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.
- package/CHANGELOG.md +52 -0
- package/dist/editor/components/HeroPartPanel.js +1 -1
- package/dist/editor/components/SectionEditor.js +1 -1
- package/dist/editor/components/SiteFields.d.ts +2 -1
- package/dist/editor/components/SiteFields.js +1 -1
- package/dist/editor/components/storefront-editor.css +5 -5
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- package/dist/editor/components/useSectionToBoxPass.js +1 -1
- package/dist/editor/lib/animation/entrance-fields.d.ts +0 -3
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/animation/loop-fields.d.ts +2 -0
- package/dist/editor/lib/animation/loop-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +2 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/document/panel-drop-empty-headings.js +1 -1
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/editor/lib/host-document-bridge.d.ts +2 -1
- package/dist/editor/lib/host-document-bridge.js +1 -1
- package/dist/editor/lib/keyed-store.d.ts +7 -0
- package/dist/editor/lib/keyed-store.js +1 -0
- package/dist/editor/lib/page-live-state.js +1 -1
- package/dist/editor/lib/page-video-frames.d.ts +11 -0
- package/dist/editor/lib/page-video-frames.js +1 -0
- package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/editor/lib/sections/new-section-node.js +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/animation/hover.d.ts +2 -3
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/animation/loop.js +1 -1
- package/dist/format/lib/document/passes/settings-groups.js +1 -1
- package/dist/format/lib/document/section-catalog.d.ts +1 -1
- package/dist/format/lib/document/section-catalog.js +14 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +7 -2
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/hero-video.d.ts +10 -0
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/sections/active-press-context.d.ts +4 -0
- package/dist/format/lib/sections/active-press-context.js +1 -0
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/sections/section-presets.d.ts +5 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +2 -2
- package/dist/format/lib/web-backend.d.ts +9 -0
- package/dist/render/components/{BoxCellWidthContext.d.ts → BoxCellContext.d.ts} +0 -1
- package/dist/render/components/BoxCellContext.js +1 -0
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/Placeholder.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +0 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/sanitize.d.ts +1 -0
- package/dist/render/lib/document/sanitize.js +1 -1
- package/package.json +5 -5
- 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
|
|
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
|
|
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
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
(efficient-shell/motion.css)
|
|
3726
|
-
|
|
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
|
|
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
|
|
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 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
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
|
|
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
|
|
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
|
|
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;
|