efficient-web-builder 69.3.0 → 69.5.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 (81) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/editor/components/StandaloneSectionEditor.js +1 -1
  3. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  4. package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
  5. package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
  6. package/dist/editor/lib/document/blocks/general/ProcessSteps/fields.js +1 -1
  7. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  8. package/dist/editor/lib/document/blocks/hero-shared-fields.d.ts +19 -0
  9. package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
  10. package/dist/editor/lib/document/controls.d.ts +9 -1
  11. package/dist/editor/lib/document/controls.js +1 -1
  12. package/dist/editor/lib/host-document-bridge.js +1 -1
  13. package/dist/editor/lib/sections/city-presets.d.ts +1 -1
  14. package/dist/editor/lib/sections/city-presets.js +1 -1
  15. package/dist/editor/lib/sections/hero-ticker-to-strip.js +1 -1
  16. package/dist/editor/lib/sections/insert-box-path.d.ts +8 -0
  17. package/dist/editor/lib/sections/insert-box-path.js +1 -0
  18. package/dist/editor/lib/sections/menu-presets.d.ts +2 -0
  19. package/dist/editor/lib/sections/menu-presets.js +1 -0
  20. package/dist/format/lib/content/card-row-keys.d.ts +5 -0
  21. package/dist/format/lib/content/card-row-keys.js +1 -0
  22. package/dist/format/lib/content/card-template.d.ts +1 -6
  23. package/dist/format/lib/content/card-template.js +1 -1
  24. package/dist/format/lib/content/picture-focus-rows.js +1 -1
  25. package/dist/format/lib/document/article-body-seed.js +1 -1
  26. package/dist/format/lib/document/blocks/general/CardList/item-seed.js +1 -1
  27. package/dist/format/lib/document/blocks/general/Cards/card-seed.d.ts +2 -1
  28. package/dist/format/lib/document/blocks/general/Cards/card-seed.js +1 -1
  29. package/dist/format/lib/document/blocks/general/FAQ/card-seed.d.ts +1 -0
  30. package/dist/format/lib/document/blocks/general/FAQ/card-seed.js +1 -1
  31. package/dist/format/lib/document/blocks/general/Footprint/card-seed.d.ts +1 -0
  32. package/dist/format/lib/document/blocks/general/Footprint/card-seed.js +1 -1
  33. package/dist/format/lib/document/blocks/general/HeroSingle/meta.js +1 -1
  34. package/dist/format/lib/document/blocks/general/HeroSlide/meta.js +1 -1
  35. package/dist/format/lib/document/blocks/general/Logos/card-seed.d.ts +1 -0
  36. package/dist/format/lib/document/blocks/general/Logos/card-seed.js +1 -1
  37. package/dist/format/lib/document/blocks/general/OrderSummary/block-type.d.ts +1 -0
  38. package/dist/format/lib/document/blocks/general/OrderSummary/block-type.js +1 -0
  39. package/dist/format/lib/document/blocks/general/ProcessSteps/row-seed.d.ts +1 -0
  40. package/dist/format/lib/document/blocks/general/ProcessSteps/row-seed.js +1 -1
  41. package/dist/format/lib/document/cap-hero-groups.js +1 -1
  42. package/dist/format/lib/document/card-content-switch.js +1 -1
  43. package/dist/format/lib/document/cards-template-on-read.js +1 -1
  44. package/dist/format/lib/document/media-manifest.json +2 -1
  45. package/dist/format/lib/document/node-lists.d.ts +1 -0
  46. package/dist/format/lib/document/node-lists.js +1 -1
  47. package/dist/format/lib/document/renamed-props.js +1 -1
  48. package/dist/format/lib/document/section-catalog.js +19 -3
  49. package/dist/format/lib/document/seed-parts.d.ts +3 -0
  50. package/dist/format/lib/document/seed-parts.js +1 -1
  51. package/dist/format/lib/editor-words-kept.js +1 -1
  52. package/dist/format/lib/hero-media-layout.d.ts +12 -0
  53. package/dist/format/lib/hero-media-layout.js +1 -1
  54. package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
  55. package/dist/format/lib/source-rules/editor-words.js +1 -1
  56. package/dist/format/lib/source-rules/no-glyph-rows.js +4 -4
  57. package/dist/format/lib/source-rules/one-node-list-loop.d.ts +6 -0
  58. package/dist/format/lib/source-rules/one-node-list-loop.js +1 -0
  59. package/dist/format/lib/source-rules/one-node-list.js +1 -1
  60. package/dist/format/lib/source-rules/one-seed-id-home.d.ts +6 -0
  61. package/dist/format/lib/source-rules/one-seed-id-home.js +1 -0
  62. package/dist/format/lib/source-rules/page-picture-place.js +3 -3
  63. package/dist/format/lib/source-rules/reduced-motion.js +8 -8
  64. package/dist/format/lib/source-rules/support/css-length.js +1 -1
  65. package/dist/format/lib/source-rules/support/css-rules.js +1 -1
  66. package/dist/format/lib/source-rules/support/label-extraction.js +5 -5
  67. package/dist/format/lib/source-rules/support/ts-source.js +3 -3
  68. package/dist/render/components/HeroSingle.d.ts +2 -1
  69. package/dist/render/components/HeroSingle.js +1 -1
  70. package/dist/render/components/HeroSlide.d.ts +2 -1
  71. package/dist/render/components/HeroSlide.js +1 -1
  72. package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
  73. package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
  74. package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
  75. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.d.ts +1 -0
  76. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  77. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  78. package/dist/render/lib/document/hero-media-parts.d.ts +6 -4
  79. package/dist/render/lib/document/hero-media-parts.js +1 -1
  80. package/dist/render/lib/sections/section-to-box.js +1 -1
  81. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 69.5.0 - 2026-11-17
