efficient-web-builder 55.3.1 → 57.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 +66 -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/HeroPartPanel.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/SiteFields.d.ts +2 -1
- package/dist/editor/components/SiteFields.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 +40 -39
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- package/dist/editor/components/useSectionToBoxPass.js +1 -1
- package/dist/editor/lib/animation/entrance-fields.d.ts +0 -3
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/animation/loop-fields.d.ts +2 -0
- package/dist/editor/lib/animation/loop-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +2 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/editor/lib/host-document-bridge.d.ts +2 -1
- package/dist/editor/lib/host-document-bridge.js +1 -1
- package/dist/editor/lib/keyed-store.d.ts +7 -0
- package/dist/editor/lib/keyed-store.js +1 -0
- package/dist/editor/lib/page-live-state.js +1 -1
- package/dist/editor/lib/page-video-frames.d.ts +11 -0
- package/dist/editor/lib/page-video-frames.js +1 -0
- package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/editor/lib/sections/new-section-node.js +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/animation/hover.d.ts +2 -3
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/animation/loop.js +1 -1
- package/dist/format/lib/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/passes/settings-groups.js +1 -1
- package/dist/format/lib/document/section-catalog.js +6 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +13 -2
- package/dist/format/lib/editor-words-catalogue.js +5 -5
- 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 +12 -0
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/sections/active-press-context.d.ts +4 -0
- package/dist/format/lib/sections/active-press-context.js +1 -0
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/sections/section-presets.d.ts +5 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/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/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +2 -2
- package/dist/format/lib/web-backend.d.ts +17 -0
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/BoxCellContext.d.ts +14 -0
- package/dist/render/components/BoxCellContext.js +1 -0
- 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/LogoBlock.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/HeroSingle/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-row-parts.d.ts +0 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/page-render.js +1 -1
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/sanitize.d.ts +1 -0
- package/dist/render/lib/document/sanitize.js +1 -1
- package/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 +5 -5
- package/dist/editor/components/KeepHint.d.ts +0 -5
- package/dist/editor/components/KeepHint.js +0 -1
- package/dist/render/components/BoxCellWidthContext.d.ts +0 -2
- package/dist/render/components/BoxCellWidthContext.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type HintsStore } from "efficient-easel/screen/lib/hints";
|
|
3
|
+
import type { WebsitePreferences } from "../../format/lib/web-backend.js";
|
|
4
|
+
export declare function createWebsiteHintsStore(preferences: WebsitePreferences): HintsStore;
|
|
5
|
+
export declare function useWebsiteHintsStore(preferences: WebsitePreferences | undefined): HintsStore | null;
|
|
6
|
+
export default function WebsiteHintsProvider({ children }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{useMemo as i}from"react";import{HintsProvider as u}from"efficient-easel/screen/lib/hints";import{useEaselSession as c}from"efficient-easel/screen/lib/session-context";import{backendOf as f}from"../lib/website-session.js";function a(t){let s;const o=new Set,r=()=>{for(const e of o)e()};return t.get().then(e=>{s===void 0&&typeof e.showHints=="boolean"&&(s=e.showHints,r())}).catch(()=>{}),{read:()=>s,save:e=>{s=e,r(),t.update({showHints:e}).catch(()=>{})},subscribe:e=>(o.add(e),()=>{o.delete(e)})}}function l(t){return i(()=>t?a(t):null,[t])}function d({children:t}){const s=f(c()).preferences,o=l(s);return n(u,{store:o,children:t})}export{a as createWebsiteHintsStore,d as default,l as useWebsiteHintsStore};
|
|
@@ -3,11 +3,6 @@ import type { SiteThemeRowPatch } from "../../format/lib/site-theme-row.js";
|
|
|
3
3
|
import { type CardShadow, type HoverEffect } from "../../format/lib/theme.js";
|
|
4
4
|
export declare const SITE_STYLES_ID_PREFIX = "sf-site-styles";
|
|
5
5
|
export declare const TABPANEL_CLASS = "sf-site-styles-tabpanel";
|
|
6
|
-
export declare const SHOW_HINTS_DEFAULT = false;
|
|
7
|
-
export declare function HintsToggle({ shown, onChange, }: {
|
|
8
|
-
shown: boolean;
|
|
9
|
-
onChange: (v: boolean) => void;
|
|
10
|
-
}): import("react").JSX.Element;
|
|
11
6
|
export declare const SITE_STYLES_TEXT_TAB = "text";
|
|
12
7
|
export declare const SITE_STYLES_BASICS_TAB = "basics";
|
|
13
8
|
export declare const THIS_PAGE_GROUP_ID = "this-page-group";
|
|
@@ -22,34 +17,28 @@ export declare function blockGapPatch(v: number | null): SiteThemeRowPatch;
|
|
|
22
17
|
export declare function blockGapPhonePatch(v: number | null): SiteThemeRowPatch;
|
|
23
18
|
export declare function siteGutterPatch(v: number | null): SiteThemeRowPatch;
|
|
24
19
|
export declare function siteGutterPhonePatch(v: number | null): SiteThemeRowPatch;
|
|
25
|
-
export declare function SideSpaceRootField({ persist,
|
|
20
|
+
export declare function SideSpaceRootField({ persist, }: {
|
|
26
21
|
persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
|
|
27
|
-
showHint: boolean;
|
|
28
22
|
}): import("react").JSX.Element | null;
|
|
29
|
-
export declare function BlockGapRootField({ persist,
|
|
23
|
+
export declare function BlockGapRootField({ persist, }: {
|
|
30
24
|
persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
|
|
31
|
-
showHint: boolean;
|
|
32
25
|
}): import("react").JSX.Element | null;
|
|
33
|
-
export declare function PageGroupFields({ persist,
|
|
26
|
+
export declare function PageGroupFields({ persist, }: {
|
|
34
27
|
persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
|
|
35
|
-
showHint?: boolean;
|
|
36
28
|
}): import("react").JSX.Element;
|
|
37
29
|
export declare function cardShadowPatch(v: CardShadow | null): SiteThemeRowPatch;
|
|
38
30
|
export declare function shadowColourPatch(hex: string | null): SiteThemeRowPatch;
|
|
39
31
|
export declare function hoverEffectPatch(v: HoverEffect | null): SiteThemeRowPatch;
|
|
40
|
-
export declare function CardLookFields({ persist,
|
|
32
|
+
export declare function CardLookFields({ persist, }: {
|
|
41
33
|
persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
|
|
42
|
-
showHint?: boolean;
|
|
43
34
|
}): import("react").JSX.Element;
|
|
44
35
|
export declare function photographyPatch(v: boolean | null): SiteThemeRowPatch;
|
|
45
|
-
export declare function PhotographyGroupFields({ persist,
|
|
36
|
+
export declare function PhotographyGroupFields({ persist, }: {
|
|
46
37
|
persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
|
|
47
|
-
showHint?: boolean;
|
|
48
38
|
}): import("react").JSX.Element;
|
|
49
39
|
export declare function shareButtonPatch(v: boolean | null): SiteThemeRowPatch;
|
|
50
|
-
export declare function ShareButtonRootField({ persist,
|
|
40
|
+
export declare function ShareButtonRootField({ persist, }: {
|
|
51
41
|
persist: (p: SiteThemeRowPatch, immediate?: boolean) => void;
|
|
52
|
-
showHint?: boolean;
|
|
53
42
|
}): import("react").JSX.Element;
|
|
54
43
|
export declare function useWebsiteName(): string;
|
|
55
44
|
export declare function WebsiteNameReadonly(): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as C,jsxs as T}from"react/jsx-runtime";import{useEasel as O,useRootFields as z}from"efficient-easel/easel";import{Inspector as Y}from"efficient-easel/fields";import{SettingsGroup as j}from"efficient-easel/panel";import{useEffect as U,useRef as X,useState as R}from"react";import q from"./ThemeField.js";import K from"./CornersField.js";import M from"./CardShadowField.js";import $ from"./ShadowColourField.js";import V,{blockGapRow as J}from"./BlockGapField.js";import Q from"./HoverEffectField.js";import Z from"./PhotographyField.js";import D from"./ShareButtonField.js";import{usePreviewDevice as k}from"efficient-easel/draw/client";import ee,{sideSpaceRow as te}from"./SideSpaceField.js";import{BackgroundWidthRow as oe,ContentWidthRow as ne,SITE_BACKGROUND_HINT as re,SITE_CONTENT_HINT as ie}from"./SectionWidthRows.js";import se from"./SiteAccentField.js";import ae from"./SiteTextStylesField.js";import{usePreviewHeader as g}from"../../render/components/PreviewHeaderContext.js";import{Button as ce,EmptyState as le,SliderGroup as ue,Tabs as de,Tooltip as he,tabButtonId as pe,tabPanelId as fe}from"efficient-shell/ui";import{ContrastIcon as ge,NoteIcon as me,SettingsIcon as Se,TypeIcon as _e}from"efficient-easel/icons";import{useThemeRowPersist as we}from"../lib/theme-row-persist.js";import{themeSaveNotice as xe}from"../../format/lib/theme-save-message.js";import{say as m}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as Te}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as E}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as Ce}from"../lib/document/page-root-fields.js";import{previewFrame as be}from"efficient-easel/screen/lib/document/preview-dom";import{siteTextColourNameOf as ye,siteTextColours as Pe}from"../../format/lib/text-styles/site-text-colours.js";import{useSiteTextStylesWriter as Re}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as Ee,normalizeCornerRadius as Ie,normalizeCornerStyle as Ge,normalizeShadowColor as ke}from"../../format/lib/theme.js";const F="sf-site-styles",Fe="sf-site-styles-tabpanel",He=!1,Oe="Show hints";function Be({shown:e,onChange:t}){return o("div",{className:"sf-hints",children:o(ce,{type:"button",variant:"ghost","aria-pressed":e,leftIcon:o(me,{size:13}),onClick:()=>t(!e),children:m(Oe)})})}const jt="text",B="basics",N="this-page-group",I=[{id:B,label:"Basics",icon:o(Se,{})},{id:"theme",label:"Theme",icon:o(ge,{})},{id:"text",label:"Text",icon:o(_e,{})}];function Ne({themeFromDocument:e,persist:t}){const{appState:n,dispatch:r}=O(d=>d),{theme:l,setTheme:s}=g(),u=n.data,h=u.root?.props??{},i=d=>{if(e){const p={...h,theme:d};r({type:"replaceRoot",root:{...u.root,props:p},recordHistory:!0})}else s(d);t({selected_preset:d.selected,theme_presets:d.themes})};return o(q,{value:e?h.theme:l,onChange:i})}function ve({themeFromDocument:e,persist:t}){const[n,r]=R(null),{theme:l,setFonts:s,setSizes:u,setHeadingTypography:h}=g(),i=Re({themeFromDocument:e,persist:t}),{old:d,saved:p,writeRoot:f}=i,S=i.fonts,a=i.sizes,x=i.typography,b=c=>c.values.size??ze(Ae[c.id]??"body")??Le[c.kind],_=c=>i.write(c),G=Pe(l),y=ye(l),P=c=>{const w={...S,accent:c};e?f({fonts:w}):s(w),t({accent_font:c})},A=c=>{u({...a,accent:c}),t({accent_size_px:c})},L=c=>{const w={...x,weightStrong:c};e?f({headingTypography:w}):h(w),t({heading_weight_strong:c})},W=c=>{const w={...x,italicStrong:c};e?f({headingTypography:w}):h(w),t({accent_italic:c})};return T(C,{children:[o(ae,{saved:p,old:d,colours:G,colourNameOf:y,sizeOf:b,onChange:_,openId:n===H?null:n,onOpenChange:r,withoutSize:e}),o(se,{font:S.accent,size:a.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:n===H,onOpenChange:c=>r(c?H:null),onChange:c=>{c.key==="font"?P(c.value):c.key==="size"?A(c.value):c.key==="weight"?L(c.value):W(c.value)},withoutSize:e})]})}const H="accent",Ae={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Le={heading:32,body:14},We={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function ze(e){if(typeof document>"u")return null;const n=(be()?.contentDocument??document).querySelector(We[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function Ye({themeFromDocument:e,persist:t,showHint:n}){const{appState:r,dispatch:l}=O(a=>a),{cornerRadiusPx:s,setCornerRadiusPx:u}=g(),h=r.data,i=h.root?.props??{},d=i.cornerRadiusPx===void 0?Ee[Ge(i.cornerStyle)]:Ie(i.cornerRadiusPx),p=e?d:s,f=a=>l({type:"replaceRoot",root:{...h.root,props:{...i,...a}},recordHistory:!0});return o(K,{value:p,onChange:a=>{e?f({cornerRadiusPx:a}):u(a),t({corner_radius_px:a})},showHint:n})}function je(e){return{site_width:e}}function Ue({persist:e,showHint:t}){const{siteWidth:n,setSiteWidth:r,sectionBackgroundWidth:l,setSectionBackgroundWidth:s,sectionContentWidth:u,setSectionContentWidth:h}=g();if(k()!=="desktop")return null;const d=typeof n=="number"?n:E.default,p=a=>{r(a),e(je(a),a===null)},f=a=>{s(a),e({section_background_width:a},!0)},S=a=>{h(a),e({section_content_width:a},!0)};return T(C,{children:[o(oe,{value:l??"full",changed:l!==null,detail:m("Full width"),onChange:f,onReset:()=>f(null),hint:t?re:void 0}),o(ne,{mode:u??"content",px:d,min:E.min,max:E.max,changed:typeof n=="number"||u!==null,detail:`${m("Content width")} ${E.default}px`,onMode:S,onPx:a=>p(a),onReset:()=>{S(null),p(null)},hint:t?ie:void 0})]})}function Xe(e){return{block_gap:e}}function qe(e){return{block_gap_phone:e}}function Ke(e){return{site_gutter:e}}function Me(e){return{site_gutter_phone:e}}function v(e,[t,n],r){t(e),r(n(e),e===null)}function $e({persist:e,showHint:t}){const{siteGutter:n,siteGutterPhone:r,setSiteGutter:l,setSiteGutterPhone:s}=g(),u=te(k(),{gutter:n,phone:r});if(!u)return null;const h=u.key==="site_gutter_phone"?[s,Me]:[l,Ke];return o(ee,{value:u.value,onChange:i=>v(i,h,e),showHint:t,unsetPx:u.unsetPx,bounds:u.bounds})}function Ve({persist:e,showHint:t}){const{blockGap:n,blockGapPhone:r,setBlockGap:l,setBlockGapPhone:s}=g(),u=J(k(),{gap:n,phone:r});if(!u)return null;const h=u.key==="block_gap_phone"?[s,qe]:[l,Xe];return o(V,{value:u.value,onChange:i=>v(i,h,e),showHint:t,followsPx:u.followsPx})}function Je({persist:e,showHint:t=!0}){return T(C,{children:[o(Ue,{persist:e,showHint:t}),o($e,{persist:e,showHint:t}),o(Ve,{persist:e,showHint:t})]})}function Qe(e){return{card_shadow:e}}function Ze(e){return e===null?{shadow_color:null}:{shadow_color:ke(e)}}function De(e){return{hover_effect:e}}function et({persist:e,showHint:t=!0}){const{cardShadow:n,setCardShadow:r,shadowColor:l,setShadowColor:s,hoverEffect:u,setHoverEffect:h}=g();return T(C,{children:[o(M,{value:n,onChange:i=>{r(i),e(Qe(i),!0)},showHint:t}),o($,{value:l,onChange:i=>{s(i),e(Ze(i),i===null)},showHint:t}),o(Q,{value:u,onChange:i=>{h(i),e(De(i),!0)},showHint:t})]})}function tt(e){return{photography_grayscale:e}}function ot({persist:e,showHint:t}){const{photographyGrayscale:n,setPhotographyGrayscale:r}=g();return o(Z,{value:n,onChange:s=>{r(s),e(tt(s),!0)},showHint:t})}function nt({persist:e,showHint:t=!0}){return o(C,{children:o(ot,{persist:e,showHint:t})})}function rt(e){return{share_button_on_posts:e}}function it({persist:e,showHint:t=!0}){const{shareButtonOnPosts:n,setShareButtonOnPosts:r}=g();return o(D,{value:n,onChange:s=>{r(s),e(rt(s),!0)},showHint:t})}function st(){const{websiteName:e}=g();return e?.trim()||Te}function Ut(){const e=st();return o(he,{content:m("{name} — renamed in the Console: {place}.",{name:e,place:m("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:o("span",{className:"sf-panel-site",children:e})})}function at({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:r,tab:l,onTabChange:s,initialTab:u,revealPageGroup:h=!1,onPageGroupRevealed:i}){const{persist:d}=we({themeFromDocument:e,tokenRef:t,siteId:n,onResult:y=>{const P=xe(y);P&&r?.(P.msg,P.tone)}}),[p,f]=R(u??I[0].id),S=l!==void 0,a=S?l:p,x=S?s??(()=>{}):f,b=I.find(y=>y.id===a)??I[0],[_,G]=R(He);return T(ue,{children:[o(ut,{activeId:b.id,onSelect:x}),T("div",{id:fe(F,b.id),className:Fe,role:"tabpanel","aria-labelledby":pe(F,b.id),children:[a===B&&T(C,{children:[o(Ye,{themeFromDocument:e,persist:d,showHint:_}),!e&&o(et,{persist:d,showHint:_}),!e&&o(Je,{persist:d,showHint:_}),!e&&o(nt,{persist:d,showHint:_}),!e&&o(it,{persist:d,showHint:_}),o(ct,{reveal:h,onRevealed:i}),o(Be,{shown:_,onChange:G})]}),a==="theme"&&o(Ne,{themeFromDocument:e,persist:d}),a==="text"&&o(ve,{themeFromDocument:e,persist:d})]})]})}function ct({reveal:e,onRevealed:t}){const[n,r]=R(!0),l=X(t);return l.current=t,U(()=>{if(!e)return;r(!0);const s=requestAnimationFrame(()=>{document.getElementById(N)?.scrollIntoView({block:"start"}),l.current?.()});return()=>cancelAnimationFrame(s)},[e]),o(j,{title:m("This page"),open:n,onToggle:r,id:N,children:o(lt,{})})}function lt(){const{fields:e,values:t,readOnly:n,onChange:r}=z(),l=Object.fromEntries(Ce.filter(s=>s in e).map(s=>[s,e[s]]));return Object.keys(l).length===0?o(le,{variant:"none",icon:!1,message:m("This page has no look of its own to set.")}):o(Y,{fields:l,values:t,onChange:r,readOnly:n,tabs:!1,idPrefix:"this-page",ariaLabel:m("This page")})}function ut({activeId:e,onSelect:t}){return o("div",{className:"es-insp-tabs",children:o(de,{variant:"underline",block:!0,labelsFit:!0,"aria-label":m("Styles"),idPrefix:F,value:e,onChange:t,items:I.map(n=>{const r=m(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{Ve as BlockGapRootField,et as CardLookFields,Be as HintsToggle,Je as PageGroupFields,nt as PhotographyGroupFields,He as SHOW_HINTS_DEFAULT,B as SITE_STYLES_BASICS_TAB,F as SITE_STYLES_ID_PREFIX,I as SITE_STYLES_TABS,jt as SITE_STYLES_TEXT_TAB,it as ShareButtonRootField,$e as SideSpaceRootField,ut as SiteStylesTabStrip,Fe as TABPANEL_CLASS,N as THIS_PAGE_GROUP_ID,Ut as WebsiteNameReadonly,Xe as blockGapPatch,qe as blockGapPhonePatch,Qe as cardShadowPatch,at as default,De as hoverEffectPatch,tt as photographyPatch,Ze as shadowColourPatch,rt as shareButtonPatch,Ke as siteGutterPatch,Me as siteGutterPhonePatch,je as siteWidthPatch,st as useWebsiteName};
|
|
1
|
+
"use client";import{jsx as t,Fragment as T,jsxs as C}from"react/jsx-runtime";import{useEasel as I,useRootFields as H}from"efficient-easel/easel";import{Inspector as Y}from"efficient-easel/fields";import{SettingsGroup as j}from"efficient-easel/panel";import{useEffect as X,useRef as U,useState as E}from"react";import q from"./ThemeField.js";import K from"./CornersField.js";import M from"./CardShadowField.js";import $ from"./ShadowColourField.js";import V,{blockGapRow as J}from"./BlockGapField.js";import Q from"./HoverEffectField.js";import Z from"./PhotographyField.js";import D from"./ShareButtonField.js";import{usePreviewDevice as G}from"efficient-easel/draw/client";import ee,{sideSpaceRow as te}from"./SideSpaceField.js";import{BackgroundWidthRow as oe,ContentWidthRow as ne,SITE_BACKGROUND_HINT as re,SITE_CONTENT_HINT as ie}from"./SectionWidthRows.js";import se from"./SiteAccentField.js";import ae from"./SiteTextStylesField.js";import{usePreviewHeader as f}from"../../render/components/PreviewHeaderContext.js";import{EmptyState as ce,SliderGroup as le,Tabs as ue,Tooltip as de,tabButtonId as pe,tabPanelId as he}from"efficient-shell/ui";import{ContrastIcon as fe,SettingsIcon as ge,TypeIcon as me}from"efficient-easel/icons";import{useThemeRowPersist as Se}from"../lib/theme-row-persist.js";import{themeSaveNotice as _e}from"../../format/lib/theme-save-message.js";import{say as m}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as xe}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as w}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as Ce}from"../lib/document/page-root-fields.js";import{previewFrame as Te}from"efficient-easel/screen/lib/document/preview-dom";import{siteTextColourNameOf as be,siteTextColours as Pe}from"../../format/lib/text-styles/site-text-colours.js";import{useSiteTextStylesWriter as ye}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as we,normalizeCornerRadius as Re,normalizeCornerStyle as Ee,normalizeShadowColor as Ge}from"../../format/lib/theme.js";const k="sf-site-styles",ke="sf-site-styles-tabpanel",Lt="text",O="basics",B="this-page-group",R=[{id:O,label:"Basics",icon:t(ge,{})},{id:"theme",label:"Theme",icon:t(fe,{})},{id:"text",label:"Text",icon:t(me,{})}];function Fe({themeFromDocument:e,persist:o}){const{appState:n,dispatch:r}=I(u=>u),{theme:s,setTheme:i}=f(),d=n.data,a=d.root?.props??{},p=u=>{if(e){const h={...a,theme:u};r({type:"replaceRoot",root:{...d.root,props:h},recordHistory:!0})}else i(u);o({selected_preset:u.selected,theme_presets:u.themes})};return t(q,{value:e?a.theme:s,onChange:p})}function Ie({themeFromDocument:e,persist:o}){const[n,r]=E(null),{theme:s,setFonts:i,setSizes:d,setHeadingTypography:a}=f(),p=ye({themeFromDocument:e,persist:o}),{old:u,saved:h,writeRoot:g}=p,l=p.fonts,_=p.sizes,x=p.typography,b=c=>c.values.size??Ae(Oe[c.id]??"body")??Be[c.kind],P=c=>p.write(c),y=Pe(s),A=be(s),N=c=>{const S={...l,accent:c};e?g({fonts:S}):i(S),o({accent_font:c})},L=c=>{d({..._,accent:c}),o({accent_size_px:c})},W=c=>{const S={...x,weightStrong:c};e?g({headingTypography:S}):a(S),o({heading_weight_strong:c})},z=c=>{const S={...x,italicStrong:c};e?g({headingTypography:S}):a(S),o({accent_italic:c})};return C(T,{children:[t(ae,{saved:h,old:u,colours:y,colourNameOf:A,sizeOf:b,onChange:P,openId:n===F?null:n,onOpenChange:r,withoutSize:e}),t(se,{font:l.accent,size:_.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:n===F,onOpenChange:c=>r(c?F:null),onChange:c=>{c.key==="font"?N(c.value):c.key==="size"?L(c.value):c.key==="weight"?W(c.value):z(c.value)},withoutSize:e})]})}const F="accent",Oe={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Be={heading:32,body:14},ve={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Ae(e){if(typeof document>"u")return null;const n=(Te()?.contentDocument??document).querySelector(ve[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function Ne({themeFromDocument:e,persist:o}){const{appState:n,dispatch:r}=I(l=>l),{cornerRadiusPx:s,setCornerRadiusPx:i}=f(),d=n.data,a=d.root?.props??{},p=a.cornerRadiusPx===void 0?we[Ee(a.cornerStyle)]:Re(a.cornerRadiusPx),u=e?p:s,h=l=>r({type:"replaceRoot",root:{...d.root,props:{...a,...l}},recordHistory:!0});return t(K,{value:u,onChange:l=>{e?h({cornerRadiusPx:l}):i(l),o({corner_radius_px:l})}})}function Le(e){return{site_width:e}}function We({persist:e}){const{siteWidth:o,setSiteWidth:n,sectionBackgroundWidth:r,setSectionBackgroundWidth:s,sectionContentWidth:i,setSectionContentWidth:d}=f();if(G()!=="desktop")return null;const p=typeof o=="number"?o:w.default,u=l=>{n(l),e(Le(l),l===null)},h=l=>{s(l),e({section_background_width:l},!0)},g=l=>{d(l),e({section_content_width:l},!0)};return C(T,{children:[t(oe,{value:r??"full",changed:r!==null,detail:m("Full width"),onChange:h,onReset:()=>h(null),hint:re}),t(ne,{mode:i??"content",px:p,min:w.min,max:w.max,changed:typeof o=="number"||i!==null,detail:`${m("Content width")} ${w.default}px`,onMode:g,onPx:l=>u(l),onReset:()=>{g(null),u(null)},hint:ie})]})}function ze(e){return{block_gap:e}}function He(e){return{block_gap_phone:e}}function Ye(e){return{site_gutter:e}}function je(e){return{site_gutter_phone:e}}function v(e,[o,n],r){o(e),r(n(e),e===null)}function Xe({persist:e}){const{siteGutter:o,siteGutterPhone:n,setSiteGutter:r,setSiteGutterPhone:s}=f(),i=te(G(),{gutter:o,phone:n});if(!i)return null;const d=i.key==="site_gutter_phone"?[s,je]:[r,Ye];return t(ee,{value:i.value,onChange:a=>v(a,d,e),unsetPx:i.unsetPx,bounds:i.bounds})}function Ue({persist:e}){const{blockGap:o,blockGapPhone:n,setBlockGap:r,setBlockGapPhone:s}=f(),i=J(G(),{gap:o,phone:n});if(!i)return null;const d=i.key==="block_gap_phone"?[s,He]:[r,ze];return t(V,{value:i.value,onChange:a=>v(a,d,e),followsPx:i.followsPx})}function qe({persist:e}){return C(T,{children:[t(We,{persist:e}),t(Xe,{persist:e}),t(Ue,{persist:e})]})}function Ke(e){return{card_shadow:e}}function Me(e){return e===null?{shadow_color:null}:{shadow_color:Ge(e)}}function $e(e){return{hover_effect:e}}function Ve({persist:e}){const{cardShadow:o,setCardShadow:n,shadowColor:r,setShadowColor:s,hoverEffect:i,setHoverEffect:d}=f();return C(T,{children:[t(M,{value:o,onChange:a=>{n(a),e(Ke(a),!0)}}),t($,{value:r,onChange:a=>{s(a),e(Me(a),a===null)}}),t(Q,{value:i,onChange:a=>{d(a),e($e(a),!0)}})]})}function Je(e){return{photography_grayscale:e}}function Qe({persist:e}){const{photographyGrayscale:o,setPhotographyGrayscale:n}=f();return t(Z,{value:o,onChange:s=>{n(s),e(Je(s),!0)}})}function Ze({persist:e}){return t(T,{children:t(Qe,{persist:e})})}function De(e){return{share_button_on_posts:e}}function et({persist:e}){const{shareButtonOnPosts:o,setShareButtonOnPosts:n}=f();return t(D,{value:o,onChange:s=>{n(s),e(De(s),!0)}})}function tt(){const{websiteName:e}=f();return e?.trim()||xe}function Wt(){const e=tt();return t(de,{content:m("{name} — renamed in the Console: {place}.",{name:e,place:m("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:t("span",{className:"sf-panel-site",children:e})})}function ot({themeFromDocument:e=!1,tokenRef:o,siteId:n,onNotify:r,tab:s,onTabChange:i,initialTab:d,revealPageGroup:a=!1,onPageGroupRevealed:p}){const{persist:u}=Se({themeFromDocument:e,tokenRef:o,siteId:n,onResult:P=>{const y=_e(P);y&&r?.(y.msg,y.tone)}}),[h,g]=E(d??R[0].id),l=s!==void 0,_=l?s:h,x=l?i??(()=>{}):g,b=R.find(P=>P.id===_)??R[0];return C(le,{children:[t(it,{activeId:b.id,onSelect:x}),C("div",{id:he(k,b.id),className:ke,role:"tabpanel","aria-labelledby":pe(k,b.id),children:[_===O&&C(T,{children:[t(Ne,{themeFromDocument:e,persist:u}),!e&&t(Ve,{persist:u}),!e&&t(qe,{persist:u}),!e&&t(Ze,{persist:u}),!e&&t(et,{persist:u}),t(nt,{reveal:a,onRevealed:p})]}),_==="theme"&&t(Fe,{themeFromDocument:e,persist:u}),_==="text"&&t(Ie,{themeFromDocument:e,persist:u})]})]})}function nt({reveal:e,onRevealed:o}){const[n,r]=E(!0),s=U(o);return s.current=o,X(()=>{if(!e)return;r(!0);const i=requestAnimationFrame(()=>{document.getElementById(B)?.scrollIntoView({block:"start"}),s.current?.()});return()=>cancelAnimationFrame(i)},[e]),t(j,{title:m("This page"),open:n,onToggle:r,id:B,children:t(rt,{})})}function rt(){const{fields:e,values:o,readOnly:n,onChange:r}=H(),s=Object.fromEntries(Ce.filter(i=>i in e).map(i=>[i,e[i]]));return Object.keys(s).length===0?t(ce,{variant:"none",icon:!1,message:m("This page has no look of its own to set.")}):t(Y,{fields:s,values:o,onChange:r,readOnly:n,tabs:!1,idPrefix:"this-page",ariaLabel:m("This page")})}function it({activeId:e,onSelect:o}){return t("div",{className:"es-insp-tabs",children:t(ue,{variant:"underline",block:!0,labelsFit:!0,"aria-label":m("Styles"),idPrefix:k,value:e,onChange:o,items:R.map(n=>{const r=m(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{Ue as BlockGapRootField,Ve as CardLookFields,qe as PageGroupFields,Ze as PhotographyGroupFields,O as SITE_STYLES_BASICS_TAB,k as SITE_STYLES_ID_PREFIX,R as SITE_STYLES_TABS,Lt as SITE_STYLES_TEXT_TAB,et as ShareButtonRootField,Xe as SideSpaceRootField,it as SiteStylesTabStrip,ke as TABPANEL_CLASS,B as THIS_PAGE_GROUP_ID,Wt as WebsiteNameReadonly,ze as blockGapPatch,He as blockGapPhonePatch,Ke as cardShadowPatch,ot as default,$e as hoverEffectPatch,Je as photographyPatch,Me as shadowColourPatch,De as shareButtonPatch,Ye as siteGutterPatch,je as siteGutterPhonePatch,Le as siteWidthPatch,tt as useWebsiteName};
|
|
@@ -1774,35 +1774,23 @@
|
|
|
1774
1774
|
above the box exists to act on that selection.
|
|
1775
1775
|
|
|
1776
1776
|
SCOPED TO THE MODIFIER, NEVER TO .es-field-hint ITSELF. The shared caption
|
|
1777
|
-
class
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
⚠️ IT FOLDS A ROW'S EXPLANATION, NEVER A STATE. Every quiet line is
|
|
1786
|
-
`.es-field-hint` now, and two kinds must stay on screen: the "Anchor name"
|
|
1787
|
-
sentence, the only place that term of art is explained, and the source note,
|
|
1788
|
-
which tells a merchant why clicking a hydrated word gave them no caret. Both
|
|
1789
|
-
are marked `.sf-hint-keep`, and the rule below leaves them alone. */
|
|
1790
|
-
/* ⚠️ AND NEVER A HINT THAT HOLDS `.sf-hint-keep` ([MERGE] One Settings Row And
|
|
1791
|
-
Hint In The Website Editor, 2026-10-06). The shop's own hint classes are
|
|
1792
|
-
gone; every quiet line under a control is `SettingsField`'s `hint`. The few
|
|
1793
|
-
that are a STATE rather than an explanation — loading, empty, why a control
|
|
1794
|
-
is disabled — wrap their words in `components/KeepHint.tsx`, and a line under
|
|
1795
|
-
no row wears `sf-hint-keep` itself; this rule leaves both on screen. `scripts/test-section-hints-fold.ts` holds both. */
|
|
1796
|
-
.sf-panel--right.sf-hints-folded .es-field-hint:not(.sf-hint-keep):not(:has(.sf-hint-keep)) {
|
|
1797
|
-
display: none;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1777
|
+
class carries every row's hint; a rule one class wider would take them all
|
|
1778
|
+
off at once.
|
|
1779
|
+
|
|
1780
|
+
AND THE PANEL'S ONE HINTS SWITCH WINS (owner 2026-11-07). While an
|
|
1781
|
+
inspector's hints are folded (`.es-hints-folded`, efficient-easel/panel),
|
|
1782
|
+
this hint stays hidden on focus too: every hint folds, and only a line that
|
|
1783
|
+
says the setting does nothing now stays (`InertHint`). The fold itself is
|
|
1784
|
+
easel's one rule in `panel.css`, not a copy here. */
|
|
1800
1785
|
.es-field-hint:has(.sf-hint-while-typing) {
|
|
1801
1786
|
display: none;
|
|
1802
1787
|
}
|
|
1803
1788
|
.es-field:focus-within > .es-field-hint:has(.sf-hint-while-typing) {
|
|
1804
1789
|
display: block;
|
|
1805
1790
|
}
|
|
1791
|
+
.es-hints-folded .es-field:focus-within > .es-field-hint:has(.sf-hint-while-typing) {
|
|
1792
|
+
display: none;
|
|
1793
|
+
}
|
|
1806
1794
|
|
|
1807
1795
|
/* ── Device-aware fields (lib/document/device-fields.tsx) ─────────────────────────
|
|
1808
1796
|
The rule that collapses a row holding the device gate's marker
|
|
@@ -2218,14 +2206,6 @@
|
|
|
2218
2206
|
height: 11px;
|
|
2219
2207
|
}
|
|
2220
2208
|
|
|
2221
|
-
/* The one control that folds the Basics tab's five explanations (card 66177).
|
|
2222
|
-
It sits at the FOOT of the tab, under the last row's own separation, and it
|
|
2223
|
-
is deliberately quiet: it is chrome about the panel, not one of the
|
|
2224
|
-
merchant's settings, so it must not read as loudly as the rows above it. */
|
|
2225
|
-
.sf-hints {
|
|
2226
|
-
display: flex;
|
|
2227
|
-
margin-top: var(--space-32);
|
|
2228
|
-
}
|
|
2229
2209
|
/* A heading INSIDE one control, below the row's own label: "Dark surfaces",
|
|
2230
2210
|
"Light surfaces". Deliberately not `.sf-field-group`, which heads a group of
|
|
2231
2211
|
settings -- these head a group of colours inside ONE setting. */
|
|
@@ -3060,6 +3040,27 @@ input.sf-list-marking {
|
|
|
3060
3040
|
display: inline;
|
|
3061
3041
|
vertical-align: baseline;
|
|
3062
3042
|
}
|
|
3043
|
+
/* SourceStatus oneLine: the compact line on one line that gives way, and the
|
|
3044
|
+
map Find result's three states (a result, so the hints switch never folds
|
|
3045
|
+
it; owner 2026-11-07). */
|
|
3046
|
+
.sf-blogsource--line {
|
|
3047
|
+
min-width: 0;
|
|
3048
|
+
}
|
|
3049
|
+
.sf-blogsource--line .sf-blogsource-status {
|
|
3050
|
+
min-width: 0;
|
|
3051
|
+
white-space: nowrap;
|
|
3052
|
+
overflow: hidden;
|
|
3053
|
+
text-overflow: ellipsis;
|
|
3054
|
+
}
|
|
3055
|
+
.sf-blogsource--line .sf-blogsource-status[data-state="found"] {
|
|
3056
|
+
color: var(--status-success-soft-ink);
|
|
3057
|
+
}
|
|
3058
|
+
.sf-blogsource--line .sf-blogsource-status[data-state="busy"] {
|
|
3059
|
+
color: var(--ink-faint);
|
|
3060
|
+
}
|
|
3061
|
+
.sf-blogsource--line .sf-blogsource-status[data-state="notfound"] {
|
|
3062
|
+
color: var(--status-danger-soft-ink);
|
|
3063
|
+
}
|
|
3063
3064
|
/* The "Open" control inside a source note — the route the sentence names.
|
|
3064
3065
|
[ADD] Source Note Opens The Record, 2026-09-06.
|
|
3065
3066
|
|
|
@@ -3718,11 +3719,11 @@ input.sf-list-marking {
|
|
|
3718
3719
|
opacity: 0.55;
|
|
3719
3720
|
}
|
|
3720
3721
|
|
|
3721
|
-
/* The Entrance kinds (lib/animation/entrance-fields): the
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
(efficient-shell/motion.css)
|
|
3725
|
-
|
|
3722
|
+
/* The Entrance kinds (lib/animation/entrance-fields): the easel effect tiles. Each
|
|
3723
|
+
tile's picture is the shell's glyph of its kind, and it plays that kind when the
|
|
3724
|
+
mouse rests on its tile, by the page's engine and keyframes
|
|
3725
|
+
(efficient-shell/motion.css), inside this clipped stage, so a kind that moves
|
|
3726
|
+
never crosses the word under it. */
|
|
3726
3727
|
.sf-entrance-stage {
|
|
3727
3728
|
display: flex;
|
|
3728
3729
|
align-items: center;
|
|
@@ -3759,14 +3760,14 @@ input.sf-list-marking {
|
|
|
3759
3760
|
UNDER A CONTROL is `SettingsField`'s own `hint`. A few lines sit under no
|
|
3760
3761
|
row — the caption inside a linked-source card, a panel's opening sentence,
|
|
3761
3762
|
the empty state of an open focus picker — and they wear the SAME class,
|
|
3762
|
-
`<p class="es-field-hint
|
|
3763
|
+
`<p class="es-field-hint">`: one hint line in the whole editor,
|
|
3763
3764
|
not a shop copy of its look. That replaces the shop's `.sf-field-hint` and
|
|
3764
3765
|
`.sf-blogsource-hint`, which drew this idea twice, slightly differently.
|
|
3765
3766
|
|
|
3766
3767
|
Not a NEW class, and not `.sf-note`: `test-editor-chrome-note` holds the
|
|
3767
3768
|
chrome to ONE note style, and these are hints, at the hint's size.
|
|
3768
|
-
|
|
3769
|
-
|
|
3769
|
+
They fold with the panel's one hints switch like every hint; a line that
|
|
3770
|
+
says the setting does nothing now is easel's `InertHint` instead.
|
|
3770
3771
|
|
|
3771
3772
|
Inside a source card the card's own gap spaces it. */
|
|
3772
3773
|
.sf-blogsource > .es-field-hint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useEffect as b,useMemo as w,useRef as k}from"react";import{useEasel as O}from"efficient-easel/easel";import{useEaselHost as
|
|
1
|
+
"use client";import{useEffect as b,useMemo as w,useRef as k}from"react";import{useEasel as O}from"efficient-easel/easel";import{useEaselHost as P}from"efficient-easel/screen/lib/host";import{applyPageEdits as B,describeBlocks as C,describeSelection as D}from"../lib/host-document-bridge.js";import{nonEmptyString as H}from"../../format/lib/non-empty-string.js";import{activePressContext as J}from"../../format/lib/sections/active-press-context.js";const p=t=>H(t.requestId)??null;function v(){const t=P(),{appState:n,selectedItem:I,dispatch:l,history:f,config:S}=O(s=>s),i=S,g=k({appState:n,dispatch:l,history:f,blockConfig:i});g.current={appState:n,dispatch:l,history:f,blockConfig:i};const c=k(new Map),h=I?.props?.id,a=w(()=>D(i,n.data,h),[i,n.data,h]),q=a?JSON.stringify(a):"";b(()=>{t.connected&&t.send("storefront-editor:selection",{selection:a})},[t,q]),b(()=>t.subscribe(s=>{const{appState:d,dispatch:y,history:u,blockConfig:m}=g.current;switch(s.type){case"storefront-editor:request-document":{const e=p(s);if(!e)return;t.send("storefront-editor:document",{requestId:e,document:d.data,blocks:C(m)});return}case"storefront-editor:apply-page-edits":{const e=p(s);if(!e)return;const r=Array.isArray(s.ops)?s.ops:[],o=r.length?B(m,d.data,r,E=>`${E}-${crypto.randomUUID()}`,J()):{ok:!1,reason:"no changes"};o.ok&&(y({type:"setData",data:o.document,recordHistory:!0}),c.current.set(e,JSON.stringify(o.document.content??[]))),t.send("storefront-editor:page-edits-result",{requestId:e,applied:o.ok,reason:o.ok?null:o.reason});return}case"storefront-editor:undo-page-edits":{const e=p(s);if(!e)return;const r=c.current.get(e),o=r!==void 0&&r===JSON.stringify(d.data.content??[]);o&&u.hasPast&&(u.back(),c.current.delete(e)),t.send("storefront-editor:page-edits-result",{requestId:e,applied:o&&u.hasPast,reason:o?null:"the page has changed since"});return}case"storefront-editor:set-right-panel":typeof s.shown=="boolean"&&y({type:"setUi",ui:{rightSideBarVisible:s.shown}});return;default:return}}),[t])}export{v as useHostDocumentBridge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useEffect as f,useRef as
|
|
1
|
+
"use client";import{useEffect as f,useRef as p}from"react";import{useEasel as d}from"efficient-easel/easel";import{ROOT_ZONE as s}from"efficient-easel/draw";import{usePreviewHeader as x}from"../../render/components/PreviewHeaderContext.js";import{sectionToBoxEdits as a}from"../../render/lib/sections/section-to-box.js";import{clearActivePressContext as l,setActivePressContext as h}from"../../format/lib/sections/active-press-context.js";function T(t){const i=d(e=>e.appState.data.content),{theme:r,themeRow:o,themeFromDocument:n}=x(),c=p(new Set);f(()=>{const e=u({theme:r,themeRow:o,themeFromDocument:n});e&&C(a(i,void 0,e),t,c.current)},[i,t,r,o,n]),f(()=>{const e=h(u({theme:r,themeRow:o,themeFromDocument:n}));return()=>l(e)},[r,o,n])}function u(t){return t.themeFromDocument||t.themeRow==="none"?{}:t.themeRow==="read"?{theme:t.theme}:null}function C(t,i,r){for(const{index:o,nodes:n}of[...t].sort((c,e)=>e.index-c.index)){const c=String(n[0].props.id);r.has(c)||(r.add(c),i.replaceComponent(s,o,n[0]),n.slice(1).forEach((e,m)=>{i.insertNode(s,o+1+m,e),i.replaceComponent(s,o+1+m,e)}))}}export{C as applySectionToBoxEdits,u as editorConvertContext,T as useSectionToBoxPass};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,Fragment as g,jsxs as S}from"react/jsx-runtime";import{useRef as I}from"react";import{phoneKey as i}from"efficient-easel/draw";import{SettingsDefaultReset as C}from"efficient-easel/panel";import{ClockIcon as v,DirectionDownIcon as w,DirectionIcon as L,DirectionLeftIcon as M,DirectionRightIcon as x,DirectionUpIcon as G,DurationIcon as P,EntranceBounceIcon as B,EntranceFadeIcon as U,EntranceFlipIcon as W,EntranceGlideIcon as Y,EntranceRevealIcon as j,EntranceRiseIcon as H,EntranceScaleIcon as $,EntranceSpinIcon as q,NoSymbolIcon as z}from"efficient-easel/icons";import{effectTiles as V}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as c}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as J,noControlField as Q}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{customize as X,describedAs as R,group as Z,onDesktopWords as ee,phoneTwinFields as ne}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as oe,ENTRANCE_FROM_DEFAULT as N,ENTRANCE_KINDS as p,ENTRANCE_KINDS_WITH_FROM as y,MOTION_TIMING as te,entranceAttrs as ie,playEntrance as re,readEntrance as ce}from"efficient-shell/format";import{segmented as ae}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as k}from"../document/controls.js";import{withRowRules as le}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as se,say as s}from"../../../format/lib/editor-words.js";import{animationDelayField as de,animationDurationField as pe}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as t,LEGACY_ENTRANCE_KEY as D,entranceOf as F}from"../../../render/lib/animation/entrance.js";import{ENTRANCE_GROUP_KEY as me}from"../../../format/lib/animation/index.js";const u={none:"None",fade:"Fade",rise:"Rise",scale:"Scale",glide:"Glide",bounce:"Bounce",flip:"Flip",reveal:"Reveal",spin:"Spin"},fe={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},ue={top:()=>n(w,{}),bottom:()=>n(G,{}),left:()=>n(x,{}),right:()=>n(M,{})},E="Entrance",m=p.filter(e=>e!=="none"),f=e=>({any:[{field:t.kind,in:e},{all:[{field:t.kind,set:!1},{field:D,in:e}]}]}),T=e=>({any:[{field:i(t.kind),in:e},{all:[{field:i(t.kind),set:!1},f(e)]}]}),Ee={any:[f(m),{field:i(t.kind),in:m}]},Ie=[[[t.from],f(y)],[[i(t.from)],T(y)],[[t.duration,t.delay],f(m)],[[i(t.duration),i(t.delay)],T(m)]],Re={none:()=>n(z,{}),fade:()=>n(U,{}),rise:()=>n(H,{}),scale:()=>n($,{}),glide:()=>n(Y,{}),bounce:()=>n(B,{}),flip:()=>n(W,{}),reveal:()=>n(j,{}),spin:()=>n(q,{})},b="data-entrance-tile";function Ne({kind:e}){const{attrs:o}=ie(ce(e,N));return n("span",{className:"sf-entrance-stage",[b]:e,children:n("i",{...o,children:Re[e]()})})}const ye=e=>o=>{const r=e.current?.querySelector(`[${b}="${o}"] > i`);r&&re(r)},h=e=>V({label:s(E),options:p.map(o=>({value:o,label:s(u[o]),picture:n(Ne,{kind:o})})),fallback:"none",onPreview:e?ye(e):void 0});function O({row:e,children:o}){return n("div",{ref:e,style:{display:"contents"},children:o})}function _e({value:e,onChange:o}){const r=k(),a=F({...r,[t.kind]:e},"desktop").kind,l=I(null);return n(O,{row:l,children:h(l).render({value:a,onChange:d=>o(d??"none")})})}function ke({value:e,onChange:o}){const r=k(),a=typeof e=="string"&&p.includes(e),l=F(r,"desktop").kind,d=I(null);return S(g,{children:[n(O,{row:d,children:h(d).render({value:a?e:l,onChange:o})}),a&&n(C,{words:se()?.panel,label:s(De),changed:a,detail:ee(A=>s(A),s(u[l])),onReset:()=>o(void 0)})]})}const De="Effect",K={type:"select",label:E,options:p.map(e=>({value:e,label:u[e]}))},Fe=()=>R({type:"custom",render:({value:e,onChange:o})=>n(_e,{value:e,onChange:o})},K),Te=()=>R({type:"custom",render:({value:e,onChange:o})=>n(ke,{value:e,onChange:o})},K),be=oe.map(e=>({label:fe[e],value:e,picture:ue[e]()}));function Ye(){const{duration:e,delay:o}=te.entrance,r={[me]:Z(E,{dot:Ee}),[t.kind]:c("desktop",Fe()),[D]:Q({type:"custom",render:()=>n(J,{})},"always"),[i(t.kind)]:c("mobile",Te()),_cEntrance:X(),...ne(t.from,ae("From",n(L,{}),be,N)),[t.duration]:c("desktop",pe("entrance")),[i(t.duration)]:c("mobile",_({label:"Duration",desktopKey:t.duration,icon:n(P,{}),min:e.min,max:e.max,step:e.step,fallback:e.default,unit:"s"})),[t.delay]:c("desktop",de("entrance")),[i(t.delay)]:c("mobile",_({label:"Delay",desktopKey:t.delay,icon:n(v,{}),min:o.min,max:o.max,step:o.step,fallback:o.default,unit:"s"}))};return le(r,Ie)}export{Ye as entranceFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loopDelayField as i,loopDurationField as n}from"./AnimationDurationRow.js";import{entranceFields as e}from"./entrance-fields.js";import{cardHoverResting as s,pictureHoverResting as c}from"../../../format/lib/animation/hover.js";import{cardHoverFields as a,hoverFields as
|
|
1
|
+
import{loopDelayField as i,loopDurationField as n}from"./AnimationDurationRow.js";import{entranceFields as e}from"./entrance-fields.js";import{cardHoverResting as s,pictureHoverResting as c}from"../../../format/lib/animation/hover.js";import{cardHoverFields as a,hoverFields as p,pictureHoverFields as t}from"./hover-fields.js";import{customize as l}from"efficient-easel/screen/lib/document/box-fields";import{loopDirectionField as u,loopFields as m,loopHeading as d}from"./loop-fields.js";import{truthy as F,withRowsShownWhen as f}from"../../../format/lib/document/show-when-attach.js";function g(){const o=t("none");return f(o,Object.keys(o),F("bgImage"))}function R(o,r=""){switch(o){case"section":case"block":return e();case"box":return{...e(),...m(),...g()};case"picture":return{...e(),...t(c(r),r)};case"textPart":return{...e(),...p()};case"cards":return{...e(),...a(s(r))};case"marquee":return{...e(),_gLoop:d(),_cLoop:l(),scrollDirection:u(),loopDuration:n({readsSpeed:!0}),loopDelay:i()}}}export{R as animationTabFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{ContrastIcon as A,NoSymbolIcon as P,HoverLiftIcon as g,HoverNextImageIcon as y,HoverRotateIcon as U,HoverZoomIcon as v,OpacityIcon as F,RotateIcon as b}from"efficient-easel/icons";import{customize as W,describedAs as L,group as z}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as B}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as n}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as M,noControlField as Y}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as c}from"../../../format/lib/content/box-background.js";import{cardTemplateField as X,cardTemplateOwner as j,namedRowField as G}from"../../../format/lib/content/card-template.js";import{slider as h}from"../document/box-fields.js";import{say as O}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as w,animationDurationField as N,showsWhatRuns as R}from"./AnimationDurationRow.js";import{CARD_HOVER_ANGLE as f,CARD_HOVER_KEYS as s,CARD_HOVER_KINDS as Z,CARD_HOVER_TURN as q,HOVER_KEY as m,HOVER_KIND_LABELS as T,NEXT_PICTURE_BLOCKS as J,NEXT_PICTURE_HOVER_KINDS as Q,OLD_SPIN_KEY as $,PART_HOVER_KINDS as k,PICTURE_HOVER_KEYS as C,PICTURE_HOVER_KINDS as oo,PICTURE_HOVER_ZOOM as l,cardHoverAngleOf as eo,cardHoverKindOf as to,cardRotatesRule as ro,HOVER_GROUP_KEY as _,pictureHoverKindOf as no,pictureHoverMovesRule as io,pictureHoverRunsRule as so}from"../../../format/lib/animation/hover.js";const E=o=>n("desktop",z("Hover",{dot:o})),x=()=>n("desktop",W()),ao="What this does when a shopper points at it, or taps it on a phone.",po="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",co="What this picture does when a shopper points at the card. Show next image fades to the card's next photo. Black and white shows it in grey until then. A phone shows the first photo in colour.",lo="What each card does when a shopper points at it, or taps it on a phone. Rotate turns the wheel picture.",mo={none:()=>i(P,{}),nextImage:()=>i(y,{}),rotate:()=>i(U,{}),zoom:()=>i(v,{}),lift:()=>i(g,{}),mono:()=>i(A,{})};function H(o,e){const r=B({label:O("Hover effect"),options:o.map(t=>({value:t,label:O(T[t]),picture:mo[t]()})),fallback:e});return L(r,{type:"select",label:"Hover effect",options:o.map(t=>({value:t,label:T[t]}))})}function Co(){return{[_]:E({field:m,in:k.filter(o=>o!=="none")}),[m]:n("desktop",{...H(k,"none"),description:ao})}}function xo(o){const e=ro(o),r=h("Angle",i(b,{}),f.min,f.max,f.step,q,"°");return{[_]:E(e),[s.kind]:n("desktop",{...R(H(Z,o),(t,p)=>to(p??{},o)),description:lo}),[$]:Y({type:"custom",render:()=>i(M,{})},"always"),_cHover:x(),[s.angle]:n("desktop",a(R(r,t=>eo(t)),e)),[s.duration]:n("desktop",a(N("hover"),e)),[s.delay]:n("desktop",a(w("hover"),e))}}function Vo(o,e=""){const r=so(o);return{[_]:E(r),[s.kind]:V(oo,o,po),_cHover:x(),...J.includes(e)?uo():{},[s.duration]:n("desktop",a(N("hover"),r)),[s.delay]:n("desktop",a(w("hover"),r))}}function uo(){const o=io(),e=h("Zoom",i(v,{}),l.min,l.max,l.step,l.min,l.unit),r=h("Darken on hover",i(F,{}),c.min,c.max,c.step,c.fallback,c.unit);return{[C.zoom]:n("desktop",a(e,o)),[C.darken]:n("desktop",a(r,o))}}function V(o,e,r){const t=n("desktop",{...R(H(o,e),p=>no({[m]:p},e,o)),description:r});return Object.assign(t,{[D]:e})}const D="sfPictureResting",S=new WeakMap;function Do(o,e,r){const t=o[s.kind],p=t?.[D];if(!t||!p)return o;const I=e.props?.[m]==="nextImage",u=I?null:j(r.appState,e.props?.id),K=u?X(String(u.type),G(e.props),u):null;if(!I&&!K?.next)return o;let d=S.get(o);return d||(d={...o,[s.kind]:V(Q,p,co)},S.set(o,d)),d}export{xo as cardHoverFields,Co as hoverFields,Do as offerNextPicture,Vo as pictureHoverFields};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import type { ShowWhenRule } from "../../../render/lib/document/show-when.js";
|
|
1
2
|
export declare function loopDirectionField(): import("../document/controls.js").CustomField<string>;
|
|
3
|
+
export declare const loopHeading: (dot?: ShowWhenRule) => import("efficient-easel/screen/lib/document/box-fields").BoxField<undefined>;
|
|
2
4
|
export declare function loopFields(): Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{DirectionIcon as s,LoopMarqueeIcon as c,NoSymbolIcon as a}from"efficient-easel/icons";import{customize as m,describedAs as O,group as f}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as L}from"efficient-easel/screen/lib/document/effect-tiles";import{EDGE_ARROWS as u,edgePad as d}from"../document/controls.js";import{withShowWhen as n}from"../../../format/lib/document/show-when-attach.js";import{loopDelayField as _,loopDurationField as D}from"./AnimationDurationRow.js";import{say as p}from"../../../format/lib/editor-words.js";import{DEFAULT_LOOP_DIRECTION as I,LOOP_DIRECTION_OPTIONS as P,LOOP_NONE as S,LOOP_OPTIONS as l,LOOP_SCROLLS as r}from"../../../format/lib/animation/loop.js";function T(){return d("Direction",P,I,"A marquee cannot run diagonally, so the corners are not answers.",t(s,{}),u)}const E=o=>f("Loop",o?{dot:o}:void 0),N={none:()=>t(a,{}),scroll:()=>t(c,{})};function b(){const o=L({label:p("Loop"),options:l.map(({value:e,label:i})=>({value:e,label:p(i),picture:N[e]()})),fallback:S});return O(o,{type:"select",label:"Loop",options:l.map(({value:e,label:i})=>({value:e,label:i}))})}function j(){return{_gLoop:E(r),loop:b(),_cLoop:m(),scrollDirection:n(T(),r),loopDuration:n(D({readsSpeed:!1}),r),loopDelay:n(_(),r)}}export{T as loopDirectionField,j as loopFields,E as loopHeading};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{phoneKey as t,tabletKey as r}from"efficient-easel/draw";import{BOX_CARD_PAD as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{phoneKey as t,tabletKey as r}from"efficient-easel/draw";import{BOX_CARD_PAD as w,BOX_SWATCH_PROP as So,isBackgroundBox as mo}from"../../../../../../format/lib/content/box-background.js";import{CARD_ROW_FACTS as fo,cardRowField as ho,cardRowFields as Oo}from"../../../card-row-fields.js";import{darkenFields as uo}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as Ro,REEL_SHAPE_LABELS as Ao}from"../../../../../../format/lib/reel.js";import{LAYOUT_CELL as k,CARD_LIST_STYLE_PICTURES as wo,TAB_SHAPE_PICTURES as Co}from"../../../choice-pictures.js";import{CARD_STYLE_KEY as R,CARD_STYLE_POINTS as Eo,applyCardStyle as To,isCardStyle as go}from"../../../../../../render/lib/sections/card-list-style.js";import{deviceField as d}from"efficient-easel/screen/lib/document/device-fields";import{ChevronDownIcon as Do,ClockIcon as No,CropIcon as H,GapIcon as Lo,MediaLayoutStackedIcon as bo,LineBetweenIcon as Io,LineSolidIcon as Fo,ShadowIcon as ko,StylesIcon as P,TableIcon as x,TargetIcon as Ho,WrapIcon as W}from"efficient-easel/icons";import{boxBlockSpacingField as Po,boxFillField as xo,boxColumnsFields as Wo,boxShareField as Bo,boxSharePhoneField as yo,boxShareTabletField as Mo,containerDirectionField as Uo,containerGapRows as Ko,linkField as Xo,plainText as jo,swapPadding as B,toggle as c,upload as y,withPanelOnly as Yo}from"../../../controls.js";import{BOX_STACK_LINE as M,BOX_STACK_RANGE as E,STACK_BELOW_PROP as U}from"../../../../../../render/lib/content/box-stack-line.js";import{BOX_SHAPES as K,boxShapeOf as vo}from"../../../../../../format/lib/content/box-shape.js";import{shapeLines as X}from"../../../../../../format/lib/content/gallery-card-layout.js";import{shapePickerRow as j}from"../../../shape-picker.js";import{BOX_COLUMNS_MAX as T,BOX_COLUMNS_MIN as g,boxPhoneRowOneLine as Go,boxWrapWordOf as Y}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as v}from"../../../../../../format/lib/content/box-separator.js";import{BOX_WRAP_LABEL as G,VIEW_KEY_ACCESS as a,group as m,phoneTwinFields as s}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as Vo,boxJustifyField as Jo,boxWrapField as C,iconPickerRow as V,placementField as zo,select as D,sidesPaddingFields as J,slider as qo}from"../../../box-fields.js";import{withRowRules as Qo}from"../../../../../../render/lib/document/show-when.js";import{separatorField as Zo}from"../../../separator-field.js";import{LOOP_SCROLLS as $o}from"../../../../../../format/lib/animation/index.js";import{DEFAULT_TICKER_JOIN as oe,TICKER_JOIN_OPTIONS as ee}from"../../../../../../format/lib/sections/ticker-join.js";import{NOT_HELD_BY_A_NODE as ne}from"../../../../../../format/lib/document/passes/document-position.js";import{accordionOnSet as te}from"../../../box-accordion-seed.js";import{FlexSlots as z}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{BOX_TYPE as re,CONTAINER_BLOCKS_SLOT as ie}from"../../../../../../format/lib/document/container-blocks.js";import{boxPhoneOrderField as le}from"../../../box-phone-order-field.js";import{CARD_BOX_FACTS as ae,ON_A_CARD as se,cardDisplayField as de}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as ce,MIRROR_CARDS_MIRRORS as pe,mirrorCardsField as _e}from"../../../mirror-cards-field.js";import{handedRowOf as q}from"../../../../../../format/lib/document/row-hand.js";import{SHOW_FOR_FACTS as Se,showForField as me,showForFields as fe}from"../../../show-for-field.js";import{SHARED_COLUMNS_KEY as f,SHARED_COLUMNS_LABEL as Q,SHARED_COLUMNS_OFF as Z,sharedColumnsDrawn as $,sharedColumnsFits as oo,SHARED_COLUMNS_PHONE_POINTS as he,SHARED_COLUMNS_POINTS as Oe,sharedRowsDrawn as ue}from"../../../../../../render/lib/content/box-shared-columns.js";const N={field:"bgImage",set:!0},eo={all:[{field:"phoneRow",in:[2,3]},{not:{field:"direction",is:"accordion"}}]},Re={field:"direction",is:"tabs"},Ae={field:"line",in:[!0,!1]},we={field:"anchor",set:!0},L=["fixed","screen"],Ce={not:{any:[{field:"sectionHeightMode",in:L},{field:"sectionHeightModeTablet",in:L},{field:"sectionHeightModePhone",in:L}]}},Ee={context:"parent.line",is:!0},p={not:{field:"direction",is:"accordion"}},no="notAccordionRow",Te={not:{context:no,is:!0}},ge={[no]:(o,e)=>e.parent?.props?.direction!=="accordion"},b={field:"direction",is:"row",default:"row"},_={not:$o},h={all:[b,_,{not:{field:"separator",in:v.map(o=>o.value)}},{not:{field:"line",is:!0}}]},to={all:[h,...["columns",r("columns")].map(o=>({not:{field:o,in:Array.from({length:T},(e,n)=>n+g)}}))]},De={all:[_,{not:{all:[b,{field:"separator",in:v.map(o=>o.value)}]}}]},I={not:{all:[h,{field:"columns",in:Array.from({length:T},(o,e)=>e+g)}]}},Ne="sharedColumnsFits",ro="sharedColumnsMisfit",io="sharedColumnsDraws",lo="sharedColumnsPhoneDraws",Le={[Ne]:o=>oo(o.props??{}),[ro]:o=>!oo(o.props??{}),[io]:o=>$(o.props??{}).desktop,[lo]:o=>$(o.props??{}).phone};function ao(o){return{all:[{not:{context:ro,is:!0}},{any:[se,{field:o,set:!0}]}]}}const S={not:{context:io,is:!0}},O={not:{context:lo,is:!0}},so="sharedRowsDraws",be={[so]:(o,e)=>ue(o.props??{})&&q(e.appState,o.props?.id)?.row===void 0},A={not:{context:so,is:!0}},Ie={any:[S,O]},F={not:N},Fe={not:{context:pe,is:!0}},co="rowHanded",ke={not:{context:co,is:!0}},He={[co]:(o,e)=>{const n=q(e.appState,o.props?.id);return n===void 0?void 0:n?.row!==void 0}},po={all:[p,F,S,O,Fe]},Pe={field:"direction",is:"row"},xe={field:"align",in:["start","center","end"]},We={all:[{field:"darken",set:!0},{not:{field:"darken",in:[0,"0"]}}]};function Be(){const{darken:o,darkenStyle:e}=uo();return{...s("darken",o,a),...s("darkenStyle",e,a)}}const _o={not:{all:[h,{field:r("columns"),in:Array.from({length:T},(o,e)=>e+g)}]}};function ye(){const o=c(G,!1,i(W,{})),e=n=>{const l=Y(n);return l===void 0?void 0:l==="wrap"};return{...C(),render:n=>o.render({...n,value:e(n.value),follows:e(n.follows)??!1,onChange:l=>n.onChange(l===void 0?void 0:l?"wrap":"nowrap")})}}function Me(){const o=c(G,!0,i(W,{})),e=n=>{const l=Y(n);return l===void 0?void 0:l==="wrap"};return{...C(),render:n=>{const l=n.followsView==="tablet";return o.render({...n,value:e(n.value),follows:!Go(void 0,l?n.follows:void 0),followsNoView:!l,onChange:u=>n.onChange(u===void 0?void 0:u?"wrap":"nowrap")})}}}const wn={fields:Qo({_gContent:m("Content"),rowTitle:z.rowTitle,content:z.content,_gCardDisplay:m("Display"),cardDisplay:de(),showFor:me(),_gLayout:m("Layout"),direction:Uo("Flex"),tabShape:V("Tab shape",i(P,{}),Ro.map(o=>({label:Ao[o],value:o,picture:Co[o]})),"tabs",{columns:2,cell:k}),mirrorCards:_e(),[U]:d("desktop",qo("Stacks below",i(bo,{}),E.min,E.max,E.step,M,"px",{clear:{hint:M},hint:"Under this screen width the blocks stand one under another, with the Phone Gap and Padding."})),startsOpen:d("desktop",c("Starts open",!1,i(Do,{}))),label:Yo(jo("Tab name")),...Ko("Flex"),...s("justify",Jo(),a),...s("align",Vo(),a),...(()=>{const o=s("wrap",C(),a,{phoneRow:Me()}),e=s("wrap",C(),a,{phoneRow:ye()});return{wrap:e.wrap,[r("wrap")]:e[r("wrap")],[t("wrap")]:o[t("wrap")]}})(),[t("order")]:le(),...s("boxShape",j("Box shape",i(H,{}),X(K),"shape","auto"),a,{phoneRow:j("Box shape",i(H,{}),X(K),"shape","auto",{phoneRest:o=>vo(o)})}),separator:Zo(i(Io,{size:18}),"none"),[R]:d("desktop",V("Card style",i(P,{}),Eo.map(o=>({...o,picture:wo[o.value]})),"table",{columns:2,cell:k})),share:d("desktop",Bo()),[r("share")]:Mo(),[t("share")]:yo(),[f]:d("desktop",D(Q,i(x,{}),[...Oe],Z)),[t(f)]:d("mobile",D(Q,i(x,{}),[...he],Z)),...Wo(),...s("blockSpacing",Po(),a),line:c("Line",!1,i(Fo,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,i(No,{}),"Still to come: a hollow dot, and the gold line stops before it."),join:D("Join",i(Lo,{}),ee,oe),_gShadow:m("Shadow"),...s("shadow",c("Shadow",!1,i(ko,{})),a),...s("fillColor",xo(),a),[So]:ho("Fill content","colour"),_gBackground:m("Background image"),bgImage:d("desktop",y("Image","image/*")),bgImagePhone:d("mobile",y("Image","image/*")),...Be(),placement:zo("Content position"),_gLink:m("Link"),link:Xo("Link to"),jumpHighlight:c("Highlight when a link jumps here",!1,i(Ho,{}),"When a link lands on this Box's anchor, the Box gets a main color outline and its first block turns the main color.")},[[["darken","darkenStyle","placement"],N],[[t("share")],{all:[eo,O]}],[[f],ao(f)],[[t(f)],ao(t(f))],[[t("wrap")],{all:[eo,_,O,A]}],[[t("order")],{all:[h,O,S]}],[["phoneRow"],{all:[O,p]}],[["tabShape"],Re],[["rowTitle","startsOpen"],Te],[["align","blockSpacing",r("blockSpacing"),t("blockSpacing")],p],[[r("justify"),t("justify")],{all:[_,po,A]}],[[r("align"),t("align")],{all:[Pe,xe,po]}],[[r("wrap")],{all:[_,I,_o,S,p,A]}],[[r("shadow"),t("shadow")],F],[[r("darken"),t("darken"),r("darkenStyle"),t("darkenStyle")],{all:[N,We]}],[["separator"],b],[[R],{field:R,set:!0}],[["columns",r("columns")],h],[[U],{all:[h,F,_o,{not:{all:[to,{field:r("share"),set:!0}]}}]}],[[r("gap")],De],[["justify"],{all:[_,Ie,p,A]}],[["wrap"],{all:[_,I,S,p,A]}],[["share"],{all:[I,S,p]}],[[r("share")],{all:[to,S]}],[["line"],Ae],[["upcoming"],Ee],[["jumpHighlight"],we],[["boxShape",r("boxShape"),t("boxShape")],Ce],[["direction","share",t("order")],ke],[["join"],ne]]),resolveData:(o,e)=>{const n=o.props,l=n[R];return e.changed?.[R]===!0&&go(l)?{...o,props:To(n,l,re,ie)}:n.direction==="accordion"&&(e.trigger==="insert"||e.changed?.direction===!0)?{...o,props:te(n)}:o},resolveFields:(o,e)=>fe(Ue(o,{...e,fields:Oo(e.fields,o,e)}),o.props),showWhenFacts:{...fo,...ae,...ce,...He,...Le,...be,...Se,...ge}};function Ue(...[o,{fields:e}]){{const n=o.props;if(mo(n.bgImage)){const u=J({fallback:{top:w.desktop,bottom:w.desktop,left:w.side,right:w.side},tablet:!0});return B(e,u)}return o.props.padV2!==!0?B(e,J({fallback:{top:24,bottom:24},tablet:!0})):e}}export{wn as FlexFields};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type FieldsPatch } from "efficient-easel/easel";
|
|
3
3
|
import { type MediaValue } from "../../../format/lib/media-value.js";
|
|
4
|
-
import { type LoadingShows } from "../../../format/lib/hero-video.js";
|
|
4
|
+
import { type KnownVideoFrame, type LoadingShows } from "../../../format/lib/hero-video.js";
|
|
5
5
|
import { readHidable, hidableText, type HidableValue } from "efficient-easel/draw";
|
|
6
6
|
import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, foldMetaOf, textFieldIdentifier, type EdgeCell, type FoldFieldMeta, type TextFieldMeta, type TextListRendering } from "efficient-easel/draw";
|
|
7
7
|
import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
|
|
@@ -304,6 +304,7 @@ export declare const MEDIA_TYPE_OPTIONS: {
|
|
|
304
304
|
value: "image" | "video";
|
|
305
305
|
}[];
|
|
306
306
|
export declare function loadingShowsField(label: string, icon: ReactElement, pictures: Readonly<Record<LoadingShows, ReactElement>>): CustomField<LoadingShows>;
|
|
307
|
+
export declare function loadingRowHint(values: Readonly<Record<string, unknown>>, frames: Readonly<Record<string, KnownVideoFrame>> | undefined, hasUnsavedEdits: boolean): string | undefined;
|
|
307
308
|
export declare function upload(label: string, accept: string, placeholder?: string, opts?: {
|
|
308
309
|
focus?: string;
|
|
309
310
|
focusWhen?: (props: Record<string, unknown>, view: "desktop" | "tablet" | "mobile") => boolean;
|