efficient-web-builder 52.0.0 → 53.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 (143) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/editor/components/ChatSettingsPanel.js +1 -1
  3. package/dist/editor/components/MediaUploadField.d.ts +7 -7
  4. package/dist/editor/components/MediaUploadField.js +1 -1
  5. package/dist/editor/components/PartSettingsPanel.js +1 -1
  6. package/dist/editor/components/PartTextBox.js +1 -1
  7. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  8. package/dist/editor/components/SectionTextPartBridge.js +1 -1
  9. package/dist/editor/components/SiteAccentField.js +1 -1
  10. package/dist/editor/components/SiteTextStylesField.d.ts +3 -3
  11. package/dist/editor/components/SiteTextStylesField.js +1 -1
  12. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  13. package/dist/editor/components/storefront-editor.css +70 -20
  14. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  15. package/dist/editor/lib/animation/hover-fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/general/Breadcrumb/fields.js +1 -1
  17. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  18. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  19. package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
  20. package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
  21. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  22. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  23. package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
  24. package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
  25. package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
  26. package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
  27. package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
  28. package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
  29. package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
  30. package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
  31. package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
  32. package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
  33. package/dist/editor/lib/document/blocks/shared-fields.d.ts +5 -0
  34. package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
  35. package/dist/editor/lib/document/box-fields.d.ts +23 -2
  36. package/dist/editor/lib/document/box-fields.js +1 -1
  37. package/dist/editor/lib/document/card-row-fields.js +1 -1
  38. package/dist/editor/lib/document/choice-pictures.d.ts +21 -0
  39. package/dist/editor/lib/document/choice-pictures.js +1 -0
  40. package/dist/editor/lib/document/controls.d.ts +19 -5
  41. package/dist/editor/lib/document/controls.js +1 -1
  42. package/dist/editor/lib/document/hidable-rows-drawn.d.ts +1 -0
  43. package/dist/editor/lib/document/hidable-rows-drawn.js +1 -1
  44. package/dist/editor/lib/document/part-panel-rows.d.ts +1 -0
  45. package/dist/editor/lib/document/part-panel-rows.js +1 -1
  46. package/dist/editor/lib/document/separator-field.d.ts +9 -1
  47. package/dist/editor/lib/document/separator-field.js +1 -1
  48. package/dist/editor/lib/document/shape-picker.d.ts +37 -0
  49. package/dist/editor/lib/document/shape-picker.js +1 -0
  50. package/dist/editor/lib/document/show-for-field.d.ts +6 -0
  51. package/dist/editor/lib/document/show-for-field.js +1 -0
  52. package/dist/format/lib/animation/hover.d.ts +0 -2
  53. package/dist/format/lib/animation/hover.js +1 -1
  54. package/dist/format/lib/content/box-layout.d.ts +21 -6
  55. package/dist/format/lib/content/box-layout.js +1 -1
  56. package/dist/format/lib/content/box-shape.d.ts +1 -5
  57. package/dist/format/lib/content/box-shape.js +1 -1
  58. package/dist/format/lib/content/box-show-for-choices.d.ts +9 -0
  59. package/dist/format/lib/content/box-show-for-choices.js +1 -0
  60. package/dist/format/lib/content/card-template.js +1 -1
  61. package/dist/format/lib/content/gallery-card-layout.d.ts +45 -1
  62. package/dist/format/lib/content/gallery-card-layout.js +1 -1
  63. package/dist/format/lib/content/image-aspect.d.ts +47 -0
  64. package/dist/format/lib/content/image-aspect.js +1 -0
  65. package/dist/format/lib/content/list-number.d.ts +11 -0
  66. package/dist/format/lib/content/list-number.js +1 -1
  67. package/dist/format/lib/content/phone-focus.d.ts +4 -1
  68. package/dist/format/lib/content/phone-focus.js +1 -1
  69. package/dist/format/lib/content/record-row.d.ts +14 -0
  70. package/dist/format/lib/content/record-row.js +1 -0
  71. package/dist/format/lib/content/record-types.d.ts +1 -1
  72. package/dist/format/lib/content/record-types.js +1 -1
  73. package/dist/format/lib/content/section-height.d.ts +8 -0
  74. package/dist/format/lib/content/section-height.js +1 -1
  75. package/dist/format/lib/document/blocks/general/text-part-shapes.json +2 -2
  76. package/dist/format/lib/document/media-manifest.json +5 -2
  77. package/dist/format/lib/document/mockup-variant-fields.d.ts +1 -0
  78. package/dist/format/lib/document/mockup-variant-fields.js +1 -1
  79. package/dist/format/lib/document/section-catalog.js +2 -2
  80. package/dist/format/lib/document/section-descriptions.js +1 -1
  81. package/dist/format/lib/editor-words-catalogue.d.ts +25 -11
  82. package/dist/format/lib/editor-words-catalogue.js +4 -4
  83. package/dist/format/lib/fonts.js +1 -1
  84. package/dist/format/lib/sections/divider-style.d.ts +4 -0
  85. package/dist/format/lib/sections/divider-style.js +1 -1
  86. package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
  87. package/dist/format/lib/sections/section-presets.js +1 -1
  88. package/dist/format/lib/source-rules/editor-words.js +2 -2
  89. package/dist/format/lib/source-rules/mirrored-rows-agree.js +4 -4
  90. package/dist/format/lib/source-rules/shape-rows-use-the-picker.d.ts +7 -0
  91. package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -0
  92. package/dist/format/lib/text-styles/site-text-colours.d.ts +2 -9
  93. package/dist/format/lib/text-styles/site-text-colours.js +1 -1
  94. package/dist/render/components/Breadcrumb.d.ts +2 -1
  95. package/dist/render/components/Breadcrumb.js +1 -1
  96. package/dist/render/components/CardRowContext.d.ts +1 -1
  97. package/dist/render/components/CardRowContext.js +1 -1
  98. package/dist/render/components/ContentsList.d.ts +4 -1
  99. package/dist/render/components/ContentsList.js +1 -1
  100. package/dist/render/components/CurrentRecord.d.ts +23 -0
  101. package/dist/render/components/CurrentRecord.js +1 -0
  102. package/dist/render/components/Flex.d.ts +1 -1
  103. package/dist/render/components/Flex.js +1 -1
  104. package/dist/render/components/HeroPictures.d.ts +2 -0
  105. package/dist/render/components/HeroPictures.js +1 -1
  106. package/dist/render/components/HeroPoster.d.ts +2 -1
  107. package/dist/render/components/HeroPoster.js +1 -1
  108. package/dist/render/components/HeroSection.d.ts +2 -1
  109. package/dist/render/components/HeroSection.js +1 -1
  110. package/dist/render/components/HeroSingle.d.ts +3 -1
  111. package/dist/render/components/HeroSingle.js +1 -1
  112. package/dist/render/components/HeroSlide.d.ts +3 -1
  113. package/dist/render/components/HeroSlide.js +1 -1
  114. package/dist/render/components/ImageBlock.d.ts +5 -3
  115. package/dist/render/components/ImageBlock.js +1 -1
  116. package/dist/render/components/InBoxContext.d.ts +3 -0
  117. package/dist/render/components/SiteGutterFrame.d.ts +1 -0
  118. package/dist/render/components/SiteGutterFrame.js +1 -1
  119. package/dist/render/lib/content/block-size.d.ts +2 -0
  120. package/dist/render/lib/content/block-size.js +1 -1
  121. package/dist/render/lib/content/box-show-for.d.ts +14 -0
  122. package/dist/render/lib/content/box-show-for.js +1 -0
  123. package/dist/render/lib/content/page-contents.d.ts +1 -0
  124. package/dist/render/lib/content/page-contents.js +1 -1
  125. package/dist/render/lib/content/picture-focus-rows.d.ts +13 -0
  126. package/dist/render/lib/content/picture-focus-rows.js +1 -0
  127. package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
  128. package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
  129. package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
  130. package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
  131. package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
  132. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  133. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +1 -1
  134. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  135. package/dist/render/lib/document/part-styles.d.ts +21 -7
  136. package/dist/render/lib/document/part-styles.js +2 -2
  137. package/dist/render/lib/document/passes/block-size.js +1 -1
  138. package/dist/render/lib/document/passes/index.js +1 -1
  139. package/dist/render/lib/document/passes/show-for.d.ts +2 -0
  140. package/dist/render/lib/document/passes/show-for.js +1 -0
  141. package/dist/render/lib/document/show-when.js +1 -1
  142. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  143. package/package.json +3 -3
