FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
social-icon
/
build
Edit File: index.js
(()=>{"use strict";var o,e={409:()=>{const o=window.wp.blocks,e=window.wp.i18n,l=window.wp.blockEditor,t=window.wp.components,n=window.wp.data,c=window.React,i=window.wp.primitives,s=(0,c.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,c.createElement)(i.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"})),a=window.wp.element,r=window.ReactJSXRuntime,d=()=>(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",marginBottom:"10px"},children:[(0,r.jsx)("p",{children:(0,r.jsxs)("svg",{width:"41",height:"48",viewBox:"0 0 41 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.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,r.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,r.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,r.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,r.jsx)("h2",{style:{fontSize:"18px",fontFamily:"Inter",marginTop:"-5px",marginBottom:"15px"},children:(0,e.__)("Access Without Limits!","cozy-addons")}),(0,r.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,r.jsx)("a",{href:"https://cozythemes.com/pricing-and-plans/",target:"_blank",children:(0,r.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,r.jsxs)("div",{style:{display:"flex",gap:"5px",margin:"0"},children:[(0,r.jsx)("div",{children:(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.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,r.jsx)("div",{children:(0,e.__)("Upgrade to Pro","cozy-addons")})]})})})]})}),C=(0,a.memo)((()=>{const o=(0,l.useInnerBlocksProps)({className:"cozy-social-icon-wrapper"},{allowedBlocks:["cozy-block/social-icon-picker"],template:[["cozy-block/social-icon-picker",{iconDefaultColor:cozySocialIcons.collection.facebook.defaultColor,bgDefaultColor:cozySocialIcons.collection.facebook.defaultColor}],["cozy-block/social-icon-picker",{iconPath:"M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z",iconViewBox:{vx:0,vy:0,vw:24,vh:24},iconDefaultColor:cozySocialIcons.collection.twitter.defaultColor,bgDefaultColor:cozySocialIcons.collection.twitter.defaultColor}],["cozy-block/social-icon-picker",{iconPath:"M23.2084 2.60777C22.9358 1.58129 22.1326 0.772873 21.1128 0.498524C19.2642 0 11.8519 0 11.8519 0C11.8519 0 4.43954 0 2.59097 0.498524C1.57114 0.772917 0.767925 1.58129 0.495312 2.60777C0 4.46832 0 8.35017 0 8.35017C0 8.35017 0 12.232 0.495312 14.0926C0.767925 15.1191 1.57114 15.8938 2.59097 16.1681C4.43954 16.6667 11.8519 16.6667 11.8519 16.6667C11.8519 16.6667 19.2642 16.6667 21.1128 16.1681C22.1326 15.8938 22.9358 15.1191 23.2084 14.0926C23.7037 12.232 23.7037 8.35017 23.7037 8.35017C23.7037 8.35017 23.7037 4.46832 23.2084 2.60777ZM9.4276 11.8746V4.82574L15.6229 8.35026L9.4276 11.8746Z",iconViewBox:{vx:0,vy:0,vw:24,vh:17},iconDefaultColor:cozySocialIcons.collection.youtube.defaultColor,bgDefaultColor:cozySocialIcons.collection.youtube.defaultColor}],["cozy-block/social-icon-picker",{iconPath:"M10.946 5.33081C7.84058 5.33081 5.33569 7.83569 5.33569 10.9412C5.33569 14.0466 7.84058 16.5515 10.946 16.5515C14.0515 16.5515 16.5564 14.0466 16.5564 10.9412C16.5564 7.83569 14.0515 5.33081 10.946 5.33081ZM10.946 14.5886C8.93921 14.5886 7.29858 12.9529 7.29858 10.9412C7.29858 8.92944 8.93433 7.2937 10.946 7.2937C12.9578 7.2937 14.5935 8.92944 14.5935 10.9412C14.5935 12.9529 12.9529 14.5886 10.946 14.5886ZM18.0945 5.10132C18.0945 5.82886 17.5085 6.40991 16.7859 6.40991C16.0584 6.40991 15.4773 5.82397 15.4773 5.10132C15.4773 4.37866 16.0632 3.79272 16.7859 3.79272C17.5085 3.79272 18.0945 4.37866 18.0945 5.10132ZM21.8103 6.42944C21.7273 4.67651 21.3269 3.12378 20.0427 1.84448C18.7634 0.565185 17.2107 0.164795 15.4578 0.0769043C13.6511 -0.0256348 8.23608 -0.0256348 6.42944 0.0769043C4.6814 0.159912 3.12866 0.560303 1.84448 1.8396C0.560303 3.1189 0.164795 4.67163 0.0769043 6.42456C-0.0256348 8.2312 -0.0256348 13.6462 0.0769043 15.4529C0.159912 17.2058 0.560303 18.7585 1.84448 20.0378C3.12866 21.3171 4.67651 21.7175 6.42944 21.8054C8.23608 21.908 13.6511 21.908 15.4578 21.8054C17.2107 21.7224 18.7634 21.322 20.0427 20.0378C21.322 18.7585 21.7224 17.2058 21.8103 15.4529C21.9128 13.6462 21.9128 8.23608 21.8103 6.42944ZM19.4763 17.3914C19.0955 18.3484 18.3582 19.0857 17.3962 19.4714C15.9558 20.0427 12.5378 19.9109 10.946 19.9109C9.35425 19.9109 5.9314 20.0378 4.49585 19.4714C3.53882 19.0906 2.80151 18.3533 2.41577 17.3914C1.84448 15.9509 1.97632 12.533 1.97632 10.9412C1.97632 9.34937 1.84937 5.92651 2.41577 4.49097C2.79663 3.53394 3.53394 2.79663 4.49585 2.41089C5.93628 1.8396 9.35425 1.97144 10.946 1.97144C12.5378 1.97144 15.9607 1.84448 17.3962 2.41089C18.3533 2.79175 19.0906 3.52905 19.4763 4.49097C20.0476 5.9314 19.9158 9.34937 19.9158 10.9412C19.9158 12.533 20.0476 15.9558 19.4763 17.3914Z",iconViewBox:{vx:0,vy:0,vw:22,vh:22},iconDefaultColor:cozySocialIcons.collection.instagram.defaultColor,bgDefaultColor:cozySocialIcons.collection.instagram.defaultColor}]]});return(0,r.jsx)("div",{...o})})),y=(0,a.memo)((({clientId:c})=>{const{insertBlock:i,selectBlock:a}=(0,n.useDispatch)(l.store),d=(0,n.useSelect)((o=>o(l.store).getBlock(c).innerBlocks));return(0,r.jsxs)(t.ToolbarGroup,{children:[(0,r.jsx)(t.ToolbarButton,{icon:s,onClick:()=>{const e=(0,o.createBlock)("cozy-block/social-icon-picker",{bgDefaultColor:cozySocialIcons.collection.facebook.defaultColor,iconDefaultColor:cozySocialIcons.collection.facebook.defaultColor});i(e,d.length,c,!1),a(e.clientId)},children:(0,e.__)("Add Icon","cozy-addons")}),","]})})),u=(0,a.memo)((({attributes:o,blockId:e,clientId:t})=>{const n=`\n #${e} .cozy-block-social-icon-picker {\n margin-right: ${o.gap}px;\n }\n #${e}.stacked .cozy-block-social-icon-picker {\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 }\n #${e}.stacked.icon-color-custom .cozy-block-social-icon-picker {\n background: ${o.boxStyles.bgColor};\n }\n #${e}.stacked .cozy-block-social-icon-picker:hover {\n border-color: ${o.boxStyles.borderColorHover};\n }\n #${e}.stacked.icon-color-custom .cozy-block-social-icon-picker:hover {\n background: ${o.boxStyles.bgColorHover};\n }\n #${e} svg{\n width: ${o.iconSize}px !important;\n height: ${o.iconSize}px !important;\n opacity: ${o.iconOpacity};\n }\n #${e}.fill.icon-color-custom svg {\n fill: ${o.iconColor};\n }\n #${e}.fill.icon-color-custom .cozy-block-social-icon-picker:hover svg {\n fill: ${o.iconColorHover};\n }\n #${e}.outline.icon-color-custom svg{\n stroke: ${o.iconColor};\n fill: none;\n }\n #${e}.outline.icon-color-custom .cozy-block-social-icon-picker:hover svg {\n stroke: ${o.iconColorHover};\n fill: none;\n }\n `;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.BlockControls,{children:(0,r.jsx)(y,{clientId:t})}),(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:n}}),(0,r.jsx)("div",{className:`cozy-block-social-icon ${o.view} ${o.layout} icon-color-${o.iconColorLayout}`,id:e,children:(0,r.jsx)(C,{})})]})})),b=JSON.parse('{"UU":"cozy-block/social-icon","DD":"Social Icons"}'),x=(0,r.jsxs)("svg",{width:"27",height:"23",viewBox:"0 0 27 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("rect",{width:"13",height:"11",fill:"#0C50FF"}),(0,r.jsx)("rect",{y:"12",width:"13",height:"11",fill:"#0C50FF"}),(0,r.jsx)("rect",{x:"14",width:"13",height:"11",fill:"#0C50FF"}),(0,r.jsx)("rect",{x:"14",y:"12",width:"13",height:"11",fill:"#0C50FF"}),(0,r.jsx)("path",{d:"M22.5128 2H23.5861L21.2411 4.96547L24 9H21.8399L20.1482 6.55276L18.2122 9H17.1382L19.6466 5.82801L17 2.00032H19.2149L20.7441 4.23717L22.5128 2ZM22.1363 8.28945H22.731L18.8917 2.67344H18.2536L22.1363 8.28945Z",fill:"white"}),(0,r.jsx)("path",{d:"M5.65446 8.92242V6.58636H4.93287V5.51288H5.65446V5.05035C5.65446 3.85451 6.19346 3.30035 7.36304 3.30035C7.48 3.30035 7.64158 3.31265 7.79121 3.3305C7.90328 3.34208 8.01446 3.36115 8.124 3.38759V4.36095C8.06067 4.35502 7.99714 4.3515 7.93354 4.35041C7.86229 4.34855 7.79102 4.34768 7.71975 4.34778C7.51354 4.34778 7.35254 4.37588 7.23121 4.43823C7.14964 4.47931 7.08107 4.54235 7.03317 4.62032C6.95792 4.74327 6.92408 4.91159 6.92408 5.1332V5.51288H8.06712L7.95454 6.12851L7.87083 6.58636H6.92408V9C8.65717 8.78981 10 7.30884 10 5.51288C10 3.57289 8.43287 2 6.5 2C4.56712 2 3 3.57289 3 5.51288C3 7.16042 4.12992 8.54274 5.65446 8.92242Z",fill:"white"}),(0,r.jsx)("path",{d:"M24.3328 15.7823C24.2408 15.4744 23.9697 15.2319 23.6255 15.1496C23.0017 15 20.5 15 20.5 15C20.5 15 17.9983 15 17.3745 15.1496C17.0303 15.2319 16.7592 15.4744 16.6672 15.7823C16.5 16.3405 16.5 17.5051 16.5 17.5051C16.5 17.5051 16.5 18.6696 16.6672 19.2278C16.7592 19.5357 17.0303 19.7681 17.3745 19.8504C17.9983 20 20.5 20 20.5 20C20.5 20 23.0017 20 23.6255 19.8504C23.9697 19.7681 24.2408 19.5357 24.3328 19.2278C24.5 18.6696 24.5 17.5051 24.5 17.5051C24.5 17.5051 24.5 16.3405 24.3328 15.7823ZM19.6818 18.5624V16.4477L21.7727 17.5051L19.6818 18.5624Z",fill:"white"}),(0,r.jsx)("path",{d:"M6.48522 15.977C5.63391 15.977 4.94724 16.6638 4.94724 17.5153C4.94724 18.3668 5.63391 19.0537 6.48522 19.0537C7.33653 19.0537 8.0232 18.3668 8.0232 17.5153C8.0232 16.6638 7.33653 15.977 6.48522 15.977ZM6.48522 18.5155C5.93508 18.5155 5.48533 18.0669 5.48533 17.5153C5.48533 16.9637 5.93374 16.5152 6.48522 16.5152C7.0367 16.5152 7.48511 16.9637 7.48511 17.5153C7.48511 18.0669 7.03536 18.5155 6.48522 18.5155ZM8.44484 15.9141C8.44484 16.1136 8.28422 16.2729 8.08611 16.2729C7.88667 16.2729 7.72738 16.1122 7.72738 15.9141C7.72738 15.7159 7.88801 15.5553 8.08611 15.5553C8.28422 15.5553 8.44484 15.7159 8.44484 15.9141ZM9.46347 16.2783C9.44071 15.7976 9.33095 15.3719 8.97892 15.0211C8.62822 14.6703 8.20257 14.5605 7.72203 14.5364C7.22677 14.5083 5.74233 14.5083 5.24707 14.5364C4.76788 14.5592 4.34222 14.669 3.99018 15.0197C3.63815 15.3705 3.52973 15.7963 3.50563 16.2769C3.47752 16.7723 3.47752 18.2571 3.50563 18.7524C3.52839 19.2331 3.63815 19.6588 3.99018 20.0096C4.34222 20.3604 4.76654 20.4702 5.24707 20.4943C5.74233 20.5224 7.22677 20.5224 7.72203 20.4943C8.20257 20.4715 8.62822 20.3617 8.97892 20.0096C9.32962 19.6588 9.43938 19.2331 9.46347 18.7524C9.49158 18.2571 9.49158 16.7736 9.46347 16.2783ZM8.82365 19.2839C8.71924 19.5464 8.51712 19.7485 8.25343 19.8543C7.85856 20.0109 6.92158 19.9748 6.48522 19.9748C6.04886 19.9748 5.11054 20.0096 4.71701 19.8543C4.45466 19.7499 4.25254 19.5477 4.14679 19.2839C3.99018 18.889 4.02632 17.9518 4.02632 17.5153C4.02632 17.0789 3.99152 16.1404 4.14679 15.7467C4.2512 15.4843 4.45332 15.2822 4.71701 15.1764C5.11188 15.0197 6.04886 15.0559 6.48522 15.0559C6.92158 15.0559 7.8599 15.0211 8.25343 15.1764C8.51578 15.2808 8.7179 15.483 8.82365 15.7467C8.98026 16.1417 8.94412 17.0789 8.94412 17.5153C8.94412 17.9518 8.98026 18.8903 8.82365 19.2839Z",fill:"white"})]}),h=(0,a.memo)((({blockId:o,attributes:e,view:l,layout:t,iconColorLayout:n})=>{const c=`\n #${o}.stacked.icon-color-default {\n background: ${e.bgDefaultColor};\n }\n #${o}.stacked.fill.icon-color-default svg {\n fill: ${e.iconColor};\n }\n #${o}.stacked.outline.icon-color-default svg {\n stroke: ${e.iconColor};\n fill: none;\n }\n #${o}.fill.icon-color-default svg {\n fill: ${e.iconDefaultColor};\n }\n #${o}.outline.icon-color-default svg {\n stroke: ${e.iconDefaultColor};\n fill: none;\n }\n `;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:c}}),(0,r.jsx)("div",{className:`cozy-block-social-icon-picker ${l} ${t} icon-color-${n}`,id:o,children:(0,r.jsx)("svg",{viewBox:`${e.iconViewBox.vx} ${e.iconViewBox.vy} ${e.iconViewBox.vw} ${e.iconViewBox.vh}`,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,r.jsx)("path",{d:e.iconPath})})})]})}));(0,o.registerBlockType)("cozy-block/social-icon-picker",{title:(0,e.__)("Icon","cozy-addons"),category:"cozy-block",textdomain:"cozy-addons",icon:()=>(0,r.jsxs)("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("circle",{cx:"2.5",cy:"6.5",r:"2.5",fill:"#B2BCF9"}),(0,r.jsx)("path",{d:"M12.7679 11.1119C12.7679 12.4926 11.6486 13.6119 10.2679 13.6119C8.88721 13.6119 7.76792 12.4926 7.76792 11.1119C7.76792 9.73115 8.88721 8.61185 10.2679 8.61185C11.6486 8.61185 12.7679 9.73115 12.7679 11.1119Z",fill:"#B2BCF9"}),(0,r.jsx)("path",{d:"M11.5 2.06301C11.5 3.16757 10.6046 4.06301 9.5 4.06301C8.39543 4.06301 7.5 3.16757 7.5 2.06301C7.5 0.95845 8.39543 0.0630094 9.5 0.0630094C10.6046 0.0630094 11.5 0.95845 11.5 2.06301Z",fill:"#B2BCF9"}),(0,r.jsx)("path",{d:"M8.97826 2L4 5.28261L4.5 6L9 3L8.97826 2Z",fill:"#B2BCF9"}),(0,r.jsx)("path",{d:"M8.5 10L4.5 7L4 7.5L8 10.5L8.5 10Z",fill:"#B2BCF9"})]}),attributes:{blockClientId:{type:"string",default:""},iconViewBox:{type:"object",default:{vx:0,vy:0,vw:14,vh:25}},iconPath:{type:"string",default:"M12.5122 14.0625L13.2065 9.53809H8.86523V6.60205C8.86523 5.36426 9.47168 4.15771 11.416 4.15771H13.3896V0.305664C13.3896 0.305664 11.5986 0 9.88623 0C6.31104 0 3.97412 2.16699 3.97412 6.08984V9.53809H0V14.0625H3.97412V25H8.86523V14.0625H12.5122Z"},parentAttrs:{type:"object",default:{view:"stacked",layout:"fill",iconColorLayout:"default"}},iconDefaultColor:{type:"string",default:""},iconFallbackColor:{type:"string",default:"#000"},iconColor:{type:"string",default:"#fff"},iconColorHover:{type:"string",default:""},bgDefaultColor:{type:"string",default:""},bgColorHover:{type:"string",default:""},iconOpacity:{type:"number",default:""},url:{type:"string",default:""}},edit:function({attributes:o,setAttributes:c,clientId:i}){o.blockClientId=i;const s=`cozyBlock_${i.replace(/-/gi,"_")}`,C=(0,n.select)("core/block-editor").getBlockRootClientId(i),y=(0,n.useSelect)((o=>o("core/block-editor").getBlockAttributes(C)),[C]);let u="stacked",b="fill",x="default";y&&(u=y.view,b=y.layout,x=y.iconColorLayout),(0,a.useEffect)((()=>{const o=(0,n.select)("core/block-editor").getBlock(i);if(o){const e={...o.attributes,parentAttrs:{...o.attributes.parentAttrs,view:y.view,layout:y.layout,iconColorLayout:y.iconColorLayout}};(0,n.dispatch)("core/block-editor").updateBlockAttributes(i,e)}}),[y]);const[p,g]=(0,a.useState)(""),v=Object.keys(cozySocialIcons.collection).filter((o=>o.toLowerCase().includes(p.toLowerCase())));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h,{blockId:s,attributes:o,view:u,layout:b,iconColorLayout:x}),(0,r.jsxs)(l.InspectorControls,{children:[(0,r.jsxs)(t.PanelBody,{title:(0,e.__)("Icon Styles","cozy-addons"),children:[(0,r.jsxs)(t.BaseControl,{children:[(0,r.jsx)(t.BaseControl.VisualLabel,{children:(0,e.__)("Select Icon","cozy-addons")}),(0,r.jsx)("input",{type:"text",className:"cozy-icon-search",placeholder:(0,e.__)("Search Icons...","cozy-addons"),value:p,onChange:o=>{g(o.target.value)}}),(0,r.jsx)("div",{className:"cozy-icon-list",children:v.map((e=>{const l=cozySocialIcons.collection[e].logo,n=cozySocialIcons.collection[e].defaultColor,i=l.match(/d="([^"]+)"/),s=l.match(/viewBox\s*=\s*"([^"]*)"/),a=i?i[1]:"",d=s?s[1]:"";return(0,r.jsx)(t.Button,{onClick:()=>((e,l,t)=>{const n=l.split(" ");c({...o,iconPath:e,iconViewBox:{vx:n[0],vy:n[1],vw:n[2],vh:n[3]},bgDefaultColor:t,iconDefaultColor:t})})(a,d,n),children:(0,r.jsx)("div",{className:"cozy-icon",title:e,dangerouslySetInnerHTML:{__html:l}})},e)}))})]}),(0,r.jsx)(t.TextControl,{label:(0,e.__)("Url","cozy-addons"),type:"url",value:o.url,onChange:e=>c({...o,url:e}),placeholder:"#"})]}),!cozyBlockAssets.isPremium&&(0,r.jsx)(d,{})]})]})},save:function({attributes:o}){const e=`cozyBlock_${o.blockClientId.replace(/-/gi,"_")}`,l=`\n #${e}.stacked.icon-color-default {\n background: ${o.bgDefaultColor};\n }\n #${e}.stacked.fill.icon-color-default svg {\n fill: ${o.iconColor};\n }\n #${e}.stacked.outline.icon-color-default svg {\n stroke: ${o.iconColor};\n fill: none;\n }\n #${e}.fill.icon-color-default svg {\n fill: ${o.iconDefaultColor};\n }\n #${e}.outline.icon-color-default svg {\n stroke: ${o.iconDefaultColor};\n fill: none;\n }\n `;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:l}}),(0,r.jsx)("a",{href:`${o.url.length>0?o.url:"#"}`,target:o.url.length>0?"_blank":"",rel:"noopener",children:(0,r.jsx)("div",{className:`cozy-block-social-icon-picker ${o.parentAttrs.view} ${o.parentAttrs.layout} icon-color-${o.parentAttrs.iconColorLayout}`,id:e,children:(0,r.jsx)("svg",{viewBox:`${o.iconViewBox.vx} ${o.iconViewBox.vy} ${o.iconViewBox.vw} ${o.iconViewBox.vh}`,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,r.jsx)("path",{d:o.iconPath})})})})]})},supports:{inserter:!1}}),(0,o.registerBlockType)(b.UU,{title:(0,e.__)(b.DD,"cozy-addons"),description:(0,e.__)("Foster online connections effortlessly using our 'Social Icons' block, allowing you to effortlessly integrate and showcase your social media profiles directly on your website.","cozy-addons"),icon:{src:x},example:{attributes:{cover:cozyBlockAssets.imageDir+"/preview_social_icons.jpg"},viewportWidth:1260},edit:function({attributes:o,setAttributes:n,clientId:c}){if(o.blockClientId=c,o.cover)return(0,r.jsx)("img",{src:o.cover});const i=(0,l.useBlockProps)({className:"cozy-block-wrapper"}),s=`cozyBlock_${c.replace(/-/gi,"_")}`,[C,y]=(0,a.useState)(!0),b=(e,l)=>{let t={...o.boxStyles.padding};t={...t,top:Math.abs(l),right:Math.abs(l),bottom:Math.abs(l),left:Math.abs(l)},n(C?{...o,boxStyles:{...o.boxStyles,padding:t}}:{...o,boxStyles:{...o.boxStyles,padding:{...o.boxStyles.padding,[e]:Math.abs(l)}}})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{...i,children:(0,r.jsx)(u,{attributes:o,blockId:s,clientId:c})}),(0,r.jsxs)(l.InspectorControls,{group:"settings",children:[(0,r.jsxs)(t.PanelBody,{title:(0,e.__)("General","cozy-addons"),children:[(0,r.jsx)(t.SelectControl,{label:(0,e.__)("Icon 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=>n({...o,view:e})}),(0,r.jsx)(t.SelectControl,{label:(0,e.__)("Icon 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=>n({...o,layout:e})}),(0,r.jsx)(t.SelectControl,{label:(0,e.__)("Icon Color Layout","cozy-addons"),options:[{label:(0,e.__)("Default","cozy-addons"),value:"default"},{label:(0,e.__)("Custom","cozy-addons"),value:"custom"}],value:o.iconColorLayout,onChange:e=>n({...o,iconColorLayout:e})}),(0,r.jsx)(t.RangeControl,{label:(0,e.__)("Gap","cozy-addons"),min:1,max:100,step:1,value:o.gap,onChange:e=>n({...o,gap:Math.abs(e)})})]}),!cozyBlockAssets.isPremium&&(0,r.jsx)(d,{})]},"setting"),(0,r.jsxs)(l.InspectorControls,{group:"styles",children:["stacked"===o.view&&(0,r.jsxs)(t.PanelBody,{title:(0,e.__)("Icon Box Styles","cozy-addons"),children:[(0,r.jsxs)(t.BaseControl,{children:[(0,r.jsx)(t.BaseControl.VisualLabel,{children:(0,e.__)("Padding","cozy-addons")}),(0,r.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,r.jsx)("button",{className:"cozy-link-styles "+(C?"":"cozy-attr-link-disabled"),onClick:()=>y(!C),children:(0,r.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,r.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,r.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,r.jsx)(t.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Top","cozy-addons"),value:o.boxStyles.padding.top,onChange:o=>b("top",o)}),(0,r.jsx)(t.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Right","cozy-addons"),value:o.boxStyles.padding.right,onChange:o=>b("right",o)}),(0,r.jsx)(t.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Bottom","cozy-addons"),value:o.boxStyles.padding.bottom,onChange:o=>b("bottom",o)}),(0,r.jsx)(t.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Left","cozy-addons"),value:o.boxStyles.padding.left,onChange:o=>b("left",o)})]})]}),(0,r.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=>n({...o,boxStyles:{...o.boxStyles,borderType:e}})}),"none"!==o.boxStyles.borderType&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.RangeControl,{label:(0,e.__)("Border Width","cozy-addons"),min:1,max:50,step:1,value:o.boxStyles.borderWidth,onChange:e=>n({...o,boxStyles:{...o.boxStyles,borderWidth:Math.abs(e)}})}),(0,r.jsx)(l.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Border Color","cozy-addons"),colorSettings:[{label:(0,e.__)("Normal","cozy-addons"),value:o.boxStyles.borderColor,onChange:e=>n({...o,boxStyles:{...o.boxStyles,borderColor:e}})},{label:(0,e.__)("Hover","cozy-addons"),value:o.boxStyles.borderColorHover,onChange:e=>n({...o,boxStyles:{...o.boxStyles,borderColorHover:e}})}]})]}),(0,r.jsx)(t.RangeControl,{label:(0,e.__)("Border Radius","cozy-addons"),min:1,max:100,step:1,value:o.boxStyles.borderRadius,onChange:e=>n({...o,boxStyles:{...o.boxStyles,borderRadius:Math.abs(e)}})}),"custom"===o.iconColorLayout&&(0,r.jsx)(l.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Background Color","cozy-addons"),colorSettings:[{label:(0,e.__)("Normal","cozy-addons"),value:o.boxStyles.bgColor,onChange:e=>n({...o,boxStyles:{...o.boxStyles,bgColor:e}})},{label:(0,e.__)("Hover","cozy-addons"),value:o.boxStyles.bgColorHover,onChange:e=>n({...o,boxStyles:{...o.boxStyles,bgColorHover:e}})}]})]}),(0,r.jsxs)(t.PanelBody,{title:(0,e.__)("Icon Styles","cozy-addons"),children:[(0,r.jsx)(t.TextControl,{label:(0,e.__)("Size","cozy-addons"),type:"number",value:o.iconSize,onChange:e=>n({...o,iconSize:Math.abs(e)})}),(0,r.jsx)(t.RangeControl,{label:(0,e.__)("Opacity","cozy-addons"),min:0,max:1,step:.1,value:o.iconOpacity,onChange:e=>n({...o,iconOpacity:Math.abs(e)})}),"custom"===o.iconColorLayout&&(0,r.jsx)(l.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Color","cozy-addons"),colorSettings:[{label:(0,e.__)("Normal","cozy-addons"),value:o.iconColor,onChange:e=>n({...o,iconColor:e})},{label:(0,e.__)("Hover","cozy-addons"),value:o.iconColorHover,onChange:e=>n({...o,iconColorHover:e})}]})]})]},"style")]})},save:function({attributes:o}){const{blockClientId:e}=o,t=`cozyBlock_${(n=e,n.replace(/[;=()\s]/g,"")).replace(/-/gi,"_")}`;var n;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:`cozy-block-social-icon ${o.view} ${o.layout} icon-color-${o.iconColorLayout}`,id:t,children:(0,r.jsx)(l.InnerBlocks.Content,{})})})}})}},l={};function t(o){var n=l[o];if(void 0!==n)return n.exports;var c=l[o]={exports:{}};return e[o](c,c.exports,t),c.exports}t.m=e,o=[],t.O=(e,l,n,c)=>{if(!l){var i=1/0;for(d=0;d<o.length;d++){for(var[l,n,c]=o[d],s=!0,a=0;a<l.length;a++)(!1&c||i>=c)&&Object.keys(t.O).every((o=>t.O[o](l[a])))?l.splice(a--,1):(s=!1,c<i&&(i=c));if(s){o.splice(d--,1);var r=n();void 0!==r&&(e=r)}}return e}c=c||0;for(var d=o.length;d>0&&o[d-1][2]>c;d--)o[d]=o[d-1];o[d]=[l,n,c]},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,l)=>{var n,c,[i,s,a]=l,r=0;if(i.some((e=>0!==o[e]))){for(n in s)t.o(s,n)&&(t.m[n]=s[n]);if(a)var d=a(t)}for(e&&e(l);r<i.length;r++)c=i[r],t.o(o,c)&&o[c]&&o[c][0](),o[c]=0;return t.O(d)},l=globalThis.webpackChunksocial_icon=globalThis.webpackChunksocial_icon||[];l.forEach(e.bind(null,0)),l.push=e.bind(null,l.push.bind(l))})();var n=t.O(void 0,[350],(()=>t(409)));n=t.O(n)})();
Save
Back