You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
4.5 KiB

(()=>{"use strict";var e,i={487:(e,i,n)=>{const o=window.wp.blocks,t=window.wp.i18n,s=window.wp.blockEditor,l=window.wp.element,r=window.wp.apiFetch;var a=n.n(r);const c=window.wp.components,h=window.wp.primitives,w=window.ReactJSXRuntime,v=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),p=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),d=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),x=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),u=(0,w.jsx)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w.jsx)(h.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),g=JSON.parse('{"UU":"massivedynamic/wpsi-menu"}');(0,o.registerBlockType)(g.UU,{edit:({attributes:e,setAttributes:i})=>{const[n,o]=(0,l.useState)([]),{alignment:r,orientation:h,exclude:g,openInNewTab:m}=e,j=(0,l.useMemo)((()=>{const e=[];for(const[i,o]of Object.entries(n))e.push({key:i,value:o});return e}),[n]),b=(0,l.useMemo)((()=>j.filter((e=>!g.includes(e.key)))),[j,g]);return(0,l.useEffect)((()=>{a()({path:"/wp-social-icons/items"}).then((e=>{o(e)})).catch((e=>console.error("ERR",e)))}),[]),(0,w.jsxs)("section",{...(0,s.useBlockProps)(),children:[(0,w.jsxs)(s.InspectorControls,{children:[(0,w.jsx)(c.PanelBody,{title:(0,t.__)("Active Services","wpsocialicons"),initialOpen:!0,children:j.map((e=>(0,w.jsx)(c.PanelRow,{children:(0,w.jsx)(c.ToggleControl,{label:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{className:`wpsi-${e.key}`,style:{fontSize:"1.2rem",verticalAlign:"middle",marginRight:"0.5rem"}})," ",(0,w.jsx)("span",{style:{verticalAlign:"middle"},children:e.key})]}),checked:!g.includes(e.key),onChange:()=>{return n=e.key,void i({exclude:g.includes(n)?g.filter((e=>e!==n)):[...g,n]});var n}})})))}),(0,w.jsx)(c.PanelBody,{title:(0,t.__)("Link Behavior","wpsocialicons"),initialOpen:!0,children:(0,w.jsx)(c.PanelRow,{children:(0,w.jsx)(c.ToggleControl,{label:(0,t.__)("Open links in new tab","wpsocialicons"),checked:m,onChange:e=>i({openInNewTab:e})})})})]}),(0,w.jsxs)(s.BlockControls,{children:[(0,w.jsxs)(c.ToolbarGroup,{children:[(0,w.jsx)(c.ToolbarButton,{isActive:"horizontal"===h,icon:v,title:(0,t.__)("align horizontal","wpsocialicons"),onClick:()=>i({orientation:"horizontal"})}),(0,w.jsx)(c.ToolbarButton,{isActive:"vertical"===h,icon:p,title:(0,t.__)("align vertical","wpsocialicons"),onClick:()=>i({orientation:"vertical"})})]}),(0,w.jsxs)(c.ToolbarGroup,{children:[(0,w.jsx)(c.ToolbarButton,{isActive:"left"===r,icon:d,title:(0,t.__)("align left","wpsocialicons"),onClick:()=>i({alignment:"left"})}),(0,w.jsx)(c.ToolbarButton,{isActive:"center"===r,icon:x,title:(0,t.__)("align center","wpsocialicons"),onClick:()=>i({alignment:"center"})}),(0,w.jsx)(c.ToolbarButton,{isActive:"right"===r,icon:u,title:(0,t.__)("align right","wpsocialicons"),onClick:()=>i({alignment:"right"})})]})]}),b.length<1?(0,w.jsx)("section",{children:"No elements"}):(0,w.jsx)("nav",{className:`wpsi-menu ${h} align-${r}`,children:b.map((e=>(0,w.jsx)("a",{href:e.value,children:(0,w.jsx)("span",{className:`wpsi wpsi-${e.key}`})})))})]})}})}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return i[e](s,s.exports,o),s.exports}o.m=i,e=[],o.O=(i,n,t,s)=>{if(!n){var l=1/0;for(h=0;h<e.length;h++){for(var[n,t,s]=e[h],r=!0,a=0;a<n.length;a++)(!1&s||l>=s)&&Object.keys(o.O).every((e=>o.O[e](n[a])))?n.splice(a--,1):(r=!1,s<l&&(l=s));if(r){e.splice(h--,1);var c=t();void 0!==c&&(i=c)}}return i}s=s||0;for(var h=e.length;h>0&&e[h-1][2]>s;h--)e[h]=e[h-1];e[h]=[n,t,s]},o.n=e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return o.d(i,{a:i}),i},o.d=(e,i)=>{for(var n in i)o.o(i,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={57:0,350:0};o.O.j=i=>0===e[i];var i=(i,n)=>{var t,s,[l,r,a]=n,c=0;if(l.some((i=>0!==e[i]))){for(t in r)o.o(r,t)&&(o.m[t]=r[t]);if(a)var h=a(o)}for(i&&i(n);c<l.length;c++)s=l[c],o.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return o.O(h)},n=globalThis.webpackChunkwpsi_menu=globalThis.webpackChunkwpsi_menu||[];n.forEach(i.bind(null,0)),n.push=i.bind(null,n.push.bind(n))})();var t=o.O(void 0,[350],(()=>o(487)));t=o.O(t)})();