efficient-web-builder 59.0.0 → 59.2.0

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 (95) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/editor/components/HoverEffectField.js +1 -1
  3. package/dist/editor/components/SwitchToBoxFooter.js +1 -1
  4. package/dist/editor/components/useCardContentSwitchPass.d.ts +1 -0
  5. package/dist/editor/components/useCardContentSwitchPass.js +1 -0
  6. package/dist/editor/components/usePinnedChromeSeed.js +1 -1
  7. package/dist/editor/lib/animation/fields.js +1 -1
  8. package/dist/editor/lib/animation/hover-fields.d.ts +10 -1
  9. package/dist/editor/lib/animation/hover-fields.js +1 -1
  10. package/dist/editor/lib/document/blocks/general/CardList/fields.js +1 -1
  11. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  12. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
  14. package/dist/editor/lib/document/box-footer-rows.d.ts +3 -0
  15. package/dist/editor/lib/document/box-footer-rows.js +1 -0
  16. package/dist/editor/lib/document/box-side-space-field.d.ts +11 -0
  17. package/dist/editor/lib/document/box-side-space-field.js +1 -0
  18. package/dist/editor/lib/document/choice-pictures.d.ts +2 -1
  19. package/dist/editor/lib/document/choice-pictures.js +1 -1
  20. package/dist/editor/lib/document/page-root.js +2 -2
  21. package/dist/editor/lib/sections/text-layouts.js +1 -1
  22. package/dist/format/lib/animation/hover.d.ts +8 -0
  23. package/dist/format/lib/animation/hover.js +1 -1
  24. package/dist/format/lib/content/block-align.d.ts +1 -0
  25. package/dist/format/lib/content/block-align.js +1 -1
  26. package/dist/format/lib/content/block-sources.d.ts +1 -0
  27. package/dist/format/lib/content/block-sources.js +1 -1
  28. package/dist/format/lib/content/box-shape.d.ts +1 -1
  29. package/dist/format/lib/content/box-side-space.d.ts +13 -0
  30. package/dist/format/lib/content/box-side-space.js +1 -0
  31. package/dist/format/lib/content/page-width.d.ts +3 -0
  32. package/dist/format/lib/content/page-width.js +1 -1
  33. package/dist/format/lib/document/blocks/general/Cards/card-list-seed.d.ts +18 -0
  34. package/dist/format/lib/document/blocks/general/Cards/card-list-seed.js +1 -0
  35. package/dist/format/lib/document/blocks/general/Cards/card-seed.d.ts +9 -0
  36. package/dist/format/lib/document/blocks/general/Cards/card-seed.js +1 -1
  37. package/dist/format/lib/document/blocks/general/FAQ/card-seed.d.ts +1 -0
  38. package/dist/format/lib/document/blocks/general/FAQ/card-seed.js +1 -1
  39. package/dist/format/lib/document/box-footer.d.ts +13 -2
  40. package/dist/format/lib/document/box-footer.js +1 -1
  41. package/dist/format/lib/document/card-content-switch.d.ts +22 -0
  42. package/dist/format/lib/document/card-content-switch.js +1 -0
  43. package/dist/format/lib/document/cards-template-on-read.js +1 -1
  44. package/dist/format/lib/document/container-blocks.js +1 -1
  45. package/dist/format/lib/document/section-catalog.d.ts +1 -0
  46. package/dist/format/lib/document/section-catalog.js +4 -12
  47. package/dist/format/lib/document/seed-parts.d.ts +3 -0
  48. package/dist/format/lib/document/seed-parts.js +1 -1
  49. package/dist/format/lib/editor-words-catalogue.d.ts +4 -0
  50. package/dist/format/lib/editor-words-catalogue.js +3 -3
  51. package/dist/format/lib/sections/logo-look.d.ts +1 -1
  52. package/dist/format/lib/sections/logo-look.js +1 -1
  53. package/dist/format/lib/source-rules/one-section-edge-inset.d.ts +6 -0
  54. package/dist/format/lib/source-rules/one-section-edge-inset.js +2 -0
  55. package/dist/format/lib/source-rules/one-site-column.js +3 -3
  56. package/dist/render/components/BlockFrame.d.ts +2 -0
  57. package/dist/render/components/BlockFrame.js +1 -1
  58. package/dist/render/components/Flex.d.ts +5 -2
  59. package/dist/render/components/Flex.js +1 -1
  60. package/dist/render/components/Logos.d.ts +5 -1
  61. package/dist/render/components/Logos.js +1 -1
  62. package/dist/render/components/SiteGutterFrame.d.ts +7 -2
  63. package/dist/render/components/SiteGutterFrame.js +1 -1
  64. package/dist/render/components/Text.d.ts +2 -1
  65. package/dist/render/components/Text.js +1 -1
  66. package/dist/render/lib/content/box-stack-line.d.ts +3 -1
  67. package/dist/render/lib/content/box-stack-line.js +1 -1
  68. package/dist/render/lib/content/section-edge.d.ts +12 -0
  69. package/dist/render/lib/content/section-edge.js +1 -1
  70. package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
  71. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  72. package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
  73. package/dist/render/lib/document/blocks/general/Logos/wall-rows.d.ts +2 -0
  74. package/dist/render/lib/document/blocks/general/Logos/wall-rows.js +1 -0
  75. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  76. package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +1 -0
  77. package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
  78. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -0
  79. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  80. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  81. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.d.ts +3 -1
  82. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
  83. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.d.ts +1 -0
  84. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
  85. package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -1
  86. package/dist/render/lib/document/head-core-boxes.d.ts +1 -0
  87. package/dist/render/lib/document/head-core-boxes.js +1 -1
  88. package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
  89. package/dist/render/lib/document/page-render.js +1 -1
  90. package/dist/render/lib/document/passes/section-width.js +1 -1
  91. package/dist/render/lib/document/wall-labels.d.ts +3 -0
  92. package/dist/render/lib/document/wall-labels.js +1 -0
  93. package/dist/render/lib/sections/section-to-box.d.ts +1 -0
  94. package/dist/render/lib/sections/section-to-box.js +1 -1
  95. package/package.json +1 -1
