efficient-web-builder 56.0.0 → 57.1.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 (68) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/editor/components/HeroPartPanel.js +1 -1
  3. package/dist/editor/components/SectionEditor.js +1 -1
  4. package/dist/editor/components/SiteFields.d.ts +2 -1
  5. package/dist/editor/components/SiteFields.js +1 -1
  6. package/dist/editor/components/storefront-editor.css +5 -5
  7. package/dist/editor/components/useHostDocumentBridge.js +1 -1
  8. package/dist/editor/components/useSectionToBoxPass.js +1 -1
  9. package/dist/editor/lib/animation/entrance-fields.d.ts +0 -3
  10. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  11. package/dist/editor/lib/animation/fields.js +1 -1
  12. package/dist/editor/lib/animation/hover-fields.js +1 -1
  13. package/dist/editor/lib/animation/loop-fields.d.ts +2 -0
  14. package/dist/editor/lib/animation/loop-fields.js +1 -1
  15. package/dist/editor/lib/document/controls.d.ts +2 -1
  16. package/dist/editor/lib/document/controls.js +1 -1
  17. package/dist/editor/lib/document/field-groups.js +1 -1
  18. package/dist/editor/lib/document/overrides.js +1 -1
  19. package/dist/editor/lib/document/panel-drop-empty-headings.js +1 -1
  20. package/dist/editor/lib/editor-document-adapter.js +1 -1
  21. package/dist/editor/lib/host-document-bridge.d.ts +2 -1
  22. package/dist/editor/lib/host-document-bridge.js +1 -1
  23. package/dist/editor/lib/keyed-store.d.ts +7 -0
  24. package/dist/editor/lib/keyed-store.js +1 -0
  25. package/dist/editor/lib/page-live-state.js +1 -1
  26. package/dist/editor/lib/page-video-frames.d.ts +11 -0
  27. package/dist/editor/lib/page-video-frames.js +1 -0
  28. package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
  29. package/dist/editor/lib/pinned-chrome-doc.js +1 -1
  30. package/dist/editor/lib/sections/new-section-node.js +1 -1
  31. package/dist/editor/lib/sections/text-layouts.js +1 -1
  32. package/dist/format/lib/animation/hover.d.ts +2 -3
  33. package/dist/format/lib/animation/hover.js +1 -1
  34. package/dist/format/lib/animation/loop.js +1 -1
  35. package/dist/format/lib/document/passes/settings-groups.js +1 -1
  36. package/dist/format/lib/document/section-catalog.d.ts +1 -1
  37. package/dist/format/lib/document/section-catalog.js +14 -2
  38. package/dist/format/lib/editor-words-catalogue.d.ts +7 -2
  39. package/dist/format/lib/editor-words-catalogue.js +4 -4
  40. package/dist/format/lib/editor-words-kept.js +1 -1
  41. package/dist/format/lib/hero-video.d.ts +10 -0
  42. package/dist/format/lib/hero-video.js +1 -1
  43. package/dist/format/lib/sections/active-press-context.d.ts +4 -0
  44. package/dist/format/lib/sections/active-press-context.js +1 -0
  45. package/dist/format/lib/sections/section-head-placement.js +1 -1
  46. package/dist/format/lib/sections/section-presets.d.ts +5 -1
  47. package/dist/format/lib/sections/section-presets.js +1 -1
  48. package/dist/format/lib/theme.d.ts +2 -1
  49. package/dist/format/lib/theme.js +2 -2
  50. package/dist/format/lib/web-backend.d.ts +9 -0
  51. package/dist/render/components/{BoxCellWidthContext.d.ts → BoxCellContext.d.ts} +0 -1
  52. package/dist/render/components/BoxCellContext.js +1 -0
  53. package/dist/render/components/Flex.js +1 -1
  54. package/dist/render/components/ImageBlock.js +1 -1
  55. package/dist/render/components/LogoBlock.js +1 -1
  56. package/dist/render/components/Placeholder.js +1 -1
  57. package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
  58. package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
  59. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +0 -1
  60. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  61. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
  62. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
  63. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  64. package/dist/render/lib/document/passes/block-size.js +1 -1
  65. package/dist/render/lib/document/sanitize.d.ts +1 -0
  66. package/dist/render/lib/document/sanitize.js +1 -1
  67. package/package.json +5 -5
  68. package/dist/render/components/BoxCellWidthContext.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # Changelog
2
2
 
