FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
button
/
build
Edit File: index.js
(()=>{"use strict";var e,t={42:()=>{const e=window.wp.blocks,t=window.wp.i18n,o=window.wp.blockEditor,n=window.wp.components,s=window.React,l=window.wp.primitives,i=(0,s.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(l.Path,{d:"M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6zM10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z"})),r=window.wp.element,c=window.wp.compose,C=window.wp.data,d=window.ReactJSXRuntime,a=()=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",marginBottom:"10px"},children:[(0,d.jsx)("p",{children:(0,d.jsxs)("svg",{width:"41",height:"48",viewBox:"0 0 41 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,d.jsx)("path",{d:"M0 34.7721L6.88004 38.677V15.8055L20.4542 7.80977L23.9872 9.4833L30.4953 5.57841L20.4542 -7.62939e-06L0 11.9006V34.7721Z",fill:"#38DAC7"}),(0,d.jsx)("path",{d:"M32.9284 6.87939L34.2126 7.61318L12.3825 19.904L12.1991 40.45L20.6376 45.8616L41.0001 33.6625V35.4969L20.6376 47.6043L10.8232 41.2755V18.9868L32.9284 6.87939Z",fill:"#5566CA"}),(0,d.jsx)("path",{d:"M37.6063 9.53936L36.2305 8.71385L14.217 21.3716V38.9824L20.5459 43.5685L41.0001 31.3694V29.5349L20.5459 41.8258L15.5928 38.2486V22.1054L37.6063 9.53936Z",fill:"#5566CA"}),(0,d.jsx)("path",{d:"M41.0001 11.3738L39.5325 10.5483L17.3356 23.2061V37.2397L20.5459 39.6244L41.0001 27.4253V25.6826L20.5459 37.79L18.9866 36.5976V24.1233L41.0001 11.3738Z",fill:"#5566CA"})]})}),(0,d.jsx)("h2",{style:{fontSize:"18px",fontFamily:"Inter",marginTop:"-5px",marginBottom:"15px"},children:(0,t.__)("Access Without Limits!","cozy-addons")}),(0,d.jsx)("p",{style:{textAlign:"center",lineHeight:"20px"},children:(0,t.__)("Access more blocks and advanced features for effortless design. Upgrade today for a richer web-building experience!","cozy-addons")}),(0,d.jsx)("a",{href:"https://cozythemes.com/pricing-and-plans/",target:"_blank",children:(0,d.jsx)("button",{className:"cozy-block-premium-button",style:{backgroundColor:"#5566ca",borderRadius:"20px",padding:"10px",border:"none",color:"#fff",fontFamily:"Inter",fontSize:"10px",fontWeight:"500",cursor:"pointer"},children:(0,d.jsxs)("div",{style:{display:"flex",gap:"5px",margin:"0"},children:[(0,d.jsx)("div",{children:(0,d.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)("path",{d:"M9.29768 0.0630875L0.24397 5.2847C-0.109583 5.48778 -0.0646564 5.97987 0.286944 6.12828L2.36334 6.99919L7.97527 2.05487C8.0827 1.95919 8.23506 2.10565 8.14325 2.21695L3.43767 7.94822V9.52017C3.43767 9.98102 3.99437 10.1626 4.26784 9.8287L5.50821 8.31924L7.94206 9.33857C8.21943 9.45573 8.53588 9.28194 8.58666 8.98317L9.99306 0.547365C10.0595 0.152913 9.6356 -0.132186 9.29768 0.0630875Z",fill:"white"})})}),(0,d.jsx)("div",{children:(0,t.__)("Upgrade to Pro","cozy-addons")})]})})})]})}),h=(0,r.memo)((()=>{const e=(0,o.useInnerBlocksProps)({className:"cozy-block-button"},{template:[["core/buttons",{layout:{type:"flex",justifyContent:"center"}},[["core/button",{},[]]]]]});return(0,d.jsx)("div",{...e})})),p=(0,r.memo)((({clientId:s})=>{const{insertBlock:l,selectBlock:r}=(0,C.useDispatch)(o.store),c=(0,C.useSelect)((e=>e(o.store).getBlock(s).innerBlocks[0]));return(0,d.jsx)(n.ToolbarGroup,{children:(0,d.jsx)(n.ToolbarButton,{icon:i,onClick:()=>{const t=(0,e.createBlock)("core/button");l(t,c.length,c.clientId,!1),r(t.clientId)},children:(0,t.__)("Add Button","cozy-addons")})})})),u=(0,r.memo)((({clientId:e,attributes:t})=>{const n=(0,c.useRefEffect)((t=>{let n=(0,C.select)(o.store).getBlockOrder(e);const s=(0,C.subscribe)((()=>{const t=(0,C.select)(o.store).getBlockOrder(e);t.toString()!==n.toString()&&((0,C.select)(o.store).getSelectedBlock(),t.length,n.length,t.length,n.length,t.length,n.length,n=t)}));return()=>{s()}}));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.BlockControls,{children:(0,d.jsx)(p,{clientId:e})}),(0,d.jsx)("div",{className:"cozy-block-button-wrapper",id:`cozyBlock_${e.replace(/-/gi,"_")}`,ref:n,children:(0,d.jsx)(h,{})})]})})),x=JSON.parse('{"UU":"cozy-block/button","DD":"Cozy Button"}'),L=(0,d.jsxs)("svg",{width:"32",height:"26",viewBox:"0 0 32 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,d.jsx)("rect",{fill:"none",x:"1",y:"7.99997",width:"23",height:"10",stroke:"#0C50FF",strokeWidth:"2"}),(0,d.jsx)("path",{d:"M10.2668 18.0597L10.2667 18.0597C9.97547 17.9761 9.67184 18.0208 9.4142 18.1833L9.41414 18.1833C8.89155 18.5132 8.70203 19.2449 8.97358 19.8177L9.10912 19.7534L8.97323 19.8169C8.974 19.8186 8.97556 19.8219 8.97797 19.8271C9.02271 19.9232 9.35844 20.6445 10.3039 22.6337L10.4394 22.5693L10.3039 22.6337C10.7778 23.6307 11.3055 24.3617 11.88 24.7869C12.3351 25.1239 12.6626 25.15 12.7489 25.15H15.2494C15.7059 25.15 16.1288 25.0106 16.5035 24.737C16.8647 24.4738 17.1702 24.0936 17.4159 23.6141L17.4159 23.6141C17.9005 22.6672 18.15 21.3232 18.15 19.7366C18.15 19.0805 17.6414 18.5339 16.9998 18.5339H16.9354L16.933 18.5364C16.7838 18.5453 16.6425 18.584 16.5142 18.6467C16.3219 18.2698 15.9419 18.0081 15.499 18.0081C15.3253 18.0081 15.1611 18.0485 15.0139 18.1203C14.8216 17.7435 14.4416 17.4817 13.9987 17.4817C13.8766 17.4817 13.7589 17.5018 13.6486 17.5388V16.0527C13.6486 15.3966 13.1399 14.85 12.4983 14.85C11.8567 14.85 11.3481 15.3966 11.3481 16.0527V19.3477L10.9572 18.6346C10.8088 18.3512 10.5642 18.1453 10.2668 18.0597ZM15.2489 24.3242H12.7622C12.735 24.32 12.5614 24.2869 12.2986 24.08C12.0042 23.848 11.5311 23.343 11.022 22.2703L11.022 22.2702C10.5152 21.2035 10.184 20.5021 9.97906 20.0668C9.79608 19.678 9.71315 19.4998 9.69677 19.4646C9.69488 19.4605 9.69387 19.4583 9.69371 19.458C9.69371 19.458 9.69371 19.458 9.69371 19.458L9.69301 19.4565L9.69278 19.456L9.69276 19.456C9.69275 19.456 9.69274 19.4559 9.69273 19.4559C9.59612 19.2521 9.67188 18.9906 9.83181 18.8897L9.83194 18.8896C9.8999 18.8466 9.9773 18.8356 10.0532 18.8571C10.1347 18.8806 10.2076 18.9396 10.2548 19.0304L10.2543 19.0307L10.2592 19.0383L10.2594 19.0388C10.2597 19.0394 10.2601 19.0401 10.2606 19.0408L11.0392 20.461C11.1241 20.6239 11.222 20.7554 11.3377 20.8385C11.4594 20.9261 11.5988 20.9577 11.7439 20.9189C11.8892 20.8801 11.9949 20.7825 12.0602 20.6469C12.1229 20.5167 12.1487 20.3521 12.1487 20.165V16.0532C12.1487 15.8387 12.3133 15.6769 12.4988 15.6769C12.6844 15.6769 12.8489 15.8387 12.8489 16.0532V19.4744C12.8489 19.6952 13.021 19.8876 13.249 19.8876C13.477 19.8876 13.6491 19.6952 13.6491 19.4744V18.6849C13.6491 18.4704 13.8136 18.3086 13.9992 18.3086C14.1847 18.3086 14.3493 18.4704 14.3493 18.6849V19.4744C14.3493 19.6952 14.5213 19.8876 14.7493 19.8876C14.9773 19.8876 15.1494 19.6952 15.1494 19.4744V19.2113C15.1494 18.9968 15.3139 18.8349 15.4995 18.8349C15.6851 18.8349 15.8496 18.9968 15.8496 19.2113V20.0008C15.8496 20.2216 16.0216 20.414 16.2496 20.414C16.4776 20.414 16.6497 20.2216 16.6497 20.0008V19.7376C16.6497 19.5231 16.8142 19.3613 16.9998 19.3613C17.1854 19.3613 17.3499 19.5231 17.3499 19.7376C17.3499 21.175 17.1352 22.3546 16.7409 23.1645L16.7082 23.2285C16.4392 23.7549 15.9778 24.3242 15.2489 24.3242Z",fill:"#0C50FF",stroke:"white",strokeWidth:"0.3"}),(0,d.jsx)("path",{d:"M5.14062 14V11.8182H6.08665C6.25284 11.8182 6.3924 11.8405 6.50533 11.8853C6.61896 11.93 6.70455 11.9932 6.76207 12.0749C6.82031 12.1566 6.84943 12.2528 6.84943 12.3636C6.84943 12.4439 6.83168 12.517 6.79616 12.5831C6.76136 12.6491 6.71236 12.7045 6.64915 12.7493C6.58594 12.7933 6.51207 12.8238 6.42756 12.8409V12.8622C6.52131 12.8657 6.60653 12.8895 6.68324 12.9336C6.75994 12.9769 6.82102 13.0369 6.86648 13.1136C6.91193 13.1896 6.93466 13.2791 6.93466 13.3821C6.93466 13.5014 6.90341 13.6076 6.84091 13.7006C6.77912 13.7936 6.69105 13.8668 6.5767 13.9201C6.46236 13.9733 6.32599 14 6.16761 14H5.14062ZM5.73295 13.527H6.00994C6.10938 13.527 6.18395 13.5085 6.23366 13.4716C6.28338 13.4339 6.30824 13.3785 6.30824 13.3054C6.30824 13.2542 6.29652 13.2109 6.27308 13.1754C6.24964 13.1399 6.21626 13.1129 6.17294 13.0944C6.13033 13.076 6.07884 13.0667 6.01847 13.0667H5.73295V13.527ZM5.73295 12.7003H5.97585C6.0277 12.7003 6.07351 12.6921 6.11328 12.6758C6.15305 12.6594 6.18395 12.636 6.20597 12.6054C6.22869 12.5742 6.24006 12.5362 6.24006 12.4914C6.24006 12.424 6.21591 12.3725 6.16761 12.337C6.11932 12.3008 6.05824 12.2826 5.98438 12.2826H5.73295V12.7003ZM8.73572 11.8182H9.32805V13.2159C9.32805 13.3821 9.28828 13.5259 9.20874 13.6473C9.1299 13.7681 9.01982 13.8615 8.87848 13.9275C8.73714 13.9929 8.57308 14.0255 8.38629 14.0255C8.19808 14.0255 8.03331 13.9929 7.89197 13.9275C7.75064 13.8615 7.64055 13.7681 7.56172 13.6473C7.48359 13.5259 7.44453 13.3821 7.44453 13.2159V11.8182H8.03686V13.1647C8.03686 13.2322 8.05178 13.2926 8.08161 13.3459C8.11143 13.3984 8.15263 13.4396 8.20518 13.4694C8.25845 13.4993 8.31882 13.5142 8.38629 13.5142C8.45447 13.5142 8.51484 13.4993 8.5674 13.4694C8.61996 13.4396 8.66115 13.3984 8.69098 13.3459C8.72081 13.2926 8.73572 13.2322 8.73572 13.1647V11.8182ZM9.84991 12.2954V11.8182H11.7462V12.2954H11.09V14H10.5062V12.2954H9.84991ZM12.2095 12.2954V11.8182H14.1058V12.2954H13.4495V14H12.8657V12.2954H12.2095ZM16.6398 12.9091C16.6398 13.152 16.5926 13.3569 16.4981 13.5238C16.4037 13.69 16.2762 13.816 16.1157 13.902C15.9551 13.9872 15.7762 14.0298 15.5787 14.0298C15.3799 14.0298 15.2002 13.9868 15.0397 13.9009C14.8799 13.8142 14.7527 13.6878 14.6583 13.5216C14.5645 13.3547 14.5176 13.1505 14.5176 12.9091C14.5176 12.6662 14.5645 12.4616 14.6583 12.2954C14.7527 12.1285 14.8799 12.0025 15.0397 11.9172C15.2002 11.8313 15.3799 11.7883 15.5787 11.7883C15.7762 11.7883 15.9551 11.8313 16.1157 11.9172C16.2762 12.0025 16.4037 12.1285 16.4981 12.2954C16.5926 12.4616 16.6398 12.6662 16.6398 12.9091ZM16.0304 12.9091C16.0304 12.7784 16.013 12.6683 15.9782 12.5788C15.9441 12.4886 15.8934 12.4204 15.8259 12.3743C15.7591 12.3274 15.6767 12.3039 15.5787 12.3039C15.4807 12.3039 15.398 12.3274 15.3305 12.3743C15.2637 12.4204 15.213 12.4886 15.1782 12.5788C15.1441 12.6683 15.127 12.7784 15.127 12.9091C15.127 13.0397 15.1441 13.1502 15.1782 13.2404C15.213 13.3299 15.2637 13.3981 15.3305 13.4449C15.398 13.4911 15.4807 13.5142 15.5787 13.5142C15.6767 13.5142 15.7591 13.4911 15.8259 13.4449C15.8934 13.3981 15.9441 13.3299 15.9782 13.2404C16.013 13.1502 16.0304 13.0397 16.0304 12.9091ZM19.1017 11.8182V14H18.6073L17.819 12.8537H17.8062V14H17.2139V11.8182H17.7167L18.4923 12.9602H18.5093V11.8182H19.1017Z",fill:"#0C50FF"}),(0,d.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.4556 6.22119C22.9222 6.07774 22.6062 5.5291 22.7496 4.99577L23.5672 1.956C23.7107 1.42267 24.2593 1.10661 24.7927 1.25006C25.326 1.39351 25.6421 1.94215 25.4986 2.47548L24.681 5.51525C24.5375 6.04858 23.9889 6.36464 23.4556 6.22119Z",fill:"#0C50FF"}),(0,d.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.698 6.64931C25.3858 6.21874 25.4658 5.61903 25.88 5.28535L29.3501 2.4896C29.7951 2.13105 30.4497 2.21838 30.7852 2.68105C31.0974 3.11162 31.0174 3.71133 30.6032 4.04501L27.1331 6.84076C26.6881 7.19931 26.0335 7.11198 25.698 6.64931Z",fill:"#0C50FF"}),(0,d.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.8462 9.2097C25.9044 8.6605 26.3968 8.2625 26.9461 8.32076L30.0763 8.65278C30.6255 8.71103 31.0235 9.20347 30.9653 9.75267C30.907 10.3019 30.4146 10.6999 29.8654 10.6416L26.7351 10.3096C26.1859 10.2513 25.7879 9.75891 25.8462 9.2097Z",fill:"#0C50FF"})]});(0,e.registerBlockType)(x.UU,{title:(0,t.__)(x.DD,"cozy-addons"),description:(0,t.__)("Enhance user interaction with our stylish and versatile 'Button' block, designed to seamlessly integrate into your site for a polished appearance.","cozy-addons"),icon:{src:L},edit:function({attributes:e,setAttributes:t,clientId:n}){if(e.cover)return(0,d.jsx)("img",{src:e.cover});e.blockClientId=n;const s=(0,o.useBlockProps)({className:"cozy-block-wrapper"});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{...s,children:(0,d.jsx)(u,{clientId:n,attributes:e})}),(0,d.jsx)(o.InspectorControls,{children:!cozyBlockAssets.isPremium&&(0,d.jsx)(a,{})})]})},save:function({attributes:e}){return(0,d.jsx)("div",{className:"cozy-block-button",id:`cozyBlock_${(t=e.blockClientId,t.replace(/[;=()\s]/g,"")).replace(/-/gi,"_")}`,children:(0,d.jsx)(o.InnerBlocks.Content,{})});var t}})}},o={};function n(e){var s=o[e];if(void 0!==s)return s.exports;var l=o[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=(t,o,s,l)=>{if(!o){var i=1/0;for(d=0;d<e.length;d++){for(var[o,s,l]=e[d],r=!0,c=0;c<o.length;c++)(!1&l||i>=l)&&Object.keys(n.O).every((e=>n.O[e](o[c])))?o.splice(c--,1):(r=!1,l<i&&(i=l));if(r){e.splice(d--,1);var C=s();void 0!==C&&(t=C)}}return t}l=l||0;for(var d=e.length;d>0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[o,s,l]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var s,l,[i,r,c]=o,C=0;if(i.some((t=>0!==e[t]))){for(s in r)n.o(r,s)&&(n.m[s]=r[s]);if(c)var d=c(n)}for(t&&t(o);C<i.length;C++)l=i[C],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return n.O(d)},o=globalThis.webpackChunkbutton=globalThis.webpackChunkbutton||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var s=n.O(void 0,[350],(()=>n(42)));s=n.O(s)})();
Save
Back