@@ -1 +1 @@
1
- import{DIM as u,DROP_COMMON as a,DROP_SIDE_PADDING as s,FOLLOW_THE_BOX as c,INNER_BOX as r,SAME_KEYS as _,SECTION_BOX as P,TEXT as b,bandPage as y,smallText as i,wrapperPad as C,wrapperPadKeys as f}from"./section-to-box-row-parts.js";import{boxPadding as x,token as p}from"../../../../../format/lib/document/seed-parts.js";import{phoneKey as E}from"efficient-easel/draw";import{convertTheme as S}from"../../../sections/section-to-box.js";import{surfacePresetIndex as w}from"../../../../../format/lib/theme.js";import{CHART_OWN_BOX_WORDS as A}from"../../../../../format/lib/document/blocks/general/Chart/meta.js";import{MOCKUP_OWN_BOX_WORDS as N}from"../../../../../format/lib/document/blocks/general/Mockup/meta.js";const m={top:76,bottom:76,topPhone:76,bottomPhone:76},d=()=>({kind:"group",name:"Words",props:{...r,gap:20,gapPhone:20},parts:[{kind:"group",name:"Chip row",props:{...r,direction:"row",phoneRow:2,[E("share")]:"content"},parts:[{kind:"group",name:"Chip",props:{...r,fillColor:"main",...x(6,14)},parts:[i("eyebrow",{color:"background",...p("label",12),weight:600,letterSpacing:.16})]}]},{kind:"text",key:"title",role:"heading",props:b,style:{textStyle:"heading-2",...p("headingMedium",44,32),weight:500,case:"upper",lineHeight:1.04,letterSpacing:-.02}},{kind:"text",key:"body",props:{...u,maxWidth:435},style:{textStyle:"body-1",...p("body",15),lineHeight:1.625}}]}),l=(e,o)=>{const t=S(o)?.themes,n=t?w(t,y(e,o)):-1;return n>=0?n:e},g=e=>(o,t)=>({...P,sectionAccent:l(o.sectionAccent??0,t),direction:"row",align:"center",gap:56,gapPhone:56,share:e,sectionBorder:{top:1,bottom:1},...C(o,m)}),h=[..._.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,o,t)=>l(e,t)],...f(m)],B=()=>({name:"Chart",boxProps:g([42]),box:h,parts:[d(),{kind:"group",name:"Chart",props:{...r,gap:16,gapPhone:16},keepEmpty:!0,parts:[{kind:"core",keep:"rest",props:c},i("caption",{color:"muted",...p("label",10),letterSpacing:.14})]}],pressKeepsEmpty:[...A],drop:{...a,...s}}),O=e=>e.align==="left",k={kind:"group",name:"Card",keepEmpty:!0,props:r,parts:[{kind:"core",keep:"rest",props:c}]},D=()=>({name:"Mockup Card",boxProps:g("equal"),box:h,parts:[{...k,when:O},d(),{...k,when:e=>!O(e)}],pressKeepsEmpty:[...N],drop:{...a,...s}}),H={Chart:B(),Mockup:D()};export{H as PROOF_SECTION_TO_BOX};
1
+ import{DIM as _,DROP_COMMON as s,DROP_SIDE_PADDING as a,FOLLOW_THE_BOX as c,INNER_BOX as r,SAME_KEYS as k,SECTION_BOX as u,TEXT as y,bandPage as P,filledChip as b,smallText as C,wrapperPad as f,wrapperPadKeys as E}from"./section-to-box-row-parts.js";import{token as p}from"../../../../../format/lib/document/seed-parts.js";import{phoneKey as x}from"efficient-easel/draw";import{convertTheme as S}from"../../../sections/section-to-box.js";import{surfacePresetIndex as w}from"../../../../../format/lib/theme.js";import{CHART_OWN_BOX_WORDS as A}from"../../../../../format/lib/document/blocks/general/Chart/meta.js";import{MOCKUP_OWN_BOX_WORDS as N}from"../../../../../format/lib/document/blocks/general/Mockup/meta.js";const i={top:76,bottom:76,topPhone:76,bottomPhone:76},m=()=>({kind:"group",name:"Words",props:{...r,gap:20,gapPhone:20},parts:[{kind:"group",name:"Chip row",props:{...r,direction:"row",phoneRow:2,[x("share")]:"content"},parts:[b("eyebrow")]},{kind:"text",key:"title",role:"heading",props:y,style:{textStyle:"heading-2",...p("headingMedium",44,32),weight:500,case:"upper",lineHeight:1.04,letterSpacing:-.02}},{kind:"text",key:"body",props:{..._,maxWidth:435},style:{textStyle:"body-1",...p("body",15),lineHeight:1.625}}]}),d=(e,o)=>{const t=S(o)?.themes,n=t?w(t,P(e,o)):-1;return n>=0?n:e},h=e=>(o,t)=>({...u,sectionAccent:d(o.sectionAccent??0,t),direction:"row",align:"center",gap:56,gapPhone:56,share:e,sectionBorder:{top:1,bottom:1},...f(o,i)}),O=[...k.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,o,t)=>d(e,t)],...E(i)],B=()=>({name:"Chart",boxProps:h([42]),box:O,parts:[m(),{kind:"group",name:"Chart",props:{...r,gap:16,gapPhone:16},keepEmpty:!0,parts:[{kind:"core",keep:"rest",props:c},C("caption",{color:"muted",...p("label",10),letterSpacing:.14})]}],pressKeepsEmpty:[...A],drop:{...s,...a}}),l=e=>e.align==="left",g={kind:"group",name:"Card",keepEmpty:!0,props:r,parts:[{kind:"core",keep:"rest",props:c}]},D=()=>({name:"Mockup Card",boxProps:h("equal"),box:O,parts:[{...g,when:l},m(),{...g,when:e=>!l(e)}],pressKeepsEmpty:[...N],drop:{...s,...a}}),H={Chart:B(),Mockup:D()};export{H as PROOF_SECTION_TO_BOX};
@@ -1 +1,2 @@
1
1
  export declare function markHeadCoreBoxes<T>(data: T): T;
2
+ export declare function dropEmptySourcedBoxes<T>(data: T): T;
@@ -1 +1 @@
1
- import{isNode as x,isNodeList as c}from"efficient-easel/data";import{storedStepsShown as E}from"../../components/ProcessSteps.js";import{declaredBlockSource as m,sourcedRows as P}from"../../../format/lib/content/block-sources.js";import{rowHoldsContent as S}from"../../../format/lib/content/card-state.js";import{CARD_LIST_TYPE as k}from"../../../format/lib/content/card-template.js";import{HEAD_CORE_PROP as C,HOLDS_HEAD_CORE_PROP as l}from"../content/empty-hides.js";import{parseSectionHeadPlacement as L}from"../../../format/lib/sections/section-head-placement.js";const p="Flex",_="Text",i=r=>Object.values(r??{}).filter(c),A=r=>r.type===k&&m(r.props)!=="",a=r=>{if(r.type!==p)return!1;const t=i(r.props).flat();return t.length>0&&t.every(A)},u=r=>L(r.props?.headPlacement)==="own-box"||a(r),f=r=>r===void 0||Array.isArray(r)&&r.length===0;function y(r){return r.type===_?!0:r.type===p&&i(r.props).every(t=>t.every(y))}const H={ProcessSteps:r=>f(r.boxes)&&E(r.steps).length===0,Logos:r=>!m(r)&&f(r.logos)&&f(r.items)};function B(r){return i(r.props).flat().every(t=>!P(t.props,!1).rows.some(S))}function g(r){const t=i(r.props).flat();return t.some(u)&&t.every(o=>u(o)||y(o))}function O(r){const t={...r.props};for(const[o,s]of Object.entries(r.props??{}))!c(s)||!s.some(e=>x(e)&&u(e))||(t[o]=s.map(e=>{if(!u(e))return e;const n=a(e)?B(e):H[String(e.type)]?.(e.props??{})===!0;return{...e,props:{...e.props,[C]:n?"empty":!0}}}));return{...r,props:t}}function R(r){const o=Object.entries(r.props??{}).filter(([,e])=>c(e)).filter(([,e])=>e.length>0);if(o.length!==1||o[0][1].length!==1)return null;const s=o[0][1][0];return s?.type===p&&s.props?{key:o[0][0],inner:s}:null}function T(r){if(r?.type!==p||!r.props)return r;if(g(r)){const o=O(r);return{...o,props:{...o.props,[l]:!0}}}const t=R(r);return!t||!g(t.inner)?r:{...r,props:{...r.props,[t.key]:[O(t.inner)],[l]:!0}}}function j(r){const t=r;if(!t||!Array.isArray(t.content))return r;let o=!1;const s=t.content.map(e=>{const n=T(e);return n!==e&&(o=!0),n});return o?{...t,content:s}:r}export{j as markHeadCoreBoxes};
1
+ import{isNode as k,isNodeList as u}from"efficient-easel/data";import{storedStepsShown as w}from"../../components/ProcessSteps.js";import{declaredBlockSource as l,servedRows as A,sourcedRows as L}from"../../../format/lib/content/block-sources.js";import{rowHoldsContent as P}from"../../../format/lib/content/card-state.js";import{CARD_LIST_TYPE as B}from"../../../format/lib/content/card-template.js";import{wallRows as C}from"./blocks/general/Logos/wall-rows.js";import{HEAD_CORE_PROP as R,HOLDS_HEAD_CORE_PROP as a}from"../content/empty-hides.js";import{parseSectionHeadPlacement as _}from"../../../format/lib/sections/section-head-placement.js";const p="Flex",v="Text",i=r=>Object.values(r??{}).filter(u),H=r=>r.type===B&&l(r.props)!=="",y=r=>{if(r.type!==p)return!1;const t=i(r.props).flat();return t.length>0&&t.every(H)},c=r=>_(r.props?.headPlacement)==="own-box"||y(r),m=r=>r===void 0||Array.isArray(r)&&r.length===0;function x(r){return r.type===v?!0:r.type===p&&i(r.props).every(t=>t.every(x))}const g={ProcessSteps:r=>m(r.boxes)&&w(r.steps).length===0,Logos:r=>l(r)?b(r):m(r.logos)&&m(r.items)};function b(r){return A(r)!==null&&C(r,!1).length===0}function T(r){return i(r.props).flat().every(t=>!L(t.props,!1).rows.some(P))}function f(r){const t=i(r.props).flat();return t.some(c)&&t.every(o=>c(o)||x(o))}function S(r){const t={...r.props};for(const[o,s]of Object.entries(r.props??{}))!u(s)||!s.some(e=>k(e)&&c(e))||(t[o]=s.map(e=>{if(!c(e))return e;const n=y(e)?T(e):g[String(e.type)]?.(e.props??{})===!0;return{...e,props:{...e.props,[R]:n?"empty":!0}}}));return{...r,props:t}}function E(r){const o=Object.entries(r.props??{}).filter(([,e])=>u(e)).filter(([,e])=>e.length>0);if(o.length!==1||o[0][1].length!==1)return null;const s=o[0][1][0];return s?.type===p&&s.props?{key:o[0][0],inner:s}:null}function h(r){if(r?.type!==p||!r.props)return r;if(f(r)){const o=S(r);return{...o,props:{...o.props,[a]:!0}}}const t=E(r);return!t||!f(t.inner)?r:{...r,props:{...r.props,[t.key]:[S(t.inner)],[a]:!0}}}function q(r){const t=r;if(!t||!Array.isArray(t.content))return r;let o=!1;const s=t.content.map(e=>{const n=h(e);return n!==e&&(o=!0),n});return o?{...t,content:s}:r}const d=r=>g[String(r.type)]?.(r.props??{})===!0;function j(r){if(r.type!==p||!r.props)return!1;const t=f(r)?null:E(r),o=t?t.inner:r;if(!f(o))return!1;const s=i(o.props).flat().filter(c);return s.some(e=>l(e.props)!=="")&&s.every(d)}function O(r){let t;for(const[o,s]of Object.entries(r.props??{})){if(!u(s))continue;const e=s,n=D(e);n!==e&&((t??={...r.props})[o]=n)}return t?{...r,props:t}:r}function D(r){let t=!1;const o=[];for(const s of r){if(j(s)){t=!0;continue}const e=O(s);e!==s&&(t=!0),o.push(e)}return t?o:r}function z(r){const t=r;if(!t||!Array.isArray(t.content))return r;let o=!1;const s=t.content.map(e=>{if(h(e)!==e)return e;const n=O(e);return n!==e&&(o=!0),n});return o?{...t,content:s}:r}export{z as dropEmptySourcedBoxes,q as markHeadCoreBoxes};
@@ -12,8 +12,8 @@ export declare const VIDEO_FILE_LABEL = "Video file";
12
12
  export declare const VIDEO_FILE_PROMPT = "Upload a video file";