3
+ ## 57.1.0 - 2026-11-07
4
+
5
+ From main at `316e1bb7`: #596, #599. A minor: no `!` in either title, no declared export is removed, the peers stay `efficient-easel` `^29.0.0` and `efficient-shell` `^12.16.0`. No stored key or value moves.
6
+
7
+ **For hosts:**
8
+ - efficient-storefront-blocks: a later blocks bump takes `^57.1.0`; its guard `test-panel-no-empty-headings` passes on 57.1.0 and is red on 57.0.0 (#599).
9
+ - A host that stores a Tyre Fitment Form node draws it as before. The type key stays registered; the Fitment Form's answer part draws one verdict per size on a tyre product page (blocks 0.87.0 or later) (#596).
10
+
11
+ ### Changed
12
+
13
+ - **The Tyre Fitment Form leaves the Add menu** (#596): the Fitment Form takes its job. `TyreFitment` moves to the retired list with its reason and stays in `UNLISTED_BLOCK_SETS` as `commerce`, so a stored node still draws. "Tyre Fitment Form" stays in the kept editor phrases until the next major. No visible change other than the Add-menu row going away.
14
+
15
+ ### Fixed
16
+
17
+ - **A band whose rows are all hidden no longer keeps its heading because of the Animation tab's Customize marker** (#599): the Booking and Submit boxes drew an empty Animation tab.
18
+
19
+ ## 57.0.0 - 2026-11-07
20
+
21
+ From main at `4fe1b314`: #585, #587, #584, #588, #591, #590, #594, #595. A major: #584, #594 and #595 have `!` in their titles, the peers narrow, and three exports are removed. The peers move to `efficient-easel` `^29.0.0` (was `^28.4.0`) and `efficient-shell` `^12.16.0` (was `^12.13.0`) (#594). No stored key or value moves.
22
+
23
+ **For hosts:**
24
+ - Install efficient-easel 29.0.0 or later and efficient-shell 12.16.0 or later with this release (both are on npm) (#594).
25
+ - `HOVER_KINDS` is deleted from `efficient-web-builder/format/lib/animation/hover`. Import `HOVER_KINDS`, `hoverKindsOf` and `HoverKind` from `efficient-shell/format` (12.16.0); `HoverKind` is still re-exported here as a type (#594).
26
+ - `ENTRANCE_PICTURE` is deleted from `efficient-web-builder/editor/lib/animation/entrance-fields`. Draw the shell's `Entrance*Icon` glyphs from `efficient-easel/icons` (#594).
27
+ - `components/BoxCellWidthContext` is deleted. Import `BoxCellContext` (the cell's `{ hasWidth, bound? }`), `useBoxCellHasWidth`, `useCellPictureSizes`, `useSizesWithinCell`, `NoCellBound` and the `BoxCellValue` / `ViewBound` types from `efficient-web-builder/<side>/components/BoxCellContext`. Same names, same behaviour; only the module path changes (#595).
28
+ - `lineBorder` is deleted (from `render/lib/document/blocks/general/section-to-box-row-parts`). A host that imports it deletes the call and stores no border colour: a button reads the Box's theme (#584).
29
+ - A host that draws a stored Bundle Products node (type key `BundleOffer`) draws it as a Product Grid bound to the current product, with Show set to "Bundles with this product" (the host's `bundleToGrid`), and deletes its own `DynamicBundleOffer`. Nothing stored changes (#585).
30
+ - No host imports any of the four removed names today (storefront, storefront-blocks and admin-portal searched: 0).
31
+
32
+ ### Removed (BREAKING)
33
+
34
+ - **`HOVER_KINDS` and `ENTRANCE_PICTURE`** (#594).
35
+ - **`components/BoxCellWidthContext`** (#595), deprecated in 55.x.
36
+ - **`lineBorder`** (#584). It wrote the site's line colour as a hex into a button's Border; no part stores a colour now.
37
+
38
+ ### Changed
39
+
40
+ - **BREAKING: peers `efficient-easel` `^29.0.0` and `efficient-shell` `^12.16.0`** (#594). Peer and dev.
41
+ - **The Animation tab has kind tabs, effect tiles and a Customize fold on the tab** (#594). `LOOP_OPTIONS` keeps its values; the label of `"scroll"` is now `Marquee`.
42
+ - **Every press converts with the site's theme** (#584): optional arguments on `SectionPreset`, `applyPageEdits` and `darkPresetIndex`; new `darkBandIndex`, a `PressContext` type and an `active-press-context` module.
43
+ - **Bundle Products leaves the Add menu** (#585): a Product Grid bound to the current product, with Show set to "Bundles with this product", is the one bundle section (the same retirement as Related Products). The Product page set shows 8 sections instead of 9. A stored node draws through the host. The phrase "Bundle Products" stays in the words catalogue, marked deprecated for the next major.
44
+
45
+ ### Added
46
+
47
+ - **A hero slide says what the backend did with the video's first frame** (#588): the "Show while loading" row names each state, and the editor canvas draws the backend's ready frame as the slide's still, so the editor shows the same frame as the shop.
48
+ - **The one sanitizer also returns a fragment** (#591): `sanitizeHtmlFragment(html)` returns a parsed `DocumentFragment` with the same DOMPurify config and the same `target=_blank` link hook as `sanitizeHtml`, which is unchanged.
49
+
50
+ ### Fixed
51
+
52
+ - **Article Body takes the Design and Animation tabs** (#590): `GROUPED_SECTIONS` names `ArticleBody`; a new guard fails when a catalogue section is not in it.
53
+ - **A note told hosts the wrong date** (#587): the `BoxCellWidthContext` deprecation said 57.0.0 (the component is now removed by #595).
54
+
3
55
  ## 56.0.0 - 2026-11-07
4
56
 
5
57
  From main at `1ccd6199`: #565, #578, #580, #581, #574, #522, #583, #582 (and #579, a CI change with no effect on the package). A major: #582 has `!` in its title and deletes exports. The peer `efficient-easel` is raised to `^28.4.0` (was `^28.2.0`); `efficient-shell` stays `^12.13.0`. No stored key or value moves.
@@ -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 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
+ "use client";import{jsx as o,jsxs as c}from"react/jsx-runtime";import{InspectorUpLevel as i}from"efficient-easel/chrome";import{usePreviewHeroPart as f}from"../../render/components/PreviewHeroPartContext.js";import{SiteFields as p}from"./SiteFields.js";import{usePartMotion as u}from"./usePartMotion.js";import{say as r}from"../../format/lib/editor-words.js";import{HERO_MEDIA_PART_LABELS as m,heroPartId as d}from"../../render/lib/document/hero-media-parts.js";function P({nodeId:t,part:e,sectionName:n,onUpToSection:s}){const{select:a}=f(),l=u(t,e,"picture");return c("div",{children:[e!=="media"?o(i,{inline:!0,name:r(m.media),onSelect:()=>a(d(t,"media"))}):o(i,{inline:!0,name:r(n),onSelect:s}),o(p,{part:e,motion:l,itemWord:r(m[e])})]})}export{P as default};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as m,Fragment as K}from"react/jsx-runtime";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 z}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 j}from"efficient-easel/chrome";import{DuplicateIcon as Ie,TrashIcon as Le}from"efficient-easel/icons";import{panelFieldsOf as ye}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as G}from"../../render/components/PreviewTickerContext.js";import Te from"./SectionIcon.js";import{PanelHideButton as Y}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as Oe}from"efficient-easel/screen/lib/session-context";import{say as n}from"../../format/lib/editor-words.js";import Ne,{SITE_STYLES_BASICS_TAB as _e}from"./WebsiteSettingsPanel.js";import He from"./ChatSettingsPanel.js";import Re from"./SocialLinksPanel.js";import Ae from"./TickerSettingsPanel.js";import De,{PartSourceNote as Ce}from"./PartSettingsPanel.js";import{regionsForSection as Be}from"../../format/lib/sections/section-text-regions.js";import{TEXT_KIND_LABELS as Fe}from"../../format/lib/sections/section-text-kinds.js";import{textRegionOfPartKey as xe}from"../../format/lib/sections/text-regions.js";import Me from"./DuplicateToPageMenu.js";import{usePageRows as Ke}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 je}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as Ge,isSelectionMode as I}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as Ye}from"efficient-easel/draw/client";import{entryPartsOf as Ue,SectionTextEntries as Xe}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ze}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as $e,ROOT_ZONE as U}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 Je from"./SwitchToBoxFooter.js";import{SiteFields as X}from"./SiteFields.js";import Qe from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as Ve,HERO_PART_MODE as et,heroPartLabel as tt}from"../../render/lib/document/hero-media-parts.js";import{HintsToggle as nt,SettingsSwitch as ot,hintsFoldClass as rt}from"efficient-easel/panel";import{useHints as it}from"efficient-easel/screen/lib/hints";import{foldTopTier as st}from"../lib/document/field-groups.js";import{FoldHeadingScope as at}from"../lib/document/panel-heading-scope.js";import{partRowField as lt}from"../lib/document/part-row-field.js";import{decodePartKey as ct,partRowHeadLabel as dt}from"../../render/lib/document/part-rows.js";import{encodePartId as pt,partHeadLabel as mt,partLabel as ft,sectionTextParts as ut}from"../../render/lib/document/text-parts.js";import{partSourceOf as ht,sourceMenuIdOf as St,sourceSlugOf as bt}from"../../format/lib/document/source-bound-parts.js";const wn=Ge,gn={kind:"header"},En={kind:"website"},kn={kind:"website",tab:_e,revealPageGroup:!0},Pn={kind:"chat"},vn={kind:"social"},w="Part";function wt(e){return n("Part of {name}",{name:n(e)})}function gt(e,r,i){const s=e.describeNode(r);return{name:i,kindLabel:s?wt(s.label):n(w)}}function Et(e){switch(e){case"Header":return{title:n("Header settings belong to a website."),own:n("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:n("Appearance settings belong to a website."),own:n("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:n("Live chat settings belong to a website."),own:n("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:n("Social link settings belong to a website."),own:n("Each website created from this template sets its own social link afterwards.")};default:return{title:n("{what} settings belong to a website.",{what:e}),own:n("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function Z({what:e}){const r=Et(e);return m("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:r.title})}),m("p",{children:[n("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",r.own]})]})}function y(e){const r=et[e];return{name:Ve[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:n(tt(e,d.props)),tier:"part",of:n(d.label)},{partOf:({name:p})=>n("Part of {name}",{name:p})});return{name:S.name,kindLabel:S.kind}},render:(i,s)=>i.kind===r?o(Qe,{nodeId:i.nodeId,part:e,sectionName:s.describeNode(i.nodeId)?.label??"Hero",onUpToSection:()=>s.onSelectNode(i.nodeId)}):null}}const kt={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,r)=>{const i=r.hostPanels?.header;return i?o(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)=>o(Ne,{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:()=>o(He,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>o(Re,{unavailable:o(Z,{what:"Social link"})})},ticker:{name:G,kindLabel:w,icon:"ticker",head:(e,r)=>e.kind==="ticker"?gt(r,e.heroId,n(G)):null,render:e=>o(Ae,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:y("media"),heroImage:y("image"),heroImage2:y("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}=ct(e.propKey),S=d?lt(i.fields[s],d):i.fields[s],p=Be(i.type),f=p?xe(p,e.propKey):null,u=p&&f?p[f].label:Fe[e.propKey],g=u?n(u):dt(n(mt(ft(S??{},s))),d),E=W({name:g,tier:"part",of:n(i.label)},{partOf:({name:k})=>n("Part of {name}",{name:k})});return{name:E.name,kindLabel:E.kind}},render:(e,r)=>e.kind==="part"?o(De,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>r.onSelectNode(e.nodeId),onEditStyle:r.onOpenSiteStyles}):null}},Pt=new Set(["header","website","chat"]);function vt(e,r){if(e==="selection")return null;const i=kt[e];return Pt.has(e)&&!r.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>o(Z,{what:i.name})}:i}function It({mode:e,onOpenWebsiteSettings:r,onOpenSiteStyles:i,onOpenPageStyles:s,onSelectNode:d,hideNodeActions:S=!1,onNotify:p,onHidePanel:f}){const{capabilities:u,tokenRef:g,notifyParent:E,currentSlug:k,siteId:T,runAuthed:$,readOnly:q,navigate:Lt}=ze(),{rows:J}=Ke(),O=J?.find(l=>l.slug===k)??null,Q=ge(),N=Object.keys(Q.fields).some(l=>!l.startsWith("_")&&!z.includes(l)),{websiteName:V}=We(),P=je({readOnly:q}),{select:ee}=Ye(),{selectedItem:t,getItemById:te,getSelectorForId:ne,config:h,appState:oe}=we(l=>l),re=ye(h,t?{type:t.type,props:t.props}:null),_=t?ut(re??h.components[t.type]?.fields,t.props):[],ie=l=>h.components[l]?.label??l,a=t?ne(t.props.id):void 0,c=vt(e.kind,u),se=Oe(),H={capabilities:u,tokenRef:g,hostPanels:se.chrome?.panels,describeNode:l=>{const b=te(l);if(!b)return null;const M=h.components[b.type];return{type:b.type,label:M?.label??b.type,fields:M?.fields??{},props:b.props??{}}},siteId:T,websiteName:V??null,notifyParent:E,onNotify:p,onOpenWebsiteSettings:r,onOpenSiteStyles:i,onSelectNode:d},R=c?.head?.(e,H)??null,A=Pe({kind:O?.kind,pageName:O?.label}),ae=R?.name??(c?n(c.name):t?n(ie(t.type)):A.name),le=R?.kindLabel??(c?n(c.kindLabel):t?a&&a.zone!==U?n("Block"):n("Section"):A.kindLabel),ce=c?c.icon:t?t.type:"page",D=c?null:t?h.components[t.type]?.fields??null:h.root?.fields??null,de=D?st(D):2,C=I(e)&&t?ht(t.type):null,pe=!!t&&!!a&&a.zone===U&&t.type!==L&&t.type!==$e,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?h.components[t.type]?.defaultProps?.previewHover:void 0,B=I(e)&&!!t&&!!a&&ue!==void 0,F=B&&t.props.previewHover===!0,he=()=>{!t||!a||P.replaceComponent(a.zone,a.index,{...t,props:{...t.props,previewHover:!F}})},{shown:x,setShown:Se}=it(),be=!!(c||t||N);return m("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right ${rt(x)}`.trim(),children:[o(ve,{icon:o(Te,{type:ce,size:15}),name:ae,kind:le,actions:!S&&I(e)&&t&&t.type!==L?m(K,{children:[o(j,{label:n("Duplicate section"),title:v??void 0,disabled:v!==null,onClick:me,children:o(Ie,{size:15})}),pe&&u.hasSiteSettings&&o(Me,{node:t,currentSlug:k,siteId:T??void 0,tokenRef:g,runAuthed:$,onNotify:p}),o(j,{label:n("Remove section"),danger:!0,onClick:fe,children:o(Le,{size:15})}),f?o(Y,{side:"right",onHide:f,divider:!0}):null]}):f?o(Y,{side:"right",onHide:f}):void 0}),B&&m("div",{className:"sf-preview-pin",children:[m("div",{className:"sf-preview-pin-text",children:[o("span",{className:"sf-preview-pin-label",children:n("Preview hover state")}),o("span",{className:"sf-preview-pin-hint",children:n("not shown live")})]}),o(ot,{checked:F,onChange:he,ariaLabel:n("Preview hover state")})]}),o(at,{tier:de,children:m("div",{className:"sf-insp-body es-insp-body sf-scroll",children:[c?c.render(e,H):t?m(K,{children:[t.type===L&&u.hasSiteSettings&&o(Je,{}),o(Ze,{children:o(X,{entries:o(Xe,{parts:_,heading:!1,onOpen:l=>ee(pt(t.props.id,l))}),entryCount:Ue(_).length})}),C&&o(Ce,{source:C,slug:bt(t?.props),menuId:St(t?.props)})]}):N?o(X,{omit:z}):o(ke,{variant:"none",icon:!1,message:n("Select a section or block to edit it."),children:s&&o(Ee,{variant:"secondary",onClick:s,children:n("This page")})}),be&&o(nt,{shown:x,onChange:Se,label:n("Show hints")})]})})]})}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,It as default,vt as resolvePanel};
1
+ "use client";import{jsx as o,jsxs as m,Fragment as W}from"react/jsx-runtime";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 z}from"../lib/document/page-root-fields.js";import{rootPanelHead as Pe}from"../../format/lib/document/root-panel.js";import{headWords as j,InspectorHead as ve,InspectorIconButton as G}from"efficient-easel/chrome";import{DuplicateIcon as Ie,TrashIcon as Le}from"efficient-easel/icons";import{panelFieldsOf as ye}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as Y}from"../../render/components/PreviewTickerContext.js";import Te from"./SectionIcon.js";import{PanelHideButton as U}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as Oe}from"efficient-easel/screen/lib/session-context";import{say as n}from"../../format/lib/editor-words.js";import Ne,{SITE_STYLES_BASICS_TAB as _e}from"./WebsiteSettingsPanel.js";import He from"./ChatSettingsPanel.js";import Re from"./SocialLinksPanel.js";import Ae from"./TickerSettingsPanel.js";import De,{PartSourceNote as Ce}from"./PartSettingsPanel.js";import{regionsForSection as Be}from"../../format/lib/sections/section-text-regions.js";import{TEXT_KIND_LABELS as Fe}from"../../format/lib/sections/section-text-kinds.js";import{textRegionOfPartKey as xe}from"../../format/lib/sections/text-regions.js";import Me from"./DuplicateToPageMenu.js";import{usePageRows as Ke}from"../lib/page-rows.js";import{useScreenDocument as We}from"efficient-easel/screen/components/ScreenDocumentContext";import{usePreviewHeader as ze}from"../../render/components/PreviewHeaderContext.js";import{useSectionOps as je}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as Ge,isSelectionMode as I}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as Ye}from"efficient-easel/draw/client";import{entryPartsOf as Ue,SectionTextEntries as Xe}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as Ze}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as $e,ROOT_ZONE as X}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 Je from"./SwitchToBoxFooter.js";import{SiteFields as Z}from"./SiteFields.js";import Qe from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as Ve,HERO_PART_MODE as et,heroPartLabel as tt}from"../../render/lib/document/hero-media-parts.js";import{HintsToggle as nt,SettingsSwitch as ot,hintsFoldClass as rt}from"efficient-easel/panel";import{useHints as it}from"efficient-easel/screen/lib/hints";import{foldTopTier as st}from"../lib/document/field-groups.js";import{FoldHeadingScope as at}from"../lib/document/panel-heading-scope.js";import{partRowField as lt}from"../lib/document/part-row-field.js";import{decodePartKey as ct,partRowHeadLabel as dt}from"../../render/lib/document/part-rows.js";import{encodePartId as pt,partHeadLabel as mt,partLabel as ft,sectionTextParts as ut}from"../../render/lib/document/text-parts.js";import{partSourceOf as ht,sourceMenuIdOf as St,sourceSlugOf as bt}from"../../format/lib/document/source-bound-parts.js";const wn=Ge,gn={kind:"header"},En={kind:"website"},kn={kind:"website",tab:_e,revealPageGroup:!0},Pn={kind:"chat"},vn={kind:"social"},w="Part";function wt(e){return n("Part of {name}",{name:n(e)})}function gt(e,r,i){const s=e.describeNode(r);return{name:i,kindLabel:s?wt(s.label):n(w)}}function Et(e){switch(e){case"Header":return{title:n("Header settings belong to a website."),own:n("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:n("Appearance settings belong to a website."),own:n("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:n("Live chat settings belong to a website."),own:n("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:n("Social link settings belong to a website."),own:n("Each website created from this template sets its own social link afterwards.")};default:return{title:n("{what} settings belong to a website.",{what:e}),own:n("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function $({what:e}){const r=Et(e);return m("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:r.title})}),m("p",{children:[n("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",r.own]})]})}function y(e){const r=et[e];return{name:Ve[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=j({name:n(tt(e,d.props)),tier:"part",of:n(d.label)},{partOf:({name:p})=>n("Part of {name}",{name:p})});return{name:S.name,kindLabel:S.kind}},render:(i,s)=>i.kind===r?o(Qe,{nodeId:i.nodeId,part:e,sectionName:s.describeNode(i.nodeId)?.label??"Hero",onUpToSection:()=>s.onSelectNode(i.nodeId)}):null}}const kt={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,r)=>{const i=r.hostPanels?.header;return i?o(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)=>o(Ne,{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:()=>o(He,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>o(Re,{unavailable:o($,{what:"Social link"})})},ticker:{name:Y,kindLabel:w,icon:"ticker",head:(e,r)=>e.kind==="ticker"?gt(r,e.heroId,n(Y)):null,render:e=>o(Ae,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:y("media"),heroImage:y("image"),heroImage2:y("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}=ct(e.propKey),S=d?lt(i.fields[s],d):i.fields[s],p=Be(i.type),f=p?xe(p,e.propKey):null,u=p&&f?p[f].label:Fe[e.propKey],g=u?n(u):dt(n(mt(ft(S??{},s))),d),E=j({name:g,tier:"part",of:n(i.label)},{partOf:({name:k})=>n("Part of {name}",{name:k})});return{name:E.name,kindLabel:E.kind}},render:(e,r)=>e.kind==="part"?o(De,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>r.onSelectNode(e.nodeId),onEditStyle:r.onOpenSiteStyles}):null}},Pt=new Set(["header","website","chat"]);function vt(e,r){if(e==="selection")return null;const i=kt[e];return Pt.has(e)&&!r.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>o($,{what:i.name})}:i}function It({mode:e,onOpenWebsiteSettings:r,onOpenSiteStyles:i,onOpenPageStyles:s,onSelectNode:d,hideNodeActions:S=!1,onNotify:p,onHidePanel:f}){const{capabilities:u,tokenRef:g,notifyParent:E,currentSlug:k,siteId:T,runAuthed:q,readOnly:J,navigate:Lt}=We(),{rows:Q}=Ke(),O=Q?.find(l=>l.slug===k)??null,V=ge(),N=Object.keys(V.fields).some(l=>!l.startsWith("_")&&!z.includes(l)),{websiteName:ee}=ze(),P=je({readOnly:J}),{select:te}=Ye(),{selectedItem:t,getItemById:ne,getSelectorForId:oe,config:h,appState:re}=we(l=>l),ie=ye(h,t?{type:t.type,props:t.props}:null),_=t?ut(ie??h.components[t.type]?.fields,t.props):[],se=l=>h.components[l]?.label??l,a=t?oe(t.props.id):void 0,c=vt(e.kind,u),ae=Oe(),H={capabilities:u,tokenRef:g,hostPanels:ae.chrome?.panels,describeNode:l=>{const b=ne(l);if(!b)return null;const K=h.components[b.type];return{type:b.type,label:K?.label??b.type,fields:K?.fields??{},props:b.props??{}}},siteId:T,websiteName:ee??null,notifyParent:E,onNotify:p,onOpenWebsiteSettings:r,onOpenSiteStyles:i,onSelectNode:d},R=c?.head?.(e,H)??null,A=Pe({kind:O?.kind,pageName:O?.label}),D=R?.name??(c?n(c.name):t?n(se(t.type)):A.name),le=R?.kindLabel??(c?n(c.kindLabel):t?a&&a.zone!==X?n("Block"):n("Section"):A.kindLabel),ce=c?c.icon:t?t.type:"page",C=c?null:t?h.components[t.type]?.fields??null:h.root?.fields??null,de=C?st(C):2,B=I(e)&&t?ht(t.type):null,pe=!!t&&!!a&&a.zone===X&&t.type!==L&&t.type!==$e,v=qe(re?.data,t),me=()=>{v||a&&P.duplicateComponent(a.zone,a.index)},fe=()=>{a&&(P.removeComponent(a.zone,a.index),P.select(null))},ue=t?h.components[t.type]?.defaultProps?.previewHover:void 0,F=I(e)&&!!t&&!!a&&ue!==void 0,x=F&&t.props.previewHover===!0,he=()=>{!t||!a||P.replaceComponent(a.zone,a.index,{...t,props:{...t.props,previewHover:!x}})},{shown:M,setShown:Se}=it(),be=!!(c||t||N);return m("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right ${rt(M)}`.trim(),children:[o(ve,{icon:o(Te,{type:ce,size:15}),name:D,kind:le,actions:!S&&I(e)&&t&&t.type!==L?m(W,{children:[o(G,{label:n("Duplicate section"),title:v??void 0,disabled:v!==null,onClick:me,children:o(Ie,{size:15})}),pe&&u.hasSiteSettings&&o(Me,{node:t,currentSlug:k,siteId:T??void 0,tokenRef:g,runAuthed:q,onNotify:p}),o(G,{label:n("Remove section"),danger:!0,onClick:fe,children:o(Le,{size:15})}),f?o(U,{side:"right",onHide:f,divider:!0}):null]}):f?o(U,{side:"right",onHide:f}):void 0}),F&&m("div",{className:"sf-preview-pin",children:[m("div",{className:"sf-preview-pin-text",children:[o("span",{className:"sf-preview-pin-label",children:n("Preview hover state")}),o("span",{className:"sf-preview-pin-hint",children:n("not shown live")})]}),o(ot,{checked:x,onChange:he,ariaLabel:n("Preview hover state")})]}),o(at,{tier:de,children:m("div",{className:"sf-insp-body es-insp-body sf-scroll",children:[c?c.render(e,H):t?m(W,{children:[t.type===L&&u.hasSiteSettings&&o(Je,{}),o(Ze,{children:o(Z,{entries:o(Xe,{parts:_,heading:!1,onOpen:l=>te(pt(t.props.id,l))}),entryCount:Ue(_).length,itemWord:D})}),B&&o(Ce,{source:B,slug:bt(t?.props),menuId:St(t?.props)})]}):N?o(Z,{omit:z}):o(ke,{variant:"none",icon:!1,message:n("Select a section or block to edit it."),children:s&&o(Ee,{variant:"secondary",onClick:s,children:n("This page")})}),be&&o(nt,{shown:M,onChange:Se,label:n("Show hints")})]})})]})}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,It as default,vt as resolvePanel};
@@ -3,11 +3,12 @@ import { type SettingsBucket } from "efficient-easel/fields";
3
3
  import type { PartMotionRows } from "./usePartMotion.js";
4
4
  import { type HeroMediaPart } from "../../render/lib/document/hero-media-parts.js";
5
5
  export declare const TAB_ICONS: Record<SettingsBucket, ReactNode>;
6
- export declare function SiteFields({ entries, entryCount, part, omit, motion, body, }: {
6
+ export declare function SiteFields({ entries, entryCount, part, omit, motion, body, itemWord, }: {
7
7
  entries?: ReactNode;
8
8
  entryCount?: number;
9
9
  part?: HeroMediaPart | null;
10
10
  omit?: readonly string[];
11
11
  motion?: PartMotionRows;
12
12
  body?: ReactNode;
13
+ itemWord?: string;
13
14
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as c,Fragment as ce,jsxs as de}from"react/jsx-runtime";import{createContext as ie,useContext as ue,useLayoutEffect as V,useMemo as g,useRef as W,useState as F}from"react";import{useEasel as q,useSelectedFields as fe}from"efficient-easel/easel";import{fieldShownInView as pe,Inspector as me,planFields as P}from"efficient-easel/fields";import{BUCKET_ICONS as we,RowPropsContext as he}from"../lib/document/controls.js";import{panelTab as be}from"../../format/lib/document/panel-tabs.js";import{BUCKETS as ge}from"../lib/document/field-groups.js";import{say as ye}from"../../format/lib/editor-words.js";import{SameInEveryViewNote as xe}from"./SameInEveryViewNote.js";import{usePreviewDevice as Se}from"efficient-easel/draw/client";import{deviceField as ve}from"efficient-easel/screen/lib/document/device-fields";import{showWhenContext as Be,visibleFields as U}from"../../render/lib/document/show-when.js";import{fieldsOfPart as Ce}from"../../render/lib/document/hero-media-parts.js";import{bandIsDropped as Te,droppedBands as ke,loneDesignBand as Ee,sameKeys as De,TEXT_BAND_KEY as O,TEXT_BAND_TITLE as _e,withoutBands as Fe}from"../../format/lib/document/panel-bands.js";const I=new Map,y=new Set;function X(o,r){const p=new Map;for(const t of o.querySelectorAll(".es-insp-row[data-field]"))p.set(t.getAttribute("data-field")??"",t);const d=[];for(const[t,b]of r)d.push({key:t,rows:b.map(m=>{const w=p.get(m),i=!!w&&[...w.children].some(S=>!S.hidden),x=w?.querySelector(".es-field-label, .es-list-label")?.textContent?.trim();return{shown:i,labelled:i&&!!x}})});return d}const Pe=Object.fromEntries(ge.map(o=>{const r=we[o];return[o,c(r,{},o)]})),Y=ie(null),Oe={_partBody:ve("each",{type:"custom",render:()=>c(Ie,{})})};function Ie(){return c(ce,{children:ue(Y)})}function Ge({entries:o,entryCount:r=0,part:p=null,omit:d,motion:t,body:b}){const{id:m,fields:w,values:i,readOnly:x,onChange:S}=fe(),l=g(()=>t?{...i,...t.values}:i,[i,t?.values]),G=(e,n)=>t?.keys.has(e)?t.onChange(e,n):S(e,n),v=Se(),{appState:R,config:H}=q(e=>e),B=Be(v,H,R.data.content??[],R.ui.itemSelector),C=b===void 0?Ce(w,p):Oe,j=g(()=>{const e=d?.length?Object.fromEntries(Object.entries(C).filter(([n])=>!d.includes(n))):C;return t?{...e,...t.fields}:e},[C,d,t?.fields]),h=U(j,l,B),[z,J]=F(()=>new Set(y)),[T,Q]=F(()=>new Set),A=W(null),{bandRows:Z,designBands:ee,looseRows:te}=g(()=>{const e=new Map,n=new Set,f=[];for(const s of P(h).rows){if(!s.fold){s.bucket==="Design"&&f.push(s.name);continue}const a=e.get(s.fold.key)??[];a.push(s.name),e.set(s.fold.key,a),s.bucket==="Design"&&n.add(s.fold.key)}return{bandRows:e,designBands:n,looseRows:new Map([["",f]])}},[h]),k=pe({},v),M={key:O,rows:Array.from({length:k?r:0},()=>({shown:!0,labelled:!0}))};V(()=>{const e=A.current?.parentElement;if(!e)return;const n=X(e,Z),f=new Set(ke(n)),s=Ee([M,...n.filter(a=>ee.has(a.key))],X(e,te)[0].rows);s&&f.add(s),Q(a=>De(a,f)?a:f)});const ne=g(()=>Fe(h,T),[h,T]),se=!Te(M)&&!T.has(O)?{key:O,title:_e}:void 0,K=q(e=>e.selectedItem)!==null,N=t?.part??p??"",E=`${m}:${N}:${String(v)}`,[oe,re]=F(()=>({tab:I.get(E)})),$=`${m}:${N}`,D=W(null),_={...B,node:l},L=P(h,{values:l,context:_}).buckets,u=be({allTabs:K,remembered:I.get(E),inherited:D.current?.panel===$?D.current.tab:oe.tab,buckets:L,hasText:k&&r>0}),le=!k&&!L.includes(u)&&(P(U(j,l,{...B,device:"desktop"}),{values:l,context:{..._,device:"desktop"}}).buckets.includes(u)||u==="Design"&&r>0);V(()=>{D.current={panel:$,tab:u}});const ae=u==="Design";return c(Y.Provider,{value:b??null,children:c(he.Provider,{value:t?l:null,children:de(me,{fields:ne,values:l,onChange:G,readOnly:x,allTabs:K,showWhenContext:_,tab:u,onTab:e=>{I.set(E,e),re({tab:e})},tabIcons:Pe,idPrefix:m,ariaLabel:ye("Section settings"),lead:ae?o:null,leadFold:se,closedFolds:z,onFold:(e,n)=>{n?y.delete(e):y.add(e),J(new Set(y))},children:[c("span",{ref:A,hidden:!0}),le&&c(xe,{})]})})})}export{Ge as SiteFields,Pe as TAB_ICONS};
1
+ "use client";import{jsx as d,Fragment as de,jsxs as ie}from"react/jsx-runtime";import{createContext as ue,useContext as fe,useLayoutEffect as V,useMemo as g,useRef as W,useState as F}from"react";import{useEasel as q,useSelectedFields as pe}from"efficient-easel/easel";import{fieldShownInView as me,Inspector as we,planFields as P}from"efficient-easel/fields";import{BUCKET_ICONS as he,RowPropsContext as be}from"../lib/document/controls.js";import{panelTab as ge}from"../../format/lib/document/panel-tabs.js";import{BUCKETS as ye}from"../lib/document/field-groups.js";import{say as xe}from"../../format/lib/editor-words.js";import{SameInEveryViewNote as Se}from"./SameInEveryViewNote.js";import{usePreviewDevice as ve}from"efficient-easel/draw/client";import{deviceField as Be}from"efficient-easel/screen/lib/document/device-fields";import{showWhenContext as Ce,visibleFields as U}from"../../render/lib/document/show-when.js";import{fieldsOfPart as Te}from"../../render/lib/document/hero-media-parts.js";import{bandIsDropped as ke,droppedBands as Ee,loneDesignBand as De,sameKeys as _e,TEXT_BAND_KEY as O,TEXT_BAND_TITLE as Fe,withoutBands as Pe}from"../../format/lib/document/panel-bands.js";const I=new Map,y=new Set;function X(o,r){const p=new Map;for(const t of o.querySelectorAll(".es-insp-row[data-field]"))p.set(t.getAttribute("data-field")??"",t);const i=[];for(const[t,h]of r)i.push({key:t,rows:h.map(x=>{const l=p.get(x),b=!!l&&[...l.children].some(S=>!S.hidden),m=l?.querySelector(".es-field-label, .es-list-label")?.textContent?.trim();return{shown:b,labelled:b&&!!m}})});return i}const Oe=Object.fromEntries(ye.map(o=>{const r=he[o];return[o,d(r,{},o)]})),Y=ue(null),Ie={_partBody:Be("each",{type:"custom",render:()=>d(Re,{})})};function Re(){return d(de,{children:fe(Y)})}function He({entries:o,entryCount:r=0,part:p=null,omit:i,motion:t,body:h,itemWord:x}){const{id:l,fields:b,values:m,readOnly:S,onChange:G}=pe(),a=g(()=>t?{...m,...t.values}:m,[m,t?.values]),H=(e,n)=>t?.keys.has(e)?t.onChange(e,n):G(e,n),v=ve(),{appState:R,config:z}=q(e=>e),B=Ce(v,z,R.data.content??[],R.ui.itemSelector),C=h===void 0?Te(b,p):Ie,j=g(()=>{const e=i?.length?Object.fromEntries(Object.entries(C).filter(([n])=>!i.includes(n))):C;return t?{...e,...t.fields}:e},[C,i,t?.fields]),w=U(j,a,B),[J,Q]=F(()=>new Set(y)),[T,Z]=F(()=>new Set),A=W(null),{bandRows:ee,designBands:te,looseRows:ne}=g(()=>{const e=new Map,n=new Set,f=[];for(const s of P(w).rows){if(!s.fold){s.bucket==="Design"&&f.push(s.name);continue}const c=e.get(s.fold.key)??[];c.push(s.name),e.set(s.fold.key,c),s.bucket==="Design"&&n.add(s.fold.key)}return{bandRows:e,designBands:n,looseRows:new Map([["",f]])}},[w]),k=me({},v),M={key:O,rows:Array.from({length:k?r:0},()=>({shown:!0,labelled:!0}))};V(()=>{const e=A.current?.parentElement;if(!e)return;const n=X(e,ee),f=new Set(Ee(n)),s=De([M,...n.filter(c=>te.has(c.key))],X(e,ne)[0].rows);s&&f.add(s),Z(c=>_e(c,f)?c:f)});const se=g(()=>Pe(w,T),[w,T]),oe=!ke(M)&&!T.has(O)?{key:O,title:Fe}:void 0,K=q(e=>e.selectedItem)!==null,N=t?.part??p??"",E=`${l}:${N}:${String(v)}`,[re,le]=F(()=>({tab:I.get(E)})),$=`${l}:${N}`,D=W(null),_={...B,node:a},L=P(w,{values:a,context:_}).buckets,u=ge({allTabs:K,remembered:I.get(E),inherited:D.current?.panel===$?D.current.tab:re.tab,buckets:L,hasText:k&&r>0}),ae=!k&&!L.includes(u)&&(P(U(j,a,{...B,device:"desktop"}),{values:a,context:{..._,device:"desktop"}}).buckets.includes(u)||u==="Design"&&r>0);V(()=>{D.current={panel:$,tab:u}});const ce=u==="Design";return d(Y.Provider,{value:h??null,children:d(be.Provider,{value:t?a:null,children:ie(we,{fields:se,values:a,onChange:H,readOnly:S,allTabs:K,showWhenContext:_,context:{itemWord:x},tab:u,onTab:e=>{I.set(E,e),le({tab:e})},tabIcons:Oe,idPrefix:l,ariaLabel:xe("Section settings"),lead:ce?o:null,leadFold:oe,closedFolds:J,onFold:(e,n)=>{n?y.delete(e):y.add(e),Q(new Set(y))},children:[d("span",{ref:A,hidden:!0}),ae&&d(Se,{})]})})})}export{He as SiteFields,Oe as TAB_ICONS};
@@ -3719,11 +3719,11 @@ input.sf-list-marking {
3719
3719
  opacity: 0.55;
3720
3720
  }
3721
3721
 
3722
- /* The Entrance kinds (lib/animation/entrance-fields): the shell's IconPicker, three
3723
- across. Each picture is the approved drawing of its kind, and it plays that kind
3724
- when the mouse rests on its cell, by the page's engine and keyframes
3725
- (efficient-shell/motion.css). The closed button shows the kind's word only (the
3726
- `.sf-pick` rule above). */
3722
+ /* The Entrance kinds (lib/animation/entrance-fields): the easel effect tiles. Each
3723
+ tile's picture is the shell's glyph of its kind, and it plays that kind when the
3724
+ mouse rests on its tile, by the page's engine and keyframes
3725
+ (efficient-shell/motion.css), inside this clipped stage, so a kind that moves
3726
+ never crosses the word under it. */
3727
3727
  .sf-entrance-stage {
3728
3728
  display: flex;
3729
3729
  align-items: center;
@@ -1 +1 @@
1
- "use client";import{useEffect as b,useMemo as w,useRef as k}from"react";import{useEasel as O}from"efficient-easel/easel";import{useEaselHost as B}from"efficient-easel/screen/lib/host";import{applyPageEdits as D,describeBlocks as H,describeSelection as J}from"../lib/host-document-bridge.js";import{nonEmptyString as N}from"../../format/lib/non-empty-string.js";const p=t=>N(t.requestId)??null;function $(){const t=B(),{appState:n,selectedItem:I,dispatch:l,history:f,config:S}=O(s=>s),i=S,g=k({appState:n,dispatch:l,history:f,blockConfig:i});g.current={appState:n,dispatch:l,history:f,blockConfig:i};const c=k(new Map),h=I?.props?.id,a=w(()=>J(i,n.data,h),[i,n.data,h]),q=a?JSON.stringify(a):"";b(()=>{t.connected&&t.send("storefront-editor:selection",{selection:a})},[t,q]),b(()=>t.subscribe(s=>{const{appState:d,dispatch:y,history:u,blockConfig:m}=g.current;switch(s.type){case"storefront-editor:request-document":{const e=p(s);if(!e)return;t.send("storefront-editor:document",{requestId:e,document:d.data,blocks:H(m)});return}case"storefront-editor:apply-page-edits":{const e=p(s);if(!e)return;const r=Array.isArray(s.ops)?s.ops:[],o=r.length?D(m,d.data,r,E=>`${E}-${crypto.randomUUID()}`):{ok:!1,reason:"no changes"};o.ok&&(y({type:"setData",data:o.document,recordHistory:!0}),c.current.set(e,JSON.stringify(o.document.content??[]))),t.send("storefront-editor:page-edits-result",{requestId:e,applied:o.ok,reason:o.ok?null:o.reason});return}case"storefront-editor:undo-page-edits":{const e=p(s);if(!e)return;const r=c.current.get(e),o=r!==void 0&&r===JSON.stringify(d.data.content??[]);o&&u.hasPast&&(u.back(),c.current.delete(e)),t.send("storefront-editor:page-edits-result",{requestId:e,applied:o&&u.hasPast,reason:o?null:"the page has changed since"});return}case"storefront-editor:set-right-panel":typeof s.shown=="boolean"&&y({type:"setUi",ui:{rightSideBarVisible:s.shown}});return;default:return}}),[t])}export{$ as useHostDocumentBridge};
1
+ "use client";import{useEffect as b,useMemo as w,useRef as k}from"react";import{useEasel as O}from"efficient-easel/easel";import{useEaselHost as P}from"efficient-easel/screen/lib/host";import{applyPageEdits as B,describeBlocks as C,describeSelection as D}from"../lib/host-document-bridge.js";import{nonEmptyString as H}from"../../format/lib/non-empty-string.js";import{activePressContext as J}from"../../format/lib/sections/active-press-context.js";const p=t=>H(t.requestId)??null;function v(){const t=P(),{appState:n,selectedItem:I,dispatch:l,history:f,config:S}=O(s=>s),i=S,g=k({appState:n,dispatch:l,history:f,blockConfig:i});g.current={appState:n,dispatch:l,history:f,blockConfig:i};const c=k(new Map),h=I?.props?.id,a=w(()=>D(i,n.data,h),[i,n.data,h]),q=a?JSON.stringify(a):"";b(()=>{t.connected&&t.send("storefront-editor:selection",{selection:a})},[t,q]),b(()=>t.subscribe(s=>{const{appState:d,dispatch:y,history:u,blockConfig:m}=g.current;switch(s.type){case"storefront-editor:request-document":{const e=p(s);if(!e)return;t.send("storefront-editor:document",{requestId:e,document:d.data,blocks:C(m)});return}case"storefront-editor:apply-page-edits":{const e=p(s);if(!e)return;const r=Array.isArray(s.ops)?s.ops:[],o=r.length?B(m,d.data,r,E=>`${E}-${crypto.randomUUID()}`,J()):{ok:!1,reason:"no changes"};o.ok&&(y({type:"setData",data:o.document,recordHistory:!0}),c.current.set(e,JSON.stringify(o.document.content??[]))),t.send("storefront-editor:page-edits-result",{requestId:e,applied:o.ok,reason:o.ok?null:o.reason});return}case"storefront-editor:undo-page-edits":{const e=p(s);if(!e)return;const r=c.current.get(e),o=r!==void 0&&r===JSON.stringify(d.data.content??[]);o&&u.hasPast&&(u.back(),c.current.delete(e)),t.send("storefront-editor:page-edits-result",{requestId:e,applied:o&&u.hasPast,reason:o?null:"the page has changed since"});return}case"storefront-editor:set-right-panel":typeof s.shown=="boolean"&&y({type:"setUi",ui:{rightSideBarVisible:s.shown}});return;default:return}}),[t])}export{v as useHostDocumentBridge};
@@ -1 +1 @@
1
- "use client";import{useEffect as f,useRef as u}from"react";import{useEasel as p}from"efficient-easel/easel";import{ROOT_ZONE as m}from"efficient-easel/draw";import{usePreviewHeader as d}from"../../render/components/PreviewHeaderContext.js";import{sectionToBoxEdits as a}from"../../render/lib/sections/section-to-box.js";function C(e){const o=p(t=>t.appState.data.content),{theme:c,themeRow:n,themeFromDocument:r}=d(),i=u(new Set);f(()=>{const t=x({theme:c,themeRow:n,themeFromDocument:r});t&&l(a(o,void 0,t),e,i.current)},[o,e,c,n,r])}function x(e){return e.themeFromDocument||e.themeRow==="none"?{}:e.themeRow==="read"?{theme:e.theme}:null}function l(e,o,c){for(const{index:n,nodes:r}of[...e].sort((i,t)=>t.index-i.index)){const i=String(r[0].props.id);c.has(i)||(c.add(i),o.replaceComponent(m,n,r[0]),r.slice(1).forEach((t,s)=>{o.insertNode(m,n+1+s,t),o.replaceComponent(m,n+1+s,t)}))}}export{l as applySectionToBoxEdits,x as editorConvertContext,C as useSectionToBoxPass};
1
+ "use client";import{useEffect as f,useRef as p}from"react";import{useEasel as d}from"efficient-easel/easel";import{ROOT_ZONE as s}from"efficient-easel/draw";import{usePreviewHeader as x}from"../../render/components/PreviewHeaderContext.js";import{sectionToBoxEdits as a}from"../../render/lib/sections/section-to-box.js";import{clearActivePressContext as l,setActivePressContext as h}from"../../format/lib/sections/active-press-context.js";function T(t){const i=d(e=>e.appState.data.content),{theme:r,themeRow:o,themeFromDocument:n}=x(),c=p(new Set);f(()=>{const e=u({theme:r,themeRow:o,themeFromDocument:n});e&&C(a(i,void 0,e),t,c.current)},[i,t,r,o,n]),f(()=>{const e=h(u({theme:r,themeRow:o,themeFromDocument:n}));return()=>l(e)},[r,o,n])}function u(t){return t.themeFromDocument||t.themeRow==="none"?{}:t.themeRow==="read"?{theme:t.theme}:null}function C(t,i,r){for(const{index:o,nodes:n}of[...t].sort((c,e)=>e.index-c.index)){const c=String(n[0].props.id);r.has(c)||(r.add(c),i.replaceComponent(s,o,n[0]),n.slice(1).forEach((e,m)=>{i.insertNode(s,o+1+m,e),i.replaceComponent(s,o+1+m,e)}))}}export{C as applySectionToBoxEdits,u as editorConvertContext,T as useSectionToBoxPass};
@@ -1,4 +1 @@
1
- import type { ReactElement } from "react";
2
- import { type EntranceKind } from "efficient-shell/format";
3
- export declare const ENTRANCE_PICTURE: Readonly<Record<EntranceKind, ReactElement>>;
4
1
  export declare function entranceFields(): Record<string, unknown>;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{phoneKey as l}from"efficient-easel/draw";import{SettingsDefaultReset as O,SettingsField as R}from"efficient-easel/panel";import{AnimationIcon as N,ClockIcon as w,DirectionDownIcon as A,DirectionIcon as T,DirectionLeftIcon as L,DirectionRightIcon as S,DirectionUpIcon as P,DurationIcon as B,NoSymbolIcon as G}from"efficient-easel/icons";import{deviceField as d}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as U,noControlField as W}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{describedAs as k,group as j,onDesktopWords as Y,phoneTwinFields as z}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as H,ENTRANCE_FROM_DEFAULT as I,ENTRANCE_KINDS as m,ENTRANCE_KINDS_WITH_FROM as g,MOTION_TIMING as q,entranceAttrs as V,playEntrance as J,readEntrance as Q}from"efficient-shell/format";import{IconPicker as X}from"efficient-shell/ui";import{pickerCellIcon as Z}from"../document/box-fields.js";import{segmented as $}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as D}from"../document/controls.js";import{withRowRules as ee}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as oe,say as c}from"../../../format/lib/editor-words.js";import{animationDelayField as ne,animationDurationField as te}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as t,LEGACY_ENTRANCE_KEY as C,entranceOf as b}from"../../../render/lib/animation/entrance.js";import{ENTRANCE_GROUP_KEY as ie}from"../../../format/lib/animation/index.js";const h={none:"None",fade:"Fade",rise:"Rise",scale:"Scale",glide:"Glide",bounce:"Bounce",flip:"Flip",reveal:"Reveal",spin:"Spin"},re={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},ae={top:()=>e(A,{}),bottom:()=>e(P,{}),left:()=>e(S,{}),right:()=>e(L,{})},f="Entrance",x=m.filter(o=>o!=="none"),u=o=>({any:[{field:t.kind,in:o},{all:[{field:t.kind,set:!1},{field:C,in:o}]}]}),v=o=>({any:[{field:l(t.kind),in:o},{all:[{field:l(t.kind),set:!1},u(o)]}]}),le=[[[t.from],u(g)],[[l(t.from)],v(g)],[[t.duration,t.delay],u(x)],[[l(t.duration),l(t.delay)],v(x)]],s=({children:o})=>e("svg",{viewBox:"0 0 40 40",width:"40",height:"40",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o}),r=({x:o=12,y:n=12,o:i=1})=>e("rect",{x:o,y:n,width:"16",height:"16",rx:"2",opacity:i}),ce={none:e(G,{size:20}),fade:a(s,{children:[e(r,{x:6,o:.3}),e(r,{x:18})]}),rise:a(s,{children:[e(r,{y:20,o:.3}),e(r,{y:8}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),scale:a(s,{children:[e("rect",{x:"16",y:"16",width:"8",height:"8",rx:"1",opacity:".35"}),e(r,{}),e("path",{d:"M6 6l4 4M34 34l-4-4"})]}),glide:a(s,{children:[e(r,{x:2,o:.3}),e(r,{x:20}),e("path",{d:"M4 33h12m-2-2 2 2-2 2"})]}),bounce:a(s,{children:[e(r,{y:6}),e("path",{d:"M8 34c3-6 5-6 8 0s5 6 8 0 5-6 8 0"})]}),flip:a(s,{children:[e("path",{d:"M12 12l16 4v8l-16 4z",opacity:".35"}),e(r,{}),e("path",{d:"M20 4v32",strokeDasharray:"2 2"})]}),reveal:a(s,{children:[e("rect",{x:"12",y:"12",width:"16",height:"16",rx:"2",strokeDasharray:"2 2",opacity:".5"}),e("path",{d:"M12 22h16v4a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z",fill:"currentColor",opacity:".35"}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),spin:a(s,{children:[e(r,{}),e("path",{d:"M33 14a14 14 0 0 1 0 12m0 0-3-1m3 1 1-3"})]})};function se({kind:o}){const{attrs:n}=V(Q(o,I)),i=c(h[o]);return Z(e("span",{className:"sf-entrance-stage",children:e("i",{...n,children:ce[o]})}),i,i)}const de=(o,n)=>{const i=n.querySelector(".sf-entrance-stage > i");i&&J(i)},pe={width:"3.5rem",height:"4.25rem"};function F({value:o,onChange:n}){return e(X,{label:c(f),value:o,columns:3,cell:pe,onChange:n,onPreview:de,tooltips:!1,options:m.map(i=>({value:i,label:c(h[i]),icon:e(se,{kind:i})}))})}const y="Effect";function me({value:o,onChange:n}){const i=D(),p=b({...i,[t.kind]:o},"desktop").kind;return e(R,{label:c(y),icon:e(N,{}),children:e(F,{value:p,onChange:n})})}function he({value:o,onChange:n}){const i=D(),p=typeof o=="string"&&m.includes(o),E=b(i,"desktop").kind;return e(R,{label:c(y),icon:e(N,{}),changed:p,action:e(O,{words:oe()?.panel,label:c(y),changed:p,detail:Y(K=>c(K),c(h[E])),onReset:()=>n(void 0)}),children:e(F,{value:p?o:E,onChange:n})})}const M={type:"select",label:f,options:m.map(o=>({value:o,label:h[o]}))},fe=()=>k({type:"custom",render:({value:o,onChange:n})=>e(me,{value:o,onChange:n})},M),ue=()=>k({type:"custom",render:({value:o,onChange:n})=>e(he,{value:o,onChange:n})},M),ye=H.map(o=>({label:re[o],value:o,picture:ae[o]()}));function Ae(){const{duration:o,delay:n}=q.entrance,i={[ie]:j(f),[t.kind]:d("desktop",fe()),[C]:W({type:"custom",render:()=>e(U,{})},"always"),[l(t.kind)]:d("mobile",ue()),...z(t.from,$("From",e(T,{}),ye,I)),[t.duration]:d("desktop",te("entrance")),[l(t.duration)]:d("mobile",_({label:"Duration",desktopKey:t.duration,icon:e(B,{}),min:o.min,max:o.max,step:o.step,fallback:o.default,unit:"s"})),[t.delay]:d("desktop",ne("entrance")),[l(t.delay)]:d("mobile",_({label:"Delay",desktopKey:t.delay,icon:e(w,{}),min:n.min,max:n.max,step:n.step,fallback:n.default,unit:"s"}))};return ee(i,le)}export{ce as ENTRANCE_PICTURE,Ae as entranceFields};
1
+ import{jsx as n,Fragment as g,jsxs as S}from"react/jsx-runtime";import{useRef as I}from"react";import{phoneKey as i}from"efficient-easel/draw";import{SettingsDefaultReset as C}from"efficient-easel/panel";import{ClockIcon as v,DirectionDownIcon as w,DirectionIcon as L,DirectionLeftIcon as M,DirectionRightIcon as x,DirectionUpIcon as G,DurationIcon as P,EntranceBounceIcon as B,EntranceFadeIcon as U,EntranceFlipIcon as W,EntranceGlideIcon as Y,EntranceRevealIcon as j,EntranceRiseIcon as H,EntranceScaleIcon as $,EntranceSpinIcon as q,NoSymbolIcon as z}from"efficient-easel/icons";import{effectTiles as V}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as c}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as J,noControlField as Q}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{customize as X,describedAs as R,group as Z,onDesktopWords as ee,phoneTwinFields as ne}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as oe,ENTRANCE_FROM_DEFAULT as N,ENTRANCE_KINDS as p,ENTRANCE_KINDS_WITH_FROM as y,MOTION_TIMING as te,entranceAttrs as ie,playEntrance as re,readEntrance as ce}from"efficient-shell/format";import{segmented as ae}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as k}from"../document/controls.js";import{withRowRules as le}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as se,say as s}from"../../../format/lib/editor-words.js";import{animationDelayField as de,animationDurationField as pe}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as t,LEGACY_ENTRANCE_KEY as D,entranceOf as F}from"../../../render/lib/animation/entrance.js";import{ENTRANCE_GROUP_KEY as me}from"../../../format/lib/animation/index.js";const u={none:"None",fade:"Fade",rise:"Rise",scale:"Scale",glide:"Glide",bounce:"Bounce",flip:"Flip",reveal:"Reveal",spin:"Spin"},fe={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},ue={top:()=>n(w,{}),bottom:()=>n(G,{}),left:()=>n(x,{}),right:()=>n(M,{})},E="Entrance",m=p.filter(e=>e!=="none"),f=e=>({any:[{field:t.kind,in:e},{all:[{field:t.kind,set:!1},{field:D,in:e}]}]}),T=e=>({any:[{field:i(t.kind),in:e},{all:[{field:i(t.kind),set:!1},f(e)]}]}),Ee={any:[f(m),{field:i(t.kind),in:m}]},Ie=[[[t.from],f(y)],[[i(t.from)],T(y)],[[t.duration,t.delay],f(m)],[[i(t.duration),i(t.delay)],T(m)]],Re={none:()=>n(z,{}),fade:()=>n(U,{}),rise:()=>n(H,{}),scale:()=>n($,{}),glide:()=>n(Y,{}),bounce:()=>n(B,{}),flip:()=>n(W,{}),reveal:()=>n(j,{}),spin:()=>n(q,{})},b="data-entrance-tile";function Ne({kind:e}){const{attrs:o}=ie(ce(e,N));return n("span",{className:"sf-entrance-stage",[b]:e,children:n("i",{...o,children:Re[e]()})})}const ye=e=>o=>{const r=e.current?.querySelector(`[${b}="${o}"] > i`);r&&re(r)},h=e=>V({label:s(E),options:p.map(o=>({value:o,label:s(u[o]),picture:n(Ne,{kind:o})})),fallback:"none",onPreview:e?ye(e):void 0});function O({row:e,children:o}){return n("div",{ref:e,style:{display:"contents"},children:o})}function _e({value:e,onChange:o}){const r=k(),a=F({...r,[t.kind]:e},"desktop").kind,l=I(null);return n(O,{row:l,children:h(l).render({value:a,onChange:d=>o(d??"none")})})}function ke({value:e,onChange:o}){const r=k(),a=typeof e=="string"&&p.includes(e),l=F(r,"desktop").kind,d=I(null);return S(g,{children:[n(O,{row:d,children:h(d).render({value:a?e:l,onChange:o})}),a&&n(C,{words:se()?.panel,label:s(De),changed:a,detail:ee(A=>s(A),s(u[l])),onReset:()=>o(void 0)})]})}const De="Effect",K={type:"select",label:E,options:p.map(e=>({value:e,label:u[e]}))},Fe=()=>R({type:"custom",render:({value:e,onChange:o})=>n(_e,{value:e,onChange:o})},K),Te=()=>R({type:"custom",render:({value:e,onChange:o})=>n(ke,{value:e,onChange:o})},K),be=oe.map(e=>({label:fe[e],value:e,picture:ue[e]()}));function Ye(){const{duration:e,delay:o}=te.entrance,r={[me]:Z(E,{dot:Ee}),[t.kind]:c("desktop",Fe()),[D]:Q({type:"custom",render:()=>n(J,{})},"always"),[i(t.kind)]:c("mobile",Te()),_cEntrance:X(),...ne(t.from,ae("From",n(L,{}),be,N)),[t.duration]:c("desktop",pe("entrance")),[i(t.duration)]:c("mobile",_({label:"Duration",desktopKey:t.duration,icon:n(P,{}),min:e.min,max:e.max,step:e.step,fallback:e.default,unit:"s"})),[t.delay]:c("desktop",de("entrance")),[i(t.delay)]:c("mobile",_({label:"Delay",desktopKey:t.delay,icon:n(v,{}),min:o.min,max:o.max,step:o.step,fallback:o.default,unit:"s"}))};return le(r,Ie)}export{Ye as entranceFields};
@@ -1 +1 @@
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
+ 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 p,pictureHoverFields as t}from"./hover-fields.js";import{customize as l}from"efficient-easel/screen/lib/document/box-fields";import{loopDirectionField as u,loopFields as m,loopHeading as d}from"./loop-fields.js";import{truthy as F,withRowsShownWhen as f}from"../../../format/lib/document/show-when-attach.js";function g(){const o=t("none");return f(o,Object.keys(o),F("bgImage"))}function R(o,r=""){switch(o){case"section":case"block":return e();case"box":return{...e(),...m(),...g()};case"picture":return{...e(),...t(c(r),r)};case"textPart":return{...e(),...p()};case"cards":return{...e(),...a(s(r))};case"marquee":return{...e(),_gLoop:d(),_cLoop:l(),scrollDirection:u(),loopDuration:n({readsSpeed:!0}),loopDelay:i()}}}export{R as animationTabFields};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{ContrastIcon as V,HoverIcon as D,HoverLiftIcon as K,HoverNextImageIcon as S,HoverNoneIcon as P,HoverRotateIcon as g,HoverZoomIcon as O,OpacityIcon as A,RotateIcon as U}from"efficient-easel/icons";import{group as F}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as y,noControlField as W}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as c}from"../../../format/lib/content/box-background.js";import{cardTemplateField as L,cardTemplateOwner as B,namedRowField as M}from"../../../format/lib/content/card-template.js";import{segmented as Y,slider as R}from"../document/box-fields.js";import{withShowWhen as p}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as v,animationDurationField as w,showsWhatRuns as m}from"./AnimationDurationRow.js";import{CARD_HOVER_ANGLE as _,CARD_HOVER_KEYS as i,CARD_HOVER_KINDS as X,CARD_HOVER_TURN as b,HOVER_KEY as l,HOVER_KIND_LABELS as j,NEXT_PICTURE_BLOCKS as z,NEXT_PICTURE_HOVER_KINDS as G,OLD_SPIN_KEY as Z,PART_HOVER_KINDS as q,PICTURE_HOVER_KEYS as N,PICTURE_HOVER_KINDS as J,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as Q,cardHoverKindOf as $,cardRotatesRule as oo,HOVER_GROUP_KEY as E,pictureHoverKindOf as eo,pictureHoverMovesRule as to,pictureHoverRunsRule as no}from"../../../format/lib/animation/hover.js";const H=()=>r("desktop",F("Hover")),ro="What this does when a shopper points at it, or taps it on a phone.",io="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",so="What this picture does when a shopper points at the card. Show next image fades to the card's next photo. Black and white shows it in grey until then. A phone shows the first photo in colour.",po="What each card does when a shopper points at it, or taps it on a phone. Rotate turns the wheel picture.",ao={none:()=>n(P,{}),nextImage:()=>n(S,{}),rotate:()=>n(g,{}),zoom:()=>n(O,{}),lift:()=>n(K,{}),mono:()=>n(V,{})};function f(o,e){return Y("Hover effect",n(D,{}),o.map(t=>({label:j[t],value:t,picture:ao[t]()})),e)}function vo(){return{[E]:H(),[l]:r("desktop",{...f(q,"none"),description:ro})}}function wo(o){const e=oo(o),t=R("Angle",n(U,{}),_.min,_.max,_.step,b,"°");return{[E]:H(),[i.kind]:r("desktop",{...m(f(X,o),(s,a)=>$(a??{},o)),description:po}),[Z]:W({type:"custom",render:()=>n(y,{})},"always"),[i.angle]:r("desktop",p(m(t,s=>Q(s)),e)),[i.duration]:r("desktop",p(w("hover"),e)),[i.delay]:r("desktop",p(v("hover"),e))}}function No(o,e=""){const t=no(o);return{[E]:H(),[i.kind]:T(J,o,io),...z.includes(e)?co():{},[i.duration]:r("desktop",p(w("hover"),t)),[i.delay]:r("desktop",p(v("hover"),t))}}function co(){const o=to(),e=R("Zoom",n(O,{}),d.min,d.max,d.step,d.min,d.unit),t=R("Darken on hover",n(A,{}),c.min,c.max,c.step,c.fallback,c.unit);return{[N.zoom]:r("desktop",p(e,o)),[N.darken]:r("desktop",p(t,o))}}function T(o,e,t){const s=r("desktop",{...m(f(o,e),a=>eo({[l]:a},e,o)),description:t});return Object.assign(s,{[k]:e})}const k="sfPictureResting",C=new WeakMap;function To(o,e,t){const s=o[i.kind],a=s?.[k];if(!s||!a)return o;const I=e.props?.[l]==="nextImage",h=I?null:B(t.appState,e.props?.id),x=h?L(String(h.type),M(e.props),h):null;if(!I&&!x?.next)return o;let u=C.get(o);return u||(u={...o,[i.kind]:T(G,a,so)},C.set(o,u)),u}export{wo as cardHoverFields,vo as hoverFields,To as offerNextPicture,No as pictureHoverFields};
1
+ import{jsx as i}from"react/jsx-runtime";import{ContrastIcon as A,NoSymbolIcon as P,HoverLiftIcon as g,HoverNextImageIcon as y,HoverRotateIcon as U,HoverZoomIcon as v,OpacityIcon as F,RotateIcon as b}from"efficient-easel/icons";import{customize as W,describedAs as L,group as z}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as B}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as n}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as M,noControlField as Y}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 X,cardTemplateOwner as j,namedRowField as G}from"../../../format/lib/content/card-template.js";import{slider as h}from"../document/box-fields.js";import{say as O}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as w,animationDurationField as N,showsWhatRuns as R}from"./AnimationDurationRow.js";import{CARD_HOVER_ANGLE as f,CARD_HOVER_KEYS as s,CARD_HOVER_KINDS as Z,CARD_HOVER_TURN as q,HOVER_KEY as m,HOVER_KIND_LABELS as T,NEXT_PICTURE_BLOCKS as J,NEXT_PICTURE_HOVER_KINDS as Q,OLD_SPIN_KEY as $,PART_HOVER_KINDS as k,PICTURE_HOVER_KEYS as C,PICTURE_HOVER_KINDS as oo,PICTURE_HOVER_ZOOM as l,cardHoverAngleOf as eo,cardHoverKindOf as to,cardRotatesRule as ro,HOVER_GROUP_KEY as _,pictureHoverKindOf as no,pictureHoverMovesRule as io,pictureHoverRunsRule as so}from"../../../format/lib/animation/hover.js";const E=o=>n("desktop",z("Hover",{dot:o})),x=()=>n("desktop",W()),ao="What this does when a shopper points at it, or taps it on a phone.",po="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",co="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.",lo="What each card does when a shopper points at it, or taps it on a phone. Rotate turns the wheel picture.",mo={none:()=>i(P,{}),nextImage:()=>i(y,{}),rotate:()=>i(U,{}),zoom:()=>i(v,{}),lift:()=>i(g,{}),mono:()=>i(A,{})};function H(o,e){const r=B({label:O("Hover effect"),options:o.map(t=>({value:t,label:O(T[t]),picture:mo[t]()})),fallback:e});return L(r,{type:"select",label:"Hover effect",options:o.map(t=>({value:t,label:T[t]}))})}function Co(){return{[_]:E({field:m,in:k.filter(o=>o!=="none")}),[m]:n("desktop",{...H(k,"none"),description:ao})}}function xo(o){const e=ro(o),r=h("Angle",i(b,{}),f.min,f.max,f.step,q,"°");return{[_]:E(e),[s.kind]:n("desktop",{...R(H(Z,o),(t,p)=>to(p??{},o)),description:lo}),[$]:Y({type:"custom",render:()=>i(M,{})},"always"),_cHover:x(),[s.angle]:n("desktop",a(R(r,t=>eo(t)),e)),[s.duration]:n("desktop",a(N("hover"),e)),[s.delay]:n("desktop",a(w("hover"),e))}}function Vo(o,e=""){const r=so(o);return{[_]:E(r),[s.kind]:V(oo,o,po),_cHover:x(),...J.includes(e)?uo():{},[s.duration]:n("desktop",a(N("hover"),r)),[s.delay]:n("desktop",a(w("hover"),r))}}function uo(){const o=io(),e=h("Zoom",i(v,{}),l.min,l.max,l.step,l.min,l.unit),r=h("Darken on hover",i(F,{}),c.min,c.max,c.step,c.fallback,c.unit);return{[C.zoom]:n("desktop",a(e,o)),[C.darken]:n("desktop",a(r,o))}}function V(o,e,r){const t=n("desktop",{...R(H(o,e),p=>no({[m]:p},e,o)),description:r});return Object.assign(t,{[D]:e})}const D="sfPictureResting",S=new WeakMap;function Do(o,e,r){const t=o[s.kind],p=t?.[D];if(!t||!p)return o;const I=e.props?.[m]==="nextImage",u=I?null:j(r.appState,e.props?.id),K=u?X(String(u.type),G(e.props),u):null;if(!I&&!K?.next)return o;let d=S.get(o);return d||(d={...o,[s.kind]:V(Q,p,co)},S.set(o,d)),d}export{xo as cardHoverFields,Co as hoverFields,Do as offerNextPicture,Vo as pictureHoverFields};
@@ -1,2 +1,4 @@
1
+ import type { ShowWhenRule } from "../../../render/lib/document/show-when.js";
1
2
  export declare function loopDirectionField(): import("../document/controls.js").CustomField<string>;
