efficient-web-builder 42.0.0 → 44.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 (187) hide show
  1. package/CHANGELOG.md +212 -0
  2. package/dist/editor/components/AnchorField.js +1 -1
  3. package/dist/editor/components/CanvasPartsBridge.d.ts +1 -0
  4. package/dist/editor/components/CanvasPartsBridge.js +1 -1
  5. package/dist/editor/components/DuplicatePageDialog.js +1 -1
  6. package/dist/editor/components/MediaUploadField.d.ts +3 -1
  7. package/dist/editor/components/MediaUploadField.js +1 -1
  8. package/dist/editor/components/PagesPanel.js +1 -1
  9. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  10. package/dist/editor/components/PreviewThemeFrame.d.ts +1 -1
  11. package/dist/editor/components/PreviewThemeFrame.js +3 -19
  12. package/dist/editor/components/SectionEditor.d.ts +5 -1
  13. package/dist/editor/components/SectionEditor.js +1 -1
  14. package/dist/editor/components/SectionIcon.js +1 -1
  15. package/dist/editor/components/SectionTextPartBridge.js +1 -1
  16. package/dist/editor/components/SectionThumbnail.js +1 -1
  17. package/dist/editor/components/SiteFields.d.ts +2 -1
  18. package/dist/editor/components/SiteFields.js +1 -1
  19. package/dist/editor/components/StandaloneSectionEditor.js +1 -1
  20. package/dist/editor/components/StorefrontEditor.js +1 -1
  21. package/dist/editor/components/StylesPanel.d.ts +3 -1
  22. package/dist/editor/components/StylesPanel.js +1 -1
  23. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  24. package/dist/editor/components/WebsiteSettingsPanel.d.ts +6 -1
  25. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  26. package/dist/editor/components/storefront-editor.css +16 -77
  27. package/dist/editor/components/useHostDocumentBridge.js +1 -1
  28. package/dist/editor/components/useLocationsTree.js +1 -1
  29. package/dist/editor/components/useSectionToBoxPass.js +1 -1
  30. package/dist/editor/components/useSocialSettings.d.ts +2 -2
  31. package/dist/editor/lib/document/ColourControl.d.ts +7 -2
  32. package/dist/editor/lib/document/ColourControl.js +1 -1
  33. package/dist/editor/lib/document/MarkupToolbar.d.ts +6 -2
  34. package/dist/editor/lib/document/MarkupToolbar.js +1 -1
  35. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  36. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  37. package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
  38. package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
  39. package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
  40. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  41. package/dist/editor/lib/document/canvas-typing.js +1 -1
  42. package/dist/editor/lib/document/consent-words-field.d.ts +6 -0
  43. package/dist/editor/lib/document/consent-words-field.js +1 -0
  44. package/dist/editor/lib/document/controls.d.ts +14 -2
  45. package/dist/editor/lib/document/controls.js +1 -1
  46. package/dist/editor/lib/document/field-groups.js +1 -1
  47. package/dist/editor/lib/document/footer-blocks.js +1 -1
  48. package/dist/editor/lib/document/locked-blocks.d.ts +3 -0
  49. package/dist/editor/lib/document/locked-blocks.js +1 -1
  50. package/dist/editor/lib/document/overrides.js +1 -1
  51. package/dist/editor/lib/document/page-root-fields.d.ts +1 -0
  52. package/dist/editor/lib/document/page-root-fields.js +1 -1
  53. package/dist/editor/lib/document/part-anchors.d.ts +7 -0
  54. package/dist/editor/lib/document/part-anchors.js +1 -1
  55. package/dist/editor/lib/document/section-width-fields.js +1 -1
  56. package/dist/editor/lib/document/selected-host.d.ts +2 -0
  57. package/dist/editor/lib/document/selected-host.js +1 -0
  58. package/dist/editor/lib/page-copy.js +1 -1
  59. package/dist/editor/lib/sections/section-dry-run.d.ts +2 -9
  60. package/dist/editor/lib/sections/section-dry-run.js +2 -2
  61. package/dist/format/lib/content/authored-props.js +1 -1
  62. package/dist/format/lib/content/block-sources.js +1 -1
  63. package/dist/format/lib/content/box-layout.d.ts +1 -0
  64. package/dist/format/lib/content/box-layout.js +1 -1
  65. package/dist/format/lib/content/box-shadow.d.ts +3 -0
  66. package/dist/format/lib/content/box-shadow.js +1 -0
  67. package/dist/format/lib/content/button-icon.d.ts +2 -1
  68. package/dist/format/lib/content/button-icon.js +1 -1
  69. package/dist/format/lib/content/consent-banner.d.ts +21 -0
  70. package/dist/format/lib/content/consent-banner.js +1 -1
  71. package/dist/format/lib/content/contact.js +1 -1
  72. package/dist/format/lib/content/footer.d.ts +10 -0
  73. package/dist/format/lib/content/footer.js +1 -1
  74. package/dist/format/lib/content/gallery-layout.d.ts +12 -0
  75. package/dist/format/lib/content/gallery-layout.js +1 -1
  76. package/dist/format/lib/content/section-width.d.ts +0 -4
  77. package/dist/format/lib/content/section-width.js +1 -1
  78. package/dist/format/lib/document/blocks/general/Logos/meta.d.ts +6 -0
  79. package/dist/format/lib/document/blocks/general/Logos/meta.js +1 -1
  80. package/dist/format/lib/document/blocks/general/SectionHeader/meta.js +1 -1
  81. package/dist/format/lib/document/box-footer.js +1 -1
  82. package/dist/format/lib/document/container-blocks.js +1 -1
  83. package/dist/format/lib/document/media-manifest.json +3 -2
  84. package/dist/format/lib/document/nestable-content-sections.js +1 -1
  85. package/dist/format/lib/document/passes/settings-groups.js +1 -1
  86. package/dist/format/lib/document/root-panel.d.ts +8 -0
  87. package/dist/format/lib/document/root-panel.js +1 -0
  88. package/dist/format/lib/document/section-catalog.js +1 -1
  89. package/dist/format/lib/document/source-bound-parts.js +1 -1
  90. package/dist/format/lib/editor-words-catalogue.d.ts +23 -5
  91. package/dist/format/lib/editor-words-catalogue.js +4 -4
  92. package/dist/format/lib/editor-words.js +1 -1
  93. package/dist/format/lib/hero-texture.js +1 -1
  94. package/dist/format/lib/hero-video.d.ts +7 -0
  95. package/dist/format/lib/hero-video.js +1 -1
  96. package/dist/format/lib/links/page-link-rules.js +1 -1
  97. package/dist/format/lib/markup.d.ts +1 -0
  98. package/dist/format/lib/markup.js +2 -2
  99. package/dist/format/lib/non-empty-string.d.ts +1 -0
  100. package/dist/format/lib/non-empty-string.js +1 -0
  101. package/dist/format/lib/popup/look.d.ts +1 -1
  102. package/dist/format/lib/popup/look.js +1 -1
  103. package/dist/format/lib/popup/rules.d.ts +1 -1
  104. package/dist/format/lib/popup/rules.js +1 -1
  105. package/dist/format/lib/reel.d.ts +2 -1
  106. package/dist/format/lib/reel.js +1 -1
  107. package/dist/format/lib/sections/hero-overlay.js +1 -1
  108. package/dist/format/lib/sections/logo-look.d.ts +7 -0
  109. package/dist/format/lib/sections/logo-look.js +1 -0
  110. package/dist/format/lib/sections/section-head-placement.d.ts +1 -0
  111. package/dist/format/lib/sections/section-head-placement.js +1 -1
  112. package/dist/format/lib/site-theme-row.d.ts +0 -1
  113. package/dist/format/lib/slugify.d.ts +1 -1
  114. package/dist/format/lib/slugify.js +1 -1
  115. package/dist/format/lib/theme.d.ts +2 -1
  116. package/dist/format/lib/theme.js +4 -4
  117. package/dist/render/components/BlockFrame.d.ts +1 -1
  118. package/dist/render/components/BoxTabs.d.ts +2 -1
  119. package/dist/render/components/BoxTabs.js +1 -1
  120. package/dist/render/components/Btn.d.ts +1 -0
  121. package/dist/render/components/Btn.js +1 -1
  122. package/dist/render/components/ButtonBlock.d.ts +12 -1
  123. package/dist/render/components/ButtonBlock.js +1 -1
  124. package/dist/render/components/ContactLocations.js +3 -45
  125. package/dist/render/components/Divider.d.ts +1 -1
  126. package/dist/render/components/Divider.js +1 -1
  127. package/dist/render/components/DocBody.js +5 -5
  128. package/dist/render/components/Flex.d.ts +5 -9
  129. package/dist/render/components/Flex.js +1 -1
  130. package/dist/render/components/Heading.d.ts +1 -1
  131. package/dist/render/components/HeroGroup.d.ts +3 -9
  132. package/dist/render/components/HeroGroup.js +1 -1
  133. package/dist/render/components/HeroSection.js +1 -11
  134. package/dist/render/components/HeroSingle.js +1 -11
  135. package/dist/render/components/LogoBlock.d.ts +1 -1
  136. package/dist/render/components/LogoBlock.js +1 -1
  137. package/dist/render/components/LogoWallContext.d.ts +12 -0
  138. package/dist/render/components/LogoWallContext.js +1 -0
  139. package/dist/render/components/Logos.d.ts +16 -1
  140. package/dist/render/components/Logos.js +1 -1
  141. package/dist/render/components/PaymentBadges.d.ts +3 -1
  142. package/dist/render/components/PaymentBadges.js +1 -1
  143. package/dist/render/components/PreviewHeaderContext.d.ts +1 -3
  144. package/dist/render/components/PreviewHeaderContext.js +1 -1
  145. package/dist/render/components/PreviewTickerContext.d.ts +3 -0
  146. package/dist/render/components/PreviewTickerContext.js +1 -1
  147. package/dist/render/components/Reel.js +1 -1
  148. package/dist/render/components/SiteGutterFrame.d.ts +3 -2
  149. package/dist/render/components/SiteGutterFrame.js +1 -1
  150. package/dist/render/components/Text.d.ts +1 -1
  151. package/dist/render/lib/content/button-look.d.ts +46 -0
  152. package/dist/render/lib/content/button-look.js +1 -0
  153. package/dist/{format → render}/lib/content/section-padding.d.ts +32 -4
  154. package/dist/render/lib/content/section-padding.js +1 -0
  155. package/dist/render/lib/content/view-values.d.ts +10 -0
  156. package/dist/render/lib/content/view-values.js +1 -0
  157. package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
  158. package/dist/render/lib/document/blocks/general/Divider/render.js +1 -1
  159. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  160. package/dist/render/lib/document/blocks/general/Heading/render.js +1 -1
  161. package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
  162. package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
  163. package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
  164. package/dist/render/lib/document/blocks/general/PaymentBadges/render.js +1 -1
  165. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  166. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +4 -1
  167. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  168. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.d.ts +2 -0
  169. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -0
  170. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.d.ts +5 -0
  171. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -0
  172. package/dist/render/lib/document/blocks/general/section-to-box-rows.d.ts +0 -4
  173. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  174. package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
  175. package/dist/render/lib/document/page-render.js +1 -1
  176. package/dist/render/lib/document/part-rows.js +1 -1
  177. package/dist/render/lib/document/part-styles.d.ts +0 -1
  178. package/dist/render/lib/document/part-styles.js +2 -2
  179. package/dist/render/lib/document/passes/section-anchor.js +1 -1
  180. package/dist/render/lib/document/passes/section-padding.js +1 -1
  181. package/dist/render/lib/document/text-parts.d.ts +0 -2
  182. package/dist/render/lib/document/text-parts.js +1 -1
  183. package/dist/render/lib/sections/section-to-box.d.ts +2 -11
  184. package/dist/render/lib/sections/section-to-box.js +1 -1
  185. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  186. package/package.json +5 -5
  187. package/dist/format/lib/content/section-padding.js +0 -1
