efficient-web-builder 59.2.0 → 60.0.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 (153) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/editor/components/SectionThumbnail.js +1 -1
  3. package/dist/editor/components/storefront-editor.css +21 -7
  4. package/dist/editor/lib/animation/fields.js +1 -1
  5. package/dist/editor/lib/animation/hover-fields.js +1 -1
  6. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  7. package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
  8. package/dist/editor/lib/document/blocks/general/ListSearch/fields.js +1 -1
  9. package/dist/editor/lib/document/canvas-typing.js +1 -1
  10. package/dist/editor/lib/document/card-display-chips.d.ts +4 -2
  11. package/dist/editor/lib/document/card-display-chips.js +1 -1
  12. package/dist/editor/lib/document/card-row-fields.d.ts +3 -1
  13. package/dist/editor/lib/document/card-row-fields.js +1 -1
  14. package/dist/editor/lib/document/controls.js +1 -1
  15. package/dist/editor/lib/document/field-groups.js +1 -1
  16. package/dist/editor/lib/document/mirror-cards-field.js +1 -1
  17. package/dist/format/lib/animation/hover.d.ts +23 -1
  18. package/dist/format/lib/animation/hover.js +1 -1
  19. package/dist/format/lib/content/block-align.d.ts +3 -1
  20. package/dist/format/lib/content/block-align.js +1 -1
  21. package/dist/format/lib/content/box-background.d.ts +7 -0
  22. package/dist/format/lib/content/box-background.js +1 -1
  23. package/dist/format/lib/content/box-card-rule.d.ts +7 -0
  24. package/dist/format/lib/content/box-card-rule.js +1 -0
  25. package/dist/format/lib/content/box-layout.js +1 -1
  26. package/dist/format/lib/content/box-phone-place.d.ts +4 -4
  27. package/dist/format/lib/content/box-phone-place.js +1 -1
  28. package/dist/format/lib/content/box-shape.d.ts +1 -1
  29. package/dist/format/lib/content/box-shape.js +1 -1
  30. package/dist/format/lib/content/box-side-space.d.ts +2 -1
  31. package/dist/format/lib/content/box-side-space.js +1 -1
  32. package/dist/format/lib/content/button-icon.d.ts +3 -1
  33. package/dist/format/lib/content/button-icon.js +1 -1
  34. package/dist/format/lib/content/card-template.d.ts +9 -1
  35. package/dist/format/lib/content/card-template.js +1 -1
  36. package/dist/format/lib/content/cell-picture-sizes.js +1 -1
  37. package/dist/format/lib/content/footprint.d.ts +2 -0
  38. package/dist/format/lib/content/footprint.js +1 -1
  39. package/dist/format/lib/content/gallery-card-layout.d.ts +6 -1
  40. package/dist/format/lib/content/gallery-card-layout.js +1 -1
  41. package/dist/format/lib/content/hover-media.d.ts +30 -0
  42. package/dist/format/lib/content/hover-media.js +1 -0
  43. package/dist/format/lib/content/image-aspect.d.ts +3 -3
  44. package/dist/format/lib/content/image-aspect.js +1 -1
  45. package/dist/format/lib/content/ink.d.ts +3 -0
  46. package/dist/format/lib/content/ink.js +1 -1
  47. package/dist/format/lib/content/list-position.d.ts +3 -0
  48. package/dist/format/lib/content/list-position.js +1 -0
  49. package/dist/format/lib/content/list-query.d.ts +2 -0
  50. package/dist/format/lib/content/list-query.js +1 -1
  51. package/dist/format/lib/content/mirror-cards.d.ts +3 -0
  52. package/dist/format/lib/content/mirror-cards.js +1 -1
  53. package/dist/format/lib/content/part-display.d.ts +2 -1
  54. package/dist/format/lib/content/part-display.js +1 -1
  55. package/dist/format/lib/content/site-gutter.d.ts +2 -0
  56. package/dist/format/lib/content/site-gutter.js +1 -1
  57. package/dist/format/lib/content/view-hide-class.d.ts +5 -2
  58. package/dist/format/lib/content/view-hide-class.js +1 -1
  59. package/dist/format/lib/content/view-lines.d.ts +2 -1
  60. package/dist/format/lib/content/view-lines.js +1 -1
  61. package/dist/format/lib/document/blocks/general/Footprint/card-seed.d.ts +3 -0
  62. package/dist/format/lib/document/blocks/general/Footprint/card-seed.js +1 -1
  63. package/dist/format/lib/document/blocks/general/text-part-shapes.json +7 -0
  64. package/dist/format/lib/document/card-content-switch.js +1 -1
  65. package/dist/format/lib/document/panel-only.d.ts +2 -0
  66. package/dist/format/lib/document/panel-only.js +1 -0
  67. package/dist/format/lib/document/row-hand.js +1 -1
  68. package/dist/format/lib/document/section-catalog.d.ts +2 -1
  69. package/dist/format/lib/document/section-catalog.js +10 -10
  70. package/dist/format/lib/document/section-descriptions.js +1 -1
  71. package/dist/format/lib/document/seed-shape.d.ts +2 -0
  72. package/dist/format/lib/document/seed-shape.js +1 -0
  73. package/dist/format/lib/editor-words-catalogue.d.ts +21 -0
  74. package/dist/format/lib/editor-words-catalogue.js +4 -4
  75. package/dist/format/lib/editor-words-kept.js +1 -1
  76. package/dist/format/lib/fit-words.d.ts +1 -0
  77. package/dist/format/lib/fit-words.js +9 -8
  78. package/dist/format/lib/sized-image.js +1 -1
  79. package/dist/format/lib/source-rules/one-phone-edge.d.ts +13 -0
  80. package/dist/format/lib/source-rules/one-phone-edge.js +8 -0
  81. package/dist/format/lib/source-rules/published-mounts.d.ts +22 -0
  82. package/dist/format/lib/source-rules/published-mounts.js +58 -0
  83. package/dist/format/lib/source-rules/support/panel-select-cascade.js +1 -2
  84. package/dist/format/lib/source-rules/support/ts-program.d.ts +4 -0
  85. package/dist/format/lib/source-rules/support/ts-program.js +2 -0
  86. package/dist/format/lib/theme.d.ts +1 -0
  87. package/dist/format/lib/theme.js +3 -3
  88. package/dist/render/components/ButtonBlock.js +1 -1
  89. package/dist/render/components/CardRowContext.d.ts +5 -2
  90. package/dist/render/components/CardRowContext.js +1 -1
  91. package/dist/render/components/DealerFinder.js +1 -1
  92. package/dist/render/components/Eyebrow.js +1 -1
  93. package/dist/render/components/Flex.d.ts +2 -1
  94. package/dist/render/components/Flex.js +1 -1
  95. package/dist/render/components/Footprint.js +1 -1
  96. package/dist/render/components/HeroArrows.d.ts +6 -3
  97. package/dist/render/components/HeroArrows.js +1 -1
  98. package/dist/render/components/HeroPictures.js +1 -1
  99. package/dist/render/components/HoverMediaLayer.d.ts +9 -0
  100. package/dist/render/components/HoverMediaLayer.js +1 -0
  101. package/dist/render/components/InBoxContext.d.ts +3 -0
  102. package/dist/render/components/InBoxContext.js +1 -1
  103. package/dist/render/components/ListSearchBox.d.ts +2 -1
  104. package/dist/render/components/ListSearchBox.js +1 -1
  105. package/dist/render/components/LogoBlock.js +1 -1
  106. package/dist/render/components/Logos.js +1 -1
  107. package/dist/render/components/PublishedPartStylesContext.d.ts +2 -1
  108. package/dist/render/components/PublishedPartStylesContext.js +1 -1
  109. package/dist/render/components/SectionAnimation.d.ts +4 -2
  110. package/dist/render/components/SectionAnimation.js +1 -1
  111. package/dist/render/components/SideListLayout.d.ts +14 -0
  112. package/dist/render/components/SideListLayout.js +1 -0
  113. package/dist/render/components/Split.js +1 -1
  114. package/dist/render/components/Text.js +1 -1
  115. package/dist/render/components/TitleWithButtons.js +1 -1
  116. package/dist/render/components/ViewHideRoot.d.ts +7 -1
  117. package/dist/render/components/ViewHideRoot.js +1 -1
  118. package/dist/render/lib/content/block-size.d.ts +4 -1
  119. package/dist/render/lib/content/block-size.js +1 -1
  120. package/dist/render/lib/content/box-cell-bound.js +1 -1
  121. package/dist/render/lib/content/box-shared-columns.js +1 -1
  122. package/dist/render/lib/content/box-stack-line.d.ts +1 -0
  123. package/dist/render/lib/content/box-stack-line.js +1 -1
  124. package/dist/render/lib/content/view-values.d.ts +2 -0
  125. package/dist/render/lib/content/view-values.js +1 -1
  126. package/dist/render/lib/dealer-source.d.ts +3 -2
  127. package/dist/render/lib/dealer-source.js +1 -1
  128. package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
  129. package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
  130. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  131. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  132. package/dist/render/lib/document/blocks/general/ListSearch/render.js +1 -1
  133. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -0
  134. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  135. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  136. package/dist/render/lib/document/blocks/general/section-to-box-rows-forms.js +1 -1
  137. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
  138. package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -1
  139. package/dist/render/lib/document/page-render.js +1 -1
  140. package/dist/render/lib/document/part-styles.d.ts +3 -1
  141. package/dist/render/lib/document/part-styles.js +2 -2
  142. package/dist/render/lib/document/passes/block-size.js +1 -1
  143. package/dist/render/lib/document/passes/clickable-parts.js +1 -1
  144. package/dist/render/lib/document/passes/hidden-nodes.js +1 -1
  145. package/dist/render/lib/document/passes/section-animation.js +1 -1
  146. package/dist/render/lib/document/passes/section-width.js +1 -1
  147. package/dist/render/lib/document/published-passes.d.ts +13 -0
  148. package/dist/render/lib/document/published-passes.js +1 -0
  149. package/dist/render/lib/document/text-parts.d.ts +1 -0
  150. package/dist/render/lib/document/text-parts.js +1 -1
  151. package/dist/render/lib/sections/section-to-box.d.ts +4 -0
  152. package/dist/render/lib/sections/section-to-box.js +1 -1
  153. package/package.json +1 -1