3
+ export declare const loopHeading: (dot?: ShowWhenRule) => import("efficient-easel/screen/lib/document/box-fields").BoxField<undefined>;
2
4
  export declare function loopFields(): Record<string, unknown>;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{DirectionIcon as i,LoopIcon as t}from"efficient-easel/icons";import{select as n}from"../document/box-fields.js";import{EDGE_ARROWS as l,edgePad as p}from"../document/controls.js";import{withShowWhen as o}from"../../../format/lib/document/show-when-attach.js";import{loopDelayField as O,loopDurationField as m}from"./AnimationDurationRow.js";import{DEFAULT_LOOP_DIRECTION as a,LOOP_DIRECTION_OPTIONS as c,LOOP_NONE as s,LOOP_OPTIONS as D,LOOP_SCROLLS as r}from"../../../format/lib/animation/loop.js";function d(){return p("Scroll direction",c,a,"A marquee cannot run diagonally, so the corners are not answers.",e(i,{}),l)}function E(){return{loop:n("Loop",e(t,{}),D,s),scrollDirection:o(d(),r),loopDuration:o(m({readsSpeed:!1}),r),loopDelay:o(O(),r)}}export{d as loopDirectionField,E as loopFields};
1
+ import{jsx as t}from"react/jsx-runtime";import{DirectionIcon as s,LoopMarqueeIcon as c,NoSymbolIcon as a}from"efficient-easel/icons";import{customize as m,describedAs as O,group as f}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as L}from"efficient-easel/screen/lib/document/effect-tiles";import{EDGE_ARROWS as u,edgePad as d}from"../document/controls.js";import{withShowWhen as n}from"../../../format/lib/document/show-when-attach.js";import{loopDelayField as _,loopDurationField as D}from"./AnimationDurationRow.js";import{say as p}from"../../../format/lib/editor-words.js";import{DEFAULT_LOOP_DIRECTION as I,LOOP_DIRECTION_OPTIONS as P,LOOP_NONE as S,LOOP_OPTIONS as l,LOOP_SCROLLS as r}from"../../../format/lib/animation/loop.js";function T(){return d("Direction",P,I,"A marquee cannot run diagonally, so the corners are not answers.",t(s,{}),u)}const E=o=>f("Loop",o?{dot:o}:void 0),N={none:()=>t(a,{}),scroll:()=>t(c,{})};function b(){const o=L({label:p("Loop"),options:l.map(({value:e,label:i})=>({value:e,label:p(i),picture:N[e]()})),fallback:S});return O(o,{type:"select",label:"Loop",options:l.map(({value:e,label:i})=>({value:e,label:i}))})}function j(){return{_gLoop:E(r),loop:b(),_cLoop:m(),scrollDirection:n(T(),r),loopDuration:n(D({readsSpeed:!1}),r),loopDelay:n(_(),r)}}export{T as loopDirectionField,j as loopFields,E as loopHeading};
@@ -1,7 +1,7 @@
1
1
  import { type ReactElement, type ReactNode } from "react";