@@ -0,0 +1 @@
1
+ import{AUTO_RULES as u,FOLLOW_RULES as d,VIEW_DESKTOP_MIN as w,VIEW_TABLET_MIN as s,isAuto as I,resolveViewValue as L}from"efficient-easel/draw";const O="v1";function f(){return O==="v2"?u:d}const p=.02,A=`(min-width: ${s}px) and (max-width: ${w-p}px)`,S=`(max-width: ${s-p}px)`;function T(x,n,i,r,c=f()){const t=L(x,n,i,r,c),o={},E=(_,e)=>!I(_)||e!=null&&e!==n;return E(i,t.tablet)&&(o.tablet=t.tablet),E(r,t.phone)&&(o.phone=t.phone),o}export{S as PHONE_MEDIA,O as RESPONSIVE_RULES,A as TABLET_MEDIA,T as viewOverrides,f as viewRules};
@@ -1 +1 @@
1
- import{jsx as c}from"react/jsx-runtime";import{CardRowValues as P}from"../../../../../components/CardRowContext.js";import R from"../../../../../components/ButtonBlock.js";import{CARD_ROW_LINK_PROP as p,namedRowField as m}from"../../../../../../format/lib/content/card-template.js";import{CTA_PH as _}from"../../../../../../format/lib/document/blocks/placeholders.js";import{phPrev as k}from"../../scaffold.js";import{ButtonBlockMeta as v}from"../../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";const H={...v,render:o=>{const{label:n,href:i,variant:d,align:f,contained:s,arrow:u,icon:w,iconPosition:C,widthFit:b,buttonColor:h,buttonTextColor:x,editor:B}=o,e=(t,r)=>c(R,{label:k(t,_.text,B)??"",href:r,variant:d,align:f,contained:s,arrow:u,icon:w,iconPosition:C,widthFit:b,buttonColor:h,buttonTextColor:x}),a=m(o),l=m(o,p);return!a&&!l?e(n,i):c(P,{fields:[a,l],children:([t,r])=>e(t??n,r??i)})}};export{H as ButtonBlockRender};
1
+ import{jsx as c}from"react/jsx-runtime";import{CardRowValues as R}from"../../../../../components/CardRowContext.js";import O from"../../../../../components/ButtonBlock.js";import{CARD_ROW_LINK_PROP as _,namedRowField as d}from"../../../../../../format/lib/content/card-template.js";import{CTA_PH as j}from"../../../../../../format/lib/document/blocks/placeholders.js";import{phPrev as p}from"../../scaffold.js";import{ButtonBlockMeta as F}from"../../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";const D={...F,render:o=>{const{label:n,href:i,variant:m,align:s,contained:f,arrow:u,icon:b,iconPosition:w,widthFit:h,buttonColor:B,buttonTextColor:C,editor:P}=o,x=Object.fromEntries(Object.entries(o).filter(([t])=>t==="buttonFillOpacity"||t==="buttonBorder"||t.startsWith("buttonPadding"))),e=(t,r)=>c(O,{label:p(t,j.text,P)??"",href:r,variant:m,align:s,contained:f,arrow:u,icon:b,iconPosition:w,widthFit:h,buttonColor:B,buttonTextColor:C,...x}),l=d(o),a=d(o,_);return!l&&!a?e(n,i):c(R,{fields:[l,a],children:([t,r])=>e(t??n,r??i)})}};export{D as ButtonBlockRender};
@@ -1 +1 @@
1
- import{jsx as d}from"react/jsx-runtime";import c from"../../../../../components/Divider.js";import{padValuesOf as a}from"../../../../../../format/lib/content/section-padding.js";import{DividerMeta as m}from"../../../../../../format/lib/document/blocks/general/Divider/meta.js";const g={...m,render:e=>{const{spacing:i,contained:t,style:n,thickness:r,lengthPct:o,hideOnMobile:s}=e;return d(c,{spacing:i,contained:t,style:n,thickness:r,lengthPct:o,hideOnMobile:s===!0,pad:a(e)})}};export{g as DividerRender};
1
+ import{jsx as d}from"react/jsx-runtime";import c from"../../../../../components/Divider.js";import{padValuesOf as a}from"../../../../content/section-padding.js";import{DividerMeta as m}from"../../../../../../format/lib/document/blocks/general/Divider/meta.js";const g={...m,render:e=>{const{spacing:i,contained:t,style:n,thickness:r,lengthPct:o,hideOnMobile:s}=e;return d(c,{spacing:i,contained:t,style:n,thickness:r,lengthPct:o,hideOnMobile:s===!0,pad:a(e)})}};export{g as DividerRender};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import t from"../../../../../components/Flex.js";import{sectionFillsHeight as a}from"../../../../../../format/lib/content/section-min-height.js";import{FlexMeta as i}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";const h={...i,render:e=>n(t,{direction:e.direction,label:e.label,gap:e.gap,justify:e.justify,align:e.align,wrap:e.wrap,share:e.share,phoneRow:e.phoneRow,blockSpacing:e.blockSpacing,bgImage:e.bgImage,bgImagePhone:e.bgImagePhone,darken:e.darken,darkenStyle:e.darkenStyle,placement:e.placement,padV2:e.padV2===!0,border:e.sectionBorder,borderPhone:e.sectionBorderPhone,padTop:e.sectionPaddingTop,padBottom:e.sectionPaddingBottom,padTopPhone:e.sectionPaddingTopPhone,padBottomPhone:e.sectionPaddingBottomPhone,padLeft:e.sectionPaddingLeft,padRight:e.sectionPaddingRight,padLeftPhone:e.sectionPaddingLeftPhone,padRightPhone:e.sectionPaddingRightPhone,contained:e.contained,fillHeight:a(e),content:e.content})};export{h as FlexRender};
1
+ import{jsx as a}from"react/jsx-runtime";import n from"../../../../../components/Flex.js";import{padValuesOf as t}from"../../../../content/section-padding.js";import{sectionFillsHeight as i}from"../../../../../../format/lib/content/section-min-height.js";import{FlexMeta as d}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";const h={...d,render:e=>a(n,{direction:e.direction,label:e.label,tabShape:e.tabShape,gap:e.gap,justify:e.justify,align:e.align,wrap:e.wrap,share:e.share,phoneRow:e.phoneRow,blockSpacing:e.blockSpacing,bgImage:e.bgImage,bgImagePhone:e.bgImagePhone,darken:e.darken,darkenStyle:e.darkenStyle,placement:e.placement,padV2:e.padV2===!0,border:e.sectionBorder,borderPhone:e.sectionBorderPhone,pad:t(e),contained:e.contained,fillHeight:i(e),shadow:e.shadow,content:e.content})};export{h as FlexRender};
@@ -1 +1 @@
1
- import{Fragment as d,jsx as t}from"react/jsx-runtime";import{padValuesOf as m}from"../../../../../../format/lib/content/section-padding.js";import f from"../../../../../components/Heading.js";import{hidableText as l,readHidable as p}from"efficient-easel/draw";import{PH as g}from"../../../../../../format/lib/document/blocks/placeholders.js";import{phPrev as s}from"../../scaffold.js";import{HeadingMeta as x}from"../../../../../../format/lib/document/blocks/general/Heading/meta.js";const F={...x,render:e=>{const{text:r,level:i,align:a,contained:n,editor:o}=e;return p(r).hidden?t(d,{}):t(f,{text:s(l(r),g.heading,o)??"",level:i,align:a,contained:n,pad:m(e)})}};export{F as HeadingRender};
1
+ import{Fragment as d,jsx as t}from"react/jsx-runtime";import{padValuesOf as m}from"../../../../content/section-padding.js";import f from"../../../../../components/Heading.js";import{hidableText as l,readHidable as p}from"efficient-easel/draw";import{PH as g}from"../../../../../../format/lib/document/blocks/placeholders.js";import{phPrev as s}from"../../scaffold.js";import{HeadingMeta as x}from"../../../../../../format/lib/document/blocks/general/Heading/meta.js";const F={...x,render:e=>{const{text:r,level:i,align:a,contained:n,editor:o}=e;return p(r).hidden?t(d,{}):t(f,{text:s(l(r),g.heading,o)??"",level:i,align:a,contained:n,pad:m(e)})}};export{F as HeadingRender};
@@ -1 +1 @@
1
- import{jsx as x}from"react/jsx-runtime";import G from"../../../../../components/HeroGroup.js";import{HeroGroupMeta as H}from"../../../../../../format/lib/document/blocks/general/HeroGroup/meta.js";const L={...H,render:({placement:o,nudgeX:e,nudgeY:n,width:t,gap:i,direction:d,justify:r,align:a,wrap:g,sectionPaddingTop:c,sectionPaddingBottom:s,sectionPaddingTopPhone:p,sectionPaddingBottomPhone:P,sectionPaddingLeft:m,sectionPaddingRight:f,sectionPaddingLeftPhone:h,sectionPaddingRightPhone:u,content:R,editor:j})=>x(G,{placement:o,nudgeX:e,nudgeY:n,width:t,gap:i,direction:d,justify:r,align:a,wrap:g,sectionPaddingTop:c,sectionPaddingBottom:s,sectionPaddingTopPhone:p,sectionPaddingBottomPhone:P,sectionPaddingLeft:m,sectionPaddingRight:f,sectionPaddingLeftPhone:h,sectionPaddingRightPhone:u,content:R,dragRef:j?.dragRef})};export{L as HeroGroupRender};
1
+ import{jsx as f}from"react/jsx-runtime";import c from"../../../../../components/HeroGroup.js";import{padValuesOf as s}from"../../../../content/section-padding.js";import{HeroGroupMeta as l}from"../../../../../../format/lib/document/blocks/general/HeroGroup/meta.js";const H={...l,render:e=>{const{placement:r,nudgeX:t,nudgeY:o,width:n,gap:a,direction:d,justify:i,align:p,wrap:u,content:g,editor:m}=e;return f(c,{placement:r,nudgeX:t,nudgeY:o,width:n,gap:a,direction:d,justify:i,align:p,wrap:u,pad:s(e),content:g,dragRef:m?.dragRef})}};export{H as HeroGroupRender};
@@ -1 +1 @@
1
- import{jsx as h}from"react/jsx-runtime";import S from"../../../../../components/HeroSlide.js";import{nestedAccentValue as b,sectionThemeWrap as j}from"../../../../../../format/lib/content/section-surface.js";import{phHide as H}from"../../scaffold.js";import{HeroSlideMeta as x}from"../../../../../../format/lib/document/blocks/general/HeroSlide/meta.js";const E={...x,render:({name:s,process:d,mediaType:e,mediaVideo:m,mediaImage:c,poster:f,mediaSrc:a,videoSpeed:n,imageFocal:p,imageFocalPhone:t,tintColor:u,overlay:l,groups:g,editor:i,...o})=>{const r=j({...o,sectionAccent:b(o.sectionAccent)});return h(S,{themeClassName:r?.className,themeStyle:r?.style,name:s||void 0,process:H(d,"Label",i),mediaType:e,mediaSrc:(e==="image"?c:m||a)||void 0,videoSpeed:typeof n=="number"?n:void 0,poster:f||void 0,objectPosition:e==="image"&&p||void 0,objectPositionPhone:e==="image"&&typeof t=="string"?t:void 0,tintColor:u,tintOpacity:e==="image"?l:0,groups:g,editing:i?.isEditing})}};export{E as HeroSlideRender};
1
+ import{jsx as b}from"react/jsx-runtime";import j from"../../../../../components/HeroSlide.js";import{nestedAccentValue as H,sectionThemeWrap as x}from"../../../../../../format/lib/content/section-surface.js";import{phHide as A}from"../../scaffold.js";import{HeroSlideMeta as y}from"../../../../../../format/lib/document/blocks/general/HeroSlide/meta.js";import{loadingStill as C}from"../../../../../../format/lib/hero-video.js";const R={...y,render:({name:m,process:s,mediaType:e,mediaVideo:d,mediaImage:c,poster:f,loadingShows:a,videoFrame:l,mediaSrc:p,videoSpeed:t,imageFocal:u,imageFocalPhone:i,tintColor:g,overlay:S,groups:h,editor:n,...o})=>{const r=x({...o,sectionAccent:H(o.sectionAccent)});return b(j,{themeClassName:r?.className,themeStyle:r?.style,name:m||void 0,process:A(s,"Label",n),mediaType:e,mediaSrc:(e==="image"?c:d||p)||void 0,videoSpeed:typeof t=="number"?t:void 0,poster:C({loadingShows:a,poster:f,videoFrame:l}),objectPosition:e==="image"&&u||void 0,objectPositionPhone:e==="image"&&typeof i=="string"?i:void 0,tintColor:g,tintOpacity:e==="image"?S:0,groups:h,editing:n?.isEditing})}};export{R as HeroSlideRender};
@@ -1 +1 @@
1
- import{jsx as c}from"react/jsx-runtime";import d from"../../../../../components/Logos.js";import{phRows as l,phHide as n}from"../../scaffold.js";import{say as o}from"../../../../../../format/lib/editor-words.js";import{LogosMeta as f}from"../../../../../../format/lib/document/blocks/general/Logos/meta.js";const p=()=>[{src:"",alt:o("Logo one")},{src:"",alt:o("Logo two")},{src:"",alt:o("Logo three")},{src:"",alt:o("Logo four")},{src:"",alt:o("Logo five")}],y={...f,render:({items:s,contained:t,heading:e,columns:a,logoHeight:g,bandPadding:m,grayscale:i,editor:r})=>c(d,{items:l(s,p(),r),contained:t,heading:n(e,"Trusted by *teams worldwide*",r),columns:a,logoHeight:g,bandPadding:m,grayscale:i})};export{y as LogosRender};
1
+ import{jsx as f}from"react/jsx-runtime";import p from"../../../../../components/Logos.js";import{phRows as L,phHide as u}from"../../scaffold.js";import{say as o}from"../../../../../../format/lib/editor-words.js";import{parseLogoLook as w}from"../../../../../../format/lib/sections/logo-look.js";import{parseSectionHeadPlacement as h}from"../../../../../../format/lib/sections/section-head-placement.js";import{LogosMeta as x}from"../../../../../../format/lib/document/blocks/general/Logos/meta.js";const y=()=>[{src:"",alt:o("Logo one")},{src:"",alt:o("Logo two")},{src:"",alt:o("Logo three")},{src:"",alt:o("Logo four")},{src:"",alt:o("Logo five")}],S={...x,render:({items:e,contained:s,heading:a,columns:n,logoHeight:m,bandPadding:d,grayscale:i,logos:g,look:c,headPlacement:l,editor:t})=>{const r=h(l)==="own-box";return f(p,{items:r?Array.isArray(e)?e:[]:L(e,y(),t),contained:s,heading:r?void 0:u(a,"Trusted by *teams worldwide*",t),columns:n,logoHeight:m,bandPadding:d,grayscale:i,logos:r?g:void 0,look:w(c),omitHead:r})}};export{S as LogosRender};
@@ -1 +1 @@
1
- import{Fragment as u,jsx as s}from"react/jsx-runtime";import l from"../../../../../components/PaymentBadges.js";import{declaredBlockSource as y,sourcedRows as b}from"../../../../../../format/lib/content/block-sources.js";import{phRows as c,phHide as i}from"../../scaffold.js";import{say as a}from"../../../../../../format/lib/editor-words.js";import{PaymentBadgesMeta as f,PAYMENT_PH as g}from"../../../../../../format/lib/document/blocks/general/PaymentBadges/meta.js";const P=[{label:"Visa"},{label:"Mastercard"},{label:"Amex"},{label:"PayPal"}],p=()=>[{text:a("Secure encrypted checkout")},{text:a("30-day returns")}],A=()=>[{label:a("Payment method")},{label:a("Payment method")},{label:a("Payment method")}],w={...f,render:t=>{const{heading:o,badges:h,assurances:r,contained:d,editor:e}=t;if(y(t)!==""){const m=b(t,!!e?.isEditing,A()).rows.filter(n=>n.label).map(n=>({label:n.label}));return m.length?s(l,{heading:i(o,g.heading,e),badges:m,assurances:Array.isArray(r)?r:[],contained:d}):s(u,{})}return s(l,{heading:i(o,g.heading,e),badges:c(h,P,e),assurances:c(r,p(),e),contained:d})}};export{w as PaymentBadgesRender};
1
+ import{Fragment as b,jsx as t}from"react/jsx-runtime";import c from"../../../../../components/PaymentBadges.js";import{declaredBlockSource as h,sourcedRows as f}from"../../../../../../format/lib/content/block-sources.js";import{phRows as l,phHide as m}from"../../scaffold.js";import{say as a}from"../../../../../../format/lib/editor-words.js";import{PaymentBadgesMeta as y,PAYMENT_PH as u}from"../../../../../../format/lib/document/blocks/general/PaymentBadges/meta.js";const p=[{label:"Visa"},{label:"Mastercard"},{label:"Amex"},{label:"PayPal"}],k=()=>[{text:a("Secure encrypted checkout")},{text:a("30-day returns")}],A=()=>[{label:a("Cash"),kind:"cash"},{label:a("Card"),kind:"card"},{label:a("Bank transfer"),kind:"wire"}],M={...y,render:n=>{const{heading:d,badges:g,assurances:s,contained:o,editor:e}=n;if(h(n)!==""){const i=f(n,!!e?.isEditing,A()).rows.filter(r=>r.label).map(r=>({label:r.label,kind:r.kind}));return i.length?t(c,{heading:m(d,u.heading,e),badges:i,assurances:Array.isArray(s)?s:[],contained:o,sourced:!0}):t(b,{})}return t(c,{heading:m(d,u.heading,e),badges:l(g,p,e),assurances:l(s,k(),e),contained:o})}};export{M as PaymentBadgesRender};
@@ -1 +1 @@
1
- import{Fragment as g,jsx as o}from"react/jsx-runtime";import{CardRowValues as h}from"../../../../../components/CardRowContext.js";import{namedRowField as u}from"../../../../../../format/lib/content/card-template.js";import{padValuesOf as y}from"../../../../../../format/lib/content/section-padding.js";import S from"../../../../../components/Text.js";import{hidableText as d,readHidable as T}from"efficient-easel/draw";import{PH as m}from"../../../../../../format/lib/document/blocks/placeholders.js";import{phPrev as b}from"../../scaffold.js";import{readPartStyle as w}from"../../../part-styles.js";import{TextMeta as F}from"../../../../../../format/lib/document/blocks/general/Text/meta.js";const W={...F,render:t=>{const{text:e,align:l,tone:f,tag:x,contained:s,editor:c}=t;if(T(e).hidden)return o(g,{});const a=w(t,"text").textStyle,p=a?.startsWith("heading-")?m.heading:m.body,i=r=>o(S,{text:b(r,p,c)??"",align:l,tone:f,tag:x,textStyle:a,contained:s,pad:y(t)}),n=u(t);return n?o(h,{fields:[n],children:([r])=>i(r??d(e))}):i(d(e))}};export{W as TextRender};
1
+ import{Fragment as g,jsx as o}from"react/jsx-runtime";import{CardRowValues as h}from"../../../../../components/CardRowContext.js";import{namedRowField as u}from"../../../../../../format/lib/content/card-template.js";import{padValuesOf as y}from"../../../../content/section-padding.js";import S from"../../../../../components/Text.js";import{hidableText as d,readHidable as T}from"efficient-easel/draw";import{PH as m}from"../../../../../../format/lib/document/blocks/placeholders.js";import{phPrev as b}from"../../scaffold.js";import{readPartStyle as w}from"../../../part-styles.js";import{TextMeta as F}from"../../../../../../format/lib/document/blocks/general/Text/meta.js";const W={...F,render:t=>{const{text:e,align:l,tone:f,tag:x,contained:s,editor:c}=t;if(T(e).hidden)return o(g,{});const a=w(t,"text").textStyle,p=a?.startsWith("heading-")?m.heading:m.body,i=r=>o(S,{text:b(r,p,c)??"",align:l,tone:f,tag:x,textStyle:a,contained:s,pad:y(t)}),n=u(t);return n?o(h,{fields:[n],children:([r])=>i(r??d(e))}):i(d(e))}};export{W as TextRender};
@@ -1,3 +1,4 @@
1
+ import { SECTION_PAD_INNER_DEFAULTS } from "../../passes/section-padding.js";
1
2
  import { type BoxEntry, type PartRow, type SiteWrite } from "../../../sections/section-to-box.js";
2
3
  type Props = Record<string, unknown>;
3
4
  export declare const TEXT: Props;
@@ -16,7 +17,9 @@ export type OwnPad = {
16
17
  bottomPhone: number;
17
18
  };
18
19
  export declare function wrapperPad(p: Props, own: OwnPad): Props;
19
- export declare const wrapperPadKeys: (own: OwnPad) => BoxEntry[];
20
+ export declare const wrapperPadKeys: (own: OwnPad | ((props: Props) => OwnPad)) => BoxEntry[];
21
+ export declare function innerPad(p: Props, type: keyof typeof SECTION_PAD_INNER_DEFAULTS): Props;
22
+ export declare const innerPadKeys: (type: keyof typeof SECTION_PAD_INNER_DEFAULTS) => BoxEntry[];
20
23
  export declare const HEADING_CASE_UPPER: SiteWrite;
