efficient-web-builder 47.1.0 → 48.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/CHANGELOG.md +67 -1
  2. package/dist/editor/components/BlockGapField.d.ts +15 -1
  3. package/dist/editor/components/BlockGapField.js +1 -1
  4. package/dist/editor/components/DuplicateToPageMenu.d.ts +2 -0
  5. package/dist/editor/components/DuplicateToPageMenu.js +1 -1
  6. package/dist/editor/components/HeroPartPanel.js +1 -1
  7. package/dist/editor/components/HoverEffectField.d.ts +1 -0
  8. package/dist/editor/components/HoverEffectField.js +1 -1
  9. package/dist/editor/components/MediaUploadField.d.ts +9 -0
  10. package/dist/editor/components/MediaUploadField.js +1 -1
  11. package/dist/editor/components/PartSettingsPanel.d.ts +2 -1
  12. package/dist/editor/components/PartSettingsPanel.js +1 -1
  13. package/dist/editor/components/PreviewPartAnchors.d.ts +3 -1
  14. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  15. package/dist/editor/components/SameInEveryViewNote.d.ts +1 -0
  16. package/dist/editor/components/SameInEveryViewNote.js +1 -0
  17. package/dist/editor/components/SaveAsTemplateButton.d.ts +5 -0
  18. package/dist/editor/components/SaveAsTemplateButton.js +1 -0
  19. package/dist/editor/components/SideSpaceField.d.ts +31 -1
  20. package/dist/editor/components/SideSpaceField.js +1 -1
  21. package/dist/editor/components/SiteFields.d.ts +4 -1
  22. package/dist/editor/components/SiteFields.js +1 -1
  23. package/dist/editor/components/SiteRestoreNotice.js +1 -1
  24. package/dist/editor/components/SiteTextStylesField.js +1 -1
  25. package/dist/editor/components/StandaloneSectionEditor.js +1 -1
  26. package/dist/editor/components/StorefrontEditor.js +1 -1
  27. package/dist/editor/components/TickerSettingsPanel.js +1 -1
  28. package/dist/editor/components/VersionHistoryDrawer.js +1 -1
  29. package/dist/editor/components/WebsitePreviewButton.d.ts +2 -1
  30. package/dist/editor/components/WebsitePreviewButton.js +1 -1
  31. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  32. package/dist/editor/components/WebsiteSettingsPanel.d.ts +10 -0
  33. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  34. package/dist/editor/components/usePartMotion.d.ts +10 -0
  35. package/dist/editor/components/usePartMotion.js +1 -0
  36. package/dist/editor/components/useSocialSettings.d.ts +2 -2
  37. package/dist/editor/lib/animation/AnimationDurationRow.d.ts +4 -0
  38. package/dist/editor/lib/animation/AnimationDurationRow.js +1 -1
  39. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  40. package/dist/editor/lib/animation/fields.d.ts +1 -1
  41. package/dist/editor/lib/animation/fields.js +1 -1
  42. package/dist/editor/lib/animation/hover-fields.d.ts +1 -0
  43. package/dist/editor/lib/animation/hover-fields.js +1 -0
  44. package/dist/editor/lib/animation/loop-fields.js +1 -1
  45. package/dist/editor/lib/document/add-target.d.ts +2 -1
  46. package/dist/editor/lib/document/add-target.js +1 -1
  47. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  48. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  49. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  50. package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
  51. package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
  52. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  53. package/dist/editor/lib/document/build-config.js +1 -1
  54. package/dist/editor/lib/document/canvas-typing.js +1 -1
  55. package/dist/editor/lib/document/card-display-chips.d.ts +33 -0
  56. package/dist/editor/lib/document/card-display-chips.js +1 -0
  57. package/dist/editor/lib/document/controls.d.ts +19 -2
  58. package/dist/editor/lib/document/controls.js +1 -1
  59. package/dist/editor/lib/document/field-groups.js +1 -1
  60. package/dist/editor/lib/document/geocode-resolve.d.ts +1 -0
  61. package/dist/editor/lib/document/geocode-resolve.js +1 -1
  62. package/dist/editor/lib/document/live-number-field.d.ts +12 -0
  63. package/dist/editor/lib/document/live-number-field.js +1 -0
  64. package/dist/editor/lib/document/page-root.js +2 -2
  65. package/dist/editor/lib/document/part-motion-canvas.d.ts +10 -0
  66. package/dist/editor/lib/document/part-motion-canvas.js +2 -0
  67. package/dist/editor/lib/editor-document-adapter.d.ts +5 -1
  68. package/dist/editor/lib/editor-document-adapter.js +1 -1
  69. package/dist/editor/lib/sections/section-dry-run.d.ts +34 -0
  70. package/dist/editor/lib/sections/section-dry-run.js +2 -2
  71. package/dist/format/lib/animation/hover.d.ts +5 -0
  72. package/dist/format/lib/animation/hover.js +1 -0
  73. package/dist/format/lib/animation/index.d.ts +1 -0
  74. package/dist/format/lib/animation/index.js +1 -1
  75. package/dist/format/lib/content/block-sources.d.ts +9 -0
  76. package/dist/format/lib/content/block-sources.js +1 -1
  77. package/dist/format/lib/content/box-layout.d.ts +20 -1
  78. package/dist/format/lib/content/box-layout.js +1 -1
  79. package/dist/format/lib/content/box-separator.js +1 -1
  80. package/dist/format/lib/content/card-template.d.ts +9 -0
  81. package/dist/format/lib/content/card-template.js +1 -1
  82. package/dist/format/lib/content/container-gap.d.ts +11 -2
  83. package/dist/format/lib/content/container-gap.js +1 -1
  84. package/dist/format/lib/content/count-numbers.d.ts +7 -0
  85. package/dist/format/lib/content/count-numbers.js +1 -0
  86. package/dist/format/lib/content/page-width.d.ts +11 -0
  87. package/dist/format/lib/content/page-width.js +1 -1
  88. package/dist/format/lib/content/section-sticky.d.ts +1 -0
  89. package/dist/format/lib/content/section-sticky.js +1 -1
  90. package/dist/format/lib/content/site-gutter.d.ts +6 -0
  91. package/dist/format/lib/content/site-gutter.js +1 -1
  92. package/dist/format/lib/document/easel-row-words.d.ts +2 -0
  93. package/dist/format/lib/document/easel-row-words.js +1 -1
  94. package/dist/format/lib/document/panel-bands.d.ts +1 -0
  95. package/dist/format/lib/document/panel-bands.js +1 -1
  96. package/dist/format/lib/document/panel-tabs.d.ts +8 -0
  97. package/dist/format/lib/document/panel-tabs.js +1 -0
  98. package/dist/format/lib/document/part-records.d.ts +6 -0
  99. package/dist/format/lib/document/part-records.js +1 -0
  100. package/dist/format/lib/document/passes/registry-context.d.ts +1 -1
  101. package/dist/format/lib/document/passes/registry-context.js +1 -1
  102. package/dist/format/lib/document/passes/settings-groups.js +1 -1
  103. package/dist/format/lib/document/passes/types.d.ts +2 -0
  104. package/dist/format/lib/document/section-groups.d.ts +1 -1
  105. package/dist/format/lib/document/site-gap-fields.d.ts +1 -1
  106. package/dist/format/lib/document/site-gap-fields.js +1 -1
  107. package/dist/format/lib/editor-words-catalogue.d.ts +11 -0
  108. package/dist/format/lib/editor-words-catalogue.js +4 -4
  109. package/dist/format/lib/fit-words.js +4 -3
  110. package/dist/format/lib/hero-ticker.d.ts +1 -0
  111. package/dist/format/lib/hero-ticker.js +1 -1
  112. package/dist/format/lib/sections/strip-shape.d.ts +1 -0
  113. package/dist/format/lib/sections/strip-shape.js +1 -1
  114. package/dist/format/lib/site-theme-row.d.ts +2 -0
  115. package/dist/format/lib/site-twin-row.d.ts +5 -0
  116. package/dist/format/lib/site-twin-row.js +1 -0
  117. package/dist/format/lib/source-rules/flat-theme-palette.js +1 -1
  118. package/dist/format/lib/source-rules/one-loop-module.js +3 -3
  119. package/dist/render/components/BlockFrame.d.ts +2 -1
  120. package/dist/render/components/BlockFrame.js +1 -1
  121. package/dist/render/components/Btn.js +1 -1
  122. package/dist/render/components/CardRowContext.d.ts +3 -1
  123. package/dist/render/components/CardRowContext.js +1 -1
  124. package/dist/render/components/CountRowsContext.d.ts +8 -0
  125. package/dist/render/components/CountRowsContext.js +1 -0
  126. package/dist/render/components/Flex.d.ts +5 -1
  127. package/dist/render/components/Flex.js +1 -1
  128. package/dist/render/components/Grid.d.ts +2 -1
  129. package/dist/render/components/Grid.js +1 -1
  130. package/dist/render/components/HeroGroup.d.ts +2 -1
  131. package/dist/render/components/HeroGroup.js +1 -1
  132. package/dist/render/components/HeroSection.d.ts +2 -1
  133. package/dist/render/components/HeroSection.js +1 -1
  134. package/dist/render/components/HeroSingle.d.ts +2 -1
  135. package/dist/render/components/HeroSingle.js +1 -1
  136. package/dist/render/components/ImageBlock.d.ts +4 -1
  137. package/dist/render/components/ImageBlock.js +1 -1
  138. package/dist/render/components/InBoxContext.d.ts +1 -0
  139. package/dist/render/components/InBoxContext.js +1 -1
  140. package/dist/render/components/IntroBleed.js +1 -1
  141. package/dist/render/components/LocationMap.js +1 -1
  142. package/dist/render/components/PartStyledKind.js +1 -1
  143. package/dist/render/components/PartStyledText.js +1 -1
  144. package/dist/render/components/PreviewHeaderContext.d.ts +9 -1
  145. package/dist/render/components/PreviewHeaderContext.js +1 -1
  146. package/dist/render/components/PublishedPartStylesContext.d.ts +4 -1
  147. package/dist/render/components/PublishedPartStylesContext.js +1 -1
  148. package/dist/render/components/SectionAnimation.d.ts +8 -2
  149. package/dist/render/components/SectionAnimation.js +1 -1
  150. package/dist/render/components/SiteGutterFrame.d.ts +7 -1
  151. package/dist/render/components/SiteGutterFrame.js +1 -1
  152. package/dist/render/lib/animation/LoopTrack.d.ts +2 -2
  153. package/dist/render/lib/animation/LoopTrack.js +1 -1
  154. package/dist/render/lib/animation/part-motion.d.ts +21 -0
  155. package/dist/render/lib/animation/part-motion.js +1 -0
  156. package/dist/render/lib/content/block-size.js +1 -1
  157. package/dist/render/lib/content/button-look.js +1 -1
  158. package/dist/render/lib/content/section-edge.d.ts +10 -0
  159. package/dist/render/lib/content/section-edge.js +1 -0
  160. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  161. package/dist/render/lib/document/blocks/general/Grid/render.js +1 -1
  162. package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
  163. package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
  164. package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
  165. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  166. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  167. package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +1 -0
  168. package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
  169. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +8 -0
  170. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  171. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.d.ts +1 -1
  172. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  173. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  174. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.d.ts +2 -0
  175. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -0
  176. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
  177. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
  178. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
  179. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  180. package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
  181. package/dist/render/lib/document/part-styles.d.ts +10 -1
  182. package/dist/render/lib/document/part-styles.js +2 -2
  183. package/dist/render/lib/document/passes/block-size.js +1 -1
  184. package/dist/render/lib/document/passes/clickable-parts.js +1 -1
  185. package/dist/render/lib/document/passes/section-anchor.js +1 -1
  186. package/dist/render/lib/document/passes/section-padding.js +1 -1
  187. package/dist/render/lib/document/passes/slots-start-afresh.js +1 -1
  188. package/dist/render/lib/sections/section-to-box.d.ts +5 -1
  189. package/dist/render/lib/sections/section-to-box.js +1 -1
  190. package/dist/render/lib/text-styles/site-text-styles.d.ts +16 -4
  191. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  192. package/package.json +3 -3
  193. package/dist/editor/lib/document/selected-host.d.ts +0 -2
  194. package/dist/editor/lib/document/selected-host.js +0 -1
@@ -1,8 +1,10 @@
1
1
  import type { LockHolder, SaveConflict } from "efficient-easel/edit-lock";
2
+ import type { SectionTemplateStore } from "efficient-easel/screen/lib/section-template-types";
3
+ import type { TreeItem } from "efficient-easel/draw";
2
4
  import { type OfferedSets } from "./editor-blocks.js";
3
5
  import type { EaselCapabilities as EditorCapabilities, EaselDocument as EditorDocument, EaselDocumentAdapter as EditorDocumentAdapter } from "efficient-easel/screen/lib/document-contract";
4
6
  import type { SiteVersionsAccess } from "./site-versions.js";
5
- import type { EditorPageRow, SiteLiveState, WebsiteBackend } from "../../format/lib/web-backend.js";
7
+ import type { EditorPageRow, SiteLiveState, WebsiteBackend, WebsitePages } from "../../format/lib/web-backend.js";
6
8
  export type { EditorPageRow };
7
9
  export type { EditorCapabilities, EditorDocument, EditorDocumentAdapter };
