/i,a=//i,i=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},s=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},c="object"==typeof window&&window.DOMParser;if("function"==typeof c){var u=new c;i=s=function(e,t){return t&&(e="<"+t+">"+e+""+t+">"),u.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var m=document.implementation.createHTMLDocument();i=function(e,t){return t?(m.documentElement.querySelector(t).innerHTML=e,m):(m.documentElement.innerHTML=e,m)}}var p,d="object"==typeof document?document.createElement("template"):{};d.content&&(p=function(e){return d.innerHTML=e,d.content.childNodes}),e.exports=function(e){var c,u,m,d,f=e.match(r);switch(f&&f[1]&&(c=f[1].toLowerCase()),c){case t:return u=s(e),o.test(e)||(m=u.querySelector(n))&&m.parentNode.removeChild(m),a.test(e)||(m=u.querySelector(l))&&m.parentNode.removeChild(m),u.querySelectorAll(t);case n:case l:return d=(u=i(e)).querySelectorAll(c),a.test(e)&&o.test(e)?d[0].parentNode.childNodes:d;default:return p?p(e):(m=i(e,l).querySelector(l)).childNodes}}},152:function(e,t,n){var l=n(276),r=n(507).formatDOM,o=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(o);return n&&n[1]&&(t=n[1]),r(l(e),null,t)}},507:function(e,t,n){for(var l,r=n(915),o=n(885).CASE_SENSITIVE_TAG_NAMES,a=r.Comment,i=r.Element,s=r.ProcessingInstruction,c=r.Text,u={},m=0,p=o.length;m1&&(u=f(u,{key:u.key||k})),b.push(u);else if("text"!==o.type){switch(m=o.attribs,s(o)?a(m.style,m):m&&(m=r(m,o.name)),p=null,o.type){case"script":case"style":o.children[0]&&(m.dangerouslySetInnerHTML={__html:o.children[0].data});break;case"tag":"textarea"===o.name&&o.children[0]?m.defaultValue=o.children[0].data:o.children&&o.children.length&&(p=e(o.children,n));break;default:continue}E>1&&(m.key=k),b.push(y(o.name,m,p))}else{if((c=!o.data.trim().length)&&o.parent&&!i(o.parent))continue;if(v&&c)continue;b.push(o.data)}return 1===b.length?b[0]:b}},606:function(e,t,n){var l=n(196),r=n(476).default,o={reactCompat:!0},a=l.version.split(".")[0]>=16,i=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,l,r="function"==typeof t,o={},a={};for(n in e)l=e[n],r&&(o=t(n,l))&&2===o.length?a[o[0]]=o[1]:"string"==typeof l&&(a[l]=n);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){if(null!=e)try{t.style=r(e,o)}catch(e){t.style={}}},canTextBeChildOfNode:function(e){return!i.has(e.name)},elementsWithNoTextChildren:i}},139:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,l=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,s=/^\s+|\s+$/g,c="\n",u="/",m="*",p="",d="comment",f="declaration";function y(e){return e?e.replace(s,p):p}e.exports=function(e,s){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};var h=1,b=1;function g(e){var t=e.match(n);t&&(h+=t.length);var l=e.lastIndexOf(c);b=~l?e.length-l:b+e.length}function v(){var e={line:h,column:b};return function(t){return t.position=new k(e),_(),t}}function k(e){this.start=e,this.end={line:h,column:b},this.source=s.source}k.prototype.content=e;var E=[];function w(t){var n=new Error(s.source+":"+h+":"+b+": "+t);if(n.reason=t,n.filename=s.source,n.line=h,n.column=b,n.source=e,!s.silent)throw n;E.push(n)}function x(t){var n=t.exec(e);if(n){var l=n[0];return g(l),e=e.slice(l.length),n}}function _(){x(l)}function S(e){var t;for(e=e||[];t=C();)!1!==t&&e.push(t);return e}function C(){var t=v();if(u==e.charAt(0)&&m==e.charAt(1)){for(var n=2;p!=e.charAt(n)&&(m!=e.charAt(n)||u!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return w("End of comment missing");var l=e.slice(2,n-2);return b+=2,g(l),e=e.slice(n),b+=2,t({type:d,comment:l})}}function F(){var e=v(),n=x(r);if(n){if(C(),!x(o))return w("property missing ':'");var l=x(a),s=e({type:f,property:y(n[0].replace(t,p)),value:l?y(l[0].replace(t,p)):p});return x(i),s}}return _(),function(){var e,t=[];for(S(t);e=F();)!1!==e&&(t.push(e),S(t));return t}()}},726:function(e,t,n){"use strict";function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=new Array(t);ne?e?.toLowerCase()?.replace(/(?<= )[^\s]|^./g,(e=>e?.toUpperCase())):"",o=e=>{var t;return e&&null!==(t=e?.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.join("-")?.toLowerCase())&&void 0!==t?t:""},a=(e,t,n)=>e?.split(t)?.join(n);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var e,t,n;const o=null!==(e=window?.blockify?.blockStyles)&&void 0!==e?e:{unregister:{},register:{}},i=null!==(t=o?.unregister)&&void 0!==t?t:{},s=null!==(n=o?.register)&&void 0!==n?n:{};Object.keys(i).forEach((e=>{i[e].forEach((t=>{(0,l.unregisterBlockStyle)(e,t)}))})),Object.keys(s).forEach((e=>{s[e].forEach((t=>{(0,l.registerBlockStyle)(e,{name:t,label:r(a(t,"-"," "))})}))}))}));var s=window.wp.element,c=window.wp.hooks,u=window.wp.compose;const m=e=>Object.keys(e).map((t=>`${t?.includes("-")?t:o(t)}:${e[t]};`)).join(" "),p=e=>{const t={};return e.split(";").map((e=>{const[n,l]=e.split(":");return n&&(t[n]=l),null})),t},d=e=>e.includes("var:")?(e=e.replace("var:","var(--wp--"),(e=a(e,"|","--"))+")"):e;var f;const y=null!==(f=window?.blockify?.blockSupports)&&void 0!==f?f:{};(0,c.addFilter)("blocks.registerBlockType","blockify/block-supports",((e,t)=>(Object.keys(y).includes(t)&&(e.supports={...e.supports,...y[t]}),e)),0),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/alignment-class",((e,t,n)=>(Object.keys(y).includes(t.name)&&n?.align&&!e.className.includes(" align")&&(e.className+=" align"+n.align),e))),(0,c.addFilter)("blocks.registerBlockType","blockify/block-attributes-search",((e,t)=>("core/search"===t&&(e.attributes.style={...e.attributes?.style,spacing:{...e.attributes?.style?.spacing,padding:{top:"1em",right:"1em",bottom:"1em",left:"2em"}}}),e)),0),(0,c.addFilter)("editor.BlockEdit","blockify/with-search-padding-css",(0,u.createHigherOrderComponent)((e=>t=>{if("core/search"!==t.name)return(0,s.createElement)(e,t);const n=document.getElementsByClassName("wp-block-search__input"),l=t?.attributes?.style?.spacing?.padding;return n[0]&&l&&(l.top&&(n[0].style.paddingTop=l?.top),l.right&&(n[0].style.paddingRight=l?.right),l.bottom&&(n[0].style.paddingBottom=l?.bottom),l.left&&(n[0].style.paddingLeft=l?.left)),(0,s.createElement)(e,t)}),"withSearchPaddingCss")),(0,c.addFilter)("editor.BlockListBlock","blockify/with-block-gap-css",(0,u.createHigherOrderComponent)((e=>t=>{var n,l;const r=(0,s.createElement)(e,t);if("core/page-list"!==t.name)return r;const o=null!==(n=t?.attributes?.style?.spacing?.blockGap)&&void 0!==n?n:"";if(!o)return r;t.style={...null!==(l=t.style)&&void 0!==l?l:{},"--wp--style--block-gap":d(o)};const a={...t.wrapperProps,style:{...t.wrapperProps?.style,"--wp--style--block-gap":d(o)}};return(0,s.createElement)(e,i({},t,{wrapperProps:a}))}),"withBlockGapCss"));var h=window.wp.apiFetch,b=n.n(h),g=window.wp.data;const v={icons:{social:{},wordpress:{}}},k={setIcons(e){return{type:"SET_ICONS",icons:e}},getIcons(e){return{type:"GET_ICONS",path:e}}},E={getIcons(e){const{icons:t}=e;return t}},w={GET_ICONS(e){return b()({path:e.path})}},x={*getIcons(){const e=yield k.getIcons("/blockify/v1/icons/");return k.setIcons(e)}};(0,g.register)((0,g.createReduxStore)("blockify/icons",{reducer:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;return"SET_ICONS"===t.type?{...e,icons:t.icons}:e},actions:k,selectors:E,controls:w,resolvers:x}));var _=window.wp.components,S=window.wp.i18n,C=window.wp.primitives,F=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"}));const T=()=>(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 120 120",xmlSpace:"preserve"},(0,s.createElement)(C.Path,{d:"M15 0h35v120H15zm55 0h35v120H70z"})),N=e=>{let{children:t}=e;return(0,s.createElement)("p",{className:"blockify-control-label"},t)};var P=window.wp.blockEditor;const I=[{value:"ease",label:(0,S.__)("Ease","blockify")},{value:"ease-in",label:(0,S.__)("Ease In","blockify")},{value:"ease-out",label:(0,S.__)("Ease Out","blockify"),isDefault:!0},{value:"ease-in-out",label:(0,S.__)("Ease In Out","blockify")},{value:"linear",label:(0,S.__)("Linear","blockify")}],O=[{value:"",label:""}];window?.blockify?.animations?.forEach((e=>{O.push({value:e,label:r(e?.replace(/-/g," "))})}));const B=[{value:"enter",label:(0,S.__)("Enter","blockify"),isDefault:!0},{value:"exit",label:(0,S.__)("Exit","blockify")},{value:"infinite",label:(0,S.__)("Infinite","blockify")},{value:"scroll",label:(0,S.__)("Scroll","blockify")}],A=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyAnimation)&&void 0!==t&&t};(0,c.addFilter)("blocks.registerBlockType","blockify/add-animation-attributes",((e,t)=>(A(t)&&(e.attributes={...e.attributes,animation:{type:"object"}}),e)),0);const z=e=>{const t={};var n,l,r,o,a,i,s;return e?.event&&(t["--animation-event"]=null!==(n=e.event)&&void 0!==n?n:"enter","infinite"===e.event&&(t.animationIterationCount="infinite")),e?.name&&(t.animationName=null!==(l=e.name)&&void 0!==l?l:""),e?.duration&&(t.animationDuration=(null!==(r=e.duration)&&void 0!==r?r:"1")+"s"),e?.delay&&(t.animationDelay=(null!==(o=e.delay)&&void 0!==o?o:"0")+"s"),e?.timingFunction&&(t.animationTimingFunction=null!==(a=e?.timingFunction)&&void 0!==a?a:"ease-in-out"),t?.animationIterationCount||(t.animationIterationCount=null!==(i=e?.iterationCount)&&void 0!==i?i:"1"),e?.playState&&(t.animationPlayState=null!==(s=e?.playState)&&void 0!==s?s:"running"),t};(0,c.addFilter)("editor.BlockListBlock","blockify/with-animation-props",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l}=t,r=null!==(n=l?.animation)&&void 0!==n?n:{};if(!r||!Object?.keys(r)?.length)return(0,s.createElement)(e,t);const o=z(r),a=t?.className?.trim()+" has-animation",c={...(t={...t,className:a})?.wrapperProps,className:a,style:{...t?.wrapperProps?.style,...o}};return(0,s.createElement)(e,i({},t,{wrapperProps:c}))}),"withAnimation")),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/apply-animation-styles",((e,t,n)=>{var l;const r=null!==(l=n?.animation)&&void 0!==l?l:{};if(!r||!Object?.keys(r)?.length)return e;e.className=e?.className?.trim()+" has-animation";const o=z(r);return{...e,style:{...e?.style,...o}}}));const M=e=>{var t,n,l,r,o,a,i;let{attributes:c,setAttributes:u}=e;const m=null!==(t=c?.animation)&&void 0!==t?t:{};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(N,null,(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",null,(0,S.__)("Animation","blockify")),(0,s.createElement)(_.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>u({animation:{}}),icon:F,iconSize:16,"aria-label":(0,S.__)("Clear Animation","blockify")}))),(0,s.createElement)(_.Flex,{justify:"flex-end"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.Button,{isSecondary:!0,isSmall:!0,icon:"running"===m?.playState?T:(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",fill:"currentColor"},(0,s.createElement)("polygon",{points:"10,5 0,10 0,0"})),iconSize:10,onClick:()=>{u({animation:{...m,playState:"running"===m?.playState?"paused":"running"}})}},"running"===m?.playState?(0,S.__)("Pause","blockify"):(0,S.__)("Run","blockify"))))),(0,s.createElement)(_.PanelRow,{className:"blockify-animate-controls"},(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Effect","blockify"),value:null!==(n=m?.name)&&void 0!==n?n:"",options:O,onChange:e=>{var t;u({animation:{...m,name:e,duration:null!==(t=m?.duration)&&void 0!==t?t:1}})}}))),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Easing","blockify"),value:null!==(l=m?.timingFunction)&&void 0!==l?l:"",options:I,onChange:e=>{u({animation:{...m,timingFunction:e}})}}))),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Event","blockify"),value:null!==(r=m?.event)&&void 0!==r?r:"enter",options:B,onChange:e=>{u({animation:{...m,event:e,iterationCount:"infinite"===e?"-1":"-1"===m?.iterationCount?"1":m?.iterationCount}})}})))),(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Duration","blockify"),value:null!==(o=m?.duration)&&void 0!==o?o:1,onChange:e=>{u({animation:{...m,duration:e}})},min:0,max:100,step:.1,shifStep:10,allowReset:!0})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Delay","blockify"),value:null!==(a=m?.delay)&&void 0!==a?a:0,onChange:e=>{u({animation:{...m,delay:e}})},min:0,max:100,step:.1,shifStep:10,allowReset:!0})),(0,s.createElement)(_.FlexItem,null,"infinite"!==m?.event&&(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Repeat","blockify"),value:"infinite"===m?.event?-1:null!==(i=m?.iterationCount)&&void 0!==i?i:1,onChange:e=>{u({animation:{...m,iterationCount:e}})},min:-1,max:100,step:1,allowReset:!0})))))};(0,c.addFilter)("editor.BlockEdit","blockify/animation-controls",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,isSelected:r,name:o}=t;return A(o)?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{initialOpen:null!==(n=l?.animation)&&void 0!==n&&n,title:(0,S.__)("Animation","blockify")},(0,s.createElement)(M,t)))):(0,s.createElement)(e,t)}),"withAnimation"));var R,D=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})),j=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"}));const V=null!==(R=window?.blockify?.blockSupports)&&void 0!==R?R:{},L=["","none","block","inline-block","inline","flex","inline-flex","grid","inline-grid","contents"],H=(e,t)=>{var n,l;const{attributes:o,setAttributes:a}=e,{style:i}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.PanelRow,{className:"blockify-display-controls"},(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Display","blockify"),value:null!==(n=i?.display?.[t])&&void 0!==n?n:"",options:L.map((e=>({label:r(e?.replace("-"," ")),value:e}))),onChange:e=>{a({style:{...i,display:{...i?.display,[t]:e}}})}})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Order","blockify"),value:null!==(l=i?.order?.[t])&&void 0!==l?l:"",onChange:e=>{a({style:{...i,order:{...i?.order,[t]:e}}})},min:-10,max:10,step:1,allowReset:!0}))),(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalUnitControl,{label:(0,S.__)("Width","blockify"),value:i?.width?.[t],onChange:e=>{a({style:{...i,width:{...i?.width,[t]:e}}})}})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalUnitControl,{label:(0,S.__)("Max Width","blockify"),value:i?.maxWidth?.[t],onChange:e=>{a({style:{...i,maxWidth:{...i?.maxWidth,[t]:e}}})}})))))},G=e=>{const{attributes:t,setAttributes:n}=e,[l,r]=(0,s.useState)("all");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(N,null,(0,s.createElement)(s.Fragment,null,(0,S.__)("Display","blockify"),(0,s.createElement)(_.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{n({style:{...t?.style,display:"",order:"",width:"",maxWidth:""}})},icon:F,iconSize:16,"aria-label":(0,S.__)("Reset Display","blockify")}))),(0,s.createElement)(_.ButtonGroup,null,(0,s.createElement)(_.Button,{isSmall:!0,variant:"all"===l?"primary":"secondary",onClick:()=>r("all")},(0,S.__)("All","blockify")),(0,s.createElement)(_.Button,{isSmall:!0,variant:"mobile"===l?"primary":"secondary",onClick:()=>r("mobile"),icon:D}),(0,s.createElement)(_.Button,{isSmall:!0,variant:"desktop"===l?"primary":"secondary",onClick:()=>r("desktop"),icon:j}))),"all"===l&&H(e,l),"mobile"===l&&H(e,l),"desktop"===l&&H(e,l))};(0,c.addFilter)("editor.BlockEdit","blockify/display-controls",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,isSelected:r,name:o}=t;return(e=>{var t;return null!==(t=V?.[e]?.blockifyPosition)&&void 0!==t&&t})(o)?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{initialOpen:null!==(n=l?.display)&&void 0!==n&&n,title:(0,S.__)("Display","blockify")},(0,s.createElement)(G,t)))):(0,s.createElement)(e,t)}),"withDisplay"));const U=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyFilter)&&void 0!==t&&t},W={blur:{unit:"px",min:0,max:500},brightness:{unit:"%",min:0,max:360},contrast:{unit:"%",min:0,max:200},grayscale:{unit:"%",min:0,max:100},hueRotate:{unit:"deg",min:-360,max:360},invert:{unit:"%",min:0,max:100},opacity:{unit:"%",min:0,max:100},saturate:{unit:"",min:0,max:100,step:.1},sepia:{unit:"%",min:0,max:100}};(0,c.addFilter)("blocks.registerBlockType","blockify/add-css-transform-attributes",((e,t)=>{var n;return U(t)?(e.attributes={...e.attributes,style:{...null!==(n=e?.attributes?.style)&&void 0!==n?n:{},filter:{type:"string"}}},e):e}));const q=e=>{let t="";return Object.keys(W).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&void 0!==e[n]&&(t+=" "+o(n)+"("+e[n]+W?.[n]?.unit+")")})),t?{[e?.backdrop?"backdropFilter":"filter"]:t.trim()}:{}};(0,c.addFilter)("editor.BlockListBlock","blockify/with-css-filter",(0,u.createHigherOrderComponent)((e=>t=>{var n,l;const r=null!==(n=t?.attributes?.style?.filter)&&void 0!==n?n:{},o=(0,s.createElement)(e,t);if(0===Object.getOwnPropertyNames(r).length)return o;const a=q(r);if(!Object.keys(a).length)return o;const c={...(t={...t,style:{...null!==(l=t?.style)&&void 0!==l?l:{},...a}}).wrapperProps,style:{...t.wrapperProps?.style,...a}};return(0,s.createElement)(e,i({},t,{wrapperProps:c}))}),"withCssFilter")),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/apply-filter-styles",((e,t,n)=>{var l;const r=null!==(l=n?.style?.filter)&&void 0!==l?l:{};if(0===Object.getOwnPropertyNames(r).length)return e;const o=q(r);return Object.keys(o).length?{...e,style:{...e?.style,...o}}:e}));const $=e=>{const{attributes:t,setAttributes:n}=e,{style:l}=t;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(N,null,(0,s.createElement)(s.Fragment,null,(0,S.__)("Filter","blockify"),(0,s.createElement)(_.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{n({style:{...t?.style,filter:{}}})},icon:F,iconSize:16,"aria-label":(0,S.__)("Clear Filters","blockify")}))),(0,s.createElement)(_.PanelRow,{className:"blockify-filter-settings"},Object.keys(W).map((e=>{var t,o;return(0,s.createElement)(_.__experimentalNumberControl,{key:e,label:"hueRotate"===e?(0,S.__)("Hue Rotate","blockify"):r(e),value:l?.filter?.[e],onChange:t=>{var r;n({style:{...l,filter:{...null!==(r=l?.filter)&&void 0!==r?r:{},[e]:t}}})},min:null!==(t=W?.[e]?.min)&&void 0!==t?t:0,max:W?.[e]?.max,step:null!==(o=W?.[e]?.step)&&void 0!==o?o:1,allowReset:!0})}))),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.ToggleControl,{label:(0,S.__)("Use as backdrop filter","blockify"),checked:l?.filter?.backdrop,onChange:e=>{n({style:{...l,filter:{...l?.filter,backdrop:e}}})}})))};var X;(0,c.addFilter)("editor.BlockEdit","blockify/filter-controls",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,isSelected:r,name:o}=t;return U(o)?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{initialOpen:null!==(n=l?.filter)&&void 0!==n&&n,title:(0,S.__)("Filter","blockify")},(0,s.createElement)($,t)))):(0,s.createElement)(e,t)}),"withFilter"));const Y=null!==(X=window?.blockify?.blockSupports)&&void 0!==X?X:{};(0,c.addFilter)("editor.BlockEdit","blockify/with-negative-margin",(0,u.createHigherOrderComponent)((e=>t=>{if(n=t?.name,null!==(l=Y?.[n]?.blockifyNegativeMargin)&&void 0!==l&&l){const e=document.querySelector('.components-input-control__input[min="0"]');e&&e.setAttribute("min","-999")}var n,l;return(0,s.createElement)(e,t)}),"withMinHeightSettings"));const Z=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyOnclick)&&void 0!==t&&t};var K,J;(0,c.addFilter)("blocks.registerBlockType","blockify/add-onclick-attribute",((e,t)=>Z(t)?(e.attributes={...e.attributes,onclick:{type:"string"}},e):e),0),(0,c.addFilter)("editor.BlockEdit","blockify/with-onclick-attribute",(0,u.createHigherOrderComponent)((e=>t=>{const{attributes:n,setAttributes:l,name:r}=t;return Z(r)&&(0,g.useSelect)((e=>{const t=e("core")?.getCurrentUser(),n=e("core")?.getUser(t?.id);return n?.roles}),[])?.includes("administrator")?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(P.InspectorAdvancedControls,null,(0,s.createElement)(_.TextareaControl,{label:(0,S.__)("On-click event","blockify"),help:(0,S.__)("Enter a JavaScript function to be called when the button is clicked.","blockify"),rows:4,value:n?.onclick?.replace('"',"'"),onChange:e=>l({onclick:e?.replace('"',"'")}),style:{fontFamily:"ui-monospace,Menlo,Monaco,Cascadia Code,Segoe UI Mono,Roboto Mono,Oxygen Mono,Ubuntu Monospace,Source Code Pro,Fira Code,Droid Sans Mono,DejaVu Sans Mono,Courier New,monospace",fontSize:"14px",tabSize:"1em",lineHeight:"1.5"}}))):(0,s.createElement)(e,t)}),"onclickAttribute"),99);const Q=null!==(K=window?.blockify?.blockSupports)&&void 0!==K?K:{},ee=e=>{var t;return null!==(t=Q?.[e]?.blockifyPosition)&&void 0!==t&&t},te=null!==(J=window?.blockify?.positionOptions)&&void 0!==J?J:{};(0,c.addFilter)("blocks.registerBlockType","blockify/add-position-attributes",((e,t)=>{if(ee(t)){var n;const t={};Object.keys(te).forEach((e=>{t[e]={type:"object"}})),e.attributes={...e.attributes,style:{...t,...null!==(n=e?.attributes?.style)&&void 0!==n?n:{}}}}return e}),0);const ne=e=>{var t;const n=[],l=null!==(t=e?.style)&&void 0!==t?t:{};return Object.keys(te).forEach((e=>{const t=o(e);var r,a,i;te?.[e]?.options?(null!==(r=l?.[e]?.all)&&void 0!==r&&r&&n.push(`has-${t}-${o(l?.[e]?.all)}`),null!==(a=l?.[e]?.mobile)&&void 0!==a&&a&&n.push(`has-${t}-${o(l?.[e]?.mobile)}-mobile`),null!==(i=l?.[e]?.desktop)&&void 0!==i&&i&&n.push(`has-${t}-${o(l?.[e]?.desktop)}-desktop`)):l?.[e]&&n.push(`has-${t}`)})),n},le=e=>{var t;const n={},l=null!==(t=e?.style)&&void 0!==t?t:{};return Object.keys(te).forEach((e=>{var t,r,a;if(te?.[e]?.options)return;const i=o(e);null!==(t=l?.[e]?.all)&&void 0!==t&&t&&(n[`--${i}`]=l?.[e]?.all),null!==(r=l?.[e]?.mobile)&&void 0!==r&&r&&(n[`--${i}-mobile`]=l?.[e]?.mobile),null!==(a=l?.[e]?.desktop)&&void 0!==a&&a&&(n[`--${i}-desktop`]=l?.[e]?.desktop)})),n};(0,c.addFilter)("editor.BlockListBlock","blockify/with-position-style",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{name:l,attributes:r}=t;if(!ee(l))return(0,s.createElement)(e,t);const o=ne(r),a=le(r),i=null!==(n=t?.wrapperProps)&&void 0!==n?n:{};return t={...t,style:{...t?.style,...a}},i&&(i.style={...i?.style,...a}),o.forEach((e=>{t?.className?.includes(e)||(t.className=t?.className+" "+e)})),t.wrapperProps=i,(0,s.createElement)(e,t)}),"withPositionStyle")),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/save-position-style",(e=>{const{name:t,attributes:n}=e;if(!Q?.[t]?.blockifyPosition)return e;const l=ne(n),r=le(n);return l.forEach((t=>{e?.className?.includes(t)||(e.className=e?.className+" "+t)})),e.style={...e?.style,...r},e}),11);const re=(e,t)=>{var n,l,r,o,a,i,c,u;const{attributes:m,setAttributes:p}=e,d=null!==(n=m?.style)&&void 0!==n?n:{},f=e=>{const n={};Object.keys(e).forEach((l=>{n[l]={...d?.[l],[t]:e[l]}})),p({style:{...d,...n}})};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Position","blockify"),value:null!==(l=d?.position?.[t])&&void 0!==l?l:"",options:te?.position?.options,onChange:e=>{f({position:e})}})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:te?.zIndex?.label,value:d?.zIndex?.[t],onChange:e=>{f({zIndex:e})},min:-100,max:100,step:1,allowReset:!0})))),d?.position&&(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Overflow","blockify"),value:null!==(r=d?.overflow?.[t])&&void 0!==r?r:"",options:te?.overflow?.options,onChange:e=>{f({overflow:e})}})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Pointer Events","blockify"),value:null!==(o=d?.pointerEvents?.[t])&&void 0!==o?o:"",options:te?.pointerEvents?.options,onChange:e=>{f({pointerEvents:e})}})))),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.__experimentalBoxControl,{className:"blockify-box-control",label:(0,S.__)("Inset","blockify"),values:{top:null!==(a=d?.top?.[t])&&void 0!==a?a:"",right:null!==(i=d?.right?.[t])&&void 0!==i?i:"",bottom:null!==(c=d?.bottom?.[t])&&void 0!==c?c:"",left:null!==(u=d?.left?.[t])&&void 0!==u?u:""},onChange:e=>{var t,n,l,r;f({top:null!==(t=e?.top)&&void 0!==t?t:"",right:null!==(n=e?.right)&&void 0!==n?n:"",bottom:null!==(l=e?.bottom)&&void 0!==l?l:"",left:null!==(r=e?.left)&&void 0!==r?r:""})},inputProps:{min:-999}})))},oe=e=>{const{attributes:t,setAttributes:n}=e,[l,r]=(0,s.useState)("all");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(N,null,(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",null,(0,S.__)("Position","blockify")),(0,s.createElement)(_.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{n({style:{...t?.style,position:"",zIndex:"",top:"",right:"",bottom:"",left:""}})},icon:F,iconSize:16,"aria-label":(0,S.__)("Reset Position","blockify")}))),(0,s.createElement)(_.ButtonGroup,null,(0,s.createElement)(_.Button,{isSmall:!0,variant:"all"===l?"primary":"tertiary",onClick:()=>r("all")},(0,S.__)("All","blockify")),(0,s.createElement)(_.Button,{isSmall:!0,variant:"mobile"===l?"primary":"tertiary",onClick:()=>r("mobile"),icon:D}),(0,s.createElement)(_.Button,{isSmall:!0,variant:"desktop"===l?"primary":"tertiary",onClick:()=>r("desktop"),icon:j}))),"all"===l&&re(e,l),"mobile"===l&&re(e,l),"desktop"===l&&re(e,l))};(0,c.addFilter)("editor.BlockEdit","blockify/position-controls",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,isSelected:r,name:o}=t;return ee(o)?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{initialOpen:null!==(n=l?.position)&&void 0!==n&&n,title:(0,S.__)("Position","blockify")},(0,s.createElement)(oe,t)))):(0,s.createElement)(e,t)}),"withPosition")),(0,c.addFilter)("editor.BlockListBlock","blockify/with-block-gap",(0,u.createHigherOrderComponent)((e=>t=>{var n;if("core/query"!==t?.name)return(0,s.createElement)(e,t);if(!t?.attributes?.style?.spacing?.blockGap)return(0,s.createElement)(e,t);const l=null!==(n=t.wrapperProps)&&void 0!==n?n:{};return l.style={...l.style,"--wp--style--block-gap":t.attributes.style.spacing.blockGap},(0,s.createElement)(e,i({},t,{wrapperProps:l}))}),"withBlockGap")),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/apply-block-gap",((e,t,n)=>("core/query"===t&&n?.style?.spacing?.blockGap&&(e.style={...e.style,"--wp--style--block-gap":n.style.spacing.blockGap}),e)));const ae=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyBoxShadow)&&void 0!==t&&t};(0,c.addFilter)("blocks.registerBlockType","blockify/add-box-shadow-attributes",((e,t)=>{var n;return ae(t)&&(e.attributes={...e.attributes,style:{...null!==(n=e?.attributes?.style)&&void 0!==n?n:{},boxShadow:{type:"object"}}}),e}),0);const ie=e=>{var t;const n=null!==(t=e?.style?.boxShadow)&&void 0!==t?t:{},l={},r={inset:"",x:"px",y:"px",blur:"px",spread:"px",color:""};return Object.keys(r).map((e=>((n?.[e]||"0"===n?.[e]?.toString())&&(l["--wp--custom--box-shadow--"+e]=n?.[e]+r?.[e]),(n?.hover?.[e]||"0"===n?.hover?.[e]?.toString())&&(l["--wp--custom--box-shadow--hover--"+e]=n?.hover?.[e]+r?.[e]),!0))),l},se=(e,t)=>{var n;const{attributes:l,setAttributes:o}=e,{style:a}=l,i=null!==(n=a?.boxShadow)&&void 0!==n?n:{},c=e=>{let n;n="default"===t?{...e}:{hover:{...i?.hover,...e}},o({style:{...a,boxShadow:{...i,...n}}})};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,null,["x","y","blur","spread"].map((e=>(0,s.createElement)(_.FlexItem,{key:e},(0,s.createElement)(_.__experimentalNumberControl,{label:r(e),value:"default"===t?i[e]:i?.hover?.[e],step:1,shiftStep:10,onChange:t=>{c({[e]:t})}})))))),(0,s.createElement)("br",null),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,{style:{flex:1.5}},(0,s.createElement)(P.__experimentalPanelColorGradientSettings,{title:(0,S.__)("Color","blockify"),showTitle:!1,enableAlpha:!0,settings:[{enableAlpha:!0,colorValue:"default"===t?i?.color:i?.[t]?.color,label:(0,S.__)("Color ","blockify")+("hover"===t?(0,S.__)(" Hover","blockify"):""),onColorChange:e=>{c({color:e})}}]})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.ToggleControl,{label:(0,S.__)("Inset","blockify"),checked:"default"===t?i?.inset:i?.[t]?.inset,onChange:e=>{c({inset:e?"inset":""})}})))))};(0,c.addFilter)("editor.BlockListBlock","blockify/edit-box-shadow-styles",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,name:r}=t;if(!ae(r))return(0,s.createElement)(e,t);const o=ie(l);if(!Object.keys(o).length)return(0,s.createElement)(e,t);const a={...t.wrapperProps},c=(null!==(n=t?.className)&&void 0!==n?n:"")+" has-box-shadow";return t={...t,className:c,style:{...t.style,...o}},a.className+=" has-box-shadow",a.style={...a.style,...o},(0,s.createElement)(e,i({},t,{wrapperProps:a}))}),"withBoxShadow")),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/save-box-shadow-styles",((e,t,n)=>{const{name:l}=t;if(!ae(l))return e;const r=ie(n);return Object.keys(r).length?(e.className+=" has-box-shadow",e.style={...e.style,...r},e):e}));const ce=e=>{const{attributes:t,setAttributes:n}=e,[l,r]=(0,s.useState)("default");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(N,null,(0,s.createElement)(s.Fragment,null,(0,S.__)("Shadow","blockify"),(0,s.createElement)(_.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{n({style:{...t?.style,boxShadow:""}})},icon:F,iconSize:16,"aria-label":(0,S.__)("Clear Shadow","blockify")}))),(0,s.createElement)(_.ButtonGroup,null,(0,s.createElement)(_.Button,{isSmall:!0,variant:"default"===l?"primary":"secondary",onClick:()=>r("default")},(0,S.__)("Default","blockify")),(0,s.createElement)(_.Button,{isSmall:!0,variant:"hover"===l?"primary":"secondary",onClick:()=>r("hover")},(0,S.__)("Hover","blockify")))),"default"===l&&se(e,l),"hover"===l&&se(e,l))};(0,c.addFilter)("editor.BlockEdit","blockify/shadow-controls",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,isSelected:r,name:o}=t;return ae(o)?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{initialOpen:null!==(n=l?.shadow)&&void 0!==n&&n,title:(0,S.__)("Shadow","blockify")},(0,s.createElement)(ce,t)))):(0,s.createElement)(e,t)}),"withShadow"));const ue=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyTransform)&&void 0!==t&&t},me={rotate:"deg",rotateX:"deg",rotateY:"deg",scale:"",scaleX:"",scaleY:"",skew:"deg",skewX:"deg",skewY:"deg",translateX:"",translateY:"",translateZ:""};(0,c.addFilter)("blocks.registerBlockType","blockify/add-css-transform-attributes",((e,t)=>{var n;return ue(t)?(e.attributes={...e.attributes,style:{...null!==(n=e?.attributes?.style)&&void 0!==n?n:{},transform:{type:"string"}}},e):e}));const pe=e=>{let t="";return Object.keys(me).forEach((n=>{if(e?.[n]){const l=e[n];t+=` ${n}(${l}${me[n]})`}})),t?{transform:t.trim()}:{}};(0,c.addFilter)("editor.BlockListBlock","blockify/with-css-transform",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,name:r}=t,o=(0,s.createElement)(e,t);if(!ue(r))return o;const{style:a}=l,c=null!==(n=a?.transform)&&void 0!==n?n:{};if(!c)return o;const u=pe(c);if(!Object.keys(u).length)return o;const m={...(t={...t,style:{...t?.style,...u}}).wrapperProps,style:{...t.wrapperProps?.style,...u}};return(0,s.createElement)(e,i({},t,{wrapperProps:m}))}),"withCssTransform")),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/apply-css-transform-styles",((e,t,n)=>{var l;const{name:r}=t;if(!ue(r))return e;const{style:o}=n,a=null!==(l=o?.transform)&&void 0!==l?l:{};if(!a)return e;const i=pe(a);return Object.keys(i).length?{...e,style:{...e?.style,...i}}:e}));const de=e=>{var t;const{attributes:n,setAttributes:l}=e,{style:r}=n,o=null!==(t=r?.transform)&&void 0!==t?t:{};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(N,null,(0,s.createElement)(s.Fragment,null,(0,S.__)("Transform","blockify"),(0,s.createElement)(_.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{l({style:{...n?.style,transform:""}})},icon:F,iconSize:16,"aria-label":(0,S.__)("Clear Transforms","blockify")})))),(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Rotate","blockify"),value:o?.rotate,onChange:e=>{l({style:{...r,transform:{...o,rotate:e}}})},min:-360,max:360,step:1})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Rotate X","blockify"),value:o?.rotateX,onChange:e=>{l({style:{...r,transform:{...o,rotateX:e}}})},min:-360,max:360,step:1})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Rotate Y","blockify"),value:o?.rotateY,onChange:e=>{l({style:{...r,transform:{...o,rotateY:e}}})},min:-360,max:360,step:1}))),(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Scale","blockify"),value:o?.scale,onChange:e=>{l({style:{...r,transform:{...o,scale:e}}})},min:0,max:10,step:.1})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Scale X","blockify"),value:o?.scaleX,onChange:e=>{l({style:{...r,transform:{...o,scaleX:e}}})},min:0,max:10,step:.1})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Scale Y","blockify"),value:o?.scaleY,onChange:e=>{l({style:{...r,transform:{...o,scaleY:e}}})},min:0,max:10,step:.1}))),(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Skew","blockify"),value:o?.skew,onChange:e=>{l({style:{...r,transform:{...o,skew:e}}})},min:-360,max:360,step:1})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Skew X","blockify"),value:o?.skewX,onChange:e=>{l({style:{...r,transform:{...o,skewX:e}}})},min:-360,max:360,step:1})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Skew Y","blockify"),value:o?.skewY,onChange:e=>{l({style:{...r,transform:{...o,skewY:e}}})},min:-360,max:360,step:1}))),(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalUnitControl,{label:(0,S.__)("Translate X","blockify"),value:o?.translateX,onChange:e=>{l({style:{...r,transform:{...o,translateX:e}}})}})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalUnitControl,{label:(0,S.__)("Translate Y","blockify"),value:o?.translateY,onChange:e=>{l({style:{...r,transform:{...o,translateY:e}}})}})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalUnitControl,{label:(0,S.__)("Translate Z","blockify"),value:o?.translateZ,onChange:e=>{l({style:{...r,transform:{...o,translateZ:e}}})}}))),(0,s.createElement)("br",null))};(0,c.addFilter)("editor.BlockEdit","blockify/transform-controls",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,isSelected:r,name:o}=t;return ue(o)?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),r&&(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{initialOpen:null!==(n=l?.transform)&&void 0!==n&&n,title:(0,S.__)("Transform","blockify")},(0,s.createElement)(de,t)))):(0,s.createElement)(e,t)}),"withTransform"));var fe=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));(0,l.registerBlockVariation)("core/list",{name:"accordion",title:(0,S.__)("Accordion","blockify"),description:(0,S.__)("Add a collapsible accordion list.","blockify"),category:window?.blockify?.isPlugin?"blockify":"text",icon:fe,attributes:{className:"is-style-accordion"},isDefault:!1,isActive:(e,t)=>e&&e?.className?.includes(t.className)});var ye=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));const he={content:(0,S.__)("Curved text. Curved text. Curved text.","blockify"),containerSize:"160",pathSize:"120"},be={name:"curved-text",title:(0,S.__)("Curved Text","blockify"),icon:ye,isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"text",scope:["inserter","transform","block"],description:(0,S.__)("Insert curved text around circular SVG path.","blockify"),attributes:{className:"is-style-curved-text"},isActive:e=>e?.className?.includes("is-style-curved-text")};t()((()=>{(0,l.registerBlockVariation)("core/paragraph",be)})),(0,c.addFilter)("blocks.registerBlockType","blockify/curved-text-attributes",((e,t)=>("core/paragraph"===t&&(e={...e,attributes:{...e?.attributes,curvedText:{type:"object"}}}),e)));const ge=function(){var e,t,n;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{curvedText:r=he}=l,o=null!==(e=r?.content)&&void 0!==e?e:he.content,a=null!==(t=r?.containerSize)&&void 0!==t?t:he.containerSize,i=null!==(n=r?.pathSize)&&void 0!==n?n:he.pathSize,c=parseInt(a)/2,u=parseInt(i)/2,m={viewBox:`0 0 ${a} ${a}`,xmlns:"http://www.w3.org/2000/svg",enableBackground:`new 0 0 ${a} ${a}`,xmlSpace:"preserve",width:a,height:a,contentEditable:!1,x:0,y:0},p=Date.now()+Math.random(),d={id:"circle-"+p,d:`M ${c}, ${c} m -${u}, 0 a ${u},${u} 0 0,1 ${i},0 a ${u},${u} 0 0,1 -${i},0`,fill:"transparent"};return(0,s.createElement)("svg",m,(0,s.createElement)("path",d," "),(0,s.createElement)("text",{fill:"currentColor"},(0,s.createElement)("textPath",{xlinkHref:"#circle-"+p},o)))};(0,c.addFilter)("editor.BlockEdit","blockify/with-curved-text-css",(0,u.createHigherOrderComponent)((e=>t=>{var n,l,r;const{attributes:o,setAttributes:a}=t;if(!(e=>!(!e?.className||"string"!=typeof e?.className)&&e?.className?.includes("is-style-curved-text"))(o))return(0,s.createElement)(e,t);const c=document.getElementsByClassName("edit-site-visual-editor__editor-canvas")?.item(0),u=document.getElementsByName("editor-canvas")?.item(0);let m;if(m=c?c.contentDocument:u?u.contentDocument:document,!m)return(0,s.createElement)(e,t);const p=m?.getElementById("block-"+t?.clientId);p&&(p.innerHTML=(0,s.renderToString)(ge({...o,clientId:t.clientId})));const{curvedText:d=he}=o,f=e=>{var n;const l={...e,svgString:(0,s.renderToString)((0,s.createElement)(ge,i({},o,e,{clientId:null!==(n=t.clientId)&&void 0!==n?n:"1"})))};a({curvedText:{...d,...l}})};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{className:"blockify-controls",title:(0,S.__)("Curved Text","blockify")},(0,s.createElement)(_.TextareaControl,{label:(0,S.__)("Content","blockify"),value:null!==(n=d?.content)&&void 0!==n?n:he.content,onChange:e=>{f({content:e})}}),(0,s.createElement)("p",null,(0,S.__)("Size","blockify")),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)("br",null),(0,s.createElement)(_.Flex,null,(0,s.createElement)(_.FlexItem,{style:{width:"50%"}},(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Container","blockify"),value:null!==(l=d?.containerSize)&&void 0!==l?l:he.containerSize,onChange:e=>{f({containerSize:e})}})),(0,s.createElement)(_.FlexBlock,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Path","blockify"),value:null!==(r=d?.pathSize)&&void 0!==r?r:he.pathSize,onChange:e=>{f({pathSize:e})}})))))))}),"withCurvedTextSettings"),1);var ve=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"}));const ke={start:"0",end:"100",duration:"2",delay:"0",prefix:"",suffix:""},Ee={name:"counter",title:(0,S.__)("Counter","blockify"),keywords:["counter","number","count","stats"],icon:ve,isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"text",scope:["inserter","transform","block"],description:(0,S.__)("Insert counter animation.","blockify"),attributes:{className:"is-style-counter"},isActive:e=>e&&e?.className?.includes("is-style-counter")};t()((()=>{(0,l.registerBlockVariation)("core/paragraph",Ee)})),(0,c.addFilter)("editor.BlockEdit","blockify/with-counter-controls",(0,u.createHigherOrderComponent)((e=>t=>{const{attributes:n,setAttributes:l}=t,r=(0,s.createElement)(e,t);if(!n?.className?.includes("is-style-counter"))return r;const{style:o}=n;let a=ke;return o?.counter?a=o.counter:l({style:{...o,counter:ke}}),(0,s.useEffect)((()=>{if(!a?.prefix&&!a?.end&&!a?.suffix)return;let e=a?.end;"string"==typeof a?.prefix&&(e=a?.prefix+e),"string"==typeof a?.suffix&&(e+=a?.suffix),l({content:e})}),[a?.prefix,a?.end,a?.suffix,l]),(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{title:(0,S.__)("Counter Settings","blockify"),initialOpen:!0,className:"blockify-counter-settings"},(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Start","blockify"),value:a?.start,onChange:e=>{l({style:{...o,counter:{...a,start:e}}})},step:1,shiftStep:10,isDragEnabled:!0,isShiftStepEnabled:!0})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("End","blockify"),value:a?.end,onChange:e=>{l({style:{...o,counter:{...a,end:e}}})},step:1,shiftStep:10,isDragEnabled:!0,isShiftStepEnabled:!0})))),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Duration (seconds)","blockify"),value:a?.duration,onChange:e=>{l({style:{...o,counter:{...a,duration:e}}})},step:.1,shiftStep:1,isDragEnabled:!0,isShiftStepEnabled:!0})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalNumberControl,{label:(0,S.__)("Delay (seconds)","blockify"),value:a?.delay,onChange:e=>{l({style:{...o,counter:{...a,delay:e}}})},step:.1,shiftStep:1,isDragEnabled:!0,isShiftStepEnabled:!0})))),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,{className:"blockify-flex-controls"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.TextControl,{label:(0,S.__)("Prefix","blockify"),value:a?.prefix,onChange:e=>{l({style:{...o,counter:{...a,prefix:e}}})}})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.TextControl,{label:(0,S.__)("Suffix","blockify"),value:a?.suffix,onChange:e=>{l({style:{...o,counter:{...a,suffix:e}}})}})))))))}),"withCounterControls"),9);var we=(0,s.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(C.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"}));const xe={name:"image",title:(0,S.__)("Image","blockify"),icon:we,isDefault:!0,category:"media",scope:["inserter","transform","block"],description:(0,S.__)("Insert an image to make a visual statement.","blockify"),attributes:{className:""},isActive:e=>!e?.className||!e?.className?.includes("is-style-icon")&&!e?.className?.includes("is-style-svg")};(0,l.registerBlockVariation)("core/image",xe);var _e=n(488),Se=(_e.domToReact,_e.htmlToDOM,_e.attributesToProps,_e.Comment,_e.Element,_e.ProcessingInstruction,_e.Text,_e),Ce=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));_.SelectControl.Option,_.CustomSelectControl.Option;const Fe=e=>"core/image"===e,Te={iconSet:{type:"string",default:"wordpress"},iconName:{type:"string",default:"star-empty"},iconColor:{type:"string"},iconGradient:{type:"string"},iconSize:{type:"string"},iconCustomSVG:{type:"string"},iconSvgString:{type:"string",default:' '}},Ne={name:"icon",icon:Ce,title:(0,S.__)("Icon","blockify"),isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"media",scope:["inserter","transform","block"],description:(0,S.__)("Insert a customizable SVG icon.","blockify"),attributes:{className:"is-style-icon",iconSet:"wordpress",iconName:"star-empty",iconSvgString:' '},isActive:e=>e&&e?.className?.includes("is-style-icon")};t()((()=>{(0,l.registerBlockVariation)("core/image",Ne)})),(0,c.addFilter)("blocks.registerBlockType","blockify/add-icon-attributes",((e,t)=>{if(Fe(t)){for(const[t,n]of Object.entries(Te))e.attributes[t]={type:n.type};e.attributes={...e.attributes,...Te}}return e}),99),(0,c.addFilter)("editor.BlockEdit","blockify/with-icon",(0,u.createHigherOrderComponent)((e=>t=>{var n,l,r,o,a;const{name:i,attributes:c,setAttributes:u,isSelected:m}=t,{className:p}=c;if(!p)return(0,s.createElement)(e,t);if(!p?.includes("is-style-icon"))return(0,s.createElement)(e,t);if(!Fe(i))return(0,s.createElement)(e,t);m&&(()=>{const e=document.getElementsByClassName("block-editor-block-card__description").item(0);e&&(document.getElementsByClassName("blockify-pro-icon-link").item(0)||(e.innerHTML=e.innerHTML+(0,S.__)(" Get more icons with ","blockify")+'Blockify Pro ↗ '))})(),c?.url||u({url:"#"}),c?.iconSet||u({iconSet:Te?.iconSet?.default}),c?.iconName||u({iconName:Te?.iconName?.default}),c?.iconSvgString||u({iconSvgString:Te?.iconSvgString?.default});const d=[],{icons:f}=null!==(n=(0,g.useSelect)((e=>({icons:e("blockify/icons")?.getIcons()})),[]))&&void 0!==n?n:v,y={wordpress:[{name:Te?.iconSvgString?.default,key:Te?.iconName?.default}]};return Object.keys(f).forEach((e=>{let t=e.split("-").join(" ");t="wordpress"===t?"WordPress":t,d.push({label:t,value:e}),y[e]=[],Object.keys(f[e]).forEach((t=>{t!==c?.iconName&&y[e].push({name:Se(f?.[e]?.[t]),key:t})})),f?.[e]?.[c?.iconName]&&y[e].unshift({name:Se(f?.[e]?.[c?.iconName]),key:c?.iconName})})),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{title:(0,S.__)("Icon Settings","blockify"),initialOpen:!0,className:"blockify-icon-settings"},!1,(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Select Icon Set","blockify"),value:null!==(l=c?.iconSet)&&void 0!==l?l:Te?.iconSet.default,options:d,onChange:e=>u({iconSet:e})}),(0,s.createElement)((()=>{const e=y[c?.iconSet]?.filter((e=>e?.key===c?.iconName))?.[0]?.name;return(0,s.createElement)("div",{className:"blockify-icon-preview"},e&&(0,s.createElement)(s.Fragment,null,e,(0,s.createElement)("span",null,c?.iconName?.replace("-"," "))))}),null),(0,s.createElement)(_.CustomSelectControl,{label:(0,S.__)("Select Icon","blockify"),options:null!==(r=y?.[c?.iconSet])&&void 0!==r?r:y?.wordpress,value:null!==(o=c?.iconSvgString)&&void 0!==o?o:Te?.iconSvgString?.default,className:"blockify-icon-setting",onChange:e=>{var t;let{selectedItem:n}=e;const l=null!==(t=n?.key)&&void 0!==t?t:"";u({iconName:l}),u({iconSvgString:f?.[c?.iconSet]?.[l]})}}),(0,s.createElement)("br",null),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,null,(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalUnitControl,{label:(0,S.__)("Icon Width","blockify"),value:null!==(a=c?.iconSize)&&void 0!==a?a:"",onChange:e=>u({iconSize:e})})))))))}),"iconEdit"),0);const Pe=e=>{var t,n,l;const r={};let o="";e?.style?.color?.background&&(o=e.style.color.background),e?.backgroundColor&&(o="var(--wp--preset--color--"+e.backgroundColor+", currentColor)");let a="";e?.style?.color?.gradient&&(a=e?.style?.color?.gradient),e?.gradient&&(a="var(--wp--preset--gradient--"+e.gradient+",currentColor)");let i="";if(e?.style?.color?.text&&(i=e?.style?.color?.text),e?.textColor&&(i="var(--wp--preset--color--"+e.textColor+",currentColor)"),""!==o&&(r["--wp--custom--icon--background"]=o),i?(r["--wp--custom--icon--color"]=i,a&&(r["--wp--custom--icon--background"]=a)):a&&(r["--wp--custom--icon--color"]=a),e?.style?.spacing?.padding){var s,c,u,m;const t=e.style.spacing.padding,n={top:null!==(s=t?.top)&&void 0!==s?s:"0",right:null!==(c=t?.right)&&void 0!==c?c:"0",bottom:null!==(u=t?.bottom)&&void 0!==u?u:"0",left:null!==(m=t?.left)&&void 0!==m?m:"0"};Object.keys(n).forEach((e=>{var t;const l=null!==(t=n?.[e])&&void 0!==t?t:"";l&&l?.includes("var:preset")&&(n[e]="var(--wp--preset--spacing--"+l.replace("var:preset|spacing|","")+")")})),r["--wp--custom--icon--padding"]=Object.values(n).join(" ")}if(e?.style?.spacing?.margin){var p,d,f,y;const t=e.style.spacing.margin,n={top:null!==(p=t?.top)&&void 0!==p?p:"",right:null!==(d=t?.right)&&void 0!==d?d:"",bottom:null!==(f=t?.bottom)&&void 0!==f?f:"",left:null!==(y=t?.left)&&void 0!==y?y:""};Object.keys(n).forEach((e=>{var t;const l=null!==(t=n?.[e])&&void 0!==t?t:"";l?.includes("var:preset")&&(n[e]="var(--wp--preset--spacing--"+l?.replace("var:preset|spacing|","")+")")})),r["--wp--custom--icon--margin"]=Object.values(n).join(" ")}let h="";var b,g;e?.borderColor&&(h="var(--wp--preset--color--"+e?.borderColor+")"),e?.style?.border?.width&&(r["--wp--custom--icon--border-width"]=e.style.border.width,r["--wp--custom--icon--border-style"]=null!==(b=e.style.border?.style)&&void 0!==b?b:"solid",r["--wp--custom--icon--border-color"]=null!==(g=e.style.border?.color)&&void 0!==g?g:h);const v=null!==(t=e?.iconSize)&&void 0!==t?t:"";""!==v&&(r["--wp--custom--icon--size"]=v);const k=(null!==(n=e?.iconCustomSVG)&&void 0!==n?n:"")?.replace('"',"'"),E=k&&k?.includes("t=>{let{attributes:n,wrapperProps:l,name:r}=t;return n?.className&&n?.className?.includes("is-style-icon")&&Fe(r)?(l||(l={style:{}}),l.style={...l?.style,...Pe(n)},(0,s.createElement)(e,i({},t,{wrapperProps:l}))):(0,s.createElement)(e,t)}),"withIcon")),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/save-icon-styles",((e,t,n)=>{if(!n?.className)return e;const{name:l}=t;return n?.className?.includes("is-style-icon")&&Fe(l)?(e.style={...e?.style,...Pe(n)},e):e}));var Ie=(0,s.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(C.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));const Oe={name:"svg",title:(0,S.__)("SVG","blockify"),icon:Ie,isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"media",scope:["inserter","transform","block"],description:(0,S.__)("Insert an inline SVG.","blockify"),attributes:{className:"is-style-svg"},isActive:e=>!!e?.className&&e?.className&&e?.className?.includes("is-style-svg")};t()((()=>{(0,l.registerBlockVariation)("core/image",Oe)}));const Be=e=>"url('data:image/svg+xml;utf8,"+encodeURIComponent(e)+"')",Ae=e=>"data:image/svg+xml;utf8,"+encodeURIComponent(e);(0,c.addFilter)("editor.BlockEdit","blockify/with-svg-controls",(0,u.createHigherOrderComponent)((e=>t=>{var n,l;const{attributes:r,setAttributes:o}=t;if(!r?.className?.includes("is-style-svg"))return(0,s.createElement)(e,t);const{style:a}=r,i=null!==(n=a?.svgString)&&void 0!==n?n:"",c=null!==(l=a?.maskSvg)&&void 0!==l&&l;r?.url||o({url:c?"#":Ae(i)}),c&&"#"!==r?.url&&o({url:"#"}),c||r?.url?.includes("data:image/svg+xml;utf8,")||o({url:Ae(i)});let u="var(--width,1em)",m="";var p;r?.width&&(u=r.width+"px"),r?.height&&(m=(null!==(p=r.height)&&void 0!==p?p:"")+"px"),m=""===m?u:m;const d={width:u,height:m,display:"inline-flex",background:"currentColor",overflow:"hidden","-webkit-mask-repeat":"no-repeat","-mask-repeat":"no-repeat","-webkit-mask-size":"100% 100%","-mask-size":"100% 100%","-webkit-mask-position":"center","-mask-position":"center bottom","-webkit-mask-image":Be(i),"-mask-image":Be(i)};let f="";return i&&(f=Object.entries(d).map((e=>{let[t,n]=e;return`${t}:${n};`})).join("")),(0,s.createElement)(s.Fragment,null,c&&(0,s.createElement)("style",null,"#block-"+t?.clientId+">div:first-of-type{"+f+"}"),(0,s.createElement)(e,t),(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{title:(0,S.__)("SVG Settings","blockify-pro"),className:(0,S.__)("blockify-svg-controls","blockify-pro")},(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.TextareaControl,{label:(0,S.__)("SVG String","blockify"),help:(0,S.__)("Paste your SVG string in the field above. It is recommended to format your SVG with an optimization tool ","blockify"),value:null!=i?i:"",rows:20,onChange:e=>{const t={style:{...a,svgString:e}};t.url=c?"#":Ae(e),o(t)},style:{fontFamily:"var(--wp--preset--font-family--monospace, monospace)"}})),(0,s.createElement)(_.ExternalLink,{href:"https://jakearchibald.github.io/svgomg/",target:"_blank"},"https://jakearchibald.github.io/svgomg/"),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.ToggleControl,{label:(0,S.__)("Mask with text color","blockify"),help:(0,S.__)("If enabled, the SVG will be masked with the text color. (Renders inline SVG on front end).","blockify"),checked:c,onChange:e=>{const t={style:{...a,maskSvg:e}};t.url=c?"#":Ae(i),o(t)}})))))}),"withSvgControls"),9);const ze={name:"marquee",icon:(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M7 7.2h8.2L13.5 9l1.1 1.1 3.6-3.6-3.5-4-1.1 1 1.9 2.3H7c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.2-.5zm13.8 4V11h-1.5v.3c0 1.1 0 3.5-1 4.5-.3.3-.7.5-1.3.5H8.8l1.7-1.7-1.1-1.1L5.9 17l3.5 4 1.1-1-1.9-2.3H17c.9 0 1.7-.3 2.3-.9 1.5-1.4 1.5-4.2 1.5-5.6z"})),title:(0,S.__)("Marquee","blockify"),isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"design",scope:["inserter","transform","block"],description:(0,S.__)("Adds a horizontal infinite scrolling marquee banner.","blockify"),innerBlocks:[["core/group",{layout:{type:"flex",flexWrap:"nowrap",orientation:"horizontal",justifyContent:"center"}},[["core/paragraph"]]]],attributes:{marquee:{},align:"full",speedMobile:60,speedDesktop:90,pauseOnHover:!0,reverse:!1,spacing:{padding:{right:"0",left:"0"}},layout:{type:"flex",flexWrap:"nowrap",orientation:"marquee",justifyContent:"center"}},isActive:(e,t)=>e.layout?.orientation===t.layout?.orientation};(0,l.registerBlockVariation)("core/group",ze);const Me=e=>{var t,n;return{"--marquee-speed-mobile":(null!==(t=e?.speedMobile)&&void 0!==t?t:20)+"s","--marquee-speed-desktop":(null!==(n=e?.speedDesktop)&&void 0!==n?n:30)+"s","--marquee-direction":e?.reverse?"reverse":"forwards","--marquee-pause":e?.pauseOnHover?"paused":"running"}};(0,c.addFilter)("blocks.registerBlockType","blockify/marquee-attributes",((e,t)=>("core/group"===t&&(e={...e,attributes:{...e.attributes,speedMobile:{type:"string"},speedDesktop:{type:"string"},reverse:{type:"boolean"},pauseOnHover:{type:"boolean"},repeatItems:{type:"number"}}}),e)),0),(0,c.addFilter)("editor.BlockEdit","blockify/with-marquee-controls",(0,u.createHigherOrderComponent)((e=>t=>{var n;const{attributes:l,setAttributes:r}=t;return"marquee"!==l?.layout?.orientation?(0,s.createElement)(e,t):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(P.InspectorControls,null,(0,s.createElement)(_.PanelBody,{title:(0,S.__)("Marquee Settings","blockify-pro"),className:(0,S.__)("blockify-width-control","blockify-pro")},(0,s.createElement)("p",null,(0,S.__)("Scroll Speed (seconds)","blockify")),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)("br",null),(0,s.createElement)(_.Flex,null,(0,s.createElement)(_.FlexItem,{style:{width:"50%"}},(0,s.createElement)(_.__experimentalNumberControl,{isShiftStepEnabled:!0,label:(0,S.__)("Mobile","blockify"),onChange:e=>{r({speedMobile:e})},value:l?.speedMobile})),(0,s.createElement)(_.FlexBlock,null,(0,s.createElement)(_.__experimentalNumberControl,{isShiftStepEnabled:!0,label:(0,S.__)("Desktop","blockify-pro"),onChange:e=>{r({speedDesktop:e})},value:l?.speedDesktop})))),(0,s.createElement)("br",null),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.RangeControl,{label:(0,S.__)("Repeat Items","blockify"),help:(0,S.__)("How many times should the items be duplicated and cloned.","blockify"),value:null!==(n=l?.repeatItems)&&void 0!==n?n:2,onChange:e=>{r({repeatItems:e})},min:0,max:10,step:1,allowReset:!0})),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.ToggleControl,{label:(0,S.__)("Pause on hover","blockify-pro"),checked:l?.pauseOnHover,onChange:()=>r({pauseOnHover:!l?.pauseOnHover})})),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.ToggleControl,{label:(0,S.__)("Reverse direction","blockify-pro"),checked:l?.reverse,onChange:()=>r({reverse:!l?.reverse})})))),(0,s.createElement)(e,t))}),"withInspectorControl"),9),(0,c.addFilter)("editor.BlockListBlock","blockify/with-marquee",(0,u.createHigherOrderComponent)((e=>t=>{var n,l;const{attributes:r}=t;if("marquee"!==r?.layout?.orientation)return(0,s.createElement)(e,t);t.attributes.style={...null!==(n=r.style)&&void 0!==n?n:{},...Me(r)};const o={...t.wrapperProps,style:{...null!==(l=t.wrapperProps?.style)&&void 0!==l?l:{},...Me(r)}};return(0,s.createElement)(e,i({},t,{wrapperProps:o}))}),"withMarquee")),(0,c.addFilter)("blocks.getSaveContent.extraProps","blockify/save-marquee-styles",((e,t,n)=>("marquee"!==n?.layout?.orientation||(e.style={...e?.style,...Me(n)}),e)));var Re=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"}));const De={name:"paragraph",title:(0,S.__)("Paragraph","blockify"),icon:Re,isDefault:!0,category:"text",scope:["inserter","transform","block"],description:(0,S.__)("Insert an image to make a visual statement.","blockify"),attributes:{className:""},isActive:e=>!e?.className?.includes("is-style-curved-text")&&!e?.className?.includes("is-style-counter")};(0,l.registerBlockVariation)("core/paragraph",De);const je=(0,s.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 512 512"},(0,s.createElement)(_.Path,{d:"M126.12 315.1A47.06 47.06 0 1 1 79.06 268h47.06Zm23.72 0a47.06 47.06 0 0 1 94.12 0v117.84a47.06 47.06 0 1 1-94.12 0Zm47.06-188.98A47.06 47.06 0 1 1 244 79.06v47.06Zm0 23.72a47.06 47.06 0 0 1 0 94.12H79.06a47.06 47.06 0 0 1 0-94.12Zm188.98 47.06a47.06 47.06 0 1 1 47.06 47.1h-47.06Zm-23.72 0a47.06 47.06 0 0 1-94.12 0V79.06a47.06 47.06 0 1 1 94.12 0ZM315.1 385.88a47.06 47.06 0 1 1-47.1 47.06v-47.06Zm0-23.72a47.06 47.06 0 0 1 0-94.12h117.84a47.06 47.06 0 1 1 0 94.12Z"})),Ve={name:"slack",title:(0,S.__)("Slack","blockify"),icon:je,attributes:{service:"slack"},isActive:(e,t)=>e.service===t.service};(0,l.registerBlockVariation)("core/social-link",Ve);var Le=window.wp.richText;(0,Le.registerFormatType)("blockify/clear-formatting",{title:(0,S.__)("Clear","blockify"),tagName:"span",className:"clear",edit:e=>{const{value:t,isActive:n,onChange:l}=e,{formatTypes:r}=(0,g.useSelect)((e=>({formatTypes:e("core/rich-text").getFormatTypes()})),[]);return(0,s.createElement)(P.RichTextToolbarButton,{icon:"editor-removeformatting",title:(0,S.__)("Clear Formatting","blockify"),onClick:()=>{if(r.length>0){let e=t;r.map((t=>{e=(0,Le.removeFormat)(e,t.name)})),l({...e})}},isActive:n})}});var He=(0,s.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(C.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));const Ge="blockify/gradient";(0,Le.registerFormatType)(Ge,{title:(0,S.__)("Gradient","blockify"),tagName:"span",className:"has-text-gradient",attributes:{style:"style",class:"class"},edit:e=>{let{isActive:t,value:n,onChange:l}=e;const[r,o]=(0,s.useState)(""),[a,i]=(0,s.useState)(!1),{gradients:c}=(0,g.useSelect)((e=>({gradients:e("core/block-editor").getSettings()?.gradients})),[]);let u="",m="";return n?.formats&&n.formats.forEach((e=>{const t=e?.find((e=>e?.type===Ge));t?.type===Ge&&(u+=";"+t?.attributes?.style,m+=t?.attributes?.class)})),(0,s.createElement)(P.BlockControls,null,(0,s.createElement)(P.RichTextToolbarButton,{icon:He,title:(0,S.__)("Gradient","blockify"),isActive:t,shortcutType:"primary",shortcutCharacter:"g",onClick:()=>i(!a)}),a&&(0,s.createElement)(_.Toolbar,{className:"blockify-components-toolbar"},(0,s.createElement)(_.Popover,{position:"bottom center",className:"blockify-gradient-text-control",focusOnMount:"container",onFocusOutside:()=>i(!1)},(0,s.createElement)(_.GradientPicker,{value:null!=r?r:"",gradients:c,onChange:e=>{o(e);let t=u,r=m;c.forEach((t=>{t.gradient===e&&(r+=(r?" ":"")+"has-"+t.slug+"-gradient-background")})),e&&!r.includes("-gradient-background")&&(t+=(t?t+";":"")+"background:"+e),r?.includes("has-text-gradient")&&(r=r?.replace("has-text-gradient","")?.trim()+" has-text-gradient"),l((0,Le.applyFormat)(n,{type:Ge,attributes:{style:t,class:r}}))}}))))}});var Ue=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));_.CustomSelectControl.Option;const We="blockify/typography",qe=[{key:"Default",name:"Default",style:{}},{key:"Thin",name:"Thin",style:{fontStyle:"normal",fontWeight:100}},{key:"Extra Light",name:"Extra Light",style:{fontStyle:"normal",fontWeight:200}},{key:"Light",name:"Light",style:{fontStyle:"normal",fontWeight:300}},{key:"Regular",name:"Regular",style:{fontStyle:"normal",fontWeight:400}},{key:"Medium",name:"Medium",style:{fontStyle:"normal",fontWeight:500}},{key:"Semi Bold",name:"Semi Bold",style:{fontStyle:"normal",fontWeight:600}},{key:"Bold",name:"Bold",style:{fontStyle:"normal",fontWeight:700}},{key:"Extra Bold",name:"Extra Bold",style:{fontStyle:"normal",fontWeight:800}},{key:"Black",name:"Black",style:{fontStyle:"normal",fontWeight:900}},{key:"Thin Italic",name:"Thin Italic",style:{fontStyle:"italic",fontWeight:100}},{key:"Extra Light Italic",name:"Extra Light Italic",style:{fontStyle:"italic",fontWeight:200}},{key:"Light Italic",name:"Light Italic",style:{fontStyle:"italic",fontWeight:300}},{key:"Regular Italic",name:"Regular Italic",style:{fontStyle:"italic",fontWeight:400}},{key:"Medium Italic",name:"Medium Italic",style:{fontStyle:"italic",fontWeight:500}},{key:"Semi Bold Italic",name:"Semi Bold Italic",style:{fontStyle:"italic",fontWeight:600}},{key:"Bold Italic",name:"Bold Italic",style:{fontStyle:"italic",fontWeight:700}},{key:"Extra Bold Italic",name:"Extra Bold Italic",style:{fontStyle:"italic",fontWeight:800}},{key:"Black Italic",name:"Black Italic",style:{fontStyle:"italic",fontWeight:900}}];(0,Le.registerFormatType)(We,{title:(0,S.__)("Typography","blockify"),tagName:"span",className:"has-font",edit:e=>{var t;const{isActive:n,value:l,onChange:o}=e,[a,i]=(0,s.useState)(!1),{fontSizes:c}=(0,g.useSelect)((e=>({fontSizes:e("core/block-editor")?.getSettings()?.fontSizes})),[]),u=(null!==(t=window?.blockify?.selectedFonts)&&void 0!==t?t:[])?.map((e=>({label:r(e?.replace("-"," ")),value:e})));let d="",f="";l?.formats&&l.formats.forEach((e=>{e&&e.forEach((e=>{var t,n;e?.type===We&&(d=null!==(t=e?.attributes?.style)&&void 0!==t?t:"",f=null!==(n=e?.attributes?.class)&&void 0!==n?n:"")}))}));const[y,h]=(0,s.useState)({style:p(d),class:f.split(" "),fontFamily:"",fontSize:"",fontAppearance:qe[0],isOpen:!1});return(0,s.createElement)(P.BlockControls,null,(0,s.createElement)(P.RichTextToolbarButton,{icon:Ue,title:(0,S.__)("Typography","blockify"),isActive:n,shortcutType:"primary",shortcutCharacter:"f",onClick:()=>h({...y,isOpen:!y.isOpen})}),y?.isOpen&&(0,s.createElement)(_.Toolbar,{className:"blockify-components-toolbar"},(0,s.createElement)(_.Popover,{position:"bottom center",className:"blockify-font-family-control",focusOnMount:"container",onFocusOutside:()=>h({...y,isOpen:!1})},(0,s.createElement)(_.SelectControl,{label:(0,S.__)("Select Font Family","blockify"),value:y?.fontFamily,options:u,onChange:e=>{h({...y,fontFamily:e});const t="has-"+e+"-font-family";y?.class?.includes(t)||y?.class?.push(t),o((0,Le.applyFormat)(l,{type:We,attributes:{style:m(y?.style),class:y?.class?.join(" ")}}))}}),(0,s.createElement)(_.FontSizePicker,{fontSizes:c,fallbackFontSize:20,value:parseInt(y?.fontSize),withSlider:!0,onChange:e=>{h({...y,fontSize:e.toString()}),e&&(y.style["--wp--custom--font-size"]=e.toString()),y?.class?.includes("has-inline-font-size")||y.class.push("has-inline-font-size"),o((0,Le.applyFormat)(l,{type:We,attributes:{style:m(y?.style),class:y?.class?.join(" ")}}))}}),(0,s.createElement)(_.CustomSelectControl,{label:(0,S.__)("Appearance","blockify"),value:qe.find((e=>e.key===y?.fontAppearance?.key)),options:null!=qe?qe:[],onChange:e=>{let{selectedItem:t}=e;t&&h({...y,fontAppearance:t}),t?.style?.fontStyle&&(y.style["font-style"]=t?.style?.fontStyle),t?.style?.fontWeight&&(y.style["font-weight"]=t?.style?.fontWeight?.toString()),o((0,Le.applyFormat)(l,{type:We,attributes:{style:m(y?.style),class:y?.class?.join(" ")}}))}}))))}});var $e=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const Xe="blockify/inline-svg";(0,Le.registerFormatType)(Xe,{title:(0,S.__)("Inline SVG","blockify"),object:!0,tagName:"img",className:"has-inline-svg",edit:e=>{const{isActive:t,onChange:n,value:l}=e,[r,o]=(0,s.useState)(!1),[a,i]=(0,s.useState)({string:"",width:"1em",widthDesktop:"1em",alt:"",src:""});return(0,s.createElement)(P.BlockControls,null,(0,s.createElement)(P.RichTextToolbarButton,{icon:$e,title:(0,S.__)("Inline SVG","blockify"),isActive:t,shortcutType:"primary",shortcutCharacter:"v",onClick:()=>o(!r)}),r&&(0,s.createElement)(_.Toolbar,{className:"blockify-components-toolbar"},(0,s.createElement)(_.Popover,{position:"bottom center",className:"blockify-svg-control",focusOnMount:"container",onFocusOutside:()=>o(!1)},(0,s.createElement)(_.TextareaControl,{label:(0,S.__)("SVG String","blockify"),help:(0,S.__)("Paste your SVG string in the field above and then click the button below to insert your image.","blockify"),value:a?.string,placeholder:(0,S.__)("Paste your SVG string here","blockify"),rows:20,onChange:e=>{i({...a,string:e.replace(/'/g,'"')})},style:{fontFamily:"var(--wp--preset--font-family--monospace, monospace)",width:"300px"}}),(0,s.createElement)("br",null),(0,s.createElement)(_.TextareaControl,{label:(0,S.__)("Alt Text","blockify"),placeholder:(0,S.__)("SVG description","blockify"),value:a?.alt,rows:2,onChange:e=>{i({...a,alt:e})},style:{width:"300px"}}),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(_.Flex,null,(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalUnitControl,{label:(0,S.__)("Width Mobile","blockify"),value:a?.width,onChange:e=>{i({...a,width:e})}})),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalUnitControl,{label:(0,S.__)("Width Desktop","blockify"),value:a?.widthDesktop,onChange:e=>{i({...a,widthDesktop:e})}})))),(0,s.createElement)("br",null),(0,s.createElement)(_.Button,{text:(0,S.__)("Insert SVG","blockify"),onClick:()=>(e=>{let t=`-webkit-mask-image:url(${"data:image/svg+xml;utf8,"+encodeURIComponent(e?.string)})`;e?.width&&(t+=`;--width: ${e?.width}`),e?.widthDesktop&&(t+=`;--width-desktop: ${e?.widthDesktop}`),n((0,Le.insertObject)(l,{type:Xe,attributes:{style:t,alt:e?.alt,role:"presentation",src:""}})),o(!1)})(a)}))))}});var Ye=(0,s.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(C.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"}));const Ze="blockify/underline",Ke=["none","solid","wavy","dashed","dotted","double","brush","circle"];(0,Le.registerFormatType)(Ze,{title:(0,S.__)("Underline","blockify"),tagName:"u",className:"has-text-underline",attributes:{style:"style",class:"class"},edit:e=>{let{isActive:t,value:n,onChange:l}=e;const[r,o]=(0,s.useState)(""),[a,i]=(0,s.useState)(!1);let c=[],u=[];return n?.formats&&n.formats.forEach((e=>{e&&e.forEach((e=>{e.type===Ze&&(e.attributes?.style&&(c=e.attributes.style.split(";")),e.attributes?.class&&(u=e.attributes.class.split(" ")))}))})),(0,s.createElement)(P.BlockControls,null,(0,s.createElement)(P.RichTextShortcut,{type:"primary",character:"u",onUse:()=>{l((0,Le.toggleFormat)(n,{type:Ze}))}}),(0,s.createElement)(P.RichTextToolbarButton,{icon:Ye,title:(0,S.__)("Underline","blockify"),isActive:t,shortcutType:"primary",shortcutCharacter:"u",onClick:()=>i(!a)}),a&&(0,s.createElement)(_.Toolbar,{className:"blockify-components-toolbar"},(0,s.createElement)(_.Popover,{position:"bottom center",className:"blockify-underline-format",focusOnMount:"container",onFocusOutside:()=>i(!1)},(0,s.createElement)(_.__experimentalText,null,(0,S.__)("Underline style","blockify")),(0,s.createElement)("br",null),(0,s.createElement)(_.SelectControl,{onChange:e=>{var t,r;"none"===e&&l((0,Le.removeFormat)(n,Ze)),o(e);const a=null!==(t=u)&&void 0!==t?t:[];a.forEach(((e,t)=>{e.includes("is-underline-")&&delete i.classes[t]}));const i={classes:[...a,"is-underline-"+e],styles:[...null!==(r=c)&&void 0!==r?r:[],"--wp--custom--underline--style:"+e]};l((0,Le.applyFormat)(n,{type:Ze,attributes:{class:i.classes.join(" "),style:i.styles.join(";")}}))},value:r,options:Ke.map((e=>{return{label:(t=e,t.charAt(0).toUpperCase()+t.slice(1)),value:e};var t}))}))))}})}()}();
\ No newline at end of file
+(()=>{var e={960:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(960),a=n(790);o(n(790),t);var l={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=function(){function e(e,t,n){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=l),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:l,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,r=new a.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===i.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new a.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new a.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new a.Text(""),t=new a.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new a.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=s,t.default=s},790:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(l);t.NodeWithChildren=p;var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=m;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=f;var h=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?a.ElementType.Script:"style"===t?a.ElementType.Style:a.ElementType.Tag);var i=e.call(this,r)||this;return i.name=t,i.attribs=n,i.type=o,i}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(p);function g(e){return(0,a.isTag)(e)}function b(e){return e.type===a.ElementType.CDATA}function v(e){return e.type===a.ElementType.Text}function y(e){return e.type===a.ElementType.Comment}function k(e){return e.type===a.ElementType.Directive}function w(e){return e.type===a.ElementType.Root}function E(e,t){var n;if(void 0===t&&(t=!1),v(e))n=new c(e.data);else if(y(e))n=new u(e.data);else if(g(e)){var r=t?x(e.children):[],o=new h(e.name,i({},e.attribs),r);r.forEach((function(e){return e.parent=o})),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=i({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=i({},e["x-attribsPrefix"])),n=o}else if(b(e)){r=t?x(e.children):[];var a=new m(r);r.forEach((function(e){return e.parent=a})),n=a}else if(w(e)){r=t?x(e.children):[];var l=new f(r);r.forEach((function(e){return e.parent=l})),e["x-mode"]&&(l["x-mode"]=e["x-mode"]),n=l}else{if(!k(e))throw new Error("Not implemented yet: ".concat(e.type));var s=new d(e.name,e.data);null!=e["x-name"]&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),n=s}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function x(e){for(var t=e.map((function(e){return E(e,!0)})),n=1;n{"use strict";var r=n(296),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?a:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(f){var o=m(n);o&&o!==f&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var l=s(t),h=s(n),g=0;g{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,m=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,k=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case l:case a:case m:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case h:case s:return e;default:return t}}case o:return t}}}function E(e){return w(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=h,t.Portal=o,t.Profiler=l,t.StrictMode=a,t.Suspense=m,t.isAsyncMode=function(e){return E(e)||w(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===p},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===h},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===l||e===a||e===m||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===y||e.$$typeof===k||e.$$typeof===b)},t.typeOf=w},296:(e,t,n)=>{"use strict";e.exports=n(103)},885:(e,t)=>{t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]},276:e=>{var t="html",n="head",r="body",o=/<([a-zA-Z]+[0-9]?)/,i=//i,a=//i,l=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},s=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},c="object"==typeof window&&window.DOMParser;if("function"==typeof c){var u=new c;l=s=function(e,t){return t&&(e="<"+t+">"+e+""+t+">"),u.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var d=document.implementation.createHTMLDocument();l=function(e,t){return t?(d.documentElement.querySelector(t).innerHTML=e,d):(d.documentElement.innerHTML=e,d)}}var p,m="object"==typeof document?document.createElement("template"):{};m.content&&(p=function(e){return m.innerHTML=e,m.content.childNodes}),e.exports=function(e){var c,u,d,m,f=e.match(o);switch(f&&f[1]&&(c=f[1].toLowerCase()),c){case t:return u=s(e),i.test(e)||(d=u.querySelector(n))&&d.parentNode.removeChild(d),a.test(e)||(d=u.querySelector(r))&&d.parentNode.removeChild(d),u.querySelectorAll(t);case n:case r:return m=(u=l(e)).querySelectorAll(c),a.test(e)&&i.test(e)?m[0].parentNode.childNodes:m;default:return p?p(e):(d=l(e,r).querySelector(r)).childNodes}}},152:(e,t,n)=>{var r=n(276),o=n(507).formatDOM,i=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(i);return n&&n[1]&&(t=n[1]),o(r(e),null,t)}},507:(e,t,n)=>{for(var r,o=n(915),i=n(885).CASE_SENSITIVE_TAG_NAMES,a=o.Comment,l=o.Element,s=o.ProcessingInstruction,c=o.Text,u={},d=0,p=i.length;d{var r=n(915),o=n(152),i=n(484),a=n(670);o="function"==typeof o.default?o.default:o;var l={lowerCaseAttributeNames:!1};function s(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:a(o(e,(t=t||{}).htmlparser2||l),t)}s.domToReact=a,s.htmlToDOM=o,s.attributesToProps=i,s.Comment=r.Comment,s.Element=r.Element,s.ProcessingInstruction=r.ProcessingInstruction,s.Text=r.Text,e.exports=s,s.default=s},484:(e,t,n)=>{var r=n(726),o=n(606),i=["checked","value"],a=["input","select","textarea"],l={reset:!0,submit:!0};function s(e){return r.possibleStandardNames[e]}e.exports=function(e,t){var n,c,u,d,p,m={},f=(e=e||{}).type&&l[e.type];for(n in e)if(u=e[n],r.isCustomAttribute(n))m[n]=u;else if(d=s(c=n.toLowerCase()))switch(p=r.getPropertyInfo(d),-1===i.indexOf(d)||-1===a.indexOf(t)||f||(d=s("default"+c)),m[d]=u,p&&p.type){case r.BOOLEAN:m[d]=!0;break;case r.OVERLOADED_BOOLEAN:""===u&&(m[d]=!0)}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(m[n]=u);return o.setStyleProp(e.style,m),m}},670:(e,t,n)=>{var r=n(196),o=n(484),i=n(606),a=i.setStyleProp,l=i.canTextBeChildOfNode;function s(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&i.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var i,c,u,d,p,m=(n=n||{}).library||r,f=m.cloneElement,h=m.createElement,g=m.isValidElement,b=[],v="function"==typeof n.replace,y=n.trim,k=0,w=t.length;k1&&(u=f(u,{key:u.key||k})),b.push(u);else if("text"!==i.type){switch(d=i.attribs,s(i)?a(d.style,d):d&&(d=o(d,i.name)),p=null,i.type){case"script":case"style":i.children[0]&&(d.dangerouslySetInnerHTML={__html:i.children[0].data});break;case"tag":"textarea"===i.name&&i.children[0]?d.defaultValue=i.children[0].data:i.children&&i.children.length&&(p=e(i.children,n));break;default:continue}w>1&&(d.key=k),b.push(h(i.name,d,p))}else{if((c=!i.data.trim().length)&&i.parent&&!l(i.parent))continue;if(y&&c)continue;b.push(i.data)}return 1===b.length?b[0]:b}},606:(e,t,n)=>{var r=n(196),o=n(476).default,i={reactCompat:!0},a=r.version.split(".")[0]>=16,l=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,o="function"==typeof t,i={},a={};for(n in e)r=e[n],o&&(i=t(n,r))&&2===i.length?a[i[0]]=i[1]:"string"==typeof r&&(a[r]=n);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){if(null!=e)try{t.style=o(e,i)}catch(e){t.style={}}},canTextBeChildOfNode:function(e){return!l.has(e.name)},elementsWithNoTextChildren:l}},139:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(s,c):c}e.exports=function(e,s){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};var d=1,p=1;function m(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function f(){var e={line:d,column:p};return function(t){return t.position=new h(e),y(),t}}function h(e){this.start=e,this.end={line:d,column:p},this.source=s.source}h.prototype.content=e;var g=[];function b(t){var n=new Error(s.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=s.source,n.line=d,n.column=p,n.source=e,!s.silent)throw n;g.push(n)}function v(t){var n=t.exec(e);if(n){var r=n[0];return m(r),e=e.slice(r.length),n}}function y(){v(r)}function k(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return b("End of comment missing");var r=e.slice(2,n-2);return p+=2,m(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function E(){var e=f(),n=v(o);if(n){if(w(),!v(i))return b("property missing ':'");var r=v(a),s=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return v(l),s}}return y(),function(){var e,t=[];for(k(t);e=E();)!1!==e&&(t.push(e),k(t));return t}()}},433:()=>{Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},325:(e,t,n)=>{var r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);x+=E.value.length,E=E.next){var C=E.value;if(t.length>e.length)return;if(!(C instanceof i)){var S,_=1;if(v){if(!(S=a(w,x,e,b))||S.index>=e.length)break;var O=S.index,F=S.index+S[0].length,P=x;for(P+=E.value.length;O>=P;)P+=(E=E.next).value.length;if(x=P-=E.value.length,E.value instanceof i)continue;for(var I=E;I!==t.tail&&(Pd.reach&&(d.reach=M);var R=E.prev;if(A&&(R=c(t,R,A),x+=A.length),u(t,R,_),E=c(t,R,new i(p,g?o.tokenize(T,g):T,y,T)),N&&c(t,E,N),_>1){var B={cause:p+","+f,reach:M};l(e,t,n,E.prev,x,B),d&&B.reach>d.reach&&(d.reach=B.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function u(e,t,n){for(var r=t.next,o=0;o"+i.content+""+i.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,a=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),a&&e.close()}),!1),o):o;var d=o.util.currentScript();function p(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var m=document.readyState;"loading"===m||"interactive"===m&&d&&d.defer?document.addEventListener("DOMContentLoaded",p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r)},980:()=>{Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript},726:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},460:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1){t._history.stack=s.slice(0,c+1);var u=t._history.stack.length;if(u>100){var d=u-100;t._history.stack=s.slice(d,u),t._history.offset=Math.max(t._history.offset-d,0)}}var p=Date.now();if(n){var m=t._history.stack[t._history.offset];if(m&&p-m.timestamp<3e3){var f=/[^a-z0-9]([a-z0-9]+)$/i,h=null===(r=t._getLines(m.value,m.selectionStart).pop())||void 0===r?void 0:r.match(f),g=null===(o=t._getLines(e.value,e.selectionStart).pop())||void 0===o?void 0:o.match(f);if((null==h?void 0:h[1])&&(null===(a=null==g?void 0:g[1])||void 0===a?void 0:a.startsWith(h[1])))return void(t._history.stack[t._history.offset]=i(i({},e),{timestamp:p}))}}t._history.stack.push(i(i({},e),{timestamp:p})),t._history.offset++},t._updateInput=function(e){var n=t._input;n&&(n.value=e.value,n.selectionStart=e.selectionStart,n.selectionEnd=e.selectionEnd,t.props.onValueChange(e.value))},t._applyEdits=function(e){var n=t._input,r=t._history.stack[t._history.offset];r&&n&&(t._history.stack[t._history.offset]=i(i({},r),{selectionStart:n.selectionStart,selectionEnd:n.selectionEnd})),t._recordChange(e),t._updateInput(e)},t._undoEdit=function(){var e=t._history,n=e.stack,r=e.offset,o=n[r-1];o&&(t._updateInput(o),t._history.offset=Math.max(r-1,0))},t._redoEdit=function(){var e=t._history,n=e.stack,r=e.offset,o=n[r+1];o&&(t._updateInput(o),t._history.offset=Math.min(r+1,n.length-1))},t._handleKeyDown=function(e){var n=t.props,r=n.tabSize,o=n.insertSpaces,i=n.ignoreTabKey,a=n.onKeyDown;if(!a||(a(e),!e.defaultPrevented)){27===e.keyCode&&e.currentTarget.blur();var l=e.currentTarget,s=l.value,c=l.selectionStart,u=l.selectionEnd,m=(o?" ":"\t").repeat(r);if(9===e.keyCode&&!i&&t.state.capture)if(e.preventDefault(),e.shiftKey){var f=(v=t._getLines(s,c)).length-1,h=t._getLines(s,u).length-1,g=s.split("\n").map((function(e,t){return t>=f&&t<=h&&e.startsWith(m)?e.substring(m.length):e})).join("\n");if(s!==g){var b=v[f];t._applyEdits({value:g,selectionStart:(null==b?void 0:b.startsWith(m))?c-m.length:c,selectionEnd:u-(s.length-g.length)})}}else if(c!==u){var v,y=(v=t._getLines(s,c)).length-1,k=t._getLines(s,u).length-1;b=v[y],t._applyEdits({value:s.split("\n").map((function(e,t){return t>=y&&t<=k?m+e:e})).join("\n"),selectionStart:b&&/\S/.test(b)?c+m.length:c,selectionEnd:u+m.length*(k-y+1)})}else{var w=c+m.length;t._applyEdits({value:s.substring(0,c)+m+s.substring(u),selectionStart:w,selectionEnd:w})}else if(8===e.keyCode){var E=c!==u;s.substring(0,c).endsWith(m)&&!E&&(e.preventDefault(),w=c-m.length,t._applyEdits({value:s.substring(0,c-m.length)+s.substring(u),selectionStart:w,selectionEnd:w}))}else if(13===e.keyCode){if(c===u){var x=t._getLines(s,c).pop(),C=null==x?void 0:x.match(/^\s+/);if(null==C?void 0:C[0]){e.preventDefault();var S="\n"+C[0];w=c+S.length,t._applyEdits({value:s.substring(0,c)+S+s.substring(u),selectionStart:w,selectionEnd:w})}}}else if(57===e.keyCode||219===e.keyCode||222===e.keyCode||192===e.keyCode){var _=void 0;57===e.keyCode&&e.shiftKey?_=["(",")"]:219===e.keyCode?_=e.shiftKey?["{","}"]:["[","]"]:222===e.keyCode?_=e.shiftKey?['"','"']:["'","'"]:192!==e.keyCode||e.shiftKey||(_=["`","`"]),c!==u&&_&&(e.preventDefault(),t._applyEdits({value:s.substring(0,c)+_[0]+s.substring(c,u)+_[1]+s.substring(u),selectionStart:c,selectionEnd:u+2}))}else!(p?e.metaKey&&90===e.keyCode:e.ctrlKey&&90===e.keyCode)||e.shiftKey||e.altKey?(p?e.metaKey&&90===e.keyCode&&e.shiftKey:d?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&90===e.keyCode&&e.shiftKey)&&!e.altKey?(e.preventDefault(),t._redoEdit()):77!==e.keyCode||!e.ctrlKey||p&&!e.shiftKey||(e.preventDefault(),t.setState((function(e){return{capture:!e.capture}}))):(e.preventDefault(),t._undoEdit())}},t._handleChange=function(e){var n=e.currentTarget,r=n.value,o=n.selectionStart,i=n.selectionEnd;t._recordChange({value:r,selectionStart:o,selectionEnd:i},!0),t.props.onValueChange(r)},t._history={stack:[],offset:-1},t._input=null,t}return o(t,e),t.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(t.prototype,"session",{get:function(){return{history:this._history}},set:function(e){this._history=e.history},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props,n=t.value,r=t.style,o=t.padding,a=t.highlight,l=t.textareaId,s=t.textareaClassName,d=t.autoFocus,p=t.disabled,h=t.form,b=t.maxLength,v=t.minLength,y=t.name,k=t.placeholder,w=t.readOnly,E=t.required,x=t.onClick,C=t.onFocus,S=t.onBlur,_=t.onKeyUp,O=(t.onKeyDown,t.onValueChange,t.tabSize,t.insertSpaces,t.ignoreTabKey,t.preClassName),F=c(t,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),P={paddingTop:"object"==typeof o?o.top:o,paddingRight:"object"==typeof o?o.right:o,paddingBottom:"object"==typeof o?o.bottom:o,paddingLeft:"object"==typeof o?o.left:o},I=a(n);return u.createElement("div",i({},F,{style:i(i({},g.container),r)}),u.createElement("pre",i({className:O,"aria-hidden":"true",style:i(i(i({},g.editor),g.highlight),P)},"string"==typeof I?{dangerouslySetInnerHTML:{__html:I+" "}}:{children:I})),u.createElement("textarea",{ref:function(t){return e._input=t},style:i(i(i({},g.editor),g.textarea),P),className:m+(s?" ".concat(s):""),id:l,value:n,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:x,onKeyUp:_,onFocus:C,onBlur:S,disabled:p,form:h,maxLength:b,minLength:v,name:y,placeholder:k,readOnly:w,required:E,autoFocus:d,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),u.createElement("style",{dangerouslySetInnerHTML:{__html:f}}))},t.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},t}(u.Component);t.default=h;var g={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}}},476:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=r(n(848)),i=n(678);t.default=function(e,t){var n={};return e&&"string"==typeof e?((0,o.default)(e,(function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)})),n):n}},678:(e,t)=>{"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,o=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(e,t){return t.toUpperCase()},s=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||o.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(a,s):e.replace(i,s)).replace(r,l))}},848:(e,t,n)=>{var r=n(139);function o(e,t){var n,o=null;if(!e||"string"!=typeof e)return o;for(var i,a,l=r(e),s="function"==typeof t,c=0,u=l.length;c{"use strict";e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(196);const t=window.wp.hooks,r=window.wp.compose,o=e=>e?e?.toLowerCase()?.replace(/(?<= )[^\s]|^./g,(e=>e?.toUpperCase())):"",i=e=>{var t;return e&&null!==(t=e?.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.join("-")?.toLowerCase())&&void 0!==t?t:""},a=(e="",t,n)=>{if("string"==typeof t)return e?.split(t)?.join(n);for(const r of t)e=a(e,r,n);return e},l=e=>o(a((e=>{const t=e.replace(/([A-Z])/g," $1");return t.charAt(0).toUpperCase()+t.slice(1)})(e),["-","_"]," "));var s,c;const u=null!==(s=window?.blockify?.blockSupports)&&void 0!==s?s:{},d=e=>{var t;return null!==(t=u?.[e]?.blockifyPosition)&&void 0!==t&&t},p=null!==(c=window?.blockify?.extensionOptions)&&void 0!==c?c:{};(0,t.addFilter)("blocks.registerBlockType","blockify/add-position-attributes",((e,t)=>{if(d(t)){var n;const t={};Object.keys(p).forEach((e=>{t[e]={type:"object"}})),e.attributes={...e.attributes,style:{...t,...null!==(n=e?.attributes?.style)&&void 0!==n?n:{}}}}return e}),0);const m=e=>{var t;const n=[],r=null!==(t=e?.style)&&void 0!==t?t:{};return Object.keys(p).forEach((e=>{var t;const o=i(e);var a,l,s,c,u,d;p?.[e]?.options?(null!==(a=r?.[e]?.all)&&void 0!==a&&a&&n.push(`has-${o}-${i(null!==(c=r?.[e]?.all)&&void 0!==c?c:"")}`),null!==(l=r?.[e]?.mobile)&&void 0!==l&&l&&n.push(`has-${o}-${i(null!==(u=r?.[e]?.mobile)&&void 0!==u?u:"")}-mobile`),null!==(s=r?.[e]?.desktop)&&void 0!==s&&s&&n.push(`has-${o}-${i(null!==(d=r?.[e]?.desktop)&&void 0!==d?d:"")}-desktop`)):null!==(t=r?.[e])&&void 0!==t&&t&&n.push(`has-${o}`)})),n},f=e=>{var t;const n={},r=null!==(t=e?.style)&&void 0!==t?t:{};return Object.keys(p).forEach((e=>{var t,o,a;if(p?.[e]?.options)return;const l=i(e);null!==(t=r?.[e]?.all)&&void 0!==t&&t&&(n[`--${l}`]=r?.[e]?.all),null!==(o=r?.[e]?.mobile)&&void 0!==o&&o&&(n[`--${l}-mobile`]=r?.[e]?.mobile),null!==(a=r?.[e]?.desktop)&&void 0!==a&&a&&(n[`--${l}-desktop`]=r?.[e]?.desktop)})),n};(0,t.addFilter)("editor.BlockListBlock","blockify/with-position-style",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{name:o,attributes:i}=n;if(!d(o))return(0,e.createElement)(t,{...n});const a=m(i),l=f(i),s=null!==(r=n?.wrapperProps)&&void 0!==r?r:{};return n={...n,style:{...n?.style,...l}},s&&(s.style={...s?.style,...l}),a.forEach((e=>{n?.className?.includes(e)||(n.className=n?.className+" "+e)})),n.wrapperProps=s,(0,e.createElement)(t,{...n})}),"withPositionStyle")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/save-position-style",(e=>{const{name:t,attributes:n}=e;if(!u?.[t]?.blockifyPosition)return e;const r=m(n),o=f(n);return r.forEach((t=>{e?.className?.includes(t)||(e.className=e?.className+" "+t)})),e={...e,style:{...e?.style,...o}}}),11);const h=window.wp.domReady;var g=n.n(h);const b=window.wp.blocks;g()((()=>{var e,t,n;const r=null!==(e=window?.blockify?.blockStyles)&&void 0!==e?e:{unregister:{},register:{}},i=null!==(t=r?.unregister)&&void 0!==t?t:{},l=null!==(n=r?.register)&&void 0!==n?n:{};Object.keys(i).forEach((e=>{i[e].forEach((t=>{(0,b.unregisterBlockStyle)(e,t)}))})),Object.keys(l).forEach((e=>{l[e].forEach((t=>{let n="",r="";"string"==typeof t?(n=t,r=o(a(t,"-"," "))):(n=Object.keys(t)[0],r=Object.values(t)[0]),(0,b.registerBlockStyle)(e,{name:n,label:r})}))}))}));const v=e=>Object.keys(e).map((t=>`${t?.includes("-")?t:i(t)}:${e[t]};`)).join(" "),y=e=>{const t={};return e.split(";").map((e=>{const[n,r]=e.split(":");return n&&(t[n]=r),null})),t},k=e=>e.includes("var:")?(e=e.replace("var:","var(--wp--"),(e=a(e,"|","--"))+")"):e,w=(e="",t="")=>{if(!t)return e;const n=e.trim().split(" ");return t.trim().split(" ").forEach((e=>{n.includes(e)||n.push(e)})),n.join(" ")},E=[{value:"px",label:"px"},{value:"%",label:"%"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"vw",label:"vw"},{value:"vh",label:"vh"},{value:"auto",label:"auto"}];var x;(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000"},(0,e.createElement)("path",{fill:"currentColor",d:"m1729.66 534.39-691.26-399.1a76.814 76.814 0 0 0-76.81 0l-691.26 399.1a76.818 76.818 0 0 0-38.4 66.52v798.19c0 27.44 14.64 52.8 38.4 66.52l691.26 399.1c11.88 6.86 25.14 10.29 38.4 10.29s26.52-3.43 38.4-10.29l691.26-399.1a76.818 76.818 0 0 0 38.4-66.52V600.9c.01-27.44-14.63-52.79-38.39-66.51zm-115.21 820.36-539.18 311.3V998.46c0-27.45-14.65-52.81-38.43-66.53l-574.18-331.2L1000 290.49l614.45 354.75v709.51z"}));const C=null!==(x=window?.blockify?.defaultIcon)&&void 0!==x?x:{set:"wordpress",name:"star-empty",string:' '},S=e=>{var t,n;const r={};let o="";const i=e?.className?.includes("is-style-icon");if(!(e?.iconSet&&e?.iconName||i))return r;e?.style?.color?.background&&(o=e.style.color.background),e?.backgroundColor&&(o="var(--wp--preset--color--"+e.backgroundColor+", currentColor)"),"start"===e?.iconPosition&&(r["--wp--custom--icon--order"]="-1");let a="";e?.style?.color?.gradient&&(a=e?.style?.color?.gradient),e?.gradient&&(a="var(--wp--preset--gradient--"+e.gradient+",currentColor)");let l="";if(e?.style?.color?.text&&(l=e?.style?.color?.text),e?.textColor&&(l="var(--wp--preset--color--"+e.textColor+",currentColor)"),""!==o&&(r["--wp--custom--icon--background"]=o),l?(r["--wp--custom--icon--color"]=l,a&&(r["--wp--custom--icon--background"]=a)):a&&(r["--wp--custom--icon--color"]=a),e?.style?.spacing?.padding){var s,c,u,d;const t=e.style.spacing.padding,n={top:null!==(s=t?.top)&&void 0!==s?s:"0",right:null!==(c=t?.right)&&void 0!==c?c:"0",bottom:null!==(u=t?.bottom)&&void 0!==u?u:"0",left:null!==(d=t?.left)&&void 0!==d?d:"0"};Object.keys(n).forEach((e=>{var t;const r=null!==(t=n?.[e])&&void 0!==t?t:"";r&&r?.includes("var:preset")&&(n[e]="var(--wp--preset--spacing--"+r.replace("var:preset|spacing|","")+")")})),r["--wp--custom--icon--padding"]=Object.values(n).join(" ")}if(e?.style?.spacing?.margin){var p,m,f,h;const t=e.style.spacing.margin,n={top:null!==(p=t?.top)&&void 0!==p?p:"",right:null!==(m=t?.right)&&void 0!==m?m:"",bottom:null!==(f=t?.bottom)&&void 0!==f?f:"",left:null!==(h=t?.left)&&void 0!==h?h:""};Object.keys(n).forEach((e=>{var t;const r=null!==(t=n?.[e])&&void 0!==t?t:"";r?.includes("var:preset")&&(n[e]="var(--wp--preset--spacing--"+r?.replace("var:preset|spacing|","")+")")})),r["--wp--custom--icon--margin"]=Object.values(n).join(" ")}let g="";var b,v;e?.borderColor&&(g="var(--wp--preset--color--"+e?.borderColor+")"),e?.style?.border?.width&&(r["--wp--custom--icon--border-width"]=e.style.border.width,r["--wp--custom--icon--border-style"]=null!==(b=e.style.border?.style)&&void 0!==b?b:"solid",r["--wp--custom--icon--border-color"]=null!==(v=e.style.border?.color)&&void 0!==v?v:g);let y=null!==(t=e?.iconSize)&&void 0!==t?t:"";if(""!==y){const e=["px","em","rem","vh","vw","%"].some((e=>y?.includes(e)));y=e?y:y+"px",r["--wp--custom--icon--size"]=y}const k=null!==(n=e?.iconSvgString)&&void 0!==n?n:"";return k&&(r["--wp--custom--icon--url"]="url('data:image/svg+xml;utf8,"+k+"')"),r};var _;const O=null!==(_=window?.blockify?.blockSupports)&&void 0!==_?_:{};(0,t.addFilter)("blocks.registerBlockType","blockify/block-supports",((e,t)=>(Object.keys(O).includes(t)&&(e.supports={...e.supports,...O[t]}),e)),0),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/alignment-class",((e,t,n)=>(Object.keys(O).includes(t.name)&&n?.align&&!e.className.includes(" align")&&(e.className+=" align"+n.align),e))),(0,t.addFilter)("editor.BlockListBlock","blockify/with-block-gap-css",(0,r.createHigherOrderComponent)((t=>n=>{var r,o;const{name:i}=n,a=(0,e.createElement)(t,{...n});if(!["core/page-list","core/button","core/post-author"].includes(i))return a;const l=null!==(r=n?.attributes?.style?.spacing?.blockGap)&&void 0!==r?r:"";if(!l)return a;const s={...(n={...n,style:{...null!==(o=n.style)&&void 0!==o?o:{},"--wp--style--block-gap":k(l)}}).wrapperProps,style:{...n.wrapperProps?.style,"--wp--style--block-gap":k(l)}};return(0,e.createElement)(t,{...n,wrapperProps:s})}),"withBlockGapCss")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/with-no-spacer-height",((e,t,n)=>{var r;return"core/spacer"!==t.name||(null!==(r=n?.height)&&void 0!==r?r:"")||(e.style={...e.style,height:""}),e}));const F=window.wp.apiFetch;var P=n.n(F);const I=window.wp.data,T={icons:{social:{},wordpress:{}}},A={setIcons:e=>({type:"SET_ICONS",icons:e}),getIcons:e=>({type:"GET_ICONS",path:e})},N={getIcons(e){const{icons:t}=e;return t}},M={GET_ICONS:e=>P()({path:e.path})},R={*getIcons(){const e=yield A.getIcons("/blockify/v1/icons/");return A.setIcons(e)}},B="blockify/icons";(0,I.select)("blockify/icons")?.getIcons()||(0,I.register)((0,I.createReduxStore)(B,{reducer:(e=T,t)=>"SET_ICONS"===t.type?{...e,icons:t.icons}:e,actions:A,selectors:N,controls:M,resolvers:R}));const D=window.wp.components,L=window.wp.i18n,V=window.wp.primitives,j=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"})),z=({children:t,style:n})=>(0,e.createElement)("p",{className:"blockify-control-label",style:{margin:"8px 0",...n}},t),H=({children:t,style:n})=>(0,e.createElement)("p",{style:{fontSize:"12px",color:"rgb(117, 117, 117)",...n}},t);var $=n(460),U=n.n($),G=n(325);n(433),n(980);const W=window.wp.element,q=({code:t,onChange:n,rows:r=32,language:i="html"})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(U(),{highlight:e=>{var t;return(0,G.highlight)(e,null!==(t=G.languages?.[i])&&void 0!==t?t:"html")},placeholder:(0,L.__)("Please enter ","blockify")+o(i)+(0,L.__)(" code here…","blockify"),value:a(t,'"',"'"),onValueChange:e=>{n(a(e,'"',"'"))},padding:10,style:{fontSize:12,fontFamily:"ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",height:r.toString()+"em",maxHeight:"100%",borderRadius:"2px",color:"#c3cee3",background:"#263238"}})),Y=t=>{const[n,r]=(0,W.useState)(!1),{title:o,description:i}=t;return(0,e.createElement)("div",{className:"blockify-code-editor-modal",style:{width:"100%",display:"flex",flexWrap:"wrap",flexDirection:"column",alignItems:"flex-start"}},(0,e.createElement)(z,null,null!=o?o:""),(0,e.createElement)(H,null,null!=i?i:""),(0,e.createElement)(D.Button,{isSecondary:!0,onClick:()=>r(!0)},o),n&&(0,e.createElement)(D.Modal,{title:null!=o?o:"",onRequestClose:()=>r(!1),style:{width:"80%"}},(0,e.createElement)(q,{...t})))},X=()=>(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 120 120",xmlSpace:"preserve"},(0,e.createElement)(V.Path,{d:"M15 0h35v120H15zm55 0h35v120H70z"})),K=()=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",fill:"currentColor",width:"1em",height:"1em"},(0,e.createElement)("polygon",{points:"10,5 0,10 0,0"})),Z=window.wp.blockEditor,J=t=>{const{attributes:n,setAttributes:r,colorPalette:i}=t,{style:a}=n,{textShadow:l}=a;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,null,["x","y","blur"].map((t=>{var n;return(0,e.createElement)(D.FlexItem,{key:t},(0,e.createElement)(D.__experimentalNumberControl,{label:o(t),value:null!==(n=l?.[null!=t?t:""])&&void 0!==n?n:"",onChange:e=>{r({style:{...a,textShadow:{...l,[t]:e}}})}}))})))),(0,e.createElement)(Z.__experimentalPanelColorGradientSettings,{title:(0,L.__)("Color","blockify"),showTitle:!1,enableAlpha:!0,settings:[{enableAlpha:!0,colorValue:l?.color,label:(0,L.__)("Color","blockify"),onColorChange:e=>{for(const t of i)t.color===e&&(e="var(--wp--preset--color--"+t.slug+")");r({style:{...a,textShadow:{...l,color:e}}})}}]}))},Q=t=>{const{boxShadow:n,setBoxShadow:r,changeColor:i,tab:a}=t;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,null,["x","y","blur","spread"].map((t=>(0,e.createElement)(D.FlexItem,{key:t},(0,e.createElement)(D.__experimentalNumberControl,{label:o(t),value:"default"===a?n[t]:n?.hover?.[t],onChange:e=>{e&&r({[t]:e})}})))),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(Z.__experimentalPanelColorGradientSettings,{title:(0,L.__)("Color","blockify"),showTitle:!1,enableAlpha:!0,settings:[{enableAlpha:!0,colorValue:"default"===a?n?.color:n?.[a]?.color,label:(0,L.__)("Color ","blockify")+("hover"===a?(0,L.__)(" Hover","blockify"):""),onColorChange:i}]})))),(0,e.createElement)("br",null),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,{style:{flex:1.5}},(0,e.createElement)(Z.__experimentalPanelColorGradientSettings,{title:(0,L.__)("Color","blockify"),showTitle:!1,enableAlpha:!0,settings:[{enableAlpha:!0,colorValue:"default"===a?n?.color:n?.[a]?.color,label:(0,L.__)("Color ","blockify")+("hover"===a?(0,L.__)(" Hover","blockify"):""),onColorChange:i}]})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.ToggleControl,{label:(0,L.__)("Inset","blockify"),checked:"default"===a?n?.inset:n?.[a]?.inset,onChange:e=>{r({inset:e?"inset":""})}})))))},ee=(t,n)=>{var r,o;const{attributes:i,setAttributes:a}=t,{style:l}=i,s=null!==(r=l?.boxShadow)&&void 0!==r?r:{},c=(l?.textShadow,null!==(o=(0,I.select)("core/block-editor").getSettings().colors)&&void 0!==o?o:[]),u=e=>{let t;t="default"===n?{...e}:{hover:{...s?.hover,...e}},a({...i,style:{...l,boxShadow:{...s,...t}}})},d=(0,I.select)("core/block-editor")?.getSettings()?.__experimentalFeatures?.shadow?.presets?.theme;return(0,e.createElement)(e.Fragment,null,"text"===n&&(0,e.createElement)(J,{attributes:i,setAttributes:a,colorPalette:c}),"text"!==n&&(0,e.createElement)((()=>{const t="hover"===n?"-hover":"";return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.ButtonGroup,{className:"blockify-shadow-presets"},d.map((r=>{const o="default"===n&&i.shadowPreset===r.slug||"hover"===n&&i.shadowPresetHover===r.slug;return(0,e.createElement)(D.Button,{key:r.slug+t,className:`has-${r.slug}-shadow`+t,isSmall:!0,variant:o?"primary":"secondary",onClick:()=>{a("hover"===n?{shadowPresetHover:"none"===r.slug?"":r.slug}:{shadowPreset:"none"===r.slug?"":r.slug})}},r.name)})))),(0,e.createElement)("br",null),(0,e.createElement)(D.PanelRow,null,"text"!==n&&(0,e.createElement)(D.ToggleControl,{label:(0,L.__)("Custom box shadow","blockify"),checked:i?.useCustomBoxShadow,onChange:e=>{a({useCustomBoxShadow:e})}})))}),null),i?.useCustomBoxShadow&&"text"!==n&&(0,e.createElement)(Q,{boxShadow:s,setBoxShadow:u,changeColor:e=>{for(const t of c)t.color===e&&(e="var(--wp--preset--color--"+t.slug+")");u({color:e})},tab:n}))},te=t=>{const{attributes:n,setAttributes:r}=t,[o,i]=(0,W.useState)("default");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(z,null,(0,e.createElement)(e.Fragment,null,(0,L.__)("Shadow","blockify"),(0,e.createElement)(D.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{r({shadowPreset:"",shadowPresetHover:"",useCustomBoxShadow:!1,style:{...n?.style,boxShadow:"",textShadow:""}})},icon:j,iconSize:16,"aria-label":(0,L.__)("Clear Shadow","blockify")}))),(0,e.createElement)(D.ButtonGroup,null,(0,e.createElement)(D.Button,{isSmall:!0,variant:"default"===o?"primary":"secondary",onClick:()=>i("default")},(0,L.__)("Default","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,variant:"hover"===o?"primary":"secondary",onClick:()=>i("hover")},(0,L.__)("Hover","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,variant:"text"===o?"primary":"secondary",onClick:()=>i("text")},(0,L.__)("Text","blockify")))),"default"===o&&ee(t,o),"hover"===o&&ee(t,o),"text"===o&&ee(t,o))},ne=[{value:"ease",label:(0,L.__)("Ease","blockify")},{value:"ease-in",label:(0,L.__)("Ease In","blockify")},{value:"ease-out",label:(0,L.__)("Ease Out","blockify"),isDefault:!0},{value:"ease-in-out",label:(0,L.__)("Ease In Out","blockify")},{value:"linear",label:(0,L.__)("Linear","blockify")}],re=[{value:"",label:""}];window?.blockify?.animations?.forEach((e=>{re.push({value:e,label:o(e?.replace(/-/g," "))})}));const oe=[{value:"enter",label:(0,L.__)("Enter","blockify"),isDefault:!0},{value:"exit",label:(0,L.__)("Exit","blockify")},{value:"infinite",label:(0,L.__)("Infinite","blockify")},{value:"scroll",label:(0,L.__)("Scroll","blockify")}],ie=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyAnimation)&&void 0!==t&&t};(0,t.addFilter)("blocks.registerBlockType","blockify/add-animation-attributes",((e,t)=>(ie(t)&&(e.attributes={...e.attributes,animation:{type:"object"}}),e)),0);const ae=e=>{const t={};var n,r,o,i,a,l,s;return e?.event&&(t["--animation-event"]=null!==(n=e.event)&&void 0!==n?n:"enter","infinite"===e.event&&(t.animationIterationCount="infinite")),e?.name&&(t.animationName=null!==(r=e.name)&&void 0!==r?r:""),e?.duration&&(t.animationDuration=(null!==(o=e.duration)&&void 0!==o?o:"1")+"s"),e?.delay&&(t.animationDelay=(null!==(i=e.delay)&&void 0!==i?i:"0")+"s"),e?.timingFunction&&(t.animationTimingFunction=null!==(a=e?.timingFunction)&&void 0!==a?a:"ease-in-out"),t?.animationIterationCount||(t.animationIterationCount=null!==(l=e?.iterationCount)&&void 0!==l?l:"1"),e?.playState&&(t.animationPlayState=null!==(s=e?.playState)&&void 0!==s?s:"running"),t};(0,t.addFilter)("editor.BlockListBlock","blockify/with-animation-props",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o}=n,i=null!==(r=o?.animation)&&void 0!==r?r:{};if(!i||!Object?.keys(i)?.length)return(0,e.createElement)(t,{...n});const a=ae(i),l=n?.className?.trim()+" has-animation";n={...n,className:l};const s={...n?.wrapperProps,className:l,style:{...n?.wrapperProps?.style,...a}};return(0,e.createElement)(t,{...n,wrapperProps:s})}),"withAnimation")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/apply-animation-styles",((e,t,n)=>{var r;const o=null!==(r=n?.animation)&&void 0!==r?r:{};if(!o||!Object?.keys(o)?.length)return e;e.className=e?.className?.trim()+" has-animation";const i=ae(o);return{...e,style:{...e?.style,...i}}}));const le=({attributes:t,setAttributes:n})=>{var r,o,i,a,l,s,c,u;const d=null!==(r=t?.animation)&&void 0!==r?r:{};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(z,null,(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",null,(0,L.__)("Animation","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>n({animation:{}}),icon:j,iconSize:16,"aria-label":(0,L.__)("Clear Animation","blockify")}))),(0,e.createElement)(D.Flex,{justify:"flex-end"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.Button,{variant:"secondary",isSmall:!0,icon:"running"===d?.playState?X:K,iconSize:10,onClick:()=>{n({animation:{...d,playState:"running"===d?.playState?"paused":"running"}})}},"running"===d?.playState?(0,L.__)("Pause","blockify"):(0,L.__)("Run","blockify"))))),(0,e.createElement)(D.PanelRow,{className:"blockify-animate-controls"},(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Effect","blockify"),value:null!==(o=d?.name)&&void 0!==o?o:"",options:re,onChange:e=>{var t;n({animation:{...d,name:e,duration:null!==(t=d?.duration)&&void 0!==t?t:1}})}}))),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Easing","blockify"),value:null!==(i=d?.timingFunction)&&void 0!==i?i:"",options:ne,onChange:e=>{n({animation:{...d,timingFunction:e}})}}))),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Event","blockify"),value:null!==(a=d?.event)&&void 0!==a?a:"enter",options:oe,onChange:e=>{n({animation:{...d,event:e,iterationCount:"-1"===("infinite"===e?"-1":d?.iterationCount)?"1":d?.iterationCount}})}})))),(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Duration","blockify"),value:null!==(l=d?.duration)&&void 0!==l?l:1,onChange:e=>{n({animation:{...d,duration:e}})},min:0,max:100,step:.1,shiftStep:10,allowReset:!0})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Delay","blockify"),value:null!==(s=d?.delay)&&void 0!==s?s:0,onChange:e=>{n({animation:{...d,delay:e}})},min:0,max:100,step:.1,shiftStep:10,allowReset:!0})),"infinite"!==d?.event&&(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Repeat","blockify"),value:"infinite"===d?.event?-1:null!==(c=d?.iterationCount)&&void 0!==c?c:1,onChange:e=>{n({animation:{...d,iterationCount:e}})},min:-1,max:100,step:1,allowReset:!0})),"scroll"===d?.event&&(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Offset","blockify"),value:parseInt(null!==(u=d?.offset)&&void 0!==u?u:"50"),onChange:e=>{n({animation:{...d,offset:e.toString()}})},min:-1,max:200,step:1,allowReset:!0})))))};(0,t.addFilter)("editor.BlockEdit","blockify/animation-controls",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o,isSelected:i,name:a}=n;return ie(a)?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),i&&(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{initialOpen:null!==(r=o?.animation)&&void 0!==r&&r,title:(0,L.__)("Animation","blockify")},(0,e.createElement)(le,{...n})))):(0,e.createElement)(t,{...n})}),"withAnimation"));const se=["chevron","plus"];(0,t.addFilter)("blocks.registerBlockType","blockify/details-icon-attributes",((e,t)=>("core/details"===t&&(e={...e,attributes:{...e.attributes,expandIcon:{type:"string"},closeOthers:{type:"boolean"}}}),e))),(0,t.addFilter)("editor.BlockEdit","blockify/with-details-icon-controls",(0,r.createHigherOrderComponent)((t=>n=>{const{attributes:r,setAttributes:i,name:a}=n;return"core/details"!==a?(0,e.createElement)(t,{...n}):(r?.expandIcon||(r.expandIcon="chevron"),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{title:(0,L.__)("Expand Icon","blockify")},(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.ButtonGroup,null,se.map((t=>(0,e.createElement)(D.Button,{key:t,variant:r.expandIcon===t?"primary":"secondary",onClick:()=>i({expandIcon:t})},o(t)))))))),(0,e.createElement)(t,{...n})))}),"withExpandIconControls")),(0,t.addFilter)("editor.BlockListBlock","blockify/with-details-icon",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{name:o,attributes:i}=n;if("core/details"!==o||!i?.expandIcon)return(0,e.createElement)(t,{...n});const a=null!==(r=n.wrapperProps)&&void 0!==r?r:{},l="is-style-"+i.expandIcon;return a.className=w(a?.className,l),(0,e.createElement)(t,{...n,wrapperProps:a})}),"withExpandIcon")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/details-icon-save",(e=>{const{name:t,attributes:n}=e;if("core/details"!==t||!n?.expandIcon)return e;const r="is-style-"+n.expandIcon;return e.className=w(e?.className,r),e}));const ce=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})),ue=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})),de={name:"group-grid",icon:(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",fillRule:"evenodd",clipRule:"evenodd"})),title:(0,L.__)("Grid","blockify"),isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"design",scope:["inserter","transform","block"],description:(0,L.__)("Arrange blocks in a grid.","blockify"),attributes:{layout:{type:"flex",orientation:"grid"},style:{display:{all:"grid"},gridTemplateColumns:{all:"repeat(3,1fr)"},gridTemplateRows:{all:"repeat(3,1fr)"}}},isActive:e=>"grid"===e?.layout?.orientation};(0,b.registerBlockVariation)("core/group",de);const pe=["grid","inline-grid"],me=(t,n,r,o)=>{var i,a,l,s;const{attributes:c,setAttributes:u}=t,{style:d}=c,p=d?.gridTemplateColumns?.[n],m=d?.gridTemplateRows?.[n],f=p?p?.replace(/repeat\((\d+),1fr\)/,"$1"):"",h=m?m?.replace(/repeat\((\d+),1fr\)/,"$1"):"";return(0,e.createElement)(e.Fragment,null,r&&(0,e.createElement)(D.PanelRow,{className:"blockify-grid-controls"},(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Columns","blockify"),value:f,onChange:e=>{u({style:{...d,gridTemplateColumns:{...d?.gridTemplateColumns,[n]:e?"repeat("+e+",1fr)":""}}})},min:1,max:12,step:1})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Rows","blockify"),value:h,onChange:e=>{u({style:{...d,gridTemplateRows:{...d?.gridTemplateRows,[n]:e?"repeat("+e+",1fr)":""}}})},min:1,max:12,step:1})))),o&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,{className:"blockify-grid-controls"},(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Column Start","blockify"),value:null!==(i=d?.gridColumnStart?.[n])&&void 0!==i?i:"",onChange:e=>{u({style:{...d,gridColumnStart:{...d?.gridColumnStart,[n]:e}}})},min:1,max:12,step:1})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Column End","blockify"),value:null!==(a=d?.gridColumnEnd?.[n])&&void 0!==a?a:"",onChange:e=>{u({style:{...d,gridColumnEnd:{...d?.gridColumnEnd,[n]:e}}})},min:1,max:12,step:1})))),(0,e.createElement)(D.PanelRow,{className:"blockify-grid-controls"},(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Row Start","blockify"),value:null!==(l=d?.gridRowStart?.[n])&&void 0!==l?l:"",onChange:e=>{u({style:{...d,gridRowStart:{...d?.gridRowStart,[n]:e}}})},min:1,max:12,step:1})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Row End","blockify"),value:null!==(s=d?.gridRowEnd?.[n])&&void 0!==s?s:"",onChange:e=>{u({style:{...d,gridRowEnd:{...d?.gridRowEnd,[n]:e}}})},min:1,max:12,step:1}))))))},fe=t=>{var n,r;const{attributes:o,setAttributes:i,name:a,clientId:l}=t,[s,c]=(0,W.useState)("all"),{style:u}=o,d="core/group"===a&&(pe.includes(u?.display?.all)||pe.includes(u?.display?.mobile)||pe.includes(u?.display?.desktop)),p=null!==(n=(0,I.select)("core/block-editor")?.getBlockParents(l))&&void 0!==n?n:[],m=p[p.length-1],f=null!==(r=(0,I.select)("core/block-editor")?.getBlockAttributes(m))&&void 0!==r?r:null,h=pe.includes(f?.style?.display?.all)||pe.includes(f?.style?.display?.mobile)||pe.includes(f?.style?.display?.desktop);return d||h?(0,e.createElement)(D.PanelBody,{initialOpen:"grid"===o?.display?.all||"grid"===o?.display?.mobile||"grid"===o?.display?.desktop,title:(0,L.__)("Grid","blockify")},(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(z,null,(0,e.createElement)(e.Fragment,null,(0,L.__)("Grid","blockify"),(0,e.createElement)(D.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{i({style:{...o?.style,gridTemplateColumns:"",gridTemplateRows:"",gridColumnStart:"",gridColumnEnd:"",gridRowStart:"",gridRowEnd:""}})},icon:j,iconSize:16,"aria-label":(0,L.__)("Reset Grid","blockify")}))),(0,e.createElement)(D.ButtonGroup,null,(0,e.createElement)(D.Button,{isSmall:!0,variant:"all"===s?"primary":"secondary",onClick:()=>c("all")},(0,L.__)("All","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,variant:"mobile"===s?"primary":"secondary",onClick:()=>c("mobile"),icon:ce}),(0,e.createElement)(D.Button,{isSmall:!0,variant:"desktop"===s?"primary":"secondary",onClick:()=>c("desktop"),icon:ue}))),"all"===s&&me(t,s,d,h),"mobile"===s&&me(t,s,d,h),"desktop"===s&&me(t,s,d,h)):(0,e.createElement)(e.Fragment,null)};var he;(0,t.addFilter)("editor.BlockEdit","blockify/grid-controls",(0,r.createHigherOrderComponent)((t=>n=>{const{isSelected:r,attributes:o,name:i}=n;if(!be(i))return(0,e.createElement)(t,{...n});const a="grid"===o?.layout?.orientation&&!o?.layout?.verticalAlignment;return(0,e.createElement)(e.Fragment,null,a&&(0,e.createElement)((()=>(0,e.createElement)("style",null,".has-display-grid{align-items:normal !important}")),null),(0,e.createElement)(t,{...n}),r&&(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(fe,{...n})))}),"withDisplay"));const ge=null!==(he=window?.blockify?.blockSupports)&&void 0!==he?he:{},be=e=>{var t;return null!==(t=ge?.[e]?.blockifyPosition)&&void 0!==t&&t},ve=t=>{var n,r,o;const{attributes:i,setAttributes:a,screen:l}=t,{style:s}=i;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,{className:"blockify-display-controls"},(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Display","blockify"),value:null!==(n=s?.display?.[l])&&void 0!==n?n:"",options:null!==(r=window?.blockify?.extensionOptions?.display?.options)&&void 0!==r?r:[],onChange:e=>{a({style:{...s,display:{...s?.display,[l]:e}}}),pe.includes(e)?a({layout:{...i?.layout,type:"flex",flexWrap:"nowrap",orientation:"grid"}}):a({layout:{...i?.layout,orientation:"horizontal"}})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Order","blockify"),value:null!==(o=s?.order?.[l])&&void 0!==o?o:"",onChange:e=>{a({style:{...s,order:{...s?.order,[l]:e}}})},min:-10,max:10,step:1,allowReset:!0}))),(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Width","blockify"),value:s?.width?.[l]?.includes("auto")?"":s?.width?.[l],units:E,onChange:e=>{a({style:{...s,width:{...s?.width,[l]:e?.includes("auto")?"auto":e}}})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Min Width","blockify"),value:s?.minWidth?.[l],onChange:e=>{a({style:{...s,minWidth:{...s?.minWidth,[l]:e}}})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Max Width","blockify"),value:s?.maxWidth?.[l],onChange:e=>{a({style:{...s,maxWidth:{...s?.maxWidth,[l]:e}}})}})))))},ye=t=>{const{attributes:n,setAttributes:r}=t,[o,i]=(0,W.useState)("all");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(z,null,(0,e.createElement)(e.Fragment,null,(0,L.__)("Display","blockify"),(0,e.createElement)(D.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{r({style:{...n?.style,display:void 0,order:void 0,width:void 0,maxWidth:void 0}})},icon:j,iconSize:16,"aria-label":(0,L.__)("Reset Display","blockify")}))),(0,e.createElement)(D.ButtonGroup,null,(0,e.createElement)(D.Button,{isSmall:!0,variant:"all"===o?"primary":"secondary",onClick:()=>i("all")},(0,L.__)("All","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,variant:"mobile"===o?"primary":"secondary",onClick:()=>i("mobile"),icon:ce}),(0,e.createElement)(D.Button,{isSmall:!0,variant:"desktop"===o?"primary":"secondary",onClick:()=>i("desktop"),icon:ue}))),"all"===o&&(0,e.createElement)(ve,{...t,screen:o}),"mobile"===o&&(0,e.createElement)(ve,{...t,screen:o}),"desktop"===o&&(0,e.createElement)(ve,{...t,screen:o}))};var ke;(0,t.addFilter)("editor.BlockEdit","blockify/display-controls",(0,r.createHigherOrderComponent)((t=>n=>{var r,o;const{attributes:i,isSelected:a,name:l}=n;return be(l)?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),a&&(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{initialOpen:null!==(r=(null!==(o=i?.style?.display?.all?.length)&&void 0!==o?o:{})>0)&&void 0!==r&&r,title:(0,L.__)("Display","blockify")},(0,e.createElement)(ye,{...n})))):(0,e.createElement)(t,{...n})}),"withDisplay")),(0,t.addFilter)("blocks.registerBlockType","blockify/content-limit-attributes",((e,t)=>("core/post-excerpt"===t&&(e={...e,attributes:{...e.attributes,defaultExcerpt:{type:"string"},hideReadMore:{type:"boolean"}}}),"core/post-content"===t&&(e={...e,attributes:{...e.attributes,contentLimit:{type:"number"}}}),e))),(0,t.addFilter)("editor.BlockEdit","blockify/with-content-limit-controls",(0,r.createHigherOrderComponent)((t=>n=>{const{attributes:r,setAttributes:o,name:i}=n;return"core/post-excerpt"!==i&&"core/post-content"!==i?(0,e.createElement)(t,{...n}):(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{title:(0,L.__)("Content","blockify")},"core/post-excerpt"===i&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.TextareaControl,{label:(0,L.__)("Default Content","blockify"),value:r.defaultExcerpt,onChange:e=>{o({defaultExcerpt:e})}})),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.ToggleControl,{label:(0,L.__)("Hide Read More Link","blockify"),checked:r.hideReadMore,onChange:e=>{o({hideReadMore:e})}}))),"core/post-content"===i&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Content Limit","blockify"),help:(0,L.__)("Limit content to specific number of words.","blockify"),value:r?.contentLimit,onChange:e=>{o({contentLimit:e})}}))))),(0,e.createElement)(t,{...n}))}),"withContentLimitControls")),(0,t.addFilter)("editor.BlockListBlock","blockify/with-content-limit",(0,r.createHigherOrderComponent)((t=>n=>{var r,o;const{name:i,attributes:a}=n;if("core/post-excerpt"!==i)return(0,e.createElement)(t,{...n});if(!a?.hideReadMore)return(0,e.createElement)(t,{...n});const l=null!==(r=n.wrapperProps)&&void 0!==r?r:{},s="hide-read-more";return l.className=w(l?.className,s),(0,e.createElement)(t,{...n,className:(null!==(o=n?.className)&&void 0!==o?o:"")+" "+s,wrapperProps:l})}),"withContentLimit")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/content-limit-save",(e=>{const{name:t,attributes:n}=e;if("core/post-excerpt"===t&&n?.hideReadMore){const t="hide-read-more";e.className=a(e?.className,t,"")+" "+t}return e}));const we=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyFilter)&&void 0!==t&&t},Ee=null!==(ke=window?.blockify?.filterOptions)&&void 0!==ke?ke:{};(0,t.addFilter)("blocks.registerBlockType","blockify/add-css-transform-attributes",((e,t)=>{var n;return we(t)?(e.attributes={...e.attributes,style:{...null!==(n=e?.attributes?.style)&&void 0!==n?n:{},filter:{type:"string"}}},e):e}));const xe=e=>{let t="";return Ee?.blur?(Object.keys(Ee).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&void 0!==e[n]&&(t+=" "+i(n)+"("+e[n]+Ee?.[n]?.unit+")")})),t?{[e?.backdrop?"backdropFilter":"filter"]:t.trim()}:{}):{}};(0,t.addFilter)("editor.BlockListBlock","blockify/with-css-filter",(0,r.createHigherOrderComponent)((t=>n=>{var r,o;const i=null!==(r=n?.attributes?.style?.filter)&&void 0!==r?r:{},a=(0,e.createElement)(t,{...n});if(0===Object.getOwnPropertyNames(i).length)return a;const l=xe(i);if(!Object.keys(l).length)return a;const s={...(n={...n,style:{...null!==(o=n?.style)&&void 0!==o?o:{},...l}}).wrapperProps,style:{...n.wrapperProps?.style,...l}};return(0,e.createElement)(t,{...n,wrapperProps:s})}),"withCssFilter")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/apply-filter-styles",((e,t,n)=>{var r;const o=null!==(r=n?.style?.filter)&&void 0!==r?r:{};if(0===Object.getOwnPropertyNames(o).length)return e;const i=xe(o);return Object.keys(i).length?{...e,style:{...e?.style,...i}}:e}));const Ce=t=>{const{attributes:n,setAttributes:r}=t,{style:i}=n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(z,null,(0,e.createElement)(e.Fragment,null,(0,L.__)("Filter","blockify"),(0,e.createElement)(D.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{r({style:{...n?.style,filter:{}}})},icon:j,iconSize:16,"aria-label":(0,L.__)("Clear Filters","blockify")}))),(0,e.createElement)(D.PanelRow,{className:"blockify-filter-settings"},Object.keys(Ee).map((t=>{var n,a;return(0,e.createElement)(D.__experimentalNumberControl,{key:t,label:"hueRotate"===t?(0,L.__)("Hue Rotate","blockify"):o(t),value:i?.filter?.[t],onChange:e=>{var n;r({style:{...i,filter:{...null!==(n=i?.filter)&&void 0!==n?n:{},[t]:e}}})},min:null!==(n=Ee?.[t]?.min)&&void 0!==n?n:0,max:Ee?.[t]?.max,step:null!==(a=Ee?.[t]?.step)&&void 0!==a?a:1,allowReset:!0})}))),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.ToggleControl,{label:(0,L.__)("Use as backdrop filter","blockify"),checked:i?.filter?.backdrop,onChange:e=>{r({style:{...i,filter:{...i?.filter,backdrop:e}}})}})))};(0,t.addFilter)("editor.BlockEdit","blockify/filter-controls",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o,isSelected:i,name:a}=n;return we(a)?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),i&&(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{initialOpen:null!==(r=o?.filter)&&void 0!==r&&r,title:(0,L.__)("Filter","blockify")},(0,e.createElement)(Ce,{...n})))):(0,e.createElement)(t,{...n})}),"withFilter"));const Se=e=>["core/image","core/post-featured-image",["blockify/image-compare"]].includes(e);(0,t.addFilter)("blocks.registerBlockType","blockify/image-attributes",((e,t)=>Se(t)?(e.attributes={...e.attributes,usePlaceholder:{type:"string"}},e?.attributes?.style||(e.attributes.style={type:"object"}),e):e));const _e=(t,n)=>{var r;const{attributes:o,setAttributes:i}=t,{style:a}=o,[l,s]=(0,W.useState)(null!==(r=a?.height?.[n])&&void 0!==r?r:"");return(0,e.createElement)(D.PanelRow,{className:"blockify-image-controls blockify-display-controls"},(c=t?.name,["core/image","core/post-featured-image","blockify/image-compare"].includes(c)&&(0,e.createElement)((()=>{var t,r,o,c,u,d;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Aspect Ratio","blockify"),value:null!==(t=a?.aspectRatio?.[n])&&void 0!==t?t:"",options:null!==(r=window?.blockify?.imageOptions?.aspectRatio?.options)&&void 0!==r?r:[],onChange:e=>{i({style:{...a,aspectRatio:{...a?.aspectRatio,[n]:e}}})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Height","blockify"),value:l?.[n]?.includes("auto")?"":l[n],onChange:e=>{s({...l,[n]:e?.includes("auto")?"":e}),i({style:{...a,height:{...a?.height,[n]:e?.includes("auto")?"auto":e}}})},min:0,step:1,units:E,allowReset:!0}))),(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Object Fit","blockify"),value:null!==(o=a?.objectFit?.[n])&&void 0!==o?o:"",placeholder:(0,L.__)("","blockify"),options:null!==(c=window?.blockify?.imageOptions?.objectFit?.options)&&void 0!==c?c:[],onChange:e=>{i({style:{...a,objectFit:{...a?.objectFit,[n]:e}}})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Object Position","blockify"),value:null!==(u=a?.objectPosition?.[n])&&void 0!==u?u:"",placeholder:(0,L.__)("","blockify"),options:null!==(d=window?.blockify?.imageOptions?.objectPosition?.options)&&void 0!==d?d:[],onChange:e=>{i({style:{...a,objectPosition:{...a?.objectPosition,[n]:e}}})}}))))}),null)),(0,e.createElement)(z,{style:{marginTop:"0"}},(0,L.__)("Placeholder Image","blockify")),(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.ButtonGroup,null,(0,e.createElement)(D.Button,{isSmall:!0,variant:o?.usePlaceholder&&"default"!==o?.usePlaceholder?"secondary":"primary",onClick:()=>{i({usePlaceholder:"default"})}},(0,L.__)("Default","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,variant:"none"===o?.usePlaceholder?"primary":"secondary",onClick:()=>{i({usePlaceholder:"none"})}},(0,L.__)("None","blockify")))));var c},Oe=t=>{const{attributes:n,setAttributes:r,name:o}=t;if(!Se(o))return(0,e.createElement)(e.Fragment,null);const[i,a]=(0,W.useState)("all");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(z,null,(0,e.createElement)(e.Fragment,null,(0,L.__)("Image","blockify"),(0,e.createElement)(D.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{r({style:{...n?.style,objectFit:null,objectPosition:null,aspectRatio:null,height:null}})},icon:j,iconSize:16,"aria-label":(0,L.__)("Reset Image","blockify")}))),(0,e.createElement)(D.ButtonGroup,null,(0,e.createElement)(D.Button,{isSmall:!0,variant:"all"===i?"primary":"secondary",onClick:()=>a("all")},(0,L.__)("All","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,variant:"mobile"===i?"primary":"secondary",onClick:()=>a("mobile"),icon:ce}),(0,e.createElement)(D.Button,{isSmall:!0,variant:"desktop"===i?"primary":"secondary",onClick:()=>a("desktop"),icon:ue}))),"all"===i&&_e(t,i),"mobile"===i&&_e(t,i),"desktop"===i&&_e(t,i))};(0,t.addFilter)("editor.BlockEdit","blockify/image-controls",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o,isSelected:i,name:a}=n;return Se(a)?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),i&&(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{initialOpen:null!==(r=o?.image)&&void 0!==r&&r,title:(0,L.__)("Image","blockify")},(0,e.createElement)(Oe,{...n})))):(0,e.createElement)(t,{...n})}),"withImage")),(0,t.addFilter)("editor.BlockListBlock","blockify/image-attribute",(0,r.createHigherOrderComponent)((t=>n=>{var r,o,i,a,l,s,c,u,d,p,m,f,h,g,b,v,y;const{attributes:k,name:w}=n;if(!Se(w))return(0,e.createElement)(t,{...n});const E=null!==(r=n?.className?.split(" "))&&void 0!==r?r:[];E.push("is-placeholder"),E.push("has-placeholder-icon");const x=null!==(o=k?.style?.aspectRatio)&&void 0!==o?o:{},C=null!==(i=null!==(a=null!==(l=x?.all)&&void 0!==l?l:x?.desktop)&&void 0!==a?a:x?.mobile)&&void 0!==i?i:"";var S;C&&(E.forEach((e=>{e.includes("has-aspect-ratio-")&&E.splice(E.indexOf(e),1)})),E.push(`has-aspect-ratio-${C}`),n={...n,className:null!==(S=E?.join(" "))&&void 0!==S?S:""});const _=null!==(s=k?.style?.objectFit)&&void 0!==s?s:{},O=null!==(c=null!==(u=null!==(d=_?.all)&&void 0!==d?d:_?.desktop)&&void 0!==u?u:_?.mobile)&&void 0!==c?c:"";var F;O&&(E.forEach((e=>{e.includes("has-object-fit-")&&E.splice(E.indexOf(e),1)})),E.push(`has-object-fit-${O}`),n={...n,className:null!==(F=E?.join(" "))&&void 0!==F?F:""});const P=null!==(p=k?.style?.objectPosition)&&void 0!==p?p:{},I=null!==(m=null!==(f=null!==(h=P?.all)&&void 0!==h?h:P?.desktop)&&void 0!==f?f:P?.mobile)&&void 0!==m?m:"";var T;I&&(E.forEach((e=>{e.includes("has-object-position-")&&E.splice(E.indexOf(e),1)})),E.push(`has-object-position-${I}`),n={...n,className:null!==(T=E?.join(" "))&&void 0!==T?T:""});const A=null!==(g=k?.style?.height)&&void 0!==g?g:{},N=null!==(b=null!==(v=null!==(y=A?.all)&&void 0!==y?y:A?.desktop)&&void 0!==v?v:A?.mobile)&&void 0!==b?b:"";if(N){var M;const e=null!==(M=n?.style)&&void 0!==M?M:{};e.height=N,n={...n,style:e}}return(0,e.createElement)(t,{...n})}),"withImageAttribute"));const Fe=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyInlineCss)&&void 0!==t&&t};var Pe;(0,t.addFilter)("blocks.registerBlockType","blockify/add-inline-css-attribute",((e,t)=>Fe(t)?(e.attributes={...e.attributes,inlineCss:{type:"string"}},e):e),0),(0,t.addFilter)("editor.BlockEdit","blockify/with-inline-css-attribute",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o,setAttributes:i,name:a}=n;if(!Fe(a))return(0,e.createElement)(t,{...n});const l=(0,I.useSelect)((e=>{const t=e("core")?.getCurrentUser(),n=e("core")?.getUser(t?.id);return n?.roles}),[]);return l?.includes("administrator")?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),(0,e.createElement)(Z.InspectorAdvancedControls,null,(0,e.createElement)(Y,{code:null!==(r=o?.inlineCss)&&void 0!==r?r:"",language:"css",onChange:e=>{i({inlineCss:e})},title:(0,L.__)("Edit Inline CSS","blockify"),description:(0,L.__)("Add custom CSS to this block.","blockify")}))):(0,e.createElement)(t,{...n})}),"inlineCssAttribute"),99);const Ie=null!==(Pe=window?.blockify?.blockSupports)&&void 0!==Pe?Pe:{};(0,t.addFilter)("editor.BlockEdit","blockify/with-negative-margin",(0,r.createHigherOrderComponent)((t=>n=>{if(r=n?.name,null!==(o=Ie?.[r]?.blockifyNegativeMargin)&&void 0!==o&&o){const e=document.querySelector('.components-input-control__input[min="0"]');e&&e.setAttribute("min","-999")}var r,o;return(0,e.createElement)(t,{...n})}),"withMinHeightSettings"));const Te=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyOnclick)&&void 0!==t&&t};var Ae;(0,t.addFilter)("blocks.registerBlockType","blockify/add-onclick-attribute",((e,t)=>Te(t)?(e.attributes={...e.attributes,onclick:{type:"string"}},e):e),0),(0,t.addFilter)("editor.BlockEdit","blockify/with-onclick-attribute",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o,setAttributes:i,name:a}=n;if(!Te(a))return(0,e.createElement)(t,{...n});const l=(0,I.useSelect)((e=>{const t=e("core")?.getCurrentUser(),n=e("core")?.getUser(t?.id);return n?.roles}),[]);return l?.includes("administrator")?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),(0,e.createElement)(Z.InspectorAdvancedControls,null,(0,e.createElement)(Y,{code:null!==(r=o?.onclick)&&void 0!==r?r:"",language:"js",onChange:e=>{i({onclick:e})},title:(0,L.__)("Edit On-Click Event","blockify"),description:(0,L.__)("Add custom JavaScript to the onclick event for this block.","blockify")}))):(0,e.createElement)(t,{...n})}),"onclickAttribute"),99);const Ne=null!==(Ae=window?.blockify?.blockSupports)&&void 0!==Ae?Ae:{},Me=(t,n)=>{var r,o,i,a,l,s,c,u;const{attributes:d,setAttributes:p}=t,m=null!==(r=d?.style)&&void 0!==r?r:{},f=e=>{const t={};Object.keys(e).forEach((r=>{t[r]={...m?.[r],[n]:e[r]}})),p({style:{...m,...t}})};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Position","blockify"),value:null!==(o=m?.position?.[n])&&void 0!==o?o:"",options:window?.blockify?.extensionOptions?.position?.options,onChange:e=>{f({position:e})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:window?.blockify?.extensionOptions?.zIndex?.label,value:m?.zIndex?.[n],onChange:e=>{f({zIndex:e})},min:-100,max:100,step:1,allowReset:!0})))),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Overflow","blockify"),value:null!==(i=m?.overflow?.[n])&&void 0!==i?i:"",options:window?.blockify?.extensionOptions?.overflow?.options,onChange:e=>{f({overflow:e})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Pointer Events","blockify"),value:null!==(a=m?.pointerEvents?.[n])&&void 0!==a?a:"",options:window?.blockify?.extensionOptions?.pointerEvents?.options,onChange:e=>{f({pointerEvents:e})}})))),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.__experimentalBoxControl,{className:"blockify-box-control",label:(0,L.__)("Inset","blockify"),values:{top:null!==(l=m?.top?.[n])&&void 0!==l?l:"",right:null!==(s=m?.right?.[n])&&void 0!==s?s:"",bottom:null!==(c=m?.bottom?.[n])&&void 0!==c?c:"",left:null!==(u=m?.left?.[n])&&void 0!==u?u:""},onChange:e=>{var t,n,r,o;f({top:null!==(t=e?.top)&&void 0!==t?t:"",right:null!==(n=e?.right)&&void 0!==n?n:"",bottom:null!==(r=e?.bottom)&&void 0!==r?r:"",left:null!==(o=e?.left)&&void 0!==o?o:""})},inputProps:{min:-999}})))},Re=t=>{const{attributes:n,setAttributes:r}=t,[o,i]=(0,W.useState)("all");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(z,null,(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",null,(0,L.__)("Position","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{r({style:{...n?.style,position:void 0,zIndex:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0,overflow:void 0}})},icon:j,iconSize:16,"aria-label":(0,L.__)("Reset Position","blockify")}))),(0,e.createElement)(D.ButtonGroup,null,(0,e.createElement)(D.Button,{isSmall:!0,variant:"all"===o?"primary":"tertiary",onClick:()=>i("all")},(0,L.__)("All","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,variant:"mobile"===o?"primary":"tertiary",onClick:()=>i("mobile"),icon:ce}),(0,e.createElement)(D.Button,{isSmall:!0,variant:"desktop"===o?"primary":"tertiary",onClick:()=>i("desktop"),icon:ue}))),"all"===o&&Me(t,o),"mobile"===o&&Me(t,o),"desktop"===o&&Me(t,o))};(0,t.addFilter)("editor.BlockEdit","blockify/position-controls",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o,isSelected:i,name:a}=n;return(e=>{var t;return null!==(t=Ne?.[e]?.blockifyPosition)&&void 0!==t&&t})(a)?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),i&&(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{initialOpen:null!==(r=o?.position)&&void 0!==r&&r,title:(0,L.__)("Position","blockify")},(0,e.createElement)(Re,{...n})))):(0,e.createElement)(t,{...n})}),"withPosition")),(0,t.addFilter)("editor.BlockListBlock","blockify/with-block-gap",(0,r.createHigherOrderComponent)((t=>n=>{var r;if("core/post-template"!==n?.name)return(0,e.createElement)(t,{...n});if(!n?.attributes?.style?.spacing?.blockGap)return(0,e.createElement)(t,{...n});const o=null!==(r=n.wrapperProps)&&void 0!==r?r:{};return o.style={...o.style,"--wp--style--block-gap":k(n.attributes.style.spacing.blockGap)},(0,e.createElement)(t,{...n,wrapperProps:o})}),"withBlockGap")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/apply-block-gap",((e,t,n)=>("core/post-template"===t&&n?.style?.spacing?.blockGap&&(e={...e,style:{...e.style,"--wp--style--block-gap":k(n.style.spacing.blockGap)}}),e))),D.ColorPalette.Color;const Be=e=>{var t,n;const r=(null!==(t=(0,I.select)("core/block-editor")?.getSettings().colors)&&void 0!==t?t:[]).find((t=>t.slug===e));return null!==(n=r?.color)&&void 0!==n?n:""};(0,t.addFilter)("blocks.registerBlockType","blockify/search-input-colors",((e,t)=>("core/search"!==t||(e.attributes={...e.attributes,inputBackgroundColor:{type:"string"}}),e))),(0,t.addFilter)("editor.BlockEdit","blockify/search-input-colors",(0,r.createHigherOrderComponent)((t=>n=>{const r=(0,e.createElement)(t,{...n}),o=(0,Z.__experimentalUseMultipleOriginColorsAndGradients)();if("core/search"!==n.name)return r;const{attributes:i,setAttributes:a,clientId:l}=n,{inputBackgroundColor:s}=i,c=[{label:(0,L.__)("Input Background","blockify"),colorValue:"string"==typeof s&&s?.includes("-")?Be(s):s,onColorChange:e=>{const t=(e=>{var t,n;const r=(null!==(t=(0,I.select)("core/block-editor")?.getSettings().colors)&&void 0!==t?t:[]).find((t=>t.color===e));return null!==(n=r?.slug)&&void 0!==n?n:""})(e);a({inputBackgroundColor:t||e})}}];return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),(0,e.createElement)(Z.InspectorControls,{group:"color"},(0,e.createElement)(Z.__experimentalColorGradientSettingsDropdown,{settings:c,panelId:l,hasColorsOrGradients:!0,disableCustomColors:!1,__experimentalIsRenderedInSidebar:!0,...o})))}),"withSearchInputColors")),(0,t.addFilter)("editor.BlockListBlock","blockify/search-input-colors",(0,r.createHigherOrderComponent)((t=>n=>{const r=(0,e.createElement)(t,{...n});if("core/search"!==n.name)return r;const{attributes:o,wrapperProps:i={}}=n,{inputBackgroundColor:a,borderColor:l}=o;if(a){const e=a?.includes("-")?`var(--wp--preset--color--${a})`:a;i.style={...i.style,"--wp--custom--input--background":e}}if(l){const e=l?.includes("-")?`var(--wp--preset--color--${l})`:l;i.style={...i.style,"--wp--custom--input--border":`var(--wp--custom--border--width,1px) var(--wp--custom--border--style,solid) ${e}`}}return(0,e.createElement)(t,{...n,wrapperProps:i})}),"withSearchInputColors")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/search-input-colors",((e,t,n)=>{if("core/search"!==t.name)return e;const{inputBackgroundColor:r}=n;if(r){const t=r?.includes("-")?`var(--wp--preset--color--${r})`:r;e.style={...e.style,"--wp--custom--input--background":t}}return e}));const De=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyBoxShadow)&&void 0!==t&&t};(0,t.addFilter)("blocks.registerBlockType","blockify/add-box-shadow-attributes",((e,t)=>{var n;return De(t)&&(e.attributes={...e.attributes,shadowPreset:{type:"string"},shadowPresetHover:{type:"string"},useCustomBoxShadow:{type:"boolean"},style:{...null!==(n=e?.attributes?.style)&&void 0!==n?n:{},boxShadow:{type:"object"},textShadow:{type:"object"}}}),e}),0);const Le=e=>{var t,n;const r=null!==(t=e?.style?.boxShadow)&&void 0!==t?t:{},o=null!==(n=e?.style?.textShadow)&&void 0!==n?n:{},i={},a=((0,I.select)("core/block-editor").getSettings().colors,{inset:"",x:"px",y:"px",blur:"px",spread:"px",color:""}),l={x:"px",y:"px",blur:"px",color:""};return Object.keys(a).map((e=>((r?.[e]||"0"===r?.[e]?.toString())&&(i["--wp--custom--box-shadow--"+e]=r?.[e]+a?.[e]),(r?.hover?.[e]||"0"===r?.hover?.[e]?.toString())&&(i["--wp--custom--box-shadow--hover--"+e]=r?.hover?.[e]+a?.[e]),!0))),Object.keys(l).map((e=>{(o?.[e]||"0"===o?.[e]?.toString())&&(i["--wp--custom--text-shadow--"+e]=o?.[e]+l?.[e])})),i};(0,t.addFilter)("editor.BlockListBlock","blockify/edit-box-shadow-styles",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o,name:i}=n;if(!De(i))return(0,e.createElement)(t,{...n});const a=Le(o),l=o?.shadowPreset||o?.shadowPresetHover,s=Object.keys(null!==(r=o?.style?.textShadow)&&void 0!==r?r:{}).length>0;if(!l&&!Object.keys(a).length)return(0,e.createElement)(t,{...n});const c={...n.wrapperProps};let u=n.className;return u=w(u,c.className),u=w(u,"has-box-shadow"),l&&(u=w(u,"has-shadow").replace("has-box-shadow","")),s&&(u=w(u,"has-text-shadow")),o?.shadowPreset&&(u=w(u,`has-${o.shadowPreset}-shadow`)),o?.shadowPresetHover&&(u=w(u,`has-${o.shadowPresetHover}-shadow-hover`)),n={...n,className:w(n?.className,u),style:{...n.style,...a}},c.className=u,c.style={...c.style,...a},(0,e.createElement)(t,{...n,wrapperProps:c})}),"withBoxShadow")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/save-box-shadow-styles",((e,t,n)=>{var r;const{name:o}=t;if(!De(o))return e;const i=Le(n),a=n?.shadowPreset||n?.shadowPresetHover,l=Object.keys(null!==(r=n?.style?.textShadow)&&void 0!==r?r:{}).length>0;if(!a&&!Object.keys(i).length)return e;let s=w(e?.className,"has-box-shadow");return l&&(s=w(s,"has-text-shadow")),a&&(s=w(s,"has-shadow").replace("has-box-shadow","")),n?.shadowPreset&&(s=w(s,`has-${n.shadowPreset}-shadow`)),n?.shadowPresetHover&&(s=w(s,`has-${n.shadowPresetHover}-shadow-hover`)),{...e,style:{...e.style,...i},className:s}}));const Ve=t=>{var n;return(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{initialOpen:null!==(n=t?.attributes?.shadow)&&void 0!==n&&n,title:(0,L.__)("Shadow","blockify")},(0,e.createElement)(te,{...t})))};var je;(0,t.addFilter)("editor.BlockEdit","blockify/shadow-controls",(0,r.createHigherOrderComponent)((t=>n=>{const{isSelected:r,name:o}=n;return De(o)?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),r&&(0,e.createElement)(Ve,{...n})):(0,e.createElement)(t,{...n})}),"withShadow"));const ze=null!==(je=window?.blockify?.blockSupports)&&void 0!==je?je:{},He=e=>{var t;return null!==(t=ze?.[e]?.blockifySize)&&void 0!==t&&t},$e=t=>{const{attributes:n,setAttributes:r}=t,{size:o}=n,i=[{key:"large",label:(0,L.__)("Large","blockify")},{key:"medium",label:(0,L.__)("Medium","blockify")},{key:"small",label:(0,L.__)("Small","blockify")}];return(0,e.createElement)(Z.BlockControls,null,(0,e.createElement)(D.ToolbarGroup,null,(0,e.createElement)(D.DropdownMenu,{icon:(0,e.createElement)("span",null,(0,L.__)("Size","blockify")),label:(0,L.__)("Switch Size","blockify")},(({onClose:t})=>(0,e.createElement)(D.MenuGroup,null,i.map((n=>(0,e.createElement)(D.MenuItem,{key:n.key,icon:o===n.key?"yes":"",onClick:()=>{if(o===n.key)return r({size:""}),void t();r({size:n.key}),t()}},n.label))))))))};(0,t.addFilter)("blocks.registerBlockType","blockify/add-size-attribute",(e=>(e?.attributes&&He(e?.name)&&(e.attributes={...e.attributes,size:{type:"string",default:"20px"}}),e))),(0,t.addFilter)("editor.BlockEdit","blockify/add-size-block-controls",(0,r.createHigherOrderComponent)((t=>n=>{const{name:r,isSelected:o}=n;return He(r)?(0,e.createElement)(W.Fragment,null,o&&(0,e.createElement)($e,{...n}),(0,e.createElement)(t,{...n})):(0,e.createElement)(t,{...n})}),"addSizeBlockControls")),(0,t.addFilter)("editor.BlockListBlock","blockify/with-size",(0,r.createHigherOrderComponent)((t=>n=>{var r,o;const{name:i,attributes:a}=n;if(!He(i))return(0,e.createElement)(t,{...n});if(!a?.size)return(0,e.createElement)(t,{...n});const l=null!==(r=n.wrapperProps)&&void 0!==r?r:{},s="is-style-"+a.size;return l.className=w(l?.className,s),(0,e.createElement)(t,{...n,className:(null!==(o=n?.className)&&void 0!==o?o:"")+" "+s,wrapperProps:l})}),"withSizeClass")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/size-save",(e=>{const{name:t,attributes:n}=e;if(He(t)&&n?.size){const t="is-style-"+n.size;e.className=a(e?.className,t,"")+" "+t}return e}));const Ue=e=>{var t;return null!==(t=window?.blockify?.blockSupports?.[e]?.blockifyTransform)&&void 0!==t&&t},Ge={rotate:"deg",rotateX:"deg",rotateY:"deg",scale:"",scaleX:"",scaleY:"",skew:"deg",skewX:"deg",skewY:"deg",translateX:"",translateY:"",translateZ:""};(0,t.addFilter)("blocks.registerBlockType","blockify/add-css-transform-attributes",((e,t)=>{var n;return Ue(t)?(e.attributes={...e.attributes,style:{...null!==(n=e?.attributes?.style)&&void 0!==n?n:{},transform:{type:"string"},transformHover:{type:"string"}}},e):e}));const We=(e,t)=>{const n={};let r="",o="";return Object.keys(Ge).forEach((n=>{if(e?.[n]){const t=e[n];r+=` ${n}(${t}${Ge[n]})`}if(t?.[n]){const e=t[n];o+=` ${n}(${e}${Ge[n]})`}})),r&&(n["--transform"]=r.trim()),o&&(n["--transform-hover"]=o.trim()),null!=n?n:{}};(0,t.addFilter)("editor.BlockListBlock","blockify/with-css-transform",(0,r.createHigherOrderComponent)((t=>n=>{var r,o;const{attributes:i,name:a}=n,l=(0,e.createElement)(t,{...n});if(!Ue(a))return l;const{style:s}=i,c=null!==(r=s?.transform)&&void 0!==r?r:{},u=null!==(o=s?.transformHover)&&void 0!==o?o:{};if(!c&&!u)return l;const d=We(c,u);if(!Object.keys(d).length)return l;const p={...(n={...n,style:{...n?.style,...d},className:w(n?.className,"has-transform")}).wrapperProps,style:{...n.wrapperProps?.style,...d},className:w(n?.wrapperProps?.className,"has-transform")};return(0,e.createElement)(t,{...n,wrapperProps:p})}),"withCssTransform")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/apply-css-transform-styles",((e,t,n)=>{var r,o;const{name:i}=t;if(!Ue(i))return e;const{style:a}=n,l=null!==(r=a?.transform)&&void 0!==r?r:{},s=null!==(o=a?.transformHover)&&void 0!==o?o:{};if(!l&&!s)return e;const c=We(l,s);return Object.keys(c).length?{...e,style:{...e?.style,...c},className:w(e?.className,"has-transform")}:e}));const qe=t=>{var n,r;const{attributes:o,setAttributes:i}=t,{style:a}=o,l=null!==(n=a?.transform)&&void 0!==n?n:{},s=null!==(r=a?.transformHover)&&void 0!==r?r:{},[c,u]=(0,W.useState)("default"),d="default"===c?l:s,p=e=>{const t="default"===c?"transform":"transformHover";i({style:{...a,[t]:{...d,...e}}})};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(z,null,(0,e.createElement)(e.Fragment,null,(0,L.__)("Transform","blockify"),(0,e.createElement)(D.Button,{isSmall:!0,isDestructive:!0,variant:"tertiary",onClick:()=>{i({style:{...o?.style,transform:"",transformHover:""}})},icon:j,iconSize:16,"aria-label":(0,L.__)("Clear Transforms","blockify")}))),(0,e.createElement)(D.ButtonGroup,null,(0,e.createElement)(D.Button,{isSmall:!0,variant:"default"===c?"primary":"secondary",onClick:()=>u("default")},(0,L.__)("Default","blockify")),(0,e.createElement)(D.Button,{isSmall:!0,variant:"hover"===c?"primary":"secondary",onClick:()=>u("hover")},(0,L.__)("Hover","blockify")))),(0,e.createElement)("br",null),(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Rotate","blockify"),value:d?.rotate,onChange:e=>{p({rotate:e})},min:-360,max:360,step:1})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Rotate X","blockify"),value:d?.rotateX,onChange:e=>{p({rotateX:e})},min:-360,max:360,step:1})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Rotate Y","blockify"),value:d?.rotateY,onChange:e=>{p({rotateY:e})},min:-360,max:360,step:1}))),(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Scale","blockify"),value:d?.scale,onChange:e=>{p({scale:e})},min:0,max:10,step:.01})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Scale X","blockify"),value:d?.scaleX,onChange:e=>{p({scaleX:e})},min:0,max:10,step:.01})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Scale Y","blockify"),value:d?.scaleY,onChange:e=>{p({scaleY:e})},min:0,max:10,step:.01}))),(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Skew","blockify"),value:d?.skew,onChange:e=>{p({skew:e})},min:-360,max:360,step:1})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Skew X","blockify"),value:d?.skewX,onChange:e=>{p({skewX:e})},min:-360,max:360,step:1})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Skew Y","blockify"),value:d?.skewY,onChange:e=>{p({skewY:e})},min:-360,max:360,step:1}))),(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Translate X","blockify"),value:d?.translateX,onChange:e=>{p({translateX:e})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Translate Y","blockify"),value:d?.translateY,onChange:e=>{p({translateY:e})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Translate Z","blockify"),value:d?.translateZ,onChange:e=>{p({translateZ:e})}}))),(0,e.createElement)("br",null))};(0,t.addFilter)("editor.BlockEdit","blockify/transform-controls",(0,r.createHigherOrderComponent)((t=>n=>{var r;const{attributes:o,isSelected:i,name:a}=n;return Ue(a)?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),i&&(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{initialOpen:null!==(r=o?.transform)&&void 0!==r&&r,title:(0,L.__)("Transform","blockify")},(0,e.createElement)(qe,{...n})))):(0,e.createElement)(t,{...n})}),"withTransform"));const Ye=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));(0,b.registerBlockVariation)("core/list",{name:"accordion",title:(0,L.__)("Accordion","blockify"),description:(0,L.__)("Add a collapsible accordion list.","blockify"),category:window?.blockify?.isPlugin?"blockify":"text",scope:[],icon:Ye,attributes:{className:"is-style-accordion"},isDefault:!1,isActive:(e,t)=>e&&e?.className?.includes(t.className)});const Xe=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})),Ke={content:(0,L.__)("Curved text. Curved text. Curved text.","blockify"),containerSize:"160",pathSize:"120"},Ze={name:"curved-text",title:(0,L.__)("Curved Text","blockify"),icon:Xe,isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"text",scope:["inserter"],description:(0,L.__)("Insert curved text around circular SVG path.","blockify"),attributes:{className:"is-style-curved-text"},isActive:e=>e?.className?.includes("is-style-curved-text")};g()((()=>{(0,b.registerBlockVariation)("core/paragraph",Ze)})),(0,t.addFilter)("blocks.registerBlockType","blockify/curved-text-attributes",((e,t)=>("core/paragraph"===t&&(e={...e,attributes:{...e?.attributes,curvedText:{type:"object"}}}),e)));const Je=(t={})=>{var n,r,o;const{curvedText:i=Ke}=t,a=null!==(n=i?.content)&&void 0!==n?n:Ke.content,l=null!==(r=i?.containerSize)&&void 0!==r?r:Ke.containerSize,s=null!==(o=i?.pathSize)&&void 0!==o?o:Ke.pathSize,c=parseInt(l)/2,u=parseInt(s)/2,d={viewBox:`0 0 ${l} ${l}`,xmlns:"http://www.w3.org/2000/svg",enableBackground:`new 0 0 ${l} ${l}`,xmlSpace:"preserve",width:l,height:l,contentEditable:!1,x:0,y:0},p=Date.now()+Math.random(),m={id:"circle-"+p,d:`M ${c}, ${c} m -${u}, 0 a ${u},${u} 0 0,1 ${s},0 a ${u},${u} 0 0,1 -${s},0`,fill:"transparent"};return(0,e.createElement)("svg",{...d},(0,e.createElement)("path",{...m}," "),(0,e.createElement)("text",{fill:"currentColor"},(0,e.createElement)("textPath",{xlinkHref:"#circle-"+p},a)))};(0,t.addFilter)("editor.BlockEdit","blockify/with-curved-text-css",(0,r.createHigherOrderComponent)((t=>n=>{var r,o,i;const{attributes:a,setAttributes:l}=n;if(!(e=>!(!e?.className||"string"!=typeof e?.className)&&e?.className?.includes("is-style-curved-text"))(a))return(0,e.createElement)(t,{...n});const s=document.getElementsByClassName("edit-site-visual-editor__editor-canvas")?.item(0),c=document.getElementsByName("editor-canvas")?.item(0);let u;if(u=s?s.contentDocument:c?c.contentDocument:document,!u)return(0,e.createElement)(t,{...n});const d=u?.getElementById("block-"+n?.clientId);d&&(d.innerHTML=(0,W.renderToString)(Je({...a,clientId:n.clientId})));const{curvedText:p=Ke}=a,m=t=>{var r;const o={...t,svgString:(0,W.renderToString)((0,e.createElement)(Je,{...a,...t,clientId:null!==(r=n.clientId)&&void 0!==r?r:"1"}))};l({curvedText:{...p,...o}})};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{className:"blockify-controls",title:(0,L.__)("Curved Text","blockify")},(0,e.createElement)(D.TextareaControl,{label:(0,L.__)("Content","blockify"),value:null!==(r=p?.content)&&void 0!==r?r:Ke.content,onChange:e=>{m({content:e})}}),(0,e.createElement)("p",null,(0,L.__)("Size","blockify")),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)("br",null),(0,e.createElement)(D.Flex,null,(0,e.createElement)(D.FlexItem,{style:{width:"50%"}},(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Container","blockify"),value:null!==(o=p?.containerSize)&&void 0!==o?o:Ke.containerSize,onChange:e=>{m({containerSize:e})}})),(0,e.createElement)(D.FlexBlock,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Path","blockify"),value:null!==(i=p?.pathSize)&&void 0!==i?i:Ke.pathSize,onChange:e=>{m({pathSize:e})}})))))))}),"withCurvedTextSettings"),1);const Qe=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})),et={start:"0",end:"100",duration:"2",delay:"0",prefix:"",suffix:""},tt={name:"counter",title:(0,L.__)("Counter","blockify"),keywords:["counter","number","count","stats"],icon:Qe,isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"text",scope:["inserter"],description:(0,L.__)("Insert counter animation.","blockify"),attributes:{className:"is-style-counter"},isActive:e=>e&&e?.className?.includes("is-style-counter")};g()((()=>{(0,b.registerBlockVariation)("core/paragraph",tt)})),(0,t.addFilter)("editor.BlockEdit","blockify/with-counter-controls",(0,r.createHigherOrderComponent)((t=>n=>{const{attributes:r,setAttributes:o}=n,i=(0,e.createElement)(t,{...n});if(!r?.className?.includes("is-style-counter"))return i;const{style:a}=r;let l=et;return a?.counter?l=a.counter:o({style:{...a,counter:et}}),(0,W.useEffect)((()=>{if(!l?.prefix&&!l?.end&&!l?.suffix)return;let e=l?.end;"string"==typeof l?.prefix&&(e=l?.prefix+e),"string"==typeof l?.suffix&&(e+=l?.suffix),o({content:e})}),[l?.prefix,l?.end,l?.suffix,o]),(0,e.createElement)(e.Fragment,null,i,(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{title:(0,L.__)("Counter Settings","blockify"),initialOpen:!0,className:"blockify-counter-settings"},(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Start","blockify"),value:l?.start,onChange:e=>{o({style:{...a,counter:{...l,start:e}}})},step:1,shiftStep:10,isDragEnabled:!0,isShiftStepEnabled:!0})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("End","blockify"),value:l?.end,onChange:e=>{o({style:{...a,counter:{...l,end:e}}})},step:1,shiftStep:10,isDragEnabled:!0,isShiftStepEnabled:!0})))),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Duration (seconds)","blockify"),value:l?.duration,onChange:e=>{o({style:{...a,counter:{...l,duration:e}}})},step:.1,shiftStep:1,isDragEnabled:!0,isShiftStepEnabled:!0})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalNumberControl,{label:(0,L.__)("Delay (seconds)","blockify"),value:l?.delay,onChange:e=>{o({style:{...a,counter:{...l,delay:e}}})},step:.1,shiftStep:1,isDragEnabled:!0,isShiftStepEnabled:!0})))),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,{className:"blockify-flex-controls"},(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.TextControl,{label:(0,L.__)("Prefix","blockify"),value:l?.prefix,onChange:e=>{o({style:{...a,counter:{...l,prefix:e}}})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.TextControl,{label:(0,L.__)("Suffix","blockify"),value:l?.suffix,onChange:e=>{o({style:{...a,counter:{...l,suffix:e}}})}})))))))}),"withCounterControls"),9);const nt=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"}));var rt=n(488);rt.domToReact,rt.htmlToDOM,rt.attributesToProps,rt.Comment,rt.Element,rt.ProcessingInstruction,rt.Text;const ot=rt;function it(e){return it="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},it(e)}function at(e){var t=function(e,t){if("object"!==it(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==it(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===it(t)?t:String(t)}function lt(e,t,n){return(t=at(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ct(e){for(var t=1;t0?vt(Ft,--_t):0,Ct--,10===Ot&&(Ct=1,xt--),Ot}function At(){return Ot=_t2||Bt(Ot)>3?"":" "}function zt(e,t){for(;--t&&At()&&!(Ot<48||Ot>102||Ot>57&&Ot<65||Ot>70&&Ot<97););return Rt(e,Mt()+(t<6&&32==Nt()&&32==At()))}function Ht(e){for(;At();)switch(Ot){case e:return _t;case 34:case 39:34!==e&&39!==e&&Ht(Ot);break;case 40:41===e&&Ht(e);break;case 92:At()}return _t}function $t(e,t){for(;At()&&e+Ot!==57&&(e+Ot!==84||47!==Nt()););return"/*"+Rt(t,_t-1)+"*"+mt(47===e?e:At())}function Ut(e){for(;!Bt(Nt());)At();return Rt(e,_t)}var Gt="-ms-",Wt="-moz-",qt="-webkit-",Yt="comm",Xt="rule",Kt="decl",Zt="@keyframes";function Jt(e,t){for(var n="",r=wt(e),o=0;o0&&kt(x)-d&&Et(m>32?on(x+";",r,n,d-1):on(gt(x," ","")+";",r,n,d-2),s);break;case 59:x+=";";default:if(Et(E=nn(x,t,n,c,u,o,l,y,k=[],w=[],d),i),123===v)if(0===u)tn(x,t,E,E,k,i,d,l,w);else switch(99===p&&110===vt(x,3)?100:p){case 100:case 108:case 109:case 115:tn(e,E,E,r&&Et(nn(e,E,E,0,0,o,l,y,o,k=[],d),w),o,w,d,l,r?k:w);break;default:tn(x,E,E,E,[""],w,0,l,w)}}c=u=m=0,h=b=1,y=x="",d=a;break;case 58:d=1+kt(x),m=f;default:if(h<1)if(123==v)--h;else if(125==v&&0==h++&&125==Tt())continue;switch(x+=mt(v),v*h){case 38:b=u>0?1:(x+="\f",-1);break;case 44:l[c++]=(kt(x)-1)*b,b=1;break;case 64:45===Nt()&&(x+=Vt(At())),p=Nt(),u=d=kt(y=x+=Ut(Mt())),v++;break;case 45:45===f&&2==kt(x)&&(h=0)}}return i}function nn(e,t,n,r,o,i,a,l,s,c,u){for(var d=o-1,p=0===o?i:[""],m=wt(p),f=0,h=0,g=0;f0?p[b]+" "+v:gt(v,/&\f/g,p[b])))&&(s[g++]=y);return Pt(e,t,n,0===o?Xt:l,s,c,u)}function rn(e,t,n){return Pt(e,t,n,Yt,mt(Ot),yt(e,2,-2),0)}function on(e,t,n,r){return Pt(e,t,n,Kt,yt(e,0,r),yt(e,r+1,-1),r)}var an=function(e,t,n){for(var r=0,o=0;r=o,o=Nt(),38===r&&12===o&&(t[n]=1),!Bt(o);)At();return Rt(e,_t)},ln=new WeakMap,sn=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ln.get(n))&&!r){ln.set(e,!0);for(var o=[],i=function(e,t){return Lt(function(e,t){var n=-1,r=44;do{switch(Bt(r)){case 0:38===r&&12===Nt()&&(t[n]=1),e[n]+=an(_t-1,t,n);break;case 2:e[n]+=Vt(r);break;case 4:if(44===r){e[++n]=58===Nt()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=mt(r)}}while(r=At());return e}(Dt(e),t))}(t,o),a=n.props,l=0,s=0;l6)switch(vt(e,t+1)){case 109:if(45!==vt(e,t+4))break;case 102:return gt(e,/(.+:)(.+)-([^]+)/,"$1"+qt+"$2-$3$1"+Wt+(108==vt(e,t+3)?"$3":"$2-$3"))+e;case 115:return~bt(e,"stretch")?un(gt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==vt(e,t+1))break;case 6444:switch(vt(e,kt(e)-3-(~bt(e,"!important")&&10))){case 107:return gt(e,":",":"+qt)+e;case 101:return gt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+qt+(45===vt(e,14)?"inline-":"")+"box$3$1"+qt+"$2$3$1"+Gt+"$2box$3")+e}break;case 5936:switch(vt(e,t+11)){case 114:return qt+e+Gt+gt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return qt+e+Gt+gt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return qt+e+Gt+gt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return qt+e+Gt+e+e}return e}var dn=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Kt:e.return=un(e.value,e.length);break;case Zt:return Jt([It(e,{value:gt(e.value,"@","@"+qt)})],r);case Xt:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Jt([It(e,{props:[gt(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Jt([It(e,{props:[gt(t,/:(plac\w+)/,":"+qt+"input-$1")]}),It(e,{props:[gt(t,/:(plac\w+)/,":-moz-$1")]}),It(e,{props:[gt(t,/:(plac\w+)/,Gt+"input-$1")]})],r)}return""}))}}],pn=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,o,i=e.stylisPlugins||dn,a={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+s;return{name:c,styles:o,next:xn}},On=!!e.useInsertionEffect&&e.useInsertionEffect,Fn=On||function(e){return e()},Pn=(On||e.useLayoutEffect,{}.hasOwnProperty),In=e.createContext("undefined"!=typeof HTMLElement?pn({key:"css"}):null);In.Provider;var Tn=function(t){return(0,e.forwardRef)((function(n,r){var o=(0,e.useContext)(In);return t(n,o,r)}))},An=e.createContext({}),Nn="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Mn=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return mn(t,n,r),Fn((function(){return function(e,t,n){mn(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,r)})),null},Rn=Tn((function(t,n,r){var o=t.css;"string"==typeof o&&void 0!==n.registered[o]&&(o=n.registered[o]);var i=t[Nn],a=[o],l="";"string"==typeof t.className?l=function(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}(n.registered,a,t.className):null!=t.className&&(l=t.className+" ");var s=Sn(a,void 0,e.useContext(An));l+=n.key+"-"+s.name;var c={};for(var u in t)Pn.call(t,u)&&"css"!==u&&u!==Nn&&(c[u]=t[u]);return c.ref=r,c.className=l,e.createElement(e.Fragment,null,e.createElement(Mn,{cache:n,serialized:s,isStringTag:"string"==typeof i}),e.createElement(i,c))})),Bn=Rn,Dn=(n(679),function(t,n){var r=arguments;if(null==n||!Pn.call(n,"css"))return e.createElement.apply(void 0,r);var o=r.length,i=new Array(o);i[0]=Bn,i[1]=function(e,t){var n={};for(var r in t)Pn.call(t,r)&&(n[r]=t[r]);return n[Nn]=e,n}(t,n);for(var a=2;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const $n=window.ReactDOM,Un=Math.min,Gn=Math.max,Wn=Math.round,qn=Math.floor,Yn=e=>({x:e,y:e});function Xn(e){return Jn(e)?(e.nodeName||"").toLowerCase():"#document"}function Kn(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Zn(e){var t;return null==(t=(Jn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Jn(e){return e instanceof Node||e instanceof Kn(e).Node}function Qn(e){return e instanceof Element||e instanceof Kn(e).Element}function er(e){return e instanceof HTMLElement||e instanceof Kn(e).HTMLElement}function tr(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Kn(e).ShadowRoot)}function nr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function rr(e){return Kn(e).getComputedStyle(e)}function or(e){const t=function(e){if("html"===Xn(e))return e;const t=e.assignedSlot||e.parentNode||tr(e)&&e.host||Zn(e);return tr(t)?t.host:t}(e);return function(e){return["html","body","#document"].includes(Xn(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:er(t)&&nr(t)?t:or(t)}function ir(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=or(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Kn(o);return i?t.concat(a,a.visualViewport||[],nr(o)?o:[],a.frameElement&&n?ir(a.frameElement):[]):t.concat(o,ir(o,[],n))}function ar(e){return Qn(e)?e:e.contextElement}function lr(e){const t=ar(e);if(!er(t))return Yn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=function(e){const t=rr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=er(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=Wn(n)!==i||Wn(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}(t);let a=(i?Wn(n.width):n.width)/r,l=(i?Wn(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const sr=Yn(0);function cr(e){const t=Kn(e);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:sr}function ur(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ar(e);let a=Yn(1);t&&(r?Qn(r)&&(a=lr(r)):a=lr(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Kn(e))&&t}(i,n,r)?cr(i):Yn(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=Kn(i),t=r&&Qn(r)?Kn(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=lr(n),t=n.getBoundingClientRect(),r=rr(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=o,c+=i,n=Kn(n).frameElement}}return p={width:u,height:d,x:s,y:c},{...p,top:p.y,left:p.x,right:p.x+p.width,bottom:p.y+p.height};var p}const dr=e.useLayoutEffect;var pr=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],mr=function(){};function fr(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function hr(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o-1}function kr(e){return yr(e)?window.pageYOffset:e.scrollTop}function wr(e,t){yr(e)?window.scrollTo(0,t):e.scrollTop=t}function Er(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:mr,o=kr(e),i=t-o,a=0;!function t(){var l,s=i*((l=(l=a+=10)/n-1)*l*l+1)+o;wr(e,s),an.bottom?wr(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o=f)return{placement:"bottom",maxHeight:t};if(C>=f&&!a)return i&&Er(s,S,O),{placement:"bottom",maxHeight:t};if(!a&&C>=r||a&&E>=r)return i&&Er(s,S,O),{placement:"bottom",maxHeight:a?E-y:C-y};if("auto"===o||a){var F=t,P=a?w:x;return P>=r&&(F=Math.min(P-y-l,t)),{placement:"top",maxHeight:F}}if("bottom"===o)return i&&wr(s,S),{placement:"bottom",maxHeight:t};break;case"top":if(w>=f)return{placement:"top",maxHeight:t};if(x>=f&&!a)return i&&Er(s,_,O),{placement:"top",maxHeight:t};if(!a&&x>=r||a&&w>=r){var I=t;return(!a&&x>=r||a&&w>=r)&&(I=a?w-k:x-k),i&&Er(s,_,O),{placement:"top",maxHeight:I}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}({maxHeight:o,menuEl:e,minHeight:r,placement:i,shouldScroll:l&&!t,isFixedPosition:t,controlHeight:b});m(n.maxHeight),g(n.placement),null==c||c(n.placement)}}),[o,i,a,l,r,c,b]),n({ref:u,placerProps:ct(ct({},t),{},{placement:h||Br(i),maxHeight:p})})},Vr=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return ct({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},jr=Vr,zr=Vr,Hr=["size"],$r=["innerProps","isRtl","size"],Ur={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Gr=function(e){var t=e.size,n=Hn(e,Hr);return Dn("svg",ut({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Ur},n))},Wr=function(e){return Dn(Gr,ut({size:20},e),Dn("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},qr=function(e){return Dn(Gr,ut({size:20},e),Dn("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Yr=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return ct({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*o,":hover":{color:n?i.neutral80:i.neutral40}})},Xr=Yr,Kr=Yr,Zr=function(){var e=Ln.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(Nr||(Mr=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],Rr||(Rr=Mr.slice(0)),Nr=Object.freeze(Object.defineProperties(Mr,{raw:{value:Object.freeze(Rr)}})))),Jr=function(e){var t=e.delay,n=e.offset;return Dn("span",{css:Ln({animation:"".concat(Zr," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Qr=["data"],eo=["innerRef","isDisabled","isHidden","inputClassName"],to={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},no={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ct({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},to)},ro=function(e){return ct({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},to)},oo=function(e){var t=e.children,n=e.innerProps;return Dn("div",n,t)},io={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Dn("div",ut({},vr(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Dn(Wr,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Dn("div",ut({ref:o},vr(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Dn("div",ut({},vr(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Dn(qr,null))},DownChevron:qr,CrossIcon:Wr,Group:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return Dn("div",ut({},vr(e,"group",{group:!0}),l),Dn(i,ut({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),Dn("div",null,t))},GroupHeading:function(e){var t=br(e);t.data;var n=Hn(t,Qr);return Dn("div",ut({},vr(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Dn("div",ut({},vr(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Dn("span",ut({},t,vr(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=br(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=Hn(r,eo);return Dn("div",ut({},vr(e,"input",{"input-container":!0}),{"data-value":n||""}),Dn("input",ut({className:t({input:!0},l),ref:o,style:ro(a),disabled:i},s)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=void 0===r?4:r,i=Hn(e,$r);return Dn("div",ut({},vr(ct(ct({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Dn(Jr,{delay:0,offset:n}),Dn(Jr,{delay:160,offset:!0}),Dn(Jr,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return Dn("div",ut({},vr(e,"menu",{menu:!0}),{ref:n},r),t)},MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return Dn("div",ut({},vr(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},MenuPortal:function(t){var n=t.appendTo,r=t.children,o=t.controlElement,i=t.innerProps,a=t.menuPlacement,l=t.menuPosition,s=(0,e.useRef)(null),c=(0,e.useRef)(null),u=zn((0,e.useState)(Br(a)),2),d=u[0],p=u[1],m=(0,e.useMemo)((function(){return{setPortalPlacement:p}}),[]),f=zn((0,e.useState)(null),2),h=f[0],g=f[1],b=(0,e.useCallback)((function(){if(o){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(o),t="fixed"===l?0:window.pageYOffset,n=e[d]+t;n===(null==h?void 0:h.offset)&&e.left===(null==h?void 0:h.rect.left)&&e.width===(null==h?void 0:h.rect.width)||g({offset:n,rect:e})}}),[o,l,d,null==h?void 0:h.offset,null==h?void 0:h.rect.left,null==h?void 0:h.rect.width]);dr((function(){b()}),[b]);var v=(0,e.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),o&&s.current&&(c.current=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=ar(e),u=o||i?[...c?ir(c):[],...ir(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&l?function(e,t){let n,r=null;const o=Zn(e);function i(){clearTimeout(n),r&&r.disconnect(),r=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(l||t(),!d||!p)return;const m={rootMargin:-qn(u)+"px "+-qn(o.clientWidth-(c+d))+"px "+-qn(o.clientHeight-(u+p))+"px "+-qn(c)+"px",threshold:Gn(0,Un(1,s))||1};let f=!0;function h(e){const t=e[0].intersectionRatio;if(t!==s){if(!f)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),100)}f=!1}try{r=new IntersectionObserver(h,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),i}(c,n):null;let p,m=-1,f=null;a&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{f&&f.observe(t)}))),n()})),c&&!s&&f.observe(c),f.observe(t));let h=s?ur(e):null;return s&&function t(){const r=ur(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n(),h=r,p=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),d&&d(),f&&f.disconnect(),f=null,s&&cancelAnimationFrame(p)}}(o,s.current,b,{elementResize:"ResizeObserver"in window}))}),[o,b]);dr((function(){v()}),[v]);var y=(0,e.useCallback)((function(e){s.current=e,v()}),[v]);if(!n&&"fixed"!==l||!h)return null;var k=Dn("div",ut({ref:y},vr(ct(ct({},t),{},{offset:h.offset,position:l,rect:h.rect}),"menuPortal",{"menu-portal":!0}),i),r);return Dn(Dr.Provider,{value:m},n?(0,$n.createPortal)(k,n):k)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,o=Hn(e,Ar);return Dn("div",ut({},vr(ct(ct({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,r=e.innerProps,o=Hn(e,Tr);return Dn("div",ut({},vr(ct(ct({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},MultiValue:function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return Dn(s,{data:r,innerProps:ct(ct({},vr(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},Dn(c,{data:r,innerProps:ct({},vr(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),Dn(u,{data:r,innerProps:ct(ct({},vr(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},MultiValueContainer:oo,MultiValueLabel:oo,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Dn("div",ut({role:"button"},n),t||Dn(Wr,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return Dn("div",ut({},vr(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Dn("div",ut({},vr(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return Dn("div",ut({},vr(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return Dn("div",ut({},vr(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return Dn("div",ut({},vr(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},ao=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function lo(e,t){for(var n=0;n1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(r,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=void 0===o?"":o,a=e.selectValue,l=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if("menu"===t&&c){var d=l?" disabled":"",p="".concat(s?" selected":"").concat(d);return"".concat(i).concat(p,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},vo=function(t){var n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.focusableOptions,a=t.isFocused,l=t.selectValue,s=t.selectProps,c=t.id,u=t.isAppleDevice,d=s.ariaLiveMessages,p=s.getOptionLabel,m=s.inputValue,f=s.isMulti,h=s.isOptionDisabled,g=s.isSearchable,b=s.menuIsOpen,v=s.options,y=s.screenReaderStatus,k=s.tabSelectsValue,w=s.isLoading,E=s["aria-label"],x=s["aria-live"],C=(0,e.useMemo)((function(){return ct(ct({},bo),d||{})}),[d]),S=(0,e.useMemo)((function(){var e,t="";if(n&&C.onChange){var r=n.option,o=n.options,i=n.removedValue,a=n.removedValues,s=n.value,c=i||r||(e=s,Array.isArray(e)?null:e),u=c?p(c):"",d=o||a||void 0,m=d?d.map(p):[],f=ct({isDisabled:c&&h(c,l),label:u,labels:m},n);t=C.onChange(f)}return t}),[n,C,h,l,p]),_=(0,e.useMemo)((function(){var e="",t=r||o,n=!!(r&&l&&l.includes(r));if(t&&C.onFocus){var a={focused:t,label:p(t),isDisabled:h(t,l),isSelected:n,options:i,context:t===r?"menu":"value",selectValue:l,isAppleDevice:u};e=C.onFocus(a)}return e}),[r,o,p,h,C,i,l,u]),O=(0,e.useMemo)((function(){var e="";if(b&&v.length&&!w&&C.onFilter){var t=y({count:i.length});e=C.onFilter({inputValue:m,resultsMessage:t})}return e}),[i,m,b,C,v,y,w]),F="initial-input-focus"===(null==n?void 0:n.action),P=(0,e.useMemo)((function(){var e="";if(C.guidance){var t=o?"value":b?"menu":"input";e=C.guidance({"aria-label":E,context:t,isDisabled:r&&h(r,l),isMulti:f,isSearchable:g,tabSelectsValue:k,isInitialFocus:F})}return e}),[E,r,o,f,h,g,b,C,l,k,F]),I=Dn(e.Fragment,null,Dn("span",{id:"aria-selection"},S),Dn("span",{id:"aria-focused"},_),Dn("span",{id:"aria-results"},O),Dn("span",{id:"aria-guidance"},P));return Dn(e.Fragment,null,Dn(go,{id:c},F&&I),Dn(go,{"aria-live":x,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!F&&I))},yo=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],ko=new RegExp("["+yo.map((function(e){return e.letters})).join("")+"]","g"),wo={},Eo=0;Eo1?t-1:0),r=1;r0,h=d-p-c,g=!1;h>t&&l.current&&(o&&o(e),l.current=!1),f&&s.current&&(a&&a(e),s.current=!1),f&&t>h?(r&&!l.current&&r(e),m.scrollTop=d,g=!0,l.current=!0):!f&&-t>c&&(i&&!s.current&&i(e),m.scrollTop=0,g=!0,s.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}}),[r,o,i,a]),p=(0,e.useCallback)((function(e){d(e,e.deltaY)}),[d]),m=(0,e.useCallback)((function(e){c.current=e.changedTouches[0].clientY}),[]),f=(0,e.useCallback)((function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)}),[d]),h=(0,e.useCallback)((function(e){if(e){var t=!!Fr&&{passive:!1};e.addEventListener("wheel",p,t),e.addEventListener("touchstart",m,t),e.addEventListener("touchmove",f,t)}}),[f,m,p]),g=(0,e.useCallback)((function(e){e&&(e.removeEventListener("wheel",p,!1),e.removeEventListener("touchstart",m,!1),e.removeEventListener("touchmove",f,!1))}),[f,m,p]);return(0,e.useEffect)((function(){if(n){var e=u.current;return h(e),function(){g(e)}}}),[n,h,g]),function(e){u.current=e}}({isEnabled:void 0===o||o,onBottomArrive:t.onBottomArrive,onBottomLeave:t.onBottomLeave,onTopArrive:t.onTopArrive,onTopLeave:t.onTopLeave}),a=function(t){var n=t.isEnabled,r=t.accountForScrollbars,o=void 0===r||r,i=(0,e.useRef)({}),a=(0,e.useRef)(null),l=(0,e.useCallback)((function(e){if(Do){var t=document.body,n=t&&t.style;if(o&&To.forEach((function(e){var t=n&&n[e];i.current[e]=t})),o&&Lo<1){var r=parseInt(i.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,l=window.innerWidth-a+r||0;Object.keys(Ao).forEach((function(e){var t=Ao[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(l,"px"))}t&&Bo()&&(t.addEventListener("touchmove",No,Vo),e&&(e.addEventListener("touchstart",Ro,Vo),e.addEventListener("touchmove",Mo,Vo))),Lo+=1}}),[o]),s=(0,e.useCallback)((function(e){if(Do){var t=document.body,n=t&&t.style;Lo=Math.max(Lo-1,0),o&&Lo<1&&To.forEach((function(e){var t=i.current[e];n&&(n[e]=t)})),t&&Bo()&&(t.removeEventListener("touchmove",No,Vo),e&&(e.removeEventListener("touchstart",Ro,Vo),e.removeEventListener("touchmove",Mo,Vo)))}}),[o]);return(0,e.useEffect)((function(){if(n){var e=a.current;return l(e),function(){s(e)}}}),[n,l,s]),function(e){a.current=e}}({isEnabled:r});return Dn(e.Fragment,null,r&&Dn("div",{onClick:jo,css:zo}),n((function(e){i(e),a(e)})))}var $o={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Uo=function(e){var t=e.name,n=e.onFocus;return Dn("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:$o,value:"",onChange:function(){}})};function Go(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function Wo(){return Go(/^Mac/i)}var qo={clearIndicator:Kr,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius;return ct({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},dropdownIndicator:Xr,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return ct({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return ct({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return ct(ct({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},no),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return ct({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*a})},loadingMessage:zr,menu:function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return ct((lt(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),lt(n,"position","absolute"),lt(n,"width","100%"),lt(n,"zIndex",1),n),t?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return ct({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return ct({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return ct({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return ct({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:jr,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return ct({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?l.primary:l.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return ct({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return ct({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return ct({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},Yo={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Xo={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Cr(),captureMenuScroll:!Cr(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=ct({ignoreCase:!0,ignoreAccents:!0,stringify:Fo,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,l=n.matchFrom,s=a?Oo(t):t,c=a?Oo(i(e)):i(e);return r&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=_o(s),c=So(c)),"start"===l?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Ko(e,t,n,r){return{type:"option",data:t,isDisabled:oi(e,t,n),isSelected:ii(e,t,n),label:ni(e,t),value:ri(e,t),index:r}}function Zo(e,t){return e.options.map((function(n,r){if("options"in n){var o=n.options.map((function(n,r){return Ko(e,n,t,r)})).filter((function(t){return ei(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Ko(e,n,t,r);return ei(e,i)?i:void 0})).filter(Pr)}function Jo(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,po(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function Qo(e,t){return e.reduce((function(e,n){return"group"===n.type?e.push.apply(e,po(n.options.map((function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}})))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e}),[])}function ei(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!li(e)||!i)&&ai(e,{label:a,value:l,data:o},r)}var ti=function(e,t){var n;return(null===(n=e.find((function(e){return e.data===t})))||void 0===n?void 0:n.id)||null},ni=function(e,t){return e.getOptionLabel(t)},ri=function(e,t){return e.getOptionValue(t)};function oi(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function ii(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=ri(e,t);return n.some((function(t){return ri(e,t)===r}))}function ai(e,t,n){return!e.filterOption||e.filterOption(t,n)}var li=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},si=1,ci=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&so(e,t)}(a,t);var n,r,o,i=uo(a);function a(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.isAppleDevice=Wo()||Go(/^iPhone/i)||Go(/^iPad/i)||Wo()&&navigator.maxTouchPoints>1,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,n){var r=t.props,o=r.onChange,i=r.name;n.name=i,t.ariaOnChange(e,n),o(e,n)},t.setValue=function(e,n,r){var o=t.props,i=o.closeMenuOnSelect,a=o.isMulti,l=o.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:l}),i&&(t.setState({inputIsHiddenAfterUpdate:!a}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:n,option:r})},t.selectOption=function(e){var n=t.props,r=n.blurInputOnSelect,o=n.isMulti,i=n.name,a=t.state.selectValue,l=o&&t.isOptionSelected(e,a),s=t.isOptionDisabled(e,a);if(l){var c=t.getOptionValue(e);t.setValue(a.filter((function(e){return t.getOptionValue(e)!==c})),"deselect-option",e)}else{if(s)return void t.ariaOnChange(e,{action:"select-option",option:e,name:i});o?t.setValue([].concat(po(a),[e]),"select-option",e):t.setValue(e,"select-option")}r&&t.blurInput()},t.removeValue=function(e){var n=t.props.isMulti,r=t.state.selectValue,o=t.getOptionValue(e),i=r.filter((function(e){return t.getOptionValue(e)!==o})),a=Ir(n,i,i[0]||null);t.onChange(a,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e=t.state.selectValue;t.onChange(Ir(t.props.isMulti,[],null),{action:"clear",removedValues:e})},t.popValue=function(){var e=t.props.isMulti,n=t.state.selectValue,r=n[n.length-1],o=n.slice(0,n.length-1),i=Ir(e,o,o[0]||null);t.onChange(i,{action:"pop-value",removedValue:r})},t.getFocusedOptionId=function(e){return ti(t.state.focusableOptionsWithIds,e)},t.getFocusableOptionsWithIds=function(){return Qo(Zo(t.props,t.state.selectValue),t.getElementId("option"))},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,n=new Array(e),r=0;r5||i>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var n=t.props.inputValue,r=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(r,{action:"input-change",prevInputValue:n}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var n=t.props.inputValue;t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:n}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){if(!t.blockOptionHover&&t.state.focusedOption!==e){var n=t.getFocusableOptions().indexOf(e);t.setState({focusedOption:e,focusedOptionId:n>-1?t.getFocusedOptionId(e):null})}},t.shouldHideSelectedOptions=function(){return li(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var n=t.props,r=n.isMulti,o=n.backspaceRemovesValue,i=n.escapeClearsValue,a=n.inputValue,l=n.isClearable,s=n.isDisabled,c=n.menuIsOpen,u=n.onKeyDown,d=n.tabSelectsValue,p=n.openMenuOnFocus,m=t.state,f=m.focusedOption,h=m.focusedValue,g=m.selectValue;if(!(s||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||a)return;t.focusValue("previous");break;case"ArrowRight":if(!r||a)return;t.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(h)t.removeValue(h);else{if(!o)return;r?t.popValue():l&&t.clearValue()}break;case"Tab":if(t.isComposing)return;if(e.shiftKey||!c||!d||!f||p&&t.isOptionSelected(f,g))return;t.selectOption(f);break;case"Enter":if(229===e.keyCode)break;if(c){if(!f)return;if(t.isComposing)return;t.selectOption(f);break}return;case"Escape":c?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:a}),t.onMenuClose()):l&&i&&t.clearValue();break;case" ":if(a)return;if(!c){t.openMenu("first");break}if(!f)return;t.selectOption(f);break;case"ArrowUp":c?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":c?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!c)return;t.focusOption("pageup");break;case"PageDown":if(!c)return;t.focusOption("pagedown");break;case"Home":if(!c)return;t.focusOption("first");break;case"End":if(!c)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.state.instancePrefix="react-select-"+(t.props.instanceId||++si),t.state.selectValue=gr(e.value),e.menuIsOpen&&t.state.selectValue.length){var n=t.getFocusableOptionsWithIds(),r=t.buildFocusableOptions(),o=r.indexOf(t.state.selectValue[0]);t.state.focusableOptionsWithIds=n,t.state.focusedOption=r[o],t.state.focusedOptionId=ti(n,r[o])}return t}return n=a,r=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&xr(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&r&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(xr(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,o=n.isFocused,i=this.buildFocusableOptions(),a="first"===e?0:i.length-1;if(!this.props.isMulti){var l=i.indexOf(r[0]);l>-1&&(a=l)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a],focusedOptionId:this.getFocusedOptionId(i[a])},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[o])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Yo):ct(ct({},Yo),this.props.theme):Yo}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,o=this.getValue,i=this.selectOption,a=this.setValue,l=this.props,s=l.isMulti,c=l.isRtl,u=l.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:o,hasValue:this.hasValue(),isMulti:s,isRtl:c,options:u,selectOption:i,selectProps:l,setValue:a,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return oi(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return ii(this.props,e,t)}},{key:"filterOption",value:function(e,t){return ai(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var t=this.props,n=t.isDisabled,r=t.isSearchable,o=t.inputId,i=t.inputValue,a=t.tabIndex,l=t.form,s=t.menuIsOpen,c=t.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,m=d.ariaSelection,f=this.commonProps,h=o||this.getElementId("input"),g=ct(ct(ct({"aria-autocomplete":"list","aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},s&&{"aria-controls":this.getElementId("listbox")}),!r&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==m?void 0:m.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return r?e.createElement(u,ut({},f,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:h,innerRef:this.getInputRef,isDisabled:n,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:l,type:"text",value:i},g)):e.createElement(Io,ut({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:mr,onFocus:this.onInputFocus,disabled:n,tabIndex:a,inputMode:"none",form:l,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var t=this,n=this.getComponents(),r=n.MultiValue,o=n.MultiValueContainer,i=n.MultiValueLabel,a=n.MultiValueRemove,l=n.SingleValue,s=n.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,m=u.isMulti,f=u.inputValue,h=u.placeholder,g=this.state,b=g.selectValue,v=g.focusedValue,y=g.isFocused;if(!this.hasValue()||!d)return f?null:e.createElement(s,ut({},c,{key:"placeholder",isDisabled:p,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),h);if(m)return b.map((function(n,l){var s=n===v,u="".concat(t.getOptionLabel(n),"-").concat(t.getOptionValue(n));return e.createElement(r,ut({},c,{components:{Container:o,Label:i,Remove:a},isFocused:s,isDisabled:p,key:u,index:l,removeProps:{onClick:function(){return t.removeValue(n)},onTouchEnd:function(){return t.removeValue(n)},onMouseDown:function(e){e.preventDefault()}},data:n}),t.formatOptionLabel(n,"value"))}));if(f)return null;var k=b[0];return e.createElement(l,ut({},c,{data:k,isDisabled:p}),this.formatOptionLabel(k,"value"))}},{key:"renderClearIndicator",value:function(){var t=this.getComponents().ClearIndicator,n=this.commonProps,r=this.props,o=r.isDisabled,i=r.isLoading,a=this.state.isFocused;if(!this.isClearable()||!t||o||!this.hasValue()||i)return null;var l={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return e.createElement(t,ut({},n,{innerProps:l,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var t=this.getComponents().LoadingIndicator,n=this.commonProps,r=this.props,o=r.isDisabled,i=r.isLoading,a=this.state.isFocused;return t&&i?e.createElement(t,ut({},n,{innerProps:{"aria-hidden":"true"},isDisabled:o,isFocused:a})):null}},{key:"renderIndicatorSeparator",value:function(){var t=this.getComponents(),n=t.DropdownIndicator,r=t.IndicatorSeparator;if(!n||!r)return null;var o=this.commonProps,i=this.props.isDisabled,a=this.state.isFocused;return e.createElement(r,ut({},o,{isDisabled:i,isFocused:a}))}},{key:"renderDropdownIndicator",value:function(){var t=this.getComponents().DropdownIndicator;if(!t)return null;var n=this.commonProps,r=this.props.isDisabled,o=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return e.createElement(t,ut({},n,{innerProps:i,isDisabled:r,isFocused:o}))}},{key:"renderMenu",value:function(){var t=this,n=this.getComponents(),r=n.Group,o=n.GroupHeading,i=n.Menu,a=n.MenuList,l=n.MenuPortal,s=n.LoadingMessage,c=n.NoOptionsMessage,u=n.Option,d=this.commonProps,p=this.state.focusedOption,m=this.props,f=m.captureMenuScroll,h=m.inputValue,g=m.isLoading,b=m.loadingMessage,v=m.minMenuHeight,y=m.maxMenuHeight,k=m.menuIsOpen,w=m.menuPlacement,E=m.menuPosition,x=m.menuPortalTarget,C=m.menuShouldBlockScroll,S=m.menuShouldScrollIntoView,_=m.noOptionsMessage,O=m.onMenuScrollToTop,F=m.onMenuScrollToBottom;if(!k)return null;var P,I=function(n,r){var o=n.type,i=n.data,a=n.isDisabled,l=n.isSelected,s=n.label,c=n.value,m=p===i,f=a?void 0:function(){return t.onOptionHover(i)},h=a?void 0:function(){return t.selectOption(i)},g="".concat(t.getElementId("option"),"-").concat(r),b={id:g,onClick:h,onMouseMove:f,onMouseOver:f,tabIndex:-1,role:"option","aria-selected":t.isAppleDevice?void 0:l};return e.createElement(u,ut({},d,{innerProps:b,data:i,isDisabled:a,isSelected:l,key:g,label:s,type:o,value:c,isFocused:m,innerRef:m?t.getFocusedOptionRef:void 0}),t.formatOptionLabel(n.data,"menu"))};if(this.hasOptions())P=this.getCategorizedOptions().map((function(n){if("group"===n.type){var i=n.data,a=n.options,l=n.index,s="".concat(t.getElementId("group"),"-").concat(l),c="".concat(s,"-heading");return e.createElement(r,ut({},d,{key:s,data:i,options:a,Heading:o,headingProps:{id:c,data:n.data},label:t.formatGroupLabel(n.data)}),n.options.map((function(e){return I(e,"".concat(l,"-").concat(e.index))})))}if("option"===n.type)return I(n,"".concat(n.index))}));else if(g){var T=b({inputValue:h});if(null===T)return null;P=e.createElement(s,d,T)}else{var A=_({inputValue:h});if(null===A)return null;P=e.createElement(c,d,A)}var N={minMenuHeight:v,maxMenuHeight:y,menuPlacement:w,menuPosition:E,menuShouldScrollIntoView:S},M=e.createElement(Lr,ut({},d,N),(function(n){var r=n.ref,o=n.placerProps,l=o.placement,s=o.maxHeight;return e.createElement(i,ut({},d,N,{innerRef:r,innerProps:{onMouseDown:t.onMenuMouseDown,onMouseMove:t.onMenuMouseMove},isLoading:g,placement:l}),e.createElement(Ho,{captureEnabled:f,onTopArrive:O,onBottomArrive:F,lockEnabled:C},(function(n){return e.createElement(a,ut({},d,{innerRef:function(e){t.getMenuListRef(e),n(e)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:t.getElementId("listbox")},isLoading:g,maxHeight:s,focusedOption:p}),P)})))}));return x||"fixed"===E?e.createElement(l,ut({},d,{appendTo:x,controlElement:this.controlRef,menuPlacement:w,menuPosition:E}),M):M}},{key:"renderFormField",value:function(){var t=this,n=this.props,r=n.delimiter,o=n.isDisabled,i=n.isMulti,a=n.name,l=n.required,s=this.state.selectValue;if(l&&!this.hasValue()&&!o)return e.createElement(Uo,{name:a,onFocus:this.onValueInputFocus});if(a&&!o){if(i){if(r){var c=s.map((function(e){return t.getOptionValue(e)})).join(r);return e.createElement("input",{name:a,type:"hidden",value:c})}var u=s.length>0?s.map((function(n,r){return e.createElement("input",{key:"i-".concat(r),name:a,type:"hidden",value:t.getOptionValue(n)})})):e.createElement("input",{name:a,type:"hidden",value:""});return e.createElement("div",null,u)}var d=s[0]?this.getOptionValue(s[0]):"";return e.createElement("input",{name:a,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var t=this.commonProps,n=this.state,r=n.ariaSelection,o=n.focusedOption,i=n.focusedValue,a=n.isFocused,l=n.selectValue,s=this.getFocusableOptions();return e.createElement(vo,ut({},t,{id:this.getElementId("live-region"),ariaSelection:r,focusedOption:o,focusedValue:i,isFocused:a,selectValue:l,focusableOptions:s,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var t=this.getComponents(),n=t.Control,r=t.IndicatorsContainer,o=t.SelectContainer,i=t.ValueContainer,a=this.props,l=a.className,s=a.id,c=a.isDisabled,u=a.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return e.createElement(o,ut({},p,{className:l,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),e.createElement(n,ut({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),e.createElement(i,ut({},p,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),e.createElement(r,ut({},p,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],o=[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,a=t.isFocused,l=t.prevWasFocused,s=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,m=e.isMulti,f=gr(u),h={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var g=d?function(e,t){return Jo(Zo(e,t))}(e,f):[],b=d?Qo(Zo(e,f),"".concat(s,"-option")):[],v=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r-1?n:t[0]}(t,g);h={selectValue:f,focusedOption:y,focusedOptionId:ti(b,y),focusableOptionsWithIds:b,focusedValue:v,clearFocusValueOnUpdate:!1}}var k=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},w=i,E=a&&l;return a&&!E&&(w={value:Ir(m,f,f[0]||null),options:f,action:"initial-input-focus"},E=!l),"initial-input-focus"===(null==i?void 0:i.action)&&(w=null),ct(ct(ct({},h),k),{},{prevProps:e,ariaSelection:w,prevWasFocused:E})}}],r&&lo(n.prototype,r),o&&lo(n,o),Object.defineProperty(n,"prototype",{writable:!1}),a}(e.Component);ci.defaultProps=Xo;var ui=(0,e.forwardRef)((function(t,n){var r=function(t){var n=t.defaultInputValue,r=void 0===n?"":n,o=t.defaultMenuIsOpen,i=void 0!==o&&o,a=t.defaultValue,l=void 0===a?null:a,s=t.inputValue,c=t.menuIsOpen,u=t.onChange,d=t.onInputChange,p=t.onMenuClose,m=t.onMenuOpen,f=t.value,h=Hn(t,ao),g=zn((0,e.useState)(void 0!==s?s:r),2),b=g[0],v=g[1],y=zn((0,e.useState)(void 0!==c?c:i),2),k=y[0],w=y[1],E=zn((0,e.useState)(void 0!==f?f:l),2),x=E[0],C=E[1],S=(0,e.useCallback)((function(e,t){"function"==typeof u&&u(e,t),C(e)}),[u]),_=(0,e.useCallback)((function(e,t){var n;"function"==typeof d&&(n=d(e,t)),v(void 0!==n?n:e)}),[d]),O=(0,e.useCallback)((function(){"function"==typeof m&&m(),w(!0)}),[m]),F=(0,e.useCallback)((function(){"function"==typeof p&&p(),w(!1)}),[p]),P=void 0!==s?s:b,I=void 0!==c?c:k,T=void 0!==f?f:x;return ct(ct({},h),{},{inputValue:P,menuIsOpen:I,onChange:S,onInputChange:_,onMenuClose:F,onMenuOpen:O,value:T})}(t);return e.createElement(ci,ut({ref:n},r))})),di=ui;D.CustomSelectControl.Option;const{Option:pi}=io,mi=e=>["core/image","core/button","blockify/tab"].includes(e),fi={iconSet:{type:"string",default:C.set},iconName:{type:"string",default:C.name},iconColor:{type:"string"},iconGradient:{type:"string"},iconSize:{type:"string"},iconPosition:{type:"string"},iconSvgString:{type:"string",default:C.string}},hi={name:"icon",icon:nt,title:(0,L.__)("Icon","blockify"),isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"media",scope:["inserter"],description:(0,L.__)("Insert a customizable SVG icon.","blockify"),attributes:{className:"is-style-icon",iconSet:C.set,iconName:C.name,iconSvgString:C.string},isActive:e=>e&&e?.className?.includes("is-style-icon")};g()((()=>{(0,b.registerBlockVariation)("core/image",hi)})),(0,t.addFilter)("blocks.registerBlockType","blockify/add-icon-attributes",((e,t)=>{if(mi(t)){for(const[t,n]of Object.entries(fi))e.attributes[t]={type:n.type};"core/button"===t&&(delete fi?.iconSet?.default,delete fi?.iconName?.default),e.attributes={...e.attributes,...fi}}return e}),99);const gi=t=>{var n,r,o,i,a,s,c,u;const{attributes:d,setAttributes:p,isButton:m}=t,f=[{label:(0,L.__)("None","blockify"),value:""}],h=null!==(n=(0,I.useSelect)((e=>e(B)?.getIcons()),[]))&&void 0!==n?n:T,g={wordpress:[{value:fi?.iconName?.default,label:l(null!==(r=fi?.iconName?.default)&&void 0!==r?r:""),icon:ot(null!==(o=fi?.iconSvgString?.default)&&void 0!==o?o:"")}]};return Object.keys(h).forEach((e=>{var t;let n=e.split("-").join(" ");var r,o,i;n="wordpress"===n?"WordPress":n,f.push({label:n,value:e}),g[e]=[],Object.keys(h[e]).forEach((t=>{t!==d?.iconName&&g[e].push({icon:ot(h?.[e]?.[t]),value:t,label:l(null!=t?t:"")})})),h?.[e]?.[null!==(t=d?.iconName)&&void 0!==t?t:""]&&g[e].unshift({icon:ot(h?.[e]?.[null!==(r=d?.iconName)&&void 0!==r?r:""]),value:null!==(o=d?.iconName)&&void 0!==o?o:"",label:l(null!==(i=d?.iconName)&&void 0!==i?i:"")})})),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Select Icon Set","blockify"),value:null!==(i=d?.iconSet)&&void 0!==i?i:fi?.iconSet.default,options:f,onChange:e=>p({iconSet:e})}),(0,e.createElement)(z,{style:{marginTop:0}},(0,L.__)("Select Icon","blockify")),(0,e.createElement)(di,{isMulti:!1,isSearchable:!0,placeholder:(0,L.__)("Select icon","blockify-pro"),options:null!==(a=g?.[null!==(s=d?.iconSet)&&void 0!==s?s:""])&&void 0!==a?a:g?.wordpress,value:{value:d?.iconName,label:l(null!==(c=d?.iconName)&&void 0!==c?c:""),icon:null!==(u=d.iconSvgString)&&void 0!==u?u:""},onChange:e=>{var t,n,r;p({iconName:e?.value,iconSvgString:null!==(t=h?.[null!==(n=d?.iconSet)&&void 0!==n?n:""]?.[null!==(r=e?.value)&&void 0!==r?r:""])&&void 0!==t?t:""})},components:{Option:t=>{var n,r;return(0,e.createElement)(pi,{...t,key:t.data?.value,label:t.data?.label},null!==(n=t.data?.icon)&&void 0!==n?n:"",(0,e.createElement)("span",{className:"screen-reader-text"},null!==(r=t.data?.value)&&void 0!==r?r:""))}},isClearable:!0}),(0,e.createElement)("br",null),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,{align:"top",justify:"space-between",wrap:!1,style:{alignItems:"top",alignContent:"top"}},(0,e.createElement)(D.FlexItem,{style:{flexBasis:"100%"}},(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Icon Width","blockify"),value:d?.iconSize,onChange:e=>{p({iconSize:e})}})),m&&(0,e.createElement)((()=>{const t={height:"30px"};return(0,e.createElement)(D.FlexItem,{style:{flexBasis:"100%"}},(0,e.createElement)(z,{style:{margin:"0 0 5px"}},(0,L.__)("Icon Position","blockify")),(0,e.createElement)(D.ButtonGroup,null,(0,e.createElement)(D.Button,{variant:"start"===d?.iconPosition?"primary":"secondary",onClick:()=>{p({iconPosition:"start"})},style:t},(0,L.__)("Start","blockify")),(0,e.createElement)(D.Button,{variant:"end"===d?.iconPosition?"primary":"secondary",onClick:()=>{p({iconPosition:"end"})},style:t},(0,L.__)("End","blockify"))))}),null))))};(0,t.addFilter)("editor.BlockEdit","blockify/with-icon",(0,r.createHigherOrderComponent)((t=>n=>{const{name:r,attributes:o,isSelected:i}=n,{className:a}=o,l=["core/button","blockify/tab"].includes(r);return(a?.includes("is-style-icon")||l)&&mi(r)?(i&&(()=>{var e;if(null!==(e=window?.blockify?.isPlugin)&&void 0!==e&&e)return;const t=document.getElementsByClassName("block-editor-block-card__description").item(0);t&&(document.getElementsByClassName("blockify-pro-icon-link").item(0)||(t.innerHTML=t.innerHTML+(0,L.__)(" Get more icons with ","blockify")+'Blockify Pro ↗ '))})(),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,{...n}),(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{title:(0,L.__)("Icon Settings","blockify"),initialOpen:!0,className:"blockify-icon-settings"},!window?.blockify?.isPlugin&&(0,e.createElement)("p",null,(0,L.__)("More icons available with Blockify Pro! ","blockify"),(0,e.createElement)("a",{href:"https://blockifywp.com/pro",target:"_blank",rel:"noreferrer"},(0,L.__)("Learn more ↗","blockify"))),(0,e.createElement)(gi,{...n,isButton:l}))))):(0,e.createElement)(t,{...n})}),"iconEdit"),0),(0,t.addFilter)("editor.BlockListBlock","blockify/edit-icon-styles",(0,r.createHigherOrderComponent)((t=>n=>{let{attributes:r,wrapperProps:o,name:i,clientId:a}=n;const l=["core/button"].includes(i);if(!r?.className&&!l)return(0,e.createElement)(t,{...n});if(!r?.className?.includes("is-style-icon")&&!l)return(0,e.createElement)(t,{...n});if(!mi(i))return(0,e.createElement)(t,{...n});o||(o={style:{}}),o.style={...o?.style,...S(r)};const s={};return r.iconSvgString&&(s["--wp--custom--icon--url"]="url('data:image/svg+xml;utf8,"+r.iconSvgString+"')"),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("style",null,"#block-"+a+"{"+v(s)+"}"),(0,e.createElement)(t,{...n,wrapperProps:o}))}),"withIcon")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/save-icon-styles",((e,t,n)=>{if(!n?.className)return e;const{name:r}=t,o="core/button"===r;return(n?.className?.includes("is-style-icon")||o)&&mi(r)?e={...e,style:{...e?.style,...S(n)}}:e}));const bi=(0,e.createElement)(V.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(V.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})),vi={name:"svg",title:(0,L.__)("SVG","blockify"),icon:bi,isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"media",scope:[],description:(0,L.__)("Insert an inline SVG.","blockify"),attributes:{className:"is-style-svg"},isActive:e=>!!e?.className&&e?.className&&e?.className?.includes("is-style-svg")};g()((()=>{(0,b.registerBlockVariation)("core/image",vi)}));const yi=e=>"url('data:image/svg+xml;utf8,"+encodeURIComponent(e)+"')",ki=e=>"data:image/svg+xml;utf8,"+encodeURIComponent(e);(0,t.addFilter)("editor.BlockEdit","blockify/with-svg-controls",(0,r.createHigherOrderComponent)((t=>n=>{var r,o;const{attributes:i,setAttributes:a}=n;if(!i?.className?.includes("is-style-svg"))return(0,e.createElement)(t,{...n});const{style:l}=i,s=null!==(r=l?.svgString)&&void 0!==r?r:"",c=null!==(o=l?.maskSvg)&&void 0!==o&&o;i?.url||a({url:c?"#":ki(s)}),c&&"#"!==i?.url&&a({url:"#"}),c||i?.url?.includes("data:image/svg+xml;utf8,")||a({url:ki(s)});let u="var(--width,1em)",d="";var p;i?.width&&(u=i.width+"px"),i?.height&&(d=(null!==(p=i.height)&&void 0!==p?p:"")+"px"),d=""===d?u:d;const m={width:u,height:d,display:"inline-flex",background:"currentColor",overflow:"hidden","-webkit-mask-repeat":"no-repeat","-mask-repeat":"no-repeat","-webkit-mask-size":"100% 100%","-mask-size":"100% 100%","-webkit-mask-position":"center","-mask-position":"center bottom","-webkit-mask-image":yi(s),"-mask-image":yi(s)};let f="";return s&&(f=Object.entries(m).map((([e,t])=>`${e}:${t};`)).join("")),(0,e.createElement)(e.Fragment,null,c&&(0,e.createElement)("style",null,"#block-"+n?.clientId+">div:first-of-type{"+f+"}"),(0,e.createElement)(t,{...n}),(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{title:(0,L.__)("SVG Settings","blockify-pro"),className:(0,L.__)("blockify-svg-controls","blockify-pro")},(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.TextareaControl,{label:(0,L.__)("SVG String","blockify"),help:(0,L.__)("Paste your SVG string in the field above. It is recommended to format your SVG with an optimization tool ","blockify"),value:null!=s?s:"",rows:20,onChange:e=>{const t={style:{...l,svgString:e}};t.url=c?"#":ki(e),a(t)},style:{fontFamily:"var(--wp--preset--font-family--monospace, monospace)"}})),(0,e.createElement)(D.ExternalLink,{href:"https://jakearchibald.github.io/svgomg/",target:"_blank"},"https://jakearchibald.github.io/svgomg/"),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.ToggleControl,{label:(0,L.__)("Mask with text color","blockify"),help:(0,L.__)("If enabled, the SVG will be masked with the text color. (Renders inline SVG on front end).","blockify"),checked:c,onChange:e=>{const t={style:{...l,maskSvg:e}};t.url=c?"#":ki(s),a(t)}})))))}),"withSvgControls"),9);const wi=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M7 7.2h8.2L13.5 9l1.1 1.1 3.6-3.6-3.5-4-1.1 1 1.9 2.3H7c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.2-.5zm13.8 4V11h-1.5v.3c0 1.1 0 3.5-1 4.5-.3.3-.7.5-1.3.5H8.8l1.7-1.7-1.1-1.1L5.9 17l3.5 4 1.1-1-1.9-2.3H17c.9 0 1.7-.3 2.3-.9 1.5-1.4 1.5-4.2 1.5-5.6z"})),Ei="60",xi="90",Ci={name:"marquee",icon:wi,title:(0,L.__)("Marquee","blockify"),isDefault:!1,category:window?.blockify?.isPlugin?"blockify":"design",scope:["inserter"],description:(0,L.__)("Adds a horizontal infinite scrolling marquee banner.","blockify"),innerBlocks:[["core/group",{layout:{type:"flex",flexWrap:"nowrap",orientation:"horizontal",justifyContent:"center"}},[["core/paragraph"]]]],attributes:{marquee:{},align:"full",speedMobile:Ei,speedDesktop:xi,pauseOnHover:!0,reverse:!1,fadeEdges:!1,direction:"horizontal",spacing:{padding:{right:"0",left:"0"}},layout:{type:"flex",flexWrap:"nowrap",orientation:"marquee",justifyContent:"center"}},isActive:(e,t)=>e.layout?.orientation===t.layout?.orientation};(0,b.registerBlockVariation)("core/group",Ci);const Si=e=>{var t,n;return{"--marquee-speed-mobile":(null!==(t=e?.speedMobile)&&void 0!==t?t:Ei)+"s","--marquee-speed-desktop":(null!==(n=e?.speedDesktop)&&void 0!==n?n:xi)+"s","--marquee-direction":e?.reverse?"reverse":"forwards","--marquee-pause":e?.pauseOnHover?"paused":"running"}};(0,t.addFilter)("blocks.registerBlockType","blockify/marquee-attributes",((e,t)=>("core/group"===t&&(e={...e,attributes:{...e.attributes,speedMobile:{type:"string"},speedDesktop:{type:"string"},reverse:{type:"boolean"},pauseOnHover:{type:"boolean"},repeatItems:{type:"number"},fadeEdges:{type:"boolean"}}}),e)),0),(0,t.addFilter)("editor.BlockEdit","blockify/with-marquee-controls",(0,r.createHigherOrderComponent)((t=>n=>{const{attributes:r,setAttributes:o}=n;return"marquee"!==r?.layout?.orientation?(0,e.createElement)(t,{...n}):(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Z.InspectorControls,null,(0,e.createElement)(D.PanelBody,{title:(0,L.__)("Marquee Settings","blockify-pro"),className:"blockify-width-control"},(0,e.createElement)((()=>{var t,n,i;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.__experimentalVStack,null,(0,e.createElement)(z,null,(0,L.__)("Scroll Speed (seconds)","blockify")),(0,e.createElement)(D.Flex,null,(0,e.createElement)(D.FlexItem,{style:{width:"50%"}},(0,e.createElement)(D.__experimentalNumberControl,{isShiftStepEnabled:!0,label:(0,L.__)("Mobile","blockify"),onChange:(e,t)=>{t?.event?.target?.validity?.valid&&o({speedMobile:e})},value:null!==(t=r?.speedMobile)&&void 0!==t?t:Ei})),(0,e.createElement)(D.FlexBlock,null,(0,e.createElement)(D.__experimentalNumberControl,{isShiftStepEnabled:!0,label:(0,L.__)("Desktop","blockify-pro"),onChange:(e,t)=>{t?.event?.target?.validity?.valid&&o({speedDesktop:e})},value:null!==(n=r?.speedDesktop)&&void 0!==n?n:xi}))))),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.RangeControl,{label:(0,L.__)("Repeat Items","blockify"),help:(0,L.__)("How many times should the items be duplicated/cloned.","blockify"),value:null!==(i=r?.repeatItems)&&void 0!==i?i:2,onChange:e=>{o({repeatItems:e})},min:0,max:10,step:1,allowReset:!0})),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.ToggleControl,{label:(0,L.__)("Pause on hover","blockify-pro"),checked:r?.pauseOnHover,onChange:()=>o({pauseOnHover:!r?.pauseOnHover})})),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.ToggleControl,{label:(0,L.__)("Reverse direction","blockify-pro"),checked:r?.reverse,onChange:()=>o({reverse:!r?.reverse})})),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.ToggleControl,{label:(0,L.__)("Fade Edges","blockify-pro"),checked:r?.fadeEdges,onChange:()=>o({fadeEdges:!r?.fadeEdges})})))}),null))),(0,e.createElement)(t,{...n}))}),"withInspectorControl"),9),(0,t.addFilter)("editor.BlockListBlock","blockify/with-marquee",(0,r.createHigherOrderComponent)((t=>n=>{var r,o;const{attributes:i}=n;if("marquee"!==i?.layout?.orientation)return(0,e.createElement)(t,{...n});n.attributes.style={...null!==(r=i.style)&&void 0!==r?r:{},...Si(i)};const a={...n.wrapperProps,style:{...null!==(o=n.wrapperProps?.style)&&void 0!==o?o:{},...Si(i)}};let l=n.className;return i?.fadeEdges&&(l=w(l,"fade-edges"),a.className=l),(0,e.createElement)(t,{...n,className:l,wrapperProps:a})}),"withMarquee")),(0,t.addFilter)("blocks.getSaveContent.extraProps","blockify/save-marquee-styles",((e,t,n)=>("marquee"!==n?.layout?.orientation||(e={...e,style:{...e?.style,...Si(n)}},n?.fadeEdges&&(e.className=w(e.className,"fade-edges"))),e)));const _i=(0,e.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 512 512"},(0,e.createElement)(D.Path,{d:"M126.12 315.1A47.06 47.06 0 1 1 79.06 268h47.06Zm23.72 0a47.06 47.06 0 0 1 94.12 0v117.84a47.06 47.06 0 1 1-94.12 0Zm47.06-188.98A47.06 47.06 0 1 1 244 79.06v47.06Zm0 23.72a47.06 47.06 0 0 1 0 94.12H79.06a47.06 47.06 0 0 1 0-94.12Zm188.98 47.06a47.06 47.06 0 1 1 47.06 47.1h-47.06Zm-23.72 0a47.06 47.06 0 0 1-94.12 0V79.06a47.06 47.06 0 1 1 94.12 0ZM315.1 385.88a47.06 47.06 0 1 1-47.1 47.06v-47.06Zm0-23.72a47.06 47.06 0 0 1 0-94.12h117.84a47.06 47.06 0 1 1 0 94.12Z"})),Oi={name:"slack",title:(0,L.__)("Slack","blockify"),icon:_i,attributes:{service:"slack"},isActive:(e,t)=>e.service===t.service};(0,b.registerBlockVariation)("core/social-link",Oi);const Fi=window.wp.richText;(0,Fi.registerFormatType)("blockify/clear-formatting",{title:(0,L.__)("Clear","blockify"),tagName:"span",className:"clear",edit:t=>{const{value:n,isActive:r,onChange:o}=t,{formatTypes:i}=(0,I.useSelect)((e=>({formatTypes:e("core/rich-text").getFormatTypes()})),[]);return(0,e.createElement)(Z.RichTextToolbarButton,{icon:"editor-removeformatting",title:(0,L.__)("Clear Formatting","blockify"),onClick:()=>{if(i.length>0){let e=n;i.map((t=>{e=(0,Fi.removeFormat)(e,t.name)})),o({...e})}},isActive:r})}});const Pi=(0,e.createElement)(V.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(V.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"})),Ii="blockify/gradient";(0,Fi.registerFormatType)(Ii,{title:(0,L.__)("Gradient","blockify"),tagName:"span",className:"has-text-gradient",attributes:{style:"style",class:"class"},edit:({isActive:t,value:n,onChange:r})=>{const[o,i]=(0,W.useState)(""),[a,l]=(0,W.useState)(!1),{gradients:s}=(0,I.useSelect)((e=>({gradients:e("core/block-editor").getSettings()?.gradients})),[]);let c="",u="";return n?.formats&&n.formats.forEach((e=>{const t=e?.find((e=>e?.type===Ii));t?.type===Ii&&(c+=";"+t?.attributes?.style,u+=t?.attributes?.class)})),(0,e.createElement)(Z.BlockControls,null,(0,e.createElement)(Z.RichTextToolbarButton,{icon:Pi,title:(0,L.__)("Gradient","blockify"),isActive:t,shortcutType:"primary",shortcutCharacter:"g",onClick:()=>l(!a)}),a&&(0,e.createElement)(D.Toolbar,{className:"blockify-components-toolbar"},(0,e.createElement)(D.Popover,{position:"bottom center",className:"blockify-gradient-text-control",focusOnMount:"container",onFocusOutside:()=>l(!1)},(0,e.createElement)(D.GradientPicker,{value:null!=o?o:"",gradients:s,onChange:e=>{i(e);let t=c,o=u;s.forEach((t=>{t.gradient===e&&(o+=(o?" ":"")+"has-"+t.slug+"-gradient-background")})),e&&!o.includes("-gradient-background")&&(t+=(t?t+";":"")+"background:"+e),o?.includes("has-text-gradient")&&(o=o?.replace("has-text-gradient","")?.trim()+" has-text-gradient"),r((0,Fi.applyFormat)(n,{type:Ii,attributes:{style:t,class:o}}))}}))))}});const Ti=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));D.CustomSelectControl.Option;const Ai="blockify/typography",Ni=[{key:"Default",name:"Default",style:{}},{key:"Thin",name:"Thin",style:{fontStyle:"normal",fontWeight:100}},{key:"Extra Light",name:"Extra Light",style:{fontStyle:"normal",fontWeight:200}},{key:"Light",name:"Light",style:{fontStyle:"normal",fontWeight:300}},{key:"Regular",name:"Regular",style:{fontStyle:"normal",fontWeight:400}},{key:"Medium",name:"Medium",style:{fontStyle:"normal",fontWeight:500}},{key:"Semi Bold",name:"Semi Bold",style:{fontStyle:"normal",fontWeight:600}},{key:"Bold",name:"Bold",style:{fontStyle:"normal",fontWeight:700}},{key:"Extra Bold",name:"Extra Bold",style:{fontStyle:"normal",fontWeight:800}},{key:"Black",name:"Black",style:{fontStyle:"normal",fontWeight:900}},{key:"Thin Italic",name:"Thin Italic",style:{fontStyle:"italic",fontWeight:100}},{key:"Extra Light Italic",name:"Extra Light Italic",style:{fontStyle:"italic",fontWeight:200}},{key:"Light Italic",name:"Light Italic",style:{fontStyle:"italic",fontWeight:300}},{key:"Regular Italic",name:"Regular Italic",style:{fontStyle:"italic",fontWeight:400}},{key:"Medium Italic",name:"Medium Italic",style:{fontStyle:"italic",fontWeight:500}},{key:"Semi Bold Italic",name:"Semi Bold Italic",style:{fontStyle:"italic",fontWeight:600}},{key:"Bold Italic",name:"Bold Italic",style:{fontStyle:"italic",fontWeight:700}},{key:"Extra Bold Italic",name:"Extra Bold Italic",style:{fontStyle:"italic",fontWeight:800}},{key:"Black Italic",name:"Black Italic",style:{fontStyle:"italic",fontWeight:900}}];(0,Fi.registerFormatType)(Ai,{title:(0,L.__)("Typography","blockify"),tagName:"span",className:"has-font",edit:t=>{var n;const{isActive:r,value:i,onChange:a}=t,{fontSizes:l}=(0,I.useSelect)((e=>({fontSizes:e("core/block-editor")?.getSettings()?.fontSizes})),[]),s=null!==(n=window?.blockify?.selectedFonts)&&void 0!==n?n:[],c=s?.map((e=>({label:o(e?.replace("-"," ")),value:e})));let u="",d="";i?.formats&&i.formats.forEach((e=>{e&&e.forEach((e=>{var t,n;e?.type===Ai&&(u=null!==(t=e?.attributes?.style)&&void 0!==t?t:"",d=null!==(n=e?.attributes?.class)&&void 0!==n?n:"")}))}));const[p,m]=(0,W.useState)({style:y(u),class:d.split(" "),fontFamily:"",fontSize:"",fontAppearance:Ni[0],isOpen:!1});return(0,e.createElement)(Z.BlockControls,null,(0,e.createElement)(Z.RichTextToolbarButton,{icon:Ti,title:(0,L.__)("Typography","blockify"),isActive:r,shortcutType:"primary",shortcutCharacter:"f",onClick:()=>m({...p,isOpen:!p.isOpen})}),p?.isOpen&&(0,e.createElement)(D.Toolbar,{className:"blockify-components-toolbar"},(0,e.createElement)(D.Popover,{position:"bottom center",className:"blockify-font-family-control",focusOnMount:"container",onFocusOutside:()=>m({...p,isOpen:!1})},(0,e.createElement)(D.SelectControl,{label:(0,L.__)("Select Font Family","blockify"),value:p?.fontFamily,options:c,onChange:e=>{m({...p,fontFamily:e});const t="has-"+e+"-font-family";p?.class?.includes(t)||p?.class?.push(t),a((0,Fi.applyFormat)(i,{type:Ai,attributes:{style:v(p?.style),class:p?.class?.join(" ")}}))}}),(0,e.createElement)(D.FontSizePicker,{fontSizes:l,fallbackFontSize:20,value:parseInt(p?.fontSize),withSlider:!0,onChange:e=>{m({...p,fontSize:e.toString()}),e&&(p.style["--wp--custom--font-size"]=e.toString()),p?.class?.includes("has-inline-font-size")||p.class.push("has-inline-font-size"),a((0,Fi.applyFormat)(i,{type:Ai,attributes:{style:v(p?.style),class:p?.class?.join(" ")}}))}}),(0,e.createElement)(D.CustomSelectControl,{label:(0,L.__)("Appearance","blockify"),value:Ni.find((e=>e.key===p?.fontAppearance?.key)),options:null!=Ni?Ni:[],onChange:({selectedItem:e})=>{e&&m({...p,fontAppearance:e}),e?.style?.fontStyle&&(p.style["font-style"]=e?.style?.fontStyle),e?.style?.fontWeight&&(p.style["font-weight"]=e?.style?.fontWeight?.toString()),a((0,Fi.applyFormat)(i,{type:Ai,attributes:{style:v(p?.style),class:p?.class?.join(" ")}}))}}))))}});const Mi=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),Ri="blockify/inline-svg";(0,Fi.registerFormatType)(Ri,{title:(0,L.__)("Inline SVG","blockify"),object:!0,tagName:"img",className:"has-inline-svg",edit:t=>{const{isActive:n,onChange:r,value:o}=t,[i,a]=(0,W.useState)(!1),[l,s]=(0,W.useState)({string:"",width:"1em",widthDesktop:"1em",alt:"",src:""});return(0,e.createElement)(Z.BlockControls,null,(0,e.createElement)(Z.RichTextToolbarButton,{icon:Mi,title:(0,L.__)("Inline SVG","blockify"),isActive:n,shortcutType:"primary",shortcutCharacter:"v",onClick:()=>a(!i)}),i&&(0,e.createElement)(D.Toolbar,{className:"blockify-components-toolbar"},(0,e.createElement)(D.Popover,{position:"bottom center",className:"blockify-svg-control",focusOnMount:"container",onFocusOutside:()=>a(!1)},(0,e.createElement)((()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(D.TextareaControl,{label:(0,L.__)("SVG String","blockify"),help:(0,L.__)("Paste your SVG string in the field above and then click the button below to insert your image.","blockify"),value:l?.string,placeholder:(0,L.__)("Paste your SVG string here","blockify"),rows:20,onChange:e=>{s({...l,string:e.replace(/'/g,'"')})},style:{fontFamily:"var(--wp--preset--font-family--monospace, monospace)",width:"300px"}}),(0,e.createElement)("br",null),(0,e.createElement)(D.TextareaControl,{label:(0,L.__)("Alt Text","blockify"),placeholder:(0,L.__)("SVG description","blockify"),value:l?.alt,rows:2,onChange:e=>{s({...l,alt:e})},style:{width:"300px"}}),(0,e.createElement)(D.PanelRow,null,(0,e.createElement)(D.Flex,null,(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Width Mobile","blockify"),value:l?.width,onChange:e=>{s({...l,width:e})}})),(0,e.createElement)(D.FlexItem,null,(0,e.createElement)(D.__experimentalUnitControl,{label:(0,L.__)("Width Desktop","blockify"),value:l?.widthDesktop,onChange:e=>{s({...l,widthDesktop:e})}})))),(0,e.createElement)("br",null),(0,e.createElement)(D.Button,{variant:"primary",text:(0,L.__)("Insert SVG","blockify"),onClick:()=>(e=>{const t={};e?.string&&(t["-webkit-mask-image"]="url(data:image/svg+xml;utf8,"+encodeURIComponent(e.string)+")"),e?.width&&(t["--width"]=e.width),e?.widthDesktop&&(t["--width-desktop"]=e.widthDesktop);const n={type:Ri,attributes:{alt:e?.alt,role:"presentation",src:"",style:v(t)}};r((0,Fi.insertObject)(o,n)),a(!1)})(l)}))),null))))}});const Bi=(0,e.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(V.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"})),Di="blockify/underline",Li=["none","solid","wavy","dashed","dotted","double","brush","circle","scribble"];(0,Fi.registerFormatType)(Di,{title:(0,L.__)("Underline","blockify"),tagName:"u",className:"has-text-underline",attributes:{style:"style",class:"class"},edit:({isActive:t,value:n,onChange:r})=>{const[o,i]=(0,W.useState)(""),[a,l]=(0,W.useState)(!1);let s=[],c=[];return n?.formats&&n.formats.forEach((e=>{e&&e.forEach((e=>{e.type===Di&&(e.attributes?.style&&(s=e.attributes.style.split(";")),e.attributes?.class&&(c=e.attributes.class.split(" ")))}))})),(0,e.createElement)(Z.BlockControls,null,(0,e.createElement)(Z.RichTextShortcut,{type:"primary",character:"u",onUse:()=>{r((0,Fi.toggleFormat)(n,{type:Di}))}}),(0,e.createElement)(Z.RichTextToolbarButton,{icon:Bi,title:(0,L.__)("Underline","blockify"),isActive:t,shortcutType:"primary",shortcutCharacter:"u",onClick:()=>l(!a)}),a&&(0,e.createElement)(D.Toolbar,{className:"blockify-components-toolbar"},(0,e.createElement)(D.Popover,{position:"bottom center",className:"blockify-underline-format",focusOnMount:"container",onFocusOutside:()=>l(!1)},(0,e.createElement)(D.__experimentalText,null,(0,L.__)("Underline style","blockify")),(0,e.createElement)("br",null),(0,e.createElement)(D.SelectControl,{onChange:e=>{var t,o;"none"===e&&r((0,Fi.removeFormat)(n,Di)),i(e);const a=null!==(t=c)&&void 0!==t?t:[];a.forEach(((e,t)=>{e.includes("is-underline-")&&delete l.classes[t]}));const l={classes:[...a,"is-underline-"+e],styles:[...null!==(o=s)&&void 0!==o?o:[],"--wp--custom--underline--style:"+e]};r((0,Fi.applyFormat)(n,{type:Di,attributes:{class:l.classes.join(" "),style:l.styles.join(";")}}))},value:o,options:Li.map((e=>{return{label:(t=e,t.charAt(0).toUpperCase()+t.slice(1)),value:e};var t}))}))))}})})()})();
\ No newline at end of file
diff --git a/assets/js/packery.asset.php b/assets/js/packery.asset.php
new file mode 100644
index 0000000..3d8649d
--- /dev/null
+++ b/assets/js/packery.asset.php
@@ -0,0 +1 @@
+ array(), 'version' => '296621db5d2278c5fb03');
diff --git a/assets/js/packery.js b/assets/js/packery.js
new file mode 100644
index 0000000..7d2c522
--- /dev/null
+++ b/assets/js/packery.js
@@ -0,0 +1 @@
+(()=>{var t={741:(t,i,e)=>{var n,o;!function(s,r){"use strict";void 0===(o="function"==typeof(n=r)?n.call(i,e,i,t):n)||(t.exports=o)}(window,(function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var i=["webkit","moz","ms","o"],e=0;ethis.animate())))},s.setLeftTop=function(){let{x:t,y:i}=this.position;this.element.style.left=`${t}px`,this.element.style.top=`${i}px`},s.positionDrag=function(){let{x:t,y:i}=this.dragPoint;this.element.style.transform=`translate3d(${t}px, ${i}px, 0)`},s.setPosition=function(t,i){this.position.x=t,this.position.y=i,this.setLeftTop()},s.enable=function(){this.isEnabled||(this.isEnabled=!0,this.bindHandles())},s.disable=function(){this.isEnabled&&(this.isEnabled=!1,this.isDragging&&this.dragEnd(),this.unbindHandles())};const d=["transform","left","top","position"];return s.destroy=function(){this.disable(),d.forEach((t=>{this.element.style[t]=""})),this.unbindHandles(),this.$element&&this.$element.removeData("draggabilly")},s._init=function(){},n&&n.bridget&&n.bridget("draggabilly",o),o}))},83:t=>{!function(i,e){t.exports?t.exports=e():i.getSize=e()}(window,(function(){function t(t){let i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}let i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];return i.length,function(e){if("string"==typeof e&&(e=document.querySelector(e)),!e||"object"!=typeof e||!e.nodeType)return;let n=getComputedStyle(e);if("none"==n.display)return function(){let t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};return i.forEach((i=>{t[i]=0})),t}();let o={};o.width=e.offsetWidth,o.height=e.offsetHeight;let s=o.isBorderBox="border-box"==n.boxSizing;i.forEach((t=>{let i=n[t],e=parseFloat(i);o[t]=isNaN(e)?0:e}));let r=o.paddingLeft+o.paddingRight,a=o.paddingTop+o.paddingBottom,h=o.marginLeft+o.marginRight,u=o.marginTop+o.marginBottom,d=o.borderLeftWidth+o.borderRightWidth,c=o.borderTopWidth+o.borderBottomWidth,l=t(n.width);!1!==l&&(o.width=l+(s?0:r+d));let p=t(n.height);return!1!==p&&(o.height=p+(s?0:a+c)),o.innerWidth=o.width-(r+d),o.innerHeight=o.height-(a+c),o.outerWidth=o.width+h,o.outerHeight=o.height+u,o}}))},158:function(t,i,e){var n,o;"undefined"!=typeof window&&window,void 0===(o="function"==typeof(n=function(){"use strict";function t(){}var i=t.prototype;return i.on=function(t,i){if(t&&i){var e=this._events=this._events||{},n=e[t]=e[t]||[];return-1==n.indexOf(i)&&n.push(i),this}},i.once=function(t,i){if(t&&i){this.on(t,i);var e=this._onceEvents=this._onceEvents||{};return(e[t]=e[t]||{})[i]=!0,this}},i.off=function(t,i){var e=this._events&&this._events[t];if(e&&e.length){var n=e.indexOf(i);return-1!=n&&e.splice(n,1),this}},i.emitEvent=function(t,i){var e=this._events&&this._events[t];if(e&&e.length){e=e.slice(0),i=i||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o{var n,o;!function(s,r){n=[e(741)],o=function(t){return function(t,i){"use strict";var e={extend:function(t,i){for(var e in i)t[e]=i[e];return t},modulo:function(t,i){return(t%i+i)%i}},n=Array.prototype.slice;e.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?n.call(t):[t]},e.removeFrom=function(t,i){var e=t.indexOf(i);-1!=e&&t.splice(e,1)},e.getParent=function(t,e){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,i(t,e))return t},e.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},e.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t)},e.filterFindElements=function(t,n){t=e.makeArray(t);var o=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(n){i(t,n)&&o.push(t);for(var e=t.querySelectorAll(n),s=0;s{var n,o;window,void 0===(o="function"==typeof(n=function(){"use strict";function t(t){var i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}var i="undefined"==typeof console?function(){}:function(t){console.error(t)},e=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],n=e.length;function o(t){var e=getComputedStyle(t);return e||i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}var s,r=!1;function a(i){if(function(){if(!r){r=!0;var i=document.createElement("div");i.style.width="200px",i.style.padding="1px 2px 3px 4px",i.style.borderStyle="solid",i.style.borderWidth="1px 2px 3px 4px",i.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(i);var n=o(i);s=200==Math.round(t(n.width)),a.isBoxSizeOuter=s,e.removeChild(i)}}(),"string"==typeof i&&(i=document.querySelector(i)),i&&"object"==typeof i&&i.nodeType){var h=o(i);if("none"==h.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0;i{var n,o,s;window,o=[e(158),e(131)],void 0===(s="function"==typeof(n=function(t,i){"use strict";var e=document.documentElement.style,n="string"==typeof e.transition?"transition":"WebkitTransition",o="string"==typeof e.transform?"transform":"WebkitTransform",s={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[n],r={transform:o,transition:n,transitionDuration:n+"Duration",transitionProperty:n+"Property",transitionDelay:n+"Delay"};function a(t,i){t&&(this.element=t,this.layout=i,this.position={x:0,y:0},this._create())}var h=a.prototype=Object.create(t.prototype);h.constructor=a,h._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},h.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t)},h.getSize=function(){this.size=i(this.element)},h.css=function(t){var i=this.element.style;for(var e in t)i[r[e]||e]=t[e]},h.getPosition=function(){var t=getComputedStyle(this.element),i=this.layout._getOption("originLeft"),e=this.layout._getOption("originTop"),n=t[i?"left":"right"],o=t[e?"top":"bottom"],s=parseFloat(n),r=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(s=s/100*a.width),-1!=o.indexOf("%")&&(r=r/100*a.height),s=isNaN(s)?0:s,r=isNaN(r)?0:r,s-=i?a.paddingLeft:a.paddingRight,r-=e?a.paddingTop:a.paddingBottom,this.position.x=s,this.position.y=r},h.layoutPosition=function(){var t=this.layout.size,i={},e=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=e?"paddingLeft":"paddingRight",s=e?"left":"right",r=e?"right":"left",a=this.position.x+t[o];i[s]=this.getXValue(a),i[r]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",c=this.position.y+t[h];i[u]=this.getYValue(c),i[d]="",this.css(i),this.emitEvent("layout",[this])},h.getXValue=function(t){var i=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!i?t/this.layout.size.width*100+"%":t+"px"},h.getYValue=function(t){var i=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&i?t/this.layout.size.height*100+"%":t+"px"},h._transitionTo=function(t,i){this.getPosition();var e=this.position.x,n=this.position.y,o=t==this.position.x&&i==this.position.y;if(this.setPosition(t,i),!o||this.isTransitioning){var s=t-e,r=i-n,a={};a.transform=this.getTranslate(s,r),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},h.getTranslate=function(t,i){return"translate3d("+(t=this.layout._getOption("originLeft")?t:-t)+"px, "+(i=this.layout._getOption("originTop")?i:-i)+"px, 0)"},h.goTo=function(t,i){this.setPosition(t,i),this.layoutPosition()},h.moveTo=h._transitionTo,h.setPosition=function(t,i){this.position.x=parseFloat(t),this.position.y=parseFloat(i)},h._nonTransition=function(t){for(var i in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[i].call(this)},h.transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var i=this._transn;for(var e in t.onTransitionEnd)i.onEnd[e]=t.onTransitionEnd[e];for(e in t.to)i.ingProperties[e]=!0,t.isCleaning&&(i.clean[e]=!0);t.from&&(this.css(t.from),this.element.offsetHeight),this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var u="opacity,"+o.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}));h.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:u,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(s,this,!1)}},h.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},h.onotransitionend=function(t){this.ontransitionend(t)};var d={"-webkit-transform":"transform"};h.ontransitionend=function(t){if(t.target===this.element){var i=this._transn,e=d[t.propertyName]||t.propertyName;delete i.ingProperties[e],function(t){for(var i in t)return!1;return!0}(i.ingProperties)&&this.disableTransition(),e in i.clean&&(this.element.style[t.propertyName]="",delete i.clean[e]),e in i.onEnd&&(i.onEnd[e].call(this),delete i.onEnd[e]),this.emitEvent("transitionEnd",[this])}},h.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(s,this,!1),this.isTransitioning=!1},h._removeStyles=function(t){var i={};for(var e in t)i[e]="";this.css(i)};var c={transitionProperty:"",transitionDuration:"",transitionDelay:""};return h.removeTransitionStyles=function(){this.css(c)},h.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},h.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},h.remove=function(){n&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},h.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,i={};i[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:i})},h.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},h.getHideRevealTransitionEndProperty=function(t){var i=this.layout.options[t];if(i.opacity)return"opacity";for(var e in i)return e},h.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,i={};i[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:i})},h.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},h.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a})?n.apply(i,o):n)||(t.exports=s)},794:(t,i,e)=>{var n,o;!function(s,r){"use strict";n=[e(158),e(131),e(47),e(652)],o=function(t,i,e,n){return function(t,i,e,n,o){var s=t.console,r=t.jQuery,a=function(){},h=0,u={};function d(t,i){var e=n.getQueryElement(t);if(e){this.element=e,r&&(this.$element=r(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(i);var o=++h;this.element.outlayerGUID=o,u[o]=this,this._create(),this._getOption("initLayout")&&this.layout()}else s&&s.error("Bad element for "+this.constructor.namespace+": "+(e||t))}d.namespace="outlayer",d.Item=o,d.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=d.prototype;function l(t){function i(){t.apply(this,arguments)}return i.prototype=Object.create(t.prototype),i.prototype.constructor=i,i}n.extend(c,i.prototype),c.option=function(t){n.extend(this.options,t)},c._getOption=function(t){var i=this.constructor.compatOptions[t];return i&&void 0!==this.options[i]?this.options[i]:this.options[t]},d.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},c.reloadItems=function(){this.items=this._itemize(this.element.children)},c._itemize=function(t){for(var i=this._filterFindItemElements(t),e=this.constructor.Item,n=[],o=0;o{var n,o,s;window,o=[e(794),e(173)],void 0===(s="function"==typeof(n=function(t,i){"use strict";var e="string"==typeof document.documentElement.style.transform?"transform":"WebkitTransform",n=function(){t.Item.apply(this,arguments)},o=n.prototype=Object.create(t.Item.prototype),s=o._create;o._create=function(){s.call(this),this.rect=new i};var r=o.moveTo;return o.moveTo=function(t,i){var e=Math.abs(this.position.x-t),n=Math.abs(this.position.y-i);this.layout.dragItemCount&&!this.isPlacing&&!this.isTransitioning&&e<1&&n<1?this.goTo(t,i):r.apply(this,arguments)},o.enablePlacing=function(){this.removeTransitionStyles(),this.isTransitioning&&e&&(this.element.style[e]="none"),this.isTransitioning=!1,this.getSize(),this.layout._setRectSize(this.element,this.rect),this.isPlacing=!0},o.disablePlacing=function(){this.isPlacing=!1},o.removeElem=function(){var t=this.element.parentNode;t&&t.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},o.showDropPlaceholder=function(){var t=this.dropPlaceholder;t||((t=this.dropPlaceholder=document.createElement("div")).className="packery-drop-placeholder",t.style.position="absolute"),t.style.width=this.size.width+"px",t.style.height=this.size.height+"px",this.positionDropPlaceholder(),this.layout.element.appendChild(t)},o.positionDropPlaceholder=function(){this.dropPlaceholder.style[e]="translate("+this.rect.x+"px, "+this.rect.y+"px)"},o.hideDropPlaceholder=function(){var t=this.dropPlaceholder.parentNode;t&&t.removeChild(this.dropPlaceholder)},n})?n.apply(i,o):n)||(t.exports=s)},539:(t,i,e)=>{var n,o,s;window,o=[e(173)],void 0===(s="function"==typeof(n=function(t){"use strict";function i(t,i,e){this.width=t||0,this.height=i||0,this.sortDirection=e||"downwardLeftToRight",this.reset()}var e=i.prototype;e.reset=function(){this.spaces=[];var i=new t({x:0,y:0,width:this.width,height:this.height});this.spaces.push(i),this.sorter=n[this.sortDirection]||n.downwardLeftToRight},e.pack=function(t){for(var i=0;i=t.x+t.width&&e.height>=t.height-.01){t.y=e.y,this.placed(t);break}}},e.rowPack=function(t){for(var i=0;i=t.y+t.height&&e.width>=t.width-.01){t.x=e.x,this.placed(t);break}}},e.placeInSpace=function(t,i){t.x=i.x,t.y=i.y,this.placed(t)},e.placed=function(t){for(var i=[],e=0;e{var n,o,s;window,o=[e(131),e(794),e(173),e(539),e(398)],void 0===(s="function"==typeof(n=function(t,i,e,n,o){"use strict";e.prototype.canFit=function(t){return this.width>=t.width-1&&this.height>=t.height-1};var s=i.create("packery");s.Item=o;var r=s.prototype;function a(t,i){return t.position.y-i.position.y||t.position.x-i.position.x}function h(t,i){return t.position.x-i.position.x||t.position.y-i.position.y}r._create=function(){i.prototype._create.call(this),this.packer=new n,this.shiftPacker=new n,this.isEnabled=!0,this.dragItemCount=0;var t=this;this.handleDraggabilly={dragStart:function(){t.itemDragStart(this.element)},dragMove:function(){t.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){t.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(i,e){e&&t.itemDragStart(i.currentTarget)},drag:function(i,e){e&&t.itemDragMove(i.currentTarget,e.position.left,e.position.top)},stop:function(i,e){e&&t.itemDragEnd(i.currentTarget)}}},r._resetLayout=function(){var t,i,e;this.getSize(),this._getMeasurements(),this._getOption("horizontal")?(t=1/0,i=this.size.innerHeight+this.gutter,e="rightwardTopToBottom"):(t=this.size.innerWidth+this.gutter,i=1/0,e="downwardLeftToRight"),this.packer.width=this.shiftPacker.width=t,this.packer.height=this.shiftPacker.height=i,this.packer.sortDirection=this.shiftPacker.sortDirection=e,this.packer.reset(),this.maxY=0,this.maxX=0},r._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},r._getItemLayoutPosition=function(t){if(this._setRectSize(t.element,t.rect),this.isShifting||this.dragItemCount>0){var i=this._getPackMethod();this.packer[i](t.rect)}else this.packer.pack(t.rect);return this._setMaxXY(t.rect),t.rect},r.shiftLayout=function(){this.isShifting=!0,this.layout(),delete this.isShifting},r._getPackMethod=function(){return this._getOption("horizontal")?"rowPack":"columnPack"},r._setMaxXY=function(t){this.maxX=Math.max(t.x+t.width,this.maxX),this.maxY=Math.max(t.y+t.height,this.maxY)},r._setRectSize=function(i,e){var n=t(i),o=n.outerWidth,s=n.outerHeight;(o||s)&&(o=this._applyGridGutter(o,this.columnWidth),s=this._applyGridGutter(s,this.rowHeight)),e.width=Math.min(o,this.packer.width),e.height=Math.min(s,this.packer.height)},r._applyGridGutter=function(t,i){if(!i)return t+this.gutter;var e=t%(i+=this.gutter);return Math[e&&e<1?"round":"ceil"](t/i)*i},r._getContainerSize=function(){return this._getOption("horizontal")?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},r._manageStamp=function(t){var i,n=this.getItem(t);if(n&&n.isPlacing)i=n.rect;else{var o=this._getElementOffset(t);i=new e({x:this._getOption("originLeft")?o.left:o.right,y:this._getOption("originTop")?o.top:o.bottom})}this._setRectSize(t,i),this.packer.placed(i),this._setMaxXY(i)},r.sortItemsByPosition=function(){var t=this._getOption("horizontal")?h:a;this.items.sort(t)},r.fit=function(t,i,e){var n=this.getItem(t);n&&(this.stamp(n.element),n.enablePlacing(),this.updateShiftTargets(n),i=void 0===i?n.rect.x:i,e=void 0===e?n.rect.y:e,this.shift(n,i,e),this._bindFitEvents(n),n.moveTo(n.rect.x,n.rect.y),this.shiftLayout(),this.unstamp(n.element),this.sortItemsByPosition(),n.disablePlacing())},r._bindFitEvents=function(t){var i=this,e=0;function n(){2==++e&&i.dispatchEvent("fitComplete",null,[t])}t.once("layout",n),this.once("layoutComplete",n)},r.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&(this.options.shiftPercentResize?this.resizeShiftPercentLayout():this.layout())},r.needsResizeLayout=function(){var i=t(this.element),e=this._getOption("horizontal")?"innerHeight":"innerWidth";return i[e]!=this.size[e]},r.resizeShiftPercentLayout=function(){var i=this._getItemsForLayout(this.items),e=this._getOption("horizontal"),n=e?"y":"x",o=e?"height":"width",s=e?"rowHeight":"columnWidth",r=e?"innerHeight":"innerWidth",a=this[s];if(a=a&&a+this.gutter){this._getMeasurements();var h=this[s]+this.gutter;i.forEach((function(t){var i=Math.round(t.rect[n]/a);t.rect[n]=i*h}))}else{var u=t(this.element)[r]+this.gutter,d=this.packer[o];i.forEach((function(t){t.rect[n]=t.rect[n]/d*u}))}this.shiftLayout()},r.itemDragStart=function(t){if(this.isEnabled){this.stamp(t);var i=this.getItem(t);i&&(i.enablePlacing(),i.showDropPlaceholder(),this.dragItemCount++,this.updateShiftTargets(i))}},r.updateShiftTargets=function(t){this.shiftPacker.reset(),this._getBoundingRect();var i=this._getOption("originLeft"),n=this._getOption("originTop");this.stamps.forEach((function(t){var o=this.getItem(t);if(!o||!o.isPlacing){var s=this._getElementOffset(t),r=new e({x:i?s.left:s.right,y:n?s.top:s.bottom});this._setRectSize(t,r),this.shiftPacker.placed(r)}}),this);var o,s=this._getOption("horizontal"),r=s?"rowHeight":"columnWidth",a=s?"height":"width";this.shiftTargetKeys=[],this.shiftTargets=[];var h=this[r];if(h=h&&h+this.gutter){var u=Math.ceil(t.rect[a]/h),d=Math.floor((this.shiftPacker[a]+this.gutter)/h);o=(d-u)*h;for(var c=0;ce)){var o=t+","+i;-1!=this.shiftTargetKeys.indexOf(o)||(this.shiftTargetKeys.push(o),this.shiftTargets.push({x:t,y:i}))}},r.shift=function(t,i,e){var n,o=1/0,s={x:i,y:e};this.shiftTargets.forEach((function(t){var i,e,r,a,h=(r=(e=s).x-(i=t).x,a=e.y-i.y,Math.sqrt(r*r+a*a));h{var n,o;window,void 0===(o="function"==typeof(n=function(){"use strict";function t(i){for(var e in t.defaults)this[e]=t.defaults[e];for(e in i)this[e]=i[e]}t.defaults={x:0,y:0,width:0,height:0};var i=t.prototype;return i.contains=function(t){var i=t.width||0,e=t.height||0;return this.x<=t.x&&this.y<=t.y&&this.x+this.width>=t.x+i&&this.y+this.height>=t.y+e},i.overlaps=function(t){var i=this.x+this.width,e=this.y+this.height,n=t.x+t.width,o=t.y+t.height;return this.xt.x&&this.yt.y},i.getMaximalFreeRects=function(i){if(!this.overlaps(i))return!1;var e,n=[],o=this.x+this.width,s=this.y+this.height,r=i.x+i.width,a=i.y+i.height;return this.yr&&(e=new t({x:r,y:this.y,width:o-r,height:this.height}),n.push(e)),s>a&&(e=new t({x:this.x,y:a,width:this.width,height:s-a}),n.push(e)),this.x=t.width&&this.height>=t.height},t})?n.call(i,e,i,t):n)||(t.exports=o)},574:function(t){var i,e;i="undefined"!=typeof window?window:this,e=function(){function t(){}let i=t.prototype;return i.on=function(t,i){if(!t||!i)return this;let e=this._events=this._events||{},n=e[t]=e[t]||[];return n.includes(i)||n.push(i),this},i.once=function(t,i){if(!t||!i)return this;this.on(t,i);let e=this._onceEvents=this._onceEvents||{};return(e[t]=e[t]||{})[i]=!0,this},i.off=function(t,i){let e=this._events&&this._events[t];if(!e||!e.length)return this;let n=e.indexOf(i);return-1!=n&&e.splice(n,1),this},i.emitEvent=function(t,i){let e=this._events&&this._events[t];if(!e||!e.length)return this;e=e.slice(0),i=i||[];let n=this._onceEvents&&this._onceEvents[t];for(let o of e)n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,i);return this},i.allOff=function(){return delete this._events,delete this._onceEvents,this},t},t.exports?t.exports=e():i.EvEmitter=e()},842:function(t,i,e){!function(i,n){t.exports?t.exports=n(i,e(574)):i.Unidragger=n(i,i.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,i){function e(){}let n,o,s=e.prototype=Object.create(i.prototype);s.handleEvent=function(t){let i="on"+t.type;this[i]&&this[i](t)},"ontouchstart"in t?(n="touchstart",o=["touchmove","touchend","touchcancel"]):t.PointerEvent?(n="pointerdown",o=["pointermove","pointerup","pointercancel"]):(n="mousedown",o=["mousemove","mouseup"]),s.touchActionValue="none",s.bindHandles=function(){this._bindHandles("addEventListener",this.touchActionValue)},s.unbindHandles=function(){this._bindHandles("removeEventListener","")},s._bindHandles=function(i,e){this.handles.forEach((o=>{o[i](n,this),o[i]("click",this),t.PointerEvent&&(o.style.touchAction=e)}))},s.bindActivePointerEvents=function(){o.forEach((i=>{t.addEventListener(i,this)}))},s.unbindActivePointerEvents=function(){o.forEach((i=>{t.removeEventListener(i,this)}))},s.withPointer=function(t,i){i.pointerId===this.pointerIdentifier&&this[t](i,i)},s.withTouch=function(t,i){let e;for(let t of i.changedTouches)t.identifier===this.pointerIdentifier&&(e=t);e&&this[t](i,e)},s.onmousedown=function(t){this.pointerDown(t,t)},s.ontouchstart=function(t){this.pointerDown(t,t.changedTouches[0])},s.onpointerdown=function(t){this.pointerDown(t,t)};const r=["TEXTAREA","INPUT","SELECT","OPTION"],a=["radio","checkbox","button","submit","image","file"];return s.pointerDown=function(t,i){let e=r.includes(t.target.nodeName),n=a.includes(t.target.type),o=!e||n;!this.isPointerDown&&!t.button&&o&&(this.isPointerDown=!0,this.pointerIdentifier=void 0!==i.pointerId?i.pointerId:i.identifier,this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY},this.bindActivePointerEvents(),this.emitEvent("pointerDown",[t,i]))},s.onmousemove=function(t){this.pointerMove(t,t)},s.onpointermove=function(t){this.withPointer("pointerMove",t)},s.ontouchmove=function(t){this.withTouch("pointerMove",t)},s.pointerMove=function(t,i){let e={x:i.pageX-this.pointerDownPointer.pageX,y:i.pageY-this.pointerDownPointer.pageY};this.emitEvent("pointerMove",[t,i,e]),!this.isDragging&&this.hasDragStarted(e)&&this.dragStart(t,i),this.isDragging&&this.dragMove(t,i,e)},s.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3},s.dragStart=function(t,i){this.isDragging=!0,this.isPreventingClicks=!0,this.emitEvent("dragStart",[t,i])},s.dragMove=function(t,i,e){this.emitEvent("dragMove",[t,i,e])},s.onmouseup=function(t){this.pointerUp(t,t)},s.onpointerup=function(t){this.withPointer("pointerUp",t)},s.ontouchend=function(t){this.withTouch("pointerUp",t)},s.pointerUp=function(t,i){this.pointerDone(),this.emitEvent("pointerUp",[t,i]),this.isDragging?this.dragEnd(t,i):this.staticClick(t,i)},s.dragEnd=function(t,i){this.isDragging=!1,setTimeout((()=>delete this.isPreventingClicks)),this.emitEvent("dragEnd",[t,i])},s.pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this.unbindActivePointerEvents(),this.emitEvent("pointerDone")},s.onpointercancel=function(t){this.withPointer("pointerCancel",t)},s.ontouchcancel=function(t){this.withTouch("pointerCancel",t)},s.pointerCancel=function(t,i){this.pointerDone(),this.emitEvent("pointerCancel",[t,i])},s.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},s.staticClick=function(t,i){let e="mouseup"===t.type;e&&this.isIgnoringMouseUp||(this.emitEvent("staticClick",[t,i]),e&&(this.isIgnoringMouseUp=!0,setTimeout((()=>{delete this.isIgnoringMouseUp}),400)))},e}))}},i={};function e(n){var o=i[n];if(void 0!==o)return o.exports;var s=i[n]={exports:{}};return t[n].call(s.exports,s,s.exports,e),s.exports}e.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},e.d=(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),(()=>{"use strict";var t=e(812),i=e.n(t),n=e(384),o=e.n(n);document.querySelectorAll(".packery").forEach((t=>{var e,n,s;const r=null!==(e=t.getAttribute("data-item-selector"))&&void 0!==e?e:".wp-block-group",a=null!==(n=t.getAttribute("data-gutter"))&&void 0!==n?n:16,h=null===(s=t.getAttribute("data-origin-top"))||void 0===s||s,u=t.getAttribute("data-draggable")||t.classList.contains("is-draggable"),d=new(i())(t,{itemSelector:r,gutter:a,originTop:h});u&&d.items.forEach((t=>{d.bindDraggabillyEvents(new(o())(t.element))}))}))})()})();
\ No newline at end of file
diff --git a/assets/js/scroll.asset.php b/assets/js/scroll.asset.php
index 702067a..200b262 100644
--- a/assets/js/scroll.asset.php
+++ b/assets/js/scroll.asset.php
@@ -1 +1 @@
- array(), 'version' => '1ae3ce03039fa027ffb5');
+ array(), 'version' => '03c3ff95e1bb5f96af46');
diff --git a/assets/js/scroll.js b/assets/js/scroll.js
index 42af6f2..040f60f 100644
--- a/assets/js/scroll.js
+++ b/assets/js/scroll.js
@@ -1 +1 @@
-window.addEventListener("scroll",(()=>{const o=window.scrollY/(document.body.offsetHeight-window.innerHeight);document.body.style.setProperty("--scroll",o.toFixed(2).toString())}),!1);
\ No newline at end of file
+(()=>{let t,e,o=0,n=!1;t=document.body.offsetHeight-window.innerHeight,e=document.querySelectorAll(".has-scroll-animation"),window.addEventListener("scroll",function(t,e){let o;return(...e)=>{clearTimeout(o),o=window.setTimeout((()=>{t(...e)}),10)}}((()=>{o=window.scrollY,n||(window.requestAnimationFrame((()=>{(()=>{const n=100*Math.min(Math.max(o/t,0),1);document.body.style.setProperty("--scroll",n.toFixed(0)),e.forEach((t=>{const e=(t.getBoundingClientRect().top+window.scrollY-o)/window.innerHeight*100;t.style.setProperty("--scroll-amount",e.toFixed(0))}))})(),n=!1})),n=!0)})))})();
\ No newline at end of file
diff --git a/assets/svg/social/amazon.svg b/assets/svg/social/amazon.svg
index 9374728..57c0e53 100644
--- a/assets/svg/social/amazon.svg
+++ b/assets/svg/social/amazon.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/bandcamp.svg b/assets/svg/social/bandcamp.svg
index 4833560..a1dc80c 100644
--- a/assets/svg/social/bandcamp.svg
+++ b/assets/svg/social/bandcamp.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/behance.svg b/assets/svg/social/behance.svg
index 92748d7..addb968 100644
--- a/assets/svg/social/behance.svg
+++ b/assets/svg/social/behance.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/blockify.svg b/assets/svg/social/blockify.svg
index 6e6a345..eca698d 100644
--- a/assets/svg/social/blockify.svg
+++ b/assets/svg/social/blockify.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/social/chain.svg b/assets/svg/social/chain.svg
index f35bf5d..a4a911e 100644
--- a/assets/svg/social/chain.svg
+++ b/assets/svg/social/chain.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/codepen.svg b/assets/svg/social/codepen.svg
index 1f30eab..491fc28 100644
--- a/assets/svg/social/codepen.svg
+++ b/assets/svg/social/codepen.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/deviantart.svg b/assets/svg/social/deviantart.svg
index f28b239..ff4c000 100644
--- a/assets/svg/social/deviantart.svg
+++ b/assets/svg/social/deviantart.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/dribbble.svg b/assets/svg/social/dribbble.svg
index cab4d25..b0d73c1 100644
--- a/assets/svg/social/dribbble.svg
+++ b/assets/svg/social/dribbble.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/dropbox.svg b/assets/svg/social/dropbox.svg
index 6a20fef..07f0a5d 100644
--- a/assets/svg/social/dropbox.svg
+++ b/assets/svg/social/dropbox.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/etsy.svg b/assets/svg/social/etsy.svg
index 6874f7b..82578cc 100644
--- a/assets/svg/social/etsy.svg
+++ b/assets/svg/social/etsy.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/facebook.svg b/assets/svg/social/facebook.svg
index 4f43a3c..ec6c74e 100644
--- a/assets/svg/social/facebook.svg
+++ b/assets/svg/social/facebook.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/feed.svg b/assets/svg/social/feed.svg
index 38f5f0f..20bf068 100644
--- a/assets/svg/social/feed.svg
+++ b/assets/svg/social/feed.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/fivehundredpx.svg b/assets/svg/social/fivehundredpx.svg
index b7397de..589bb1e 100644
--- a/assets/svg/social/fivehundredpx.svg
+++ b/assets/svg/social/fivehundredpx.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/flickr.svg b/assets/svg/social/flickr.svg
index b3cca89..14c1bfa 100644
--- a/assets/svg/social/flickr.svg
+++ b/assets/svg/social/flickr.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/foursquare.svg b/assets/svg/social/foursquare.svg
index abe96c4..44af940 100644
--- a/assets/svg/social/foursquare.svg
+++ b/assets/svg/social/foursquare.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/github.svg b/assets/svg/social/github.svg
index 34b16ae..00bb66f 100644
--- a/assets/svg/social/github.svg
+++ b/assets/svg/social/github.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/goodreads.svg b/assets/svg/social/goodreads.svg
index 6e121e8..9ee629a 100644
--- a/assets/svg/social/goodreads.svg
+++ b/assets/svg/social/goodreads.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/google.svg b/assets/svg/social/google.svg
index 0a48b88..fb57efb 100644
--- a/assets/svg/social/google.svg
+++ b/assets/svg/social/google.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/instagram.svg b/assets/svg/social/instagram.svg
index e9f76f0..5c338e6 100644
--- a/assets/svg/social/instagram.svg
+++ b/assets/svg/social/instagram.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/lastfm.svg b/assets/svg/social/lastfm.svg
index 47cf1f8..fe7172d 100644
--- a/assets/svg/social/lastfm.svg
+++ b/assets/svg/social/lastfm.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/linkedin.svg b/assets/svg/social/linkedin.svg
index c7c8c0f..5835468 100644
--- a/assets/svg/social/linkedin.svg
+++ b/assets/svg/social/linkedin.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/mail.svg b/assets/svg/social/mail.svg
index 9143abd..545fa2e 100644
--- a/assets/svg/social/mail.svg
+++ b/assets/svg/social/mail.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/social/mastodon.svg b/assets/svg/social/mastodon.svg
index e74a124..fa2e33e 100644
--- a/assets/svg/social/mastodon.svg
+++ b/assets/svg/social/mastodon.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/medium.svg b/assets/svg/social/medium.svg
index fc9d2da..7f28476 100644
--- a/assets/svg/social/medium.svg
+++ b/assets/svg/social/medium.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/meetup.svg b/assets/svg/social/meetup.svg
index 9359def..8f3f273 100644
--- a/assets/svg/social/meetup.svg
+++ b/assets/svg/social/meetup.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/patreon.svg b/assets/svg/social/patreon.svg
index 5cfac57..c57a921 100644
--- a/assets/svg/social/patreon.svg
+++ b/assets/svg/social/patreon.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/pinterest.svg b/assets/svg/social/pinterest.svg
index cc9360b..5189013 100644
--- a/assets/svg/social/pinterest.svg
+++ b/assets/svg/social/pinterest.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/pocket.svg b/assets/svg/social/pocket.svg
index 5418060..f3684fa 100644
--- a/assets/svg/social/pocket.svg
+++ b/assets/svg/social/pocket.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/reddit.svg b/assets/svg/social/reddit.svg
index c240a7e..91d6cf9 100644
--- a/assets/svg/social/reddit.svg
+++ b/assets/svg/social/reddit.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/skype.svg b/assets/svg/social/skype.svg
index dffbb75..3d1c4b5 100644
--- a/assets/svg/social/skype.svg
+++ b/assets/svg/social/skype.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/snapchat.svg b/assets/svg/social/snapchat.svg
index 9e150c6..89e3d65 100644
--- a/assets/svg/social/snapchat.svg
+++ b/assets/svg/social/snapchat.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/soundcloud.svg b/assets/svg/social/soundcloud.svg
index ceee0b9..c653f62 100644
--- a/assets/svg/social/soundcloud.svg
+++ b/assets/svg/social/soundcloud.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/spotify.svg b/assets/svg/social/spotify.svg
index e5e7e05..0a5cb37 100644
--- a/assets/svg/social/spotify.svg
+++ b/assets/svg/social/spotify.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/telegram.svg b/assets/svg/social/telegram.svg
index 14e432d..724dbef 100644
--- a/assets/svg/social/telegram.svg
+++ b/assets/svg/social/telegram.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/tiktok.svg b/assets/svg/social/tiktok.svg
index 923b602..fe6d87a 100644
--- a/assets/svg/social/tiktok.svg
+++ b/assets/svg/social/tiktok.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/tumblr.svg b/assets/svg/social/tumblr.svg
index 63a3178..1760ae9 100644
--- a/assets/svg/social/tumblr.svg
+++ b/assets/svg/social/tumblr.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/twitch.svg b/assets/svg/social/twitch.svg
index 4550a87..16aee9e 100644
--- a/assets/svg/social/twitch.svg
+++ b/assets/svg/social/twitch.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/twitter.svg b/assets/svg/social/twitter.svg
index 82a8515..4ffa329 100644
--- a/assets/svg/social/twitter.svg
+++ b/assets/svg/social/twitter.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/vimeo.svg b/assets/svg/social/vimeo.svg
index e1ac74b..c54af82 100644
--- a/assets/svg/social/vimeo.svg
+++ b/assets/svg/social/vimeo.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/vk.svg b/assets/svg/social/vk.svg
index fbcdbdf..23e81d6 100644
--- a/assets/svg/social/vk.svg
+++ b/assets/svg/social/vk.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/wordpress.svg b/assets/svg/social/wordpress.svg
index 40105cc..a879f98 100644
--- a/assets/svg/social/wordpress.svg
+++ b/assets/svg/social/wordpress.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/x.svg b/assets/svg/social/x.svg
new file mode 100644
index 0000000..344879a
--- /dev/null
+++ b/assets/svg/social/x.svg
@@ -0,0 +1,4 @@
+
+
+
\ No newline at end of file
diff --git a/assets/svg/social/yelp.svg b/assets/svg/social/yelp.svg
index 46808c6..f109830 100644
--- a/assets/svg/social/yelp.svg
+++ b/assets/svg/social/yelp.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/social/youtube.svg b/assets/svg/social/youtube.svg
index 719ee63..a927143 100644
--- a/assets/svg/social/youtube.svg
+++ b/assets/svg/social/youtube.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/assets/svg/wordpress/add-template.svg b/assets/svg/wordpress/add-template.svg
new file mode 100644
index 0000000..6e45d03
--- /dev/null
+++ b/assets/svg/wordpress/add-template.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/align-center.svg b/assets/svg/wordpress/align-center.svg
index 2cfb3f7..f420603 100644
--- a/assets/svg/wordpress/align-center.svg
+++ b/assets/svg/wordpress/align-center.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/align-justify.svg b/assets/svg/wordpress/align-justify.svg
index b3ce2e6..f3a1131 100644
--- a/assets/svg/wordpress/align-justify.svg
+++ b/assets/svg/wordpress/align-justify.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/align-left.svg b/assets/svg/wordpress/align-left.svg
index fb63c69..c1bb072 100644
--- a/assets/svg/wordpress/align-left.svg
+++ b/assets/svg/wordpress/align-left.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/align-none.svg b/assets/svg/wordpress/align-none.svg
index 405d7a2..b7a8619 100644
--- a/assets/svg/wordpress/align-none.svg
+++ b/assets/svg/wordpress/align-none.svg
@@ -1 +1,3 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/align-right.svg b/assets/svg/wordpress/align-right.svg
index bd9ae9c..d53e40f 100644
--- a/assets/svg/wordpress/align-right.svg
+++ b/assets/svg/wordpress/align-right.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/archive.svg b/assets/svg/wordpress/archive.svg
index a8146f9..12d4a32 100644
--- a/assets/svg/wordpress/archive.svg
+++ b/assets/svg/wordpress/archive.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/arrow-down.svg b/assets/svg/wordpress/arrow-down.svg
index ea5385f..f87560c 100644
--- a/assets/svg/wordpress/arrow-down.svg
+++ b/assets/svg/wordpress/arrow-down.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/arrow-left.svg b/assets/svg/wordpress/arrow-left.svg
index eaed796..2ddea24 100644
--- a/assets/svg/wordpress/arrow-left.svg
+++ b/assets/svg/wordpress/arrow-left.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/arrow-right.svg b/assets/svg/wordpress/arrow-right.svg
index b1a1e44..c16f6c4 100644
--- a/assets/svg/wordpress/arrow-right.svg
+++ b/assets/svg/wordpress/arrow-right.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/arrow-up.svg b/assets/svg/wordpress/arrow-up.svg
index 7f9de61..b94c549 100644
--- a/assets/svg/wordpress/arrow-up.svg
+++ b/assets/svg/wordpress/arrow-up.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/at-symbol.svg b/assets/svg/wordpress/at-symbol.svg
index dfa8775..5800dc1 100644
--- a/assets/svg/wordpress/at-symbol.svg
+++ b/assets/svg/wordpress/at-symbol.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/audio.svg b/assets/svg/wordpress/audio.svg
index a4c1b91..4bf17af 100644
--- a/assets/svg/wordpress/audio.svg
+++ b/assets/svg/wordpress/audio.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/before-after.svg b/assets/svg/wordpress/before-after.svg
new file mode 100644
index 0000000..3da238c
--- /dev/null
+++ b/assets/svg/wordpress/before-after.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/block-table.svg b/assets/svg/wordpress/block-table.svg
index 6cc6894..73da856 100644
--- a/assets/svg/wordpress/block-table.svg
+++ b/assets/svg/wordpress/block-table.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/border.svg b/assets/svg/wordpress/border.svg
new file mode 100644
index 0000000..ce5e39a
--- /dev/null
+++ b/assets/svg/wordpress/border.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/box.svg b/assets/svg/wordpress/box.svg
index a768ce7..060d7c7 100644
--- a/assets/svg/wordpress/box.svg
+++ b/assets/svg/wordpress/box.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/bug.svg b/assets/svg/wordpress/bug.svg
index c6c8d62..1ed037a 100644
--- a/assets/svg/wordpress/bug.svg
+++ b/assets/svg/wordpress/bug.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/button.svg b/assets/svg/wordpress/button.svg
index a2493d3..6baa5f5 100644
--- a/assets/svg/wordpress/button.svg
+++ b/assets/svg/wordpress/button.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/buttons.svg b/assets/svg/wordpress/buttons.svg
index b6713c2..1b14105 100644
--- a/assets/svg/wordpress/buttons.svg
+++ b/assets/svg/wordpress/buttons.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/calendar.svg b/assets/svg/wordpress/calendar.svg
index b4dca5a..6489209 100644
--- a/assets/svg/wordpress/calendar.svg
+++ b/assets/svg/wordpress/calendar.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/cancel-circle-filled.svg b/assets/svg/wordpress/cancel-circle-filled.svg
index 9a251a9..0b71462 100644
--- a/assets/svg/wordpress/cancel-circle-filled.svg
+++ b/assets/svg/wordpress/cancel-circle-filled.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/caption.svg b/assets/svg/wordpress/caption.svg
new file mode 100644
index 0000000..de79596
--- /dev/null
+++ b/assets/svg/wordpress/caption.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/capture-photo.svg b/assets/svg/wordpress/capture-photo.svg
index 0bb7056..af407bd 100644
--- a/assets/svg/wordpress/capture-photo.svg
+++ b/assets/svg/wordpress/capture-photo.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/capture-video.svg b/assets/svg/wordpress/capture-video.svg
index e8b3c69..a486b3d 100644
--- a/assets/svg/wordpress/capture-video.svg
+++ b/assets/svg/wordpress/capture-video.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/category.svg b/assets/svg/wordpress/category.svg
index 0503fa7..78471ff 100644
--- a/assets/svg/wordpress/category.svg
+++ b/assets/svg/wordpress/category.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/chart-bar.svg b/assets/svg/wordpress/chart-bar.svg
index 6b6337e..42e1de2 100644
--- a/assets/svg/wordpress/chart-bar.svg
+++ b/assets/svg/wordpress/chart-bar.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/chevron-down.svg b/assets/svg/wordpress/chevron-down.svg
index 0b57592..027a717 100644
--- a/assets/svg/wordpress/chevron-down.svg
+++ b/assets/svg/wordpress/chevron-down.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/chevron-left-small.svg b/assets/svg/wordpress/chevron-left-small.svg
new file mode 100644
index 0000000..59ed13e
--- /dev/null
+++ b/assets/svg/wordpress/chevron-left-small.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/chevron-up-down.svg b/assets/svg/wordpress/chevron-up-down.svg
new file mode 100644
index 0000000..407ad25
--- /dev/null
+++ b/assets/svg/wordpress/chevron-up-down.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/chevron-up.svg b/assets/svg/wordpress/chevron-up.svg
index c4b3645..3316667 100644
--- a/assets/svg/wordpress/chevron-up.svg
+++ b/assets/svg/wordpress/chevron-up.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/circle-filled.svg b/assets/svg/wordpress/circle-filled.svg
new file mode 100644
index 0000000..1dcd39f
--- /dev/null
+++ b/assets/svg/wordpress/circle-filled.svg
@@ -0,0 +1,4 @@
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/circle.svg b/assets/svg/wordpress/circle.svg
new file mode 100644
index 0000000..c979649
--- /dev/null
+++ b/assets/svg/wordpress/circle.svg
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/classic.svg b/assets/svg/wordpress/classic.svg
index 83d4498..0fe83c4 100644
--- a/assets/svg/wordpress/classic.svg
+++ b/assets/svg/wordpress/classic.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/code.svg b/assets/svg/wordpress/code.svg
index e0174ec..f1e0862 100644
--- a/assets/svg/wordpress/code.svg
+++ b/assets/svg/wordpress/code.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/cog.svg b/assets/svg/wordpress/cog.svg
index c1446a6..c8eaf84 100644
--- a/assets/svg/wordpress/cog.svg
+++ b/assets/svg/wordpress/cog.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/color.svg b/assets/svg/wordpress/color.svg
index edc734a..1b2f8ec 100644
--- a/assets/svg/wordpress/color.svg
+++ b/assets/svg/wordpress/color.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/columns.svg b/assets/svg/wordpress/columns.svg
index 5dd5169..0fadb4e 100644
--- a/assets/svg/wordpress/columns.svg
+++ b/assets/svg/wordpress/columns.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/comment-author-avatar.svg b/assets/svg/wordpress/comment-author-avatar.svg
index 9e6a608..6cffa78 100644
--- a/assets/svg/wordpress/comment-author-avatar.svg
+++ b/assets/svg/wordpress/comment-author-avatar.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/comment-author-name.svg b/assets/svg/wordpress/comment-author-name.svg
index 4f7279d..1b0bbaf 100644
--- a/assets/svg/wordpress/comment-author-name.svg
+++ b/assets/svg/wordpress/comment-author-name.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/comment-content.svg b/assets/svg/wordpress/comment-content.svg
index 51ba14d..7727cb9 100644
--- a/assets/svg/wordpress/comment-content.svg
+++ b/assets/svg/wordpress/comment-content.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/comment-edit-link.svg b/assets/svg/wordpress/comment-edit-link.svg
index 610c56d..7445b6b 100644
--- a/assets/svg/wordpress/comment-edit-link.svg
+++ b/assets/svg/wordpress/comment-edit-link.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/comment-reply-link.svg b/assets/svg/wordpress/comment-reply-link.svg
index a948b3f..fd90a8d 100644
--- a/assets/svg/wordpress/comment-reply-link.svg
+++ b/assets/svg/wordpress/comment-reply-link.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/comment.svg b/assets/svg/wordpress/comment.svg
index 555e3b3..bcc3169 100644
--- a/assets/svg/wordpress/comment.svg
+++ b/assets/svg/wordpress/comment.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/currency-pound.svg b/assets/svg/wordpress/currency-pound.svg
index b3b25e1..a63c781 100644
--- a/assets/svg/wordpress/currency-pound.svg
+++ b/assets/svg/wordpress/currency-pound.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/custom-link.svg b/assets/svg/wordpress/custom-link.svg
index 74122d9..c714dba 100644
--- a/assets/svg/wordpress/custom-link.svg
+++ b/assets/svg/wordpress/custom-link.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/details.svg b/assets/svg/wordpress/details.svg
new file mode 100644
index 0000000..ccedbe5
--- /dev/null
+++ b/assets/svg/wordpress/details.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/drag-handle.svg b/assets/svg/wordpress/drag-handle.svg
index 7818c61..3a16f1b 100644
--- a/assets/svg/wordpress/drag-handle.svg
+++ b/assets/svg/wordpress/drag-handle.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/drawer-left.svg b/assets/svg/wordpress/drawer-left.svg
new file mode 100644
index 0000000..dcb3c2b
--- /dev/null
+++ b/assets/svg/wordpress/drawer-left.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/drawer-right.svg b/assets/svg/wordpress/drawer-right.svg
new file mode 100644
index 0000000..80c6745
--- /dev/null
+++ b/assets/svg/wordpress/drawer-right.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/edit.svg b/assets/svg/wordpress/edit.svg
index afa2f56..035420e 100644
--- a/assets/svg/wordpress/edit.svg
+++ b/assets/svg/wordpress/edit.svg
@@ -1 +1,3 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/external.svg b/assets/svg/wordpress/external.svg
index 8d7946e..c01def6 100644
--- a/assets/svg/wordpress/external.svg
+++ b/assets/svg/wordpress/external.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/file.svg b/assets/svg/wordpress/file.svg
index 108bc3c..7d4aadd 100644
--- a/assets/svg/wordpress/file.svg
+++ b/assets/svg/wordpress/file.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/filter.svg b/assets/svg/wordpress/filter.svg
new file mode 100644
index 0000000..eb266f9
--- /dev/null
+++ b/assets/svg/wordpress/filter.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/footer.svg b/assets/svg/wordpress/footer.svg
index 6b1e28e..f62ee00 100644
--- a/assets/svg/wordpress/footer.svg
+++ b/assets/svg/wordpress/footer.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/fullscreen.svg b/assets/svg/wordpress/fullscreen.svg
index 08320af..e24a87e 100644
--- a/assets/svg/wordpress/fullscreen.svg
+++ b/assets/svg/wordpress/fullscreen.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/gallery.svg b/assets/svg/wordpress/gallery.svg
index 76a4a0d..36d5d60 100644
--- a/assets/svg/wordpress/gallery.svg
+++ b/assets/svg/wordpress/gallery.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/grid.svg b/assets/svg/wordpress/grid.svg
index 248b937..7f01f5d 100644
--- a/assets/svg/wordpress/grid.svg
+++ b/assets/svg/wordpress/grid.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/group.svg b/assets/svg/wordpress/group.svg
index d7a0abc..a31de8a 100644
--- a/assets/svg/wordpress/group.svg
+++ b/assets/svg/wordpress/group.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/handle.svg b/assets/svg/wordpress/handle.svg
index ff09bd2..32e76f5 100644
--- a/assets/svg/wordpress/handle.svg
+++ b/assets/svg/wordpress/handle.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/heading-level-1.svg b/assets/svg/wordpress/heading-level-1.svg
new file mode 100644
index 0000000..feed53e
--- /dev/null
+++ b/assets/svg/wordpress/heading-level-1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/heading-level-2.svg b/assets/svg/wordpress/heading-level-2.svg
new file mode 100644
index 0000000..41f894b
--- /dev/null
+++ b/assets/svg/wordpress/heading-level-2.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/heading-level-3.svg b/assets/svg/wordpress/heading-level-3.svg
new file mode 100644
index 0000000..4c20719
--- /dev/null
+++ b/assets/svg/wordpress/heading-level-3.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/heading-level-4.svg b/assets/svg/wordpress/heading-level-4.svg
new file mode 100644
index 0000000..f0c24bd
--- /dev/null
+++ b/assets/svg/wordpress/heading-level-4.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/heading-level-5.svg b/assets/svg/wordpress/heading-level-5.svg
new file mode 100644
index 0000000..61c69da
--- /dev/null
+++ b/assets/svg/wordpress/heading-level-5.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/heading-level-6.svg b/assets/svg/wordpress/heading-level-6.svg
new file mode 100644
index 0000000..737ee43
--- /dev/null
+++ b/assets/svg/wordpress/heading-level-6.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/heading.svg b/assets/svg/wordpress/heading.svg
index 6729915..71e55c6 100644
--- a/assets/svg/wordpress/heading.svg
+++ b/assets/svg/wordpress/heading.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/help-filled.svg b/assets/svg/wordpress/help-filled.svg
index 7b3d895..24a2e30 100644
--- a/assets/svg/wordpress/help-filled.svg
+++ b/assets/svg/wordpress/help-filled.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/html.svg b/assets/svg/wordpress/html.svg
index 1bbcea5..1c693e7 100644
--- a/assets/svg/wordpress/html.svg
+++ b/assets/svg/wordpress/html.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/image.svg b/assets/svg/wordpress/image.svg
index 26b87e5..a55da44 100644
--- a/assets/svg/wordpress/image.svg
+++ b/assets/svg/wordpress/image.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/inbox.svg b/assets/svg/wordpress/inbox.svg
index a8e4c4c..8b82300 100644
--- a/assets/svg/wordpress/inbox.svg
+++ b/assets/svg/wordpress/inbox.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/institution.svg b/assets/svg/wordpress/institution.svg
index 8093c64..940a4eb 100644
--- a/assets/svg/wordpress/institution.svg
+++ b/assets/svg/wordpress/institution.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/justify-center.svg b/assets/svg/wordpress/justify-center.svg
index d75f500..fb19259 100644
--- a/assets/svg/wordpress/justify-center.svg
+++ b/assets/svg/wordpress/justify-center.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/justify-stretch.svg b/assets/svg/wordpress/justify-stretch.svg
new file mode 100644
index 0000000..5e70ae2
--- /dev/null
+++ b/assets/svg/wordpress/justify-stretch.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/key.svg b/assets/svg/wordpress/key.svg
index f216ff8..26facfb 100644
--- a/assets/svg/wordpress/key.svg
+++ b/assets/svg/wordpress/key.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/keyboard.svg b/assets/svg/wordpress/keyboard.svg
new file mode 100644
index 0000000..d6dd9f2
--- /dev/null
+++ b/assets/svg/wordpress/keyboard.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/language.svg b/assets/svg/wordpress/language.svg
new file mode 100644
index 0000000..f2c1364
--- /dev/null
+++ b/assets/svg/wordpress/language.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/level-up.svg b/assets/svg/wordpress/level-up.svg
new file mode 100644
index 0000000..158ae83
--- /dev/null
+++ b/assets/svg/wordpress/level-up.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/lifesaver.svg b/assets/svg/wordpress/lifesaver.svg
index 8c6f540..1d77b2a 100644
--- a/assets/svg/wordpress/lifesaver.svg
+++ b/assets/svg/wordpress/lifesaver.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/line-dashed.svg b/assets/svg/wordpress/line-dashed.svg
index ce4ab82..160acc5 100644
--- a/assets/svg/wordpress/line-dashed.svg
+++ b/assets/svg/wordpress/line-dashed.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/line-dotted.svg b/assets/svg/wordpress/line-dotted.svg
index 1c3730c..16b1679 100644
--- a/assets/svg/wordpress/line-dotted.svg
+++ b/assets/svg/wordpress/line-dotted.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/line-solid.svg b/assets/svg/wordpress/line-solid.svg
index e9add27..0b5ec3a 100644
--- a/assets/svg/wordpress/line-solid.svg
+++ b/assets/svg/wordpress/line-solid.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/link-off.svg b/assets/svg/wordpress/link-off.svg
index ac22a5d..b4b4406 100644
--- a/assets/svg/wordpress/link-off.svg
+++ b/assets/svg/wordpress/link-off.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/link.svg b/assets/svg/wordpress/link.svg
index 0a26598..722e4a3 100644
--- a/assets/svg/wordpress/link.svg
+++ b/assets/svg/wordpress/link.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/list-view.svg b/assets/svg/wordpress/list-view.svg
index aa333ca..18606ee 100644
--- a/assets/svg/wordpress/list-view.svg
+++ b/assets/svg/wordpress/list-view.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/list.svg b/assets/svg/wordpress/list.svg
index d65be10..285628f 100644
--- a/assets/svg/wordpress/list.svg
+++ b/assets/svg/wordpress/list.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/lock-outline.svg b/assets/svg/wordpress/lock-outline.svg
new file mode 100644
index 0000000..8ae9f29
--- /dev/null
+++ b/assets/svg/wordpress/lock-outline.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/lock-small.svg b/assets/svg/wordpress/lock-small.svg
new file mode 100644
index 0000000..5478e3d
--- /dev/null
+++ b/assets/svg/wordpress/lock-small.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/lock.svg b/assets/svg/wordpress/lock.svg
index 890e679..3b8ec5b 100644
--- a/assets/svg/wordpress/lock.svg
+++ b/assets/svg/wordpress/lock.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/loop.svg b/assets/svg/wordpress/loop.svg
index c8dc184..e1762c7 100644
--- a/assets/svg/wordpress/loop.svg
+++ b/assets/svg/wordpress/loop.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/mail.svg b/assets/svg/wordpress/mail.svg
new file mode 100644
index 0000000..545fa2e
--- /dev/null
+++ b/assets/svg/wordpress/mail.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/map-marker.svg b/assets/svg/wordpress/map-marker.svg
index 4f2a6df..0137920 100644
--- a/assets/svg/wordpress/map-marker.svg
+++ b/assets/svg/wordpress/map-marker.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/media-and-text.svg b/assets/svg/wordpress/media-and-text.svg
index 8a0fc81..a5f638f 100644
--- a/assets/svg/wordpress/media-and-text.svg
+++ b/assets/svg/wordpress/media-and-text.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/media.svg b/assets/svg/wordpress/media.svg
index c61710b..05b9733 100644
--- a/assets/svg/wordpress/media.svg
+++ b/assets/svg/wordpress/media.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/megaphone.svg b/assets/svg/wordpress/megaphone.svg
index 8289dd8..23f409f 100644
--- a/assets/svg/wordpress/megaphone.svg
+++ b/assets/svg/wordpress/megaphone.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/moon.svg b/assets/svg/wordpress/moon.svg
index 7bd6a05..d9958cc 100644
--- a/assets/svg/wordpress/moon.svg
+++ b/assets/svg/wordpress/moon.svg
@@ -1 +1,4 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/more-horizontal-mobile.svg b/assets/svg/wordpress/more-horizontal-mobile.svg
index dfcf56e..b26460e 100644
--- a/assets/svg/wordpress/more-horizontal-mobile.svg
+++ b/assets/svg/wordpress/more-horizontal-mobile.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/more.svg b/assets/svg/wordpress/more.svg
index 15bbdd9..cba194b 100644
--- a/assets/svg/wordpress/more.svg
+++ b/assets/svg/wordpress/more.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/navigation.svg b/assets/svg/wordpress/navigation.svg
index ea66464..ef77907 100644
--- a/assets/svg/wordpress/navigation.svg
+++ b/assets/svg/wordpress/navigation.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/page-break.svg b/assets/svg/wordpress/page-break.svg
index 454b247..a189e50 100644
--- a/assets/svg/wordpress/page-break.svg
+++ b/assets/svg/wordpress/page-break.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/paragraph.svg b/assets/svg/wordpress/paragraph.svg
index 6986e7a..74611fa 100644
--- a/assets/svg/wordpress/paragraph.svg
+++ b/assets/svg/wordpress/paragraph.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/payment.svg b/assets/svg/wordpress/payment.svg
index c58cbb0..cc903b2 100644
--- a/assets/svg/wordpress/payment.svg
+++ b/assets/svg/wordpress/payment.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/pencil.svg b/assets/svg/wordpress/pencil.svg
index afa2f56..b8359b7 100644
--- a/assets/svg/wordpress/pencil.svg
+++ b/assets/svg/wordpress/pencil.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/people.svg b/assets/svg/wordpress/people.svg
index 9768c2d..09ca11e 100644
--- a/assets/svg/wordpress/people.svg
+++ b/assets/svg/wordpress/people.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/percent.svg b/assets/svg/wordpress/percent.svg
index d0c3fc0..3e37c62 100644
--- a/assets/svg/wordpress/percent.svg
+++ b/assets/svg/wordpress/percent.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/pin-small.svg b/assets/svg/wordpress/pin-small.svg
new file mode 100644
index 0000000..3269ad6
--- /dev/null
+++ b/assets/svg/wordpress/pin-small.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/position-center.svg b/assets/svg/wordpress/position-center.svg
index 9db4aea..a02481b 100644
--- a/assets/svg/wordpress/position-center.svg
+++ b/assets/svg/wordpress/position-center.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/position-left.svg b/assets/svg/wordpress/position-left.svg
index e1af237..71cc447 100644
--- a/assets/svg/wordpress/position-left.svg
+++ b/assets/svg/wordpress/position-left.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/position-right.svg b/assets/svg/wordpress/position-right.svg
index 5526526..689f2e8 100644
--- a/assets/svg/wordpress/position-right.svg
+++ b/assets/svg/wordpress/position-right.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/post-author.svg b/assets/svg/wordpress/post-author.svg
index 0b481d0..217f0f0 100644
--- a/assets/svg/wordpress/post-author.svg
+++ b/assets/svg/wordpress/post-author.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/post-categories.svg b/assets/svg/wordpress/post-categories.svg
index 7fd7569..e347d6b 100644
--- a/assets/svg/wordpress/post-categories.svg
+++ b/assets/svg/wordpress/post-categories.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/post-content.svg b/assets/svg/wordpress/post-content.svg
index 10552ac..0cf72c7 100644
--- a/assets/svg/wordpress/post-content.svg
+++ b/assets/svg/wordpress/post-content.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/post-list.svg b/assets/svg/wordpress/post-list.svg
index a0a774f..890da3a 100644
--- a/assets/svg/wordpress/post-list.svg
+++ b/assets/svg/wordpress/post-list.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/post-terms.svg b/assets/svg/wordpress/post-terms.svg
index 3a85e10..2d899aa 100644
--- a/assets/svg/wordpress/post-terms.svg
+++ b/assets/svg/wordpress/post-terms.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/preformatted.svg b/assets/svg/wordpress/preformatted.svg
index 010644c..662d8d0 100644
--- a/assets/svg/wordpress/preformatted.svg
+++ b/assets/svg/wordpress/preformatted.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/pullquote.svg b/assets/svg/wordpress/pullquote.svg
index 6e8d97c..38369bc 100644
--- a/assets/svg/wordpress/pullquote.svg
+++ b/assets/svg/wordpress/pullquote.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/quote.svg b/assets/svg/wordpress/quote.svg
index 66cb9bf..1faf87e 100644
--- a/assets/svg/wordpress/quote.svg
+++ b/assets/svg/wordpress/quote.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/receipt.svg b/assets/svg/wordpress/receipt.svg
index baff282..dd3cc10 100644
--- a/assets/svg/wordpress/receipt.svg
+++ b/assets/svg/wordpress/receipt.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/remove-bug.svg b/assets/svg/wordpress/remove-bug.svg
index 6f372f0..f3202e0 100644
--- a/assets/svg/wordpress/remove-bug.svg
+++ b/assets/svg/wordpress/remove-bug.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/remove-submenu.svg b/assets/svg/wordpress/remove-submenu.svg
index c9b5f28..fa3a94e 100644
--- a/assets/svg/wordpress/remove-submenu.svg
+++ b/assets/svg/wordpress/remove-submenu.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/resize-corner-n-e.svg b/assets/svg/wordpress/resize-corner-n-e.svg
index 4edcac9..d35151a 100644
--- a/assets/svg/wordpress/resize-corner-n-e.svg
+++ b/assets/svg/wordpress/resize-corner-n-e.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/row.svg b/assets/svg/wordpress/row.svg
index 45eb057..42ddecc 100644
--- a/assets/svg/wordpress/row.svg
+++ b/assets/svg/wordpress/row.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/search.svg b/assets/svg/wordpress/search.svg
index 637c28b..873323f 100644
--- a/assets/svg/wordpress/search.svg
+++ b/assets/svg/wordpress/search.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/seen.svg b/assets/svg/wordpress/seen.svg
new file mode 100644
index 0000000..fd9a4e6
--- /dev/null
+++ b/assets/svg/wordpress/seen.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/separator.svg b/assets/svg/wordpress/separator.svg
index 2b119c2..1f81182 100644
--- a/assets/svg/wordpress/separator.svg
+++ b/assets/svg/wordpress/separator.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/settings.svg b/assets/svg/wordpress/settings.svg
index de7dcb1..ed6b2a3 100644
--- a/assets/svg/wordpress/settings.svg
+++ b/assets/svg/wordpress/settings.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/shadow.svg b/assets/svg/wordpress/shadow.svg
new file mode 100644
index 0000000..8d6c5b0
--- /dev/null
+++ b/assets/svg/wordpress/shadow.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/share.svg b/assets/svg/wordpress/share.svg
index 43963fd..8952b8a 100644
--- a/assets/svg/wordpress/share.svg
+++ b/assets/svg/wordpress/share.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/shield.svg b/assets/svg/wordpress/shield.svg
index 071c619..871125f 100644
--- a/assets/svg/wordpress/shield.svg
+++ b/assets/svg/wordpress/shield.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/shortcode.svg b/assets/svg/wordpress/shortcode.svg
index 4e356c5..657b2dc 100644
--- a/assets/svg/wordpress/shortcode.svg
+++ b/assets/svg/wordpress/shortcode.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/shuffle.svg b/assets/svg/wordpress/shuffle.svg
new file mode 100644
index 0000000..65b53d4
--- /dev/null
+++ b/assets/svg/wordpress/shuffle.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sides-all.svg b/assets/svg/wordpress/sides-all.svg
new file mode 100644
index 0000000..c38dec3
--- /dev/null
+++ b/assets/svg/wordpress/sides-all.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sides-axial.svg b/assets/svg/wordpress/sides-axial.svg
new file mode 100644
index 0000000..3f3040a
--- /dev/null
+++ b/assets/svg/wordpress/sides-axial.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sides-bottom.svg b/assets/svg/wordpress/sides-bottom.svg
new file mode 100644
index 0000000..4443da0
--- /dev/null
+++ b/assets/svg/wordpress/sides-bottom.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sides-horizontal.svg b/assets/svg/wordpress/sides-horizontal.svg
new file mode 100644
index 0000000..8860ee1
--- /dev/null
+++ b/assets/svg/wordpress/sides-horizontal.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sides-left.svg b/assets/svg/wordpress/sides-left.svg
new file mode 100644
index 0000000..7fd5d16
--- /dev/null
+++ b/assets/svg/wordpress/sides-left.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sides-right.svg b/assets/svg/wordpress/sides-right.svg
new file mode 100644
index 0000000..533bd97
--- /dev/null
+++ b/assets/svg/wordpress/sides-right.svg
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sides-top.svg b/assets/svg/wordpress/sides-top.svg
new file mode 100644
index 0000000..3542776
--- /dev/null
+++ b/assets/svg/wordpress/sides-top.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sides-vertical.svg b/assets/svg/wordpress/sides-vertical.svg
new file mode 100644
index 0000000..5b9dfb0
--- /dev/null
+++ b/assets/svg/wordpress/sides-vertical.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/slide.svg b/assets/svg/wordpress/slide.svg
new file mode 100644
index 0000000..7bb66ee
--- /dev/null
+++ b/assets/svg/wordpress/slide.svg
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/slider.svg b/assets/svg/wordpress/slider.svg
new file mode 100644
index 0000000..78678dc
--- /dev/null
+++ b/assets/svg/wordpress/slider.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/stack.svg b/assets/svg/wordpress/stack.svg
index 8e90918..7824a88 100644
--- a/assets/svg/wordpress/stack.svg
+++ b/assets/svg/wordpress/stack.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/star-empty.svg b/assets/svg/wordpress/star-empty.svg
index fad4eeb..266ffbb 100644
--- a/assets/svg/wordpress/star-empty.svg
+++ b/assets/svg/wordpress/star-empty.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/store.svg b/assets/svg/wordpress/store.svg
index 5d40bd4..8f993f6 100644
--- a/assets/svg/wordpress/store.svg
+++ b/assets/svg/wordpress/store.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/stretch-full-width.svg b/assets/svg/wordpress/stretch-full-width.svg
index cb3766a..d0d5bdc 100644
--- a/assets/svg/wordpress/stretch-full-width.svg
+++ b/assets/svg/wordpress/stretch-full-width.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/stretch-wide.svg b/assets/svg/wordpress/stretch-wide.svg
index f6634af..cde206d 100644
--- a/assets/svg/wordpress/stretch-wide.svg
+++ b/assets/svg/wordpress/stretch-wide.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/styles.svg b/assets/svg/wordpress/styles.svg
index 65f99e4..0b2a543 100644
--- a/assets/svg/wordpress/styles.svg
+++ b/assets/svg/wordpress/styles.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/sun.svg b/assets/svg/wordpress/sun.svg
index a723be4..af3257e 100644
--- a/assets/svg/wordpress/sun.svg
+++ b/assets/svg/wordpress/sun.svg
@@ -1 +1,4 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/tabs-vertical.svg b/assets/svg/wordpress/tabs-vertical.svg
new file mode 100644
index 0000000..2c777b5
--- /dev/null
+++ b/assets/svg/wordpress/tabs-vertical.svg
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/tabs.svg b/assets/svg/wordpress/tabs.svg
new file mode 100644
index 0000000..c08f75f
--- /dev/null
+++ b/assets/svg/wordpress/tabs.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/text-horizontal.svg b/assets/svg/wordpress/text-horizontal.svg
new file mode 100644
index 0000000..9b57728
--- /dev/null
+++ b/assets/svg/wordpress/text-horizontal.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/text-vertical.svg b/assets/svg/wordpress/text-vertical.svg
new file mode 100644
index 0000000..7380e78
--- /dev/null
+++ b/assets/svg/wordpress/text-vertical.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/title.svg b/assets/svg/wordpress/title.svg
index 6ce631a..8ced29e 100644
--- a/assets/svg/wordpress/title.svg
+++ b/assets/svg/wordpress/title.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/unlock.svg b/assets/svg/wordpress/unlock.svg
index caf5571..c5bce47 100644
--- a/assets/svg/wordpress/unlock.svg
+++ b/assets/svg/wordpress/unlock.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/unseen.svg b/assets/svg/wordpress/unseen.svg
new file mode 100644
index 0000000..524ac92
--- /dev/null
+++ b/assets/svg/wordpress/unseen.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/update.svg b/assets/svg/wordpress/update.svg
index 14c7d33..5994444 100644
--- a/assets/svg/wordpress/update.svg
+++ b/assets/svg/wordpress/update.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/verse.svg b/assets/svg/wordpress/verse.svg
index 1fbb346..9c4d63a 100644
--- a/assets/svg/wordpress/verse.svg
+++ b/assets/svg/wordpress/verse.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/svg/wordpress/video.svg b/assets/svg/wordpress/video.svg
index 20b7d9f..c61710b 100644
--- a/assets/svg/wordpress/video.svg
+++ b/assets/svg/wordpress/video.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/composer.json b/composer.json
index a5aea41..82299e5 100644
--- a/composer.json
+++ b/composer.json
@@ -2,23 +2,36 @@
"name": "blockify/theme",
"description": "Blockify WordPress Theme",
"license": "GPL-2.0-or-later",
+ "type": "library",
+ "homepage": "https://wordpress.org/themes/blockify/",
+ "support": {
+ "issues": "https://github.com/blockifywp/theme/issues"
+ },
+ "keywords": [
+ "blockify",
+ "theme",
+ "wordpress",
+ "fse",
+ "blocks",
+ "wp"
+ ],
"authors": [
{
"name": "Blockify",
- "email": "info@blockifytheme.com"
+ "homepage": "https://blockifywp.com"
}
],
- "type": "wordpress-theme",
+ "minimum-stability": "dev",
"scripts": {
"install:dev": "@composer update",
"install:prod": "@composer update --no-dev",
"install:cs": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run",
+ "install:pest": "pest --init",
"phpcs": "phpcs -s",
"phpcbf": "phpcbf",
"phpstan": "phpstan --memory-limit=1G",
"pest": "pest"
},
- "minimum-stability": "dev",
"config": {
"allow-plugins": {
"composer/installers": true,
@@ -33,7 +46,8 @@
"require-dev": {
"composer/installers": "^1.5 || ^2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
- "dingo-d/wp-pest-integration-test-setup": "dev-main",
+ "dingo-d/wp-pest": "dev-main",
+ "mockery/mockery": "^1.6@dev",
"php-parallel-lint/php-parallel-lint": "^1.3",
"szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "dev-master",
"szepeviktor/phpstan-wordpress": "^1.1",
diff --git a/functions.php b/functions.php
index 1a92dc6..4c6b9be 100644
--- a/functions.php
+++ b/functions.php
@@ -4,10 +4,10 @@
namespace Blockify\Theme;
-use const DIRECTORY_SEPARATOR;
use function add_action;
use function function_exists;
use function is_readable;
+use const DIRECTORY_SEPARATOR;
const NS = __NAMESPACE__ . '\\';
const DS = DIRECTORY_SEPARATOR;
@@ -26,55 +26,69 @@
*/
function setup(): void {
$files = [
+ 'utility/array',
'utility/color',
'utility/css',
'utility/dom',
- 'utility/helper',
'utility/icon',
+ 'utility/image',
'utility/string',
+ 'utility/theme',
+ 'api/block-extensions',
+ 'api/block-styles',
+ 'api/block-supports',
'extensions/animation',
- 'extensions/block-extras',
- 'extensions/block-styles',
- 'extensions/block-supports',
- 'extensions/box-shadow',
- 'extensions/conic-gradient',
'extensions/counter',
+ 'extensions/copy-to-clipboard',
'extensions/dark-mode',
+ 'extensions/gradient',
+ 'extensions/grid',
'extensions/icon',
'extensions/inline-color',
'extensions/onclick',
'extensions/placeholder',
+ 'extensions/shadow',
'extensions/svg',
- 'fonts',
- 'patterns',
- 'scripts',
- 'styles',
+ 'extensions/template-tags',
+ 'common/fonts',
+ 'common/patterns',
+ 'common/scripts',
+ 'common/styles',
+ 'common/templates',
+ 'blocks/avatar',
'blocks/button',
+ 'blocks/buttons',
+ 'blocks/calendar',
+ 'blocks/code',
'blocks/columns',
'blocks/cover',
+ 'blocks/details',
'blocks/group',
'blocks/heading',
'blocks/image',
'blocks/list',
- 'blocks/navigation-submenu',
'blocks/navigation',
'blocks/page-list',
+ 'blocks/pagination',
'blocks/paragraph',
+ 'blocks/pattern',
'blocks/post-author',
'blocks/post-comments-form',
'blocks/post-content',
'blocks/post-date',
'blocks/post-excerpt',
'blocks/post-featured-image',
+ 'blocks/post-template',
'blocks/post-terms',
'blocks/post-title',
'blocks/query-pagination',
'blocks/query-title',
'blocks/query',
'blocks/search',
- 'blocks/site-logo',
+ 'blocks/shortcode',
'blocks/social-link',
'blocks/social-links',
+ 'blocks/spacer',
'blocks/table-of-contents',
'blocks/tag-cloud',
'blocks/template-part',
diff --git a/includes/api/block-extensions.php b/includes/api/block-extensions.php
new file mode 100644
index 0000000..148fd30
--- /dev/null
+++ b/includes/api/block-extensions.php
@@ -0,0 +1,798 @@
+ [
+ 'property' => 'position',
+ 'label' => __( 'Position', 'blockify' ),
+ 'options' => [
+ [
+ 'label' => '',
+ 'value' => '',
+ ],
+ [
+ 'label' => __( 'Relative', 'blockify' ),
+ 'value' => 'relative',
+ ],
+ [
+ 'label' => __( 'Absolute', 'blockify' ),
+ 'value' => 'absolute',
+ ],
+ [
+ 'label' => __( 'Sticky', 'blockify' ),
+ 'value' => 'sticky',
+ ],
+ [
+ 'label' => __( 'Fixed', 'blockify' ),
+ 'value' => 'fixed',
+ ],
+ [
+ 'label' => __( 'Static', 'blockify' ),
+ 'value' => 'static',
+ ],
+ ],
+ ],
+ 'top' => [
+ 'property' => 'top',
+ 'label' => __( 'Top', 'blockify' ),
+ ],
+ 'right' => [
+ 'property' => 'right',
+ 'label' => __( 'Right', 'blockify' ),
+ ],
+ 'bottom' => [
+ 'property' => 'bottom',
+ 'label' => __( 'Bottom', 'blockify' ),
+ ],
+ 'left' => [
+ 'property' => 'left',
+ 'label' => __( 'Left', 'blockify' ),
+ ],
+ 'zIndex' => [
+ 'property' => 'z-index',
+ 'label' => __( 'Z-Index', 'blockify' ),
+ ],
+ 'display' => [
+ 'property' => 'display',
+ 'label' => __( 'Display', 'blockify' ),
+ 'options' => [
+ [
+ 'label' => '',
+ 'value' => '',
+ ],
+ [
+ 'label' => __( 'None', 'blockify' ),
+ 'value' => 'none',
+ ],
+ [
+ 'label' => __( 'Flex', 'blockify' ),
+ 'value' => 'flex',
+ ],
+ [
+ 'label' => __( 'Inline Flex', 'blockify' ),
+ 'value' => 'inline-flex',
+ ],
+ [
+ 'label' => __( 'Block', 'blockify' ),
+ 'value' => 'block',
+ ],
+ [
+ 'label' => __( 'Inline Block', 'blockify' ),
+ 'value' => 'inline-block',
+ ],
+ [
+ 'label' => __( 'Inline', 'blockify' ),
+ 'value' => 'inline',
+ ],
+ [
+ 'label' => __( 'Grid', 'blockify' ),
+ 'value' => 'grid',
+ ],
+ [
+ 'label' => __( 'Inline Grid', 'blockify' ),
+ 'value' => 'inline-grid',
+ ],
+ [
+ 'label' => __( 'Contents', 'blockify' ),
+ 'value' => 'contents',
+ ],
+ ],
+ ],
+ 'order' => [
+ 'property' => 'order',
+ 'label' => __( 'Order', 'blockify' ),
+ ],
+ 'gridTemplateColumns' => [
+ 'property' => 'grid-template-columns',
+ 'label' => __( 'Columns', 'blockify' ),
+ ],
+ 'gridTemplateRows' => [
+ 'property' => 'grid-template-rows',
+ 'label' => __( 'Rows', 'blockify' ),
+ ],
+ 'gridColumnStart' => [
+ 'property' => 'grid-column-start',
+ 'label' => __( 'Column Start', 'blockify' ),
+ ],
+ 'gridColumnEnd' => [
+ 'property' => 'grid-column-end',
+ 'label' => __( 'Column End', 'blockify' ),
+ ],
+ 'gridRowStart' => [
+ 'property' => 'grid-row-start',
+ 'label' => __( 'Row Start', 'blockify' ),
+ ],
+ 'gridRowEnd' => [
+ 'property' => 'grid-row-end',
+ 'label' => __( 'Row End', 'blockify' ),
+ ],
+ 'overflow' => [
+ 'property' => 'overflow',
+ 'label' => __( 'Overflow', 'blockify' ),
+ 'options' => [
+ [
+ 'label' => '',
+ 'value' => '',
+ ],
+ [
+ 'label' => __( 'Hidden', 'blockify' ),
+ 'value' => 'hidden',
+ ],
+ [
+ 'label' => __( 'Visible', 'blockify' ),
+ 'value' => 'visible',
+ ],
+ ],
+ ],
+ 'pointerEvents' => [
+ 'property' => 'pointer-events',
+ 'label' => __( 'Pointer Events', 'blockify' ),
+ 'options' => [
+ [
+ 'label' => '',
+ 'value' => '',
+ ],
+ [
+ 'label' => __( 'None', 'blockify' ),
+ 'value' => 'none',
+ ],
+ [
+ 'label' => __( 'All', 'blockify' ),
+ 'value' => 'all',
+ ],
+ ],
+ ],
+ 'width' => [
+ 'property' => 'width',
+ 'label' => __( 'Width', 'blockify' ),
+ ],
+ 'minWidth' => [
+ 'property' => 'min-width',
+ 'label' => __( 'Min Width', 'blockify' ),
+ ],
+ 'maxWidth' => [
+ 'property' => 'max-width',
+ 'label' => __( 'Max Width', 'blockify' ),
+ ],
+ ];
+}
+
+/**
+ * Returns the filter options.
+ *
+ * @since 1.3.0
+ *
+ * @return array
+ */
+function get_filter_options(): array {
+ return [
+ 'blur' => [
+ 'unit' => 'px',
+ 'min' => 0,
+ 'max' => 500,
+ ],
+ 'brightness' => [
+ 'unit' => '%',
+ 'min' => 0,
+ 'max' => 360,
+ ],
+ 'contrast' => [
+ 'unit' => '%',
+ 'min' => 0,
+ 'max' => 200,
+ ],
+ 'grayscale' => [
+ 'unit' => '%',
+ 'min' => 0,
+ 'max' => 100,
+ ],
+ 'hueRotate' => [
+ 'unit' => 'deg',
+ 'min' => -360,
+ 'max' => 360,
+ ],
+ 'invert' => [
+ 'unit' => '%',
+ 'min' => 0,
+ 'max' => 100,
+ ],
+ 'opacity' => [
+ 'unit' => '%',
+ 'min' => 0,
+ 'max' => 100,
+ ],
+ 'saturate' => [
+ 'unit' => '',
+ 'min' => 0,
+ 'max' => 100,
+ 'step' => 0.1,
+ ],
+ 'sepia' => [
+ 'unit' => '%',
+ 'min' => 0,
+ 'max' => 100,
+ ],
+ ];
+}
+
+/**
+ * Get the image options.
+ *
+ * @since 1.3.0
+ *
+ * @return array
+ */
+function get_image_options(): array {
+ return [
+ 'aspectRatio' => [
+ 'property' => 'aspect-ratio',
+ 'label' => __( 'Aspect Ratio', 'blockify' ),
+ 'options' => [
+ [
+ 'label' => '',
+ 'value' => '',
+ ],
+ [
+ 'label' => '1/1',
+ 'value' => '1/1',
+ ],
+ [
+ 'label' => '1/2',
+ 'value' => '1/2',
+ ],
+ [
+ 'label' => '1/3',
+ 'value' => '1/3',
+ ],
+ [
+ 'label' => '2/1',
+ 'value' => '2/1',
+ ],
+ [
+ 'label' => '2/3',
+ 'value' => '2/3',
+ ],
+ [
+ 'label' => '3/1',
+ 'value' => '3/1',
+ ],
+ [
+ 'label' => '3/2',
+ 'value' => '3/2',
+ ],
+ [
+ 'label' => '3/4',
+ 'value' => '3/4',
+ ],
+ [
+ 'label' => '4/3',
+ 'value' => '4/3',
+ ],
+ [
+ 'label' => '4/5',
+ 'value' => '4/5',
+ ],
+ [
+ 'label' => '5/2',
+ 'value' => '5/2',
+ ],
+ [
+ 'label' => '5/4',
+ 'value' => '5/4',
+ ],
+ [
+ 'label' => '9/16',
+ 'value' => '9/16',
+ ],
+ [
+ 'label' => '16/9',
+ 'value' => '16/9',
+ ],
+ ],
+ ],
+ 'height' => [
+ 'property' => 'height',
+ 'label' => __( 'Height', 'blockify' ),
+ ],
+ 'objectFit' => [
+ 'property' => 'object-fit',
+ 'label' => __( 'Object Fit', 'blockify' ),
+ 'options' => [
+ [
+ 'label' => '',
+ 'value' => '',
+ ],
+ [
+ 'label' => __( 'Fill', 'blockify' ),
+ 'value' => 'fill',
+ ],
+ [
+ 'label' => __( 'Contain', 'blockify' ),
+ 'value' => 'contain',
+ ],
+ [
+ 'label' => __( 'Cover', 'blockify' ),
+ 'value' => 'cover',
+ ],
+ [
+ 'label' => __( 'None', 'blockify' ),
+ 'value' => 'none',
+ ],
+ [
+ 'label' => __( 'Scale Down', 'blockify' ),
+ 'value' => 'scale-down',
+ ],
+ ],
+ ],
+ 'objectPosition' => [
+ 'property' => 'object-position',
+ 'label' => __( 'Object Position', 'blockify' ),
+ 'options' => [
+ [
+ 'label' => '',
+ 'value' => '',
+ ],
+ [
+ 'label' => __( 'Top', 'blockify' ),
+ 'value' => 'top',
+ ],
+ [
+ 'label' => __( 'Top Right', 'blockify' ),
+ 'value' => 'top right',
+ ],
+ [
+ 'label' => __( 'Right', 'blockify' ),
+ 'value' => 'right',
+ ],
+ [
+ 'label' => __( 'Bottom Right', 'blockify' ),
+ 'value' => 'bottom right',
+ ],
+ [
+ 'label' => __( 'Bottom', 'blockify' ),
+ 'value' => 'bottom',
+ ],
+ [
+ 'label' => __( 'Bottom Left', 'blockify' ),
+ 'value' => 'bottom left',
+ ],
+ [
+ 'label' => __( 'Left', 'blockify' ),
+ 'value' => 'left',
+ ],
+ [
+ 'label' => __( 'Top Left', 'blockify' ),
+ 'value' => 'top left',
+ ],
+ [
+ 'label' => __( 'Center', 'blockify' ),
+ 'value' => 'center',
+ ],
+ [
+ 'label' => __( 'None', 'blockify' ),
+ 'value' => 'none',
+ ],
+ ],
+ ],
+ ];
+}
+
+add_filter( 'blockify_editor_data', NS . 'register_responsive_settings', 11 );
+/**
+ * Add default block supports.
+ *
+ * @since 0.9.10
+ *
+ * @param array $config Blockify editor config.
+ *
+ * @return array
+ */
+function register_responsive_settings( array $config = [] ): array {
+ $config['extensionOptions'] = get_block_extension_options();
+ $config['filterOptions'] = get_filter_options();
+ $config['imageOptions'] = get_image_options();
+
+ return $config;
+}
+
+add_filter( 'blockify_inline_css', NS . 'get_block_extra_styles', 11, 3 );
+/**
+ * Conditionally adds CSS for utility classes
+ *
+ * @since 0.9.19
+ *
+ * @param string $css Inline CSS.
+ * @param string $content Page Content.
+ * @param bool $all Is editor page.
+ *
+ * @return string
+ */
+function get_block_extra_styles( string $css, string $content, bool $all ): string {
+ $options = array_merge(
+ get_block_extension_options(),
+ get_image_options(),
+ );
+ $both = '';
+ $mobile = '';
+ $desktop = '';
+
+ foreach ( $options as $key => $args ) {
+ $property = _wp_to_kebab_case( $key );
+ $select_options = $args['options'] ?? [];
+
+ foreach ( $select_options as $option ) {
+ $value = $option['value'] ?? '';
+
+ if ( ! $value ) {
+ continue;
+ }
+
+ $formatted_value = $value;
+
+ if ( 'aspect-ratio' === $property ) {
+ $formatted_value = str_replace( '/', '\/', $formatted_value );
+ }
+
+ if ( $all || str_contains( $content, " has-{$property}-{$value}" ) ) {
+ $both .= sprintf(
+ '.has-%1$s-%3$s{%1$s:%2$s !important}',
+ $property,
+ $value,
+ $formatted_value,
+ );
+ }
+
+ if ( $all || str_contains( $content, " has-{$property}-{$value}-mobile" ) ) {
+ $mobile .= sprintf(
+ '.has-%1$s-%3$s-mobile{%1$s:%2$s !important}',
+ $property,
+ $value,
+ $formatted_value,
+ );
+ }
+
+ if ( $all || str_contains( $content, " has-{$property}-{$value}-desktop" ) ) {
+ $desktop .= sprintf(
+ '.has-%1$s-%3$s-desktop{%1$s:%2$s !important}',
+ $property,
+ $value,
+ $formatted_value,
+ );
+ }
+ }
+
+ // Has custom value.
+ if ( ! $select_options ) {
+
+ if ( $all || str_contains( $content, " has-$property" ) ) {
+ $both .= sprintf(
+ '.has-%1$s{%1$s:var(--%1$s)}',
+ $property
+ );
+ }
+
+ if ( $all || str_contains( $content, "--$property-mobile" ) ) {
+ $mobile .= sprintf(
+ '.has-%1$s{%1$s:var(--%1$s-mobile,var(--%1$s))}',
+ $property
+ );
+ }
+
+ if ( $all || str_contains( $content, "--$property-desktop" ) ) {
+ $desktop .= sprintf(
+ '.has-%1$s{%1$s:var(--%1$s-desktop,var(--%1$s))}',
+ $property
+ );
+ }
+ }
+ }
+
+ if ( $both ) {
+ $css .= $both;
+ }
+
+ if ( $mobile ) {
+ $css .= sprintf( '@media(max-width:781px){%s}', $mobile );
+ }
+
+ if ( $desktop ) {
+ $css .= sprintf( '@media(min-width:782px){%s}', $desktop );
+ }
+
+ return $css;
+}
+
+add_filter( 'render_block', NS . 'add_position_classes', 11, 2 );
+/**
+ * Adds inline block positioning classes.
+ *
+ * @since 1.0.0
+ *
+ * @param array $block Block data.
+ *
+ * @param string $html Block content.
+ *
+ * @return string
+ */
+function add_position_classes( string $html, array $block ): string {
+ $style = $block['attrs']['style'] ?? [];
+
+ if ( ! $style ) {
+ return $html;
+ }
+
+ return add_responsive_classes(
+ $html,
+ $block,
+ get_block_extension_options()
+ );
+}
+
+/**
+ * Gets responsive classes for a given property.
+ *
+ * @since 1.0.0
+ *
+ * @param string $html HTML content.
+ * @param array $block Block data.
+ * @param array $options Block options.
+ * @param bool $image Is an image block.
+ *
+ * @return string
+ */
+function add_responsive_classes( string $html, array $block, array $options, bool $image = false ): string {
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
+
+ if ( ! $first ) {
+ return $html;
+ }
+
+ $element = $first;
+
+ if ( $image ) {
+ $link = get_dom_element( 'a', $first );
+ $element = $link ? get_dom_element( 'img', $link ) : get_dom_element( 'img', $first );
+ }
+
+ if ( ! $element ) {
+ return $html;
+ }
+
+ $style = $block['attrs']['style'] ?? [];
+ $classes = explode( ' ', $element->getAttribute( 'class' ) );
+
+ foreach ( $options as $key => $args ) {
+ if ( ! isset( $style[ $key ] ) || $style[ $key ] === '' ) {
+ continue;
+ }
+
+ $property = _wp_to_kebab_case( $key );
+
+ if ( isset( $args['options'] ) ) {
+ $both = $style[ $key ]['all'] ?? '';
+ $mobile = $style[ $key ]['mobile'] ?? '';
+ $desktop = $style[ $key ]['desktop'] ?? '';
+
+ if ( $both ) {
+ $classes[] = "has-{$property}-{$both}";
+ }
+
+ if ( $mobile ) {
+ $classes[] = "has-{$property}-{$mobile}-mobile";
+ }
+
+ if ( $desktop ) {
+ $classes[] = "has-{$property}-{$desktop}-desktop";
+ }
+ } else {
+ $classes[] = "has-{$property}";
+ }
+
+ $element->setAttribute( 'class', implode( ' ', $classes ) );
+
+ $html = $dom->saveHTML();
+ }
+
+ return $html;
+}
+
+add_filter( 'render_block', NS . 'add_position_styles', 11, 2 );
+/**
+ * Renders block inline positioning styles.
+ *
+ * @since 1.0.0
+ *
+ * @param array $block Block data.
+ *
+ * @param string $html Block HTML.
+ *
+ * @return string
+ */
+function add_position_styles( string $html, array $block ): string {
+ $style = $block['attrs']['style'] ?? [];
+
+ if ( ! $style ) {
+ return $html;
+ }
+
+ $options = get_block_extension_options();
+
+ foreach ( $options as $key => $args ) {
+
+ if ( ! isset( $style[ $key ] ) ) {
+ continue;
+ }
+
+ // Has utility class.
+ if ( isset( $args['options'] ) ) {
+ continue;
+ }
+
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
+
+ if ( ! $first ) {
+ continue;
+ }
+
+ $styles = css_string_to_array( $first->getAttribute( 'style' ) );
+ $property = _wp_to_kebab_case( $key );
+ $both = $style[ $key ]['all'] ?? '';
+ $mobile = $style[ $key ]['mobile'] ?? '';
+ $desktop = $style[ $key ]['desktop'] ?? '';
+
+ if ( $both ) {
+ $styles[ '--' . $property ] = $both;
+ }
+
+ if ( $mobile ) {
+ $styles[ '--' . $property . '-mobile' ] = $mobile;
+ }
+
+ if ( $desktop ) {
+ $styles[ '--' . $property . '-desktop' ] = $desktop;
+ }
+
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
+
+ $html = $dom->saveHTML();
+ }
+
+ return $html;
+}
+
+add_filter( 'render_block', NS . 'add_opacity_style', 12, 2 );
+/**
+ * Renders block opacity style.
+ *
+ * @since 1.0.0
+ *
+ * @param array $block Block data.
+ *
+ * @param string $html Block HTML.
+ *
+ * @return string
+ */
+function add_opacity_style( string $html, array $block ): string {
+ $opacity = $block['attrs']['style']['filter']['opacity'] ?? '';
+
+ if ( $opacity ) {
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
+
+ if ( ! $first ) {
+ return $html;
+ }
+
+ $styles = css_string_to_array( $first->getAttribute( 'style' ) );
+
+ //$styles['opacity'] = $opacity / 100;
+
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
+
+ $html = $dom->saveHTML();
+ }
+
+ return $html;
+}
+
+add_filter( 'render_block', NS . 'add_backdrop_blur', 12, 2 );
+/**
+ * Renders backdrop blur style.
+ *
+ * @since 1.0.0
+ *
+ * @param array $block Block data.
+ *
+ * @param string $html Block HTML.
+ *
+ * @return string
+ */
+function add_backdrop_blur( string $html, array $block ): string {
+ $blur = (string) ( $block['attrs']['style']['filter']['blur'] ?? '' );
+
+ if ( ! $blur ) {
+ return $html;
+ }
+
+ $use_backdrop = (string) ( $block['attrs']['style']['filter']['backdrop'] ?? '' );
+
+ if ( ! $use_backdrop ) {
+ return $html;
+ }
+
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
+
+ if ( ! $first ) {
+ return $html;
+ }
+
+ $styles = css_string_to_array( $first->getAttribute( 'style' ) );
+
+ $backdrop_blur = 'blur(' . $blur . 'px)';
+
+ unset( $styles['backdrop-filter'] );
+ unset( $styles['-webkit-backdrop-filter'] );
+
+ $styles['backdrop-filter'] = $backdrop_blur;
+ $styles['-webkit-backdrop-filter'] = $backdrop_blur;
+
+ $opacity = (int) ( $block['attrs']['style']['filter']['opacity'] ?? '' );
+
+ if ( $opacity ) {
+ $existing = $styles['filter'] ?? '';
+
+ if ( $existing ) {
+ $styles['filter'] = str_replace(
+ ' opacity(' . $opacity . '%)',
+ '',
+ $existing
+ );
+ }
+ }
+
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
+
+ return $dom->saveHTML();
+}
diff --git a/includes/api/block-styles.php b/includes/api/block-styles.php
new file mode 100644
index 0000000..59b75c7
--- /dev/null
+++ b/includes/api/block-styles.php
@@ -0,0 +1,114 @@
+ [ 'sub-heading' ],
+ 'core/buttons' => [ 'surface' ],
+ 'core/button' => [ 'ghost' ],
+ 'core/code' => [ 'surface' ],
+ 'core/columns' => [ 'surface' ],
+ 'core/column' => [ 'surface' ],
+ 'core/comment-author-name' => [ 'heading' ],
+ 'core/details' => [
+ [ 'summary-heading' => __( 'Heading', 'blockify' ) ],
+ ],
+ 'core/group' => [ 'surface' ],
+ 'core/list' => [ 'checklist', 'check-outline', 'check-circle', 'square', 'list-heading', 'dash', 'none' ],
+ 'core/list-item' => [ 'surface' ],
+ 'core/navigation' => [ 'heading' ],
+ 'core/page-list' => [ 'none' ],
+ 'core/paragraph' => [ 'sub-heading', 'notice', 'heading' ],
+ 'core/post-author-name' => [ 'heading' ],
+ 'core/post-terms' => [ 'list', 'sub-heading', 'badges' ],
+ 'core/post-title' => [ 'sub-heading' ],
+ 'core/query-pagination' => [ 'badges' ],
+ 'core/read-more' => [ 'button' ],
+ 'core/site-title' => [ 'heading' ],
+ 'core/spacer' => [ 'angle', 'curve', 'round', 'wave', 'fade' ],
+ 'core/tag-cloud' => [ 'badges' ],
+ 'core/quote' => [ 'surface' ],
+ ];
+
+ $global_settings = wp_get_global_settings();
+ $button_secondary = $global_settings['custom']['buttonSecondary'] ?? null;
+
+ if ( $button_secondary ) {
+ $register['core/button'][] = 'secondary';
+ }
+
+ $dark_mode = $global_settings['custom']['darkMode'] ?? null;
+ $light_mode = $global_settings['custom']['lightMode'] ?? null;
+
+ if ( $dark_mode || $light_mode ) {
+ $register['core/code'][] = 'light';
+ $register['core/code'][] = 'dark';
+ $register['core/column'][] = 'light';
+ $register['core/column'][] = 'dark';
+ $register['core/columns'][] = 'light';
+ $register['core/columns'][] = 'dark';
+ $register['core/group'][] = 'light';
+ $register['core/group'][] = 'dark';
+ }
+
+ // Values must be arrays.
+ $unregister = [
+ 'core/image' => [ 'rounded', 'default' ],
+ 'core/site-logo' => [ 'default', 'rounded' ],
+ 'core/separator' => [ 'wide', 'dots' ],
+ ];
+
+ $config['blockStyles'] = [
+ 'register' => $register,
+ 'unregister' => $unregister,
+ ];
+
+ return $config;
+}
+
+add_filter( 'render_block', NS . 'add_sub_heading_clip_text', 10, 2 );
+/**
+ * Add sub heading clip text.
+ *
+ * @since 1.3.2
+ *
+ * @param string $html Block HTML.
+ * @param array $block Block data.
+ *
+ * @return string
+ */
+function add_sub_heading_clip_text( string $html, array $block ): string {
+ $class_names = $block['attrs']['className'] ?? '';
+
+ if ( ! str_contains( $class_names, 'is-style-sub-heading' ) ) {
+ return $html;
+ }
+
+ $global_settings = wp_get_global_settings();
+ $background = $global_settings['custom']['subHeading']['background'] ?? '';
+
+ if ( ! str_contains( $background, 'gradient' ) ) {
+ return $html;
+ }
+
+ return str_replace( 'is-style-sub-heading', 'is-style-sub-heading has-text-gradient-background', $html );
+}
diff --git a/includes/extensions/block-supports.php b/includes/api/block-supports.php
similarity index 76%
rename from includes/extensions/block-supports.php
rename to includes/api/block-supports.php
index 102c5e7..1d6a17f 100644
--- a/includes/extensions/block-supports.php
+++ b/includes/api/block-supports.php
@@ -12,24 +12,32 @@
*
* @todo Move to rest settings.
*
- * @param array $config Blockify editor config.
- *
* @since 0.9.10
*
+ * @param array $data Blockify editor config.
+ *
* @return array
*/
-function register_block_supports( array $config = [] ): array {
- $config['blockSupports'] = [
- 'blockify/accordion' => [
+function register_block_supports( array $data = [] ): array {
+ $data['blockSupports'] = [
+ 'blockify/accordion' => [
'blockifyBoxShadow' => true,
],
- 'blockify/tabs' => [
+ 'blockify/edd-image-slider' => [
+ 'blockifyPosition' => true,
+ ],
+ 'blockify/post-content' => [
+ 'blockifyPosition' => true,
'blockifyBoxShadow' => true,
],
- 'blockify/slider' => [
+ 'blockify/template-part' => [
'blockifyPosition' => true,
],
- 'core/buttons' => [
+ 'core/block' => [
+ 'className' => true,
+ 'customClassName' => true,
+ ],
+ 'core/buttons' => [
'__experimentalBorder' => [
'radius' => true,
'width' => true,
@@ -50,10 +58,15 @@ function register_block_supports( array $config = [] ): array {
'margin' => true,
'blockGap' => true,
],
- 'blockifyPosition' => true,
'blockifyBoxShadow' => true,
+ 'blockifyPosition' => true,
],
- 'core/button' => [
+ 'core/button' => [
+ 'spacing' => [
+ 'margin' => true,
+ 'padding' => true,
+ 'blockGap' => true,
+ ],
'__experimentalBorder' => [
'radius' => true,
'width' => true,
@@ -64,16 +77,27 @@ function register_block_supports( array $config = [] ): array {
'color' => true,
],
],
+ '__experimentalLayout' => [
+ 'allowSwitching' => true,
+ 'allowEditing' => true,
+ 'allowInheriting' => true,
+ 'allowSizingOnChildren' => true,
+ 'allowVerticalAlignment' => true,
+ 'allowJustification' => true,
+ 'allowOrientation' => true,
+ ],
'blockifyBoxShadow' => true,
'blockifyOnclick' => true,
'blockifyPosition' => true,
+ 'blockifySize' => true,
+ 'blockifyIcon' => true,
],
- 'core/code' => [
+ 'core/code' => [
'blockifyBoxShadow' => true,
'blockifyPosition' => true,
'blockifyTransform' => true,
],
- 'core/column' => [
+ 'core/column' => [
'spacing' => [
'padding' => true,
'margin' => true,
@@ -96,7 +120,7 @@ function register_block_supports( array $config = [] ): array {
'blockifyPosition' => true,
'blockifyNegativeMargin' => true,
],
- 'core/columns' => [
+ 'core/columns' => [
'typography' => [
'fontSize' => true,
'fontWeight' => true,
@@ -109,7 +133,27 @@ function register_block_supports( array $config = [] ): array {
'blockifyFilter' => true,
'blockifyOnclick' => true,
],
- 'core/cover' => [
+ 'core/cover' => [
+ 'color' => [
+ 'background' => true,
+ 'gradients' => true,
+ 'text' => true,
+ 'link' => true,
+ 'overlay' => true,
+ ],
+ '__experimentalBorder' => [
+ 'radius' => true,
+ 'width' => true,
+ 'color' => true,
+ 'style' => true,
+ '__experimentalDefaultControls' => [
+ 'width' => true,
+ 'color' => true,
+ ],
+ ],
+ 'blockifyPosition' => true,
+ ],
+ 'core/details' => [
'__experimentalBorder' => [
'radius' => true,
'width' => true,
@@ -120,9 +164,10 @@ function register_block_supports( array $config = [] ): array {
'color' => true,
],
],
+ 'blockifyBoxShadow' => true,
'blockifyPosition' => true,
],
- 'core/embed' => [
+ 'core/embed' => [
'spacing' => [
'margin' => true,
],
@@ -137,12 +182,12 @@ function register_block_supports( array $config = [] ): array {
],
],
],
- 'core/gallery' => [
+ 'core/gallery' => [
'spacing' => [
'margin' => true,
],
],
- 'core/group' => [
+ 'core/group' => [
'blockifyAnimation' => true,
'blockifyBackground' => true,
'blockifyBoxShadow' => true,
@@ -153,7 +198,7 @@ function register_block_supports( array $config = [] ): array {
'blockifyDarkMode' => true,
'blockifyPosition' => true,
],
- 'core/heading' => [
+ 'core/heading' => [
'align' => [
'full',
'wide',
@@ -177,7 +222,7 @@ function register_block_supports( array $config = [] ): array {
'blockifyTransform' => true,
'blockifyFilter' => true,
],
- 'core/html' => [
+ 'core/html' => [
'color' => [
'background' => true,
'text' => true,
@@ -188,7 +233,7 @@ function register_block_supports( array $config = [] ): array {
'blockifyTransform' => true,
'blockifyFilter' => true,
],
- 'core/image' => [
+ 'core/image' => [
'__experimentalBorder' => [
'radius' => true,
'width' => true,
@@ -221,7 +266,7 @@ function register_block_supports( array $config = [] ): array {
'blockifyTransform' => true,
'blockifyOnclick' => true,
],
- 'core/list' => [
+ 'core/list' => [
'spacing' => [
'padding' => true,
'margin' => true,
@@ -248,7 +293,7 @@ function register_block_supports( array $config = [] ): array {
'blockifyPosition' => true,
'blockifyShadow' => true,
],
- 'core/list-item' => [
+ 'core/list-item' => [
'color' => [
'text' => true,
'background' => true,
@@ -271,7 +316,7 @@ function register_block_supports( array $config = [] ): array {
],
'blockifyBoxShadow' => true,
],
- 'core/media-text' => [
+ 'core/media-text' => [
'__experimentalBorder' => [
'radius' => true,
],
@@ -280,33 +325,54 @@ function register_block_supports( array $config = [] ): array {
],
'blockifyPosition' => true,
],
- 'core/navigation' => [
- 'spacing' => [
+ 'core/navigation' => [
+ 'spacing' => [
'margin' => true,
'padding' => true,
'blockGap' => true,
],
- 'blockifyPosition' => true,
+ '__experimentalBorder' => [
+ 'radius' => true,
+ 'width' => true,
+ 'color' => false,
+ 'style' => true,
+ '__experimentalDefaultControls' => [
+ 'width' => true,
+ 'color' => true,
+ ],
+ ],
+ 'blockifyPosition' => true,
+ 'blockifyFilter' => true,
],
- 'core/navigation-submenu' => [
- 'spacing' => [
+ 'core/navigation-submenu' => [
+ 'spacing' => [
'margin' => true,
'padding' => true,
'blockGap' => true,
],
- 'color' => [
+ 'color' => [
'background' => true,
'gradients' => true,
'link' => true,
'text' => true,
],
+ '__experimentalBorder' => [
+ 'radius' => true,
+ 'width' => true,
+ 'color' => false,
+ 'style' => true,
+ '__experimentalDefaultControls' => [
+ 'width' => true,
+ 'color' => true,
+ ],
+ ],
],
- 'core/page-list' => [
+ 'core/page-list' => [
'spacing' => [
'blockGap' => true,
],
],
- 'core/paragraph' => [
+ 'core/paragraph' => [
'align' => [
'full',
'wide',
@@ -343,7 +409,10 @@ function register_block_supports( array $config = [] ): array {
'blockifyTransform' => true,
'blockifyFilter' => true,
],
- 'core/post-content' => [
+ 'core/pattern' => [
+ 'className' => true,
+ ],
+ 'core/post-content' => [
'align' => [
'full',
'wide',
@@ -358,7 +427,10 @@ function register_block_supports( array $config = [] ): array {
'padding' => true,
],
],
- 'core/post-author' => [
+ 'core/post-author' => [
+ 'spacing' => [
+ 'blockGap' => true,
+ ],
// Border applied to avatar.
'__experimentalBorder' => [
'radius' => true,
@@ -371,7 +443,7 @@ function register_block_supports( array $config = [] ): array {
],
],
],
- 'core/post-excerpt' => [
+ 'core/post-excerpt' => [
'__experimentalLayout' => [
'allowSwitching' => false,
'allowInheriting' => false,
@@ -380,12 +452,12 @@ function register_block_supports( array $config = [] ): array {
],
],
],
- 'core/post-date' => [
+ 'core/post-date' => [
'spacing' => [
'margin' => true,
],
],
- 'core/post-featured-image' => [
+ 'core/post-featured-image' => [
'align' => [
'full',
'wide',
@@ -403,13 +475,12 @@ function register_block_supports( array $config = [] ): array {
'padding' => true,
],
'blockifyBoxShadow' => true,
+ 'blockifyFilter' => true,
'blockifyPosition' => true,
+ 'blockifyTransform' => true,
],
- 'core/post-template' => [
- 'spacing' => [],
- ],
- 'core/post-terms' => [
- 'align' => [
+ 'core/post-terms' => [
+ 'align' => [
'full',
'wide',
'left',
@@ -417,13 +488,17 @@ function register_block_supports( array $config = [] ): array {
'right',
'none',
],
- 'alignWide' => true,
- 'spacing' => [
- 'padding' => true,
- 'margin' => true,
+ 'alignWide' => true,
+ 'spacing' => [
+ 'padding' => true,
+ 'margin' => true,
+ 'blockGap' => true,
+ ],
+ '__experimentalBorder' => [
+ 'radius' => true,
],
],
- 'core/post-title' => [
+ 'core/post-title' => [
'spacing' => [
'padding' => true,
'margin' => true,
@@ -438,8 +513,9 @@ function register_block_supports( array $config = [] ): array {
'color' => true,
],
],
+ 'blockifyPosition' => true,
],
- 'core/pullquote' => [
+ 'core/pullquote' => [
'spacing' => [
'margin' => true,
'padding' => true,
@@ -456,21 +532,31 @@ function register_block_supports( array $config = [] ): array {
],
],
],
- 'core/query' => [
+ 'core/query' => [
'spacing' => [
- 'padding' => true,
- 'margin' => true,
- 'blockGap' => true,
+ 'padding' => true,
+ 'margin' => true,
],
'blockifyPosition' => true,
],
- 'core/query-pagination' => [
- 'spacing' => [
+ 'core/query-pagination' => [
+ 'spacing' => [
'margin' => true,
'padding' => true,
],
+ '__experimentalBorder' => [
+ 'radius' => true,
+ 'width' => true,
+ 'color' => true,
+ 'style' => true,
+ '__experimentalDefaultControls' => [
+ 'width' => true,
+ 'color' => true,
+ 'radius' => true,
+ ],
+ ],
],
- 'core/quote' => [
+ 'core/quote' => [
'spacing' => [
'margin' => true,
'padding' => true,
@@ -487,19 +573,20 @@ function register_block_supports( array $config = [] ): array {
],
],
],
- 'core/row' => [
+ 'core/row' => [
'blockifyBoxShadow' => true,
'blockifyPosition' => true,
],
- 'core/search' => [
- 'blockifyBoxShadow' => true,
- 'blockifyPosition' => true,
+ 'core/search' => [
'spacing' => [
- 'padding' => true,
- 'margin' => true,
+ 'padding' => true,
+ 'margin' => true,
+ 'blockGap' => true,
],
+ 'blockifyBoxShadow' => true,
+ 'blockifyPosition' => true,
],
- 'core/separator' => [
+ 'core/separator' => [
'align' => [
'full',
'wide',
@@ -528,7 +615,7 @@ function register_block_supports( array $config = [] ): array {
'padding' => false,
],
],
- 'core/site-logo' => [
+ 'core/site-logo' => [
'color' => [
'background' => true,
'gradients' => true,
@@ -546,10 +633,10 @@ function register_block_supports( array $config = [] ): array {
],
],
],
- 'core/stack' => [
+ 'core/stack' => [
'blockifyPosition' => true,
],
- 'core/social-links' => [
+ 'core/social-links' => [
'align' => [
'full',
'wide',
@@ -580,13 +667,13 @@ function register_block_supports( array $config = [] ): array {
],
'blockifyPosition' => true,
],
- 'core/social-link' => [
+ 'core/social-link' => [
'color' => [
'background' => false,
'text' => true,
],
],
- 'core/spacer' => [
+ 'core/spacer' => [
'align' => [
'full',
'wide',
@@ -596,7 +683,6 @@ function register_block_supports( array $config = [] ): array {
'none',
],
'alignWide' => true,
- 'blockifyBoxShadow' => true,
'color' => [
'gradients' => true,
'background' => true,
@@ -615,24 +701,27 @@ function register_block_supports( array $config = [] ): array {
'color' => true,
],
],
+ 'blockifyAnimation' => true,
+ 'blockifyBoxShadow' => true,
'blockifyPosition' => true,
'blockifyFilter' => true,
'blockifyTransform' => true,
+ 'blockifyOnclick' => true,
],
- 'core/table-of-contents' => [
+ 'core/table-of-contents' => [
'spacing' => [
'margin' => true,
'padding' => true,
'blockGap' => true,
],
],
- 'core/tag-cloud' => [
+ 'core/tag-cloud' => [
'typography' => [
'textTransform' => true, // Doesn't work.
'letterSpacing' => true, // Doesn't work.
],
],
- 'core/template-part' => [
+ 'core/template-part' => [
'blockifyBoxShadow' => true,
'color' => [
'background' => true,
@@ -642,7 +731,7 @@ function register_block_supports( array $config = [] ): array {
],
'blockifyPosition' => true,
],
- 'core/video' => [
+ 'core/video' => [
'color' => [
'gradients' => true,
'background' => true,
@@ -668,5 +757,5 @@ function register_block_supports( array $config = [] ): array {
],
];
- return $config;
+ return $data;
}
diff --git a/includes/blocks/avatar.php b/includes/blocks/avatar.php
new file mode 100644
index 0000000..6440e32
--- /dev/null
+++ b/includes/blocks/avatar.php
@@ -0,0 +1,8 @@
+getAttribute( 'class' ) );
@@ -47,51 +59,285 @@ function render_button_block( string $html, array $block ): string {
if ( str_contains( $html, '-border-' ) ) {
$global_settings = wp_get_global_settings();
$dom = dom( $html );
- $button = get_dom_element( 'div', $dom );
+ $div = get_dom_element( 'div', $dom );
$link = get_dom_element( 'a', $dom );
- if ( ! $button || ! $link ) {
- return $html;
+ if ( ! $div ) {
+ $div = create_element( 'div', $dom );
}
- $classes = explode( ' ', $button->getAttribute( 'class' ) );
- $styles = explode( ';', $button->getAttribute( 'style' ) );
- $new_classes = [];
- $new_styles = [];
+ if ( ! $link ) {
+ $link = create_element( 'a', $dom );
+ }
+
+ $classes = explode( ' ', $div->getAttribute( 'class' ) );
+ $styles = explode( ';', $div->getAttribute( 'style' ) );
+ $div_classes = [];
+ $div_styles = [];
foreach ( $classes as $class ) {
if ( ! str_contains( $class, '-border-' ) ) {
- $new_classes[] = $class;
+ $div_classes[] = $class;
}
}
foreach ( $styles as $style ) {
if ( ! str_contains( $style, 'border-' ) ) {
- $new_styles[] = $style;
+ $div_styles[] = $style;
}
}
$border_width = $block['attrs']['style']['border']['width'] ?? null;
$border_color = $block['attrs']['style']['border']['color'] ?? null;
- $link_styles = explode( ';', $link->getAttribute( 'style' ) );
+ $link_styles = css_string_to_array( $link->getAttribute( 'style' ) );
if ( $border_width || $border_color ) {
- $border_width = $border_width ?? $global_settings['custom']['border']['width'];
- $link_styles[] = "line-height:calc(1em - $border_width)";
+ $border_width = $border_width ?? $global_settings['custom']['border']['width'];
+
+ $link_styles['line-height'] = "calc(1em - $border_width)";
+ }
+
+ $link->setAttribute( 'style', css_array_to_string( $link_styles ) );
+ $div->setAttribute( 'class', implode( ' ', $div_classes ) );
+ $div->setAttribute( 'style', implode( ';', $div_styles ) );
+
+ if ( ! $div->getAttribute( 'style' ) ) {
+ $div->removeAttribute( 'style' );
+ }
+
+ $html = $dom->saveHTML();
+ }
+
+ $icon_set = $block['attrs']['iconSet'] ?? '';
+ $icon_name = $block['attrs']['iconName'] ?? '';
+ $icon = $icon_set && $icon_name ? get_icon( $icon_set, $icon_name ) : '';
+
+ if ( $icon ) {
+ $dom = dom( $html );
+ $div = get_dom_element( 'div', $dom );
+
+ if ( ! $div ) {
+ $div = create_element( 'div', $dom );
+ $div = dom_element( $dom->appendChild( $div ) );
+ $class = esc_attr( $block['attrs']['className'] ?? '' );
+
+ $div->setAttribute( 'class', 'wp-block-button ' . $class );
+ }
+
+ $div_styles = css_string_to_array( $div->getAttribute( 'style' ) );
+
+ foreach ( $div_styles as $key => $style ) {
+ if ( str_contains( $key, '--wp--custom--icon--' ) ) {
+ unset( $div_styles[ $key ] );
+ }
+ }
+
+ $div->setAttribute( 'style', css_array_to_string( $div_styles ) );
+
+ $a = get_dom_element( 'a', $div );
+
+ if ( ! $a ) {
+ $a = create_element( 'a', $dom );
+
+ $a->setAttribute( 'class', 'wp-block-button__link wp-element-button' );
+
+ $a = dom_element( $div->appendChild( $a ) );
+ }
+
+ $svg_dom = dom( $icon );
+ $svg = get_dom_element( 'svg', $svg_dom );
+ $imported = dom_element( $dom->importNode( $svg, true ) );
+ $gap = $block['attrs']['style']['spacing']['blockGap'] ?? null;
+ $classes = explode( ' ', $a->getAttribute( 'class' ) );
+ $styles = css_string_to_array( $a->getAttribute( 'style' ) );
+
+ if ( $gap ) {
+ $styles['gap'] = format_custom_property( $gap );
+ }
+
+ $padding = $block['attrs']['style']['spacing']['padding'] ?? [];
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
+
+ $text_color = $block['attrs']['textColor'] ?? null;
+
+ if ( $text_color ) {
+ $styles['color'] = format_custom_property( $text_color );
+ }
+
+ $background_color = $block['attrs']['backgroundColor'] ?? null;
+
+ if ( $background_color ) {
+ $styles['background-color'] = format_custom_property( $background_color );
+ $classes[] = 'has-background';
+ }
+
+ $border_width = $block['attrs']['style']['border']['width'] ?? null;
+ $border_style = $block['attrs']['style']['border']['style'] ?? null;
+ $border_color = $block['attrs']['style']['border']['color'] ?? null;
+
+ if ( $border_width ) {
+ $styles['border-width'] = format_custom_property( $border_width );
+ }
+
+ if ( $border_style ) {
+ $styles['border-style'] = format_custom_property( $border_style );
+ }
+
+ if ( $border_color ) {
+ $styles['border-color'] = format_custom_property( $border_color );
+ }
+
+ if ( $styles ) {
+ $a->setAttribute( 'style', css_array_to_string( $styles ) );
}
- $link->setAttribute( 'style', implode( ';', $link_styles ) );
+ $a->setAttribute( 'class', implode( ' ', array_unique( $classes ) ) );
- $button->setAttribute( 'class', implode( ' ', $new_classes ) );
- $button->setAttribute( 'style', implode( ';', $new_styles ) );
+ $on_click = $block['attrs']['onclick'] ?? null;
- if ( ! $button->getAttribute( 'style' ) ) {
- $button->removeAttribute( 'style' );
+ if ( $on_click ) {
+ $a->setAttribute( 'onclick', format_inline_js( $on_click ) );
+ }
+
+ $url = $block['attrs']['url'] ?? $a->getAttribute( 'href' );
+
+ if ( ! $url ) {
+ if ( ! $on_click ) {
+ $a->setAttribute( 'href', '#' );
+ } else {
+ $a->setAttribute( 'href', 'javascript:void(0)' );
+ }
+ }
+
+ $size = esc_attr( $block['attrs']['iconSize'] ?? null ) ?: '20';
+
+ if ( str_contains( $size, 'var' ) ) {
+ $svg_styles = css_string_to_array( $svg->getAttribute( 'style' ) );
+
+ unset ( $svg_styles['enable-background'] );
+
+ $svg_styles['height'] = format_custom_property( $size );
+ $svg_styles['width'] = format_custom_property( $size );
+
+ $imported->setAttribute( 'style', css_array_to_string( $svg_styles ) );
+
+ } else {
+ $imported->setAttribute( 'height', $size );
+ $imported->setAttribute( 'width', $size );
+ }
+
+ $fill = $imported->getAttribute( 'fill' );
+
+ if ( ! $fill ) {
+ $imported->setAttribute( 'fill', 'currentColor' );
+ }
+
+ $icon_position = $block['attrs']['iconPosition'] ?? 'end';
+
+ if ( $icon_position === 'start' ) {
+ $svg = $a->insertBefore( $imported, $a->firstChild );
+ } else {
+ $svg = $a->appendChild( $imported );
+ }
+
+ $title = $svg->insertBefore(
+ create_element( 'title', $dom ),
+ $svg->firstChild
+ );
+
+ $text = $dom->createTextNode( to_title_case( $block['attrs']['iconName'] ?? '' ) );
+
+ $title->appendChild( $text );
+
+ $html = add_position_classes( $dom->saveHTML(), $block );
+ }
+
+ $url = esc_url( $block['attrs']['url'] ?? '' );
+
+ if ( ! $url ) {
+ $dom = dom( $html );
+ $div = get_dom_element( 'div', $dom );
+ $a = get_dom_element( 'a', $div );
+
+ if ( $a ) {
+ $href = $a->getAttribute( 'href' );
+
+ if ( $href ) {
+ $a->setAttribute( 'href', $href );
+ } else {
+
+ $on_click = $block['attrs']['onclick'] ?? null;
+
+ if ( ! $on_click ) {
+ $a->setAttribute( 'href', '#' );
+ } else {
+ $a->setAttribute( 'href', 'javascript:void(0)' );
+ }
+ }
}
$html = $dom->saveHTML();
}
+ $size = esc_attr( $block['attrs']['size'] ?? 'medium' );
+
+ if ( in_array( $size, [ 'small', 'large' ] ) ) {
+ $dom = dom( $html );
+ $div = get_dom_element( 'div', $dom );
+
+ if ( $div ) {
+ $div_classes = explode( ' ', $div->getAttribute( 'class' ) );
+ $div_classes[] = "is-style-$size";
+ $div->setAttribute( 'class', implode( ' ', $div_classes ) );
+ }
+
+ $html = $dom->saveHTML();
+ }
+
+ $inner_html = $block['innerHTML'] ?? $block['innerContent'] ?? $html;
+ $back_urls = [
+ 'javascript:history.go(-1)',
+ 'javascript: history.go(-1)',
+ ];
+
+ foreach ( $back_urls as $back_url ) {
+ if ( str_contains( $inner_html, $back_url ) ) {
+ $html = str_replace( 'href="#"', 'href="' . $back_url . '"', $html );
+ }
+ }
+
+ if ( str_contains( $html, 'javascript:void' ) ) {
+ $html = str_replace(
+ [
+ 'http://javascript:void',
+ 'target="_blank"',
+ ],
+ [
+ 'javascript:void',
+ 'disabled',
+ ],
+ $html
+ );
+ }
+
+ if ( str_contains( $html, 'href="http://#"' ) ) {
+ $html = str_replace(
+ [
+ 'href="http://#"',
+ 'target="_blank"',
+ ],
+ [
+ 'href="#"',
+ '',
+ ],
+ $html
+ );
+ }
+
+ if ( str_contains( $html, 'http://http' ) ) {
+ $html = str_replace( 'http://http', 'http', $html );
+ }
+
return $html;
}
diff --git a/includes/blocks/buttons.php b/includes/blocks/buttons.php
new file mode 100644
index 0000000..e954992
--- /dev/null
+++ b/includes/blocks/buttons.php
@@ -0,0 +1,40 @@
+getAttribute( 'style' ) );
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
+
+ $div->setAttribute( 'style', css_array_to_string( $styles ) );
+
+ $html = $dom->saveHTML();
+ }
+ }
+
+ return $html;
+}
diff --git a/includes/blocks/calendar.php b/includes/blocks/calendar.php
new file mode 100644
index 0000000..22a2c84
--- /dev/null
+++ b/includes/blocks/calendar.php
@@ -0,0 +1,43 @@
+getAttribute( 'class' ) );
+ $table_classes = explode( ' ', $table->getAttribute( 'class' ) );
+
+ foreach ( $table_classes as $index => $table_class ) {
+ if ( str_contains_any( $table_class, 'background', 'color' ) ) {
+ $div_classes[] = $table_class;
+ unset( $table_classes[ $index ] );
+ }
+ }
+
+ $div->setAttribute( 'class', implode( ' ', $div_classes ) );
+ $table->setAttribute( 'class', implode( ' ', $table_classes ) );
+
+ return $dom->saveHTML();
+}
diff --git a/includes/blocks/code.php b/includes/blocks/code.php
new file mode 100644
index 0000000..3b4da2e
--- /dev/null
+++ b/includes/blocks/code.php
@@ -0,0 +1,41 @@
+getAttribute( 'style' ) );
+ $pre_styles = add_shorthand_property( $pre_styles, 'margin', $margin );
+
+ $pre->setAttribute( 'style', css_array_to_string( $pre_styles ) );
+ }
+
+ $html = $dom->saveHTML();
+ }
+
+ return $html;
+}
diff --git a/includes/blocks/columns.php b/includes/blocks/columns.php
index 4ac92bc..93ed6e9 100644
--- a/includes/blocks/columns.php
+++ b/includes/blocks/columns.php
@@ -5,6 +5,11 @@
namespace Blockify\Theme;
use function add_filter;
+use function array_unique;
+use function count;
+use function explode;
+use function implode;
+use function in_array;
use function str_replace;
add_filter( 'render_block_core/columns', NS . 'render_columns_block', 10, 2 );
@@ -13,8 +18,8 @@
*
* @since 0.0.2
*
- * @param string $html Block HTML.
- * @param array $block Block data.
+ * @param string $html Block HTML.
+ * @param array $block Block data.
*
* @return string
*/
@@ -27,7 +32,50 @@ function render_columns_block( string $html, array $block ): string {
}
if ( $class === 'is-stacked-on-mobile' ) {
- $html = str_replace( 'wp-block-columns', 'wp-block-columns is-stacked-on-mobile', $html );
+ $html = str_replace( 'wp-block-columns ', 'wp-block-columns is-stacked-on-mobile ', $html );
+ $dom = dom( $html );
+ $div = get_dom_element( 'div', $dom );
+
+ if ( $div ) {
+ $div_classes = explode( ' ', $div->getAttribute( 'class' ) );
+
+ if ( ! in_array( $class, $div_classes ) ) {
+ $div_classes[] = $class;
+ }
+
+ $div_classes = array_unique( $div_classes );
+
+ $div->setAttribute( 'class', implode( ' ', $div_classes ) );
+ }
+
+ $html = $dom->saveHTML();
+ }
+
+ $margin = $block['attrs']['style']['spacing']['margin'] ?? null;
+
+ if ( $margin ) {
+ $dom = dom( $html );
+ $first = get_dom_element( 'div', $dom );
+
+ if ( $first ) {
+ $styles = css_string_to_array( $first->getAttribute( 'style' ) );
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
+
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
+ }
+
+ $html = $dom->saveHTML();
+ }
+
+ $dom = dom( $html );
+ $div = get_dom_element( 'div', $dom );
+
+ if ( $div ) {
+ $column_count = (string) count( $block['innerBlocks'] ?? 0 );
+
+ $div->setAttribute( 'data-columns', $column_count );
+
+ $html = $dom->saveHTML();
}
return $html;
diff --git a/includes/blocks/cover.php b/includes/blocks/cover.php
index 50de88a..abd2eae 100644
--- a/includes/blocks/cover.php
+++ b/includes/blocks/cover.php
@@ -19,13 +19,6 @@
* @return string
*/
function render_cover_block( string $html, array $block ): string {
- $padding = $block['attrs']['style']['spacing']['padding'] ?? null;
- $zIndex = $block['attrs']['style']['zIndex']['all'] ?? null;
-
- if ( is_null( $padding ) && is_null( $zIndex ) ) {
- return $html;
- }
-
$dom = dom( $html );
$div = get_dom_element( 'div', $dom );
@@ -33,16 +26,24 @@ function render_cover_block( string $html, array $block ): string {
return $html;
}
- $styles = css_string_to_array( $div->getAttribute( 'style' ) );
+ $url = $block['attrs']['url'] ?? null;
- foreach ( [ 'top', 'right', 'bottom', 'left' ] as $side ) {
- if ( ! isset( $padding[ $side ] ) ) {
- continue;
- }
+ if ( ! $url ) {
+ $imported = $dom->importNode( get_placeholder_image( $dom ), true );
+ $svg = dom_element( $imported );
- $styles[ "padding-{$side}" ] = format_custom_property( (string) $padding[ $side ] );
+ $classes = [];
+ $classes[] = 'wp-block-cover__image-background';
+
+ $svg->setAttribute( 'class', implode( ' ', $classes ) );
}
+ $padding = $block['attrs']['style']['spacing']['padding'] ?? null;
+ $zIndex = $block['attrs']['style']['zIndex']['all'] ?? null;
+
+ $styles = css_string_to_array( $div->getAttribute( 'style' ) );
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
+
if ( ! is_null( $zIndex ) ) {
$styles['--z-index'] = format_custom_property( $zIndex );
}
diff --git a/includes/blocks/details.php b/includes/blocks/details.php
new file mode 100644
index 0000000..8330027
--- /dev/null
+++ b/includes/blocks/details.php
@@ -0,0 +1,73 @@
+getAttribute( 'style' ) );
+
+ $summary_styles['padding-top'] = $padding['top'] ?? '';
+ $summary_styles['padding-bottom'] = $padding['bottom'] ?? '';
+ $summary_styles['padding-left'] = $padding['left'] ?? '';
+ $summary_styles['margin-top'] = 'calc(0px - ' . ( $padding['top'] ?? '' ) . ')';
+ $summary_styles['margin-bottom'] = 'calc(0px - ' . ( $padding['bottom'] ?? '' ) . ')';
+ $summary_styles['margin-left'] = 'calc(0px - ' . ( $padding['left'] ?? '' ) . ')';
+
+ $summary->setAttribute( 'style', css_array_to_string( $summary_styles ) );
+ }
+
+ return $dom->saveHTML();
+}
+
+add_filter( 'blockify_inline_js', NS . 'add_details_js', 10, 3 );
+/**
+ * Adds JS for the details block.
+ *
+ * @since 0.0.1
+ *
+ * @param string $js Inline JS.
+ * @param string $content Template HTML.
+ * @param bool $all Whether to include all JS.
+ *
+ * @return string
+ */
+function add_details_js( string $js, string $content, bool $all ): string {
+
+ if ( $all || str_contains( $content, 'wp-block-details' ) ) {
+ $file = get_dir() . 'assets/js/details.js';
+
+ if ( file_exists( $file ) ) {
+ $js .= file_get_contents( $file );
+ }
+ }
+
+ return $js;
+}
diff --git a/includes/blocks/group.php b/includes/blocks/group.php
index e7f27d0..21a6ca8 100644
--- a/includes/blocks/group.php
+++ b/includes/blocks/group.php
@@ -4,47 +4,73 @@
namespace Blockify\Theme;
-use function add_filter;
+use function array_diff;
+use function esc_attr;
use function explode;
use function implode;
+use function in_array;
use function method_exists;
-add_filter( 'render_block_core/group', NS . 'render_block_layout', 10, 2 );
+add_filter( 'render_block_core/group', NS . 'render_group_block', 10, 2 );
/**
* Modifies front end HTML output of block.
*
- * @since 0.0.20
+ * @since 1.3.0
*
* @param string $html Block HTML.
* @param array $block Block data.
*
* @return string
*/
-function render_block_layout( string $html, array $block ): string {
- $dom = dom( $html );
- $div = get_dom_element( 'div', $dom );
-
- if ( $div && $div->tagName === 'main' ) {
- $div->setAttribute(
- 'class',
- 'wp-site-main ' . $div->getAttribute( 'class' )
- );
+function render_group_block( string $html, array $block ): string {
+ if ( ( $block['attrs']['layout']['orientation'] ?? '' ) === 'marquee' ) {
+ $html = render_marquee_block_variation( $html, $block );
+ }
+
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
+
+ if ( ! $first ) {
+ return $html;
}
if ( $block['attrs']['minHeight'] ?? null ) {
- $div->setAttribute(
+ $first->setAttribute(
'style',
- $div->getAttribute( 'style' ) . ';min-height:' . $block['attrs']['minHeight']
+ $first->getAttribute( 'style' ) . ';min-height:' . $block['attrs']['minHeight']
);
}
- $html = $dom->saveHTML();
+ $margin = $block['attrs']['style']['spacing']['margin'] ?? [];
+ $padding = $block['attrs']['style']['spacing']['padding'] ?? [];
- if ( ( $block['attrs']['layout']['orientation'] ?? null ) === 'marquee' ) {
- $html = render_marquee_block_variation( $html, $block );
+ $div_styles = css_string_to_array( $first->getAttribute( 'style' ) );
+ $div_styles = add_shorthand_property( $div_styles, 'margin', $margin );
+ $div_styles = add_shorthand_property( $div_styles, 'padding', $padding );
+
+ if ( $div_styles ) {
+ $first->setAttribute( 'style', css_array_to_string( $div_styles ) );
+ }
+
+ $tag = esc_attr( $block['attrs']['tagName'] ?? 'div' );
+
+ if ( $tag === 'main' ) {
+ $first->setAttribute( 'role', $tag );
+
+ $classes = explode( ' ', $first->getAttribute( 'class' ) );
+
+ // Move `site-main` class to the start of the array.
+ if ( in_array( 'site-main', $classes, true ) ) {
+ $classes = [
+ 'site-main',
+ ...( array_diff( $classes, [ 'site-main' ] ) ),
+ ];
+ }
+
+ $first->setAttribute( 'class', implode( ' ', $classes ) );
}
- return $html;
+ return $dom->saveHTML();
}
/**
@@ -58,19 +84,18 @@ function render_block_layout( string $html, array $block ): string {
* @return string
*/
function render_marquee_block_variation( string $html, array $block ): string {
- $dom = dom( $html );
- $div = get_dom_element( 'div', $dom );
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
- if ( ! $div ) {
+ if ( ! $first ) {
return $html;
}
$repeat = $block['attrs']['repeatItems'] ?? 2;
- $wrap = $dom->createElement( 'div' );
- $styles = css_string_to_array( $div->getAttribute( 'style' ) );
- $classes = explode( ' ', $div->getAttribute( 'class' ) );
-
- unset( $classes[ array_search( 'is-marquee', $classes, true ) ] );
+ $wrap = create_element( 'div', $dom );
+ $styles = css_string_to_array( $first->getAttribute( 'style' ) );
+ $classes = explode( ' ', $first->getAttribute( 'class' ) );
+ $classes = array_diff( $classes, [ 'is-marquee' ] );
$gap = $block['attrs']['style']['spacing']['blockGap'] ?? null;
@@ -78,15 +103,14 @@ function render_marquee_block_variation( string $html, array $block ): string {
$styles['--marquee-gap'] = format_custom_property( $gap );
}
- $div->setAttribute( 'class', implode( ' ', $classes ) );
- $div->setAttribute( 'style', css_array_to_string( $styles ) );
-
+ $first->setAttribute( 'class', implode( ' ', $classes ) );
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
$wrap->setAttribute( 'class', 'is-marquee' );
- $count = $div->childNodes->count();
+ $count = $first->childNodes->count();
for ( $i = 0; $i < $count; $i++ ) {
- $item = $div->childNodes->item( $i );
+ $item = $first->childNodes->item( $i );
if ( ! $item || ! method_exists( $item, 'setAttribute' ) ) {
continue;
@@ -109,7 +133,7 @@ function render_marquee_block_variation( string $html, array $block ): string {
}
}
- $div->insertBefore( $wrap, $div->firstChild );
+ $first->insertBefore( $wrap, $first->firstChild );
return $dom->saveHTML();
}
diff --git a/includes/blocks/heading.php b/includes/blocks/heading.php
index 26feab9..7b20ba8 100644
--- a/includes/blocks/heading.php
+++ b/includes/blocks/heading.php
@@ -4,36 +4,44 @@
namespace Blockify\Theme;
+use WP_Block;
use function add_filter;
+use function esc_html;
+use function esc_html__;
use function explode;
use function get_search_query;
use function implode;
+use function in_array;
+use function intval;
use function sanitize_title_with_dashes;
use function sprintf;
-add_filter( 'render_block_core/heading', NS . 'render_heading_block', 10, 2 );
+add_filter( 'render_block_core/heading', NS . 'render_heading_block', 10, 3 );
/**
* Modifies front end HTML output of block.
*
* @since 0.0.2
*
- * @param string $html Block HTML.
- * @param array $block Block data.
+ * @param string $html Block HTML.
+ * @param array $block Block data.
+ * @param WP_Block $object Block object.
*
* @return string
*/
-function render_heading_block( string $html, array $block ): string {
- $dom = dom( $html );
-
- // No way of knowing tag.
- $heading = get_dom_element( '*', $dom );
+function render_heading_block( string $html, array $block, WP_Block $object ): string {
+ $dom = dom( $html );
+ $level = intval( $block['attrs']['level'] ?? 2 );
+ $heading = get_dom_element( 'h' . $level, $dom );
if ( ! $heading ) {
return $html;
}
- $classes = explode( ' ', $heading->getAttribute( 'class' ) );
- $classes[] = 'wp-block-heading';
+ $classes = explode( ' ', $heading->getAttribute( 'class' ) );
+
+ if ( ! in_array( 'wp-block-heading', $classes, true ) ) {
+ $classes[] = 'wp-block-heading';
+ }
$styles = css_string_to_array( $heading->getAttribute( 'style' ) );
@@ -43,15 +51,19 @@ function render_heading_block( string $html, array $block ): string {
$styles['gap'] = format_custom_property( $gap );
}
+ $styles = add_shorthand_property( $styles, 'margin', $block['attrs']['style']['spacing']['margin'] ?? [] );
+
$heading->setAttribute(
'class',
implode( ' ', $classes )
);
- $heading->setAttribute(
- 'style',
- css_array_to_string( $styles )
- );
+ if ( $styles ) {
+ $heading->setAttribute(
+ 'style',
+ css_array_to_string( $styles )
+ );
+ }
$id = $heading->getAttribute( 'id' );
@@ -70,13 +82,13 @@ function render_heading_block( string $html, array $block ): string {
$heading->removeAttribute( 'style' );
}
- $level = $block['attrs']['level'] ?? null;
$search_query = get_search_query();
+ $default = esc_html__( 'Search Results', 'blockify' );
- if ( $level === 1 && $search_query && $heading->textContent === __( 'Search Results', 'blockify' ) ) {
+ if ( $level === 1 && $search_query && $heading->textContent === $default ) {
$heading->textContent = sprintf(
- __( 'Search results for: ', 'blockify' ) . '%s',
- $search_query
+ esc_html__( 'Search results for: ', 'blockify' ) . '%s',
+ esc_html( $search_query )
);
}
diff --git a/includes/blocks/image.php b/includes/blocks/image.php
index ceeefc1..1c1ec5a 100644
--- a/includes/blocks/image.php
+++ b/includes/blocks/image.php
@@ -4,34 +4,77 @@
namespace Blockify\Theme;
+use WP_Block;
use function add_filter;
-use function str_contains;
+use function in_array;
-add_filter( 'render_block_core/image', NS . 'render_image_block', 10, 2 );
+add_filter( 'render_block', NS . 'render_image_block', 12, 3 );
/**
* Modifies front end HTML output of block.
*
* @since 0.0.2
*
- * @param string $html Block HTML.
- * @param array $block Block data.
+ * @param string $html Block HTML.
+ * @param array $block Block data.
+ * @param WP_Block $object Block object.
*
* @return string
*/
-function render_image_block( string $html, array $block ): string {
- $id = $block['attrs']['id'] ?? '';
- $icon = str_contains( $html, 'is-style-icon' ) || isset( $block['attrs']['className'] ) && str_contains( $block['attrs']['className'], 'is-style-icon' );
- $svg = $block['attrs']['style']['svgString'] ?? '';
+function render_image_block( string $html, array $block, WP_Block $object ): string {
+ $name = $block['blockName'] ?? '';
+
+ if ( ! in_array( $name, [ 'core/image', 'core/post-featured-image', 'blockify/image-compare' ], true ) ) {
+ return $html;
+ }
+
+ $attrs = $block['attrs'] ?? [];
+ $id = $attrs['id'] ?? '';
+ $has_icon = ( $attrs['iconSet'] ?? '' ) && ( $attrs['iconName'] ?? '' ) || ( $attrs['iconSvgString'] ?? '' );
+ $style = $attrs['style'] ?? [];
+ $has_svg = $style['svgString'] ?? '';
+ $use_placeholder = $attrs['usePlaceholder'] ?? true;
// Placeholder.
- if ( ! $id && ! $icon && ! $svg ) {
- $html = render_image_placeholder( $html, $block );
+ if ( $use_placeholder && ! $id && ! $has_icon && ! $has_svg ) {
+ $html = render_image_placeholder( $html, $block, $object );
}
// Icon.
- if ( $icon ) {
+ if ( $has_icon ) {
$html = get_icon_html( $html, $block );
}
+ // Image options.
+ if ( ! $has_icon && ! $has_svg ) {
+
+ if ( $name === 'core/image' ) {
+ $html = add_responsive_classes( $html, $block, get_image_options(), (bool) $id );
+ }
+
+ if ( $name === 'core/post-featured-image' ) {
+ $html = add_responsive_classes( $html, $block, get_image_options(), (bool) $id );
+ }
+ }
+
+ $margin = $style['spacing']['margin'] ?? '';
+
+ if ( $margin ) {
+ $dom = dom( $html );
+ $figure = get_dom_element( 'figure', $dom );
+
+ if ( $figure ) {
+ $styles = css_string_to_array( $figure->getAttribute( 'style' ) );
+
+ $styles = add_shorthand_property( $styles, 'margin', $style['spacing']['margin'] ?? [] );
+
+ $figure->setAttribute(
+ 'style',
+ css_array_to_string( $styles )
+ );
+ }
+
+ $html = $dom->saveHTML();
+ }
+
return $html;
}
diff --git a/includes/blocks/list.php b/includes/blocks/list.php
index 4384e48..072ed48 100644
--- a/includes/blocks/list.php
+++ b/includes/blocks/list.php
@@ -7,8 +7,8 @@
use DOMElement;
use function add_filter;
use function array_unshift;
+use function esc_attr;
use function explode;
-use function in_array;
use function method_exists;
use function str_contains;
@@ -24,9 +24,6 @@
* @return string
*/
function render_list_block( string $html, array $block ): string {
- $block_gap = $block['attrs']['style']['spacing']['blockGap'] ?? null;
- $justify_content = $block['attrs']['layout']['justifyContent'] ?? '';
-
$dom = dom( $html );
$ul = get_dom_element( 'ul', $dom );
$ol = get_dom_element( 'ol', $dom );
@@ -35,8 +32,11 @@ function render_list_block( string $html, array $block ): string {
return $html;
}
- $list = $ul ?? $ol;
- $styles = css_string_to_array( $list->getAttribute( 'style' ) );
+ $block_gap = $block['attrs']['style']['spacing']['blockGap'] ?? null;
+ $justify_content = $block['attrs']['layout']['justifyContent'] ?? '';
+ $margin = $block['attrs']['style']['spacing']['margin'] ?? [];
+ $list = $ul ?? $ol;
+ $styles = css_string_to_array( $list->getAttribute( 'style' ) );
if ( $block_gap === '0' || $block_gap ) {
$styles['gap'] = format_custom_property( $block_gap );
@@ -45,10 +45,14 @@ function render_list_block( string $html, array $block ): string {
if ( $justify_content ) {
$styles['display'] = 'flex';
$styles['flex-wrap'] = 'wrap';
- $styles['justify-content'] = $justify_content;
+ $styles['justify-content'] = esc_attr( $justify_content );
}
- $list->setAttribute( 'style', css_array_to_string( $styles ) );
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
+
+ if ( $styles ) {
+ $list->setAttribute( 'style', css_array_to_string( $styles ) );
+ }
$classes = explode( ' ', $list->getAttribute( 'class' ) );
@@ -59,7 +63,7 @@ function render_list_block( string $html, array $block ): string {
$html = $dom->saveHTML();
if ( str_contains( $html, 'is-style-accordion' ) ) {
- $html = render_list_block_accordion( $html, $block );
+ $html = render_list_block_accordion( $html );
}
return $html;
@@ -70,12 +74,11 @@ function render_list_block( string $html, array $block ): string {
*
* @since 0.9.19
*
- * @param string $html Block html.
- * @param array $block Block data.
+ * @param string $html Block html.
*
* @return string
*/
-function render_list_block_accordion( string $html, array $block ): string {
+function render_list_block_accordion( string $html ): string {
$dom = dom( $html );
$ul = get_dom_element( 'ul', $dom );
$ol = get_dom_element( 'ol', $dom );
@@ -88,12 +91,11 @@ function render_list_block_accordion( string $html, array $block ): string {
$classes = explode( ' ', $list->getAttribute( 'class' ) );
- if ( ! in_array( 'wp-block-list', $classes, true ) ) {
- $classes = [
- 'wp-block-list',
- ...$classes,
- ];
- }
+ // Move `wp-block-list` class to the start of the array.
+ $classes = [
+ 'wp-block-list',
+ ...( array_diff( $classes, [ 'wp-block-list' ] ) ),
+ ];
$list->setAttribute( 'class', implode( ' ', $classes ) );
@@ -110,14 +112,17 @@ function render_list_block_accordion( string $html, array $block ): string {
continue;
}
- $details = $dom->createElement( 'details' );
+ $details = create_element( 'details', $dom );
foreach ( $li->attributes as $attribute ) {
- $details->setAttribute( $attribute->name, $attribute->value );
+ $details->setAttribute(
+ esc_attr( $attribute->name ),
+ esc_attr( $attribute->value )
+ );
}
- $summary = $dom->createElement( 'summary' );
- $section = $dom->createElement( 'section' );
+ $summary = create_element( 'summary', $dom );
+ $section = create_element( 'section', $dom );
$explode = explode( ' ', $inner );
$details->textContent = '';
@@ -139,7 +144,7 @@ function render_list_block_accordion( string $html, array $block ): string {
$has_border = str_contains_any( $li_style, 'border-width', 'border-style', 'border-color' ) && ! str_contains( $li_style, 'border-width:0' );
if ( $has_border ) {
- $details->appendChild( $dom->createElement( 'hr' ) );
+ $details->appendChild( create_element( 'hr', $dom ) );
}
$details->appendChild( $section );
@@ -186,7 +191,7 @@ function render_list_block_accordion( string $html, array $block ): string {
$details->removeAttribute( 'style' );
}
- $icon = $dom->createElement( 'span' );
+ $icon = create_element( 'span', $dom );
$icon->setAttribute( 'class', 'accordion-toggle' );
$summary->appendChild( $icon );
@@ -209,22 +214,3 @@ function render_list_block_accordion( string $html, array $block ): string {
return $dom->saveHTML();
}
-
-add_filter( 'blockify_inline_js', NS . 'add_accordion_js', 10, 2 );
-/**
- * Adds accordion js.
- *
- * @since 0.9.19
- *
- * @param string $js Inline JS.
- * @param string $content Page HTML content.
- *
- * @return string
- */
-function add_accordion_js( string $js, string $content ): string {
- if ( str_contains( $content, 'is-style-accordion' ) ) {
- $js .= file_get_contents( get_dir() . 'assets/js/accordion.js' );
- }
-
- return $js;
-}
diff --git a/includes/blocks/navigation.php b/includes/blocks/navigation.php
index 68c2146..e34a8cb 100644
--- a/includes/blocks/navigation.php
+++ b/includes/blocks/navigation.php
@@ -4,10 +4,19 @@
namespace Blockify\Theme;
+use function add_filter;
use function array_keys;
+use function explode;
+use function implode;
+use function in_array;
use function is_array;
use function is_string;
+use function str_contains;
use function str_replace;
+use function trim;
+use function wp_get_global_settings;
+use function wp_get_global_styles;
+use function wp_list_pluck;
add_filter( 'render_block_core/navigation', NS . 'render_navigation_block', 10, 2 );
/**
@@ -24,21 +33,66 @@ function render_navigation_block( string $html, array $block ): string {
// Replace invalid root relative URLs.
$html = str_replace( 'http://./', './', $html );
+ $dom = dom( $html );
+ $nav = get_dom_element( 'nav', $dom );
- $spacing = $block['attrs']['style']['spacing'] ?? null;
-
- if ( ! $spacing ) {
+ if ( ! $nav ) {
return $html;
}
- $dom = dom( $html );
- $nav = get_dom_element( 'nav', $dom );
+ $styles = css_string_to_array( $nav->getAttribute( 'style' ) );
+ $classes = explode( ' ', $nav->getAttribute( 'class' ) );
+ $overlay_menu = $block['attrs']['overlayMenu'] ?? true;
+ $filter = $block['attrs']['style']['filter'] ?? null;
- if ( ! $nav ) {
+ if ( $overlay_menu && $filter ) {
+ $filter_value = '';
+
+ foreach ( $filter as $property => $value ) {
+ if ( $property === 'backdrop' ) {
+ continue;
+ }
+
+ $value = format_custom_property( $value ) . 'px';
+
+ $filter_value .= "$property($value) ";
+ }
+
+ $styles['--wp--custom--nav--filter'] = trim( $filter_value );
+
+ $background_color = $block['attrs']['backgroundColor'] ?? $block['attrs']['style']['color']['background'] ?? '';
+
+ $global_settings = wp_get_global_settings();
+ $color_slugs = wp_list_pluck( $global_settings['color']['palette']['theme'] ?? [], 'slug' );
+
+ if ( in_array( $background_color, $color_slugs, true ) ) {
+ $background_color = "var(--wp--preset--color--{$background_color})";
+ }
+
+ if ( $background_color ) {
+ $styles['--wp--custom--nav--background-color'] = format_custom_property( $background_color );
+ }
+
+ $nav->setAttribute( 'style', css_array_to_string( $styles ) );
+
+ if ( $filter['backdrop'] ?? null ) {
+ $classes[] = 'has-backdrop-filter';
+ }
+
+ $nav->setAttribute( 'class', implode( ' ', $classes ) );
+
+ $html = $dom->saveHTML();
+ }
+
+ $spacing = $block['attrs']['style']['spacing'] ?? null;
+
+ if ( ! $spacing ) {
return $html;
}
- $styles = css_string_to_array( $nav->getAttribute( 'style' ) );
+ $padding = $spacing['padding'] ?? null;
+
+ unset( $spacing['padding'] );
foreach ( array_keys( $spacing ) as $attribute ) {
$prop = $attribute === 'blockGap' ? 'gap' : $attribute;
@@ -49,19 +103,20 @@ function render_navigation_block( string $html, array $block ): string {
if ( is_array( $spacing[ $attribute ] ) ) {
foreach ( array_keys( $spacing[ $attribute ] ) as $side ) {
- $styles[ "$prop-$side" ] = format_custom_property( $spacing[ $attribute ][ $side ] );
+ $styles["$prop-$side"] = format_custom_property( $spacing[ $attribute ][ $side ] );
}
}
}
+ $styles = add_shorthand_property( $styles, '--wp--custom--nav--padding', $padding );
+
if ( $styles ) {
$nav->setAttribute( 'style', css_array_to_string( $styles ) );
}
- $buttons = get_elements_by_class_name( $dom, 'wp-block-navigation-submenu__toggle' );
+ $buttons = get_elements_by_class_name( 'wp-block-navigation-submenu__toggle', $dom );
foreach ( $buttons as $button ) {
-
$span = $button->nextSibling;
if ( ! $span || $span->tagName !== 'span' ) {
@@ -76,3 +131,55 @@ function render_navigation_block( string $html, array $block ): string {
return $html;
}
+
+add_filter( 'blockify_inline_css', NS . 'add_submenu_border_css', 11, 3 );
+/**
+ * Adds CSS for submenu borders.
+ *
+ * @since 0.0.2
+ *
+ * @param string $css CSS string.
+ * @param string $content Page HTML content.
+ * @param bool $all Is editor.
+ *
+ * @return string
+ */
+function add_submenu_border_css( string $css, string $content, bool $all ): string {
+
+ if ( $all || str_contains( $content, 'wp-block-navigation__submenu-container' ) ) {
+
+ $global_styles = wp_get_global_styles();
+ $border = $global_styles['blocks']['core/navigation-submenu']['border'] ?? [];
+ $styles = [];
+
+ foreach ( [ 'top', 'right', 'bottom', 'left' ] as $side ) {
+ if ( ! isset( $border[ $side ] ) ) {
+ continue;
+ }
+
+ if ( $border[ $side ]['width'] ?? '' ) {
+ $styles["border-$side-width"] = $border[ $side ]['width'];
+ }
+
+ if ( $border[ $side ]['style'] ?? '' ) {
+ $styles["border-$side-style"] = $border[ $side ]['style'];
+ }
+
+ if ( $border[ $side ]['color'] ?? '' ) {
+ $styles["border-$side-color"] = format_custom_property( $border[ $side ]['color'] );
+ }
+ }
+
+ $radius = $border['radius'] ?? null;
+
+ if ( $radius ) {
+ $styles['border-radius'] = format_custom_property( $radius );
+ }
+
+ if ( $styles ) {
+ $css .= '.wp-block-navigation-submenu{border:0}.wp-block-navigation .wp-block-navigation-item .wp-block-navigation__submenu-container{' . css_array_to_string( $styles ) . '}';
+ }
+ }
+
+ return $css;
+}
diff --git a/includes/blocks/paragraph.php b/includes/blocks/paragraph.php
index 2a081b0..599ae6f 100644
--- a/includes/blocks/paragraph.php
+++ b/includes/blocks/paragraph.php
@@ -6,10 +6,8 @@
use function add_filter;
use function explode;
-use function get_bloginfo;
-use function gmdate;
use function implode;
-use function str_replace;
+use function is_array;
add_filter( 'render_block_core/paragraph', NS . 'render_paragraph_block', 11, 2 );
/**
@@ -23,16 +21,6 @@
* @return string
*/
function render_paragraph_block( string $html, array $block ): string {
- $tags = [
- '[year]' => gmdate( 'Y' ),
- '{current_year}' => gmdate( 'Y' ),
- '{site_title}' => get_bloginfo( 'name' ),
- ];
-
- foreach ( $tags as $tag => $value ) {
- $html = str_replace( $tag, $value, $html );
- }
-
$dom = dom( $html );
$p = get_dom_element( 'p', $dom );
@@ -54,13 +42,48 @@ function render_paragraph_block( string $html, array $block ): string {
)
);
+ $p_styles = css_string_to_array( $p->getAttribute( 'style' ) );
+ $padding = $block['attrs']['style']['spacing']['padding'] ?? '';
+ $margin = $block['attrs']['style']['spacing']['margin'] ?? '';
+
+ if ( is_array( $padding ) && ! empty( $padding ) ) {
+ $p_styles = add_shorthand_property( $p_styles, 'padding', $padding );
+ }
+
+ if ( is_array( $margin ) && ! empty( $margin ) ) {
+ $p_styles = add_shorthand_property( $p_styles, 'margin', $margin );
+ }
+
+ $p->setAttribute( 'style', css_array_to_string( $p_styles ) );
+
$html = $dom->saveHTML();
$svg_string = $block['attrs']['curvedText']['svgString'] ?? '';
- if ( ! $svg_string ) {
- return $html;
+ if ( $svg_string ) {
+ $html = render_curved_text( $html, $block, $svg_string );
}
+ if ( str_contains( $html, 'http://http' ) ) {
+ $html = str_replace( 'http://http', 'http', $html );
+ }
+
+ return $html;
+}
+
+/**
+ * Renders curved text.
+ *
+ * @since 1.3.2
+ *
+ * @param string $html Block HTML.
+ * @param array $block Block data.
+ * @param string $svg_string SVG string.
+ *
+ * @return string
+ */
+function render_curved_text( string $html, array $block, string $svg_string ): string {
+ $dom = dom( $html );
+ $p = get_dom_element( 'p', $dom );
$p->textContent = '';
$svg_dom = dom( $svg_string );
diff --git a/includes/blocks/post-author.php b/includes/blocks/post-author.php
index bc93d1f..70b5cb1 100644
--- a/includes/blocks/post-author.php
+++ b/includes/blocks/post-author.php
@@ -36,6 +36,12 @@ function render_post_author_block( string $html, array $block ): string {
$styles['border-radius'] = $block['attrs']['style']['border']['radius'] ?? null;
}
+ $gap = $block['attrs']['style']['spacing']['blockGap'] ?? null;
+
+ if ( $gap ) {
+ $styles['--wp--style--block-gap'] = format_custom_property( $gap );
+ }
+
$div->setAttribute(
'style',
( $style ? $style . ';' : '' ) . css_array_to_string( $styles )
diff --git a/includes/blocks/post-comments-form.php b/includes/blocks/post-comments-form.php
index b423e51..4213fc2 100644
--- a/includes/blocks/post-comments-form.php
+++ b/includes/blocks/post-comments-form.php
@@ -6,6 +6,7 @@
use function add_filter;
use function apply_filters;
+use function esc_attr;
add_filter( 'render_block_core/post-comments-form', NS . 'render_post_comments_form_block', 10, 2 );
/**
@@ -26,10 +27,28 @@ function render_post_comments_form_block( string $html, array $block ): string {
}
change_tag_name(
- $h3,
- apply_filters( 'blockify_comments_form_title_tag', 'h4' )
+ esc_attr( apply_filters( 'blockify_comments_form_title_tag', 'h4' ) ),
+ $h3
);
return $dom->saveHTML();
}
+add_filter( 'register_block_type_args', NS . 'register_comments_args', 10, 2 );
+/**
+ * Registers the Post Comments Form block.
+ *
+ * @param array $args The block arguments.
+ * @param string $block_type The block handle.
+ *
+ * @return array
+ */
+function register_comments_args( array $args, string $block_type ): array {
+ if ( 'core/comments' === $block_type ) {
+ $args['available_context'] = [
+ 'postId' => '',
+ ];
+ }
+
+ return $args;
+}
diff --git a/includes/blocks/post-content.php b/includes/blocks/post-content.php
index 77f64d6..f67044e 100644
--- a/includes/blocks/post-content.php
+++ b/includes/blocks/post-content.php
@@ -4,9 +4,9 @@
namespace Blockify\Theme;
+use DOMXPath;
use function add_filter;
-use function explode;
-use function implode;
+use function intval;
use function method_exists;
add_filter( 'render_block_core/post-content', NS . 'render_post_content_block', 10, 2 );
@@ -32,28 +32,39 @@ function render_post_content_block( string $html, array $block ): string {
return $html;
}
- $styles = [];
- $original = $div->getAttribute( 'style' );
+ $styles = css_string_to_array( $div->getAttribute( 'style' ) );
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
- if ( $original ) {
- foreach ( explode( ';', $original ) as $rule ) {
- $styles[] = $rule;
- }
+ if ( $styles ) {
+ $div->setAttribute( 'style', css_array_to_string( $styles ) );
}
- foreach ( $margin as $key => $value ) {
- $styles[] = "margin-$key:" . format_custom_property( $value );
- }
+ $html = $dom->saveHTML();
+ }
+
+ $limit = intval( $block['attrs']['contentLimit'] ?? 0 );
+
+ if ( ! $limit ) {
+ return $html;
+ }
+
+ $dom = dom( $html );
+ $xpath = new DOMXPath( $dom );
+ $nodes = $xpath->query( '//text()' );
+ $index = 0;
- foreach ( $padding as $key => $value ) {
- $styles[] = "padding-$key:" . format_custom_property( $value );
+ foreach ( $nodes as $node ) {
+ if ( $index > $limit ) {
+ $node->parentNode->removeChild( $node );
}
- $div->setAttribute( 'style', implode( ';', $styles ) );
+ if ( $node->parentNode && ! $node->textContent ) {
+ $node->parentNode->removeChild( $node );
+ }
- $html = $dom->saveHTML();
+ $index++;
}
- return $html;
+ return $dom->saveHTML();
}
-
diff --git a/includes/blocks/post-date.php b/includes/blocks/post-date.php
index e00e0c5..aa1be98 100644
--- a/includes/blocks/post-date.php
+++ b/includes/blocks/post-date.php
@@ -12,8 +12,8 @@
*
* @since 0.0.1
*
- * @param string $html The block content.
- * @param array $block The block.
+ * @param string $html The block content.
+ * @param array $block The block.
*
* @return string
*/
@@ -28,14 +28,10 @@ function render_post_date( string $html, array $block ): string {
return $html;
}
- $styles = [
- 'margin-top' => $margin['top'] ?? null,
- 'margin-right' => $margin['right'] ?? null,
- 'margin-bottom' => $margin['bottom'] ?? null,
- 'margin-left' => $margin['left'] ?? null,
- ];
+ $styles = css_string_to_array( $div->getAttribute( 'style' ) );
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
- $div->setAttribute( 'style', css_array_to_string( $styles ) . $div->getAttribute( 'style' ) );
+ $div->setAttribute( 'style', css_array_to_string( $styles ) );
$html = $dom->saveHTML();
}
diff --git a/includes/blocks/post-excerpt.php b/includes/blocks/post-excerpt.php
index da58cb1..f371542 100644
--- a/includes/blocks/post-excerpt.php
+++ b/includes/blocks/post-excerpt.php
@@ -4,34 +4,82 @@
namespace Blockify\Theme;
-use DOMException;
use WP_Block;
+use WP_Block_Supports;
+use function add_action;
use function add_filter;
+use function add_post_type_support;
+use function apply_filters;
+use function esc_html;
+use function esc_html__;
+use function explode;
+use function get_post_field;
+use function get_the_excerpt;
+use function get_the_ID;
use function get_the_title;
+use function implode;
+use function in_array;
+use function is_singular;
use function str_replace;
+use function trim;
+use function wp_trim_words;
add_filter( 'render_block_core/post-excerpt', NS . 'render_post_excerpt', 10, 3 );
/**
* Renders post excerpt block.
*
+ * @since 1.2.4
+ *
* @param string $block_content The block content.
* @param array $block The block.
* @param WP_Block $object The block object.
*
- * @throws DOMException If the DOM element is not created.
- * @since 1.2.4
- *
* @return string
*/
function render_post_excerpt( string $block_content, array $block, WP_Block $object ): string {
+ $query_post_id = $object->context['postId'] ?? false;
+ $custom_excerpt = get_post_field( 'post_excerpt', $query_post_id ?? get_the_ID() );
+ $is_query_loop = ( WP_Block_Supports::$block_to_render['blockName'] ?? '' ) === 'core/post-template';
+
+ if ( is_singular() && ! $custom_excerpt && ! $is_query_loop ) {
+ return '';
+ }
+
+ $hide_read_more = $block['attrs']['hideReadMore'] ?? false;
+
+ if ( $hide_read_more ) {
+ $dom = dom( $block_content );
+ $first = get_dom_element( '*', $dom );
+
+ if ( ! $first ) {
+ return $block_content;
+ }
+
+ $read_more = get_elements_by_class_name( 'wp-block-post-excerpt__more-text', $dom )[0] ?? null;
+
+ if ( $read_more ) {
+ $read_more->parentNode->removeChild( $read_more );
+ } else {
+ $classes = explode( ' ', $first->getAttribute( 'class' ) );
+
+ if ( ! in_array( 'hide-read-more', $classes, true ) ) {
+ $classes[] = 'hide-read-more';
+ }
+
+ $first->setAttribute( 'class', implode( ' ', $classes ) );
+ }
+
+ $block_content = $dom->saveHTML();
+ }
+
$more_text = $block['attrs']['moreText'] ?? '';
if ( $more_text ) {
$dom = dom( $block_content );
- $more_link = get_elements_by_class_name( $dom, 'wp-block-post-excerpt__more-link' )[0] ?? null;
+ $more_link = get_elements_by_class_name( 'wp-block-post-excerpt__more-link', $dom )[0] ?? null;
if ( $more_link ) {
- $screen_reader = $dom->createElement( 'span' );
+ $screen_reader = create_element( 'span', $dom );
$screen_reader->setAttribute( 'class', 'screen-reader-text' );
@@ -39,10 +87,10 @@ function render_post_excerpt( string $block_content, array $block, WP_Block $obj
$post_title = get_the_title( $post_id );
if ( ! $post_title ) {
- $post_title = __( 'this post', 'blockify' );
+ $post_title = esc_html__( 'this post', 'blockify' );
}
- $screen_reader->textContent = __( ' about ', 'blockify' ) . ( $post_title );
+ $screen_reader->textContent = esc_html__( ' about ', 'blockify' ) . ( $post_title );
$more_link->appendChild( $screen_reader );
@@ -50,16 +98,89 @@ function render_post_excerpt( string $block_content, array $block, WP_Block $obj
}
}
- return $block_content;
+ $excerpt_length = $block['attrs']['excerptLength'] ?? apply_filters( 'excerpt_length', 55 );
+ $default_excerpt = $block['attrs']['defaultExcerpt'] ?? '';
+ $excerpt = $custom_excerpt ?: $default_excerpt;
+
+ if ( ! $excerpt ) {
+ $excerpt = get_the_excerpt();
+ }
+
+ $dom = dom( $block_content );
+ $div = get_elements_by_class_name( 'wp-block-post-excerpt', $dom )[0] ?? null;
+ $p = get_elements_by_class_name( 'wp-block-post-excerpt__excerpt', $dom )[0] ?? null;
+
+ if ( ! $p ) {
+ $div = $div ?? create_element( 'div', $dom );
+ $p = create_element( 'p', $dom );
+
+ $p->textContent = esc_html( $excerpt );
+ $p->setAttribute( 'class', 'wp-block-post-excerpt__excerpt' );
+
+ $div->appendChild( $p );
+ }
+
+ $p->textContent = esc_html( $excerpt );
+ $div_classes = explode( ' ', $div->getAttribute( 'class' ) );
+ $styles = [];
+ $text_color = $block['attrs']['textColor'] ?? null;
+
+ if ( $text_color ) {
+ $custom_property = ! str_contains_any( $text_color, '#', 'rgb', 'hsl' );
+
+ $styles['color'] = $custom_property ? 'var(--wp--preset--color--' . $text_color . ')' : $text_color;
+ }
+
+ if ( $block['attrs']['textAlign'] ?? '' ) {
+ $div_classes[] = 'has-text-align-' . $block['attrs']['textAlign'];
+ }
+
+ $margin = $block['attrs']['style']['spacing']['margin'] ?? '';
+ $padding = $block['attrs']['style']['spacing']['padding'] ?? '';
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
+
+ if ( $styles ) {
+ $div->setAttribute( 'style', css_array_to_string( $styles ) );
+ }
+
+ $align = $block['attrs']['align'] ?? '';
+
+ if ( $align ) {
+ $div_classes[] = 'align' . $align;
+ }
+
+ $div->setAttribute( 'class', trim( implode( ' ', $div_classes ) ) );
+ $dom->appendChild( $div );
+
+ // Limit length.
+ $p->nodeValue = wp_trim_words(
+ $p->nodeValue ?? '',
+ $excerpt_length,
+ );
+
+ return $dom->saveHTML();
+}
+
+add_action( 'after_setup_theme', NS . 'add_page_excerpt_support' );
+/**
+ * Adds excerpt support to pages.
+ *
+ * @since 1.3.0
+ *
+ * @return void
+ */
+function add_page_excerpt_support(): void {
+ add_post_type_support( 'page', 'excerpt' );
}
add_filter( 'excerpt_more', NS . 'remove_brackets_from_excerpt' );
/**
* Removes brackets from excerpt more string.
*
- * @param string $more Read more text.
+ * @since 1.3.0
*
- * @since 0.0.1
+ * @param string $more Read more text.
*
* @return string
*/
diff --git a/includes/blocks/post-featured-image.php b/includes/blocks/post-featured-image.php
index 4ae0129..4fe8ef1 100644
--- a/includes/blocks/post-featured-image.php
+++ b/includes/blocks/post-featured-image.php
@@ -5,62 +5,114 @@
namespace Blockify\Theme;
use function add_filter;
+use function esc_attr;
use function explode;
use function implode;
-use function in_array;
-add_filter( 'render_block_core/post-featured-image', NS . 'render_featured_image_block', 10, 2 );
+add_filter( 'render_block_core/post-featured-image', NS . 'render_post_featured_image_block', 10, 2 );
/**
* Modifies front end HTML output of block.
*
- * @since 0.0.2
+ * @since 1.3.0
*
* @param string $html Block HTML.
* @param array $block Block data.
*
* @return string
*/
-function render_featured_image_block( string $html, array $block ): string {
- if ( ! $html ) {
- $html = render_image_placeholder( $html, $block['attrs'] );
+function render_post_featured_image_block( string $html, array $block ): string {
+ $dom = dom( $html );
+ $figure = get_dom_element( 'figure', $dom );
+ $img = get_dom_element( 'img', $figure );
+
+ if ( ! $figure ) {
+ return $html;
+ }
+
+ $figure_classes = explode( ' ', $figure->getAttribute( 'class' ) );
+ $attrs = $block['attrs'] ?? [];
+ $shadow_preset = esc_attr( $attrs['shadowPreset'] ?? '' );
+ $hover_preset = esc_attr( $attrs['shadowPresetHover'] ?? '' );
+ $use_custom = $attrs['useCustomBoxShadow'] ?? null;
+ $shadow_custom = $attrs['style']['boxShadow'] ?? null;
+ $hover_custom = $attrs['style']['boxShadow']['hover'] ?? null;
+ $border_radius = $attrs['style']['border']['radius'] ?? null;
+
+ if ( $shadow_preset ) {
+ $figure_classes[] = 'has-shadow';
+ $figure_classes[] = "has-{$shadow_preset}-shadow";
+ }
+
+ if ( $hover_preset ) {
+ $figure_classes[] = "has-{$hover_preset}-shadow-hover";
}
- $shadow = $block['attrs']['style']['boxShadow'] ?? null;
+ $figure->setAttribute( 'class', implode( ' ', $figure_classes ) );
+
+ $figure_styles = css_string_to_array( $figure->getAttribute( 'style' ) );
+
+ if ( $use_custom && $shadow_custom ) {
+ $color = $shadow_custom['color'] ?? null;
+
+ if ( $color ) {
+ $figure_styles['--wp--custom--box-shadow--color'] = format_custom_property( $color );
+ }
+ }
- if ( $shadow ) {
- $dom = dom( $html );
- $figure = get_dom_element( 'figure', $dom );
- $img = get_dom_element( 'img', $figure );
+ if ( $use_custom && $hover_custom ) {
+ $color = $hover_custom['color'] ?? null;
- if ( ! $img ) {
- return $html;
+ if ( $color ) {
+ $figure_styles['--wp--custom--box-shadow--hover--color'] = format_custom_property( $color );
}
+ }
- $styles = css_string_to_array( $img->getAttribute( 'style' ) );
+ if ( $border_radius ) {
+ $figure_styles['border-radius'] = $border_radius;
+ }
- foreach ( $shadow as $property => $value ) {
- if ( ! $value ) {
- continue;
- }
+ $img_classes = $img ? explode( ' ', $img->getAttribute( 'class' ) ) : [];
- $px = in_array( $property, [ 'x', 'y', 'blur', 'spread' ], true ) ? 'px' : '';
+ $transform = $attrs['style']['transform'] ?? [];
+ $transform_units = [
+ 'rotate' => 'deg',
+ 'skew' => 'deg',
+ 'scale' => '',
+ 'translate' => '',
+ ];
- $styles[ '--wp--custom--box-shadow--' . $property ] = $value . $px;
+ if ( ! empty( $transform ) && is_array( $transform ) ) {
+ $transform_value = '';
+
+ foreach ( $transform as $key => $value ) {
+ $unit = $transform_units[ $key ] ?? '';
+ $transform_value .= "{$key}({$value}{$unit}) ";
}
- if ( ! isset( $styles['--wp--custom--box-shadow--inset'] ) ) {
- $styles['--wp--custom--box-shadow--inset'] = '';
+ if ( ! in_array( 'has-transform', $img_classes, true ) ) {
+ $figure_styles['transform'] = $transform_value;
}
+ }
- $img->setAttribute( 'style', css_array_to_string( $styles ) );
+ $filter = $attrs['style']['filter'] ?? [];
- $classes = explode( ' ', $img->getAttribute( 'class' ) );
- $classes[] = 'has-box-shadow';
+ if ( ! empty( $filter ) && is_array( $filter ) ) {
+ $filter_options = get_filter_options();
+ $filter_value = '';
- $img->setAttribute( 'class', implode( ' ', $classes ) );
+ foreach ( $filter as $key => $value ) {
+ $unit = $filter_options[ $key ]['unit'] ?? '';
+ $filter_value .= "{$key}({$value}{$unit}) ";
+ }
+
+ if ( ! in_array( 'has-filter', $img_classes, true ) ) {
+ $figure_styles['filter'] = $filter_value;
+ }
+ }
- $html = $dom->saveHTML();
+ if ( $figure_styles ) {
+ $figure->setAttribute( 'style', css_array_to_string( $figure_styles ) );
}
- return $html;
+ return $dom->saveHTML();
}
diff --git a/includes/blocks/post-template.php b/includes/blocks/post-template.php
new file mode 100644
index 0000000..99718f8
--- /dev/null
+++ b/includes/blocks/post-template.php
@@ -0,0 +1,43 @@
+getAttribute( 'style' ) );
+
+ $first_styles['gap'] = format_custom_property( $block_gap );
+ $first_styles['display'] = 'flex';
+ $first_styles['flex-wrap'] = 'wrap';
+
+ $first->setAttribute( 'style', css_array_to_string( $first_styles ) );
+
+ $html = $dom->saveHTML();
+ }
+ }
+
+ return $html;
+}
diff --git a/includes/blocks/post-terms.php b/includes/blocks/post-terms.php
index 2ae5978..5687d30 100644
--- a/includes/blocks/post-terms.php
+++ b/includes/blocks/post-terms.php
@@ -5,10 +5,21 @@
namespace Blockify\Theme;
use function add_filter;
+use function array_key_last;
+use function array_unique;
+use function esc_attr;
+use function esc_html;
+use function esc_html__;
+use function esc_url;
+use function explode;
+use function get_post_type;
use function get_term_link;
use function get_terms;
-use function str_contains;
-use function str_replace;
+use function in_array;
+use function is_front_page;
+use function is_singular;
+use function is_string;
+use function trim;
add_filter( 'render_block_core/post-terms', NS . 'render_post_terms_block', 10, 2 );
/**
@@ -22,94 +33,221 @@
* @return string
*/
function render_post_terms_block( string $html, array $block ): string {
- if ( $block['attrs']['align'] ?? null ) {
- $html = str_replace(
- [
+ $attrs = $block['attrs'] ?? [];
+
+ if ( $attrs['align'] ?? null ) {
+ $dom = dom( $html );
+ $div = get_dom_element( 'div', $dom );
+
+ if ( $div ) {
+ $classes = array_unique( [
'wp-block-post-terms',
- 'rel="tag"',
- ],
- [
- 'wp-block-post-terms flex justify-' . $block['attrs']['align'],
- 'class="wp-block-post-terms__link" rel="tag"',
- ],
- $html
- );
+ 'flex',
+ 'wrap',
+ 'justify-' . esc_attr( $attrs['align'] ?? 'left' ),
+ ...( explode( ' ', $div->getAttribute( 'class' ) ) ),
+ ] );
+
+ $div->setAttribute( 'class', implode( ' ', $classes ) );
+ }
+
+ $html = $dom->saveHTML();
+ }
+
+ $term = $attrs['term'] ?? '';
+
+ if ( ! $term ) {
+ return $html;
}
// Remove empty separator elements.
- $separator = $block['attrs']['separator'] ?? null;
+ $separator = $attrs['separator'] ?? null;
if ( $separator === '' ) {
$dom = dom( $html );
$div = get_dom_element( 'div', $dom );
if ( $div ) {
- $separators = $div->getElementsByTagName( 'span' );
- foreach ( $separators as $empty_separator ) {
- $empty_separator->parentNode->removeChild( $empty_separator );
+ foreach ( $div->childNodes as $child ) {
+
+ if ( $child->nodeName === 'span' && ! trim( $child->nodeValue ) ) {
+ $div->removeChild( $child );
+ }
}
$html = $dom->saveHTML();
}
}
- if ( str_contains( $html, 'all-terms' ) ) {
- $dom = dom( $html );
- $div = get_dom_element( 'div', $dom );
+ $show_all = $attrs['showAll'] ?? false;
+
+ if ( ! $html || $show_all ) {
+ $dom = dom( '
' );
+ $div = get_dom_element( 'div', $dom );
+ $div_classes = [
+ ...( explode( ' ', $attrs['className'] ?? '' ) ),
+ 'wp-block-post-terms',
+ 'taxonomy-' . $term,
+ ];
+
+ $text_align = esc_attr( $attrs['textAlign'] ?? '' );
+
+ if ( $text_align ) {
+ $div_classes[] = 'has-text-align-' . $text_align;
+ $div_classes[] = 'justify-' . $text_align;
+ }
+
+ $text_color = esc_attr( $attrs['textColor'] ?? '' );
+
+ if ( $text_color ) {
+ $div_classes[] = 'has-' . $text_color . '-color';
+ }
+
+ $taxonomy = get_taxonomy( $term );
+ $post_type = $taxonomy->object_type[0] ?? get_post_type();
+
+ if ( ( is_singular() && ! is_front_page() && ! $show_all ) || ! $show_all ) {
+ $p = create_element( 'p', $dom );
+ $p->nodeValue = esc_html( $taxonomy->labels->not_found ?? '' );
+
+ $p->setAttribute( 'class', 'margin-top-auto margin-bottom-auto' );
+
+ $div->appendChild( $p );
+
+ } else {
+ $a = create_element( 'a', $dom );
+ $archive_link = get_post_type_archive_link( $post_type );
+
+ if ( ! is_string( $archive_link ) ) {
+ return '';
+ }
- if ( ! $div ) {
- return $html;
+ $a->setAttribute( 'href', esc_url( $archive_link ) );
+ $a->setAttribute( 'class', 'wp-block-post-terms__link' );
+ $a->setAttribute( 'rel', 'tag' );
+ $a->nodeValue = esc_html__( 'All', 'blockify' );
+
+ $div->appendChild( $a );
+
+ if ( ! in_array( 'is-style-badges', $div_classes, true ) ) {
+ $div->appendChild(
+ $dom->createTextNode( $separator ?? '' )
+ );
+ }
+
+ $terms = get_terms(
+ [
+ 'taxonomy' => $term,
+ 'hide_empty' => true,
+ ]
+ );
+
+ foreach ( $terms as $index => $term_object ) {
+ $a = create_element( 'a', $dom );
+ $term_link = get_term_link( $term_object );
+
+ if ( ! is_string( $term_link ) ) {
+ continue;
+ }
+
+ $a->setAttribute( 'href', esc_url( $term_link ) );
+ $a->setAttribute( 'class', 'wp-block-post-terms__link' );
+ $a->setAttribute( 'rel', 'tag' );
+ $a->nodeValue = esc_html( $term_object->name ?? '' );
+
+ $div->appendChild( $a );
+
+ if ( ! in_array( 'is-style-badges', $div_classes, true ) && $index !== array_key_last( $terms ) ) {
+ $div->appendChild(
+ $dom->createTextNode( $separator ?? '' )
+ );
+ }
+ }
}
- $terms = get_terms(
- [
- 'taxonomy' => $block['attrs']['term'],
- 'hide_empty' => true,
- ]
- );
+ $styles = [];
+ $margin = $attrs['style']['spacing']['margin'] ?? null;
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
- $links = get_elements_by_class_name( $div, 'wp-block-post-terms__link' );
+ $text_decoration = esc_attr( $attrs['style']['typography']['textDecoration'] ?? '' );
- foreach ( $links as $link ) {
- $link->parentNode->removeChild( $link );
+ if ( $text_decoration ) {
+ $styles['text-decoration'] = $text_decoration;
}
- foreach ( $terms as $term ) {
- $link = $dom->createElement( 'a' );
+ $font_size = esc_attr( $attrs['fontSize'] ?? '' );
+
+ if ( $font_size ) {
+ $div_classes[] = 'has-font-size';
+ $div_classes[] = 'has-' . $font_size . '-font-size';
+ }
- $link->setAttribute( 'href', get_term_link( $term ) );
+ $font_size_custom = esc_attr( $attrs['style']['typography']['fontSize'] ?? '' );
- $link->setAttribute( 'class', 'wp-block-post-terms__link' );
+ if ( $font_size_custom ) {
+ $styles['font-size'] = format_custom_property( $font_size_custom );
+ $div_classes[] = 'has-font-size';
+ }
- $link->setAttribute( 'rel', 'tag' );
+ $padding = $attrs['style']['spacing']['padding'] ?? null;
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
- $link->nodeValue = $term->name;
+ $div->setAttribute( 'class', implode( ' ', $div_classes ) );
- $div->appendChild( $link );
+ if ( $styles ) {
+ $div->setAttribute( 'style', css_array_to_string( $styles ) );
}
$html = $dom->saveHTML();
}
- $margin = $block['attrs']['style']['spacing']['margin'] ?? [];
+ $dom = dom( $html );
- if ( $margin ) {
- $dom = dom( $html );
- $div = get_dom_element( 'div', $dom );
+ // First child either div or ul.
+ $first = get_dom_element( '*', $dom );
- if ( $div ) {
- $styles = css_string_to_array( $div->getAttribute( 'style' ) );
+ if ( $first ) {
+ $styles = css_string_to_array( $first->getAttribute( 'style' ) );
- foreach ( $margin as $key => $value ) {
- $styles[ 'margin-' . $key ] = format_custom_property( $value );
- }
+ $gap = $attrs['style']['spacing']['blockGap'] ?? '';
- $div->setAttribute( 'style', css_array_to_string( $styles ) );
+ if ( $gap ) {
+ $styles['gap'] = format_custom_property( $gap );
+ }
- $html = $dom->saveHTML();
+ $font_weight = esc_attr( $attrs['style']['typography']['fontWeight'] ?? '' );
+
+ if ( $font_weight ) {
+ $styles['font-weight'] = $font_weight;
+ }
+
+ $border = $attrs['style']['border'] ?? null;
+ $radius = $border['radius'] ?? null;
+
+ if ( $radius ) {
+ $styles['--wp--custom--border--radius'] = esc_attr( $radius );
+ }
+
+ if ( $styles ) {
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
+ }
+ }
+
+ $class_names = explode( ' ', $attrs['className'] ?? '' );
+
+ if ( in_array( 'is-style-badges', $class_names, true ) ) {
+ $padding = $attrs['style']['spacing']['padding'] ?? null;
+
+ if ( $padding && $first ) {
+ $styles = css_string_to_array( $first->getAttribute( 'style' ) );
+ unset( $styles['padding'] );
+
+ $styles = add_shorthand_property( $styles, '--wp--custom--badge--padding', $padding );
+
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
}
}
- return $html;
+ return $dom->saveHTML();
}
diff --git a/includes/blocks/post-title.php b/includes/blocks/post-title.php
index 44483e3..3586ffc 100644
--- a/includes/blocks/post-title.php
+++ b/includes/blocks/post-title.php
@@ -6,8 +6,11 @@
use DOMElement;
use function add_filter;
+use function esc_html;
+use function esc_html__;
use function get_option;
use function get_post;
+use function intval;
use function is_home;
use function sanitize_title_with_dashes;
use function str_contains;
@@ -31,22 +34,22 @@ function render_post_title_block( string $html, array $block ): string {
$page_for_posts = get_post( get_option( 'page_for_posts' ) );
if ( $page_for_posts->post_type === 'page' ) {
- $title = $page_for_posts->post_title;
+ $title = esc_html( $page_for_posts->post_title );
} else {
- $title = __( 'Latest Posts', 'blockify' );
+ $title = esc_html__( 'Latest Posts', 'blockify' );
}
$html = str_replace( $text, $title, $html );
}
- $tag = 'h' . ( $block['attrs']['level'] ?? 2 );
+ $tag = 'h' . intval( $block['attrs']['level'] ?? 2 );
$dom = dom( $html );
$heading = get_dom_element( $tag, $dom );
if ( $heading instanceof DOMElement ) {
$heading->setAttribute(
'id',
- $block['attrs']['anchor'] ?? sanitize_title_with_dashes( $heading->textContent )
+ sanitize_title_with_dashes( $block['attrs']['anchor'] ?? $heading->textContent )
);
}
diff --git a/includes/blocks/query-pagination.php b/includes/blocks/query-pagination.php
index 7512437..d5db4f8 100644
--- a/includes/blocks/query-pagination.php
+++ b/includes/blocks/query-pagination.php
@@ -13,8 +13,8 @@
*
* @since 0.0.2
*
- * @param string $html Block HTML.
- * @param array $block Block data.
+ * @param string $html Block HTML.
+ * @param array $block Block data.
*
* @return string
*/
@@ -26,27 +26,29 @@ function render_query_pagination_block( string $html, array $block ): string {
return $html;
}
- $styles = css_string_to_array( $nav->getAttribute( 'style' ) );
-
- $margin = $block['attrs']['style']['spacing']['margin'] ?? null;
-
- if ( $margin ) {
- $styles['margin-top'] = $margin['top'] ?? null;
- $styles['margin-right'] = $margin['right'] ?? null;
- $styles['margin-bottom'] = $margin['bottom'] ?? null;
- $styles['margin-left'] = $margin['left'] ?? null;
- }
+ $styles = css_string_to_array( $nav->getAttribute( 'style' ) );
+ $margin = $block['attrs']['style']['spacing']['margin'] ?? null;
+ $padding = $block['attrs']['style']['spacing']['padding'] ?? null;
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
foreach ( $styles as $key => $value ) {
if ( ! $value ) {
continue;
}
+ // TODO: Which properties need formatting?
if ( str_contains( $value, 'var:' ) ) {
$styles[ $key ] = format_custom_property( $value );
}
}
+ $border_radius = $block['attrs']['style']['border']['radius'] ?? null;
+
+ if ( $border_radius ) {
+ $styles['border-radius'] = $border_radius;
+ }
+
$nav->setAttribute( 'style', css_array_to_string( $styles ) );
return $dom->saveHTML();
diff --git a/includes/blocks/query-title.php b/includes/blocks/query-title.php
index 143cd50..aa79352 100644
--- a/includes/blocks/query-title.php
+++ b/includes/blocks/query-title.php
@@ -5,6 +5,8 @@
namespace Blockify\Theme;
use function add_filter;
+use function esc_attr;
+use function esc_html;
use function get_option;
use function implode;
use function is_front_page;
@@ -20,7 +22,6 @@
* @return string
*/
function render_archive_title_block( string $html, array $block ): string {
-
if ( $html ) {
return $html;
}
@@ -35,37 +36,29 @@ function render_archive_title_block( string $html, array $block ): string {
return '';
}
- $text_align = $block['attrs']['textAlign'] ?? null;
-
$dom = dom( $html );
- $h1 = $dom->createElement( 'h1' );
+ $h1 = create_element( 'h1', $dom );
$classes = [
'wp-block-query-title',
];
+ $text_align = $block['attrs']['textAlign'] ?? null;
+
if ( $text_align ) {
- $classes[] = 'has-text-align-' . $text_align;
+ $classes[] = 'has-text-align-' . esc_attr( $text_align );
}
$h1->setAttribute( 'class', implode( ' ', $classes ) );
+ $styles = [];
$margin = $block['attrs']['style']['spacing']['margin'] ?? [];
$padding = $block['attrs']['style']['spacing']['padding'] ?? [];
- $styles = [];
-
- foreach ( $margin as $key => $value ) {
- $styles[ 'margin-' . $key ] = $value;
- }
-
- foreach ( $padding as $key => $value ) {
- $styles[ 'padding-' . $key ] = $value;
- }
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
$h1->setAttribute( 'style', css_array_to_string( $styles ) );
-
- $h1->nodeValue = get_the_title( $page_for_posts );
-
+ $h1->nodeValue = esc_html( get_the_title( $page_for_posts ) );
$dom->appendChild( $h1 );
return $dom->saveHTML();
diff --git a/includes/blocks/search.php b/includes/blocks/search.php
index 5bd90b6..7a33700 100644
--- a/includes/blocks/search.php
+++ b/includes/blocks/search.php
@@ -5,12 +5,8 @@
namespace Blockify\Theme;
use function add_filter;
-use function apply_filters;
+use function esc_attr;
use function explode;
-use function get_post_type;
-use function is_post_type_archive;
-use function str_contains;
-use function str_replace;
use function trim;
add_filter( 'render_block_core/search', NS . 'render_search_block', 10, 2 );
@@ -25,124 +21,196 @@
* @return string
*/
function render_search_block( string $html, array $block ): string {
- $dom = dom( $html );
- $form = get_dom_element( 'form', $dom );
+ $dom = dom( $html );
+ $form = get_dom_element( 'form', $dom );
+ $wrap = get_dom_element( 'div', $form );
+ $input = get_dom_element( 'input', $wrap );
- if ( ! $form ) {
+ if ( ! $input ) {
return $html;
}
- $div = get_dom_element( 'div', $form );
+ $button = get_dom_element( 'button', $wrap );
+ $use_icon = $block['attrs']['buttonUseIcon'] ?? false;
+ $button_position = $block['attrs']['buttonPosition'] ?? 'button-outside';
+ $show_icon = ! $use_icon || ( $button_position === 'button-outside' || $button_position === 'no-button' );
+ $padding = $block['attrs']['style']['spacing']['padding'] ?? [];
+ $margin = $block['attrs']['style']['spacing']['margin'] ?? [];
+ $background_color = $block['attrs']['backgroundColor'] ?? '';
+ $background_custom = $block['attrs']['style']['color']['background'] ?? '';
+ $input_background = $block['attrs']['inputBackgroundColor'] ?? '';
+ $border = $block['attrs']['style']['border'] ?? [];
+ $border_color = $block['attrs']['style']['border']['color'] ?? $block['attrs']['borderColor'] ?? '';
+ $box_shadow = $block['attrs']['style']['boxShadow'] ?? [];
+ $shadow_preset = esc_attr( $block['attrs']['shadowPreset'] ?? '' );
+ $shadow_preset_hover = esc_attr( $block['attrs']['shadowPresetHover'] ?? '' );
+
+ $input_styles = css_string_to_array( $input->getAttribute( 'style' ) );
+ $input_classes = explode( ' ', $input->getAttribute( 'class' ) );
+
+ $button_styles = $button ? css_string_to_array( $button->getAttribute( 'style' ) ) : [];
+
+ if ( ! $button || $button_position === 'button-inside' ) {
+ if ( $background_color ) {
+ $input_classes[] = "has-{$background_color}-background-color";
+ }
- if ( ! $div ) {
- return $html;
+ if ( $background_custom ) {
+ $input_styles['background-color'] = format_custom_property( $background_custom );
+ }
+ }
+
+ if ( $shadow_preset ) {
+ $input_classes[] = "has-{$shadow_preset}-shadow";
+ }
+
+ if ( $shadow_preset_hover ) {
+ $input_classes[] = "has-{$shadow_preset_hover}-shadow-hover";
+ }
+
+ if ( $box_shadow ) {
+ $x = $box_shadow['x'] ?? '0';
+ $y = $box_shadow['y'] ?? '0';
+ $blur = $box_shadow['blur'] ?? '0';
+ $spread = $box_shadow['spread'] ?? '0';
+ $color = $box_shadow['color'] ?? '';
+
+ $input_styles['box-shadow'] = "{$x}px {$y}px {$blur}px {$spread}px {$color}";
+ }
+
+ if ( $padding['top'] ?? '' ) {
+ $input_styles['padding-top'] = format_custom_property( $padding['top'] ?? '' );
+ }
+
+ if ( $padding['right'] ?? '' ) {
+ $input_styles['padding-right'] = format_custom_property( $padding['right'] ?? '' );
+ }
+
+ if ( $padding['bottom'] ?? '' ) {
+ $input_styles['padding-bottom'] = format_custom_property( $padding['bottom'] ?? '' );
+ }
+
+ if ( $padding['left'] ?? '' ) {
+ $padding_left = 'calc(' . format_custom_property( $padding['left'] ?? '' ) . ' * 2)';
+
+ if ( $show_icon ) {
+ $padding_left = 'calc(1em + (' . format_custom_property( $padding['left'] ?? '' ) . ' * 2))';
+ }
+
+ $input_styles['padding-left'] = $padding_left;
+ }
+
+ if ( $border['width'] ?? '' ) {
+ $input_styles['border-width'] = format_custom_property( $border['width'] ?? '' );
+ }
+
+ if ( $border['style'] ?? '' ) {
+ $input_styles['border-style'] = format_custom_property( $border['style'] ?? '' );
}
- $padding = $block['attrs']['style']['spacing']['padding'] ?? [];
- $input = get_dom_element( 'input', $div );
+ if ( $border_color ) {
+ $input_styles['border-color'] = format_custom_property( $border_color );
+ }
+
+ if ( $border['radius'] ?? '' ) {
+ $input_styles['border-radius'] = format_custom_property( $border['radius'] ?? '' );
+ }
- if ( $padding && $input ) {
+ if ( $input_background ) {
+ $input_styles['background-color'] = format_custom_property( $input_background );
+ }
+
+ if ( $input_styles ) {
+ $input_styles['height'] = 'auto';
+
+ $input->setAttribute(
+ 'style',
+ css_array_to_string( $input_styles )
+ );
+ }
+
+ $input->setAttribute(
+ 'class',
+ implode( ' ', $input_classes )
+ );
+
+ if ( $button && $button_styles ) {
+ $button->setAttribute(
+ 'style',
+ css_array_to_string( $button_styles )
+ );
+ }
+
+ $form_styles = css_string_to_array( $form->getAttribute( 'style' ) );
+ $form_styles = add_shorthand_property( $form_styles, 'margin', $margin );
+
+ if ( $form_styles ) {
$form->setAttribute(
'style',
- implode(
- ';',
- [
- 'padding-top:' . format_custom_property( $padding['top'] ?? '' ),
- 'padding-right:' . format_custom_property( $padding['right'] ?? '' ),
- 'padding-bottom:' . format_custom_property( $padding['bottom'] ?? '' ),
- 'padding-left:' . format_custom_property( $padding['left'] ?? '' ),
- ]
- )
+ css_array_to_string( $form_styles )
);
}
- $html = $dom->saveHTML();
- $class_name = $block['attrs']['className'] ?? '';
-
- if ( $class_name && str_contains( $class_name, 'is-style-toggle' ) ) {
- $dom = dom( $html );
- $form = get_dom_element( 'form', $dom );
- $label = get_dom_element( 'label', $form );
- $wrap = get_dom_element( 'div', $form );
- $input = get_dom_element( 'input', $wrap );
- $button = get_dom_element( 'button', $wrap );
- $button = change_tag_name( $button, 'label' );
- $checkbox = $dom->createElement( 'input' );
- $placeholder = $input->getAttribute( 'placeholder' );
-
- if ( ! $placeholder ) {
- $input->setAttribute(
- 'placeholder',
- apply_filters( 'blockify_search_placeholder', __( 'Search this website', 'blockify' ) )
- );
- }
+ $wrap_styles = css_string_to_array( $wrap->getAttribute( 'style' ) );
+ $gap = $block['attrs']['style']['spacing']['blockGap'] ?? '';
+
+ if ( $gap ) {
+ $wrap_styles['gap'] = format_custom_property( $gap );
+ }
- $checkbox->setAttribute( 'class', 'wp-block-search__checkbox screen-reader-text' );
- $checkbox->setAttribute( 'type', 'checkbox' );
- $checkbox->setAttribute( 'id', $label->getAttribute( 'for' ) . '-checkbox' );
- $button->setAttribute( 'for', $checkbox->getAttribute( 'id' ) );
+ if ( $border['radius'] ?? '' ) {
+ $wrap_styles['border-radius'] = format_custom_property( $border['radius'] ?? '' );
+ }
+ if ( $wrap_styles ) {
$wrap->setAttribute(
- 'class',
- trim(
- str_replace(
- [ 'wp-block-search__button', 'has-icon', 'wp-element-button' ],
- '',
- $button->getAttribute( 'class' ) . ' ' . $wrap->getAttribute( 'class' )
- )
- )
+ 'style',
+ css_array_to_string( $wrap_styles )
);
+ }
- $button_classes = explode( ' ', $button->getAttribute( 'class' ) );
- $button_class = '';
+ if ( $show_icon ) {
+ $svg_dom = dom( get_icon( 'wordpress', 'search' ) );
+ $svg = get_dom_element( 'svg', $svg_dom );
- foreach ( $button_classes as $class ) {
- if ( ! str_contains( $class, '-background' ) ) {
- $button_class .= $class . ' ';
- }
+ if ( ! $svg ) {
+ return $dom->saveHTML();
}
- $button->setAttribute( 'class', $button_class );
+ $svg_classes = explode( ' ', $svg->getAttribute( 'class' ) );
+ $svg_styles = css_string_to_array( $svg->getAttribute( 'style' ) );
+ $svg_classes[] = 'wp-block-search__icon';
- $wrap->appendChild( $input );
- $form->removeChild( $label );
- $form->removeChild( $wrap );
- $form->appendChild( $wrap );
- $form->insertBefore( $button, $wrap );
- $button->insertBefore( $checkbox, $button->firstChild );
+ if ( $padding['left'] ?? '' ) {
+ $left = format_custom_property( $padding['left'] );
- $close = $dom->createElement( 'svg' );
- $close->setAttribute( 'xmlns', 'http://www.w3.org/2000/svg' );
- $close->setAttribute( 'viewBox', '0 0 24 24' );
- $close->setAttribute( 'class', 'close-icon' );
+ $svg_styles['left'] = 'calc(0.25em + (' . $left . ' / 2))';
+ }
- $close_path = $dom->createElement( 'path' );
- $close_path->setAttribute( 'd', 'm13 11.8 6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z' );
- $close_path->setAttribute( 'fill', 'currentColor' );
+ $svg->setAttribute( 'class', trim( implode( ' ', $svg_classes ) ) );
- $close->appendChild( $close_path );
- $button->appendChild( $close );
+ if ( $svg_styles ) {
+ $svg->setAttribute( 'style', css_array_to_string( $svg_styles ) );
+ }
- $html = $dom->saveHTML();
+ $imported_svg = $dom->importNode( $svg, true );
+ $wrap->insertBefore( $imported_svg, $input );
}
- $post_type = get_post_type();
+ $post_type = esc_attr( $block['attrs']['postType'] ?? '' );
- if ( $post_type && is_post_type_archive() ) {
- $dom = dom( $html );
+ if ( $post_type ) {
$form = get_dom_element( 'form', $dom );
if ( $form ) {
- $post_type_field = $dom->createElement( 'input' );
+ $post_type_field = create_element( 'input', $dom );
$post_type_field->setAttribute( 'type', 'hidden' );
$post_type_field->setAttribute( 'name', 'post_type' );
$post_type_field->setAttribute( 'value', $post_type );
$form->insertBefore( $post_type_field, $form->firstChild );
-
- $html = $dom->saveHTML();
}
}
- return $html;
+ return $dom->saveHTML();
}
diff --git a/includes/blocks/shortcode.php b/includes/blocks/shortcode.php
new file mode 100644
index 0000000..3a57c2b
--- /dev/null
+++ b/includes/blocks/shortcode.php
@@ -0,0 +1,34 @@
+', '
' ], '', $html );
+}
+
+add_filter( 'render_block_core/shortcode', NS . 'render_block_shortcode', 11, 2 );
+/**
+ * Render the block shortcode.
+ *
+ * @param string $html The block content.
+ * @param array $block The block.
+ *
+ * @return string
+ */
+function render_block_shortcode( string $html, array $block ): string {
+ return do_shortcode( $html );
+}
diff --git a/includes/blocks/site-logo.php b/includes/blocks/site-logo.php
deleted file mode 100644
index 0c382f1..0000000
--- a/includes/blocks/site-logo.php
+++ /dev/null
@@ -1,67 +0,0 @@
-getAttribute( 'src' )
- );
-
- if ( ! file_exists( $file ) ) {
- return $html;
- }
-
- $svg = $dom->importNode( dom( file_get_contents( $file ) )->documentElement, true );
-
- if ( ! method_exists( $svg, 'setAttribute' ) ) {
- return $html;
- }
-
- $svg->setAttribute( 'width', $img->getAttribute( 'width' ) );
- $svg->setAttribute( 'height', $img->getAttribute( 'height' ) );
- $svg->setAttribute( 'aria-label', $img->getAttribute( 'alt' ) );
- $svg->setAttribute( 'class', $img->getAttribute( 'class' ) );
-
- ( $link ?? $div )->removeChild( $img );
- ( $link ?? $div )->appendChild( $svg );
-
- $html = $dom->saveHTML();
- }
-
- return $html;
-}
diff --git a/includes/blocks/social-link.php b/includes/blocks/social-link.php
index 9298649..5f76091 100644
--- a/includes/blocks/social-link.php
+++ b/includes/blocks/social-link.php
@@ -5,21 +5,23 @@
namespace Blockify\Theme;
use function add_filter;
+use function esc_attr;
use function file_get_contents;
add_filter( 'render_block_core/social-link', NS . 'render_social_link_block', 10, 2 );
/**
* Modifies front end HTML output of block.
*
- * @param string $html Block HTML.
+ * @since 0.0.24
+ *
* @param array $block Block data.
*
- * @since 0.0.24
+ * @param string $html Block HTML.
*
* @return string
*/
function render_social_link_block( string $html, array $block ): string {
- $textColor = $block['attrs']['textColor'] ?? null;
+ $textColor = esc_attr( $block['attrs']['textColor'] ?? '' );
if ( $textColor ) {
$dom = dom( $html );
diff --git a/includes/blocks/social-links.php b/includes/blocks/social-links.php
index 8fe892c..015a177 100644
--- a/includes/blocks/social-links.php
+++ b/includes/blocks/social-links.php
@@ -6,6 +6,7 @@
use DOMElement;
use function add_filter;
+use function esc_attr;
use function trim;
use function wp_get_global_settings;
@@ -44,8 +45,16 @@ function render_social_links_block( string $html, array $block ): string {
}
foreach ( $color_palette as $color ) {
- if ( trim( $styles['color'] ) === trim( $color['color'] ) ) {
- $styles['color'] = "var(--wp--preset--color--{$color['slug']})";
+ $hex = $color['color'] ?? '';
+
+ if ( trim( $styles['color'] ) === trim( $hex ) ) {
+ $slug = esc_attr( $color['slug'] ?? '' );
+
+ if ( ! $slug ) {
+ continue;
+ }
+
+ $styles['color'] = "var(--wp--preset--color--$slug)";
$child->setAttribute( 'style', css_array_to_string( $styles ) );
break;
diff --git a/includes/blocks/spacer.php b/includes/blocks/spacer.php
new file mode 100644
index 0000000..2e52b6c
--- /dev/null
+++ b/includes/blocks/spacer.php
@@ -0,0 +1,43 @@
+getAttribute( 'style' ) );
+
+ $margin = $block['attrs']['style']['spacing']['margin'] ?? '';
+ $div_styles = add_shorthand_property( $div_styles, 'margin', $margin );
+
+ $width = $block['attrs']['width'] ?? '';
+ $responsive_width = $block['attrs']['style']['width']['all'] ?? '';
+
+ if ( $width && $responsive_width ) {
+ unset ( $div_styles['width'] );
+ }
+
+ $div->setAttribute( 'style', css_array_to_string( $div_styles ) );
+
+ return $dom->saveHTML();
+}
diff --git a/includes/blocks/table-of-contents.php b/includes/blocks/table-of-contents.php
index ad5afba..33f8168 100644
--- a/includes/blocks/table-of-contents.php
+++ b/includes/blocks/table-of-contents.php
@@ -4,9 +4,9 @@
namespace Blockify\Theme;
-use Exception;
use function add_filter;
use function do_blocks;
+use function esc_html__;
use function get_the_content;
use function get_the_title;
use function in_array;
@@ -23,8 +23,6 @@
* @param string $html The block content.
* @param array $block The block.
*
- * @throws Exception If the DOMDocument fails to load the HTML.
- *
* @return string
*/
function render_table_of_contents( string $html, array $block ): string {
@@ -37,9 +35,9 @@ function render_table_of_contents( string $html, array $block ): string {
if ( in_array(
$content,
[
- __( 'Table of Contents', 'blockify' ),
- __( 'Contents', 'blockify' ),
- __( 'Table of contents', 'blockify' ),
+ esc_html__( 'Table of Contents', 'blockify' ),
+ esc_html__( 'Contents', 'blockify' ),
+ esc_html__( 'Table of contents', 'blockify' ),
],
true
) ) {
@@ -72,18 +70,18 @@ function render_table_of_contents( string $html, array $block ): string {
$nav->removeChild( $nav->firstChild );
- $ol = $dom->createElement( 'ol' );
+ $ol = create_element( 'ol', $dom );
$nav->appendChild( $ol );
foreach ( $content_headings as $content_heading ) {
- $link = $dom->createElement( 'a' );
+ $link = create_element( 'a', $dom );
$link->setAttribute( 'href', '#' . sanitize_title( $content_heading ) );
$link->textContent = $content_heading;
- $li = $dom->createElement( 'li' );
+ $li = create_element( 'li', $dom );
$li->appendChild( $link );
$ol->appendChild( $li );
diff --git a/includes/blocks/tag-cloud.php b/includes/blocks/tag-cloud.php
index 919fdd4..68efe27 100644
--- a/includes/blocks/tag-cloud.php
+++ b/includes/blocks/tag-cloud.php
@@ -5,6 +5,7 @@
namespace Blockify\Theme;
use function add_filter;
+use function esc_attr;
use function implode;
add_filter( 'render_block_core/tag-cloud', NS . 'render_tag_cloud_block', 10, 2 );
@@ -13,14 +14,14 @@
*
* @since 0.0.2
*
- * @param string $html Block HTML.
- * @param array $block Block data.
+ * @param string $html Block HTML.
+ * @param array $block Block data.
*
* @return string
*/
function render_tag_cloud_block( string $html, array $block ): string {
- $smallest = $block['attrs']['smallestFontSize'] ?? '1em';
- $largest = $block['attrs']['largestFontSize'] ?? '1em';
+ $smallest = esc_attr( $block['attrs']['smallestFontSize'] ?? '1em' );
+ $largest = esc_attr( $block['attrs']['largestFontSize'] ?? '1em' );
$dom = dom( $html );
$paragraph = get_dom_element( 'p', $dom );
diff --git a/includes/blocks/template-part.php b/includes/blocks/template-part.php
index fb0f090..eee53dd 100644
--- a/includes/blocks/template-part.php
+++ b/includes/blocks/template-part.php
@@ -4,7 +4,7 @@
namespace Blockify\Theme;
-use function add_filter;
+use function esc_attr;
add_filter( 'render_block_core/template-part', NS . 'render_block_template_part', 10, 2 );
/**
@@ -30,27 +30,27 @@ function render_block_template_part( string $html, array $block ): string {
$color = $attrs['style']['color'] ?? [];
if ( isset( $color['background'] ) ) {
- $styles['background'] = $color['background'];
+ $styles['background'] = esc_attr( $color['background'] );
}
if ( isset( $attrs['backgroundColor'] ) ) {
- $styles['background'] = 'var(--wp--preset--color--' . $attrs['backgroundColor'] . ')';
+ $styles['background'] = 'var(--wp--preset--color--' . esc_attr( $attrs['backgroundColor'] ) . ')';
}
if ( isset( $color['gradient'] ) ) {
- $styles['background'] = $color['gradient'];
+ $styles['background'] = esc_attr( $color['gradient'] );
}
if ( isset( $attrs['gradient'] ) ) {
- $styles['background'] = 'var(--wp--preset--gradient--' . $attrs['gradient'] . ')';
+ $styles['background'] = 'var(--wp--preset--gradient--' . esc_attr( $attrs['gradient'] ) . ')';
}
if ( isset( $color['text'] ) ) {
- $styles['color'] = $color['text'];
+ $styles['color'] = esc_attr( $color['text'] );
}
if ( isset( $attrs['textColor'] ) ) {
- $styles['color'] = 'var(--wp--preset--color--' . $attrs['textColor'] . ')';
+ $styles['color'] = 'var(--wp--preset--color--' . esc_attr( $attrs['textColor'] ) . ')';
}
$styles = css_array_to_string( $styles );
@@ -61,12 +61,15 @@ function render_block_template_part( string $html, array $block ): string {
$first->removeAttribute( 'style' );
}
- if ( $first->tagName === 'header' ) {
+ if ( $block['attrs']['slug'] === 'header' ) {
$first->setAttribute( 'role', 'banner' );
- $first->setAttribute( 'id', 'top' );
}
- if ( $first->tagName === 'footer' ) {
+ if ( $block['attrs']['slug'] === 'main' ) {
+ $first->setAttribute( 'role', 'main' );
+ }
+
+ if ( $block['attrs']['slug'] === 'footer' ) {
$first->setAttribute( 'role', 'contentinfo' );
}
diff --git a/includes/blocks/video.php b/includes/blocks/video.php
index 970425d..bde9ce8 100644
--- a/includes/blocks/video.php
+++ b/includes/blocks/video.php
@@ -7,6 +7,7 @@
use function add_action;
use function add_filter;
use function add_theme_support;
+use function esc_attr;
use function wp_add_inline_script;
use function wp_enqueue_script;
use function wp_enqueue_style;
@@ -35,9 +36,7 @@ function theme_supports(): void {
* @return string
*/
function render_video_block( string $html, array $block ): string {
-
- $dom = dom( $html );
-
+ $dom = dom( $html );
$figure = get_dom_element( 'figure', $dom );
if ( ! $figure ) {
@@ -48,7 +47,7 @@ function render_video_block( string $html, array $block ): string {
$background = $styles['background'] ?? $styles['background-color'] ?? '';
if ( $background ) {
- $styles['--wp--custom--video--background'] = $background;
+ $styles['--wp--custom--video--background'] = esc_attr( $background );
unset( $styles['background'], $styles['background-color'] );
}
@@ -57,7 +56,13 @@ function render_video_block( string $html, array $block ): string {
$html = $dom->saveHTML();
- add_action( 'wp_enqueue_scripts', NS . 'video_scripts_styles' );
+ static $is_enqueued = false;
+
+ if ( ! $is_enqueued ) {
+ add_action( 'wp_enqueue_scripts', NS . 'video_scripts_styles' );
+ }
+
+ $is_enqueued = true;
return $html;
}
diff --git a/includes/fonts.php b/includes/common/fonts.php
similarity index 63%
rename from includes/fonts.php
rename to includes/common/fonts.php
index 1e9616c..95362fc 100644
--- a/includes/fonts.php
+++ b/includes/common/fonts.php
@@ -7,6 +7,7 @@
use function add_filter;
use function apply_filters;
use function array_merge;
+use function is_readable;
add_filter( 'wp_theme_json_data_theme', NS . 'add_system_fonts' );
/**
@@ -17,7 +18,33 @@
* @return mixed
*/
function add_system_fonts( $theme_json ) {
- $data = $theme_json->get_data();
+ $data = $theme_json->get_data();
+ $theme_fonts = $data['settings']['typography']['fontFamilies']['theme'] ?? [];
+
+ static $added = false;
+
+ if ( ! $theme_fonts && ! $added ) {
+ $added = true;
+
+ $framework_theme_json_file = get_dir() . 'theme.json';
+
+ if ( ! is_readable( $framework_theme_json_file ) ) {
+ return $theme_json;
+ }
+
+ $file_contents = file_get_contents( $framework_theme_json_file );
+ $framework_theme_json_file = json_decode( $file_contents, true );
+ $framework_fonts = $framework_theme_json_file['settings']['typography']['fontFamilies'] ?? [];
+
+ if ( ! $framework_fonts ) {
+ return $theme_json;
+ }
+
+ $data['settings']['typography']['fontFamilies']['theme'] = array_merge(
+ get_system_fonts(),
+ $framework_fonts,
+ );
+ }
$data['settings']['typography']['fontFamilies']['theme'] = array_merge(
get_system_fonts(),
diff --git a/includes/common/patterns.php b/includes/common/patterns.php
new file mode 100644
index 0000000..8366bfe
--- /dev/null
+++ b/includes/common/patterns.php
@@ -0,0 +1,327 @@
+get_all_registered() ?? [];
+
+ foreach ( $all_patterns as $pattern ) {
+ $registered_slugs[] = $pattern['slug'] ?? '';
+ }
+
+ foreach ( $categories as $category => $patterns ) {
+
+ if ( ! in_array( $category, $registered_categories, true ) ) {
+
+ if ( in_array( $category, [ 'cta', 'faq' ], true ) ) {
+ $label = strtoupper( $category );
+ } else {
+ $label = ucwords( str_replace( '-', ' ', $category ) );
+ }
+
+ register_block_pattern_category(
+ $category,
+ [
+ 'label' => $label,
+ ]
+ );
+
+ $registered_categories[ $category ] = [];
+ }
+
+ foreach ( $patterns as $pattern => $file ) {
+ $basename = basename( $file, '.php' );
+
+ if ( in_array( $basename, $registered_categories[ $category ], true ) ) {
+ continue;
+ }
+
+ $registered_categories[ $category ][] = $basename;
+
+ $slug = $category . '-' . $basename;
+
+ if ( in_array( $slug, $registered_slugs, true ) ) {
+ continue;
+ }
+
+ register_block_pattern_from_file( $file );
+ }
+ }
+}
+
+/**
+ * Parses a pattern file and returns the pattern data.
+ *
+ * @since 0.0.2
+ *
+ * @param string $file The file path.
+ *
+ * @return array
+ */
+function parse_pattern_file( string $file ): array {
+ if ( ! $file ) {
+ return [];
+ }
+
+ $content = '';
+ $default_headers = [
+ 'categories' => 'Categories',
+ 'title' => 'Title',
+ 'slug' => 'Slug',
+ 'block_types' => 'Block Types',
+ 'inserter' => 'Inserter',
+ 'ID' => 'ID',
+ 'theme' => 'Theme',
+ ];
+
+ if ( is_readable( $file ) ) {
+ $headers = get_file_data( $file, $default_headers );
+
+ ob_start();
+ $global_settings = wp_get_global_settings();
+
+ include $file;
+ $content = ob_get_clean();
+
+ } else {
+ if ( str_contains( $file, 'Title: ' ) ) {
+ $content = $file;
+ $headers = $default_headers;
+
+ // Use regex from get_file_data().
+ foreach ( $headers as $field => $regex ) {
+ if ( preg_match( '/^(?:[ \t]*<\?php)?[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file, $match ) && $match[1] ) {
+ $headers[ $field ] = _cleanup_header_comment( $match[1] );
+ } else {
+ $headers[ $field ] = '';
+ }
+ }
+ }
+ }
+
+ if ( ! isset( $headers['title'], $headers['slug'], $headers['categories'] ) ) {
+ return [];
+ }
+
+ $categories = explode( ',', $headers['categories'] );
+
+ $theme = $headers['theme'] ?? null;
+
+ if ( ! $theme ) {
+ $stylesheet_dir = get_stylesheet_directory();
+ $template_dir = get_template_directory();
+
+ if ( $stylesheet_dir === $template_dir ) {
+ $theme = get_template();
+ } else if ( str_contains( $file, $stylesheet_dir ) ) {
+ $theme = get_stylesheet();
+ } else if ( str_contains( $file, $template_dir ) ) {
+ $theme = get_template();
+ }
+ }
+
+ $pattern = [
+ 'slug' => $categories[0] . '-' . $headers['slug'],
+ 'title' => $headers['title'],
+ 'content' => str_replace_first(
+ str_between( '', $content ),
+ '',
+ $content
+ ),
+ 'categories' => [ ...$categories ],
+ 'description' => $headers['description'] ?? '',
+ 'blockTypes' => explode( ',', $headers['block_types'] ?? [] ),
+ 'ID' => $headers['ID'] ?? null,
+ 'theme' => $theme,
+ ];
+
+ if ( ( $headers['inserter'] ?? null ) === 'false' ) {
+ $pattern['inserter'] = false;
+ }
+
+ return $pattern;
+}
+
+/**
+ * Parses and registers block pattern from PHP file with header comment.
+ *
+ * @since 0.0.8
+ *
+ * @param string $file Path to PHP file or content.
+ *
+ * @return void
+ */
+function register_block_pattern_from_file( string $file ): void {
+ $pattern = parse_pattern_file( $file );
+ $categories = $pattern['categories'] ?? [];
+
+ foreach ( $categories as $category ) {
+
+ if ( in_array( $category, [ 'cta', 'faq' ], true ) ) {
+ $label = strtoupper( $category );
+ } else {
+ $label = ucwords( str_replace( '-', ' ', $category ) );
+ }
+
+ register_block_pattern_category(
+ $category,
+ [
+ 'label' => $label,
+ ]
+ );
+ }
+
+ register_block_pattern( $pattern['slug'], $pattern );
+}
+
+/**
+ * Get block HTML.
+ *
+ * @since 1.3.0
+ *
+ * @param array $block Block.
+ * @param bool $render Whether to render the block.
+ *
+ * @return string
+ */
+function get_block_html( array $block, bool $render = false ): string {
+ $block['innerContent'] = $block['innerContent'] ?? [];
+ $block['innerHTML'] = $block['innerHTML'] ?? '';
+ $block['innerBlocks'] = $block['innerBlocks'] ?? [];
+ $name = strip_core_block_namespace( $block['blockName'] ?? '' );
+
+ if ( ! $name || empty( $block['innerBlocks'] ) ) {
+ return serialize_block( $block );
+ }
+
+ $classes = array_filter( [
+ 'wp-block-' . $name,
+ $block['attrs']['className'] ?? null,
+ isset( $block['attrs']['fontSize'] ) ? 'has-' . $block['attrs']['fontSize'] . '-font-size' : null,
+ isset( $block['attrs']['textColor'] ) ? 'has-' . $block['attrs']['textColor'] . '-color' : null,
+ isset( $block['attrs']['backgroundColor'] ) ? 'has-' . $block['attrs']['backgroundColor'] . '-background-color' : null,
+ ] );
+
+ $styles = array_filter( [
+ 'gap' => $block['attrs']['style']['spacing']['blockGap'] ?? null,
+ ] );
+
+ $tag = $block['tagName'] ?? $block['attrs']['tagName'] ?? 'div';
+ $opening = sprintf( '<%s class="%s" style="%s">', $tag, implode( ' ', $classes ), css_array_to_string( $styles ) );
+ $closing = sprintf( '%s>', $tag );
+
+ $inner_content = $block['innerContent'];
+ array_unshift( $inner_content, $opening );
+ $inner_content[] = $closing;
+
+ foreach ( $block['innerBlocks'] as $inner_block ) {
+ $inner_content[] = get_block_html( $inner_block );
+ }
+
+ $block['innerContent'] = $inner_content;
+ $block['innerHTML'] = implode( '', $inner_content );
+
+ $serialized = serialize_block( $block );
+ $parsed_block = parse_blocks( $serialized )[0];
+
+ return $render ? render_block( $parsed_block ) : $serialized;
+}
diff --git a/includes/scripts.php b/includes/common/scripts.php
similarity index 68%
rename from includes/scripts.php
rename to includes/common/scripts.php
index cb162ec..fce94e2 100644
--- a/includes/scripts.php
+++ b/includes/common/scripts.php
@@ -4,15 +4,14 @@
namespace Blockify\Theme;
-use WP_Screen;
use function add_action;
use function apply_filters;
-use function do_action;
use function filemtime;
use function function_exists;
use function get_current_screen;
use function get_template;
use function home_url;
+use function is_admin;
use function remove_action;
use function trailingslashit;
use function wp_add_inline_script;
@@ -21,34 +20,70 @@
use function wp_localize_script;
use function wp_register_script;
-add_action( 'current_screen', NS . 'add_editor_scripts_hook', 10, 1 );
/**
- * Conditionally changes which action hook editor assets are enqueued.
+ * Returns inline scripts.
*
- * @since 0.0.19
+ * @since 1.3.2
*
- * @param WP_Screen $screen Current screen.
+ * @param string $content Page content.
+ * @param bool $all Whether to return all inline scripts.
*
- * @return void
+ * @return string
*/
-function add_editor_scripts_hook( WP_Screen $screen ): void {
- $site_editor = $screen->base === 'site-editor';
+function get_inline_scripts( string $content, bool $all ): string {
+
+ /**
+ * Filters inline scripts.
+ *
+ * @since 0.0.27
+ *
+ * @param string $js Inline scripts.
+ * @param string $content Template HTML.
+ * @param bool $all Whether to return all inline scripts.
+ */
+ $js = apply_filters(
+ 'blockify_inline_js',
+ '',
+ $content,
+ $all
+ );
- if ( ! $site_editor && function_exists( 'is_gutenberg_page' ) && ! \is_gutenberg_page() ) {
- return;
- }
+ return reduce_whitespace( trim( $js ) );
+}
- if ( ! $site_editor && ! $screen->is_block_editor() ) {
- return;
- }
+add_action( 'wp_enqueue_scripts', NS . 'enqueue_scripts' );
+/**
+ * Register proxy handle for inline frontend scripts.
+ *
+ * Called in styles.php to share page content string.
+ *
+ * @since 0.0.27
+ *
+ * @return void
+ */
+function enqueue_scripts(): void {
+ $handle = get_template();
- add_action(
- $site_editor ? 'admin_enqueue_scripts' : 'enqueue_block_editor_assets',
- static fn() => do_action( 'blockify_editor_scripts', $screen )
+ wp_register_script(
+ $handle,
+ '',
+ [],
+ wp_get_theme()->get( 'version' ),
+ true
);
+
+ wp_add_inline_script(
+ $handle,
+ get_inline_scripts(
+ (string) ( $GLOBALS['template_html'] ?? '' ),
+ false
+ ),
+ );
+
+ wp_enqueue_script( $handle );
}
-add_action( 'blockify_editor_scripts', NS . 'enqueue_editor_scripts' );
+add_action( 'enqueue_block_assets', NS . 'enqueue_editor_scripts' );
/**
* Enqueues editor assets.
*
@@ -57,6 +92,10 @@ function add_editor_scripts_hook( WP_Screen $screen ): void {
* @return void
*/
function enqueue_editor_scripts(): void {
+ if ( ! is_admin() ) {
+ return;
+ }
+
$dir = get_dir();
$asset = $dir . 'assets/js/editor.asset.php';
@@ -90,11 +129,18 @@ function enqueue_editor_scripts(): void {
*
* @since 0.9.10
*
- * @return mixed|void
+ * @return array
*/
-function get_editor_data() {
+function get_editor_data(): array {
$current_screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
+ /**
+ * Filters editor data.
+ *
+ * @since 0.9.10
+ *
+ * @param array $data Editor data.
+ */
return apply_filters(
'blockify_editor_data',
[
@@ -112,40 +158,3 @@ function get_editor_data() {
// Prevent special characters converting to emojis (arrows, lines, etc.).
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
-
-add_action( 'wp_enqueue_scripts', NS . 'enqueue_scripts', 10 );
-/**
- * Register proxy handle for inline frontend scripts.
- *
- * Called in styles.php to share page content string.
- *
- * @since 0.0.27
- *
- * @return void
- */
-function enqueue_scripts(): void {
- $handle = get_template();
-
- wp_register_script(
- $handle,
- '',
- [],
- wp_get_theme()->get( 'version' ),
- true
- );
-
- wp_add_inline_script(
- $handle,
- reduce_whitespace(
- trim(
- apply_filters(
- 'blockify_inline_js',
- '',
- (string) ( $GLOBALS['template_html'] ?? '' )
- )
- )
- )
- );
-
- wp_enqueue_script( $handle );
-}
diff --git a/includes/styles.php b/includes/common/styles.php
similarity index 53%
rename from includes/styles.php
rename to includes/common/styles.php
index fb814ea..8a9abf5 100644
--- a/includes/styles.php
+++ b/includes/common/styles.php
@@ -15,11 +15,13 @@
use function filemtime;
use function get_stylesheet_directory;
use function get_template;
+use function get_template_directory;
use function glob;
use function is_a;
use function is_admin;
use function is_admin_bar_showing;
use function is_archive;
+use function is_user_logged_in;
use function str_contains;
use function str_replace;
use function trim;
@@ -29,24 +31,38 @@
use function wp_get_global_settings;
use function wp_get_global_styles;
use function wp_get_theme;
+use function wp_json_file_decode;
use function wp_register_style;
+// Remove admin bar inline CSS.
+add_theme_support( 'admin-bar', [ 'callback' => '__return_false' ] );
+
/**
* Returns filtered inline styles.
*
* @since 0.9.22
*
- * @param string $content Page content.
- * @param bool $is_editor Is Editor.
+ * @param string $content Page content.
+ * @param bool $all Is Editor.
*
* @return string
*/
-function get_inline_styles( string $content, bool $is_editor ): string {
+function get_inline_styles( string $content, bool $all ): string {
+
+ /**
+ * Filters the inline CSS.
+ *
+ * @since 0.9.22
+ *
+ * @param string $css Inline CSS.
+ * @param string $content Page content.
+ * @param bool $all Is Editor. (Load all CSS).
+ */
$css = apply_filters(
'blockify_inline_css',
'',
$content,
- $is_editor
+ $all
);
return remove_line_breaks( $css );
@@ -63,6 +79,8 @@ function get_inline_styles( string $content, bool $is_editor ): string {
function enqueue_styles(): void {
$handle = get_template();
+ wp_dequeue_style( 'wp-block-library-theme' );
+
wp_register_style(
$handle,
'',
@@ -70,8 +88,6 @@ function enqueue_styles(): void {
wp_get_theme()->get( 'Version' )
);
- wp_enqueue_style( $handle );
-
wp_add_inline_style(
$handle,
get_inline_styles(
@@ -80,30 +96,30 @@ function enqueue_styles(): void {
)
);
- wp_dequeue_style( 'wp-block-library-theme' );
+ wp_enqueue_style( $handle );
}
-add_filter( 'blockify_inline_css', NS . 'get_dynamic_custom_properties', 8 );
/**
- * Add dynamic custom properties.
+ * Gets dynamic custom properties.
*
* @since 0.9.19
*
- * @param string $css Inline CSS.
- *
- * @return string
+ * @return array
*/
-function get_dynamic_custom_properties( string $css = '' ): string {
- $settings = wp_get_global_settings();
- $global_styles = wp_get_global_styles();
- $custom = $settings['custom'] ?? [];
- $border_width = $custom['border']['width'] ?? '1px';
- $border_style = $custom['border']['style'] ?? 'solid';
- $border_color = $custom['border']['color'] ?? '#ddd';
- $bodyBackground = $global_styles['color']['background'] ?? null;
- $body_color = $global_styles['color']['text'] ?? null;
- $box_shadow = $custom['boxShadow'] ?? [];
- $list_gap = $global_styles['blocks']['core/list']['spacing']['blockGap'] ?? null;
+function get_dynamic_custom_properties(): array {
+ $global_settings = wp_get_global_settings();
+ $global_styles = wp_get_global_styles();
+ $custom = $global_settings['custom'] ?? [];
+ $transition_property = $custom['transition']['property'] ?? 'all';
+ $transition_duration = $custom['transition']['duration'] ?? '0.3s';
+ $transition_timing = $custom['transition']['timingFunction'] ?? 'ease-in';
+ $body_background = $global_styles['color']['background'] ?? null;
+ $body_color = $global_styles['color']['text'] ?? null;
+ $body_font_family = $global_styles['typography']['fontFamily'] ?? null;
+ $body_font_size = $global_styles['typography']['fontSize'] ?? null;
+ $body_font_weight = $global_styles['typography']['fontWeight'] ?? null;
+ $box_shadow = $custom['boxShadow'] ?? [];
+ $list_gap = $global_styles['blocks']['core/list']['spacing']['blockGap'] ?? null;
// Button.
$button_block = $global_styles['blocks']['core/button'] ?? [];
@@ -118,36 +134,70 @@ function get_dynamic_custom_properties( string $css = '' ): string {
$button_padding = $button_element['spacing']['padding'] ?? $button_block['spacing']['padding'] ?? null;
// Also used by b, strong elements and legend element.
- $heading_font_weight = $global_styles['elements']['heading']['typography']['fontWeight'] ?? null;
- $heading_font_family = $global_styles['elements']['heading']['typography']['fontFamily'] ?? null;
+ $heading_font_family = $global_styles['elements']['heading']['typography']['fontFamily'] ?? null;
+ $heading_font_weight = $global_styles['elements']['heading']['typography']['fontWeight'] ?? null;
+ $heading_line_height = $global_styles['elements']['heading']['typography']['lineHeight'] ?? null;
+ $heading_letter_spacing = $global_styles['elements']['heading']['typography']['letterSpacing'] ?? null;
+ $heading_color = $global_styles['elements']['heading']['color']['text'] ?? null;
+
+ // Also used by placeholder image.
+ $image_border_radius = $global_styles['blocks']['core/image']['border']['radius'] ?? null;
+
+ // Search gap.
+ $search_gap = $global_styles['blocks']['core/search']['spacing']['blockGap'] ?? null;
+
+ $link_hover_color = $global_styles['elements']['link'][':hover']['color']['text'] ?? null;
+
+ $calendar_background = $global_styles['blocks']['core/calendar']['color']['background'] ?? null;
$styles = [
- '--scroll' => '0',
- '--breakpoint' => '782px', // Only used by JS.
- '--wp--custom--border' => "$border_width $border_style $border_color",
- '--wp--custom--body--background' => $bodyBackground,
- '--wp--custom--body--color' => $body_color,
- '--wp--custom--heading--font-weight' => $heading_font_weight,
- '--wp--custom--heading--font-family' => $heading_font_family,
+ '--scroll' => '0',
+ '--breakpoint' => '782px', // Only used by JS.
+ '--wp--custom--border' => "var(--wp--custom--border--width,1px) var(--wp--custom--border--style,solid) var(--wp--custom--border--color,#ddd)",
+ '--wp--custom--transition' => "$transition_property $transition_duration $transition_timing",
+ '--wp--custom--body--background' => $body_background,
+ '--wp--custom--body--color' => $body_color,
+ '--wp--custom--body--font-family' => $body_font_family,
+ '--wp--custom--body--font-size' => $body_font_size,
+ '--wp--custom--body--font-weight' => $body_font_weight,
+ '--wp--custom--heading--font-family' => $heading_font_family,
+ '--wp--custom--heading--font-weight' => $heading_font_weight,
+ '--wp--custom--heading--line-height' => $heading_line_height,
+ '--wp--custom--heading--letter-spacing' => $heading_letter_spacing,
+ '--wp--custom--heading--color' => $heading_color,
// Used by .button.
- '--wp--custom--button--background' => $button_background,
- '--wp--custom--button--color' => $button_text,
- '--wp--custom--button--padding-top' => $button_padding['top'] ?? null,
- '--wp--custom--button--padding-right' => $button_padding['right'] ?? null,
- '--wp--custom--button--padding-bottom' => $button_padding['bottom'] ?? null,
- '--wp--custom--button--padding-left' => $button_padding['left'] ?? null,
- '--wp--custom--button--border-radius' => $button_border_radius,
- '--wp--custom--button--border-width' => $button_border_width,
- '--wp--custom--button--font-size' => $button_font_size,
- '--wp--custom--button--font-weight' => $button_font_weight,
- '--wp--custom--button--line-height' => $button_line_height,
+ '--wp--custom--button--background' => $button_background,
+ '--wp--custom--button--color' => $button_text,
+ '--wp--custom--button--padding-top' => $button_padding['top'] ?? null,
+ '--wp--custom--button--padding-right' => $button_padding['right'] ?? null,
+ '--wp--custom--button--padding-bottom' => $button_padding['bottom'] ?? null,
+ '--wp--custom--button--padding-left' => $button_padding['left'] ?? null,
+ '--wp--custom--button--padding' => 'var(--wp--custom--button--padding-top) var(--wp--custom--button--padding-right) var(--wp--custom--button--padding-bottom) var(--wp--custom--button--padding-left)',
+ '--wp--custom--button--border-radius' => $button_border_radius,
+ '--wp--custom--button--border-width' => $button_border_width,
+ '--wp--custom--button--font-size' => $button_font_size,
+ '--wp--custom--button--font-weight' => $button_font_weight,
+ '--wp--custom--button--line-height' => $button_line_height,
+
+ // Image.
+ '--wp--custom--image--border--radius' => $image_border_radius,
+
+ // Search.
+ '--wp--custom--search--gap' => $search_gap,
+
+ // Link hover color used by navigation.
+ '--wp--custom--link--hover--color' => $link_hover_color,
];
if ( $list_gap ) {
$styles['--wp--custom--list--gap'] = $list_gap;
}
+ if ( $calendar_background ) {
+ $styles['--wp--custom--calendar--background'] = $calendar_background;
+ }
+
$inset = $box_shadow['inset'] ?? ' ';
$x = $box_shadow['x'] ?? '0px';
$y = $box_shadow['y'] ?? '0px';
@@ -169,7 +219,29 @@ function get_dynamic_custom_properties( string $css = '' ): string {
]
);
- return $css . 'body{' . css_array_to_string( $styles ) . '}';
+ /**
+ * Filters the dynamic custom properties.
+ *
+ * @since 1.3.0
+ *
+ * @param array $styles Dynamic custom properties.
+ * @param array $global_styles Global styles.
+ */
+ return apply_filters( 'blockify_dynamic_custom_properties', $styles, $global_styles );
+}
+
+add_filter( 'blockify_inline_css', NS . 'add_dynamic_custom_properties', 8 );
+/**
+ * Adds dynamic custom properties.
+ *
+ * @since 0.9.19
+ *
+ * @param string $css Inline CSS.
+ *
+ * @return string
+ */
+function add_dynamic_custom_properties( string $css = '' ): string {
+ return $css . 'body{' . css_array_to_string( get_dynamic_custom_properties() ) . '}';
}
add_filter( 'blockify_inline_css', NS . 'get_conditional_stylesheets', 10, 3 );
@@ -178,17 +250,18 @@ function get_dynamic_custom_properties( string $css = '' ): string {
*
* @since 0.0.27
*
- * @param string $css Inline CSS.
- * @param string $content Page content.
- * @param bool $is_editor Is editor.
+ * @param string $css Inline CSS.
+ * @param string $content Page content.
+ * @param bool $all Is editor.
*
* @return string
*/
-function get_conditional_stylesheets( string $css, string $content, bool $is_editor ): string {
+function get_conditional_stylesheets( string $css, string $content, bool $all ): string {
$styles = [];
$styles['elements'] = [
'all' => true,
+ 'anchor' => str_contains( $content, ' str_contains( $content, ' str_contains( $content, ' true,
@@ -201,6 +274,8 @@ function get_conditional_stylesheets( string $css, string $content, bool $is_edi
'nf-form',
'wp-element-button'
),
+ 'caption' => str_contains( $content, 'wp-element-caption' ),
+ 'checkbox' => str_contains( $content, 'type="checkbox"' ),
'cite' => str_contains( $content, ' str_contains( $content, ' str_contains( $content, ' true,
'html' => true,
- 'anchor' => str_contains( $content, ' str_contains( $content, ' str_contains_any( $content, ' str_contains( $content, ' str_contains( $content, ' str_contains( $content, 'type="radio"' ),
'small' => str_contains( $content, ' str_contains( $content, ' str_contains( $content, ' is_admin_bar_showing(),
'border' => str_contains( $content, 'border-width:' ),
'drop-cap' => str_contains( $content, 'has-drop-cap' ),
+ 'edit-link' => str_contains( $content, 'edit-link' ),
'inline-image' => str_contains( $content, 'wp-image-' ),
'placeholder-image' => str_contains( $content, 'is-placeholder' ) || is_archive(),
'screen-reader-text' => true,
@@ -239,7 +316,8 @@ function get_conditional_stylesheets( string $css, string $content, bool $is_edi
'button-outline' => str_contains( $content, 'is-style-outline' ),
'button-secondary' => str_contains( $content, 'is-style-secondary' ),
'button-ghost' => str_contains( $content, 'is-style-ghost' ),
- 'checklist-circle' => str_contains( $content, 'is-style-checklist-circle' ),
+ 'check-circle' => str_contains( $content, 'is-style-check-circle' ),
+ 'check-outline' => str_contains_any( $content, 'is-style-check-outline', 'is-style-checklist-circle' ),
'checklist' => str_contains( $content, 'is-style-checklist' ),
'curved-text' => str_contains( $content, 'is-style-curved-text' ),
'divider-angle' => str_contains( $content, 'is-style-angle' ),
@@ -247,7 +325,10 @@ function get_conditional_stylesheets( string $css, string $content, bool $is_edi
'divider-fade' => str_contains( $content, 'is-style-fade' ),
'divider-round' => str_contains( $content, 'is-style-round' ),
'divider-wave' => str_contains( $content, 'is-style-wave' ),
- 'none' => str_contains( $content, 'is-style-none' ),
+ 'heading' => str_contains_any( $content, 'is-style-heading', 'is-style-summary-heading', 'is-style-list-heading' ),
+ 'list-dash' => str_contains( $content, 'is-style-dash' ),
+ 'list-heading' => str_contains( $content, 'is-style-heading' ),
+ 'list-none' => str_contains( $content, 'is-style-none' ),
'notice' => str_contains( $content, 'is-style-notice' ),
'numbered-list' => str_contains( $content, 'is-style-numbered' ),
'search-toggle' => str_contains( $content, 'is-style-toggle' ),
@@ -261,12 +342,15 @@ function get_conditional_stylesheets( string $css, string $content, bool $is_edi
'counter' => str_contains( $content, 'is-style-counter' ),
'icon' => str_contains( $content, 'is-style-icon' ),
'marquee' => str_contains( $content, 'is-marquee' ),
+ 'svg' => str_contains( $content, 'is-style-svg' ),
];
$styles['formats'] = [
+ 'animation' => str_contains_any( $content, 'has-text-animation', 'typewriter' ),
'arrow' => str_contains( $content, 'is-underline-arrow' ),
'brush' => str_contains( $content, 'is-underline-brush' ),
'circle' => str_contains( $content, 'is-underline-circle' ),
+ 'scribble' => str_contains( $content, 'is-underline-scribble' ),
'gradient' => str_contains( $content, 'has-text-gradient' ),
'highlight' => str_contains( $content, 'has-inline-color' ),
'underline' => str_contains( $content, 'has-text-underline' ),
@@ -276,17 +360,21 @@ function get_conditional_stylesheets( string $css, string $content, bool $is_edi
];
$styles['extensions'] = [
- 'animation' => str_contains_any( $content, 'has-animation', 'will-animate' ),
- 'box-shadow' => str_contains( $content, 'has-box-shadow' ),
- 'dark-mode' => str_contains( $content, 'toggle-switch' ),
- 'filter' => str_contains( $content, 'has-filter' ),
- 'gradient-mask' => str_contains( $content, '-gradient-background' ),
- 'grid-pattern' => str_contains( $content, 'has-grid-gradient-' ),
+ 'animation' => str_contains_any( $content, 'has-animation', 'will-animate' ),
+ 'aspect-ratio' => str_contains( $content, 'has-aspect-ratio-' ),
+ 'box-shadow' => str_contains( $content, 'has-box-shadow' ),
+ 'dark-mode' => str_contains_any( $content, 'hide-dark-mode', 'hide-light-mode' ),
+ 'dark-mode-toggle' => str_contains( $content, 'toggle-switch' ),
+ 'filter' => str_contains( $content, 'has-filter' ),
+ 'gradient-mask' => str_contains( $content, '-gradient-background' ),
+ 'grid-pattern' => str_contains( $content, 'has-grid-gradient-' ),
+ 'shadow' => str_contains_any( $content, 'has-shadow', 'has-box-shadow', 'has-text-shadow' ),
+ 'transform' => str_contains( $content, 'has-transform' ),
];
foreach ( $styles as $group => $stylesheets ) {
foreach ( $stylesheets as $stylesheet => $condition ) {
- if ( $condition || $is_editor || ! $content ) {
+ if ( $all || $condition || ! $content ) {
$file = get_dir() . "assets/css/$group/$stylesheet.css";
if ( file_exists( $file ) ) {
@@ -352,8 +440,8 @@ function add_block_styles(): void {
function fix_editor_layout_sizes( $theme_json ) {
$default = $theme_json->get_data();
$new = [];
- $content_size = $default['settings']['layout']['contentSize'] ?? 'min(calc(100dvw - 3rem), 800px)';
- $wide_size = $default['settings']['layout']['wideSize'] ?? 'min(calc(100dvw - 3rem), 1200px)';
+ $content_size = $default['settings']['layout']['contentSize'] ?? 'min(calc(100dvw - var(--wp--preset--spacing--lg,2rem)), 720px)';
+ $wide_size = $default['settings']['layout']['wideSize'] ?? 'min(calc(100dvw - var(--wp--preset--spacing--lg,2rem)), 1200px)';
if ( is_admin() ) {
$content_size = str_replace( 'dvw', '%', $content_size );
@@ -368,7 +456,7 @@ function fix_editor_layout_sizes( $theme_json ) {
return $theme_json;
}
-add_action( 'blockify_editor_scripts', NS . 'enqueue_editor_only_styles' );
+add_action( 'enqueue_block_assets', NS . 'enqueue_editor_only_styles' );
/**
* Enqueues editor assets.
*
@@ -377,11 +465,16 @@ function fix_editor_layout_sizes( $theme_json ) {
* @return void
*/
function enqueue_editor_only_styles(): void {
+ if ( ! is_admin() || ! is_user_logged_in() ) {
+ return;
+ }
+
wp_dequeue_style( 'wp-block-library-theme' );
+ $dir = get_dir();
$file = 'assets/css/editor.css';
$handle = 'blockify-editor';
- $version = file_exists( get_dir() . $file ) ? filemtime( get_dir() . $file ) : wp_get_theme()->get( 'Version' );
+ $version = file_exists( $dir . $file ) ? filemtime( $dir . $file ) : wp_get_theme()->get( 'Version' );
wp_register_style(
$handle,
@@ -391,6 +484,13 @@ function enqueue_editor_only_styles(): void {
);
wp_enqueue_style( $handle );
+
+ $dark_mode_css = get_dark_mode_styles( '' );
+
+ wp_add_inline_style(
+ $handle,
+ $dark_mode_css
+ );
}
add_action( 'admin_init', NS . 'add_editor_stylesheets' );
@@ -403,9 +503,14 @@ function enqueue_editor_only_styles(): void {
*/
function add_editor_stylesheets() {
$blocks = glob( get_dir() . 'assets/css/blocks/*.css' );
+ $vendor = '';
+
+ if ( is_framework() ) {
+ $vendor = 'vendor/blockify/theme/';
+ }
foreach ( $blocks as $block ) {
- add_editor_style( 'assets/css/blocks/' . basename( $block ) );
+ add_editor_style( $vendor . 'assets/css/blocks/' . basename( $block ) );
}
add_editor_style( 'https://blockify-dynamic-styles' );
@@ -455,7 +560,7 @@ function add_child_theme_style_css( string $css ): string {
if ( file_exists( $child ) ) {
$content = trim( file_get_contents( $child ) );
- $css .= str_replace(
+ $css .= str_replace(
str_between( '/**', '*/', $content ),
'',
$content
@@ -464,3 +569,93 @@ function add_child_theme_style_css( string $css ): string {
return $css;
}
+
+add_filter( 'blockify_inline_css', NS . 'add_deprecated_color_palette' );
+/**
+ * Adds deprecated color palette to inline styles.
+ *
+ * @since 1.3.0
+ *
+ * @param string $css CSS.
+ *
+ * @return string
+ */
+function add_deprecated_color_palette( string $css ): string {
+ $colors = get_deprecated_colors();
+ $styles = [];
+
+ foreach ( $colors as $slug => $value ) {
+ if ( $value ) {
+ $styles["--wp--preset--color--{$slug}"] = $value;
+ }
+ }
+
+ if ( ! empty( $styles ) ) {
+ $css .= 'body{' . css_array_to_string( $styles ) . '}';
+ }
+
+ return $css;
+}
+
+add_filter( 'blockify_inline_css', NS . 'add_deprecated_typography' );
+/**
+ * Adds deprecated typography to inline styles.
+ *
+ * @since 1.3.0
+ *
+ * @param string $css CSS.
+ *
+ * @return string
+ */
+function add_deprecated_typography( string $css ): string {
+ $global_settings = wp_get_global_settings();
+ $font_sizes = $global_settings['typography']['fontSizes']['theme'] ?? [];
+
+ if ( ! $font_sizes ) {
+ return $css;
+ }
+
+ $has_deprecated = false;
+ $slugs = [];
+
+ foreach ( $font_sizes as $font_size ) {
+ $slug = $font_size['slug'] ?? '';
+
+ if ( $slug === '81' ) {
+ $has_deprecated = true;
+ }
+
+ $slugs[ $slug ] = $font_size;
+ }
+
+ if ( ! $has_deprecated ) {
+ return $css;
+ }
+
+ $theme_json_file = get_template_directory() . '/theme.json';
+
+ if ( ! file_exists( $theme_json_file ) ) {
+ return $css;
+ }
+
+ $theme_json = wp_json_file_decode( $theme_json_file );
+ $theme_json_font_sizes = (array) ( $theme_json->settings->typography->fontSizes ?? [] );
+
+ if ( ! $theme_json_font_sizes ) {
+ return $css;
+ }
+
+ $styles = [];
+
+ foreach ( $theme_json_font_sizes as $font_size ) {
+ $slug = $font_size->slug ?? '';
+
+ if ( isset( $slugs[ $slug ] ) ) {
+ continue;
+ }
+
+ $styles["--wp--preset--font-size--{$slug}"] = $font_size->size ?? '';
+ }
+
+ return $css . 'body{' . css_array_to_string( $styles ) . '}';
+}
diff --git a/includes/common/templates.php b/includes/common/templates.php
new file mode 100644
index 0000000..fb41308
--- /dev/null
+++ b/includes/common/templates.php
@@ -0,0 +1,83 @@
+ $wp_block_template ) {
+ $slug = $wp_block_template->slug;
+
+ if ( 'blockify' !== $wp_block_template->theme ) {
+ continue;
+ }
+
+ if ( ! $woocommerce && str_contains( $slug, 'product' ) ) {
+ unset( $query_result[ $index ] );
+ continue;
+ }
+
+ if ( ! $edd && str_contains( $slug, '-download' ) ) {
+ unset( $query_result[ $index ] );
+ }
+ }
+
+ return $query_result;
+}
+
+add_filter( 'search_template_hierarchy', NS . 'update_search_template_hierarchy' );
+/**
+ * Updates search template hierarchy.
+ *
+ * @since 1.0.0
+ *
+ * @param array $templates Template files to search for, in order.
+ *
+ * @return array
+ */
+function update_search_template_hierarchy( array $templates ): array {
+ if ( is_search() && is_post_type_archive() ) {
+ $post_type = get_queried_object()->name ?? get_post_type();
+ $slug = "search-$post_type";
+ $child = get_stylesheet_directory() . "/templates/$slug.html";
+ $parent = get_template_directory() . "/templates/$slug.html";
+
+ if ( file_exists( $child ) || file_exists( $parent ) ) {
+ array_unshift( $templates, $slug );
+ }
+ }
+
+ return $templates;
+}
diff --git a/includes/extensions/animation.php b/includes/extensions/animation.php
index 3e148dd..70034a3 100644
--- a/includes/extensions/animation.php
+++ b/includes/extensions/animation.php
@@ -5,9 +5,11 @@
namespace Blockify\Theme;
use function add_filter;
-use function array_search;
+use function array_diff;
use function array_unique;
+use function esc_attr;
use function explode;
+use function file_exists;
use function file_get_contents;
use function str_contains;
@@ -43,23 +45,30 @@ function get_animations(): array {
/**
* Returns inline styles for animations.
*
- * @param string $css Inline CSS.
- * @param string $content Page content.
- * @param bool $is_editor Is admin.
- *
* @since 0.9.19
*
+ * @param string $css Inline CSS.
+ * @param string $content Page content.
+ * @param bool $all Is admin.
+ *
+ *
* @return string
*/
-function get_animation_styles( string $css, string $content, bool $is_editor ): string {
+function get_animation_styles( string $css, string $content, bool $all ): string {
$animations = get_animations();
foreach ( $animations as $name => $animation ) {
- if ( $is_editor || str_contains( $content, "animation-name:{$name}" ) ) {
+ if ( $all || str_contains( $content, "animation-name:{$name}" ) ) {
$css .= "@keyframes $name" . trim( $animation );
}
}
+ $file = get_dir() . 'assets/css/extensions/animation.css';
+
+ if ( file_exists( $file ) ) {
+ $css .= file_get_contents( $file );
+ }
+
return $css;
}
@@ -67,10 +76,10 @@ function get_animation_styles( string $css, string $content, bool $is_editor ):
/**
* Adds animation names to editor, so they are available for options.
*
- * @param array $data Editor data.
- *
* @since 0.9.19
*
+ * @param array $data Editor data.
+ *
* @return array
*/
function add_animation_names( array $data ): array {
@@ -79,33 +88,15 @@ function add_animation_names( array $data ): array {
return $data;
}
-add_filter( 'blockify_inline_js', NS . 'add_animation_js', 10, 2 );
-/**
- * Conditionally add animation JS.
- *
- * @param string $js The inline JS.
- * @param string $content The block content.
- *
- * @since 0.9.10
- *
- * @return string
- */
-function add_animation_js( string $js, string $content ): string {
- if ( str_contains( $content, ' has-animation' ) ) {
- $js .= file_get_contents( get_dir() . 'assets/js/animation.js' );
- }
-
- return $js;
-}
-
add_filter( 'render_block', NS . 'render_animation_attributes', 10, 2 );
/**
* Adds animation attributes to block.
*
- * @param string $html The block content.
+ * @since 0.9.10
+ *
* @param array $block The block.
*
- * @since 0.9.10
+ * @param string $html The block content.
*
* @return string
*/
@@ -139,43 +130,112 @@ function render_animation_attributes( string $html, array $block ): string {
} else {
unset( $styles['animation-name'] );
- $styles['--animation-name'] = $animation['name'] ?? '';
+ $styles['--animation-name'] = esc_attr( $animation['name'] ?? '' );
}
$event = $animation['event'] ?? '';
if ( $event === 'scroll' ) {
+ $classes[] = 'animate';
$classes[] = 'has-scroll-animation';
- unset( $classes[ array_search( 'has-animation', $classes, true ) ] );
+ $classes = array_diff( $classes, [ 'has-animation' ] );
+
$styles['animation-delay'] = 'calc(var(--scroll) * -1s)';
$styles['animation-play-state'] = 'paused';
$styles['animation-duration'] = '1s';
$styles['animation-fill-mode'] = 'both';
unset( $styles['--animation-event'] );
+
+ $offset = $animation['offset'] ?? '0';
+
+ if ( $offset === '0' ) {
+ $offset = '0.01';
+ }
+
+ if ( $offset ) {
+ $first->setAttribute( 'data-offset', esc_attr( $offset ) );
+ }
+ }
+
+ if ( $styles ) {
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
}
- $first->setAttribute( 'style', css_array_to_string( $styles ) );
$first->setAttribute( 'class', implode( ' ', $classes ) );
return $dom->saveHTML();
}
-add_filter( 'blockify_inline_js', NS . 'add_scroll_js', 10, 2 );
+add_filter( 'blockify_inline_js', NS . 'add_animation_js', 10, 3 );
+/**
+ * Conditionally add animation JS.
+ *
+ * @since 0.9.10
+ *
+ * @param string $js The inline JS.
+ * @param string $content The block content.
+ * @param bool $all Whether to add all JS.
+ *
+ *
+ * @return string
+ */
+function add_animation_js( string $js, string $content, bool $all ): string {
+ if ( $all || str_contains_any( $content, 'has-animation', 'has-scroll-animation' ) ) {
+ $file = get_dir() . 'assets/js/animation.js';
+
+ if ( file_exists( $file ) ) {
+ $js .= file_get_contents( $file );
+ }
+ }
+
+ return $js;
+}
+
+add_filter( 'blockify_inline_js', NS . 'add_scroll_js', 10, 3 );
/**
* Adds scroll JS to the inline JS.
*
+ * @since 0.0.14
+ *
* @param string $js Inline JS.
* @param string $content Page content.
+ * @param bool $all Whether to add all JS.
+ *
+ * @return string
+ */
+function add_scroll_js( string $js, string $content, bool $all ): string {
+ if ( $all || str_contains_any( $content, 'animation-event:scroll', 'has-scroll-animation' ) ) {
+ $file = get_dir() . 'assets/js/scroll.js';
+
+ if ( file_exists( $file ) ) {
+ $js .= file_get_contents( $file );
+ }
+ }
+
+ return $js;
+}
+
+add_filter( 'blockify_inline_js', NS . 'add_packery_js', 10, 3 );
+/**
+ * Adds packery JS to the inline JS.
*
* @since 0.0.14
*
+ * @param string $js Inline JS.
+ * @param string $content Page content.
+ * @param bool $all Whether to add all JS.
+ *
* @return string
*/
-function add_scroll_js( string $js, string $content ): string {
- if ( str_contains( $content, 'animation-event:scroll' ) ) {
- $js .= file_get_contents( get_dir() . 'assets/js/scroll.js' );
+function add_packery_js( string $js, string $content, bool $all ): string {
+ if ( $all || str_contains_any( $content, 'packery' ) ) {
+ $file = get_dir() . 'assets/js/packery.js';
+
+ if ( file_exists( $file ) ) {
+ $js .= file_get_contents( $file );
+ }
}
return $js;
diff --git a/includes/extensions/block-extras.php b/includes/extensions/block-extras.php
deleted file mode 100644
index 6a8781f..0000000
--- a/includes/extensions/block-extras.php
+++ /dev/null
@@ -1,252 +0,0 @@
- $args ) {
- $property = _wp_to_kebab_case( $key );
- $select_options = $args['options'] ?? [];
-
- foreach ( $select_options as $option ) {
- $value = $option['value'] ?? '';
-
- if ( ! $value ) {
- continue;
- }
-
- if ( $is_editor || str_contains( $content, " has-{$property}-{$value}" ) ) {
- $all .= sprintf(
- '.has-%1$s-%2$s{%1$s:%2$s !important}',
- $property,
- $value,
- );
- }
-
- if ( $is_editor || str_contains( $content, " has-{$property}-{$value}-mobile" ) ) {
- $mobile .= sprintf(
- '.has-%1$s-%2$s-mobile{%1$s:%2$s !important}',
- $property,
- $value,
- );
- }
-
- if ( $is_editor || str_contains( $content, " has-{$property}-{$value}-desktop" ) ) {
- $desktop .= sprintf(
- '.has-%1$s-%2$s-desktop{%1$s:%2$s !important}',
- $property,
- $value,
- );
- }
- }
-
- // Has custom value.
- if ( ! $select_options ) {
-
- if ( $is_editor || str_contains( $content, " has-$property" ) ) {
- $all .= sprintf(
- '.has-%1$s{%1$s:var(--%1$s)}',
- $property
- );
- }
-
- if ( $is_editor || str_contains( $content, "--$property-mobile" ) ) {
- $mobile .= sprintf(
- '.has-%1$s{%1$s:var(--%1$s-mobile,var(--%1$s))}',
- $property
- );
- }
-
- if ( $is_editor || str_contains( $content, "--$property-desktop" ) ) {
- $desktop .= sprintf(
- '.has-%1$s{%1$s:var(--%1$s-desktop,var(--%1$s))}',
- $property
- );
- }
- }
- }
-
- if ( $all ) {
- $css .= $all;
- }
-
- if ( $mobile ) {
- $css .= sprintf( '@media(max-width:781px){%s}', $mobile );
- }
-
- if ( $desktop ) {
- $css .= sprintf( '@media(min-width:782px){%s}', $desktop );
- }
-
- return $css;
-}
-
-add_filter( 'render_block', NS . 'add_position_classes', 10, 2 );
-/**
- * Adds inline block positioning classes.
- *
- * @param string $html Block content.
- * @param array $block Block data.
- *
- * @since 1.0.0
- *
- * @return string
- */
-function add_position_classes( string $html, array $block ): string {
- $style = $block['attrs']['style'] ?? [];
-
- if ( ! $style ) {
- return $html;
- }
-
- $options = get_block_extra_options();
-
- foreach ( $options as $key => $args ) {
- if ( ! isset( $style[ $key ] ) || $style[ $key ] === '' ) {
- continue;
- }
-
- $dom = dom( $html );
- $first = get_dom_element( '*', $dom );
-
- if ( ! $first ) {
- continue;
- }
-
- $classes = explode( ' ', $first->getAttribute( 'class' ) );
- $property = _wp_to_kebab_case( $key );
-
- if ( isset( $args['options'] ) ) {
- $all = $style[ $key ]['all'] ?? '';
- $mobile = $style[ $key ]['mobile'] ?? '';
- $desktop = $style[ $key ]['desktop'] ?? '';
-
- if ( $all ) {
- $classes[] = "has-{$property}-{$all}";
- }
-
- if ( $mobile ) {
- $classes[] = "has-{$property}-{$mobile}-mobile";
- }
-
- if ( $desktop ) {
- $classes[] = "has-{$property}-{$desktop}-desktop";
- }
- } else {
- $classes[] = "has-{$property}";
- }
-
- $first->setAttribute( 'class', implode( ' ', $classes ) );
-
- $html = $dom->saveHTML();
- }
-
- return $html;
-}
-
-add_filter( 'render_block', NS . 'add_position_styles', 10, 2 );
-/**
- * Renders block inline positioning styles.
- *
- * @param string $html Block HTML.
- * @param array $block Block data.
- *
- * @since 1.0.0
- *
- * @return string
- */
-function add_position_styles( string $html, array $block ): string {
- $style = $block['attrs']['style'] ?? [];
-
- if ( ! $style ) {
- return $html;
- }
-
- $options = get_block_extra_options();
-
- foreach ( $options as $key => $args ) {
-
- if ( ! isset( $style[ $key ] ) ) {
- continue;
- }
-
- // Has utility class.
- if ( isset( $args['options'] ) ) {
- continue;
- }
-
- $dom = dom( $html );
- $first = get_dom_element( '*', $dom );
-
- if ( ! $first ) {
- continue;
- }
-
- $styles = css_string_to_array( $first->getAttribute( 'style' ) );
- $property = _wp_to_kebab_case( $key );
- $all = $style[ $key ]['all'] ?? '';
- $mobile = $style[ $key ]['mobile'] ?? '';
- $desktop = $style[ $key ]['desktop'] ?? '';
-
- if ( $all ) {
- $styles[ '--' . $property ] = $all;
- }
-
- if ( $mobile ) {
- $styles[ '--' . $property . '-mobile' ] = $mobile;
- }
-
- if ( $desktop ) {
- $styles[ '--' . $property . '-desktop' ] = $desktop;
- }
-
- $first->setAttribute( 'style', css_array_to_string( $styles ) );
-
- $html = $dom->saveHTML();
- }
-
- return $html;
-}
-
-
diff --git a/includes/extensions/block-styles.php b/includes/extensions/block-styles.php
deleted file mode 100644
index 177d420..0000000
--- a/includes/extensions/block-styles.php
+++ /dev/null
@@ -1,115 +0,0 @@
- [ 'surface' ],
- 'core/button' => [ 'ghost' ],
- 'core/code' => [ 'surface' ],
- 'core/columns' => [ 'surface' ],
- 'core/column' => [ 'surface' ],
- 'core/group' => [ 'surface' ],
- 'core/list' => [ 'checklist', 'checklist-circle', 'square', 'accordion', 'none' ],
- 'core/list-item' => [ 'surface' ],
- 'core/page-list' => [ 'none' ],
- 'core/paragraph' => [ 'sub-heading', 'notice', 'heading' ],
- 'core/post-terms' => [ 'badges' ],
- 'core/read-more' => [ 'button' ],
- 'core/site-title' => [ 'heading' ],
- 'core/spacer' => [ 'angle', 'curve', 'round', 'wave', 'fade' ],
- 'core/quote' => [ 'surface' ],
- ];
-
- $button_secondary = wp_get_global_settings()['custom']['buttonSecondary'] ?? null;
-
- if ( $button_secondary ) {
- $register['core/button'][] = 'secondary';
- }
-
- $dark_mode = wp_get_global_settings()['custom']['darkMode'] ?? null;
-
- if ( $dark_mode ) {
- $register['core/code'][] = 'light';
- $register['core/code'][] = 'dark';
- $register['core/column'][] = 'light';
- $register['core/column'][] = 'dark';
- $register['core/columns'][] = 'light';
- $register['core/columns'][] = 'dark';
- $register['core/group'][] = 'light';
- $register['core/group'][] = 'dark';
- }
-
- $config['blockStyles'] = [
- 'register' => $register,
- 'unregister' => [
- 'core/image' => [ 'rounded', 'default' ],
- 'core/site-logo' => [ 'default', 'rounded' ],
- 'core/separator' => [ 'wide', 'dots' ],
- ],
- ];
-
- return $config;
-}
-
-add_filter( 'blockify_inline_css', NS . 'get_block_style_heading_styles', 10, 3 );
-/**
- * Get block style heading styles.
- *
- * @since 1.1.2
- *
- * @param string $css Inline CSS.
- * @param string $content Page Content.
- * @param bool $is_editor Is editor page.
- *
- * @return string
- */
-function get_block_style_heading_styles( string $css, string $content, bool $is_editor ): string {
- $global_styles = wp_get_global_styles();
-
- if ( ! str_contains( $content, 'is-style-heading' ) && ! $is_editor ) {
- return $css;
- }
-
- $typography = $global_styles['elements']['heading']['typography'] ?? [];
- $color = $global_styles['elements']['heading']['color'] ?? [];
-
- if ( ! $typography && ! $color ) {
- return $css;
- }
-
- $styles = [];
-
- foreach ( $typography as $key => $value ) {
- $pieces = preg_split( '/(?=[A-Z])/', $key );
- $property = implode( '-', array_map( 'strtolower', $pieces ) );
-
- $styles[ $property ] = $value;
- }
-
- if ( $color['text'] ?? null ) {
- $styles['color'] = $color['text'];
- }
-
- return $css . '.is-style-heading{' . css_array_to_string( $styles ) . '}';
-}
diff --git a/includes/extensions/box-shadow.php b/includes/extensions/box-shadow.php
deleted file mode 100644
index 6baa79b..0000000
--- a/includes/extensions/box-shadow.php
+++ /dev/null
@@ -1,51 +0,0 @@
-getAttribute( 'style' ) );
- $palette = wp_get_global_settings()['color']['palette']['theme'] ?? [];
-
- foreach ( $palette as $theme_color ) {
- if ( $theme_color['color'] === $color ) {
- $styles['--wp--custom--box-shadow--color'] = "var(--wp--preset--color--{$theme_color['slug']})";
- }
-
- if ( $theme_color['color'] === $hover_color ) {
- $styles['--wp--custom--box-shadow--hover--color'] = "var(--wp--preset--color--{$theme_color['slug']})";
- }
- }
-
- $first->setAttribute( 'style', css_array_to_string( $styles ) );
-
- $html = $dom->saveHTML();
- }
-
- return $html;
-}
-
diff --git a/includes/extensions/counter.php b/includes/extensions/counter.php
index eb4b401..8c152be 100644
--- a/includes/extensions/counter.php
+++ b/includes/extensions/counter.php
@@ -5,6 +5,8 @@
namespace Blockify\Theme;
use function add_filter;
+use function esc_attr;
+use function esc_html;
use function file_get_contents;
use function str_contains;
use function trim;
@@ -35,15 +37,15 @@ function render_counter_block_variation( string $html, array $block ): string {
}
foreach ( $counter as $attribute => $value ) {
- $p->setAttribute( "data-$attribute", (string) $value );
+ $p->setAttribute( "data-$attribute", esc_attr( $value ) );
}
- $p->textContent = trim( $p->textContent );
+ $p->textContent = esc_html( trim( $p->textContent ) );
return $dom->saveHTML();
}
-add_filter( 'blockify_inline_js', NS . 'add_counter_js', 10, 2 );
+add_filter( 'blockify_inline_js', NS . 'add_counter_js', 10, 3 );
/**
* Conditionally add counter JS.
*
@@ -51,11 +53,12 @@ function render_counter_block_variation( string $html, array $block ): string {
*
* @param string $js Inline js.
* @param string $html Block html content.
+ * @param bool $all Whether to add all inline js.
*
* @return string
*/
-function add_counter_js( string $js, string $html ): string {
- if ( str_contains( $html, 'is-style-counter' ) ) {
+function add_counter_js( string $js, string $html, bool $all ): string {
+ if ( $all || str_contains( $html, 'is-style-counter' ) ) {
$js .= file_get_contents( get_dir() . 'assets/js/counter.js' );
}
diff --git a/includes/extensions/dark-mode.php b/includes/extensions/dark-mode.php
index 0d1b026..2d55399 100644
--- a/includes/extensions/dark-mode.php
+++ b/includes/extensions/dark-mode.php
@@ -5,129 +5,166 @@
namespace Blockify\Theme;
use function add_filter;
-use function preg_replace;
-use function str_replace;
-use function strtolower;
+use function array_diff;
+use function array_replace;
+use function array_unique;
+use function filter_input;
+use function in_array;
+use function is_null;
+use function is_string;
use function wp_get_global_settings;
-use function wp_get_global_styles;
+use const FILTER_SANITIZE_FULL_SPECIAL_CHARS;
+use const INPUT_COOKIE;
+use const INPUT_GET;
-add_filter( 'body_class', NS . 'add_default_mode_body_class' );
+add_filter( 'body_class', NS . 'add_dark_mode_body_class' );
+//add_filter( 'language_attributes', NS . 'add_dark_mode_body_class' );
/**
- * Adds default mode body class.
+ * Sets default body class.
*
- * @param array $classes Array of body classes.
+ * @since 0.9.10
*
- * @since 1.2.4
+ * @param array $classes Body classes.
*
* @return array
*/
-function add_default_mode_body_class( array $classes ): array {
+function add_dark_mode_body_class( array $classes ): array {
+ $cookie = filter_input( INPUT_COOKIE, 'blockifyDarkMode', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
+ $url_param = filter_input( INPUT_GET, 'dark_mode', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
+ $stylesheet_dir = get_stylesheet_directory();
$global_settings = wp_get_global_settings();
- $dark_mode = $global_settings['custom']['darkMode'] ?? [];
- $light_mode = $global_settings['custom']['lightMode'] ?? [];
- $classes[] = $light_mode && ! $dark_mode ? 'default-mode-dark' : 'default-mode-light';
+ $default_mode = $global_settings['custom']['darkMode']['defaultMode'] ?? 'light';
+ $both_classes = [ 'is-style-light', 'is-style-dark' ];
- return $classes;
-}
-
-add_filter( 'blockify_inline_css', NS . 'get_dark_mode_custom_properties', 9 );
-/**
- * Returns dark mode custom properties.
- *
- * @param string $css Inline CSS.
- *
- * @since 0.0.24
- *
- * @return string
- */
-function get_dark_mode_custom_properties( string $css ): string {
- $global_settings = wp_get_global_settings();
+ $classes[] = 'default-mode-' . $default_mode;
- $dark_mode = $global_settings['custom']['darkMode'] ?? [];
- $light_mode = $global_settings['custom']['lightMode'] ?? [];
-
- if ( ! $dark_mode && ! $light_mode ) {
- return $css;
- }
-
- $mode = ( $light_mode && ! $dark_mode ) ? 'lightMode' : 'darkMode';
-
- $dark_mode_colors = $global_settings['custom'][ $mode ]['palette'] ?? [];
- $dark_mode_gradients = $global_settings['custom'][ $mode ]['gradients'] ?? [];
-
- if ( ! $dark_mode_colors && ! $dark_mode_gradients ) {
- return $css;
+ if ( ! $cookie ) {
+ $classes[] = 'is-style-' . $default_mode;
}
- foreach ( $dark_mode_colors as $slug => $color ) {
- $slug = strtolower( preg_replace( '/(? $gradient ) {
- $slug = strtolower( preg_replace( '/(? [
+ 950 => 25,
+ 900 => 50,
+ 800 => 100,
+ 700 => 200,
+ 600 => 300,
+ 500 => 400,
+ 400 => 500,
+ 300 => 600,
+ 200 => 700,
+ 100 => 800,
+ 50 => 900,
+ 25 => 950,
],
- '',
- $global_styles['color']['text'] ?? ''
- );
+ 'neutral' => [
+ 950 => 0,
+ 900 => 50,
+ 800 => 100,
+ 700 => 200,
+ 600 => 300,
+ 500 => 400,
+ 400 => 500,
+ 300 => 600,
+ 200 => 700,
+ 100 => 800,
+ 50 => 900,
+ 0 => 950,
+ ],
+ 'success' => [
+ 600 => 100,
+ 500 => 500,
+ 100 => 600,
+ ],
+ 'warning' => [
+ 600 => 100,
+ 500 => 500,
+ 100 => 600,
+ ],
+ 'error' => [
+ 600 => 100,
+ 500 => 500,
+ 100 => 600,
+ ],
+ ];
- foreach ( $theme_color_palette as $color ) {
- if ( $light_background_slug === $color['slug'] ) {
- $light['background'] = $color['color'];
- }
+ foreach ( $colors as $slug => $value ) {
+ $explode = explode( '-', $slug );
+ $name = $explode[0] ?? '';
+ $shade = $explode[1] ?? '';
- if ( $light_text_slug === $color['slug'] ) {
- $light['color'] = $color['color'];
+ if ( is_null( $shade ) || in_array( $slug, $system, true ) ) {
+ continue;
}
- }
- foreach ( $theme_gradient_palette as $gradient ) {
- if ( $light_background_slug === $gradient['slug'] ) {
- $light['background'] = $gradient['gradient'];
+ $default_styles["--wp--preset--color--{$slug}"] = $value;
+
+ $opposite_shade = $maps[ $name ][ $shade ] ?? '';
+ $opposite_value = $colors[ $name . '-' . $opposite_shade ] ?? '';
+
+ if ( $opposite_value ) {
+ $opposite_styles["--wp--preset--color--{$slug}"] = $opposite_value;
}
}
- if ( ! is_admin() ) {
- foreach ( $theme_color_palette as $color ) {
- $light[ '--wp--preset--color--' . $color['slug'] ] = $color['color'];
- }
+ foreach ( $gradients as $slug => $value ) {
+ $default_styles["--wp--preset--gradient--{$slug}"] = $value;
+ $opposite_styles["--wp--preset--gradient--{$slug}"] = $value;
+ }
- foreach ( $theme_gradient_palette as $gradient ) {
- $light[ '--wp--preset--gradient--' . $gradient['slug'] ] = $gradient['gradient'];
+ foreach ( $custom as $name => $value ) {
+ if ( is_string( $value ) && str_contains_any( $value, '--wp--preset--color--', '--wp--preset--gradient--' ) ) {
+ $default_styles[ $name ] = $value;
+ $opposite_styles[ $name ] = $value;
}
}
- if ( $mode === 'lightMode' ) {
- return $css . '.is-style-light{' . css_array_to_string( $styles ) . '}.is-style-dark{' . css_array_to_string( $light ) . '}';
- }
+ $css .= "html .is-style-{$default_mode}{" . css_array_to_string( $default_styles ) . '}';
+ $css .= "html .is-style-{$opposite_mode}{" . css_array_to_string( $opposite_styles ) . '}';
- return $css . '.is-style-dark{' . css_array_to_string( $styles ) . '}.is-style-light{' . css_array_to_string( $light ) . '}';
+ return $css;
}
diff --git a/includes/extensions/conic-gradient.php b/includes/extensions/gradient.php
similarity index 100%
rename from includes/extensions/conic-gradient.php
rename to includes/extensions/gradient.php
diff --git a/includes/extensions/grid.php b/includes/extensions/grid.php
new file mode 100644
index 0000000..a1d4d77
--- /dev/null
+++ b/includes/extensions/grid.php
@@ -0,0 +1,41 @@
+getAttribute( 'style' ) );
+ $styles['align-items'] = 'stretch';
+
+ $div->setAttribute( 'style', css_array_to_string( $styles ) );
+
+ $content = $dom->saveHTML();
+ }
+
+ return $content;
+}
diff --git a/includes/extensions/icon.php b/includes/extensions/icon.php
index 9ff50f2..060b2a2 100644
--- a/includes/extensions/icon.php
+++ b/includes/extensions/icon.php
@@ -4,10 +4,15 @@
namespace Blockify\Theme;
-use function add_action;
-use function current_user_can;
use WP_REST_Request;
use WP_REST_Server;
+use function add_action;
+use function current_user_can;
+use function do_blocks;
+use function in_array;
+use function is_array;
+use function str_contains;
+use function str_replace;
add_action( 'rest_api_init', NS . 'register_icons_rest_route' );
/**
@@ -40,3 +45,305 @@ function register_icons_rest_route(): void {
]
);
}
+
+/**
+ * Renders image icon styles on front end.
+ *
+ * @since 0.2.0
+ *
+ * @param string $content Block HTML.
+ * @param array $block Block data.
+ *
+ * @return string
+ */
+function get_icon_html( string $content, array $block ): string {
+ $attrs = $block['attrs'] ?? [];
+ $classes = $attrs['className'] ?? '';
+ $icon_set = $attrs['iconSet'] ?? strtolower( 'WordPress' );
+
+ if ( str_contains( $classes, 'all-icons' ) ) {
+ return render_all_icons( $icon_set );
+ }
+
+ $content = ! $content ? ' ' : $content;
+ $dom = dom( $content );
+ $figure = get_dom_element( 'figure', $dom );
+ $img = get_dom_element( 'img', $figure );
+
+ if ( ! $figure || ! $img ) {
+ return $content;
+ }
+
+ $span = change_tag_name( 'span', $img );
+ $icon_name = $attrs['iconName'] ?? 'star-empty';
+ $gradient = $attrs['gradient'] ?? null;
+ $span_classes = [ 'wp-block-image__icon' ];
+
+ if ( $gradient ) {
+ $span_classes[] = 'has-gradient';
+ }
+
+ $figure_classes = explode( ' ', $figure->getAttribute( 'class' ) );
+ $block_extras = get_block_extension_options();
+ $block_extra_classes = [];
+
+ foreach ( $block_extras as $name => $args ) {
+ $block_extra_classes[] = 'has-' . $args['property'];
+
+ if ( ! isset( $args['options'] ) ) {
+ continue;
+ }
+
+ foreach ( $args['options'] as $option ) {
+ $block_extra_classes[] = 'has-' . $args['property'] . '-' . $option['value'];
+ }
+ }
+
+ foreach ( $figure_classes as $index => $class ) {
+ if ( ! str_contains( $class, 'has-' ) ) {
+ continue;
+ }
+
+ if ( in_array( $class, $block_extra_classes, true ) ) {
+ continue;
+ }
+
+ if ( str_contains( $class, 'has-display' ) ) {
+ continue;
+ }
+
+ if ( str_contains( $class, 'has-' ) && str_contains( $class, '-background' ) ) {
+ unset( $figure_classes[ $index ] );
+ continue;
+ }
+
+ $span_classes[] = $class;
+ unset( $figure_classes[ $index ] );
+ }
+
+ $text_color = $attrs['textColor'] ?? null;
+
+ if ( $text_color ) {
+ $figure_classes[] = "has-{$text_color}-color";
+ }
+
+ $aria_label = $img->getAttribute( 'alt' ) ? $img->getAttribute( 'alt' ) : str_replace( '-', ' ', $icon_name ) . __( ' icon', 'blockify' );
+
+ $span->setAttribute( 'title', $attrs['title'] ?? $aria_label );
+
+ if ( ! ( $attrs['title'] ?? null ) || ! $aria_label ) {
+ $span->setAttribute( 'role', 'img' );
+ }
+
+ $span->removeAttribute( 'src' );
+ $span->removeAttribute( 'alt' );
+
+ $figure_styles = css_string_to_array( $figure->getAttribute( 'style' ) );
+ $span_styles = css_string_to_array( $span->getAttribute( 'style' ) );
+ $properties = wp_list_pluck( array_values( $block_extras ), 'property' );
+
+ $custom_properties = array_map(
+ static fn( string $property ): string => '--' . $property,
+ $properties
+ );
+
+ foreach ( $figure_styles as $key => $value ) {
+ if ( in_array( $key, $properties, true ) ) {
+ continue;
+ }
+
+ if ( in_array( $key, $custom_properties, true ) ) {
+ continue;
+ }
+
+ if ( str_contains( $key, 'margin' ) ) {
+ continue;
+ }
+
+ $span_styles[ $key ] = $value;
+ unset( $figure_styles[ $key ] );
+ }
+
+ $svg_string = $attrs['iconSvgString'] ?? get_icon( $icon_set, $icon_name );
+
+ if ( $gradient && $svg_string ) {
+ $span_styles['--wp--custom--icon--url'] = 'url(\'data:image/svg+xml;utf8,' . $svg_string . '\')';
+ } else {
+ unset( $span_styles['--wp--custom--icon--url'] );
+ }
+
+ $size = $attrs['iconSize'] ?? null;
+
+ if ( $gradient && $size ) {
+ $span_styles['--wp--custom--icon--size'] = $size;
+ } else {
+ unset( $span_styles['--wp--custom--icon--size'] );
+ }
+
+ $custom_text_color = $attrs['style']['color']['text'] ?? null;
+
+ if ( $custom_text_color ) {
+ $figure_styles['--wp--custom--icon--color'] = $custom_text_color;
+ }
+
+ $background_color = $attrs['backgroundColor'] ?? null;
+
+ if ( $background_color ) {
+ $figure_styles['--wp--custom--icon--background'] = "var(--wp--preset--color--{$background_color})";
+ }
+
+ if ( $gradient ) {
+
+ if ( $text_color || $custom_text_color ) {
+ $figure_styles['--wp--custom--icon--background'] = "var(--wp--preset--gradient--{$gradient})";
+ } else {
+ $figure_styles['--wp--custom--icon--color'] = "var(--wp--preset--gradient--{$gradient})";
+ }
+ }
+
+ $border_radius = $attrs['style']['border']['radius'] ?? null;
+
+ if ( $border_radius ) {
+ $span_styles['border-radius'] = $border_radius;
+ }
+
+ $padding = $attrs['style']['spacing']['padding'] ?? null;
+
+ if ( $padding ) {
+ $span_styles = add_shorthand_property( $span_styles, 'padding', $padding );
+ }
+
+ $transform = $attrs['style']['transform'] ?? [];
+ $transform_units = [
+ 'rotate' => 'deg',
+ 'skew' => 'deg',
+ 'scale' => '',
+ 'translate' => '',
+ ];
+
+ if ( ! empty( $transform ) && is_array( $transform ) ) {
+ $figure_classes[] = 'has-transform';
+ $transform_value = '';
+
+ foreach ( $transform as $key => $value ) {
+ if ( $key === 'hover' ) {
+ $hover_transform = '';
+
+ foreach ( $value as $hover_key => $hover_value ) {
+ $unit = $transform_units[ $hover_key ] ?? '';
+ $hover_transform .= "{$hover_key}({$hover_value}{$unit}) ";
+ }
+
+ $figure_styles['--transform-hover'] = $hover_transform;
+
+ } else {
+ $unit = $transform_units[ $key ] ?? '';
+ $transform_value .= "{$key}({$value}{$unit}) ";
+ }
+ }
+
+ if ( ! in_array( 'has-transform', $span_classes, true ) ) {
+ $figure_styles['transform'] = $transform_value;
+ }
+ }
+
+ $figure->setAttribute( 'class', implode( ' ', $figure_classes ) );
+ $span->setAttribute( 'class', implode( ' ', $span_classes ) );
+ $figure->setAttribute( 'style', css_array_to_string( $figure_styles ) );
+ $span->setAttribute( 'style', css_array_to_string( $span_styles ) );
+
+ $link = get_dom_element( 'a', $figure );
+
+ if ( $link ) {
+ $link->appendChild( $span );
+ } else {
+ $figure->appendChild( $span );
+ }
+
+ if ( ! $gradient ) {
+ $icon = get_icon( $icon_set, $icon_name, $size );
+
+ if ( $icon ) {
+ $icon_dom = dom( $icon );
+ $imported_icon = $dom->importNode( $icon_dom->firstChild, true );
+
+ $span->appendChild( $imported_icon );
+ }
+ }
+
+ $html = $dom->saveHTML();
+ $html = add_position_classes( $html, $block );
+ $html = add_position_styles( $html, $block );
+
+ return $html;
+}
+
+/**
+ * Displays grid of all icons in a set.
+ *
+ * @since 1.3.0
+ *
+ * @param string $set Icon set name.
+ *
+ * @return string
+ */
+function render_all_icons( string $set = 'wordpress' ): string {
+ $icons = get_icons( $set );
+ $inner_blocks = [];
+ $limit = 40;
+
+ foreach ( $icons as $icon => $svg ) {
+ if ( $limit-- <= 0 ) {
+ break;
+ }
+
+ $inner_blocks[] = [
+ 'blockName' => 'core/image',
+ 'attrs' => [
+ 'className' => 'is-style-icon',
+ 'iconSet' => $set,
+ 'iconName' => $icon,
+ 'iconSvgString' => $svg,
+ 'iconSize' => '1em',
+ ],
+ ];
+ }
+
+ $inner_blocks[] = [
+ 'blockName' => 'core/paragraph',
+ 'attrs' => [
+ 'content' => __( 'This is a preview of all icons in the set.', 'blockify' ),
+ ],
+ ];
+
+ $inner_blocks[] = [
+ 'blockName' => 'core/image',
+ 'attrs' => [
+ 'className' => 'is-style-icon',
+ 'iconSet' => 'social',
+ 'iconName' => 'blockify',
+ 'iconSvgString' => get_icons()['social']['blockify'],
+ 'iconSize' => '1em',
+ ],
+ ];
+
+ $block = [
+ 'blockName' => 'core/group',
+ 'attrs' => [
+ 'style' => [
+ 'spacing' => [
+ 'blockGap' => 'var(--wp--preset--spacing--sm)',
+ ],
+ ],
+ 'fontSize' => '24',
+ 'textColor' => 'heading',
+ 'layout' => [
+ 'type' => 'flex',
+ 'flexWrap' => 'wrap',
+ ],
+ ],
+ 'innerBlocks' => $inner_blocks,
+ ];
+
+ return do_blocks( get_block_html( $block ) );
+}
diff --git a/includes/extensions/inline-color.php b/includes/extensions/inline-color.php
index a19152e..3e4a3fe 100644
--- a/includes/extensions/inline-color.php
+++ b/includes/extensions/inline-color.php
@@ -25,8 +25,7 @@ function render_inline_color( string $html ): string {
return $html;
}
- $dom = dom( $html );
-
+ $dom = dom( $html );
$first = get_dom_element( '*', $dom );
if ( ! $first ) {
diff --git a/includes/extensions/onclick.php b/includes/extensions/onclick.php
index 0d23554..3fe6204 100644
--- a/includes/extensions/onclick.php
+++ b/includes/extensions/onclick.php
@@ -4,35 +4,37 @@
namespace Blockify\Theme;
+use WP_Block;
use function add_filter;
+use function apply_filters;
use function rtrim;
use function str_contains;
+use function strval;
use function trim;
-add_filter( 'render_block', NS . 'render_block_onclick_attribute', 11, 2 );
+add_filter( 'render_block', NS . 'render_block_onclick_attribute', 11, 3 );
/**
* Modifies front end HTML output of block.
*
* @since 0.0.2
*
- * @param string $html Block HTML.
- * @param array $block Block data.
+ * @param string $html Block HTML.
+ * @param array $block Block data.
+ * @param WP_Block $object Block args.
*
* @return string
*/
-function render_block_onclick_attribute( string $html, array $block ): string {
+function render_block_onclick_attribute( string $html, array $block, WP_Block $object ): string {
+ $js = strval( $block['attrs']['onclick'] ?? '' );
- // Force casting to string in case of incorrect html.
- if ( isset( $block['attrs']['onclick'] ) ) {
- $on_click = (string) $block['attrs']['onclick'];
- } else {
+ if ( ! $js ) {
return $html;
}
- $on_click = str_replace( '"', "'", $on_click );
- $on_click = trim( rtrim( $on_click, ';' ) );
- $on_click = reduce_whitespace( $on_click );
+ $js = render_template_tags( $js, $block, $object );
+ $on_click = format_inline_js( $js );
$link = null;
+ $name = $block['blockName'] ?? '';
// Groups and buttons.
if ( $on_click && $html ) {
@@ -40,11 +42,9 @@ function render_block_onclick_attribute( string $html, array $block ): string {
$div = get_dom_element( 'div', $dom );
$link = get_dom_element( 'a', $div );
- if ( $link ) {
+ if ( $link && $name === 'core/button' ) {
$link->setAttribute( 'onclick', $on_click );
- }
-
- if ( ! $link && $div ) {
+ } else if ( $div ) {
$div->setAttribute( 'onclick', $on_click );
}
@@ -66,3 +66,21 @@ function render_block_onclick_attribute( string $html, array $block ): string {
return $html;
}
+
+/**
+ * Formats inline JS.
+ *
+ * @since 1.2.9
+ *
+ * @param string $js JS.
+ *
+ * @return string
+ */
+function format_inline_js( string $js ): string {
+ $js = str_replace( '"', "'", $js );
+ $js = trim( rtrim( $js, ';' ) );
+ $js = reduce_whitespace( $js );
+ $js = remove_line_breaks( $js );
+
+ return apply_filters( 'blockify_format_inline_js', $js );
+}
diff --git a/includes/extensions/placeholder.php b/includes/extensions/placeholder.php
index a3cdd05..45dec35 100644
--- a/includes/extensions/placeholder.php
+++ b/includes/extensions/placeholder.php
@@ -4,54 +4,62 @@
namespace Blockify\Theme;
-use DOMException;
+use DOMDocument;
+use DOMElement;
+use WP_Block;
+use function apply_filters;
use function array_merge;
+use function count;
+use function esc_attr;
+use function esc_html__;
+use function esc_url;
use function explode;
+use function glob;
use function implode;
use function in_array;
+use function property_exists;
+use function str_replace;
/**
* Returns placeholder HTML element string.
*
* @since 0.9.10
*
- * @param string $html Block content.
- * @param array $block Block attributes.
- *
- * @throws DOMException If the HTML is invalid.
+ * @param string $html Block content.
+ * @param array $block Block attributes.
+ * @param WP_Block $object Block object.
*
* @return string
*/
-function render_image_placeholder( string $html, array $block ): string {
+function render_image_placeholder( string $html, array $block, WP_Block $object ): string {
+ $use_placeholder = $block['attrs']['usePlaceholder'] ?? 'default';
+
+ if ( ! $use_placeholder || $use_placeholder === 'none' ) {
+ return $html;
+ }
+
$dom = dom( $html );
$figure = get_dom_element( 'figure', $dom );
$img = get_dom_element( 'img', $figure );
+ $link = get_dom_element( 'a', $figure );
+ $svg = get_dom_element( 'svg', $link ?? $figure );
- if ( $img && $img->getAttribute( 'src' ) ) {
+ if ( $svg ) {
return $html;
}
- $html = ! $html ? ' ' : $html;
- $dom = dom( $html );
-
- // @phpcs:disable WordPress.WP.CapitalPDangit.Misspelled
- $svg = get_icon( 'wordpress', 'image', 30 );
- $svg_dom = dom( $svg );
- $svg_element = get_dom_element( 'svg', $svg_dom );
-
- if ( ! $svg_element ) {
+ if ( $img && $img->getAttribute( 'src' ) ) {
return $html;
}
- $svg_classes = explode( ' ', $svg_element->getAttribute( 'class' ) );
-
- $svg_classes[] = 'wp-block-image__placeholder-icon';
-
- $svg_element->setAttribute( 'class', implode( ' ', $svg_classes ) );
-
- $svg_element->setAttribute( 'fill', 'currentColor' );
+ $block_name = str_replace(
+ 'core/',
+ '',
+ $block['blockName'] ?? ''
+ );
- $result = $dom->importNode( $svg_element, true );
+ $html = $html ?: " ";
+ $dom = dom( $html );
$figure = get_dom_element( 'figure', $dom );
if ( ! $figure ) {
@@ -64,7 +72,6 @@ function render_image_placeholder( string $html, array $block ): string {
$figure->removeChild( $img );
}
- $figure->appendChild( $result );
$classes = explode( ' ', $figure->getAttribute( 'class' ) );
if ( ! in_array( 'is-placeholder', $classes, true ) ) {
@@ -75,31 +82,181 @@ function render_image_placeholder( string $html, array $block ): string {
$classes[] = 'align' . $block['align'];
}
- $figure->setAttribute( 'class', implode( ' ', $classes ) );
+ $is_link = $block['attrs']['isLink'] ?? false;
+ $placeholder = get_placeholder_image( $dom );
+
+ if ( $placeholder->tagName === 'svg' ) {
+ $classes[] = 'has-placeholder-icon';
+ }
+
+ if ( $is_link ) {
+ $context = (object) ( property_exists( $object, 'context' ) ? $object->context : null );
+ $link = create_element( 'a', $dom );
+ $id_key = 'postId';
+
+ if ( property_exists( $context, $id_key ) ) {
+ $post_id = $context->$id_key ?? null;
+ $href = get_permalink( $post_id );
+
+ if ( $href ) {
+ $link->setAttribute( 'href', esc_url( $href ) );
+ }
+ }
+
+ $link_target = $block['linkTarget'] ?? '';
+
+ if ( $link_target ) {
+ $link->setAttribute( 'target', $link_target );
+ }
+
+ $rel = esc_attr( $block['rel'] ?? '' );
+
+ if ( $rel ) {
+ $link->setAttribute( 'rel', $rel );
+ }
+
+ $link_classes = explode( ' ', $link->getAttribute( 'class' ) );
+
+ if ( ! in_array( 'wp-block-image__link', $link_classes, true ) ) {
+ $link_classes[] = 'wp-block-image__link';
+ }
+
+ if ( ! in_array( 'is-placeholder', $classes, true ) && ! in_array( 'is-placeholder', $link_classes, true ) ) {
+ $link_classes[] = 'is-placeholder';
+ }
+
+ $link->setAttribute(
+ 'class',
+ implode( ' ', $link_classes )
+ );
+ $link->appendChild( $placeholder );
+ $figure->appendChild( $link );
+ } else {
+ $figure->appendChild( $placeholder );
+ }
+
+ $style = $block['attrs']['style'] ?? [];
+ $spacing = $style['spacing'] ?? [];
+ $margin = $spacing['margin'] ?? [];
+ $padding = $spacing['padding'] ?? [];
+ $border = $style['border'] ?? [];
+ $radius = $border['radius'] ?? [];
+ $aspect_ratio = $block['attrs']['aspectRatio'] ?? null;
+ $background_color = $block['attrs']['backgroundColor'] ?? null;
$styles = [
'width' => $block['width'] ?? null,
'height' => $block['height'] ?? null,
- 'margin-top' => $block['style']['spacing']['margin']['top'] ?? null,
- 'margin-right' => $block['style']['spacing']['margin']['right'] ?? null,
- 'margin-bottom' => $block['style']['spacing']['margin']['bottom'] ?? null,
- // TODO: Get from theme.json.
- 'margin-left' => $block['style']['spacing']['margin']['left'] ?? null,
- 'border-top-left-radius' => $block['style']['border']['radius']['topLeft'] ?? null,
- 'border-top-right-radius' => $block['style']['border']['radius']['topRight'] ?? null,
- 'border-bottom-left-radius' => $block['style']['border']['radius']['bottomLeft'] ?? null,
- 'border-bottom-right-radius' => $block['style']['border']['radius']['bottomRight'] ?? null,
+ 'border-width' => $border['width'] ?? null,
+ 'border-style' => $border['style'] ?? ( ( $border['width'] ?? null ) ? 'solid' : null ),
+ 'border-color' => $border['color'] ?? null,
+ 'border-top-left-radius' => $radius['topLeft'] ?? null,
+ 'border-top-right-radius' => $radius['topRight'] ?? null,
+ 'border-bottom-left-radius' => $radius['bottomLeft'] ?? null,
+ 'border-bottom-right-radius' => $radius['bottomRight'] ?? null,
+ 'position' => $style['position']['all'] ?? null,
+ 'top' => $style['top']['all'] ?? null,
+ 'right' => $style['right']['all'] ?? null,
+ 'bottom' => $style['bottom']['all'] ?? null,
+ 'left' => $style['left']['all'] ?? null,
+ 'z-index' => $style['zIndex']['all'] ?? null,
];
- $figure->setAttribute(
- 'style',
- css_array_to_string(
- array_merge(
- css_string_to_array( $figure->getAttribute( 'style' ) ),
- $styles,
- )
+ $styles = add_shorthand_property( $styles, 'margin', $margin );
+ $styles = add_shorthand_property( $styles, 'padding', $padding );
+
+ if ( $aspect_ratio && $aspect_ratio !== 'auto' ) {
+ $styles['aspect-ratio'] = $aspect_ratio;
+ }
+
+ if ( $background_color === 'transparent' ) {
+ $classes[] = 'has-transparent-background-color';
+ } else {
+ $styles['background-color'] = $background_color;
+ }
+
+ $css = css_array_to_string(
+ array_merge(
+ css_string_to_array(
+ $figure->getAttribute( 'style' )
+ ),
+ $styles,
)
);
+ if ( $css ) {
+ $figure->setAttribute( 'style', $css );
+ }
+
+ $figure->setAttribute( 'class', implode( ' ', $classes ) );
+
return $dom->saveHTML();
}
+
+/**
+ * Returns placeholder image element.
+ *
+ * @param DOMDocument $dom DOM document.
+ *
+ * @return ?DOMElement
+ */
+function get_placeholder_image( DOMDocument $dom ): ?DOMElement {
+ $image_paths = apply_filters(
+ 'blockify_placeholder_images',
+ glob( get_dir() . 'assets/img/placeholder-*.png' )
+ );
+
+ static $last_index = 0;
+
+ $count = count( $image_paths );
+
+ if ( $last_index >= $count ) {
+ $last_index = 0;
+ }
+
+ if ( $count > 0 ) {
+ $img = create_element( 'img', $dom );
+ $img->setAttribute( 'src', esc_url( get_uri() . 'assets/img/' . basename( $image_paths[ $last_index ] ) ) );
+ $img->setAttribute( 'alt', '' );
+
+ $result = dom_element( $img );
+
+ $last_index++;
+ } else {
+ $svg_title = esc_html__( 'Image placeholder', 'blockify' );
+ $svg_icon = <<
+ $svg_title
+
+
+
+HTML;
+
+ /**
+ * Filters the SVG icon for the placeholder image.
+ *
+ * @since 1.3.0
+ *
+ * @param string $svg_icon SVG icon.
+ * @param string $svg_title SVG title.
+ */
+ $svg_icon = apply_filters( 'blockify_placeholder_svg', $svg_icon, $svg_title );
+ $svg_dom = dom( $svg_icon );
+ $svg_element = get_dom_element( 'svg', $svg_dom );
+
+ if ( ! $svg_element ) {
+ return create_element( 'span', $dom );
+ }
+
+ $svg_classes = explode( ' ', $svg_element->getAttribute( 'class' ) );
+ $svg_classes[] = 'wp-block-image__placeholder-icon';
+
+ $svg_element->setAttribute( 'class', implode( ' ', $svg_classes ) );
+ $svg_element->setAttribute( 'fill', 'currentColor' );
+
+ $imported = $dom->importNode( $svg_element, true );
+ $result = dom_element( $imported );
+ }
+
+ return $result ?? null;
+}
diff --git a/includes/extensions/shadow.php b/includes/extensions/shadow.php
new file mode 100644
index 0000000..bf4a7cf
--- /dev/null
+++ b/includes/extensions/shadow.php
@@ -0,0 +1,241 @@
+getAttribute( 'class' ) );
+ $nested_classes = explode( ' ', $nested->getAttribute( 'class' ) );
+
+ foreach ( $first_classes as $index => $class ) {
+ $exploded = explode( '-', $class );
+ $has = 'has' === ( $exploded[0] ?? null );
+ $shadow = in_array( 'shadow', [ $exploded[1] ?? '', $exploded[2] ?? '' ], true );
+
+ if ( $has && $shadow ) {
+ unset( $first_classes[ $index ] );
+ $nested_classes[] = $class;
+ }
+ }
+
+ $first->setAttribute( 'class', implode( ' ', $first_classes ) );
+ $nested->setAttribute( 'class', implode( ' ', $nested_classes ) );
+
+ $html = $dom->saveHTML();
+ }
+ }
+
+ if ( $hover_preset && ! $shadow_preset ) {
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
+ $classes = explode( ' ', $first->getAttribute( 'class' ) );
+ $classes = array_diff( $classes, [ 'has-shadow' ] );
+ $classes[] = 'has-shadow-hover';
+
+ $first->setAttribute( 'class', implode( ' ', $classes ) );
+
+ $html = $dom->saveHTML();
+ }
+
+ $custom_shadow = $block['attrs']['style']['boxShadow'] ?? null;
+
+ if ( ! $custom_shadow ) {
+ return $html;
+ }
+
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
+
+ if ( ! $first ) {
+ return $html;
+ }
+
+ $first_classes = explode( ' ', $first->getAttribute( 'class' ) );
+
+ if ( ! in_array( 'has-box-shadow', $first_classes, true ) ) {
+ $first_classes[] = 'has-box-shadow';
+ }
+
+ $first->setAttribute( 'class', implode( ' ', $first_classes ) );
+
+ $styles = css_string_to_array( $first->getAttribute( 'style' ) );
+
+ $inset = $custom_shadow['inset'] ?? null;
+ $inset_hover = $custom_shadow['hover']['inset'] ?? null;
+
+ if ( $inset ) {
+ $styles['--wp--custom--box-shadow--inset'] = 'inset';
+ }
+
+ if ( $inset_hover ) {
+ $styles['--wp--custom--box-shadow--hover--inset'] = 'inset';
+ }
+
+ foreach ( [ 'x', 'y', 'blur', 'spread' ] as $property ) {
+
+ if ( $custom_shadow[ $property ] ?? '' ) {
+ $styles[ '--wp--custom--box-shadow--' . $property ] = esc_attr( $custom_shadow[ $property ] ) . 'px';
+ }
+
+ if ( $custom_shadow['hover'][ $property ] ?? '' ) {
+ $styles[ '--wp--custom--box-shadow--hover--' . $property ] = esc_attr( $custom_shadow['hover'][ $property ] ) . 'px';
+ }
+
+ }
+
+ $color = $custom_shadow['color'] ?? null;
+ $hover_color = $custom_shadow['hover']['color'] ?? null;
+ $palette = wp_get_global_settings()['color']['palette']['theme'] ?? [];
+
+ foreach ( $palette as $theme_color ) {
+ if ( $theme_color['color'] === $color ) {
+ $styles['--wp--custom--box-shadow--color'] = "var(--wp--preset--color--{$theme_color['slug']})";
+ }
+
+ if ( $theme_color['color'] === $hover_color ) {
+ $styles['--wp--custom--box-shadow--hover--color'] = "var(--wp--preset--color--{$theme_color['slug']})";
+ }
+ }
+
+ $first->setAttribute( 'style', css_array_to_string( $styles ) );
+
+ return $dom->saveHTML();
+}
+
+add_filter( 'render_block', NS . 'render_text_shadow', 10, 2 );
+/**
+ * Adds text shadow to blocks.
+ *
+ * @param string $html The block content.
+ * @param array $block The block.
+ *
+ * @return string
+ */
+function render_text_shadow( string $html, array $block ): string {
+ $text_shadow = $block['attrs']['style']['textShadow'] ?? [];
+
+ if ( ! $text_shadow ) {
+ return $html;
+ }
+
+ $dom = dom( $html );
+ $first = get_dom_element( '*', $dom );
+
+ if ( ! $first ) {
+ return $html;
+ }
+
+ $first_classes = explode( ' ', $first->getAttribute( 'class' ) );
+
+ $text_classes = array_unique( [
+ ...$first_classes,
+ 'has-text-shadow',
+ ] );
+
+ $first->setAttribute( 'class', implode( ' ', $text_classes ) );
+
+ $first_styles = css_string_to_array( $first->getAttribute( 'style' ) );
+
+ $x = $text_shadow['x'] ?? null;
+ $y = $text_shadow['y'] ?? null;
+ $blur = $text_shadow['blur'] ?? null;
+ $color = $text_shadow['color'] ?? null;
+
+ if ( $x ) {
+ $first_styles['--wp--custom--text-shadow--x'] = esc_attr( $x ) . 'px';
+ }
+
+ if ( $y ) {
+ $first_styles['--wp--custom--text-shadow--y'] = esc_attr( $y ) . 'px';
+ }
+
+ if ( $blur ) {
+ $first_styles['--wp--custom--text-shadow--blur'] = esc_attr( $blur ) . 'px';
+ }
+
+ if ( $color ) {
+ $palette = wp_get_global_settings()['color']['palette']['theme'] ?? [];
+
+ $first_styles['--wp--custom--text-shadow--color'] = esc_attr( $color );
+
+ foreach ( $palette as $theme_color ) {
+ if ( $theme_color['color'] === $color ) {
+ $first_styles['--wp--custom--text-shadow--color'] = "var(--wp--preset--color--{$theme_color['slug']})";
+ }
+ }
+ }
+
+ $first->setAttribute( 'style', css_array_to_string( $first_styles ) );
+
+ return $dom->saveHTML();
+}
+
+add_filter( 'blockify_dynamic_custom_properties', NS . 'add_shadow_custom_properties', 10, 2 );
+/**
+ * Adds box shadow custom properties.
+ *
+ * @param array $styles The custom properties.
+ * @param array $global_styles The global styles.
+ *
+ * @return array
+ */
+function add_shadow_custom_properties( array $styles, array $global_styles ): array {
+ global $template_html;
+
+ $is_editor = is_admin() && ! wp_doing_ajax();
+ $settings = wp_get_global_settings();
+ $presets = $settings['shadow']['presets']['theme'] ?? [];
+
+ foreach ( $presets as $preset ) {
+ $slug = $preset['slug'] ?? null;
+ $shadow = $preset['shadow'] ?? null;
+
+ if ( ! $slug || ! $shadow ) {
+ continue;
+ }
+
+ if ( ! $is_editor && ! str_contains( $template_html ?? '', "has-{$slug}" ) ) {
+ continue;
+ }
+
+ $styles[ '--wp--preset--shadow--' . $slug . '--hover' ] = esc_attr( $preset['shadow'] );
+ }
+
+ return $styles;
+}
diff --git a/includes/extensions/svg.php b/includes/extensions/svg.php
index a08bb63..96cd16e 100644
--- a/includes/extensions/svg.php
+++ b/includes/extensions/svg.php
@@ -5,8 +5,17 @@
namespace Blockify\Theme;
use function add_filter;
+use function array_diff;
+use function content_url;
+use function dirname;
+use function esc_attr;
use function explode;
+use function file_exists;
+use function file_get_contents;
+use function get_template_directory;
use function implode;
+use function in_array;
+use function method_exists;
use function rawurlencode;
use function str_contains;
use function str_replace;
@@ -17,10 +26,11 @@
/**
* Render SVG block variation.
*
- * @param string $html Block html content.
+ * @since 0.9.10
+ *
* @param array $block Block data.
*
- * @since 0.9.10
+ * @param string $html Block html content.
*
* @return string
*/
@@ -42,11 +52,11 @@ function render_svg_block_variation( string $html, array $block ): string {
$svg = get_dom_element( 'svg', $link ?? $figure );
$mask = (bool) ( $block['attrs']['style']['maskSvg'] ?? false );
- $width = $block['attrs']['width'] ?? '';
- $height = $block['attrs']['height'] ?? '';
+ $width = esc_attr( $block['attrs']['width'] ?? '' );
+ $height = esc_attr( $block['attrs']['height'] ?? '' );
if ( $mask ) {
- $span = change_tag_name( $img, 'span' );
+ $span = change_tag_name( 'span', $img );
$styles = css_string_to_array( $span->getAttribute( 'style' ) );
$encoded = rawurlencode(
str_replace(
@@ -59,13 +69,17 @@ function render_svg_block_variation( string $html, array $block ): string {
$styles['-webkit-mask-image'] = 'url("data:image/svg+xml;utf8,' . $encoded . '")';
if ( $width ) {
- $styles['width'] = $width . 'px';
+ $unit = str_contains_any( $width, 'px', 'em', 'rem', 'vh', 'vw', '%' ) ? '' : 'px';
+
+ $styles['width'] = $width . $unit;
$span->removeAttribute( 'width' );
}
if ( $height ) {
- $styles['height'] = $height . 'px';
+ $unit = str_contains_any( $height, 'px', 'em', 'rem', 'vh', 'vw', '%' ) ? '' : 'px';
+
+ $styles['height'] = $height . $unit;
$span->removeAttribute( 'height' );
}
@@ -73,7 +87,7 @@ function render_svg_block_variation( string $html, array $block ): string {
$alt = $img->getAttribute( 'alt' );
if ( $alt ) {
- $span->setAttribute( 'aria-label', $alt );
+ $span->setAttribute( 'aria-label', esc_attr( $alt ) );
$span->removeAttribute( 'alt' );
}
@@ -109,11 +123,11 @@ function render_svg_block_variation( string $html, array $block ): string {
$imported = dom_element( $imported );
if ( $width ) {
- $imported->setAttribute( 'width', (string) $width );
+ $imported->setAttribute( 'width', $width );
}
if ( $height ) {
- $imported->setAttribute( 'height', (string) $height );
+ $imported->setAttribute( 'height', $height );
}
( $link ?? $figure )->appendChild( $imported );
@@ -127,18 +141,19 @@ function render_svg_block_variation( string $html, array $block ): string {
return $dom->saveHTML();
}
-add_filter( 'render_block', NS . 'render_inline_svg', 10, 2 );
+add_filter( 'render_block', NS . 'render_inline_svg_mask', 10, 2 );
/**
* Renders inline SVGs in rich text content.
*
- * @param string $html Block html content.
+ * @since 0.9.10
+ *
* @param array $block Block data.
*
- * @since 0.9.10
+ * @param string $html Block html content.
*
* @return string
*/
-function render_inline_svg( string $html, array $block ): string {
+function render_inline_svg_mask( string $html, array $block ): string {
if ( ! str_contains( $html, 'has-inline-svg' ) ) {
return $html;
}
@@ -150,13 +165,13 @@ function render_inline_svg( string $html, array $block ): string {
return $html;
}
- $imgs = $dom->getElementsByTagName( 'img' );
+ $images = $dom->getElementsByTagName( 'img' );
- if ( ! $imgs->length ) {
+ if ( ! $images->length ) {
return $html;
}
- foreach ( $imgs as $index => $img ) {
+ foreach ( $images as $index => $img ) {
$style = css_string_to_array( $img->getAttribute( 'style' ) );
$mask = $style['-webkit-mask-image'] ?? '';
@@ -186,14 +201,16 @@ function render_inline_svg( string $html, array $block ): string {
continue;
}
- $imported->setAttribute( $attribute->name, $attribute->value );
+ $imported->setAttribute(
+ esc_attr( $attribute->name ),
+ esc_attr( $attribute->value )
+ );
}
$imported->setAttribute( 'fill', 'currentColor' );
$classes = explode( ' ', $img->getAttribute( 'class' ) );
-
- unset( $classes[ array_search( 'has-inline-svg', $classes, true ) ] );
+ $classes = array_diff( $classes, [ 'has-inline-svg' ] );
$classes[] = 'inline-svg';
@@ -208,3 +225,89 @@ function render_inline_svg( string $html, array $block ): string {
return $html;
}
+
+add_filter( 'render_block', NS . 'render_inline_svg', 10, 2 );
+/**
+ * Converts image asset to inline SVG.
+ *
+ * @since 1.5.0
+ *
+ * @param string $html Block HTML.
+ * @param array $block Block data.
+ *
+ * @return string
+ */
+function render_inline_svg( string $html, array $block ): string {
+ $blocks = [
+ 'core/image',
+ 'core/site-logo',
+ 'core/post-featured-image',
+ ];
+
+ $name = $block['blockName'] ?? '';
+
+ if ( ! in_array( $name, $blocks, true ) ) {
+ return $html;
+ }
+
+ if ( ! str_contains( $html, '.svg' ) ) {
+ return $html;
+ }
+
+ $attrs = $block['attrs'] ?? [];
+ $dom = dom( $html );
+ $div = get_dom_element( 'div', $dom );
+ $figure = get_dom_element( 'figure', $dom );
+ $first = $div ?? $figure ?? null;
+ $link = get_dom_element( 'a', $first );
+ $img = get_dom_element( 'img', $link ?? $first );
+
+ if ( ! $img ) {
+ return $html;
+ }
+
+ $file = str_replace(
+ content_url(),
+ dirname( get_template_directory(), 2 ),
+ $img->getAttribute( 'src' )
+ );
+
+ if ( ! file_exists( $file ) ) {
+ return $html;
+ }
+
+ $svg = $dom->importNode( dom( file_get_contents( $file ) )->documentElement, true );
+
+ if ( ! method_exists( $svg, 'setAttribute' ) ) {
+ return $html;
+ }
+
+ $width = $attrs['width'] ?? $img->getAttribute( 'width' );
+ $height = $attrs['height'] ?? $img->getAttribute( 'height' );
+ $alt = $attrs['alt'] ?? $img->getAttribute( 'alt' );
+
+ if ( $width ) {
+ $svg->setAttribute( 'width', str_replace( 'px', '', (string) $width ) );
+ }
+
+ if ( $height ) {
+ $svg->setAttribute( 'height', str_replace( 'px', '', (string) $height ) );
+ }
+
+ if ( $alt ) {
+ $svg->setAttribute( 'aria-label', $alt );
+ }
+
+ $svg->setAttribute( 'class', $img->getAttribute( 'class' ) );
+
+ ( $link ?? $first )->removeChild( $img );
+ ( $link ?? $first )->appendChild( $svg );
+
+ $first_classes = explode( ' ', $first->getAttribute( 'class' ) );
+
+ $first_classes[] = 'has-inlined-svg';
+
+ $first->setAttribute( 'class', implode( ' ', $first_classes ) );
+
+ return $dom->saveHTML();
+}
diff --git a/includes/extensions/template-tags.php b/includes/extensions/template-tags.php
new file mode 100644
index 0000000..1efcdc6
--- /dev/null
+++ b/includes/extensions/template-tags.php
@@ -0,0 +1,234 @@
+get_all_registered();
+
+ if ( ! array_key_exists( $block_name, $registered_blocks ) ) {
+ return $html;
+ }
+
+ $category = $registered_blocks[ $block_name ]->category ?? '';
+
+ $other_blocks = [ 'core/button', 'core/navigation-link', 'core/image' ];
+
+ if ( 'text' !== $category && ! in_array( $block_name, $other_blocks, true ) ) {
+ return $html;
+ }
+
+ $html = str_replace(
+ [ '{', '}', '%7B', '%7D' ],
+ [ '{', '}', '{', '}' ],
+ $html
+ );
+
+ if ( ! str_contains( $html, '{' ) || ! str_contains( $html, '}' ) ) {
+ return $html;
+ }
+
+ preg_match_all( '#\{(.*?)}#', $html, $matches );
+
+ $without_brackets = $matches[1] ?? [];
+
+ if ( empty( $without_brackets ) ) {
+ return $html;
+ }
+
+ $post_id = $object->context['postId'] ?? get_the_ID();
+ $replacements = [];
+
+ foreach ( $without_brackets as $tag ) {
+ $tag = strtolower( $tag );
+ $replacement = '';
+
+ if ( shortcode_exists( $tag ) ) {
+ continue;
+ }
+
+ if ( ! is_null( $post_id ) ) {
+ $post_field = get_post_field( $tag, $post_id );
+
+ if ( $post_field ) {
+ $replacement = $post_field;
+ } else {
+ $post_meta = get_post_meta( $post_id, $tag, true );
+
+ if ( $post_meta ) {
+ $replacement = $post_meta;
+ }
+ }
+ }
+
+ if ( ! $replacement ) {
+ $tags = get_template_tags( $post_id ?: null );
+
+ if ( isset( $tags[ $tag ] ) ) {
+ $replacement = is_callable( $tags[ $tag ] ) ? call_user_func( $tags[ $tag ] ) : $tags[ $tag ];
+ }
+ }
+
+ if ( $replacement ) {
+ $replacements[ '{' . $tag . '}' ] = esc_html( $replacement );
+ }
+ }
+
+ return str_replace( array_keys( $replacements ), array_values( $replacements ), $html );
+}
+
+/**
+ * Get template tags.
+ *
+ * @since 0.9.34
+ *
+ * @param ?int $post_id Extra tags.
+ *
+ * @return array
+ */
+function get_template_tags( ?int $post_id ): array {
+ static $tags = null;
+
+ if ( is_null( $tags ) ) {
+ $year = gmdate( 'Y' );
+ $site_name = get_bloginfo( 'name', 'display' );
+
+ $tags = [
+ 'year' => $year,
+ 'current_year' => $year, // Backwards compatibility.
+ 'date' => gmdate( 'm/d/Y' ),
+ 'home_url' => home_url(),
+ 'site_title' => $site_name,
+ 'site_name' => $site_name,
+ ];
+ }
+
+ /**
+ * Filter template tags.
+ *
+ * @since 0.9.34
+ *
+ * @param array $tags Template tags.
+ * @param int $post_id Post ID.
+ *
+ * @return array
+ */
+ return apply_filters( 'blockify_template_tags', $tags, $post_id );
+}
+
+add_filter( 'blockify_template_tags', NS . 'add_post_template_tags', 10, 2 );
+/**
+ * Adds post tags not included in post fields.
+ *
+ * @since 1.3.0
+ *
+ * @param array $tags Template tags.
+ * @param ?int $post_id Post ID.
+ *
+ * @return array
+ */
+function add_post_template_tags( array $tags, ?int $post_id ): array {
+ if ( ! $post_id ) {
+ return $tags;
+ }
+
+ $tags['post_id'] = $post_id;
+ $tags['permalink'] = get_permalink( $post_id );
+
+ $post_type = get_post_type( $post_id );
+ $post_type_object = get_post_type_object( $post_type );
+
+ if ( $post_type_object ) {
+ $tags['post_type_label'] = $post_type_object->label;
+ }
+
+ return $tags;
+}
+
+add_filter( 'blockify_template_tags', NS . 'add_archive_template_tags', 10, 2 );
+/**
+ * Adds archive tags.
+ *
+ * @since 1.3.0
+ *
+ * @param array $tags Template tags.
+ * @param ?int $post_id Post ID.
+ *
+ * @return array
+ */
+function add_archive_template_tags( array $tags, ?int $post_id ): array {
+ if ( is_archive() || is_home() ) {
+ $tags['archive_title'] = static function (): string {
+ add_filter( 'get_the_archive_title_prefix', '__return_empty_string' );
+
+ $title = get_the_archive_title();
+
+ remove_filter( 'get_the_archive_title_prefix', '__return_empty_string' );
+
+ return $title;
+ };
+ }
+
+ return $tags;
+}
+
+add_filter( 'get_the_archive_title', NS . 'get_the_archive_title_home', 10, 1 );
+/**
+ * Get the archive title for the home page.
+ *
+ * @since 1.3.0
+ *
+ * @param string $title Archive title.
+ *
+ * @return string
+ */
+function get_the_archive_title_home( string $title ): string {
+ if ( is_home() ) {
+ $title = get_the_title( get_option( 'page_for_posts', true ) );
+ }
+
+ return $title;
+}
diff --git a/includes/patterns.php b/includes/patterns.php
deleted file mode 100644
index f87f73d..0000000
--- a/includes/patterns.php
+++ /dev/null
@@ -1,178 +0,0 @@
-get_all_registered();
-
- foreach ( $block_patterns as $block_pattern ) {
- if ( ! isset( $block_pattern['categories'] ) ) {
- continue;
- }
-
- sort( $block_pattern['categories'] );
-
- foreach ( $block_pattern['categories'] as $category ) {
- $categories = wp_list_pluck( WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(), 'name' );
-
- if ( in_array( $category, $categories, true ) ) {
- continue;
- }
-
- register_block_pattern_category(
- $category,
- [
- 'label' => ucfirst( $category ),
- ]
- );
- }
- }
-}
-
-add_action( 'init', NS . 'register_default_patterns' );
-/**
- * Manually registers default patterns to avoid loading in child themes.
- *
- * @since 1.0.1
- *
- * @return void
- */
-function register_default_patterns(): void {
- if ( is_child_theme() || is_framework() ) {
- return;
- }
-
- $files = glob( get_dir() . 'patterns/default/*.php' );
-
- foreach ( $files as $file ) {
- register_block_pattern_from_file( $file );
- }
-}
-
-/**
- * Parses and registers block pattern from PHP file with header comment.
- *
- * @since 0.0.8
- *
- * @param string $file Path to PHP file.
- *
- * @return void
- */
-function register_block_pattern_from_file( string $file ): void {
- if ( ! is_readable( $file ) ) {
- return;
- }
-
- $content = $file;
-
- if ( file_exists( $file ) ) {
- $headers = get_file_data(
- $file,
- [
- 'categories' => 'Categories',
- 'title' => 'Title',
- 'slug' => 'Slug',
- 'block_types' => 'Block Types',
- ]
- );
-
- ob_start();
- include $file;
- $content = ob_get_clean();
-
- } elseif ( str_contains( $file, 'Title: ' ) ) {
- $headers = [
- 'title' => 'Title',
- 'slug' => 'Slug',
- 'categories' => 'Categories',
- 'block_types' => 'Block Types',
- ];
-
- // Use regex from get_file_data().
- foreach ( $headers as $field => $regex ) {
- if ( preg_match( '/^(?:[ \t]*<\?php)?[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file, $match ) && $match[1] ) {
- $headers[ $field ] = _cleanup_header_comment( $match[1] );
- } else {
- $headers[ $field ] = '';
- }
- }
- }
-
- if ( ! isset( $headers['title'], $headers['slug'], $headers['categories'] ) ) {
- return;
- }
-
- $categories = explode( ',', $headers['categories'] );
-
- $pattern = [
- 'title' => $headers['title'],
- 'content' => str_replace(
- str_between( '', $content ),
- '',
- $content
- ),
- 'categories' => [ ...$categories ],
- 'description' => $headers['description'] ?? '',
- 'viewportWidth' => $headers['viewport_width'] ?? null,
- 'blockTypes' => $headers['block_types'] ?? [],
- ];
-
- foreach ( $categories as $category ) {
- register_block_pattern_category(
- $category,
- [
- 'label' => ucwords( $category ),
- ]
- );
- }
-
- // @phpstan-ignore-next-line.
- register_block_pattern( $headers['slug'], $pattern );
-}
diff --git a/includes/utility/array.php b/includes/utility/array.php
new file mode 100644
index 0000000..a66f17b
--- /dev/null
+++ b/includes/utility/array.php
@@ -0,0 +1,25 @@
+ [
+ 950 => 0,
+ 900 => 50,
+ 800 => 100,
+ 700 => 200,
+ 600 => 300,
+ 500 => 400,
+ 400 => 500,
+ 300 => 600,
+ 200 => 700,
+ 100 => 800,
+ 50 => 900,
+ 0 => 950,
+ ],
+ 'primary' => [
+ 950 => 25,
+ 900 => 100,
+ 700 => 300,
+ 600 => 500,
+ 500 => 600,
+ 300 => 700,
+ 100 => 900,
+ ],
+ 'accent' => [
+ 900 => 100,
+ 700 => 300,
+ 600 => 500,
+ 500 => 600,
+ 300 => 700,
+ 100 => 900,
+ ],
+ 'success' => [
+ 600 => 100,
+ 500 => 500,
+ 100 => 600,
+ ],
+ 'warning' => [
+ 600 => 100,
+ 500 => 500,
+ 100 => 600,
+ ],
+ 'error' => [
+ 600 => 100,
+ 500 => 500,
+ 100 => 600,
+ ],
+ ];
+
+ return $color ? ( $map[ $color ] ?? [] ) : $map;
+}
+
+/**
+ * Reverses color shade.
+ *
+ * @since 1.3.2
+ *
+ * @param string $slug Color slug.
+ *
+ * @return string
+ */
+function get_reverse_color_shade( string $slug ): string {
+ $explode = explode( '-', $slug );
+ $color = $explode[0] ?? '';
+ $shade = $explode[1] ?? '';
+ $scale = get_shade_scales( $color );
+ $reverse = $scale[ (int) $shade ] ?? '';
+
+ return $reverse ? "{$color}-{$reverse}" : '';
+}
+
+/**
+ * Gets color values from a color palette.
+ *
+ * @since 1.3.0
+ *
+ * @param array $colors Color palette.
+ * @param string $type Color or gradient. Default is color.
+ *
+ * @return array
+ */
+function get_color_values( array $colors, string $type = 'color' ): array {
+ $color_values = [];
+
+ foreach ( $colors as $color ) {
+ $color = (array) $color;
+
+ if ( ! isset( $color['slug'], $color[ $type ] ) ) {
+ continue;
+ }
+
+ $color_values[ $color['slug'] ] = $color[ $type ];
+ }
+
+ return $color_values;
+}
+
+/**
+ * Returns replacements for deprecated colors.
+ *
+ * @since 1.3.0
+ *
+ * @param array $settings Global settings.
+ *
+ * @return array
+ */
+function get_replacement_colors( array $settings = [] ): array {
+ return array_replace(
+ [
+ 'primary-darker' => 'primary-900',
+ 'primary-dark' => 'primary-700',
+ 'primary' => 'primary-500',
+ 'primary-light' => 'primary-300',
+ 'primary-lighter' => 'primary-100',
+ 'secondary-darker' => 'primary-900',
+ 'secondary-dark' => 'primary-700',
+ 'secondary' => 'primary-600',
+ 'secondary-light' => 'primary-300',
+ 'secondary-lighter' => 'primary-100',
+ 'contrast' => 'neutral-950',
+ 'foreground' => 'neutral-900',
+ 'heading' => 'neutral-800',
+ 'body' => 'neutral-600',
+ 'neutral' => 'neutral-500',
+ 'outline' => 'neutral-200',
+ 'surface' => 'neutral-100',
+ 'lighten' => 'neutral-50',
+ 'background' => 'neutral-0',
+ 'base' => 'neutral-0',
+ 'success' => 'success-500',
+ 'warning' => 'warning-500',
+ 'error' => 'error-500',
+ ],
+ $settings['custom']['deprecatedColors'] ?? []
+ );
+}
+
+/**
+ * Returns key value pairs of deprecated colors with replacements.
+ *
+ * @since 1.3.0
+ *
+ * @return array
+ */
+function get_deprecated_colors(): array {
+ $child_theme_file = get_stylesheet_directory() . '/theme.json';
+ $parent_theme_file = get_template_directory() . '/theme.json';
+ $child_theme_json = file_exists( $child_theme_file ) ? wp_json_file_decode( $child_theme_file ) : new stdClass();
+ $parent_theme_json = file_exists( $parent_theme_file ) ? wp_json_file_decode( $parent_theme_file ) : new stdClass();
+ $parent_colors = get_color_values( $parent_theme_json->settings->color->palette ?? [] );
+ $child_colors = get_color_values( $child_theme_json->settings->color->palette ?? [] );
+ $settings = wp_get_global_settings();
+ $replacements = get_replacement_colors( $settings );
+ $user_colors = get_color_values( $settings['color']['palette']['theme'] ?? [] );
+ $default_colors = array_replace( $parent_colors, $child_colors, $user_colors );
+
+ $has_deprecated = $settings['custom']['deprecatedColors'] ?? false;
+ $new_colors = [];
+ $old_colors = [];
+
+ foreach ( $replacements as $old => $new ) {
+ $old = _wp_to_kebab_case( $old );
+
+ if ( isset( $user_colors[ $old ] ) ) {
+ $has_deprecated = true;
+ }
+
+ if ( ! isset( $user_colors[ $new ] ) ) {
+ $value = $user_colors[ $old ] ?? $default_colors[ $new ] ?? '';
+
+ if ( $value ) {
+ $new_colors[ $new ] = $value;
+ }
+
+ if ( isset( $user_colors[ $old ] ) ) {
+ continue;
+ }
+ }
+
+ $old = _wp_to_kebab_case( $old );
+
+ if ( ! str_contains_any( $new, 'var', '#', 'rgb', 'hsl' ) ) {
+ $new = "var(--wp--preset--color--$new)";
+ }
+
+ if ( $new ) {
+ $old_colors[ $old ] = $new;
+ }
+ }
+
+ return $has_deprecated ? array_replace( $new_colors, $old_colors ) : [];
+}
diff --git a/includes/utility/css.php b/includes/utility/css.php
index 1bcb394..0568468 100644
--- a/includes/utility/css.php
+++ b/includes/utility/css.php
@@ -5,10 +5,18 @@
namespace Blockify\Theme;
use function array_key_last;
+use function array_merge;
+use function count;
use function explode;
+use function file_exists;
+use function get_template_directory;
+use function is_array;
use function is_null;
+use function is_string;
+use function rtrim;
use function str_contains;
use function str_replace;
+use function wp_json_file_decode;
/**
* Converts array of CSS rules to string.
@@ -24,15 +32,16 @@ function css_array_to_string( array $styles, bool $trim = false ): string {
$css = '';
foreach ( $styles as $property => $value ) {
- if ( is_null( $value ) ) {
+ if ( is_null( $value ) || is_array( $value ) ) {
continue;
}
+ $value = format_custom_property( (string) $value );
$semicolon = $trim && $property === array_key_last( $styles ) ? '' : ';';
- $css .= $property . ':' . $value . $semicolon;
+ $css .= $property . ':' . $value . $semicolon;
}
- return $css;
+ return rtrim( $css, ';' );
}
/**
@@ -60,7 +69,12 @@ function css_string_to_array( string $css ): array {
$value = $parts[1];
if ( $value !== '' && $value !== 'null' ) {
- $array[ $property ] = str_replace( 'xml$', 'xml;', $value );
+ $value = str_replace( 'xml$', 'xml;', $value );
+ $value = format_custom_property( (string) $value );
+
+ if ( $value ) {
+ $array[ $property ] = $value;
+ }
}
}
}
@@ -79,6 +93,32 @@ function css_string_to_array( string $css ): array {
*/
function format_custom_property( string $custom_property ): string {
if ( ! str_contains( $custom_property, 'var:' ) ) {
+ $global_settings = function_exists( 'wp_get_global_settings' ) ? wp_get_global_settings() : [];
+ $theme_json_file = get_template_directory() . '/theme.json';
+ $theme_json = [];
+
+ if ( file_exists( $theme_json_file ) ) {
+ $theme_json = wp_json_file_decode( $theme_json_file );
+ }
+
+ if ( ! isset( $global_settings['color']['palette']['theme'] ) && ! isset( $theme_json->settings->color->palette ) ) {
+ return $custom_property;
+ }
+
+ $colors = array_merge(
+ (array) ( $global_settings['color']['palette']['theme'] ?? [] ),
+ (array) $theme_json->settings->color->palette
+ );
+
+ $color_slugs = array_diff(
+ wp_list_pluck( $colors, 'slug' ),
+ get_system_colors()
+ );
+
+ if ( in_array( $custom_property, $color_slugs, true ) ) {
+ return "var(--wp--preset--color--{$custom_property})";
+ }
+
return $custom_property;
}
@@ -96,157 +136,65 @@ function format_custom_property( string $custom_property ): string {
}
/**
- * Returns responsive settings config.
+ * Adds shorthand CSS properties.
*
- * @since 0.9.10
+ * @param array $styles Existing CSS array.
+ * @param string $property CSS property to add. E.g. 'margin'.
+ * @param array|string $values CSS values to add.
*
* @return array
*/
-function get_block_extra_options(): array {
- return [
- 'position' => [
- 'value' => 'position',
- 'label' => __( 'Position', 'blockify' ),
- 'options' => [
- [
- 'label' => '',
- 'value' => '',
- ],
- [
- 'label' => __( 'Relative', 'blockify' ),
- 'value' => 'relative',
- ],
- [
- 'label' => __( 'Absolute', 'blockify' ),
- 'value' => 'absolute',
- ],
- [
- 'label' => __( 'Sticky', 'blockify' ),
- 'value' => 'sticky',
- ],
- [
- 'label' => __( 'Fixed', 'blockify' ),
- 'value' => 'fixed',
- ],
- [
- 'label' => __( 'Static', 'blockify' ),
- 'value' => 'static',
- ],
- ],
- ],
- 'top' => [
- 'value' => 'top',
- 'label' => __( 'Top', 'blockify' ),
- ],
- 'right' => [
- 'value' => 'right',
- 'label' => __( 'Right', 'blockify' ),
- ],
- 'bottom' => [
- 'value' => 'bottom',
- 'label' => __( 'Bottom', 'blockify' ),
- ],
- 'left' => [
- 'value' => 'left',
- 'label' => __( 'Left', 'blockify' ),
- ],
- 'zIndex' => [
- 'value' => 'z-index',
- 'label' => __( 'Z-Index', 'blockify' ),
- ],
- 'display' => [
- 'value' => 'display',
- 'label' => __( 'Display', 'blockify' ),
- 'options' => [
- [
- 'label' => '',
- 'value' => '',
- ],
- [
- 'label' => __( 'None', 'blockify' ),
- 'value' => 'none',
- ],
- [
- 'label' => __( 'Flex', 'blockify' ),
- 'value' => 'flex',
- ],
- [
- 'label' => __( 'Inline Flex', 'blockify' ),
- 'value' => 'inline-flex',
- ],
- [
- 'label' => __( 'Block', 'blockify' ),
- 'value' => 'block',
- ],
- [
- 'label' => __( 'Inline Block', 'blockify' ),
- 'value' => 'inline-block',
- ],
- [
- 'label' => __( 'Inline', 'blockify' ),
- 'value' => 'inline',
- ],
- [
- 'label' => __( 'Grid', 'blockify' ),
- 'value' => 'grid',
- ],
- [
- 'label' => __( 'Inline Grid', 'blockify' ),
- 'value' => 'inline-grid',
- ],
- [
- 'label' => __( 'Contents', 'blockify' ),
- 'value' => 'contents',
- ],
- ],
- ],
- 'order' => [
- 'value' => 'order',
- 'label' => __( 'Order', 'blockify' ),
- ],
- 'overflow' => [
- 'value' => 'overflow',
- 'label' => __( 'Overflow', 'blockify' ),
- 'options' => [
- [
- 'label' => '',
- 'value' => '',
- ],
- [
- 'label' => __( 'Hidden', 'blockify' ),
- 'value' => 'hidden',
- ],
- [
- 'label' => __( 'Visible', 'blockify' ),
- 'value' => 'visible',
- ],
- ],
- ],
- 'pointerEvents' => [
- 'value' => 'pointer-events',
- 'label' => __( 'Pointer Events', 'blockify' ),
- 'options' => [
- [
- 'label' => '',
- 'value' => '',
- ],
- [
- 'label' => __( 'None', 'blockify' ),
- 'value' => 'none',
- ],
- [
- 'label' => __( 'All', 'blockify' ),
- 'value' => 'all',
- ],
- ],
- ],
- 'width' => [
- 'value' => 'width',
- 'label' => __( 'Width', 'blockify' ),
- ],
- 'maxWidth' => [
- 'value' => 'max-width',
- 'label' => __( 'Max Width', 'blockify' ),
- ],
- ];
+function add_shorthand_property( array $styles, string $property, $values ): array {
+ if ( empty( $values ) || isset( $styles[ $property ] ) ) {
+ return $styles;
+ }
+
+ if ( is_string( $values ) ) {
+ $styles[ $property ] = format_custom_property( $values );
+
+ return $styles;
+ }
+
+ $sides = [ 'top', 'right', 'bottom', 'left' ];
+
+ if ( count( $values ) === 1 ) {
+ foreach ( $values as $side => $value ) {
+ if ( ! in_array( $side, $sides, true ) ) {
+ continue;
+ }
+
+ $styles[ $property . '-' . $side ] = format_custom_property( $value );
+ }
+
+ return $styles;
+ }
+
+ $has_top = isset( $values['top'] );
+ $has_right = isset( $values['right'] );
+ $has_bottom = isset( $values['bottom'] );
+ $has_left = isset( $values['left'] );
+
+ if ( ! $has_top && ! $has_right && ! $has_bottom && ! $has_left ) {
+ return $styles;
+ }
+
+ $top = format_custom_property( $values['top'] ?? '0' );
+ $right = format_custom_property( $values['right'] ?? '0' );
+ $bottom = format_custom_property( $values['bottom'] ?? '0' );
+ $left = format_custom_property( $values['left'] ?? '0' );
+
+ unset( $styles[ $property . '-top' ] );
+ unset( $styles[ $property . '-right' ] );
+ unset( $styles[ $property . '-bottom' ] );
+ unset( $styles[ $property . '-left' ] );
+
+ if ( $top === $right && $right === $bottom && $bottom === $left ) {
+ $styles[ $property ] = format_custom_property( $top );
+ } else if ( $top === $bottom && $left === $right ) {
+ $styles[ $property ] = "$top $right";
+ } else {
+ $styles[ $property ] = "$top $right $bottom $left";
+ }
+
+ return $styles;
}
diff --git a/includes/utility/dom.php b/includes/utility/dom.php
index 9d46660..6652b61 100644
--- a/includes/utility/dom.php
+++ b/includes/utility/dom.php
@@ -6,10 +6,14 @@
use DOMDocument;
use DOMElement;
+use DOMXPath;
+use Exception;
+use WP_Error;
use function bin2hex;
use function current;
use function iconv;
use function is_a;
+use function is_null;
use function libxml_clear_errors;
use function libxml_use_internal_errors;
use function ltrim;
@@ -24,7 +28,7 @@
*
* @param string $html HTML string to convert to DOM.
*
- * @return \DOMDocument
+ * @return DOMDocument
*/
function dom( string $html ): DOMDocument {
$dom = new DOMDocument();
@@ -34,16 +38,20 @@ function dom( string $html ): DOMDocument {
}
$libxml_previous_state = libxml_use_internal_errors( true );
- $dom->preserveWhiteSpace = true;
+ $dom->preserveWhiteSpace = false;
if ( defined( 'LIBXML_HTML_NOIMPLIED' ) && defined( 'LIBXML_HTML_NODEFDTD' ) ) {
$options = LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD;
- } elseif ( defined( 'LIBXML_HTML_NOIMPLIED' ) ) {
- $options = LIBXML_HTML_NOIMPLIED;
- } elseif ( defined( 'LIBXML_HTML_NODEFDTD' ) ) {
- $options = LIBXML_HTML_NODEFDTD;
} else {
- $options = 0;
+ if ( defined( 'LIBXML_HTML_NOIMPLIED' ) ) {
+ $options = LIBXML_HTML_NOIMPLIED;
+ } else {
+ if ( defined( 'LIBXML_HTML_NODEFDTD' ) ) {
+ $options = LIBXML_HTML_NODEFDTD;
+ } else {
+ $options = 0;
+ }
+ }
}
// @see https://stackoverflow.com/questions/13280200/convert-unicode-to-html-entities-hex.
@@ -85,9 +93,9 @@ function dom( string $html ): DOMDocument {
* @param mixed $dom_or_element DOMDocument or DOMElement.
* @param int $index Index of element to return.
*
- * @return \DOMElement|null
+ * @return ?DOMElement
*/
-function get_dom_element( string $tag, $dom_or_element, int $index = 0 ) {
+function get_dom_element( string $tag, $dom_or_element, int $index = 0 ): ?DOMElement {
if ( ! is_a( $dom_or_element, DOMDocument::class ) && ! is_a( $dom_or_element, DOMElement::class ) ) {
return null;
}
@@ -108,11 +116,11 @@ function get_dom_element( string $tag, $dom_or_element, int $index = 0 ) {
*
* @param mixed $node DOMNode to cast to DOMElement.
*
- * @return \DOMElement|null
+ * @return ?DOMElement
*/
-function dom_element( $node ) {
- if ( $node->nodeType === XML_ELEMENT_NODE ) {
- /* @var \DOMElement $node DOM Element node */
+function dom_element( $node ): ?DOMElement {
+ if ( $node && $node->nodeType === XML_ELEMENT_NODE ) {
+ /* @var DOMElement $node DOM Element node */
return $node;
}
@@ -124,14 +132,14 @@ function dom_element( $node ) {
*
* @since 0.0.20
*
- * @param DOMElement $element DOM Element to change.
* @param string $name Tag name, e.g: 'div'.
+ * @param DOMElement $element DOM Element to change.
*
- * @return DOMElement
+ * @return ?DOMElement
*/
-function change_tag_name( DOMElement $element, string $name ): DOMElement {
+function change_tag_name( string $name, DOMElement $element ): ?DOMElement {
if ( ! $element->ownerDocument ) {
- return new DOMElement( $name );
+ return null;
}
$child_nodes = [];
@@ -162,28 +170,55 @@ function change_tag_name( DOMElement $element, string $name ): DOMElement {
}
/**
- * Returns array of dom elements by class name.
+ * Returns an array of DOM elements by class name.
*
* @since 0.9.26
*
- * @param DOMDocument|DOMElement $dom DOM document or element.
- * @param string $class_name Element class name.
- * @param string $tag Element tag name (optional).
+ * @param DOMDocument $dom DOM document or element.
+ * @param string $class_name Element class name.
+ * @param string $tag Element tag name (optional).
*
* @return array
*/
-function get_elements_by_class_name( $dom, string $class_name, string $tag = '*' ): array {
+function get_elements_by_class_name( string $class_name, DOMDocument $dom, string $tag = '*' ): array {
+ $xpath = new DOMXPath( $dom );
+ $query = sprintf( "//%s[contains(concat(' ', normalize-space(@class), ' '), ' %s ')]", $tag, $class_name );
+ $nodes = $xpath->query( $query );
$elements = [];
- foreach ( $dom->getElementsByTagName( $tag ) as $element ) {
- if ( $element->hasAttribute( 'class' ) ) {
- $classes = explode( ' ', $element->getAttribute( 'class' ) );
-
- if ( in_array( $class_name, $classes, true ) ) {
- $elements[] = $element;
+ if ( $nodes !== false ) {
+ foreach ( $nodes as $node ) {
+ if ( $node instanceof DOMElement ) {
+ $elements[] = $node;
}
}
}
return $elements;
}
+
+/**
+ * Creates a DOMElement to avoid unhandled exceptions.
+ *
+ * @since 1.3.0
+ *
+ * @param string $tag HTML tag.
+ * @param DOMDocument $dom DOM object.
+ *
+ * @return ?DOMElement
+ */
+function create_element( string $tag, DOMDocument $dom ): ?DOMElement {
+ $element = null;
+
+ try {
+ $element = $dom->createElement( $tag );
+ } catch ( Exception $e ) {
+ new WP_Error( 'invalid_dom_tag', $e->getMessage() );
+ }
+
+ if ( is_null( $element ) ) {
+ return null;
+ }
+
+ return dom_element( $element );
+}
diff --git a/includes/utility/helper.php b/includes/utility/helper.php
deleted file mode 100644
index 58f539a..0000000
--- a/includes/utility/helper.php
+++ /dev/null
@@ -1,106 +0,0 @@
- 'path' ]
*/
function get_icon_sets(): array {
- $options = get_option( 'blockify' )['iconSets'] ?? [
+ $theme = [
[
'label' => 'WordPress',
'value' => 'wordpress',
@@ -42,6 +42,18 @@ function get_icon_sets(): array {
],
];
+ $child_theme = glob( get_stylesheet_directory() . '/assets/svg/*', GLOB_ONLYDIR );
+
+ foreach ( $child_theme as $dir ) {
+ $slug = basename( $dir );
+
+ $theme[] = [
+ 'label' => to_title_case( $slug ),
+ 'value' => $slug,
+ ];
+ }
+
+ $options = get_option( 'blockify' )['iconSets'] ?? $theme;
$icon_sets = [];
foreach ( $options as $option ) {
@@ -49,8 +61,15 @@ function get_icon_sets(): array {
continue;
}
- if ( in_array( $option['value'], [ 'wordpress', 'social' ], true ) ) {
- $icon_sets[ $option['value'] ] = get_dir() . 'assets/svg/' . $option['value'];
+ $parent = get_dir() . 'assets/svg/' . $option['value'];
+ $child = get_stylesheet_directory() . '/assets/svg/' . $option['value'];
+
+ if ( file_exists( $parent ) ) {
+ $icon_sets[ $option['value'] ] = $parent;
+ }
+
+ if ( file_exists( $child ) ) {
+ $icon_sets[ $option['value'] ] = $child;
}
}
@@ -60,10 +79,10 @@ function get_icon_sets(): array {
/**
* Returns icon data for rest endpoint
*
- * @param WP_REST_Request $request Request object.
- *
* @since 0.4.8
*
+ * @param WP_REST_Request $request Request object.
+ *
* @return mixed array|string
*/
function get_icon_data( WP_REST_Request $request ) {
@@ -88,6 +107,15 @@ function get_icon_data( WP_REST_Request $request ) {
// Remove comments.
$icon = preg_replace( '//', '', $icon );
+ // Remove new lines.
+ $icon = preg_replace( '/\s+/', ' ', $icon );
+
+ // Remove tabs.
+ $icon = preg_replace( '/\t+/', '', $icon );
+
+ // Remove spaces between tags.
+ $icon = preg_replace( '/>\s+', '><', $icon );
+
$icon_data[ $icon_set ][ $name ] = trim( $icon );
}
}
@@ -116,37 +144,74 @@ function get_icon_data( WP_REST_Request $request ) {
*
* @since 0.9.10
*
+ * @param string $set Icon set.
+ *
* @return array
*/
-function get_icons(): array {
- $icons = [];
- $icon_sets = get_icon_sets();
+function get_icons( string $set = '' ): array {
+ static $icons = null;
+
+ if ( is_null( $icons ) ) {
+ $icon_sets = get_icon_sets();
+
+ foreach ( $icon_sets as $icon_set => $dir ) {
+ if ( ! is_string( $dir ) ) {
+ continue;
+ }
+
+ $icons[ $icon_set ] = [];
- foreach ( $icon_sets as $icon_set => $dir ) {
- $icons[ $icon_set ] = [];
+ $files = glob( $dir . '/*.svg' );
- foreach ( glob( $dir . '/*.svg' ) as $file ) {
- $icons[ $icon_set ][ basename( $file, '.svg' ) ] = trim( file_get_contents( $file ) );
+ if ( ! is_array( $files ) ) {
+ continue;
+ }
+
+ foreach ( $files as $file ) {
+ $icons[ $icon_set ][ basename( $file, '.svg' ) ] = trim( file_get_contents( $file ) );
+ }
}
}
- return $icons;
+ return $set ? ( $icons[ $set ] ?? [] ) : $icons;
}
/**
* Returns svg string for given icon.
*
- * @param string $set Icon set.
- * @param string $name Icon name.
- * @param int|null $size Icon size.
- *
- * @throws DOMException If DOM can't create element.
* @since 0.9.10
*
+ * @param string $set Icon set.
+ * @param string $name Icon name.
+ * @param string|int|null $size Icon size.
+ *
* @return string
*/
-function get_icon( string $set, string $name, int $size = null ): string {
- $icon = get_icons()[ $set ][ $name ] ?? '';
+function get_icon( string $set, string $name, $size = null ): string {
+ $set = strtolower( $set );
+
+ static $cache = [];
+
+ $cache_key = implode( '-', [ $set, $name, $size ] );
+
+ if ( isset( $cache[ $cache_key ] ) ) {
+ return $cache[ $cache_key ];
+ }
+
+ $icon_sets = get_icon_sets();
+
+ if ( ! isset( $icon_sets[ $set ] ) ) {
+ return '';
+ }
+
+ $dir = $icon_sets[ $set ];
+ $file = $dir . '/' . $name . '.svg';
+
+ if ( ! file_exists( $file ) ) {
+ return '';
+ }
+
+ $icon = file_get_contents( $file );
$dom = dom( $icon );
$svg = get_dom_element( 'svg', $dom );
@@ -160,8 +225,8 @@ function get_icon( string $set, string $name, int $size = null ): string {
$svg->setAttribute( 'aria-labelledby', $unique_id );
$svg->setAttribute( 'data-icon', $set . '-' . $name );
- $label = ucwords( str_replace( '-', ' ', $name ) ) . __( ' Icon', 'blockify' );
- $title = $dom->createElement( 'title' );
+ $label = to_title_case( $name ) . __( ' Icon', 'blockify' );
+ $title = create_element( 'title', $dom );
$title->appendChild( $dom->createTextNode( $label ) );
$title->setAttribute( 'id', $unique_id );
@@ -169,117 +234,28 @@ function get_icon( string $set, string $name, int $size = null ): string {
$svg->insertBefore( $title, $svg->firstChild );
if ( $size ) {
- $svg->setAttribute( 'width', (string) $size );
- $svg->setAttribute( 'height', (string) $size );
- }
+ $has_unit = str_contains_any( (string) $size, 'px', 'em', 'rem', '%', 'vh', 'vw' );
- return $dom->saveHTML();
-}
+ if ( $has_unit ) {
+ $styles = css_string_to_array( $svg->getAttribute( 'style' ) );
-/**
- * Renders image icon styles on front end.
- *
- * @param string $content Block HTML.
- * @param array $block Block data.
- *
- * @since 0.2.0
- *
- * @return string
- */
-function get_icon_html( string $content, array $block ): string {
- $content = ! $content ? ' ' : $content;
- $dom = dom( $content );
- $figure = get_dom_element( 'figure', $dom );
- $img = get_dom_element( 'img', $figure );
-
- if ( ! $figure || ! $img ) {
- return $content;
- }
-
- $link = get_dom_element( 'a', $figure );
- $span = change_tag_name( $img, 'span' );
- $icon_name = $block['attrs']['iconName'] ?? 'star-empty';
-
- $span_classes = [
- 'wp-block-image__icon',
- ];
-
- $figure_classes = explode( ' ', $figure->getAttribute( 'class' ) );
+ $styles['min-width'] = $size;
+ $styles['height'] = $size;
- $block_extras = get_block_extra_options();
- $block_extra_classes = [];
-
- foreach ( $block_extras as $name => $args ) {
- $block_extra_classes[] = 'has-' . $args['value'];
-
- if ( ! isset( $args['options'] ) ) {
- continue;
- }
-
- foreach ( $args['options'] as $option ) {
- $block_extra_classes[] = 'has-' . $args['value'] . '-' . $option['value'];
+ $svg->setAttribute( 'style', css_array_to_string( $styles ) );
+ } else {
+ $svg->setAttribute( 'width', (string) $size );
+ $svg->setAttribute( 'height', (string) $size );
}
}
- foreach ( $figure_classes as $index => $class ) {
- if ( ! str_contains( $class, 'has-' ) ) {
- continue;
- }
-
- if ( in_array( $class, $block_extra_classes, true ) ) {
- continue;
- }
+ $fill = $svg->getAttribute( 'fill' );
- $span_classes[] = $class;
- unset( $figure_classes[ $index ] );
+ if ( ! $fill ) {
+ $svg->setAttribute( 'fill', 'currentColor' );
}
- $figure->setAttribute( 'class', implode( ' ', $figure_classes ) );
- $span->setAttribute( 'class', implode( ' ', $span_classes ) );
-
- $aria_label = $img->getAttribute( 'alt' ) ? $img->getAttribute( 'alt' ) : str_replace( '-', ' ', $icon_name ) . __( ' icon', 'blockify' );
-
- $span->setAttribute( 'title', $block['attrs']['title'] ?? $aria_label );
-
- if ( ! ( $block['attrs']['title'] ?? null ) || ! $aria_label ) {
- $span->setAttribute( 'role', 'img' );
- }
-
- $span->removeAttribute( 'src' );
- $span->removeAttribute( 'alt' );
-
- $figure_styles = css_string_to_array( $figure->getAttribute( 'style' ) );
- $span_styles = css_string_to_array( $span->getAttribute( 'style' ) );
-
- $block_extra_values = wp_list_pluck(
- array_values( $block_extras ),
- 'value'
- );
-
- $block_extra_custom_props = \array_map( fn( $prop ) => '--' . $prop, $block_extra_values );
-
- foreach ( $figure_styles as $key => $value ) {
-
- if ( in_array( $key, $block_extra_values, true ) ) {
- continue;
- }
-
- if ( in_array( $key, $block_extra_custom_props, true ) ) {
- continue;
- }
-
- $span_styles[ $key ] = $value;
- unset( $figure_styles[ $key ] );
- }
-
- $figure->setAttribute( 'style', css_array_to_string( $figure_styles ) );
- $span->setAttribute( 'style', css_array_to_string( $span_styles ) );
-
- if ( $link ) {
- $link->appendChild( $span );
- } else {
- $figure->appendChild( $span );
- }
+ $cache[ $cache_key ] = trim( $dom->saveHTML() );
- return $dom->saveHTML();
+ return $cache[ $cache_key ];
}
diff --git a/includes/utility/string.php b/includes/utility/string.php
index 200d5b6..7662762 100644
--- a/includes/utility/string.php
+++ b/includes/utility/string.php
@@ -9,7 +9,9 @@
use function str_replace;
use function strlen;
use function strpos;
-use function substr;
+use function trim;
+use function ucwords;
+use const PHP_EOL;
/**
* Check if any of the given needles are in the haystack.
@@ -58,6 +60,7 @@ function remove_line_breaks( string $string ): string {
[
"\r",
"\n",
+ PHP_EOL,
],
'',
trim( $string )
@@ -65,50 +68,87 @@ function remove_line_breaks( string $string ): string {
}
/**
- * Returns part of string between two strings.
+ * Returns parts of a string between two strings using regular expressions.
*
- * @since 0.0.2
+ * @since 0.1.2
*
* @param string $start Start string.
* @param string $end End string.
* @param string $string String content.
- * @param bool $omit Omit start and end.
+ * @param bool $omit Omit start and end strings.
+ * @param bool $all Return all occurrences.
*
- * @return string
+ * @return string|array
*/
-function str_between( string $start, string $end, string $string, bool $omit = false ): string {
- $string = ' ' . $string;
- $ini = strpos( $string, $start );
+function str_between( string $start, string $end, string $string, bool $omit = false, bool $all = false ) {
+ $pattern = '/' . preg_quote( $start, '/' ) . '(.*?)' . preg_quote( $end, '/' ) . '/s';
+ preg_match_all( $pattern, $string, $matches );
- if ( $ini === 0 ) {
- return '';
- }
+ $selected_matches = $omit ? $matches[1] : $matches[0];
+ $first_match = $selected_matches[0] ?? '';
- $ini += strlen( $start );
+ return $all ? $selected_matches : $first_match;
+}
- if ( strlen( $string ) < $ini ) {
- $ini = 0;
+/**
+ * Removes non-alphanumeric characters from string.
+ *
+ * @since 1.0.0
+ *
+ * @param string $string String to sanitize.
+ *
+ * @return string
+ */
+function remove_non_alphanumeric( string $string ): string {
+ return preg_replace( '/[^A-Za-z0-9\-]/', '', $string );
+}
+
+/**
+ * Replace first occurrence of a string.
+ *
+ * @since 1.2.9
+ *
+ * @param string $needle The string to search for.
+ * @param string $replacement The string to replace with.
+ * @param string $haystack The string to search.
+ *
+ * @return string
+ */
+function str_replace_first( string $needle, string $replacement, string $haystack ): string {
+ if ( ! $needle || ! $haystack ) {
+ return $haystack;
}
- $len = strpos( $string, $end, $ini ) - $ini;
- $string = $start . substr( $string, $ini, $len ) . $end;
+ $position = strpos( $haystack, $needle );
- if ( $omit ) {
- $string = str_replace( [ $start, $end ], '', $string );
+ if ( $position !== false ) {
+ $haystack = substr_replace( $haystack, $replacement, $position, strlen( $needle ) );
}
- return $string;
+ return $haystack;
}
/**
- * Removes non-alphanumeric characters from string.
+ * Converts a string to title case.
*
- * @since 1.0.0
+ * @param string $string The string to convert.
+ * @param string[] $search Characters to replace (optional).
*
- * @param string $string String to sanitize.
+ * @return string
+ */
+function to_title_case( string $string, array $search = [ '-', '_' ] ): string {
+ return trim( ucwords( str_replace( $search, ' ', $string ) ) );
+}
+
+/**
+ * Converts a camelCase string to kebab case.
+ *
+ * @param string $string camelCase string to convert.
*
* @return string
*/
-function remove_non_alphanumeric( string $string ): string {
- return preg_replace( '/[^A-Za-z0-9\-]/', '', $string );
+function camel_to_kebab( string $string ): string {
+ $strings = preg_split( '/(?=[A-Z])/', $string );
+
+ return strtolower( implode( '-', $strings ) );
}
diff --git a/includes/utility/theme.php b/includes/utility/theme.php
new file mode 100644
index 0000000..eb6804a
--- /dev/null
+++ b/includes/utility/theme.php
@@ -0,0 +1,192 @@
+ 'property_value,
+ * )
+ *
+ * This is slightly different from the implementation in
+ * wp-includes/class-wp-theme-json.php which is:
+ *
+ * array(
+ * 'name' => 'property_name',
+ * 'value' => 'property_value,
+ * )
+ *
+ * @since 5.8.0
+ *
+ * @param array $custom_values Settings to process.
+ *
+ * @see WP_Theme_JSON::compute_theme_vars()
+ *
+ * @return array The modified $declarations.
+ */
+function compute_theme_vars( array $custom_values ): array {
+ $declarations = [];
+ $css_vars = flatten_tree( $custom_values );
+
+ foreach ( $css_vars as $key => $value ) {
+ $declarations[ '--wp--custom--' . $key ] = $value;
+ }
+
+ return $declarations;
+}
+
+/**
+ * Given a tree, it creates a flattened one
+ * by merging the keys and binding the leaf values
+ * to the new keys.
+ *
+ * It also transforms camelCase names into kebab-case
+ * and substitutes '/' by '-'.
+ *
+ * This is thought to be useful to generate
+ * CSS Custom Properties from a tree,
+ * although there's nothing in the implementation
+ * of this function that requires that format.
+ *
+ * For example, assuming the given prefix is '--wp'
+ * and the token is '--', for this input tree:
+ *
+ * {
+ * 'some/property': 'value',
+ * 'nestedProperty': {
+ * 'sub-property': 'value'
+ * }
+ * }
+ *
+ * it'll return this output:
+ *
+ * {
+ * '--wp--some-property': 'value',
+ * '--wp--nested-property--sub-property': 'value'
+ * }
+ *
+ * @since 5.8.0
+ *
+ * @param array $tree Input tree to process.
+ * @param string $prefix Optional. Prefix to prepend to each variable. Default
+ * empty string.
+ * @param string $token Optional. Token to use between levels. Default '--'.
+ *
+ * @see WP_Theme_JSON::flatten_tree()
+ *
+ * @return array The flattened tree.
+ */
+function flatten_tree( array $tree, string $prefix = '', string $token = '--' ): array {
+ $result = [];
+
+ foreach ( $tree as $property => $value ) {
+ $new_key = $prefix . str_replace(
+ '/',
+ '-',
+ strtolower( _wp_to_kebab_case( $property ) )
+ );
+
+ if ( is_array( $value ) ) {
+ $new_prefix = $new_key . $token;
+ $flattened_subtree = flatten_tree( $value, $new_prefix, $token );
+
+ foreach ( $flattened_subtree as $subtree_key => $subtree_value ) {
+ $result[ $subtree_key ] = $subtree_value;
+ }
+
+ } else {
+ $result[ $new_key ] = $value;
+ }
+ }
+
+ return $result;
+}
diff --git a/languages/blockify.pot b/languages/blockify.pot
index 9887f2b..34937e6 100644
--- a/languages/blockify.pot
+++ b/languages/blockify.pot
@@ -2,16 +2,16 @@
# This file is distributed under the GPL-2.0-or-later.
msgid ""
msgstr ""
-"Project-Id-Version: Blockify 1.2.7\n"
+"Project-Id-Version: Blockify 1.3.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/blockify\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"POT-Creation-Date: 2023-04-22T05:15:41+00:00\n"
+"POT-Creation-Date: 2023-11-08T15:40:57+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"X-Generator: WP-CLI 2.6.0\n"
+"X-Generator: WP-CLI 2.8.1\n"
"X-Domain: blockify\n"
#. Theme Name of the theme
@@ -31,390 +31,1548 @@ msgstr ""
msgid "https://blockifywp.com/"
msgstr ""
-#: includes/blocks/heading.php:76
+#: includes/api/block-extensions.php:26
+#: assets/js/editor.js:1
+msgid "Position"
+msgstr ""
+
+#: includes/api/block-extensions.php:33
+msgid "Relative"
+msgstr ""
+
+#: includes/api/block-extensions.php:37
+msgid "Absolute"
+msgstr ""
+
+#: includes/api/block-extensions.php:41
+msgid "Sticky"
+msgstr ""
+
+#: includes/api/block-extensions.php:45
+msgid "Fixed"
+msgstr ""
+
+#: includes/api/block-extensions.php:49
+msgid "Static"
+msgstr ""
+
+#: includes/api/block-extensions.php:56
+#: includes/api/block-extensions.php:371
+msgid "Top"
+msgstr ""
+
+#: includes/api/block-extensions.php:60
+#: includes/api/block-extensions.php:375
+msgid "Right"
+msgstr ""
+
+#: includes/api/block-extensions.php:64
+#: includes/api/block-extensions.php:379
+msgid "Bottom"
+msgstr ""
+
+#: includes/api/block-extensions.php:68
+#: includes/api/block-extensions.php:383
+msgid "Left"
+msgstr ""
+
+#: includes/api/block-extensions.php:72
+msgid "Z-Index"
+msgstr ""
+
+#: includes/api/block-extensions.php:76
+#: assets/js/editor.js:1
+msgid "Display"
+msgstr ""
+
+#: includes/api/block-extensions.php:83
+#: includes/api/block-extensions.php:175
+#: includes/api/block-extensions.php:353
+#: includes/api/block-extensions.php:391
+#: assets/js/editor.js:1
+msgid "None"
+msgstr ""
+
+#: includes/api/block-extensions.php:87
+msgid "Flex"
+msgstr ""
+
+#: includes/api/block-extensions.php:91
+msgid "Inline Flex"
+msgstr ""
+
+#: includes/api/block-extensions.php:95
+msgid "Block"
+msgstr ""
+
+#: includes/api/block-extensions.php:99
+msgid "Inline Block"
+msgstr ""
+
+#: includes/api/block-extensions.php:103
+msgid "Inline"
+msgstr ""
+
+#: includes/api/block-extensions.php:107
+#: assets/js/editor.js:1
+msgid "Grid"
+msgstr ""
+
+#: includes/api/block-extensions.php:111
+msgid "Inline Grid"
+msgstr ""
+
+#: includes/api/block-extensions.php:115
+#: includes/blocks/table-of-contents.php:38
+msgid "Contents"
+msgstr ""
+
+#: includes/api/block-extensions.php:122
+#: assets/js/editor.js:1
+msgid "Order"
+msgstr ""
+
+#: includes/api/block-extensions.php:126
+#: assets/js/editor.js:1
+msgid "Columns"
+msgstr ""
+
+#: includes/api/block-extensions.php:130
+#: assets/js/editor.js:1
+msgid "Rows"
+msgstr ""
+
+#: includes/api/block-extensions.php:134
+#: assets/js/editor.js:1
+msgid "Column Start"
+msgstr ""
+
+#: includes/api/block-extensions.php:138
+#: assets/js/editor.js:1
+msgid "Column End"
+msgstr ""
+
+#: includes/api/block-extensions.php:142
+#: assets/js/editor.js:1
+msgid "Row Start"
+msgstr ""
+
+#: includes/api/block-extensions.php:146
+#: assets/js/editor.js:1
+msgid "Row End"
+msgstr ""
+
+#: includes/api/block-extensions.php:150
+#: assets/js/editor.js:1
+msgid "Overflow"
+msgstr ""
+
+#: includes/api/block-extensions.php:157
+msgid "Hidden"
+msgstr ""
+
+#: includes/api/block-extensions.php:161
+msgid "Visible"
+msgstr ""
+
+#: includes/api/block-extensions.php:168
+#: assets/js/editor.js:1
+msgid "Pointer Events"
+msgstr ""
+
+#: includes/api/block-extensions.php:179
+#: includes/blocks/post-terms.php:122
+#: assets/js/editor.js:1
+msgid "All"
+msgstr ""
+
+#: includes/api/block-extensions.php:186
+#: assets/js/editor.js:1
+msgid "Width"
+msgstr ""
+
+#: includes/api/block-extensions.php:190
+#: assets/js/editor.js:1
+msgid "Min Width"
+msgstr ""
+
+#: includes/api/block-extensions.php:194
+#: assets/js/editor.js:1
+msgid "Max Width"
+msgstr ""
+
+#: includes/api/block-extensions.php:268
+#: assets/js/editor.js:1
+msgid "Aspect Ratio"
+msgstr ""
+
+#: includes/api/block-extensions.php:330
+#: assets/js/editor.js:1
+msgid "Height"
+msgstr ""
+
+#: includes/api/block-extensions.php:334
+#: assets/js/editor.js:1
+msgid "Object Fit"
+msgstr ""
+
+#: includes/api/block-extensions.php:341
+msgid "Fill"
+msgstr ""
+
+#: includes/api/block-extensions.php:345
+msgid "Contain"
+msgstr ""
+
+#: includes/api/block-extensions.php:349
+msgid "Cover"
+msgstr ""
+
+#: includes/api/block-extensions.php:357
+msgid "Scale Down"
+msgstr ""
+
+#: includes/api/block-extensions.php:364
+#: assets/js/editor.js:1
+msgid "Object Position"
+msgstr ""
+
+#: includes/api/block-extensions.php:387
+msgid "Center"
+msgstr ""
+
+#: includes/blocks/heading.php:82
msgid "Search Results"
msgstr ""
-#: includes/blocks/heading.php:78
-msgid "Search results for: "
+#: includes/blocks/heading.php:84
+msgid "Search results for: "
+msgstr ""
+
+#: includes/blocks/post-excerpt.php:79
+msgid "this post"
+msgstr ""
+
+#: includes/blocks/post-excerpt.php:82
+msgid " about "
+msgstr ""
+
+#: includes/blocks/post-title.php:36
+msgid "Latest Posts"
+msgstr ""
+
+#: includes/blocks/table-of-contents.php:37
+msgid "Table of Contents"
+msgstr ""
+
+#: includes/blocks/table-of-contents.php:39
+msgid "Table of contents"
+msgstr ""
+
+#: includes/extensions/icon.php:124
+msgid " icon"
+msgstr ""
+
+#: includes/extensions/icon.php:236
+msgid "This is a preview of all icons in the set."
+msgstr ""
+
+#: includes/extensions/placeholder.php:222
+msgid "Image placeholder"
+msgstr ""
+
+#: includes/utility/icon.php:190
+msgid " Icon"
+msgstr ""
+
+#: patterns/blog/featured-post.php
+msgctxt "Pattern title"
+msgid "Featured Post"
+msgstr ""
+
+#: patterns/blog/grid-boxed.php
+msgctxt "Pattern title"
+msgid "Grid Boxed"
+msgstr ""
+
+#: patterns/blog/single-column.php
+msgctxt "Pattern title"
+msgid "Single Column"
+msgstr ""
+
+#: patterns/blog/three-column.php
+#: patterns/pricing/three-column.php
+#: patterns/testimonial/three-column.php
+msgctxt "Pattern title"
+msgid "Three Column"
+msgstr ""
+
+#: patterns/contact/form-boxed.php
+msgctxt "Pattern title"
+msgid "Form Boxed"
+msgstr ""
+
+#: patterns/contact/form-map.php
+msgctxt "Pattern title"
+msgid "Form Map"
+msgstr ""
+
+#: patterns/contact/form.php
+msgctxt "Pattern title"
+msgid "Form"
+msgstr ""
+
+#: patterns/contact/icons.php
+#: patterns/feature/icons.php
+msgctxt "Pattern title"
+msgid "Icons"
+msgstr ""
+
+#: patterns/contact/map.php
+msgctxt "Pattern title"
+msgid "Map"
+msgstr ""
+
+#: patterns/contact/two-column.php
+#: patterns/pricing/two-column.php
+#: patterns/testimonial/two-column.php
+msgctxt "Pattern title"
+msgid "Two Column"
+msgstr ""
+
+#: patterns/cta/box.php
+msgctxt "Pattern title"
+msgid "Box"
+msgstr ""
+
+#: patterns/cta/center.php
+msgctxt "Pattern title"
+msgid "Center"
+msgstr ""
+
+#: patterns/cta/horizontal.php
+msgctxt "Pattern title"
+msgid "Horizontal"
+msgstr ""
+
+#: patterns/cta/right.php
+msgctxt "Pattern title"
+msgid "Right"
+msgstr ""
+
+#: patterns/faq/accordion-wide.php
+msgctxt "Pattern title"
+msgid "Accordion Wide"
+msgstr ""
+
+#: patterns/faq/accordion.php
+msgctxt "Pattern title"
+msgid "Accordion"
+msgstr ""
+
+#: patterns/faq/columns.php
+msgctxt "Pattern title"
+msgid "Columns"
+msgstr ""
+
+#: patterns/faq/default.php
+#: patterns/footer/default.php
+#: patterns/header/default.php
+msgctxt "Pattern title"
+msgid "Default"
+msgstr ""
+
+#: patterns/feature/banner.php
+msgctxt "Pattern title"
+msgid "Banner"
+msgstr ""
+
+#: patterns/feature/icon-boxes.php
+msgctxt "Pattern title"
+msgid "Icon Boxes"
+msgstr ""
+
+#: patterns/feature/icons-centered.php
+msgctxt "Pattern title"
+msgid "Icons Centered"
+msgstr ""
+
+#: patterns/feature/images.php
+msgctxt "Pattern title"
+msgid "Images"
+msgstr ""
+
+#: patterns/footer/centered.php
+#: patterns/header/centered.php
+msgctxt "Pattern title"
+msgid "Centered"
+msgstr ""
+
+#: patterns/footer/cta.php
+msgctxt "Pattern title"
+msgid "CTA"
+msgstr ""
+
+#: patterns/footer/minimal.php
+#: patterns/header/minimal.php
+msgctxt "Pattern title"
+msgid "Minimal"
+msgstr ""
+
+#: patterns/gallery/grid-alt.php
+msgctxt "Pattern title"
+msgid "Grid Alt"
+msgstr ""
+
+#: patterns/gallery/grid.php
+msgctxt "Pattern title"
+msgid "Grid"
+msgstr ""
+
+#: patterns/header/center-logo.php
+msgctxt "Pattern title"
+msgid "Center Logo"
+msgstr ""
+
+#: patterns/header/center-menu.php
+msgctxt "Pattern title"
+msgid "Center Menu"
+msgstr ""
+
+#: patterns/header/menu-left.php
+msgctxt "Pattern title"
+msgid "Menu Left"
+msgstr ""
+
+#: patterns/hero/cover.php
+msgctxt "Pattern title"
+msgid "Cover"
+msgstr ""
+
+#: patterns/hero/image-below.php
+msgctxt "Pattern title"
+msgid "Image Below"
+msgstr ""
+
+#: patterns/hero/image.php
+msgctxt "Pattern title"
+msgid "Image"
+msgstr ""
+
+#: patterns/hero/left.php
+msgctxt "Pattern title"
+msgid "Left"
+msgstr ""
+
+#: patterns/page/about.php
+msgctxt "Pattern title"
+msgid "About"
+msgstr ""
+
+#: patterns/page/blog.php
+msgctxt "Pattern title"
+msgid "Blog"
+msgstr ""
+
+#: patterns/page/contact.php
+msgctxt "Pattern title"
+msgid "Contact"
+msgstr ""
+
+#: patterns/page/landing.php
+msgctxt "Pattern title"
+msgid "Landing"
+msgstr ""
+
+#: patterns/page/pricing.php
+msgctxt "Pattern title"
+msgid "Pricing"
+msgstr ""
+
+#: patterns/page/style-guide.php
+msgctxt "Pattern title"
+msgid "Style Guide"
+msgstr ""
+
+#: patterns/pricing/two-rows.php
+msgctxt "Pattern title"
+msgid "Two Rows"
+msgstr ""
+
+#: patterns/stats/four-columns.php
+msgctxt "Pattern title"
+msgid "Four Columns"
+msgstr ""
+
+#: patterns/stats/with-image.php
+msgctxt "Pattern title"
+msgid "With Image"
+msgstr ""
+
+#: patterns/team/members.php
+msgctxt "Pattern title"
+msgid "Members"
+msgstr ""
+
+#: patterns/template/404.php
+msgctxt "Pattern title"
+msgid "404"
+msgstr ""
+
+#: patterns/template/archive.php
+msgctxt "Pattern title"
+msgid "Archive"
+msgstr ""
+
+#: patterns/template/front-page.php
+msgctxt "Pattern title"
+msgid "Front Page"
+msgstr ""
+
+#: patterns/template/full-width.php
+msgctxt "Pattern title"
+msgid "Full Width"
+msgstr ""
+
+#: patterns/template/page.php
+msgctxt "Pattern title"
+msgid "Page"
+msgstr ""
+
+#: patterns/testimonial/brands.php
+msgctxt "Pattern title"
+msgid "Brands"
+msgstr ""
+
+#: patterns/testimonial/logo-cloud.php
+msgctxt "Pattern title"
+msgid "Logo Cloud"
+msgstr ""
+
+#: patterns/testimonial/single.php
+msgctxt "Pattern title"
+msgid "Single"
+msgstr ""
+
+#: patterns/utility/app-store.php
+msgctxt "Pattern title"
+msgid "App Store"
+msgstr ""
+
+#: patterns/utility/browser.php
+msgctxt "Pattern title"
+msgid "Browser"
+msgstr ""
+
+#: patterns/utility/dark-mode-toggle.php
+msgctxt "Pattern title"
+msgid "Dark Mode Toggle"
+msgstr ""
+
+#: patterns/utility/google-play.php
+msgctxt "Pattern title"
+msgid "Google Play"
+msgstr ""
+
+#: patterns/utility/icon-logo.php
+msgctxt "Pattern title"
+msgid "Icon Logo"
+msgstr ""
+
+#: patterns/utility/intro-notice.php
+msgctxt "Pattern title"
+msgid "Intro Notice"
+msgstr ""
+
+#: patterns/utility/search-toggle.php
+msgctxt "Pattern title"
+msgid "Search Toggle"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Please enter "
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid " code here…"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Custom box shadow"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Color"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Color "
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid " Hover"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Inset"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Shadow"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Clear Shadow"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Default"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Hover"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Ease"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Ease In"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Ease Out"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Ease In Out"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Linear"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Enter"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Exit"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Infinite"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Scroll"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Animation"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Clear Animation"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Pause"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Run"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Effect"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Easing"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Event"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Duration"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Delay"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Repeat"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Offset"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Arrange blocks in a grid."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Reset Grid"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Reset Display"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Content"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Default Content"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Hide Read More Link"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Content Limit"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Limit content to specific number of words."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Filter"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Clear Filters"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Hue Rotate"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Use as backdrop filter"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Placeholder Image"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Image"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Reset Image"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Edit Inline CSS"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Add custom CSS to this block."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Edit On-Click Event"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Add custom JavaScript to the onclick event for this block."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Reset Position"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Large"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Medium"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Small"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Size"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Switch Size"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Transform"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Clear Transforms"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Rotate"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Rotate X"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Rotate Y"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Scale"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Scale X"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Scale Y"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Skew"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Skew X"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Skew Y"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Translate X"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Translate Y"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Translate Z"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Accordion"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Add a collapsible accordion list."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Curved text. Curved text. Curved text."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Curved Text"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Insert curved text around circular SVG path."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Container"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Path"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Counter"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Insert counter animation."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Counter Settings"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Start"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "End"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Duration (seconds)"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Delay (seconds)"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Prefix"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Suffix"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Insert an image to make a visual statement."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Icon"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Insert a customizable SVG icon."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Icon Position"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Select Icon Set"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Select Icon"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Icon Width"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid " Get more icons with "
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Icon Settings"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "More icons available with Blockify Pro! "
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Learn more ↗"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "SVG"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Insert an inline SVG."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "SVG String"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Paste your SVG string in the field above. It is recommended to format your SVG with an optimization tool "
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Mask with text color"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "If enabled, the SVG will be masked with the text color. (Renders inline SVG on front end)."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Marquee"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Adds a horizontal infinite scrolling marquee banner."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Scroll Speed (seconds)"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Mobile"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Repeat Items"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "How many times should the items be duplicated and cloned."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Paragraph"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Slack"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Clear"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Clear Formatting"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Gradient"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Typography"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Select Font Family"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Appearance"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Inline SVG"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Paste your SVG string in the field above and then click the button below to insert your image."
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Paste your SVG string here"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Alt Text"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "SVG description"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Width Mobile"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Width Desktop"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Insert SVG"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Underline"
+msgstr ""
+
+#: assets/js/editor.js:1
+msgid "Underline style"
+msgstr ""
+
+#: styles/dark.json
+msgctxt "Style variation name"
+msgid "Dark"
+msgstr ""
+
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 0"
+msgstr ""
+
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 50"
msgstr ""
-#: includes/blocks/post-excerpt.php:42
-msgid "this post"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 100"
msgstr ""
-#: includes/blocks/post-excerpt.php:45
-msgid " about "
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 200"
msgstr ""
-#: includes/blocks/post-title.php:36
-msgid "Latest Posts"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 300"
msgstr ""
-#: includes/blocks/search.php:76
-msgid "Search this website"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 400"
msgstr ""
-#: includes/blocks/table-of-contents.php:40
-msgid "Table of Contents"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 500"
msgstr ""
-#: includes/blocks/table-of-contents.php:41
-#: includes/utility/css.php:198
-msgid "Contents"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 600"
msgstr ""
-#: includes/blocks/table-of-contents.php:42
-msgid "Table of contents"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 700"
msgstr ""
-#: includes/utility/css.php:109
-msgid "Position"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 800"
msgstr ""
-#: includes/utility/css.php:116
-msgid "Relative"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 900"
msgstr ""
-#: includes/utility/css.php:120
-msgid "Absolute"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Neutral 950"
msgstr ""
-#: includes/utility/css.php:124
-msgid "Sticky"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Primary 100"
msgstr ""
-#: includes/utility/css.php:128
-msgid "Fixed"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Primary 300"
msgstr ""
-#: includes/utility/css.php:132
-msgid "Static"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Primary 500"
msgstr ""
-#: includes/utility/css.php:139
-msgid "Top"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Primary 600"
msgstr ""
-#: includes/utility/css.php:143
-msgid "Right"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Primary 700"
msgstr ""
-#: includes/utility/css.php:147
-msgid "Bottom"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Primary 900"
msgstr ""
-#: includes/utility/css.php:151
-msgid "Left"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Success 100"
msgstr ""
-#: includes/utility/css.php:155
-msgid "Z-Index"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Success 500"
msgstr ""
-#: includes/utility/css.php:159
-msgid "Display"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Success 600"
msgstr ""
-#: includes/utility/css.php:166
-#: includes/utility/css.php:234
-msgid "None"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Warning 100"
msgstr ""
-#: includes/utility/css.php:170
-msgid "Flex"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Warning 500"
msgstr ""
-#: includes/utility/css.php:174
-msgid "Inline Flex"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Warning 600"
msgstr ""
-#: includes/utility/css.php:178
-msgid "Block"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Error 100"
msgstr ""
-#: includes/utility/css.php:182
-msgid "Inline Block"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Error 500"
msgstr ""
-#: includes/utility/css.php:186
-msgid "Inline"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Error 600"
msgstr ""
-#: includes/utility/css.php:190
-msgid "Grid"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Transparent"
msgstr ""
-#: includes/utility/css.php:194
-msgid "Inline Grid"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Current"
msgstr ""
-#: includes/utility/css.php:205
-msgid "Order"
+#: styles/dark.json
+#: theme.json
+msgctxt "Color name"
+msgid "Inherit"
msgstr ""
-#: includes/utility/css.php:209
-msgid "Overflow"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Archive: Doc"
msgstr ""
-#: includes/utility/css.php:216
-msgid "Hidden"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Archive: Download"
msgstr ""
-#: includes/utility/css.php:220
-msgid "Visible"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Archive: Product"
msgstr ""
-#: includes/utility/css.php:227
-msgid "Pointer Events"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Blank"
msgstr ""
-#: includes/utility/css.php:238
-msgid "All"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Full Width"
msgstr ""
-#: includes/utility/css.php:245
-msgid "Width"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Product Search Results"
msgstr ""
-#: includes/utility/css.php:249
-msgid "Max Width"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Single item: Doc"
msgstr ""
-#: includes/utility/icon.php:163
-msgid " Icon"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Single item: Download"
msgstr ""
-#: includes/utility/icon.php:240
-msgid " icon"
+#: theme.json
+msgctxt "Custom template name"
+msgid "Single item: Product"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "100px"
+msgctxt "Custom template name"
+msgid "Taxonomy Doc Category"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "90px"
+msgctxt "Custom template name"
+msgid "Taxonomy Download Category"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "81px"
+msgctxt "Custom template name"
+msgid "Taxonomy Download Tag"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "72px"
+msgctxt "Custom template name"
+msgid "Taxonomy Product Category"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "60px"
+msgctxt "Custom template name"
+msgid "Taxonomy Product Tag"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "54px"
+msgctxt "Template part name"
+msgid "Header"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "48px"
+msgctxt "Template part name"
+msgid "Footer"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "42px"
+msgctxt "Gradient name"
+msgid "Primary 600/500"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "36px"
+msgctxt "Gradient name"
+msgid "Primary 500/300"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "30px"
+msgctxt "Gradient name"
+msgid "Primary Transparent"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "24px"
+msgctxt "Gradient name"
+msgid "Primary Foreground"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "22px"
+msgctxt "Gradient name"
+msgid "Body/Heading"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "20px"
+msgctxt "Gradient name"
+msgid "Surface/Border"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "18px"
+msgctxt "Gradient name"
+msgid "Background/Transparent"
msgstr ""
#: theme.json
-msgctxt "Font size name"
-msgid "16px"
+msgctxt "Gradient name"
+msgid "Transparent/Background"
+msgstr ""
+
+#: theme.json
+msgctxt "Gradient name"
+msgid "Fade Left"
+msgstr ""
+
+#: theme.json
+msgctxt "Gradient name"
+msgid "Fade Right"
+msgstr ""
+
+#: theme.json
+msgctxt "Gradient name"
+msgid "Checkerboard"
+msgstr ""
+
+#: theme.json
+msgctxt "Gradient name"
+msgid "Grid"
msgstr ""
#: theme.json
msgctxt "Font size name"
-msgid "14px"
+msgid "96px"
msgstr ""
#: theme.json
msgctxt "Font size name"
-msgid "Inherit"
+msgid "88px"
msgstr ""
#: theme.json
-msgctxt "Font family name"
-msgid "Inter"
+msgctxt "Font size name"
+msgid "80px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Primary"
+msgctxt "Font size name"
+msgid "72px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Secondary"
+msgctxt "Font size name"
+msgid "64px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Foreground"
+msgctxt "Font size name"
+msgid "60px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Heading"
+msgctxt "Font size name"
+msgid "52px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Body"
+msgctxt "Font size name"
+msgid "48px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Neutral"
+msgctxt "Font size name"
+msgid "44px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Outline"
+msgctxt "Font size name"
+msgid "40px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Surface"
+msgctxt "Font size name"
+msgid "36px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Base"
+msgctxt "Font size name"
+msgid "32px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Current Color"
+msgctxt "Font size name"
+msgid "28px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Inherit"
+msgctxt "Font size name"
+msgid "24px"
msgstr ""
#: theme.json
-msgctxt "Color name"
-msgid "Transparent"
+msgctxt "Font size name"
+msgid "22px"
msgstr ""
#: theme.json
-msgctxt "Gradient name"
-msgid "Primary Foreground"
+msgctxt "Font size name"
+msgid "20px"
msgstr ""
#: theme.json
-msgctxt "Gradient name"
-msgid "Body/Heading"
+msgctxt "Font size name"
+msgid "18px"
msgstr ""
#: theme.json
-msgctxt "Gradient name"
-msgid "Surface/Border"
+msgctxt "Font size name"
+msgid "16px"
msgstr ""
#: theme.json
-msgctxt "Gradient name"
-msgid "Base/Transparent"
+msgctxt "Font size name"
+msgid "14px"
msgstr ""
#: theme.json
-msgctxt "Gradient name"
-msgid "Transparent/Base"
+msgctxt "Font size name"
+msgid "12px"
msgstr ""
#: theme.json
-msgctxt "Space size name"
-msgid "XXS"
+msgctxt "Font size name"
+msgid "Inherit"
msgstr ""
#: theme.json
-msgctxt "Space size name"
-msgid "XS"
+msgctxt "Font family name"
+msgid "Inter"
msgstr ""
#: theme.json
-msgctxt "Space size name"
-msgid "S"
+msgctxt "Font family name"
+msgid "Inter Tight"
msgstr ""
#: theme.json
-msgctxt "Space size name"
-msgid "M"
+msgctxt "Font family name"
+msgid "JetBrains Mono"
msgstr ""
#: theme.json
msgctxt "Space size name"
-msgid "L"
+msgid "XXS (8px)"
msgstr ""
#: theme.json
msgctxt "Space size name"
-msgid "XL"
+msgid "XS (16px)"
msgstr ""
#: theme.json
msgctxt "Space size name"
-msgid "XXL"
+msgid "S (24px)"
msgstr ""
#: theme.json
-msgctxt "Custom template name"
-msgid "Blank"
+msgctxt "Space size name"
+msgid "M (32px)"
msgstr ""
#: theme.json
-msgctxt "Custom template name"
-msgid "Full Width"
+msgctxt "Space size name"
+msgid "L (48px)"
msgstr ""
#: theme.json
-msgctxt "Template part name"
-msgid "Header"
+msgctxt "Space size name"
+msgid "XL (64px)"
msgstr ""
#: theme.json
-msgctxt "Template part name"
-msgid "Footer"
+msgctxt "Space size name"
+msgid "XXL (96px)"
msgstr ""
diff --git a/package.json b/package.json
index d7b6bba..265a23e 100644
--- a/package.json
+++ b/package.json
@@ -3,20 +3,29 @@
"description": "Blockify theme.",
"author": "Blockify",
"license": "GPL-2.0-or-later",
- "main": "assets/js/index.js",
+ "main": "src/index.tsx",
+ "exports": {
+ "./components": "./src/components",
+ "./utility": "./src/utility"
+ },
"scripts": {
- "start": "wp-scripts start",
+ "css": "npm run build:css",
+ "js": "npm run build:js",
+ "pot": "npm run build:pot",
"build": "npm run js && npm run css && npm run pot",
- "js": "wp-scripts build --output-path=assets/js",
- "css": "rm -Rf assets/css && node-sass --output-style compressed --recursive -o assets/css src/scss && rm -Rf assets/css/abstracts",
- "pot": "wp i18n make-pot ./ languages/blockify.pot --exclude='wp,wp-content,vendor,tests,node_modules,build,assets,src' && echo 'Check nav menu refs'",
+ "build:js": "wp-scripts build --output-path=assets/js",
+ "build:css": "rm -Rf assets/css && node-sass --output-style compressed --recursive -o assets/css src/scss && rm -Rf assets/css/abstracts && find src/scss -type f -name '*.css' -exec rm {} +",
+ "build:pot": "wp i18n make-pot ./ languages/blockify.pot --exclude='wp,wp-content,vendor,tests,node_modules,build,src,assets/css,assets/fonts,assets/img,assets/svg'",
+ "start": "npm run start:css && npm run start:js",
+ "start:js": "wp-scripts start --output-path=assets/js",
+ "start:css": "node-sass --output-style compressed --recursive -wo assets/css src/scss",
"lint": "npm run lint:css && npm run lint:js",
"lint:css": "wp-scripts lint-style 'src/scss'",
"lint:js": "wp-scripts lint-js 'src/**/*.tsx'",
"fix:css": "wp-scripts lint-style 'src/scss' --fix",
"fix:js": "wp-scripts lint-js 'src/**/*.tsx' --fix",
"test": "jest --verbose ./tests/js/*.js",
- "zip": "rm -Rf ../../blockify.zip && zip -r ../../blockify.zip assets/css/ assets/fonts/ assets/js/ assets/svg includes/ languages/ parts/ patterns/ styles/ templates/ functions.php index.php readme.txt screenshot.png style.css theme.json"
+ "zip": "rm -Rf ../../blockify.zip && zip -r ../../blockify.zip assets/ includes/ languages/ parts/ patterns/ styles/ templates/ functions.php index.php readme.txt screenshot.png style.css theme.json"
},
"devDependencies": {
"@babel/preset-typescript": "^7.18.6",
@@ -28,30 +37,30 @@
"@wordpress/api-fetch": "^6.23.0",
"@wordpress/block-editor": "^11.3.0",
"@wordpress/blocks": "^12.3.0",
- "@wordpress/components": "^23.3.0",
+ "@wordpress/components": "^25.11.0",
"@wordpress/compose": "^6.3.0",
"@wordpress/data": "^8.3.0",
"@wordpress/dom-ready": "^3.26.0",
- "@wordpress/edit-post": "^7.3.0",
- "@wordpress/edit-site": "^5.3.0",
- "@wordpress/editor": "^13.3.0",
"@wordpress/element": "^5.3.0",
"@wordpress/eslint-plugin": "^13.10.0",
"@wordpress/hooks": "^3.26.0",
"@wordpress/i18n": "^4.26.0",
"@wordpress/icons": "^9.17.0",
- "@wordpress/plugins": "^5.3.0",
"@wordpress/primitives": "^3.24.0",
"@wordpress/scripts": "^25.3.0",
"browser-sync-webpack-plugin": "^2.3.0",
+ "draggabilly": "^3.0.0",
"eslint": "^8.34.0",
- "glob": "^8.1.0",
"html-react-parser": "^3.0.9",
"jest": "^29.4.2",
"node-sass": "^8.0.0",
+ "packery": "^2.1.2",
"prettier": "^2.8.4",
+ "prism-themes": "^1.9.0",
+ "prismjs": "^1.29.0",
"react": "^18.2.0",
- "react-select": "^5.7.0",
+ "react-select": "^5.8.0",
+ "react-simple-code-editor": "^0.13.1",
"redux": "^4.2.1",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
diff --git a/patterns/blog/featured-post.php b/patterns/blog/featured-post.php
new file mode 100644
index 0000000..a48fa13
--- /dev/null
+++ b/patterns/blog/featured-post.php
@@ -0,0 +1,52 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/blog/grid-boxed.php b/patterns/blog/grid-boxed.php
new file mode 100644
index 0000000..0f9c6f4
--- /dev/null
+++ b/patterns/blog/grid-boxed.php
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/default/blog-single-column.php b/patterns/blog/single-column.php
similarity index 96%
rename from patterns/default/blog-single-column.php
rename to patterns/blog/single-column.php
index 60107e5..c5210c0 100644
--- a/patterns/default/blog-single-column.php
+++ b/patterns/blog/single-column.php
@@ -1,35 +1,27 @@
Latest Posts
-
-
-
-
-
-
-
-
diff --git a/patterns/blog/three-column.php b/patterns/blog/three-column.php
new file mode 100644
index 0000000..d210233
--- /dev/null
+++ b/patterns/blog/three-column.php
@@ -0,0 +1,27 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/contact/form-boxed.php b/patterns/contact/form-boxed.php
new file mode 100644
index 0000000..f0ce1bd
--- /dev/null
+++ b/patterns/contact/form-boxed.php
@@ -0,0 +1,31 @@
+
+
+
+
+
Get in touch
+
+
+
Contact Us
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/contact/form-map-overlay.php b/patterns/contact/form-map-overlay.php
new file mode 100644
index 0000000..377e777
--- /dev/null
+++ b/patterns/contact/form-map-overlay.php
@@ -0,0 +1,36 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/contact/form-map.php b/patterns/contact/form-map.php
new file mode 100644
index 0000000..c92883e
--- /dev/null
+++ b/patterns/contact/form-map.php
@@ -0,0 +1,34 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/contact/form.php b/patterns/contact/form.php
new file mode 100644
index 0000000..6ae889f
--- /dev/null
+++ b/patterns/contact/form.php
@@ -0,0 +1,26 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/contact/icons.php b/patterns/contact/icons.php
new file mode 100644
index 0000000..f132521
--- /dev/null
+++ b/patterns/contact/icons.php
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
Email
+
+
+
Email us for general queries and we’ll get back to you promptly.
+
+
+
info@blockifytheme.com
+
+
+
+
+
+
+
+
Phone
+
+
+
Call us to speak to one of our friendly team members.
+
+
+
+555-1234-56789
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/contact/map.php b/patterns/contact/map.php
new file mode 100644
index 0000000..6b1c26c
--- /dev/null
+++ b/patterns/contact/map.php
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/contact/two-column.php b/patterns/contact/two-column.php
new file mode 100644
index 0000000..2f0512c
--- /dev/null
+++ b/patterns/contact/two-column.php
@@ -0,0 +1,69 @@
+
+
+
+
+
+
Contact us
+
+
+
Get in touch with our helpful and friendly support team using one of the contact methods listed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/default/cta-box.php b/patterns/cta/box.php
similarity index 69%
rename from patterns/default/cta-box.php
rename to patterns/cta/box.php
index df927b9..7ef84ed 100644
--- a/patterns/default/cta-box.php
+++ b/patterns/cta/box.php
@@ -1,23 +1,21 @@
-
-
+
+
Ready to get started?
-
Click the button below to sign up for our advanced SaaS platform. Get started now and see the benefits for yourself.
-
-
diff --git a/patterns/cta/center.php b/patterns/cta/center.php
new file mode 100644
index 0000000..d8cc03c
--- /dev/null
+++ b/patterns/cta/center.php
@@ -0,0 +1,24 @@
+
+
+
+
Ready to get started?
+
+
+
Supercharge your business with modern web design and development tools designed for performance and conversion.
+
+
+
+
+
diff --git a/patterns/default/cta-horizontal.php b/patterns/cta/horizontal.php
similarity index 57%
rename from patterns/default/cta-horizontal.php
rename to patterns/cta/horizontal.php
index 18ae5f1..21567bb 100644
--- a/patterns/default/cta-horizontal.php
+++ b/patterns/cta/horizontal.php
@@ -1,30 +1,27 @@
-
-
-
-
Ready to start your project?
+
+
+
+
Ready to start your project?
-
There has never been a better time than now.
-
-
diff --git a/patterns/cta/right.php b/patterns/cta/right.php
new file mode 100644
index 0000000..ea363d3
--- /dev/null
+++ b/patterns/cta/right.php
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
Let's discuss your next project and bring your idea to life
+
+
+
Supercharge your business with modern web design and development tools designed for performance and conversion. Contact our team and begin your next project by clicking the button below
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/default/blog-featured-post.php b/patterns/default/blog-featured-post.php
deleted file mode 100644
index 09933e2..0000000
--- a/patterns/default/blog-featured-post.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/blog-grid-boxed.php b/patterns/default/blog-grid-boxed.php
deleted file mode 100644
index 7c255e5..0000000
--- a/patterns/default/blog-grid-boxed.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/blog-three-column.php b/patterns/default/blog-three-column.php
deleted file mode 100644
index 27cbef0..0000000
--- a/patterns/default/blog-three-column.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
Latest posts
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/contact-icons.php b/patterns/default/contact-icons.php
deleted file mode 100644
index 1a68f13..0000000
--- a/patterns/default/contact-icons.php
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/contact-two-column.php b/patterns/default/contact-two-column.php
deleted file mode 100644
index 4161d4b..0000000
--- a/patterns/default/contact-two-column.php
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
Contact us
-
-
-
-
Get in touch with our helpful and friendly support team using one of the contact methods listed.
-
-
-
-
Click here to chat to someone now.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/cta-center.php b/patterns/default/cta-center.php
deleted file mode 100644
index 161c1c5..0000000
--- a/patterns/default/cta-center.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
Ready to get started?
-
-
-
-
Supercharge your business with modern web design and development tools designed for performance and conversion.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/cta-right.php b/patterns/default/cta-right.php
deleted file mode 100644
index 84db67c..0000000
--- a/patterns/default/cta-right.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
Start your next project.
-
-
-
-
Ready to begin your project? Get in touch →
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/faq-accordion.php b/patterns/default/faq-accordion.php
deleted file mode 100644
index 0a2a526..0000000
--- a/patterns/default/faq-accordion.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-How does the Accordion block variation work? The Accordion block variation extends the core List block to allow you to create accessible, lightweight, Accordion sections. It uses the details and summary HTML elements. To separate the Accordion title from the content, hold Shift and press Enter/Return. This will create a line break between the title and content. The block variation will turn this into an expandable section with a toggle button.
-
-
-
-How do I add custom SVG images? Custom SVG images can be added to your site in multiple ways. The first option is to use the core Image block, however this requires the use of the Safe SVG plugin since WordPress doesn't allow SVG uploads by default. There is also an SVG block variation provided with this theme which lets you simply paste SVG HTML code into an Image block. The third option is to use the Icon block variation. This displays an SVG icon which you can choose from a library of included icons, or upload your own.
-
-
-
-How to submit a support request? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-Will you considering adding this feature? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
\ No newline at end of file
diff --git a/patterns/default/faq-columns.php b/patterns/default/faq-columns.php
deleted file mode 100644
index c3ae278..0000000
--- a/patterns/default/faq-columns.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-How do I create an accordion block? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-How to use the icon block? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-How to submit a support request? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-Can you please add this feature? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
-
-
-How do I create an accordion block? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-How to use the icon block? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-How to submit a support request? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-Can you please add this feature? Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/faq-default.php b/patterns/default/faq-default.php
deleted file mode 100644
index c5b41a4..0000000
--- a/patterns/default/faq-default.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
Frequently asked questions
-
-
-
-
Ut enim ad minim veniam, quis nostrud exercitation?
-
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-
-
-
-
-
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit?
-
-
-
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
-
-
-
-
-
-
-
-
Duis aute irure dolor in reprehenderit in voluptate?
-
-
-
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
-
-
-
-
-
-
-
-
Excepteur sint occaecat cupidatat non proident?
-
-
-
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
-
-
diff --git a/patterns/default/feature-icon-boxes.php b/patterns/default/feature-icon-boxes.php
deleted file mode 100644
index 25f4ee1..0000000
--- a/patterns/default/feature-icon-boxes.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
Features and benefits
-
-
-
-
-
-
-
-
-
-
-
No Code
-
-
-
-
Customize every aspect of your site from within the site editor without needing to write code
-
-
-
-
-
-
-
-
-
-
Responsive
-
-
-
-
Change the layout, size and spacing of sections depending on the users device width and screen size
-
-
-
-
-
-
-
-
-
-
SVG Icons
-
-
-
-
Choose from multiple icon collections and easily customize the appearance of SVG images
-
-
-
-
-
-
-
-
-
-
-
-
Extendable
-
-
-
-
Easy to extend and make your own with a wide range of design related customization settings
-
-
-
-
-
-
-
-
-
-
Typography
-
-
-
-
Easily change the font settings and try different font combinations with your design
-
-
-
-
-
-
-
-
-
-
Positioning
-
-
-
-
Create almost any kind of layout with the easy to use positioning and layout settings
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/feature-icons.php b/patterns/default/feature-icons.php
deleted file mode 100644
index 782fec9..0000000
--- a/patterns/default/feature-icons.php
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-
-
-
Analytics
-
-
-
-
Simplify your work and gain valuable insights into your business with our advanced analytics tools
-
-
-
-
-
-
-
-
-
-
Less Code
-
-
-
-
Customize every aspect of your dashboard without needing to write a single line of code
-
-
-
-
-
-
-
-
-
-
Collaboration
-
-
-
-
Whether you're just starting out or looking to expand, our platform is designed to grow with you
-
-
-
-
-
-
-
-
-
-
-
-
User Friendly
-
-
-
-
Our platform is designed to be easy to use, so you can focus on what matters most - growing your business
-
-
-
-
-
-
-
-
-
-
Secure Payments
-
-
-
-
Our SaaS platform uses SSL encryption and regular updates to keep your data safe and secure
-
-
-
-
-
-
-
-
-
-
Social Media
-
-
-
-
Easily connect your account to social media platforms and share your content with a wider audience
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/feature-images.php b/patterns/default/feature-images.php
deleted file mode 100644
index 7053819..0000000
--- a/patterns/default/feature-images.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
Simplify your business with our platform
-
-
-
-
Our platform offers a range of features to help you improve your operations, including a user-friendly interface and advanced customization options.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Improve your productivity and get things done
-
-
-
-
Advanced productivity tools designed to help you get things done faster and more efficiently. With features like task management, time tracking, and collaboration tools.
-
-
-
-
-
-
-
-
Protect your data with advanced security
-
-
-
-
Simplify your work and protect your data with our advanced security measures. Our SaaS platform uses SSL encryption and regular updates to keep your data safe and secure
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/footer-centered.php b/patterns/default/footer-centered.php
deleted file mode 100644
index 102b6c5..0000000
--- a/patterns/default/footer-centered.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-
-
Home
-
-
-
-
About
-
-
-
-
Store
-
-
-
-
Blog
-
-
-
-
Account
-
-
-
-
Contact
-
-
-
-
-
-
-
-
-
-
Copyright [year] [site_title]. All rights reserved.
-
-
-
\ No newline at end of file
diff --git a/patterns/default/footer-cta.php b/patterns/default/footer-cta.php
deleted file mode 100644
index 4f670c4..0000000
--- a/patterns/default/footer-cta.php
+++ /dev/null
@@ -1,219 +0,0 @@
-
-
-
-
-
-
Join the weekly newsletter
-
-
-
-
Enter your email address to receive weekly updates
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Overview
-
-
-
-
Landing 1
-
-
-
-
Landing 2
-
-
-
-
Style Guide
-
-
-
-
-
-
Pages
-
-
-
-
About
-
-
-
-
Pricing
-
-
-
-
FAQ
-
-
-
-
Team
-
-
-
-
Contact
-
-
-
-
-
-
-
-
-
-
Templates
-
-
-
-
Blog
-
-
-
-
Blog Post
-
-
-
-
Masonry
-
-
-
-
Author
-
-
-
-
Search
-
-
-
-
-
-
Patterns
-
-
-
-
Header
-
-
-
-
Hero
-
-
-
-
Call to Action
-
-
-
-
Features
-
-
-
-
Testimonials
-
-
-
-
Footer
-
-
-
-
-
-
-
-
-
-
Store
-
-
-
-
Shop
-
-
-
-
Product
-
-
-
-
Cart
-
-
-
-
Checkout
-
-
-
-
My Account
-
-
-
-
-
-
Extra
-
-
-
-
Log In / Register
-
-
-
-
Terms and Conditions
-
-
-
-
Privacy Policy
-
-
-
-
Error 404
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Copyright [year][site_title]. All rights reserved.
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/footer-default.php b/patterns/default/footer-default.php
deleted file mode 100644
index ac17183..0000000
--- a/patterns/default/footer-default.php
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Simplify your workflow and spend more time focussing on what really matters - your business and customers.
-
-
-
-
-
-
-
-
-
-
-
-
Navigation
-
-
-
-
-
-
-
-
Pages
-
-
-
-
-
About
-
-
-
-
Blog
-
-
-
-
Pricing
-
-
-
-
FAQ
-
-
-
-
Team
-
-
-
-
Contact
-
-
-
-
-
-
-
-
-
-
-
Store
-
-
-
-
-
Shop
-
-
-
-
Product
-
-
-
-
Cart
-
-
-
-
Checkout
-
-
-
-
My Account
-
-
-
-
-
-
-
Extra
-
-
-
-
-
Terms of Service
-
-
-
-
Privacy Policy
-
-
-
-
Register
-
-
-
-
Log In
-
-
-
-
-
-
-
-
-
-
© Copyright [year]
-
-
-
-
-
-
· All rights reserved.
-
-
-
diff --git a/patterns/default/footer-minimal.php b/patterns/default/footer-minimal.php
deleted file mode 100644
index 6973b1f..0000000
--- a/patterns/default/footer-minimal.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
Copyright [year] Blockify. All rights reserved.
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/gallery-grid-alt.php b/patterns/default/gallery-grid-alt.php
deleted file mode 100644
index 32acb7d..0000000
--- a/patterns/default/gallery-grid-alt.php
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
Latest Work
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/patterns/default/header-banner.php b/patterns/default/header-banner.php
deleted file mode 100644
index 31aed65..0000000
--- a/patterns/default/header-banner.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
Save 50% for a limited time. Learn more
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/header-center-logo.php b/patterns/default/header-center-logo.php
deleted file mode 100644
index d29f356..0000000
--- a/patterns/default/header-center-logo.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/header-center-menu.php b/patterns/default/header-center-menu.php
deleted file mode 100644
index 4a9edcc..0000000
--- a/patterns/default/header-center-menu.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/patterns/default/header-default.php b/patterns/default/header-default.php
deleted file mode 100644
index af0ebba..0000000
--- a/patterns/default/header-default.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/patterns/default/hero-cover.php b/patterns/default/hero-cover.php
deleted file mode 100644
index 460c0bf..0000000
--- a/patterns/default/hero-cover.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
Create your website with easy to use blocks
-
-
-
-
-
Lightweight full site editing theme with a powerful design framework for building modern WordPress sites with blocks.
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/hero-default.php b/patterns/default/hero-default.php
deleted file mode 100644
index 7670ac9..0000000
--- a/patterns/default/hero-default.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
Simple design system for your website
-
-
-
-
-
Simplify your workflow and collaborate online with our user-friendly platform and collection of free and premium resources
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/hero-image.php b/patterns/default/hero-image.php
deleted file mode 100644
index 3ec818e..0000000
--- a/patterns/default/hero-image.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
The perfect starting point for full site editing
-
-
-
-
-
Lightweight theme framework with useful customization features that help you build better websites with blocks
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/hero-left.php b/patterns/default/hero-left.php
deleted file mode 100644
index 71e5cc9..0000000
--- a/patterns/default/hero-left.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
Launch your idea without code
-
-
-
-
Work with the world's leading web development experts for success with your next project
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/pricing-three-column.php b/patterns/default/pricing-three-column.php
deleted file mode 100644
index 0bb2fb4..0000000
--- a/patterns/default/pricing-three-column.php
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
Simple pricing plans
-
-
-
-
Choose the right pricing plan for your business, whether you're just starting out or looking to upgrade.
-
-
-
-
-
-
-
Single
-
-
-
-
1 team member
-
-
-
-
$ 99
-
-
-
-
Save 50% - $199.00
-
-
-
-
-Feature one
-
-
-
-Feature two
-
-
-
-Feature three
-
-
-
-Feature four
-
-
-
-Feature five
-
-
-
-
-
-
-
-
-
Learn more
-
-
-
-
-
-
Multiple
-
-
-
-
10 team members
-
-
-
-
$ 199
-
-
-
-
Save 50% - $399.00
-
-
-
-
-Feature one
-
-
-
-Feature two
-
-
-
-Feature three
-
-
-
-Feature four
-
-
-
-Feature five
-
-
-
-
-
-
-
-
-
Learn more
-
-
-
-
-
-
Unlimited
-
-
-
-
100 team members
-
-
-
-
$ 299
-
-
-
-
Save 50% - $599.00
-
-
-
-
-Feature one
-
-
-
-Feature two
-
-
-
-Feature three
-
-
-
-Feature four
-
-
-
-Feature five
-
-
-
-
-
-
-
-
-
Learn more
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/pricing-two-column.php b/patterns/default/pricing-two-column.php
deleted file mode 100644
index bf57b3e..0000000
--- a/patterns/default/pricing-two-column.php
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
Choose your plan
-
-
-
-
Simple pricing plans for any size team.
-
-
-
-
-
-
Basic
-
-
-
-
Save 100% - $97.00
-
-
-
-
$ 0
-
-
-
-
Best for personal blogs or single eCommerce stores
-
-
-
-
-Pro blocks & patterns
-
-
-
-WooCommerce
-
-
-
-Developer tools
-
-
-
-White label
-
-
-
-
-
-
-
-
-
Learn more
-
-
-
-
-
-
Pro
-
-
-
-
Save 50% - $197.00
-
-
-
-
$ 97
-
-
-
-
Everything in Basic plan with unlimited use plus:
-
-
-
-
-Pro blocks & patterns
-
-
-
-WooCommerce
-
-
-
-Developer tools
-
-
-
-White label
-
-
-
-
-
-
-
-
-
Learn more
-
-
-
-
diff --git a/patterns/default/pricing-two-rows.php b/patterns/default/pricing-two-rows.php
deleted file mode 100644
index 9771011..0000000
--- a/patterns/default/pricing-two-rows.php
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-
-
-
Pro membership plans for every team size
-
-
-
-
-
-
-
Professional monthly
-
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
-
-
-
-
-
-
-Community access
-
-
-
-Free resources
-
-
-
-
-
-
-
-Unlimited patterns
-
-
-
-Pro membership
-
-
-
-
-
-
-
-
-
Professional
-
-
-
-
Save 50% - $197.00
-
-
-
-
$ 99/month
-
-
-
-
-
-
-
-
Learn more
-
-
-
-
-
-
-
-
Enterprise monthly
-
-
-
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
-
-
-
-
-
-
-Community access
-
-
-
-Free resources
-
-
-
-
-
-
-
-Unlimited patterns
-
-
-
-Pro membership
-
-
-
-
-
-
-
-
-
Enterprise
-
-
-
-
Save 50% - $497.00
-
-
-
-
$ 357/month
-
-
-
-
-
-
-
-
Learn more
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/stats-four-columns.php b/patterns/default/stats-four-columns.php
deleted file mode 100644
index 4bb1e0d..0000000
--- a/patterns/default/stats-four-columns.php
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
30k
-
-
-
-
Happy customers
-
-
-
-
-
-
100
-
-
-
-
Projects completed
-
-
-
-
-
-
33
-
-
-
-
Design awards
-
-
-
-
-
-
10m
-
-
-
-
Cups of coffee
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/team-members.php b/patterns/default/team-members.php
deleted file mode 100644
index 5989044..0000000
--- a/patterns/default/team-members.php
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
Meet the team
-
-
-
-
-
-
-
-
-
-
Jess Brown
-
-
-
-
Co-founder & CEO
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Mark Smith
-
-
-
-
Co-founder & designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Steve Jobs
-
-
-
-
Developer
-
-
-
-
-
-
-
-
diff --git a/patterns/default/template-front-page.php b/patterns/default/template-front-page.php
deleted file mode 100644
index 6cb71c6..0000000
--- a/patterns/default/template-front-page.php
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/patterns/default/testimonial-three-column.php b/patterns/default/testimonial-three-column.php
deleted file mode 100644
index e7d004f..0000000
--- a/patterns/default/testimonial-three-column.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-★★★★★
-
-
-
-Nice work on this product. You've saved our business! If you aren't sure, always go for this product. Believe me, you won't regret it.
-Jess Brown
-
-
-
-
-
-
-★★★★★
-
-
-
-Really good. This product is by far the most valuable business resource we have EVER purchased. Thanks guys, keep up the good work!
-Shane Warne
-
-
-
-
-
-
-★★★★★
-
-
-
-I don't know what else to say. This is simply unbelievable! Nice work on this product. You've really saved our business!
-Sam Jones
-
-
-
\ No newline at end of file
diff --git a/patterns/default/testimonial-two-column.php b/patterns/default/testimonial-two-column.php
deleted file mode 100644
index 772a961..0000000
--- a/patterns/default/testimonial-two-column.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-★★★★★
-
-
-
-Nice work on this product. You've saved our business! If you aren't sure, always go for this product. Believe me, you won't regret it.
-Jess Brown
-
-
-
-
-
-
-★★★★★
-
-
-
-Really good. This product is by far the most valuable business resource we have ever purchased. Thanks guys, keep up the good work!
-Mark Smith
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/utility-browser.php b/patterns/default/utility-browser.php
deleted file mode 100644
index 9c061a5..0000000
--- a/patterns/default/utility-browser.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/utility-dark-mode-toggle.php b/patterns/default/utility-dark-mode-toggle.php
deleted file mode 100644
index a67743b..0000000
--- a/patterns/default/utility-dark-mode-toggle.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/utility-search-toggle.php b/patterns/default/utility-search-toggle.php
deleted file mode 100644
index 7eab03c..0000000
--- a/patterns/default/utility-search-toggle.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/patterns/default/utility-style-guide.php b/patterns/default/utility-style-guide.php
deleted file mode 100644
index a5d677b..0000000
--- a/patterns/default/utility-style-guide.php
+++ /dev/null
@@ -1,475 +0,0 @@
-
-
-
-
-
Color palette
-
-
-
-
Default color palette inspired by the "Modern" WordPress admin color scheme. Theme color palettes can be customized from the site editor.
-
-
-
-
-
Please Note: Neutral colors are reversed in dark mode, and the defaults can be changed by creating your own custom colors in the Styles editor with the following name scheme "Dark Mode Heading" "Dark Mode Body" and so on.
-
-
-
-
Brand
-
-
-
-
-
-
-
-
Neutral
-
-
-
-
-
-
-
-
Utility
-
-
-
-
-
-
-
-
-
Gradients
-
-
-
-
For use with text, backgrounds, box shadows and borders. Default conic gradients can be changed by creating your own custom gradients named "Conic Light" and "Conic Dark".
-
-
-
-
-
Theme
-
-
-
-
-
-
-
-
WordPress
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Typography
-
-
-
-
Fluid typography scale automatically adapts to all screen sizes
-
-
-
-
-
Heading / 72px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
H1 / 60px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
H2 / 48px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
H3 / 36px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
H4 / 30px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
H5 / 24px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
H6 / 20px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
Text / 20px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
Text / 18px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
-
-
-
Text / 16px
-
-
-
-
Almost before we knew it we had left the ground.
-
-
-
-
-
Buttons
-
-
-
-
Customizable uniform button styling
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Notices
-
-
-
-
Add simple notices to let users know of important announcements
-
-
-
-
-
Info : These are the default styles provided by the theme. Every setting can be changed easily from within WordPress.
-
-
-
-
Success : These are the default styles provided by the theme. Every setting can be changed easily from within WordPress.
-
-
-
-
Warning : These are the default styles provided by the theme. Every setting can be changed easily from within WordPress.
-
-
-
-
Error : These are the default styles provided by the theme. Every setting can be changed easily from within WordPress.
-
-
\ No newline at end of file
diff --git a/patterns/faq/accordion-wide.php b/patterns/faq/accordion-wide.php
new file mode 100644
index 0000000..939150e
--- /dev/null
+++ b/patterns/faq/accordion-wide.php
@@ -0,0 +1,77 @@
+
+
+
+
+
FAQs
+
+
+
Frequently asked questions
+
+
+
+
+
+
How do I add custom SVG images?
+Custom SVG images can be added to your site in multiple ways. The first option is to use the core Image block, however this requires the use of the Safe SVG plugin since WordPress doesn't allow SVG uploads by default. There is also an SVG block variation provided with this theme which lets you simply paste SVG HTML code into an Image block. The third option is to use the Icon block variation. This displays an SVG icon which you can choose from a library of included icons, or upload your own.
+
+
+
+
How to change the site logo?
+Head to the Site Editor and then navigate to the Header Template Part. From there, click on the existing logo and then replace it with a block of your choice. You can use an Image block, SVG, Site Logo or Site Title block as the site logo, the choice is yours. We prefer to use SVGs for logos because they scale perfectly at all screen sizes and also support variable colors which makes them ideal for use with dark mode and animations.
+
+
+
+
Does this theme require any plugins?
+No, there are no plugins required by this theme. Everything you need to design an amazing website is provided by the framework.
+
+
+
+
How can I add animations to blocks?
+Most core blocks have animation supported added. You can add and change transition effects without needing any code.
+
+
+
+
What version of PHP do I need?
+PHP 7.4 or higher is required however we recommend using a later version PHP 8.2 or above.
+
+
+
+
+
+
How do I create an FAQ accordion?
+There are 2 ways to add an accordion to your site with our theme. First, you can use an existing accordion from any of the included block patters. Secondly you can create your own from scratch using the core List block. Since the accordion uses a core block variation instead of a custom block, your content will not be lost if you ever decide to switch themes.
+
+
+
+
How can I display blog posts on the home page?
+This theme comes with multiple blog patterns that can be used to display posts on any page. Simply add a blog pattern to your home page template, or the page that is set as the Front Page. You can customize the Query Loop to suit your needs.
+
+
+
+
How can I save user dark mode preferences?
+No, there are no plugins required by this theme. Everything you need to design an amazing website is provided by the framework.
+
+
+
+
How to keep user dark mode setting?
+Cookies can be used to store user dark mode settings when clicking the toggle switch
+
+
+
+
How do I create a child theme?
+We recommend using the create block theme plugin to create your own child themes. With a little know-how, they can be the perfect way to build your own website. They inherit all of the parent theme's design which saves you a tonne of work and provides a head start for your next project.
+
+
+
+
+
+
Question not answered above? Contact us →
+
+
\ No newline at end of file
diff --git a/patterns/faq/accordion.php b/patterns/faq/accordion.php
new file mode 100644
index 0000000..58d9cec
--- /dev/null
+++ b/patterns/faq/accordion.php
@@ -0,0 +1,60 @@
+
+
+
+
How do I add custom SVG images?
+Custom SVG images can be added to your site in multiple ways. The first option is to use the core Image block, however this requires the use of the Safe SVG plugin since WordPress doesn't allow SVG uploads by default. There is also an SVG block variation provided with this theme which lets you simply paste SVG HTML code into an Image block. The third option is to use the Icon block variation. This displays an SVG icon which you can choose from a library of included icons, or upload your own.
+
+
+
+
How to change the site logo?
+Head to the Site Editor and then navigate to the Header Template Part. From there, click on the existing logo and then replace it with a block of your choice. You can use an Image block, SVG, Site Logo or Site Title block as the site logo, the choice is yours. We prefer to use SVGs for logos because they scale perfectly at all screen sizes and also support variable colors which makes them ideal for use with dark mode and animations.
+
+
+
+
Does this theme require any plugins?
+No, there are no plugins required by this theme. Everything you need to design an amazing website is provided by the framework.
+
+
+
+
How can I add animations to blocks?
+Most core blocks have animation supported added. You can add and change transition effects without needing any code.
+
+
+
+
What version of PHP do I need?
+PHP 7.4 or higher is required however we recommend using a later version PHP 8.2 or above.
+
+
+
+
How do I create an FAQ accordion?
+There are 2 ways to add an accordion to your site with our theme. First, you can use an existing accordion from any of the included block patters. Secondly you can create your own from scratch using the core List block. Since the accordion uses a core block variation instead of a custom block, your content will not be lost if you ever decide to switch themes.
+
+
+
+
How can I display blog posts on the home page?
+This theme comes with multiple blog patterns that can be used to display posts on any page. Simply add a blog pattern to your home page template, or the page that is set as the Front Page. You can customize the Query Loop to suit your needs.
+
+
+
+
How can I save user dark mode preferences?
+No, there are no plugins required by this theme. Everything you need to design an amazing website is provided by the framework.
+
+
+
+
How to keep user dark mode setting?
+Cookies can be used to store user dark mode settings when clicking the toggle switch
+
+
+
+
How do I create a child theme?
+We recommend using the create block theme plugin to create your own child themes. With a little know-how, they can be the perfect way to build your own website. They inherit all of the parent theme's design which saves you a tonne of work and provides a head start for your next project.
+
+
+
\ No newline at end of file
diff --git a/patterns/faq/columns.php b/patterns/faq/columns.php
new file mode 100644
index 0000000..dccdb00
--- /dev/null
+++ b/patterns/faq/columns.php
@@ -0,0 +1,72 @@
+
+
+
+
FAQs
+
+
+
Frequently asked questions
+
+
+
+
+
How do I add custom SVG images?
+Custom SVG images can be added to your site in multiple ways. The first option is to use the core Image block, however this requires the use of the Safe SVG plugin since WordPress doesn't allow SVG uploads by default. There is also an SVG block variation provided with this theme which lets you simply paste SVG HTML code into an Image block. The third option is to use the Icon block variation. This displays an SVG icon which you can choose from a library of included icons, or upload your own.
+
+
+
+
How to change the site logo?
+Head to the Site Editor and then navigate to the Header Template Part. From there, click on the existing logo and then replace it with a block of your choice. You can use an Image block, SVG, Site Logo or Site Title block as the site logo, the choice is yours. We prefer to use SVGs for logos because they scale perfectly at all screen sizes and also support variable colors which makes them ideal for use with dark mode and animations.
+
+
+
+
Does this theme require any plugins?
+No, there are no plugins required by this theme. Everything you need to design an amazing website is provided by the framework.
+
+
+
+
How can I add animations to blocks?
+Most core blocks have animation supported added. You can add and change transition effects without needing any code.
+
+
+
+
What version of PHP do I need?
+PHP 7.4 or higher is required however we recommend using a later version PHP 8.2 or above.
+
+
+
+
+
+
How do I create an FAQ accordion?
+There are 2 ways to add an accordion to your site with our theme. First, you can use an existing accordion from any of the included block patters. Secondly you can create your own from scratch using the core List block. Since the accordion uses a core block variation instead of a custom block, your content will not be lost if you ever decide to switch themes.
+
+
+
+
How can I display blog posts on the home page?
+This theme comes with multiple blog patterns that can be used to display posts on any page. Simply add a blog pattern to your home page template, or the page that is set as the Front Page. You can customize the Query Loop to suit your needs.
+
+
+
+
How can I save user dark mode preferences?
+No, there are no plugins required by this theme. Everything you need to design an amazing website is provided by the framework.
+
+
+
+
How to keep user dark mode setting?
+Cookies can be used to store user dark mode settings when clicking the toggle switch
+
+
+
+
How do I create a child theme?
+We recommend using the create block theme plugin to create your own child themes. With a little know-how, they can be the perfect way to build your own website. They inherit all of the parent theme's design which saves you a tonne of work and provides a head start for your next project.
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/faq/default.php b/patterns/faq/default.php
new file mode 100644
index 0000000..d93b165
--- /dev/null
+++ b/patterns/faq/default.php
@@ -0,0 +1,40 @@
+
+
+
+
FAQs
+
+
+
Frequently asked questions
+
+
+
Ut enim ad minim veniam, quis nostrud exercitation?
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit?
+
+
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+
+
+
Duis aute irure dolor in reprehenderit in voluptate?
+
+
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
+
+
Excepteur sint occaecat cupidatat non proident?
+
+
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+
+
\ No newline at end of file
diff --git a/patterns/default/feature-banner.php b/patterns/feature/banner.php
similarity index 79%
rename from patterns/default/feature-banner.php
rename to patterns/feature/banner.php
index bc1c388..cdf14b7 100644
--- a/patterns/default/feature-banner.php
+++ b/patterns/feature/banner.php
@@ -1,13 +1,12 @@
-
+
-
Limited time only · Everything on sale · Don't miss out · Hurry while stocks last · Biggest sale of the year ·
+
Limited time only · Everything on sale · Don't miss out · Hurry while stocks last · Biggest sale of the year ·
\ No newline at end of file
diff --git a/patterns/feature/icon-boxes.php b/patterns/feature/icon-boxes.php
new file mode 100644
index 0000000..edfd084
--- /dev/null
+++ b/patterns/feature/icon-boxes.php
@@ -0,0 +1,87 @@
+
+
+
+
+
Features
+
+
+
Everything you need to succeed online
+
+
+
+
+
+
+
+
+
No Code
+
+
+
Customize every aspect of your site from within the site editor without needing to write code
+
+
+
+
+
+
+
+
Responsive
+
+
+
Change the layout, size and spacing of sections depending on the users device width and screen size
+
+
+
+
+
+
+
+
Icon Library
+
+
+
Choose from multiple icon collections and easily customize the appearance of SVG images
+
+
+
+
+
+
+
+
+
+
Extendable
+
+
+
Easy to extend and make your own with a wide range of design related customization settings
+
+
+
+
+
+
+
+
Typography
+
+
+
Easily change the font settings and try different font combinations with your design
+
+
+
+
+
+
+
+
Positioning
+
+
+
Create almost any kind of layout with the easy to use positioning and layout block settings
+
+
+
+
\ No newline at end of file
diff --git a/patterns/feature/icons-centered.php b/patterns/feature/icons-centered.php
new file mode 100644
index 0000000..b082ef3
--- /dev/null
+++ b/patterns/feature/icons-centered.php
@@ -0,0 +1,53 @@
+
+
+
+
+
Everything you need
+
+
+
The most powerful tools for your business
+
+
+
+
+
+
+
+
+
Analytics
+
+
+
Simplify your work and gain valuable insights into your business with our advanced analytics tools
+
+
+
+
+
+
+
+
Less Code
+
+
+
Less coding needed to customize aspects of your dashboard without needing to write a single line of code
+
+
+
+
+
+
+
+
Collaboration
+
+
+
Whether you're just starting out or looking to expand, our platform is designed to grow with you
+
+
+
+
\ No newline at end of file
diff --git a/patterns/feature/icons.php b/patterns/feature/icons.php
new file mode 100644
index 0000000..9888a36
--- /dev/null
+++ b/patterns/feature/icons.php
@@ -0,0 +1,88 @@
+
+
+
+
+
Everything you need
+
+
+
The most powerful tools for your business
+
+
+
+
+
+
+
+
+
Analytics
+
+
+
Simplify your work and gain valuable insights into your business with our advanced analytics tools
+
+
+
+
+
+
+
+
Less Code
+
+
+
Less coding needed to customize aspects of your dashboard without needing to write a single line of code
+
+
+
+
+
+
+
+
Collaboration
+
+
+
Whether you're just starting out or looking to expand, our platform is designed to grow with you
+
+
+
+
+
+
+
+
+
+
User Friendly
+
+
+
Our platform is designed to be easy to use, so you can focus on what matters most - growing your business
+
+
+
+
+
+
+
+
Secure Payments
+
+
+
Our SaaS platform uses SSL encryption and regular updates to keep your data safe and secure
+
+
+
+
+
+
+
+
Social Media
+
+
+
Easily connect your account to social media platforms and share your content with a wider audience
+
+
+
+
\ No newline at end of file
diff --git a/patterns/feature/image-gallery-alt.php b/patterns/feature/image-gallery-alt.php
new file mode 100644
index 0000000..3cf12e7
--- /dev/null
+++ b/patterns/feature/image-gallery-alt.php
@@ -0,0 +1,42 @@
+
+
+
+
+
+
Portfolio
+
+
+
Latest projects
+
+
+
Simplify your workflow and collaborate online with our user-friendly platform and collection of free and premium resources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/default/gallery-grid.php b/patterns/feature/image-gallery.php
similarity index 67%
rename from patterns/default/gallery-grid.php
rename to patterns/feature/image-gallery.php
index c3cc466..a3a0a4a 100644
--- a/patterns/default/gallery-grid.php
+++ b/patterns/feature/image-gallery.php
@@ -1,65 +1,66 @@
-
-
Portfolio
+
+
+
+
Portfolio
+
+
+
Latest projects
-
+
+
Simplify your workflow and collaborate online with our user-friendly platform and collection of free and premium resources
+
+
+
-
-
+
\ No newline at end of file
diff --git a/patterns/feature/images-two-column.php b/patterns/feature/images-two-column.php
new file mode 100644
index 0000000..2f08b7e
--- /dev/null
+++ b/patterns/feature/images-two-column.php
@@ -0,0 +1,36 @@
+
+
+
+
+
+
Beautiful pre-made designs ready for your next project
+
+
+
Choose from 100+ expertly crafted, responsive block layouts for your next project. Save time, avoid starting from scratch, and create stunning websites and user interfaces with ease. Personalize your site with colors, gradients, typography, and more. Apply site-wide changes or fine-tune individual blocks.
+
+
+
Simplify your workflow and collaborate online with our user-friendly platform and collection of free and premium resources
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/feature/images.php b/patterns/feature/images.php
new file mode 100644
index 0000000..8b5d340
--- /dev/null
+++ b/patterns/feature/images.php
@@ -0,0 +1,64 @@
+
+
+
+
+
+
Block Patterns
+
+
+
Beautiful pre-made designs ready for your next project
+
+
+
Choose from 100+ expertly crafted, responsive block layouts for your next project. Save time, avoid starting from scratch, and create stunning websites and user interfaces with ease.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Global Styles
+
+
+
Consistent design system with easy to customize tokens
+
+
+
Personalize your site with colors, gradients, typography, and more. Apply site-wide changes or fine-tune individual blocks. Update your brand and build world-class, responsive UIs with precision.
+
+
+
+
+
+
+
Dark mode
+
+
+
Delight users with automatic dark mode theme switching
+
+
+
Improve the user experience by offering one-click light and dark theme switching. The intelligent dark mode color palette detects system preferences and displays the appropriate theme automatically.
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/footer/centered.php b/patterns/footer/centered.php
new file mode 100644
index 0000000..e78784b
--- /dev/null
+++ b/patterns/footer/centered.php
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+© Copyright {year}
+
+
+
+
+
+· All rights reserved.
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/footer/cta.php b/patterns/footer/cta.php
new file mode 100644
index 0000000..8f8cf64
--- /dev/null
+++ b/patterns/footer/cta.php
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Store
+
+
+
+
Shop
+
+
+
Product
+
+
+
Cart
+
+
+
Checkout
+
+
+
My Account
+
+
+
+
+
+
Extra
+
+
+
+
+Terms of Service
+
+
+
+
+Privacy Policy
+
+
+
+
+Register
+
+
+
+
+Log In
+
+
+
+
+
+
+
+
+
+
+
Navigation
+
+
+
+
+
+
+
+
+
+
+
+
+
Store
+
+
+
Shop
+
+
+
Product
+
+
+
+
Cart
+
+
+
Checkout
+
+
+
My Account
+
+
+
+
+
+
Extra
+
+
+
+
Terms of Service
+
+
+
Privacy Policy
+
+
+
Register
+
+
+
Log In
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+© Copyright {year}
+
+
+
+
+
+· All rights reserved.
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/footer/default.php b/patterns/footer/default.php
new file mode 100644
index 0000000..a15340d
--- /dev/null
+++ b/patterns/footer/default.php
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Templates
+
+
+
+
Single Post
+
+
+
Blog Category
+
+
+
Page
+
+
+
Front Page
+
+
+
Search
+
+
+
+
+
+
Extra
+
+
+
+
Terms of Service
+
+
+
Privacy Policy
+
+
+
Register
+
+
+
Log In
+
+
+
+
+
+
+
+
+
+
© Copyright {year}
+
+
+
+
· All rights reserved.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/footer/minimal.php b/patterns/footer/minimal.php
new file mode 100644
index 0000000..5a20661
--- /dev/null
+++ b/patterns/footer/minimal.php
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+© Copyright {year}
+
+
+
+
+
+· All rights reserved.
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/header/center-logo.php b/patterns/header/center-logo.php
new file mode 100644
index 0000000..90ead17
--- /dev/null
+++ b/patterns/header/center-logo.php
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/header/center-menu.php b/patterns/header/center-menu.php
new file mode 100644
index 0000000..0c7683f
--- /dev/null
+++ b/patterns/header/center-menu.php
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/header/centered.php b/patterns/header/centered.php
new file mode 100644
index 0000000..785bd9a
--- /dev/null
+++ b/patterns/header/centered.php
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/header/default.php b/patterns/header/default.php
new file mode 100644
index 0000000..c91bd2e
--- /dev/null
+++ b/patterns/header/default.php
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/header/menu-left.php b/patterns/header/menu-left.php
new file mode 100644
index 0000000..5d8e97a
--- /dev/null
+++ b/patterns/header/menu-left.php
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/header/minimal.php b/patterns/header/minimal.php
new file mode 100644
index 0000000..cc14881
--- /dev/null
+++ b/patterns/header/minimal.php
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/hero/cover.php b/patterns/hero/cover.php
new file mode 100644
index 0000000..5c65147
--- /dev/null
+++ b/patterns/hero/cover.php
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Block Design system
+
+
+
Lightweight, responsive block design system
+
+
+
+
Simplify
+ your workflow and collaborate online with our user-friendly
+ platform and collection of free and premium resources
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/hero/image-below.php b/patterns/hero/image-below.php
new file mode 100644
index 0000000..8bc2292
--- /dev/null
+++ b/patterns/hero/image-below.php
@@ -0,0 +1,32 @@
+
+
+
+
+
+
Lightweight, responsive block design system
+
+
+
+
Simplify your workflow and collaborate online with our user-friendly platform and collection of free and premium resources
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/hero/image.php b/patterns/hero/image.php
new file mode 100644
index 0000000..b577a16
--- /dev/null
+++ b/patterns/hero/image.php
@@ -0,0 +1,40 @@
+
+
+
+
+
+
Everything you need
+
+
+
Lightweight, responsive block design system
+
+
+
+
Simplify
+ your workflow and collaborate online with our user-friendly
+ platform and collection of free and premium resources
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/hero/left.php b/patterns/hero/left.php
new file mode 100644
index 0000000..015cb34
--- /dev/null
+++ b/patterns/hero/left.php
@@ -0,0 +1,40 @@
+
+
+
+
+
+
Everything you need
+
+
+
Lightweight, responsive block design system
+
+
+
+
Simplify
+ your workflow and collaborate online with our user-friendly
+ platform and collection of free and premium resources
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/page/about.php b/patterns/page/about.php
new file mode 100644
index 0000000..c8334b7
--- /dev/null
+++ b/patterns/page/about.php
@@ -0,0 +1,11 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/page/blog.php b/patterns/page/blog.php
new file mode 100644
index 0000000..e68c6e7
--- /dev/null
+++ b/patterns/page/blog.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/page/contact.php b/patterns/page/contact.php
new file mode 100644
index 0000000..68a0807
--- /dev/null
+++ b/patterns/page/contact.php
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/patterns/page/home.php b/patterns/page/home.php
new file mode 100644
index 0000000..419308d
--- /dev/null
+++ b/patterns/page/home.php
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/page/pricing.php b/patterns/page/pricing.php
new file mode 100644
index 0000000..2f5c234
--- /dev/null
+++ b/patterns/page/pricing.php
@@ -0,0 +1,15 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/page/style-guide.php b/patterns/page/style-guide.php
new file mode 100644
index 0000000..5f577d5
--- /dev/null
+++ b/patterns/page/style-guide.php
@@ -0,0 +1,854 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Color Palette
+
+
+
Default color palette for creating beautiful designs
+
+
+
+
+
Primary
+
+
+
+
+
+
Neutral
+
+
+
+
+
+
+
+
+
Status
+
+
+
+
+
+
+
+
+
+
+
Gradients
+
+
+
For use with text, backgrounds, box shadows and borders
+
+
+
+
+
Theme
+
+
+
+
+
+
Default
+
+
+
+
+
+
+
+
+
+
+
Typography
+
+
+
For use with text, backgrounds, box shadows and borders
+
+
+
+
+
Display / 60px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Heading 1 / 44px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Heading 2 / 36px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Heading 3 / 32px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Heading 4 / 28px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Heading 5 / 24px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Heading 6 / 20px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Text / 20px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Text / 18px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Text / 16px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
+
Text / 14px
+
+
+
Almost before we knew it we had left the ground.
+
+
+
+
+
Spacing Scale
+
+
+
Smart grid spacing included for consistent layouts
+
+
+
+
+
+
Name
+
+
+
Token
+
+
+
Size
+
+
+
Width
+
+
+
+
+
XX Small
+
+
+
spacing-xxs
+
+
+
8px
+
+
+
+
+
+
+
+
X Small
+
+
+
spacing-xs
+
+
+
16px
+
+
+
+
+
+
+
+
Small
+
+
+
spacing-sm
+
+
+
24px
+
+
+
+
+
+
+
+
Medium
+
+
+
spacing-md
+
+
+
32px
+
+
+
+
+
+
+
+
Large
+
+
+
spacing-lg
+
+
+
48px
+
+
+
+
+
+
+
+
X Large
+
+
+
spacing-xl
+
+
+
64px
+
+
+
+
+
+
+
+
XX Large
+
+
+
spacing-xxl
+
+
+
96px
+
+
+
+
+
+
+
+
+
Shadows
+
+
+
Subtle shadow scale presets
+
+
+
+
+
+
Shadow (xxs)
+
+
+
var(--wp--preset--shadow--xxs)
+
+
+
+
+
+
+
+
+
+
Shadow (xs)
+
+
+
var(--wp--preset--shadow--xs)
+
+
+
+
+
+
+
+
+
+
Shadow (sm)
+
+
+
var(--wp--preset--shadow--sm)
+
+
+
+
+
+
+
+
+
+
Shadow (md)
+
+
+
var(--wp--preset--shadow--md)
+
+
+
+
+
+
+
+
+
+
Shadow (lg)
+
+
+
var(--wp--preset--shadow--lg)
+
+
+
+
+
+
+
+
+
+
Shadow (xl)
+
+
+
var(--wp--preset--shadow--xl)
+
+
+
+
+
+
+
+
+
+
Shadow (xxl)
+
+
+
var(--wp--preset--shadow--xxl)
+
+
+
+
+
+
+
+
+
Elements
+
+
+
Common HTML element styles
+
+
+
+
Buttons
+
+
+
+
+
+
Forms
+
+
+
+
+
+
+ Country
+ United States
+ Canada
+ United Kingdom
+
+
+
+
+
+ Subscribe to our newsletter
+
+
+
+
+
+
+
Notices
+
+
+
+
Info : These are the default styles provided by the theme. Every setting can be changed easily from within WordPress.
+
+
+
Success : These are the default styles provided by the theme. Every setting can be changed easily from within WordPress.
+
+
+
Warning : These are the default styles provided by the theme. Every setting can be changed easily from within WordPress.
+
+
+
Error : These are the default styles provided by the theme. Every setting can be changed easily from within WordPress.
+
+
+
+
+
Icons
+
+
+
Default icon sets included with theme
+
+
+
+
WordPress
+
+
+
+
+
+
Social
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/pricing/three-column.php b/patterns/pricing/three-column.php
new file mode 100644
index 0000000..34e3ff7
--- /dev/null
+++ b/patterns/pricing/three-column.php
@@ -0,0 +1,154 @@
+
+
+
+
+
Pricing
+
+
+
Simple transparent pricing
+
+
+
Choose the right pricing plan for your business
+
+
+
+
+
+
Basic
+
+
+
+
+
+
Save 50% - $199.00
+
+
+
+
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Save 50% - $399.00
+
+
+
+
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+
+
+
+
+
+
+
Team
+
+
+
+
+
+
Save 50% - $799.00
+
+
+
+
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+
+
+
+
+
+
+
100% no-risk money back guarantee
+
+
\ No newline at end of file
diff --git a/patterns/pricing/two-column.php b/patterns/pricing/two-column.php
new file mode 100644
index 0000000..5c44b24
--- /dev/null
+++ b/patterns/pricing/two-column.php
@@ -0,0 +1,110 @@
+
+
+
+
+
plans
+
+
+
Choose your plan
+
+
+
Choose the right pricing plan for your business
+
+
+
+
+
+
Basic
+
+
+
+
+
+
Save 50% - $199.00
+
+
+
+
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Save 50% - $399.00
+
+
+
+
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+Feature or benefit one
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/pricing/two-rows.php b/patterns/pricing/two-rows.php
new file mode 100644
index 0000000..4dae3e2
--- /dev/null
+++ b/patterns/pricing/two-rows.php
@@ -0,0 +1,124 @@
+
+
+
+
+
Pricing
+
+
+
Become a member
+
+
+
Choose the right pricing plan for your business
+
+
+
+
+
+
Basic
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
+
+
+
+
+Feature or benefit one
+
+
+Feature or benefit two
+
+
+
+
+
+
+Feature or benefit three
+
+
+Feature or benefit four
+
+
+
+
+
+
+
+
+
+
+
Save 50% - $199.00
+
+
+
+
+
+
+
+
+
+
Pro
+
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
+
+
+
+
+Feature or benefit one
+
+
+Feature or benefit two
+
+
+
+
+
+
+Feature or benefit three
+
+
+Feature or benefit four
+
+
+
+
+
+
+
+
+
+
+
Save 50% - $399.00
+
+
+
+
+
+
+
+
100% no-risk money back guarantee
+
+
\ No newline at end of file
diff --git a/patterns/stats/four-columns.php b/patterns/stats/four-columns.php
new file mode 100644
index 0000000..6ad4505
--- /dev/null
+++ b/patterns/stats/four-columns.php
@@ -0,0 +1,43 @@
+
+
+
+
+
+
30k
+
+
+
Happy customers
+
+
+
+
+
100
+
+
+
Projects completed
+
+
+
+
+
+
+
+
10m
+
+
+
Cups of coffee
+
+
+
+
\ No newline at end of file
diff --git a/patterns/stats/left.php b/patterns/stats/left.php
new file mode 100644
index 0000000..8101e0f
--- /dev/null
+++ b/patterns/stats/left.php
@@ -0,0 +1,57 @@
+
+
+
+
+
+
30k
+
+
+
Happy customers
+
+
+
+
+
100
+
+
+
Projects completed
+
+
+
+
+
+
+
+
10m
+
+
+
Cups of coffee
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/default/stats-with-image.php b/patterns/stats/with-image.php
similarity index 50%
rename from patterns/default/stats-with-image.php
rename to patterns/stats/with-image.php
index 2cc649e..bd941b1 100644
--- a/patterns/default/stats-with-image.php
+++ b/patterns/stats/with-image.php
@@ -1,64 +1,54 @@
-
+
-
-
Helping your business succeed online
+
Helping more businesses succeed online with proven strategies
-
-
-
30k
+
+
30k
-
-
-
Happy customers
+
+
Happy customers
-
-
-
10m
+
+
10m
-
-
-
Cups of coffee
+
+
Cups of coffee
-
-
-
-
-
33
+
+
+
+
100b
-
-
-
Design awards
+
+
Profit generated
-
-
-
100b
+
+
33
-
-
-
Profit generated
+
+
Design awards
diff --git a/patterns/team/members.php b/patterns/team/members.php
new file mode 100644
index 0000000..a605ebb
--- /dev/null
+++ b/patterns/team/members.php
@@ -0,0 +1,83 @@
+
+
+
+
About
+
+
+
Meet the team
+
+
+
+
+
+
+
+
+
Jess Brown
+
+
+
Co-founder & CEO
+
+
+
Integer ipsum odio platea orci quis tempus sociosqu. Fusce egestas ligula urna consectetur sem at.
+
+
+
+
+
+
+
+
+
+
+
+
+
Mark Smith
+
+
+
Co-founder & designer
+
+
+
Integer ipsum odio platea orci quis tempus sociosqu. Fusce egestas ligula urna consectetur sem at.
+
+
+
+
+
+
+
+
+
+
+
+
+
Steve Jobs
+
+
+
Developer
+
+
+
Integer ipsum odio platea orci quis tempus sociosqu. Fusce egestas ligula urna consectetur sem at.
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/template/404.php b/patterns/template/404.php
new file mode 100644
index 0000000..68413b1
--- /dev/null
+++ b/patterns/template/404.php
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+ 404
+
+
+
Page not found
+
+
+
Sorry, the page
+ you are looking for could not be found. Try searching the site using
+ the search form below.
+
+
+
+
+
+
+
diff --git a/patterns/template/archive-download.php b/patterns/template/archive-download.php
new file mode 100644
index 0000000..a1a86b8
--- /dev/null
+++ b/patterns/template/archive-download.php
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/patterns/template/archive-product.php b/patterns/template/archive-product.php
new file mode 100644
index 0000000..fc69542
--- /dev/null
+++ b/patterns/template/archive-product.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/patterns/template/archive.php b/patterns/template/archive.php
new file mode 100644
index 0000000..7bb361c
--- /dev/null
+++ b/patterns/template/archive.php
@@ -0,0 +1,47 @@
+
+
+
+
+
+ {archive_title}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/template/author.php b/patterns/template/author.php
new file mode 100644
index 0000000..6f72e5c
--- /dev/null
+++ b/patterns/template/author.php
@@ -0,0 +1,10 @@
+
+
diff --git a/patterns/template/blank.php b/patterns/template/blank.php
new file mode 100644
index 0000000..f75c574
--- /dev/null
+++ b/patterns/template/blank.php
@@ -0,0 +1,11 @@
+
+
+
diff --git a/patterns/template/date.php b/patterns/template/date.php
new file mode 100644
index 0000000..f14196a
--- /dev/null
+++ b/patterns/template/date.php
@@ -0,0 +1,10 @@
+
+
diff --git a/patterns/template/front-page.php b/patterns/template/front-page.php
new file mode 100644
index 0000000..1ccc697
--- /dev/null
+++ b/patterns/template/front-page.php
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
diff --git a/patterns/template/full-width.php b/patterns/template/full-width.php
new file mode 100644
index 0000000..2f8eba1
--- /dev/null
+++ b/patterns/template/full-width.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/template/index.php b/patterns/template/index.php
new file mode 100644
index 0000000..70fa0f8
--- /dev/null
+++ b/patterns/template/index.php
@@ -0,0 +1,60 @@
+
+
+
+
+
+ Blog
+
+
+
+ Latest
+ posts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/template/page.php b/patterns/template/page.php
new file mode 100644
index 0000000..955e321
--- /dev/null
+++ b/patterns/template/page.php
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/template/search-product.php b/patterns/template/search-product.php
new file mode 100644
index 0000000..7e57918
--- /dev/null
+++ b/patterns/template/search-product.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/patterns/template/search.php b/patterns/template/search.php
new file mode 100644
index 0000000..31d1ea1
--- /dev/null
+++ b/patterns/template/search.php
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Search Results
+
+
+
+
+
+
diff --git a/patterns/template/single-download.php b/patterns/template/single-download.php
new file mode 100644
index 0000000..24aaacd
--- /dev/null
+++ b/patterns/template/single-download.php
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/template/single-product.php b/patterns/template/single-product.php
new file mode 100644
index 0000000..2fb7d27
--- /dev/null
+++ b/patterns/template/single-product.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/patterns/template/single.php b/patterns/template/single.php
new file mode 100644
index 0000000..9c856e3
--- /dev/null
+++ b/patterns/template/single.php
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/template/taxonomy-product_cat.php b/patterns/template/taxonomy-product_cat.php
new file mode 100644
index 0000000..bfb8175
--- /dev/null
+++ b/patterns/template/taxonomy-product_cat.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/patterns/template/taxonomy-product_tag.php b/patterns/template/taxonomy-product_tag.php
new file mode 100644
index 0000000..e1dbe8a
--- /dev/null
+++ b/patterns/template/taxonomy-product_tag.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/patterns/testimonial/brands.php b/patterns/testimonial/brands.php
new file mode 100644
index 0000000..d6ef182
--- /dev/null
+++ b/patterns/testimonial/brands.php
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/testimonial/logo-cloud.php b/patterns/testimonial/logo-cloud.php
new file mode 100644
index 0000000..566b68d
--- /dev/null
+++ b/patterns/testimonial/logo-cloud.php
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/patterns/default/testimonial-single.php b/patterns/testimonial/single.php
similarity index 71%
rename from patterns/default/testimonial-single.php
rename to patterns/testimonial/single.php
index c9bd7fa..ad7a44a 100644
--- a/patterns/default/testimonial-single.php
+++ b/patterns/testimonial/single.php
@@ -1,16 +1,14 @@
-
-
-
★★★★★
+
+
+
★★★★★
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
diff --git a/patterns/testimonial/three-column.php b/patterns/testimonial/three-column.php
new file mode 100644
index 0000000..1f297fd
--- /dev/null
+++ b/patterns/testimonial/three-column.php
@@ -0,0 +1,79 @@
+
+
+
+
+
+⭐️⭐️⭐️⭐️⭐️
+
+
+Nice work on this product. You've saved our business! If you aren't sure, always go for this product. Believe me, you won't regret it.
+
+
+
+
+
+
+
+
Jessica Lee
+
+
+
Designer
+
+
+
+
+
+
+
+
+⭐️⭐️⭐️⭐️⭐️
+
+
+Really good. This product is by far the most valuable business resource we have ever purchased. Keep up the good work!
+
+
+
+
+
+
+
+
Mark Smith
+
+
+
Developer
+
+
+
+
+
+
+
+
+⭐️⭐️⭐️⭐️⭐️
+
+
+I don't know what else to say. This is simply unbelievable! Nice work on this product. You've helped our business!
+
+
+
+
+
+
+
+
Emily Johnson
+
+
+
Consultant
+
+
+
+
+
+
diff --git a/patterns/testimonial/two-column.php b/patterns/testimonial/two-column.php
new file mode 100644
index 0000000..d7e23ff
--- /dev/null
+++ b/patterns/testimonial/two-column.php
@@ -0,0 +1,56 @@
+
+
+
+
+
+⭐️⭐️⭐️⭐️⭐️
+
+
+Nice work on this product. You've saved our business! If you aren't sure, always go for this product. Believe me, you won't regret it.
+
+
+
+
+
+
+
+
Olivia Walker
+
+
+
Consultant
+
+
+
+
+
+
+
+
+⭐️⭐️⭐️⭐️⭐️
+
+
+Really good. This product is by far the most valuable business resource we have ever purchased. Keep up the good work!
+
+
+
+
+
+
+
+
Ashley Taylor
+
+
+
Blogger
+
+
+
+
+
+
diff --git a/patterns/utility/app-store.php b/patterns/utility/app-store.php
new file mode 100644
index 0000000..686e942
--- /dev/null
+++ b/patterns/utility/app-store.php
@@ -0,0 +1,11 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/utility/browser.php b/patterns/utility/browser.php
new file mode 100644
index 0000000..32da935
--- /dev/null
+++ b/patterns/utility/browser.php
@@ -0,0 +1,34 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/utility/dark-mode-toggle.php b/patterns/utility/dark-mode-toggle.php
new file mode 100644
index 0000000..adfc294
--- /dev/null
+++ b/patterns/utility/dark-mode-toggle.php
@@ -0,0 +1,12 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/patterns/utility/google-play.php b/patterns/utility/google-play.php
new file mode 100644
index 0000000..e33078d
--- /dev/null
+++ b/patterns/utility/google-play.php
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/patterns/utility/icon-logo.php b/patterns/utility/icon-logo.php
new file mode 100644
index 0000000..bf19acf
--- /dev/null
+++ b/patterns/utility/icon-logo.php
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/patterns/utility/intro-notice.php b/patterns/utility/intro-notice.php
new file mode 100644
index 0000000..dd504d8
--- /dev/null
+++ b/patterns/utility/intro-notice.php
@@ -0,0 +1,15 @@
+
+
+
+
\ No newline at end of file
diff --git a/patterns/utility/search-toggle.php b/patterns/utility/search-toggle.php
new file mode 100644
index 0000000..3512b7f
--- /dev/null
+++ b/patterns/utility/search-toggle.php
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/phpunit.xml b/phpunit.xml
new file mode 100644
index 0000000..8f4b58c
--- /dev/null
+++ b/phpunit.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ ./tests
+
+
+
+
+ ./app
+ ./src
+
+
+
diff --git a/readme.txt b/readme.txt
index ea5683c..77fc3ba 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,8 +1,8 @@
=== Blockify ===
Contributors: blockify
-Requires at least: 6.1
-Tested up to: 6.2
-Stable tag: 1.2.7
+Requires at least: 6.2
+Tested up to: 6.4
+Stable tag: 1.3.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -45,10 +45,46 @@ Google Fonts
License: SIL Open Font License, 1.1
License URL: https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
+Images
+All images are licensed under the Creative Commons Zero (CC0) license.
+
+Avatars
+https://stocksnap.io/photo/young-man_CACAIXFZ2V.jpg
+https://stocksnap.io/photo/woman-urban_G4YYZSAXAT.jpg
+https://stocksnap.io/photo/woman-sunglasses_FRHAMZCZ2X.jpg
+https://stocksnap.io/photo/woman-business_X0XJR9QNN8.jpg
+https://stocksnap.io/photo/girl-portrait_LMKLOZE1TO.jpg
+
© Copyright Blockify 2023, Blockify.
== Changelog ==
+= 1.3.2 - 27 December 2023 =
+
+* Add: Text shadow controls
+* Fix: Icon performance
+
+= 1.3.1 - 8 November 2023 =
+
+* Remove: Use of `get_bloginfo( 'url' )` in favor of `home_url()`
+* Remove: #wpadminbar styling
+* Remove: Blog comments pattern
+
+= 1.3.0 - 8 November 2023 =
+
+* Add: Complete rebuild. See https://blockifywp.com/changelog for full details.
+
+= 1.2.9 - 8 May 2023 =
+
+* Add: Support for links in placeholder images
+
+= 1.2.8 - 22 April 2023 =
+
+* Fix: Pages list menu item width
+* Fix: Icon alignment for centered images
+* Update: Year template tag
+* Update: Page template main padding bottom
+
= 1.2.7 - 22 April 2023 =
* Add: Block gap support to page list block
@@ -362,7 +398,7 @@ License URL: https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
* Add: New settings UI
* Remove: Child theme json fix
* Fix: Placeholder border
-* Fix: Surface before psuedo element pointer events
+* Fix: Surface before pseudo-element pointer events
* Fix: Marquee block gap custom properties
= 0.9.18 - 21 November 2022 =
@@ -530,7 +566,7 @@ License URL: https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
* Fix: Remove id from nav menu in patterns
* Fix: Sub menu padding
* Fix: Template part inline css
-* Fix: Icon psuedo element bug in Gutenberg 14.3
+* Fix: Icon pseudo-element bug in Gutenberg 14.3
* Fix: Horizontal submenu padding on mobile
= 0.7.0 - 12 October 2022 =
diff --git a/screenshot.png b/screenshot.png
index 81e6ada..fab86bb 100644
Binary files a/screenshot.png and b/screenshot.png differ
diff --git a/src/api/block-extensions.tsx b/src/api/block-extensions.tsx
new file mode 100644
index 0000000..e53f59b
--- /dev/null
+++ b/src/api/block-extensions.tsx
@@ -0,0 +1,160 @@
+import { addFilter } from '@wordpress/hooks';
+import { createHigherOrderComponent } from '@wordpress/compose';
+import { toKebabCase } from '../utility/string';
+
+const blockSupports = window?.blockify?.blockSupports ?? {};
+
+export const supportsPosition = ( name: string ): boolean => blockSupports?.[ name ]?.blockifyPosition ?? false;
+
+const config: extensionOptions = window?.blockify?.extensionOptions ?? {};
+
+addFilter(
+ 'blocks.registerBlockType',
+ 'blockify/add-position-attributes',
+ ( props, name ): object => {
+ if ( supportsPosition( name ) ) {
+ const newAttributes: { [key: string]: object } = {};
+
+ Object.keys( config ).forEach( ( key ) => {
+ newAttributes[ key ] = {
+ type: 'object',
+ };
+ } );
+
+ props.attributes = {
+ ...props.attributes,
+ style: {
+ ...newAttributes,
+ ...( props?.attributes?.style ?? {} ),
+ },
+ };
+ }
+
+ return props;
+ },
+ 0
+);
+
+const getClasses = ( attributes: attributes ): string[] => {
+ const classes: string[] = [];
+ const style = attributes?.style ?? {};
+
+ Object.keys( config ).forEach( ( key: string ) => {
+ const property = toKebabCase( key );
+
+ if ( config?.[ key ]?.options ) {
+ if ( style?.[ key ]?.all ?? null ) {
+ classes.push( `has-${ property }-${ toKebabCase( style?.[ key ]?.all ?? '' ) }` );
+ }
+
+ if ( style?.[ key ]?.mobile ?? null ) {
+ classes.push( `has-${ property }-${ toKebabCase( style?.[ key ]?.mobile ?? '' ) }-mobile` );
+ }
+
+ if ( style?.[ key ]?.desktop ?? null ) {
+ classes.push( `has-${ property }-${ toKebabCase( style?.[ key ]?.desktop ?? '' ) }-desktop` );
+ }
+ } else if ( style?.[ key ] ?? null ) {
+ classes.push( `has-${ property }` );
+ }
+ } );
+
+ return classes;
+};
+
+const getStyles = ( attributes: attributes ): object => {
+ const styles: { [name: string]: string } = {};
+
+ const style = attributes?.style ?? {};
+
+ Object.keys( config ).forEach( ( key: string ) => {
+ if ( config?.[ key ]?.options ) {
+ return;
+ }
+
+ const property = toKebabCase( key );
+
+ if ( style?.[ key ]?.all ?? null ) {
+ styles[ `--${ property }` ] = style?.[ key ]?.all;
+ }
+
+ if ( style?.[ key ]?.mobile ?? null ) {
+ styles[ `--${ property }-mobile` ] = style?.[ key ]?.mobile;
+ }
+
+ if ( style?.[ key ]?.desktop ?? null ) {
+ styles[ `--${ property }-desktop` ] = style?.[ key ]?.desktop;
+ }
+ } );
+
+ return styles;
+};
+
+addFilter(
+ 'editor.BlockListBlock',
+ 'blockify/with-position-style',
+ createHigherOrderComponent( ( BlockListBlock ) => {
+ return ( props: blockProps ) => {
+ const { name, attributes } = props;
+
+ if ( ! supportsPosition( name ) ) {
+ return ;
+ }
+
+ const classes = getClasses( attributes );
+ const styles = getStyles( attributes );
+ const wrapperProps = props?.wrapperProps ?? {};
+
+ props = {
+ ...props,
+ style: { ...props?.style, ...styles },
+ };
+
+ if ( wrapperProps ) {
+ wrapperProps.style = { ...wrapperProps?.style, ...styles };
+ }
+
+ classes.forEach( ( className: string ) => {
+ if ( ! props?.className?.includes( className ) ) {
+ props.className = props?.className + ' ' + className;
+ }
+ } );
+
+ props.wrapperProps = wrapperProps;
+
+ return ;
+ };
+ }, 'withPositionStyle' )
+);
+
+addFilter(
+ 'blocks.getSaveContent.extraProps',
+ 'blockify/save-position-style',
+ ( props: blockProps ) => {
+ const { name, attributes } = props;
+
+ if ( ! blockSupports?.[ name ]?.blockifyPosition ) {
+ return props;
+ }
+
+ const classes = getClasses( attributes );
+ const styles = getStyles( attributes );
+
+ classes.forEach( ( className: string ) => {
+ if ( ! props?.className?.includes( className ) ) {
+ props.className = props?.className + ' ' + className;
+ }
+ } );
+
+ props = {
+ ...props,
+ style: {
+ ...props?.style,
+ ...styles,
+ },
+ };
+
+ return props;
+ },
+ 11
+);
diff --git a/src/api/block-styles.tsx b/src/api/block-styles.tsx
index 66f458d..e5336e4 100644
--- a/src/api/block-styles.tsx
+++ b/src/api/block-styles.tsx
@@ -18,10 +18,21 @@ domReady( () => {
} );
Object.keys( register ).forEach( ( blockName ) => {
- register[ blockName ].forEach( ( style ) => {
+ register[ blockName ].forEach( ( blockStyle ) => {
+ let name = '';
+ let label = '';
+
+ if ( typeof blockStyle === 'string' ) {
+ name = blockStyle;
+ label = ucWords( replaceAll( blockStyle, '-', ' ' ) );
+ } else {
+ name = Object.keys( blockStyle )[ 0 ];
+ label = Object.values( blockStyle )[ 0 ];
+ }
+
registerBlockStyle( blockName, {
- name: style,
- label: ucWords( replaceAll( style, '-', ' ' ) ),
+ name,
+ label,
} );
} );
} );
diff --git a/src/api/block-supports.tsx b/src/api/block-supports.tsx
index 1afa34c..05efd0c 100644
--- a/src/api/block-supports.tsx
+++ b/src/api/block-supports.tsx
@@ -1,8 +1,8 @@
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
-import { formatCustomProperty } from '../utility/css';
+import { formatCustomProperty } from '../utility';
-const blockSupports: { [ name: string ]: any } =
+const blockSupports: { [name: string]: any } =
window?.blockify?.blockSupports ?? {};
addFilter(
@@ -37,75 +37,23 @@ addFilter(
}
);
-addFilter(
- 'blocks.registerBlockType',
- 'blockify/block-attributes-search',
- ( settings, name ) => {
- if ( name === 'core/search' ) {
- settings.attributes.style = {
- ...settings.attributes?.style,
- spacing: {
- ...settings.attributes?.style?.spacing,
- padding: {
- top: '1em',
- right: '1em',
- bottom: '1em',
- left: '2em',
- },
- },
- };
- }
-
- return settings;
- },
- 0
-);
-
-addFilter(
- 'editor.BlockEdit',
- 'blockify/with-search-padding-css',
- createHigherOrderComponent( ( BlockEdit ) => {
- return ( props : blockProps ) => {
- if ( 'core/search' !== props.name ) {
- return ;
- }
-
- const searchInputs = document.getElementsByClassName(
- 'wp-block-search__input'
- ) as HTMLCollectionOf;
- const padding = props?.attributes?.style?.spacing?.padding;
-
- if ( searchInputs[ 0 ] && padding ) {
- if ( padding.top ) {
- searchInputs[ 0 ].style.paddingTop = padding?.top;
- }
-
- if ( padding.right ) {
- searchInputs[ 0 ].style.paddingRight = padding?.right;
- }
-
- if ( padding.bottom ) {
- searchInputs[ 0 ].style.paddingBottom = padding?.bottom;
- }
- if ( padding.left ) {
- searchInputs[ 0 ].style.paddingLeft = padding?.left;
- }
- }
-
- return ;
- };
- }, 'withSearchPaddingCss' )
-);
-
addFilter(
'editor.BlockListBlock',
'blockify/with-block-gap-css',
createHigherOrderComponent(
( BlockListBlock ) => {
return ( props: blockProps ) => {
+ const { name } = props;
+
+ const blocksWithBlockGap = [
+ 'core/page-list',
+ 'core/button',
+ 'core/post-author',
+ ];
+
const defaultReturn = ;
- if ( props.name !== 'core/page-list' ) {
+ if ( ! blocksWithBlockGap.includes( name ) ) {
return defaultReturn;
}
@@ -115,9 +63,12 @@ addFilter(
return defaultReturn;
}
- props.style = {
- ...props.style ?? {},
- '--wp--style--block-gap': formatCustomProperty( blockGap ),
+ props = {
+ ...props,
+ style: {
+ ...props.style ?? {},
+ '--wp--style--block-gap': formatCustomProperty( blockGap ),
+ },
};
const wrapperProps = {
@@ -135,3 +86,23 @@ addFilter(
)
);
+addFilter(
+ 'blocks.getSaveContent.extraProps',
+ 'blockify/with-no-spacer-height',
+ ( extraProps, blockType, attributes ) => {
+ if ( blockType.name !== 'core/spacer' ) {
+ return extraProps;
+ }
+
+ const height = attributes?.height ?? '';
+
+ if ( ! height ) {
+ extraProps.style = {
+ ...extraProps.style,
+ height: '',
+ };
+ }
+
+ return extraProps;
+ }
+);
diff --git a/src/api/icon-store.tsx b/src/api/icon-store.tsx
index 79514f3..8dc410e 100644
--- a/src/api/icon-store.tsx
+++ b/src/api/icon-store.tsx
@@ -1,24 +1,24 @@
import { Reducer } from 'redux';
import apiFetch from '@wordpress/api-fetch';
-import { createReduxStore, register } from '@wordpress/data';
+import { createReduxStore, register, select } from '@wordpress/data';
-interface Icons {
+export interface Icons {
[set: string]: {
- [icon: string]: object;
+ [icon: string]: string;
};
}
-interface Action {
+export interface IconAction {
type: string;
path: string;
icons: Icons;
}
-interface State {
+export interface IconState {
icons: Icons;
}
-export const defaultState: State = {
+export const defaultIconState: IconState = {
icons: {
social: {},
wordpress: {},
@@ -40,9 +40,9 @@ const actions = {
},
};
-const reducer: Reducer = (
- state: State = defaultState,
- action: Action
+const reducer: Reducer = (
+ state: IconState = defaultIconState,
+ action: IconAction
) => {
switch ( action.type ) {
case 'SET_ICONS': {
@@ -58,32 +58,40 @@ const reducer: Reducer = (
};
const selectors = {
- getIcons( state: State ) {
+ getIcons( state: IconState ) {
const { icons } = state;
return icons;
},
};
const controls: { [key: string]: ( action: any ) => any } = {
- GET_ICONS( action: Action ) {
+ GET_ICONS( action: IconAction ) {
return apiFetch( { path: action.path } );
},
};
const resolvers = {
- *getIcons(): Generator<{ type: string; path: string }> {
+ * getIcons(): Generator<{ type: string; path: string }> {
const icons = yield actions.getIcons( '/blockify/v1/icons/' );
return actions.setIcons( icons );
},
};
-register(
- createReduxStore( 'blockify/icons', {
- reducer,
- actions,
- selectors,
- controls,
- resolvers,
- } )
-);
+export const iconStoreName = 'blockify/icons';
+
+if ( ! select( 'blockify/icons' )?.getIcons() ) {
+ register(
+ createReduxStore(
+ iconStoreName,
+ {
+ reducer,
+ actions,
+ selectors,
+ controls,
+ resolvers,
+ }
+ )
+ );
+}
+
diff --git a/src/block-extensions/animation.tsx b/src/block-extensions/animation.tsx
index 6e15a51..3e515e7 100644
--- a/src/block-extensions/animation.tsx
+++ b/src/block-extensions/animation.tsx
@@ -1,5 +1,4 @@
import {
- // eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalNumberControl as NumberControl,
Button,
Flex,
@@ -11,11 +10,10 @@ import {
import { __ } from '@wordpress/i18n';
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
-import { CSSProperties } from '@wordpress/element';
+import { CSSProperties } from 'react';
import { trash } from '@wordpress/icons';
import { ucWords } from '../utility/string';
-import { PauseIcon } from '../components/pause-icon';
-import { Label } from '../components/label';
+import { Label, PauseIcon, PlayIcon } from '../components';
import { InspectorControls } from '@wordpress/block-editor';
interface cssAnimation {
@@ -28,6 +26,7 @@ interface cssAnimation {
direction?: string | null;
fillMode?: string | null;
playState?: string | null;
+ offset?: string | null;
}
const timingFunctionOptions = [
@@ -80,7 +79,7 @@ addFilter(
0
);
-const getStyles = ( animation: style ): CSSProperties => {
+const getStyles = ( animation: cssAnimation ): CSSProperties => {
const styles: {
'--animation-event'?: string;
animationName?: string;
@@ -115,7 +114,7 @@ const getStyles = ( animation: style ): CSSProperties => {
if ( animation?.timingFunction ) {
styles.animationTimingFunction =
- animation?.timingFunction ?? 'ease-in-out';
+ animation?.timingFunction ?? 'ease-in-out';
}
if ( ! styles?.animationIterationCount ) {
@@ -135,7 +134,7 @@ addFilter(
createHigherOrderComponent( ( BlockListBlock ) => {
return ( props: blockProps ) => {
const { attributes } = props;
- const animation: style = attributes?.animation ?? {};
+ const animation: cssAnimation = attributes?.animation ?? {};
if ( ! animation || ! Object?.keys( animation )?.length ) {
return ;
@@ -168,7 +167,7 @@ addFilter(
'blocks.getSaveContent.extraProps',
'blockify/apply-animation-styles',
( props, block, attributes ) => {
- const animation: style = attributes?.animation ?? {};
+ const animation: cssAnimation = attributes?.animation ?? {};
if ( ! animation || ! Object?.keys( animation )?.length ) {
return props;
@@ -211,20 +210,10 @@ const Animation = ( { attributes, setAttributes }: blockProps ): JSX.Element =>
-
-
- )
+ animation?.playState === 'running' ? PauseIcon : PlayIcon
}
iconSize={ 10 }
onClick={ () => {
@@ -232,9 +221,7 @@ const Animation = ( { attributes, setAttributes }: blockProps ): JSX.Element =>
animation: {
...animation,
playState:
- animation?.playState === 'running'
- ? 'paused'
- : 'running',
+ animation?.playState === 'running' ? 'paused' : 'running',
},
} );
} }
@@ -295,7 +282,7 @@ const Animation = ( { attributes, setAttributes }: blockProps ): JSX.Element =>
animation: {
...animation,
event: value,
- iterationCount: value === 'infinite' ? '-1' : animation?.iterationCount === '-1' ? '1' : animation?.iterationCount,
+ iterationCount: ( value === 'infinite' ? '-1' : animation?.iterationCount ) === '-1' ? '1' : animation?.iterationCount,
},
} );
} }
@@ -319,7 +306,7 @@ const Animation = ( { attributes, setAttributes }: blockProps ): JSX.Element =>
min={ 0 }
max={ 100 }
step={ 0.1 }
- shifStep={ 10 }
+ shiftStep={ 10 }
allowReset={ true }
/>
@@ -338,12 +325,12 @@ const Animation = ( { attributes, setAttributes }: blockProps ): JSX.Element =>
min={ 0 }
max={ 100 }
step={ 0.1 }
- shifStep={ 10 }
+ shiftStep={ 10 }
allowReset={ true }
/>
-
- { animation?.event !== 'infinite' && (
+ { animation?.event !== 'infinite' && (
+
step={ 1 }
allowReset={ true }
/>
- ) }
-
+
+ ) }
+ { animation?.event === 'scroll' && (
+
+ {
+ setAttributes( {
+ animation: {
+ ...animation,
+ offset: value.toString(),
+ },
+ } );
+ } }
+ min={ -1 }
+ max={ 200 }
+ step={ 1 }
+ allowReset={ true }
+ />
+
+ ) }
>
diff --git a/src/block-extensions/content-limit.tsx b/src/block-extensions/content-limit.tsx
new file mode 100644
index 0000000..5ae6ecc
--- /dev/null
+++ b/src/block-extensions/content-limit.tsx
@@ -0,0 +1,152 @@
+import { __ } from '@wordpress/i18n';
+import { addFilter } from '@wordpress/hooks';
+import { createHigherOrderComponent } from '@wordpress/compose';
+import { InspectorControls } from '@wordpress/block-editor';
+import {
+ __experimentalNumberControl as NumberControl,
+ PanelBody,
+ PanelRow,
+ TextareaControl,
+ ToggleControl,
+} from '@wordpress/components';
+import { replaceAll } from '../utility';
+import { addClassName } from '../utility/css';
+
+addFilter(
+ 'blocks.registerBlockType',
+ 'blockify/content-limit-attributes',
+ ( props, name: string ): void => {
+ if ( name === 'core/post-excerpt' ) {
+ props = {
+ ...props,
+ attributes: {
+ ...props.attributes,
+ defaultExcerpt: {
+ type: 'string',
+ },
+ hideReadMore: {
+ type: 'boolean',
+ },
+ },
+ };
+ }
+
+ if ( name === 'core/post-content' ) {
+ props = {
+ ...props,
+ attributes: {
+ ...props.attributes,
+ contentLimit: {
+ type: 'number',
+ },
+ },
+ };
+ }
+
+ return props;
+ }
+);
+
+addFilter(
+ 'editor.BlockEdit',
+ 'blockify/with-content-limit-controls',
+ createHigherOrderComponent( ( BlockEdit: any ) => ( props: any ) => {
+ const { attributes, setAttributes, name } = props;
+
+ if ( name !== 'core/post-excerpt' && name !== 'core/post-content' ) {
+ return ;
+ }
+
+ return <>
+
+
+ { name === 'core/post-excerpt' && ( <>
+
+ {
+ setAttributes( { defaultExcerpt: value } );
+ } }
+ />
+
+
+ {
+ setAttributes( { hideReadMore: value } );
+ } }
+ />
+
+ >
+ ) }
+ { name === 'core/post-content' && ( <>
+
+ {
+ setAttributes( {
+ contentLimit: value,
+ } );
+ } }
+ />
+
+ >
+ ) }
+
+
+
+ >;
+ }, 'withContentLimitControls' )
+);
+
+addFilter(
+ 'editor.BlockListBlock',
+ 'blockify/with-content-limit',
+ createHigherOrderComponent(
+ ( BlockListBlock ) => ( props: blockProps ) => {
+ const { name, attributes } = props;
+
+ if ( name !== 'core/post-excerpt' ) {
+ return ;
+ }
+
+ if ( ! attributes?.hideReadMore ) {
+ return ;
+ }
+
+ const wrapperProps = props.wrapperProps ?? {};
+ const className = 'hide-read-more';
+
+ wrapperProps.className = addClassName( wrapperProps?.className, className );
+
+ return ;
+ },
+ 'withContentLimit'
+ )
+);
+
+addFilter(
+ 'blocks.getSaveContent.extraProps',
+ 'blockify/content-limit-save',
+ ( props: blockProps ) => {
+ const { name, attributes } = props;
+
+ if ( name === 'core/post-excerpt' && attributes?.hideReadMore ) {
+ const className = 'hide-read-more';
+
+ props.className = replaceAll( props?.className, className, '' ) + ' ' + className;
+ }
+
+ return props;
+ }
+);
diff --git a/src/block-extensions/details-icon.tsx b/src/block-extensions/details-icon.tsx
new file mode 100644
index 0000000..631ffec
--- /dev/null
+++ b/src/block-extensions/details-icon.tsx
@@ -0,0 +1,115 @@
+import { __ } from '@wordpress/i18n';
+import { addFilter } from '@wordpress/hooks';
+import { createHigherOrderComponent } from '@wordpress/compose';
+import { InspectorControls } from '@wordpress/block-editor';
+import { Button, ButtonGroup, PanelBody, PanelRow } from '@wordpress/components';
+import { ucWords } from '../utility';
+import { addClassName } from '../utility/css';
+
+const iconTypes = [
+ 'chevron',
+ 'plus',
+];
+
+addFilter(
+ 'blocks.registerBlockType',
+ 'blockify/details-icon-attributes',
+ ( props, name: string ): void => {
+ if ( name === 'core/details' ) {
+ props = {
+ ...props,
+ attributes: {
+ ...props.attributes,
+ expandIcon: {
+ type: 'string',
+ },
+ closeOthers: {
+ type: 'boolean',
+ },
+ },
+ };
+ }
+
+ return props;
+ }
+);
+
+addFilter(
+ 'editor.BlockEdit',
+ 'blockify/with-details-icon-controls',
+ createHigherOrderComponent( ( BlockEdit: any ) => ( props: any ) => {
+ const { attributes, setAttributes, name } = props;
+
+ if ( name !== 'core/details' ) {
+ return ;
+ }
+
+ if ( ! attributes?.expandIcon ) {
+ attributes.expandIcon = 'chevron';
+ }
+
+ return <>
+
+
+
+
+ { iconTypes.map( ( iconType ) => (
+ setAttributes( { expandIcon: iconType } ) }
+ >
+ { ucWords( iconType ) }
+
+ ) ) }
+
+
+
+
+
+ >;
+ }, 'withExpandIconControls' )
+);
+
+addFilter(
+ 'editor.BlockListBlock',
+ 'blockify/with-details-icon',
+ createHigherOrderComponent(
+ ( BlockListBlock ) => ( props: blockProps ) => {
+ const { name, attributes } = props;
+
+ if ( name !== 'core/details' || ! attributes?.expandIcon ) {
+ return ;
+ }
+
+ const wrapperProps = props.wrapperProps ?? {};
+ const className = 'is-style-' + attributes.expandIcon;
+
+ wrapperProps.className = addClassName( wrapperProps?.className, className );
+
+ return ;
+ },
+ 'withExpandIcon'
+ )
+);
+
+addFilter(
+ 'blocks.getSaveContent.extraProps',
+ 'blockify/details-icon-save',
+ ( props: blockProps ) => {
+ const { name, attributes } = props;
+
+ if ( name !== 'core/details' || ! attributes?.expandIcon ) {
+ return props;
+ }
+
+ const className = 'is-style-' + attributes.expandIcon;
+
+ props.className = addClassName( props?.className, className );
+
+ return props;
+ }
+);
diff --git a/src/block-extensions/display.tsx b/src/block-extensions/display.tsx
index bb11e84..4e2df81 100644
--- a/src/block-extensions/display.tsx
+++ b/src/block-extensions/display.tsx
@@ -1,203 +1,239 @@
import { __ } from '@wordpress/i18n';
import {
- SelectControl,
- PanelRow,
- Flex,
- FlexItem,
- // @ts-ignore
- __experimentalUnitControl as UnitControl,
- // @ts-ignore
__experimentalNumberControl as NumberControl,
+ __experimentalUnitControl as UnitControl,
+ Button,
ButtonGroup,
- Button, PanelBody,
+ Flex,
+ FlexItem,
+ PanelBody,
+ PanelRow,
+ SelectControl,
} from '@wordpress/components';
-import { Label } from '../components/label';
import { useState } from '@wordpress/element';
import { desktop, mobile, trash } from '@wordpress/icons';
-import { ucWords } from '../utility/string';
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
import { InspectorControls } from '@wordpress/block-editor';
+import { Label } from '../components';
+import { unitsWithAuto } from '../utility';
+import { gridTypes } from '../block-variations/grid';
const blockSupports = window?.blockify?.blockSupports ?? {};
export const supportsDisplay = ( name: string ): boolean => blockSupports?.[ name ]?.blockifyPosition ?? false;
-const displayOptions = [
- '',
- 'none',
- 'block',
- 'inline-block',
- 'inline',
- 'flex',
- 'inline-flex',
- 'grid',
- 'inline-grid',
- 'contents',
-];
+interface DisplayAttributes {
+ style?: {
+ display?: responsiveStyles;
+ order?: responsiveStyles;
+ width?: responsiveStyles;
+ minWidth?: responsiveStyles;
+ maxWidth?: responsiveStyles;
+ };
+ layout?: {
+ type?: string;
+ flexWrap?: string;
+ orientation?: string;
+ };
+}
-const DisplayControl = ( props: blockProps, screen: string ) => {
- const { attributes, setAttributes } = props;
+interface DisplayProps {
+ attributes: DisplayAttributes;
+ setAttributes: ( attributes: DisplayAttributes ) => void;
+ screen: 'all' | 'mobile' | 'desktop';
+ isSelected: boolean;
+ name: string;
+}
+
+const DisplayControl = ( props: DisplayProps ) => {
+ const { attributes, setAttributes, screen } = props;
const { style } = attributes;
- return (
- <>
-
-
-
- {
- return {
- label: ucWords( option?.replace( '-', ' ' ) ),
- value: option,
- };
- } ) }
- onChange={ ( value: string ) => {
- setAttributes( {
- style: {
- ...style,
- display: {
- ...style?.display,
- [ screen ]: value,
- },
+ return <>
+
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ display: {
+ ...style?.display,
+ [ screen ]: value,
},
- } );
- } }
- />
-
-
- {
+ },
+ } );
+
+ if ( gridTypes.includes( value ) ) {
setAttributes( {
- style: {
- ...style,
- order: {
- ...style?.order,
- [ screen ]: value,
- },
+ layout: {
+ ...attributes?.layout,
+ type: 'flex',
+ flexWrap: 'nowrap',
+ orientation: 'grid',
},
} );
- } }
- min={ -10 }
- max={ 10 }
- step={ 1 }
- allowReset={ true }
- />
-
-
-
-
- {
+ } else {
setAttributes( {
- style: {
- ...style,
- width: {
- ...style?.width,
- [ screen ]: value,
- },
+ layout: {
+ ...attributes?.layout,
+ orientation: 'horizontal',
},
} );
- } }
- />
-
-
- {
- setAttributes( {
- style: {
- ...style,
- maxWidth: {
- ...style?.maxWidth,
- [ screen ]: value,
- },
+ }
+ } }
+ />
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ order: {
+ ...style?.order,
+ [ screen ]: value,
},
- } );
- } }
- />
-
-
-
-
- >
- );
+ },
+ } );
+ } }
+ min={ -10 }
+ max={ 10 }
+ step={ 1 }
+ allowReset={ true }
+ />
+
+
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ width: {
+ ...style?.width,
+ [ screen ]: value?.includes( 'auto' ) ? 'auto' : value,
+ },
+ },
+ } );
+ } }
+ />
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ minWidth: {
+ ...style?.minWidth,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ />
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ maxWidth: {
+ ...style?.maxWidth,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ />
+
+
+
+ >;
};
-const Display = ( props: blockProps ): JSX.Element => {
+const DisplayControls = ( props: DisplayProps ): JSX.Element => {
const { attributes, setAttributes } = props;
const [ screen, setScreen ] = useState( 'all' );
- return (
- <>
-
-
- <>
- { __( 'Display', 'blockify' ) }
- {
- setAttributes( {
- style: {
- ...attributes?.style,
- display: '',
- order: '',
- width: '',
- maxWidth: '',
- },
- } );
- } }
- icon={ trash }
- iconSize={ 16 }
- aria-label={ __( 'Reset Display', 'blockify' ) }
- />
- >
-
-
- setScreen( 'all' ) }
- >
- { __( 'All', 'blockify' ) }
-
- setScreen( 'mobile' ) }
- icon={ mobile }
- />
+ return <>
+
+
+ <>
+ { __( 'Display', 'blockify' ) }
setScreen( 'desktop' ) }
- icon={ desktop }
+ isDestructive
+ variant={ 'tertiary' }
+ onClick={ () => {
+ setAttributes( {
+ style: {
+ ...attributes?.style,
+ display: undefined,
+ order: undefined,
+ width: undefined,
+ maxWidth: undefined,
+ },
+ } );
+ } }
+ icon={ trash }
+ iconSize={ 16 }
+ aria-label={ __( 'Reset Display', 'blockify' ) }
/>
-
-
- { screen === 'all' && DisplayControl( props, screen ) }
- { screen === 'mobile' && DisplayControl( props, screen ) }
- { screen === 'desktop' && DisplayControl( props, screen ) }
- >
- );
+ >
+
+
+ setScreen( 'all' ) }
+ >
+ { __( 'All', 'blockify' ) }
+
+ setScreen( 'mobile' ) }
+ icon={ mobile }
+ />
+ setScreen( 'desktop' ) }
+ icon={ desktop }
+ />
+
+
+ { screen === 'all' && }
+ { screen === 'mobile' && }
+ { screen === 'desktop' && }
+ >;
};
addFilter(
'editor.BlockEdit',
'blockify/display-controls',
createHigherOrderComponent( ( BlockEdit ) => {
- return ( props: blockProps ) => {
+ return ( props: DisplayProps ) => {
const { attributes, isSelected, name } = props;
if ( ! supportsDisplay( name ) ) {
@@ -210,10 +246,10 @@ addFilter(
{ isSelected &&
0 ?? false }
title={ __( 'Display', 'blockify' ) }
- >
-
+ >
+
}
diff --git a/src/block-extensions/filter.tsx b/src/block-extensions/filter.tsx
index 837165c..3589618 100644
--- a/src/block-extensions/filter.tsx
+++ b/src/block-extensions/filter.tsx
@@ -1,8 +1,9 @@
import {
+ __experimentalNumberControl as NumberControl,
+ Button,
+ PanelBody,
PanelRow,
ToggleControl,
- // @ts-ignore
- __experimentalNumberControl as NumberControl, Button, PanelBody,
} from '@wordpress/components';
import { createHigherOrderComponent } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';
@@ -14,61 +15,7 @@ import { InspectorControls } from '@wordpress/block-editor';
const supportsFilter = ( name: string ): boolean => window?.blockify?.blockSupports?.[ name ]?.blockifyFilter ?? false;
-const config: {
- [name: string]: {
- unit: string,
- max: number,
- min?: number,
- step?: number,
- }
-} = {
- blur: {
- unit: 'px',
- min: 0,
- max: 500,
- },
- brightness: {
- unit: '%',
- min: 0,
- max: 360,
- },
- contrast: {
- unit: '%',
- min: 0,
- max: 200,
- },
- grayscale: {
- unit: '%',
- min: 0,
- max: 100,
- },
- hueRotate: {
- unit: 'deg',
- min: -360,
- max: 360,
- },
- invert: {
- unit: '%',
- min: 0,
- max: 100,
- },
- opacity: {
- unit: '%',
- min: 0,
- max: 100,
- },
- saturate: {
- unit: '',
- min: 0,
- max: 100,
- step: 0.1,
- },
- sepia: {
- unit: '%',
- min: 0,
- max: 100,
- },
-};
+const config: filterOptions | null = window?.blockify?.filterOptions ?? {};
addFilter(
'blocks.registerBlockType',
@@ -95,6 +42,10 @@ addFilter(
const getStyles = ( filter: cssFilters ): object => {
let styles = '';
+ if ( ! config?.blur ) {
+ return {};
+ }
+
Object.keys( config ).forEach( ( key ) => {
if ( Object.prototype.hasOwnProperty.call( filter, key ) && typeof filter[ key ] !== 'undefined' ) {
styles += ' ' + toKebabCase( key ) + '(' + filter[ key ] + config?.[ key ]?.unit + ')';
@@ -269,14 +220,14 @@ addFilter(
<>
{ isSelected &&
-
-
-
-
-
+
+
+
+
+
}
>
);
diff --git a/src/block-extensions/image.tsx b/src/block-extensions/image.tsx
new file mode 100644
index 0000000..89b297b
--- /dev/null
+++ b/src/block-extensions/image.tsx
@@ -0,0 +1,370 @@
+import { __ } from '@wordpress/i18n';
+import {
+ __experimentalUnitControl as UnitControl,
+ Button,
+ ButtonGroup,
+ Flex,
+ FlexItem,
+ PanelBody,
+ PanelRow,
+ SelectControl,
+} from '@wordpress/components';
+import { useState } from '@wordpress/element';
+import { desktop, mobile, trash } from '@wordpress/icons';
+import { addFilter } from '@wordpress/hooks';
+import { createHigherOrderComponent } from '@wordpress/compose';
+import { InspectorControls } from '@wordpress/block-editor';
+import { Label } from '../components';
+import { unitsWithAuto } from '../utility';
+
+export const supportsImage = ( name: string ): boolean => [ 'core/image', 'core/post-featured-image', [ 'blockify/image-compare' ] ].includes( name );
+export const supportsAspectRatio = ( name: string ): boolean => [ 'core/image', 'core/post-featured-image', 'blockify/image-compare' ].includes( name );
+
+addFilter(
+ 'blocks.registerBlockType',
+ 'blockify/image-attributes',
+ ( settings: any, name: string ) => {
+ if ( ! supportsImage( name ) ) {
+ return settings;
+ }
+
+ settings.attributes = {
+ ...settings.attributes,
+ ...{
+ usePlaceholder: {
+ type: 'string',
+ },
+ },
+ };
+
+ if ( ! settings?.attributes?.style ) {
+ settings.attributes.style = {
+ type: 'object',
+ };
+ }
+
+ return settings;
+ }
+);
+
+const ImageControl = ( props: blockProps, screen: string ) => {
+ const { attributes, setAttributes } = props;
+ const { style } = attributes;
+ const [ height, setHeight ] = useState( style?.height?.[ screen ] ?? '' );
+
+ const AspectRatio = () => {
+ return <>
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ aspectRatio: {
+ ...style?.aspectRatio,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ />
+
+
+ {
+ setHeight( {
+ ...height,
+ [ screen ]: value?.includes( 'auto' ) ? '' : value,
+ } );
+
+ setAttributes( {
+ style: {
+ ...style,
+ height: {
+ ...style?.height,
+ [ screen ]: value?.includes( 'auto' ) ? 'auto' : value,
+ },
+ },
+ } );
+ } }
+ min={ 0 }
+ step={ 1 }
+ units={ unitsWithAuto }
+ allowReset={ true }
+ />
+
+
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ objectFit: {
+ ...style?.objectFit,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ />
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ objectPosition: {
+ ...style?.objectPosition,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ />
+
+
+ >;
+ };
+
+ return
+ { supportsAspectRatio( props?.name ) &&
+
+ }
+
+ { __( 'Placeholder Image', 'blockify' ) }
+
+
+
+ {
+ setAttributes( {
+ usePlaceholder: 'default',
+ } );
+ } }
+ >
+ { __( 'Default', 'blockify' ) }
+
+ {
+ setAttributes( {
+ usePlaceholder: 'none',
+ } );
+ } }
+ >
+ { __( 'None', 'blockify' ) }
+
+
+
+ ;
+};
+
+const ImageControls = ( props: blockProps ): JSX.Element => {
+ const { attributes, setAttributes, name } = props;
+
+ if ( ! supportsImage( name ) ) {
+ return <>>;
+ }
+
+ const [ screen, setScreen ] = useState( 'all' );
+
+ return (
+ <>
+
+
+ <>
+ { __( 'Image', 'blockify' ) }
+ {
+ setAttributes( {
+ style: {
+ ...attributes?.style,
+ objectFit: null,
+ objectPosition: null,
+ aspectRatio: null,
+ height: null,
+ },
+ } );
+ } }
+ icon={ trash }
+ iconSize={ 16 }
+ aria-label={ __( 'Reset Image', 'blockify' ) }
+ />
+ >
+
+
+ setScreen( 'all' ) }
+ >
+ { __( 'All', 'blockify' ) }
+
+ setScreen( 'mobile' ) }
+ icon={ mobile }
+ />
+ setScreen( 'desktop' ) }
+ icon={ desktop }
+ />
+
+
+ { screen === 'all' && ImageControl( props, screen ) }
+ { screen === 'mobile' && ImageControl( props, screen ) }
+ { screen === 'desktop' && ImageControl( props, screen ) }
+ >
+ );
+};
+
+addFilter(
+ 'editor.BlockEdit',
+ 'blockify/image-controls',
+ createHigherOrderComponent( ( BlockEdit ) => {
+ return ( props: blockProps ) => {
+ const { attributes, isSelected, name } = props;
+
+ if ( ! supportsImage( name ) ) {
+ return ;
+ }
+
+ return (
+ <>
+
+ { isSelected &&
+
+
+
+
+
+ }
+ >
+ );
+ };
+ }, 'withImage' )
+);
+
+addFilter(
+ 'editor.BlockListBlock',
+ 'blockify/image-attribute',
+ createHigherOrderComponent( ( BlockListBlock ) => {
+ return ( props: blockProps ) => {
+ const { attributes, name } = props;
+
+ if ( ! supportsImage( name ) ) {
+ return ;
+ }
+
+ const classes = props?.className?.split( ' ' ) ?? [];
+
+ classes.push( 'is-placeholder' );
+ classes.push( 'has-placeholder-icon' );
+
+ const aspectRatio = attributes?.style?.aspectRatio ?? {};
+ const aspectRatioScreen = aspectRatio?.all ?? aspectRatio?.desktop ?? aspectRatio?.mobile ?? '';
+
+ if ( aspectRatioScreen ) {
+ classes.forEach( ( className: string ) => {
+ if ( className.includes( 'has-aspect-ratio-' ) ) {
+ classes.splice( classes.indexOf( className ), 1 );
+ }
+ } );
+
+ classes.push( `has-aspect-ratio-${ aspectRatioScreen }` );
+
+ props = {
+ ...props,
+ className: classes?.join( ' ' ) ?? '',
+ };
+ }
+
+ const objectFit = attributes?.style?.objectFit ?? {};
+ const objectFitScreen = objectFit?.all ?? objectFit?.desktop ?? objectFit?.mobile ?? '';
+
+ if ( objectFitScreen ) {
+ classes.forEach( ( className: string ) => {
+ if ( className.includes( 'has-object-fit-' ) ) {
+ classes.splice( classes.indexOf( className ), 1 );
+ }
+ } );
+
+ classes.push( `has-object-fit-${ objectFitScreen }` );
+
+ props = {
+ ...props,
+ className: classes?.join( ' ' ) ?? '',
+ };
+ }
+
+ const objectPosition = attributes?.style?.objectPosition ?? {};
+ const objectPositionScreen = objectPosition?.all ?? objectPosition?.desktop ?? objectPosition?.mobile ?? '';
+
+ if ( objectPositionScreen ) {
+ classes.forEach( ( className: string ) => {
+ if ( className.includes( 'has-object-position-' ) ) {
+ classes.splice( classes.indexOf( className ), 1 );
+ }
+ } );
+
+ classes.push( `has-object-position-${ objectPositionScreen }` );
+
+ props = {
+ ...props,
+ className: classes?.join( ' ' ) ?? '',
+ };
+ }
+
+ const height = attributes?.style?.height ?? {};
+ const heightScreen = height?.all ?? height?.desktop ?? height?.mobile ?? '';
+
+ if ( heightScreen ) {
+ const styles = props?.style ?? {};
+
+ styles.height = heightScreen;
+
+ props = {
+ ...props,
+ style: styles,
+ };
+ }
+
+ return (
+
+ );
+ };
+ }, 'withImageAttribute' )
+);
diff --git a/src/block-extensions/inline-css.tsx b/src/block-extensions/inline-css.tsx
new file mode 100644
index 0000000..47e252c
--- /dev/null
+++ b/src/block-extensions/inline-css.tsx
@@ -0,0 +1,73 @@
+import { __ } from '@wordpress/i18n';
+import { addFilter } from '@wordpress/hooks';
+import { createHigherOrderComponent } from '@wordpress/compose';
+import { InspectorAdvancedControls } from '@wordpress/block-editor';
+import { useSelect } from '@wordpress/data';
+import { CodeEditorModal } from '../components';
+
+const supportsInlineCss = ( name: string ): boolean => window?.blockify?.blockSupports?.[ name ]?.blockifyInlineCss ?? false;
+
+addFilter(
+ 'blocks.registerBlockType',
+ 'blockify/add-inline-css-attribute',
+ ( props, name ): object => {
+ if ( ! supportsInlineCss( name ) ) {
+ return props;
+ }
+
+ props.attributes = {
+ ...props.attributes,
+ inlineCss: {
+ type: 'string',
+ },
+ };
+
+ return props;
+ },
+ 0
+);
+
+addFilter(
+ 'editor.BlockEdit',
+ 'blockify/with-inline-css-attribute',
+ createHigherOrderComponent( ( BlockEdit ) => {
+ return ( props: blockProps ) => {
+ const { attributes, setAttributes, name } = props;
+
+ if ( ! supportsInlineCss( name ) ) {
+ return ;
+ }
+
+ const userRoles = useSelect( ( select: any ) => {
+ const currentUser: { id: number } = select( 'core' )?.getCurrentUser();
+ const user: { roles: string[] } = select( 'core' )?.getUser( currentUser?.id );
+
+ return user?.roles;
+ }, [] );
+
+ if ( ! userRoles?.includes( 'administrator' ) ) {
+ return ;
+ }
+
+ return (
+ <>
+
+
+ {
+ setAttributes( {
+ inlineCss: value,
+ } );
+ } }
+ title={ __( 'Edit Inline CSS', 'blockify' ) }
+ description={ __( 'Add custom CSS to this block.', 'blockify' ) }
+ />
+
+ >
+ );
+ };
+ }, 'inlineCssAttribute' ),
+ 99
+);
diff --git a/src/block-extensions/onclick.tsx b/src/block-extensions/onclick.tsx
index b2c901b..9c83b02 100644
--- a/src/block-extensions/onclick.tsx
+++ b/src/block-extensions/onclick.tsx
@@ -1,11 +1,9 @@
import { __ } from '@wordpress/i18n';
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
-import {
- InspectorAdvancedControls,
-} from '@wordpress/block-editor';
-import { TextareaControl } from '@wordpress/components';
-import { SelectorMap, useSelect } from '@wordpress/data';
+import { InspectorAdvancedControls } from '@wordpress/block-editor';
+import { useSelect } from '@wordpress/data';
+import { CodeEditorModal } from '../components';
const supportsOnclick = ( name: string ): boolean => window?.blockify?.blockSupports?.[ name ]?.blockifyOnclick ?? false;
@@ -40,7 +38,7 @@ addFilter(
return ;
}
- const userRoles = useSelect( ( select : SelectorMap ) => {
+ const userRoles = useSelect( ( select: any ) => {
const currentUser: { id: number } = select( 'core' )?.getCurrentUser();
const user: { roles: string[] } = select( 'core' )?.getUser( currentUser?.id );
@@ -55,22 +53,17 @@ addFilter(
<>
- setAttributes( {
- onclick: value?.replace( '"', "'" ),
- } ) }
- style={ {
- fontFamily: 'ui-monospace,Menlo,Monaco,Cascadia Code,Segoe UI Mono,Roboto Mono,Oxygen Mono,Ubuntu Monospace,Source Code Pro,Fira Code,Droid Sans Mono,DejaVu Sans Mono,Courier New,monospace',
- fontSize: '14px',
- tabSize: '1em',
- lineHeight: '1.5',
+ {
+ setAttributes( {
+ onclick: value,
+ } );
} }
+ title={ __( 'Edit On-Click Event', 'blockify' ) }
+ description={ __( 'Add custom JavaScript to the onclick event for this block.', 'blockify' ) }
/>
-
>
);
diff --git a/src/block-extensions/position.tsx b/src/block-extensions/position.tsx
index 932df5c..9574fd1 100644
--- a/src/block-extensions/position.tsx
+++ b/src/block-extensions/position.tsx
@@ -2,181 +2,32 @@ import { __ } from '@wordpress/i18n';
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
import {
- SelectControl,
- PanelRow,
- Flex,
- FlexItem,
- // eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalBoxControl as BoxControl,
- // eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalNumberControl as NumberControl,
+ Button,
ButtonGroup,
- Button, PanelBody,
+ Flex,
+ FlexItem,
+ PanelBody,
+ PanelRow,
+ SelectControl,
} from '@wordpress/components';
-import { Label } from '../components/label';
+import { Label } from '../components';
import { useState } from '@wordpress/element';
import { desktop, mobile, trash } from '@wordpress/icons';
-import { toKebabCase } from '../utility/string';
import { InspectorControls } from '@wordpress/block-editor';
const blockSupports = window?.blockify?.blockSupports ?? {};
export const supportsPosition = ( name: string ): boolean => blockSupports?.[ name ]?.blockifyPosition ?? false;
-const config: positionOptions = window?.blockify?.positionOptions ?? {};
-
-addFilter(
- 'blocks.registerBlockType',
- 'blockify/add-position-attributes',
- ( props, name ): object => {
- if ( supportsPosition( name ) ) {
- const newAttributes: { [ key: string ]: object } = {};
-
- Object.keys( config ).forEach( ( key ) => {
- newAttributes[ key ] = {
- type: 'object',
- };
- } );
-
- props.attributes = {
- ...props.attributes,
- style: {
- ...newAttributes,
- ...( props?.attributes?.style ?? {} ),
- },
- };
- }
-
- return props;
- },
- 0
-);
-
-const getClasses = ( attributes: attributes ): string[] => {
- const classes: string[] = [];
- const style = attributes?.style ?? {};
-
- Object.keys( config ).forEach( ( key: string ) => {
- const property = toKebabCase( key );
-
- if ( config?.[ key ]?.options ) {
- if ( style?.[ key ]?.all ?? null ) {
- classes.push( `has-${ property }-${ toKebabCase( style?.[ key ]?.all ) }` );
- }
-
- if ( style?.[ key ]?.mobile ?? null ) {
- classes.push( `has-${ property }-${ toKebabCase( style?.[ key ]?.mobile ) }-mobile` );
- }
-
- if ( style?.[ key ]?.desktop ?? null ) {
- classes.push( `has-${ property }-${ toKebabCase( style?.[ key ]?.desktop ) }-desktop` );
- }
- } else if ( style?.[ key ] ) {
- classes.push( `has-${ property }` );
- }
- } );
-
- return classes;
-};
-
-const getStyles = ( attributes: attributes ): object => {
- const styles: { [ name: string ]: string } = {};
-
- const style = attributes?.style ?? {};
-
- Object.keys( config ).forEach( ( key: string ) => {
- if ( config?.[ key ]?.options ) {
- return;
- }
-
- const property = toKebabCase( key );
-
- if ( style?.[ key ]?.all ?? null ) {
- styles[ `--${ property }` ] = style?.[ key ]?.all;
- }
-
- if ( style?.[ key ]?.mobile ?? null ) {
- styles[ `--${ property }-mobile` ] = style?.[ key ]?.mobile;
- }
-
- if ( style?.[ key ]?.desktop ?? null ) {
- styles[ `--${ property }-desktop` ] = style?.[ key ]?.desktop;
- }
- } );
-
- return styles;
-};
-
-addFilter(
- 'editor.BlockListBlock',
- 'blockify/with-position-style',
- createHigherOrderComponent( ( BlockListBlock ) => {
- return ( props: blockProps ) => {
- const { name, attributes } = props;
-
- if ( ! supportsPosition( name ) ) {
- return ;
- }
-
- const classes = getClasses( attributes );
- const styles = getStyles( attributes );
- const wrapperProps = props?.wrapperProps ?? {};
-
- props = {
- ...props,
- style: { ...props?.style, ...styles },
- };
-
- if ( wrapperProps ) {
- wrapperProps.style = { ...wrapperProps?.style, ...styles };
- }
-
- classes.forEach( ( className: string ) => {
- if ( ! props?.className?.includes( className ) ) {
- props.className = props?.className + ' ' + className;
- }
- } );
-
- props.wrapperProps = wrapperProps;
-
- return ;
- };
- }, 'withPositionStyle' )
-);
-
-addFilter(
- 'blocks.getSaveContent.extraProps',
- 'blockify/save-position-style',
- ( props: blockProps ) => {
- const { name, attributes } = props;
-
- if ( ! blockSupports?.[ name ]?.blockifyPosition ) {
- return props;
- }
-
- const classes = getClasses( attributes );
- const styles = getStyles( attributes );
-
- classes.forEach( ( className: string ) => {
- if ( ! props?.className?.includes( className ) ) {
- props.className = props?.className + ' ' + className;
- }
- } );
-
- props.style = { ...props?.style, ...styles };
-
- return props;
- },
- 11
-);
-
export const PositionControl = ( props: blockProps, screen: string ) => {
const { attributes, setAttributes } = props;
const style = attributes?.style ?? {};
- const setPosition = ( values: { [ property: string ]: string } ) => {
- const properties: { [ property: string ]: string } = {};
+ const setPosition = ( values: { [property: string]: string } ) => {
+ const properties: { [property: string]: string } = {};
Object.keys( values ).forEach( ( property: string ) => {
properties[ property ] = {
@@ -201,7 +52,7 @@ export const PositionControl = ( props: blockProps, screen: string ) => {
{
setPosition( { position: value } );
} }
@@ -209,7 +60,7 @@ export const PositionControl = ( props: blockProps, screen: string ) => {
{
setPosition( { zIndex: value } );
@@ -223,14 +74,13 @@ export const PositionControl = ( props: blockProps, screen: string ) => {
- { style?.position &&
{
setPosition( { overflow: value } );
} }
@@ -240,14 +90,14 @@ export const PositionControl = ( props: blockProps, screen: string ) => {
{
setPosition( { pointerEvents: value } );
} }
/>
- }
+
{
left: style?.left?.[ screen ] ?? '',
} }
onChange={ ( value: {
- top: string,
- right: string,
- bottom: string,
- left: string,
+ top: string;
+ right: string;
+ bottom: string;
+ left: string;
} ) => {
setPosition( {
top: value?.top ?? '',
@@ -299,12 +149,13 @@ export const Position = ( props: blockProps ): JSX.Element => {
setAttributes( {
style: {
...attributes?.style,
- position: '',
- zIndex: '',
- top: '',
- right: '',
- bottom: '',
- left: '',
+ position: undefined,
+ zIndex: undefined,
+ top: undefined,
+ right: undefined,
+ bottom: undefined,
+ left: undefined,
+ overflow: undefined,
},
} );
} }
@@ -362,7 +213,7 @@ addFilter(
+ >
diff --git a/src/block-extensions/query-spacing.tsx b/src/block-extensions/query-spacing.tsx
index 74974cc..693bccc 100644
--- a/src/block-extensions/query-spacing.tsx
+++ b/src/block-extensions/query-spacing.tsx
@@ -1,25 +1,25 @@
import { createHigherOrderComponent } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';
-import { CSSProperties } from '@wordpress/element';
+import { CSSProperties } from 'react';
+import { formatCustomProperty } from '../utility';
addFilter(
'editor.BlockListBlock',
'blockify/with-block-gap',
createHigherOrderComponent(
( BlockListBlock ) => ( props: blockProps ) => {
- if ( props?.name !== 'core/query' ) {
+ if ( props?.name !== 'core/post-template' ) {
return ;
}
if ( ! props?.attributes?.style?.spacing?.blockGap ) {
return ;
}
-
const wrapperProps = props.wrapperProps ?? {};
wrapperProps.style = {
...wrapperProps.style,
- '--wp--style--block-gap': props.attributes.style.spacing.blockGap,
+ '--wp--style--block-gap': formatCustomProperty( props.attributes.style.spacing.blockGap ),
} as CSSProperties;
return ;
@@ -32,10 +32,13 @@ addFilter(
'blocks.getSaveContent.extraProps',
'blockify/apply-block-gap',
( props, blockType: string, attributes ): object => {
- if ( blockType === 'core/query' && attributes?.style?.spacing?.blockGap ) {
- props.style = {
- ...props.style,
- '--wp--style--block-gap': attributes.style.spacing.blockGap,
+ if ( blockType === 'core/post-template' && attributes?.style?.spacing?.blockGap ) {
+ props = {
+ ...props,
+ style: {
+ ...props.style,
+ '--wp--style--block-gap': formatCustomProperty( attributes.style.spacing.blockGap ),
+ },
};
}
diff --git a/src/block-extensions/search-input.tsx b/src/block-extensions/search-input.tsx
new file mode 100644
index 0000000..0489648
--- /dev/null
+++ b/src/block-extensions/search-input.tsx
@@ -0,0 +1,162 @@
+import { addFilter } from '@wordpress/hooks';
+import { createHigherOrderComponent } from '@wordpress/compose';
+import {
+ __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
+ __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
+ InspectorControls,
+} from '@wordpress/block-editor';
+import { __ } from '@wordpress/i18n';
+import {
+ getColorSlugFromValue,
+ getColorValueFromSlug,
+} from '../utility/color.tsx';
+
+addFilter(
+ 'blocks.registerBlockType',
+ 'blockify/search-input-colors',
+ ( settings, name ) => {
+ if ( name !== 'core/search' ) {
+ return settings;
+ }
+
+ settings.attributes = {
+ ...settings.attributes,
+ inputBackgroundColor: {
+ type: 'string',
+ },
+ };
+
+ return settings;
+ }
+);
+
+addFilter(
+ 'editor.BlockEdit',
+ 'blockify/search-input-colors',
+ createHigherOrderComponent(
+ ( BlockEdit ) => {
+ return ( props: any ) => {
+ const defaultReturn = ;
+
+ const colorGradientSettings = useMultipleOriginColorsAndGradients();
+
+ if ( props.name !== 'core/search' ) {
+ return defaultReturn;
+ }
+
+ const {
+ attributes,
+ setAttributes,
+ clientId,
+ } = props;
+
+ const {
+ inputBackgroundColor,
+ } = attributes;
+
+ const settings = [ {
+ label: __( 'Input Background', 'blockify' ),
+ colorValue: ( typeof inputBackgroundColor === 'string' && inputBackgroundColor?.includes( '-' ) ) ? getColorValueFromSlug( inputBackgroundColor ) : inputBackgroundColor,
+ onColorChange: ( value: string ) => {
+ const slug = getColorSlugFromValue( value );
+
+ setAttributes( {
+ inputBackgroundColor: slug ? slug : value,
+ } );
+ },
+ } ];
+
+ return (
+ <>
+
+
+
+
+ >
+ );
+ };
+ },
+ 'withSearchInputColors'
+ )
+);
+
+addFilter(
+ 'editor.BlockListBlock',
+ 'blockify/search-input-colors',
+ createHigherOrderComponent(
+ ( BlockListBlock ) => {
+ return ( props: any ) => {
+ const defaultReturn = ;
+
+ if ( props.name !== 'core/search' ) {
+ return defaultReturn;
+ }
+
+ const {
+ attributes,
+ wrapperProps = {},
+ } = props;
+
+ const {
+ inputBackgroundColor,
+ borderColor,
+ } = attributes;
+
+ if ( inputBackgroundColor ) {
+ const colorValue = inputBackgroundColor?.includes( '-' ) ? `var(--wp--preset--color--${ inputBackgroundColor })` : inputBackgroundColor;
+
+ wrapperProps.style = {
+ ...wrapperProps.style,
+ '--wp--custom--input--background': colorValue,
+ };
+ }
+
+ if ( borderColor ) {
+ const colorValue = borderColor?.includes( '-' ) ? `var(--wp--preset--color--${ borderColor })` : borderColor;
+
+ wrapperProps.style = {
+ ...wrapperProps.style,
+ '--wp--custom--input--border': `var(--wp--custom--border--width,1px) var(--wp--custom--border--style,solid) ${ colorValue }`,
+ };
+ }
+
+ return ;
+ };
+ },
+ 'withSearchInputColors'
+ )
+);
+
+addFilter(
+ 'blocks.getSaveContent.extraProps',
+ 'blockify/search-input-colors',
+ ( extraProps, blockType, attributes ) => {
+ if ( blockType.name !== 'core/search' ) {
+ return extraProps;
+ }
+
+ const {
+ inputBackgroundColor,
+ } = attributes;
+
+ if ( inputBackgroundColor ) {
+ const colorValue = inputBackgroundColor?.includes( '-' ) ? `var(--wp--preset--color--${ inputBackgroundColor })` : inputBackgroundColor;
+
+ extraProps.style = {
+ ...extraProps.style,
+ '--wp--custom--input--background': colorValue,
+ };
+ }
+
+ return extraProps;
+ }
+);
diff --git a/src/block-extensions/shadow.tsx b/src/block-extensions/shadow.tsx
index b304ad4..1b3472a 100644
--- a/src/block-extensions/shadow.tsx
+++ b/src/block-extensions/shadow.tsx
@@ -1,31 +1,30 @@
import { __ } from '@wordpress/i18n';
import { createHigherOrderComponent } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';
-import {
- PanelRow,
- Flex,
- FlexItem,
- ToggleControl,
- // eslint-disable-next-line @wordpress/no-unsafe-wp-apis
- __experimentalNumberControl as NumberControl,
- ButtonGroup,
- Button,
- PanelBody,
-} from '@wordpress/components';
-
-import {
- // eslint-disable-next-line @wordpress/no-unsafe-wp-apis
- __experimentalPanelColorGradientSettings as PanelColorGradientSettings,
- InspectorControls,
-} from '@wordpress/block-editor';
-import { ucWords } from '../utility/string';
-import { Label } from '../components/label';
-import { useState } from '@wordpress/element';
-import { trash } from '@wordpress/icons';
+import { PanelBody } from '@wordpress/components';
+import { EditorColor, InspectorControls } from '@wordpress/block-editor';
+import { BoxShadowControl } from '../components';
+import { addClassName } from '../utility/css';
+import { select } from '@wordpress/data';
export const supportsShadow = ( name: string ): boolean =>
window?.blockify?.blockSupports?.[ name ]?.blockifyBoxShadow ?? false;
+interface BoxShadowValues {
+ [key: string]: string | number | boolean | undefined | BoxShadowValues;
+
+ inset?: boolean;
+ x?: number;
+ y?: number;
+ blur?: number;
+ spread?: number;
+ color?: string;
+}
+
+interface BoxShadow extends BoxShadowValues {
+ hover?: BoxShadowValues;
+}
+
addFilter(
'blocks.registerBlockType',
'blockify/add-box-shadow-attributes',
@@ -33,11 +32,23 @@ addFilter(
if ( supportsShadow( name ) ) {
props.attributes = {
...props.attributes,
+ shadowPreset: {
+ type: 'string',
+ },
+ shadowPresetHover: {
+ type: 'string',
+ },
+ useCustomBoxShadow: {
+ type: 'boolean',
+ },
style: {
...( props?.attributes?.style ?? {} ),
boxShadow: {
type: 'object',
},
+ textShadow: {
+ type: 'object',
+ },
},
};
}
@@ -47,12 +58,20 @@ addFilter(
0
);
-const getStyles = ( attributes: attributes ): style => {
- const boxShadow = attributes?.style?.boxShadow ?? {};
+const getStyles = ( attributes: {
+ style?: {
+ boxShadow?: BoxShadow;
+ textShadow?: BoxShadow;
+ };
+} ): genericStrings => {
+ const boxShadow: BoxShadow = attributes?.style?.boxShadow ?? {};
+ const textShadow: BoxShadow = attributes?.style?.textShadow ?? {};
+
+ const style: genericStrings = {};
- const style: { [key: string]: string } = {};
+ const colorPalette: EditorColor[] = select( 'core/block-editor' ).getSettings().colors ?? [];
- const units: { [property: string]: string } = {
+ const properties: { [property: string]: string } = {
inset: '',
x: 'px',
y: 'px',
@@ -61,137 +80,35 @@ const getStyles = ( attributes: attributes ): style => {
color: '',
};
- Object.keys( units ).map( ( key: string ) => {
- if ( boxShadow?.[ key ] || boxShadow?.[ key ]?.toString() === '0' ) {
- style[ '--wp--custom--box-shadow--' + key ] =
- boxShadow?.[ key ] + units?.[ key ];
+ const textProperties: { [property: string]: string } = {
+ x: 'px',
+ y: 'px',
+ blur: 'px',
+ color: '',
+ };
+
+ Object.keys( properties ).map( ( property: string ) => {
+ if ( boxShadow?.[ property ] || boxShadow?.[ property ]?.toString() === '0' ) {
+ style[ '--wp--custom--box-shadow--' + property ] = boxShadow?.[ property ] + properties?.[ property ];
}
if (
- boxShadow?.hover?.[ key ] ||
- boxShadow?.hover?.[ key ]?.toString() === '0'
+ boxShadow?.hover?.[ property ] ||
+ boxShadow?.hover?.[ property ]?.toString() === '0'
) {
- style[ '--wp--custom--box-shadow--hover--' + key ] =
- boxShadow?.hover?.[ key ] + units?.[ key ];
+ style[ '--wp--custom--box-shadow--hover--' + property ] = boxShadow?.hover?.[ property ] + properties?.[ property ];
}
return true;
} );
- return style;
-};
-
-const BoxShadowControl = ( props: blockProps, tab: string ): JSX.Element => {
- const { attributes, setAttributes } = props;
- const { style } = attributes;
-
- const boxShadow = style?.boxShadow ?? {};
-
- const setBoxShadow = ( values: { [property: string]: string | boolean } ) => {
- let newAttributes;
-
- if ( tab === 'default' ) {
- newAttributes = {
- ...values,
- };
- } else {
- newAttributes = {
- hover: {
- ...boxShadow?.hover,
- ...values,
- },
- };
+ Object.keys( textProperties ).map( ( property: string ) => {
+ if ( textShadow?.[ property ] || textShadow?.[ property ]?.toString() === '0' ) {
+ style[ '--wp--custom--text-shadow--' + property ] = textShadow?.[ property ] + textProperties?.[ property ];
}
+ } );
- setAttributes( {
- style: {
- ...style,
- boxShadow: {
- ...boxShadow,
- ...newAttributes,
- },
- },
- } );
- };
-
- return (
- <>
-
-
- { [ 'x', 'y', 'blur', 'spread' ].map( ( key ) => (
-
- {
- setBoxShadow( {
- [ key ]: value,
- } );
- } }
- />
-
- ) ) }
-
-
-
-
-
-
-
- {
- setBoxShadow( {
- color: value,
- } );
- },
- },
- ] }
- />
-
-
- {
- setBoxShadow( {
- inset: value ? 'inset' : '',
- } );
- } }
- />
-
-
-
- >
- );
+ return style;
};
addFilter(
@@ -206,25 +123,47 @@ addFilter(
}
const styles = getStyles( attributes );
+ const hasPreset = attributes?.shadowPreset || attributes?.shadowPresetHover;
+ const hasTextShadow = Object.keys( attributes?.style?.textShadow ?? {} ).length > 0;
- if ( ! Object.keys( styles ).length ) {
+ if ( ! hasPreset && ! Object.keys( styles ).length ) {
return ;
}
const wrapperProps = { ...props.wrapperProps };
- const className = ( props?.className ?? '' ) + ' has-box-shadow';
+ let className = props.className;
+
+ className = addClassName( className, wrapperProps.className );
+
+ className = addClassName( className, 'has-box-shadow' );
+
+ if ( hasPreset ) {
+ className = addClassName( className, 'has-shadow' ).replace( 'has-box-shadow', '' );
+ }
+
+ if ( hasTextShadow ) {
+ className = addClassName( className, 'has-text-shadow' );
+ }
+
+ if ( attributes?.shadowPreset ) {
+ className = addClassName( className, `has-${ attributes.shadowPreset }-shadow` );
+ }
+
+ if ( attributes?.shadowPresetHover ) {
+ className = addClassName( className, `has-${ attributes.shadowPresetHover }-shadow-hover` );
+ }
props = {
...props,
- className,
+ className: addClassName( props?.className, className ),
style: {
...props.style,
...styles,
},
};
- wrapperProps.className += ' has-box-shadow';
+ wrapperProps.className = className;
wrapperProps.style = {
...wrapperProps.style,
@@ -248,70 +187,55 @@ addFilter(
const styles = getStyles( attributes );
- if ( ! Object.keys( styles ).length ) {
+ const hasPreset = attributes?.shadowPreset || attributes?.shadowPresetHover;
+ const hasTextShadow = Object.keys( attributes?.style?.textShadow ?? {} ).length > 0;
+
+ if ( ! hasPreset && ! Object.keys( styles ).length ) {
return props;
}
- props.className += ' has-box-shadow';
+ let className = addClassName( props?.className, 'has-box-shadow' );
+
+ if ( hasTextShadow ) {
+ className = addClassName( className, 'has-text-shadow' );
+ }
- props.style = {
- ...props.style,
- ...styles,
+ if ( hasPreset ) {
+ className = addClassName( className, 'has-shadow' ).replace( 'has-box-shadow', '' );
+ }
+
+ if ( attributes?.shadowPreset ) {
+ className = addClassName( className, `has-${ attributes.shadowPreset }-shadow` );
+ }
+
+ if ( attributes?.shadowPresetHover ) {
+ className = addClassName( className, `has-${ attributes.shadowPresetHover }-shadow-hover` );
+ }
+
+ props = {
+ ...props,
+ style: {
+ ...props.style,
+ ...styles,
+ },
+ className,
};
return props;
}
);
-export const Shadow = ( props: blockProps ): JSX.Element => {
- const { attributes, setAttributes } = props;
- const [ tab, setTab ] = useState( 'default' );
-
- return (
- <>
-
-
- <>
- { __( 'Shadow', 'blockify' ) }
- {
- setAttributes( {
- style: {
- ...attributes?.style,
- boxShadow: '',
- },
- } );
- } }
- icon={ trash }
- iconSize={ 16 }
- aria-label={ __( 'Clear Shadow', 'blockify' ) }
- />
- >
-
-
- setTab( 'default' ) }
- >
- { __( 'Default', 'blockify' ) }
-
- setTab( 'hover' ) }
- >
- { __( 'Hover', 'blockify' ) }
-
-
-
- { tab === 'default' && BoxShadowControl( props, tab ) }
- { tab === 'hover' && BoxShadowControl( props, tab ) }
- >
- );
+export const ShadowControls = ( props: blockProps ): JSX.Element => {
+ return
+
+
+
+ ;
};
addFilter(
@@ -319,7 +243,7 @@ addFilter(
'blockify/shadow-controls',
createHigherOrderComponent( ( BlockEdit ) => {
return ( props: blockProps ) => {
- const { attributes, isSelected, name } = props;
+ const { isSelected, name } = props;
if ( ! supportsShadow( name ) ) {
return ;
@@ -329,14 +253,7 @@ addFilter(
<>
{ isSelected && (
-
-
-
-
-
+
) }
>
);
diff --git a/src/block-extensions/size.tsx b/src/block-extensions/size.tsx
new file mode 100644
index 0000000..44a2744
--- /dev/null
+++ b/src/block-extensions/size.tsx
@@ -0,0 +1,161 @@
+import { __ } from '@wordpress/i18n';
+import { BlockControls } from '@wordpress/block-editor';
+import { createHigherOrderComponent } from '@wordpress/compose';
+import {
+ DropdownMenu,
+ MenuGroup,
+ MenuItem,
+ ToolbarGroup,
+} from '@wordpress/components';
+import { Fragment } from '@wordpress/element';
+import { addFilter } from '@wordpress/hooks';
+import { replaceAll } from '../utility';
+import { addClassName } from '../utility/css';
+
+const blockSupports = window?.blockify?.blockSupports ?? {};
+
+export const supportsSize = ( name: string ): boolean => blockSupports?.[ name ]?.blockifySize ?? false;
+
+const Controls = ( props: any ) => {
+ const { attributes, setAttributes } = props;
+ const { size } = attributes;
+
+ const sizes = [
+ {
+ key: 'large',
+ label: __( 'Large', 'blockify' ),
+ },
+ {
+ key: 'medium',
+ label: __( 'Medium', 'blockify' ),
+ },
+ {
+ key: 'small',
+ label: __( 'Small', 'blockify' ),
+ },
+ ];
+
+ return
+
+ { __( 'Size', 'blockify' ) } }
+ label={ __( 'Switch Size', 'blockify' ) }
+ >
+ { ( { onClose } ) => (
+
+ { sizes.map( ( sizeData ) => (
+ {
+ if ( size === sizeData.key ) {
+ setAttributes( {
+ size: '',
+ } );
+ onClose();
+
+ return;
+ }
+
+ setAttributes( {
+ size: sizeData.key,
+ } );
+ onClose();
+ } }
+ >
+ { sizeData.label }
+
+ ) ) }
+
+ ) }
+
+
+ ;
+};
+
+addFilter(
+ 'blocks.registerBlockType',
+ 'blockify/add-size-attribute',
+ ( settings: any ) => {
+ if ( settings?.attributes && supportsSize( settings?.name ) ) {
+ settings.attributes = {
+ ...settings.attributes,
+ size: {
+ type: 'string',
+ default: '20px',
+ },
+ };
+ }
+
+ return settings;
+ }
+);
+
+addFilter(
+ 'editor.BlockEdit',
+ 'blockify/add-size-block-controls',
+ createHigherOrderComponent( ( BlockEdit: any ) => {
+ return ( props: blockProps ) => {
+ const { name, isSelected } = props;
+
+ if ( ! supportsSize( name ) ) {
+ return ;
+ }
+
+ return (
+
+ { isSelected && }
+
+
+ );
+ };
+ }, 'addSizeBlockControls' )
+);
+
+addFilter(
+ 'editor.BlockListBlock',
+ 'blockify/with-size',
+ createHigherOrderComponent(
+ ( BlockListBlock ) => ( props: blockProps ) => {
+ const { name, attributes } = props;
+
+ if ( ! supportsSize( name ) ) {
+ return ;
+ }
+
+ if ( ! attributes?.size ) {
+ return ;
+ }
+
+ const wrapperProps = props.wrapperProps ?? {};
+ const className = 'is-style-' + attributes.size;
+
+ wrapperProps.className = addClassName( wrapperProps?.className, className );
+
+ return ;
+ },
+ 'withSizeClass'
+ )
+);
+
+addFilter(
+ 'blocks.getSaveContent.extraProps',
+ 'blockify/size-save',
+ ( props: blockProps ) => {
+ const { name, attributes } = props;
+
+ if ( supportsSize( name ) && attributes?.size ) {
+ const className = 'is-style-' + attributes.size;
+
+ props.className = replaceAll( props?.className, className, '' ) + ' ' + className;
+ }
+
+ return props;
+ }
+);
diff --git a/src/block-extensions/transform.tsx b/src/block-extensions/transform.tsx
index 70236ca..cf56c20 100644
--- a/src/block-extensions/transform.tsx
+++ b/src/block-extensions/transform.tsx
@@ -1,23 +1,26 @@
import {
- // @ts-ignore
- __experimentalUnitControl as UnitControl,
- // @ts-ignore
__experimentalNumberControl as NumberControl,
+ __experimentalUnitControl as UnitControl,
+ Button,
+ ButtonGroup,
Flex,
- FlexItem, PanelRow, Button, PanelBody,
+ FlexItem,
+ PanelBody,
+ PanelRow,
} from '@wordpress/components';
import { createHigherOrderComponent } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';
import { __ } from '@wordpress/i18n';
import { Label } from '../components/label';
import { trash } from '@wordpress/icons';
-import { CSSProperties } from 'react';
import { InspectorControls } from '@wordpress/block-editor';
+import { useState } from '@wordpress/element';
+import { addClassName } from '../utility/css.tsx';
export const supportsTransform = ( name: string ): boolean => window?.blockify?.blockSupports?.[ name ]?.blockifyTransform ?? false;
interface transformTypes {
- [name: string]: string
+ [name: string]: string;
}
const transformTypes: transformTypes = {
@@ -50,6 +53,9 @@ addFilter(
transform: {
type: 'string',
},
+ transformHover: {
+ type: 'string',
+ },
},
};
@@ -57,20 +63,45 @@ addFilter(
}
);
-const getStyles = ( transform: { [name: string]: string } ): CSSProperties => {
- let styles = '';
+const getStyles = (
+ transformDefault: {
+ [name: string]: string;
+ },
+ transformHover: {
+ [name: string]: string;
+ }
+): {
+ [name: string]: string;
+} => {
+ const styles: {
+ [name: string]: string;
+ } = {};
+ let defaultStyles = '';
+ let hoverStyles = '';
Object.keys( transformTypes ).forEach( ( type: string ) => {
- if ( transform?.[ type ] ) {
- const amount = transform[ type ];
+ if ( transformDefault?.[ type ] ) {
+ const amount = transformDefault[ type ];
const unit = transformTypes[ type ];
- styles += ` ${ type }(${ amount }${ unit })`;
+ defaultStyles += ` ${ type }(${ amount }${ unit })`;
+ }
+
+ if ( transformHover?.[ type ] ) {
+ const amount = transformHover[ type ];
+ const unit = transformTypes[ type ];
+ hoverStyles += ` ${ type }(${ amount }${ unit })`;
}
} );
- return styles ? {
- transform: styles.trim(),
- } : {};
+ if ( defaultStyles ) {
+ styles[ '--transform' ] = defaultStyles.trim();
+ }
+
+ if ( hoverStyles ) {
+ styles[ '--transform-hover' ] = hoverStyles.trim();
+ }
+
+ return styles ?? {};
};
addFilter(
@@ -87,13 +118,14 @@ addFilter(
}
const { style } = attributes;
- const transform = style?.transform ?? {};
+ const transformDefault = style?.transform ?? {};
+ const transformHover = style?.transformHover ?? {};
- if ( ! transform ) {
+ if ( ! transformDefault && ! transformHover ) {
return defaultReturn;
}
- const styles: CSSProperties = getStyles( transform );
+ const styles = getStyles( transformDefault, transformHover );
if ( ! Object.keys( styles ).length ) {
return defaultReturn;
@@ -105,6 +137,7 @@ addFilter(
...props?.style,
...styles,
},
+ className: addClassName( props?.className, 'has-transform' ),
};
const wrapperProps = {
@@ -113,6 +146,7 @@ addFilter(
...props.wrapperProps?.style,
...styles,
},
+ className: addClassName( props?.wrapperProps?.className, 'has-transform' ),
};
return ;
@@ -133,13 +167,14 @@ addFilter(
}
const { style } = attributes;
- const transform = style?.transform ?? {};
+ const transformDefault = style?.transform ?? {};
+ const transformHover = style?.transformHover ?? {};
- if ( ! transform ) {
+ if ( ! transformDefault && ! transformHover ) {
return props;
}
- const styles = getStyles( transform );
+ const styles = getStyles( transformDefault, transformHover );
if ( ! Object.keys( styles ).length ) {
return props;
@@ -151,6 +186,7 @@ addFilter(
...props?.style,
...styles,
},
+ className: addClassName( props?.className, 'has-transform' ),
};
}
);
@@ -159,287 +195,250 @@ export const Transform = ( props: blockProps ): JSX.Element => {
const { attributes, setAttributes } = props;
const { style } = attributes;
const transform = style?.transform ?? {};
+ const transformHover = style?.transformHover ?? {};
- return (
- <>
-
-
- <>
- { __( 'Transform', 'blockify' ) }
- {
- setAttributes( {
- style: {
- ...attributes?.style,
- transform: '',
- },
- } );
- } }
- icon={ trash }
- iconSize={ 16 }
- aria-label={ __( 'Clear Transforms', 'blockify' ) }
- />
- >
-
-
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- rotate: value,
- },
- },
- } );
- } }
- min={ -360 }
- max={ 360 }
- step={ 1 }
- />
-
+ const [ tab, setTab ] = useState( 'default' );
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- rotateX: value,
- },
- },
- } );
- } }
- min={ -360 }
- max={ 360 }
- step={ 1 }
- />
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- rotateY: value,
- },
- },
- } );
- } }
- min={ -360 }
- max={ 360 }
- step={ 1 }
- />
-
+ const activeTransform = tab === 'default' ? transform : transformHover;
-
+ const setTransform = ( value: { [name: string]: string | undefined } ) => {
+ const styleKey = tab === 'default' ? 'transform' : 'transformHover';
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- scale: value,
- },
- },
- } );
- } }
- min={ 0 }
- max={ 10 }
- step={ 0.1 }
- />
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- scaleX: value,
- },
- },
- } );
- } }
- min={ 0 }
- max={ 10 }
- step={ 0.1 }
- />
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- scaleY: value,
- },
- },
- } );
- } }
- min={ 0 }
- max={ 10 }
- step={ 0.1 }
- />
-
-
-
-
-
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- skew: value,
- },
- },
- } );
- } }
- min={ -360 }
- max={ 360 }
- step={ 1 }
- />
-
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- skewX: value,
- },
- },
- } );
- } }
- min={ -360 }
- max={ 360 }
- step={ 1 }
- />
-
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- skewY: value,
- },
- },
- } );
- } }
- min={ -360 }
- max={ 360 }
- step={ 1 }
- />
-
-
-
-
-
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- translateX: value,
- },
- },
- } );
- } }
- />
-
-
-
- {
- setAttributes( {
- style: {
- ...style,
- transform: {
- ...transform,
- translateY: value,
- },
- },
- } );
- } }
- />
-
+ setAttributes( {
+ style: {
+ ...style,
+ [ styleKey ]: {
+ ...( activeTransform ),
+ ...value,
+ },
+ },
+ } );
+ };
-
- {
+ return <>
+
+
+ <>
+ { __( 'Transform', 'blockify' ) }
+ {
setAttributes( {
style: {
- ...style,
- transform: {
- ...transform,
- translateZ: value,
- },
+ ...attributes?.style,
+ transform: '',
+ transformHover: '',
},
} );
} }
+ icon={ trash }
+ iconSize={ 16 }
+ aria-label={ __( 'Clear Transforms', 'blockify' ) }
/>
-
-
-
- >
- );
+ >
+
+
+ setTab( 'default' ) }
+ >
+ { __( 'Default', 'blockify' ) }
+
+ setTab( 'hover' ) }
+ >
+ { __( 'Hover', 'blockify' ) }
+
+
+
+
+
+
+ {
+ setTransform( {
+ rotate: value,
+ } );
+ } }
+ min={ -360 }
+ max={ 360 }
+ step={ 1 }
+ />
+
+
+
+ {
+ setTransform( {
+ rotateX: value,
+ } );
+ } }
+ min={ -360 }
+ max={ 360 }
+ step={ 1 }
+ />
+
+
+ {
+ setTransform( {
+ rotateY: value,
+ } );
+ } }
+ min={ -360 }
+ max={ 360 }
+ step={ 1 }
+ />
+
+
+
+
+
+
+ {
+ setTransform( {
+ scale: value,
+ } );
+ } }
+ min={ 0 }
+ max={ 10 }
+ step={ 0.01 }
+ />
+
+
+ {
+ setTransform( {
+ scaleX: value,
+ } );
+ } }
+ min={ 0 }
+ max={ 10 }
+ step={ 0.01 }
+ />
+
+
+ {
+ setTransform( {
+ scaleY: value,
+ } );
+ } }
+ min={ 0 }
+ max={ 10 }
+ step={ 0.01 }
+ />
+
+
+
+
+
+
+
+ {
+ setTransform( {
+ skew: value,
+ } );
+ } }
+ min={ -360 }
+ max={ 360 }
+ step={ 1 }
+ />
+
+
+
+ {
+ setTransform( {
+ skewX: value,
+ } );
+ } }
+ min={ -360 }
+ max={ 360 }
+ step={ 1 }
+ />
+
+
+
+ {
+ setTransform( {
+ skewY: value,
+ } );
+ } }
+ min={ -360 }
+ max={ 360 }
+ step={ 1 }
+ />
+
+
+
+
+
+
+
+ {
+ setTransform( {
+ translateX: value,
+ } );
+ } }
+ />
+
+
+
+ {
+ setTransform( {
+ translateY: value,
+ } );
+ } }
+ />
+
+
+
+ {
+ setTransform( {
+ translateZ: value,
+ } );
+ } }
+ />
+
+
+
+ >;
};
addFilter(
@@ -461,7 +460,7 @@ addFilter(
+ >
diff --git a/src/block-variations/accordion.tsx b/src/block-variations/accordion.tsx
index f317d9d..4bdca53 100644
--- a/src/block-variations/accordion.tsx
+++ b/src/block-variations/accordion.tsx
@@ -7,6 +7,7 @@ registerBlockVariation( 'core/list', {
title: __( 'Accordion', 'blockify' ),
description: __( 'Add a collapsible accordion list.', 'blockify' ),
category: window?.blockify?.isPlugin ? 'blockify' : 'text',
+ scope: [],
icon: plus,
attributes: {
className: 'is-style-accordion',
diff --git a/src/block-variations/counter.tsx b/src/block-variations/counter.tsx
index c189fdb..9d3a838 100644
--- a/src/block-variations/counter.tsx
+++ b/src/block-variations/counter.tsx
@@ -1,9 +1,11 @@
import { __ } from '@wordpress/i18n';
import {
+ __experimentalNumberControl as NumberControl,
+ Flex,
+ FlexItem,
PanelBody,
PanelRow,
TextControl,
- __experimentalNumberControl as NumberControl, Flex, FlexItem,
} from '@wordpress/components';
import { backup } from '@wordpress/icons';
import { InspectorControls } from '@wordpress/block-editor';
@@ -14,12 +16,12 @@ import domReady from '@wordpress/dom-ready';
import { useEffect } from '@wordpress/element';
interface Counter {
- start: string,
- end: string,
- duration: string,
- delay: string,
- prefix: string,
- suffix: string,
+ start: string;
+ end: string;
+ duration: string;
+ delay: string;
+ prefix: string;
+ suffix: string;
}
const defaults: Counter = {
@@ -38,7 +40,7 @@ const counterVariation: BlockVariation = {
icon: backup,
isDefault: false,
category: window?.blockify?.isPlugin ? 'blockify' : 'text',
- scope: [ 'inserter', 'transform', 'block' ],
+ scope: [ 'inserter' ],
description: __( 'Insert counter animation.', 'blockify' ),
attributes: {
className: 'is-style-counter',
diff --git a/src/block-variations/curved-text.tsx b/src/block-variations/curved-text.tsx
index 2832753..9d62d7d 100644
--- a/src/block-variations/curved-text.tsx
+++ b/src/block-variations/curved-text.tsx
@@ -1,10 +1,11 @@
import {
+ __experimentalNumberControl as NumberControl,
+ Flex,
+ FlexBlock,
+ FlexItem,
PanelBody,
PanelRow,
TextareaControl,
- __experimentalNumberControl as NumberControl,
- FlexItem,
- FlexBlock, Flex,
} from '@wordpress/components';
import { createHigherOrderComponent } from '@wordpress/compose';
import { InspectorControls } from '@wordpress/block-editor';
@@ -35,7 +36,7 @@ const curvedTextVariation: BlockVariation = {
icon: rotateRight,
isDefault: false,
category: window?.blockify?.isPlugin ? 'blockify' : 'text',
- scope: [ 'inserter', 'transform', 'block' ],
+ scope: [ 'inserter' ],
description: __( 'Insert curved text around circular SVG path.', 'blockify' ),
attributes: {
className: 'is-style-curved-text',
diff --git a/src/block-variations/grid.tsx b/src/block-variations/grid.tsx
index 7317298..bdf0502 100644
--- a/src/block-variations/grid.tsx
+++ b/src/block-variations/grid.tsx
@@ -1,9 +1,22 @@
import { BlockVariation, registerBlockVariation } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';
-import { grid } from '@wordpress/icons';
+import { desktop, grid, mobile, trash } from '@wordpress/icons';
+import {
+ __experimentalNumberControl as NumberControl,
+ Button,
+ ButtonGroup,
+ Flex,
+ FlexItem,
+ PanelBody,
+ PanelRow,
+} from '@wordpress/components';
+import { useState } from '@wordpress/element';
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
-import domReady from '@wordpress/dom-ready';
+import { InspectorControls } from '@wordpress/block-editor';
+import { Label } from '../components';
+import { select } from '@wordpress/data';
+import { supportsDisplay } from '../block-extensions/display.tsx';
const blockVariation: BlockVariation = {
name: 'group-grid',
@@ -11,57 +24,295 @@ const blockVariation: BlockVariation = {
title: __( 'Grid', 'blockify' ),
isDefault: false,
category: window?.blockify?.isPlugin ? 'blockify' : 'design',
- scope: [ 'inserter', 'transform' ],
- description: __( 'Arrange blocks in CSS grid', 'blockify' ),
+ scope: [ 'inserter', 'transform', 'block' ],
+ description: __( 'Arrange blocks in a grid.', 'blockify' ),
attributes: {
layout: {
type: 'flex',
orientation: 'grid',
},
+ style: {
+ display: {
+ all: 'grid',
+ },
+ gridTemplateColumns: {
+ all: 'repeat(3,1fr)',
+ },
+ gridTemplateRows: {
+ all: 'repeat(3,1fr)',
+ },
+ },
},
isActive: ( blockAttributes ) => blockAttributes?.layout?.orientation === 'grid',
};
-domReady(
- () => registerBlockVariation( 'core/group', blockVariation )
-);
+registerBlockVariation( 'core/group', blockVariation );
-addFilter(
- 'blocks.registerBlockType',
- 'blockify/grid-attributes',
- ( props, name: string ): void => {
- if ( name === 'core/group' ) {
- props = {
- ...props,
- attributes: {
- ...props.attributes,
- grid: {
- type: 'object',
- },
- },
- };
+export const gridTypes = [ 'grid', 'inline-grid' ];
+
+const GridControl = ( props: blockProps, screen: string, hasGrid: boolean, parentHasGrid: boolean ) => {
+ const { attributes, setAttributes } = props;
+ const { style } = attributes;
+
+ const columnValue = style?.gridTemplateColumns?.[ screen ];
+ const rowValue = style?.gridTemplateRows?.[ screen ];
+
+ const columns = columnValue ? columnValue?.replace( /repeat\((\d+),1fr\)/, '$1' ) : '';
+ const rows = rowValue ? rowValue?.replace( /repeat\((\d+),1fr\)/, '$1' ) : '';
+
+ return <>
+ { hasGrid &&
+
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ gridTemplateColumns: {
+ ...style?.gridTemplateColumns,
+ [ screen ]: value ? 'repeat(' + value + ',1fr)' : '',
+ },
+ },
+ } );
+ } }
+ min={ 1 }
+ max={ 12 }
+ step={ 1 }
+ />
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ gridTemplateRows: {
+ ...style?.gridTemplateRows,
+ [ screen ]: value ? 'repeat(' + value + ',1fr)' : '',
+ },
+ },
+ } );
+ } }
+ min={ 1 }
+ max={ 12 }
+ step={ 1 }
+ />
+
+
+
+ }
+ { parentHasGrid &&
+ <>
+
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ gridColumnStart: {
+ ...style?.gridColumnStart,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ min={ 1 }
+ max={ 12 }
+ step={ 1 }
+ />
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ gridColumnEnd: {
+ ...style?.gridColumnEnd,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ min={ 1 }
+ max={ 12 }
+ step={ 1 }
+ />
+
+
+
+
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ gridRowStart: {
+ ...style?.gridRowStart,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ min={ 1 }
+ max={ 12 }
+ step={ 1 }
+ />
+
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ gridRowEnd: {
+ ...style?.gridRowEnd,
+ [ screen ]: value,
+ },
+ },
+ } );
+ } }
+ min={ 1 }
+ max={ 12 }
+ step={ 1 }
+ />
+
+
+
+ >
}
+ >;
+};
- return props;
- },
- 0
-);
+const GridControls = ( props: blockProps ): JSX.Element => {
+ const { attributes, setAttributes, name, clientId } = props;
+ const [ screen, setScreen ] = useState( 'all' );
+ const { style } = attributes;
+
+ const hasGrid = name === 'core/group' && ( gridTypes.includes( style?.display?.all ) || gridTypes.includes( style?.display?.mobile ) || gridTypes.includes( style?.display?.desktop ) );
+
+ const parentBlocks = select( 'core/block-editor' )?.getBlockParents( clientId ) ?? [];
+ const parentBlock = parentBlocks[ parentBlocks.length - 1 ];
+ const parentAttributes = select( 'core/block-editor' )?.getBlockAttributes( parentBlock ) ?? null;
+ const parentHasGrid = gridTypes.includes( parentAttributes?.style?.display?.all ) || gridTypes.includes( parentAttributes?.style?.display?.mobile ) || gridTypes.includes( parentAttributes?.style?.display?.desktop );
+
+ if ( ! hasGrid && ! parentHasGrid ) {
+ return <>>;
+ }
+
+ return
+
+
+ <>
+ { __( 'Grid', 'blockify' ) }
+ {
+ setAttributes( {
+ style: {
+ ...attributes?.style,
+ gridTemplateColumns: '',
+ gridTemplateRows: '',
+ gridColumnStart: '',
+ gridColumnEnd: '',
+ gridRowStart: '',
+ gridRowEnd: '',
+ },
+ } );
+ } }
+ icon={ trash }
+ iconSize={ 16 }
+ aria-label={ __( 'Reset Grid', 'blockify' ) }
+ />
+ >
+
+
+ setScreen( 'all' ) }
+ >
+ { __( 'All', 'blockify' ) }
+
+ setScreen( 'mobile' ) }
+ icon={ mobile }
+ />
+ setScreen( 'desktop' ) }
+ icon={ desktop }
+ />
+
+
+ { screen === 'all' && GridControl( props, screen, hasGrid, parentHasGrid ) }
+ { screen === 'mobile' && GridControl( props, screen, hasGrid, parentHasGrid ) }
+ { screen === 'desktop' && GridControl( props, screen, hasGrid, parentHasGrid ) }
+ ;
+};
addFilter(
- 'editor.BlockListBlock',
- 'blockify/with-grid',
- createHigherOrderComponent(
- ( BlockListBlock ) => ( props: blockProps ) => {
- if ( props?.name !== 'core/group' ) {
- return ;
- }
+ 'editor.BlockEdit',
+ 'blockify/grid-controls',
+ createHigherOrderComponent( ( BlockEdit ) => {
+ return ( props: blockProps ) => {
+ const { isSelected, attributes, name } = props;
- if ( props?.attributes?.layout?.orientation !== 'grid' ) {
- return ;
+ if ( ! supportsDisplay( name ) ) {
+ return ;
}
- return ;
- },
- 'withWidth'
- )
+ const InlineStyles = () => ;
+
+ const hasInlineStyles = attributes?.layout?.orientation === 'grid' && ! attributes?.layout?.verticalAlignment;
+
+ return (
+ <>
+ { hasInlineStyles &&
+
+ }
+
+ { isSelected &&
+
+
+
+ }
+ >
+ );
+ };
+ }, 'withDisplay' )
);
diff --git a/src/block-variations/icon.tsx b/src/block-variations/icon.tsx
index b215e83..5053bac 100644
--- a/src/block-variations/icon.tsx
+++ b/src/block-variations/icon.tsx
@@ -1,34 +1,50 @@
-import parse from 'html-react-parser';
import { __ } from '@wordpress/i18n';
-import {
- InspectorControls,
-} from '@wordpress/block-editor';
-import { useSelect } from '@wordpress/data';
+import { InspectorControls } from '@wordpress/block-editor';
import {
__experimentalUnitControl as UnitControl,
- CustomSelectControl, Flex, FlexItem,
- PanelBody, PanelRow,
+ Button,
+ ButtonGroup,
+ CustomSelectControl,
+ Flex,
+ FlexItem,
+ PanelBody,
+ PanelRow,
SelectControl,
} from '@wordpress/components';
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
-import SelectOption = SelectControl.Option;
-import CustomSelectOption = CustomSelectControl.Option;
-import { starFilled } from '@wordpress/icons';
-import { BlockVariation, registerBlockVariation } from '@wordpress/blocks';
-import { defaultState } from '../api/icon-store';
+import { starEmpty } from '@wordpress/icons';
+import {
+ BlockAttributes,
+ BlockVariation,
+ registerBlockVariation,
+} from '@wordpress/blocks';
+import { defaultIconState, Icons, iconStoreName } from '../api/icon-store';
import domReady from '@wordpress/dom-ready';
+import { Label } from '../components';
+import React from 'react';
+import { defaultIcon, getIconStyles, IconAttributes } from '../utility/icon';
+import { useSelect } from '@wordpress/data';
+import HTMLReactParser from 'html-react-parser';
+import Select, { components, SingleValue } from 'react-select';
+import {
+ OptionProps,
+} from 'react-select/dist/declarations/src/components/Option';
+import { cssObjectToString, toTitleCase } from '../utility';
+import CustomSelectOption = CustomSelectControl.Option;
-const supportsIcon = ( name: string ): boolean => name === 'core/image';
+const { Option } = components;
-const iconAttributes = {
+const supportsIcon = ( name: string ): boolean => [ 'core/image', 'core/button', 'blockify/tab' ].includes( name );
+
+const iconAttributes: { [key: string]: { [key: string]: any } } = {
iconSet: {
type: 'string',
- default: 'wordpress',
+ default: defaultIcon.set,
},
iconName: {
type: 'string',
- default: 'star-empty',
+ default: defaultIcon.name,
},
iconColor: {
type: 'string',
@@ -39,30 +55,30 @@ const iconAttributes = {
iconSize: {
type: 'string',
},
- iconCustomSVG: {
+ iconPosition: {
type: 'string',
},
iconSvgString: {
type: 'string',
- default: ' ',
+ default: defaultIcon.string,
},
};
const blockVariation: BlockVariation = {
name: 'icon',
- icon: starFilled,
+ icon: starEmpty,
title: __( 'Icon', 'blockify' ),
isDefault: false,
category: window?.blockify?.isPlugin ? 'blockify' : 'media',
- scope: [ 'inserter', 'transform', 'block' ],
+ scope: [ 'inserter' ],
description: __( 'Insert a customizable SVG icon.', 'blockify' ),
attributes: {
className: 'is-style-icon',
- iconSet: 'wordpress',
- iconName: 'star-empty',
- iconSvgString: ' ',
+ iconSet: defaultIcon.set,
+ iconName: defaultIcon.name,
+ iconSvgString: defaultIcon.string,
},
- isActive: ( blockAttributes ) => {
+ isActive: ( blockAttributes: BlockAttributes ) => {
return blockAttributes && blockAttributes?.className?.includes( 'is-style-icon' );
},
};
@@ -82,6 +98,11 @@ addFilter(
};
}
+ if ( name === 'core/button' ) {
+ delete iconAttributes?.iconSet?.default;
+ delete iconAttributes?.iconName?.default;
+ }
+
props.attributes = {
...props.attributes,
...iconAttributes,
@@ -94,6 +115,12 @@ addFilter(
);
const addProLink = () => {
+ const pluginActive = window?.blockify?.isPlugin ?? false;
+
+ if ( pluginActive ) {
+ return;
+ }
+
const description = document.getElementsByClassName( 'block-editor-block-card__description' ).item( 0 );
if ( ! description ) {
@@ -107,130 +134,245 @@ const addProLink = () => {
}
};
-addFilter(
- 'editor.BlockEdit',
- 'blockify/with-icon',
- createHigherOrderComponent( ( BlockEdit ) => {
- return ( props: blockProps ) => {
- const {
- name,
- attributes,
- setAttributes,
- isSelected,
- } = props;
-
- const { className }: { [className: string]: string } = attributes;
-
- if ( ! className ) {
- return ;
- }
-
- if ( ! className?.includes( 'is-style-icon' ) ) {
- return ;
- }
-
- if ( ! supportsIcon( name ) ) {
- return ;
- }
+interface IconEditProps {
+ name: string;
+ attributes: IconAttributes;
+ setAttributes: ( attributes: IconAttributes ) => void;
+ isSelected: boolean;
+ isButton: boolean;
+}
+
+interface IconSelectOption {
+ value: string;
+ label: string;
+ icon: JSX.Element | JSX.Element[] | string;
+}
+
+const IconSettings = ( props: IconEditProps ) => {
+ const {
+ attributes,
+ setAttributes,
+ isButton,
+ } = props;
+
+ const iconSetOptions: CustomSelectOption[] = [
+ {
+ label: __( 'None', 'blockify' ),
+ value: '',
+ },
+ ];
+
+ const icons: Icons = useSelect(
+ ( select ) => select( iconStoreName )?.getIcons(),
+ []
+ ) ?? defaultIconState;
+
+ const allIconOptions: {
+ [set: string]: IconSelectOption[];
+ } = {
+ wordpress: [
+ {
+ value: iconAttributes?.iconName?.default,
+ label: toTitleCase( iconAttributes?.iconName?.default ?? '' ),
+ icon: HTMLReactParser( iconAttributes?.iconSvgString?.default ?? '' ),
+ },
+ ],
+ };
+
+ Object.keys( icons ).forEach( ( iconSet: string ) => {
+ let label = iconSet.split( '-' ).join( ' ' );
+
+ label = 'wordpress' === label ? 'WordPress' : label;
+
+ iconSetOptions.push( {
+ label,
+ value: iconSet,
+ } );
- if ( isSelected ) {
- addProLink();
- }
+ allIconOptions[ iconSet ] = [];
- if ( ! attributes?.url ) {
- setAttributes( {
- url: '#',
- } );
+ Object.keys( icons[ iconSet ] ).forEach( ( iconName: string ) => {
+ if ( iconName !== attributes?.iconName ) {
+ allIconOptions[ iconSet ].push(
+ {
+ icon: HTMLReactParser( icons?.[ iconSet ]?.[ iconName ] ),
+ value: iconName,
+ label: toTitleCase( iconName ?? '' ),
+ }
+ );
}
+ } );
- if ( ! attributes?.iconSet ) {
- setAttributes( {
- iconSet: iconAttributes?.iconSet?.default,
- } );
- }
+ // Moves current icon to start of array.
+ if ( icons?.[ iconSet ]?.[ attributes?.iconName ?? '' ] ) {
+ allIconOptions[ iconSet ].unshift( {
+ icon: HTMLReactParser( icons?.[ iconSet ]?.[ attributes?.iconName ?? '' ] ),
+ value: attributes?.iconName ?? '',
+ label: toTitleCase( attributes?.iconName ?? '' ),
+ } );
+ }
+ } );
- if ( ! attributes?.iconName ) {
- setAttributes( {
- iconName: iconAttributes?.iconName?.default,
- } );
- }
+ const PositionControls = () => {
+ const buttonStyle = {
+ height: '30px',
+ };
- if ( ! attributes?.iconSvgString ) {
+ return
+
+ { __( 'Icon Position', 'blockify' ) }
+
+
+ {
+ setAttributes( {
+ iconPosition: 'start',
+ } );
+ } }
+ style={ buttonStyle }
+ >
+ { __( 'Start', 'blockify' ) }
+
+ {
+ setAttributes( {
+ iconPosition: 'end',
+ } );
+ } }
+ style={ buttonStyle }
+ >
+ { __( 'End', 'blockify' ) }
+
+
+ ;
+ };
+
+ const IconOption = ( optionProps: OptionProps ) => {
+ return
+ { optionProps.data?.icon ?? '' }
+
+ { optionProps.data?.value ?? '' }
+
+ ;
+ };
+
+ return <>
+ setAttributes( {
+ iconSet: value,
+ } ) }
+ />
+
+ { __( 'Select Icon', 'blockify' ) }
+
+ ) => {
setAttributes( {
- iconSvgString: iconAttributes?.iconSvgString?.default,
+ iconName: value?.value,
+ iconSvgString: icons?.[ attributes?.iconSet ?? '' ]?.[ value?.value ?? '' ] ?? '',
} );
- }
-
- const setOptions: SelectOption[] = [];
-
- const { icons } = useSelect( ( select ) => {
- return {
- icons: select( 'blockify/icons' )?.getIcons(),
- };
- }, [] ) ?? defaultState;
-
- const allIconOptions: {
- [set: string]: CustomSelectOption[]
- } = {
- wordpress: [
- {
- name: iconAttributes?.iconSvgString?.default,
- key: iconAttributes?.iconName?.default,
- },
- ],
- };
-
- Object.keys( icons ).forEach( ( iconSet: string ) => {
- let label = iconSet.split( '-' ).join( ' ' );
+ } }
+ components={ {
+ Option: IconOption,
+ } }
+ isClearable={ true }
+ />
+
+
+
+
+
+ {
+ setAttributes( {
+ iconSize: value,
+ } );
+ } }
+ />
+
+ { isButton &&
+
+ }
+
+
+ >;
+};
- label = 'wordpress' === label ? 'WordPress' : label;
+addFilter(
+ 'editor.BlockEdit',
+ 'blockify/with-icon',
+ createHigherOrderComponent(
+ ( BlockEdit ) => {
+ return (
+ props: IconEditProps
+ ) => {
+ const {
+ name,
+ attributes,
+ isSelected,
+ } = props;
- setOptions.push( {
- label,
- value: iconSet,
- } );
+ const { className } = attributes;
- allIconOptions[ iconSet ] = [];
+ const isButton = [ 'core/button', 'blockify/tab' ].includes( name );
- Object.keys( icons[ iconSet ] ).forEach( ( iconName: string ) => {
- if ( iconName !== attributes?.iconName ) {
- allIconOptions[ iconSet ].push(
- {
- name: parse( icons?.[ iconSet ]?.[ iconName ] ),
- key: iconName,
- }
- );
- }
- } );
+ if ( ! className?.includes( 'is-style-icon' ) && ! isButton ) {
+ return ;
+ }
- // Moves current icon to start of array.
- if ( icons?.[ iconSet ]?.[ attributes?.iconName ] ) {
- allIconOptions[ iconSet ].unshift( {
- name: parse( icons?.[ iconSet ]?.[ attributes?.iconName ] ),
- key: attributes?.iconName,
- } );
+ if ( ! supportsIcon( name ) ) {
+ return ;
}
- } );
- const IconPreview = () => {
- const currentIconSvg: string = allIconOptions[ attributes?.iconSet ]?.filter( ( option: CustomSelectOption ) => {
- return option?.key === attributes?.iconName;
- } )?.[ 0 ]?.name;
-
- return (
-
- { currentIconSvg && (
- <>
- { currentIconSvg }
- { attributes?.iconName?.replace( '-', ' ' ) }
- >
- ) }
-
- );
- };
+ if ( isSelected ) {
+ addProLink();
+ }
- return (
- <>
+ return <>
- { ! 1 &&
+ { ! window?.blockify?.isPlugin &&
- { __( 'More icons available with the Blockify Pro add-on! ', 'blockify' ) }
+ { __( 'More icons available with Blockify Pro! ', 'blockify' ) }
+ target={ '_blank' }
+ rel={ 'noreferrer' }
+ >
{ __( 'Learn more ↗', 'blockify' ) }
}
- setAttributes( {
- iconSet: value,
- } ) }
- />
-
-
- {
- const key = selectedItem?.key ?? '';
-
- setAttributes( {
- iconName: key,
- } );
-
- setAttributes( {
- iconSvgString: icons?.[ attributes?.iconSet ]?.[ key ],
- } );
- } }
+
+
-
-
-
-
- setAttributes( {
- iconSize: value,
- } ) }
- />
-
-
-
- >
- );
- };
- }, 'iconEdit' ),
+ >;
+ };
+ }, 'iconEdit' ),
0
);
-const getStyles = ( attributes: attributes ) => {
- const styles: style = {};
- let background = '';
-
- if ( attributes?.style?.color?.background ) {
- background = attributes.style.color.background;
- }
-
- if ( attributes?.backgroundColor ) {
- background = 'var(--wp--preset--color--' + attributes.backgroundColor + ', currentColor)';
- }
-
- let gradient = '';
-
- if ( attributes?.style?.color?.gradient ) {
- gradient = attributes?.style?.color?.gradient;
- }
-
- if ( attributes?.gradient ) {
- gradient = 'var(--wp--preset--gradient--' + attributes.gradient + ',currentColor)';
- }
-
- let text = '';
-
- if ( attributes?.style?.color?.text ) {
- text = attributes?.style?.color?.text;
- }
-
- if ( attributes?.textColor ) {
- text = 'var(--wp--preset--color--' + attributes.textColor + ',currentColor)';
- }
-
- if ( background !== '' ) {
- styles[ '--wp--custom--icon--background' ] = background;
- }
-
- if ( text ) {
- styles[ '--wp--custom--icon--color' ] = text;
-
- if ( gradient ) {
- styles[ '--wp--custom--icon--background' ] = gradient;
- }
- } else if ( gradient ) {
- styles[ '--wp--custom--icon--color' ] = gradient;
- }
-
- if ( attributes?.style?.spacing?.padding ) {
- const padding = attributes.style.spacing.padding;
-
- const paddingObject: { [side: string]: string } = {
- top: padding?.top ?? '0',
- right: padding?.right ?? '0',
- bottom: padding?.bottom ?? '0',
- left: padding?.left ?? '0',
- };
-
- // Support spacing scale.
- Object.keys( paddingObject ).forEach( ( side: string ) => {
- const value: string = paddingObject?.[ side ] ?? '';
-
- if ( value && value?.includes( 'var:preset' ) ) {
- paddingObject[ side ] = 'var(--wp--preset--spacing--' + value.replace( 'var:preset|spacing|', '' ) + ')';
- }
- } );
-
- styles[ '--wp--custom--icon--padding' ] = Object.values( paddingObject ).join( ' ' );
- }
-
- if ( attributes?.style?.spacing?.margin ) {
- const margin = attributes.style.spacing.margin;
-
- const marginObject: { [side: string]: string } = {
- top: margin?.top ?? '',
- right: margin?.right ?? '',
- bottom: margin?.bottom ?? '',
- left: margin?.left ?? '',
- };
-
- // Support spacing scale.
- Object.keys( marginObject ).forEach( ( side: string ) => {
- const value: string = marginObject?.[ side ] ?? '';
-
- if ( value?.includes( 'var:preset' ) ) {
- marginObject[ side ] = 'var(--wp--preset--spacing--' + value?.replace( 'var:preset|spacing|', '' ) + ')';
- }
- } );
-
- styles[ '--wp--custom--icon--margin' ] = Object.values( marginObject ).join( ' ' );
- }
-
- let borderColor = '';
-
- if ( attributes?.borderColor ) {
- borderColor = 'var(--wp--preset--color--' + attributes?.borderColor + ')';
- }
-
- if ( attributes?.style?.border?.width ) {
- styles[ '--wp--custom--icon--border-width' ] = attributes.style.border.width;
- styles[ '--wp--custom--icon--border-style' ] = attributes.style.border?.style ?? 'solid';
- styles[ '--wp--custom--icon--border-color' ] = attributes.style.border?.color ?? borderColor;
- }
-
- const size = attributes?.iconSize ?? '';
-
- if ( size !== '' ) {
- styles[ '--wp--custom--icon--size' ] = size;
- }
-
- const custom: string = ( attributes?.iconCustomSVG ?? '' )?.replace( '"', "'" );
- const svg: string = custom && custom?.includes( ' {
return ( props: blockProps ) => {
- let { attributes, wrapperProps, name } = props;
+ let {
+ attributes,
+ wrapperProps,
+ name,
+ clientId,
+ } = props;
+
+ const isButton = [ 'core/button' ].includes( name );
- if ( ! attributes?.className ) {
+ if ( ! attributes?.className && ! isButton ) {
return ;
}
- if ( ! attributes?.className?.includes( 'is-style-icon' ) ) {
+ if ( ! attributes?.className?.includes( 'is-style-icon' ) && ! isButton ) {
return ;
}
@@ -444,10 +438,19 @@ addFilter(
wrapperProps.style = {
...wrapperProps?.style,
- ...getStyles( attributes ),
+ ...getIconStyles( attributes ),
};
- return ;
+ const styles: genericStrings = {};
+
+ if ( attributes.iconSvgString ) {
+ styles[ '--wp--custom--icon--url' ] = "url('data:image/svg+xml;utf8," + attributes.iconSvgString + "')";
+ }
+
+ return <>
+
+
+ >;
};
}, 'withIcon' )
);
@@ -455,14 +458,16 @@ addFilter(
addFilter(
'blocks.getSaveContent.extraProps',
'blockify/save-icon-styles',
- ( props, block, attributes ): object => {
+ ( props, block, attributes: IconAttributes ): object => {
if ( ! attributes?.className ) {
return props;
}
const { name } = block;
- if ( ! attributes?.className?.includes( 'is-style-icon' ) ) {
+ const isButton = name === 'core/button';
+
+ if ( ! attributes?.className?.includes( 'is-style-icon' ) && ! isButton ) {
return props;
}
@@ -470,9 +475,12 @@ addFilter(
return props;
}
- props.style = {
- ...props?.style,
- ...getStyles( attributes ),
+ props = {
+ ...props,
+ style: {
+ ...props?.style,
+ ...getIconStyles( attributes ),
+ },
};
return props;
diff --git a/src/block-variations/image.tsx b/src/block-variations/image.tsx
deleted file mode 100644
index 8b5d09b..0000000
--- a/src/block-variations/image.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { BlockVariation, registerBlockVariation } from '@wordpress/blocks';
-import { __ } from '@wordpress/i18n';
-import { image } from '@wordpress/icons';
-
-const defaultImage: BlockVariation = {
- name: 'image',
- title: __( 'Image', 'blockify' ),
- icon: image,
- isDefault: true,
- category: 'media',
- scope: [ 'inserter', 'transform', 'block' ],
- description: __( 'Insert an image to make a visual statement.', 'blockify' ),
- attributes: {
- className: '',
- },
- isActive: ( blockAttributes ) => {
- if ( ! blockAttributes?.className ) {
- return true;
- }
-
- return ! blockAttributes?.className?.includes( 'is-style-icon' ) && ! blockAttributes?.className?.includes( 'is-style-svg' );
- },
-};
-
-registerBlockVariation( 'core/image', defaultImage );
diff --git a/src/block-variations/marquee.tsx b/src/block-variations/marquee.tsx
index c47993a..85a80fb 100644
--- a/src/block-variations/marquee.tsx
+++ b/src/block-variations/marquee.tsx
@@ -3,17 +3,24 @@ import { __ } from '@wordpress/i18n';
import { reusableBlock } from '@wordpress/icons';
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
-import { CSSProperties } from 'react';
-import {
- InspectorControls,
-} from '@wordpress/block-editor';
+import { CSSProperties, SyntheticEvent } from 'react';
+import { InspectorControls } from '@wordpress/block-editor';
import {
+ __experimentalNumberControl as NumberControl,
+ __experimentalVStack as VStack,
+ Flex,
+ FlexBlock,
+ FlexItem,
PanelBody,
PanelRow,
+ RangeControl,
ToggleControl,
- // @ts-ignore
- __experimentalNumberControl as NumberControl, Flex, FlexItem, FlexBlock, RangeControl,
} from '@wordpress/components';
+import { Label } from '../components';
+import { addClassName } from '../utility/css.tsx';
+
+const defaultMobileSpeed = '60';
+const defaultDesktopSpeed = '90';
const blockVariation: BlockVariation = {
name: 'marquee',
@@ -21,7 +28,7 @@ const blockVariation: BlockVariation = {
title: __( 'Marquee', 'blockify' ),
isDefault: false,
category: window?.blockify?.isPlugin ? 'blockify' : 'design',
- scope: [ 'inserter', 'transform', 'block' ],
+ scope: [ 'inserter' ],
description: __( 'Adds a horizontal infinite scrolling marquee banner.', 'blockify' ),
innerBlocks: [
[
@@ -44,10 +51,12 @@ const blockVariation: BlockVariation = {
attributes: {
marquee: {},
align: 'full',
- speedMobile: 60,
- speedDesktop: 90,
+ speedMobile: defaultMobileSpeed,
+ speedDesktop: defaultDesktopSpeed,
pauseOnHover: true,
reverse: false,
+ fadeEdges: false,
+ direction: 'horizontal',
spacing: {
padding: {
right: '0',
@@ -70,8 +79,8 @@ registerBlockVariation( 'core/group', blockVariation );
const getStyles = ( attributes: attributes ): CSSProperties => {
return {
- '--marquee-speed-mobile': ( attributes?.speedMobile ?? 20 ) + 's',
- '--marquee-speed-desktop': ( attributes?.speedDesktop ?? 30 ) + 's',
+ '--marquee-speed-mobile': ( attributes?.speedMobile ?? defaultMobileSpeed ) + 's',
+ '--marquee-speed-desktop': ( attributes?.speedDesktop ?? defaultDesktopSpeed ) + 's',
'--marquee-direction': attributes?.reverse ? 'reverse' : 'forwards',
'--marquee-pause': attributes?.pauseOnHover ? 'paused' : 'running',
} as CSSProperties;
@@ -101,6 +110,9 @@ addFilter(
repeatItems: {
type: 'number',
},
+ fadeEdges: {
+ type: 'boolean',
+ },
},
};
}
@@ -120,81 +132,108 @@ addFilter(
return ;
}
- return (
- <>
-
-
- { __( 'Scroll Speed (seconds)', 'blockify' ) }
-
-
-
-
- {
- setAttributes( { speedMobile: value } );
- } }
- value={ attributes?.speedMobile }
- />
-
-
- {
- setAttributes( {
- speedDesktop: value,
- } );
- } }
- value={ attributes?.speedDesktop }
- />
-
-
-
-
-
- {
+ const Settings = () => <>
+
+
+
+ { __( 'Scroll Speed (seconds)', 'blockify' ) }
+
+
+
+ {
+ if ( ! extra?.event?.target?.validity?.valid ) {
+ return;
+ }
+
setAttributes( {
- repeatItems: value,
+ speedMobile: value,
} );
} }
- min={ 0 }
- max={ 10 }
- step={ 1 }
- allowReset={ true }
+ value={ attributes?.speedMobile ?? defaultMobileSpeed }
/>
-
-
- setAttributes( {
- pauseOnHover: ! attributes?.pauseOnHover,
- } ) }
- />
-
-
- setAttributes( {
- reverse: ! attributes?.reverse,
- } ) }
+
+
+ {
+ if ( ! extra?.event?.target?.validity?.valid ) {
+ return;
+ }
+
+ setAttributes( {
+ speedDesktop: value,
+ } );
+ } }
+ value={ attributes?.speedDesktop ?? defaultDesktopSpeed }
/>
-
-
-
-
- >
- );
+
+
+
+
+
+ {
+ setAttributes( {
+ repeatItems: value,
+ } );
+ } }
+ min={ 0 }
+ max={ 10 }
+ step={ 1 }
+ allowReset={ true }
+ />
+
+
+ setAttributes( {
+ pauseOnHover: ! attributes?.pauseOnHover,
+ } ) }
+ />
+
+
+ setAttributes( {
+ reverse: ! attributes?.reverse,
+ } ) }
+ />
+
+
+ setAttributes( {
+ fadeEdges: ! attributes?.fadeEdges,
+ } ) }
+ />
+
+ >;
+
+ return <>
+
+
+
+
+
+
+ >;
}, 'withInspectorControl' ),
9
);
@@ -223,7 +262,18 @@ addFilter(
},
};
- return ;
+ let className = props.className;
+
+ if ( attributes?.fadeEdges ) {
+ className = addClassName( className, 'fade-edges' );
+
+ wrapperProps.className = className;
+ }
+
+ return ;
},
'withMarquee'
)
@@ -237,11 +287,18 @@ addFilter(
return props;
}
- props.style = {
- ...props?.style,
- ...getStyles( attributes ),
+ props = {
+ ...props,
+ style: {
+ ...props?.style,
+ ...getStyles( attributes ),
+ },
};
+ if ( attributes?.fadeEdges ) {
+ props.className = addClassName( props.className, 'fade-edges' );
+ }
+
return props;
}
);
diff --git a/src/block-variations/paragraph.tsx b/src/block-variations/paragraph.tsx
deleted file mode 100644
index 9bafb46..0000000
--- a/src/block-variations/paragraph.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { BlockVariation, registerBlockVariation } from '@wordpress/blocks';
-import { __ } from '@wordpress/i18n';
-import { paragraph } from '@wordpress/icons';
-
-const defaultParagraph: BlockVariation = {
- name: 'paragraph',
- title: __( 'Paragraph', 'blockify' ),
- icon: paragraph,
- isDefault: true,
- category: 'text',
- scope: [ 'inserter', 'transform', 'block' ],
- description: __( 'Insert an image to make a visual statement.', 'blockify' ),
- attributes: {
- className: '',
- },
- isActive: ( blockAttributes ) => {
- return ! blockAttributes?.className?.includes( 'is-style-curved-text' ) && ! blockAttributes?.className?.includes( 'is-style-counter' );
- },
-};
-
-registerBlockVariation( 'core/paragraph', defaultParagraph );
diff --git a/src/block-variations/svg.tsx b/src/block-variations/svg.tsx
index 384e603..03dc96e 100644
--- a/src/block-variations/svg.tsx
+++ b/src/block-variations/svg.tsx
@@ -5,9 +5,11 @@ import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
import { InspectorControls } from '@wordpress/block-editor';
import {
- TextareaControl,
+ ExternalLink,
PanelBody,
- PanelRow, ExternalLink, ToggleControl,
+ PanelRow,
+ TextareaControl,
+ ToggleControl,
} from '@wordpress/components';
import domReady from '@wordpress/dom-ready';
@@ -17,7 +19,7 @@ const svgVariation: BlockVariation = {
icon: code,
isDefault: false,
category: window?.blockify?.isPlugin ? 'blockify' : 'media',
- scope: [ 'inserter', 'transform', 'block' ],
+ scope: [],
description: __( 'Insert an inline SVG.', 'blockify' ),
attributes: {
className: 'is-style-svg',
diff --git a/src/components/box-shadow-control.tsx b/src/components/box-shadow-control.tsx
new file mode 100644
index 0000000..02da211
--- /dev/null
+++ b/src/components/box-shadow-control.tsx
@@ -0,0 +1,401 @@
+import { select } from '@wordpress/data';
+import {
+ __experimentalNumberControl as NumberControl,
+ Button,
+ ButtonGroup,
+ Flex,
+ FlexItem,
+ PanelRow,
+ ToggleControl,
+} from '@wordpress/components';
+import { __ } from '@wordpress/i18n';
+import { ucWords } from '../utility';
+import {
+ __experimentalPanelColorGradientSettings as PanelColorGradientSettings,
+ EditorColor,
+} from '@wordpress/block-editor';
+import { Label } from './label';
+import { trash } from '@wordpress/icons';
+import { useState } from '@wordpress/element';
+
+interface PresetProps {
+ name: string;
+ slug: string;
+ shadow: string;
+}
+
+const TextControls = ( props: {
+ attributes: {
+ style: {
+ textShadow: {
+ x?: string | undefined;
+ y?: string | undefined;
+ blur?: string | undefined;
+ color?: string | undefined;
+ };
+ };
+ };
+ setAttributes: ( values: {
+ style: {
+ textShadow: {
+ [property: string]: string | undefined;
+ };
+ };
+ } ) => void;
+ colorPalette: EditorColor[];
+} ) => {
+ const { attributes, setAttributes, colorPalette } = props;
+ const { style } = attributes;
+ const { textShadow } = style;
+
+ return <>
+
+
+ { [ 'x', 'y', 'blur' ].map( ( key ) => (
+
+ {
+ setAttributes( {
+ style: {
+ ...style,
+ textShadow: {
+ ...textShadow,
+ [ key ]: value,
+ },
+ },
+ } );
+ } }
+ />
+
+ ) ) }
+
+
+ {
+ for ( const color of colorPalette ) {
+ if ( color.color === value ) {
+ value = 'var(--wp--preset--color--' + color.slug + ')';
+ }
+ }
+
+ setAttributes( {
+ style: {
+ ...style,
+ textShadow: {
+ ...textShadow,
+ color: value,
+ },
+ },
+ } );
+ },
+ },
+ ] }
+ />
+ >;
+};
+
+const CustomControls = ( props: {
+ boxShadow: { [property: string]: string | boolean };
+ setBoxShadow: ( values: { [property: string]: string | boolean } ) => void;
+ changeColor: ( value: string ) => void;
+ tab: string;
+} ) => {
+ const {
+ boxShadow,
+ setBoxShadow,
+ changeColor,
+ tab,
+ } = props;
+
+ return <>
+
+
+ { [ 'x', 'y', 'blur', 'spread' ].map( ( key ) => (
+
+ {
+ if ( ! value ) {
+ return;
+ }
+
+ setBoxShadow( {
+ [ key ]: value,
+ } );
+ } }
+ />
+
+ ) ) }
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ setBoxShadow( {
+ inset: value ? 'inset' : '',
+ } );
+ } }
+ />
+
+
+
+ >;
+};
+
+const BoxShadowSettings = ( props: blockProps, tab: string ): JSX.Element => {
+ const {
+ attributes,
+ setAttributes,
+ } = props;
+ const { style } = attributes;
+
+ const boxShadow = style?.boxShadow ?? {};
+ const textShadow = style?.textShadow ?? {};
+
+ const colorPalette: EditorColor[] = select( 'core/block-editor' ).getSettings().colors ?? [];
+
+ const setBoxShadow = ( values: { [property: string]: string | boolean } ) => {
+ let newAttributes;
+
+ if ( tab === 'default' ) {
+ newAttributes = {
+ ...values,
+ };
+ } else {
+ newAttributes = {
+ hover: {
+ ...boxShadow?.hover,
+ ...values,
+ },
+ };
+ }
+
+ setAttributes( {
+ ...attributes,
+ style: {
+ ...style,
+ boxShadow: {
+ ...boxShadow,
+ ...newAttributes,
+ },
+ },
+ } );
+ };
+
+ const changeColor = ( value: string ) => {
+ for ( const color of colorPalette ) {
+ if ( color.color === value ) {
+ value = 'var(--wp--preset--color--' + color.slug + ')';
+ }
+ }
+
+ setBoxShadow( {
+ color: value,
+ } );
+ };
+
+ const presets: PresetProps[] = select( 'core/block-editor' )?.getSettings()?.__experimentalFeatures?.shadow?.presets?.theme;
+
+ const PresetControls = () => {
+ const hoverSuffix = tab === 'hover' ? '-hover' : '';
+
+ return <>
+
+
+ { presets.map( ( preset: PresetProps ) => {
+ const isPrimary = ( tab === 'default' && attributes.shadowPreset === preset.slug ) || ( tab === 'hover' && attributes.shadowPresetHover === preset.slug );
+
+ return {
+ if ( tab === 'hover' ) {
+ setAttributes( {
+ shadowPresetHover: preset.slug === 'none' ? '' : preset.slug,
+ } );
+ } else {
+ setAttributes( {
+ shadowPreset: preset.slug === 'none' ? '' : preset.slug,
+ } );
+ }
+ } }
+ >
+ { preset.name }
+ ;
+ } ) }
+
+
+
+
+ { tab !== 'text' && {
+ setAttributes( {
+ useCustomBoxShadow: value,
+ } );
+ } }
+ /> }
+
+ >;
+ };
+
+ return <>
+ { tab === 'text' && }
+ { tab !== 'text' && }
+ { ( attributes?.useCustomBoxShadow && tab !== 'text' ) && }
+ >;
+};
+
+export const BoxShadowControl = (
+ props: blockProps
+): JSX.Element => {
+ const { attributes, setAttributes } = props;
+
+ const [ tab, setTab ] = useState( 'default' );
+
+ return <>
+
+
+ <>
+ { __( 'Shadow', 'blockify' ) }
+ {
+ setAttributes( {
+ shadowPreset: '',
+ shadowPresetHover: '',
+ useCustomBoxShadow: false,
+ style: {
+ ...attributes?.style,
+ boxShadow: '',
+ textShadow: '',
+ },
+ } );
+ } }
+ icon={ trash }
+ iconSize={ 16 }
+ aria-label={ __( 'Clear Shadow', 'blockify' ) }
+ />
+ >
+
+
+ setTab( 'default' ) }
+ >
+ { __( 'Default', 'blockify' ) }
+
+ setTab( 'hover' ) }
+ >
+ { __( 'Hover', 'blockify' ) }
+
+ setTab( 'text' ) }
+ >
+ { __( 'Text', 'blockify' ) }
+
+
+
+ { tab === 'default' && BoxShadowSettings( props, tab ) }
+ { tab === 'hover' && BoxShadowSettings( props, tab ) }
+ { tab === 'text' && BoxShadowSettings( props, tab ) }
+ >;
+};
diff --git a/src/components/button-group.tsx b/src/components/button-group.tsx
deleted file mode 100644
index 8428ea0..0000000
--- a/src/components/button-group.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { __ } from '@wordpress/i18n';
-import {
- ButtonGroup,
- Button,
-} from '@wordpress/components';
-import {
- PanelRow,
-} from '@wordpress/components';
-
-export const CustomButtonGroup = (
- {
- label = __( 'Width', 'blockify' ),
- width = 'auto',
- widths = [ 'auto', '25%', '50%', '75%', '100%' ],
- isSmall = true,
- setWidth = ( width: string ) => console.log( width ),
- onClick = ( key: string ) => console.log( key ),
- } ) =>
-
-
- { widths.map( ( key ) => {
- if ( key === width ) {
- setWidth( 'auto' );
- } else {
- setWidth( key );
- }
-
- if ( key === 'default' ) {
- setWidth( '' );
- }
-
- if ( typeof onClick === 'function' ) {
- onClick( key );
- }
- } }
- >
- { key === 'auto' ? __( 'Auto', 'blockify' ) : key }
-
- ) }
-
-
- ;
-
-export default CustomButtonGroup;
diff --git a/src/components/code-editor-modal.tsx b/src/components/code-editor-modal.tsx
new file mode 100644
index 0000000..432d98e
--- /dev/null
+++ b/src/components/code-editor-modal.tsx
@@ -0,0 +1,92 @@
+import Editor from 'react-simple-code-editor';
+import { highlight, languages } from 'prismjs/components/prism-core';
+import 'prismjs/components/prism-clike';
+import 'prismjs/components/prism-javascript';
+import { Label, Description } from '../components';
+import { __ } from '@wordpress/i18n';
+import { useState } from '@wordpress/element';
+import { Button, Modal } from '@wordpress/components';
+import { ucWords, replaceAll } from '../utility';
+
+interface ModalProps {
+ code: string,
+ onChange: ( value: string ) => void,
+ rows?: number,
+ title?: string,
+ description?: string,
+ language?: string,
+}
+
+const CodeEditor = ( {
+ code,
+ onChange,
+ rows = 32,
+ language = 'html',
+}: ModalProps ) => {
+ return <>
+ highlight( value, languages?.[ language ] ?? 'html' ) }
+ placeholder={ __( 'Please enter ', 'blockify' ) + ucWords( language ) + __( ' code here…', 'blockify' ) }
+ value={ replaceAll( code, '"', "'" ) }
+ onValueChange={ ( value: string ) => {
+ onChange( replaceAll( value, '"', "'" ) );
+ } }
+ padding={ 10 }
+ style={ {
+ fontSize: 12,
+ fontFamily: 'ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace',
+ height: rows.toString() + 'em',
+ maxHeight: '100%',
+ borderRadius: '2px', // Core modal border-radius.
+
+ // Material Oceanic theme.
+ color: '#c3cee3',
+ background: '#263238',
+ } }
+ />
+ >;
+};
+
+export const CodeEditorModal = ( props: ModalProps ) => {
+ const [ modalOpen, setModalOpen ] = useState( false );
+
+ const { title, description } = props;
+
+ const openModal = () => setModalOpen( true );
+ const closeModal = () => setModalOpen( false );
+
+ return
+
+ { title ?? '' }
+
+
+ { description ?? '' }
+
+ openModal() }
+ >
+ { title }
+
+ { modalOpen && (
+ closeModal() }
+ style={ {
+ width: '80%',
+ } }
+ >
+
+
+ ) }
+
;
+};
diff --git a/src/components/description.tsx b/src/components/description.tsx
new file mode 100644
index 0000000..13567d2
--- /dev/null
+++ b/src/components/description.tsx
@@ -0,0 +1,14 @@
+import { CSSProperties } from 'react';
+
+export const Description = ( { children, style }: {
+ children:string | JSX.Element,
+ style?: CSSProperties
+} ) => {
+ return
+ { children }
+
;
+};
diff --git a/src/components/index.tsx b/src/components/index.tsx
new file mode 100644
index 0000000..f746ec0
--- /dev/null
+++ b/src/components/index.tsx
@@ -0,0 +1,17 @@
+import { Label } from './label';
+import { Description } from './description';
+import { CodeEditorModal } from './code-editor-modal';
+import { PauseIcon } from './pause-icon';
+import { PlayIcon } from './play-icon.tsx';
+import { ScreenReaderText } from './screen-reader-text';
+import { BoxShadowControl } from './box-shadow-control';
+
+export {
+ Label,
+ Description,
+ CodeEditorModal,
+ PauseIcon,
+ PlayIcon,
+ ScreenReaderText,
+ BoxShadowControl,
+};
diff --git a/src/components/label.tsx b/src/components/label.tsx
index 88d30ff..a404e4f 100644
--- a/src/components/label.tsx
+++ b/src/components/label.tsx
@@ -1,3 +1,16 @@
-export const Label = ( { children }: { children: string | JSX.Element } ) => {
- return { children }
;
+import { CSSProperties } from 'react';
+
+export const Label = ( { children, style }: {
+ children: string | JSX.Element,
+ style?: CSSProperties
+} ) => {
+ return
+ { children }
+
;
};
diff --git a/src/components/play-icon.tsx b/src/components/play-icon.tsx
new file mode 100644
index 0000000..ac17209
--- /dev/null
+++ b/src/components/play-icon.tsx
@@ -0,0 +1,11 @@
+export const PlayIcon = () => {
+ return
+
+ ;
+};
diff --git a/src/components/screen-reader-text.tsx b/src/components/screen-reader-text.tsx
index 7969ba3..8110b12 100644
--- a/src/components/screen-reader-text.tsx
+++ b/src/components/screen-reader-text.tsx
@@ -1 +1,13 @@
-export const screenReaderText = ( text: string ) => { text } ;
+import { CSSProperties } from 'react';
+
+export const ScreenReaderText = ( { children, style }: {
+ children: string | JSX.Element,
+ style?: CSSProperties
+} ) => {
+ return
+ { children }
+ ;
+};
diff --git a/src/editor.tsx b/src/index.tsx
similarity index 72%
rename from src/editor.tsx
rename to src/index.tsx
index 9bc1cb2..c0b0ace 100644
--- a/src/editor.tsx
+++ b/src/index.tsx
@@ -1,29 +1,37 @@
+import './api/block-extensions.tsx';
import './api/block-styles.tsx';
import './api/block-supports.tsx';
import './api/icon-store.tsx';
import './block-extensions/animation.tsx';
+import './block-extensions/details-icon.tsx';
import './block-extensions/display.tsx';
+import './block-extensions/content-limit.tsx';
import './block-extensions/filter.tsx';
+import './block-extensions/image.tsx';
+import './block-extensions/inline-css.tsx';
import './block-extensions/negative-margin.tsx';
import './block-extensions/onclick.tsx';
import './block-extensions/position.tsx';
import './block-extensions/query-spacing.tsx';
+import './block-extensions/search-input.tsx';
import './block-extensions/shadow.tsx';
+import './block-extensions/size.tsx';
import './block-extensions/transform.tsx';
import './block-variations/accordion.tsx';
import './block-variations/curved-text.tsx';
import './block-variations/counter.tsx';
-import './block-variations/image.tsx';
+import './block-variations/grid.tsx';
import './block-variations/icon.tsx';
import './block-variations/svg.tsx';
import './block-variations/marquee.tsx';
-import './block-variations/paragraph.tsx';
import './block-variations/social-link-slack.tsx';
+// import './text-formats/animation.tsx';
import './text-formats/clear-formatting.tsx';
import './text-formats/gradient.tsx';
import './text-formats/typography.tsx';
import './text-formats/inline-svg.tsx';
import './text-formats/underline.tsx';
+
diff --git a/src/public/accordion.tsx b/src/public/accordion.tsx
deleted file mode 100644
index a6bf975..0000000
--- a/src/public/accordion.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-( () => {
- const details = document.querySelectorAll( 'details' );
-
- for ( const detail of details ) {
- detail.addEventListener( 'click', ( event ) => {
- for ( const otherDetail of details ) {
- if ( otherDetail !== detail ) {
- otherDetail.removeAttribute( 'open' );
-
- const otherSection = otherDetail.getElementsByTagName( 'section' ).item( 0 );
-
- if ( otherSection ) {
- otherSection.classList.remove( 'is-open' );
- otherSection.classList.add( 'is-closed' );
- }
- }
- }
-
- const section = detail.getElementsByTagName( 'section' ).item( 0 );
-
- if ( ! section ) {
- return;
- }
-
- section.style.setProperty(
- '--height',
- section.scrollHeight + 'px'
- );
-
- if ( detail.hasAttribute( 'open' ) ) {
- section.classList.add( 'is-closed' );
- section.classList.remove( 'is-open' );
- } else {
- section.classList.remove( 'is-closed' );
- section.classList.add( 'is-open' );
- }
- } );
- }
-} )();
diff --git a/src/public/animation.tsx b/src/public/animation.tsx
index 060fa50..918e6fb 100644
--- a/src/public/animation.tsx
+++ b/src/public/animation.tsx
@@ -1,4 +1,4 @@
-( () => {
+const initAnimation = () => {
const mediaQuery = window.matchMedia( '(prefers-reduced-motion: reduce)' );
if ( ! mediaQuery || mediaQuery.matches ) {
@@ -35,4 +35,7 @@
for ( const block of animatedBlocks ) {
observer.observe( block );
}
-} )();
+};
+
+document.addEventListener( 'DOMContentLoaded', initAnimation );
+window.addEventListener( 'resize', initAnimation );
diff --git a/src/public/code.tsx b/src/public/code.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/src/public/counter.tsx b/src/public/counter.tsx
index ba8b49e..af659d0 100644
--- a/src/public/counter.tsx
+++ b/src/public/counter.tsx
@@ -1,4 +1,4 @@
-document.addEventListener( 'DOMContentLoaded', () => {
+const initCounter = () => {
const mediaQuery = window.matchMedia( '(prefers-reduced-motion)' );
if ( mediaQuery && mediaQuery.matches ) {
@@ -54,4 +54,7 @@ document.addEventListener( 'DOMContentLoaded', () => {
block.innerHTML = '0';
observer.observe( block );
} );
-} );
+};
+
+document.addEventListener( 'DOMContentLoaded', initCounter );
+window.addEventListener( 'resize', initCounter );
diff --git a/src/public/details.tsx b/src/public/details.tsx
new file mode 100644
index 0000000..f2965ef
--- /dev/null
+++ b/src/public/details.tsx
@@ -0,0 +1,111 @@
+interface DetailsElement extends HTMLElement {
+ open: boolean;
+}
+
+const getTransitionDuration = (): number => {
+ const style = getComputedStyle( document.body );
+ const transitionDuration = style.getPropertyValue( '--wp--custom--transition--duration' );
+
+ if ( transitionDuration.includes( 'ms' ) ) {
+ return parseFloat( transitionDuration );
+ } else if ( transitionDuration.includes( 's' ) ) {
+ return parseFloat( transitionDuration ) * 1000; // Convert seconds to milliseconds
+ }
+
+ return 300;
+};
+
+const handleSticky = ( details: DetailsElement, animateHeight: ( isOpening: boolean ) => void ): void => {
+ const getStickyTopValue = (): number => {
+ const style = getComputedStyle( details );
+ return parseFloat( style.top ) || 0;
+ };
+
+ const checkAndCloseIfStuck = () => {
+ const stickyTop = getStickyTopValue();
+ const detailsRect = details.getBoundingClientRect();
+
+ if ( window.getComputedStyle( details ).position === 'sticky' && detailsRect.top <= stickyTop && details.open ) {
+ animateHeight( false ); // Use animateHeight for smooth closing
+ }
+ };
+
+ window.addEventListener( 'scroll', checkAndCloseIfStuck );
+};
+
+const initAccordion = ( el: HTMLElement ): void => {
+ const details = el as DetailsElement;
+ let animation: Animation | null = null;
+
+ const summary = details.querySelector( 'summary' ) as HTMLElement | null;
+ if ( ! summary ) {
+ return;
+ }
+
+ const calculateInitialMaxHeight = (): number => {
+ const style = getComputedStyle( details );
+ const borderTopWidth = parseFloat( style.borderTopWidth ) || 0;
+ const borderBottomWidth = parseFloat( style.borderBottomWidth ) || 0;
+ return summary.offsetHeight + borderTopWidth + borderBottomWidth;
+ };
+
+ details.style.maxHeight = `${ calculateInitialMaxHeight() }px`;
+
+ const getContentHeight = (): number => {
+ return Array.from( details.children )
+ .filter( ( child ) => child !== summary )
+ .reduce( ( totalHeight, child ) => {
+ const childEl = child as HTMLElement;
+ const style = getComputedStyle( childEl );
+ const marginTop = parseFloat( style.marginTop ) || 0;
+ const marginBottom = parseFloat( style.marginBottom ) || 0;
+ return totalHeight + childEl.offsetHeight + marginTop + marginBottom;
+ }, 0 );
+ };
+
+ const animateHeight = ( isOpening: boolean ) => {
+ const contentHeight = getContentHeight();
+ const summaryOuterHeight = calculateInitialMaxHeight();
+ const startHeight = `${ details.offsetHeight }px`;
+ const endHeight = isOpening ? `${ summaryOuterHeight + contentHeight }px` : `${ summaryOuterHeight }px`;
+
+ if ( ! isOpening ) {
+ details.classList.add( 'closing' );
+ }
+
+ details.style.overflow = 'hidden';
+ animation?.cancel();
+
+ animation = details.animate( { maxHeight: [ startHeight, endHeight ] }, {
+ duration: getTransitionDuration(),
+ easing: 'ease-out',
+ } );
+ animation.onfinish = () => {
+ animation = null;
+ details.style.overflow = '';
+ details.style.maxHeight = isOpening ? 'none' : `${ summaryOuterHeight }px`;
+
+ if ( ! isOpening ) {
+ details.classList.remove( 'closing' );
+ details.removeAttribute( 'open' );
+ }
+ };
+ };
+
+ handleSticky( details, animateHeight ); // Pass animateHeight to handleSticky
+
+ summary.addEventListener( 'click', ( e: MouseEvent ) => {
+ e.preventDefault();
+ const isOpening = ! details.open;
+ if ( isOpening ) {
+ details.setAttribute( 'open', '' );
+ }
+ animateHeight( isOpening );
+ } );
+};
+
+document.querySelectorAll( 'details:not([open])' ).forEach( ( el ) => {
+ if ( el instanceof HTMLElement ) {
+ initAccordion( el );
+ }
+} );
diff --git a/src/public/packery.tsx b/src/public/packery.tsx
new file mode 100644
index 0000000..4ca8cda
--- /dev/null
+++ b/src/public/packery.tsx
@@ -0,0 +1,26 @@
+import Packery from 'packery';
+import Draggabilly from 'draggabilly';
+
+const divs = document.querySelectorAll( '.packery' ) as NodeListOf;
+
+divs.forEach( ( div ) => {
+ const itemSelector = div.getAttribute( 'data-item-selector' ) ?? '.wp-block-group';
+ const gutter = div.getAttribute( 'data-gutter' ) ?? 16;
+ const originTop = div.getAttribute( 'data-origin-top' ) ?? true;
+ const draggable = div.getAttribute( 'data-draggable' ) || div.classList.contains( 'is-draggable' );
+
+ const pckry = new Packery(
+ div,
+ {
+ itemSelector,
+ gutter,
+ originTop,
+ }
+ );
+
+ if ( draggable ) {
+ pckry.items.forEach( ( item: any ): void => {
+ pckry.bindDraggabillyEvents( new Draggabilly( item.element ) );
+ } );
+ }
+} );
diff --git a/src/public/scroll.tsx b/src/public/scroll.tsx
index 90565b1..89ddfb2 100644
--- a/src/public/scroll.tsx
+++ b/src/public/scroll.tsx
@@ -1,8 +1,49 @@
-window.addEventListener( 'scroll', () => {
- const scroll = window.scrollY / ( document.body.offsetHeight - window.innerHeight );
-
- document.body.style.setProperty(
- '--scroll',
- scroll.toFixed( 2 ).toString()
- );
-}, false );
+type Procedure = ( ...args: T ) => unknown;
+
+function debounce( func: Procedure, waitMilliseconds: number ): ( ...args: T ) => void {
+ let timeoutId: number | undefined;
+
+ return ( ...args: T ) => {
+ clearTimeout( timeoutId );
+ timeoutId = window.setTimeout( () => {
+ func( ...args );
+ }, waitMilliseconds );
+ };
+}
+
+let lastKnownPosition = 0;
+let ticking = false;
+let maxScroll: number;
+let animatedElements: NodeListOf;
+
+const updateElements = () => {
+ const scrollPercentage = Math.min( Math.max( lastKnownPosition / maxScroll, 0 ), 1 ) * 100;
+ document.body.style.setProperty( '--scroll', scrollPercentage.toFixed( 0 ) );
+
+ animatedElements.forEach( ( el ) => {
+ const elementTop = el.getBoundingClientRect().top + window.scrollY;
+ const elementDistance = ( elementTop - lastKnownPosition ) / window.innerHeight * 100;
+ el.style.setProperty( '--scroll-amount', elementDistance.toFixed( 0 ) );
+ } );
+};
+
+const handleScroll = () => {
+ lastKnownPosition = window.scrollY;
+
+ if ( ! ticking ) {
+ window.requestAnimationFrame( () => {
+ updateElements();
+ ticking = false;
+ } );
+
+ ticking = true;
+ }
+};
+
+const initialize = () => {
+ maxScroll = document.body.offsetHeight - window.innerHeight;
+ animatedElements = document.querySelectorAll( '.has-scroll-animation' );
+ window.addEventListener( 'scroll', debounce( handleScroll, 10 ) );
+};
+
+initialize();
diff --git a/src/scss/abstracts/align-full.scss b/src/scss/abstracts/align-full.scss
index 577cf0d..66c348f 100644
--- a/src/scss/abstracts/align-full.scss
+++ b/src/scss/abstracts/align-full.scss
@@ -1,5 +1,5 @@
@mixin alignfull {
- width: var(--wp--custom--alignfull--width, 100vw) !important;
- margin-left: var(--wp--custom--alignfull--margin-left, calc(50% - 50vw)) !important;
- margin-right: var(--wp--custom--alignfull--margin-right, calc(50% - 50vw)) !important;
+ width: var(--wp--custom--alignfull--width, 100dvw) !important;
+ margin-left: var(--wp--custom--alignfull--margin-left, calc(50% - 50dvw)) !important;
+ margin-right: var(--wp--custom--alignfull--margin-right, calc(50% - 50dvw)) !important;
}
diff --git a/src/scss/abstracts/align-wide.scss b/src/scss/abstracts/align-wide.scss
index 6fc2944..c9f91b2 100644
--- a/src/scss/abstracts/align-wide.scss
+++ b/src/scss/abstracts/align-wide.scss
@@ -1,6 +1,6 @@
@mixin alignwide {
- width: 94vw !important;
- max-width: var(--wp--custom--layout--wide-size, 1200px) !important;
- margin-left: auto;
- margin-right: auto;
+ width: 100%;
+ min-width: var(--wp--style--global--wide-size) !important;
+ margin-left: 50%;
+ transform: translateX(-50%);
}
diff --git a/src/scss/abstracts/button.scss b/src/scss/abstracts/button.scss
index 99fa5db..6895be1 100644
--- a/src/scss/abstracts/button.scss
+++ b/src/scss/abstracts/button.scss
@@ -1,17 +1,47 @@
-$padding: var(--wp--custom--button--padding-top, 1em) var(--wp--custom--button--padding-right, 1.5em) var(--wp--custom--button--padding-bottom, 1em) var(--wp--custom--button--padding-left, 1.5em);
+$buttons: (
+ '.wp-element-button',
+ '.is-style-button',
+ '.button:not(.components-button)',
+ '[type="submit"]'
+);
@mixin button {
height: auto; // Editor component button styles.
color: var(--wp--custom--button--color, inherit);
- background: var(--wp--custom--button--background, inherit);
- padding: $padding;
+ padding: var(--wp--custom--button--padding-top, 8px) var(--wp--custom--button--padding-right, 16px) var(--wp--custom--button--padding-bottom, 8px) var(--wp--custom--button--padding-left, 16px);
border-radius: var(--wp--custom--button--border-radius, inherit);
border-width: var(--wp--custom--button--border-width);
font-size: var(--wp--custom--button--font-size);
font-weight: var(--wp--custom--button--font-weight);
- line-height: 1; // Force line height (unknown parent).
- display: inline-block;
+ font-variation-settings: var(--wp--custom--button--font-variation-settings);
text-decoration: none;
box-shadow: var(--wp--custom--button--box-shadow);
cursor: pointer;
+ -webkit-appearance: none;
+
+ // Layout.
+ display: inline-flex;
+ position: relative;
+ flex-wrap: wrap;
+ justify-content: center;
+ align-items: center;
+ align-content: center;
+ transition: var(--wp--custom--transition, inherit);
+ background-clip: padding-box !important; // Semi transparent borders.
+
+ &:hover,
+ &:focus {
+ box-shadow: var(--wp--custom--button--box-shadow--hover);
+ }
+
+ .is-style-dark &:not(.has-background) {
+ background: var(--wp--custom--dark-mode--button--background, var(--wp--custom--button--background));
+ }
+
+ @media(prefers-color-scheme: dark) {
+
+ .default-mode-auto:not(.is-style-light):not(.is-style-dark) &:not(.has-background) {
+ background: var(--wp--custom--dark-mode--ghost--color, var(--wp--custom--button--background));
+ }
+ }
}
diff --git a/src/scss/abstracts/ghost.scss b/src/scss/abstracts/ghost.scss
index 8c2c682..859901a 100644
--- a/src/scss/abstracts/ghost.scss
+++ b/src/scss/abstracts/ghost.scss
@@ -1,9 +1,15 @@
@mixin ghost {
background: transparent !important;
- color: inherit;
position: relative;
z-index: 0;
+ &:hover {
+
+ &::before {
+ opacity: var(--wp--custom--ghost--hover--opacity, 0.2);
+ }
+ }
+
&::before {
content: "";
position: absolute;
diff --git a/src/scss/abstracts/heading.scss b/src/scss/abstracts/heading.scss
index ca2877c..2aa7d38 100644
--- a/src/scss/abstracts/heading.scss
+++ b/src/scss/abstracts/heading.scss
@@ -1,8 +1,7 @@
@mixin heading {
-
- @for $index from 1 through 6 {
- h#{$index} {
- @content;
- }
- }
+ font-family: var(--wp--custom--heading--font-family);
+ font-weight: var(--wp--custom--heading--font-weight);
+ line-height: var(--wp--custom--heading--line-height);
+ letter-spacing: var(--wp--custom--heading--letter-spacing);
+ color: var(--wp--custom--heading--color);
}
diff --git a/src/scss/abstracts/input.scss b/src/scss/abstracts/input.scss
index 5427e20..3fe7701 100644
--- a/src/scss/abstracts/input.scss
+++ b/src/scss/abstracts/input.scss
@@ -1,14 +1,19 @@
-$padding: var(--wp--custom--button--padding-top, 1em) var(--wp--custom--button--padding-top, 1.2em) var(--wp--custom--button--padding-bottom, 1em);
+$padding: calc(var(--wp--custom--button--padding-top, 1em) - 1px) var(--wp--custom--button--padding-top, 1.2em) calc(var(--wp--custom--button--padding-bottom, 1em) - 1px);
@mixin input {
font: inherit;
transition: var(--wp--custom--transition, inherit);
- border: var(--wp--custom--input--border, var(--wp--custom--border, 0));
- border-radius: var(--wp--custom--button--border-radius, inherit);
+ border-width: var(--wp--custom--border--width, 1px);
+ border-radius: var(--wp--custom--input--border-radius, var(--wp--custom--border--radius, inherit));
+ border-style: var(--wp--custom--border--style, solid);
+ border-color: var(--wp--custom--border--color, currentColor);
background: var(--wp--custom--input--background, transparent);
+ box-shadow: var(--wp--custom--input--box-shadow, none);
outline: none;
+ line-height: var(--wp--custom--button--line-height, inherit);
&:focus {
- border-color: var(--wp--custom--input-focus--border-color, var(--wp--preset--color--primary, currentColor));
+ border-color: var(--wp--custom--input--focus--border-color, currentColor);
+ box-shadow: var(--wp--custom--input--focus--box-shadow, none);
}
}
diff --git a/src/scss/abstracts/notice.scss b/src/scss/abstracts/notice.scss
index d595741..52009fa 100644
--- a/src/scss/abstracts/notice.scss
+++ b/src/scss/abstracts/notice.scss
@@ -1,7 +1,7 @@
@mixin notice {
position: relative;
padding: var(--wp--custom--notice--padding, 1em);
- color: var(--wp--custom--notice--color, var(--wp--preset--color--primary));
+ color: var(--wp--custom--notice--color, currentColor);
border: var(--wp--custom--border--width) solid currentcolor;
border-radius: var(--wp--custom--border--radius);
font-size: var(--wp--custom--notice--font-size, var(--wp--preset--font-size--small));
diff --git a/src/scss/abstracts/shadow.scss b/src/scss/abstracts/shadow.scss
new file mode 100644
index 0000000..5c6ea78
--- /dev/null
+++ b/src/scss/abstracts/shadow.scss
@@ -0,0 +1,9 @@
+$presets: (
+ 'xxs',
+ 'xs',
+ 'sm',
+ 'md',
+ 'lg',
+ 'xl',
+ 'xxl',
+);
diff --git a/src/scss/abstracts/surface.scss b/src/scss/abstracts/surface.scss
index 9dd7842..1e09417 100644
--- a/src/scss/abstracts/surface.scss
+++ b/src/scss/abstracts/surface.scss
@@ -2,15 +2,41 @@
$border: var(--wp--custom--surface--border-width, $border-width) var(--wp--custom--surface--border-style, $border-style) var(--wp--custom--surface--border-color, $border-color);
+@mixin surface-overlay {
+
+ &::before {
+ content: "";
+ display: block;
+ position: absolute;
+ inset: 0;
+ background: var(--wp--custom--surface--overlay--background, transparent);
+ opacity: var(--wp--custom--surface--overlay--opacity, 1);
+ border-radius: inherit;
+ pointer-events: none;
+ width: 100% !important;
+ z-index: -1;
+ }
+
+ &::after {
+ content: '';
+ display: block;
+ position: absolute;
+ inset: 0;
+ backdrop-filter: var(--wp--custom--surface--backdrop-filter, none);
+ z-index: -1;
+ border-radius: inherit;
+ }
+}
+
@mixin surface {
- background: var(--wp--custom--surface--background, var(--wp--preset--color--surface));
border-top: var(--wp--custom--surface--border--top, $border);
border-right: var(--wp--custom--surface--border--right, $border);
border-bottom: var(--wp--custom--surface--border--bottom, $border);
border-left: var(--wp--custom--surface--border--left, $border);
border-radius: var(--wp--custom--surface--border-radius, $border-radius);
- padding: var(--wp--custom--surface--padding, var(--wp--preset--spacing--sm));
+ padding: var(--wp--custom--surface--padding, var(--wp--preset--spacing--xs));
box-shadow: var(--wp--custom--surface--box-shadow);
+ -webkit-backdrop-filter: var(--wp--custom--surface--backdrop-filter, none);
backdrop-filter: var(--wp--custom--surface--backdrop-filter, none);
position: relative;
@@ -18,18 +44,17 @@ $border: var(--wp--custom--surface--border-width, $border-width) var(--wp--custo
background: var(--wp--custom--surface--surface--background, inherit);
}
- // Overlay.
- &::before {
- content: "";
- display: block;
- position: absolute;
- inset: 0;
- background: var(--wp--custom--surface-overlay--background, transparent);
- opacity: var(--wp--custom--surface-overlay--opacity, 0);
- border-radius: inherit;
- pointer-events: none;
+ &[style*="background-color:"] {
+ --wp--custom--surface--overlay--background: transparent;
}
+ &:not(.has-background) {
+ background: var(--wp--custom--surface--background, transparent);
+ }
+
+ // Overlay.
+ @include surface-overlay;
+
> * {
position: relative;
}
diff --git a/src/scss/block-styles/badge.scss b/src/scss/block-styles/badge.scss
index 91d110c..a28e4b8 100644
--- a/src/scss/block-styles/badge.scss
+++ b/src/scss/block-styles/badge.scss
@@ -1,27 +1,27 @@
+@import "../abstracts/ghost.scss";
+
.is-style-badge,
-.is-style-badges > * {
+.is-style-badges > *:not(.wp-block-query-pagination-numbers),
+.is-style-badges .page-numbers {
position: relative;
- padding: var(--wp--custom--badge--padding, 0.66em 1em);
- border-radius: var(--wp--custom--border--radius, 0.5em);
+ padding: var(--wp--custom--badge--padding, 0.5em 0.75em);
+ margin-left: 0;
+ margin-right: 0;
+ border-radius: var(--wp--custom--border--radius, 4px);
text-decoration: none;
line-height: 1;
- font-size: var(--wp--custom--badge--font-size, inherit);
- font-weight: var(--wp--custom--badge--font-weight, bolder);
-
- &::before {
- content: "";
- background: currentcolor;
- position: absolute;
- inset: 0;
- opacity: var(--wp--custom--badge--opacity, 0.1);
- border-radius: inherit;
+
+ @include ghost;
+
+ &:hover {
+ --wp--custom--dark-mode--ghost--opacity: .12;
}
}
.is-style-badges {
display: flex;
flex-wrap: wrap;
- gap: 0.5em;
+ gap: var(--wp--custom--button--gap, 8px);
.wp-block-post-terms__separator,
.justify-center__separator {
@@ -31,4 +31,14 @@
&.has-text-align-right {
justify-content: flex-end;
}
+
+ .page-numbers {
+ display: inline-flex;
+ }
+
+ .wp-block-query-pagination-numbers {
+ display: flex;
+ justify-content: space-between;
+ gap: inherit;
+ }
}
diff --git a/src/scss/block-styles/button-ghost.scss b/src/scss/block-styles/button-ghost.scss
index 5ce44a2..cfea566 100644
--- a/src/scss/block-styles/button-ghost.scss
+++ b/src/scss/block-styles/button-ghost.scss
@@ -1,15 +1,17 @@
-@import "../abstracts/ghost";
+@import "../abstracts/button.scss";
+@import "../abstracts/ghost.scss";
-.wp-block-button__link {
+.is-style-ghost {
- .is-style-ghost & {
- @include ghost;
+ &:not(.wp-block-button) {
- color: var(--wp--custom--button-ghost--color, inherit);
+ @include ghost;
}
-}
-.is-style-ghost:not(.wp-block-button) {
+ .wp-block-button__link {
+ @include ghost;
- @include ghost;
+ color: var(--wp--custom--ghost--color, inherit);
+ }
}
+
diff --git a/src/scss/block-styles/button-outline.scss b/src/scss/block-styles/button-outline.scss
index 89b1139..738a9fc 100644
--- a/src/scss/block-styles/button-outline.scss
+++ b/src/scss/block-styles/button-outline.scss
@@ -1,43 +1,34 @@
-.wp-block-button__link {
+.is-style-outline {
- .wp-block-button.is-style-outline & {
- line-height: calc(1em - 4px);
+ &.wp-block-button {
+ padding: 0;
}
- .is-style-outline & {
+ .wp-element-button,
+ &.wp-block-button > .wp-block-button__link {
+ padding-top: calc(var(--wp--custom--button--padding-top) - var(--wp--custom--border--width, 1px));
+ padding-right: var(--wp--custom--button--padding-right);
+ padding-bottom: calc(var(--wp--custom--button--padding-bottom) - var(--wp--custom--border--width, 1px));
+ padding-left: var(--wp--custom--button--padding-left);
+ }
+
+ .wp-element-button,
+ .button {
+ display: inline-flex;
border-color: currentcolor;
background: transparent;
color: var(--wp--custom--button-outline--color, var(--wp--custom--button--background, var(--wp--preset--color--primary)));
- &.wp-element-button {
- padding: var(--wp--custom--button--padding, 0.9em 1.2em);
+ &:not([style*="border-width"]) {
+ border-width: var(--wp--custom--button-outline--border-width, 2px) !important;
}
- }
-
- .is-style-outline &:not([style*="border-width"]) {
- border-width: var(--wp--custom--button-outline--border-width, 2px) !important;
- }
-
- // Core override
- .wp-block-button.is-style-outline &:not(.has-text-color) {
- color: var(--wp--custom--button-outline--color, inherit) !important;
- }
-}
-
-// EDD & WooCommerce.
-.button.is-style-outline {
- display: inline-flex;
- line-height: calc(1em - 4px);
- border-color: currentcolor;
- background: transparent;
- color: var(--wp--preset--color--custom-button-outline, var(--wp--preset--color--primary));
- &:not([style*="border-width"]) {
- border-width: var(--wp--custom--button-outline--border-width, 2px) !important;
- }
+ &:not([style*="border-color"]) {
+ border-color: currentcolor;
+ }
- &:not([style*="border-color"]) {
- border-color: currentcolor;
+ &:not(.has-text-color) {
+ color: var(--wp--custom--button-outline--color, inherit) !important;
+ }
}
}
-
diff --git a/src/scss/block-styles/button-secondary.scss b/src/scss/block-styles/button-secondary.scss
index ee6a9c2..179c48b 100644
--- a/src/scss/block-styles/button-secondary.scss
+++ b/src/scss/block-styles/button-secondary.scss
@@ -1,7 +1,4 @@
-.wp-block-button__link {
-
- .is-style-secondary & {
- background: var(--wp--custom--button-secondary--background, var(--wp--preset--color--secondary));
- color: var(--wp--custom--button-secondary--color);
- }
+.is-style-secondary .wp-block-button__link {
+ background: var(--wp--custom--button-secondary--background, var(--wp--preset--color--secondary));
+ color: var(--wp--custom--button-secondary--color);
}
diff --git a/src/scss/block-styles/check-circle.scss b/src/scss/block-styles/check-circle.scss
new file mode 100644
index 0000000..8f1e416
--- /dev/null
+++ b/src/scss/block-styles/check-circle.scss
@@ -0,0 +1,33 @@
+$mask: url('data:image/svg+xml, ');
+
+.is-style-check-circle {
+ list-style: none;
+ padding-left: 1.5em;
+
+ ul {
+ list-style: none;
+ }
+
+ li {
+ width: 100%;
+
+ &::before {
+ content: "";
+ mask-position: center;
+ -webkit-mask-position: center;
+ mask-size: contain;
+ -webkit-mask-size: contain;
+ mask-repeat: no-repeat;
+ -webkit-mask-repeat: no-repeat;
+ mask-image: $mask;
+ -webkit-mask-image: $mask;
+ margin-left: -1.5em;
+ margin-top: 0.25em;
+ width: 1em;
+ height: 1em;
+ display: inline-block !important;
+ background: var(--wp--custom--checklist--color, currentColor);
+ position: absolute;
+ }
+ }
+}
diff --git a/src/scss/block-styles/check-outline.scss b/src/scss/block-styles/check-outline.scss
new file mode 100644
index 0000000..1c227aa
--- /dev/null
+++ b/src/scss/block-styles/check-outline.scss
@@ -0,0 +1,41 @@
+$mask: url("data:image/svg+xml;utf8, ");
+
+.is-style-checklist-circle,
+.is-style-check-outline {
+ list-style: none;
+ padding-left: 1.5em;
+
+ ul {
+ list-style: none;
+ }
+
+ li {
+ width: 100%;
+ display: inline-flex;
+ align-items: flex-start;
+ flex-wrap: nowrap;
+
+ &:last-of-type {
+ margin-bottom: 0;
+ }
+
+ &::before {
+ content: "";
+ margin: 0.3em 0.5em 0.3em -1.5em;
+ width: 1em;
+ height: 1em;
+ display: inline-block !important;
+ background: var(--wp--custom--checklist--background, var(--wp--preset--color--primary, currentColor));
+
+ // Mask (color doesn't work in content: url() or background-image).
+ mask-position: center;
+ -webkit-mask-position: center;
+ mask-size: contain;
+ -webkit-mask-size: contain;
+ mask-repeat: no-repeat;
+ -webkit-mask-repeat: no-repeat;
+ mask-image: $mask;
+ -webkit-mask-image: $mask;
+ }
+ }
+}
diff --git a/src/scss/block-styles/divider-fade.scss b/src/scss/block-styles/divider-fade.scss
index f8cd636..8a19ba4 100644
--- a/src/scss/block-styles/divider-fade.scss
+++ b/src/scss/block-styles/divider-fade.scss
@@ -1,9 +1,6 @@
@import "../abstracts/divider";
-.is-style-fade::before {
+.is-style-fade {
- @include divider();
-
- mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1));
- -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1));
+ @include divider(linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1)));
}
diff --git a/src/scss/block-styles/heading.scss b/src/scss/block-styles/heading.scss
new file mode 100644
index 0000000..ad3b484
--- /dev/null
+++ b/src/scss/block-styles/heading.scss
@@ -0,0 +1,6 @@
+@import "../abstracts/heading";
+
+.is-style-heading {
+
+ @include heading;
+}
diff --git a/src/scss/block-styles/list-dash.scss b/src/scss/block-styles/list-dash.scss
new file mode 100644
index 0000000..6a7aa6b
--- /dev/null
+++ b/src/scss/block-styles/list-dash.scss
@@ -0,0 +1,21 @@
+.is-style-dash {
+ list-style: none;
+ padding-left: 1.5em;
+
+ ul {
+ list-style: none;
+ }
+
+ li {
+ width: 100%;
+
+ &::before {
+ content: "-";
+ margin-left: -1.5em;
+ width: 1em;
+ height: 1em;
+ display: block;
+ float: left;
+ }
+ }
+}
diff --git a/src/scss/block-styles/list-heading.scss b/src/scss/block-styles/list-heading.scss
new file mode 100644
index 0000000..259553d
--- /dev/null
+++ b/src/scss/block-styles/list-heading.scss
@@ -0,0 +1,14 @@
+@import 'list-none';
+@import '../abstracts/heading';
+
+.is-style-list-heading {
+
+ @include is-style-none;
+ @include heading;
+
+ color: inherit;
+
+ ul {
+ font-weight: var(--wp--custom--body--font-weight, normal);
+ }
+}
diff --git a/src/scss/block-styles/list-none.scss b/src/scss/block-styles/list-none.scss
new file mode 100644
index 0000000..f304373
--- /dev/null
+++ b/src/scss/block-styles/list-none.scss
@@ -0,0 +1,16 @@
+@mixin is-style-none {
+ list-style: none;
+ padding-left: 0;
+ margin-bottom: 0.5em;
+
+ ul {
+ list-style: none;
+ margin-top: 0.5em;
+ padding-left: 1em;
+ }
+}
+
+ul.is-style-none {
+
+ @include is-style-none;
+}
diff --git a/src/scss/block-styles/sub-heading.scss b/src/scss/block-styles/sub-heading.scss
index 6f7c831..c0d112e 100644
--- a/src/scss/block-styles/sub-heading.scss
+++ b/src/scss/block-styles/sub-heading.scss
@@ -1,19 +1,22 @@
@import "../abstracts/text-gradient";
.is-style-sub-heading {
- font-size: var(--wp--custom--sub-heading--font-size, smaller);
line-height: var(--wp--custom--sub-heading--line-height);
- font-weight: var(--wp--custom--sub-heading--font-weight, bold);
+ font-weight: var(--wp--custom--sub-heading--font-weight, var(--wp--custom--font-weight--semi-bold));
text-transform: var(--wp--custom--sub-heading--text-transform, uppercase);
- letter-spacing: var(--wp--custom--sub-heading--letter-spacing, 0.33em);
- background: var(--wp--custom--sub-heading--background, currentColor);
+ letter-spacing: var(--wp--custom--sub-heading--letter-spacing, 0.1em);
word-break: break-word;
+ background: var(--wp--custom--sub-heading--background, transparent);
+ color: var(--wp--custom--sub-heading--color, currentColor);
+ border-radius: var(--wp--custom--sub-heading--border-radius, var(--wp--custom--border--radius));
+ padding: var(--wp--custom--sub-heading--padding, 0);
- @include text-gradient;
-}
+ &:not([class*="-font-size "]) {
+ font-size: var(--wp--custom--sub-heading--font-size, var(--wp--preset--font-size--12, 12px));
+ }
-// Override instead of important.
-p.is-style-sub-heading {
- margin: var(--wp--custom--sub-heading--margin-top, auto) var(--wp--custom--sub-heading--margin-right, auto) var(--wp--custom--sub-heading--margin-bottom, auto) var(--wp--custom--sub-heading--margin-left, auto);
-}
+ &[class*="-gradient-background"] {
+ @include text-gradient;
+ }
+}
diff --git a/src/scss/block-styles/surface.scss b/src/scss/block-styles/surface.scss
index a3d3b68..c79e380 100644
--- a/src/scss/block-styles/surface.scss
+++ b/src/scss/block-styles/surface.scss
@@ -1,4 +1,4 @@
-@import "../abstracts/surface";
+@import "../abstracts/surface.scss";
.is-style-surface {
diff --git a/src/scss/block-variations/accordion.scss b/src/scss/block-variations/accordion.scss
index 94e2f2c..1c9994b 100644
--- a/src/scss/block-variations/accordion.scss
+++ b/src/scss/block-variations/accordion.scss
@@ -1,106 +1,83 @@
.is-style-accordion {
- display: flex;
- flex-direction: column;
- gap: var(--wp--style--block-gap, inherit);
+ display: flex;
+ flex-direction: column;
+ gap: var(--wp--style--block-gap, inherit);
}
.is-style-accordion details {
- width: 100%;
- padding: 0;
+ width: 100%;
+ padding: 0;
- [data-stack="true"] & {
+ [data-stack="true"] & {
- &:not(:first-of-type) {
- border-top-left-radius: 0;
- border-top-right-radius: 0;
- }
+ &:not(:first-of-type) {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ }
- &:not(:last-of-type) {
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- }
- }
+ &:not(:last-of-type) {
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ }
+ }
}
.is-style-accordion summary {
- display: flex;
- justify-content: space-between;
- align-items: center;
- position: relative;
- cursor: pointer;
- border-radius: inherit;
-
- &::-webkit-details-marker {
- display: none;
- }
-
- strong {
- color: var(--wp--preset--color--heading, inherit);
- }
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ position: relative;
+ cursor: pointer;
+ border-radius: inherit;
+
+ &::-webkit-details-marker {
+ display: none;
+ }
+
+ strong {
+ color: var(--wp--custom--heading--color, inherit);
+ }
}
.is-style-accordion summary::marker {
- display: none;
- content: "";
+ display: none;
+ content: "";
}
-// Vertical.
.accordion-toggle {
- position: relative;
- height: 0.1em;
- width: 2em;
-
- &::after,
- &::before {
- content: "";
- width: var(--wp--custom--accordion-toggle-icon--width, 1em);
- height: 2px;
- display: inline-block !important;
- background: currentcolor;
- position: absolute;
- right: 0;
- top: 0;
- opacity: 1;
- transition: var(--wp--custom--transition, opacity 1s ease-in-out);
- }
-
- &::after {
- transform: rotate(90deg);
- }
+ position: relative;
+ height: 1em;
+ width: 1em;
+ border: var(--wp--custom--accordion--border, 0);
+ border-radius: .5em;
+
+ &::after,
+ &::before {
+ content: "";
+ height: var(--wp--custom--accordion--height, 2px);
+ width: var(--wp--custom--accordion--width, 1em);
+ display: inline-block !important;
+ background: currentcolor;
+ position: absolute;
+ inset: 0;
+ margin: auto;
+ opacity: 1;
+ transition: transform var(--wp--custom--accordion--animation-duration, 0s) var(--wp--custom--transition--timing-function, ease-in);
+ }
+
+ &::after {
+ transform: scaleY(1) rotate(90deg);
+ }
}
.is-style-accordion details[open] summary span::after {
- opacity: 0;
+ transform: scaleY(0) rotate(90deg);
}
.is-style-accordion section {
- display: block;
- padding-top: var(--wp--style--block-gap);
+ display: block;
}
.is-style-accordion hr {
- margin: 0;
-}
-
-details {
- transition: var(--wp--custom--transition);
-}
-
-details > section {
- transition: var(--wp--custom--transition);
-
- &.is-open {
- animation: accordion-open 0.2s ease-in-out;
- }
-}
-
-@keyframes accordion-open {
-
- 0% {
- height: 0;
- }
-
- 100% {
- height: var(--height);
- }
+ margin: 0;
}
diff --git a/src/scss/block-variations/icon.scss b/src/scss/block-variations/icon.scss
index 8a107d3..17548a2 100644
--- a/src/scss/block-variations/icon.scss
+++ b/src/scss/block-variations/icon.scss
@@ -2,6 +2,10 @@
--wp--custom--icon-container--width: auto;
}
+.is-style-icon {
+ line-height: 1;
+}
+
.wp-block-image__icon {
display: flex;
width: var(--wp--custom--icon-container--width, auto);
@@ -14,6 +18,7 @@
color: var(--wp--custom--icon--color, currentColor);
justify-content: center;
align-items: center;
+ aspect-ratio: 1;
.alignleft & {
justify-content: flex-start;
@@ -27,13 +32,13 @@
justify-content: flex-end;
}
- &::after {
+ &.has-gradient::after {
content: "";
display: inline-block;
position: relative;
background: var(--wp--custom--icon--color);
- height: var(--wp--custom--icon--size, 30px);
- width: var(--wp--custom--icon--size, 30px);
+ height: var(--wp--custom--icon--size, 1.5em);
+ width: var(--wp--custom--icon--size, 1.5em);
vertical-align: text-bottom;
-webkit-mask-image: var(--wp--custom--icon--url);
-webkit-mask-position: center;
@@ -45,13 +50,17 @@
display: none;
}
- &.has-background:not(.has-text-color) {
- background: transparent !important;
+ svg:not([width]) {
+ width: var(--wp--custom--icon--size, 1.5em);
+ }
+
+ svg:not([height]) {
+ height: var(--wp--custom--icon--size, 1.5em);
}
}
.is-style-icon.has-box-shadow {
- box-shadow: none;
+ box-shadow: none !important;
> *:first-of-type {
box-shadow: var(--wp--custom--box-shadow--inset) var(--wp--custom--box-shadow--x) var(--wp--custom--box-shadow--y) var(--wp--custom--box-shadow--blur) var(--wp--custom--box-shadow--spread) var(--wp--custom--box-shadow--color);
@@ -62,3 +71,15 @@
.wp-block-image.is-style-icon.alignright {
float: none;
}
+
+.wp-block-image {
+
+ &.is-style-icon {
+ justify-content: center;
+ align-items: center;
+
+ svg {
+ height: auto;
+ }
+ }
+}
diff --git a/src/scss/block-variations/marquee.scss b/src/scss/block-variations/marquee.scss
index f163962..c473c66 100644
--- a/src/scss/block-variations/marquee.scss
+++ b/src/scss/block-variations/marquee.scss
@@ -2,10 +2,12 @@
display: flex;
overflow: hidden;
user-select: none;
- gap: var(--marquee-gap, var(--wp--style--block-gap));
+ gap: var(--marquee-gap, var(--wp--style--block-gap, 1em));
width: 100%;
max-width: 100dvw;
min-width: 100%;
+ will-change: transform;
+ border-radius: inherit;
&:hover,
&:focus,
@@ -53,6 +55,11 @@
margin: 0;
}
+.fade-edges {
+ mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 12.5%, rgb(0, 0, 0) 87.5%, rgba(0, 0, 0, 0) 100%);
+ -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 12.5%, rgb(0, 0, 0) 87.5%, rgba(0, 0, 0, 0) 100%);
+}
+
@media (prefers-reduced-motion) {
.is-marquee > * {
@@ -74,6 +81,6 @@
}
100% {
- transform: translateX(calc(-100% - var(--wp--style--block-gap, 1em)));
+ transform: translateX(calc(-100% - var(--marquee-gap, var(--wp--style--block-gap, 1em))));
}
}
diff --git a/src/scss/block-variations/svg.scss b/src/scss/block-variations/svg.scss
new file mode 100644
index 0000000..de55df1
--- /dev/null
+++ b/src/scss/block-variations/svg.scss
@@ -0,0 +1,32 @@
+.wp-block-image {
+
+ &.is-style-svg {
+ margin: 0;
+
+ img[src="#"],
+ figcaption {
+ display: none;
+ }
+
+ svg {
+ display: block;
+ }
+ }
+
+ &__svg {
+ display: block;
+ max-width: none;
+ background: currentColor;
+ -webkit-mask-repeat: no-repeat;
+ -webkit-mask-size: contain;
+ -webkit-mask-position: center;
+ }
+}
+
+.aligncenter {
+
+ > .wp-block-image__svg {
+ margin-left: auto;
+ margin-right: auto;
+ }
+}
diff --git a/src/scss/blocks/avatar.scss b/src/scss/blocks/avatar.scss
new file mode 100644
index 0000000..5ae54d7
--- /dev/null
+++ b/src/scss/blocks/avatar.scss
@@ -0,0 +1,7 @@
+.wp-block-avatar {
+
+ &__link,
+ &__image {
+ display: block;
+ }
+}
diff --git a/src/scss/blocks/block.scss b/src/scss/blocks/block.scss
new file mode 100644
index 0000000..7e117fd
--- /dev/null
+++ b/src/scss/blocks/block.scss
@@ -0,0 +1,3 @@
+.wp-block-block {
+ margin-top: 0;
+}
diff --git a/src/scss/blocks/button.scss b/src/scss/blocks/button.scss
index 49c42c2..a0d8613 100644
--- a/src/scss/blocks/button.scss
+++ b/src/scss/blocks/button.scss
@@ -1,16 +1,31 @@
.wp-block-button {
+ --wp--style--block-gap: var(--wp--custom--button--gap, 6px);
+
transition: var(--wp--custom--transition);
line-height: 1;
border-style: none;
+ padding: 0 !important;
&:active,
&:hover,
&:focus {
- opacity: var(--wp--custom--button--hover-opacity, 0.82);
+ opacity: var(--wp--custom--button--hover-opacity, 1);
}
&__link {
display: inline-flex;
+ gap: var(--wp--style--block-gap);
+
+ .is-content-justification-left .wp-block-button__width-100 & {
+ justify-content: flex-start;
+ }
+ }
+
+ &[style*="font-weight:"] {
+
+ .wp-element-button {
+ font-weight: inherit;
+ }
}
}
diff --git a/src/scss/blocks/calendar.scss b/src/scss/blocks/calendar.scss
new file mode 100644
index 0000000..8be7895
--- /dev/null
+++ b/src/scss/blocks/calendar.scss
@@ -0,0 +1,82 @@
+@import "../abstracts/ghost";
+
+.wp-block-calendar {
+ border: var(--wp--custom--border);
+ border-radius: var(--wp--custom--border--radius);
+ background: var(--wp--custom--calendar--background, var(--wp--custom--body--background));
+
+ caption {
+ padding: 1em 0;
+ font-weight: var(--wp--custom--font-weight--medium);
+ }
+
+ table {
+ border: 0;
+ line-height: 1;
+ text-align: center;
+ background: transparent;
+
+ &:where(:not(.has-text-color)) {
+ color: inherit;
+
+ td,
+ th {
+ border-color: var(--wp--custom--border--color);
+ }
+ }
+ }
+
+ td,
+ th {
+ padding: 1em 0;
+ text-align: center;
+ background: transparent;
+
+ a {
+ padding: .5em;
+ margin: -.5em;
+ border-radius: 99px;
+ background: var(--wp--preset--color--primary-500);
+ line-height: 1;
+ width: 2em;
+
+ @include ghost;
+ }
+ }
+
+ a {
+ display: inline-flex;
+ justify-content: center;
+ align-items: center;
+ text-decoration: none;
+ }
+
+ thead {
+
+ th {
+
+ &:first-of-type {
+ border-top-left-radius: inherit;
+ }
+
+ &:last-of-type {
+ border-top-right-radius: inherit;
+ }
+ }
+ }
+
+ tbody {
+ }
+
+ nav {
+ padding: 1em 0;
+ }
+}
+
+:where(.wp-block-calendar table:not(.has-background) th) {
+ background: transparent;
+}
+
+.wp-calendar-table {
+
+}
diff --git a/src/scss/blocks/code.scss b/src/scss/blocks/code.scss
index 2a8d9e7..5dc6103 100644
--- a/src/scss/blocks/code.scss
+++ b/src/scss/blocks/code.scss
@@ -14,3 +14,22 @@
padding: 0.5em 0;
}
}
+
+.shcb-loc {
+
+ .fade-in {
+ opacity: 0;
+ transition: opacity 0.2s ease-in-out;
+ animation: fade-in;
+ }
+}
+
+@keyframes fade-in {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
diff --git a/src/scss/blocks/columns.scss b/src/scss/blocks/columns.scss
new file mode 100644
index 0000000..79147de
--- /dev/null
+++ b/src/scss/blocks/columns.scss
@@ -0,0 +1,4 @@
+// Core important override.
+.wp-block-columns:not(.are-vertically-aligned-top,.are-vertically-aligned-center,.are-vertically-aligned-bottom) {
+ align-items: flex-start !important;
+}
diff --git a/src/scss/blocks/comments-title.scss b/src/scss/blocks/comments-title.scss
new file mode 100644
index 0000000..a47059e
--- /dev/null
+++ b/src/scss/blocks/comments-title.scss
@@ -0,0 +1,17 @@
+@import "../abstracts/text-gradient";
+
+.wp-block-comments-title {
+ word-break: break-word;
+
+ &[class*="-font-size"] {
+ line-height: var(--wp--custom--heading--line-height, 1.5);
+ }
+
+ &[class*="-gradient-background"]:not(.has-text-color),
+ &[style*="-gradient("]:not(.has-text-color) {
+
+ @include text-gradient;
+ }
+}
+
+
diff --git a/src/scss/blocks/details.scss b/src/scss/blocks/details.scss
new file mode 100644
index 0000000..b30c795
--- /dev/null
+++ b/src/scss/blocks/details.scss
@@ -0,0 +1,110 @@
+@import '../abstracts/heading';
+
+.wp-block-details {
+ width: 100%;
+ padding: 0;
+
+ [data-stack="true"] & {
+
+ &:not(:first-of-type) {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ }
+
+ &:not(:last-of-type) {
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ }
+ }
+
+ summary {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ position: relative;
+ cursor: pointer;
+ border-radius: inherit;
+ padding-right: calc(var(--wp--style--block-gap, 1em) * 1.5);
+ font-weight: var(--wp--custom--summary--font-weight, var(--wp--custom--font-weight--medium, 500));
+
+ &::-webkit-details-marker {
+ display: none;
+ }
+
+ &::marker {
+ display: none;
+ content: "";
+ }
+
+ strong {
+ color: var(--wp--custom--heading--color, inherit);
+ }
+ }
+
+ section:not([hidden]) {
+ display: block;
+ }
+
+ hr {
+ margin: 0;
+ }
+
+ summary::after,
+ summary::before {
+ content: "";
+ height: var(--wp--custom--accordion--height, 2px);
+ width: var(--wp--custom--accordion--width, 1em);
+ display: inline-block;
+ background: currentcolor;
+ position: absolute;
+ inset: 0 0 0 auto;
+ margin: auto;
+ opacity: 1;
+ transition: transform var(--wp--custom--accordion--animation-duration, 0s) var(--wp--custom--transition--timing-function, ease-in);
+ }
+
+ summary::after {
+ transform: scaleY(1) rotate(90deg);
+ }
+
+ &[open]:not(.closing) summary::after {
+ transform: scaleY(0) rotate(90deg);
+ }
+
+ &:not(.is-style-plus) {
+
+ summary::before {
+ display: none;
+ }
+
+ summary::after {
+ height: 1.5em;
+ width: 1.5em;
+ margin-right: -.333em;
+ transform: rotate(0deg);
+ mask-image: url('data:image/svg+xml;utf8, ');
+ mask-size: contain;
+ mask-repeat: no-repeat;
+ mask-position: center;
+ -webkit-mask-size: contain;
+ -webkit-mask-repeat: no-repeat;
+ -webkit-mask-position: center;
+ -webkit-mask-image: url('data:image/svg+xml;utf8, ');
+ background: currentcolor;
+ }
+
+ &[open]:not(.closing) summary::after {
+ transform: rotate(180deg);
+ }
+ }
+}
+
+.is-style-summary-heading {
+
+ summary {
+
+ @include heading;
+
+ color: inherit;
+ }
+}
diff --git a/src/scss/blocks/group.scss b/src/scss/blocks/group.scss
index a332148..5545d87 100644
--- a/src/scss/blocks/group.scss
+++ b/src/scss/blocks/group.scss
@@ -3,6 +3,11 @@
.wp-block-column > & {
max-width: 100% !important;
}
+
+ &.is-vertical {
+ flex-direction: column;
+ gap: 1em;
+ }
}
// Gutenberg override.
diff --git a/src/scss/blocks/heading.scss b/src/scss/blocks/heading.scss
index b0d786c..47113fc 100644
--- a/src/scss/blocks/heading.scss
+++ b/src/scss/blocks/heading.scss
@@ -2,10 +2,16 @@
.wp-block-heading {
word-break: break-word;
-}
-.wp-block-heading[class*="-gradient-background"]:not(.has-text-color),
-.wp-block-heading[style*="-gradient("]:not(.has-text-color) {
+ &[class*="-font-size"] {
+ line-height: var(--wp--custom--heading--line-height, 1.5);
+ }
+
+ &[class*="-gradient-background"]:not(.has-text-color),
+ &[style*="-gradient("]:not(.has-text-color) {
- @include text-gradient;
+ @include text-gradient;
+ }
}
+
+
diff --git a/src/scss/blocks/image.scss b/src/scss/blocks/image.scss
index ab97a75..7484d2d 100644
--- a/src/scss/blocks/image.scss
+++ b/src/scss/blocks/image.scss
@@ -8,6 +8,9 @@
&:not(.is-style-icon) > div {
max-width: 100% !important;
+ aspect-ratio: inherit;
+ object-fit: inherit;
+ object-position: inherit;
}
svg {
@@ -21,45 +24,24 @@
}
}
- &.is-style-icon {
-
- svg {
- height: auto;
- }
- }
-
a {
display: inherit;
+ object-position: inherit;
}
- &.is-style-svg {
- margin: 0;
+ &[style*="-radius"] {
- img[src="#"],
- figcaption {
- display: none;
- }
-
- svg {
- display: block;
+ img {
+ border-radius: inherit;
}
}
-
- &__svg {
- display: block;
- max-width: none;
- background: currentColor;
- -webkit-mask-repeat: no-repeat;
- -webkit-mask-size: contain;
- -webkit-mask-position: center;
- }
}
figure.wp-block-image {
text-align: center;
&.aligncenter {
- display: block !important;
+ display: block;
}
img {
@@ -68,5 +50,6 @@ figure.wp-block-image {
max-width: 100%;
margin-left: auto;
margin-right: auto;
+ object-position: inherit;
}
}
diff --git a/src/scss/blocks/navigation-submenu.scss b/src/scss/blocks/navigation-submenu.scss
new file mode 100644
index 0000000..3ea08e6
--- /dev/null
+++ b/src/scss/blocks/navigation-submenu.scss
@@ -0,0 +1,186 @@
+@import '../abstracts/surface.scss';
+
+$navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
+$gap: var(--wp--custom--navigation--padding, var(--wp--preset--spacing--xs, 1em));
+
+.wp-block-navigation__submenu-container {
+ gap: $gap;
+
+ .is-vertical & {
+ gap: inherit;
+ }
+
+ .is-vertical.hide-submenu & {
+ display: none;
+ }
+
+ .is-vertical.hide-sub-submenu & .wp-block-navigation__submenu-container {
+ display: none;
+ }
+
+ // Core override.
+ .wp-block-navigation:not(.has-background) & {
+ color: inherit;
+ }
+}
+
+/**
+ * Toggle.
+ */
+.wp-block-navigation__submenu-icon {
+ background: transparent !important;
+
+ .wp-block-navigation & {
+ width: 0.75em;
+ height: 0.75em;
+ opacity: 0.5;
+ }
+}
+
+.wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-submenu__toggle {
+ padding-right: .75em;
+}
+
+.wp-block-navigation-submenu__toggle {
+ font-weight: inherit;
+}
+
+/**
+ * Vertical.
+ */
+
+.wp-block-navigation.is-vertical {
+
+ .wp-block-navigation__submenu-icon {
+ display: none;
+ }
+
+ .has-child {
+ margin-bottom: 0;
+ gap: inherit;
+
+ .wp-block-navigation__submenu-container {
+ position: relative;
+ height: auto;
+ opacity: 1;
+ visibility: visible;
+ width: 100%;
+ background-color: transparent !important;
+ left: auto;
+ top: auto;
+ padding: 0;
+ border: inherit;
+ }
+
+ > .wp-block-pages-list__item__link {
+ margin-bottom: var(--wp--style--block-gap, 1em);
+ }
+ }
+}
+
+// Core override.
+.wp-block-navigation .has-child:not(.open-on-click):hover > .wp-block-navigation__submenu-container {
+ min-width: var(--wp--custom--navigation--sub-menu--min-width, 12em);
+}
+
+@media (max-width: 782px) {
+
+ .open-on-click {
+ margin-bottom: var(--wp--style--block-gap, 1em) !important;
+
+ .wp-block-navigation-submenu__toggle {
+
+ .wp-block-navigation__submenu-icon {
+ display: flex !important;
+ width: 2em;
+ }
+
+ & ~ .wp-block-navigation__submenu-container {
+ display: none !important;
+ }
+
+ &[aria-expanded="true"] ~ .wp-block-navigation__submenu-container {
+ display: flex !important;
+ }
+ }
+ }
+
+ .wp-block-navigation__submenu-container {
+ gap: $gap !important;
+ padding: $navigation_padding 0 0;
+ }
+
+ .wp-block-navigation__responsive-container .wp-block-navigation__submenu-container {
+ padding-left: 0 !important;
+ padding-right: 0 !important;
+ }
+}
+
+// Use same breakpoint as core columns block for consistency.
+// TODO: Allow custom breakpoint.
+@media (min-width: 782px) {
+
+ .wp-block-navigation:not(.is-vertical) .wp-block-navigation__submenu-container {
+
+ @include surface-overlay;
+
+ .wp-block-navigation__submenu-container {
+
+ @include surface-overlay;
+ }
+
+ .wp-block-navigation-item__label {
+ white-space: pre-wrap !important;
+ }
+ }
+
+ .wp-block-navigation__submenu-container {
+
+ .wp-block-navigation:not(.is-vertical) & {
+ border: var(--wp--custom--submenu--border, none) !important;
+ border-radius: var(--wp--custom--submenu--border-radius, var(--wp--custom--border--radius));
+ box-shadow: var(--wp--custom--submenu--box-shadow, var(--wp--preset--shadow--sm));
+ line-height: 1;
+ }
+
+ .wp-block-navigation:not(.is-vertical) .has-child:not(.open-on-click) & {
+ transform: translateY($gap);
+ opacity: 0;
+ }
+
+ .wp-block-navigation:not(.is-vertical) & .wp-block-navigation-item {
+ padding: 0 $gap;
+
+ &:first-of-type {
+ padding-top: $gap;
+ }
+
+ &:last-of-type {
+ padding-bottom: $gap;
+ }
+ }
+
+ .wp-block-navigation:not(.has-background) & {
+ background: transparent;
+ color: inherit;
+ }
+
+ .wp-block-navigation .wp-block-navigation-item.has-child & {
+ transition: var(--wp--custom--transition);
+ }
+
+ .wp-block-navigation:not(.is-vertical) .has-child:not(.open-on-click):hover & {
+ transform: translateY(0);
+ opacity: 1;
+
+ .wp-block-navigation__submenu-container {
+ top: calc(0px - (var(--wp--custom--navigation--padding, var(--wp--preset--spacing--xs, 1em))));
+ }
+ }
+ }
+
+ .wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded="true"] + .wp-block-navigation__submenu-container {
+ transform: translateY(0);
+ opacity: 1;
+ }
+}
diff --git a/src/scss/blocks/navigation.scss b/src/scss/blocks/navigation.scss
index 683088a..e7d821f 100644
--- a/src/scss/blocks/navigation.scss
+++ b/src/scss/blocks/navigation.scss
@@ -1,4 +1,4 @@
-$navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
+$gap: var(--wp--custom--navigation--padding, var(--wp--preset--spacing--xs, 1em));
.wp-block-navigation {
@@ -6,12 +6,9 @@ $navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
text-decoration: inherit;
}
- // 782px hardcoded in core.
- @media (max-width: 782px) {
-
- & {
- font-size: 1em;
- }
+ .wp-block-navigation &-item {
+ background: inherit !important;
+ border-radius: inherit;
}
.wp-block-navigation-item:not(.has-background) {
@@ -22,15 +19,60 @@ $navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
display: flex;
padding: 0;
+ &:hover,
+ &:focus {
+ color: var(--wp--custom--link--hover--color, currentColor);
+ }
+
&.wp-block-navigation-submenu__toggle {
padding-left: 0;
padding-right: 0;
}
}
+
+ .wp-block-pages-list__item {
+ width: auto;
+ }
+
+ &:not(.is-responsive,.is-vertical) {
+ margin: auto;
+ }
+
+ &__container {
+
+ &.items-justified-right {
+ margin-right: 0;
+ }
+ }
+}
+
+/**
+ * Responsive container.
+ */
+
+.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
+ background: var(--wp--custom--body--background, #fff);
+ color: currentcolor; // #000 hardcoded in core.
}
-.wp-block-navigation:not(.is-responsive) {
- margin: auto;
+.wp-block-navigation.has-backdrop-filter {
+ -webkit-backdrop-filter: none !important;
+ backdrop-filter: none !important;
+
+ .wp-block-navigation__responsive-container.is-menu-open {
+ -webkit-backdrop-filter: var(--wp--custom--nav--filter, blur(10px));
+ backdrop-filter: var(--wp--custom--nav--filter, blur(10px));
+ background-color: transparent;
+
+ &:before {
+ content: '';
+ position: fixed;
+ inset: 0;
+ background: var(--wp--custom--nav--background-color, inherit);
+ opacity: 0.5;
+ z-index: -1;
+ }
+ }
}
.wp-block-navigation__responsive-container-close,
@@ -39,36 +81,60 @@ $navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
color: currentcolor !important;
svg {
- width: 30px;
- height: 30px;
+ width: 1.5em;
+ height: 1.5em;
}
}
-.wp-block-navigation__responsive-container.is-menu-open {
- padding: var(--wp--preset--spacing--md);
- min-height: 100vh;
+.wp-block-navigation__responsive-container {
+
+ &.is-menu-open {
+ --wp--custom--nav--padding: 0;
+
+ top: var(--wp-admin--admin-bar--height, 0);
+ padding: var(--wp--preset--spacing--md);
+ min-height: 100vh;
+
+ .wp-block-navigation__responsive-container-content {
+
+ .wp-block-navigation-item {
+ padding-top: var(--wp--custom--nav--padding, 0);
+ padding-bottom: var(--wp--custom--nav--padding, 0);
+ }
+
+ .wp-block-navigation__container {
+ gap: $gap;
+ }
+ }
+ }
}
-.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
- background: var(--wp--custom--body--background, #fff);
- color: currentcolor; // #000 hardcoded in core.
+.wp-block-navigation:not(.is-vertical) .wp-block-navigation__responsive-container-content {
+ row-gap: inherit;
}
-// TODO: Remove when merged into core or Gutenberg active.
.has-modal-open .admin-bar .wp-block-navigation__responsive-dialog {
- margin-top: 46px;
+ margin-top: 0 !important;
+}
+
+nav.wp-block-navigation.has-position-static {
+
+ .wp-block-navigation__responsive-container,
+ .wp-block-navigation__responsive-dialog {
+ position: static;
+ }
}
// Theme.json doesn't work.
.wp-block-navigation:not(.is-vertical) .wp-block-navigation-item {
margin-bottom: 0;
+}
- &:not(.has-child) {
-
- @media (max-width: 782px) {
- margin-bottom: var(--wp--style--block-gap, 1em);
- }
- }
+ul.wp-block-navigation__container > li,
+.wp-block-page-list .wp-block-pages-list__item,
+.has-mega-menu {
+ padding-top: var(--wp--custom--nav--padding, 0);
+ padding-bottom: var(--wp--custom--nav--padding, 0);
}
/**
@@ -77,43 +143,16 @@ $navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
.wp-block-navigation.is-vertical {
- .wp-block-navigation__submenu-icon {
- display: none;
- }
-
.wp-block-navigation-item {
padding: 0;
flex-wrap: wrap;
- margin-bottom: var(--wp--style--block-gap, 1em);
- }
-
- .has-child {
- margin-bottom: 0;
-
- .wp-block-navigation__submenu-container {
- position: relative;
- height: auto;
- opacity: 1;
- visibility: visible;
- width: 100%;
- background-color: transparent !important;
- left: auto;
- top: auto;
- padding: 0;
- }
-
- > .wp-block-pages-list__item__link {
- margin-bottom: var(--wp--style--block-gap, 1em);
- }
}
}
-.wp-block-navigation__responsive-container .wp-block-navigation-link a {
-
- &:hover,
- &:focus {
- color: var(--wp--preset--color--primary);
- }
+.wp-block-navigation__responsive-container .current-menu-item > .wp-block-navigation-item__content,
+.wp-block-navigation__responsive-container .wp-block-navigation-link a:hover,
+.wp-block-navigation__responsive-container .wp-block-navigation-link a:focus {
+ color: var(--wp--custom--link--hover--color, currentColor);
}
:where(.wp-block-navigation.has-background .wp-block-navigation-item a:not(.wp-element-button)),
@@ -123,18 +162,24 @@ $navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
@media (max-width: 782px) {
- .wp-block-navigation .wp-block-navigation-item.has-child {
- padding-bottom: 0;
- }
+ .wp-block-navigation {
- .wp-block-navigation__submenu-container {
- gap: var(--wp--custom--submenu--gap);
- padding: $navigation_padding 0 0;
+ .wp-block-navigation-item.has-child {
+ padding-bottom: 0;
+ }
}
- .wp-block-navigation__responsive-container .wp-block-navigation__submenu-container {
- padding-left: 0 !important;
- padding-right: 0 !important;
+ // Make button font size slightly large on mobile.
+ .is-responsive .wp-block-navigation__responsive-container-open:not(.always-shown) {
+
+ &,
+ & + .wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-close {
+ font-size: var(--wp--custom--navigation-button--font-size, 120%);
+ }
+
+ & + .wp-block-navigation__responsive-container .wp-block-navigation__container {
+ font-size: var(--wp--custom--navigation--font-size--mobile, 110%);
+ }
}
}
@@ -162,11 +207,6 @@ $navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
// TODO: Allow custom breakpoint.
@media (min-width: 782px) {
- ul.wp-block-navigation__container > li,
- ul.wp-block-page-list > li {
- padding: calc(var(--wp--style--block-gap, 1em) / 2) 0;
- }
-
.is-vertical ul li {
padding: 0;
}
@@ -189,92 +229,8 @@ $navigation_padding: calc(var(--wp--style--block-gap, 1em) / 2);
.wp-block-navigation-item__label {
white-space: nowrap !important;
+ display: block;
}
-
- .wp-block-navigation__submenu-container .wp-block-navigation-item__label {
- white-space: pre-wrap !important;
- }
-
- .wp-block-navigation__submenu-container {
-
- &::before {
- content: "";
- position: absolute;
- backdrop-filter: var(--wp--custom--surface--backdrop-filter, none);
- inset: 0 !important;
- width: 100% !important;
- background: var(--wp--custom--surface-overlay--background, transparent);
- opacity: 1;
- border-radius: inherit;
- pointer-events: none;
- }
- }
-}
-
-
-/**
- * Submenu
- */
-
-.wp-block-navigation__submenu-container {
- border: none;
- border-radius: var(--wp--custom--submenu--border-radius, var(--wp--custom--border--radius));
- gap: var(--wp--custom--submenu--gap);
-
- .wp-block-navigation-item {
- padding: 0.5em 1em;
-
- &:first-of-type {
- padding-top: 1em;
- border-top-left-radius: inherit;
- border-top-right-radius: inherit;
- }
-
- &:last-of-type {
- padding-bottom: 1em;
- border-bottom-left-radius: inherit;
- border-bottom-right-radius: inherit;
- }
- }
-}
-
-.wp-block-navigation__submenu-icon {
- background: transparent !important;
-}
-
-.wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-submenu__toggle {
- padding-right: .75em;
-}
-
-.wp-block-navigation-submenu__toggle {
- font-weight: inherit;
-}
-
-.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
- border: 0;
- background: transparent;
- color: inherit;
}
-@media (max-width: 782px) {
-
- .open-on-click {
- margin-bottom: var(--wp--style--block-gap, 1em) !important;
-
- .wp-block-navigation-submenu__toggle {
-
- .wp-block-navigation__submenu-icon {
- display: flex !important;
- width: 2em;
- }
-
- & ~ .wp-block-navigation__submenu-container {
- display: none !important;
- }
-
- &[aria-expanded="true"] ~ .wp-block-navigation__submenu-container {
- display: flex !important;
- }
- }
- }
-}
+@import "navigation-submenu";
diff --git a/src/scss/blocks/page-list.scss b/src/scss/blocks/page-list.scss
index d595d33..04d0e30 100644
--- a/src/scss/blocks/page-list.scss
+++ b/src/scss/blocks/page-list.scss
@@ -1,5 +1,14 @@
.wp-block-page-list {
+ .wp-block-navigation.is-vertical & .has-child .wp-block-pages-list__item__link,
+ .wp-block-navigation.is-vertical & .wp-block-navigation-item {
+ margin-bottom: 0;
+ }
+
+ .wp-block-navigation:not(.is-vertical) .wp-block-navigation__responsive-container:not(.is-menu-open) & {
+ row-gap: 0 !important;
+ }
+
}
.wp-block-pages-list {
diff --git a/src/scss/blocks/post-author.scss b/src/scss/blocks/post-author.scss
index 3f243c9..47db2ab 100644
--- a/src/scss/blocks/post-author.scss
+++ b/src/scss/blocks/post-author.scss
@@ -1,20 +1,28 @@
.wp-block-post-author {
align-items: center;
-}
+ gap: calc(var(--wp--style--block-gap, 1em) / 2);
-.wp-block-post-author__byline {
- font-size: var(--wp--custom--byline--font-size, 1em);
-}
+ &__byline {
+ font-size: var(--wp--custom--byline--font-size, 1em);
-.wp-block-post-author__byline::after {
- content: " ";
-}
+ &::after {
+ content: " ";
+ }
+ }
-.wp-block-post-author__avatar {
- display: flex;
- border-radius: inherit;
-}
+ &__avatar {
+ display: flex;
+ border-radius: inherit;
+ margin-right: 0;
+
+ img {
+ border-radius: inherit;
+ }
+ }
-.wp-block-post-author__avatar img {
- border-radius: inherit;
+ &__content {
+ display: flex;
+ flex-wrap: wrap;
+ }
}
+
diff --git a/src/scss/blocks/post-comments-form.scss b/src/scss/blocks/post-comments-form.scss
index 33ea5d9..ddf6350 100644
--- a/src/scss/blocks/post-comments-form.scss
+++ b/src/scss/blocks/post-comments-form.scss
@@ -2,3 +2,14 @@
.wp-block-post-comments-form textarea {
border: var(--wp--custom--border);
}
+
+// Core override.
+.wp-block-post-comments-form .comment-reply-title :where(small) {
+ font-size: var(--wp--custom--small--font-size, 0.5em);
+ margin-left: var(--wp--style--block-gap, 1em);
+}
+
+.form-submit {
+ --wp--custom--button--background: var(--wp--custom--comments-form--submit--background);
+ --wp--custom--button--color: var(--wp--custom--comments-form--submit--color);
+}
diff --git a/src/scss/blocks/post-content.scss b/src/scss/blocks/post-content.scss
index acbd674..8f24f01 100644
--- a/src/scss/blocks/post-content.scss
+++ b/src/scss/blocks/post-content.scss
@@ -1,4 +1,3 @@
-@import "../abstracts/align-wide";
@import "../abstracts/align-full";
.wp-block-post-content:not(.is-root-container) {
diff --git a/src/scss/blocks/post-excerpt.scss b/src/scss/blocks/post-excerpt.scss
index cc955b0..6cbaace 100644
--- a/src/scss/blocks/post-excerpt.scss
+++ b/src/scss/blocks/post-excerpt.scss
@@ -1,3 +1,5 @@
+@import "../abstracts/text-gradient";
+
.wp-block-post-excerpt {
&__excerpt {
@@ -7,4 +9,17 @@
&__more-text {
margin-bottom: inherit;
}
+
+ &__more-link {
+
+ .hide-read-more & {
+ display: none;
+ }
+ }
+
+ &[class*="-gradient-background"]:not(.has-text-color),
+ &[style*="-gradient("]:not(.has-text-color) {
+
+ @include text-gradient;
+ }
}
diff --git a/src/scss/blocks/post-featured-image.scss b/src/scss/blocks/post-featured-image.scss
index e69de29..e7bc436 100644
--- a/src/scss/blocks/post-featured-image.scss
+++ b/src/scss/blocks/post-featured-image.scss
@@ -0,0 +1,17 @@
+.wp-block-post-featured-image {
+
+ &[style*="aspect-ratio:"] {
+
+ a,
+ img {
+ aspect-ratio: inherit;
+ object-fit: cover;
+ object-position: inherit;
+ }
+ }
+
+ svg {
+ max-width: 100%;
+ height: auto;
+ }
+}
diff --git a/src/scss/blocks/post-template.scss b/src/scss/blocks/post-template.scss
index 6becbb8..5413fea 100644
--- a/src/scss/blocks/post-template.scss
+++ b/src/scss/blocks/post-template.scss
@@ -1,9 +1,7 @@
$gap: var(--wp--style--block-gap, 1em);
.wp-block-post-template {
- display: flex;
- flex-wrap: wrap;
- gap: var(--wp--style--block-gap, inherit) !important; // Theme.json doesn't work.
+ gap: var(--wp--style--block-gap, inherit);
// For core/post-featured-image block placeholders.
&[class*="columns"] {
@@ -12,31 +10,22 @@ $gap: var(--wp--style--block-gap, 1em);
}
}
+
// Post block does not load theme.json styles.
.wp-block-post {
margin-top: var(--wp--custom--post--margin-top, 0) !important;
width: 100%;
}
-@media (min-width: 600px) {
-
- .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li {
- width: calc((100% - #{$gap}) / 2);
- }
-
- .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li {
- width: calc((100% - (#{$gap} * 2)) / 3);
- }
-
- .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li {
- width: calc((100% - (#{$gap} * 3)) / 4);
- }
+@media (min-width: 600px) and (max-width: 959px) {
- .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li {
- width: calc((100% - (#{$gap} * 4)) / 5);
- }
+ // Core override 🙄.
+ .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
- .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li {
- width: calc((100% - (#{$gap} * 5)) / 6);
+ &.columns-4,
+ &.columns-5,
+ &.columns-6 {
+ grid-template-columns: repeat(2, 1fr);
+ }
}
}
diff --git a/src/scss/blocks/post-terms.scss b/src/scss/blocks/post-terms.scss
new file mode 100644
index 0000000..6291999
--- /dev/null
+++ b/src/scss/blocks/post-terms.scss
@@ -0,0 +1,35 @@
+.wp-block-post-terms {
+
+ &.justify-center,
+ &.aligncenter {
+ text-align: center;
+ justify-content: center;
+ }
+
+ &.justify-right,
+ &.alignright {
+ text-align: right;
+ justify-content: flex-end;
+ }
+
+ &.has-font-size {
+
+ .wp-block-post-terms__link {
+ font-size: inherit;
+ }
+ }
+
+ &.is-style-list {
+ display: flex;
+ flex-direction: column;
+ list-style-type: none;
+ padding: 0;
+
+ a {
+ &:before {
+ content: "›";
+ margin-right: 0.5em;
+ }
+ }
+ }
+}
diff --git a/src/scss/blocks/post-title.scss b/src/scss/blocks/post-title.scss
index 02be879..ce939b8 100644
--- a/src/scss/blocks/post-title.scss
+++ b/src/scss/blocks/post-title.scss
@@ -1,19 +1,25 @@
-.wp-block-post-title a {
- text-decoration: var(--wp--custom--post-title-link--text-decoration, none);
-}
-
-.wp-block-post-title a:not(:hover,:focus,:active) {
- color: var(--wp--custom--post-title-link--color, inherit);
-}
-
@import "../abstracts/text-gradient";
.wp-block-post-title {
word-break: break-word;
-}
-.wp-block-post-title[class*="-gradient-background"]:not(.has-text-color),
-.wp-block-post-title[style*="-gradient("]:not(.has-text-color) {
+ &[class*="-font-size"] {
+ line-height: var(--wp--custom--heading--line-height, 1.5);
+ }
- @include text-gradient;
+ &[class*="-gradient-background"]:not(.has-text-color),
+ &[style*="-gradient("]:not(.has-text-color) {
+
+ @include text-gradient;
+ }
+
+ a {
+ text-decoration: var(--wp--custom--post-title-link--text-decoration, none);
+
+ &:not(:hover,:focus,:active) {
+ color: var(--wp--custom--post-title-link--color, inherit);
+ }
+ }
}
+
+
diff --git a/src/scss/blocks/query-pagination.scss b/src/scss/blocks/query-pagination.scss
new file mode 100644
index 0000000..c1fc05b
--- /dev/null
+++ b/src/scss/blocks/query-pagination.scss
@@ -0,0 +1,8 @@
+.wp-block-query-pagination {
+
+ &.has-background > .wp-block-query-pagination-next,
+ &.has-background > .wp-block-query-pagination-numbers,
+ &.has-background > .wp-block-query-pagination-previous {
+ margin: 0;
+ }
+}
diff --git a/src/scss/blocks/search.scss b/src/scss/blocks/search.scss
index bbcd467..b77b74b 100644
--- a/src/scss/blocks/search.scss
+++ b/src/scss/blocks/search.scss
@@ -1,6 +1,11 @@
.wp-block-search {
+ display: flex;
flex-wrap: wrap;
line-height: 1;
+ align-items: inherit;
+ border-radius: inherit;
+ background: transparent !important;
+ padding: 0 !important;
&__button {
margin-left: 0; // Core override.
@@ -9,27 +14,53 @@
svg {
margin: -0.5em 0;
}
+
+ .wp-block-search__button-inside &.has-icon {
+ padding-left: 0;
+ padding-right: 0;
+ }
+
+ &.has-icon {
+ min-width: 3em;
+ }
}
&__inside-wrapper {
position: relative;
- gap: var(--wp--style--block-gap, 1em);
+ gap: var(--wp--custom--search--gap, var(--wp--style--block-gap, 1em));
}
&__input {
margin-bottom: 0 !important;
border: var(--wp--custom--input--border, var(--wp--custom--border, 0));
+ line-height: 1;
}
&__label {
margin-bottom: var(--wp--style--block-gap, 1em);
}
+
+ &__icon {
+ position: absolute;
+ height: 1.5em;
+ max-width: 1.5em;
+ top: 0;
+ bottom: 0;
+ margin: auto;
+ pointer-events: none;
+ fill: currentColor;
+ opacity: 0.5;
+ left: calc(0.25em + (var(--wp--custom--button--padding-top, 0.5em) / 2));
+
+ + .wp-block-search__input {
+ padding-left: calc(var(--wp--custom--button--padding-top) * 3);
+ }
+ }
}
.wp-block-search__button-inside {
.wp-block-search__inside-wrapper {
- gap: 0;
border: 0;
padding: 0;
}
@@ -37,18 +68,22 @@
.wp-block-search__input {
width: 100%;
max-width: 100%;
- padding: var(--wp--custom--input--padding, 0.5em 1em);
- padding-right: var(--wp--preset--spacing--md, 3em);
- border: var(--wp--custom--input--border, var(--wp--custom--border, 0));
- border-radius: var(--wp--custom--border--radius);
+ border-radius: var(--wp--custom--button--border-radius);
+ padding-right: calc(var(--wp--custom--button--padding-top) * 3);
}
.wp-block-search__button {
position: absolute;
- right: 0.25em;
- top: 0.25em;
- bottom: 0.25em;
+ right: 0.2em;
+ top: 0.2em;
+ bottom: 0.2em;
height: auto;
- margin: 0;
+ margin: auto;
+ background: var(--wp--custom--search-button--background, transparent) !important;
+ color: currentColor;
}
}
+
+.search-icon {
+ fill: currentColor;
+}
diff --git a/src/scss/blocks/social-link.scss b/src/scss/blocks/social-link.scss
deleted file mode 100644
index 1fef346..0000000
--- a/src/scss/blocks/social-link.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-.wp-block-social-link {
- transition: var(--wp--custom--transition);
-
- &.has-text-color:hover {
- transform: none;
- opacity: var(--wp--custom--button--hover-opacity, 0.82);
- }
-}
diff --git a/src/scss/blocks/social-links.scss b/src/scss/blocks/social-links.scss
index 58ce603..3b734af 100644
--- a/src/scss/blocks/social-links.scss
+++ b/src/scss/blocks/social-links.scss
@@ -1,3 +1,18 @@
-.wp-block-social-link {
+.wp-social-link {
+ transition: var(--wp--custom--transition);
list-style-type: none;
+
+ &.has-text-color:hover {
+ transform: none;
+ opacity: var(--wp--custom--button--hover-opacity, 0.82);
+ }
+
+ .has-normal-icon-size {
+ font-size: inherit;
+ }
+
+ .wp-block-social-links.has-normal-icon-size & svg {
+ width: 1em;
+ height: 1em;
+ }
}
diff --git a/src/scss/blocks/table.scss b/src/scss/blocks/table.scss
index 95ca6a6..881395e 100644
--- a/src/scss/blocks/table.scss
+++ b/src/scss/blocks/table.scss
@@ -1,16 +1,37 @@
+.wp-block-table {
+ border-radius: var(--wp--custom--border--radius, 0);
-.wp-block-table.is-style-stripes,
-.wp-block-table thead,
-.wp-block-table tfoot {
- border: 0;
-}
+ &.is-style-stripes,
+ thead,
+ tfoot {
+ border: 0;
+ }
-.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
- background-color: var(--wp--preset--color--white);
-}
+ &.is-style-stripes tbody tr:nth-child(odd) {
+ background-color: var(--wp--preset--color--white);
+ }
+
+ td,
+ th {
+ padding: var(--wp--custom--table-cell--padding, 1em);
+ border-color: var(--wp--custom--border--color, inherit);
+ }
+
+ table {
+ border-collapse: separate;
+ border-width: calc(var(--wp--custom--border--width, 1px) / 2);
+
+ td,
+ th {
+ border-width: calc(var(--wp--custom--border--width, 1px) / 2);
+ }
+ thead + tbody {
-.wp-block-table td,
-.wp-block-table th {
- padding: var(--wp--custom--table-cell--padding, 1em);
+ td {
+ border-top-left-radius: 0 !important;
+ border-top-right-radius: 0 !important;
+ }
+ }
+ }
}
diff --git a/src/scss/blocks/template-part.scss b/src/scss/blocks/template-part.scss
index 4b4b2dc..a3ec2a6 100644
--- a/src/scss/blocks/template-part.scss
+++ b/src/scss/blocks/template-part.scss
@@ -3,7 +3,19 @@
}
header.wp-block-template-part {
- z-index: 3;
+
+ &:not(.has-z-index) {
+ z-index: var(--wp--custom--header--z-index, initial);
+ }
+
+ &:not([class*="has-display-"]) {
+ // display: initial; // Required for nested sticky elements to work.
+ }
+
+ &:not([class*="has-position-"]) {
+ position: var(--wp--custom--header--position, relative);
+ top: var(--wp--custom--header--top, 0);
+ }
}
footer.wp-block-template-part {
diff --git a/src/scss/blocks/video.scss b/src/scss/blocks/video.scss
index 6ce8ffb..ccb5fda 100644
--- a/src/scss/blocks/video.scss
+++ b/src/scss/blocks/video.scss
@@ -32,12 +32,30 @@ div.mejs-controls {
}
div.mejs-overlay-button {
- background: var(--wp--custom--video-button--background, currentcolor);
+ position: relative;
+ background: transparent;
color: inherit;
- width: 3.333em;
- -webkit-mask-image: url('data:image/svg+xml;utf8, ');
- -webkit-mask-position: center;
- -webkit-mask-repeat: no-repeat;
+ width: var(--wp--custom--video-button--size, 5em);
+ height: auto;
+ border-radius: var(--wp--custom--video-button--border-radius, var(--wp--custom--border--radius, 0));
+ aspect-ratio: 1;
+ box-shadow: var(--wp--custom--video-button--box-shadow, none);
+ -webkit-mask-image: none;
+
+ &:before {
+ content: '';
+ display: block;
+ position: absolute;
+ inset: 0;
+ background: var(--wp--custom--video-button--background, currentcolor);
+ color: inherit;
+ width: 100%;
+ height: 100%;
+ -webkit-mask-image: var(--wp--custom--video-button--url, url('data:image/svg+xml;utf8, '));
+ -webkit-mask-position: center;
+ -webkit-mask-repeat: no-repeat;
+ transform: scale(1.02); // Prevents a small gap between the mask and the button.
+ }
}
div.mejs-button > button {
diff --git a/src/scss/components/admin-bar.scss b/src/scss/components/admin-bar.scss
index aabc0cd..51a1b4b 100644
--- a/src/scss/components/admin-bar.scss
+++ b/src/scss/components/admin-bar.scss
@@ -2,6 +2,16 @@
--wp--custom--site-blocks--min-height: calc(100vh - 46px);
}
+@media (min-width: 600px) {
+
+ .admin-bar {
+
+ .wp-site-blocks {
+ margin-top: var(--wp-admin--admin-bar--height);
+ }
+ }
+}
+
@media (min-width: 783px) {
.admin-bar {
diff --git a/src/scss/components/edit-link.scss b/src/scss/components/edit-link.scss
new file mode 100644
index 0000000..96a1eb8
--- /dev/null
+++ b/src/scss/components/edit-link.scss
@@ -0,0 +1,12 @@
+@import "../abstracts/ghost.scss";
+
+.comment-edit-link {
+ padding: 4px 8px;
+ border-radius: var(--wp--custom--border--radius);
+ margin-left: 0.5em;
+ font-size: smaller;
+ font-weight: var(--wp--custom--font-weight--semi-bold);
+ color: inherit;
+
+ @include ghost;
+}
diff --git a/src/scss/components/inline-image.scss b/src/scss/components/inline-image.scss
index 12cd852..1e3c9a3 100644
--- a/src/scss/components/inline-image.scss
+++ b/src/scss/components/inline-image.scss
@@ -2,7 +2,7 @@
.wp-block-paragraph {
img {
- border-radius: var(--wp--custom--image---border-radius, var(--wp--custom--border--radius, inherit));
+ border-radius: var(--wp--custom--image--border-radius, var(--wp--custom--border--radius, inherit));
max-height: var(--wp--custom--inline-image--max-height, 100%);
}
}
diff --git a/src/scss/components/placeholder-image.scss b/src/scss/components/placeholder-image.scss
index 082c74d..1a6655f 100644
--- a/src/scss/components/placeholder-image.scss
+++ b/src/scss/components/placeholder-image.scss
@@ -5,8 +5,43 @@
display: flex;
align-items: center;
justify-content: center;
- background: var(--wp--custom--placeholder--background, var(--wp--preset--color--surface));
border: var(--wp--custom--placeholder--border, 0);
- border-radius: var(--wp--custom--placeholder--border-radius, var(--wp--custom--border--radius));
+ border-radius: var(--wp--custom--image--border--radius, inherit);
aspect-ratio: var(--wp--custom--placeholder--aspect-ratio, 16/9);
}
+
+.has-placeholder-icon {
+ background: var(--wp--custom--placeholder--background, var(--wp--custom--surface--background));
+
+ a {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100%;
+ width: 100%;
+ }
+
+ svg {
+ fill: var(--wp--preset--color--neutral-300, currentColor);
+ }
+
+ &.has-transparent-background-color {
+
+ svg {
+ fill: transparent;
+ }
+ }
+}
+
+.is-placeholder:not(.has-placeholder-icon) {
+
+ a,
+ img {
+ width: inherit;
+ height: inherit;
+ object-fit: inherit;
+ object-position: inherit;
+ border-radius: inherit;
+ }
+}
+
diff --git a/src/scss/components/site-blocks.scss b/src/scss/components/site-blocks.scss
index 324ea34..727bb51 100644
--- a/src/scss/components/site-blocks.scss
+++ b/src/scss/components/site-blocks.scss
@@ -2,11 +2,12 @@
@import "../abstracts/align-full";
.wp-site-blocks {
- display: grid;
+ display: var(--wp--custom--site-blocks--display, grid);
grid-template-rows: auto 1fr auto;
grid-template-columns: 1fr;
+ width: 100%;
min-height: var(--wp--custom--site-blocks--min-height, 100vh);
- overflow-x: var(--wp--custom--site-blocks--overflow-x, hidden);
+ overflow-x: var(--wp--custom--site-blocks--overflow-x);
}
.wp-site-blocks > * + * {
@@ -34,6 +35,10 @@
margin-bottom: auto !important;
}
+.no-margin {
+ margin: 0 !important;
+}
+
.nowrap {
white-space: nowrap !important; // !important for editor.
@@ -52,12 +57,28 @@
flex-wrap: wrap;
}
+.flex {
+ display: flex;
+}
+
.justify-center {
justify-content: center;
}
+.justify-space-between {
+ justify-content: space-between;
+}
+
.height-100 {
- height: 100%;
+ height: 100% !important
+}
+
+.height-auto {
+ height: auto !important;
+}
+
+.isolate {
+ isolation: isolate;
}
[style*="border-"] {
@@ -68,15 +89,26 @@
cursor: pointer;
}
-// TODO: clean up.
-.cursor-pointer {
- cursor: pointer;
-}
-
.align-content-center {
align-content: center;
}
+.align-stretch {
+ align-items: stretch !important;
+ align-self: stretch;
+}
+
+.vertical-align-top {
+ vertical-align: top;
+}
+
+.object-fit {
+ object-fit: cover;
+ object-position: center;
+ height: 100%;
+ width: 100%;
+}
+
header,
footer,
main {
@@ -86,3 +118,24 @@ main {
@include alignfull;
}
}
+
+
+// TODO: clean up.
+.cursor-pointer {
+ cursor: pointer;
+}
+
+.fade-top {
+ mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%);
+ -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%);
+}
+
+.fade-bottom {
+ mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%);
+ -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%);
+}
+
+.fade-vertical {
+ mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%, rgb(0, 0, 0) 80%, rgba(0, 0, 0, 0) 100%);
+ -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgb(0, 0, 0) 20%, rgb(0, 0, 0) 80%, rgba(0, 0, 0, 0) 100%);
+}
diff --git a/src/scss/editor.scss b/src/scss/editor.scss
index 0b947e3..8b8817c 100644
--- a/src/scss/editor.scss
+++ b/src/scss/editor.scss
@@ -1,3 +1,21 @@
+@import "../../node_modules/prism-themes/themes/prism-material-oceanic";
+@import "abstracts/align-wide";
+@import "abstracts/shadow";
+@import "extensions/dark-mode";
+
+.edit-site-site-icon__image[src*=".svg"] {
+ transform: scale(0.55);
+ background: transparent;
+}
+
+.npm__react-simple-code-editor__textarea {
+
+ &:focus {
+ outline: none;
+ box-shadow: none;
+ }
+}
+
// Overrides.
html .editor-styles-wrapper {
--wp--custom--html--width: auto;
@@ -12,6 +30,13 @@ html .editor-styles-wrapper {
img {
max-width: 100% !important;
}
+
+ &[style*="--min-width:"] {
+
+ > div {
+ min-width: 100% !important;
+ }
+ }
}
[src*=".svg"] {
@@ -30,6 +55,9 @@ html .editor-styles-wrapper {
.edit-post-visual-editor__post-title-wrapper {
text-align: center;
+ margin-bottom: calc(var(--wp--style--block-gap) * 2);
+ position: relative;
+ z-index: 10;
}
// Always hide title.
@@ -159,6 +187,25 @@ header.wp-block-template-part {
display: flex !important;
}
+[class*="has-aspect-ratio-"] {
+
+ .components-placeholder {
+ min-height: 1em;
+ }
+
+ .components-placeholder__fieldset {
+ height: 0;
+ }
+}
+
+.is-placeholder.is-selected,
+.is-placeholder.has-child-selected {
+
+ .components-placeholder__fieldset {
+ height: auto;
+ }
+}
+
.blockify-settings .components-base-control__help {
margin-top: 8px;
}
@@ -173,12 +220,30 @@ header.wp-block-template-part {
* Icons.
*/
+div:has(> .blockify-icon-settings) {
+ display: flex;
+ flex-wrap: wrap;
+
+ > div {
+ width: 100%;
+ }
+
+ .components-tools-panel {
+ display: none;
+ }
+}
+
.blockify-icon-settings {
order: -1;
select {
text-transform: capitalize;
}
+
+ div[role="listbox"] {
+ display: grid;
+ grid-template-columns: repeat(5, minmax(0, 1fr));
+ }
}
.blockify-icon-setting {
@@ -211,7 +276,7 @@ header.wp-block-template-part {
}
.blockify-icon-preview {
- margin-top: 29px;
+ margin-top: 27px;
position: absolute;
width: 220px;
display: flex;
@@ -229,7 +294,8 @@ header.wp-block-template-part {
// Hide site logo placeholder when icon is set.
-.is-style-icon .components-placeholder__illustration {
+.is-style-icon .components-placeholder__illustration,
+.is-style-icon .components-placeholder__instructions {
display: none !important;
}
@@ -238,7 +304,7 @@ header.wp-block-template-part {
min-height: 0;
}
-.editor-styles-wrapper div [style*="--wp--custom--icon--"] {
+.editor-styles-wrapper div [style*="--wp--custom--icon--url:"] {
background: transparent !important;
float: none !important;
padding: 0 !important;
@@ -247,6 +313,13 @@ header.wp-block-template-part {
margin-right: 0 !important;
box-shadow: none !important;
+ &.wp-block-button {
+
+ [data-rich-text-placeholder] {
+ display: none;
+ }
+ }
+
.components-placeholder__illustration,
img,
figcaption,
@@ -264,34 +337,38 @@ header.wp-block-template-part {
margin-right: 0;
}
+ > div:first-of-type:not(.wp-block-button__link) {
+ border-radius: inherit !important;
+ border-width: var(--wp--custom--icon--border-width, 0) !important;
+ border-style: var(--wp--custom--icon--border-style, solid) !important;
+ border-color: var(--wp--custom--icon--border-color, currentColor) !important;
+ background: var(--wp--custom--icon--background, transparent) !important;
+ color: inherit !important;
+ box-shadow: none;
+ background-color: var(--wp--custom--icon--background, transparent) !important;
+ padding: var(--wp--custom--icon--padding, 0);
+ }
+
> div:first-of-type {
display: inline-flex;
position: relative;
- padding: var(--wp--custom--icon--padding, 0);
margin-left: auto;
margin-right: auto;
- border-radius: inherit !important;
- border-width: var(--wp--custom--icon--border-width, 0) !important;
- border-style: var(--wp--custom--icon--border-style, solid) !important;
- border-color: var(--wp--custom--icon--border-color, currentColor) !important;
width: auto !important;
height: auto !important;
min-height: 0;
min-width: var(--wp--custom--icon--size, 30px);
- background: var(--wp--custom--icon--background, transparent) !important;
- color: inherit !important;
- box-shadow: none;
- background-color: var(--wp--custom--icon--background, transparent) !important;
&::after {
content: "";
display: inline-block;
position: relative;
background: var(--wp--custom--icon--color, currentColor);
- width: var(--wp--custom--icon--size, 30px);
- height: var(--wp--custom--icon--size, 30px);
+ width: var(--wp--custom--icon--size, 1em);
+ height: var(--wp--custom--icon--size, 1em);
margin: auto;
vertical-align: text-bottom;
+ order: var(--wp--custom--icon--order, 0);
-webkit-mask-image: var(--wp--custom--icon--url);
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
@@ -303,6 +380,7 @@ header.wp-block-template-part {
// Can't use important.
.wp-block-image.wp-block-image.is-selected .components-placeholder {
box-shadow: none;
+ background-color: transparent;
}
.blockify-icon-popover > div > div {
@@ -355,16 +433,20 @@ header.wp-block-template-part {
}
}
-.blockify-underline-format > div {
- padding: 1em;
- display: flex;
- flex-wrap: wrap;
- width: 20em;
- gap: 1em;
+.blockify-animation-format,
+.blockify-underline-format {
- > div,
- select {
- width: 100%;
+ > div {
+ padding: 1em;
+ display: flex;
+ flex-wrap: wrap;
+ width: 20em;
+ gap: 1em;
+
+ > div,
+ select {
+ width: 100%;
+ }
}
}
@@ -406,10 +488,6 @@ div .wp-block-navigation__responsive-close {
.editor-styles-wrapper .wp-block-navigation.is-vertical {
margin-top: var(--wp--style--block-gap, 1em);
-
- .wp-block.wp-block-navigation-item {
- margin-bottom: var(--wp--style--block-gap, 1em);
- }
}
.wp-block-navigation:not(.is-vertical) .wp-block-navigation-item__content {
@@ -436,13 +514,18 @@ div .wp-block-navigation__responsive-close {
stroke: var(--wp--custom--border--color, currentColor);
border-radius: var(--wp--custom--border--radius, 0);
color: var(--wp--preset--color--outline);
- opacity: 1;
+ opacity: 0;
}
.components-placeholder.has-illustration {
backdrop-filter: none;
border: 0;
overflow: inherit;
+ background: var(--wp--custom--placeholder--background, var(--wp--custom--surface--background));
+
+ .has-background > & {
+ background: transparent;
+ }
}
.blockify-width-control {
@@ -512,7 +595,7 @@ div .wp-block-navigation__responsive-close {
display: inline-flex;
align-items: center;
gap: 4px;
- margin: 8px 0 !important;
+ margin: 8px 0;
padding: 0;
+ .components-button-group {
@@ -587,6 +670,14 @@ img[style*="toggle-switch"] {
max-width: 100%;
}
+.wp-block-post-content:not(.is-root-container) {
+
+ > .alignwide {
+
+ @include alignwide;
+ }
+}
+
.is-style-accordion {
list-style: none;
padding: 0;
@@ -606,9 +697,9 @@ img[style*="toggle-switch"] {
&::after,
&::before {
content: "";
- margin: 1em 0.5em 1em -1.5em;
- width: 16px;
- height: 2px;
+ margin: 0.75em 0 0 0;
+ width: 12px;
+ height: 1.5px;
display: inline-block !important;
background: currentcolor;
position: absolute;
@@ -728,3 +819,71 @@ img[style*="toggle-switch"] {
.entities-saved-states__text-prompt + .is-opened strong {
text-transform: capitalize;
}
+
+.blockify-shadow-presets {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ justify-content: space-between;
+ gap: 12px;
+ width: 100%;
+ margin-bottom: 16px;
+
+ .components-button {
+ display: flex;
+ justify-content: center;
+ height: 54px;
+ width: 54px;
+ border-radius: 60px !important;
+ font-size: 10px !important;
+ box-shadow: var(--wp--custom--button--box-shadow);
+ }
+
+ @each $preset in $presets {
+ .has-#{$preset}-shadow,
+ .has-#{$preset}-shadow-hover {
+ box-shadow: var(--wp--preset--shadow--#{$preset});
+ }
+
+ .has-#{$preset}-shadow-hover:hover,
+ .has-#{$preset}-shadow-hover:focus {
+ box-shadow: var(--wp--preset--shadow--#{$preset});
+ }
+ }
+}
+
+.block-editor-link-control__search-item-top {
+ flex-wrap: wrap;
+}
+
+.block-editor-link-control__search-item-action.block-editor-link-control__unlink {
+ margin-left: 0;
+}
+
+.post-type-download .is-root-container.wp-block-post-content {
+ max-width: var(--wp--style--global--content-size, 90%);
+ margin-bottom: var(--wp--style--block-gap, 1em);
+}
+
+.edit-site-visual-editor {
+
+ > .components-resizable-box__container {
+ height: 100% !important;
+ }
+}
+
+.is-selected.is-style-surface::after {
+ backdrop-filter: none !important;
+ pointer-events: none;
+}
+
+.post-type-wp_block {
+
+ .alignfull {
+
+ .alignfull {
+ max-width: 100%;
+ margin-left: auto !important;
+ margin-right: auto !important;
+ }
+ }
+}
diff --git a/src/scss/elements/body.scss b/src/scss/elements/body.scss
index 2fe4728..45ba3ec 100644
--- a/src/scss/elements/body.scss
+++ b/src/scss/elements/body.scss
@@ -8,4 +8,7 @@ body {
// For gradients.
background: var(--wp--custom--body--background, var(--wp--preset--color--white, #fff));
+
+ // Allow custom variable font settings.
+ font-variation-settings: var(--wp--custom--body--font-variation-settings);
}
diff --git a/src/scss/elements/button.scss b/src/scss/elements/button.scss
index 3b68b2a..b0e6d41 100644
--- a/src/scss/elements/button.scss
+++ b/src/scss/elements/button.scss
@@ -1,19 +1,9 @@
-@import "../abstracts/button";
-
-.wp-element-button {
- position: relative;
- display: inline-flex;
- flex-wrap: wrap;
- justify-content: center;
- align-items: center;
- align-content: center;
- transition: var(--wp--custom--transition, inherit);
- background-clip: padding-box !important; // Semi transparent borders.
- cursor: pointer;
+@import "../abstracts/button.scss";
+@import "../abstracts/ghost.scss";
- &:not(.has-background) {
- background: var(--wp--custom--button--background);
- }
+#{$buttons} {
+
+ @include button;
br + span {
width: 100%;
@@ -22,22 +12,55 @@
&:active,
&:hover,
- &:focus {
+ &:focus,
+ &.is-focus {
opacity: var(--wp--custom--button--hover-opacity, 0.82);
}
.nowrap & {
flex-wrap: nowrap;
}
+
+ &:not(.has-background) {
+ background: var(--wp--custom--button--background);
+ }
+
+ &.is-style-ghost {
+
+ @include ghost;
+
+ color: var(--wp--custom--ghost--color, inherit);
+
+ .is-style-dark & {
+ color: var(--wp--custom--dark-mode--ghost--color, inherit);
+ }
+
+ @media(prefers-color-scheme: dark) {
+
+ .default-mode-auto:not(.is-style-light):not(.is-style-dark) & {
+ color: var(--wp--custom--dark-mode--ghost--color, inherit);
+ }
+ }
+ }
}
-// Commonly used class. (wp.org, woocommerce, etc.). !important for EDD.
-.button,
-.is-style-button,
-[type="submit"],
-[type="button"]:not(.wp-block-social-link-anchor,.components-button,[id*="mce"],[aria-controls]) {
+.is-style-badges,
+.is-style-small {
+ --wp--custom--button--font-size: 12px;
+ --wp--custom--button--padding-top: 6px;
+ --wp--custom--button--padding-right: 12px;
+ --wp--custom--button--padding-bottom: 6px;
+ --wp--custom--button--padding-left: 12px;
+ --wp--custom--button--gap: 6px;
+}
- @include button;
+.is-style-large {
+ --wp--custom--button--font-size: 16px;
+ --wp--custom--button--padding-top: 12px;
+ --wp--custom--button--padding-right: 20px;
+ --wp--custom--button--padding-bottom: 12px;
+ --wp--custom--button--padding-left: 20px;
+ --wp--custom--button--gap: 8px;
}
[type="reset"] {
diff --git a/src/scss/elements/caption.scss b/src/scss/elements/caption.scss
new file mode 100644
index 0000000..8ee636f
--- /dev/null
+++ b/src/scss/elements/caption.scss
@@ -0,0 +1,3 @@
+.wp-element-caption {
+ display: block !important;
+}
diff --git a/src/scss/elements/checkbox.scss b/src/scss/elements/checkbox.scss
new file mode 100644
index 0000000..ca1d50e
--- /dev/null
+++ b/src/scss/elements/checkbox.scss
@@ -0,0 +1,40 @@
+$border_width: var(--wp--custom--border--width, 1px);
+$border_color: var(--wp--custom--border--color, currentColor);
+$size: 1.2em;
+
+input[type="checkbox"] {
+ appearance: none;
+ width: $size;
+ height: $size;
+ margin: 0.1em 0.66em 0 0;
+ border: $border_width solid $border_color;
+ border-radius: 0.33em;
+ display: inline-grid;
+ place-content: center;
+ color: var(--wp--preset--color--primary, currentColor);
+
+ &::before {
+ content: "";
+ width: $size;
+ height: $size;
+ border-radius: 0.33em;
+ transform: scale(0);
+ clip-path: polygon(22% 44%, 10% 60%, 46% 87%, 92% 30%, 75% 17%, 42% 59%);
+ transition: var(--wp--custom--transition);
+ background: var(--wp--custom--body--background, currentColor);
+ }
+
+ &:checked {
+ background-color: currentColor;
+ }
+
+ &:checked::before {
+ transform: scale(.66);
+ }
+
+ &:focus {
+ border-color: var(--wp--custom--border--color, currentColor);
+ outline: $border_width solid currentColor;
+ outline-offset: $border_width;
+ }
+}
diff --git a/src/scss/elements/form.scss b/src/scss/elements/form.scss
index 90d2473..83dfca5 100644
--- a/src/scss/elements/form.scss
+++ b/src/scss/elements/form.scss
@@ -1,29 +1,45 @@
-@import "../abstracts/input";
+@import "../abstracts/input.scss";
form {
margin-block-end: 0; // Remove user agent style.
}
label {
- display: block;
- font-size: var(--wp--custom--label--font-size, var(--wp--preset--font-size--18, smaller));
+ display: flex;
+ align-items: center;
+ font-size: var(--wp--custom--label--font-size, inherit);
font-weight: var(--wp--custom--label--font-weight, var(--wp--custom--font-weight--medium, 500));
margin-bottom: var(--wp--custom--label--margin-bottom, 0.5em);
+ width: 100%;
+
+ input + & {
+ width: auto;
+ }
}
fieldset {
margin: var(--wp--style--block-gap, 1em) 0;
- padding: var(--wp--style--block-gap, 0);
- border: var(--wp--custom--border, 0);
+ padding: var(--wp--custom--fieldset--padding, 0);
+ border: var(--wp--custom--fieldset--border, 0);
border-radius: var(--wp--custom--border--radius);
+
+ p {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ column-gap: calc(var(--wp--style--block-gap, 1em) / 2);
+ width: 100%;
+ }
}
legend {
width: 100%;
margin: 0 0 var(--wp--style--block-gap, 1em);
+ padding: 0;
float: left;
font-family: var(--wp--custom--heading--font-family);
font-weight: var(--wp--custom--heading--font-weight);
+ color: var(--wp--custom--heading--color);
}
input,
@@ -37,16 +53,15 @@ textarea {
select,
textarea,
input:not([type="checkbox"],[type="submit"],[type="button"],[type="radio"]) {
- margin: var(--wp--custom--input--margin, 0 0 var(--wp--style--block-gap, 1em));
+ margin: 0 0 var(--wp--style--block-gap, 1em);
padding: $padding;
font-size: var(--wp--custom--button--font-size);
width: var(--wp--custom--input--width, 100%);
color: inherit;
}
-// Match .wp-element-button workaround. Line height doesn't work.
-input:not([type="checkbox"],[type="submit"],[type="button"],[type="radio"],[type="file"]) {
- height: calc(1em + var(--wp--custom--button--padding-top, 1em) + var(--wp--custom--button--padding-bottom, 1em) + (var(--wp--custom--border--width, 1px) * 2));
+p input:not([type="checkbox"],[type="submit"],[type="button"],[type="radio"]) {
+ margin-bottom: 0;
}
// Override plugins.
@@ -55,6 +70,14 @@ textarea {
max-width: 100%;
}
+select {
+ appearance: none;
+ background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
+ background-repeat: no-repeat;
+ background-position: right 0.5em center;
+ background-size: 1em;
+}
+
::placeholder {
color: var(--wp--custom--placeholder--color, inherit);
opacity: var(--wp--custom--placeholder--opacity, 0.5);
@@ -65,3 +88,10 @@ textarea {
opacity: var(--wp--custom--placeholder--opacity, 0.5);
}
+[disabled] {
+ opacity: var(--wp--custom--disabled--opacity, 0.5);
+ cursor: not-allowed;
+
+ --wp--custom--button--hover-opacity: 0.5;
+ --wp--custom--ghost--hover--opacity: 0.1;
+}
diff --git a/src/scss/elements/heading.scss b/src/scss/elements/heading.scss
new file mode 100644
index 0000000..293b278
--- /dev/null
+++ b/src/scss/elements/heading.scss
@@ -0,0 +1,3 @@
+h1, h2, h3, h4, h5, h6, .is-style-heading {
+ font-variation-settings: var(--wp--custom--heading--font-variation-settings);
+}
diff --git a/src/scss/elements/html.scss b/src/scss/elements/html.scss
index f8d8788..067502e 100644
--- a/src/scss/elements/html.scss
+++ b/src/scss/elements/html.scss
@@ -1,5 +1,4 @@
html {
- width: var(--wp--custom--html--width, 100vw);
padding: 0 !important;
box-sizing: border-box;
overflow-x: hidden;
diff --git a/src/scss/elements/list.scss b/src/scss/elements/list.scss
index 027e473..7154c3d 100644
--- a/src/scss/elements/list.scss
+++ b/src/scss/elements/list.scss
@@ -1,8 +1,18 @@
-ol,
+ol:not(.wp-block-comment-template),
ul {
- padding-left: 1em;
+ padding-left: 1em
+}
+
+ol {
+ display: flex;
+ flex-direction: column;
+ gap: 1em;
+
+ ol {
+ margin-top: 1em;
+ }
}
li {
- margin-bottom: var(--wp--style--block-gap, 1em);
+ margin: 0;
}
diff --git a/src/scss/elements/mark.scss b/src/scss/elements/mark.scss
index ab2493e..aa4c33c 100644
--- a/src/scss/elements/mark.scss
+++ b/src/scss/elements/mark.scss
@@ -1,4 +1,7 @@
mark {
border-radius: inherit;
- padding: 0.2em 0.4em;
+
+ &:not(.has-inline-color) {
+ padding: 0.2em 0.4em;
+ }
}
diff --git a/src/scss/elements/pre.scss b/src/scss/elements/pre.scss
index 0d6178e..7df4fa7 100644
--- a/src/scss/elements/pre.scss
+++ b/src/scss/elements/pre.scss
@@ -1,6 +1,7 @@
pre {
width: 100%;
font-family: var(--wp--preset--font-family--monospace);
+ overflow-x: scroll;
p {
white-space: normal;
diff --git a/src/scss/elements/radio.scss b/src/scss/elements/radio.scss
new file mode 100644
index 0000000..682d121
--- /dev/null
+++ b/src/scss/elements/radio.scss
@@ -0,0 +1,39 @@
+$border_width: var(--wp--custom--border--width, 1px);
+$border_color: var(--wp--custom--border--color, currentColor);
+$size: 1.2em;
+
+input[type="radio"] {
+ appearance: none;
+ width: $size;
+ height: $size;
+ margin: 0 0.5em 0 0;
+ border: $border_width solid $border_color;
+ border-radius: calc(#{$size} / 2);
+ display: inline-grid;
+ place-content: center;
+ color: var(--wp--preset--color--primary, currentColor);
+ background: var(--wp--custom--body--background, currentColor);
+
+ &::before {
+ content: "";
+ width: $size;
+ height: $size;
+ border-radius: calc(#{$size} / 2);
+ transform: scale(0);
+ transition: var(--wp--custom--transition);
+ background: var(--wp--custom--body--background, currentColor);
+ }
+
+ &:checked {
+ background-color: currentColor;
+ }
+
+ &:checked::before {
+ transform: scale(.33);
+ }
+
+ &:focus {
+ outline: $border_width solid currentColor;
+ outline-offset: $border_width;
+ }
+}
diff --git a/src/scss/extensions/animation.scss b/src/scss/extensions/animation.scss
index 9e5cad8..3c74f1b 100644
--- a/src/scss/extensions/animation.scss
+++ b/src/scss/extensions/animation.scss
@@ -1,10 +1,18 @@
.animate {
animation-name: var(--animation-name);
+ -webkit-transform: translate3d(0, 0, 0);
+}
+
+.has-animation,
+.has-scroll-animation {
+ will-change: transform;
}
@media (prefers-reduced-motion) {
- .has-animation {
+ .has-animation,
+ .has-scroll-animation {
+ will-change: transform;
animation: none !important;
}
}
diff --git a/src/scss/extensions/animations.scss b/src/scss/extensions/animations.scss
index 0add543..b080efc 100644
--- a/src/scss/extensions/animations.scss
+++ b/src/scss/extensions/animations.scss
@@ -102,6 +102,22 @@
}
+@keyframes up-and-down {
+
+ 0% {
+ transform: translateY(0);
+ }
+
+ 50% {
+ transform: translateY(-30px);
+ }
+
+ 100% {
+ transform: translateY(0);
+ }
+
+}
+
@keyframes fade-in {
0% {
@@ -467,3 +483,16 @@
transform: translate3d(0, 2000px, 0);
}
}
+
+@keyframes scale-down {
+
+ 0% {
+ transform: scaleY(0);
+ transform-origin: top;
+ }
+
+ 100% {
+ transform: scaleY(1);
+ transform-origin: top;
+ }
+}
diff --git a/src/scss/extensions/aspect-ratio.scss b/src/scss/extensions/aspect-ratio.scss
new file mode 100644
index 0000000..0f80bb5
--- /dev/null
+++ b/src/scss/extensions/aspect-ratio.scss
@@ -0,0 +1,9 @@
+[class*="has-aspect-ratio-"] {
+
+ img,
+ a,
+ a img {
+ aspect-ratio: inherit;
+ object-fit: cover;
+ }
+}
diff --git a/src/scss/extensions/dark-mode-toggle.scss b/src/scss/extensions/dark-mode-toggle.scss
new file mode 100644
index 0000000..b4b9c5a
--- /dev/null
+++ b/src/scss/extensions/dark-mode-toggle.scss
@@ -0,0 +1,22 @@
+.toggle-switch {
+ position: relative;
+
+ &::before {
+ content: "";
+ display: block;
+ position: absolute;
+ transition: var(--wp--custom--transition, left 0.2s ease-in-out);
+ z-index: 1;
+ pointer-events: none;
+ height: 1em;
+ width: 1em;
+ background: currentcolor;
+ border-radius: 99px;
+ left: var(--wp--custom--toggle-switch--inset, 0.2em);
+
+ .default-mode-light.is-style-dark &,
+ .default-mode-dark.is-style-light & {
+ left: calc(100% - (1em + var(--wp--custom--toggle-switch--inset, 0.2em)));
+ }
+ }
+}
diff --git a/src/scss/extensions/dark-mode.scss b/src/scss/extensions/dark-mode.scss
index dfb89df..e138fe8 100644
--- a/src/scss/extensions/dark-mode.scss
+++ b/src/scss/extensions/dark-mode.scss
@@ -1,22 +1,48 @@
-.toggle-switch {
- position: relative;
-
- &::before {
- content: "";
- display: block;
- position: absolute;
- transition: var(--wp--custom--transition, left 0.2s ease-in-out);
- z-index: 1;
- pointer-events: none;
- height: 1em;
- width: 1em;
- background: currentcolor;
- border-radius: 99px;
- left: var(--wp--custom--toggle-switch--inset, 0.2em);
-
- body.is-style-dark &,
- body.is-style-light & {
- left: calc(100% - (1em + var(--wp--custom--toggle-switch--inset, 0.2em)));
+body.is-style-dark {
+
+ .hide-dark-mode {
+ display: none;
+ }
+}
+
+body.is-style-light:not(.is-style-dark) {
+
+ .hide-light-mode {
+ display: none;
+ }
+}
+
+.default-mode-light:not(.is-style-dark) {
+
+ .hide-light-mode {
+ display: none;
+ }
+}
+
+.default-mode-dark:not(.is-style-light) {
+
+ .hide-dark-mode {
+ display: none;
+ }
+}
+
+.default-mode-auto:not(.is-style-light):not(.is-style-dark) {
+
+ .hide-light-mode {
+ display: none;
+ }
+}
+
+@media (prefers-color-scheme: dark) {
+
+ .default-mode-auto:not(.is-style-light):not(.is-style-dark) {
+
+ .hide-dark-mode {
+ display: none;
+ }
+
+ .hide-light-mode {
+ display: flex;
}
}
}
diff --git a/src/scss/extensions/grid-pattern.scss b/src/scss/extensions/grid-pattern.scss
deleted file mode 100644
index 0d09c09..0000000
--- a/src/scss/extensions/grid-pattern.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.has-grid-gradient-background {
- background-size: var(--wp--custom--grid--size, 100px) var(--wp--custom--grid--size, 100px) !important;
-}
diff --git a/src/scss/extensions/shadow.scss b/src/scss/extensions/shadow.scss
new file mode 100644
index 0000000..10b9828
--- /dev/null
+++ b/src/scss/extensions/shadow.scss
@@ -0,0 +1,40 @@
+@import "../abstracts/shadow";
+
+.has-shadow {
+ box-shadow: var(--wp--custom--box-shadow);
+ transition: var(--wp--custom--transition);
+}
+
+.has-text-shadow {
+ text-shadow: var(--wp--custom--text-shadow--x, 0) var(--wp--custom--text-shadow--y, 0) var(--wp--custom--text-shadow--blur, 0) var(--wp--custom--text-shadow--color, transparent);
+}
+
+.has-none-shadow:not(.wp-block-button),
+.has-none-shadow-hover:not(.wp-block-button):hover,
+.has-none-shadow-hover:not(.wp-block-button):focus {
+ box-shadow: none;
+}
+
+@each $preset in $presets {
+
+ .has-#{$preset}-shadow {
+ box-shadow: var(--wp--preset--shadow--#{$preset});
+ }
+
+ .has-#{$preset}-shadow:not(.wp-block-button) {
+ box-shadow: var(--wp--preset--shadow--#{$preset});
+ }
+
+ .has-#{$preset}-shadow-hover:not(.wp-block-button):hover,
+ .has-#{$preset}-shadow-hover:not(.wp-block-button):focus {
+ box-shadow: var(--wp--preset--shadow--#{$preset}--hover) !important;
+ }
+
+ .has-#{$preset}-shadow.wp-block-button {
+ --wp--custom--button--box-shadow: var(--wp--preset--shadow--#{$preset});
+ }
+
+ .has-#{$preset}-shadow-hover.wp-block-button {
+ --wp--custom--button--box-shadow--hover: var(--wp--preset--shadow--#{$preset});
+ }
+}
diff --git a/src/scss/extensions/transform.scss b/src/scss/extensions/transform.scss
new file mode 100644
index 0000000..cb01152
--- /dev/null
+++ b/src/scss/extensions/transform.scss
@@ -0,0 +1,11 @@
+.has-transform {
+ transform: var(--transform);
+ transition: transform var(--wp--custom--transition--duration) var(--wp--custom--transition--timing-function);
+
+ @media (prefers-reduced-motion: no-preference) {
+
+ &:hover {
+ transform: var(--transform-hover, var(--transform));
+ }
+ }
+}
diff --git a/src/scss/formats/animation.scss b/src/scss/formats/animation.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/scss/formats/scribble.scss b/src/scss/formats/scribble.scss
new file mode 100644
index 0000000..f9bb980
--- /dev/null
+++ b/src/scss/formats/scribble.scss
@@ -0,0 +1,28 @@
+.is-underline-scribble {
+ display: inline-block;
+ position: relative;
+ text-decoration: none;
+
+ .has-text-gradient & {
+ position: static;
+ }
+
+ &::before {
+ content: "";
+ position: absolute;
+ top: 70%;
+ bottom: 0;
+ left: auto;
+ right: auto;
+ height: 0.5em;
+ width: 100%;
+ max-width: 100%;
+ margin: 0;
+ opacity: 0.5;
+ background: var(--wp--custom--text-gradient, currentColor);
+ -webkit-mask-repeat: no-repeat;
+ -webkit-mask-position: center;
+ -webkit-mask-size: 100%;
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' viewBox='0 0 418 42' class='absolute left-0 top-2/3 h-%5B0.58em%5D w-full fill-blue-300/70' preserveAspectRatio='none'%3E%3Cpath d='M203.371.916c-26.013-2.078-76.686 1.963-124.73 9.946L67.3 12.749C35.421 18.062 18.2 21.766 6.004 25.934 1.244 27.561.828 27.778.874 28.61c.07 1.214.828 1.121 9.595-1.176 9.072-2.377 17.15-3.92 39.246-7.496C123.565 7.986 157.869 4.492 195.942 5.046c7.461.108 19.25 1.696 19.17 2.582-.107 1.183-7.874 4.31-25.75 10.366-21.992 7.45-35.43 12.534-36.701 13.884-2.173 2.308-.202 4.407 4.442 4.734 2.654.187 3.263.157 15.593-.78 35.401-2.686 57.944-3.488 88.365-3.143 46.327.526 75.721 2.23 130.788 7.584 19.787 1.924 20.814 1.98 24.557 1.332l.066-.011c1.201-.203 1.53-1.825.399-2.335-2.911-1.31-4.893-1.604-22.048-3.261-57.509-5.556-87.871-7.36-132.059-7.842-23.239-.254-33.617-.116-50.627.674-11.629.54-42.371 2.494-46.696 2.967-2.359.259 8.133-3.625 26.504-9.81 23.239-7.825 27.934-10.149 28.304-14.005.417-4.348-3.529-6-16.878-7.066Z'%3E%3C/path%3E%3C/svg%3E");
+ }
+}
diff --git a/src/scss/formats/underline.scss b/src/scss/formats/underline.scss
index 6189bd5..03243d7 100644
--- a/src/scss/formats/underline.scss
+++ b/src/scss/formats/underline.scss
@@ -3,6 +3,7 @@
text-decoration-color: var(--wp--custom--underline--color, currentColor);
text-underline-offset: var(--wp--custom--underline--offset, 0.2em);
text-decoration-thickness: var(--wp--custom--underline--width);
+ -webkit-text-fill-color: currentColor;
}
.is-underline-none {
diff --git a/src/text-formats/animation.tsx b/src/text-formats/animation.tsx
new file mode 100644
index 0000000..bc15dc3
--- /dev/null
+++ b/src/text-formats/animation.tsx
@@ -0,0 +1,168 @@
+import { __ } from '@wordpress/i18n';
+import {
+ applyFormat,
+ Format,
+ FormatProps,
+ registerFormatType,
+ removeFormat,
+ toggleFormat,
+} from '@wordpress/rich-text';
+import { rotateRight } from '@wordpress/icons';
+import {
+ BlockControls,
+ RichTextShortcut,
+ RichTextToolbarButton,
+} from '@wordpress/block-editor';
+import {
+ __experimentalText as Text,
+ Popover,
+ SelectControl,
+ Toolbar,
+} from '@wordpress/components';
+import { useState } from '@wordpress/element';
+import { ucFirst } from '../utility/string';
+
+const name = 'blockify/animation';
+
+const animationTypes = [
+ 'none',
+ 'typewriter',
+];
+
+const Edit = ( { isActive, value, onChange }: FormatProps ) => {
+ const [ animation, setAnimation ] = useState( '' );
+ const [ isOpen, setIsOpen ] = useState( false );
+
+ let styles: string[] = [];
+ let classes: string[] = [];
+
+ if ( value?.formats ) {
+ value.formats.forEach( ( formats: Format[] | undefined ): void => {
+ if ( formats ) {
+ formats.forEach( ( format: Format ): void => {
+ if ( format.type === name ) {
+ if ( format.attributes?.style ) {
+ styles = format.attributes.style.split( ';' );
+ }
+
+ if ( format.attributes?.class ) {
+ classes = format.attributes.class.split( ' ' );
+ }
+ }
+ } );
+ }
+ } );
+ }
+
+ if ( ! animation ) {
+ animationTypes.forEach( ( animationType ) => {
+ if ( classes.includes( 'has-text-' + animationType + '-animation' ) ) {
+ setAnimation( animationType );
+ }
+ } );
+ }
+
+ const onToggle = () => {
+ onChange(
+ toggleFormat( value, {
+ type: name,
+ } )
+ );
+ };
+
+ const Settings = () => <>
+ { __( 'Animation style', 'blockify' ) }
+
+ {
+ if ( newAnimationType === 'none' ) {
+ onChange( removeFormat( value, name ) );
+ }
+
+ setAnimation( newAnimationType );
+
+ const existingClasses = classes ?? [];
+
+ existingClasses.forEach( ( existingClass: string, index: number ): void => {
+ if ( existingClass.includes( '-animation' ) ) {
+ delete newAttributes.classes[ index ];
+ }
+ } );
+
+ styles.forEach( ( style: string, index: number ): void => {
+ if ( style.includes( '--wp--custom--animation--' ) ) {
+ delete newAttributes.styles[ index ];
+ }
+ } );
+
+ const newAttributes = {
+ classes: [
+ ...existingClasses,
+ 'has-text-' + newAnimationType + '-animation',
+ ],
+ styles: [
+ ...styles ?? [],
+ '--wp--custom--animation--style:' + newAnimationType,
+ ],
+ };
+
+ onChange( applyFormat( ( value ), {
+ type: name,
+ attributes: {
+ class: newAttributes.classes.join( ' ' ),
+ style: newAttributes.styles.join( ';' ),
+ },
+ } ) );
+ } }
+ value={ animation }
+ options={ animationTypes.map( ( animationType ) => {
+ return {
+ label: ucFirst( animationType ),
+ value: animationType,
+ };
+ } ) }
+ >
+
+ >;
+
+ return (
+
+
+ setIsOpen( ! isOpen ) }
+ />
+ { isOpen &&
+
+ setIsOpen( false ) }
+ >
+
+
+
+ }
+
+ );
+};
+
+registerFormatType( name, {
+ title: __( 'Animation', 'blockify' ),
+ tagName: 'span',
+ className: 'has-text-animation',
+ attributes: {
+ style: 'style',
+ class: 'class',
+ },
+ edit: Edit,
+} );
diff --git a/src/text-formats/gradient.tsx b/src/text-formats/gradient.tsx
index 284c120..4f8b838 100644
--- a/src/text-formats/gradient.tsx
+++ b/src/text-formats/gradient.tsx
@@ -1,9 +1,14 @@
import { __ } from '@wordpress/i18n';
-import { Format, FormatProps, registerFormatType, applyFormat } from '@wordpress/rich-text';
-import { RichTextShortcut, BlockControls, RichTextToolbarButton } from '@wordpress/block-editor';
-import { Toolbar, Popover, GradientPicker } from '@wordpress/components';
+import {
+ applyFormat,
+ Format,
+ FormatProps,
+ registerFormatType,
+} from '@wordpress/rich-text';
+import { BlockControls, RichTextToolbarButton } from '@wordpress/block-editor';
+import { GradientPicker, Popover, Toolbar } from '@wordpress/components';
import { useState } from '@wordpress/element';
-import { SelectorMap, useSelect } from '@wordpress/data';
+import { useSelect } from '@wordpress/data';
import { styles } from '@wordpress/icons';
const name = 'blockify/gradient';
@@ -12,7 +17,7 @@ const Edit = ( { isActive, value, onChange }: FormatProps ) => {
const [ gradient, setGradient ] = useState( '' );
const [ isOpen, setIsOpen ] = useState( false );
- const { gradients } = useSelect( ( select: SelectorMap ) => {
+ const { gradients } = useSelect( ( select: any ) => {
return {
gradients: select( 'core/block-editor' ).getSettings()?.gradients,
};
@@ -43,47 +48,50 @@ const Edit = ( { isActive, value, onChange }: FormatProps ) => {
onClick={ () => setIsOpen( ! isOpen ) }
/>
{ isOpen &&
-
- setIsOpen( false ) }
- >
- {
- setGradient( newGradient );
+
+ setIsOpen( false ) }
+ >
+ {
+ setGradient( newGradient );
- let style = existingStyle;
- let className = existingClass;
+ let style = existingStyle;
+ let className = existingClass;
- gradients.forEach( ( gradientItem: { slug: string; gradient: string } ) => {
- if ( gradientItem.gradient === newGradient ) {
- className += ( className ? ' ' : '' ) + 'has-' + gradientItem.slug + '-gradient-background';
- }
- } );
+ gradients.forEach( ( gradientItem: {
+ slug: string;
+ gradient: string
+ } ) => {
+ if ( gradientItem.gradient === newGradient ) {
+ className += ( className ? ' ' : '' ) + 'has-' + gradientItem.slug + '-gradient-background';
+ }
+ } );
- if ( newGradient && ! className.includes( '-gradient-background' ) ) {
- style += ( style ? style + ';' : '' ) + 'background:' + newGradient;
- }
+ if ( newGradient && ! className.includes( '-gradient-background' ) ) {
+ style += ( style ? style + ';' : '' ) + 'background:' + newGradient;
+ }
- if ( className?.includes( 'has-text-gradient' ) ) {
- className = className?.replace( 'has-text-gradient', '' )?.trim() + ' has-text-gradient';
- }
+ if ( className?.includes( 'has-text-gradient' ) ) {
+ className = className?.replace( 'has-text-gradient', '' )?.trim() + ' has-text-gradient';
+ }
- onChange( applyFormat( value, {
- type: name,
- attributes: {
- style,
- class: className,
- },
- } ) );
- } }
- />
-
-
+ onChange( applyFormat( value, {
+ type: name,
+ attributes: {
+ style,
+ class: className,
+ },
+ } ) );
+ } }
+ />
+
+
}
diff --git a/src/text-formats/inline-svg.tsx b/src/text-formats/inline-svg.tsx
index f4157bb..38a3c2f 100644
--- a/src/text-formats/inline-svg.tsx
+++ b/src/text-formats/inline-svg.tsx
@@ -1,15 +1,19 @@
import { __ } from '@wordpress/i18n';
-import { registerFormatType, insertObject } from '@wordpress/rich-text';
+import { Format, insertObject, registerFormatType } from '@wordpress/rich-text';
import { symbol } from '@wordpress/icons';
-import { BlockControls, RichTextShortcut, RichTextToolbarButton } from '@wordpress/block-editor';
+import { BlockControls, RichTextToolbarButton } from '@wordpress/block-editor';
import {
- Toolbar,
- Popover, TextareaControl, Button, Flex, FlexItem,
- // eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalUnitControl as UnitControl,
+ Button,
+ Flex,
+ FlexItem,
PanelRow,
+ Popover,
+ TextareaControl,
+ Toolbar,
} from '@wordpress/components';
import { useState } from '@wordpress/element';
+import { cssObjectToString } from '../utility';
const name = 'blockify/inline-svg';
@@ -30,38 +34,113 @@ const Edit = ( props: formatProps ) => {
} );
const insertSvg = ( svgValue: {
- string: string,
- alt: string,
- width: string,
- widthDesktop: string,
- src: string
+ string: string;
+ alt: string;
+ width: string;
+ widthDesktop: string;
+ src: string;
} ) => {
- const src = 'data:image/svg+xml;utf8,' + encodeURIComponent( svgValue?.string );
- let style = `-webkit-mask-image:url(${ src })`;
+ const styles: genericStrings = {};
+
+ if ( svgValue?.string ) {
+ styles[ '-webkit-mask-image' ] = 'url(data:image/svg+xml;utf8,' + encodeURIComponent( svgValue.string ) + ')';
+ }
if ( svgValue?.width ) {
- style += `;--width: ${ svgValue?.width }`;
+ styles[ '--width' ] = svgValue.width;
}
if ( svgValue?.widthDesktop ) {
- style += `;--width-desktop: ${ svgValue?.widthDesktop }`;
+ styles[ '--width-desktop' ] = svgValue.widthDesktop;
}
+ const format: Format = {
+ type: name,
+ attributes: {
+ alt: svgValue?.alt,
+ role: 'presentation',
+ src: '',
+ style: cssObjectToString( styles ),
+ },
+ };
+
onChange(
- insertObject( value, {
- type: name,
- attributes: {
- style,
- alt: svgValue?.alt,
- role: 'presentation',
- src: '',
- },
- } )
+ insertObject( value, format )
);
setIsOpen( false );
};
+ const ModalContent = () => <>
+ {
+ setSvg( {
+ ...svg,
+ string: newSvgString.replace( /'/g, '"' ),
+ } );
+ } }
+ style={ {
+ fontFamily: 'var(--wp--preset--font-family--monospace, monospace)',
+ width: '300px',
+ } }
+ />
+
+ {
+ setSvg( {
+ ...svg,
+ alt: newAlt,
+ } );
+ } }
+ style={ {
+ width: '300px',
+ } }
+ />
+
+
+
+ {
+ setSvg( {
+ ...svg,
+ width: widthMobile,
+ } );
+ } }
+ />
+
+
+ {
+ setSvg( {
+ ...svg,
+ widthDesktop,
+ } );
+ } }
+ />
+
+
+
+
+ insertSvg( svg ) }
+ />
+ >;
+
return (
{
className={ 'blockify-svg-control' }
focusOnMount={ 'container' }
onFocusOutside={ () => setIsOpen( false ) }
- >
- {
- setSvg( {
- ...svg,
- string: newSvgString.replace( /'/g, '"' ),
- } );
- } }
- style={ {
- fontFamily: 'var(--wp--preset--font-family--monospace, monospace)',
- width: '300px',
- } }
- />
-
- {
- setSvg( {
- ...svg,
- alt: newAlt,
- } );
- } }
- style={ {
- width: '300px',
- } }
- />
-
-
-
- {
- setSvg( {
- ...svg,
- width: widthMobile,
- } );
- } }
- />
-
-
- {
- setSvg( {
- ...svg,
- widthDesktop,
- } );
- } }
- />
-
-
-
-
- insertSvg( svg ) }
- />
+ >
+
}
diff --git a/src/text-formats/text-outline.tsx b/src/text-formats/text-outline.tsx
index b32bf17..967f409 100644
--- a/src/text-formats/text-outline.tsx
+++ b/src/text-formats/text-outline.tsx
@@ -21,8 +21,6 @@ const Edit = ( props: formatProps ) => {
onChange,
} = props;
- const [ isOpen, setIsOpen ] = useState( false );
-
let existingStyleString = '';
let existingClassString = '';
diff --git a/src/text-formats/typography.tsx b/src/text-formats/typography.tsx
index ed57914..7b4425c 100644
--- a/src/text-formats/typography.tsx
+++ b/src/text-formats/typography.tsx
@@ -1,20 +1,19 @@
-import { RichTextToolbarButton } from '@wordpress/block-editor';
+import { BlockControls, RichTextToolbarButton } from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';
import { applyFormat, Format, registerFormatType } from '@wordpress/rich-text';
-import { RichTextShortcut } from '@wordpress/block-editor';
import { typography } from '@wordpress/icons';
-import { BlockControls } from '@wordpress/block-editor';
import {
- Toolbar,
+ CustomSelectControl,
+ FontSizePicker,
Popover,
SelectControl,
- FontSizePicker,
- CustomSelectControl,
+ Toolbar,
} from '@wordpress/components';
import { useState } from '@wordpress/element';
import { ucWords } from '../utility/string';
import { SelectorMap, useSelect } from '@wordpress/data';
import { cssObjectToString, cssStringToObject } from '../utility/css';
+import { CSSProperties } from 'react';
import Option = CustomSelectControl.Option;
const typographyType = 'blockify/typography';
@@ -124,9 +123,7 @@ const Edit = ( props: formatProps ) => {
onChange,
} = props;
- const [ isOpen, setIsOpen ] = useState( false );
-
- const { fontSizes } = useSelect( ( select : SelectorMap ) => {
+ const { fontSizes } = useSelect( ( select: SelectorMap ) => {
return {
fontSizes: select( 'core/block-editor' )?.getSettings()?.fontSizes,
};
@@ -158,12 +155,12 @@ const Edit = ( props: formatProps ) => {
}
interface Typography {
- style: style,
- class: string[],
- fontSize: string,
- fontFamily: string,
- fontAppearance: Option
- isOpen: boolean
+ style: CSSProperties;
+ class: string[];
+ fontSize: string;
+ fontFamily: string;
+ fontAppearance: Option;
+ isOpen: boolean;
}
const [ state, setState ] = useState( {
@@ -195,35 +192,35 @@ const Edit = ( props: formatProps ) => {
className={ 'blockify-font-family-control' }
focusOnMount={ 'container' }
onFocusOutside={ () => setState( {
- ...state,
- isOpen: false,
- } ) }
- >
+ ...state,
+ isOpen: false,
+ } ) }
+ >
{
- setState( {
- ...state,
- fontFamily: newFontFamily,
- } );
+ setState( {
+ ...state,
+ fontFamily: newFontFamily,
+ } );
- const newClass = 'has-' + newFontFamily + '-font-family';
+ const newClass = 'has-' + newFontFamily + '-font-family';
- if ( ! state?.class?.includes( newClass ) ) {
- state?.class?.push( newClass );
- }
+ if ( ! state?.class?.includes( newClass ) ) {
+ state?.class?.push( newClass );
+ }
- onChange( applyFormat( value, {
- type: typographyType,
- attributes: {
- style: cssObjectToString( state?.style ),
- class: state?.class?.join( ' ' ),
- },
- } ) );
- } }
- />
+ onChange( applyFormat( value, {
+ type: typographyType,
+ attributes: {
+ style: cssObjectToString( state?.style ),
+ class: state?.class?.join( ' ' ),
+ },
+ } ) );
+ } }
+ />
{
value={ parseInt( state?.fontSize ) }
withSlider={ true }
onChange={ ( newFontSize: number ) => {
- setState( {
- ...state,
- fontSize: newFontSize.toString(),
- } );
+ setState( {
+ ...state,
+ fontSize: newFontSize.toString(),
+ } );
- if ( newFontSize ) {
- state.style[ '--wp--custom--font-size' ] = newFontSize.toString();
- }
+ if ( newFontSize ) {
+ state.style[ '--wp--custom--font-size' ] = newFontSize.toString();
+ }
- if ( ! state?.class?.includes( 'has-inline-font-size' ) ) {
- state.class.push( 'has-inline-font-size' );
- }
+ if ( ! state?.class?.includes( 'has-inline-font-size' ) ) {
+ state.class.push( 'has-inline-font-size' );
+ }
- onChange( applyFormat( value, {
- type: typographyType,
- attributes: {
- style: cssObjectToString( state?.style ),
- class: state?.class?.join( ' ' ),
- },
- } ) );
- } }
- />
+ onChange( applyFormat( value, {
+ type: typographyType,
+ attributes: {
+ style: cssObjectToString( state?.style ),
+ class: state?.class?.join( ' ' ),
+ },
+ } ) );
+ } }
+ />
option.key === state?.fontAppearance?.key ) }
options={ appearanceOptions ?? [] }
onChange={ ( { selectedItem } ) => {
- if ( selectedItem ) {
- setState( {
- ...state,
- fontAppearance: selectedItem,
- } );
- }
+ if ( selectedItem ) {
+ setState( {
+ ...state,
+ fontAppearance: selectedItem,
+ } );
+ }
- if ( selectedItem?.style?.fontStyle ) {
- state.style[ 'font-style' ] = selectedItem?.style?.fontStyle;
- }
+ if ( selectedItem?.style?.fontStyle ) {
+ state.style[ 'font-style' ] = selectedItem?.style?.fontStyle;
+ }
- if ( selectedItem?.style?.fontWeight ) {
- state.style[ 'font-weight' ] = selectedItem?.style?.fontWeight?.toString();
- }
+ if ( selectedItem?.style?.fontWeight ) {
+ state.style[ 'font-weight' ] = selectedItem?.style?.fontWeight?.toString();
+ }
- onChange( applyFormat( value, {
- type: typographyType,
- attributes: {
- style: cssObjectToString( state?.style ),
- class: state?.class?.join( ' ' ),
- },
- } ) );
- } }
- />
+ onChange( applyFormat( value, {
+ type: typographyType,
+ attributes: {
+ style: cssObjectToString( state?.style ),
+ class: state?.class?.join( ' ' ),
+ },
+ } ) );
+ } }
+ />
}
diff --git a/src/text-formats/underline.tsx b/src/text-formats/underline.tsx
index f2edef4..fa143d9 100644
--- a/src/text-formats/underline.tsx
+++ b/src/text-formats/underline.tsx
@@ -1,13 +1,23 @@
import { __ } from '@wordpress/i18n';
-import { applyFormat, Format, FormatProps, registerFormatType, removeFormat, toggleFormat } from '@wordpress/rich-text';
+import {
+ applyFormat,
+ Format,
+ FormatProps,
+ registerFormatType,
+ removeFormat,
+ toggleFormat,
+} from '@wordpress/rich-text';
import { formatUnderline } from '@wordpress/icons';
-import { BlockControls, RichTextShortcut, RichTextToolbarButton } from '@wordpress/block-editor';
import {
- Toolbar,
+ BlockControls,
+ RichTextShortcut,
+ RichTextToolbarButton,
+} from '@wordpress/block-editor';
+import {
+ __experimentalText as Text,
Popover,
SelectControl,
- // eslint-disable-next-line @wordpress/no-unsafe-wp-apis
- __experimentalText as Text,
+ Toolbar,
} from '@wordpress/components';
import { useState } from '@wordpress/element';
import { ucFirst } from '../utility/string';
@@ -23,9 +33,10 @@ const underlineTypes = [
'double',
'brush',
'circle',
+ 'scribble',
];
-const Edit = ( { isActive, value, onChange } : FormatProps ) => {
+const Edit = ( { isActive, value, onChange }: FormatProps ) => {
const [ underline, setUnderline ] = useState( '' );
const [ isOpen, setIsOpen ] = useState( false );
@@ -80,52 +91,52 @@ const Edit = ( { isActive, value, onChange } : FormatProps ) => {
className={ 'blockify-underline-format' }
focusOnMount={ 'container' }
onFocusOutside={ () => setIsOpen( false ) }
- >
+ >
{ __( 'Underline style', 'blockify' ) }
{
- if ( newUnderlineType === 'none' ) {
- onChange( removeFormat( value, name ) );
- }
+ if ( newUnderlineType === 'none' ) {
+ onChange( removeFormat( value, name ) );
+ }
- setUnderline( newUnderlineType );
+ setUnderline( newUnderlineType );
- const existingClasses = classes ?? [];
+ const existingClasses = classes ?? [];
- existingClasses.forEach( ( existingClass: string, index: number ): void => {
- if ( existingClass.includes( 'is-underline-' ) ) {
- delete newAttributes.classes[ index ];
- }
- } );
+ existingClasses.forEach( ( existingClass: string, index: number ): void => {
+ if ( existingClass.includes( 'is-underline-' ) ) {
+ delete newAttributes.classes[ index ];
+ }
+ } );
- const newAttributes = {
- classes: [
- ...existingClasses,
- 'is-underline-' + newUnderlineType,
- ],
- styles: [
- ...styles ?? [],
- '--wp--custom--underline--style:' + newUnderlineType,
- ],
- };
+ const newAttributes = {
+ classes: [
+ ...existingClasses,
+ 'is-underline-' + newUnderlineType,
+ ],
+ styles: [
+ ...styles ?? [],
+ '--wp--custom--underline--style:' + newUnderlineType,
+ ],
+ };
- onChange( applyFormat( ( value ), {
- type: name,
- attributes: {
- class: newAttributes.classes.join( ' ' ),
- style: newAttributes.styles.join( ';' ),
- },
- } ) );
- } }
+ onChange( applyFormat( ( value ), {
+ type: name,
+ attributes: {
+ class: newAttributes.classes.join( ' ' ),
+ style: newAttributes.styles.join( ';' ),
+ },
+ } ) );
+ } }
value={ underline }
options={ underlineTypes.map( ( underlineType ) => {
- return {
- label: ucFirst( underlineType ),
- value: underlineType,
- };
- } ) }
- >
+ return {
+ label: ucFirst( underlineType ),
+ value: underlineType,
+ };
+ } ) }
+ >
diff --git a/src/utility/color.tsx b/src/utility/color.tsx
new file mode 100644
index 0000000..1b08922
--- /dev/null
+++ b/src/utility/color.tsx
@@ -0,0 +1,19 @@
+import { select } from '@wordpress/data';
+import { ColorPalette } from '@wordpress/components';
+import Color = ColorPalette.Color;
+
+export const getColorSlugFromValue = ( value: string ): string => {
+ const colors: Color[] = select( 'core/block-editor' )?.getSettings().colors ?? [];
+
+ const color = colors.find( ( color ) => color.color === value );
+
+ return color?.slug ?? '';
+};
+
+export const getColorValueFromSlug = ( slug: string ): string => {
+ const colors: Color[] = select( 'core/block-editor' )?.getSettings().colors ?? [];
+
+ const color = colors.find( ( color ) => color.slug === slug );
+
+ return color?.color ?? '';
+};
diff --git a/src/utility/css.tsx b/src/utility/css.tsx
index 7113cff..826b6b0 100644
--- a/src/utility/css.tsx
+++ b/src/utility/css.tsx
@@ -1,6 +1,6 @@
-import { toKebabCase, replaceAll } from './string';
+import { replaceAll, toKebabCase } from './string';
-export const cssObjectToString = ( css: style ): string => {
+export const cssObjectToString = ( css: genericStrings ): string => {
return Object.keys( css ).map( ( key ) => {
const property = key?.includes( '-' ) ? key : toKebabCase( key );
@@ -8,8 +8,8 @@ export const cssObjectToString = ( css: style ): string => {
} ).join( ' ' );
};
-export const cssStringToObject = ( css: string ): style => {
- const cssObject: style = {};
+export const cssStringToObject = ( css: string ): genericStrings => {
+ const cssObject: genericStrings = {};
css.split( ';' ).map( ( rule: string ) => {
const [ key, value ] = rule.split( ':' );
@@ -34,3 +34,30 @@ export const formatCustomProperty = ( property: string ): string => {
return property + ')';
};
+
+export const addClassName = ( classes = '', newClasses = '' ): string => {
+ if ( ! newClasses ) {
+ return classes;
+ }
+
+ const classList = classes.trim().split( ' ' );
+ const newClassList = newClasses.trim().split( ' ' );
+
+ newClassList.forEach( ( className ) => {
+ if ( ! classList.includes( className ) ) {
+ classList.push( className );
+ }
+ } );
+
+ return classList.join( ' ' );
+};
+
+export const unitsWithAuto = [
+ { value: 'px', label: 'px' },
+ { value: '%', label: '%' },
+ { value: 'em', label: 'em' },
+ { value: 'rem', label: 'rem' },
+ { value: 'vw', label: 'vw' },
+ { value: 'vh', label: 'vh' },
+ { value: 'auto', label: 'auto' },
+];
diff --git a/src/utility/icon.tsx b/src/utility/icon.tsx
new file mode 100644
index 0000000..6e07e19
--- /dev/null
+++ b/src/utility/icon.tsx
@@ -0,0 +1,158 @@
+import { BlockAttributes } from '@wordpress/blocks';
+
+export interface IconAttributes extends BlockAttributes {
+ iconSet?: string;
+ iconName?: string;
+ iconColor?: string;
+ iconGradient?: string;
+ iconSize?: string;
+ iconPosition?: string;
+ iconCustomSVG?: string;
+ iconSvgString?: string;
+}
+
+export const blockifyIcon =
+
+ ;
+
+export const defaultIcon = window?.blockify?.defaultIcon ?? {
+ set: 'wordpress',
+ name: 'star-empty',
+ string: ' ',
+};
+
+export const getIconStyles = ( attributes: IconAttributes ) => {
+ const styles: genericStrings = {};
+ let background = '';
+
+ const isIcon = attributes?.className?.includes( 'is-style-icon' );
+
+ if ( ( ! attributes?.iconSet || ! attributes?.iconName ) && ! isIcon ) {
+ return styles;
+ }
+
+ if ( attributes?.style?.color?.background ) {
+ background = attributes.style.color.background;
+ }
+
+ if ( attributes?.backgroundColor ) {
+ background = 'var(--wp--preset--color--' + attributes.backgroundColor + ', currentColor)';
+ }
+
+ if ( attributes?.iconPosition === 'start' ) {
+ styles[ '--wp--custom--icon--order' ] = '-1';
+ }
+
+ let gradient = '';
+
+ if ( attributes?.style?.color?.gradient ) {
+ gradient = attributes?.style?.color?.gradient;
+ }
+
+ if ( attributes?.gradient ) {
+ gradient = 'var(--wp--preset--gradient--' + attributes.gradient + ',currentColor)';
+ }
+
+ let text = '';
+
+ if ( attributes?.style?.color?.text ) {
+ text = attributes?.style?.color?.text;
+ }
+
+ if ( attributes?.textColor ) {
+ text = 'var(--wp--preset--color--' + attributes.textColor + ',currentColor)';
+ }
+
+ if ( background !== '' ) {
+ styles[ '--wp--custom--icon--background' ] = background;
+ }
+
+ if ( text ) {
+ styles[ '--wp--custom--icon--color' ] = text;
+
+ if ( gradient ) {
+ styles[ '--wp--custom--icon--background' ] = gradient;
+ }
+ } else if ( gradient ) {
+ styles[ '--wp--custom--icon--color' ] = gradient;
+ }
+
+ if ( attributes?.style?.spacing?.padding ) {
+ const padding = attributes.style.spacing.padding;
+
+ const paddingObject: { [side: string]: string } = {
+ top: padding?.top ?? '0',
+ right: padding?.right ?? '0',
+ bottom: padding?.bottom ?? '0',
+ left: padding?.left ?? '0',
+ };
+
+ // Support spacing scale.
+ Object.keys( paddingObject ).forEach( ( side: string ) => {
+ const value: string = paddingObject?.[ side ] ?? '';
+
+ if ( value && value?.includes( 'var:preset' ) ) {
+ paddingObject[ side ] = 'var(--wp--preset--spacing--' + value.replace( 'var:preset|spacing|', '' ) + ')';
+ }
+ } );
+
+ styles[ '--wp--custom--icon--padding' ] = Object.values( paddingObject ).join( ' ' );
+ }
+
+ if ( attributes?.style?.spacing?.margin ) {
+ const margin = attributes.style.spacing.margin;
+
+ const marginObject: { [side: string]: string } = {
+ top: margin?.top ?? '',
+ right: margin?.right ?? '',
+ bottom: margin?.bottom ?? '',
+ left: margin?.left ?? '',
+ };
+
+ // Support spacing scale.
+ Object.keys( marginObject ).forEach( ( side: string ) => {
+ const value: string = marginObject?.[ side ] ?? '';
+
+ if ( value?.includes( 'var:preset' ) ) {
+ marginObject[ side ] = 'var(--wp--preset--spacing--' + value?.replace( 'var:preset|spacing|', '' ) + ')';
+ }
+ } );
+
+ styles[ '--wp--custom--icon--margin' ] = Object.values( marginObject ).join( ' ' );
+ }
+
+ let borderColor = '';
+
+ if ( attributes?.borderColor ) {
+ borderColor = 'var(--wp--preset--color--' + attributes?.borderColor + ')';
+ }
+
+ if ( attributes?.style?.border?.width ) {
+ styles[ '--wp--custom--icon--border-width' ] = attributes.style.border.width;
+ styles[ '--wp--custom--icon--border-style' ] = attributes.style.border?.style ?? 'solid';
+ styles[ '--wp--custom--icon--border-color' ] = attributes.style.border?.color ?? borderColor;
+ }
+
+ let size = attributes?.iconSize ?? '';
+
+ if ( size !== '' ) {
+ const hasUnit = [ 'px', 'em', 'rem', 'vh', 'vw', '%' ].some( ( unit ) => size?.includes( unit ) );
+
+ size = hasUnit ? size : size + 'px';
+ styles[ '--wp--custom--icon--size' ] = size;
+ }
+
+ const svg: string = attributes?.iconSvgString ?? '';
+
+ if ( svg ) {
+ styles[ '--wp--custom--icon--url' ] = "url('data:image/svg+xml;utf8," + svg + "')";
+ }
+
+ return styles;
+};
diff --git a/src/utility/index.tsx b/src/utility/index.tsx
index 0531ddc..0b39b40 100644
--- a/src/utility/index.tsx
+++ b/src/utility/index.tsx
@@ -1,7 +1,36 @@
-export const textDomain = 'blockify';
+import {
+ cssObjectToString,
+ cssStringToObject,
+ formatCustomProperty,
+ unitsWithAuto,
+} from './css';
-export const blockifyIcon =
-
- ;
+import {
+ camelCaseToWords,
+ replaceAll,
+ toKebabCase,
+ toTitleCase,
+ ucFirst,
+ ucWords,
+} from './string';
-export default { textDomain, blockifyIcon };
+import { blockifyIcon, defaultIcon, getIconStyles } from './icon.tsx';
+
+const textDomain = 'blockify';
+
+export {
+ textDomain,
+ blockifyIcon,
+ defaultIcon,
+ getIconStyles,
+ formatCustomProperty,
+ cssObjectToString,
+ cssStringToObject,
+ unitsWithAuto,
+ ucWords,
+ ucFirst,
+ toKebabCase,
+ replaceAll,
+ camelCaseToWords,
+ toTitleCase,
+};
diff --git a/src/utility/string.tsx b/src/utility/string.tsx
index 49518c2..27983ec 100644
--- a/src/utility/string.tsx
+++ b/src/utility/string.tsx
@@ -8,6 +8,7 @@ export const ucWords = ( str: string ) => {
export const ucFirst = ( str: string ) => str.charAt( 0 ).toUpperCase() + str.slice( 1 );
+// Attempts to convert all case types to `kebab-case`.
export const toKebabCase = ( str: string ) => {
if ( ! str ) {
return '';
@@ -16,8 +17,23 @@ export const toKebabCase = ( str: string ) => {
return str?.match( /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g )?.join( '-' )?.toLowerCase() ?? '';
};
-export const replaceAll = ( str: string, find: string, replace: string ) => {
- return str?.split( find )?.join( replace );
+export const replaceAll = ( str = '', find: string | string[], replace: string ) => {
+ if ( typeof find === 'string' ) {
+ return str?.split( find )?.join( replace );
+ }
+
+ for ( const f of find ) {
+ str = replaceAll( str, f, replace );
+ }
+
+ return str;
};
-export default { ucWords, ucFirst, toKebabCase };
+export const camelCaseToWords = ( slug: string ) => {
+ const result = slug.replace( /([A-Z])/g, ' $1' );
+ return result.charAt( 0 ).toUpperCase() + result.slice( 1 );
+};
+
+export const toTitleCase = ( str: string ): string => {
+ return ucWords( replaceAll( camelCaseToWords( str ), [ '-', '_' ], ' ' ) );
+};
diff --git a/src/utility/types.tsx b/src/utility/types.tsx
index aacd2e5..d84d66b 100644
--- a/src/utility/types.tsx
+++ b/src/utility/types.tsx
@@ -1,19 +1,106 @@
import { CustomSelectControl } from '@wordpress/components';
-import Option = CustomSelectControl.Option;
import { CSSProperties } from 'react';
-
-export {};
+import { BlockAttributes, TemplateArray } from '@wordpress/blocks';
+import {
+ AlignmentToolbar,
+ BlockAlignmentToolbar,
+ BlockControls,
+ EditorTemplateLock,
+} from '@wordpress/block-editor';
+import { Value } from '@wordpress/rich-text';
+import Option = CustomSelectControl.Option;
declare global {
- interface blockify {
+ interface genericStrings {
+ [key: string]: string;
+ }
+
+ interface CustomBlockAttribute {
+ control?: 'text' | 'textarea' | 'select' | 'number' | 'checkbox' | 'radio' | 'color' | 'range' | 'toggle';
+ default?: string | number | boolean | object | null | undefined;
+ name: string;
+ type: string;
+ label?: string;
+ value: string | number | boolean | object | null | undefined;
+ placeholder?: string;
+ help?: string;
+ min?: number;
+ max?: number;
+ step?: number;
+ options?: genericOption[];
+ multiple?: boolean;
+ labelPosition?: 'top' | 'side' | 'bottom';
+ inputType?: 'text' | 'number' | 'email' | 'url' | 'tel' | 'password' | 'hidden';
+ withInputField?: boolean;
+ marks?: {
+ value: number;
+ label: string;
+ }[];
+ rows?: number;
+ toolbar?: 'AlignmentToolbar' | 'BlockAlignmentToolbar' | 'BlockVerticalAlignmentToolbar';
+ controls?: BlockAlignmentToolbar.Control[] | AlignmentToolbar.Props['alignmentControls'] | BlockControls.Props['controls'];
+ onChange?: ( newValue: string | number | boolean | object | null | undefined ) => void;
+ subfields?: CustomField[];
+ allowReset?: boolean;
+ searchable?: boolean;
+ creatable?: boolean;
+ colors?: {
+ slug: string;
+ name: string;
+ color: string;
+ }[];
+ gradients?: {
+ slug: string;
+ name: string;
+ gradient: string;
+ }[];
+ enableAlpha?: boolean;
+ disableCustomColors?: boolean;
+ disableCustomGradients?: boolean;
+ showTitle?: boolean;
+ clearable?: boolean;
+ }
+
+ interface CustomBlock {
+ title?: string;
+ description?: string;
+ category?: string;
+ icon?: string | {
+ src: string;
+ };
+ attributes?: {
+ [key: string]: CustomBlockAttribute;
+ };
+ post_types?: string[];
+ uses_context?: string[];
+ enabled?: boolean;
+ template?: TemplateArray | undefined;
+ template_lock?: EditorTemplateLock | undefined;
+ }
+
+ interface CustomField {
+ id: string;
+ type: string;
+ index?: number;
+ label?: string;
+ add?: string;
+ default?: string | number | boolean | object | null | undefined;
+ subfields?: CustomField[];
+ placeholder?: string;
+ columns?: number;
+ control?: string; // Used by blocks.
+ onChange?: ( newValue: string | number | boolean | object | null | undefined ) => void; // Used by blocks.
+ }
- // Editor.
+ interface blockify {
+ name?: string;
siteUrl?: string;
adminUrl?: string;
ajaxUrl?: string;
url?: string;
restUrl?: string;
+ previewLink?: string;
nonce?: string;
icon?: string;
darkMode?: string;
@@ -25,19 +112,40 @@ declare global {
underlineTypes?: string[];
fontFamilies?: string[];
selectedFonts?: string[];
- positionOptions?: positionOptions;
+ extensionOptions?: extensionOptions;
+ filterOptions?: filterOptions;
+ imageOptions?: imageOptions;
animations?: string[];
animationOffset?: string;
breakpoint?: string; // Front end.
siteEditor?: boolean;
isPlugin?: boolean;
- userRoles?: { [key: string]: string };
+ userRoles?: genericStrings;
loremIpsum?: string;
+ googleMaps?: string;
+ plugins?: string[];
+ blocks?: {
+ [key: string]: CustomBlock;
+ };
+ postMeta?: string[];
+ postType?: string;
+ defaultIcon?: {
+ set: string;
+ name: string;
+ string: string;
+ };
+ metaBoxes?: {
+ id: string;
+ fields: CustomField[];
+ }[];
+ }
- // Public.
- setCookie: ( name: string, value: string, days: number ) => void,
- getCookie: ( name: string ) => string,
- eraseCookie: ( name: string ) => void,
+ interface Window {
+ blockify: blockify;
+ Splide?: any;
+ splide?: {
+ Extensions?: any;
+ };
}
interface blockSupports {
@@ -47,150 +155,137 @@ declare global {
text?: boolean;
background?: boolean;
link?: boolean;
- },
+ };
blockifyAnimation?: boolean;
blockifyBackground?: boolean;
blockifyBoxShadow?: boolean;
blockifyDisplay?: boolean;
blockifyFilter?: boolean;
+ blockifyInlineCss?: boolean;
blockifyOnclick?: boolean;
blockifyPosition?: boolean;
+ blockifySize?: boolean;
blockifyTransform?: boolean;
- }
- }
-
- interface BlockStyle {
- type: string
- name: string,
- label: string,
- isDefault?: boolean
+ };
}
interface BlockStyles {
unregister: {
- [ blockName: string ]: string[];
- },
+ [blockName: string]: string[];
+ };
register: {
- [ blockName: string ]: string[]
- }
+ [blockName: string]: string[] | {
+ [blockNameWithLabel: string]: string;
+ }[];
+ };
}
- interface Window {
- blockify: blockify;
+ interface wrapperProps {
+ style?: CSSProperties;
+ 'data-id'?: string;
+ className?: string;
}
- interface style {
- [name: string]: string | null;
+ interface responsiveStyles {
+ all?: string;
+ mobile?: string;
+ desktop?: string;
}
interface attributes {
- [name: string]: any;
- }
+ [name: string]: object | string | number | boolean | null | undefined;
- interface wrapperProps {
- style?: CSSProperties;
- 'data-id'?: string;
- className?: string;
+ style?: {
+ [key: string]: genericStrings | responsiveStyles;
+ };
}
interface blockProps {
name: string;
clientId: string;
className: string;
- style: style | CSSProperties;
- attributes: attributes,
+ style: genericStrings | CSSProperties;
+ attributes: BlockAttributes | attributes;
setAttributes: ( newAttributes: attributes ) => void;
- wrapperProps?: wrapperProps,
+ wrapperProps?: wrapperProps;
isSelected?: boolean;
- value?: any,
- children?: any,
+ value?: any;
+ children?: any;
+ context?: any;
}
interface formatProps {
- isActive?: boolean,
- onChange: ( value: any ) => any,
- formatTypes?: { name: string }[],
- value?: any,
+ isActive?: boolean;
+ onChange: ( value: any ) => any;
+ formatTypes?: { name: string }[];
+ value?: Value;
}
interface customSelectOptions extends Array {
- [index: number]: Option
- }
-
- interface cssTransforms {
- matrix?: string,
- matrix3d?: string,
- perspective?: string,
- rotate?: string,
- rotate3d?: string,
- rotateX?: string,
- rotateY?: string,
- rotateZ?: string,
- translate?: string,
- translate3d?: string,
- translateX?: string,
- translateY?: string,
- translateZ?: string,
- scale?: string,
- scale3d?: string,
- scaleX?: string,
- scaleY?: string,
- scaleZ?: string,
- skew?: string,
- skewX?: string,
- skewY?: string,
- hover?: cssTransforms,
- animate?: cssTransforms,
+ [index: number]: Option;
}
interface cssFilters {
- [name: string]: string | undefined | boolean | cssFilters,
-
- blur?: string,
- brightness?: string,
- contrast?: string,
- grayscale?: string,
- hueRotate?: string,
- invert?: string,
- opacity?: string,
- saturate?: string,
- sepia?: string,
- backdrop?: boolean,
- hover?: cssFilters,
- animate?: cssFilters,
+ [name: string]: string | undefined | boolean | cssFilters;
+
+ blur?: string;
+ brightness?: string;
+ contrast?: string;
+ grayscale?: string;
+ hueRotate?: string;
+ invert?: string;
+ opacity?: string;
+ saturate?: string;
+ sepia?: string;
+ backdrop?: boolean;
+ hover?: cssFilters;
+ animate?: cssFilters;
}
interface gradient {
- slug: string,
- name: string,
- gradient: string,
+ slug: string;
+ name: string;
+ gradient: string;
}
- interface positionOptions {
- [name: string]: responsiveSetting | undefined,
+ interface extensionOptions {
+ [name: string]: responsiveSetting | filterOptions | undefined;
- position?: responsiveSetting,
- inset?: responsiveSetting,
- zIndex?: responsiveSetting,
- overflow?: responsiveSetting,
- pointerEvents?: responsiveSetting,
+ position?: responsiveSetting;
+ inset?: responsiveSetting;
+ zIndex?: responsiveSetting;
+ overflow?: responsiveSetting;
+ pointerEvents?: responsiveSetting;
+ aspectRatio?: responsiveSetting;
+ objectFit?: responsiveSetting;
+ objectPosition?: responsiveSetting;
}
- interface displayOptions {
- display?: responsiveSetting,
- order?: responsiveSetting,
- width?: responsiveSetting,
- maxWidth?: responsiveSetting,
+ interface filterOptions {
+ [name: string]: {
+ unit?: string;
+ min?: number;
+ max?: number;
+ step?: number;
+ };
+ }
+
+ interface imageOptions {
+ aspectRatio?: responsiveSetting;
+ height?: responsiveSetting;
+ objectFit?: responsiveSetting;
+ objectPosition?: responsiveSetting;
+ }
+
+ interface genericOption {
+ value: string;
+ label: string;
+ disabled?: boolean;
}
interface responsiveSetting {
- value: string,
- label: string,
- options?: Array<{
- value: string,
- label: string,
- }>
+ value: string;
+ label: string;
+ options?: genericOption[];
}
}
-
-export { blockify };
diff --git a/style.css b/style.css
index b03eade..ae58ba1 100644
--- a/style.css
+++ b/style.css
@@ -4,10 +4,10 @@
* Author: Blockify
* Author URI: https://blockifywp.com/
* Description: Lightweight full site editing block theme framework. Blockify provides useful features that help you build modern WordPress sites with blocks. Optimized for speed - loads zero CSS, JavaScript, image or font files by default. Customization settings including SVG icons, box shadows, gradient text, absolute positioning, responsive settings, negative margins and more. Designed for use with child themes and compatible with most popular plugins. Blockify is a great starting point and toolkit for building your own custom block theme.
- * Requires at least: 6.1
- * Tested up to: 6.2
+ * Requires at least: 6.2
+ * Tested up to: 6.4
* Requires PHP: 7.4
- * Version: 1.2.7
+ * Version: 1.3.1
* License: GPL-2.0-or-later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: blockify
diff --git a/styles/dark.json b/styles/dark.json
index c122349..8bac170 100644
--- a/styles/dark.json
+++ b/styles/dark.json
@@ -1,81 +1,159 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
- "title": "Dark Mode",
+ "title": "Dark",
"settings": {
- "custom": {
- "darkMode": {
- "palette": {
- "foreground": "#151929",
- "heading": "#191f31",
- "body": "#3f4c7c",
- "outline": "#d0d4e3",
- "surface": "#f6f6f9",
- "background": "#ffffff"
- }
- }
- },
"color": {
"palette": [
{
- "color": "#3858e9",
- "name": "Primary",
- "slug": "primary"
+ "name": "Primary 900",
+ "slug": "primary-900",
+ "color": "#e0e7ff"
},
{
- "color": "#33f078",
- "name": "Secondary",
- "slug": "secondary"
+ "name": "Primary 700",
+ "slug": "primary-700",
+ "color": "#9eafff"
},
{
- "color": "#151929",
- "name": "Background",
- "slug": "background"
+ "name": "Primary 600",
+ "slug": "primary-600",
+ "color": "#4b4efc"
},
{
- "color": "#1d243c",
- "name": "Surface",
- "slug": "surface"
+ "name": "Primary 500",
+ "slug": "primary-500",
+ "color": "#4539f2"
},
{
- "color": "#3f4c7c",
- "name": "Outline",
- "slug": "outline"
+ "name": "Primary 300",
+ "slug": "primary-300",
+ "color": "#3a2cd6"
},
{
- "color": "#7e87ad",
- "name": "Neutral",
- "slug": "neutral"
+ "name": "Primary 100",
+ "slug": "primary-100",
+ "color": "#1a1e50"
},
{
- "color": "#d0d4e3",
- "name": "Body",
- "slug": "body"
+ "name": "Neutral 950",
+ "slug": "neutral-950",
+ "color": "#ffffff"
},
{
- "color": "#f6f6f9",
- "name": "Heading",
- "slug": "heading"
+ "name": "Neutral 900",
+ "slug": "neutral-900",
+ "color": "#f9fafb"
},
{
- "color": "#ffffff",
- "name": "Foreground",
- "slug": "foreground"
+ "name": "Neutral 800",
+ "slug": "neutral-800",
+ "color": "#f3f4f6"
},
{
- "color": "currentColor",
- "name": "Current Color",
- "slug": "currentColor"
+ "name": "Neutral 700",
+ "slug": "neutral-700",
+ "color": "#e5e7eb"
},
{
- "color": "inherit",
- "name": "Inherit",
- "slug": "inherit"
+ "name": "Neutral 600",
+ "slug": "neutral-600",
+ "color": "#a6b3cb"
+ },
+ {
+ "name": "Neutral 500",
+ "slug": "neutral-500",
+ "color": "#9ca3af"
+ },
+ {
+ "name": "Neutral 400",
+ "slug": "neutral-400",
+ "color": "#6b7280"
+ },
+ {
+ "name": "Neutral 300",
+ "slug": "neutral-300",
+ "color": "#4b5563"
+ },
+ {
+ "name": "Neutral 200",
+ "slug": "neutral-200",
+ "color": "#374151"
+ },
+ {
+ "name": "Neutral 100",
+ "slug": "neutral-100",
+ "color": "#1f2937"
+ },
+ {
+ "name": "Neutral 50",
+ "slug": "neutral-50",
+ "color": "#111827"
+ },
+ {
+ "name": "Neutral 0",
+ "slug": "neutral-0",
+ "color": "#030712"
+ },
+ {
+ "name": "Success 600",
+ "slug": "success-600",
+ "color": "#34d399"
+ },
+ {
+ "name": "Success 500",
+ "slug": "success-500",
+ "color": "#10b981"
+ },
+ {
+ "name": "Success 100",
+ "slug": "success-100",
+ "color": "#022c22"
+ },
+ {
+ "name": "Warning 600",
+ "slug": "warning-600",
+ "color": "#facc15"
+ },
+ {
+ "name": "Warning 500",
+ "slug": "warning-500",
+ "color": "#eab308"
+ },
+ {
+ "name": "Warning 100",
+ "slug": "warning-100",
+ "color": "#451a03"
+ },
+ {
+ "name": "Error 600",
+ "slug": "error-600",
+ "color": "#fb7185"
+ },
+ {
+ "name": "Error 500",
+ "slug": "error-500",
+ "color": "#f43f5e"
+ },
+ {
+ "name": "Error 100",
+ "slug": "error-100",
+ "color": "#4c0519"
},
{
- "color": "transparent",
"name": "Transparent",
- "slug": "transparent"
+ "slug": "transparent",
+ "color": "transparent"
+ },
+ {
+ "name": "Current",
+ "slug": "current",
+ "color": "currentcolor"
+ },
+ {
+ "name": "Inherit",
+ "slug": "inherit",
+ "color": "inherit"
}
]
}
diff --git a/templates/404.html b/templates/404.html
index dbc98b6..d38d04e 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -1,18 +1 @@
-
-
-
-
-
- Page not found
-
-
-
- Sorry, the page you are looking for could not be found. Try
- searching the site using the search form below.
-
-
-
-
-
-
-
+
diff --git a/templates/archive-download.html b/templates/archive-download.html
index 600a5bc..a407374 100644
--- a/templates/archive-download.html
+++ b/templates/archive-download.html
@@ -1,10 +1 @@
-
-
-
-
-
-
-
-
-
-
+
diff --git a/templates/archive-product.html b/templates/archive-product.html
index e079d35..5ad1dfc 100644
--- a/templates/archive-product.html
+++ b/templates/archive-product.html
@@ -1,7 +1 @@
-
-
-
-
-
-
-
+
diff --git a/templates/archive.html b/templates/archive.html
index d7ac938..20287f2 100644
--- a/templates/archive.html
+++ b/templates/archive.html
@@ -1,18 +1 @@
-
-
-
-
-
-
-
+
diff --git a/templates/author.html b/templates/author.html
new file mode 100644
index 0000000..be1111e
--- /dev/null
+++ b/templates/author.html
@@ -0,0 +1 @@
+
diff --git a/templates/blank.html b/templates/blank.html
index 7381a5b..b07fc39 100644
--- a/templates/blank.html
+++ b/templates/blank.html
@@ -1,5 +1 @@
-
-
-
-
-
+
diff --git a/templates/date.html b/templates/date.html
new file mode 100644
index 0000000..0ab340a
--- /dev/null
+++ b/templates/date.html
@@ -0,0 +1 @@
+
diff --git a/templates/front-page.html b/templates/front-page.html
index d1a8915..c92632e 100644
--- a/templates/front-page.html
+++ b/templates/front-page.html
@@ -1,5 +1 @@
-
-
-
-
diff --git a/templates/full-width.html b/templates/full-width.html
index f0abbea..7642019 100644
--- a/templates/full-width.html
+++ b/templates/full-width.html
@@ -1,9 +1 @@
-
-
-
-
-
-
-
-
-
+
diff --git a/templates/home.html b/templates/home.html
new file mode 100644
index 0000000..c92632e
--- /dev/null
+++ b/templates/home.html
@@ -0,0 +1 @@
+
diff --git a/templates/index.html b/templates/index.html
index d7ac938..64d0719 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,18 +1 @@
-
-
-
-
-
-
-
+
diff --git a/templates/page.html b/templates/page.html
index ae7041c..7d52d29 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -1,9 +1 @@
-
-
-
-
-
-
-
-
-
+
diff --git a/templates/product-search-results.html b/templates/product-search-results.html
deleted file mode 100644
index e079d35..0000000
--- a/templates/product-search-results.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/templates/search-product.html b/templates/search-product.html
new file mode 100644
index 0000000..ae591e3
--- /dev/null
+++ b/templates/search-product.html
@@ -0,0 +1 @@
+
diff --git a/templates/search.html b/templates/search.html
index 5d50f03..f96d65c 100644
--- a/templates/search.html
+++ b/templates/search.html
@@ -1,20 +1 @@
-
-
-
-
-
- Search Results
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/templates/single-download.html b/templates/single-download.html
index dfa912a..405d9e5 100644
--- a/templates/single-download.html
+++ b/templates/single-download.html
@@ -1,15 +1 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/templates/single-product.html b/templates/single-product.html
index 228fcc5..eedda1e 100644
--- a/templates/single-product.html
+++ b/templates/single-product.html
@@ -1,7 +1 @@
-
-
-
-
-
-
-
+
diff --git a/templates/single.html b/templates/single.html
index fbc13bf..6dcfe71 100644
--- a/templates/single.html
+++ b/templates/single.html
@@ -1,16 +1 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/templates/taxonomy-product_cat.html b/templates/taxonomy-product_cat.html
index 6e6337a..3b6010a 100644
--- a/templates/taxonomy-product_cat.html
+++ b/templates/taxonomy-product_cat.html
@@ -1,7 +1 @@
-
-
-
-
-
-
-
+
diff --git a/templates/taxonomy-product_tag.html b/templates/taxonomy-product_tag.html
index 0f80cae..78e40fa 100644
--- a/templates/taxonomy-product_tag.html
+++ b/templates/taxonomy-product_tag.html
@@ -1,7 +1 @@
-
-
-
-
-
-
-
+
diff --git a/tests/Pest.php b/tests/Pest.php
index 6e7d97e..c6deeb6 100644
--- a/tests/Pest.php
+++ b/tests/Pest.php
@@ -1,8 +1,10 @@
group('integration')->in('Integration');
-uses()->group('unit')->in('Unit');
+uses()->group( 'integration' )->in( 'Integration' );
+uses()->group( 'unit' )->in( 'Unit' );
-uses(TestCase::class)->in('Unit', 'Integration');
+uses( TestCase::class )->in( 'Unit', 'Integration' );
diff --git a/tests/php/CssIsCompiledTest.php b/tests/php/CssIsCompiledTest.php
deleted file mode 100644
index 82f415b..0000000
--- a/tests/php/CssIsCompiledTest.php
+++ /dev/null
@@ -1,15 +0,0 @@
-toBeTrue();
-
- $editor_css_contents = \file_get_contents( $editor_css );
-
- \expect( $editor_css_contents )->toContain( '.editor-styles-wrapper' );
-} );
diff --git a/tests/php/RestEndpointsTest.php b/tests/php/RestEndpointsTest.php
deleted file mode 100644
index 793ab4b..0000000
--- a/tests/php/RestEndpointsTest.php
+++ /dev/null
@@ -1,28 +0,0 @@
-server = $wp_rest_server = new \WP_REST_Server();
- do_action('rest_api_init', $this->server);
-});
-
-afterEach(function () {
- global $wp_rest_server;
- $wp_rest_server = null;
-
- parent::tearDown();
-});
-
-test('rest API endpoints work', function () {
- $routes = $this->server->get_routes();
-
- expect($routes)
- ->toBeArray()
- ->toHaveKey('/wp/v2/posts');
-});
diff --git a/tests/php/UtilityCssTest.php b/tests/php/UtilityCssTest.php
new file mode 100644
index 0000000..4e12920
--- /dev/null
+++ b/tests/php/UtilityCssTest.php
@@ -0,0 +1,30 @@
+toBeTrue();
+
+ $editor_css_contents = \file_get_contents( $editor_css );
+
+ \expect( $editor_css_contents )->toContain( '.editor-styles-wrapper' );
+} );
+
+test( 'css type flipping works', function () {
+ $css_array = [
+ 'color' => 'red',
+ 'font-size' => '12px',
+ ];
+
+ $css_string = 'color:red;font-size:12px';
+
+ \expect( css_array_to_string( $css_array ) )->toEqual( $css_string );
+ \expect( css_string_to_array( $css_string ) )->toEqual( $css_array );
+} );
diff --git a/tests/php/UtilityDomTest.php b/tests/php/UtilityDomTest.php
new file mode 100644
index 0000000..ea26e3d
--- /dev/null
+++ b/tests/php/UtilityDomTest.php
@@ -0,0 +1,73 @@
+Hello, World! ';
+ $dom = dom( $html );
+
+ expect( $dom )->toBeInstanceOf( DOMDocument::class );
+ expect( preg_replace( '/\s+/', '', $dom->saveHTML() ) )->toBe( preg_replace( '/\s+/', '', $html ) );
+} );
+
+it( 'returns a formatted DOMElement object from a DOMDocument object', function () {
+ $html = '
Hello, World!
';
+ $dom = dom( $html );
+ $element = get_dom_element( 'div', $dom );
+
+ expect( $element )->toBeInstanceOf( DOMElement::class );
+ expect( $element->tagName )->toBe( 'div' );
+ expect( $element->textContent )->toBe( 'Hello, World!' );
+} );
+
+it( 'returns null when no DOMElement found', function () {
+ $html = '
Hello, World!
';
+ $dom = dom( $html );
+ $element = get_dom_element( 'span', $dom );
+
+ expect( $element )->toBeNull();
+} );
+
+it( 'returns null when trying to cast non-element node', function () {
+ $html = '
Hello, World!
';
+ $dom = dom( $html );
+ $node = $dom->createTextNode( 'Hello, World!' );
+ $element = get_dom_element( 'div', $node );
+
+ expect( $element )->toBeNull();
+} );
+
+it( 'returns an HTML element with a replaced tag', function () {
+ $html = '
Hello, World!
';
+ $dom = dom( $html );
+ $element = get_dom_element( 'div', $dom );
+ $newElement = change_tag_name( 'span', $element );
+
+ expect( $newElement )->toBeInstanceOf( DOMElement::class );
+ expect( $newElement->tagName )->toBe( 'span' );
+ expect( $newElement->textContent )->toBe( 'Hello, World!' );
+ expect( $newElement->getAttribute( 'class' ) )->toBe( 'my-class' );
+} );
+
+it( 'returns an array of dom elements by class name', function () {
+ $html = '
Element 1
Element 2
Element 3
';
+ $dom = dom( $html );
+ $elements = get_elements_by_class_name( 'my-class', $dom );
+
+ expect( $elements )->toBeArray();
+ expect( count( $elements ) )->toBe( 2 );
+ expect( $elements[0] )->toBeInstanceOf( DOMElement::class );
+ expect( $elements[0]->firstChild->nodeValue )->toBe( 'Element 1' );
+ expect( $elements[1] )->toBeInstanceOf( DOMElement::class );
+ expect( $elements[1]->firstChild->nodeValue )->toBe( 'Element 2' );
+} );
+
diff --git a/tests/php/UtilityHelperTest.php b/tests/php/UtilityHelperTest.php
new file mode 100644
index 0000000..bb32439
--- /dev/null
+++ b/tests/php/UtilityHelperTest.php
@@ -0,0 +1,70 @@
+justReturn( 'blockify' );
+ Functions\when( 'get_template_directory' )->justReturn( get_dir_mock() );
+ Functions\when( 'get_template_directory_uri' )->justReturn( 'https://blockify.local/wp-content/themes/blockify' );
+ Functions\when( 'plugin_dir_url' )->justReturn( 'https://blockify.local/wp-content/plugins/blockify' );
+} );
+
+afterEach( function () {
+ Monkey\tearDown();
+} );
+
+function get_dir_mock( string $type = 'default' ): string {
+ $dirs = [
+ 'default' => dirname( __DIR__, 2 ) . DS,
+ 'plugin' => dirname( __DIR__, 3 ) . '/plugins/',
+ 'framework' => dirname( __DIR__, 2 ) . '/vendor/blockify/theme/',
+ ];
+
+ return $dirs[ $type ];
+}
+
+function get_uri_mock( string $type = 'default' ): string {
+ $dirs = [
+ 'default' => 'https://blockify.local/wp-content/themes/blockify/',
+ 'plugin' => 'https://blockify.local/wp-content/plugins/blockify/',
+ 'framework' => 'https://blockify.local/wp-content/themes/blockify/',
+ ];
+
+ return $dirs[ $type ];
+}
+
+test( 'is_framework function checks if Blockify is installed as framework', function () {
+ expect( Theme\is_framework() )->toBeFalse();
+} );
+
+test( 'is_plugin function checks if Blockify is installed as plugin', function () {
+ expect( Theme\is_plugin() )->toBeFalse();
+} );
+
+test( 'get_dir function returns path to theme directory when installed as framework', function () {
+ expect( Theme\get_dir() )->toBe( get_dir_mock() );
+} );
+
+test( 'get_dir function returns path to theme directory when installed as plugin', function () {
+ // TODO: Test with plugin active.
+ expect( Theme\get_dir() )->toBe( get_dir_mock() );
+} );
+
+test( 'get_uri function returns URI to theme directory when installed as framework', function () {
+ expect( Theme\get_uri() )->toBe( get_uri_mock( 'framework' ) );
+} );
+
+test( 'get_uri function returns URI to theme directory when installed as plugin', function () {
+
+ // TODO: Test with plugin installed.
+ expect( Theme\get_uri() )->toBe( get_uri_mock( 'default' ) );
+} );
diff --git a/tests/php/UtilityIconTest.php b/tests/php/UtilityIconTest.php
new file mode 100644
index 0000000..aaa08af
--- /dev/null
+++ b/tests/php/UtilityIconTest.php
@@ -0,0 +1,44 @@
+server = $wp_rest_server = new WP_REST_Server();
+ do_action( 'rest_api_init', $this->server );
+} );
+
+afterEach( function () {
+ global $wp_rest_server;
+ $wp_rest_server = null;
+
+ parent::tearDown();
+} );
+
+test( 'rest API endpoints work', function () {
+ if ( ! class_exists( '\WP_REST_Server' ) ) {
+
+ // If the REST API is not available, skip the test.
+ $this->markTestSkipped( 'TODO: Configure Rest API.' );
+
+ return;
+ }
+
+ $routes = $this->server->get_routes();
+
+ expect( $routes )
+ ->toBeArray()
+ ->toHaveKey( '/wp/v2/posts' );
+} );
diff --git a/tests/php/UtilityStringTest.php b/tests/php/UtilityStringTest.php
new file mode 100644
index 0000000..b2433eb
--- /dev/null
+++ b/tests/php/UtilityStringTest.php
@@ -0,0 +1,60 @@
+toBe('Lorem ipsum dolor sit amet, consectetur adipiscing elit');
+
+ $result = str_between('Lorem', 'elit', $string, true);
+ expect($result)->toBe(' ipsum dolor sit amet, consectetur adipiscing ');
+
+ $result = str_between('Nonexistent', 'String', $string);
+ expect($result)->toBe('');
+
+ $result = str_between('Nonexistent', 'String', $string, true);
+ expect($result)->toBe('');
+});
+
+test('str_between returns all occurrences when $all is true', function () {
+ $string = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem tempus dolor sit amet, consectetur fermentum elit.';
+
+ $result = str_between('Lorem', 'elit', $string, false, true);
+ expect($result)->toBeArray();
+ expect($result)->toEqual(['Lorem ipsum dolor sit amet, consectetur adipiscing elit', 'Lorem tempus dolor sit amet, consectetur fermentum elit']);
+
+ $result = str_between('Lorem', 'elit', $string, true, true);
+ expect($result)->toBeArray();
+ expect($result)->toEqual([' ipsum dolor sit amet, consectetur adipiscing ', ' tempus dolor sit amet, consectetur fermentum ']);
+
+ $result = str_between('dolor', 'elit', $string, false, true);
+ expect($result)->toBeArray();
+ expect($result)->toEqual(['dolor sit amet, consectetur adipiscing elit', 'dolor sit amet, consectetur fermentum elit']);
+
+ $result = str_between('dolor', 'elit', $string, true, true);
+ expect($result)->toBeArray();
+ expect($result)->toEqual([' sit amet, consectetur adipiscing ', ' sit amet, consectetur fermentum ']);
+});
+
+test('str_between returns empty string or array when no match found', function () {
+ $string = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
+
+ $result = str_between('Nonexistent', 'String', $string);
+ expect($result)->toBe('');
+
+ $result = str_between('Nonexistent', 'String', $string, true);
+ expect($result)->toBe('');
+
+ $result = str_between('Nonexistent', 'String', $string, false, true);
+ expect($result)->toBeArray()->toBe([]);
+
+ $result = str_between('Nonexistent', 'String', $string, true, true);
+ expect($result)->toBeArray()->toBe([]);
+});
+
diff --git a/tests/php/UtilityUnitTest.php b/tests/php/UtilityUnitTest.php
deleted file mode 100644
index 5450432..0000000
--- a/tests/php/UtilityUnitTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-test
' );
-
- expect( trim( $dom->saveHTML() ) )
- ->toBeString()
- ->toEqual( '
test
' );
-
-
- $empty = dom( '' );
-
- expect( trim( $empty->saveHTML() ) )
- ->toBeString()
- ->toEqual( '' );
-
-} );
-
-test( 'change tag name works', function () {
-
- $dom = dom( '
test
' );
-
- /** @var \DOMElement $first */
- $first = $dom->firstChild;
-
- \expect( $first->tagName )->toEqual( 'div' );
-
- $first = change_tag_name( $first, 'span' );
-
- \expect( $first->tagName )->toEqual( 'span' );
-
- $saved = trim( $dom->saveHTML() );
-
- \expect( $saved )->toEqual( '
test ' );
-
-} );
-
-test( 'css type flipping works', function () {
- $css_array = [
- 'color' => 'red',
- 'font-size' => '12px',
- ];
-
- $css_string = 'color:red;font-size:12px;';
-
- \expect( css_array_to_string( $css_array ) )->toEqual( $css_string );
- \expect( css_string_to_array( $css_string ) )->toEqual( $css_array );
-} );
-
diff --git a/theme.json b/theme.json
index 59c4808..3376137 100644
--- a/theme.json
+++ b/theme.json
@@ -1,7 +1,16 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
+ "title": "Light",
"customTemplates": [
+ {
+ "title": "Archive: Download",
+ "name": "archive-download"
+ },
+ {
+ "title": "Archive: Product",
+ "name": "archive-product"
+ },
{
"title": "Blank",
"name": "blank",
@@ -17,6 +26,34 @@
"page",
"post"
]
+ },
+ {
+ "title": "Product Search Results",
+ "name": "product-search-results"
+ },
+ {
+ "title": "Single item: Download",
+ "name": "single-download"
+ },
+ {
+ "title": "Single item: Product",
+ "name": "single-product"
+ },
+ {
+ "title": "Taxonomy Download Category",
+ "name": "taxonomy-download_category"
+ },
+ {
+ "title": "Taxonomy Download Tag",
+ "name": "taxonomy-download_tag"
+ },
+ {
+ "title": "Taxonomy Product Category",
+ "name": "taxonomy-product_cat"
+ },
+ {
+ "title": "Taxonomy Product Tag",
+ "name": "taxonomy-product_tag"
}
],
"templateParts": [
@@ -25,6 +62,11 @@
"name": "header",
"title": "Header"
},
+ {
+ "area": "uncategorized",
+ "name": "main",
+ "title": "Main"
+ },
{
"area": "footer",
"name": "footer",
@@ -33,7 +75,7 @@
],
"settings": {
"layout": {
- "contentSize": "min(calc(100dvw - var(--wp--preset--spacing--lg,2rem)), 800px)",
+ "contentSize": "min(calc(100dvw - var(--wp--preset--spacing--lg,2rem)), 720px)",
"wideSize": "min(calc(100dvw - var(--wp--preset--spacing--lg,2rem)), 1200px)"
},
"appearanceTools": true,
@@ -43,6 +85,9 @@
"style": true,
"width": true
},
+ "position": {
+ "sticky": false
+ },
"custom": {
"spacing": {
"gap": "var(--wp--style--block-gap)"
@@ -50,19 +95,19 @@
"border": {
"width": "1px",
"style": "solid",
- "color": "var(--wp--preset--color--custom-outline,var(--wp--preset--color--outline))",
+ "color": "var(--wp--preset--color--neutral-200)",
"radius": "6px"
},
"boxShadow": {
"inset": "",
"x": "0",
- "y": "5px",
- "blur": "20px",
+ "y": "4px",
+ "blur": "16px",
"spread": "0",
- "color": "var(--wp--preset--color--custom-shadow,var(--wp--preset--color--surface))",
+ "color": "var(--wp--preset--color--custom-shadow,#6b728011)",
"hover": {
"inset": "",
- "y": "10px"
+ "y": "8px"
}
},
"fontWeight": {
@@ -76,183 +121,293 @@
"extraLight": 200,
"thin": 100
},
- "transition": "all 0.2s ease",
- "darkMode": {
- "palette": {
- "foreground": "#ffffff",
- "heading": "#f6f6f9",
- "body": "#d0d4e3",
- "outline": "#3f4c7c",
- "surface": "#191f31",
- "background": "#151929"
- }
+ "transition": {
+ "property": "all",
+ "duration": "0.1s",
+ "timingFunction": "ease-in"
+ },
+ "strong": {
+ "fontWeight": "var(--wp--custom--font-weight--medium)"
+ },
+ "checklist": {
+ "color": "var(--wp--preset--color--success-600)"
},
"surface": {
- "borderColor": "transparent",
- "boxShadow": "var(--wp--custom--box-shadow)",
- "background": "var(--wp--preset--color--background)"
+ "backdropFilter": "blur(8px)",
+ "borderRadius": "var(--wp--custom--border--radius)",
+ "boxShadow": "var(--wp--preset--shadow--sm)",
+ "border": {
+ "top": "0",
+ "right": "0",
+ "bottom": "0",
+ "left": "0"
+ },
+ "overlay": {
+ "background": "var(--wp--preset--color--neutral-50)",
+ "opacity": ".5"
+ },
+ "input": {
+ "focus": {
+ "borderColor": "var(--wp--preset--color--primary-500)"
+ }
+ }
+ },
+ "subHeading": {
+ "color": "var(--wp--preset--color--primary-500)"
},
"buttonOutline": {
- "color": "var(--wp--preset--color--primary)"
+ "color": "var(--wp--preset--color--primary-500)",
+ "borderWidth": "1px"
},
- "buttonGhost": {
- "color": "var(--wp--preset--color--primary)"
+ "ghost": {
+ "color": "var(--wp--preset--color--primary-600)"
+ },
+ "input": {
+ "background": "var(--wp--preset--color--neutral-0)",
+ "focus": {
+ "boxShadow": "var(--wp--preset--shadow--sm)",
+ "borderColor": "var(--wp--preset--color--primary-500)"
+ }
+ },
+ "placeholder": {
+ "background": "var(--wp--preset--color--neutral-100)"
},
"icon": {
- "color": "var(--wp--preset--color--primary)"
+ "color": "currentcolor"
+ },
+ "notice": {
+ "color": "var(--wp--preset--color--primary-500)"
+ },
+ "accordion": {
+ "height": "1.5px",
+ "width": "12px",
+ "animationDuration": "0s"
+ },
+ "submenu": {
+ "boxShadow": "var(--wp--preset--shadow--xl)"
+ },
+ "header": {
+ "zIndex": "2"
}
},
- "spacing": {
- "blockGap": true,
- "margin": true,
- "padding": true,
- "units": [
- "%",
- "em",
- "px",
- "rem",
- "vh",
- "vw"
- ],
- "customSpacingSize": true,
- "spacingScale": {
- "operator": "*",
- "increment": 0,
- "steps": 0,
- "mediumStep": 0,
- "unit": "px"
- },
- "spacingSizes": [
+ "color": {
+ "customDuotone": true,
+ "customGradient": true,
+ "defaultGradients": true,
+ "defaultPalette": false,
+ "link": true,
+ "palette": [
{
- "name": "XXS",
- "slug": "xxs",
- "size": "clamp(8px,1vw,10px)"
+ "name": "Primary 900",
+ "slug": "primary-900",
+ "color": "#2b2788"
},
{
- "name": "XS",
- "slug": "xs",
- "size": "var(--wp--preset--font-size--20)"
+ "name": "Primary 700",
+ "slug": "primary-700",
+ "color": "#3a2cd6"
},
{
- "name": "S",
- "slug": "sm",
- "size": "var(--wp--preset--font-size--30)"
+ "name": "Primary 600",
+ "slug": "primary-600",
+ "color": "#4539f2"
},
{
- "name": "M",
- "slug": "md",
- "size": "var(--wp--preset--font-size--42)"
+ "name": "Primary 500",
+ "slug": "primary-500",
+ "color": "#4b4efc"
},
{
- "name": "L",
- "slug": "lg",
- "size": "var(--wp--preset--font-size--60)"
+ "name": "Primary 300",
+ "slug": "primary-300",
+ "color": "#9eafff"
},
{
- "name": "XL",
- "slug": "xl",
- "size": "var(--wp--preset--font-size--81)"
+ "name": "Primary 100",
+ "slug": "primary-100",
+ "color": "#e0e7ff"
},
{
- "name": "XXL",
- "slug": "xxl",
- "size": "clamp(81px,12vw,120px)"
- }
- ]
- },
- "color": {
- "customDuotone": true,
- "customGradient": true,
- "defaultGradients": true,
- "defaultPalette": false,
- "link": true,
- "palette": [
+ "name": "Neutral 950",
+ "slug": "neutral-950",
+ "color": "#030712"
+ },
{
- "color": "#3858e9",
- "name": "Primary",
- "slug": "primary"
+ "name": "Neutral 900",
+ "slug": "neutral-900",
+ "color": "#111827"
},
{
- "color": "#33f078",
- "name": "Secondary",
- "slug": "secondary"
+ "name": "Neutral 800",
+ "slug": "neutral-800",
+ "color": "#1f2937"
},
{
- "color": "#151929",
- "name": "Foreground",
- "slug": "foreground"
+ "name": "Neutral 700",
+ "slug": "neutral-700",
+ "color": "#374151"
},
{
- "color": "#1d243c",
- "name": "Heading",
- "slug": "heading"
+ "name": "Neutral 600",
+ "slug": "neutral-600",
+ "color": "#4b5563"
},
{
- "color": "#3f4c7c",
- "name": "Body",
- "slug": "body"
+ "name": "Neutral 500",
+ "slug": "neutral-500",
+ "color": "#6b7280"
},
{
- "color": "#7e87ad",
- "name": "Neutral",
- "slug": "neutral"
+ "name": "Neutral 400",
+ "slug": "neutral-400",
+ "color": "#9ca3af"
},
{
- "color": "#d0d4e3",
- "name": "Outline",
- "slug": "outline"
+ "name": "Neutral 300",
+ "slug": "neutral-300",
+ "color": "#d1d5db"
},
{
- "color": "#f6f6f9",
- "name": "Surface",
- "slug": "surface"
+ "name": "Neutral 200",
+ "slug": "neutral-200",
+ "color": "#e5e7eb"
},
{
- "color": "#ffffff",
- "name": "Base",
- "slug": "background"
+ "name": "Neutral 100",
+ "slug": "neutral-100",
+ "color": "#f3f4f6"
},
{
- "color": "currentColor",
- "name": "Current Color",
- "slug": "currentColor"
+ "name": "Neutral 50",
+ "slug": "neutral-50",
+ "color": "#f9fafb"
},
{
- "color": "inherit",
- "name": "Inherit",
- "slug": "inherit"
+ "name": "Neutral 0",
+ "slug": "neutral-0",
+ "color": "#ffffff"
+ },
+ {
+ "name": "Success 600",
+ "slug": "success-600",
+ "color": "#059669"
+ },
+ {
+ "name": "Success 500",
+ "slug": "success-500",
+ "color": "#10b981"
+ },
+ {
+ "name": "Success 100",
+ "slug": "success-100",
+ "color": "#d1fae5"
+ },
+ {
+ "name": "Warning 600",
+ "slug": "warning-600",
+ "color": "#d97706"
+ },
+ {
+ "name": "Warning 500",
+ "slug": "warning-500",
+ "color": "#f59e0b"
+ },
+ {
+ "name": "Warning 100",
+ "slug": "warning-100",
+ "color": "#feeac7"
+ },
+ {
+ "name": "Error 600",
+ "slug": "error-600",
+ "color": "#e11d48"
+ },
+ {
+ "name": "Error 500",
+ "slug": "error-500",
+ "color": "#f43f5e"
+ },
+ {
+ "name": "Error 100",
+ "slug": "error-100",
+ "color": "#ffe4e6"
},
{
- "color": "transparent",
"name": "Transparent",
- "slug": "transparent"
+ "slug": "transparent",
+ "color": "transparent"
+ },
+ {
+ "name": "Current",
+ "slug": "current",
+ "color": "currentcolor"
+ },
+ {
+ "name": "Inherit",
+ "slug": "inherit",
+ "color": "inherit"
}
],
"gradients": [
{
- "gradient": "linear-gradient(135deg,var(--wp--preset--color--primary) 0%,var(--wp--preset--color--foreground) 100%)",
+ "gradient": "linear-gradient(135deg,var(--wp--preset--color--primary-700) 0%,var(--wp--preset--color--primary-500) 100%)",
+ "name": "Primary 600/500",
+ "slug": "primary-600-500"
+ },
+ {
+ "gradient": "linear-gradient(135deg,var(--wp--preset--color--primary-500) 0%,var(--wp--preset--color--primary-300) 100%)",
+ "name": "Primary 500/300",
+ "slug": "primary-500-300"
+ },
+ {
+ "gradient": "linear-gradient(180deg,var(--wp--preset--color--transparent) 0%,var(--wp--preset--color--primary-100) 100%)",
+ "name": "Primary Transparent",
+ "slug": "primary-transparent"
+ },
+ {
+ "gradient": "linear-gradient(135deg,var(--wp--preset--color--primary-900) 0%,var(--wp--preset--color--neutral-950) 100%)",
"name": "Primary Foreground",
"slug": "primary-foreground"
},
{
- "gradient": "linear-gradient(135deg,var(--wp--preset--color--body) 0%,var(--wp--preset--color--heading) 100%)",
+ "gradient": "linear-gradient(135deg,var(--wp--preset--color--neutral-600) 0%,var(--wp--preset--color--neutral-950) 100%)",
"name": "Body/Heading",
"slug": "body-heading"
},
{
- "gradient": "linear-gradient(135deg,var(--wp--preset--color--surface) 0%,var(--wp--preset--color--outline) 100%)",
+ "gradient": "linear-gradient(135deg,var(--wp--preset--color--neutral-100) 0%,var(--wp--preset--color--neutral-200) 100%)",
"name": "Surface/Border",
"slug": "surface-border"
},
{
- "gradient": "linear-gradient(0deg,var(--wp--preset--color--background) 50%,transparent 50%)",
- "name": "Base/Transparent",
+ "gradient": "linear-gradient(0deg,var(--wp--custom--body--background) 50%,transparent 50%)",
+ "name": "Background/Transparent",
"slug": "background-transparent"
},
{
- "gradient": "linear-gradient(180deg,var(--wp--preset--color--background) 50%,transparent 50%)",
- "name": "Transparent/Base",
+ "gradient": "linear-gradient(180deg,var(--wp--custom--body--background) 50%,transparent 50%)",
+ "name": "Transparent/Background",
"slug": "transparent-background"
+ },
+ {
+ "gradient": "linear-gradient(90deg,var(--wp--preset--color--neutral-0) 0%,transparent 100%)",
+ "name": "Fade Left",
+ "slug": "fade-left"
+ },
+ {
+ "gradient": "linear-gradient(-90deg,var(--wp--preset--color--neutral-0) 0%,transparent 100%)",
+ "name": "Fade Right",
+ "slug": "fade-right"
+ },
+ {
+ "gradient": "repeating-conic-gradient(var(--wp--preset--color--neutral-200) 0% 25%, transparent 0% 50%) 50% / 16px 16px",
+ "name": "Checkerboard",
+ "slug": "checkerboard"
+ },
+ {
+ "gradient": "conic-gradient(from 90deg at 1px 1px,transparent 90deg,var(--wp--custom--gradient-grid--color,var(--wp--preset--color--neutral-100)) 0) -1px -1px / var(--wp--custom--gradient-grid--size,40px) var(--wp--custom--gradient-grid--size,40px)",
+ "name": "Grid",
+ "slug": "grid"
}
]
},
@@ -263,93 +418,120 @@
"fluid": false,
"fontSizes": [
{
- "name": "100px",
- "slug": "100",
- "size": "clamp(60px,9.9vw,100px)",
+ "name": "96px",
+ "slug": "96",
+ "size": "clamp(80px,9.6vw,96px)",
"fluid": {
- "min": "60px",
- "max": "100px"
+ "min": "80px",
+ "max": "96px"
}
},
{
- "name": "90px",
- "slug": "90",
- "size": "clamp(54px,9vw,90px)",
+ "name": "88px",
+ "slug": "88",
+ "size": "clamp(72px,8.8vw,88px)",
"fluid": {
- "min": "54px",
- "max": "90px"
+ "min": "72px",
+ "max": "88px"
}
},
{
- "name": "81px",
- "slug": "81",
- "size": "clamp(51px,8.1vw,81px)",
+ "name": "80px",
+ "slug": "80",
+ "size": "clamp(64px,8vw,80px)",
"fluid": {
- "min": "51px",
- "max": "81px"
+ "min": "64px",
+ "max": "80px"
}
},
{
"name": "72px",
"slug": "72",
- "size": "clamp(48px,7.2vw,72px)",
+ "size": "clamp(56px,7.2vw,72px)",
"fluid": {
- "min": "48px",
+ "min": "56px",
"max": "72px"
}
},
+ {
+ "name": "64px",
+ "slug": "64",
+ "size": "clamp(52px,6.4vw,64px)",
+ "fluid": {
+ "min": "52px",
+ "max": "60px"
+ }
+ },
{
"name": "60px",
"slug": "60",
- "size": "clamp(45px,6vw,60px)",
+ "size": "clamp(48px,6vw,60px)",
"fluid": {
- "min": "45px",
+ "min": "48px",
"max": "60px"
}
},
{
- "name": "54px",
- "slug": "54",
- "size": "clamp(42px,6vw,54px)",
+ "name": "52px",
+ "slug": "52",
+ "size": "clamp(44px,5.2vw,52px)",
"fluid": {
- "min": "42px",
- "max": "54px"
+ "min": "44px",
+ "max": "52px"
}
},
{
"name": "48px",
"slug": "48",
- "size": "clamp(36px,4.8vw,48px)",
+ "size": "clamp(40px,4.8vw,48px)",
"fluid": {
- "min": "36px",
+ "min": "40px",
"max": "48px"
}
},
{
- "name": "42px",
- "slug": "42",
- "size": "clamp(27px,4.2vw,42px)",
+ "name": "44px",
+ "slug": "44",
+ "size": "clamp(40px,4.4vw,44px)",
+ "fluid": {
+ "min": "40px",
+ "max": "44px"
+ }
+ },
+ {
+ "name": "40px",
+ "slug": "40",
+ "size": "clamp(36px,4vw,40px)",
"fluid": {
"min": "36px",
- "max": "42px"
+ "max": "40px"
}
},
{
"name": "36px",
"slug": "36",
- "size": "clamp(24px,3.6vw,36px)",
+ "size": "clamp(32px,3.6vw,36px)",
"fluid": {
- "min": "30px",
+ "min": "32px",
"max": "36px"
}
},
{
- "name": "30px",
- "slug": "30",
- "size": "clamp(21px,3vw,30px)",
+ "name": "32px",
+ "slug": "32",
+ "size": "clamp(28px,3.2vw,32px)",
+ "fluid": {
+ "min": "28px",
+ "max": "32px"
+ }
+ },
+ {
+ "name": "28px",
+ "slug": "28",
+ "size": "clamp(24px,2.8vw,28px)",
"fluid": {
"min": "24px",
- "max": "30px"
+ "max": "28px"
}
},
{
@@ -373,16 +555,16 @@
{
"name": "20px",
"slug": "20",
- "size": "clamp(18px,2vw,20px)",
+ "size": "clamp(19px,2vw,20px)",
"fluid": {
- "min": "18px",
+ "min": "19px",
"max": "20px"
}
},
{
"name": "18px",
"slug": "18",
- "size": "clamp(16px,1.8vw,18px)",
+ "size": "clamp(17px,1.8vw,18px)",
"fluid": {
"min": "17px",
"max": "18px"
@@ -391,21 +573,30 @@
{
"name": "16px",
"slug": "16",
- "size": "clamp(14px,1.6vw,16px)",
+ "size": "clamp(16px,1.6vw,16px)",
"fluid": {
- "min": "15px",
+ "min": "16px",
"max": "16px"
}
},
{
"name": "14px",
"slug": "14",
- "size": "clamp(12px,1.4vw,14px)",
+ "size": "clamp(14px,1.4vw,14px)",
"fluid": {
- "min": "13px",
+ "min": "14px",
"max": "14px"
}
},
+ {
+ "name": "12px",
+ "slug": "12",
+ "size": "clamp(12px,1.2vw,12px)",
+ "fluid": {
+ "min": "12px",
+ "max": "12px"
+ }
+ },
{
"name": "Inherit",
"slug": "inherit",
@@ -414,7 +605,7 @@
],
"fontFamilies": [
{
- "fontFamily": "Inter",
+ "fontFamily": "Inter, var(--wp--preset--font-family--sans-serif)",
"name": "Inter",
"slug": "inter",
"fontFace": [
@@ -429,86 +620,228 @@
]
}
]
+ },
+ {
+ "fontFamily": "Inter Tight, var(--wp--preset--font-family--sans-serif)",
+ "name": "Inter Tight",
+ "slug": "inter-tight",
+ "fontFace": [
+ {
+ "fontFamily": "Inter Tight",
+ "fontStyle": "normal",
+ "fontStretch": "normal",
+ "fontDisplay": "swap",
+ "fontWeight": "100 900",
+ "src": [
+ "file:./assets/fonts/inter-tight.woff2"
+ ]
+ }
+ ]
+ },
+ {
+ "fontFamily": "JetBrains Mono, var(--wp--preset--font-family--monospace)",
+ "name": "JetBrains Mono",
+ "slug": "jetbrains-mono",
+ "fontFace": [
+ {
+ "fontFamily": "JetBrains Mono",
+ "fontStyle": "normal",
+ "fontStretch": "normal",
+ "fontDisplay": "swap",
+ "fontWeight": "100 900",
+ "src": [
+ "file:./assets/fonts/jetbrains-mono.woff2"
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "shadow": {
+ "defaultPresets": false,
+ "presets": [
+ {
+ "name": "None",
+ "slug": "none",
+ "shadow": "none"
+ },
+ {
+ "name": "XX Small",
+ "slug": "xxs",
+ "shadow": "0 1px 2px 0 var(--wp--custom--box-shadow--color)"
+ },
+ {
+ "name": "X Small",
+ "slug": "xs",
+ "shadow": "0 1px 2px var(--wp--custom--box-shadow--color), 0 2px 4px 0 var(--wp--custom--box-shadow--color)"
+ },
+ {
+ "name": "Small",
+ "slug": "sm",
+ "shadow": "0 1px 2px 0 var(--wp--custom--box-shadow--color), 0 4px 12px -4px var(--wp--custom--box-shadow--color)"
+ },
+ {
+ "name": "Medium",
+ "slug": "md",
+ "shadow": "0 1px 2px 0 var(--wp--custom--box-shadow--color), 0 4px 8px var(--wp--custom--box-shadow--color)"
+ },
+ {
+ "name": "Large",
+ "slug": "lg",
+ "shadow": "0 2px 4px 0 var(--wp--custom--box-shadow--color), 0 8px 24px var(--wp--custom--box-shadow--color)"
+ },
+ {
+ "name": "X Large",
+ "slug": "xl",
+ "shadow": "0 4px 8px -4px var(--wp--custom--box-shadow--color), 0 16px 24px -4px var(--wp--custom--box-shadow--color)"
+ },
+ {
+ "name": "XX Large",
+ "slug": "xxl",
+ "shadow": "0 4px 8px 0 var(--wp--custom--box-shadow--color), 0 24px 48px 0 var(--wp--custom--box-shadow--color)"
+ }
+ ]
+ },
+ "spacing": {
+ "blockGap": true,
+ "margin": true,
+ "padding": true,
+ "units": [
+ "%",
+ "em",
+ "px",
+ "rem",
+ "vh",
+ "vw"
+ ],
+ "customSpacingSize": true,
+ "spacingScale": {
+ "operator": "*",
+ "increment": 0,
+ "steps": 0,
+ "mediumStep": 0,
+ "unit": "px"
+ },
+ "spacingSizes": [
+ {
+ "name": "XXS (8px)",
+ "slug": "xxs",
+ "size": "8px"
+ },
+ {
+ "name": "XS (16px)",
+ "slug": "xs",
+ "size": "var(--wp--preset--font-size--16)"
+ },
+ {
+ "name": "S (24px)",
+ "slug": "sm",
+ "size": "var(--wp--preset--font-size--24)"
+ },
+ {
+ "name": "M (32px)",
+ "slug": "md",
+ "size": "var(--wp--preset--font-size--32)"
+ },
+ {
+ "name": "L (48px)",
+ "slug": "lg",
+ "size": "var(--wp--preset--font-size--48)"
+ },
+ {
+ "name": "XL (64px)",
+ "slug": "xl",
+ "size": "var(--wp--preset--font-size--64)"
+ },
+ {
+ "name": "XXL (96px)",
+ "slug": "xxl",
+ "size": "var(--wp--preset--font-size--96)"
}
]
}
},
"styles": {
"color": {
- "background": "var(--wp--preset--color--background)",
- "text": "var(--wp--preset--color--body)"
+ "background": "var(--wp--preset--color--neutral-0)",
+ "text": "var(--wp--preset--color--neutral-600)"
},
"spacing": {
- "blockGap": "var(--wp--preset--spacing--xs)"
+ "blockGap": "var(--wp--preset--spacing--sm)"
},
"typography": {
"fontFamily": "var(--wp--preset--font-family--inter)",
- "fontSize": "var(--wp--preset--font-size--20)",
+ "fontSize": "var(--wp--preset--font-size--16)",
"fontWeight": "var(--wp--custom--font-weight--regular)",
- "lineHeight": "1.5"
+ "lineHeight": "1.6"
},
"elements": {
"button": {
"border": {
- "width": "0px",
"radius": "var(--wp--custom--border--radius)"
},
"color": {
"text": "#fff",
- "background": "var(--wp--preset--color--primary)"
+ "background": "var(--wp--preset--color--primary-500)"
},
"spacing": {
"padding": {
- "top": "0.9em",
- "right": "1.2em",
- "bottom": "0.9em",
- "left": "1.2em"
+ "top": "10px",
+ "right": "16px",
+ "bottom": "10px",
+ "left": "16px"
}
},
"typography": {
- "fontSize": "clamp(16px,1.7vw,17px)",
+ "fontSize": "14px",
"fontWeight": "var(--wp--custom--font-weight--semi-bold)",
- "lineHeight": "inherit"
+ "lineHeight": "20px"
}
},
"heading": {
"typography": {
+ "fontFamily": "var(--wp--preset--font-family--inter-tight)",
"fontWeight": "var(--wp--custom--font-weight--semi-bold)",
- "lineHeight": "1.15",
- "letterSpacing": "-0.03em"
+ "lineHeight": "1.4"
},
"color": {
- "text": "var(--wp--preset--color--heading)"
+ "text": "var(--wp--preset--color--neutral-800)"
}
},
"h1": {
"typography": {
- "fontSize": "var(--wp--preset--font-size--72)"
+ "fontSize": "var(--wp--preset--font-size--44)",
+ "lineHeight": "var(--wp--preset--font-size--52)"
}
},
"h2": {
"typography": {
- "fontSize": "var(--wp--preset--font-size--48)"
+ "fontSize": "var(--wp--preset--font-size--36)",
+ "lineHeight": "var(--wp--preset--font-size--44)"
}
},
"h3": {
"typography": {
- "fontSize": "var(--wp--preset--font-size--36)"
+ "fontSize": "var(--wp--preset--font-size--32)",
+ "lineHeight": "var(--wp--preset--font-size--40)"
}
},
"h4": {
"typography": {
- "fontSize": "var(--wp--preset--font-size--30)"
+ "fontSize": "var(--wp--preset--font-size--28)",
+ "lineHeight": "var(--wp--preset--font-size--36)"
}
},
"h5": {
"typography": {
- "fontSize": "var(--wp--preset--font-size--24)"
+ "fontSize": "var(--wp--preset--font-size--24)",
+ "lineHeight": "var(--wp--preset--font-size--32)"
}
},
"h6": {
"typography": {
- "fontSize": "var(--wp--preset--font-size--20)"
+ "fontSize": "var(--wp--preset--font-size--20)",
+ "lineHeight": "var(--wp--preset--font-size--28)"
}
},
"link": {
@@ -520,20 +853,28 @@
},
":hover": {
"color": {
- "text": "var(--wp--preset--color--primary)"
+ "text": "var(--wp--preset--color--primary-500)"
}
},
":focus": {
"color": {
- "text": "var(--wp--preset--color--primary)"
+ "text": "var(--wp--preset--color--primary-500)"
}
}
}
},
"blocks": {
"core/buttons": {
+ "border": {
+ "radius": "var(--wp--custom--border--radius)"
+ },
"spacing": {
- "blockGap": "var(--wp--preset--spacing--sm)"
+ "blockGap": "var(--wp--preset--spacing--xs)"
+ }
+ },
+ "core/button": {
+ "spacing": {
+ "blockGap": "var(--wp--preset--spacing--xxs)"
}
},
"core/code": {
@@ -542,7 +883,7 @@
"radius": "var(--wp--custom--border--radius)"
},
"color": {
- "background": "var(--wp--preset--color--surface)"
+ "background": "var(--wp--preset--color--neutral-100)"
},
"spacing": {
"padding": {
@@ -551,6 +892,11 @@
"bottom": "var(--wp--style--block-gap)",
"left": "var(--wp--style--block-gap)"
}
+ },
+ "typography": {
+ "fontFamily": "var(--wp--preset--font-family--jetbrains-mono)",
+ "fontSize": "var(--wp--preset--font-size--14)",
+ "fontWeight": "var(--wp--custom--font-weight--medium)"
}
},
"core/column": {
@@ -579,20 +925,6 @@
"core/image": {
"border": {
"radius": "var(--wp--custom--border--radius)"
- },
- "spacing": {
- "margin": {
- "top": "0",
- "right": "0",
- "bottom": "0",
- "left": "0"
- },
- "padding": {
- "top": "0",
- "right": "0",
- "bottom": "0",
- "left": "0"
- }
}
},
"core/list": {
@@ -601,8 +933,9 @@
}
},
"core/navigation": {
- "spacing": {
- "blockGap": "1em"
+ "typography": {
+ "fontWeight": "var(--wp--custom--font-weight--semi-bold)",
+ "fontSize": "14px"
}
},
"core/page-list": {
@@ -613,6 +946,9 @@
"core/post-author": {
"border": {
"radius": "999px"
+ },
+ "typography": {
+ "textTransform": "capitalize"
}
},
"core/post-date": {
@@ -657,11 +993,6 @@
"fontSize": "var(--wp--preset--font-size--16)"
}
},
- "core/post-title": {
- "color": {
- "text": "var(--wp--preset--color--heading)"
- }
- },
"core/preformatted": {
"border": {
"radius": "var(--wp--custom--border--radius)"
@@ -696,7 +1027,7 @@
"left": {
"style": "var(--wp--custom--border--style)",
"color": "var(--wp--custom--border--color)",
- "width": "var(--wp--custom--border--width)"
+ "width": "2px"
}
},
"spacing": {
@@ -715,22 +1046,26 @@
"right": "0",
"bottom": "0",
"left": "0"
- }
+ },
+ "blockGap": "var(--wp--preset--spacing--xxs)"
}
},
"core/separator": {
"border": {
"color": "currentColor !important"
+ },
+ "color": {
+ "text": "var(--wp--preset--color--neutral-200)"
}
},
"core/site-logo": {
"color": {
- "text": "var(--wp--preset--color--heading)"
+ "text": "var(--wp--preset--color--neutral-800)"
}
},
"core/site-title": {
"color": {
- "text": "var(--wp--preset--color--heading)"
+ "text": "var(--wp--preset--color--neutral-800)"
},
"spacing": {
"margin": {
@@ -766,7 +1101,7 @@
"radius": "var(--wp--custom--border--radius)"
},
"color": {
- "background": "var(--wp--preset--color--surface)"
+ "background": "var(--wp--preset--color--neutral-100)"
}
}
}
diff --git a/tsconfig.json b/tsconfig.json
index d0002da..00a8aac 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -6,6 +6,7 @@
"resolveJsonModule": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
+ "allowImportingTsExtensions": true,
"strict": true
},
"include": [
diff --git a/webpack.config.js b/webpack.config.js
index 9675c06..1962c14 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,19 +1,20 @@
-const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
+const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const BrowserSyncPlugin = require( 'browser-sync-webpack-plugin' );
-module.exports = env => {
+module.exports = ( env ) => {
return {
...defaultConfig,
module: {
- ...defaultConfig.module
+ ...defaultConfig.module,
},
entry: {
- editor: './src/editor.tsx',
- accordion: './src/public/accordion.tsx',
+ editor: './src/index.tsx',
animation: './src/public/animation.tsx',
counter: './src/public/counter.tsx',
+ details: './src/public/details.tsx',
+ packery: './src/public/packery.tsx',
scroll: './src/public/scroll.tsx',
},
@@ -23,9 +24,9 @@ module.exports = env => {
new BrowserSyncPlugin( {
host: 'localhost',
port: 8887,
- proxy: 'https://blockifywp.test/'
+ proxy: 'https://blockifywp.local/',
} ),
- ]
+ ],
};
};