efficient-web-builder 52.0.0 → 53.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/editor/components/ChatSettingsPanel.js +1 -1
  3. package/dist/editor/components/MediaUploadField.d.ts +7 -7
  4. package/dist/editor/components/MediaUploadField.js +1 -1
  5. package/dist/editor/components/PartSettingsPanel.js +1 -1
  6. package/dist/editor/components/PartTextBox.js +1 -1
  7. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  8. package/dist/editor/components/SectionTextPartBridge.js +1 -1
  9. package/dist/editor/components/SiteAccentField.js +1 -1
  10. package/dist/editor/components/SiteTextStylesField.d.ts +3 -3
  11. package/dist/editor/components/SiteTextStylesField.js +1 -1
  12. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  13. package/dist/editor/components/storefront-editor.css +70 -20
  14. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  15. package/dist/editor/lib/animation/hover-fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/general/Breadcrumb/fields.js +1 -1
  17. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  18. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  19. package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
  20. package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
  21. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  22. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  23. package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
  24. package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
  25. package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
  26. package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
  27. package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
  28. package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
  29. package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
  30. package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
  31. package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
  32. package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
  33. package/dist/editor/lib/document/blocks/shared-fields.d.ts +5 -0
  34. package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
  35. package/dist/editor/lib/document/box-fields.d.ts +23 -2
  36. package/dist/editor/lib/document/box-fields.js +1 -1
  37. package/dist/editor/lib/document/card-row-fields.js +1 -1
  38. package/dist/editor/lib/document/choice-pictures.d.ts +21 -0
  39. package/dist/editor/lib/document/choice-pictures.js +1 -0
  40. package/dist/editor/lib/document/controls.d.ts +19 -5
  41. package/dist/editor/lib/document/controls.js +1 -1
  42. package/dist/editor/lib/document/hidable-rows-drawn.d.ts +1 -0
  43. package/dist/editor/lib/document/hidable-rows-drawn.js +1 -1
  44. package/dist/editor/lib/document/part-panel-rows.d.ts +1 -0
  45. package/dist/editor/lib/document/part-panel-rows.js +1 -1
  46. package/dist/editor/lib/document/separator-field.d.ts +9 -1
  47. package/dist/editor/lib/document/separator-field.js +1 -1
  48. package/dist/editor/lib/document/shape-picker.d.ts +37 -0
  49. package/dist/editor/lib/document/shape-picker.js +1 -0
  50. package/dist/editor/lib/document/show-for-field.d.ts +6 -0
  51. package/dist/editor/lib/document/show-for-field.js +1 -0
  52. package/dist/format/lib/animation/hover.d.ts +0 -2
  53. package/dist/format/lib/animation/hover.js +1 -1
  54. package/dist/format/lib/content/box-layout.d.ts +21 -6
  55. package/dist/format/lib/content/box-layout.js +1 -1
  56. package/dist/format/lib/content/box-shape.d.ts +1 -5
  57. package/dist/format/lib/content/box-shape.js +1 -1
  58. package/dist/format/lib/content/box-show-for-choices.d.ts +9 -0
  59. package/dist/format/lib/content/box-show-for-choices.js +1 -0
  60. package/dist/format/lib/content/card-template.js +1 -1
  61. package/dist/format/lib/content/gallery-card-layout.d.ts +45 -1
  62. package/dist/format/lib/content/gallery-card-layout.js +1 -1
  63. package/dist/format/lib/content/image-aspect.d.ts +47 -0
  64. package/dist/format/lib/content/image-aspect.js +1 -0
  65. package/dist/format/lib/content/list-number.d.ts +11 -0
  66. package/dist/format/lib/content/list-number.js +1 -1
  67. package/dist/format/lib/content/phone-focus.d.ts +4 -1
  68. package/dist/format/lib/content/phone-focus.js +1 -1
  69. package/dist/format/lib/content/record-row.d.ts +14 -0
  70. package/dist/format/lib/content/record-row.js +1 -0
  71. package/dist/format/lib/content/record-types.d.ts +1 -1
  72. package/dist/format/lib/content/record-types.js +1 -1
  73. package/dist/format/lib/content/section-height.d.ts +8 -0
  74. package/dist/format/lib/content/section-height.js +1 -1
  75. package/dist/format/lib/document/blocks/general/text-part-shapes.json +2 -2
  76. package/dist/format/lib/document/media-manifest.json +5 -2
  77. package/dist/format/lib/document/mockup-variant-fields.d.ts +1 -0
  78. package/dist/format/lib/document/mockup-variant-fields.js +1 -1
  79. package/dist/format/lib/document/section-catalog.js +2 -2
  80. package/dist/format/lib/document/section-descriptions.js +1 -1
  81. package/dist/format/lib/editor-words-catalogue.d.ts +25 -11
  82. package/dist/format/lib/editor-words-catalogue.js +4 -4
  83. package/dist/format/lib/fonts.js +1 -1
  84. package/dist/format/lib/sections/divider-style.d.ts +4 -0
  85. package/dist/format/lib/sections/divider-style.js +1 -1
  86. package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
  87. package/dist/format/lib/sections/section-presets.js +1 -1
  88. package/dist/format/lib/source-rules/editor-words.js +2 -2
  89. package/dist/format/lib/source-rules/mirrored-rows-agree.js +4 -4
  90. package/dist/format/lib/source-rules/shape-rows-use-the-picker.d.ts +7 -0
  91. package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -0
  92. package/dist/format/lib/text-styles/site-text-colours.d.ts +2 -9
  93. package/dist/format/lib/text-styles/site-text-colours.js +1 -1
  94. package/dist/render/components/Breadcrumb.d.ts +2 -1
  95. package/dist/render/components/Breadcrumb.js +1 -1
  96. package/dist/render/components/CardRowContext.d.ts +1 -1
  97. package/dist/render/components/CardRowContext.js +1 -1
  98. package/dist/render/components/ContentsList.d.ts +4 -1
  99. package/dist/render/components/ContentsList.js +1 -1
  100. package/dist/render/components/CurrentRecord.d.ts +23 -0
  101. package/dist/render/components/CurrentRecord.js +1 -0
  102. package/dist/render/components/Flex.d.ts +1 -1
  103. package/dist/render/components/Flex.js +1 -1
  104. package/dist/render/components/HeroPictures.d.ts +2 -0
  105. package/dist/render/components/HeroPictures.js +1 -1
  106. package/dist/render/components/HeroPoster.d.ts +2 -1
  107. package/dist/render/components/HeroPoster.js +1 -1
  108. package/dist/render/components/HeroSection.d.ts +2 -1
  109. package/dist/render/components/HeroSection.js +1 -1
  110. package/dist/render/components/HeroSingle.d.ts +3 -1
  111. package/dist/render/components/HeroSingle.js +1 -1
  112. package/dist/render/components/HeroSlide.d.ts +3 -1
  113. package/dist/render/components/HeroSlide.js +1 -1
  114. package/dist/render/components/ImageBlock.d.ts +5 -3
  115. package/dist/render/components/ImageBlock.js +1 -1
  116. package/dist/render/components/InBoxContext.d.ts +3 -0
  117. package/dist/render/components/SiteGutterFrame.d.ts +1 -0
  118. package/dist/render/components/SiteGutterFrame.js +1 -1
  119. package/dist/render/lib/content/block-size.d.ts +2 -0
  120. package/dist/render/lib/content/block-size.js +1 -1
  121. package/dist/render/lib/content/box-show-for.d.ts +14 -0
  122. package/dist/render/lib/content/box-show-for.js +1 -0
  123. package/dist/render/lib/content/page-contents.d.ts +1 -0
  124. package/dist/render/lib/content/page-contents.js +1 -1
  125. package/dist/render/lib/content/picture-focus-rows.d.ts +13 -0
  126. package/dist/render/lib/content/picture-focus-rows.js +1 -0
  127. package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
  128. package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
  129. package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
  130. package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
  131. package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
  132. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  133. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +1 -1
  134. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  135. package/dist/render/lib/document/part-styles.d.ts +21 -7
  136. package/dist/render/lib/document/part-styles.js +2 -2
  137. package/dist/render/lib/document/passes/block-size.js +1 -1
  138. package/dist/render/lib/document/passes/index.js +1 -1
  139. package/dist/render/lib/document/passes/show-for.d.ts +2 -0
  140. package/dist/render/lib/document/passes/show-for.js +1 -0
  141. package/dist/render/lib/document/show-when.js +1 -1
  142. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  143. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
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
+
3
36
  ## 52.0.0 - 2026-11-05
