efficient-web-builder 74.0.0 → 74.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/editor/components/PreviewFooterContext.d.ts +3 -1
- package/dist/editor/components/PreviewFooterContext.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.d.ts +2 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/storefront-editor.css +7 -0
- package/dist/editor/lib/document/blocks/general/ContactLocations/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Footprint/fields.d.ts +3 -0
- package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +3 -0
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/own-pad-fields.d.ts +7 -1
- package/dist/editor/lib/document/own-pad-fields.js +1 -1
- package/dist/editor/lib/document/page-root-fields.d.ts +4 -0
- package/dist/editor/lib/document/page-root-fields.js +1 -1
- package/dist/editor/lib/document/page-root.d.ts +3 -2
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/editor/lib/document/registry.js +1 -1
- package/dist/editor/lib/editor-document-adapter.d.ts +1 -0
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/format/lib/build/module-specifiers.d.ts +8 -0
- package/dist/format/lib/build/module-specifiers.js +1 -1
- package/dist/format/lib/content/block-sources.d.ts +1 -0
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/borders.d.ts +2 -1
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/page-width.d.ts +15 -0
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/section-css.d.ts +1 -1
- package/dist/format/lib/content/section-css.js +1 -1
- package/dist/format/lib/content/site-css.d.ts +5 -0
- package/dist/format/lib/content/site-css.js +1 -0
- package/dist/format/lib/content/site-offices.d.ts +7 -0
- package/dist/format/lib/content/site-offices.js +1 -0
- package/dist/format/lib/document/blocks/block-types.d.ts +1 -0
- package/dist/format/lib/document/passes/types.d.ts +4 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +5 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/format/lib/sections/strip-shape.d.ts +1 -0
- package/dist/format/lib/sections/strip-shape.js +1 -1
- package/dist/format/lib/source-rules/panel-colour-tokens.js +7 -7
- package/dist/format/lib/source-rules/site-gutter-once.d.ts +12 -0
- package/dist/format/lib/source-rules/site-gutter-once.js +23 -0
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +3 -3
- package/dist/render/components/Breadcrumb.d.ts +4 -1
- package/dist/render/components/Breadcrumb.js +1 -1
- package/dist/render/components/Cards.js +1 -1
- package/dist/render/components/ChartSection.js +1 -1
- package/dist/render/components/ContactLocations.js +2 -2
- package/dist/render/components/Countdown.js +1 -1
- package/dist/render/components/DocBody.js +5 -5
- package/dist/render/components/DocMasthead.js +1 -1
- package/dist/render/components/DocMetaCards.js +1 -1
- package/dist/render/components/FAQ.js +1 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/HeroGroup.js +1 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/LongRead.js +1 -1
- package/dist/render/components/Manifesto.js +1 -1
- package/dist/render/components/Masthead.js +1 -1
- package/dist/render/components/MockupSection.js +1 -1
- package/dist/render/components/ParagraphsA.js +1 -1
- package/dist/render/components/PhoneMenuTools.d.ts +3 -1
- package/dist/render/components/PhoneMenuTools.js +1 -1
- package/dist/render/components/ProcessSteps.js +1 -1
- package/dist/render/components/Prose.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.d.ts +2 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/Series.js +1 -1
- package/dist/render/components/SideSpaceOnce.d.ts +6 -0
- package/dist/render/components/SideSpaceOnce.js +1 -0
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/SiteOffices.d.ts +5 -0
- package/dist/render/components/SiteOffices.js +1 -0
- package/dist/render/components/SiteRootProps.d.ts +6 -0
- package/dist/render/components/SiteRootProps.js +1 -0
- package/dist/render/components/SpecStrip.d.ts +4 -1
- package/dist/render/components/SpecStrip.js +1 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/components/StatsParagraph.js +1 -1
- package/dist/render/components/Testimonials.js +1 -1
- package/dist/render/components/Timeline.js +1 -1
- package/dist/render/components/TimelineTrack.js +1 -1
- package/dist/render/components/TitleWithButtons.js +1 -1
- package/dist/render/lib/content/section-edge.d.ts +1 -1
- package/dist/render/lib/content/section-edge.js +1 -1
- package/dist/render/lib/content/section-padding.d.ts +24 -14
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ContactLocations/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
- package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
- package/dist/render/lib/document/blocks/general/SpecStrip/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -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-pageheader.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/custom-css.d.ts +2 -1
- package/dist/render/lib/document/part-styles.d.ts +7 -4
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/clickable-parts.js +1 -1
- package/dist/render/lib/document/passes/section-custom-css.d.ts +7 -0
- package/dist/render/lib/document/passes/section-custom-css.js +1 -1
- package/dist/render/lib/document/passes/section-padding.d.ts +2 -1
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/document/section-css-style.d.ts +3 -1
- package/dist/render/lib/document/section-css-style.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 74.2.0 - 2026-11-22
|
|
4
|
+
|
|
5
|
+
From main at `65a9e17d`: #827, #828.
|
|
6
|
+
|
|
7
|
+
A minor: the site-footer page's root settings get one "Website" group (count the site's side space once, one office list for the website, the site's own Custom CSS), and the Add page window's card area scrolls. New exports and new optional root props; no new peer, no removed path. No stored key or value moves. A site without the three values draws the same bytes as before (`test-site-root-bytes`).
|
|
8
|
+
|
|
9
|
+
**For hosts:**
|
|
10
|
+
- storefront: wrap the page in `SiteRootPropsProvider` (`components/SiteRootProps`) with the site-footer root props, and put `data-sf-side` (from `sideSpaceOnceAttr`, `lib/content/page-width`) and `data-sf-site-css` (from `siteCssScopeAttr`, `lib/content/site-css`) on the outermost wrapper (header + page + footer). Each hand-built route's phone/tablet rung reads the phone-room class through `withSideOnce(cls, useSideSpaceOnce())`, with its own breakpoint. Without these steps a host page draws as today.
|
|
11
|
+
- storefront-blocks and storefront: the files that write `--sf-site-gutter` (blocks 19, storefront 12) follow in their own PRs.
|
|
12
|
+
- admin-portal: no step. The admin bump checks the site Custom CSS in the real editor (not checked before this release).
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Count the site's side space once.** A switch, off by default: `sideSpaceOnce` (`SIDE_SPACE_ONCE_PROP`) in the site-footer page's root props. On, the page carrier gets `data-sf-side="once"` (`SIDE_ONCE_ATTR`); the outer "site" side draws the gutter and what it holds gives way (`SIDE_ONCE_HOLDS_CLASS`, the scoped twin of `BOX_HOLDS_NO_GUTTER_CLASS`; a test holds the two together). Below the phone edge (800) a switched site draws its phone side space; from 800 up a "site" section draws one count at its own step. Look change on switched sites only. A source rule, `site-gutter-once`, fails a web-builder file that draws a gutter token inside a "site" side without the switch. (#827)
|
|
17
|
+
- **One office list for the website.** `siteOffices` (`SITE_OFFICES_PROP`) in the site-footer root props, edited as "Offices" with the "Find coordinates" control Footprint uses (the `FootprintOffice` shape). A "Site offices" source (`SITE_OFFICES_BLOCK_SOURCE`, `lib/content/site-offices`) that Footprint and Contact/Locations read, so no section keeps a second copy. (#827)
|
|
18
|
+
- **The site's own Custom CSS.** `siteCustomCss` (`SITE_CSS_KEY`) in the site-footer root props, filtered like the section Custom CSS (`scopeCustomCss`) and scoped by `data-sf-site-css` (`SITE_CSS_SCOPE_ATTR`). Refused CSS does not reach the page. Like the section CSS, it has no Suspense boundary of its own: a cold `renderToString` / `renderToStaticMarkup` under the provider throws instead of sending the page without its CSS (no host path renders that way today). (#827)
|
|
19
|
+
- **One provider of the site-footer root props:** `SiteRootPropsProvider` and `useSiteRootProps` (`components/SiteRootProps`). The switch, the offices and the site CSS read it; with no provider, main's markup. (#827)
|
|
20
|
+
- The three rows are one "Website" group on the site-footer page's root settings: "Count side space once", "Offices", "Custom CSS". (#827)
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **The Add page window's card area scrolls.** `.sf-add-page` (`storefront-editor.css`) fills its column and scrolls its own overflow (`flex: 1 1 0%; min-height: 0; overflow-y: auto`), as the shell `SidebarLayout` content contract asks. Before, at 1440 × 900 the cards ran past the window and the bottom cards could not be reached. A real-Chromium check, `tests/browser/addPageScroll`, holds it. (#828)
|
|
25
|
+
|
|
26
|
+
## 74.1.0 - 2026-11-21
|
|
27
|
+
|
|
28
|
+
From main at `f81d0ed3`: #824, #825.
|
|
29
|
+
|
|
30
|
+
A minor: the Breadcrumb and the Spec Strip draw one padding, a block can cap the size of the parts it names, and the Cart can join the phone menu. New exports and new optional meta fields; no new peer. No stored key or value moves. An unset Breadcrumb or Spec Strip draws the same bytes as before; a stored one keeps its drawn total.
|
|
31
|
+
|
|
32
|
+
**For hosts:**
|
|
33
|
+
- storefront-blocks: a block that fits a headline to its box (`ProductName`) can declare `partSizeCaps: { name: true }` in its meta and set `--sf-part-size-cap` (`PART_SIZE_CAP_VAR`) to its fit.
|
|
34
|
+
- storefront-blocks: the header tool blocks (Search, Account, Cart, Country, Theme) can take `phonePlaceField(<today's place>)` and offer themselves with `useOfferToPhoneMenu`; a Cart block offers `"cart"`.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **Breadcrumb and Spec Strip draw one vertical padding.** They own their top and bottom padding, as Text and Heading do: their Padding row keeps its keys (`sectionPadding*`), shows the section's own default for an empty side, and an edit names its key in `padTotal`. A total is drawn on their own root (the nav; the strip's row), not on an outer wrapper over a fixed `py-*`, so a top of 40 draws 40, not 40 + 24 (Breadcrumb) or 40 + 16 (Spec Strip), and the strip no longer shows bare page round its dark band. One reader, `framePadAttrs` in `lib/content/section-padding`, with the `py-*` text in `PY_CLASS`; the default numbers have one home (`lib/sections/strip-shape` `CRUMB_PAD`, `SPEC_PAD`), read by the component, the panel and the Box converter (which adds no own px to a total). A node with no total, which is every stored node, draws the same bytes as before: its classes, and any older value on the outer wrapper at its old lines (720 for a tablet or phone value). The Spec Strip's row carries the edge mark when it draws a total's view classes, so its default phone value turns at 800, as its class did. (#825)
|
|
39
|
+
- **The corner and border size limits come from efficient-easel.** `CORNER_RADIUS_MAX` (`lib/theme`) and `BORDER_MAX` (`lib/content/borders`) are now taken from `efficient-easel/screen/lib/content/style-keys` (easel's `BORDER_WIDTH_MAX` under the old name `BORDER_MAX`), not declared here. The names and the values (40, 20) do not change. The draw-imports guard checks that neither file declares its own copy. (#824)
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- **A block caps the size of the parts it names.** `BlockRender.partSizeCaps` (`Readonly<Record<string, true>>`) and `PartDeclarationOptions.sizeCap`: a named part draws its own Font size as `min(<size>, var(--sf-part-size-cap, <size>))` on desktop, tablet and phone, on the published sheet and on the canvas. `blockCapsPartSize` and `PART_SIZE_CAP_VAR` are exported. A part that is not named draws the CSS it drew. (#825)
|
|
44
|
+
- **The Cart can join the phone menu.** `PhoneMenuTool` takes `"cart"`; `usePhoneMenuTools()` reports `cart`. `PhonePlace` (`"header" | "menu"`) and `phonePlaceField(fallback)`: the one "On a phone" dropdown (In the header / In the menu) for the header tools. (#825)
|
|
45
|
+
|
|
3
46
|
## 74.0.0 - 2026-11-19
|
|
4
47
|
|
|
5
48
|
From main at `80ccf42a`: #817, #818, #820, #823.
|
|
@@ -8,10 +8,12 @@ type PreviewFooterCtx = {
|
|
|
8
8
|
editFooter?: () => void;
|
|
9
9
|
refreshToken: number;
|
|
10
10
|
refreshFooter: () => void;
|
|
11
|
+
chromeRootProps: Record<string, unknown> | null;
|
|
11
12
|
};
|
|
12
|
-
export declare function PreviewFooterProvider({ children, editFooter, }: {
|
|
13
|
+
export declare function PreviewFooterProvider({ children, editFooter, chromeRootProps, }: {
|
|
13
14
|
children: ReactNode;
|
|
14
15
|
editFooter?: () => void;
|
|
16
|
+
chromeRootProps?: Record<string, unknown> | null;
|
|
15
17
|
}): import("react").JSX.Element;
|
|
16
18
|
export declare const usePreviewFooter: () => PreviewFooterCtx;
|
|
17
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as p}from"react/jsx-runtime";import{createContext as k,useCallback as d,useContext as x,useState as e}from"react";const o=k({footerBlock:null,setFooterBlock:()=>{},headerGroup:null,setHeaderGroup:()=>{},refreshToken:0,refreshFooter:()=>{},chromeRootProps:null});function P({children:r,editFooter:t,chromeRootProps:s=null}){const[n,l]=e(null),[u,c]=e(null),[a,f]=e(0),i=d(()=>f(h=>h+1),[]);return p(o.Provider,{value:{footerBlock:n,setFooterBlock:l,headerGroup:u,setHeaderGroup:c,editFooter:t,refreshToken:a,refreshFooter:i,chromeRootProps:s},children:r})}const m=()=>x(o);export{P as PreviewFooterProvider,m as usePreviewFooter};
|
|
@@ -9,10 +9,11 @@ export declare function styleTagsOf(element: HTMLElement): {
|
|
|
9
9
|
sizeGroup: TypeGroup | null;
|
|
10
10
|
};
|
|
11
11
|
export declare function measureStyleBase(element: HTMLElement, shown?: ShownDeclarations): PartStyleBase;
|
|
12
|
-
export default function PreviewPartAnchors({ needles, styles, motions, type, children, }: {
|
|
12
|
+
export default function PreviewPartAnchors({ needles, styles, motions, type, sizeCaps, children, }: {
|
|
13
13
|
needles: PartNeedle[];
|
|
14
14
|
styles: PartStyles;
|
|
15
15
|
motions?: Readonly<Record<string, PartMotion>>;
|
|
16
16
|
type?: string;
|
|
17
|
+
sizeCaps?: Readonly<Record<string, true>>;
|
|
17
18
|
children: ReactNode;
|
|
18
19
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as j}from"react/jsx-runtime";import{readInks as G}from"../../format/lib/document/part-inks.js";import{useEffect as q,useRef as I}from"react";import{markOverlayPortal as U}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as V}from"efficient-easel/draw/client";import{usePartStyle as Q}from"./PreviewPartStyleContext.js";import{usePreviewDevice as X}from"efficient-easel/draw/client";import{shownTier as Z}from"efficient-easel/screen/lib/document/device-fields";import{decodePartId as C,encodePartId as tt}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as et}from"efficient-easel/canvas";import{engagePartAnchors as rt}from"../lib/document/part-anchors.js";import{PART_ATTR as P,PART_STYLE_KIND_ATTR as b,PART_STYLE_OWNER_ATTR as ot,partStyleOwnerOf as S}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as D,applyPartStyles as k,blockCapsPartSize as z,blockDrawsTextStyle as F,partFontKeyOf as nt,partShownDeclarations as st,partStyleBase as it,partStyleSource as at,storedPartStyle as lt}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as pt,styleRoleOfClassName as ct}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as J}from"../../format/lib/theme.js";import{styleKeyForPart as A}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as ft,PART_HOST_ATTR as ut}from"../../render/lib/animation/part-motion.js";import{paintPartMotion as mt}from"../lib/document/part-motion-canvas.js";import{viewOfTier as yt}from"../../format/lib/content/view-tier.js";function dt(p){let s=null,n=null;for(let r=p;r&&(s===null||n===null);r=r.parentElement){const o=r.getAttribute("class");s??=ct(o),n??=J(o)}return{faceRole:s??"body",sizeGroup:n}}function M(p,s={}){const n=p.style,r={};for(const e of D)r[e]=n[e]??"",n[e]="";s.fontFamily&&(n.fontFamily=s.fontFamily),s.fontSize&&(n.fontSize=s.fontSize);const o=getComputedStyle(p),g=getComputedStyle(p.ownerDocument.documentElement),d=it({fontSize:o.fontSize,fontWeight:o.fontWeight,lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,textAlign:o.textAlign,textTransform:o.textTransform,paddingTop:o.paddingTop},nt(o.fontFamily,e=>g.getPropertyValue(e)));for(const e of D)n[e]=r[e];return d}function St({needles:p,styles:s,motions:n=ft,type:r,sizeCaps:o,children:g}){const d=I(null),{selectedPartId:e}=V(),{setPartStyle:h}=Q(),m=Z(X()),R=JSON.stringify(p),w=JSON.stringify(s),E=JSON.stringify(n),L=I(new Map);return q(()=>{const y=d.current;if(!y)return;const v=[],_=()=>y.parentElement,W=l=>{const a=_();if(!a)return null;const f=new MutationObserver(l);return f.observe(a,{attributes:!0,attributeFilter:[et]}),()=>f.disconnect()},B=l=>{const a=new MutationObserver(l);return a.observe(y,{childList:!0,subtree:!0,characterData:!0}),()=>a.disconnect()};let c=[];v.push(()=>{for(const l of c)l();c=[]});const H=JSON.parse(R),T=JSON.parse(w),Y=JSON.parse(E),$=rt(y,H,_,W,(l,a,f)=>{for(const t of c)t();c=[];const K=[];for(const t of f){const i=t,u=U(i);u&&c.push(u),i.getAttribute(P)===e&&K.push(i)}const N=at(a,e,K,t=>pt(t)!==null||J(t)!==null);if(N&&e){const t=N,i=C(e)?.propKey??"",u=S(t)?{}:st(lt(T,A(r,i)),m,{blockDrawsStyle:F(r,i),sizeCap:z(o,i)});h({partId:e,...dt(t),base:M(t,u),inks:G(t),...(()=>{const x=S(t);return x?{styleOwner:x}:{}})()})}k(f.filter(t=>!S(t)).map(t=>({element:t,partId:t.getAttribute(P)??""})),T,t=>M(t),t=>A(r,t),void 0,m,t=>F(r,t),t=>z(o,t));const O=[...y.querySelectorAll(`[${ot}="${CSS.escape(a)}"][${b}]`)];O.length&&k(O.map(t=>({element:t,partId:tt(a,t.getAttribute(b)??"")})),T,void 0,t=>t,void 0,m),c.push(mt([...f.filter(t=>!S(t)).map(t=>{const i=t,u=C(i.getAttribute(P)??"")?.propKey??"";return{element:i,partKey:A(r,u)}}),...O.map(t=>({element:t,partKey:t.getAttribute(b)??""}))],t=>Y[t],yt(m),L.current))},B);return()=>{$();for(const l of v)l()}},[R,w,E,e,h,m,r]),j("div",{ref:d,[ut]:"",style:{display:"contents"},children:g})}export{St as default,M as measureStyleBase,dt as styleTagsOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as wt}from"react/jsx-runtime";import{useCallback as o,useEffect as f,useMemo as Ct,useRef as g,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{useHostConfig as _t}from"../lib/document/host-config.js";import{ChromeWrap as Pt}from"efficient-easel/screen/lib/host-chrome";import{refreshSiteLiveState as Tt}from"../lib/site-live-state.js";import{holdSiteWrites as Et}from"../../format/lib/site-writes.js";import{backendOf as k}from"../lib/website-session.js";import{useEaselSession as yt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Gt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as vt}from"../../format/lib/document/templateFields.js";import{setEditorPage as he}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as Ht}from"./EditorPagePathProvider.js";import{AddPageOnOpen as Wt}from"./AddPageOnOpen.js";import{resolveSiteName as kt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Bt,normalizeSiteGutterPhone as Rt,normalizeSiteWidth as Ft}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as It}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as ue}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as le}from"../../format/lib/content/container-gap.js";import Dt,{DocumentScreen as Ot}from"efficient-easel/screen/components/ScreenMount";import Mt from"./WebsiteHintsProvider.js";import{useScreenDocument as bt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Nt,siteThemeRow as xt,themeEdited as Ut,themeSeeded as At}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as Lt}from"./PreviewFooterContext.js";import{PreviewChatProvider as zt,DEFAULT_CHAT_PREVIEW as Yt}from"./PreviewChatContext.js";import{PreviewSocialProvider as jt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Kt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Vt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Xt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Zt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as qt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Jt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Qt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as $t}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as er}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as tr,DEFAULT_HEADING_COMPRESSION as rr,DEFAULT_HEADING_TYPOGRAPHY as or,DEFAULT_SWITCH_SHOWN as B,DEFAULT_SIZES as nr,DEFAULT_THEME_MODE as T,normalizeCornerRadius as ir,normalizeCornerStyle as ar,normalizeCardShadow as cr,normalizeCardGap as sr,normalizeHoverEffect as dr,IDENTITY_CARD_GAP as me,IDENTITY_CARD_SHADOW as hr,IDENTITY_HOVER_EFFECT as ur,THEME_MODE_KEY as pe,THEME_STORAGE_KEY as lr,THEME_SWITCH_HIDE as Se,THEME_SWITCH_KEY as R}from"../../format/lib/theme.js";import{pictureShadowColor as mr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as pr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as Sr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as fr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as gr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as wr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as Cr}from"./PreviewChatContext.js";import{parseOption as _r}from"efficient-shell/format";import{THEME_MODES as Pr}from"../../format/lib/theme.js";const Tr=()=>{if(typeof window>"u")return T;try{const d=window.localStorage.getItem(pe);return _r(Pr,T,d)}catch{return T}},fe=d=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,d)}catch{}},Er=()=>{if(typeof window>"u")return B;try{return window.localStorage.getItem(R)!==Se}catch{return B}},yr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(lr)}catch{}},ge=d=>{if(!(typeof window>"u"))try{d?window.localStorage.removeItem(R):window.localStorage.setItem(R,Se)}catch{}};function Gr(){const{adapter:d,capabilities:s,templateId:F,ready:_,token:h,siteId:c,currentSlug:I,currentKind:D}=bt();f(()=>(he(I,D),()=>he(null,null)),[I,D]);const E=s.placeholderFrames,[we,O]=r(null),[Ce,M]=r("");f(()=>{const e=d.templateName;if(!_||!F||!e){M("");return}let i=!1;return e().then(u=>!i&&M(u??"")).catch(()=>{}),()=>{i=!0}},[_,h,F,d]);const[_e,y]=r(T),[Pe,G]=r(B),[b,N]=r({value:{selected:0,themes:[]},readFor:null}),Te=b.value,[Ee,x]=r(pr),[ye,U]=r(nr),[Ge,A]=r(null),[ve,L]=r(rr),[He,z]=r(null),[We,Y]=r(null),[ke,j]=r(me),[Be,K]=r(null),[Re,V]=r(null),[Fe,X]=r(null),[Ie,Z]=r(null),[v,q]=r(null),[H,J]=r(null),[De,Q]=r({}),Oe=o(e=>Q(i=>({...i,...e})),[]),l=yt(),$=_t(),Me=Ct(()=>Gt(vt($,E),v,H),[$,E,v,H]),[be,ee]=r(or),[Ne,te]=r(null),[xe,re]=r(null),[Ue,oe]=r(null),[Ae,ne]=r(null),[Le,ie]=r(null),ae=g(null),n=g(!1);f(()=>{y(Tr()),G(Er())},[]);const ze=o(e=>{n.current=!0,yr(),fe(e),y(e)},[]),Ye=o(e=>{n.current=!0,ge(e),G(e)},[]),je=o(e=>{n.current=!0,N(i=>Ut(i,e,c??""))},[c]),Ke=o(e=>{n.current=!0,x(e)},[]),Ve=o(e=>{n.current=!0,U(e)},[]),Xe=o(e=>{n.current=!0,A(e)},[]),Ze=o(e=>{n.current=!0,L(e)},[]),qe=o(e=>{n.current=!0,z(e)},[]),Je=o(e=>{n.current=!0,Y(e)},[]),Qe=o(e=>{n.current=!0,j(e)},[]),$e=o(e=>{n.current=!0,K(e)},[]),et=o(e=>{n.current=!0,ee(e)},[]),[tt,ce]=r(null),[rt,ot]=r(null),nt=o(e=>{n.current=!0,ce(e)},[]),it=o(e=>{n.current=!0,V(e)},[]),at=o(e=>{n.current=!0,X(e)},[]),ct=o(e=>{n.current=!0,Z(e)},[]),st=o(e=>{n.current=!0,q(e)},[]),dt=o(e=>{n.current=!0,J(e)},[]),ht=o(e=>{n.current=!0,te(e)},[]),ut=o(e=>{n.current=!0,re(e)},[]),lt=o(e=>{n.current=!0,oe(e)},[]),mt=o(e=>{n.current=!0,ne(e)},[]),pt=o(e=>{n.current=!0,ie(e)},[]);f(()=>{const e=k(l).theme;if(!h||!s.hasSiteTheme||!e)return;const i=c??"";ae.current!==i&&(ae.current=i,n.current=!1);let u=!1;return e.get(c?{siteId:c}:void 0).then(t=>{if(u||n.current)return;fe(t.default_mode),ge(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),N(At({selected:t.selected_preset,themes:t.theme_presets},i));const C=gr(t);x(C.fonts),U(C.sizes);const S=It(t);Q(S),A(t.corner_radius_px===void 0?tr[ar(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,ir)),L(C.compression),z(t.card_shadow==null?hr:cr(t.card_shadow)),j(t.card_gap==null?me:sr(t.card_gap)),K(t.hover_effect==null?ur:dr(t.hover_effect)),Y(mr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,Ft)),X(w(t.site_gutter,S.siteGutterUnit,Bt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Rt)),q(w(t.block_gap,S.blockGapUnit,le)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,le)),ee(C.typography),ce(C.textStyles),ot(wr(t)),te(t.hero_background_follows_width===!0),re(ue(t.section_background_width)),oe(ue(t.section_content_width)),ne(t.photography_grayscale===!0),ie(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[h,c,s.hasSiteTheme,l]);const St=Kt({token:h,siteId:c,enabled:s.hasSiteSettings}),[ft,se]=r(Yt),de=g(null),W=g(!1),m=g(null),p=g({}),P=o(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(l).chat?.update(e,c?{siteId:c}:void 0),Tt()}catch(i){throw p.current={...e,...p.current},i}},[l,c]);f(()=>Et(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const gt=o(e=>{W.current=!0,se(i=>({...i,...e})),!(!s.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[s.hasSiteSettings,h,P]);return f(()=>{if(!h||!s.hasSiteSettings)return;const e=c??"";de.current!==e&&(de.current=e,W.current=!1);let i=!1;const u=k(l).chat;if(u)return u.get(c?{siteId:c}:void 0).then(t=>{i||W.current||se(Cr(t))}).catch(()=>{}),()=>{i=!0}},[h,c,s.hasSiteSettings,l]),f(()=>{const e=d.site;if(!_||!s.hasSiteRecord||!e){O(null);return}let i=!1;return e().then(u=>{i||O(kt(u.name))}).catch(()=>{}),()=>{i=!0}},[_,h,s.hasSiteRecord,c,d]),a(Ot,{config:Me,parts:Sr,wrap:(e,i)=>a(Nt,{websiteName:we,templateChrome:E,templateName:Ce||null,themeMode:_e,onThemeModeChange:ze,themeSwitchShown:Pe,onThemeSwitchShownChange:Ye,theme:Te,themeRow:xt(s.hasSiteTheme,b.readFor,c??""),onThemeChange:je,fonts:Ee,onFontsChange:Ke,cornerRadiusPx:Ge,onCornerRadiusPxChange:Xe,cardShadow:He,onCardShadowChange:qe,shadowColor:We,onShadowColorChange:Je,cardGap:ke,onCardGapChange:Qe,hoverEffect:Be,onHoverEffectChange:$e,headingCompression:ve,onHeadingCompressionChange:Ze,headingTypography:be,onHeadingTypographyChange:et,textStyles:tt,onTextStylesChange:nt,wordStyles:rt,sizes:ye,onSizesChange:Ve,siteWidth:Re,onSiteWidthChange:it,siteGutter:Fe,onSiteGutterChange:at,siteGutterPhone:Ie,onSiteGutterPhoneChange:ct,blockGap:v,onBlockGapChange:st,blockGapPhone:H,onBlockGapPhoneChange:dt,siteLengthUnits:De,onSiteLengthUnitsChange:Oe,heroBackgroundFollowsWidth:Ne,onHeroBackgroundFollowsWidthChange:ht,sectionBackgroundWidth:xe,onSectionBackgroundWidthChange:ut,sectionContentWidth:Ue,onSectionContentWidthChange:lt,photographyGrayscale:Ae,onPhotographyGrayscaleChange:mt,shareButtonOnPosts:Le,onShareButtonOnPostsChange:pt,themeFromDocument:!s.hasSiteTheme,children:a(Lt,{children:a(Pt,{wrap:l.chrome?.wrap,surface:"page",children:a(Zt,{children:a(qt,{children:a(Jt,{children:a($t,{children:a(Qt,{children:wt(er,{children:[a(zt,{chat:ft,onChatChange:gt,children:a(jt,{value:St,children:a(Vt,{children:a(Ht,{children:a(Mt,{children:e})})})})}),i]})})})})})})})})})})}function vr({target:d,openAddPage:s}){return a(Wt,{open:s,children:a(Dt,{target:d,addressing:Xt,onHostMessage:fr,children:a(Gr,{})})})}export{vr as default};
|
|
1
|
+
"use client";import{jsx as a,jsxs as Ct}from"react/jsx-runtime";import{useCallback as o,useEffect as f,useMemo as _t,useRef as g,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{useHostConfig as Pt}from"../lib/document/host-config.js";import{ChromeWrap as Tt}from"efficient-easel/screen/lib/host-chrome";import{refreshSiteLiveState as Et}from"../lib/site-live-state.js";import{holdSiteWrites as yt}from"../../format/lib/site-writes.js";import{backendOf as k}from"../lib/website-session.js";import{useEaselSession as Gt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as vt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as Ht}from"../../format/lib/document/templateFields.js";import{setEditorPage as he}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as Wt}from"./EditorPagePathProvider.js";import{AddPageOnOpen as kt}from"./AddPageOnOpen.js";import{resolveSiteName as Rt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Bt,normalizeSiteGutterPhone as Ft,normalizeSiteWidth as It}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as Dt}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as ue}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as le}from"../../format/lib/content/container-gap.js";import Ot,{DocumentScreen as Mt}from"efficient-easel/screen/components/ScreenMount";import bt from"./WebsiteHintsProvider.js";import{useScreenDocument as Nt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as xt,siteThemeRow as Ut,themeEdited as At,themeSeeded as Lt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as zt}from"./PreviewFooterContext.js";import{usePinnedChromeState as Yt}from"./usePinnedChromeState.js";import{PreviewChatProvider as jt,DEFAULT_CHAT_PREVIEW as Kt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Vt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Xt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Zt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as qt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Jt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Qt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as $t}from"efficient-easel/draw/client";import{CanvasPartsBridge as er}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as tr}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as rr}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as or,DEFAULT_HEADING_COMPRESSION as nr,DEFAULT_HEADING_TYPOGRAPHY as ir,DEFAULT_SWITCH_SHOWN as R,DEFAULT_SIZES as ar,DEFAULT_THEME_MODE as T,normalizeCornerRadius as cr,normalizeCornerStyle as sr,normalizeCardShadow as dr,normalizeCardGap as hr,normalizeHoverEffect as ur,IDENTITY_CARD_GAP as me,IDENTITY_CARD_SHADOW as lr,IDENTITY_HOVER_EFFECT as mr,THEME_MODE_KEY as pe,THEME_STORAGE_KEY as pr,THEME_SWITCH_HIDE as Se,THEME_SWITCH_KEY as B}from"../../format/lib/theme.js";import{pictureShadowColor as Sr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as fr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as gr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as wr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as Cr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as _r}from"../../format/lib/word-styles.js";import{chatPreviewFrom as Pr}from"./PreviewChatContext.js";import{parseOption as Tr}from"efficient-shell/format";import{THEME_MODES as Er}from"../../format/lib/theme.js";const yr=()=>{if(typeof window>"u")return T;try{const d=window.localStorage.getItem(pe);return Tr(Er,T,d)}catch{return T}},fe=d=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,d)}catch{}},Gr=()=>{if(typeof window>"u")return R;try{return window.localStorage.getItem(B)!==Se}catch{return R}},vr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(pr)}catch{}},ge=d=>{if(!(typeof window>"u"))try{d?window.localStorage.removeItem(B):window.localStorage.setItem(B,Se)}catch{}};function Hr(){const{adapter:d,capabilities:s,templateId:F,ready:_,token:h,siteId:c,currentSlug:I,currentKind:D}=Nt();f(()=>(he(I,D),()=>he(null,null)),[I,D]);const we=Yt(d?.pinnedChrome)?.rootProps??null,E=s.placeholderFrames,[Ce,O]=r(null),[_e,M]=r("");f(()=>{const e=d.templateName;if(!_||!F||!e){M("");return}let i=!1;return e().then(u=>!i&&M(u??"")).catch(()=>{}),()=>{i=!0}},[_,h,F,d]);const[Pe,y]=r(T),[Te,G]=r(R),[b,N]=r({value:{selected:0,themes:[]},readFor:null}),Ee=b.value,[ye,x]=r(fr),[Ge,U]=r(ar),[ve,A]=r(null),[He,L]=r(nr),[We,z]=r(null),[ke,Y]=r(null),[Re,j]=r(me),[Be,K]=r(null),[Fe,V]=r(null),[Ie,X]=r(null),[De,Z]=r(null),[v,q]=r(null),[H,J]=r(null),[Oe,Q]=r({}),Me=o(e=>Q(i=>({...i,...e})),[]),l=Gt(),$=Pt(),be=_t(()=>vt(Ht($,E),v,H),[$,E,v,H]),[Ne,ee]=r(ir),[xe,te]=r(null),[Ue,re]=r(null),[Ae,oe]=r(null),[Le,ne]=r(null),[ze,ie]=r(null),ae=g(null),n=g(!1);f(()=>{y(yr()),G(Gr())},[]);const Ye=o(e=>{n.current=!0,vr(),fe(e),y(e)},[]),je=o(e=>{n.current=!0,ge(e),G(e)},[]),Ke=o(e=>{n.current=!0,N(i=>At(i,e,c??""))},[c]),Ve=o(e=>{n.current=!0,x(e)},[]),Xe=o(e=>{n.current=!0,U(e)},[]),Ze=o(e=>{n.current=!0,A(e)},[]),qe=o(e=>{n.current=!0,L(e)},[]),Je=o(e=>{n.current=!0,z(e)},[]),Qe=o(e=>{n.current=!0,Y(e)},[]),$e=o(e=>{n.current=!0,j(e)},[]),et=o(e=>{n.current=!0,K(e)},[]),tt=o(e=>{n.current=!0,ee(e)},[]),[rt,ce]=r(null),[ot,nt]=r(null),it=o(e=>{n.current=!0,ce(e)},[]),at=o(e=>{n.current=!0,V(e)},[]),ct=o(e=>{n.current=!0,X(e)},[]),st=o(e=>{n.current=!0,Z(e)},[]),dt=o(e=>{n.current=!0,q(e)},[]),ht=o(e=>{n.current=!0,J(e)},[]),ut=o(e=>{n.current=!0,te(e)},[]),lt=o(e=>{n.current=!0,re(e)},[]),mt=o(e=>{n.current=!0,oe(e)},[]),pt=o(e=>{n.current=!0,ne(e)},[]),St=o(e=>{n.current=!0,ie(e)},[]);f(()=>{const e=k(l).theme;if(!h||!s.hasSiteTheme||!e)return;const i=c??"";ae.current!==i&&(ae.current=i,n.current=!1);let u=!1;return e.get(c?{siteId:c}:void 0).then(t=>{if(u||n.current)return;fe(t.default_mode),ge(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),N(Lt({selected:t.selected_preset,themes:t.theme_presets},i));const C=Cr(t);x(C.fonts),U(C.sizes);const S=Dt(t);Q(S),A(t.corner_radius_px===void 0?or[sr(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,cr)),L(C.compression),z(t.card_shadow==null?lr:dr(t.card_shadow)),j(t.card_gap==null?me:hr(t.card_gap)),K(t.hover_effect==null?mr:ur(t.hover_effect)),Y(Sr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,It)),X(w(t.site_gutter,S.siteGutterUnit,Bt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Ft)),q(w(t.block_gap,S.blockGapUnit,le)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,le)),ee(C.typography),ce(C.textStyles),nt(_r(t)),te(t.hero_background_follows_width===!0),re(ue(t.section_background_width)),oe(ue(t.section_content_width)),ne(t.photography_grayscale===!0),ie(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[h,c,s.hasSiteTheme,l]);const ft=Xt({token:h,siteId:c,enabled:s.hasSiteSettings}),[gt,se]=r(Kt),de=g(null),W=g(!1),m=g(null),p=g({}),P=o(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(l).chat?.update(e,c?{siteId:c}:void 0),Et()}catch(i){throw p.current={...e,...p.current},i}},[l,c]);f(()=>yt(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const wt=o(e=>{W.current=!0,se(i=>({...i,...e})),!(!s.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[s.hasSiteSettings,h,P]);return f(()=>{if(!h||!s.hasSiteSettings)return;const e=c??"";de.current!==e&&(de.current=e,W.current=!1);let i=!1;const u=k(l).chat;if(u)return u.get(c?{siteId:c}:void 0).then(t=>{i||W.current||se(Pr(t))}).catch(()=>{}),()=>{i=!0}},[h,c,s.hasSiteSettings,l]),f(()=>{const e=d.site;if(!_||!s.hasSiteRecord||!e){O(null);return}let i=!1;return e().then(u=>{i||O(Rt(u.name))}).catch(()=>{}),()=>{i=!0}},[_,h,s.hasSiteRecord,c,d]),a(Mt,{config:be,parts:gr,wrap:(e,i)=>a(xt,{websiteName:Ce,templateChrome:E,templateName:_e||null,themeMode:Pe,onThemeModeChange:Ye,themeSwitchShown:Te,onThemeSwitchShownChange:je,theme:Ee,themeRow:Ut(s.hasSiteTheme,b.readFor,c??""),onThemeChange:Ke,fonts:ye,onFontsChange:Ve,cornerRadiusPx:ve,onCornerRadiusPxChange:Ze,cardShadow:We,onCardShadowChange:Je,shadowColor:ke,onShadowColorChange:Qe,cardGap:Re,onCardGapChange:$e,hoverEffect:Be,onHoverEffectChange:et,headingCompression:He,onHeadingCompressionChange:qe,headingTypography:Ne,onHeadingTypographyChange:tt,textStyles:rt,onTextStylesChange:it,wordStyles:ot,sizes:Ge,onSizesChange:Xe,siteWidth:Fe,onSiteWidthChange:at,siteGutter:Ie,onSiteGutterChange:ct,siteGutterPhone:De,onSiteGutterPhoneChange:st,blockGap:v,onBlockGapChange:dt,blockGapPhone:H,onBlockGapPhoneChange:ht,siteLengthUnits:Oe,onSiteLengthUnitsChange:Me,heroBackgroundFollowsWidth:xe,onHeroBackgroundFollowsWidthChange:ut,sectionBackgroundWidth:Ue,onSectionBackgroundWidthChange:lt,sectionContentWidth:Ae,onSectionContentWidthChange:mt,photographyGrayscale:Le,onPhotographyGrayscaleChange:pt,shareButtonOnPosts:ze,onShareButtonOnPostsChange:St,themeFromDocument:!s.hasSiteTheme,children:a(zt,{chromeRootProps:we,children:a(Tt,{wrap:l.chrome?.wrap,surface:"page",children:a(Jt,{children:a(Qt,{children:a($t,{children:a(tr,{children:a(er,{children:Ct(rr,{children:[a(jt,{chat:gt,onChatChange:wt,children:a(Vt,{value:ft,children:a(Zt,{children:a(Wt,{children:a(bt,{children:e})})})})}),i]})})})})})})})})})})}function Wr({target:d,openAddPage:s}){return a(kt,{open:s,children:a(Ot,{target:d,addressing:qt,onHostMessage:wr,children:a(Hr,{})})})}export{Wr as default};
|
|
@@ -1673,7 +1673,14 @@
|
|
|
1673
1673
|
its two lines of words, the gap above "From your template", and the card.
|
|
1674
1674
|
The window is portalled to <body>, outside the screen's `.sf-editor` scope,
|
|
1675
1675
|
so it reads the shell's own root tokens (`--ink*`, `--line`). */
|
|
1676
|
+
/* The card area fills the shell SidebarLayout's content column and scrolls its
|
|
1677
|
+
own overflow (the layout's contract: a child that fills the pane takes
|
|
1678
|
+
`min-h-0 flex-1`), so the last card can be reached. The sidebar keeps its
|
|
1679
|
+
own scroll. */
|
|
1676
1680
|
.sf-add-page {
|
|
1681
|
+
flex: 1 1 0%;
|
|
1682
|
+
min-height: 0;
|
|
1683
|
+
overflow-y: auto;
|
|
1677
1684
|
padding: var(--space-32) var(--space-48);
|
|
1678
1685
|
}
|
|
1679
1686
|
/* The main area takes the window's first focus (initialFocus), so a mouse
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import p from"../../../../../components/LocationsGroupedField.js";import{splitLegacyRegion as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{group as p}from"efficient-easel/screen/lib/document/box-fields";import m from"../../../../../components/LocationsGroupedField.js";import{splitLegacyRegion as l}from"../../../../../../format/lib/content/contact.js";import{BLOCK_SOURCE_ROWS_PROP as f}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as d,blockSourceFields as u}from"../../../block-source-fields.js";import{needsGeocodeWork as g,resolveGeocodeRows as S}from"../../../geocode-resolve.js";const k={fields:{_gOffices:p("Offices"),dataSource:d("Location content","Manual"),locations:{type:"custom",render:({value:o,onChange:r})=>a(m,{value:o,onChange:r})}},resolveData:async o=>{const r=o.props,t=r.locations??[];if(!g(t))return o;const n=await S(t,e=>{const s=l(e.region);return[String(e.address??"").replace(/\s*\n+\s*/g,", "),e.name,String(e.state??"").trim()||s.state,String(e.country??"").trim()||s.country].map(c=>String(c??"").trim()).filter(Boolean).join(", ")}),{[f]:y,...i}=r;return{...o,props:{...i,locations:n}}},resolveFields:(o,{fields:r})=>u("ContactLocations",r,o.props)};export{k as ContactLocationsFields};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { type FootprintOffice } from "../../../../../../format/lib/content/footprint.js";
|
|
1
2
|
import type { BlockFields } from "../../../../../../format/lib/document/blocks/block-types.js";
|
|
3
|
+
export declare function resolveOfficeCoords(offices: readonly FootprintOffice[]): Promise<readonly FootprintOffice[]>;
|
|
2
4
|
export declare const FootprintFields: BlockFields;
|
|
5
|
+
export declare const FOOTPRINT_OFFICES_FIELD: import("efficient-easel/blocks").Field<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as C,FOOTPRINT_LIST_COLUMNS as H,FOOTPRINT_LIST_COLUMNS_DEFAULT as I,FOOTPRINT_MAP_HEIGHT_DEFAULT as g,FOOTPRINT_MAP_HEIGHT_FULL as v,FOOTPRINT_MAP_HEIGHT_KEY as A,FOOTPRINT_SHOWS_DEFAULT as i,FOOTPRINT_SHOWS_KEY as a}from"../../../../../../format/lib/content/footprint.js";import{ColumnsIcon as N,HeadquartersIcon as w,HeightIcon as D,LayoutIcon as M,LocationIcon as k,MapIcon as x,SearchIcon as B,ThemeIcon as U}from"efficient-easel/icons";import{CoordsField as G,copyText as W,plainText as n,sourceField as K,text as p,textarea as E,toggle as f,withPanelOnly as L}from"../../../controls.js";import{group as d}from"efficient-easel/screen/lib/document/box-fields";import{segmented as c}from"../../../box-fields.js";import{withShowWhen as l}from"../../../../../../render/lib/document/show-when.js";import{needsGeocodeWork as j,resolveGeocodeRows as q}from"../../../geocode-resolve.js";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{SPLITTABLE_SECTIONS as Y,headFieldsForPlacement as Q}from"../../../../../../format/lib/sections/section-head-placement.js";import{BLOCK_SOURCE_PROP as u,DEALERS_SOURCE as z,registerBlockSources as J}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as V,blockSourceFields as X}from"../../../block-source-fields.js";import{DEALERS_BLOCK_SOURCE as Z}from"../../../../../../render/lib/dealer-source.js";import{SITE_OFFICES_BLOCK_SOURCE as $}from"../../../../../../format/lib/content/site-offices.js";import{FOOTPRINT_PH as m,FootprintSlots as ee}from"../../../../../../format/lib/document/blocks/general/Footprint/meta.js";import{withFootprintListTemplate as oe}from"../../../../../../format/lib/document/blocks/general/Footprint/card-seed.js";const P={field:u,is:z,default:""},O={field:a,is:i,default:i},te={field:a,is:"list",default:i},le={field:a,is:"map",default:i},y={all:[O,{field:"listPosition",in:["left","right"],default:"below"}]},b={any:[{all:[P,{not:le}]},y]},ie={any:[{all:[O,{field:"listPosition",is:"below",default:"below"}]},te]},R={all:[b,{field:"search",is:!0,default:!1}]};J([Z,$]);async function re(e){return j(e)?q(e,t=>[t.address,t.city,t.country].map(s=>String(s??"").replace(/\*/g,"").trim()).filter(Boolean).join(", ")):e}const se={fields:{_gContent:d("Section"),sectionNumber:p("Section number",m.sectionNumber),heading:E("Heading",m.heading),tagline:E("Body",m.tagline),_gOffices:d("Offices"),[u]:V("Office content","Manual"),offices:{type:"array",label:"Offices",arrayFields:{role:n("Role"),city:n("City"),country:n("Region · country"),address:W("Address"),phone:n("Phone"),group:n("Group"),hq:f("HQ",!1,o(w,{})),geocode:K(G,{label:"Coordinates"})},defaultItemProps:{role:"Sales & Distribution",city:"City",country:"Country",address:"",phone:"",group:"",hq:!1,lat:0,lng:0},getItemSummary:e=>e?.city||"Office"},...ee,[a]:c("Shows",o(x,{}),[{label:"Map and list",value:i},{label:"Map only",value:"map"},{label:"List only",value:"list"}],i),mapTheme:c("Map theme",o(U,{}),[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],C.mapTheme),_gList:d("List"),listPosition:r("desktop",l(c("Position",o(M,{}),[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Below",value:"below"}],"below"),O)),listColumns:r("desktop",l(c("Columns",o(N,{}),[{label:"Auto",value:I},...H.map(e=>({label:String(e),value:String(e)}))],I),ie)),[A]:r("desktop",l(c("Map height",o(D,{}),[{label:"Fixed",value:g},{label:"Full height",value:v}],g),y)),search:r("desktop",l(f("Search",!1,o(B,{})),b)),searchHint:r("desktop",l(L(p("Hint","Type a postcode or address")),R)),noMatchText:r("desktop",l(L(p("No match","No place found. Try another postcode.")),R)),showDistance:l(f("Distance",!0,o(k,{})),P)},resolveData:async(e,t)=>{const s=t?.changed,S=e.props;if(s?.listPosition===!0||s?.[a]===!0||s?.[u]===!0){const F=oe(S);F!==S&&(e={...e,props:F})}const T=e.props,h=T.offices??[],_=await re(h);return _===h?e:{...e,props:{...T,offices:[..._]}}},resolveFields:(e,{fields:t})=>Q(X("Footprint",t,e.props,{hides:["offices"]}),e.props.headPlacement,Y.Footprint.headRows)},Ee=se.fields.offices;export{Ee as FOOTPRINT_OFFICES_FIELD,se as FootprintFields,re as resolveOfficeCoords};
|
|
@@ -8,6 +8,7 @@ import { readHidable, hidableText, type HidableValue } from "efficient-easel/dra
|
|
|
8
8
|
import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, foldMetaOf, textFieldIdentifier, type EdgeCell, type FoldFieldMeta, type TextFieldMeta, type TextListRendering } from "efficient-easel/draw";
|
|
9
9
|
import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
|
|
10
10
|
import { CARD_IMAGE_RADIUS_ROW } from "../../../format/lib/content/card-image-shape.js";
|
|
11
|
+
import type { PhonePlace } from "../../../render/components/PhoneMenuTools.js";
|
|
11
12
|
import { FOCAL_DEFAULT, type UnitChoice as ShellUnitChoice } from "efficient-shell/ui";
|
|
12
13
|
import { type ColourChoice } from "./ColourControl.js";
|
|
13
14
|
import { type DeviceTier } from "efficient-easel/screen/lib/document/device-fields";
|
|
@@ -216,6 +217,7 @@ export declare function cardCornersField(): CustomField<number | null>;
|
|
|
216
217
|
export declare function cardShapeFields(): Record<string, unknown>;
|
|
217
218
|
export declare function boxShareField(): CustomField<unknown>;
|
|
218
219
|
export declare function boxBlockSpacingField(): SelectField;
|
|
220
|
+
export declare function phonePlaceField(fallback: PhonePlace): SelectField;
|
|
219
221
|
export declare function boxSharePhoneField(): {
|
|
220
222
|
options: {
|
|
221
223
|
showWhen?: ShowWhenRule | undefined;
|
|
@@ -299,6 +301,7 @@ type StickNumberKey = "stickTopDistance" | typeof SECTION_PIN_SCREENS_KEY;
|
|
|
299
301
|
export declare function followedStickPatch(view: PanelView, props: Record<string, unknown>, next: unknown, base?: StickNumberKey, intro?: boolean): Record<string, unknown> | null;
|
|
300
302
|
export declare function anchorFields(): Record<string, CustomField<undefined> | CustomField<HidableValue>>;
|
|
301
303
|
export declare function customCssFields(): Record<string, CustomField<undefined> | CustomField<string>>;
|
|
304
|
+
export declare const CUSTOM_CSS_ROW: CustomField<string>;
|
|
302
305
|
export declare function dateTime(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
|
|
303
306
|
export declare function date(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
|
|
304
307
|
export declare function toggle(label: string, fallback: boolean, icon?: ReactNode, hint?: string): CustomField<boolean>;
|