efficient-web-builder 73.0.0 → 73.2.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 +48 -0
- package/dist/editor/components/SlotChildRows.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/TickerSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +5 -4
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
- package/dist/editor/lib/document/blocks/hero-shared-fields.d.ts +5 -0
- package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +1 -0
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/footer-blocks.js +1 -1
- package/dist/editor/lib/document/own-pad-fields.d.ts +5 -0
- package/dist/editor/lib/document/own-pad-fields.js +1 -0
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/content/accordion-row-style.d.ts +3 -1
- package/dist/format/lib/content/accordion-row-style.js +1 -1
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/button-icon.d.ts +3 -1
- package/dist/format/lib/content/button-icon.js +1 -1
- package/dist/format/lib/content/card-place.d.ts +3 -1
- package/dist/format/lib/content/card-place.js +1 -1
- package/dist/format/lib/content/chat-launcher.js +1 -1
- package/dist/format/lib/content/container-direction.js +1 -1
- package/dist/format/lib/content/footprint.d.ts +22 -0
- package/dist/format/lib/content/footprint.js +1 -1
- package/dist/format/lib/content/image-fit.js +1 -1
- package/dist/format/lib/content/image-text-rows.d.ts +5 -2
- package/dist/format/lib/content/image-text-rows.js +1 -1
- package/dist/format/lib/content/list-number.js +1 -1
- package/dist/format/lib/content/list-position.js +1 -1
- package/dist/format/lib/content/part-names.d.ts +27 -0
- package/dist/format/lib/content/part-names.js +1 -0
- package/dist/format/lib/content/section-css.d.ts +3 -0
- package/dist/format/lib/content/section-css.js +1 -0
- package/dist/format/lib/content/text-tag.js +1 -1
- package/dist/format/lib/document/blocks/general/Footprint/card-seed.js +1 -1
- package/dist/format/lib/document/box-footer.js +1 -1
- package/dist/format/lib/document/left-view.js +1 -1
- package/dist/format/lib/document/mockup-variant-fields.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +2 -0
- package/dist/format/lib/document/section-groups.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +13 -0
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/hero-arrows.js +1 -1
- package/dist/format/lib/hero-group-placement.js +1 -1
- package/dist/format/lib/hero-media-layout.js +1 -1
- package/dist/format/lib/hero-phone-stack.d.ts +12 -0
- package/dist/format/lib/hero-phone-stack.js +1 -1
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/reel.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/sections/section-head-placement.d.ts +3 -1
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/source-rules/one-option-parser.d.ts +12 -0
- package/dist/format/lib/source-rules/one-option-parser.js +12 -0
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/BlockFrame.d.ts +3 -1
- package/dist/render/components/BlockFrame.js +1 -1
- package/dist/render/components/BoxTabPaneContext.d.ts +2 -3
- package/dist/render/components/Btn.d.ts +3 -0
- package/dist/render/components/Btn.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +2 -0
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/DealerFinder.d.ts +7 -1
- package/dist/render/components/DealerFinder.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Footprint.d.ts +6 -2
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/Grid.js +1 -1
- package/dist/render/components/Heading.d.ts +1 -1
- package/dist/render/components/Heading.js +1 -1
- package/dist/render/components/HeroArrows.d.ts +4 -1
- package/dist/render/components/HeroArrows.js +1 -1
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroPoster.js +1 -1
- package/dist/render/components/HeroSection.d.ts +4 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.d.ts +4 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +3 -0
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/Logo.d.ts +3 -1
- package/dist/render/components/Logo.js +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/SideListLayout.d.ts +8 -2
- package/dist/render/components/SideListLayout.js +1 -1
- package/dist/render/components/SiteGutterFrame.d.ts +3 -1
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/Text.d.ts +1 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/lib/content/section-padding.d.ts +36 -2
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/CustomHTML/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
- package/dist/render/lib/document/blocks/general/LocationMap/render.js +1 -1
- package/dist/render/lib/document/blocks/general/LogoBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
- 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-editorial.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
- package/dist/render/lib/document/custom-css.d.ts +7 -3
- package/dist/render/lib/document/custom-css.js +2 -2
- package/dist/render/lib/document/header-clearance.js +1 -1
- package/dist/render/lib/document/header-ink.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/section-custom-css.d.ts +2 -0
- package/dist/render/lib/document/passes/section-custom-css.js +1 -0
- package/dist/render/lib/document/passes/section-padding.d.ts +4 -0
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/sanitize.d.ts +4 -1
- package/dist/render/lib/document/sanitize.js +1 -1
- package/dist/render/lib/document/section-css-style.d.ts +4 -0
- package/dist/render/lib/document/section-css-style.js +1 -0
- package/dist/routine-index.json +1 -0
- package/dist/value-index.json +1 -0
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 73.2.0 - 2026-11-19
|
|
4
|
+
|
|
5
|
+
From main at `99f31fec`: #808, #810, #811, #812, #813, #814, #816, #819, #821.
|
|
6
|
+
|
|
7
|
+
A minor: one rule for reading a stored option, three phone-only space rows on the hero, Text, Heading and Button own their top and bottom room, new Footprint settings, and a Custom HTML section can open and close a part on a click with no script. New exports; new optional props. No stored key or value moves. Every stored node draws the same bytes as before, except a Custom HTML section: it now keeps its ids (with the section prefix), buttons, popovers and `<details>`, and a link to an anchor outside the section stays as written (#816, #821). The `efficient-shell` peer widens to `^13.24.1 || ^14.0.0` (#813); the floor does not move.
|
|
8
|
+
|
|
9
|
+
**For hosts:**
|
|
10
|
+
- A host on efficient-shell 14 installs `efficient-easel` 37.2.0 or later. A host on shell 13.24.1 or later needs no change.
|
|
11
|
+
- storefront-blocks: its hero stylesheet reads `--sf-hero-phone-words-top`, `--sf-hero-phone-words-bottom` and `--sf-hero-phone-box-gap` with today's 100px / 90px / 28px fallbacks (storefront-blocks #629).
|
|
12
|
+
- storefront-blocks, admin email and easel: turn on the efficient-shell ui-check kind `option-read` (14.2.0). Do not import `oneOptionParser`; web-builder keeps it for its own tree only, and it is removed at the next web-builder major.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Phone words space on the hero.** Three phone-only rows, Words space top, Words space bottom and Space between boxes, on Hero (in its "On a phone" group) and on HeroSingle (a new "On a phone" heading). One value per Hero, 0-200 px; an empty row stores nothing. `lib/hero-phone-stack` exports the three CSS properties and `heroPhoneWordsStyle()`, which writes a property only for a stored number. HeroSingle -> Hero carries the keys. (#811)
|
|
17
|
+
- **Text, Heading and Button own their top and bottom room.** A top or bottom value set in the panel is now the total room the block draws; before, the block's fixed frame (16 px for Text and Button, 24 px for Heading) was always added. A new marker `padTotal` is written only on a panel edit; a node without it draws stored value + frame, as before. One reader, `ownPadOf` (`src/lib/content/section-padding.ts`); the frames are named once, `TEXT_PAD_FRAME` and `HEADING_PAD_FRAME`. The Button's new row is "Outer padding". No data move. (#812)
|
|
18
|
+
- **Footprint: Shows, Columns, Map height and the head in the list column.** Shows: Map and list (default) / Map only / List only. Columns (desktop list band): Auto (default) / 1-4; tablet at most 2, phone 1. Map height (list Left/Right): Fixed (default) / Full height. The section head can sit in the list column (`list-column`). Each reader goes through `parseOption` in `lib/content/footprint.ts`. No key is in `defaultProps`; a stored Footprint draws the same bytes. (#814)
|
|
19
|
+
- **Custom HTML opens a part on a click, with no script.** In a Custom HTML section, `<button popovertarget>` with a `popover`, and `<details>`/`<summary>`, are kept. `sanitizeHtml(html, { idPrefix })` allows `button`, `details`, `summary` and the id, popover and aria attributes; event handlers and `script` stay forbidden. Every `id` takes the section's prefix (`<block id>-`). A `#link`, `popovertarget` or `aria-*` value, and a CSS `#x`, take the prefix only when they name an id that the section itself draws; a link to an anchor outside the section (for example `#contact`) stays as written. With no prefix (an article body), nothing changes. (#816, #821)
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **The builder takes document addressing from easel.** The Ticker root zone, slot and section-group zone keys, and new node ids come from `efficient-easel` (`ROOT_ZONE`, `zoneKey`, `newId`), not from local copies. The values are the same as before. A new guard fails on a hand-written root zone, zone key or `crypto.randomUUID` node id in `src/`. (#808)
|
|
24
|
+
- **A ratio hero keeps a bottom Box at the bottom in the editor.** In ratio mode the slide root is `flex flex-col` and the words layer `w-full flex-1`, so the layer fills the slide inside the editor's block wrapper too. The no-ratio classes do not change. (#819)
|
|
25
|
+
|
|
26
|
+
### Guards
|
|
27
|
+
|
|
28
|
+
- **The package ships its copy index.** The build writes the efficient-shell checker's index into `dist` last (one `--entry` per side: render, format, editor); `verify-dist` checks it is there, for this package and version, and that no exported side is empty. Checker `efficient-shell` 14.1.1 (dev only). (#813)
|
|
29
|
+
- **One option parser rule.** `oneOptionParser` (`src/lib/source-rules/one-option-parser.ts`) finds a stored option read by a hand-written conditional; every such read in `src/` now goes through `parseOption`. Each read returns the same answer for every stored value. `THEME_MODES` is exported from `lib/theme.ts`. (#810)
|
|
30
|
+
|
|
31
|
+
## 73.1.0 - 2026-11-19
|
|
32
|
+
|
|
33
|
+
From main at `1d788e30`: #806, #807.
|
|
34
|
+
|
|
35
|
+
A minor: every section gets one Custom CSS box, and the parts the sections draw carry fixed `data-part` names. The `efficient-easel` peer floor moves to `^37.1.0` (the panel's Advanced band). New exports; one new optional prop. No stored key or value moves.
|
|
36
|
+
|
|
37
|
+
**For hosts:**
|
|
38
|
+
- Install `efficient-easel` 37.1.0 or later with this release.
|
|
39
|
+
- A section with no Custom CSS draws exactly what it drew before. A section with Custom CSS draws one wrapper (`data-sf-section-css="<id>"`) with its scoped `<style>` first; the style is loaded lazily and suspends with its section, so a host that streams (the storefront) gets the `<style>` in the server HTML. `renderToString` of a section that has Custom CSS throws.
|
|
40
|
+
- storefront-blocks: its own parts import their names from `PART_NAMES` (follow-up PR).
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- **A Custom CSS box on every section**, in the settings panel's Advanced band. It is for one-off values on one site. The CSS is stored verbatim in the section's `customCss` prop and limited at draw time by the one scoper Custom HTML uses (`scopeCustomCss`, now with a scope attribute): selectors are prefixed with the section's scope; `http:`, `data:`, `//host` and `@import` are dropped. `customCss` is carried when a legacy section becomes a Box and when a HeroSingle becomes a Hero. (#807)
|
|
45
|
+
- **Frozen part names.** One list, `src/lib/content/part-names.ts` (`PART_NAMES`); every block draws its parts with `data-part="..."` from it (Box, Grid, Hero, HeroSlide, HeroSingle, ImageBlock, ButtonBlock, Text, Heading, LogoBlock). After this release a name does not change. (#807)
|
|
46
|
+
|
|
47
|
+
### Guards
|
|
48
|
+
|
|
49
|
+
- ui-check turns on `spacing`, `font-size`, `shadow`, `own-text`, `own-badge`, `hand-motion` and `shell-part-copy`, with `includeValues: ["src/**"]` (checker `efficient-shell` 13.25.0, dev only). `scripts/test-editor-css-tokens.ts` is deleted: the ui-check counts the same values. (#806)
|
|
50
|
+
|
|
3
51
|
## 73.0.0 - 2026-11-19
|
|
4
52
|
|
|
5
53
|
From main at `e3945738`: #792, #793, #798, #800, #801, #802, #803.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s,Fragment as C,jsxs as R}from"react/jsx-runtime";import{useEasel as x}from"efficient-easel/easel";import{
|
|
1
|
+
"use client";import{jsx as s,Fragment as C,jsxs as R}from"react/jsx-runtime";import{useEasel as x}from"efficient-easel/easel";import{zoneKey as b}from"efficient-easel/data";import{LayersIcon as F}from"efficient-easel/icons";import{SettingsDrill as k,SettingsField as _}from"efficient-easel/panel";import j from"efficient-easel/screen/components/AddChildRow";import{useSlotChildActions as y}from"efficient-easel/screen/components/SlotChildActionsContext";import{HERO_GROUP_TYPE as D,heroGroupNestDepth as I}from"../../format/lib/hero-group-placement.js";import{canAddTo as p}from"../lib/document/add-target.js";import{say as O}from"../../format/lib/editor-words.js";function E({parent:o,parentType:t,label:r,rowName:n,onSelectChild:e,onAddChild:l,nestDepth:m=0}){const u=p(t,m);if(!u)return null;const{slot:d,choices:A,spec:i}=u,f=String(o.props.id),h=b({parentId:f,slot:d}),c=Array.isArray(o.props[d])?o.props[d]:[],w=i?.addBlocked?.(c)??null,S=i?.notice?.(c)??null,g=R(C,{children:[S?s("p",{className:"sf-note",children:S}):null,c.map((a,N)=>s(k,{name:n(a),onOpen:()=>e(h,N,String(a.props.id),t)},String(a.props.id??`${h}-${N}`))),A||i.fixed?null:s(j,{label:i.addLabel,blocked:w,onAdd:()=>l(f,d,i.childType,c.length,t)})]});return s("div",{className:"sf-slot-rows",children:r?s(_,{label:O(r),icon:s(F,{}),value:String(c.length),children:g}):g})}function v(o,t){return p(o)?.spec?.notice?.(t)??null}function M({parentType:o}){const{selectedItem:t}=x(l=>l);if(!t||t.type!==o)return null;const r=p(o)?.slot,n=r&&Array.isArray(t.props[r])?t.props[r]:[],e=v(o,n);return e?s("p",{className:"sf-note",children:e}):null}function z(o,t){return p(t)?.source==="footer"?o.blockRowName:o.childRowName}function G({parentType:o,label:t}){const{appState:r,selectedItem:n}=x(m=>m),e=y();if(!e||!n||n.type!==o)return null;const l=o===D?I(r?.data,String(n.props.id)):0;return s(E,{parent:n,parentType:o,label:t,rowName:z(e,o),onSelectChild:e.selectChild,onAddChild:e.addChild,nestDepth:l})}export{E as SlotChildRows,M as SlotNoticeField,G as default,z as rowNamerFor,v as slotNoticeOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import X from"./WebsiteHintsProvider.js";import{useCallback as H,useEffect as P,useMemo as l,useRef as Z,useState as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import X from"./WebsiteHintsProvider.js";import{useCallback as H,useEffect as P,useMemo as l,useRef as Z,useState as f}from"react";import x from"next/dynamic";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{buildConfig as $}from"../lib/document/build-config.js";import{withTemplateMediaPlaceholders as ee}from"../../format/lib/document/templateFields.js";import{setEditorPageSlug as B}from"../../format/lib/document/editor-page-context.js";import{ScreenDocumentContext as te}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as re}from"../../render/components/PreviewHeaderContext.js";import{PreviewTickerProvider as oe}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as ie}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as ne}from"efficient-easel/draw/client";import{CanvasPartsBridge as se}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as de}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as ae}from"./PreviewPartStyleContext.js";import{sectionTemplates as O}from"efficient-easel/screen/lib/section-templates";import{saveSectionTemplate as R}from"../lib/editor-document-adapter.js";import{nodeToDoc as me,docToNode as F}from"efficient-easel/screen/lib/document/section-doc";import{newNodeId as ce}from"efficient-easel/draw";import{migrateRenamedProps as le}from"../../format/lib/document/renamed-props.js";import{buildSlotSeedChildren as fe}from"../../render/lib/document/slot-specs.js";import{FOOTER_TYPE as ue,buildDefaultFooterBlocks as pe}from"../lib/document/footer-blocks.js";import{NO_BRIDGED_CAPABILITIES as ve,useAdminBridge as ge}from"efficient-easel/screen/lib/admin-bridge";import{useEaselHost as he}from"efficient-easel/screen/lib/host";import{ChromeWrap as Pe}from"efficient-easel/screen/lib/host-chrome";import{sessionRegistry as Ee}from"efficient-easel/screen/lib/session";import{useEaselSession as Se}from"efficient-easel/screen/lib/session-context";import{say as L}from"../../format/lib/editor-words.js";import{retargetWhenSaved as ye}from"../../format/lib/section-retarget.js";import{routeSharedHostMessage as Te}from"efficient-easel/screen/lib/host-inbound";import{routeWebsiteHostMessage as we}from"../../format/lib/website-host-inbound.js";import{DEFAULT_THEME_MODE as E,THEME_MODE_KEY as Ne}from"../../format/lib/theme.js";import{makeSitePageAdapter as U}from"../lib/editor-document-adapter.js";import{documentPermissions as Ce}from"efficient-easel/edit-lock";import{useAutosave as ke}from"efficient-easel/autosave";import{saveStatusOf as Ae}from"efficient-easel/screen/lib/document-switch";import{blocksOf as Me}from"../lib/website-session.js";import{parseOption as Oe}from"../../format/lib/parse-option.js";import{THEME_MODES as be}from"../../format/lib/theme.js";const Ie=x(()=>import("./SiteEditorProvider.js"),{ssr:!1}),De=x(()=>import("efficient-easel/screen/components/SectionScreenShell"),{ssr:!1}),W="Hero",Y="Untitled section";function _e(s,S){const d=S.components,r=d[s]?s:W,y=d[r]?.defaultProps??{},i=fe(r,u=>d[u]?.defaultProps??{}),n=r===ue?{blocks:pe()}:null;return{type:r,props:{id:ce(r),...y,...i?{[i.slot]:i.children}:null,...n}}}function He(){if(typeof window>"u")return E;try{const s=window.localStorage.getItem(Ne);return Oe(be,E,s)}catch{return E}}function xe({id:s,initialType:S,initialName:d=Y}){const[r,y]=f(s),i=Z(r);P(()=>{i.current=r},[r]);const n=he(),[u,j]=f(S),[b,K]=f(d),[a,T]=f(void 0),[G,q]=f(E),{token:w,tokenRef:I}=ge({onMessage:e=>{if(we(e)||Te(e))return;const t=e;if(t?.type==="storefront-editor:navigate"&&t.target?.kind==="section"&&t.target.id){const M=t.target.id;if(M===i.current)return;const Q=t.target.type,V=t.target.name;ye(C,()=>{j(Q),K(V||Y),y(M),n.address.show({kind:"section",id:M})},()=>n.send("storefront-editor:save-failed"))}}}),N=ke({save:e=>R(O,e.id,e.node).then(()=>{}),onFailure:(e,t)=>{t===0&&n.send("storefront-editor:save-failed")}}),{state:p,push:D,flush:C}=N;P(()=>q(He()),[]);const m=Se(),v=m.usesBridgedToken?!!w:!0,g=l(()=>$(Ee(m),Me(m)),[m]);P(()=>{if(!v)return;let e=!1;return T(void 0),O.ensure(r,b,_e(u??W,g)).then(t=>!e&&T(t.node)).catch(()=>!e&&T(null)),()=>{e=!0}},[r,u,b,v,g]);const k=H(e=>{n.send("storefront-editor:dirty");const t=F(e);t&&D({id:i.current,node:t})},[D,n]),h=n.send,_=H(async e=>{try{return await e(I.current??""),!0}catch{return h("storefront-editor:save-failed"),!1}},[h]),z=l(()=>ee(g,!0),[g]);P(()=>(B(null),()=>B(null)),[]);const c=l(()=>a?le(me(a)):null,[a]),A=l(()=>({target:{kind:"page",slug:""},adapter:U(void 0),capabilities:U(void 0).capabilities,templateId:null,currentSlug:"",currentKind:null,siteId:null,ready:v,token:w,tokenRef:I,notifyParent:h,runAuthed:_,docId:r,data:c,getLiveData:()=>c,error:null,redirecting:!1,saveStatus:Ae(p),saveState:p,autoSaveEnabled:!0,autoSaveStoppedByConflict:!1,hasUnsavedEdits:p.pending,toggleAutoSave:()=>{},retrySave:()=>{N.retryNow()},onChange:k,flushSave:C,onPublish:async e=>{const t=F(e);t&&await R(O,i.current,t)},bridgeCapabilities:ve,access:{kind:"editing"},readOnly:!1,takeOverEditing:()=>{},viewReadOnly:()=>{},saveConflict:null,reloadFromServer:()=>{},navigate:()=>{},pendingNav:null,cancelPendingNav:()=>{},discardAndNavigate:()=>{},saveAndNavigate:async()=>{}}),[r,v,w,h,_,c,p,k,C,N.retryNow]),J=l(()=>Ce(!A.readOnly),[A.readOnly]);return a===void 0?o("div",{className:"sf-msg",children:L("Loading…")}):a===null||!c?o("div",{className:"sf-msg sf-msg--error",children:L("Couldn’t open this section.")}):o(te.Provider,{value:A,children:o(X,{children:o(re,{themeMode:G,chromePlaceholder:!0,children:o(Pe,{wrap:m.chrome?.wrap,surface:"section",children:o(oe,{children:o(ie,{children:o(ne,{children:o(de,{children:o(se,{children:o(ae,{children:o(Ie,{config:z,data:c,onChange:k,permissions:J,children:o(De,{})},r)})})})})})})})})})})}export{xe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as wt}from"react/jsx-runtime";import{useCallback as o,useEffect as f,useMemo as Ct,useRef as g,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{useHostConfig as _t}from"../lib/document/host-config.js";import{ChromeWrap as Pt}from"efficient-easel/screen/lib/host-chrome";import{refreshSiteLiveState as Tt}from"../lib/site-live-state.js";import{holdSiteWrites as Et}from"../../format/lib/site-writes.js";import{backendOf as W}from"../lib/website-session.js";import{useEaselSession as yt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Gt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as vt}from"../../format/lib/document/templateFields.js";import{setEditorPage as he}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as kt}from"./EditorPagePathProvider.js";import{AddPageOnOpen as Ht}from"./AddPageOnOpen.js";import{resolveSiteName as Wt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Bt,normalizeSiteGutterPhone as Rt,normalizeSiteWidth as Ft}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as It}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as ue}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as le}from"../../format/lib/content/container-gap.js";import Dt,{DocumentScreen as bt}from"efficient-easel/screen/components/ScreenMount";import Ot from"./WebsiteHintsProvider.js";import{useScreenDocument as Mt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Nt,siteThemeRow as xt,themeEdited as Ut,themeSeeded as At}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as Lt}from"./PreviewFooterContext.js";import{PreviewChatProvider as zt,DEFAULT_CHAT_PREVIEW as Yt}from"./PreviewChatContext.js";import{PreviewSocialProvider as jt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Kt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Vt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Xt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Zt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as qt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Jt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Qt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as $t}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as er}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as tr,DEFAULT_HEADING_COMPRESSION as rr,DEFAULT_HEADING_TYPOGRAPHY as or,DEFAULT_SWITCH_SHOWN as B,DEFAULT_SIZES as nr,DEFAULT_THEME_MODE as T,normalizeCornerRadius as ir,normalizeCornerStyle as ar,normalizeCardShadow as cr,normalizeCardGap as sr,normalizeHoverEffect as dr,IDENTITY_CARD_GAP as me,IDENTITY_CARD_SHADOW as hr,IDENTITY_HOVER_EFFECT as ur,THEME_MODE_KEY as pe,THEME_STORAGE_KEY as lr,THEME_SWITCH_HIDE as Se,THEME_SWITCH_KEY as R}from"../../format/lib/theme.js";import{pictureShadowColor as mr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as pr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as Sr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as fr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as gr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as wr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as Cr}from"./PreviewChatContext.js";const _r=()=>{if(typeof window>"u")return T;try{const s=window.localStorage.getItem(pe);return s==="light"||s==="dark"||s==="auto"?s:T}catch{return T}},fe=s=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,s)}catch{}},Pr=()=>{if(typeof window>"u")return B;try{return window.localStorage.getItem(R)!==Se}catch{return B}},Tr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(lr)}catch{}},ge=s=>{if(!(typeof window>"u"))try{s?window.localStorage.removeItem(R):window.localStorage.setItem(R,Se)}catch{}};function Er(){const{adapter:s,capabilities:d,templateId:F,ready:_,token:h,siteId:c,currentSlug:I,currentKind:D}=Mt();f(()=>(he(I,D),()=>he(null,null)),[I,D]);const E=d.placeholderFrames,[we,b]=r(null),[Ce,O]=r("");f(()=>{const e=s.templateName;if(!_||!F||!e){O("");return}let i=!1;return e().then(u=>!i&&O(u??"")).catch(()=>{}),()=>{i=!0}},[_,h,F,s]);const[_e,y]=r(T),[Pe,G]=r(B),[M,N]=r({value:{selected:0,themes:[]},readFor:null}),Te=M.value,[Ee,x]=r(pr),[ye,U]=r(nr),[Ge,A]=r(null),[ve,L]=r(rr),[ke,z]=r(null),[He,Y]=r(null),[We,j]=r(me),[Be,K]=r(null),[Re,V]=r(null),[Fe,X]=r(null),[Ie,Z]=r(null),[v,q]=r(null),[k,J]=r(null),[De,Q]=r({}),be=o(e=>Q(i=>({...i,...e})),[]),l=yt(),$=_t(),Oe=Ct(()=>Gt(vt($,E),v,k),[$,E,v,k]),[Me,ee]=r(or),[Ne,te]=r(null),[xe,re]=r(null),[Ue,oe]=r(null),[Ae,ne]=r(null),[Le,ie]=r(null),ae=g(null),n=g(!1);f(()=>{y(_r()),G(Pr())},[]);const ze=o(e=>{n.current=!0,Tr(),fe(e),y(e)},[]),Ye=o(e=>{n.current=!0,ge(e),G(e)},[]),je=o(e=>{n.current=!0,N(i=>Ut(i,e,c??""))},[c]),Ke=o(e=>{n.current=!0,x(e)},[]),Ve=o(e=>{n.current=!0,U(e)},[]),Xe=o(e=>{n.current=!0,A(e)},[]),Ze=o(e=>{n.current=!0,L(e)},[]),qe=o(e=>{n.current=!0,z(e)},[]),Je=o(e=>{n.current=!0,Y(e)},[]),Qe=o(e=>{n.current=!0,j(e)},[]),$e=o(e=>{n.current=!0,K(e)},[]),et=o(e=>{n.current=!0,ee(e)},[]),[tt,ce]=r(null),[rt,ot]=r(null),nt=o(e=>{n.current=!0,ce(e)},[]),it=o(e=>{n.current=!0,V(e)},[]),at=o(e=>{n.current=!0,X(e)},[]),ct=o(e=>{n.current=!0,Z(e)},[]),st=o(e=>{n.current=!0,q(e)},[]),dt=o(e=>{n.current=!0,J(e)},[]),ht=o(e=>{n.current=!0,te(e)},[]),ut=o(e=>{n.current=!0,re(e)},[]),lt=o(e=>{n.current=!0,oe(e)},[]),mt=o(e=>{n.current=!0,ne(e)},[]),pt=o(e=>{n.current=!0,ie(e)},[]);f(()=>{const e=W(l).theme;if(!h||!d.hasSiteTheme||!e)return;const i=c??"";ae.current!==i&&(ae.current=i,n.current=!1);let u=!1;return e.get(c?{siteId:c}:void 0).then(t=>{if(u||n.current)return;fe(t.default_mode),ge(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),N(At({selected:t.selected_preset,themes:t.theme_presets},i));const C=gr(t);x(C.fonts),U(C.sizes);const S=It(t);Q(S),A(t.corner_radius_px===void 0?tr[ar(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,ir)),L(C.compression),z(t.card_shadow==null?hr:cr(t.card_shadow)),j(t.card_gap==null?me:sr(t.card_gap)),K(t.hover_effect==null?ur:dr(t.hover_effect)),Y(mr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,Ft)),X(w(t.site_gutter,S.siteGutterUnit,Bt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Rt)),q(w(t.block_gap,S.blockGapUnit,le)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,le)),ee(C.typography),ce(C.textStyles),ot(wr(t)),te(t.hero_background_follows_width===!0),re(ue(t.section_background_width)),oe(ue(t.section_content_width)),ne(t.photography_grayscale===!0),ie(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[h,c,d.hasSiteTheme,l]);const St=Kt({token:h,siteId:c,enabled:d.hasSiteSettings}),[ft,se]=r(Yt),de=g(null),H=g(!1),m=g(null),p=g({}),P=o(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await W(l).chat?.update(e,c?{siteId:c}:void 0),Tt()}catch(i){throw p.current={...e,...p.current},i}},[l,c]);f(()=>Et(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const gt=o(e=>{H.current=!0,se(i=>({...i,...e})),!(!d.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[d.hasSiteSettings,h,P]);return f(()=>{if(!h||!d.hasSiteSettings)return;const e=c??"";de.current!==e&&(de.current=e,H.current=!1);let i=!1;const u=W(l).chat;if(u)return u.get(c?{siteId:c}:void 0).then(t=>{i||H.current||se(Cr(t))}).catch(()=>{}),()=>{i=!0}},[h,c,d.hasSiteSettings,l]),f(()=>{const e=s.site;if(!_||!d.hasSiteRecord||!e){b(null);return}let i=!1;return e().then(u=>{i||b(Wt(u.name))}).catch(()=>{}),()=>{i=!0}},[_,h,d.hasSiteRecord,c,s]),a(bt,{config:Oe,parts:Sr,wrap:(e,i)=>a(Nt,{websiteName:we,templateChrome:E,templateName:Ce||null,themeMode:_e,onThemeModeChange:ze,themeSwitchShown:Pe,onThemeSwitchShownChange:Ye,theme:Te,themeRow:xt(d.hasSiteTheme,M.readFor,c??""),onThemeChange:je,fonts:Ee,onFontsChange:Ke,cornerRadiusPx:Ge,onCornerRadiusPxChange:Xe,cardShadow:ke,onCardShadowChange:qe,shadowColor:He,onShadowColorChange:Je,cardGap:We,onCardGapChange:Qe,hoverEffect:Be,onHoverEffectChange:$e,headingCompression:ve,onHeadingCompressionChange:Ze,headingTypography:Me,onHeadingTypographyChange:et,textStyles:tt,onTextStylesChange:nt,wordStyles:rt,sizes:ye,onSizesChange:Ve,siteWidth:Re,onSiteWidthChange:it,siteGutter:Fe,onSiteGutterChange:at,siteGutterPhone:Ie,onSiteGutterPhoneChange:ct,blockGap:v,onBlockGapChange:st,blockGapPhone:k,onBlockGapPhoneChange:dt,siteLengthUnits:De,onSiteLengthUnitsChange:be,heroBackgroundFollowsWidth:Ne,onHeroBackgroundFollowsWidthChange:ht,sectionBackgroundWidth:xe,onSectionBackgroundWidthChange:ut,sectionContentWidth:Ue,onSectionContentWidthChange:lt,photographyGrayscale:Ae,onPhotographyGrayscaleChange:mt,shareButtonOnPosts:Le,onShareButtonOnPostsChange:pt,themeFromDocument:!d.hasSiteTheme,children:a(Lt,{children:a(Pt,{wrap:l.chrome?.wrap,surface:"page",children:a(Zt,{children:a(qt,{children:a(Jt,{children:a($t,{children:a(Qt,{children:wt(er,{children:[a(zt,{chat:ft,onChatChange:gt,children:a(jt,{value:St,children:a(Vt,{children:a(kt,{children:a(Ot,{children:e})})})})}),i]})})})})})})})})})})}function yr({target:s,openAddPage:d}){return a(Ht,{open:d,children:a(Dt,{target:s,addressing:Xt,onHostMessage:fr,children:a(Er,{})})})}export{yr as default};
|
|
1
|
+
"use client";import{jsx as a,jsxs as wt}from"react/jsx-runtime";import{useCallback as o,useEffect as f,useMemo as Ct,useRef as g,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{useHostConfig as _t}from"../lib/document/host-config.js";import{ChromeWrap as Pt}from"efficient-easel/screen/lib/host-chrome";import{refreshSiteLiveState as Tt}from"../lib/site-live-state.js";import{holdSiteWrites as Et}from"../../format/lib/site-writes.js";import{backendOf as k}from"../lib/website-session.js";import{useEaselSession as yt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Gt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as vt}from"../../format/lib/document/templateFields.js";import{setEditorPage as he}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as Ht}from"./EditorPagePathProvider.js";import{AddPageOnOpen as Wt}from"./AddPageOnOpen.js";import{resolveSiteName as kt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Bt,normalizeSiteGutterPhone as Rt,normalizeSiteWidth as Ft}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as It}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as ue}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as le}from"../../format/lib/content/container-gap.js";import Dt,{DocumentScreen as Ot}from"efficient-easel/screen/components/ScreenMount";import Mt from"./WebsiteHintsProvider.js";import{useScreenDocument as bt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Nt,siteThemeRow as xt,themeEdited as Ut,themeSeeded as At}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as Lt}from"./PreviewFooterContext.js";import{PreviewChatProvider as zt,DEFAULT_CHAT_PREVIEW as Yt}from"./PreviewChatContext.js";import{PreviewSocialProvider as jt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Kt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Vt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Xt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Zt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as qt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Jt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Qt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as $t}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as er}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as tr,DEFAULT_HEADING_COMPRESSION as rr,DEFAULT_HEADING_TYPOGRAPHY as or,DEFAULT_SWITCH_SHOWN as B,DEFAULT_SIZES as nr,DEFAULT_THEME_MODE as T,normalizeCornerRadius as ir,normalizeCornerStyle as ar,normalizeCardShadow as cr,normalizeCardGap as sr,normalizeHoverEffect as dr,IDENTITY_CARD_GAP as me,IDENTITY_CARD_SHADOW as hr,IDENTITY_HOVER_EFFECT as ur,THEME_MODE_KEY as pe,THEME_STORAGE_KEY as lr,THEME_SWITCH_HIDE as Se,THEME_SWITCH_KEY as R}from"../../format/lib/theme.js";import{pictureShadowColor as mr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as pr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as Sr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as fr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as gr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as wr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as Cr}from"./PreviewChatContext.js";import{parseOption as _r}from"../../format/lib/parse-option.js";import{THEME_MODES as Pr}from"../../format/lib/theme.js";const Tr=()=>{if(typeof window>"u")return T;try{const d=window.localStorage.getItem(pe);return _r(Pr,T,d)}catch{return T}},fe=d=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,d)}catch{}},Er=()=>{if(typeof window>"u")return B;try{return window.localStorage.getItem(R)!==Se}catch{return B}},yr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(lr)}catch{}},ge=d=>{if(!(typeof window>"u"))try{d?window.localStorage.removeItem(R):window.localStorage.setItem(R,Se)}catch{}};function Gr(){const{adapter:d,capabilities:s,templateId:F,ready:_,token:h,siteId:c,currentSlug:I,currentKind:D}=bt();f(()=>(he(I,D),()=>he(null,null)),[I,D]);const E=s.placeholderFrames,[we,O]=r(null),[Ce,M]=r("");f(()=>{const e=d.templateName;if(!_||!F||!e){M("");return}let i=!1;return e().then(u=>!i&&M(u??"")).catch(()=>{}),()=>{i=!0}},[_,h,F,d]);const[_e,y]=r(T),[Pe,G]=r(B),[b,N]=r({value:{selected:0,themes:[]},readFor:null}),Te=b.value,[Ee,x]=r(pr),[ye,U]=r(nr),[Ge,A]=r(null),[ve,L]=r(rr),[He,z]=r(null),[We,Y]=r(null),[ke,j]=r(me),[Be,K]=r(null),[Re,V]=r(null),[Fe,X]=r(null),[Ie,Z]=r(null),[v,q]=r(null),[H,J]=r(null),[De,Q]=r({}),Oe=o(e=>Q(i=>({...i,...e})),[]),l=yt(),$=_t(),Me=Ct(()=>Gt(vt($,E),v,H),[$,E,v,H]),[be,ee]=r(or),[Ne,te]=r(null),[xe,re]=r(null),[Ue,oe]=r(null),[Ae,ne]=r(null),[Le,ie]=r(null),ae=g(null),n=g(!1);f(()=>{y(Tr()),G(Er())},[]);const ze=o(e=>{n.current=!0,yr(),fe(e),y(e)},[]),Ye=o(e=>{n.current=!0,ge(e),G(e)},[]),je=o(e=>{n.current=!0,N(i=>Ut(i,e,c??""))},[c]),Ke=o(e=>{n.current=!0,x(e)},[]),Ve=o(e=>{n.current=!0,U(e)},[]),Xe=o(e=>{n.current=!0,A(e)},[]),Ze=o(e=>{n.current=!0,L(e)},[]),qe=o(e=>{n.current=!0,z(e)},[]),Je=o(e=>{n.current=!0,Y(e)},[]),Qe=o(e=>{n.current=!0,j(e)},[]),$e=o(e=>{n.current=!0,K(e)},[]),et=o(e=>{n.current=!0,ee(e)},[]),[tt,ce]=r(null),[rt,ot]=r(null),nt=o(e=>{n.current=!0,ce(e)},[]),it=o(e=>{n.current=!0,V(e)},[]),at=o(e=>{n.current=!0,X(e)},[]),ct=o(e=>{n.current=!0,Z(e)},[]),st=o(e=>{n.current=!0,q(e)},[]),dt=o(e=>{n.current=!0,J(e)},[]),ht=o(e=>{n.current=!0,te(e)},[]),ut=o(e=>{n.current=!0,re(e)},[]),lt=o(e=>{n.current=!0,oe(e)},[]),mt=o(e=>{n.current=!0,ne(e)},[]),pt=o(e=>{n.current=!0,ie(e)},[]);f(()=>{const e=k(l).theme;if(!h||!s.hasSiteTheme||!e)return;const i=c??"";ae.current!==i&&(ae.current=i,n.current=!1);let u=!1;return e.get(c?{siteId:c}:void 0).then(t=>{if(u||n.current)return;fe(t.default_mode),ge(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),N(At({selected:t.selected_preset,themes:t.theme_presets},i));const C=gr(t);x(C.fonts),U(C.sizes);const S=It(t);Q(S),A(t.corner_radius_px===void 0?tr[ar(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,ir)),L(C.compression),z(t.card_shadow==null?hr:cr(t.card_shadow)),j(t.card_gap==null?me:sr(t.card_gap)),K(t.hover_effect==null?ur:dr(t.hover_effect)),Y(mr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,Ft)),X(w(t.site_gutter,S.siteGutterUnit,Bt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Rt)),q(w(t.block_gap,S.blockGapUnit,le)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,le)),ee(C.typography),ce(C.textStyles),ot(wr(t)),te(t.hero_background_follows_width===!0),re(ue(t.section_background_width)),oe(ue(t.section_content_width)),ne(t.photography_grayscale===!0),ie(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[h,c,s.hasSiteTheme,l]);const St=Kt({token:h,siteId:c,enabled:s.hasSiteSettings}),[ft,se]=r(Yt),de=g(null),W=g(!1),m=g(null),p=g({}),P=o(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(l).chat?.update(e,c?{siteId:c}:void 0),Tt()}catch(i){throw p.current={...e,...p.current},i}},[l,c]);f(()=>Et(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const gt=o(e=>{W.current=!0,se(i=>({...i,...e})),!(!s.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[s.hasSiteSettings,h,P]);return f(()=>{if(!h||!s.hasSiteSettings)return;const e=c??"";de.current!==e&&(de.current=e,W.current=!1);let i=!1;const u=k(l).chat;if(u)return u.get(c?{siteId:c}:void 0).then(t=>{i||W.current||se(Cr(t))}).catch(()=>{}),()=>{i=!0}},[h,c,s.hasSiteSettings,l]),f(()=>{const e=d.site;if(!_||!s.hasSiteRecord||!e){O(null);return}let i=!1;return e().then(u=>{i||O(kt(u.name))}).catch(()=>{}),()=>{i=!0}},[_,h,s.hasSiteRecord,c,d]),a(Ot,{config:Me,parts:Sr,wrap:(e,i)=>a(Nt,{websiteName:we,templateChrome:E,templateName:Ce||null,themeMode:_e,onThemeModeChange:ze,themeSwitchShown:Pe,onThemeSwitchShownChange:Ye,theme:Te,themeRow:xt(s.hasSiteTheme,b.readFor,c??""),onThemeChange:je,fonts:Ee,onFontsChange:Ke,cornerRadiusPx:Ge,onCornerRadiusPxChange:Xe,cardShadow:He,onCardShadowChange:qe,shadowColor:We,onShadowColorChange:Je,cardGap:ke,onCardGapChange:Qe,hoverEffect:Be,onHoverEffectChange:$e,headingCompression:ve,onHeadingCompressionChange:Ze,headingTypography:be,onHeadingTypographyChange:et,textStyles:tt,onTextStylesChange:nt,wordStyles:rt,sizes:ye,onSizesChange:Ve,siteWidth:Re,onSiteWidthChange:it,siteGutter:Fe,onSiteGutterChange:at,siteGutterPhone:Ie,onSiteGutterPhoneChange:ct,blockGap:v,onBlockGapChange:st,blockGapPhone:H,onBlockGapPhoneChange:dt,siteLengthUnits:De,onSiteLengthUnitsChange:Oe,heroBackgroundFollowsWidth:Ne,onHeroBackgroundFollowsWidthChange:ht,sectionBackgroundWidth:xe,onSectionBackgroundWidthChange:ut,sectionContentWidth:Ue,onSectionContentWidthChange:lt,photographyGrayscale:Ae,onPhotographyGrayscaleChange:mt,shareButtonOnPosts:Le,onShareButtonOnPostsChange:pt,themeFromDocument:!s.hasSiteTheme,children:a(Lt,{children:a(Pt,{wrap:l.chrome?.wrap,surface:"page",children:a(Zt,{children:a(qt,{children:a(Jt,{children:a($t,{children:a(Qt,{children:wt(er,{children:[a(zt,{chat:ft,onChatChange:gt,children:a(jt,{value:St,children:a(Vt,{children:a(Ht,{children:a(Mt,{children:e})})})})}),i]})})})})})})})})})})}function vr({target:d,openAddPage:s}){return a(Wt,{open:s,children:a(Dt,{target:d,addressing:Xt,onHostMessage:fr,children:a(Gr,{})})})}export{vr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as w,jsxs as k}from"react/jsx-runtime";import{useId as E,useMemo as S}from"react";import{useEasel as _}from"efficient-easel/easel";import{SettingsField as g,SettingsSwitch as x}from"efficient-easel/panel";import{EyeIcon as b}from"efficient-easel/icons";import{fieldShownInView as y}from"efficient-easel/fields";import{usePreviewDevice as R}from"efficient-easel/draw/client";import{
|
|
1
|
+
"use client";import{jsx as t,Fragment as w,jsxs as k}from"react/jsx-runtime";import{useId as E,useMemo as S}from"react";import{useEasel as _}from"efficient-easel/easel";import{SettingsField as g,SettingsSwitch as x}from"efficient-easel/panel";import{EyeIcon as b}from"efficient-easel/icons";import{fieldShownInView as y}from"efficient-easel/fields";import{usePreviewDevice as R}from"efficient-easel/draw/client";import{ROOT_ZONE as O}from"efficient-easel/draw";import{DEFAULT_TICKER_ITEMS as C}from"../../format/lib/hero-ticker.js";import{TextListField as F,TICKER_ITEMS_ROW as a}from"../lib/document/controls.js";import{say as p}from"../../format/lib/editor-words.js";import{SiteFields as A}from"./SiteFields.js";import{usePartMotion as L}from"./usePartMotion.js";import{TICKER_MOTION_PART as M}from"../../format/lib/hero-ticker.js";import{TICKER_PANEL_ROWS as N}from"../lib/document/part-panel-rows.js";import{SameInEveryViewNote as P}from"./SameInEveryViewNote.js";function j({heroId:s}){const{appState:l,dispatch:d}=_(e=>e),n=l.data.content??[],i=n.findIndex(e=>e.props.id===s),o=i>=0?n[i]:null,f=o?o.props.showTicker??!0:!0,h=S(()=>{const e=o?.props.tickerItems;return Array.isArray(e)?e:C.map(I=>({text:I}))},[o]),m=E(),T=R(),r=e=>y(N[e],T),u=L(s,M,"block");if(!o)return t("p",{className:"sf-note",children:p("This ticker’s hero is no longer on the page.")});const c=e=>d({type:"replace",destinationZone:O,destinationIndex:i,data:{...o,props:{...o.props,...e}}});return t(A,{motion:u,body:k(w,{children:[!r("showTicker")&&!r("items")&&t(P,{}),r("showTicker")&&t(g,{label:p("Show ticker"),labelId:m,icon:t(b,{}),action:t(x,{checked:f,onChange:e=>c({showTicker:e}),ariaLabelledBy:m})}),r("items")&&t(F,{label:a.label,icon:a.icon,items:h,placeholder:"item",onChange:e=>c({tickerItems:e}),markup:!0})]})})}export{j as default};
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
* sheet, or the shell's tokens resolve to nothing.
|
|
29
29
|
*
|
|
30
30
|
* NO COLOUR LITERAL AND NO LITERAL RADIUS IN A CHROME RULE
|
|
31
|
-
* (`
|
|
31
|
+
* (`pnpm run test:own-ui`: the ui-check counts every literal colour, radius,
|
|
32
|
+
* size and face in this sheet, and its baseline only goes down). Two regions are not chrome and are
|
|
32
33
|
* marked `@tokens canvas-begin/end` and `@tokens output-begin/end`: rules that
|
|
33
34
|
* paint inside the canvas frame (the website being edited, where no token is
|
|
34
35
|
* defined), and the section covers' palette (a miniature of a section, output).
|
|
@@ -329,7 +330,7 @@
|
|
|
329
330
|
the admin's catalog; it is not chrome and does not follow the shell theme,
|
|
330
331
|
exactly as the canvas paper stays white (UI-24 leaves rendered output its own
|
|
331
332
|
look). The card around a cover is easel's `.es-add-*` chrome, on shell tokens.
|
|
332
|
-
|
|
333
|
+
Its literal colours are held in `ui-kit.baseline.json`. */
|
|
333
334
|
.sf-thumb {
|
|
334
335
|
--sf-thumb-card: #ffffff;
|
|
335
336
|
--sf-thumb-thumb-bg: #fcfdff;
|
|
@@ -511,8 +512,8 @@
|
|
|
511
512
|
INSIDE the canvas frame, on the website being edited: that document has no
|
|
512
513
|
`.es-editor` root, so no shell or `--es-*` token is defined there, and each
|
|
513
514
|
colour carries its own fallback (see the note at B below). Harness UI-24
|
|
514
|
-
leaves the canvas to the page;
|
|
515
|
-
|
|
515
|
+
leaves the canvas to the page; its literal colours are held in
|
|
516
|
+
`ui-kit.baseline.json`. */
|
|
516
517
|
|
|
517
518
|
/* ── One dashed outline on hover, not a field of them (card 66395) ─────────
|
|
518
519
|
The owner, 2026-09-01: hovering a section shows too many dashed lines. He
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useEffect as b,useMemo as w,useRef as k}from"react";import{useEasel as
|
|
1
|
+
"use client";import{useEffect as b,useMemo as w,useRef as k}from"react";import{useEasel as E}from"efficient-easel/easel";import{newId as O}from"efficient-easel/data";import{useEaselHost as P}from"efficient-easel/screen/lib/host";import{applyPageEdits as B,describeBlocks as C,describeSelection as H}from"../lib/host-document-bridge.js";import{nonEmptyString as J}from"../../format/lib/non-empty-string.js";import{activePressContext as N}from"../../format/lib/sections/active-press-context.js";const p=t=>J(t.requestId)??null;function U(){const t=P(),{appState:n,selectedItem:I,dispatch:l,history:f,config:S}=E(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(()=>H(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:m,history:u,blockConfig:y}=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(y)});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(y,d.data,r,O,N()):{ok:!1,reason:"no changes"};o.ok&&(m({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"&&m({type:"setUi",ui:{rightSideBarVisible:s.shown}});return;default:return}}),[t])}export{U as useHostDocumentBridge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as A,FOOTPRINT_LIST_COLUMNS as C,FOOTPRINT_LIST_COLUMNS_DEFAULT as g,FOOTPRINT_MAP_HEIGHT_DEFAULT as F,FOOTPRINT_MAP_HEIGHT_FULL as v,FOOTPRINT_MAP_HEIGHT_KEY as N,FOOTPRINT_SHOWS_DEFAULT as i,FOOTPRINT_SHOWS_KEY as r}from"../../../../../../format/lib/content/footprint.js";import{ColumnsIcon as w,HeadquartersIcon as D,HeightIcon as M,LayoutIcon as k,LocationIcon as x,MapIcon as B,SearchIcon as U,ThemeIcon as G}from"efficient-easel/icons";import{CoordsField as W,copyText as K,plainText as a,sourceField as j,text as f,textarea as I,toggle as d,withPanelOnly as L}from"../../../controls.js";import{group as u}from"efficient-easel/screen/lib/document/box-fields";import{segmented as n}from"../../../box-fields.js";import{withShowWhen as t}from"../../../../../../render/lib/document/show-when.js";import{needsGeocodeWork as q,resolveGeocodeRows as Y}from"../../../geocode-resolve.js";import{deviceField as s}from"efficient-easel/screen/lib/document/device-fields";import{SPLITTABLE_SECTIONS as Q,headFieldsForPlacement as z}from"../../../../../../format/lib/sections/section-head-placement.js";import{BLOCK_SOURCE_PROP as m,DEALERS_SOURCE as J,registerBlockSources as V}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as X,blockSourceFields as Z}from"../../../block-source-fields.js";import{DEALERS_BLOCK_SOURCE as $}from"../../../../../../render/lib/dealer-source.js";import{FOOTPRINT_PH as S,FootprintSlots as ee}from"../../../../../../format/lib/document/blocks/general/Footprint/meta.js";import{withFootprintListTemplate as oe}from"../../../../../../format/lib/document/blocks/general/Footprint/card-seed.js";const P={field:m,is:J,default:""},h={field:r,is:i,default:i},te={field:r,is:"list",default:i},le={field:r,is:"map",default:i},b={all:[h,{field:"listPosition",in:["left","right"],default:"below"}]},y={any:[{all:[P,{not:le}]},b]},ie={any:[{all:[h,{field:"listPosition",is:"below",default:"below"}]},te]},E={all:[y,{field:"search",is:!0,default:!1}]};V([$]);const ge={fields:{_gContent:u("Section"),sectionNumber:f("Section number",S.sectionNumber),heading:I("Heading",S.heading),tagline:I("Body",S.tagline),_gOffices:u("Offices"),[m]:X("Office content","Manual"),offices:{type:"array",label:"Offices",arrayFields:{role:a("Role"),city:a("City"),country:a("Region · country"),address:K("Address"),phone:a("Phone"),group:a("Group"),hq:d("HQ",!1,o(D,{})),geocode:j(W,{label:"Coordinates"})},defaultItemProps:{role:"Sales & Distribution",city:"City",country:"Country",address:"",phone:"",group:"",hq:!1,lat:0,lng:0},getItemSummary:e=>e?.city||"Office"},...ee,[r]:n("Shows",o(B,{}),[{label:"Map and list",value:i},{label:"Map only",value:"map"},{label:"List only",value:"list"}],i),mapTheme:n("Map theme",o(G,{}),[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],A.mapTheme),_gList:u("List"),listPosition:s("desktop",t(n("Position",o(k,{}),[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Below",value:"below"}],"below"),h)),listColumns:s("desktop",t(n("Columns",o(w,{}),[{label:"Auto",value:g},...C.map(e=>({label:String(e),value:String(e)}))],g),ie)),[N]:s("desktop",t(n("Map height",o(M,{}),[{label:"Fixed",value:F},{label:"Full height",value:v}],F),b)),search:s("desktop",t(d("Search",!1,o(U,{})),y)),searchHint:s("desktop",t(L(f("Hint","Type a postcode or address")),E)),noMatchText:s("desktop",t(L(f("No match","No place found. Try another postcode.")),E)),showDistance:t(d("Distance",!0,o(x,{})),P)},resolveData:async(e,c)=>{const p=c?.changed,T=e.props;if(p?.listPosition===!0||p?.[r]===!0||p?.[m]===!0){const l=oe(T);l!==T&&(e={...e,props:l})}const O=e.props,_=O.offices??[];if(!q(_))return e;const R=await Y(_,l=>[l.address,l.city,l.country].map(H=>String(H??"").replace(/\*/g,"").trim()).filter(Boolean).join(", "));return{...e,props:{...O,offices:R}}},resolveFields:(e,{fields:c})=>z(Z("Footprint",c,e.props,{hides:["offices"]}),e.props.headPlacement,Q.Footprint.headRows)};export{ge as FootprintFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{REEL_PLACEMENT_DEFAULT as d,REEL_SHAPE_DEFAULT as m,HERO_REEL_SHAPES as R,REEL_SHAPE_LABELS as A,REEL_SHOWN_DEFAULT as O}from"../../../../../../format/lib/reel.js";import{HERO_TEXTURE_SHOWN_DEFAULT as P}from"../../../../../../format/lib/hero-texture.js";import{HERO_ARROW_SHAPE_DEFAULT as H,HERO_ARROW_SHAPE_LABELS as L,HERO_ARROW_SHAPES as h,HERO_ARROWS_PLACEMENT_DEFAULT as u,HERO_ARROWS_SHOWN_DEFAULT as w}from"../../../../../../format/lib/hero-arrows.js";import{ClockIcon as T,EyeIcon as t,OpacityIcon as I,PhoneIcon as n,PlayIcon as W,SlideArrowsBareIcon as D,SlideArrowsRoundIcon as f,SlideArrowsSquareIcon as k,SlidePickerBarIcon as U,SlidePickerCardsIcon as g,SlidePickerDotsIcon as y,SlidePickerNumbersIcon as F,SlidePickerSquaresIcon as N,SquareIcon as p}from"efficient-easel/icons";import{SlideArrowsRoundSolidIcon as x}from"efficient-shell/icons/efficient-looks";const b=x,C={cards:o(g,{}),dots:o(y,{}),numbers:o(F,{}),bar:o(U,{}),squares:o(N,{})},B={outline:o(f,{}),solid:o(b,{}),square:o(k,{}),bare:o(D,{})};import{toggle as i}from"../../../controls.js";import{HERO_PHONE_WORDS_ROWS as s,HERO_TEXTURE_COLOR_ROW as q,heroHeightFields as j}from"../../hero-shared-fields.js";import{group as e}from"efficient-easel/screen/lib/document/box-fields";import{alignmentField as G,iconPickerRow as l,placementField as _,segmented as c,slider as S}from"../../../box-fields.js";import{deviceField as E,deviceNote as M}from"efficient-easel/screen/lib/document/device-fields";import{HERO_PHONE_SIDEWAYS_DEFAULT as X,HERO_PHONE_SIDEWAYS_LABEL as Y,HERO_PHONE_UPDOWN_DEFAULT as v,HERO_PHONE_UPDOWN_LABEL as K,phoneSidewaysPoints as z,phoneUpDownPoints as J}from"../../../../../../format/lib/hero-phone-stack.js";import{HeroSlots as a}from"../../../../../../format/lib/document/blocks/general/Hero/meta.js";const lo={fields:{_dDevice:M(),_gContent:e("Content"),slides:a.slides,strip:a.strip,_gStyle:e("Style"),alignment:G(),_gTexture:e("Texture"),showTexture:i("Show texture",P,o(t,{})),textureColor:q,textureOpacity:S("Texture opacity",o(I,{}),0,100,1,40,"%"),_gLayout:e("Layout"),...j(),_gAutoplay:e("Auto-slide"),autoplay:i("Auto-advance slides",!1,o(W,{})),autoplayInterval:S("Still time per slide",o(T,{}),2,15,1,6,"s"),_gPicker:e("Slide picker"),showPicker:i("Show slide picker",O,o(t,{})),pickerShape:l("Slide picker shape",o(p,{}),R.map(r=>({label:A[r],value:r,picture:C[r]})),m),pickerPlacement:_("Slide picker placement",{fallback:d}),_gArrows:e("Arrows"),showArrows:i("Show arrows",w,o(t,{})),arrowsShape:l("Arrows shape",o(p,{}),h.map(r=>({label:L[r],value:r,picture:B[r]})),H),arrowsPlacement:_("Arrows placement",{fallback:u}),_gPhone:E("mobile",e("On a phone")),phoneUpDown:E("mobile",c(K,o(n,{}),J(),v)),phoneSideways:E("mobile",c(Y,o(n,{}),z(),X)),phoneWordsTop:s.phoneWordsTop,phoneWordsBottom:s.phoneWordsBottom,phoneBoxGap:s.phoneBoxGap}};export{lo as HeroFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{MediaIcon as E,OpacityIcon as s}from"efficient-easel/icons";import{MEDIA_TYPE_OPTIONS as y,upload as a}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{segmented as u,slider as S}from"../../../box-fields.js";import{deviceField as c,deviceNote as R}from"efficient-easel/screen/lib/document/device-fields";import{HERO_IMAGE2_ROWS as g,HERO_IMAGE_ROWS as v,heroTintColorRow as f,HERO_LAYOUT_ROWS as l,HERO_IMAGE2_KEYS as d,HERO_IMAGE_KEYS as H,HERO_LAYOUT_KEYS as I,heroLayoutRules as T,heroTintRow as h,HERO_OVERLAY_ROWS as m,HERO_PHONE_WORDS_ROWS as i,HERO_VIDEO_ROWS as r,heroHeightFields as L}from"../../hero-shared-fields.js";import{slotNoticeField as b}from"../../shared-fields.js";import{mediaTypeShownWhen as p,heroMediaFields as P,VIDEO_FILE_LABEL as A,VIDEO_FILE_PROMPT as M}from"../../../../../../render/lib/document/hero-media-parts.js";import{HERO_ABSENT_MEDIA_TYPE as e}from"../../../../../../format/lib/hero-media-layout.js";import{VIDEO_SOURCE_DEFAULT as _}from"../../../../../../format/lib/hero-video.js";const n=p("video",e.HeroSingle),W=p("image",e.HeroSingle);import{HeroSingleSlots as D}from"../../../../../../format/lib/document/blocks/general/HeroSingle/meta.js";const O=[...H,"tintColor","tintOpacity"],j={fields:P({_dDevice:R(),boxNotice:b("HeroSingle"),boxes:D.boxes,_gStyle:o("Style"),overlay:S("Overlay",t(s,{}),0,100,5,100,"%"),overlayColor:m.overlayColor,overlayPosition:m.overlayPosition,_gLayout:o("Layout"),...L({tabletNumber:!1}),_gPhone:c("mobile",o("On a phone")),phoneWordsTop:i.phoneWordsTop,phoneWordsBottom:i.phoneWordsBottom,phoneBoxGap:i.phoneBoxGap,_gMedia:o("Media"),mediaType:u("Type",t(E,{}),y,e.HeroSingle),mediaLayout:l.mediaLayout,mediaLayoutPhone:l.mediaLayoutPhone,...v,videoSource:r.videoSource,mediaVideo:a(A,"video/*",M),youtubeUrl:r.youtubeUrl,videoPlayback:r.videoPlayback,poster:a("Video poster","image/*","Upload a poster still"),_gTint:o("Image tint"),tintColor:f(),tintOpacity:h(),...g},{parts:{media:["mediaType",...I,"videoSource","mediaVideo","youtubeUrl","videoPlayback","poster"],image:O,image2:d},onlyFor:{image:[...O,"_gTint",...d],video:["videoSource","videoPlayback","poster"]},rules:{mediaVideo:{all:[n,{field:"videoSource",is:"upload",default:_}]},youtubeUrl:{all:[n,{field:"videoSource",is:"youtube",default:_}]},...T(W)},fallback:e.HeroSingle})};export{j as HeroSingleFields};
|
|
@@ -60,4 +60,9 @@ export declare const HERO_VIDEO_ROWS: {
|
|
|
60
60
|
youtubeUrl: CustomField<import("efficient-easel/draw").HidableValue>;
|
|
61
61
|
videoPlayback: BoxField<string>;
|
|
62
62
|
};
|
|
63
|
+
export declare const HERO_PHONE_WORDS_ROWS: {
|
|
64
|
+
phoneWordsTop: BoxField<number>;
|
|
65
|
+
phoneWordsBottom: BoxField<number>;
|
|
66
|
+
phoneBoxGap: BoxField<number>;
|
|
67
|
+
};
|
|
63
68
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i,jsxs as
|
|
1
|
+
import{jsx as i,jsxs as ee,Fragment as oe}from"react/jsx-runtime";import{HeightIcon as te,ImageIcon as ie,ImagesIcon as ne,OpacityIcon as re,MediaLayoutSideBySideIcon as le,MediaLayoutStackedIcon as ae,GapIcon as de,PaddingBottomIcon as se,PaddingTopIcon as he,PlacementIcon as w,PlayIcon as ce,UploadIcon as ue}from"efficient-easel/icons";import{viewFocusKeys as F}from"../../../../format/lib/content/picture-focus-rows.js";import{HERO_FOCUS as p,MEDIA_LAYOUT_DEFAULT as pe,MEDIA_LAYOUT_LABELS as Oe,MEDIA_LAYOUTS as _e,resolvePhoneLayout as me}from"../../../../format/lib/hero-media-layout.js";import{useEasel as Ee,useSelectedHost as ge}from"efficient-easel/easel";import{SettingsDefaultReset as fe,SettingsField as be,SettingsSegmented as Re}from"efficient-easel/panel";import{describedAs as Te,FLAT_ACCESS as Se,iconOf as xe,onDesktopWords as ve,phoneTwinFields as b,useAccessPatch as ye}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as R}from"efficient-easel/screen/lib/document/style-fields";import{deviceField as T}from"efficient-easel/screen/lib/document/device-fields";import{HERO_PHONE_BOX_GAP_DEFAULT as k,HERO_PHONE_BOX_GAP_LABEL as He,HERO_PHONE_WORDS_BOTTOM_DEFAULT as U,HERO_PHONE_WORDS_BOTTOM_LABEL as Ae,HERO_PHONE_WORDS_MAX as S,HERO_PHONE_WORDS_MIN as x,HERO_PHONE_WORDS_TOP_DEFAULT as M,HERO_PHONE_WORDS_TOP_LABEL as Le}from"../../../../format/lib/hero-phone-stack.js";import{colorInput as W,edgePad as B,focusKeptField as Ie,plainText as Pe,Slider as Y,upload as Ce,useSelectedSibling as v}from"../controls.js";import{ColourRow as De,InheritedColourRow as we}from"../ColourControl.js";import{rowSay as Fe,segmented as y,slider as m}from"../box-fields.js";import{CUSTOM_SHAPE as ke,SHAPE_TABLE as Ue}from"../../../../format/lib/content/gallery-card-layout.js";import{ShapePicker as Me}from"../shape-picker.js";import{HERO_FIXED_DEFAULT as We,HERO_HEIGHT_PX as H,readHeroFixedHeight as Be,SECTION_HEIGHT as c}from"../../../../format/lib/content/section-height.js";import{DEFAULT_TINT as A}from"../../../../format/lib/content/tint.js";import{editorEaselWords as Ye,say as a}from"../../../../format/lib/editor-words.js";import{nonEmptyString as L}from"../../../../format/lib/non-empty-string.js";import{findParentNode as Ne}from"../../../../format/lib/document/passes/document-position.js";import{DEFAULT_OVERLAY_POSITION as N,OVERLAY_POSITION_OPTIONS as V,slideOverlayState as G}from"../../../../format/lib/sections/hero-overlay.js";import{VIDEO_PLAYBACK_DEFAULT as Ve,VIDEO_PLAYBACK_LABELS as Ge,VIDEO_PLAYBACKS as Ke,VIDEO_SOURCE_DEFAULT as je,VIDEO_SOURCE_LABELS as Xe,VIDEO_SOURCES as $e}from"../../../../format/lib/hero-video.js";function qe(){return Ue.filter(e=>e.ratio!==null||e.shape===ke)}const I={desktop:{number:"heightDesktop",fixed:"heightFixed"},tablet:{number:"heightTablet",fixed:"heightFixedTablet"},mobile:{number:"heightMobile",fixed:"heightFixedMobile"}},K={read:e=>e.heightMobile,write:(e,o,t)=>({heightMobile:t}),fieldKey:()=>"heightMobile",ownField:!0,tablet:{read:e=>e.heightTablet,write:(e,o,t)=>({heightTablet:t}),fieldKey:()=>"heightTablet",ownField:!0}};function j(e,{number:o,fixed:t}){const r=o===void 0?void 0:e[o];return Be(e[t])??(typeof r=="number"?{unit:"vh",vh:r}:null)}const ze="On Tablet, this hero uses the Desktop vh. Set vh in the Desktop view.";function Je({view:e,keys:o,props:t}){const r=ge(),d=ye(Se),{number:s}=o,O={...r?.values??{},...s?{[s]:t.value}:{}},g=j(O,o),n=e==="tablet"?j(O,I.desktop):null,h=g??n??{unit:"vh",vh:c.fallback},u=t.readOnly===!0,P=qe(),Q=l=>{if(l===h.unit)return;if(l!=="vh"){d([[o.fixed,n?.unit===l?n.value:We[l]]]);return}const Z=s!==void 0&&typeof O[s]!="number"&&n!==null&&n.unit!=="vh";d([[o.fixed,void 0],...Z?[[s,c.fallback]]:[]])},_=g===null&&e!=="desktop",f=s===void 0,C=f&&n!==null&&n.unit!=="vh",D=n===null?`${c.fallback} ${c.unit}`:n.unit==="vh"?`${n.vh} ${c.unit}`:n.unit==="px"?n.value:P.find(l=>l.image===n.value)?.label??n.value;return i(be,{label:a("Height"),icon:xe(i(te,{})),hint:f&&(h.unit==="vh"||C)?a(ze):void 0,action:e==="desktop"?void 0:i(fe,{words:Ye()?.panel,label:a("Height"),changed:g!==null||!!O[o.fixed],detail:e==="tablet"?ve(Fe,D):D,disabled:u,onReset:()=>d([...s?[[s,void 0]]:[],[o.fixed,void 0]])}),children:ee("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-8)",flex:"1 1 auto",minWidth:0},children:[i(Re,{options:[{id:"vh",label:a("vh"),disabled:C},{id:"ratio",label:a("Ratio")},{id:"px",label:a("px")}],value:h.unit,onChange:Q,ariaLabel:a("Unit"),disabled:u}),h.unit==="ratio"?i(Me,{label:"Height",lines:P,column:"image",value:h.value,disabled:u,onChange:l=>d([[o.fixed,l]])}):h.unit==="px"?Y({...H,value:_?null:h.px,..._?{placeholder:h.px}:{},suffix:H.unit,ariaLabel:"Height",disabled:u,onChange:l=>d([[o.fixed,`${l}${H.unit}`]])}):Y({min:c.min,max:c.max,step:c.step,value:_?null:h.vh,..._?{placeholder:h.vh}:{},suffix:c.unit,ariaLabel:"Height",disabled:u||f,onChange:l=>t.onChange(l)})]})})}const E=(e,o=I[e])=>({type:"custom",...Te({},{type:"number",label:"Height"}),render:t=>i(Je,{view:e,keys:o,props:t})}),Qe={read:e=>e.heightFixedTablet,write:(e,o,t)=>({heightFixedTablet:t}),fieldKey:()=>"heightFixedTablet",ownField:!0};function Fo({tabletNumber:e=!0}={}){const o=e?K:{...K,tablet:Qe},t=E("tablet",e?void 0:{fixed:I.tablet.fixed}),r=b("heightDesktop",E("desktop"),o,{phoneRow:t}),d=b("heightDesktop",E("desktop"),o,{phoneRow:E("mobile")});return{heightDesktop:r.heightDesktop,...e?{heightTablet:r.heightTablet,heightFixedTablet:R("heightTablet")}:{heightFixedTablet:r.heightFixedTablet},heightMobile:d.heightMobile,heightFixed:R("heightDesktop"),heightFixedMobile:R("heightMobile")}}const ko={overlayColor:W("Overlay color",A),overlayPosition:B("Overlay position",V,N,"A corner would need a diagonal ramp, which this overlay does not draw.",i(w,{}))},X="Texture",$=e=>B("Overlay position",V,e,"A corner would need a diagonal ramp, which this overlay does not draw.",i(w,{}),void 0,X);function Ze(){try{const{appState:e,selectedItem:o}=Ee(t=>t);return eo(e,o?.props?.id)}catch{return}}function eo(e,o){return L(Ne(e,o)?.props?.textureColor)}function oo({value:e,onChange:o}){const[t]=v("overlayPosition"),r=Ze(),d=L(e)??"",s=G({overlayColor:d,overlayPosition:t},r);return i(we,{label:a("Overlay color"),value:d,inherited:s.color,resetTo:a(X),onChange:o,onReset:()=>o("")})}const to=$(N),io=$("");function no(e){const[o]=v("overlayColor"),t=G({overlayColor:o,overlayPosition:e.value}).own?to:io;return i(oe,{children:t.render(e)})}function ro(e){if(!Array.isArray(e))return;const o=e.flatMap((t,r)=>L(t?.props?.overlayColor)?[r+1]:[]);if(o.length!==0)return o.length===1?a("Slide {n}: own Overlay color.",{n:o[0]}):a("Slides {n}: own Overlay color.",{n:o.join(", ")})}function lo({value:e,onChange:o}){const[t]=v("slides");return i(De,{label:a("Texture color"),value:e||A,onChange:o,hint:ro(t)})}const Uo={type:"custom",render:({value:e,onChange:o})=>i(lo,{value:e,onChange:o})},Mo={overlayColor:{type:"custom",render:({value:e,onChange:o})=>i(oo,{value:e,onChange:o})},overlayPosition:{type:"custom",render:({value:e,onChange:o})=>i(no,{value:e,onChange:o})}},ao={one:i(ie,{}),side:i(le,{}),stacked:i(ae,{})},q=e=>y("Layout",i(ne,{}),_e.map(o=>({label:Oe[o],value:o,picture:ao[o]})),pe,e?{phoneRest:o=>me(void 0,o)}:void 0),so={mediaLayout:q(),mediaLayoutPhone:b("mediaLayout",q(!0)).mediaLayoutPhone},ho=()=>m("Tint",i(re,{}),0,100,5,0,"%"),z=e=>Object.fromEntries(F(e).map(o=>[o,Ie()])),J=e=>Ce("Background image","image/*","Upload a background image",{focus:e}),co=()=>W("Tint color",A),Wo={mediaImage:J(p.image),...z(p.image)},uo={mediaImage2:J(p.image2),...z(p.image2),tintColor2:co(),tintOpacity2:ho()},Bo=Object.keys(so),Yo=Object.keys(uo),No=["mediaImage",...F(p.image)],Vo=e=>({mediaLayout:{all:[e,{not:{context:"device",is:"mobile"}}]},mediaLayoutPhone:{all:[e,{context:"device",is:"mobile"}]}}),Go={videoSource:y("Source",i(ue,{}),$e.map(e=>({label:Xe[e],value:e})),je),youtubeUrl:Pe("YouTube link","https://youtu.be/…"),videoPlayback:y("Playback",i(ce,{}),Ke.map(e=>({label:Ge[e],value:e})),Ve)},Ko={phoneWordsTop:T("mobile",m(Le,i(he,{}),x,S,1,M,{kind:"spacing"},{clear:{hint:M}})),phoneWordsBottom:T("mobile",m(Ae,i(se,{}),x,S,1,U,{kind:"spacing"},{clear:{hint:U}})),phoneBoxGap:T("mobile",m(He,i(de,{}),x,S,1,k,{kind:"spacing"},{clear:{hint:k}}))};export{Yo as HERO_IMAGE2_KEYS,uo as HERO_IMAGE2_ROWS,No as HERO_IMAGE_KEYS,Wo as HERO_IMAGE_ROWS,Bo as HERO_LAYOUT_KEYS,so as HERO_LAYOUT_ROWS,ko as HERO_OVERLAY_ROWS,Ko as HERO_PHONE_WORDS_ROWS,Mo as HERO_SLIDE_OVERLAY_ROWS,ze as HERO_TABLET_VH_HINT,Uo as HERO_TEXTURE_COLOR_ROW,Go as HERO_VIDEO_ROWS,Fo as heroHeightFields,Vo as heroLayoutRules,qe as heroRatioLines,co as heroTintColorRow,ho as heroTintRow,ro as textureColorHint,eo as textureColorOfSlide};
|
|
@@ -298,6 +298,7 @@ export declare function stickFields(opts?: {
|
|
|
298
298
|
type StickNumberKey = "stickTopDistance" | typeof SECTION_PIN_SCREENS_KEY;
|
|
299
299
|
export declare function followedStickPatch(view: PanelView, props: Record<string, unknown>, next: unknown, base?: StickNumberKey, intro?: boolean): Record<string, unknown> | null;
|
|
300
300
|
export declare function anchorFields(): Record<string, CustomField<undefined> | CustomField<HidableValue>>;
|
|
301
|
+
export declare function customCssFields(): Record<string, CustomField<undefined> | CustomField<string>>;
|
|
301
302
|
export declare function dateTime(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
|
|
302
303
|
export declare function date(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
|
|
303
304
|
export declare function toggle(label: string, fallback: boolean, icon?: ReactNode, hint?: string): CustomField<boolean>;
|