21
24
  export declare const headingCaseOf: (key: string) => (node: {
22
25
  props: Props;
@@ -1 +1 @@
1
- import{NESTED_BOX_PADDING as c}from"../../../../../format/lib/content/box-layout.js";import{ButtonBlockMeta as r}from"../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";import{TextMeta as a}from"../../../../../format/lib/document/blocks/general/Text/meta.js";import{finiteNumber as n}from"../../../../../format/lib/finite-number.js";import{hasWords as p}from"../../../sections/section-to-box.js";const{text:B,tag:_,...h}=a.defaultProps,s=h,b={...s,tone:"dim"},{label:D,href:E,...g}=r.defaultProps,O=g,d={justify:"start",align:"stretch",wrap:!1,blockSpacing:"gap",padV2:!0},S={...d,direction:"column",...c},M={...d,sectionAccent:0},N=["gridSpan","backgroundWidth","contentWidth","contentMax","widthMode","sectionHeightMode","sectionHeightValue","sectionHeightUnit","sectionHeightModePhone","sectionHeightValuePhone","sectionHeightUnitPhone","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderPhone","sectionAccent","stickTop","stickTopDistance","stickTopPhone","stickTopDistancePhone","anchor","sectionAnimation","_hidden"],k={sectionSurface:"read by nothing in src/ (searched 2026-10-24): a retired theme key that draws nothing today, so dropping it changes nothing"},A=Object.fromEntries(["sectionPaddingLeft","sectionPaddingRight","sectionPaddingLeftPhone","sectionPaddingRightPhone"].map(o=>[o,"needs Box side padding outside its gutter: the old section added it outside its frame, a Box's side padding replaces the gutter. 0 live nodes store it (JJ's read-only export, 2026-10-24)"]));function P(o,t){const i=n(o.sectionPaddingTop)??0,e=n(o.sectionPaddingBottom)??0;return{sectionPaddingTop:i+t.top,sectionPaddingBottom:e+t.bottom,sectionPaddingTopPhone:(n(o.sectionPaddingTopPhone)??i)+t.topPhone,sectionPaddingBottomPhone:(n(o.sectionPaddingBottomPhone)??e)+t.bottomPhone}}const H=o=>["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopPhone","sectionPaddingBottomPhone"].map(t=>[t,t,(i,e)=>P(e,o)[t]]),m={kind:"heading-case-upper",styles:["heading-1","heading-2","heading-3"]},I=o=>t=>p(t.props[o])?[m]:[],C=(o,t)=>({kind:"text",key:o,role:"eyebrow",props:s,...t?{style:t}:{}});export{d as BOX,O as BUTTON,b as DIM,k as DROP_COMMON,A as DROP_SIDE_PADDING,m as HEADING_CASE_UPPER,S as INNER_BOX,N as SAME_KEYS,M as SECTION_BOX,s as TEXT,I as headingCaseOf,C as smallText,P as wrapperPad,H as wrapperPadKeys};
1
+ import{NESTED_BOX_PADDING as a}from"../../../../../format/lib/content/box-layout.js";import{resolveSectionPadding as r}from"../../../content/section-padding.js";import{ButtonBlockMeta as p}from"../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";import{TextMeta as g}from"../../../../../format/lib/document/blocks/general/Text/meta.js";import{SECTION_PAD_INNER_DEFAULTS as P}from"../../passes/section-padding.js";import{finiteNumber as i}from"../../../../../format/lib/finite-number.js";import{hasWords as h}from"../../../sections/section-to-box.js";const{text:b,tag:N,...m}=g.defaultProps,s=m,O={...s,tone:"dim"},{label:A,href:M,...T}=p.defaultProps,I=T,c={justify:"start",align:"stretch",wrap:!1,blockSpacing:"gap",padV2:!0},k={...c,direction:"column",...a},v={...c,sectionAccent:0},C=["gridSpan","backgroundWidth","contentWidth","contentMax","widthMode","sectionHeightMode","sectionHeightValue","sectionHeightUnit","sectionHeightModePhone","sectionHeightValuePhone","sectionHeightUnitPhone","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderPhone","sectionAccent","stickTop","stickTopDistance","stickTopPhone","stickTopDistancePhone","anchor","sectionAnimation","_hidden"],H={sectionSurface:"read by nothing in src/ (searched 2026-10-24): a retired theme key that draws nothing today, so dropping it changes nothing"},R=Object.fromEntries(["sectionPaddingLeft","sectionPaddingRight","sectionPaddingLeftPhone","sectionPaddingRightPhone"].map(o=>[o,"needs Box side padding outside its gutter: the old section added it outside its frame, a Box's side padding replaces the gutter. 0 live nodes store it (JJ's read-only export, 2026-10-24)"]));function x(o,t){const e=i(o.sectionPaddingTop)??0,n=i(o.sectionPaddingBottom)??0;return{sectionPaddingTop:e+t.top,sectionPaddingBottom:n+t.bottom,sectionPaddingTopPhone:(i(o.sectionPaddingTopPhone)??e)+t.topPhone,sectionPaddingBottomPhone:(i(o.sectionPaddingBottomPhone)??n)+t.bottomPhone}}const U=o=>["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopPhone","sectionPaddingBottomPhone"].map(t=>[t,t,(e,n)=>x(n,typeof o=="function"?o(n):o)[t]]);function d(o,t){const e=r(o,P[t]);return{sectionPaddingTop:e.top,sectionPaddingBottom:e.bottom}}const X=o=>[["padTop","sectionPaddingTop",(t,e)=>d(e,o).sectionPaddingTop],["padBottom","sectionPaddingBottom",(t,e)=>d(e,o).sectionPaddingBottom],["sectionPaddingTop","sectionPaddingTop",(t,e)=>d(e,o).sectionPaddingTop],["sectionPaddingBottom","sectionPaddingBottom",(t,e)=>d(e,o).sectionPaddingBottom]],f={kind:"heading-case-upper",styles:["heading-1","heading-2","heading-3"]},y=o=>t=>h(t.props[o])?[f]:[],G=(o,t)=>({kind:"text",key:o,role:"eyebrow",props:s,...t?{style:t}:{}});export{c as BOX,I as BUTTON,O as DIM,H as DROP_COMMON,R as DROP_SIDE_PADDING,f as HEADING_CASE_UPPER,k as INNER_BOX,C as SAME_KEYS,v as SECTION_BOX,s as TEXT,y as headingCaseOf,d as innerPad,X as innerPadKeys,G as smallText,x as wrapperPad,U as wrapperPadKeys};
@@ -0,0 +1,2 @@
1
+ import { type SectionToBoxRow } from "../../../sections/section-to-box.js";
2
+ export declare const LOGOS_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
@@ -0,0 +1 @@
1
+ import{hasWords as t}from"../../../sections/section-to-box.js";import{DROP_COMMON as d,DROP_SIDE_PADDING as i,INNER_BOX as l,SAME_KEYS as c,SECTION_BOX as p,TEXT as n,smallText as g,wrapperPad as s,wrapperPadKeys as m}from"./section-to-box-row-parts.js";import{finiteNumber as P}from"../../../../../format/lib/finite-number.js";const h={contained:!1},b=(o,e)=>({logos:[{kind:"list",key:o,name:"Logo",flat:!0,parts:[{kind:"block",type:"LogoBlock",box:["src",[e,"alt"]],when:(S,r)=>t(r?.src)||t(r?.[e])}]}]}),a=o=>{const e=P(o.bandPadding)??40;return{top:e,bottom:e,topPhone:e,bottomPhone:e}},k={...g("heading",{color:"labels",letterSpacing:.2}),props:{...n,align:"center"}},f={name:"Logos",on:!1,boxProps:o=>({...p,direction:"column",gap:32,...s(o,a(o))}),box:[...c,...m(a),["bandPadding","sectionPaddingTop",(o,e)=>s(e,a(e)).sectionPaddingTop]],parts:[k,{kind:"core",keep:["columns","logoHeight","grayscale"],rename:{logosPerRow:"columns"},props:h,slots:b("items","alt")}],drop:{...d,...i,contained:"the Box draws the site frame now; the Logos block inside it fills the Box's column (`contained: false`)",headPlacement:"a Logos band has no split head (not in SPLITTABLE_SECTIONS): no stored node can hold one, and the converted block stores own-box"}},u={top:24,bottom:24,topPhone:24,bottomPhone:24},O={name:"Payment Methods",on:!1,boxProps:o=>({...p,direction:"column",...s(o,u)}),box:[...c,...m(u)],skip:o=>t(o.dataSource)?"its payment methods come from a data source (a venue's Setup): a sourced list needs the card template (plan §3.2), not built yet":void 0,parts:[{kind:"group",name:"Methods",props:{...l,align:"center",gap:20,sectionBorder:{top:1,bottom:1},sectionPaddingTop:32,sectionPaddingBottom:32},parts:[{...g("heading",{color:"labels"}),props:{...n,align:"center"}},{kind:"core",keep:[],as:"Logos",props:{...h,look:"cards",grayscale:!1},slots:b("badges","label")},{kind:"group",name:"Reassurance",props:{...l,direction:"row",wrap:!0,justify:"center",gap:24},parts:[{kind:"list",key:"assurances",name:"Line",flat:!0,parts:[{kind:"text",key:"text",props:{...n,align:"center"},style:{size:13,color:"labels"}}]}]}]}],drop:{...d,...i,contained:"the Box draws the site frame now; the Logos block inside it fills the Box's column (`contained: false`)",dataSource:"empty: no source, so the authored badges above are the list (a node that names a source is skipped, see `skip`)"}},L={Logos:f,PaymentBadges:O};export{L as LOGOS_SECTION_TO_BOX};
@@ -0,0 +1,5 @@
1
+ import { type SectionToBoxRow } from "../../../sections/section-to-box.js";
2
+ type Props = Record<string, unknown>;
3
+ export declare function figureWords(item: Props): string;
4
+ export declare const STATS_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
5
+ export {};
@@ -0,0 +1 @@
1
+ import{hasWords as l}from"../../../sections/section-to-box.js";import{DIM as g,DROP_COMMON as c,DROP_SIDE_PADDING as h,INNER_BOX as n,SAME_KEYS as u,SECTION_BOX as S,TEXT as o,headingCaseOf as w,innerPad as x,innerPadKeys as y,smallText as i}from"./section-to-box-row-parts.js";const a=e=>typeof e=="string"?e.trim():"";function p(e){const t=`${a(e.prefix)}${a(e.value)}`,s=a(e.suffix);return e.emphasizeAll===!0?t?`==_${t}_==`:"":`${t}${s?`==_${s}_==`:""}`}const r={kind:"block",type:"Text",props:{...o,_partStyles:{text:{textStyle:"heading-1",case:"none",lineHeight:.9,letterSpacing:-.04}}},box:[["value","text",(e,t)=>p(t)]],when:(e,t)=>t!==void 0&&typeof t.value=="string"&&p(t)!==""},d=e=>l(e?.supSuffix),b={name:"Stats with Text",on:!1,boxProps:e=>({...S,direction:"column",gap:60,sectionBorder:{bottom:1},...x(e,"StatsParagraph")}),box:[...u,...y("StatsParagraph")],parts:[{kind:"group",name:"Header",props:{...n,direction:"row",align:"end",justify:"between",gap:40,share:"content",sectionBorder:{bottom:1},sectionPaddingBottom:32},parts:[{kind:"group",name:"Title",props:{...n,direction:"row",align:"end",gap:40,share:"content"},parts:[i("eyebrow"),{kind:"text",key:"title",role:"heading",props:o,style:{lineHeight:1,letterSpacing:-.03}}]},{kind:"text",key:"desc",props:{...g,align:"right"},style:{textStyle:"body-1",lineHeight:1.5,width:360},was:{size:15}}]},{kind:"group",name:"Stats",props:{...n,gap:0},parts:[{kind:"list",key:"stats",name:"Stat",perRow:()=>4,rowName:"Stats row",rowProps:{...n,direction:"row",gap:0,share:"equal"},props:{...n,justify:"between",gap:12,sectionPaddingTop:48,sectionPaddingBottom:48,sectionPaddingLeft:32,sectionPaddingRight:32,sectionBorder:{top:1,right:1,bottom:1,left:1}},parts:[{...r,when:(e,t)=>!d(t)&&r.when(e,t)},{kind:"group",name:"Figure",props:{...n,direction:"row",align:"start",gap:32,share:"content"},when:(e,t)=>d(t),parts:[r,{kind:"text",key:"supSuffix",props:o,style:{textStyle:"body-5",color:"accent",letterSpacing:.18,lineHeight:1,padding:18}}]},{kind:"group",name:"Words",props:{...n,gap:4},parts:[{kind:"text",key:"label",props:o,style:{textStyle:"body-1",letterSpacing:-.01},was:{size:16}},i("sub",{color:"labels",letterSpacing:.24})]}]}]}],site:w("title"),drop:{...c,...h,background:"needs a Box fill: the old band painted this colour (the theme's section band, `var(--section-bg)`, or none) behind the head and round the cards, and a Box paints only its theme's page colour",headPlacement:"needs a row per head placement: an own-box Stats with Text draws no head (its words sit in a Section Header above it), the row always draws the head"}},k={StatsParagraph:b};export{k as STATS_SECTION_TO_BOX,p as figureWords};
@@ -1,7 +1,3 @@
1
1
  import { type SectionToBoxRow } from "../../../sections/section-to-box.js";
2
- export declare const XM_SITE: {
3
- readonly schema: "xtreme_mudder";
4
- readonly site: "xtreme-mudder";
5
- };
6
2
  export declare const GENERAL_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
7
3
  export declare function registerGeneralSectionRows(): void;
@@ -1 +1 @@
1
- import{resolveSectionPadding as B}from"../../../../../format/lib/content/section-padding.js";import{SECTION_PAD_INNER_DEFAULTS as T}from"../../passes/section-padding.js";import{hasWords as _,headParts as H,registerSectionToBox as E}from"../../../sections/section-to-box.js";import{BUTTON as g,DIM as l,DROP_COMMON as s,DROP_SIDE_PADDING as c,INNER_BOX as e,SAME_KEYS as d,SECTION_BOX as p,TEXT as i,headingCaseOf as h,smallText as r,wrapperPad as m,wrapperPadKeys as u}from"./section-to-box-row-parts.js";import{finiteNumber as N}from"../../../../../format/lib/finite-number.js";function a(t,o){const n=B(t,T[o]);return{sectionPaddingTop:n.top,sectionPaddingBottom:n.bottom}}const y=t=>[["padTop","sectionPaddingTop",(o,n)=>a(n,t).sectionPaddingTop],["padBottom","sectionPaddingBottom",(o,n)=>a(n,t).sectionPaddingBottom],["sectionPaddingTop","sectionPaddingTop",(o,n)=>a(n,t).sectionPaddingTop],["sectionPaddingBottom","sectionPaddingBottom",(o,n)=>a(n,t).sectionPaddingBottom]],P={top:72,bottom:72,topPhone:72,bottomPhone:72},[v,O]=H("Prose"),A={name:"Editorial Text",on:!1,boxProps:t=>({...p,direction:"column",gap:28,sectionBorder:{top:1},...m(t,P)}),box:[["topBorder","sectionBorder",t=>t===!1?void 0:{top:1}],...d,...u(P)],parts:[{kind:"group",name:"Heading",props:{...e,gap:16},parts:[{...v,props:i},{...O,props:i,style:{textStyle:"heading-3",lineHeight:1,letterSpacing:-.02}}]},{kind:"text",key:"body",props:l,style:{textStyle:"body-1",lineHeight:1.7,width:680,paragraphSpacing:18},was:{size:16}}],site:h("title"),drop:{...s,...c,headPlacement:"needs a row per head placement: an own-box Prose draws no head (its words sit in a Section Header above it), the row always draws the head. 0 of 123 live nodes store it (JJ's export, 2026-10-24)"}},R={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},k=(t,o)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:t,parts:[{kind:"button",key:"label",href:"href",variant:{key:"variant",map:{primary:"primary",outline:"ghost"},fallback:"ghost"},style:{letterSpacing:.3},props:{...g,...R,...o}}]}),b=t=>_(t.title),D={name:"Call-to-Action Heading",on:!1,boxProps:t=>({...p,direction:"row",align:"center",justify:b(t)?"between":"end",gap:60,share:"content",sectionBorder:{bottom:1},...a(t,"TitleWithButtons")}),box:[...d,...y("TitleWithButtons")],parts:[{kind:"group",name:"Title",props:e,parts:[{kind:"text",key:"title",role:"heading",props:i,style:{textStyle:"heading-1",lineHeight:.94,letterSpacing:-.035,width:1e3}}]},{kind:"group",name:"Buttons",props:{...e,gap:14},parts:[k(b,{widthFit:"fill",iconPosition:"end"}),k(t=>!b(t),{})]}],site:h("title"),drop:{...s,buttonsAlign:"moves the buttons only when there is no heading (4 of 128 live nodes), where the Box puts them at the end. 0 of 128 live nodes store it (JJ's export, 2026-10-24)"}},w={top:40,bottom:64,topPhone:24,bottomPhone:36},I={buttonFillOpacity:0,buttonBorder:{width:0},buttonPaddingTop:0,buttonPaddingRight:0,buttonPaddingBottom:0,buttonPaddingLeft:0},W={name:"Section Header",on:!1,boxProps:t=>({...p,direction:"column",gap:0,...m(t,w)}),box:[...d,"fullWidth","pageWidth",...u(w)],parts:[{kind:"group",name:"Header",props:{...e,direction:"row",align:"end",justify:"between",gap:40,share:"content",sectionBorder:{bottom:1},sectionPaddingBottom:24,sectionPaddingBottomPhone:20},parts:[{kind:"group",name:"Title",props:{...e,direction:"row",align:"end",gap:40,share:"content"},parts:[{kind:"group",name:"Number",props:{...e,align:"start",gap:12},parts:[{kind:"image",key:"logoSrc",alt:"logoAlt",props:{aspect:"auto",contained:!1}},r("num")]},{kind:"text",key:"title",role:"heading",props:i,style:{lineHeight:.95,letterSpacing:-.025}}]},{kind:"group",name:"Words",props:{...e,align:"end",gap:12},parts:[{kind:"text",key:"description",props:{...l,align:"right"},style:{textStyle:"body-5",lineHeight:1.5,width:340},was:{size:14}},{kind:"button",key:"linkText",href:"linkHref",variant:"ghost",props:{...g,align:"right",...I},style:{textStyle:"body-5",color:"labels"}}]}]}],site:h("title"),drop:{...s,...c,headStyle:"needs a row per head look: the row draws the standard look; the editorial, simple, statement, natural and essay looks are other layouts. 0 of 69 live nodes store it (JJ's export, 2026-10-24)",eyebrowLook:"read only by the simple, statement, natural and essay looks, which this row does not draw. 0 of 69 live nodes store it",rowGap:"read only by the natural look, which this row does not draw. 0 of 69 live nodes store it",descriptionSize:"read only by the natural look, which this row does not draw. 0 of 69 live nodes store it",numStyle:"Solid (the default; 4 of 69 live nodes store it) IS the eyebrow Text the row draws; Outlined (0 live) needs an outlined-number text look"}},C={name:"Lead Text",on:!1,boxProps:t=>({...p,direction:"column",gap:40,sectionBorder:{bottom:1},...a(t,"ParagraphsA")}),box:[...d,...y("ParagraphsA")],parts:[{kind:"group",name:"Numbers",props:{...e,direction:"row",justify:"between",gap:60,share:"content",sectionBorder:{bottom:1},sectionPaddingBottom:40},parts:[r("eyebrow",{color:"labels",letterSpacing:.24}),{kind:"group",name:"Stats",props:{...e,align:"end"},parts:[{kind:"list",key:"stats",name:"Stat",props:{...e,direction:"row",share:"content",justify:"end",gap:8},parts:[r("value",{color:"text",letterSpacing:.18,lineHeight:1.8}),r("label",{color:"labels",letterSpacing:.18,lineHeight:1.8})]}]}]},{kind:"group",name:"Words",props:{...e,direction:"row",align:"end",gap:60,share:"bigLeft"},parts:[{kind:"text",key:"lead",props:i,style:{textStyle:"body-1",lineHeight:1.45,letterSpacing:-.005,width:780,paragraphSpacing:0},was:{size:22,sizePhone:20}},{kind:"group",name:"Founders",props:{...e,gap:8},parts:[{kind:"group",name:"Note",props:{...e,gap:6},parts:[{kind:"text",key:"foundersHeading",props:i,style:{textStyle:"body-1",weight:500,letterSpacing:-.01,lineHeight:1.7},was:{size:18,sizePhone:16}},{kind:"text",key:"foundersBody",props:l,style:{textStyle:"body-5",lineHeight:1.7},was:{size:14,sizePhone:12}}]},r("attribution",{letterSpacing:.24,lineHeight:1.7})]}]}],drop:{...s}},f={top:24,bottom:24,topPhone:24,bottomPhone:24},S={schema:"xtreme_mudder",site:"xtreme-mudder"},z="#F2F2EF",L={kind:"add-theme-preset",copyOf:0,set:{background:z},reason:"Banner card with no picture"},M=t=>t.site?.schema===S.schema&&t.site.site===S.site,x=t=>typeof t.imageSrc!="string"||!t.imageSrc;function X(t,o){return!x(t)||typeof o.cardTheme!="number"?{}:{sectionAccent:o.cardTheme}}const F={name:"Banner",on:!1,boxProps:t=>({...p,direction:"column",gap:0,...m(t,f)}),box:[...d,"contained",...u(f)],parts:[{kind:"group",name:"Card",keepEmpty:!0,props:(t,o)=>({...e,gap:28,placement:"top-left",darken:60,darkenStyle:"even",sectionBorder:{width:1},sectionPaddingTop:64,sectionPaddingBottom:64,sectionPaddingTopPhone:40,sectionPaddingBottomPhone:40,sectionPaddingLeft:40,sectionPaddingRight:40,sectionPaddingLeftPhone:24,sectionPaddingRightPhone:24,...X(t,o)}),box:[["imageSrc","bgImage"],["overlay","darken",t=>Math.min(Math.max(N(t)??60,0),100)]],parts:[{kind:"group",name:"Words",props:{...e,gap:20},parts:[r("eyebrow"),{kind:"text",key:"title",role:"heading",props:i,style:{weight:500,lineHeight:1.05,letterSpacing:-.03,case:"none",width:680}},{kind:"text",key:"body",props:l,style:{textStyle:"body-1",lineHeight:1.6,width:680},was:{size:16}}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:g}]}],site:(t,o)=>x(t.props)&&M(o)?[L]:[],drop:{...s,...c}},J={Prose:A,TitleWithButtons:D,SectionHeader:W,ParagraphsA:C,Banner:F};function q(){E(J)}export{J as GENERAL_SECTION_TO_BOX,S as XM_SITE,q as registerGeneralSectionRows};
1
+ import{hasWords as f,headParts as x,registerSectionToBox as d}from"../../../sections/section-to-box.js";import{BUTTON as p,DIM as s,DROP_COMMON as i,DROP_SIDE_PADDING as l,INNER_BOX as t,SAME_KEYS as r,SECTION_BOX as a,TEXT as o,headingCaseOf as g,innerPad as y,innerPadKeys as b,smallText as n,wrapperPad as h,wrapperPadKeys as c}from"./section-to-box-row-parts.js";import{finiteNumber as B}from"../../../../../format/lib/finite-number.js";import{STATS_SECTION_TO_BOX as T}from"./section-to-box-rows-stats.js";import{LOGOS_SECTION_TO_BOX as O}from"./section-to-box-rows-logos.js";const u={top:72,bottom:72,topPhone:72,bottomPhone:72},[H,N]=x("Prose"),_={name:"Editorial Text",on:!1,boxProps:e=>({...a,direction:"column",gap:28,sectionBorder:{top:1},...h(e,u)}),box:[["topBorder","sectionBorder",e=>e===!1?void 0:{top:1}],...r,...c(u)],parts:[{kind:"group",name:"Heading",props:{...t,gap:16},parts:[{...H,props:o},{...N,props:o,style:{textStyle:"heading-3",lineHeight:1,letterSpacing:-.02}}]},{kind:"text",key:"body",props:s,style:{textStyle:"body-1",lineHeight:1.7,width:680,paragraphSpacing:18},was:{size:16}}],site:g("title"),drop:{...i,...l,headPlacement:"needs a row per head placement: an own-box Prose draws no head (its words sit in a Section Header above it), the row always draws the head. 0 of 123 live nodes store it (JJ's export, 2026-10-24)"}},E={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},k=(e,S)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:e,parts:[{kind:"button",key:"label",href:"href",variant:{key:"variant",map:{primary:"primary",outline:"ghost"},fallback:"ghost"},style:{letterSpacing:.3},props:{...p,...E,...S}}]}),m=e=>f(e.title),v={name:"Call-to-Action Heading",on:!1,boxProps:e=>({...a,direction:"row",align:"center",justify:m(e)?"between":"end",gap:60,share:"content",sectionBorder:{bottom:1},...y(e,"TitleWithButtons")}),box:[...r,...b("TitleWithButtons")],parts:[{kind:"group",name:"Title",props:t,parts:[{kind:"text",key:"title",role:"heading",props:o,style:{textStyle:"heading-1",lineHeight:.94,letterSpacing:-.035,width:1e3}}]},{kind:"group",name:"Buttons",props:{...t,gap:14},parts:[k(m,{widthFit:"fill",iconPosition:"end"}),k(e=>!m(e),{})]}],site:g("title"),drop:{...i,buttonsAlign:"moves the buttons only when there is no heading (4 of 128 live nodes), where the Box puts them at the end. 0 of 128 live nodes store it (JJ's export, 2026-10-24)"}},w={top:40,bottom:64,topPhone:24,bottomPhone:36},A={buttonFillOpacity:0,buttonBorder:{width:0},buttonPaddingTop:0,buttonPaddingRight:0,buttonPaddingBottom:0,buttonPaddingLeft:0},W={name:"Section Header",on:!1,boxProps:e=>({...a,direction:"column",gap:0,...h(e,w)}),box:[...r,"fullWidth","pageWidth",...c(w)],parts:[{kind:"group",name:"Header",props:{...t,direction:"row",align:"end",justify:"between",gap:40,share:"content",sectionBorder:{bottom:1},sectionPaddingBottom:24,sectionPaddingBottomPhone:20},parts:[{kind:"group",name:"Title",props:{...t,direction:"row",align:"end",gap:40,share:"content"},parts:[{kind:"group",name:"Number",props:{...t,align:"start",gap:12},parts:[{kind:"image",key:"logoSrc",alt:"logoAlt",props:{aspect:"auto",contained:!1}},n("num")]},{kind:"text",key:"title",role:"heading",props:o,style:{lineHeight:.95,letterSpacing:-.025}}]},{kind:"group",name:"Words",props:{...t,align:"end",gap:12},parts:[{kind:"text",key:"description",props:{...s,align:"right"},style:{textStyle:"body-5",lineHeight:1.5,width:340},was:{size:14}},{kind:"button",key:"linkText",href:"linkHref",variant:"ghost",props:{...p,align:"right",...A},style:{textStyle:"body-5",color:"labels"}}]}]}],site:g("title"),drop:{...i,...l,headStyle:"needs a row per head look: the row draws the standard look; the editorial, simple, statement, natural and essay looks are other layouts. 0 of 69 live nodes store it (JJ's export, 2026-10-24)",eyebrowLook:"read only by the simple, statement, natural and essay looks, which this row does not draw. 0 of 69 live nodes store it",rowGap:"read only by the natural look, which this row does not draw. 0 of 69 live nodes store it",descriptionSize:"read only by the natural look, which this row does not draw. 0 of 69 live nodes store it",numStyle:"Solid (the default; 4 of 69 live nodes store it) IS the eyebrow Text the row draws; Outlined (0 live) needs an outlined-number text look"}},I={name:"Lead Text",on:!1,boxProps:e=>({...a,direction:"column",gap:40,sectionBorder:{bottom:1},...y(e,"ParagraphsA")}),box:[...r,...b("ParagraphsA")],parts:[{kind:"group",name:"Numbers",props:{...t,direction:"row",justify:"between",gap:60,share:"content",sectionBorder:{bottom:1},sectionPaddingBottom:40},parts:[n("eyebrow",{color:"labels",letterSpacing:.24}),{kind:"group",name:"Stats",props:{...t,align:"end"},parts:[{kind:"list",key:"stats",name:"Stat",props:{...t,direction:"row",share:"content",justify:"end",gap:8},parts:[n("value",{color:"text",letterSpacing:.18,lineHeight:1.8}),n("label",{color:"labels",letterSpacing:.18,lineHeight:1.8})]}]}]},{kind:"group",name:"Words",props:{...t,direction:"row",align:"end",gap:60,share:"bigLeft"},parts:[{kind:"text",key:"lead",props:o,style:{textStyle:"body-1",lineHeight:1.45,letterSpacing:-.005,width:780,paragraphSpacing:0},was:{size:22,sizePhone:20}},{kind:"group",name:"Founders",props:{...t,gap:8},parts:[{kind:"group",name:"Note",props:{...t,gap:6},parts:[{kind:"text",key:"foundersHeading",props:o,style:{textStyle:"body-1",weight:500,letterSpacing:-.01,lineHeight:1.7},was:{size:18,sizePhone:16}},{kind:"text",key:"foundersBody",props:s,style:{textStyle:"body-5",lineHeight:1.7},was:{size:14,sizePhone:12}}]},n("attribution",{letterSpacing:.24,lineHeight:1.7})]}]}],drop:{...i}},P={top:24,bottom:24,topPhone:24,bottomPhone:24},R={name:"Banner",on:!1,boxProps:e=>({...a,direction:"column",gap:0,...h(e,P)}),box:[...r,"contained",...c(P)],parts:[{kind:"group",name:"Card",keepEmpty:!0,props:{...t,gap:28,placement:"top-left",darken:60,darkenStyle:"even",sectionBorder:{width:1},sectionPaddingTop:64,sectionPaddingBottom:64,sectionPaddingTopPhone:40,sectionPaddingBottomPhone:40,sectionPaddingLeft:40,sectionPaddingRight:40,sectionPaddingLeftPhone:24,sectionPaddingRightPhone:24},box:[["imageSrc","bgImage"],["overlay","darken",e=>Math.min(Math.max(B(e)??60,0),100)]],parts:[{kind:"group",name:"Words",props:{...t,gap:20},parts:[n("eyebrow"),{kind:"text",key:"title",role:"heading",props:o,style:{weight:500,lineHeight:1.05,letterSpacing:-.03,case:"none",width:680}},{kind:"text",key:"body",props:s,style:{textStyle:"body-1",lineHeight:1.6,width:680},was:{size:16}}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:p}]}],drop:{...i,...l}},z={Prose:_,TitleWithButtons:v,SectionHeader:W,ParagraphsA:I,Banner:R};function X(){d(z),d(T),d(O)}export{z as GENERAL_SECTION_TO_BOX,X as registerGeneralSectionRows};
@@ -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: "video" | "image";
16
- readonly default: "video" | "image";
15
+ readonly is: "image" | "video";
16
+ readonly default: "image" | "video";
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 m}from"efficient-easel/render";import{capHeroGroups as a}from"../../../format/lib/document/cap-hero-groups.js";import{oneH1 as i}from"../../../format/lib/document/one-h1.js";import{migrateLegacyPageData as n}from"./migrate-legacy.js";import{migrateRenamedProps as p}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as f,pageConvertContextOf as g}from"../sections/section-to-box.js";import{registerGeneralSectionRows as s}from"./blocks/general/section-to-box-rows.js";function c({config:e,data:o,metadata:r}){return s(),t(m,{config:e,metadata:r,data:i(a(f(p(n(o)),g(r))))})}export{c as default};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{Render as m}from"efficient-easel/render";import{capHeroGroups as a}from"../../../format/lib/document/cap-hero-groups.js";import{oneH1 as i}from"../../../format/lib/document/one-h1.js";import{migrateLegacyPageData as n}from"./migrate-legacy.js";import{migrateRenamedProps as p}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as f}from"../sections/section-to-box.js";import{registerGeneralSectionRows as s}from"./blocks/general/section-to-box-rows.js";function c({config:r,data:e,metadata:o}){return s(),t(m,{config:r,metadata:o,data:i(a(f(p(n(e)))))})}export{c as default};
@@ -1 +1 @@
1
- import{TEXT_FIELD_MARKER as x}from"efficient-easel/draw";import{partText as s,partValueWithText as y,typeInPlaceKind as d}from"./part-text.js";import{decodePartKey as b,encodePartKey as j}from"../../../format/lib/document/part-key.js";function p(t){if(!(!t||typeof t!="object"))return t[x]}function l(t){if(!t||typeof t!="object")return null;const r=t.arrayFields;return r&&typeof r=="object"?r:null}function R(t,r){if(!Array.isArray(r))return[];const e=p(t),i=[];if(e?.control==="textList"){const n=e.itemKey??"text";return r.forEach((c,a)=>{const u=c?.[n];typeof u=="string"&&u&&i.push({row:{index:a,rowKey:n},text:u})}),i}const o=l(t);return o?(r.forEach((n,c)=>{for(const[a,u]of Object.entries(o)){if(!d(u))continue;const f=s(n?.[a])||p(u)?.placeholder||"";f&&i.push({row:{index:c,rowKey:a},text:f})}}),i):[]}function h(t,r){if(Array.isArray(t))return t[r.index]?.[r.rowKey]}function w(t,r,e,i){const o=t[r];return!Array.isArray(o)||e.index<0||e.index>=o.length?null:{...t,[r]:o.map((n,c)=>c===e.index?{...n,[e.rowKey]:i}:n)}}function T(t,r,e,i,o){const n=h(t[r],e);return s(n)===o?null:w(t,r,e,y(i,n,o))}function E(t,r){return r?`${t} · row ${r.index+1}`:t}export{l as arrayFieldsOf,b as decodePartKey,j as encodePartKey,T as partPropsWithRowText,w as partPropsWithRowValue,E as partRowHeadLabel,R as partRowTexts,h as partRowValue,p as textMeta};
1
+ import{TEXT_FIELD_MARKER as x}from"efficient-easel/draw";import{partText as p,partValueWithText as y,typeInPlaceKind as d}from"./part-text.js";import{nonEmptyString as l}from"../../../format/lib/non-empty-string.js";import{decodePartKey as L,encodePartKey as W}from"../../../format/lib/document/part-key.js";function s(t){if(!(!t||typeof t!="object"))return t[x]}function h(t){if(!t||typeof t!="object")return null;const r=t.arrayFields;return r&&typeof r=="object"?r:null}function T(t,r){if(!Array.isArray(r))return[];const e=s(t),i=[];if(e?.control==="textList"){const n=e.itemKey??"text";return r.forEach((u,a)=>{const c=l(u?.[n]);c&&i.push({row:{index:a,rowKey:n},text:c})}),i}const o=h(t);return o?(r.forEach((n,u)=>{for(const[a,c]of Object.entries(o)){if(!d(c))continue;const f=p(n?.[a])||s(c)?.placeholder||"";f&&i.push({row:{index:u,rowKey:a},text:f})}}),i):[]}function m(t,r){if(Array.isArray(t))return t[r.index]?.[r.rowKey]}function w(t,r,e,i){const o=t[r];return!Array.isArray(o)||e.index<0||e.index>=o.length?null:{...t,[r]:o.map((n,u)=>u===e.index?{...n,[e.rowKey]:i}:n)}}function F(t,r,e,i,o){const n=m(t[r],e);return p(n)===o?null:w(t,r,e,y(i,n,o))}function P(t,r){return r?`${t} · row ${r.index+1}`:t}export{h as arrayFieldsOf,L as decodePartKey,W as encodePartKey,F as partPropsWithRowText,w as partPropsWithRowValue,P as partRowHeadLabel,T as partRowTexts,m as partRowValue,s as textMeta};
@@ -110,7 +110,6 @@ export declare function partSpacingOf(style: PartStyle): {
110
110
  letterSpacingEm?: number;
111
111
  };
