efficient-web-builder 51.0.0 → 53.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/editor/components/ChatSettingsPanel.js +1 -1
  3. package/dist/editor/components/MediaUploadField.d.ts +7 -7
  4. package/dist/editor/components/MediaUploadField.js +1 -1
  5. package/dist/editor/components/PartSettingsPanel.js +1 -1
  6. package/dist/editor/components/PartTextBox.js +1 -1
  7. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  8. package/dist/editor/components/PreviewPartStyleContext.d.ts +2 -2
  9. package/dist/editor/components/SectionTextPartBridge.js +1 -1
  10. package/dist/editor/components/SiteAccentField.js +1 -1
  11. package/dist/editor/components/SiteTextStylesField.d.ts +3 -2
  12. package/dist/editor/components/SiteTextStylesField.js +1 -1
  13. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  14. package/dist/editor/components/storefront-editor.css +82 -64
  15. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  16. package/dist/editor/lib/animation/hover-fields.js +1 -1
  17. package/dist/editor/lib/document/ColourControl.d.ts +11 -8
  18. package/dist/editor/lib/document/ColourControl.js +1 -1
  19. package/dist/editor/lib/document/blocks/general/Breadcrumb/fields.js +1 -1
  20. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  21. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  22. package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
  23. package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
  24. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  25. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  26. package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
  27. package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
  28. package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
  29. package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
  30. package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
  31. package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
  32. package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
  33. package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
  34. package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
  35. package/dist/editor/lib/document/blocks/general/Series/fields.js +1 -1
  36. package/dist/editor/lib/document/blocks/general/StatsParagraph/fields.js +1 -1
  37. package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
  38. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  39. package/dist/editor/lib/document/blocks/shared-fields.d.ts +5 -0
  40. package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
  41. package/dist/editor/lib/document/box-fields.d.ts +23 -2
  42. package/dist/editor/lib/document/box-fields.js +1 -1
  43. package/dist/editor/lib/document/card-row-fields.js +1 -1
  44. package/dist/editor/lib/document/choice-pictures.d.ts +21 -0
  45. package/dist/editor/lib/document/choice-pictures.js +1 -0
  46. package/dist/editor/lib/document/controls.d.ts +33 -9
  47. package/dist/editor/lib/document/controls.js +1 -1
  48. package/dist/editor/lib/document/hidable-rows-drawn.d.ts +1 -0
  49. package/dist/editor/lib/document/hidable-rows-drawn.js +1 -1
  50. package/dist/editor/lib/document/overrides.js +1 -1
  51. package/dist/editor/lib/document/part-panel-rows.d.ts +1 -0
  52. package/dist/editor/lib/document/part-panel-rows.js +1 -1
  53. package/dist/editor/lib/document/passes/inspector.js +1 -1
  54. package/dist/editor/lib/document/separator-field.d.ts +9 -1
  55. package/dist/editor/lib/document/separator-field.js +1 -1
  56. package/dist/editor/lib/document/shape-picker.d.ts +37 -0
  57. package/dist/editor/lib/document/shape-picker.js +1 -0
  58. package/dist/editor/lib/document/show-for-field.d.ts +6 -0
  59. package/dist/editor/lib/document/show-for-field.js +1 -0
  60. package/dist/format/lib/animation/hover.d.ts +0 -2
  61. package/dist/format/lib/animation/hover.js +1 -1
  62. package/dist/format/lib/content/borders.d.ts +4 -2
  63. package/dist/format/lib/content/borders.js +1 -1
  64. package/dist/format/lib/content/box-layout.d.ts +21 -6
  65. package/dist/format/lib/content/box-layout.js +1 -1
  66. package/dist/format/lib/content/box-shape.d.ts +1 -5
  67. package/dist/format/lib/content/box-shape.js +1 -1
  68. package/dist/format/lib/content/box-show-for-choices.d.ts +9 -0
  69. package/dist/format/lib/content/box-show-for-choices.js +1 -0
  70. package/dist/format/lib/content/button-icon.d.ts +1 -1
  71. package/dist/format/lib/content/button-icon.js +1 -1
  72. package/dist/format/lib/content/card-state.d.ts +8 -0
  73. package/dist/format/lib/content/card-state.js +1 -0
  74. package/dist/format/lib/content/card-template.js +1 -1
  75. package/dist/format/lib/content/gallery-card-layout.d.ts +45 -1
  76. package/dist/format/lib/content/gallery-card-layout.js +1 -1
  77. package/dist/format/lib/content/image-aspect.d.ts +47 -0
  78. package/dist/format/lib/content/image-aspect.js +1 -0
  79. package/dist/format/lib/content/list-number.d.ts +11 -0
  80. package/dist/format/lib/content/list-number.js +1 -1
  81. package/dist/format/lib/content/phone-focus.d.ts +4 -1
  82. package/dist/format/lib/content/phone-focus.js +1 -1
  83. package/dist/format/lib/content/record-row.d.ts +14 -0
  84. package/dist/format/lib/content/record-row.js +1 -0
  85. package/dist/format/lib/content/record-types.d.ts +1 -1
  86. package/dist/format/lib/content/record-types.js +1 -1
  87. package/dist/format/lib/content/section-background.d.ts +10 -3
  88. package/dist/format/lib/content/section-background.js +1 -1
  89. package/dist/format/lib/content/section-height.d.ts +8 -0
  90. package/dist/format/lib/content/section-height.js +1 -1
  91. package/dist/format/lib/content/section-min-height.d.ts +17 -1
  92. package/dist/format/lib/content/section-min-height.js +1 -1
  93. package/dist/format/lib/content/section-sticky.d.ts +9 -0
  94. package/dist/format/lib/content/section-sticky.js +1 -1
  95. package/dist/format/lib/document/blocks/general/text-part-shapes.json +2 -2
  96. package/dist/format/lib/document/card-template-layers.d.ts +1 -1
  97. package/dist/format/lib/document/card-template-layers.js +1 -1
  98. package/dist/format/lib/document/media-manifest.json +5 -2
  99. package/dist/format/lib/document/mockup-variant-fields.d.ts +1 -0
  100. package/dist/format/lib/document/mockup-variant-fields.js +1 -1
  101. package/dist/format/lib/document/part-inks.d.ts +5 -10
  102. package/dist/format/lib/document/part-inks.js +1 -1
  103. package/dist/format/lib/document/passes/types.d.ts +1 -0
  104. package/dist/format/lib/document/section-catalog.js +2 -2
  105. package/dist/format/lib/document/section-descriptions.js +1 -1
  106. package/dist/format/lib/document/show-when-attach.d.ts +2 -1
  107. package/dist/format/lib/document/show-when-attach.js +1 -1
  108. package/dist/format/lib/editor-words-catalogue.d.ts +25 -14
  109. package/dist/format/lib/editor-words-catalogue.js +4 -4
  110. package/dist/format/lib/fonts.js +1 -1
  111. package/dist/format/lib/sections/divider-style.d.ts +4 -0
  112. package/dist/format/lib/sections/divider-style.js +1 -1
  113. package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
  114. package/dist/format/lib/sections/section-presets.js +1 -1
  115. package/dist/format/lib/source-rules/editor-words.js +2 -2
  116. package/dist/format/lib/source-rules/mirrored-rows-agree.js +4 -4
  117. package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.d.ts +4 -0
  118. package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.js +37 -20
  119. package/dist/format/lib/source-rules/shape-rows-use-the-picker.d.ts +7 -0
  120. package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -0
  121. package/dist/format/lib/source-rules/support/part-slider-call-sites.d.ts +0 -1
  122. package/dist/format/lib/source-rules/support/part-slider-call-sites.js +6 -6
  123. package/dist/format/lib/text-styles/site-text-colours.d.ts +4 -0
  124. package/dist/format/lib/text-styles/site-text-colours.js +1 -0
  125. package/dist/format/lib/theme.d.ts +1 -0
  126. package/dist/format/lib/theme.js +3 -3
  127. package/dist/format/lib/word-styles.d.ts +0 -1
  128. package/dist/format/lib/word-styles.js +1 -1
  129. package/dist/render/components/Breadcrumb.d.ts +2 -1
  130. package/dist/render/components/Breadcrumb.js +1 -1
  131. package/dist/render/components/ButtonBlock.d.ts +1 -0
  132. package/dist/render/components/ButtonBlock.js +1 -1
  133. package/dist/render/components/CardRowContext.d.ts +6 -3
  134. package/dist/render/components/CardRowContext.js +1 -1
  135. package/dist/render/components/ContentsList.d.ts +4 -1
  136. package/dist/render/components/ContentsList.js +1 -1
  137. package/dist/render/components/CurrentRecord.d.ts +23 -0
  138. package/dist/render/components/CurrentRecord.js +1 -0
  139. package/dist/render/components/Flex.d.ts +3 -2
  140. package/dist/render/components/Flex.js +1 -1
  141. package/dist/render/components/HeroPictures.d.ts +2 -0
  142. package/dist/render/components/HeroPictures.js +1 -1
  143. package/dist/render/components/HeroPoster.d.ts +2 -1
  144. package/dist/render/components/HeroPoster.js +1 -1
  145. package/dist/render/components/HeroSection.d.ts +2 -1
  146. package/dist/render/components/HeroSection.js +1 -1
  147. package/dist/render/components/HeroSingle.d.ts +3 -1
  148. package/dist/render/components/HeroSingle.js +1 -1
  149. package/dist/render/components/HeroSlide.d.ts +3 -1
  150. package/dist/render/components/HeroSlide.js +1 -1
  151. package/dist/render/components/ImageBlock.d.ts +5 -3
  152. package/dist/render/components/ImageBlock.js +1 -1
  153. package/dist/render/components/InBoxContext.d.ts +3 -0
  154. package/dist/render/components/SiteGutterFrame.d.ts +1 -0
  155. package/dist/render/components/SiteGutterFrame.js +1 -1
  156. package/dist/render/components/goldPhrases.js +2 -2
  157. package/dist/render/lib/content/block-size.d.ts +3 -0
  158. package/dist/render/lib/content/block-size.js +1 -1
  159. package/dist/render/lib/content/box-shared-columns.js +1 -1
  160. package/dist/render/lib/content/box-show-for.d.ts +14 -0
  161. package/dist/render/lib/content/box-show-for.js +1 -0
  162. package/dist/render/lib/content/page-contents.d.ts +1 -0
  163. package/dist/render/lib/content/page-contents.js +1 -1
  164. package/dist/render/lib/content/picture-focus-rows.d.ts +13 -0
  165. package/dist/render/lib/content/picture-focus-rows.js +1 -0
  166. package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
  167. package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
  168. package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
  169. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  170. package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
  171. package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
  172. package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
  173. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  174. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +2 -0
  175. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  176. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  177. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.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/part-styles.d.ts +21 -7
  181. package/dist/render/lib/document/part-styles.js +2 -2
  182. package/dist/render/lib/document/passes/block-size.js +1 -1
  183. package/dist/render/lib/document/passes/borders.js +1 -1
  184. package/dist/render/lib/document/passes/index.js +1 -1
  185. package/dist/render/lib/document/passes/section-height.js +1 -1
  186. package/dist/render/lib/document/passes/section-sticky.js +1 -1
  187. package/dist/render/lib/document/passes/show-for.d.ts +2 -0
  188. package/dist/render/lib/document/passes/show-for.js +1 -0
  189. package/dist/render/lib/document/show-when.d.ts +1 -1
  190. package/dist/render/lib/document/show-when.js +1 -1
  191. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  192. package/package.json +3 -3
  193. package/dist/editor/components/PartInkControl.d.ts +0 -7
  194. package/dist/editor/components/PartInkControl.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # Changelog
2
2
 
