Changeset 3291508
- Timestamp:
- 05/12/2025 03:54:36 AM (10 months ago)
- Location:
- dblocks-hotspot
- Files:
-
- 12 edited
- 1 copied
-
tags/1.0.3 (copied) (copied from dblocks-hotspot/trunk)
-
tags/1.0.3/.github/workflows/release.yml (modified) (1 diff)
-
tags/1.0.3/build/index.asset.php (modified) (1 diff)
-
tags/1.0.3/build/index.js (modified) (1 diff)
-
tags/1.0.3/dblocks-hotspot.php (modified) (1 diff)
-
tags/1.0.3/readme.txt (modified) (2 diffs)
-
tags/1.0.3/src/edit.js (modified) (1 diff)
-
trunk/.github/workflows/release.yml (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/dblocks-hotspot.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/edit.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dblocks-hotspot/tags/1.0.3/.github/workflows/release.yml
r3248663 r3291508 43 43 files: dblocks-hotspot.zip 44 44 env: 45 GITHUB_TOKEN: ${{ secrets. GITHUB_TOKEN }}45 GITHUB_TOKEN: ${{ secrets.WPSCIPTSTOKEN }} -
dblocks-hotspot/tags/1.0.3/build/index.asset.php
r3248650 r3291508 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' 54622f2600bac9de6e85');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '4607970839159167662f'); -
dblocks-hotspot/tags/1.0.3/build/index.js
r3248650 r3291508 1 (()=>{"use strict";var o,t={545:()=>{const o=window.wp.blocks,t=window.wp.element,e=window.wp.primitives,r=window.ReactJSXRuntime,s=(0,r.jsx)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}), l=(0,r.jsx)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})}),i=window.wp.i18n,d=window.wp.blockEditor,n=window.wp.components,a=JSON.parse('{"UU":"dblocks/hotspot"}');(0,o.registerBlockType)(a.UU,{edit:function({attributes:o,setAttributes:e}){const{hotspotNumbers:a,startNumber:b}=o,[c,h]=(0,t.useState)(!1),[p,u]=(0,t.useState)(null),[m,f]=(0,t.useState)(!1);(0,t.useEffect)((()=>{0===a.length&&e({hotspotNumbers:[{x:.5,y:.5}]})}),[]);const x=()=>{const o=[...a,{x:.5,y:.5}];e({hotspotNumbers:o})},g=(o,t)=>{e({hotspotNumbers:a.map(((e,r)=>r===o?t:e))})},w=(o,t)=>{g(o,t)},y=(0,d.useBlockProps)(),v=window?.GlobalStylesData||{},R={backgroundColor:y.style?.backgroundColor||v.color?.background,color:y.style?.color||v.color?.text,fontSize:y.style?.fontSize||v.typography?.fontSize,borderTopLeftRadius:`${y.style?.borderTopLeftRadius||y.style?.borderRadius||v.border?.radius?.topLeft||v.border?.radius||"0px"}`,borderTopRightRadius:`${y.style?.borderTopRightRadius||y.style?.borderRadius||v.border?.radius?.topRight||v.border?.radius||"0px"}`,borderBottomLeftRadius:`${y.style?.borderBottomLeftRadius||y.style?.borderRadius||v.border?.radius?.bottomLeft||v.border?.radius||"0px"}`,borderBottomRightRadius:`${y.style?.borderBottomRightRadius||y.style?.borderRadius||v.border?.radius?.bottomRight||v.border?.radius||"0px"}`,borderTop:`${y.style.borderTopWidth||v.border?.top?.width||"0px"} ${v.border?.top?.style||"solid"} ${y.style.borderTopColor||y.style.borderColor||v.border?.top?.color||"transparent"}`,borderRight:`${y.style.borderRightWidth||v.border?.right?.width||"0px"} ${v.border?.right?.style||"solid"} ${y.style.borderRightColor||y.style.borderColor||v.border?.right?.color||"transparent"}`,borderBottom:`${y.style.borderBottomWidth||v.border?.bottom?.width||"0px"} ${v.border?.bottom?.style||"solid"} ${y.style.borderBottomColor||y.style.borderColor||v.border?.bottom?.color||"transparent"}`,borderLeft:`${y.style.borderLeftWidth||v.border?.left?.width||"0px"} ${v.border?.left?.style||"solid"} ${y.style.borderLeftColor||y.style.borderColor||v.border?.left?.color||"transparent"}`,borderWidth:y.style?.borderWidth||`${v.border?.top?.width||"0px"} ${v.border?.right?.width||"0px"} ${v.border?.bottom?.width||"0px"} ${v.border?.left?.width||"0px"}`},k=(0,t.useMemo)((()=>R),[R.backgroundColor,R.color,R.fontSize,R.borderTopLeftRadius,R.borderTopRightRadius,R.borderBottomLeftRadius,R.borderBottomRightRadius,R.borderTop,R.borderRight,R.borderBottom,R.borderLeft,R.borderWidth]);return(0,t.useEffect)((()=>{e({defaultStylesBlock:R})}),[k]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(d.InspectorControls,{children:[(0,r.jsx)(d.BlockControls,{children:(0,r.jsx)(n.ToolbarGroup,{children:(0,r.jsx)(n.ToolbarButton,{icon:s,onClick:x})})}),(0,r.jsxs)(n.PanelBody,{title:(0,i.__)("Hotspots Positions","dblocks-hotspot"),children:[(0,r.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,checked:m,label:"Enable Focal Point Preview",onChange:()=>f(!m)}),(0,r.jsxs)("div",{className:"focal-point-picker-container "+(m?"":"disable-focal-preview"),children:[a.map(((o,t)=>(0,r.jsxs)("div",{className:"focal-point-picker-item",children:[(0,r.jsx)(n.FocalPointPicker,{value:o,onDragStart:o=>w(t,o),onDrag:o=>w(t,o),onChange:o=>w(t,o)}),a.length>1&&(0,r.jsx)(n.Button,{variant:"secondary",icon:l,onClick:()=>(o=>{const t=a.filter(((t,e)=>e!==o));e({hotspotNumbers:t})})(t)})]},t))),(0,r.jsx)(n.Button,{variant:"primary",onClick:x,children:"Add more"})]})]}),(0,r.jsx)(n.PanelBody,{title:(0,i.__)("Hotspots Order","dblocks-hotspot"),children:(0,r.jsx)(n.__experimentalNumberControl,{__next40pxDefaultSize:!0,isShiftStepEnabled:!0,shiftStep:10,label:(0,i.__)("Starting Number","dp-hotspot"),value:b,onChange:o=>{const t=parseInt(o,10)||1;e({startNumber:t})}})})]}),(0,r.jsxs)("div",{...y,onMouseMove:o=>{if(c&&null!==p){const t=o.currentTarget.getBoundingClientRect(),e=(o.clientX-t.left)/t.width,r=(o.clientY-t.top)/t.height,s={x:Math.max(0,Math.min(1,e)),y:Math.max(0,Math.min(1,r))};g(p,s)}},onMouseUp:()=>{h(!1),u(null)},children:[a.map(((o,t)=>(0,r.jsx)("span",{className:"drag-point",style:{...R,left:100*o.x+"%",top:100*o.y+"%",width:`calc(${R.fontSize} * 2)`,height:`calc(${R.fontSize} * 2)`},onMouseDown:()=>(o=>{h(!0),u(o)})(t),children:b+t},t))),(0,r.jsx)(d.InnerBlocks,{template:[["core/image"]]})]})]})},save:function({attributes:o}){const{hotspotNumbers:t,startNumber:e,defaultStylesBlock:s}=o;return(0,r.jsxs)("div",{...d.useBlockProps.save(),children:[t.map(((o,t)=>(0,r.jsx)("div",{className:"drag-point",style:{...s,left:100*o.x+"%",top:100*o.y+"%",width:`calc(${s?.fontSize} * 2)`,height:`calc(${s?.fontSize} * 2)`},children:e+t},t))),(0,r.jsx)(d.InnerBlocks.Content,{})]})}})}},e={};function r(o){var s=e[o];if(void 0!==s)return s.exports;var l=e[o]={exports:{}};return t[o](l,l.exports,r),l.exports}r.m=t,o=[],r.O=(t,e,s,l)=>{if(!e){var i=1/0;for(b=0;b<o.length;b++){for(var[e,s,l]=o[b],d=!0,n=0;n<e.length;n++)(!1&l||i>=l)&&Object.keys(r.O).every((o=>r.O[o](e[n])))?e.splice(n--,1):(d=!1,l<i&&(i=l));if(d){o.splice(b--,1);var a=s();void 0!==a&&(t=a)}}return t}l=l||0;for(var b=o.length;b>0&&o[b-1][2]>l;b--)o[b]=o[b-1];o[b]=[e,s,l]},r.o=(o,t)=>Object.prototype.hasOwnProperty.call(o,t),(()=>{var o={57:0,350:0};r.O.j=t=>0===o[t];var t=(t,e)=>{var s,l,[i,d,n]=e,a=0;if(i.some((t=>0!==o[t]))){for(s in d)r.o(d,s)&&(r.m[s]=d[s]);if(n)var b=n(r)}for(t&&t(e);a<i.length;a++)l=i[a],r.o(o,l)&&o[l]&&o[l][0](),o[l]=0;return r.O(b)},e=globalThis.webpackChunkdblocks_hotspot=globalThis.webpackChunkdblocks_hotspot||[];e.forEach(t.bind(null,0)),e.push=t.bind(null,e.push.bind(e))})();var s=r.O(void 0,[350],(()=>r(545)));s=r.O(s)})();1 (()=>{"use strict";var o,t={545:()=>{const o=window.wp.blocks,t=window.wp.element,e=window.wp.primitives,r=window.ReactJSXRuntime,s=(0,r.jsx)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),i=(0,r.jsx)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})}),l=window.wp.i18n,d=window.wp.blockEditor,n=window.wp.components,a=JSON.parse('{"UU":"dblocks/hotspot"}');(0,o.registerBlockType)(a.UU,{edit:function({attributes:o,setAttributes:e}){const{hotspotNumbers:a,startNumber:b}=o,[c,h]=(0,t.useState)(!1),[p,u]=(0,t.useState)(null),[m,f]=(0,t.useState)(!1);(0,t.useEffect)((()=>{0===a.length&&e({hotspotNumbers:[{x:.5,y:.5}]})}),[]);const x=()=>{const o=[...a,{x:.5,y:.5}];e({hotspotNumbers:o})},g=(o,t)=>{e({hotspotNumbers:a.map(((e,r)=>r===o?t:e))})},w=(o,t)=>{g(o,t)},y=(0,d.useBlockProps)(),v=window?.GlobalStylesData||{},R={backgroundColor:y.style?.backgroundColor||v.color?.background,color:y.style?.color||v.color?.text,fontSize:y.style?.fontSize||v.typography?.fontSize,borderTopLeftRadius:`${y.style?.borderTopLeftRadius||y.style?.borderRadius||v.border?.radius?.topLeft||v.border?.radius||"0px"}`,borderTopRightRadius:`${y.style?.borderTopRightRadius||y.style?.borderRadius||v.border?.radius?.topRight||v.border?.radius||"0px"}`,borderBottomLeftRadius:`${y.style?.borderBottomLeftRadius||y.style?.borderRadius||v.border?.radius?.bottomLeft||v.border?.radius||"0px"}`,borderBottomRightRadius:`${y.style?.borderBottomRightRadius||y.style?.borderRadius||v.border?.radius?.bottomRight||v.border?.radius||"0px"}`,borderTop:`${y.style.borderTopWidth||v.border?.top?.width||"0px"} ${v.border?.top?.style||"solid"} ${y.style.borderTopColor||y.style.borderColor||v.border?.top?.color||"transparent"}`,borderRight:`${y.style.borderRightWidth||v.border?.right?.width||"0px"} ${v.border?.right?.style||"solid"} ${y.style.borderRightColor||y.style.borderColor||v.border?.right?.color||"transparent"}`,borderBottom:`${y.style.borderBottomWidth||v.border?.bottom?.width||"0px"} ${v.border?.bottom?.style||"solid"} ${y.style.borderBottomColor||y.style.borderColor||v.border?.bottom?.color||"transparent"}`,borderLeft:`${y.style.borderLeftWidth||v.border?.left?.width||"0px"} ${v.border?.left?.style||"solid"} ${y.style.borderLeftColor||y.style.borderColor||v.border?.left?.color||"transparent"}`,borderWidth:y.style?.borderWidth||`${v.border?.top?.width||"0px"} ${v.border?.right?.width||"0px"} ${v.border?.bottom?.width||"0px"} ${v.border?.left?.width||"0px"}`},k=(0,t.useMemo)((()=>R),[R.backgroundColor,R.color,R.fontSize,R.borderTopLeftRadius,R.borderTopRightRadius,R.borderBottomLeftRadius,R.borderBottomRightRadius,R.borderTop,R.borderRight,R.borderBottom,R.borderLeft,R.borderWidth]);return(0,t.useEffect)((()=>{e({defaultStylesBlock:R})}),[k]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(d.InspectorControls,{children:[(0,r.jsx)(d.BlockControls,{children:(0,r.jsx)(n.ToolbarGroup,{children:(0,r.jsx)(n.ToolbarButton,{icon:s,onClick:x})})}),(0,r.jsxs)(n.PanelBody,{title:(0,l.__)("Hotspots Positions","dblocks-hotspot"),children:[(0,r.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,checked:m,label:"Enable Focal Point Preview",onChange:()=>f(!m)}),(0,r.jsxs)("div",{className:"focal-point-picker-container "+(m?"":"disable-focal-preview"),children:[a.map(((o,t)=>(0,r.jsxs)("div",{className:"focal-point-picker-item",children:[(0,r.jsx)(n.FocalPointPicker,{value:o,onDragStart:o=>w(t,o),onDrag:o=>w(t,o),onChange:o=>w(t,o),__nextHasNoMarginBottom:!0}),a.length>1&&(0,r.jsx)(n.Button,{variant:"secondary",icon:i,onClick:()=>(o=>{const t=a.filter(((t,e)=>e!==o));e({hotspotNumbers:t})})(t)})]},t))),(0,r.jsx)(n.Button,{variant:"primary",onClick:x,children:"Add more"})]})]}),(0,r.jsx)(n.PanelBody,{title:(0,l.__)("Hotspots Order","dblocks-hotspot"),children:(0,r.jsx)(n.__experimentalNumberControl,{__next40pxDefaultSize:!0,isShiftStepEnabled:!0,shiftStep:10,label:(0,l.__)("Starting Number","dp-hotspot"),value:b,onChange:o=>{const t=parseInt(o,10)||1;e({startNumber:t})}})})]}),(0,r.jsxs)("div",{...y,onMouseMove:o=>{if(c&&null!==p){const t=o.currentTarget.getBoundingClientRect(),e=(o.clientX-t.left)/t.width,r=(o.clientY-t.top)/t.height,s={x:Math.max(0,Math.min(1,e)),y:Math.max(0,Math.min(1,r))};g(p,s)}},onMouseUp:()=>{h(!1),u(null)},children:[a.map(((o,t)=>(0,r.jsx)("span",{className:"drag-point",style:{...R,left:100*o.x+"%",top:100*o.y+"%",width:`calc(${R.fontSize} * 2)`,height:`calc(${R.fontSize} * 2)`},onMouseDown:()=>(o=>{h(!0),u(o)})(t),children:b+t},t))),(0,r.jsx)(d.InnerBlocks,{template:[["core/image"]]})]})]})},save:function({attributes:o}){const{hotspotNumbers:t,startNumber:e,defaultStylesBlock:s}=o;return(0,r.jsxs)("div",{...d.useBlockProps.save(),children:[t.map(((o,t)=>(0,r.jsx)("div",{className:"drag-point",style:{...s,left:100*o.x+"%",top:100*o.y+"%",width:`calc(${s?.fontSize} * 2)`,height:`calc(${s?.fontSize} * 2)`},children:e+t},t))),(0,r.jsx)(d.InnerBlocks.Content,{})]})}})}},e={};function r(o){var s=e[o];if(void 0!==s)return s.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,r),i.exports}r.m=t,o=[],r.O=(t,e,s,i)=>{if(!e){var l=1/0;for(b=0;b<o.length;b++){for(var[e,s,i]=o[b],d=!0,n=0;n<e.length;n++)(!1&i||l>=i)&&Object.keys(r.O).every((o=>r.O[o](e[n])))?e.splice(n--,1):(d=!1,i<l&&(l=i));if(d){o.splice(b--,1);var a=s();void 0!==a&&(t=a)}}return t}i=i||0;for(var b=o.length;b>0&&o[b-1][2]>i;b--)o[b]=o[b-1];o[b]=[e,s,i]},r.o=(o,t)=>Object.prototype.hasOwnProperty.call(o,t),(()=>{var o={57:0,350:0};r.O.j=t=>0===o[t];var t=(t,e)=>{var s,i,[l,d,n]=e,a=0;if(l.some((t=>0!==o[t]))){for(s in d)r.o(d,s)&&(r.m[s]=d[s]);if(n)var b=n(r)}for(t&&t(e);a<l.length;a++)i=l[a],r.o(o,i)&&o[i]&&o[i][0](),o[i]=0;return r.O(b)},e=globalThis.webpackChunkdblocks_hotspot=globalThis.webpackChunkdblocks_hotspot||[];e.forEach(t.bind(null,0)),e.push=t.bind(null,e.push.bind(e))})();var s=r.O(void 0,[350],(()=>r(545)));s=r.O(s)})(); -
dblocks-hotspot/tags/1.0.3/dblocks-hotspot.php
r3248663 r3291508 6 6 * Requires at least: 6.3 7 7 * Requires PHP: 7.2 8 * Version: 1.0. 28 * Version: 1.0.3 9 9 * Author: DPlugins 10 10 * Author URI: https://dplugins.com/ -
dblocks-hotspot/tags/1.0.3/readme.txt
r3248663 r3291508 2 2 Contributors: DBlocks, DPlugins, Marko Krstic 3 3 Tags: block, dblocks, hotspot, image, tag image 4 Tested up to: 6. 7.25 Stable tag: 1.0. 24 Tested up to: 6.8.1 5 Stable tag: 1.0.3 6 6 License: GPL-2.0-or-later 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 37 37 == Changelog == 38 38 39 = 1.0.3 = 40 * Bump test 41 39 42 = 1.0.2 = 40 43 * Bump test -
dblocks-hotspot/tags/1.0.3/src/edit.js
r3248650 r3291508 149 149 onDrag={(newFocalPoint) => handleDrag(index, newFocalPoint)} 150 150 onChange={(newFocalPoint) => handleDrag(index, newFocalPoint)} 151 __nextHasNoMarginBottom 151 152 /> 152 153 {hotspotNumbers.length > 1 && ( -
dblocks-hotspot/trunk/.github/workflows/release.yml
r3248663 r3291508 43 43 files: dblocks-hotspot.zip 44 44 env: 45 GITHUB_TOKEN: ${{ secrets. GITHUB_TOKEN }}45 GITHUB_TOKEN: ${{ secrets.WPSCIPTSTOKEN }} -
dblocks-hotspot/trunk/build/index.asset.php
r3248650 r3291508 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => ' 54622f2600bac9de6e85');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '4607970839159167662f'); -
dblocks-hotspot/trunk/build/index.js
r3248650 r3291508 1 (()=>{"use strict";var o,t={545:()=>{const o=window.wp.blocks,t=window.wp.element,e=window.wp.primitives,r=window.ReactJSXRuntime,s=(0,r.jsx)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}), l=(0,r.jsx)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})}),i=window.wp.i18n,d=window.wp.blockEditor,n=window.wp.components,a=JSON.parse('{"UU":"dblocks/hotspot"}');(0,o.registerBlockType)(a.UU,{edit:function({attributes:o,setAttributes:e}){const{hotspotNumbers:a,startNumber:b}=o,[c,h]=(0,t.useState)(!1),[p,u]=(0,t.useState)(null),[m,f]=(0,t.useState)(!1);(0,t.useEffect)((()=>{0===a.length&&e({hotspotNumbers:[{x:.5,y:.5}]})}),[]);const x=()=>{const o=[...a,{x:.5,y:.5}];e({hotspotNumbers:o})},g=(o,t)=>{e({hotspotNumbers:a.map(((e,r)=>r===o?t:e))})},w=(o,t)=>{g(o,t)},y=(0,d.useBlockProps)(),v=window?.GlobalStylesData||{},R={backgroundColor:y.style?.backgroundColor||v.color?.background,color:y.style?.color||v.color?.text,fontSize:y.style?.fontSize||v.typography?.fontSize,borderTopLeftRadius:`${y.style?.borderTopLeftRadius||y.style?.borderRadius||v.border?.radius?.topLeft||v.border?.radius||"0px"}`,borderTopRightRadius:`${y.style?.borderTopRightRadius||y.style?.borderRadius||v.border?.radius?.topRight||v.border?.radius||"0px"}`,borderBottomLeftRadius:`${y.style?.borderBottomLeftRadius||y.style?.borderRadius||v.border?.radius?.bottomLeft||v.border?.radius||"0px"}`,borderBottomRightRadius:`${y.style?.borderBottomRightRadius||y.style?.borderRadius||v.border?.radius?.bottomRight||v.border?.radius||"0px"}`,borderTop:`${y.style.borderTopWidth||v.border?.top?.width||"0px"} ${v.border?.top?.style||"solid"} ${y.style.borderTopColor||y.style.borderColor||v.border?.top?.color||"transparent"}`,borderRight:`${y.style.borderRightWidth||v.border?.right?.width||"0px"} ${v.border?.right?.style||"solid"} ${y.style.borderRightColor||y.style.borderColor||v.border?.right?.color||"transparent"}`,borderBottom:`${y.style.borderBottomWidth||v.border?.bottom?.width||"0px"} ${v.border?.bottom?.style||"solid"} ${y.style.borderBottomColor||y.style.borderColor||v.border?.bottom?.color||"transparent"}`,borderLeft:`${y.style.borderLeftWidth||v.border?.left?.width||"0px"} ${v.border?.left?.style||"solid"} ${y.style.borderLeftColor||y.style.borderColor||v.border?.left?.color||"transparent"}`,borderWidth:y.style?.borderWidth||`${v.border?.top?.width||"0px"} ${v.border?.right?.width||"0px"} ${v.border?.bottom?.width||"0px"} ${v.border?.left?.width||"0px"}`},k=(0,t.useMemo)((()=>R),[R.backgroundColor,R.color,R.fontSize,R.borderTopLeftRadius,R.borderTopRightRadius,R.borderBottomLeftRadius,R.borderBottomRightRadius,R.borderTop,R.borderRight,R.borderBottom,R.borderLeft,R.borderWidth]);return(0,t.useEffect)((()=>{e({defaultStylesBlock:R})}),[k]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(d.InspectorControls,{children:[(0,r.jsx)(d.BlockControls,{children:(0,r.jsx)(n.ToolbarGroup,{children:(0,r.jsx)(n.ToolbarButton,{icon:s,onClick:x})})}),(0,r.jsxs)(n.PanelBody,{title:(0,i.__)("Hotspots Positions","dblocks-hotspot"),children:[(0,r.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,checked:m,label:"Enable Focal Point Preview",onChange:()=>f(!m)}),(0,r.jsxs)("div",{className:"focal-point-picker-container "+(m?"":"disable-focal-preview"),children:[a.map(((o,t)=>(0,r.jsxs)("div",{className:"focal-point-picker-item",children:[(0,r.jsx)(n.FocalPointPicker,{value:o,onDragStart:o=>w(t,o),onDrag:o=>w(t,o),onChange:o=>w(t,o)}),a.length>1&&(0,r.jsx)(n.Button,{variant:"secondary",icon:l,onClick:()=>(o=>{const t=a.filter(((t,e)=>e!==o));e({hotspotNumbers:t})})(t)})]},t))),(0,r.jsx)(n.Button,{variant:"primary",onClick:x,children:"Add more"})]})]}),(0,r.jsx)(n.PanelBody,{title:(0,i.__)("Hotspots Order","dblocks-hotspot"),children:(0,r.jsx)(n.__experimentalNumberControl,{__next40pxDefaultSize:!0,isShiftStepEnabled:!0,shiftStep:10,label:(0,i.__)("Starting Number","dp-hotspot"),value:b,onChange:o=>{const t=parseInt(o,10)||1;e({startNumber:t})}})})]}),(0,r.jsxs)("div",{...y,onMouseMove:o=>{if(c&&null!==p){const t=o.currentTarget.getBoundingClientRect(),e=(o.clientX-t.left)/t.width,r=(o.clientY-t.top)/t.height,s={x:Math.max(0,Math.min(1,e)),y:Math.max(0,Math.min(1,r))};g(p,s)}},onMouseUp:()=>{h(!1),u(null)},children:[a.map(((o,t)=>(0,r.jsx)("span",{className:"drag-point",style:{...R,left:100*o.x+"%",top:100*o.y+"%",width:`calc(${R.fontSize} * 2)`,height:`calc(${R.fontSize} * 2)`},onMouseDown:()=>(o=>{h(!0),u(o)})(t),children:b+t},t))),(0,r.jsx)(d.InnerBlocks,{template:[["core/image"]]})]})]})},save:function({attributes:o}){const{hotspotNumbers:t,startNumber:e,defaultStylesBlock:s}=o;return(0,r.jsxs)("div",{...d.useBlockProps.save(),children:[t.map(((o,t)=>(0,r.jsx)("div",{className:"drag-point",style:{...s,left:100*o.x+"%",top:100*o.y+"%",width:`calc(${s?.fontSize} * 2)`,height:`calc(${s?.fontSize} * 2)`},children:e+t},t))),(0,r.jsx)(d.InnerBlocks.Content,{})]})}})}},e={};function r(o){var s=e[o];if(void 0!==s)return s.exports;var l=e[o]={exports:{}};return t[o](l,l.exports,r),l.exports}r.m=t,o=[],r.O=(t,e,s,l)=>{if(!e){var i=1/0;for(b=0;b<o.length;b++){for(var[e,s,l]=o[b],d=!0,n=0;n<e.length;n++)(!1&l||i>=l)&&Object.keys(r.O).every((o=>r.O[o](e[n])))?e.splice(n--,1):(d=!1,l<i&&(i=l));if(d){o.splice(b--,1);var a=s();void 0!==a&&(t=a)}}return t}l=l||0;for(var b=o.length;b>0&&o[b-1][2]>l;b--)o[b]=o[b-1];o[b]=[e,s,l]},r.o=(o,t)=>Object.prototype.hasOwnProperty.call(o,t),(()=>{var o={57:0,350:0};r.O.j=t=>0===o[t];var t=(t,e)=>{var s,l,[i,d,n]=e,a=0;if(i.some((t=>0!==o[t]))){for(s in d)r.o(d,s)&&(r.m[s]=d[s]);if(n)var b=n(r)}for(t&&t(e);a<i.length;a++)l=i[a],r.o(o,l)&&o[l]&&o[l][0](),o[l]=0;return r.O(b)},e=globalThis.webpackChunkdblocks_hotspot=globalThis.webpackChunkdblocks_hotspot||[];e.forEach(t.bind(null,0)),e.push=t.bind(null,e.push.bind(e))})();var s=r.O(void 0,[350],(()=>r(545)));s=r.O(s)})();1 (()=>{"use strict";var o,t={545:()=>{const o=window.wp.blocks,t=window.wp.element,e=window.wp.primitives,r=window.ReactJSXRuntime,s=(0,r.jsx)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),i=(0,r.jsx)(e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})}),l=window.wp.i18n,d=window.wp.blockEditor,n=window.wp.components,a=JSON.parse('{"UU":"dblocks/hotspot"}');(0,o.registerBlockType)(a.UU,{edit:function({attributes:o,setAttributes:e}){const{hotspotNumbers:a,startNumber:b}=o,[c,h]=(0,t.useState)(!1),[p,u]=(0,t.useState)(null),[m,f]=(0,t.useState)(!1);(0,t.useEffect)((()=>{0===a.length&&e({hotspotNumbers:[{x:.5,y:.5}]})}),[]);const x=()=>{const o=[...a,{x:.5,y:.5}];e({hotspotNumbers:o})},g=(o,t)=>{e({hotspotNumbers:a.map(((e,r)=>r===o?t:e))})},w=(o,t)=>{g(o,t)},y=(0,d.useBlockProps)(),v=window?.GlobalStylesData||{},R={backgroundColor:y.style?.backgroundColor||v.color?.background,color:y.style?.color||v.color?.text,fontSize:y.style?.fontSize||v.typography?.fontSize,borderTopLeftRadius:`${y.style?.borderTopLeftRadius||y.style?.borderRadius||v.border?.radius?.topLeft||v.border?.radius||"0px"}`,borderTopRightRadius:`${y.style?.borderTopRightRadius||y.style?.borderRadius||v.border?.radius?.topRight||v.border?.radius||"0px"}`,borderBottomLeftRadius:`${y.style?.borderBottomLeftRadius||y.style?.borderRadius||v.border?.radius?.bottomLeft||v.border?.radius||"0px"}`,borderBottomRightRadius:`${y.style?.borderBottomRightRadius||y.style?.borderRadius||v.border?.radius?.bottomRight||v.border?.radius||"0px"}`,borderTop:`${y.style.borderTopWidth||v.border?.top?.width||"0px"} ${v.border?.top?.style||"solid"} ${y.style.borderTopColor||y.style.borderColor||v.border?.top?.color||"transparent"}`,borderRight:`${y.style.borderRightWidth||v.border?.right?.width||"0px"} ${v.border?.right?.style||"solid"} ${y.style.borderRightColor||y.style.borderColor||v.border?.right?.color||"transparent"}`,borderBottom:`${y.style.borderBottomWidth||v.border?.bottom?.width||"0px"} ${v.border?.bottom?.style||"solid"} ${y.style.borderBottomColor||y.style.borderColor||v.border?.bottom?.color||"transparent"}`,borderLeft:`${y.style.borderLeftWidth||v.border?.left?.width||"0px"} ${v.border?.left?.style||"solid"} ${y.style.borderLeftColor||y.style.borderColor||v.border?.left?.color||"transparent"}`,borderWidth:y.style?.borderWidth||`${v.border?.top?.width||"0px"} ${v.border?.right?.width||"0px"} ${v.border?.bottom?.width||"0px"} ${v.border?.left?.width||"0px"}`},k=(0,t.useMemo)((()=>R),[R.backgroundColor,R.color,R.fontSize,R.borderTopLeftRadius,R.borderTopRightRadius,R.borderBottomLeftRadius,R.borderBottomRightRadius,R.borderTop,R.borderRight,R.borderBottom,R.borderLeft,R.borderWidth]);return(0,t.useEffect)((()=>{e({defaultStylesBlock:R})}),[k]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(d.InspectorControls,{children:[(0,r.jsx)(d.BlockControls,{children:(0,r.jsx)(n.ToolbarGroup,{children:(0,r.jsx)(n.ToolbarButton,{icon:s,onClick:x})})}),(0,r.jsxs)(n.PanelBody,{title:(0,l.__)("Hotspots Positions","dblocks-hotspot"),children:[(0,r.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,checked:m,label:"Enable Focal Point Preview",onChange:()=>f(!m)}),(0,r.jsxs)("div",{className:"focal-point-picker-container "+(m?"":"disable-focal-preview"),children:[a.map(((o,t)=>(0,r.jsxs)("div",{className:"focal-point-picker-item",children:[(0,r.jsx)(n.FocalPointPicker,{value:o,onDragStart:o=>w(t,o),onDrag:o=>w(t,o),onChange:o=>w(t,o),__nextHasNoMarginBottom:!0}),a.length>1&&(0,r.jsx)(n.Button,{variant:"secondary",icon:i,onClick:()=>(o=>{const t=a.filter(((t,e)=>e!==o));e({hotspotNumbers:t})})(t)})]},t))),(0,r.jsx)(n.Button,{variant:"primary",onClick:x,children:"Add more"})]})]}),(0,r.jsx)(n.PanelBody,{title:(0,l.__)("Hotspots Order","dblocks-hotspot"),children:(0,r.jsx)(n.__experimentalNumberControl,{__next40pxDefaultSize:!0,isShiftStepEnabled:!0,shiftStep:10,label:(0,l.__)("Starting Number","dp-hotspot"),value:b,onChange:o=>{const t=parseInt(o,10)||1;e({startNumber:t})}})})]}),(0,r.jsxs)("div",{...y,onMouseMove:o=>{if(c&&null!==p){const t=o.currentTarget.getBoundingClientRect(),e=(o.clientX-t.left)/t.width,r=(o.clientY-t.top)/t.height,s={x:Math.max(0,Math.min(1,e)),y:Math.max(0,Math.min(1,r))};g(p,s)}},onMouseUp:()=>{h(!1),u(null)},children:[a.map(((o,t)=>(0,r.jsx)("span",{className:"drag-point",style:{...R,left:100*o.x+"%",top:100*o.y+"%",width:`calc(${R.fontSize} * 2)`,height:`calc(${R.fontSize} * 2)`},onMouseDown:()=>(o=>{h(!0),u(o)})(t),children:b+t},t))),(0,r.jsx)(d.InnerBlocks,{template:[["core/image"]]})]})]})},save:function({attributes:o}){const{hotspotNumbers:t,startNumber:e,defaultStylesBlock:s}=o;return(0,r.jsxs)("div",{...d.useBlockProps.save(),children:[t.map(((o,t)=>(0,r.jsx)("div",{className:"drag-point",style:{...s,left:100*o.x+"%",top:100*o.y+"%",width:`calc(${s?.fontSize} * 2)`,height:`calc(${s?.fontSize} * 2)`},children:e+t},t))),(0,r.jsx)(d.InnerBlocks.Content,{})]})}})}},e={};function r(o){var s=e[o];if(void 0!==s)return s.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,r),i.exports}r.m=t,o=[],r.O=(t,e,s,i)=>{if(!e){var l=1/0;for(b=0;b<o.length;b++){for(var[e,s,i]=o[b],d=!0,n=0;n<e.length;n++)(!1&i||l>=i)&&Object.keys(r.O).every((o=>r.O[o](e[n])))?e.splice(n--,1):(d=!1,i<l&&(l=i));if(d){o.splice(b--,1);var a=s();void 0!==a&&(t=a)}}return t}i=i||0;for(var b=o.length;b>0&&o[b-1][2]>i;b--)o[b]=o[b-1];o[b]=[e,s,i]},r.o=(o,t)=>Object.prototype.hasOwnProperty.call(o,t),(()=>{var o={57:0,350:0};r.O.j=t=>0===o[t];var t=(t,e)=>{var s,i,[l,d,n]=e,a=0;if(l.some((t=>0!==o[t]))){for(s in d)r.o(d,s)&&(r.m[s]=d[s]);if(n)var b=n(r)}for(t&&t(e);a<l.length;a++)i=l[a],r.o(o,i)&&o[i]&&o[i][0](),o[i]=0;return r.O(b)},e=globalThis.webpackChunkdblocks_hotspot=globalThis.webpackChunkdblocks_hotspot||[];e.forEach(t.bind(null,0)),e.push=t.bind(null,e.push.bind(e))})();var s=r.O(void 0,[350],(()=>r(545)));s=r.O(s)})(); -
dblocks-hotspot/trunk/dblocks-hotspot.php
r3248663 r3291508 6 6 * Requires at least: 6.3 7 7 * Requires PHP: 7.2 8 * Version: 1.0. 28 * Version: 1.0.3 9 9 * Author: DPlugins 10 10 * Author URI: https://dplugins.com/ -
dblocks-hotspot/trunk/readme.txt
r3248663 r3291508 2 2 Contributors: DBlocks, DPlugins, Marko Krstic 3 3 Tags: block, dblocks, hotspot, image, tag image 4 Tested up to: 6. 7.25 Stable tag: 1.0. 24 Tested up to: 6.8.1 5 Stable tag: 1.0.3 6 6 License: GPL-2.0-or-later 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 37 37 == Changelog == 38 38 39 = 1.0.3 = 40 * Bump test 41 39 42 = 1.0.2 = 40 43 * Bump test -
dblocks-hotspot/trunk/src/edit.js
r3248650 r3291508 149 149 onDrag={(newFocalPoint) => handleDrag(index, newFocalPoint)} 150 150 onChange={(newFocalPoint) => handleDrag(index, newFocalPoint)} 151 __nextHasNoMarginBottom 151 152 /> 152 153 {hotspotNumbers.length > 1 && (
Note: See TracChangeset
for help on using the changeset viewer.