@@ -1 +1 @@
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};
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{boxCardProps as et}from"../../../../format/lib/content/box-background.js";import{cardCopyPlace as ot}from"../../../../format/lib/content/card-template.js";import{BOX_GUTTER_KEY as it,boxGutterOf as ct,boxPlaceOf as rt,boxRunsEdgeToEdge as lt,isFrameContainer as T,ownNodeWidth as dt,siteDrawsGutter as ut}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as st}from"../../../../format/lib/document/editor-site-widths.js";import{GroundStopsAt as F,NestedBoxChoice as at,SectionGroupChoice as ft,SectionGroupWidthsProvider as ht,SectionRootChoice as _t,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 Nt}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 wt,heldByANode as Ct,isNestedNode as Tt,NOT_HELD_BY_A_NODE as P}from"../../../../format/lib/document/passes/document-position.js";const N="--sf-sw-site",Et="--sf-sw-content",Ot="--sf-bg-cap",St="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",R=({own:t,content:n,siteContent:e})=>t===!0&&n==="full"&&e!=="full",k="contents view-wide:[--sf-site-width:100vw]",A=({held:t},n,e)=>t?e:l(u,{className:n,children:e}),mt=`contents view-wide:[--sf-site-width:100vw] ${K} view-wide:[--sf-site-gutter:var(--intro-edge)]`,W=(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:W(n,e)}function m(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:_},children:l(u,{className:St,style:{[Et]:n},children:t})})}const pt="--sf-content-cap",xt="contents max-view-wide:[--sf-content-cap:none]";function Rt({content:t,contentMax:n},e){return t==="full"?null:n!==null?W(n,e):e==="content"?null:`var(${N})`}function At(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:_},children:l(u,{className:xt,style:{[pt]: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(R(e))return f(o,A(e,k,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?_:W(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=R(o)?A(o,mt,t({...n,fullWidth:!1})):m(t({...n,fullWidth:r}),r?null:S(o,i));return i==="content"?l(u,{className:"contents",style:{[Ot]:_},children:d}):d}switch(e){case"both":return f(i,At(t(n),Rt(o,i)),c);case"contained":return U(t,n,o,i,c);case"contentColumn":case"contentFull":case"productGrid":{const r=R(o),d=o.content==="full"&&!r?"full":"page",s=r?A(o,k,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:s}):s:f(i,s,c)}default:return f(i,m(t(n),S(o,i)),c)}}function Wt(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(ft,{draw:a=>a?.background==="content"?l(F,{ground:y,children:s(a)}):s(a)}),s=a=>{const C=a?{...r,band:a.background==="content"?r.band:a.background??r.band,content:a.content??r.content,own:a.background==="full"||a.content!==null,held:!0,siteContent:r.content}:r,x=V(o,i,e,C);if(!T(n))return x;const b=ct(i),g=b===void 0?C.content:b?"content":"full";return g===C.content?x:l(at,{atTop:x,nested:U(o,i,{...C,content:g,own:!1},C.band??"full",M(i))})},h=dt(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),p={band:I,content:I==="content"?"content":Y,contentMax:h.contentMax,own:!w,siteContent:r.content};return l(_t,{own:()=>l(ht,{value:{background:p.band,content:p.content},children:V(o,i,e,p)}),followed:d})}}const It={all:[P,{not:{context:"runsEdgeToEdge",is:!0}}]},Qt={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=T(n)?e.boxGutterFields():{},c={...t.fields,...i,...o},r=T(n)?$(n,t,c,[it]):c;E(t,{heldByANode:Ct}),T(n)&&E(t,{runsEdgeToEdge:(d,s)=>lt(et(d.props??{},ot(s.appState,d.props?.id)?.inCopy!==!1))}),t.fields=O(r,[G.background,G.content],T(n)?It:P)},draw(t,n){Wt(t,n)}};function bt(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 gt=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),Zt={name:"containedWidth",applies:(t,n,e)=>gt.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,s=D(c?.props??{},"page"),h=w=>bt(w,s);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}},tn={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=O(n.fields??{},["align"],Bt),E(n,{inHeroGroupRow:(e,o)=>{const i=wt(o.appState,e.props?.id);return!!i&&i.type==="HeroGroup"&&j("HeroGroup",i.props?.direction)==="row"}})}};function vt(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const Gt={any:[]},Dt={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},Ft={not:{context:"widthCappedByParent",is:!0}};function $(t,n,e,o=["widthMode"]){if(t==="ButtonBlock")return O(e,["_gWidth",...o],Gt);if(vt(e)){const i=(c,r)=>rt(r.appState?.data?.content,c.props?.id,ut(st()));return E(n,{outsideBox:(c,r)=>i(c,r)?.inBox!==!0,insideSiteGutter:(c,r)=>i(c,r)?.insideGutter}),O(e,o,Dt)}return E(n,{widthCappedByParent:(i,c)=>"parent"in c?Nt(c.parent):Tt({props:i.props??{}},c)}),O(e,o,Ft)}export{Ot as SECTION_BACKGROUND_VAR,xt as SECTION_CONTENT_CAP_CLASS,pt as SECTION_CONTENT_CAP_VAR,St as SECTION_CONTENT_CLASS,Et as SECTION_CONTENT_VAR,N as SITE_CONTENT_VAR,tn as buttonAlignInRow,Zt as containedWidth,Qt as sectionWidth,bt as widthModeFields};
@@ -0,0 +1,13 @@
1
+ import type { Data } from "efficient-easel/blocks";
2
+ export type PublishedPassContext = {
3
+ readonly metadata?: Readonly<Record<string, unknown>>;
4
+ };
5
+ export type PublishedPass = {
6
+ readonly name: string;
7
+ readonly chrome: boolean;
8
+ readonly why: string;
9
+ readonly run: (data: Data, ctx: PublishedPassContext) => Data;
10
+ };
11
+ export declare const PUBLISHED_PASSES: readonly PublishedPass[];
12
+ export declare function publishedPageData(data: unknown, metadata?: Readonly<Record<string, unknown>>): Data;
13
+ export declare function publishedChromeData(data: Data, metadata?: Readonly<Record<string, unknown>>): Data;
@@ -0,0 +1 @@
1
+ import{capHeroGroups as s}from"../../../format/lib/document/cap-hero-groups.js";import{markListSearchScopes as m}from"../../../format/lib/document/list-search-scopes.js";import{dropEmptySourcedBoxes as i,markHeadCoreBoxes as h}from"./head-core-boxes.js";import{oneH1 as c}from"../../../format/lib/document/one-h1.js";import{withPageContents as l}from"../content/page-contents.js";import{markWallLabels as p}from"./wall-labels.js";import{migrateLegacyPageData as d}from"./migrate-legacy.js";import{migrateRenamedProps as u}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as f,SECTION_TO_BOX_ON as y}from"../sections/section-to-box.js";import{siteThemeOf as g}from"../../../format/lib/theme.js";import{registerGeneralSectionRows as w}from"./blocks/general/section-to-box-rows.js";const S=[{name:"migrateLegacyPageData",chrome:!1,why:"page-only: it walks the top-level sections (Gallery B's array to its slot, a second pinned Header or Footer); a chrome document's one top-level node is the chrome itself",run:e=>d(e)},{name:"migrateRenamedProps",chrome:!0,why:"every document built from stored props: a renamed key still reads its stored answer (lib/source-rules/document-surfaces)",run:e=>u(e)},{name:"convertSectionsInPage",chrome:!1,why:"page-only: it turns an old top-level SECTION into its Box, with the site theme off the page's metadata; chrome is a Box group, never one of those sections",run:(e,{metadata:o})=>(w(),f(e,y,{theme:g(o)}))},{name:"capHeroGroups",chrome:!1,why:"page-only: it caps a top-level Hero's slide groups, and a Hero is a page section",run:e=>s(e)},{name:"oneH1",chrome:!1,why:"page-only: it hands the h1 to the first opener in the PAGE's document order; on a chrome document it would count a second document on its own",run:e=>c(e)},{name:"dropEmptySourcedBoxes",chrome:!0,why:"any document: a nested head over sourced cores served none goes (the Box footer's payment line), at any depth inside a slot",run:e=>i(e)},{name:"markHeadCoreBoxes",chrome:!1,why:"page-only: it marks a head Box at the TOP of the page, where the mark element draws (lib/content/empty-hides); a chrome document's top is the chrome group",run:e=>h(e)},{name:"markListSearchScopes",chrome:!1,why:"page-only for now: it ties a Search to the lists of the page's Box; no chrome holds a Search, and a chrome entry is one flag when one does",run:e=>m(e)},{name:"withPageContents",chrome:!1,why:"page-only: a Contents block lists the PAGE's anchored sections and numbers their kickers",run:e=>l(e)},{name:"markWallLabels",chrome:!0,why:"any document: each Marks wall is named by the lead Text drawn before it (aria-labelledby), the Box footer's walls too",run:e=>p(e)}];function a(e,o,n){let r=e;for(const t of S)(!n||t.chrome)&&(r=t.run(r,o));return r}function G(e,o){return a(e,{metadata:o},!1)}function T(e,o){return a(e,{metadata:o},!0)}export{S as PUBLISHED_PASSES,T as publishedChromeData,G as publishedPageData};
@@ -31,6 +31,7 @@ export declare function partNeedles(fields: Record<string, unknown> | undefined,
31
31
  export declare function canTypeOnCanvas(part: {
32
32
  offPage: boolean;
33
33
  hidden: boolean;
34
+ panelOnly?: boolean;
34
35
  }): boolean;
35
36
  export type SectionTextPart = {
36
37
  key: string;
@@ -1 +1 @@
1
- import{decodePartId as O,encodePartId as E}from"efficient-easel/draw";import{stripMarkup as R}from"../../../format/lib/markup.js";import{LINK_FIELD_MARKER as y,SCAFFOLD_FIELD_MARKER as A,TEXT_FIELD_MARKER as p}from"efficient-easel/draw";import{readHidable as h}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as L}from"efficient-easel/draw";import{isStructuralTextProp as _}from"../../../format/lib/document/neutralization-contracts.js";import{fieldInOwnBox as I}from"../../../format/lib/document/own-box.js";import{partRowTexts as S}from"./part-rows.js";import{nonEmptyString as j}from"../../../format/lib/non-empty-string.js";const q="data-sf-part",J="data-sf-region-part",Q="data-sf-part-row";function U(e,t){return`${e}[${t}]`}const V="data-sf-part-kind",N="data-sf-part-style-owner",F="data-sf-part-style-kind";function Z(e){for(let t=e;t;t=t.parentElement){const r=t.getAttribute(N),o=t.getAttribute(F);if(r&&o)return{owner:r,kind:o};if(t.getAttribute("data-easel-block"))return null}return null}const b=2;function g(e){return R(e).replace(/\s+/gu,"")}function l(e,t,r){const o=e[p];if(o){if(o.control==="textList"){const i=o.itemKey??"text";if(!Array.isArray(t))return;for(const s of t){const c=s?.[i];typeof c=="string"&&r.push(c)}return}const{text:n}=h(t);n?r.push(n):o.placeholder&&r.push(o.placeholder);return}if(!e[y]){if(e.type==="text"||e.type==="textarea"){const n=j(t);n&&r.push(n);return}if(e.arrayFields&&Array.isArray(t)){for(const n of t)for(const[i,s]of Object.entries(e.arrayFields))l(s,n?.[i],r);return}if(e.objectFields&&t&&typeof t=="object")for(const[n,i]of Object.entries(e.objectFields))l(i,t[n],r)}}function k(e){if(!e||typeof e!="object")return!1;const t=e;return t[y]?!1:!!t[p]||t.type==="text"||t.type==="textarea"}function w(e,t){const r=e[p];return r?.label?r.label:typeof e.label=="string"?e.label:t}function K(e){const t=e.indexOf(" (");return(t>0?e.slice(0,t):e).trim()}function v(e,t,r){if(!e)return[];const o=[];for(const[n,i]of Object.entries(e)){if(!i||typeof i!="object"||_(n))continue;const s=i,c=[];l(s,t?.[n],c),!c.length&&s[A]!==void 0&&l(s,s[A],c);const a=w(s,n);if(r?.(n)&&k(s)){c.length&&o.push({key:n,label:a,texts:[],keyed:!0});continue}const u=new Set;for(const{row:d,text:f}of S(s,t?.[n])){const T=g(f);T.length<b||(u.add(T),o.push({key:n,label:a,texts:[T],row:d}))}const m=new Set(u),x=[];for(const d of c){const f=g(d);f.length<b||m.has(f)||(m.add(f),x.push(f))}x.length&&o.push({key:n,label:a,texts:x})}return o}function D(e){return!e.offPage&&!e.hidden}const M=L;function P(e,t){if(!t||typeof t!="object"||_(e)||I(t))return null;const r=t[p];return!r||!M.includes(r.control)?null:r}function tt(e,t){const r=P(e,t);return r!==null&&r.identifier!==!0}function et(e,t){if(!e)return[];const r=[];for(const[o,n]of Object.entries(e)){const i=P(o,n);if(!i)continue;const{text:s,hidden:c}=h(t?.[o]);if(D({offPage:i.offPage===!0,hidden:!!c}))continue;const a=s||i.placeholder||"",u=R(a).replace(/\s+/gu," ").trim();r.push({key:o,label:K(w(n,o)),preview:u,offPage:i.offPage===!0,identifier:i.identifier===!0,hidden:!!c})}return r}export{q as PART_ATTR,V as PART_KIND_ATTR,Q as PART_ROW_ATTR,F as PART_STYLE_KIND_ATTR,N as PART_STYLE_OWNER_ATTR,J as REGION_PART_ATTR,D as canTypeOnCanvas,O as decodePartId,E as encodePartId,U as encodePartRow,P as entryPartMetaOf,tt as fieldDrawsEntryRow,k as holdsAuthoredText,g as normalizePartText,K as partHeadLabel,w as partLabel,v as partNeedles,Z as partStyleOwnerOf,et as sectionTextParts};
1
+ import{decodePartId as w,encodePartId as E}from"efficient-easel/draw";import{stripMarkup as y}from"../../../format/lib/markup.js";import{LINK_FIELD_MARKER as R,SCAFFOLD_FIELD_MARKER as A,TEXT_FIELD_MARKER as p}from"efficient-easel/draw";import{readHidable as h}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as L}from"efficient-easel/draw";import{isStructuralTextProp as _}from"../../../format/lib/document/neutralization-contracts.js";import{fieldInOwnBox as I}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as S}from"../../../format/lib/document/panel-only.js";import{partRowTexts as j}from"./part-rows.js";import{nonEmptyString as N}from"../../../format/lib/non-empty-string.js";const Q="data-sf-part",U="data-sf-region-part",V="data-sf-part-row";function Z(t,e){return`${t}[${e}]`}const v="data-sf-part-kind",F="data-sf-part-style-owner",k="data-sf-part-style-kind";function tt(t){for(let e=t;e;e=e.parentElement){const r=e.getAttribute(F),o=e.getAttribute(k);if(r&&o)return{owner:r,kind:o};if(e.getAttribute("data-easel-block"))return null}return null}const b=2;function O(t){return y(t).replace(/\s+/gu,"")}function l(t,e,r){const o=t[p];if(o){if(o.control==="textList"){const i=o.itemKey??"text";if(!Array.isArray(e))return;for(const s of e){const c=s?.[i];typeof c=="string"&&r.push(c)}return}const{text:n}=h(e);n?r.push(n):o.placeholder&&r.push(o.placeholder);return}if(!t[R]){if(t.type==="text"||t.type==="textarea"){const n=N(e);n&&r.push(n);return}if(t.arrayFields&&Array.isArray(e)){for(const n of e)for(const[i,s]of Object.entries(t.arrayFields))l(s,n?.[i],r);return}if(t.objectFields&&e&&typeof e=="object")for(const[n,i]of Object.entries(t.objectFields))l(i,e[n],r)}}function K(t){if(!t||typeof t!="object")return!1;const e=t;return e[R]?!1:!!e[p]||e.type==="text"||e.type==="textarea"}function P(t,e){const r=t[p];return r?.label?r.label:typeof t.label=="string"?t.label:e}function D(t){const e=t.indexOf(" (");return(e>0?t.slice(0,e):t).trim()}function et(t,e,r){if(!t)return[];const o=[];for(const[n,i]of Object.entries(t)){if(!i||typeof i!="object"||_(n))continue;const s=i,c=[];l(s,e?.[n],c),!c.length&&s[A]!==void 0&&l(s,s[A],c);const a=P(s,n);if(r?.(n)&&K(s)){c.length&&o.push({key:n,label:a,texts:[],keyed:!0});continue}const u=new Set;for(const{row:x,text:f}of j(s,e?.[n])){const m=O(f);m.length<b||(u.add(m),o.push({key:n,label:a,texts:[m],row:x}))}const T=new Set(u),d=[];for(const x of c){const f=O(x);f.length<b||T.has(f)||(T.add(f),d.push(f))}d.length&&o.push({key:n,label:a,texts:d})}return o}function M(t){return!t.offPage&&!t.hidden&&t.panelOnly!==!0}const C=L;function g(t,e){if(!e||typeof e!="object"||_(t)||I(e))return null;const r=e[p];return!r||!C.includes(r.control)?null:r}function rt(t,e){const r=g(t,e);return r!==null&&r.identifier!==!0}function nt(t,e){if(!t)return[];const r=[];for(const[o,n]of Object.entries(t)){const i=g(o,n);if(!i)continue;const{text:s,hidden:c}=h(e?.[o]);if(M({offPage:i.offPage===!0,hidden:!!c,panelOnly:S(n)}))continue;const a=s||i.placeholder||"",u=y(a).replace(/\s+/gu," ").trim();r.push({key:o,label:D(P(n,o)),preview:u,offPage:i.offPage===!0,identifier:i.identifier===!0,hidden:!!c})}return r}export{Q as PART_ATTR,v as PART_KIND_ATTR,V as PART_ROW_ATTR,k as PART_STYLE_KIND_ATTR,F as PART_STYLE_OWNER_ATTR,U as REGION_PART_ATTR,M as canTypeOnCanvas,w as decodePartId,E as encodePartId,Z as encodePartRow,g as entryPartMetaOf,rt as fieldDrawsEntryRow,K as holdsAuthoredText,O as normalizePartText,D as partHeadLabel,P as partLabel,et as partNeedles,tt as partStyleOwnerOf,nt as sectionTextParts};
@@ -167,6 +167,7 @@ export interface SectionToBoxRow {
167
167
  pressKeepsEmpty?: readonly string[];
168
168
  site?: (node: SectionNode, ctx: ConvertContext) => readonly SiteWrite[];
169
169
  skip?: (props: Props) => string | undefined;
170
+ ownBoxConverts?: true;
170
171
  also?: readonly SectionPiece[];
171
172
  reads?: Readonly<Record<string, string>>;
172
173
  }
