efficient-web-builder 51.0.0 → 52.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 +33 -0
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewPartStyleContext.d.ts +2 -2
- package/dist/editor/components/SiteTextStylesField.d.ts +2 -1
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +12 -44
- package/dist/editor/lib/document/ColourControl.d.ts +11 -8
- package/dist/editor/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Series/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/StatsParagraph/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/controls.d.ts +14 -4
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/format/lib/content/borders.d.ts +4 -2
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/button-icon.d.ts +1 -1
- package/dist/format/lib/content/button-icon.js +1 -1
- package/dist/format/lib/content/card-state.d.ts +8 -0
- package/dist/format/lib/content/card-state.js +1 -0
- package/dist/format/lib/content/section-background.d.ts +10 -3
- package/dist/format/lib/content/section-background.js +1 -1
- package/dist/format/lib/content/section-min-height.d.ts +17 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +9 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/document/card-template-layers.d.ts +1 -1
- package/dist/format/lib/document/card-template-layers.js +1 -1
- package/dist/format/lib/document/part-inks.d.ts +5 -10
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +1 -0
- package/dist/format/lib/document/show-when-attach.d.ts +2 -1
- package/dist/format/lib/document/show-when-attach.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +0 -3
- package/dist/format/lib/editor-words-catalogue.js +2 -2
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.d.ts +4 -0
- package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.js +37 -20
- package/dist/format/lib/source-rules/support/part-slider-call-sites.d.ts +0 -1
- package/dist/format/lib/source-rules/support/part-slider-call-sites.js +6 -6
- package/dist/format/lib/text-styles/site-text-colours.d.ts +11 -0
- package/dist/format/lib/text-styles/site-text-colours.js +1 -0
- package/dist/format/lib/theme.d.ts +1 -0
- package/dist/format/lib/theme.js +3 -3
- package/dist/format/lib/word-styles.d.ts +0 -1
- package/dist/format/lib/word-styles.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +1 -0
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +5 -2
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/Flex.d.ts +2 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/goldPhrases.js +2 -2
- package/dist/render/lib/content/block-size.d.ts +1 -0
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-shared-columns.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- 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/borders.js +1 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/document/passes/section-sticky.js +1 -1
- package/dist/render/lib/document/show-when.d.ts +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 +1 -1
- package/dist/editor/components/PartInkControl.d.ts +0 -7
- package/dist/editor/components/PartInkControl.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 52.0.0 - 2026-11-05
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
**BREAKING for hosts:**
|
|
8
|
+
|
|
9
|
+
- **Part colour types** (#497): in `format/lib/document/part-inks`, `partThemeColors(read)` and `readInks` use `Partial<Record<ColorSlot, string>>`. `PartStyleReading.inks` in `editor/components/PreviewPartStyleContext` has the same type. `WORD_STYLE_COLOUR_LABELS` is deleted.
|
|
10
|
+
- **The card highlight attribute** (#497): `data-sf-card-highlighted` leaves the drawn page, and `data-sf-card-state` replaces it.
|
|
11
|
+
- **Removed** (#510): `editor/components/PartInkControl`, `AnyColourSwatch`, and `PartInk`, `partInks` and `toHex` from `format/lib/document/part-inks`. The words `Any color`, `Follows the style` and `Mixed` leave `WEB_BUILDER_WORDS` and `WebBuilderPhrase`, so a host that generates its editor words must generate them again.
|
|
12
|
+
- **Removed** (#512): `SECTION_BG_SWATCHES`, `SECTION_BG_SWATCH_NAMES` and `isSectionBackgroundInheriting` from `format/lib/content/section-background`.
|
|
13
|
+
- **Removed** (#515): `readFieldLabels` and `SliderCallSite.labelFor` from `lib/source-rules/support/part-slider-call-sites`.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **One card row state** (#497): `CardRow.state`, `CardTemplateRows` `states`, and the module `format/lib/content/card-state`. A copy in a state draws one line in the theme's main colour. Cards highlights through it. A plain copy keeps its markup.
|
|
18
|
+
- **Height, Stick to top, the block Width group, Border and Button width take a Tablet value** (#501), drawn from 720 to 1100. A node with no tablet value draws the same bytes as before.
|
|
19
|
+
- `sectionBackgroundHex`, `isSectionBackgroundEmpty`, `sectionBackgroundChoice`, `SECTION_BG_NO_FILL` and the type `SectionBandColours` (#512); `surfaceTwoTone` in `lib/theme`; `partInkCss` (#497); `partColourName` (#515); `lib/text-styles/site-text-colours` (#516).
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Part colours use the shell's colour slots** (#497): Main, Text, Background, Muted. The old names `accent` and `labels` read as `main` and `muted`, and paint the same token.
|
|
24
|
+
- **The band Background color row is the shared colour row** (#512) on Series, Stats, StatsParagraph, Timeline and TimelineTrack. Its window offers No fill, the section band and the theme colours, then a hex. The page paint does not change.
|
|
25
|
+
- **The text toolbars light a colour saved under an old name** (#515).
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- **A text style paints `main`, `muted` and `background`** (#516). The Site styles Color row offers Main, Text and Muted.
|
|
30
|
+
- **Layers keeps a data block's other slots** (#519). On easel 27.4.0, `cardTemplateSlotsOf` maps the slots the screen says are shown.
|
|
31
|
+
|
|
32
|
+
### Internal
|
|
33
|
+
|
|
34
|
+
- CI runs the org-name guard here (#514).
|
|
35
|
+
|
|
3
36
|
## 51.0.0 - 2026-11-05
|
|
4
37
|
|
|
5
38
|
From main at `6e5a8b06`: #473, #492, #494, #495, #496, #498, #499, #500, #502, #503, #504, #505, #506, #507, #508, #509. A major because of #503: the `efficient-easel` peer rises from `^27.0.0` to `^27.3.0`. No declared export is removed or changed (only added), and `efficient-shell` stays at `^11.8.0`. No stored key moves, so no stored page needs a data move.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as c,jsxs as x}from"react/jsx-runtime";import{COPY_CELLS as t,CopyBox as S}from"efficient-easel/copy";import{
|
|
1
|
+
"use client";import{jsx as c,jsxs as x}from"react/jsx-runtime";import{COPY_CELLS as t,CopyBox as S}from"efficient-easel/copy";import{partColourName as z}from"../../format/lib/document/part-inks.js";import{PaddingYIcon as C}from"efficient-easel/icons";import{say as _}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 R,partSpacingOf as k}from"../../render/lib/document/part-styles.js";const D=["left","center","right","justify"];function H(n,i,a,r="desktop"){const l=k(n),o=r==="mobile",p=(o?n.sizePhone:void 0)??n.size??i.sizePx;return[o?{...t.fontSize,key:"fontSize",value:n.sizePhone,styleValue:Math.round(i.sizePx),onChange:e=>a({sizePhone:e??null})}:{...t.fontSize,key:"fontSize",value:n.size,styleValue:Math.round(i.sizePx),onChange:e=>a({size:e??null})},{...t.lineHeight,key:"lineHeight",value:l.lineHeight,styleValue:i.lineRatio,onChange:e=>a(e===void 0?{lineHeight:null,line:null}:{lineHeight:e})},{...t.letterSpacing,key:"letterSpacing",scale:p,value:l.letterSpacingEm,styleValue:i.letterEm,onChange:e=>a(e===void 0?{letterSpacing:null,letter:null}:{letterSpacing:e})},{...t.paragraphSpacing,key:"paragraphSpacing",value:n.paragraphSpacing,styleValue:0,onChange:e=>a({paragraphSpacing:e??null})},{key:"padding",name:_("Padding"),icon:c(C,{}),unit:"px",step:R,shiftStep:10,min:N,max:v,value:n.padding,styleValue:i.paddingPx,onChange:e=>a({padding:e??null})}]}function w({text:n,onTextChange:i,multiline:a,markup:r=!0,styled:l=!0,style:o,base:p,setValue:e,colors:u,placeholder:s,ariaLabel:h,head:d,typedOnCanvas:f=!1}){const m=H(o,p,e),P=T(r,a);return x("div",{className:"sf-part-textbox",children:[d,c(S,{value:n,onChange:i,multiline:a,placeholder:s,ariaLabel:h,rules:A,tools:P,barShows:f?"focus":"always",colors:r?u:[],colorNameOf:z,align:l?{value:o.align??p.align,allow:D,onChange:g=>e({align:g})}:void 0,letterCase:l?{value:o.case==="capitalize"?"":o.case??"",onChange:g=>e({case:g||null})}:void 0,cells:l?m:void 0})]})}export{w as PartTextBox,H as partTextCells};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ColorSlot } from "efficient-shell/markup";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import type { FontRole } from "../../format/lib/fonts.js";
|
|
4
4
|
import type { PartStyleBase } from "../../render/lib/document/part-styles.js";
|
|
@@ -8,7 +8,7 @@ export type PartStyleReading = {
|
|
|
8
8
|
faceRole: FontRole;
|
|
9
9
|
sizeGroup: TypeGroup | null;
|
|
10
10
|
base: PartStyleBase;
|
|
11
|
-
inks?: Partial<Record<
|
|
11
|
+
inks?: Partial<Record<ColorSlot, string>>;
|
|
12
12
|
styleOwner?: {
|
|
13
13
|
owner: string;
|
|
14
14
|
kind: string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type TextStyleColour, 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, sizeOf, onChange, openId, onOpenChange, readOnly, withoutSize, }: {
|
|
4
|
+
export default function SiteTextStylesField({ saved, old, colours, coloursNotOffered, sizeOf, onChange, openId, onOpenChange, readOnly, withoutSize, }: {
|
|
5
5
|
saved: unknown;
|
|
6
6
|
old: OldSiteText;
|
|
7
7
|
colours: readonly TextStyleColour[];
|
|
8
|
+
coloursNotOffered?: readonly TextStyleColour[];
|
|
8
9
|
sizeOf: (style: StoredTextStyle) => number;
|
|
9
10
|
onChange: (next: {
|
|
10
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 C}from"efficient-easel/text-styles";import{keepColoursNotOffered as _,showColoursNotOffered as w}from"../../format/lib/text-styles/site-text-colours.js";import{FONT_OPTIONS as x}from"../../format/lib/fonts.js";import{usePreviewDevice as I}from"efficient-easel/draw/client";import{applyListChange as b,resolveTextStyles as k,toPanelStyles as L}from"../../render/lib/text-styles/site-text-styles.js";const N={desktop:"desktop",tablet:"tablet",mobile:"phone"},f=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],A=["size","lineSpacing","letterSpacing","letterCase"],F=500,z=x.map(e=>({value:e.key,label:e.label,family:`var(${e.cssVar})`,italic:e.italicLoaded}));function D({saved:e,old:l,colours:d,coloursNotOffered:r=[],sizeOf:p,onChange:S,openId:c,onOpenChange:m,readOnly:u=!1,withoutSize:g=!1}){const T=I(),[h,E]=y(null),n=k(e,l),i=N[T],o=w(L(n,p,i),r);return v(C,{styles:o,onChange:t=>S(b({saved:e,old:l,cur:o,next:_(t,o,n,r),sizeOf:p,panelView:i})),fonts:z,colours:d,settings:g?f.filter(t=>t!=="size"):f,auto:A,openId:c===void 0?h:c,onOpenChange:m??E,readOnly:u,device:i,fallback:t=>{const s=n.find(O=>O.id===(t.kind==="heading"?"heading-1":"body-1")),a={};return s?.values.font&&t.id!==s.id&&(a.font=s.values.font),t.kind==="heading"&&(a.weight=F),a}})}export{z as SITE_FONTS,D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as T,jsxs as C}from"react/jsx-runtime";import{useEasel as H,useRootFields as W}from"efficient-easel/easel";import{Inspector as z}from"efficient-easel/fields";import{SettingsGroup as Y}from"efficient-easel/panel";import{useEffect as j,useRef as U,useState as R}from"react";import X from"./ThemeField.js";import q from"./CornersField.js";import K from"./CardShadowField.js";import M from"./ShadowColourField.js";import $,{blockGapRow as V}from"./BlockGapField.js";import J from"./HoverEffectField.js";import Q from"./PhotographyField.js";import Z from"./ShareButtonField.js";import{usePreviewDevice as v}from"efficient-easel/draw/client";import D,{sideSpaceRow as ee}from"./SideSpaceField.js";import{BackgroundWidthRow as te,ContentWidthRow as oe,SITE_BACKGROUND_HINT as ne,SITE_CONTENT_HINT as re}from"./SectionWidthRows.js";import ie from"./SiteAccentField.js";import se from"./SiteTextStylesField.js";import{usePreviewHeader as m}from"../../render/components/PreviewHeaderContext.js";import{Button as ae,EmptyState as ce,Tabs as le,Tooltip as ue,tabButtonId as de,tabPanelId as he}from"efficient-shell/ui";import{ContrastIcon as pe,NoteIcon as fe,SettingsIcon as ge,TypeIcon as me}from"efficient-easel/icons";import{useThemeRowPersist as Se}from"../lib/theme-row-persist.js";import{themeSaveNotice as _e}from"../../format/lib/theme-save-message.js";import{say as p}from"../../format/lib/editor-words.js";import{NEUTRAL_SITE_NAME as we}from"../../format/lib/content/site-name.js";import{PAGE_WIDTH as E}from"../../format/lib/content/page-width.js";import{PAGE_STYLE_FIELDS as xe}from"../lib/document/page-root-fields.js";import{previewFrame as Te}from"efficient-easel/screen/lib/document/preview-dom";import{useSiteTextStylesWriter as Ce}from"../lib/site-text-styles-writer.js";import{CORNER_STYLE_TO_PX as be,normalizeCornerRadius as ye,normalizeCornerStyle as Pe,normalizeShadowColor as Re,selectedThemeColors as Ee}from"../../format/lib/theme.js";const F="sf-site-styles",ke="sf-site-styles-tabpanel",Ie=!1,ve="Show hints";function Fe({shown:e,onChange:t}){return o("div",{className:"sf-hints",children:o(ae,{type:"button",variant:"ghost","aria-pressed":e,leftIcon:o(fe,{size:13}),onClick:()=>t(!e),children:p(ve)})})}const Wt="text",A="basics",B="this-page-group",k=[{id:A,label:"Basics",icon:o(ge,{})},{id:"theme",label:"Theme",icon:o(pe,{})},{id:"text",label:"Text",icon:o(me,{})}];function Ge({themeFromDocument:e,persist:t}){const{appState:n,dispatch:r}=H(d=>d),{theme:l,setTheme:s}=m(),u=n.data,h=u.root?.props??{},i=d=>{if(e){const f={...h,theme:d};r({type:"replaceRoot",root:{...u.root,props:f},recordHistory:!0})}else s(d);t({selected_preset:d.selected,theme_presets:d.themes})};return o(X,{value:e?h.theme:l,onChange:i})}function He({themeFromDocument:e,persist:t}){const[n,r]=R(null),{theme:l,setFonts:s,setSizes:u,setHeadingTypography:h}=m(),i=Ce({themeFromDocument:e,persist:t}),{old:d,saved:f,writeRoot:g}=i,S=i.fonts,a=i.sizes,x=i.typography,b=c=>c.values.size??Le(Be[c.id]??"body")??Oe[c.kind],_=c=>i.write(c),I=Ae(l),y=c=>{const w={...S,accent:c};e?g({fonts:w}):s(w),t({accent_font:c})},P=c=>{u({...a,accent:c}),t({accent_size_px:c})},N=c=>{const w={...x,weightStrong:c};e?g({headingTypography:w}):h(w),t({heading_weight_strong:c})},L=c=>{const w={...x,italicStrong:c};e?g({headingTypography:w}):h(w),t({accent_italic:c})};return C(T,{children:[o(se,{saved:f,old:d,colours:I,sizeOf:b,onChange:_,openId:n===G?null:n,onOpenChange:r,withoutSize:e}),o(ie,{font:S.accent,size:a.accent,weight:x.weightStrong,italic:x.italicStrong,headingWeight:x.weight,open:n===G,onOpenChange:c=>r(c?G:null),onChange:c=>{c.key==="font"?y(c.value):c.key==="size"?P(c.value):c.key==="weight"?N(c.value):L(c.value)},withoutSize:e})]})}const G="accent";function Ae(e){const t=Ee(e);return[{key:"accent",name:p("Accent"),value:t.accent},{key:"text",name:p("Text"),value:t.text},{key:"labels",name:p("Labels"),value:t.muted??t.text}]}const Be={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},Oe={heading:32,body:14},Ne={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 Le(e){if(typeof document>"u")return null;const n=(Te()?.contentDocument??document).querySelector(Ne[e]);if(!n)return null;const r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)?r:null}function We({themeFromDocument:e,persist:t,showHint:n}){const{appState:r,dispatch:l}=H(a=>a),{cornerRadiusPx:s,setCornerRadiusPx:u}=m(),h=r.data,i=h.root?.props??{},d=i.cornerRadiusPx===void 0?be[Pe(i.cornerStyle)]:ye(i.cornerRadiusPx),f=e?d:s,g=a=>l({type:"replaceRoot",root:{...h.root,props:{...i,...a}},recordHistory:!0});return o(q,{value:f,onChange:a=>{e?g({cornerRadiusPx:a}):u(a),t({corner_radius_px:a})},showHint:n})}function ze(e){return{site_width:e}}function Ye({persist:e,showHint:t}){const{siteWidth:n,setSiteWidth:r,sectionBackgroundWidth:l,setSectionBackgroundWidth:s,sectionContentWidth:u,setSectionContentWidth:h}=m();if(v()!=="desktop")return null;const d=typeof n=="number"?n:E.default,f=a=>{r(a),e(ze(a),a===null)},g=a=>{s(a),e({section_background_width:a},!0)},S=a=>{h(a),e({section_content_width:a},!0)};return C(T,{children:[o(te,{value:l??"full",changed:l!==null,detail:p("Full width"),onChange:g,onReset:()=>g(null),hint:t?ne:void 0}),o(oe,{mode:u??"content",px:d,min:E.min,max:E.max,changed:typeof n=="number"||u!==null,detail:`${p("Content width")} ${E.default}px`,onMode:S,onPx:a=>f(a),onReset:()=>{S(null),f(null)},hint:t?re:void 0})]})}function je(e){return{block_gap:e}}function Ue(e){return{block_gap_phone:e}}function Xe(e){return{site_gutter:e}}function qe(e){return{site_gutter_phone:e}}function O(e,[t,n],r){t(e),r(n(e),e===null)}function Ke({persist:e,showHint:t}){const{siteGutter:n,siteGutterPhone:r,setSiteGutter:l,setSiteGutterPhone:s}=m(),u=ee(v(),{gutter:n,phone:r});if(!u)return null;const h=u.key==="site_gutter_phone"?[s,qe]:[l,Xe];return o(D,{value:u.value,onChange:i=>O(i,h,e),showHint:t,unsetPx:u.unsetPx,bounds:u.bounds})}function Me({persist:e,showHint:t}){const{blockGap:n,blockGapPhone:r,setBlockGap:l,setBlockGapPhone:s}=m(),u=V(v(),{gap:n,phone:r});if(!u)return null;const h=u.key==="block_gap_phone"?[s,Ue]:[l,je];return o($,{value:u.value,onChange:i=>O(i,h,e),showHint:t,followsPx:u.followsPx})}function $e({persist:e,showHint:t=!0}){return C(T,{children:[o(Ye,{persist:e,showHint:t}),o(Ke,{persist:e,showHint:t}),o(Me,{persist:e,showHint:t})]})}function Ve(e){return{card_shadow:e}}function Je(e){return e===null?{shadow_color:null}:{shadow_color:Re(e)}}function Qe(e){return{hover_effect:e}}function Ze({persist:e,showHint:t=!0}){const{cardShadow:n,setCardShadow:r,shadowColor:l,setShadowColor:s,hoverEffect:u,setHoverEffect:h}=m();return C(T,{children:[o(K,{value:n,onChange:i=>{r(i),e(Ve(i),!0)},showHint:t}),o(M,{value:l,onChange:i=>{s(i),e(Je(i),i===null)},showHint:t}),o(J,{value:u,onChange:i=>{h(i),e(Qe(i),!0)},showHint:t})]})}function De(e){return{photography_grayscale:e}}function et({persist:e,showHint:t}){const{photographyGrayscale:n,setPhotographyGrayscale:r}=m();return o(Q,{value:n,onChange:s=>{r(s),e(De(s),!0)},showHint:t})}function tt({persist:e,showHint:t=!0}){return o(T,{children:o(et,{persist:e,showHint:t})})}function ot(e){return{share_button_on_posts:e}}function nt({persist:e,showHint:t=!0}){const{shareButtonOnPosts:n,setShareButtonOnPosts:r}=m();return o(Z,{value:n,onChange:s=>{r(s),e(ot(s),!0)},showHint:t})}function rt(){const{websiteName:e}=m();return e?.trim()||we}function zt(){const e=rt();return o(ue,{content:p("{name} — renamed in the Console: {place}.",{name:e,place:p("Storefront ▸ Sites ▸ Settings")}),className:"sf-name-tip",children:o("span",{className:"sf-panel-site",children:e})})}function it({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:r,tab:l,onTabChange:s,initialTab:u,revealPageGroup:h=!1,onPageGroupRevealed:i}){const{persist:d}=Se({themeFromDocument:e,tokenRef:t,siteId:n,onResult:y=>{const P=_e(y);P&&r?.(P.msg,P.tone)}}),[f,g]=R(u??k[0].id),S=l!==void 0,a=S?l:f,x=S?s??(()=>{}):g,b=k.find(y=>y.id===a)??k[0],[_,I]=R(Ie);return C(T,{children:[o(ct,{activeId:b.id,onSelect:x}),C("div",{id:he(F,b.id),className:ke,role:"tabpanel","aria-labelledby":de(F,b.id),children:[a===A&&C(T,{children:[o(We,{themeFromDocument:e,persist:d,showHint:_}),!e&&o(Ze,{persist:d,showHint:_}),!e&&o($e,{persist:d,showHint:_}),!e&&o(tt,{persist:d,showHint:_}),!e&&o(nt,{persist:d,showHint:_}),o(st,{reveal:h,onRevealed:i}),o(Fe,{shown:_,onChange:I})]}),a==="theme"&&o(Ge,{themeFromDocument:e,persist:d}),a==="text"&&o(He,{themeFromDocument:e,persist:d})]})]})}function st({reveal:e,onRevealed:t}){const[n,r]=R(!0),l=U(t);return l.current=t,j(()=>{if(!e)return;r(!0);const s=requestAnimationFrame(()=>{document.getElementById(B)?.scrollIntoView({block:"start"}),l.current?.()});return()=>cancelAnimationFrame(s)},[e]),o(Y,{title:p("This page"),open:n,onToggle:r,id:B,children:o(at,{})})}function at(){const{fields:e,values:t,readOnly:n,onChange:r}=W(),l=Object.fromEntries(xe.filter(s=>s in e).map(s=>[s,e[s]]));return Object.keys(l).length===0?o(ce,{variant:"none",icon:!1,message:p("This page has no look of its own to set.")}):o(z,{fields:l,values:t,onChange:r,readOnly:n,tabs:!1,idPrefix:"this-page",ariaLabel:p("This page")})}function ct({activeId:e,onSelect:t}){return o("div",{className:"es-insp-tabs",children:o(le,{variant:"underline",block:!0,labelsFit:!0,"aria-label":p("Styles"),idPrefix:F,value:e,onChange:t,items:k.map(n=>{const r=p(n.label);return{id:n.id,icon:n.icon,label:r}})})})}export{Me as BlockGapRootField,Ze as CardLookFields,Fe as HintsToggle,$e as PageGroupFields,tt as PhotographyGroupFields,Ie as SHOW_HINTS_DEFAULT,A as SITE_STYLES_BASICS_TAB,F as SITE_STYLES_ID_PREFIX,k as SITE_STYLES_TABS,Wt as SITE_STYLES_TEXT_TAB,nt as ShareButtonRootField,Ke as SideSpaceRootField,ct as SiteStylesTabStrip,ke as TABPANEL_CLASS,B as THIS_PAGE_GROUP_ID,zt as WebsiteNameReadonly,je as blockGapPatch,Ue as blockGapPhonePatch,Ve as cardShadowPatch,it as default,Qe as hoverEffectPatch,De as photographyPatch,Je as shadowColourPatch,ot as shareButtonPatch,Xe as siteGutterPatch,qe as siteGutterPhonePatch,ze as siteWidthPatch,rt 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{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};
|
|
@@ -2048,6 +2048,18 @@
|
|
|
2048
2048
|
gap: var(--space-8);
|
|
2049
2049
|
min-width: 0;
|
|
2050
2050
|
}
|
|
2051
|
+
/* The colour window with choices above the shell's panel: the same 12px the
|
|
2052
|
+
panel keeps between its own parts, and the 8px of its own swatch row. */
|
|
2053
|
+
.sf-colour-window {
|
|
2054
|
+
display: flex;
|
|
2055
|
+
flex-direction: column;
|
|
2056
|
+
gap: var(--space-12);
|
|
2057
|
+
}
|
|
2058
|
+
.sf-colour-choices {
|
|
2059
|
+
display: flex;
|
|
2060
|
+
flex-wrap: wrap;
|
|
2061
|
+
gap: var(--space-8);
|
|
2062
|
+
}
|
|
2051
2063
|
/* The hex box's width is the SHELL's: `HexInput` is never narrower than its
|
|
2052
2064
|
seven characters and its padding. This sheet held it at 4.75rem, which cut
|
|
2053
2065
|
"#0A0A0A" to "#0A0A0" in the Hero's Texture color row (Lewis, 2026-10-14). */
|
|
@@ -3488,50 +3500,6 @@ input.sf-list-marking {
|
|
|
3488
3500
|
min-width: 0;
|
|
3489
3501
|
}
|
|
3490
3502
|
|
|
3491
|
-
/* The `Color` row's control row: the dropdown, and — only once `Custom…` is
|
|
3492
|
-
chosen — the swatch and hex under it.
|
|
3493
|
-
|
|
3494
|
-
⚠️ A COLUMN, NOT A ROW, AND 220px IS WHY. `MIN_PANEL_W` is 220, which leaves
|
|
3495
|
-
a 181px content box; the dropdown alone wants that, and the swatch (26) plus
|
|
3496
|
-
the hex box (57) plus two 8px gaps is another 99. Side by side they do not
|
|
3497
|
-
fit, and the first thing to collapse would be the dropdown showing which
|
|
3498
|
-
colour is selected. Stacked, each keeps its full width at every panel size —
|
|
3499
|
-
and the shell's `SettingsField` already gives a row a control area under its
|
|
3500
|
-
label, so this costs no new shape.
|
|
3501
|
-
|
|
3502
|
-
The swatch pair is right-aligned to sit under the dropdown's own right edge,
|
|
3503
|
-
where `SettingsField`'s `action` slot puts every other trailing control. */
|
|
3504
|
-
.sf-part-ink {
|
|
3505
|
-
display: flex;
|
|
3506
|
-
flex-direction: column;
|
|
3507
|
-
gap: 8px;
|
|
3508
|
-
min-width: 0;
|
|
3509
|
-
}
|
|
3510
|
-
/* The part panel's Color row: its name and what it holds on one line, the
|
|
3511
|
-
theme's swatches and Any color under it — the shell's swatches and picker. */
|
|
3512
|
-
.sf-part-ink-top {
|
|
3513
|
-
display: flex;
|
|
3514
|
-
align-items: baseline;
|
|
3515
|
-
gap: 8px;
|
|
3516
|
-
}
|
|
3517
|
-
.sf-part-ink-label {
|
|
3518
|
-
font-size: var(--text-2xs);
|
|
3519
|
-
font-weight: 600;
|
|
3520
|
-
color: var(--sf-muted);
|
|
3521
|
-
}
|
|
3522
|
-
.sf-part-ink-read {
|
|
3523
|
-
margin-left: auto;
|
|
3524
|
-
font-size: var(--text-xs);
|
|
3525
|
-
color: var(--sf-text-secondary);
|
|
3526
|
-
font-variant-numeric: tabular-nums;
|
|
3527
|
-
}
|
|
3528
|
-
.sf-part-ink-swatches {
|
|
3529
|
-
display: flex;
|
|
3530
|
-
flex-wrap: wrap;
|
|
3531
|
-
align-items: center;
|
|
3532
|
-
gap: var(--space-8);
|
|
3533
|
-
}
|
|
3534
|
-
|
|
3535
3503
|
/* The copy box at the TOP of the drill (card 8819). Clicking a word drills
|
|
3536
3504
|
straight to its editor, so the box is the first thing on the part screen —
|
|
3537
3505
|
right under the way back, above the style it follows. It is the plain copy box
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type ColorPreset } from "efficient-shell/ui";
|
|
3
|
-
export declare function ColourControl({ value, onChange, label, id, caption, inherited, ariaLabel, }: {
|
|
3
|
+
export declare function ColourControl({ value, onChange, label, id, caption, inherited, ariaLabel, choices, }: {
|
|
4
4
|
value: string;
|
|
5
5
|
onChange: (next: string) => void;
|
|
6
6
|
label: string;
|
|
@@ -8,13 +8,15 @@ export declare function ColourControl({ value, onChange, label, id, caption, inh
|
|
|
8
8
|
caption?: string;
|
|
9
9
|
inherited?: string;
|
|
10
10
|
ariaLabel?: string;
|
|
11
|
+
choices?: readonly ColourChoice[];
|
|
11
12
|
}): import("react").JSX.Element;
|
|
12
|
-
export
|
|
13
|
-
export declare function AnyColourSwatch({ value, onChange, label, }: {
|
|
14
|
-
value: string;
|
|
15
|
-
onChange: (next: string) => void;
|
|
13
|
+
export interface ColourChoice {
|
|
16
14
|
label: string;
|
|
17
|
-
|
|
15
|
+
color: string;
|
|
16
|
+
selected: boolean;
|
|
17
|
+
onPick: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function useThemePresets(): ColorPreset[];
|
|
18
20
|
export declare function ColourRow({ label, icon, changed, hint, onReset, resetTo, children, ...control }: Parameters<typeof ColourControl>[0] & {
|
|
19
21
|
icon?: ReactNode;
|
|
20
22
|
changed?: boolean;
|
|
@@ -23,7 +25,7 @@ export declare function ColourRow({ label, icon, changed, hint, onReset, resetTo
|
|
|
23
25
|
resetTo?: string;
|
|
24
26
|
children?: ReactNode;
|
|
25
27
|
}): import("react").JSX.Element;
|
|
26
|
-
export declare function InheritedColourRow({ label, icon, value, inherited, resetTo, onChange, onReset, hint, }: {
|
|
28
|
+
export declare function InheritedColourRow({ label, icon, value, inherited, resetTo, onChange, onReset, hint, choices, }: {
|
|
27
29
|
label: string;
|
|
28
30
|
icon?: ReactElement;
|
|
29
31
|
value: string;
|
|
@@ -32,4 +34,5 @@ export declare function InheritedColourRow({ label, icon, value, inherited, rese
|
|
|
32
34
|
onChange: (hex: string) => void;
|
|
33
35
|
onReset: () => void;
|
|
34
36
|
hint?: ReactNode;
|
|
37
|
+
choices?: readonly ColourChoice[];
|
|
35
38
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,jsxs as h}from"react/jsx-runtime";import{useRef as C}from"react";import{ColorPicker as w,ColorPickerPanel as x,ColorSwatch as b,HexInput as S,Popover as N,Tooltip as P,colorFill as k,colorSwatchClasses as T,useShellStrings as E}from"efficient-shell/ui";import{SettingsDefaultReset as R,SettingsField as _}from"efficient-easel/panel";import{typedHex as p}from"efficient-easel/pick";import{usePreviewHeader as j}from"../../../render/components/PreviewHeaderContext.js";import{editorEaselWords as v,say as g}from"../../../format/lib/editor-words.js";import{themeSwatches as F}from"./theme-swatches.js";import{SITE_STYLE_UNSET_LABEL as I}from"../../../format/components/SiteStyleUnset.js";function L({value:e,onChange:n,label:o,id:a,caption:s,inherited:c,ariaLabel:t,choices:l}){return r(z,{value:e,onChange:n,label:g(t??o),id:a,caption:s,inherited:c,choices:l})}function y(){const{theme:e}=j();return F(e).map(n=>({value:n.value,label:n.name}))}function z({value:e,onChange:n,label:o,id:a,caption:s,inherited:c,choices:t}){const l=y(),i=e?null:p(c??""),d=s!==void 0&&(!e||p(s)!==p(e))?s:null,f=m=>{m!==e&&n(m)};return h("div",{className:"sf-colour",children:[t?r(B,{id:a,value:e,onChange:n,label:o,presets:l,follows:i,choices:t}):r(w,{id:a,value:e,onChange:f,label:o,presets:l,fallback:i??void 0,size:"md",align:"start"}),d!==null?r("span",{className:"sf-colour-caption",children:d}):r("span",{className:"sf-colour-hexwrap",children:r(S,{value:e||i||"",onChange:f,label:g("{label} hex code",{label:o}),placeholder:e||i?void 0:g(I),className:i?"sf-colour-hex is-inherited":"sf-colour-hex",size:"md"})})]})}function B({value:e,onChange:n,label:o,id:a,presets:s,follows:c,choices:t}){const l=E().color,i=e||c||"",d=t.findIndex(u=>u.selected),f=d>=0,m=C(d);return f&&(m.current=d),r(N,{id:a,trigger:r("span",{"aria-hidden":"true",className:"absolute inset-0",style:k(i)}),triggerLabel:l.swatch(o,i.toUpperCase()||l.none),triggerClassName:T({size:"md"}),"aria-label":l.panel(o),align:"start",children:h("div",{className:"sf-colour-window",children:[r("div",{role:"group","aria-label":o,className:"sf-colour-choices",children:t.map(u=>r(P,{content:u.label,children:r(b,{color:u.color,"aria-label":u.label,selected:u.selected,onClick:()=>{u.selected||u.onPick()}})},u.label))}),r(x,{value:f?"":e,onChange:n,label:o,presets:s,fallback:(f?i:c)??void 0},m.current)]})})}function H({label:e,icon:n,changed:o,hint:a,onReset:s,resetTo:c,children:t,...l}){return h(_,{label:e,icon:n,htmlFor:l.id,changed:o,hint:a,action:s?r(R,{words:v()?.panel,label:e,changed:!!o,detail:c,onReset:s}):void 0,children:[L({...l,label:e}),t]})}function M({label:e,icon:n,value:o,inherited:a,resetTo:s,onChange:c,onReset:t,hint:l,choices:i}){const d=!!o;return r(H,{label:e,icon:n,value:o,inherited:d?void 0:a,onChange:c,changed:d,onReset:t,resetTo:s,hint:l,choices:i})}export{L as ColourControl,H as ColourRow,M as InheritedColourRow,y as useThemePresets};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{phoneKey as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{phoneKey as n,tabletKey as i}from"efficient-easel/draw";import{BOX_CARD_PAD as d,isBackgroundBox as W}from"../../../../../../format/lib/content/box-background.js";import{darkenFields as X}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as j,REEL_SHAPE_LABELS as K}from"../../../../../../format/lib/reel.js";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{ClockIcon as v,CropIcon as g,LineBetweenIcon as G,LineSolidIcon as Y,ShadowIcon as J,StylesIcon as V,TableIcon as A,TargetIcon as z}from"efficient-easel/icons";import{boxBlockSpacingField as q,boxFillField as Q,boxColumnsFields as Z,boxShareField as $,boxSharePhoneField as oo,boxShareTabletField as eo,containerDirectionField as to,containerGapRows as no,linkField as io,plainText as ao,swapPadding as O,toggle as c,upload as R,withPanelOnly as lo}from"../../../controls.js";import{BOX_SHAPE_OPTIONS as E,boxShapeOf as ro}from"../../../../../../format/lib/content/box-shape.js";import{BOX_COLUMNS_MAX as b,BOX_COLUMNS_MIN as C,boxPhoneRowOneLine as so}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as F}from"../../../../../../format/lib/content/box-separator.js";import{VIEW_KEY_ACCESS as po,group as a,phoneTwinFields as L}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as co,boxJustifyField as mo,boxWrapField as N,placementField as So,select as s,sidesPaddingFields as H}from"../../../box-fields.js";import{withRowRules as _o}from"../../../../../../render/lib/document/show-when.js";import{separatorField as ho}from"../../../separator-field.js";import{LOOP_SCROLLS as fo}from"../../../../../../format/lib/animation/index.js";import{FlexSlots as uo}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{CARD_BOX_FACTS as go,ON_A_CARD as Ao,cardDisplayField as Oo}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as Ro,mirrorCardsField as Eo}from"../../../mirror-cards-field.js";import{SHARED_COLUMNS_KEY as l,SHARED_COLUMNS_LABEL as T,SHARED_COLUMNS_OFF as D,sharedColumnsDrawn as x,sharedColumnsFits as I,SHARED_COLUMNS_PHONE_POINTS as bo,SHARED_COLUMNS_POINTS as Co}from"../../../../../../render/lib/content/box-shared-columns.js";const Fo={field:"bgImage",set:!0},w={field:"phoneRow",in:[2,3]},Lo={field:"direction",is:"tabs"},No={field:"line",in:[!0,!1]},Ho={field:"anchor",set:!0},h=["fixed","screen"],To={not:{any:[{field:"sectionHeightMode",in:h},{field:"sectionHeightModeTablet",in:h},{field:"sectionHeightModePhone",in:h}]}},Do={context:"parent.line",is:!0},f={field:"direction",is:"row",default:"row"},p={not:fo},u={all:[f,p,{not:{field:"separator",in:F.map(o=>o.value)}},{not:{field:"line",is:!0}}]},xo={all:[u,...["columns",i("columns")].map(o=>({not:{field:o,in:Array.from({length:b},(t,_)=>_+C)}}))]},Io={all:[p,{not:{all:[f,{field:"separator",in:F.map(o=>o.value)}]}}]},k={not:{all:[u,{field:"columns",in:Array.from({length:b},(o,t)=>t+C)}]}},wo="sharedColumnsFits",P="sharedColumnsMisfit",B="sharedColumnsDraws",M="sharedColumnsPhoneDraws",ko={[wo]:o=>I(o.props??{}),[P]:o=>!I(o.props??{}),[B]:o=>x(o.props??{}).desktop,[M]:o=>x(o.props??{}).phone};function y(o){return{all:[{not:{context:P,is:!0}},{any:[Ao,{field:o,set:!0}]}]}}const m={not:{context:B,is:!0}},S={not:{context:M,is:!0}},Po={any:[m,S]};function Bo(o){return{...o,render:t=>o.render({...t,value:so(t.value)?"nowrap":"wrap"})}}const ie={fields:_o({_gContent:a("Content"),content:uo.content,_gCardDisplay:a("Display"),cardDisplay:Oo(),_gLayout:a("Layout"),direction:to("Flex"),tabShape:s("Tab shape",e(V,{}),j.map(o=>({label:K[o],value:o})),"tabs"),mirrorCards:Eo(),label:lo(ao("Tab name")),...no("Flex"),justify:mo(),align:co(),...L("wrap",N(),void 0,{phoneRow:Bo(N())}),...L("boxShape",s("Box shape",e(g,{}),[...E],"auto"),po,{phoneRow:s("Box shape",e(g,{}),[...E],"auto",{phoneRest:o=>ro(o)})}),separator:ho(e(G,{size:18}),"none"),share:r("desktop",$()),[i("share")]:eo(),[n("share")]:oo(),[l]:r("desktop",s(T,e(A,{}),[...Co],D)),[n(l)]:r("mobile",s(T,e(A,{}),[...bo],D)),...Z(),blockSpacing:q(),line:c("Line",!1,e(Y,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,e(v,{}),"Still to come: a hollow dot, and the gold line stops before it."),_gShadow:a("Shadow"),shadow:c("Shadow",!1,e(J,{})),fillColor:Q(),_gBackground:a("Background image"),bgImage:r("desktop",R("Image","image/*")),bgImagePhone:r("mobile",R("Image","image/*")),...X(),placement:So("Content position"),_gLink:a("Link"),link:io("Link to"),jumpHighlight:c("Highlight when a link jumps here",!1,e(z,{}),"When a link lands on this Box's anchor, the Box gets an accent outline and its first block turns accent.")},[[["darken","darkenStyle","placement"],Fo],[[n("share")],{all:[w,S]}],[[l],y(l)],[[n(l)],y(n(l))],[[n("wrap")],{all:[w,p,S]}],[["phoneRow"],S],[["tabShape"],Lo],[["separator"],f],[["columns",i("columns")],u],[[i("gap")],Io],[["justify"],{all:[p,Po]}],[["wrap"],{all:[p,k,m]}],[["share"],{all:[k,m]}],[[i("share")],{all:[xo,m]}],[["line"],No],[["upcoming"],Do],[["jumpHighlight"],Ho],[["boxShape",i("boxShape"),n("boxShape")],To]]),resolveFields:(o,{fields:t})=>{const _=o.props;if(W(_.bgImage)){const U=H({fallback:{top:d.desktop,bottom:d.desktop,left:d.side,right:d.side},tablet:!0});return O(t,U)}return o.props.padV2!==!0?O(t,H({fallback:{top:24,bottom:24},tablet:!0})):t},showWhenFacts:{...go,...Ro,...ko}};export{ie as FlexFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{backgroundField as s,copyText as r,plainTextarea as o,text as d,textarea as i}from"../../../controls.js";import{group as
|
|
1
|
+
import{backgroundField as s,copyText as r,plainTextarea as o,text as d,textarea as i}from"../../../controls.js";import{group as t}from"efficient-easel/screen/lib/document/box-fields";import{SPLITTABLE_SECTIONS as m,headFieldsForPlacement as n}from"../../../../../../format/lib/sections/section-head-placement.js";import{SECTION_BG_BUILT_IN as u}from"../../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{SERIES_PH as a}from"../../../../../../format/lib/document/blocks/general/Series/meta.js";const h={fields:{_gHead:t("Section header"),headNum:d("Number",a.headNum),headTitle:i("Heading",a.headTitle),headDesc:i("Body",a.headDesc),_gCards:t("Cards"),cards:{type:"array",label:"Cards",arrayFields:{num:r("Number"),since:r("Right Top Text"),title:o("Title"),desc:o("Body"),entries:r("Entries count"),entriesLabel:r("Button Right Text")},getItemSummary:e=>e?.title||(e?.num?`Column ${e.num}`:"Column")},_gViewLabel:t("Card link"),viewLabel:d("Card button",a.viewLabel),_gStyle:t("Style"),background:s("Background color",u.Series,!0)},resolveFields:(e,{fields:l})=>n(l,e.props.headPlacement,m.Series.headRows)};export{h as SeriesFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s}from"react/jsx-runtime";import{AccentIcon as i}from"efficient-easel/icons";import{backgroundField as p,plainText as e,plainTextarea as m,text as f,textarea as t,toggle as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{AccentIcon as i}from"efficient-easel/icons";import{backgroundField as p,plainText as e,plainTextarea as m,text as f,textarea as t,toggle as u}from"../../../controls.js";import{group as o}from"efficient-easel/screen/lib/document/box-fields";import{SPLITTABLE_SECTIONS as d,headFieldsForPlacement as n}from"../../../../../../format/lib/sections/section-head-placement.js";import{innerSpacingFields as S}from"../../shared-fields.js";import{SECTION_BG_BUILT_IN as g}from"../../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{STATS_PARAGRAPH_PH as r}from"../../../../../../format/lib/document/blocks/general/StatsParagraph/meta.js";const A={fields:{_gContent:o("Content"),eyebrow:f("Eyebrow",r.eyebrow),title:t("Heading",r.title),desc:t("Body",r.desc),stats:{type:"array",label:"Stats",arrayFields:{value:e("Number"),prefix:e("Prefix"),suffix:e("Unit"),supSuffix:e("Superscript"),emphasizeAll:u("Whole number Theme Color",!1,s(i,{})),label:e("Label"),sub:m("Body")},defaultItemProps:{value:"",prefix:"",suffix:"",supSuffix:"",emphasizeAll:!1,label:"",sub:""},getItemSummary:a=>a.label||a.value||"Stat"},_gStyle:o("Style"),background:p("Background color",g.StatsParagraph,!0),...S("StatsParagraph")},resolveFields:(a,{fields:l})=>n(l,a.props.headPlacement,d.StatsParagraph.headRows)};export{A as StatsParagraphFields};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const assembleGeneralBlocks: () => Record<"ImageBlock" | "Manifesto" | "Split" | "ContactLocations" | "Grid" | "HeroGroup" | "HeroSlide" | "
|
|
2
|
-
export declare const generalBlocks: Record<"ImageBlock" | "Manifesto" | "Split" | "ContactLocations" | "Grid" | "HeroGroup" | "HeroSlide" | "
|
|
1
|
+
export declare const assembleGeneralBlocks: () => Record<"ImageBlock" | "Manifesto" | "Split" | "ContactLocations" | "Grid" | "HeroGroup" | "HeroSlide" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "FAQ" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "Heading" | "Text" | "Eyebrow" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
|
|
2
|
+
export declare const generalBlocks: Record<"ImageBlock" | "Manifesto" | "Split" | "ContactLocations" | "Grid" | "HeroGroup" | "HeroSlide" | "Hero" | "HeroSingle" | "IntroBleed" | "ProcessSteps" | "OrderSummary" | "PaymentBadges" | "Footprint" | "Prose" | "ParagraphsA" | "Cards" | "Stats" | "StatsParagraph" | "Chart" | "Mockup" | "Testimonials" | "Logos" | "Banner" | "TitleWithButtons" | "Countdown" | "Masthead" | "FeaturedCover" | "LongRead" | "Breadcrumb" | "CategoryBar" | "DocTabs" | "DocMasthead" | "DocBody" | "FAQ" | "SectionHeader" | "Flex" | "Divider" | "CustomHTML" | "Ticker" | "SpecStrip" | "TimelineTrack" | "Timeline" | "Spacer" | "KeyFeatures" | "Series" | "DocMetaCards" | "Heading" | "Text" | "Eyebrow" | "LogoBlock" | "LocationMap" | "Contents" | "ButtonBlock" | "PostCard" | "Integrations", import("efficient-easel/blocks").ComponentConfig<any, any, Omit<import("efficient-easel/blocks").ComponentData<any, string, Record<string, import("efficient-easel/blocks").DefaultComponentProps>>, "type">>>;
|
|
@@ -8,6 +8,7 @@ import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
|
|
|
8
8
|
import { type SettingsBorderValue } from "efficient-easel/panel";
|
|
9
9
|
import { type AlignmentPoint, FOCAL_DEFAULT } from "efficient-shell/ui";
|
|
10
10
|
import type { GeocodeState } from "../../../format/lib/content/contact.js";
|
|
11
|
+
import { type SectionHeightMode, type SectionHeightUnit } from "../../../format/lib/content/section-min-height.js";
|
|
11
12
|
import { type DirectionContainer } from "../../../format/lib/content/container-direction.js";
|
|
12
13
|
import { BOX_SHARE_POINTS } from "../../../format/lib/content/box-layout.js";
|
|
13
14
|
import { GAP_FIELD_CONTAINER, type GapContainer } from "../../../format/lib/content/container-gap.js";
|
|
@@ -138,20 +139,21 @@ export declare function Swatches({ swatches, current, onPick, names, }: {
|
|
|
138
139
|
onPick: (next: string) => void;
|
|
139
140
|
names?: Readonly<Record<string, string>>;
|
|
140
141
|
}): import("react").JSX.Element;
|
|
141
|
-
export declare function backgroundField(label: string, builtIn: SectionBackground): CustomField<SectionBackground>;
|
|
142
|
+
export declare function backgroundField(label: string, builtIn: SectionBackground, followsBand?: boolean): CustomField<SectionBackground>;
|
|
142
143
|
export declare function cardImageBackgroundField(label: string, builtIn: string): CustomField<unknown>;
|
|
143
144
|
export declare function sectionThemeFields(readValue?: (v: unknown) => unknown, followLabel?: string): Record<string, CustomField<unknown>>;
|
|
144
|
-
export declare function Slider({ min, max, step, value, onChange, suffix, readout, notch, ariaLabel, disabled, }: {
|
|
145
|
+
export declare function Slider({ min, max, step, value, onChange, suffix, readout, notch, ariaLabel, disabled, placeholder, }: {
|
|
145
146
|
min: number;
|
|
146
147
|
max: number;
|
|
147
148
|
step: number;
|
|
148
|
-
value: number;
|
|
149
|
+
value: number | null;
|
|
149
150
|
onChange: (next: number) => void;
|
|
150
151
|
suffix?: string;
|
|
151
152
|
readout?: boolean;
|
|
152
153
|
notch?: number;
|
|
153
154
|
ariaLabel?: string;
|
|
154
155
|
disabled?: boolean;
|
|
156
|
+
placeholder?: number;
|
|
155
157
|
}): import("react").JSX.Element;
|
|
156
158
|
export declare function pxField(label: string, opts: {
|
|
157
159
|
min: number;
|
|
@@ -185,7 +187,8 @@ export declare function useSelectedPatch(): (patch: FieldsPatch) => void;
|
|
|
185
187
|
export declare function cornerSidesField(): CustomField<string[] | null>;
|
|
186
188
|
export declare function sectionCornersField(): CustomField<number | null>;
|
|
187
189
|
export declare function sectionShapeFields(): Record<string, unknown>;
|
|
188
|
-
export declare function sectionBorderField(tier: "desktop" | "mobile"): CustomField<SettingsBorderValue | undefined>;
|
|
190
|
+
export declare function sectionBorderField(tier: "desktop" | "tablet" | "mobile"): CustomField<SettingsBorderValue | undefined>;
|
|
191
|
+
type PanelView = "desktop" | "tablet" | "phone";
|
|
189
192
|
export declare function buttonWordsEntryField(partKey: string): CustomField<undefined>;
|
|
190
193
|
export declare function cardCornersField(): CustomField<number | null>;
|
|
191
194
|
export declare function templateField<V>(inner: CustomField<V>): CustomField<V>;
|
|
@@ -235,7 +238,14 @@ export declare function swapPadding(fields: Record<string, unknown>, padding: Re
|
|
|
235
238
|
export declare const WIDTH_LABEL = "Width";
|
|
236
239
|
export declare function widthField(defaultMode: WidthMode, modes?: readonly WidthMode[], inheritable?: boolean): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
|
|
237
240
|
export declare function heightFields(): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
|
|
241
|
+
export declare function heightFollowedBy(view: PanelView, props: Record<string, unknown>): {
|
|
242
|
+
mode: SectionHeightMode;
|
|
243
|
+
value: number;
|
|
244
|
+
unit: SectionHeightUnit;
|
|
245
|
+
} | null;
|
|
246
|
+
export declare function followedHeightPatch(view: PanelView, props: Record<string, unknown>, base: "sectionHeightValue" | "sectionHeightUnit", next: unknown): Record<string, unknown> | null;
|
|
238
247
|
export declare function stickFields(): Record<string, CustomField<undefined> | CustomField<boolean> | CustomField<number>>;
|
|
248
|
+
export declare function followedStickPatch(view: PanelView, props: Record<string, unknown>, next: unknown): Record<string, unknown> | null;
|
|
239
249
|
export declare function anchorFields(): Record<string, CustomField<undefined> | CustomField<HidableValue>>;
|
|
240
250
|
export declare function dateTime(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
|
|
241
251
|
export declare function date(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
|