efficient-web-builder 55.3.0 → 56.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/dist/editor/components/BlockGapField.d.ts +1 -2
- package/dist/editor/components/BlockGapField.js +1 -1
- package/dist/editor/components/CardShadowField.d.ts +1 -2
- package/dist/editor/components/CardShadowField.js +1 -1
- package/dist/editor/components/ChatSettingsPanel.js +1 -1
- package/dist/editor/components/CornersField.d.ts +1 -2
- package/dist/editor/components/CornersField.js +1 -1
- package/dist/editor/components/HoverEffectField.d.ts +1 -2
- package/dist/editor/components/HoverEffectField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PhotographyField.d.ts +1 -2
- package/dist/editor/components/PhotographyField.js +1 -1
- package/dist/editor/components/SectionEditor.js +1 -1
- package/dist/editor/components/SectionThumbnail.js +1 -1
- package/dist/editor/components/ShadowColourField.d.ts +1 -2
- package/dist/editor/components/ShadowColourField.js +1 -1
- package/dist/editor/components/ShareButtonField.d.ts +1 -2
- package/dist/editor/components/ShareButtonField.js +1 -1
- package/dist/editor/components/SideSpaceField.d.ts +1 -2
- package/dist/editor/components/SideSpaceField.js +1 -1
- package/dist/editor/components/SocialLinksPanel.js +1 -1
- package/dist/editor/components/SourceStatus.d.ts +2 -1
- package/dist/editor/components/SourceStatus.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/StylesPanel.js +1 -1
- package/dist/editor/components/WebsiteHintsProvider.d.ts +8 -0
- package/dist/editor/components/WebsiteHintsProvider.js +1 -0
- package/dist/editor/components/WebsiteSettingsPanel.d.ts +6 -17
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +35 -34
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/controls.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/content/box-layout.d.ts +5 -3
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/cell-picture-sizes.d.ts +31 -0
- package/dist/format/lib/content/cell-picture-sizes.js +1 -0
- package/dist/format/lib/content/image-aspect.d.ts +1 -0
- package/dist/format/lib/content/image-aspect.js +1 -1
- package/dist/format/lib/content/mirror-cards.d.ts +1 -1
- package/dist/format/lib/content/mirror-cards.js +1 -1
- package/dist/format/lib/document/article-body-seed.d.ts +10 -0
- package/dist/format/lib/document/article-body-seed.js +1 -0
- package/dist/format/lib/document/blocks/general/Timeline/meta.d.ts +2 -1
- package/dist/format/lib/document/blocks/general/Timeline/meta.js +2 -2
- package/dist/format/lib/document/blocks/placeholders.d.ts +1 -0
- package/dist/format/lib/document/blocks/placeholders.js +1 -1
- package/dist/format/lib/document/easel-row-words.d.ts +1 -1
- package/dist/format/lib/document/easel-row-words.js +1 -1
- package/dist/format/lib/document/section-catalog.js +2 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +6 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/fit-words.js +2 -2
- package/dist/format/lib/hero-video.d.ts +2 -0
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/sections/timeline-year-shape.js +1 -1
- package/dist/format/lib/sized-image.d.ts +1 -0
- package/dist/format/lib/sized-image.js +1 -1
- package/dist/format/lib/source-rules/page-picture-place.d.ts +6 -0
- package/dist/format/lib/source-rules/page-picture-place.js +4 -0
- package/dist/format/lib/source-rules/part-style-naming.js +2 -2
- package/dist/format/lib/web-backend.d.ts +8 -0
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/BoxCellWidthContext.d.ts +13 -0
- package/dist/render/components/BoxCellWidthContext.js +1 -1
- package/dist/render/components/Flex.d.ts +2 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -1
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroPoster.d.ts +4 -1
- package/dist/render/components/HeroPoster.js +1 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +3 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/HeroVideoPlay.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/Manifesto.js +1 -1
- package/dist/render/components/Placeholder.d.ts +2 -1
- package/dist/render/components/Placeholder.js +1 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/lib/content/block-size.d.ts +1 -0
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-cell-bound.d.ts +17 -0
- package/dist/render/lib/content/box-cell-bound.js +1 -0
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Timeline/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +1 -0
- package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/page-render.js +1 -1
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/slot-counts.d.ts +8 -0
- package/dist/render/lib/document/slot-counts.js +1 -0
- package/dist/render/lib/first-screen.d.ts +28 -0
- package/dist/render/lib/first-screen.js +1 -0
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/site-runtime.d.ts +1 -0
- package/package.json +3 -3
- package/dist/editor/components/KeepHint.d.ts +0 -5
- package/dist/editor/components/KeepHint.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 56.0.0 - 2026-11-07
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
**For hosts:**
|
|
8
|
+
- Install efficient-easel 28.4.0 or later with this release.
|
|
9
|
+
- A host that imports `KeepHint` or `KEEP_HINT_CLASS` imports `InertHint` / `INERT_HINT_CLASS` from `efficient-easel/panel` for a line that must stay; any other hint is a plain `.es-field-hint`.
|
|
10
|
+
- A host that imports `HintsToggle` or `SHOW_HINTS_DEFAULT` from `components/WebsiteSettingsPanel` imports `HintsToggle` from `efficient-easel/panel` and reads the state from `useHints()` (`efficient-easel/screen/lib/hints`), or draws nothing: the inspector root draws the one switch.
|
|
11
|
+
- A host stops passing `showHint` to the 8 Site styles fields; it passes `hint` only.
|
|
12
|
+
- A host line that wears the CSS class `sf-hint-keep` now folds under easel's fold: change it to `InertHint`, or to a plain `.es-field-hint`. The classes `.sf-hints-folded` and `.sf-hints` are gone.
|
|
13
|
+
- efficient-storefront-blocks takes `^56.0.0` in its own bump (it uses `HintsToggle` and `SHOW_HINTS_DEFAULT`).
|
|
14
|
+
|
|
15
|
+
### Removed (BREAKING)
|
|
16
|
+
|
|
17
|
+
- **`components/KeepHint`** (`KeepHint`, `KEEP_HINT_CLASS`), **`HintsToggle`**, **`SHOW_HINTS_DEFAULT`** and the `showHint` prop on the 8 Site styles fields (#582).
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **One Show hints switch for every panel, remembered** (#582): every panel hint folds behind easel's one switch; only `InertHint` stays.
|
|
22
|
+
- **Story and Milestone presses lay down the row Box** (#574): the two hand-written presets are deleted; a press converts a starter through the type's converter row.
|
|
23
|
+
- **A hero draws a picture first and starts only the shown video** (#522): a video slide on the first screen draws a real picture at first paint, and its video no longer waits for `window.load`.
|
|
24
|
+
- **A Box tells its cells their width** (#583): a picture in a Box cell asks the browser for the width it is drawn at.
|
|
25
|
+
- **Article Body is listed in "Blog & journal" with a cover** (#565).
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- **A half-width picture asks for a half-width copy** (#578).
|
|
30
|
+
- **A mirrored card copy swaps each view's own Justify, and the phone Wrap follows its view** (#580).
|
|
31
|
+
- **The text-fit answer says "Shrink"**, as easel 28.3 does (#581).
|
|
32
|
+
|
|
33
|
+
## 55.3.1 - 2026-11-07
|
|
34
|
+
|
|
35
|
+
From main at `a63c1019`: #576. A patch: one fix, no `!` in any title, the peers stay `efficient-easel` `^28.2.0` and `efficient-shell` `^12.13.0`, the declared exports are byte for byte the same as 55.3.0. No stored key or value moves.
|
|
36
|
+
|
|
37
|
+
**For hosts:**
|
|
38
|
+
- efficient-storefront-blocks: take `^55.3.1` in the bump PR; the `FitmentPicker` and `StockFitment` lines in `scripts/registered-not-catalogued.ts` can go.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- **The Fitment Form parts have a block set** (#576): `FitmentPicker` and `StockFitment` are in the commerce set. The set guard now walks every block the builder can hand a host (catalogue, unlisted sets, registry, presses, section-to-box rows, slot, drop and card-template seeds).
|
|
43
|
+
|
|
3
44
|
## 55.3.0 - 2026-11-07
|
|
4
45
|
|
|
5
46
|
From main at `e06f6ceb`: #567, #569, #568, #570, #560, #571, #557, #572, #573. A minor: no `!` in any title, the peers stay `efficient-easel` `^28.2.0` and `efficient-shell` `^12.13.0`, no module is deleted or moved and no declared export is removed (`CardRowFieldKind` gains `"colour"`; `linkedCount` gains an optional `row`; `OwnPad` gains optional tablet values). No stored key or value moves: the new converter rows stay OFF, so every stored node draws as before; only a NEW insert changes.
|
|
@@ -11,9 +11,8 @@ export declare function blockGapRow(device: SiteRowView, site: {
|
|
|
11
11
|
value: number | null;
|
|
12
12
|
followsPx: number | null;
|
|
13
13
|
} | null;
|
|
14
|
-
export default function BlockGapField({ value, onChange,
|
|
14
|
+
export default function BlockGapField({ value, onChange, followsPx, }: {
|
|
15
15
|
value: number | null;
|
|
16
16
|
onChange: (v: number | null) => void;
|
|
17
|
-
showHint?: boolean;
|
|
18
17
|
followsPx?: number | null;
|
|
19
18
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a}from"react/jsx-runtime";import{SettingsDefaultReset as
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import{SettingsDefaultReset as u,SettingsField as d}from"efficient-easel/panel";import{AlignSeparateIcon as h}from"efficient-easel/icons";import{CONTAINER_GAP_BUILT_IN as m,SITE_BLOCK_GAP as t,halfDesktopGap as _,normalizeSiteBlockGap as g}from"../../format/lib/content/container-gap.js";import{say as l,editorEaselWords as k}from"../../format/lib/editor-words.js";import{Slider as b}from"../lib/document/controls.js";import{siteTwinRow as f}from"../../format/lib/site-twin-row.js";const A="The space between the blocks inside a row, a grid or a box. Auto means each one keeps the spacing it already has.",B="The space between the blocks inside a row, a grid or a box, on a phone. Until you set it, a phone uses half the desktop gap.",r="Block gap",c=m.Grid;function E(o,e){return f(o,{desktop:{key:"block_gap",value:e.gap,followsPx:null},phone:{key:"block_gap_phone",value:e.phone,followsPx:e.gap===null?null:_(e.gap)}})}function G({value:o,onChange:e,followsPx:n=null}){const p=o===null,i=n===null?null:`${n}px`,s=n===null?c:g(n)??c;return a(d,{label:l(r),labelId:"sf-block-gap",icon:a(h,{}),changed:!p,action:a(u,{words:k()?.panel,label:l(r),changed:!p,detail:i??l("each block's own spacing"),onReset:()=>e(null)}),hint:l(i===null?A:B),children:a(b,{min:t.min,max:t.max,step:t.step,value:o,...o===null&&n===null?{}:{suffix:"px"},placeholder:s,...n===null?{placeholderWord:"Auto"}:n===s?{}:{placeholderWord:String(n)},onClear:()=>e(null),ariaLabel:l(r),onChange:e})})}export{E as blockGapRow,G as default};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type CardShadow } from "../../format/lib/theme.js";
|
|
2
|
-
export default function CardShadowField({ value, onChange,
|
|
2
|
+
export default function CardShadowField({ value, onChange, }: {
|
|
3
3
|
value: CardShadow | null;
|
|
4
4
|
onChange: (v: CardShadow | null) => void;
|
|
5
|
-
showHint?: boolean;
|
|
6
5
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import{SettingsDefaultReset as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{SettingsDefaultReset as i,SettingsField as p}from"efficient-easel/panel";import{IconPicker as c}from"efficient-shell/ui";import{ShadowIcon as f}from"efficient-easel/icons";import{say as e,editorEaselWords as h}from"../../format/lib/editor-words.js";import{CARD_SHADOWS as u,DEFAULT_CARD_SHADOW as l}from"../../format/lib/theme.js";const a={none:"None",soft:"Soft",lifted:"Lifted"},m="Applies to cards — products, brands, journal entries and filter cells. Round things like swatches and status dots are never shadowed.",x={none:"none",soft:"0 1px 1px rgba(20, 20, 22, 0.10), 0 2px 4px -1px rgba(20, 20, 22, 0.14)",lifted:"0 1px 2px rgba(20, 20, 22, 0.10), 0 4px 7px -2px rgba(20, 20, 22, 0.30)"};function b({value:n,onChange:s}){const r=n===null,d=n??l;return o(p,{label:e("Card shadow"),icon:o(f,{}),value:e(a[d]),changed:!r,action:o(i,{words:h()?.panel,label:e("Card shadow"),changed:!r,detail:e(a[l]),onReset:()=>s(null)}),hint:e(m),children:o(c,{label:e("Card shadow"),value:d,options:u.map(t=>({value:t,label:e(a[t]),icon:o("span",{className:"sf-shadow-chip border border-line bg-surface",style:{boxShadow:x[t]}})})),onChange:s})})}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,jsxs as s,Fragment as L}from"react/jsx-runtime";import{useEffect as P,useId as C,useState as E}from"react";import{usePreviewChat as S,DEFAULT_CHAT_PREVIEW as T}from"./PreviewChatContext.js";import{usePreviewHeader as R}from"../../render/components/PreviewHeaderContext.js";import{IconPicker as _}from"efficient-shell/ui";import{ShellIconWord as y}from"../lib/document/box-fields.js";import{SettingsDefaultReset as A,SettingsField as u,SettingsSegmented as O,SettingsSwitch as I}from"efficient-easel/panel";import{ButtonIcon as v,ButtonIconIcon as B,EyeIcon as H,PhoneIcon as N,PlacementIcon as x,TypeIcon as D}from"efficient-easel/icons";import{ColourRow as F}from"../lib/document/ColourControl.js";import{shellGlyphOf as U}from"../lib/document/shell-glyph.js";import{PanelBand as w}from"../lib/document/controls.js";import{say as t,editorEaselWords as k}from"../../format/lib/editor-words.js";import{normalizeTheme as W,themeButtonColour as j}from"../../format/lib/theme.js";import{CHAT_LAUNCHER_ICONS as G,DEFAULT_CHAT_LAUNCHER_ICON as m,DEFAULT_CHAT_LAUNCHER_POSITION as f,chatLauncherIcon as z}from"../../format/lib/content/chat-launcher.js";const K="Chat with us",V="We usually reply within a few minutes",q="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function b({label:e,value:o,placeholder:a,onCommit:r,multiline:i=!1,hint:l}){const[c,g]=E(o);P(()=>g(o),[o]);const p=()=>{c!==o&&r(c)};return n(u,{label:e,icon:n(D,{}),changed:o!=="",action:n(d,{label:e,changed:o!=="",onReset:()=>r("")}),hint:l,children:i?n("textarea",{value:c,placeholder:a,rows:3,onChange:h=>g(h.target.value),onBlur:p,"aria-label":e}):n("input",{type:"text",value:c,placeholder:a,onChange:h=>g(h.target.value),onBlur:p,onKeyDown:h=>{h.key==="Enter"&&h.currentTarget.blur()},"aria-label":e,autoComplete:"off"})})}function d({label:e,changed:o,onReset:a}){return n(A,{words:k()?.panel,label:e,changed:o,onReset:a})}function J({label:e,icon:o,checked:a,fallback:r,onChange:i,hint:l}){const c=C();return n(u,{label:e,labelId:c,icon:o,changed:a!==r,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:a,onChange:i,ariaLabelledBy:c}),n(d,{label:e,changed:a!==r,onReset:()=>i(r)})]}),hint:l})}const M=G.map(e=>({value:e,icon:U(e)}));function Q(){const{theme:e}=R(),o=W(e).themes[0];return j(o)??o?.accent??""}function X(){const{chat:e,setChat:o}=S(),a=C(),r=Q(),i=e.launcherIcon?z(e.launcherIcon):m;return s(L,{children:[n(u,{label:t("Show the chat bubble"),labelId:a,icon:n(H,{}),changed:!e.enabled,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:e.enabled,onChange:l=>o({enabled:l}),ariaLabelledBy:a}),n(d,{label:t("Show the chat bubble"),changed:!e.enabled,onReset:()=>o({enabled:!0})})]}),hint:e.enabled?t("The floating chat bubble shows in the corner of every page."):t("The chat bubble is hidden across the whole site.")}),s(w,{title:t("Look"),children:[n(F,{label:t("Button color"),icon:n(v,{}),changed:e.launcherColor!=="",value:e.launcherColor,inherited:r,caption:e.launcherColor?void 0:t("Site button color"),onChange:l=>o({launcherColor:l}),onReset:()=>o({launcherColor:""})}),n(u,{label:t("Icon"),icon:n(B,{}),value:n(y,{value:i}),changed:i!==m,action:n(d,{label:t("Icon"),changed:i!==m,onReset:()=>o({launcherIcon:""})}),children:n(_,{label:t("Icon"),value:i,options:M,onChange:l=>o({launcherIcon:l===m?"":l})})}),n(u,{label:t("Position"),icon:n(x,{}),changed:e.launcherPosition!==f,action:n(d,{label:t("Position"),changed:e.launcherPosition!==f,onReset:()=>o({launcherPosition:f})}),children:n(O,{options:[{label:t("Right"),id:"right"},{label:t("Left"),id:"left"}],value:e.launcherPosition,ariaLabel:t("Position"),onChange:l=>o({launcherPosition:l})})}),n(b,{label:t("Label"),value:e.launcherLabel,placeholder:t("Icon only"),onCommit:l=>o({launcherLabel:l}),hint:t("Shows when a visitor points at the button")}),n(J,{label:t("Show on phones"),icon:n(N,{}),checked:e.showOnPhones,fallback:T.showOnPhones,onChange:l=>o({showOnPhones:l})})]}),s(w,{title:t("Wording"),children:[n(b,{label:t("Title"),value:e.title,placeholder:K,onCommit:l=>o({title:l})}),n(b,{label:t("Subtitle"),value:e.subtitle,placeholder:V,onCommit:l=>o({subtitle:l})}),n(b,{label:t("Greeting message"),value:e.greeting,placeholder:q,onCommit:l=>o({greeting:l}),multiline:!0}),n("p",{className:"es-field-hint
|
|
1
|
+
"use client";import{jsx as n,jsxs as s,Fragment as L}from"react/jsx-runtime";import{useEffect as P,useId as C,useState as E}from"react";import{usePreviewChat as S,DEFAULT_CHAT_PREVIEW as T}from"./PreviewChatContext.js";import{usePreviewHeader as R}from"../../render/components/PreviewHeaderContext.js";import{IconPicker as _}from"efficient-shell/ui";import{ShellIconWord as y}from"../lib/document/box-fields.js";import{SettingsDefaultReset as A,SettingsField as u,SettingsSegmented as O,SettingsSwitch as I}from"efficient-easel/panel";import{ButtonIcon as v,ButtonIconIcon as B,EyeIcon as H,PhoneIcon as N,PlacementIcon as x,TypeIcon as D}from"efficient-easel/icons";import{ColourRow as F}from"../lib/document/ColourControl.js";import{shellGlyphOf as U}from"../lib/document/shell-glyph.js";import{PanelBand as w}from"../lib/document/controls.js";import{say as t,editorEaselWords as k}from"../../format/lib/editor-words.js";import{normalizeTheme as W,themeButtonColour as j}from"../../format/lib/theme.js";import{CHAT_LAUNCHER_ICONS as G,DEFAULT_CHAT_LAUNCHER_ICON as m,DEFAULT_CHAT_LAUNCHER_POSITION as f,chatLauncherIcon as z}from"../../format/lib/content/chat-launcher.js";const K="Chat with us",V="We usually reply within a few minutes",q="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function b({label:e,value:o,placeholder:a,onCommit:r,multiline:i=!1,hint:l}){const[c,g]=E(o);P(()=>g(o),[o]);const p=()=>{c!==o&&r(c)};return n(u,{label:e,icon:n(D,{}),changed:o!=="",action:n(d,{label:e,changed:o!=="",onReset:()=>r("")}),hint:l,children:i?n("textarea",{value:c,placeholder:a,rows:3,onChange:h=>g(h.target.value),onBlur:p,"aria-label":e}):n("input",{type:"text",value:c,placeholder:a,onChange:h=>g(h.target.value),onBlur:p,onKeyDown:h=>{h.key==="Enter"&&h.currentTarget.blur()},"aria-label":e,autoComplete:"off"})})}function d({label:e,changed:o,onReset:a}){return n(A,{words:k()?.panel,label:e,changed:o,onReset:a})}function J({label:e,icon:o,checked:a,fallback:r,onChange:i,hint:l}){const c=C();return n(u,{label:e,labelId:c,icon:o,changed:a!==r,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:a,onChange:i,ariaLabelledBy:c}),n(d,{label:e,changed:a!==r,onReset:()=>i(r)})]}),hint:l})}const M=G.map(e=>({value:e,icon:U(e)}));function Q(){const{theme:e}=R(),o=W(e).themes[0];return j(o)??o?.accent??""}function X(){const{chat:e,setChat:o}=S(),a=C(),r=Q(),i=e.launcherIcon?z(e.launcherIcon):m;return s(L,{children:[n(u,{label:t("Show the chat bubble"),labelId:a,icon:n(H,{}),changed:!e.enabled,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:e.enabled,onChange:l=>o({enabled:l}),ariaLabelledBy:a}),n(d,{label:t("Show the chat bubble"),changed:!e.enabled,onReset:()=>o({enabled:!0})})]}),hint:e.enabled?t("The floating chat bubble shows in the corner of every page."):t("The chat bubble is hidden across the whole site.")}),s(w,{title:t("Look"),children:[n(F,{label:t("Button color"),icon:n(v,{}),changed:e.launcherColor!=="",value:e.launcherColor,inherited:r,caption:e.launcherColor?void 0:t("Site button color"),onChange:l=>o({launcherColor:l}),onReset:()=>o({launcherColor:""})}),n(u,{label:t("Icon"),icon:n(B,{}),value:n(y,{value:i}),changed:i!==m,action:n(d,{label:t("Icon"),changed:i!==m,onReset:()=>o({launcherIcon:""})}),children:n(_,{label:t("Icon"),value:i,options:M,onChange:l=>o({launcherIcon:l===m?"":l})})}),n(u,{label:t("Position"),icon:n(x,{}),changed:e.launcherPosition!==f,action:n(d,{label:t("Position"),changed:e.launcherPosition!==f,onReset:()=>o({launcherPosition:f})}),children:n(O,{options:[{label:t("Right"),id:"right"},{label:t("Left"),id:"left"}],value:e.launcherPosition,ariaLabel:t("Position"),onChange:l=>o({launcherPosition:l})})}),n(b,{label:t("Label"),value:e.launcherLabel,placeholder:t("Icon only"),onCommit:l=>o({launcherLabel:l}),hint:t("Shows when a visitor points at the button")}),n(J,{label:t("Show on phones"),icon:n(N,{}),checked:e.showOnPhones,fallback:T.showOnPhones,onChange:l=>o({showOnPhones:l})})]}),s(w,{title:t("Wording"),children:[n(b,{label:t("Title"),value:e.title,placeholder:K,onCommit:l=>o({title:l})}),n(b,{label:t("Subtitle"),value:e.subtitle,placeholder:V,onCommit:l=>o({subtitle:l})}),n(b,{label:t("Greeting message"),value:e.greeting,placeholder:q,onCommit:l=>o({greeting:l}),multiline:!0}),n("p",{className:"es-field-hint",children:t("Leave a field blank to use the built-in wording.")})]})]})}export{X as default};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const CORNERS_LABEL = "Corners";
|
|
2
|
-
export default function CornersField({ value, onChange,
|
|
2
|
+
export default function CornersField({ value, onChange, }: {
|
|
3
3
|
value: number | null;
|
|
4
4
|
onChange: (v: number | null) => void;
|
|
5
|
-
showHint?: boolean;
|
|
6
5
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{SettingsDefaultReset as i,SettingsField as a}from"efficient-easel/panel";import{SquareIcon as d}from"efficient-easel/icons";import{CORNER_RADIUS_MAX as c,CORNER_RADIUS_MIN as l}from"../../format/lib/theme.js";import{say as t,editorEaselWords as u}from"../../format/lib/editor-words.js";import{Slider as p}from"../lib/document/controls.js";const m="Applies to panels, cards, inputs and buttons. Round things — color swatches, switches, status dots — stay round.",s="Corners";function R({value:o,onChange:r}){const n=o===null;return e(a,{label:t(s),icon:e(d,{}),changed:!n,action:e(i,{words:u()?.panel,label:t(s),changed:!n,detail:t("the built-in corners"),onReset:()=>r(null)}),hint:t(m),children:e(p,{min:l,max:c,step:1,value:o,...o===null?{}:{suffix:"px"},placeholder:l,placeholderWord:"Auto",onClear:()=>r(null),ariaLabel:t(s),onChange:r})})}export{s as CORNERS_LABEL,R as default};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type HoverEffect } from "../../format/lib/theme.js";
|
|
2
2
|
export declare const HOVER_EFFECT_LABELS: Readonly<Record<HoverEffect, string>>;
|
|
3
|
-
export default function HoverEffectField({ value, onChange,
|
|
3
|
+
export default function HoverEffectField({ value, onChange, }: {
|
|
4
4
|
value: HoverEffect | null;
|
|
5
5
|
onChange: (v: HoverEffect | null) => void;
|
|
6
|
-
showHint?: boolean;
|
|
7
6
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{SettingsDefaultReset as c,SettingsField as E,SettingsSegmented as d}from"efficient-easel/panel";import{HoverIcon as p}from"efficient-easel/icons";import{HOVER_KIND_LABELS as s}from"../../format/lib/animation/hover.js";import{say as e,editorEaselWords as h}from"../../format/lib/editor-words.js";import{HOVER_EFFECTS as m,DEFAULT_HOVER_EFFECT as f}from"../../format/lib/theme.js";const o={none:s.none,lift:s.lift,highlight:"Highlight"},H="What a card does when a shopper points at it — or taps it, on a phone. Highlight is the effect your cards already use.";function g({value:i,onChange:n}){const r=i===null,a=i??f;return t(E,{label:e("Hover effect"),icon:t(p,{}),value:e(o[a]),changed:!r,action:t(c,{words:h()?.panel,label:e("Hover effect"),changed:!r,detail:e(o[f]),onReset:()=>n(null)}),hint:e(H),children:t(d,{options:m.map(l=>({id:l,label:e(o[l])})),value:a,ariaLabel:e("Hover effect"),onChange:n})})}export{o as HOVER_EFFECT_LABELS,g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as W,jsxs as h}from"react/jsx-runtime";import{useContext as bt,useEffect as pe,useRef as wt,useState as Ve}from"react";import{FieldSelect as Pt,InspectorField as vt,fieldShownInView as Tt}from"efficient-easel/fields";import{SettingsField as Nt}from"efficient-easel/panel";import{InspectorUpLevel as X}from"efficient-easel/chrome";import{StylesIcon as kt,TypeIcon as Ot}from"efficient-easel/icons";import{useEasel as Rt}from"efficient-easel/easel";import{TextPartPanel as Be}from"efficient-easel/copy";import{Button as Ct,IconButton as Et,Tooltip as It}from"efficient-shell/ui";import{PartTextBox as Ft,partTextCells as He}from"./PartTextBox.js";import{SiteFields as me}from"./SiteFields.js";import{usePartMotion as zt}from"./usePartMotion.js";import{UiIcon as Ue}from"efficient-easel/draw/client";import{usePreviewHeader as _t}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as At}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as Lt}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as Vt,partStyleToTextStyleValues as Bt,pushIntoStyle as Ht,resolveTextStyles as We,styleIdOfRole as Ut}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as Wt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as jt}from"../lib/theme-row-persist.js";import{usePreviewDevice as Dt}from"efficient-easel/draw/client";import{shownTier as q}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as je,partRowHasTabletValue as Gt}from"../lib/document/part-panel-rows.js";import{usePartStyle as Kt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as J,textFieldOffPage as Mt,textFieldPanelOnly as $t}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as Yt}from"efficient-easel/draw";import{useSectionOps as Xt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as qt,FONT_ROLES as Jt,FONT_ROLE_LABELS as De,fontOption as ye,fontRoleOf as Qt}from"../../format/lib/fonts.js";import{isMultilineKind as Zt,partPlaceholder as en,typeInPlaceKind as tn}from"../../render/lib/document/part-text.js";import{partRowField as nn}from"../lib/document/part-row-field.js";import{decodePartKey as on,partPropsWithRowValue as ln,partRowValue as sn}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Ge,partAlignFollowed as rn,propsWithPartStyleValue as B,propsWithoutPartStyle as an,readPartStyle as he,regionHasOwnLook as cn}from"../../render/lib/document/part-styles.js";import{partThemeColors as dn}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Ke}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as un}from"../lib/document/part-typing.js";import{keysOnCanvas as fn,useCanvasTypingPart as pn}from"../lib/document/canvas-typing.js";import{useEaselHost as mn}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as yn,SOURCE_ACTIONS as hn,SOURCE_ACTION_LABEL as Sn,partSourceNoteFor as gn,partSourceOf as xn,sourceMenuIdOf as bn,sourceSlugOf as Se}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as wn,holdsAuthoredText as Pn}from"../../render/lib/document/text-parts.js";import{regionsForSection as vn}from"../../format/lib/sections/section-text-regions.js";import{regionTakesSize as Tn,textRegionOfPartKey as Nn}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as Me}from"./SameInEveryViewNote.js";function ge(t){return t?l(t):null}function $e(t){return t.kind==="role"?De[t.role]:t.kind==="custom"?"Custom":null}function kn(t){const n=Qt(t.role);return n?{kind:"role",role:n}:null}function On(t,n){if(!t)return{kind:"unread"};const{faceRole:r,base:i}=t;if(n[r]===i.fontKey)return{kind:"role",role:r};const a=Object.keys(n).filter(s=>n[s]===i.fontKey);return a.length===1?{kind:"role",role:a[0]}:{kind:"custom"}}function Q(t,n,r,i){return kn(he(t,n))??On(r,i)}function Rn(t,n){if(!t.length)return null;const r=n(t[0]);return t.every(i=>n(i)===r)?r:null}function Ye(t){return[{value:j,label:l("No style"),description:l("Section’s own")},...t.map(n=>({value:n.id,label:n.name,description:n.values.font?ye(n.values.font)?.label:void 0}))]}const j="";function Cn({face:t,base:n,onPick:r}){const i=t.kind==="role"?t.role:j,a=[{label:l("No style"),value:j},...Jt.map(s=>({label:l(De[s]),value:s}))];return o(Pt,{ariaLabel:l("Style"),value:i,options:a,inline:!0,onChange:s=>r(s===j?null:s),renderOption:s=>s.value===j?h(W,{children:[o("span",{className:"es-fsel-label sf-part-style-keep",children:s.label}),o("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):o("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${s.value})`},children:s.label}),renderValue:()=>o("span",{style:{fontFamily:n?.fontKey?`var(${ye(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:ge($e(t))}),valueText:s=>ge($e(t))??s?.label??""})}const Xe=["regionNote","regionStyle"],En=Object.keys(je).filter(t=>!Xe.includes(t));function qe(t,n){return!t.some(n)}function In({sectionName:t,onBack:n,textEditor:r,styleRow:i,children:a,tabs:s}){const g=h(W,{children:[r,i,a]});return h("div",{className:"sf-part-panel",children:[o(X,{inline:!0,name:l(t),onSelect:n}),s?s(g):g]})}function Je({source:t,slug:n,menuId:r}){const i=mn(),a=hn[t],s=!a.needsSlug||!!n;return o("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[l(yn[t]),s?h(W,{children:[" ",o(Ct,{type:"button",variant:"link",size:"sm",onClick:()=>{a.type==="storefront-editor:open-menus"?i.send(a.type,{menuId:r??null}):n&&i.send(a.type,{slug:n})},children:l(Sn)})]}):null]})})}const Qe=4,Fn=120;function Ze(t){return l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(t.label).toLowerCase()})}function et({region:t,sizePx:n,face:r,base:i,onFollowStyle:a,source:s,slug:g,onBack:N,shows:x,sizedStyle:b,ownLook:I}){const D=t.follows;return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l(t.label)})}),x("regionNote")&&!I&&o("p",{children:n?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(D),px:Math.round(n)}):l("Its size follows Styles ▸ {follows}.",{follows:l(D)})}),b?h(W,{children:[b,x("regionStyle")&&o("p",{className:"es-field-hint sf-hint-keep",children:Ze(t)})]}):a?x("regionStyle")?o(W,{children:o(Nt,{label:l("Style"),icon:o(kt,{}),hint:Ze(t),children:o(Cn,{face:r,base:i,onPick:a})})}):null:x("regionNote")&&o("p",{className:"es-field-hint sf-hint-keep",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),s&&x("sourceNote")?o(Je,{source:s,slug:g}):null,qe([...Xe,"sourceNote",...b?["fontSize"]:[]],F=>x(F)&&(F!=="sourceNote"||!!s))&&o(Me,{}),o(X,{inline:!0,name:l("Page"),onSelect:N})]})}function zn({onBack:t}){return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l("This part is no longer here.")})}),o("p",{children:l("The section it belonged to has been changed or removed.")}),o(X,{inline:!0,name:l("Page"),onSelect:t})]})}function _n({onBack:t,partId:n,why:r}){return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l("This part's settings did not open.")})}),o("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),o("p",{className:"sf-note-detail",children:h("code",{children:[n," — ",r]})}),o(X,{inline:!0,name:l("Page"),onSelect:t})]})}function An({nodeId:t,propKey:n,onBack:r,onEditStyle:i}){const{getItemById:a,getSelectorForId:s,config:g}=Rt(e=>e),N=Xt(),x=pn(),{partStyle:b}=Kt(),{fonts:I,textStyles:D}=_t(),F=bt(Lt),xe=!F?.capabilities?.hasSiteTheme,{persist:nt}=jt({themeFromDocument:xe,tokenRef:F?.tokenRef,siteId:F?.siteId??null}),k=Wt({themeFromDocument:xe,persist:nt}),[ot,Z]=Ve(!1),H=Dt(),f=e=>(q(H)!=="tablet"||Gt(e))&&Tt(je[e],H),be=wt(null),d=a(t),p=s(t),we=d?g.components[d.type]:void 0,{key:w,row:P}=on(n),Pe=we?.fields?.[w],S=P?nn(Pe,P):Pe,z=wn(t,n),u=d?.props??{},v=tn(S),ve=Mt(S),Te=Pn(S),Ne=d?xn(d.type):null,ee=d?gn(d.type,w):null,te=P?sn(u[w],P):u[w],ke=!!P&&!(Array.isArray(u[w])&&P.index<u[w].length);pe(()=>{if(fn(document))return;be.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[z]);const[ne,Oe]=Ve(0);pe(()=>Oe(0),[z]);const oe=!!d&&!ke&&(!p||!S);pe(()=>{if(!oe||ne>=Qe)return;const e=setTimeout(()=>Oe(c=>c+1),Fn);return()=>clearTimeout(e)},[oe,ne]);const lt=oe&&ne<Qe,le=zt(t,Ke(d?.type,n),"textPart");if(!d||ke)return o(zn,{onBack:r});const G=vn(d.type),Re=G?Nn(G,n):null;if(G&&Re){const e=b?.partId===z?b:null,c=G[Re],m=c.writable===!0&&!!p,T=C=>{p&&N.replaceComponent(p.zone,p.index,{...d,props:B(u,n,"role",C)})};if(m&&Tn(c)){const C=he(u,n),Le=E=>{if(!p)return;let fe=u;for(const[gt,xt]of Object.entries(E))fe=B(fe,n,gt,xt??null);N.replaceComponent(p.zone,p.index,{...d,props:fe})},yt=We(k.saved,k.old),ht=Ge(C)??"",St=He(C,e?.base??tt,Le,q(H)).filter(E=>E.key==="fontSize"&&f(E.key));return o(me,{motion:le,body:o(et,{region:c,sizePx:e?.base.sizePx??null,face:Q(u,n,e,I),base:e?.base??null,source:Ne,slug:Se(u),onBack:r,shows:f,ownLook:cn(C),sizedStyle:o(Be,{style:f("style")?{value:ht,options:Ye(yt),onChange:E=>Le(E?{textStyle:E}:{textStyle:null,role:null}),onEditStyles:i}:void 0,cells:St})})})}return o(me,{motion:le,body:o(et,{region:c,sizePx:e?.base.sizePx??null,face:Q(u,n,e,I),base:e?.base??null,onFollowStyle:m?T:void 0,source:Ne,slug:Se(u),onBack:r,shows:f})})}if(!p||!S)return lt?o("div",{className:"sf-note","aria-busy":"true"}):o(_n,{onBack:r,partId:z,why:p?"no field":"no selector"});const Ce=e=>{N.replaceComponent(p.zone,p.index,{...d,props:e})},se=e=>{if(J(e).hidden!==J(te).hidden||!v){const m=P?ln(u,w,P,e):{...u,[w]:e};m&&Ce(m);return}un({node:d,propKey:n,kind:v,zone:p.zone,index:p.index},J(e).text,N.replaceComponent)},st=te,_=b?.partId===z?b:null,A=_?.styleOwner,K=A?a(A.owner):null,re=A&&K?s(A.owner):null,ie=!!(A&&K&&re),L=ie?K.props??{}:u,ae=ie?e=>N.replaceComponent(re.zone,re.index,{...K,props:e}):Ce,M=ie?A.kind:Ke(d?.type,n),O=he(L,M),y=[{partKey:M,face:Q(L,M,_,I),sizeGroup:_?.sizeGroup??null,base:_?.base??tt,style:O}],Ee=Rn(y,e=>e.sizeGroup),rt=dn(_?.inks),U=(e,c)=>{let m=L;for(const T of y)m=B(m,T.partKey,e,c);ae(m)},it=e=>e?U("textStyle",e):ce({textStyle:null,role:null}),ce=e=>{let c=L;for(const m of y)for(const[T,C]of Object.entries(e))c=B(c,m.partKey,T,C??null);ae(c)},de=v==="text"||v==="textarea",{text:Ie,hidden:V}=J(te),$=S?.[Yt]?.label??n,Fe=V?l("Show {label} on the slide",{label:l($)}):l("Hide {label} on the slide",{label:l($)}),ze=h("div",{className:"sf-field-head",children:[o(Ot,{}),o("span",{className:"sf-field-label sf-field-label--inline",children:l($)}),de&&o(It,{content:Fe,children:o(Et,{"aria-pressed":V,"aria-label":Fe,onClick:()=>se({text:Ie,hidden:!V}),children:V?o(Ue,{name:"eye-off",size:14}):o(Ue,{name:"eye",size:14})})})]}),Y=!ve&&Te,at=!!v&&($t(S)||ve||V||!Te),_e=Q(L,M,_,I),ct=_e.kind==="role"?_e.role:null,ue=Ge(O)??Ut(ct),Ae=We(k.saved,k.old),dt=Object.entries(O).filter(([e,c])=>e!=="role"&&e!=="textStyle"&&c!==void 0).length,ut=()=>{let e=L;for(const c of y){const{role:m,textStyle:T}=c.style;e=an(e,c.partKey),m&&(e=B(e,c.partKey,"role",m)),T&&(e=B(e,c.partKey,"textStyle",T))}ae(e)},R=ue,ft=Vt(y[0].style),pt=R?Ae.find(e=>e.id===R)?.name??R:"",mt=()=>{Z(!1),R&&(k.write(Ht({saved:k.saved,old:k.old,styleId:R,values:Bt(y[0].style)}),!0),ut())};return h(In,{sectionName:we?.label??d.type,onBack:r,tabs:e=>o(me,{motion:le,body:e}),textEditor:f("words")?o("div",{ref:be,className:"sf-part-text",children:at?o(Ft,{text:Ie,onTextChange:e=>se(de?{text:e,hidden:V}:e),multiline:Zt(v),markup:v!=="plainText",styled:!1,style:y[0].style,base:y[0].base,setValue:ce,colors:rt,placeholder:ge(en(S))??void 0,ariaLabel:l($),head:ze,typedOnCanvas:x===z}):v?de?ze:null:o(vt,{field:S,name:n,value:st,onChange:se,id:`sf-part-${t}-${n}`})}):void 0,children:[ee&&f("sourceNote")&&o(Je,{source:ee,slug:Se(u),menuId:bn(u)}),Y&&o(Be,{style:f("style")?{value:ue??"",options:Ye(Ae),onChange:e=>it(e||null),changed:dt>0,onEditStyles:i,onUpdateStyle:R&&ft?()=>Z(!0):void 0}:void 0,font:f("font")?{value:O.font??"",styleValue:ye(y[0].base.fontKey)?.label,options:qt.map(e=>({label:e.label,value:e.key})),onChange:e=>U("font",e||null)}:void 0,italic:f("italic")?{value:O.italic,styleValue:Bn(D,ue),onChange:e=>U("italic",e??null)}:void 0,cells:He(y[0].style,y[0].base,ce,q(H)).filter(e=>f(e.key)),align:f("align")?Vn(O,y[0].base.align,q(H),U):void 0,letterCase:f("letterCase")?{value:O.case??"",styleValue:y[0].base.case,onChange:e=>U("case",e||null)}:void 0}),ot&&R&&o(At,{styleName:pt,onCancel:()=>Z(!1),onConfirm:mt}),Y&&Ee===null&&f("fixedSizeHint")&&o("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),qe(En,e=>f(e)&&(e==="words"||(e==="sourceNote"?!!ee:e==="fixedSizeHint"?Y&&Ee===null:Y)))&&o(Me,{})]})}const Ln={desktop:"align",tablet:"alignTablet",mobile:"alignPhone"};function Vn(t,n,r,i){const a=Ln[r],s=rn(t,r);return{value:t[a]??"",styleValue:s??n,onChange:g=>i(a,g||null)}}function Bn(t,n){return!n||!Array.isArray(t)?!1:t.find(i=>i?.id===n)?.values?.italic===!0}const tt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{In as PartPanelBody,Je as PartSourceNote,Cn as PartStyleSelect,An as default,Q as partFace};
|
|
1
|
+
"use client";import{jsx as o,Fragment as W,jsxs as h}from"react/jsx-runtime";import{useContext as wt,useEffect as pe,useRef as Pt,useState as Ve}from"react";import{FieldSelect as vt,InspectorField as Tt,fieldShownInView as Nt}from"efficient-easel/fields";import{InertHint as Be,SettingsField as Ot}from"efficient-easel/panel";import{InspectorUpLevel as X}from"efficient-easel/chrome";import{StylesIcon as Rt,TypeIcon as kt}from"efficient-easel/icons";import{useEasel as Ct}from"efficient-easel/easel";import{TextPartPanel as He}from"efficient-easel/copy";import{Button as Et,IconButton as It,Tooltip as Ft}from"efficient-shell/ui";import{PartTextBox as zt,partTextCells as Ue}from"./PartTextBox.js";import{SiteFields as me}from"./SiteFields.js";import{usePartMotion as _t}from"./usePartMotion.js";import{UiIcon as We}from"efficient-easel/draw/client";import{usePreviewHeader as At}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as Lt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as Vt}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as Bt,partStyleToTextStyleValues as Ht,pushIntoStyle as Ut,resolveTextStyles as je,styleIdOfRole as Wt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as jt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as Dt}from"../lib/theme-row-persist.js";import{usePreviewDevice as Gt}from"efficient-easel/draw/client";import{shownTier as q}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as De,partRowHasTabletValue as Kt}from"../lib/document/part-panel-rows.js";import{usePartStyle as Mt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as J,textFieldOffPage as $t,textFieldPanelOnly as Yt}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as Xt}from"efficient-easel/draw";import{useSectionOps as qt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as Jt,FONT_ROLES as Qt,FONT_ROLE_LABELS as Ge,fontOption as ye,fontRoleOf as Zt}from"../../format/lib/fonts.js";import{isMultilineKind as en,partPlaceholder as tn,typeInPlaceKind as nn}from"../../render/lib/document/part-text.js";import{partRowField as on}from"../lib/document/part-row-field.js";import{decodePartKey as ln,partPropsWithRowValue as sn,partRowValue as rn}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Ke,partAlignFollowed as an,propsWithPartStyleValue as B,propsWithoutPartStyle as cn,readPartStyle as he,regionHasOwnLook as dn}from"../../render/lib/document/part-styles.js";import{partThemeColors as un}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Me}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as fn}from"../lib/document/part-typing.js";import{keysOnCanvas as pn,useCanvasTypingPart as mn}from"../lib/document/canvas-typing.js";import{useEaselHost as yn}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as hn,SOURCE_ACTIONS as Sn,SOURCE_ACTION_LABEL as gn,partSourceNoteFor as xn,partSourceOf as bn,sourceMenuIdOf as wn,sourceSlugOf as Se}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as Pn,holdsAuthoredText as vn}from"../../render/lib/document/text-parts.js";import{regionsForSection as Tn}from"../../format/lib/sections/section-text-regions.js";import{regionTakesSize as Nn,textRegionOfPartKey as On}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as $e}from"./SameInEveryViewNote.js";function ge(t){return t?l(t):null}function Ye(t){return t.kind==="role"?Ge[t.role]:t.kind==="custom"?"Custom":null}function Rn(t){const n=Zt(t.role);return n?{kind:"role",role:n}:null}function kn(t,n){if(!t)return{kind:"unread"};const{faceRole:r,base:i}=t;if(n[r]===i.fontKey)return{kind:"role",role:r};const a=Object.keys(n).filter(s=>n[s]===i.fontKey);return a.length===1?{kind:"role",role:a[0]}:{kind:"custom"}}function Q(t,n,r,i){return Rn(he(t,n))??kn(r,i)}function Cn(t,n){if(!t.length)return null;const r=n(t[0]);return t.every(i=>n(i)===r)?r:null}function Xe(t){return[{value:j,label:l("No style"),description:l("Section’s own")},...t.map(n=>({value:n.id,label:n.name,description:n.values.font?ye(n.values.font)?.label:void 0}))]}const j="";function En({face:t,base:n,onPick:r}){const i=t.kind==="role"?t.role:j,a=[{label:l("No style"),value:j},...Qt.map(s=>({label:l(Ge[s]),value:s}))];return o(vt,{ariaLabel:l("Style"),value:i,options:a,inline:!0,onChange:s=>r(s===j?null:s),renderOption:s=>s.value===j?h(W,{children:[o("span",{className:"es-fsel-label sf-part-style-keep",children:s.label}),o("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):o("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${s.value})`},children:s.label}),renderValue:()=>o("span",{style:{fontFamily:n?.fontKey?`var(${ye(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:ge(Ye(t))}),valueText:s=>ge(Ye(t))??s?.label??""})}const qe=["regionNote","regionStyle"],In=Object.keys(De).filter(t=>!qe.includes(t));function Je(t,n){return!t.some(n)}function Fn({sectionName:t,onBack:n,textEditor:r,styleRow:i,children:a,tabs:s}){const g=h(W,{children:[r,i,a]});return h("div",{className:"sf-part-panel",children:[o(X,{inline:!0,name:l(t),onSelect:n}),s?s(g):g]})}function Qe({source:t,slug:n,menuId:r}){const i=yn(),a=Sn[t],s=!a.needsSlug||!!n;return o("div",{className:"sf-note sf-note--source",children:h(Be,{children:[l(hn[t]),s?h(W,{children:[" ",o(Et,{type:"button",variant:"link",size:"sm",onClick:()=>{a.type==="storefront-editor:open-menus"?i.send(a.type,{menuId:r??null}):n&&i.send(a.type,{slug:n})},children:l(gn)})]}):null]})})}const Ze=4,zn=120;function et(t){return l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(t.label).toLowerCase()})}function tt({region:t,sizePx:n,face:r,base:i,onFollowStyle:a,source:s,slug:g,onBack:N,shows:x,sizedStyle:b,ownLook:I}){const D=t.follows;return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l(t.label)})}),x("regionNote")&&!I&&o("p",{children:n?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(D),px:Math.round(n)}):l("Its size follows Styles ▸ {follows}.",{follows:l(D)})}),b?h(W,{children:[b,x("regionStyle")&&o("p",{className:"es-field-hint",children:et(t)})]}):a?x("regionStyle")?o(W,{children:o(Ot,{label:l("Style"),icon:o(Rt,{}),hint:et(t),children:o(En,{face:r,base:i,onPick:a})})}):null:x("regionNote")&&o("p",{className:"es-field-hint",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),s&&x("sourceNote")?o(Qe,{source:s,slug:g}):null,Je([...qe,"sourceNote",...b?["fontSize"]:[]],F=>x(F)&&(F!=="sourceNote"||!!s))&&o($e,{}),o(X,{inline:!0,name:l("Page"),onSelect:N})]})}function _n({onBack:t}){return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l("This part is no longer here.")})}),o("p",{children:l("The section it belonged to has been changed or removed.")}),o(X,{inline:!0,name:l("Page"),onSelect:t})]})}function An({onBack:t,partId:n,why:r}){return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l("This part's settings did not open.")})}),o("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),o("p",{className:"sf-note-detail",children:h("code",{children:[n," — ",r]})}),o(X,{inline:!0,name:l("Page"),onSelect:t})]})}function Ln({nodeId:t,propKey:n,onBack:r,onEditStyle:i}){const{getItemById:a,getSelectorForId:s,config:g}=Ct(e=>e),N=qt(),x=mn(),{partStyle:b}=Mt(),{fonts:I,textStyles:D}=At(),F=wt(Vt),xe=!F?.capabilities?.hasSiteTheme,{persist:ot}=Dt({themeFromDocument:xe,tokenRef:F?.tokenRef,siteId:F?.siteId??null}),O=jt({themeFromDocument:xe,persist:ot}),[lt,Z]=Ve(!1),H=Gt(),f=e=>(q(H)!=="tablet"||Kt(e))&&Nt(De[e],H),be=Pt(null),d=a(t),p=s(t),we=d?g.components[d.type]:void 0,{key:w,row:P}=ln(n),Pe=we?.fields?.[w],S=P?on(Pe,P):Pe,z=Pn(t,n),u=d?.props??{},v=nn(S),ve=$t(S),Te=vn(S),Ne=d?bn(d.type):null,ee=d?xn(d.type,w):null,te=P?rn(u[w],P):u[w],Oe=!!P&&!(Array.isArray(u[w])&&P.index<u[w].length);pe(()=>{if(pn(document))return;be.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[z]);const[ne,Re]=Ve(0);pe(()=>Re(0),[z]);const oe=!!d&&!Oe&&(!p||!S);pe(()=>{if(!oe||ne>=Ze)return;const e=setTimeout(()=>Re(c=>c+1),zn);return()=>clearTimeout(e)},[oe,ne]);const st=oe&&ne<Ze,le=_t(t,Me(d?.type,n),"textPart");if(!d||Oe)return o(_n,{onBack:r});const G=Tn(d.type),ke=G?On(G,n):null;if(G&&ke){const e=b?.partId===z?b:null,c=G[ke],m=c.writable===!0&&!!p,T=C=>{p&&N.replaceComponent(p.zone,p.index,{...d,props:B(u,n,"role",C)})};if(m&&Nn(c)){const C=he(u,n),Le=E=>{if(!p)return;let fe=u;for(const[xt,bt]of Object.entries(E))fe=B(fe,n,xt,bt??null);N.replaceComponent(p.zone,p.index,{...d,props:fe})},ht=je(O.saved,O.old),St=Ke(C)??"",gt=Ue(C,e?.base??nt,Le,q(H)).filter(E=>E.key==="fontSize"&&f(E.key));return o(me,{motion:le,body:o(tt,{region:c,sizePx:e?.base.sizePx??null,face:Q(u,n,e,I),base:e?.base??null,source:Ne,slug:Se(u),onBack:r,shows:f,ownLook:dn(C),sizedStyle:o(He,{style:f("style")?{value:St,options:Xe(ht),onChange:E=>Le(E?{textStyle:E}:{textStyle:null,role:null}),onEditStyles:i}:void 0,cells:gt})})})}return o(me,{motion:le,body:o(tt,{region:c,sizePx:e?.base.sizePx??null,face:Q(u,n,e,I),base:e?.base??null,onFollowStyle:m?T:void 0,source:Ne,slug:Se(u),onBack:r,shows:f})})}if(!p||!S)return st?o("div",{className:"sf-note","aria-busy":"true"}):o(An,{onBack:r,partId:z,why:p?"no field":"no selector"});const Ce=e=>{N.replaceComponent(p.zone,p.index,{...d,props:e})},se=e=>{if(J(e).hidden!==J(te).hidden||!v){const m=P?sn(u,w,P,e):{...u,[w]:e};m&&Ce(m);return}fn({node:d,propKey:n,kind:v,zone:p.zone,index:p.index},J(e).text,N.replaceComponent)},rt=te,_=b?.partId===z?b:null,A=_?.styleOwner,K=A?a(A.owner):null,re=A&&K?s(A.owner):null,ie=!!(A&&K&&re),L=ie?K.props??{}:u,ae=ie?e=>N.replaceComponent(re.zone,re.index,{...K,props:e}):Ce,M=ie?A.kind:Me(d?.type,n),R=he(L,M),y=[{partKey:M,face:Q(L,M,_,I),sizeGroup:_?.sizeGroup??null,base:_?.base??nt,style:R}],Ee=Cn(y,e=>e.sizeGroup),it=un(_?.inks),U=(e,c)=>{let m=L;for(const T of y)m=B(m,T.partKey,e,c);ae(m)},at=e=>e?U("textStyle",e):ce({textStyle:null,role:null}),ce=e=>{let c=L;for(const m of y)for(const[T,C]of Object.entries(e))c=B(c,m.partKey,T,C??null);ae(c)},de=v==="text"||v==="textarea",{text:Ie,hidden:V}=J(te),$=S?.[Xt]?.label??n,Fe=V?l("Show {label} on the slide",{label:l($)}):l("Hide {label} on the slide",{label:l($)}),ze=h("div",{className:"sf-field-head",children:[o(kt,{}),o("span",{className:"sf-field-label sf-field-label--inline",children:l($)}),de&&o(Ft,{content:Fe,children:o(It,{"aria-pressed":V,"aria-label":Fe,onClick:()=>se({text:Ie,hidden:!V}),children:V?o(We,{name:"eye-off",size:14}):o(We,{name:"eye",size:14})})})]}),Y=!ve&&Te,ct=!!v&&(Yt(S)||ve||V||!Te),_e=Q(L,M,_,I),dt=_e.kind==="role"?_e.role:null,ue=Ke(R)??Wt(dt),Ae=je(O.saved,O.old),ut=Object.entries(R).filter(([e,c])=>e!=="role"&&e!=="textStyle"&&c!==void 0).length,ft=()=>{let e=L;for(const c of y){const{role:m,textStyle:T}=c.style;e=cn(e,c.partKey),m&&(e=B(e,c.partKey,"role",m)),T&&(e=B(e,c.partKey,"textStyle",T))}ae(e)},k=ue,pt=Bt(y[0].style),mt=k?Ae.find(e=>e.id===k)?.name??k:"",yt=()=>{Z(!1),k&&(O.write(Ut({saved:O.saved,old:O.old,styleId:k,values:Ht(y[0].style)}),!0),ft())};return h(Fn,{sectionName:we?.label??d.type,onBack:r,tabs:e=>o(me,{motion:le,body:e}),textEditor:f("words")?o("div",{ref:be,className:"sf-part-text",children:ct?o(zt,{text:Ie,onTextChange:e=>se(de?{text:e,hidden:V}:e),multiline:en(v),markup:v!=="plainText",styled:!1,style:y[0].style,base:y[0].base,setValue:ce,colors:it,placeholder:ge(tn(S))??void 0,ariaLabel:l($),head:ze,typedOnCanvas:x===z}):v?de?ze:null:o(Tt,{field:S,name:n,value:rt,onChange:se,id:`sf-part-${t}-${n}`})}):void 0,children:[ee&&f("sourceNote")&&o(Qe,{source:ee,slug:Se(u),menuId:wn(u)}),Y&&o(He,{style:f("style")?{value:ue??"",options:Xe(Ae),onChange:e=>at(e||null),changed:ut>0,onEditStyles:i,onUpdateStyle:k&&pt?()=>Z(!0):void 0}:void 0,font:f("font")?{value:R.font??"",styleValue:ye(y[0].base.fontKey)?.label,options:Jt.map(e=>({label:e.label,value:e.key})),onChange:e=>U("font",e||null)}:void 0,italic:f("italic")?{value:R.italic,styleValue:Hn(D,ue),onChange:e=>U("italic",e??null)}:void 0,cells:Ue(y[0].style,y[0].base,ce,q(H)).filter(e=>f(e.key)),align:f("align")?Bn(R,y[0].base.align,q(H),U):void 0,letterCase:f("letterCase")?{value:R.case??"",styleValue:y[0].base.case,onChange:e=>U("case",e||null)}:void 0}),lt&&k&&o(Lt,{styleName:mt,onCancel:()=>Z(!1),onConfirm:yt}),Y&&Ee===null&&f("fixedSizeHint")&&o(Be,{children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),Je(In,e=>f(e)&&(e==="words"||(e==="sourceNote"?!!ee:e==="fixedSizeHint"?Y&&Ee===null:Y)))&&o($e,{})]})}const Vn={desktop:"align",tablet:"alignTablet",mobile:"alignPhone"};function Bn(t,n,r,i){const a=Vn[r],s=an(t,r);return{value:t[a]??"",styleValue:s??n,onChange:g=>i(a,g||null)}}function Hn(t,n){return!n||!Array.isArray(t)?!1:t.find(i=>i?.id===n)?.values?.italic===!0}const nt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{Fn as PartPanelBody,Qe as PartSourceNote,En as PartStyleSelect,Ln as default,Q as partFace};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const SITE_PHOTOGRAPHY_LABEL = "Photography";
|
|
2
|
-
export default function PhotographyField({ value, onChange,
|
|
2
|
+
export default function PhotographyField({ value, onChange, }: {
|
|
3
3
|
value: boolean | null;
|
|
4
4
|
onChange: (v: boolean | null) => void;
|
|
5
|
-
showHint?: boolean;
|
|
6
5
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a}from"react/jsx-runtime";import{SettingsDefaultReset as
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import{SettingsDefaultReset as h,SettingsField as d,SettingsSegmented as p}from"efficient-easel/panel";import{DropIcon as f}from"efficient-easel/icons";import{say as e,editorEaselWords as g}from"../../format/lib/editor-words.js";const o="Photography",c={shot:"As shot",mono:"Black and white"},l=[{grayscale:!1,label:c.shot},{grayscale:!0,label:c.mono}],m="Black and white photographs return to color on hover. Wheels and tyres keep their real finish either way.";function u({value:n,onChange:s}){const r=n===null,i=n??!1;return a(d,{label:e(o),icon:a(f,{}),value:e(l.find(t=>t.grayscale===i).label),changed:!r,action:a(h,{words:g()?.panel,label:e(o),changed:!r,detail:e(l.find(t=>!t.grayscale).label),onReset:()=>s(null)}),hint:e(m),children:a(p,{options:l.map(t=>({id:t.grayscale,label:e(t.label)})),value:i,ariaLabel:e(o),onChange:s})})}export{o as SITE_PHOTOGRAPHY_LABEL,u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,jsxs as h,Fragment as M}from"react/jsx-runtime";import{useState as be}from"react";import{useEasel as we,useRootFields as ge}from"efficient-easel/easel";import{Button as Ee,EmptyState as ke}from"efficient-shell/ui";import{PAGE_STYLE_FIELDS as K}from"../lib/document/page-root-fields.js";import{rootPanelHead as Pe}from"../../format/lib/document/root-panel.js";import{headWords as W,InspectorHead as ve,InspectorIconButton as z}from"efficient-easel/chrome";import{DuplicateIcon as Ie,TrashIcon as Le}from"efficient-easel/icons";import{panelFieldsOf as Te}from"efficient-easel/screen/lib/document/panel-fields";import{TICKER_PART_LABEL as j}from"../../render/components/PreviewTickerContext.js";import ye from"./SectionIcon.js";import{PanelHideButton as G}from"efficient-easel/screen/components/SidePanelHead";import{useEaselSession as Oe}from"efficient-easel/screen/lib/session-context";import{say as o}from"../../format/lib/editor-words.js";import _e,{HintsToggle as Ne,SHOW_HINTS_DEFAULT as He,SITE_STYLES_BASICS_TAB as Re}from"./WebsiteSettingsPanel.js";import Ae from"./ChatSettingsPanel.js";import De from"./SocialLinksPanel.js";import Ce from"./TickerSettingsPanel.js";import Fe,{PartSourceNote as Be}from"./PartSettingsPanel.js";import{regionsForSection as xe}from"../../format/lib/sections/section-text-regions.js";import{TEXT_KIND_LABELS as Me}from"../../format/lib/sections/section-text-kinds.js";import{textRegionOfPartKey as Ke}from"../../format/lib/sections/text-regions.js";import We from"./DuplicateToPageMenu.js";import{usePageRows as ze}from"../lib/page-rows.js";import{useScreenDocument as je}from"efficient-easel/screen/components/ScreenDocumentContext";import{usePreviewHeader as Ge}from"../../render/components/PreviewHeaderContext.js";import{useSectionOps as Ye}from"efficient-easel/screen/lib/document/use-section-ops";import{SELECTION_MODE as Ue,isSelectionMode as I}from"efficient-easel/screen/lib/screen-parts";import{usePreviewParts as Xe}from"efficient-easel/draw/client";import{entryPartsOf as Ze,SectionTextEntries as $e}from"./SectionTextEntries.js";import{SectionTextSuppressProvider as qe}from"../lib/document/section-text-suppress.js";import{HEADER_TYPE as Je,ROOT_ZONE as Y}from"efficient-easel/draw";import{websiteDuplicateBlocked as Qe}from"../lib/document/every-page.js";import{FOOTER_TYPE as L}from"../lib/document/footer-blocks.js";import Ve from"./SwitchToBoxFooter.js";import{SiteFields as U}from"./SiteFields.js";import et from"./HeroPartPanel.js";import{HERO_MEDIA_PART_LABELS as tt,HERO_PART_MODE as nt,heroPartLabel as ot}from"../../render/lib/document/hero-media-parts.js";import{SettingsSwitch as rt}from"efficient-easel/panel";import{foldTopTier as it}from"../lib/document/field-groups.js";import{FoldHeadingScope as st}from"../lib/document/panel-heading-scope.js";import{partRowField as at}from"../lib/document/part-row-field.js";import{decodePartKey as lt,partRowHeadLabel as ct}from"../../render/lib/document/part-rows.js";import{encodePartId as dt,partHeadLabel as pt,partLabel as mt,sectionTextParts as ft}from"../../render/lib/document/text-parts.js";import{partSourceOf as ut,sourceMenuIdOf as ht,sourceSlugOf as St}from"../../format/lib/document/source-bound-parts.js";const wn=Ue,gn={kind:"header"},En={kind:"website"},kn={kind:"website",tab:Re,revealPageGroup:!0},Pn={kind:"chat"},vn={kind:"social"},w="Part";function bt(e){return o("Part of {name}",{name:o(e)})}function wt(e,r,i){const s=e.describeNode(r);return{name:i,kindLabel:s?bt(s.label):o(w)}}function gt(e){switch(e){case"Header":return{title:o("Header settings belong to a website."),own:o("Each website created from this template sets its own header afterwards.")};case"Appearance":return{title:o("Appearance settings belong to a website."),own:o("Each website created from this template sets its own appearance afterwards.")};case"Live chat":return{title:o("Live chat settings belong to a website."),own:o("Each website created from this template sets its own live chat afterwards.")};case"Social link":return{title:o("Social link settings belong to a website."),own:o("Each website created from this template sets its own social link afterwards.")};default:return{title:o("{what} settings belong to a website.",{what:e}),own:o("Each website created from this template sets its own {what} afterwards.",{what:e.toLowerCase()})}}}function X({what:e}){const r=gt(e);return h("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:r.title})}),h("p",{children:[o("A template is a blueprint — it has no website of its own, so there is nothing here to change.")," ",r.own]})]})}function T(e){const r=nt[e];return{name:tt[e],kindLabel:w,icon:r,head:(i,s)=>{if(i.kind!==r)return null;const d=s.describeNode(i.nodeId);if(!d)return null;const S=W({name:o(ot(e,d.props)),tier:"part",of:o(d.label)},{partOf:({name:p})=>o("Part of {name}",{name:p})});return{name:S.name,kindLabel:S.kind}},render:(i,s)=>i.kind===r?n(et,{nodeId:i.nodeId,part:e,sectionName:s.describeNode(i.nodeId)?.label??"Hero",onUpToSection:()=>s.onSelectNode(i.nodeId)}):null}}const Et={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,r)=>{const i=r.hostPanels?.header;return i?n(i,{placeholderMode:r.capabilities.placeholderFrames,tokenRef:r.tokenRef,siteId:r.siteId,websiteName:r.websiteName,onOpenWebsiteSettings:r.onOpenWebsiteSettings,onAuthExpired:()=>r.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,r)=>n(_e,{initialTab:e.tab,revealPageGroup:e.revealPageGroup,themeFromDocument:!r.capabilities.hasSiteTheme,tokenRef:r.tokenRef,siteId:r.siteId,onNotify:r.onNotify},e.tab??"")},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>n(Ae,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>n(De,{unavailable:n(X,{what:"Social link"})})},ticker:{name:j,kindLabel:w,icon:"ticker",head:(e,r)=>e.kind==="ticker"?wt(r,e.heroId,o(j)):null,render:e=>n(Ce,{heroId:e.kind==="ticker"?e.heroId:""})},heroMedia:T("media"),heroImage:T("image"),heroImage2:T("image2"),part:{name:w,kindLabel:w,icon:"Text",head:(e,r)=>{if(e.kind!=="part")return null;const i=r.describeNode(e.nodeId);if(!i)return null;const{key:s,row:d}=lt(e.propKey),S=d?at(i.fields[s],d):i.fields[s],p=xe(i.type),m=p?Ke(p,e.propKey):null,f=p&&m?p[m].label:Me[e.propKey],g=f?o(f):ct(o(pt(mt(S??{},s))),d),E=W({name:g,tier:"part",of:o(i.label)},{partOf:({name:k})=>o("Part of {name}",{name:k})});return{name:E.name,kindLabel:E.kind}},render:(e,r)=>e.kind==="part"?n(Fe,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>r.onSelectNode(e.nodeId),onEditStyle:r.onOpenSiteStyles}):null}},kt=new Set(["header","website","chat"]);function Pt(e,r){if(e==="selection")return null;const i=Et[e];return kt.has(e)&&!r.hasSiteSettings?{...i,kindLabel:"Not part of a template",render:()=>n(X,{what:i.name})}:i}function vt({mode:e,onOpenWebsiteSettings:r,onOpenSiteStyles:i,onOpenPageStyles:s,onSelectNode:d,hideNodeActions:S=!1,onNotify:p,onHidePanel:m}){const{capabilities:f,tokenRef:g,notifyParent:E,currentSlug:k,siteId:y,runAuthed:Z,readOnly:$,navigate:It}=je(),{rows:q}=ze(),O=q?.find(l=>l.slug===k)??null,J=ge(),Q=Object.keys(J.fields).some(l=>!l.startsWith("_")&&!K.includes(l)),{websiteName:V}=Ge(),P=Ye({readOnly:$}),{select:ee}=Xe(),{selectedItem:t,getItemById:te,getSelectorForId:ne,config:u,appState:oe}=we(l=>l),re=Te(u,t?{type:t.type,props:t.props}:null),_=t?ft(re??u.components[t.type]?.fields,t.props):[],ie=l=>u.components[l]?.label??l,a=t?ne(t.props.id):void 0,c=Pt(e.kind,f),se=Oe(),N={capabilities:f,tokenRef:g,hostPanels:se.chrome?.panels,describeNode:l=>{const b=te(l);if(!b)return null;const x=u.components[b.type];return{type:b.type,label:x?.label??b.type,fields:x?.fields??{},props:b.props??{}}},siteId:y,websiteName:V??null,notifyParent:E,onNotify:p,onOpenWebsiteSettings:r,onOpenSiteStyles:i,onSelectNode:d},H=c?.head?.(e,N)??null,R=Pe({kind:O?.kind,pageName:O?.label}),ae=H?.name??(c?o(c.name):t?o(ie(t.type)):R.name),le=H?.kindLabel??(c?o(c.kindLabel):t?a&&a.zone!==Y?o("Block"):o("Section"):R.kindLabel),ce=c?c.icon:t?t.type:"page",A=c?null:t?u.components[t.type]?.fields??null:u.root?.fields??null,de=A?it(A):2,D=I(e)&&t?ut(t.type):null,pe=!!t&&!!a&&a.zone===Y&&t.type!==L&&t.type!==Je,v=Qe(oe?.data,t),me=()=>{v||a&&P.duplicateComponent(a.zone,a.index)},fe=()=>{a&&(P.removeComponent(a.zone,a.index),P.select(null))},ue=t?u.components[t.type]?.defaultProps?.previewHover:void 0,C=I(e)&&!!t&&!!a&&ue!==void 0,F=C&&t.props.previewHover===!0,he=()=>{!t||!a||P.replaceComponent(a.zone,a.index,{...t,props:{...t.props,previewHover:!F}})},[B,Se]=be(He);return h("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right${B||!(!c&&!!t)?"":" sf-hints-folded"}`,children:[n(ve,{icon:n(ye,{type:ce,size:15}),name:ae,kind:le,actions:!S&&I(e)&&t&&t.type!==L?h(M,{children:[n(z,{label:o("Duplicate section"),title:v??void 0,disabled:v!==null,onClick:me,children:n(Ie,{size:15})}),pe&&f.hasSiteSettings&&n(We,{node:t,currentSlug:k,siteId:y??void 0,tokenRef:g,runAuthed:Z,onNotify:p}),n(z,{label:o("Remove section"),danger:!0,onClick:fe,children:n(Le,{size:15})}),m?n(G,{side:"right",onHide:m,divider:!0}):null]}):m?n(G,{side:"right",onHide:m}):void 0}),C&&h("div",{className:"sf-preview-pin",children:[h("div",{className:"sf-preview-pin-text",children:[n("span",{className:"sf-preview-pin-label",children:o("Preview hover state")}),n("span",{className:"sf-preview-pin-hint",children:o("not shown live")})]}),n(rt,{checked:F,onChange:he,ariaLabel:o("Preview hover state")})]}),n(st,{tier:de,children:n("div",{className:"sf-insp-body es-insp-body sf-scroll",children:c?c.render(e,N):t?h(M,{children:[t.type===L&&f.hasSiteSettings&&n(Ve,{}),n(qe,{children:n(U,{entries:n($e,{parts:_,heading:!1,onOpen:l=>ee(dt(t.props.id,l))}),entryCount:Ze(_).length})}),D&&n(Be,{source:D,slug:St(t?.props),menuId:ht(t?.props)}),n(Ne,{shown:B,onChange:Se})]}):Q?n(U,{omit:K}):n(ke,{variant:"none",icon:!1,message:o("Select a section or block to edit it."),children:s&&n(Ee,{variant:"secondary",onClick:s,children:o("This page")})})})})]})}export{Pn as CHAT_MODE,gn as HEADER_MODE,wn as SELECTION_MODE,vn as SOCIAL_MODE,En as WEBSITE_MODE,kn as WEBSITE_PAGE_MODE,vt as default,Pt as resolvePanel};
|
|
1
|
+
"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};
|