@@ -189,6 +190,9 @@ export declare function convertsToBox(type: string): boolean;
189
190
  export declare function pressesAsBox(type: string, press?: readonly string[]): boolean;
190
191
  export declare function headParts(type: string): PartRow[];
191
192
  export declare const hasWords: (v: unknown) => boolean;
193
+ export declare const headInOwnBox: (p: Props) => boolean;
194
+ export declare function ownBoxHold(p: Props): string | undefined;
195
+ export declare function filledTemplateHold(p: Props, slot: string): string | undefined;
192
196
  export declare function convertSection(node: SectionNode, row: SectionToBoxRow, ctx?: ConvertContext): SectionConversion;
193
197
  export declare function convertSectionsInPage<D extends {
194
198
  content?: unknown;
@@ -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 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};
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,parseSectionHeadPlacement as ie}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 ae}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ce}from"../../../format/lib/locations-grid.js";import{normalizeTheme as G}from"../../../format/lib/theme.js";const _=ee,E=te;function Ie(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 fe(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 Ne(t){for(const[o,s]of Object.entries(t)){if(o in A&&A[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=s}}function Re(t){return A[t]}const Y=new Set(["id"]),T={},F=[],de=["ProductGrid","Events","ContactRouting","ReviewForm","AppointmentBooking","Reviews","CheckoutCTA"],le=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ",...de,"Stats","Logos","PaymentBadges","PaymentLogosBlock","FitmentFinder","DocMasthead","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Countdown","FeaturedCover","Cards"];function Ae(t){for(const[o,s]of Object.entries(t)){if(o in T&&T[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=s}}function Ce(t){return T[t]}function He(){return Object.keys(T)}function pe(t){return t in T&&F.includes(t)}function Le(t,o=le){return t in T&&(o.includes(t)||pe(t))}function Fe(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const s=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&s.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&s.push({kind:"button",key:"linkText",href:"linkHref"}),s}const z=t=>Z(t),ze=t=>z(t).text.trim()!=="";function ue(t){if(t.includes("=="))return t;const o=t.indexOf("/"),s=o===-1?t:t.slice(0,o),i=s.trim();if(!i)return t;const c=s.indexOf(i);return`${s.slice(0,c)}==${i}==${s.slice(c+i.length)}${o===-1?"":t.slice(o)}`}const he=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function ye(t,o,s,i){const a={...t._partStyles?.text??{},...o??{},...s??{}};return(i==="center"||i==="right")&&a.align===void 0&&(a.align=i),Object.keys(a).length?{_partStyles:{text:a}}:{}}function me(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const s=o[t.key];return{variant:typeof s=="string"&&Object.hasOwn(t.map,s)?t.map[s]:t.fallback}}function V(t,o,s,i,c={}){const a={...o};for(const u of t){const[k,O,j]=typeof u=="string"?[u,u,void 0]:u;if(s[k]===void 0)continue;const P=j?j(s[k],s,c):s[k];P===void 0?delete a[O]:a[O]=P,i(k,O,P===void 0)}return a}function ke(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),s=c=>{for(const a of c??[])o.add(typeof a=="string"?a:a[0])},i=c=>{for(const a of c)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":s(a.box),i(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(u=>o.add(u)),Object.keys(a.rename??{}).forEach(u=>o.add(u)),a.derive?.reads.forEach(u=>o.add(u)),typeof a.slots!="function")for(const u of Object.values(a.slots??{}))for(const k of u)"kind"in k&&o.add(k.key);break}};for(const c of[t,...t.also??[]])s(c.box),i(c.parts);return o}const be=t=>ie(t.headPlacement)==="own-box";function xe(t){return be(t)?"its head sits in a Box of its own above it (own-box): the row draws the head inline":void 0}function ge(t,o){const s=t[o];return Array.isArray(s)&&s.some(c=>!!c&&typeof c=="object"&&typeof c.type=="string")?"already on the Box path: its items draw from a filled card template":void 0}function we(t){const o=new Set,s=i=>{for(const c of i)if(c.kind==="group"||c.kind==="block")s(c.parts??[]);else if(c.kind==="core"&&c.slots&&typeof c.slots!="function")for(const[a,u]of Object.entries(c.slots))u.length>0&&u.every(k=>!("kind"in k))&&o.add(a)};for(const i of[t,...t.also??[]])s(i.parts);return[...o]}function $e(t,o,s){if(!s.press)for(const i of we(t)){const c=ge(o,i);if(c!==void 0)return c}}function Q(t,o,s={}){const i=t.props,c=(o.ownBoxConverts?void 0:xe(i))??$e(o,i,s)??o.skip?.(i);if(c!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:c};const a=String(i.id??t.type),u=[],k=[],O=[],j=new Set,P=(n,r)=>{u.push({key:n,home:r}),j.add(n)},M=i._partStyles??{},C=ke(o);let X=0;const w=(n,r)=>({type:n,props:{...r,id:`${a}~${n}-${++X}`}}),K=(n,r,b,m,x,l,$)=>{if(x){for(const f of n??[]){const h=typeof f=="string"?f:f[0];b[h]!==void 0&&$(h,`nothing — the ${m} has no parts, so it is not drawn`)}return}const e=typeof r=="function"?r(i,s):r??{};return V(n??[],e,b,(f,h,d)=>$(f,d?`nothing — the old value draws nothing (${m}: no ${h})`:`${l}${m}: ${h}`),s)},q=n=>ae(n,r=>`${a}~${r}-${++X}`),W=(n,r,b)=>{const m=n.of?n.of(r):Array.isArray(r[n.key])?r[n.key]:[],x=typeof n.props=="function"?n.props(i,s):n.props??{},l=m.map((d,g)=>{const p=d??{},y=n.item?.(p,g,i)??{},S=I(y.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${g+1}: `);return n.flat?y.props?S.map(v=>({...v,props:{...v.props,...y.props,id:v.props.id}})):S:[w(_,{name:`${n.name} ${g+1}`,...x,...y.props??{},[E]:S})]});if(n.groups){const d=n.groups;return b(n.key,m.length?`one Box per item (${m.length}), in a Box per group`:"nothing — the list is empty"),ce(m.map(g=>g??{}),d.of,d.of).map((g,p)=>{const y=g.items.map(B=>B.item),S=d.parts?I(d.parts,d.head?.(y,i)??{},!1,`group ${p+1}: `):[],v=g.items.map(B=>l[B.index]),H=d.perRow?.(y.length,i),N=Number.isInteger(H)&&H>=1?H:1,L=[];if(d.perRow&&N<v.length)for(let B=0;B*N<v.length;B++)L.push(v.slice(B*N,(B+1)*N).flat());return w(_,{name:`${d.name} ${p+1}`,...d.props??{},[E]:[...S,w(_,{name:`${d.itemsName} ${p+1}`,...d.itemsProps?.(y.length,i)??{},[E]:L.length?L.map((B,U)=>w(_,{name:`${d.rowName??`${d.itemsName} row`} ${U+1}`,...d.rowProps??{},[E]:B})):v.flat()})]})})}const $=n.perRow?.(i),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(m.length?n.flat?`each item's parts (${m.length} items), in order`:`one Box per item (${m.length}), its parts inside`:"nothing — the list is empty")+(e&&m.length?`, in rows of ${e}`:"")),!e)return l.flat();const f=typeof n.rowProps=="function"?n.rowProps(i,s):n.rowProps??{},h=[];for(let d=0;d*e<l.length;d++){const g=l.slice(d*e,(d+1)*e).flat(),p=n.rowFiller?e-l.slice(d*e,(d+1)*e).length:0;h.push(w(_,{name:`${n.rowName??`${n.name} row`} ${d+1}`,...f,[E]:[...g,...Array.from({length:p},(y,S)=>w(_,{name:`Empty ${S+1}`,...n.rowFiller,[E]:[]}))]}))}return h},I=(n,r,b,m)=>{const x=[],l=(e,f)=>b?P(e,f):void 0,$=e=>b?M[e]:void 0;for(const e of n)if(!(e.when&&!e.when(i,b?void 0:r)))switch(e.kind){case"text":{const f=z(r[e.key]);if(!f.text.trim()&&!(b&&s.press&&o.pressKeepsEmpty?.includes(e.key))){l(e.key,"nothing — empty words draw nothing, so no block");break}const h=he(e.role??"body"),{_partStyles:d,...g}=h,p=ye(h,e.styleFrom?{...e.style,...e.styleFrom(i,s)}:e.style,$(e.key),e.props?.align);if(e.was&&b){const y=p._partStyles?.text??{};O.push({key:e.key,was:e.was,...typeof y.textStyle=="string"?{textStyle:y.textStyle}:{},...R(y.size)!==void 0?{size:R(y.size)}:{},...R(y.sizePhone)!==void 0?{sizePhone:R(y.sizePhone)}:{}})}x.push(w("Text",{text:e.mark==="accentLead"?ue(f.text):e.mark==="accentItalic"?re(f.text):f.text,...g,...e.props??{},...p,...f.hidden?{_hidden:!0}:{}})),l(e.key,`${m}Text block: its words${f.hidden?", hidden":""}`);break}case"button":{const f=z(r[e.key]);if(!f.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 h=typeof r[e.href]=="string"&&r[e.href]?r[e.href]:"#",d={...e.style??{},...$(e.key)??{}};x.push(w("ButtonBlock",{label:f.text,href:h,...typeof e.props=="function"?e.props(r,s):e.props??{},...me(e.variant,r),...Object.keys(d).length?{_partStyles:{label:d}}:{},...f.hidden?{_hidden:!0}:{}})),l(e.key,`${m}Button block: its words`),l(e.href,`${m}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${m}Button block: its Style`);break}case"image":{const f=r[e.key];if(typeof f!="string"||!f){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const h=e.alt&&typeof r[e.alt]=="string"?r[e.alt]:"";x.push(w("ImageBlock",{src:f,alt:h,...e.props??{}})),l(e.key,`${m}Image block: its picture`),e.alt&&l(e.alt,`${m}Image block: its alt text`);break}case"list":{x.push(...W(e,r,l));break}case"group":{const f=I(e.parts,r,b,m),h=K(e.box,e.props,r,`${e.name} Box`,!f.length&&!e.keepEmpty,m,l);h&&x.push(w(_,{name:e.name,...h,[E]:f}));break}case"block":{const f=e.parts?I(e.parts,r,b,m):[],h=K(e.box,e.props,r,`${e.type} block`,!!e.parts&&!f.length&&!e.keepEmpty,m,l);h&&x.push(w(e.type,{...h,...e.slot?{[e.slot]:f}:{}}));break}case"core":{const f=e.as??t.type,h={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},d=e.keep==="rest"?Object.keys(r).filter(p=>!C.has(p)&&!(p in h)):e.keep;for(const p of d)r[p]!==void 0&&(h[p]=r[p],l(p,`the ${f} block inside the Box`));if(e.keep==="rest"){for(const y of Object.keys(e.props??{}))r[y]!==void 0&&!C.has(y)&&l(y,`nothing — the ${f} block inside the Box has the row's own value`);r.headPlacement!==void 0&&l("headPlacement",`the ${f} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(M).filter(([y])=>!C.has(y)));Object.keys(p).length&&(h._partStyles=p)}for(const[p,y]of Object.entries(e.rename??{}))r[p]!==void 0&&(h[y]=r[p],l(p,`the ${f} block inside the Box: ${y}`));if(e.derive){Object.assign(h,e.derive.props(r,s));for(const p of e.derive.reads)r[p]!==void 0&&l(p,`the ${f} block inside the Box`)}const g=typeof e.slots=="function"?e.slots(r,s):e.slots??{};for(const[p,y]of Object.entries(g))h[p]=y.flatMap(S=>"kind"in S?W(S,r,l):q([S]));x.push(w(f,h));break}}return x},J=(n,r)=>{const b=r===0?"Box":`${n.name} Box`,m=I(n.parts,i,!0,r===0?"":`${b}: `),x=typeof n.boxProps=="function"?n.boxProps(i,s):n.boxProps??{},l=V(n.box??[],x,i,($,e,f)=>P($,f?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),s);return{type:_,props:{name:n.name,...l,[E]:m,id:fe(a,r)}}},D=[o,...o.also??[]].map(J);i._partStyles!==void 0&&P("_partStyles","each old part's style moved to its new part");for(const[n,r]of Object.entries(o.reads??{}))i[n]!==void 0&&P(n,r);for(const[n,r]of Object.entries(o.drop??{}))n in i&&(k.push({key:n,why:r}),j.add(n));for(const n of Object.keys(i))Y.has(n)||j.has(n)||k.push({key:n,why:"not in the row — not carried"});return{node:D[0],nodes:D,carried:u,dropped:k,siteWrites:[...o.site?.(t,s)??[]],restyled:O}}function Me(t,o=F,s={}){const i=t.content;if(!Array.isArray(i))return t;let c=!1;const a=i.flatMap(u=>{const k=u&&typeof u.type=="string"&&o.includes(u.type)?T[u.type]:void 0;if(!k)return[u];const O=Q(u,k,s);return O.skipped!==void 0?[u]:(c=!0,O.nodes)});return c?{...t,content:a}:t}function Xe(t,o=F,s={}){if(!Array.isArray(t))return[];const i=[];return t.forEach((c,a)=>{const u=c&&typeof c.type=="string"&&o.includes(c.type)?T[c.type]:void 0;if(!u)return;const k=Q(c,u,s);k.skipped===void 0&&i.push({index:a,node:k.node,nodes:k.nodes})}),i}export{de as HOST_PRESS_TYPES,E as SECTION_BOX_SLOT,_ as SECTION_BOX_TYPE,F as SECTION_TO_BOX_ON,le as SECTION_TO_BOX_PRESS,Re as boxNativeReason,Q as convertSection,Me as convertSectionsInPage,Ie as convertTheme,pe as convertsToBox,ge as filledTemplateHold,ze as hasWords,be as headInOwnBox,Fe as headParts,xe as ownBoxHold,Le as pressesAsBox,Ne as registerBoxNativeSections,Ae as registerSectionToBox,fe as sectionBoxIdOf,Xe as sectionToBoxEdits,Ce as sectionToBoxRow,He as sectionToBoxTypes};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-web-builder",
3
- "version": "59.2.0",
3
+ "version": "60.0.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",