efficient-storefront-blocks 0.18.1 → 0.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use client";import{_ as E,l as A}from"./chunk-P72SMQ7D.js";import{I as m,J as y,M as g,S as d,V as h}from"./chunk-BVXI5N6D.js";import"./chunk-XBW7A5SW.js";import"./chunk-UGTQGAHF.js";import"./chunk-HYLRHFHP.js";import"./chunk-TP6VLEFI.js";import"./chunk-Y6SLVHK3.js";import{jsx as G}from"react/jsx-runtime";import{Render as D}from"efficient-easel/render";function H(e){return Array.isArray(e)&&e.length>0&&e.every(r=>!!r&&typeof r=="object"&&typeof r.type=="string")}function u(e){let r=e.props;if(!r)return e;let n=r,a=!1;for(let[i,o]of Object.entries(r)){if(!H(o))continue;let t=o.map(u),s=e.type===g&&t.every(c=>c.type===m)?y(t):t;(s.length!==o.length||s.some((c,p)=>c!==o[p]))&&(n===r&&(n={...r}),n[i]=s,a=!0)}return a?{...e,props:n}:e}function P(e){let r=e;if(!r||typeof r!="object")return e;let n=!1,a={...e};if(Array.isArray(r.content)){let i=r.content.map(u);i.some((o,t)=>o!==r.content[t])&&(a.content=i,n=!0)}if(r.zones&&typeof r.zones=="object"){let i=!1,o=Object.fromEntries(Object.entries(r.zones).map(([t,s])=>{if(!Array.isArray(s))return[t,s];let c=s.map(u);return c.some((p,f)=>p!==s[f])&&(i=!0),[t,c]}));i&&(a.zones=o,n=!0)}return n?a:e}var j=["DocMasthead","AlloyWheelsListing"],x="titleLevel";function O(e){let r=e;if(!r?.content?.length)return e;let n=!1,a=!1,i=r.content.map(o=>j.includes(o?.type??"")?n?(a=!0,{...o,props:{...o.props??{},[x]:2}}):(n=!0,o):o);return a?{...r,content:i}:e}var z=["GalleryB"];function S(e){let r=e.content;if(!Array.isArray(r))return e;let n=!1,a=r.map(t=>{let s=t?.type;if(!s||!z.includes(s))return t;let c=h[s];if(!c?.legacy)return t;let p=t.props??{},f=p[c.slot];if(Array.isArray(f)&&f.length>0)return t;let l=c.legacy(p);if(!l.length)return t;n=!0;let b=String(p.id??s),L=l.map((T,R)=>({type:c.childType,props:{id:`${c.childType}-${b}-${R}`,...T}}));return{...t,props:{...p,[c.slot]:L}}}),i=new Set(d(a)),o=i.size?a.filter((t,s)=>!i.has(s)):a;return i.size&&(n=!0),n?{...e,content:o}:e}function _({config:e,data:r}){return G(D,{config:e,data:O(P(A(S(r))))})}import{jsx as C}from"react/jsx-runtime";function I({data:e}){return C(_,{config:E,data:e})}export{I as default};
1
+ "use client";import{_ as E,l as A}from"./chunk-MIXL2LLM.js";import{I as m,J as y,M as g,S as d,V as h}from"./chunk-BVXI5N6D.js";import"./chunk-XBW7A5SW.js";import"./chunk-UGTQGAHF.js";import"./chunk-HYLRHFHP.js";import"./chunk-TP6VLEFI.js";import"./chunk-Y6SLVHK3.js";import{jsx as G}from"react/jsx-runtime";import{Render as D}from"efficient-easel/render";function H(e){return Array.isArray(e)&&e.length>0&&e.every(r=>!!r&&typeof r=="object"&&typeof r.type=="string")}function u(e){let r=e.props;if(!r)return e;let n=r,a=!1;for(let[i,o]of Object.entries(r)){if(!H(o))continue;let t=o.map(u),s=e.type===g&&t.every(c=>c.type===m)?y(t):t;(s.length!==o.length||s.some((c,p)=>c!==o[p]))&&(n===r&&(n={...r}),n[i]=s,a=!0)}return a?{...e,props:n}:e}function P(e){let r=e;if(!r||typeof r!="object")return e;let n=!1,a={...e};if(Array.isArray(r.content)){let i=r.content.map(u);i.some((o,t)=>o!==r.content[t])&&(a.content=i,n=!0)}if(r.zones&&typeof r.zones=="object"){let i=!1,o=Object.fromEntries(Object.entries(r.zones).map(([t,s])=>{if(!Array.isArray(s))return[t,s];let c=s.map(u);return c.some((p,f)=>p!==s[f])&&(i=!0),[t,c]}));i&&(a.zones=o,n=!0)}return n?a:e}var j=["DocMasthead","AlloyWheelsListing"],x="titleLevel";function O(e){let r=e;if(!r?.content?.length)return e;let n=!1,a=!1,i=r.content.map(o=>j.includes(o?.type??"")?n?(a=!0,{...o,props:{...o.props??{},[x]:2}}):(n=!0,o):o);return a?{...r,content:i}:e}var z=["GalleryB"];function S(e){let r=e.content;if(!Array.isArray(r))return e;let n=!1,a=r.map(t=>{let s=t?.type;if(!s||!z.includes(s))return t;let c=h[s];if(!c?.legacy)return t;let p=t.props??{},f=p[c.slot];if(Array.isArray(f)&&f.length>0)return t;let l=c.legacy(p);if(!l.length)return t;n=!0;let b=String(p.id??s),L=l.map((T,R)=>({type:c.childType,props:{id:`${c.childType}-${b}-${R}`,...T}}));return{...t,props:{...p,[c.slot]:L}}}),i=new Set(d(a)),o=i.size?a.filter((t,s)=>!i.has(s)):a;return i.size&&(n=!0),n?{...e,content:o}:e}function _({config:e,data:r}){return G(D,{config:e,data:O(P(A(S(r))))})}import{jsx as C}from"react/jsx-runtime";function I({data:e}){return C(_,{config:E,data:e})}export{I as default};