8
10
  export type WebsiteCapabilities = EditorCapabilities & {
@@ -36,5 +38,7 @@ export type WebsiteDocumentAdapter = EditorDocumentAdapter & {
36
38
  export type SitePageAdapterOptions = {
37
39
  editsPinnedInPlace?: boolean;
38
40
  };
41
+ export declare function settlingPages(pages: WebsitePages): WebsitePages;
42
+ export declare function saveSectionTemplate(store: Pick<SectionTemplateStore, "update">, id: string, node: TreeItem): Promise<import("efficient-easel/screen/lib/section-template-types").SectionTemplate>;
39
43
  export declare function makeSitePageAdapter(siteId: string | undefined, backend?: WebsiteBackend, offered?: OfferedSets, options?: SitePageAdapterOptions): WebsiteDocumentAdapter;
40
44
  export declare function makeTemplatePageAdapter(templateId: string, backend?: WebsiteBackend, offered?: OfferedSets): WebsiteDocumentAdapter;
@@ -1 +1 @@
1
- "use client";import{SITE_FOOTER_SLUG as H}from"../../format/lib/content/footer.js";import{offeredSetsOf as x}from"./editor-blocks.js";import{isBackendError as F}from"efficient-easel/screen/lib/backend-error";import{isEfficientBackend as z}from"efficient-easel/screen/lib/session";import{noteLoaded as M,notePublished as _,noteSaved as T,pageLiveState as Z}from"./page-live-state.js";import{noteSiteLiveState as ee,refreshSiteLiveState as A}from"./site-live-state.js";import{say as te}from"../../format/lib/editor-words.js";import{sendSiteWrites as ne}from"../../format/lib/site-writes.js";import{isPopupPageLayout as oe}from"../../format/lib/popup/new-popup.js";import{spliceChrome as ie,splitChrome as G}from"./pinned-chrome-doc.js";import{references as se,sectionNodeOf as re,spliceShared as le,splitShared as ae}from"../../format/lib/shared-section-docs.js";import{setActiveSharedSections as W}from"../../format/lib/shared-sections-active.js";import{setActivePinnedChrome as Y}from"../../format/lib/pinned-chrome-lock.js";import{backendOf as $}from"./website-session.js";function I(n){return!!(n?.publish&&n.liveState)}function ce(n,s){if(!I(n))return;const{versions:c,nameVersion:d,restoreVersion:a,previewVersion:o}=n;if(!(!c||!d||!a||!o))return{list:()=>c.call(n,s),name:(f,w)=>d.call(n,f,w,s),restore:(f,w)=>a.call(n,f,w??{},s),preview:f=>o.call(n,f,s)}}function de(n,s){return async(c,d)=>{try{await ne()}catch(o){throw new Error(te("A change waiting to go live could not be saved."),{cause:o})}return(await n.publish(s)).state==="live"?ee({state:"live",changes:[]}):A(0),{version:d??null}}}function N(n,s,c){const d=s?{siteId:s}:void 0;return{resolve:a=>n.load({slug:a,...d}).then(o=>(o&&M(o.id,o.live),o)),saveLayout:(a,o,f,w)=>n.save(a,{layout:o},{version:f,clientId:w??""}).then(v=>(T(a,v.live),A(),v)),rereadVersion:n.version?a=>n.version(a):void 0,publish:I(c)?de(c,d):n.publish?(a,o)=>n.publish(a,o?{version:o}:void 0).then(f=>(_(a,f.live),f)):void 0,listPages:()=>n.list(d),createPage:n.create?a=>n.create({...a,...d}):void 0,deletePage:n.remove?(a,o)=>n.remove(a,o):void 0}}function ue(n,s,c,d,a=!1){let o=null;const f=new Set;let w=!1,v=new Map,y=new Map,h=new Map,g=new Map,P={docId:null,lockHolder:null,conflict:null,saveFailed:!1,unpublished:!1,loadFailed:!1,sections:[]};const B=new Set,D=()=>{if(!o)return!1;const e=Z(o.id);return e==="changed"||e==="never"||e===void 0&&w},S=e=>{P={...P,...e,docId:o?.id??null,unpublished:D(),sections:[...h.values()]};for(const t of B)t()},k=(e,t,i)=>{t?h.set(e,{section:e,title:v.get(e)?.title??"",problem:t,holder:i}):h.delete(e)},C=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},L=e=>f.has(e),R=()=>new Map([...v].map(([e,t])=>[e,t.layout])),V=()=>`SharedSection-${typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2)}`,J=(e,t,i,r)=>{const l=C(t);v.set(e,{layout:l,version:i,savedJson:JSON.stringify(l),title:r})},U={state:()=>P,subscribe:e=>(B.add(e),()=>{B.delete(e)})},K={sectionOf:e=>y.get(e)?.section??null,heldElsewhere:e=>{const t=y.get(e)?.section;return!!(t&&h.get(t)?.problem==="lock")},adopt:(e,t)=>{J(t.id,t.layout,t.layout_updated_at,t.title),y.set(e,{section:t.id,refId:V()}),g.set(t.id,t.used_on),S({})},place:e=>{if([...y.values()].some(r=>r.section===e.id))return null;const t=re(C(e.layout)),i=typeof t?.props?.id=="string"?t.props.id:null;return!t||!i||!t.type?null:(J(e.id,e.layout,e.layout_updated_at,e.title),y.set(i,{section:e.id,refId:V()}),g.set(e.id,e.used_on),t)},usedOn:e=>g.get(e)??null,learn:e=>{for(const t of e){g.set(t.id,t.used_on);const i=v.get(t.id);i&&(i.title=t.title);const r=h.get(t.id);r&&h.set(t.id,{...r,title:t.title})}S({})}},Q=async(e,t)=>{for(const[i,r]of e){const l=v.get(i),u=JSON.stringify(r);if(!(!l||u===l.savedJson||h.get(i)?.problem==="lock"))try{const m=await n.save(i,{layout:r},{version:l.version,clientId:t??""});T(i,m.live),l.layout=r,l.version=m.version,l.savedJson=u,k(i,null)}catch(m){F(m,"changed-elsewhere")?k(i,"conflict"):F(m,"lock-taken")?k(i,"lock",m.holder??void 0):k(i,"save")}}e.size&&A(),S({})};return{resolve:async e=>{if(Y(e===H?null:U),W(e===H?null:K),v=new Map,y=new Map,h=new Map,g=new Map,e===H)return c.resolve(e);let t=!1;const[i,r]=await Promise.all([c.resolve(e),n.load({slug:H,...s}).catch(()=>(t=!0,null))]);if(r&&!oe(i?.layout)){M(r.id,r.live);const p=C(r.layout);o={id:r.id,layout:p,version:r.version,savedJson:""}}else o=null;if(w=!1,!i)return S({conflict:null,saveFailed:!1,loadFailed:t}),i;const l=C(i.layout),u=se(l),m=await Promise.all(u.map(p=>n.load({id:p.section,...s}).catch(()=>null)));u.forEach((p,X)=>{const b=m[X];b?(M(b.id,b.live),J(p.section,b.layout,b.version,"")):(v.delete(p.section),h.set(p.section,{section:p.section,title:"",problem:"load"}))});const E=le(l,R());if(y=E.held,!o)return y.size&&f.add(i.id),S({conflict:null,saveFailed:!1,loadFailed:t}),y.size?{...i,layout:E.working}:i;const O=ie(E.working,o.layout);return o.savedJson=JSON.stringify(G(O,o.layout).chrome),f.add(i.id),S({conflict:null,saveFailed:!1,loadFailed:!1}),{...i,layout:O}},saveLayout:async(e,t,i,r)=>{if(!L(e))return c.saveLayout(e,t,i,r);const l=o,u=l?G(t,l.layout):{page:t,chrome:null},m=ae(u.page,y,R()),E=await c.saveLayout(e,m.page,i,r);if(await Q(m.docs,r),!l)return E;const O=JSON.stringify(u.chrome);if(!u.chrome||O===l.savedJson||P.lockHolder)return E;try{const p=await n.save(l.id,{layout:u.chrome},{version:l.version,clientId:r??""});T(l.id,p.live),A(),l.layout=u.chrome,l.version=p.version,l.savedJson=O,w=!0,S({conflict:null,saveFailed:!1})}catch(p){F(p,"changed-elsewhere")?S({conflict:p.conflict??{savedBy:"",savedByYou:!1,secondsAgo:0}}):F(p,"lock-taken")?S({lockHolder:p.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}}):S({saveFailed:!0})}return E},publish:c.publish?async(e,t)=>{const i=await c.publish(e,t),r=o;if(r&&L(e)&&!a&&n.publish&&D()&&!P.lockHolder){const l=await n.publish(r.id,r.version?{version:r.version}:void 0);_(r.id,l.live),l.version!==null&&(r.version=l.version),w=!1,S({})}if(L(e)&&!a&&n.publish)for(const[l,u]of v){if(h.get(l)?.problem==="lock")continue;const m=await n.publish(l,u.version?{version:u.version}:void 0);_(l,m.live),m.version!==null&&(u.version=m.version)}return i}:void 0,lock:d?{claim:async(e,t,i)=>{const r=await d.claim(e,t,i);if(!L(e))return r;const l=o;if(l)try{await d.claim(l.id,t,!1),P.lockHolder&&S({lockHolder:null})}catch(u){F(u,"lock-taken")&&S({lockHolder:u.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}})}for(const u of v.keys())try{await d.claim(u,t,!1),h.get(u)?.problem==="lock"&&k(u,null)}catch(m){F(m,"lock-taken")&&k(u,"lock",m.holder??void 0)}return v.size&&S({}),r},release:async(e,t)=>{if(await d.release(e,t),!L(e))return;const i=o;i&&!P.lockHolder&&await d.release(i.id,t).catch(()=>{});for(const r of v.keys())h.get(r)?.problem!=="lock"&&await d.release(r,t).catch(()=>{})}}:void 0,pinnedChrome:U}}function Le(n,s=$(),c=x(),d={}){const a=z(s),o=n?{siteId:n}:void 0,f=a?!!n:!0,w=s.site.update,v=a&&c.commerce&&c.service,y=!!d.editsPinnedInPlace&&v,h=I(s.site)?s.site:void 0,g=N(s.pages,n,h),P=y?ue(s.pages,o,g,s.lock,!!h):null;return{capabilities:{canPublish:!!h||!!s.pages.publish,hasSiteSettings:a,hasSiteTheme:!!s.theme,placeholderFrames:!1,mediaEditing:!0,pageCreationInAdminForm:!s.pages.create,canDeletePagesInline:!!s.pages.remove,hasEditLock:!!s.lock,hasEditGuard:!0,hasPinnedChrome:v,editsPinnedInPlace:y,explainsSiteSettings:!1,hasSiteRecord:f,canEditSiteRecord:f&&!!w,hasPreviewLink:a||!!s.preview,hasCatalog:a&&c.commerce,hasForms:a&&c.service,hasBlog:!!s.blog&&c.service,offersCommerce:c.commerce,offersService:c.service},...g,...q(g.resolve),lock:s.lock,...P,site:f?()=>s.site.get(o):void 0,siteLiveState:h?()=>h.liveState(o):void 0,siteVersions:ce(h,o),updateSite:f&&w?B=>w(B,o):void 0,previewHref:s.preview?B=>s.preview.href(B):void 0}}function Oe(n,s=$(),c=x()){const d=z(s),a=s.templates,o=a?a.pages(n):{list:()=>Promise.reject(new Error(j)),load:()=>Promise.reject(new Error(j)),save:()=>Promise.reject(new Error(j))};return{capabilities:{canPublish:!1,hasSiteSettings:!1,hasSiteTheme:!1,placeholderFrames:!0,mediaEditing:!1,pageCreationInAdminForm:!o.create,canDeletePagesInline:!!o.remove,hasEditLock:!1,hasEditGuard:!1,hasPinnedChrome:d&&c.commerce&&c.service,editsPinnedInPlace:!1,explainsSiteSettings:d,hasSiteRecord:!1,canEditSiteRecord:!1,hasPreviewLink:!1,hasCatalog:d&&c.commerce,hasForms:d&&c.service,hasBlog:!!s.blog&&c.service,offersCommerce:c.commerce,offersService:c.service},...N(o,void 0),...q(N(o,void 0).resolve),publish:void 0,templateName:a?()=>a.get(n).then(f=>f.name):void 0}}function q(n){return{resolve:s=>(Y(null),W(null),n(s))}}const j="This editor's backend has no website templates.";export{Le as makeSitePageAdapter,Oe as makeTemplatePageAdapter};
1
+ "use client";import{settleCountNode as ee,settleCountSources as te}from"../../format/lib/content/count-numbers.js";import{SITE_FOOTER_SLUG as A}from"../../format/lib/content/footer.js";import{offeredSetsOf as U}from"./editor-blocks.js";import{isBackendError as C}from"efficient-easel/screen/lib/backend-error";import{isEfficientBackend as z}from"efficient-easel/screen/lib/session";import{noteLoaded as _,notePublished as T,noteSaved as N,pageLiveState as ne}from"./page-live-state.js";import{noteSiteLiveState as oe,refreshSiteLiveState as J}from"./site-live-state.js";import{say as se}from"../../format/lib/editor-words.js";import{sendSiteWrites as ie}from"../../format/lib/site-writes.js";import{isPopupPageLayout as re}from"../../format/lib/popup/new-popup.js";import{spliceChrome as le,splitChrome as G}from"./pinned-chrome-doc.js";import{references as ae,sectionNodeOf as ce,spliceShared as de,splitShared as ue}from"../../format/lib/shared-section-docs.js";import{setActiveSharedSections as W}from"../../format/lib/shared-sections-active.js";import{setActivePinnedChrome as Y}from"../../format/lib/pinned-chrome-lock.js";import{backendOf as $}from"./website-session.js";function I(n){return!!(n?.publish&&n.liveState)}function fe(n,s){if(!I(n))return;const{versions:l,nameVersion:d,restoreVersion:i,previewVersion:o}=n;if(!(!l||!d||!i||!o))return{list:()=>l.call(n,s),name:(f,w)=>d.call(n,f,w,s),restore:(f,w)=>i.call(n,f,w??{},s),preview:f=>o.call(n,f,s)}}function me(n,s){return async(l,d)=>{try{await ie()}catch(o){throw new Error(se("A change waiting to go live could not be saved."),{cause:o})}return(await n.publish(s)).state==="live"?oe({state:"live",changes:[]}):J(0),{version:d??null}}}function x(n,s,l){const d=s?{siteId:s}:void 0;return{resolve:i=>n.load({slug:i,...d}).then(o=>(o&&_(o.id,o.live),o)),saveLayout:(i,o,f,w)=>n.save(i,{layout:o},{version:f,clientId:w??""}).then(h=>(N(i,h.live),J(),h)),rereadVersion:n.version?i=>n.version(i):void 0,publish:I(l)?me(l,d):n.publish?(i,o)=>n.publish(i,o?{version:o}:void 0).then(f=>(T(i,f.live),f)):void 0,listPages:()=>n.list(d),createPage:n.create?i=>n.create({...i,...d}):void 0,deletePage:n.remove?(i,o)=>n.remove(i,o):void 0}}function ve(n,s,l,d,i=!1){let o=null;const f=new Set;let w=!1,h=new Map,y=new Map,m=new Map,P=new Map,g={docId:null,lockHolder:null,conflict:null,saveFailed:!1,unpublished:!1,loadFailed:!1,sections:[]};const F=new Set,E=()=>{if(!o)return!1;const e=ne(o.id);return e==="changed"||e==="never"||e===void 0&&w},S=e=>{g={...g,...e,docId:o?.id??null,unpublished:E(),sections:[...m.values()]};for(const t of F)t()},k=(e,t,r)=>{t?m.set(e,{section:e,title:h.get(e)?.title??"",problem:t,holder:r}):m.delete(e)},H=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},L=e=>f.has(e),j=()=>new Map([...h].map(([e,t])=>[e,t.layout])),D=()=>`SharedSection-${typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2)}`,M=(e,t,r,a)=>{const c=H(t);h.set(e,{layout:c,version:r,savedJson:JSON.stringify(c),title:a})},V={state:()=>g,subscribe:e=>(F.add(e),()=>{F.delete(e)})},Q={sectionOf:e=>y.get(e)?.section??null,heldElsewhere:e=>{const t=y.get(e)?.section;return!!(t&&m.get(t)?.problem==="lock")},adopt:(e,t)=>{M(t.id,t.layout,t.layout_updated_at,t.title),y.set(e,{section:t.id,refId:D()}),P.set(t.id,t.used_on),S({})},place:e=>{if([...y.values()].some(a=>a.section===e.id))return null;const t=ce(H(e.layout)),r=typeof t?.props?.id=="string"?t.props.id:null;return!t||!r||!t.type?null:(M(e.id,e.layout,e.layout_updated_at,e.title),y.set(r,{section:e.id,refId:D()}),P.set(e.id,e.used_on),t)},usedOn:e=>P.get(e)??null,learn:e=>{for(const t of e){P.set(t.id,t.used_on);const r=h.get(t.id);r&&(r.title=t.title);const a=m.get(t.id);a&&m.set(t.id,{...a,title:t.title})}S({})}},X=async(e,t)=>{for(const[r,a]of e){const c=h.get(r),u=JSON.stringify(a);if(!(!c||u===c.savedJson||m.get(r)?.problem==="lock"))try{const v=await n.save(r,{layout:a},{version:c.version,clientId:t??""});N(r,v.live),c.layout=a,c.version=v.version,c.savedJson=u,k(r,null)}catch(v){C(v,"changed-elsewhere")?k(r,"conflict"):C(v,"lock-taken")?k(r,"lock",v.holder??void 0):k(r,"save")}}e.size&&J(),S({})};return{resolve:async e=>{if(Y(e===A?null:V),W(e===A?null:Q),h=new Map,y=new Map,m=new Map,P=new Map,e===A)return l.resolve(e);let t=!1;const[r,a]=await Promise.all([l.resolve(e),n.load({slug:A,...s}).catch(()=>(t=!0,null))]);if(a&&!re(r?.layout)){_(a.id,a.live);const p=H(a.layout);o={id:a.id,layout:p,version:a.version,savedJson:""}}else o=null;if(w=!1,!r)return S({conflict:null,saveFailed:!1,loadFailed:t}),r;const c=H(r.layout),u=ae(c),v=await Promise.all(u.map(p=>n.load({id:p.section,...s}).catch(()=>null)));u.forEach((p,Z)=>{const b=v[Z];b?(_(b.id,b.live),M(p.section,b.layout,b.version,"")):(h.delete(p.section),m.set(p.section,{section:p.section,title:"",problem:"load"}))});const B=de(c,j());if(y=B.held,!o)return y.size&&f.add(r.id),S({conflict:null,saveFailed:!1,loadFailed:t}),y.size?{...r,layout:B.working}:r;const O=le(B.working,o.layout);return o.savedJson=JSON.stringify(G(O,o.layout).chrome),f.add(r.id),S({conflict:null,saveFailed:!1,loadFailed:!1}),{...r,layout:O}},saveLayout:async(e,t,r,a)=>{if(!L(e))return l.saveLayout(e,t,r,a);const c=o,u=c?G(t,c.layout):{page:t,chrome:null},v=ue(u.page,y,j()),B=await l.saveLayout(e,v.page,r,a);if(await X(v.docs,a),!c)return B;const O=JSON.stringify(u.chrome);if(!u.chrome||O===c.savedJson||g.lockHolder)return B;try{const p=await n.save(c.id,{layout:u.chrome},{version:c.version,clientId:a??""});N(c.id,p.live),J(),c.layout=u.chrome,c.version=p.version,c.savedJson=O,w=!0,S({conflict:null,saveFailed:!1})}catch(p){C(p,"changed-elsewhere")?S({conflict:p.conflict??{savedBy:"",savedByYou:!1,secondsAgo:0}}):C(p,"lock-taken")?S({lockHolder:p.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}}):S({saveFailed:!0})}return B},publish:l.publish?async(e,t)=>{const r=await l.publish(e,t),a=o;if(a&&L(e)&&!i&&n.publish&&E()&&!g.lockHolder){const c=await n.publish(a.id,a.version?{version:a.version}:void 0);T(a.id,c.live),c.version!==null&&(a.version=c.version),w=!1,S({})}if(L(e)&&!i&&n.publish)for(const[c,u]of h){if(m.get(c)?.problem==="lock")continue;const v=await n.publish(c,u.version?{version:u.version}:void 0);T(c,v.live),v.version!==null&&(u.version=v.version)}return r}:void 0,lock:d?{claim:async(e,t,r)=>{const a=await d.claim(e,t,r);if(!L(e))return a;const c=o;if(c)try{await d.claim(c.id,t,!1),g.lockHolder&&S({lockHolder:null})}catch(u){C(u,"lock-taken")&&S({lockHolder:u.holder??{name:"",secondsSinceSeen:0,secondsSinceHeld:0}})}for(const u of h.keys())try{await d.claim(u,t,!1),m.get(u)?.problem==="lock"&&k(u,null)}catch(v){C(v,"lock-taken")&&k(u,"lock",v.holder??void 0)}return h.size&&S({}),a},release:async(e,t)=>{if(await d.release(e,t),!L(e))return;const r=o;r&&!g.lockHolder&&await d.release(r.id,t).catch(()=>{});for(const a of h.keys())m.get(a)?.problem!=="lock"&&await d.release(a,t).catch(()=>{})}}:void 0,pinnedChrome:V}}function q(n){const s=(l,d,i)=>n.save(l,d.layout?{...d,layout:te(d.layout)}:d,i);return new Proxy(n,{get(l,d){if(d==="save")return s;const i=Reflect.get(l,d,l);return typeof i=="function"?i.bind(l):i}})}function He(n,s,l){return n.update(s,ee(l))}function Ae(n,s=$(),l=U(),d={}){const i=z(s),o=n?{siteId:n}:void 0,f=i?!!n:!0,w=s.site.update,h=i&&l.commerce&&l.service,y=!!d.editsPinnedInPlace&&h,m=I(s.site)?s.site:void 0,P=q(s.pages),g=x(P,n,m),F=y?ve(P,o,g,s.lock,!!m):null;return{capabilities:{canPublish:!!m||!!s.pages.publish,hasSiteSettings:i,hasSiteTheme:!!s.theme,placeholderFrames:!1,mediaEditing:!0,pageCreationInAdminForm:!s.pages.create,canDeletePagesInline:!!s.pages.remove,hasEditLock:!!s.lock,hasEditGuard:!0,hasPinnedChrome:h,editsPinnedInPlace:y,explainsSiteSettings:!1,hasSiteRecord:f,canEditSiteRecord:f&&!!w,hasPreviewLink:i||!!s.preview,hasCatalog:i&&l.commerce,hasForms:i&&l.service,hasBlog:!!s.blog&&l.service,offersCommerce:l.commerce,offersService:l.service},...g,...K(g.resolve),lock:s.lock,...F,site:f?()=>s.site.get(o):void 0,siteLiveState:m?()=>m.liveState(o):void 0,siteVersions:fe(m,o),updateSite:f&&w?E=>w(E,o):void 0,previewHref:s.preview?E=>s.preview.href(E):void 0}}function Je(n,s=$(),l=U()){const d=z(s),i=s.templates,o=i?q(i.pages(n)):{list:()=>Promise.reject(new Error(R)),load:()=>Promise.reject(new Error(R)),save:()=>Promise.reject(new Error(R))};return{capabilities:{canPublish:!1,hasSiteSettings:!1,hasSiteTheme:!1,placeholderFrames:!0,mediaEditing:!1,pageCreationInAdminForm:!o.create,canDeletePagesInline:!!o.remove,hasEditLock:!1,hasEditGuard:!1,hasPinnedChrome:d&&l.commerce&&l.service,editsPinnedInPlace:!1,explainsSiteSettings:d,hasSiteRecord:!1,canEditSiteRecord:!1,hasPreviewLink:!1,hasCatalog:d&&l.commerce,hasForms:d&&l.service,hasBlog:!!s.blog&&l.service,offersCommerce:l.commerce,offersService:l.service},...x(o,void 0),...K(x(o,void 0).resolve),publish:void 0,templateName:i?()=>i.get(n).then(f=>f.name):void 0}}function K(n){return{resolve:s=>(Y(null),W(null),n(s))}}const R="This editor's backend has no website templates.";export{Ae as makeSitePageAdapter,Je as makeTemplatePageAdapter,He as saveSectionTemplate,q as settlingPages};
@@ -89,6 +89,40 @@ export declare function dryRunSections(pages: readonly DryRunPage[], opts?: {
89
89
  draw?: (node: SectionNode) => string;
90
90
  sites?: readonly SiteFacts[];
91
91
  }): DryRunReport;
