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
package/CHANGELOG.md CHANGED
@@ -1,10 +1,76 @@
1
1
  # Changelog
2
2
 
3
+ ## 48.0.0 - 2026-11-03
4
+
5
+ From main at `1abf1642`: #448, #434, #449, #451, #453, #452, #455, #456, #458, #457. A major.
6
+
7
+ **Pair for hosts:** the Tablet Gap (#458) draws only with efficient-storefront-blocks #334 (`.sf-gap-zone` reads `--sf-gap-len-tablet` from 720 to 1099 px). The tablet text-style keys (#452) are the nine view keys efficient-backend #4256 accepts.
8
+
9
+ ### Breaking
10
+
11
+ - Peer `efficient-easel` `^26.7.0` → `^27.0.0` (#448 took `^26.13.0`, #452 takes `^27.0.0`, which gates the Tablet view). `efficient-shell` stays `^11.8.0`.
12
+ - The export `entriesHiddenForTab` is removed from `lib/document/controls` (#434). `efficient-storefront-blocks` imports it in `scripts/test-entries-follow-the-tab.ts`; its bump to 48 changes that guard. `efficient-storefront` does not import it.
13
+ - The module `lib/document/selected-host` is deleted, and the published path `efficient-web-builder/editor/lib/document/selected-host` with it (#449). Import `useSelectedHost` from `efficient-easel/easel`.
14
+ - A strip Box's `Gap` is the space on each side of its mark, not the space the mark is laid over (#451). A Box that stores a separator draws a different space. Read-only count on the inovit_us pages, 2026-11-03: 0 Box nodes store a separator (the 12 stored separators are Scrolling Bar sections, which store no gap). No data move.
15
+ - In the Tablet view, a row that still writes the desktop value is hidden (#452): the part panel's Font size and Alignment, and a picture's focus point.
16
+
17
+ ### Added
18
+
19
+ - The Tablet view keeps its own values (#452, #458): four-side Padding (section, block, Box card, Hero's Box, Divider); the site text styles (`sizeTablet` and the tablet and phone line, letter and paragraph spacing and Largest size); Box Columns (`columnsTablet`); the container Gap (`gapTablet`, `containerGapTabletField`; none for a strip or a scrolling row). New exports: `BOX_TABLET_COLUMNS_CLASS`, `boxTabletColumnsClass`, `boxRowTabletColumnsClass`, `GAP_TABLET_LENGTH_VAR`, `containerGapTabletField`.
20
+ - An empty view panel says "These settings apply to every view." (`SameInEveryViewNote`, #452). New word: `{value} on tablet`.
21
+ - Every node panel draws the Design and Animation tabs (#434).
22
+ - Every part panel has the Design and Animation tabs (#453): `usePartMotion`; `animationTabFields` takes the kind `"textPart"`.
23
+ - The editor canvas plays a text part's Entrance (when the view's value changes) and Lift (a real hover), as the published page does (#457): `usePhoneWidth`, `partLiftRules`, `drawPartEntrance`, `PART_LIFT_ATTR`, `paintPartMotion`; optional `motions` on the PartAnchors contract.
24
+ - The Box Direction row and the phone Box shape row (#448). `openDraftPreview` takes an optional `ready`; Save as Template, the draft Preview and Restore version wait for writes. Map Find says `LOOKUP_BUSY_NOTE` for a stale lookup.
25
+ - A card template takes a host's own blocks (#455): a block type that a card template declares (`CardTemplateSpec.blocks`) gets no section rows, and no Add category may list it. A config that breaks this throws by name.
26
+ - Document Header, Issue Header and Breadcrumb get Box converter rows, switched off (#456): `PAGE_HEADER_SECTION_TO_BOX`, `leadText`, `leadLine`, `RIGHT_WORDS`. A strip Box draws its mark before a Button block too.
27
+
28
+ ### Fixed
29
+
30
+ - City cards stand one per line in Tablet: the Locations converter writes `columnsTablet: 1` (#458; the 47.2.0 cards were 21-41 px too wide at 900 and 820 px).
31
+ - With easel 27, the Phone view's Line, Letter and Paragraph spacing and Largest size rows write their values; before, only `sizePhone` was kept (#452).
32
+ - The grey letter spacing in a view is the px the page draws (#452).
33
+ - Rows that read the selected node's host read easel's `useSelectedHost`, so under `RootHostScope` they read the root's host (#449).
34
+ - A Scrolling Bar converted to a Box stores Gap 60 / 32, on the 4 spacing scale (#451).
35
+
36
+ ## 47.2.0 - 2026-11-03
37
+
38
+ From main at `9299d1ad`. It carries every change on main since 47.0.0; #435 is also in 47.1.0 (entry below). A minor: exports and optional props are added, no export is removed, peers are unchanged (`efficient-easel` `^26.7.0`, `efficient-shell` `^11.8.0`). No stored value moves.
39
+
40
+ **Pair for hosts:** #442 adds the class `sf-scroll-over` on a pinned intro; efficient-storefront-blocks 0.78.0 (#328) holds the CSS rule for it. A storefront takes both together.
41
+
42
+ ### Added
43
+
44
+ - A number in a Box links to a live count (#433): `copyNodeToPage`, `saveSectionTemplate`, `settleCountNode`.
45
+ - The site's Block gap has its own phone value (#436): `block_gap_phone`, tokens `--sf-block-gap-phone` and `--sf-block-gap-phone-rem`, the module `format/site-twin-row` (`siteTwinRow`).
46
+ - Side space keeps its own phone value (#420).
47
+ - An image in a plain section reaches its edge (#419).
48
+ - A card's own panel says which parts show (#395).
49
+ - The Box: a Stats row, OFF, and a figure's live number mark (#429); the dry run reads the CLI page list and writes one edit per page (#437).
50
+ - Locations: one card size by a Columns row, the time zone tag on one line (#426); the Box's phone Wrap value `wrapPhone` and `boxPhoneRowOneLine`; `boxPhoneRowClasses` takes an optional third argument.
51
+ - A loop's Duration and Delay rows show what the page runs (#439): `loopDurationField`, `loopDelayField`.
52
+
53
+ ### Changed (section conversions to the Box keep the old look; `SECTION_TO_BOX_ON` stays empty, so no stored page changes)
54
+
55
+ - Heading case (#438), Section Header (#440), CTA Heading (#441), Cards and Detail Cards (#443), Stats (#444), Prose and Paragraphs (#445), Recurring Columns (#446), Scrolling Bar (#442: `boxRunsEdgeToEdge`, `fillFrom`, `TICKER_BARE_GAP`).
56
+
57
+ ### Fixed
58
+
59
+ - A block's Min width wins over its row's `min-w-0` (#423).
60
+ - Every block with an Entrance has the two tabs (#425).
61
+ - A picker row says its empty word once (#427); a Design tab with one group draws no band (#428).
62
+ - Site styles: width rows draw in the desktop view only (#430).
63
+ - A Text's Content width reaches its words (#435, as in 47.1.0).
64
+
65
+ ### Internal
66
+
67
+ - easel 26.10 then 26.12 in the dev range (#422, #426); panel rows counted per view (#431).
68
+
3
69
  ## 47.1.0 - 2026-11-03
4
70
 
5
71
  Cut from the `v47.0.0` tag, with only the changes of #435. Main holds later work that this release does not carry. A minor because it adds three exports and one optional prop. No stored value moves.
6
72
 
7
- **Back to main:** #435 brings the same change to main. The next release from main must be a version above 47.1.0, and its CHANGELOG must carry this entry. The release owner checks both before that release.
73
+ **Back to main:** #435 brought the same change to main, with this entry. The next release from main must be a version above 47.1.0.
8
74
 
9
75
  ### Fixed
10
76
 
@@ -1,5 +1,19 @@
1
- export default function BlockGapField({ value, onChange, showHint, }: {
1
+ import { type SiteRowView } from "../../format/lib/site-twin-row.js";
2
+ export declare function blockGapRow(device: SiteRowView, site: {
3
+ gap: number | null;
4
+ phone: number | null;
5
+ }): {
6
+ key: "block_gap";
7
+ value: number | null;
8
+ followsPx: null;
9
+ } | {
10
+ key: "block_gap_phone";
11
+ value: number | null;
12
+ followsPx: number | null;
13
+ } | null;
14
+ export default function BlockGapField({ value, onChange, showHint, followsPx, }: {
2
15
  value: number | null;
3
16
  onChange: (v: number | null) => void;
4
17
  showHint?: boolean;
18
+ followsPx?: number | null;
5
19
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as r,SettingsField as c}from"efficient-easel/panel";import{AlignSeparateIcon as d}from"efficient-easel/icons";import{CONTAINER_GAP_BUILT_IN as p,SITE_BLOCK_GAP as n}from"../../format/lib/content/container-gap.js";import{say as e,editorEaselWords as m}from"../../format/lib/editor-words.js";import{Slider as f}from"../lib/document/controls.js";const u="The space between the blocks inside a row, a grid or a box. Default means each one keeps the spacing it already has.",i="Block gap",_=p.Grid;function g({value:o,onChange:l,showHint:s=!0}){const a=o===null;return t(c,{label:e(i),labelId:"sf-block-gap",icon:t(d,{}),value:a?e("Default"):`${o}px`,changed:!a,action:t(r,{words:m()?.panel,label:e(i),changed:!a,detail:e("each block's own spacing"),onReset:()=>l(null)}),hint:s?e(u):void 0,children:t(f,{min:n.min,max:n.max,step:n.step,value:a?_:o,readout:!1,ariaLabel:e(i),onChange:l})})}export{g as default};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{SettingsDefaultReset as u,SettingsField as d}from"efficient-easel/panel";import{AlignSeparateIcon as h}from"efficient-easel/icons";import{CONTAINER_GAP_BUILT_IN as m,SITE_BLOCK_GAP as i,halfDesktopGap as f,normalizeSiteBlockGap as _}from"../../format/lib/content/container-gap.js";import{say as o,editorEaselWords as g}from"../../format/lib/editor-words.js";import{Slider as k}from"../lib/document/controls.js";import{siteTwinRow as b}from"../../format/lib/site-twin-row.js";const B="The space between the blocks inside a row, a grid or a box. Default means each one keeps the spacing it already has.",G="The space between the blocks inside a row, a grid or a box, on a phone. Until you set it, a phone uses half the desktop gap.",s="Block gap",r=m.Grid;function S(a,e){return b(a,{desktop:{key:"block_gap",value:e.gap,followsPx:null},phone:{key:"block_gap_phone",value:e.phone,followsPx:e.gap===null?null:f(e.gap)}})}function w({value:a,onChange:e,showHint:c=!0,followsPx:l=null}){const t=a===null,p=l===null?null:`${l}px`;return n(d,{label:o(s),labelId:"sf-block-gap",icon:n(h,{}),value:t?p??o("Default"):`${a}px`,changed:!t,action:n(u,{words:g()?.panel,label:o(s),changed:!t,detail:p??o("each block's own spacing"),onReset:()=>e(null)}),hint:c?o(p===null?B:G):void 0,children:n(k,{min:i.min,max:i.max,step:i.step,value:a??(l===null?r:_(l)??r),readout:!1,ariaLabel:o(s),onChange:e})})}export{S as blockGapRow,w as default};
@@ -1,5 +1,6 @@
1
1
  import type { RefObject } from "react";
2
2
  import { type TreeItem } from "efficient-easel/draw";
3
+ import type { EditorPageRow, WebsitePages } from "../../format/lib/web-backend.js";
3
4
  interface Props {
4
5
  node: TreeItem;
5
6
  currentSlug: string;
@@ -9,4 +10,5 @@ interface Props {
9
10
  onNotify?: (msg: string, tone?: "success" | "error") => void;
10
11
  }
11
12
  export default function DuplicateToPageMenu({ node, currentSlug, siteId, tokenRef, runAuthed, onNotify }: Props): import("react").JSX.Element;
13
+ export declare function copyNodeToPage(pages: WebsitePages, page: Pick<EditorPageRow, "id" | "slug">, clone: TreeItem): Promise<void>;
12
14
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as g,Fragment as A}from"react/jsx-runtime";import{useCallback as L,useRef as z,useState as s}from"react";import{InspectorIconButton as W}from"efficient-easel/chrome";import{PopupMenu as H,PopupMenuItem as Y,PopupMenuLabel as a}from"efficient-shell/ui";import{CopyToPageIcon as $}from"efficient-easel/icons";import{backendOf as M}from"../lib/website-session.js";import{useEaselSession as q}from"efficient-easel/screen/lib/session-context";import{say as n}from"../../format/lib/editor-words.js";import{cloneNodeWithFreshIds as G}from"efficient-easel/screen/lib/document/section-doc";import{FOOTER_TYPE as J}from"efficient-easel/draw";function K({node:N,currentSlug:T,siteId:i,tokenRef:h,runAuthed:D,onNotify:I}){const[c,r]=s(!1),[y,x]=s(null),o=q(),[S,u]=s(!1),[d,b]=s(null),P=z(null),[p,j]=s(null),B=L(async()=>{if(o.usesBridgedToken&&!h.current){u(!0);return}try{x(await M(o).pages.list(i?{siteId:i}:void 0))}catch{u(!0)}},[h,i,o]),F=()=>{if(c){r(!1);return}const e=P.current?.getBoundingClientRect();e&&j({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)}),x(null),u(!1),B(),r(!0)},k=(y??[]).filter(e=>e.slug!==T),O=async e=>{if(d)return;b(e.slug);const w=G(N),R=o.documentHooks?.storedNode?.(w)??w,C=M(o).pages,E=await D(async()=>{const m=await C.load({id:e.id});if(!m)throw new Error(`Page "${e.slug}" no longer exists.`);const f=m.layout??{},l=Array.isArray(f.content)?[...f.content]:[],v=l.findIndex(_=>_?.type===J);l.splice(v===-1?l.length:v,0,R),await C.save(e.id,{layout:{root:{},zones:{},...f,content:l}},{version:m.version,clientId:""})});b(null),r(!1),I?.(E?n("Duplicated to “{name}”",{name:e.label}):n("Couldn’t duplicate the section — please retry"),E?"success":"error")};return g(A,{children:[t("span",{"data-menu-toggle":!0,style:{display:"contents"},children:t(W,{buttonRef:P,label:n("Duplicate to another page"),hasPopup:"menu",expanded:c,onClick:F,children:t($,{size:15})})}),c&&p&&t(H,{portal:!0,style:{top:p.top,right:p.right},onClose:()=>r(!1),children:g("div",{role:"menu","aria-label":n("Duplicate to page"),children:[t(a,{children:n("Duplicate to page")}),S?t(a,{children:n("Couldn’t load pages")}):y===null?t(a,{children:n("Loading…")}):k.length===0?t(a,{children:n("No other pages")}):k.map(e=>g(Y,{role:"menuitem",disabled:d!==null,onClick:()=>{O(e)},children:[t("span",{className:"min-w-0 flex-1 truncate",children:e.label}),d===e.slug?t("span",{className:"shrink-0 text-xs",children:n("Copying…")}):e.draft&&t("span",{className:"shrink-0 text-xs",children:n("draft")})]},e.id))]})})]})}export{K as default};
1
+ "use client";import{jsx as t,jsxs as x,Fragment as j}from"react/jsx-runtime";import{useCallback as B,useRef as F,useState as d}from"react";import{InspectorIconButton as O}from"efficient-easel/chrome";import{PopupMenu as R,PopupMenuItem as _,PopupMenuLabel as m}from"efficient-shell/ui";import{CopyToPageIcon as A}from"efficient-easel/icons";import{backendOf as N}from"../lib/website-session.js";import{useEaselSession as L}from"efficient-easel/screen/lib/session-context";import{say as o}from"../../format/lib/editor-words.js";import{cloneNodeWithFreshIds as z}from"efficient-easel/screen/lib/document/section-doc";import{FOOTER_TYPE as W}from"efficient-easel/draw";import{settlingPages as H}from"../lib/editor-document-adapter.js";function Y({node:f,currentSlug:r,siteId:l,tokenRef:a,runAuthed:i,onNotify:c}){const[n,s]=d(!1),[p,b]=d(null),u=L(),[T,g]=d(!1),[h,P]=d(null),k=F(null),[y,v]=d(null),M=B(async()=>{if(u.usesBridgedToken&&!a.current){g(!0);return}try{b(await N(u).pages.list(l?{siteId:l}:void 0))}catch{g(!0)}},[a,l,u]),D=()=>{if(n){s(!1);return}const e=k.current?.getBoundingClientRect();e&&v({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)}),b(null),g(!1),M(),s(!0)},w=(p??[]).filter(e=>e.slug!==r),I=async e=>{if(h)return;P(e.slug);const C=z(f),S=u.documentHooks?.storedNode?.(C)??C,E=await i(()=>$(N(u).pages,e,S));P(null),s(!1),c?.(E?o("Duplicated to “{name}”",{name:e.label}):o("Couldn’t duplicate the section — please retry"),E?"success":"error")};return x(j,{children:[t("span",{"data-menu-toggle":!0,style:{display:"contents"},children:t(O,{buttonRef:k,label:o("Duplicate to another page"),hasPopup:"menu",expanded:n,onClick:D,children:t(A,{size:15})})}),n&&y&&t(R,{portal:!0,style:{top:y.top,right:y.right},onClose:()=>s(!1),children:x("div",{role:"menu","aria-label":o("Duplicate to page"),children:[t(m,{children:o("Duplicate to page")}),T?t(m,{children:o("Couldn’t load pages")}):p===null?t(m,{children:o("Loading…")}):w.length===0?t(m,{children:o("No other pages")}):w.map(e=>x(_,{role:"menuitem",disabled:h!==null,onClick:()=>{I(e)},children:[t("span",{className:"min-w-0 flex-1 truncate",children:e.label}),h===e.slug?t("span",{className:"shrink-0 text-xs",children:o("Copying…")}):e.draft&&t("span",{className:"shrink-0 text-xs",children:o("draft")})]},e.id))]})})]})}async function $(f,r,l){const a=H(f),i=await a.load({id:r.id});if(!i)throw new Error(`Page "${r.slug}" no longer exists.`);const c=i.layout??{},n=Array.isArray(c.content)?[...c.content]:[],s=n.findIndex(p=>p?.type===W);n.splice(s===-1?n.length:s,0,l),await a.save(r.id,{layout:{root:{},zones:{},...c,content:n}},{version:i.version,clientId:""})}export{$ as copyNodeToPage,Y as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{InspectorUpLevel as t}from"efficient-easel/chrome";import{usePreviewHeroPart as l}from"../../render/components/PreviewHeroPartContext.js";import{SiteFields as p}from"./SiteFields.js";import{say as o}from"../../format/lib/editor-words.js";import{HERO_MEDIA_PART_LABELS as c,heroPartId as d}from"../../render/lib/document/hero-media-parts.js";function f({nodeId:i,part:r,sectionName:m,onUpToSection:n}){const{select:s}=l();return a("div",{children:[r!=="media"?e(t,{inline:!0,name:o(c.media),onSelect:()=>s(d(i,"media"))}):e(t,{inline:!0,name:o(m),onSelect:n}),e(p,{part:r})]})}export{f as default};
1
+ "use client";import{jsx as o,jsxs as l}from"react/jsx-runtime";import{InspectorUpLevel as t}from"efficient-easel/chrome";import{usePreviewHeroPart as c}from"../../render/components/PreviewHeroPartContext.js";import{SiteFields as f}from"./SiteFields.js";import{usePartMotion as p}from"./usePartMotion.js";import{say as i}from"../../format/lib/editor-words.js";import{HERO_MEDIA_PART_LABELS as u,heroPartId as P}from"../../render/lib/document/hero-media-parts.js";function d({nodeId:r,part:e,sectionName:m,onUpToSection:n}){const{select:s}=c(),a=p(r,e,"block");return l("div",{children:[e!=="media"?o(t,{inline:!0,name:i(u.media),onSelect:()=>s(P(r,"media"))}):o(t,{inline:!0,name:i(m),onSelect:n}),o(f,{part:e,motion:a})]})}export{d as default};
@@ -1,4 +1,5 @@
1
1
  import { type HoverEffect } from "../../format/lib/theme.js";
2
+ export declare const HOVER_EFFECT_LABELS: Readonly<Record<HoverEffect, string>>;
2
3
  export default function HoverEffectField({ value, onChange, showHint, }: {
3
4
  value: HoverEffect | null;
4
5
  onChange: (v: HoverEffect | null) => void;
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as c,SettingsField as d,SettingsSegmented as h}from"efficient-easel/panel";import{HoverIcon as p}from"efficient-easel/icons";import{say as e,editorEaselWords as u}from"../../format/lib/editor-words.js";import{HOVER_EFFECTS as E,DEFAULT_HOVER_EFFECT as s}from"../../format/lib/theme.js";const o={none:"None",lift:"Lift",highlight:"Highlight"},g="What a card does when a shopper points at it — or taps it, on a phone. Highlight is the effect your cards already use.";function m({value:i,onChange:n,showHint:f=!0}){const r=i===null,a=i??s;return t(d,{label:e("Hover effect"),icon:t(p,{}),value:e(o[a]),changed:!r,action:t(c,{words:u()?.panel,label:e("Hover effect"),changed:!r,detail:e(o[s]),onReset:()=>n(null)}),hint:f?e(g):void 0,children:t(h,{options:E.map(l=>({id:l,label:e(o[l])})),value:a,ariaLabel:e("Hover effect"),onChange:n})})}export{m as default};
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as c,SettingsField as d,SettingsSegmented as E}from"efficient-easel/panel";import{HoverIcon as h}from"efficient-easel/icons";import{say as e,editorEaselWords as p}from"../../format/lib/editor-words.js";import{HOVER_EFFECTS as u,DEFAULT_HOVER_EFFECT as s}from"../../format/lib/theme.js";const o={none:"None",lift:"Lift",highlight:"Highlight"},g="What a card does when a shopper points at it — or taps it, on a phone. Highlight is the effect your cards already use.";function m({value:i,onChange:n,showHint:f=!0}){const r=i===null,a=i??s;return t(d,{label:e("Hover effect"),icon:t(h,{}),value:e(o[a]),changed:!r,action:t(c,{words:p()?.panel,label:e("Hover effect"),changed:!r,detail:e(o[s]),onReset:()=>n(null)}),hint:f?e(g):void 0,children:t(E,{options:u.map(l=>({id:l,label:e(o[l])})),value:a,ariaLabel:e("Hover effect"),onChange:n})})}export{o as HOVER_EFFECT_LABELS,m as default};
@@ -1,3 +1,4 @@
1
+ import { usePreviewDevice } from "efficient-easel/draw/client";
1
2
  import { type MediaValue } from "../../format/lib/media-value.js";
2
3
  interface Props {
3
4
  value: MediaValue;
@@ -10,5 +11,13 @@ interface Props {
10
11
  frameKey?: string;
11
12
  fieldKey?: string;
12
13
  }
14
+ export declare function viewFocusOf(values: Record<string, unknown>, focusKey: string, device: ReturnType<typeof usePreviewDevice>): {
15
+ phone: boolean;
16
+ desktop: string;
17
+ own: string | undefined;
18
+ focus: string;
19
+ key: string;
20
+ twin: string;
21
+ } | null;
13
22
  export default function MediaUploadField({ value, onChange, label, accept, placeholder, focusKey, focusWhen, frameKey, fieldKey }: Props): import("react").JSX.Element;
14
23
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as D,SettingsField as E}from"efficient-easel/panel";import{useSelectedHost as H}from"../lib/document/selected-host.js";import{FOCAL_DEFAULT as I}from"efficient-shell/format";import{ImageIcon as k,PlayIcon as F}from"efficient-easel/icons";import{MediaUploadField as M}from"efficient-shell/ui";import{useContext as y}from"react";import{ScreenDocumentContext as A}from"efficient-easel/screen/components/ScreenDocumentContext";import{editorEaselWords as B,say as c}from"../../format/lib/editor-words.js";import{phoneKey as L}from"efficient-easel/draw";import{PHONE_CLEAR as O}from"../../format/lib/document/phone-override.js";import{usePreviewDevice as R}from"efficient-easel/draw/client";import{requestMediaPick as T}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as V}from"efficient-easel/screen/lib/host";import{mediaValueSrc as _}from"../../format/lib/media-value.js";import{useSelectedPatch as j}from"../lib/document/controls.js";import{backendOf as N}from"../lib/website-session.js";import{useEaselSession as W}from"efficient-easel/screen/lib/session-context";function q(o,d){const e=H(),n=R()==="mobile";if(!o||!e||d&&!d(e.values??{}))return null;const r=typeof e.values?.[o]=="string"&&e.values[o]?String(e.values[o]):I,s=L(o),p=typeof e.values?.[s]=="string"&&e.values[s]?String(e.values[s]):void 0,m=e.onChange;return{phone:n,desktop:r,own:p,focus:n?p??r:r,set:f=>m(n?s:o,f),clear:()=>m(s,O)}}function z({value:o,onChange:d,label:e,accept:n,placeholder:r,focusKey:s,focusWhen:p,frameKey:m,fieldKey:f}){const b=V(),x=W(),v=c(e),a=n.startsWith("video"),i=q(a?void 0:s,p),g=y(A),w=j(),l=m&&f?{video:f,frame:m}:null,C=u=>T(b,{accept:n,title:v,...u?{file:u}:{}}).then(h=>!h||!l?h?.url??null:(w({[l.video]:h.url,[l.frame]:h.posterUrl??""}),null)),P=l?u=>u?d(u):w({[l.video]:"",[l.frame]:""}):d;if(g&&!g.capabilities.mediaEditing)return t(E,{label:v,icon:a?t(F,{}):t(k,{}),children:t("div",{className:"sf-image-slot-inert",children:a?c("Templates don’t store videos — this slot stays a placeholder. Each website picks its own after it’s created."):c("Templates don’t store images — this slot stays a placeholder. Each website picks its own after it’s created.")})});const S=_(o),U=i?.phone&&S?t(D,{words:B()?.panel,label:c("Image focus"),changed:!!i.own,detail:c("{value} on desktop",{value:i.desktop}),onReset:i.clear}):void 0;return t(E,{label:v,icon:a?t(F,{}):t(k,{}),action:U,children:t("div",{style:{flex:"1 1 auto",minWidth:0},children:t(M,{value:S,onChange:P,onPick:C,accept:a?"video/*":"image/*",kind:a?"video":"image",placeholder:r===void 0?void 0:c(r),maxSizeBytes:N(x).media.maxUploadBytes,...i?{focus:i.focus,onFocusChange:i.set}:{}})})})}export{z as default};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{SettingsDefaultReset as D,SettingsField as S}from"efficient-easel/panel";import{useSelectedHost as H}from"efficient-easel/easel";import{FOCAL_DEFAULT as I}from"efficient-shell/format";import{ImageIcon as E,PlayIcon as F}from"efficient-easel/icons";import{MediaUploadField as M}from"efficient-shell/ui";import{useContext as O}from"react";import{ScreenDocumentContext as T}from"efficient-easel/screen/components/ScreenDocumentContext";import{editorEaselWords as A,say as m}from"../../format/lib/editor-words.js";import{phoneKey as B}from"efficient-easel/draw";import{PHONE_CLEAR as L}from"../../format/lib/document/phone-override.js";import{usePreviewDevice as R}from"efficient-easel/draw/client";import{shownTier as b}from"efficient-easel/screen/lib/document/device-fields";import{requestMediaPick as V}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as _}from"efficient-easel/screen/lib/host";import{mediaValueSrc as j}from"../../format/lib/media-value.js";import{useSelectedPatch as N}from"../lib/document/controls.js";import{backendOf as W}from"../lib/website-session.js";import{useEaselSession as q}from"efficient-easel/screen/lib/session-context";function z(t,o,s){if(b(s)==="tablet")return null;const r=b(s)==="mobile",n=typeof t[o]=="string"&&t[o]?String(t[o]):I,e=B(o),a=typeof t[e]=="string"&&t[e]?String(t[e]):void 0;return{phone:r,desktop:n,own:a,focus:r?a??n:n,key:r?e:o,twin:e}}function G(t,o){const s=H(),r=R();if(!t||!s)return null;const n=s.values??{};if(o&&!o(n))return null;const e=z(n,t,r);if(!e)return null;const a=s.onChange;return{phone:e.phone,desktop:e.desktop,own:e.own,focus:e.focus,set:u=>a(e.key,u),clear:()=>a(e.twin,L)}}function J({value:t,onChange:o,label:s,accept:r,placeholder:n,focusKey:e,focusWhen:a,frameKey:u,fieldKey:w}){const x=_(),C=q(),h=m(s),l=r.startsWith("video"),c=G(l?void 0:e,a),g=O(T),k=N(),d=u&&w?{video:w,frame:u}:null,P=p=>V(x,{accept:r,title:h,...p?{file:p}:{}}).then(f=>!f||!d?f?.url??null:(k({[d.video]:f.url,[d.frame]:f.posterUrl??""}),null)),U=d?p=>p?o(p):k({[d.video]:"",[d.frame]:""}):o;if(g&&!g.capabilities.mediaEditing)return i(S,{label:h,icon:l?i(F,{}):i(E,{}),children:i("div",{className:"sf-image-slot-inert",children:l?m("Templates don’t store videos — this slot stays a placeholder. Each website picks its own after it’s created."):m("Templates don’t store images — this slot stays a placeholder. Each website picks its own after it’s created.")})});const v=j(t),y=c?.phone&&v?i(D,{words:A()?.panel,label:m("Image focus"),changed:!!c.own,detail:m("{value} on desktop",{value:c.desktop}),onReset:c.clear}):void 0;return i(S,{label:h,icon:l?i(F,{}):i(E,{}),action:y,children:i("div",{style:{flex:"1 1 auto",minWidth:0},children:i(M,{value:v,onChange:U,onPick:P,accept:l?"video/*":"image/*",kind:l?"video":"image",placeholder:n===void 0?void 0:m(n),maxSizeBytes:W(C).media.maxUploadBytes,...c?{focus:c.focus,onFocusChange:c.set}:{}})})})}export{J as default,z as viewFocusOf};
@@ -27,12 +27,13 @@ export declare function PartStyleSelect({ face, base, onPick, }: {
27
27
  base: PartStyleBase | null;
28
28
  onPick: (role: FontRole | null) => void;
29
29
  }): import("react").JSX.Element;
30
- export declare function PartPanelBody({ sectionName, onBack, textEditor, styleRow, children, }: {
30
+ export declare function PartPanelBody({ sectionName, onBack, textEditor, styleRow, children, tabs, }: {
31
31
  sectionName: string;
32
32
  onBack: () => void;
33
33
  textEditor?: ReactNode;
34
34
  styleRow?: ReactNode;
35
35
  children?: ReactNode;
36
+ tabs?: (body: ReactNode) => ReactNode;
36
37
  }): import("react").JSX.Element;
37
38
  export declare function PartSourceNote({ source, slug, menuId }: {
38
39
  source: PartSource;
@@ -1 +1 @@
1
- "use client";import{jsx as t,Fragment as K,jsxs as h}from"react/jsx-runtime";import{useContext as Je,useEffect as se,useRef as Qe,useState as Ce}from"react";import{FieldSelect as Ze,InspectorField as et,fieldShownInView as tt}from"efficient-easel/fields";import{SettingsField as nt}from"efficient-easel/panel";import{InspectorUpLevel as U}from"efficient-easel/chrome";import{StylesIcon as ot,TypeIcon as lt}from"efficient-easel/icons";import{useEasel as st}from"efficient-easel/easel";import{TextPartPanel as rt}from"efficient-easel/copy";import{Button as it,IconButton as at,Tooltip as ct}from"efficient-shell/ui";import{PartTextBox as dt,partTextCells as ut}from"./PartTextBox.js";import{UiIcon as ke}from"efficient-easel/draw/client";import{usePreviewHeader as ft}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as pt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as mt}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as ht,partStyleToTextStyleValues as yt,pushIntoStyle as gt,resolveTextStyles as St,styleIdOfRole as xt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as bt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as wt}from"../lib/theme-row-persist.js";import{usePreviewDevice as Pt}from"efficient-easel/draw/client";import{shownTier as Oe}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as vt}from"../lib/document/part-panel-rows.js";import{usePartStyle as Tt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as W,textFieldOffPage as Nt,textFieldPanelOnly as Ct}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as kt}from"efficient-easel/draw";import{useSectionOps as Ot}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as Rt,FONT_ROLES as It,FONT_ROLE_LABELS as Re,fontOption as re,fontRoleOf as Et}from"../../format/lib/fonts.js";import{isMultilineKind as Ft,partPlaceholder as _t,typeInPlaceKind as zt}from"../../render/lib/document/part-text.js";import{partRowField as At}from"../lib/document/part-row-field.js";import{decodePartKey as Vt,partPropsWithRowValue as Lt,partRowValue as Bt}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Kt,propsWithPartStyleValue as z,propsWithoutPartStyle as Ut,readPartStyle as Ie}from"../../render/lib/document/part-styles.js";import{partThemeColors as Wt}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Dt}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as jt}from"../lib/document/part-typing.js";import{keysOnCanvas as Gt,useCanvasTypingPart as Ht}from"../lib/document/canvas-typing.js";import{useEaselHost as Mt}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as $t,SOURCE_ACTIONS as Yt,SOURCE_ACTION_LABEL as qt,partSourceNoteFor as Xt,partSourceOf as Jt,sourceMenuIdOf as Qt,sourceSlugOf as Ee}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as Zt,holdsAuthoredText as en}from"../../render/lib/document/text-parts.js";import{regionsForSection as tn}from"../../format/lib/sections/section-text-regions.js";import{textRegionOfPartKey as nn}from"../../format/lib/sections/text-regions.js";function ie(n){return n?l(n):null}function Fe(n){return n.kind==="role"?Re[n.role]:n.kind==="custom"?"Custom":null}function on(n){const o=Et(n.role);return o?{kind:"role",role:o}:null}function ln(n,o){if(!n)return{kind:"unread"};const{faceRole:s,base:i}=n;if(o[s]===i.fontKey)return{kind:"role",role:s};const c=Object.keys(o).filter(r=>o[r]===i.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function ae(n,o,s,i){return on(Ie(n,o))??ln(s,i)}function sn(n,o){if(!n.length)return null;const s=o(n[0]);return n.every(i=>o(i)===s)?s:null}const D="";function rn({face:n,base:o,onPick:s}){const i=n.kind==="role"?n.role:D,c=[{label:l("No style"),value:D},...It.map(r=>({label:l(Re[r]),value:r}))];return t(Ze,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:r=>s(r===D?null:r),renderOption:r=>r.value===D?h(K,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:r.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${r.value})`},children:r.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${re(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:ie(Fe(n))}),valueText:r=>ie(Fe(n))??r?.label??""})}function an({sectionName:n,onBack:o,textEditor:s,styleRow:i,children:c}){return h("div",{className:"sf-part-panel",children:[t(U,{inline:!0,name:l(n),onSelect:o}),s,i,c]})}function _e({source:n,slug:o,menuId:s}){const i=Mt(),c=Yt[n],r=!c.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[l($t[n]),r?h(K,{children:[" ",t(it,{type:"button",variant:"link",size:"sm",onClick:()=>{c.type==="storefront-editor:open-menus"?i.send(c.type,{menuId:s??null}):o&&i.send(c.type,{slug:o})},children:l(qt)})]}):null]})})}const ze=4,cn=120;function dn({region:n,sizePx:o,face:s,base:i,onFollowStyle:c,source:r,slug:j,onBack:N,shows:C}){const v=n.follows;return h("div",{className:"sf-note",children:[C("regionNote")&&h(K,{children:[t("p",{children:t("strong",{children:l(n.label)})}),t("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(v),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(v)})})]}),c?C("regionStyle")?t(K,{children:t(nt,{label:l("Style"),icon:t(ot,{}),hint:l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(n.label).toLowerCase()}),children:t(rn,{face:s,base:i,onPick:c})})}):null:C("regionNote")&&t("p",{className:"es-field-hint sf-hint-keep",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),r&&C("sourceNote")?t(_e,{source:r,slug:j}):null,t(U,{inline:!0,name:l("Page"),onSelect:N})]})}function un({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part is no longer here.")})}),t("p",{children:l("The section it belonged to has been changed or removed.")}),t(U,{inline:!0,name:l("Page"),onSelect:n})]})}function fn({onBack:n,partId:o,why:s}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part's settings did not open.")})}),t("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),t("p",{className:"sf-note-detail",children:h("code",{children:[o," — ",s]})}),t(U,{inline:!0,name:l("Page"),onSelect:n})]})}function pn({nodeId:n,propKey:o,onBack:s,onEditStyle:i}){const{getItemById:c,getSelectorForId:r,config:j}=st(e=>e),N=Ot(),C=Ht(),{partStyle:v}=Tt(),{fonts:G,textStyles:Ae}=ft(),H=Je(mt),ce=!H?.capabilities?.hasSiteTheme,{persist:Ve}=wt({themeFromDocument:ce,tokenRef:H?.tokenRef,siteId:H?.siteId??null}),_=bt({themeFromDocument:ce,persist:Ve}),[Le,M]=Ce(!1),$=Pt(),y=e=>tt(vt[e],$),de=Qe(null),d=c(n),m=r(n),ue=d?j.components[d.type]:void 0,{key:x,row:b}=Vt(o),fe=ue?.fields?.[x],g=b?At(fe,b):fe,k=Zt(n,o),p=d?.props??{},w=zt(g),pe=Nt(g),me=en(g),Be=d?Jt(d.type):null,he=d?Xt(d.type,x):null,Y=b?Bt(p[x],b):p[x],ye=!!b&&!(Array.isArray(p[x])&&b.index<p[x].length);se(()=>{if(Gt(document))return;de.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[k]);const[q,ge]=Ce(0);se(()=>ge(0),[k]);const X=!!d&&!ye&&(!m||!g);se(()=>{if(!X||q>=ze)return;const e=setTimeout(()=>ge(a=>a+1),cn);return()=>clearTimeout(e)},[X,q]);const Ke=X&&q<ze;if(!d||ye)return t(un,{onBack:s});const A=tn(d.type),Se=A?nn(A,o):null;if(A&&Se){const e=v?.partId===k?v:null,a=A[Se],f=a.writable===!0&&!!m,P=le=>{m&&N.replaceComponent(m.zone,m.index,{...d,props:z(p,o,"role",le)})};return t(dn,{region:a,sizePx:e?.base.sizePx??null,face:ae(p,o,e,G),base:e?.base??null,onFollowStyle:f?P:void 0,source:Be,slug:Ee(p),onBack:s,shows:y})}if(!m||!g)return Ke?t("div",{className:"sf-note","aria-busy":"true"}):t(fn,{onBack:s,partId:k,why:m?"no field":"no selector"});const xe=e=>{N.replaceComponent(m.zone,m.index,{...d,props:e})},J=e=>{if(W(e).hidden!==W(Y).hidden||!w){const f=b?Lt(p,x,b,e):{...p,[x]:e};f&&xe(f);return}jt({node:d,propKey:o,kind:w,zone:m.zone,index:m.index},W(e).text,N.replaceComponent)},Ue=Y,O=v?.partId===k?v:null,R=O?.styleOwner,V=R?c(R.owner):null,Q=R&&V?r(R.owner):null,Z=!!(R&&V&&Q),I=Z?V.props??{}:p,ee=Z?e=>N.replaceComponent(Q.zone,Q.index,{...V,props:e}):xe,L=Z?R.kind:Dt(d?.type,o),S=Ie(I,L),u=[{partKey:L,face:ae(I,L,O,G),sizeGroup:O?.sizeGroup??null,base:O?.base??hn,style:S}],We=sn(u,e=>e.sizeGroup),De=Wt(O?.inks),E=(e,a)=>{let f=I;for(const P of u)f=z(f,P.partKey,e,a);ee(f)},je=e=>e?E("textStyle",e):te({textStyle:null,role:null}),te=e=>{let a=I;for(const f of u)for(const[P,le]of Object.entries(e))a=z(a,f.partKey,P,le??null);ee(a)},ne=w==="text"||w==="textarea",{text:be,hidden:F}=W(Y),B=g?.[kt]?.label??o,we=F?l("Show {label} on the slide",{label:l(B)}):l("Hide {label} on the slide",{label:l(B)}),Pe=h("div",{className:"sf-field-head",children:[t(lt,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:l(B)}),ne&&t(ct,{content:we,children:t(at,{"aria-pressed":F,"aria-label":we,onClick:()=>J({text:be,hidden:!F}),children:F?t(ke,{name:"eye-off",size:14}):t(ke,{name:"eye",size:14})})})]}),ve=!pe&&me,Ge=!!w&&(Ct(g)||pe||F||!me),Te=ae(I,L,O,G),He=Te.kind==="role"?Te.role:null,oe=Kt(S)??xt(He),Ne=St(_.saved,_.old),Me=Object.entries(S).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,$e=()=>{let e=I;for(const a of u){const{role:f,textStyle:P}=a.style;e=Ut(e,a.partKey),f&&(e=z(e,a.partKey,"role",f)),P&&(e=z(e,a.partKey,"textStyle",P))}ee(e)},T=oe,Ye=ht(u[0].style),qe=T?Ne.find(e=>e.id===T)?.name??T:"",Xe=()=>{M(!1),T&&(_.write(gt({saved:_.saved,old:_.old,styleId:T,values:yt(u[0].style)}),!0),$e())};return h(an,{sectionName:ue?.label??d.type,onBack:s,textEditor:y("words")?t("div",{ref:de,className:"sf-part-text",children:Ge?t(dt,{text:be,onTextChange:e=>J(ne?{text:e,hidden:F}:e),multiline:Ft(w),markup:w!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:te,colors:De,placeholder:ie(_t(g))??void 0,ariaLabel:l(B),head:Pe,typedOnCanvas:C===k}):w?ne?Pe:null:t(et,{field:g,name:o,value:Ue,onChange:J,id:`sf-part-${n}-${o}`})}):void 0,children:[he&&y("sourceNote")&&t(_e,{source:he,slug:Ee(p),menuId:Qt(p)}),ve&&t(rt,{style:y("style")?{value:oe??"",options:[{value:"",label:l("No style"),description:l("Section’s own")},...Ne.map(e=>({value:e.id,label:e.name,description:e.values.font?re(e.values.font)?.label:void 0}))],onChange:e=>je(e||null),changed:Me>0,onEditStyles:i,onUpdateStyle:T&&Ye?()=>M(!0):void 0}:void 0,font:y("font")?{value:S.font??"",styleValue:re(u[0].base.fontKey)?.label,options:Rt.map(e=>({label:e.label,value:e.key})),onChange:e=>E("font",e||null)}:void 0,italic:y("italic")?{value:S.italic,styleValue:mn(Ae,oe),onChange:e=>E("italic",e??null)}:void 0,cells:ut(u[0].style,u[0].base,te,Oe($)).filter(e=>y(e.key)),align:y("align")?Oe($)==="mobile"?{value:S.alignPhone??"",styleValue:S.align??u[0].base.align,onChange:e=>E("alignPhone",e||null)}:{value:S.align??"",styleValue:u[0].base.align,onChange:e=>E("align",e||null)}:void 0,letterCase:y("letterCase")?{value:S.case??"",styleValue:u[0].base.case,onChange:e=>E("case",e||null)}:void 0}),Le&&T&&t(pt,{styleName:qe,onCancel:()=>M(!1),onConfirm:Xe}),ve&&We===null&&y("fixedSizeHint")&&t("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function mn(n,o){return!o||!Array.isArray(n)?!1:n.find(i=>i?.id===o)?.values?.italic===!0}const hn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{an as PartPanelBody,_e as PartSourceNote,rn as PartStyleSelect,pn as default,ae as partFace};
1
+ "use client";import{jsx as n,Fragment as A,jsxs as m}from"react/jsx-runtime";import{useContext as lt,useEffect as ie,useRef as st,useState as Ce}from"react";import{FieldSelect as rt,InspectorField as it,fieldShownInView as at}from"efficient-easel/fields";import{SettingsField as ct}from"efficient-easel/panel";import{InspectorUpLevel as G}from"efficient-easel/chrome";import{StylesIcon as dt,TypeIcon as ut}from"efficient-easel/icons";import{useEasel as ft}from"efficient-easel/easel";import{TextPartPanel as pt}from"efficient-easel/copy";import{Button as mt,IconButton as ht,Tooltip as yt}from"efficient-shell/ui";import{PartTextBox as St,partTextCells as gt}from"./PartTextBox.js";import{SiteFields as Ee}from"./SiteFields.js";import{usePartMotion as xt}from"./usePartMotion.js";import{UiIcon as Ie}from"efficient-easel/draw/client";import{usePreviewHeader as bt}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as Pt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as vt}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as wt,partStyleToTextStyleValues as Tt,pushIntoStyle as Nt,resolveTextStyles as Ot,styleIdOfRole as Rt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as kt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as Ct}from"../lib/theme-row-persist.js";import{usePreviewDevice as Et}from"efficient-easel/draw/client";import{shownTier as ae}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as Fe}from"../lib/document/part-panel-rows.js";import{usePartStyle as It}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as H,textFieldOffPage as Ft,textFieldPanelOnly as _t}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as zt}from"efficient-easel/draw";import{useSectionOps as Vt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as At,FONT_ROLES as Lt,FONT_ROLE_LABELS as _e,fontOption as ce,fontRoleOf as Bt}from"../../format/lib/fonts.js";import{isMultilineKind as Kt,partPlaceholder as Ut,typeInPlaceKind as Wt}from"../../render/lib/document/part-text.js";import{partRowField as Dt}from"../lib/document/part-row-field.js";import{decodePartKey as jt,partPropsWithRowValue as Gt,partRowValue as Ht}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Mt,propsWithPartStyleValue as L,propsWithoutPartStyle as $t,readPartStyle as ze}from"../../render/lib/document/part-styles.js";import{partThemeColors as Xt}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Ve}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as Yt}from"../lib/document/part-typing.js";import{keysOnCanvas as qt,useCanvasTypingPart as Jt}from"../lib/document/canvas-typing.js";import{useEaselHost as Qt}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as Zt,SOURCE_ACTIONS as en,SOURCE_ACTION_LABEL as tn,partSourceNoteFor as nn,partSourceOf as on,sourceMenuIdOf as ln,sourceSlugOf as Ae}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as sn,holdsAuthoredText as rn}from"../../render/lib/document/text-parts.js";import{regionsForSection as an}from"../../format/lib/sections/section-text-regions.js";import{textRegionOfPartKey as cn}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as Le}from"./SameInEveryViewNote.js";function de(t){return t?l(t):null}function Be(t){return t.kind==="role"?_e[t.role]:t.kind==="custom"?"Custom":null}function dn(t){const o=Bt(t.role);return o?{kind:"role",role:o}:null}function un(t,o){if(!t)return{kind:"unread"};const{faceRole:r,base:i}=t;if(o[r]===i.fontKey)return{kind:"role",role:r};const c=Object.keys(o).filter(s=>o[s]===i.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function ue(t,o,r,i){return dn(ze(t,o))??un(r,i)}function fn(t,o){if(!t.length)return null;const r=o(t[0]);return t.every(i=>o(i)===r)?r:null}const M="";function pn({face:t,base:o,onPick:r}){const i=t.kind==="role"?t.role:M,c=[{label:l("No style"),value:M},...Lt.map(s=>({label:l(_e[s]),value:s}))];return n(rt,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:s=>r(s===M?null:s),renderOption:s=>s.value===M?m(A,{children:[n("span",{className:"es-fsel-label sf-part-style-keep",children:s.label}),n("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):n("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${s.value})`},children:s.label}),renderValue:()=>n("span",{style:{fontFamily:o?.fontKey?`var(${ce(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:de(Be(t))}),valueText:s=>de(Be(t))??s?.label??""})}const Ke=["regionNote","regionStyle"],mn=Object.keys(Fe).filter(t=>!Ke.includes(t));function Ue(t,o){return!t.some(o)}function hn({sectionName:t,onBack:o,textEditor:r,styleRow:i,children:c,tabs:s}){const O=m(A,{children:[r,i,c]});return m("div",{className:"sf-part-panel",children:[n(G,{inline:!0,name:l(t),onSelect:o}),s?s(O):O]})}function We({source:t,slug:o,menuId:r}){const i=Qt(),c=en[t],s=!c.needsSlug||!!o;return n("div",{className:"sf-note sf-note--source",children:m("p",{className:"es-field-hint sf-hint-keep",children:[l(Zt[t]),s?m(A,{children:[" ",n(mt,{type:"button",variant:"link",size:"sm",onClick:()=>{c.type==="storefront-editor:open-menus"?i.send(c.type,{menuId:r??null}):o&&i.send(c.type,{slug:o})},children:l(tn)})]}):null]})})}const De=4,yn=120;function Sn({region:t,sizePx:o,face:r,base:i,onFollowStyle:c,source:s,slug:O,onBack:R,shows:w}){const T=t.follows;return m("div",{className:"sf-note",children:[w("regionNote")&&m(A,{children:[n("p",{children:n("strong",{children:l(t.label)})}),n("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(T),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(T)})})]}),c?w("regionStyle")?n(A,{children:n(ct,{label:l("Style"),icon:n(dt,{}),hint:l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(t.label).toLowerCase()}),children:n(pn,{face:r,base:i,onPick:c})})}):null:w("regionNote")&&n("p",{className:"es-field-hint sf-hint-keep",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),s&&w("sourceNote")?n(We,{source:s,slug:O}):null,Ue([...Ke,"sourceNote"],k=>w(k)&&(k!=="sourceNote"||!!s))&&n(Le,{}),n(G,{inline:!0,name:l("Page"),onSelect:R})]})}function gn({onBack:t}){return m("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l("This part is no longer here.")})}),n("p",{children:l("The section it belonged to has been changed or removed.")}),n(G,{inline:!0,name:l("Page"),onSelect:t})]})}function xn({onBack:t,partId:o,why:r}){return m("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l("This part's settings did not open.")})}),n("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),n("p",{className:"sf-note-detail",children:m("code",{children:[o," — ",r]})}),n(G,{inline:!0,name:l("Page"),onSelect:t})]})}function bn({nodeId:t,propKey:o,onBack:r,onEditStyle:i}){const{getItemById:c,getSelectorForId:s,config:O}=ft(e=>e),R=Vt(),w=Jt(),{partStyle:T}=It(),{fonts:k,textStyles:je}=bt(),$=lt(vt),fe=!$?.capabilities?.hasSiteTheme,{persist:Ge}=Ct({themeFromDocument:fe,tokenRef:$?.tokenRef,siteId:$?.siteId??null}),V=kt({themeFromDocument:fe,persist:Ge}),[He,X]=Ce(!1),B=Et(),h=e=>ae(B)!=="tablet"&&at(Fe[e],B),pe=st(null),d=c(t),y=s(t),me=d?O.components[d.type]:void 0,{key:x,row:b}=jt(o),he=me?.fields?.[x],S=b?Dt(he,b):he,C=sn(t,o),p=d?.props??{},P=Wt(S),ye=Ft(S),Se=rn(S),Me=d?on(d.type):null,Y=d?nn(d.type,x):null,q=b?Ht(p[x],b):p[x],ge=!!b&&!(Array.isArray(p[x])&&b.index<p[x].length);ie(()=>{if(qt(document))return;pe.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[C]);const[J,xe]=Ce(0);ie(()=>xe(0),[C]);const Q=!!d&&!ge&&(!y||!S);ie(()=>{if(!Q||J>=De)return;const e=setTimeout(()=>xe(a=>a+1),yn);return()=>clearTimeout(e)},[Q,J]);const $e=Q&&J<De,be=xt(t,Ve(d?.type,o),"textPart");if(!d||ge)return n(gn,{onBack:r});const K=an(d.type),Pe=K?cn(K,o):null;if(K&&Pe){const e=T?.partId===C?T:null,a=K[Pe],f=a.writable===!0&&!!y,v=re=>{y&&R.replaceComponent(y.zone,y.index,{...d,props:L(p,o,"role",re)})};return n(Ee,{motion:be,body:n(Sn,{region:a,sizePx:e?.base.sizePx??null,face:ue(p,o,e,k),base:e?.base??null,onFollowStyle:f?v:void 0,source:Me,slug:Ae(p),onBack:r,shows:h})})}if(!y||!S)return $e?n("div",{className:"sf-note","aria-busy":"true"}):n(xn,{onBack:r,partId:C,why:y?"no field":"no selector"});const ve=e=>{R.replaceComponent(y.zone,y.index,{...d,props:e})},Z=e=>{if(H(e).hidden!==H(q).hidden||!P){const f=b?Gt(p,x,b,e):{...p,[x]:e};f&&ve(f);return}Yt({node:d,propKey:o,kind:P,zone:y.zone,index:y.index},H(e).text,R.replaceComponent)},Xe=q,E=T?.partId===C?T:null,I=E?.styleOwner,U=I?c(I.owner):null,ee=I&&U?s(I.owner):null,te=!!(I&&U&&ee),F=te?U.props??{}:p,ne=te?e=>R.replaceComponent(ee.zone,ee.index,{...U,props:e}):ve,W=te?I.kind:Ve(d?.type,o),g=ze(F,W),u=[{partKey:W,face:ue(F,W,E,k),sizeGroup:E?.sizeGroup??null,base:E?.base??vn,style:g}],we=fn(u,e=>e.sizeGroup),Ye=Xt(E?.inks),_=(e,a)=>{let f=F;for(const v of u)f=L(f,v.partKey,e,a);ne(f)},qe=e=>e?_("textStyle",e):oe({textStyle:null,role:null}),oe=e=>{let a=F;for(const f of u)for(const[v,re]of Object.entries(e))a=L(a,f.partKey,v,re??null);ne(a)},le=P==="text"||P==="textarea",{text:Te,hidden:z}=H(q),D=S?.[zt]?.label??o,Ne=z?l("Show {label} on the slide",{label:l(D)}):l("Hide {label} on the slide",{label:l(D)}),Oe=m("div",{className:"sf-field-head",children:[n(ut,{}),n("span",{className:"sf-field-label sf-field-label--inline",children:l(D)}),le&&n(yt,{content:Ne,children:n(ht,{"aria-pressed":z,"aria-label":Ne,onClick:()=>Z({text:Te,hidden:!z}),children:z?n(Ie,{name:"eye-off",size:14}):n(Ie,{name:"eye",size:14})})})]}),j=!ye&&Se,Je=!!P&&(_t(S)||ye||z||!Se),Re=ue(F,W,E,k),Qe=Re.kind==="role"?Re.role:null,se=Mt(g)??Rt(Qe),ke=Ot(V.saved,V.old),Ze=Object.entries(g).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,et=()=>{let e=F;for(const a of u){const{role:f,textStyle:v}=a.style;e=$t(e,a.partKey),f&&(e=L(e,a.partKey,"role",f)),v&&(e=L(e,a.partKey,"textStyle",v))}ne(e)},N=se,tt=wt(u[0].style),nt=N?ke.find(e=>e.id===N)?.name??N:"",ot=()=>{X(!1),N&&(V.write(Nt({saved:V.saved,old:V.old,styleId:N,values:Tt(u[0].style)}),!0),et())};return m(hn,{sectionName:me?.label??d.type,onBack:r,tabs:e=>n(Ee,{motion:be,body:e}),textEditor:h("words")?n("div",{ref:pe,className:"sf-part-text",children:Je?n(St,{text:Te,onTextChange:e=>Z(le?{text:e,hidden:z}:e),multiline:Kt(P),markup:P!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:oe,colors:Ye,placeholder:de(Ut(S))??void 0,ariaLabel:l(D),head:Oe,typedOnCanvas:w===C}):P?le?Oe:null:n(it,{field:S,name:o,value:Xe,onChange:Z,id:`sf-part-${t}-${o}`})}):void 0,children:[Y&&h("sourceNote")&&n(We,{source:Y,slug:Ae(p),menuId:ln(p)}),j&&n(pt,{style:h("style")?{value:se??"",options:[{value:"",label:l("No style"),description:l("Section’s own")},...ke.map(e=>({value:e.id,label:e.name,description:e.values.font?ce(e.values.font)?.label:void 0}))],onChange:e=>qe(e||null),changed:Ze>0,onEditStyles:i,onUpdateStyle:N&&tt?()=>X(!0):void 0}:void 0,font:h("font")?{value:g.font??"",styleValue:ce(u[0].base.fontKey)?.label,options:At.map(e=>({label:e.label,value:e.key})),onChange:e=>_("font",e||null)}:void 0,italic:h("italic")?{value:g.italic,styleValue:Pn(je,se),onChange:e=>_("italic",e??null)}:void 0,cells:gt(u[0].style,u[0].base,oe,ae(B)).filter(e=>h(e.key)),align:h("align")?ae(B)==="mobile"?{value:g.alignPhone??"",styleValue:g.align??u[0].base.align,onChange:e=>_("alignPhone",e||null)}:{value:g.align??"",styleValue:u[0].base.align,onChange:e=>_("align",e||null)}:void 0,letterCase:h("letterCase")?{value:g.case??"",styleValue:u[0].base.case,onChange:e=>_("case",e||null)}:void 0}),He&&N&&n(Pt,{styleName:nt,onCancel:()=>X(!1),onConfirm:ot}),j&&we===null&&h("fixedSizeHint")&&n("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),Ue(mn,e=>h(e)&&(e==="words"||(e==="sourceNote"?!!Y:e==="fixedSizeHint"?j&&we===null:j)))&&n(Le,{})]})}function Pn(t,o){return!o||!Array.isArray(t)?!1:t.find(i=>i?.id===o)?.values?.italic===!0}const vn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{hn as PartPanelBody,We as PartSourceNote,pn as PartStyleSelect,bn as default,ue as partFace};
@@ -3,14 +3,16 @@ import { type PartNeedle } from "../../render/lib/document/text-parts.js";
3
3
  import { type PartStyleBase, type PartStyles } from "../../render/lib/document/part-styles.js";
4
4
  import { type FontRole } from "../../format/lib/fonts.js";
5
5
  import { type TypeGroup } from "../../format/lib/theme.js";
6
+ import { type PartMotion } from "../../render/lib/animation/part-motion.js";
6
7
  export declare function styleTagsOf(element: HTMLElement): {
7
8
  faceRole: FontRole;
8
9
  sizeGroup: TypeGroup | null;
9
10
  };
10
11
  export declare function measureStyleBase(element: HTMLElement): PartStyleBase;
11
- export default function PreviewPartAnchors({ needles, styles, type, children, }: {
12
+ export default function PreviewPartAnchors({ needles, styles, motions, type, children, }: {
12
13
  needles: PartNeedle[];
13
14
  styles: PartStyles;
15
+ motions?: Readonly<Record<string, PartMotion>>;
14
16
  type?: string;
15
17
  children: ReactNode;
16
18
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as k}from"react/jsx-runtime";import{readInks as L}from"../../format/lib/document/part-inks.js";import{useEffect as W,useRef as B}from"react";import{markOverlayPortal as F}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as J}from"efficient-easel/draw/client";import{usePartStyle as z}from"./PreviewPartStyleContext.js";import{usePreviewDevice as Y}from"efficient-easel/draw/client";import{encodePartId as $}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as j}from"efficient-easel/canvas";import{engagePartAnchors as G}from"../lib/document/part-anchors.js";import{PART_ATTR as R,PART_STYLE_KIND_ATTR as w,PART_STYLE_OWNER_ATTR as H,partStyleOwnerOf as E}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as v,applyPartStyles as _,blockDrawsTextStyle as M,partFontKeyOf as q,partStyleBase as U,partStyleSource as V}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as Q,styleRoleOfClassName as X}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as x}from"../../format/lib/theme.js";import{styleKeyForPart as Z}from"../../format/lib/sections/section-text-kinds.js";function ee(i){let o=null,s=null;for(let t=i;t&&(o===null||s===null);t=t.parentElement){const a=t.getAttribute("class");o??=X(a),s??=x(a)}return{faceRole:o??"body",sizeGroup:s}}function N(i){const o=i.style,s={};for(const r of v)s[r]=o[r]??"",o[r]="";const t=getComputedStyle(i),a=getComputedStyle(i.ownerDocument.documentElement),p=U({fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,textAlign:t.textAlign,textTransform:t.textTransform,paddingTop:t.paddingTop},q(t.fontFamily,r=>a.getPropertyValue(r)));for(const r of v)o[r]=s[r];return p}function te({needles:i,styles:o,type:s,children:t}){const a=B(null),{selectedPartId:p}=J(),{setPartStyle:r}=z(),d=Y()==="mobile",y=JSON.stringify(i),S=JSON.stringify(o);return W(()=>{const f=a.current;if(!f)return;const g=[],T=()=>f.parentElement,C=l=>{const n=T();if(!n)return null;const m=new MutationObserver(l);return m.observe(n,{attributes:!0,attributeFilter:[j]}),()=>m.disconnect()},I=l=>{const n=new MutationObserver(l);return n.observe(f,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()};let u=[];g.push(()=>{for(const l of u)l();u=[]});const D=JSON.parse(y),h=JSON.parse(S),K=G(f,D,T,C,(l,n,m)=>{for(const e of u)e();u=[];const P=[];for(const e of m){const c=e,A=F(c);A&&u.push(A),c.getAttribute(R)===p&&P.push(c)}const b=V(n,p,P,e=>Q(e)!==null||x(e)!==null);if(b&&p){const e=b;r({partId:p,...ee(e),base:N(e),inks:L(e),...(()=>{const c=E(e);return c?{styleOwner:c}:{}})()})}_(m.filter(e=>!E(e)).map(e=>({element:e,partId:e.getAttribute(R)??""})),h,e=>N(e),e=>Z(s,e),void 0,d,e=>M(s,e));const O=[...f.querySelectorAll(`[${H}="${CSS.escape(n)}"][${w}]`)];O.length&&_(O.map(e=>({element:e,partId:$(n,e.getAttribute(w)??"")})),h,void 0,e=>e,void 0,d)},I);return()=>{K();for(const l of g)l()}},[y,S,p,r,d]),k("div",{ref:a,"data-sf-part-host":"",style:{display:"contents"},children:t})}export{te as default,N as measureStyleBase,ee as styleTagsOf};
1
+ "use client";import{jsx as F}from"react/jsx-runtime";import{readInks as z}from"../../format/lib/document/part-inks.js";import{useEffect as Y,useRef as _}from"react";import{markOverlayPortal as $}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as j}from"efficient-easel/draw/client";import{usePartStyle as G}from"./PreviewPartStyleContext.js";import{usePreviewDevice as H}from"efficient-easel/draw/client";import{decodePartId as q,encodePartId as U}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as V}from"efficient-easel/canvas";import{engagePartAnchors as Q}from"../lib/document/part-anchors.js";import{PART_ATTR as g,PART_STYLE_KIND_ATTR as T,PART_STYLE_OWNER_ATTR as X,partStyleOwnerOf as O}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as K,applyPartStyles as x,blockDrawsTextStyle as Z,partFontKeyOf as tt,partStyleBase as et,partStyleSource as rt}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as ot,styleRoleOfClassName as nt}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as I}from"../../format/lib/theme.js";import{styleKeyForPart as C}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as st}from"../../render/lib/animation/part-motion.js";import{paintPartMotion as it}from"../lib/document/part-motion-canvas.js";function at(l){let o=null,i=null;for(let e=l;e&&(o===null||i===null);e=e.parentElement){const p=e.getAttribute("class");o??=nt(p),i??=I(p)}return{faceRole:o??"body",sizeGroup:i}}function D(l){const o=l.style,i={};for(const r of K)i[r]=o[r]??"",o[r]="";const e=getComputedStyle(l),p=getComputedStyle(l.ownerDocument.documentElement),m=et({fontSize:e.fontSize,fontWeight:e.fontWeight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,textAlign:e.textAlign,textTransform:e.textTransform,paddingTop:e.paddingTop},tt(e.fontFamily,r=>p.getPropertyValue(r)));for(const r of K)o[r]=i[r];return m}function lt({needles:l,styles:o,motions:i=st,type:e,children:p}){const m=_(null),{selectedPartId:r}=j(),{setPartStyle:h}=G(),d=H()==="mobile",P=JSON.stringify(l),b=JSON.stringify(o),A=JSON.stringify(i),J=_(new Map);return Y(()=>{const u=m.current;if(!u)return;const R=[],w=()=>u.parentElement,M=a=>{const n=w();if(!n)return null;const f=new MutationObserver(a);return f.observe(n,{attributes:!0,attributeFilter:[V]}),()=>f.disconnect()},k=a=>{const n=new MutationObserver(a);return n.observe(u,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()};let c=[];R.push(()=>{for(const a of c)a();c=[]});const L=JSON.parse(P),E=JSON.parse(b),W=JSON.parse(A),B=Q(u,L,w,M,(a,n,f)=>{for(const t of c)t();c=[];const N=[];for(const t of f){const s=t,y=$(s);y&&c.push(y),s.getAttribute(g)===r&&N.push(s)}const v=rt(n,r,N,t=>ot(t)!==null||I(t)!==null);if(v&&r){const t=v;h({partId:r,...at(t),base:D(t),inks:z(t),...(()=>{const s=O(t);return s?{styleOwner:s}:{}})()})}x(f.filter(t=>!O(t)).map(t=>({element:t,partId:t.getAttribute(g)??""})),E,t=>D(t),t=>C(e,t),void 0,d,t=>Z(e,t));const S=[...u.querySelectorAll(`[${X}="${CSS.escape(n)}"][${T}]`)];S.length&&x(S.map(t=>({element:t,partId:U(n,t.getAttribute(T)??"")})),E,void 0,t=>t,void 0,d),c.push(it([...f.filter(t=>!O(t)).map(t=>{const s=t,y=q(s.getAttribute(g)??"")?.propKey??"";return{element:s,partKey:C(e,y)}}),...S.map(t=>({element:t,partKey:t.getAttribute(T)??""}))],t=>W[t],d,J.current))},k);return()=>{B();for(const a of R)a()}},[P,b,A,r,h,d,e]),F("div",{ref:m,"data-sf-part-host":"",style:{display:"contents"},children:p})}export{lt as default,D as measureStyleBase,at as styleTagsOf};
@@ -0,0 +1 @@
1
+ export declare function SameInEveryViewNote(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{EmptyState as t}from"efficient-shell/ui";import{say as o}from"../../format/lib/editor-words.js";function n(){return e(t,{variant:"none",icon:!1,message:o("These settings apply to every view.")})}export{n as SameInEveryViewNote};
@@ -0,0 +1,5 @@
1
+ export declare function SaveAsTemplateButton({ enabled, reason, onSaved }: {
2
+ enabled: boolean;
3
+ reason: string;
4
+ onSaved: () => void;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{useState as p}from"react";import{Button as u,Tooltip as d,toast as r}from"efficient-shell/ui";import{TemplateIcon as v}from"efficient-easel/icons";import{useSettledAction as h}from"efficient-easel/easel";import{useScreenDocument as y}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as t}from"../../format/lib/editor-words.js";function I({enabled:s,reason:c,onSaved:m}){const{flushSave:l}=y(),[a,n]=p(!1),f=async()=>{if(!a){n(!0);try{await l()?m():r.error(t(i))}catch{r.error(t(i))}finally{n(!1)}}},o=h({onPress:()=>{f()},busy:a});return e(d,{side:"bottom",content:s?t("Save this website as a platform template"):t(c),children:e("span",{className:"sf-tip-disabled",tabIndex:s?void 0:0,children:e(u,{variant:"secondary",disabled:!s||o.busy,loading:o.busy,onClick:o.onPress,rightIcon:e(v,{size:15}),children:t("Save as Template")})})})}const i="Your last changes did not save, so the template was not made. Try again.";export{I as SaveAsTemplateButton};
@@ -1,7 +1,37 @@
1
+ import { type SiteRowView } from "../../format/lib/site-twin-row.js";
1
2
  export declare const SIDE_SPACE_LABEL = "Side space";
2
3
  export declare const SIDE_SPACE_HINT = "The room left at the left and right edge of every page.";
3
- export default function SideSpaceField({ value, onChange, showHint, }: {
4
+ export declare function sideSpaceRow(device: SiteRowView, site: {
5
+ gutter: number | null;
6
+ phone: number | null;
7
+ }): {
8
+ key: "site_gutter";
9
+ value: number | null;
10
+ unsetPx: 40;
11
+ bounds: {
12
+ readonly min: 0;
13
+ readonly max: 80;
14
+ readonly step: 4;
15
+ readonly default: 40;
16
+ };
17
+ } | {
18
+ key: "site_gutter_phone";
19
+ value: number | null;
20
+ unsetPx: number;
21
+ bounds: {
22
+ readonly min: 0;
23
+ readonly max: 24;
24
+ readonly step: 4;
25
+ };
26
+ } | null;
27
+ export default function SideSpaceField({ value, onChange, showHint, unsetPx, bounds, }: {
4
28
  value: number | null;
5
29
  onChange: (v: number | null) => void;
6
30
  showHint?: boolean;
31
+ unsetPx?: number;
32
+ bounds?: {
33
+ readonly min: number;
34
+ readonly max: number;
35
+ readonly step: number;
36
+ };
7
37
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import{SettingsDefaultReset as d,SettingsField as p}from"efficient-easel/panel";import{PaddingXIcon as m}from"efficient-easel/icons";import{SITE_GUTTER as t}from"../../format/lib/content/page-width.js";import{say as o,editorEaselWords as f}from"../../format/lib/editor-words.js";import{Slider as c}from"../lib/document/controls.js";const i="Side space",n=t.default,u="The room left at the left and right edge of every page.";function S({value:a,onChange:r,showHint:s=!0}){const l=a===null;return e(p,{label:o(i),labelId:"sf-side-space",icon:e(m,{}),value:`${a??n}px`,changed:!l,action:e(d,{words:f()?.panel,label:o(i),changed:!l,detail:`${n}px`,onReset:()=>r(null)}),hint:s?o(u):void 0,children:e(c,{min:t.min,max:t.max,step:t.step,value:a??n,readout:!1,ariaLabel:o(i),onChange:r})})}export{u as SIDE_SPACE_HINT,i as SIDE_SPACE_LABEL,S as default};
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import{SettingsDefaultReset as u,SettingsField as m}from"efficient-easel/panel";import{PaddingXIcon as f}from"efficient-easel/icons";import{SITE_GUTTER as a,SITE_GUTTER_PHONE as c,siteGutterPhoneFollows as S}from"../../format/lib/content/page-width.js";import{say as r,editorEaselWords as _}from"../../format/lib/editor-words.js";import{Slider as g}from"../lib/document/controls.js";import{siteTwinRow as E}from"../../format/lib/site-twin-row.js";const l="Side space",d=a.default,h="The room left at the left and right edge of every page.";function N(t,e){return E(t,{desktop:{key:"site_gutter",value:e.gutter,unsetPx:d,bounds:a},phone:{key:"site_gutter_phone",value:e.phone,unsetPx:S(e.gutter),bounds:c}})}function x({value:t,onChange:e,showHint:p=!0,unsetPx:n=d,bounds:i=a}){const s=t===null;return o(m,{label:r(l),labelId:"sf-side-space",icon:o(f,{}),value:`${t??n}px`,changed:!s,action:o(u,{words:_()?.panel,label:r(l),changed:!s,detail:`${n}px`,onReset:()=>e(null)}),hint:p?r(h):void 0,children:o(g,{min:i.min,max:i.max,step:i.step,value:t??n,readout:!1,ariaLabel:r(l),onChange:e})})}export{h as SIDE_SPACE_HINT,l as SIDE_SPACE_LABEL,x as default,N as sideSpaceRow};
@@ -1,10 +1,13 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type SettingsBucket } from "efficient-easel/fields";
3
+ import type { PartMotionRows } from "./usePartMotion.js";
3
4
  import { type HeroMediaPart } from "../../render/lib/document/hero-media-parts.js";
4
5
  export declare const TAB_ICONS: Record<SettingsBucket, ReactNode>;
5
- export declare function SiteFields({ entries, entryCount, part, omit, }: {
6
+ export declare function SiteFields({ entries, entryCount, part, omit, motion, body, }: {
6
7
  entries?: ReactNode;
7
8
  entryCount?: number;
8
9
  part?: HeroMediaPart | null;
9
10
  omit?: readonly string[];
11
+ motion?: PartMotionRows;
12
+ body?: ReactNode;
10
13
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as T}from"react/jsx-runtime";import{useLayoutEffect as R,useMemo as g,useRef as U,useState as x}from"react";import{useEasel as W,useSelectedFields as X}from"efficient-easel/easel";import{Inspector as G,planFields as v}from"efficient-easel/fields";import{BUCKET_ICONS as H,entriesHiddenForTab as Y}from"../lib/document/controls.js";import{BUCKETS as z}from"../lib/document/field-groups.js";import{say as J}from"../../format/lib/editor-words.js";import{usePreviewDevice as Q}from"efficient-easel/draw/client";import{showWhenContext as V,visibleFields as Z}from"../../render/lib/document/show-when.js";import{fieldsOfPart as $}from"../../render/lib/document/hero-media-parts.js";import{bandIsDropped as ee,droppedBands as te,sameKeys as oe,TEXT_BAND_KEY as _,TEXT_BAND_TITLE as ne,withoutBands as se}from"../../format/lib/document/panel-bands.js";const C=new Map,p=new Set;function re(n,r){const a=new Map;for(const t of n.querySelectorAll(".es-insp-row[data-field]"))a.set(t.getAttribute("data-field")??"",t);const s=[];for(const[t,w]of r)s.push({key:t,rows:w.map(l=>{const d=a.get(l),f=!!d&&[...d.children].some(u=>!u.hidden),b=d?.querySelector(".es-field-label, .es-list-label")?.textContent?.trim();return{shown:f,labelled:f&&!!b}})});return s}const le=Object.fromEntries(z.map(n=>{const r=H[n];return[n,T(r,{},n)]}));function ye({entries:n,entryCount:r=0,part:a=null,omit:s}){const{id:t,fields:w,values:l,readOnly:d,onChange:f}=X(),b=Q(),{appState:u,config:A}=W(e=>e),B=V(b,A,u.data.content??[],u.ui.itemSelector),h=$(w,a),I=g(()=>s?.length?Object.fromEntries(Object.entries(h).filter(([e])=>!s.includes(e))):h,[h,s]),c=Z(I,l,B),[M,j]=x(()=>new Set(p)),[F,D]=x(()=>new Set),O=U(null),N=g(()=>{const e=new Map;for(const o of v(c).rows){if(!o.fold)continue;const i=e.get(o.fold.key)??[];i.push(o.name),e.set(o.fold.key,i)}return e},[c]);R(()=>{const e=O.current?.parentElement;if(!e)return;const o=new Set(te(re(e,N)));D(i=>oe(i,o)?i:o)});const k=g(()=>se(c,F),[c,F]),K={key:_,rows:Array.from({length:r},()=>({shown:!0,labelled:!0}))},P=ee(K)?void 0:{key:_,title:ne},[y,L]=x(()=>C.get(t)),S=C.get(t),m=v(c).buckets,E=S&&m.includes(S)?S:y&&m.includes(y)?y:m[0],q=E===void 0||Y(m,E)!==!0;return T(G,{fields:k,values:l,onChange:f,readOnly:d,showWhenContext:{...B,node:l},tab:E,onTab:e=>{C.set(t,e),L(e)},tabIcons:le,idPrefix:t,ariaLabel:J("Section settings"),lead:q?n:null,leadFold:P,closedFolds:M,onFold:(e,o)=>{o?p.delete(e):p.add(e),j(new Set(p))},children:T("span",{ref:O,hidden:!0})})}export{ye as SiteFields,le as TAB_ICONS};
1
+ "use client";import{jsx as c,Fragment as ce,jsxs as de}from"react/jsx-runtime";import{createContext as ie,useContext as ue,useLayoutEffect as V,useMemo as g,useRef as W,useState as F}from"react";import{useEasel as q,useSelectedFields as fe}from"efficient-easel/easel";import{fieldShownInView as pe,Inspector as me,planFields as P}from"efficient-easel/fields";import{BUCKET_ICONS as we,RowPropsContext as he}from"../lib/document/controls.js";import{panelTab as be}from"../../format/lib/document/panel-tabs.js";import{BUCKETS as ge}from"../lib/document/field-groups.js";import{say as ye}from"../../format/lib/editor-words.js";import{SameInEveryViewNote as xe}from"./SameInEveryViewNote.js";import{usePreviewDevice as Se}from"efficient-easel/draw/client";import{deviceField as ve}from"efficient-easel/screen/lib/document/device-fields";import{showWhenContext as Be,visibleFields as U}from"../../render/lib/document/show-when.js";import{fieldsOfPart as Ce}from"../../render/lib/document/hero-media-parts.js";import{bandIsDropped as Te,droppedBands as ke,loneDesignBand as Ee,sameKeys as De,TEXT_BAND_KEY as O,TEXT_BAND_TITLE as _e,withoutBands as Fe}from"../../format/lib/document/panel-bands.js";const I=new Map,y=new Set;function X(o,r){const p=new Map;for(const t of o.querySelectorAll(".es-insp-row[data-field]"))p.set(t.getAttribute("data-field")??"",t);const d=[];for(const[t,b]of r)d.push({key:t,rows:b.map(m=>{const w=p.get(m),i=!!w&&[...w.children].some(S=>!S.hidden),x=w?.querySelector(".es-field-label, .es-list-label")?.textContent?.trim();return{shown:i,labelled:i&&!!x}})});return d}const Pe=Object.fromEntries(ge.map(o=>{const r=we[o];return[o,c(r,{},o)]})),Y=ie(null),Oe={_partBody:ve("each",{type:"custom",render:()=>c(Ie,{})})};function Ie(){return c(ce,{children:ue(Y)})}function Ge({entries:o,entryCount:r=0,part:p=null,omit:d,motion:t,body:b}){const{id:m,fields:w,values:i,readOnly:x,onChange:S}=fe(),l=g(()=>t?{...i,...t.values}:i,[i,t?.values]),G=(e,n)=>t?.keys.has(e)?t.onChange(e,n):S(e,n),v=Se(),{appState:R,config:H}=q(e=>e),B=Be(v,H,R.data.content??[],R.ui.itemSelector),C=b===void 0?Ce(w,p):Oe,j=g(()=>{const e=d?.length?Object.fromEntries(Object.entries(C).filter(([n])=>!d.includes(n))):C;return t?{...e,...t.fields}:e},[C,d,t?.fields]),h=U(j,l,B),[z,J]=F(()=>new Set(y)),[T,Q]=F(()=>new Set),A=W(null),{bandRows:Z,designBands:ee,looseRows:te}=g(()=>{const e=new Map,n=new Set,f=[];for(const s of P(h).rows){if(!s.fold){s.bucket==="Design"&&f.push(s.name);continue}const a=e.get(s.fold.key)??[];a.push(s.name),e.set(s.fold.key,a),s.bucket==="Design"&&n.add(s.fold.key)}return{bandRows:e,designBands:n,looseRows:new Map([["",f]])}},[h]),k=pe({},v),M={key:O,rows:Array.from({length:k?r:0},()=>({shown:!0,labelled:!0}))};V(()=>{const e=A.current?.parentElement;if(!e)return;const n=X(e,Z),f=new Set(ke(n)),s=Ee([M,...n.filter(a=>ee.has(a.key))],X(e,te)[0].rows);s&&f.add(s),Q(a=>De(a,f)?a:f)});const ne=g(()=>Fe(h,T),[h,T]),se=!Te(M)&&!T.has(O)?{key:O,title:_e}:void 0,K=q(e=>e.selectedItem)!==null,N=t?.part??p??"",E=`${m}:${N}:${String(v)}`,[oe,re]=F(()=>({tab:I.get(E)})),$=`${m}:${N}`,D=W(null),_={...B,node:l},L=P(h,{values:l,context:_}).buckets,u=be({allTabs:K,remembered:I.get(E),inherited:D.current?.panel===$?D.current.tab:oe.tab,buckets:L,hasText:k&&r>0}),le=!k&&!L.includes(u)&&(P(U(j,l,{...B,device:"desktop"}),{values:l,context:{..._,device:"desktop"}}).buckets.includes(u)||u==="Design"&&r>0);V(()=>{D.current={panel:$,tab:u}});const ae=u==="Design";return c(Y.Provider,{value:b??null,children:c(he.Provider,{value:t?l:null,children:de(me,{fields:ne,values:l,onChange:G,readOnly:x,allTabs:K,showWhenContext:_,tab:u,onTab:e=>{I.set(E,e),re({tab:e})},tabIcons:Pe,idPrefix:m,ariaLabel:ye("Section settings"),lead:ae?o:null,leadFold:se,closedFolds:z,onFold:(e,n)=>{n?y.delete(e):y.add(e),J(new Set(y))},children:[c("span",{ref:A,hidden:!0}),le&&c(xe,{})]})})})}export{Ge as SiteFields,Pe as TAB_ICONS};
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import{useState as c}from"react";import{Banner as m,Button as h}from"efficient-shell/ui";import{UndoIcon as p}from"efficient-shell/icons/efficient";import{useScreenDocument as y}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as r}from"../../format/lib/editor-words.js";import{clearRestoreNote as v,undoSiteRestore as S,useRestoreNote as g}from"../lib/site-versions.js";function P(){const t=g(),{adapter:l,flushSave:d,reloadFromServer:u}=y(),o=l.siteVersions,[n,s]=c(!1),[i,a]=c(!1);if(!t)return null;const f=async()=>{if(!(!o||n)){s(!0),a(!1);try{await S({access:o,flushSave:d,reload:u})}catch{a(!0)}finally{s(!1)}}};return e("aside",{className:"sf-canvas-notice",children:e(m,{tone:i?"danger":"info",title:t.title,onDismiss:v,action:o&&t.undo?e(h,{variant:"secondary",size:"sm",leftIcon:e(p,{}),loading:n,disabled:n,onClick:()=>{f()},children:r("Undo")}):void 0,children:i?r("Undo did not work. Nothing changed. Try again."):r("Check it with Preview. Press Publish to put it live.")})})}export{P as SiteRestoreNotice};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{useState as d}from"react";import{Banner as p,Button as h}from"efficient-shell/ui";import{UndoIcon as y}from"efficient-shell/icons/efficient";import{useScreenDocument as v}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as n}from"../../format/lib/editor-words.js";import{clearRestoreNote as S,undoSiteRestore as b,useRestoreNote as g}from"../lib/site-versions.js";import{useSettledAction as N}from"efficient-easel/easel";function C(){const t=g(),{adapter:l,flushSave:u,reloadFromServer:f}=v(),o=l.siteVersions,[r,i]=d(!1),[a,c]=d(!1),m=async()=>{if(!(!o||r)){i(!0),c(!1);try{await b({access:o,flushSave:u,reload:f})}catch{c(!0)}finally{i(!1)}}},s=N({onPress:()=>{m()},busy:r});return t?e("aside",{className:"sf-canvas-notice",children:e(p,{tone:a?"danger":"info",title:t.title,onDismiss:S,action:o&&t.undo?e(h,{variant:"secondary",size:"sm",leftIcon:e(y,{}),loading:s.busy,disabled:s.busy,onClick:s.onPress,children:n("Undo")}):void 0,children:a?n("Undo did not work. Nothing changed. Try again."):n("Check it with Preview. Press Publish to put it live.")})}):null}export{C as SiteRestoreNotice};
@@ -1 +1 @@
1
- "use client";import{jsx as y}from"react/jsx-runtime";import{useState as O}from"react";import{TextStylesList as v}from"efficient-easel/text-styles";import{FONT_OPTIONS as x}from"../../format/lib/fonts.js";import{usePreviewDevice as I}from"efficient-easel/draw/client";import{applyListChange as _,resolveTextStyles as C,toPanelStyles as E}from"../../render/lib/text-styles/site-text-styles.js";const c=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],b=["size","lineSpacing","letterSpacing","letterCase"],k=500,w=x.map(e=>({value:e.key,label:e.label,family:`var(${e.cssVar})`,italic:e.italicLoaded}));function L({saved:e,old:s,colours:p,sizeOf:o,onChange:f,openId:a,onOpenChange:S,readOnly:d=!1,withoutSize:g=!1}){const[m,u]=O(null),T=I()==="mobile",l=C(e,s),r=E(l,o);return y(v,{styles:r,onChange:t=>f(_({saved:e,old:s,cur:r,next:t,sizeOf:o})),fonts:w,colours:p,settings:g?c.filter(t=>t!=="size"):c,auto:b,openId:a===void 0?m:a,onOpenChange:S??u,readOnly:d,device:T?"phone":"desktop",fallback:t=>{const n=l.find(h=>h.id===(t.kind==="heading"?"heading-1":"body-1")),i={};return n?.values.font&&t.id!==n.id&&(i.font=n.values.font),t.kind==="heading"&&(i.weight=k),i}})}export{w as SITE_FONTS,L as default};
1
+ "use client";import{jsx as v}from"react/jsx-runtime";import{useState as y}from"react";import{TextStylesList as O}from"efficient-easel/text-styles";import{FONT_OPTIONS as _}from"../../format/lib/fonts.js";import{usePreviewDevice as I}from"efficient-easel/draw/client";import{applyListChange as b,resolveTextStyles as w,toPanelStyles as x}from"../../render/lib/text-styles/site-text-styles.js";const C={desktop:"desktop",tablet:"tablet",mobile:"phone"},p=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],k=["size","lineSpacing","letterSpacing","letterCase"],L=500,N=_.map(e=>({value:e.key,label:e.label,family:`var(${e.cssVar})`,italic:e.italicLoaded}));function A({saved:e,old:o,colours:f,sizeOf:a,onChange:S,openId:l,onOpenChange:d,readOnly:g=!1,withoutSize:m=!1}){const u=I(),[T,h]=y(null),r=w(e,o),n=C[u],c=x(r,a,n);return v(O,{styles:c,onChange:t=>S(b({saved:e,old:o,cur:c,next:t,sizeOf:a,panelView:n})),fonts:N,colours:f,settings:m?p.filter(t=>t!=="size"):p,auto:k,openId:l===void 0?T:l,onOpenChange:d??h,readOnly:g,device:n,fallback:t=>{const i=r.find(E=>E.id===(t.kind==="heading"?"heading-1":"body-1")),s={};return i?.values.font&&t.id!==i.id&&(s.font=i.values.font),t.kind==="heading"&&(s.weight=L),s}})}export{N as SITE_FONTS,A as default};
@@ -1 +1 @@
1
- "use client";import{jsx as o}from"react/jsx-runtime";import{useCallback as H,useEffect as P,useMemo as l,useRef as V,useState as u}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as X}from"../lib/document/build-config.js";import{withTemplateMediaPlaceholders as Z}from"../../format/lib/document/templateFields.js";import{setEditorPageSlug as B}from"../../format/lib/document/editor-page-context.js";import{ScreenDocumentContext as $}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as ee}from"../../render/components/PreviewHeaderContext.js";import{PreviewTickerProvider as te}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as re}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as oe}from"efficient-easel/draw/client";import{CanvasPartsBridge as ie}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as ne}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as se}from"./PreviewPartStyleContext.js";import{sectionTemplates as b}from"efficient-easel/screen/lib/section-templates";import{nodeToDoc as de,docToNode as R}from"efficient-easel/screen/lib/document/section-doc";import{newNodeId as ae}from"efficient-easel/draw";import{migrateRenamedProps as ce}from"../../format/lib/document/renamed-props.js";import{buildSlotSeedChildren as me}from"../../render/lib/document/slot-specs.js";import{FOOTER_TYPE as le,buildDefaultFooterBlocks as ue}from"../lib/document/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as fe,useAdminBridge as pe}from"efficient-easel/screen/lib/admin-bridge";import{useEaselHost as ve}from"efficient-easel/screen/lib/host";import{ChromeWrap as ge}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as he}from"efficient-easel/screen/lib/session";import{useEaselSession as Pe}from"efficient-easel/screen/lib/session-context";import{say as F}from"../../format/lib/editor-words.js";import{retargetWhenSaved as Se}from"../../format/lib/section-retarget.js";import{routeSharedHostMessage as Ee}from"efficient-easel/screen/lib/host-inbound";import{routeWebsiteHostMessage as ye}from"../../format/lib/website-host-inbound.js";import{DEFAULT_THEME_MODE as S,THEME_MODE_KEY as Te}from"../../format/lib/theme.js";import{makeSitePageAdapter as L}from"../lib/editor-document-adapter.js";import{documentPermissions as we}from"efficient-easel/edit-lock";import{useAutosave as Ne}from"efficient-easel/autosave";import{saveStatusOf as Ce}from"efficient-easel/screen/lib/document-switch";import{blocksOf as ke}from"../lib/website-session.js";const Ae=x(()=>import("./SiteEditorProvider.js"),{ssr:!1}),Ie=x(()=>import("efficient-easel/screen/components/SectionScreenShell"),{ssr:!1}),U="HeroSingle",W="Untitled section";function be(i,E){const d=E.components,r=d[i]?i:U,y=d[r]?.defaultProps??{},n=me(r,f=>d[f]?.defaultProps??{}),s=r===le?{blocks:ue()}:null;return{type:r,props:{id:ae(r),...y,...n?{[n.slot]:n.children}:null,...s}}}function Me(){if(typeof window>"u")return S;try{const i=window.localStorage.getItem(Te);return i==="light"||i==="dark"||i==="auto"?i:S}catch{return S}}function Oe({id:i,initialType:E,initialName:d=W}){const[r,y]=u(i),n=V(r);P(()=>{n.current=r},[r]);const s=ve(),[f,Y]=u(E),[M,j]=u(d),[a,T]=u(void 0),[K,G]=u(S),{token:w,tokenRef:O}=pe({onMessage:e=>{if(ye(e)||Ee(e))return;const t=e;if(t?.type==="storefront-editor:navigate"&&t.target?.kind==="section"&&t.target.id){const I=t.target.id;if(I===n.current)return;const J=t.target.type,Q=t.target.name;Se(C,()=>{Y(J),j(Q||W),y(I),s.address.show({kind:"section",id:I})},()=>s.send("storefront-editor:save-failed"))}}}),N=Ne({save:e=>b.update(e.id,e.node).then(()=>{}),onFailure:(e,t)=>{t===0&&s.send("storefront-editor:save-failed")}}),{state:p,push:D,flush:C}=N;P(()=>G(Me()),[]);const c=Pe(),v=c.usesBridgedToken?!!w:!0,g=l(()=>X(he(c),ke(c)),[c]);P(()=>{if(!v)return;let e=!1;return T(void 0),b.ensure(r,M,be(f??U,g)).then(t=>!e&&T(t.node)).catch(()=>!e&&T(null)),()=>{e=!0}},[r,f,M,v,g]);const k=H(e=>{s.send("storefront-editor:dirty");const t=R(e);t&&D({id:n.current,node:t})},[D,s]),h=s.send,_=H(async e=>{try{return await e(O.current??""),!0}catch{return h("storefront-editor:save-failed"),!1}},[h]),q=l(()=>Z(g,!0),[g]);P(()=>(B(null),()=>B(null)),[]);const m=l(()=>a?ce(de(a)):null,[a]),A=l(()=>({target:{kind:"page",slug:""},adapter:L(void 0),capabilities:L(void 0).capabilities,templateId:null,currentSlug:"",currentKind:null,siteId:null,ready:v,token:w,tokenRef:O,notifyParent:h,runAuthed:_,docId:r,data:m,getLiveData:()=>m,error:null,redirecting:!1,saveStatus:Ce(p),saveState:p,autoSaveEnabled:!0,autoSaveStoppedByConflict:!1,hasUnsavedEdits:p.pending,toggleAutoSave:()=>{},retrySave:()=>{N.retryNow()},onChange:k,flushSave:C,onPublish:async e=>{const t=R(e);t&&await b.update(n.current,t)},bridgeCapabilities:fe,access:{kind:"editing"},readOnly:!1,takeOverEditing:()=>{},viewReadOnly:()=>{},saveConflict:null,reloadFromServer:()=>{},navigate:()=>{},pendingNav:null,cancelPendingNav:()=>{},discardAndNavigate:()=>{},saveAndNavigate:async()=>{}}),[r,v,w,h,_,m,p,k,C,N.retryNow]),z=l(()=>we(!A.readOnly),[A.readOnly]);return a===void 0?o("div",{className:"sf-msg",children:F("Loading…")}):a===null||!m?o("div",{className:"sf-msg sf-msg--error",children:F("Couldn’t open this section.")}):o($.Provider,{value:A,children:o(ee,{themeMode:K,chromePlaceholder:!0,children:o(ge,{wrap:c.chrome?.wrap,surface:"section",children:o(te,{children:o(re,{children:o(oe,{children:o(ne,{children:o(ie,{children:o(se,{children:o(Ae,{config:q,data:m,onChange:k,permissions:z,children:o(Ie,{})},r)})})})})})})})})})}export{Oe as default};
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import{useCallback as H,useEffect as P,useMemo as l,useRef as X,useState as u}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as Z}from"../lib/document/build-config.js";import{withTemplateMediaPlaceholders as $}from"../../format/lib/document/templateFields.js";import{setEditorPageSlug as B}from"../../format/lib/document/editor-page-context.js";import{ScreenDocumentContext as ee}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as te}from"../../render/components/PreviewHeaderContext.js";import{PreviewTickerProvider as re}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as oe}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as ie}from"efficient-easel/draw/client";import{CanvasPartsBridge as ne}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as se}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as de}from"./PreviewPartStyleContext.js";import{sectionTemplates as b}from"efficient-easel/screen/lib/section-templates";import{saveSectionTemplate as R}from"../lib/editor-document-adapter.js";import{nodeToDoc as ae,docToNode as F}from"efficient-easel/screen/lib/document/section-doc";import{newNodeId as ce}from"efficient-easel/draw";import{migrateRenamedProps as me}from"../../format/lib/document/renamed-props.js";import{buildSlotSeedChildren as le}from"../../render/lib/document/slot-specs.js";import{FOOTER_TYPE as ue,buildDefaultFooterBlocks as fe}from"../lib/document/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as pe,useAdminBridge as ve}from"efficient-easel/screen/lib/admin-bridge";import{useEaselHost as ge}from"efficient-easel/screen/lib/host";import{ChromeWrap as he}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as Pe}from"efficient-easel/screen/lib/session";import{useEaselSession as Se}from"efficient-easel/screen/lib/session-context";import{say as L}from"../../format/lib/editor-words.js";import{retargetWhenSaved as Ee}from"../../format/lib/section-retarget.js";import{routeSharedHostMessage as ye}from"efficient-easel/screen/lib/host-inbound";import{routeWebsiteHostMessage as Te}from"../../format/lib/website-host-inbound.js";import{DEFAULT_THEME_MODE as S,THEME_MODE_KEY as we}from"../../format/lib/theme.js";import{makeSitePageAdapter as U}from"../lib/editor-document-adapter.js";import{documentPermissions as Ne}from"efficient-easel/edit-lock";import{useAutosave as Ce}from"efficient-easel/autosave";import{saveStatusOf as ke}from"efficient-easel/screen/lib/document-switch";import{blocksOf as Ae}from"../lib/website-session.js";const Ie=x(()=>import("./SiteEditorProvider.js"),{ssr:!1}),be=x(()=>import("efficient-easel/screen/components/SectionScreenShell"),{ssr:!1}),W="HeroSingle",Y="Untitled section";function Me(i,E){const d=E.components,r=d[i]?i:W,y=d[r]?.defaultProps??{},n=le(r,f=>d[f]?.defaultProps??{}),s=r===ue?{blocks:fe()}:null;return{type:r,props:{id:ce(r),...y,...n?{[n.slot]:n.children}:null,...s}}}function Oe(){if(typeof window>"u")return S;try{const i=window.localStorage.getItem(we);return i==="light"||i==="dark"||i==="auto"?i:S}catch{return S}}function De({id:i,initialType:E,initialName:d=Y}){const[r,y]=u(i),n=X(r);P(()=>{n.current=r},[r]);const s=ge(),[f,j]=u(E),[M,K]=u(d),[a,T]=u(void 0),[G,q]=u(S),{token:w,tokenRef:O}=ve({onMessage:e=>{if(Te(e)||ye(e))return;const t=e;if(t?.type==="storefront-editor:navigate"&&t.target?.kind==="section"&&t.target.id){const I=t.target.id;if(I===n.current)return;const Q=t.target.type,V=t.target.name;Ee(C,()=>{j(Q),K(V||Y),y(I),s.address.show({kind:"section",id:I})},()=>s.send("storefront-editor:save-failed"))}}}),N=Ce({save:e=>R(b,e.id,e.node).then(()=>{}),onFailure:(e,t)=>{t===0&&s.send("storefront-editor:save-failed")}}),{state:p,push:D,flush:C}=N;P(()=>q(Oe()),[]);const c=Se(),v=c.usesBridgedToken?!!w:!0,g=l(()=>Z(Pe(c),Ae(c)),[c]);P(()=>{if(!v)return;let e=!1;return T(void 0),b.ensure(r,M,Me(f??W,g)).then(t=>!e&&T(t.node)).catch(()=>!e&&T(null)),()=>{e=!0}},[r,f,M,v,g]);const k=H(e=>{s.send("storefront-editor:dirty");const t=F(e);t&&D({id:n.current,node:t})},[D,s]),h=s.send,_=H(async e=>{try{return await e(O.current??""),!0}catch{return h("storefront-editor:save-failed"),!1}},[h]),z=l(()=>$(g,!0),[g]);P(()=>(B(null),()=>B(null)),[]);const m=l(()=>a?me(ae(a)):null,[a]),A=l(()=>({target:{kind:"page",slug:""},adapter:U(void 0),capabilities:U(void 0).capabilities,templateId:null,currentSlug:"",currentKind:null,siteId:null,ready:v,token:w,tokenRef:O,notifyParent:h,runAuthed:_,docId:r,data:m,getLiveData:()=>m,error:null,redirecting:!1,saveStatus:ke(p),saveState:p,autoSaveEnabled:!0,autoSaveStoppedByConflict:!1,hasUnsavedEdits:p.pending,toggleAutoSave:()=>{},retrySave:()=>{N.retryNow()},onChange:k,flushSave:C,onPublish:async e=>{const t=F(e);t&&await R(b,n.current,t)},bridgeCapabilities:pe,access:{kind:"editing"},readOnly:!1,takeOverEditing:()=>{},viewReadOnly:()=>{},saveConflict:null,reloadFromServer:()=>{},navigate:()=>{},pendingNav:null,cancelPendingNav:()=>{},discardAndNavigate:()=>{},saveAndNavigate:async()=>{}}),[r,v,w,h,_,m,p,k,C,N.retryNow]),J=l(()=>Ne(!A.readOnly),[A.readOnly]);return a===void 0?o("div",{className:"sf-msg",children:L("Loading…")}):a===null||!m?o("div",{className:"sf-msg sf-msg--error",children:L("Couldn’t open this section.")}):o(ee.Provider,{value:A,children:o(te,{themeMode:G,chromePlaceholder:!0,children:o(he,{wrap:c.chrome?.wrap,surface:"section",children:o(re,{children:o(oe,{children:o(ie,{children:o(se,{children:o(ne,{children:o(de,{children:o(Ie,{config:z,data:m,onChange:k,permissions:J,children:o(be,{})},r)})})})})})})})})})}export{De as default};