efficient-web-builder 48.0.0 → 48.1.1

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  3. package/dist/editor/components/SectionIcon.js +1 -1
  4. package/dist/editor/lib/document/blocks/general/Contents/fields.d.ts +2 -0
  5. package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -0
  6. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  7. package/dist/editor/lib/document/blocks/general/index.js +1 -1
  8. package/dist/editor/lib/document/canvas-typing.d.ts +1 -0
  9. package/dist/editor/lib/document/canvas-typing.js +1 -1
  10. package/dist/editor/lib/document/overrides.js +1 -1
  11. package/dist/editor/lib/document/page-root.js +2 -2
  12. package/dist/editor/lib/document/part-motion-canvas.d.ts +2 -3
  13. package/dist/editor/lib/document/part-motion-canvas.js +1 -2
  14. package/dist/format/lib/content/anchor-name.d.ts +2 -0
  15. package/dist/format/lib/content/anchor-name.js +1 -0
  16. package/dist/format/lib/content/box-link.js +1 -1
  17. package/dist/format/lib/content/list-number.d.ts +1 -0
  18. package/dist/format/lib/content/list-number.js +1 -0
  19. package/dist/format/lib/content/section-min-height.d.ts +3 -2
  20. package/dist/format/lib/content/section-min-height.js +1 -1
  21. package/dist/format/lib/content/section-sticky.js +1 -1
  22. package/dist/format/lib/content/sticky-aside.d.ts +2 -0
  23. package/dist/format/lib/content/sticky-aside.js +1 -0
  24. package/dist/format/lib/document/blocks/general/Contents/meta.d.ts +5 -0
  25. package/dist/format/lib/document/blocks/general/Contents/meta.js +1 -0
  26. package/dist/format/lib/document/blocks/general/metas.d.ts +1 -0
  27. package/dist/format/lib/document/blocks/general/metas.js +1 -1
  28. package/dist/format/lib/document/blocks/general/text-part-shapes.json +10 -0
  29. package/dist/format/lib/document/container-blocks.js +1 -1
  30. package/dist/format/lib/document/general-order.d.ts +1 -1
  31. package/dist/format/lib/document/general-order.js +1 -1
  32. package/dist/format/lib/document/section-catalog.js +1 -1
  33. package/dist/format/lib/links/page-link-rules.js +1 -1
  34. package/dist/format/lib/sections/contents-text-regions.d.ts +3 -0
  35. package/dist/format/lib/sections/contents-text-regions.js +1 -0
  36. package/dist/format/lib/sections/section-text-regions.js +1 -1
  37. package/dist/render/components/ContentsList.d.ts +14 -0
  38. package/dist/render/components/ContentsList.js +1 -0
  39. package/dist/render/components/DocBody.d.ts +18 -0
  40. package/dist/render/components/DocBody.js +5 -5
  41. package/dist/render/components/FAQ.js +1 -1
  42. package/dist/render/components/PageContentsContext.d.ts +14 -0
  43. package/dist/render/components/PageContentsContext.js +1 -0
  44. package/dist/render/components/PartStyledKind.js +1 -1
  45. package/dist/render/components/PartStyledText.js +1 -1
  46. package/dist/render/components/PublishedPartStylesContext.js +1 -1
  47. package/dist/render/components/Reel.js +1 -1
  48. package/dist/render/components/SectionAnimation.d.ts +3 -2
  49. package/dist/render/components/SectionAnimation.js +1 -1
  50. package/dist/render/components/Text.d.ts +2 -1
  51. package/dist/render/components/Text.js +1 -1
  52. package/dist/render/components/Timeline.js +1 -1
  53. package/dist/render/components/goldPhrases.d.ts +1 -1
  54. package/dist/render/components/goldPhrases.js +2 -2
  55. package/dist/render/lib/animation/entrance.d.ts +1 -0
  56. package/dist/render/lib/animation/entrance.js +1 -1
  57. package/dist/render/lib/animation/part-motion.d.ts +4 -0
  58. package/dist/render/lib/animation/part-motion.js +2 -1
  59. package/dist/render/lib/content/page-contents.d.ts +17 -0
  60. package/dist/render/lib/content/page-contents.js +1 -0
  61. package/dist/render/lib/document/blocks/general/Contents/render.d.ts +2 -0
  62. package/dist/render/lib/document/blocks/general/Contents/render.js +1 -0
  63. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  64. package/dist/render/lib/document/blocks/general/renders.d.ts +1 -0
  65. package/dist/render/lib/document/blocks/general/renders.js +1 -1
  66. package/dist/render/lib/document/blocks/general/section-to-box-rows-docbody.d.ts +2 -0
  67. package/dist/render/lib/document/blocks/general/section-to-box-rows-docbody.js +2 -0
  68. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  69. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  70. package/dist/render/lib/document/page-render.js +1 -1
  71. package/dist/render/lib/document/part-styles.js +2 -2
  72. package/dist/render/lib/document/passes/section-anchor.d.ts +1 -0
  73. package/dist/render/lib/document/passes/section-anchor.js +1 -1
  74. package/dist/render/lib/sections/section-to-box.d.ts +1 -0
  75. package/dist/render/lib/sections/section-to-box.js +1 -1
  76. package/package.json +1 -1
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Render as m}from"efficient-easel/render";import{capHeroGroups as i}from"../../../format/lib/document/cap-hero-groups.js";import{oneH1 as a}from"../../../format/lib/document/one-h1.js";import{migrateLegacyPageData as n}from"./migrate-legacy.js";import{migrateRenamedProps as f}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as p,SECTION_TO_BOX_ON as s}from"../sections/section-to-box.js";import{siteThemeOf as c}from"../../../format/lib/theme.js";import{registerGeneralSectionRows as g}from"./blocks/general/section-to-box-rows.js";function d({config:e,data:o,metadata:r}){return g(),t(m,{config:e,metadata:r,data:a(i(p(f(n(o)),s,{theme:c(r)})))})}export{d as default};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{Render as m}from"efficient-easel/render";import{capHeroGroups as i}from"../../../format/lib/document/cap-hero-groups.js";import{oneH1 as a}from"../../../format/lib/document/one-h1.js";import{withPageContents as n}from"../content/page-contents.js";import{migrateLegacyPageData as f}from"./migrate-legacy.js";import{migrateRenamedProps as p}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as s,SECTION_TO_BOX_ON as g}from"../sections/section-to-box.js";import{siteThemeOf as c}from"../../../format/lib/theme.js";import{registerGeneralSectionRows as d}from"./blocks/general/section-to-box-rows.js";function u({config:e,data:o,metadata:r}){return d(),t(m,{config:e,metadata:r,data:n(a(i(s(p(f(o)),g,{theme:c(r)}))))})}export{u as default};
@@ -1,2 +1,2 @@
1
- import{textStyleCaseCss as q,textStyleCaseOfCss as J}from"efficient-easel/draw";import{parseHexColor as Q}from"efficient-shell/format";import{FONT_OPTIONS as tt,fontOption as et,fontRoleOf as b,SIZE_STEP_OF_ROLE as M}from"../../../format/lib/fonts.js";import{encodePartKey as nt}from"../../../format/lib/document/part-key.js";import{decodePartId as F,normalizePartText as E}from"./text-parts.js";import{COLOUR_TOKEN as L}from"../../../format/lib/word-styles.js";import{PHONE_MEDIA as rt}from"../content/view-values.js";import{plainRecord as $,propsWithPartRecord as ot,readPartRecord as it,readPartRecords as st}from"../../../format/lib/document/part-records.js";const y="_partStyles",at="data-sf-part-styled",H="data-sf-text-style",ct=/^(heading|body)-[1-7]$/;function T(t){return typeof t=="string"&&ct.test(t)}const j={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function ft(t){if(!t)return null;for(const[e,n]of Object.entries(j))if(n===t)return e;return null}function ue(t){if(T(t.textStyle))return t.textStyle;const e=b(t.role);return e?j[e]:void 0}const lt=[400,500,600,700],_=["left","center","right","justify"],D=5,C=1e3,ut=-5,pt=10,dt=0,xt=64,ht=2,K={size:{min:D,max:C,step:1},sizePhone:{min:D,max:C,step:1},padding:{min:dt,max:xt,step:ht}},gt=.05,mt=.01,Pt=["line","letter"],St=.5,Tt=2.5,Rt=-1,bt=1,_t=0,At=400,Et=[...new Set(Object.values(M))];function $t(t){return[`${t} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${t}:hover, ${t}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function pe(t){return st(t,y)}function W(t,e){return it(t,y,e)}function de(t,e){return Object.values(W(t,e)).filter(n=>n!==void 0).length}function G(t,e,n){return ot(t,y,e,yt(n).length?n:null)}function yt(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function Nt(t){return Pt.includes(t)}const R=(t,e,n)=>Math.min(n,Math.max(e,t));function Ot(t,e){if(Nt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:R(n,ut,pt)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?P(R(n,St,Tt),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?P(R(n,Rt,bt),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:R(n,_t,At)}if(Object.hasOwn(K,t)){const{min:n,max:r}=K[t],o=Math.round(Number(e));return Number.isFinite(o)?R(o,n,r):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"||t==="fontRole"?b(e)?e:null:t==="sizeToken"?O(e)?e:null:t==="textStyle"?T(e)?e:null:t==="alignPhone"?_.includes(e)?e:null:e}const wt=["weight","size","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function N(t){let e=null;const n=r=>{e??={...t},delete e[r]};for(const r of wt){const o=t[r];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(r)}return t.align!==void 0&&!_.includes(t.align)&&n("align"),t.alignPhone!==void 0&&!_.includes(t.alignPhone)&&n("alignPhone"),t.textStyle!==void 0&&!T(t.textStyle)&&n("textStyle"),t.sizeToken!==void 0&&!O(t.sizeToken)&&n("sizeToken"),t.fontRole!==void 0&&!b(t.fontRole)&&n("fontRole"),e??t}function O(t){if(!t||typeof t!="object")return!1;const{step:e,px:n,stepPhone:r,pxPhone:o,fluid:i}=t,s=f=>typeof f=="number"&&Number.isFinite(f)&&f>0,c=f=>typeof f=="string"&&Et.includes(f);return c(e)&&s(n)&&(r===void 0||c(r))&&(o===void 0||s(o))&&(i===void 0||zt(i,n))}function zt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return!1;const{minPx:n,vw:r,...o}=t;return Object.keys(o).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<e&&typeof r=="number"&&Number.isFinite(r)&&r>0&&r<=100}function X(t){return t?.pxPhone&&O(t)?{step:t.stepPhone??t.step,px:t.pxPhone}:null}function U({step:t,px:e,fluid:n}){const r=n?`clamp(${n.minPx}px, ${n.vw}vw, ${e}px)`:`${e}px`,o=`var(--size-${t}, ${r})`;return t.startsWith("heading")?`min(${o}, var(--sf-heading-max,9999px))`:o}const It=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function kt(t){const e=[];for(const[n,r]of It)n===t?e.push(r):r===t&&e.push(n);return e}function xe(t,e,n,r){const o={...W(t,e)},i=r==null?null:Ot(n,r);if(i===null)delete o[n];else{o[n]=i;for(const s of kt(n))delete o[s]}return G(t,e,o)}function he(t,e){return G(t,e,{})}function Mt(t){return J(t)??"none"}function Ft(t){return q(t)??""}const v={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function Lt(t,e){const n=b(t.role);return n||(e?.blockDrawsStyle?null:ft(t.textStyle))}function ge(t,e){return t==="Text"&&e==="text"}const Ht={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function jt(t){const e=M[t],n=Ht[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function Dt(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=P(Ct+t.line*gt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=P(t.letter*mt,4)),e}const Ct=1,m="--sf-part-para";function Kt(t){t=N(t);const e={};if(typeof t.sizePhone=="number"&&t.sizePhone>0)e.fontSize=`${t.sizePhone}px`;else{const n=X(t.sizeToken);n&&(e.fontSize=U(n))}return t.alignPhone&&(e.textAlign=t.alignPhone),e}function Wt(t,e){if(!e)return t;const n=N(t);let r=t;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone};else{const o=X(n.sizeToken);o&&(r={...r,size:void 0,sizeToken:o})}return n.alignPhone&&(r={...r,align:n.alignPhone}),r}function w(t,e,n){t=N(t);const r=Lt(t,n),o=Dt(t),i=t.size?`${t.size}px`:t.sizeToken?U(t.sizeToken):r?jt(r):"";return{fontFamily:t.font?vt(t.font):t.fontRole?`var(${v[t.fontRole]})`:r?`var(${v[r]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[m]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:Ft(t.case),textAlign:t.align??"",paddingTop:V(t.padding),paddingBottom:V(t.padding),color:Gt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const Gt=t=>t===void 0||t===""?"":Object.hasOwn(L,t)?L[t]:Q(t)===t.toLowerCase()?t:"",V=t=>t===void 0?"":`${t}px`,P=(t,e)=>Number(t.toFixed(e));function me(t,e){const n=Number.parseFloat(t.fontSize)||16,r=Number.parseFloat(t.lineHeight),o=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop);return{fontKey:e,sizePx:n,weight:Xt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(r)?P(r/n,3):1.2,letterEm:Number.isFinite(o)?P(o/n,4):0,align:Ut(t.textAlign),case:Mt(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0}}function Xt(t){return Number.isFinite(t)?lt.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function Ut(t){for(const e of _)if(e===t)return e;return t==="end"?"right":"left"}function Pe(t,e){const n=Y(t);if(!n)return"";for(const r of tt)if(Y(e(r.cssVar))===n)return r.key;return""}const Y=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function vt(t){const e=et(t);return e?`var(${e.cssVar})`:""}function Se(t,e,n,r){return!e||F(e)?.nodeId!==t?null:n.find(i=>r(i.getAttribute("class")))??n[0]??null}function Te(t,e,n=()=>A,r=c=>c,o=Bt,i=!1,s=()=>!1){let c=0;for(const{element:f,partId:u}of t){const l=F(u)?.propKey;if(!l)continue;const p=r(l),d=Object.hasOwn(e,p)?$(e[p])??{}:{},a=w(Wt(d,i),A,{blockDrawsStyle:s(l)});T(d.textStyle)?f.setAttribute?.(H,d.textStyle):f.removeAttribute?.(H);const h=I.some(x=>f.style[x]);let g=!1;for(const[x,S]of Object.entries(a))Zt(f,x,S),S&&(g=!0);if(h||I.some(x=>a[x]))for(const x of Vt(f,o))for(const S of I)x.style[S]=a[S]??"";g&&(c+=1)}return c}function Vt(t,e){const n=E(t.textContent??""),r=[];let o=t;for(let i=0;i<Yt&&e(o);i+=1){const s=o.parentElement;if(!s||E(s.textContent??"")!==n)break;r.push(s),o=s}return r}const Yt=8;function Bt(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const A={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function Zt(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const r=t.style;typeof r.setProperty=="function"?n?r.setProperty(e,n):r.removeProperty?.(e):r[e]=n;const o=t;e===m&&(n?o.setAttribute?.(B,""):o.removeAttribute?.(B))}const B="data-sf-part-para",qt=Object.keys(w({},A)),z=new Set(["color","overflowWrap",m,"fontStyle"]),I=qt.filter(t=>!z.has(t));function Re(t,e,n,r=c=>c,o=()=>!1,i=()=>null,s=[]){const c=new Map;for(const l of t){const p=nt(l.key,l.row);for(const d of l.texts){const a=c.get(d);a?(a.keys.add(l.key),a.partKeys.add(p)):c.set(d,{keys:new Set([l.key]),partKeys:new Set([p])})}}const f=new Map;for(const l of new Set([...Object.keys(e),...s])){if(!Jt(l))continue;const p=Z(n,l,$(e[l])??{},!1,i(l));p&&f.set(l,p)}const u=new Map;for(const[l,{keys:p,partKeys:d}]of c){const a=d.size===1?[...d][0]:p.size===1?[...p][0]:null;if(!a)continue;const h=r(a),g=i(h);if(!Object.hasOwn(e,h)&&!g)continue;const k=$(e[h])??{},x=Z(n,a,k,o(a),g);x&&u.set(l,x)}return u.size||f.size?{rules:u,kindRules:f,drawn:new Set(c.keys())}:null}function Z(t,e,n,r,o){const i=w(n,A,{blockDrawsStyle:r}),s=Kt(n),c=T(n.textStyle)?n.textStyle:void 0;return!Object.values(i).some(Boolean)&&!Object.keys(s).length&&!c&&!o?null:{stamp:Qt(t,e),declarations:i,...Object.keys(s).length?{phone:s}:{},...c?{textStyle:c}:{},...o?{motion:o}:{}}}function Jt(t){return t.startsWith("@")}function be(t,e){return t?.kindRules.get(e)??null}function Qt(t,e){const n=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function _e(t){const e=[],n=new Set,r=o=>{const{stamp:i,declarations:s}=o;if(n.has(i))return;n.add(i);const c=Object.entries(s).filter(([,a])=>a!==""),f=a=>a.map(([h,g])=>`${ee(h)}: ${g}`).join("; "),u=`[${at}="${i}"]`,l=c.filter(([a])=>!z.has(a)),p=c.filter(([a])=>z.has(a));l.length&&e.push(`${u}, *:has(> ${u}) { ${f(l)} }`),p.length&&e.push(`${u} { ${f(p)} }`),s[m]&&(e.push(`*:has(> ${u}) { ${m}: ${s[m]} }`),e.push(...te(u,`*:has(> ${u})`)));const d=Object.entries(o.phone??{}).filter(([,a])=>a!=="");d.length&&e.push(`@media ${rt} { ${u}, *:has(> ${u}) { ${f(d)} } }`),o.motion?.hover==="lift"&&e.push(...$t(`*:has(> ${u})`))};for(const o of t.rules.values())r(o);for(const o of t.kindRules.values())r(o);return e.join(`
2
- `)}function te(t,e){const n=`var(${m})`,r=":is([data-sf-bullet], [data-sf-number])";return[`${t} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${t} ${r}:not(:first-child) { margin-top: ${n} }`,`${t} ${r}:not(:last-child) { margin-bottom: ${n} }`,`:is(${e}) + :is(${e}) { margin-top: ${n} }`]}const ee=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);function Ae(t,e){if(!t)return null;const n=E(e),r=t.rules.get(n);if(r)return r;if(n.length<ne||t.drawn.has(n))return null;let o=null;for(const[i,s]of t.rules)if(i.includes(n)){if(o&&o.stamp!==s.stamp)return null;o=s}return o}const ne=8;export{_ as PART_ALIGNS,bt as PART_LETTER_EM_MAX,Rt as PART_LETTER_EM_MIN,mt as PART_LETTER_STEP,Tt as PART_LINE_HEIGHT_MAX,St as PART_LINE_HEIGHT_MIN,gt as PART_LINE_STEP,K as PART_MEASURED_TRACKS,pt as PART_NUDGE_MAX,ut as PART_NUDGE_MIN,xt as PART_PADDING_MAX,dt as PART_PADDING_MIN,ht as PART_PADDING_STEP,B as PART_PARAGRAPH_ATTR,At as PART_PARAGRAPH_MAX,_t as PART_PARAGRAPH_MIN,m as PART_PARAGRAPH_VAR,Pt as PART_RELATIVE_PROPS,C as PART_SIZE_MAX,D as PART_SIZE_MIN,Et as PART_SIZE_STEPS,at as PART_STYLED_ATTR,y as PART_STYLES_PROP,qt as PART_STYLE_PROPERTIES,lt as PART_WEIGHTS,I as SHARED_PART_PROPERTIES,j as STYLE_ID_OF_ROLE,H as TEXT_STYLE_ATTR,Te as applyPartStyles,ge as blockDrawsTextStyle,ue as followedStyleOf,Jt as isPartKindKey,T as isTextStyleId,te as paragraphRules,Mt as partCaseOfTransform,Ft as partCaseTransform,Pe as partFontKeyOf,$t as partLiftRules,Kt as partPhoneDeclarations,be as partRuleForKind,Ae as partRuleForText,Dt as partSpacingOf,me as partStyleBase,de as partStyleCount,_e as partStyleCss,w as partStyleDeclarations,Wt as partStyleForScreen,Se as partStyleSource,xe as propsWithPartStyleValue,he as propsWithoutPartStyle,Re as publishedPartStyles,W as readPartStyle,pe as readPartStyles};
1
+ import{textStyleCaseCss as q,textStyleCaseOfCss as J}from"efficient-easel/draw";import{parseHexColor as Q}from"efficient-shell/format";import{FONT_OPTIONS as tt,fontOption as et,fontRoleOf as b,SIZE_STEP_OF_ROLE as M}from"../../../format/lib/fonts.js";import{encodePartKey as nt}from"../../../format/lib/document/part-key.js";import{decodePartId as F,normalizePartText as E}from"./text-parts.js";import{COLOUR_TOKEN as L}from"../../../format/lib/word-styles.js";import{PHONE_MEDIA as rt}from"../content/view-values.js";import{plainRecord as $,propsWithPartRecord as ot,readPartRecord as it,readPartRecords as st}from"../../../format/lib/document/part-records.js";const y="_partStyles",at="data-sf-part-styled",H="data-sf-text-style",ct=/^(heading|body)-[1-7]$/;function T(t){return typeof t=="string"&&ct.test(t)}const j={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function ft(t){if(!t)return null;for(const[e,n]of Object.entries(j))if(n===t)return e;return null}function le(t){if(T(t.textStyle))return t.textStyle;const e=b(t.role);return e?j[e]:void 0}const lt=[400,500,600,700],_=["left","center","right","justify"],D=5,C=1e3,ut=-5,pt=10,dt=0,xt=64,ht=2,K={size:{min:D,max:C,step:1},sizePhone:{min:D,max:C,step:1},padding:{min:dt,max:xt,step:ht}},gt=.05,Pt=.01,mt=["line","letter"],St=.5,Tt=2.5,Rt=-1,bt=1,_t=0,At=400,Et=[...new Set(Object.values(M))];function ue(t){return[`${t} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${t}:hover, ${t}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function pe(t){return st(t,y)}function W(t,e){return it(t,y,e)}function de(t,e){return Object.values(W(t,e)).filter(n=>n!==void 0).length}function G(t,e,n){return ot(t,y,e,$t(n).length?n:null)}function $t(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function yt(t){return mt.includes(t)}const R=(t,e,n)=>Math.min(n,Math.max(e,t));function Nt(t,e){if(yt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:R(n,ut,pt)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?m(R(n,St,Tt),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?m(R(n,Rt,bt),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:R(n,_t,At)}if(Object.hasOwn(K,t)){const{min:n,max:r}=K[t],o=Math.round(Number(e));return Number.isFinite(o)?R(o,n,r):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"||t==="fontRole"?b(e)?e:null:t==="sizeToken"?O(e)?e:null:t==="textStyle"?T(e)?e:null:t==="alignPhone"?_.includes(e)?e:null:e}const Ot=["weight","size","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function N(t){let e=null;const n=r=>{e??={...t},delete e[r]};for(const r of Ot){const o=t[r];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(r)}return t.align!==void 0&&!_.includes(t.align)&&n("align"),t.alignPhone!==void 0&&!_.includes(t.alignPhone)&&n("alignPhone"),t.textStyle!==void 0&&!T(t.textStyle)&&n("textStyle"),t.sizeToken!==void 0&&!O(t.sizeToken)&&n("sizeToken"),t.fontRole!==void 0&&!b(t.fontRole)&&n("fontRole"),e??t}function O(t){if(!t||typeof t!="object")return!1;const{step:e,px:n,stepPhone:r,pxPhone:o,fluid:i}=t,s=f=>typeof f=="number"&&Number.isFinite(f)&&f>0,c=f=>typeof f=="string"&&Et.includes(f);return c(e)&&s(n)&&(r===void 0||c(r))&&(o===void 0||s(o))&&(i===void 0||wt(i,n))}function wt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return!1;const{minPx:n,vw:r,...o}=t;return Object.keys(o).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<e&&typeof r=="number"&&Number.isFinite(r)&&r>0&&r<=100}function X(t){return t?.pxPhone&&O(t)?{step:t.stepPhone??t.step,px:t.pxPhone}:null}function U({step:t,px:e,fluid:n}){const r=n?`clamp(${n.minPx}px, ${n.vw}vw, ${e}px)`:`${e}px`,o=`var(--size-${t}, ${r})`;return t.startsWith("heading")?`min(${o}, var(--sf-heading-max,9999px))`:o}const zt=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function It(t){const e=[];for(const[n,r]of zt)n===t?e.push(r):r===t&&e.push(n);return e}function xe(t,e,n,r){const o={...W(t,e)},i=r==null?null:Nt(n,r);if(i===null)delete o[n];else{o[n]=i;for(const s of It(n))delete o[s]}return G(t,e,o)}function he(t,e){return G(t,e,{})}function kt(t){return J(t)??"none"}function Mt(t){return q(t)??""}const V={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function Ft(t,e){const n=b(t.role);return n||(e?.blockDrawsStyle?null:ft(t.textStyle))}function ge(t,e){return t==="Text"&&e==="text"}const Lt={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Ht(t){const e=M[t],n=Lt[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function jt(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=m(Dt+t.line*gt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=m(t.letter*Pt,4)),e}const Dt=1,P="--sf-part-para";function Ct(t){t=N(t);const e={};if(typeof t.sizePhone=="number"&&t.sizePhone>0)e.fontSize=`${t.sizePhone}px`;else{const n=X(t.sizeToken);n&&(e.fontSize=U(n))}return t.alignPhone&&(e.textAlign=t.alignPhone),e}function Kt(t,e){if(!e)return t;const n=N(t);let r=t;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone};else{const o=X(n.sizeToken);o&&(r={...r,size:void 0,sizeToken:o})}return n.alignPhone&&(r={...r,align:n.alignPhone}),r}function w(t,e,n){t=N(t);const r=Ft(t,n),o=jt(t),i=t.size?`${t.size}px`:t.sizeToken?U(t.sizeToken):r?Ht(r):"";return{fontFamily:t.font?Ut(t.font):t.fontRole?`var(${V[t.fontRole]})`:r?`var(${V[r]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[P]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:Mt(t.case),textAlign:t.align??"",paddingTop:Y(t.padding),paddingBottom:Y(t.padding),color:Wt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const Wt=t=>t===void 0||t===""?"":Object.hasOwn(L,t)?L[t]:Q(t)===t.toLowerCase()?t:"",Y=t=>t===void 0?"":`${t}px`,m=(t,e)=>Number(t.toFixed(e));function Pe(t,e){const n=Number.parseFloat(t.fontSize)||16,r=Number.parseFloat(t.lineHeight),o=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop);return{fontKey:e,sizePx:n,weight:Gt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(r)?m(r/n,3):1.2,letterEm:Number.isFinite(o)?m(o/n,4):0,align:Xt(t.textAlign),case:kt(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0}}function Gt(t){return Number.isFinite(t)?lt.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function Xt(t){for(const e of _)if(e===t)return e;return t==="end"?"right":"left"}function me(t,e){const n=v(t);if(!n)return"";for(const r of tt)if(v(e(r.cssVar))===n)return r.key;return""}const v=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function Ut(t){const e=et(t);return e?`var(${e.cssVar})`:""}function Se(t,e,n,r){return!e||F(e)?.nodeId!==t?null:n.find(i=>r(i.getAttribute("class")))??n[0]??null}function Te(t,e,n=()=>A,r=c=>c,o=vt,i=!1,s=()=>!1){let c=0;for(const{element:f,partId:u}of t){const l=F(u)?.propKey;if(!l)continue;const p=r(l),d=Object.hasOwn(e,p)?$(e[p])??{}:{},a=w(Kt(d,i),A,{blockDrawsStyle:s(l)});T(d.textStyle)?f.setAttribute?.(H,d.textStyle):f.removeAttribute?.(H);const h=I.some(x=>f.style[x]);let g=!1;for(const[x,S]of Object.entries(a))Bt(f,x,S),S&&(g=!0);if(h||I.some(x=>a[x]))for(const x of Vt(f,o))for(const S of I)x.style[S]=a[S]??"";g&&(c+=1)}return c}function Vt(t,e){const n=E(t.textContent??""),r=[];let o=t;for(let i=0;i<Yt&&e(o);i+=1){const s=o.parentElement;if(!s||E(s.textContent??"")!==n)break;r.push(s),o=s}return r}const Yt=8;function vt(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const A={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function Bt(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const r=t.style;typeof r.setProperty=="function"?n?r.setProperty(e,n):r.removeProperty?.(e):r[e]=n;const o=t;e===P&&(n?o.setAttribute?.(B,""):o.removeAttribute?.(B))}const B="data-sf-part-para",Zt=Object.keys(w({},A)),z=new Set(["color","overflowWrap",P,"fontStyle"]),I=Zt.filter(t=>!z.has(t));function Re(t,e,n,r=c=>c,o=()=>!1,i=()=>null,s=[]){const c=new Map;for(const l of t){const p=nt(l.key,l.row);for(const d of l.texts){const a=c.get(d);a?(a.keys.add(l.key),a.partKeys.add(p)):c.set(d,{keys:new Set([l.key]),partKeys:new Set([p])})}}const f=new Map;for(const l of new Set([...Object.keys(e),...s])){if(!qt(l))continue;const p=Z(n,l,$(e[l])??{},!1,i(l));p&&f.set(l,p)}const u=new Map;for(const[l,{keys:p,partKeys:d}]of c){const a=d.size===1?[...d][0]:p.size===1?[...p][0]:null;if(!a)continue;const h=r(a),g=i(h);if(!Object.hasOwn(e,h)&&!g)continue;const k=$(e[h])??{},x=Z(n,a,k,o(a),g);x&&u.set(l,x)}return u.size||f.size?{rules:u,kindRules:f,drawn:new Set(c.keys())}:null}function Z(t,e,n,r,o){const i=w(n,A,{blockDrawsStyle:r}),s=Ct(n),c=T(n.textStyle)?n.textStyle:void 0;return!Object.values(i).some(Boolean)&&!Object.keys(s).length&&!c&&!o?null:{stamp:Jt(t,e),declarations:i,...Object.keys(s).length?{phone:s}:{},...c?{textStyle:c}:{},...o?{motion:o}:{}}}function qt(t){return t.startsWith("@")}function be(t,e){return t?.kindRules.get(e)??null}function Jt(t,e){const n=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function _e(t){const e=[],n=new Set,r=o=>{const{stamp:i,declarations:s}=o;if(n.has(i))return;n.add(i);const c=Object.entries(s).filter(([,a])=>a!==""),f=a=>a.map(([h,g])=>`${te(h)}: ${g}`).join("; "),u=`[${at}="${i}"]`,l=c.filter(([a])=>!z.has(a)),p=c.filter(([a])=>z.has(a));l.length&&e.push(`${u}, *:has(> ${u}) { ${f(l)} }`),p.length&&e.push(`${u} { ${f(p)} }`),s[P]&&(e.push(`*:has(> ${u}) { ${P}: ${s[P]} }`),e.push(...Qt(u,`*:has(> ${u})`)));const d=Object.entries(o.phone??{}).filter(([,a])=>a!=="");d.length&&e.push(`@media ${rt} { ${u}, *:has(> ${u}) { ${f(d)} } }`)};for(const o of t.rules.values())r(o);for(const o of t.kindRules.values())r(o);return e.join(`
2
+ `)}function Qt(t,e){const n=`var(${P})`,r=":is([data-sf-bullet], [data-sf-number])";return[`${t} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${t} ${r}:not(:first-child) { margin-top: ${n} }`,`${t} ${r}:not(:last-child) { margin-bottom: ${n} }`,`:is(${e}) + :is(${e}) { margin-top: ${n} }`]}const te=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);function Ae(t,e){if(!t)return null;const n=E(e),r=t.rules.get(n);if(r)return r;if(n.length<ee||t.drawn.has(n))return null;let o=null;for(const[i,s]of t.rules)if(i.includes(n)){if(o&&o.stamp!==s.stamp)return null;o=s}return o}const ee=8;export{_ as PART_ALIGNS,bt as PART_LETTER_EM_MAX,Rt as PART_LETTER_EM_MIN,Pt as PART_LETTER_STEP,Tt as PART_LINE_HEIGHT_MAX,St as PART_LINE_HEIGHT_MIN,gt as PART_LINE_STEP,K as PART_MEASURED_TRACKS,pt as PART_NUDGE_MAX,ut as PART_NUDGE_MIN,xt as PART_PADDING_MAX,dt as PART_PADDING_MIN,ht as PART_PADDING_STEP,B as PART_PARAGRAPH_ATTR,At as PART_PARAGRAPH_MAX,_t as PART_PARAGRAPH_MIN,P as PART_PARAGRAPH_VAR,mt as PART_RELATIVE_PROPS,C as PART_SIZE_MAX,D as PART_SIZE_MIN,Et as PART_SIZE_STEPS,at as PART_STYLED_ATTR,y as PART_STYLES_PROP,Zt as PART_STYLE_PROPERTIES,lt as PART_WEIGHTS,I as SHARED_PART_PROPERTIES,j as STYLE_ID_OF_ROLE,H as TEXT_STYLE_ATTR,Te as applyPartStyles,ge as blockDrawsTextStyle,le as followedStyleOf,qt as isPartKindKey,T as isTextStyleId,Qt as paragraphRules,kt as partCaseOfTransform,Mt as partCaseTransform,me as partFontKeyOf,ue as partLiftRules,Ct as partPhoneDeclarations,be as partRuleForKind,Ae as partRuleForText,jt as partSpacingOf,Pe as partStyleBase,de as partStyleCount,_e as partStyleCss,w as partStyleDeclarations,Kt as partStyleForScreen,Se as partStyleSource,xe as propsWithPartStyleValue,he as propsWithoutPartStyle,Re as publishedPartStyles,W as readPartStyle,pe as readPartStyles};
@@ -1,3 +1,4 @@
1
1
  import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
2
2
  export declare const SECTION_ANCHOR_IN_BOX_CLASS = "!grow-0 !shrink-0 !basis-0";
3
+ export declare const ANCHOR_GAP_BACK_CLASS: string;
3
4
  export declare const sectionAnchor: BlockPass;
@@ -1 +1 @@
1
- import{jsx as o,jsxs as t,Fragment as a}from"react/jsx-runtime";import{slugify as i}from"efficient-shell/format";import{useBoxCell as f,useFillsCell as u,useInBox as d}from"../../../components/InBoxContext.js";const h="!grow-0 !shrink-0 !basis-0",x="flex flex-col w-full min-w-0 [&>*]:grow";function c({anchor:n}){const s=i(typeof n=="string"?n:""),e=d();return s?o("span",{id:s,className:e?`sf-section-anchor ${h}`:"sf-section-anchor","aria-hidden":"true"}):null}function A({anchor:n,children:s}){const e=f()?.columnsRow===!0,r=u(),l=i(typeof n=="string"?n:"")!=="";return e&&!r&&l?t("div",{className:x,children:[o(c,{anchor:n}),s]}):t(a,{children:[o(c,{anchor:n}),s]})}const g={name:"sectionAnchor",applies:(n,s,e)=>s.isSection(n)&&!!e&&typeof e.render=="function",panel(n,s,e){const r=e.anchorFields;n.fields={...n.fields,...r()}},draw(n){n.defaultProps={...n.defaultProps,anchor:""};const s=n.render;n.render=e=>o(A,{anchor:e.anchor,children:s(e)})}};export{h as SECTION_ANCHOR_IN_BOX_CLASS,g as sectionAnchor};
1
+ import{jsx as s,jsxs as o,Fragment as p}from"react/jsx-runtime";import{anchorSlug as l}from"../../../../format/lib/content/anchor-name.js";import{useBoxCell as c,useFillsCell as f,useInBox as d}from"../../../components/InBoxContext.js";const h="!grow-0 !shrink-0 !basis-0",m=["[.sf-gap-zone>&]:w-0","[.sf-gap-zone>&]:h-0","[.sf-gap-zone>&]:-mb-[var(--sf-gap-len)]","[.sf-gap-zone>&]:-mr-[var(--sf-gap-len)]","[@media(min-width:800.02px)_and_(max-width:1099.98px)]:[.sf-gap-zone>&]:-mb-[var(--sf-gap-len-tablet,var(--sf-gap-len))]","[@media(min-width:800.02px)_and_(max-width:1099.98px)]:[.sf-gap-zone>&]:-mr-[var(--sf-gap-len-tablet,var(--sf-gap-len))]","[@media(min-width:720px)_and_(max-width:800px)]:[.sf-gap-zone>&]:-mb-[var(--sf-gap-len-tablet,var(--sf-gap-len-phone,calc(var(--sf-gap-len)/2)))]","[@media(min-width:720px)_and_(max-width:800px)]:[.sf-gap-zone>&]:-mr-[var(--sf-gap-len-tablet,var(--sf-gap-len-phone,calc(var(--sf-gap-len)/2)))]","[@media(max-width:719.98px)]:[.sf-gap-zone>&]:-mb-[var(--sf-gap-len-phone,calc(var(--sf-gap-len)/2))]","[@media(max-width:719.98px)]:[.sf-gap-zone>&]:-mr-[var(--sf-gap-len-phone,calc(var(--sf-gap-len)/2))]"].join(" "),g="flex flex-col w-full min-w-0 [&>*]:grow";function i({anchor:n}){const e=l(n),a=d();return e?s("span",{id:e,className:a?`sf-section-anchor ${h} ${m}`:"sf-section-anchor","aria-hidden":"true"}):null}function x({anchor:n,children:e}){const a=c()?.columnsRow===!0,r=f(),t=l(n)!=="";return a&&!r&&t?o("div",{className:g,children:[s(i,{anchor:n}),e]}):o(p,{children:[s(i,{anchor:n}),e]})}const v={name:"sectionAnchor",applies:(n,e,a)=>e.isSection(n)&&!!a&&typeof a.render=="function",panel(n,e,a){const r=a.anchorFields;n.fields={...n.fields,...r()}},draw(n){n.defaultProps={...n.defaultProps,anchor:""};const e=n.render;n.render=a=>s(x,{anchor:a.anchor,children:e(a)})}};export{m as ANCHOR_GAP_BACK_CLASS,h as SECTION_ANCHOR_IN_BOX_CLASS,v as sectionAnchor};
@@ -83,6 +83,7 @@ export type ListPart = {
83
83
  flat?: boolean;
84
84
  props?: OwnProps;
85
85
  item?: (item: Props, index: number, node: Props) => ListItemLook;
86
+ of?: (src: Props) => Props[];
86
87
  perRow?: (node: Props) => number;
87
88
  rowName?: string;
88
89
  rowProps?: OwnProps;
@@ -1 +1 @@
1
- import{readHidable as Z}from"efficient-easel/draw";import{BOX_TYPE as ee,CONTAINER_BLOCKS_SLOT as te}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as oe,labelTextSeed as ne}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as se}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as R}from"../../../format/lib/finite-number.js";import{bucketByGroup as re}from"../../../format/lib/locations-grid.js";import{normalizeTheme as V}from"../../../format/lib/theme.js";const _=ee,P=te;function ge(t){if(t.theme)return V(t.theme);const o=t.site?.themePresets;return o?V({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ie(t,o){return o===0?`${t}~box`:`${t}~box-${o+1}`}const A={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function xe(t){for(const[o,r]of Object.entries(t)){if(o in A&&A[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=r}}function we(t){return A[t]}const Y=new Set(["id"]),j={},H=[];function $e(t){for(const[o,r]of Object.entries(t)){if(o in j&&j[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);j[o]=r}}function Oe(t){return j[t]}function Se(){return Object.keys(j)}function Be(t){return t in j&&H.includes(t)}function Te(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const r=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&r.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&r.push({kind:"button",key:"linkText",href:"linkHref"}),r}const F=t=>Z(t),_e=t=>F(t).text.trim()!=="";function ae(t){if(t.includes("=="))return t;const o=t.indexOf("/"),r=o===-1?t:t.slice(0,o),i=r.trim();if(!i)return t;const h=r.indexOf(i);return`${r.slice(0,h)}==${i}==${r.slice(h+i.length)}${o===-1?"":t.slice(o)}`}const ce=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function fe(t,o,r,i){const c={...t._partStyles?.text??{},...o??{},...r??{}};return(i==="center"||i==="right")&&c.align===void 0&&(c.align=i),Object.keys(c).length?{_partStyles:{text:c}}:{}}function le(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const r=o[t.key];return{variant:typeof r=="string"&&Object.hasOwn(t.map,r)?t.map[r]:t.fallback}}function D(t,o,r,i,h={}){const c={...o};for(const y of t){const[g,S,v]=typeof y=="string"?[y,y,void 0]:y;if(r[g]===void 0)continue;const B=v?v(r[g],r,h):r[g];B===void 0?delete c[S]:c[S]=B,i(g,S,B===void 0)}return c}function de(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),r=h=>{for(const c of h??[])o.add(typeof c=="string"?c:c[0])},i=h=>{for(const c of h)switch(c.kind){case"text":case"image":o.add(c.key),c.kind==="image"&&c.alt&&o.add(c.alt);break;case"button":o.add(c.key),o.add(c.href),typeof c.variant=="object"&&o.add(c.variant.key);break;case"list":o.add(c.key);break;case"group":case"block":r(c.box),i(c.parts??[]);break;case"core":c.keep!=="rest"&&c.keep.forEach(y=>o.add(y)),Object.keys(c.rename??{}).forEach(y=>o.add(y));for(const y of Object.values(c.slots??{}))for(const g of y)"kind"in g&&o.add(g.key);break}};for(const h of[t,...t.also??[]])r(h.box),i(h.parts);return o}function q(t,o,r={}){const i=t.props,h=o.skip?.(i);if(h!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:h};const c=String(i.id??t.type),y=[],g=[],S=[],v=new Set,B=(n,s)=>{y.push({key:n,home:s}),v.add(n)},X=i._partStyles??{},L=de(o);let J=0;const w=(n,s)=>({type:n,props:{...s,id:`${c}~${n}-${++J}`}}),K=(n,s,b,u,x,l,$)=>{if(x){for(const a of n??[]){const p=typeof a=="string"?a:a[0];b[p]!==void 0&&$(p,`nothing — the ${u} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(i,r):s??{};return D(n??[],e,b,(a,p,f)=>$(a,f?`nothing — the old value draws nothing (${u}: no ${p})`:`${l}${u}: ${p}`),r)},M=n=>n.map(s=>{const b={...s.props??{}};for(const[u,x]of Object.entries(s.slots??{}))b[u]=M(x);return w(s.type,b)}),W=(n,s,b)=>{const u=Array.isArray(s[n.key])?s[n.key]:[],x=typeof n.props=="function"?n.props(i,r):n.props??{},l=u.map((f,d)=>{const k=f??{},m=n.item?.(k,d,i)??{},E=N(m.reverse?[...n.parts].reverse():n.parts,k,!1,`item ${d+1}: `);return n.flat?m.props?E.map(T=>({...T,props:{...T.props,...m.props,id:T.props.id}})):E:[w(_,{name:`${n.name} ${d+1}`,...x,...m.props??{},[P]:E})]});if(n.groups){const f=n.groups;return b(n.key,u.length?`one Box per item (${u.length}), in a Box per group`:"nothing — the list is empty"),re(u.map(d=>d??{}),f.of,f.of).map((d,k)=>{const m=d.items.map(O=>O.item),E=f.parts?N(f.parts,f.head?.(m,i)??{},!1,`group ${k+1}: `):[],T=d.items.map(O=>l[O.index]),z=f.perRow?.(m.length,i),I=Number.isInteger(z)&&z>=1?z:1,C=[];if(f.perRow&&I<T.length)for(let O=0;O*I<T.length;O++)C.push(T.slice(O*I,(O+1)*I).flat());return w(_,{name:`${f.name} ${k+1}`,...f.props??{},[P]:[...E,w(_,{name:`${f.itemsName} ${k+1}`,...f.itemsProps?.(m.length,i)??{},[P]:C.length?C.map((O,U)=>w(_,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[P]:O})):T.flat()})]})})}const $=n.perRow?.(i),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(u.length?n.flat?`each item's parts (${u.length} items), in order`:`one Box per item (${u.length}), its parts inside`:"nothing — the list is empty")+(e&&u.length?`, in rows of ${e}`:"")),!e)return l.flat();const a=typeof n.rowProps=="function"?n.rowProps(i,r):n.rowProps??{},p=[];for(let f=0;f*e<l.length;f++){const d=l.slice(f*e,(f+1)*e).flat(),k=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;p.push(w(_,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...a,[P]:[...d,...Array.from({length:k},(m,E)=>w(_,{name:`Empty ${E+1}`,...n.rowFiller,[P]:[]}))]}))}return p},N=(n,s,b,u)=>{const x=[],l=(e,a)=>b?B(e,a):void 0,$=e=>b?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(i,b?void 0:s)))switch(e.kind){case"text":{const a=F(s[e.key]);if(!a.text.trim()){l(e.key,"nothing — empty words draw nothing, so no block");break}const p=ce(e.role??"body"),{_partStyles:f,...d}=p,k=fe(p,e.styleFrom?{...e.style,...e.styleFrom(i,r)}:e.style,$(e.key),e.props?.align);if(e.was&&b){const m=k._partStyles?.text??{};S.push({key:e.key,was:e.was,...typeof m.textStyle=="string"?{textStyle:m.textStyle}:{},...R(m.size)!==void 0?{size:R(m.size)}:{},...R(m.sizePhone)!==void 0?{sizePhone:R(m.sizePhone)}:{}})}x.push(w("Text",{text:e.mark==="accentLead"?ae(a.text):a.text,...d,...e.props??{},...k,...a.hidden?{_hidden:!0}:{}})),l(e.key,`${u}Text block: its words${a.hidden?", hidden":""}`);break}case"button":{const a=F(s[e.key]);if(!a.text.trim()){l(e.key,"nothing — no words, no button"),l(e.href,"nothing — no button to link"),typeof e.variant=="object"&&l(e.variant.key,"nothing — no button to style");break}const p=typeof s[e.href]=="string"&&s[e.href]?s[e.href]:"#",f={...e.style??{},...$(e.key)??{}};x.push(w("ButtonBlock",{label:a.text,href:p,...typeof e.props=="function"?e.props(s,r):e.props??{},...le(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...a.hidden?{_hidden:!0}:{}})),l(e.key,`${u}Button block: its words`),l(e.href,`${u}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${u}Button block: its Style`);break}case"image":{const a=s[e.key];if(typeof a!="string"||!a){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";x.push(w("ImageBlock",{src:a,alt:p,...e.props??{}})),l(e.key,`${u}Image block: its picture`),e.alt&&l(e.alt,`${u}Image block: its alt text`);break}case"list":{x.push(...W(e,s,l));break}case"group":{const a=N(e.parts,s,b,u),p=K(e.box,e.props,s,`${e.name} Box`,!a.length&&!e.keepEmpty,u,l);p&&x.push(w(_,{name:e.name,...p,[P]:a}));break}case"block":{const a=e.parts?N(e.parts,s,b,u):[],p=K(e.box,e.props,s,`${e.type} block`,!!e.parts&&!a.length&&!e.keepEmpty,u,l);p&&x.push(w(e.type,{...p,...e.slot?{[e.slot]:a}:{}}));break}case"core":{const a=e.as??t.type,p={headPlacement:"own-box",...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(d=>!L.has(d)&&!(d in p)):e.keep;for(const d of f)s[d]!==void 0&&(p[d]=s[d],l(d,`the ${a} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))s[k]!==void 0&&!L.has(k)&&l(k,`nothing — the ${a} block inside the Box has the row's own value`);s.headPlacement!==void 0&&l("headPlacement",`the ${a} block inside the Box: own-box`);const d=Object.fromEntries(Object.entries(X).filter(([k])=>!L.has(k)));Object.keys(d).length&&(p._partStyles=d)}for(const[d,k]of Object.entries(e.rename??{}))s[d]!==void 0&&(p[k]=s[d],l(d,`the ${a} block inside the Box: ${k}`));for(const[d,k]of Object.entries(e.slots??{}))p[d]=k.flatMap(m=>"kind"in m?W(m,s,l):M([m]));x.push(w(a,p));break}}return x},Q=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,u=N(n.parts,i,!0,s===0?"":`${b}: `),x=typeof n.boxProps=="function"?n.boxProps(i,r):n.boxProps??{},l=D(n.box??[],x,i,($,e,a)=>B($,a?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),r);return{type:_,props:{name:n.name,...l,[P]:u,id:ie(c,s)}}},G=[o,...o.also??[]].map(Q);i._partStyles!==void 0&&B("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))i[n]!==void 0&&B(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in i&&(g.push({key:n,why:s}),v.add(n));for(const n of Object.keys(i))Y.has(n)||v.has(n)||g.push({key:n,why:"not in the row — not carried"});return{node:G[0],nodes:G,carried:y,dropped:g,siteWrites:[...o.site?.(t,r)??[]],restyled:S}}function Pe(t,o=H,r={}){const i=t.content;if(!Array.isArray(i))return t;let h=!1;const c=i.flatMap(y=>{const g=y&&typeof y.type=="string"&&o.includes(y.type)?j[y.type]:void 0;if(!g)return[y];const S=q(y,g,r);return S.skipped!==void 0?[y]:(h=!0,S.nodes)});return h?{...t,content:c}:t}function je(t,o=H,r={}){if(!Array.isArray(t))return[];const i=[];return t.forEach((h,c)=>{const y=h&&typeof h.type=="string"&&o.includes(h.type)?j[h.type]:void 0;if(!y)return;const g=q(h,y,r);g.skipped===void 0&&i.push({index:c,node:g.node,nodes:g.nodes})}),i}export{P as SECTION_BOX_SLOT,_ as SECTION_BOX_TYPE,H as SECTION_TO_BOX_ON,we as boxNativeReason,q as convertSection,Pe as convertSectionsInPage,ge as convertTheme,Be as convertsToBox,_e as hasWords,Te as headParts,xe as registerBoxNativeSections,$e as registerSectionToBox,ie as sectionBoxIdOf,je as sectionToBoxEdits,Oe as sectionToBoxRow,Se as sectionToBoxTypes};
1
+ import{readHidable as Z}from"efficient-easel/draw";import{BOX_TYPE as ee,CONTAINER_BLOCKS_SLOT as te}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as oe,labelTextSeed as ne}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as se}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as R}from"../../../format/lib/finite-number.js";import{bucketByGroup as re}from"../../../format/lib/locations-grid.js";import{normalizeTheme as V}from"../../../format/lib/theme.js";const _=ee,P=te;function ge(t){if(t.theme)return V(t.theme);const o=t.site?.themePresets;return o?V({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ie(t,o){return o===0?`${t}~box`:`${t}~box-${o+1}`}const A={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function xe(t){for(const[o,r]of Object.entries(t)){if(o in A&&A[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=r}}function we(t){return A[t]}const Y=new Set(["id"]),j={},H=[];function $e(t){for(const[o,r]of Object.entries(t)){if(o in j&&j[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);j[o]=r}}function Oe(t){return j[t]}function Se(){return Object.keys(j)}function Be(t){return t in j&&H.includes(t)}function Te(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const r=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&r.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&r.push({kind:"button",key:"linkText",href:"linkHref"}),r}const F=t=>Z(t),_e=t=>F(t).text.trim()!=="";function ae(t){if(t.includes("=="))return t;const o=t.indexOf("/"),r=o===-1?t:t.slice(0,o),i=r.trim();if(!i)return t;const h=r.indexOf(i);return`${r.slice(0,h)}==${i}==${r.slice(h+i.length)}${o===-1?"":t.slice(o)}`}const ce=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function fe(t,o,r,i){const c={...t._partStyles?.text??{},...o??{},...r??{}};return(i==="center"||i==="right")&&c.align===void 0&&(c.align=i),Object.keys(c).length?{_partStyles:{text:c}}:{}}function le(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const r=o[t.key];return{variant:typeof r=="string"&&Object.hasOwn(t.map,r)?t.map[r]:t.fallback}}function D(t,o,r,i,h={}){const c={...o};for(const y of t){const[g,S,v]=typeof y=="string"?[y,y,void 0]:y;if(r[g]===void 0)continue;const B=v?v(r[g],r,h):r[g];B===void 0?delete c[S]:c[S]=B,i(g,S,B===void 0)}return c}function de(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),r=h=>{for(const c of h??[])o.add(typeof c=="string"?c:c[0])},i=h=>{for(const c of h)switch(c.kind){case"text":case"image":o.add(c.key),c.kind==="image"&&c.alt&&o.add(c.alt);break;case"button":o.add(c.key),o.add(c.href),typeof c.variant=="object"&&o.add(c.variant.key);break;case"list":o.add(c.key);break;case"group":case"block":r(c.box),i(c.parts??[]);break;case"core":c.keep!=="rest"&&c.keep.forEach(y=>o.add(y)),Object.keys(c.rename??{}).forEach(y=>o.add(y));for(const y of Object.values(c.slots??{}))for(const g of y)"kind"in g&&o.add(g.key);break}};for(const h of[t,...t.also??[]])r(h.box),i(h.parts);return o}function q(t,o,r={}){const i=t.props,h=o.skip?.(i);if(h!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:h};const c=String(i.id??t.type),y=[],g=[],S=[],v=new Set,B=(n,s)=>{y.push({key:n,home:s}),v.add(n)},X=i._partStyles??{},L=de(o);let J=0;const w=(n,s)=>({type:n,props:{...s,id:`${c}~${n}-${++J}`}}),K=(n,s,b,u,x,l,$)=>{if(x){for(const a of n??[]){const p=typeof a=="string"?a:a[0];b[p]!==void 0&&$(p,`nothing — the ${u} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(i,r):s??{};return D(n??[],e,b,(a,p,f)=>$(a,f?`nothing — the old value draws nothing (${u}: no ${p})`:`${l}${u}: ${p}`),r)},M=n=>n.map(s=>{const b={...s.props??{}};for(const[u,x]of Object.entries(s.slots??{}))b[u]=M(x);return w(s.type,b)}),W=(n,s,b)=>{const u=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],x=typeof n.props=="function"?n.props(i,r):n.props??{},l=u.map((f,d)=>{const k=f??{},m=n.item?.(k,d,i)??{},E=N(m.reverse?[...n.parts].reverse():n.parts,k,!1,`item ${d+1}: `);return n.flat?m.props?E.map(T=>({...T,props:{...T.props,...m.props,id:T.props.id}})):E:[w(_,{name:`${n.name} ${d+1}`,...x,...m.props??{},[P]:E})]});if(n.groups){const f=n.groups;return b(n.key,u.length?`one Box per item (${u.length}), in a Box per group`:"nothing — the list is empty"),re(u.map(d=>d??{}),f.of,f.of).map((d,k)=>{const m=d.items.map(O=>O.item),E=f.parts?N(f.parts,f.head?.(m,i)??{},!1,`group ${k+1}: `):[],T=d.items.map(O=>l[O.index]),z=f.perRow?.(m.length,i),I=Number.isInteger(z)&&z>=1?z:1,C=[];if(f.perRow&&I<T.length)for(let O=0;O*I<T.length;O++)C.push(T.slice(O*I,(O+1)*I).flat());return w(_,{name:`${f.name} ${k+1}`,...f.props??{},[P]:[...E,w(_,{name:`${f.itemsName} ${k+1}`,...f.itemsProps?.(m.length,i)??{},[P]:C.length?C.map((O,U)=>w(_,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[P]:O})):T.flat()})]})})}const $=n.perRow?.(i),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(u.length?n.flat?`each item's parts (${u.length} items), in order`:`one Box per item (${u.length}), its parts inside`:"nothing — the list is empty")+(e&&u.length?`, in rows of ${e}`:"")),!e)return l.flat();const a=typeof n.rowProps=="function"?n.rowProps(i,r):n.rowProps??{},p=[];for(let f=0;f*e<l.length;f++){const d=l.slice(f*e,(f+1)*e).flat(),k=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;p.push(w(_,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...a,[P]:[...d,...Array.from({length:k},(m,E)=>w(_,{name:`Empty ${E+1}`,...n.rowFiller,[P]:[]}))]}))}return p},N=(n,s,b,u)=>{const x=[],l=(e,a)=>b?B(e,a):void 0,$=e=>b?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(i,b?void 0:s)))switch(e.kind){case"text":{const a=F(s[e.key]);if(!a.text.trim()){l(e.key,"nothing — empty words draw nothing, so no block");break}const p=ce(e.role??"body"),{_partStyles:f,...d}=p,k=fe(p,e.styleFrom?{...e.style,...e.styleFrom(i,r)}:e.style,$(e.key),e.props?.align);if(e.was&&b){const m=k._partStyles?.text??{};S.push({key:e.key,was:e.was,...typeof m.textStyle=="string"?{textStyle:m.textStyle}:{},...R(m.size)!==void 0?{size:R(m.size)}:{},...R(m.sizePhone)!==void 0?{sizePhone:R(m.sizePhone)}:{}})}x.push(w("Text",{text:e.mark==="accentLead"?ae(a.text):a.text,...d,...e.props??{},...k,...a.hidden?{_hidden:!0}:{}})),l(e.key,`${u}Text block: its words${a.hidden?", hidden":""}`);break}case"button":{const a=F(s[e.key]);if(!a.text.trim()){l(e.key,"nothing — no words, no button"),l(e.href,"nothing — no button to link"),typeof e.variant=="object"&&l(e.variant.key,"nothing — no button to style");break}const p=typeof s[e.href]=="string"&&s[e.href]?s[e.href]:"#",f={...e.style??{},...$(e.key)??{}};x.push(w("ButtonBlock",{label:a.text,href:p,...typeof e.props=="function"?e.props(s,r):e.props??{},...le(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...a.hidden?{_hidden:!0}:{}})),l(e.key,`${u}Button block: its words`),l(e.href,`${u}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${u}Button block: its Style`);break}case"image":{const a=s[e.key];if(typeof a!="string"||!a){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";x.push(w("ImageBlock",{src:a,alt:p,...e.props??{}})),l(e.key,`${u}Image block: its picture`),e.alt&&l(e.alt,`${u}Image block: its alt text`);break}case"list":{x.push(...W(e,s,l));break}case"group":{const a=N(e.parts,s,b,u),p=K(e.box,e.props,s,`${e.name} Box`,!a.length&&!e.keepEmpty,u,l);p&&x.push(w(_,{name:e.name,...p,[P]:a}));break}case"block":{const a=e.parts?N(e.parts,s,b,u):[],p=K(e.box,e.props,s,`${e.type} block`,!!e.parts&&!a.length&&!e.keepEmpty,u,l);p&&x.push(w(e.type,{...p,...e.slot?{[e.slot]:a}:{}}));break}case"core":{const a=e.as??t.type,p={headPlacement:"own-box",...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(d=>!L.has(d)&&!(d in p)):e.keep;for(const d of f)s[d]!==void 0&&(p[d]=s[d],l(d,`the ${a} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))s[k]!==void 0&&!L.has(k)&&l(k,`nothing — the ${a} block inside the Box has the row's own value`);s.headPlacement!==void 0&&l("headPlacement",`the ${a} block inside the Box: own-box`);const d=Object.fromEntries(Object.entries(X).filter(([k])=>!L.has(k)));Object.keys(d).length&&(p._partStyles=d)}for(const[d,k]of Object.entries(e.rename??{}))s[d]!==void 0&&(p[k]=s[d],l(d,`the ${a} block inside the Box: ${k}`));for(const[d,k]of Object.entries(e.slots??{}))p[d]=k.flatMap(m=>"kind"in m?W(m,s,l):M([m]));x.push(w(a,p));break}}return x},Q=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,u=N(n.parts,i,!0,s===0?"":`${b}: `),x=typeof n.boxProps=="function"?n.boxProps(i,r):n.boxProps??{},l=D(n.box??[],x,i,($,e,a)=>B($,a?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),r);return{type:_,props:{name:n.name,...l,[P]:u,id:ie(c,s)}}},G=[o,...o.also??[]].map(Q);i._partStyles!==void 0&&B("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))i[n]!==void 0&&B(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in i&&(g.push({key:n,why:s}),v.add(n));for(const n of Object.keys(i))Y.has(n)||v.has(n)||g.push({key:n,why:"not in the row — not carried"});return{node:G[0],nodes:G,carried:y,dropped:g,siteWrites:[...o.site?.(t,r)??[]],restyled:S}}function Pe(t,o=H,r={}){const i=t.content;if(!Array.isArray(i))return t;let h=!1;const c=i.flatMap(y=>{const g=y&&typeof y.type=="string"&&o.includes(y.type)?j[y.type]:void 0;if(!g)return[y];const S=q(y,g,r);return S.skipped!==void 0?[y]:(h=!0,S.nodes)});return h?{...t,content:c}:t}function je(t,o=H,r={}){if(!Array.isArray(t))return[];const i=[];return t.forEach((h,c)=>{const y=h&&typeof h.type=="string"&&o.includes(h.type)?j[h.type]:void 0;if(!y)return;const g=q(h,y,r);g.skipped===void 0&&i.push({index:c,node:g.node,nodes:g.nodes})}),i}export{P as SECTION_BOX_SLOT,_ as SECTION_BOX_TYPE,H as SECTION_TO_BOX_ON,we as boxNativeReason,q as convertSection,Pe as convertSectionsInPage,ge as convertTheme,Be as convertsToBox,_e as hasWords,Te as headParts,xe as registerBoxNativeSections,$e as registerSectionToBox,ie as sectionBoxIdOf,je as sectionToBoxEdits,Oe as sectionToBoxRow,Se as sectionToBoxTypes};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "48.0.0",
3
+ "version": "48.1.1",
4
4
  "description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",