PATH:
home
/
thebhoeo
/
public_html
/
wp-content
/
plugins
/
otter-blocks
/
build
/
atomic-wind
/
blocks
/
box
!function(){"use strict";var e=window.wp.blocks,t=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"atomic-wind/box","title":"Box","category":"atomic-wind","description":"A generic wrapper element with tag selection and inner blocks. Supports details and summary tags for native disclosure widgets.","keywords":["box","container","wrapper","div","section","details","summary"],"textdomain":"atomic-wind","attributes":{"tagName":{"type":"string","default":"div"}},"supports":{"align":["wide","full"],"anchor":true,"html":false,"color":false,"typography":false,"spacing":false},"editorScript":"file:./index.js"}'),a=window.wp.primitives,r=window.ReactJSXRuntime,n=(0,r.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,r.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3541 3.64593C18.5085 1.8004 13.2722 4.04455 8.65837 8.65837C4.04455 13.2722 1.8004 18.5085 3.64593 20.3541C5.49146 22.1996 10.7278 19.9555 15.3416 15.3416C19.9555 10.7278 22.1996 5.49146 20.3541 3.64593Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)(a.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M3.64593 3.64593C1.8004 5.49146 4.04455 10.7278 8.65837 15.3416C13.2722 19.9555 18.5085 22.1996 20.3541 20.3541C22.1996 18.5085 19.9555 13.2722 15.3416 8.65837C10.7278 4.04455 5.49146 1.8004 3.64593 3.64593Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)(a.Path,{d:"M12.009 12H12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),o=window.wp.blockEditor,s=window.wp.components,i=window.wp.i18n,l=window.wp.data,c=window.wp.element;const d=[{label:"div",value:"div"},{label:"span",value:"span"},{label:"section",value:"section"},{label:"article",value:"article"},{label:"main",value:"main"},{label:"aside",value:"aside"},{label:"header",value:"header"},{label:"footer",value:"footer"},{label:"nav",value:"nav"},{label:"details",value:"details"},{label:"summary",value:"summary"}];function u(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function p(t,a){const{name:r,attributes:n,innerBlocks:o}=t,s=n.className||"",i=n.postField||"";let l="";switch(o?.length&&(l=o.map((e=>p(e,a))).join("")),r){case"atomic-wind/box":{const e=n.tagName||"div";return`<${e} class="${s}">${l}</${e}>`}case"atomic-wind/text":{const e=n.tagName||"p";let t=n.content||"";if(i&&a)switch(i){case"title":t=a.title?.rendered||t;break;case"excerpt":{const e=document.createElement("div");e.innerHTML=a.excerpt?.rendered||"";const r=e.textContent;t=r?u(r):t;break}case"date":{const e=a.date?new Date(a.date).toLocaleDateString():"";t=e?u(e):t;break}case"author":{const e=a._embedded?.author?.[0]?.name||"";t=e?u(e):t;break}case"categories":{const e=a._embedded?.["wp:term"]?.[0];e&&(t=u(e.map((e=>e.name)).join(", ")));break}case"tags":{const e=a._embedded?.["wp:term"]?.[1];e&&(t=u(e.map((e=>e.name)).join(", ")));break}case"modified_date":{const e=a.modified?new Date(a.modified).toLocaleDateString():"";t=e?u(e):t;break}case"comment_count":var c;t=u(String(null!==(c=a.comment_count)&&void 0!==c?c:0))}return`<${e} class="${s}" data-rich-text="">${t}</${e}>`}case"atomic-wind/image":{let e=n.url||"",t=n.alt||"";if("featured_image"===i&&a){const r=a._embedded?.["wp:featuredmedia"]?.[0];if(!r)return"";e=r.source_url||e,t=r.alt_text||a.title?.rendered||t}return e?`<img class="${s}" src="${e}" alt="${u(t)}"/>`:""}case"atomic-wind/link":{const e=n.text||"";return`<a class="${s}">${l||e}</a>`}default:return(0,e.serialize)([t]).replace(/<!--\s+\/?wp:[\s\S]*?-->/g,"").replace(/ href="[^"]*"/g,"")}}const{name:m,...w}=t;(0,e.registerBlockType)(m,{...w,icon:n,edit:function({attributes:t,setAttributes:a,clientId:n}){const{tagName:u,queryPostType:m,queryCount:w,queryOrderBy:g,queryOrder:b}=t,k=u,v=(0,o.useBlockProps)(),{children:f,...h}=(0,o.useInnerBlocksProps)(v),x=(0,l.useSelect)((e=>m?e("core/block-editor").getBlocks(n):[]),[n,m]),y=(0,l.useSelect)((e=>m?e("core").getEntityRecords("postType",m,{per_page:w||3,orderby:g||"date",order:(b||"desc").toLowerCase(),_embed:!0}):null),[m,w,g,b]),j=(0,c.useMemo)((()=>{if(!x.length||!m)return[];if(null===y){const t=(w||3)-1;if(t<1)return[];const a=(0,e.serialize)(x).replace(/<!--\s+\/?wp:[\s\S]*?-->/g,"").replace(/ href="[^"]*"/g,"");return Array.from({length:t}).map((()=>a))}return y.slice(1).map((e=>x.map((t=>p(t,e))).join("")))}),[x,y,m,w]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.InspectorControls,{children:(0,r.jsx)(s.PanelBody,{title:(0,i.__)("Settings","otter-blocks"),children:(0,r.jsx)(s.SelectControl,{label:(0,i.__)("HTML Tag","otter-blocks"),value:u,options:d,onChange:e=>a({tagName:e})})})}),(0,r.jsxs)(k,{...h,children:[f,j.map(((e,t)=>(0,r.jsx)("div",{style:{pointerEvents:"none",opacity:.5},dangerouslySetInnerHTML:{__html:e}},t)))]})]})},save:function({attributes:e}){const{tagName:t}=e,a=t,n=o.useBlockProps.save(),s=o.useInnerBlocksProps.save(n);return(0,r.jsx)(a,{...s})},__experimentalLabel({tagName:e}){return e?`Box <${e}>`:"Box"}})}();
[-] block.json
[edit]
[-] index.js
[edit]
[+]
..
[-] index.asset.php
[edit]