efficient-web-builder 55.1.0 → 55.3.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 (159) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/editor/components/PartSettingsPanel.js +1 -1
  3. package/dist/editor/lib/document/block-source-fields.d.ts +1 -0
  4. package/dist/editor/lib/document/block-source-fields.js +1 -1
  5. package/dist/editor/lib/document/blocks/general/CardList/fields.js +1 -1
  6. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  7. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  8. package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
  9. package/dist/editor/lib/document/blocks/general/LogoBlock/fields.js +1 -1
  10. package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
  11. package/dist/editor/lib/document/blocks/general/ProcessSteps/fields.js +1 -1
  12. package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  14. package/dist/editor/lib/document/card-row-fields.d.ts +2 -1
  15. package/dist/editor/lib/document/card-row-fields.js +1 -1
  16. package/dist/editor/lib/document/choice-pictures.d.ts +2 -0
  17. package/dist/editor/lib/document/choice-pictures.js +1 -1
  18. package/dist/editor/lib/document/field-groups.js +1 -1
  19. package/dist/editor/lib/document/live-number-field.d.ts +5 -0
  20. package/dist/editor/lib/document/live-number-field.js +1 -1
  21. package/dist/editor/lib/document/mirror-cards-field.js +1 -1
  22. package/dist/editor/lib/document/part-anchors.js +1 -1
  23. package/dist/editor/lib/document/part-panel-rows.js +1 -1
  24. package/dist/editor/lib/host-document-bridge.d.ts +4 -1
  25. package/dist/editor/lib/host-document-bridge.js +1 -1
  26. package/dist/editor/lib/sections/text-layouts.d.ts +2 -1
  27. package/dist/editor/lib/sections/text-layouts.js +1 -1
  28. package/dist/format/lib/content/block-sources.d.ts +18 -2
  29. package/dist/format/lib/content/block-sources.js +1 -1
  30. package/dist/format/lib/content/box-background.d.ts +3 -0
  31. package/dist/format/lib/content/box-background.js +1 -1
  32. package/dist/format/lib/content/box-shape.d.ts +1 -1
  33. package/dist/format/lib/content/card-state.d.ts +6 -0
  34. package/dist/format/lib/content/card-state.js +1 -1
  35. package/dist/format/lib/content/card-template.d.ts +14 -1
  36. package/dist/format/lib/content/card-template.js +1 -1
  37. package/dist/format/lib/content/count-numbers.d.ts +1 -1
  38. package/dist/format/lib/content/count-numbers.js +1 -1
  39. package/dist/format/lib/content/footer.js +1 -1
  40. package/dist/format/lib/content/footprint.d.ts +1 -0
  41. package/dist/format/lib/content/footprint.js +1 -1
  42. package/dist/format/lib/content/image-text-rows.d.ts +22 -0
  43. package/dist/format/lib/content/image-text-rows.js +1 -0
  44. package/dist/format/lib/content/mirror-cards.d.ts +17 -0
  45. package/dist/format/lib/content/mirror-cards.js +1 -1
  46. package/dist/format/lib/content/view-lines.d.ts +1 -1
  47. package/dist/format/lib/document/blocks/general/CardList/meta.js +1 -1
  48. package/dist/format/lib/document/blocks/general/Footprint/card-seed.d.ts +2 -0
  49. package/dist/format/lib/document/blocks/general/Footprint/card-seed.js +1 -0
  50. package/dist/format/lib/document/blocks/general/Footprint/meta.d.ts +6 -0
  51. package/dist/format/lib/document/blocks/general/Footprint/meta.js +2 -2
  52. package/dist/format/lib/document/blocks/general/Logos/card-seed.d.ts +7 -0
  53. package/dist/format/lib/document/blocks/general/Logos/card-seed.js +1 -0
  54. package/dist/format/lib/document/blocks/general/Logos/meta.d.ts +11 -0
  55. package/dist/format/lib/document/blocks/general/Logos/meta.js +1 -1
  56. package/dist/format/lib/document/blocks/general/ProcessSteps/meta.d.ts +4 -0
  57. package/dist/format/lib/document/blocks/general/ProcessSteps/meta.js +1 -1
  58. package/dist/format/lib/document/blocks/general/ProcessSteps/row-seed.d.ts +11 -0
  59. package/dist/format/lib/document/blocks/general/ProcessSteps/row-seed.js +1 -0
  60. package/dist/format/lib/document/container-blocks.js +1 -1
  61. package/dist/format/lib/document/passes/document-position.d.ts +8 -0
  62. package/dist/format/lib/document/passes/document-position.js +1 -1
  63. package/dist/format/lib/document/row-hand.d.ts +5 -0
  64. package/dist/format/lib/document/row-hand.js +1 -0
  65. package/dist/format/lib/document/section-catalog.js +20 -2
  66. package/dist/format/lib/document/section-descriptions.js +1 -1
  67. package/dist/format/lib/document/seed-parts.d.ts +3 -0
  68. package/dist/format/lib/document/seed-parts.js +1 -1
  69. package/dist/format/lib/document/text-seeds.js +1 -1
  70. package/dist/format/lib/editor-words-catalogue.d.ts +38 -1
  71. package/dist/format/lib/editor-words-catalogue.js +6 -6
  72. package/dist/format/lib/editor-words-kept.d.ts +1 -0
  73. package/dist/format/lib/editor-words-kept.js +1 -0
  74. package/dist/format/lib/fonts.js +1 -1
  75. package/dist/format/lib/sections/strip-shape.js +1 -1
  76. package/dist/format/lib/sections/ticker-join.d.ts +1 -0
  77. package/dist/format/lib/sections/ticker-join.js +1 -1
  78. package/dist/format/lib/source-rules/editor-words.js +2 -2
  79. package/dist/format/lib/theme.d.ts +1 -0
  80. package/dist/format/lib/theme.js +3 -3
  81. package/dist/render/components/CardRowContext.d.ts +8 -2
  82. package/dist/render/components/CardRowContext.js +1 -1
  83. package/dist/render/components/ClientRows.d.ts +8 -0
  84. package/dist/render/components/ClientRows.js +1 -0
  85. package/dist/render/components/Flex.d.ts +3 -1
  86. package/dist/render/components/Flex.js +1 -1
  87. package/dist/render/components/Footprint.d.ts +4 -1
  88. package/dist/render/components/Footprint.js +1 -1
  89. package/dist/render/components/HeroPictures.d.ts +2 -2
  90. package/dist/render/components/JoinBox.d.ts +4 -0
  91. package/dist/render/components/JoinBox.js +1 -0
  92. package/dist/render/components/LogoBlock.js +1 -1
  93. package/dist/render/components/Logos.d.ts +4 -2
  94. package/dist/render/components/Logos.js +1 -1
  95. package/dist/render/components/MirrorContext.d.ts +12 -0
  96. package/dist/render/components/MirrorContext.js +1 -1
  97. package/dist/render/components/PartStyledKind.d.ts +2 -1
  98. package/dist/render/components/PartStyledKind.js +1 -1
  99. package/dist/render/components/PaymentBadges.js +1 -1
  100. package/dist/render/components/ProcessSteps.d.ts +5 -1
  101. package/dist/render/components/ProcessSteps.js +1 -1
  102. package/dist/render/components/Text.d.ts +3 -1
  103. package/dist/render/components/Text.js +1 -1
  104. package/dist/render/components/TickerSection.js +1 -1
  105. package/dist/render/lib/content/box-shared-columns.d.ts +6 -0
  106. package/dist/render/lib/content/box-shared-columns.js +1 -1
  107. package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
  108. package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
  109. package/dist/render/lib/document/blocks/general/Eyebrow/render.js +1 -1
  110. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  111. package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
  112. package/dist/render/lib/document/blocks/general/LogoBlock/render.js +1 -1
  113. package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
  114. package/dist/render/lib/document/blocks/general/ProcessSteps/render.d.ts +5 -0
  115. package/dist/render/lib/document/blocks/general/ProcessSteps/render.js +1 -1
  116. package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
  117. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  118. package/dist/render/lib/document/blocks/general/TitleWithButtons/render.js +1 -1
  119. package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
  120. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +3 -0
  121. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  122. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  123. package/dist/render/lib/document/blocks/general/section-to-box-rows-docbody.js +2 -2
  124. package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
  125. package/dist/render/lib/document/blocks/general/section-to-box-rows-fitment.d.ts +2 -0
  126. package/dist/render/lib/document/blocks/general/section-to-box-rows-fitment.js +1 -0
  127. package/dist/render/lib/document/blocks/general/section-to-box-rows-forms.d.ts +2 -0
  128. package/dist/render/lib/document/blocks/general/section-to-box-rows-forms.js +1 -0
  129. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.d.ts +2 -0
  130. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
  131. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  132. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.d.ts +1 -0
  133. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
  134. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.d.ts +1 -0
  135. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
  136. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.d.ts +5 -0
  137. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
  138. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.d.ts +1 -1
  139. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
  140. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
  141. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  142. package/dist/render/lib/document/head-core-boxes.js +1 -1
  143. package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
  144. package/dist/render/lib/document/part-styles.d.ts +2 -0
  145. package/dist/render/lib/document/part-styles.js +2 -2
  146. package/dist/render/lib/document/passes/box-join.d.ts +2 -0
  147. package/dist/render/lib/document/passes/box-join.js +1 -0
  148. package/dist/render/lib/document/passes/clickable-parts.js +1 -1
  149. package/dist/render/lib/document/passes/index.js +1 -1
  150. package/dist/render/lib/document/passes/section-width.js +1 -1
  151. package/dist/render/lib/document/text-parts.d.ts +2 -1
  152. package/dist/render/lib/document/text-parts.js +1 -1
  153. package/dist/render/lib/sections/card-list-style.d.ts +18 -0
  154. package/dist/render/lib/sections/card-list-style.js +1 -0
  155. package/dist/render/lib/sections/payment-rows.d.ts +16 -0
  156. package/dist/render/lib/sections/payment-rows.js +1 -0
  157. package/dist/render/lib/sections/section-to-box.d.ts +3 -0
  158. package/dist/render/lib/sections/section-to-box.js +1 -1
  159. package/package.json +1 -1