13
13
  export declare function forMediaType(type: "image" | "video", fallback: "image" | "video"): {
14
14
  readonly field: "mediaType";
15
- readonly is: "image" | "video";
16
- readonly default: "image" | "video";
15
+ readonly is: "video" | "image";
16
+ readonly default: "video" | "image";
17
17
  };
18
18
  export declare const HERO_MEDIA_PART_TYPES: ReadonlySet<string>;
19
19
  export declare function inPart<F extends object>(part: HeroMediaPart, field: F): F;
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{Render as a}from"efficient-easel/render";import{capHeroGroups as c}from"../../../format/lib/document/cap-hero-groups.js";import{BelowFirstScreen as p,LATER_SLIDES_KEY as f,firstScreenLead as d,laterSlideIdsOf as g,useLeadDrawsFirst as S}from"../first-screen.js";import{markListSearchScopes as l}from"../../../format/lib/document/list-search-scopes.js";import{markHeadCoreBoxes as h}from"./head-core-boxes.js";import{oneH1 as u}from"../../../format/lib/document/one-h1.js";import{withPageContents as w}from"../content/page-contents.js";import{migrateLegacyPageData as L}from"./migrate-legacy.js";import{migrateRenamedProps as O}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as _,SECTION_TO_BOX_ON as P}from"../sections/section-to-box.js";import{siteThemeOf as R}from"../../../format/lib/theme.js";import{registerGeneralSectionRows as x}from"./blocks/general/section-to-box-rows.js";import{withSlotCounts as C}from"./slot-counts.js";function E({config:m,data:i,metadata:r}){x();const e=w(l(h(u(c(_(O(L(i)),P,{theme:R(r)})))))),n=S(m,d(e.content)),o=g(e.content),s=o.length>0?{...r,[f]:o}:r;return t(p,{children:t(a,{config:n,metadata:C(s,e.content),data:e})})}export{E as default};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{Render as s}from"efficient-easel/render";import{capHeroGroups as p}from"../../../format/lib/document/cap-hero-groups.js";import{BelowFirstScreen as c,LATER_SLIDES_KEY as f,firstScreenLead as d,laterSlideIdsOf as l,useLeadDrawsFirst as S}from"../first-screen.js";import{markListSearchScopes as g}from"../../../format/lib/document/list-search-scopes.js";import{dropEmptySourcedBoxes as u,markHeadCoreBoxes as h}from"./head-core-boxes.js";import{oneH1 as L}from"../../../format/lib/document/one-h1.js";import{withPageContents as w}from"../content/page-contents.js";import{markWallLabels as O}from"./wall-labels.js";import{migrateLegacyPageData as _}from"./migrate-legacy.js";import{migrateRenamedProps as x}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as E,SECTION_TO_BOX_ON as P}from"../sections/section-to-box.js";import{siteThemeOf as R}from"../../../format/lib/theme.js";import{registerGeneralSectionRows as B}from"./blocks/general/section-to-box-rows.js";import{withSlotCounts as C}from"./slot-counts.js";function I({config:m,data:i,metadata:e}){B();const r=O(w(g(h(u(L(p(E(x(_(i)),P,{theme:R(e)})))))))),n=S(m,d(r.content)),o=l(r.content),a=o.length>0?{...e,[f]:o}:e;return t(c,{children:t(s,{config:n,metadata:C(a,r.content),data:r})})}export{I as default};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{HideTaker as u}from"../../../components/ViewHideRoot.js";import{INTRO_EDGE_CLASS as U}from"../../../../format/lib/sections/intro-bleed-layout.js";import{resolveContainerDirection as $}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as Y,HERO_CHROME_CAP_VAR as K,HERO_CHROME_INSET_VAR as j,SITE_WIDTH_CAP as _,centredCap as g,heroBackgroundTokens as X}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as B,SECTION_WIDTH_KEYS as v,hasOwnSectionWidth as q,hasWidthFamily as z,resolveWidth as G,siteWidthsOf as J}from"../../../../format/lib/content/section-width.js";import{BOX_GUTTER_KEY as Q,boxGutterOf as Z,boxPlaceOf as tt,boxRunsEdgeToEdge as nt,isFrameContainer as w,ownNodeWidth as et,siteDrawsGutter as ot}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as it}from"../../../../format/lib/document/editor-site-widths.js";import{NestedBoxChoice as ct,SectionGroupChoice as rt,SectionGroupWidthsProvider as lt,SectionRootChoice as dt,SplitBandAndColumn as D}from"../../../components/SiteGutterFrame.js";import{FRAME as F}from"../../../components/BlockFrame.js";import{sectionFillPassClass as H}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as ut}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as E,withRowsShownWhen as O}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as st,heldByANode as at,isNestedNode as ft,NOT_HELD_BY_A_NODE as M}from"../../../../format/lib/document/passes/document-position.js";const C="--sf-sw-site",ht="--sf-sw-content",_t="--sf-bg-cap",Nt="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",p=({own:t,content:n,siteContent:e})=>t===!0&&n==="full"&&e!=="full",L="contents view-wide:[--sf-site-width:100vw]",A=({held:t},n,e)=>t?e:l(u,{className:n,children:e}),wt=`contents view-wide:[--sf-site-width:100vw] ${U} view-wide:[--sf-site-gutter:var(--intro-edge)]`,W=(t,n)=>n==="content"?`min(${t}px,var(${C}))`:`${t}px`;function T({content:t,contentMax:n},e){return t==="full"?e!=="content"?"100vw":null:n===null?null:W(n,e)}function S(t,n){return n===null?t:l(u,{className:"contents",style:{[C]:_},children:l(u,{className:Nt,style:{[ht]:n},children:t})})}const Et="--sf-content-cap",Ot="contents max-view-wide:[--sf-content-cap:none]";function Ct({content:t,contentMax:n},e){return t==="full"?null:n!==null?W(n,e):e==="content"?null:`var(${C})`}function Tt(t,n){return n===null?t:l(u,{className:"contents",style:{[C]:_},children:l(u,{className:Ot,style:{[Et]:n},children:t})})}const a=(t,n,e="")=>t==="content"?l(u,{className:e||void 0,style:g(_),children:n}):n;function P(t,n,e,o,i){if(p(e))return a(o,A(e,L,l(D,{children:t({...n,contained:!0})})),i);if(e.content==="full")return a(o,t({...n,contained:!1}),i);const c=T(e,o);return o==="content"&&c===null&&!e.own?t({...n,contained:!0}):a(o,S(l(D,{children:t({...n,contained:!0})}),c),i)}function k(t,n,e,o){if(e==="hero"){const r=S(t(n),T(o,o.band));return o.band==="full"?l(u,{style:{[Y]:"none",[j]:"initial",[K]:"initial"},children:r}):o.band==="content"?l(u,{style:X(!0),children:r}):r}const i=o.band??"full",c=H(n);if(e==="rawMarkup"){if(o.content==="full")return a(i,t(n),c);const r=o.contentMax===null?_:W(o.contentMax,i);return l(u,{className:"contents",style:{[C]:_},children:a(i,l(u,{className:c||void 0,style:g(r),children:t(n)}),c)})}if(e==="scrollOver"){const r=o.content==="full",d=p(o)?A(o,wt,t({...n,fullWidth:!1})):S(t({...n,fullWidth:r}),r?null:T(o,i));return i==="content"?l(u,{className:"contents",style:{[_t]:_},children:d}):d}switch(e){case"both":return a(i,Tt(t(n),Ct(o,i)),c);case"contained":return P(t,n,o,i,c);case"contentColumn":case"contentFull":case"productGrid":{const r=p(o),d=o.content==="full"&&!r?"full":"page",s=r?A(o,L,t({...n,widthMode:d})):S(t({...n,widthMode:d}),o.content==="full"?null:T(o,i));return e==="productGrid"&&!o.own?i==="content"?l(u,{className:c?`${F} ${c}`:F,children:s}):s:a(i,s,c)}default:return a(i,S(t(n),T(o,i)),c)}}function St(t,n){const e=B[n],o=t.render;t.render=i=>{const c=J(i),r={band:c.background,content:c.content??"content",contentMax:null},d=()=>e==="rawMarkup"?o(i):l(rt,{draw:h=>{const N=h?{...r,band:h.background==="content"?r.band:h.background??r.band,content:h.content??r.content,own:h.background==="full"||h.content!==null,held:!0,siteContent:r.content}:r,R=k(o,i,e,N);if(!w(n))return R;const b=Z(i),I=b===void 0?N.content:b?"content":"full";return I===N.content?R:l(ct,{atTop:R,nested:P(o,i,{...N,content:I,own:!1},N.band??"full",H(i))})}}),s=et(n,i);if(!q(s))return d();const f=e==="rawMarkup",m=s.background??(f?"full":c.background),V=s.content??(f?"full":r.content),x={band:m,content:m==="content"?"content":V,contentMax:s.contentMax,own:!f,siteContent:r.content};return l(dt,{own:()=>l(lt,{value:{background:x.band,content:x.content},children:k(o,i,e,x)}),followed:d})}}const mt={all:[M,{not:{context:"runsEdgeToEdge",is:!0}}]},$t={name:"sectionWidth",applies:(t,n,e)=>z(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.sectionOwnWidthFields({drawsFullOnItsOwn:B[n]==="rawMarkup"}),i=w(n)?e.boxGutterFields():{},c={...t.fields,...i,...o},r=w(n)?y(n,t,c,[Q]):c;E(t,{heldByANode:at}),w(n)&&E(t,{runsEdgeToEdge:d=>nt(d.props??{})}),t.fields=O(r,[v.background,v.content],w(n)?mt:M)},draw(t,n){St(t,n)}};function xt(t,n){if(!t||!("widthMode"in t))return t;const e={...t},o=e.widthMode;return o&&(e.widthMode={...o,currentValue:n.mode,inherited:n.inherited}),e}const Rt=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),Yt={name:"containedWidth",applies:(t,n,e)=>Rt.has(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.widthField;t.fields=y(n,t,{...t.fields,...o("page")});const i=t.resolveFields;t.resolveFields=(c,r)=>{const d=i?i(c,r):r.fields,s=G(c?.props??{},"page"),f=m=>xt(m,s);return d&&typeof d.then=="function"?d.then(f):f(d)}},draw(t){const n=t.render;t.render=e=>{const{mode:o}=G(e,"page");return n({...e,contained:o!=="full"})}}},pt={not:{context:"inHeroGroupRow",is:!0}},Kt={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=O(n.fields??{},["align"],pt),E(n,{inHeroGroupRow:(e,o)=>{const i=st(o.appState,e.props?.id);return!!i&&i.type==="HeroGroup"&&$("HeroGroup",i.props?.direction)==="row"}})}};function At(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const Wt={any:[]},bt={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},It={not:{context:"widthCappedByParent",is:!0}};function y(t,n,e,o=["widthMode"]){if(t==="ButtonBlock")return O(e,["_gWidth",...o],Wt);if(At(e)){const i=(c,r)=>tt(r.appState?.data?.content,c.props?.id,ot(it()));return E(n,{outsideBox:(c,r)=>i(c,r)?.inBox!==!0,insideSiteGutter:(c,r)=>i(c,r)?.insideGutter}),O(e,o,bt)}return E(n,{widthCappedByParent:(i,c)=>"parent"in c?ut(c.parent):ft({props:i.props??{}},c)}),O(e,o,It)}export{_t as SECTION_BACKGROUND_VAR,Ot as SECTION_CONTENT_CAP_CLASS,Et as SECTION_CONTENT_CAP_VAR,Nt as SECTION_CONTENT_CLASS,ht as SECTION_CONTENT_VAR,C as SITE_CONTENT_VAR,Kt as buttonAlignInRow,Yt as containedWidth,$t as sectionWidth,xt as widthModeFields};
1
+ import{jsx as l}from"react/jsx-runtime";import{HideTaker as u}from"../../../components/ViewHideRoot.js";import{INTRO_EDGE_CLASS as K}from"../../../../format/lib/sections/intro-bleed-layout.js";import{resolveContainerDirection as j}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as X,HERO_CHROME_CAP_VAR as q,HERO_CHROME_INSET_VAR as z,FULL_SECTION_WIDTH as J,SITE_WIDTH_CAP as _,centredCap as B,heroBackgroundTokens as Q}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as v,SECTION_WIDTH_KEYS as G,hasOwnSectionWidth as Z,hasWidthFamily as tt,resolveWidth as D,siteWidthsOf as nt}from"../../../../format/lib/content/section-width.js";import{BOX_GUTTER_KEY as et,boxGutterOf as ot,boxPlaceOf as it,boxRunsEdgeToEdge as ct,isFrameContainer as E,ownNodeWidth as rt,siteDrawsGutter as lt}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as dt}from"../../../../format/lib/document/editor-site-widths.js";import{GroundStopsAt as F,NestedBoxChoice as ut,SectionGroupChoice as st,SectionGroupWidthsProvider as at,SectionRootChoice as ft,SplitBandAndColumn as H}from"../../../components/SiteGutterFrame.js";import{FRAME as L}from"../../../components/BlockFrame.js";import{sectionFillPassClass as M}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as ht}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as O,withRowsShownWhen as C}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as _t,heldByANode as Nt,isNestedNode as wt,NOT_HELD_BY_A_NODE as k}from"../../../../format/lib/document/passes/document-position.js";const N="--sf-sw-site",Tt="--sf-sw-content",Et="--sf-bg-cap",Ot="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",A=({own:t,content:n,siteContent:e})=>t===!0&&n==="full"&&e!=="full",P="contents view-wide:[--sf-site-width:100vw]",W=({held:t},n,e)=>t?e:l(u,{className:n,children:e}),Ct=`contents view-wide:[--sf-site-width:100vw] ${K} view-wide:[--sf-site-gutter:var(--intro-edge)]`,p=(t,n)=>n==="content"?`min(${t}px,var(${N}))`:`${t}px`;function S({content:t,contentMax:n},e){return t==="full"?e!=="content"?J:null:n===null?null:p(n,e)}function m(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:_},children:l(u,{className:Ot,style:{[Tt]:n},children:t})})}const St="--sf-content-cap",mt="contents max-view-wide:[--sf-content-cap:none]";function Rt({content:t,contentMax:n},e){return t==="full"?null:n!==null?p(n,e):e==="content"?null:`var(${N})`}function xt(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:_},children:l(u,{className:mt,style:{[St]:n},children:t})})}const y=`var(${N},${_})`,f=(t,n,e="")=>t==="content"?l(u,{className:e||void 0,style:B(_),children:l(F,{ground:y,children:n})}):n;function U(t,n,e,o,i){if(A(e))return f(o,W(e,P,l(H,{children:t({...n,contained:!0})})),i);if(e.content==="full")return f(o,t({...n,contained:!1}),i);const c=S(e,o);return o==="content"&&c===null&&!e.own?t({...n,contained:!0}):f(o,m(l(H,{children:t({...n,contained:!0})}),c),i)}function V(t,n,e,o){if(e==="hero"){const r=m(t(n),S(o,o.band));return o.band==="full"?l(u,{style:{[X]:"none",[z]:"initial",[q]:"initial"},children:r}):o.band==="content"?l(u,{style:Q(!0),children:r}):r}const i=o.band??"full",c=M(n);if(e==="rawMarkup"){if(o.content==="full")return f(i,t(n),c);const r=o.contentMax===null?_:p(o.contentMax,i);return l(u,{className:"contents",style:{[N]:_},children:f(i,l(u,{className:c||void 0,style:B(r),children:t(n)}),c)})}if(e==="scrollOver"){const r=o.content==="full",d=A(o)?W(o,Ct,t({...n,fullWidth:!1})):m(t({...n,fullWidth:r}),r?null:S(o,i));return i==="content"?l(u,{className:"contents",style:{[Et]:_},children:d}):d}switch(e){case"both":return f(i,xt(t(n),Rt(o,i)),c);case"contained":return U(t,n,o,i,c);case"contentColumn":case"contentFull":case"productGrid":{const r=A(o),d=o.content==="full"&&!r?"full":"page",a=r?W(o,P,t({...n,widthMode:d})):m(t({...n,widthMode:d}),o.content==="full"?null:S(o,i));return e==="productGrid"&&!o.own?i==="content"?l(u,{className:c?`${L} ${c}`:L,children:a}):a:f(i,a,c)}default:return f(i,m(t(n),S(o,i)),c)}}function At(t,n){const e=v[n],o=t.render;t.render=i=>{const c=nt(i),r={band:c.background,content:c.content??"content",contentMax:null},d=()=>e==="rawMarkup"?o(i):l(st,{draw:s=>s?.background==="content"?l(F,{ground:y,children:a(s)}):a(s)}),a=s=>{const T=s?{...r,band:s.background==="content"?r.band:s.background??r.band,content:s.content??r.content,own:s.background==="full"||s.content!==null,held:!0,siteContent:r.content}:r,x=V(o,i,e,T);if(!E(n))return x;const b=ot(i),g=b===void 0?T.content:b?"content":"full";return g===T.content?x:l(ut,{atTop:x,nested:U(o,i,{...T,content:g,own:!1},T.band??"full",M(i))})},h=rt(n,i);if(!Z(h))return d();const w=e==="rawMarkup",I=h.background??(w?"full":c.background),Y=h.content??(w?"full":r.content),R={band:I,content:I==="content"?"content":Y,contentMax:h.contentMax,own:!w,siteContent:r.content};return l(ft,{own:()=>l(at,{value:{background:R.band,content:R.content},children:V(o,i,e,R)}),followed:d})}}const Wt={all:[k,{not:{context:"runsEdgeToEdge",is:!0}}]},Xt={name:"sectionWidth",applies:(t,n,e)=>tt(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.sectionOwnWidthFields({drawsFullOnItsOwn:v[n]==="rawMarkup"}),i=E(n)?e.boxGutterFields():{},c={...t.fields,...i,...o},r=E(n)?$(n,t,c,[et]):c;O(t,{heldByANode:Nt}),E(n)&&O(t,{runsEdgeToEdge:d=>ct(d.props??{})}),t.fields=C(r,[G.background,G.content],E(n)?Wt:k)},draw(t,n){At(t,n)}};function pt(t,n){if(!t||!("widthMode"in t))return t;const e={...t},o=e.widthMode;return o&&(e.widthMode={...o,currentValue:n.mode,inherited:n.inherited}),e}const It=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),qt={name:"containedWidth",applies:(t,n,e)=>It.has(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.widthField;t.fields=$(n,t,{...t.fields,...o("page")});const i=t.resolveFields;t.resolveFields=(c,r)=>{const d=i?i(c,r):r.fields,a=D(c?.props??{},"page"),h=w=>pt(w,a);return d&&typeof d.then=="function"?d.then(h):h(d)}},draw(t){const n=t.render;t.render=e=>{const{mode:o}=D(e,"page");return n({...e,contained:o!=="full"})}}},bt={not:{context:"inHeroGroupRow",is:!0}},zt={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=C(n.fields??{},["align"],bt),O(n,{inHeroGroupRow:(e,o)=>{const i=_t(o.appState,e.props?.id);return!!i&&i.type==="HeroGroup"&&j("HeroGroup",i.props?.direction)==="row"}})}};function gt(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const Bt={any:[]},vt={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},Gt={not:{context:"widthCappedByParent",is:!0}};function $(t,n,e,o=["widthMode"]){if(t==="ButtonBlock")return C(e,["_gWidth",...o],Bt);if(gt(e)){const i=(c,r)=>it(r.appState?.data?.content,c.props?.id,lt(dt()));return O(n,{outsideBox:(c,r)=>i(c,r)?.inBox!==!0,insideSiteGutter:(c,r)=>i(c,r)?.insideGutter}),C(e,o,vt)}return O(n,{widthCappedByParent:(i,c)=>"parent"in c?ht(c.parent):wt({props:i.props??{}},c)}),C(e,o,Gt)}export{Et as SECTION_BACKGROUND_VAR,mt as SECTION_CONTENT_CAP_CLASS,St as SECTION_CONTENT_CAP_VAR,Ot as SECTION_CONTENT_CLASS,Tt as SECTION_CONTENT_VAR,N as SITE_CONTENT_VAR,zt as buttonAlignInRow,qt as containedWidth,Xt as sectionWidth,pt as widthModeFields};
@@ -0,0 +1,3 @@
1
+ export declare const WALL_LABEL_ID_PROP = "_wallLabelId";
2
+ export declare const WALL_LABELLED_BY_PROP = "_wallLabelledBy";
3
+ export declare function markWallLabels<T>(data: T): T;
@@ -0,0 +1 @@
1
+ import{isNodeList as i}from"efficient-easel/data";import{readHidable as f}from"efficient-easel/draw";const a="_wallLabelId",u="_wallLabelledBy",s=t=>t.props?.id==null?"":String(t.props.id);function L(t){if(!t||t.type!=="Text"||!s(t))return!1;const o=f(t.props?.text);return!o.hidden&&o.text.trim()!==""}const m=t=>!!t&&t.type==="Logos"&&t.props?.look==="marks"&&s(t)!=="",l=(t,o,e)=>({...t,props:{...t.props,[o]:e}});function p(t){let o=null;t.forEach((r,n)=>{const c=d(r);c!==r&&((o??=t.slice())[n]=c)});const e=o??t;for(let r=1;r<e.length;r++){if(!m(e[r])||!L(e[r-1]))continue;const n=`sf-wall-label-${s(e[r-1])}`;o??=t.slice(),o[r-1]=l(o[r-1],a,n),o[r]=l(o[r],u,n)}return o??t}function d(t){let o;for(const[e,r]of Object.entries(t.props??{})){if(!i(r))continue;const n=p(r);n!==r&&((o??={...t.props})[e]=n)}return o?{...t,props:o}:t}function x(t){const o=t;if(!o||!Array.isArray(o.content))return t;const e=p(o.content);return e===o.content?t:{...o,content:e}}export{u as WALL_LABELLED_BY_PROP,a as WALL_LABEL_ID_PROP,x as markWallLabels};
@@ -180,6 +180,7 @@ export declare function sectionBoxIdOf(oldId: string, piece: number): string;
180
180
  export declare function registerBoxNativeSections(types: Readonly<Record<string, string>>): void;
181
181
  export declare function boxNativeReason(type: string): string | undefined;
182
182
  export declare const SECTION_TO_BOX_ON: readonly string[];
183
+ export declare const HOST_PRESS_TYPES: readonly string[];
183
184
  export declare const SECTION_TO_BOX_PRESS: readonly string[];
184
185
  export declare function registerSectionToBox(rows: Readonly<Record<string, SectionToBoxRow>>): void;
185
186
  export declare function sectionToBoxRow(type: string): SectionToBoxRow | undefined;
@@ -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{accentItalicRuns as re}from"../../../format/lib/markup.js";import{seedNodes as ie}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ae}from"../../../format/lib/locations-grid.js";import{normalizeTheme as G}from"../../../format/lib/theme.js";const E=ee,v=te;function Be(t){if(t.theme)return G(t.theme);const o=t.site?.themePresets;return o?G({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ce(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), and its Scrolling Bar is a Box in its strip slot (Hero › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function Te(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 _e(t){return A[t]}const V=new Set(["id"]),T={},z=[],fe=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ","ProductGrid","Stats","Logos","PaymentBadges","FitmentFinder","DocMasthead","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Countdown","FeaturedCover","Cards"];function Pe(t){for(const[o,r]of Object.entries(t)){if(o in T&&T[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=r}}function Ee(t){return T[t]}function ve(){return Object.keys(T)}function de(t){return t in T&&z.includes(t)}function je(t,o=fe){return t in T&&(o.includes(t)||de(t))}function Ne(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 H=t=>Z(t),Ie=t=>H(t).text.trim()!=="";function le(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 m=r.indexOf(i);return`${r.slice(0,m)}==${i}==${r.slice(m+i.length)}${o===-1?"":t.slice(o)}`}const pe=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function ue(t,o,r,i){const a={...t._partStyles?.text??{},...o??{},...r??{}};return(i==="center"||i==="right")&&a.align===void 0&&(a.align=i),Object.keys(a).length?{_partStyles:{text:a}}:{}}function he(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 Y(t,o,r,i,m={}){const a={...o};for(const h of t){const[k,B,j]=typeof h=="string"?[h,h,void 0]:h;if(r[k]===void 0)continue;const _=j?j(r[k],r,m):r[k];_===void 0?delete a[B]:a[B]=_,i(k,B,_===void 0)}return a}function ye(t){const o=new Set([...V,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),r=m=>{for(const a of m??[])o.add(typeof a=="string"?a:a[0])},i=m=>{for(const a of m)switch(a.kind){case"text":case"image":o.add(a.key),a.kind==="image"&&a.alt&&o.add(a.alt);break;case"button":o.add(a.key),o.add(a.href),typeof a.variant=="object"&&o.add(a.variant.key);break;case"list":o.add(a.key);break;case"group":case"block":r(a.box),i(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(h=>o.add(h)),Object.keys(a.rename??{}).forEach(h=>o.add(h)),a.derive?.reads.forEach(h=>o.add(h)),typeof a.slots!="function")for(const h of Object.values(a.slots??{}))for(const k of h)"kind"in k&&o.add(k.key);break}};for(const m of[t,...t.also??[]])r(m.box),i(m.parts);return o}function Q(t,o,r={}){const i=t.props,m=o.skip?.(i);if(m!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:m};const a=String(i.id??t.type),h=[],k=[],B=[],j=new Set,_=(n,s)=>{h.push({key:n,home:s}),j.add(n)},M=i._partStyles??{},C=ye(o);let X=0;const $=(n,s)=>({type:n,props:{...s,id:`${a}~${n}-${++X}`}}),K=(n,s,b,y,g,d,w)=>{if(g){for(const c of n??[]){const p=typeof c=="string"?c:c[0];b[p]!==void 0&&w(p,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(i,r):s??{};return Y(n??[],e,b,(c,p,f)=>w(c,f?`nothing — the old value draws nothing (${y}: no ${p})`:`${d}${y}: ${p}`),r)},q=n=>ie(n,s=>`${a}~${s}-${++X}`),W=(n,s,b)=>{const y=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],g=typeof n.props=="function"?n.props(i,r):n.props??{},d=y.map((f,x)=>{const l=f??{},u=n.item?.(l,x,i)??{},O=N(u.reverse?[...n.parts].reverse():n.parts,l,!1,`item ${x+1}: `);return n.flat?u.props?O.map(P=>({...P,props:{...P.props,...u.props,id:P.props.id}})):O:[$(E,{name:`${n.name} ${x+1}`,...g,...u.props??{},[v]:O})]});if(n.groups){const f=n.groups;return b(n.key,y.length?`one Box per item (${y.length}), in a Box per group`:"nothing — the list is empty"),ae(y.map(x=>x??{}),f.of,f.of).map((x,l)=>{const u=x.items.map(S=>S.item),O=f.parts?N(f.parts,f.head?.(u,i)??{},!1,`group ${l+1}: `):[],P=x.items.map(S=>d[S.index]),L=f.perRow?.(u.length,i),I=Number.isInteger(L)&&L>=1?L:1,F=[];if(f.perRow&&I<P.length)for(let S=0;S*I<P.length;S++)F.push(P.slice(S*I,(S+1)*I).flat());return $(E,{name:`${f.name} ${l+1}`,...f.props??{},[v]:[...O,$(E,{name:`${f.itemsName} ${l+1}`,...f.itemsProps?.(u.length,i)??{},[v]:F.length?F.map((S,U)=>$(E,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[v]:S})):P.flat()})]})})}const w=n.perRow?.(i),e=n.perRow?Number.isInteger(w)&&w>=1?w:1:0;if(b(n.key,(y.length?n.flat?`each item's parts (${y.length} items), in order`:`one Box per item (${y.length}), its parts inside`:"nothing — the list is empty")+(e&&y.length?`, in rows of ${e}`:"")),!e)return d.flat();const c=typeof n.rowProps=="function"?n.rowProps(i,r):n.rowProps??{},p=[];for(let f=0;f*e<d.length;f++){const x=d.slice(f*e,(f+1)*e).flat(),l=n.rowFiller?e-d.slice(f*e,(f+1)*e).length:0;p.push($(E,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...c,[v]:[...x,...Array.from({length:l},(u,O)=>$(E,{name:`Empty ${O+1}`,...n.rowFiller,[v]:[]}))]}))}return p},N=(n,s,b,y)=>{const g=[],d=(e,c)=>b?_(e,c):void 0,w=e=>b?M[e]:void 0;for(const e of n)if(!(e.when&&!e.when(i,b?void 0:s)))switch(e.kind){case"text":{const c=H(s[e.key]);if(!c.text.trim()&&!(b&&r.press&&o.pressKeepsEmpty?.includes(e.key))){d(e.key,"nothing — empty words draw nothing, so no block");break}const p=pe(e.role??"body"),{_partStyles:f,...x}=p,l=ue(p,e.styleFrom?{...e.style,...e.styleFrom(i,r)}:e.style,w(e.key),e.props?.align);if(e.was&&b){const u=l._partStyles?.text??{};B.push({key:e.key,was:e.was,...typeof u.textStyle=="string"?{textStyle:u.textStyle}:{},...R(u.size)!==void 0?{size:R(u.size)}:{},...R(u.sizePhone)!==void 0?{sizePhone:R(u.sizePhone)}:{}})}g.push($("Text",{text:e.mark==="accentLead"?le(c.text):e.mark==="accentItalic"?re(c.text):c.text,...x,...e.props??{},...l,...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Text block: its words${c.hidden?", hidden":""}`);break}case"button":{const c=H(s[e.key]);if(!c.text.trim()){d(e.key,"nothing — no words, no button"),d(e.href,"nothing — no button to link"),typeof e.variant=="object"&&d(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??{},...w(e.key)??{}};g.push($("ButtonBlock",{label:c.text,href:p,...typeof e.props=="function"?e.props(s,r):e.props??{},...he(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Button block: its words`),d(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&d(e.variant.key,`${y}Button block: its Style`);break}case"image":{const c=s[e.key];if(typeof c!="string"||!c){d(e.key,"nothing — no picture, no block"),e.alt&&d(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";g.push($("ImageBlock",{src:c,alt:p,...e.props??{}})),d(e.key,`${y}Image block: its picture`),e.alt&&d(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...W(e,s,d));break}case"group":{const c=N(e.parts,s,b,y),p=K(e.box,e.props,s,`${e.name} Box`,!c.length&&!e.keepEmpty,y,d);p&&g.push($(E,{name:e.name,...p,[v]:c}));break}case"block":{const c=e.parts?N(e.parts,s,b,y):[],p=K(e.box,e.props,s,`${e.type} block`,!!e.parts&&!c.length&&!e.keepEmpty,y,d);p&&g.push($(e.type,{...p,...e.slot?{[e.slot]:c}:{}}));break}case"core":{const c=e.as??t.type,p={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(l=>!C.has(l)&&!(l in p)):e.keep;for(const l of f)s[l]!==void 0&&(p[l]=s[l],d(l,`the ${c} block inside the Box`));if(e.keep==="rest"){for(const u of Object.keys(e.props??{}))s[u]!==void 0&&!C.has(u)&&d(u,`nothing — the ${c} block inside the Box has the row's own value`);s.headPlacement!==void 0&&d("headPlacement",`the ${c} block inside the Box: own-box`);const l=Object.fromEntries(Object.entries(M).filter(([u])=>!C.has(u)));Object.keys(l).length&&(p._partStyles=l)}for(const[l,u]of Object.entries(e.rename??{}))s[l]!==void 0&&(p[u]=s[l],d(l,`the ${c} block inside the Box: ${u}`));if(e.derive){Object.assign(p,e.derive.props(s,r));for(const l of e.derive.reads)s[l]!==void 0&&d(l,`the ${c} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(s,r):e.slots??{};for(const[l,u]of Object.entries(x))p[l]=u.flatMap(O=>"kind"in O?W(O,s,d):q([O]));g.push($(c,p));break}}return g},J=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,y=N(n.parts,i,!0,s===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(i,r):n.boxProps??{},d=Y(n.box??[],g,i,(w,e,c)=>_(w,c?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),r);return{type:E,props:{name:n.name,...d,[v]:y,id:ce(a,s)}}},D=[o,...o.also??[]].map(J);i._partStyles!==void 0&&_("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))i[n]!==void 0&&_(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in i&&(k.push({key:n,why:s}),j.add(n));for(const n of Object.keys(i))V.has(n)||j.has(n)||k.push({key:n,why:"not in the row — not carried"});return{node:D[0],nodes:D,carried:h,dropped:k,siteWrites:[...o.site?.(t,r)??[]],restyled:B}}function Re(t,o=z,r={}){const i=t.content;if(!Array.isArray(i))return t;let m=!1;const a=i.flatMap(h=>{const k=h&&typeof h.type=="string"&&o.includes(h.type)?T[h.type]:void 0;if(!k)return[h];const B=Q(h,k,r);return B.skipped!==void 0?[h]:(m=!0,B.nodes)});return m?{...t,content:a}:t}function Ae(t,o=z,r={}){if(!Array.isArray(t))return[];const i=[];return t.forEach((m,a)=>{const h=m&&typeof m.type=="string"&&o.includes(m.type)?T[m.type]:void 0;if(!h)return;const k=Q(m,h,r);k.skipped===void 0&&i.push({index:a,node:k.node,nodes:k.nodes})}),i}export{v as SECTION_BOX_SLOT,E as SECTION_BOX_TYPE,z as SECTION_TO_BOX_ON,fe as SECTION_TO_BOX_PRESS,_e as boxNativeReason,Q as convertSection,Re as convertSectionsInPage,Be as convertTheme,de as convertsToBox,Ie as hasWords,Ne as headParts,je as pressesAsBox,Te as registerBoxNativeSections,Pe as registerSectionToBox,ce as sectionBoxIdOf,Ae as sectionToBoxEdits,Ee as sectionToBoxRow,ve 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{accentItalicRuns as ie}from"../../../format/lib/markup.js";import{seedNodes as re}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ae}from"../../../format/lib/locations-grid.js";import{normalizeTheme as G}from"../../../format/lib/theme.js";const E=ee,v=te;function Te(t){if(t.theme)return G(t.theme);const o=t.site?.themePresets;return o?G({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ce(t,o){return o===0?`${t}~box`:`${t}~box-${o+1}`}const C={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box), and its Scrolling Bar is a Box in its strip slot (Hero › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function Pe(t){for(const[o,i]of Object.entries(t)){if(o in C&&C[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);C[o]=i}}function _e(t){return C[t]}const Y=new Set(["id"]),T={},z=[],fe=["ProductGrid","Events","ContactRouting","ReviewForm","AppointmentBooking","Reviews","CheckoutCTA"],de=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ",...fe,"Stats","Logos","PaymentBadges","PaymentLogosBlock","FitmentFinder","DocMasthead","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Countdown","FeaturedCover","Cards"];function Ee(t){for(const[o,i]of Object.entries(t)){if(o in T&&T[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=i}}function ve(t){return T[t]}function je(){return Object.keys(T)}function le(t){return t in T&&z.includes(t)}function Ne(t,o=de){return t in T&&(o.includes(t)||le(t))}function Ie(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&i.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const H=t=>Z(t),Re=t=>H(t).text.trim()!=="";function pe(t){if(t.includes("=="))return t;const o=t.indexOf("/"),i=o===-1?t:t.slice(0,o),r=i.trim();if(!r)return t;const m=i.indexOf(r);return`${i.slice(0,m)}==${r}==${i.slice(m+r.length)}${o===-1?"":t.slice(o)}`}const ue=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function he(t,o,i,r){const a={...t._partStyles?.text??{},...o??{},...i??{}};return(r==="center"||r==="right")&&a.align===void 0&&(a.align=r),Object.keys(a).length?{_partStyles:{text:a}}:{}}function ye(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const i=o[t.key];return{variant:typeof i=="string"&&Object.hasOwn(t.map,i)?t.map[i]:t.fallback}}function V(t,o,i,r,m={}){const a={...o};for(const h of t){const[k,B,j]=typeof h=="string"?[h,h,void 0]:h;if(i[k]===void 0)continue;const P=j?j(i[k],i,m):i[k];P===void 0?delete a[B]:a[B]=P,r(k,B,P===void 0)}return a}function me(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),i=m=>{for(const a of m??[])o.add(typeof a=="string"?a:a[0])},r=m=>{for(const a of m)switch(a.kind){case"text":case"image":o.add(a.key),a.kind==="image"&&a.alt&&o.add(a.alt);break;case"button":o.add(a.key),o.add(a.href),typeof a.variant=="object"&&o.add(a.variant.key);break;case"list":o.add(a.key);break;case"group":case"block":i(a.box),r(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(h=>o.add(h)),Object.keys(a.rename??{}).forEach(h=>o.add(h)),a.derive?.reads.forEach(h=>o.add(h)),typeof a.slots!="function")for(const h of Object.values(a.slots??{}))for(const k of h)"kind"in k&&o.add(k.key);break}};for(const m of[t,...t.also??[]])i(m.box),r(m.parts);return o}function Q(t,o,i={}){const r=t.props,m=o.skip?.(r);if(m!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:m};const a=String(r.id??t.type),h=[],k=[],B=[],j=new Set,P=(n,s)=>{h.push({key:n,home:s}),j.add(n)},M=r._partStyles??{},A=me(o);let X=0;const $=(n,s)=>({type:n,props:{...s,id:`${a}~${n}-${++X}`}}),K=(n,s,b,y,g,d,w)=>{if(g){for(const c of n??[]){const p=typeof c=="string"?c:c[0];b[p]!==void 0&&w(p,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(r,i):s??{};return V(n??[],e,b,(c,p,f)=>w(c,f?`nothing — the old value draws nothing (${y}: no ${p})`:`${d}${y}: ${p}`),i)},q=n=>re(n,s=>`${a}~${s}-${++X}`),W=(n,s,b)=>{const y=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],g=typeof n.props=="function"?n.props(r,i):n.props??{},d=y.map((f,x)=>{const l=f??{},u=n.item?.(l,x,r)??{},S=N(u.reverse?[...n.parts].reverse():n.parts,l,!1,`item ${x+1}: `);return n.flat?u.props?S.map(_=>({..._,props:{..._.props,...u.props,id:_.props.id}})):S:[$(E,{name:`${n.name} ${x+1}`,...g,...u.props??{},[v]:S})]});if(n.groups){const f=n.groups;return b(n.key,y.length?`one Box per item (${y.length}), in a Box per group`:"nothing — the list is empty"),ae(y.map(x=>x??{}),f.of,f.of).map((x,l)=>{const u=x.items.map(O=>O.item),S=f.parts?N(f.parts,f.head?.(u,r)??{},!1,`group ${l+1}: `):[],_=x.items.map(O=>d[O.index]),L=f.perRow?.(u.length,r),I=Number.isInteger(L)&&L>=1?L:1,F=[];if(f.perRow&&I<_.length)for(let O=0;O*I<_.length;O++)F.push(_.slice(O*I,(O+1)*I).flat());return $(E,{name:`${f.name} ${l+1}`,...f.props??{},[v]:[...S,$(E,{name:`${f.itemsName} ${l+1}`,...f.itemsProps?.(u.length,r)??{},[v]:F.length?F.map((O,U)=>$(E,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[v]:O})):_.flat()})]})})}const w=n.perRow?.(r),e=n.perRow?Number.isInteger(w)&&w>=1?w:1:0;if(b(n.key,(y.length?n.flat?`each item's parts (${y.length} items), in order`:`one Box per item (${y.length}), its parts inside`:"nothing — the list is empty")+(e&&y.length?`, in rows of ${e}`:"")),!e)return d.flat();const c=typeof n.rowProps=="function"?n.rowProps(r,i):n.rowProps??{},p=[];for(let f=0;f*e<d.length;f++){const x=d.slice(f*e,(f+1)*e).flat(),l=n.rowFiller?e-d.slice(f*e,(f+1)*e).length:0;p.push($(E,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...c,[v]:[...x,...Array.from({length:l},(u,S)=>$(E,{name:`Empty ${S+1}`,...n.rowFiller,[v]:[]}))]}))}return p},N=(n,s,b,y)=>{const g=[],d=(e,c)=>b?P(e,c):void 0,w=e=>b?M[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:s)))switch(e.kind){case"text":{const c=H(s[e.key]);if(!c.text.trim()&&!(b&&i.press&&o.pressKeepsEmpty?.includes(e.key))){d(e.key,"nothing — empty words draw nothing, so no block");break}const p=ue(e.role??"body"),{_partStyles:f,...x}=p,l=he(p,e.styleFrom?{...e.style,...e.styleFrom(r,i)}:e.style,w(e.key),e.props?.align);if(e.was&&b){const u=l._partStyles?.text??{};B.push({key:e.key,was:e.was,...typeof u.textStyle=="string"?{textStyle:u.textStyle}:{},...R(u.size)!==void 0?{size:R(u.size)}:{},...R(u.sizePhone)!==void 0?{sizePhone:R(u.sizePhone)}:{}})}g.push($("Text",{text:e.mark==="accentLead"?pe(c.text):e.mark==="accentItalic"?ie(c.text):c.text,...x,...e.props??{},...l,...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Text block: its words${c.hidden?", hidden":""}`);break}case"button":{const c=H(s[e.key]);if(!c.text.trim()){d(e.key,"nothing — no words, no button"),d(e.href,"nothing — no button to link"),typeof e.variant=="object"&&d(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??{},...w(e.key)??{}};g.push($("ButtonBlock",{label:c.text,href:p,...typeof e.props=="function"?e.props(s,i):e.props??{},...ye(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Button block: its words`),d(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&d(e.variant.key,`${y}Button block: its Style`);break}case"image":{const c=s[e.key];if(typeof c!="string"||!c){d(e.key,"nothing — no picture, no block"),e.alt&&d(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";g.push($("ImageBlock",{src:c,alt:p,...e.props??{}})),d(e.key,`${y}Image block: its picture`),e.alt&&d(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...W(e,s,d));break}case"group":{const c=N(e.parts,s,b,y),p=K(e.box,e.props,s,`${e.name} Box`,!c.length&&!e.keepEmpty,y,d);p&&g.push($(E,{name:e.name,...p,[v]:c}));break}case"block":{const c=e.parts?N(e.parts,s,b,y):[],p=K(e.box,e.props,s,`${e.type} block`,!!e.parts&&!c.length&&!e.keepEmpty,y,d);p&&g.push($(e.type,{...p,...e.slot?{[e.slot]:c}:{}}));break}case"core":{const c=e.as??t.type,p={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(l=>!A.has(l)&&!(l in p)):e.keep;for(const l of f)s[l]!==void 0&&(p[l]=s[l],d(l,`the ${c} block inside the Box`));if(e.keep==="rest"){for(const u of Object.keys(e.props??{}))s[u]!==void 0&&!A.has(u)&&d(u,`nothing — the ${c} block inside the Box has the row's own value`);s.headPlacement!==void 0&&d("headPlacement",`the ${c} block inside the Box: own-box`);const l=Object.fromEntries(Object.entries(M).filter(([u])=>!A.has(u)));Object.keys(l).length&&(p._partStyles=l)}for(const[l,u]of Object.entries(e.rename??{}))s[l]!==void 0&&(p[u]=s[l],d(l,`the ${c} block inside the Box: ${u}`));if(e.derive){Object.assign(p,e.derive.props(s,i));for(const l of e.derive.reads)s[l]!==void 0&&d(l,`the ${c} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(s,i):e.slots??{};for(const[l,u]of Object.entries(x))p[l]=u.flatMap(S=>"kind"in S?W(S,s,d):q([S]));g.push($(c,p));break}}return g},J=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,y=N(n.parts,r,!0,s===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,i):n.boxProps??{},d=V(n.box??[],g,r,(w,e,c)=>P(w,c?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),i);return{type:E,props:{name:n.name,...d,[v]:y,id:ce(a,s)}}},D=[o,...o.also??[]].map(J);r._partStyles!==void 0&&P("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))r[n]!==void 0&&P(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in r&&(k.push({key:n,why:s}),j.add(n));for(const n of Object.keys(r))Y.has(n)||j.has(n)||k.push({key:n,why:"not in the row — not carried"});return{node:D[0],nodes:D,carried:h,dropped:k,siteWrites:[...o.site?.(t,i)??[]],restyled:B}}function Ce(t,o=z,i={}){const r=t.content;if(!Array.isArray(r))return t;let m=!1;const a=r.flatMap(h=>{const k=h&&typeof h.type=="string"&&o.includes(h.type)?T[h.type]:void 0;if(!k)return[h];const B=Q(h,k,i);return B.skipped!==void 0?[h]:(m=!0,B.nodes)});return m?{...t,content:a}:t}function Ae(t,o=z,i={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((m,a)=>{const h=m&&typeof m.type=="string"&&o.includes(m.type)?T[m.type]:void 0;if(!h)return;const k=Q(m,h,i);k.skipped===void 0&&r.push({index:a,node:k.node,nodes:k.nodes})}),r}export{fe as HOST_PRESS_TYPES,v as SECTION_BOX_SLOT,E as SECTION_BOX_TYPE,z as SECTION_TO_BOX_ON,de as SECTION_TO_BOX_PRESS,_e as boxNativeReason,Q as convertSection,Ce as convertSectionsInPage,Te as convertTheme,le as convertsToBox,Re as hasWords,Ie as headParts,Ne as pressesAsBox,Pe as registerBoxNativeSections,Ee as registerSectionToBox,ce as sectionBoxIdOf,Ae as sectionToBoxEdits,ve as sectionToBoxRow,je as sectionToBoxTypes};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "59.0.0",
3
+ "version": "59.2.0",
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",