efficient-web-builder 50.0.0 → 51.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 (94) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/dist/editor/components/BlogPostSource.js +1 -1
  4. package/dist/editor/components/HeroPartPanel.js +1 -1
  5. package/dist/editor/components/MediaUploadField.js +1 -1
  6. package/dist/editor/components/SectionEditor.js +1 -1
  7. package/dist/editor/components/ThemeCard.js +1 -1
  8. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  9. package/dist/editor/components/storefront-editor.css +1 -1
  10. package/dist/editor/components/usePartMotion.d.ts +1 -1
  11. package/dist/editor/components/usePartTypingDeps.d.ts +2 -0
  12. package/dist/editor/components/usePartTypingDeps.js +1 -0
  13. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  14. package/dist/editor/lib/animation/fields.d.ts +1 -1
  15. package/dist/editor/lib/animation/fields.js +1 -1
  16. package/dist/editor/lib/animation/hover-fields.d.ts +7 -1
  17. package/dist/editor/lib/animation/hover-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/Flex/fields.js +1 -1
  20. package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
  21. package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
  22. package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
  23. package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
  24. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  25. package/dist/editor/lib/document/blocks/hero-shared-fields.d.ts +2 -0
  26. package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
  27. package/dist/editor/lib/document/canvas-typing.d.ts +1 -0
  28. package/dist/editor/lib/document/canvas-typing.js +1 -1
  29. package/dist/editor/lib/document/card-copy-rows.d.ts +12 -0
  30. package/dist/editor/lib/document/card-copy-rows.js +1 -0
  31. package/dist/editor/lib/document/controls.d.ts +1 -0
  32. package/dist/editor/lib/document/controls.js +1 -1
  33. package/dist/editor/lib/document/darken-fields.d.ts +4 -0
  34. package/dist/editor/lib/document/darken-fields.js +1 -0
  35. package/dist/editor/lib/document/overrides.js +1 -1
  36. package/dist/format/components/stored-pick-row.d.ts +8 -0
  37. package/dist/format/components/stored-pick-row.js +1 -0
  38. package/dist/format/lib/animation/hover.d.ts +32 -1
  39. package/dist/format/lib/animation/hover.js +1 -1
  40. package/dist/format/lib/content/box-layout.d.ts +11 -0
  41. package/dist/format/lib/content/box-layout.js +1 -1
  42. package/dist/format/lib/content/box-shape.d.ts +2 -1
  43. package/dist/format/lib/content/box-shape.js +1 -1
  44. package/dist/format/lib/content/card-template.d.ts +6 -0
  45. package/dist/format/lib/content/card-template.js +1 -1
  46. package/dist/format/lib/content/image-treatment.d.ts +23 -4
  47. package/dist/format/lib/content/image-treatment.js +1 -1
  48. package/dist/format/lib/document/blocks/general/Hero/meta.js +1 -1
  49. package/dist/format/lib/document/blocks/general/HeroSingle/meta.js +1 -1
  50. package/dist/format/lib/document/box-footer.js +1 -1
  51. package/dist/format/lib/document/easel-row-words.d.ts +1 -0
  52. package/dist/format/lib/document/easel-row-words.js +1 -1
  53. package/dist/format/lib/document/passes/card-template-on-insert.d.ts +2 -0
  54. package/dist/format/lib/document/passes/card-template-on-insert.js +1 -0
  55. package/dist/format/lib/document/passes/types.d.ts +6 -0
  56. package/dist/format/lib/document/section-catalog.js +2 -2
  57. package/dist/format/lib/editor-words-catalogue.d.ts +9 -2
  58. package/dist/format/lib/editor-words-catalogue.js +3 -3
  59. package/dist/format/lib/sections/hero-overlay.js +1 -1
  60. package/dist/render/components/ButtonBlock.d.ts +1 -1
  61. package/dist/render/components/ButtonBlock.js +1 -1
  62. package/dist/render/components/ContactLocations.d.ts +3 -1
  63. package/dist/render/components/ContactLocations.js +2 -2
  64. package/dist/render/components/Flex.d.ts +5 -1
  65. package/dist/render/components/Flex.js +1 -1
  66. package/dist/render/components/HeroPictures.d.ts +10 -0
  67. package/dist/render/components/HeroPictures.js +1 -1
  68. package/dist/render/components/HeroSingle.js +1 -1
  69. package/dist/render/components/HeroSlide.js +1 -1
  70. package/dist/render/components/ImageBlock.d.ts +6 -1
  71. package/dist/render/components/ImageBlock.js +1 -1
  72. package/dist/render/components/Manifesto.d.ts +3 -1
  73. package/dist/render/components/Manifesto.js +1 -1
  74. package/dist/render/components/PhotoHoverSheet.d.ts +4 -0
  75. package/dist/render/components/PhotoHoverSheet.js +1 -0
  76. package/dist/render/components/PictureWash.d.ts +6 -0
  77. package/dist/render/components/PictureWash.js +1 -0
  78. package/dist/render/components/Placeholder.js +1 -1
  79. package/dist/render/components/PostCard.js +1 -1
  80. package/dist/render/components/Split.d.ts +3 -1
  81. package/dist/render/components/Split.js +1 -1
  82. package/dist/render/components/Text.d.ts +2 -2
  83. package/dist/render/components/Text.js +1 -1
  84. package/dist/render/lib/animation/part-motion.js +2 -2
  85. package/dist/render/lib/document/blocks/general/ContactLocations/render.js +1 -1
  86. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  87. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  88. package/dist/render/lib/document/blocks/general/Manifesto/render.js +1 -1
  89. package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
  90. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  91. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  92. package/dist/render/lib/document/passes/index.js +1 -1
  93. package/dist/render/lib/document/passes/section-animation.js +1 -1
  94. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 51.0.0 - 2026-11-05