4
+
5
+ From main at `e660b33f`: #768, #769, #770, #772. A minor: no `!`, no export is removed, no export changes its type, the peers stay `efficient-easel` `^34.3.0` and `efficient-shell` `^13.3.0`. New exports only. No stored key or value moves: stored Contact / Locations, Hero Single and Scroll-Over Text nodes still draw the old sections. `forMediaType`, the `marked` prop of `HeroPickArea` / `HeroTwoPictures` and the phrase "Tint opacity" are deprecated (delete by 2026-12-18, in a major).
6
+
7
+ **For hosts:**
8
+ - The media manifest gains `HeroSlide.mediaImage2` (contentHash `4fd181cf034fee3b` -> `be784d74fee5062d`). The backend vendors the new manifest and deploys beside the storefront change that takes this release: a storefront on the new hash is refused template saves by a backend on the old one.
9
+ - storefront-blocks may register host rows for Fitment Table, Contact / Locations and Scroll-Over Text presses, and its host guard may import `hasInsertBoxPath` / `drawsThroughBox` in place of its own path check.
10
+ - The storefront change that takes this release imports `mediaFieldPaths` and deletes `scripts/gen-media-manifest.ts` `walkFields` (due 2026-11-27).
11
+
12
+ ### Added
13
+
14
+ - **Fitment Table presses its host row; one insert-path home** (#768): Fitment Table joins `HOST_PRESS_BLOCKS`. With no host row the press stays the ordinary insert. New editor-side module `lib/sections/insert-box-path` (`hasInsertBoxPath`, `drawsThroughBox`, `SAME_KEY_BOX_PART`).
15
+ - **Contact / Locations presses City maps** (#769): Contact / Locations joins `SECTION_TO_BOX_PRESS` and its old Add-menu row is retired (`RETIRED_SECTIONS`). The Add menu offers one City maps Box per city, grouped by region. New `CITY_PHOTO_WALL_HIDDEN` keeps City pictures off the menu while its photo wall is hidden; `cityPalettePresets` takes it as a new optional argument. New `menuPresets`.
16
+ - **Hero Single retires; the Hero slide takes its rows** (#770): Hero Single leaves the Add menu (`RETIRED_SECTIONS`); a new hero is a Hero (Hero > Slide > Box). The slide gets the two-picture Layout and Image 2 rows from one home, `lib/document/blocks/hero-shared-fields` (`HERO_LAYOUT_ROWS`, `HERO_IMAGE_ROWS`, `HERO_IMAGE2_ROWS`, `HERO_IMAGE_KEYS`, `heroTintRow`, `heroTintColorRow`, `heroLayoutRules`). What an absent media Type means has one home in `lib/hero-media-layout` (`HERO_MEDIA_TYPES`, `HeroMediaType`, `HERO_ABSENT_MEDIA_TYPE`, `heroMediaType`, `HERO_FOCUS`). New `mediaFields` / `mediaFieldPaths` (lib/document/controls) and `mediaTypeShownWhen`. `HERO_MEDIA_PART_TYPES` gains HeroSlide. A standalone template opened with no type gets a Hero.
17
+ - **Scroll-Over Text presses as one Box over its picture** (#772): `IntroBleed` joins `SECTION_TO_BOX_PRESS`. A new insert lays down one Box with its own picture, Darken 60, the old words as Text parts, the Button in its own Box, full-screen height and the pin stopping at the screen top.
18
+
19
+ ### Changed
20
+
21
+ - Hero Single's "Tint opacity" row is now "Tint", as on the slide (#770).
22
+ - A Hero slide whose stored Type is "" or a value no panel writes now draws its video, not the video file as a picture (#770).
23
+
24
+ ## 69.4.0 - 2026-11-16
25
+
26
+ From main at `e3b20e48`: #763, #764. A minor: no `!`, no export is removed, no type is narrowed, the peers stay `efficient-easel` `^34.3.0` and `efficient-shell` `^13.3.0`. New exports only. No stored key or value moves.
27
+
28
+ **For hosts:**
29
+ - No step is required to take this release.
30
+ - storefront-blocks may map a page's content and every zone with `mapPageLists` in place of its own loop over `content` and `zones`.
31
+
32
+ ### Added
33
+
34
+ - **One page map and the node-list rules in one home** (#763): `mapPageLists` in `lib/document/node-lists` maps `content` and every zone. New shared rule `lib/source-rules/one-node-list-loop` (`oneNodeListLoop`, `OneNodeListLoopOptions`): no own loop over a node's lists. `oneNodeList` catches more forms of a renamed node test and leaves a component that reads a prop's type. `blockEnd` also closes `(` and `[`.
35
+ - **Seed ids from one home, and each seed module loads alone** (#764): new `seedNodeId`, `slotSeedIds` and `withSeededSlot` in `seed-parts`; new rule module `oneSeedIdHome` (`OneSeedIdHomeOptions`). New module `lib/content/card-row-keys` (`CARD_ROW_FIELD_PROP`, `CARD_ROW_LINK_PROP`, `CARD_TEMPLATE_SLOT`, `CARD_LIST_TYPE`, `BOX_HIDE_WHEN_ROW_EMPTY`; `card-template` still exports the same names and values). Block type constants `CARDS_TYPE`, `FAQ_TYPE`, `FOOTPRINT_TYPE`, `LOGOS_TYPE`, `ORDER_SUMMARY_TYPE` (new leaf `OrderSummary/block-type`) and `PROCESS_STEPS_TYPE`.
36
+
3
37
  ## 69.3.0 - 2026-11-15
4
38
 
5
39
  From main at `32f5be7b`: #762. A minor: no `!`, no export is removed, the peers stay `efficient-easel` `^34.3.0` and `efficient-shell` `^13.3.0`. New exports only. No stored key or value moves.
@@ -1 +1 @@
1
- "use client";import{jsx as o}from"react/jsx-runtime";import X from"./WebsiteHintsProvider.js";import{useCallback as H,useEffect as P,useMemo as l,useRef as Z,useState as u}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as $}from"../lib/document/build-config.js";import{withTemplateMediaPlaceholders as ee}from"../../format/lib/document/templateFields.js";import{setEditorPageSlug as B}from"../../format/lib/document/editor-page-context.js";import{ScreenDocumentContext as te}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as re}from"../../render/components/PreviewHeaderContext.js";import{PreviewTickerProvider as oe}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as ie}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as ne}from"efficient-easel/draw/client";import{CanvasPartsBridge as se}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as de}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as ae}from"./PreviewPartStyleContext.js";import{sectionTemplates as I}from"efficient-easel/screen/lib/section-templates";import{saveSectionTemplate as R}from"../lib/editor-document-adapter.js";import{nodeToDoc as ce,docToNode as F}from"efficient-easel/screen/lib/document/section-doc";import{newNodeId as me}from"efficient-easel/draw";import{migrateRenamedProps as le}from"../../format/lib/document/renamed-props.js";import{buildSlotSeedChildren as ue}from"../../render/lib/document/slot-specs.js";import{FOOTER_TYPE as fe,buildDefaultFooterBlocks as pe}from"../lib/document/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as ve,useAdminBridge as ge}from"efficient-easel/screen/lib/admin-bridge";import{useEaselHost as he}from"efficient-easel/screen/lib/host";import{ChromeWrap as Pe}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as Se}from"efficient-easel/screen/lib/session";import{useEaselSession as Ee}from"efficient-easel/screen/lib/session-context";import{say as L}from"../../format/lib/editor-words.js";import{retargetWhenSaved as ye}from"../../format/lib/section-retarget.js";import{routeSharedHostMessage as Te}from"efficient-easel/screen/lib/host-inbound";import{routeWebsiteHostMessage as we}from"../../format/lib/website-host-inbound.js";import{DEFAULT_THEME_MODE as S,THEME_MODE_KEY as Ne}from"../../format/lib/theme.js";import{makeSitePageAdapter as U}from"../lib/editor-document-adapter.js";import{documentPermissions as Ce}from"efficient-easel/edit-lock";import{useAutosave as ke}from"efficient-easel/autosave";import{saveStatusOf as Ae}from"efficient-easel/screen/lib/document-switch";import{blocksOf as be}from"../lib/website-session.js";const Ie=x(()=>import("./SiteEditorProvider.js"),{ssr:!1}),Me=x(()=>import("efficient-easel/screen/components/SectionScreenShell"),{ssr:!1}),W="HeroSingle",Y="Untitled section";function Oe(i,E){const d=E.components,r=d[i]?i:W,y=d[r]?.defaultProps??{},n=ue(r,f=>d[f]?.defaultProps??{}),s=r===fe?{blocks:pe()}:null;return{type:r,props:{id:me(r),...y,...n?{[n.slot]:n.children}:null,...s}}}function De(){if(typeof window>"u")return S;try{const i=window.localStorage.getItem(Ne);return i==="light"||i==="dark"||i==="auto"?i:S}catch{return S}}function _e({id:i,initialType:E,initialName:d=Y}){const[r,y]=u(i),n=Z(r);P(()=>{n.current=r},[r]);const s=he(),[f,j]=u(E),[M,K]=u(d),[a,T]=u(void 0),[G,q]=u(S),{token:w,tokenRef:O}=ge({onMessage:e=>{if(we(e)||Te(e))return;const t=e;if(t?.type==="storefront-editor:navigate"&&t.target?.kind==="section"&&t.target.id){const b=t.target.id;if(b===n.current)return;const Q=t.target.type,V=t.target.name;ye(C,()=>{j(Q),K(V||Y),y(b),s.address.show({kind:"section",id:b})},()=>s.send("storefront-editor:save-failed"))}}}),N=ke({save:e=>R(I,e.id,e.node).then(()=>{}),onFailure:(e,t)=>{t===0&&s.send("storefront-editor:save-failed")}}),{state:p,push:D,flush:C}=N;P(()=>q(De()),[]);const c=Ee(),v=c.usesBridgedToken?!!w:!0,g=l(()=>$(Se(c),be(c)),[c]);P(()=>{if(!v)return;let e=!1;return T(void 0),I.ensure(r,M,Oe(f??W,g)).then(t=>!e&&T(t.node)).catch(()=>!e&&T(null)),()=>{e=!0}},[r,f,M,v,g]);const k=H(e=>{s.send("storefront-editor:dirty");const t=F(e);t&&D({id:n.current,node:t})},[D,s]),h=s.send,_=H(async e=>{try{return await e(O.current??""),!0}catch{return h("storefront-editor:save-failed"),!1}},[h]),z=l(()=>ee(g,!0),[g]);P(()=>(B(null),()=>B(null)),[]);const m=l(()=>a?le(ce(a)):null,[a]),A=l(()=>({target:{kind:"page",slug:""},adapter:U(void 0),capabilities:U(void 0).capabilities,templateId:null,currentSlug:"",currentKind:null,siteId:null,ready:v,token:w,tokenRef:O,notifyParent:h,runAuthed:_,docId:r,data:m,getLiveData:()=>m,error:null,redirecting:!1,saveStatus:Ae(p),saveState:p,autoSaveEnabled:!0,autoSaveStoppedByConflict:!1,hasUnsavedEdits:p.pending,toggleAutoSave:()=>{},retrySave:()=>{N.retryNow()},onChange:k,flushSave:C,onPublish:async e=>{const t=F(e);t&&await R(I,n.current,t)},bridgeCapabilities:ve,access:{kind:"editing"},readOnly:!1,takeOverEditing:()=>{},viewReadOnly:()=>{},saveConflict:null,reloadFromServer:()=>{},navigate:()=>{},pendingNav:null,cancelPendingNav:()=>{},discardAndNavigate:()=>{},saveAndNavigate:async()=>{}}),[r,v,w,h,_,m,p,k,C,N.retryNow]),J=l(()=>Ce(!A.readOnly),[A.readOnly]);return a===void 0?o("div",{className:"sf-msg",children:L("Loading…")}):a===null||!m?o("div",{className:"sf-msg sf-msg--error",children:L("Couldn’t open this section.")}):o(te.Provider,{value:A,children:o(X,{children:o(re,{themeMode:G,chromePlaceholder:!0,children:o(Pe,{wrap:c.chrome?.wrap,surface:"section",children:o(oe,{children:o(ie,{children:o(ne,{children:o(de,{children:o(se,{children:o(ae,{children:o(Ie,{config:z,data:m,onChange:k,permissions:J,children:o(Me,{})},r)})})})})})})})})})})}export{_e as default};
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import X from"./WebsiteHintsProvider.js";import{useCallback as H,useEffect as P,useMemo as l,useRef as Z,useState as u}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as $}from"../lib/document/build-config.js";import{withTemplateMediaPlaceholders as ee}from"../../format/lib/document/templateFields.js";import{setEditorPageSlug as B}from"../../format/lib/document/editor-page-context.js";import{ScreenDocumentContext as te}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as re}from"../../render/components/PreviewHeaderContext.js";import{PreviewTickerProvider as oe}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as ie}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as ne}from"efficient-easel/draw/client";import{CanvasPartsBridge as se}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as de}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as ae}from"./PreviewPartStyleContext.js";import{sectionTemplates as I}from"efficient-easel/screen/lib/section-templates";import{saveSectionTemplate as R}from"../lib/editor-document-adapter.js";import{nodeToDoc as ce,docToNode as F}from"efficient-easel/screen/lib/document/section-doc";import{newNodeId as me}from"efficient-easel/draw";import{migrateRenamedProps as le}from"../../format/lib/document/renamed-props.js";import{buildSlotSeedChildren as ue}from"../../render/lib/document/slot-specs.js";import{FOOTER_TYPE as fe,buildDefaultFooterBlocks as pe}from"../lib/document/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as ve,useAdminBridge as ge}from"efficient-easel/screen/lib/admin-bridge";import{useEaselHost as he}from"efficient-easel/screen/lib/host";import{ChromeWrap as Pe}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as Se}from"efficient-easel/screen/lib/session";import{useEaselSession as Ee}from"efficient-easel/screen/lib/session-context";import{say as L}from"../../format/lib/editor-words.js";import{retargetWhenSaved as ye}from"../../format/lib/section-retarget.js";import{routeSharedHostMessage as Te}from"efficient-easel/screen/lib/host-inbound";import{routeWebsiteHostMessage as we}from"../../format/lib/website-host-inbound.js";import{DEFAULT_THEME_MODE as S,THEME_MODE_KEY as Ne}from"../../format/lib/theme.js";import{makeSitePageAdapter as U}from"../lib/editor-document-adapter.js";import{documentPermissions as Ce}from"efficient-easel/edit-lock";import{useAutosave as ke}from"efficient-easel/autosave";import{saveStatusOf as Ae}from"efficient-easel/screen/lib/document-switch";import{blocksOf as be}from"../lib/website-session.js";const Ie=x(()=>import("./SiteEditorProvider.js"),{ssr:!1}),Me=x(()=>import("efficient-easel/screen/components/SectionScreenShell"),{ssr:!1}),W="Hero",Y="Untitled section";function Oe(i,E){const d=E.components,r=d[i]?i:W,y=d[r]?.defaultProps??{},n=ue(r,f=>d[f]?.defaultProps??{}),s=r===fe?{blocks:pe()}:null;return{type:r,props:{id:me(r),...y,...n?{[n.slot]:n.children}:null,...s}}}function De(){if(typeof window>"u")return S;try{const i=window.localStorage.getItem(Ne);return i==="light"||i==="dark"||i==="auto"?i:S}catch{return S}}function _e({id:i,initialType:E,initialName:d=Y}){const[r,y]=u(i),n=Z(r);P(()=>{n.current=r},[r]);const s=he(),[f,j]=u(E),[M,K]=u(d),[a,T]=u(void 0),[G,q]=u(S),{token:w,tokenRef:O}=ge({onMessage:e=>{if(we(e)||Te(e))return;const t=e;if(t?.type==="storefront-editor:navigate"&&t.target?.kind==="section"&&t.target.id){const b=t.target.id;if(b===n.current)return;const Q=t.target.type,V=t.target.name;ye(C,()=>{j(Q),K(V||Y),y(b),s.address.show({kind:"section",id:b})},()=>s.send("storefront-editor:save-failed"))}}}),N=ke({save:e=>R(I,e.id,e.node).then(()=>{}),onFailure:(e,t)=>{t===0&&s.send("storefront-editor:save-failed")}}),{state:p,push:D,flush:C}=N;P(()=>q(De()),[]);const c=Ee(),v=c.usesBridgedToken?!!w:!0,g=l(()=>$(Se(c),be(c)),[c]);P(()=>{if(!v)return;let e=!1;return T(void 0),I.ensure(r,M,Oe(f??W,g)).then(t=>!e&&T(t.node)).catch(()=>!e&&T(null)),()=>{e=!0}},[r,f,M,v,g]);const k=H(e=>{s.send("storefront-editor:dirty");const t=F(e);t&&D({id:n.current,node:t})},[D,s]),h=s.send,_=H(async e=>{try{return await e(O.current??""),!0}catch{return h("storefront-editor:save-failed"),!1}},[h]),z=l(()=>ee(g,!0),[g]);P(()=>(B(null),()=>B(null)),[]);const m=l(()=>a?le(ce(a)):null,[a]),A=l(()=>({target:{kind:"page",slug:""},adapter:U(void 0),capabilities:U(void 0).capabilities,templateId:null,currentSlug:"",currentKind:null,siteId:null,ready:v,token:w,tokenRef:O,notifyParent:h,runAuthed:_,docId:r,data:m,getLiveData:()=>m,error:null,redirecting:!1,saveStatus:Ae(p),saveState:p,autoSaveEnabled:!0,autoSaveStoppedByConflict:!1,hasUnsavedEdits:p.pending,toggleAutoSave:()=>{},retrySave:()=>{N.retryNow()},onChange:k,flushSave:C,onPublish:async e=>{const t=F(e);t&&await R(I,n.current,t)},bridgeCapabilities:ve,access:{kind:"editing"},readOnly:!1,takeOverEditing:()=>{},viewReadOnly:()=>{},saveConflict:null,reloadFromServer:()=>{},navigate:()=>{},pendingNav:null,cancelPendingNav:()=>{},discardAndNavigate:()=>{},saveAndNavigate:async()=>{}}),[r,v,w,h,_,m,p,k,C,N.retryNow]),J=l(()=>Ce(!A.readOnly),[A.readOnly]);return a===void 0?o("div",{className:"sf-msg",children:L("Loading…")}):a===null||!m?o("div",{className:"sf-msg sf-msg--error",children:L("Couldn’t open this section.")}):o(te.Provider,{value:A,children:o(X,{children:o(re,{themeMode:G,chromePlaceholder:!0,children:o(Pe,{wrap:c.chrome?.wrap,surface:"section",children:o(oe,{children:o(ie,{children:o(ne,{children:o(de,{children:o(se,{children:o(ae,{children:o(Ie,{config:z,data:m,onChange:k,permissions:J,children:o(Me,{})},r)})})})})})})})})})})}export{_e as default};
@@ -1 +1 @@
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 V,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 M,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 Ve,useWebsiteName as Me}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?V(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=V(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(M),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(Ve),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()},Vt={desktop:2e3,tablet:800,mobile:390},J="desktop",Mt={options:me,initial:J,fluid:J,widths:Vt,hidesPerView:!0},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(M)}}function jt(e,t){ye(e,t),Be()}const ir={useOwnerName:Me,useDocumentLabel:Ye,useBridges:Bt,useStandaloneBridges:Kt,useDocumentPass:jt,blockRules:Nt,blockLook:Wt,devices:Mt,leftView:xt,pinned:Gt,Canvas:ft,canvasDrag:{media:Et},Inspector:be};export{ir as WEBSITE_SCREEN};
1
+ "use client";import{jsx as a,Fragment as y,jsxs as C}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{toItemSelector as ae}from"efficient-easel/node-ops";import{useEaselStrings as H}from"efficient-easel/strings";import{LocationsTreeContext as ce}from"./LocationsTreeContext.js";import{usePartTypingDeps as de}from"./usePartTypingDeps.js";import{copyItemWrite as le}from"../lib/document/card-copy-rows.js";import pe from"./PagesPanel.js";import{usePreviewChat as me}from"./PreviewChatContext.js";import{PREVIEW_DEVICES as ue}from"./preview-devices.js";import{PreviewDeviceContext as fe}from"efficient-easel/draw/client";import{usePreviewSocial as Se}from"../../render/components/PreviewSocialContext.js";import{usePreviewSurface as Ee}from"./PreviewSurfaceContext.js";import{TICKER_PART_LABEL as he,usePreviewTicker as Pe}from"../../render/components/PreviewTickerContext.js";import{heroStoresLegacyTicker as Te}from"../../format/lib/hero-ticker.js";import{usePreviewHeroPart as we}from"../../render/components/PreviewHeroPartContext.js";import{HERO_MEDIA_PARTS as ge,HERO_PART_MODE as W,heroMediaRows as Ie,heroPartId as V,readHeroPartId as be}from"../../render/lib/document/hero-media-parts.js";import ve,{CHAT_MODE as _e,HEADER_MODE as ke,SOCIAL_MODE as Ce,WEBSITE_MODE as M,WEBSITE_PAGE_MODE as Re}from"./SectionEditor.js";import R from"./SectionIcon.js";import Le from"./SectionThumbnail.js";import{useScreenDocument as L}from"efficient-easel/screen/components/ScreenDocumentContext";import Oe from"./StylesPanel.js";import{LOCATIONS_TYPE as Ae,useLocationsTree as ye}from"./useLocationsTree.js";import{usePinnedChromeSeed as Be}from"./usePinnedChromeSeed.js";import{useHostDocumentBridge as De}from"./useHostDocumentBridge.js";import{usePreviewHref as Ne}from"./usePreviewHref.js";import{WebsitePreviewButton as He}from"./WebsitePreviewButton.js";import{SITE_STYLES_BASICS_TAB as We,SITE_STYLES_TABS as Ve,SITE_STYLES_TEXT_TAB as Me,useWebsiteName as xe}from"./WebsiteSettingsPanel.js";import{useWebsiteMainAction as Ge}from"./useWebsiteMainAction.js";import{VersionHistory as Ye}from"./VersionHistoryDrawer.js";import{useEaselSession as x}from"efficient-easel/screen/lib/session-context";import{useOpenPageName as Fe}from"../lib/page-rows.js";import{HERO_GROUP_TYPE as ze,heroGroupNestDepth as Ke}from"../../format/lib/hero-group-placement.js";import{stripMarkup as je}from"../../format/lib/markup.js";import{categoryShortLabel as Ue,PINNED_SECTION_TYPE as Ze}from"../lib/document/add-palette.js";import{canAddTo as qe}from"../lib/document/add-target.js";import{cardTemplateSlotsOf as Xe}from"../../format/lib/document/card-template-layers.js";import{blockIsOffered as Je}from"../lib/document/block-offer.js";import{sectionIdOfBoxZone as Qe,setBookingPreview as $e}from"../../render/lib/document/booking-preview.js";import{footerBlockRowName as et}from"../../format/lib/document/footer-block-row-name.js";import{sourceRowName as tt}from"../../format/lib/document/source-row-name.js";import{FOOTER_TYPE as ot,HEADER_TYPE as G}from"../lib/document/footer-blocks.js";import{leftViewForSelection as rt,readLeftView as nt,resolveLeftView as it,writeLeftView as st}from"../../format/lib/document/left-view.js";import{websiteNodeIsLocked as at}from"../lib/document/locked-blocks.js";import{everyPageNotice as ct,noOwnTab as dt,pinnedReach as Y,websiteDuplicateBlocked as lt}from"../lib/document/every-page.js";import{sharedSectionReach as pt,WEBSITE_SHARED_SECTIONS as mt}from"../lib/shared-sections-layer.js";import{activeSharedSections as O,setSharedEditor as F}from"../../format/lib/shared-sections-active.js";import{sharedSectionsOf as ut}from"efficient-easel/screen/lib/shared-sections";import{pinnedChromeInPlace as _}from"../../format/lib/pinned-chrome-lock.js";import{scrollPreviewToSection as ft,scrollPreviewToTop as z}from"efficient-easel/screen/lib/document/preview-dom";import{SiteCanvas as St}from"../lib/document/overrides.js";import{labelAtLevel as Et}from"../../format/lib/document/section-catalog.js";import{WEBSITE_MEDIA_DROP as ht}from"../../format/lib/document/media-drop.js";import{editorWords as Pt,say as f}from"../../format/lib/editor-words.js";import{SECTION_DESCRIPTIONS as Tt}from"../../format/lib/document/section-descriptions.js";import{groupAccepts as wt,isSectionGroupType as gt,sectionGroupZone as It,SITE_FOOTER_TYPE as K,SITE_HEADER_TYPE as bt}from"../../format/lib/document/section-groups.js";import{SaveAsTemplateButton as vt}from"./SaveAsTemplateButton.js";import{resolveSaveAsTemplateAction as _t,SAVE_AS_TEMPLATE_EVENT as kt}from"../../format/lib/save-as-template-action.js";import{menuPresets as Ct}from"../lib/sections/menu-presets.js";import{newSectionNode as Rt}from"../lib/sections/new-section-node.js";import{useHostProducts as Lt}from"../lib/use-host-products.js";import{backendOf as Ot}from"../lib/website-session.js";function j({mode:e,open:t}){const{setSelectedHeroId:o,setSelectHandler:r}=Pe(),c=H().tree,d=e,n=d.kind==="ticker"?d.heroId:null,s=v(i=>{if(!i)return;t({kind:"ticker",heroId:i}),ft(i)},[t]);return g(()=>{o(n)},[n,o]),g(()=>{r(s)},[r,s]),{partRows:(i,{rowClick:m})=>{const S=String(i.props.id);return i.type==="Hero"&&Te(i.props)&&a(D,{icon:a(R,{type:"ticker",size:13}),name:f(he),onSelect:()=>s(S),selected:n===S,rowProps:{onClick:m(()=>s(S))},words:c})}}}function U({mode:e,select:t}){const{setSelectedHeroPart:o,setSelectHandler:r}=we(),c=H().tree,{appState:d,config:n}=N(p=>p),s=te({data:d.data,config:n});s.current={data:d.data,config:n};const i=e,m=ge.find(p=>W[p]===i.kind),S=m&&"nodeId"in i?V(String(i.nodeId),m):null,h=v(p=>{const l=be(p);if(!l)return;const{data:T,config:P}=s.current,u=ae(T,P,{kind:"node",id:l.nodeId});if(!u)return;const I={kind:W[l.part],nodeId:l.nodeId};t({index:u.index,zone:u.zone},I)},[t]);return g(()=>{o(S)},[S,o]),g(()=>{r(h)},[r,h]),{partRows:(p,{rowClick:l})=>{const T=String(p.props.id),P=Ie(p);if(P.length===0)return null;const u=E=>{const w=V(T,E.part);return a(D,{icon:a(R,{type:E.part==="media"?"heroMedia":"heroImage",size:13}),name:f(E.label),onSelect:()=>h(w),selected:S===w,rowProps:{onClick:l(()=>h(w))},words:c},w)},[I,...b]=P;return C(y,{children:[u(I),b.length>0&&a(se,{children:b.map(u)})]})}}}function Z(e,t){return{partRows:(o,r)=>C(y,{children:[e.partRows?.(o,r),t.partRows?.(o,r)]})}}function At(e){const{adapter:t,capabilities:o,currentSlug:r,siteId:c,docId:d,hasUnsavedEdits:n,bridgeCapabilities:s,notifyParent:i,token:m}=L(),{hasPreviewLink:S}=o,h=Ot(x()).preview?.draftLink,p=Ge(e.data),l=_t({hasTrustedConsole:!!m,canCreatePlatformTemplate:s.canCreatePlatformTemplate,capabilities:o,siteId:c,hasUnsavedEdits:n}),T=v(()=>{!c||!r||i(kt,{siteId:c,slug:r})},[i,c,r]),P=Ne({pageSlug:r,siteId:c,token:m}),u=t.previewHref?.(r)??P;return{barLead:()=>l.visible&&a(vt,{enabled:l.enabled,reason:l.enabled?"":l.disabledReason,onSaved:T}),barView:()=>S&&r&&a(He,{liveHref:u,pageId:d??null,draftLink:h}),mainAction:p}}function yt(e,t){const{capabilities:o,templateId:r,siteId:c,tokenRef:d,navigate:n}=L(),{hasSiteTheme:s,explainsSiteSettings:i}=o,m=E=>t.setView(E),[S,h]=B(Ve[0].id),[p,l]=B(!1),{surface:T,setSurface:P}=Ee(),u=()=>{if(s){m("styles"),t.reveal(),z();return}e.show(M),e.reveal(),z()},I={id:"pages",label:f("Pages"),icon:a(re,{}),panel:({onHide:E})=>a(pe,{activeSurface:T,onPreviewSurface:P,onNavigate:w=>{P(null),n(r?{kind:"template",id:r,pageSlug:w}:{kind:"page",slug:w,siteId:c??void 0})},onClose:E})},b=[];return!s&&i&&b.push({id:"appearance",label:f("Appearance"),icon:a(ie,{}),active:e.kind==="website",onSelect:u}),s&&b.push({id:"styles",label:f("Styles"),icon:a(ne,{}),panel:({onHide:E,notify:w})=>a(Oe,{tokenRef:d,siteId:c??void 0,onClose:E,onNotify:w,tab:S,onTabChange:h,revealPageGroup:p,onPageGroupRevealed:()=>l(!1)})}),{railLead:[I],railTrail:b,resolveLeftView:E=>it(E,s),openSettings:u,openStyles:()=>{h(Me),m("styles")},openPageStyles:s?()=>{h(We),l(!0),m("styles"),t.reveal()}:i?()=>{e.show(Re),e.reveal()}:void 0}}function Bt(){const{navigate:e,siteId:t,reloadFromServer:o,docId:r}=L(),c=N(n=>n.config),d=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 ut(d).list().then(i=>{s||n.learn(i)}).catch(()=>{}),()=>{s=!0}},[r,d])}function q(){const e=de();return v(t=>{le(t,e)},[e])}function Dt(e,t,o,r){const{kind:c,open:d}=e,{selected:n,zoneOf:s}=t;g(()=>{$e(n?.type==="BookingBox"&&n.props.region==="confirm"?Qe(s(String(n.props.id))):null)},[n?.props.id]);const i=ye(e,t),{capabilities:{hasSiteSettings:m}}=L();Bt();const{chat:S,setChat:h,setSelected:p,setSelectHandler:l}=me(),T=v(()=>d(_e),[d]),P=c==="chat";g(()=>{p(P)},[P,p]),g(()=>{l(T)},[l,T]);const{setOpenHandler:u}=Se(),I=v(()=>d(Ce),[d]);g(()=>{u(I)},[u,I]);const b=Z(j(e),U(e)),E=At(t),w=yt(e,r),Q=o.device,$=q();return{...b,...E,...w,hasOwnRows:k=>k.type===Ae,ownRows:i.renderLocationTree,sectionPressed:i.sectionPressed,onCopyItem:$,wrap:k=>a(ce.Provider,{value:!0,children:C(fe.Provider,{value:Q,children:[k,a(Ye,{})]})}),addPanelRow:k=>m?C("div",{className:"sf-addside-sitewide",children:[a("span",{className:"sf-addside-sitewide-glyph","aria-hidden":"true",children:a(R,{type:"chat",size:16})}),C("button",{type:"button",className:"sf-addside-sitewide-name",onClick:()=>{k(),T()},children:[f("Live chat"),a("span",{className:"sf-addside-sitewide-desc",children:f("A chat bubble on every page")})]}),a(oe,{checked:S.enabled,onChange:ee=>h({enabled:ee}),ariaLabel:f("Show the chat bubble on the whole site")})]}):void 0}}let X=null,A=new WeakMap;function Nt(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: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 Ht={isLockedBlock:(e,t)=>at(e,t)||!!(t&&O()?.heldElsewhere(t.props.id)),duplicateBlocked:lt,nestDepth:(e,t,o)=>t===ze?Ke(e,o):0,newSectionNode:Rt,canAddTo:(e,t,o,r)=>Nt(qe(e,t,r,o)),blockIsOffered:Je,slotsOf:Xe,resolveOnInsert:!0},Wt=new Proxy(Tt,{get:(e,t)=>{const o=Reflect.get(e,t);return typeof o=="string"?f(o):o}}),Vt={labelAtLevel:(e,t,o)=>f(Et(e,t,o)),descriptions:Wt,categoryLabel:e=>{const t=Ue(e);return t===void 0?void 0:f(t)},firstSection:Ze,blockRowName:et,rowName:tt,plainText:je,Icon:R,Thumbnail:Le,useProducts:Lt,presets:Ct()},Mt={desktop:2e3,tablet:800,mobile:390},J="desktop",xt={options:ue,initial:J,fluid:J,widths:Mt,hidesPerView:!0},Gt={read:nt,write:e=>st(e),forSelection:(e,t)=>rt(e,t)},Yt={first:G,last:ot,firstGroup:bt,lastGroup:K,isSectionGroup:gt,sectionGroupZone:It,panelOf:e=>e===G?ke:null,get sharedReach(){return _()?zt:void 0},get shared(){return O()?mt:void 0},get groupTab(){return _()?dt:void 0},get groupBadge(){return _()?Y({type:K})??void 0:void 0},get changeNotice(){return _()?ct():void 0},get band(){return _()?Ft:void 0},get groupAccepts(){return _()?wt:void 0}},Ft={foldable:!0},zt=e=>Y(e)??pt(e);function Kt(e){return{...Z(j(e),U(e)),onCopyItem:q(),openSettings:()=>e.show(M)}}function jt(e,t){Be(e,t),De()}const ar={useOwnerName:xe,useDocumentLabel:Fe,useBridges:Dt,useStandaloneBridges:Kt,useDocumentPass:jt,blockRules:Ht,blockLook:Vt,devices:xt,leftView:Gt,pinned:Yt,Canvas:St,canvasDrag:{media:ht},Inspector:ve};export{ar as WEBSITE_SCREEN};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{ImageIcon as _,ImagesIcon as c,MediaIcon as b,MediaLayoutSideBySideIcon as f,MediaLayoutStackedIcon as E,OpacityIcon as m}from"efficient-easel/icons";import{colorInput as n,focusKeptField as a,MEDIA_TYPE_OPTIONS as P,upload as i}from"../../../controls.js";import{group as t,phoneTwinFields as S}from"efficient-easel/screen/lib/document/box-fields";import{segmented as l,slider as r}from"../../../box-fields.js";import{MEDIA_LAYOUT_DEFAULT as g,MEDIA_LAYOUT_LABELS as p,MEDIA_LAYOUTS as y,resolvePhoneLayout as v}from"../../../../../../format/lib/hero-media-layout.js";import{deviceNote as h}from"efficient-easel/screen/lib/document/device-fields";import{HERO_OVERLAY_ROWS as u,HERO_VIDEO_ROWS as d,heroHeightFields as U}from"../../hero-shared-fields.js";import{slotNoticeField as A}from"../../shared-fields.js";import{forMediaType as s,heroMediaFields as D,VIDEO_FILE_LABEL as M,VIDEO_FILE_PROMPT as k}from"../../../../../../render/lib/document/hero-media-parts.js";import{VIDEO_SOURCE_DEFAULT as F}from"../../../../../../format/lib/hero-video.js";const I=s("video","image"),L=s("image","image"),T={one:o(_,{}),side:o(f,{}),stacked:o(E,{})};import{HeroSingleSlots as C}from"../../../../../../format/lib/document/blocks/general/HeroSingle/meta.js";import{DEFAULT_TINT as O}from"../../../../../../format/lib/content/tint.js";const z={fields:D({_dDevice:h(),boxNotice:A("HeroSingle"),boxes:C.boxes,_gStyle:t("Style"),overlay:r("Overlay",o(m,{}),0,100,5,100,"%"),overlayColor:u.overlayColor,overlayPosition:u.overlayPosition,_gLayout:t("Layout"),...U({tabletNumber:!1}),_gMedia:t("Media"),mediaType:l("Type",o(b,{}),P,"image"),mediaLayout:l("Layout",o(c,{}),y.map(e=>({label:p[e],value:e,picture:T[e]})),g),mediaLayoutPhone:S("mediaLayout",l("Layout",o(c,{}),y.map(e=>({label:p[e],value:e,picture:T[e]})),g,{phoneRest:e=>v(void 0,e)})).mediaLayoutPhone,mediaImage:i("Background image","image/*","Upload a background image",{focus:"imageFocal"}),imageFocal:a(),imageFocalTablet:a(),imageFocalPhone:a(),videoSource:d.videoSource,mediaVideo:i(M,"video/*",k),youtubeUrl:d.youtubeUrl,videoPlayback:d.videoPlayback,poster:i("Video poster","image/*","Upload a poster still"),_gTint:t("Image tint"),tintColor:n("Tint color",O),tintOpacity:r("Tint opacity",o(m,{}),0,100,5,0,"%"),mediaImage2:i("Background image","image/*","Upload a background image",{focus:"imageFocal2"}),imageFocal2:a(),imageFocal2Tablet:a(),imageFocal2Phone:a(),tintColor2:n("Tint color",O),tintOpacity2:r("Tint opacity",o(m,{}),0,100,5,0,"%")},{parts:{media:["mediaType","mediaLayout","mediaLayoutPhone","videoSource","mediaVideo","youtubeUrl","videoPlayback","poster"],image:["mediaImage","imageFocal","imageFocalTablet","imageFocalPhone","tintColor","tintOpacity"],image2:["mediaImage2","imageFocal2","imageFocal2Tablet","imageFocal2Phone","tintColor2","tintOpacity2"]},onlyFor:{image:["mediaImage","imageFocal","imageFocalTablet","imageFocalPhone","_gTint","tintColor","tintOpacity","mediaImage2","imageFocal2","imageFocal2Tablet","imageFocal2Phone","tintColor2","tintOpacity2"],video:["videoSource","videoPlayback","poster"]},rules:{mediaVideo:{all:[I,{field:"videoSource",is:"upload",default:F}]},youtubeUrl:{all:[I,{field:"videoSource",is:"youtube",default:F}]},mediaLayout:{all:[L,{not:{context:"device",is:"mobile"}}]},mediaLayoutPhone:{all:[L,{context:"device",is:"mobile"}]}},fallback:"image"})};export{z as HeroSingleFields};
1
+ import{jsx as r}from"react/jsx-runtime";import{MediaIcon as O,OpacityIcon as s}from"efficient-easel/icons";import{MEDIA_TYPE_OPTIONS as u,upload as t}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{segmented as n,slider as p}from"../../../box-fields.js";import{deviceNote as S}from"efficient-easel/screen/lib/document/device-fields";import{HERO_IMAGE2_ROWS as c,HERO_IMAGE_ROWS as g,heroTintColorRow as v,HERO_LAYOUT_ROWS as a,HERO_IMAGE2_KEYS as l,HERO_IMAGE_KEYS as R,HERO_LAYOUT_KEYS as f,heroLayoutRules as I,heroTintRow as H,HERO_OVERLAY_ROWS as d,HERO_VIDEO_ROWS as i,heroHeightFields as L}from"../../hero-shared-fields.js";import{slotNoticeField as T}from"../../shared-fields.js";import{mediaTypeShownWhen as m,heroMediaFields as b,VIDEO_FILE_LABEL as A,VIDEO_FILE_PROMPT as P}from"../../../../../../render/lib/document/hero-media-parts.js";import{HERO_ABSENT_MEDIA_TYPE as e}from"../../../../../../format/lib/hero-media-layout.js";import{VIDEO_SOURCE_DEFAULT as _}from"../../../../../../format/lib/hero-video.js";const E=m("video",e.HeroSingle),M=m("image",e.HeroSingle);import{HeroSingleSlots as h}from"../../../../../../format/lib/document/blocks/general/HeroSingle/meta.js";const y=[...R,"tintColor","tintOpacity"],K={fields:b({_dDevice:S(),boxNotice:T("HeroSingle"),boxes:h.boxes,_gStyle:o("Style"),overlay:p("Overlay",r(s,{}),0,100,5,100,"%"),overlayColor:d.overlayColor,overlayPosition:d.overlayPosition,_gLayout:o("Layout"),...L({tabletNumber:!1}),_gMedia:o("Media"),mediaType:n("Type",r(O,{}),u,e.HeroSingle),mediaLayout:a.mediaLayout,mediaLayoutPhone:a.mediaLayoutPhone,...g,videoSource:i.videoSource,mediaVideo:t(A,"video/*",P),youtubeUrl:i.youtubeUrl,videoPlayback:i.videoPlayback,poster:t("Video poster","image/*","Upload a poster still"),_gTint:o("Image tint"),tintColor:v(),tintOpacity:H(),...c},{parts:{media:["mediaType",...f,"videoSource","mediaVideo","youtubeUrl","videoPlayback","poster"],image:y,image2:l},onlyFor:{image:[...y,"_gTint",...l],video:["videoSource","videoPlayback","poster"]},rules:{mediaVideo:{all:[E,{field:"videoSource",is:"upload",default:_}]},youtubeUrl:{all:[E,{field:"videoSource",is:"youtube",default:_}]},...I(M)},fallback:e.HeroSingle})};export{K as HeroSingleFields};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{BlockVideoIcon as g,ClockIcon as I,ImageIcon as _,MediaIcon as P,OpacityIcon as S,PlayIcon as y}from"efficient-easel/icons";import{colorInput as F,focusKeptField as l,loadingShowsField as E,MEDIA_TYPE_OPTIONS as O,plainText as T,text as h,upload as e,withIdentifier as b,withPanelOnly as t}from"../../../controls.js";import{group as r}from"efficient-easel/screen/lib/document/box-fields";import{segmented as V,slider as n}from"../../../box-fields.js";import{LOADING_SHOWS_IMAGE as p,VIDEO_PLAYBACK_DEFAULT as A,VIDEO_SOURCE_DEFAULT as i}from"../../../../../../format/lib/hero-video.js";import{HERO_SLIDE_OVERLAY_ROWS as v,HERO_VIDEO_ROWS as m}from"../../hero-shared-fields.js";import{PH as L}from"../../../../../../format/lib/document/blocks/placeholders.js";import{slotNoticeField as k}from"../../shared-fields.js";import{AV1_FILE_LABEL as c,AV1_FILE_PROMPT as s,forMediaType as D,heroMediaFields as C,VIDEO_FILE_LABEL as u,VIDEO_FILE_PROMPT as f}from"../../../../../../render/lib/document/hero-media-parts.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{DEFAULT_TINT as M}from"../../../../../../format/lib/content/tint.js";import{HeroSlideSlots as R}from"../../../../../../format/lib/document/blocks/general/HeroSlide/meta.js";const d=D("video","video"),J={fields:C({_gContent:r("Content"),name:t(b(T("Slide name",L.slideName))),process:t(h("Reel label","Label")),groupNotice:k("HeroSlide"),groups:R.groups,_gMedia:r("Media"),mediaType:V("Type",o(P,{}),O,"video"),videoSource:m.videoSource,mediaVideo:a("desktop",e(u,"video/*",f,{frame:"videoFrame"})),mediaVideoPhone:a("mobile",e(u,"video/*",f,{frame:"videoFramePhone"})),videoFramePhone:l(),mediaVideoAv1:a("desktop",e(c,"video/mp4",s)),mediaVideoAv1Phone:a("mobile",e(c,"video/mp4",s)),youtubeUrl:m.youtubeUrl,videoPlayback:m.videoPlayback,videoSpeed:n("Playback speed",o(y,{}),25,100,5,100,"%"),loadingShows:E("Show while loading",o(I,{}),{frame:o(g,{}),image:o(_,{})}),videoFrame:l(),mediaImage:e("Background image","image/*","Upload a background image",{focus:"imageFocal"}),imageFocal:l(),imageFocalTablet:l(),imageFocalPhone:l(),poster:a("desktop",e("Image","image/*","Choose an image")),posterPhone:a("mobile",e("Image","image/*","Choose an image")),_gTint:r("Image tint"),tintColor:F("Tint color",M),overlay:n("Tint",o(S,{}),0,100,5,0,"%"),_gOverlay:r("Overlay"),overlayColor:v.overlayColor,overlayPosition:v.overlayPosition},{onlyFor:{image:["mediaImage","imageFocal","imageFocalTablet","imageFocalPhone","_gTint","tintColor","overlay"],video:["videoSource","videoPlayback","loadingShows","videoFrame"]},fallback:"video",rules:{mediaVideo:{all:[d,{field:"videoSource",is:"upload",default:i}]},mediaVideoPhone:{all:[d,{field:"videoSource",is:"upload",default:i}]},mediaVideoAv1:{all:[d,{field:"videoSource",is:"upload",default:i}]},mediaVideoAv1Phone:{all:[d,{field:"videoSource",is:"upload",default:i}]},youtubeUrl:{all:[d,{field:"videoSource",is:"youtube",default:i}]},videoSpeed:{all:[d,{field:"videoSource",is:"upload",default:i},{field:"videoPlayback",is:"background",default:A}]},poster:{all:[{field:"mediaType",is:"video",default:"video"},p]},posterPhone:{all:[{field:"mediaType",is:"video",default:"video"},p]}}})};export{J as HeroSlideFields};
1
+ import{jsx as a}from"react/jsx-runtime";import{BlockVideoIcon as P,ClockIcon as I,ImageIcon as y,MediaIcon as h,PlayIcon as g}from"efficient-easel/icons";import{focusKeptField as t,loadingShowsField as A,MEDIA_TYPE_OPTIONS as L,plainText as R,text as V,upload as o,withIdentifier as F,withPanelOnly as n}from"../../../controls.js";import{group as l}from"efficient-easel/screen/lib/document/box-fields";import{segmented as T,slider as b}from"../../../box-fields.js";import{LOADING_SHOWS_IMAGE as s,VIDEO_PLAYBACK_DEFAULT as H,VIDEO_SOURCE_DEFAULT as i}from"../../../../../../format/lib/hero-video.js";import{HERO_IMAGE2_ROWS as M,HERO_IMAGE_ROWS as k,heroTintColorRow as C,HERO_LAYOUT_ROWS as p,HERO_IMAGE2_KEYS as u,HERO_IMAGE_KEYS as D,HERO_LAYOUT_KEYS as w,heroLayoutRules as Y,heroTintRow as U,HERO_SLIDE_OVERLAY_ROWS as v,HERO_VIDEO_ROWS as m}from"../../hero-shared-fields.js";import{PH as G}from"../../../../../../format/lib/document/blocks/placeholders.js";import{slotNoticeField as N}from"../../shared-fields.js";import{AV1_FILE_LABEL as _,AV1_FILE_PROMPT as S,mediaTypeShownWhen as E,heroMediaFields as W,VIDEO_FILE_LABEL as O,VIDEO_FILE_PROMPT as c}from"../../../../../../render/lib/document/hero-media-parts.js";import{HERO_ABSENT_MEDIA_TYPE as r}from"../../../../../../format/lib/hero-media-layout.js";import{deviceField as d}from"efficient-easel/screen/lib/document/device-fields";import{HeroSlideSlots as x}from"../../../../../../format/lib/document/blocks/general/HeroSlide/meta.js";const e=E("video",r.HeroSlide),B=E("image",r.HeroSlide),f=[...D,"tintColor","overlay"],ae={fields:W({_gContent:l("Content"),name:n(F(R("Slide name",G.slideName))),process:n(V("Reel label","Label")),groupNotice:N("HeroSlide"),groups:x.groups,_gMedia:l("Media"),mediaType:T("Type",a(h,{}),L,r.HeroSlide),mediaLayout:p.mediaLayout,mediaLayoutPhone:p.mediaLayoutPhone,videoSource:m.videoSource,mediaVideo:d("desktop",o(O,"video/*",c,{frame:"videoFrame"})),mediaVideoPhone:d("mobile",o(O,"video/*",c,{frame:"videoFramePhone"})),videoFramePhone:t(),mediaVideoAv1:d("desktop",o(_,"video/mp4",S)),mediaVideoAv1Phone:d("mobile",o(_,"video/mp4",S)),youtubeUrl:m.youtubeUrl,videoPlayback:m.videoPlayback,videoSpeed:b("Playback speed",a(g,{}),25,100,5,100,"%"),loadingShows:A("Show while loading",a(I,{}),{frame:a(P,{}),image:a(y,{})}),videoFrame:t(),...k,poster:d("desktop",o("Image","image/*","Choose an image")),posterPhone:d("mobile",o("Image","image/*","Choose an image")),_gTint:l("Image tint"),tintColor:C(),overlay:U(),...M,_gOverlay:l("Overlay"),overlayColor:v.overlayColor,overlayPosition:v.overlayPosition},{parts:{media:["mediaType",...w,"videoSource","mediaVideo","mediaVideoPhone","videoFramePhone","mediaVideoAv1","mediaVideoAv1Phone","youtubeUrl","videoPlayback","videoSpeed","loadingShows","videoFrame","poster","posterPhone"],image:f,image2:u},onlyFor:{image:[...f,"_gTint",...u],video:["videoSource","videoPlayback","loadingShows","videoFrame"]},fallback:r.HeroSlide,rules:{mediaVideo:{all:[e,{field:"videoSource",is:"upload",default:i}]},mediaVideoPhone:{all:[e,{field:"videoSource",is:"upload",default:i}]},mediaVideoAv1:{all:[e,{field:"videoSource",is:"upload",default:i}]},mediaVideoAv1Phone:{all:[e,{field:"videoSource",is:"upload",default:i}]},youtubeUrl:{all:[e,{field:"videoSource",is:"youtube",default:i}]},videoSpeed:{all:[e,{field:"videoSource",is:"upload",default:i},{field:"videoPlayback",is:"background",default:H}]},...Y(B),poster:{all:[e,s]},posterPhone:{all:[e,s]}}})};export{ae as HeroSlideFields};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{ColumnWidthsIcon as f,ColumnsIcon as _,LayoutIcon as P,MediaLayoutStackedIcon as T,PlacementIcon as E}from"efficient-easel/icons";import{deviceField as g}from"efficient-easel/screen/lib/document/device-fields";import{cardImageFields as O,text as s,textarea as b}from"../../../controls.js";import{group as i,section as n}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as I,segmented as l,slider as h}from"../../../box-fields.js";import{IMAGE_TEXT_ARRANGEMENT_PICTURES as R,LAYOUT_CELL as C}from"../../../choice-pictures.js";import{BLOCK_SOURCE_EDIT_PROP as x,blockSourceEditField as A,blockSourceField as w,blockSourceFields as L}from"../../../block-source-fields.js";import{declaredBlockSource as m}from"../../../../../../format/lib/content/block-sources.js";import{ARRANGEMENT_OPTIONS as N,IMAGE_WIDTH_OPTIONS as v,PHONE_ORDER_OPTIONS as F}from"../../../../../../format/lib/content/image-text-rows.js";import{imageTextRowTemplate as D}from"../../../../../../format/lib/document/blocks/general/ProcessSteps/row-seed.js";import{SPLITTABLE_SECTIONS as G,headFieldsForPlacement as H}from"../../../../../../format/lib/sections/section-head-placement.js";import{PH as W}from"../../../../../../format/lib/document/blocks/placeholders.js";import{withRowRules as k}from"../../../../../../render/lib/document/show-when.js";import{isNodeList as a}from"efficient-easel/data";import{PROCESS_PH as p,ProcessStepsSlots as c}from"../../../../../../format/lib/document/blocks/general/ProcessSteps/meta.js";const u={field:"arrangement",in:["rows-left","rows-right"]},d="drawsLegacySteps",S={not:{context:d,is:!0}},M={[d]:e=>{const o=e.props??{};return!m(o)&&!a(o.boxes)}},y=e=>e?.data?.root?.props??null,re={fields:k({_gSource:i("Source"),dataSource:w("Item content","Manual"),[x]:A(),_sHeader:n("Header"),_gContent:i("Content"),num:s("Number",p.num),title:s("Heading",p.title),description:b("Body",W.body),boxes:c.boxes,template:c.template,_dDesign:n("Design"),arrangement:I("Arrangement",t(P,{}),N.map(e=>({label:e.label,hint:e.hint,value:e.value,picture:R[e.value]})),"columns",{columns:3,cell:C}),imageWidth:l("Image width",t(f,{}),v.map(e=>({label:e.label,value:e.value})),"half"),phoneOrder:g("mobile",l("Order",t(T,{}),F.map(e=>({label:e.label,value:e.value})),"picture")),columns:h("Columns",t(_,{}),2,4,1,3),...O(),cardText:l("Text position",t(E,{}),[{label:"Below picture",value:"below"},{label:"On picture",value:"on-image"}],"below")},[[["cardText"],{not:{field:"boxes",set:!0}}],[["arrangement"],S],[["imageWidth","phoneOrder"],{all:[u,S]}],[["columns"],{not:u}]]),showWhenFacts:M,resolveFields:(e,o)=>L("ProcessSteps",H(o.fields,e.props.headPlacement,G.ProcessSteps.headRows),e.props,{root:y(o.appState)}),resolveData:(e,o)=>{const r=e.props;return o?.changed?.dataSource!==!0||!m(r)||a(r.template)?e:{...e,props:{...r,template:D(String(r.id??"ProcessSteps"))}}}};export{re as ProcessStepsFields};
1
+ import{jsx as r}from"react/jsx-runtime";import{ColumnWidthsIcon as T,ColumnsIcon as E,LayoutIcon as P,MediaLayoutStackedIcon as O,PlacementIcon as b}from"efficient-easel/icons";import{deviceField as g}from"efficient-easel/screen/lib/document/device-fields";import{cardImageFields as I,text as s,textarea as R}from"../../../controls.js";import{group as n,section as m}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as h,segmented as i,slider as C}from"../../../box-fields.js";import{IMAGE_TEXT_ARRANGEMENT_PICTURES as A,LAYOUT_CELL as L}from"../../../choice-pictures.js";import{BLOCK_SOURCE_EDIT_PROP as x,blockSourceEditField as N,blockSourceField as w,blockSourceFields as v}from"../../../block-source-fields.js";import{declaredBlockSource as a}from"../../../../../../format/lib/content/block-sources.js";import{ARRANGEMENT_OPTIONS as F,IMAGE_WIDTH_OPTIONS as D,PHONE_ORDER_OPTIONS as G}from"../../../../../../format/lib/content/image-text-rows.js";import{PROCESS_STEPS_TYPE as c,imageTextRowTemplate as H}from"../../../../../../format/lib/document/blocks/general/ProcessSteps/row-seed.js";import{CARD_TEMPLATE_SLOT as l}from"../../../../../../format/lib/content/card-row-keys.js";import{SPLITTABLE_SECTIONS as M,headFieldsForPlacement as W}from"../../../../../../format/lib/sections/section-head-placement.js";import{PH as k}from"../../../../../../format/lib/document/blocks/placeholders.js";import{withRowRules as y}from"../../../../../../render/lib/document/show-when.js";import{isNodeList as p}from"efficient-easel/data";import{seedNodeId as B}from"../../../../../../format/lib/document/seed-parts.js";import{PROCESS_PH as u,ProcessStepsSlots as d}from"../../../../../../format/lib/document/blocks/general/ProcessSteps/meta.js";const S={field:"arrangement",in:["rows-left","rows-right"]},_="drawsLegacySteps",f={not:{context:_,is:!0}},Y={[_]:e=>{const o=e.props??{};return!a(o)&&!p(o.boxes)}},U=e=>e?.data?.root?.props??null,me={fields:y({_gSource:n("Source"),dataSource:w("Item content","Manual"),[x]:N(),_sHeader:m("Header"),_gContent:n("Content"),num:s("Number",u.num),title:s("Heading",u.title),description:R("Body",k.body),boxes:d.boxes,[l]:d[l],_dDesign:m("Design"),arrangement:h("Arrangement",r(P,{}),F.map(e=>({label:e.label,hint:e.hint,value:e.value,picture:A[e.value]})),"columns",{columns:3,cell:L}),imageWidth:i("Image width",r(T,{}),D.map(e=>({label:e.label,value:e.value})),"half"),phoneOrder:g("mobile",i("Order",r(O,{}),G.map(e=>({label:e.label,value:e.value})),"picture")),columns:C("Columns",r(E,{}),2,4,1,3),...I(),cardText:i("Text position",r(b,{}),[{label:"Below picture",value:"below"},{label:"On picture",value:"on-image"}],"below")},[[["cardText"],{not:{field:"boxes",set:!0}}],[["arrangement"],f],[["imageWidth","phoneOrder"],{all:[S,f]}],[["columns"],{not:S}]]),showWhenFacts:Y,resolveFields:(e,o)=>v(c,W(o.fields,e.props.headPlacement,M.ProcessSteps.headRows),e.props,{root:U(o.appState)}),resolveData:(e,o)=>{const t=e.props;return o?.changed?.dataSource!==!0||!a(t)||p(t[l])?e:{...e,props:{...t,[l]:H(B(t,c))}}}};export{me as ProcessStepsFields};
@@ -1,2 +1,2 @@
1
- export declare const assembleGeneralBlocks: () => Record<"Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "Footprint" | "Cards" | "Stats" | "Chart" | "Mockup" | "Countdown" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "DocBody" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Logos" | "DocMasthead" | "DocTabs" | "Prose" | "ParagraphsA" | "TitleWithButtons" | "Banner" | "CategoryBar" | "Masthead" | "Grid" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "StatsParagraph" | "Testimonials" | "Integrations" | "PaymentBadges" | "Heading" | "Text" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ListSearch" | "ButtonBlock" | "CardList" | "HostPart" | "PostCard" | "HeroSlide" | "HeroGroup", 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<"Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "Footprint" | "Cards" | "Stats" | "Chart" | "Mockup" | "Countdown" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "DocBody" | "FAQ" | "ContactLocations" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Logos" | "DocMasthead" | "DocTabs" | "Prose" | "ParagraphsA" | "TitleWithButtons" | "Banner" | "CategoryBar" | "Masthead" | "Grid" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "StatsParagraph" | "Testimonials" | "Integrations" | "PaymentBadges" | "Heading" | "Text" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ListSearch" | "ButtonBlock" | "CardList" | "HostPart" | "PostCard" | "HeroSlide" | "HeroGroup", 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<"Hero" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "Footprint" | "Cards" | "Stats" | "Chart" | "Mockup" | "Countdown" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "DocBody" | "FAQ" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Logos" | "DocMasthead" | "DocTabs" | "Prose" | "ParagraphsA" | "TitleWithButtons" | "Banner" | "CategoryBar" | "Masthead" | "Grid" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "StatsParagraph" | "Testimonials" | "Integrations" | "HeroSingle" | "ContactLocations" | "PaymentBadges" | "Heading" | "Text" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ListSearch" | "ButtonBlock" | "CardList" | "HostPart" | "PostCard" | "HeroSlide" | "HeroGroup", 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<"Hero" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "Footprint" | "Cards" | "Stats" | "Chart" | "Mockup" | "Countdown" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "DocBody" | "FAQ" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Manifesto" | "Split" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Logos" | "DocMasthead" | "DocTabs" | "Prose" | "ParagraphsA" | "TitleWithButtons" | "Banner" | "CategoryBar" | "Masthead" | "Grid" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "StatsParagraph" | "Testimonials" | "Integrations" | "HeroSingle" | "ContactLocations" | "PaymentBadges" | "Heading" | "Text" | "Eyebrow" | "ImageBlock" | "LogoBlock" | "LocationMap" | "Contents" | "ListSearch" | "ButtonBlock" | "CardList" | "HostPart" | "PostCard" | "HeroSlide" | "HeroGroup", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
@@ -1,5 +1,6 @@
1
1
  import { type BoxField } from "efficient-easel/screen/lib/document/box-fields";
2
2
  import { type CustomField } from "../controls.js";
3
+ import type { ShowWhenRule } from "../../../../render/lib/document/show-when.js";
3
4
  import { type ShapeLine } from "../../../../format/lib/content/gallery-card-layout.js";
4
5
  export declare function heroRatioLines(): readonly ShapeLine[];
5
6
  export declare const HERO_TABLET_VH_HINT = "On Tablet, this hero uses the Desktop vh. Set vh in the Desktop view.";
@@ -36,6 +37,24 @@ export declare const HERO_SLIDE_OVERLAY_ROWS: {
36
37
  overlayColor: CustomField<string>;
37
38
  overlayPosition: CustomField<string>;
38
39
  };
40
+ export declare const HERO_LAYOUT_ROWS: {
41
+ mediaLayout: BoxField<string>;
42
+ mediaLayoutPhone: BoxField<string>;
43
+ };
44
+ export declare const heroTintRow: () => BoxField<number>;
45
+ export declare const heroTintColorRow: () => CustomField<string>;
46
+ export declare const HERO_IMAGE_ROWS: {
47
+ mediaImage: CustomField<import("../../../../format/lib/media-value.js").MediaValue>;
48
+ };
49
+ export declare const HERO_IMAGE2_ROWS: {
50
+ tintColor2: CustomField<string>;
51
+ tintOpacity2: BoxField<number>;
52
+ mediaImage2: CustomField<import("../../../../format/lib/media-value.js").MediaValue>;
53
+ };
54
+ export declare const HERO_LAYOUT_KEYS: (keyof typeof HERO_LAYOUT_ROWS)[];
55
+ export declare const HERO_IMAGE2_KEYS: readonly string[];
56
+ export declare const HERO_IMAGE_KEYS: readonly ["mediaImage", string, string, string];
57
+ export declare const heroLayoutRules: (imageOnly: ShowWhenRule) => Record<keyof typeof HERO_LAYOUT_ROWS, ShowWhenRule>;
39
58
  export declare const HERO_VIDEO_ROWS: {
40
59
  videoSource: BoxField<string>;
41
60
  youtubeUrl: CustomField<import("efficient-easel/draw").HidableValue>;
@@ -1 +1 @@
1
- import{jsx as n,jsxs as M,Fragment as Y}from"react/jsx-runtime";import{HeightIcon as K,PlacementIcon as R,PlayIcon as N,UploadIcon as $}from"efficient-easel/icons";import{useEasel as j,useSelectedHost as X}from"efficient-easel/easel";import{SettingsDefaultReset as G,SettingsField as q,SettingsSegmented as z}from"efficient-easel/panel";import{describedAs as J,FLAT_ACCESS as Q,iconOf as Z,onDesktopWords as ee,phoneTwinFields as C,useAccessPatch as te}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as v}from"efficient-easel/screen/lib/document/style-fields";import{colorInput as oe,edgePad as H,plainText as ne,Slider as w,useSelectedSibling as O}from"../controls.js";import{ColourRow as ie,InheritedColourRow as le}from"../ColourControl.js";import{rowSay as re,segmented as A}from"../box-fields.js";import{SHAPE_TABLE as ae}from"../../../../format/lib/content/gallery-card-layout.js";import{ShapePicker as de}from"../shape-picker.js";import{HERO_FIXED_DEFAULT as se,HERO_HEIGHT_PX as x,readHeroFixedHeight as he,SECTION_HEIGHT as u}from"../../../../format/lib/content/section-height.js";import{DEFAULT_TINT as F}from"../../../../format/lib/content/tint.js";import{editorEaselWords as ue,say as a}from"../../../../format/lib/editor-words.js";import{nonEmptyString as E}from"../../../../format/lib/non-empty-string.js";import{findParentNode as ce}from"../../../../format/lib/document/passes/document-position.js";import{DEFAULT_OVERLAY_POSITION as L,OVERLAY_POSITION_OPTIONS as I,slideOverlayState as D}from"../../../../format/lib/sections/hero-overlay.js";import{VIDEO_PLAYBACK_DEFAULT as pe,VIDEO_PLAYBACK_LABELS as fe,VIDEO_PLAYBACKS as ge,VIDEO_SOURCE_DEFAULT as be,VIDEO_SOURCE_LABELS as me,VIDEO_SOURCES as ve}from"../../../../format/lib/hero-video.js";function Oe(){return ae.filter(e=>e.ratio!==null)}const _={desktop:{number:"heightDesktop",fixed:"heightFixed"},tablet:{number:"heightTablet",fixed:"heightFixedTablet"},mobile:{number:"heightMobile",fixed:"heightFixedMobile"}},P={read:e=>e.heightMobile,write:(e,t,o)=>({heightMobile:o}),fieldKey:()=>"heightMobile",ownField:!0,tablet:{read:e=>e.heightTablet,write:(e,t,o)=>({heightTablet:o}),fieldKey:()=>"heightTablet",ownField:!0}};function k(e,{number:t,fixed:o}){const l=t===void 0?void 0:e[t];return he(e[o])??(typeof l=="number"?{unit:"vh",vh:l}:null)}const xe="On Tablet, this hero uses the Desktop vh. Set vh in the Desktop view.";function Ee({view:e,keys:t,props:o}){const l=X(),d=te(Q),{number:s}=t,p={...l?.values??{},...s?{[s]:o.value}:{}},b=k(p,t),i=e==="tablet"?k(p,_.desktop):null,h=b??i??{unit:"vh",vh:u.fallback},c=o.readOnly===!0,T=Oe(),W=r=>{if(r===h.unit)return;if(r!=="vh"){d([[t.fixed,i?.unit===r?i.value:se[r]]]);return}const B=s!==void 0&&typeof p[s]!="number"&&i!==null&&i.unit!=="vh";d([[t.fixed,void 0],...B?[[s,u.fallback]]:[]])},f=b===null&&e!=="desktop",m=s===void 0,S=m&&i!==null&&i.unit!=="vh",y=i===null?`${u.fallback} ${u.unit}`:i.unit==="vh"?`${i.vh} ${u.unit}`:i.unit==="px"?i.value:T.find(r=>r.image===i.value)?.label??i.value;return n(q,{label:a("Height"),icon:Z(n(K,{})),hint:m&&(h.unit==="vh"||S)?a(xe):void 0,action:e==="desktop"?void 0:n(G,{words:ue()?.panel,label:a("Height"),changed:b!==null||!!p[t.fixed],detail:e==="tablet"?ee(re,y):y,disabled:c,onReset:()=>d([...s?[[s,void 0]]:[],[t.fixed,void 0]])}),children:M("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-8)",flex:"1 1 auto",minWidth:0},children:[n(z,{options:[{id:"vh",label:a("vh"),disabled:S},{id:"ratio",label:a("Ratio")},{id:"px",label:a("px")}],value:h.unit,onChange:W,ariaLabel:a("Unit"),disabled:c}),h.unit==="ratio"?n(de,{label:"Height",lines:T,column:"image",value:h.value,disabled:c,onChange:r=>d([[t.fixed,r]])}):h.unit==="px"?w({...x,value:f?null:h.px,...f?{placeholder:h.px}:{},suffix:x.unit,ariaLabel:"Height",disabled:c,onChange:r=>d([[t.fixed,`${r}${x.unit}`]])}):w({min:u.min,max:u.max,step:u.step,value:f?null:h.vh,...f?{placeholder:h.vh}:{},suffix:u.unit,ariaLabel:"Height",disabled:c||m,onChange:r=>o.onChange(r)})]})})}const g=(e,t=_[e])=>({type:"custom",...J({},{type:"number",label:"Height"}),render:o=>n(Ee,{view:e,keys:t,props:o})}),_e={read:e=>e.heightFixedTablet,write:(e,t,o)=>({heightFixedTablet:o}),fieldKey:()=>"heightFixedTablet",ownField:!0};function qe({tabletNumber:e=!0}={}){const t=e?P:{...P,tablet:_e},o=g("tablet",e?void 0:{fixed:_.tablet.fixed}),l=C("heightDesktop",g("desktop"),t,{phoneRow:o}),d=C("heightDesktop",g("desktop"),t,{phoneRow:g("mobile")});return{heightDesktop:l.heightDesktop,...e?{heightTablet:l.heightTablet,heightFixedTablet:v("heightTablet")}:{heightFixedTablet:l.heightFixedTablet},heightMobile:d.heightMobile,heightFixed:v("heightDesktop"),heightFixedMobile:v("heightMobile")}}const ze={overlayColor:oe("Overlay color",F),overlayPosition:H("Overlay position",I,L,"A corner would need a diagonal ramp, which this overlay does not draw.",n(R,{}))},U="Texture",V=e=>H("Overlay position",I,e,"A corner would need a diagonal ramp, which this overlay does not draw.",n(R,{}),void 0,U);function Te(){try{const{appState:e,selectedItem:t}=j(o=>o);return Se(e,t?.props?.id)}catch{return}}function Se(e,t){return E(ce(e,t)?.props?.textureColor)}function ye({value:e,onChange:t}){const[o]=O("overlayPosition"),l=Te(),d=E(e)??"",s=D({overlayColor:d,overlayPosition:o},l);return n(le,{label:a("Overlay color"),value:d,inherited:s.color,resetTo:a(U),onChange:t,onReset:()=>t("")})}const Re=V(L),Ce=V("");function He(e){const[t]=O("overlayColor"),o=D({overlayColor:t,overlayPosition:e.value}).own?Re:Ce;return n(Y,{children:o.render(e)})}function we(e){if(!Array.isArray(e))return;const t=e.flatMap((o,l)=>E(o?.props?.overlayColor)?[l+1]:[]);if(t.length!==0)return t.length===1?a("Slide {n}: own Overlay color.",{n:t[0]}):a("Slides {n}: own Overlay color.",{n:t.join(", ")})}function Ae({value:e,onChange:t}){const[o]=O("slides");return n(ie,{label:a("Texture color"),value:e||F,onChange:t,hint:we(o)})}const Je={type:"custom",render:({value:e,onChange:t})=>n(Ae,{value:e,onChange:t})},Qe={overlayColor:{type:"custom",render:({value:e,onChange:t})=>n(ye,{value:e,onChange:t})},overlayPosition:{type:"custom",render:({value:e,onChange:t})=>n(He,{value:e,onChange:t})}},Ze={videoSource:A("Source",n($,{}),ve.map(e=>({label:me[e],value:e})),be),youtubeUrl:ne("YouTube link","https://youtu.be/…"),videoPlayback:A("Playback",n(N,{}),ge.map(e=>({label:fe[e],value:e})),pe)};export{ze as HERO_OVERLAY_ROWS,Qe as HERO_SLIDE_OVERLAY_ROWS,xe as HERO_TABLET_VH_HINT,Je as HERO_TEXTURE_COLOR_ROW,Ze as HERO_VIDEO_ROWS,qe as heroHeightFields,Oe as heroRatioLines,we as textureColorHint,Se as textureColorOfSlide};
1
+ import{jsx as i,jsxs as $,Fragment as X}from"react/jsx-runtime";import{HeightIcon as q,ImageIcon as z,ImagesIcon as J,OpacityIcon as Q,MediaLayoutSideBySideIcon as Z,MediaLayoutStackedIcon as ee,PlacementIcon as H,PlayIcon as oe,UploadIcon as te}from"efficient-easel/icons";import{viewFocusKeys as w}from"../../../../format/lib/content/picture-focus-rows.js";import{HERO_FOCUS as p,MEDIA_LAYOUT_DEFAULT as ie,MEDIA_LAYOUT_LABELS as ne,MEDIA_LAYOUTS as re,resolvePhoneLayout as le}from"../../../../format/lib/hero-media-layout.js";import{useEasel as ae,useSelectedHost as de}from"efficient-easel/easel";import{SettingsDefaultReset as se,SettingsField as ue,SettingsSegmented as he}from"efficient-easel/panel";import{describedAs as ce,FLAT_ACCESS as pe,iconOf as me,onDesktopWords as fe,phoneTwinFields as E,useAccessPatch as ge}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as _}from"efficient-easel/screen/lib/document/style-fields";import{colorInput as C,edgePad as F,focusKeptField as Oe,plainText as be,Slider as D,upload as Ee,useSelectedSibling as x}from"../controls.js";import{ColourRow as _e,InheritedColourRow as xe}from"../ColourControl.js";import{rowSay as ye,segmented as y,slider as ve}from"../box-fields.js";import{SHAPE_TABLE as Se}from"../../../../format/lib/content/gallery-card-layout.js";import{ShapePicker as Te}from"../shape-picker.js";import{HERO_FIXED_DEFAULT as Re,HERO_HEIGHT_PX as v,readHeroFixedHeight as Le,SECTION_HEIGHT as h}from"../../../../format/lib/content/section-height.js";import{DEFAULT_TINT as S}from"../../../../format/lib/content/tint.js";import{editorEaselWords as Ae,say as a}from"../../../../format/lib/editor-words.js";import{nonEmptyString as T}from"../../../../format/lib/non-empty-string.js";import{findParentNode as Ie}from"../../../../format/lib/document/passes/document-position.js";import{DEFAULT_OVERLAY_POSITION as P,OVERLAY_POSITION_OPTIONS as k,slideOverlayState as U}from"../../../../format/lib/sections/hero-overlay.js";import{VIDEO_PLAYBACK_DEFAULT as He,VIDEO_PLAYBACK_LABELS as we,VIDEO_PLAYBACKS as Ce,VIDEO_SOURCE_DEFAULT as Fe,VIDEO_SOURCE_LABELS as De,VIDEO_SOURCES as Pe}from"../../../../format/lib/hero-video.js";function ke(){return Se.filter(e=>e.ratio!==null)}const R={desktop:{number:"heightDesktop",fixed:"heightFixed"},tablet:{number:"heightTablet",fixed:"heightFixedTablet"},mobile:{number:"heightMobile",fixed:"heightFixedMobile"}},M={read:e=>e.heightMobile,write:(e,o,t)=>({heightMobile:t}),fieldKey:()=>"heightMobile",ownField:!0,tablet:{read:e=>e.heightTablet,write:(e,o,t)=>({heightTablet:t}),fieldKey:()=>"heightTablet",ownField:!0}};function Y(e,{number:o,fixed:t}){const r=o===void 0?void 0:e[o];return Le(e[t])??(typeof r=="number"?{unit:"vh",vh:r}:null)}const Ue="On Tablet, this hero uses the Desktop vh. Set vh in the Desktop view.";function Me({view:e,keys:o,props:t}){const r=de(),d=ge(pe),{number:s}=o,m={...r?.values??{},...s?{[s]:t.value}:{}},O=Y(m,o),n=e==="tablet"?Y(m,R.desktop):null,u=O??n??{unit:"vh",vh:h.fallback},c=t.readOnly===!0,L=ke(),G=l=>{if(l===u.unit)return;if(l!=="vh"){d([[o.fixed,n?.unit===l?n.value:Re[l]]]);return}const N=s!==void 0&&typeof m[s]!="number"&&n!==null&&n.unit!=="vh";d([[o.fixed,void 0],...N?[[s,h.fallback]]:[]])},f=O===null&&e!=="desktop",b=s===void 0,A=b&&n!==null&&n.unit!=="vh",I=n===null?`${h.fallback} ${h.unit}`:n.unit==="vh"?`${n.vh} ${h.unit}`:n.unit==="px"?n.value:L.find(l=>l.image===n.value)?.label??n.value;return i(ue,{label:a("Height"),icon:me(i(q,{})),hint:b&&(u.unit==="vh"||A)?a(Ue):void 0,action:e==="desktop"?void 0:i(se,{words:Ae()?.panel,label:a("Height"),changed:O!==null||!!m[o.fixed],detail:e==="tablet"?fe(ye,I):I,disabled:c,onReset:()=>d([...s?[[s,void 0]]:[],[o.fixed,void 0]])}),children:$("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-8)",flex:"1 1 auto",minWidth:0},children:[i(he,{options:[{id:"vh",label:a("vh"),disabled:A},{id:"ratio",label:a("Ratio")},{id:"px",label:a("px")}],value:u.unit,onChange:G,ariaLabel:a("Unit"),disabled:c}),u.unit==="ratio"?i(Te,{label:"Height",lines:L,column:"image",value:u.value,disabled:c,onChange:l=>d([[o.fixed,l]])}):u.unit==="px"?D({...v,value:f?null:u.px,...f?{placeholder:u.px}:{},suffix:v.unit,ariaLabel:"Height",disabled:c,onChange:l=>d([[o.fixed,`${l}${v.unit}`]])}):D({min:h.min,max:h.max,step:h.step,value:f?null:u.vh,...f?{placeholder:u.vh}:{},suffix:h.unit,ariaLabel:"Height",disabled:c||b,onChange:l=>t.onChange(l)})]})})}const g=(e,o=R[e])=>({type:"custom",...ce({},{type:"number",label:"Height"}),render:t=>i(Me,{view:e,keys:o,props:t})}),Ye={read:e=>e.heightFixedTablet,write:(e,o,t)=>({heightFixedTablet:t}),fieldKey:()=>"heightFixedTablet",ownField:!0};function _o({tabletNumber:e=!0}={}){const o=e?M:{...M,tablet:Ye},t=g("tablet",e?void 0:{fixed:R.tablet.fixed}),r=E("heightDesktop",g("desktop"),o,{phoneRow:t}),d=E("heightDesktop",g("desktop"),o,{phoneRow:g("mobile")});return{heightDesktop:r.heightDesktop,...e?{heightTablet:r.heightTablet,heightFixedTablet:_("heightTablet")}:{heightFixedTablet:r.heightFixedTablet},heightMobile:d.heightMobile,heightFixed:_("heightDesktop"),heightFixedMobile:_("heightMobile")}}const xo={overlayColor:C("Overlay color",S),overlayPosition:F("Overlay position",k,P,"A corner would need a diagonal ramp, which this overlay does not draw.",i(H,{}))},W="Texture",B=e=>F("Overlay position",k,e,"A corner would need a diagonal ramp, which this overlay does not draw.",i(H,{}),void 0,W);function We(){try{const{appState:e,selectedItem:o}=ae(t=>t);return Be(e,o?.props?.id)}catch{return}}function Be(e,o){return T(Ie(e,o)?.props?.textureColor)}function Ve({value:e,onChange:o}){const[t]=x("overlayPosition"),r=We(),d=T(e)??"",s=U({overlayColor:d,overlayPosition:t},r);return i(xe,{label:a("Overlay color"),value:d,inherited:s.color,resetTo:a(W),onChange:o,onReset:()=>o("")})}const Ke=B(P),je=B("");function Ge(e){const[o]=x("overlayColor"),t=U({overlayColor:o,overlayPosition:e.value}).own?Ke:je;return i(X,{children:t.render(e)})}function Ne(e){if(!Array.isArray(e))return;const o=e.flatMap((t,r)=>T(t?.props?.overlayColor)?[r+1]:[]);if(o.length!==0)return o.length===1?a("Slide {n}: own Overlay color.",{n:o[0]}):a("Slides {n}: own Overlay color.",{n:o.join(", ")})}function $e({value:e,onChange:o}){const[t]=x("slides");return i(_e,{label:a("Texture color"),value:e||S,onChange:o,hint:Ne(t)})}const yo={type:"custom",render:({value:e,onChange:o})=>i($e,{value:e,onChange:o})},vo={overlayColor:{type:"custom",render:({value:e,onChange:o})=>i(Ve,{value:e,onChange:o})},overlayPosition:{type:"custom",render:({value:e,onChange:o})=>i(Ge,{value:e,onChange:o})}},Xe={one:i(z,{}),side:i(Z,{}),stacked:i(ee,{})},V=e=>y("Layout",i(J,{}),re.map(o=>({label:ne[o],value:o,picture:Xe[o]})),ie,e?{phoneRest:o=>le(void 0,o)}:void 0),qe={mediaLayout:V(),mediaLayoutPhone:E("mediaLayout",V(!0)).mediaLayoutPhone},ze=()=>ve("Tint",i(Q,{}),0,100,5,0,"%"),K=e=>Object.fromEntries(w(e).map(o=>[o,Oe()])),j=e=>Ee("Background image","image/*","Upload a background image",{focus:e}),Je=()=>C("Tint color",S),So={mediaImage:j(p.image),...K(p.image)},Qe={mediaImage2:j(p.image2),...K(p.image2),tintColor2:Je(),tintOpacity2:ze()},To=Object.keys(qe),Ro=Object.keys(Qe),Lo=["mediaImage",...w(p.image)],Ao=e=>({mediaLayout:{all:[e,{not:{context:"device",is:"mobile"}}]},mediaLayoutPhone:{all:[e,{context:"device",is:"mobile"}]}}),Io={videoSource:y("Source",i(te,{}),Pe.map(e=>({label:De[e],value:e})),Fe),youtubeUrl:be("YouTube link","https://youtu.be/…"),videoPlayback:y("Playback",i(oe,{}),Ce.map(e=>({label:we[e],value:e})),He)};export{Ro as HERO_IMAGE2_KEYS,Qe as HERO_IMAGE2_ROWS,Lo as HERO_IMAGE_KEYS,So as HERO_IMAGE_ROWS,To as HERO_LAYOUT_KEYS,qe as HERO_LAYOUT_ROWS,xo as HERO_OVERLAY_ROWS,vo as HERO_SLIDE_OVERLAY_ROWS,Ue as HERO_TABLET_VH_HINT,yo as HERO_TEXTURE_COLOR_ROW,Io as HERO_VIDEO_ROWS,_o as heroHeightFields,Ao as heroLayoutRules,ke as heroRatioLines,Je as heroTintColorRow,ze as heroTintRow,Ne as textureColorHint,Be as textureColorOfSlide};
@@ -1,3 +1,4 @@
1
+ import { type HeroMediaType } from "../../../format/lib/hero-media-layout.js";
1
2
  import { type ReactElement, type ReactNode } from "react";
2
3
  import { type FieldsPatch } from "efficient-easel/easel";
3
4
  import { type WordValues } from "../../../format/lib/editor-words.js";
@@ -331,7 +332,7 @@ export declare function sourceField<V, E extends object = Record<never, never>>(
331
332
  } & E) => ReactElement, extra?: E): CustomField<V>;
332
333
  export declare const MEDIA_TYPE_OPTIONS: {
333
334
  label: string;
334
- value: "image" | "video";
335
+ value: HeroMediaType;
335
336
  }[];
336
337
  export declare function loadingShowsField(label: string, icon: ReactElement, pictures: Readonly<Record<LoadingShows, ReactElement>>): CustomField<LoadingShows>;
337
338
  export declare function loadingRowHint(values: Readonly<Record<string, unknown>>, frames: Readonly<Record<string, KnownVideoFrame>> | undefined, hasUnsavedEdits: boolean): string | undefined;
@@ -340,6 +341,13 @@ export declare function upload(label: string, accept: string, placeholder?: stri
340
341
  focusWhen?: (props: Record<string, unknown>, view: "desktop" | "tablet" | "mobile") => boolean;
341
342
  frame?: string;
342
343
  }): CustomField<MediaValue>;
344
+ export declare function mediaFieldPaths(fields: Readonly<Record<string, unknown>> | undefined): string[];
345
+ export type MediaFieldRow = {
346
+ path: string;
347
+ field: Readonly<Record<string, unknown>>;
348
+ along: readonly Readonly<Record<string, unknown>>[];
349
+ };
350
+ export declare function mediaFields(fields: Readonly<Record<string, unknown>> | undefined, prefix?: string, along?: readonly Readonly<Record<string, unknown>>[]): MediaFieldRow[];
343
351
  export declare const CUSTOM_FIELD_MEDIA: Record<string, string[]>;
344
352
  export declare function coordsResultTip(v: GeocodeState): string;
345
353
  export declare function CoordsField({ value, onChange, label, }: {