3
+ ## 53.0.0 - 2026-11-05
4
+
5
+ From main at `265af5ac`: #513, #517, #520, #523, #524, #525, #526, #528, #529, #531, #533, #535. A major because declared exports are removed or changed (#513, #520, #524, #525, #529) and the `efficient-easel` peer rises from `^27.3.0` to `^27.6.0` (#517). `efficient-shell` stays at `^11.8.0`. No stored key or value moves.
6
+
7
+ **BREAKING for hosts:**
8
+
9
+ - **Peer** (#517): install `efficient-easel` 27.6.0 or newer. `PartScreen` loses its boolean form.
10
+ - **Words** (#520): `WebBuilderPhrase` loses `Accent`, `Accent button`, `Accent footnote`, `In progress (accent)` and 2 old sentences. A host that types its words against it renames those keys (storefront-blocks: `package/src/words.public.d.ts`, and delete "Accent footnote" from `NO_IDEA` in `scripts/test-field-noun-map.tsx`).
11
+ - **Removed** (#525): `showColoursNotOffered`, `keepColoursNotOffered`, `siteTextColoursNotOffered` and the colour line of `toPanelStyles`. `SiteTextStylesField` requires `colourNameOf`; a host passes `siteTextColourNameOf(theme)`.
12
+ - **Changed** (#524): `viewFocusOf` returns `ownView`, `followed` and `followsView` in place of `phone`, `desktop` and `twin`. The media contract hash moves from `035f4205f0351855` to `b875e85294cc0f21`: the storefront installs this release with blocks that hold the Tablet focus keys, then the backend re-vendors `media_manifest.json` at that pin.
13
+ - **Removed** (#529): `cardTurnFor` and `CardHoverDrawn.angleSet`. A host draws `cardSpinOf(cardHoverOf(...))`. The phrase "By spokes" leaves the words.
14
+ - **Removed** (#513): `BOX_SHAPE_OPTIONS`, `IMAGE_ASPECT_OPTIONS`, `IMAGE_RATIO_OPTIONS`, the CSS classes `.sf-entrance-pic` and `.sf-entrance-cap`, the words `Square (1:1)`, `Landscape (4:3)`, `Bigger left`, `Bigger right`, and the `emptyValue` option of `iconPickerRow`. **Changed** (#513): `boxShareField()`, `boxShareTabletField`, `boxSharePhoneField`, `iconPickerRow`, `boxShareTabletOf`, `separatorField`, the `Flex` `share` type and `BOX_SHARE_POINTS`.
15
+
16
+ ### Added
17
+
18
+ - **A Box can show for one host choice** (#535): the `Show for` row (`showFor`), `render/lib/content/box-show-for` (`SelectedRangesProvider`, `useSelectedRanges`, `boxDrawsForRange`, `useInHiddenBox`, `ShowForGate`) and `registerShowForChoices`. With no provider, a Box draws.
19
+ - **A Text, Image, Button or Breadcrumb shows the page's record** (#528): `components/CurrentRecord` (`CurrentRecordProvider`, `useCurrentRecord`, `useCurrentRecordOf`, `usePageRecordRow`) and `lib/content/record-row`. A shopper sees it once the blocks mount the provider.
20
+ - **Image `Fill row` and a phone Aspect ratio** (#523), with `showWhen` on a row option and `useInsideBox`.
21
+ - **Font size, Hero Height** (#517) **and a picture's focus point** (#524) **take a Tablet value**. In Tablet and Phone, Font size and Hero Height show the blue name and a Reset while a value is stored.
22
+ - **A Contents block reads the anchored sections in its row Box** (#531), with `Number` and a phone `Show` row.
23
+ - **One shape picker for every shape choice** (#513): Box shape, Image Aspect ratio and 10 more rows use the shell `IconPicker`. Block widths is Fit content, Equal or Custom; old stored words read as Custom and keep their classes.
24
+
25
+ ### Changed
26
+
27
+ - **Emphasis, Button and Footnote replace the word Accent** (#520). Words only.
28
+ - **The Site styles Color row shows what is stored** (#525) through easel `colourNameOf`. A press on Main over a stored `accent` writes `main`; the page paints the same colour.
29
+ - **A card's Angle is a plain number** (#529): unset shows 72. A stored Angle still wins.
30
+ - **A picture dot acts per view, from one list** (#533): `PICTURE_DOTS` and `imageFocalPointActsIn`.
31
+
32
+ ### Fixed
33
+
34
+ - **The product card parts are in the commerce set** (#526): `ProductPrice`, `ProductSize` and `ProductColour`.
35
+
36
+ ## 52.0.0 - 2026-11-05
37
+
38
+ From main at `e9197485`: #497, #501, #510, #512, #514, #515, #516, #519. A major because declared exports are removed or changed (#497, #510, #512, #515). The peers do not change: `efficient-easel` `^27.3.0` and `efficient-shell` `^11.8.0`. A stored colour name stays as it is and paints the same token, so no stored page needs a data move for this release.
39
+
40
+ **BREAKING for hosts:**
41
+
42
+ - **Part colour types** (#497): in `format/lib/document/part-inks`, `partThemeColors(read)` and `readInks` use `Partial<Record<ColorSlot, string>>`. `PartStyleReading.inks` in `editor/components/PreviewPartStyleContext` has the same type. `WORD_STYLE_COLOUR_LABELS` is deleted.
43
+ - **The card highlight attribute** (#497): `data-sf-card-highlighted` leaves the drawn page, and `data-sf-card-state` replaces it.
44
+ - **Removed** (#510): `editor/components/PartInkControl`, `AnyColourSwatch`, and `PartInk`, `partInks` and `toHex` from `format/lib/document/part-inks`. The words `Any color`, `Follows the style` and `Mixed` leave `WEB_BUILDER_WORDS` and `WebBuilderPhrase`, so a host that generates its editor words must generate them again.
45
+ - **Removed** (#512): `SECTION_BG_SWATCHES`, `SECTION_BG_SWATCH_NAMES` and `isSectionBackgroundInheriting` from `format/lib/content/section-background`.
46
+ - **Removed** (#515): `readFieldLabels` and `SliderCallSite.labelFor` from `lib/source-rules/support/part-slider-call-sites`.
47
+
48
+ ### Added
49
+
50
+ - **One card row state** (#497): `CardRow.state`, `CardTemplateRows` `states`, and the module `format/lib/content/card-state`. A copy in a state draws one line in the theme's main colour. Cards highlights through it. A plain copy keeps its markup.
51
+ - **Height, Stick to top, the block Width group, Border and Button width take a Tablet value** (#501), drawn from 720 to 1100. A node with no tablet value draws the same bytes as before.
52
+ - `sectionBackgroundHex`, `isSectionBackgroundEmpty`, `sectionBackgroundChoice`, `SECTION_BG_NO_FILL` and the type `SectionBandColours` (#512); `surfaceTwoTone` in `lib/theme`; `partInkCss` (#497); `partColourName` (#515); `lib/text-styles/site-text-colours` (#516).
53
+
54
+ ### Changed
55
+
56
+ - **Part colours use the shell's colour slots** (#497): Main, Text, Background, Muted. The old names `accent` and `labels` read as `main` and `muted`, and paint the same token.
57
+ - **The band Background color row is the shared colour row** (#512) on Series, Stats, StatsParagraph, Timeline and TimelineTrack. Its window offers No fill, the section band and the theme colours, then a hex. The page paint does not change.
58
+ - **The text toolbars light a colour saved under an old name** (#515).
59
+
60
+ ### Fixed
61
+
62
+ - **A text style paints `main`, `muted` and `background`** (#516). The Site styles Color row offers Main, Text and Muted.
63
+ - **Layers keeps a data block's other slots** (#519). On easel 27.4.0, `cardTemplateSlotsOf` maps the slots the screen says are shown.
64
+
65
+ ### Internal
66
+
67
+ - CI runs the org-name guard here (#514).
68
+
3
69
  ## 51.0.0 - 2026-11-05
4
70
 
5
71
  From main at `6e5a8b06`: #473, #492, #494, #495, #496, #498, #499, #500, #502, #503, #504, #505, #506, #507, #508, #509. A major because of #503: the `efficient-easel` peer rises from `^27.0.0` to `^27.3.0`. No declared export is removed or changed (only added), and `efficient-shell` stays at `^11.8.0`. No stored key moves, so no stored page needs a data move.
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as s,Fragment as L}from"react/jsx-runtime";import{useEffect as P,useId as C,useState as E}from"react";import{usePreviewChat as T,DEFAULT_CHAT_PREVIEW as R}from"./PreviewChatContext.js";import{usePreviewHeader as S}from"../../render/components/PreviewHeaderContext.js";import{IconPicker as _}from"efficient-shell/ui";import{SettingsDefaultReset as y,SettingsField as u,SettingsSegmented as A,SettingsSwitch as I}from"efficient-easel/panel";import{ButtonIcon as O,ButtonIconIcon as B,EyeIcon as H,PhoneIcon as N,PlacementIcon as v,TypeIcon as x}from"efficient-easel/icons";import{ColourRow as D}from"../lib/document/ColourControl.js";import{shellGlyphOf as F}from"../lib/document/shell-glyph.js";import{PanelBand as w}from"../lib/document/controls.js";import{say as o,editorEaselWords as U}from"../../format/lib/editor-words.js";import{normalizeTheme as k,themeButtonColour as j}from"../../format/lib/theme.js";import{CHAT_LAUNCHER_ICONS as G,DEFAULT_CHAT_LAUNCHER_ICON as m,DEFAULT_CHAT_LAUNCHER_POSITION as f,chatLauncherIcon as W}from"../../format/lib/content/chat-launcher.js";const z="Chat with us",K="We usually reply within a few minutes",V="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function b({label:e,value:t,placeholder:l,onCommit:i,multiline:r=!1,hint:a}){const[c,g]=E(t);P(()=>g(t),[t]);const p=()=>{c!==t&&i(c)};return n(u,{label:e,icon:n(x,{}),changed:t!=="",action:n(d,{label:e,changed:t!=="",onReset:()=>i("")}),hint:a,children:r?n("textarea",{value:c,placeholder:l,rows:3,onChange:h=>g(h.target.value),onBlur:p,"aria-label":e}):n("input",{type:"text",value:c,placeholder:l,onChange:h=>g(h.target.value),onBlur:p,onKeyDown:h=>{h.key==="Enter"&&h.currentTarget.blur()},"aria-label":e,autoComplete:"off"})})}function d({label:e,changed:t,onReset:l}){return n(y,{words:U()?.panel,label:e,changed:t,onReset:l})}function q({label:e,icon:t,checked:l,fallback:i,onChange:r,hint:a}){const c=C();return n(u,{label:e,labelId:c,icon:t,changed:l!==i,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:l,onChange:r,ariaLabelledBy:c}),n(d,{label:e,changed:l!==i,onReset:()=>r(i)})]}),hint:a})}const J=G.map(e=>({value:e,icon:F(e)}));function M(){const{theme:e}=S(),t=k(e).themes[0];return j(t)??t?.accent??""}function Q(){const{chat:e,setChat:t}=T(),l=C(),i=M(),r=e.launcherIcon?W(e.launcherIcon):m;return s(L,{children:[n(u,{label:o("Show the chat bubble"),labelId:l,icon:n(H,{}),changed:!e.enabled,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:e.enabled,onChange:a=>t({enabled:a}),ariaLabelledBy:l}),n(d,{label:o("Show the chat bubble"),changed:!e.enabled,onReset:()=>t({enabled:!0})})]}),hint:e.enabled?o("The floating chat bubble shows in the corner of every page."):o("The chat bubble is hidden across the whole site.")}),s(w,{title:o("Look"),children:[n(D,{label:o("Button color"),icon:n(O,{}),changed:e.launcherColor!=="",value:e.launcherColor,inherited:i,caption:e.launcherColor?void 0:o("Site button color"),onChange:a=>t({launcherColor:a}),onReset:()=>t({launcherColor:""})}),n(u,{label:o("Icon"),icon:n(B,{}),changed:r!==m,action:n(d,{label:o("Icon"),changed:r!==m,onReset:()=>t({launcherIcon:""})}),children:n(_,{label:o("Icon"),value:r,options:J,onChange:a=>t({launcherIcon:a===m?"":a})})}),n(u,{label:o("Position"),icon:n(v,{}),changed:e.launcherPosition!==f,action:n(d,{label:o("Position"),changed:e.launcherPosition!==f,onReset:()=>t({launcherPosition:f})}),children:n(A,{options:[{label:o("Right"),id:"right"},{label:o("Left"),id:"left"}],value:e.launcherPosition,ariaLabel:o("Position"),onChange:a=>t({launcherPosition:a})})}),n(b,{label:o("Label"),value:e.launcherLabel,placeholder:o("Icon only"),onCommit:a=>t({launcherLabel:a}),hint:o("Shows when a visitor points at the button")}),n(q,{label:o("Show on phones"),icon:n(N,{}),checked:e.showOnPhones,fallback:R.showOnPhones,onChange:a=>t({showOnPhones:a})})]}),s(w,{title:o("Wording"),children:[n(b,{label:o("Title"),value:e.title,placeholder:z,onCommit:a=>t({title:a})}),n(b,{label:o("Subtitle"),value:e.subtitle,placeholder:K,onCommit:a=>t({subtitle:a})}),n(b,{label:o("Greeting message"),value:e.greeting,placeholder:V,onCommit:a=>t({greeting:a}),multiline:!0}),n("p",{className:"es-field-hint sf-hint-keep",children:o("Leave a field blank to use the built-in wording.")})]})]})}export{Q as default};
1
+ "use client";import{jsx as n,jsxs as s,Fragment as L}from"react/jsx-runtime";import{useEffect as P,useId as C,useState as E}from"react";import{usePreviewChat as S,DEFAULT_CHAT_PREVIEW as T}from"./PreviewChatContext.js";import{usePreviewHeader as R}from"../../render/components/PreviewHeaderContext.js";import{IconPicker as _}from"efficient-shell/ui";import{ShellIconWord as y}from"../lib/document/box-fields.js";import{SettingsDefaultReset as A,SettingsField as u,SettingsSegmented as O,SettingsSwitch as I}from"efficient-easel/panel";import{ButtonIcon as v,ButtonIconIcon as B,EyeIcon as H,PhoneIcon as N,PlacementIcon as x,TypeIcon as D}from"efficient-easel/icons";import{ColourRow as F}from"../lib/document/ColourControl.js";import{shellGlyphOf as U}from"../lib/document/shell-glyph.js";import{PanelBand as w}from"../lib/document/controls.js";import{say as t,editorEaselWords as k}from"../../format/lib/editor-words.js";import{normalizeTheme as W,themeButtonColour as j}from"../../format/lib/theme.js";import{CHAT_LAUNCHER_ICONS as G,DEFAULT_CHAT_LAUNCHER_ICON as m,DEFAULT_CHAT_LAUNCHER_POSITION as f,chatLauncherIcon as z}from"../../format/lib/content/chat-launcher.js";const K="Chat with us",V="We usually reply within a few minutes",q="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function b({label:e,value:o,placeholder:a,onCommit:r,multiline:i=!1,hint:l}){const[c,g]=E(o);P(()=>g(o),[o]);const p=()=>{c!==o&&r(c)};return n(u,{label:e,icon:n(D,{}),changed:o!=="",action:n(d,{label:e,changed:o!=="",onReset:()=>r("")}),hint:l,children:i?n("textarea",{value:c,placeholder:a,rows:3,onChange:h=>g(h.target.value),onBlur:p,"aria-label":e}):n("input",{type:"text",value:c,placeholder:a,onChange:h=>g(h.target.value),onBlur:p,onKeyDown:h=>{h.key==="Enter"&&h.currentTarget.blur()},"aria-label":e,autoComplete:"off"})})}function d({label:e,changed:o,onReset:a}){return n(A,{words:k()?.panel,label:e,changed:o,onReset:a})}function J({label:e,icon:o,checked:a,fallback:r,onChange:i,hint:l}){const c=C();return n(u,{label:e,labelId:c,icon:o,changed:a!==r,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:a,onChange:i,ariaLabelledBy:c}),n(d,{label:e,changed:a!==r,onReset:()=>i(r)})]}),hint:l})}const M=G.map(e=>({value:e,icon:U(e)}));function Q(){const{theme:e}=R(),o=W(e).themes[0];return j(o)??o?.accent??""}function X(){const{chat:e,setChat:o}=S(),a=C(),r=Q(),i=e.launcherIcon?z(e.launcherIcon):m;return s(L,{children:[n(u,{label:t("Show the chat bubble"),labelId:a,icon:n(H,{}),changed:!e.enabled,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:e.enabled,onChange:l=>o({enabled:l}),ariaLabelledBy:a}),n(d,{label:t("Show the chat bubble"),changed:!e.enabled,onReset:()=>o({enabled:!0})})]}),hint:e.enabled?t("The floating chat bubble shows in the corner of every page."):t("The chat bubble is hidden across the whole site.")}),s(w,{title:t("Look"),children:[n(F,{label:t("Button color"),icon:n(v,{}),changed:e.launcherColor!=="",value:e.launcherColor,inherited:r,caption:e.launcherColor?void 0:t("Site button color"),onChange:l=>o({launcherColor:l}),onReset:()=>o({launcherColor:""})}),n(u,{label:t("Icon"),icon:n(B,{}),value:n(y,{value:i}),changed:i!==m,action:n(d,{label:t("Icon"),changed:i!==m,onReset:()=>o({launcherIcon:""})}),children:n(_,{label:t("Icon"),value:i,options:M,onChange:l=>o({launcherIcon:l===m?"":l})})}),n(u,{label:t("Position"),icon:n(x,{}),changed:e.launcherPosition!==f,action:n(d,{label:t("Position"),changed:e.launcherPosition!==f,onReset:()=>o({launcherPosition:f})}),children:n(O,{options:[{label:t("Right"),id:"right"},{label:t("Left"),id:"left"}],value:e.launcherPosition,ariaLabel:t("Position"),onChange:l=>o({launcherPosition:l})})}),n(b,{label:t("Label"),value:e.launcherLabel,placeholder:t("Icon only"),onCommit:l=>o({launcherLabel:l}),hint:t("Shows when a visitor points at the button")}),n(J,{label:t("Show on phones"),icon:n(N,{}),checked:e.showOnPhones,fallback:T.showOnPhones,onChange:l=>o({showOnPhones:l})})]}),s(w,{title:t("Wording"),children:[n(b,{label:t("Title"),value:e.title,placeholder:K,onCommit:l=>o({title:l})}),n(b,{label:t("Subtitle"),value:e.subtitle,placeholder:V,onCommit:l=>o({subtitle:l})}),n(b,{label:t("Greeting message"),value:e.greeting,placeholder:q,onCommit:l=>o({greeting:l}),multiline:!0}),n("p",{className:"es-field-hint sf-hint-keep",children:t("Leave a field blank to use the built-in wording.")})]})]})}export{X as default};
@@ -7,17 +7,17 @@ interface Props {
7
7
  accept: string;
8
8
  placeholder?: string;
9
9
  focusKey?: string;
10
- focusWhen?: (props: Record<string, unknown>) => boolean;
10
+ focusWhen?: (props: Record<string, unknown>, view: "desktop" | "tablet" | "mobile") => boolean;
11
11
  frameKey?: string;
12
12
  fieldKey?: string;
13
13
  }
14
- export declare function viewFocusOf(values: Record<string, unknown>, focusKey: string, device: ReturnType<typeof usePreviewDevice>): {
15
- phone: boolean;
16
- desktop: string;
14
+ export declare function viewFocusOf(values: Record<string, unknown>, focusKey: string, device: ReturnType<typeof usePreviewDevice>, tabletActs?: boolean): {
15
+ ownView: boolean;
16
+ followed: string;
17
+ followsView: "desktop" | "tablet";
17
18
  own: string | undefined;
18
19
  focus: string;
19
20
  key: string;
20
- twin: string;
21
- } | null;
22
- export default function MediaUploadField({ value, onChange, label, accept, placeholder, focusKey, focusWhen, frameKey, fieldKey }: Props): import("react").JSX.Element;
21
+ };
22
+ export default function MediaUploadField({ value, onChange, label, accept, placeholder, focusKey, focusWhen, frameKey, fieldKey }: Props): import("react").JSX.Element | null;
23
23
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as i}from"react/jsx-runtime";import{SettingsDefaultReset as y,SettingsField as v}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 p}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{onDesktopWords as V}from"efficient-easel/screen/lib/document/box-fields";import{requestMediaPick as W}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 q}from"../lib/website-session.js";import{useEaselSession as z}from"efficient-easel/screen/lib/session-context";function G(o,t,s){if(b(s)==="tablet")return null;const r=b(s)==="mobile",n=typeof o[t]=="string"&&o[t]?String(o[t]):I,e=B(t),a=typeof o[e]=="string"&&o[e]?String(o[e]):void 0;return{phone:r,desktop:n,own:a,focus:r?a??n:n,key:r?e:t,twin:e}}function J(o,t){const s=H(),r=R();if(!o||!s)return null;const n=s.values??{};if(t&&!t(n))return null;const e=G(n,o,r);if(!e)return null;const a=s.onChange;return{phone:e.phone,desktop:e.desktop,own:e.own,focus:e.focus,set:f=>a(e.key,f),clear:()=>a(e.twin,L)}}function Q({value:o,onChange:t,label:s,accept:r,placeholder:n,focusKey:e,focusWhen:a,frameKey:f,fieldKey:w}){const x=_(),C=z(),h=p(s),d=r.startsWith("video"),c=J(d?void 0:e,a),g=O(T),k=N(),m=f&&w?{video:w,frame:f}:null,D=l=>W(x,{accept:r,title:h,...l?{file:l}:{}}).then(u=>!u||!m?u?.url??null:(k({[m.video]:u.url,[m.frame]:u.posterUrl??""}),null)),P=m?l=>l?t(l):k({[m.video]:"",[m.frame]:""}):t;if(g&&!g.capabilities.mediaEditing)return i(v,{label:h,icon:d?i(F,{}):i(E,{}),children:i("div",{className:"sf-image-slot-inert",children:d?p("Templates don’t store videos — this slot stays a placeholder. Each website picks its own after it’s created."):p("Templates don’t store images — this slot stays a placeholder. Each website picks its own after it’s created.")})});const S=j(o),U=c?.phone&&S?i(y,{words:A()?.panel,label:p("Image focus"),changed:!!c.own,detail:V(l=>p(l),c.desktop),onReset:c.clear}):void 0;return i(v,{label:h,icon:d?i(F,{}):i(E,{}),action:U,children:i("div",{style:{flex:"1 1 auto",minWidth:0},children:i(M,{value:S,onChange:P,onPick:D,accept:d?"video/*":"image/*",kind:d?"video":"image",placeholder:n===void 0?void 0:p(n),maxSizeBytes:q(C).media.maxUploadBytes,...c?{focus:c.focus,onFocusChange:c.set}:{}})})})}export{Q as default,G as viewFocusOf};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{SettingsDefaultReset as B,SettingsField as b}from"efficient-easel/panel";import{useSelectedHost as H}from"efficient-easel/easel";import{FOCAL_DEFAULT as M}from"efficient-shell/format";import{ImageIcon as v,PlayIcon as C}from"efficient-easel/icons";import{ImageFocusPoint as T,MediaUploadField as A}from"efficient-shell/ui";import{useContext as L}from"react";import{ScreenDocumentContext as R}from"efficient-easel/screen/components/ScreenDocumentContext";import{editorEaselWords as _,say as m}from"../../format/lib/editor-words.js";import{phoneKey as j,tabletKey as P}from"efficient-easel/draw";import{PHONE_CLEAR as N}from"../../format/lib/document/phone-override.js";import{usePreviewDevice as W}from"efficient-easel/draw/client";import{focusPoint as D}from"../../format/lib/content/phone-focus.js";import{shownTier as S}from"efficient-easel/screen/lib/document/device-fields";import{onDesktopWords as q}from"efficient-easel/screen/lib/document/box-fields";import{requestMediaPick as z}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as G}from"efficient-easel/screen/lib/host";import{mediaValueSrc as J}from"../../format/lib/media-value.js";import{useSelectedPatch as Q}from"../lib/document/controls.js";import{backendOf as X}from"../lib/website-session.js";import{useEaselSession as Y}from"efficient-easel/screen/lib/session-context";function Z(i,o,r,l=!0){const n=S(r),s=typeof i[o]=="string"&&i[o]?String(i[o]):M;if(n==="desktop")return{ownView:!1,followed:s,followsView:"desktop",own:void 0,focus:s,key:o};const a=n==="tablet"?P(o):j(o),d=D(i[a])??void 0,p=n==="mobile"&&l?D(i[P(o)])??void 0:void 0,w=p??s;return{ownView:!0,followed:w,followsView:p?"tablet":"desktop",own:d,focus:d??w,key:a}}function $(i,o,r){const l=H();if(!o||!l)return null;const n=l.values??{};if(r&&!r(n,S(i)))return null;const s=Z(n,o,i,r?r(n,"tablet"):!0),a=l.onChange;return{...s,set:d=>a(s.key,d),clear:()=>a(s.key,N)}}function K({value:i,onChange:o,label:r,accept:l,placeholder:n,focusKey:s,focusWhen:a,frameKey:d,fieldKey:p}){const w=G(),I=Y(),h=m(r),E=W(),f=l.startsWith("video"),t=$(E,f?void 0:s,a),F=!!s&&S(E)!=="desktop",x=L(R),V=Q(),u=d&&p?{video:p,frame:d}:null,U=c=>z(w,{accept:l,title:h,...c?{file:c}:{}}).then(k=>!k||!u?k?.url??null:(V({[u.video]:k.url,[u.frame]:k.posterUrl??""}),null)),y=u?c=>c?o(c):V({[u.video]:"",[u.frame]:""}):o,g=J(i);if(F&&(!t||!g))return null;if(x&&!x.capabilities.mediaEditing)return e(b,{label:h,icon:f?e(C,{}):e(v,{}),children:e("div",{className:"sf-image-slot-inert",children:f?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 O=t?.ownView&&g?e(B,{words:_()?.panel,label:m("Image focus"),changed:!!t.own,detail:q(c=>m(c),t.followed,t.followsView),onReset:t.clear}):void 0;return F&&t?e(b,{label:h,icon:e(v,{}),action:O,children:e("div",{style:{flex:"1 1 auto",minWidth:0},children:e(T,{value:t.focus,onChange:t.set,label:m("Image focus"),image:g,hint:null})})}):e(b,{label:h,icon:f?e(C,{}):e(v,{}),children:e("div",{style:{flex:"1 1 auto",minWidth:0},children:e(A,{value:g,onChange:y,onPick:U,accept:f?"video/*":"image/*",kind:f?"video":"image",placeholder:n===void 0?void 0:m(n),maxSizeBytes:X(I).media.maxUploadBytes,...t?{focus:t.focus,onFocusChange:t.set}:{}})})})}export{K as default,Z as viewFocusOf};
@@ -1 +1 @@
1
- "use client";import{jsx as n,Fragment as H,jsxs as y}from"react/jsx-runtime";import{useContext as bt,useEffect as pe,useRef as Pt,useState as Le}from"react";import{FieldSelect as wt,InspectorField as vt,fieldShownInView as Tt}from"efficient-easel/fields";import{SettingsField as Nt}from"efficient-easel/panel";import{InspectorUpLevel as Y}from"efficient-easel/chrome";import{StylesIcon as kt,TypeIcon as Ot}from"efficient-easel/icons";import{useEasel as Ct}from"efficient-easel/easel";import{TextPartPanel as Be}from"efficient-easel/copy";import{Button as Rt,IconButton as Et,Tooltip as It}from"efficient-shell/ui";import{PartTextBox as zt,partTextCells as Ue}from"./PartTextBox.js";import{SiteFields as me}from"./SiteFields.js";import{usePartMotion as Ft}from"./usePartMotion.js";import{UiIcon as We}from"efficient-easel/draw/client";import{usePreviewHeader as _t}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as Vt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as At}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as Lt,partStyleToTextStyleValues as Bt,pushIntoStyle as Ut,resolveTextStyles as He,styleIdOfRole as Wt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as Ht}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as jt}from"../lib/theme-row-persist.js";import{usePreviewDevice as Dt}from"efficient-easel/draw/client";import{shownTier as q}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as je}from"../lib/document/part-panel-rows.js";import{usePartStyle as Gt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as J,textFieldOffPage as Kt,textFieldPanelOnly as Mt}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as $t}from"efficient-easel/draw";import{useSectionOps as Xt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as Yt,FONT_ROLES as qt,FONT_ROLE_LABELS as De,fontOption as he,fontRoleOf as Jt}from"../../format/lib/fonts.js";import{isMultilineKind as Qt,partPlaceholder as Zt,typeInPlaceKind as en}from"../../render/lib/document/part-text.js";import{partRowField as tn}from"../lib/document/part-row-field.js";import{decodePartKey as nn,partPropsWithRowValue as on,partRowValue as ln}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Ge,propsWithPartStyleValue as U,propsWithoutPartStyle as sn,readPartStyle as ye,regionHasOwnLook as rn}from"../../render/lib/document/part-styles.js";import{partThemeColors as an}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Ke}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as cn}from"../lib/document/part-typing.js";import{keysOnCanvas as dn,useCanvasTypingPart as un}from"../lib/document/canvas-typing.js";import{useEaselHost as fn}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as pn,SOURCE_ACTIONS as mn,SOURCE_ACTION_LABEL as hn,partSourceNoteFor as yn,partSourceOf as gn,sourceMenuIdOf as Sn,sourceSlugOf as ge}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as xn,holdsAuthoredText as bn}from"../../render/lib/document/text-parts.js";import{regionsForSection as Pn}from"../../format/lib/sections/section-text-regions.js";import{regionTakesSize as wn,textRegionOfPartKey as vn}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as Me}from"./SameInEveryViewNote.js";function Se(t){return t?l(t):null}function $e(t){return t.kind==="role"?De[t.role]:t.kind==="custom"?"Custom":null}function Tn(t){const o=Jt(t.role);return o?{kind:"role",role:o}:null}function Nn(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 Q(t,o,r,i){return Tn(ye(t,o))??Nn(r,i)}function kn(t,o){if(!t.length)return null;const r=o(t[0]);return t.every(i=>o(i)===r)?r:null}function Xe(t){return[{value:j,label:l("No style"),description:l("Section’s own")},...t.map(o=>({value:o.id,label:o.name,description:o.values.font?he(o.values.font)?.label:void 0}))]}const j="";function On({face:t,base:o,onPick:r}){const i=t.kind==="role"?t.role:j,c=[{label:l("No style"),value:j},...qt.map(s=>({label:l(De[s]),value:s}))];return n(wt,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:s=>r(s===j?null:s),renderOption:s=>s.value===j?y(H,{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(${he(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:Se($e(t))}),valueText:s=>Se($e(t))??s?.label??""})}const Ye=["regionNote","regionStyle"],Cn=Object.keys(je).filter(t=>!Ye.includes(t));function qe(t,o){return!t.some(o)}function Rn({sectionName:t,onBack:o,textEditor:r,styleRow:i,children:c,tabs:s}){const E=y(H,{children:[r,i,c]});return y("div",{className:"sf-part-panel",children:[n(Y,{inline:!0,name:l(t),onSelect:o}),s?s(E):E]})}function Je({source:t,slug:o,menuId:r}){const i=fn(),c=mn[t],s=!c.needsSlug||!!o;return n("div",{className:"sf-note sf-note--source",children:y("p",{className:"es-field-hint sf-hint-keep",children:[l(pn[t]),s?y(H,{children:[" ",n(Rt,{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(hn)})]}):null]})})}const Qe=4,En=120;function Ze(t){return 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()})}function et({region:t,sizePx:o,face:r,base:i,onFollowStyle:c,source:s,slug:E,onBack:N,shows:x,sizedStyle:b,ownLook:I}){const D=t.follows;return y("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l(t.label)})}),x("regionNote")&&!I&&n("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(D),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(D)})}),b?y(H,{children:[b,x("regionStyle")&&n("p",{className:"es-field-hint sf-hint-keep",children:Ze(t)})]}):c?x("regionStyle")?n(H,{children:n(Nt,{label:l("Style"),icon:n(kt,{}),hint:Ze(t),children:n(On,{face:r,base:i,onPick:c})})}):null:x("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&&x("sourceNote")?n(Je,{source:s,slug:E}):null,qe([...Ye,"sourceNote",...b?["fontSize"]:[]],z=>x(z)&&(z!=="sourceNote"||!!s))&&n(Me,{}),n(Y,{inline:!0,name:l("Page"),onSelect:N})]})}function In({onBack:t}){return y("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(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function zn({onBack:t,partId:o,why:r}){return y("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:y("code",{children:[o," — ",r]})}),n(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function Fn({nodeId:t,propKey:o,onBack:r,onEditStyle:i}){const{getItemById:c,getSelectorForId:s,config:E}=Ct(e=>e),N=Xt(),x=un(),{partStyle:b}=Gt(),{fonts:I,textStyles:D}=_t(),z=bt(At),xe=!z?.capabilities?.hasSiteTheme,{persist:nt}=jt({themeFromDocument:xe,tokenRef:z?.tokenRef,siteId:z?.siteId??null}),k=Ht({themeFromDocument:xe,persist:nt}),[ot,Z]=Le(!1),W=Dt(),f=e=>q(W)!=="tablet"&&Tt(je[e],W),be=Pt(null),d=c(t),p=s(t),Pe=d?E.components[d.type]:void 0,{key:P,row:w}=nn(o),we=Pe?.fields?.[P],g=w?tn(we,w):we,F=xn(t,o),u=d?.props??{},v=en(g),ve=Kt(g),Te=bn(g),Ne=d?gn(d.type):null,ee=d?yn(d.type,P):null,te=w?ln(u[P],w):u[P],ke=!!w&&!(Array.isArray(u[P])&&w.index<u[P].length);pe(()=>{if(dn(document))return;be.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[F]);const[ne,Oe]=Le(0);pe(()=>Oe(0),[F]);const oe=!!d&&!ke&&(!p||!g);pe(()=>{if(!oe||ne>=Qe)return;const e=setTimeout(()=>Oe(a=>a+1),En);return()=>clearTimeout(e)},[oe,ne]);const lt=oe&&ne<Qe,le=Ft(t,Ke(d?.type,o),"textPart");if(!d||ke)return n(In,{onBack:r});const G=Pn(d.type),Ce=G?vn(G,o):null;if(G&&Ce){const e=b?.partId===F?b:null,a=G[Ce],h=a.writable===!0&&!!p,T=C=>{p&&N.replaceComponent(p.zone,p.index,{...d,props:U(u,o,"role",C)})};if(h&&wn(a)){const C=ye(u,o),Ae=R=>{if(!p)return;let fe=u;for(const[St,xt]of Object.entries(R))fe=U(fe,o,St,xt??null);N.replaceComponent(p.zone,p.index,{...d,props:fe})},ht=He(k.saved,k.old),yt=Ge(C)??"",gt=Ue(C,e?.base??tt,Ae,q(W)).filter(R=>R.key==="fontSize"&&f(R.key));return n(me,{motion:le,body:n(et,{region:a,sizePx:e?.base.sizePx??null,face:Q(u,o,e,I),base:e?.base??null,source:Ne,slug:ge(u),onBack:r,shows:f,ownLook:rn(C),sizedStyle:n(Be,{style:f("style")?{value:yt,options:Xe(ht),onChange:R=>Ae(R?{textStyle:R}:{textStyle:null,role:null}),onEditStyles:i}:void 0,cells:gt})})})}return n(me,{motion:le,body:n(et,{region:a,sizePx:e?.base.sizePx??null,face:Q(u,o,e,I),base:e?.base??null,onFollowStyle:h?T:void 0,source:Ne,slug:ge(u),onBack:r,shows:f})})}if(!p||!g)return lt?n("div",{className:"sf-note","aria-busy":"true"}):n(zn,{onBack:r,partId:F,why:p?"no field":"no selector"});const Re=e=>{N.replaceComponent(p.zone,p.index,{...d,props:e})},se=e=>{if(J(e).hidden!==J(te).hidden||!v){const h=w?on(u,P,w,e):{...u,[P]:e};h&&Re(h);return}cn({node:d,propKey:o,kind:v,zone:p.zone,index:p.index},J(e).text,N.replaceComponent)},st=te,_=b?.partId===F?b:null,V=_?.styleOwner,K=V?c(V.owner):null,re=V&&K?s(V.owner):null,ie=!!(V&&K&&re),A=ie?K.props??{}:u,ae=ie?e=>N.replaceComponent(re.zone,re.index,{...K,props:e}):Re,M=ie?V.kind:Ke(d?.type,o),S=ye(A,M),m=[{partKey:M,face:Q(A,M,_,I),sizeGroup:_?.sizeGroup??null,base:_?.base??tt,style:S}],Ee=kn(m,e=>e.sizeGroup),rt=an(_?.inks),L=(e,a)=>{let h=A;for(const T of m)h=U(h,T.partKey,e,a);ae(h)},it=e=>e?L("textStyle",e):ce({textStyle:null,role:null}),ce=e=>{let a=A;for(const h of m)for(const[T,C]of Object.entries(e))a=U(a,h.partKey,T,C??null);ae(a)},de=v==="text"||v==="textarea",{text:Ie,hidden:B}=J(te),$=g?.[$t]?.label??o,ze=B?l("Show {label} on the slide",{label:l($)}):l("Hide {label} on the slide",{label:l($)}),Fe=y("div",{className:"sf-field-head",children:[n(Ot,{}),n("span",{className:"sf-field-label sf-field-label--inline",children:l($)}),de&&n(It,{content:ze,children:n(Et,{"aria-pressed":B,"aria-label":ze,onClick:()=>se({text:Ie,hidden:!B}),children:B?n(We,{name:"eye-off",size:14}):n(We,{name:"eye",size:14})})})]}),X=!ve&&Te,at=!!v&&(Mt(g)||ve||B||!Te),_e=Q(A,M,_,I),ct=_e.kind==="role"?_e.role:null,ue=Ge(S)??Wt(ct),Ve=He(k.saved,k.old),dt=Object.entries(S).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,ut=()=>{let e=A;for(const a of m){const{role:h,textStyle:T}=a.style;e=sn(e,a.partKey),h&&(e=U(e,a.partKey,"role",h)),T&&(e=U(e,a.partKey,"textStyle",T))}ae(e)},O=ue,ft=Lt(m[0].style),pt=O?Ve.find(e=>e.id===O)?.name??O:"",mt=()=>{Z(!1),O&&(k.write(Ut({saved:k.saved,old:k.old,styleId:O,values:Bt(m[0].style)}),!0),ut())};return y(Rn,{sectionName:Pe?.label??d.type,onBack:r,tabs:e=>n(me,{motion:le,body:e}),textEditor:f("words")?n("div",{ref:be,className:"sf-part-text",children:at?n(zt,{text:Ie,onTextChange:e=>se(de?{text:e,hidden:B}:e),multiline:Qt(v),markup:v!=="plainText",styled:!1,style:m[0].style,base:m[0].base,setValue:ce,colors:rt,placeholder:Se(Zt(g))??void 0,ariaLabel:l($),head:Fe,typedOnCanvas:x===F}):v?de?Fe:null:n(vt,{field:g,name:o,value:st,onChange:se,id:`sf-part-${t}-${o}`})}):void 0,children:[ee&&f("sourceNote")&&n(Je,{source:ee,slug:ge(u),menuId:Sn(u)}),X&&n(Be,{style:f("style")?{value:ue??"",options:Xe(Ve),onChange:e=>it(e||null),changed:dt>0,onEditStyles:i,onUpdateStyle:O&&ft?()=>Z(!0):void 0}:void 0,font:f("font")?{value:S.font??"",styleValue:he(m[0].base.fontKey)?.label,options:Yt.map(e=>({label:e.label,value:e.key})),onChange:e=>L("font",e||null)}:void 0,italic:f("italic")?{value:S.italic,styleValue:_n(D,ue),onChange:e=>L("italic",e??null)}:void 0,cells:Ue(m[0].style,m[0].base,ce,q(W)).filter(e=>f(e.key)),align:f("align")?q(W)==="mobile"?{value:S.alignPhone??"",styleValue:S.align??m[0].base.align,onChange:e=>L("alignPhone",e||null)}:{value:S.align??"",styleValue:m[0].base.align,onChange:e=>L("align",e||null)}:void 0,letterCase:f("letterCase")?{value:S.case??"",styleValue:m[0].base.case,onChange:e=>L("case",e||null)}:void 0}),ot&&O&&n(Vt,{styleName:pt,onCancel:()=>Z(!1),onConfirm:mt}),X&&Ee===null&&f("fixedSizeHint")&&n("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),qe(Cn,e=>f(e)&&(e==="words"||(e==="sourceNote"?!!ee:e==="fixedSizeHint"?X&&Ee===null:X)))&&n(Me,{})]})}function _n(t,o){return!o||!Array.isArray(t)?!1:t.find(i=>i?.id===o)?.values?.italic===!0}const tt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{Rn as PartPanelBody,Je as PartSourceNote,On as PartStyleSelect,Fn as default,Q as partFace};
1
+ "use client";import{jsx as n,Fragment as W,jsxs as y}from"react/jsx-runtime";import{useContext as bt,useEffect as pe,useRef as Pt,useState as Le}from"react";import{FieldSelect as wt,InspectorField as vt,fieldShownInView as Tt}from"efficient-easel/fields";import{SettingsField as Nt}from"efficient-easel/panel";import{InspectorUpLevel as Y}from"efficient-easel/chrome";import{StylesIcon as kt,TypeIcon as Ot}from"efficient-easel/icons";import{useEasel as Ct}from"efficient-easel/easel";import{TextPartPanel as Be}from"efficient-easel/copy";import{Button as Rt,IconButton as Et,Tooltip as It}from"efficient-shell/ui";import{PartTextBox as zt,partTextCells as He}from"./PartTextBox.js";import{SiteFields as me}from"./SiteFields.js";import{usePartMotion as Ft}from"./usePartMotion.js";import{UiIcon as Ue}from"efficient-easel/draw/client";import{usePreviewHeader as _t}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as Vt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as At}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as Lt,partStyleToTextStyleValues as Bt,pushIntoStyle as Ht,resolveTextStyles as We,styleIdOfRole as Ut}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as Wt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as jt}from"../lib/theme-row-persist.js";import{usePreviewDevice as Dt}from"efficient-easel/draw/client";import{shownTier as q}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as je,partRowHasTabletValue as Gt}from"../lib/document/part-panel-rows.js";import{usePartStyle as Kt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as J,textFieldOffPage as Mt,textFieldPanelOnly as $t}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as Xt}from"efficient-easel/draw";import{useSectionOps as Yt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as qt,FONT_ROLES as Jt,FONT_ROLE_LABELS as De,fontOption as he,fontRoleOf as Qt}from"../../format/lib/fonts.js";import{isMultilineKind as Zt,partPlaceholder as en,typeInPlaceKind as tn}from"../../render/lib/document/part-text.js";import{partRowField as nn}from"../lib/document/part-row-field.js";import{decodePartKey as on,partPropsWithRowValue as ln,partRowValue as sn}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Ge,propsWithPartStyleValue as H,propsWithoutPartStyle as rn,readPartStyle as ye,regionHasOwnLook as an}from"../../render/lib/document/part-styles.js";import{partThemeColors as cn}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Ke}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as dn}from"../lib/document/part-typing.js";import{keysOnCanvas as un,useCanvasTypingPart as fn}from"../lib/document/canvas-typing.js";import{useEaselHost as pn}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as mn,SOURCE_ACTIONS as hn,SOURCE_ACTION_LABEL as yn,partSourceNoteFor as gn,partSourceOf as Sn,sourceMenuIdOf as xn,sourceSlugOf as ge}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as bn,holdsAuthoredText as Pn}from"../../render/lib/document/text-parts.js";import{regionsForSection as wn}from"../../format/lib/sections/section-text-regions.js";import{regionTakesSize as vn,textRegionOfPartKey as Tn}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as Me}from"./SameInEveryViewNote.js";function Se(t){return t?l(t):null}function $e(t){return t.kind==="role"?De[t.role]:t.kind==="custom"?"Custom":null}function Nn(t){const o=Qt(t.role);return o?{kind:"role",role:o}:null}function kn(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 Q(t,o,r,i){return Nn(ye(t,o))??kn(r,i)}function On(t,o){if(!t.length)return null;const r=o(t[0]);return t.every(i=>o(i)===r)?r:null}function Xe(t){return[{value:j,label:l("No style"),description:l("Section’s own")},...t.map(o=>({value:o.id,label:o.name,description:o.values.font?he(o.values.font)?.label:void 0}))]}const j="";function Cn({face:t,base:o,onPick:r}){const i=t.kind==="role"?t.role:j,c=[{label:l("No style"),value:j},...Jt.map(s=>({label:l(De[s]),value:s}))];return n(wt,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:s=>r(s===j?null:s),renderOption:s=>s.value===j?y(W,{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(${he(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:Se($e(t))}),valueText:s=>Se($e(t))??s?.label??""})}const Ye=["regionNote","regionStyle"],Rn=Object.keys(je).filter(t=>!Ye.includes(t));function qe(t,o){return!t.some(o)}function En({sectionName:t,onBack:o,textEditor:r,styleRow:i,children:c,tabs:s}){const E=y(W,{children:[r,i,c]});return y("div",{className:"sf-part-panel",children:[n(Y,{inline:!0,name:l(t),onSelect:o}),s?s(E):E]})}function Je({source:t,slug:o,menuId:r}){const i=pn(),c=hn[t],s=!c.needsSlug||!!o;return n("div",{className:"sf-note sf-note--source",children:y("p",{className:"es-field-hint sf-hint-keep",children:[l(mn[t]),s?y(W,{children:[" ",n(Rt,{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(yn)})]}):null]})})}const Qe=4,In=120;function Ze(t){return 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()})}function et({region:t,sizePx:o,face:r,base:i,onFollowStyle:c,source:s,slug:E,onBack:N,shows:x,sizedStyle:b,ownLook:I}){const D=t.follows;return y("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l(t.label)})}),x("regionNote")&&!I&&n("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(D),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(D)})}),b?y(W,{children:[b,x("regionStyle")&&n("p",{className:"es-field-hint sf-hint-keep",children:Ze(t)})]}):c?x("regionStyle")?n(W,{children:n(Nt,{label:l("Style"),icon:n(kt,{}),hint:Ze(t),children:n(Cn,{face:r,base:i,onPick:c})})}):null:x("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&&x("sourceNote")?n(Je,{source:s,slug:E}):null,qe([...Ye,"sourceNote",...b?["fontSize"]:[]],z=>x(z)&&(z!=="sourceNote"||!!s))&&n(Me,{}),n(Y,{inline:!0,name:l("Page"),onSelect:N})]})}function zn({onBack:t}){return y("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(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function Fn({onBack:t,partId:o,why:r}){return y("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:y("code",{children:[o," — ",r]})}),n(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function _n({nodeId:t,propKey:o,onBack:r,onEditStyle:i}){const{getItemById:c,getSelectorForId:s,config:E}=Ct(e=>e),N=Yt(),x=fn(),{partStyle:b}=Kt(),{fonts:I,textStyles:D}=_t(),z=bt(At),xe=!z?.capabilities?.hasSiteTheme,{persist:nt}=jt({themeFromDocument:xe,tokenRef:z?.tokenRef,siteId:z?.siteId??null}),k=Wt({themeFromDocument:xe,persist:nt}),[ot,Z]=Le(!1),U=Dt(),f=e=>(q(U)!=="tablet"||Gt(e))&&Tt(je[e],U),be=Pt(null),d=c(t),p=s(t),Pe=d?E.components[d.type]:void 0,{key:P,row:w}=on(o),we=Pe?.fields?.[P],g=w?nn(we,w):we,F=bn(t,o),u=d?.props??{},v=tn(g),ve=Mt(g),Te=Pn(g),Ne=d?Sn(d.type):null,ee=d?gn(d.type,P):null,te=w?sn(u[P],w):u[P],ke=!!w&&!(Array.isArray(u[P])&&w.index<u[P].length);pe(()=>{if(un(document))return;be.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[F]);const[ne,Oe]=Le(0);pe(()=>Oe(0),[F]);const oe=!!d&&!ke&&(!p||!g);pe(()=>{if(!oe||ne>=Qe)return;const e=setTimeout(()=>Oe(a=>a+1),In);return()=>clearTimeout(e)},[oe,ne]);const lt=oe&&ne<Qe,le=Ft(t,Ke(d?.type,o),"textPart");if(!d||ke)return n(zn,{onBack:r});const G=wn(d.type),Ce=G?Tn(G,o):null;if(G&&Ce){const e=b?.partId===F?b:null,a=G[Ce],h=a.writable===!0&&!!p,T=C=>{p&&N.replaceComponent(p.zone,p.index,{...d,props:H(u,o,"role",C)})};if(h&&vn(a)){const C=ye(u,o),Ae=R=>{if(!p)return;let fe=u;for(const[St,xt]of Object.entries(R))fe=H(fe,o,St,xt??null);N.replaceComponent(p.zone,p.index,{...d,props:fe})},ht=We(k.saved,k.old),yt=Ge(C)??"",gt=He(C,e?.base??tt,Ae,q(U)).filter(R=>R.key==="fontSize"&&f(R.key));return n(me,{motion:le,body:n(et,{region:a,sizePx:e?.base.sizePx??null,face:Q(u,o,e,I),base:e?.base??null,source:Ne,slug:ge(u),onBack:r,shows:f,ownLook:an(C),sizedStyle:n(Be,{style:f("style")?{value:yt,options:Xe(ht),onChange:R=>Ae(R?{textStyle:R}:{textStyle:null,role:null}),onEditStyles:i}:void 0,cells:gt})})})}return n(me,{motion:le,body:n(et,{region:a,sizePx:e?.base.sizePx??null,face:Q(u,o,e,I),base:e?.base??null,onFollowStyle:h?T:void 0,source:Ne,slug:ge(u),onBack:r,shows:f})})}if(!p||!g)return lt?n("div",{className:"sf-note","aria-busy":"true"}):n(Fn,{onBack:r,partId:F,why:p?"no field":"no selector"});const Re=e=>{N.replaceComponent(p.zone,p.index,{...d,props:e})},se=e=>{if(J(e).hidden!==J(te).hidden||!v){const h=w?ln(u,P,w,e):{...u,[P]:e};h&&Re(h);return}dn({node:d,propKey:o,kind:v,zone:p.zone,index:p.index},J(e).text,N.replaceComponent)},st=te,_=b?.partId===F?b:null,V=_?.styleOwner,K=V?c(V.owner):null,re=V&&K?s(V.owner):null,ie=!!(V&&K&&re),A=ie?K.props??{}:u,ae=ie?e=>N.replaceComponent(re.zone,re.index,{...K,props:e}):Re,M=ie?V.kind:Ke(d?.type,o),S=ye(A,M),m=[{partKey:M,face:Q(A,M,_,I),sizeGroup:_?.sizeGroup??null,base:_?.base??tt,style:S}],Ee=On(m,e=>e.sizeGroup),rt=cn(_?.inks),L=(e,a)=>{let h=A;for(const T of m)h=H(h,T.partKey,e,a);ae(h)},it=e=>e?L("textStyle",e):ce({textStyle:null,role:null}),ce=e=>{let a=A;for(const h of m)for(const[T,C]of Object.entries(e))a=H(a,h.partKey,T,C??null);ae(a)},de=v==="text"||v==="textarea",{text:Ie,hidden:B}=J(te),$=g?.[Xt]?.label??o,ze=B?l("Show {label} on the slide",{label:l($)}):l("Hide {label} on the slide",{label:l($)}),Fe=y("div",{className:"sf-field-head",children:[n(Ot,{}),n("span",{className:"sf-field-label sf-field-label--inline",children:l($)}),de&&n(It,{content:ze,children:n(Et,{"aria-pressed":B,"aria-label":ze,onClick:()=>se({text:Ie,hidden:!B}),children:B?n(Ue,{name:"eye-off",size:14}):n(Ue,{name:"eye",size:14})})})]}),X=!ve&&Te,at=!!v&&($t(g)||ve||B||!Te),_e=Q(A,M,_,I),ct=_e.kind==="role"?_e.role:null,ue=Ge(S)??Ut(ct),Ve=We(k.saved,k.old),dt=Object.entries(S).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,ut=()=>{let e=A;for(const a of m){const{role:h,textStyle:T}=a.style;e=rn(e,a.partKey),h&&(e=H(e,a.partKey,"role",h)),T&&(e=H(e,a.partKey,"textStyle",T))}ae(e)},O=ue,ft=Lt(m[0].style),pt=O?Ve.find(e=>e.id===O)?.name??O:"",mt=()=>{Z(!1),O&&(k.write(Ht({saved:k.saved,old:k.old,styleId:O,values:Bt(m[0].style)}),!0),ut())};return y(En,{sectionName:Pe?.label??d.type,onBack:r,tabs:e=>n(me,{motion:le,body:e}),textEditor:f("words")?n("div",{ref:be,className:"sf-part-text",children:at?n(zt,{text:Ie,onTextChange:e=>se(de?{text:e,hidden:B}:e),multiline:Zt(v),markup:v!=="plainText",styled:!1,style:m[0].style,base:m[0].base,setValue:ce,colors:rt,placeholder:Se(en(g))??void 0,ariaLabel:l($),head:Fe,typedOnCanvas:x===F}):v?de?Fe:null:n(vt,{field:g,name:o,value:st,onChange:se,id:`sf-part-${t}-${o}`})}):void 0,children:[ee&&f("sourceNote")&&n(Je,{source:ee,slug:ge(u),menuId:xn(u)}),X&&n(Be,{style:f("style")?{value:ue??"",options:Xe(Ve),onChange:e=>it(e||null),changed:dt>0,onEditStyles:i,onUpdateStyle:O&&ft?()=>Z(!0):void 0}:void 0,font:f("font")?{value:S.font??"",styleValue:he(m[0].base.fontKey)?.label,options:qt.map(e=>({label:e.label,value:e.key})),onChange:e=>L("font",e||null)}:void 0,italic:f("italic")?{value:S.italic,styleValue:Vn(D,ue),onChange:e=>L("italic",e??null)}:void 0,cells:He(m[0].style,m[0].base,ce,q(U)).filter(e=>f(e.key)),align:f("align")?q(U)==="mobile"?{value:S.alignPhone??"",styleValue:S.align??m[0].base.align,onChange:e=>L("alignPhone",e||null)}:{value:S.align??"",styleValue:m[0].base.align,onChange:e=>L("align",e||null)}:void 0,letterCase:f("letterCase")?{value:S.case??"",styleValue:m[0].base.case,onChange:e=>L("case",e||null)}:void 0}),ot&&O&&n(Vt,{styleName:pt,onCancel:()=>Z(!1),onConfirm:mt}),X&&Ee===null&&f("fixedSizeHint")&&n("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),qe(Rn,e=>f(e)&&(e==="words"||(e==="sourceNote"?!!ee:e==="fixedSizeHint"?X&&Ee===null:X)))&&n(Me,{})]})}function Vn(t,o){return!o||!Array.isArray(t)?!1:t.find(i=>i?.id===o)?.values?.italic===!0}const tt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{En as PartPanelBody,Je as PartSourceNote,Cn as PartStyleSelect,_n as default,Q as partFace};
@@ -1 +1 @@
1
- "use client";import{jsx as c,jsxs as x}from"react/jsx-runtime";import{COPY_CELLS as t,CopyBox as S}from"efficient-easel/copy";import{PaddingYIcon as z}from"efficient-easel/icons";import{say as C}from"../../format/lib/editor-words.js";import{SHOP_MARKUP as _}from"../../format/lib/markup.js";import{partTextTools as A}from"../lib/document/canvas-typing.js";import{PART_PADDING_MAX as T,PART_PADDING_MIN as v,PART_PADDING_STEP as R,partSpacingOf as k}from"../../render/lib/document/part-styles.js";const D=["left","center","right","justify"];function H(n,a,i,r="desktop"){const o=k(n),l=r==="mobile",p=(l?n.sizePhone:void 0)??n.size??a.sizePx;return[l?{...t.fontSize,key:"fontSize",value:n.sizePhone,styleValue:Math.round(a.sizePx),onChange:e=>i({sizePhone:e??null})}:{...t.fontSize,key:"fontSize",value:n.size,styleValue:Math.round(a.sizePx),onChange:e=>i({size:e??null})},{...t.lineHeight,key:"lineHeight",value:o.lineHeight,styleValue:a.lineRatio,onChange:e=>i(e===void 0?{lineHeight:null,line:null}:{lineHeight:e})},{...t.letterSpacing,key:"letterSpacing",scale:p,value:o.letterSpacingEm,styleValue:a.letterEm,onChange:e=>i(e===void 0?{letterSpacing:null,letter:null}:{letterSpacing:e})},{...t.paragraphSpacing,key:"paragraphSpacing",value:n.paragraphSpacing,styleValue:0,onChange:e=>i({paragraphSpacing:e??null})},{key:"padding",name:C("Padding"),icon:c(z,{}),unit:"px",step:R,shiftStep:10,min:v,max:T,value:n.padding,styleValue:a.paddingPx,onChange:e=>i({padding:e??null})}]}function E({text:n,onTextChange:a,multiline:i,markup:r=!0,styled:o=!0,style:l,base:p,setValue:e,colors:u,placeholder:s,ariaLabel:h,head:d,typedOnCanvas:f=!1}){const P=H(l,p,e),m=A(r,i);return x("div",{className:"sf-part-textbox",children:[d,c(S,{value:n,onChange:a,multiline:i,placeholder:s,ariaLabel:h,rules:_,tools:m,barShows:f?"focus":"always",colors:r?u:[],align:o?{value:l.align??p.align,allow:D,onChange:g=>e({align:g})}:void 0,letterCase:o?{value:l.case==="capitalize"?"":l.case??"",onChange:g=>e({case:g||null})}:void 0,cells:o?P:void 0})]})}export{E as PartTextBox,H as partTextCells};
1
+ "use client";import{jsx as s,jsxs as P}from"react/jsx-runtime";import{COPY_CELLS as c,CopyBox as C}from"efficient-easel/copy";import{partColourName as _}from"../../format/lib/document/part-inks.js";import{PaddingYIcon as z}from"efficient-easel/icons";import{say as u}from"../../format/lib/editor-words.js";import{SHOP_MARKUP as A}from"../../format/lib/markup.js";import{partTextTools as T}from"../lib/document/canvas-typing.js";import{PART_PADDING_MAX as v,PART_PADDING_MIN as N,PART_PADDING_STEP as D,partSizeBoxOf as O,partSizeFollowed as R,partSpacingOf as k}from"../../render/lib/document/part-styles.js";import{onDesktopWords as w}from"efficient-easel/screen/lib/document/box-fields";const H=["left","center","right","justify"];function I(n,o,i,r="desktop"){const t=k(n),a=O(r),p=n[a]??n.size??o.sizePx,l=R(n,r);return[{...c.fontSize,key:"fontSize",value:n[a],styleValue:Math.round(o.sizePx),onChange:e=>i({[a]:e??null}),...a==="size"?{}:{reset:{detail:l?w(e=>u(e),`${l.px}px`,l.view):void 0}}},{...c.lineHeight,key:"lineHeight",value:t.lineHeight,styleValue:o.lineRatio,onChange:e=>i(e===void 0?{lineHeight:null,line:null}:{lineHeight:e})},{...c.letterSpacing,key:"letterSpacing",scale:p,value:t.letterSpacingEm,styleValue:o.letterEm,onChange:e=>i(e===void 0?{letterSpacing:null,letter:null}:{letterSpacing:e})},{...c.paragraphSpacing,key:"paragraphSpacing",value:n.paragraphSpacing,styleValue:0,onChange:e=>i({paragraphSpacing:e??null})},{key:"padding",name:u("Padding"),icon:s(z,{}),unit:"px",step:D,shiftStep:10,min:N,max:v,value:n.padding,styleValue:o.paddingPx,onChange:e=>i({padding:e??null})}]}function F({text:n,onTextChange:o,multiline:i,markup:r=!0,styled:t=!0,style:a,base:p,setValue:l,colors:e,placeholder:d,ariaLabel:f,head:m,typedOnCanvas:h=!1}){const x=I(a,p,l),S=T(r,i);return P("div",{className:"sf-part-textbox",children:[m,s(C,{value:n,onChange:o,multiline:i,placeholder:d,ariaLabel:f,rules:A,tools:S,barShows:h?"focus":"always",colors:r?e:[],colorNameOf:_,align:t?{value:a.align??p.align,allow:H,onChange:g=>l({align:g})}:void 0,letterCase:t?{value:a.case==="capitalize"?"":a.case??"",onChange:g=>l({case:g||null})}:void 0,cells:t?x:void 0})]})}export{F as PartTextBox,I as partTextCells};
@@ -1 +1 @@
1
- "use client";import{jsx as Y}from"react/jsx-runtime";import{readInks as $}from"../../format/lib/document/part-inks.js";import{useEffect as j,useRef as x}from"react";import{markOverlayPortal as G}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as q}from"efficient-easel/draw/client";import{usePartStyle as U}from"./PreviewPartStyleContext.js";import{usePreviewDevice as V}from"efficient-easel/draw/client";import{decodePartId as I,encodePartId as Q}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as X}from"efficient-easel/canvas";import{engagePartAnchors as Z}from"../lib/document/part-anchors.js";import{PART_ATTR as P,PART_STYLE_KIND_ATTR as b,PART_STYLE_OWNER_ATTR as tt,partStyleOwnerOf as g}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as D,applyPartStyles as C,blockDrawsTextStyle as F,partFontKeyOf as et,partShownDeclarations as rt,partStyleBase as ot,partStyleSource as nt,storedPartStyle as st}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as it,styleRoleOfClassName as lt}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as k}from"../../format/lib/theme.js";import{styleKeyForPart as A}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as at,PART_HOST_ATTR as ct}from"../../render/lib/animation/part-motion.js";import{paintPartMotion as pt}from"../lib/document/part-motion-canvas.js";function ft(p){let s=null,o=null;for(let e=p;e&&(s===null||o===null);e=e.parentElement){const r=e.getAttribute("class");s??=lt(r),o??=k(r)}return{faceRole:s??"body",sizeGroup:o}}function z(p,s={}){const o=p.style,e={};for(const n of D)e[n]=o[n]??"",o[n]="";s.fontFamily&&(o.fontFamily=s.fontFamily),s.fontSize&&(o.fontSize=s.fontSize);const r=getComputedStyle(p),S=getComputedStyle(p.ownerDocument.documentElement),a=ot({fontSize:r.fontSize,fontWeight:r.fontWeight,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing,textAlign:r.textAlign,textTransform:r.textTransform,paddingTop:r.paddingTop},et(r.fontFamily,n=>S.getPropertyValue(n)));for(const n of D)o[n]=e[n];return a}function ut({needles:p,styles:s,motions:o=at,type:e,children:r}){const S=x(null),{selectedPartId:a}=q(),{setPartStyle:n}=U(),y=V()==="mobile",h=JSON.stringify(p),R=JSON.stringify(s),w=JSON.stringify(o),J=x(new Map);return j(()=>{const d=S.current;if(!d)return;const E=[],_=()=>d.parentElement,M=c=>{const i=_();if(!i)return null;const u=new MutationObserver(c);return u.observe(i,{attributes:!0,attributeFilter:[X]}),()=>u.disconnect()},L=c=>{const i=new MutationObserver(c);return i.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>i.disconnect()};let f=[];E.push(()=>{for(const c of f)c();f=[]});const W=JSON.parse(h),T=JSON.parse(R),B=JSON.parse(w),H=Z(d,W,_,M,(c,i,u)=>{for(const t of f)t();f=[];const K=[];for(const t of u){const l=t,m=G(l);m&&f.push(m),l.getAttribute(P)===a&&K.push(l)}const N=nt(i,a,K,t=>it(t)!==null||k(t)!==null);if(N&&a){const t=N,l=I(a)?.propKey??"",m=g(t)?{}:rt(st(T,A(e,l)),y,{blockDrawsStyle:F(e,l)});n({partId:a,...ft(t),base:z(t,m),inks:$(t),...(()=>{const v=g(t);return v?{styleOwner:v}:{}})()})}C(u.filter(t=>!g(t)).map(t=>({element:t,partId:t.getAttribute(P)??""})),T,t=>z(t),t=>A(e,t),void 0,y,t=>F(e,t));const O=[...d.querySelectorAll(`[${tt}="${CSS.escape(i)}"][${b}]`)];O.length&&C(O.map(t=>({element:t,partId:Q(i,t.getAttribute(b)??"")})),T,void 0,t=>t,void 0,y),f.push(pt([...u.filter(t=>!g(t)).map(t=>{const l=t,m=I(l.getAttribute(P)??"")?.propKey??"";return{element:l,partKey:A(e,m)}}),...O.map(t=>({element:t,partKey:t.getAttribute(b)??""}))],t=>B[t],y,J.current))},L);return()=>{H();for(const c of E)c()}},[h,R,w,a,n,y,e]),Y("div",{ref:S,[ct]:"",style:{display:"contents"},children:r})}export{ut as default,z as measureStyleBase,ft as styleTagsOf};
1
+ "use client";import{jsx as Y}from"react/jsx-runtime";import{readInks as $}from"../../format/lib/document/part-inks.js";import{useEffect as j,useRef as x}from"react";import{markOverlayPortal as G}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as q}from"efficient-easel/draw/client";import{usePartStyle as U}from"./PreviewPartStyleContext.js";import{usePreviewDevice as V}from"efficient-easel/draw/client";import{shownTier as Q}from"efficient-easel/screen/lib/document/device-fields";import{decodePartId as I,encodePartId as X}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as Z}from"efficient-easel/canvas";import{engagePartAnchors as tt}from"../lib/document/part-anchors.js";import{PART_ATTR as P,PART_STYLE_KIND_ATTR as b,PART_STYLE_OWNER_ATTR as et,partStyleOwnerOf as g}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as D,applyPartStyles as C,blockDrawsTextStyle as F,partFontKeyOf as rt,partShownDeclarations as ot,partStyleBase as nt,partStyleSource as st,storedPartStyle as it}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as lt,styleRoleOfClassName as at}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as k}from"../../format/lib/theme.js";import{styleKeyForPart as A}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as ct,PART_HOST_ATTR as pt}from"../../render/lib/animation/part-motion.js";import{paintPartMotion as ft}from"../lib/document/part-motion-canvas.js";function ut(p){let s=null,o=null;for(let e=p;e&&(s===null||o===null);e=e.parentElement){const r=e.getAttribute("class");s??=at(r),o??=k(r)}return{faceRole:s??"body",sizeGroup:o}}function z(p,s={}){const o=p.style,e={};for(const n of D)e[n]=o[n]??"",o[n]="";s.fontFamily&&(o.fontFamily=s.fontFamily),s.fontSize&&(o.fontSize=s.fontSize);const r=getComputedStyle(p),S=getComputedStyle(p.ownerDocument.documentElement),a=nt({fontSize:r.fontSize,fontWeight:r.fontWeight,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing,textAlign:r.textAlign,textTransform:r.textTransform,paddingTop:r.paddingTop},rt(r.fontFamily,n=>S.getPropertyValue(n)));for(const n of D)o[n]=e[n];return a}function mt({needles:p,styles:s,motions:o=ct,type:e,children:r}){const S=x(null),{selectedPartId:a}=q(),{setPartStyle:n}=U(),y=Q(V()),h=JSON.stringify(p),R=JSON.stringify(s),w=JSON.stringify(o),J=x(new Map);return j(()=>{const d=S.current;if(!d)return;const E=[],_=()=>d.parentElement,M=c=>{const i=_();if(!i)return null;const u=new MutationObserver(c);return u.observe(i,{attributes:!0,attributeFilter:[Z]}),()=>u.disconnect()},L=c=>{const i=new MutationObserver(c);return i.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>i.disconnect()};let f=[];E.push(()=>{for(const c of f)c();f=[]});const W=JSON.parse(h),T=JSON.parse(R),B=JSON.parse(w),H=tt(d,W,_,M,(c,i,u)=>{for(const t of f)t();f=[];const v=[];for(const t of u){const l=t,m=G(l);m&&f.push(m),l.getAttribute(P)===a&&v.push(l)}const K=st(i,a,v,t=>lt(t)!==null||k(t)!==null);if(K&&a){const t=K,l=I(a)?.propKey??"",m=g(t)?{}:ot(it(T,A(e,l)),y,{blockDrawsStyle:F(e,l)});n({partId:a,...ut(t),base:z(t,m),inks:$(t),...(()=>{const N=g(t);return N?{styleOwner:N}:{}})()})}C(u.filter(t=>!g(t)).map(t=>({element:t,partId:t.getAttribute(P)??""})),T,t=>z(t),t=>A(e,t),void 0,y,t=>F(e,t));const O=[...d.querySelectorAll(`[${et}="${CSS.escape(i)}"][${b}]`)];O.length&&C(O.map(t=>({element:t,partId:X(i,t.getAttribute(b)??"")})),T,void 0,t=>t,void 0,y),f.push(ft([...u.filter(t=>!g(t)).map(t=>{const l=t,m=I(l.getAttribute(P)??"")?.propKey??"";return{element:l,partKey:A(e,m)}}),...O.map(t=>({element:t,partKey:t.getAttribute(b)??""}))],t=>B[t],y==="mobile",J.current))},L);return()=>{H();for(const c of E)c()}},[h,R,w,a,n,y,e]),Y("div",{ref:S,[pt]:"",style:{display:"contents"},children:r})}export{mt as default,z as measureStyleBase,ut as styleTagsOf};
@@ -1,4 +1,4 @@
1
- import type { WordStyleColour } from "../../format/lib/word-styles.js";
1
+ import type { ColorSlot } from "efficient-shell/markup";
2
2
  import { type ReactNode } from "react";