4
+
5
+ From main at `6e5a8b06`: #473, #492, #494, #495, #496, #498, #499, #500, #502, #503, #504, #505, #506, #507, #508, #509. A major because of #503: the `efficient-easel` peer rises from `^27.0.0` to `^27.3.0`. No declared export is removed or changed (only added), and `efficient-shell` stays at `^11.8.0`. No stored key moves, so no stored page needs a data move.
6
+
7
+ **BREAKING for hosts (#503):** a host must move to `efficient-easel` 27.3.0 with this release. On an older easel, the two saved-template doors resolve as an insert, and the insert pass re-seeds a Cards or Menu that the merchant emptied in a saved template. Look: a Cards or a Menu added in a Box or a footer now draws its seeded card template, where it drew nothing.
8
+
9
+ ### Added
10
+
11
+ - **A block's card template is seeded as it goes in** (#503). `WEBSITE_BLOCK_RULES.resolveOnInsert`, `templateOnInsert(type, props)` in `lib/content/card-template`, and the pass `lib/document/passes/card-template-on-insert`. A saved node put in whole resolves as a copy and keeps an emptied template.
12
+ - **Box shape and Block widths take a Tablet value** (#473): `boxShapeTablet` and `shareTablet`, drawn from 720 to 1100 when stored. A Box with no tablet value draws the same bytes as before.
13
+ - **Black and white until hover, for every picture** (#492): a new Hover kind on the Image, Manifesto, Split, Contact tile, Box background and Hero pictures, timed by the shell's hover variables. Look: Contact tiles show colour on a phone, and the fade takes 0.7 s.
14
+ - **Show next image** (#499): a picture in a card copy fades to its row's next photo on hover, where the row field names one (`CardRowFieldSpec.next`, `rowNextPicture`).
15
+ - **A Manual row is typed in its own copy** (#494): words typed in a card copy go to that row, and a right-click on a copy offers Add, Move and Delete item.
16
+ - **A card turns one spoke** (#498, #504): `cardTurnFor(hover, spokes)` and `CardHoverDrawn.angleSet` (optional). The card Angle row reads "By spokes" when unset.
17
+ - **A Hero slide follows the Texture colour** (#508) when it stores only an Overlay position, and a line under Texture color names the slides that keep their own.
18
+ - **`storedPickRow(pick, gone)`** (#509): one row for a stored pick the list does not hold. The Blog post picker shows the post's name while the list loads.
19
+ - `HOVER_GROUP_KEY` is exported from the format side, `lib/animation/hover` (#496).
20
+
21
+ ### Changed
22
+
23
+ - The section "Hero Slideshow" reads **Hero**, the single-media section reads **Hero Single**, and a slide's "Overlay" slider reads **Tint** (#505). Labels only.
24
+ - The repository links name the `eff-erp` organization (#502).
25
+
26
+ ### Fixed
27
+
28
+ - The Box footer keeps a block's card template seed on a page twin (#500).
29
+ - A Contact tile photo that is not a string draws the placeholder instead of throwing (#495).
30
+ - A seeded Text or Button writes no `undefined` class, and the theme preview says "main" (#506).
31
+ - A section's text run names itself in the part panel head (#507).
32
+
3
33
  ## 50.0.0 - 2026-11-04
4
34
 
5
35
  From main at `7bcd4d2a`: #481, #489, #490, #491. A major because of #481: `components/Cards` loses `items` as a drawing path and its built-in card. No declared export is removed (39 added), and the peers are unchanged (`efficient-easel` `^27.0.0`, `efficient-shell` `^11.8.0`). No stored page needs a data move: a stored Cards with no card template is given one on read and saved only with a merchant's edit (1 live node, hartesmetal.com /warranty).
package/README.md CHANGED
@@ -6,7 +6,7 @@ EFFICIENT storefront, the admin portal and Foyerboard each mount it and hand it
6
6
  what is theirs.
7
7
 
8
8
  This repository was the folder `packages/web-builder` of
9
- [`efficient-storefront`](https://github.com/Efficient-Pty-Ltd/efficient-storefront)
9
+ [`efficient-storefront`](https://github.com/eff-erp/efficient-storefront)
10
10
  until 2026-10-07, and carries that folder's history: each file's log goes back
11
11
  to the day it was written there
12
12
  ([`doc/adr/0001`](doc/adr/0001-extracted-from-the-storefront.md)).
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as i,jsxs as B}from"react/jsx-runtime";import{useContext as P}from"react";import{SettingsField as d}from"efficient-easel/panel";import{FieldSelect as g}from"efficient-easel/fields";import{BlogPostIcon as f}from"efficient-easel/icons";import{ScreenDocumentContext as L}from"efficient-easel/screen/components/ScreenDocumentContext";import{loadStorefrontBlogPosts as C}from"./useStorefrontBlogPosts.js";import{useSnapshotSource as F}from"./useSnapshotSource.js";import j from"./SourceStatus.js";import{say as t}from"../../format/lib/editor-words.js";import{postDateLabel as N}from"../../format/lib/content/post-date.js";function h(o){return{slug:o.slug,image:o.coverImage,title:o.title,dek:o.excerpt,date:N(o.publishedAt),href:o.href}}function T({value:o,onChange:l}){const n=P(L);return n&&!n.capabilities.hasBlog?o?.slug?e(w,{value:o,onChange:l}):e(i,{}):e(D,{value:o,onChange:l})}function w({value:o,onChange:l}){return e("div",{children:e(d,{label:t("Blog post source"),icon:e(f,{}),hint:e(i,{children:t("Linked to a blog post. This editor has no blog to pick another from; choose “None (manual)” to author the section yourself.")}),children:e(g,{value:o.slug,ariaLabel:t("Blog post source"),onChange:n=>n?void 0:l(null),options:[{label:t("None (manual)"),value:""},{label:o.title||o.slug,value:o.slug}]})})})}function D({value:o,onChange:l}){const{rows:n,loading:p,refreshing:a,errored:m,refresh:b}=F({load:C,resolve:(s,r)=>s.find(c=>c.slug===r.slug),snapshot:h,value:o,onChange:l}),k=s=>{if(!s){l(null);return}const r=(n??[]).find(c=>c.slug===s);r&&l(h(r))},S=o?.slug&&!(n??[]).some(s=>s.slug===o.slug),x=m?"error":a?"loading":"idle",u=t("Storefront → Blog"),y=m?t("Couldn’t reach {place}.",{place:u}):a?t("Syncing from {place}…",{place:u}):t("Linked to “{name}”",{name:o?.title||o?.slug||""});return B("div",{children:[e(d,{label:t("Blog post source"),icon:e(f,{}),hint:o?.slug?void 0:e(i,{children:t("Pick a post from {place} to auto-fill this section, or keep “None (manual)” to author it yourself below.",{place:u})}),children:e(g,{value:o?.slug??"",ariaLabel:t("Blog post source"),onChange:k,readOnly:p,options:[{label:t("None (manual)"),value:""},...S?[{label:t("{name} (unavailable)",{name:o.title||o.slug}),value:o.slug}]:[],...(n??[]).map(s=>({label:s.title,value:s.slug}))]})}),o?.slug?e(j,{status:x,statusText:y,onRefresh:b,busy:a,hint:e(i,{children:t("Auto-fills the cover image, headline, dek, date and link from this post each time you open the editor. Those fields are hidden while a post is linked; the remaining fields stay yours to set.")})}):null]})}export{T as default};
1
+ "use client";import{jsx as e,Fragment as i,jsxs as B}from"react/jsx-runtime";import{useContext as P}from"react";import{SettingsField as g}from"efficient-easel/panel";import{FieldSelect as f}from"efficient-easel/fields";import{BlogPostIcon as h}from"efficient-easel/icons";import{ScreenDocumentContext as L}from"efficient-easel/screen/components/ScreenDocumentContext";import{loadStorefrontBlogPosts as C}from"./useStorefrontBlogPosts.js";import{useSnapshotSource as F}from"./useSnapshotSource.js";import j from"./SourceStatus.js";import{storedPickRow as w}from"../../format/components/stored-pick-row.js";import{say as t}from"../../format/lib/editor-words.js";import{postDateLabel as N}from"../../format/lib/content/post-date.js";function p(o){return{slug:o.slug,image:o.coverImage,title:o.title,dek:o.excerpt,date:N(o.publishedAt),href:o.href}}function T({value:o,onChange:n}){const r=P(L);return r&&!r.capabilities.hasBlog?o?.slug?e(D,{value:o,onChange:n}):e(i,{}):e(_,{value:o,onChange:n})}function D({value:o,onChange:n}){return e("div",{children:e(g,{label:t("Blog post source"),icon:e(h,{}),hint:e(i,{children:t("Linked to a blog post. This editor has no blog to pick another from; choose “None (manual)” to author the section yourself.")}),children:e(f,{value:o.slug,ariaLabel:t("Blog post source"),onChange:r=>r?void 0:n(null),options:[{label:t("None (manual)"),value:""},{label:o.title||o.slug,value:o.slug}]})})})}function _({value:o,onChange:n}){const{rows:r,loading:m,refreshing:a,errored:d,refresh:b}=F({load:C,resolve:(s,l)=>s.find(c=>c.slug===l.slug),snapshot:p,value:o,onChange:n}),k=s=>{if(!s){n(null);return}const l=(r??[]).find(c=>c.slug===s);l&&n(p(l))},S=o?.slug&&!(r??[]).some(s=>s.slug===o.slug),x=d?"error":a?"loading":"idle",u=t("Storefront → Blog"),y=d?t("Couldn’t reach {place}.",{place:u}):a?t("Syncing from {place}…",{place:u}):t("Linked to “{name}”",{name:o?.title||o?.slug||""});return B("div",{children:[e(g,{label:t("Blog post source"),icon:e(h,{}),hint:o?.slug?void 0:e(i,{children:t("Pick a post from {place} to auto-fill this section, or keep “None (manual)” to author it yourself below.",{place:u})}),children:e(f,{value:o?.slug??"",ariaLabel:t("Blog post source"),onChange:k,readOnly:m,options:[{label:t("None (manual)"),value:""},...S?[w({name:o.title||o.slug,value:o.slug},!m)]:[],...(r??[]).map(s=>({label:s.title,value:s.slug}))]})}),o?.slug?e(j,{status:x,statusText:y,onRefresh:b,busy:a,hint:e(i,{children:t("Auto-fills the cover image, headline, dek, date and link from this post each time you open the editor. Those fields are hidden while a post is linked; the remaining fields stay yours to set.")})}):null]})}export{T as default};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as l}from"react/jsx-runtime";import{InspectorUpLevel as t}from"efficient-easel/chrome";import{usePreviewHeroPart as c}from"../../render/components/PreviewHeroPartContext.js";import{SiteFields as f}from"./SiteFields.js";import{usePartMotion as p}from"./usePartMotion.js";import{say as i}from"../../format/lib/editor-words.js";import{HERO_MEDIA_PART_LABELS as u,heroPartId as P}from"../../render/lib/document/hero-media-parts.js";function d({nodeId:r,part:e,sectionName:m,onUpToSection:n}){const{select:s}=c(),a=p(r,e,"block");return l("div",{children:[e!=="media"?o(t,{inline:!0,name:i(u.media),onSelect:()=>s(P(r,"media"))}):o(t,{inline:!0,name:i(m),onSelect:n}),o(f,{part:e,motion:a})]})}export{d as default};
1
+ "use client";import{jsx as o,jsxs as l}from"react/jsx-runtime";import{InspectorUpLevel as t}from"efficient-easel/chrome";import{usePreviewHeroPart as c}from"../../render/components/PreviewHeroPartContext.js";import{SiteFields as p}from"./SiteFields.js";import{usePartMotion as f}from"./usePartMotion.js";import{say as i}from"../../format/lib/editor-words.js";import{HERO_MEDIA_PART_LABELS as u,heroPartId as P}from"../../render/lib/document/hero-media-parts.js";function d({nodeId:r,part:e,sectionName:m,onUpToSection:n}){const{select:s}=c(),a=f(r,e,"picture");return l("div",{children:[e!=="media"?o(t,{inline:!0,name:i(u.media),onSelect:()=>s(P(r,"media"))}):o(t,{inline:!0,name:i(m),onSelect:n}),o(p,{part:e,motion:a})]})}export{d as default};
@@ -1 +1 @@
1
- "use client";import{jsx as i}from"react/jsx-runtime";import{SettingsDefaultReset as D,SettingsField as S}from"efficient-easel/panel";import{useSelectedHost as H}from"efficient-easel/easel";import{FOCAL_DEFAULT as I}from"efficient-shell/format";import{ImageIcon as E,PlayIcon as F}from"efficient-easel/icons";import{MediaUploadField as M}from"efficient-shell/ui";import{useContext as O}from"react";import{ScreenDocumentContext as T}from"efficient-easel/screen/components/ScreenDocumentContext";import{editorEaselWords as A,say as m}from"../../format/lib/editor-words.js";import{phoneKey as B}from"efficient-easel/draw";import{PHONE_CLEAR as L}from"../../format/lib/document/phone-override.js";import{usePreviewDevice as R}from"efficient-easel/draw/client";import{shownTier as b}from"efficient-easel/screen/lib/document/device-fields";import{requestMediaPick as V}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as _}from"efficient-easel/screen/lib/host";import{mediaValueSrc as j}from"../../format/lib/media-value.js";import{useSelectedPatch as N}from"../lib/document/controls.js";import{backendOf as W}from"../lib/website-session.js";import{useEaselSession as q}from"efficient-easel/screen/lib/session-context";function z(t,o,s){if(b(s)==="tablet")return null;const r=b(s)==="mobile",n=typeof t[o]=="string"&&t[o]?String(t[o]):I,e=B(o),a=typeof t[e]=="string"&&t[e]?String(t[e]):void 0;return{phone:r,desktop:n,own:a,focus:r?a??n:n,key:r?e:o,twin:e}}function G(t,o){const s=H(),r=R();if(!t||!s)return null;const n=s.values??{};if(o&&!o(n))return null;const e=z(n,t,r);if(!e)return null;const a=s.onChange;return{phone:e.phone,desktop:e.desktop,own:e.own,focus:e.focus,set:u=>a(e.key,u),clear:()=>a(e.twin,L)}}function J({value:t,onChange:o,label:s,accept:r,placeholder:n,focusKey:e,focusWhen:a,frameKey:u,fieldKey:w}){const x=_(),C=q(),h=m(s),l=r.startsWith("video"),c=G(l?void 0:e,a),g=O(T),k=N(),d=u&&w?{video:w,frame:u}:null,P=p=>V(x,{accept:r,title:h,...p?{file:p}:{}}).then(f=>!f||!d?f?.url??null:(k({[d.video]:f.url,[d.frame]:f.posterUrl??""}),null)),U=d?p=>p?o(p):k({[d.video]:"",[d.frame]:""}):o;if(g&&!g.capabilities.mediaEditing)return i(S,{label:h,icon:l?i(F,{}):i(E,{}),children:i("div",{className:"sf-image-slot-inert",children:l?m("Templates don’t store videos — this slot stays a placeholder. Each website picks its own after it’s created."):m("Templates don’t store images — this slot stays a placeholder. Each website picks its own after it’s created.")})});const v=j(t),y=c?.phone&&v?i(D,{words:A()?.panel,label:m("Image focus"),changed:!!c.own,detail:m("{value} on desktop",{value:c.desktop}),onReset:c.clear}):void 0;return i(S,{label:h,icon:l?i(F,{}):i(E,{}),action:y,children:i("div",{style:{flex:"1 1 auto",minWidth:0},children:i(M,{value:v,onChange:U,onPick:P,accept:l?"video/*":"image/*",kind:l?"video":"image",placeholder:n===void 0?void 0:m(n),maxSizeBytes:W(C).media.maxUploadBytes,...c?{focus:c.focus,onFocusChange:c.set}:{}})})})}export{J as default,z as viewFocusOf};
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 +1 @@
1
- "use client";import{jsx as n,jsxs as f,Fragment as M}from"react/jsx-runtime";import{useState as be}from"react";import{useEasel as we,useRootFields as ge}from"efficient-easel/easel";import{Button as ke,EmptyState as Ee}from"efficient-shell/ui";import{PAGE_STYLE_FIELDS as x}from"../lib/document/page-root-fields.js";import{rootPanelHead as Pe}from"../../format/lib/document/root-panel.js";import{headWords as z,InspectorHead as ve,InspectorIconButton as W}from"efficient-easel/chrome";import{DuplicateIcon as Ie,TrashIcon as Le}from"efficient-easel/icons";import{panelFieldsOf as Te}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as K}from"../../render/components/PreviewTickerContext.js";import Oe from"./SectionIcon.js";import{PanelHideButton as j}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as ye}from"efficient-easel/screen/lib/session-context";import{say as o}from"../../format/lib/editor-words.js";import Ne,{HintsToggle as _e,SHOW_HINTS_DEFAULT as He,SITE_STYLES_BASICS_TAB as Re}from"./WebsiteSettingsPanel.js";import Ae from"./ChatSettingsPanel.js";import De from"./SocialLinksPanel.js";import Ce from"./TickerSettingsPanel.js";import Fe,{PartSourceNote as Be}from"./PartSettingsPanel.js";import Me from"./DuplicateToPageMenu.js";import{usePageRows as xe}from"../lib/page-rows.js";import{useScreenDocument as ze}from"efficient-easel/screen/components/ScreenDocumentContext";import{usePreviewHeader as We}from"../../render/components/PreviewHeaderContext.js";import{useSectionOps as Ke}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as je,isSelectionMode as E}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as Ge}from"efficient-easel/draw/client";import{entryPartsOf as Ye,SectionTextEntries as Ue}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ze}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as $e,ROOT_ZONE as G}from"efficient-easel/draw";import{websiteDuplicateBlocked as qe}from"../lib/document/every-page.js";import{FOOTER_TYPE as P}from"../lib/document/footer-blocks.js";import Je from"./SwitchToBoxFooter.js";import{SiteFields as Y}from"./SiteFields.js";import Qe from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as Ve,HERO_PART_MODE as Xe,heroPartLabel as et}from"../../render/lib/document/hero-media-parts.js";import{SettingsSwitch as tt}from"efficient-easel/panel";import{foldTopTier as nt}from"../lib/document/field-groups.js";import{FoldHeadingScope as ot}from"../lib/document/panel-heading-scope.js";import{partRowField as it}from"../lib/document/part-row-field.js";import{decodePartKey as rt,partRowHeadLabel as st}from"../../render/lib/document/part-rows.js";import{encodePartId as at,partHeadLabel as lt,partLabel as ct,sectionTextParts as dt}from"../../render/lib/document/text-parts.js";import{partSourceOf as pt,sourceMenuIdOf as mt,sourceSlugOf as ft}from"../../format/lib/document/source-bound-parts.js";const mn=je,fn={kind:"header"},un={kind:"website"},hn={kind:"website",tab:Re,revealPageGroup:!0},Sn={kind:"chat"},bn={kind:"social"},w="Part";function ut(e){return o("Part of {name}",{name:o(e)})}function ht(e,i,r){const s=e.describeNode(i);return{name:r,kindLabel:s?ut(s.label):o(w)}}function St(e){switch(e){case"Header":return{title:o("Header settings belong to a website."),own:o("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:o("Appearance settings belong to a website."),own:o("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:o("Live chat settings belong to a website."),own:o("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:o("Social link settings belong to a website."),own:o("Each website created from this template sets its own social link afterwards.")};default:return{title:o("{what} settings belong to a website.",{what:e}),own:o("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function U({what:e}){const i=St(e);return f("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:i.title})}),f("p",{children:[o("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",i.own]})]})}function v(e){const i=Xe[e];return{name:Ve[e],kindLabel:w,icon:i,head:(r,s)=>{if(r.kind!==i)return null;const d=s.describeNode(r.nodeId);if(!d)return null;const u=z({name:o(et(e,d.props)),tier:"part",of:o(d.label)},{partOf:({name:h})=>o("Part of {name}",{name:h})});return{name:u.name,kindLabel:u.kind}},render:(r,s)=>r.kind===i?n(Qe,{nodeId:r.nodeId,part:e,sectionName:s.describeNode(r.nodeId)?.label??"Hero",onUpToSection:()=>s.onSelectNode(r.nodeId)}):null}}const bt={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,i)=>{const r=i.hostPanels?.header;return r?n(r,{placeholderMode:i.capabilities.placeholderFrames,tokenRef:i.tokenRef,siteId:i.siteId,websiteName:i.websiteName,onOpenWebsiteSettings:i.onOpenWebsiteSettings,onAuthExpired:()=>i.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,i)=>n(Ne,{initialTab:e.tab,revealPageGroup:e.revealPageGroup,themeFromDocument:!i.capabilities.hasSiteTheme,tokenRef:i.tokenRef,siteId:i.siteId,onNotify:i.onNotify},e.tab??"")},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>n(Ae,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>n(De,{unavailable:n(U,{what:"Social link"})})},ticker:{name:K,kindLabel:w,icon:"ticker",head:(e,i)=>e.kind==="ticker"?ht(i,e.heroId,o(K)):null,render:e=>n(Ce,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:v("media"),heroImage:v("image"),heroImage2:v("image2"),part:{name:w,kindLabel:w,icon:"Text",head:(e,i)=>{if(e.kind!=="part")return null;const r=i.describeNode(e.nodeId);if(!r)return null;const{key:s,row:d}=rt(e.propKey),u=d?it(r.fields[s],d):r.fields[s],h=st(o(lt(ct(u??{},s))),d),p=z({name:h,tier:"part",of:o(r.label)},{partOf:({name:S})=>o("Part of {name}",{name:S})});return{name:p.name,kindLabel:p.kind}},render:(e,i)=>e.kind==="part"?n(Fe,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>i.onSelectNode(e.nodeId),onEditStyle:i.onOpenSiteStyles}):null}},wt=new Set(["header","website","chat"]);function gt(e,i){if(e==="selection")return null;const r=bt[e];return wt.has(e)&&!i.hasSiteSettings?{...r,kindLabel:"Not part of a template",render:()=>n(U,{what:r.name})}:r}function kt({mode:e,onOpenWebsiteSettings:i,onOpenSiteStyles:r,onOpenPageStyles:s,onSelectNode:d,hideNodeActions:u=!1,onNotify:h,onHidePanel:p}){const{capabilities:S,tokenRef:I,notifyParent:Z,currentSlug:L,siteId:T,runAuthed:$,readOnly:q,navigate:Et}=ze(),{rows:J}=xe(),O=J?.find(l=>l.slug===L)??null,Q=ge(),V=Object.keys(Q.fields).some(l=>!l.startsWith("_")&&!x.includes(l)),{websiteName:X}=We(),g=Ke({readOnly:q}),{select:ee}=Ge(),{selectedItem:t,getItemById:te,getSelectorForId:ne,config:m,appState:oe}=we(l=>l),ie=Te(m,t?{type:t.type,props:t.props}:null),y=t?dt(ie??m.components[t.type]?.fields,t.props):[],re=l=>m.components[l]?.label??l,a=t?ne(t.props.id):void 0,c=gt(e.kind,S),se=ye(),N={capabilities:S,tokenRef:I,hostPanels:se.chrome?.panels,describeNode:l=>{const b=te(l);if(!b)return null;const B=m.components[b.type];return{type:b.type,label:B?.label??b.type,fields:B?.fields??{},props:b.props??{}}},siteId:T,websiteName:X??null,notifyParent:Z,onNotify:h,onOpenWebsiteSettings:i,onOpenSiteStyles:r,onSelectNode:d},_=c?.head?.(e,N)??null,H=Pe({kind:O?.kind,pageName:O?.label}),ae=_?.name??(c?o(c.name):t?o(re(t.type)):H.name),le=_?.kindLabel??(c?o(c.kindLabel):t?a&&a.zone!==G?o("Block"):o("Section"):H.kindLabel),ce=c?c.icon:t?t.type:"page",R=c?null:t?m.components[t.type]?.fields??null:m.root?.fields??null,de=R?nt(R):2,A=E(e)&&t?pt(t.type):null,pe=!!t&&!!a&&a.zone===G&&t.type!==P&&t.type!==$e,k=qe(oe?.data,t),me=()=>{k||a&&g.duplicateComponent(a.zone,a.index)},fe=()=>{a&&(g.removeComponent(a.zone,a.index),g.select(null))},ue=t?m.components[t.type]?.defaultProps?.previewHover:void 0,D=E(e)&&!!t&&!!a&&ue!==void 0,C=D&&t.props.previewHover===!0,he=()=>{!t||!a||g.replaceComponent(a.zone,a.index,{...t,props:{...t.props,previewHover:!C}})},[F,Se]=be(He);return f("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right${F||!(!c&&!!t)?"":" sf-hints-folded"}`,children:[n(ve,{icon:n(Oe,{type:ce,size:15}),name:ae,kind:le,actions:!u&&E(e)&&t&&t.type!==P?f(M,{children:[n(W,{label:o("Duplicate section"),title:k??void 0,disabled:k!==null,onClick:me,children:n(Ie,{size:15})}),pe&&S.hasSiteSettings&&n(Me,{node:t,currentSlug:L,siteId:T??void 0,tokenRef:I,runAuthed:$,onNotify:h}),n(W,{label:o("Remove section"),danger:!0,onClick:fe,children:n(Le,{size:15})}),p?n(j,{side:"right",onHide:p,divider:!0}):null]}):p?n(j,{side:"right",onHide:p}):void 0}),D&&f("div",{className:"sf-preview-pin",children:[f("div",{className:"sf-preview-pin-text",children:[n("span",{className:"sf-preview-pin-label",children:o("Preview hover state")}),n("span",{className:"sf-preview-pin-hint",children:o("not shown live")})]}),n(tt,{checked:C,onChange:he,ariaLabel:o("Preview hover state")})]}),n(ot,{tier:de,children:n("div",{className:"sf-insp-body es-insp-body sf-scroll",children:c?c.render(e,N):t?f(M,{children:[t.type===P&&S.hasSiteSettings&&n(Je,{}),n(Ze,{children:n(Y,{entries:n(Ue,{parts:y,heading:!1,onOpen:l=>ee(at(t.props.id,l))}),entryCount:Ye(y).length})}),A&&n(Be,{source:A,slug:ft(t?.props),menuId:mt(t?.props)}),n(_e,{shown:F,onChange:Se})]}):V?n(Y,{omit:x}):n(Ee,{variant:"none",icon:!1,message:o("Select a section or block to edit it."),children:s&&n(ke,{variant:"secondary",onClick:s,children:o("This page")})})})})]})}export{Sn as CHAT_MODE,fn as HEADER_MODE,mn as SELECTION_MODE,bn as SOCIAL_MODE,un as WEBSITE_MODE,hn as WEBSITE_PAGE_MODE,kt as default,gt as resolvePanel};
1
+ "use client";import{jsx as n,jsxs as h,Fragment as M}from"react/jsx-runtime";import{useState as be}from"react";import{useEasel as we,useRootFields as ge}from"efficient-easel/easel";import{Button as Ee,EmptyState as ke}from"efficient-shell/ui";import{PAGE_STYLE_FIELDS as K}from"../lib/document/page-root-fields.js";import{rootPanelHead as Pe}from"../../format/lib/document/root-panel.js";import{headWords as W,InspectorHead as ve,InspectorIconButton as z}from"efficient-easel/chrome";import{DuplicateIcon as Ie,TrashIcon as Le}from"efficient-easel/icons";import{panelFieldsOf as Te}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as j}from"../../render/components/PreviewTickerContext.js";import ye from"./SectionIcon.js";import{PanelHideButton as G}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as Oe}from"efficient-easel/screen/lib/session-context";import{say as o}from"../../format/lib/editor-words.js";import _e,{HintsToggle as Ne,SHOW_HINTS_DEFAULT as He,SITE_STYLES_BASICS_TAB as Re}from"./WebsiteSettingsPanel.js";import Ae from"./ChatSettingsPanel.js";import De from"./SocialLinksPanel.js";import Ce from"./TickerSettingsPanel.js";import Fe,{PartSourceNote as Be}from"./PartSettingsPanel.js";import{regionsForSection as xe}from"../../format/lib/sections/section-text-regions.js";import{TEXT_KIND_LABELS as Me}from"../../format/lib/sections/section-text-kinds.js";import{textRegionOfPartKey as Ke}from"../../format/lib/sections/text-regions.js";import We from"./DuplicateToPageMenu.js";import{usePageRows as ze}from"../lib/page-rows.js";import{useScreenDocument as je}from"efficient-easel/screen/components/ScreenDocumentContext";import{usePreviewHeader as Ge}from"../../render/components/PreviewHeaderContext.js";import{useSectionOps as Ye}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as Ue,isSelectionMode as I}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as Xe}from"efficient-easel/draw/client";import{entryPartsOf as Ze,SectionTextEntries as $e}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as qe}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as Je,ROOT_ZONE as Y}from"efficient-easel/draw";import{websiteDuplicateBlocked as Qe}from"../lib/document/every-page.js";import{FOOTER_TYPE as L}from"../lib/document/footer-blocks.js";import Ve from"./SwitchToBoxFooter.js";import{SiteFields as U}from"./SiteFields.js";import et from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as tt,HERO_PART_MODE as nt,heroPartLabel as ot}from"../../render/lib/document/hero-media-parts.js";import{SettingsSwitch as rt}from"efficient-easel/panel";import{foldTopTier as it}from"../lib/document/field-groups.js";import{FoldHeadingScope as st}from"../lib/document/panel-heading-scope.js";import{partRowField as at}from"../lib/document/part-row-field.js";import{decodePartKey as lt,partRowHeadLabel as ct}from"../../render/lib/document/part-rows.js";import{encodePartId as dt,partHeadLabel as pt,partLabel as mt,sectionTextParts as ft}from"../../render/lib/document/text-parts.js";import{partSourceOf as ut,sourceMenuIdOf as ht,sourceSlugOf as St}from"../../format/lib/document/source-bound-parts.js";const wn=Ue,gn={kind:"header"},En={kind:"website"},kn={kind:"website",tab:Re,revealPageGroup:!0},Pn={kind:"chat"},vn={kind:"social"},w="Part";function bt(e){return o("Part of {name}",{name:o(e)})}function wt(e,r,i){const s=e.describeNode(r);return{name:i,kindLabel:s?bt(s.label):o(w)}}function gt(e){switch(e){case"Header":return{title:o("Header settings belong to a website."),own:o("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:o("Appearance settings belong to a website."),own:o("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:o("Live chat settings belong to a website."),own:o("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:o("Social link settings belong to a website."),own:o("Each website created from this template sets its own social link afterwards.")};default:return{title:o("{what} settings belong to a website.",{what:e}),own:o("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function X({what:e}){const r=gt(e);return h("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:r.title})}),h("p",{children:[o("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",r.own]})]})}function T(e){const r=nt[e];return{name:tt[e],kindLabel:w,icon:r,head:(i,s)=>{if(i.kind!==r)return null;const d=s.describeNode(i.nodeId);if(!d)return null;const S=W({name:o(ot(e,d.props)),tier:"part",of:o(d.label)},{partOf:({name:p})=>o("Part of {name}",{name:p})});return{name:S.name,kindLabel:S.kind}},render:(i,s)=>i.kind===r?n(et,{nodeId:i.nodeId,part:e,sectionName:s.describeNode(i.nodeId)?.label??"Hero",onUpToSection:()=>s.onSelectNode(i.nodeId)}):null}}const Et={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,r)=>{const i=r.hostPanels?.header;return i?n(i,{placeholderMode:r.capabilities.placeholderFrames,tokenRef:r.tokenRef,siteId:r.siteId,websiteName:r.websiteName,onOpenWebsiteSettings:r.onOpenWebsiteSettings,onAuthExpired:()=>r.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,r)=>n(_e,{initialTab:e.tab,revealPageGroup:e.revealPageGroup,themeFromDocument:!r.capabilities.hasSiteTheme,tokenRef:r.tokenRef,siteId:r.siteId,onNotify:r.onNotify},e.tab??"")},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>n(Ae,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>n(De,{unavailable:n(X,{what:"Social link"})})},ticker:{name:j,kindLabel:w,icon:"ticker",head:(e,r)=>e.kind==="ticker"?wt(r,e.heroId,o(j)):null,render:e=>n(Ce,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:T("media"),heroImage:T("image"),heroImage2:T("image2"),part:{name:w,kindLabel:w,icon:"Text",head:(e,r)=>{if(e.kind!=="part")return null;const i=r.describeNode(e.nodeId);if(!i)return null;const{key:s,row:d}=lt(e.propKey),S=d?at(i.fields[s],d):i.fields[s],p=xe(i.type),m=p?Ke(p,e.propKey):null,f=p&&m?p[m].label:Me[e.propKey],g=f?o(f):ct(o(pt(mt(S??{},s))),d),E=W({name:g,tier:"part",of:o(i.label)},{partOf:({name:k})=>o("Part of {name}",{name:k})});return{name:E.name,kindLabel:E.kind}},render:(e,r)=>e.kind==="part"?n(Fe,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>r.onSelectNode(e.nodeId),onEditStyle:r.onOpenSiteStyles}):null}},kt=new Set(["header","website","chat"]);function Pt(e,r){if(e==="selection")return null;const i=Et[e];return kt.has(e)&&!r.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>n(X,{what:i.name})}:i}function vt({mode:e,onOpenWebsiteSettings:r,onOpenSiteStyles:i,onOpenPageStyles:s,onSelectNode:d,hideNodeActions:S=!1,onNotify:p,onHidePanel:m}){const{capabilities:f,tokenRef:g,notifyParent:E,currentSlug:k,siteId:y,runAuthed:Z,readOnly:$,navigate:It}=je(),{rows:q}=ze(),O=q?.find(l=>l.slug===k)??null,J=ge(),Q=Object.keys(J.fields).some(l=>!l.startsWith("_")&&!K.includes(l)),{websiteName:V}=Ge(),P=Ye({readOnly:$}),{select:ee}=Xe(),{selectedItem:t,getItemById:te,getSelectorForId:ne,config:u,appState:oe}=we(l=>l),re=Te(u,t?{type:t.type,props:t.props}:null),_=t?ft(re??u.components[t.type]?.fields,t.props):[],ie=l=>u.components[l]?.label??l,a=t?ne(t.props.id):void 0,c=Pt(e.kind,f),se=Oe(),N={capabilities:f,tokenRef:g,hostPanels:se.chrome?.panels,describeNode:l=>{const b=te(l);if(!b)return null;const x=u.components[b.type];return{type:b.type,label:x?.label??b.type,fields:x?.fields??{},props:b.props??{}}},siteId:y,websiteName:V??null,notifyParent:E,onNotify:p,onOpenWebsiteSettings:r,onOpenSiteStyles:i,onSelectNode:d},H=c?.head?.(e,N)??null,R=Pe({kind:O?.kind,pageName:O?.label}),ae=H?.name??(c?o(c.name):t?o(ie(t.type)):R.name),le=H?.kindLabel??(c?o(c.kindLabel):t?a&&a.zone!==Y?o("Block"):o("Section"):R.kindLabel),ce=c?c.icon:t?t.type:"page",A=c?null:t?u.components[t.type]?.fields??null:u.root?.fields??null,de=A?it(A):2,D=I(e)&&t?ut(t.type):null,pe=!!t&&!!a&&a.zone===Y&&t.type!==L&&t.type!==Je,v=Qe(oe?.data,t),me=()=>{v||a&&P.duplicateComponent(a.zone,a.index)},fe=()=>{a&&(P.removeComponent(a.zone,a.index),P.select(null))},ue=t?u.components[t.type]?.defaultProps?.previewHover:void 0,C=I(e)&&!!t&&!!a&&ue!==void 0,F=C&&t.props.previewHover===!0,he=()=>{!t||!a||P.replaceComponent(a.zone,a.index,{...t,props:{...t.props,previewHover:!F}})},[B,Se]=be(He);return h("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right${B||!(!c&&!!t)?"":" sf-hints-folded"}`,children:[n(ve,{icon:n(ye,{type:ce,size:15}),name:ae,kind:le,actions:!S&&I(e)&&t&&t.type!==L?h(M,{children:[n(z,{label:o("Duplicate section"),title:v??void 0,disabled:v!==null,onClick:me,children:n(Ie,{size:15})}),pe&&f.hasSiteSettings&&n(We,{node:t,currentSlug:k,siteId:y??void 0,tokenRef:g,runAuthed:Z,onNotify:p}),n(z,{label:o("Remove section"),danger:!0,onClick:fe,children:n(Le,{size:15})}),m?n(G,{side:"right",onHide:m,divider:!0}):null]}):m?n(G,{side:"right",onHide:m}):void 0}),C&&h("div",{className:"sf-preview-pin",children:[h("div",{className:"sf-preview-pin-text",children:[n("span",{className:"sf-preview-pin-label",children:o("Preview hover state")}),n("span",{className:"sf-preview-pin-hint",children:o("not shown live")})]}),n(rt,{checked:F,onChange:he,ariaLabel:o("Preview hover state")})]}),n(st,{tier:de,children:n("div",{className:"sf-insp-body es-insp-body sf-scroll",children:c?c.render(e,N):t?h(M,{children:[t.type===L&&f.hasSiteSettings&&n(Ve,{}),n(qe,{children:n(U,{entries:n($e,{parts:_,heading:!1,onOpen:l=>ee(dt(t.props.id,l))}),entryCount:Ze(_).length})}),D&&n(Be,{source:D,slug:St(t?.props),menuId:ht(t?.props)}),n(Ne,{shown:B,onChange:Se})]}):Q?n(U,{omit:K}):n(ke,{variant:"none",icon:!1,message:o("Select a section or block to edit it."),children:s&&n(Ee,{variant:"secondary",onClick:s,children:o("This page")})})})})]})}export{Pn as CHAT_MODE,gn as HEADER_MODE,wn as SELECTION_MODE,vn as SOCIAL_MODE,En as WEBSITE_MODE,kn as WEBSITE_PAGE_MODE,vt as default,Pt as resolvePanel};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as d,Fragment as L}from"react/jsx-runtime";import{parseHexColor as _}from"efficient-shell/format";import{Button as b,IconButton as O,Tooltip as S}from"efficient-shell/ui";import j from"./ThemeColourField.js";import{say as a}from"../../format/lib/editor-words.js";import{ColourRow as k}from"../lib/document/ColourControl.js";import{ButtonIcon as A,ChevronDownIcon as x,ChevronUpIcon as D,GroundIcon as F,LayoutIcon as H,SquareIcon as P,TextSmallIcon as M,TypeIcon as B}from"efficient-easel/icons";import{DEFAULT_THEMES as I,GRADE_LABEL as v,contrastRatio as T,gradeContrast as R,normalizeThemeColors as p,resolvedButtonInk as E,themeButtonColour as $,themeButtonInk as U}from"../../format/lib/theme.js";const G=t=>a("Theme {n}",{n:t+1});function w({colors:t}){const n=p(t),s=$(t)??n.accent;return d("span",{className:"sf-theme-page",style:{background:n.background,color:n.text},"aria-hidden":!0,children:[e("span",{className:"sf-theme-eyebrow",style:{color:n.muted},children:a("label")}),d("span",{className:"sf-theme-headline",children:[a("Heading")," ",e("span",{style:{color:n.accent},children:a("accent")})]}),e("span",{className:"sf-theme-body",children:a("body text")}),d("span",{className:"sf-theme-row",children:[e("span",{className:"sf-theme-btn",style:{background:s,color:E(t,n.accent)},children:a("button")}),e("span",{className:"sf-theme-mini",style:{background:n.surface,borderColor:n.line},children:a("card")})]})]})}const g={"Text color":e(B,{}),"Label color":e(M,{}),Background:e(F,{}),"Panels & cards":e(H,{}),Borders:e(P,{}),"Button color":e(A,{}),"Button text color":e(B,{})};function J({label:t,colorKey:n,value:s,onChange:c,idPrefix:o="sf-theme-ink"}){const r=`${o}-${n}`;return e(k,{label:a(t),icon:g[t],id:r,value:s,onChange:l=>c(n,l)})}function W({value:t,accent:n,onChange:s,idPrefix:c="sf-theme-ink"}){const o=`${c}-button`,r=t!==void 0&&_(t)===t.toLowerCase(),l=r?t:n;return e(k,{label:a("Button color"),icon:g["Button color"],id:o,value:l,caption:r?l:a("Main"),onChange:s})}function q({colors:t,accent:n,onChange:s,idPrefix:c="sf-theme-ink"}){const o=`${c}-button-ink`,r=U(t),l=E(t,n),i=$(t)??n,m=R(T(l,i)??0);return e(k,{label:a("Button text color"),icon:g["Button text color"],hint:r&&m!=="good"?a("{grade} on the button",{grade:a(v[m])}):void 0,id:o,value:l,caption:r?l:a("Auto"),onChange:s})}const K=[{colour:!0},{label:"Text color",key:"text"},{label:"Label color",key:"muted"},{button:!0},{buttonInk:!0},{moduleBreak:!0},{label:"Background",key:"background"},{label:"Panels & cards",key:"surface"},{label:"Borders",key:"line"}];function Q({colors:t,onChange:n,idPrefix:s}){const c=p(t);return e(L,{children:K.map(o=>"colour"in o?e(j,{value:t,onChange:n},"colour"):"moduleBreak"in o?e("div",{className:"sf-theme-module-break","aria-hidden":"true"},"module-break"):"button"in o?e(W,{value:t.button,accent:c.accent,onChange:r=>n({...t,button:r}),idPrefix:s},"button"):"buttonInk"in o?e(q,{colors:t,accent:c.accent,onChange:r=>n({...t,buttonInk:r}),idPrefix:s},"buttonInk"):e(J,{label:o.label,colorKey:o.key,value:c[o.key],onChange:(r,l)=>n({...t,[r]:l}),idPrefix:s},o.key))})}function oe({index:t,colors:n,selected:s,role:c="radio",open:o,editable:r=!0,onPick:l,onEdit:i,onChangeColors:m}){const h=p(n),u=G(t),f=t<I.length&&!n.brandInk?I[t]:null,N=R(T(h.text,h.background)??0),y=f?JSON.stringify(n)!==JSON.stringify(f):!1,C=o!==void 0;return d("div",{className:`sf-theme-card${s?" is-selected":""}`,children:[e("button",{type:"button",role:c,"aria-checked":c==="radio"?s:void 0,"aria-selected":c==="option"?s:void 0,"aria-label":u,className:"sf-theme-pick",onClick:l,children:e(w,{colors:n})}),d("div",{className:"sf-theme-foot",children:[e("span",{className:"sf-theme-name",children:u}),N!=="good"&&e("span",{className:"sf-theme-warn",children:a(v[N])}),r&&i&&C&&e("span",{className:"sf-theme-edit",children:e(S,{content:o?a("Collapse"):a("Edit colors"),children:e(O,{size:"sm","aria-expanded":o,"aria-controls":`sf-theme-colours-${t}`,"aria-label":o?a("Collapse {name}",{name:u}):a("Edit colors for {name}",{name:u}),onClick:i,children:o?e(D,{size:14}):e(x,{size:14})})})}),r&&i&&!C&&e(b,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":a("Edit {name}",{name:u}),onClick:i,children:a("Edit")})]}),o&&d("div",{id:`sf-theme-colours-${t}`,className:"sf-theme-colours",children:[e(Q,{colors:n,onChange:z=>m?.(z)}),f&&e(b,{variant:"link",size:"sm",className:"sf-theme-reset",disabled:!y,onClick:()=>m?.({...f}),children:y?a("Reset {name} to the preset",{name:u}):a("Not changed")})]})]})}function se({colors:t,name:n,nameId:s,open:c,menuId:o,labelId:r,buttonRef:l,onClick:i,onKeyDown:m,onEdit:h}){return d("div",{className:"sf-secttheme-btn",children:[e("button",{ref:l,type:"button",className:"sf-theme-pick","aria-expanded":c,"aria-controls":o,"aria-labelledby":`${r} ${s}`,onClick:i,onKeyDown:m,children:t?e(w,{colors:t}):e("span",{className:"sf-secttheme-nopreview","aria-hidden":"true"})}),d("div",{className:"sf-theme-foot",children:[e("span",{id:s,className:"sf-theme-name",children:n}),h&&e(b,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":a("Edit {name}",{name:n}),onClick:h,children:a("Edit")}),e("button",{type:"button",className:"sf-secttheme-caret","aria-hidden":"true",tabIndex:-1,onClick:i,children:e(x,{size:12,className:"sf-multi-caret","aria-hidden":"true"})})]})]})}export{oe as ThemeCard,se as ThemeCardTrigger,J as ThemeColourRow,Q as ThemeColourRows,w as ThemePreview,G as themeName};
1
+ "use client";import{jsx as e,jsxs as d,Fragment as L}from"react/jsx-runtime";import{parseHexColor as _}from"efficient-shell/format";import{Button as b,IconButton as O,Tooltip as S}from"efficient-shell/ui";import j from"./ThemeColourField.js";import{say as a}from"../../format/lib/editor-words.js";import{ColourRow as k}from"../lib/document/ColourControl.js";import{ButtonIcon as A,ChevronDownIcon as x,ChevronUpIcon as D,GroundIcon as F,LayoutIcon as H,SquareIcon as P,TextSmallIcon as M,TypeIcon as B}from"efficient-easel/icons";import{DEFAULT_THEMES as I,GRADE_LABEL as v,contrastRatio as T,gradeContrast as R,normalizeThemeColors as p,resolvedButtonInk as E,themeButtonColour as $,themeButtonInk as U}from"../../format/lib/theme.js";const G=t=>a("Theme {n}",{n:t+1});function w({colors:t}){const n=p(t),s=$(t)??n.accent;return d("span",{className:"sf-theme-page",style:{background:n.background,color:n.text},"aria-hidden":!0,children:[e("span",{className:"sf-theme-eyebrow",style:{color:n.muted},children:a("label")}),d("span",{className:"sf-theme-headline",children:[a("Heading")," ",e("span",{style:{color:n.accent},children:a("main")})]}),e("span",{className:"sf-theme-body",children:a("body text")}),d("span",{className:"sf-theme-row",children:[e("span",{className:"sf-theme-btn",style:{background:s,color:E(t,n.accent)},children:a("button")}),e("span",{className:"sf-theme-mini",style:{background:n.surface,borderColor:n.line},children:a("card")})]})]})}const g={"Text color":e(B,{}),"Label color":e(M,{}),Background:e(F,{}),"Panels & cards":e(H,{}),Borders:e(P,{}),"Button color":e(A,{}),"Button text color":e(B,{})};function J({label:t,colorKey:n,value:s,onChange:c,idPrefix:o="sf-theme-ink"}){const r=`${o}-${n}`;return e(k,{label:a(t),icon:g[t],id:r,value:s,onChange:l=>c(n,l)})}function W({value:t,accent:n,onChange:s,idPrefix:c="sf-theme-ink"}){const o=`${c}-button`,r=t!==void 0&&_(t)===t.toLowerCase(),l=r?t:n;return e(k,{label:a("Button color"),icon:g["Button color"],id:o,value:l,caption:r?l:a("Main"),onChange:s})}function q({colors:t,accent:n,onChange:s,idPrefix:c="sf-theme-ink"}){const o=`${c}-button-ink`,r=U(t),l=E(t,n),i=$(t)??n,m=R(T(l,i)??0);return e(k,{label:a("Button text color"),icon:g["Button text color"],hint:r&&m!=="good"?a("{grade} on the button",{grade:a(v[m])}):void 0,id:o,value:l,caption:r?l:a("Auto"),onChange:s})}const K=[{colour:!0},{label:"Text color",key:"text"},{label:"Label color",key:"muted"},{button:!0},{buttonInk:!0},{moduleBreak:!0},{label:"Background",key:"background"},{label:"Panels & cards",key:"surface"},{label:"Borders",key:"line"}];function Q({colors:t,onChange:n,idPrefix:s}){const c=p(t);return e(L,{children:K.map(o=>"colour"in o?e(j,{value:t,onChange:n},"colour"):"moduleBreak"in o?e("div",{className:"sf-theme-module-break","aria-hidden":"true"},"module-break"):"button"in o?e(W,{value:t.button,accent:c.accent,onChange:r=>n({...t,button:r}),idPrefix:s},"button"):"buttonInk"in o?e(q,{colors:t,accent:c.accent,onChange:r=>n({...t,buttonInk:r}),idPrefix:s},"buttonInk"):e(J,{label:o.label,colorKey:o.key,value:c[o.key],onChange:(r,l)=>n({...t,[r]:l}),idPrefix:s},o.key))})}function oe({index:t,colors:n,selected:s,role:c="radio",open:o,editable:r=!0,onPick:l,onEdit:i,onChangeColors:m}){const h=p(n),u=G(t),f=t<I.length&&!n.brandInk?I[t]:null,N=R(T(h.text,h.background)??0),y=f?JSON.stringify(n)!==JSON.stringify(f):!1,C=o!==void 0;return d("div",{className:`sf-theme-card${s?" is-selected":""}`,children:[e("button",{type:"button",role:c,"aria-checked":c==="radio"?s:void 0,"aria-selected":c==="option"?s:void 0,"aria-label":u,className:"sf-theme-pick",onClick:l,children:e(w,{colors:n})}),d("div",{className:"sf-theme-foot",children:[e("span",{className:"sf-theme-name",children:u}),N!=="good"&&e("span",{className:"sf-theme-warn",children:a(v[N])}),r&&i&&C&&e("span",{className:"sf-theme-edit",children:e(S,{content:o?a("Collapse"):a("Edit colors"),children:e(O,{size:"sm","aria-expanded":o,"aria-controls":`sf-theme-colours-${t}`,"aria-label":o?a("Collapse {name}",{name:u}):a("Edit colors for {name}",{name:u}),onClick:i,children:o?e(D,{size:14}):e(x,{size:14})})})}),r&&i&&!C&&e(b,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":a("Edit {name}",{name:u}),onClick:i,children:a("Edit")})]}),o&&d("div",{id:`sf-theme-colours-${t}`,className:"sf-theme-colours",children:[e(Q,{colors:n,onChange:z=>m?.(z)}),f&&e(b,{variant:"link",size:"sm",className:"sf-theme-reset",disabled:!y,onClick:()=>m?.({...f}),children:y?a("Reset {name} to the preset",{name:u}):a("Not changed")})]})]})}function se({colors:t,name:n,nameId:s,open:c,menuId:o,labelId:r,buttonRef:l,onClick:i,onKeyDown:m,onEdit:h}){return d("div",{className:"sf-secttheme-btn",children:[e("button",{ref:l,type:"button",className:"sf-theme-pick","aria-expanded":c,"aria-controls":o,"aria-labelledby":`${r} ${s}`,onClick:i,onKeyDown:m,children:t?e(w,{colors:t}):e("span",{className:"sf-secttheme-nopreview","aria-hidden":"true"})}),d("div",{className:"sf-theme-foot",children:[e("span",{id:s,className:"sf-theme-name",children:n}),h&&e(b,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":a("Edit {name}",{name:n}),onClick:h,children:a("Edit")}),e("button",{type:"button",className:"sf-secttheme-caret","aria-hidden":"true",tabIndex:-1,onClick:i,children:e(x,{size:12,className:"sf-multi-caret","aria-hidden":"true"})})]})]})}export{oe as ThemeCard,se as ThemeCardTrigger,J as ThemeColourRow,Q as ThemeColourRows,w as ThemePreview,G as themeName};
@@ -1 +1 @@
1
- "use client";import{jsx as a,Fragment as B,jsxs as k}from"react/jsx-runtime";import{useCallback as R,useEffect as g,useRef as $,useState as y}from"react";import{SettingsSwitch as ee}from"efficient-easel/panel";import{PagesIcon as te,StylesIcon as oe}from"efficient-easel/rail";import{PaletteIcon as re}from"efficient-shell/icons/efficient";import{Subtree as ne,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ie}from"./LocationsTreeContext.js";import se from"./PagesPanel.js";import{usePreviewChat as ae}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as ce}from"./preview-devices.js";import{PreviewDeviceContext as de}from"efficient-easel/draw/client";import{usePreviewSocial as le}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as pe}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as me,usePreviewTicker as fe}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as ue}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as Se}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as Ee,HERO_PART_MODE as W,heroMediaRows as he,heroPartId as M,readHeroPartId as Pe}from"../../render/lib/document/hero-media-parts.js";import Te,{CHAT_MODE as we,HEADER_MODE as ge,SOCIAL_MODE as be,WEBSITE_MODE as V,WEBSITE_PAGE_MODE as Ie}from"./SectionEditor.js";import L from"./SectionIcon.js";import ve from"./SectionThumbnail.js";import{useScreenDocument as C}from"efficient-easel/screen/components/ScreenDocumentContext";import _e from"./StylesPanel.js";import{LOCATIONS_TYPE as ke,useLocationsTree as Re}from"./useLocationsTree.js";import{usePinnedChromeSeed as Le}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Ce}from"./useHostDocumentBridge.js";import{usePreviewHref as Oe}from"./usePreviewHref.js";import{WebsitePreviewButton as Ae}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as Be,SITE_STYLES_TABS as ye,SITE_STYLES_TEXT_TAB as De,useWebsiteName as Ne}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as He}from"./useWebsiteMainAction.js";import{VersionHistory as We}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Me}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Ve,heroGroupNestDepth as xe}from"../../format/lib/hero-group-placement.js";import{stripMarkup as Ge}from"../../format/lib/markup.js";import{categoryShortLabel as Ye,PINNED_SECTION_TYPE as Fe}from"../lib/document/add-palette.js";import{canAddTo as Ke}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as je}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as ze}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as Ue,setBookingPreview as Ze}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as qe}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as Xe}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as Je,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as Qe,readLeftView as $e,resolveLeftView as et,writeLeftView as tt}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as ot}from"../lib/document/locked-blocks.js";import{everyPageNotice as rt,noOwnTab as nt,pinnedReach as Y,websiteDuplicateBlocked as it}from"../lib/document/every-page.js";import{sharedSectionReach as st,WEBSITE_SHARED_SECTIONS as at}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as ct}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as v}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as dt,scrollPreviewToTop as K}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as lt}from"../lib/document/overrides.js";import{labelAtLevel as pt}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as mt}from"../../format/lib/document/media-drop.js";import{editorWords as ft,say as f}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ut}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as St,isSectionGroupType as Et,sectionGroupZone as ht,SITE_FOOTER_TYPE as j,SITE_HEADER_TYPE as Pt}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as Tt}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as wt,SAVE_AS_TEMPLATE_EVENT as gt}from"../../format/lib/save-as-template-action.js";import{cityPalettePresets as bt}from"../lib/sections/city-presets.js";import{newSectionNode as It}from"../lib/sections/new-section-node.js";import{useHostProducts as vt}from"../lib/use-host-products.js";import{backendOf as _t}from"../lib/website-session.js";function z({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=fe(),c=H().tree,l=e,n=l.kind==="ticker"?l.heroId:null,s=R(i=>{if(!i)return;t({kind:"ticker",heroId:i}),dt(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const u=String(i.props.id);return i.type==="Hero"&&ue(i.props)&&a(D,{icon:a(L,{type:"ticker",size:13}),name:f(me),onSelect:()=>s(u),selected:n===u,rowProps:{onClick:m(()=>s(u))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=Se(),c=H().tree,{appState:l}=N(p=>p),n=l.data.content??[],s=$(n);s.current=n;const i=e,m=Ee.find(p=>W[p]===i.kind),u=m&&"nodeId"in i?M(String(i.nodeId),m):null,E=R(p=>{const d=Pe(p);if(!d)return;const h=s.current.findIndex(T=>String(T.props.id)===d.nodeId);if(h<0)return;const P={kind:W[d.part],nodeId:d.nodeId};t({index:h},P)},[t]);return g(()=>{o(u)},[u,o]),g(()=>{r(E)},[r,E]),{partRows:(p,{rowClick:d})=>{const h=String(p.props.id),P=he(p);if(P.length===0)return null;const T=S=>{const w=M(h,S.part);return a(D,{icon:a(L,{type:S.part==="media"?"heroMedia":"heroImage",size:13}),name:f(S.label),onSelect:()=>E(w),selected:u===w,rowProps:{onClick:d(()=>E(w))},words:c},w)},[I,...b]=P;return k(B,{children:[T(I),b.length>0&&a(ne,{children:b.map(T)})]})}}}function Z(e,t){return{partRows:(o,r)=>k(B,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function kt(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:l,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=C(),{hasPreviewLink:u}=o,E=_t(x()).preview?.draftLink,p=He(e.data),d=wt({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),h=R(()=>{!c||!r||i(gt,{siteId:c,slug:r})},[i,c,r]),P=Oe({pageSlug:r,siteId:c,token:m}),T=t.previewHref?.(r)??P;return{barLead:()=>d.visible&&a(Tt,{enabled:d.enabled,reason:d.enabled?"":d.disabledReason,onSaved:h}),barView:()=>u&&r&&a(Ae,{liveHref:T,pageId:l??null,draftLink:E}),mainAction:p}}function Rt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:l,navigate:n}=C(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=S=>t.setView(S),[u,E]=y(ye[0].id),[p,d]=y(!1),{surface:h,setSurface:P}=pe(),T=()=>{if(s){m("styles"),t.reveal(),K();return}e.show(V),e.reveal(),K()},I={id:"pages",label:f("Pages"),icon:a(te,{}),panel:({onHide:S})=>a(se,{activeSurface:h,onPreviewSurface:P,onNavigate:w=>{P(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:S})},b=[];return!s&&i&&b.push({id:"appearance",label:f("Appearance"),icon:a(re,{}),active:e.kind==="website",onSelect:T}),s&&b.push({id:"styles",label:f("Styles"),icon:a(oe,{}),panel:({onHide:S,notify:w})=>a(_e,{tokenRef:l,siteId:c??void 0,onClose:S,onNotify:w,tab:u,onTabChange:E,revealPageGroup:p,onPageGroupRevealed:()=>d(!1)})}),{railLead:[I],railTrail:b,resolveLeftView:S=>et(S,s),openSettings:T,openStyles:()=>{E(De),m("styles")},openPageStyles:s?()=>{E(Be),d(!0),m("styles"),t.reveal()}:i?()=>{e.show(Ie),e.reveal()}:void 0}}function Lt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=C(),c=N(n=>n.config),l=x();g(()=>(F({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>F(null)),[e,t,o,c]),g(()=>{const n=O();if(!n||!r)return;let s=!1;return ct(l).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,l])}function Ct(e,t,o,r){const{kind:c,open:l}=e,{selected:n,zoneOf:s}=t;g(()=>{Ze(n?.type==="BookingBox"&&n.props.region==="confirm"?Ue(s(String(n.props.id))):null)},[n?.props.id]);const i=Re(e,t),{capabilities:{hasSiteSettings:m}}=C();Lt();const{chat:u,setChat:E,setSelected:p,setSelectHandler:d}=ae(),h=R(()=>l(we),[l]),P=c==="chat";g(()=>{p(P)},[P,p]),g(()=>{d(h)},[d,h]);const{setOpenHandler:T}=le(),I=R(()=>l(be),[l]);g(()=>{T(I)},[T,I]);const b=Z(z(e),U(e)),S=kt(t),w=Rt(e,r),J=o.device;return{...b,...S,...w,hasOwnRows:_=>_.type===ke,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,wrap:_=>a(ie.Provider,{value:!0,children:k(de.Provider,{value:J,children:[_,a(We,{})]})}),addPanelRow:_=>m?k("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(L,{type:"chat",size:16})}),k("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{_(),h()},children:[f("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:f("A chat bubble on every page")})]}),a(ee,{checked:u.enabled,onChange:Q=>E({enabled:Q}),ariaLabel:f("Show the chat bubble on the whole site")})]}):void 0}}let q=null,A=new WeakMap;function Ot(e){const t=ft();if(!e||!t)return e;q!==t&&(q=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:f(r.label)})):null,spec:e.spec?{...e.spec,addLabel:f(e.spec.addLabel),...e.spec.childLabel?{childLabel:f(e.spec.childLabel)}:{}}:null},A.set(e,o)),o}const At={isLockedBlock:(e,t)=>ot(e,t)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:it,nestDepth:(e,t,o)=>t===Ve?xe(e,o):0,newSectionNode:It,canAddTo:(e,t,o,r)=>Ot(Ke(e,t,r,o)),blockIsOffered:ze,slotsOf:je},Bt=new Proxy(ut,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?f(o):o}}),yt={labelAtLevel:(e,t,o)=>f(pt(e,t,o)),descriptions:Bt,categoryLabel:e=>{const t=Ye(e);return t===void 0?void 0:f(t)},firstSection:Fe,blockRowName:qe,rowName:Xe,plainText:Ge,Icon:L,Thumbnail:ve,useProducts:vt,presets:bt()},Dt={desktop:2e3,tablet:800,mobile:390},X="desktop",Nt={options:ce,initial:X,fluid:X,widths:Dt},Ht={read:$e,write:e=>tt(e),forSelection:(e,t)=>Qe(e,t)},Wt={first:G,last:Je,firstGroup:Pt,lastGroup:j,isSectionGroup:Et,sectionGroupZone:ht,panelOf:e=>e===G?ge:null,get sharedReach(){return v()?Vt:void 0},get shared(){return O()?at:void 0},get groupTab(){return v()?nt:void 0},get groupBadge(){return v()?Y({type:j})??void 0:void 0},get changeNotice(){return v()?rt():void 0},get band(){return v()?Mt:void 0},get groupAccepts(){return v()?St:void 0}},Mt={foldable:!0},Vt=e=>Y(e)??st(e);function xt(e){return{...Z(z(e),U(e)),openSettings:()=>e.show(V)}}function Gt(e,t){Le(e,t),Ce()}const $o={useOwnerName:Ne,useDocumentLabel:Me,useBridges:Ct,useStandaloneBridges:xt,useDocumentPass:Gt,blockRules:At,blockLook:yt,devices:Nt,leftView:Ht,pinned:Wt,Canvas:lt,canvasDrag:{media:mt},Inspector:Te};export{$o as WEBSITE_SCREEN};
1
+ "use client";import{jsx as a,Fragment as y,jsxs as R}from"react/jsx-runtime";import{useCallback as v,useEffect as g,useRef as te,useState as B}from"react";import{SettingsSwitch as oe}from"efficient-easel/panel";import{PagesIcon as re,StylesIcon as ne}from"efficient-easel/rail";import{PaletteIcon as ie}from"efficient-shell/icons/efficient";import{Subtree as se,TreeRow as D}from"efficient-easel/tree";import{useEasel as N}from"efficient-easel/easel";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ae}from"./LocationsTreeContext.js";import{usePartTypingDeps as ce}from"./usePartTypingDeps.js";import{copyItemWrite as de}from"../lib/document/card-copy-rows.js";import le from"./PagesPanel.js";import{usePreviewChat as pe}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as me}from"./preview-devices.js";import{PreviewDeviceContext as ue}from"efficient-easel/draw/client";import{usePreviewSocial as fe}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as Se}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as Ee,usePreviewTicker as Pe}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as he}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as Te}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as we,HERO_PART_MODE as W,heroMediaRows as ge,heroPartId as M,readHeroPartId as Ie}from"../../render/lib/document/hero-media-parts.js";import be,{CHAT_MODE as ve,HEADER_MODE as _e,SOCIAL_MODE as ke,WEBSITE_MODE as V,WEBSITE_PAGE_MODE as Re}from"./SectionEditor.js";import C from"./SectionIcon.js";import Ce from"./SectionThumbnail.js";import{useScreenDocument as L}from"efficient-easel/screen/components/ScreenDocumentContext";import Le from"./StylesPanel.js";import{LOCATIONS_TYPE as Oe,useLocationsTree as Ae}from"./useLocationsTree.js";import{usePinnedChromeSeed as ye}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as Be}from"./useHostDocumentBridge.js";import{usePreviewHref as De}from"./usePreviewHref.js";import{WebsitePreviewButton as Ne}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as He,SITE_STYLES_TABS as We,SITE_STYLES_TEXT_TAB as Me,useWebsiteName as Ve}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as xe}from"./useWebsiteMainAction.js";import{VersionHistory as Ge}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Ye}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as Fe,heroGroupNestDepth as Ke}from"../../format/lib/hero-group-placement.js";import{stripMarkup as je}from"../../format/lib/markup.js";import{categoryShortLabel as ze,PINNED_SECTION_TYPE as Ue}from"../lib/document/add-palette.js";import{canAddTo as Ze}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as qe}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as Xe}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as Je,setBookingPreview as Qe}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as $e}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as et}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as tt,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as ot,readLeftView as rt,resolveLeftView as nt,writeLeftView as it}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as st}from"../lib/document/locked-blocks.js";import{everyPageNotice as at,noOwnTab as ct,pinnedReach as Y,websiteDuplicateBlocked as dt}from"../lib/document/every-page.js";import{sharedSectionReach as lt,WEBSITE_SHARED_SECTIONS as pt}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as mt}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as _}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as ut,scrollPreviewToTop as K}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as ft}from"../lib/document/overrides.js";import{labelAtLevel as St}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as Et}from"../../format/lib/document/media-drop.js";import{editorWords as Pt,say as u}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as ht}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as Tt,isSectionGroupType as wt,sectionGroupZone as gt,SITE_FOOTER_TYPE as j,SITE_HEADER_TYPE as It}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as bt}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as vt,SAVE_AS_TEMPLATE_EVENT as _t}from"../../format/lib/save-as-template-action.js";import{cityPalettePresets as kt}from"../lib/sections/city-presets.js";import{newSectionNode as Rt}from"../lib/sections/new-section-node.js";import{useHostProducts as Ct}from"../lib/use-host-products.js";import{backendOf as Lt}from"../lib/website-session.js";function z({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=Pe(),c=H().tree,l=e,n=l.kind==="ticker"?l.heroId:null,s=v(i=>{if(!i)return;t({kind:"ticker",heroId:i}),ut(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const f=String(i.props.id);return i.type==="Hero"&&he(i.props)&&a(D,{icon:a(C,{type:"ticker",size:13}),name:u(Ee),onSelect:()=>s(f),selected:n===f,rowProps:{onClick:m(()=>s(f))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=Te(),c=H().tree,{appState:l}=N(p=>p),n=l.data.content??[],s=te(n);s.current=n;const i=e,m=we.find(p=>W[p]===i.kind),f=m&&"nodeId"in i?M(String(i.nodeId),m):null,E=v(p=>{const d=Ie(p);if(!d)return;const P=s.current.findIndex(T=>String(T.props.id)===d.nodeId);if(P<0)return;const h={kind:W[d.part],nodeId:d.nodeId};t({index:P},h)},[t]);return g(()=>{o(f)},[f,o]),g(()=>{r(E)},[r,E]),{partRows:(p,{rowClick:d})=>{const P=String(p.props.id),h=ge(p);if(h.length===0)return null;const T=S=>{const w=M(P,S.part);return a(D,{icon:a(C,{type:S.part==="media"?"heroMedia":"heroImage",size:13}),name:u(S.label),onSelect:()=>E(w),selected:f===w,rowProps:{onClick:d(()=>E(w))},words:c},w)},[b,...I]=h;return R(y,{children:[T(b),I.length>0&&a(se,{children:I.map(T)})]})}}}function Z(e,t){return{partRows:(o,r)=>R(y,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function Ot(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:l,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=L(),{hasPreviewLink:f}=o,E=Lt(x()).preview?.draftLink,p=xe(e.data),d=vt({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),P=v(()=>{!c||!r||i(_t,{siteId:c,slug:r})},[i,c,r]),h=De({pageSlug:r,siteId:c,token:m}),T=t.previewHref?.(r)??h;return{barLead:()=>d.visible&&a(bt,{enabled:d.enabled,reason:d.enabled?"":d.disabledReason,onSaved:P}),barView:()=>f&&r&&a(Ne,{liveHref:T,pageId:l??null,draftLink:E}),mainAction:p}}function At(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:l,navigate:n}=L(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=S=>t.setView(S),[f,E]=B(We[0].id),[p,d]=B(!1),{surface:P,setSurface:h}=Se(),T=()=>{if(s){m("styles"),t.reveal(),K();return}e.show(V),e.reveal(),K()},b={id:"pages",label:u("Pages"),icon:a(re,{}),panel:({onHide:S})=>a(le,{activeSurface:P,onPreviewSurface:h,onNavigate:w=>{h(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:S})},I=[];return!s&&i&&I.push({id:"appearance",label:u("Appearance"),icon:a(ie,{}),active:e.kind==="website",onSelect:T}),s&&I.push({id:"styles",label:u("Styles"),icon:a(ne,{}),panel:({onHide:S,notify:w})=>a(Le,{tokenRef:l,siteId:c??void 0,onClose:S,onNotify:w,tab:f,onTabChange:E,revealPageGroup:p,onPageGroupRevealed:()=>d(!1)})}),{railLead:[b],railTrail:I,resolveLeftView:S=>nt(S,s),openSettings:T,openStyles:()=>{E(Me),m("styles")},openPageStyles:s?()=>{E(He),d(!0),m("styles"),t.reveal()}:i?()=>{e.show(Re),e.reveal()}:void 0}}function yt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=L(),c=N(n=>n.config),l=x();g(()=>(F({openPage:n=>e({kind:"page",slug:n.slug,siteId:t??void 0}),reload:()=>{o()},config:c}),()=>F(null)),[e,t,o,c]),g(()=>{const n=O();if(!n||!r)return;let s=!1;return mt(l).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,l])}function q(){const e=ce();return v(t=>{de(t,e)},[e])}function Bt(e,t,o,r){const{kind:c,open:l}=e,{selected:n,zoneOf:s}=t;g(()=>{Qe(n?.type==="BookingBox"&&n.props.region==="confirm"?Je(s(String(n.props.id))):null)},[n?.props.id]);const i=Ae(e,t),{capabilities:{hasSiteSettings:m}}=L();yt();const{chat:f,setChat:E,setSelected:p,setSelectHandler:d}=pe(),P=v(()=>l(ve),[l]),h=c==="chat";g(()=>{p(h)},[h,p]),g(()=>{d(P)},[d,P]);const{setOpenHandler:T}=fe(),b=v(()=>l(ke),[l]);g(()=>{T(b)},[T,b]);const I=Z(z(e),U(e)),S=Ot(t),w=At(e,r),Q=o.device,$=q();return{...I,...S,...w,hasOwnRows:k=>k.type===Oe,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,onCopyItem:$,wrap:k=>a(ae.Provider,{value:!0,children:R(ue.Provider,{value:Q,children:[k,a(Ge,{})]})}),addPanelRow:k=>m?R("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(C,{type:"chat",size:16})}),R("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),P()},children:[u("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:u("A chat bubble on every page")})]}),a(oe,{checked:f.enabled,onChange:ee=>E({enabled:ee}),ariaLabel:u("Show the chat bubble on the whole site")})]}):void 0}}let X=null,A=new WeakMap;function Dt(e){const t=Pt();if(!e||!t)return e;X!==t&&(X=t,A=new WeakMap);let o=A.get(e);return o||(o={...e,choices:e.choices?e.choices.map(r=>({...r,label:u(r.label)})):null,spec:e.spec?{...e.spec,addLabel:u(e.spec.addLabel),...e.spec.childLabel?{childLabel:u(e.spec.childLabel)}:{}}:null},A.set(e,o)),o}const Nt={isLockedBlock:(e,t)=>st(e,t)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:dt,nestDepth:(e,t,o)=>t===Fe?Ke(e,o):0,newSectionNode:Rt,canAddTo:(e,t,o,r)=>Dt(Ze(e,t,r,o)),blockIsOffered:Xe,slotsOf:qe,resolveOnInsert:!0},Ht=new Proxy(ht,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?u(o):o}}),Wt={labelAtLevel:(e,t,o)=>u(St(e,t,o)),descriptions:Ht,categoryLabel:e=>{const t=ze(e);return t===void 0?void 0:u(t)},firstSection:Ue,blockRowName:$e,rowName:et,plainText:je,Icon:C,Thumbnail:Ce,useProducts:Ct,presets:kt()},Mt={desktop:2e3,tablet:800,mobile:390},J="desktop",Vt={options:me,initial:J,fluid:J,widths:Mt},xt={read:rt,write:e=>it(e),forSelection:(e,t)=>ot(e,t)},Gt={first:G,last:tt,firstGroup:It,lastGroup:j,isSectionGroup:wt,sectionGroupZone:gt,panelOf:e=>e===G?_e:null,get sharedReach(){return _()?Ft:void 0},get shared(){return O()?pt:void 0},get groupTab(){return _()?ct:void 0},get groupBadge(){return _()?Y({type:j})??void 0:void 0},get changeNotice(){return _()?at():void 0},get band(){return _()?Yt:void 0},get groupAccepts(){return _()?Tt:void 0}},Yt={foldable:!0},Ft=e=>Y(e)??lt(e);function Kt(e){return{...Z(z(e),U(e)),onCopyItem:q(),openSettings:()=>e.show(V)}}function jt(e,t){ye(e,t),Be()}const ir={useOwnerName:Ve,useDocumentLabel:Ye,useBridges:Bt,useStandaloneBridges:Kt,useDocumentPass:jt,blockRules:Nt,blockLook:Wt,devices:Vt,leftView:xt,pinned:Gt,Canvas:ft,canvasDrag:{media:Et},Inspector:be};export{ir as WEBSITE_SCREEN};
@@ -16,7 +16,7 @@
16
16
  * Everything is scoped under `.sf-editor` so it can never leak into the public
17
17
  * storefront. Colour is driven entirely by tokens so the chrome themes in ONE
18
18
  * place — and that place is efficient-shell (harness UI-24,
19
- * Efficient-Pty-Ltd/efficient-easel#199). Every chrome rule reads a `--sf-*`
19
+ * eff-erp/efficient-easel#199). Every chrome rule reads a `--sf-*`
20
20
  * (aliased by efficient-easel's `screen.css` onto `--es-*`, which easel aliases
21
21
  * onto the shell's tokens), an `--es-*`, or a shell token directly
22
22
  * (`--line-strong`, `--status-*`, `--radius-*`), so the chrome FOLLOWS THE
@@ -6,5 +6,5 @@ export type PartMotionRows = {
6
6
  keys: ReadonlySet<string>;
7
7
  onChange: (key: string, value: unknown) => void;
8
8
  };
9
- export type PartMotionKind = Extract<AnimationTabKind, "textPart" | "block">;
9
+ export type PartMotionKind = Extract<AnimationTabKind, "textPart" | "picture" | "block">;
10
10
  export declare function usePartMotion(nodeId: string, part: string, kind: PartMotionKind): PartMotionRows;
@@ -0,0 +1,2 @@
1
+ import type { PartTypingDeps } from "../lib/document/canvas-typing.js";
2
+ export declare function usePartTypingDeps(): PartTypingDeps;
@@ -0,0 +1 @@
1
+ "use client";import{useMemo as p,useRef as s}from"react";import{useEaselApi as m}from"efficient-easel/easel";import{useSectionOps as i}from"efficient-easel/screen/lib/document/use-section-ops";function l(){const t=m(),o=i(),r=s(o);return r.current=o,p(()=>({getItemById:e=>t.getState().getItemById(e),getSelectorForId:e=>t.getState().getSelectorForId(e),get components(){return t.getState().config.components},replace:(e,n,c)=>r.current.replaceComponent(e,n,c)}),[t])}export{l as usePartTypingDeps};
@@ -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 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 P,DirectionUpIcon as S,DurationIcon as B}from"efficient-easel/icons";import{deviceField as p}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as G,noControlField as U}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{describedAs as k,group as j,phoneTwinFields as W}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as Y,ENTRANCE_FROM_DEFAULT as I,ENTRANCE_KINDS as h,ENTRANCE_KINDS_WITH_FROM as g,MOTION_TIMING as H,entranceAttrs as z,playEntrance as V,readEntrance as q}from"efficient-shell/format";import{IconPicker as J}from"efficient-shell/ui";import{segmented as Q}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as v}from"../document/controls.js";import{withRowRules as X}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as Z,say as l}from"../../../format/lib/editor-words.js";import{animationDelayField as $,animationDurationField as ee}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as t,LEGACY_ENTRANCE_KEY as D,entranceOf as C}from"../../../render/lib/animation/entrance.js";import{ENTRANCE_GROUP_KEY as ne}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"},oe={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},te={top:()=>e(A,{}),bottom:()=>e(S,{}),left:()=>e(P,{}),right:()=>e(L,{})},u="Entrance",x=h.filter(n=>n!=="none"),y=n=>({any:[{field:t.kind,in:n},{all:[{field:t.kind,set:!1},{field:D,in:n}]}]}),b=n=>({any:[{field:s(t.kind),in:n},{all:[{field:s(t.kind),set:!1},y(n)]}]}),ie=[[[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}),re={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 ae({kind:n}){const{attrs:o}=z(q(n,I));return a("span",{className:"sf-entrance-pic",children:[e("span",{className:"sf-entrance-stage",children:e("i",{...o,children:re[n]})}),e("span",{className:"sf-entrance-cap",children:l(m[n])})]})}const le=(n,o)=>{const i=o.querySelector(".sf-entrance-stage > i");i&&V(i)},ce={width:"3.5rem",height:"4.25rem"};function F({value:n,onChange:o}){return e(J,{label:l(u),value:n,emptyValue:"none",columns:3,cell:ce,onChange:o,onPreview:le,tooltips:!1,options:h.map(i=>({value:i,label:l(m[i]),icon:e(ae,{kind:i})}))})}const E="Effect",M=n=>n==="none"?void 0:l(m[n]);function se({value:n,onChange:o}){const i=v(),d=C({...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 de({value:n,onChange:o}){const i=v(),d=typeof n=="string"&&h.includes(n),f=C(i,"desktop").kind;return e(R,{label:l(E),icon:e(N,{}),value:M(d?n:f),changed:d,action:e(O,{words:Z()?.panel,label:l(E),changed:d,detail:l("{value} on desktop",{value: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]}))},pe=()=>k({type:"custom",render:({value:n,onChange:o})=>e(se,{value:n,onChange:o})},K),me=()=>k({type:"custom",render:({value:n,onChange:o})=>e(de,{value:n,onChange:o})},K),he=Y.map(n=>({label:oe[n],value:n,picture:te[n]()}));function Me(){const{duration:n,delay:o}=H.entrance,i={[ne]:j(u),[t.kind]:p("desktop",pe()),[D]:U({type:"custom",render:()=>e(G,{})},"always"),[s(t.kind)]:p("mobile",me()),...W(t.from,Q("From",e(T,{}),he,I)),[t.duration]:p("desktop",ee("entrance")),[s(t.duration)]:p("mobile",_({label:"Duration",desktopKey:t.duration,icon:e(B,{}),min:n.min,max:n.max,step:n.step,fallback:n.default,unit:"s"})),[t.delay]:p("desktop",$("entrance")),[s(t.delay)]:p("mobile",_({label:"Delay",desktopKey:t.delay,icon:e(w,{}),min:o.min,max:o.max,step:o.step,fallback:o.default,unit:"s"}))};return X(i,ie)}export{re as ENTRANCE_PICTURE,Me as entranceFields};
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,2 +1,2 @@
1
- export type AnimationTabKind = "section" | "block" | "box" | "marquee" | "textPart" | "cards";
1
+ export type AnimationTabKind = "section" | "block" | "box" | "marquee" | "textPart" | "cards" | "picture";
2
2
  export declare function animationTabFields(kind: AnimationTabKind, blockKey?: string): Record<string, unknown>;
@@ -1 +1 @@
1
- import{loopDelayField as i,loopDurationField as t}from"./AnimationDurationRow.js";import{entranceFields as e}from"./entrance-fields.js";import{cardHoverResting as a}from"../../../format/lib/animation/hover.js";import{cardHoverFields as l,hoverFields as c}from"./hover-fields.js";import{loopDirectionField as n,loopFields as s}from"./loop-fields.js";function f(r,o=""){switch(r){case"section":case"block":return e();case"box":return{...e(),...s()};case"textPart":return{...e(),...c()};case"cards":return{...e(),...l(a(o))};case"marquee":return{...e(),scrollDirection:n(),loopDuration:t({readsSpeed:!0}),loopDelay:i()}}}export{f as animationTabFields};
1
+ import{loopDelayField as i,loopDurationField as n}from"./AnimationDurationRow.js";import{entranceFields as e}from"./entrance-fields.js";import{cardHoverResting as s,pictureHoverResting as c}from"../../../format/lib/animation/hover.js";import{cardHoverFields as a,hoverFields as l,pictureHoverFields as t}from"./hover-fields.js";import{loopDirectionField as u,loopFields as p}from"./loop-fields.js";import{truthy as d,withRowsShownWhen as m}from"../../../format/lib/document/show-when-attach.js";function F(){const r=t("none");return m(r,Object.keys(r),d("bgImage"))}function b(r,o=""){switch(r){case"section":case"block":return e();case"box":return{...e(),...p(),...F()};case"picture":return{...e(),...t(c(o),o)};case"textPart":return{...e(),...l()};case"cards":return{...e(),...a(s(o))};case"marquee":return{...e(),scrollDirection:u(),loopDuration:n({readsSpeed:!0}),loopDelay:i()}}}export{b as animationTabFields};
@@ -1,3 +1,9 @@
1
- import { type CardHover } from "../../../format/lib/animation/hover.js";
1
+ import { type CardHover, type PictureHover } from "../../../format/lib/animation/hover.js";
2
2
  export declare function hoverFields(): Record<string, unknown>;
3
3
  export declare function cardHoverFields(resting: CardHover): Record<string, unknown>;
4
+ export declare function pictureHoverFields(resting: PictureHover, blockKey?: string): Record<string, unknown>;
5
+ export declare function offerNextPicture<Fields extends Record<string, unknown>>(fields: Fields, data: {
6
+ props?: Record<string, unknown>;
7
+ }, params: {
8
+ appState?: unknown;
9
+ }): Fields;
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{HoverIcon as h,RotateIcon as l}from"efficient-easel/icons";import{group as H}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as o}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as f,noControlField as E}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{segmented as u,slider as v}from"../document/box-fields.js";import{withShowWhen as i}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as O,animationDurationField as D,showsWhatRuns as d}from"./AnimationDurationRow.js";import{CARD_HOVER_ANGLE as s,CARD_HOVER_KEYS as n,CARD_HOVER_KINDS as A,CARD_HOVER_TURN as V,HOVER_KEY as N,HOVER_KIND_LABELS as w,OLD_SPIN_KEY as I,PART_HOVER_KINDS as K,cardHoverAngleOf as k,cardHoverKindOf as C,cardRotatesRule as g}from"../../../format/lib/animation/hover.js";const m="_gHover",c=()=>o("desktop",H("Hover")),F="What this does when a shopper points at it, or taps it on a phone.",S="What each card does when a shopper points at it, or taps it on a phone. Rotate turns the wheel picture.";function R(e,t){return u("Hover effect",a(h,{}),e.map(r=>({label:w[r],value:r})),t)}function U(){return{[m]:c(),[N]:o("desktop",{...R(K,"none"),description:F})}}function b(e){const t=g(e),r=v("Angle",a(l,{}),s.min,s.max,s.step,V,"°");return{[m]:c(),[n.kind]:o("desktop",{...d(R(A,e),(p,_)=>C(_??{},e)),description:S}),[I]:E({type:"custom",render:()=>a(f,{})},"always"),[n.angle]:o("desktop",i(d(r,p=>k(p)),t)),[n.duration]:o("desktop",i(D("hover"),t)),[n.delay]:o("desktop",i(O("hover"),t))}}export{b as cardHoverFields,U as hoverFields};
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 +1 @@
1
- import{jsx as c}from"react/jsx-runtime";import{AccentIcon as v,ColumnsIcon as x,StylesIcon as f}from"efficient-easel/icons";import{copyText as b,plainText as C,plainTextarea as B,text as w,textarea as M,withOffPage as S}from"../../../controls.js";import{group as p}from"efficient-easel/screen/lib/document/box-fields";import{select as y,slider as A}from"../../../box-fields.js";import{SPLITTABLE_SECTIONS as H,headFieldsForPlacement as N}from"../../../../../../format/lib/sections/section-head-placement.js";import{SECTION_EYEBROW_LOOK_OPTIONS as D,eyebrowLookFor as k}from"../../../../../../format/lib/sections/section-eyebrow-look.js";import{BLOCK_SOURCE_EDIT_PROP as K,blockSourceEditField as W,blockSourceField as J,blockSourceFields as U}from"../../../block-source-fields.js";import{declaredBlockSource as E,sourceChoices as Y}from"../../../../../../format/lib/content/block-sources.js";import{cardKeyOf as q,cardRow as z,cardTemplateFields as O}from"../../../../../../format/lib/content/card-template.js";import{isNodeList as G,newId as I}from"efficient-easel/data";import{say as Q}from"../../../../../../format/lib/editor-words.js";import{withCardsTemplate as V}from"../../../../../../format/lib/document/cards-template-on-read.js";import{CARDS_PH as F,CardsSlots as X}from"../../../../../../format/lib/document/blocks/general/Cards/meta.js";const Z=e=>G(e.template)&&e.template.length>0;function $(e){const r=E(e);return r?Y(r).map(t=>({label:t.label,value:t.key})):(Array.isArray(e.items)?e.items:[]).map((t,l)=>({label:typeof t?.title=="string"&&t.title.trim()||Q("Card {n}",{n:l+1}),value:q(z(t),l)}))}const ee=e=>Object.defineProperty({...e},"key",{get:()=>I("card"),enumerable:!0});function te(e,r){const o=Z(r)&&r.cardStyle!=="label-only"&&!!e.highlightedCard;return Object.fromEntries(Object.entries(e).flatMap(([t,l])=>t==="highlightedCard"?o?[[t,re(l,$(r))]]:[]:t==="highlightBadge"?o?[[t,l]]:[]:t==="items"&&o&&l?[[t,ae(l)]]:[[t,l]]))}const L=new WeakMap;function re(e,r){let o=L.get(e);o||L.set(e,o=new Map);const t=JSON.stringify(r);let l=o.get(t);return l||o.set(t,l={...e,options:[...e.options,...r]}),l}const T=e=>e.kind==="link"?S(C(e.label)):e.multiline?B(e.label):b(e.label),oe=Object.fromEntries(O("Cards").filter(e=>!e.everySource).map(e=>[e.key,T(e)])),le=Object.fromEntries(O("Cards").filter(e=>e.key==="title"||e.key==="body").map(e=>[e.key,T(e)])),_=new WeakMap;function ae(e){let r=_.get(e);return r||_.set(e,r={...e,arrayFields:oe}),r}const we={fields:{_gSource:p("Source"),dataSource:J("Card content","Manual"),[K]:W(),_gContent:p("Content"),eyebrow:w("Eyebrow",F.eyebrow),eyebrowLook:y("Eyebrow style",c(f,{}),[...D],k("Cards")),title:M("Heading",F.title),items:{type:"array",label:"Cards",arrayFields:le,defaultItemProps:ee({title:"",body:""}),getItemSummary:e=>e?.title||e?.body||"Card"},...X,highlightedCard:y("Highlighted card",c(v,{}),[{label:"None",value:""}],""),highlightBadge:w("Highlight badge","Most popular"),_gStyle:p("Style"),cardStyle:y("Card style",c(f,{}),[{label:"Cards",value:"cards"},{label:"Label only",value:"label-only"}],"cards"),columns:A("Columns",c(x,{}),2,4,1,3)},resolveData:e=>{const r=V("Cards",e.props),o=r===e.props?e:{...e,props:r},t=o.props;if(!Array.isArray(t.items)||E(t))return o;const l=t.items,s=typeof t.highlightedCard=="string"?t.highlightedCard.trim():"",i=a=>a&&typeof a=="object"&&typeof a.key=="string"?a.key:"",P=!!s&&!l.some(a=>i(a)===s),d=new Set;let u=t.highlightedCard,h=!1;const R=l.map((a,j)=>{if(!a||typeof a!="object")return a;const n=i(a);if(n&&!d.has(n))return d.add(n),a;const g=!n&&P&&s===String(j+1);if(n||g){const m=I("card");return d.add(m),h=!0,g&&(u=m),{...a,key:m}}return a});return h?{...o,props:{...t,items:R,highlightedCard:u}}:o},resolveFields:(e,{fields:r})=>{const o=N(U("Cards",r,e.props,{hides:["items"]}),e.props.headPlacement,H.Cards.headRows),t=e.props,l=te(o,t);if(t.cardStyle!=="label-only")return l;const s=o.items,i=o.eyebrowLook;return{...l,...s?{items:{...s,arrayFields:{title:b("Feature label"),href:S(C("Link"))}}}:{},...i?{eyebrowLook:{...i,fallback:k("KeyFeatures")}}:{}}}};export{we as CardsFields};
1
+ import{jsx as c}from"react/jsx-runtime";import{AccentIcon as v,ColumnsIcon as x,StylesIcon as f}from"efficient-easel/icons";import{copyText as b,plainText as C,plainTextarea as B,text as w,textarea as M,withOffPage as S}from"../../../controls.js";import{group as p}from"efficient-easel/screen/lib/document/box-fields";import{select as y,slider as A}from"../../../box-fields.js";import{SPLITTABLE_SECTIONS as H,headFieldsForPlacement as N}from"../../../../../../format/lib/sections/section-head-placement.js";import{SECTION_EYEBROW_LOOK_OPTIONS as D,eyebrowLookFor as k}from"../../../../../../format/lib/sections/section-eyebrow-look.js";import{BLOCK_SOURCE_EDIT_PROP as K,blockSourceEditField as W,blockSourceField as J,blockSourceFields as U}from"../../../block-source-fields.js";import{declaredBlockSource as E,sourceChoices as Y}from"../../../../../../format/lib/content/block-sources.js";import{cardKeyOf as q,cardRow as z,cardTemplateFields as O}from"../../../../../../format/lib/content/card-template.js";import{isNodeList as G,newId as F}from"efficient-easel/data";import{say as Q}from"../../../../../../format/lib/editor-words.js";import{cardsFieldsFollowContent as V}from"../../../../../../format/lib/document/cards-template-on-read.js";import{CARDS_PH as I,CardsSlots as X}from"../../../../../../format/lib/document/blocks/general/Cards/meta.js";const Z=e=>G(e.template)&&e.template.length>0;function $(e){const r=E(e);return r?Y(r).map(t=>({label:t.label,value:t.key})):(Array.isArray(e.items)?e.items:[]).map((t,l)=>({label:typeof t?.title=="string"&&t.title.trim()||Q("Card {n}",{n:l+1}),value:q(z(t),l)}))}const ee=e=>Object.defineProperty({...e},"key",{get:()=>F("card"),enumerable:!0});function te(e,r){const o=Z(r)&&r.cardStyle!=="label-only"&&!!e.highlightedCard;return Object.fromEntries(Object.entries(e).flatMap(([t,l])=>t==="highlightedCard"?o?[[t,re(l,$(r))]]:[]:t==="highlightBadge"?o?[[t,l]]:[]:t==="items"&&o&&l?[[t,se(l)]]:[[t,l]]))}const L=new WeakMap;function re(e,r){let o=L.get(e);o||L.set(e,o=new Map);const t=JSON.stringify(r);let l=o.get(t);return l||o.set(t,l={...e,options:[...e.options,...r]}),l}const _=e=>e.kind==="link"?S(C(e.label)):e.multiline?B(e.label):b(e.label),oe=Object.fromEntries(O("Cards").filter(e=>!e.everySource).map(e=>[e.key,_(e)])),le=Object.fromEntries(O("Cards").filter(e=>e.key==="title"||e.key==="body").map(e=>[e.key,_(e)])),T=new WeakMap;function se(e){let r=T.get(e);return r||T.set(e,r={...e,arrayFields:oe}),r}const we={fields:{_gSource:p("Source"),dataSource:J("Card content","Manual"),[K]:W(),_gContent:p("Content"),eyebrow:w("Eyebrow",I.eyebrow),eyebrowLook:y("Eyebrow style",c(f,{}),[...D],k("Cards")),title:M("Heading",I.title),items:{type:"array",label:"Cards",arrayFields:le,defaultItemProps:ee({title:"",body:""}),getItemSummary:e=>e?.title||e?.body||"Card"},...X,highlightedCard:y("Highlighted card",c(v,{}),[{label:"None",value:""}],""),highlightBadge:w("Highlight badge","Most popular"),_gStyle:p("Style"),cardStyle:y("Card style",c(f,{}),[{label:"Cards",value:"cards"},{label:"Label only",value:"label-only"}],"cards"),columns:A("Columns",c(x,{}),2,4,1,3)},resolveData:e=>{const r=V(e.props),o=r===e.props?e:{...e,props:r},t=o.props;if(!Array.isArray(t.items)||E(t))return o;const l=t.items,a=typeof t.highlightedCard=="string"?t.highlightedCard.trim():"",i=s=>s&&typeof s=="object"&&typeof s.key=="string"?s.key:"",P=!!a&&!l.some(s=>i(s)===a),d=new Set;let u=t.highlightedCard,h=!1;const R=l.map((s,j)=>{if(!s||typeof s!="object")return s;const n=i(s);if(n&&!d.has(n))return d.add(n),s;const g=!n&&P&&a===String(j+1);if(n||g){const m=F("card");return d.add(m),h=!0,g&&(u=m),{...s,key:m}}return s});return h?{...o,props:{...t,items:R,highlightedCard:u}}:o},resolveFields:(e,{fields:r})=>{const o=N(U("Cards",r,e.props,{hides:["items"]}),e.props.headPlacement,H.Cards.headRows),t=e.props,l=te(o,t);if(t.cardStyle!=="label-only")return l;const a=o.items,i=o.eyebrowLook;return{...l,...a?{items:{...a,arrayFields:{title:b("Feature label"),href:S(C("Link"))}}}:{},...i?{eyebrowLook:{...i,fallback:k("KeyFeatures")}}:{}}}};export{we as CardsFields};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{phoneKey as t,tabletKey as h}from"efficient-easel/draw";import{BOX_CARD_PAD as d,BOX_DARKEN as s,BOX_DARKEN_STYLES as u,isBackgroundBox as X}from"../../../../../../format/lib/content/box-background.js";import{BOX_TAB_SHAPES as K,REEL_SHAPE_LABELS as j}from"../../../../../../format/lib/reel.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{ClockIcon as v,CropIcon as f,LineBetweenIcon as G,LineSolidIcon as Y,OpacityIcon as J,ShadowIcon as z,StylesIcon as O,TableIcon as g,TargetIcon as V}from"efficient-easel/icons";import{boxBlockSpacingField as q,boxFillField as Q,boxColumnsFields as Z,boxShareField as $,boxSharePhoneField as ee,containerDirectionField as oe,containerGapRows as te,linkField as ne,plainText as ae,swapPadding as A,toggle as c,upload as R,withPanelOnly as ie}from"../../../controls.js";import{BOX_SHAPE_OPTIONS as b,boxShapeOf as le}from"../../../../../../format/lib/content/box-shape.js";import{BOX_COLUMNS_MAX as re,BOX_COLUMNS_MIN as se,boxPhoneRowOneLine as pe}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as E}from"../../../../../../format/lib/content/box-separator.js";import{group as i,phoneTwinFields as C}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as de,boxJustifyField as ce,boxWrapField as N,placementField as Se,select as l,sidesPaddingFields as D,slider as me}from"../../../box-fields.js";import{withRowRules as _e}from"../../../../../../render/lib/document/show-when.js";import{separatorField as he}from"../../../separator-field.js";import{LOOP_SCROLLS as ue}from"../../../../../../format/lib/animation/index.js";import{FlexSlots as fe}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{CARD_BOX_FACTS as Oe,ON_A_CARD as ge,cardDisplayField as Ae}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as Re,mirrorCardsField as be}from"../../../mirror-cards-field.js";import{SHARED_COLUMNS_KEY as r,SHARED_COLUMNS_LABEL as L,SHARED_COLUMNS_OFF as x,sharedColumnsDrawn as F,sharedColumnsFits as H,SHARED_COLUMNS_PHONE_POINTS as Ee,SHARED_COLUMNS_POINTS as Ce}from"../../../../../../render/lib/content/box-shared-columns.js";const Ne={field:"bgImage",set:!0},I={field:"phoneRow",in:[2,3]},De={field:"direction",is:"tabs"},Le={field:"line",in:[!0,!1]},xe={field:"anchor",set:!0},T=["fixed","screen"],Fe={not:{any:[{field:"sectionHeightMode",in:T},{field:"sectionHeightModePhone",in:T}]}},He={context:"parent.line",is:!0},m={field:"direction",is:"row",default:"row"},p={not:ue},k={all:[m,p,{not:{field:"separator",in:E.map(e=>e.value)}},{not:{field:"line",is:!0}}]},Ie={all:[p,{not:{all:[m,{field:"separator",in:E.map(e=>e.value)}]}}]},w={not:{all:[k,{field:"columns",in:Array.from({length:re},(e,n)=>n+se)}]}},Te="sharedColumnsFits",B="sharedColumnsMisfit",P="sharedColumnsDraws",y="sharedColumnsPhoneDraws",ke={[Te]:e=>H(e.props??{}),[B]:e=>!H(e.props??{}),[P]:e=>F(e.props??{}).desktop,[y]:e=>F(e.props??{}).phone};function M(e){return{all:[{not:{context:B,is:!0}},{any:[ge,{field:e,set:!0}]}]}}const _={not:{context:P,is:!0}},S={not:{context:y,is:!0}},we={any:[_,S]};function Be(e){return{...e,render:n=>e.render({...n,value:pe(n.value)?"nowrap":"wrap"})}}const to={fields:_e({_gContent:i("Content"),content:fe.content,_gCardDisplay:i("Display"),cardDisplay:Ae(),_gLayout:i("Layout"),direction:oe("Flex"),tabShape:l("Tab shape",o(O,{}),K.map(e=>({label:j[e],value:e})),"tabs"),mirrorCards:be(),label:ie(ae("Tab name")),...te("Flex"),justify:ce(),align:de(),...C("wrap",N(),void 0,{phoneRow:Be(N())}),boxShape:a("desktop",l("Box shape",o(f,{}),[...b],"auto")),[t("boxShape")]:C("boxShape",l("Box shape",o(f,{}),[...b],"auto",{phoneRest:e=>le(e)}))[t("boxShape")],separator:he(o(G,{size:18}),"none"),share:a("desktop",$()),[t("share")]:ee(),[r]:a("desktop",l(L,o(g,{}),[...Ce],x)),[t(r)]:a("mobile",l(L,o(g,{}),[...Ee],x)),...Z(),blockSpacing:q(),line:c("Line",!1,o(Y,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,o(v,{}),"Still to come: a hollow dot, and the gold line stops before it."),_gShadow:i("Shadow"),shadow:c("Shadow",!1,o(z,{})),fillColor:Q(),_gBackground:i("Background image"),bgImage:a("desktop",R("Image","image/*")),bgImagePhone:a("mobile",R("Image","image/*")),darken:me("Darken",o(J,{}),s.min,s.max,s.step,s.fallback,s.unit),darkenStyle:l("Darken style",o(O,{}),u,u[0].value),placement:Se("Content position"),_gLink:i("Link"),link:ne("Link to"),jumpHighlight:c("Highlight when a link jumps here",!1,o(V,{}),"When a link lands on this Box's anchor, the Box gets an accent outline and its first block turns accent.")},[[["darken","darkenStyle","placement"],Ne],[[t("share")],{all:[I,S]}],[[r],M(r)],[[t(r)],M(t(r))],[[t("wrap")],{all:[I,p,S]}],[["phoneRow"],S],[["tabShape"],De],[["separator"],m],[["columns",h("columns")],k],[[h("gap")],Ie],[["justify"],{all:[p,we]}],[["wrap"],{all:[p,w,_]}],[["share"],{all:[w,_]}],[["line"],Le],[["upcoming"],He],[["jumpHighlight"],xe],[["boxShape",t("boxShape")],Fe]]),resolveFields:(e,{fields:n})=>{const U=e.props;if(X(U.bgImage)){const W=D({fallback:{top:d.desktop,bottom:d.desktop,left:d.side,right:d.side},tablet:!0});return A(n,W)}return e.props.padV2!==!0?A(n,D({fallback:{top:24,bottom:24},tablet:!0})):n},showWhenFacts:{...Oe,...Re,...ke}};export{to as FlexFields};
1
+ import{jsx as e}from"react/jsx-runtime";import{phoneKey as t,tabletKey as a}from"efficient-easel/draw";import{BOX_CARD_PAD as d,isBackgroundBox as W}from"../../../../../../format/lib/content/box-background.js";import{darkenFields as X}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as j,REEL_SHAPE_LABELS as K}from"../../../../../../format/lib/reel.js";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{ClockIcon as v,CropIcon as u,LineBetweenIcon as G,LineSolidIcon as Y,ShadowIcon as J,StylesIcon as V,TableIcon as A,TargetIcon as z}from"efficient-easel/icons";import{boxBlockSpacingField as q,boxFillField as Q,boxColumnsFields as Z,boxShareField as $,boxSharePhoneField as oo,boxShareTabletField as eo,containerDirectionField as no,containerGapRows as to,linkField as ao,plainText as io,swapPadding as g,toggle as c,upload as O,withPanelOnly as lo}from"../../../controls.js";import{BOX_SHAPE_OPTIONS as R,boxShapeOf as ro}from"../../../../../../format/lib/content/box-shape.js";import{BOX_COLUMNS_MAX as E,BOX_COLUMNS_MIN as C,boxPhoneRowOneLine as so}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as b}from"../../../../../../format/lib/content/box-separator.js";import{VIEW_KEY_ACCESS as po,group as i,phoneTwinFields as F}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as co,boxJustifyField as mo,boxWrapField as L,placementField as So,select as s,sidesPaddingFields as N}from"../../../box-fields.js";import{withRowRules as _o}from"../../../../../../render/lib/document/show-when.js";import{separatorField as ho}from"../../../separator-field.js";import{LOOP_SCROLLS as fo}from"../../../../../../format/lib/animation/index.js";import{FlexSlots as uo}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{CARD_BOX_FACTS as Ao,ON_A_CARD as go,cardDisplayField as Oo}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as Ro,mirrorCardsField as Eo}from"../../../mirror-cards-field.js";import{SHARED_COLUMNS_KEY as l,SHARED_COLUMNS_LABEL as D,SHARED_COLUMNS_OFF as H,sharedColumnsDrawn as T,sharedColumnsFits as x,SHARED_COLUMNS_PHONE_POINTS as Co,SHARED_COLUMNS_POINTS as bo}from"../../../../../../render/lib/content/box-shared-columns.js";const Fo={field:"bgImage",set:!0},I={field:"phoneRow",in:[2,3]},Lo={field:"direction",is:"tabs"},No={field:"line",in:[!0,!1]},Do={field:"anchor",set:!0},w=["fixed","screen"],Ho={not:{any:[{field:"sectionHeightMode",in:w},{field:"sectionHeightModePhone",in:w}]}},To={context:"parent.line",is:!0},h={field:"direction",is:"row",default:"row"},p={not:fo},f={all:[h,p,{not:{field:"separator",in:b.map(o=>o.value)}},{not:{field:"line",is:!0}}]},xo={all:[f,...["columns",a("columns")].map(o=>({not:{field:o,in:Array.from({length:E},(n,_)=>_+C)}}))]},Io={all:[p,{not:{all:[h,{field:"separator",in:b.map(o=>o.value)}]}}]},k={not:{all:[f,{field:"columns",in:Array.from({length:E},(o,n)=>n+C)}]}},wo="sharedColumnsFits",P="sharedColumnsMisfit",B="sharedColumnsDraws",M="sharedColumnsPhoneDraws",ko={[wo]:o=>x(o.props??{}),[P]:o=>!x(o.props??{}),[B]:o=>T(o.props??{}).desktop,[M]:o=>T(o.props??{}).phone};function y(o){return{all:[{not:{context:P,is:!0}},{any:[go,{field:o,set:!0}]}]}}const m={not:{context:B,is:!0}},S={not:{context:M,is:!0}},Po={any:[m,S]};function Bo(o){return{...o,render:n=>o.render({...n,value:so(n.value)?"nowrap":"wrap"})}}const ae={fields:_o({_gContent:i("Content"),content:uo.content,_gCardDisplay:i("Display"),cardDisplay:Oo(),_gLayout:i("Layout"),direction:no("Flex"),tabShape:s("Tab shape",e(V,{}),j.map(o=>({label:K[o],value:o})),"tabs"),mirrorCards:Eo(),label:lo(io("Tab name")),...to("Flex"),justify:mo(),align:co(),...F("wrap",L(),void 0,{phoneRow:Bo(L())}),...F("boxShape",s("Box shape",e(u,{}),[...R],"auto"),po,{phoneRow:s("Box shape",e(u,{}),[...R],"auto",{phoneRest:o=>ro(o)})}),separator:ho(e(G,{size:18}),"none"),share:r("desktop",$()),[a("share")]:eo(),[t("share")]:oo(),[l]:r("desktop",s(D,e(A,{}),[...bo],H)),[t(l)]:r("mobile",s(D,e(A,{}),[...Co],H)),...Z(),blockSpacing:q(),line:c("Line",!1,e(Y,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,e(v,{}),"Still to come: a hollow dot, and the gold line stops before it."),_gShadow:i("Shadow"),shadow:c("Shadow",!1,e(J,{})),fillColor:Q(),_gBackground:i("Background image"),bgImage:r("desktop",O("Image","image/*")),bgImagePhone:r("mobile",O("Image","image/*")),...X(),placement:So("Content position"),_gLink:i("Link"),link:ao("Link to"),jumpHighlight:c("Highlight when a link jumps here",!1,e(z,{}),"When a link lands on this Box's anchor, the Box gets an accent outline and its first block turns accent.")},[[["darken","darkenStyle","placement"],Fo],[[t("share")],{all:[I,S]}],[[l],y(l)],[[t(l)],y(t(l))],[[t("wrap")],{all:[I,p,S]}],[["phoneRow"],S],[["tabShape"],Lo],[["separator"],h],[["columns",a("columns")],f],[[a("gap")],Io],[["justify"],{all:[p,Po]}],[["wrap"],{all:[p,k,m]}],[["share"],{all:[k,m]}],[[a("share")],{all:[xo,m]}],[["line"],No],[["upcoming"],To],[["jumpHighlight"],Do],[["boxShape",a("boxShape"),t("boxShape")],Ho]]),resolveFields:(o,{fields:n})=>{const _=o.props;if(W(_.bgImage)){const U=N({fallback:{top:d.desktop,bottom:d.desktop,left:d.side,right:d.side},tablet:!0});return g(n,U)}return o.props.padV2!==!0?g(n,N({fallback:{top:24,bottom:24},tablet:!0})):n},showWhenFacts:{...Ao,...Ro,...ko}};export{ae as FlexFields};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{REEL_PLACEMENT_DEFAULT as m,REEL_SHAPE_DEFAULT as d,HERO_REEL_SHAPES as A,REEL_SHAPE_LABELS as R,REEL_SHOWN_DEFAULT as P}from"../../../../../../format/lib/reel.js";import{DEFAULT_TINT as O}from"../../../../../../format/lib/content/tint.js";import{HERO_TEXTURE_SHOWN_DEFAULT as L}from"../../../../../../format/lib/hero-texture.js";import{HERO_ARROW_SHAPE_DEFAULT as u,HERO_ARROW_SHAPE_LABELS as H,HERO_ARROW_SHAPES as h,HERO_ARROWS_PLACEMENT_DEFAULT as w,HERO_ARROWS_SHOWN_DEFAULT as I}from"../../../../../../format/lib/hero-arrows.js";import{ClockIcon as T,EyeIcon as t,OpacityIcon as k,PhoneIcon as s,PlayIcon as D,SlideArrowsBareIcon as f,SlideArrowsRoundIcon as g,SlideArrowsSquareIcon as U,SlidePickerBarIcon as F,SlidePickerCardsIcon as y,SlidePickerDotsIcon as N,SlidePickerNumbersIcon as b,SlidePickerSquaresIcon as W,SquareIcon as E}from"efficient-easel/icons";import{SlideArrowsRoundSolidIcon as x}from"efficient-shell/icons/efficient-looks";const C=x,B={cards:e(y,{}),dots:e(N,{}),numbers:e(b,{}),bar:e(F,{}),squares:e(W,{})},q={outline:e(g,{}),solid:e(C,{}),square:e(U,{}),bare:e(f,{})};import{colorInput as M,toggle as i}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{alignmentField as j,iconPickerRow as c,placementField as n,segmented as p,slider as _}from"../../../box-fields.js";import{deviceField as l,deviceNote as Y}from"efficient-easel/screen/lib/document/device-fields";import{HERO_PHONE_SIDEWAYS_DEFAULT as v,HERO_PHONE_SIDEWAYS_LABEL as K,HERO_PHONE_UPDOWN_DEFAULT as X,HERO_PHONE_UPDOWN_LABEL as z,phoneSidewaysPoints as G,phoneUpDownPoints as J}from"../../../../../../format/lib/hero-phone-stack.js";import{heightField as S}from"../../shared-fields.js";import{HeroSlots as a}from"../../../../../../format/lib/document/blocks/general/Hero/meta.js";const pe={fields:{_dDevice:Y(),_gContent:o("Content"),slides:a.slides,strip:a.strip,_gStyle:o("Style"),alignment:j(),_gTexture:o("Texture"),showTexture:i("Show texture",L,e(t,{})),textureColor:M("Texture color",O),textureOpacity:_("Texture opacity",e(k,{}),0,100,1,40,"%"),_gLayout:o("Layout"),heightDesktop:S("desktop"),heightMobile:S("mobile"),_gAutoplay:o("Auto-slide"),autoplay:i("Auto-advance slides",!1,e(D,{})),autoplayInterval:_("Still time per slide",e(T,{}),2,15,1,6,"s"),_gPicker:o("Slide picker"),showPicker:i("Show slide picker",P,e(t,{})),pickerShape:c("Slide picker shape",e(E,{}),A.map(r=>({label:R[r],value:r,picture:B[r]})),d),pickerPlacement:n("Slide picker placement",{fallback:m}),_gArrows:o("Arrows"),showArrows:i("Show arrows",I,e(t,{})),arrowsShape:c("Arrows shape",e(E,{}),h.map(r=>({label:H[r],value:r,picture:q[r]})),u),arrowsPlacement:n("Arrows placement",{fallback:w}),_gPhone:l("mobile",o("On a phone")),phoneUpDown:l("mobile",p(z,e(s,{}),J(),X)),phoneSideways:l("mobile",p(K,e(s,{}),G(),v))}};export{pe as HeroFields};
1
+ import{jsx as e}from"react/jsx-runtime";import{REEL_PLACEMENT_DEFAULT as m,REEL_SHAPE_DEFAULT as d,HERO_REEL_SHAPES as A,REEL_SHAPE_LABELS as R,REEL_SHOWN_DEFAULT as O}from"../../../../../../format/lib/reel.js";import{HERO_TEXTURE_SHOWN_DEFAULT as P}from"../../../../../../format/lib/hero-texture.js";import{HERO_ARROW_SHAPE_DEFAULT as H,HERO_ARROW_SHAPE_LABELS as L,HERO_ARROW_SHAPES as u,HERO_ARROWS_PLACEMENT_DEFAULT as h,HERO_ARROWS_SHOWN_DEFAULT as w}from"../../../../../../format/lib/hero-arrows.js";import{ClockIcon as I,EyeIcon as t,OpacityIcon as T,PhoneIcon as s,PlayIcon as k,SlideArrowsBareIcon as f,SlideArrowsRoundIcon as D,SlideArrowsSquareIcon as g,SlidePickerBarIcon as U,SlidePickerCardsIcon as y,SlidePickerDotsIcon as F,SlidePickerNumbersIcon as W,SlidePickerSquaresIcon as b,SquareIcon as E}from"efficient-easel/icons";import{SlideArrowsRoundSolidIcon as N}from"efficient-shell/icons/efficient-looks";const C=N,x={cards:e(y,{}),dots:e(F,{}),numbers:e(W,{}),bar:e(U,{}),squares:e(b,{})},B={outline:e(D,{}),solid:e(C,{}),square:e(g,{}),bare:e(f,{})};import{toggle as i}from"../../../controls.js";import{HERO_TEXTURE_COLOR_ROW as q}from"../../hero-shared-fields.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{alignmentField as M,iconPickerRow as _,placementField as n,segmented as c,slider as p}from"../../../box-fields.js";import{deviceField as l,deviceNote as j}from"efficient-easel/screen/lib/document/device-fields";import{HERO_PHONE_SIDEWAYS_DEFAULT as X,HERO_PHONE_SIDEWAYS_LABEL as Y,HERO_PHONE_UPDOWN_DEFAULT as v,HERO_PHONE_UPDOWN_LABEL as K,phoneSidewaysPoints as z,phoneUpDownPoints as G}from"../../../../../../format/lib/hero-phone-stack.js";import{heightField as S}from"../../shared-fields.js";import{HeroSlots as a}from"../../../../../../format/lib/document/blocks/general/Hero/meta.js";const ne={fields:{_dDevice:j(),_gContent:o("Content"),slides:a.slides,strip:a.strip,_gStyle:o("Style"),alignment:M(),_gTexture:o("Texture"),showTexture:i("Show texture",P,e(t,{})),textureColor:q,textureOpacity:p("Texture opacity",e(T,{}),0,100,1,40,"%"),_gLayout:o("Layout"),heightDesktop:S("desktop"),heightMobile:S("mobile"),_gAutoplay:o("Auto-slide"),autoplay:i("Auto-advance slides",!1,e(k,{})),autoplayInterval:p("Still time per slide",e(I,{}),2,15,1,6,"s"),_gPicker:o("Slide picker"),showPicker:i("Show slide picker",O,e(t,{})),pickerShape:_("Slide picker shape",e(E,{}),A.map(r=>({label:R[r],value:r,picture:x[r]})),d),pickerPlacement:n("Slide picker placement",{fallback:m}),_gArrows:o("Arrows"),showArrows:i("Show arrows",w,e(t,{})),arrowsShape:_("Arrows shape",e(E,{}),u.map(r=>({label:L[r],value:r,picture:B[r]})),H),arrowsPlacement:n("Arrows placement",{fallback:h}),_gPhone:l("mobile",o("On a phone")),phoneUpDown:l("mobile",c(K,e(s,{}),G(),v)),phoneSideways:l("mobile",c(Y,e(s,{}),z(),X))}};export{ne as HeroFields};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{BlockVideoIcon as c,ClockIcon as p,ImageIcon as g,MediaIcon as s,OpacityIcon as u,PlayIcon as v}from"efficient-easel/icons";import{colorInput as f,focusKeptField as i,loadingShowsField as I,MEDIA_TYPE_OPTIONS as y,plainText as _,text as S,upload as a,withIdentifier as O,withPanelOnly as m}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{segmented as E,slider as t}from"../../../box-fields.js";import{LOADING_SHOWS_IMAGE as F,VIDEO_PLAYBACK_DEFAULT as P,VIDEO_SOURCE_DEFAULT as l}from"../../../../../../format/lib/hero-video.js";import{HERO_SLIDE_OVERLAY_ROWS as n,HERO_VIDEO_ROWS as d}from"../../hero-shared-fields.js";import{PH as T}from"../../../../../../format/lib/document/blocks/placeholders.js";import{slotNoticeField as b}from"../../shared-fields.js";import{forMediaType as L,heroMediaFields as D,VIDEO_FILE_LABEL as h,VIDEO_FILE_PROMPT as k}from"../../../../../../render/lib/document/hero-media-parts.js";import{DEFAULT_TINT as A}from"../../../../../../format/lib/content/tint.js";import{HeroSlideSlots as C}from"../../../../../../format/lib/document/blocks/general/HeroSlide/meta.js";const r=L("video","video"),G={fields:D({_gContent:o("Content"),name:m(O(_("Slide name",T.slideName))),process:m(S("Reel label","Label")),groupNotice:b("HeroSlide"),groups:C.groups,_gMedia:o("Media"),mediaType:E("Type",e(s,{}),y,"video"),videoSource:d.videoSource,mediaVideo:a(h,"video/*",k,{frame:"videoFrame"}),youtubeUrl:d.youtubeUrl,videoPlayback:d.videoPlayback,videoSpeed:t("Playback speed",e(v,{}),25,100,5,100,"%"),loadingShows:I("Show while loading",e(p,{}),{frame:e(c,{}),image:e(g,{})}),videoFrame:i(),mediaImage:a("Background image","image/*","Upload a background image",{focus:"imageFocal"}),imageFocal:i(),imageFocalPhone:i(),poster:a("Image","image/*","Choose an image"),_gTint:o("Image tint"),tintColor:f("Tint color",A),overlay:t("Overlay",e(u,{}),0,100,5,0,"%"),_gOverlay:o("Overlay"),overlayColor:n.overlayColor,overlayPosition:n.overlayPosition},{onlyFor:{image:["mediaImage","imageFocal","imageFocalPhone","_gTint","tintColor","overlay"],video:["videoSource","videoPlayback","loadingShows","videoFrame"]},fallback:"video",rules:{mediaVideo:{all:[r,{field:"videoSource",is:"upload",default:l}]},youtubeUrl:{all:[r,{field:"videoSource",is:"youtube",default:l}]},videoSpeed:{all:[r,{field:"videoSource",is:"upload",default:l},{field:"videoPlayback",is:"background",default:P}]},poster:{all:[{field:"mediaType",is:"video",default:"video"},F]}}})};export{G as HeroSlideFields};
1
+ import{jsx as e}from"react/jsx-runtime";import{BlockVideoIcon as c,ClockIcon as p,ImageIcon as g,MediaIcon as s,OpacityIcon as u,PlayIcon as v}from"efficient-easel/icons";import{colorInput as f,focusKeptField as i,loadingShowsField as I,MEDIA_TYPE_OPTIONS as y,plainText as _,text as S,upload as a,withIdentifier as O,withPanelOnly as m}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{segmented as E,slider as t}from"../../../box-fields.js";import{LOADING_SHOWS_IMAGE as F,VIDEO_PLAYBACK_DEFAULT as P,VIDEO_SOURCE_DEFAULT as l}from"../../../../../../format/lib/hero-video.js";import{HERO_SLIDE_OVERLAY_ROWS as n,HERO_VIDEO_ROWS as d}from"../../hero-shared-fields.js";import{PH as T}from"../../../../../../format/lib/document/blocks/placeholders.js";import{slotNoticeField as b}from"../../shared-fields.js";import{forMediaType as L,heroMediaFields as D,VIDEO_FILE_LABEL as h,VIDEO_FILE_PROMPT as k}from"../../../../../../render/lib/document/hero-media-parts.js";import{DEFAULT_TINT as A}from"../../../../../../format/lib/content/tint.js";import{HeroSlideSlots as C}from"../../../../../../format/lib/document/blocks/general/HeroSlide/meta.js";const r=L("video","video"),G={fields:D({_gContent:o("Content"),name:m(O(_("Slide name",T.slideName))),process:m(S("Reel label","Label")),groupNotice:b("HeroSlide"),groups:C.groups,_gMedia:o("Media"),mediaType:E("Type",e(s,{}),y,"video"),videoSource:d.videoSource,mediaVideo:a(h,"video/*",k,{frame:"videoFrame"}),youtubeUrl:d.youtubeUrl,videoPlayback:d.videoPlayback,videoSpeed:t("Playback speed",e(v,{}),25,100,5,100,"%"),loadingShows:I("Show while loading",e(p,{}),{frame:e(c,{}),image:e(g,{})}),videoFrame:i(),mediaImage:a("Background image","image/*","Upload a background image",{focus:"imageFocal"}),imageFocal:i(),imageFocalPhone:i(),poster:a("Image","image/*","Choose an image"),_gTint:o("Image tint"),tintColor:f("Tint color",A),overlay:t("Tint",e(u,{}),0,100,5,0,"%"),_gOverlay:o("Overlay"),overlayColor:n.overlayColor,overlayPosition:n.overlayPosition},{onlyFor:{image:["mediaImage","imageFocal","imageFocalPhone","_gTint","tintColor","overlay"],video:["videoSource","videoPlayback","loadingShows","videoFrame"]},fallback:"video",rules:{mediaVideo:{all:[r,{field:"videoSource",is:"upload",default:l}]},youtubeUrl:{all:[r,{field:"videoSource",is:"youtube",default:l}]},videoSpeed:{all:[r,{field:"videoSource",is:"upload",default:l},{field:"videoPlayback",is:"background",default:P}]},poster:{all:[{field:"mediaType",is:"video",default:"video"},F]}}})};export{G as HeroSlideFields};
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{IMAGE_FIT_ROW_LABEL as r,imageFitOptions as t,imageIsCropped as s,parseImageFit as m}from"../../../../../../format/lib/content/image-fit.js";import{ImageIcon as c}from"efficient-easel/icons";import{focusKeptField as a,imageCornersField as p,linkField as f,plainText as d,cornerSidesField as g,upload as n,withPanelOnly as F}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{select as u}from"../../../box-fields.js";import{photographyToggle as h}from"../../shared-fields.js";import{CARD_ROW_FACTS as I,cardRowField as _,cardRowFields as v}from"../../../card-row-fields.js";const O={fields:{_gImage:o("Image"),src:n("Image","image/*",void 0,{focus:"focal",focusWhen:e=>s(e.aspect,m(e.fit,"cover"))}),alt:F(d("Alt text")),rowField:_("Shows","image"),aspect:{type:"select",label:"Aspect ratio",options:[{label:"Auto",value:"auto"},{label:"21 : 9",value:"21/9"},{label:"16 : 9",value:"16/9"},{label:"4 : 3",value:"4/3"},{label:"1 : 1",value:"1/1"}]},fit:u(r,i(c,{}),t(),"cover"),focal:a(),focalPhone:a(),href:f("Link"),_gStyle:o("Style"),grayscale:h(),_gShape:o("Shape"),corners:p(),cornerSides:g()},resolveFields:(e,l)=>v(l.fields,e,l),showWhenFacts:I};export{O as ImageBlockFields};
1
+ import{jsx as i}from"react/jsx-runtime";import{IMAGE_FIT_ROW_LABEL as t,imageFitOptions as a,imageIsCropped as m,parseImageFit as s}from"../../../../../../format/lib/content/image-fit.js";import{ImageIcon as c}from"efficient-easel/icons";import{focusKeptField as r,imageCornersField as f,linkField as p,plainText as d,cornerSidesField as g,upload as n,withPanelOnly as F}from"../../../controls.js";import{group as l}from"efficient-easel/screen/lib/document/box-fields";import{select as u}from"../../../box-fields.js";import{photographyToggle as h}from"../../shared-fields.js";import{CARD_ROW_FACTS as I,cardRowField as _,cardRowFields as v}from"../../../card-row-fields.js";import{offerNextPicture as S}from"../../../../animation/hover-fields.js";import{darkenFields as A}from"../../../darken-fields.js";const L={fields:{_gImage:l("Image"),src:n("Image","image/*",void 0,{focus:"focal",focusWhen:e=>m(e.aspect,s(e.fit,"cover"))}),alt:F(d("Alt text")),rowField:_("Shows","image"),aspect:{type:"select",label:"Aspect ratio",options:[{label:"Auto",value:"auto"},{label:"21 : 9",value:"21/9"},{label:"16 : 9",value:"16/9"},{label:"4 : 3",value:"4/3"},{label:"1 : 1",value:"1/1"}]},fit:u(t,i(c,{}),a(),"cover"),focal:r(),focalPhone:r(),href:p("Link"),_gStyle:l("Style"),grayscale:h(),...A(),_gShape:l("Shape"),corners:f(),cornerSides:g()},resolveFields:(e,o)=>S(v(o.fields,e,o),e,o),showWhenFacts:I};export{L as ImageBlockFields};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{BOX_DARKEN as t,BOX_DARKEN_STYLES as i}from"../../../../../../format/lib/content/box-background.js";import{POST_CARD_HEIGHT as o,POST_CARD_LAYOUT_FALLBACK as s,POST_CARD_LAYOUTS as p}from"../../../../../../format/lib/post-card-layout.js";import O from"../../../../../components/BlogPostSource.js";import{HeightIcon as _,ImageIcon as d,LayoutIcon as g,OpacityIcon as f,StylesIcon as C}from"efficient-easel/icons";import{NOT_BOUND_TO_POST as T,linkField as u,sourceField as S,text as a,textarea as m,toggle as R,upload as x}from"../../../controls.js";import{group as y}from"efficient-easel/screen/lib/document/box-fields";import{placementField as D,select as n,slider as l}from"../../../box-fields.js";import{withRowRules as h}from"../../../../../../render/lib/document/show-when.js";import{POSTCARD_PH as r}from"../../../../../../format/lib/document/blocks/general/PostCard/meta.js";const c={field:"layout",is:"cover"},k={not:c},A=["placement","darken","darkenStyle","minHeight","_gTint"],E=["showCover"],L=["image","title","excerpt","href"],V={fields:h({source:S(O),image:x("Cover image","image/*"),title:m("Heading",r.title),excerpt:m("Excerpt",r.excerpt),href:u("Link"),category:a("Category",r.category),date:a("Date",r.date),readLabel:a("Read time",r.readLabel),layout:n("Card layout",e(g,{}),p,s),showCover:R("Show cover image",!0,e(d,{})),placement:D("Text position"),minHeight:l("Card height",e(_,{}),o.min,o.max,o.step,o.fallback,o.unit),_gTint:y("Image tint"),darken:l("Darken",e(f,{}),t.min,t.max,t.step,t.fallback,t.unit),darkenStyle:n("Darken style",e(C,{}),i,i[0].value)},[[A,c],[E,k],[L,T]])};export{V as PostCardFields};
1
+ import{jsx as o}from"react/jsx-runtime";import{darkenFields as m}from"../../../darken-fields.js";import{POST_CARD_HEIGHT as e,POST_CARD_LAYOUT_FALLBACK as l,POST_CARD_LAYOUTS as n}from"../../../../../../format/lib/post-card-layout.js";import c from"../../../../../components/BlogPostSource.js";import{HeightIcon as s,ImageIcon as p,LayoutIcon as d}from"efficient-easel/icons";import{NOT_BOUND_TO_POST as g,linkField as O,sourceField as _,text as r,textarea as i,toggle as C,upload as f}from"../../../controls.js";import{group as T}from"efficient-easel/screen/lib/document/box-fields";import{placementField as u,select as h,slider as x}from"../../../box-fields.js";import{withRowRules as R}from"../../../../../../render/lib/document/show-when.js";import{POSTCARD_PH as t}from"../../../../../../format/lib/document/blocks/general/PostCard/meta.js";const a={field:"layout",is:"cover"},S={not:a},L=["placement","darken","darkenStyle","minHeight","_gTint"],y=["showCover"],A=["image","title","excerpt","href"],B={fields:R({source:_(c),image:f("Cover image","image/*"),title:i("Heading",t.title),excerpt:i("Excerpt",t.excerpt),href:O("Link"),category:r("Category",t.category),date:r("Date",t.date),readLabel:r("Read time",t.readLabel),layout:h("Card layout",o(d,{}),n,l),showCover:C("Show cover image",!0,o(p,{})),placement:u("Text position"),minHeight:x("Card height",o(s,{}),e.min,e.max,e.step,e.fallback,e.unit),_gTint:T("Image tint"),...m()},[[L,a],[y,S],[A,g]])};export{B as PostCardFields};
@@ -1,2 +1,2 @@
1
- export declare const assembleGeneralBlocks: () => Record<"Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "Heading" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
2
- export declare const generalBlocks: Record<"Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "Heading" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
1
+ export declare const assembleGeneralBlocks: () => Record<"ImageBlock" | "Manifesto" | "Split" | "ContactLocations" | "Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "FAQ" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "Heading" | "Eyebrow" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
2
+ export declare const generalBlocks: Record<"ImageBlock" | "Manifesto" | "Split" | "ContactLocations" | "Grid" | "HeroGroup" | "HeroSlide" | "Text" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "FAQ" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "Heading" | "Eyebrow" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
@@ -4,6 +4,8 @@ export declare const HERO_OVERLAY_ROWS: {
4
4
  overlayPosition: CustomField<string>;
5
5
  };
6
6
  export declare function textureColorOfSlide(appState: unknown, slideId: unknown): string | undefined;
7
+ export declare function textureColorHint(slides: unknown): string | undefined;
8
+ export declare const HERO_TEXTURE_COLOR_ROW: CustomField<string>;
7
9
  export declare const HERO_SLIDE_OVERLAY_ROWS: {
8
10
  overlayColor: CustomField<string>;
9
11
  overlayPosition: CustomField<string>;
@@ -1 +1 @@
1
- import{jsx as r,Fragment as v}from"react/jsx-runtime";import{PlacementIcon as i,PlayIcon as P,UploadIcon as f}from"efficient-easel/icons";import{useEasel as A}from"efficient-easel/easel";import{colorInput as I,edgePad as s,plainText as L,useSelectedSibling as c}from"../controls.js";import{InheritedColourRow as C}from"../ColourControl.js";import{segmented as O}from"../box-fields.js";import{DEFAULT_TINT as R}from"../../../../format/lib/content/tint.js";import{say as d}from"../../../../format/lib/editor-words.js";import{nonEmptyString as m}from"../../../../format/lib/non-empty-string.js";import{findParentNode as T}from"../../../../format/lib/document/passes/document-position.js";import{DEFAULT_OVERLAY_POSITION as p,OVERLAY_POSITION_OPTIONS as u,slideOverlayState as n}from"../../../../format/lib/sections/hero-overlay.js";import{VIDEO_PLAYBACK_DEFAULT as h,VIDEO_PLAYBACK_LABELS as D,VIDEO_PLAYBACKS as w,VIDEO_SOURCE_DEFAULT as x,VIDEO_SOURCE_LABELS as V,VIDEO_SOURCES as b}from"../../../../format/lib/hero-video.js";const Z={overlayColor:I("Overlay color",R),overlayPosition:s("Overlay position",u,p,"A corner would need a diagonal ramp, which this overlay does not draw.",r(i,{}))},y="Texture",E=o=>s("Overlay position",u,o,"A corner would need a diagonal ramp, which this overlay does not draw.",r(i,{}),void 0,y);function g(){try{const{appState:o,selectedItem:e}=A(t=>t);return U(o,e?.props?.id)}catch{return}}function U(o,e){return m(T(o,e)?.props?.textureColor)}function F({value:o,onChange:e}){const[t]=c("overlayPosition"),S=g(),l=m(o)??"",_=n({overlayColor:l,overlayPosition:t},S),a=n({overlayPosition:t});return r(C,{label:d("Overlay color"),value:l,inherited:_.color,resetTo:a.own?a.color:d(y),onChange:e,onReset:()=>e("")})}const Y=E(p),N=E("");function W(o){const[e]=c("overlayColor"),t=n({overlayColor:e,overlayPosition:o.value}).own?Y:N;return r(v,{children:t.render(o)})}const $={overlayColor:{type:"custom",render:({value:o,onChange:e})=>r(F,{value:o,onChange:e})},overlayPosition:{type:"custom",render:({value:o,onChange:e})=>r(W,{value:o,onChange:e})}},oo={videoSource:O("Source",r(f,{}),b.map(o=>({label:V[o],value:o})),x),youtubeUrl:L("YouTube link","https://youtu.be/…"),videoPlayback:O("Playback",r(P,{}),w.map(o=>({label:D[o],value:o})),h)};export{Z as HERO_OVERLAY_ROWS,$ as HERO_SLIDE_OVERLAY_ROWS,oo as HERO_VIDEO_ROWS,U as textureColorOfSlide};
1
+ import{jsx as r,Fragment as S}from"react/jsx-runtime";import{PlacementIcon as c,PlayIcon as f,UploadIcon as C}from"efficient-easel/icons";import{useEasel as R}from"efficient-easel/easel";import{colorInput as A,edgePad as u,plainText as L,useSelectedSibling as a}from"../controls.js";import{ColourRow as P,InheritedColourRow as I}from"../ColourControl.js";import{segmented as d}from"../box-fields.js";import{DEFAULT_TINT as O}from"../../../../format/lib/content/tint.js";import{say as n}from"../../../../format/lib/editor-words.js";import{nonEmptyString as i}from"../../../../format/lib/non-empty-string.js";import{findParentNode as T}from"../../../../format/lib/document/passes/document-position.js";import{DEFAULT_OVERLAY_POSITION as p,OVERLAY_POSITION_OPTIONS as m,slideOverlayState as y}from"../../../../format/lib/sections/hero-overlay.js";import{VIDEO_PLAYBACK_DEFAULT as h,VIDEO_PLAYBACK_LABELS as w,VIDEO_PLAYBACKS as x,VIDEO_SOURCE_DEFAULT as g,VIDEO_SOURCE_LABELS as D,VIDEO_SOURCES as U}from"../../../../format/lib/hero-video.js";const oo={overlayColor:A("Overlay color",O),overlayPosition:u("Overlay position",m,p,"A corner would need a diagonal ramp, which this overlay does not draw.",r(c,{}))},E="Texture",_=o=>u("Overlay position",m,o,"A corner would need a diagonal ramp, which this overlay does not draw.",r(c,{}),void 0,E);function V(){try{const{appState:o,selectedItem:e}=R(t=>t);return b(o,e?.props?.id)}catch{return}}function b(o,e){return i(T(o,e)?.props?.textureColor)}function F({value:o,onChange:e}){const[t]=a("overlayPosition"),l=V(),s=i(o)??"",v=y({overlayColor:s,overlayPosition:t},l);return r(I,{label:n("Overlay color"),value:s,inherited:v.color,resetTo:n(E),onChange:e,onReset:()=>e("")})}const Y=_(p),W=_("");function N(o){const[e]=a("overlayColor"),t=y({overlayColor:e,overlayPosition:o.value}).own?Y:W;return r(S,{children:t.render(o)})}function B(o){if(!Array.isArray(o))return;const e=o.flatMap((t,l)=>i(t?.props?.overlayColor)?[l+1]:[]);if(e.length!==0)return e.length===1?n("Slide {n}: own Overlay color.",{n:e[0]}):n("Slides {n}: own Overlay color.",{n:e.join(", ")})}function H({value:o,onChange:e}){const[t]=a("slides");return r(P,{label:n("Texture color"),value:o||O,onChange:e,hint:B(t)})}const eo={type:"custom",render:({value:o,onChange:e})=>r(H,{value:o,onChange:e})},ro={overlayColor:{type:"custom",render:({value:o,onChange:e})=>r(F,{value:o,onChange:e})},overlayPosition:{type:"custom",render:({value:o,onChange:e})=>r(N,{value:o,onChange:e})}},to={videoSource:d("Source",r(C,{}),U.map(o=>({label:D[o],value:o})),g),youtubeUrl:L("YouTube link","https://youtu.be/…"),videoPlayback:d("Playback",r(f,{}),x.map(o=>({label:w[o],value:o})),h)};export{oo as HERO_OVERLAY_ROWS,ro as HERO_SLIDE_OVERLAY_ROWS,eo as HERO_TEXTURE_COLOR_ROW,to as HERO_VIDEO_ROWS,B as textureColorHint,b as textureColorOfSlide};