92
+ export type CliPageRow = {
93
+ id: string;
94
+ site: string;
95
+ slug: string;
96
+ layout: unknown;
97
+ published_layout: unknown;
98
+ layout_updated_at: string;
99
+ };
100
+ export declare function pagesFromCliExport(rows: readonly CliPageRow[], opts: {
101
+ schema: string;
102
+ siteName: (siteId: string) => string;
103
+ }): DryRunPage[];
104
+ export type PageEdit = {
105
+ id: string;
106
+ slug: string;
107
+ patch?: {
108
+ layout: unknown;
109
+ expected_updated_at: string;
110
+ };
111
+ converted: {
112
+ type: string;
113
+ id: string;
114
+ }[];
115
+ skipped: {
116
+ type: string;
117
+ id: string;
118
+ why: string;
119
+ }[];
120
+ held?: string;
121
+ };
122
+ export declare function pageEdits(rows: readonly CliPageRow[], opts: {
123
+ types: readonly string[];
124
+ site?: SiteFacts;
125
+ }): PageEdit[];
92
126
  export declare function siteWritesFile(report: DryRunReport): {
93
127
  schema: string;
94
128
  site: string;
@@ -1,3 +1,3 @@
1
- import{defaultTextStyles as _}from"efficient-easel/text-styles/model";import{headingDefaultPx as T}from"../../../render/components/Heading.js";import{headingLevelOfStyle as M}from"../../../render/components/Text.js";import{listToWrite as A,setStyleValues as D}from"../../../render/lib/text-styles/site-text-styles.js";import{bandPresetFor as L,bandPresetIndex as R}from"../../../format/lib/theme.js";import{convertSection as z,sectionToBoxRow as N,sectionToBoxTypes as E}from"../../../render/lib/sections/section-to-box.js";const P={"body-1":17,"body-2":17,"body-3":17,"body-4":17,"body-5":13,"body-6":17,"body-7":17};function X(e,t,i=_()){const d=s=>t==="heading"?T(M(s)):P[s];let n;for(const{id:s,kind:r}of i){const o=r===t?d(s):void 0;if(o===void 0)continue;const l=Math.abs(o-e),c=n?Math.abs(n.px-e):1/0;(l<c||l===c&&n&&o>n.px)&&(n={id:s,px:o})}if(!n)throw new Error(`lib/sections/section-dry-run: the text-style list has no ${t} style`);return n.id}function C(e){const[t,i]=e.split("/");return t&&i?{schema:t,site:i}:void 0}function K(e){const t=d=>typeof d=="string"?d:null,i=e.theme_row===void 0?null:e.theme_row==="site";return{schema:String(e.schema),site:String(e.site),headingCase:t(e.heading_case),textStyles:typeof e.text_styles_is_null=="boolean"?!e.text_styles_is_null:null,textStylesList:Array.isArray(e.text_styles)?e.text_styles:null,ownThemeRow:i,deleted:e.site_deleted===!0,...Array.isArray(e.theme_presets)?{themePresets:e.theme_presets}:{},...typeof e.selected_preset=="number"?{selectedPreset:e.selected_preset}:{}}}const j=new Set([null,"authored"]);function v(e,t){const i=A(t),d=i.filter(s=>e.includes(s.id)&&s.values.letterCase===void 0).map(s=>s.id);return{list:d.reduce((s,r)=>D(s,r,{letterCase:"upper"}),i),changed:d.length>0}}function B(e,t){if(t?.deleted)return{notNeeded:"the site is soft-deleted: no write"};if(t&&t.ownThemeRow===!1)return{notNeeded:"no own theme row: write refused (the command changes a site's own row, it never creates one)"};if(e.kind==="band-preset")return F(e,t);if(!t||t.textStyles===null)return{undecided:"the site's heading case and text_styles were not read"};if(!j.has(t.headingCase))return{notNeeded:`the site chose a heading case (${t.headingCase})`};if(t.textStyles&&!t.textStylesList)return{undecided:"the site has a saved text_styles list, and the list was not read"};const{list:i,changed:d}=v(e.styles,t.textStyles?t.textStylesList??null:null);return d?{send:{kind:e.kind,styles:[...e.styles],...t.textStyles?{}:{listIfNull:i}}}:{notNeeded:"the saved text_styles list's Heading 1–3 already say their own case"}}function F(e,t){const i=t?.themePresets;if(!t||!i)return{undecided:"the site's theme presets were not read"};const d=i[e.page];if(!d)return{undecided:`the site has no preset ${e.page+1} to take the band from`};if(R(i,e.page)>=0)return{notNeeded:"the site already has the band preset"};const n=L(d);return{send:{kind:e.kind,page:e.page,index:i.length,preset:n,themePresets:[...i,n]}}}function Q(e,t={}){const i=[...t.types??E()],d=i.filter(p=>!N(p)),n=new Set(i.filter(p=>N(p))),s=[],r=[],o={},l={},c=new Map((t.sites??[]).map(p=>[`${p.schema}/${p.site}`,p])),$=new Map,k=(p,m,a)=>{const b=`${p.schema}/${p.site}`;let g=$.get(b);g||$.set(b,g={...p,facts:!!m,writes:[],undecided:[],notNeeded:[]});const h=B(a,m);if("send"in h){const u=g.writes.find(x=>JSON.stringify(x.write)===JSON.stringify(h.send));u?u.nodes+=1:g.writes.push({write:h.send,reason:a.kind==="band-preset"?"a section that painted the grey band (`--section-bg`)":"a heading that followed the site's heading case",nodes:1});return}const[w,f]="undecided"in h?[g.undecided,h.undecided]:[g.notNeeded,h.notNeeded],y=w.find(u=>u.kind===a.kind&&u.why===f);y?y.nodes+=1:w.push({kind:a.kind,why:f,nodes:1})};for(const p of e){const m=p.layout?.content;Array.isArray(m)&&m.forEach((a,b)=>{if(!a||typeof a.type!="string"||!n.has(a.type))return;const g=N(a.type),h=C(p.label),w=h?c.get(`${h.schema}/${h.site}`):void 0,f=z(a,g,w?{site:w}:{});if(f.skipped!==void 0){r.push({page:p.label,index:b,type:a.type,id:String(a.props?.id??""),why:f.skipped});return}if(h)for(const S of f.siteWrites)k(h,w,S);const y={page:p.label,index:b,type:a.type,id:String(a.props?.id??""),carried:f.carried,dropped:f.dropped,restyled:f.restyled},u=t.draw;u&&(y.before=u(a),y.after=f.nodes.map(u).join(""),y.sameMarkup=y.before===y.after),s.push(y);const x=o[a.type]??={nodes:0,pages:0,dropped:{}};x.nodes+=1,(l[a.type]??=new Set).add(p.label),x.pages=l[a.type].size;for(const S of f.dropped)x.dropped[S.key]=(x.dropped[S.key]??0)+1})}return{types:i,noRow:d,pages:e.length,nodes:s,skipped:r,byType:o,sites:[...$.values()],siteFacts:[...t.sites??[]]}}function Z(e){return e.sites.filter(t=>t.writes.length).map(t=>({schema:t.schema,site:t.site,writes:t.writes.map(i=>i.write)}))}function I(e){const t=new Map;for(const i of e.nodes)for(const d of i.restyled){const n=d.textStyle??"none",s=P[n],r=d.size??s,o=d.sizePhone??d.size??s;if(r===void 0||o===void 0)continue;const l=d.was.size,c=d.was.sizePhone??d.was.size,$=[i.type,d.key,n,l,c,r,o].join("|"),k=t.get($);k?k.nodes+=1:t.set($,{type:i.type,key:d.key,textStyle:n,oldPx:l,oldPhonePx:c,newPx:r,newPhonePx:o,diff:r-l,diffPhone:o-c,nodes:1})}return[...t.values()]}const O=e=>e>0?`+${e}`:String(e),W=e=>_().find(t=>t.id===e)?.name??e,Y=e=>e.kind==="band-preset"?`theme_presets + preset ${e.index+1} (background ${e.preset.background}: the band of preset ${e.page+1}); presets 1–${e.index} unchanged`:`Capitalization = Uppercase on ${e.styles.join(", ")}${e.listIfNull?` (text_styles is NULL: listIfNull = the easel default list, ${e.listIfNull.length} styles)`:" (on the saved text_styles list)"}`;function ee(e){const t=["# Section conversion — dry run (READ ONLY: nothing was written)","",`Pages read: ${e.pages}. Nodes converted on paper: ${e.nodes.length}.`,"","| Type | Nodes | Pages | Dropped keys |","|---|---|---|---|"];for(const[n,s]of Object.entries(e.byType)){const r=Object.keys(s.dropped).length;t.push(`| ${n} | ${s.nodes} | ${s.pages} | ${r} |`)}if(e.noRow.length&&t.push("",`Asked for, but no row: ${e.noRow.join(", ")}.`),e.skipped.length){t.push("",`Nodes skipped (left as they are): ${e.skipped.length}.`);const n=new Map;for(const s of e.skipped){const r=n.get(s.type)??n.set(s.type,new Map).get(s.type);r.set(s.why,(r.get(s.why)??0)+1)}for(const[s,r]of n){t.push("",`## ${s} — skipped (not converted)`,"");for(const[o,l]of r)t.push(`- ×${l}: ${o}`)}}for(const[n,s]of Object.entries(e.byType)){const r=Object.entries(s.dropped);if(!r.length)continue;t.push("",`## ${n} — dropped`,"");const o=new Map;for(const l of e.nodes)if(l.type===n)for(const c of l.dropped)o.set(c.key,c.why);for(const[l,c]of r)t.push(`- \`${l}\` ×${c}: ${o.get(l)}`)}if(e.siteFacts.length){t.push("","## Site facts (the read-only read handed in)","","| Site | Own theme row | Deleted | Heading case | text_styles saved |","|---|---|---|---|---|");const n=s=>s==null?"—":String(s);for(const s of e.siteFacts)t.push(`| ${s.schema}/${s.site} | ${n(s.ownThemeRow)} | ${s.deleted?"YES":"no"} | ${n(s.headingCase)} | ${n(s.textStyles)} |`)}if(e.sites.length){t.push("","## Site writes (DECLARED ONLY: nothing was written)","","One line per write per site. Only the `send` lines are in `site-writes.json`.","","| Site | Facts read | Write | Status | Nodes | Why |","|---|---|---|---|---|---|");for(const n of e.sites){const s=`${n.schema}/${n.site}`,r=n.facts?"yes":"NO";for(const o of n.writes)t.push(`| ${s} | ${r} | ${Y(o.write)} | send | ${o.nodes} | ${o.reason} |`);for(const o of n.undecided)t.push(`| ${s} | ${r} | ${o.kind} | UNDECIDED | ${o.nodes} | ${o.why} |`);for(const o of n.notNeeded)t.push(`| ${s} | ${r} | ${o.kind} | not needed | ${o.nodes} | ${o.why} |`)}}const i=I(e);if(i.length){const n=["| Type | Text | Old px (phone) | Style | New px (phone) | Difference (phone) | Nodes |","|---|---|---|---|---|---|---|"],s=o=>`| ${o.type} | \`${o.key}\` | ${o.oldPx} (${o.oldPhonePx}) | ${W(o.textStyle)} | ${o.newPx} (${o.newPhonePx}) | ${O(o.diff)} (${O(o.diffPhone)}) | ${o.nodes} |`;t.push("","## Body copy: each text follows a Body style (sizes at the site defaults)","","New px = what a Text block draws for the style with no size saved (Body 5 13px, other Body styles 17px, the same on a phone); a part with its own stored size draws that size.","",...n,...i.map(s));const r=i.filter(o=>Math.abs(o.diff)>2||Math.abs(o.diffPhone)>2);t.push("","## Body copy: differences over 2px",""),r.length?t.push(...n,...r.map(s)):t.push("None.")}const d=e.nodes.filter(n=>n.sameMarkup!==void 0);if(d.length){const n=d.filter(s=>s.sameMarkup).length;t.push("",`Markup equal before and after: ${n} of ${d.length} (a hint; the pixels decide).`)}return t.join(`
1
+ import{defaultTextStyles as N}from"efficient-easel/text-styles/model";import{headingDefaultPx as A}from"../../../render/components/Heading.js";import{headingLevelOfStyle as M}from"../../../render/components/Text.js";import{migrateLegacyPageData as D}from"../../../render/lib/document/migrate-legacy.js";import{migrateRenamedProps as v}from"../../../format/lib/document/renamed-props.js";import{listToWrite as E,setStyleValues as L}from"../../../render/lib/text-styles/site-text-styles.js";import{bandPresetFor as R,bandPresetIndex as z}from"../../../format/lib/theme.js";import{convertSection as C,convertSectionsInPage as j,sectionToBoxRow as S,sectionToBoxTypes as F}from"../../../render/lib/sections/section-to-box.js";const P={"body-1":17,"body-2":17,"body-3":17,"body-4":17,"body-5":13,"body-6":17,"body-7":17};function se(e,t,d=N()){const i=s=>t==="heading"?A(M(s)):P[s];let n;for(const{id:s,kind:r}of d){const o=r===t?i(s):void 0;if(o===void 0)continue;const a=Math.abs(o-e),c=n?Math.abs(n.px-e):1/0;(a<c||a===c&&n&&o>n.px)&&(n={id:s,px:o})}if(!n)throw new Error(`lib/sections/section-dry-run: the text-style list has no ${t} style`);return n.id}function B(e){const[t,d]=e.split("/");return t&&d?{schema:t,site:d}:void 0}function ne(e){const t=i=>typeof i=="string"?i:null,d=e.theme_row===void 0?null:e.theme_row==="site";return{schema:String(e.schema),site:String(e.site),headingCase:t(e.heading_case),textStyles:typeof e.text_styles_is_null=="boolean"?!e.text_styles_is_null:null,textStylesList:Array.isArray(e.text_styles)?e.text_styles:null,ownThemeRow:d,deleted:e.site_deleted===!0,...Array.isArray(e.theme_presets)?{themePresets:e.theme_presets}:{},...typeof e.selected_preset=="number"?{selectedPreset:e.selected_preset}:{},...typeof e.site_gutter=="number"?{siteGutter:e.site_gutter}:{},...typeof e.site_gutter_phone=="number"?{siteGutterPhone:e.site_gutter_phone}:{}}}const I=new Set([null,"authored"]);function W(e,t){const d=E(t),i=d.filter(s=>e.includes(s.id)&&s.values.letterCase===void 0).map(s=>s.id);return{list:i.reduce((s,r)=>L(s,r,{letterCase:"upper"}),d),changed:i.length>0}}function Y(e,t){if(t?.deleted)return{notNeeded:"the site is soft-deleted: no write"};if(t&&t.ownThemeRow===!1)return{notNeeded:"no own theme row: write refused (the command changes a site's own row, it never creates one)"};if(e.kind==="band-preset")return J(e,t);if(!t||t.textStyles===null)return{undecided:"the site's heading case and text_styles were not read"};if(!I.has(t.headingCase))return{notNeeded:`the site chose a heading case (${t.headingCase})`};if(t.textStyles&&!t.textStylesList)return{undecided:"the site has a saved text_styles list, and the list was not read"};const{list:d,changed:i}=W(e.styles,t.textStyles?t.textStylesList??null:null);return i?{send:{kind:e.kind,styles:[...e.styles],...t.textStyles?{}:{listIfNull:d}}}:{notNeeded:"the saved text_styles list's Heading 1–3 already say their own case"}}function J(e,t){const d=t?.themePresets;if(!t||!d)return{undecided:"the site's theme presets were not read"};const i=d[e.page];if(!i)return{undecided:`the site has no preset ${e.page+1} to take the band from`};if(z(d,e.page)>=0)return{notNeeded:"the site already has the band preset"};const n=R(i);return{send:{kind:e.kind,page:e.page,index:d.length,preset:n,themePresets:[...d,n]}}}function O(e){const t=e?.content;return Array.isArray(t)?v(D(e)):e}function oe(e,t={}){const d=[...t.types??F()],i=d.filter(p=>!S(p)),n=new Set(d.filter(p=>S(p))),s=[],r=[],o={},a={},c=new Map((t.sites??[]).map(p=>[`${p.schema}/${p.site}`,p])),f=new Map,m=(p,w,l)=>{const k=`${p.schema}/${p.site}`;let $=f.get(k);$||f.set(k,$={...p,facts:!!w,writes:[],undecided:[],notNeeded:[]});const h=Y(l,w);if("send"in h){const g=$.writes.find(b=>JSON.stringify(b.write)===JSON.stringify(h.send));g?g.nodes+=1:$.writes.push({write:h.send,reason:l.kind==="band-preset"?"a section that painted the grey band (`--section-bg`)":"a heading that followed the site's heading case",nodes:1});return}const[x,y]="undecided"in h?[$.undecided,h.undecided]:[$.notNeeded,h.notNeeded],u=x.find(g=>g.kind===l.kind&&g.why===y);u?u.nodes+=1:x.push({kind:l.kind,why:y,nodes:1})};for(const p of e){const w=O(p.layout)?.content;Array.isArray(w)&&w.forEach((l,k)=>{if(!l||typeof l.type!="string"||!n.has(l.type))return;const $=S(l.type),h=B(p.label),x=h?c.get(`${h.schema}/${h.site}`):void 0,y=C(l,$,x?{site:x}:{});if(y.skipped!==void 0){r.push({page:p.label,index:k,type:l.type,id:String(l.props?.id??""),why:y.skipped});return}if(h)for(const _ of y.siteWrites)m(h,x,_);const u={page:p.label,index:k,type:l.type,id:String(l.props?.id??""),carried:y.carried,dropped:y.dropped,restyled:y.restyled},g=t.draw;g&&(u.before=g(l),u.after=y.nodes.map(g).join(""),u.sameMarkup=u.before===u.after),s.push(u);const b=o[l.type]??={nodes:0,pages:0,dropped:{}};b.nodes+=1,(a[l.type]??=new Set).add(p.label),b.pages=a[l.type].size;for(const _ of y.dropped)b.dropped[_.key]=(b.dropped[_.key]??0)+1})}return{types:d,noRow:i,pages:e.length,nodes:s,skipped:r,byType:o,sites:[...f.values()],siteFacts:[...t.sites??[]]}}function ie(e,t){return e.flatMap(d=>{const i=`${t.schema}/${t.siteName(d.site)}/${d.slug}`;return[{label:`${i} (draft)`,layout:d.layout},{label:`${i} (published)`,layout:d.published_layout}]})}function de(e,t){const d=t.types.filter(i=>S(i));return e.map(i=>{const n={id:i.id,slug:i.slug};if(JSON.stringify(i.layout)!==JSON.stringify(i.published_layout))return{...n,converted:[],skipped:[],held:"draft and published differ: a person decides which one moves"};const s=O(i.layout),r=Array.isArray(s?.content)?s.content:[],o=[],a=[];for(const f of r){if(!f||!d.includes(f.type))continue;const m=String(f.props?.id??""),p=S(f.type).skip?.(f.props);p===void 0?o.push({type:f.type,id:m}):a.push({type:f.type,id:m,why:p})}if(!o.length)return{...n,converted:o,skipped:a};const c=j(s,d,t.site?{site:t.site}:{});return{...n,patch:{layout:c,expected_updated_at:i.layout_updated_at},converted:o,skipped:a}})}function re(e){return e.sites.filter(t=>t.writes.length).map(t=>({schema:t.schema,site:t.site,writes:t.writes.map(d=>d.write)}))}function U(e){const t=new Map;for(const d of e.nodes)for(const i of d.restyled){const n=i.textStyle??"none",s=P[n],r=i.size??s,o=i.sizePhone??i.size??s;if(r===void 0||o===void 0)continue;const a=i.was.size,c=i.was.sizePhone??i.was.size,f=[d.type,i.key,n,a,c,r,o].join("|"),m=t.get(f);m?m.nodes+=1:t.set(f,{type:d.type,key:i.key,textStyle:n,oldPx:a,oldPhonePx:c,newPx:r,newPhonePx:o,diff:r-a,diffPhone:o-c,nodes:1})}return[...t.values()]}const T=e=>e>0?`+${e}`:String(e),G=e=>N().find(t=>t.id===e)?.name??e,H=e=>e.kind==="band-preset"?`theme_presets + preset ${e.index+1} (background ${e.preset.background}: the band of preset ${e.page+1}); presets 1–${e.index} unchanged`:`Capitalization = Uppercase on ${e.styles.join(", ")}${e.listIfNull?` (text_styles is NULL: listIfNull = the easel default list, ${e.listIfNull.length} styles)`:" (on the saved text_styles list)"}`;function ae(e){const t=["# Section conversion — dry run (READ ONLY: nothing was written)","",`Pages read: ${e.pages}. Nodes converted on paper: ${e.nodes.length}.`,"","| Type | Nodes | Pages | Dropped keys |","|---|---|---|---|"];for(const[n,s]of Object.entries(e.byType)){const r=Object.keys(s.dropped).length;t.push(`| ${n} | ${s.nodes} | ${s.pages} | ${r} |`)}if(e.noRow.length&&t.push("",`Asked for, but no row: ${e.noRow.join(", ")}.`),e.skipped.length){t.push("",`Nodes skipped (left as they are): ${e.skipped.length}.`);const n=new Map;for(const s of e.skipped){const r=n.get(s.type)??n.set(s.type,new Map).get(s.type);r.set(s.why,(r.get(s.why)??0)+1)}for(const[s,r]of n){t.push("",`## ${s} — skipped (not converted)`,"");for(const[o,a]of r)t.push(`- ×${a}: ${o}`)}}for(const[n,s]of Object.entries(e.byType)){const r=Object.entries(s.dropped);if(!r.length)continue;t.push("",`## ${n} — dropped`,"");const o=new Map;for(const a of e.nodes)if(a.type===n)for(const c of a.dropped)o.set(c.key,c.why);for(const[a,c]of r)t.push(`- \`${a}\` ×${c}: ${o.get(a)}`)}if(e.siteFacts.length){t.push("","## Site facts (the read-only read handed in)","","| Site | Own theme row | Deleted | Heading case | text_styles saved |","|---|---|---|---|---|");const n=s=>s==null?"—":String(s);for(const s of e.siteFacts)t.push(`| ${s.schema}/${s.site} | ${n(s.ownThemeRow)} | ${s.deleted?"YES":"no"} | ${n(s.headingCase)} | ${n(s.textStyles)} |`)}if(e.sites.length){t.push("","## Site writes (DECLARED ONLY: nothing was written)","","One line per write per site. Only the `send` lines are in `site-writes.json`.","","| Site | Facts read | Write | Status | Nodes | Why |","|---|---|---|---|---|---|");for(const n of e.sites){const s=`${n.schema}/${n.site}`,r=n.facts?"yes":"NO";for(const o of n.writes)t.push(`| ${s} | ${r} | ${H(o.write)} | send | ${o.nodes} | ${o.reason} |`);for(const o of n.undecided)t.push(`| ${s} | ${r} | ${o.kind} | UNDECIDED | ${o.nodes} | ${o.why} |`);for(const o of n.notNeeded)t.push(`| ${s} | ${r} | ${o.kind} | not needed | ${o.nodes} | ${o.why} |`)}}const d=U(e);if(d.length){const n=["| Type | Text | Old px (phone) | Style | New px (phone) | Difference (phone) | Nodes |","|---|---|---|---|---|---|---|"],s=o=>`| ${o.type} | \`${o.key}\` | ${o.oldPx} (${o.oldPhonePx}) | ${G(o.textStyle)} | ${o.newPx} (${o.newPhonePx}) | ${T(o.diff)} (${T(o.diffPhone)}) | ${o.nodes} |`;t.push("","## Body copy: each text follows a Body style (sizes at the site defaults)","","New px = what a Text block draws for the style with no size saved (Body 5 13px, other Body styles 17px, the same on a phone); a part with its own stored size draws that size.","",...n,...d.map(s));const r=d.filter(o=>Math.abs(o.diff)>2||Math.abs(o.diffPhone)>2);t.push("","## Body copy: differences over 2px",""),r.length?t.push(...n,...r.map(s)):t.push("None.")}const i=e.nodes.filter(n=>n.sameMarkup!==void 0);if(i.length){const n=i.filter(s=>s.sameMarkup).length;t.push("",`Markup equal before and after: ${n} of ${i.length} (a hint; the pixels decide).`)}return t.join(`
2
2
  `)+`
3
- `}export{P as BODY_STYLE_PX_AT_DEFAULTS,I as bodyStyleRows,ee as dryRunMarkdown,Q as dryRunSections,v as headingCaseList,X as nearestTextStyle,K as siteFactsFromRead,C as siteOfLabel,Z as siteWritesFile};
3
+ `}export{P as BODY_STYLE_PX_AT_DEFAULTS,U as bodyStyleRows,ae as dryRunMarkdown,oe as dryRunSections,W as headingCaseList,se as nearestTextStyle,de as pageEdits,ie as pagesFromCliExport,ne as siteFactsFromRead,B as siteOfLabel,re as siteWritesFile};
@@ -0,0 +1,5 @@
1
+ import { type HoverEffect } from "../theme.js";
2
+ export declare const HOVER_KEY = "hover";
3
+ export type PartHover = Extract<HoverEffect, "none" | "lift">;
4
+ export declare const PART_HOVER_KINDS: readonly PartHover[];
5
+ export declare function hoverOf(record: Readonly<Record<string, unknown>>): PartHover;
@@ -0,0 +1 @@
1
+ import{HOVER_EFFECTS as n}from"../theme.js";const t="hover",r=n.filter(o=>o==="none"||o==="lift");function c(o){const e=o[t];return r.includes(e)?e:"none"}export{t as HOVER_KEY,r as PART_HOVER_KINDS,c as hoverOf};
@@ -1 +1,2 @@
1
1
  export * from "./loop.js";
2
+ export declare const ENTRANCE_GROUP_KEY = "_gEntrance";
@@ -1 +1 @@
1
- export*from"./loop.js";
1
+ export*from"./loop.js";const o="_gEntrance";export{o as ENTRANCE_GROUP_KEY};
@@ -1,16 +1,25 @@
1
1
  export declare const BLOCK_SOURCE_PROP = "dataSource";
2
2
  export declare const BLOCK_SOURCE_OPTIONS_PROP = "dataSourceOptions";
3
3
  export declare const BLOCK_SOURCE_ROWS_PROP = "dataRows";
4
+ export declare const COUNT_KEY_PROP = "countKey";
5
+ export declare const COUNTS_SOURCE = "counts";
4
6
  export type SourceRow = Readonly<Record<string, string>>;
7
+ export interface SourceChoice {
8
+ key: string;
9
+ label: string;
10
+ value: string;
11
+ }
5
12
  export interface BlockSourceSpec {
6
13
  key: string;
7
14
  label: string;
8
15
  blocks: readonly string[];
9
16
  sample?: readonly SourceRow[];
17
+ choices?: readonly SourceChoice[];
10
18
  }
11
19
  export declare function registerBlockSources(sources: readonly BlockSourceSpec[]): void;
12
20
  export declare function blockSources(block?: string): readonly BlockSourceSpec[];
13
21
  export declare function blockSourceSpec(key: string): BlockSourceSpec | null;
22
+ export declare function sourceChoices(key: string): readonly SourceChoice[];
14
23
  export declare function blockSourcesRevision(): number;
15
24
  export declare function declaredBlockSource(props?: Record<string, unknown> | null): string;
16
25
  export declare function servedRows(props?: Record<string, unknown> | null): readonly SourceRow[] | null;
@@ -1 +1 @@
1
- import{nonEmptyString as c}from"../non-empty-string.js";const i="dataSource",O="dataSourceOptions",a="dataRows",f=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,u=Symbol.for("efficient.block-sources");function s(){const e=globalThis;return e[u]??={sources:new Map,revision:0}}function p(e){if(typeof e.key!="string"||!f.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)}:{}}}function S(e){const t=e.map(p),o=s();for(const r of t)o.sources.set(r.key,r);t.length&&(o.revision+=1)}function d(e){const t=[...s().sources.values()];return e===void 0?t:t.filter(o=>o.blocks.includes(e))}function k(e){return s().sources.get(e)??null}function h(){return s().revision}function y(e){const t=e?.[i];return typeof t=="string"?t.trim():""}function l(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t={};for(const[o,r]of Object.entries(e)){const n=c(r);n&&(t[o]=n)}return Object.keys(t).length?t:null}function b(e){const t=e?.[a];return Array.isArray(t)?t.map(l).filter(o=>o!==null):null}function w(e,t,o=[]){const r=b(e);if(r!==null&&(r.length||!t))return{rows:r,sample:!1};if(!t)return{rows:[],sample:!1};const n=k(y(e))?.sample;return{rows:n?.length?n:o,sample:!0}}export{O as BLOCK_SOURCE_OPTIONS_PROP,i as BLOCK_SOURCE_PROP,a as BLOCK_SOURCE_ROWS_PROP,k as blockSourceSpec,d as blockSources,h as blockSourcesRevision,y as declaredBlockSource,S as registerBlockSources,b as servedRows,w as sourcedRows};
1
+ import{nonEmptyString as c}from"../non-empty-string.js";const i="dataSource",m="dataSourceOptions",a="dataRows",S="countKey",d="counts",u=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,f=Symbol.for("efficient.block-sources");function s(){const e=globalThis;return e[f]??={sources:new Map,revision:0}}const p=e=>[e?.key,e?.label,e?.value].every(t=>typeof t=="string"&&t.trim()!=="");function y(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(p)}:{}}}function x(e){const t=e.map(y),o=s();for(const r of t)o.sources.set(r.key,r);t.length&&(o.revision+=1)}function R(e){const t=[...s().sources.values()];return e===void 0?t:t.filter(o=>o.blocks.includes(e))}function k(e){return s().sources.get(e)??null}function g(e){return s().sources.get(e)?.choices??[]}function w(){return s().revision}function b(e){const t=e?.[i];return typeof t=="string"?t.trim():""}function l(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t={};for(const[o,r]of Object.entries(e)){const n=c(r);n&&(t[o]=n)}return Object.keys(t).length?t:null}function h(e){const t=e?.[a];return Array.isArray(t)?t.map(l).filter(o=>o!==null):null}function C(e,t,o=[]){const r=h(e);if(r!==null&&(r.length||!t))return{rows:r,sample:!1};if(!t)return{rows:[],sample:!1};const n=k(b(e))?.sample;return{rows:n?.length?n:o,sample:!0}}export{m as BLOCK_SOURCE_OPTIONS_PROP,i as BLOCK_SOURCE_PROP,a as BLOCK_SOURCE_ROWS_PROP,d as COUNTS_SOURCE,S as COUNT_KEY_PROP,k as blockSourceSpec,R as blockSources,w as blockSourcesRevision,b as declaredBlockSource,x as registerBlockSources,h as servedRows,g as sourceChoices,C as sourcedRows};
@@ -50,7 +50,26 @@ export declare const BOX_SHARE_PHONE_POINTS: ({
50
50
  readonly weights: readonly [1, 1];
51
51
  })[];