4
37
 
5
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.
@@ -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{partColourName as z}from"../../format/lib/document/part-inks.js";import{PaddingYIcon as C}from"efficient-easel/icons";import{say as _}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 R,partSpacingOf as k}from"../../render/lib/document/part-styles.js";const D=["left","center","right","justify"];function H(n,i,a,r="desktop"){const l=k(n),o=r==="mobile",p=(o?n.sizePhone:void 0)??n.size??i.sizePx;return[o?{...t.fontSize,key:"fontSize",value:n.sizePhone,styleValue:Math.round(i.sizePx),onChange:e=>a({sizePhone:e??null})}:{...t.fontSize,key:"fontSize",value:n.size,styleValue:Math.round(i.sizePx),onChange:e=>a({size:e??null})},{...t.lineHeight,key:"lineHeight",value:l.lineHeight,styleValue:i.lineRatio,onChange:e=>a(e===void 0?{lineHeight:null,line:null}:{lineHeight:e})},{...t.letterSpacing,key:"letterSpacing",scale:p,value:l.letterSpacingEm,styleValue:i.letterEm,onChange:e=>a(e===void 0?{letterSpacing:null,letter:null}:{letterSpacing:e})},{...t.paragraphSpacing,key:"paragraphSpacing",value:n.paragraphSpacing,styleValue:0,onChange:e=>a({paragraphSpacing:e??null})},{key:"padding",name:_("Padding"),icon:c(C,{}),unit:"px",step:R,shiftStep:10,min:N,max:v,value:n.padding,styleValue:i.paddingPx,onChange:e=>a({padding:e??null})}]}function w({text:n,onTextChange:i,multiline:a,markup:r=!0,styled:l=!0,style:o,base:p,setValue:e,colors:u,placeholder:s,ariaLabel:h,head:d,typedOnCanvas:f=!1}){const m=H(o,p,e),P=T(r,a);return x("div",{className:"sf-part-textbox",children:[d,c(S,{value:n,onChange:i,multiline:a,placeholder:s,ariaLabel:h,rules:A,tools:P,barShows:f?"focus":"always",colors:r?u:[],colorNameOf:z,align:l?{value:o.align??p.align,allow:D,onChange:g=>e({align:g})}:void 0,letterCase:l?{value:o.case==="capitalize"?"":o.case??"",onChange:g=>e({case:g||null})}:void 0,cells:l?m:void 0})]})}export{w 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 +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,11 +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, coloursNotOffered, 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
- coloursNotOffered?: readonly TextStyleColour[];
8
+ colourNameOf: TextStyleColourNameOf;
9
9
  sizeOf: (style: StoredTextStyle) => number;
10
10
  onChange: (next: {
11
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 C}from"efficient-easel/text-styles";import{keepColoursNotOffered as _,showColoursNotOffered as w}from"../../format/lib/text-styles/site-text-colours.js";import{FONT_OPTIONS as x}from"../../format/lib/fonts.js";import{usePreviewDevice as I}from"efficient-easel/draw/client";import{applyListChange as b,resolveTextStyles as k,toPanelStyles as L}from"../../render/lib/text-styles/site-text-styles.js";const N={desktop:"desktop",tablet:"tablet",mobile:"phone"},f=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],A=["size","lineSpacing","letterSpacing","letterCase"],F=500,z=x.map(e=>({value:e.key,label:e.label,family:`var(${e.cssVar})`,italic:e.italicLoaded}));function D({saved:e,old:l,colours:d,coloursNotOffered:r=[],sizeOf:p,onChange:S,openId:c,onOpenChange:m,readOnly:u=!1,withoutSize:g=!1}){const T=I(),[h,E]=y(null),n=k(e,l),i=N[T],o=w(L(n,p,i),r);return v(C,{styles:o,onChange:t=>S(b({saved:e,old:l,cur:o,next:_(t,o,n,r),sizeOf:p,panelView:i})),fonts:z,colours:d,settings:g?f.filter(t=>t!=="size"):f,auto:A,openId:c===void 0?h:c,onOpenChange:m??E,readOnly:u,device:i,fallback:t=>{const s=n.find(O=>O.id===(t.kind==="heading"?"heading-1":"body-1")),a={};return s?.values.font&&t.id!==s.id&&(a.font=s.values.font),t.kind==="heading"&&(a.weight=F),a}})}export{z as SITE_FONTS,D 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 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{siteTextColours as be,siteTextColoursNotOffered 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=be(l),y=ye(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,coloursNotOffered: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};
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};
@@ -3649,18 +3649,80 @@ input.sf-list-marking {
3649
3649
  background: var(--sf-accent);
3650
3650
  }
3651
3651
 
3652
- /* The Entrance kinds (lib/animation/entrance-fields): the shell's IconPicker, three
3653
- across. Each picture is the approved drawing of its kind, and it plays that kind
3654
- when the mouse rests on its cell, by the page's engine and keyframes
3655
- (efficient-shell/motion.css). The word under a drawing shows in the popup only;
3656
- the closed button names the kind beside it, so there it is hidden (the closed
3657
- button is inside the panel's control slot, the popup is not). */
3658
- .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 {
3659
3658
  display: flex;
3660
3659
  flex-direction: column;
3661
3660
  align-items: center;
3662
- gap: 2px;
3661
+ gap: 4px;
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;
3663
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). */
3664
3726
  .sf-entrance-stage {
3665
3727
  display: flex;
3666
3728
  align-items: center;
@@ -3673,18 +3735,6 @@ input.sf-list-marking {
3673
3735
  display: block;
3674
3736
  line-height: 0;
3675
3737
  }
3676
- .sf-entrance-cap {
3677
- font-size: var(--text-2xs);
3678
- line-height: 1;
3679
- }
3680
- .es-field-ctl .sf-entrance-cap {
3681
- display: none;
3682
- }
3683
- .es-field-ctl .sf-entrance-stage {
3684
- width: auto;
3685
- height: auto;
3686
- overflow: visible;
3687
- }
3688
3738
 
3689
3739
  /* ── Side panel heads (components/SidePanelHead) ─────────────────────────
3690
3740
  Every side panel's head is efficient-easel's `InspectorHead`; these two
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{phoneKey as s}from"efficient-easel/draw";import{SettingsDefaultReset as w,SettingsField as R}from"efficient-easel/panel";import{AnimationIcon as N,ClockIcon as A,DirectionDownIcon as T,DirectionIcon as L,DirectionLeftIcon as P,DirectionRightIcon as S,DirectionUpIcon as B,DurationIcon as G}from"efficient-easel/icons";import{deviceField as p}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as U,noControlField as W}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{describedAs as k,group as j,onDesktopWords as Y,phoneTwinFields as H}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as z,ENTRANCE_FROM_DEFAULT as I,ENTRANCE_KINDS as h,ENTRANCE_KINDS_WITH_FROM as g,MOTION_TIMING as V,entranceAttrs as q,playEntrance as J,readEntrance as Q}from"efficient-shell/format";import{IconPicker as X}from"efficient-shell/ui";import{segmented as Z}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as D}from"../document/controls.js";import{withRowRules as $}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as ee,say as l}from"../../../format/lib/editor-words.js";import{animationDelayField as ne,animationDurationField as oe}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as t,LEGACY_ENTRANCE_KEY as C,entranceOf as v}from"../../../render/lib/animation/entrance.js";import{ENTRANCE_GROUP_KEY as te}from"../../../format/lib/animation/index.js";const m={none:"None",fade:"Fade",rise:"Rise",scale:"Scale",glide:"Glide",bounce:"Bounce",flip:"Flip",reveal:"Reveal",spin:"Spin"},ie={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},re={top:()=>e(T,{}),bottom:()=>e(B,{}),left:()=>e(S,{}),right:()=>e(P,{})},u="Entrance",x=h.filter(n=>n!=="none"),y=n=>({any:[{field:t.kind,in:n},{all:[{field:t.kind,set:!1},{field:C,in:n}]}]}),b=n=>({any:[{field:s(t.kind),in:n},{all:[{field:s(t.kind),set:!1},y(n)]}]}),ae=[[[t.from],y(g)],[[s(t.from)],b(g)],[[t.duration,t.delay],y(x)],[[s(t.duration),s(t.delay)],b(x)]],c=({children:n})=>e("svg",{viewBox:"0 0 40 40",width:"40",height:"40",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:n}),r=({x:n=12,y:o=12,o:i=1})=>e("rect",{x:n,y:o,width:"16",height:"16",rx:"2",opacity:i}),le={none:e(c,{children:e(r,{})}),fade:a(c,{children:[e(r,{x:6,o:.3}),e(r,{x:18})]}),rise:a(c,{children:[e(r,{y:20,o:.3}),e(r,{y:8}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),scale:a(c,{children:[e("rect",{x:"16",y:"16",width:"8",height:"8",rx:"1",opacity:".35"}),e(r,{}),e("path",{d:"M6 6l4 4M34 34l-4-4"})]}),glide:a(c,{children:[e(r,{x:2,o:.3}),e(r,{x:20}),e("path",{d:"M4 33h12m-2-2 2 2-2 2"})]}),bounce:a(c,{children:[e(r,{y:6}),e("path",{d:"M8 34c3-6 5-6 8 0s5 6 8 0 5-6 8 0"})]}),flip:a(c,{children:[e("path",{d:"M12 12l16 4v8l-16 4z",opacity:".35"}),e(r,{}),e("path",{d:"M20 4v32",strokeDasharray:"2 2"})]}),reveal:a(c,{children:[e("rect",{x:"12",y:"12",width:"16",height:"16",rx:"2",strokeDasharray:"2 2",opacity:".5"}),e("path",{d:"M12 22h16v4a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z",fill:"currentColor",opacity:".35"}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),spin:a(c,{children:[e(r,{}),e("path",{d:"M33 14a14 14 0 0 1 0 12m0 0-3-1m3 1 1-3"})]})};function ce({kind:n}){const{attrs:o}=q(Q(n,I));return a("span",{className:"sf-entrance-pic",children:[e("span",{className:"sf-entrance-stage",children:e("i",{...o,children:le[n]})}),e("span",{className:"sf-entrance-cap",children:l(m[n])})]})}const se=(n,o)=>{const i=o.querySelector(".sf-entrance-stage > i");i&&J(i)},de={width:"3.5rem",height:"4.25rem"};function F({value:n,onChange:o}){return e(X,{label:l(u),value:n,emptyValue:"none",columns:3,cell:de,onChange:o,onPreview:se,tooltips:!1,options:h.map(i=>({value:i,label:l(m[i]),icon:e(ce,{kind:i})}))})}const E="Effect",M=n=>n==="none"?void 0:l(m[n]);function pe({value:n,onChange:o}){const i=D(),d=v({...i,[t.kind]:n},"desktop").kind;return e(R,{label:l(E),icon:e(N,{}),value:M(d),children:e(F,{value:d,onChange:o})})}function me({value:n,onChange:o}){const i=D(),d=typeof n=="string"&&h.includes(n),f=v(i,"desktop").kind;return e(R,{label:l(E),icon:e(N,{}),value:M(d?n:f),changed:d,action:e(w,{words:ee()?.panel,label:l(E),changed:d,detail:Y(O=>l(O),l(m[f])),onReset:()=>o(void 0)}),children:e(F,{value:d?n:f,onChange:o})})}const K={type:"select",label:u,options:h.map(n=>({value:n,label:m[n]}))},he=()=>k({type:"custom",render:({value:n,onChange:o})=>e(pe,{value:n,onChange:o})},K),fe=()=>k({type:"custom",render:({value:n,onChange:o})=>e(me,{value:n,onChange:o})},K),ue=z.map(n=>({label:ie[n],value:n,picture:re[n]()}));function Oe(){const{duration:n,delay:o}=V.entrance,i={[te]:j(u),[t.kind]:p("desktop",he()),[C]:W({type:"custom",render:()=>e(U,{})},"always"),[s(t.kind)]:p("mobile",fe()),...H(t.from,Z("From",e(L,{}),ue,I)),[t.duration]:p("desktop",oe("entrance")),[s(t.duration)]:p("mobile",_({label:"Duration",desktopKey:t.duration,icon:e(G,{}),min:n.min,max:n.max,step:n.step,fallback:n.default,unit:"s"})),[t.delay]:p("desktop",ne("entrance")),[s(t.delay)]:p("mobile",_({label:"Delay",desktopKey:t.delay,icon:e(A,{}),min:o.min,max:o.max,step:o.step,fallback:o.default,unit:"s"}))};return $(i,ae)}export{le as ENTRANCE_PICTURE,Oe as entranceFields};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{phoneKey as l}from"efficient-easel/draw";import{SettingsDefaultReset as O,SettingsField as R}from"efficient-easel/panel";import{AnimationIcon as N,ClockIcon as w,DirectionDownIcon as A,DirectionIcon as T,DirectionLeftIcon as L,DirectionRightIcon as S,DirectionUpIcon as P,DurationIcon as B,NoSymbolIcon as G}from"efficient-easel/icons";import{deviceField as d}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as U,noControlField as W}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{describedAs as k,group as j,onDesktopWords as Y,phoneTwinFields as z}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as H,ENTRANCE_FROM_DEFAULT as I,ENTRANCE_KINDS as m,ENTRANCE_KINDS_WITH_FROM as g,MOTION_TIMING as q,entranceAttrs as V,playEntrance as J,readEntrance as Q}from"efficient-shell/format";import{IconPicker as X}from"efficient-shell/ui";import{pickerCellIcon as Z}from"../document/box-fields.js";import{segmented as $}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as D}from"../document/controls.js";import{withRowRules as ee}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as oe,say as c}from"../../../format/lib/editor-words.js";import{animationDelayField as ne,animationDurationField as te}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as t,LEGACY_ENTRANCE_KEY as C,entranceOf as b}from"../../../render/lib/animation/entrance.js";import{ENTRANCE_GROUP_KEY as ie}from"../../../format/lib/animation/index.js";const h={none:"None",fade:"Fade",rise:"Rise",scale:"Scale",glide:"Glide",bounce:"Bounce",flip:"Flip",reveal:"Reveal",spin:"Spin"},re={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},ae={top:()=>e(A,{}),bottom:()=>e(P,{}),left:()=>e(S,{}),right:()=>e(L,{})},f="Entrance",x=m.filter(o=>o!=="none"),u=o=>({any:[{field:t.kind,in:o},{all:[{field:t.kind,set:!1},{field:C,in:o}]}]}),v=o=>({any:[{field:l(t.kind),in:o},{all:[{field:l(t.kind),set:!1},u(o)]}]}),le=[[[t.from],u(g)],[[l(t.from)],v(g)],[[t.duration,t.delay],u(x)],[[l(t.duration),l(t.delay)],v(x)]],s=({children:o})=>e("svg",{viewBox:"0 0 40 40",width:"40",height:"40",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o}),r=({x:o=12,y:n=12,o:i=1})=>e("rect",{x:o,y:n,width:"16",height:"16",rx:"2",opacity:i}),ce={none:e(G,{size:20}),fade:a(s,{children:[e(r,{x:6,o:.3}),e(r,{x:18})]}),rise:a(s,{children:[e(r,{y:20,o:.3}),e(r,{y:8}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),scale:a(s,{children:[e("rect",{x:"16",y:"16",width:"8",height:"8",rx:"1",opacity:".35"}),e(r,{}),e("path",{d:"M6 6l4 4M34 34l-4-4"})]}),glide:a(s,{children:[e(r,{x:2,o:.3}),e(r,{x:20}),e("path",{d:"M4 33h12m-2-2 2 2-2 2"})]}),bounce:a(s,{children:[e(r,{y:6}),e("path",{d:"M8 34c3-6 5-6 8 0s5 6 8 0 5-6 8 0"})]}),flip:a(s,{children:[e("path",{d:"M12 12l16 4v8l-16 4z",opacity:".35"}),e(r,{}),e("path",{d:"M20 4v32",strokeDasharray:"2 2"})]}),reveal:a(s,{children:[e("rect",{x:"12",y:"12",width:"16",height:"16",rx:"2",strokeDasharray:"2 2",opacity:".5"}),e("path",{d:"M12 22h16v4a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z",fill:"currentColor",opacity:".35"}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),spin:a(s,{children:[e(r,{}),e("path",{d:"M33 14a14 14 0 0 1 0 12m0 0-3-1m3 1 1-3"})]})};function se({kind:o}){const{attrs:n}=V(Q(o,I)),i=c(h[o]);return Z(e("span",{className:"sf-entrance-stage",children:e("i",{...n,children:ce[o]})}),i,i)}const de=(o,n)=>{const i=n.querySelector(".sf-entrance-stage > i");i&&J(i)},pe={width:"3.5rem",height:"4.25rem"};function F({value:o,onChange:n}){return e(X,{label:c(f),value:o,columns:3,cell:pe,onChange:n,onPreview:de,tooltips:!1,options:m.map(i=>({value:i,label:c(h[i]),icon:e(se,{kind:i})}))})}const y="Effect";function me({value:o,onChange:n}){const i=D(),p=b({...i,[t.kind]:o},"desktop").kind;return e(R,{label:c(y),icon:e(N,{}),children:e(F,{value:p,onChange:n})})}function he({value:o,onChange:n}){const i=D(),p=typeof o=="string"&&m.includes(o),E=b(i,"desktop").kind;return e(R,{label:c(y),icon:e(N,{}),changed:p,action:e(O,{words:oe()?.panel,label:c(y),changed:p,detail:Y(K=>c(K),c(h[E])),onReset:()=>n(void 0)}),children:e(F,{value:p?o:E,onChange:n})})}const M={type:"select",label:f,options:m.map(o=>({value:o,label:h[o]}))},fe=()=>k({type:"custom",render:({value:o,onChange:n})=>e(me,{value:o,onChange:n})},M),ue=()=>k({type:"custom",render:({value:o,onChange:n})=>e(he,{value:o,onChange:n})},M),ye=H.map(o=>({label:re[o],value:o,picture:ae[o]()}));function Ae(){const{duration:o,delay:n}=q.entrance,i={[ie]:j(f),[t.kind]:d("desktop",fe()),[C]:W({type:"custom",render:()=>e(U,{})},"always"),[l(t.kind)]:d("mobile",ue()),...z(t.from,$("From",e(T,{}),ye,I)),[t.duration]:d("desktop",te("entrance")),[l(t.duration)]:d("mobile",_({label:"Duration",desktopKey:t.duration,icon:e(B,{}),min:o.min,max:o.max,step:o.step,fallback:o.default,unit:"s"})),[t.delay]:d("desktop",ne("entrance")),[l(t.delay)]:d("mobile",_({label:"Delay",desktopKey:t.delay,icon:e(w,{}),min:n.min,max:n.max,step:n.step,fallback:n.default,unit:"s"}))};return ee(i,le)}export{ce as ENTRANCE_PICTURE,Ae as entranceFields};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{ContrastIcon as V,HoverIcon as D,HoverLiftIcon as K,HoverNextImageIcon as S,HoverNoneIcon as P,HoverRotateIcon as g,HoverZoomIcon as O,OpacityIcon as A,RotateIcon as y}from"efficient-easel/icons";import{group as U}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as F,noControlField as L}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as c}from"../../../format/lib/content/box-background.js";import{cardTemplateField as W,cardTemplateOwner as B,namedRowField as b}from"../../../format/lib/content/card-template.js";import{segmented as M,slider as h}from"../document/box-fields.js";import{withShowWhen as p}from"../../../format/lib/document/show-when-attach.js";import{finiteNumber as Y}from"../../../format/lib/finite-number.js";import{animationDelayField as v,animationDurationField as w,showsWhatRuns as R}from"./AnimationDurationRow.js";import{CARD_HOVER_ANGLE as l,CARD_HOVER_KEYS as i,CARD_HOVER_KINDS as X,CARD_HOVER_TURN as j,HOVER_KEY as _,HOVER_KIND_LABELS as z,NEXT_PICTURE_BLOCKS as G,NEXT_PICTURE_HOVER_KINDS as Z,OLD_SPIN_KEY as q,PART_HOVER_KINDS as J,PICTURE_HOVER_KEYS as N,PICTURE_HOVER_KINDS as Q,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as $,cardHoverKindOf as oo,cardRotatesRule as eo,HOVER_GROUP_KEY as f,pictureHoverKindOf as to,pictureHoverMovesRule as no,pictureHoverRunsRule as ro}from"../../../format/lib/animation/hover.js";const E=()=>r("desktop",U("Hover")),io="What this does when a shopper points at it, or taps it on a phone.",so="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",po="What this picture does when a shopper points at the card. Show next image fades to the card's next photo. Black and white shows it in grey until then. A phone shows the first photo in colour.",ao="What each card does when a shopper points at it, or taps it on a phone. Rotate turns the wheel picture.",co={none:()=>n(P,{}),nextImage:()=>n(S,{}),rotate:()=>n(g,{}),zoom:()=>n(O,{}),lift:()=>n(K,{}),mono:()=>n(V,{})};function H(o,e){return M("Hover effect",n(D,{}),o.map(t=>({label:z[t],value:t,picture:co[t]()})),e)}function No(){return{[f]:E(),[_]:r("desktop",{...H(J,"none"),description:io})}}function ko(o){const e=eo(o),t=h("Angle",n(y,{}),l.min,l.max,l.step,j,"°",{clear:{emptyLabel:"By spokes"}});return{[f]:E(),[i.kind]:r("desktop",{...R(H(X,o),(s,a)=>oo(a??{},o)),description:ao}),[q]:L({type:"custom",render:()=>n(F,{})},"always"),[i.angle]:r("desktop",p(R(t,s=>Y(s)===void 0?void 0:$(s)),e)),[i.duration]:r("desktop",p(w("hover"),e)),[i.delay]:r("desktop",p(v("hover"),e))}}function To(o,e=""){const t=ro(o);return{[f]:E(),[i.kind]:k(Q,o,so),...G.includes(e)?uo():{},[i.duration]:r("desktop",p(w("hover"),t)),[i.delay]:r("desktop",p(v("hover"),t))}}function uo(){const o=no(),e=h("Zoom",n(O,{}),d.min,d.max,d.step,d.min,d.unit),t=h("Darken on hover",n(A,{}),c.min,c.max,c.step,c.fallback,c.unit);return{[N.zoom]:r("desktop",p(e,o)),[N.darken]:r("desktop",p(t,o))}}function k(o,e,t){const s=r("desktop",{...R(H(o,e),a=>to({[_]:a},e,o)),description:t});return Object.assign(s,{[T]:e})}const T="sfPictureResting",C=new WeakMap;function Co(o,e,t){const s=o[i.kind],a=s?.[T];if(!s||!a)return o;const I=e.props?.[_]==="nextImage",m=I?null:B(t.appState,e.props?.id),x=m?W(String(m.type),b(e.props),m):null;if(!I&&!x?.next)return o;let u=C.get(o);return u||(u={...o,[i.kind]:k(Z,a,po)},C.set(o,u)),u}export{ko as cardHoverFields,No as hoverFields,Co as offerNextPicture,To as pictureHoverFields};
1
+ import{jsx as n}from"react/jsx-runtime";import{ContrastIcon as V,HoverIcon as D,HoverLiftIcon as K,HoverNextImageIcon as S,HoverNoneIcon as P,HoverRotateIcon as g,HoverZoomIcon as O,OpacityIcon as A,RotateIcon as U}from"efficient-easel/icons";import{group as F}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as y,noControlField as W}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as c}from"../../../format/lib/content/box-background.js";import{cardTemplateField as L,cardTemplateOwner as B,namedRowField as M}from"../../../format/lib/content/card-template.js";import{segmented as Y,slider as R}from"../document/box-fields.js";import{withShowWhen as p}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as v,animationDurationField as w,showsWhatRuns as m}from"./AnimationDurationRow.js";import{CARD_HOVER_ANGLE as _,CARD_HOVER_KEYS as i,CARD_HOVER_KINDS as X,CARD_HOVER_TURN as b,HOVER_KEY as l,HOVER_KIND_LABELS as j,NEXT_PICTURE_BLOCKS as z,NEXT_PICTURE_HOVER_KINDS as G,OLD_SPIN_KEY as Z,PART_HOVER_KINDS as q,PICTURE_HOVER_KEYS as N,PICTURE_HOVER_KINDS as J,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as Q,cardHoverKindOf as $,cardRotatesRule as oo,HOVER_GROUP_KEY as E,pictureHoverKindOf as eo,pictureHoverMovesRule as to,pictureHoverRunsRule as no}from"../../../format/lib/animation/hover.js";const H=()=>r("desktop",F("Hover")),ro="What this does when a shopper points at it, or taps it on a phone.",io="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",so="What this picture does when a shopper points at the card. Show next image fades to the card's next photo. Black and white shows it in grey until then. A phone shows the first photo in colour.",po="What each card does when a shopper points at it, or taps it on a phone. Rotate turns the wheel picture.",ao={none:()=>n(P,{}),nextImage:()=>n(S,{}),rotate:()=>n(g,{}),zoom:()=>n(O,{}),lift:()=>n(K,{}),mono:()=>n(V,{})};function f(o,e){return Y("Hover effect",n(D,{}),o.map(t=>({label:j[t],value:t,picture:ao[t]()})),e)}function vo(){return{[E]:H(),[l]:r("desktop",{...f(q,"none"),description:ro})}}function wo(o){const e=oo(o),t=R("Angle",n(U,{}),_.min,_.max,_.step,b,"°");return{[E]:H(),[i.kind]:r("desktop",{...m(f(X,o),(s,a)=>$(a??{},o)),description:po}),[Z]:W({type:"custom",render:()=>n(y,{})},"always"),[i.angle]:r("desktop",p(m(t,s=>Q(s)),e)),[i.duration]:r("desktop",p(w("hover"),e)),[i.delay]:r("desktop",p(v("hover"),e))}}function No(o,e=""){const t=no(o);return{[E]:H(),[i.kind]:T(J,o,io),...z.includes(e)?co():{},[i.duration]:r("desktop",p(w("hover"),t)),[i.delay]:r("desktop",p(v("hover"),t))}}function co(){const o=to(),e=R("Zoom",n(O,{}),d.min,d.max,d.step,d.min,d.unit),t=R("Darken on hover",n(A,{}),c.min,c.max,c.step,c.fallback,c.unit);return{[N.zoom]:r("desktop",p(e,o)),[N.darken]:r("desktop",p(t,o))}}function T(o,e,t){const s=r("desktop",{...m(f(o,e),a=>eo({[l]:a},e,o)),description:t});return Object.assign(s,{[k]:e})}const k="sfPictureResting",C=new WeakMap;function To(o,e,t){const s=o[i.kind],a=s?.[k];if(!s||!a)return o;const I=e.props?.[l]==="nextImage",h=I?null:B(t.appState,e.props?.id),x=h?L(String(h.type),M(e.props),h):null;if(!I&&!x?.next)return o;let u=C.get(o);return u||(u={...o,[i.kind]:T(G,a,so)},C.set(o,u)),u}export{wo as cardHoverFields,vo as hoverFields,To as offerNextPicture,No as pictureHoverFields};
@@ -1 +1 @@
1
- import{plainText as e,text as r,withOffPage as a}from"../../../controls.js";import{group as m}from"efficient-easel/screen/lib/document/box-fields";import{BREADCRUMB_PH as i}from"../../../../../../format/lib/document/blocks/general/Breadcrumb/meta.js";const b={fields:{_gContent:m("Content"),items:{type:"array",label:"Crumbs",arrayFields:{label:e("Label"),href:a(e("Link"))},getItemSummary:t=>t?.label||"Crumb"},meta:r("Trailing note",i.meta)}};export{b as BreadcrumbFields};
1
+ import{CARD_ROW_FACTS as i,cardRowField as l,cardRowFields as a}from"../../../card-row-fields.js";import{plainText as r,text as m,withOffPage as s}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{BREADCRUMB_PH as d}from"../../../../../../format/lib/document/blocks/general/Breadcrumb/meta.js";const p={fields:{_gContent:o("Content"),items:{type:"array",label:"Crumbs",arrayFields:{label:r("Label"),href:s(r("Link"))},getItemSummary:e=>e?.label||"Crumb"},meta:m("Trailing note",d.meta),_gText:o("Text"),rowField:l("Shows","text")},resolveFields:(e,t)=>a(t.fields,e,t),showWhenFacts:i};export{p as BreadcrumbFields};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as B}from"react/jsx-runtime";import{ButtonIcon as C,ButtonIconIcon as S,IconAfterTextIcon as T,IconBeforeTextIcon as w}from"efficient-easel/icons";import{SettingsField as k}from"efficient-easel/panel";import{useSelectedFields as m}from"efficient-easel/easel";import{buttonFieldSet as F}from"efficient-easel/screen/lib/document/button-fields";import{IconPicker as v,Segmented as O}from"efficient-shell/ui";import{shellGlyphOf as P}from"../../../shell-glyph.js";import{StorefrontTextLinkField as _}from"../../../../../components/StorefrontLinkField.js";import{usePreviewHeader as a}from"../../../../../../render/components/PreviewHeaderContext.js";import{BUTTON_ICONS as N,buttonIconChoice as R,buttonIconSide as j,buttonWidth as L}from"../../../../../../format/lib/content/button-icon.js";import{BUTTON_PAD_BUILT_IN as W,buttonLook as u}from"../../../../../../render/lib/content/button-look.js";import{nonEmptyString as z}from"../../../../../../format/lib/non-empty-string.js";import{selectedThemeColors as A,siteButtonPaint as d,siteButtonRadiusPx as E}from"../../../../../../format/lib/theme.js";import{say as r}from"../../../../../../format/lib/editor-words.js";import{backTo as D,buttonWordsEntryField as U,inOwnBox as G,linkField as H,plainText as K,useSelectedSibling as f}from"../../../controls.js";import{useThemePresets as V}from"../../../ColourControl.js";import{keptByRow as c}from"efficient-easel/screen/lib/document/style-fields";import{group as p}from"efficient-easel/screen/lib/document/box-fields";import{rowSay as q}from"../../../box-fields.js";import{CARD_ROW_FACTS as J,cardRowField as h,cardRowFields as M}from"../../../card-row-fields.js";import{consentWordsKept as Q,withConsentWordsRow as X}from"../../../consent-words-field.js";const b=o=>P(o==="none"?"no-symbol":o),Y=N.map(o=>({value:o,icon:b(o)}));function Z({value:o,onChange:n}){const t=m(),i=t.values.href,s=typeof o=="string"?o:o&&typeof o=="object"&&"text"in o?String(o.text??""):"";return e(_,{label:"Button",icon:e(C,{size:18}),text:s,onTextChange:n,link:typeof i=="string"?i:"",onLinkChange:l=>t.onChange("href",l)})}function $({value:o,onChange:n}){const t=m(),i=R(o,t.values.arrow),s=j(t.values.iconPosition),l=L(t.values.widthFit)==="fill",I=b("icon-at-end");return e(k,{label:r("Icon"),icon:e(S,{size:18}),children:B("div",{className:"flex items-center gap-2",children:[e(v,{label:r("Icon"),value:i,emptyValue:"none",options:Y,onChange:n}),i!=="none"&&e(O,{size:"sm",block:!0,label:r("Icon position"),value:s==="end"&&!l?"after":s,onChange:g=>t.onChange("iconPosition",g),options:[{value:"before",icon:e(w,{size:16}),label:e("span",{className:"sr-only",children:r("Icon before text")}),title:r("Icon before text")},{value:"after",icon:e(T,{size:16}),label:e("span",{className:"sr-only",children:r("Icon after text")}),title:r("Icon after text")},...l?[{value:"end",icon:I,label:e("span",{className:"sr-only",children:r("Icon at the far end")}),title:r("Icon at the far end")}]:[]]})]})})}const x=()=>d(a().theme),y=F({follows:{useFill:()=>x().fill,useText:()=>x().ink,useBorder:()=>{const[o]=f("variant"),[n]=f("buttonColor"),{theme:t}=a(),i=u({variant:o,buttonColor:n}).border.width,s=z(n)??(o==="ghost"?A(t).text:d(t).fill);return{width:i,color:s}},useCorners:()=>E(a().cornerRadiusPx),useFillOpacity:()=>u({variant:f("variant")[0]}).fillOpacity},usePresets:V,resetTo:o=>D(o,r("Styles")),padding:{fallback:W,tablet:!0},say:q});function oo(o,n){const t=Object.keys(o);return Object.fromEntries(t.slice(0,t.indexOf(n)+1).map(i=>[i,o[i]]))}const So={fields:{label:G(K("Button"),o=>e(Z,{value:o.value,onChange:o.onChange})),labelText:U("label"),href:{...H("Button link"),...c("label")},consentWords:Q("label"),_gButton:p("Button"),rowField:h("Shows","text"),rowLinkField:h("Link from","link"),...oo(y,"_dDesign"),_gStyle:p("Style"),variant:c("buttonColor"),icon:{type:"custom",render:o=>e($,{value:o.value,onChange:o.onChange})},iconPosition:c("icon"),arrow:c("icon"),...y},resolveFields:(o,n)=>X(M(n.fields,o,n),o.props,"label",["href"]),showWhenFacts:J};export{So as ButtonBlockFields};
1
+ import{jsx as e,jsxs as C}from"react/jsx-runtime";import{ButtonIcon as S,ButtonIconIcon as T,IconAfterTextIcon as k,IconBeforeTextIcon as w}from"efficient-easel/icons";import{SettingsField as F}from"efficient-easel/panel";import{useSelectedFields as u}from"efficient-easel/easel";import{buttonFieldSet as v}from"efficient-easel/screen/lib/document/button-fields";import{IconPicker as O,Segmented as P}from"efficient-shell/ui";import{shellGlyphOf as _}from"../../../shell-glyph.js";import{StorefrontTextLinkField as N}from"../../../../../components/StorefrontLinkField.js";import{usePreviewHeader as a}from"../../../../../../render/components/PreviewHeaderContext.js";import{BUTTON_ICONS as R,buttonIconChoice as W,buttonIconSide as j,buttonWidth as L}from"../../../../../../format/lib/content/button-icon.js";import{BUTTON_PAD_BUILT_IN as z,buttonLook as d}from"../../../../../../render/lib/content/button-look.js";import{nonEmptyString as A}from"../../../../../../format/lib/non-empty-string.js";import{selectedThemeColors as E,siteButtonPaint as p,siteButtonRadiusPx as D}from"../../../../../../format/lib/theme.js";import{say as r}from"../../../../../../format/lib/editor-words.js";import{backTo as U,buttonWordsEntryField as G,inOwnBox as H,linkField as K,plainText as q,useSelectedSibling as f}from"../../../controls.js";import{useThemePresets as J}from"../../../ColourControl.js";import{keptByRow as c}from"efficient-easel/screen/lib/document/style-fields";import{group as h}from"efficient-easel/screen/lib/document/box-fields";import{pickerNoneIcon as M,rowSay as Q,ShellIconWord as b}from"../../../box-fields.js";import{CARD_ROW_FACTS as V,cardRowField as x,cardRowFields as X}from"../../../card-row-fields.js";import{consentWordsKept as Y,withConsentWordsRow as Z}from"../../../consent-words-field.js";const m=o=>_(o==="none"?"no-symbol":o),$=R.map(o=>({value:o,icon:o==="none"?M(m(o),e(b,{value:o})):m(o)}));function oo({value:o,onChange:i}){const t=u(),n=t.values.href,s=typeof o=="string"?o:o&&typeof o=="object"&&"text"in o?String(o.text??""):"";return e(N,{label:"Button",icon:e(S,{size:18}),text:s,onTextChange:i,link:typeof n=="string"?n:"",onLinkChange:l=>t.onChange("href",l)})}function eo({value:o,onChange:i}){const t=u(),n=W(o,t.values.arrow),s=j(t.values.iconPosition),l=L(t.values.widthFit)==="fill",y=m("icon-at-end");return e(F,{label:r("Icon"),icon:e(T,{size:18}),value:n==="none"?void 0:e(b,{value:n}),children:C("div",{className:"flex items-center gap-2",children:[e(O,{label:r("Icon"),value:n,options:$,onChange:i}),n!=="none"&&e(P,{size:"sm",block:!0,label:r("Icon position"),value:s==="end"&&!l?"after":s,onChange:B=>t.onChange("iconPosition",B),options:[{value:"before",icon:e(w,{size:16}),label:e("span",{className:"sr-only",children:r("Icon before text")}),title:r("Icon before text")},{value:"after",icon:e(k,{size:16}),label:e("span",{className:"sr-only",children:r("Icon after text")}),title:r("Icon after text")},...l?[{value:"end",icon:y,label:e("span",{className:"sr-only",children:r("Icon at the far end")}),title:r("Icon at the far end")}]:[]]})]})})}const I=()=>p(a().theme),g=v({follows:{useFill:()=>I().fill,useText:()=>I().ink,useBorder:()=>{const[o]=f("variant"),[i]=f("buttonColor"),{theme:t}=a(),n=d({variant:o,buttonColor:i}).border.width,s=A(i)??(o==="ghost"?E(t).text:p(t).fill);return{width:n,color:s}},useCorners:()=>D(a().cornerRadiusPx),useFillOpacity:()=>d({variant:f("variant")[0]}).fillOpacity},usePresets:J,resetTo:o=>U(o,r("Styles")),padding:{fallback:z,tablet:!0},say:Q});function to(o,i){const t=Object.keys(o);return Object.fromEntries(t.slice(0,t.indexOf(i)+1).map(n=>[n,o[n]]))}const ko={fields:{label:H(q("Button"),o=>e(oo,{value:o.value,onChange:o.onChange})),labelText:G("label"),href:{...K("Button link"),...c("label")},consentWords:Y("label"),_gButton:h("Button"),rowField:x("Shows","text"),rowLinkField:x("Link from","link"),...to(g,"_dDesign"),_gStyle:h("Style"),variant:c("buttonColor"),icon:{type:"custom",render:o=>e(eo,{value:o.value,onChange:o.onChange})},iconPosition:c("icon"),arrow:c("icon"),...g},resolveFields:(o,i)=>Z(X(i.fields,o,i),o.props,"label",["href"]),showWhenFacts:V};export{ko as ButtonBlockFields};