2
2
  import { type FieldsPatch } from "efficient-easel/easel";
3
3
  import { type MediaValue } from "../../../format/lib/media-value.js";
4
- import { type LoadingShows } from "../../../format/lib/hero-video.js";
4
+ import { type KnownVideoFrame, type LoadingShows } from "../../../format/lib/hero-video.js";
5
5
  import { readHidable, hidableText, type HidableValue } from "efficient-easel/draw";
6
6
  import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, foldMetaOf, textFieldIdentifier, type EdgeCell, type FoldFieldMeta, type TextFieldMeta, type TextListRendering } from "efficient-easel/draw";
7
7
  import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
@@ -304,6 +304,7 @@ export declare const MEDIA_TYPE_OPTIONS: {
304
304
  value: "image" | "video";
305
305
  }[];
306
306
  export declare function loadingShowsField(label: string, icon: ReactElement, pictures: Readonly<Record<LoadingShows, ReactElement>>): CustomField<LoadingShows>;
307
+ export declare function loadingRowHint(values: Readonly<Record<string, unknown>>, frames: Readonly<Record<string, KnownVideoFrame>> | undefined, hasUnsavedEdits: boolean): string | undefined;
307
308
  export declare function upload(label: string, accept: string, placeholder?: string, opts?: {
308
309
  focus?: string;
309
310
  focusWhen?: (props: Record<string, unknown>, view: "desktop" | "tablet" | "mobile") => boolean;