52
52
  export declare const BOX_SHARE_PHONE_DEFAULT = "equal";
53
- export declare function boxPhoneRowClasses(perRow: unknown, sharePhone?: unknown): string;
53
+ export declare const BOX_COLUMNS_MIN = 1;
54
+ export declare const BOX_COLUMNS_MAX = 6;
55
+ export declare function boxColumnsClass(columns: unknown): string;
56
+ export declare function boxTabletColumnsClass(columnsTablet: unknown): string;
57
+ export declare function boxRowTabletColumnsClass(box: {
58
+ direction?: unknown;
59
+ separator?: unknown;
60
+ loop?: unknown;
61
+ line?: unknown;
62
+ columnsTablet?: unknown;
63
+ }): string;
64
+ export declare function boxRowColumnsClass(box: {
65
+ direction?: unknown;
66
+ separator?: unknown;
67
+ loop?: unknown;
68
+ line?: unknown;
69
+ columns?: unknown;
70
+ }): string;
71
+ export declare function boxPhoneRowOneLine(wrapPhone: unknown): boolean;
72
+ export declare function boxPhoneRowClasses(perRow: unknown, sharePhone?: unknown, wrapPhone?: unknown): string;
54
73
  export declare function boxPhoneRowFits(perRow: unknown, sharePhone: unknown): boolean;