@@ -1 +1 @@
1
- const c=[{key:"space-grotesk",label:"Space Grotesk",cssVar:"--font-display",category:"sans",italic:!1,italicLoaded:!1},{key:"inter",label:"Inter",cssVar:"--font-body",category:"sans",italic:!0,italicLoaded:!0},{key:"poppins",label:"Poppins",cssVar:"--font-poppins",category:"sans",italic:!0,italicLoaded:!0},{key:"dm-sans",label:"DM Sans",cssVar:"--font-dm-sans",category:"sans",italic:!0,italicLoaded:!0},{key:"sora",label:"Sora",cssVar:"--font-sora",category:"sans",italic:!1,italicLoaded:!1},{key:"oswald",label:"Oswald",cssVar:"--font-oswald",category:"sans",italic:!1,italicLoaded:!1},{key:"archivo",label:"Archivo",cssVar:"--font-archivo",category:"sans",italic:!0,italicLoaded:!0},{key:"outfit",label:"Outfit",cssVar:"--font-outfit",category:"sans",italic:!1,italicLoaded:!1},{key:"manrope",label:"Manrope",cssVar:"--font-manrope",category:"sans",italic:!1,italicLoaded:!1},{key:"big-shoulders",label:"Big Shoulders",cssVar:"--font-big-shoulders",category:"sans",italic:!1,italicLoaded:!1},{key:"michroma",label:"Michroma",cssVar:"--font-michroma",category:"sans",italic:!1,italicLoaded:!1},{key:"assistant",label:"Assistant",cssVar:"--font-assistant",category:"sans",italic:!1,italicLoaded:!1},{key:"fraunces",label:"Fraunces",cssVar:"--font-serif",category:"serif",italic:!0,italicLoaded:!0},{key:"playfair-display",label:"Playfair Display",cssVar:"--font-playfair",category:"serif",italic:!0,italicLoaded:!0},{key:"cormorant",label:"Cormorant",cssVar:"--font-cormorant",category:"serif",italic:!0,italicLoaded:!0},{key:"jetbrains-mono",label:"JetBrains Mono",cssVar:"--font-mono-loaded",category:"mono",italic:!0,italicLoaded:!0}],n=new Map(c.map(e=>[e.key,e])),g={sans:"Sans",serif:"Serif",mono:"Mono"};function m(){return Object.keys(g).map(e=>[e,c.filter(t=>t.category===e)]).filter(([,e])=>e.length>0)}function O(e){return n.get(e)?.italic??!1}function S(e){return n.get(e)?.italicLoaded??!1}function _(e){return n.get(e)}const s=["heading","heading2","heading3","body","accent","label"];function x(e){return typeof e=="string"&&s.includes(e)?e:null}const k={heading:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",body:"Body",accent:"Accent",label:"Labels"},u=[["font-heading2","heading2"],["font-heading3","heading3"],["font-display","heading"],["font-serif","accent"],["font-mono","label"],["font-body","body"]],y=/var\(--size-(headingLarge|headingMedium|headingSmall|accent|body|label)\s*,/,V={heading:"headingLarge",heading2:"headingMedium",heading3:"headingSmall",accent:"accent",body:"body",label:"label"},p={headingLarge:"heading",headingMedium:"heading2",headingSmall:"heading3",accent:"accent",body:"body",label:"label"};function E(e){const t=e?y.exec(e):null;return t?p[t[1]]??null:h(e)}function h(e){if(!e)return null;const t=e.split(/\s+/).filter(a=>!a.slice(0,a.lastIndexOf(":")+1).includes("&")).map(a=>a.slice(a.lastIndexOf(":")+1));for(const[a,i]of u)if(t.includes(a))return i;return null}const I=["heading","heading2","heading3"],b=["font-display","font-heading2","font-heading3"];function T(e){if(!e)return!1;const t=e.split(/\s+/).filter(a=>!a.slice(0,a.lastIndexOf(":")+1).includes("&")).map(a=>a.slice(a.lastIndexOf(":")+1));return b.some(a=>t.includes(a))}const r={heading:"space-grotesk",heading2:"space-grotesk",heading3:"space-grotesk",body:"inter",accent:"fraunces",label:"jetbrains-mono"};function d(e){const t=a=>{const i=e?.[a];if(i&&n.has(i))return i;if(a==="heading2"||a==="heading3"){const l=e?.heading;return l&&n.has(l)?l:r.heading}return r[a]};return Object.fromEntries(s.map(a=>[a,t(a)]))}function f(e,t){return n.get(e[t])??n.get(r[t])}function o(e,t){return`var(${f(e,t).cssVar})`}function F(e){const t=d(e);return[...new Set([...L,...s.map(a=>f(t,a).cssVar)])]}const L=[...new Set(s.map(e=>n.get(r[e]).cssVar))],A=[...new Set(c.map(e=>e.cssVar))];function R(e){const t=d(e);return{"--font-role-heading":o(t,"heading"),"--font-role-heading2":o(t,"heading2"),"--font-role-heading3":o(t,"heading3"),"--font-role-body":o(t,"body"),"--font-role-accent":o(t,"accent"),"--font-role-label":o(t,"label"),fontFamily:"var(--font-role-body)"}}export{A as ALL_FONT_CSS_VARS,r as DEFAULT_FONTS,g as FONT_CATEGORY_LABELS,c as FONT_OPTIONS,s as FONT_ROLES,k as FONT_ROLE_LABELS,b as HEADING_FACE_UTILITIES,I as HEADING_FONT_ROLES,L as ROOT_FALLBACK_CSS_VARS,V as SIZE_STEP_OF_ROLE,T as drawsHeadingFace,O as fontHasItalic,S as fontItalicIsUsable,_ as fontOption,x as fontRoleOf,h as fontRoleOfClassName,R as fontRoleStyle,m as fontsByCategory,d as normalizeFonts,F as siteFontCssVars,E as styleRoleOfClassName};
1
+ const c=[{key:"space-grotesk",label:"Space Grotesk",cssVar:"--font-display",category:"sans",italic:!1,italicLoaded:!1},{key:"inter",label:"Inter",cssVar:"--font-body",category:"sans",italic:!0,italicLoaded:!0},{key:"poppins",label:"Poppins",cssVar:"--font-poppins",category:"sans",italic:!0,italicLoaded:!0},{key:"dm-sans",label:"DM Sans",cssVar:"--font-dm-sans",category:"sans",italic:!0,italicLoaded:!0},{key:"sora",label:"Sora",cssVar:"--font-sora",category:"sans",italic:!1,italicLoaded:!1},{key:"oswald",label:"Oswald",cssVar:"--font-oswald",category:"sans",italic:!1,italicLoaded:!1},{key:"archivo",label:"Archivo",cssVar:"--font-archivo",category:"sans",italic:!0,italicLoaded:!0},{key:"outfit",label:"Outfit",cssVar:"--font-outfit",category:"sans",italic:!1,italicLoaded:!1},{key:"manrope",label:"Manrope",cssVar:"--font-manrope",category:"sans",italic:!1,italicLoaded:!1},{key:"big-shoulders",label:"Big Shoulders",cssVar:"--font-big-shoulders",category:"sans",italic:!1,italicLoaded:!1},{key:"michroma",label:"Michroma",cssVar:"--font-michroma",category:"sans",italic:!1,italicLoaded:!1},{key:"assistant",label:"Assistant",cssVar:"--font-assistant",category:"sans",italic:!1,italicLoaded:!1},{key:"fraunces",label:"Fraunces",cssVar:"--font-serif",category:"serif",italic:!0,italicLoaded:!0},{key:"playfair-display",label:"Playfair Display",cssVar:"--font-playfair",category:"serif",italic:!0,italicLoaded:!0},{key:"cormorant",label:"Cormorant",cssVar:"--font-cormorant",category:"serif",italic:!0,italicLoaded:!0},{key:"jetbrains-mono",label:"JetBrains Mono",cssVar:"--font-mono-loaded",category:"mono",italic:!0,italicLoaded:!0}],n=new Map(c.map(e=>[e.key,e])),g={sans:"Sans",serif:"Serif",mono:"Mono"};function m(){return Object.keys(g).map(e=>[e,c.filter(t=>t.category===e)]).filter(([,e])=>e.length>0)}function O(e){return n.get(e)?.italic??!1}function S(e){return n.get(e)?.italicLoaded??!1}function _(e){return n.get(e)}const s=["heading","heading2","heading3","body","accent","label"];function x(e){return typeof e=="string"&&s.includes(e)?e:null}const k={heading:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",body:"Body",accent:"Emphasis",label:"Labels"},u=[["font-heading2","heading2"],["font-heading3","heading3"],["font-display","heading"],["font-serif","accent"],["font-mono","label"],["font-body","body"]],y=/var\(--size-(headingLarge|headingMedium|headingSmall|accent|body|label)\s*,/,V={heading:"headingLarge",heading2:"headingMedium",heading3:"headingSmall",accent:"accent",body:"body",label:"label"},p={headingLarge:"heading",headingMedium:"heading2",headingSmall:"heading3",accent:"accent",body:"body",label:"label"};function E(e){const t=e?y.exec(e):null;return t?p[t[1]]??null:h(e)}function h(e){if(!e)return null;const t=e.split(/\s+/).filter(a=>!a.slice(0,a.lastIndexOf(":")+1).includes("&")).map(a=>a.slice(a.lastIndexOf(":")+1));for(const[a,i]of u)if(t.includes(a))return i;return null}const I=["heading","heading2","heading3"],b=["font-display","font-heading2","font-heading3"];function T(e){if(!e)return!1;const t=e.split(/\s+/).filter(a=>!a.slice(0,a.lastIndexOf(":")+1).includes("&")).map(a=>a.slice(a.lastIndexOf(":")+1));return b.some(a=>t.includes(a))}const r={heading:"space-grotesk",heading2:"space-grotesk",heading3:"space-grotesk",body:"inter",accent:"fraunces",label:"jetbrains-mono"};function d(e){const t=a=>{const i=e?.[a];if(i&&n.has(i))return i;if(a==="heading2"||a==="heading3"){const l=e?.heading;return l&&n.has(l)?l:r.heading}return r[a]};return Object.fromEntries(s.map(a=>[a,t(a)]))}function f(e,t){return n.get(e[t])??n.get(r[t])}function o(e,t){return`var(${f(e,t).cssVar})`}function F(e){const t=d(e);return[...new Set([...L,...s.map(a=>f(t,a).cssVar)])]}const L=[...new Set(s.map(e=>n.get(r[e]).cssVar))],A=[...new Set(c.map(e=>e.cssVar))];function R(e){const t=d(e);return{"--font-role-heading":o(t,"heading"),"--font-role-heading2":o(t,"heading2"),"--font-role-heading3":o(t,"heading3"),"--font-role-body":o(t,"body"),"--font-role-accent":o(t,"accent"),"--font-role-label":o(t,"label"),fontFamily:"var(--font-role-body)"}}export{A as ALL_FONT_CSS_VARS,r as DEFAULT_FONTS,g as FONT_CATEGORY_LABELS,c as FONT_OPTIONS,s as FONT_ROLES,k as FONT_ROLE_LABELS,b as HEADING_FACE_UTILITIES,I as HEADING_FONT_ROLES,L as ROOT_FALLBACK_CSS_VARS,V as SIZE_STEP_OF_ROLE,T as drawsHeadingFace,O as fontHasItalic,S as fontItalicIsUsable,_ as fontOption,x as fontRoleOf,h as fontRoleOfClassName,R as fontRoleStyle,m as fontsByCategory,d as normalizeFonts,F as siteFontCssVars,E as styleRoleOfClassName};
@@ -4,6 +4,10 @@ export declare const DIVIDER_STYLE_OPTIONS: readonly {
4
4
  label: string;
5
5
  value: DividerStyle;
6
6
  }[];
7
+ export declare const STRIPE_GEOMETRY: Record<Exclude<DividerStyle, "none" | "line">, {
8
+ ink: number;
9
+ period: number;
10
+ }>;
7
11
  export declare const STRIPE_BAND_HEIGHT_PX = 28;
8
12
  export declare const STRIPE_ANGLE = "-45deg";
9
13
  export declare const STRIPE_INK = "color-mix(in oklab, var(--accent) 50%, var(--bg))";
@@ -1 +1 @@
1
- import{parseOption as n}from"../parse-option.js";const i="line",o=[{label:"None",value:"none"},{label:"Line",value:"line"},{label:"Stripes · fine",value:"stripes-fine"},{label:"Stripes · medium",value:"stripes-medium"},{label:"Stripes · bold",value:"stripes-bold"}],p={"stripes-fine":{ink:4,period:12},"stripes-medium":{ink:8,period:18},"stripes-bold":{ink:14,period:28}},E=28,s="-45deg",l="color-mix(in oklab, var(--accent) 50%, var(--bg))";function a(e){return e!=="line"&&e!=="none"}const c={sm:24,md:48,lg:80},u="md",I=Object.keys(c);function S(e){return n(I,u,e)}function x(e){return n(o,i,e)}function D(e){if(!a(e))return null;const{ink:r,period:t}=p[e];return`repeating-linear-gradient(${s}, ${l} 0 ${r}px, transparent ${r}px ${t}px)`}export{u as DEFAULT_DIVIDER_SPACING,i as DEFAULT_DIVIDER_STYLE,c as DIVIDER_SPACE_PX,o as DIVIDER_STYLE_OPTIONS,s as STRIPE_ANGLE,E as STRIPE_BAND_HEIGHT_PX,l as STRIPE_INK,a as isStriped,S as parseDividerSpacing,x as parseDividerStyle,D as stripeBackground};
1
+ import{parseOption as n}from"../parse-option.js";const i="line",o=[{label:"None",value:"none"},{label:"Line",value:"line"},{label:"Stripes · fine",value:"stripes-fine"},{label:"Stripes · medium",value:"stripes-medium"},{label:"Stripes · bold",value:"stripes-bold"}],p={"stripes-fine":{ink:4,period:12},"stripes-medium":{ink:8,period:18},"stripes-bold":{ink:14,period:28}},E=28,s="-45deg",l="color-mix(in oklab, var(--accent) 50%, var(--bg))";function a(e){return e!=="line"&&e!=="none"}const c={sm:24,md:48,lg:80},u="md",I=Object.keys(c);function S(e){return n(I,u,e)}function x(e){return n(o,i,e)}function D(e){if(!a(e))return null;const{ink:r,period:t}=p[e];return`repeating-linear-gradient(${s}, ${l} 0 ${r}px, transparent ${r}px ${t}px)`}export{u as DEFAULT_DIVIDER_SPACING,i as DEFAULT_DIVIDER_STYLE,c as DIVIDER_SPACE_PX,o as DIVIDER_STYLE_OPTIONS,s as STRIPE_ANGLE,E as STRIPE_BAND_HEIGHT_PX,p as STRIPE_GEOMETRY,l as STRIPE_INK,a as isStriped,S as parseDividerSpacing,x as parseDividerStyle,D as stripeBackground};
@@ -1 +1 @@
1
- import{DEFAULT_TINT as y}from"../content/tint.js";import{finiteNumber as m}from"../finite-number.js";import{nonEmptyString as s}from"../non-empty-string.js";import{DEFAULT_OVERLAY_POSITION as u}from"./hero-overlay.js";import{normaliseVideoSource as v}from"../hero-video.js";const S=50,c=["mediaImage","mediaVideo","poster","imageFocal","imageFocalPhone","tintColor","mediaLayout","mediaLayoutPhone","mediaImage2","imageFocal2","imageFocal2Phone","tintColor2","tintOpacity2","videoSource","youtubeUrl","videoPlayback","_partMotion"],T=["heightDesktop","heightMobile","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone","sectionAccent","stickTop","stickTopDistance","stickTopTablet","stickTopDistanceTablet","stickTopPhone","stickTopDistancePhone","anchor","entrance","entrancePhone","entranceFrom","entranceFromPhone","entranceDuration","entranceDurationPhone","entranceDelay","entranceDelayPhone","sectionAnimation","_hidden"],f=new Set(T),b="the Hero does not read this key as a section setting (only the section pass rows both heroes share carry), so it is not copied",l={eyebrow:"the single Hero stopped drawing its own copy on 2026-09-09 (owner: delete the old text); the words are blocks in its boxes, which the slide keeps",titleTop:"the single Hero stopped drawing its own copy on 2026-09-09 (owner: delete the old text); the words are blocks in its boxes, which the slide keeps",titleLevel:"it set the level of the copy the single Hero stopped drawing on 2026-09-09; a Text block in a box sets its own level",alignment:"its row was deleted on 2026-09-09 with the copy it placed; a box places itself on nine anchors, and the value was drawn by nothing"};function x(p){const e=p.props,a=s(e.id)??"HeroSingle",i=[],r=[],t={id:`${a}~slide`},n={id:`${a}~hero`};t.mediaType=e.mediaType==="video"?"video":"image","mediaType"in e&&i.push({key:"mediaType",home:"HeroSlide.mediaType"}),t.mediaType==="video"&&v(e.videoSource)==="upload"&&(t.videoSpeed=S);for(const o of c)o in e&&(t[o]=e[o],i.push({key:o,home:`HeroSlide.${o}`}));"tintOpacity"in e&&(t.overlay=e.tintOpacity,i.push({key:"tintOpacity",home:"HeroSlide.overlay (Image tint)"})),t.overlayColor=s(e.overlayColor)??y,t.overlayPosition=s(e.overlayPosition)??u,"overlayColor"in e&&i.push({key:"overlayColor",home:"HeroSlide.overlayColor"}),"overlayPosition"in e&&i.push({key:"overlayPosition",home:"HeroSlide.overlayPosition"}),Array.isArray(e.boxes)?(t.groups=e.boxes,i.push({key:"boxes",home:"HeroSlide.groups (the same HeroGroup boxes)"})):"boxes"in e&&i.push({key:"boxes",home:"HeroSlide.groups (none stored)"}),n.textureOpacity=m(e.overlay)??100,"overlay"in e&&i.push({key:"overlay",home:"Hero.textureOpacity (the ramp's opacity)"}),n.showTicker=!1;const d=new Set(["id","mediaType","tintOpacity","overlay","overlayColor","overlayPosition","boxes",...c]);for(const[o,h]of Object.entries(e))if(!d.has(o)){if(o in l){r.push({key:o,why:l[o]});continue}if(!f.has(o)){r.push({key:o,why:b});continue}n[o]=h,i.push({key:o,home:`Hero.${o} (section pass)`})}return n.slides=[{type:"HeroSlide",props:t}],{node:{type:"Hero",props:n},carried:i,dropped:r}}export{T as HERO_SECTION_PASS_KEYS,x as heroSingleToHero};
1
+ import{DEFAULT_TINT as y}from"../content/tint.js";import{finiteNumber as m}from"../finite-number.js";import{nonEmptyString as s}from"../non-empty-string.js";import{DEFAULT_OVERLAY_POSITION as u}from"./hero-overlay.js";import{normaliseVideoSource as v}from"../hero-video.js";const T=50,l=["mediaImage","mediaVideo","poster","imageFocal","imageFocalTablet","imageFocalPhone","tintColor","mediaLayout","mediaLayoutPhone","mediaImage2","imageFocal2","imageFocal2Tablet","imageFocal2Phone","tintColor2","tintOpacity2","videoSource","youtubeUrl","videoPlayback","_partMotion"],S=["heightDesktop","heightMobile","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone","sectionAccent","stickTop","stickTopDistance","stickTopTablet","stickTopDistanceTablet","stickTopPhone","stickTopDistancePhone","anchor","entrance","entrancePhone","entranceFrom","entranceFromPhone","entranceDuration","entranceDurationPhone","entranceDelay","entranceDelayPhone","sectionAnimation","_hidden"],b=new Set(S),g="the Hero does not read this key as a section setting (only the section pass rows both heroes share carry), so it is not copied",c={eyebrow:"the single Hero stopped drawing its own copy on 2026-09-09 (owner: delete the old text); the words are blocks in its boxes, which the slide keeps",titleTop:"the single Hero stopped drawing its own copy on 2026-09-09 (owner: delete the old text); the words are blocks in its boxes, which the slide keeps",titleLevel:"it set the level of the copy the single Hero stopped drawing on 2026-09-09; a Text block in a box sets its own level",alignment:"its row was deleted on 2026-09-09 with the copy it placed; a box places itself on nine anchors, and the value was drawn by nothing"};function x(p){const e=p.props,a=s(e.id)??"HeroSingle",i=[],r=[],t={id:`${a}~slide`},n={id:`${a}~hero`};t.mediaType=e.mediaType==="video"?"video":"image","mediaType"in e&&i.push({key:"mediaType",home:"HeroSlide.mediaType"}),t.mediaType==="video"&&v(e.videoSource)==="upload"&&(t.videoSpeed=T);for(const o of l)o in e&&(t[o]=e[o],i.push({key:o,home:`HeroSlide.${o}`}));"tintOpacity"in e&&(t.overlay=e.tintOpacity,i.push({key:"tintOpacity",home:"HeroSlide.overlay (Image tint)"})),t.overlayColor=s(e.overlayColor)??y,t.overlayPosition=s(e.overlayPosition)??u,"overlayColor"in e&&i.push({key:"overlayColor",home:"HeroSlide.overlayColor"}),"overlayPosition"in e&&i.push({key:"overlayPosition",home:"HeroSlide.overlayPosition"}),Array.isArray(e.boxes)?(t.groups=e.boxes,i.push({key:"boxes",home:"HeroSlide.groups (the same HeroGroup boxes)"})):"boxes"in e&&i.push({key:"boxes",home:"HeroSlide.groups (none stored)"}),n.textureOpacity=m(e.overlay)??100,"overlay"in e&&i.push({key:"overlay",home:"Hero.textureOpacity (the ramp's opacity)"}),n.showTicker=!1;const d=new Set(["id","mediaType","tintOpacity","overlay","overlayColor","overlayPosition","boxes",...l]);for(const[o,h]of Object.entries(e))if(!d.has(o)){if(o in c){r.push({key:o,why:c[o]});continue}if(!b.has(o)){r.push({key:o,why:g});continue}n[o]=h,i.push({key:o,home:`Hero.${o} (section pass)`})}return n.slides=[{type:"HeroSlide",props:t}],{node:{type:"Hero",props:n},carried:i,dropped:r}}export{S as HERO_SECTION_PASS_KEYS,x as heroSingleToHero};
@@ -1 +1 @@
1
- import{BOX_TYPE as i}from"../document/container-blocks.js";import{headingTextSeed as c,labelTextSeed as p}from"../document/text-seeds.js";import{TICKER_SCAFFOLD_ITEMS as P}from"../document/blocks/general/Ticker/meta.js";import{specStripScaffold as S}from"../document/blocks/general/SpecStrip/meta.js";import{TIMELINE_YEAR_BOX as B,TIMELINE_YEAR_HEAD as h}from"./timeline-year-shape.js";import{SPEC_PAD as s,SPEC_STRIP as E,SPEC_TEXT as _,STRIP_BOX as R,TICKER_PAD as b,TICKER_SMALL as y,TICKER_STRIP as C}from"./strip-shape.js";function e(t,n,o,m={}){return{type:t,props:{...n(t),id:o(t),...m}}}function a(t,n,o){return e(i,t,n,{...o,sectionPaddingTop:void 0,sectionPaddingBottom:void 0})}const k={Manifesto:(t,n)=>({type:i,props:{...t(i),id:n(i),direction:"row",share:"equal",sectionHeightMode:"screen",name:"Brand Text",content:[e(i,t,n,{direction:"column",justify:"center",blockSpacing:"gap",name:"Text",sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingLeft:40,sectionPaddingRight:40,content:[e("Text",t,n,p()),e("Text",t,n,c()),e("Text",t,n),e("Stats",t,n)]}),a(t,n,{direction:"column",name:"Picture",content:[]})]}}),Split:(t,n)=>({type:i,props:{...t(i),id:n(i),direction:"row",share:"equal",sectionHeightMode:"screen",sectionHeightValue:70,name:"Image & Text Split",content:[e(i,t,n,{direction:"column",justify:"center",blockSpacing:"gap",name:"Text",sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingLeft:60,sectionPaddingRight:60,content:[e("Text",t,n,p()),e("Text",t,n,c()),e("Text",t,n),e("ButtonBlock",t,n)]}),a(t,n,{direction:"column",name:"Image",content:[e("ImageBlock",t,n)]})]}}),Subscribe:(t,n)=>({type:i,props:{...t(i),id:n(i),direction:"column",name:"Subscribe",content:[e("Text",t,n,c()),e("Text",t,n),e("Form",t,n)]}}),Ticker:(t,n)=>x("Scrolling Bar",C,b,P.map(o=>({text:o.text,style:y,muted:!0})),t,n),SpecStrip:(t,n)=>x("Spec Strip",{...E,sectionBorder:{top:1}},s,S().map(o=>({text:o.text??"",style:_,muted:o.tone==="muted"})),t,n),TimelineTrack:(t,n)=>{const o=m=>e(i,t,n,{...B,name:"Year",sectionPaddingTop:0,sectionPaddingBottom:0,...m?{upcoming:!0}:{},content:[e(i,t,n,{...h,sectionPaddingTop:0,sectionPaddingBottom:0,content:[e("Text",t,n,p()),e("Text",t,n,c())]}),e("Text",t,n)]});return{type:i,props:{...t(i),id:n(i),direction:"column",gap:48,name:"Milestone Timeline",content:[e(i,t,n,{direction:"row",align:"end",justify:"between",share:"content",name:"Heading",content:[e("Text",t,n,p()),e("Text",t,n,c()),e("Text",t,n)]}),e(i,t,n,{direction:"row",share:"equal",gap:0,line:!0,name:"Years",content:[o(!1),o(!1),o(!0)]}),e("ButtonBlock",t,n)]}}},Timeline:(t,n)=>{const o=()=>e(i,t,n,{direction:"row",share:"biggerRight",gap:24,name:"Chapter",content:[e("Text",t,n,p()),e(i,t,n,{direction:"column",gap:12,name:"Words",content:[e("Text",t,n,c()),e("Text",t,n)]})]});return{type:i,props:{...t(i),id:n(i),direction:"row",share:"bigRight",gap:48,name:"Story Timeline",content:[e(i,t,n,{direction:"column",gap:24,name:"Heading",content:[e("Text",t,n,p()),e("Text",t,n,c()),e("Text",t,n),e("ImageBlock",t,n),e("ButtonBlock",t,n)]}),e(i,t,n,{direction:"column",gap:48,line:!1,name:"Chapters",content:[o(),o(),o()]})]}}}};function x(t,n,o,m,T,g){return e(i,T,g,{...R,...n,blockSpacing:"gap",padV2:!0,name:t,sectionPaddingTop:o.top,sectionPaddingBottom:o.bottom,sectionPaddingTopPhone:o.topPhone,sectionPaddingBottomPhone:o.bottomPhone,content:m.map(r=>e("Text",T,g,{text:r.text,...r.muted?{tone:"dim"}:{},_partStyles:{text:r.style}}))})}function Y(t){return k[t]??null}export{k as SECTION_PRESETS,Y as presetFor};
1
+ import{BOX_TYPE as i}from"../document/container-blocks.js";import{headingTextSeed as c,labelTextSeed as p}from"../document/text-seeds.js";import{TICKER_SCAFFOLD_ITEMS as P}from"../document/blocks/general/Ticker/meta.js";import{specStripScaffold as S}from"../document/blocks/general/SpecStrip/meta.js";import{TIMELINE_YEAR_BOX as B,TIMELINE_YEAR_HEAD as s}from"./timeline-year-shape.js";import{SPEC_PAD as E,SPEC_STRIP as h,SPEC_TEXT as _,STRIP_BOX as y,TICKER_PAD as R,TICKER_SMALL as b,TICKER_STRIP as C}from"./strip-shape.js";function e(t,n,o,m={}){return{type:t,props:{...n(t),id:o(t),...m}}}function a(t,n,o){return e(i,t,n,{...o,sectionPaddingTop:void 0,sectionPaddingBottom:void 0})}const k={Manifesto:(t,n)=>({type:i,props:{...t(i),id:n(i),direction:"row",share:"equal",sectionHeightMode:"screen",name:"Brand Text",content:[e(i,t,n,{direction:"column",justify:"center",blockSpacing:"gap",name:"Text",sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingLeft:40,sectionPaddingRight:40,content:[e("Text",t,n,p()),e("Text",t,n,c()),e("Text",t,n),e("Stats",t,n)]}),a(t,n,{direction:"column",name:"Picture",content:[]})]}}),Split:(t,n)=>({type:i,props:{...t(i),id:n(i),direction:"row",share:"equal",sectionHeightMode:"screen",sectionHeightValue:70,name:"Image & Text Split",content:[e(i,t,n,{direction:"column",justify:"center",blockSpacing:"gap",name:"Text",sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingLeft:60,sectionPaddingRight:60,content:[e("Text",t,n,p()),e("Text",t,n,c()),e("Text",t,n),e("ButtonBlock",t,n)]}),a(t,n,{direction:"column",name:"Image",content:[e("ImageBlock",t,n)]})]}}),Subscribe:(t,n)=>({type:i,props:{...t(i),id:n(i),direction:"column",name:"Subscribe",content:[e("Text",t,n,c()),e("Text",t,n),e("Form",t,n)]}}),Ticker:(t,n)=>x("Scrolling Bar",C,R,P.map(o=>({text:o.text,style:b,muted:!0})),t,n),SpecStrip:(t,n)=>x("Spec Strip",{...h,sectionBorder:{top:1}},E,S().map(o=>({text:o.text??"",style:_,muted:o.tone==="muted"})),t,n),TimelineTrack:(t,n)=>{const o=m=>e(i,t,n,{...B,name:"Year",sectionPaddingTop:0,sectionPaddingBottom:0,...m?{upcoming:!0}:{},content:[e(i,t,n,{...s,sectionPaddingTop:0,sectionPaddingBottom:0,content:[e("Text",t,n,p()),e("Text",t,n,c())]}),e("Text",t,n)]});return{type:i,props:{...t(i),id:n(i),direction:"column",gap:48,name:"Milestone Timeline",content:[e(i,t,n,{direction:"row",align:"end",justify:"between",share:"content",name:"Heading",content:[e("Text",t,n,p()),e("Text",t,n,c()),e("Text",t,n)]}),e(i,t,n,{direction:"row",share:"equal",gap:0,line:!0,name:"Years",content:[o(!1),o(!1),o(!0)]}),e("ButtonBlock",t,n)]}}},Timeline:(t,n)=>{const o=()=>e(i,t,n,{direction:"row",share:[25],gap:24,name:"Chapter",content:[e("Text",t,n,p()),e(i,t,n,{direction:"column",gap:12,name:"Words",content:[e("Text",t,n,c()),e("Text",t,n)]})]});return{type:i,props:{...t(i),id:n(i),direction:"row",share:[33],gap:48,name:"Story Timeline",content:[e(i,t,n,{direction:"column",gap:24,name:"Heading",content:[e("Text",t,n,p()),e("Text",t,n,c()),e("Text",t,n),e("ImageBlock",t,n),e("ButtonBlock",t,n)]}),e(i,t,n,{direction:"column",gap:48,line:!1,name:"Chapters",content:[o(),o(),o()]})]}}}};function x(t,n,o,m,T,g){return e(i,T,g,{...y,...n,blockSpacing:"gap",padV2:!0,name:t,sectionPaddingTop:o.top,sectionPaddingBottom:o.bottom,sectionPaddingTopPhone:o.topPhone,sectionPaddingBottomPhone:o.bottomPhone,content:m.map(r=>e("Text",T,g,{text:r.text,...r.muted?{tone:"dim"}:{},_partStyles:{text:r.style}}))})}function Y(t){return k[t]??null}export{k as SECTION_PRESETS,Y as presetFor};
@@ -1,3 +1,3 @@
1
- import{ruleChecks as A}from"./rule.js";const E={text:[0,1,2],textarea:[0,1,2],plainText:[0,1,2],copyText:[0,1,2],plainTextarea:[0,1,2],linkField:[0],textList:[0,2],upload:[0,2],toggle:[0,3],checkbox:[0],select:[0,4],searchSelect:[0,3],segmented:[0],iconPickerRow:[0],multiSelect:[0,2],slider:[0],colorInput:[0],focalPicker:[0],sizeField:[0],backgroundField:[0],cardImageBackgroundField:[0],placementField:[0],pxField:[0],dateTime:[0,2],edgePad:[0,3],blockSourceField:[0,1],phPrev:[1],phHide:[1],phHideDefault:[1],group:[0],section:[0],panelNote:[0]},b=new Set(["value","render","defaultProps","fields","type","arrayFields","icon"]),N=/(^|_)(PH|LABELS?|HINTS?|NOTES?|TITLES?|SWATCH_NAMES|GROUP|REASON|ROWS|PANELS|TABS|LINES)$/,O=new Set(["key","value","id","type","href","slug","kind","cell","set","icon","token","unit","path","url","src","className","variant","mode","side","align","role"]),$=new Set(["hint","coverHint","unsetLabel","emptyLabel","addLabel"]),_=new Set(["say","sayCount"]);function C(t){return/\p{L}/u.test(t)&&t.trim()===t&&t.length>0&&!/^[a-z0-9]+(?:-[a-z0-9]+)+$/.test(t)}const P=/(?:Key|Id|Slug|Href|Url|ClassName)$/;function L(t,p,s={}){const a=new Map,k=new Set(s.skip??[]),S=new Map((s.dataFiles??[]).map(e=>[e.path,e.keys])),u=(e,l)=>{if(!C(e))return;let d=a.get(e);d||a.set(e,d=new Set),d.add(l)},f=e=>e&&(t.isStringLiteral(e)||t.isNoSubstitutionTemplateLiteral(e))?e.text:null,o=e=>{if(!e)return[];const l=f(e);return l!==null?[l]:t.isParenthesizedExpression(e)?o(e.expression):t.isConditionalExpression(e)?[...o(e.whenTrue),...o(e.whenFalse)]:t.isBinaryExpression(e)&&(e.operatorToken.kind===t.SyntaxKind.QuestionQuestionToken||e.operatorToken.kind===t.SyntaxKind.BarBarToken)?[...o(e.left),...o(e.right)]:[]},y=e=>{const l=e.expression;return t.isIdentifier(l)?l.text:t.isPropertyAccessExpression(l)?l.name.text:null},g=e=>e.name&&(t.isIdentifier(e.name)||t.isStringLiteral(e.name))?e.name.text:null;for(const e of p){if(!/\.tsx?$/.test(e.path)||k.has(e.path))continue;const l=S.get(e.path),d=t.createSourceFile(e.path,e.text,t.ScriptTarget.Latest,!0,e.path.endsWith(".tsx")?t.ScriptKind.TSX:t.ScriptKind.TS),T=n=>{if(t.isCallExpression(n)){const r=y(n);if(r&&_.has(r))for(const c of n.arguments){const i=f(c);i!==null&&u(i,e.path)}else if(r&&t.isIdentifier(n.expression)&&Object.prototype.hasOwnProperty.call(E,r)){for(const c of E[r])for(const i of o(n.arguments[c]))u(i,e.path);if(r==="segmented"){const c=n.arguments[2];if(c&&t.isArrayLiteralExpression(c))for(const i of c.elements){const h=f(i);h!==null&&u(h,e.path)}}}}else if(t.isJsxAttribute(n)&&n.name.getText(d)==="label"&&n.initializer&&t.isStringLiteral(n.initializer)&&/^[A-Z]/.test(n.parent.parent.tagName.getText(d).split(".").pop()??""))u(n.initializer.text,e.path);else if(t.isObjectLiteralExpression(n)){const r=n.properties.filter(t.isPropertyAssignment),c=r.find(i=>g(i)==="label");if(c&&r.some(i=>b.has(g(i)??""))){const i=f(c.initializer);i!==null&&u(i,e.path)}for(const i of r){const h=g(i);if(h!==null&&$.has(h))for(const x of o(i.initializer))u(x,e.path)}if(l)for(const i of r){const h=g(i);if(h!==null&&(l==="*"||l.includes(h))){const x=f(i.initializer);x!==null&&u(x,e.path)}}}else if(t.isVariableDeclaration(n)&&t.isIdentifier(n.name)&&N.test(n.name.text)&&n.initializer&&!/CSSProperties|Style\b/.test(n.type?.getText(d)??"")){const r=f(n.initializer);r!==null&&!/^[a-z0-9_]+$/.test(r)&&u(r,e.path);const c=i=>{const h=t.isPropertyAssignment(i)?g(i)??"":"";if(t.isPropertyAssignment(i)&&!O.has(h)&&!P.test(h)){const x=f(i.initializer);x!==null&&u(x,e.path)}t.forEachChild(i,c)};c(n.initializer)}t.forEachChild(n,T)};T(d)}const m=new Map;for(const e of[...a.keys()].sort(w))s.known?.has(e)||m.set(e,[...a.get(e)].sort());return m}function w(t,p){return t<p?-1:t>p?1:0}function R(t,p){return["/**",...p.header.map(a=>a?` * ${a}`:" *")," */",`export const ${p.constant} = {`,...[...t].map(a=>` ${JSON.stringify(a)}: ${JSON.stringify(a)},`),"} as const;","",`/** Every phrase of {@link ${p.constant}}: what a host's words are keyed by. */`,`export type ${p.phraseType} = keyof typeof ${p.constant};`,""].join(`
1
+ import{ruleChecks as A}from"./rule.js";const E={text:[0,1,2],textarea:[0,1,2],plainText:[0,1,2],copyText:[0,1,2],plainTextarea:[0,1,2],linkField:[0],textList:[0,2],upload:[0,2],toggle:[0,3],checkbox:[0],select:[0,4],searchSelect:[0,3],segmented:[0],iconPickerRow:[0],shapePickerRow:[0],multiSelect:[0,2],slider:[0],colorInput:[0],focalPicker:[0],sizeField:[0],backgroundField:[0],cardImageBackgroundField:[0],placementField:[0],pxField:[0],dateTime:[0,2],edgePad:[0,3],blockSourceField:[0,1],phPrev:[1],phHide:[1],phHideDefault:[1],group:[0],section:[0],panelNote:[0]},b=new Set(["value","render","defaultProps","fields","type","arrayFields","icon","shape"]),N=/(^|_)(PH|LABELS?|HINTS?|NOTES?|TITLES?|SWATCH_NAMES|GROUP|REASON|ROWS|PANELS|TABS|LINES)$/,O=new Set(["key","value","id","type","href","slug","kind","cell","set","icon","token","unit","path","url","src","className","variant","mode","side","align","role"]),$=new Set(["hint","coverHint","unsetLabel","emptyLabel","addLabel"]),P=new Set(["say","sayCount"]);function _(t){return/\p{L}/u.test(t)&&t.trim()===t&&t.length>0&&!/^[a-z0-9]+(?:-[a-z0-9]+)+$/.test(t)}const C=/(?:Key|Id|Slug|Href|Url|ClassName)$/;function w(t,p,s={}){const a=new Map,k=new Set(s.skip??[]),S=new Map((s.dataFiles??[]).map(e=>[e.path,e.keys])),u=(e,l)=>{if(!_(e))return;let d=a.get(e);d||a.set(e,d=new Set),d.add(l)},f=e=>e&&(t.isStringLiteral(e)||t.isNoSubstitutionTemplateLiteral(e))?e.text:null,o=e=>{if(!e)return[];const l=f(e);return l!==null?[l]:t.isParenthesizedExpression(e)?o(e.expression):t.isConditionalExpression(e)?[...o(e.whenTrue),...o(e.whenFalse)]:t.isBinaryExpression(e)&&(e.operatorToken.kind===t.SyntaxKind.QuestionQuestionToken||e.operatorToken.kind===t.SyntaxKind.BarBarToken)?[...o(e.left),...o(e.right)]:[]},y=e=>{const l=e.expression;return t.isIdentifier(l)?l.text:t.isPropertyAccessExpression(l)?l.name.text:null},g=e=>e.name&&(t.isIdentifier(e.name)||t.isStringLiteral(e.name))?e.name.text:null;for(const e of p){if(!/\.tsx?$/.test(e.path)||k.has(e.path))continue;const l=S.get(e.path),d=t.createSourceFile(e.path,e.text,t.ScriptTarget.Latest,!0,e.path.endsWith(".tsx")?t.ScriptKind.TSX:t.ScriptKind.TS),T=n=>{if(t.isCallExpression(n)){const r=y(n);if(r&&P.has(r))for(const c of n.arguments){const i=f(c);i!==null&&u(i,e.path)}else if(r&&t.isIdentifier(n.expression)&&Object.prototype.hasOwnProperty.call(E,r)){for(const c of E[r])for(const i of o(n.arguments[c]))u(i,e.path);if(r==="segmented"){const c=n.arguments[2];if(c&&t.isArrayLiteralExpression(c))for(const i of c.elements){const h=f(i);h!==null&&u(h,e.path)}}}}else if(t.isJsxAttribute(n)&&n.name.getText(d)==="label"&&n.initializer&&t.isStringLiteral(n.initializer)&&/^[A-Z]/.test(n.parent.parent.tagName.getText(d).split(".").pop()??""))u(n.initializer.text,e.path);else if(t.isObjectLiteralExpression(n)){const r=n.properties.filter(t.isPropertyAssignment),c=r.find(i=>g(i)==="label");if(c&&r.some(i=>b.has(g(i)??""))){const i=f(c.initializer);i!==null&&u(i,e.path)}for(const i of r){const h=g(i);if(h!==null&&$.has(h))for(const x of o(i.initializer))u(x,e.path)}if(l)for(const i of r){const h=g(i);if(h!==null&&(l==="*"||l.includes(h))){const x=f(i.initializer);x!==null&&u(x,e.path)}}}else if(t.isVariableDeclaration(n)&&t.isIdentifier(n.name)&&N.test(n.name.text)&&n.initializer&&!/CSSProperties|Style\b/.test(n.type?.getText(d)??"")){const r=f(n.initializer);r!==null&&!/^[a-z0-9_]+$/.test(r)&&u(r,e.path);const c=i=>{const h=t.isPropertyAssignment(i)?g(i)??"":"";if(t.isPropertyAssignment(i)&&!O.has(h)&&!C.test(h)){const x=f(i.initializer);x!==null&&u(x,e.path)}t.forEachChild(i,c)};c(n.initializer)}t.forEachChild(n,T)};T(d)}const m=new Map;for(const e of[...a.keys()].sort(L))s.known?.has(e)||m.set(e,[...a.get(e)].sort());return m}function L(t,p){return t<p?-1:t>p?1:0}function R(t,p){return["/**",...p.header.map(a=>a?` * ${a}`:" *")," */",`export const ${p.constant} = {`,...[...t].map(a=>` ${JSON.stringify(a)}: ${JSON.stringify(a)},`),"} as const;","",`/** Every phrase of {@link ${p.constant}}: what a host's words are keyed by. */`,`export type ${p.phraseType} = keyof typeof ${p.constant};`,""].join(`
2
2
  `)}function I(t,p,s){const{check:a,report:k}=A("editor words");{const f=[{path:"fixture.tsx",text:['const a = say("Delete {name}", { name });','const b = sayCount("{n} page", "{n} pages", n);','const c = text("Heading", "Main heading", "A hint");','const d = select("Align", icon, [{ label: "Left", value: "left" }], "left", "A note");','const e = segmented("Size", icon, ["Small", "Large"], "Small");','const SERIES_PH = { headTitle: "Section heading", link: "#" };','export const CORNER_SIDES_LABEL = "Corner sides";','const VIEW_TIER_LABEL = { desktop: "Desktop" };',"const DEFAULT_LABEL_KEY = 12;",'const FOCUS_HINT: CSSProperties = { display: "flex" };','const LAYOUT_TABS = "tabs";','const TEMPLATE_GROUP = { group: "Template pages", groupKey: "template" };','const a4 = <MenuLink label="text-fg" />;','const THEME_COLOUR_ROWS = [{ key: "fg", label: "Text color" }, { group: "Borders" }];','const a1 = <GroupLabel label="Wording" />;','const a2 = <input label="raw" />;','const a3 = say("Already listed");','const f = toggle("Show", false, "not-a-word");','const i = pxField("Corners", { min: 0, unsetLabel: on ? "Square" : "Round", hint: opts?.hint ?? "Rounds it." });','const g = { label: "Content", href: "/" };',"const h = say(`${x} colour`);"].join(`
3
- `)},{path:"names.ts",text:'export const N = [{ key: "openers", title: "Hero & intros", sections: [{ type: "Hero", label: "Hero Slideshow" }] }];'},{path:"block.tsx",text:'export const B = { label: "Banner", fields: {}, defaultProps: { cta: { label: "Shop now", href: "/" } } };'}],o=[...L(t,f,{dataFiles:[{path:"names.ts",keys:["title"]}],known:new Set(["Already listed"])}).keys()],y=["A hint","A note","Align","Banner","Borders","Corner sides","Corners","Round","Rounds it.","Square","Template pages","Text color","Wording","Desktop","Delete {name}","Heading","Hero & intros","Hero Slideshow","Large","Left","Main heading","Section heading","Show","Size","Small","{n} page","{n} pages"].sort(w);a("the reader reads every shape on a fixture, and no value, link or built phrase",JSON.stringify(o)===JSON.stringify(y),`read ${JSON.stringify(o)}`)}const S=L(t,p,s);a(`the source says at least ${s.floor} phrases`,S.size>=s.floor,`read ${S.size}: the reader broke, or the editor stopped saying its words through it`);const u=R(S.keys(),s.shape);if(!s.catalogue)a("the catalogue exists",!1,`run ${s.write}`);else{const f=s.catalogue.text===u;let o;if(!f){const y=new Set([...s.catalogue.text.matchAll(/^ {2}("(?:[^"\\]|\\.)*"): /gm)].map(e=>JSON.parse(e[1]))),g=[...S.keys()].filter(e=>!y.has(e)),m=[...y].filter(e=>!S.has(e));o=`${s.catalogue.path} is not what the source says — run ${s.write}. Missing ${g.length}${g.length?` (${g.slice(0,5).map(e=>JSON.stringify(e)).join(", ")}…)`:""}; no longer said ${m.length}${m.length?` (${m.slice(0,5).map(e=>JSON.stringify(e)).join(", ")}…)`:""}.`}a(`${s.catalogue.path} lists exactly the ${S.size} phrases the source says`,f,o)}return k()}export{E as BUILDER_WORDS,L as editorPhrases,I as editorWordsCatalogue,R as editorWordsCatalogueText,C as isPhrase};
3
+ `)},{path:"names.ts",text:'export const N = [{ key: "openers", title: "Hero & intros", sections: [{ type: "Hero", label: "Hero Slideshow" }] }];'},{path:"block.tsx",text:'export const B = { label: "Banner", fields: {}, defaultProps: { cta: { label: "Shop now", href: "/" } } };'}],o=[...w(t,f,{dataFiles:[{path:"names.ts",keys:["title"]}],known:new Set(["Already listed"])}).keys()],y=["A hint","A note","Align","Banner","Borders","Corner sides","Corners","Round","Rounds it.","Square","Template pages","Text color","Wording","Desktop","Delete {name}","Heading","Hero & intros","Hero Slideshow","Large","Left","Main heading","Section heading","Show","Size","Small","{n} page","{n} pages"].sort(L);a("the reader reads every shape on a fixture, and no value, link or built phrase",JSON.stringify(o)===JSON.stringify(y),`read ${JSON.stringify(o)}`)}const S=w(t,p,s);a(`the source says at least ${s.floor} phrases`,S.size>=s.floor,`read ${S.size}: the reader broke, or the editor stopped saying its words through it`);const u=R(S.keys(),s.shape);if(!s.catalogue)a("the catalogue exists",!1,`run ${s.write}`);else{const f=s.catalogue.text===u;let o;if(!f){const y=new Set([...s.catalogue.text.matchAll(/^ {2}("(?:[^"\\]|\\.)*"): /gm)].map(e=>JSON.parse(e[1]))),g=[...S.keys()].filter(e=>!y.has(e)),m=[...y].filter(e=>!S.has(e));o=`${s.catalogue.path} is not what the source says — run ${s.write}. Missing ${g.length}${g.length?` (${g.slice(0,5).map(e=>JSON.stringify(e)).join(", ")}…)`:""}; no longer said ${m.length}${m.length?` (${m.slice(0,5).map(e=>JSON.stringify(e)).join(", ")}…)`:""}.`}a(`${s.catalogue.path} lists exactly the ${S.size} phrases the source says`,f,o)}return k()}export{E as BUILDER_WORDS,w as editorPhrases,I as editorWordsCatalogue,R as editorWordsCatalogueText,_ as isPhrase};
@@ -1,7 +1,7 @@
1
- import{ruleChecks as R}from"./rule.js";import{blockSource as E,registryFiles as k}from"./support/registry-source.js";import{isDocumentPath as S}from"./support/document-folder.js";const j="lib/document/controls.tsx",P=["slider","select","segmented","textList"];function x(c){return/icon=\{<([A-Z][A-Za-z0-9]*Icon)\s*\/>\}/.exec(c)?.[1]??/<([A-Z][A-Za-z0-9]*Icon)\s*\/>/.exec(c)?.[1]??/<FieldGlyph noun="([a-z]+)"/.exec(c)?.[1]??"none"}function y(c){const l=new Map;for(const s of c)s.text.split(`
2
- `).forEach((t,p)=>{const a=t.trim();if(!(a.startsWith("//")||a.startsWith("*")||a.startsWith("/*")))for(const h of P){if(new RegExp(`^(export )?function ${h}\\(`).test(a))continue;const d=t.match(new RegExp(`(^|[^.\\w])${h}\\(\\s*"([^"]+)"`));d&&l.set(d[2],[...l.get(d[2])??[],{file:s,line:p+1,builder:h}])}});return l}function I(c){const l=[];for(const s of c)s.text.split(`
3
- `).forEach((t,p)=>{const a=t.match(/<SettingsField\s+label=(?:\{say\()?"([^"]+)"/);a&&l.push({file:s.path,line:p+1,label:a[1].trim(),glyph:x(t)})});return l}function N(c,l,s){const{check:t,report:p}=R("mirrored rows agree"),a=s.mirrored??[],h=s.sameWord??[];{const e={path:"fixture.tsx",text:["export function select(label: string) {}",'const a = select("Product", <BoxIcon />, options);','// select("In a comment", <BoxIcon />)','const b = usePreviewParts().select("Not a row");','const c = <SettingsField label="Product" icon={<BoxIcon />}>{x}</SettingsField>;'].join(`
4
- `)},o=y([e]),n=I([e]);t("the builder-label reader finds a call, and not its declaration, a comment or another object's method",[...o.keys()].join()==="Product"&&o.get("Product")?.[0].line===2,JSON.stringify([...o.keys()])),t("the row reader finds a hand-drawn row and the glyph it wears",n.length===1&&n[0].label==="Product"&&n[0].glyph==="BoxIcon",JSON.stringify(n))}const d=l.find(e=>S(e.path,"controls.tsx"));for(const e of a){const o=d?new RegExp(`export const ${e.constant} = \\{[\\s\\S]*?\\} as const;`).exec(d.text):null;t(`${e.constant} is declared in ${j}`,o!==null),o&&(t("…and carries the label",/label:\s*"/.test(o[0]),o[0].slice(0,120)),t("…and carries the glyph",/icon:\s*</.test(o[0]),o[0].slice(0,120)));let n=null;try{n=E(c,l,e.declaredIn)}catch{n=null}t(`read the ${e.declaredIn} block`,n!==null,`no block "${e.declaredIn}" among the files handed in`);const r=l.find(i=>i.path===e.drawnIn)?.text??null;t(`read ${e.drawnIn}`,r!==null);for(const[i,$]of[[`the ${e.declaredIn} block`,n],[e.drawnIn,r]])$!==null&&(t(`${i} spreads ${e.constant}`,new RegExp(`${e.constant}\\.(label|icon)`).test($)),t(`…and no longer hard-codes "${e.row}"`,!new RegExp(`"${e.row}"`).test($),`${i} still contains the literal`))}t(`the mirrored pairs were checked (${a.length}, at least ${s.floors.pairs}; an empty sweep proves nothing)`,a.length>=s.floors.pairs);const f=y([...k(l),...d?[d]:[]]),m=l.filter(e=>/^components\/[^/]+\.tsx$/.test(e.path)),u=I(m),g=[],w=[];for(const e of u){if(!f.has(e.label))continue;if(h.includes(e.label)){w.push({at:`${e.file}:${e.line}`,label:e.label,glyph:e.glyph});continue}const o=(f.get(e.label)??[]).map(n=>`${n.builder} @ ${n.file.path}:${n.line}`).join(" · ");g.push(`${e.file}:${e.line} "${e.label}" — also ${o}`)}t(`the builder-label scan read something (${f.size} labels, at least ${s.floors.labels})`,f.size>=s.floors.labels),t(`the component scan read something (${u.length} hand-drawn rows in ${m.length} component files, at least ${s.floors.panelRows})`,u.length>=s.floors.panelRows),t("no NEW hard-coded mirror",g.length===0,`
1
+ import{ruleChecks as R}from"./rule.js";import{blockSource as k,registryFiles as E}from"./support/registry-source.js";import{isDocumentPath as P}from"./support/document-folder.js";const S="lib/document/controls.tsx",j=["slider","select","segmented","textList","iconPickerRow","shapePickerRow"];function x(a){return/icon=\{<([A-Z][A-Za-z0-9]*Icon)\s*\/>\}/.exec(a)?.[1]??/<([A-Z][A-Za-z0-9]*Icon)\s*\/>/.exec(a)?.[1]??/<FieldGlyph noun="([a-z]+)"/.exec(a)?.[1]??"none"}function y(a){const l=new Map;for(const s of a)s.text.split(`
2
+ `).forEach((t,p)=>{const c=t.trim();if(!(c.startsWith("//")||c.startsWith("*")||c.startsWith("/*")))for(const h of j){if(new RegExp(`^(export )?function ${h}\\(`).test(c))continue;const d=t.match(new RegExp(`(^|[^.\\w])${h}\\(\\s*"([^"]+)"`));d&&l.set(d[2],[...l.get(d[2])??[],{file:s,line:p+1,builder:h}])}});return l}function I(a){const l=[];for(const s of a)s.text.split(`
3
+ `).forEach((t,p)=>{const c=t.match(/<SettingsField\s+label=(?:\{say\()?"([^"]+)"/);c&&l.push({file:s.path,line:p+1,label:c[1].trim(),glyph:x(t)})});return l}function N(a,l,s){const{check:t,report:p}=R("mirrored rows agree"),c=s.mirrored??[],h=s.sameWord??[];{const e={path:"fixture.tsx",text:["export function select(label: string) {}",'const a = select("Product", <BoxIcon />, options);','// select("In a comment", <BoxIcon />)','const b = usePreviewParts().select("Not a row");','const c = <SettingsField label="Product" icon={<BoxIcon />}>{x}</SettingsField>;'].join(`
4
+ `)},o=y([e]),n=I([e]);t("the builder-label reader finds a call, and not its declaration, a comment or another object's method",[...o.keys()].join()==="Product"&&o.get("Product")?.[0].line===2,JSON.stringify([...o.keys()])),t("the row reader finds a hand-drawn row and the glyph it wears",n.length===1&&n[0].label==="Product"&&n[0].glyph==="BoxIcon",JSON.stringify(n))}const d=l.find(e=>P(e.path,"controls.tsx"));for(const e of c){const o=d?new RegExp(`export const ${e.constant} = \\{[\\s\\S]*?\\} as const;`).exec(d.text):null;t(`${e.constant} is declared in ${S}`,o!==null),o&&(t("…and carries the label",/label:\s*"/.test(o[0]),o[0].slice(0,120)),t("…and carries the glyph",/icon:\s*</.test(o[0]),o[0].slice(0,120)));let n=null;try{n=k(a,l,e.declaredIn)}catch{n=null}t(`read the ${e.declaredIn} block`,n!==null,`no block "${e.declaredIn}" among the files handed in`);const r=l.find(i=>i.path===e.drawnIn)?.text??null;t(`read ${e.drawnIn}`,r!==null);for(const[i,$]of[[`the ${e.declaredIn} block`,n],[e.drawnIn,r]])$!==null&&(t(`${i} spreads ${e.constant}`,new RegExp(`${e.constant}\\.(label|icon)`).test($)),t(`…and no longer hard-codes "${e.row}"`,!new RegExp(`"${e.row}"`).test($),`${i} still contains the literal`))}t(`the mirrored pairs were checked (${c.length}, at least ${s.floors.pairs}; an empty sweep proves nothing)`,c.length>=s.floors.pairs);const f=y([...E(l),...d?[d]:[]]),m=l.filter(e=>/^components\/[^/]+\.tsx$/.test(e.path)),u=I(m),g=[],w=[];for(const e of u){if(!f.has(e.label))continue;if(h.includes(e.label)){w.push({at:`${e.file}:${e.line}`,label:e.label,glyph:e.glyph});continue}const o=(f.get(e.label)??[]).map(n=>`${n.builder} @ ${n.file.path}:${n.line}`).join(" · ");g.push(`${e.file}:${e.line} "${e.label}" — also ${o}`)}t(`the builder-label scan read something (${f.size} labels, at least ${s.floors.labels})`,f.size>=s.floors.labels),t(`the component scan read something (${u.length} hand-drawn rows in ${m.length} component files, at least ${s.floors.panelRows})`,u.length>=s.floors.panelRows),t("no NEW hard-coded mirror",g.length===0,`
5
5
  ${g.join(`
6
6
  `)}`);const b=h.filter(e=>!f.has(e));t("no same-word entry has outlived its subject",b.length===0,b.join(" · "));for(const e of h){const o=new Set,n=[];for(const r of w.filter(i=>i.label===e))o.add(r.glyph),n.push(`${r.at} → ${r.glyph}`);for(const r of f.get(e)??[]){const i=x(r.file.text.split(`
7
7
  `).slice(r.line-1,r.line+6).join(`
@@ -0,0 +1,7 @@
1
+ import type * as TS from "typescript";
2
+ import { type RuleReport, type SourceFile } from "./rule.js";
3
+ export type ShapeRowsOptions = {
4
+ readonly selectRows: readonly string[];
5
+ readonly minFiles: number;
6
+ };
7
+ export declare function shapeRowsUseThePicker(ts: typeof TS, files: readonly SourceFile[], options: ShapeRowsOptions): RuleReport;
@@ -0,0 +1,2 @@
1
+ import{isRuleSource as b,ruleChecks as S}from"./rule.js";const k=new Set(["Select","SettingsSelect","FieldSelect"]);function u(s,n){const i=s.createSourceFile(n.path,n.text,s.ScriptTarget.Latest,!0,s.ScriptKind.TSX),r=[],p=[],c=e=>i.getLineAndCharacterOfPosition(e.getStart(i)).line+1,d=e=>{let t=e;for(;t&&(s.isAsExpression(t)||s.isSatisfiesExpression(t)||s.isParenthesizedExpression(t));)t=t.expression;return t},a=e=>e?s.isStringLiteralLike(e)?e.text:e.getText(i):"(no label)",x=e=>e.name&&(s.isIdentifier(e.name)||s.isStringLiteralLike(e.name))?e.name.text:void 0,f=(e,t)=>{for(const o of e.properties)if(x(o)===t){if(s.isPropertyAssignment(o))return o.initializer;if(s.isShorthandPropertyAssignment(o))return o.name}},h=e=>{const t=e.parent;return s.isCallExpression(t)&&s.isIdentifier(t.expression)&&t.expression.text==="describedAs"&&t.arguments[1]===e},m=e=>{if(s.isCallExpression(e)){const t=e.arguments[0];(s.isIdentifier(e.expression)&&e.expression.text==="select"||s.isPropertyAccessExpression(e.expression)&&e.expression.name.text==="select")&&e.arguments.length>=2&&t&&!s.isObjectLiteralExpression(t)&&r.push(`${n.path}|${a(t)}`);const l=e.arguments[1];(e.expression.getText(i).endsWith("createElement")||s.isIdentifier(e.expression)&&e.expression.text==="h")&&t&&t.getText(i).replace(/<[\s\S]*>$/,"")==="IconPicker"&&l&&s.isObjectLiteralExpression(l)&&l.properties.some(y=>x(y)==="emptyValue")&&p.push(c(l))}if(s.isImportSpecifier(e)&&e.propertyName&&(e.propertyName.text==="select"||e.propertyName.text==="IconPicker")&&r.push(`${n.path}|alias ${e.name.text}`),s.isBindingElement(e)&&e.propertyName&&s.isIdentifier(e.propertyName)&&e.propertyName.text==="select"&&r.push(`${n.path}|alias ${e.name.getText(i)}`),(s.isJsxOpeningElement(e)||s.isJsxSelfClosingElement(e))&&k.has(e.tagName.getText(i))){const t=e.attributes.properties.find(l=>s.isJsxAttribute(l)&&l.name.getText(i)==="label"),o=t&&s.isJsxAttribute(t)?t.initializer:void 0;r.push(`${n.path}|<${e.tagName.getText(i)}> ${o?a(s.isJsxExpression(o)?o.expression:o):"(no label)"}`)}if(s.isObjectLiteralExpression(e))for(const t of["type","kind"]){const o=d(f(e,t));o&&s.isStringLiteralLike(o)&&o.text==="select"&&!h(e)&&r.push(`${n.path}|${a(f(e,"label"))}`)}s.isJsxAttribute(e)&&e.name.getText(i)==="emptyValue"&&e.parent.parent.tagName.getText(i)==="IconPicker"&&p.push(c(e)),s.isJsxSpreadAttribute(e)&&e.parent.parent.tagName.getText(i)==="IconPicker"&&p.push(c(e)),s.forEachChild(e,m)};return m(i),{selects:r,emptyValues:p}}function g(s){const n=new Map;for(const i of s)n.set(i,(n.get(i)??0)+1);return n}function A(s,n,i){const{check:r,report:p}=S("shape rows use the picker");{const e=['const a = select("Corner shape", icon, options);','const b = { type: "select", label: "Card shape", options };','const c = { type: "select" as const, label: LABEL, options };',"const d = select(item);",'const e = iconPickerRow("Corner shape", icon, options, "a");','const f = <IconPicker label="x" emptyValue="none" options={o} />;','const g = <IconPicker label="x" options={o} />;','const h = <Other emptyValue="none" />;','// select("A comment", icon) is not a use','const i = select(say("Said"), icon, options);',"const j = select(LABELS.x, icon, options);","const k = select(`A ${b}`, icon, options);",'const l = { "type": "select", label, options };',"const m = select({ index }, other);",'import { select as pick } from "x";','const n = createElement(IconPicker<V>, { label: "x", emptyValue: "none" });','const o = createElement(IconPicker, { label: "x" });','const p = rows.select("By a member", icon, options);',"const { select: q } = rows;",'const r = { type: "select" satisfies string, label: "Satisfied", options };','const s = { kind: "select", label: "A kind", options };','const t = <SettingsSelect label="Hand drawn" options={o} />;',"const u = <FieldSelect value={v} options={o} />;",'const v = <IconPicker label="x" {...rest} />;','import { IconPicker as Pick } from "x";','const w = describedAs(field, { type: "select", label: "Described" });',"const x = rows.select(item);"].join(`
2
+ `),t=u(s,{path:"f.tsx",text:e});r("R1 finds the builder and both field forms, and nothing else",JSON.stringify(t.selects)===JSON.stringify(["f.tsx|Corner shape","f.tsx|Card shape","f.tsx|LABEL",'f.tsx|say("Said")',"f.tsx|LABELS.x","f.tsx|`A ${b}`","f.tsx|label","f.tsx|alias pick","f.tsx|By a member","f.tsx|alias q","f.tsx|Satisfied","f.tsx|A kind","f.tsx|<SettingsSelect> Hand drawn","f.tsx|<FieldSelect> (no label)","f.tsx|alias Pick"]),JSON.stringify(t.selects)),r("R2 finds emptyValue on an IconPicker only, in both forms, and a spread",JSON.stringify(t.emptyValues)==="[6,16,24]",JSON.stringify(t.emptyValues))}const c=n.filter(e=>/\.tsx?$/.test(e.path)&&!e.path.endsWith(".d.ts")&&!b(e.path)),d=[],a=[];for(const e of c){const t=u(s,e);d.push(...t.selects),t.emptyValues.forEach(o=>a.push(`${e.path}:${o}`))}const x=g(d),f=g(i.selectRows),h=[...x].filter(([e,t])=>t>(f.get(e)??0)).map(([e])=>e).sort(),m=[...f].filter(([e,t])=>t>(x.get(e)??0)).map(([e])=>e);return r("R1 every select row is on the repository's list",h.length===0,`${h.join(", ")}: a row that picks between shapes uses iconPickerRow or shapePickerRow; a row that picks words joins the list`),r("R1 every name on the list is still a select row",m.length===0,`${m.join(", ")}: remove the entry`),r("R2 no IconPicker takes emptyValue",a.length===0,`${a.join(", ")}: use pickerNoneIcon, so the closed word has the size of every other`),r(`walked the source (${c.length} TS/TSX files, at least ${i.minFiles})`,c.length>=i.minFiles),p()}export{A as shapeRowsUseThePicker};
@@ -1,11 +1,4 @@
1
- import type { TextStyle, TextStyleColour } from "efficient-easel/text-styles";
1
+ import type { TextStyleColour, TextStyleColourNameOf } from "efficient-easel/text-styles";
2
2
  import { type ThemeValue } from "../theme.js";
3
3
  export declare function siteTextColours(theme: ThemeValue): TextStyleColour[];
4
- export declare function siteTextColoursNotOffered(theme: ThemeValue): TextStyleColour[];
5
- export declare function showColoursNotOffered(list: readonly TextStyle[], notOffered: readonly TextStyleColour[]): TextStyle[];
6
- export declare function keepColoursNotOffered(next: readonly TextStyle[], cur: readonly TextStyle[], stored: readonly {
7
- id: string;
8
- values: {
9
- color?: string;
10
- };
11
- }[], notOffered: readonly TextStyleColour[]): TextStyle[];
4
+ export declare function siteTextColourNameOf(theme: ThemeValue): TextStyleColourNameOf;
@@ -1 +1 @@
1
- import{partThemeColors as m}from"../document/part-inks.js";import{normalizeThemeColors as d,selectedThemeColors as s}from"../theme.js";const c="background";function i(r){const e=d(s(r));return m({main:e.accent,text:e.text,background:e.background,muted:e.muted}).map(o=>({key:o.name,name:o.label??o.name,value:o.value}))}function v(r){return i(r).filter(e=>e.key!==c)}function x(r){return i(r).filter(e=>e.key===c)}function C(r,e){return r.map(o=>{const t=e.find(n=>n.key===o.values.color);return t?{...o,values:{...o.values,color:t.value}}:o})}function T(r,e,o,t){return r.map(n=>{if(e.some(u=>u.id===n.id))return n;const l=e.filter(u=>u.kind===n.kind).at(-1),f=o.find(u=>u.id===l?.id)?.values.color,a=t.find(u=>u.key===f);return a&&a.value===n.values.color?{...n,values:{...n.values,color:a.key}}:n})}export{T as keepColoursNotOffered,C as showColoursNotOffered,v as siteTextColours,x as siteTextColoursNotOffered};
1
+ import{partColourName as m,partThemeColors as c}from"../document/part-inks.js";import{normalizeThemeColors as l,selectedThemeColors as i}from"../theme.js";const n="background";function a(r){const e=l(i(r));return c({main:e.accent,text:e.text,background:e.background,muted:e.muted}).map(o=>({key:o.name,name:o.label??o.name,value:o.value}))}function d(r){return a(r).filter(e=>e.key!==n)}function k(r){const e=a(r).filter(o=>o.key===n);return o=>{const t=m(o);return e.find(u=>u.key===t)?.value??t}}export{k as siteTextColourNameOf,d as siteTextColours};
@@ -4,7 +4,8 @@ export interface BreadcrumbItem {
4
4
  }
5
5
  export interface BreadcrumbProps {
6
6
  items?: BreadcrumbItem[];
7
+ current?: string;
7
8
  meta?: string;
8
9
  editing?: boolean;
9
10
  }
10
- export default function Breadcrumb({ items, meta, editing }: BreadcrumbProps): import("react").JSX.Element | null;
11
+ export default function Breadcrumb({ items, current, meta, editing }: BreadcrumbProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- import{jsx as r,jsxs as s,Fragment as p}from"react/jsx-runtime";import{Fragment as f}from"react";import{SiteLink as d}from"../lib/site-runtime.js";import{renderChrome as m,renderGold as x}from"./goldPhrases.js";import{say as h}from"../../format/lib/editor-words.js";function u({items:o,meta:a,editing:c=!1}){const l=(o??[]).filter(e=>e?.label?.trim()),t=l.length>0?l:c?[{label:h("Breadcrumb")}]:[];return t.length===0&&!a?null:r("nav",{className:"border-b border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-4",children:s("div",{className:"mx-auto flex max-w-[var(--sf-content-cap,none)] items-center gap-4",children:[t.map((e,n)=>{const i=n===t.length-1;return s(f,{children:[n>0&&r("span",{className:"opacity-40",children:"/"}),e.href&&!i?r(d,{href:e.href,className:"hover:text-fg",children:m(e.label)}):r("span",{className:i?"text-fg":void 0,children:m(e.label)})]},n)}),a&&s(p,{children:[r("span",{className:"opacity-40",children:"·"}),r("span",{children:x(a)})]})]})})}export{u as default};
1
+ import{jsx as r,jsxs as s,Fragment as f}from"react/jsx-runtime";import{Fragment as x}from"react";import{SiteLink as h}from"../lib/site-runtime.js";import{renderChrome as c,renderGold as b}from"./goldPhrases.js";import{say as g}from"../../format/lib/editor-words.js";function u({items:p,current:l,meta:t,editing:d=!1}){const i=(p??[]).filter(e=>e?.label?.trim()),m=l?.trim()?[...i,{label:l}]:i,a=m.length>0?m:d?[{label:g("Breadcrumb")}]:[];return a.length===0&&!t?null:r("nav",{className:"border-b border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-4",children:s("div",{className:"mx-auto flex max-w-[var(--sf-content-cap,none)] items-center gap-4",children:[a.map((e,n)=>{const o=n===a.length-1;return s(x,{children:[n>0&&r("span",{className:"opacity-40",children:"/"}),e.href&&!o?r(h,{href:e.href,className:"hover:text-fg",children:c(e.label)}):r("span",{className:o?"text-fg":void 0,children:c(e.label)})]},n)}),t&&s(f,{children:[r("span",{className:"opacity-40",children:"·"}),r("span",{children:b(t)})]})]})})}export{u as default};
@@ -16,7 +16,7 @@ export declare function useCardRow(): CardRow | null;
16
16
  export declare function CardRowDrawn({ type, props, children, }: {
17
17
  type: string;
18
18
  props: Record<string, unknown>;
19
- children: (drawn: Record<string, unknown>, at: CardRow | null) => ReactNode;
19
+ children: (drawn: Record<string, unknown>, at: CardRow | null, row: SourceRow | null) => ReactNode;
20
20
  }): import("react").JSX.Element;
21
21
  type CardTemplateRowsProps = {
22
22
  ownerId: string;
@@ -1 +1 @@
1
- "use client";import{Fragment as s,jsx as r,jsxs as h}from"react/jsx-runtime";import{createContext as x,useContext as i}from"react";import{REPEAT_ATTRIBUTE as w,REPEAT_INDEX_ATTRIBUTE as S}from"efficient-easel/draw";import{CARD_TEMPLATE_SLOT as P,rowFilledProps as j}from"../../format/lib/content/card-template.js";import{CARD_STATE_LINE_CLASS as D,cardStateAttrs as I,cardStateValue as L}from"../../format/lib/content/card-state.js";const c=x(null);function U(){return i(c)}function $({type:a,props:u,children:t}){const n=i(c);return r(s,{children:t(j(a,u,n?.row),n)})}function b({ownerId:a,ownerType:u,Template:t,rows:n,items:E,states:T,fallback:_,wrapCopy:l,children:A}){const C=i(c);if(!t||(t.blockCount??0)<=0)return r(s,{children:_});const R=C!==null,f=n.map((p,o)=>{const e=T?.[o],d={row:p,index:o,ownerType:u,item:E?.[o],nested:R,...e?{state:e}:null},m=r("div",{[w]:`${a}:${P}`,[S]:o,...I(e),children:L(e)?h(s,{children:[r(t,{}),r("span",{"aria-hidden":"true",className:D})]}):r(t,{})});return r(c.Provider,{value:d,children:l?l(m,d):m},o)});return r(s,{children:A(f)})}export{c as CardRowContext,$ as CardRowDrawn,b as CardTemplateRows,U as useCardRow};
1
+ "use client";import{Fragment as c,jsx as r,jsxs as w}from"react/jsx-runtime";import{createContext as h,useContext as l}from"react";import{REPEAT_ATTRIBUTE as x,REPEAT_INDEX_ATTRIBUTE as P}from"efficient-easel/draw";import{CARD_TEMPLATE_SLOT as S,rowFilledProps as g}from"../../format/lib/content/card-template.js";import{CARD_STATE_LINE_CLASS as j,cardStateAttrs as D,cardStateValue as I}from"../../format/lib/content/card-state.js";import{usePageRecordRow as L}from"./CurrentRecord.js";const a=h(null);function b(){return l(a)}function k({type:u,props:i,children:t}){const e=l(a),d=L(),n=e?.row??d;return r(c,{children:t(g(u,i,n),e,n)})}function M({ownerId:u,ownerType:i,Template:t,rows:e,items:d,states:n,fallback:E,wrapCopy:m,children:T}){const _=l(a);if(!t||(t.blockCount??0)<=0)return r(c,{children:E});const f=_!==null,A=e.map((C,o)=>{const s=n?.[o],R={row:C,index:o,ownerType:i,item:d?.[o],nested:f,...s?{state:s}:null},p=r("div",{[x]:`${u}:${S}`,[P]:o,...D(s),children:I(s)?w(c,{children:[r(t,{}),r("span",{"aria-hidden":"true",className:j})]}):r(t,{})});return r(a.Provider,{value:R,children:m?m(p,R):p},o)});return r(c,{children:T(A)})}export{a as CardRowContext,k as CardRowDrawn,M as CardTemplateRows,b as useCardRow};
@@ -1,14 +1,17 @@
1
+ import { type ListNumberForm } from "../../format/lib/content/list-number.js";
1
2
  import type { PartStyles } from "../lib/document/part-styles.js";
2
3
  export interface ContentsEntry {
3
4
  label: string;
4
5
  anchor: string;
5
6
  }
6
7
  export declare const CONTENTS_STICKY_TOP = 120;
7
- export default function ContentsList({ title, entries, stickyTop, sticky, editing, partStyles, }: {
8
+ export default function ContentsList({ title, entries, stickyTop, sticky, editing, partStyles, numberForm, hideClass, }: {
8
9
  title?: string;
9
10
  entries: readonly ContentsEntry[];
10
11
  stickyTop: number;
11
12
  sticky?: boolean;
12
13
  editing?: boolean;
13
14
  partStyles?: PartStyles;
15
+ numberForm?: ListNumberForm;
16
+ hideClass?: string;
14
17
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as n,jsxs as m}from"react/jsx-runtime";import{renderGold as c}from"./goldPhrases.js";import{listNumber as x}from"../../format/lib/content/list-number.js";import{STICKY_ASIDE_TOP as d}from"../../format/lib/content/sticky-aside.js";import{SIZE_STEP_OF_ROLE as T}from"../../format/lib/fonts.js";import{CONTENTS_REGIONS as b}from"../../format/lib/sections/contents-text-regions.js";import{TEXT_REGION_ATTR as h,regionStyle as u,textRegionPartKey as _}from"../../format/lib/sections/text-regions.js";const i=(e,t)=>e?{[h]:t}:{},p=(e,t)=>u(e?.[_(t)]?.role,b[t],T),C=d;function N({title:e,entries:t,stickyTop:f,sticky:s=!0,editing:a=!1,partStyles:l}){return m("aside",{className:`${s?"sticky ":""}flex flex-col self-start max-[900px]:static`,style:s?{top:f}:void 0,children:[e&&n("h4",{className:"mb-[18px] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-accent",children:c(e)}),t.map((r,o)=>m("a",{href:`#${r.anchor}`,className:`flex items-center justify-between gap-3 border-b border-line py-2.5 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim transition-colors hover:text-fg${o===0?" border-t":""}`,children:[n("span",{...i(a,"entry"),style:p(l,"entry"),children:c(r.label||"Section")}),n("span",{...i(a,"number"),style:p(l,"number"),className:"text-accent",children:x(o)})]},`${o}-${r.anchor}`))]})}export{C as CONTENTS_STICKY_TOP,N as default};
1
+ import{jsx as s,jsxs as f}from"react/jsx-runtime";import{renderGold as x}from"./goldPhrases.js";import{LIST_NUMBER_FORM_DEFAULT as b,listNumberIn as d}from"../../format/lib/content/list-number.js";import{STICKY_ASIDE_TOP as N}from"../../format/lib/content/sticky-aside.js";import{SIZE_STEP_OF_ROLE as h}from"../../format/lib/fonts.js";import{CONTENTS_REGIONS as E}from"../../format/lib/sections/contents-text-regions.js";import{TEXT_REGION_ATTR as S,regionStyle as g,textRegionPartKey as y}from"../../format/lib/sections/text-regions.js";const u=(e,t)=>e?{[S]:t}:{},T=(e,t)=>g(e?.[y(t)]?.role,E[t],h),v=N;function O({title:e,entries:t,stickyTop:_,sticky:a=!0,editing:l=!1,partStyles:c,numberForm:m=b,hideClass:i=""}){const r=m==="plain";return f("aside",{className:`${a?"sticky ":""}flex flex-col self-start max-[900px]:static${i?` ${i}`:""}`,style:a?{top:_}:void 0,children:[e&&s("h4",{className:"mb-[18px] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-accent",children:x(e)}),t.map((n,o)=>{const p=s("span",{...u(l,"number"),style:T(c,"number"),className:"text-accent",children:d(m,o)});return f("a",{href:`#${n.anchor}`,className:`flex items-center ${r?"justify-start gap-1":"justify-between gap-3"} border-b border-line py-2.5 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim transition-colors hover:text-fg${o===0?" border-t":""}`,children:[r&&p,s("span",{...u(l,"entry"),style:T(c,"entry"),children:x(n.label||"Section")}),!r&&p]},`${o}-${n.anchor}`)})]})}export{v as CONTENTS_STICKY_TOP,O as default};
@@ -0,0 +1,23 @@
1
+ import { type ReactNode } from "react";
2
+ import type { SourceRow } from "../../format/lib/content/block-sources.js";
3
+ export interface RecordSchemaField {
4
+ key: string;
5
+ label: string;
6
+ kind: string;
7
+ }
8
+ export interface CurrentRecord<TValue = unknown> {
9
+ type: string;
10
+ key: string;
11
+ title: string;
12
+ fields: Readonly<Record<string, unknown>>;
13
+ value: TValue;
14
+ schema?: readonly RecordSchemaField[];
15
+ }
16
+ export declare function CurrentRecordProvider({ record, dateWords, children, }: {
17
+ record: CurrentRecord;
18
+ dateWords?: (iso: string) => string;
19
+ children: ReactNode;
20
+ }): import("react").JSX.Element;
21
+ export declare function useCurrentRecord(): CurrentRecord | null;
22
+ export declare function useCurrentRecordOf<TValue = unknown>(type: string): CurrentRecord<TValue> | null;
23
+ export declare function usePageRecordRow(): SourceRow | null;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as l}from"react/jsx-runtime";import{createContext as d,useContext as t,useMemo as n}from"react";import{recordRow as s}from"../../format/lib/content/record-row.js";import{PRODUCT_RECORD_TYPE as i}from"../../format/lib/content/record-types.js";const o=d(null);function C({record:r,dateWords:e,children:u}){const c=n(()=>({record:r,dateWords:e}),[r,e]);return l(o.Provider,{value:c,children:u})}function p(){return t(o)?.record??null}function P(r){const e=p();return e!==null&&e.type===r?e:null}function a(){const r=t(o);return n(()=>r&&r.record.type!==i?s(r.record,r.dateWords):null,[r])}export{C as CurrentRecordProvider,p as useCurrentRecord,P as useCurrentRecordOf,a as usePageRecordRow};
@@ -20,7 +20,7 @@ interface FlexProps {
20
20
  justify: Justify;
21
21
  align: AlignItems;
22
22
  wrap: boolean;
23
- share?: string;
23
+ share?: unknown;
24
24
  sharePhone?: string;
25
25
  shareTablet?: unknown;
26
26
  wrapPhone?: unknown;
@@ -1 +1 @@
1
- import{Fragment as g,jsx as s,jsxs as eo}from"react/jsx-runtime";import{useId as Me}from"react";import{parseHexColor as We}from"efficient-shell/format";import je from"./BoxTabs.js";import{BoxTabPaneContext as He,useIsTabPane as Ue}from"./BoxTabPaneContext.js";import{CellFillContext as Xe,InBoxContext as Ge,useCellOfStretchedRow as ze,useFillsCell as Je}from"./InBoxContext.js";import Ke,{InsideSiteColumn as Ko,useInsideSiteGutter as Ye,useSectionRoot as qe}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as Qe}from"./BoxSurfaceContext.js";import Ve from"./PictureWash.js";import{BoxCellWidthContext as Ze}from"./BoxCellWidthContext.js";import{useInSiteHeader as os}from"./PhoneMenuTools.js";import{useCardRow as es}from"./CardRowContext.js";import{framesItsCards as ss}from"../../format/lib/content/card-place.js";import{MirrorContext as ts,useMirroredCopy as rs,useUnderCardBox as ns}from"./MirrorContext.js";import{isMirroredCopy as ls,mirrorCardsActs as as,mirroredBoxClass as cs,MIRROR_ROW_CLASS as ms,ownsCard as is}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as so,FRAME_GUTTER as to}from"./BlockFrame.js";import{containerGapProps as us}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as ds,boxBlockSpacingClass as fs,boxFitContentClass as Cs,boxRowColumnsClass as ps,boxRowTabletColumnsClass as Ss,boxRowTabletShareClass as xs,boxPhoneRowClasses as L,boxPhoneRowFits as bs,boxShareClasses as F,boxWrapClass as hs}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as $s,boxSeparatorSeamClass as _s,boxSeparatorStyle as Ps,isStripBox as Rs}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as ys,DEFAULT_LOOP_DIRECTION as Ls,DEFAULT_LOOP_SECONDS as As,isVerticalLoop as ws}from"../../format/lib/animation/index.js";import{LoopTrack as Os}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as m,BOX_OWNS_SIDES_CLASS as Bs,boxDarkenStyle as Ts,boxPlacementClasses as vs,CARD_SHADOW_CLASS as Ns,isBackgroundBox as Yo}from"../../format/lib/content/box-background.js";import{boxShadowAttrs as qo}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as Es,drawsSiteGutter as ks}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as gs,boxShapeClasses as Fs}from"../../format/lib/content/box-shape.js";import{BOX_JUMP_ATTR as Ds,BOX_LINK_ATTR as Qo,BOX_LINK_CLASS as Vo,BOX_LINKED_CLASS as Is,boxJumpBlocksClass as Ms,boxJumpCss as Ws,boxJumpSlug as js,boxLinkOf as Hs}from"../../format/lib/content/box-link.js";import{SiteLink as Us}from"../lib/site-runtime.js";import{sectionBorderStyle as Zo}from"../../format/lib/content/borders.js";import{finiteNumber as i}from"../../format/lib/finite-number.js";import{sectionPadAttrs as Xs}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as D}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as Gs}from"../../format/lib/content/ink.js";import{sizedBackground as ro}from"../../format/lib/sized-image.js";import{PHOTO_HOST_ATTR as zs,resolveImageTreatment as Js}from"../../format/lib/content/image-treatment.js";import{BoxRail as Ks,BoxRailStop as Ys,RAIL_STOPS_CLASS as qs,useTimelineRail as Qs}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as Vs,sharedColumnsClasses as Zs,sharedColumnsCss as ot}from"../lib/content/box-shared-columns.js";import et from"./PhotoHoverSheet.js";const no={"--sf-site-gutter":"0px"},st={overflowX:"clip",overflowY:"visible"},tt={desktop:!1,phone:!1},oe="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-tablet:bg-[image:var(--sf-box-bg-p)]",lo=o=>o==null||o==="",ao=o=>!lo(o)&&Number(o)===0;function rt({children:o}){return s(g,{children:o(Me())})}function nt({direction:o,label:ee,tabShape:se,gap:co,gapPhone:te,gapTablet:I,justify:A,align:C,wrap:mo,share:p,sharePhone:M,shareTablet:io,wrapPhone:re,phoneRow:w,columns:O,columnsTablet:W,separator:n,blockSpacing:ne,bgImage:h,bgImagePhone:uo,pictureHover:le,darken:ae,darkenStyle:ce,placement:me,padV2:fo=!1,border:Co,borderTablet:po,borderPhone:So,pad:r={},contained:j=!0,fillHeight:u=!1,shadow:xo,loop:S,scrollDirection:H=Ls,loopSeconds:ie=As,loopDelay:ue=ys,editing:bo=!1,fillColor:ho,line:$,upcoming:de,link:fe,boxShape:$o,boxShapePhone:Ce,boxShapeTablet:pe,jumpHighlight:Se,anchor:xe,sharedSides:B=tt,boxId:_o,mirrorCards:be,content:_}){const x=bo?"":Hs(fe),l=u?"":Fs($o,Ce,pe),he=!u&&gs($o)!=="",d=js(Se,xe),U=typeof ho=="string"?We(ho.trim()):null,Po=U?{backgroundColor:U}:void 0,Ro=Qs(),X=$===!0&&o!=="tabs",t=Yo(h),T=os(),$e=qe(),yo=Ue(),G=Je(),_e=ze(),v=Rs(o,n),a=S==="scroll"&&o!=="tabs",b=es(),Pe=rs(),Re=ns(),N=is({inCopy:b!==null,nestedCopy:b?.nested===!0,underBox:Re}),z=N&&ss(b?.ownerType),Lo=as({direction:o,separator:n,loop:S,line:$,bgImage:h,columns:O,columnsTablet:W,share:p,wrap:mo},N,B.desktop)&&ls(be,b?.index),Ao=t||N?"":cs(Pe,o,a?void 0:A,C),E=ps({direction:o,separator:n,loop:S,line:$,columns:O}),J=Ss({direction:o,separator:n,loop:S,line:$,columnsTablet:W}),wo=xs({direction:o,separator:n,loop:S,line:$,columns:O,columnsTablet:W,share:p,shareTablet:io}),ye=Ye(),k=Zs(B,_.blockCount??0),Le=k&&(!b||b.index===0)?ot(B,_.blockCount??0):"",Oo=[F(p),o==="row"?Cs(p):"",E,J,wo,fs(ne),$s(o,n)].filter(Boolean).join(" "),Ae=Oo?` ${Oo}`:"",Bo=["flex",o==="row"?v||a?"flex-row":`flex-row ${L(w,M,re)}`:"flex-col",hs(a?!1:mo),t?vs(me??"center",o):ds(a?void 0:A,C)+(Ao?` ${Ao}`:"")].join(" ")+Ae,P=u||t||l||G?` ${D}`:"",K=he?` ${l}`:l?`${P} ${l}`:P,To=_e&&o==="column"&&!t&&!a&&F(p)===""&&typeof A=="string"&&A!=="start",vo=P||(To?` ${D}`:""),Y=x?` ${Is}`:"",q=t||T||fo?"":" py-6",we=`${so}${q} ${to}${K}${Y}`,Oe=T?`${K}${Y}`.trim():`w-full${q}${K}${Y}`,R=us("Flex",co,o==="row"?"inline":"block",te,v||a?void 0:I),Be=v?{...R.style,...Ps(o,n)}:R.style,No=(e="")=>s(_,{className:`${Bo}${Lo?` ${ms}`:""}${R.className}${vo}${e?` ${e}`:""}${X?` ${qs}`:""}${d?` ${Ms(d)}`:""}${k}`,style:Be,minEmptyHeight:120}),Eo=ws(H)?"":_s(o,n),ko=a?s(Os,{direction:H,seconds:ie,delay:ue,editing:bo,copy:e=>No(e&&Eo?`${e} ${Eo}`:e)}):No(),go=o==="tabs"?s(je,{className:`${Bo}${R.className}${G&&!u&&!t&&!l?"":P}`,style:R.style,shape:se,children:ko}):ko,Fo=yo?s(He.Provider,{value:!1,children:go}):go,Te={stretchedRow:o==="row"&&!t&&(C===void 0||C==="stretch"),fillingColumn:o==="column"&&(G||To),columnsRow:E!==""||J!==""||k!=="",..._o?{id:_o}:null},Do=s(Ge.Provider,{value:Te,children:s(Xe.Provider,{value:!1,children:N?s(ts.Provider,{value:Lo,children:Fo}):Fo})}),Q=X?s(Ks,{row:o==="row",stops:_.blockCount??0,children:Do}):Do,ve=ee?.trim()||(yo?"":void 0),Ne={values:r,frame:q?24:0},Ee=e=>Ro?s(Ys,{on:Ro,future:de===!0,children:e}):e,ke=e=>x.startsWith("/")?s(Us,{href:x,className:Vo,"aria-labelledby":e,[Qo]:""}):s("a",{href:x,className:Vo,"aria-labelledby":e,[Qo]:""}),Io=(d?Ws(d):"")+Le,Mo=Io?s("style",{dangerouslySetInnerHTML:{__html:Io}}):null,y=Es({loop:S,direction:o,scrollDirection:H,bgImage:h}),ge=B.desktop&&k!==""&&!U&&!Zo(Co,So,po)&&Object.keys(qo(xo)).length===0&&!x&&!l&&!u&&!d&&!ks(j&&!y,ye)&&ao(co)&&(lo(I)||ao(I))&&fo&&Object.values(r).every(e=>lo(e)||ao(e)),Fe=e=>({...ge?{[Vs]:""}:null,...t?null:qo(xo),...d?{[Ds]:d}:null,...e?{id:e}:null}),Wo=E!==""?Number(O):0,De=L(w,M)===L(void 0),Ie=(o==="column"||o==="row"&&!v&&!a&&(Wo===1&&De||Wo===0&&_.blockCount===1))&&!t&&!X&&!T,jo=t&&$e&&!T,Ho=(e,c)=>Ee(s(Ke,{contained:j&&!y,style:y?no:void 0,framedClass:we,fillClass:Oe,columnClass:`${so} ${to}${vo}`,tabLabel:ve,pad:t?void 0:Ne,border:Zo(Co,So,po),outerAttrs:Fe(c),box:!0,edge:Ie,outerStyle:t?void 0:Po,bleed:jo,children:Mo||c?eo(g,{children:[Mo,c?ke(c):null,y?s(Ko,{children:e}):e]}):y?s(Ko,{children:e}):e})),Uo=e=>x?s(rt,{children:c=>Ho(e,c)}):Ho(e);if(!t){const e=C===void 0||C==="stretch",c=(F(p)!==""||E!==""||J!=="")&&!bs(w,M)&&!(wo!==""&&F(io)==="")&&(e||L(w)!==L(void 0));return Uo((o==="row"?c:o==="column"&&e)?s(Ze.Provider,{value:!0,children:Q}):Q)}const V=Ts(ae,ce),Z=Yo(uo),Xo=Z?{"--sf-box-bg":ro(h??""),"--sf-box-bg-p":ro(uo??"")}:{backgroundImage:ro(h??""),backgroundSize:"cover",backgroundPosition:"center"},Go=Js(void 0,void 0,le),f=Go.className?Go:null,oo=Xs({...r,top:i(r.top)??m.desktop,bottom:i(r.bottom)??m.desktop,topPhone:i(r.topPhone)??m.phone,bottomPhone:i(r.bottomPhone)??m.phone,left:i(r.left)??m.side,right:i(r.right)??m.side,leftPhone:i(r.leftPhone)??m.sidePhone,rightPhone:i(r.rightPhone)??m.sidePhone}),zo=s("div",{className:`relative z-[1] ${Bs} ${oo?.className??""}${u||l?` ${D}`:""}`.trimEnd(),style:V?{...oo?.style,...no,...Gs}:{...oo?.style,...no},children:Q}),Jo=jo&&j?s("div",{className:`${so} ${to}${u||l?` ${D}`:""}`,children:zo}):zo;return Uo(s(g,{children:eo("div",{className:`relative isolate overflow-hidden ${Ns}${P}${Z&&!f?` ${oe}`:""}`,style:{...z?st:{},...Po,...f?{}:Xo},...f?{[zs]:""}:{},children:[f&&eo(g,{children:[s(et,{sheet:f.sheet}),s("div",{"aria-hidden":!0,className:`absolute inset-0${z?" rounded-[inherit]":""}${Z?` ${oe}`:""} ${f.className}`,style:{...Xo,...f.style??{}}})]}),s(Ve,{wash:V,...z?{className:"rounded-[inherit]"}:{}}),V?s(Qe,{children:Jo}):Jo]})}))}export{nt as default};
1
+ import{Fragment as j,jsx as e,jsxs as to}from"react/jsx-runtime";import{useId as zs}from"react";import{parseHexColor as Js}from"efficient-shell/format";import Ks from"./BoxTabs.js";import{BoxTabPaneContext as Ys,useIsTabPane as Vs}from"./BoxTabPaneContext.js";import{CellFillContext as qs,InBoxContext as Qs,useCellOfStretchedRow as Zs,useFillsCell as oe}from"./InBoxContext.js";import se,{InsideSiteColumn as Zo,useInsideSiteGutter as ee,useSectionRoot as te}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as re}from"./BoxSurfaceContext.js";import ne from"./PictureWash.js";import{BoxCellWidthContext as le}from"./BoxCellWidthContext.js";import{useInSiteHeader as ae}from"./PhoneMenuTools.js";import{useCardRow as ce}from"./CardRowContext.js";import{framesItsCards as me}from"../../format/lib/content/card-place.js";import{MirrorContext as ie,useMirroredCopy as ue,useUnderCardBox as de}from"./MirrorContext.js";import{isMirroredCopy as fe,mirrorCardsActs as Ce,mirroredBoxClass as Se,MIRROR_ROW_CLASS as pe,ownsCard as be}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as ro,FRAME_GUTTER as no}from"./BlockFrame.js";import{containerGapProps as xe}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as he,boxBlockSpacingClass as $e,boxFitContentClass as _e,boxRowColumnsClass as ye,boxRowTabletColumnsClass as Pe,boxRowTabletShareClass as Re,boxPhoneCellsShareLine as Ae,boxPhoneRowClasses as E,boxPhoneRowFits as Le,boxShareClasses as _,boxShareVars as we,boxWrapClass as Oe}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as Be,boxSeparatorSeamClass as Ne,boxSeparatorStyle as ve,isStripBox as Ee}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as Te,DEFAULT_LOOP_DIRECTION as ke,DEFAULT_LOOP_SECONDS as Fe,isVerticalLoop as ge}from"../../format/lib/animation/index.js";import{LoopTrack as De}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as i,BOX_OWNS_SIDES_CLASS as Ie,boxDarkenStyle as Me,boxPlacementClasses as We,CARD_SHADOW_CLASS as je,isBackgroundBox as os}from"../../format/lib/content/box-background.js";import{boxShadowAttrs as ss}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as He,drawsSiteGutter as Ue}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as Xe,boxShapeClasses as Ge}from"../../format/lib/content/box-shape.js";import{BOX_JUMP_ATTR as ze,BOX_LINK_ATTR as es,BOX_LINK_CLASS as ts,BOX_LINKED_CLASS as Je,boxJumpBlocksClass as Ke,boxJumpCss as Ye,boxJumpSlug as Ve,boxLinkOf as qe}from"../../format/lib/content/box-link.js";import{SiteLink as Qe}from"../lib/site-runtime.js";import{sectionBorderStyle as rs}from"../../format/lib/content/borders.js";import{finiteNumber as u}from"../../format/lib/finite-number.js";import{sectionPadAttrs as Ze}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as H}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as ot}from"../../format/lib/content/ink.js";import{sizedBackground as lo}from"../../format/lib/sized-image.js";import{PHOTO_HOST_ATTR as st,resolveImageTreatment as et}from"../../format/lib/content/image-treatment.js";import{BoxRail as tt,BoxRailStop as rt,RAIL_STOPS_CLASS as nt,useTimelineRail as lt}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as at,sharedColumnsClasses as ct,sharedColumnsCss as mt}from"../lib/content/box-shared-columns.js";import it from"./PhotoHoverSheet.js";const ao={"--sf-site-gutter":"0px"},ut={overflowX:"clip",overflowY:"visible"},dt={desktop:!1,phone:!1},ns="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-tablet:bg-[image:var(--sf-box-bg-p)]",co=o=>o==null||o==="",mo=o=>!co(o)&&Number(o)===0;function ft({children:o}){return e(j,{children:o(zs())})}function Ct({direction:o,label:ls,tabShape:as,gap:io,gapPhone:cs,gapTablet:U,justify:T,align:p,wrap:uo,share:n,sharePhone:k,shareTablet:y,wrapPhone:ms,phoneRow:P,columns:R,columnsTablet:F,separator:a,blockSpacing:is,bgImage:A,bgImagePhone:fo,pictureHover:us,darken:ds,darkenStyle:fs,placement:Cs,padV2:Co=!1,border:So,borderTablet:po,borderPhone:bo,pad:r={},contained:X=!0,fillHeight:d=!1,shadow:xo,loop:b,scrollDirection:G=ke,loopSeconds:Ss=Fe,loopDelay:ps=Te,editing:ho=!1,fillColor:$o,line:x,upcoming:bs,link:xs,boxShape:_o,boxShapePhone:hs,boxShapeTablet:$s,jumpHighlight:_s,anchor:ys,sharedSides:g=dt,boxId:yo,mirrorCards:Ps,content:f}){const h=ho?"":qe(xs),c=d?"":Ge(_o,hs,$s),Rs=!d&&Xe(_o)!=="",C=Ve(_s,ys),z=typeof $o=="string"?Js($o.trim()):null,Po=z?{backgroundColor:z}:void 0,Ro=lt(),J=x===!0&&o!=="tabs",t=os(A),D=ae(),As=te(),Ao=Vs(),K=oe(),Ls=Zs(),L=Ee(o,a),l=b==="scroll"&&o!=="tabs",$=ce(),ws=ue(),Os=de(),I=be({inCopy:$!==null,nestedCopy:$?.nested===!0,underBox:Os}),Y=I&&me($?.ownerType),Lo=Ce({direction:o,separator:a,loop:b,line:x,bgImage:A,columns:R,columnsTablet:F,share:n,wrap:uo},I,g.desktop)&&fe(Ps,$?.index),wo=t||I?"":Se(ws,o,l?void 0:T,p),w=ye({direction:o,separator:a,loop:b,line:x,columns:R}),O=Pe({direction:o,separator:a,loop:b,line:x,columnsTablet:F}),M=Re({direction:o,separator:a,loop:b,line:x,columns:R,columnsTablet:F,share:n,shareTablet:y}),Bs=ee(),W=ct(g,f.blockCount??0),Ns=W&&(!$||$.index===0)?mt(g,f.blockCount??0):"",Oo=O!==""?Number(F)>=2:M===""||_(y)!=="",Bo=O!==""||M!=="",vs=o==="row"&&!L&&!l&&x!==!0,Es=w!==""?Number(R)>=2:_(n)!=="",No=[_(n),o==="row"?_e(n):"",w,O,M,$e(is),Be(o,a)].filter(Boolean).join(" "),Ts=No?` ${No}`:"",vo=["flex",o==="row"?L||l?"flex-row":`flex-row ${E(P,k,ms)}`:"flex-col",Oe(l?!1:uo),t?We(Cs??"center",o):he(l?void 0:T,p)+(wo?` ${wo}`:"")].join(" ")+Ts,B=d||t||c||K?` ${H}`:"",V=Rs?` ${c}`:c?`${B} ${c}`:B,Eo=Ls&&o==="column"&&!t&&!l&&_(n)===""&&typeof T=="string"&&T!=="start",To=B||(Eo?` ${H}`:""),q=h?` ${Je}`:"",Q=t||D||Co?"":" py-6",ks=`${ro}${Q} ${no}${V}${q}`,Fs=D?`${V}${q}`.trim():`w-full${Q}${V}${q}`,N=xe("Flex",io,o==="row"?"inline":"block",cs,L||l?void 0:U),ko=we(n,y,o==="row"?f.blockCount??0:0),Fo=L?{...N.style,...ve(o,a)}:N.style,gs=ko?{...Fo,...ko}:Fo,go=(s="")=>e(f,{className:`${vo}${Lo?` ${pe}`:""}${N.className}${To}${s?` ${s}`:""}${J?` ${nt}`:""}${C?` ${Ke(C)}`:""}${W}`,style:gs,minEmptyHeight:120}),Do=ge(G)?"":Ne(o,a),Io=l?e(De,{direction:G,seconds:Ss,delay:ps,editing:ho,copy:s=>go(s&&Do?`${s} ${Do}`:s)}):go(),Mo=o==="tabs"?e(Ks,{className:`${vo}${N.className}${K&&!d&&!t&&!c?"":B}`,style:N.style,shape:as,children:Io}):Io,Wo=Ao?e(Ys.Provider,{value:!1,children:Mo}):Mo,jo=o==="row"&&!t&&(p===void 0||p==="stretch"),Ds={stretchedRow:jo,fillingColumn:o==="column"&&(K||Eo),columnsRow:w!==""||O!==""||W!==""||o==="row"&&(Array.isArray(n)||Array.isArray(y)),...jo&&vs&&(f.blockCount??0)>=2&&Es?{picturesFillRow:!0}:null,...Bo?{fillFrom:Oo?"tablet":"desktop"}:null,...Ae(P,k)&&(!Bo||Oo)?{phoneRowFills:!0}:null,...yo?{id:yo}:null},Ho=e(Qs.Provider,{value:Ds,children:e(qs.Provider,{value:!1,children:I?e(ie.Provider,{value:Lo,children:Wo}):Wo})}),Z=J?e(tt,{row:o==="row",stops:f.blockCount??0,children:Ho}):Ho,Is=ls?.trim()||(Ao?"":void 0),Ms={values:r,frame:Q?24:0},Ws=s=>Ro?e(rt,{on:Ro,future:bs===!0,children:s}):s,js=s=>h.startsWith("/")?e(Qe,{href:h,className:ts,"aria-labelledby":s,[es]:""}):e("a",{href:h,className:ts,"aria-labelledby":s,[es]:""}),Uo=(C?Ye(C):"")+Ns,Xo=Uo?e("style",{dangerouslySetInnerHTML:{__html:Uo}}):null,v=He({loop:b,direction:o,scrollDirection:G,bgImage:A}),Hs=g.desktop&&W!==""&&!z&&!rs(So,bo,po)&&Object.keys(ss(xo)).length===0&&!h&&!c&&!d&&!C&&!Ue(X&&!v,Bs)&&mo(io)&&(co(U)||mo(U))&&Co&&Object.values(r).every(s=>co(s)||mo(s)),Us=s=>({...Hs?{[at]:""}:null,...t?null:ss(xo),...C?{[ze]:C}:null,...s?{id:s}:null}),Go=w!==""?Number(R):0,Xs=E(P,k)===E(void 0),Gs=(o==="column"||o==="row"&&!L&&!l&&(Go===1&&Xs||Go===0&&f.blockCount===1))&&!t&&!J&&!D,zo=t&&As&&!D,Jo=(s,m)=>Ws(e(se,{contained:X&&!v,style:v?ao:void 0,framedClass:ks,fillClass:Fs,columnClass:`${ro} ${no}${To}`,tabLabel:Is,pad:t?void 0:Ms,border:rs(So,bo,po),outerAttrs:Us(m),box:!0,edge:Gs,outerStyle:t?void 0:Po,bleed:zo,children:Xo||m?to(j,{children:[Xo,m?js(m):null,v?e(Zo,{children:s}):s]}):v?e(Zo,{children:s}):s})),Ko=s=>h?e(ft,{children:m=>Jo(s,m)}):Jo(s);if(!t){const s=p===void 0||p==="stretch",m=(_(n)!==""||w!==""||O!=="")&&!Le(P,k)&&!(M!==""&&_(y)==="")&&(s||E(P)!==E(void 0));return Ko((o==="row"?m:o==="column"&&s)?e(le.Provider,{value:!0,children:Z}):Z)}const oo=Me(ds,fs),so=os(fo),Yo=so?{"--sf-box-bg":lo(A??""),"--sf-box-bg-p":lo(fo??"")}:{backgroundImage:lo(A??""),backgroundSize:"cover",backgroundPosition:"center"},Vo=et(void 0,void 0,us),S=Vo.className?Vo:null,eo=Ze({...r,top:u(r.top)??i.desktop,bottom:u(r.bottom)??i.desktop,topPhone:u(r.topPhone)??i.phone,bottomPhone:u(r.bottomPhone)??i.phone,left:u(r.left)??i.side,right:u(r.right)??i.side,leftPhone:u(r.leftPhone)??i.sidePhone,rightPhone:u(r.rightPhone)??i.sidePhone}),qo=e("div",{className:`relative z-[1] ${Ie} ${eo?.className??""}${d||c?` ${H}`:""}`.trimEnd(),style:oo?{...eo?.style,...ao,...ot}:{...eo?.style,...ao},children:Z}),Qo=zo&&X?e("div",{className:`${ro} ${no}${d||c?` ${H}`:""}`,children:qo}):qo;return Ko(e(j,{children:to("div",{className:`relative isolate overflow-hidden ${je}${B}${so&&!S?` ${ns}`:""}`,style:{...Y?ut:{},...Po,...S?{}:Yo},...S?{[st]:""}:{},children:[S&&to(j,{children:[e(it,{sheet:S.sheet}),e("div",{"aria-hidden":!0,className:`absolute inset-0${Y?" rounded-[inherit]":""}${so?` ${ns}`:""} ${S.className}`,style:{...Yo,...S.style??{}}})]}),e(ne,{wash:oo,...Y?{className:"rounded-[inherit]"}:{}}),oo?e(re,{children:Qo}):Qo]})}))}export{Ct as default};
@@ -60,6 +60,7 @@ export declare function HeroTwoPictures({ desktopLayout, phoneLayout, editing, m
60
60
  src?: string;
61
61
  objectPosition?: string;
62
62
  objectPositionPhone?: string;
63
+ objectPositionTablet?: string;
63
64
  tintColor: string;
64
65
  tintOpacity: number;
65
66
  };
@@ -67,6 +68,7 @@ export declare function HeroTwoPictures({ desktopLayout, phoneLayout, editing, m
67
68
  src?: string;
68
69
  objectPosition?: string;
69
70
  objectPositionPhone?: string;
71
+ objectPositionTablet?: string;
70
72
  tintColor: string;
71
73
  tintOpacity: number;
72
74
  };
@@ -1 +1 @@
1
- "use client";import{Fragment as m,jsx as i,jsxs as l}from"react/jsx-runtime";import u from"./HeroPoster.js";import{SectionAnimation as h}from"./SectionAnimation.js";import{resolveMedia as p}from"../lib/media.js";import{HERO_MEDIA_PARTS as g,HERO_PART_ATTR as v}from"../lib/document/hero-media-parts.js";import{entranceDrawn as y}from"../lib/animation/entrance.js";import{readPartMotion as b}from"../lib/animation/part-motion.js";import{pictureHoverOf as w}from"../../format/lib/animation/hover.js";import{PHOTO_HOST_ATTR as T,SITE_PHOTO_CSS as H,resolveImageTreatment as _}from"../../format/lib/content/image-treatment.js";import{heroPictureCount as k,normaliseMediaLayout as j,resolvePhoneLayout as N}from"../../format/lib/hero-media-layout.js";import{normaliseVideoPlayback as O,normaliseVideoSource as S,parseYouTubeId as A}from"../../format/lib/hero-video.js";import{hidableText as R}from"efficient-easel/draw";const V={one:"max-[719px]:grid-cols-1 max-[719px]:grid-rows-1",side:"max-[719px]:grid-cols-2 max-[719px]:grid-rows-1",stacked:"max-[719px]:grid-cols-1 max-[719px]:grid-rows-2"},C={one:"view-tablet:grid-cols-1 view-tablet:grid-rows-1",side:"view-tablet:grid-cols-2 view-tablet:grid-rows-1",stacked:"view-tablet:grid-cols-1 view-tablet:grid-rows-2"};function q(e){const o=e.isVideo&&S(e.videoSource)==="youtube",r=e.isVideo&&O(e.videoPlayback)==="click",n=o?A(R(e.youtubeUrl)):null,t=j(e.mediaLayout);return{fromYouTube:o,onClick:r,youTubeId:n,backgroundFile:e.isVideo&&!o&&!r,desktopLayout:t,phoneLayout:N(e.mediaLayoutPhone,t),twoPictures:!e.isVideo&&k(e)>1}}function d(e,o){return y(b({_partMotion:e},o))}function c(e,o){return _(void 0,void 0,w(b({_partMotion:e},o)))}function B(e){return g.some(r=>c(e,r).className)?{hostAttrs:{[T]:""},sheet:H}:{}}function x({treatment:e,children:o}){return e.className?i("div",{className:`absolute inset-0 ${e.className}`,...e.style?{style:e.style}:{},children:o}):i(m,{children:o})}function P({color:e,opacity:o,passClicks:r=!0}){return o>0?i("div",{className:r?"pointer-events-none absolute inset-0 z-[2]":"absolute inset-0 z-[2]",style:{background:e,opacity:Math.min(Math.max(o,0),100)/100}}):null}function f({part:e,editing:o,marked:r=!0,entrance:n,className:t,children:s}){const a=o&&r?{[v]:e}:void 0;return n?i(h,{desktop:n.desktop,phone:n.phone,editing:o,boxClass:t,boxAttrs:a,children:s}):i("div",{className:t,...a,children:s})}function J({partMotion:e,editing:o,children:r}){const n=d(e,"media"),t=c(e,"media"),s=t.className?i("div",{className:`absolute inset-0 z-[1] ${t.className}`,...t.style?{style:t.style}:{},children:r}):r;return n?i(h,{desktop:n.desktop,phone:n.phone,editing:o,boxClass:"absolute inset-0 z-[1]",children:s}):i(m,{children:s})}function Q({desktopLayout:e,phoneLayout:o,editing:r,marked:n=!0,partMotion:t,first:s,second:a}){return l("div",{className:`absolute inset-0 z-[1] grid ${V[o]} ${C[e]}`,"data-hero-layout":e,"data-hero-layout-phone":o,children:[i(f,{part:"image",editing:r,marked:n,entrance:d(t,"image"),className:"relative overflow-hidden",children:l(x,{treatment:c(t,"image"),children:[i(u,{posterSrc:p(s.src),showVideo:!1,objectPosition:s.objectPosition,objectPositionPhone:s.objectPositionPhone}),i(P,{color:s.tintColor,opacity:s.tintOpacity})]})}),i(f,{part:"image2",editing:r,marked:n,entrance:d(t,"image2"),className:`relative overflow-hidden${o==="one"?" max-[719px]:hidden":""}${e==="one"?" view-tablet:hidden":""}`,children:l(x,{treatment:c(t,"image2"),children:[i(u,{posterSrc:p(a.src),showVideo:!1,objectPosition:a.objectPosition,objectPositionPhone:a.objectPositionPhone}),i(P,{color:a.tintColor,opacity:a.tintOpacity})]})})]})}export{J as HeroMediaLayer,f as HeroPickArea,x as HeroPictureHover,P as HeroTint,Q as HeroTwoPictures,q as heroMediaReading,d as heroPartEntrance,c as heroPartHover,B as heroPicturesHover};
1
+ "use client";import{Fragment as m,jsx as r,jsxs as l}from"react/jsx-runtime";import u from"./HeroPoster.js";import{SectionAnimation as b}from"./SectionAnimation.js";import{resolveMedia as h}from"../lib/media.js";import{HERO_MEDIA_PARTS as g,HERO_PART_ATTR as v}from"../lib/document/hero-media-parts.js";import{entranceDrawn as y}from"../lib/animation/entrance.js";import{readPartMotion as P}from"../lib/animation/part-motion.js";import{pictureHoverOf as T}from"../../format/lib/animation/hover.js";import{PHOTO_HOST_ATTR as w,SITE_PHOTO_CSS as j,resolveImageTreatment as H}from"../../format/lib/content/image-treatment.js";import{heroPictureCount as _,normaliseMediaLayout as k,resolvePhoneLayout as N}from"../../format/lib/hero-media-layout.js";import{normaliseVideoPlayback as O,normaliseVideoSource as S,parseYouTubeId as A}from"../../format/lib/hero-video.js";import{hidableText as R}from"efficient-easel/draw";const V={one:"max-[719px]:grid-cols-1 max-[719px]:grid-rows-1",side:"max-[719px]:grid-cols-2 max-[719px]:grid-rows-1",stacked:"max-[719px]:grid-cols-1 max-[719px]:grid-rows-2"},C={one:"view-tablet:grid-cols-1 view-tablet:grid-rows-1",side:"view-tablet:grid-cols-2 view-tablet:grid-rows-1",stacked:"view-tablet:grid-cols-1 view-tablet:grid-rows-2"};function q(e){const o=e.isVideo&&S(e.videoSource)==="youtube",i=e.isVideo&&O(e.videoPlayback)==="click",n=o?A(R(e.youtubeUrl)):null,t=k(e.mediaLayout);return{fromYouTube:o,onClick:i,youTubeId:n,backgroundFile:e.isVideo&&!o&&!i,desktopLayout:t,phoneLayout:N(e.mediaLayoutPhone,t),twoPictures:!e.isVideo&&_(e)>1}}function d(e,o){return y(P({_partMotion:e},o))}function c(e,o){return H(void 0,void 0,T(P({_partMotion:e},o)))}function B(e){return g.some(i=>c(e,i).className)?{hostAttrs:{[w]:""},sheet:j}:{}}function p({treatment:e,children:o}){return e.className?r("div",{className:`absolute inset-0 ${e.className}`,...e.style?{style:e.style}:{},children:o}):r(m,{children:o})}function x({color:e,opacity:o,passClicks:i=!0}){return o>0?r("div",{className:i?"pointer-events-none absolute inset-0 z-[2]":"absolute inset-0 z-[2]",style:{background:e,opacity:Math.min(Math.max(o,0),100)/100}}):null}function f({part:e,editing:o,marked:i=!0,entrance:n,className:t,children:a}){const s=o&&i?{[v]:e}:void 0;return n?r(b,{desktop:n.desktop,phone:n.phone,editing:o,boxClass:t,boxAttrs:s,children:a}):r("div",{className:t,...s,children:a})}function J({partMotion:e,editing:o,children:i}){const n=d(e,"media"),t=c(e,"media"),a=t.className?r("div",{className:`absolute inset-0 z-[1] ${t.className}`,...t.style?{style:t.style}:{},children:i}):i;return n?r(b,{desktop:n.desktop,phone:n.phone,editing:o,boxClass:"absolute inset-0 z-[1]",children:a}):r(m,{children:a})}function Q({desktopLayout:e,phoneLayout:o,editing:i,marked:n=!0,partMotion:t,first:a,second:s}){return l("div",{className:`absolute inset-0 z-[1] grid ${V[o]} ${C[e]}`,"data-hero-layout":e,"data-hero-layout-phone":o,children:[r(f,{part:"image",editing:i,marked:n,entrance:d(t,"image"),className:"relative overflow-hidden",children:l(p,{treatment:c(t,"image"),children:[r(u,{posterSrc:h(a.src),showVideo:!1,objectPosition:a.objectPosition,objectPositionPhone:a.objectPositionPhone,objectPositionTablet:a.objectPositionTablet}),r(x,{color:a.tintColor,opacity:a.tintOpacity})]})}),r(f,{part:"image2",editing:i,marked:n,entrance:d(t,"image2"),className:`relative overflow-hidden${o==="one"?" max-[719px]:hidden":""}${e==="one"?" view-tablet:hidden":""}`,children:l(p,{treatment:c(t,"image2"),children:[r(u,{posterSrc:h(s.src),showVideo:!1,objectPosition:s.objectPosition,objectPositionPhone:s.objectPositionPhone,objectPositionTablet:s.objectPositionTablet}),r(x,{color:s.tintColor,opacity:s.tintOpacity})]})})]})}export{J as HeroMediaLayer,f as HeroPickArea,p as HeroPictureHover,x as HeroTint,Q as HeroTwoPictures,q as heroMediaReading,d as heroPartEntrance,c as heroPartHover,B as heroPicturesHover};
@@ -5,7 +5,8 @@ interface HeroPosterProps {
5
5
  playbackRate?: number;
6
6
  objectPosition?: string;
7
7
  objectPositionPhone?: string;
8
+ objectPositionTablet?: string;
8
9
  quiet?: boolean;
9
10
  }
10
- export default function HeroPoster({ videoSrc, posterSrc, showVideo, playbackRate, objectPosition, objectPositionPhone, quiet, }: HeroPosterProps): import("react").JSX.Element;
11
+ export default function HeroPoster({ videoSrc, posterSrc, showVideo, playbackRate, objectPosition, objectPositionPhone, objectPositionTablet, quiet, }: HeroPosterProps): import("react").JSX.Element;
11
12
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as N}from"react/jsx-runtime";import{useEffect as m,useRef as C,useState as a}from"react";import{SiteImage as L}from"../lib/site-runtime.js";import P from"./HeroHeldFrame.js";import{hasAv1Variant as R,isExternalMediaUrl as A}from"../lib/media.js";import{sizedImage as H}from"../../format/lib/sized-image.js";import{phoneFocus as S}from"../../format/lib/content/phone-focus.js";const _=.5;function $({videoSrc:d,posterSrc:f,showVideo:p=!0,playbackRate:v=_,objectPosition:l="50% 50%",objectPositionPhone:I,quiet:y=!1}){const n=S(I),e=f||"",t=d||"",[c,u]=a(!1),[g,w]=a(!1),[j,F]=a(!1),[k,E]=a(!1),[b,h]=a(!1),z=C(null);m(()=>{u(!1),w(!1),F(!1),E(!1)},[d,f]),m(()=>{if(typeof window>"u")return;const s=()=>{const r=window;r.requestIdleCallback?r.requestIdleCallback(()=>h(!0),{timeout:2e3}):setTimeout(()=>h(!0),800)};if(document.readyState==="complete"){s();return}return window.addEventListener("load",s,{once:!0}),()=>window.removeEventListener("load",s)},[]),m(()=>{const s=z.current;if(!s)return;const r=()=>{s.playbackRate=v};return r(),s.addEventListener("loadedmetadata",r),()=>s.removeEventListener("loadedmetadata",r)},[d,v]);const x=A(e),i=e&&x&&!g?H(e):{src:e};return N("div",{className:"absolute inset-0 z-[1]",children:[o("div",{className:"absolute inset-0",style:{background:"var(--site-surface)"}}),e&&(x?o("img",{src:i.src,...i.srcSet?{srcSet:i.srcSet,sizes:"100vw"}:{},alt:"",className:`absolute inset-0 z-[2] h-full w-full object-cover ${n.className}`.trim(),style:{display:c?"none":"block",objectPosition:l,...n.style},onError:()=>i.srcSet?w(!0):u(!0)},e):o(L,{src:e,alt:"",fill:!0,priority:!0,sizes:"100vw",className:`z-[2] object-cover ${n.className}`.trim(),style:{display:c?"none":"block",objectPosition:l,...n.style},onError:()=>u(!0)},e)),p&&!y&&t&&b&&!j&&N("video",{ref:z,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"metadata",className:"absolute inset-0 z-[3] h-full w-full object-cover",style:{objectPosition:l},onError:()=>F(!0),children:[R(t)&&o("source",{src:t.replace(/\.mp4$/,".av1.mp4"),type:'video/mp4; codecs="av01.0.08M.10"'}),o("source",{src:t,type:"video/mp4"})]},t),p&&y&&t&&b&&!k&&(!e||c)&&o(P,{src:t,objectPosition:l,onError:()=>E(!0)},t)]})}export{$ as default};
1
+ "use client";import{jsx as o,jsxs as N}from"react/jsx-runtime";import{useEffect as m,useRef as L,useState as a}from"react";import{SiteImage as P}from"../lib/site-runtime.js";import R from"./HeroHeldFrame.js";import{hasAv1Variant as A,isExternalMediaUrl as H}from"../lib/media.js";import{sizedImage as S}from"../../format/lib/sized-image.js";import{phoneFocus as _}from"../../format/lib/content/phone-focus.js";const $=.5;function M({videoSrc:d,posterSrc:f,showVideo:p=!0,playbackRate:v=$,objectPosition:l="50% 50%",objectPositionPhone:I,objectPositionTablet:g,quiet:y=!1}){const n=_(I,g),e=f||"",t=d||"",[c,u]=a(!1),[j,w]=a(!1),[k,F]=a(!1),[C,E]=a(!1),[b,h]=a(!1),z=L(null);m(()=>{u(!1),w(!1),F(!1),E(!1)},[d,f]),m(()=>{if(typeof window>"u")return;const s=()=>{const r=window;r.requestIdleCallback?r.requestIdleCallback(()=>h(!0),{timeout:2e3}):setTimeout(()=>h(!0),800)};if(document.readyState==="complete"){s();return}return window.addEventListener("load",s,{once:!0}),()=>window.removeEventListener("load",s)},[]),m(()=>{const s=z.current;if(!s)return;const r=()=>{s.playbackRate=v};return r(),s.addEventListener("loadedmetadata",r),()=>s.removeEventListener("loadedmetadata",r)},[d,v]);const x=H(e),i=e&&x&&!j?S(e):{src:e};return N("div",{className:"absolute inset-0 z-[1]",children:[o("div",{className:"absolute inset-0",style:{background:"var(--site-surface)"}}),e&&(x?o("img",{src:i.src,...i.srcSet?{srcSet:i.srcSet,sizes:"100vw"}:{},alt:"",className:`absolute inset-0 z-[2] h-full w-full object-cover ${n.className}`.trim(),style:{display:c?"none":"block",objectPosition:l,...n.style},onError:()=>i.srcSet?w(!0):u(!0)},e):o(P,{src:e,alt:"",fill:!0,priority:!0,sizes:"100vw",className:`z-[2] object-cover ${n.className}`.trim(),style:{display:c?"none":"block",objectPosition:l,...n.style},onError:()=>u(!0)},e)),p&&!y&&t&&b&&!k&&N("video",{ref:z,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"metadata",className:"absolute inset-0 z-[3] h-full w-full object-cover",style:{objectPosition:l},onError:()=>F(!0),children:[A(t)&&o("source",{src:t.replace(/\.mp4$/,".av1.mp4"),type:'video/mp4; codecs="av01.0.08M.10"'}),o("source",{src:t,type:"video/mp4"})]},t),p&&y&&t&&b&&!C&&(!e||c)&&o(R,{src:t,objectPosition:l,onError:()=>E(!0)},t)]})}export{M as default};
@@ -23,6 +23,7 @@ interface Props {
23
23
  text?: string;
24
24
  }[];
25
25
  heightDesktop?: number;
26
+ heightTablet?: number;
26
27
  heightMobile?: number;
27
28
  showPicker?: boolean;
28
29
  pickerShape?: HeroReelShape;
@@ -33,4 +34,4 @@ interface Props {
33
34
  editing?: boolean;
34
35
  partMotion?: Record<string, unknown>;
35
36
  }
36
- export default function HeroSection({ slides: Slides, strip: Strip, alignment, textureOpacity, showTexture, textureColor, phoneUpDown, phoneSideways, autoplay, autoplayInterval, showTicker, tickerItems, heightDesktop, heightMobile, showPicker, pickerShape, pickerPlacement, showArrows, arrowsShape, arrowsPlacement, editing, partMotion, }: Props): import("react").JSX.Element;
37
+ export default function HeroSection({ slides: Slides, strip: Strip, alignment, textureOpacity, showTexture, textureColor, phoneUpDown, phoneSideways, autoplay, autoplayInterval, showTicker, tickerItems, heightDesktop, heightTablet, heightMobile, showPicker, pickerShape, pickerPlacement, showArrows, arrowsShape, arrowsPlacement, editing, partMotion, }: Props): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as P}from"react/jsx-runtime";import{useCallback as v,useEffect as w,useId as Ae,useRef as d,useState as k}from"react";import{markOverlayPortal as te}from"../../format/lib/document/overlay-portal.js";import Ne from"./Ticker.js";import{HeroSlideStyleContext as Le}from"./HeroSlide.js";import Me from"./HeroArrows.js";import Ce from"./Reel.js";import{TICKER_PART_ATTR as Pe}from"./PreviewTickerContext.js";import{useReducedMotion as De}from"./useReducedMotion.js";import{hasSectionHeight as Ie,resolveSectionHeight as re}from"../../format/lib/content/section-height.js";import{HEADER_HEIGHT_CSS as Ve}from"../lib/document/header-clearance.js";import{nextReel as ze,normaliseHeroReelShape as $e,reelShown as Xe}from"../../format/lib/reel.js";import{arrowsShown as Ge,arrowStep as Ye}from"../../format/lib/hero-arrows.js";import{swipeEnabled as je,swipeStep as Be}from"../../format/lib/hero-swipe.js";import{videoControlShown as qe,videoHeld as Ke}from"../../format/lib/hero-video-control.js";import{HERO_SLIDER_GOTO_EVENT as D}from"efficient-easel/draw";import{say as oe}from"../../format/lib/editor-words.js";import{markedChildren as ne}from"../../format/lib/marked-children.js";import{legacyTickerDrawn as Fe,TICKER_MOTION_PART as Je}from"../../format/lib/hero-ticker.js";import{ON_MEDIA_INK_STYLE as Qe}from"../../format/lib/content/ink.js";import{SectionAnimation as Ue}from"./SectionAnimation.js";import{entranceDrawn as We}from"../lib/animation/entrance.js";import{readPartMotion as Ze}from"../lib/animation/part-motion.js";import{scrim as se}from"../../format/lib/content/scrim.js";const et="Play video",tt="Hold video",rt="flex h-7 cursor-pointer items-center gap-1.5 rounded-full border border-overlay-chrome/25 bg-overlay-scrim/80 px-[11px] font-mono text-[11px] leading-none tracking-[0.05em] text-overlay-fg",ot=()=>oe("item"),ce=new Map;function nt(m,a){const i=m?.ownerDocument?.defaultView;if(i)return i.addEventListener(D,a),()=>i.removeEventListener(D,a)}function st({slides:m,strip:a,alignment:i,textureOpacity:y,showTexture:E,textureColor:g,phoneUpDown:ae,phoneSideways:ie,autoplay:I,autoplayInterval:O,showTicker:le,tickerItems:V,heightDesktop:z,heightMobile:$,showPicker:ue,pickerShape:de,pickerPlacement:me,showArrows:fe,arrowsShape:he,arrowsPlacement:pe,editing:s,partMotion:ve}){const X=Ie(z,$),be=X?"h-[var(--sf-hero-h-m)] view-tablet:h-[var(--sf-hero-h-d)]":"h-screen min-h-[680px]",xe=X?{"--sf-hero-h-d":re(z),"--sf-hero-h-m":re($)}:void 0,G=(a?.blockCount??0)>0,we=!G&&Fe({showTicker:le,tickerItems:V}),Y=(V??[]).map(e=>e?.text?.trim()?e.text:s?ot():"").filter(Boolean),ke=We(Ze({_partMotion:ve},Je)),f=d(null),j=d(null),B=d(null),q=d(null),K=Ae(),H=d(K),[_,ye]=k([]),[Ee,F]=k(0),b=d(0),[J,Q]=k(!1),[ge,U]=k(null),[R,_e]=k(!1),A=De(),S=v(()=>f.current?.querySelector(".hero-track")??null,[]),l=v((e,t=!1)=>{F(e),U(o=>o===e?o:null),b.current=e,ce.set(H.current,e);const r=f.current?.querySelector(".hero-track");if(r)if(t){const o=r.style.transition;r.style.transition="none",r.style.transform=`translateX(-${Math.max(0,e)*100}%)`,r.offsetHeight,r.style.transition=o}else r.style.transform=`translateX(-${Math.max(0,e)*100}%)`},[]);w(()=>{const e=f.current,t=e?.getAttribute("data-easel-block")||e?.closest("[data-easel-block]")?.getAttribute("data-easel-block")||K;H.current=t;const r=ce.get(t);typeof r=="number"&&(F(r),b.current=r)},[]),w(()=>{const e=S();if(!e)return;const t=()=>{ye(o=>ze(o,ne(e,"data-slide-name")))};t();const r=new MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-slide-name","data-slide-process","data-slide-media"]}),()=>{r.disconnect()}},[S]),w(()=>{if(!s)return;const e=t=>{const r=t.detail;if(!r||typeof r.index!="number")return;const o=f.current,p=o?.getAttribute("data-easel-block")||o?.closest("[data-easel-block]")?.getAttribute("data-easel-block")||H.current;r.id&&r.id!==p||l(r.index,!0)};return nt(f.current,e)},[s,l]);const c=_.length,u=Math.min(Math.max(Ee,0),Math.max(0,c-1)),N=ge===u,L=Xe({shown:ue,count:c}),W=Ge({shown:fe,count:c}),Z=qe({editing:s,shown:u,slides:_}),Re=Ke({editing:s,playing:R,controlShown:Z}),T=je({count:c,editing:s}),h=d(null),x=d(null),Se=v(e=>{if(h.current=null,x.current=null,!T||e.touches.length!==1)return;const t=e.touches[0];h.current={x:t.clientX,y:t.clientY},x.current={x:t.clientX,y:t.clientY}},[T]),Te=v(e=>{if(!h.current)return;if(e.touches.length!==1){h.current=null;return}const t=e.touches[0];x.current={x:t.clientX,y:t.clientY}},[]),Oe=v(()=>{const e=h.current,t=x.current;if(h.current=null,x.current=null,!T||!e||!t)return;const r=Be(t.x-e.x,t.y-e.y,b.current,c);r!==b.current&&l(r)},[T,c,l]);w(()=>{if(s||!I||J||N||A||c<=1)return;const t=Math.max(1,typeof O=="number"?O:6)*1e3,r=window.setTimeout(()=>l((u+1)%c),t);return()=>window.clearTimeout(r)},[s,I,O,J,N,A,c,u,l]),w(()=>{const e=[j.current,B.current,q.current].filter(Boolean),t=e.map(o=>te(o)),r=o=>{const p=o.target,M=p.closest("[data-hero-nav]"),ee=M??p.closest("[data-idx]");if(!ee)return;o.stopPropagation(),o.preventDefault();const C=M?Ye(M.dataset.heroNav,b.current,c):Number(ee.dataset.idx);Number.isNaN(C)||(l(C,s),ne(S(),"data-slide-name")[C]?.click())};return e.forEach(o=>o.addEventListener("click",r,{capture:!0})),()=>{t.forEach(o=>o?.()),e.forEach(o=>o.removeEventListener("click",r,{capture:!0}))}},[c,l,S,s]);const He=v(e=>{if(!e)return;const t=te(e),r=o=>{o.stopPropagation(),o.preventDefault(),_e(p=>!p)};return e.addEventListener("click",r,{capture:!0}),()=>{t?.(),e.removeEventListener("click",r,{capture:!0})}},[]);return n(Le.Provider,{value:{alignment:i,textureOpacity:y,textureOn:E,textureColor:g,quietVideo:Re,phoneUpDown:ae,phoneSideways:ie,holdReel:()=>U(u),reelHeld:N},children:P("div",{ref:f,className:`relative mx-[var(--sf-hero-bleed-m,calc(50%_-_50vw))] w-[var(--sf-hero-bleed-w,100vw)] ${be} max-w-[var(--sf-hero-cap,none)] overflow-hidden`,style:xe,onMouseEnter:()=>Q(!0),onMouseLeave:()=>Q(!1),onTouchStart:Se,onTouchMove:Te,onTouchEnd:Oe,children:[n(m,{className:"hero-track flex h-full [&>*]:h-full [&>*]:min-w-full [&>*]:shrink-0 [&>*]:basis-full",style:{transform:`translateX(-${u*100}%)`,transition:A?"none":"transform 600ms cubic-bezier(.22,.61,.36,1)"},minEmptyHeight:400}),Z&&n("div",{ref:He,"data-hero-video-control":R?"playing":"held",className:"sf-hero-video-control absolute left-6 z-[7]",style:{top:`calc(${Ve} + 16px)`},children:P("button",{type:"button",className:rt,children:[n("span",{"aria-hidden":"true",children:R?"❚❚":"▶"}),oe(R?tt:et)]})}),(L||W)&&P("div",{className:"pointer-events-none absolute inset-y-0 left-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] right-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] z-[6] mx-auto max-w-[var(--sf-hero-chrome-cap,calc(var(--sf-site-width,1600px)_-_var(--sf-site-gutter,40px)*2))]",children:[L&&n(Ce,{ref:j,slides:_,active:u,shape:$e(de),placement:me}),W&&n(Me,{ref:q,shape:he,placement:pe})]}),L&&n("div",{ref:B,className:"sf-hero-phone-dots absolute bottom-[80px] left-1/2 z-[6] hidden -translate-x-1/2 items-center gap-2",children:_.map((e,t)=>n("button",{type:"button","data-idx":t,"aria-label":`Go to slide ${t+1}`,className:`h-2 rounded-full transition-all motion-reduce:transition-none ${t===u?"w-5 bg-accent":"w-2 bg-white/45 hover:bg-white/70"}`},t))}),G&&a&&n("div",{className:"sf-hero-strip absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10",style:{background:se(.55),...Qe},children:n(a,{})}),we&&Y.length>0&&n(ct,{editing:!!s,entrance:ke,children:n(Ne,{items:Y,backdrop:"dark-media"})})]})})}function ct({editing:m,entrance:a,children:i}){const y="sf-hero-ticker absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10 py-3.5",E=m?{[Pe]:""}:void 0,g={background:se(.55)};return a?n(Ue,{desktop:a.desktop,phone:a.phone,editing:m,boxClass:y,boxAttrs:E,boxStyle:g,children:i}):n("div",{className:y,...E,style:g,children:i})}export{D as HERO_SLIDER_GOTO_EVENT,tt as HERO_VIDEO_HOLD_LABEL,et as HERO_VIDEO_PLAY_LABEL,st as default,nt as subscribeSliderGoto};
1
+ "use client";import{jsx as n,jsxs as P}from"react/jsx-runtime";import{useCallback as v,useEffect as w,useId as Ne,useRef as d,useState as k}from"react";import{markOverlayPortal as W}from"../../format/lib/document/overlay-portal.js";import Ae from"./Ticker.js";import{HeroSlideStyleContext as He}from"./HeroSlide.js";import Le from"./HeroArrows.js";import Me from"./Reel.js";import{TICKER_PART_ATTR as Ce}from"./PreviewTickerContext.js";import{useReducedMotion as Pe}from"./useReducedMotion.js";import{heroHeightBox as De}from"../../format/lib/content/section-height.js";import{HEADER_HEIGHT_CSS as Ie}from"../lib/document/header-clearance.js";import{nextReel as Ve,normaliseHeroReelShape as $e,reelShown as ze}from"../../format/lib/reel.js";import{arrowsShown as Xe,arrowStep as Be}from"../../format/lib/hero-arrows.js";import{swipeEnabled as Ge,swipeStep as Ye}from"../../format/lib/hero-swipe.js";import{videoControlShown as je,videoHeld as qe}from"../../format/lib/hero-video-control.js";import{HERO_SLIDER_GOTO_EVENT as D}from"efficient-easel/draw";import{say as Z}from"../../format/lib/editor-words.js";import{markedChildren as ee}from"../../format/lib/marked-children.js";import{legacyTickerDrawn as Ke,TICKER_MOTION_PART as Fe}from"../../format/lib/hero-ticker.js";import{ON_MEDIA_INK_STYLE as Je}from"../../format/lib/content/ink.js";import{SectionAnimation as Qe}from"./SectionAnimation.js";import{entranceDrawn as Ue}from"../lib/animation/entrance.js";import{readPartMotion as We}from"../lib/animation/part-motion.js";import{scrim as te}from"../../format/lib/content/scrim.js";const Ze="Play video",et="Hold video",tt="flex h-7 cursor-pointer items-center gap-1.5 rounded-full border border-overlay-chrome/25 bg-overlay-scrim/80 px-[11px] font-mono text-[11px] leading-none tracking-[0.05em] text-overlay-fg",rt=()=>Z("item"),re=new Map;function ot(m,a){const l=m?.ownerDocument?.defaultView;if(l)return l.addEventListener(D,a),()=>l.removeEventListener(D,a)}function nt({slides:m,strip:a,alignment:l,textureOpacity:y,showTexture:E,textureColor:g,phoneUpDown:oe,phoneSideways:ne,autoplay:I,autoplayInterval:S,showTicker:se,tickerItems:V,heightDesktop:ce,heightTablet:ae,heightMobile:le,showPicker:ie,pickerShape:ue,pickerPlacement:de,showArrows:me,arrowsShape:fe,arrowsPlacement:he,editing:s,partMotion:pe}){const{className:ve,style:be}=De({heightDesktop:ce,heightTablet:ae,heightMobile:le}),$=(a?.blockCount??0)>0,xe=!$&&Ke({showTicker:se,tickerItems:V}),z=(V??[]).map(e=>e?.text?.trim()?e.text:s?rt():"").filter(Boolean),we=Ue(We({_partMotion:pe},Fe)),f=d(null),X=d(null),B=d(null),G=d(null),Y=Ne(),N=d(Y),[_,ke]=k([]),[ye,j]=k(0),b=d(0),[q,K]=k(!1),[Ee,F]=k(null),[R,ge]=k(!1),A=Pe(),T=v(()=>f.current?.querySelector(".hero-track")??null,[]),i=v((e,t=!1)=>{j(e),F(o=>o===e?o:null),b.current=e,re.set(N.current,e);const r=f.current?.querySelector(".hero-track");if(r)if(t){const o=r.style.transition;r.style.transition="none",r.style.transform=`translateX(-${Math.max(0,e)*100}%)`,r.offsetHeight,r.style.transition=o}else r.style.transform=`translateX(-${Math.max(0,e)*100}%)`},[]);w(()=>{const e=f.current,t=e?.getAttribute("data-easel-block")||e?.closest("[data-easel-block]")?.getAttribute("data-easel-block")||Y;N.current=t;const r=re.get(t);typeof r=="number"&&(j(r),b.current=r)},[]),w(()=>{const e=T();if(!e)return;const t=()=>{ke(o=>Ve(o,ee(e,"data-slide-name")))};t();const r=new MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-slide-name","data-slide-process","data-slide-media"]}),()=>{r.disconnect()}},[T]),w(()=>{if(!s)return;const e=t=>{const r=t.detail;if(!r||typeof r.index!="number")return;const o=f.current,p=o?.getAttribute("data-easel-block")||o?.closest("[data-easel-block]")?.getAttribute("data-easel-block")||N.current;r.id&&r.id!==p||i(r.index,!0)};return ot(f.current,e)},[s,i]);const c=_.length,u=Math.min(Math.max(ye,0),Math.max(0,c-1)),H=Ee===u,L=ze({shown:ie,count:c}),J=Xe({shown:me,count:c}),Q=je({editing:s,shown:u,slides:_}),_e=qe({editing:s,playing:R,controlShown:Q}),O=Ge({count:c,editing:s}),h=d(null),x=d(null),Re=v(e=>{if(h.current=null,x.current=null,!O||e.touches.length!==1)return;const t=e.touches[0];h.current={x:t.clientX,y:t.clientY},x.current={x:t.clientX,y:t.clientY}},[O]),Te=v(e=>{if(!h.current)return;if(e.touches.length!==1){h.current=null;return}const t=e.touches[0];x.current={x:t.clientX,y:t.clientY}},[]),Oe=v(()=>{const e=h.current,t=x.current;if(h.current=null,x.current=null,!O||!e||!t)return;const r=Ye(t.x-e.x,t.y-e.y,b.current,c);r!==b.current&&i(r)},[O,c,i]);w(()=>{if(s||!I||q||H||A||c<=1)return;const t=Math.max(1,typeof S=="number"?S:6)*1e3,r=window.setTimeout(()=>i((u+1)%c),t);return()=>window.clearTimeout(r)},[s,I,S,q,H,A,c,u,i]),w(()=>{const e=[X.current,B.current,G.current].filter(Boolean),t=e.map(o=>W(o)),r=o=>{const p=o.target,M=p.closest("[data-hero-nav]"),U=M??p.closest("[data-idx]");if(!U)return;o.stopPropagation(),o.preventDefault();const C=M?Be(M.dataset.heroNav,b.current,c):Number(U.dataset.idx);Number.isNaN(C)||(i(C,s),ee(T(),"data-slide-name")[C]?.click())};return e.forEach(o=>o.addEventListener("click",r,{capture:!0})),()=>{t.forEach(o=>o?.()),e.forEach(o=>o.removeEventListener("click",r,{capture:!0}))}},[c,i,T,s]);const Se=v(e=>{if(!e)return;const t=W(e),r=o=>{o.stopPropagation(),o.preventDefault(),ge(p=>!p)};return e.addEventListener("click",r,{capture:!0}),()=>{t?.(),e.removeEventListener("click",r,{capture:!0})}},[]);return n(He.Provider,{value:{alignment:l,textureOpacity:y,textureOn:E,textureColor:g,quietVideo:_e,phoneUpDown:oe,phoneSideways:ne,holdReel:()=>F(u),reelHeld:H},children:P("div",{ref:f,className:`relative mx-[var(--sf-hero-bleed-m,calc(50%_-_50vw))] w-[var(--sf-hero-bleed-w,100vw)] ${ve} max-w-[var(--sf-hero-cap,none)] overflow-hidden`,style:be,onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),onTouchStart:Re,onTouchMove:Te,onTouchEnd:Oe,children:[n(m,{className:"hero-track flex h-full [&>*]:h-full [&>*]:min-w-full [&>*]:shrink-0 [&>*]:basis-full",style:{transform:`translateX(-${u*100}%)`,transition:A?"none":"transform 600ms cubic-bezier(.22,.61,.36,1)"},minEmptyHeight:400}),Q&&n("div",{ref:Se,"data-hero-video-control":R?"playing":"held",className:"sf-hero-video-control absolute left-6 z-[7]",style:{top:`calc(${Ie} + 16px)`},children:P("button",{type:"button",className:tt,children:[n("span",{"aria-hidden":"true",children:R?"❚❚":"▶"}),Z(R?et:Ze)]})}),(L||J)&&P("div",{className:"pointer-events-none absolute inset-y-0 left-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] right-[var(--sf-hero-chrome-x,var(--sf-site-gutter,40px))] z-[6] mx-auto max-w-[var(--sf-hero-chrome-cap,calc(var(--sf-site-width,1600px)_-_var(--sf-site-gutter,40px)*2))]",children:[L&&n(Me,{ref:X,slides:_,active:u,shape:$e(ue),placement:de}),J&&n(Le,{ref:G,shape:fe,placement:he})]}),L&&n("div",{ref:B,className:"sf-hero-phone-dots absolute bottom-[80px] left-1/2 z-[6] hidden -translate-x-1/2 items-center gap-2",children:_.map((e,t)=>n("button",{type:"button","data-idx":t,"aria-label":`Go to slide ${t+1}`,className:`h-2 rounded-full transition-all motion-reduce:transition-none ${t===u?"w-5 bg-accent":"w-2 bg-white/45 hover:bg-white/70"}`},t))}),$&&a&&n("div",{className:"sf-hero-strip absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10",style:{background:te(.55),...Je},children:n(a,{})}),xe&&z.length>0&&n(st,{editing:!!s,entrance:we,children:n(Ae,{items:z,backdrop:"dark-media"})})]})})}function st({editing:m,entrance:a,children:l}){const y="sf-hero-ticker absolute inset-x-0 bottom-0 z-[5] border-t border-overlay-chrome/10 py-3.5",E=m?{[Ce]:""}:void 0,g={background:te(.55)};return a?n(Qe,{desktop:a.desktop,phone:a.phone,editing:m,boxClass:y,boxAttrs:E,boxStyle:g,children:l}):n("div",{className:y,...E,style:g,children:l})}export{D as HERO_SLIDER_GOTO_EVENT,et as HERO_VIDEO_HOLD_LABEL,Ze as HERO_VIDEO_PLAY_LABEL,nt as default,ot as subscribeSliderGoto};