efficient-web-builder 52.0.0 → 54.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 +47 -0
- package/dist/editor/components/ChatSettingsPanel.js +1 -1
- package/dist/editor/components/DuplicateToPageMenu.d.ts +2 -0
- package/dist/editor/components/DuplicateToPageMenu.js +1 -1
- package/dist/editor/components/MediaUploadField.d.ts +7 -7
- package/dist/editor/components/MediaUploadField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/SiteAccentField.js +1 -1
- package/dist/editor/components/SiteTextStylesField.d.ts +3 -3
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +70 -20
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Breadcrumb/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
- package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
- package/dist/editor/lib/document/blocks/shared-fields.d.ts +5 -0
- package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +23 -2
- package/dist/editor/lib/document/box-fields.js +1 -1
- package/dist/editor/lib/document/box-phone-order-field.d.ts +8 -0
- package/dist/editor/lib/document/box-phone-order-field.js +1 -0
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/choice-pictures.d.ts +21 -0
- package/dist/editor/lib/document/choice-pictures.js +1 -0
- package/dist/editor/lib/document/controls.d.ts +19 -5
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/hidable-rows-drawn.d.ts +1 -0
- package/dist/editor/lib/document/hidable-rows-drawn.js +1 -1
- package/dist/editor/lib/document/part-panel-rows.d.ts +1 -0
- package/dist/editor/lib/document/part-panel-rows.js +1 -1
- package/dist/editor/lib/document/separator-field.d.ts +9 -1
- package/dist/editor/lib/document/separator-field.js +1 -1
- package/dist/editor/lib/document/shape-picker.d.ts +37 -0
- package/dist/editor/lib/document/shape-picker.js +1 -0
- package/dist/editor/lib/document/show-for-field.d.ts +6 -0
- package/dist/editor/lib/document/show-for-field.js +1 -0
- package/dist/format/lib/animation/hover.d.ts +0 -2
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +21 -6
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-phone-place.d.ts +11 -0
- package/dist/format/lib/content/box-phone-place.js +1 -0
- package/dist/format/lib/content/box-shape.d.ts +1 -5
- package/dist/format/lib/content/box-shape.js +1 -1
- package/dist/format/lib/content/box-show-for-choices.d.ts +9 -0
- package/dist/format/lib/content/box-show-for-choices.js +1 -0
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/gallery-card-layout.d.ts +45 -1
- package/dist/format/lib/content/gallery-card-layout.js +1 -1
- package/dist/format/lib/content/image-aspect.d.ts +47 -0
- package/dist/format/lib/content/image-aspect.js +1 -0
- package/dist/format/lib/content/list-number.d.ts +11 -0
- package/dist/format/lib/content/list-number.js +1 -1
- package/dist/format/lib/content/phone-focus.d.ts +4 -1
- package/dist/format/lib/content/phone-focus.js +1 -1
- package/dist/format/lib/content/record-row.d.ts +14 -0
- package/dist/format/lib/content/record-row.js +1 -0
- package/dist/format/lib/content/record-types.d.ts +1 -1
- package/dist/format/lib/content/record-types.js +1 -1
- package/dist/format/lib/content/section-height.d.ts +8 -0
- package/dist/format/lib/content/section-height.js +1 -1
- package/dist/format/lib/document/blocks/block-types.d.ts +1 -1
- package/dist/format/lib/document/blocks/general/Flex/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/text-part-shapes.json +2 -2
- package/dist/format/lib/document/media-manifest.json +5 -2
- package/dist/format/lib/document/mockup-variant-fields.d.ts +1 -0
- package/dist/format/lib/document/mockup-variant-fields.js +1 -1
- package/dist/format/lib/document/section-catalog.js +2 -2
- package/dist/format/lib/document/section-descriptions.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +26 -11
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/fonts.js +1 -1
- package/dist/format/lib/sections/divider-style.d.ts +4 -0
- package/dist/format/lib/sections/divider-style.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/source-rules/editor-words.js +2 -2
- package/dist/format/lib/source-rules/mirrored-rows-agree.js +4 -4
- package/dist/format/lib/source-rules/shape-rows-use-the-picker.d.ts +7 -0
- package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -0
- package/dist/format/lib/text-styles/site-text-colours.d.ts +2 -9
- package/dist/format/lib/text-styles/site-text-colours.js +1 -1
- package/dist/render/components/Breadcrumb.d.ts +2 -1
- package/dist/render/components/Breadcrumb.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +1 -1
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/ContentsList.d.ts +4 -1
- package/dist/render/components/ContentsList.js +1 -1
- package/dist/render/components/CurrentRecord.d.ts +23 -0
- package/dist/render/components/CurrentRecord.js +1 -0
- package/dist/render/components/Flex.d.ts +3 -2
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -0
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroPoster.d.ts +2 -1
- package/dist/render/components/HeroPoster.js +1 -1
- package/dist/render/components/HeroSection.d.ts +2 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.d.ts +3 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +3 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +5 -3
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +4 -0
- package/dist/render/components/SiteGutterFrame.d.ts +1 -0
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/lib/content/block-size.d.ts +3 -0
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-show-for.d.ts +14 -0
- package/dist/render/lib/content/box-show-for.js +1 -0
- package/dist/render/lib/content/page-contents.d.ts +1 -0
- package/dist/render/lib/content/page-contents.js +1 -1
- package/dist/render/lib/content/picture-focus-rows.d.ts +13 -0
- package/dist/render/lib/content/picture-focus-rows.js +1 -0
- package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +21 -7
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/show-for.d.ts +2 -0
- package/dist/render/lib/document/passes/show-for.js +1 -0
- package/dist/render/lib/document/passes/slots-start-afresh.js +1 -1
- package/dist/render/lib/document/show-when.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 54.0.0 - 2026-11-06
|
|
4
|
+
|
|
5
|
+
From main at `55be615c`: #536. A major because the `efficient-easel` peer rises from `^27.6.0` to `^27.7.0` (#536). No declared export is removed. `efficient-shell` stays at `^11.8.0`. No stored key or value moves (0 stored `orderPhone` on the US tenant).
|
|
6
|
+
|
|
7
|
+
**BREAKING for hosts (#536):** install `efficient-easel` 27.7.0 or newer with this release. The storefront's Tailwind `@source` keeps scanning web-builder `dist`, so the new whole-literal order classes are built.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **A Box Phone order, stored as child ids** (#536). A row Box can stack its blocks in another order on a phone: the `Phone order` row in the Box's Phone view (easel `PhoneOrderField`), stored as `orderPhone`. The page draws a cell per child (`lib/content/box-phone-place`) only when an order is stored and the Box is a plain row; with no order the markup is the same as before. Box declares `phoneOrder`, so easel's copies write the list again with new ids, and Duplicate to another page keeps the order. Only the look moves: the Tab key and a screen reader keep the desktop order.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **`slots-start-afresh` reads `blockIds` live** (#536), so the editor no longer keeps a stale list for a block that declares an order.
|
|
16
|
+
|
|
17
|
+
## 53.0.0 - 2026-11-05
|
|
18
|
+
|
|
19
|
+
From main at `265af5ac`: #513, #517, #520, #523, #524, #525, #526, #528, #529, #531, #533, #535. A major because declared exports are removed or changed (#513, #520, #524, #525, #529) and the `efficient-easel` peer rises from `^27.3.0` to `^27.6.0` (#517). `efficient-shell` stays at `^11.8.0`. No stored key or value moves.
|
|
20
|
+
|
|
21
|
+
**BREAKING for hosts:**
|
|
22
|
+
|
|
23
|
+
- **Peer** (#517): install `efficient-easel` 27.6.0 or newer. `PartScreen` loses its boolean form.
|
|
24
|
+
- **Words** (#520): `WebBuilderPhrase` loses `Accent`, `Accent button`, `Accent footnote`, `In progress (accent)` and 2 old sentences. A host that types its words against it renames those keys (storefront-blocks: `package/src/words.public.d.ts`, and delete "Accent footnote" from `NO_IDEA` in `scripts/test-field-noun-map.tsx`).
|
|
25
|
+
- **Removed** (#525): `showColoursNotOffered`, `keepColoursNotOffered`, `siteTextColoursNotOffered` and the colour line of `toPanelStyles`. `SiteTextStylesField` requires `colourNameOf`; a host passes `siteTextColourNameOf(theme)`.
|
|
26
|
+
- **Changed** (#524): `viewFocusOf` returns `ownView`, `followed` and `followsView` in place of `phone`, `desktop` and `twin`. The media contract hash moves from `035f4205f0351855` to `b875e85294cc0f21`: the storefront installs this release with blocks that hold the Tablet focus keys, then the backend re-vendors `media_manifest.json` at that pin.
|
|
27
|
+
- **Removed** (#529): `cardTurnFor` and `CardHoverDrawn.angleSet`. A host draws `cardSpinOf(cardHoverOf(...))`. The phrase "By spokes" leaves the words.
|
|
28
|
+
- **Removed** (#513): `BOX_SHAPE_OPTIONS`, `IMAGE_ASPECT_OPTIONS`, `IMAGE_RATIO_OPTIONS`, the CSS classes `.sf-entrance-pic` and `.sf-entrance-cap`, the words `Square (1:1)`, `Landscape (4:3)`, `Bigger left`, `Bigger right`, and the `emptyValue` option of `iconPickerRow`. **Changed** (#513): `boxShareField()`, `boxShareTabletField`, `boxSharePhoneField`, `iconPickerRow`, `boxShareTabletOf`, `separatorField`, the `Flex` `share` type and `BOX_SHARE_POINTS`.
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **A Box can show for one host choice** (#535): the `Show for` row (`showFor`), `render/lib/content/box-show-for` (`SelectedRangesProvider`, `useSelectedRanges`, `boxDrawsForRange`, `useInHiddenBox`, `ShowForGate`) and `registerShowForChoices`. With no provider, a Box draws.
|
|
33
|
+
- **A Text, Image, Button or Breadcrumb shows the page's record** (#528): `components/CurrentRecord` (`CurrentRecordProvider`, `useCurrentRecord`, `useCurrentRecordOf`, `usePageRecordRow`) and `lib/content/record-row`. A shopper sees it once the blocks mount the provider.
|
|
34
|
+
- **Image `Fill row` and a phone Aspect ratio** (#523), with `showWhen` on a row option and `useInsideBox`.
|
|
35
|
+
- **Font size, Hero Height** (#517) **and a picture's focus point** (#524) **take a Tablet value**. In Tablet and Phone, Font size and Hero Height show the blue name and a Reset while a value is stored.
|
|
36
|
+
- **A Contents block reads the anchored sections in its row Box** (#531), with `Number` and a phone `Show` row.
|
|
37
|
+
- **One shape picker for every shape choice** (#513): Box shape, Image Aspect ratio and 10 more rows use the shell `IconPicker`. Block widths is Fit content, Equal or Custom; old stored words read as Custom and keep their classes.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- **Emphasis, Button and Footnote replace the word Accent** (#520). Words only.
|
|
42
|
+
- **The Site styles Color row shows what is stored** (#525) through easel `colourNameOf`. A press on Main over a stored `accent` writes `main`; the page paints the same colour.
|
|
43
|
+
- **A card's Angle is a plain number** (#529): unset shows 72. A stored Angle still wins.
|
|
44
|
+
- **A picture dot acts per view, from one list** (#533): `PICTURE_DOTS` and `imageFocalPointActsIn`.
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- **The product card parts are in the commerce set** (#526): `ProductPrice`, `ProductSize` and `ProductColour`.
|
|
49
|
+
|
|
3
50
|
## 52.0.0 - 2026-11-05
|
|
4
51
|
|
|
5
52
|
From main at `e9197485`: #497, #501, #510, #512, #514, #515, #516, #519. A major because declared exports are removed or changed (#497, #510, #512, #515). The peers do not change: `efficient-easel` `^27.3.0` and `efficient-shell` `^11.8.0`. A stored colour name stays as it is and paints the same token, so no stored page needs a data move for this release.
|
|
@@ -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
|
|
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 sf-hint-keep",children:t("Leave a field blank to use the built-in wording.")})]})]})}export{X as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RefObject } from "react";
|
|
2
|
+
import type { DataConfig } from "efficient-easel/data";
|
|
2
3
|
import { type TreeItem } from "efficient-easel/draw";
|
|
3
4
|
import type { EditorPageRow, WebsitePages } from "../../format/lib/web-backend.js";
|
|
4
5
|
interface Props {
|
|
@@ -9,6 +10,7 @@ interface Props {
|
|
|
9
10
|
runAuthed: (op: (token: string) => Promise<unknown>) => Promise<boolean>;
|
|
10
11
|
onNotify?: (msg: string, tone?: "success" | "error") => void;
|
|
11
12
|
}
|
|
13
|
+
export declare function copyForAnotherPage(node: TreeItem, components: DataConfig["components"], storedNode?: (node: TreeItem) => TreeItem): TreeItem;
|
|
12
14
|
export default function DuplicateToPageMenu({ node, currentSlug, siteId, tokenRef, runAuthed, onNotify }: Props): import("react").JSX.Element;
|
|
13
15
|
export declare function copyNodeToPage(pages: WebsitePages, page: Pick<EditorPageRow, "id" | "slug">, clone: TreeItem): Promise<void>;
|
|
14
16
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as x,Fragment as
|
|
1
|
+
"use client";import{jsx as t,jsxs as x,Fragment as S}from"react/jsx-runtime";import{useCallback as j,useRef as A,useState as p}from"react";import{InspectorIconButton as B}from"efficient-easel/chrome";import{useEasel as O}from"efficient-easel/easel";import{PopupMenu as R,PopupMenuItem as _,PopupMenuLabel as f}from"efficient-shell/ui";import{CopyToPageIcon as L}from"efficient-easel/icons";import{backendOf as E}from"../lib/website-session.js";import{useEaselSession as z}from"efficient-easel/screen/lib/session-context";import{say as o}from"../../format/lib/editor-words.js";import{cloneNodeWithFreshIds as W}from"efficient-easel/screen/lib/document/section-doc";import{FOOTER_TYPE as H}from"efficient-easel/draw";import{settlingPages as Y}from"../lib/editor-document-adapter.js";function $(i,r,l){const n=W(i,void 0,r);return l?.(n)??n}function q({node:i,currentSlug:r,siteId:l,tokenRef:n,runAuthed:c,onNotify:u}){const[s,a]=p(!1),[m,P]=p(null),d=z(),N=O(e=>e.config.components),[T,g]=p(!1),[h,b]=p(null),k=A(null),[y,v]=p(null),M=j(async()=>{if(d.usesBridgedToken&&!n.current){g(!0);return}try{P(await E(d).pages.list(l?{siteId:l}:void 0))}catch{g(!0)}},[n,l,d]),D=()=>{if(s){a(!1);return}const e=k.current?.getBoundingClientRect();e&&v({top:e.bottom+6,right:Math.max(8,window.innerWidth-e.right)}),P(null),g(!1),M(),a(!0)},w=(m??[]).filter(e=>e.slug!==r),F=async e=>{if(h)return;b(e.slug);const I=$(i,N,d.documentHooks?.storedNode),C=await c(()=>G(E(d).pages,e,I));b(null),a(!1),u?.(C?o("Duplicated to “{name}”",{name:e.label}):o("Couldn’t duplicate the section — please retry"),C?"success":"error")};return x(S,{children:[t("span",{"data-menu-toggle":!0,style:{display:"contents"},children:t(B,{buttonRef:k,label:o("Duplicate to another page"),hasPopup:"menu",expanded:s,onClick:D,children:t(L,{size:15})})}),s&&y&&t(R,{portal:!0,style:{top:y.top,right:y.right},onClose:()=>a(!1),children:x("div",{role:"menu","aria-label":o("Duplicate to page"),children:[t(f,{children:o("Duplicate to page")}),T?t(f,{children:o("Couldn’t load pages")}):m===null?t(f,{children:o("Loading…")}):w.length===0?t(f,{children:o("No other pages")}):w.map(e=>x(_,{role:"menuitem",disabled:h!==null,onClick:()=>{F(e)},children:[t("span",{className:"min-w-0 flex-1 truncate",children:e.label}),h===e.slug?t("span",{className:"shrink-0 text-xs",children:o("Copying…")}):e.draft&&t("span",{className:"shrink-0 text-xs",children:o("draft")})]},e.id))]})})]})}async function G(i,r,l){const n=Y(i),c=await n.load({id:r.id});if(!c)throw new Error(`Page "${r.slug}" no longer exists.`);const u=c.layout??{},s=Array.isArray(u.content)?[...u.content]:[],a=s.findIndex(m=>m?.type===H);s.splice(a===-1?s.length:a,0,l),await n.save(r.id,{layout:{root:{},zones:{},...u,content:s}},{version:c.version,clientId:""})}export{$ as copyForAnotherPage,G as copyNodeToPage,q as default};
|
|
@@ -7,17 +7,17 @@ interface Props {
|
|
|
7
7
|
accept: string;
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
focusKey?: string;
|
|
10
|
-
focusWhen?: (props: Record<string, unknown
|
|
10
|
+
focusWhen?: (props: Record<string, unknown>, view: "desktop" | "tablet" | "mobile") => boolean;
|
|
11
11
|
frameKey?: string;
|
|
12
12
|
fieldKey?: string;
|
|
13
13
|
}
|
|
14
|
-
export declare function viewFocusOf(values: Record<string, unknown>, focusKey: string, device: ReturnType<typeof usePreviewDevice
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export declare function viewFocusOf(values: Record<string, unknown>, focusKey: string, device: ReturnType<typeof usePreviewDevice>, tabletActs?: boolean): {
|
|
15
|
+
ownView: boolean;
|
|
16
|
+
followed: string;
|
|
17
|
+
followsView: "desktop" | "tablet";
|
|
17
18
|
own: string | undefined;
|
|
18
19
|
focus: string;
|
|
19
20
|
key: string;
|
|
20
|
-
|
|
21
|
-
} | null;
|
|
22
|
-
export default function MediaUploadField({ value, onChange, label, accept, placeholder, focusKey, focusWhen, frameKey, fieldKey }: Props): import("react").JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export default function MediaUploadField({ value, onChange, label, accept, placeholder, focusKey, focusWhen, frameKey, fieldKey }: Props): import("react").JSX.Element | null;
|
|
23
23
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{SettingsDefaultReset as B,SettingsField as b}from"efficient-easel/panel";import{useSelectedHost as H}from"efficient-easel/easel";import{FOCAL_DEFAULT as M}from"efficient-shell/format";import{ImageIcon as v,PlayIcon as C}from"efficient-easel/icons";import{ImageFocusPoint as T,MediaUploadField as A}from"efficient-shell/ui";import{useContext as L}from"react";import{ScreenDocumentContext as R}from"efficient-easel/screen/components/ScreenDocumentContext";import{editorEaselWords as _,say as m}from"../../format/lib/editor-words.js";import{phoneKey as j,tabletKey as P}from"efficient-easel/draw";import{PHONE_CLEAR as N}from"../../format/lib/document/phone-override.js";import{usePreviewDevice as W}from"efficient-easel/draw/client";import{focusPoint as D}from"../../format/lib/content/phone-focus.js";import{shownTier as S}from"efficient-easel/screen/lib/document/device-fields";import{onDesktopWords as q}from"efficient-easel/screen/lib/document/box-fields";import{requestMediaPick as z}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as G}from"efficient-easel/screen/lib/host";import{mediaValueSrc as J}from"../../format/lib/media-value.js";import{useSelectedPatch as Q}from"../lib/document/controls.js";import{backendOf as X}from"../lib/website-session.js";import{useEaselSession as Y}from"efficient-easel/screen/lib/session-context";function Z(i,o,r,l=!0){const n=S(r),s=typeof i[o]=="string"&&i[o]?String(i[o]):M;if(n==="desktop")return{ownView:!1,followed:s,followsView:"desktop",own:void 0,focus:s,key:o};const a=n==="tablet"?P(o):j(o),d=D(i[a])??void 0,p=n==="mobile"&&l?D(i[P(o)])??void 0:void 0,w=p??s;return{ownView:!0,followed:w,followsView:p?"tablet":"desktop",own:d,focus:d??w,key:a}}function $(i,o,r){const l=H();if(!o||!l)return null;const n=l.values??{};if(r&&!r(n,S(i)))return null;const s=Z(n,o,i,r?r(n,"tablet"):!0),a=l.onChange;return{...s,set:d=>a(s.key,d),clear:()=>a(s.key,N)}}function K({value:i,onChange:o,label:r,accept:l,placeholder:n,focusKey:s,focusWhen:a,frameKey:d,fieldKey:p}){const w=G(),I=Y(),h=m(r),E=W(),f=l.startsWith("video"),t=$(E,f?void 0:s,a),F=!!s&&S(E)!=="desktop",x=L(R),V=Q(),u=d&&p?{video:p,frame:d}:null,U=c=>z(w,{accept:l,title:h,...c?{file:c}:{}}).then(k=>!k||!u?k?.url??null:(V({[u.video]:k.url,[u.frame]:k.posterUrl??""}),null)),y=u?c=>c?o(c):V({[u.video]:"",[u.frame]:""}):o,g=J(i);if(F&&(!t||!g))return null;if(x&&!x.capabilities.mediaEditing)return e(b,{label:h,icon:f?e(C,{}):e(v,{}),children:e("div",{className:"sf-image-slot-inert",children:f?m("Templates don’t store videos — this slot stays a placeholder. Each website picks its own after it’s created."):m("Templates don’t store images — this slot stays a placeholder. Each website picks its own after it’s created.")})});const O=t?.ownView&&g?e(B,{words:_()?.panel,label:m("Image focus"),changed:!!t.own,detail:q(c=>m(c),t.followed,t.followsView),onReset:t.clear}):void 0;return F&&t?e(b,{label:h,icon:e(v,{}),action:O,children:e("div",{style:{flex:"1 1 auto",minWidth:0},children:e(T,{value:t.focus,onChange:t.set,label:m("Image focus"),image:g,hint:null})})}):e(b,{label:h,icon:f?e(C,{}):e(v,{}),children:e("div",{style:{flex:"1 1 auto",minWidth:0},children:e(A,{value:g,onChange:y,onPick:U,accept:f?"video/*":"image/*",kind:f?"video":"image",placeholder:n===void 0?void 0:m(n),maxSizeBytes:X(I).media.maxUploadBytes,...t?{focus:t.focus,onFocusChange:t.set}:{}})})})}export{K as default,Z as viewFocusOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,Fragment as H,jsxs as y}from"react/jsx-runtime";import{useContext as bt,useEffect as pe,useRef as Pt,useState as Le}from"react";import{FieldSelect as wt,InspectorField as vt,fieldShownInView as Tt}from"efficient-easel/fields";import{SettingsField as Nt}from"efficient-easel/panel";import{InspectorUpLevel as Y}from"efficient-easel/chrome";import{StylesIcon as kt,TypeIcon as Ot}from"efficient-easel/icons";import{useEasel as Ct}from"efficient-easel/easel";import{TextPartPanel as Be}from"efficient-easel/copy";import{Button as Rt,IconButton as Et,Tooltip as It}from"efficient-shell/ui";import{PartTextBox as zt,partTextCells as Ue}from"./PartTextBox.js";import{SiteFields as me}from"./SiteFields.js";import{usePartMotion as Ft}from"./usePartMotion.js";import{UiIcon as We}from"efficient-easel/draw/client";import{usePreviewHeader as _t}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as Vt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as At}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as Lt,partStyleToTextStyleValues as Bt,pushIntoStyle as Ut,resolveTextStyles as He,styleIdOfRole as Wt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as Ht}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}from"../lib/document/part-panel-rows.js";import{usePartStyle as Gt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as J,textFieldOffPage as Kt,textFieldPanelOnly as Mt}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as $t}from"efficient-easel/draw";import{useSectionOps as Xt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as Yt,FONT_ROLES as qt,FONT_ROLE_LABELS as De,fontOption as he,fontRoleOf as Jt}from"../../format/lib/fonts.js";import{isMultilineKind as Qt,partPlaceholder as Zt,typeInPlaceKind as en}from"../../render/lib/document/part-text.js";import{partRowField as tn}from"../lib/document/part-row-field.js";import{decodePartKey as nn,partPropsWithRowValue as on,partRowValue as ln}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Ge,propsWithPartStyleValue as U,propsWithoutPartStyle as sn,readPartStyle as ye,regionHasOwnLook as rn}from"../../render/lib/document/part-styles.js";import{partThemeColors as an}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Ke}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as cn}from"../lib/document/part-typing.js";import{keysOnCanvas as dn,useCanvasTypingPart as un}from"../lib/document/canvas-typing.js";import{useEaselHost as fn}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as pn,SOURCE_ACTIONS as mn,SOURCE_ACTION_LABEL as hn,partSourceNoteFor as yn,partSourceOf as gn,sourceMenuIdOf as Sn,sourceSlugOf as ge}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as xn,holdsAuthoredText as bn}from"../../render/lib/document/text-parts.js";import{regionsForSection as Pn}from"../../format/lib/sections/section-text-regions.js";import{regionTakesSize as wn,textRegionOfPartKey as vn}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as Me}from"./SameInEveryViewNote.js";function Se(t){return t?l(t):null}function $e(t){return t.kind==="role"?De[t.role]:t.kind==="custom"?"Custom":null}function Tn(t){const o=Jt(t.role);return o?{kind:"role",role:o}:null}function Nn(t,o){if(!t)return{kind:"unread"};const{faceRole:r,base:i}=t;if(o[r]===i.fontKey)return{kind:"role",role:r};const c=Object.keys(o).filter(s=>o[s]===i.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function Q(t,o,r,i){return Tn(ye(t,o))??Nn(r,i)}function kn(t,o){if(!t.length)return null;const r=o(t[0]);return t.every(i=>o(i)===r)?r:null}function Xe(t){return[{value:j,label:l("No style"),description:l("Section’s own")},...t.map(o=>({value:o.id,label:o.name,description:o.values.font?he(o.values.font)?.label:void 0}))]}const j="";function On({face:t,base:o,onPick:r}){const i=t.kind==="role"?t.role:j,c=[{label:l("No style"),value:j},...qt.map(s=>({label:l(De[s]),value:s}))];return n(wt,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:s=>r(s===j?null:s),renderOption:s=>s.value===j?y(H,{children:[n("span",{className:"es-fsel-label sf-part-style-keep",children:s.label}),n("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):n("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${s.value})`},children:s.label}),renderValue:()=>n("span",{style:{fontFamily:o?.fontKey?`var(${he(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:Se($e(t))}),valueText:s=>Se($e(t))??s?.label??""})}const Ye=["regionNote","regionStyle"],Cn=Object.keys(je).filter(t=>!Ye.includes(t));function qe(t,o){return!t.some(o)}function Rn({sectionName:t,onBack:o,textEditor:r,styleRow:i,children:c,tabs:s}){const E=y(H,{children:[r,i,c]});return y("div",{className:"sf-part-panel",children:[n(Y,{inline:!0,name:l(t),onSelect:o}),s?s(E):E]})}function Je({source:t,slug:o,menuId:r}){const i=fn(),c=mn[t],s=!c.needsSlug||!!o;return n("div",{className:"sf-note sf-note--source",children:y("p",{className:"es-field-hint sf-hint-keep",children:[l(pn[t]),s?y(H,{children:[" ",n(Rt,{type:"button",variant:"link",size:"sm",onClick:()=>{c.type==="storefront-editor:open-menus"?i.send(c.type,{menuId:r??null}):o&&i.send(c.type,{slug:o})},children:l(hn)})]}):null]})})}const Qe=4,En=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:o,face:r,base:i,onFollowStyle:c,source:s,slug:E,onBack:N,shows:x,sizedStyle:b,ownLook:I}){const D=t.follows;return y("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l(t.label)})}),x("regionNote")&&!I&&n("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(D),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(D)})}),b?y(H,{children:[b,x("regionStyle")&&n("p",{className:"es-field-hint sf-hint-keep",children:Ze(t)})]}):c?x("regionStyle")?n(H,{children:n(Nt,{label:l("Style"),icon:n(kt,{}),hint:Ze(t),children:n(On,{face:r,base:i,onPick:c})})}):null:x("regionNote")&&n("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")?n(Je,{source:s,slug:E}):null,qe([...Ye,"sourceNote",...b?["fontSize"]:[]],z=>x(z)&&(z!=="sourceNote"||!!s))&&n(Me,{}),n(Y,{inline:!0,name:l("Page"),onSelect:N})]})}function In({onBack:t}){return y("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l("This part is no longer here.")})}),n("p",{children:l("The section it belonged to has been changed or removed.")}),n(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function zn({onBack:t,partId:o,why:r}){return y("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l("This part's settings did not open.")})}),n("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.")}),n("p",{className:"sf-note-detail",children:y("code",{children:[o," — ",r]})}),n(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function Fn({nodeId:t,propKey:o,onBack:r,onEditStyle:i}){const{getItemById:c,getSelectorForId:s,config:E}=Ct(e=>e),N=Xt(),x=un(),{partStyle:b}=Gt(),{fonts:I,textStyles:D}=_t(),z=bt(At),xe=!z?.capabilities?.hasSiteTheme,{persist:nt}=jt({themeFromDocument:xe,tokenRef:z?.tokenRef,siteId:z?.siteId??null}),k=Ht({themeFromDocument:xe,persist:nt}),[ot,Z]=Le(!1),W=Dt(),f=e=>q(W)!=="tablet"&&Tt(je[e],W),be=Pt(null),d=c(t),p=s(t),Pe=d?E.components[d.type]:void 0,{key:P,row:w}=nn(o),we=Pe?.fields?.[P],g=w?tn(we,w):we,F=xn(t,o),u=d?.props??{},v=en(g),ve=Kt(g),Te=bn(g),Ne=d?gn(d.type):null,ee=d?yn(d.type,P):null,te=w?ln(u[P],w):u[P],ke=!!w&&!(Array.isArray(u[P])&&w.index<u[P].length);pe(()=>{if(dn(document))return;be.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[F]);const[ne,Oe]=Le(0);pe(()=>Oe(0),[F]);const oe=!!d&&!ke&&(!p||!g);pe(()=>{if(!oe||ne>=Qe)return;const e=setTimeout(()=>Oe(a=>a+1),En);return()=>clearTimeout(e)},[oe,ne]);const lt=oe&&ne<Qe,le=Ft(t,Ke(d?.type,o),"textPart");if(!d||ke)return n(In,{onBack:r});const G=Pn(d.type),Ce=G?vn(G,o):null;if(G&&Ce){const e=b?.partId===F?b:null,a=G[Ce],h=a.writable===!0&&!!p,T=C=>{p&&N.replaceComponent(p.zone,p.index,{...d,props:U(u,o,"role",C)})};if(h&&wn(a)){const C=ye(u,o),Ae=R=>{if(!p)return;let fe=u;for(const[St,xt]of Object.entries(R))fe=U(fe,o,St,xt??null);N.replaceComponent(p.zone,p.index,{...d,props:fe})},ht=He(k.saved,k.old),yt=Ge(C)??"",gt=Ue(C,e?.base??tt,Ae,q(W)).filter(R=>R.key==="fontSize"&&f(R.key));return n(me,{motion:le,body:n(et,{region:a,sizePx:e?.base.sizePx??null,face:Q(u,o,e,I),base:e?.base??null,source:Ne,slug:ge(u),onBack:r,shows:f,ownLook:rn(C),sizedStyle:n(Be,{style:f("style")?{value:yt,options:Xe(ht),onChange:R=>Ae(R?{textStyle:R}:{textStyle:null,role:null}),onEditStyles:i}:void 0,cells:gt})})})}return n(me,{motion:le,body:n(et,{region:a,sizePx:e?.base.sizePx??null,face:Q(u,o,e,I),base:e?.base??null,onFollowStyle:h?T:void 0,source:Ne,slug:ge(u),onBack:r,shows:f})})}if(!p||!g)return lt?n("div",{className:"sf-note","aria-busy":"true"}):n(zn,{onBack:r,partId:F,why:p?"no field":"no selector"});const Re=e=>{N.replaceComponent(p.zone,p.index,{...d,props:e})},se=e=>{if(J(e).hidden!==J(te).hidden||!v){const h=w?on(u,P,w,e):{...u,[P]:e};h&&Re(h);return}cn({node:d,propKey:o,kind:v,zone:p.zone,index:p.index},J(e).text,N.replaceComponent)},st=te,_=b?.partId===F?b:null,V=_?.styleOwner,K=V?c(V.owner):null,re=V&&K?s(V.owner):null,ie=!!(V&&K&&re),A=ie?K.props??{}:u,ae=ie?e=>N.replaceComponent(re.zone,re.index,{...K,props:e}):Re,M=ie?V.kind:Ke(d?.type,o),S=ye(A,M),m=[{partKey:M,face:Q(A,M,_,I),sizeGroup:_?.sizeGroup??null,base:_?.base??tt,style:S}],Ee=kn(m,e=>e.sizeGroup),rt=an(_?.inks),L=(e,a)=>{let h=A;for(const T of m)h=U(h,T.partKey,e,a);ae(h)},it=e=>e?L("textStyle",e):ce({textStyle:null,role:null}),ce=e=>{let a=A;for(const h of m)for(const[T,C]of Object.entries(e))a=U(a,h.partKey,T,C??null);ae(a)},de=v==="text"||v==="textarea",{text:Ie,hidden:B}=J(te),$=g?.[$t]?.label??o,ze=B?l("Show {label} on the slide",{label:l($)}):l("Hide {label} on the slide",{label:l($)}),Fe=y("div",{className:"sf-field-head",children:[n(Ot,{}),n("span",{className:"sf-field-label sf-field-label--inline",children:l($)}),de&&n(It,{content:ze,children:n(Et,{"aria-pressed":B,"aria-label":ze,onClick:()=>se({text:Ie,hidden:!B}),children:B?n(We,{name:"eye-off",size:14}):n(We,{name:"eye",size:14})})})]}),X=!ve&&Te,at=!!v&&(Mt(g)||ve||B||!Te),_e=Q(A,M,_,I),ct=_e.kind==="role"?_e.role:null,ue=Ge(S)??Wt(ct),Ve=He(k.saved,k.old),dt=Object.entries(S).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,ut=()=>{let e=A;for(const a of m){const{role:h,textStyle:T}=a.style;e=sn(e,a.partKey),h&&(e=U(e,a.partKey,"role",h)),T&&(e=U(e,a.partKey,"textStyle",T))}ae(e)},O=ue,ft=Lt(m[0].style),pt=O?Ve.find(e=>e.id===O)?.name??O:"",mt=()=>{Z(!1),O&&(k.write(Ut({saved:k.saved,old:k.old,styleId:O,values:Bt(m[0].style)}),!0),ut())};return y(Rn,{sectionName:Pe?.label??d.type,onBack:r,tabs:e=>n(me,{motion:le,body:e}),textEditor:f("words")?n("div",{ref:be,className:"sf-part-text",children:at?n(zt,{text:Ie,onTextChange:e=>se(de?{text:e,hidden:B}:e),multiline:Qt(v),markup:v!=="plainText",styled:!1,style:m[0].style,base:m[0].base,setValue:ce,colors:rt,placeholder:Se(Zt(g))??void 0,ariaLabel:l($),head:Fe,typedOnCanvas:x===F}):v?de?Fe:null:n(vt,{field:g,name:o,value:st,onChange:se,id:`sf-part-${t}-${o}`})}):void 0,children:[ee&&f("sourceNote")&&n(Je,{source:ee,slug:ge(u),menuId:Sn(u)}),X&&n(Be,{style:f("style")?{value:ue??"",options:Xe(Ve),onChange:e=>it(e||null),changed:dt>0,onEditStyles:i,onUpdateStyle:O&&ft?()=>Z(!0):void 0}:void 0,font:f("font")?{value:S.font??"",styleValue:he(m[0].base.fontKey)?.label,options:Yt.map(e=>({label:e.label,value:e.key})),onChange:e=>L("font",e||null)}:void 0,italic:f("italic")?{value:S.italic,styleValue:_n(D,ue),onChange:e=>L("italic",e??null)}:void 0,cells:Ue(m[0].style,m[0].base,ce,q(W)).filter(e=>f(e.key)),align:f("align")?q(W)==="mobile"?{value:S.alignPhone??"",styleValue:S.align??m[0].base.align,onChange:e=>L("alignPhone",e||null)}:{value:S.align??"",styleValue:m[0].base.align,onChange:e=>L("align",e||null)}:void 0,letterCase:f("letterCase")?{value:S.case??"",styleValue:m[0].base.case,onChange:e=>L("case",e||null)}:void 0}),ot&&O&&n(Vt,{styleName:pt,onCancel:()=>Z(!1),onConfirm:mt}),X&&Ee===null&&f("fixedSizeHint")&&n("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),qe(Cn,e=>f(e)&&(e==="words"||(e==="sourceNote"?!!ee:e==="fixedSizeHint"?X&&Ee===null:X)))&&n(Me,{})]})}function _n(t,o){return!o||!Array.isArray(t)?!1:t.find(i=>i?.id===o)?.values?.italic===!0}const tt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{Rn as PartPanelBody,Je as PartSourceNote,On as PartStyleSelect,Fn as default,Q as partFace};
|
|
1
|
+
"use client";import{jsx as n,Fragment as W,jsxs as y}from"react/jsx-runtime";import{useContext as bt,useEffect as pe,useRef as Pt,useState as Le}from"react";import{FieldSelect as wt,InspectorField as vt,fieldShownInView as Tt}from"efficient-easel/fields";import{SettingsField as Nt}from"efficient-easel/panel";import{InspectorUpLevel as Y}from"efficient-easel/chrome";import{StylesIcon as kt,TypeIcon as Ot}from"efficient-easel/icons";import{useEasel as Ct}from"efficient-easel/easel";import{TextPartPanel as Be}from"efficient-easel/copy";import{Button as Rt,IconButton as Et,Tooltip as It}from"efficient-shell/ui";import{PartTextBox as zt,partTextCells as He}from"./PartTextBox.js";import{SiteFields as me}from"./SiteFields.js";import{usePartMotion as Ft}from"./usePartMotion.js";import{UiIcon as Ue}from"efficient-easel/draw/client";import{usePreviewHeader as _t}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as Vt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as At}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as Lt,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 Xt}from"efficient-easel/draw";import{useSectionOps as Yt}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 he,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,propsWithPartStyleValue as H,propsWithoutPartStyle as rn,readPartStyle as ye,regionHasOwnLook as an}from"../../render/lib/document/part-styles.js";import{partThemeColors as cn}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Ke}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as dn}from"../lib/document/part-typing.js";import{keysOnCanvas as un,useCanvasTypingPart as fn}from"../lib/document/canvas-typing.js";import{useEaselHost as pn}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as mn,SOURCE_ACTIONS as hn,SOURCE_ACTION_LABEL as yn,partSourceNoteFor as gn,partSourceOf as Sn,sourceMenuIdOf as xn,sourceSlugOf as ge}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as bn,holdsAuthoredText as Pn}from"../../render/lib/document/text-parts.js";import{regionsForSection as wn}from"../../format/lib/sections/section-text-regions.js";import{regionTakesSize as vn,textRegionOfPartKey as Tn}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as Me}from"./SameInEveryViewNote.js";function Se(t){return t?l(t):null}function $e(t){return t.kind==="role"?De[t.role]:t.kind==="custom"?"Custom":null}function Nn(t){const o=Qt(t.role);return o?{kind:"role",role:o}:null}function kn(t,o){if(!t)return{kind:"unread"};const{faceRole:r,base:i}=t;if(o[r]===i.fontKey)return{kind:"role",role:r};const c=Object.keys(o).filter(s=>o[s]===i.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function Q(t,o,r,i){return Nn(ye(t,o))??kn(r,i)}function On(t,o){if(!t.length)return null;const r=o(t[0]);return t.every(i=>o(i)===r)?r:null}function Xe(t){return[{value:j,label:l("No style"),description:l("Section’s own")},...t.map(o=>({value:o.id,label:o.name,description:o.values.font?he(o.values.font)?.label:void 0}))]}const j="";function Cn({face:t,base:o,onPick:r}){const i=t.kind==="role"?t.role:j,c=[{label:l("No style"),value:j},...Jt.map(s=>({label:l(De[s]),value:s}))];return n(wt,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:s=>r(s===j?null:s),renderOption:s=>s.value===j?y(W,{children:[n("span",{className:"es-fsel-label sf-part-style-keep",children:s.label}),n("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):n("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${s.value})`},children:s.label}),renderValue:()=>n("span",{style:{fontFamily:o?.fontKey?`var(${he(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:Se($e(t))}),valueText:s=>Se($e(t))??s?.label??""})}const Ye=["regionNote","regionStyle"],Rn=Object.keys(je).filter(t=>!Ye.includes(t));function qe(t,o){return!t.some(o)}function En({sectionName:t,onBack:o,textEditor:r,styleRow:i,children:c,tabs:s}){const E=y(W,{children:[r,i,c]});return y("div",{className:"sf-part-panel",children:[n(Y,{inline:!0,name:l(t),onSelect:o}),s?s(E):E]})}function Je({source:t,slug:o,menuId:r}){const i=pn(),c=hn[t],s=!c.needsSlug||!!o;return n("div",{className:"sf-note sf-note--source",children:y("p",{className:"es-field-hint sf-hint-keep",children:[l(mn[t]),s?y(W,{children:[" ",n(Rt,{type:"button",variant:"link",size:"sm",onClick:()=>{c.type==="storefront-editor:open-menus"?i.send(c.type,{menuId:r??null}):o&&i.send(c.type,{slug:o})},children:l(yn)})]}):null]})})}const Qe=4,In=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:o,face:r,base:i,onFollowStyle:c,source:s,slug:E,onBack:N,shows:x,sizedStyle:b,ownLook:I}){const D=t.follows;return y("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l(t.label)})}),x("regionNote")&&!I&&n("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(D),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(D)})}),b?y(W,{children:[b,x("regionStyle")&&n("p",{className:"es-field-hint sf-hint-keep",children:Ze(t)})]}):c?x("regionStyle")?n(W,{children:n(Nt,{label:l("Style"),icon:n(kt,{}),hint:Ze(t),children:n(Cn,{face:r,base:i,onPick:c})})}):null:x("regionNote")&&n("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")?n(Je,{source:s,slug:E}):null,qe([...Ye,"sourceNote",...b?["fontSize"]:[]],z=>x(z)&&(z!=="sourceNote"||!!s))&&n(Me,{}),n(Y,{inline:!0,name:l("Page"),onSelect:N})]})}function zn({onBack:t}){return y("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l("This part is no longer here.")})}),n("p",{children:l("The section it belonged to has been changed or removed.")}),n(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function Fn({onBack:t,partId:o,why:r}){return y("div",{className:"sf-note",children:[n("p",{children:n("strong",{children:l("This part's settings did not open.")})}),n("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.")}),n("p",{className:"sf-note-detail",children:y("code",{children:[o," — ",r]})}),n(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function _n({nodeId:t,propKey:o,onBack:r,onEditStyle:i}){const{getItemById:c,getSelectorForId:s,config:E}=Ct(e=>e),N=Yt(),x=fn(),{partStyle:b}=Kt(),{fonts:I,textStyles:D}=_t(),z=bt(At),xe=!z?.capabilities?.hasSiteTheme,{persist:nt}=jt({themeFromDocument:xe,tokenRef:z?.tokenRef,siteId:z?.siteId??null}),k=Wt({themeFromDocument:xe,persist:nt}),[ot,Z]=Le(!1),U=Dt(),f=e=>(q(U)!=="tablet"||Gt(e))&&Tt(je[e],U),be=Pt(null),d=c(t),p=s(t),Pe=d?E.components[d.type]:void 0,{key:P,row:w}=on(o),we=Pe?.fields?.[P],g=w?nn(we,w):we,F=bn(t,o),u=d?.props??{},v=tn(g),ve=Mt(g),Te=Pn(g),Ne=d?Sn(d.type):null,ee=d?gn(d.type,P):null,te=w?sn(u[P],w):u[P],ke=!!w&&!(Array.isArray(u[P])&&w.index<u[P].length);pe(()=>{if(un(document))return;be.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[F]);const[ne,Oe]=Le(0);pe(()=>Oe(0),[F]);const oe=!!d&&!ke&&(!p||!g);pe(()=>{if(!oe||ne>=Qe)return;const e=setTimeout(()=>Oe(a=>a+1),In);return()=>clearTimeout(e)},[oe,ne]);const lt=oe&&ne<Qe,le=Ft(t,Ke(d?.type,o),"textPart");if(!d||ke)return n(zn,{onBack:r});const G=wn(d.type),Ce=G?Tn(G,o):null;if(G&&Ce){const e=b?.partId===F?b:null,a=G[Ce],h=a.writable===!0&&!!p,T=C=>{p&&N.replaceComponent(p.zone,p.index,{...d,props:H(u,o,"role",C)})};if(h&&vn(a)){const C=ye(u,o),Ae=R=>{if(!p)return;let fe=u;for(const[St,xt]of Object.entries(R))fe=H(fe,o,St,xt??null);N.replaceComponent(p.zone,p.index,{...d,props:fe})},ht=We(k.saved,k.old),yt=Ge(C)??"",gt=He(C,e?.base??tt,Ae,q(U)).filter(R=>R.key==="fontSize"&&f(R.key));return n(me,{motion:le,body:n(et,{region:a,sizePx:e?.base.sizePx??null,face:Q(u,o,e,I),base:e?.base??null,source:Ne,slug:ge(u),onBack:r,shows:f,ownLook:an(C),sizedStyle:n(Be,{style:f("style")?{value:yt,options:Xe(ht),onChange:R=>Ae(R?{textStyle:R}:{textStyle:null,role:null}),onEditStyles:i}:void 0,cells:gt})})})}return n(me,{motion:le,body:n(et,{region:a,sizePx:e?.base.sizePx??null,face:Q(u,o,e,I),base:e?.base??null,onFollowStyle:h?T:void 0,source:Ne,slug:ge(u),onBack:r,shows:f})})}if(!p||!g)return lt?n("div",{className:"sf-note","aria-busy":"true"}):n(Fn,{onBack:r,partId:F,why:p?"no field":"no selector"});const Re=e=>{N.replaceComponent(p.zone,p.index,{...d,props:e})},se=e=>{if(J(e).hidden!==J(te).hidden||!v){const h=w?ln(u,P,w,e):{...u,[P]:e};h&&Re(h);return}dn({node:d,propKey:o,kind:v,zone:p.zone,index:p.index},J(e).text,N.replaceComponent)},st=te,_=b?.partId===F?b:null,V=_?.styleOwner,K=V?c(V.owner):null,re=V&&K?s(V.owner):null,ie=!!(V&&K&&re),A=ie?K.props??{}:u,ae=ie?e=>N.replaceComponent(re.zone,re.index,{...K,props:e}):Re,M=ie?V.kind:Ke(d?.type,o),S=ye(A,M),m=[{partKey:M,face:Q(A,M,_,I),sizeGroup:_?.sizeGroup??null,base:_?.base??tt,style:S}],Ee=On(m,e=>e.sizeGroup),rt=cn(_?.inks),L=(e,a)=>{let h=A;for(const T of m)h=H(h,T.partKey,e,a);ae(h)},it=e=>e?L("textStyle",e):ce({textStyle:null,role:null}),ce=e=>{let a=A;for(const h of m)for(const[T,C]of Object.entries(e))a=H(a,h.partKey,T,C??null);ae(a)},de=v==="text"||v==="textarea",{text:Ie,hidden:B}=J(te),$=g?.[Xt]?.label??o,ze=B?l("Show {label} on the slide",{label:l($)}):l("Hide {label} on the slide",{label:l($)}),Fe=y("div",{className:"sf-field-head",children:[n(Ot,{}),n("span",{className:"sf-field-label sf-field-label--inline",children:l($)}),de&&n(It,{content:ze,children:n(Et,{"aria-pressed":B,"aria-label":ze,onClick:()=>se({text:Ie,hidden:!B}),children:B?n(Ue,{name:"eye-off",size:14}):n(Ue,{name:"eye",size:14})})})]}),X=!ve&&Te,at=!!v&&($t(g)||ve||B||!Te),_e=Q(A,M,_,I),ct=_e.kind==="role"?_e.role:null,ue=Ge(S)??Ut(ct),Ve=We(k.saved,k.old),dt=Object.entries(S).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,ut=()=>{let e=A;for(const a of m){const{role:h,textStyle:T}=a.style;e=rn(e,a.partKey),h&&(e=H(e,a.partKey,"role",h)),T&&(e=H(e,a.partKey,"textStyle",T))}ae(e)},O=ue,ft=Lt(m[0].style),pt=O?Ve.find(e=>e.id===O)?.name??O:"",mt=()=>{Z(!1),O&&(k.write(Ht({saved:k.saved,old:k.old,styleId:O,values:Bt(m[0].style)}),!0),ut())};return y(En,{sectionName:Pe?.label??d.type,onBack:r,tabs:e=>n(me,{motion:le,body:e}),textEditor:f("words")?n("div",{ref:be,className:"sf-part-text",children:at?n(zt,{text:Ie,onTextChange:e=>se(de?{text:e,hidden:B}:e),multiline:Zt(v),markup:v!=="plainText",styled:!1,style:m[0].style,base:m[0].base,setValue:ce,colors:rt,placeholder:Se(en(g))??void 0,ariaLabel:l($),head:Fe,typedOnCanvas:x===F}):v?de?Fe:null:n(vt,{field:g,name:o,value:st,onChange:se,id:`sf-part-${t}-${o}`})}):void 0,children:[ee&&f("sourceNote")&&n(Je,{source:ee,slug:ge(u),menuId:xn(u)}),X&&n(Be,{style:f("style")?{value:ue??"",options:Xe(Ve),onChange:e=>it(e||null),changed:dt>0,onEditStyles:i,onUpdateStyle:O&&ft?()=>Z(!0):void 0}:void 0,font:f("font")?{value:S.font??"",styleValue:he(m[0].base.fontKey)?.label,options:qt.map(e=>({label:e.label,value:e.key})),onChange:e=>L("font",e||null)}:void 0,italic:f("italic")?{value:S.italic,styleValue:Vn(D,ue),onChange:e=>L("italic",e??null)}:void 0,cells:He(m[0].style,m[0].base,ce,q(U)).filter(e=>f(e.key)),align:f("align")?q(U)==="mobile"?{value:S.alignPhone??"",styleValue:S.align??m[0].base.align,onChange:e=>L("alignPhone",e||null)}:{value:S.align??"",styleValue:m[0].base.align,onChange:e=>L("align",e||null)}:void 0,letterCase:f("letterCase")?{value:S.case??"",styleValue:m[0].base.case,onChange:e=>L("case",e||null)}:void 0}),ot&&O&&n(Vt,{styleName:pt,onCancel:()=>Z(!1),onConfirm:mt}),X&&Ee===null&&f("fixedSizeHint")&&n("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),qe(Rn,e=>f(e)&&(e==="words"||(e==="sourceNote"?!!ee:e==="fixedSizeHint"?X&&Ee===null:X)))&&n(Me,{})]})}function Vn(t,o){return!o||!Array.isArray(t)?!1:t.find(i=>i?.id===o)?.values?.italic===!0}const tt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{En as PartPanelBody,Je as PartSourceNote,Cn as PartStyleSelect,_n as default,Q as partFace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as s,jsxs as P}from"react/jsx-runtime";import{COPY_CELLS as c,CopyBox as C}from"efficient-easel/copy";import{partColourName as _}from"../../format/lib/document/part-inks.js";import{PaddingYIcon as z}from"efficient-easel/icons";import{say as u}from"../../format/lib/editor-words.js";import{SHOP_MARKUP as A}from"../../format/lib/markup.js";import{partTextTools as T}from"../lib/document/canvas-typing.js";import{PART_PADDING_MAX as v,PART_PADDING_MIN as N,PART_PADDING_STEP as D,partSizeBoxOf as O,partSizeFollowed as R,partSpacingOf as k}from"../../render/lib/document/part-styles.js";import{onDesktopWords as w}from"efficient-easel/screen/lib/document/box-fields";const H=["left","center","right","justify"];function I(n,o,i,r="desktop"){const t=k(n),a=O(r),p=n[a]??n.size??o.sizePx,l=R(n,r);return[{...c.fontSize,key:"fontSize",value:n[a],styleValue:Math.round(o.sizePx),onChange:e=>i({[a]:e??null}),...a==="size"?{}:{reset:{detail:l?w(e=>u(e),`${l.px}px`,l.view):void 0}}},{...c.lineHeight,key:"lineHeight",value:t.lineHeight,styleValue:o.lineRatio,onChange:e=>i(e===void 0?{lineHeight:null,line:null}:{lineHeight:e})},{...c.letterSpacing,key:"letterSpacing",scale:p,value:t.letterSpacingEm,styleValue:o.letterEm,onChange:e=>i(e===void 0?{letterSpacing:null,letter:null}:{letterSpacing:e})},{...c.paragraphSpacing,key:"paragraphSpacing",value:n.paragraphSpacing,styleValue:0,onChange:e=>i({paragraphSpacing:e??null})},{key:"padding",name:u("Padding"),icon:s(z,{}),unit:"px",step:D,shiftStep:10,min:N,max:v,value:n.padding,styleValue:o.paddingPx,onChange:e=>i({padding:e??null})}]}function F({text:n,onTextChange:o,multiline:i,markup:r=!0,styled:t=!0,style:a,base:p,setValue:l,colors:e,placeholder:d,ariaLabel:f,head:m,typedOnCanvas:h=!1}){const x=I(a,p,l),S=T(r,i);return P("div",{className:"sf-part-textbox",children:[m,s(C,{value:n,onChange:o,multiline:i,placeholder:d,ariaLabel:f,rules:A,tools:S,barShows:h?"focus":"always",colors:r?e:[],colorNameOf:_,align:t?{value:a.align??p.align,allow:H,onChange:g=>l({align:g})}:void 0,letterCase:t?{value:a.case==="capitalize"?"":a.case??"",onChange:g=>l({case:g||null})}:void 0,cells:t?x:void 0})]})}export{F as PartTextBox,I as partTextCells};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as Y}from"react/jsx-runtime";import{readInks as $}from"../../format/lib/document/part-inks.js";import{useEffect as j,useRef as x}from"react";import{markOverlayPortal as G}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as q}from"efficient-easel/draw/client";import{usePartStyle as U}from"./PreviewPartStyleContext.js";import{usePreviewDevice as V}from"efficient-easel/draw/client";import{decodePartId as I,encodePartId as
|
|
1
|
+
"use client";import{jsx as Y}from"react/jsx-runtime";import{readInks as $}from"../../format/lib/document/part-inks.js";import{useEffect as j,useRef as x}from"react";import{markOverlayPortal as G}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as q}from"efficient-easel/draw/client";import{usePartStyle as U}from"./PreviewPartStyleContext.js";import{usePreviewDevice as V}from"efficient-easel/draw/client";import{shownTier as Q}from"efficient-easel/screen/lib/document/device-fields";import{decodePartId as I,encodePartId as X}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as Z}from"efficient-easel/canvas";import{engagePartAnchors as tt}from"../lib/document/part-anchors.js";import{PART_ATTR as P,PART_STYLE_KIND_ATTR as b,PART_STYLE_OWNER_ATTR as et,partStyleOwnerOf as g}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as D,applyPartStyles as C,blockDrawsTextStyle as F,partFontKeyOf as rt,partShownDeclarations as ot,partStyleBase as nt,partStyleSource as st,storedPartStyle as it}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as lt,styleRoleOfClassName as at}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as k}from"../../format/lib/theme.js";import{styleKeyForPart as A}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as ct,PART_HOST_ATTR as pt}from"../../render/lib/animation/part-motion.js";import{paintPartMotion as ft}from"../lib/document/part-motion-canvas.js";function ut(p){let s=null,o=null;for(let e=p;e&&(s===null||o===null);e=e.parentElement){const r=e.getAttribute("class");s??=at(r),o??=k(r)}return{faceRole:s??"body",sizeGroup:o}}function z(p,s={}){const o=p.style,e={};for(const n of D)e[n]=o[n]??"",o[n]="";s.fontFamily&&(o.fontFamily=s.fontFamily),s.fontSize&&(o.fontSize=s.fontSize);const r=getComputedStyle(p),S=getComputedStyle(p.ownerDocument.documentElement),a=nt({fontSize:r.fontSize,fontWeight:r.fontWeight,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing,textAlign:r.textAlign,textTransform:r.textTransform,paddingTop:r.paddingTop},rt(r.fontFamily,n=>S.getPropertyValue(n)));for(const n of D)o[n]=e[n];return a}function mt({needles:p,styles:s,motions:o=ct,type:e,children:r}){const S=x(null),{selectedPartId:a}=q(),{setPartStyle:n}=U(),y=Q(V()),h=JSON.stringify(p),R=JSON.stringify(s),w=JSON.stringify(o),J=x(new Map);return j(()=>{const d=S.current;if(!d)return;const E=[],_=()=>d.parentElement,M=c=>{const i=_();if(!i)return null;const u=new MutationObserver(c);return u.observe(i,{attributes:!0,attributeFilter:[Z]}),()=>u.disconnect()},L=c=>{const i=new MutationObserver(c);return i.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>i.disconnect()};let f=[];E.push(()=>{for(const c of f)c();f=[]});const W=JSON.parse(h),T=JSON.parse(R),B=JSON.parse(w),H=tt(d,W,_,M,(c,i,u)=>{for(const t of f)t();f=[];const v=[];for(const t of u){const l=t,m=G(l);m&&f.push(m),l.getAttribute(P)===a&&v.push(l)}const K=st(i,a,v,t=>lt(t)!==null||k(t)!==null);if(K&&a){const t=K,l=I(a)?.propKey??"",m=g(t)?{}:ot(it(T,A(e,l)),y,{blockDrawsStyle:F(e,l)});n({partId:a,...ut(t),base:z(t,m),inks:$(t),...(()=>{const N=g(t);return N?{styleOwner:N}:{}})()})}C(u.filter(t=>!g(t)).map(t=>({element:t,partId:t.getAttribute(P)??""})),T,t=>z(t),t=>A(e,t),void 0,y,t=>F(e,t));const O=[...d.querySelectorAll(`[${et}="${CSS.escape(i)}"][${b}]`)];O.length&&C(O.map(t=>({element:t,partId:X(i,t.getAttribute(b)??"")})),T,void 0,t=>t,void 0,y),f.push(ft([...u.filter(t=>!g(t)).map(t=>{const l=t,m=I(l.getAttribute(P)??"")?.propKey??"";return{element:l,partKey:A(e,m)}}),...O.map(t=>({element:t,partKey:t.getAttribute(b)??""}))],t=>B[t],y==="mobile",J.current))},L);return()=>{H();for(const c of E)c()}},[h,R,w,a,n,y,e]),Y("div",{ref:S,[pt]:"",style:{display:"contents"},children:r})}export{mt as default,z as measureStyleBase,ut as styleTagsOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as x}from"react/jsx-runtime";import{useEffect as E,useRef as _}from"react";import{markOverlayPortal as I}from"../../format/lib/document/overlay-portal.js";import{measureStyleBase as O,styleTagsOf as w}from"./PreviewPartAnchors.js";import{usePreviewDevice as
|
|
1
|
+
"use client";import{jsx as x}from"react/jsx-runtime";import{useEffect as E,useRef as _}from"react";import{markOverlayPortal as I}from"../../format/lib/document/overlay-portal.js";import{measureStyleBase as O,styleTagsOf as w}from"./PreviewPartAnchors.js";import{shownTier as D}from"efficient-easel/screen/lib/document/device-fields";import{usePreviewDevice as K,usePreviewParts as N}from"efficient-easel/draw/client";import{usePartStyle as j}from"./PreviewPartStyleContext.js";import{REGION_PART_ATTR as R,encodePartId as B}from"../../render/lib/document/text-parts.js";import{TEXT_REGION_ATTR as v,textRegionOfAttr as C,textRegionPartKey as G}from"../../format/lib/sections/text-regions.js";import{regionsForSection as X}from"../../format/lib/sections/section-text-regions.js";import{TEXT_STYLE_ATTR as n,isTextStyleId as k,regionCanvasDeclarations as q,regionCanvasRestore as J,regionSheetStyle as L,regionShownDeclarations as Y}from"../../render/lib/document/part-styles.js";function $({nodeId:s,sectionType:c,partStyles:m,children:z}){const y=_(null),{selectedPartId:u}=N(),{setPartStyle:p}=j(),f=D(K()),F=JSON.stringify(m??null);return E(()=>{const S=y.current,o=X(c);if(!S||!s||!o)return;const l=[],d=Array.from(S.querySelectorAll(`[${v}]`));for(const t of d){const r=C(o,t.getAttribute(v));if(!r)continue;const g=I(t);g&&l.push(g);const T=G(r),a=B(s,T);t.setAttribute(R,a);const i=m?.[T];if(o[r].sized&&L(i)){const e=q(i,f),b={fontFamily:t.style.fontFamily,fontSize:t.style.fontSize},A=t.getAttribute(n);e.fontFamily&&(t.style.fontFamily=e.fontFamily),e.fontSize&&(t.style.fontSize=e.fontSize);const h={fontFamily:e.fontFamily?t.style.fontFamily:void 0,fontSize:e.fontSize?t.style.fontSize:void 0},P=i?.textStyle;k(P)&&t.setAttribute(n,P),l.push(()=>{J(t.style,b,h),A===null?t.removeAttribute(n):t.setAttribute(n,A)})}if(a===u){const e=O(t,Y(i,o[r],f));p({partId:a,...w(t),base:e})}}return()=>{for(const t of l)t();for(const t of d)t.removeAttribute(R)}},[s,c,u,p,f,F]),x("div",{ref:y,style:{display:"contents"},children:z})}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a}from"react/jsx-runtime";import{TextStyleItem as h,TextStylesGroup as r}from"efficient-easel/text-styles";import{SITE_FONTS as
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import{TextStyleItem as h,TextStylesGroup as r}from"efficient-easel/text-styles";import{SITE_FONTS as p}from"./SiteTextStylesField.js";import{say as u}from"../../format/lib/editor-words.js";const c=["font","size","weight","emphasis"],g=500;function m({font:i,size:s,weight:t,italic:n}){const e={font:i};return s!==null&&(e.size=s),t!==null&&(e.weight=t),n!==null&&(e.italic=n),{id:"accent",kind:"heading",name:u("Emphasis"),values:e}}function y(i,s){const t=[],n=i.values,e=s.values;return e.font!==n.font&&e.font!==void 0&&t.push({key:"font",value:e.font}),e.size!==n.size&&t.push({key:"size",value:e.size??null}),e.weight!==n.weight&&t.push({key:"weight",value:e.weight??null}),e.italic!==n.italic&&t.push({key:"italic",value:e.italic??null}),t}function d(i){const{headingWeight:s,open:t,onOpenChange:n,onChange:e,withoutSize:f=!1}=i,l=m(i);return a(r,{label:u("Emphasis"),children:a(h,{style:l,fonts:p,settings:f?c.filter(o=>o!=="size"):c,auto:["size"],fallback:()=>({weight:s??g}),open:t,onOpenChange:n,onChange:o=>y(l,o).forEach(e)})})}export{y as accentChanges,m as accentTextStyle,d as default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type TextStyleColour, type TextStyleFont } from "efficient-easel/text-styles";
|
|
1
|
+
import { type TextStyleColour, type TextStyleColourNameOf, type TextStyleFont } from "efficient-easel/text-styles";
|
|
2
2
|
import { type OldSiteText, type StoredTextStyle } from "../../render/lib/text-styles/site-text-styles.js";
|
|
3
3
|
export declare const SITE_FONTS: TextStyleFont[];
|
|
4
|
-
export default function SiteTextStylesField({ saved, old, colours,
|
|
4
|
+
export default function SiteTextStylesField({ saved, old, colours, colourNameOf, sizeOf, onChange, openId, onOpenChange, readOnly, withoutSize, }: {
|
|
5
5
|
saved: unknown;
|
|
6
6
|
old: OldSiteText;
|
|
7
7
|
colours: readonly TextStyleColour[];
|
|
8
|
-
|
|
8
|
+
colourNameOf: TextStyleColourNameOf;
|
|
9
9
|
sizeOf: (style: StoredTextStyle) => number;
|
|
10
10
|
onChange: (next: {
|
|
11
11
|
saved: StoredTextStyle[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as v}from"react/jsx-runtime";import{useState as y}from"react";import{TextStylesList as
|
|
1
|
+
"use client";import{jsx as v}from"react/jsx-runtime";import{useState as y}from"react";import{TextStylesList as _}from"efficient-easel/text-styles";import{FONT_OPTIONS as I}from"../../format/lib/fonts.js";import{usePreviewDevice as b}from"efficient-easel/draw/client";import{applyListChange as w,resolveTextStyles as x,toPanelStyles as C}from"../../render/lib/text-styles/site-text-styles.js";const k={desktop:"desktop",tablet:"tablet",mobile:"phone"},p=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],L=["size","lineSpacing","letterSpacing","letterCase"],N=500,A=I.map(e=>({value:e.key,label:e.label,family:`var(${e.cssVar})`,italic:e.italicLoaded}));function F({saved:e,old:s,colours:f,colourNameOf:S,sizeOf:a,onChange:d,openId:l,onOpenChange:m,readOnly:u=!1,withoutSize:g=!1}){const T=b(),[h,E]=y(null),r=x(e,s),n=k[T],c=C(r,a,n);return v(_,{styles:c,onChange:t=>d(w({saved:e,old:s,cur:c,next:t,sizeOf:a,panelView:n})),fonts:A,colours:f,colourNameOf:S,settings:g?p.filter(t=>t!=="size"):p,auto:L,openId:l===void 0?h:l,onOpenChange:m??E,readOnly:u,device:n,fallback:t=>{const i=r.find(O=>O.id===(t.kind==="heading"?"heading-1":"body-1")),o={};return i?.values.font&&t.id!==i.id&&(o.font=i.values.font),t.kind==="heading"&&(o.weight=N),o}})}export{A as SITE_FONTS,F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as T,jsxs as C}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 F}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,Tabs as ue,Tooltip as de,tabButtonId as he,tabPanelId as pe}from"efficient-shell/ui";import{ContrastIcon as fe,NoteIcon as ge,SettingsIcon as me,TypeIcon as Se}from"efficient-easel/icons";import{useThemeRowPersist as _e}from"../lib/theme-row-persist.js";import{themeSaveNotice as we}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 E}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as Te}from"../lib/document/page-root-fields.js";import{previewFrame as Ce}from"efficient-easel/screen/lib/document/preview-dom";import{siteTextColours as be,siteTextColoursNotOffered as ye}from"../../format/lib/text-styles/site-text-colours.js";import{useSiteTextStylesWriter as Pe}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as Re,normalizeCornerRadius as Ee,normalizeCornerStyle as Ie,normalizeShadowColor as ke}from"../../format/lib/theme.js";const G="sf-site-styles",Fe="sf-site-styles-tabpanel",Ge=!1,He="Show hints";function Oe({shown:e,onChange:t}){return o("div",{className:"sf-hints",children:o(ce,{type:"button",variant:"ghost","aria-pressed":e,leftIcon:o(ge,{size:13}),onClick:()=>t(!e),children:m(He)})})}const Yt="text",B="basics",N="this-page-group",I=[{id:B,label:"Basics",icon:o(me,{})},{id:"theme",label:"Theme",icon:o(fe,{})},{id:"text",label:"Text",icon:o(Se,{})}];function Be({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 Ne({themeFromDocument:e,persist:t}){const[n,r]=R(null),{theme:l,setFonts:s,setSizes:u,setHeadingTypography:h}=g(),i=Pe({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??We(ve[c.id]??"body")??Ae[c.kind],_=c=>i.write(c),k=be(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 C(T,{children:[o(ae,{saved:p,old:d,colours:k,coloursNotOffered: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",ve={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Ae={heading:32,body:14},Le={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 We(e){if(typeof document>"u")return null;const n=(Ce()?.contentDocument??document).querySelector(Le[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function ze({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?Re[Ie(i.cornerStyle)]:Ee(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 Ye(e){return{site_width:e}}function je({persist:e,showHint:t}){const{siteWidth:n,setSiteWidth:r,sectionBackgroundWidth:l,setSectionBackgroundWidth:s,sectionContentWidth:u,setSectionContentWidth:h}=g();if(F()!=="desktop")return null;const d=typeof n=="number"?n:E.default,p=a=>{r(a),e(Ye(a),a===null)},f=a=>{s(a),e({section_background_width:a},!0)},S=a=>{h(a),e({section_content_width:a},!0)};return C(T,{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 Ue(e){return{block_gap:e}}function Xe(e){return{block_gap_phone:e}}function qe(e){return{site_gutter:e}}function Ke(e){return{site_gutter_phone:e}}function v(e,[t,n],r){t(e),r(n(e),e===null)}function Me({persist:e,showHint:t}){const{siteGutter:n,siteGutterPhone:r,setSiteGutter:l,setSiteGutterPhone:s}=g(),u=te(F(),{gutter:n,phone:r});if(!u)return null;const h=u.key==="site_gutter_phone"?[s,Ke]:[l,qe];return o(ee,{value:u.value,onChange:i=>v(i,h,e),showHint:t,unsetPx:u.unsetPx,bounds:u.bounds})}function $e({persist:e,showHint:t}){const{blockGap:n,blockGapPhone:r,setBlockGap:l,setBlockGapPhone:s}=g(),u=J(F(),{gap:n,phone:r});if(!u)return null;const h=u.key==="block_gap_phone"?[s,Xe]:[l,Ue];return o(V,{value:u.value,onChange:i=>v(i,h,e),showHint:t,followsPx:u.followsPx})}function Ve({persist:e,showHint:t=!0}){return C(T,{children:[o(je,{persist:e,showHint:t}),o(Me,{persist:e,showHint:t}),o($e,{persist:e,showHint:t})]})}function Je(e){return{card_shadow:e}}function Qe(e){return e===null?{shadow_color:null}:{shadow_color:ke(e)}}function Ze(e){return{hover_effect:e}}function De({persist:e,showHint:t=!0}){const{cardShadow:n,setCardShadow:r,shadowColor:l,setShadowColor:s,hoverEffect:u,setHoverEffect:h}=g();return C(T,{children:[o(M,{value:n,onChange:i=>{r(i),e(Je(i),!0)},showHint:t}),o($,{value:l,onChange:i=>{s(i),e(Qe(i),i===null)},showHint:t}),o(Q,{value:u,onChange:i=>{h(i),e(Ze(i),!0)},showHint:t})]})}function et(e){return{photography_grayscale:e}}function tt({persist:e,showHint:t}){const{photographyGrayscale:n,setPhotographyGrayscale:r}=g();return o(Z,{value:n,onChange:s=>{r(s),e(et(s),!0)},showHint:t})}function ot({persist:e,showHint:t=!0}){return o(T,{children:o(tt,{persist:e,showHint:t})})}function nt(e){return{share_button_on_posts:e}}function rt({persist:e,showHint:t=!0}){const{shareButtonOnPosts:n,setShareButtonOnPosts:r}=g();return o(D,{value:n,onChange:s=>{r(s),e(nt(s),!0)},showHint:t})}function it(){const{websiteName:e}=g();return e?.trim()||xe}function jt(){const e=it();return o(de,{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 st({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:r,tab:l,onTabChange:s,initialTab:u,revealPageGroup:h=!1,onPageGroupRevealed:i}){const{persist:d}=_e({themeFromDocument:e,tokenRef:t,siteId:n,onResult:y=>{const P=we(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],[_,k]=R(Ge);return C(T,{children:[o(lt,{activeId:b.id,onSelect:x}),C("div",{id:pe(G,b.id),className:Fe,role:"tabpanel","aria-labelledby":he(G,b.id),children:[a===B&&C(T,{children:[o(ze,{themeFromDocument:e,persist:d,showHint:_}),!e&&o(De,{persist:d,showHint:_}),!e&&o(Ve,{persist:d,showHint:_}),!e&&o(ot,{persist:d,showHint:_}),!e&&o(rt,{persist:d,showHint:_}),o(at,{reveal:h,onRevealed:i}),o(Oe,{shown:_,onChange:k})]}),a==="theme"&&o(Be,{themeFromDocument:e,persist:d}),a==="text"&&o(Ne,{themeFromDocument:e,persist:d})]})]})}function at({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(ct,{})})}function ct(){const{fields:e,values:t,readOnly:n,onChange:r}=z(),l=Object.fromEntries(Te.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 lt({activeId:e,onSelect:t}){return o("div",{className:"es-insp-tabs",children:o(ue,{variant:"underline",block:!0,labelsFit:!0,"aria-label":m("Styles"),idPrefix:G,value:e,onChange:t,items:I.map(n=>{const r=m(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{$e as BlockGapRootField,De as CardLookFields,Oe as HintsToggle,Ve as PageGroupFields,ot as PhotographyGroupFields,Ge as SHOW_HINTS_DEFAULT,B as SITE_STYLES_BASICS_TAB,G as SITE_STYLES_ID_PREFIX,I as SITE_STYLES_TABS,Yt as SITE_STYLES_TEXT_TAB,rt as ShareButtonRootField,Me as SideSpaceRootField,lt as SiteStylesTabStrip,Fe as TABPANEL_CLASS,N as THIS_PAGE_GROUP_ID,jt as WebsiteNameReadonly,Ue as blockGapPatch,Xe as blockGapPhonePatch,Je as cardShadowPatch,st as default,Ze as hoverEffectPatch,et as photographyPatch,Qe as shadowColourPatch,nt as shareButtonPatch,qe as siteGutterPatch,Ke as siteGutterPhonePatch,Ye as siteWidthPatch,it as useWebsiteName};
|
|
1
|
+
"use client";import{jsx as o,Fragment as T,jsxs as C}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 F}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,Tabs as ue,Tooltip as de,tabButtonId as he,tabPanelId as pe}from"efficient-shell/ui";import{ContrastIcon as fe,NoteIcon as ge,SettingsIcon as me,TypeIcon as Se}from"efficient-easel/icons";import{useThemeRowPersist as _e}from"../lib/theme-row-persist.js";import{themeSaveNotice as we}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 E}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as Te}from"../lib/document/page-root-fields.js";import{previewFrame as Ce}from"efficient-easel/screen/lib/document/preview-dom";import{siteTextColourNameOf as be,siteTextColours as ye}from"../../format/lib/text-styles/site-text-colours.js";import{useSiteTextStylesWriter as Pe}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as Re,normalizeCornerRadius as Ee,normalizeCornerStyle as Ie,normalizeShadowColor as ke}from"../../format/lib/theme.js";const G="sf-site-styles",Fe="sf-site-styles-tabpanel",Ge=!1,He="Show hints";function Oe({shown:e,onChange:t}){return o("div",{className:"sf-hints",children:o(ce,{type:"button",variant:"ghost","aria-pressed":e,leftIcon:o(ge,{size:13}),onClick:()=>t(!e),children:m(He)})})}const Yt="text",B="basics",N="this-page-group",I=[{id:B,label:"Basics",icon:o(me,{})},{id:"theme",label:"Theme",icon:o(fe,{})},{id:"text",label:"Text",icon:o(Se,{})}];function Be({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 Ne({themeFromDocument:e,persist:t}){const[n,r]=R(null),{theme:l,setFonts:s,setSizes:u,setHeadingTypography:h}=g(),i=Pe({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??We(ve[c.id]??"body")??Ae[c.kind],_=c=>i.write(c),k=ye(l),y=be(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 C(T,{children:[o(ae,{saved:p,old:d,colours:k,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",ve={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Ae={heading:32,body:14},Le={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 We(e){if(typeof document>"u")return null;const n=(Ce()?.contentDocument??document).querySelector(Le[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function ze({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?Re[Ie(i.cornerStyle)]:Ee(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 Ye(e){return{site_width:e}}function je({persist:e,showHint:t}){const{siteWidth:n,setSiteWidth:r,sectionBackgroundWidth:l,setSectionBackgroundWidth:s,sectionContentWidth:u,setSectionContentWidth:h}=g();if(F()!=="desktop")return null;const d=typeof n=="number"?n:E.default,p=a=>{r(a),e(Ye(a),a===null)},f=a=>{s(a),e({section_background_width:a},!0)},S=a=>{h(a),e({section_content_width:a},!0)};return C(T,{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 Ue(e){return{block_gap:e}}function Xe(e){return{block_gap_phone:e}}function qe(e){return{site_gutter:e}}function Ke(e){return{site_gutter_phone:e}}function v(e,[t,n],r){t(e),r(n(e),e===null)}function Me({persist:e,showHint:t}){const{siteGutter:n,siteGutterPhone:r,setSiteGutter:l,setSiteGutterPhone:s}=g(),u=te(F(),{gutter:n,phone:r});if(!u)return null;const h=u.key==="site_gutter_phone"?[s,Ke]:[l,qe];return o(ee,{value:u.value,onChange:i=>v(i,h,e),showHint:t,unsetPx:u.unsetPx,bounds:u.bounds})}function $e({persist:e,showHint:t}){const{blockGap:n,blockGapPhone:r,setBlockGap:l,setBlockGapPhone:s}=g(),u=J(F(),{gap:n,phone:r});if(!u)return null;const h=u.key==="block_gap_phone"?[s,Xe]:[l,Ue];return o(V,{value:u.value,onChange:i=>v(i,h,e),showHint:t,followsPx:u.followsPx})}function Ve({persist:e,showHint:t=!0}){return C(T,{children:[o(je,{persist:e,showHint:t}),o(Me,{persist:e,showHint:t}),o($e,{persist:e,showHint:t})]})}function Je(e){return{card_shadow:e}}function Qe(e){return e===null?{shadow_color:null}:{shadow_color:ke(e)}}function Ze(e){return{hover_effect:e}}function De({persist:e,showHint:t=!0}){const{cardShadow:n,setCardShadow:r,shadowColor:l,setShadowColor:s,hoverEffect:u,setHoverEffect:h}=g();return C(T,{children:[o(M,{value:n,onChange:i=>{r(i),e(Je(i),!0)},showHint:t}),o($,{value:l,onChange:i=>{s(i),e(Qe(i),i===null)},showHint:t}),o(Q,{value:u,onChange:i=>{h(i),e(Ze(i),!0)},showHint:t})]})}function et(e){return{photography_grayscale:e}}function tt({persist:e,showHint:t}){const{photographyGrayscale:n,setPhotographyGrayscale:r}=g();return o(Z,{value:n,onChange:s=>{r(s),e(et(s),!0)},showHint:t})}function ot({persist:e,showHint:t=!0}){return o(T,{children:o(tt,{persist:e,showHint:t})})}function nt(e){return{share_button_on_posts:e}}function rt({persist:e,showHint:t=!0}){const{shareButtonOnPosts:n,setShareButtonOnPosts:r}=g();return o(D,{value:n,onChange:s=>{r(s),e(nt(s),!0)},showHint:t})}function it(){const{websiteName:e}=g();return e?.trim()||xe}function jt(){const e=it();return o(de,{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 st({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:r,tab:l,onTabChange:s,initialTab:u,revealPageGroup:h=!1,onPageGroupRevealed:i}){const{persist:d}=_e({themeFromDocument:e,tokenRef:t,siteId:n,onResult:y=>{const P=we(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],[_,k]=R(Ge);return C(T,{children:[o(lt,{activeId:b.id,onSelect:x}),C("div",{id:pe(G,b.id),className:Fe,role:"tabpanel","aria-labelledby":he(G,b.id),children:[a===B&&C(T,{children:[o(ze,{themeFromDocument:e,persist:d,showHint:_}),!e&&o(De,{persist:d,showHint:_}),!e&&o(Ve,{persist:d,showHint:_}),!e&&o(ot,{persist:d,showHint:_}),!e&&o(rt,{persist:d,showHint:_}),o(at,{reveal:h,onRevealed:i}),o(Oe,{shown:_,onChange:k})]}),a==="theme"&&o(Be,{themeFromDocument:e,persist:d}),a==="text"&&o(Ne,{themeFromDocument:e,persist:d})]})]})}function at({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(ct,{})})}function ct(){const{fields:e,values:t,readOnly:n,onChange:r}=z(),l=Object.fromEntries(Te.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 lt({activeId:e,onSelect:t}){return o("div",{className:"es-insp-tabs",children:o(ue,{variant:"underline",block:!0,labelsFit:!0,"aria-label":m("Styles"),idPrefix:G,value:e,onChange:t,items:I.map(n=>{const r=m(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{$e as BlockGapRootField,De as CardLookFields,Oe as HintsToggle,Ve as PageGroupFields,ot as PhotographyGroupFields,Ge as SHOW_HINTS_DEFAULT,B as SITE_STYLES_BASICS_TAB,G as SITE_STYLES_ID_PREFIX,I as SITE_STYLES_TABS,Yt as SITE_STYLES_TEXT_TAB,rt as ShareButtonRootField,Me as SideSpaceRootField,lt as SiteStylesTabStrip,Fe as TABPANEL_CLASS,N as THIS_PAGE_GROUP_ID,jt as WebsiteNameReadonly,Ue as blockGapPatch,Xe as blockGapPhonePatch,Je as cardShadowPatch,st as default,Ze as hoverEffectPatch,et as photographyPatch,Qe as shadowColourPatch,nt as shareButtonPatch,qe as siteGutterPatch,Ke as siteGutterPhonePatch,Ye as siteWidthPatch,it as useWebsiteName};
|
|
@@ -3649,18 +3649,80 @@ input.sf-list-marking {
|
|
|
3649
3649
|
background: var(--sf-accent);
|
|
3650
3650
|
}
|
|
3651
3651
|
|
|
3652
|
-
/*
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
.sf-entrance-pic {
|
|
3652
|
+
/* A picture choice's cell (lib/document/box-fields `iconPickerRow`, and every other
|
|
3653
|
+
shell IconPicker whose cells are pictures): the picture, and its word UNDER it
|
|
3654
|
+
(choices keep their words, Lewis 2026-11-02). In the closed button (the panel's
|
|
3655
|
+
control slot) only the WORD shows: a drawing held to a glyph's height does not
|
|
3656
|
+
read, and the word always does. ONE rule for every such cell. */
|
|
3657
|
+
.sf-pick {
|
|
3659
3658
|
display: flex;
|
|
3660
3659
|
flex-direction: column;
|
|
3661
3660
|
align-items: center;
|
|
3662
|
-
gap:
|
|
3661
|
+
gap: 4px;
|
|
3662
|
+
}
|
|
3663
|
+
/* The whole cell opens the tooltip, not only the drawing in its middle: the tooltip's trigger reaches the cell's edge. */
|
|
3664
|
+
.sf-pick-tip {
|
|
3665
|
+
display: inline-flex;
|
|
3666
|
+
}
|
|
3667
|
+
[role="option"]:has(.sf-pick-tip) {
|
|
3668
|
+
position: relative;
|
|
3669
|
+
}
|
|
3670
|
+
[role="option"] .sf-pick-tip::after {
|
|
3671
|
+
content: "";
|
|
3672
|
+
position: absolute;
|
|
3673
|
+
inset: 0;
|
|
3674
|
+
}
|
|
3675
|
+
.sf-pick-pic {
|
|
3676
|
+
display: flex;
|
|
3677
|
+
align-items: center;
|
|
3678
|
+
justify-content: center;
|
|
3679
|
+
line-height: 0;
|
|
3680
|
+
}
|
|
3681
|
+
.sf-pick-cap {
|
|
3682
|
+
font-size: var(--text-2xs);
|
|
3683
|
+
line-height: 1.2;
|
|
3684
|
+
white-space: nowrap;
|
|
3685
|
+
}
|
|
3686
|
+
.sf-pick-cap-closed {
|
|
3687
|
+
display: none;
|
|
3688
|
+
}
|
|
3689
|
+
.es-field-ctl .sf-pick-cap-closed {
|
|
3690
|
+
display: inline;
|
|
3663
3691
|
}
|
|
3692
|
+
.es-field-ctl .sf-pick {
|
|
3693
|
+
gap: 0;
|
|
3694
|
+
}
|
|
3695
|
+
.es-field-ctl .sf-pick-pic {
|
|
3696
|
+
display: none;
|
|
3697
|
+
}
|
|
3698
|
+
.es-field-ctl .sf-pick-cap {
|
|
3699
|
+
font-size: var(--text-xs);
|
|
3700
|
+
}
|
|
3701
|
+
/* The Block widths row: the chooser, and the width bar under Custom. */
|
|
3702
|
+
.sf-share-row {
|
|
3703
|
+
display: flex;
|
|
3704
|
+
flex-direction: column;
|
|
3705
|
+
gap: 0.5rem;
|
|
3706
|
+
flex: 1 1 auto;
|
|
3707
|
+
min-width: 0;
|
|
3708
|
+
}
|
|
3709
|
+
.sf-share-pick {
|
|
3710
|
+
display: flex;
|
|
3711
|
+
}
|
|
3712
|
+
.sf-share-pic {
|
|
3713
|
+
width: 4.5rem;
|
|
3714
|
+
}
|
|
3715
|
+
/* In the cell's own ink, as every picker picture: the chosen cell draws it in the accent. */
|
|
3716
|
+
.sf-share-pic i {
|
|
3717
|
+
background: currentColor;
|
|
3718
|
+
opacity: 0.55;
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3721
|
+
/* The Entrance kinds (lib/animation/entrance-fields): the shell's IconPicker, three
|
|
3722
|
+
across. Each picture is the approved drawing of its kind, and it plays that kind
|
|
3723
|
+
when the mouse rests on its cell, by the page's engine and keyframes
|
|
3724
|
+
(efficient-shell/motion.css). The closed button shows the kind's word only (the
|
|
3725
|
+
`.sf-pick` rule above). */
|
|
3664
3726
|
.sf-entrance-stage {
|
|
3665
3727
|
display: flex;
|
|
3666
3728
|
align-items: center;
|
|
@@ -3673,18 +3735,6 @@ input.sf-list-marking {
|
|
|
3673
3735
|
display: block;
|
|
3674
3736
|
line-height: 0;
|
|
3675
3737
|
}
|
|
3676
|
-
.sf-entrance-cap {
|
|
3677
|
-
font-size: var(--text-2xs);
|
|
3678
|
-
line-height: 1;
|
|
3679
|
-
}
|
|
3680
|
-
.es-field-ctl .sf-entrance-cap {
|
|
3681
|
-
display: none;
|
|
3682
|
-
}
|
|
3683
|
-
.es-field-ctl .sf-entrance-stage {
|
|
3684
|
-
width: auto;
|
|
3685
|
-
height: auto;
|
|
3686
|
-
overflow: visible;
|
|
3687
|
-
}
|
|
3688
3738
|
|
|
3689
3739
|
/* ── Side panel heads (components/SidePanelHead) ─────────────────────────
|
|
3690
3740
|
Every side panel's head is efficient-easel's `InspectorHead`; these two
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{phoneKey as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{phoneKey as l}from"efficient-easel/draw";import{SettingsDefaultReset as O,SettingsField as R}from"efficient-easel/panel";import{AnimationIcon as N,ClockIcon as w,DirectionDownIcon as A,DirectionIcon as T,DirectionLeftIcon as L,DirectionRightIcon as S,DirectionUpIcon as P,DurationIcon as B,NoSymbolIcon as G}from"efficient-easel/icons";import{deviceField as d}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as U,noControlField as W}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{describedAs as k,group as j,onDesktopWords as Y,phoneTwinFields as z}from"efficient-easel/screen/lib/document/box-fields";import{ENTRANCE_FROM as H,ENTRANCE_FROM_DEFAULT as I,ENTRANCE_KINDS as m,ENTRANCE_KINDS_WITH_FROM as g,MOTION_TIMING as q,entranceAttrs as V,playEntrance as J,readEntrance as Q}from"efficient-shell/format";import{IconPicker as X}from"efficient-shell/ui";import{pickerCellIcon as Z}from"../document/box-fields.js";import{segmented as $}from"../document/box-fields.js";import{phoneOverrideField as _,useSelectedProps as D}from"../document/controls.js";import{withRowRules as ee}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as oe,say as c}from"../../../format/lib/editor-words.js";import{animationDelayField as ne,animationDurationField as te}from"./AnimationDurationRow.js";import{ENTRANCE_KEYS as t,LEGACY_ENTRANCE_KEY as C,entranceOf as b}from"../../../render/lib/animation/entrance.js";import{ENTRANCE_GROUP_KEY as ie}from"../../../format/lib/animation/index.js";const h={none:"None",fade:"Fade",rise:"Rise",scale:"Scale",glide:"Glide",bounce:"Bounce",flip:"Flip",reveal:"Reveal",spin:"Spin"},re={top:"Top",bottom:"Bottom",left:"Left",right:"Right"},ae={top:()=>e(A,{}),bottom:()=>e(P,{}),left:()=>e(S,{}),right:()=>e(L,{})},f="Entrance",x=m.filter(o=>o!=="none"),u=o=>({any:[{field:t.kind,in:o},{all:[{field:t.kind,set:!1},{field:C,in:o}]}]}),v=o=>({any:[{field:l(t.kind),in:o},{all:[{field:l(t.kind),set:!1},u(o)]}]}),le=[[[t.from],u(g)],[[l(t.from)],v(g)],[[t.duration,t.delay],u(x)],[[l(t.duration),l(t.delay)],v(x)]],s=({children:o})=>e("svg",{viewBox:"0 0 40 40",width:"40",height:"40",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o}),r=({x:o=12,y:n=12,o:i=1})=>e("rect",{x:o,y:n,width:"16",height:"16",rx:"2",opacity:i}),ce={none:e(G,{size:20}),fade:a(s,{children:[e(r,{x:6,o:.3}),e(r,{x:18})]}),rise:a(s,{children:[e(r,{y:20,o:.3}),e(r,{y:8}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),scale:a(s,{children:[e("rect",{x:"16",y:"16",width:"8",height:"8",rx:"1",opacity:".35"}),e(r,{}),e("path",{d:"M6 6l4 4M34 34l-4-4"})]}),glide:a(s,{children:[e(r,{x:2,o:.3}),e(r,{x:20}),e("path",{d:"M4 33h12m-2-2 2 2-2 2"})]}),bounce:a(s,{children:[e(r,{y:6}),e("path",{d:"M8 34c3-6 5-6 8 0s5 6 8 0 5-6 8 0"})]}),flip:a(s,{children:[e("path",{d:"M12 12l16 4v8l-16 4z",opacity:".35"}),e(r,{}),e("path",{d:"M20 4v32",strokeDasharray:"2 2"})]}),reveal:a(s,{children:[e("rect",{x:"12",y:"12",width:"16",height:"16",rx:"2",strokeDasharray:"2 2",opacity:".5"}),e("path",{d:"M12 22h16v4a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z",fill:"currentColor",opacity:".35"}),e("path",{d:"M20 36v-5m-2 2 2-2 2 2"})]}),spin:a(s,{children:[e(r,{}),e("path",{d:"M33 14a14 14 0 0 1 0 12m0 0-3-1m3 1 1-3"})]})};function se({kind:o}){const{attrs:n}=V(Q(o,I)),i=c(h[o]);return Z(e("span",{className:"sf-entrance-stage",children:e("i",{...n,children:ce[o]})}),i,i)}const de=(o,n)=>{const i=n.querySelector(".sf-entrance-stage > i");i&&J(i)},pe={width:"3.5rem",height:"4.25rem"};function F({value:o,onChange:n}){return e(X,{label:c(f),value:o,columns:3,cell:pe,onChange:n,onPreview:de,tooltips:!1,options:m.map(i=>({value:i,label:c(h[i]),icon:e(se,{kind:i})}))})}const y="Effect";function me({value:o,onChange:n}){const i=D(),p=b({...i,[t.kind]:o},"desktop").kind;return e(R,{label:c(y),icon:e(N,{}),children:e(F,{value:p,onChange:n})})}function he({value:o,onChange:n}){const i=D(),p=typeof o=="string"&&m.includes(o),E=b(i,"desktop").kind;return e(R,{label:c(y),icon:e(N,{}),changed:p,action:e(O,{words:oe()?.panel,label:c(y),changed:p,detail:Y(K=>c(K),c(h[E])),onReset:()=>n(void 0)}),children:e(F,{value:p?o:E,onChange:n})})}const M={type:"select",label:f,options:m.map(o=>({value:o,label:h[o]}))},fe=()=>k({type:"custom",render:({value:o,onChange:n})=>e(me,{value:o,onChange:n})},M),ue=()=>k({type:"custom",render:({value:o,onChange:n})=>e(he,{value:o,onChange:n})},M),ye=H.map(o=>({label:re[o],value:o,picture:ae[o]()}));function Ae(){const{duration:o,delay:n}=q.entrance,i={[ie]:j(f),[t.kind]:d("desktop",fe()),[C]:W({type:"custom",render:()=>e(U,{})},"always"),[l(t.kind)]:d("mobile",ue()),...z(t.from,$("From",e(T,{}),ye,I)),[t.duration]:d("desktop",te("entrance")),[l(t.duration)]:d("mobile",_({label:"Duration",desktopKey:t.duration,icon:e(B,{}),min:o.min,max:o.max,step:o.step,fallback:o.default,unit:"s"})),[t.delay]:d("desktop",ne("entrance")),[l(t.delay)]:d("mobile",_({label:"Delay",desktopKey:t.delay,icon:e(w,{}),min:n.min,max:n.max,step:n.step,fallback:n.default,unit:"s"}))};return ee(i,le)}export{ce as ENTRANCE_PICTURE,Ae as entranceFields};
|