55
74
  export declare const BOX_BLOCK_SPACING_LABEL = "Block spacing";
56
75
  export declare const BOX_BLOCK_SPACING_POINTS: readonly [{
@@ -1 +1 @@
1
- const f={sectionPaddingTop:0,sectionPaddingBottom:0},s={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},i={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function b(t,e){const o=typeof t=="string"&&t in s?s[t]:"",a=typeof e=="string"&&e in i?i[e]:"";return[o,a].filter(Boolean).join(" ")}function m(t){return t===!0||t==="wrap"?"flex-wrap":""}const S="Block widths",l=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Big left",value:"bigLeft",weights:[2,1]},{label:"Big right",value:"bigRight",weights:[1,2]},{label:"Bigger left",value:"biggerLeft",weights:[3,1]},{label:"Bigger right",value:"biggerRight",weights:[1,3]},{label:"2 : 3",value:"twoThree",weights:[2,3]}],n="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",x={equal:n,bigLeft:`${n} [&>*:first-child]:min-[800px]:grow-[2]`,bigRight:`${n} [&>*:last-child]:min-[800px]:grow-[2]`,biggerLeft:`${n} [&>*:first-child]:min-[800px]:grow-[3]`,biggerRight:`${n} [&>*:last-child]:min-[800px]:grow-[3]`,twoThree:`${n} [&>*:first-child]:min-[800px]:grow-[2] [&>*:last-child]:min-[800px]:grow-[3]`};function c(t){return typeof t=="string"?x[t]??"":""}const p="[&>*]:min-[800px]:basis-[content]";function h(t){return c(t)===""?p:""}const O="Columns",w=1,B=3,r={2:"max-[800px]:flex-wrap [&>*]:max-[800px]:min-w-0 [&>*]:max-[800px]:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-[800px]:flex-wrap [&>*]:max-[800px]:min-w-0 [&>*]:max-[800px]:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},L=l.filter(t=>t.value==="content"||t.value==="equal"),A="equal",g="max-[800px]:flex-wrap [&>*]:max-[800px]:min-w-0 [&>*]:max-[800px]:grow-0 [&>*]:max-[800px]:basis-[content]";function E(t,e){const o=r[Number(t)];return o?_(t,e)?g:o:"max-[800px]:flex-col"}function _(t,e){return Number(t)in r&&e==="content"}const C="Block spacing",N=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],u="sf-box-gap-only";function P(t){return t==="gap"?u:""}export{C as BOX_BLOCK_SPACING_LABEL,N as BOX_BLOCK_SPACING_POINTS,u as BOX_GAP_ONLY_CLASS,O as BOX_PHONE_ROW_LABEL,B as BOX_PHONE_ROW_MAX,w as BOX_PHONE_ROW_MIN,S as BOX_SHARE_LABEL,A as BOX_SHARE_PHONE_DEFAULT,L as BOX_SHARE_PHONE_POINTS,l as BOX_SHARE_POINTS,f as NESTED_BOX_PADDING,P as boxBlockSpacingClass,h as boxFitContentClass,b as boxLayoutClasses,E as boxPhoneRowClasses,_ as boxPhoneRowFits,c as boxShareClasses,m as boxWrapClass};
1
+ import{isStripBox as r}from"./box-separator.js";const A={sectionPaddingTop:0,sectionPaddingBottom:0},l={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},s={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function B(n,a){const p=typeof n=="string"&&n in l?l[n]:"",t=typeof a=="string"&&a in s?s[a]:"";return[p,t].filter(Boolean).join(" ")}function N(n){return n===!0||n==="wrap"?"flex-wrap":""}const E="Block widths",c=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Big left",value:"bigLeft",weights:[2,1]},{label:"Big right",value:"bigRight",weights:[1,2]},{label:"Bigger left",value:"biggerLeft",weights:[3,1]},{label:"Bigger right",value:"biggerRight",weights:[1,3]},{label:"2 : 3",value:"twoThree",weights:[2,3]}],e="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",m={equal:e,bigLeft:`${e} [&>*:first-child]:min-[800px]:grow-[2]`,bigRight:`${e} [&>*:last-child]:min-[800px]:grow-[2]`,biggerLeft:`${e} [&>*:first-child]:min-[800px]:grow-[3]`,biggerRight:`${e} [&>*:last-child]:min-[800px]:grow-[3]`,twoThree:`${e} [&>*:first-child]:min-[800px]:grow-[2] [&>*:last-child]:min-[800px]:grow-[3]`};function _(n){return typeof n=="string"?m[n]??"":""}const f="[&>*]:min-[800px]:basis-[content]";function P(n){return _(n)===""?f:""}const R="Columns",T=1,X=3,o={2:"max-[800px]:flex-wrap [&>*]:max-[800px]:min-w-0 [&>*]:max-[800px]:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-[800px]:flex-wrap [&>*]:max-[800px]:min-w-0 [&>*]:max-[800px]:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},H=c.filter(n=>n.value==="content"||n.value==="equal"),I="equal",$=1,y=6,x="min-[800px]:flex-wrap [&>*]:min-[800px]:min-w-0 [&>*]:min-[800px]:grow-0!",g={1:`${x} [&>*]:min-[800px]:basis-[calc(100%/1)]!`,2:`${x} [&>*]:min-[800px]:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${x} [&>*]:min-[800px]:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${x} [&>*]:min-[800px]:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${x} [&>*]:min-[800px]:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${x} [&>*]:min-[800px]:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function h(n){return typeof n=="number"?g[n]??"":""}const w={1:"min-[720px]:max-[1100px]:flex-row! min-[720px]:max-[1100px]:flex-wrap! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:min-w-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:grow-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:basis-[calc(100%/1)]!",2:"min-[720px]:max-[1100px]:flex-row! min-[720px]:max-[1100px]:flex-wrap! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:min-w-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:grow-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"min-[720px]:max-[1100px]:flex-row! min-[720px]:max-[1100px]:flex-wrap! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:min-w-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:grow-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"min-[720px]:max-[1100px]:flex-row! min-[720px]:max-[1100px]:flex-wrap! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:min-w-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:grow-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"min-[720px]:max-[1100px]:flex-row! min-[720px]:max-[1100px]:flex-wrap! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:min-w-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:grow-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"min-[720px]:max-[1100px]:flex-row! min-[720px]:max-[1100px]:flex-wrap! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:min-w-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:grow-0! [&>*:nth-child(n)]:min-[720px]:max-[1100px]:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function u(n){return typeof n=="number"?w[n]??"":""}function W(n){return n.direction!=="row"||r(n.direction,n.separator)||n.loop==="scroll"||n.line===!0?"":u(n.columnsTablet)}function M(n){return n.direction!=="row"||r(n.direction,n.separator)||n.loop==="scroll"||n.line===!0?"":h(n.columns)}const b="max-[800px]:flex-wrap [&>*]:max-[800px]:min-w-0 [&>*]:max-[800px]:grow-0 [&>*]:max-[800px]:basis-[content]",O={2:"max-[800px]:flex-nowrap [&>*]:max-[800px]:min-w-0 [&>*]:max-[800px]:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-[800px]:flex-nowrap [&>*]:max-[800px]:min-w-0 [&>*]:max-[800px]:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},S="max-[800px]:flex-nowrap [&>*]:max-[800px]:grow-0 [&>*]:max-[800px]:basis-[content]";function C(n){return n===!1||n==="nowrap"}function F(n,a,p){const t=o[Number(n)];if(!t)return"max-[800px]:flex-col";const i=C(p);return d(n,a)?i?S:b:i?O[Number(n)]:t}function d(n,a){return Number(n)in o&&a==="content"}const U="Block spacing",G=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],L="sf-box-gap-only";function q(n){return n==="gap"?L:""}export{U as BOX_BLOCK_SPACING_LABEL,G as BOX_BLOCK_SPACING_POINTS,y as BOX_COLUMNS_MAX,$ as BOX_COLUMNS_MIN,L as BOX_GAP_ONLY_CLASS,R as BOX_PHONE_ROW_LABEL,X as BOX_PHONE_ROW_MAX,T as BOX_PHONE_ROW_MIN,E as BOX_SHARE_LABEL,I as BOX_SHARE_PHONE_DEFAULT,H as BOX_SHARE_PHONE_POINTS,c as BOX_SHARE_POINTS,A as NESTED_BOX_PADDING,q as boxBlockSpacingClass,h as boxColumnsClass,P as boxFitContentClass,B as boxLayoutClasses,F as boxPhoneRowClasses,d as boxPhoneRowFits,C as boxPhoneRowOneLine,M as boxRowColumnsClass,W as boxRowTabletColumnsClass,_ as boxShareClasses,u as boxTabletColumnsClass,N as boxWrapClass};
@@ -1 +1 @@
1
- import{parseTickerSeparator as a,SEPARATOR_GLYPH as l,separatorScaleClass as f,TICKER_SEPARATOR_OPTIONS as c}from"../sections/ticker-style.js";const d=[{value:"none"},{value:"dot"},{value:"cross"},{value:"slash"},{value:"triangle"}];function r(h){return c.some(e=>e.value===h)?a(h):void 0}const n="overflow-hidden [&>*]:shrink-0 [&>*]:max-[800px]:basis-[content] [&>*+*]:relative [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:absolute [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:top-1/2 [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:left-[calc(var(--sf-gap-len,0px)/-2)] [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:max-[800px]:before:left-[calc(var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))/-2)] [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:-translate-x-1/2 [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:-translate-y-1/2 [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:leading-none [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:text-accent [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:text-[length:var(--sf-sep-size,1em)] [&>*+*_:is(p,h1,h2,h3,h4,h5,h6):first-child]:before:content-[var(--sf-sep-mark)]";function t(h,e){return h==="row"&&r(e)!==void 0}function x(h,e){return t(h,e)?n:""}const p="[&>*:last-child]:relative [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:absolute [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:top-1/2 [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:right-[calc(var(--sf-gap-len,0px)/-2)] [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:max-[800px]:after:right-[calc(var(--sf-gap-len,0px)/-4)] [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:translate-x-1/2 [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:-translate-y-1/2 [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:leading-none [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:text-accent [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:text-[length:var(--sf-sep-size,1em)] [&>*:last-child_:is(p,h1,h2,h3,h4,h5,h6):first-child]:after:content-[var(--sf-sep-mark)]";function _(h,e){return t(h,e)?p:""}function S(h,e){if(!t(h,e))return{};const s=r(e),i=/^text-\[(.+)\]$/.exec(f("small",s))?.[1];return{"--sf-sep-mark":JSON.stringify(l[s]),...i?{"--sf-sep-size":i}:{}}}export{d as BOX_SEPARATOR_POINTS,x as boxSeparatorClasses,r as boxSeparatorOf,_ as boxSeparatorSeamClass,S as boxSeparatorStyle,t as isStripBox};
1
+ import{parseTickerSeparator as r,SEPARATOR_GLYPH as n,separatorScaleClass as c,TICKER_SEPARATOR_OPTIONS as f}from"../sections/ticker-style.js";const d=[{value:"none"},{value:"dot"},{value:"cross"},{value:"slash"},{value:"triangle"}];function o(h){return f.some(t=>t.value===h)?r(h):void 0}const a="overflow-hidden [&>*]:shrink-0 [&>*]:max-[800px]:basis-[content] [&>*_:is(p,h1,h2,h3,h4,h5,h6)]:max-w-none [&>*_:is(.sf-button-block>div)]:font-mono [&>*_:is(.sf-button-block>div)]:text-[length:var(--size-label,14px)] [&>*_:is(.sf-button-block>div)]:tracking-[0.2em] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:inline-flex [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:items-center [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:align-top [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:h-[calc(1lh/var(--sf-sep-k,1))] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:mr-[var(--sf-gap-len,0px)] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:max-[800px]:before:mr-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:text-accent [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:text-[length:calc(var(--sf-sep-k,1)*1em)] [&>*+*_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:before:content-[var(--sf-sep-mark)]";function s(h,t){return h==="row"&&o(t)!==void 0}function v(h,t){return s(h,t)?a:""}const p="[&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:inline-flex [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:items-center [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:align-top [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:h-[calc(1lh/var(--sf-sep-k,1))] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:ml-[var(--sf-gap-len,0px)] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:max-[800px]:after:ml-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:text-accent [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:text-[length:calc(var(--sf-sep-k,1)*1em)] [&>*:last-child_:is(:is(p,h1,h2,h3,h4,h5,h6):first-child,.sf-button-block>div)]:after:content-[var(--sf-sep-mark)]";function u(h,t){return s(h,t)?p:""}function k(h,t){if(!s(h,t))return{};const i=o(t),e=/^text-\[([\d.]+)em\]$/.exec(c("small",i))?.[1],l=n[i];return{"--sf-sep-mark":l===""?"none":JSON.stringify(l),...e?{"--sf-sep-k":e}:{}}}export{d as BOX_SEPARATOR_POINTS,v as boxSeparatorClasses,o as boxSeparatorOf,u as boxSeparatorSeamClass,k as boxSeparatorStyle,s as isStripBox};
@@ -18,8 +18,16 @@ export interface CardRowFieldSpec {
18
18
  export interface CardTemplateSpec {
19
19
  block: string;
20
20
  fields: readonly CardRowFieldSpec[];
21
+ blocks?: readonly CardTemplateBlock[];
22
+ }
23
+ export interface CardTemplateBlock {
24
+ type: string;
25
+ label: string;
21
26
  }
22
27
  export declare function registerCardTemplates(specs: readonly CardTemplateSpec[]): void;
28
+ export declare function cardTemplatesNameBlocks(): boolean;
29
+ export declare function cardTemplateBlocks(type: string): readonly CardTemplateBlock[];
30
+ export declare function isCardTemplateBlock(type: string): boolean;
23
31
  export declare function hasCardTemplate(type: unknown): boolean;
24
32
  export declare function cardTemplateFields(type: string, kind?: CardRowFieldKind): readonly CardRowFieldSpec[];
25
33
  export declare function cardTemplateField(type: string | undefined, key: string): CardRowFieldSpec | null;
@@ -33,4 +41,5 @@ type DocNode = {
33
41
  props?: Record<string, unknown>;
34
42
  };
35
43
  export declare function cardTemplateOwner(appState: unknown, id: unknown): DocNode | null | undefined;
44
+ export declare function cardTemplateCardOwner(appState: unknown, id: unknown): DocNode | null | undefined;
36
45
  export {};
@@ -1 +1 @@
1
- import{isNodeList as b}from"efficient-easel/data";const k="template",L="Card template",y=["Text","ImageBlock","ButtonBlock","Flex"],c="rowField",A="rowLinkField";function B(){return{type:"slot",allow:[...y]}}const O=[{block:"OrderSummary",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]}],d=Symbol.for("efficient.card-templates");function f(){const e=globalThis;let t=e[d];return t||(t=new Map(O.map(o=>[o.block,o])),e[d]=t),t}function g(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");f().set(t.block,{block:t.block,fields:t.fields.map(o=>({...o}))})}}function R(e){return typeof e=="string"&&f().has(e)}function w(e,t){const o=f().get(e)?.fields??[];return t?o.filter(n=>(n.kind??"text")===t):o}function C(e,t){return e?f().get(e)?.fields.find(o=>o.key===t)??null:null}function p(e,t=c){const o=e?.[t];return typeof o=="string"?o.trim():""}function F(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[o,n]of Object.entries(e))typeof n=="string"&&(t[o]=n);return t}const m={Text:{text:c},ImageBlock:{src:c},ButtonBlock:{label:c,href:A}};function P(e,t,o){const n=m[e]?.[o];return!!(n&&p(t,n))}function _(e,t){return!t||!e?null:e[t]??""}function D(e,t,o){if(!o)return t;let n=null;for(const[l,s]of Object.entries(m[e]??{})){const r=_(o,p(t,s));r!==null&&(n??={...t},n[l]=r)}return n??t}function h(e,t){const o=e?.data?.content;if(!Array.isArray(o)||typeof t!="string")return;const n=(s,r)=>{for(const i of s){if(i?.props?.id===t)return r;for(const[x,u]of Object.entries(i?.props??{})){if(!b(u))continue;const T=x===k&&R(i.type)?i:r,a=n(u,T);if(a!==void 0)return a}}},l=n(o,null);return l===void 0?null:l}export{c as CARD_ROW_FIELD_PROP,A as CARD_ROW_LINK_PROP,y as CARD_TEMPLATE_BLOCKS,L as CARD_TEMPLATE_LABEL,k as CARD_TEMPLATE_SLOT,F as cardRow,C as cardTemplateField,w as cardTemplateFields,h as cardTemplateOwner,B as cardTemplateSlot,R as hasCardTemplate,p as namedRowField,g as registerCardTemplates,P as rowBound,_ as rowFieldText,D as rowFilledProps};
1
+ import{isNodeList as y}from"efficient-easel/data";const T="template",R="Card template",w=["Text","ImageBlock","ButtonBlock","Flex"],i="rowField",A="rowLinkField";function _(){return{type:"slot",allow:[...w]}}const B=[{block:"OrderSummary",fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]}],p=Symbol.for("efficient.card-templates");function n(){const t=globalThis;let e=t[p];return e||(e=new Map(B.map(o=>[o.block,o])),t[p]=e),e}function L(t){for(const e of t){if(typeof e.block!="string"||!e.block)throw new Error("A card template names no block.");const o=[];for(const r of e.blocks??[]){if(typeof r?.type!="string"||!r.type)throw new Error(`The card template of ${e.block} names an empty block.`);o.some(l=>l.type===r.type)||o.push({type:r.type,label:r.label||r.type})}n().set(e.block,{block:e.block,fields:e.fields.map(r=>({...r})),blocks:o})}}function h(){for(const t of n().values())if(t.blocks?.length)return!0;return!1}function C(t){return n().get(t)?.blocks??[]}function P(t){for(const e of n().values())if(e.blocks?.some(o=>o.type===t))return!0;return!1}function O(t){return typeof t=="string"&&n().has(t)}function F(t,e){const o=n().get(t)?.fields??[];return e?o.filter(r=>(r.kind??"text")===e):o}function D(t,e){return t?n().get(t)?.fields.find(o=>o.key===e)??null:null}function d(t,e=i){const o=t?.[e];return typeof o=="string"?o.trim():""}function S(t){const e={};if(t&&typeof t=="object"&&!Array.isArray(t))for(const[o,r]of Object.entries(t))typeof r=="string"&&(e[o]=r);return e}const m={Text:{text:i},ImageBlock:{src:i},ButtonBlock:{label:i,href:A}};function I(t,e,o){const r=m[t]?.[o];return!!(r&&d(e,r))}function g(t,e){return!e||!t?null:t[e]??""}function M(t,e,o){if(!o)return e;let r=null;for(const[l,f]of Object.entries(m[t]??{})){const c=g(o,d(e,f));c!==null&&(r??={...e},r[l]=c)}return r??e}function b(t,e){const o=t?.data?.content;if(!Array.isArray(o)||typeof e!="string")return;const r=(f,c)=>{for(const s of f){if(s?.props?.id===e)return c;for(const[k,u]of Object.entries(s?.props??{})){if(!y(u))continue;const x=k===T&&O(s.type)?{owner:s,direct:!0}:c&&{owner:c.owner,direct:!1},a=r(u,x);if(a!==void 0)return a}}},l=r(o,null);return l===void 0?null:l}function j(t,e){const o=b(t,e);return o&&o.owner}function N(t,e){const o=b(t,e);return o&&(o.direct?o.owner:null)}export{i as CARD_ROW_FIELD_PROP,A as CARD_ROW_LINK_PROP,w as CARD_TEMPLATE_BLOCKS,R as CARD_TEMPLATE_LABEL,T as CARD_TEMPLATE_SLOT,S as cardRow,C as cardTemplateBlocks,N as cardTemplateCardOwner,D as cardTemplateField,F as cardTemplateFields,j as cardTemplateOwner,_ as cardTemplateSlot,h as cardTemplatesNameBlocks,O as hasCardTemplate,P as isCardTemplateBlock,d as namedRowField,L as registerCardTemplates,I as rowBound,g as rowFieldText,M as rowFilledProps};
@@ -22,18 +22,27 @@ export declare const SITE_BLOCK_GAP: {
22
22
  };
23
23
  export declare function normalizeSiteBlockGap(v?: number | null): number | null;
24
24
  export declare function siteBlockGapTokens(v?: number | null): Record<string, string>;
25
+ export declare const SITE_BLOCK_GAP_PHONE_VAR = "--sf-block-gap-phone";
26
+ export declare const SITE_BLOCK_GAP_PHONE_REM_VAR = "--sf-block-gap-phone-rem";
27
+ export declare const SITE_BLOCK_GAP_ON_PHONE_VAR = "--sf-block-gap-on-phone";
28
+ export declare const SITE_BLOCK_GAP_PHONE_CLASS = "max-[720px]:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]";
29
+ export declare function siteBlockGapPhoneTokens(v?: number | null): Record<string, string>;
30
+ export declare function siteBlockGapPhoneClass(v?: number | null): string;
25
31
  export declare const GAP_ZONE_CLASS = "sf-gap-zone";
26
32
  export declare const GAP_LENGTH_VAR = "--sf-gap-len";
27
33
  export declare function hasOwnContainerGap(container: GapContainer, value: unknown): boolean;
28
34
  export declare const GAP_PHONE_LENGTH_VAR = "--sf-gap-len-phone";
35
+ export declare const GAP_TABLET_LENGTH_VAR = "--sf-gap-len-tablet";
29
36
  export declare const CONTAINER_GAP_PHONE: {
30
37
  readonly min: 0;
31
38
  readonly max: 64;
32
39
  readonly step: 2;
33
40
  };
34
41
  export declare function hasOwnPhoneGap(value: unknown): value is number;
35
- export declare function resolvePhoneContainerGap(container: GapContainer, phone: unknown, desktop: unknown, siteGap?: number | null): number;
36
- export declare function containerGapProps(container: GapContainer, value: unknown, axis: GapAxis, phone?: unknown): {
42
+ export declare function halfDesktopGap(px: number): number;
43
+ export declare function followsSitePhoneGap(container: GapContainer, desktop: unknown, sitePhone: unknown): sitePhone is number;
44
+ export declare function resolvePhoneContainerGap(container: GapContainer, phone: unknown, desktop: unknown, siteGap?: number | null, sitePhone?: number | null): number;
45
+ export declare function containerGapProps(container: GapContainer, value: unknown, axis: GapAxis, phone?: unknown, tablet?: unknown): {
37
46
  className: string;
38
47
  style: CSSProperties;
39
48
  };
@@ -1 +1 @@
1
- const y="sf.gapContainer",o={min:-32,max:64,step:2},m={Grid:{sm:12,md:24,lg:40},Flex:{sm:12,md:24,lg:40},FooterGroup:{sm:8,md:16,lg:32},HeroGroup:null,Events:null,GalleryB:null,ProductGrid:null},x={Grid:24,Flex:24,FooterGroup:16,HeroGroup:0,Events:24,GalleryB:8,ProductGrid:2},G=new Set(["Events","GalleryB"]);function c(n,t,e){if(typeof t=="number"&&Number.isFinite(t)&&t>=o.min)return t;if(typeof t=="string"){const r=m[n]?.[t];if(typeof r=="number")return r}return typeof e=="number"&&Number.isFinite(e)?e:x[n]}const N="sf-gap-overlap",E="--sf-gap-overlap",f="--sf-block-gap",P="--sf-block-gap-rem",s={min:0,max:o.max,step:o.step};function b(n){if(typeof n!="number"||!Number.isFinite(n))return null;const t=Math.min(Math.max(Math.round(n),s.min),s.max);return t-t%s.step}function I(n){const t=b(n);return t===null?{}:{[f]:`${t}px`,[P]:`${t/16}rem`}}const u="sf-gap-zone",l="--sf-gap-len";function g(n,t){return typeof t=="number"&&Number.isFinite(t)&&t>=o.min?!0:typeof t=="string"&&typeof m[n]?.[t]=="number"}const C="--sf-gap-len-phone",O={min:0,max:o.max,step:o.step};function _(n){return typeof n=="number"&&Number.isFinite(n)&&n>=O.min}function L(n,t,e,r){return _(t)?t:c(n,e,r)/2}const R={block:"sf-gap-overlap-block",inline:"sf-gap-overlap-inline",both:"sf-gap-overlap-both"};function S(n,t,e,r){const i=_(r)?{[C]:`${r}px`}:{};if(!g(n,t)){const a=`${x[n]}px`,A=G.has(n)?`var(--sf-card-gap, ${a})`:a;return{className:` ${u}`,style:{[l]:`var(${f}, ${A})`,...i}}}const p=c(n,t);return p>=0?{className:` ${u}`,style:{[l]:`${p}px`,...i}}:{className:` ${N} ${R[e]}`,style:{gap:"0px",[E]:`${-p/2}px`}}}export{G as CARD_GRID_CONTAINERS,o as CONTAINER_GAP,x as CONTAINER_GAP_BUILT_IN,m as CONTAINER_GAP_LEGACY,O as CONTAINER_GAP_PHONE,y as GAP_FIELD_CONTAINER,l as GAP_LENGTH_VAR,N as GAP_OVERLAP_CLASS,E as GAP_OVERLAP_VAR,C as GAP_PHONE_LENGTH_VAR,u as GAP_ZONE_CLASS,s as SITE_BLOCK_GAP,P as SITE_BLOCK_GAP_REM_VAR,f as SITE_BLOCK_GAP_VAR,S as containerGapProps,g as hasOwnContainerGap,_ as hasOwnPhoneGap,b as normalizeSiteBlockGap,c as resolveContainerGap,L as resolvePhoneContainerGap,I as siteBlockGapTokens};
1
+ const y="sf.gapContainer",r={min:-32,max:64,step:2},f={Grid:{sm:12,md:24,lg:40},Flex:{sm:12,md:24,lg:40},FooterGroup:{sm:8,md:16,lg:32},HeroGroup:null,Events:null,GalleryB:null,ProductGrid:null},u={Grid:24,Flex:24,FooterGroup:16,HeroGroup:0,Events:24,GalleryB:8,ProductGrid:2},g=new Set(["Events","GalleryB"]);function x(t,n,o){if(typeof n=="number"&&Number.isFinite(n)&&n>=r.min)return n;if(typeof n=="string"){const e=f[t]?.[n];if(typeof e=="number")return e}return typeof o=="number"&&Number.isFinite(o)?o:u[t]}const O="sf-gap-overlap",b="--sf-gap-overlap",A="--sf-block-gap",C="--sf-block-gap-rem",l={min:0,max:r.max,step:r.step};function _(t){if(typeof t!="number"||!Number.isFinite(t))return null;const n=Math.min(Math.max(Math.round(t),l.min),l.max);return n-n%l.step}function V(t){const n=_(t);return n===null?{}:{[A]:`${n}px`,[C]:`${n/16}rem`}}const L="--sf-block-gap-phone",R="--sf-block-gap-phone-rem",T="--sf-block-gap-on-phone",S="max-[720px]:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]";function H(t){const n=_(t);return n===null?{}:{[L]:`${n}px`,[R]:`${n/16}rem`}}function d(t){return _(t)===null?"":S}const G="sf-gap-zone",m="--sf-gap-len";function E(t,n){return typeof n=="number"&&Number.isFinite(n)&&n>=r.min?!0:typeof n=="string"&&typeof f[t]?.[n]=="number"}const P="--sf-gap-len-phone",I="--sf-gap-len-tablet",h={min:0,max:r.max,step:r.step};function s(t){return typeof t=="number"&&Number.isFinite(t)&&t>=h.min}function $(t){return t/2}function B(t,n,o){return s(o)&&!E(t,n)}function F(t,n,o,e,p){return s(n)?n:B(t,o,p)?p:$(x(t,o,e))}const k={block:"sf-gap-overlap-block",inline:"sf-gap-overlap-inline",both:"sf-gap-overlap-both"};function K(t,n,o,e,p){const a={...s(e)?{[P]:`${e}px`}:null,...s(p)?{[I]:`${p}px`}:null};if(!E(t,n)){const c=`${u[t]}px`,N=g.has(t)?`var(--sf-card-gap, ${c})`:c;return{className:` ${G}`,style:{[m]:`var(${A}, ${N})`,[P]:`var(${T})`,...a}}}const i=x(t,n);return i>=0?{className:` ${G}`,style:{[m]:`${i}px`,...a}}:{className:` ${O} ${k[o]}`,style:{gap:"0px",[b]:`${-i/2}px`}}}export{g as CARD_GRID_CONTAINERS,r as CONTAINER_GAP,u as CONTAINER_GAP_BUILT_IN,f as CONTAINER_GAP_LEGACY,h as CONTAINER_GAP_PHONE,y as GAP_FIELD_CONTAINER,m as GAP_LENGTH_VAR,O as GAP_OVERLAP_CLASS,b as GAP_OVERLAP_VAR,P as GAP_PHONE_LENGTH_VAR,I as GAP_TABLET_LENGTH_VAR,G as GAP_ZONE_CLASS,l as SITE_BLOCK_GAP,T as SITE_BLOCK_GAP_ON_PHONE_VAR,S as SITE_BLOCK_GAP_PHONE_CLASS,R as SITE_BLOCK_GAP_PHONE_REM_VAR,L as SITE_BLOCK_GAP_PHONE_VAR,C as SITE_BLOCK_GAP_REM_VAR,A as SITE_BLOCK_GAP_VAR,K as containerGapProps,B as followsSitePhoneGap,$ as halfDesktopGap,E as hasOwnContainerGap,s as hasOwnPhoneGap,_ as normalizeSiteBlockGap,x as resolveContainerGap,F as resolvePhoneContainerGap,d as siteBlockGapPhoneClass,H as siteBlockGapPhoneTokens,V as siteBlockGapTokens};
@@ -0,0 +1,7 @@
1
+ import { type SourceRow } from "./block-sources.js";
2
+ export declare function linkedCount(props?: Record<string, unknown> | null): string;
3
+ export declare function countWords(value: string): string;
4
+ export declare function countNumber(key: string, served: readonly SourceRow[] | null): string | null;
5
+ export declare function countsReachText(content: unknown, id: unknown): boolean;
6
+ export declare function settleCountSources<T>(layout: T): T;
7
+ export declare function settleCountNode<T>(node: T): T;
@@ -0,0 +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};
@@ -20,6 +20,13 @@ export declare const SITE_GUTTER: {
20
20
  readonly default: 40;
21
21
  };
22
22
  export declare const SITE_GUTTER_VAR = "--sf-site-gutter";
23
+ export declare const SITE_GUTTER_PHONE: {
24
+ readonly min: 0;
25
+ readonly max: 24;
26
+ readonly step: 4;
27
+ };
28
+ export declare const SITE_GUTTER_PHONE_VAR = "--sf-site-gutter-phone";
29
+ export declare const SITE_GUTTER_PHONE_CLASS = "max-[720px]:[--sf-site-gutter:var(--sf-site-gutter-phone)]!";
23
30
  export declare const SITE_GUTTER_CAP: string;
24
31
  export declare const SITE_GUTTER_CLASS: string;
25
32
  export declare const PRE_SITE_GUTTER_CLASSES: readonly ["px-10", "px-[60px]"];
@@ -35,6 +42,10 @@ export declare const SITE_COLUMN = "mx-auto max-w-[var(--sf-site-width,1600px)]
35
42
  export declare const EDITORIAL_COLUMN = "mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]";
36
43
  export declare function normalizeSiteGutter(v?: number | null): number;
37
44
  export declare function siteGutterTokens(v?: number | null): Record<string, string>;
45
+ export declare function normalizeSiteGutterPhone(v?: number | null): number | null;
46
+ export declare function siteGutterPhoneTokens(v?: number | null): Record<string, string>;
47
+ export declare function siteGutterPhoneClass(v?: number | null): string;
48
+ export declare function siteGutterPhoneFollows(gutter?: number | null): number;
38
49
  export declare function siteHalfColumnCap(dividerPx?: number): string;
39
50
  export declare function siteHalfColumnCapClass(dividerPx?: number): string;
40
51
  export declare const HERO_CAP: string;
@@ -1 +1 @@
1
- const p={min:1e3,max:2e3,step:50,default:1600};function m(t){return{maxWidth:t,marginInline:"auto",width:"100%"}}function P(t,e){if(t!==!1)return null;const a=typeof e=="number"?e:p.default;return m(a)}const i="--sf-site-width",o=`var(${i},${p.default}px)`,E=`max-w-[${o}]`,M=`max-w-[${p.default}px]`;function T(t){return typeof t!="number"||!Number.isFinite(t)?p.default:Math.round(Math.min(Math.max(t,p.min),p.max))}function D(t){const e=T(t);return e===p.default?{}:{[i]:`${e}px`}}const r={min:0,max:80,step:4,default:40},s="--sf-site-gutter",x=`var(${s},${r.default}px)`,R=`px-[${x}]`,W=["px-10","px-[60px]"],n={md:`min(24px,${x})`,sm:`min(20px,${x})`,frame:`min(24px,${x})`,tabs:`min(16px,${x})`},C=[[`max-[1100px]:px-[${n.md}]`,"max-[1100px]:px-6"],[`max-[1100px]:px-[${n.tabs}]`,"max-[1100px]:px-4"],[`max-[960px]:px-[${n.frame}]`,"max-[960px]:px-6"],[`max-[900px]:px-[${n.md}]`,"max-[900px]:px-6"],[`max-[800px]:px-[${n.md}]`,"max-[800px]:px-6"],[`max-[720px]:px-[${n.sm}]`,"max-[720px]:px-5"],[`max-[800px]:px-[${n.sm}]`,"max-[800px]:px-5"],[`max-[640px]:px-[${n.sm}]`,"max-[640px]:px-5"],[`min-[800px]:px-[${x}]`,"min-[800px]:px-10"],[`max-[720px]:px-[min(24px,${x})]`,"max-[720px]:px-6"],[`max-[800px]:-mx-[min(20px,${x})]`,"max-[800px]:-mx-5"],[`max-[720px]:-mx-[min(20px,${x})]`,"max-[720px]:-mx-5"],[`-mx-[${x}]`,"-mx-10"],[R,"px-10"]];function w(t){return C.reduce((e,[a,l])=>e.split(a).join(l),t)}const G="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]",g="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]";function A(t){return typeof t!="number"||!Number.isFinite(t)?r.default:Math.round(Math.min(Math.max(t,r.min),r.max))}function L(t){const e=A(t);return e===r.default?{}:{[s]:`${e}px`}}function S(t=0){return`calc(${o}/2 - ${x}*2 - ${t}px)`}function U(t=0){return`max-w-[${S(t).replace(/ /g,"_")}]`}const _=o,N=`max-w-[${_}]`,b=`max-w-[min(var(--sf-page-cap,${p.default}px),${p.default}px)]`,c="--sf-hero-cap",$=`var(${c},none)`,v=`max-w-[${$}]`,d="--sf-hero-bleed-m",h="--sf-hero-bleed-w",H="--sf-hero-chrome-x",I="--sf-hero-chrome-cap";function V(t){return t===!0?{[c]:_,[d]:"auto",[h]:"100%",[H]:"24px",[I]:"none"}:{}}const u=`calc(${o} - ${x}*2)`,B=`max-w-[${u.replace(/ /g,"_")}]`,y=E;function k(t){return t!==!1?null:m(f)}const O="--sf-chrome-cap",f=`var(${O},${u})`,K="data-page-width";function z(t){return t==="full"?"full":null}function F(t){return t==="full"?null:m(t==="content"?u:f)}function j(t){if(t==="full")return"full";if(t==="content")return"content"}export{f as CHROME_CAP_READ,O as CHROME_CAP_VAR,u as CHROME_WIDTH_CAP,B as CHROME_WIDTH_CAP_CLASS,g as EDITORIAL_COLUMN,$ as HERO_BACKGROUND_CAP,v as HERO_BACKGROUND_CAP_CLASS,c as HERO_BACKGROUND_VAR,d as HERO_BLEED_MARGIN_VAR,h as HERO_BLEED_WIDTH_VAR,_ as HERO_CAP,N as HERO_CAP_CLASS,I as HERO_CHROME_CAP_VAR,H as HERO_CHROME_INSET_VAR,p as PAGE_WIDTH,K as PAGE_WIDTH_ATTR,y as PRE_CHROME_WIDTH_CAP_CLASS,b as PRE_HERO_CAP_CLASS,W as PRE_SITE_GUTTER_CLASSES,M as PRE_SITE_WIDTH_CAP_CLASS,G as SITE_COLUMN,r as SITE_GUTTER,x as SITE_GUTTER_CAP,R as SITE_GUTTER_CLASS,n as SITE_GUTTER_NARROW,C as SITE_GUTTER_SUBSTITUTIONS,s as SITE_GUTTER_VAR,o as SITE_WIDTH_CAP,E as SITE_WIDTH_CAP_CLASS,i as SITE_WIDTH_VAR,w as asMainGutters,m as centredCap,F as chromeWidthStyle,V as heroBackgroundTokens,A as normalizeSiteGutter,T as normalizeSiteWidth,z as pageWidthMarker,P as pageWidthStyle,j as resolveChromeWidth,L as siteGutterTokens,S as siteHalfColumnCap,U as siteHalfColumnCapClass,k as siteWidthCapStyle,D as siteWidthTokens};
1
+ const n={min:1e3,max:2e3,step:50,default:1600};function u(t){return{maxWidth:t,marginInline:"auto",width:"100%"}}function w(t,e){if(t!==!1)return null;const a=typeof e=="number"?e:n.default;return u(a)}const s="--sf-site-width",o=`var(${s},${n.default}px)`,C=`max-w-[${o}]`,D=`max-w-[${n.default}px]`;function S(t){return typeof t!="number"||!Number.isFinite(t)?n.default:Math.round(Math.min(Math.max(t,n.min),n.max))}function U(t){const e=S(t);return e===n.default?{}:{[s]:`${e}px`}}const p={min:0,max:80,step:4,default:40},_="--sf-site-gutter",i={min:0,max:24,step:4},A="--sf-site-gutter-phone",h="max-[720px]:[--sf-site-gutter:var(--sf-site-gutter-phone)]!",x=`var(${_},${p.default}px)`,$=`px-[${x}]`,W=["px-10","px-[60px]"],r={md:`min(24px,${x})`,sm:`min(20px,${x})`,frame:`min(24px,${x})`,tabs:`min(16px,${x})`},d=[[`max-[1100px]:px-[${r.md}]`,"max-[1100px]:px-6"],[`max-[1100px]:px-[${r.tabs}]`,"max-[1100px]:px-4"],[`max-[960px]:px-[${r.frame}]`,"max-[960px]:px-6"],[`max-[900px]:px-[${r.md}]`,"max-[900px]:px-6"],[`max-[800px]:px-[${r.md}]`,"max-[800px]:px-6"],[`max-[720px]:px-[${r.sm}]`,"max-[720px]:px-5"],[`max-[800px]:px-[${r.sm}]`,"max-[800px]:px-5"],[`max-[640px]:px-[${r.sm}]`,"max-[640px]:px-5"],[`min-[800px]:px-[${x}]`,"min-[800px]:px-10"],[`max-[720px]:px-[min(24px,${x})]`,"max-[720px]:px-6"],[`max-[800px]:-mx-[min(20px,${x})]`,"max-[800px]:-mx-5"],[`max-[720px]:-mx-[min(20px,${x})]`,"max-[720px]:-mx-5"],[`-mx-[${x}]`,"-mx-10"],[$,"px-10"]];function L(t){return d.reduce((e,[a,R])=>e.split(a).join(R),t)}const N="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]",b="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]";function c(t){return typeof t!="number"||!Number.isFinite(t)?p.default:Math.round(Math.min(Math.max(t,p.min),p.max))}function V(t){const e=c(t);return e===p.default?{}:{[_]:`${e}px`}}function f(t){return typeof t!="number"||!Number.isFinite(t)?null:Math.round(Math.min(Math.max(t,i.min),i.max))}function v(t){const e=f(t);return e===null?{}:{[A]:`${e}px`}}function y(t){return f(t)===null?"":h}function B(t){return Math.min(i.max,c(t))}function H(t=0){return`calc(${o}/2 - ${x}*2 - ${t}px)`}function k(t=0){return`max-w-[${H(t).replace(/ /g,"_")}]`}const l=o,F=`max-w-[${l}]`,z=`max-w-[min(var(--sf-page-cap,${n.default}px),${n.default}px)]`,E="--sf-hero-cap",I=`var(${E},none)`,K=`max-w-[${I}]`,O="--sf-hero-bleed-m",P="--sf-hero-bleed-w",G="--sf-hero-chrome-x",M="--sf-hero-chrome-cap";function j(t){return t===!0?{[E]:l,[O]:"auto",[P]:"100%",[G]:"24px",[M]:"none"}:{}}const m=`calc(${o} - ${x}*2)`,q=`max-w-[${m.replace(/ /g,"_")}]`,J=C;function Q(t){return t!==!1?null:u(T)}const g="--sf-chrome-cap",T=`var(${g},${m})`,X="data-page-width";function Y(t){return t==="full"?"full":null}function Z(t){return t==="full"?null:u(t==="content"?m:T)}function tt(t){if(t==="full")return"full";if(t==="content")return"content"}export{T as CHROME_CAP_READ,g as CHROME_CAP_VAR,m as CHROME_WIDTH_CAP,q as CHROME_WIDTH_CAP_CLASS,b as EDITORIAL_COLUMN,I as HERO_BACKGROUND_CAP,K as HERO_BACKGROUND_CAP_CLASS,E as HERO_BACKGROUND_VAR,O as HERO_BLEED_MARGIN_VAR,P as HERO_BLEED_WIDTH_VAR,l as HERO_CAP,F as HERO_CAP_CLASS,M as HERO_CHROME_CAP_VAR,G as HERO_CHROME_INSET_VAR,n as PAGE_WIDTH,X as PAGE_WIDTH_ATTR,J as PRE_CHROME_WIDTH_CAP_CLASS,z as PRE_HERO_CAP_CLASS,W as PRE_SITE_GUTTER_CLASSES,D as PRE_SITE_WIDTH_CAP_CLASS,N as SITE_COLUMN,p as SITE_GUTTER,x as SITE_GUTTER_CAP,$ as SITE_GUTTER_CLASS,r as SITE_GUTTER_NARROW,i as SITE_GUTTER_PHONE,h as SITE_GUTTER_PHONE_CLASS,A as SITE_GUTTER_PHONE_VAR,d as SITE_GUTTER_SUBSTITUTIONS,_ as SITE_GUTTER_VAR,o as SITE_WIDTH_CAP,C as SITE_WIDTH_CAP_CLASS,s as SITE_WIDTH_VAR,L as asMainGutters,u as centredCap,Z as chromeWidthStyle,j as heroBackgroundTokens,c as normalizeSiteGutter,f as normalizeSiteGutterPhone,S as normalizeSiteWidth,Y as pageWidthMarker,w as pageWidthStyle,tt as resolveChromeWidth,y as siteGutterPhoneClass,B as siteGutterPhoneFollows,v as siteGutterPhoneTokens,V as siteGutterTokens,H as siteHalfColumnCap,k as siteHalfColumnCapClass,Q as siteWidthCapStyle,U as siteWidthTokens};
@@ -7,6 +7,7 @@ export declare const SECTION_STICK_DISTANCE: {
7
7
  readonly fallback: 0;
8
8
  };
9
9
  export declare const SECTION_STICK_CLASS = "sf-section-stick";
10
+ export declare const SCROLL_OVER_CLASS = "sf-scroll-over";
10
11
  export declare const SECTION_STICK_PHONE_ON_CLASS = "sf-section-stick-phone-on";
11
12
  export declare const SECTION_STICK_PHONE_OFF_CLASS = "sf-section-stick-phone-off";
12
13
  export declare const SECTION_STICK_VARS: {
@@ -1 +1 @@
1
- import{finiteNumber as a}from"../finite-number.js";const _="Stick to top",s={min:0,max:200,step:4,fallback:0},k="sf-section-stick",r="sf-section-stick-phone-on",f="sf-section-stick-phone-off",c={desktop:"--sf-stick-distance",phone:"--sf-stick-distance-phone"},u=new Set(["CategoryBar","DocTabs","IntroBleed"]);function i(o){const t=a(o)??s.fallback;return Math.min(s.max,Math.max(s.min,Math.round(t)))}function h(o){return typeof o.stickTopPhone=="boolean"}function T(o){const t=o.stickTop===!0,n=i(o.stickTopDistance),e=h(o),p=e?o.stickTopPhone===!0:t,S=e?i(o.stickTopDistancePhone):n;return{desktop:t,desktopDistance:n,phone:p,phoneDistance:S,ownPhone:e}}function I(o){const t=T(o);if(!t.desktop&&!t.phone)return null;const n=[k],e={};return t.desktop&&(e[c.desktop]=`${t.desktopDistance}px`),(t.ownPhone||t.phone!==t.desktop)&&(n.push(t.phone?r:f),t.phone&&(e[c.phone]=`${t.phoneDistance}px`)),t.desktop||n.push("sf-section-stick-desktop-off"),{className:n.join(" "),style:e}}export{k as SECTION_STICK_CLASS,s as SECTION_STICK_DISTANCE,u as SECTION_STICK_EXCLUDED,_ as SECTION_STICK_LABEL,f as SECTION_STICK_PHONE_OFF_CLASS,r as SECTION_STICK_PHONE_ON_CLASS,c as SECTION_STICK_VARS,h as hasPhoneStick,T as resolveSectionStick,I as sectionStickAttrs};
1
+ import{finiteNumber as r}from"../finite-number.js";const _="Stick to top",s={min:0,max:200,step:4,fallback:0},a="sf-section-stick",u="sf-scroll-over",k="sf-section-stick-phone-on",f="sf-section-stick-phone-off",c={desktop:"--sf-stick-distance",phone:"--sf-stick-distance-phone"},x=new Set(["CategoryBar","DocTabs","IntroBleed"]);function i(o){const t=r(o)??s.fallback;return Math.min(s.max,Math.max(s.min,Math.round(t)))}function h(o){return typeof o.stickTopPhone=="boolean"}function C(o){const t=o.stickTop===!0,n=i(o.stickTopDistance),e=h(o),p=e?o.stickTopPhone===!0:t,S=e?i(o.stickTopDistancePhone):n;return{desktop:t,desktopDistance:n,phone:p,phoneDistance:S,ownPhone:e}}function I(o){const t=C(o);if(!t.desktop&&!t.phone)return null;const n=[a],e={};return t.desktop&&(e[c.desktop]=`${t.desktopDistance}px`),(t.ownPhone||t.phone!==t.desktop)&&(n.push(t.phone?k:f),t.phone&&(e[c.phone]=`${t.phoneDistance}px`)),t.desktop||n.push("sf-section-stick-desktop-off"),{className:n.join(" "),style:e}}export{u as SCROLL_OVER_CLASS,a as SECTION_STICK_CLASS,s as SECTION_STICK_DISTANCE,x as SECTION_STICK_EXCLUDED,_ as SECTION_STICK_LABEL,f as SECTION_STICK_PHONE_OFF_CLASS,k as SECTION_STICK_PHONE_ON_CLASS,c as SECTION_STICK_VARS,h as hasPhoneStick,C as resolveSectionStick,I as sectionStickAttrs};
@@ -8,5 +8,11 @@ export interface BoxPlace {
8
8
  insideGutter: boolean;
9
9
  inBox: boolean;
10
10
  }
11
+ export declare function boxRunsEdgeToEdge(props: {
12
+ loop?: unknown;
13
+ direction?: unknown;
14
+ scrollDirection?: unknown;
15
+ bgImage?: unknown;
16
+ }): boolean;
11
17
  export declare function siteDrawsGutter(siteContent: unknown): boolean;
12
18
  export declare function boxPlaceOf(content: unknown, id: unknown, site: boolean): BoxPlace | undefined;
@@ -1 +1 @@
1
- import{isNodeList as p}from"efficient-easel/data";const G=new Set(["Flex","Grid"]);function l(t){return typeof t=="string"&&G.has(t)}const O="contentWidth",B="full",T="content";function _(t){const n=t?.[O];return n===B?!1:n===T?!0:void 0}function b(t,n){return t&&!n}function F(t){return t!=="full"}function R(t,n,r){if(!Array.isArray(t)||typeof n!="string")return;const i=(d,e)=>{for(const s of d){const o=s?.props??{};if(o.id===n)return e;const u=l(s?.type),x=u&&(e.inBox?_(o)??r:r),a={insideGutter:e.insideGutter||x,inBox:e.inBox||u};for(const f of Object.values(o)){if(!p(f))continue;const c=i(f,a);if(c!==void 0)return c}}};return i(t,{insideGutter:!1,inBox:!1})}export{O as BOX_GUTTER_KEY,B as BOX_GUTTER_OFF,T as BOX_GUTTER_ON,_ as boxGutterOf,R as boxPlaceOf,b as drawsSiteGutter,l as isFrameContainer,F as siteDrawsGutter};
1
+ import{isNodeList as l}from"efficient-easel/data";import{isVerticalLoop as g}from"../animation/loop.js";import{isBackgroundBox as p}from"./box-background.js";const G=new Set(["Flex","Grid"]);function b(t){return typeof t=="string"&&G.has(t)}const m="contentWidth",B="full",O="content";function E(t){const n=t?.[m];return n===B?!1:n===O?!0:void 0}function F(t,n){return t&&!n}function T(t){return t.loop==="scroll"&&t.direction!=="tabs"&&!p(typeof t.bgImage=="string"?t.bgImage:null)&&!g(t.scrollDirection)}function w(t){return t!=="full"}function A(t,n,i){if(!Array.isArray(t)||typeof n!="string")return;const u=(d,o)=>{for(const s of d){const e=s?.props??{};if(e.id===n)return o;const r=b(s?.type),x=r&&(o.inBox?E(e)??i:i),a={insideGutter:o.insideGutter||x||r&&T(e),inBox:o.inBox||r};for(const f of Object.values(e)){if(!l(f))continue;const c=u(f,a);if(c!==void 0)return c}}};return u(t,{insideGutter:!1,inBox:!1})}export{m as BOX_GUTTER_KEY,B as BOX_GUTTER_OFF,O as BOX_GUTTER_ON,E as boxGutterOf,A as boxPlaceOf,T as boxRunsEdgeToEdge,F as drawsSiteGutter,b as isFrameContainer,w as siteDrawsGutter};
@@ -3,4 +3,6 @@ export declare const EASEL_ROW_WORDS: {
3
3
  readonly textFit: "When the text does not fit";
4
4
  readonly wrap: "Wrap";
5
5
  readonly shrink: "Shrink to fit";
6
+ readonly line: "One line";
7
+ readonly onTablet: "{value} on tablet";
6
8
  };
@@ -1 +1 @@
1
- const t={fillColor:"Fill color",textFit:"When the text does not fit",wrap:"Wrap",shrink:"Shrink to fit"};export{t as EASEL_ROW_WORDS};
1
+ const t={fillColor:"Fill color",textFit:"When the text does not fit",wrap:"Wrap",shrink:"Shrink to fit",line:"One line",onTablet:"{value} on tablet"};export{t as EASEL_ROW_WORDS};
@@ -10,5 +10,6 @@ export declare const TEXT_BAND_KEY = " text";
10
10
  export declare const TEXT_BAND_TITLE = "Text";
11
11
  export declare function bandIsDropped(band: DrawnBand): boolean;
12
12
  export declare function droppedBands(bands: readonly DrawnBand[]): string[];
13
+ export declare function loneDesignBand(bands: readonly DrawnBand[], loose: readonly BandRow[]): string | null;
13
14
  export declare function withoutBands<T extends Record<string, unknown>>(fields: T, keys: ReadonlySet<string>): T;
14
15
  export declare function sameKeys(a: ReadonlySet<string>, b: ReadonlySet<string>): boolean;
@@ -1 +1 @@
1
- const f=" text",u="Text";function s(t){const e=t.rows.filter(n=>n.shown);return e.length===0||e.length===1&&e[0].labelled}function l(t){return t.filter(s).map(e=>e.key)}function i(t,e){let n=null;for(const r of e){const o=t[r];!o||o.marker!==!0||typeof o.fold!="string"||(n??={...t},n[r]={...o,fold:!1})}return n??t}function p(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}export{f as TEXT_BAND_KEY,u as TEXT_BAND_TITLE,s as bandIsDropped,l as droppedBands,p as sameKeys,i as withoutBands};
1
+ const s=" text",f="Text";function l(e){const t=e.rows.filter(o=>o.shown);return t.length===0||t.length===1&&t[0].labelled}function u(e){return e.filter(l).map(t=>t.key)}function i(e,t){const o=e.filter(n=>!l(n));if(o.length!==1)return null;const r=e.filter(l).flatMap(n=>n.rows);return[...t,...r].some(n=>n.shown)?null:o[0].rows.filter(n=>n.shown).length>1?o[0].key:null}function p(e,t){let o=null;for(const r of t){const n=e[r];!n||n.marker!==!0||typeof n.fold!="string"||(o??={...e},o[r]={...n,fold:!1})}return o??e}function c(e,t){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}export{s as TEXT_BAND_KEY,f as TEXT_BAND_TITLE,l as bandIsDropped,u as droppedBands,i as loneDesignBand,c as sameKeys,p as withoutBands};
@@ -0,0 +1,8 @@
1
+ import type { SettingsBucket } from "efficient-easel/fields";
2
+ export declare function panelTab({ allTabs, remembered, inherited, buckets, hasText, }: {
3
+ allTabs: boolean;
4
+ remembered: SettingsBucket | undefined;
5
+ inherited: SettingsBucket | undefined;
6
+ buckets: readonly SettingsBucket[];
7
+ hasText: boolean;
8
+ }): SettingsBucket;
@@ -0,0 +1 @@
1
+ function r({allTabs:i,remembered:n,inherited:u,buckets:f,hasText:l}){return n&&(i||f.includes(n))?n:u&&f.includes(u)?u:l?"Design":f[0]??"Design"}export{r as panelTab};
@@ -0,0 +1,6 @@
1
+ type Props = Readonly<Record<string, unknown>>;
2
+ export declare function plainRecord(value: unknown): Record<string, unknown> | null;
3
+ export declare function readPartRecords(props: Props | undefined, prop: string): Record<string, unknown>;
4
+ export declare function readPartRecord(props: Props | undefined, prop: string, part: string): Record<string, unknown>;
5
+ export declare function propsWithPartRecord(props: Props, prop: string, part: string, record: Record<string, unknown> | null): Record<string, unknown>;
6
+ export {};