3
3
  import type { FontRole } from "../../format/lib/fonts.js";
4
4
  import type { PartStyleBase } from "../../render/lib/document/part-styles.js";
@@ -8,7 +8,7 @@ export type PartStyleReading = {
8
8
  faceRole: FontRole;
9
9
  sizeGroup: TypeGroup | null;
10
10
  base: PartStyleBase;
11
- inks?: Partial<Record<WordStyleColour, string>>;
11
+ inks?: Partial<Record<ColorSlot, string>>;
12
12
  styleOwner?: {
13
13
  owner: string;
14
14
  kind: string;
@@ -1 +1 @@
1
- "use client";import{jsx as x}from"react/jsx-runtime";import{useEffect as E,useRef as _}from"react";import{markOverlayPortal as I}from"../../format/lib/document/overlay-portal.js";import{measureStyleBase as O,styleTagsOf as w}from"./PreviewPartAnchors.js";import{usePreviewDevice as D,usePreviewParts as K}from"efficient-easel/draw/client";import{usePartStyle as N}from"./PreviewPartStyleContext.js";import{REGION_PART_ATTR as R,encodePartId as j}from"../../render/lib/document/text-parts.js";import{TEXT_REGION_ATTR as b,textRegionOfAttr as B,textRegionPartKey as C}from"../../format/lib/sections/text-regions.js";import{regionsForSection as G}from"../../format/lib/sections/section-text-regions.js";import{TEXT_STYLE_ATTR as n,isTextStyleId as X,regionCanvasDeclarations as k,regionCanvasRestore as q,regionSheetStyle as J,regionShownDeclarations as L}from"../../render/lib/document/part-styles.js";function Y({nodeId:s,sectionType:c,partStyles:m,children:v}){const y=_(null),{selectedPartId:u}=K(),{setPartStyle:p}=N(),f=D()==="mobile",z=JSON.stringify(m??null);return E(()=>{const S=y.current,o=G(c);if(!S||!s||!o)return;const l=[],d=Array.from(S.querySelectorAll(`[${b}]`));for(const t of d){const r=B(o,t.getAttribute(b));if(!r)continue;const g=I(t);g&&l.push(g);const A=C(r),a=j(s,A);t.setAttribute(R,a);const i=m?.[A];if(o[r].sized&&J(i)){const e=k(i,f),F={fontFamily:t.style.fontFamily,fontSize:t.style.fontSize},T=t.getAttribute(n);e.fontFamily&&(t.style.fontFamily=e.fontFamily),e.fontSize&&(t.style.fontSize=e.fontSize);const h={fontFamily:e.fontFamily?t.style.fontFamily:void 0,fontSize:e.fontSize?t.style.fontSize:void 0},P=i?.textStyle;X(P)&&t.setAttribute(n,P),l.push(()=>{q(t.style,F,h),T===null?t.removeAttribute(n):t.setAttribute(n,T)})}if(a===u){const e=O(t,L(i,o[r],f));p({partId:a,...w(t),base:e})}}return()=>{for(const t of l)t();for(const t of d)t.removeAttribute(R)}},[s,c,u,p,f,z]),x("div",{ref:y,style:{display:"contents"},children:v})}export{Y as default};
1
+ "use client";import{jsx as x}from"react/jsx-runtime";import{useEffect as E,useRef as _}from"react";import{markOverlayPortal as I}from"../../format/lib/document/overlay-portal.js";import{measureStyleBase as O,styleTagsOf as w}from"./PreviewPartAnchors.js";import{shownTier as D}from"efficient-easel/screen/lib/document/device-fields";import{usePreviewDevice as K,usePreviewParts as N}from"efficient-easel/draw/client";import{usePartStyle as j}from"./PreviewPartStyleContext.js";import{REGION_PART_ATTR as R,encodePartId as B}from"../../render/lib/document/text-parts.js";import{TEXT_REGION_ATTR as v,textRegionOfAttr as C,textRegionPartKey as G}from"../../format/lib/sections/text-regions.js";import{regionsForSection as X}from"../../format/lib/sections/section-text-regions.js";import{TEXT_STYLE_ATTR as n,isTextStyleId as k,regionCanvasDeclarations as q,regionCanvasRestore as J,regionSheetStyle as L,regionShownDeclarations as Y}from"../../render/lib/document/part-styles.js";function $({nodeId:s,sectionType:c,partStyles:m,children:z}){const y=_(null),{selectedPartId:u}=N(),{setPartStyle:p}=j(),f=D(K()),F=JSON.stringify(m??null);return E(()=>{const S=y.current,o=X(c);if(!S||!s||!o)return;const l=[],d=Array.from(S.querySelectorAll(`[${v}]`));for(const t of d){const r=C(o,t.getAttribute(v));if(!r)continue;const g=I(t);g&&l.push(g);const T=G(r),a=B(s,T);t.setAttribute(R,a);const i=m?.[T];if(o[r].sized&&L(i)){const e=q(i,f),b={fontFamily:t.style.fontFamily,fontSize:t.style.fontSize},A=t.getAttribute(n);e.fontFamily&&(t.style.fontFamily=e.fontFamily),e.fontSize&&(t.style.fontSize=e.fontSize);const h={fontFamily:e.fontFamily?t.style.fontFamily:void 0,fontSize:e.fontSize?t.style.fontSize:void 0},P=i?.textStyle;k(P)&&t.setAttribute(n,P),l.push(()=>{J(t.style,b,h),A===null?t.removeAttribute(n):t.setAttribute(n,A)})}if(a===u){const e=O(t,Y(i,o[r],f));p({partId:a,...w(t),base:e})}}return()=>{for(const t of l)t();for(const t of d)t.removeAttribute(R)}},[s,c,u,p,f,F]),x("div",{ref:y,style:{display:"contents"},children:z})}export{$ as default};
@@ -1 +1 @@
1
- "use client";import{jsx as a}from"react/jsx-runtime";import{TextStyleItem as h,TextStylesGroup as r}from"efficient-easel/text-styles";import{SITE_FONTS as g}from"./SiteTextStylesField.js";import{say as c}from"../../format/lib/editor-words.js";const u=["font","size","weight","emphasis"],p=500;function m({font:i,size:o,weight:t,italic:n}){const e={font:i};return o!==null&&(e.size=o),t!==null&&(e.weight=t),n!==null&&(e.italic=n),{id:"accent",kind:"heading",name:c("Accent"),values:e}}function y(i,o){const t=[],n=i.values,e=o.values;return e.font!==n.font&&e.font!==void 0&&t.push({key:"font",value:e.font}),e.size!==n.size&&t.push({key:"size",value:e.size??null}),e.weight!==n.weight&&t.push({key:"weight",value:e.weight??null}),e.italic!==n.italic&&t.push({key:"italic",value:e.italic??null}),t}function d(i){const{headingWeight:o,open:t,onOpenChange:n,onChange:e,withoutSize:f=!1}=i,s=m(i);return a(r,{label:c("Accent"),children:a(h,{style:s,fonts:g,settings:f?u.filter(l=>l!=="size"):u,auto:["size"],fallback:()=>({weight:o??p}),open:t,onOpenChange:n,onChange:l=>y(s,l).forEach(e)})})}export{y as accentChanges,m as accentTextStyle,d as default};
1
+ "use client";import{jsx as a}from"react/jsx-runtime";import{TextStyleItem as h,TextStylesGroup as r}from"efficient-easel/text-styles";import{SITE_FONTS as p}from"./SiteTextStylesField.js";import{say as u}from"../../format/lib/editor-words.js";const c=["font","size","weight","emphasis"],g=500;function m({font:i,size:s,weight:t,italic:n}){const e={font:i};return s!==null&&(e.size=s),t!==null&&(e.weight=t),n!==null&&(e.italic=n),{id:"accent",kind:"heading",name:u("Emphasis"),values:e}}function y(i,s){const t=[],n=i.values,e=s.values;return e.font!==n.font&&e.font!==void 0&&t.push({key:"font",value:e.font}),e.size!==n.size&&t.push({key:"size",value:e.size??null}),e.weight!==n.weight&&t.push({key:"weight",value:e.weight??null}),e.italic!==n.italic&&t.push({key:"italic",value:e.italic??null}),t}function d(i){const{headingWeight:s,open:t,onOpenChange:n,onChange:e,withoutSize:f=!1}=i,l=m(i);return a(r,{label:u("Emphasis"),children:a(h,{style:l,fonts:p,settings:f?c.filter(o=>o!=="size"):c,auto:["size"],fallback:()=>({weight:s??g}),open:t,onOpenChange:n,onChange:o=>y(l,o).forEach(e)})})}export{y as accentChanges,m as accentTextStyle,d as default};
@@ -1,10 +1,11 @@
1
- import { type TextStyleColour, type TextStyleFont } from "efficient-easel/text-styles";
1
+ import { type TextStyleColour, type TextStyleColourNameOf, type TextStyleFont } from "efficient-easel/text-styles";
2
2
  import { type OldSiteText, type StoredTextStyle } from "../../render/lib/text-styles/site-text-styles.js";
3
3
  export declare const SITE_FONTS: TextStyleFont[];
4
- export default function SiteTextStylesField({ saved, old, colours, sizeOf, onChange, openId, onOpenChange, readOnly, withoutSize, }: {
4
+ export default function SiteTextStylesField({ saved, old, colours, colourNameOf, sizeOf, onChange, openId, onOpenChange, readOnly, withoutSize, }: {
5
5
  saved: unknown;
6
6
  old: OldSiteText;
7
7
  colours: readonly TextStyleColour[];
8
+ colourNameOf: TextStyleColourNameOf;
8
9
  sizeOf: (style: StoredTextStyle) => number;
9
10
  onChange: (next: {
10
11
  saved: StoredTextStyle[];
@@ -1 +1 @@
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
+ "use client";import{jsx as v}from"react/jsx-runtime";import{useState as y}from"react";import{TextStylesList as _}from"efficient-easel/text-styles";import{FONT_OPTIONS as I}from"../../format/lib/fonts.js";import{usePreviewDevice as b}from"efficient-easel/draw/client";import{applyListChange as w,resolveTextStyles as x,toPanelStyles as C}from"../../render/lib/text-styles/site-text-styles.js";const k={desktop:"desktop",tablet:"tablet",mobile:"phone"},p=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],L=["size","lineSpacing","letterSpacing","letterCase"],N=500,A=I.map(e=>({value:e.key,label:e.label,family:`var(${e.cssVar})`,italic:e.italicLoaded}));function F({saved:e,old:s,colours:f,colourNameOf:S,sizeOf:a,onChange:d,openId:l,onOpenChange:m,readOnly:u=!1,withoutSize:g=!1}){const T=b(),[h,E]=y(null),r=x(e,s),n=k[T],c=C(r,a,n);return v(_,{styles:c,onChange:t=>d(w({saved:e,old:s,cur:c,next:t,sizeOf:a,panelView:n})),fonts:A,colours:f,colourNameOf:S,settings:g?p.filter(t=>t!=="size"):p,auto:L,openId:l===void 0?h:l,onOpenChange:m??E,readOnly:u,device:n,fallback:t=>{const i=r.find(O=>O.id===(t.kind==="heading"?"heading-1":"body-1")),o={};return i?.values.font&&t.id!==i.id&&(o.font=i.values.font),t.kind==="heading"&&(o.weight=N),o}})}export{A as SITE_FONTS,F as default};
@@ -1 +1 @@
1
- "use client";import{jsx as o,Fragment as T,jsxs as C}from"react/jsx-runtime";import{useEasel as H,useRootFields as W}from"efficient-easel/easel";import{Inspector as z}from"efficient-easel/fields";import{SettingsGroup as Y}from"efficient-easel/panel";import{useEffect as j,useRef as U,useState as R}from"react";import X from"./ThemeField.js";import q from"./CornersField.js";import K from"./CardShadowField.js";import M from"./ShadowColourField.js";import $,{blockGapRow as V}from"./BlockGapField.js";import J from"./HoverEffectField.js";import Q from"./PhotographyField.js";import Z from"./ShareButtonField.js";import{usePreviewDevice as v}from"efficient-easel/draw/client";import D,{sideSpaceRow as ee}from"./SideSpaceField.js";import{BackgroundWidthRow as te,ContentWidthRow as oe,SITE_BACKGROUND_HINT as ne,SITE_CONTENT_HINT as re}from"./SectionWidthRows.js";import ie from"./SiteAccentField.js";import se from"./SiteTextStylesField.js";import{usePreviewHeader as m}from"../../render/components/PreviewHeaderContext.js";import{Button as ae,EmptyState as ce,Tabs as le,Tooltip as ue,tabButtonId as de,tabPanelId as he}from"efficient-shell/ui";import{ContrastIcon as pe,NoteIcon as fe,SettingsIcon as ge,TypeIcon as me}from"efficient-easel/icons";import{useThemeRowPersist as Se}from"../lib/theme-row-persist.js";import{themeSaveNotice as _e}from"../../format/lib/theme-save-message.js";import{say as p}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as we}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as E}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as xe}from"../lib/document/page-root-fields.js";import{previewFrame as Te}from"efficient-easel/screen/lib/document/preview-dom";import{useSiteTextStylesWriter as Ce}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as be,normalizeCornerRadius as ye,normalizeCornerStyle as Pe,normalizeShadowColor as Re,selectedThemeColors as Ee}from"../../format/lib/theme.js";const F="sf-site-styles",ke="sf-site-styles-tabpanel",Ie=!1,ve="Show hints";function Fe({shown:e,onChange:t}){return o("div",{className:"sf-hints",children:o(ae,{type:"button",variant:"ghost","aria-pressed":e,leftIcon:o(fe,{size:13}),onClick:()=>t(!e),children:p(ve)})})}const Wt="text",A="basics",B="this-page-group",k=[{id:A,label:"Basics",icon:o(ge,{})},{id:"theme",label:"Theme",icon:o(pe,{})},{id:"text",label:"Text",icon:o(me,{})}];function Ge({themeFromDocument:e,persist:t}){const{appState:n,dispatch:r}=H(d=>d),{theme:l,setTheme:s}=m(),u=n.data,h=u.root?.props??{},i=d=>{if(e){const f={...h,theme:d};r({type:"replaceRoot",root:{...u.root,props:f},recordHistory:!0})}else s(d);t({selected_preset:d.selected,theme_presets:d.themes})};return o(X,{value:e?h.theme:l,onChange:i})}function He({themeFromDocument:e,persist:t}){const[n,r]=R(null),{theme:l,setFonts:s,setSizes:u,setHeadingTypography:h}=m(),i=Ce({themeFromDocument:e,persist:t}),{old:d,saved:f,writeRoot:g}=i,S=i.fonts,a=i.sizes,x=i.typography,b=c=>c.values.size??Le(Be[c.id]??"body")??Oe[c.kind],_=c=>i.write(c),I=Ae(l),y=c=>{const w={...S,accent:c};e?g({fonts:w}):s(w),t({accent_font:c})},P=c=>{u({...a,accent:c}),t({accent_size_px:c})},N=c=>{const w={...x,weightStrong:c};e?g({headingTypography:w}):h(w),t({heading_weight_strong:c})},L=c=>{const w={...x,italicStrong:c};e?g({headingTypography:w}):h(w),t({accent_italic:c})};return C(T,{children:[o(se,{saved:f,old:d,colours:I,sizeOf:b,onChange:_,openId:n===G?null:n,onOpenChange:r,withoutSize:e}),o(ie,{font:S.accent,size:a.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:n===G,onOpenChange:c=>r(c?G:null),onChange:c=>{c.key==="font"?y(c.value):c.key==="size"?P(c.value):c.key==="weight"?N(c.value):L(c.value)},withoutSize:e})]})}const G="accent";function Ae(e){const t=Ee(e);return[{key:"accent",name:p("Accent"),value:t.accent},{key:"text",name:p("Text"),value:t.text},{key:"labels",name:p("Labels"),value:t.muted??t.text}]}const Be={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Oe={heading:32,body:14},Ne={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Le(e){if(typeof document>"u")return null;const n=(Te()?.contentDocument??document).querySelector(Ne[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function We({themeFromDocument:e,persist:t,showHint:n}){const{appState:r,dispatch:l}=H(a=>a),{cornerRadiusPx:s,setCornerRadiusPx:u}=m(),h=r.data,i=h.root?.props??{},d=i.cornerRadiusPx===void 0?be[Pe(i.cornerStyle)]:ye(i.cornerRadiusPx),f=e?d:s,g=a=>l({type:"replaceRoot",root:{...h.root,props:{...i,...a}},recordHistory:!0});return o(q,{value:f,onChange:a=>{e?g({cornerRadiusPx:a}):u(a),t({corner_radius_px:a})},showHint:n})}function ze(e){return{site_width:e}}function Ye({persist:e,showHint:t}){const{siteWidth:n,setSiteWidth:r,sectionBackgroundWidth:l,setSectionBackgroundWidth:s,sectionContentWidth:u,setSectionContentWidth:h}=m();if(v()!=="desktop")return null;const d=typeof n=="number"?n:E.default,f=a=>{r(a),e(ze(a),a===null)},g=a=>{s(a),e({section_background_width:a},!0)},S=a=>{h(a),e({section_content_width:a},!0)};return C(T,{children:[o(te,{value:l??"full",changed:l!==null,detail:p("Full width"),onChange:g,onReset:()=>g(null),hint:t?ne:void 0}),o(oe,{mode:u??"content",px:d,min:E.min,max:E.max,changed:typeof n=="number"||u!==null,detail:`${p("Content width")} ${E.default}px`,onMode:S,onPx:a=>f(a),onReset:()=>{S(null),f(null)},hint:t?re:void 0})]})}function je(e){return{block_gap:e}}function Ue(e){return{block_gap_phone:e}}function Xe(e){return{site_gutter:e}}function qe(e){return{site_gutter_phone:e}}function O(e,[t,n],r){t(e),r(n(e),e===null)}function Ke({persist:e,showHint:t}){const{siteGutter:n,siteGutterPhone:r,setSiteGutter:l,setSiteGutterPhone:s}=m(),u=ee(v(),{gutter:n,phone:r});if(!u)return null;const h=u.key==="site_gutter_phone"?[s,qe]:[l,Xe];return o(D,{value:u.value,onChange:i=>O(i,h,e),showHint:t,unsetPx:u.unsetPx,bounds:u.bounds})}function Me({persist:e,showHint:t}){const{blockGap:n,blockGapPhone:r,setBlockGap:l,setBlockGapPhone:s}=m(),u=V(v(),{gap:n,phone:r});if(!u)return null;const h=u.key==="block_gap_phone"?[s,Ue]:[l,je];return o($,{value:u.value,onChange:i=>O(i,h,e),showHint:t,followsPx:u.followsPx})}function $e({persist:e,showHint:t=!0}){return C(T,{children:[o(Ye,{persist:e,showHint:t}),o(Ke,{persist:e,showHint:t}),o(Me,{persist:e,showHint:t})]})}function Ve(e){return{card_shadow:e}}function Je(e){return e===null?{shadow_color:null}:{shadow_color:Re(e)}}function Qe(e){return{hover_effect:e}}function Ze({persist:e,showHint:t=!0}){const{cardShadow:n,setCardShadow:r,shadowColor:l,setShadowColor:s,hoverEffect:u,setHoverEffect:h}=m();return C(T,{children:[o(K,{value:n,onChange:i=>{r(i),e(Ve(i),!0)},showHint:t}),o(M,{value:l,onChange:i=>{s(i),e(Je(i),i===null)},showHint:t}),o(J,{value:u,onChange:i=>{h(i),e(Qe(i),!0)},showHint:t})]})}function De(e){return{photography_grayscale:e}}function et({persist:e,showHint:t}){const{photographyGrayscale:n,setPhotographyGrayscale:r}=m();return o(Q,{value:n,onChange:s=>{r(s),e(De(s),!0)},showHint:t})}function tt({persist:e,showHint:t=!0}){return o(T,{children:o(et,{persist:e,showHint:t})})}function ot(e){return{share_button_on_posts:e}}function nt({persist:e,showHint:t=!0}){const{shareButtonOnPosts:n,setShareButtonOnPosts:r}=m();return o(Z,{value:n,onChange:s=>{r(s),e(ot(s),!0)},showHint:t})}function rt(){const{websiteName:e}=m();return e?.trim()||we}function zt(){const e=rt();return o(ue,{content:p("{name} — renamed in the Console: {place}.",{name:e,place:p("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:o("span",{className:"sf-panel-site",children:e})})}function it({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:r,tab:l,onTabChange:s,initialTab:u,revealPageGroup:h=!1,onPageGroupRevealed:i}){const{persist:d}=Se({themeFromDocument:e,tokenRef:t,siteId:n,onResult:y=>{const P=_e(y);P&&r?.(P.msg,P.tone)}}),[f,g]=R(u??k[0].id),S=l!==void 0,a=S?l:f,x=S?s??(()=>{}):g,b=k.find(y=>y.id===a)??k[0],[_,I]=R(Ie);return C(T,{children:[o(ct,{activeId:b.id,onSelect:x}),C("div",{id:he(F,b.id),className:ke,role:"tabpanel","aria-labelledby":de(F,b.id),children:[a===A&&C(T,{children:[o(We,{themeFromDocument:e,persist:d,showHint:_}),!e&&o(Ze,{persist:d,showHint:_}),!e&&o($e,{persist:d,showHint:_}),!e&&o(tt,{persist:d,showHint:_}),!e&&o(nt,{persist:d,showHint:_}),o(st,{reveal:h,onRevealed:i}),o(Fe,{shown:_,onChange:I})]}),a==="theme"&&o(Ge,{themeFromDocument:e,persist:d}),a==="text"&&o(He,{themeFromDocument:e,persist:d})]})]})}function st({reveal:e,onRevealed:t}){const[n,r]=R(!0),l=U(t);return l.current=t,j(()=>{if(!e)return;r(!0);const s=requestAnimationFrame(()=>{document.getElementById(B)?.scrollIntoView({block:"start"}),l.current?.()});return()=>cancelAnimationFrame(s)},[e]),o(Y,{title:p("This page"),open:n,onToggle:r,id:B,children:o(at,{})})}function at(){const{fields:e,values:t,readOnly:n,onChange:r}=W(),l=Object.fromEntries(xe.filter(s=>s in e).map(s=>[s,e[s]]));return Object.keys(l).length===0?o(ce,{variant:"none",icon:!1,message:p("This page has no look of its own to set.")}):o(z,{fields:l,values:t,onChange:r,readOnly:n,tabs:!1,idPrefix:"this-page",ariaLabel:p("This page")})}function ct({activeId:e,onSelect:t}){return o("div",{className:"es-insp-tabs",children:o(le,{variant:"underline",block:!0,labelsFit:!0,"aria-label":p("Styles"),idPrefix:F,value:e,onChange:t,items:k.map(n=>{const r=p(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{Me as BlockGapRootField,Ze as CardLookFields,Fe as HintsToggle,$e as PageGroupFields,tt as PhotographyGroupFields,Ie as SHOW_HINTS_DEFAULT,A as SITE_STYLES_BASICS_TAB,F as SITE_STYLES_ID_PREFIX,k as SITE_STYLES_TABS,Wt as SITE_STYLES_TEXT_TAB,nt as ShareButtonRootField,Ke as SideSpaceRootField,ct as SiteStylesTabStrip,ke as TABPANEL_CLASS,B as THIS_PAGE_GROUP_ID,zt as WebsiteNameReadonly,je as blockGapPatch,Ue as blockGapPhonePatch,Ve as cardShadowPatch,it as default,Qe as hoverEffectPatch,De as photographyPatch,Je as shadowColourPatch,ot as shareButtonPatch,Xe as siteGutterPatch,qe as siteGutterPhonePatch,ze as siteWidthPatch,rt as useWebsiteName};
1
+ "use client";import{jsx as o,Fragment as T,jsxs as C}from"react/jsx-runtime";import{useEasel as O,useRootFields as z}from"efficient-easel/easel";import{Inspector as Y}from"efficient-easel/fields";import{SettingsGroup as j}from"efficient-easel/panel";import{useEffect as U,useRef as X,useState as R}from"react";import q from"./ThemeField.js";import K from"./CornersField.js";import M from"./CardShadowField.js";import $ from"./ShadowColourField.js";import V,{blockGapRow as J}from"./BlockGapField.js";import Q from"./HoverEffectField.js";import Z from"./PhotographyField.js";import D from"./ShareButtonField.js";import{usePreviewDevice as F}from"efficient-easel/draw/client";import ee,{sideSpaceRow as te}from"./SideSpaceField.js";import{BackgroundWidthRow as oe,ContentWidthRow as ne,SITE_BACKGROUND_HINT as re,SITE_CONTENT_HINT as ie}from"./SectionWidthRows.js";import se from"./SiteAccentField.js";import ae from"./SiteTextStylesField.js";import{usePreviewHeader as g}from"../../render/components/PreviewHeaderContext.js";import{Button as ce,EmptyState as le,Tabs as ue,Tooltip as de,tabButtonId as he,tabPanelId as pe}from"efficient-shell/ui";import{ContrastIcon as fe,NoteIcon as ge,SettingsIcon as me,TypeIcon as Se}from"efficient-easel/icons";import{useThemeRowPersist as _e}from"../lib/theme-row-persist.js";import{themeSaveNotice as we}from"../../format/lib/theme-save-message.js";import{say as m}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as xe}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as E}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as Te}from"../lib/document/page-root-fields.js";import{previewFrame as Ce}from"efficient-easel/screen/lib/document/preview-dom";import{siteTextColourNameOf as be,siteTextColours as ye}from"../../format/lib/text-styles/site-text-colours.js";import{useSiteTextStylesWriter as Pe}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as Re,normalizeCornerRadius as Ee,normalizeCornerStyle as Ie,normalizeShadowColor as ke}from"../../format/lib/theme.js";const G="sf-site-styles",Fe="sf-site-styles-tabpanel",Ge=!1,He="Show hints";function Oe({shown:e,onChange:t}){return o("div",{className:"sf-hints",children:o(ce,{type:"button",variant:"ghost","aria-pressed":e,leftIcon:o(ge,{size:13}),onClick:()=>t(!e),children:m(He)})})}const Yt="text",B="basics",N="this-page-group",I=[{id:B,label:"Basics",icon:o(me,{})},{id:"theme",label:"Theme",icon:o(fe,{})},{id:"text",label:"Text",icon:o(Se,{})}];function Be({themeFromDocument:e,persist:t}){const{appState:n,dispatch:r}=O(d=>d),{theme:l,setTheme:s}=g(),u=n.data,h=u.root?.props??{},i=d=>{if(e){const p={...h,theme:d};r({type:"replaceRoot",root:{...u.root,props:p},recordHistory:!0})}else s(d);t({selected_preset:d.selected,theme_presets:d.themes})};return o(q,{value:e?h.theme:l,onChange:i})}function Ne({themeFromDocument:e,persist:t}){const[n,r]=R(null),{theme:l,setFonts:s,setSizes:u,setHeadingTypography:h}=g(),i=Pe({themeFromDocument:e,persist:t}),{old:d,saved:p,writeRoot:f}=i,S=i.fonts,a=i.sizes,x=i.typography,b=c=>c.values.size??We(ve[c.id]??"body")??Ae[c.kind],_=c=>i.write(c),k=ye(l),y=be(l),P=c=>{const w={...S,accent:c};e?f({fonts:w}):s(w),t({accent_font:c})},A=c=>{u({...a,accent:c}),t({accent_size_px:c})},L=c=>{const w={...x,weightStrong:c};e?f({headingTypography:w}):h(w),t({heading_weight_strong:c})},W=c=>{const w={...x,italicStrong:c};e?f({headingTypography:w}):h(w),t({accent_italic:c})};return C(T,{children:[o(ae,{saved:p,old:d,colours:k,colourNameOf:y,sizeOf:b,onChange:_,openId:n===H?null:n,onOpenChange:r,withoutSize:e}),o(se,{font:S.accent,size:a.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:n===H,onOpenChange:c=>r(c?H:null),onChange:c=>{c.key==="font"?P(c.value):c.key==="size"?A(c.value):c.key==="weight"?L(c.value):W(c.value)},withoutSize:e})]})}const H="accent",ve={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Ae={heading:32,body:14},Le={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function We(e){if(typeof document>"u")return null;const n=(Ce()?.contentDocument??document).querySelector(Le[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function ze({themeFromDocument:e,persist:t,showHint:n}){const{appState:r,dispatch:l}=O(a=>a),{cornerRadiusPx:s,setCornerRadiusPx:u}=g(),h=r.data,i=h.root?.props??{},d=i.cornerRadiusPx===void 0?Re[Ie(i.cornerStyle)]:Ee(i.cornerRadiusPx),p=e?d:s,f=a=>l({type:"replaceRoot",root:{...h.root,props:{...i,...a}},recordHistory:!0});return o(K,{value:p,onChange:a=>{e?f({cornerRadiusPx:a}):u(a),t({corner_radius_px:a})},showHint:n})}function Ye(e){return{site_width:e}}function je({persist:e,showHint:t}){const{siteWidth:n,setSiteWidth:r,sectionBackgroundWidth:l,setSectionBackgroundWidth:s,sectionContentWidth:u,setSectionContentWidth:h}=g();if(F()!=="desktop")return null;const d=typeof n=="number"?n:E.default,p=a=>{r(a),e(Ye(a),a===null)},f=a=>{s(a),e({section_background_width:a},!0)},S=a=>{h(a),e({section_content_width:a},!0)};return C(T,{children:[o(oe,{value:l??"full",changed:l!==null,detail:m("Full width"),onChange:f,onReset:()=>f(null),hint:t?re:void 0}),o(ne,{mode:u??"content",px:d,min:E.min,max:E.max,changed:typeof n=="number"||u!==null,detail:`${m("Content width")} ${E.default}px`,onMode:S,onPx:a=>p(a),onReset:()=>{S(null),p(null)},hint:t?ie:void 0})]})}function Ue(e){return{block_gap:e}}function Xe(e){return{block_gap_phone:e}}function qe(e){return{site_gutter:e}}function Ke(e){return{site_gutter_phone:e}}function v(e,[t,n],r){t(e),r(n(e),e===null)}function Me({persist:e,showHint:t}){const{siteGutter:n,siteGutterPhone:r,setSiteGutter:l,setSiteGutterPhone:s}=g(),u=te(F(),{gutter:n,phone:r});if(!u)return null;const h=u.key==="site_gutter_phone"?[s,Ke]:[l,qe];return o(ee,{value:u.value,onChange:i=>v(i,h,e),showHint:t,unsetPx:u.unsetPx,bounds:u.bounds})}function $e({persist:e,showHint:t}){const{blockGap:n,blockGapPhone:r,setBlockGap:l,setBlockGapPhone:s}=g(),u=J(F(),{gap:n,phone:r});if(!u)return null;const h=u.key==="block_gap_phone"?[s,Xe]:[l,Ue];return o(V,{value:u.value,onChange:i=>v(i,h,e),showHint:t,followsPx:u.followsPx})}function Ve({persist:e,showHint:t=!0}){return C(T,{children:[o(je,{persist:e,showHint:t}),o(Me,{persist:e,showHint:t}),o($e,{persist:e,showHint:t})]})}function Je(e){return{card_shadow:e}}function Qe(e){return e===null?{shadow_color:null}:{shadow_color:ke(e)}}function Ze(e){return{hover_effect:e}}function De({persist:e,showHint:t=!0}){const{cardShadow:n,setCardShadow:r,shadowColor:l,setShadowColor:s,hoverEffect:u,setHoverEffect:h}=g();return C(T,{children:[o(M,{value:n,onChange:i=>{r(i),e(Je(i),!0)},showHint:t}),o($,{value:l,onChange:i=>{s(i),e(Qe(i),i===null)},showHint:t}),o(Q,{value:u,onChange:i=>{h(i),e(Ze(i),!0)},showHint:t})]})}function et(e){return{photography_grayscale:e}}function tt({persist:e,showHint:t}){const{photographyGrayscale:n,setPhotographyGrayscale:r}=g();return o(Z,{value:n,onChange:s=>{r(s),e(et(s),!0)},showHint:t})}function ot({persist:e,showHint:t=!0}){return o(T,{children:o(tt,{persist:e,showHint:t})})}function nt(e){return{share_button_on_posts:e}}function rt({persist:e,showHint:t=!0}){const{shareButtonOnPosts:n,setShareButtonOnPosts:r}=g();return o(D,{value:n,onChange:s=>{r(s),e(nt(s),!0)},showHint:t})}function it(){const{websiteName:e}=g();return e?.trim()||xe}function jt(){const e=it();return o(de,{content:m("{name} — renamed in the Console: {place}.",{name:e,place:m("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:o("span",{className:"sf-panel-site",children:e})})}function st({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:r,tab:l,onTabChange:s,initialTab:u,revealPageGroup:h=!1,onPageGroupRevealed:i}){const{persist:d}=_e({themeFromDocument:e,tokenRef:t,siteId:n,onResult:y=>{const P=we(y);P&&r?.(P.msg,P.tone)}}),[p,f]=R(u??I[0].id),S=l!==void 0,a=S?l:p,x=S?s??(()=>{}):f,b=I.find(y=>y.id===a)??I[0],[_,k]=R(Ge);return C(T,{children:[o(lt,{activeId:b.id,onSelect:x}),C("div",{id:pe(G,b.id),className:Fe,role:"tabpanel","aria-labelledby":he(G,b.id),children:[a===B&&C(T,{children:[o(ze,{themeFromDocument:e,persist:d,showHint:_}),!e&&o(De,{persist:d,showHint:_}),!e&&o(Ve,{persist:d,showHint:_}),!e&&o(ot,{persist:d,showHint:_}),!e&&o(rt,{persist:d,showHint:_}),o(at,{reveal:h,onRevealed:i}),o(Oe,{shown:_,onChange:k})]}),a==="theme"&&o(Be,{themeFromDocument:e,persist:d}),a==="text"&&o(Ne,{themeFromDocument:e,persist:d})]})]})}function at({reveal:e,onRevealed:t}){const[n,r]=R(!0),l=X(t);return l.current=t,U(()=>{if(!e)return;r(!0);const s=requestAnimationFrame(()=>{document.getElementById(N)?.scrollIntoView({block:"start"}),l.current?.()});return()=>cancelAnimationFrame(s)},[e]),o(j,{title:m("This page"),open:n,onToggle:r,id:N,children:o(ct,{})})}function ct(){const{fields:e,values:t,readOnly:n,onChange:r}=z(),l=Object.fromEntries(Te.filter(s=>s in e).map(s=>[s,e[s]]));return Object.keys(l).length===0?o(le,{variant:"none",icon:!1,message:m("This page has no look of its own to set.")}):o(Y,{fields:l,values:t,onChange:r,readOnly:n,tabs:!1,idPrefix:"this-page",ariaLabel:m("This page")})}function lt({activeId:e,onSelect:t}){return o("div",{className:"es-insp-tabs",children:o(ue,{variant:"underline",block:!0,labelsFit:!0,"aria-label":m("Styles"),idPrefix:G,value:e,onChange:t,items:I.map(n=>{const r=m(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{$e as BlockGapRootField,De as CardLookFields,Oe as HintsToggle,Ve as PageGroupFields,ot as PhotographyGroupFields,Ge as SHOW_HINTS_DEFAULT,B as SITE_STYLES_BASICS_TAB,G as SITE_STYLES_ID_PREFIX,I as SITE_STYLES_TABS,Yt as SITE_STYLES_TEXT_TAB,rt as ShareButtonRootField,Me as SideSpaceRootField,lt as SiteStylesTabStrip,Fe as TABPANEL_CLASS,N as THIS_PAGE_GROUP_ID,jt as WebsiteNameReadonly,Ue as blockGapPatch,Xe as blockGapPhonePatch,Je as cardShadowPatch,st as default,Ze as hoverEffectPatch,et as photographyPatch,Qe as shadowColourPatch,nt as shareButtonPatch,qe as siteGutterPatch,Ke as siteGutterPhonePatch,Ye as siteWidthPatch,it as useWebsiteName};
@@ -2048,6 +2048,18 @@
2048
2048
  gap: var(--space-8);
2049
2049
  min-width: 0;
2050
2050
  }
2051
+ /* The colour window with choices above the shell's panel: the same 12px the
2052
+ panel keeps between its own parts, and the 8px of its own swatch row. */
2053
+ .sf-colour-window {
2054
+ display: flex;
2055
+ flex-direction: column;
2056
+ gap: var(--space-12);
2057
+ }
2058
+ .sf-colour-choices {
2059
+ display: flex;
2060
+ flex-wrap: wrap;
2061
+ gap: var(--space-8);
2062
+ }
2051
2063
  /* The hex box's width is the SHELL's: `HexInput` is never narrower than its
2052
2064
  seven characters and its padding. This sheet held it at 4.75rem, which cut
2053
2065
  "#0A0A0A" to "#0A0A0" in the Hero's Texture color row (Lewis, 2026-10-14). */
@@ -3488,50 +3500,6 @@ input.sf-list-marking {
3488
3500
  min-width: 0;
3489
3501
  }
3490
3502
 
3491
- /* The `Color` row's control row: the dropdown, and — only once `Custom…` is
3492
- chosen — the swatch and hex under it.
3493
-
3494
- ⚠️ A COLUMN, NOT A ROW, AND 220px IS WHY. `MIN_PANEL_W` is 220, which leaves
3495
- a 181px content box; the dropdown alone wants that, and the swatch (26) plus
3496
- the hex box (57) plus two 8px gaps is another 99. Side by side they do not
3497
- fit, and the first thing to collapse would be the dropdown showing which
3498
- colour is selected. Stacked, each keeps its full width at every panel size —
3499
- and the shell's `SettingsField` already gives a row a control area under its
3500
- label, so this costs no new shape.
3501
-
3502
- The swatch pair is right-aligned to sit under the dropdown's own right edge,
3503
- where `SettingsField`'s `action` slot puts every other trailing control. */
3504
- .sf-part-ink {
3505
- display: flex;
3506
- flex-direction: column;
3507
- gap: 8px;
3508
- min-width: 0;
3509
- }
3510
- /* The part panel's Color row: its name and what it holds on one line, the
3511
- theme's swatches and Any color under it — the shell's swatches and picker. */
3512
- .sf-part-ink-top {
3513
- display: flex;
3514
- align-items: baseline;
3515
- gap: 8px;
3516
- }
3517
- .sf-part-ink-label {
3518
- font-size: var(--text-2xs);
3519
- font-weight: 600;
3520
- color: var(--sf-muted);
3521
- }
3522
- .sf-part-ink-read {
3523
- margin-left: auto;
3524
- font-size: var(--text-xs);
3525
- color: var(--sf-text-secondary);
3526
- font-variant-numeric: tabular-nums;
3527
- }
3528
- .sf-part-ink-swatches {
3529
- display: flex;
3530
- flex-wrap: wrap;
3531
- align-items: center;
3532
- gap: var(--space-8);
3533
- }
3534
-
3535
3503
  /* The copy box at the TOP of the drill (card 8819). Clicking a word drills
3536
3504
  straight to its editor, so the box is the first thing on the part screen —
3537
3505
  right under the way back, above the style it follows. It is the plain copy box
@@ -3681,18 +3649,80 @@ input.sf-list-marking {
3681
3649
  background: var(--sf-accent);
3682
3650
  }
3683
3651
 
3684
- /* The Entrance kinds (lib/animation/entrance-fields): the shell's IconPicker, three
3685
- across. Each picture is the approved drawing of its kind, and it plays that kind
3686
- when the mouse rests on its cell, by the page's engine and keyframes
3687
- (efficient-shell/motion.css). The word under a drawing shows in the popup only;
3688
- the closed button names the kind beside it, so there it is hidden (the closed
3689
- button is inside the panel's control slot, the popup is not). */
3690
- .sf-entrance-pic {
3652
+ /* A picture choice's cell (lib/document/box-fields `iconPickerRow`, and every other
3653
+ shell IconPicker whose cells are pictures): the picture, and its word UNDER it
3654
+ (choices keep their words, Lewis 2026-11-02). In the closed button (the panel's
3655
+ control slot) only the WORD shows: a drawing held to a glyph's height does not
3656
+ read, and the word always does. ONE rule for every such cell. */
3657
+ .sf-pick {
3691
3658
  display: flex;
3692
3659
  flex-direction: column;
3693
3660
  align-items: center;
3694
- gap: 2px;
3661
+ gap: 4px;
3695
3662
  }
3663
+ /* The whole cell opens the tooltip, not only the drawing in its middle: the tooltip's trigger reaches the cell's edge. */
3664
+ .sf-pick-tip {
3665
+ display: inline-flex;
3666
+ }
3667
+ [role="option"]:has(.sf-pick-tip) {
3668
+ position: relative;
3669
+ }
3670
+ [role="option"] .sf-pick-tip::after {
3671
+ content: "";
3672
+ position: absolute;
3673
+ inset: 0;
3674
+ }
3675
+ .sf-pick-pic {
3676
+ display: flex;
3677
+ align-items: center;
3678
+ justify-content: center;
3679
+ line-height: 0;
3680
+ }
3681
+ .sf-pick-cap {
3682
+ font-size: var(--text-2xs);
3683
+ line-height: 1.2;
3684
+ white-space: nowrap;
3685
+ }
3686
+ .sf-pick-cap-closed {
3687
+ display: none;
3688
+ }
3689
+ .es-field-ctl .sf-pick-cap-closed {
3690
+ display: inline;
3691
+ }
3692
+ .es-field-ctl .sf-pick {
3693
+ gap: 0;
3694
+ }
3695
+ .es-field-ctl .sf-pick-pic {
3696
+ display: none;
3697
+ }
3698
+ .es-field-ctl .sf-pick-cap {
3699
+ font-size: var(--text-xs);
3700
+ }
3701
+ /* The Block widths row: the chooser, and the width bar under Custom. */
3702
+ .sf-share-row {
3703
+ display: flex;
3704
+ flex-direction: column;
3705
+ gap: 0.5rem;
3706
+ flex: 1 1 auto;
3707
+ min-width: 0;
3708
+ }
3709
+ .sf-share-pick {
3710
+ display: flex;
3711
+ }
3712
+ .sf-share-pic {
3713
+ width: 4.5rem;
3714
+ }
3715
+ /* In the cell's own ink, as every picker picture: the chosen cell draws it in the accent. */
3716
+ .sf-share-pic i {
3717
+ background: currentColor;
3718
+ opacity: 0.55;
3719
+ }
3720
+
3721
+ /* The Entrance kinds (lib/animation/entrance-fields): the shell's IconPicker, three
3722
+ across. Each picture is the approved drawing of its kind, and it plays that kind
3723
+ when the mouse rests on its cell, by the page's engine and keyframes
3724
+ (efficient-shell/motion.css). The closed button shows the kind's word only (the
3725
+ `.sf-pick` rule above). */
3696
3726
  .sf-entrance-stage {
3697
3727
  display: flex;
3698
3728
  align-items: center;
@@ -3705,18 +3735,6 @@ input.sf-list-marking {
3705
3735
  display: block;
3706
3736
  line-height: 0;
3707
3737
  }
3708
- .sf-entrance-cap {
3709
- font-size: var(--text-2xs);
3710
- line-height: 1;
3711
- }
3712
- .es-field-ctl .sf-entrance-cap {
3713
- display: none;
3714
- }
3715
- .es-field-ctl .sf-entrance-stage {
3716
- width: auto;
3717
- height: auto;
3718
- overflow: visible;
3719
- }
3720
3738
 
3721
3739
  /* ── Side panel heads (components/SidePanelHead) ─────────────────────────
3722
3740
  Every side panel's head is efficient-easel's `InspectorHead`; these two