Changeset 3460591
- Timestamp:
- 02/13/2026 08:59:23 AM (7 weeks ago)
- Location:
- zypento-blocks/trunk
- Files:
-
- 14 edited
-
README.txt (modified) (1 diff)
-
assets/css/blockeditor.css (modified) (1 diff)
-
assets/css/src/components/simple-slider.scss (modified) (2 diffs)
-
assets/js/blockeditor.js (modified) (1 diff)
-
assets/js/blocks/simple-slider/block.json (modified) (1 diff)
-
assets/js/blocks/simple-slider/style.css (modified) (1 diff)
-
assets/js/src/admin/components/simpleSliderControl.js (modified) (2 diffs)
-
assets/js/src/blockeditor.js (modified) (1 diff)
-
assets/js/src/blocks/simple-slider/block.json (modified) (1 diff)
-
assets/js/src/blocks/simple-slider/editor.js (modified) (1 diff)
-
assets/js/src/blocks/simple-slider/style.scss (modified) (1 diff)
-
includes/core/class-blocks.php (modified) (1 diff)
-
includes/features/class-simple-slider.php (modified) (2 diffs)
-
zypento-blocks.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
zypento-blocks/trunk/README.txt
r3456914 r3460591 5 5 Requires at least: 6.0 6 6 Tested up to: 6.9 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later -
zypento-blocks/trunk/assets/css/blockeditor.css
r3456914 r3460591 1 .zypento-blocks-simple-slider-container{width:90%;margin:2em auto;background:rgba(0,0,0,.05);border-radius:6px;padding:2em 1em}.zypento-blocks-simple-slider-slide{position:relative;background:rgba(0,0,0,.05);margin:0 0 10px 0}.zypento-blocks-simple-slider-slide>.zypento-heading{padding:10px 60px 10px 10px;margin:0}.zypento-blocks-simple-slider-slide>.zypento-menu{ width:16px;height:16px;position:absolute;top:10px;right:10px;display:inline-block;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16px' height='16px' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E") center no-repeat}.zypento-blocks-simple-slider-slide>.zypento-delete{width:16px;height:16px;position:absolute;top:10px;right:40px;display:inline-block;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16px' height='16px' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M17 3.34a10 10 0 1 1-14.995 8.984L2 12l.005-.324A10 10 0 0 1 17 3.34m-6.489 5.8a1 1 0 0 0-1.218 1.567L10.585 12l-1.292 1.293l-.083.094a1 1 0 0 0 1.497 1.32L12 13.415l1.293 1.292l.094.083a1 1 0 0 0 1.32-1.497L13.415 12l1.292-1.293l.083-.094a1 1 0 0 0-1.497-1.32L12 10.585l-1.293-1.292l-.094-.083z'/%3E%3C/svg%3E") center no-repeat}.zypento-blocks-simple-slider-slide .zypento-blocks-simple-slider-slide-content{padding:10px}.zypento-blocks-simple-slider-slide .zypento-blocks-simple-slider-slide-content .zypento-item{padding:10px;background:rgba(0,0,0,.05);border-radius:4px;margin:0 0 10px 0}.zypento-blocks-simple-slider-slide .zypento-blocks-simple-slider-slide-content .zypento-item>label{margin:0 0 10px 0}.zypento-blocks-simple-slider-slide .zypento-colorpicker-wrap .components-color-picker{width:100%;max-width:100%;box-sizing:border-box}.zypento-blocks-simple-slider-slide .zypento-colorpicker-wrap .components-color-picker .react-colorful{max-width:100%}.zypento-blocks-simple-slider-slide .zypento-colorpicker-wrap .components-color-picker .react-colorful__hue{max-width:100%}.zypento-blocks-simple-slider-add-slide{margin:10px 0 0 0;text-align:center}.zypento-blocks-simple-slider-add-slide>span{display:inline-block;padding:5px 20px;background:#000;border-radius:2em;color:#fff;cursor:pointer}1 .zypento-blocks-simple-slider-container{width:90%;margin:2em auto;background:rgba(0,0,0,.05);border-radius:6px;padding:2em 1em}.zypento-blocks-simple-slider-slide{position:relative;background:rgba(0,0,0,.05);margin:0 0 10px 0}.zypento-blocks-simple-slider-slide>.zypento-heading{padding:10px 60px 10px 10px;margin:0}.zypento-blocks-simple-slider-slide>.zypento-menu{cursor:pointer;width:16px;height:16px;position:absolute;top:10px;right:10px;display:inline-block;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16px' height='16px' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E") center no-repeat}.zypento-blocks-simple-slider-slide>.zypento-delete{cursor:pointer;width:16px;height:16px;position:absolute;top:10px;right:40px;display:inline-block;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16px' height='16px' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M17 3.34a10 10 0 1 1-14.995 8.984L2 12l.005-.324A10 10 0 0 1 17 3.34m-6.489 5.8a1 1 0 0 0-1.218 1.567L10.585 12l-1.292 1.293l-.083.094a1 1 0 0 0 1.497 1.32L12 13.415l1.293 1.292l.094.083a1 1 0 0 0 1.32-1.497L13.415 12l1.292-1.293l.083-.094a1 1 0 0 0-1.497-1.32L12 10.585l-1.293-1.292l-.094-.083z'/%3E%3C/svg%3E") center no-repeat}.zypento-blocks-simple-slider-slide .zypento-blocks-simple-slider-slide-content{padding:10px}.zypento-blocks-simple-slider-slide .zypento-blocks-simple-slider-slide-content .zypento-item{padding:10px;background:rgba(0,0,0,.05);border-radius:4px;margin:0 0 10px 0}.zypento-blocks-simple-slider-slide .zypento-blocks-simple-slider-slide-content .zypento-item>label{margin:0 0 10px 0}.zypento-blocks-simple-slider-slide .zypento-colorpicker-wrap .components-color-picker{width:100%;max-width:100%;box-sizing:border-box}.zypento-blocks-simple-slider-slide .zypento-colorpicker-wrap .components-color-picker .react-colorful{max-width:100%}.zypento-blocks-simple-slider-slide .zypento-colorpicker-wrap .components-color-picker .react-colorful__hue{max-width:100%}.zypento-blocks-simple-slider-add-slide{margin:10px 0 0 0;text-align:center}.zypento-blocks-simple-slider-add-slide>span{display:inline-block;padding:5px 20px;background:#000;border-radius:2em;color:#fff;cursor:pointer} -
zypento-blocks/trunk/assets/css/src/components/simple-slider.scss
r3456914 r3460591 15 15 } 16 16 &>.zypento-menu{ 17 cursor: pointer; 17 18 width: 16px; 18 19 height: 16px; … … 24 25 } 25 26 &>.zypento-delete{ 27 cursor: pointer; 26 28 width: 16px; 27 29 height: 16px; -
zypento-blocks/trunk/assets/js/blockeditor.js
r3456914 r3460591 1 1 /*! For license information please see blockeditor.js.LICENSE.txt */ 2 (()=>{"use strict";const e=JSON.parse('{"UU":"zypento-blocks/woo-collection"}');function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,c=[],i=!0, u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;i=!1}else for(;!(i=(o=l.call(n)).done)&&(c.push(o.value),c.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{if(!i&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return c}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var l=wp.i18n.__,a=wp.blocks,c=(a.registerBlockCollection,a.registerBlockType),i=(a.query,wp.blockEditor),u=(i.RichText,i.InspectorControls),s=i.useBlockProps,d=(i.InnerBlocks,i.BlockControls,i.PlainText,i.PanelColorSettings,wp.serverSideRender),p=wp.components,m=p.PanelBody,f=(p.Icon,p.ColorPicker,p.GradientPicker,p.TextControl,p.SelectControl),b=p.ToggleControl;c(e.UU,{edit:function(e){var o=e.attributes,r=e.setAttributes,a=[{label:l("Select a category","zypento-blocks"),value:""}].concat(n(Object.entries(zypentoBlocksEditorVariables.categories).map(function(e){var n=t(e,2),o=n[0];return{label:n[1],value:o}}))),c=[{label:l("Select a Tag","zypento-blocks"),value:""}].concat(n(Object.entries(zypentoBlocksEditorVariables.tags).map(function(e){var n=t(e,2),o=n[0];return{label:n[1],value:o}}))),i=l("Select a category","zypento-blocks"),p=l("Select a Tag","zypento-blocks"),y="tag"!==o.type;return React.createElement(React.Fragment,null,React.createElement(u,null,React.createElement(m,{title:l("Woo Category/Tag","zypento-blocks"),initialOpen:!1},React.createElement(b,{label:l(y?"Category":"Tag","zypento-blocks"),checked:y,onChange:function(e){return r({type:e?"category":"tag",term:""})},help:l(y?"Showing categories":"Showing tags","zypento-blocks")}),React.createElement(f,{label:y?i:p,value:o.term,options:y?a:c,onChange:function(e){return r({term:e})}}))),React.createElement("div",s(),React.createElement(d,{block:"zypento/woo-collection",attributes:o})))},save:function(){return null}});const y=JSON.parse('{"UU":"zypento-blocks/table-of-contents"}');var v=wp.i18n.__,g=wp.blocks,k=(g.registerBlockCollection,g.registerBlockType),h=(g.query,wp.blockEditor),E=(h.RichText,h.InspectorControls),C=h.useBlockProps,R=(h.InnerBlocks,h.BlockControls,h.PlainText,h.PanelColorSettings,wp.serverSideRender,wp.components),z=R.PanelBody,S=(R.Icon,R.ColorPicker,R.GradientPicker,R.TextControl);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,c=[],i=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;i=!1}else for(;!(i=(o=l.call(n)).done)&&(c.push(o.value),c.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{if(!i&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function x(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function l(n,o,r,l){var i=o&&o.prototype instanceof c?o:c,u=Object.create(i.prototype);return P(u,"_invoke",function(n,o,r){var l,c,i,u=0,s=r||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return l=t,c=0,i=e,p.n=n,a}};function m(n,o){for(c=n,i=o,t=0;!d&&u&&!r&&t<s.length;t++){var r,l=s[t],m=p.p,f=l[2];n>3?(r=f===o)&&(i=l[(c=l[4])?5:(c=3,3)],l[4]=l[5]=e):l[0]<=m&&((r=n<2&&m<l[1])?(c=0,p.v=o,p.n=l[1]):m<f&&(r=n<3||l[0]>o||o>f)&&(l[4]=n,l[5]=o,p.n=f,c=0))}if(r||n>1)return a;throw d=!0,o}return function(r,s,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===s&&m(s,f),c=s,i=f;(t=c<2?e:i)||!d;){l||(c?c<3?(c>1&&(p.n=-1),m(c,i)):p.n=i:p.v=i);try{if(u=2,l){if(c||(r="next"),t=l[r]){if(!(t=t.call(l,i)))throw TypeError("iterator result is not an object");if(!t.done)return t;i=t.value,c<2&&(c=0)}else 1===c&&(t=l.return)&&t.call(l),c<2&&(i=TypeError("The iterator does not provide a '"+r+"' method"),c=1);l=e}else if((t=(d=p.n<0)?i:n.call(o,p))!==a)break}catch(t){l=e,c=1,i=t}finally{u=1}}return{value:t,done:d}}}(n,r,l),!0),u}var a={};function c(){}function i(){}function u(){}t=Object.getPrototypeOf;var s=[][o]?t(t([][o]())):(P(t={},o,function(){return this}),t),d=u.prototype=c.prototype=Object.create(s);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,P(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return i.prototype=u,P(d,"constructor",u),P(u,"constructor",i),i.displayName="GeneratorFunction",P(u,r,"GeneratorFunction"),P(d),P(d,r,"Generator"),P(d,o,function(){return this}),P(d,"toString",function(){return"[object Generator]"}),(x=function(){return{w:l,m:p}})()}function P(e,t,n,o){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}P=function(e,t,n,o){if(t)r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n;else{var l=function(t,n){P(e,t,function(e){return this._invoke(t,n,e)})};l("next",0),l("throw",1),l("return",2)}},P(e,t,n,o)}function j(e,t,n,o,r,l,a){try{var c=e[l](a),i=c.value}catch(e){return void n(e)}c.done?t(i):Promise.resolve(i).then(o,r)}function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t,n){return(t=function(e){var t=function(e){if("object"!=w(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==w(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}R.SelectControl,R.ToggleControl,k(y.UU,{edit:function(e){var t=e.attributes,n=e.setAttributes;return React.createElement(React.Fragment,null,React.createElement(E,null,React.createElement(z,{title:v("Zypento TOC Settings","zypento-blocks"),initialOpen:!1},React.createElement(S,{label:v("Select Heading","zypento-blocks"),value:t.customHeading||"",onChange:function(e){return n({customHeading:e})},help:v("Enter a heading for the TOC block.","zypento-blocks")}),React.createElement(S,{label:v("Select Element","zypento-blocks"),value:t.elementIdentifier||"",onChange:function(e){return n({elementIdentifier:e})},help:v("Enter CSS class or ID of the container that has post content, else block will look for children of .wp-block-post-content which are headings","zypento-blocks")}))),React.createElement("div",C(),React.createElement("h4",null,""!==t.customHeading&&t.customHeading.trim()?t.customHeading:v("Table of Contents","zypento-blocks")),React.createElement("div",{"data-toc-content":t.elementIdentifier||"",id:"zypento-blocks-toc",class:"zypento-blocks-toc"})))},save:function(e){var t=e.attributes;return React.createElement("div",C.save(),React.createElement("h4",null,""!==t.customHeading&&t.customHeading.trim()?t.customHeading:v("Table of Contents","zypento-blocks")),React.createElement("div",{"data-toc-content":t.elementIdentifier||"",id:"zypento-blocks-toc",class:"zypento-blocks-toc"}))}});var N=wp.i18n.__,_=wp.element,H=_.useState,U=(_.useEffect,wp.components),G=U.ColorPicker,L=(U.GradientPicker,U.TextControl),q=(U.SelectControl,U.ToggleControl),F=U.Button,M=wp.blockEditor.MediaUpload;const D=function(e){var t=e.onChange,n=e.currentSlides,o={background:{color:"",img:""},padding:{container:"",content:""},width:{content:""},heading:N("Slide Heading","zypento-blocks"),headingColor:"",text:N("Some super awesome text comes here","zypento-blocks"),textColor:"",button:{text:N("Click Here","zypento-blocks"),link:"",color:{bg:"",text:""},type:""}},r=function(){var e,o=(e=x().m(function e(o){var r;return x().w(function(e){for(;;)switch(e.n){case 0:delete(r=I({},n))[o],t(r);case 1:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(o,r){var l=e.apply(t,n);function a(e){j(l,o,r,a,c,"next",e)}function c(e){j(l,o,r,a,c,"throw",e)}a(void 0)})});return function(e){return o.apply(this,arguments)}}(),l=O(H(null),2),a=l[0],c=l[1];return React.createElement(React.Fragment,null,React.createElement("div",{className:"zypento-blocks-simple-slider-container"},React.createElement("div",{className:"zypento-blocks-simple-slider-slides"},"object"===w(n)&&Object.entries(n).map(function(e){var o,l,i,u,s,d,p,m,f,b,y,v=O(e,2),g=v[0],k=v[1];return React.createElement("div",{"data-id":g,className:"zypento-blocks-simple-slider-slide",key:g},React.createElement("h4",{className:"zypento-heading"},N("Slide","zypento-blocks")),React.createElement("span",{className:"zypento-menu",onClick:function(){return c(a===g?null:g)}}),React.createElement("span",{onClick:function(){return r(g)},className:"zypento-delete"}),React.createElement("div",{style:{display:a===g?"block":"none"},className:"zypento-blocks-simple-slider-slide-content"},React.createElement("div",{className:"zypento-item"},React.createElement(L,{label:N("Heading","zypento-blocks"),value:k.heading,onChange:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{heading:e}),t(o)}}),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement(G,{color:k.headingColor||"#000000",onChangeComplete:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{headingColor:"string"==typeof e?e:e.hex}),t(o)},disableAlpha:!0}))),React.createElement("div",{className:"zypento-item"},React.createElement(L,{label:N("Text","zypento-blocks"),value:k.text,onChange:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{text:e}),t(o)}}),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement(G,{color:k.textColor||"#000000",onChangeComplete:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{textColor:"string"==typeof e?e:e.hex}),t(o)},disableAlpha:!0}))),React.createElement("div",{className:"zypento-item"},React.createElement(L,{label:N("Button text","zypento-blocks"),value:(null===(o=k.button)||void 0===o?void 0:o.text)||"",onChange:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{button:I(I({},o[g]&&o[g].button||{}),{},{text:e})}),t(o)}}),React.createElement(L,{label:N("Button link","zypento-blocks"),value:(null===(l=k.button)||void 0===l?void 0:l.link)||"",onChange:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{button:I(I({},o[g]&&o[g].button||{}),{},{link:e})}),t(o)}}),React.createElement(q,{label:N("Rounded Button","zypento-blocks"),checked:"rounded"===(null===(i=k.button)||void 0===i?void 0:i.type),onChange:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{button:I(I({},o[g]&&o[g].button||{}),{},{type:e?"rounded":"normal"})}),t(o)}}),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement("label",null,N("Button BG","zypento-blocks")),React.createElement(G,{color:(null===(u=k.button)||void 0===u||null===(u=u.color)||void 0===u?void 0:u.bg)||"#ffffff",onChangeComplete:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{button:I(I({},o[g]&&o[g].button||{}),{},{color:I(I({},o[g]&&o[g].button&&o[g].button.color||{}),{},{bg:"string"==typeof e?e:e.hex})})}),t(o)},disableAlpha:!0})),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement("label",null,N("Button Text","zypento-blocks")),React.createElement(G,{color:(null===(s=k.button)||void 0===s||null===(s=s.color)||void 0===s?void 0:s.text)||"#ffffff",onChangeComplete:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{button:I(I({},o[g]&&o[g].button||{}),{},{color:I(I({},o[g]&&o[g].button&&o[g].button.color||{}),{},{text:"string"==typeof e?e:e.hex})})}),t(o)},disableAlpha:!0}))),React.createElement("div",{className:"zypento-item"},React.createElement(L,{label:N("Slide Vertical Padding","zypento-blocks"),value:(null===(d=k.padding)||void 0===d?void 0:d.container)||"",onChange:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{padding:I(I({},o[g]&&o[g].padding||{}),{},{container:e})}),t(o)}}),React.createElement("label",null,N("Background Color","zypento-blocks")),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement(G,{color:(null===(p=k.background)||void 0===p?void 0:p.color)||"#ffffff",onChangeComplete:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{background:I(I({},o[g]&&o[g].background||{}),{},{color:"string"==typeof e?e:e.hex})}),t(o)},disableAlpha:!0}))),React.createElement("div",{className:"zypento-item"},React.createElement(L,{label:N("Slide Content Vertical Padding","zypento-blocks"),value:(null===(m=k.padding)||void 0===m?void 0:m.content)||"",onChange:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{padding:I(I({},o[g]&&o[g].padding||{}),{},{content:e})}),t(o)}}),React.createElement(L,{label:N("Slide Content Width","zypento-blocks"),value:(null===(f=k.width)||void 0===f?void 0:f.content)||"",onChange:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{width:I(I({},o[g]&&o[g].width||{}),{},{content:e})}),t(o)}}),React.createElement("label",null,N("Background Image","zypento-blocks")),React.createElement(M,{onSelect:function(e){var o=I({},n);o[g]=I(I({},o[g]),{},{background:I(I({},o[g]&&o[g].background||{}),{},{img:e.url||""})}),t(o)},allowedTypes:["image"],value:(null===(b=k.background)||void 0===b?void 0:b.img)||"",render:function(e){var t,n=e.open;return React.createElement(F,{onClick:n,isSecondary:!0},null!==(t=k.background)&&void 0!==t&&t.img?N("Change Image","zypento-blocks"):N("Select Image","zypento-blocks"))}}),(null===(y=k.background)||void 0===y?void 0:y.img)&&React.createElement("img",{src:k.background.img,alt:N("Slide Image","zypento-blocks"),style:{maxWidth:"100%",marginTop:"8px"}}))))})),React.createElement("div",{className:""}),React.createElement("p",{className:"zypento-blocks-simple-slider-add-slide"},React.createElement("span",{onClick:function(){return e=Math.random().toString(36).slice(2,7),(r=I({},n))[e]=structuredClone(o),void t(r);var e,r}},N("Add Slide","zypento-blocks")))))};var V=function(e,t,n,o,r,l){e<0?e=o?r-1:0:e>=r&&(e=o?0:r-1),l(e),t.style.transform="translateX("+-100*e+"%)",n.forEach(function(t,n){return t.classList.toggle("active",n===e)})};const W=JSON.parse('{"UU":"zypento-blocks/simple-slider"}');var J=wp.i18n.__,X=wp.blocks,Z=(X.registerBlockCollection,X.registerBlockType),$=(X.query,wp.blockEditor),K=($.RichText,$.InspectorControls),Q=$.useBlockProps,Y=($.InnerBlocks,$.BlockControls,$.PlainText,$.PanelColorSettings,wp.serverSideRender),ee=wp.components,te=ee.PanelBody,ne=(ee.Icon,ee.ColorPicker,ee.GradientPicker,ee.TextControl,ee.SelectControl,ee.ToggleControl,wp.element.useEffect);Z(W.UU,{edit:function(e){var t=e.attributes,n=e.setAttributes,o=(e.clientId,t.slides);return ne(function(){setTimeout(function(){var e;e=0,function t(){var n=document.querySelector("iframe");if(n){var o=(n.contentDocument||n.contentWindow.document).querySelectorAll(".zypento-blocks-simple-slider");if(o.length>0)return void o.forEach(function(e){var t="false"!==e.getAttribute("data-loop");!function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.querySelector(".zypento-blocks-simple-slider-belt"),o=n.querySelectorAll(".zypento-blocks-simple-slide"),r=e.querySelector(".zypento-blocks-simple-slider-navigation"),l=0,a=o.length;function c(e){l=e}var i="false"!==e.getAttribute("data-autoslide"),u=parseInt(e.getAttribute("data-autoslide-interval"),10)||1e4,s=null;r.innerHTML="";var d=document.createElement("div");d.className="zypento-blocks-simple-slider-nav-inner";for(var p=function(e){var o=document.createElement("span");o.className="zypento-blocks-simple-slider-dot"+(0===e?" active":""),o.addEventListener("click",function(){V(e,n,y,t,a,c),i&&k()}),d.appendChild(o)},m=0;m<a;m++)p(m);var f=document.createElement("button");f.className="zypento-blocks-simple-slider-arrow prev",f.innerHTML="←",f.addEventListener("click",function(){V(l-1,n,y,t,a,c),i&&k()});var b=document.createElement("button");b.className="zypento-blocks-simple-slider-arrow next",b.innerHTML="→",b.addEventListener("click",function(){V(l+1,n,y,t,a,c),i&&k()}),d.insertBefore(f,d.firstChild),d.appendChild(b),r.appendChild(d);var y=d.querySelectorAll(".zypento-blocks-simple-slider-dot"),v=null;function g(){i&&(s=setInterval(function(){V(l+1,n,y,t,a,c)},u))}function k(){i&&(clearInterval(s),g())}n.addEventListener("touchstart",function(e){v=e.touches[0].clientX}),n.addEventListener("touchend",function(e){if(null!==v){var o=e.changedTouches[0].clientX;o-v>50?V(l-1,n,y,t,a,c):v-o>50&&V(l+1,n,y,t,a,c),i&&k(),v=null}}),i&&g(),e.addEventListener("mouseenter",function(){i&&clearInterval(s)}),e.addEventListener("mouseleave",k)}(e,t)})}++e<50&&setTimeout(t,200)}()},1e4)},[o]),React.createElement(React.Fragment,null,React.createElement(K,null,React.createElement(te,{title:J("Slides","zypento-blocks"),initialOpen:!0},React.createElement(D,{currentSlides:o,onChange:function(e){n({slides:e})}}))),React.createElement("div",Q(),React.createElement(Y,{block:"zypento-blocks/simple-slider",attributes:t})))},save:function(){return null}}),(0,wp.blocks.registerBlockCollection)("zypento-blocks",{title:(0,wp.i18n.__)("Zypento","zypento-blocks")})})();2 (()=>{"use strict";const e=JSON.parse('{"UU":"zypento-blocks/woo-collection"}');function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,c=[],i=!0,s=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;i=!1}else for(;!(i=(o=l.call(n)).done)&&(c.push(o.value),c.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{if(!i&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw r}}return c}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var l=wp.i18n.__,a=wp.blocks,c=(a.registerBlockCollection,a.registerBlockType),i=(a.query,wp.blockEditor),s=(i.RichText,i.InspectorControls),u=i.useBlockProps,d=(i.InnerBlocks,i.BlockControls,i.PlainText,i.PanelColorSettings,wp.serverSideRender),p=wp.components,f=p.PanelBody,m=(p.Icon,p.ColorPicker,p.GradientPicker,p.TextControl,p.SelectControl),b=p.ToggleControl;c(e.UU,{edit:function(e){var o=e.attributes,r=e.setAttributes,a=[{label:l("Select a category","zypento-blocks"),value:""}].concat(n(Object.entries(zypentoBlocksEditorVariables.categories).map(function(e){var n=t(e,2),o=n[0];return{label:n[1],value:o}}))),c=[{label:l("Select a Tag","zypento-blocks"),value:""}].concat(n(Object.entries(zypentoBlocksEditorVariables.tags).map(function(e){var n=t(e,2),o=n[0];return{label:n[1],value:o}}))),i=l("Select a category","zypento-blocks"),p=l("Select a Tag","zypento-blocks"),y="tag"!==o.type;return React.createElement(React.Fragment,null,React.createElement(s,null,React.createElement(f,{title:l("Woo Category/Tag","zypento-blocks"),initialOpen:!1},React.createElement(b,{label:l(y?"Category":"Tag","zypento-blocks"),checked:y,onChange:function(e){return r({type:e?"category":"tag",term:""})},help:l(y?"Showing categories":"Showing tags","zypento-blocks")}),React.createElement(m,{label:y?i:p,value:o.term,options:y?a:c,onChange:function(e){return r({term:e})}}))),React.createElement("div",u(),React.createElement(d,{block:"zypento/woo-collection",attributes:o})))},save:function(){return null}});const y=JSON.parse('{"UU":"zypento-blocks/table-of-contents"}');var g=wp.i18n.__,v=wp.blocks,k=(v.registerBlockCollection,v.registerBlockType),h=(v.query,wp.blockEditor),E=(h.RichText,h.InspectorControls),C=h.useBlockProps,w=(h.InnerBlocks,h.BlockControls,h.PlainText,h.PanelColorSettings,wp.serverSideRender,wp.components),S=w.PanelBody,R=(w.Icon,w.ColorPicker,w.GradientPicker,w.TextControl);function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,c=[],i=!0,s=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;i=!1}else for(;!(i=(o=l.call(n)).done)&&(c.push(o.value),c.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{if(!i&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw r}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function x(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function l(n,o,r,l){var i=o&&o.prototype instanceof c?o:c,s=Object.create(i.prototype);return O(s,"_invoke",function(n,o,r){var l,c,i,s=0,u=r||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return l=t,c=0,i=e,p.n=n,a}};function f(n,o){for(c=n,i=o,t=0;!d&&s&&!r&&t<u.length;t++){var r,l=u[t],f=p.p,m=l[2];n>3?(r=m===o)&&(i=l[(c=l[4])?5:(c=3,3)],l[4]=l[5]=e):l[0]<=f&&((r=n<2&&f<l[1])?(c=0,p.v=o,p.n=l[1]):f<m&&(r=n<3||l[0]>o||o>m)&&(l[4]=n,l[5]=o,p.n=m,c=0))}if(r||n>1)return a;throw d=!0,o}return function(r,u,m){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),c=u,i=m;(t=c<2?e:i)||!d;){l||(c?c<3?(c>1&&(p.n=-1),f(c,i)):p.n=i:p.v=i);try{if(s=2,l){if(c||(r="next"),t=l[r]){if(!(t=t.call(l,i)))throw TypeError("iterator result is not an object");if(!t.done)return t;i=t.value,c<2&&(c=0)}else 1===c&&(t=l.return)&&t.call(l),c<2&&(i=TypeError("The iterator does not provide a '"+r+"' method"),c=1);l=e}else if((t=(d=p.n<0)?i:n.call(o,p))!==a)break}catch(t){l=e,c=1,i=t}finally{s=1}}return{value:t,done:d}}}(n,r,l),!0),s}var a={};function c(){}function i(){}function s(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(O(t={},o,function(){return this}),t),d=s.prototype=c.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,O(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return i.prototype=s,O(d,"constructor",s),O(s,"constructor",i),i.displayName="GeneratorFunction",O(s,r,"GeneratorFunction"),O(d),O(d,r,"Generator"),O(d,o,function(){return this}),O(d,"toString",function(){return"[object Generator]"}),(x=function(){return{w:l,m:p}})()}function O(e,t,n,o){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}O=function(e,t,n,o){if(t)r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n;else{var l=function(t,n){O(e,t,function(e){return this._invoke(t,n,e)})};l("next",0),l("throw",1),l("return",2)}},O(e,t,n,o)}function P(e,t,n,o,r,l,a){try{var c=e[l](a),i=c.value}catch(e){return void n(e)}c.done?t(i):Promise.resolve(i).then(o,r)}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t,n){return(t=function(e){var t=function(e){if("object"!=I(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==I(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}w.SelectControl,w.ToggleControl,k(y.UU,{edit:function(e){var t=e.attributes,n=e.setAttributes;return React.createElement(React.Fragment,null,React.createElement(E,null,React.createElement(S,{title:g("Zypento TOC Settings","zypento-blocks"),initialOpen:!1},React.createElement(R,{label:g("Select Heading","zypento-blocks"),value:t.customHeading||"",onChange:function(e){return n({customHeading:e})},help:g("Enter a heading for the TOC block.","zypento-blocks")}),React.createElement(R,{label:g("Select Element","zypento-blocks"),value:t.elementIdentifier||"",onChange:function(e){return n({elementIdentifier:e})},help:g("Enter CSS class or ID of the container that has post content, else block will look for children of .wp-block-post-content which are headings","zypento-blocks")}))),React.createElement("div",C(),React.createElement("h4",null,""!==t.customHeading&&t.customHeading.trim()?t.customHeading:g("Table of Contents","zypento-blocks")),React.createElement("div",{"data-toc-content":t.elementIdentifier||"",id:"zypento-blocks-toc",class:"zypento-blocks-toc"})))},save:function(e){var t=e.attributes;return React.createElement("div",C.save(),React.createElement("h4",null,""!==t.customHeading&&t.customHeading.trim()?t.customHeading:g("Table of Contents","zypento-blocks")),React.createElement("div",{"data-toc-content":t.elementIdentifier||"",id:"zypento-blocks-toc",class:"zypento-blocks-toc"}))}});var N=wp.i18n.__,U=wp.element,_=U.useState,H=(U.useEffect,wp.components),G=H.ColorPicker,q=(H.GradientPicker,H.TextControl),L=(H.SelectControl,H.ToggleControl),D=H.Button,F=wp.blockEditor.MediaUpload;const M=function(e){var t=e.onChange,n=e.slides;console.log("slides @ 10 are",n);var o={"54ue2":{background:{color:"#81b29a",img:zypentoBlocksEditorVariables.pluginUrl+"/assets/images/slides/03.jpg"},padding:{container:"",content:"12%"},width:{content:"1460px"},heading:N("End of Winter Season Sale","zypento-blocks"),headingColor:"#ffffff",text:N("Growing a business is about consistently delivering value, building strong relationships, and adapting quickly to changing needs and opportunities.","zypento-blocks"),textColor:"#ffffff",button:{text:N("Shop Now","zypento-blocks"),link:"#",color:{bg:"",text:""},type:"rounded"}},"54ue3":{background:{color:"#f1ab86",img:zypentoBlocksEditorVariables.pluginUrl+"/assets/images/slides/04.jpg"},padding:{container:"",content:"12%"},width:{content:"1460px"},heading:N("Start of Summer Season Sale","zypento-blocks"),headingColor:"#ffffff",text:N("Growing a business is about consistently delivering value, building strong relationships, and adapting quickly to changing needs and opportunities.","zypento-blocks"),textColor:"#ffffff",button:{text:N("Shop Now","zypento-blocks"),link:"#",color:{bg:"",text:""},type:"rounded"}}};null!==n&&"object"===I(n)&&Object===n.constructor&&0!==Object.keys(n).length&&(console.log("Assigning slides to currentSlides"),o=n),console.log(o);var r={background:{color:"",img:""},padding:{container:"",content:""},width:{content:""},heading:N("Slide Heading","zypento-blocks"),headingColor:"",text:N("Some super awesome text comes here","zypento-blocks"),textColor:"",button:{text:N("Click Here","zypento-blocks"),link:"",color:{bg:"",text:""},type:""}},l=function(){var e,n=(e=x().m(function e(n){var r;return x().w(function(e){for(;;)switch(e.n){case 0:delete(r=B({},o))[n],t(r);case 1:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(o,r){var l=e.apply(t,n);function a(e){P(l,o,r,a,c,"next",e)}function c(e){P(l,o,r,a,c,"throw",e)}a(void 0)})});return function(e){return n.apply(this,arguments)}}(),a=z(_(null),2),c=a[0],i=a[1];return React.createElement(React.Fragment,null,React.createElement("div",{className:"zypento-blocks-simple-slider-container"},React.createElement("div",{className:"zypento-blocks-simple-slider-slides"},"object"===I(o)&&Object.entries(o).map(function(e){var n,r,a,s,u,d,p,f,m,b,y,g=z(e,2),v=g[0],k=g[1];return React.createElement("div",{"data-id":v,className:"zypento-blocks-simple-slider-slide",key:v},React.createElement("h4",{className:"zypento-heading"},N("Slide","zypento-blocks")),React.createElement("span",{className:"zypento-menu",onClick:function(){return i(c===v?null:v)}}),React.createElement("span",{onClick:function(){return l(v)},className:"zypento-delete"}),React.createElement("div",{style:{display:c===v?"block":"none"},className:"zypento-blocks-simple-slider-slide-content"},React.createElement("div",{className:"zypento-item"},React.createElement(q,{label:N("Heading","zypento-blocks"),value:k.heading,onChange:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{heading:e}),t(n)}}),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement(G,{color:k.headingColor||"#000000",onChangeComplete:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{headingColor:"string"==typeof e?e:e.hex}),t(n)},disableAlpha:!0}))),React.createElement("div",{className:"zypento-item"},React.createElement(q,{label:N("Text","zypento-blocks"),value:k.text,onChange:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{text:e}),t(n)}}),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement(G,{color:k.textColor||"#000000",onChangeComplete:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{textColor:"string"==typeof e?e:e.hex}),t(n)},disableAlpha:!0}))),React.createElement("div",{className:"zypento-item"},React.createElement(q,{label:N("Button text","zypento-blocks"),value:(null===(n=k.button)||void 0===n?void 0:n.text)||"",onChange:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{button:B(B({},n[v]&&n[v].button||{}),{},{text:e})}),t(n)}}),React.createElement(q,{label:N("Button link","zypento-blocks"),value:(null===(r=k.button)||void 0===r?void 0:r.link)||"",onChange:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{button:B(B({},n[v]&&n[v].button||{}),{},{link:e})}),t(n)}}),React.createElement(L,{label:N("Rounded Button","zypento-blocks"),checked:"rounded"===(null===(a=k.button)||void 0===a?void 0:a.type),onChange:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{button:B(B({},n[v]&&n[v].button||{}),{},{type:e?"rounded":"normal"})}),t(n)}}),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement("label",null,N("Button BG","zypento-blocks")),React.createElement(G,{color:(null===(s=k.button)||void 0===s||null===(s=s.color)||void 0===s?void 0:s.bg)||"#ffffff",onChangeComplete:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{button:B(B({},n[v]&&n[v].button||{}),{},{color:B(B({},n[v]&&n[v].button&&n[v].button.color||{}),{},{bg:"string"==typeof e?e:e.hex})})}),t(n)},disableAlpha:!0})),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement("label",null,N("Button Text","zypento-blocks")),React.createElement(G,{color:(null===(u=k.button)||void 0===u||null===(u=u.color)||void 0===u?void 0:u.text)||"#ffffff",onChangeComplete:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{button:B(B({},n[v]&&n[v].button||{}),{},{color:B(B({},n[v]&&n[v].button&&n[v].button.color||{}),{},{text:"string"==typeof e?e:e.hex})})}),t(n)},disableAlpha:!0}))),React.createElement("div",{className:"zypento-item"},React.createElement(q,{label:N("Slide Vertical Padding","zypento-blocks"),value:(null===(d=k.padding)||void 0===d?void 0:d.container)||"",onChange:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{padding:B(B({},n[v]&&n[v].padding||{}),{},{container:e})}),t(n)}}),React.createElement("label",null,N("Background Color","zypento-blocks")),React.createElement("div",{className:"zypento-colorpicker-wrap"},React.createElement(G,{color:(null===(p=k.background)||void 0===p?void 0:p.color)||"#ffffff",onChangeComplete:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{background:B(B({},n[v]&&n[v].background||{}),{},{color:"string"==typeof e?e:e.hex})}),t(n)},disableAlpha:!0}))),React.createElement("div",{className:"zypento-item"},React.createElement(q,{label:N("Slide Content Vertical Padding","zypento-blocks"),value:(null===(f=k.padding)||void 0===f?void 0:f.content)||"",onChange:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{padding:B(B({},n[v]&&n[v].padding||{}),{},{content:e})}),t(n)}}),React.createElement(q,{label:N("Slide Content Width","zypento-blocks"),value:(null===(m=k.width)||void 0===m?void 0:m.content)||"",onChange:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{width:B(B({},n[v]&&n[v].width||{}),{},{content:e})}),t(n)}}),React.createElement("label",null,N("Background Image","zypento-blocks")),React.createElement(F,{onSelect:function(e){var n=B({},o);n[v]=B(B({},n[v]),{},{background:B(B({},n[v]&&n[v].background||{}),{},{img:e.url||""})}),t(n)},allowedTypes:["image"],value:(null===(b=k.background)||void 0===b?void 0:b.img)||"",render:function(e){var t,n=e.open;return React.createElement(D,{onClick:n,isSecondary:!0},null!==(t=k.background)&&void 0!==t&&t.img?N("Change Image","zypento-blocks"):N("Select Image","zypento-blocks"))}}),(null===(y=k.background)||void 0===y?void 0:y.img)&&React.createElement("img",{src:k.background.img,alt:N("Slide Image","zypento-blocks"),style:{maxWidth:"100%",marginTop:"8px"}}))))})),React.createElement("div",{className:""}),React.createElement("p",{className:"zypento-blocks-simple-slider-add-slide"},React.createElement("span",{onClick:function(){return function(){var e=Math.random().toString(36).slice(2,7);console.log("key",e);var n=B({},o);console.log("newSlides",n),n[e]=structuredClone(r),console.log("newSlides",n),t(n)}()}},N("Add Slide","zypento-blocks")))))};var V=function(e,t,n,o,r,l){e<0?e=o?r-1:0:e>=r&&(e=o?0:r-1),l(e),t.style.transform="translateX("+-100*e+"%)",n.forEach(function(t,n){return t.classList.toggle("active",n===e)})};const W=JSON.parse('{"UU":"zypento-blocks/simple-slider"}');var J=wp.i18n.__,X=wp.blocks,Z=(X.registerBlockCollection,X.registerBlockType),$=(X.query,wp.blockEditor),K=($.RichText,$.InspectorControls),Q=$.useBlockProps,Y=($.InnerBlocks,$.BlockControls,$.PlainText,$.PanelColorSettings,wp.serverSideRender),ee=wp.components,te=ee.PanelBody,ne=(ee.Icon,ee.ColorPicker,ee.GradientPicker,ee.TextControl,ee.SelectControl,ee.ToggleControl,wp.element.useEffect);function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}Z(W.UU,{edit:function(e){var t=e.attributes,n=e.setAttributes,o=(e.clientId,t.slides);return ne(function(){setTimeout(function(){var e;e=0,function t(){var n=document.querySelector("iframe");if(n){var o=(n.contentDocument||n.contentWindow.document).querySelectorAll(".zypento-blocks-simple-slider");if(o.length>0)return void o.forEach(function(e){var t="false"!==e.getAttribute("data-loop");!function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.querySelector(".zypento-blocks-simple-slider-belt"),o=n.querySelectorAll(".zypento-blocks-simple-slide"),r=e.querySelector(".zypento-blocks-simple-slider-navigation"),l=0,a=o.length;function c(e){l=e}var i="false"!==e.getAttribute("data-autoslide"),s=parseInt(e.getAttribute("data-autoslide-interval"),10)||1e4,u=null;r.innerHTML="";var d=document.createElement("div");d.className="zypento-blocks-simple-slider-nav-inner";for(var p=function(e){var o=document.createElement("span");o.className="zypento-blocks-simple-slider-dot"+(0===e?" active":""),o.addEventListener("click",function(){V(e,n,y,t,a,c),i&&k()}),d.appendChild(o)},f=0;f<a;f++)p(f);var m=document.createElement("button");m.className="zypento-blocks-simple-slider-arrow prev",m.innerHTML="←",m.addEventListener("click",function(){V(l-1,n,y,t,a,c),i&&k()});var b=document.createElement("button");b.className="zypento-blocks-simple-slider-arrow next",b.innerHTML="→",b.addEventListener("click",function(){V(l+1,n,y,t,a,c),i&&k()}),d.insertBefore(m,d.firstChild),d.appendChild(b),r.appendChild(d);var y=d.querySelectorAll(".zypento-blocks-simple-slider-dot"),g=null;function v(){i&&(u=setInterval(function(){V(l+1,n,y,t,a,c)},s))}function k(){i&&(clearInterval(u),v())}n.addEventListener("touchstart",function(e){g=e.touches[0].clientX}),n.addEventListener("touchend",function(e){if(null!==g){var o=e.changedTouches[0].clientX;o-g>50?V(l-1,n,y,t,a,c):g-o>50&&V(l+1,n,y,t,a,c),i&&k(),g=null}}),i&&v(),e.addEventListener("mouseenter",function(){i&&clearInterval(u)}),e.addEventListener("mouseleave",k)}(e,t)})}++e<50&&setTimeout(t,200)}()},1e4)},[o]),React.createElement(React.Fragment,null,React.createElement(K,null,React.createElement(te,{title:J("Slides","zypento-blocks"),initialOpen:!0},React.createElement(M,{slides:o,onChange:function(e){n({slides:e})}}))),React.createElement("div",Q(),React.createElement(Y,{block:"zypento-blocks/simple-slider",attributes:t})))},save:function(){return null}});var re=wp.components,le=(re.DatePicker,re.TimePicker),ae=wp.element,ce=ae.useState;ae.useEffect;const ie=function(e){var t=e.value,n=e.onChange;console.log("@ line 6",t);var o,r,l=(o=ce(t||new Date),r=2,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,c=[],i=!0,s=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;i=!1}else for(;!(i=(o=l.call(n)).done)&&(c.push(o.value),c.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{if(!i&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw r}}return c}}(o,r)||function(e,t){if(e){if("string"==typeof e)return oe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oe(e,t):void 0}}(o,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=l[0];return l[1],console.log("@ line 10",a),React.createElement("div",null,React.createElement(le,{currentTime:a,onChange:function(e){n(e)}}))},se=JSON.parse('{"UU":"zypento-blocks/simple-countdown"}');var ue=wp.i18n.__,de=wp.blocks,pe=(de.registerBlockCollection,de.registerBlockType),fe=(de.query,wp.blockEditor),me=(fe.RichText,fe.InspectorControls),be=fe.useBlockProps,ye=(fe.InnerBlocks,fe.BlockControls,fe.PlainText,fe.PanelColorSettings,wp.serverSideRender,wp.components),ge=ye.PanelBody;ye.Icon,ye.ColorPicker,ye.GradientPicker,ye.TextControl,ye.SelectControl,ye.ToggleControl,wp.element.useEffect,pe(se.UU,{edit:function(e){var t=e.attributes,n=e.setAttributes,o=t.endTime,r=new Date(o).getTime();return React.createElement(React.Fragment,null,React.createElement(me,null,React.createElement(ge,{title:ue("Zypento Simple Countdown","zypento-blocks"),initialOpen:!1},React.createElement(ie,{value:o,onChange:function(e){n({endTime:e})}}))),React.createElement("div",be(),React.createElement("div",{"data-countdown":r,class:"zypento-blocks-simple-countdown"})))},save:function(e){var t=e.attributes.endTime,n=new Date(t).getTime();return React.createElement("div",be.save(),React.createElement("div",{"data-countdown":n,class:"zypento-blocks-simple-countdown"}))}}),(0,wp.blocks.registerBlockCollection)("zypento-blocks",{title:(0,wp.i18n.__)("Zypento","zypento-blocks")})})(); -
zypento-blocks/trunk/assets/js/blocks/simple-slider/block.json
r3456914 r3460591 10 10 "slides": { 11 11 "type": "object", 12 "default": {} 12 "default": { 13 14 } 13 15 } 14 16 }, -
zypento-blocks/trunk/assets/js/blocks/simple-slider/style.css
r3456914 r3460591 1 @keyframes zypento-blocks-spinner-icon{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.zypento-blocks-simple-slider{position:relative;overflow:hidden;width:100%;margin:0 auto 2em auto}.zypento-blocks-simple-slider-belt{display:flex;transition:transform .5s cubic-bezier(0.4, 0, 0.2, 1);will-change:transform}.zypento-blocks-simple-slide{min-width:100%;box-sizing:border-box;flex-shrink:0;padding:1em}.zypento-blocks-simple-slide-content{margin:0 auto}@media screen and (min-width: 1201px){.zypento-blocks-simple-slide-content{padding :0 50% 0 0}}.zypento-blocks-simple-slide-content .zypento-button>span{background:#000;color:#fff;padding:.5em 2em;display:inline-block}.zypento-blocks-simple-slide-content .zypento-button>a{background:#000;color:#fff;padding:.5em 2em;display:inline-block;text-decoration:none}.zypento-blocks-simple-slider-navigation{position:absolute;z-index:99;bottom:2em;display:flex;justify-content:center;width:100%}.zypento-blocks-simple-slider-nav-inner{padding:10px;background:#fff;border-radius:4px;display:inline-flex;justify-content:center;gap:.5em;align-items:center}.zypento-blocks-simple-slider-dot{width:12px;height:12px;border-radius:50%;background:#ccc;cursor:pointer;transition:background .2s}.zypento-blocks-simple-slider-dot.active{background:#333}.zypento-blocks-simple-slider-arrow{color:#000;border:none;background:none;cursor:pointer;z-index:2}1 @keyframes zypento-blocks-spinner-icon{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.zypento-blocks-simple-slider{position:relative;overflow:hidden;width:100%;margin:0 auto 2em auto}.zypento-blocks-simple-slider-belt{display:flex;transition:transform .5s cubic-bezier(0.4, 0, 0.2, 1);will-change:transform}.zypento-blocks-simple-slide{min-width:100%;box-sizing:border-box;flex-shrink:0;padding:1em}.zypento-blocks-simple-slide-content{margin:0 auto}@media screen and (min-width: 1201px){.zypento-blocks-simple-slide-content{padding-right:40% !important}}.zypento-blocks-simple-slide-content>h3{font-size:clamp(2.5rem,2.5rem + (1vw - .2rem)*2.386,4.2rem);margin:0}.zypento-blocks-simple-slide-content>p{margin:3rem 0 0 0}.zypento-blocks-simple-slide-content .zypento-button{margin:3rem 0 0 0}.zypento-blocks-simple-slide-content .zypento-button>span{background:#000;color:#fff;padding:.5em 2em;display:inline-block}.zypento-blocks-simple-slide-content .zypento-button>a{background:#000;color:#fff;padding:.5em 2em;display:inline-block;text-decoration:none}.zypento-blocks-simple-slider-navigation{position:absolute;z-index:99;bottom:2em;display:flex;justify-content:center;width:100%}.zypento-blocks-simple-slider-nav-inner{padding:10px;background:#fff;border-radius:4px;display:inline-flex;justify-content:center;gap:.5em;align-items:center}.zypento-blocks-simple-slider-dot{width:12px;height:12px;border-radius:50%;background:#ccc;cursor:pointer;transition:background .2s}.zypento-blocks-simple-slider-dot.active{background:#333}.zypento-blocks-simple-slider-arrow{color:#000;border:none;background:none;cursor:pointer;z-index:2} -
zypento-blocks/trunk/assets/js/src/admin/components/simpleSliderControl.js
r3456914 r3460591 6 6 const SimpleSliderControl = ( props ) => { 7 7 8 const { onChange, currentSlides } = props; 8 const { onChange, slides } = props; 9 10 console.log( 'slides @ 10 are', slides ); 11 12 let currentSlides = { 13 '54ue2' :{ 14 'background' : { 15 'color' : '#81b29a', 16 'img' : zypentoBlocksEditorVariables['pluginUrl'] + '/assets/images/slides/03.jpg' 17 }, 18 'padding' : { 19 'container' : '', 20 'content' : '12%' 21 }, 22 'width' : { 23 'content' : '1460px' 24 }, 25 'heading' : __('End of Winter Season Sale', 'zypento-blocks'), 26 'headingColor' : '#ffffff', 27 'text' : __('Growing a business is about consistently delivering value, building strong relationships, and adapting quickly to changing needs and opportunities.', 'zypento-blocks'), 28 'textColor' : '#ffffff', 29 'button' : { 30 'text' : __('Shop Now', 'zypento-blocks'), 31 'link' : '#', 32 'color' : { 33 'bg' : '', 34 'text' : '' 35 }, 36 'type' : 'rounded' 37 } 38 }, 39 '54ue3' :{ 40 'background' : { 41 'color' : '#f1ab86', 42 'img' : zypentoBlocksEditorVariables['pluginUrl'] + '/assets/images/slides/04.jpg' 43 }, 44 'padding' : { 45 'container' : '', 46 'content' : '12%' 47 }, 48 'width' : { 49 'content' : '1460px' 50 }, 51 'heading' : __('Start of Summer Season Sale', 'zypento-blocks'), 52 'headingColor' : '#ffffff', 53 'text' : __('Growing a business is about consistently delivering value, building strong relationships, and adapting quickly to changing needs and opportunities.', 'zypento-blocks'), 54 'textColor' : '#ffffff', 55 'button' : { 56 'text' : __('Shop Now', 'zypento-blocks'), 57 'link' : '#', 58 'color' : { 59 'bg' : '', 60 'text' : '' 61 }, 62 'type' : 'rounded' 63 } 64 } 65 }; 66 67 if ( 68 null !== slides && 69 'object' === typeof slides && 70 Object === slides.constructor && 71 0 !== Object.keys(slides).length 72 ) { 73 console.log( 'Assigning slides to currentSlides' ); 74 currentSlides = slides; 75 } 76 77 console.log( currentSlides ); 9 78 10 79 let newSlideData = { … … 37 106 const handleAddSlide = () => { 38 107 // Generate a random string key 39 let key = Math.random().toString(36).slice(2, 7); 40 const newSlides = { ...currentSlides }; 41 newSlides[key] = structuredClone( newSlideData ); 108 let key = Math.random().toString(36).slice(2, 7); console.log('key', key); 109 const newSlides = { ...currentSlides }; console.log('newSlides', newSlides); 110 newSlides[key] = structuredClone( newSlideData ); console.log('newSlides', newSlides); 42 111 onChange(newSlides); 43 112 } -
zypento-blocks/trunk/assets/js/src/blockeditor.js
r3456914 r3460591 7 7 import "./blocks/table-of-contents/editor"; 8 8 import "./blocks/simple-slider/editor"; 9 import "./blocks/simple-countdown/editor"; -
zypento-blocks/trunk/assets/js/src/blocks/simple-slider/block.json
r3456914 r3460591 10 10 "slides": { 11 11 "type": "object", 12 "default": {} 12 "default": { 13 14 } 13 15 } 14 16 }, -
zypento-blocks/trunk/assets/js/src/blocks/simple-slider/editor.js
r3456914 r3460591 64 64 65 65 <SimpleSliderControl 66 currentSlides={slides}66 slides={slides} 67 67 onChange={(value) => { 68 68 setAttributes({ slides: value }); -
zypento-blocks/trunk/assets/js/src/blocks/simple-slider/style.scss
r3456914 r3460591 21 21 margin: 0 auto; 22 22 @media screen and (min-width : 1201px) { 23 padding: 0 50% 0 0; 23 padding-right: 40% !important; 24 } 25 &>h3{ 26 font-size: clamp(2.5rem, 2.5rem + ((1vw - 0.2rem) * 2.386), 4.2rem); 27 margin: 0; 28 } 29 &>p{ 30 margin: 3rem 0 0 0; 24 31 } 25 32 & .zypento-button{ 33 margin: 3rem 0 0 0; 26 34 &>span{ 27 35 background: #000000; -
zypento-blocks/trunk/includes/core/class-blocks.php
r3456914 r3460591 81 81 ZYPENTO_BLOCKS_PLUGIN_PATH . 'assets/js/blocks/table-of-contents', 82 82 ); 83 register_block_type( 84 ZYPENTO_BLOCKS_PLUGIN_PATH . 'assets/js/blocks/simple-countdown', 85 ); 83 86 84 87 } -
zypento-blocks/trunk/includes/features/class-simple-slider.php
r3456914 r3460591 86 86 ! is_array( $atts ) || 87 87 ! array_key_exists( 'slides', $atts ) || 88 ! is_array( $atts['slides'] ) 88 ! is_array( $atts['slides'] ) || 89 empty( $atts['slides'] ) 89 90 ) { 90 return; 91 92 $atts = array(); 93 $atts['slides'] = array( 94 95 '54ue2' => array( 96 'background' => array( 97 'color' => '#81b29a', 98 'img' => ZYPENTO_BLOCKS_PLUGIN_URL . '/assets/images/slides/03.jpg', 99 ), 100 'padding' => array( 101 'container' => '', 102 'content' => '12%', 103 ), 104 'width' => array( 105 'content' => '1460px', 106 ), 107 'heading' => esc_html__( 'End of Winter Season Sale', 'zypento-blocks' ), 108 'headingColor' => '#ffffff', 109 'text' => esc_html__( 'Growing a business is about consistently delivering value, building strong relationships, and adapting quickly to changing needs and opportunities.', 'zypento-blocks' ), 110 'textColor' => '#ffffff', 111 'button' => array( 112 'text' => esc_html__( 'Shop Now', 'zypento-blocks' ), 113 'link' => '#', 114 'color' => array( 115 'bg' => '', 116 'text' => '', 117 ), 118 'type' => 'rounded', 119 ), 120 ), 121 '54ue3' => array( 122 'background' => array( 123 'color' => '#f1ab86', 124 'img' => ZYPENTO_BLOCKS_PLUGIN_URL . '/assets/images/slides/04.jpg', 125 ), 126 'padding' => array( 127 'container' => '', 128 'content' => '12%', 129 ), 130 'width' => array( 131 'content' => '1460px', 132 ), 133 'heading' => esc_html__( 'Start of Summer Season Sale', 'zypento-blocks' ), 134 'headingColor' => '#ffffff', 135 'text' => esc_html__( 'Growing a business is about consistently delivering value, building strong relationships, and adapting quickly to changing needs and opportunities.', 'zypento-blocks' ), 136 'textColor' => '#ffffff', 137 'button' => array( 138 'text' => esc_html__( 'Shop Now', 'zypento-blocks' ), 139 'link' => '#', 140 'color' => array( 141 'bg' => '', 142 'text' => '', 143 ), 144 'type' => 'rounded', 145 ), 146 ), 147 148 ); 149 91 150 } 92 151 … … 125 184 array_key_exists( 'img', $slide['background'] ) 126 185 ) { 127 $slide_content_css .= 'background:url("' . $slide['background']['img'] . '") center right ;';186 $slide_content_css .= 'background:url("' . $slide['background']['img'] . '") center right no-repeat;'; 128 187 } 129 188 if ( -
zypento-blocks/trunk/zypento-blocks.php
r3456914 r3460591 11 11 * Plugin URI: 12 12 * Description: Gutenberg Blocks. 13 * Version: 1.0. 013 * Version: 1.0.1 14 14 * Author: Zypento 15 15 * Author URI: http://zypento.com
Note: See TracChangeset
for help on using the changeset viewer.