112
112
  export declare const PART_PARAGRAPH_VAR = "--sf-part-para";
113
- export declare const PART_PHONE_MAX_CSS = "(max-width: 719.98px)";
114
113
  export declare function partPhoneDeclarations(style: PartStyle): Record<string, string>;
115
114
  export declare function partStyleForScreen(style: PartStyle, phone: boolean): PartStyle;
116
115
  export declare function partStyleDeclarations(style: PartStyle, base: PartStyleBase, options?: PartDeclarationOptions): Record<string, string>;
@@ -1,2 +1,2 @@
1
- import{textStyleCaseCss as q,textStyleCaseOfCss as J}from"efficient-easel/draw";import{FONT_OPTIONS as Q,FONT_ROLES as O,fontOption as v,SIZE_STEP_OF_ROLE as tt}from"../../../format/lib/fonts.js";import{encodePartKey as et}from"../../../format/lib/document/part-key.js";import{decodePartId as H,normalizePartText as N}from"./text-parts.js";import{COLOUR_TOKEN as F}from"../../../format/lib/word-styles.js";const w="_partStyles",nt="data-sf-part-styled",L="data-sf-text-style",rt=/^(heading|body)-[1-7]$/;function g(t){return typeof t=="string"&&rt.test(t)}const z={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function ot(t){if(!t)return null;for(const[e,n]of Object.entries(z))if(n===t)return e;return null}function ne(t){if(g(t.textStyle))return t.textStyle;const e=t.role&&O.includes(t.role)?t.role:null;return e?z[e]:void 0}const it=[400,500,600,700],k=["left","center","right","justify"],j=5,D=1e3,st=-5,at=10,ct=0,lt=64,ft=2,ut=120,E=1280,pt=10,C={size:{min:j,max:D,step:1},sizePhone:{min:j,max:D,step:1},padding:{min:ct,max:lt,step:ft},width:{min:ut,max:E,step:pt}},dt=.05,xt=.01,ht=["line","letter"],St=.5,gt=2.5,mt=-1,Pt=1,Tt=0,_t=400;function T(t){return!t||typeof t!="object"||Array.isArray(t)?null:t}function W(t){return T(t?.[w])??{}}function K(t,e){const n=W(t);return Object.hasOwn(n,e)?T(n[e])??{}:{}}function re(t,e){return Object.values(K(t,e)).filter(n=>n!==void 0).length}function G(t,e,n){const r={...W(t)};if(At(n).length?r[e]=n:delete r[e],!Object.keys(r).length){const{[w]:o,...i}=t;return i}return{...t,[w]:r}}function At(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function bt(t){return ht.includes(t)}const _=(t,e,n)=>Math.min(n,Math.max(e,t));function Rt(t,e){if(bt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:_(n,st,at)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?m(_(n,St,gt),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?m(_(n,mt,Pt),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:_(n,Tt,_t)}if(Object.hasOwn(C,t)){const{min:n,max:r}=C[t],o=Math.round(Number(e));return Number.isFinite(o)?_(o,n,r):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"?O.includes(String(e))?e:null:t==="textStyle"?g(e)?e:null:e}const Et=["weight","size","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding","width"];function X(t){let e=null;const n=r=>{e??={...t},delete e[r]};for(const r of Et){const o=t[r];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(r)}return t.align!==void 0&&!k.includes(t.align)&&n("align"),t.textStyle!==void 0&&!g(t.textStyle)&&n("textStyle"),e??t}const yt=[["font","role"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Ot(t){const e=[];for(const[n,r]of yt)n===t?e.push(r):r===t&&e.push(n);return e}function oe(t,e,n,r){const o={...K(t,e)},i=r==null?null:Rt(n,r);if(i===null)delete o[n];else{o[n]=i;for(const s of Ot(n))delete o[s]}return G(t,e,o)}function ie(t,e){return G(t,e,{})}function Nt(t){return J(t)??"none"}function wt(t){return q(t)??""}const It={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function $t(t,e){const n=t.role;return n&&O.includes(n)?n:e?.blockDrawsStyle?null:ot(t.textStyle)}function se(t,e){return t==="Text"&&e==="text"}const Mt={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Ht(t){const e=tt[t],n=Mt[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function Ft(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=m(Lt+t.line*dt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=m(t.letter*xt,4)),e}const Lt=1,A="--sf-part-para",zt="(max-width: 719.98px)";function U(t){return t=X(t),typeof t.sizePhone=="number"&&t.sizePhone>0?{fontSize:`${t.sizePhone}px`}:{}}function kt(t,e){return e&&typeof t.sizePhone=="number"&&t.sizePhone>0?{...t,size:t.sizePhone}:t}function y(t,e,n){t=X(t);const r=$t(t,n),o=Ft(t),i=t.size?`${t.size}px`:r?Ht(r):"";return{fontFamily:t.font?Wt(t.font):r?`var(${It[r]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[A]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:wt(t.case),textAlign:t.align??"",paddingTop:I(t.padding),paddingBottom:I(t.padding),maxWidth:I(t.width),color:jt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const jt=t=>t===void 0||t===""?"":Object.hasOwn(F,t)?F[t]:B.test(t)?t:"",B=/^#[0-9a-fA-F]{6}$/;function ae(t){return B.test(t)}const I=t=>t===void 0?"":`${t}px`,m=(t,e)=>Number(t.toFixed(e));function ce(t,e){const n=Number.parseFloat(t.fontSize)||16,r=Number.parseFloat(t.lineHeight),o=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop),s=Number.parseFloat(t.maxWidth);return{fontKey:e,sizePx:n,weight:Dt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(r)?m(r/n,3):1.2,letterEm:Number.isFinite(o)?m(o/n,4):0,align:Ct(t.textAlign),case:Nt(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0,widthPx:Number.isFinite(s)&&s<E?Math.round(s):E}}function Dt(t){return Number.isFinite(t)?it.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function Ct(t){for(const e of k)if(e===t)return e;return t==="end"?"right":"left"}function le(t,e){const n=V(t);if(!n)return"";for(const r of Q)if(V(e(r.cssVar))===n)return r.key;return""}const V=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function Wt(t){const e=v(t);return e?`var(${e.cssVar})`:""}function fe(t,e,n,r){return!e||H(e)?.nodeId!==t?null:n.find(i=>r(i.getAttribute("class")))??n[0]??null}function ue(t,e,n=()=>b,r=d=>d,o=Xt,i=!1,s=()=>!1){let d=0;for(const{element:a,partId:c}of t){const u=H(c)?.propKey;if(!u)continue;const l=r(u),p=Object.hasOwn(e,l)?T(e[l])??{}:{},f=y(kt(p,i),b,{blockDrawsStyle:s(u)});g(p.textStyle)?a.setAttribute?.(L,p.textStyle):a.removeAttribute?.(L);const S=M.some(h=>a.style[h]);let x=!1;for(const[h,P]of Object.entries(f))Ut(a,h,P),P&&(x=!0);if(S||M.some(h=>f[h]))for(const h of Kt(a,o))for(const P of M)h.style[P]=f[P]??"";x&&(d+=1)}return d}function Kt(t,e){const n=N(t.textContent??""),r=[];let o=t;for(let i=0;i<Gt&&e(o);i+=1){const s=o.parentElement;if(!s||N(s.textContent??"")!==n)break;r.push(s),o=s}return r}const Gt=8;function Xt(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const b={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:E};function Ut(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const r=t.style;typeof r.setProperty=="function"?n?r.setProperty(e,n):r.removeProperty?.(e):r[e]=n;const o=t;e===A&&(n?o.setAttribute?.(Y,""):o.removeAttribute?.(Y))}const Y="data-sf-part-para",Bt=Object.keys(y({},b)),$=new Set(["color","overflowWrap",A,"fontStyle"]),M=Bt.filter(t=>!$.has(t));function pe(t,e,n,r=i=>i,o=()=>!1){const i=new Map;for(const a of t){const c=et(a.key,a.row);for(const u of a.texts){const l=i.get(u);l?(l.keys.add(a.key),l.partKeys.add(c)):i.set(u,{keys:new Set([a.key]),partKeys:new Set([c])})}}const s=new Map;for(const a of Object.keys(e)){if(!Vt(a))continue;const c=T(e[a])??{},u=y(c,b),l=U(c),p=g(c.textStyle)?c.textStyle:void 0;!Object.values(u).some(Boolean)&&!Object.keys(l).length&&!p||s.set(a,{stamp:Z(n,a),declarations:u,...Object.keys(l).length?{phone:l}:{},...p?{textStyle:p}:{}})}const d=new Map;for(const[a,{keys:c,partKeys:u}]of i){const l=u.size===1?[...u][0]:c.size===1?[...c][0]:null;if(!l)continue;const p=r(l);if(!Object.hasOwn(e,p))continue;const f=T(e[p])??{},S=y(f,b,{blockDrawsStyle:o(l)}),x=U(f),R=g(f.textStyle)?f.textStyle:void 0;!Object.values(S).some(Boolean)&&!Object.keys(x).length&&!R||d.set(a,{stamp:Z(n,l),declarations:S,...Object.keys(x).length?{phone:x}:{},...R?{textStyle:R}:{}})}return d.size||s.size?{rules:d,kindRules:s,drawn:new Set(i.keys())}:null}function Vt(t){return t.startsWith("@")}function de(t,e){return t?.kindRules.get(e)??null}function Z(t,e){const n=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function xe(t){const e=[],n=new Set,r=o=>{const{stamp:i,declarations:s}=o;if(n.has(i))return;n.add(i);const d=Object.entries(s).filter(([,f])=>f!==""),a=f=>f.map(([S,x])=>`${Zt(S)}: ${x}`).join("; "),c=`[${nt}="${i}"]`,u=d.filter(([f])=>!$.has(f)),l=d.filter(([f])=>$.has(f));u.length&&e.push(`${c}, *:has(> ${c}) { ${a(u)} }`),l.length&&e.push(`${c} { ${a(l)} }`),s[A]&&e.push(...Yt(c));const p=Object.entries(o.phone??{}).filter(([,f])=>f!=="");p.length&&e.push(`@media ${zt} { ${c}, *:has(> ${c}) { ${a(p)} } }`)};for(const o of t.rules.values())r(o);for(const o of t.kindRules.values())r(o);return e.join(`
2
- `)}function Yt(t){const e=`var(${A})`,n=":is([data-sf-bullet], [data-sf-number])";return[`${t} br:not(br + br) { display: block; content: ""; margin-top: ${e} }`,`${t} ${n}:not(:first-child) { margin-top: ${e} }`,`${t} ${n}:not(:last-child) { margin-bottom: ${e} }`]}const Zt=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);function he(t,e){if(!t)return null;const n=N(e),r=t.rules.get(n);if(r)return r;if(n.length<qt||t.drawn.has(n))return null;let o=null;for(const[i,s]of t.rules)if(i.includes(n)){if(o&&o.stamp!==s.stamp)return null;o=s}return o}const qt=8;export{k as PART_ALIGNS,Pt as PART_LETTER_EM_MAX,mt as PART_LETTER_EM_MIN,xt as PART_LETTER_STEP,gt as PART_LINE_HEIGHT_MAX,St as PART_LINE_HEIGHT_MIN,dt as PART_LINE_STEP,C as PART_MEASURED_TRACKS,at as PART_NUDGE_MAX,st as PART_NUDGE_MIN,lt as PART_PADDING_MAX,ct as PART_PADDING_MIN,ft as PART_PADDING_STEP,Y as PART_PARAGRAPH_ATTR,_t as PART_PARAGRAPH_MAX,Tt as PART_PARAGRAPH_MIN,A as PART_PARAGRAPH_VAR,zt as PART_PHONE_MAX_CSS,ht as PART_RELATIVE_PROPS,D as PART_SIZE_MAX,j as PART_SIZE_MIN,nt as PART_STYLED_ATTR,w as PART_STYLES_PROP,Bt as PART_STYLE_PROPERTIES,it as PART_WEIGHTS,E as PART_WIDTH_MAX,ut as PART_WIDTH_MIN,pt as PART_WIDTH_STEP,M as SHARED_PART_PROPERTIES,z as STYLE_ID_OF_ROLE,L as TEXT_STYLE_ATTR,ue as applyPartStyles,se as blockDrawsTextStyle,ne as followedStyleOf,ae as isHexColour,Vt as isPartKindKey,g as isTextStyleId,Yt as paragraphRules,Nt as partCaseOfTransform,wt as partCaseTransform,le as partFontKeyOf,U as partPhoneDeclarations,de as partRuleForKind,he as partRuleForText,Ft as partSpacingOf,ce as partStyleBase,re as partStyleCount,xe as partStyleCss,y as partStyleDeclarations,kt as partStyleForScreen,fe as partStyleSource,oe as propsWithPartStyleValue,ie as propsWithoutPartStyle,pe as publishedPartStyles,K as readPartStyle,W as readPartStyles};
1
+ import{textStyleCaseCss as q,textStyleCaseOfCss as J}from"efficient-easel/draw";import{FONT_OPTIONS as Q,FONT_ROLES as O,fontOption as v,SIZE_STEP_OF_ROLE as tt}from"../../../format/lib/fonts.js";import{encodePartKey as et}from"../../../format/lib/document/part-key.js";import{decodePartId as H,normalizePartText as N}from"./text-parts.js";import{COLOUR_TOKEN as F}from"../../../format/lib/word-styles.js";import{PHONE_MEDIA as nt}from"../content/view-values.js";const w="_partStyles",rt="data-sf-part-styled",L="data-sf-text-style",ot=/^(heading|body)-[1-7]$/;function S(t){return typeof t=="string"&&ot.test(t)}const z={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function it(t){if(!t)return null;for(const[e,n]of Object.entries(z))if(n===t)return e;return null}function re(t){if(S(t.textStyle))return t.textStyle;const e=t.role&&O.includes(t.role)?t.role:null;return e?z[e]:void 0}const st=[400,500,600,700],k=["left","center","right","justify"],D=5,j=1e3,at=-5,ct=10,lt=0,ft=64,ut=2,pt=120,E=1280,dt=10,W={size:{min:D,max:j,step:1},sizePhone:{min:D,max:j,step:1},padding:{min:lt,max:ft,step:ut},width:{min:pt,max:E,step:dt}},xt=.05,ht=.01,gt=["line","letter"],St=.5,mt=2.5,Pt=-1,Tt=1,_t=0,bt=400;function T(t){return!t||typeof t!="object"||Array.isArray(t)?null:t}function C(t){return T(t?.[w])??{}}function K(t,e){const n=C(t);return Object.hasOwn(n,e)?T(n[e])??{}:{}}function oe(t,e){return Object.values(K(t,e)).filter(n=>n!==void 0).length}function G(t,e,n){const r={...C(t)};if(At(n).length?r[e]=n:delete r[e],!Object.keys(r).length){const{[w]:o,...i}=t;return i}return{...t,[w]:r}}function At(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function Rt(t){return gt.includes(t)}const _=(t,e,n)=>Math.min(n,Math.max(e,t));function Et(t,e){if(Rt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:_(n,at,ct)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?m(_(n,St,mt),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?m(_(n,Pt,Tt),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:_(n,_t,bt)}if(Object.hasOwn(W,t)){const{min:n,max:r}=W[t],o=Math.round(Number(e));return Number.isFinite(o)?_(o,n,r):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"?O.includes(String(e))?e:null:t==="textStyle"?S(e)?e:null:e}const yt=["weight","size","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding","width"];function X(t){let e=null;const n=r=>{e??={...t},delete e[r]};for(const r of yt){const o=t[r];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(r)}return t.align!==void 0&&!k.includes(t.align)&&n("align"),t.textStyle!==void 0&&!S(t.textStyle)&&n("textStyle"),e??t}const Ot=[["font","role"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Nt(t){const e=[];for(const[n,r]of Ot)n===t?e.push(r):r===t&&e.push(n);return e}function ie(t,e,n,r){const o={...K(t,e)},i=r==null?null:Et(n,r);if(i===null)delete o[n];else{o[n]=i;for(const s of Nt(n))delete o[s]}return G(t,e,o)}function se(t,e){return G(t,e,{})}function wt(t){return J(t)??"none"}function It(t){return q(t)??""}const $t={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function Mt(t,e){const n=t.role;return n&&O.includes(n)?n:e?.blockDrawsStyle?null:it(t.textStyle)}function ae(t,e){return t==="Text"&&e==="text"}const Ht={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Ft(t){const e=tt[t],n=Ht[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function Lt(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=m(zt+t.line*xt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=m(t.letter*ht,4)),e}const zt=1,b="--sf-part-para";function U(t){return t=X(t),typeof t.sizePhone=="number"&&t.sizePhone>0?{fontSize:`${t.sizePhone}px`}:{}}function kt(t,e){return e&&typeof t.sizePhone=="number"&&t.sizePhone>0?{...t,size:t.sizePhone}:t}function y(t,e,n){t=X(t);const r=Mt(t,n),o=Lt(t),i=t.size?`${t.size}px`:r?Ft(r):"";return{fontFamily:t.font?Ct(t.font):r?`var(${$t[r]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[b]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:It(t.case),textAlign:t.align??"",paddingTop:I(t.padding),paddingBottom:I(t.padding),maxWidth:I(t.width),color:Dt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const Dt=t=>t===void 0||t===""?"":Object.hasOwn(F,t)?F[t]:B.test(t)?t:"",B=/^#[0-9a-fA-F]{6}$/;function ce(t){return B.test(t)}const I=t=>t===void 0?"":`${t}px`,m=(t,e)=>Number(t.toFixed(e));function le(t,e){const n=Number.parseFloat(t.fontSize)||16,r=Number.parseFloat(t.lineHeight),o=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop),s=Number.parseFloat(t.maxWidth);return{fontKey:e,sizePx:n,weight:jt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(r)?m(r/n,3):1.2,letterEm:Number.isFinite(o)?m(o/n,4):0,align:Wt(t.textAlign),case:wt(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0,widthPx:Number.isFinite(s)&&s<E?Math.round(s):E}}function jt(t){return Number.isFinite(t)?st.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function Wt(t){for(const e of k)if(e===t)return e;return t==="end"?"right":"left"}function fe(t,e){const n=V(t);if(!n)return"";for(const r of Q)if(V(e(r.cssVar))===n)return r.key;return""}const V=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function Ct(t){const e=v(t);return e?`var(${e.cssVar})`:""}function ue(t,e,n,r){return!e||H(e)?.nodeId!==t?null:n.find(i=>r(i.getAttribute("class")))??n[0]??null}function pe(t,e,n=()=>A,r=d=>d,o=Xt,i=!1,s=()=>!1){let d=0;for(const{element:a,partId:c}of t){const u=H(c)?.propKey;if(!u)continue;const l=r(u),p=Object.hasOwn(e,l)?T(e[l])??{}:{},f=y(kt(p,i),A,{blockDrawsStyle:s(u)});S(p.textStyle)?a.setAttribute?.(L,p.textStyle):a.removeAttribute?.(L);const g=M.some(h=>a.style[h]);let x=!1;for(const[h,P]of Object.entries(f))Ut(a,h,P),P&&(x=!0);if(g||M.some(h=>f[h]))for(const h of Kt(a,o))for(const P of M)h.style[P]=f[P]??"";x&&(d+=1)}return d}function Kt(t,e){const n=N(t.textContent??""),r=[];let o=t;for(let i=0;i<Gt&&e(o);i+=1){const s=o.parentElement;if(!s||N(s.textContent??"")!==n)break;r.push(s),o=s}return r}const Gt=8;function Xt(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const A={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:E};function Ut(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const r=t.style;typeof r.setProperty=="function"?n?r.setProperty(e,n):r.removeProperty?.(e):r[e]=n;const o=t;e===b&&(n?o.setAttribute?.(Y,""):o.removeAttribute?.(Y))}const Y="data-sf-part-para",Bt=Object.keys(y({},A)),$=new Set(["color","overflowWrap",b,"fontStyle"]),M=Bt.filter(t=>!$.has(t));function de(t,e,n,r=i=>i,o=()=>!1){const i=new Map;for(const a of t){const c=et(a.key,a.row);for(const u of a.texts){const l=i.get(u);l?(l.keys.add(a.key),l.partKeys.add(c)):i.set(u,{keys:new Set([a.key]),partKeys:new Set([c])})}}const s=new Map;for(const a of Object.keys(e)){if(!Vt(a))continue;const c=T(e[a])??{},u=y(c,A),l=U(c),p=S(c.textStyle)?c.textStyle:void 0;!Object.values(u).some(Boolean)&&!Object.keys(l).length&&!p||s.set(a,{stamp:Z(n,a),declarations:u,...Object.keys(l).length?{phone:l}:{},...p?{textStyle:p}:{}})}const d=new Map;for(const[a,{keys:c,partKeys:u}]of i){const l=u.size===1?[...u][0]:c.size===1?[...c][0]:null;if(!l)continue;const p=r(l);if(!Object.hasOwn(e,p))continue;const f=T(e[p])??{},g=y(f,A,{blockDrawsStyle:o(l)}),x=U(f),R=S(f.textStyle)?f.textStyle:void 0;!Object.values(g).some(Boolean)&&!Object.keys(x).length&&!R||d.set(a,{stamp:Z(n,l),declarations:g,...Object.keys(x).length?{phone:x}:{},...R?{textStyle:R}:{}})}return d.size||s.size?{rules:d,kindRules:s,drawn:new Set(i.keys())}:null}function Vt(t){return t.startsWith("@")}function xe(t,e){return t?.kindRules.get(e)??null}function Z(t,e){const n=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function he(t){const e=[],n=new Set,r=o=>{const{stamp:i,declarations:s}=o;if(n.has(i))return;n.add(i);const d=Object.entries(s).filter(([,f])=>f!==""),a=f=>f.map(([g,x])=>`${Zt(g)}: ${x}`).join("; "),c=`[${rt}="${i}"]`,u=d.filter(([f])=>!$.has(f)),l=d.filter(([f])=>$.has(f));u.length&&e.push(`${c}, *:has(> ${c}) { ${a(u)} }`),l.length&&e.push(`${c} { ${a(l)} }`),s[b]&&e.push(...Yt(c));const p=Object.entries(o.phone??{}).filter(([,f])=>f!=="");p.length&&e.push(`@media ${nt} { ${c}, *:has(> ${c}) { ${a(p)} } }`)};for(const o of t.rules.values())r(o);for(const o of t.kindRules.values())r(o);return e.join(`
2
+ `)}function Yt(t){const e=`var(${b})`,n=":is([data-sf-bullet], [data-sf-number])";return[`${t} br:not(br + br) { display: block; content: ""; margin-top: ${e} }`,`${t} ${n}:not(:first-child) { margin-top: ${e} }`,`${t} ${n}:not(:last-child) { margin-bottom: ${e} }`]}const Zt=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);function ge(t,e){if(!t)return null;const n=N(e),r=t.rules.get(n);if(r)return r;if(n.length<qt||t.drawn.has(n))return null;let o=null;for(const[i,s]of t.rules)if(i.includes(n)){if(o&&o.stamp!==s.stamp)return null;o=s}return o}const qt=8;export{k as PART_ALIGNS,Tt as PART_LETTER_EM_MAX,Pt as PART_LETTER_EM_MIN,ht as PART_LETTER_STEP,mt as PART_LINE_HEIGHT_MAX,St as PART_LINE_HEIGHT_MIN,xt as PART_LINE_STEP,W as PART_MEASURED_TRACKS,ct as PART_NUDGE_MAX,at as PART_NUDGE_MIN,ft as PART_PADDING_MAX,lt as PART_PADDING_MIN,ut as PART_PADDING_STEP,Y as PART_PARAGRAPH_ATTR,bt as PART_PARAGRAPH_MAX,_t as PART_PARAGRAPH_MIN,b as PART_PARAGRAPH_VAR,gt as PART_RELATIVE_PROPS,j as PART_SIZE_MAX,D as PART_SIZE_MIN,rt as PART_STYLED_ATTR,w as PART_STYLES_PROP,Bt as PART_STYLE_PROPERTIES,st as PART_WEIGHTS,E as PART_WIDTH_MAX,pt as PART_WIDTH_MIN,dt as PART_WIDTH_STEP,M as SHARED_PART_PROPERTIES,z as STYLE_ID_OF_ROLE,L as TEXT_STYLE_ATTR,pe as applyPartStyles,ae as blockDrawsTextStyle,re as followedStyleOf,ce as isHexColour,Vt as isPartKindKey,S as isTextStyleId,Yt as paragraphRules,wt as partCaseOfTransform,It as partCaseTransform,fe as partFontKeyOf,U as partPhoneDeclarations,xe as partRuleForKind,ge as partRuleForText,Lt as partSpacingOf,le as partStyleBase,oe as partStyleCount,he as partStyleCss,y as partStyleDeclarations,kt as partStyleForScreen,ue as partStyleSource,ie as propsWithPartStyleValue,se as propsWithoutPartStyle,de as publishedPartStyles,K as readPartStyle,C as readPartStyles};
@@ -1 +1 @@
1
- import{jsx as s,Fragment as i,jsxs as t}from"react/jsx-runtime";import{slugifyAnchor as a}from"../../../../format/lib/links/page-link-rules.js";function c({anchor:n}){const e=a(typeof n=="string"?n:"");return e?s("span",{id:e,className:"sf-section-anchor","aria-hidden":"true"}):null}const f={name:"sectionAnchor",applies:(n,e,r)=>e.isSection(n)&&!!r&&typeof r.render=="function",panel(n,e,r){const o=r.anchorFields;n.fields={...n.fields,...o()}},draw(n){n.defaultProps={...n.defaultProps,anchor:""};const e=n.render;n.render=r=>t(i,{children:[s(c,{anchor:r.anchor}),e(r)]})}};export{f as sectionAnchor};
1
+ import{jsx as s,Fragment as o,jsxs as t}from"react/jsx-runtime";import{slugify as a}from"efficient-shell/format";function c({anchor:n}){const e=a(typeof n=="string"?n:"");return e?s("span",{id:e,className:"sf-section-anchor","aria-hidden":"true"}):null}const f={name:"sectionAnchor",applies:(n,e,r)=>e.isSection(n)&&!!r&&typeof r.render=="function",panel(n,e,r){const i=r.anchorFields;n.fields={...n.fields,...i()}},draw(n){n.defaultProps={...n.defaultProps,anchor:""};const e=n.render;n.render=r=>t(o,{children:[s(c,{anchor:r.anchor}),e(r)]})}};export{f as sectionAnchor};
@@ -1 +1 @@
1
- import{jsx as f}from"react/jsx-runtime";import{isBackgroundBox as _}from"../../../../format/lib/content/box-background.js";import{resolveSectionPadding as h,sectionPadAttrs as r}from"../../../../format/lib/content/section-padding.js";const P={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120},DetailRows:{top:100,bottom:100}},c=new Set(Object.keys(P)),l=new Set(["Flex","Text","Heading"]),u=new Set(["Divider"]),T=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),g=new Set(["ProductGrid"]);function a(t,n,o=!1){const d=t.render;t.render=e=>{if(n?.(e))return d(e);const i=o?r(e.sectionPaddingTop,e.sectionPaddingBottom,e.sectionPaddingTopPhone,e.sectionPaddingBottomPhone,e.sectionPaddingLeft,e.sectionPaddingRight,e.sectionPaddingLeftPhone,e.sectionPaddingRightPhone):r(e.sectionPaddingTop,e.sectionPaddingBottom,e.sectionPaddingTopPhone,e.sectionPaddingBottomPhone),s=d(e);return i?f("div",{className:i.className,style:i.style,children:s}):s}}const A={name:"sectionPadding",applies:(t,n,o)=>n.isSection(t)&&!T.has(t)&&!!o&&typeof o.render=="function",panel(t,n,o){c.has(n)||g.has(n)||(t.fields={...t.fields,...o.sidesPaddingFields()})},draw(t,n){if(c.has(n)){const o=t.render,d=P[n];t.render=e=>{const i=h(e,d);return o({...e,padTop:i.top,padBottom:i.bottom})};return}if(g.has(n)){a(t);return}l.has(n)||u.has(n)||a(t,n==="Flex"?o=>_(o.bgImage):void 0,!0)}},S=["Heading","Text"],m=["LogoBlock"],D={name:"blockPadding",applies:(t,n,o)=>(S.includes(t)||m.includes(t))&&!!o&&typeof o.render=="function",panel(t,n,o){t.fields={...t.fields,...o.sidesPaddingFields()}},draw(t,n){l.has(n)||a(t,void 0,!0)}};export{u as PADS_ITS_OWN_SPACE,l as PAD_ON_ROOT,c as SECTION_PAD_INNER,P as SECTION_PAD_INNER_DEFAULTS,D as blockPadding,A as sectionPadding};
1
+ import{jsx as _}from"react/jsx-runtime";import{isBackgroundBox as f}from"../../../../format/lib/content/box-background.js";import{SECTION_PAD_KEYS as u,padValuesOf as S,resolveSectionPadding as p,sectionPadAttrs as T}from"../../content/section-padding.js";const d={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120},DetailRows:{top:100,bottom:100}},l=new Set(Object.keys(d)),c=new Set(["Flex","Text","Heading"]),g=new Set(["Divider"]),m=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),P=new Set(["ProductGrid"]);function i(t,e,n=!1){const s=t.render;t.render=o=>{if(e?.(o))return s(o);const r=T(S(o,u,n)),a=s(o);return r?_("div",{className:r.className,style:r.style,children:a}):a}}const I={name:"sectionPadding",applies:(t,e,n)=>e.isSection(t)&&!m.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){l.has(e)||P.has(e)||(t.fields={...t.fields,...n.sidesPaddingFields()})},draw(t,e){if(l.has(e)){const n=t.render,s=d[e];t.render=o=>{const r=p(o,s);return n({...o,padTop:r.top,padBottom:r.bottom})};return}if(P.has(e)){i(t);return}c.has(e)||g.has(e)||i(t,e==="Flex"?n=>f(n.bgImage):void 0,!0)}},A=["Heading","Text"],D=["LogoBlock"],N={name:"blockPadding",applies:(t,e,n)=>(A.includes(t)||D.includes(t))&&!!n&&typeof n.render=="function",panel(t,e,n){t.fields={...t.fields,...n.sidesPaddingFields()}},draw(t,e){c.has(e)||i(t,void 0,!0)}};export{g as PADS_ITS_OWN_SPACE,c as PAD_ON_ROOT,l as SECTION_PAD_INNER,d as SECTION_PAD_INNER_DEFAULTS,N as blockPadding,I as sectionPadding};
@@ -5,7 +5,6 @@ export declare const PART_ATTR = "data-sf-part";
5
5
  export declare const REGION_PART_ATTR = "data-sf-region-part";
6
6
  export declare const PART_ROW_ATTR = "data-sf-part-row";
7
7
  export declare function encodePartRow(key: string, index: number): string;
8
- export declare const PART_SELECTED_ATTR = "data-sf-part-selected";
9
8
  export declare const PART_KIND_ATTR = "data-sf-part-kind";
10
9
  export declare const PART_STYLE_OWNER_ATTR = "data-sf-part-style-owner";
11
10
  export declare const PART_STYLE_KIND_ATTR = "data-sf-part-style-kind";
@@ -23,7 +22,6 @@ export type PartNeedle = {
23
22
  row?: PartRow;
24
23
  };
25
24
  export { decodePartId, encodePartId };
26
- export declare function partOpenOn(selectedPartId: string | null, nodeId: string): boolean;
27
25
  export declare function normalizePartText(value: string): string;
28
26
  export declare function holdsAuthoredText(field: unknown): boolean;
29
27
  export declare function partLabel(field: Record<string, unknown>, key: string): string;
@@ -1 +1 @@
1
- import{decodePartId as m,encodePartId as P}from"efficient-easel/draw";import{stripMarkup as R}from"../../../format/lib/markup.js";import{LINK_FIELD_MARKER as A,SCAFFOLD_FIELD_MARKER as y,TEXT_FIELD_MARKER as u}from"efficient-easel/draw";import{readHidable as _}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as g}from"efficient-easel/draw";import{isStructuralTextProp as b}from"../../../format/lib/document/neutralization-contracts.js";import{fieldInOwnBox as L}from"../../../format/lib/document/own-box.js";import{partRowTexts as I}from"./part-rows.js";const B="data-sf-part",H="data-sf-region-part",W="data-sf-part-row";function $(e,t){return`${e}[${t}]`}const G="data-sf-part-selected",q="data-sf-part-kind",S="data-sf-part-style-owner",j="data-sf-part-style-kind";function J(e){for(let t=e;t;t=t.parentElement){const r=t.getAttribute(S),n=t.getAttribute(j);if(r&&n)return{owner:r,kind:n};if(t.getAttribute("data-easel-block"))return null}return null}const h=2;function Q(e,t){if(!e)return!1;const r=m(e);return!!r?.propKey&&r.nodeId===t}function w(e){return R(e).replace(/\s+/gu,"")}function l(e,t,r){const n=e[u];if(n){if(n.control==="textList"){const o=n.itemKey??"text";if(!Array.isArray(t))return;for(const i of t){const c=i?.[o];typeof c=="string"&&r.push(c)}return}const{text:s}=_(t);s?r.push(s):n.placeholder&&r.push(n.placeholder);return}if(!e[A]){if(e.type==="text"||e.type==="textarea"){typeof t=="string"&&t&&r.push(t);return}if(e.arrayFields&&Array.isArray(t)){for(const s of t)for(const[o,i]of Object.entries(e.arrayFields))l(i,s?.[o],r);return}if(e.objectFields&&t&&typeof t=="object")for(const[s,o]of Object.entries(e.objectFields))l(o,t[s],r)}}function U(e){if(!e||typeof e!="object")return!1;const t=e;return t[A]?!1:!!t[u]||t.type==="text"||t.type==="textarea"}function E(e,t){const r=e[u];return r?.label?r.label:typeof e.label=="string"?e.label:t}function N(e){const t=e.indexOf(" (");return(t>0?e.slice(0,t):e).trim()}function V(e,t){if(!e)return[];const r=[];for(const[n,s]of Object.entries(e)){if(!s||typeof s!="object"||b(n))continue;const o=s,i=[];l(o,t?.[n],i),!i.length&&o[y]!==void 0&&l(o,o[y],i);const c=E(o,n),a=new Set;for(const{row:T,text:f}of I(o,t?.[n])){const d=w(f);d.length<h||(a.add(d),r.push({key:n,label:c,texts:[d],row:T}))}const p=new Set(a),x=[];for(const T of i){const f=w(T);f.length<h||p.has(f)||(p.add(f),x.push(f))}x.length&&r.push({key:n,label:c,texts:x})}return r}const F=g;function O(e,t){if(!t||typeof t!="object"||b(e)||L(t))return null;const r=t[u];return!r||!F.includes(r.control)?null:r}function Z(e,t){const r=O(e,t);return r!==null&&r.identifier!==!0}function v(e,t){if(!e)return[];const r=[];for(const[n,s]of Object.entries(e)){const o=O(n,s);if(!o)continue;const{text:i,hidden:c}=_(t?.[n]),a=i||o.placeholder||"",p=R(a).replace(/\s+/gu," ").trim();r.push({key:n,label:N(E(s,n)),preview:p,offPage:o.offPage===!0,identifier:o.identifier===!0,hidden:!!c})}return r}export{B as PART_ATTR,q as PART_KIND_ATTR,W as PART_ROW_ATTR,G as PART_SELECTED_ATTR,j as PART_STYLE_KIND_ATTR,S as PART_STYLE_OWNER_ATTR,H as REGION_PART_ATTR,m as decodePartId,P as encodePartId,$ as encodePartRow,O as entryPartMetaOf,Z as fieldDrawsEntryRow,U as holdsAuthoredText,w as normalizePartText,N as partHeadLabel,E as partLabel,V as partNeedles,Q as partOpenOn,J as partStyleOwnerOf,v as sectionTextParts};
1
+ import{decodePartId as O,encodePartId as P}from"efficient-easel/draw";import{stripMarkup as m}from"../../../format/lib/markup.js";import{LINK_FIELD_MARKER as R,SCAFFOLD_FIELD_MARKER as A,TEXT_FIELD_MARKER as u}from"efficient-easel/draw";import{readHidable as y}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as g}from"efficient-easel/draw";import{isStructuralTextProp as _}from"../../../format/lib/document/neutralization-contracts.js";import{fieldInOwnBox as L}from"../../../format/lib/document/own-box.js";import{partRowTexts as I}from"./part-rows.js";import{nonEmptyString as S}from"../../../format/lib/non-empty-string.js";const W="data-sf-part",$="data-sf-region-part",G="data-sf-part-row";function q(e,t){return`${e}[${t}]`}const J="data-sf-part-kind",j="data-sf-part-style-owner",N="data-sf-part-style-kind";function Q(e){for(let t=e;t;t=t.parentElement){const r=t.getAttribute(j),n=t.getAttribute(N);if(r&&n)return{owner:r,kind:n};if(t.getAttribute("data-easel-block"))return null}return null}const b=2;function h(e){return m(e).replace(/\s+/gu,"")}function l(e,t,r){const n=e[u];if(n){if(n.control==="textList"){const o=n.itemKey??"text";if(!Array.isArray(t))return;for(const i of t){const c=i?.[o];typeof c=="string"&&r.push(c)}return}const{text:s}=y(t);s?r.push(s):n.placeholder&&r.push(n.placeholder);return}if(!e[R]){if(e.type==="text"||e.type==="textarea"){const s=S(t);s&&r.push(s);return}if(e.arrayFields&&Array.isArray(t)){for(const s of t)for(const[o,i]of Object.entries(e.arrayFields))l(i,s?.[o],r);return}if(e.objectFields&&t&&typeof t=="object")for(const[s,o]of Object.entries(e.objectFields))l(o,t[s],r)}}function U(e){if(!e||typeof e!="object")return!1;const t=e;return t[R]?!1:!!t[u]||t.type==="text"||t.type==="textarea"}function w(e,t){const r=e[u];return r?.label?r.label:typeof e.label=="string"?e.label:t}function F(e){const t=e.indexOf(" (");return(t>0?e.slice(0,t):e).trim()}function V(e,t){if(!e)return[];const r=[];for(const[n,s]of Object.entries(e)){if(!s||typeof s!="object"||_(n))continue;const o=s,i=[];l(o,t?.[n],i),!i.length&&o[A]!==void 0&&l(o,o[A],i);const c=w(o,n),a=new Set;for(const{row:T,text:f}of I(o,t?.[n])){const d=h(f);d.length<b||(a.add(d),r.push({key:n,label:c,texts:[d],row:T}))}const p=new Set(a),x=[];for(const T of i){const f=h(T);f.length<b||p.has(f)||(p.add(f),x.push(f))}x.length&&r.push({key:n,label:c,texts:x})}return r}const K=g;function E(e,t){if(!t||typeof t!="object"||_(e)||L(t))return null;const r=t[u];return!r||!K.includes(r.control)?null:r}function Z(e,t){const r=E(e,t);return r!==null&&r.identifier!==!0}function v(e,t){if(!e)return[];const r=[];for(const[n,s]of Object.entries(e)){const o=E(n,s);if(!o)continue;const{text:i,hidden:c}=y(t?.[n]),a=i||o.placeholder||"",p=m(a).replace(/\s+/gu," ").trim();r.push({key:n,label:F(w(s,n)),preview:p,offPage:o.offPage===!0,identifier:o.identifier===!0,hidden:!!c})}return r}export{W as PART_ATTR,J as PART_KIND_ATTR,G as PART_ROW_ATTR,N as PART_STYLE_KIND_ATTR,j as PART_STYLE_OWNER_ATTR,$ as REGION_PART_ATTR,O as decodePartId,P as encodePartId,q as encodePartRow,E as entryPartMetaOf,Z as fieldDrawsEntryRow,U as holdsAuthoredText,h as normalizePartText,F as partHeadLabel,w as partLabel,V as partNeedles,Q as partStyleOwnerOf,v as sectionTextParts};
@@ -18,11 +18,6 @@ export type HeadingStyleId = "heading-1" | "heading-2" | "heading-3";
18
18
  export type SiteWrite = {
19
19
  kind: "heading-case-upper";
20
20
  styles: readonly HeadingStyleId[];
21
- } | {
22
- kind: "add-theme-preset";
23
- copyOf: number;
24
- set: Readonly<Record<string, string>>;
25
- reason: string;
26
21
  };
27
22
  export type SiteFacts = {
28
23
  schema: string;
@@ -30,16 +25,12 @@ export type SiteFacts = {
30
25
  headingCase: string | null;
31
26
  textStyles: boolean | null;
32
27
  textStylesList?: readonly StoredTextStyle[] | null;
33
- themePresets: number | null;
34
28
  ownThemeRow?: boolean | null;
35
29
  deleted?: boolean;
36
30
  };
37
31
  export type ConvertContext = {
38
32
  site?: SiteFacts;
39
- cardTheme?: number;
40
33
  };
41
- export type PageConvertContext = Pick<ConvertContext, "cardTheme">;
42
- export declare function pageConvertContextOf(metadata: Readonly<Record<string, unknown>> | undefined): PageConvertContext;
43
34
  export type Restyled = {
44
35
  key: string;
45
36
  was: {
@@ -166,11 +157,11 @@ export declare const hasWords: (v: unknown) => boolean;
166
157
  export declare function convertSection(node: SectionNode, row: SectionToBoxRow, ctx?: ConvertContext): SectionConversion;
167
158
  export declare function convertSectionsInPage<D extends {
168
159
  content?: unknown;
169
- }>(data: D, page?: PageConvertContext): D;
160
+ }>(data: D): D;
170
161
  export type SectionToBoxEdit = {
171
162
  index: number;
172
163
  node: SectionNode;
173
164
  nodes: SectionNode[];
174
165
  };
175
- export declare function sectionToBoxEdits(content: unknown, page?: PageConvertContext): SectionToBoxEdit[];
166
+ export declare function sectionToBoxEdits(content: unknown): SectionToBoxEdit[];
176
167
  export {};
@@ -1 +1 @@
1
- import{readHidable as K}from"efficient-easel/draw";import{BOX_TYPE as V,CONTAINER_BLOCKS_SLOT as Y}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as D,labelTextSeed as F}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as G}from"../../../format/lib/sections/section-head-placement.js";import{siteCardThemeOf as q}from"../../../format/lib/content/section-width.js";import{finiteNumber as _}from"../../../format/lib/finite-number.js";const E=V,v=Y;function ct(e){const r=q(e);return r===null?{}:{cardTheme:r}}function J(e,r){return r===0?`${e}~box`:`${e}~box-${r+1}`}const P={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function at(e){for(const[r,i]of Object.entries(e)){if(r in P&&P[r]!==i)throw new Error(`lib/sections/section-to-box: "${r}" is already Box-native`);P[r]=i}}function ft(e){return P[e]}const Q=new Set(["id"]),S={};function dt(e){for(const[r,i]of Object.entries(e)){if(r in S&&S[r]!==i)throw new Error(`lib/sections/section-to-box: "${r}" already has a row`);S[r]=i}}function pt(e){return S[e]}function lt(){return Object.keys(S)}function ut(e){return S[e]?.on===!0}function yt(e){const r=G[e];if(!r)throw new Error(`lib/sections/section-to-box: "${e}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:r.num,role:"eyebrow"},{kind:"text",key:r.title,role:"heading"}];return r.description&&i.push({kind:"text",key:r.description,role:"body"}),r.headRows.includes("linkText")&&r.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const j=e=>K(e),ht=e=>j(e).text.trim()!=="",U=e=>e==="heading"?D():e==="eyebrow"?F():{};function Z(e,r,i){const x={...e._partStyles?.text??{},...r??{},...i??{}};return Object.keys(x).length?{_partStyles:{text:x}}:{}}function tt(e,r){if(e===void 0)return{};if(typeof e=="string")return{variant:e};const i=r[e.key];return{variant:typeof i=="string"&&Object.hasOwn(e.map,i)?e.map[i]:e.fallback}}function R(e,r,i,f){const x={...r};for(const y of e){const[h,m,T]=typeof y=="string"?[y,y,void 0]:y;if(i[h]===void 0)continue;const O=T?T(i[h],i):i[h];O===void 0?delete x[m]:x[m]=O,f(h,m,O===void 0)}return x}function z(e,r,i={}){const f=e.props,x=r.skip?.(f);if(x!==void 0)return{node:e,nodes:[e],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:x};const y=String(f.id??e.type),h=[],m=[],T=[],O=new Set,I=(n,o)=>{h.push({key:n,home:o}),O.add(n)},M=f._partStyles??{};let W=0;const $=(n,o)=>({type:n,props:{...o,id:`${y}~${n}-${++W}`}}),N=(n,o,l,d,u,a,k)=>{if(u){for(const s of n??[]){const c=typeof s=="string"?s:s[0];l[c]!==void 0&&k(c,`nothing — the ${d} has no parts, so it is not drawn`)}return}const t=typeof o=="function"?o(f,i):o??{};return R(n??[],t,l,(s,c,p)=>k(s,p?`nothing — the old value draws nothing (${d}: no ${c})`:`${a}${d}: ${c}`))},A=n=>n.map(o=>{const l={...o.props??{}};for(const[d,u]of Object.entries(o.slots??{}))l[d]=A(u);return $(o.type,l)}),C=(n,o,l)=>{const d=Array.isArray(o[n.key])?o[n.key]:[],u=d.map((s,c)=>{const p=s??{},b=n.item?.(p,c,f)??{},g=B(b.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${c+1}: `);return n.flat?b.props?g.map(w=>({...w,props:{...w.props,...b.props,id:w.props.id}})):g:[$(E,{name:`${n.name} ${c+1}`,...n.props??{},...b.props??{},[v]:g})]}),a=n.perRow?.(f),k=n.perRow?Number.isInteger(a)&&a>=1?a:1:0;if(l(n.key,(d.length?n.flat?`each item's parts (${d.length} items), in order`:`one Box per item (${d.length}), its parts inside`:"nothing — the list is empty")+(k&&d.length?`, in rows of ${k}`:"")),!k)return u.flat();const t=[];for(let s=0;s*k<u.length;s++)t.push($(E,{name:`${n.rowName??`${n.name} row`} ${s+1}`,...n.rowProps??{},[v]:u.slice(s*k,(s+1)*k).flat()}));return t},B=(n,o,l,d)=>{const u=[],a=(t,s)=>l?I(t,s):void 0,k=t=>l?M[t]:void 0;for(const t of n)if(!(t.when&&!t.when(f,l?void 0:o)))switch(t.kind){case"text":{const s=j(o[t.key]);if(!s.text.trim()){a(t.key,"nothing — empty words draw nothing, so no block");break}const c=U(t.role??"body"),{_partStyles:p,...b}=c,g=Z(c,t.style,k(t.key));if(t.was&&l){const w=g._partStyles?.text??{};T.push({key:t.key,was:t.was,...typeof w.textStyle=="string"?{textStyle:w.textStyle}:{},..._(w.size)!==void 0?{size:_(w.size)}:{},..._(w.sizePhone)!==void 0?{sizePhone:_(w.sizePhone)}:{}})}u.push($("Text",{text:s.text,...b,...t.props??{},...g,...s.hidden?{_hidden:!0}:{}})),a(t.key,`${d}Text block: its words${s.hidden?", hidden":""}`);break}case"button":{const s=j(o[t.key]);if(!s.text.trim()){a(t.key,"nothing — no words, no button"),a(t.href,"nothing — no button to link"),typeof t.variant=="object"&&a(t.variant.key,"nothing — no button to style");break}const c=typeof o[t.href]=="string"&&o[t.href]?o[t.href]:"#",p={...t.style??{},...k(t.key)??{}};u.push($("ButtonBlock",{label:s.text,href:c,...t.props??{},...tt(t.variant,o),...Object.keys(p).length?{_partStyles:{label:p}}:{},...s.hidden?{_hidden:!0}:{}})),a(t.key,`${d}Button block: its words`),a(t.href,`${d}Button block: its link`),typeof t.variant=="object"&&a(t.variant.key,`${d}Button block: its Style`);break}case"image":{const s=o[t.key];if(typeof s!="string"||!s){a(t.key,"nothing — no picture, no block"),t.alt&&a(t.alt,"nothing — no picture to describe");break}const c=t.alt&&typeof o[t.alt]=="string"?o[t.alt]:"";u.push($("ImageBlock",{src:s,alt:c,...t.props??{}})),a(t.key,`${d}Image block: its picture`),t.alt&&a(t.alt,`${d}Image block: its alt text`);break}case"list":{u.push(...C(t,o,a));break}case"group":{const s=B(t.parts,o,l,d),c=N(t.box,t.props,o,`${t.name} Box`,!s.length&&!t.keepEmpty,d,a);c&&u.push($(E,{name:t.name,...c,[v]:s}));break}case"block":{const s=t.parts?B(t.parts,o,l,d):[],c=N(t.box,t.props,o,`${t.type} block`,!!t.parts&&!s.length&&!t.keepEmpty,d,a);c&&u.push($(t.type,{...c,...t.slot?{[t.slot]:s}:{}}));break}case"core":{const s=t.as??e.type,c={headPlacement:"own-box",...t.props??{}};for(const p of t.keep)o[p]!==void 0&&(c[p]=o[p],a(p,`the ${s} block inside the Box`));for(const[p,b]of Object.entries(t.rename??{}))o[p]!==void 0&&(c[b]=o[p],a(p,`the ${s} block inside the Box: ${b}`));for(const[p,b]of Object.entries(t.slots??{}))c[p]=b.flatMap(g=>"kind"in g?C(g,o,a):A([g]));u.push($(s,c));break}}return u},X=(n,o)=>{const l=o===0?"Box":`${n.name} Box`,d=B(n.parts,f,!0,o===0?"":`${l}: `),u=typeof n.boxProps=="function"?n.boxProps(f,i):n.boxProps??{},a=R(n.box??[],u,f,(k,t,s)=>I(k,s?`nothing — the old value draws nothing (${l}: no ${t})`:`${l}: ${t}`));return{type:E,props:{name:n.name,...a,[v]:d,id:J(y,o)}}},L=[r,...r.also??[]].map(X);f._partStyles!==void 0&&I("_partStyles","each old part's style moved to its new part");for(const[n,o]of Object.entries(r.drop??{}))n in f&&(m.push({key:n,why:o}),O.add(n));for(const n of Object.keys(f))Q.has(n)||O.has(n)||m.push({key:n,why:"not in the row — not carried"});return{node:L[0],nodes:L,carried:h,dropped:m,siteWrites:[...r.site?.(e,i)??[]],restyled:T}}const H=e=>typeof e.cardTheme=="number"?{cardTheme:e.cardTheme}:{};function kt(e,r={}){const i=e.content;if(!Array.isArray(i))return e;let f=!1;const x=i.flatMap(y=>{const h=y&&typeof y.type=="string"?S[y.type]:void 0;if(!h?.on)return[y];const m=z(y,h,H(r));return m.skipped!==void 0?[y]:(f=!0,m.nodes)});return f?{...e,content:x}:e}function xt(e,r={}){if(!Array.isArray(e))return[];const i=[];return e.forEach((f,x)=>{const y=f&&typeof f.type=="string"?S[f.type]:void 0;if(!y?.on)return;const h=z(f,y,H(r));h.skipped===void 0&&i.push({index:x,node:h.node,nodes:h.nodes})}),i}export{v as SECTION_BOX_SLOT,E as SECTION_BOX_TYPE,ft as boxNativeReason,z as convertSection,kt as convertSectionsInPage,ut as convertsToBox,ht as hasWords,yt as headParts,ct as pageConvertContextOf,at as registerBoxNativeSections,dt as registerSectionToBox,J as sectionBoxIdOf,xt as sectionToBoxEdits,pt as sectionToBoxRow,lt as sectionToBoxTypes};
1
+ import{readHidable as X}from"efficient-easel/draw";import{BOX_TYPE as K,CONTAINER_BLOCKS_SLOT as V}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as Y,labelTextSeed as D}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as F}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as _}from"../../../format/lib/finite-number.js";const E=K,v=V;function G(e,r){return r===0?`${e}~box`:`${e}~box-${r+1}`}const P={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function st(e){for(const[r,i]of Object.entries(e)){if(r in P&&P[r]!==i)throw new Error(`lib/sections/section-to-box: "${r}" is already Box-native`);P[r]=i}}function rt(e){return P[e]}const q=new Set(["id"]),$={};function it(e){for(const[r,i]of Object.entries(e)){if(r in $&&$[r]!==i)throw new Error(`lib/sections/section-to-box: "${r}" already has a row`);$[r]=i}}function ct(e){return $[e]}function at(){return Object.keys($)}function ft(e){return $[e]?.on===!0}function dt(e){const r=F[e];if(!r)throw new Error(`lib/sections/section-to-box: "${e}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:r.num,role:"eyebrow"},{kind:"text",key:r.title,role:"heading"}];return r.description&&i.push({kind:"text",key:r.description,role:"body"}),r.headRows.includes("linkText")&&r.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const j=e=>X(e),pt=e=>j(e).text.trim()!=="",J=e=>e==="heading"?Y():e==="eyebrow"?D():{};function Q(e,r,i){const p={...e._partStyles?.text??{},...r??{},...i??{}};return Object.keys(p).length?{_partStyles:{text:p}}:{}}function U(e,r){if(e===void 0)return{};if(typeof e=="string")return{variant:e};const i=r[e.key];return{variant:typeof i=="string"&&Object.hasOwn(e.map,i)?e.map[i]:e.fallback}}function z(e,r,i,d){const p={...r};for(const h of e){const[b,S,O]=typeof h=="string"?[h,h,void 0]:h;if(i[b]===void 0)continue;const B=O?O(i[b],i):i[b];B===void 0?delete p[S]:p[S]=B,d(b,S,B===void 0)}return p}function C(e,r,i={}){const d=e.props,p=r.skip?.(d);if(p!==void 0)return{node:e,nodes:[e],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:p};const h=String(d.id??e.type),b=[],S=[],O=[],B=new Set,I=(o,n)=>{b.push({key:o,home:n}),B.add(o)},H=d._partStyles??{};let M=0;const w=(o,n)=>({type:o,props:{...n,id:`${h}~${o}-${++M}`}}),N=(o,n,u,f,y,a,k)=>{if(y){for(const s of o??[]){const c=typeof s=="string"?s:s[0];u[c]!==void 0&&k(c,`nothing — the ${f} has no parts, so it is not drawn`)}return}const t=typeof n=="function"?n(d,i):n??{};return z(o??[],t,u,(s,c,l)=>k(s,l?`nothing — the old value draws nothing (${f}: no ${c})`:`${a}${f}: ${c}`))},A=o=>o.map(n=>{const u={...n.props??{}};for(const[f,y]of Object.entries(n.slots??{}))u[f]=A(y);return w(n.type,u)}),L=(o,n,u)=>{const f=Array.isArray(n[o.key])?n[o.key]:[],y=f.map((s,c)=>{const l=s??{},x=o.item?.(l,c,d)??{},m=T(x.reverse?[...o.parts].reverse():o.parts,l,!1,`item ${c+1}: `);return o.flat?x.props?m.map(g=>({...g,props:{...g.props,...x.props,id:g.props.id}})):m:[w(E,{name:`${o.name} ${c+1}`,...o.props??{},...x.props??{},[v]:m})]}),a=o.perRow?.(d),k=o.perRow?Number.isInteger(a)&&a>=1?a:1:0;if(u(o.key,(f.length?o.flat?`each item's parts (${f.length} items), in order`:`one Box per item (${f.length}), its parts inside`:"nothing — the list is empty")+(k&&f.length?`, in rows of ${k}`:"")),!k)return y.flat();const t=[];for(let s=0;s*k<y.length;s++)t.push(w(E,{name:`${o.rowName??`${o.name} row`} ${s+1}`,...o.rowProps??{},[v]:y.slice(s*k,(s+1)*k).flat()}));return t},T=(o,n,u,f)=>{const y=[],a=(t,s)=>u?I(t,s):void 0,k=t=>u?H[t]:void 0;for(const t of o)if(!(t.when&&!t.when(d,u?void 0:n)))switch(t.kind){case"text":{const s=j(n[t.key]);if(!s.text.trim()){a(t.key,"nothing — empty words draw nothing, so no block");break}const c=J(t.role??"body"),{_partStyles:l,...x}=c,m=Q(c,t.style,k(t.key));if(t.was&&u){const g=m._partStyles?.text??{};O.push({key:t.key,was:t.was,...typeof g.textStyle=="string"?{textStyle:g.textStyle}:{},..._(g.size)!==void 0?{size:_(g.size)}:{},..._(g.sizePhone)!==void 0?{sizePhone:_(g.sizePhone)}:{}})}y.push(w("Text",{text:s.text,...x,...t.props??{},...m,...s.hidden?{_hidden:!0}:{}})),a(t.key,`${f}Text block: its words${s.hidden?", hidden":""}`);break}case"button":{const s=j(n[t.key]);if(!s.text.trim()){a(t.key,"nothing — no words, no button"),a(t.href,"nothing — no button to link"),typeof t.variant=="object"&&a(t.variant.key,"nothing — no button to style");break}const c=typeof n[t.href]=="string"&&n[t.href]?n[t.href]:"#",l={...t.style??{},...k(t.key)??{}};y.push(w("ButtonBlock",{label:s.text,href:c,...t.props??{},...U(t.variant,n),...Object.keys(l).length?{_partStyles:{label:l}}:{},...s.hidden?{_hidden:!0}:{}})),a(t.key,`${f}Button block: its words`),a(t.href,`${f}Button block: its link`),typeof t.variant=="object"&&a(t.variant.key,`${f}Button block: its Style`);break}case"image":{const s=n[t.key];if(typeof s!="string"||!s){a(t.key,"nothing — no picture, no block"),t.alt&&a(t.alt,"nothing — no picture to describe");break}const c=t.alt&&typeof n[t.alt]=="string"?n[t.alt]:"";y.push(w("ImageBlock",{src:s,alt:c,...t.props??{}})),a(t.key,`${f}Image block: its picture`),t.alt&&a(t.alt,`${f}Image block: its alt text`);break}case"list":{y.push(...L(t,n,a));break}case"group":{const s=T(t.parts,n,u,f),c=N(t.box,t.props,n,`${t.name} Box`,!s.length&&!t.keepEmpty,f,a);c&&y.push(w(E,{name:t.name,...c,[v]:s}));break}case"block":{const s=t.parts?T(t.parts,n,u,f):[],c=N(t.box,t.props,n,`${t.type} block`,!!t.parts&&!s.length&&!t.keepEmpty,f,a);c&&y.push(w(t.type,{...c,...t.slot?{[t.slot]:s}:{}}));break}case"core":{const s=t.as??e.type,c={headPlacement:"own-box",...t.props??{}};for(const l of t.keep)n[l]!==void 0&&(c[l]=n[l],a(l,`the ${s} block inside the Box`));for(const[l,x]of Object.entries(t.rename??{}))n[l]!==void 0&&(c[x]=n[l],a(l,`the ${s} block inside the Box: ${x}`));for(const[l,x]of Object.entries(t.slots??{}))c[l]=x.flatMap(m=>"kind"in m?L(m,n,a):A([m]));y.push(w(s,c));break}}return y},W=(o,n)=>{const u=n===0?"Box":`${o.name} Box`,f=T(o.parts,d,!0,n===0?"":`${u}: `),y=typeof o.boxProps=="function"?o.boxProps(d,i):o.boxProps??{},a=z(o.box??[],y,d,(k,t,s)=>I(k,s?`nothing — the old value draws nothing (${u}: no ${t})`:`${u}: ${t}`));return{type:E,props:{name:o.name,...a,[v]:f,id:G(h,n)}}},R=[r,...r.also??[]].map(W);d._partStyles!==void 0&&I("_partStyles","each old part's style moved to its new part");for(const[o,n]of Object.entries(r.drop??{}))o in d&&(S.push({key:o,why:n}),B.add(o));for(const o of Object.keys(d))q.has(o)||B.has(o)||S.push({key:o,why:"not in the row — not carried"});return{node:R[0],nodes:R,carried:b,dropped:S,siteWrites:[...r.site?.(e,i)??[]],restyled:O}}function lt(e){const r=e.content;if(!Array.isArray(r))return e;let i=!1;const d=r.flatMap(p=>{const h=p&&typeof p.type=="string"?$[p.type]:void 0;if(!h?.on)return[p];const b=C(p,h);return b.skipped!==void 0?[p]:(i=!0,b.nodes)});return i?{...e,content:d}:e}function ut(e){if(!Array.isArray(e))return[];const r=[];return e.forEach((i,d)=>{const p=i&&typeof i.type=="string"?$[i.type]:void 0;if(!p?.on)return;const h=C(i,p);h.skipped===void 0&&r.push({index:d,node:h.node,nodes:h.nodes})}),r}export{v as SECTION_BOX_SLOT,E as SECTION_BOX_TYPE,rt as boxNativeReason,C as convertSection,lt as convertSectionsInPage,ft as convertsToBox,pt as hasWords,dt as headParts,st as registerBoxNativeSections,it as registerSectionToBox,G as sectionBoxIdOf,ut as sectionToBoxEdits,ct as sectionToBoxRow,at as sectionToBoxTypes};
@@ -1,2 +1,2 @@
1
- import{defaultTextStyles as E,textStyleCaseCss as X}from"efficient-easel/text-styles/model";import{FONT_OPTIONS as Y,normalizeFonts as I}from"../../../format/lib/fonts.js";import{PART_PHONE_MAX_CSS as G,STYLE_ID_OF_ROLE as U,TEXT_STYLE_ATTR as Z,partSpacingOf as q}from"../document/part-styles.js";import{faceClassOf as L}from"../../../format/lib/text-style-face.js";import{compressionMetrics as B,headingTypographyFromRow as K,normalizeHeadingCompression as k,normalizeSizes as j}from"../../../format/lib/theme.js";import{finiteNumber as h}from"../../../format/lib/finite-number.js";const T=e=>e==="sentence"?"none":void 0,_=e=>typeof e=="string"&&e?e:void 0,F=["font","color","size","sizePhone","weight","italic","lineHeight","letterSpacing","paragraphSpacing","letterCase","largestSize"];function p(e){const i={};for(const n of F)e[n]!==void 0&&(i[n]=e[n]);return i}function H(e,i){const{auto:n,...t}=e,o=new Set(i??[]),r=F.filter(a=>o.has(a)&&e.values[a]===void 0);return r.length?{...t,auto:r}:t}function R(e){const i=e.fonts,n=e.sizes,t=e.typography,o=B(e.compression),r={"heading-1":{font:_(i.heading),size:h(n.headingLarge),weight:h(t.weight),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:T(t.case),largestSize:h(t.maxPx)},"heading-2":{font:_(i.heading2),size:h(n.headingMedium),weight:h(t.weight2),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:T(t.case2)},"heading-3":{font:_(i.heading3),size:h(n.headingSmall),weight:h(t.weight3),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:T(t.case3)},"body-1":{font:_(i.body),size:h(n.body)},"body-5":{font:_(i.label),size:h(n.label)}};return E().map(({id:a,kind:l,name:c})=>({id:a,kind:l,name:c,values:p(r[a]??{})}))}function C(e){return Array.isArray(e)&&e.every(n=>n&&typeof n=="object"&&typeof n.id=="string"&&(n.kind==="heading"||n.kind==="body")&&typeof n.name=="string")?e.map(n=>H({...n,values:p(n.values??{})},Array.isArray(n.auto)?n.auto:void 0)):null}function ue(e){return C(e)??[]}function M(e){return C(e)??E().map(({id:i,kind:n,name:t})=>({id:i,kind:n,name:t,values:{}}))}function O(e,i){const n=R(i),t=C(e);return t?t.map(o=>{const r={...w(n,o.id)};for(const a of o.auto??[])delete r[a];return{...o,values:p({...r,...o.values})}}):n}const w=(e,i)=>e.find(n=>n.id===i)?.values??{},V=["heading-1","heading-2","heading-3"];function fe({saved:e,old:i,cur:n,next:t,sizeOf:o}){const r=R(i),a=M(e),l=O(a,i),c=[],y=t.map(s=>{const d=n.find(f=>f.id===s.id),b=a.find(f=>f.id===s.id);if(!d||!b)return Q([s],o)[0];const u={...b.values},z=new Set(b.auto??[]),v=s.values,P=d.values,A=[...new Set([...Object.keys(v),...Object.keys(P)])].filter(f=>JSON.stringify(v[f])!==JSON.stringify(P[f]));A.sort((f,m)=>+(f==="letterSpacing")-+(m==="letterSpacing"));for(const f of A){const m=f==="lineSpacing"?"lineHeight":f,$=v[f];if($===void 0){delete u[m],w(r,s.id)[m]!==void 0&&(c.push([s.id,m]),z.add(m));continue}if(z.delete(m),f==="lineSpacing")u.lineHeight=x($/100,3);else if(f==="letterSpacing"){const J=l.find(W=>W.id===s.id),N=o({...s,values:p({...J?.values??{},...u})});u.letterSpacing=N?x($/N,4):0}else u[m]=$}return H({id:s.id,kind:s.kind,name:s.name,values:p(u)},z)});let g=i.compression;if(c.some(([s,d])=>(d==="lineHeight"||d==="letterSpacing")&&V.includes(s))&&k(g)!=="normal"){for(const s of V){const d=y.find(u=>u.id===s);if(!d)continue;const b={...d.values};for(const u of["lineHeight","letterSpacing"])c.some(([z,v])=>z===s&&v===u)||b[u]===void 0&&!(d.auto??[]).includes(u)&&(b[u]=w(r,s)[u]);d.values=p(b)}g="normal"}return{saved:y,old:{...i,compression:g}}}function ge(e,i){const n={text_styles:e.saved};return e.old.compression!==i.compression&&(n.heading_compression=k(e.old.compression)),n}const x=(e,i)=>Number(e.toFixed(i));function pe(e,i){return e.map(n=>{const{lineHeight:t,letterSpacing:o,...r}=n.values,a={...r};return t!==void 0&&(a.lineSpacing=x(t*100,1)),o!==void 0&&(a.letterSpacing=x(o*i(n),2)),{id:n.id,kind:n.kind,name:n.name,values:a}})}function Q(e,i){return e.map(n=>{const{lineSpacing:t,letterSpacing:o,...r}=n.values,a={id:n.id,kind:n.kind,name:n.name,values:p({...r})},l={...a.values};if(t!==void 0&&(l.lineHeight=x(t/100,3)),o!==void 0){const c=i({...a,values:{...a.values}});l.letterSpacing=c?x(o/c,4):0}return{...a,values:p(l)}})}function he(e){const i={fonts:I({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:j({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:k(e.heading_compression),typography:K(e)},n=e.text_styles??null,t=Array.isArray(n)?D(O(n,i),i):i;return{fonts:I(t.fonts),sizes:j(t.sizes),compression:k(t.compression),typography:t.typography,textStyles:n}}function D(e,i){const n=s=>e.find(d=>d.id===s)?.values??{},t=n("heading-1"),o=n("heading-2"),r=n("heading-3"),a=n("body-1"),l=n("body-5"),c=i.fonts,y=i.sizes,g=i.typography,S=s=>s==="none"?"sentence":"authored";return{fonts:{...c,heading:t.font??c.heading,heading2:o.font??t.font??c.heading2,heading3:r.font??t.font??c.heading3,body:a.font??c.body,label:l.font??c.label},sizes:{...y,headingLarge:t.size??null,headingMedium:o.size??null,headingSmall:r.size??null,body:a.size??null,label:l.size??null},compression:i.compression,typography:{...g,case:S(t.letterCase),weight:t.weight??null,maxPx:t.largestSize??null,weight2:o.weight??null,weight3:r.weight??null,case2:S(o.letterCase),case3:S(r.letterCase)}}}function me(e){const i=C(e.textStyles);if(!i||i.every(o=>Object.keys(o.values).length===0&&!o.auto))return e;const n={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},t=D(O(i,n),n);return{...e,fonts:t.fonts,sizes:t.sizes,headingCompression:t.compression,headingTypography:t.typography}}function ee(e){return e==="accent"?"var(--accent)":e==="text"?"var(--fg)":e==="labels"?"var(--fg-dim)":/^#[0-9a-f]{6}$/i.test(e)?e:null}function ne(e){const i=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: var(--sf-part-para) }`,`${e} ${i}:not(:first-child) { margin-top: var(--sf-part-para) }`,`${e} ${i}:not(:last-child) { margin-bottom: var(--sf-part-para) }`]}function ye(e){const i=[];for(const n of e){const t=n.values,o=`.${L(n)}`,r=`[${Z}="${n.id}"]`,a=`${o}, ${r}`,l=[],c=t.font!==void 0?Y.find(s=>s.key===t.font)?.cssVar:void 0;if(c&&l.push(`font-family: var(${c})`),t.size!==void 0){const s=t.largestSize!==void 0?Math.min(t.size,t.largestSize):t.size;l.push(`font-size: ${s}px`)}const y=t.color!==void 0?ee(t.color):null;y&&l.push(`color: ${y}`),t.italic===!0&&l.push("font-style: italic"),t.weight!==void 0&&l.push(`font-weight: ${t.weight}`);const g=[];t.lineHeight!==void 0&&g.push(`line-height: ${t.lineHeight}`),t.letterSpacing!==void 0&&g.push(`letter-spacing: ${t.letterSpacing}em`),n.kind==="body"&&l.push(...g);const S=X(t.letterCase);if(S&&l.push(`text-transform: ${S}`),t.paragraphSpacing&&l.push(`--sf-part-para: ${t.paragraphSpacing}px`),l.length&&i.push(`${a} { ${l.join("; ")} }`),n.kind==="heading"&&g.length&&i.push(`${a}, ${o}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${g.join("; ")} }`),t.paragraphSpacing&&i.push(...ne(`:is(${a})`)),t.sizePhone!==void 0){const s=te[n.id],d=[`${a} { font-size: ${t.sizePhone}px }`];s&&d.push(`.sf-themed-content { --size-${s}: ${t.sizePhone}px !important }`),i.push(`@media ${G} { ${d.join(" ")} }`)}}return i.join(`
2
- `)}const te={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function Se(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function be(e){return e?U[e]:void 0}function ie(e){const i=q(e);return p({font:e.font,color:e.color,size:e.size,weight:e.weight,italic:e.italic,lineHeight:i.lineHeight,letterSpacing:i.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function xe(e){return Object.keys(ie(e)).length>0}function ze({saved:e,old:i,styleId:n,values:t}){const o=M(e);return{saved:oe(o,n,t),old:i}}function oe(e,i,n){return e.map(t=>t.id===i?H({...t,values:p({...t.values,...n})},t.auto):t)}function ve(e){const i=e.filter(n=>n.kind==="body").map(n=>Number(/^body-(\d+)$/.exec(n.id)?.[1])).filter(n=>Number.isInteger(n)&&n>0);return i.length?`body-${Math.max(...i)}`:"body-1"}export{Se as accentItalicCss,fe as applyListChange,ve as eyebrowStyleId,L as faceClassOf,Q as fromPanelStyles,xe as hasStyleChange,ge as listChangePatch,M as listToWrite,ie as partStyleToTextStyleValues,ze as pushIntoStyle,O as resolveTextStyles,oe as setStyleValues,he as siteTextFromRow,ue as storedTextStyles,be as styleIdOfRole,ye as textStylesCss,R as textStylesFromOld,D as textStylesToOld,me as themeWithTextStyles,pe as toPanelStyles};
1
+ import{defaultTextStyles as A,textStyleCaseCss as Y}from"efficient-easel/text-styles/model";import{FONT_OPTIONS as G,normalizeFonts as I}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as U}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as X,TEXT_STYLE_ATTR as Z,partSpacingOf as q}from"../document/part-styles.js";import{faceClassOf as L}from"../../../format/lib/text-style-face.js";import{compressionMetrics as B,headingTypographyFromRow as K,normalizeHeadingCompression as k,normalizeSizes as j}from"../../../format/lib/theme.js";import{finiteNumber as m}from"../../../format/lib/finite-number.js";import{nonEmptyString as _}from"../../../format/lib/non-empty-string.js";const T=e=>e==="sentence"?"none":void 0,F=["font","color","size","sizePhone","weight","italic","lineHeight","letterSpacing","paragraphSpacing","letterCase","largestSize"];function p(e){const i={};for(const n of F)e[n]!==void 0&&(i[n]=e[n]);return i}function H(e,i){const{auto:n,...t}=e,o=new Set(i??[]),r=F.filter(a=>o.has(a)&&e.values[a]===void 0);return r.length?{...t,auto:r}:t}function M(e){const i=e.fonts,n=e.sizes,t=e.typography,o=B(e.compression),r={"heading-1":{font:_(i.heading),size:m(n.headingLarge),weight:m(t.weight),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:T(t.case),largestSize:m(t.maxPx)},"heading-2":{font:_(i.heading2),size:m(n.headingMedium),weight:m(t.weight2),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:T(t.case2)},"heading-3":{font:_(i.heading3),size:m(n.headingSmall),weight:m(t.weight3),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:T(t.case3)},"body-1":{font:_(i.body),size:m(n.body)},"body-5":{font:_(i.label),size:m(n.label)}};return A().map(({id:a,kind:l,name:d})=>({id:a,kind:l,name:d,values:p(r[a]??{})}))}function C(e){return Array.isArray(e)&&e.every(n=>n&&typeof n=="object"&&typeof n.id=="string"&&(n.kind==="heading"||n.kind==="body")&&typeof n.name=="string")?e.map(n=>H({...n,values:p(n.values??{})},Array.isArray(n.auto)?n.auto:void 0)):null}function ge(e){return C(e)??[]}function R(e){return C(e)??A().map(({id:i,kind:n,name:t})=>({id:i,kind:n,name:t,values:{}}))}function O(e,i){const n=M(i),t=C(e);return t?t.map(o=>{const r={...w(n,o.id)};for(const a of o.auto??[])delete r[a];return{...o,values:p({...r,...o.values})}}):n}const w=(e,i)=>e.find(n=>n.id===i)?.values??{},V=["heading-1","heading-2","heading-3"];function pe({saved:e,old:i,cur:n,next:t,sizeOf:o}){const r=M(i),a=R(e),l=O(a,i),d=[],S=t.map(s=>{const c=n.find(u=>u.id===s.id),b=a.find(u=>u.id===s.id);if(!c||!b)return Q([s],o)[0];const f={...b.values},z=new Set(b.auto??[]),v=s.values,E=c.values,N=[...new Set([...Object.keys(v),...Object.keys(E)])].filter(u=>JSON.stringify(v[u])!==JSON.stringify(E[u]));N.sort((u,y)=>+(u==="letterSpacing")-+(y==="letterSpacing"));for(const u of N){const y=u==="lineSpacing"?"lineHeight":u,$=v[u];if($===void 0){delete f[y],w(r,s.id)[y]!==void 0&&(d.push([s.id,y]),z.add(y));continue}if(z.delete(y),u==="lineSpacing")f.lineHeight=x($/100,3);else if(u==="letterSpacing"){const J=l.find(W=>W.id===s.id),P=o({...s,values:p({...J?.values??{},...f})});f.letterSpacing=P?x($/P,4):0}else f[y]=$}return H({id:s.id,kind:s.kind,name:s.name,values:p(f)},z)});let g=i.compression;if(d.some(([s,c])=>(c==="lineHeight"||c==="letterSpacing")&&V.includes(s))&&k(g)!=="normal"){for(const s of V){const c=S.find(f=>f.id===s);if(!c)continue;const b={...c.values};for(const f of["lineHeight","letterSpacing"])d.some(([z,v])=>z===s&&v===f)||b[f]===void 0&&!(c.auto??[]).includes(f)&&(b[f]=w(r,s)[f]);c.values=p(b)}g="normal"}return{saved:S,old:{...i,compression:g}}}function he(e,i){const n={text_styles:e.saved};return e.old.compression!==i.compression&&(n.heading_compression=k(e.old.compression)),n}const x=(e,i)=>Number(e.toFixed(i));function me(e,i){return e.map(n=>{const{lineHeight:t,letterSpacing:o,...r}=n.values,a={...r};return t!==void 0&&(a.lineSpacing=x(t*100,1)),o!==void 0&&(a.letterSpacing=x(o*i(n),2)),{id:n.id,kind:n.kind,name:n.name,values:a}})}function Q(e,i){return e.map(n=>{const{lineSpacing:t,letterSpacing:o,...r}=n.values,a={id:n.id,kind:n.kind,name:n.name,values:p({...r})},l={...a.values};if(t!==void 0&&(l.lineHeight=x(t/100,3)),o!==void 0){const d=i({...a,values:{...a.values}});l.letterSpacing=d?x(o/d,4):0}return{...a,values:p(l)}})}function ye(e){const i={fonts:I({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:j({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:k(e.heading_compression),typography:K(e)},n=e.text_styles??null,t=Array.isArray(n)?D(O(n,i),i):i;return{fonts:I(t.fonts),sizes:j(t.sizes),compression:k(t.compression),typography:t.typography,textStyles:n}}function D(e,i){const n=s=>e.find(c=>c.id===s)?.values??{},t=n("heading-1"),o=n("heading-2"),r=n("heading-3"),a=n("body-1"),l=n("body-5"),d=i.fonts,S=i.sizes,g=i.typography,h=s=>s==="none"?"sentence":"authored";return{fonts:{...d,heading:t.font??d.heading,heading2:o.font??t.font??d.heading2,heading3:r.font??t.font??d.heading3,body:a.font??d.body,label:l.font??d.label},sizes:{...S,headingLarge:t.size??null,headingMedium:o.size??null,headingSmall:r.size??null,body:a.size??null,label:l.size??null},compression:i.compression,typography:{...g,case:h(t.letterCase),weight:t.weight??null,maxPx:t.largestSize??null,weight2:o.weight??null,weight3:r.weight??null,case2:h(o.letterCase),case3:h(r.letterCase)}}}function Se(e){const i=C(e.textStyles);if(!i||i.every(o=>Object.keys(o.values).length===0&&!o.auto))return e;const n={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},t=D(O(i,n),n);return{...e,fonts:t.fonts,sizes:t.sizes,headingCompression:t.compression,headingTypography:t.typography}}function ee(e){return e==="accent"?"var(--accent)":e==="text"?"var(--fg)":e==="labels"?"var(--fg-dim)":/^#[0-9a-f]{6}$/i.test(e)?e:null}function ne(e){const i=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: var(--sf-part-para) }`,`${e} ${i}:not(:first-child) { margin-top: var(--sf-part-para) }`,`${e} ${i}:not(:last-child) { margin-bottom: var(--sf-part-para) }`]}function be(e){const i=[];for(const n of e){const t=n.values,o=`.${L(n)}`,r=`[${Z}="${n.id}"]`,a=`${o}, ${r}`,l=[],d=t.font!==void 0?G.find(s=>s.key===t.font)?.cssVar:void 0;if(d&&l.push(`font-family: var(${d})`),t.size!==void 0){const s=t.largestSize!==void 0?Math.min(t.size,t.largestSize):t.size;l.push(`font-size: ${s}px`)}const S=t.color!==void 0?ee(t.color):null;S&&l.push(`color: ${S}`),t.italic===!0&&l.push("font-style: italic"),t.weight!==void 0&&l.push(`font-weight: ${t.weight}`);const g=[];t.lineHeight!==void 0&&g.push(`line-height: ${t.lineHeight}`),t.letterSpacing!==void 0&&g.push(`letter-spacing: ${t.letterSpacing}em`),n.kind==="body"&&l.push(...g);const h=Y(t.letterCase);if(h&&n.kind==="body"&&l.push(`text-transform: ${h}`),t.paragraphSpacing&&l.push(`--sf-part-para: ${t.paragraphSpacing}px`),l.length&&i.push(`${a} { ${l.join("; ")} }`),n.kind==="heading"&&g.length&&i.push(`${a}, ${o}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${g.join("; ")} }`),n.kind==="heading"&&h&&i.push(`${r}, ${o}:is(h1, h2, h3, h4) { text-transform: ${h} }`),t.paragraphSpacing&&i.push(...ne(`:is(${a})`)),t.sizePhone!==void 0){const s=te[n.id],c=[`${a} { font-size: ${t.sizePhone}px }`];s&&c.push(`.sf-themed-content { --size-${s}: ${t.sizePhone}px !important }`),i.push(`@media ${U} { ${c.join(" ")} }`)}}return i.join(`
2
+ `)}const te={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function xe(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function ze(e){return e?X[e]:void 0}function ie(e){const i=q(e);return p({font:e.font,color:e.color,size:e.size,weight:e.weight,italic:e.italic,lineHeight:i.lineHeight,letterSpacing:i.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function ve(e){return Object.keys(ie(e)).length>0}function _e({saved:e,old:i,styleId:n,values:t}){const o=R(e);return{saved:oe(o,n,t),old:i}}function oe(e,i,n){return e.map(t=>t.id===i?H({...t,values:p({...t.values,...n})},t.auto):t)}function $e(e){const i=e.filter(n=>n.kind==="body").map(n=>Number(/^body-(\d+)$/.exec(n.id)?.[1])).filter(n=>Number.isInteger(n)&&n>0);return i.length?`body-${Math.max(...i)}`:"body-1"}export{xe as accentItalicCss,pe as applyListChange,$e as eyebrowStyleId,L as faceClassOf,Q as fromPanelStyles,ve as hasStyleChange,he as listChangePatch,R as listToWrite,ie as partStyleToTextStyleValues,_e as pushIntoStyle,O as resolveTextStyles,oe as setStyleValues,ye as siteTextFromRow,ge as storedTextStyles,ze as styleIdOfRole,be as textStylesCss,M as textStylesFromOld,D as textStylesToOld,Se as themeWithTextStyles,me as toPanelStyles};