FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
icon-picker
/
build
Edit File: index.js
(()=>{"use strict";var o,e={280:()=>{const o=window.wp.blocks,e=window.wp.i18n,n=window.wp.blockEditor,t=window.wp.components,l=window.wp.element,i=window.ReactJSXRuntime,a=()=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",marginBottom:"10px"},children:[(0,i.jsx)("p",{children:(0,i.jsxs)("svg",{width:"41",height:"48",viewBox:"0 0 41 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.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,i.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,i.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,i.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,i.jsx)("h2",{style:{fontSize:"18px",fontFamily:"Inter",marginTop:"-5px",marginBottom:"15px"},children:(0,e.__)("Access Without Limits!","cozy-addons")}),(0,i.jsx)("p",{style:{textAlign:"center",lineHeight:"20px"},children:(0,e.__)("Access more blocks and advanced features for effortless design. Upgrade today for a richer web-building experience!","cozy-addons")}),(0,i.jsx)("a",{href:"https://cozythemes.com/pricing-and-plans/",target:"_blank",children:(0,i.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,i.jsxs)("div",{style:{display:"flex",gap:"5px",margin:"0"},children:[(0,i.jsx)("div",{children:(0,i.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.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,i.jsx)("div",{children:(0,e.__)("Upgrade to Pro","cozy-addons")})]})})})]})}),s=(0,l.memo)((({attributes:o,clientId:e})=>(0,i.jsxs)("div",{className:`cozy-block-icon-picker ${o.view} layout-${o.layout}`,id:`cozyBlock_${e.replace(/-/gi,"_")}`,children:["fill"===o.layout&&(0,i.jsx)("svg",{width:o.iconSize,height:o.iconSize,viewBox:`${o.iconViewBox.vx} ${o.iconViewBox.vy} ${o.iconViewBox.vw} ${o.iconViewBox.vh}`,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:o.iconColor,fillOpacity:o.iconOpacity,children:(0,i.jsx)("path",{d:o.iconPath})}),"outline"===o.layout&&(0,i.jsx)("svg",{width:o.iconSize,height:o.iconSize,viewBox:`${parseInt(o.iconViewBox.vx)-1.5} ${parseInt(o.iconViewBox.vy)-1.5} ${parseInt(o.iconViewBox.vw)+3} ${parseInt(o.iconViewBox.vh)+3}`,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:"none",stroke:o.iconColor,strokeOpacity:o.iconOpacity,strokeWidth:o.strokeWidth,children:(0,i.jsx)("path",{d:o.iconPath})})]}))),r=JSON.parse('{"UU":"cozy-block/icon-picker","DD":"Icon Picker"}'),c=(0,i.jsxs)("svg",{width:"27",height:"22",viewBox:"0 0 27 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{fill:"none",x:"1",y:"1",width:"25",height:"20",stroke:"#0C50FF",strokeWidth:"2"}),(0,i.jsx)("path",{d:"M12.5962 5.41743L11.0659 8.52017L7.64212 9.01933C7.02813 9.10838 6.78207 9.86532 7.22733 10.2989L9.70436 12.7126L9.1185 16.1224C9.01304 16.7387 9.66218 17.2004 10.2059 16.9121L13.2688 15.3021L16.3317 16.9121C16.8754 17.198 17.5245 16.7387 17.419 16.1224L16.8332 12.7126L19.3102 10.2989C19.7555 9.86532 19.5094 9.10838 18.8954 9.01933L15.4716 8.52017L13.9413 5.41743C13.6672 4.86438 12.8727 4.85735 12.5962 5.41743Z",fill:"#0C50FF"})]});(0,o.registerBlockType)(r.UU,{title:(0,e.__)(r.DD,"cozy-addons"),description:(0,e.__)("Unlock endless possibilities with our 'Icon Picker' block, providing a user-friendly interface to choose from a diverse range of icons, enhancing the visual appeal of your content.","cozy-addons"),icon:{src:c},edit:function({attributes:o,setAttributes:r,clientId:c}){o.blockClientId=c;const d=(0,n.useBlockProps)({className:"cozy-block-wrapper cozy-block-icon-wrapper"}),x=`#cozyBlock_${c.replace(/-/gi,"_")}`,[h,p]=(0,l.useState)(!0),y=(e,n)=>{let t={...o.boxStyles.padding};t={...t,top:Math.abs(n),right:Math.abs(n),bottom:Math.abs(n),left:Math.abs(n)},r(h?{...o,boxStyles:{...o.boxStyles,padding:t}}:{...o,boxStyles:{...o.boxStyles,padding:{...o.boxStyles.padding,[e]:Math.abs(n)}}})},g=`\n\t${x} {\n\t\tmargin-top: ${o?.margin?.top}px;\n\t\tmargin-right: ${o?.margin?.right}px;\n\t\tmargin-bottom: ${o?.margin?.bottom}px;\n\t\tmargin-left: ${o?.margin?.left}px;\n\t}\n ${x}.stacked {\n padding: ${o.boxStyles.padding.top}px ${o.boxStyles.padding.right}px ${o.boxStyles.padding.bottom}px ${o.boxStyles.padding.left}px;\n border: ${o.boxStyles.borderWidth}px ${o.boxStyles.borderType} ${o.boxStyles.borderColor};\n border-radius: ${o.boxStyles.borderRadius}px;\n background-color: ${o.boxStyles.bgColor};\n }\n ${x} svg {\n rotate: ${o.iconRotate}deg;\n }\n ${x}.stacked:hover {\n background-color: ${o.boxStyles.bgColorHover};\n border-color: ${o.boxStyles.borderColorHover};\n }\n ${x}:hover svg {\n fill: ${o.iconColorHover};\n }\n\t${x}.layout-outline:hover svg {\n\t\tstroke: ${o.iconColorHover};\n\t }\n `,[b,v]=(0,l.useState)(""),u=Object.keys(cozyIcons.collection).filter((o=>o.toLowerCase().includes(b.toLowerCase())));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:g}}),(0,i.jsx)("div",{...d,children:(0,i.jsx)(s,{clientId:c,attributes:o})}),(0,i.jsxs)(n.InspectorControls,{group:"settings",children:[(0,i.jsxs)(t.PanelBody,{title:(0,e.__)("General","cozy-addons"),children:[(0,i.jsxs)(t.BaseControl,{children:[(0,i.jsx)(t.BaseControl.VisualLabel,{children:(0,e.__)("Select Icon","cozy-addons")}),(0,i.jsx)("input",{type:"text",className:"cozy-icon-search",placeholder:(0,e.__)("Search Icons...","cozy-addons"),value:b,onChange:o=>{v(o.target.value)}}),(0,i.jsx)("div",{className:"cozy-icon-list",children:u.map((e=>{const n=cozyIcons.collection[e],l=n.match(/d="([^"]+)"/),a=n.match(/viewBox\s*=\s*"([^"]*)"/),s=l?l[1]:"",c=a?a[1]:"";return(0,i.jsx)(t.Button,{onClick:()=>((e,n)=>{const t=n.split(" ");r({...o,iconPath:e,iconViewBox:{vx:t[0],vy:t[1],vw:t[2],vh:t[3]}})})(s,c),children:(0,i.jsx)("div",{className:"cozy-icon",title:e,dangerouslySetInnerHTML:{__html:n}})},e)}))})]}),(0,i.jsx)(t.SelectControl,{label:(0,e.__)("View","cozy-addons"),options:[{label:(0,e.__)("Default","cozy-addons"),value:"default"},{label:(0,e.__)("Stacked","cozy-addons"),value:"stacked"}],value:o.view,onChange:e=>r({...o,view:e})}),(0,i.jsx)(t.SelectControl,{label:(0,e.__)("Layout","cozy-addons"),options:[{label:(0,e.__)("Fill","cozy-addons"),value:"fill"},{label:(0,e.__)("Outline","cozy-addons"),value:"outline"}],value:o.layout,onChange:e=>r({...o,layout:e})}),"outline"===o.layout&&(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Outline Width","cozy-addons"),min:1,max:50,step:1,value:o.strokeWidth,onChange:e=>r({...o,strokeWidth:Math.abs(e)})}),(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Icon Rotate","cozy-addons"),min:0,max:360,step:1,value:o.iconRotate,onChange:e=>r({...o,iconRotate:Math.abs(e)})})]}),!cozyBlockAssets.isPremium&&(0,i.jsx)(a,{})]},"setting"),(0,i.jsxs)(n.InspectorControls,{group:"styles",children:["stacked"===o.view&&(0,i.jsxs)(t.PanelBody,{title:(0,e.__)("Icon Box Styles","cozy-addons"),children:[(0,i.jsxs)(t.BaseControl,{children:[(0,i.jsx)(t.BaseControl.VisualLabel,{children:(0,e.__)("Padding","cozy-addons")}),(0,i.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,i.jsx)("button",{className:"cozy-link-styles "+(h?"":"cozy-attr-link-disabled"),onClick:()=>p(!h),children:(0,i.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,i.jsx)("path",{d:"M0.0553284 7.88029L0.0553284 13.2126H2.53381L2.53381 7.88029C2.82201 4.53678 5.6079 3.53757 6.94321 3.4415C10.9203 3.15534 12.1019 6.00678 12.3901 7.88029V13.2126L14.8398 13.2126V7.88029C14.1251 1.90809 9.2776 0.780139 6.94321 0.962687C1.84791 1.30857 0.0553284 5.92031 0.0553284 7.88029Z",fill:"black"}),(0,i.jsx)("path",{d:"M0.0553284 20.9042L0.0553284 15.5718H2.53381L2.53381 20.9042C2.82201 24.2477 5.6079 25.2469 6.94321 25.343C10.9203 25.6291 12.1019 22.7777 12.3901 20.9042V15.5718L14.8398 15.5718V20.9042C14.1251 26.8764 9.2776 28.0043 6.94321 27.8218C1.84791 27.4759 0.0553284 22.8641 0.0553284 20.9042Z",fill:"black"})]})}),(0,i.jsx)(t.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Top","cozy-addons"),value:o.boxStyles.padding.top,onChange:o=>y("top",o)}),(0,i.jsx)(t.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Right","cozy-addons"),value:o.boxStyles.padding.right,onChange:o=>y("right",o)}),(0,i.jsx)(t.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Bottom","cozy-addons"),value:o.boxStyles.padding.bottom,onChange:o=>y("bottom",o)}),(0,i.jsx)(t.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Left","cozy-addons"),value:o.boxStyles.padding.left,onChange:o=>y("left",o)})]})]}),(0,i.jsx)(t.SelectControl,{label:(0,e.__)("Border Type","cozy-addons"),value:o.boxStyles.borderType,options:[{label:(0,e.__)("None","cozy-addons"),value:"none"},{label:(0,e.__)("Solid","cozy-addons"),value:"solid"},{label:(0,e.__)("Double","cozy-addons"),value:"double"},{label:(0,e.__)("Dotted","cozy-addons"),value:"dotted"},{label:(0,e.__)("Dashed","cozy-addons"),value:"dashed"},{label:(0,e.__)("Groove","cozy-addons"),value:"groove"}],onChange:e=>r({...o,boxStyles:{...o.boxStyles,borderType:e}})}),"none"!==o.boxStyles.borderType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Border Width","cozy-addons"),min:1,max:50,step:1,value:o.boxStyles.borderWidth,onChange:e=>r({...o,boxStyles:{...o.boxStyles,borderWidth:Math.abs(e)}})}),(0,i.jsx)(n.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Border Color","cozy-addons"),colorSettings:[{label:(0,e.__)("Default","cozy-addons"),value:o.boxStyles.borderColor,onChange:e=>r({...o,boxStyles:{...o.boxStyles,borderColor:e}})},{label:(0,e.__)("Hover","cozy-addons"),value:o.boxStyles.borderColorHover,onChange:e=>r({...o,boxStyles:{...o.boxStyles,borderColorHover:e}})}]})]}),(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Border Radius","cozy-addons"),min:1,max:100,step:1,value:o.boxStyles.borderRadius,onChange:e=>r({...o,boxStyles:{...o.boxStyles,borderRadius:Math.abs(e)}})}),(0,i.jsx)(n.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Background Color","cozy-addons"),colorSettings:[{label:(0,e.__)("Default","cozy-addons"),value:o.boxStyles.bgColor,onChange:e=>r({...o,boxStyles:{...o.boxStyles,bgColor:e}})},{label:(0,e.__)("Hover","cozy-addons"),value:o.boxStyles.bgColorHover,onChange:e=>r({...o,boxStyles:{...o.boxStyles,bgColorHover:e}})}]})]}),(0,i.jsxs)(t.PanelBody,{title:(0,e.__)("Icon Styles","cozy-addons"),children:[(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Margin Top","cozy-addons"),min:-100,max:100,step:1,value:o?.margin?.top,onChange:e=>r({...o,margin:{...o.margin,top:e}})}),(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Margin Right","cozy-addons"),min:-100,max:100,step:1,value:o?.margin?.right,onChange:e=>r({...o,margin:{...o.margin,right:e}})}),(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Margin Bottom","cozy-addons"),min:-100,max:100,step:1,value:o?.margin?.bottom,onChange:e=>r({...o,margin:{...o.margin,bottom:e}})}),(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Margin Left","cozy-addons"),min:-100,max:100,step:1,value:o?.margin?.left,onChange:e=>r({...o,margin:{...o.margin,left:e}})}),(0,i.jsx)(t.TextControl,{label:(0,e.__)("Size","cozy-addons"),type:"number",value:o.iconSize,onChange:e=>r({...o,iconSize:Math.abs(e)})}),(0,i.jsx)(t.RangeControl,{label:(0,e.__)("Opacity","cozy-addons"),min:0,max:1,step:.1,value:o.iconOpacity,onChange:e=>r({...o,iconOpacity:Math.abs(e)})}),(0,i.jsx)(n.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Color","cozy-addons"),colorSettings:[{label:(0,e.__)("Default","cozy-addons"),value:o.iconColor,onChange:e=>r({...o,iconColor:e})},{label:(0,e.__)("Hover","cozy-addons"),value:o.iconColorHover,onChange:e=>r({...o,iconColorHover:e})}]})]})]},"style")]})},save:function({attributes:o}){const{blockClientId:e}=o,n=`cozyBlock_${(t=e,t.replace(/[;=()\s]/g,"")).replace(/-/gi,"_")}`;var t;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:`cozy-block-icon-picker ${o.view}`,id:n,children:["fill"===o.layout&&(0,i.jsx)("svg",{width:o.iconSize,height:o.iconSize,viewBox:`${o.iconViewBox.vx} ${o.iconViewBox.vy} ${o.iconViewBox.vw} ${o.iconViewBox.vh}`,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:o.iconColor,children:(0,i.jsx)("path",{d:o.iconPath})}),"outline"===o.layout&&(0,i.jsx)("svg",{width:o.iconSize+5,height:o.iconSize+5,viewBox:`${parseInt(o.iconViewBox.vx)-1.5} ${parseInt(o.iconViewBox.vy)-1.5} ${parseInt(o.iconViewBox.vw)+3} ${parseInt(o.iconViewBox.vh)+3}`,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:"none",stroke:o.iconColor,strokeOpacity:o.iconOpacity,strokeWidth:o.strokeWidth,children:(0,i.jsx)("path",{d:o.iconPath})})]})})}})}},n={};function t(o){var l=n[o];if(void 0!==l)return l.exports;var i=n[o]={exports:{}};return e[o](i,i.exports,t),i.exports}t.m=e,o=[],t.O=(e,n,l,i)=>{if(!n){var a=1/0;for(d=0;d<o.length;d++){for(var[n,l,i]=o[d],s=!0,r=0;r<n.length;r++)(!1&i||a>=i)&&Object.keys(t.O).every((o=>t.O[o](n[r])))?n.splice(r--,1):(s=!1,i<a&&(a=i));if(s){o.splice(d--,1);var c=l();void 0!==c&&(e=c)}}return e}i=i||0;for(var d=o.length;d>0&&o[d-1][2]>i;d--)o[d]=o[d-1];o[d]=[n,l,i]},t.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),(()=>{var o={57:0,350:0};t.O.j=e=>0===o[e];var e=(e,n)=>{var l,i,[a,s,r]=n,c=0;if(a.some((e=>0!==o[e]))){for(l in s)t.o(s,l)&&(t.m[l]=s[l]);if(r)var d=r(t)}for(e&&e(n);c<a.length;c++)i=a[c],t.o(o,i)&&o[i]&&o[i][0](),o[i]=0;return t.O(d)},n=globalThis.webpackChunkicon_picker=globalThis.webpackChunkicon_picker||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})();var l=t.O(void 0,[350],(()=>t(280)));l=t.O(l)})();
Save
Back