@@ -1 +1 @@
1
- import{anchorFields as m,bucketHeader as L,cardMediaFields as Y,cardShowFields as U,cardStyleFields as W,designGroupHeader as F,foldMarker as z,foldMetaOf as h,quietMarker as q,heightFields as E,sectionShapeFields as w,sectionThemeFields as O,stickFields as x,widthField as D}from"./controls.js";import{group as J}from"efficient-easel/screen/lib/document/box-fields";import{sidesPaddingFields as T}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as B}from"../animation/entrance-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as V}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=V;function X(e){return e==="Animation"?"Animation":"Design"}const Z="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content","Card list":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content",Display:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content",Source:"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design",Overlay:"Design","Text style":"Design",Entrance:"Animation",Hover:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[Z]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Size:"Size",Height:"Size"},$={"AlloyWheelsListing._gCards":"Design","ProductGrid._gCards":"Design"},G={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return G[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(a):void 0}function H(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const o of e)for(const a of Object.values(o)){const C=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of H(l))t.includes(p)||t.push(p)}return t}const pe=[...S(T({tablet:!0}),D("full"),E(),m(),x()),...Object.keys(T({tablet:!0})),...Object.keys(D("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],_e=[...S(B()),...Object.keys(B())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...H(_("ProductGrid","_gCards","Cards")??"Design"),...ee.filter(e=>e.startsWith("_g")||te.has(e))],ve=Object.keys(W()),fe=Object.keys(U()),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T({tablet:!0}),...D("full"),...E(),...m(),...O(),...w(),...B()};for(const t of Object.keys(M)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!K[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const oe=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ae=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function me(e){const t=new Set([...Object.values(d),b.Content]);for(const[o,a]of Object.entries(e))if(!t.has(o)&&h(a)?.level===1)return 1;return 2}function ie(e){const t=`${e}.`;return Object.keys(ne).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function re(e,t){const o=P(e),a=J(t);return o?Q(o.tier,a):a}function de(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?z(t,o.label):q(t):t}function j(e){return e==="Design"?k:["Animation"]}function Le(e,t){const o=[],a=new Set(ie(t)),C=new Set;let g=!1,l=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(oe.has(n))throw new Error(`${t}.${n}: that key was a tab header until efficient-web-builder 11.0.0, when the panel moved to two tabs (Design · Animation). Its tab is gone, so the key may not come back. Give the heading a key of the section's own (\`_g…\`), or open a Design group with its own key (\`_dDesign: section("Design")\`, \`_dLayout: section("Layout")\`).`);const c=ae.get(n);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${n}: that key is reserved for the ${c} heading of the settings panel, but this field is ${i?`a level-${i.level} "${i.label}" header`:"not a header"}, so it cannot serve as one. Rename the section's own field.`);(n===d.Design||n===d.Animation)&&(g=!0),o.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||o.push(l={place:"Content",entries:[]}),l.entries.push([n,r]);continue}if(a.has(n)||n in M){const s=_(t,n,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(n)&&C.add(n),o.push(l={place:s,entries:[]});continue}const u=_(t,n,i.label);if(!u)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);o.push(l={place:u,entries:[[n,i.level===2?r:re(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,n])=>h(n)).map(([n])=>n));for(const[n,r]of[["BLOCK_KEY_GROUP",G],["KEY_GROUP",$]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${n} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>j(n).some(r=>R.has(r))),y={};for(const n of f){y[d[n]]=L(n,n===f[0]?f:null);for(const r of j(n)){if(!R.has(r))continue;const i=o.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const u of i)for(const[s,N]of u.entries)y[s]=de(r,N)}}return y}function Ee(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:F("Content"),...e}}function we(e){return A.some(t=>d[t]in e)}function Oe(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const o={...e};for(const a of t)o[d[a]]=L(a,a===t[0]?t:null);return o}export{G as BLOCK_KEY_GROUP,Se as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,ee as CARD_MEDIA_FIELD_KEYS,fe as CARD_SHOW_FIELD_KEYS,ve as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,Z as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,$ as KEY_GROUP,I as LABEL_GROUP,pe as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,_e as SECTION_ANIM_FIELD_KEYS,ke as SECTION_SHAPE_FIELD_KEYS,ye as SECTION_THEME_FIELD_KEYS,Le as assignSectionGroups,ge as bucketOf,X as bucketOfPlace,me as foldTopTier,we as hasBucketTabs,S as headerKeysOf,H as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
1
+ import{anchorFields as m,bucketHeader as L,cardMediaFields as Y,cardShowFields as U,cardStyleFields as W,designGroupHeader as F,foldMarker as z,foldMetaOf as h,quietMarker as q,heightFields as E,sectionShapeFields as w,sectionThemeFields as O,stickFields as x,widthField as D}from"./controls.js";import{group as J}from"efficient-easel/screen/lib/document/box-fields";import{sidesPaddingFields as T}from"./box-fields.js";import{deviceField as Q,deviceMetaOf as P}from"efficient-easel/screen/lib/document/device-fields";import{entranceFields as B}from"../animation/entrance-fields.js";import{DESIGN_GROUPS as k,SETTINGS_BUCKETS as V}from"efficient-easel/panel";import{BUCKET_KEY as d,DESIGN_GROUP_KEY as b}from"efficient-easel/screen/lib/document/field-buckets";const A=V;function X(e){return e==="Animation"?"Animation":"Design"}const Z="Editor only — not shown live",I={"Archive link":"Content",Article:"Content",Blocks:"Content","Blog posts":"Content","Browser mock":"Content",Button:"Content","Call to action":"Content","Car prompt":"Content","Card link":"Content","Card list":"Content",Cards:"Content","Claims bars":"Content","Contact info":"Content",Content:"Content",Display:"Content","Content source":"Content",Contents:"Content",Filters:"Content","Show on a card":"Content",Footnote:"Content",Form:"Content",Founders:"Content","Gallery A":"Content","Gallery B":"Content","Gallery link":"Content",Header:"Content","Header link":"Content","Image caption":"Content","In this issue":"Content",Items:"Content","Kanban columns":"Content",Lead:"Content","Left panel":"Content",Link:"Content",Links:"Content",List:"Content","Message form":"Content",Metadata:"Content",Milestones:"Content","Mockup card":"Content","Newsletter panel":"Content",Offices:"Content",Options:"Content","Others gallery":"Content","Overlay button":"Content",Product:"Content","Product page":"Content",Products:"Content","Pull quote":"Content",Questions:"Content","Recent issues":"Content","Recent posts":"Content",Reviews:"Content","Right panel · actions":"Content","Right panel · choices":"Content","Right panel · form":"Content","Routing groups":"Content",Rows:"Content",Search:"Content",Section:"Content","Section header":"Content",Sections:"Content","Signup form":"Content",Source:"Content","Source product":"Content","Stat & note":"Content",Stats:"Content","Submit button":"Content","Success state":"Content",Wheel:"Content",Terminal:"Content",Text:"Content","Text column":"Content","Timeline entries":"Content","Top row":"Content",Total:"Content","Trailing note":"Content","“Other” reason":"Content","Background images":"Design",Gallery:"Content",Image:"Content","Image column":"Content",Images:"Content",Logo:"Content",Map:"Content",Media:"Content","Background image":"Design",Color:"Design","Image tint":"Design",Style:"Design",Shape:"Design",Shadow:"Design",Texture:"Design",Overlay:"Design","Text style":"Design",Entrance:"Animation",Hover:"Animation",Anchor:"Anchor",Arrangement:"Layout","Auto-slide":"Layout",Bar:"Layout","Cell width":"Size",Behavior:"Layout",Schedule:"Layout",Controls:"Layout",Diagram:"Layout",[Z]:"Layout","Filters shown":"Layout","Slide picker":"Layout",Arrows:"Layout","On a phone":"Layout",Placement:"Position",Nudge:"Position","Stick to top":"Position","Image gallery":"Layout",Grid:"Layout",Layout:"Layout",Padding:"Layout",Price:"Layout",Preview:"Layout",Setup:"Layout","Show / hide elements":"Layout","Show in the buy box":"Layout",Visibility:"Layout",Width:"Size",Size:"Size",Height:"Size"},$={"AlloyWheelsListing._gCards":"Design"},H={"Text._gSpacing":"Size","Heading._gSpacing":"Size"};function _(e,t,o){const a=`${e}.${t}`;return H[a]??$[a]??I[o]}function ge(e,t,o){const a=_(e,t,o);return a?X(a):void 0}function G(e){return e==="Animation"?[d.Animation]:[d.Design,b[e]]}function S(...e){const t=[];for(const o of e)for(const a of Object.values(o)){const C=P(a),g=h(C?C.inner:a),l=g?I[g.label]:void 0;if(l)for(const p of G(l))t.includes(p)||t.push(p)}return t}const pe=[...S(T({tablet:!0}),D("full"),E(),m(),x()),...Object.keys(T({tablet:!0})),...Object.keys(D("full")),...Object.keys(E()),...Object.keys(m()),...Object.keys(x())],ye=[...S(O()),...Object.keys(O())],ke=[...S(w()),...Object.keys(w())],_e=[...S(B()),...Object.keys(B())],ee=Object.keys(Y()),te=new Set(["cardImage","imageBackground"]),Se=[...G(_("ProductGrid","_gCards","Cards")??"Design"),...ee.filter(e=>e.startsWith("_g")||te.has(e))],ve=Object.keys(W()),fe=Object.keys(U()),ne={"ImageBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","ButtonBlock._gStyle":"duplicated the Style bucket header above it (2026-09-04)","HeroGroup._gContent":"duplicated the Content bucket header above it (2026-09-04)","HeroGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","Footer._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterLogo._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterLogo._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterMenu._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterMenu._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterGroup._gLayout":"duplicated the Layout bucket header above it (2026-09-04)","FooterText._gContent":"duplicated the Content bucket header above it (2026-09-04)","FooterText._gStyle":"duplicated the Style bucket header above it (2026-09-04)","FooterSocial._gStyle":"duplicated the Style bucket header above it (born tabbed, 2026-09-17)","FooterSocial._gLayout":"duplicated the Layout bucket header above it (born tabbed, 2026-09-17)","MenuBlock._gContent":"duplicated the Content bucket header above it (born tabbed, H.1)","MenuBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.1)","SocialLogosBlock._gLayout":"duplicated the Layout bucket header above it (born tabbed, H.1)","SearchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CartBlock._gStyle":"duplicated the Style bucket header above it (born tabbed, H.2)","CountrySwitchBlock._gStyle":"duplicated the Style bucket header above it (born tabbed with its Show as, 2026-10-17)","Split._gContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gVehicleContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gWheelContent":"duplicated the Content bucket header above it (2026-09-04)","Gallery._gOthersContent":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gHeadCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gLeftCopy":"duplicated the Content bucket header above it (2026-09-04)","Subscribe._gRightCopy":"duplicated the Content bucket header above it (2026-09-04)","CollectionCard._gContent":"duplicated the Content bucket header above it (A Card Sets Its Own Corners)","HeroSlide._gContent":"duplicated the Content bucket header above it (Hero Slide Tabs And Theme)","KeyFeatures._gContent":"duplicated the Content bucket header above it (66049)","KeyFeatures._gStyle":"duplicated the Style bucket header above it (66049)","ParagraphsA._gContent":"duplicated the Content bucket header above it (66049)","ParagraphsA._gStyle":"duplicated the Style bucket header above it (66049)","Chart._gContent":"duplicated the Content bucket header above it (66049)","Chart._gStyle":"duplicated the Style bucket header above it (66049)","Logos._gContent":"duplicated the Content bucket header above it (66049)","Logos._gStyle":"duplicated the Style bucket header above it (66049)","Mockup._gContent":"duplicated the Content bucket header above it (66049)","Mockup._gStyle":"duplicated the Style bucket header above it (66049)","Stats._gContent":"duplicated the Content bucket header above it (66049)","Stats._gStyle":"duplicated the Style bucket header above it (66049)","StatsParagraph._gContent":"duplicated the Content bucket header above it (66049)","StatsParagraph._gStyle":"duplicated the Style bucket header above it (66049)","Testimonials._gContent":"duplicated the Content bucket header above it (66049)","Testimonials._gStyle":"duplicated the Style bucket header above it (66049)","AppointmentBooking._gContent":"duplicated the Content bucket header above it (66050)","BookingBox._gContent":"duplicated the Content bucket header above it ([SPLIT] Booking Form Into Three Boxes) — the same fault its own section retired in 66050, one level down","FAQ._gContent":"duplicated the Content bucket header above it (66050, family sweep)","FAQ._gLayout":"duplicated the Layout bucket header above it (66050, family sweep)","Form._gContent":"duplicated the Content bucket header above it (66050)","ReviewForm._gContent":"duplicated the Content bucket header above it (66050)","SubmitBuild._gContent":"duplicated the Content bucket header above it (66050)","SubmitBox._gContent":"duplicated the Content bucket header above it ([SPLIT] SubmitBuild Keeps Its Two Columns) — the same fault its own section retired in 66050, one level down","CheckoutCTA._gContent":"duplicated the Content bucket header above it (66051)","CheckoutCTA._gLayout":"duplicated the Layout bucket header above it (66051)","DeliveryOptions._gContent":"duplicated the Content bucket header above it (66051)","DeliveryOptions._gLayout":"duplicated the Layout bucket header above it (66051)","OrderSummary._gContent":"duplicated the Content bucket header above it (66051)","OrderSummary._gLayout":"duplicated the Layout bucket header above it (66051)","PaymentBadges._gContent":"duplicated the Content bucket header above it (66051)","PaymentBadges._gLayout":"duplicated the Layout bucket header above it (66051)","Collections._gContent":"duplicated the Content bucket header above it (66052)","Collections._gLayout":"duplicated the Layout bucket header above it (66052)","DocMasthead._gContent":"duplicated the Content bucket header above it (66053)","Events._gContent":"duplicated the Content bucket header above it (66054)","Events._gLayout":"duplicated the Layout bucket header above it (66054)","FeaturedCover._gContent":"duplicated the Content bucket header above it (66054)","Series._gStyle":"duplicated the Style bucket header above it (66054)","Flex._gContent":"duplicated the Content bucket header above it (66055)","Flex._gLayout":"duplicated the Layout bucket header above it (66055)","SectionHeader._gContent":"duplicated the Content bucket header above it (66055)","Breadcrumb._gContent":"duplicated the Content bucket header above it (66056)","CategoryBar._gStyle":"duplicated the Style bucket header above it (66056)","Hero._gContent":"duplicated the Content bucket header above it (66056)","Hero._gStyle":"duplicated the Style bucket header above it (66056)","HeroSingle._gStyle":"duplicated the Style bucket header above it (66056)","IntroBleed._gContent":"duplicated the Content bucket header above it (66056)","IntroBleed._gLayout":"duplicated the Layout bucket header above it (66056)","BundleOffer._gLayout":"duplicated the Layout bucket header above it (66059)","ProcessSteps._gContent":"duplicated the Content bucket header above it (66059)","Banner._gContent":"duplicated the Content bucket header above it (66060.1)","Banner._gLayout":"duplicated the Layout bucket header above it, and governed no controls (66060.1)","Manifesto._gContent":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gHeadCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gLeftCopy":"duplicated the Content bucket header above it (66060.1)","SubscribeBlogs._gRightCopy":"duplicated the Content bucket header above it (66060.1)","Ticker._gContent":"duplicated the Content bucket header above it (66060.1)","Ticker._gStyle":"duplicated the Style bucket header above it (66060.1)","Timeline._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gContent":"duplicated the Content bucket header above it (66060.1)","TitleWithButtons._gStyle":"duplicated the Style bucket header above it (66060.1)","Cards._gContent":"duplicated the Content bucket header above it (66218)","Cards._gStyle":"duplicated the Style bucket header above it (66218)","Prose._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gContent":"duplicated the Content bucket header above it (66218)","Reviews._gStyle":"duplicated the Style bucket header above it (66218)"},K={Content:["Content"],Size:["Size"],Design:["Design","Style"],Layout:["Layout"],Position:["Position"],Anchor:["Anchor"],Animation:["Animation"]},M={_gAnchor:"repeated the Anchor group heading above it (two tabs, 11.0.0)"};{const e={...T({tablet:!0}),...D("full"),...E(),...m(),...O(),...w(),...B()};for(const t of Object.keys(M)){const o=h(e[t]),a=o?I[o.label]:void 0;if(!o||o.level!==2||!a||!K[a].includes(o.label))throw new Error(`INJECTED_RETIRED (lib/document/field-groups.ts) lists "${t}", but no uniform builder makes a level-2 heading by that key whose label repeats its place's word. The heading was renamed, moved or removed and the row is stale — a list that quietly matches nothing is worse than no list.`)}}const oe=new Set(["_sContent","_sStyle","_sLayout","_sMedia"]),ae=new Map([[d.Design,"Content"],[d.Animation,"Animation"],...k.map(e=>[b[e],e])]);function me(e){const t=new Set([...Object.values(d),b.Content]);for(const[o,a]of Object.entries(e))if(!t.has(o)&&h(a)?.level===1)return 1;return 2}function ie(e){const t=`${e}.`;return Object.keys(ne).filter(o=>o.startsWith(t)).map(o=>o.slice(t.length))}function re(e,t){const o=P(e),a=J(t);return o?Q(o.tier,a):a}function de(e,t){const o=h(t);return o?e==="Content"||e==="Animation"?z(t,o.label):q(t):t}function j(e){return e==="Design"?k:["Animation"]}function Le(e,t){const o=[],a=new Set(ie(t)),C=new Set;let g=!1,l=null;for(const[n,r]of Object.entries(e)){const i=h(r);if(oe.has(n))throw new Error(`${t}.${n}: that key was a tab header until efficient-web-builder 11.0.0, when the panel moved to two tabs (Design · Animation). Its tab is gone, so the key may not come back. Give the heading a key of the section's own (\`_g…\`), or open a Design group with its own key (\`_dDesign: section("Design")\`, \`_dLayout: section("Layout")\`).`);const c=ae.get(n);if(c!==void 0){if(i?.level!==1)throw new Error(`${t}.${n}: that key is reserved for the ${c} heading of the settings panel, but this field is ${i?`a level-${i.level} "${i.label}" header`:"not a header"}, so it cannot serve as one. Rename the section's own field.`);(n===d.Design||n===d.Animation)&&(g=!0),o.push(l={place:c,entries:[],adopted:!0});continue}if(!i){l||o.push(l={place:"Content",entries:[]}),l.entries.push([n,r]);continue}if(a.has(n)||n in M){const s=_(t,n,i.label);if(i.level!==2||!s||!K[s].includes(i.label))throw new Error(`${t}.${n}: ${a.has(n)?"RETIRED":"INJECTED_RETIRED"} (lib/document/field-groups.ts) lists this sub-heading as one whose name repeats the place it sits in, but it is a level-${i.level} "${i.label}" header in the ${s??"(unclassified)"} place. Only a level-2 header whose label is one of its place's words (PLACE_WORDS) may be retired — anything else is a heading a merchant reads for its own sake. Fix the row or drop it.`);a.has(n)&&C.add(n),o.push(l={place:s,entries:[]});continue}const u=_(t,n,i.label);if(!u)throw new Error(`${t}.${n}: the inspector group "${i.label}" is not classified in LABEL_GROUP (lib/document/field-groups.ts), so there is no way to say which of ${[...k,"Animation"].join(" / ")} its controls belong under. Classify it — an unclassified group silently lands wherever it was declared, which is the whole bug.`);o.push(l={place:u,entries:[[n,i.level===2?r:re(r,i.label)]]})}const p=new Set(Object.entries(e).filter(([,n])=>h(n)).map(([n])=>n));for(const[n,r]of[["BLOCK_KEY_GROUP",H],["KEY_GROUP",$]]){const i=Object.keys(r).filter(c=>c.startsWith(`${t}.`)).filter(c=>!p.has(c.slice(t.length+1)));if(i.length)throw new Error(`${t}: ${n} (lib/document/field-groups.ts) lists ${JSON.stringify(i)}, but no fold header by that key is in this section's panel. Either the heading was renamed or removed and the row is stale, or the row names the wrong key — an override that quietly matches nothing is worse than no override.`)}const v=g?[]:[...a].filter(n=>!C.has(n));if(v.length)throw new Error(`${t}: RETIRED (lib/document/field-groups.ts) lists ${JSON.stringify(v)}, but this section has no such fold header${v.length>1?"s":""}. Either the heading was renamed or removed and the row is stale, or the row names the wrong section — a list that quietly matches nothing is worse than no list.`);const R=new Set(o.filter(n=>n.entries.length>0).map(n=>n.place)),f=A.filter(n=>j(n).some(r=>R.has(r))),y={};for(const n of f){y[d[n]]=L(n,n===f[0]?f:null);for(const r of j(n)){if(!R.has(r))continue;const i=o.filter(u=>u.place===r),c=i.findIndex(u=>u.adopted);c>0&&i.unshift(...i.splice(c,1)),n==="Design"&&(y[b[r]]=F(r));for(const u of i)for(const[s,N]of u.entries)y[s]=de(r,N)}}return y}function Ee(e){return d.Design in e?e:{[d.Design]:L("Design",null),[b.Content]:F("Content"),...e}}function we(e){return A.some(t=>d[t]in e)}function Oe(e){const t=A.filter(a=>d[a]in e);if(t.length===0)return e;const o={...e};for(const a of t)o[d[a]]=L(a,a===t[0]?t:null);return o}export{H as BLOCK_KEY_GROUP,Se as BOUND_CARD_MEDIA_FIELD_KEYS,A as BUCKETS,d as BUCKET_KEY,ee as CARD_MEDIA_FIELD_KEYS,fe as CARD_SHOW_FIELD_KEYS,ve as CARD_STYLE_FIELD_KEYS,k as DESIGN_GROUPS,b as DESIGN_GROUP_KEY,Z as EDITOR_ONLY_GROUP,M as INJECTED_RETIRED,$ as KEY_GROUP,I as LABEL_GROUP,pe as LAYOUT_FIELD_KEYS,K as PLACE_WORDS,ne as RETIRED,_e as SECTION_ANIM_FIELD_KEYS,ke as SECTION_SHAPE_FIELD_KEYS,ye as SECTION_THEME_FIELD_KEYS,Le as assignSectionGroups,ge as bucketOf,X as bucketOfPlace,me as foldTopTier,we as hasBucketTabs,S as headerKeysOf,G as headerKeysOfPlace,_ as placeOf,Oe as reseatBucketTabs,ie as retiredHeadings,Ee as seatDesignBucket};
@@ -1,5 +1,7 @@
1
+ import { type ReactNode } from "react";
1
2
  import type { DropdownMenuEntry } from "efficient-shell/ui";
2
3
  import { type SourceChoice } from "../../../format/lib/content/block-sources.js";
4
+ import { type CustomField } from "./controls.js";
3
5
  export declare function liveNumberMenu(choices: readonly SourceChoice[], onLink: (key: string) => void): DropdownMenuEntry[];
4
6
  export declare function LiveNumberBox({ id, text, countKey, choices, onText, onLink, }: {
5
7
  id: string;
@@ -9,4 +11,7 @@ export declare function LiveNumberBox({ id, text, countKey, choices, onText, onL
9
11
  onText: (next: string) => void;
10
12
  onLink: (key: string) => void;
11
13
  }): import("react").JSX.Element;
14
+ export declare const ROW_LIVE_NUMBER_FIELD: CustomField<string> & {
15
+ icon: ReactNode;
16
+ };
12
17
  export declare function withLiveNumberRow<F extends Record<string, unknown>>(fields: F, props: Record<string, unknown> | undefined): F;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useId as b}from"react";import{useEasel as v,useSelectedHost as y}from"efficient-easel/easel";import{CloseIcon as C,LinkIcon as x,LockIcon as k}from"efficient-easel/icons";import{SettingsField as N}from"efficient-easel/panel";import{deviceField as h,deviceNote as O}from"efficient-easel/screen/lib/document/device-fields";import{Input as s}from"efficient-shell/ui";import{namedRowField as g}from"../../../format/lib/content/card-template.js";import{COUNT_KEY_PROP as c,COUNTS_SOURCE as I,sourceChoices as R}from"../../../format/lib/content/block-sources.js";import{consentWordsOf as S}from"../../../format/lib/content/consent-banner.js";import{countsReachText as w,countWords as d,linkedCount as _}from"../../../format/lib/content/count-numbers.js";import{readHidable as E,useSelectedSibling as L}from"./controls.js";import{partValueWithText as T}from"../../../render/lib/document/part-text.js";import{say as i}from"../../../format/lib/editor-words.js";const f=(e,t)=>t==="number"?`${d(e.value)} · ${i(e.label)}`:`${i(e.label)} · ${d(e.value)}`;function W(e,t){return[{type:"label",key:"heading",label:i("Live numbers")},...e.map(n=>({key:n.key,label:f(n,"name"),onSelect:()=>t(n.key)}))]}function F({id:e,text:t,countKey:n,choices:r,onText:u,onLink:a}){const l=n?r.find(m=>m.key===n):void 0;return o("div",{className:"sf-copybox",children:n?o(s,{id:e,readOnly:!0,value:l?f(l,"number"):t,leftIcon:o(k,{size:16}),endAction:{label:i("Unlink"),icon:o(C,{size:16}),onClick:()=>a("")}}):o(s,{id:e,value:t,onChange:m=>u(m.target.value),endAction:r.length?{label:i("Connect to a live number"),icon:o(x,{size:16}),menu:W(r,a)}:void 0})})}function U(){const e=y();try{return v(t=>w(t.appState.data.content,e?.id))}catch{return!0}}function $({value:e,onChange:t}){const n=b(),[r,u]=L(c),a=U();return o(N,{label:i("Body"),htmlFor:n,children:o(F,{id:n,text:E(e).text,countKey:_({[c]:r}),choices:a?R(I):z,onText:l=>t(T("textarea",e,l)),onLink:u})})}const j=O(),z=[],p=new WeakMap;function H(e){let t=p.get(e);if(!t){const n={...e,render:({value:r,onChange:u})=>o($,{value:r,onChange:u})};t=h("desktop",n),p.set(e,t)}return t}function ee(e,t){if(typeof t?.[c]!="string"||S(t)!==null||g(t))return e;const n=e.text;return!n||typeof n!="object"?e:{_dDevice:j,...e,text:H(n)}}export{F as LiveNumberBox,W as liveNumberMenu,ee as withLiveNumberRow};
1
+ import{jsx as o}from"react/jsx-runtime";import{useId as f}from"react";import{useEasel as R,useSelectedHost as O}from"efficient-easel/easel";import{CloseIcon as g,LinkIcon as b,LockIcon as w}from"efficient-easel/icons";import{SettingsField as p}from"efficient-easel/panel";import{deviceField as E,deviceNote as I}from"efficient-easel/screen/lib/document/device-fields";import{Input as s}from"efficient-shell/ui";import{namedRowField as L}from"../../../format/lib/content/card-template.js";import{COUNT_KEY_PROP as a,COUNTS_SOURCE as y,sourceChoices as v}from"../../../format/lib/content/block-sources.js";import{consentWordsOf as _}from"../../../format/lib/content/consent-banner.js";import{countsReachText as S,countWords as h,linkedCount as k}from"../../../format/lib/content/count-numbers.js";import{readHidable as T,useSelectedSibling as F}from"./controls.js";import{partValueWithText as W}from"../../../render/lib/document/part-text.js";import{say as u}from"../../../format/lib/editor-words.js";const d=(e,n)=>n==="number"?`${h(e.value)} · ${u(e.label)}`:`${u(e.label)} · ${h(e.value)}`;function U(e,n){return[{type:"label",key:"heading",label:u("Live numbers")},...e.map(t=>({key:t.key,label:d(t,"name"),onSelect:()=>n(t.key)}))]}const x=(e,n)=>e.length?{label:u("Connect to a live number"),icon:o(b,{size:16}),menu:U(e,n)}:void 0,C=(e,n,t)=>o(s,{id:e,readOnly:!0,value:n,leftIcon:o(w,{size:16}),endAction:{label:u("Unlink"),icon:o(g,{size:16}),onClick:()=>t("")}});function $({id:e,text:n,countKey:t,choices:i,onText:r,onLink:c}){const l=t?i.find(m=>m.key===t):void 0;return o("div",{className:"sf-copybox",children:t?C(e,l?d(l,"number"):n,c):o(s,{id:e,value:n,onChange:m=>r(m.target.value),endAction:x(i,c)})})}function j({id:e,countKey:n,onLink:t}){const i=v(y),r=k({[a]:n}),c=r?i.find(l=>l.key===r):void 0;return o("div",{className:"sf-copybox",children:r?C(e,c?d(c,"number"):r,t):o(s,{id:e,readOnly:!0,value:u("Typed by hand"),endAction:x(i,t)})})}const re={type:"custom",icon:o(b,{}),render:({value:e,onChange:n})=>o(z,{value:e,onChange:n})};function z({value:e,onChange:n}){const t=f();return o(p,{label:u("Live number"),htmlFor:t,children:o(j,{id:t,countKey:typeof e=="string"?e:"",onLink:n})})}function A(){const e=O();try{return R(n=>S(n.appState.data.content,e?.id))}catch{return!0}}function B({value:e,onChange:n}){const t=f(),[i,r]=F(a),c=A();return o(p,{label:u("Body"),htmlFor:t,children:o($,{id:t,text:T(e).text,countKey:k({[a]:i}),choices:c?v(y):H,onText:l=>n(W("textarea",e,l)),onLink:r})})}const D=I(),H=[],N=new WeakMap;function K(e){let n=N.get(e);if(!n){const t={...e,render:({value:i,onChange:r})=>o(B,{value:i,onChange:r})};n=E("desktop",t),N.set(e,n)}return n}function ie(e,n){if(typeof n?.[a]!="string"||_(n)!==null||L(n))return e;const t=e.text;return!t||typeof t!="object"?e:{_dDevice:D,...e,text:K(t)}}export{$ as LiveNumberBox,re as ROW_LIVE_NUMBER_FIELD,U as liveNumberMenu,ie as withLiveNumberRow};
@@ -1 +1 @@
1
- "use client";import{jsx as i}from"react/jsx-runtime";import{SettingsDefaultReset as C,SettingsField as S}from"efficient-easel/panel";import{Segmented as O}from"efficient-shell/ui";import{SwapIcon as _}from"efficient-easel/icons";import{describedAs as I}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as A}from"efficient-easel/screen/lib/document/device-fields";import{MIRROR_CARDS_LABEL as s,MIRROR_CARDS_OFF as a,MIRROR_CARDS_OPTIONS as p,MIRROR_CARDS_TITLES as b,mirrorCardsActs as d,mirrorCardsOf as l,mirrorCardsWrite as D,ownsCard as m}from"../../../format/lib/content/mirror-cards.js";import{editorEaselWords as M,say as n}from"../../../format/lib/editor-words.js";import{cardCopyPlace as R}from"../../../format/lib/content/card-template.js";import{sharedColumnsDrawn as u}from"../../../render/lib/content/box-shared-columns.js";import{withShowWhen as v}from"../../../format/lib/document/show-when-attach.js";const c="mirrorCardsIdle",h="mirrorCardsMirrors",B={[h]:(r,e)=>{const o=R(e.appState,r.props?.id),t=r.props??{};return o===void 0?void 0:d(t,m(o),u(t).desktop)&&l(t.mirrorCards)!==null},[c]:(r,e)=>{const o=R(e.appState,r.props?.id),t=r.props??{};return o===void 0?void 0:!d(t,m(o),u(t).desktop)}};function w(r=!1){return p.map(e=>({value:e.value,label:n(e.label),title:e.value===a?void 0:n(b[e.value]),disabled:r}))}function x({value:r,onChange:e,readOnly:o}){const t=l(r)??a;return i(S,{label:n(s),icon:i(_,{}),action:i(C,{words:M()?.panel,label:n(s),changed:t!==a,detail:n("Off"),onReset:()=>e(void 0)}),children:i(O,{size:"sm",block:!0,label:n(s),value:t,onChange:f=>e(D(f)),options:w(o===!0)})})}function N(){return v(A("desktop",{type:"custom",...I({},{type:"radio",label:s,options:p.map(r=>({value:r.value,label:r.label}))}),render:({value:r,onChange:e,readOnly:o})=>i(x,{value:r,onChange:e,readOnly:o})}),{not:{context:c,is:!0}})}export{B as MIRROR_CARDS_FACTS,c as MIRROR_CARDS_IDLE,h as MIRROR_CARDS_MIRRORS,N as mirrorCardsField,w as mirrorCardsOptions};
1
+ "use client";import{jsx as s}from"react/jsx-runtime";import{SettingsDefaultReset as O,SettingsField as _}from"efficient-easel/panel";import{Segmented as h}from"efficient-shell/ui";import{SwapIcon as w}from"efficient-easel/icons";import{describedAs as A}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as I}from"efficient-easel/screen/lib/document/device-fields";import{MIRROR_CARDS_LABEL as p,MIRROR_CARDS_OFF as d,MIRROR_CARDS_OPTIONS as u,MIRROR_CARDS_TITLES as b,mirrorCardsActs as a,mirrorCardsOf as R,mirrorChildrenActs as D,mirrorCardsWrite as M,ownsCard as f}from"../../../format/lib/content/mirror-cards.js";import{editorEaselWords as v,say as i}from"../../../format/lib/editor-words.js";import{cardCopyPlace as c}from"../../../format/lib/content/card-template.js";import{sharedColumnsDrawn as l}from"../../../render/lib/content/box-shared-columns.js";import{withShowWhen as x}from"../../../format/lib/document/show-when-attach.js";import{handedRowOf as C,holdsABox as y}from"../../../format/lib/document/row-hand.js";const S="mirrorCardsIdle",F="mirrorCardsMirrors",J={[F]:(r,e)=>{const t=c(e.appState,r.props?.id),o=r.props??{};if(t===void 0)return;const n=C(e.appState,r.props?.id);if(n){const m=n.row?{...o,direction:"row",share:n.row.share}:o;return n.mirror!==null&&a(m,!0,l(m).desktop)}return a(o,f(t),l(o).desktop)&&R(o.mirrorCards)!==null},[S]:(r,e)=>{const t=c(e.appState,r.props?.id),o=r.props??{};if(t!==void 0)return C(e.appState,r.props?.id)?!0:a(o,f(t),l(o).desktop)?!1:!(D(o,t.inCopy)&&y(o))}};function g(r=!1){return u.map(e=>({value:e.value,label:i(e.label),title:e.value===d?void 0:i(b[e.value]),disabled:r}))}function k({value:r,onChange:e,readOnly:t}){const o=R(r)??d;return s(_,{label:i(p),icon:s(w,{}),action:s(O,{words:v()?.panel,label:i(p),changed:o!==d,detail:i("Off"),onReset:()=>e(void 0)}),children:s(h,{size:"sm",block:!0,label:i(p),value:o,onChange:n=>e(M(n)),options:g(t===!0)})})}function K(){return x(I("desktop",{type:"custom",...A({},{type:"radio",label:p,options:u.map(r=>({value:r.value,label:r.label}))}),render:({value:r,onChange:e,readOnly:t})=>s(k,{value:r,onChange:e,readOnly:t})}),{not:{context:S,is:!0}})}export{J as MIRROR_CARDS_FACTS,S as MIRROR_CARDS_IDLE,F as MIRROR_CARDS_MIRRORS,K as mirrorCardsField,g as mirrorCardsOptions};
@@ -1 +1 @@
1
- import{encodePartKey as L}from"../../../format/lib/document/part-key.js";import{HERO_MEDIA_PART_LABELS as U,HERO_PART_ATTR as M,heroPartId as J,readHeroPartId as Q}from"../../../render/lib/document/hero-media-parts.js";import{TICKER_PART_ATTR as z,TICKER_PART_LABEL as V,readTickerPartId as X,tickerPartId as Y}from"../../../render/components/PreviewTickerContext.js";import{BLOCK_ATTRIBUTE as y}from"efficient-easel/canvas";import{decodeLocationPartId as Z,encodeLocationPartId as tt}from"../../../render/components/PreviewLocationPartContext.js";import{PART_ATTR as b,PART_KIND_ATTR as et,PART_ROW_ATTR as N,REGION_PART_ATTR as _,decodePartId as nt,encodePartId as O,encodePartRow as ot,normalizePartText as rt,partHeadLabel as st}from"../../../render/lib/document/text-parts.js";const E="data-sf-part-label";function B(c,n){return c.closest(`[${y}]`)?.getAttribute(y)===n}function v(c,n,o){const s=c.querySelectorAll("*"),l=[],a=new Set;for(let t=0;t<s.length;t+=1){const e=s[t];if(!B(e,n))continue;const i=e.getAttribute(et);i&&(l.push({element:e,partId:O(n,i)}),a.add(e))}const u=[],f=new Set;for(let t=0;t<s.length;t+=1){const e=s[t];if(!B(e,n)||a.has(e))continue;const i=rt(e.textContent??"");if(!i)continue;const r=e.closest(`[${N}]`)?.getAttribute(N)||null;r&&f.add(r.replace(/\[\d+\]$/u,"")),u.push({element:e,text:i,row:r})}const T=t=>u.filter(e=>e.row===ot(t.key,t.row.index)),P=u.filter(t=>t.row===null),g=t=>t.row&&f.has(t.key)?T(t):f.size?P:u,d=new Map,w=[],x=t=>t.row?`${t.key}.${t.row.rowKey}`:null,I=new Map;for(const t of o){const e=x(t);if(!e||f.has(t.key))continue;const i=I.get(e);i?i.push(t):I.set(e,[t])}const S=new Set;for(const[t,e]of I){if(e.length<2)continue;const i=e.flatMap(m=>m.texts);if(new Set(i).size===i.length)continue;const r=g(e[0]).filter(m=>i.includes(m.text));if(r.length!==e.length)continue;const A=[...e].sort((m,R)=>(m.row?.index??0)-(R.row?.index??0));for(let m=0;m<A.length;m+=1){const R=A[m],p=r[m].element,h={key:R.key,partKey:L(R.key,R.row),exact:!0},k=d.get(p);k?k.push(h):(d.set(p,[h]),w.push(p))}S.add(t)}const K=new Map;for(const t of o){if(S.has(x(t)??""))continue;const e=L(t.key,t.row);for(const i of t.texts)for(const r of g(t)){if(r.text!==i)continue;const A=K.get(r.element);A?A.add(e):K.set(r.element,new Set([e]))}}const F=(t,e)=>[...K].some(([i,r])=>i!==t&&!r.has(e)&&i.contains(t));for(const t of o){if(S.has(x(t)??""))continue;const e=L(t.key,t.row);for(const i of t.texts){const r=[];let A=null;for(const p of g(t))p.text===i?F(p.element,e)||r.push(p.element):!r.length&&p.text.includes(i)&&(!A||p.text.length<=A.length)&&(A={element:p.element,length:p.text.length});const m=r.length?r:A?[A.element]:[],R=m.filter(p=>!m.some(h=>h!==p&&p.contains(h)));for(const p of R){const h={key:t.key,partKey:e,exact:r.length>0},k=d.get(p);k?k.push(h):(d.set(p,[h]),w.push(p))}}}const G=new Map(o.map(t=>[t.key,st(t.label)])),$=[...l];for(const t of w){const e=d.get(t)??[],i=e.some(r=>r.exact)?e.filter(r=>r.exact):e;if(new Set(i.map(r=>r.partKey)).size===1){const r=G.get(i[0].key);$.push({element:t,partId:O(n,i[0].partKey),...r?{label:r}:{}});continue}new Set(i.map(r=>r.key)).size===1&&$.push({element:t,partId:O(n,i[0].key)})}return $}function C(c,n,o){const s=c.querySelectorAll(`[${b}]`);for(let a=0;a<s.length;a+=1){const u=s[a];B(u,n)&&(u.removeAttribute(b),u.removeAttribute(E))}const l=[];for(const{element:a,partId:u,label:f}of o)a.setAttribute(b,u),f&&a.setAttribute(E,f),l.push(a);return l}function dt(c,n,o,s,l,a=()=>null){let u=null,f=null,T=null;const P=()=>{const g=o(),d=g?.getAttribute(y)??null;if(!g||!d)return!1;u=d;let w=v(c,d,n);return l(g,d,C(c,d,w)),T=a(()=>{const x=v(c,d,n);ct(w,x)||(w=x,l(g,d,C(c,d,x)))}),!0};return P()||(f=s(()=>{(u||P())&&(f?.(),f=null)})),()=>{f?.(),f=null,T?.(),T=null,u&&C(c,u,[])}}function ct(c,n){return c.length===n.length&&c.every((o,s)=>o.element===n[s].element&&o.partId===n[s].partId)}function mt(c,n){const o=c?.closest?.(`[${b}],[${_}]`),s=o?.getAttribute(b)??o?.getAttribute(_),l=s?nt(s):null;if(o&&s&&l?.nodeId===n&&l.propKey)return{id:s,element:o,whole:D(o,s),label:H(o,s)};const a=c?.closest?.(q.slice(2).map(T=>`[${T}]`).join(","));if(!a)return null;const f=a.closest?.(`[${y}]`)?.getAttribute(y)===n?j(a,n):null;return f?{id:f,element:a,whole:D(a,f),label:H(a,f)}:null}function H(c,n){const o=Z(n);if(o)return o.part==="map"?"Map":o.part==="city"?"City":"Image";const s=Q(n);return s?U[s.part]:X(n)?V:c.getAttribute(E)??void 0}const W="data-loc-pick",q=[b,_,M,z,W];function j(c,n){const o=c.getAttribute(b)??c.getAttribute(_);if(o)return o;const s=c.getAttribute(M);if(s)return J(n,s);if(c.getAttribute(z)!==null)return Y(n);const l=c.getAttribute(W)?.split(":");return l&&(l[1]==="image"||l[1]==="map"||l[1]==="city")&&/^\d+$/.test(l[0])?tt(n,Number(l[0]),l[1]):null}function D(c,n){const o=c.closest?.(`[${y}]`),s=o?.getAttribute(y);if(!o||!s)return!1;const l=new Set;for(const a of o.querySelectorAll(q.map(u=>`[${u}]`).join(","))){if(a.closest?.(`[${y}]`)!==o)continue;const u=j(a,s);u&&l.add(u)}return l.size===1&&l.has(n)}export{W as LOCATION_PICK_ATTR,E as PART_LABEL_ATTR,C as applyPartStamps,dt as engagePartAnchors,D as isOnlyPart,H as partLabelOf,mt as partOfBlockAt,v as resolvePartStamps};
1
+ import{encodePartKey as O}from"../../../format/lib/document/part-key.js";import{HERO_MEDIA_PART_LABELS as U,HERO_PART_ATTR as z,heroPartId as J,readHeroPartId as Q}from"../../../render/lib/document/hero-media-parts.js";import{TICKER_PART_ATTR as N,TICKER_PART_LABEL as V,readTickerPartId as X,tickerPartId as Y}from"../../../render/components/PreviewTickerContext.js";import{BLOCK_ATTRIBUTE as T}from"efficient-easel/canvas";import{decodeLocationPartId as Z,encodeLocationPartId as tt}from"../../../render/components/PreviewLocationPartContext.js";import{PART_ATTR as b,PART_KIND_ATTR as et,PART_ROW_ATTR as v,REGION_PART_ATTR as _,decodePartId as nt,encodePartId as E,encodePartRow as ot,normalizePartText as rt,partHeadLabel as st}from"../../../render/lib/document/text-parts.js";const B="data-sf-part-label";function C(c,o){return c.closest(`[${T}]`)?.getAttribute(T)===o}function H(c,o,r){const s=c.querySelectorAll("*"),l=new Map(r.map(t=>[t.key,st(t.label)])),a=[],u=new Set;for(let t=0;t<s.length;t+=1){const e=s[t];if(!C(e,o))continue;const i=e.getAttribute(et);if(!i)continue;const n=l.get(i);a.push({element:e,partId:E(o,i),...n?{label:n}:{}}),u.add(e)}const f=[],g=new Set;for(let t=0;t<s.length;t+=1){const e=s[t];if(!C(e,o)||u.has(e))continue;const i=rt(e.textContent??"");if(!i)continue;const n=e.closest(`[${v}]`)?.getAttribute(v)||null;n&&g.add(n.replace(/\[\d+\]$/u,"")),f.push({element:e,text:i,row:n})}const P=t=>f.filter(e=>e.row===ot(t.key,t.row.index)),R=f.filter(t=>t.row===null),m=t=>t.row&&g.has(t.key)?P(t):g.size?R:f,h=new Map,w=[],I=t=>t.row?`${t.key}.${t.row.rowKey}`:null,S=new Map;for(const t of r){const e=I(t);if(!e||g.has(t.key))continue;const i=S.get(e);i?i.push(t):S.set(e,[t])}const K=new Set;for(const[t,e]of S){if(e.length<2)continue;const i=e.flatMap(d=>d.texts);if(new Set(i).size===i.length)continue;const n=m(e[0]).filter(d=>i.includes(d.text));if(n.length!==e.length)continue;const A=[...e].sort((d,x)=>(d.row?.index??0)-(x.row?.index??0));for(let d=0;d<A.length;d+=1){const x=A[d],p=n[d].element,y={key:x.key,partKey:O(x.key,x.row),exact:!0},k=h.get(p);k?k.push(y):(h.set(p,[y]),w.push(p))}K.add(t)}const $=new Map;for(const t of r){if(K.has(I(t)??""))continue;const e=O(t.key,t.row);for(const i of t.texts)for(const n of m(t)){if(n.text!==i)continue;const A=$.get(n.element);A?A.add(e):$.set(n.element,new Set([e]))}}const G=(t,e)=>[...$].some(([i,n])=>i!==t&&!n.has(e)&&i.contains(t));for(const t of r){if(K.has(I(t)??""))continue;const e=O(t.key,t.row);for(const i of t.texts){const n=[];let A=null;for(const p of m(t))p.text===i?G(p.element,e)||n.push(p.element):!n.length&&p.text.includes(i)&&(!A||p.text.length<=A.length)&&(A={element:p.element,length:p.text.length});const d=n.length?n:A?[A.element]:[],x=d.filter(p=>!d.some(y=>y!==p&&p.contains(y)));for(const p of x){const y={key:t.key,partKey:e,exact:n.length>0},k=h.get(p);k?k.push(y):(h.set(p,[y]),w.push(p))}}}const L=[...a];for(const t of w){const e=h.get(t)??[],i=e.some(n=>n.exact)?e.filter(n=>n.exact):e;if(new Set(i.map(n=>n.partKey)).size===1){const n=l.get(i[0].key);L.push({element:t,partId:E(o,i[0].partKey),...n?{label:n}:{}});continue}new Set(i.map(n=>n.key)).size===1&&L.push({element:t,partId:E(o,i[0].key)})}return L}function M(c,o,r){const s=c.querySelectorAll(`[${b}]`);for(let a=0;a<s.length;a+=1){const u=s[a];C(u,o)&&(u.removeAttribute(b),u.removeAttribute(B))}const l=[];for(const{element:a,partId:u,label:f}of r)a.setAttribute(b,u),f&&a.setAttribute(B,f),l.push(a);return l}function dt(c,o,r,s,l,a=()=>null){let u=null,f=null,g=null;const P=()=>{const R=r(),m=R?.getAttribute(T)??null;if(!R||!m)return!1;u=m;let h=H(c,m,o);return l(R,m,M(c,m,h)),g=a(()=>{const w=H(c,m,o);ct(h,w)||(h=w,l(R,m,M(c,m,w)))}),!0};return P()||(f=s(()=>{(u||P())&&(f?.(),f=null)})),()=>{f?.(),f=null,g?.(),g=null,u&&M(c,u,[])}}function ct(c,o){return c.length===o.length&&c.every((r,s)=>r.element===o[s].element&&r.partId===o[s].partId)}function mt(c,o){const r=c?.closest?.(`[${b}],[${_}]`),s=r?.getAttribute(b)??r?.getAttribute(_),l=s?nt(s):null;if(r&&s&&l?.nodeId===o&&l.propKey)return{id:s,element:r,whole:F(r,s),label:W(r,s)};const a=c?.closest?.(j.slice(2).map(g=>`[${g}]`).join(","));if(!a)return null;const f=a.closest?.(`[${T}]`)?.getAttribute(T)===o?D(a,o):null;return f?{id:f,element:a,whole:F(a,f),label:W(a,f)}:null}function W(c,o){const r=Z(o);if(r)return r.part==="map"?"Map":r.part==="city"?"City":"Image";const s=Q(o);return s?U[s.part]:X(o)?V:c.getAttribute(B)??void 0}const q="data-loc-pick",j=[b,_,z,N,q];function D(c,o){const r=c.getAttribute(b)??c.getAttribute(_);if(r)return r;const s=c.getAttribute(z);if(s)return J(o,s);if(c.getAttribute(N)!==null)return Y(o);const l=c.getAttribute(q)?.split(":");return l&&(l[1]==="image"||l[1]==="map"||l[1]==="city")&&/^\d+$/.test(l[0])?tt(o,Number(l[0]),l[1]):null}function F(c,o){const r=c.closest?.(`[${T}]`),s=r?.getAttribute(T);if(!r||!s)return!1;const l=new Set;for(const a of r.querySelectorAll(j.map(u=>`[${u}]`).join(","))){if(a.closest?.(`[${T}]`)!==r)continue;const u=D(a,s);u&&l.add(u)}return l.size===1&&l.has(o)}export{q as LOCATION_PICK_ATTR,B as PART_LABEL_ATTR,M as applyPartStamps,dt as engagePartAnchors,F as isOnlyPart,W as partLabelOf,mt as partOfBlockAt,H as resolvePartStamps};
@@ -1 +1 @@
1
- import{Fragment as n,createElement as o}from"react";import{deviceField as t}from"efficient-easel/screen/lib/document/device-fields";const e=()=>({type:"custom",render:()=>o(n)}),p=["fontSize","lineHeight","letterSpacing","paragraphSpacing","padding"],g={words:e(),sourceNote:e(),style:e(),font:e(),italic:e(),fontSize:t("each",e()),lineHeight:e(),letterSpacing:e(),paragraphSpacing:e(),padding:e(),align:t("each",e()),letterCase:e(),fixedSizeHint:t("each",e()),regionNote:e(),regionStyle:e()},r=["fontSize"];function l(i){return r.includes(i)}const s={showTicker:e(),items:e()};export{p as PART_CELL_KEYS,g as PART_PANEL_ROWS,s as TICKER_PANEL_ROWS,l as partRowHasTabletValue};
1
+ import{Fragment as n,createElement as o}from"react";import{deviceField as t}from"efficient-easel/screen/lib/document/device-fields";const e=()=>({type:"custom",render:()=>o(n)}),p=["fontSize","lineHeight","letterSpacing","paragraphSpacing","padding"],g={words:e(),sourceNote:e(),style:e(),font:e(),italic:e(),fontSize:t("each",e()),lineHeight:e(),letterSpacing:e(),paragraphSpacing:e(),padding:e(),align:t("each",e()),letterCase:e(),fixedSizeHint:t("each",e()),regionNote:e(),regionStyle:e()},r=["fontSize","align"];function l(i){return r.includes(i)}const s={showTicker:e(),items:e()};export{p as PART_CELL_KEYS,g as PART_PANEL_ROWS,s as TICKER_PANEL_ROWS,l as partRowHasTabletValue};
@@ -14,7 +14,10 @@ type BlockConfig = {
14
14
  };
15
15
  export declare function blockLabel(config: BlockConfig, type: string): string;
16
16
  export declare function describeSelection(config: BlockConfig, document: AnyDocument, selectedId: string | null | undefined): EaselSelection | null;
17
- export declare function describeBlocks(config: BlockConfig): Record<string, EaselBlockType>;
17
+ export declare function describeBlocks(config: BlockConfig): Record<string, DescribedBlockType>;
18
+ export type DescribedBlockType = EaselBlockType & {
19
+ retired?: true;
20
+ };
18
21
  export type ApplyResult<D> = {
19
22
  ok: true;
20
23
  document: D;
@@ -1 +1 @@
1
- import{FIELD_DESCRIPTION_MARKER as m}from"efficient-easel/screen/lib/host";import{isNode as u}from"efficient-easel/data";function p(n,e){const t=n.components[e]?.label;return typeof t=="string"&&t.trim()?t.trim():e}function g(n){return n.length>3&&n.endsWith("s")?n.slice(0,-1):n}function b(n,e,t,o){n.forEach((s,c)=>{if(u(s)){o.push({node:s,list:n,index:c,parent:e,slot:t});for(const[r,l]of Object.entries(s.props))Array.isArray(l)&&l.some(u)&&b(l,s,r,o)}})}function _(n){const e=[];b(Array.isArray(n.content)?n.content:[],null,"",e);for(const t of Object.values(n.zones??{}))Array.isArray(t)&&b(t,null,"",e);return e}function y(n,e){return _(n).find(t=>String(t.node.props.id)===e)}function O(n,e,t){if(!t)return null;const o=y(e,t);if(!o)return null;const s=p(n,o.node.type),c=o.parent?`${p(n,o.parent.type)} · ${g(o.slot)} ${o.index+1}`:s;return{blockId:t,type:o.node.type,label:c,path:""}}const v=n=>n.filter(e=>!!e&&typeof e=="object"&&"value"in e).map(e=>typeof e.label=="string"?{value:e.value,label:e.label}:{value:e.value});function $(n){if(!n||typeof n!="object")return null;const e=n;if(typeof e.type!="string")return null;const t=e.type==="custom"?e[m]:void 0,o={type:t?.type??e.type},s=t?.label??e.label;typeof s=="string"&&(o.label=s);const c=t?.options??e.options;Array.isArray(c)&&(o.options=v(c));for(const r of["arrayFields","objectFields"]){const l=t?.[r]??e[r];l&&typeof l=="object"&&(o[r]=k(l))}return o}function k(n){const e={};for(const[t,o]of Object.entries(n??{})){const s=$(o);s&&(e[t]=s)}return e}function w(n){const e={};for(const[t,o]of Object.entries(n.components))o&&(e[t]={label:p(n,t),fields:k(o.fields)});return e}function j(n,e){let t=n;for(const o of e?e.split("."):[]){const s=/^([A-Za-z_][A-Za-z0-9_]*)(?:\[(\d+)\])?$/.exec(o);if(!s||!t||typeof t!="object")return null;t=t[s[1]],s[2]!==void 0&&(t=Array.isArray(t)?t[Number(s[2])]:void 0)}return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function d(n,e){return n.findIndex(t=>u(t)&&String(t.props.id)===e)}function h(n,e,t){const o=e||t;if(!o)return n.length;const s=d(n,o);if(s<0)throw new Error(`there is no top-level block ${o}`);return e?s+1:s}function F(n,e,t,o){const s=structuredClone(e),c=Array.isArray(s.content)?s.content:s.content=[];try{t.forEach((r,l)=>{const a=i=>{throw new Error(`change ${l+1}: ${i}`)};switch(r.op){case"set_props":{const i=y(s,r.block_id)??a(`there is no block ${r.block_id}`);"id"in r.props&&a("a block's id is never changed");const f=j(i.node.props,r.path)??a(`there is no ${r.path} in that block`);Object.assign(f,structuredClone(r.props));break}case"insert_block":{const i=n.components[r.type]??a(`there is no block type ${r.type}`),f=i.defaultProps&&typeof i.defaultProps=="object"?i.defaultProps:{},A={type:r.type,props:{...structuredClone(f),...structuredClone(r.props),id:o(r.type)}};c.splice(h(c,r.after,r.before),0,A);break}case"remove_block":{const i=d(c,r.block_id);i<0&&a(`there is no top-level block ${r.block_id}`),c.splice(i,1);break}case"move_block":{const i=d(c,r.block_id);i<0&&a(`there is no top-level block ${r.block_id}`);const[f]=c.splice(i,1);c.splice(h(c,r.after,r.before),0,f);break}default:a(`"${r.op}" is not a change this editor makes`)}})}catch(r){return{ok:!1,reason:r instanceof Error?r.message:String(r)}}return{ok:!0,document:s}}export{F as applyPageEdits,p as blockLabel,w as describeBlocks,O as describeSelection};
1
+ import{FIELD_DESCRIPTION_MARKER as $}from"efficient-easel/screen/lib/host";import{isNode as d}from"efficient-easel/data";import{RETIRED_SECTIONS as j}from"../../format/lib/document/section-catalog.js";import{layoutPresetFor as v}from"./sections/text-layouts.js";function u(r,t){const e=r.components[t]?.label;return typeof e=="string"&&e.trim()?e.trim():t}function O(r){return r.length>3&&r.endsWith("s")?r.slice(0,-1):r}function b(r,t,e,o){r.forEach((s,i)=>{if(d(s)){o.push({node:s,list:r,index:i,parent:t,slot:e});for(const[n,l]of Object.entries(s.props))Array.isArray(l)&&l.some(d)&&b(l,s,n,o)}})}function E(r){const t=[];b(Array.isArray(r.content)?r.content:[],null,"",t);for(const e of Object.values(r.zones??{}))Array.isArray(e)&&b(e,null,"",t);return t}function h(r,t){return E(r).find(e=>String(e.node.props.id)===t)}function P(r,t,e){if(!e)return null;const o=h(t,e);if(!o)return null;const s=u(r,o.node.type),i=o.parent?`${u(r,o.parent.type)} · ${O(o.slot)} ${o.index+1}`:s;return{blockId:e,type:o.node.type,label:i,path:""}}const x=r=>r.filter(t=>!!t&&typeof t=="object"&&"value"in t).map(t=>typeof t.label=="string"?{value:t.value,label:t.label}:{value:t.value});function w(r){if(!r||typeof r!="object")return null;const t=r;if(typeof t.type!="string")return null;const e=t.type==="custom"?t[$]:void 0,o={type:e?.type??t.type},s=e?.label??t.label;typeof s=="string"&&(o.label=s);const i=e?.options??t.options;Array.isArray(i)&&(o.options=x(i));for(const n of["arrayFields","objectFields"]){const l=e?.[n]??t[n];l&&typeof l=="object"&&(o[n]=k(l))}return o}function k(r){const t={};for(const[e,o]of Object.entries(r??{})){const s=w(o);s&&(t[e]=s)}return t}function N(r){const t={};for(const[e,o]of Object.entries(r.components))o&&(t[e]={label:u(r,e),fields:k(o.fields),...m(e)?{retired:!0}:{}});return t}function m(r){return Object.prototype.hasOwnProperty.call(j,r)}function A(r,t){const e=r.components[t]?.defaultProps;return e&&typeof e=="object"?structuredClone(e):{}}function F(r,t){let e=r;for(const o of t?t.split("."):[]){const s=/^([A-Za-z_][A-Za-z0-9_]*)(?:\[(\d+)\])?$/.exec(o);if(!s||!e||typeof e!="object")return null;e=e[s[1]],s[2]!==void 0&&(e=Array.isArray(e)?e[Number(s[2])]:void 0)}return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function y(r,t){return r.findIndex(e=>d(e)&&String(e.props.id)===t)}function g(r,t,e){const o=t||e;if(!o)return r.length;const s=y(r,o);if(s<0)throw new Error(`there is no top-level block ${o}`);return t?s+1:s}function z(r,t,e,o){const s=structuredClone(t),i=Array.isArray(s.content)?s.content:s.content=[];try{e.forEach((n,l)=>{const a=c=>{throw new Error(`change ${l+1}: ${c}`)};switch(n.op){case"set_props":{const c=h(s,n.block_id)??a(`there is no block ${n.block_id}`);"id"in n.props&&a("a block's id is never changed");const f=F(c.node.props,n.path)??a(`there is no ${n.path} in that block`);Object.assign(f,structuredClone(n.props));break}case"insert_block":{r.components[n.type]??a(`there is no block type ${n.type}`),m(n.type)&&a(`${u(r,n.type)} is retired: it is no longer added (a page that holds one keeps it)`);const c=v(n.type),f=Object.keys(n.props??{}).filter(p=>p!=="id");c&&f.length&&a(`${u(r,n.type)} is laid down as a Box of blocks: insert it with no props, then change its blocks`);const _=c?c(p=>A(r,p),o):{type:n.type,props:{...A(r,n.type),...structuredClone(n.props),id:o(n.type)}};i.splice(g(i,n.after,n.before),0,_);break}case"remove_block":{const c=y(i,n.block_id);c<0&&a(`there is no top-level block ${n.block_id}`),i.splice(c,1);break}case"move_block":{const c=y(i,n.block_id);c<0&&a(`there is no top-level block ${n.block_id}`);const[f]=i.splice(c,1);i.splice(g(i,n.after,n.before),0,f);break}default:a(`"${n.op}" is not a change this editor makes`)}})}catch(n){return{ok:!1,reason:n instanceof Error?n.message:String(n)}}return{ok:!0,document:s}}export{z as applyPageEdits,u as blockLabel,N as describeBlocks,P as describeSelection};
@@ -1,6 +1,7 @@
1
1
  import { type SectionToBoxRow } from "../../../render/lib/sections/section-to-box.js";
2
2
  import { type SectionPreset } from "../../../format/lib/sections/section-presets.js";
3
3
  export declare const TEXT_LAYOUTS: readonly string[];
4
- export declare function conversionPreset(type: string, row: SectionToBoxRow, piece?: number): SectionPreset;
4
+ export declare const MERGE_LAYOUTS: Readonly<Record<string, () => Readonly<Record<string, unknown>>>>;
5
+ export declare function conversionPreset(type: string, row: SectionToBoxRow, piece?: number, starter?: () => Readonly<Record<string, unknown>>): SectionPreset;
5
6
  export declare function layoutPresetFor(type: string, press?: readonly string[]): SectionPreset | null;
6
7
  export declare function layoutTypes(): string[];
@@ -1 +1 @@
1
- import{convertSection as u,pressesAsBox as i,SECTION_TO_BOX_PRESS as f,sectionToBoxRow as O}from"../../../render/lib/sections/section-to-box.js";import{SECTION_PRESETS as T,presetFor as m}from"../../../format/lib/sections/section-presets.js";import{GENERAL_SECTION_TO_BOX as E}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{isNodeList as S}from"efficient-easel/data";const _=Object.keys(E);function c(r,o,t){const e={};for(const n of Object.keys(o(r.type)))e[n]=void 0;for(const[n,s]of Object.entries(r.props))e[n]=S(s)?s.map(p=>c(p,o,t)):s;return e.id=t(r.type),{type:r.type,props:e}}function x(r,o,t=0){return(e,n)=>{const{nodes:s}=u({type:r,props:{...e(r),id:n(r)}},o);return c(s[t],e,n)}}function k(r,o){if(!i(r,o))return null;const t=O(r);return t?x(r,t):null}function b(r,o=f){return m(r)??k(r,o)}function j(){return[...Object.keys(T),..._.filter(r=>i(r))]}export{_ as TEXT_LAYOUTS,x as conversionPreset,b as layoutPresetFor,j as layoutTypes};
1
+ import{convertSection as S,pressesAsBox as m,SECTION_TO_BOX_PRESS as E,sectionToBoxRow as l}from"../../../render/lib/sections/section-to-box.js";import{SECTION_PRESETS as y,presetFor as g}from"../../../format/lib/sections/section-presets.js";import{GENERAL_SECTION_TO_BOX as _}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{statsBoxSeed as O,statsPressSeed as k,statsSeedRows as N}from"../../../render/lib/document/blocks/general/section-to-box-rows-stats.js";import{logosPressStarter as B}from"../../../render/lib/document/blocks/general/section-to-box-rows-logos.js";import{pageHeaderPressStarter as L}from"../../../render/lib/document/blocks/general/section-to-box-rows-pageheader.js";import{seedNodes as R}from"../../../format/lib/document/seed-parts.js";import{propsWithPartStyleValue as j}from"../../../render/lib/document/part-styles.js";import{isNodeList as a}from"efficient-easel/data";const w=Object.keys(_),P={Logos:B,DocMasthead:L};function u(t,r,o){const e={};for(const s of Object.keys(r(t.type)))e[s]=void 0;for(const[s,n]of Object.entries(t.props))e[s]=a(n)?n.map(p=>u(p,r,o)):n;return e.id=o(t.type),{type:t.type,props:e}}function v(t,r,o=0,e=()=>({})){return(s,n)=>{const{nodes:p}=S({type:t,props:{...s(t),...e(),id:n(t)}},r,{press:!0});return u(p[o],s,n)}}const A={Stats:C};function C(){const t=l("StatsParagraph");return t?(r,o)=>{const{nodes:e}=S({type:"StatsParagraph",props:{...r("StatsParagraph"),...k(),id:o("StatsParagraph")}},t),s=e[0],n=a(s.props.content)?s.props.content.filter(f=>f.props?.cardStyle===void 0):[],p=b(O(N(),"table")),c=n.map(T),i=u({...s,props:{...s.props,content:[...c,p]}},r,o);return{...i,props:{...i.props,name:"Stats section"}}}:null}function T(t){if(t.props?.name==="Words"){const r=a(t.props.content)?t.props.content.map(U):t.props.content;return{...t,props:{...t.props,widthFitPhone:"fill",content:r}}}return a(t.props?.content)?{...t,props:{...t.props,content:t.props.content.map(T)}}:t}function U(t){return t.type!=="Text"?t:{...t,props:j({...t.props,alignTablet:"left"},"text","alignTablet","left")}}const b=t=>R([t],(r,o)=>`${r}-seed-${o}`)[0];function W(t,r){if(!m(t,r))return null;const o=A[t];if(o)return o();const e=l(t);return e?v(t,e,0,P[t]):null}function X(t){return(r,o)=>{const e=s=>{if(s.type==="Stats"){const c=u(b(O([],"list")),r,o);return{...c,props:{...c.props,name:"Numbers"}}}let n=!1;const p={};for(const[c,i]of Object.entries(s.props))if(a(i)){const f=i.map(e);n||=f.some((x,h)=>x!==i[h]),p[c]=f}else p[c]=i;return n?{type:s.type,props:p}:s};return e(t(r,o))}}function z(t,r=E){const o=g(t);return o?X(o):W(t,r)}function I(){return[...Object.keys(y),...w.filter(t=>m(t)),...Object.keys(P).filter(t=>m(t))]}export{P as MERGE_LAYOUTS,w as TEXT_LAYOUTS,v as conversionPreset,z as layoutPresetFor,I as layoutTypes};
@@ -1,8 +1,11 @@
1
+ import type { CardRowFieldKind } from "./card-template.js";
1
2
  export declare const BLOCK_SOURCE_PROP = "dataSource";
2
3
  export declare const BLOCK_SOURCE_OPTIONS_PROP = "dataSourceOptions";
3
4
  export declare const BLOCK_SOURCE_ROWS_PROP = "dataRows";
4
5
  export declare const COUNT_KEY_PROP = "countKey";
5
6
  export declare const COUNTS_SOURCE = "counts";
7
+ export declare const LOCATION_PAYMENT_METHODS_SOURCE = "location-payment-methods";
8
+ export declare const SHOP_PAYMENT_METHODS_SOURCE = "shop-payment-methods";
6
9
  export type SourceRow = Readonly<Record<string, string>>;
7
10
  export interface SourceChoice {
8
11
  key: string;
@@ -16,17 +19,30 @@ export interface BlockSourceSpec {
16
19
  sample?: readonly SourceRow[];
17
20
  choices?: readonly SourceChoice[];
18
21
  fields?: readonly SourceFieldSpec[];
19
- edit?: SourceEditLink;
22
+ edit?: SourceEditLink | SourceEditAction;
23
+ useRows?: (props: Readonly<Record<string, unknown>>) => ClientRows | null;
24
+ records?: readonly string[];
25
+ }
26
+ export interface ClientRows {
27
+ rows: readonly SourceRow[];
28
+ items?: readonly unknown[];
20
29
  }
21
30
  export interface SourceFieldSpec {
22
31
  key: string;
23
32
  label: string;
24
- kind?: "text" | "image" | "link";
33
+ kind?: CardRowFieldKind;
34
+ alt?: string;
35
+ fields?: readonly SourceFieldSpec[];
25
36
  }
26
37
  export interface SourceEditLink {
27
38
  label: string;
28
39
  href: string;
29
40
  }
41
+ export interface SourceEditAction {
42
+ label: string;
43
+ open: () => void;
44
+ }
45
+ export declare function isSourceEditAction(link: SourceEditLink | SourceEditAction): link is SourceEditAction;
30
46
  export declare function registerBlockSources(sources: readonly BlockSourceSpec[]): void;
31
47
  export declare function blockSources(block?: string): readonly BlockSourceSpec[];
32
48
  export declare function blockSourceSpec(key: string): BlockSourceSpec | null;
@@ -1 +1 @@
1
- import{globalRegistry as i}from"../global-registry.js";import{nonEmptyString as c}from"../non-empty-string.js";const a="dataSource",S="dataSourceOptions",f="dataRows",x="countKey",R="counts",u=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;function s(){return i("efficient.block-sources",()=>({sources:new Map,revision:0}))}const y=e=>[e?.key,e?.label,e?.value].every(t=>typeof t=="string"&&t.trim()!==""),p=e=>[e?.key,e?.label].every(t=>typeof t=="string"&&t.trim()!==""),b=e=>[e?.label,e?.href].every(t=>typeof t=="string"&&t.trim()!=="");function k(e){if(typeof e.key!="string"||!u.test(e.key))throw new Error(`A block source key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(typeof e.label!="string"||!e.label.trim())throw new Error(`The block source ${e.key} has no label.`);if(!Array.isArray(e.blocks)||!e.blocks.length||e.blocks.some(t=>typeof t!="string"||!t))throw new Error(`The block source ${e.key} names no block it can fill.`);return{key:e.key,label:e.label.trim(),blocks:[...e.blocks],...e.sample?{sample:e.sample.map(t=>l(t)).filter(t=>t!==null)}:{},...Array.isArray(e.choices)?{choices:e.choices.filter(y)}:{},...Array.isArray(e.fields)?{fields:e.fields.filter(p).map(t=>({...t}))}:{},...b(e.edit)?{edit:{label:e.edit.label.trim(),href:e.edit.href.trim()}}:{}}}function v(e){const t=e.map(k),r=s();for(const o of t)r.sources.set(o.key,o);t.length&&(r.revision+=1)}function C(e){const t=[...s().sources.values()];return e===void 0?t:t.filter(r=>r.blocks.includes(e))}function m(e){return s().sources.get(e)??null}function E(e){return s().sources.get(e)?.choices??[]}function _(){return s().revision}function h(e){const t=e?.[a];return typeof t=="string"?t.trim():""}function l(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t={};for(const[r,o]of Object.entries(e)){const n=c(o);n&&(t[r]=n)}return Object.keys(t).length?t:null}function d(e){const t=e?.[f];return Array.isArray(t)?t.map(l).filter(r=>r!==null):null}function w(e,t,r=[]){const o=d(e);if(o!==null&&(o.length||!t))return{rows:o,sample:!1};if(!t)return{rows:[],sample:!1};const n=m(h(e))?.sample;return{rows:n?.length?n:r,sample:!0}}export{S as BLOCK_SOURCE_OPTIONS_PROP,a as BLOCK_SOURCE_PROP,f as BLOCK_SOURCE_ROWS_PROP,R as COUNTS_SOURCE,x as COUNT_KEY_PROP,m as blockSourceSpec,C as blockSources,_ as blockSourcesRevision,h as declaredBlockSource,v as registerBlockSources,d as servedRows,E as sourceChoices,w as sourcedRows};
1
+ import{globalRegistry as c}from"../global-registry.js";import{nonEmptyString as a}from"../non-empty-string.js";const f="dataSource",x="dataSourceOptions",u="dataRows",E="countKey",_="counts",A="location-payment-methods",C="shop-payment-methods";function p(e){return typeof e.open=="function"}const y=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;function s(){return c("efficient.block-sources",()=>({sources:new Map,revision:0}))}const m=e=>[e?.key,e?.label,e?.value].every(t=>typeof t=="string"&&t.trim()!==""),b=e=>[e?.key,e?.label].every(t=>typeof t=="string"&&t.trim()!==""),l=e=>typeof e=="string"&&e.trim()!=="";function O(e){if(!e||!l(e.label))return null;if(p(e))return{label:e.label.trim(),open:e.open};const t=e.href;return l(t)?{label:e.label.trim(),href:t.trim()}:null}function d(e){if(typeof e.key!="string"||!y.test(e.key))throw new Error(`A block source key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(typeof e.label!="string"||!e.label.trim())throw new Error(`The block source ${e.key} has no label.`);if(!Array.isArray(e.blocks)||!e.blocks.length||e.blocks.some(r=>typeof r!="string"||!r))throw new Error(`The block source ${e.key} names no block it can fill.`);const t=O(e.edit);return{key:e.key,label:e.label.trim(),blocks:[...e.blocks],...e.sample?{sample:e.sample.map(r=>i(r)).filter(r=>r!==null)}:{},...Array.isArray(e.choices)?{choices:e.choices.filter(m)}:{},...Array.isArray(e.fields)?{fields:e.fields.filter(b).map(r=>({...r}))}:{},...t?{edit:t}:{},...typeof e.useRows=="function"?{useRows:e.useRows}:{},...Array.isArray(e.records)?{records:e.records.filter(r=>typeof r=="string"&&r.trim()!=="").map(r=>r.trim())}:{}}}function w(e){const t=e.map(d),r=s();for(const o of t)r.sources.set(o.key,o);t.length&&(r.revision+=1)}function P(e){const t=[...s().sources.values()];return e===void 0?t:t.filter(r=>r.blocks.includes(e))}function h(e){return s().sources.get(e)??null}function v(e){return s().sources.get(e)?.choices??[]}function T(){return s().revision}function k(e){const t=e?.[f];return typeof t=="string"?t.trim():""}function i(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t={};for(const[r,o]of Object.entries(e)){const n=a(o);n&&(t[r]=n)}return Object.keys(t).length?t:null}function S(e){const t=e?.[u];return Array.isArray(t)?t.map(i).filter(r=>r!==null):null}function U(e,t,r=[]){const o=S(e);if(o!==null&&(o.length||!t))return{rows:o,sample:!1};if(!t)return{rows:[],sample:!1};const n=h(k(e))?.sample;return{rows:n?.length?n:r,sample:!0}}export{x as BLOCK_SOURCE_OPTIONS_PROP,f as BLOCK_SOURCE_PROP,u as BLOCK_SOURCE_ROWS_PROP,_ as COUNTS_SOURCE,E as COUNT_KEY_PROP,A as LOCATION_PAYMENT_METHODS_SOURCE,C as SHOP_PAYMENT_METHODS_SOURCE,h as blockSourceSpec,P as blockSources,T as blockSourcesRevision,k as declaredBlockSource,p as isSourceEditAction,w as registerBlockSources,S as servedRows,v as sourceChoices,U as sourcedRows};
@@ -1,4 +1,5 @@
1
1
  import type { CSSProperties } from "react";
2
+ import type { SourceRow } from "./block-sources.js";
2
3
  import { type ViewVarNames } from "./view-var-split.js";
3
4
  export declare const CARD_SHADOW_CLASS = "sf-card";
4
5
  export declare const BOX_DARKEN: {
@@ -30,6 +31,8 @@ export declare const BOX_CARD_SIDE: {
30
31
  export declare function isBackgroundBox(src?: string | null): boolean;
31
32
  export declare function boxDarkenStyle(darken: unknown, style?: unknown): CSSProperties | null;
32
33
  export declare const boxFillOf: (value: unknown) => string | null;
34
+ export declare const BOX_SWATCH_PROP = "swatch";
35
+ export declare function boxSwatchFill(props: Record<string, unknown> | null | undefined, row: SourceRow | null | undefined): string | null;
33
36
  export declare const BOX_FILL_VIEWS: ViewVarNames;
34
37
  export declare function boxFillViews(fill: unknown, fillTablet: unknown, fillPhone: unknown): {
35
38
  className: string;
@@ -1 +1 @@
1
- import{parseHexColor as h}from"efficient-shell/format";import{scrim as p}from"./scrim.js";import{viewVarSplit as b}from"./view-var-split.js";const C="sf-card",S={min:0,max:100,step:5,fallback:0,unit:"%"},_=[{label:"Even",value:"even"},{label:"From the bottom",value:"bottom"}],g="68%",E={desktop:20,phone:20,side:40,sidePhone:24},B="sf-box-sides",F={min:0,max:200,step:10};function N(t){return typeof t=="string"&&t.trim()!==""}function x(t,o){const e=typeof t=="number"?t:Number.parseFloat(String(t??""));if(!Number.isFinite(e)||e<=0)return null;const r=(Math.min(S.max,Math.max(S.min,e))/100).toFixed(2);return o!=="bottom"?{background:p(Number(r))}:{background:`linear-gradient(0deg, ${p(Number(r))} 0%, ${p(0)} ${g})`}}const d=t=>typeof t=="string"?h(t.trim()):null,k={tabletClass:"sf-fill-tablet",tabletVar:"--sf-fill-tablet",phoneClass:"sf-fill-phone",phoneVar:"--sf-fill-phone"};function T(t,o,e){return b(k,d(t),d(o),d(e))}const y={tabletClass:"sf-wash-tablet",tabletVar:"--sf-wash-tablet",phoneClass:"sf-wash-phone",phoneVar:"--sf-wash-phone"};function V(t){const o=x(t.darken,t.darkenStyle);if(!o)return{className:"",style:{}};const e=(n,f)=>String(x(n,f)?.background??"none"),s=n=>(typeof n=="number"||typeof n=="string"&&n.trim()!=="")&&Number.isFinite(Number(n))?n:void 0,r=n=>_.some(f=>f.value===n)?n:void 0,[a,l,i,c]=[s(t.darkenTablet),r(t.darkenStyleTablet),s(t.darkenPhone),r(t.darkenStylePhone)],u=a??t.darken,m=l??t.darkenStyle;return b(y,String(o.background),a!==void 0||l!==void 0?e(u,m):null,i!==void 0||c!==void 0?e(i??u,c??m):null)}function P(t,o){const e={"top-left":["start","start"],"top-center":["center","start"],"top-right":["end","start"],left:["start","center"],center:["center","center"],right:["end","center"],"bottom-left":["start","end"],"bottom-center":["center","end"],"bottom-right":["end","end"]},[s,r]=e[t]??e.center,[a,l]=o==="column"?[r,s]:[s,r],i={start:"justify-start",center:"justify-center",end:"justify-end"},c={start:"items-start",center:"items-center",end:"items-end"};return`${i[a]} ${c[l]}`}export{E as BOX_CARD_PAD,F as BOX_CARD_SIDE,S as BOX_DARKEN,_ as BOX_DARKEN_STYLES,k as BOX_FILL_VIEWS,B as BOX_OWNS_SIDES_CLASS,y as BOX_WASH_VIEWS,C as CARD_SHADOW_CLASS,x as boxDarkenStyle,d as boxFillOf,T as boxFillViews,P as boxPlacementClasses,V as boxWashViews,N as isBackgroundBox};
1
+ import{parseHexColor as h}from"efficient-shell/format";import{namedRowField as _,rowFieldText as g}from"./card-template.js";import{scrim as f}from"./scrim.js";import{viewVarSplit as b}from"./view-var-split.js";const E="sf-card",x={min:0,max:100,step:5,fallback:0,unit:"%"},k=[{label:"Even",value:"even"},{label:"From the bottom",value:"bottom"}],y="68%",N={desktop:20,phone:20,side:40,sidePhone:24},P="sf-box-sides",V={min:0,max:200,step:10};function X(t){return typeof t=="string"&&t.trim()!==""}function S(t,e){const n=typeof t=="number"?t:Number.parseFloat(String(t??""));if(!Number.isFinite(n)||n<=0)return null;const r=(Math.min(x.max,Math.max(x.min,n))/100).toFixed(2);return e!=="bottom"?{background:f(Number(r))}:{background:`linear-gradient(0deg, ${f(Number(r))} 0%, ${f(0)} ${y})`}}const p=t=>typeof t=="string"?h(t.trim()):null,O="swatch";function I(t,e){return e?p(g(e,_(t,O))):null}const A={tabletClass:"sf-fill-tablet",tabletVar:"--sf-fill-tablet",phoneClass:"sf-fill-phone",phoneVar:"--sf-fill-phone"};function R(t,e,n){return b(A,p(t),p(e),p(n))}const F={tabletClass:"sf-wash-tablet",tabletVar:"--sf-wash-tablet",phoneClass:"sf-wash-phone",phoneVar:"--sf-wash-phone"};function W(t){const e=S(t.darken,t.darkenStyle);if(!e)return{className:"",style:{}};const n=(o,d)=>String(S(o,d)?.background??"none"),s=o=>(typeof o=="number"||typeof o=="string"&&o.trim()!=="")&&Number.isFinite(Number(o))?o:void 0,r=o=>k.some(d=>d.value===o)?o:void 0,[a,l,i,c]=[s(t.darkenTablet),r(t.darkenStyleTablet),s(t.darkenPhone),r(t.darkenStylePhone)],u=a??t.darken,m=l??t.darkenStyle;return b(F,String(e.background),a!==void 0||l!==void 0?n(u,m):null,i!==void 0||c!==void 0?n(i??u,c??m):null)}function L(t,e){const n={"top-left":["start","start"],"top-center":["center","start"],"top-right":["end","start"],left:["start","center"],center:["center","center"],right:["end","center"],"bottom-left":["start","end"],"bottom-center":["center","end"],"bottom-right":["end","end"]},[s,r]=n[t]??n.center,[a,l]=e==="column"?[r,s]:[s,r],i={start:"justify-start",center:"justify-center",end:"justify-end"},c={start:"items-start",center:"items-center",end:"items-end"};return`${i[a]} ${c[l]}`}export{N as BOX_CARD_PAD,V as BOX_CARD_SIDE,x as BOX_DARKEN,k as BOX_DARKEN_STYLES,A as BOX_FILL_VIEWS,P as BOX_OWNS_SIDES_CLASS,O as BOX_SWATCH_PROP,F as BOX_WASH_VIEWS,E as CARD_SHADOW_CLASS,S as boxDarkenStyle,p as boxFillOf,R as boxFillViews,L as boxPlacementClasses,I as boxSwatchFill,W as boxWashViews,X as isBackgroundBox};
@@ -1,4 +1,4 @@
1
- export declare const BOX_SHAPES: ("square" | "video" | "poster" | "auto" | "tall" | "wide" | "landscape" | "portrait" | "panorama" | "story")[];
1
+ export declare const BOX_SHAPES: ("square" | "video" | "auto" | "poster" | "tall" | "wide" | "landscape" | "portrait" | "panorama" | "story")[];
2
2
  export type BoxShape = (typeof BOX_SHAPES)[number];
3
3
  export declare function boxShapeOf(value: unknown): BoxShape;
4
4
  export declare function boxShapeClass(value: unknown): string;
@@ -7,4 +7,10 @@ export type CardStateLine = "frame" | "under";
7
7
  export declare const CARD_STATE_UNDER_LINE_CLASS = "pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";
8
8
  export declare function cardStateValue(state: CardRowState | undefined | null): string;
9
9
  export declare function cardStateAttrs(state: CardRowState | undefined | null): Record<string, string>;
10
+ export type CardItemAction = {
11
+ readonly press: () => void;
12
+ };
13
+ export declare function cardItemAction(item: unknown): CardItemAction | undefined;
14
+ export declare const CARD_ACTION_ATTR = "data-sf-card-press";
15
+ export declare const CARD_ACTION_CLASS = "absolute inset-0 -z-[1] outline-none focus-visible:z-[2] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent appearance-none bg-transparent border-0 p-0 m-0 cursor-pointer";
10
16
  export {};
@@ -1 +1 @@
1
- const r=["selected","highlighted"],n="data-sf-card-state",a="pointer-events-none absolute inset-0 border border-accent",c="pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";function o(e){return e?r.filter(t=>e[t]===!0).join(" "):""}function s(e){const t=o(e);return t?{[n]:t,className:"relative"}:{}}export{n as CARD_STATE_ATTR,a as CARD_STATE_LINE_CLASS,c as CARD_STATE_UNDER_LINE_CLASS,s as cardStateAttrs,o as cardStateValue};
1
+ import{BOX_LINK_CLASS as r}from"./box-link.js";const n=["selected","highlighted"],o="data-sf-card-state",a="pointer-events-none absolute inset-0 border border-accent",p="pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";function s(e){return e?n.filter(t=>e[t]===!0).join(" "):""}function A(e){const t=s(e);return t?{[o]:t,className:"relative"}:{}}function d(e){if(!e||typeof e!="object")return;const t=e.press;return typeof t=="function"?{press:t}:void 0}const i="data-sf-card-press",u=`${r} appearance-none bg-transparent border-0 p-0 m-0 cursor-pointer`;export{i as CARD_ACTION_ATTR,u as CARD_ACTION_CLASS,o as CARD_STATE_ATTR,a as CARD_STATE_LINE_CLASS,p as CARD_STATE_UNDER_LINE_CLASS,d as cardItemAction,A as cardStateAttrs,s as cardStateValue};
@@ -10,7 +10,14 @@ export declare function cardTemplateSlot(): {
10
10
  type: "slot";
11
11
  allow: string[];
12
12
  };
13
- export type CardRowFieldKind = "text" | "image" | "link" | "list";
13
+ export declare const CARD_LIST_ITEM_BLOCKS: ("Flex" | "Text" | "ImageBlock")[];
14
+ export declare const CARD_LIST_ROWS = "items";
15
+ export declare const CARD_LIST_FIELDS = "itemFields";
16
+ export declare function cardListItemSlot(): {
17
+ type: "slot";
18
+ allow: string[];
19
+ };
20
+ export type CardRowFieldKind = "text" | "image" | "link" | "list" | "colour";
14
21
  export interface CardRowFieldSpec {
15
22
  key: string;
16
23
  label: string;
@@ -55,7 +62,12 @@ export declare function cardTemplateField(type: string | undefined, key: string,
55
62
  export declare function namedRowField(props: Record<string, unknown> | null | undefined, prop?: string): string;
56
63
  export declare function cardKeyOf(row: SourceRow, index: number): string;
57
64
  export declare function cardRow(value: unknown): SourceRow;
65
+ export declare const BOX_HIDE_WHEN_ROW_EMPTY = "hideWhenRowEmpty";
66
+ export declare function templateBoxIsEmpty(props: Record<string, unknown>, row: SourceRow | null | undefined): boolean;
58
67
  export declare function rowNextPicture(item: unknown, next: string | undefined, cover?: string): string;
68
+ export declare const ROW_BOUND_PROPS: Readonly<Record<string, Readonly<Record<string, string>>>>;
69
+ export declare const ROW_PART_BY_WORDS: ReadonlySet<string>;
70
+ export declare function rowPartByKey(type: string, props: Record<string, unknown> | null | undefined, key: string): boolean;
59
71
  export declare function rowBound(type: string, props: Record<string, unknown> | null | undefined, key: string): boolean;
60
72
  export declare function rowFieldOf(type: string, props: Record<string, unknown> | null | undefined, key: string): string;
61
73
  export declare function rowFieldText(row: SourceRow | null | undefined, key: string): string | null;
@@ -71,4 +83,5 @@ export declare function cardListFieldsOf(appState: unknown, list: {
71
83
  type?: unknown;
72
84
  props?: Record<string, unknown>;
73
85
  } | null | undefined, kind?: CardRowFieldKind): readonly CardRowFieldSpec[];
86
+ export declare function cardListProps(rows: readonly Record<string, unknown>[], fields: readonly CardRowFieldSpec[]): Record<string, unknown>;
74
87
  export {};
@@ -1 +1 @@
1
- import{blockSourceSpec as T,declaredBlockSource as w}from"./block-sources.js";import{isNodeList as C}from"efficient-easel/data";import{BOX_TYPE as B}from"../document/container-blocks.js";import{globalRegistry as R}from"../global-registry.js";import{nonEmptyString as m}from"../non-empty-string.js";import{accentItalicRuns as A}from"../markup.js";import{withCardsTemplate as L}from"../document/cards-template-on-read.js";import{withCardListTemplate as O}from"../document/blocks/general/CardList/item-seed.js";const h="template",z="Card template",k="CardList",_=["Text","ImageBlock","ButtonBlock","Flex"],f="rowField",E="rowLinkField";function G(){return{type:"slot",allow:[..._]}}const P=[{block:"OrderSummary",typedRows:"rows",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{block:"Cards",typedRows:"items",fields:[{key:"num",label:"Number"},{key:"since",label:"Corner note"},{key:"label",label:"Label"},{key:"title",label:"Card title"},{key:"value",label:"Value"},{key:"body",label:"Card body",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:"count",label:"Count"},{key:"badge",label:"Highlight badge",everySource:!0}],seed:e=>L("Cards",e)},{block:k,fields:[],seed:e=>O(e)}];function c(){return R("efficient.card-templates",()=>new Map(P.map(e=>[e.block,e])))}function J(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");const r=[];for(const o of t.blocks??[]){if(typeof o?.type!="string"||!o.type)throw new Error(`The card template of ${t.block} names an empty block.`);r.some(i=>i.type===o.type)||r.push({type:o.type,label:o.label||o.type})}const n=m(t.typedRows);c().set(t.block,{block:t.block,fields:t.fields.map(o=>({...o})),blocks:r,typedRows:n,...t.seed?{seed:t.seed}:{}})}}function S(e,t){const r=e?c().get(e)?.seed:void 0;return r?r(t):t}function Q(e,t){if(!(t.template===void 0||Array.isArray(t.template)&&t.template.length===0))return t;const{template:n,...o}=t,i=S(e,o);return i===o?t:i}function Z(){for(const e of c().values())if(e.blocks?.length)return!0;return!1}function ee(e){return c().get(e)?.blocks??[]}function te(e){for(const t of c().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function re(e){return typeof e=="string"&&c().get(e)?.typedRows||""}function F(e){return typeof e=="string"&&c().has(e)}function I(e,t){const r=c().get(e)?.fields??[];return t?r.filter(n=>(n.kind??"text")===t):r}function D(e){return typeof e=="string"?I(e,"list")[0]?.key??"":""}function v(e,t){return d(e)||D(t)}function b(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const n=c().get(r)?.fields??[],o=T(w(e?.props))?.fields,i=o?.length?[...o.map(l=>({...l})),...n.filter(l=>l.everySource&&!o.some(s=>s.key===l.key))]:n;return t?i.filter(l=>(l.kind??"text")===t):i}function M(e,t,r){return e?r?b(r).find(n=>n.key===t)??null:c().get(e)?.fields.find(n=>n.key===t)??null:null}function d(e,t=f){const r=e?.[t];return typeof r=="string"?r.trim():""}function ne(e,t){return e.key||String(t+1)}function oe(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}function le(e,t,r=""){const n=t&&e&&typeof e=="object"?e[t]:void 0;if(!Array.isArray(n))return"";for(const o of n){const i=typeof o=="string"?o:o?.src,l=m(typeof i=="string"?i.trim():void 0);if(l&&l!==r.trim())return l}return""}const x={Text:{text:f},ImageBlock:{src:f},ButtonBlock:{label:f,href:E},Breadcrumb:{currentCrumb:f}};function ie(e,t,r){return N(e,t,r)!==""}function N(e,t,r){const n=x[e]?.[r];return n?d(t,n):""}function j(e,t){return!t||!e?null:e[t]??""}function se(e,t,r,n){if(!r)return t;let o=null;for(const[i,l]of Object.entries(x[e]??{})){const s=d(t,l),u=j(r,s);u!==null&&(o??={...t},o[i]=n&&M(n,s)?.mark==="accentItalic"?A(u):u)}return o??t}function a(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const n=(i,l)=>{for(const s of i){if(s?.props?.id===t)return l;for(const[u,p]of Object.entries(s?.props??{})){if(!C(p))continue;const g=u===h&&F(s.type)?{owner:s,direct:!0,nested:l!==null,underBox:!1}:l&&{owner:l.owner,direct:!1,nested:l.nested,underBox:l.underBox||s.type===B},y=n(p,g);if(y!==void 0)return y}}},o=n(r,null);return o===void 0?null:o}function K(e,t){const r=a(e,t);return r&&r.owner}function ce(e,t){const r=a(e,t);return r&&(r.direct?r.owner:null)}function ue(e,t){const r=a(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}function fe(e,t,r){if(t?.type!==k)return[];const n=K(e,t.props?.id),o=n?v(t.props,n.type):"",i=o&&n&&b(n,"list").find(l=>l.key===o)?.fields||[];return r?i.filter(l=>(l.kind??"text")===r):i}export{k as CARD_LIST_TYPE,f as CARD_ROW_FIELD_PROP,E as CARD_ROW_LINK_PROP,_ as CARD_TEMPLATE_BLOCKS,z as CARD_TEMPLATE_LABEL,h as CARD_TEMPLATE_SLOT,ue as cardCopyPlace,ne as cardKeyOf,fe as cardListFieldsOf,v as cardListShows,oe as cardRow,ee as cardTemplateBlocks,ce as cardTemplateCardOwner,M as cardTemplateField,I as cardTemplateFields,b as cardTemplateFieldsOf,K as cardTemplateOwner,G as cardTemplateSlot,re as cardTemplateTypedRows,Z as cardTemplatesNameBlocks,D as defaultListField,F as hasCardTemplate,te as isCardTemplateBlock,d as namedRowField,J as registerCardTemplates,ie as rowBound,N as rowFieldOf,j as rowFieldText,se as rowFilledProps,le as rowNextPicture,Q as templateOnInsert,S as templateOnRead};
1
+ import{blockSourceSpec as B,declaredBlockSource as L}from"./block-sources.js";import{isNodeList as _}from"efficient-easel/data";import{BOX_TYPE as C}from"../document/container-blocks.js";import{globalRegistry as A}from"../global-registry.js";import{nonEmptyString as b}from"../non-empty-string.js";import{accentItalicRuns as O}from"../markup.js";import{withCardsTemplate as S}from"../document/cards-template-on-read.js";import{withCardListTemplate as h}from"../document/blocks/general/CardList/item-seed.js";import{withLogosTemplate as E}from"../document/blocks/general/Logos/card-seed.js";const I="template",ne="Card template",d="CardList",x=["Text","ImageBlock","ButtonBlock","Flex"],u="rowField",P="rowLinkField";function le(){return{type:"slot",allow:[...x]}}const F=x.filter(e=>e!=="ButtonBlock"),g="items",R="itemFields";function ie(){return{type:"slot",allow:[...F]}}const D=[{block:"OrderSummary",typedRows:"rows",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{block:"Footprint",typedRows:"offices",fields:[{key:"badge",label:"HQ"},{key:"role",label:"Role"},{key:"city",label:"City"},{key:"country",label:"Region · country"},{key:"address",label:"Address"},{key:"linkLabel",label:"Button"},{key:"href",label:"Link",kind:"link"}]},{block:"Cards",typedRows:"items",fields:[{key:"num",label:"Number"},{key:"since",label:"Corner note"},{key:"label",label:"Label"},{key:"title",label:"Card title"},{key:"value",label:"Value"},{key:"body",label:"Card body",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:"count",label:"Count"},{key:"badge",label:"Highlight badge",everySource:!0}],seed:e=>S("Cards",e)},{block:"ProcessSteps",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title",mark:"accentItalic"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"},{key:"specs",label:"Specs",kind:"list",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]}],blocks:[{type:d,label:"Card list"}]},{block:"Logos",fields:[{key:"label",label:"Name"},{key:"kind",label:"Kind"}],seed:e=>E(e)},{block:d,fields:[],typedRows:g,seed:e=>h(e)}];function c(){return A("efficient.card-templates",()=>new Map(D.map(e=>[e.block,e])))}function se(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");const r=[];for(const n of t.blocks??[]){if(typeof n?.type!="string"||!n.type)throw new Error(`The card template of ${t.block} names an empty block.`);r.some(i=>i.type===n.type)||r.push({type:n.type,label:n.label||n.type})}const o=b(t.typedRows);c().set(t.block,{block:t.block,fields:t.fields.map(n=>({...n})),blocks:r,typedRows:o,...t.seed?{seed:t.seed}:{}})}}function W(e,t){const r=e?c().get(e)?.seed:void 0;return r?r(t):t}function ce(e,t){if(!(t.template===void 0||Array.isArray(t.template)&&t.template.length===0))return t;const{template:o,...n}=t,i=W(e,n);return i===n?t:i}function ae(){for(const e of c().values())if(e.blocks?.length)return!0;return!1}function ue(e){return c().get(e)?.blocks??[]}function fe(e){for(const t of c().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function de(e){return typeof e=="string"&&c().get(e)?.typedRows||""}function M(e){return typeof e=="string"&&c().has(e)}function N(e,t){const r=c().get(e)?.fields??[];return t?r.filter(o=>(o.kind??"text")===t):r}function v(e){return typeof e=="string"?N(e,"list")[0]?.key??"":""}function K(e,t){return p(e)||v(t)}function T(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const o=c().get(r)?.fields??[],n=B(L(e?.props))?.fields,i=n?.length?[...n.map(l=>({...l})),...o.filter(l=>l.everySource&&!n.some(s=>s.key===l.key))]:o;return t?i.filter(l=>(l.kind??"text")===t):i}function j(e,t,r){return e?r?T(r).find(o=>o.key===t)??null:c().get(e)?.fields.find(o=>o.key===t)??null:null}function p(e,t=u){const r=e?.[t];return typeof r=="string"?r.trim():""}function pe(e,t){return e.key||String(t+1)}function ye(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[r,o]of Object.entries(e))typeof o=="string"&&(t[r]=o);return t}const H="hideWhenRowEmpty";function me(e,t){const r=e[H];return!t||!Array.isArray(r)||!r.length?!1:r.every(o=>typeof o!="string"||!t[o]?.trim())}function ke(e,t,r=""){const o=t&&e&&typeof e=="object"?e[t]:void 0;if(!Array.isArray(o))return"";for(const n of o){const i=typeof n=="string"?n:n?.src,l=b(typeof i=="string"?i.trim():void 0);if(l&&l!==r.trim())return l}return""}const y={Text:{text:u},ImageBlock:{src:u},ButtonBlock:{label:u,href:P},LogoBlock:{alt:u},Breadcrumb:{currentCrumb:u}},be=y,Y=new Set(["ButtonBlock.label","LogoBlock.alt"]);function xe(e,t,r){return U(e,t,r)&&!Y.has(`${e}.${r}`)}function U(e,t,r){return $(e,t,r)!==""}function $(e,t,r){const o=y[e]?.[r];return o?p(t,o):""}function V(e,t){return!t||!e?null:e[t]??""}function ge(e,t,r,o){if(!r)return t;let n=null;for(const[i,l]of Object.entries(y[e]??{})){const s=p(t,l),a=V(r,s);a!==null&&(n??={...t},n[i]=o&&j(o,s)?.mark==="accentItalic"?O(a):a)}return n??t}function m(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const o=(i,l)=>{for(const s of i){if(s?.props?.id===t)return l;for(const[a,f]of Object.entries(s?.props??{})){if(!_(f))continue;const w=a===I&&M(s.type)?{owner:s,direct:!0,nested:l!==null,underBox:!1}:l&&{owner:l.owner,direct:!1,nested:l.nested,underBox:l.underBox||s.type===C},k=o(f,w);if(k!==void 0)return k}}},n=o(r,null);return n===void 0?null:n}function X(e,t){const r=m(e,t);return r&&r.owner}function Re(e,t){const r=m(e,t);return r&&(r.direct?r.owner:null)}function Te(e,t){const r=m(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}function we(e,t,r){if(t?.type!==d)return[];const o=X(e,t.props?.id);if(!o)return Q(t.props,r);const n=K(t.props,o.type),i=n&&T(o,"list").find(l=>l.key===n)?.fields||[];return r?i.filter(l=>(l.kind??"text")===r):i}function Be(e,t){return{[u]:"",[g]:e.map(r=>({...r})),[R]:t.map(r=>({...r}))}}function Q(e,t){const r=e?.[R];if(!Array.isArray(r))return[];const o=r.flatMap(n=>{if(!n||typeof n!="object")return[];const{key:i,label:l,kind:s,multiline:a}=n;if(typeof i!="string"||!i||typeof l!="string")return[];const f=s==="image"||s==="link"||s==="colour"?s:void 0;return[{key:i,label:l,...f?{kind:f}:{},...a===!0?{multiline:!0}:{}}]});return t?o.filter(n=>(n.kind??"text")===t):o}export{H as BOX_HIDE_WHEN_ROW_EMPTY,R as CARD_LIST_FIELDS,F as CARD_LIST_ITEM_BLOCKS,g as CARD_LIST_ROWS,d as CARD_LIST_TYPE,u as CARD_ROW_FIELD_PROP,P as CARD_ROW_LINK_PROP,x as CARD_TEMPLATE_BLOCKS,ne as CARD_TEMPLATE_LABEL,I as CARD_TEMPLATE_SLOT,be as ROW_BOUND_PROPS,Y as ROW_PART_BY_WORDS,Te as cardCopyPlace,pe as cardKeyOf,we as cardListFieldsOf,ie as cardListItemSlot,Be as cardListProps,K as cardListShows,ye as cardRow,ue as cardTemplateBlocks,Re as cardTemplateCardOwner,j as cardTemplateField,N as cardTemplateFields,T as cardTemplateFieldsOf,X as cardTemplateOwner,le as cardTemplateSlot,de as cardTemplateTypedRows,ae as cardTemplatesNameBlocks,v as defaultListField,M as hasCardTemplate,fe as isCardTemplateBlock,p as namedRowField,se as registerCardTemplates,U as rowBound,$ as rowFieldOf,V as rowFieldText,ge as rowFilledProps,ke as rowNextPicture,xe as rowPartByKey,me as templateBoxIsEmpty,ce as templateOnInsert,W as templateOnRead};
@@ -1,5 +1,5 @@
1
1
  import { type SourceRow } from "./block-sources.js";
2
- export declare function linkedCount(props?: Record<string, unknown> | null): string;
2
+ export declare function linkedCount(props?: Record<string, unknown> | null, row?: SourceRow | null): string;
3
3
  export declare function countWords(value: string): string;
4
4
  export declare function countNumber(key: string, served: readonly SourceRow[] | null): string | null;
5
5
  export declare function countsReachText(content: unknown, id: unknown): boolean;
@@ -1 +1 @@
1
- import{isNodeList as i}from"efficient-easel/data";import{namedRowField as C}from"./card-template.js";import{BLOCK_SOURCE_PROP as d,COUNT_KEY_PROP as N,COUNTS_SOURCE as c,declaredBlockSource as l,sourceChoices as _}from"./block-sources.js";const a="Flex";function R(e){if(C(e))return"";const t=e?.[N];return typeof t=="string"?t.trim():""}const E=new Intl.NumberFormat("en-US");function S(e){return/^\d+$/.test(e)?E.format(Number(e)):e}function y(e,t){const r=t?t.find(n=>n.key===e)?.value:_(c).find(n=>n.key===e)?.value;return r===void 0?null:S(r)}function m(e){const t=e.props;if(!t)return{node:e,names:!1};let r=e.type==="Text"&&R(t)!=="",n=t;for(const[u,s]of Object.entries(t)){if(!i(s))continue;const p=s.map(m);p.some(f=>f.names)&&(r=!0),p.some((f,O)=>f.node!==s[O])&&(n={...n,[u]:p.map(f=>f.node)})}if(e.type!==a)return{node:n===t?e:{...e,props:n},names:r};const o=l(n);if(r&&!o&&(n={...n,[d]:c}),!r&&o===c){const{[d]:u,...s}=n;n=s}return{node:n===t?e:{...e,props:n},names:!1}}function x(e,t,r){for(const n of e){if(n?.props?.id===t)return r;for(const o of Object.values(n?.props??{})){if(!i(o))continue;const u=x(o,t,n.type===a?n:r);if(u!==void 0)return u}}}function B(e,t){if(!i(e))return!0;const r=x(e,t,null);if(r===void 0)return!0;if(r===null)return!1;const n=l(r.props);return!n||n===c}function P(e){const t=e?.content;if(!i(t))return e;const r=t.map(m);return r.every((n,o)=>n.node===t[o])?e:{...e,content:r.map(n=>n.node)}}function T(e){return m(e).node}export{y as countNumber,S as countWords,B as countsReachText,R as linkedCount,T as settleCountNode,P as settleCountSources};
1
+ import{isNodeList as c}from"efficient-easel/data";import{CARD_LIST_ROWS as _,CARD_LIST_TYPE as y,namedRowField as E}from"./card-template.js";import{BLOCK_SOURCE_PROP as C,COUNT_KEY_PROP as f,COUNTS_SOURCE as p,declaredBlockSource as x,sourceChoices as U}from"./block-sources.js";const N="Flex";function R(e,r){return E(e)?typeof e?.[f]=="string"?a(r?.[f]):"":a(e?.[f])}const a=e=>typeof e=="string"?e.trim():"",P=e=>e.type===y&&Array.isArray(e.props?.[_])&&e.props[_].some(r=>a(r?.[f])!==""),b=new Intl.NumberFormat("en-US");function A(e){return/^\d+$/.test(e)?b.format(Number(e)):e}function Y(e,r){const n=r?r.find(t=>t.key===e)?.value:U(p).find(t=>t.key===e)?.value;return n===void 0?null:A(n)}const B={[f]:"any"};function l(e,r=!1){const n=e.props;if(!n)return{node:e,names:!1};let t=e.type==="Text"&&(R(n)!==""||r&&R(n,B)!=="");const u=r||P(e);let o=n;for(const[O,i]of Object.entries(n)){if(!c(i))continue;const m=i.map(s=>l(s,u));m.some(s=>s.names)&&(t=!0),m.some((s,T)=>s.node!==i[T])&&(o={...o,[O]:m.map(s=>s.node)})}if(e.type!==N)return{node:o===n?e:{...e,props:o},names:t};const d=x(o);if(t&&!d&&(o={...o,[C]:p}),!t&&d===p){const{[C]:O,...i}=o;o=i}return{node:o===n?e:{...e,props:o},names:!1}}function S(e,r,n){for(const t of e){if(t?.props?.id===r)return n;for(const u of Object.values(t?.props??{})){if(!c(u))continue;const o=S(u,r,t.type===N?t:n);if(o!==void 0)return o}}}function g(e,r){if(!c(e))return!0;const n=S(e,r,null);if(n===void 0)return!0;if(n===null)return!1;const t=x(n.props);return!t||t===p}function k(e){const r=e?.content;if(!c(r))return e;const n=r.map(t=>l(t));return n.every((t,u)=>t.node===r[u])?e:{...e,content:n.map(t=>t.node)}}function F(e){return l(e).node}export{Y as countNumber,A as countWords,g as countsReachText,R as linkedCount,F as settleCountNode,k as settleCountSources};
@@ -1 +1 @@
1
- const E={heading:"Join our email list",placeholder:"Email address",buttonLabel:"Subscribe"},a={lead:"We accept"},u={...a,methods:[],size:"sm",align:"start",dataSource:"shop-payment-methods"},c="site-footer",d=c,m=c,f={desktop:!0,tablet:!0,mobile:!0},x={desktop:!1,tablet:!1,mobile:!1},s=1,l=6,T=Array.from({length:l-s+1},(t,o)=>s+o),n={desktop:6,tablet:3,mobile:2},i={2:{desktop:2,tablet:2,mobile:1},3:{desktop:3,tablet:3,mobile:1},4:{desktop:4,tablet:2,mobile:2},5:{desktop:5,tablet:3,mobile:2},6:{desktop:6,tablet:3,mobile:2}},r=t=>Math.min(Math.max(Math.round(t),s),l);function F(t){if(typeof t=="number")return i[r(t)]??{desktop:r(t),tablet:r(t),mobile:r(t)};if(t&&typeof t=="object"){const o=t;return{desktop:r(o.desktop??n.desktop),tablet:r(o.tablet??n.tablet),mobile:r(o.mobile??n.mobile)}}return{...n}}function b(t){const o=t?.content;return Array.isArray(o)?o.find(e=>!!e&&typeof e=="object"&&e.type==="Footer")??null:null}function A(t){const o=t?.content;return Array.isArray(o)?o.find(e=>!!e&&typeof e=="object"&&e.type===O)??b(t):null}const O="SiteFooter",_="SiteHeader";function L(t){const o=t?.content;return Array.isArray(o)?o.find(e=>!!e&&typeof e=="object"&&e.type===_)??null:null}function S(t){const o=t?.root?.props;return o&&typeof o=="object"&&!Array.isArray(o)?o:null}export{E as EMAIL_SIGNUP_PH,n as FOOTER_COLUMNS_DEFAULT,l as FOOTER_COLUMNS_MAX,s as FOOTER_COLUMNS_MIN,T as FOOTER_COLUMN_STEPS,a as FOOTER_PAYMENT_PH,u as FOOTER_PAYMENT_SEED,d as FOOTER_SOURCE_SLUG,f as LOGO_FILL_DEFAULT,x as LOGO_ROW_FILL_DEFAULT,O as SITE_FOOTER_GROUP_TYPE,m as SITE_FOOTER_KIND,c as SITE_FOOTER_SLUG,_ as SITE_HEADER_GROUP_TYPE,A as extractDrawnFooter,b as extractFooterBlock,S as extractFooterRootProps,L as extractHeaderGroup,F as normalizeFooterColumns};
1
+ import{SHOP_PAYMENT_METHODS_SOURCE as i}from"./block-sources.js";const m={heading:"Join our email list",placeholder:"Email address",buttonLabel:"Subscribe"},a={lead:"We accept"},d={...a,methods:[],size:"sm",align:"start",dataSource:i},c="site-footer",f=c,T=c,x={desktop:!0,tablet:!0,mobile:!0},F={desktop:!1,tablet:!1,mobile:!1},s=1,l=6,S=Array.from({length:l-s+1},(t,o)=>s+o),n={desktop:6,tablet:3,mobile:2},O={2:{desktop:2,tablet:2,mobile:1},3:{desktop:3,tablet:3,mobile:1},4:{desktop:4,tablet:2,mobile:2},5:{desktop:5,tablet:3,mobile:2},6:{desktop:6,tablet:3,mobile:2}},r=t=>Math.min(Math.max(Math.round(t),s),l);function A(t){if(typeof t=="number")return O[r(t)]??{desktop:r(t),tablet:r(t),mobile:r(t)};if(t&&typeof t=="object"){const o=t;return{desktop:r(o.desktop??n.desktop),tablet:r(o.tablet??n.tablet),mobile:r(o.mobile??n.mobile)}}return{...n}}function _(t){const o=t?.content;return Array.isArray(o)?o.find(e=>!!e&&typeof e=="object"&&e.type==="Footer")??null:null}function L(t){const o=t?.content;return Array.isArray(o)?o.find(e=>!!e&&typeof e=="object"&&e.type===b)??_(t):null}const b="SiteFooter",E="SiteHeader";function R(t){const o=t?.content;return Array.isArray(o)?o.find(e=>!!e&&typeof e=="object"&&e.type===E)??null:null}function y(t){const o=t?.root?.props;return o&&typeof o=="object"&&!Array.isArray(o)?o:null}export{m as EMAIL_SIGNUP_PH,n as FOOTER_COLUMNS_DEFAULT,l as FOOTER_COLUMNS_MAX,s as FOOTER_COLUMNS_MIN,S as FOOTER_COLUMN_STEPS,a as FOOTER_PAYMENT_PH,d as FOOTER_PAYMENT_SEED,f as FOOTER_SOURCE_SLUG,x as LOGO_FILL_DEFAULT,F as LOGO_ROW_FILL_DEFAULT,b as SITE_FOOTER_GROUP_TYPE,T as SITE_FOOTER_KIND,c as SITE_FOOTER_SLUG,E as SITE_HEADER_GROUP_TYPE,L as extractDrawnFooter,_ as extractFooterBlock,y as extractFooterRootProps,R as extractHeaderGroup,A as normalizeFooterColumns};
@@ -15,6 +15,7 @@ export interface FootprintOffice {
15
15
  linkLabel?: string;
16
16
  }
17
17
  export declare function footprintOfficeOfRow(row: Readonly<Record<string, string>>): FootprintOffice;
18
+ export declare function footprintCardRow(office: FootprintOffice): Record<string, string>;
18
19
  export interface FootprintContent {
19
20
  sectionNumber: string;
20
21
  heading: string;
@@ -1 +1 @@
1
- import{hasMapCoords as a,mapCoordOfText as r}from"../map-styles.js";const s=/^https?:\/\//i;function o(t){const e=(t.href??"").trim(),n=(t.linkLabel??"").trim();return{role:t.role??"",city:t.city??"",country:t.country??"",address:t.address??"",hq:t.hq==="true",lat:r(t.lat),lng:r(t.lng),...e&&n&&s.test(e)?{href:e,linkLabel:n}:{}}}const p={sectionNumber:"",heading:"",tagline:"",mapTheme:"auto"};function h(t){const e=[];return t.forEach((n,l)=>{a(n.lat,n.lng)&&e.push({key:String(l),label:n.city||n.role||"Office",lat:n.lat,lng:n.lng,glyph:"",tone:"",...n.hq?{badge:"HQ"}:{}})}),e}export{p as FOOTPRINT_DEFAULTS,o as footprintOfficeOfRow,h as footprintPins};
1
+ import{hasMapCoords as a,mapCoordOfText as e}from"../map-styles.js";const s=/^https?:\/\//i;function h(t){const r=(t.href??"").trim(),n=(t.linkLabel??"").trim();return{role:t.role??"",city:t.city??"",country:t.country??"",address:t.address??"",hq:t.hq==="true",lat:e(t.lat),lng:e(t.lng),...r&&n&&s.test(r)?{href:r,linkLabel:n}:{}}}function i(t){const r=n=>typeof n=="string"?n:"";return{badge:t.hq?"HQ":"",role:r(t.role),city:r(t.city),country:r(t.country),address:r(t.address),...t.href&&t.linkLabel?{href:t.href,linkLabel:t.linkLabel}:{}}}const p={sectionNumber:"",heading:"",tagline:"",mapTheme:"auto"};function u(t){const r=[];return t.forEach((n,l)=>{a(n.lat,n.lng)&&r.push({key:String(l),label:n.city||n.role||"Office",lat:n.lat,lng:n.lng,glyph:"",tone:"",...n.hq?{badge:"HQ"}:{}})}),r}export{p as FOOTPRINT_DEFAULTS,i as footprintCardRow,h as footprintOfficeOfRow,u as footprintPins};
@@ -0,0 +1,22 @@
1
+ import type { RowHand } from "./mirror-cards.js";
2
+ export type ImageTextArrangement = "columns" | "rows-left" | "rows-right";
3
+ export type ImageTextImageWidth = "half" | "third";
4
+ export type ImageTextPhoneOrder = "picture" | "words";
5
+ export declare const ARRANGEMENT_OPTIONS: readonly {
6
+ value: ImageTextArrangement;
7
+ label: string;
8
+ }[];
9
+ export declare const IMAGE_WIDTH_OPTIONS: readonly {
10
+ value: ImageTextImageWidth;
11
+ label: string;
12
+ }[];
13
+ export declare const PHONE_ORDER_OPTIONS: readonly {
14
+ value: ImageTextPhoneOrder;
15
+ label: string;
16
+ }[];
17
+ export declare function arrangementOf(value: unknown): ImageTextArrangement;
18
+ export declare function imageTextRowsHand(props: {
19
+ arrangement?: unknown;
20
+ imageWidth?: unknown;
21
+ phoneOrder?: unknown;
22
+ } | null | undefined): RowHand | null;