FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
cozy-addons
/
cozy-blocks
/
dist
/
sidebar-panel
/
build
Edit File: index.js
(()=>{"use strict";var o,e={507:()=>{const o=window.wp.blocks,e=window.wp.i18n,n=window.wp.blockEditor,l=window.wp.components,a=window.wp.primitives,t=window.ReactJSXRuntime,i=(0,t.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(a.Path,{d:"M5 11.25h14v1.5H5z"})}),s=(0,t.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(a.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})}),c=(0,t.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(a.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})}),r=(0,t.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(a.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})}),d=(0,t.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(a.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})}),p=(0,t.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(a.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})}),y=window.wp.element,h=window.wp.data,g=()=>(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"16px",marginBottom:"10px"},children:[(0,t.jsx)("p",{children:(0,t.jsxs)("svg",{width:"41",height:"48",viewBox:"0 0 41 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.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,t.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,t.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,t.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,t.jsx)("h2",{style:{fontSize:"18px",fontFamily:"Inter",marginTop:"-5px",marginBottom:"15px"},children:(0,e.__)("Access Without Limits!","cozy-addons")}),(0,t.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,t.jsx)("a",{href:"https://cozythemes.com/pricing-and-plans/",target:"_blank",children:(0,t.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,t.jsxs)("div",{style:{display:"flex",gap:"5px",margin:"0"},children:[(0,t.jsx)("div",{children:(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.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,t.jsx)("div",{children:(0,e.__)("Upgrade to Pro","cozy-addons")})]})})})]})}),x=(0,y.memo)((({clientId:o,attributes:e})=>{const l=(0,h.select)("core/block-editor").getBlockOrder(o).length;return(0,t.jsxs)("div",{className:"cozy-sidebar-panel-wrapper",children:[(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:`sidebar-icon-wrapper close-icon-wrapper align-${e.closeIcon.alignment}`,children:(0,t.jsx)("svg",{className:"sidebar-close-icon",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M4.99999 4.058L8.29999 0.758003L9.24266 1.70067L5.94266 5.00067L9.24266 8.30067L8.29932 9.24334L4.99932 5.94334L1.69999 9.24334L0.757324 8.3L4.05732 5L0.757324 1.7L1.69999 0.75867L4.99999 4.058Z"})})})}),(0,t.jsx)(n.InnerBlocks,{renderAppender:l>0?void 0:n.InnerBlocks.ButtonBlockAppender})]})})),b=(0,y.memo)((({attributes:o,blockId:e,clientId:n})=>{const l=`\n #${e} .cozy-sidebar-panel-wrapper{\n padding: ${o.sidebarPadding.top}px ${o.sidebarPadding.right}px ${o.sidebarPadding.bottom}px ${o.sidebarPadding.left}px;\n background-color: ${o.bgColor};\n z-index: ${o.zIndex};\n }\n #${e}.layout-custom .cozy-sidebar-panel-wrapper {\n width: ${o.width}px;\n }\n #${e} .sidebar-icon-wrapper:not(.close-icon-wrapper) svg {\n width: ${o.iconSize}px;\n height: ${o.iconSize}px;\n rotate: ${o.iconRotate}deg;\n opacity: ${o.iconOpacity};\n }\n #${e}.icon-layout-fill .sidebar-icon-wrapper svg {\n fill: ${o.iconColor};\n }\n #${e}.icon-layout-outline .sidebar-icon-wrapper svg {\n stroke: ${o.iconColor};\n fill: none;\n }\n #${e}.icon-layout-fill .sidebar-icon-wrapper:hover svg, #${e}.icon-layout-fill .open-icon-wrapper:hover .sidebar-icon-wrapper svg {\n fill: ${o.iconColorHover};\n }\n #${e}.icon-layout-outline .sidebar-icon-wrapper:hover svg, #${e}.icon-layout-outline .open-icon-wrapper:hover .sidebar-icon-wrapper svg {\n stroke: ${o.iconColorHover};\n fill: none;\n }\n #${e}.icon-view-stacked .sidebar-icon-wrapper {\n padding: ${o.iconBoxStyles.padding.top}px ${o.iconBoxStyles.padding.right}px ${o.iconBoxStyles.padding.bottom}px ${o.iconBoxStyles.padding.left}px;\n border: ${o.iconBoxStyles.borderWidth}px ${o.iconBoxStyles.borderType} ${o.iconBoxStyles.borderColor};\n border-radius: ${o.iconBoxStyles.borderRadius}px;\n background-color: ${o.iconBoxStyles.bgColor};\n }\n #${e}.icon-view-stacked .sidebar-icon-wrapper:hover {\n background-color: ${o.iconBoxStyles.bgColorHover};\n border-color: ${o.iconBoxStyles.borderColorHover};\n }\n #${e} .relative {\n padding: ${o.closeIcon.verticalSpacing}px 0;\n margin: 0 ${o.closeIcon.horizontalSpacing}px;\n }\n #${e} .open-icon-wrapper {\n\t\tgap: ${o.openIcon.gap}px;\n\t\tfont-size: ${o.typography.fontSize}px;\n\t\tfont-weight: ${o.typography.fontWeight};\n\t\tfont-family: ${o.typography.fontFamily};\n\t\ttext-transform: ${o.typography?.letterCase};\n\t\ttext-decoration: ${o.typography?.decoration};\n\t\tline-height: ${o.typography?.lineHeight};\n\t\tletter-spacing: ${o.typography?.letterSpacing};\n \tcolor: ${o.typography.color};\n }\n #${e} .open-icon-wrapper:hover {\n color: ${o.typography.colorHover};\n }\n\t #${e}.icon-layout-fill .open-icon-wrapper .sidebar-icon-wrapper svg {\n fill: ${o.openIcon?.color?.icon};\n }\n #${e}.icon-layout-outline .open-icon-wrapper .sidebar-icon-wrapper svg {\n stroke: ${o.openIcon?.color?.icon};\n fill: none;\n }\n #${e}.icon-layout-fill .open-icon-wrapper:hover .sidebar-icon-wrapper svg {\n fill: ${o.openIcon?.color?.iconHover};\n }\n #${e}.icon-layout-outline .open-icon-wrapper:hover .sidebar-icon-wrapper svg {\n stroke: ${o.openIcon?.color?.iconHover};\n fill: none;\n }\n\t#${e}.icon-view-stacked .open-icon-wrapper .sidebar-icon-wrapper {\n\t\tbackground-color: ${o.openIcon?.color?.bg};\n\t}\n\t#${e}.icon-view-stacked .open-icon-wrapper:hover .sidebar-icon-wrapper {\n\t\tbackground-color: ${o.openIcon?.color?.bgHover};\n\t}\n `;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:l}}),""!=o.typography?.fontFamily&&null!=o.typography?.fontFamily&&(0,t.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css2?family=${o.typography?.fontFamily}:wght@100;200;300;400;500;600;700;800;900`}),(0,t.jsxs)("div",{className:`cozy-block-sidebar-panel layout-${o.sidebarLayout} ${o.position} icon-view-${o.iconView} icon-layout-${o.iconLayout}`,id:e,children:[(0,t.jsxs)("div",{className:"open-icon-wrapper",children:[o.openIcon.enableTitle&&"before"===o.openIcon.titlePosition&&(0,t.jsx)("p",{children:o.openIcon.title}),o.openIcon?.enableIcon&&(0,t.jsx)("div",{className:"sidebar-icon-wrapper",children:(0,t.jsx)("svg",{className:"sidebar-open-icon",width:o.iconSize,height:o.iconSize,viewBox:`${o.openIcon.viewBox.vx} ${o.openIcon.viewBox.vy} ${o.openIcon.viewBox.vw} ${o.openIcon.viewBox.vh}`,children:(0,t.jsx)("path",{d:o.openIcon.path})})}),o.openIcon.enableTitle&&"after"===o.openIcon.titlePosition&&(0,t.jsx)("p",{children:o.openIcon.title})]}),(0,t.jsx)(x,{clientId:n,attributes:o})]})]})})),v=JSON.parse('{"UU":"cozy-block/sidebar-panel","DD":"Sidebar Panel"}'),_=(0,t.jsxs)("svg",{width:"27",height:"22",viewBox:"0 0 27 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{fill:"none",x:"1",y:"1",width:"17",height:"20",stroke:"#0C50FF",strokeWidth:"2"}),(0,t.jsx)("line",{x1:"4",y1:"4.5",x2:"15",y2:"4.5",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("line",{x1:"4",y1:"6.5",x2:"13",y2:"6.5",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("line",{x1:"4",y1:"8.5",x2:"15",y2:"8.5",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("line",{x1:"4",y1:"10.5",x2:"11",y2:"10.5",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("line",{x1:"4",y1:"12.5",x2:"13",y2:"12.5",stroke:"#0C50FF",strokeOpacity:"0.5"}),(0,t.jsx)("rect",{x:"20",width:"7",height:"7",fill:"#0C50FF"}),(0,t.jsx)("path",{d:"M24.0686 3.5L24.9215 2.64713C25.0262 2.54247 25.0262 2.37278 24.9215 2.26804L24.732 2.07849C24.6273 1.97384 24.4576 1.97384 24.3529 2.07849L23.5 2.93136L22.6471 2.07849C22.5425 1.97384 22.3728 1.97384 22.268 2.07849L22.0785 2.26804C21.9738 2.3727 21.9738 2.54239 22.0785 2.64713L22.9314 3.5L22.0785 4.35287C21.9738 4.45753 21.9738 4.62722 22.0785 4.73196L22.268 4.92151C22.3727 5.02617 22.5425 5.02617 22.6471 4.92151L23.5 4.06864L24.3529 4.92151C24.4575 5.02617 24.6273 5.02617 24.732 4.92151L24.9215 4.73196C25.0262 4.6273 25.0262 4.45761 24.9215 4.35287L24.0686 3.5Z",fill:"white"})]});(0,o.registerBlockType)(v.UU,{title:(0,e.__)(v.DD,"cozy-addons"),description:(0,e.__)("Maximize versatility with our 'Sidebar Panel' block, seamlessly integrating a customizable sidebar drawer to display menus, latest posts, popular content, or any desired elements for a user-friendly and organized layout.","cozy-addons"),icon:{src:_},edit:function({attributes:o,setAttributes:a,clientId:h}){o.blockClientId=h;const x=(0,n.useBlockProps)({className:"cozy-block-wrapper"}),v=`cozyBlock_${h.replace(/-/gi,"_")}`,[_,u]=(0,y.useState)(""),C=Object.keys(cozyIcons.collection).filter((o=>o.toLowerCase().includes(_.toLowerCase()))),[w,m]=(0,y.useState)(!0),z=(e,n)=>{let l={...o.iconBoxStyles.padding};l={...l,top:Math.abs(n),right:Math.abs(n),bottom:Math.abs(n),left:Math.abs(n)},a(w?{...o,iconBoxStyles:{...o.iconBoxStyles,padding:l}}:{...o,iconBoxStyles:{...o.iconBoxStyles,padding:{...o.iconBoxStyles.padding,[e]:Math.abs(n)}}})},[j,I]=(0,y.useState)(!0),f=(e,n)=>{let l={...o.sidebarPadding};l={...l,top:Math.abs(n),right:Math.abs(n),bottom:Math.abs(n),left:Math.abs(n)},a(j?{...o,sidebarPadding:l}:{...o,sidebarPadding:{...o.sidebarPadding,[e]:Math.abs(n)}})},L=function(){let o=[{label:"Default",value:""}];if("object"==typeof cozyBlockAssets.googleFonts)for(let e in cozyBlockAssets.googleFonts)o.push({label:cozyBlockAssets.googleFonts[e],value:e});return o}(),[S,B]=(0,y.useState)("general");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{...x,children:(0,t.jsx)(b,{attributes:o,blockId:v,clientId:h})}),(0,t.jsxs)(n.InspectorControls,{group:"settings",children:[(0,t.jsxs)(l.PanelBody,{title:(0,e.__)("Sidebar Panel","cozy-addons"),opened:"general"===S,onToggle:()=>B("general"),children:[(0,t.jsx)(l.SelectControl,{label:(0,e.__)("Layout","cozy-addons"),options:[{label:(0,e.__)("Full Width","cozy-addons"),value:"full"},{label:(0,e.__)("Custom","cozy-addons"),value:"custom"}],value:o.sidebarLayout,onChange:e=>a({...o,sidebarLayout:e})}),"custom"===o.sidebarLayout&&(0,t.jsx)(l.RangeControl,{label:(0,e.__)("Width","cozy-addons"),min:100,max:1e3,step:1,value:o.width,onChange:e=>a({...o,width:Math.abs(e)})}),(0,t.jsx)(l.SelectControl,{label:(0,e.__)("Position","cozy-addons"),options:[{label:(0,e.__)("Left","cozy-addons"),value:"left"},{label:(0,e.__)("Right","cozy-addons"),value:"right"}],value:o.position,onChange:e=>a({...o,position:e})}),(0,t.jsx)(l.TextControl,{label:(0,e.__)("Z Index","cozy-addons"),type:"number",min:0,step:1,value:o.zIndex,onChange:e=>a({...o,zIndex:Math.abs(e)})}),(0,t.jsx)(l.TextControl,{label:(0,e.__)("Overlay Z Index","cozy-addons"),type:"number",min:0,step:1,value:o?.overlayZIndex,onChange:e=>a({...o,overlayZIndex:Math.abs(e)})})]}),(0,t.jsxs)(l.PanelBody,{title:(0,e.__)("Open Icon","cozy-addons"),opened:"open-icon"===S,onToggle:()=>B("open-icon"),children:[(0,t.jsx)(l.ToggleControl,{label:(0,e.__)("Enable Icon"),checked:o.openIcon?.enableIcon,onChange:e=>a({...o,openIcon:{...o.openIcon,enableIcon:e}})}),o.openIcon?.enableIcon&&(0,t.jsxs)(l.BaseControl,{children:[(0,t.jsx)(l.BaseControl.VisualLabel,{children:(0,e.__)("Select Icon","cozy-addons")}),(0,t.jsx)("input",{type:"text",className:"cozy-icon-search",placeholder:(0,e.__)("Search Icons...","cozy-addons"),value:_,onChange:o=>{u(o.target.value)}}),(0,t.jsx)("div",{className:"cozy-icon-list",children:C.map((e=>{const n=cozyIcons.collection[e],i=n.match(/d="([^"]+)"/),s=n.match(/viewBox\s*=\s*"([^"]*)"/),c=i?i[1]:"",r=s?s[1]:"";return(0,t.jsx)(l.Button,{onClick:()=>((e,n)=>{const l=n.split(" ");a({...o,openIcon:{...o.openIcon,path:e,viewBox:{vx:l[0],vy:l[1],vw:l[2],vh:l[3]}}})})(c,r),children:(0,t.jsx)("div",{className:"cozy-icon",title:e,dangerouslySetInnerHTML:{__html:n}})},e)}))})]}),(0,t.jsx)(l.ToggleControl,{label:(0,e.__)("Enable Title"),checked:o.openIcon.enableTitle,onChange:e=>a({...o,openIcon:{...o.openIcon,enableTitle:e}})}),o.openIcon.enableTitle&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.SelectControl,{label:(0,e.__)("Title Position","cozy-addons"),options:[{label:(0,e.__)("Before Icon","cozy-addons"),value:"before"},{label:(0,e.__)("After Icon","cozy-addons"),value:"after"}],value:o.openIcon.titlePosition,onChange:e=>a({...o,openIcon:{...o.openIcon,titlePosition:e}})}),(0,t.jsx)(l.TextControl,{label:(0,e.__)("Title","cozy-addons"),type:"text",value:o.openIcon.title,onChange:e=>a({...o,openIcon:{...o.openIcon,title:e}})}),(0,t.jsx)(l.RangeControl,{label:(0,e.__)("Gap","cozy-addons"),min:0,max:30,step:1,value:o.openIcon.gap,onChange:e=>a({...o,openIcon:{...o.openIcon,gap:Math.abs(e)}})})]})]}),(0,t.jsxs)(l.PanelBody,{title:(0,e.__)("Close Icon","cozy-addons"),opened:"close-icon"===S,onToggle:()=>B("close-icon"),children:[(0,t.jsx)(l.SelectControl,{label:(0,e.__)("Alignment","cozy-addons"),options:[{label:(0,e.__)("Left","cozy-addons"),value:"left"},{label:(0,e.__)("Right","cozy-addons"),value:"right"}],value:o.closeIcon.alignment,onChange:e=>a({...o,closeIcon:{...o.closeIcon,alignment:e}})}),(0,t.jsx)(l.RangeControl,{label:(0,e.__)("Vertical Spacing","cozy-addons"),min:0,max:50,step:1,value:o.closeIcon.verticalSpacing,onChange:e=>a({...o,closeIcon:{...o.closeIcon,verticalSpacing:Math.abs(e)}})}),(0,t.jsx)(l.RangeControl,{label:(0,e.__)("Horizontal Spacing","cozy-addons"),min:0,max:50,step:1,value:o.closeIcon.horizontalSpacing,onChange:e=>a({...o,closeIcon:{...o.closeIcon,horizontalSpacing:Math.abs(e)}})})]}),!cozyBlockAssets.isPremium&&(0,t.jsx)(g,{})]},"setting"),(0,t.jsxs)(n.InspectorControls,{group:"styles",children:[(0,t.jsxs)(l.PanelBody,{title:(0,e.__)("Sidebar Panel Styles"),opened:"sidebar-panel-styles"===S,onToggle:()=>B("sidebar-panel-styles"),children:[(0,t.jsxs)(l.BaseControl,{children:[(0,t.jsx)(l.BaseControl.VisualLabel,{children:(0,e.__)("Padding","cozy-addons")}),(0,t.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,t.jsx)("button",{className:"cozy-link-styles "+(j?"":"cozy-attr-link-disabled"),onClick:()=>I(!j),children:(0,t.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,t.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,t.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,t.jsx)(l.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Top","cozy-addons"),value:o.sidebarPadding.top,onChange:o=>f("top",o)}),(0,t.jsx)(l.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Right","cozy-addons"),value:o.sidebarPadding.right,onChange:o=>f("right",o)}),(0,t.jsx)(l.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Bottom","cozy-addons"),value:o.sidebarPadding.bottom,onChange:o=>f("bottom",o)}),(0,t.jsx)(l.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Left","cozy-addons"),value:o.sidebarPadding.left,onChange:o=>f("left",o)})]})]}),(0,t.jsx)(n.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Color","cozy-addons"),colorSettings:[{label:(0,e.__)("Background","cozy-addons"),value:o.bgColor,onChange:e=>a({...o,bgColor:e})},{label:(0,e.__)("Overlay","cozy-addons"),value:o.overlayBgColor,onChange:e=>a({...o,overlayBgColor:e})}]})]}),"stacked"===o.iconView&&(0,t.jsxs)(l.PanelBody,{title:(0,e.__)("Icon Box Styles","cozy-addons"),opened:"icon-box-styles"===S,onToggle:()=>B("icon-box-styles"),children:[(0,t.jsxs)(l.BaseControl,{children:[(0,t.jsx)(l.BaseControl.VisualLabel,{children:(0,e.__)("Padding","cozy-addons")}),(0,t.jsxs)("div",{style:{display:"flex",gap:"5px",height:"50px",position:"relative"},children:[(0,t.jsx)("button",{className:"cozy-link-styles "+(w?"":"cozy-attr-link-disabled"),onClick:()=>m(!w),children:(0,t.jsxs)("svg",{width:"10",height:"16",viewBox:"0 0 15 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M6.18931 9.59516L6.18931 19.3466H8.70581V9.59516H6.18931Z",fill:"black"}),(0,t.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,t.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,t.jsx)(l.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Top","cozy-addons"),value:o.iconBoxStyles.padding.top,onChange:o=>z("top",o)}),(0,t.jsx)(l.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Right","cozy-addons"),value:o.iconBoxStyles.padding.right,onChange:o=>z("right",o)}),(0,t.jsx)(l.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Bottom","cozy-addons"),value:o.iconBoxStyles.padding.bottom,onChange:o=>z("bottom",o)}),(0,t.jsx)(l.TextControl,{type:"number",step:1,min:0,label:(0,e.__)("Left","cozy-addons"),value:o.iconBoxStyles.padding.left,onChange:o=>z("left",o)})]})]}),(0,t.jsx)(l.SelectControl,{label:(0,e.__)("Border Type","cozy-addons"),value:o.iconBoxStyles.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=>a({...o,iconBoxStyles:{...o.iconBoxStyles,borderType:e}})}),"none"!==o.iconBoxStyles.borderType&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.RangeControl,{label:(0,e.__)("Border Width","cozy-addons"),min:1,max:50,step:1,value:o.iconBoxStyles.borderWidth,onChange:e=>a({...o,iconBoxStyles:{...o.iconBoxStyles,borderWidth:Math.abs(e)}})}),(0,t.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.iconBoxStyles.borderColor,onChange:e=>a({...o,iconBoxStyles:{...o.iconBoxStyles,borderColor:e}})},{label:(0,e.__)("Hover","cozy-addons"),value:o.iconBoxStyles.borderColorHover,onChange:e=>a({...o,iconBoxStyles:{...o.iconBoxStyles,borderColorHover:e}})}]})]}),(0,t.jsx)(l.RangeControl,{label:(0,e.__)("Border Radius","cozy-addons"),min:1,max:100,step:1,value:o.iconBoxStyles.borderRadius,onChange:e=>a({...o,iconBoxStyles:{...o.iconBoxStyles,borderRadius:Math.abs(e)}})}),(0,t.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.iconBoxStyles.bgColor,onChange:e=>a({...o,iconBoxStyles:{...o.iconBoxStyles,bgColor:e}})},{label:(0,e.__)("Hover","cozy-addons"),value:o.iconBoxStyles.bgColorHover,onChange:e=>a({...o,iconBoxStyles:{...o.iconBoxStyles,bgColorHover:e}})},{label:(0,e.__)("Open Icon","cozy-addons"),value:o.openIcon?.color?.bg,onChange:e=>a({...o,openIcon:{...o.openIcon,color:{...o.openIcon.color,bg:e}}})},{label:(0,e.__)("Open Icon (Hover)","cozy-addons"),value:o.openIcon?.color?.bgHover,onChange:e=>a({...o,openIcon:{...o.openIcon,color:{...o.openIcon.color,bgHover:e}}})}]})]}),(0,t.jsxs)(l.PanelBody,{title:(0,e.__)("Icon Styles","cozy-addons"),opened:"icon-styles"===S,onToggle:()=>B("icon-styles"),children:[(0,t.jsx)(l.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.iconView,onChange:e=>a({...o,iconView:e})}),(0,t.jsx)(l.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.iconLayout,onChange:e=>a({...o,iconLayout:e})}),(0,t.jsx)(l.TextControl,{label:(0,e.__)("Size","cozy-addons"),type:"number",value:o.iconSize,onChange:e=>a({...o,iconSize:Math.abs(e)}),help:(0,e.__)("Set value to '0' to hide menu icon.","cozy-addons")}),(0,t.jsx)(l.RangeControl,{label:(0,e.__)("Opacity","cozy-addons"),min:0,max:1,step:.1,value:o.iconOpacity,onChange:e=>a({...o,iconOpacity:Math.abs(e)})}),(0,t.jsx)(l.RangeControl,{label:(0,e.__)("Icon Rotate","cozy-addons"),min:0,max:360,step:90,value:o.iconRotate,onChange:e=>a({...o,iconRotate:Math.abs(e)})}),(0,t.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=>a({...o,iconColor:e})},{label:(0,e.__)("Hover","cozy-addons"),value:o.iconColorHover,onChange:e=>a({...o,iconColorHover:e})},{label:(0,e.__)("Open Icon","cozy-addons"),value:o.openIcon?.color?.icon,onChange:e=>a({...o,openIcon:{...o.openIcon,color:{...o.openIcon.color,icon:e}}})},{label:(0,e.__)("Open Icon (Hover)","cozy-addons"),value:o.openIcon?.color?.iconHover,onChange:e=>a({...o,openIcon:{...o.openIcon,color:{...o.openIcon.color,iconHover:e}}})}]})]}),o.openIcon.enableTitle&&(0,t.jsxs)(l.PanelBody,{title:(0,e.__)("Typography","cozy-addons"),opened:"typography"===S,onToggle:()=>B("typography"),children:[(0,t.jsx)(l.TextControl,{label:(0,e.__)("Font Size","cozy-addons"),type:"number",min:10,value:o.typography.fontSize,onChange:e=>a({...o,typography:{...o.typography,fontSize:Math.abs(e)}})}),(0,t.jsx)(l.SelectControl,{label:(0,e.__)("Font Family","cozy-addons"),options:L,value:o.typography.fontFamily,onChange:e=>a({...o,typography:{...o.typography,fontFamily:e}})}),(0,t.jsx)(l.SelectControl,{label:(0,e.__)("Font Weight","cozy-addons"),options:[{label:(0,e.__)("Thin","cozy-addons"),value:100},{label:(0,e.__)("Extra Light","cozy-addons"),value:200},{label:(0,e.__)("Light","cozy-addons"),value:300},{label:(0,e.__)("Normal","cozy-addons"),value:400},{label:(0,e.__)("Medium","cozy-addons"),value:500},{label:(0,e.__)("Semi Bold","cozy-addons"),value:600},{label:(0,e.__)("Bold","cozy-addons"),value:700},{label:(0,e.__)("Extra Bold","cozy-addons"),value:800},{label:(0,e.__)("Black","cozy-addons"),value:900}],value:o.typography.fontWeight,onChange:e=>a({...o,typography:{...o.typography,fontWeight:e}})}),(0,t.jsxs)("div",{className:"components-base-control",style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[(0,t.jsx)("div",{style:{width:"100%"},children:(0,t.jsxs)(l.__experimentalToggleGroupControl,{label:(0,e.__)("Letter Case","cozy-addons"),value:o.typography?.letterCase,onChange:e=>a({...o,typography:{...o.typography,letterCase:e}}),children:[(0,t.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("None","cozy-addons"),value:"none",icon:i}),(0,t.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("Uppercase","cozy-addons"),value:"uppercase",icon:s}),(0,t.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("Lowercase","cozy-addons"),value:"lowercase",icon:c}),(0,t.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("Capitalize","cozy-addons"),value:"capitalize",icon:r})]})}),(0,t.jsx)("div",{style:{width:"100%"},children:(0,t.jsxs)(l.__experimentalToggleGroupControl,{label:(0,e.__)("Decoration","cozy-addons"),value:o.typography?.decoration,onChange:e=>a({...o,typography:{...o.typography,decoration:e}}),children:[(0,t.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("None","cozy-addons"),value:"none",icon:i}),(0,t.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("Underline","cozy-addons"),value:"underline",icon:d}),(0,t.jsx)(l.__experimentalToggleGroupControlOptionIcon,{label:(0,e.__)("Strikethrough","cozy-addons"),value:"line-through",icon:p})]})})]}),(0,t.jsxs)("div",{className:"components-base-control",style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[(0,t.jsx)("div",{style:{width:"100%"},children:(0,t.jsx)(l.__experimentalUnitControl,{label:(0,e.__)("Line Height","cozy-addons"),value:o.typography?.lineHeight,onChange:e=>a({...o,typography:{...o.typography,lineHeight:e}})})}),(0,t.jsx)("div",{style:{width:"100%"},children:(0,t.jsx)(l.__experimentalUnitControl,{label:(0,e.__)("Letter Spacing","cozy-addons"),value:o.typography?.letterSpacing,onChange:e=>a({...o,typography:{...o.typography,letterSpacing:e}})})})]}),(0,t.jsx)(n.PanelColorSettings,{className:"cozy-color-control",enableAlpha:!0,title:(0,e.__)("Color","cozy-addons"),colorSettings:[{label:(0,e.__)("Default","cozy-addons"),value:o.typography.color,onChange:e=>a({...o,typography:{...o.typography,color:e}})},{label:(0,e.__)("Hover","cozy-addons"),value:o.typography.colorHover,onChange:e=>a({...o,typography:{...o.typography,colorHover:e}})}]})]})]},"style")]})},save:function({attributes:o}){const e=`cozyBlock_${(l=o.blockClientId,l.replace(/[;=()\s]/g,"")).replace(/-/gi,"_")}`;var l;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:`cozy-block-sidebar-panel layout-${o.sidebarLayout} ${o.position} icon-view-${o.iconView} icon-layout-${o.iconLayout}`,id:e,children:[(0,t.jsxs)("div",{className:"open-icon-wrapper",children:[o.openIcon.enableTitle&&"before"===o.openIcon.titlePosition&&(0,t.jsx)("p",{children:o.openIcon.title}),o.openIcon?.enableIcon&&(0,t.jsx)("div",{className:"sidebar-icon-wrapper",children:(0,t.jsx)("svg",{className:"sidebar-open-icon",width:o.iconSize,height:o.iconSize,viewBox:`${o.openIcon.viewBox.vx} ${o.openIcon.viewBox.vy} ${o.openIcon.viewBox.vw} ${o.openIcon.viewBox.vh}`,children:(0,t.jsx)("path",{d:o.openIcon.path})})}),o.openIcon.enableTitle&&"after"===o.openIcon.titlePosition&&(0,t.jsx)("p",{children:o.openIcon.title})]}),(0,t.jsxs)("div",{className:"cozy-sidebar-panel-wrapper",children:[(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("div",{className:`sidebar-icon-wrapper close-icon-wrapper align-${o.closeIcon.alignment}`,children:(0,t.jsx)("svg",{className:"sidebar-close-icon",width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M4.99999 4.058L8.29999 0.758003L9.24266 1.70067L5.94266 5.00067L9.24266 8.30067L8.29932 9.24334L4.99932 5.94334L1.69999 9.24334L0.757324 8.3L4.05732 5L0.757324 1.7L1.69999 0.75867L4.99999 4.058Z"})})})}),(0,t.jsx)(n.InnerBlocks.Content,{})]})]})})}})}},n={};function l(o){var a=n[o];if(void 0!==a)return a.exports;var t=n[o]={exports:{}};return e[o](t,t.exports,l),t.exports}l.m=e,o=[],l.O=(e,n,a,t)=>{if(!n){var i=1/0;for(d=0;d<o.length;d++){for(var[n,a,t]=o[d],s=!0,c=0;c<n.length;c++)(!1&t||i>=t)&&Object.keys(l.O).every((o=>l.O[o](n[c])))?n.splice(c--,1):(s=!1,t<i&&(i=t));if(s){o.splice(d--,1);var r=a();void 0!==r&&(e=r)}}return e}t=t||0;for(var d=o.length;d>0&&o[d-1][2]>t;d--)o[d]=o[d-1];o[d]=[n,a,t]},l.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),(()=>{var o={57:0,350:0};l.O.j=e=>0===o[e];var e=(e,n)=>{var a,t,[i,s,c]=n,r=0;if(i.some((e=>0!==o[e]))){for(a in s)l.o(s,a)&&(l.m[a]=s[a]);if(c)var d=c(l)}for(e&&e(n);r<i.length;r++)t=i[r],l.o(o,t)&&o[t]&&o[t][0](),o[t]=0;return l.O(d)},n=globalThis.webpackChunksidebar_panel=globalThis.webpackChunksidebar_panel||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})();var a=l.O(void 0,[350],(()=>l(507)));a=l.O(a)})();
Save
Back