efficient-web-builder 64.0.0 → 65.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 +28 -0
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/scroll-fields.js +1 -1
- package/dist/editor/lib/animation/view-rows.d.ts +20 -0
- package/dist/editor/lib/animation/view-rows.js +1 -0
- package/dist/editor/lib/document/blocks/general/FAQ/fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +1 -0
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/part-motion-canvas.d.ts +2 -2
- package/dist/editor/lib/document/part-motion-canvas.js +1 -1
- package/dist/format/lib/animation/entrance-keys.d.ts +8 -0
- package/dist/format/lib/animation/entrance-keys.js +1 -0
- package/dist/format/lib/animation/scroll.d.ts +5 -6
- package/dist/format/lib/animation/scroll.js +1 -1
- package/dist/format/lib/animation/views.d.ts +6 -0
- package/dist/format/lib/animation/views.js +1 -0
- package/dist/format/lib/content/section-sticky.d.ts +28 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +1 -0
- package/dist/format/lib/editor-words-catalogue.d.ts +6 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/source-rules/motion-vars-from-the-shell.d.ts +6 -0
- package/dist/format/lib/source-rules/motion-vars-from-the-shell.js +4 -0
- package/dist/render/components/HeroPictures.d.ts +2 -5
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/PictureZoom.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/SectionAnimation.d.ts +8 -16
- package/dist/render/components/SectionAnimation.js +1 -1
- package/dist/render/lib/animation/entrance.d.ts +6 -14
- package/dist/render/lib/animation/entrance.js +1 -1
- package/dist/render/lib/animation/part-motion.js +2 -2
- 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-editorial.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +1 -0
- package/dist/render/lib/document/passes/section-animation.js +1 -1
- package/dist/render/lib/document/passes/section-sticky.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +3 -3
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
4
|
-
import type { ScrollView } from "../../format/lib/animation/scroll.js";
|
|
2
|
+
import { ENTRANCE_WRAPPER_CLASS, type EntranceViews } from "../lib/animation/entrance.js";
|
|
3
|
+
import type { MotionView } from "../../format/lib/animation/views.js";
|
|
5
4
|
export { ENTRANCE_WRAPPER_CLASS };
|
|
6
|
-
export declare function SectionAnimation({
|
|
7
|
-
|
|
8
|
-
phone: EntranceValue;
|
|
5
|
+
export declare function SectionAnimation({ views, editing, boxClass, boxAttrs, boxStyle, takesViewHide, atEdge, children, }: {
|
|
6
|
+
views: EntranceViews;
|
|
9
7
|
editing: boolean;
|
|
10
8
|
boxClass?: string;
|
|
11
9
|
boxAttrs?: Readonly<Record<string, string>>;
|
|
@@ -14,13 +12,10 @@ export declare function SectionAnimation({ desktop, phone, editing, boxClass, bo
|
|
|
14
12
|
atEdge?: boolean;
|
|
15
13
|
children: ReactNode;
|
|
16
14
|
}): ReactNode;
|
|
17
|
-
export type SeenEntrance =
|
|
18
|
-
readonly desktop: string;
|
|
19
|
-
readonly phone: string;
|
|
20
|
-
};
|
|
15
|
+
export type SeenEntrance = Readonly<Record<MotionView, string>>;
|
|
21
16
|
export declare const entranceReplay: {
|
|
22
|
-
seed(
|
|
23
|
-
next(seen: SeenEntrance,
|
|
17
|
+
seed(views: EntranceViews): SeenEntrance;
|
|
18
|
+
next(seen: SeenEntrance, views: EntranceViews, view: MotionView): {
|
|
24
19
|
play: boolean;
|
|
25
20
|
seen: SeenEntrance;
|
|
26
21
|
};
|
|
@@ -28,7 +23,4 @@ export declare const entranceReplay: {
|
|
|
28
23
|
export declare function phoneMediaOf(atEdge: boolean): string;
|
|
29
24
|
export declare function useViewWidth(ref: {
|
|
30
25
|
current: HTMLElement | null;
|
|
31
|
-
}, enabled?: boolean, atEdge?: boolean):
|
|
32
|
-
export declare function usePhoneWidth(ref: {
|
|
33
|
-
current: HTMLElement | null;
|
|
34
|
-
}, enabled?: boolean, atEdge?: boolean): boolean;
|
|
26
|
+
}, enabled?: boolean, atEdge?: boolean): MotionView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as M}from"react/jsx-runtime";import{NO_HIDE as S,useTakeViewHide as L,withViewHide as v}from"./ViewHideRoot.js";import{useEffect as E,useRef as g,useState as A}from"react";import{armEntrance as R,entranceAttrs as V,playEntrance as b}from"efficient-shell/format";import{useCellLayer as J,useInBox as _}from"./InBoxContext.js";import{ENTRANCE_WRAPPER_CLASS as N}from"../lib/animation/entrance.js";import{viewMediaOf as x}from"../lib/document/part-styles.js";function W({views:e,editing:n,boxClass:r,boxAttrs:s,boxStyle:c,takesViewHide:p=!1,atEdge:u=!1,children:f}){const o=g(null),i=J(),a=L(),t=p?a:S,d=$(o,!0,u),{attrs:O,style:h}=V(e[d]),y=g(m.seed(e)),k=JSON.stringify(e);return E(()=>{const l=o.current;if(l){if(n){const w=m.next(y.current,e,d);y.current=w.seen,w.play&&b(l);return}return R(l)}},[k,d,n]),t.scope(M("div",{ref:o,className:v(`${N}${i.fill}${r?` ${r}`:""}`,t.className),...s,...t.attrs,...O,...Object.keys(h).length||c?{style:{...c,...h}}:{},children:i.inner(f)}))}const m={seed(e){return{desktop:JSON.stringify(e.desktop),tablet:JSON.stringify(e.tablet),phone:JSON.stringify(e.phone)}},next(e,n,r){const s=m.seed(n);return{play:s[r]!==e[r],seen:s}}};function B(e){return x(e).phone}function $(e,n=!0,r=!1){const[s,c]=A("desktop"),p=_()||r,{phone:u,tablet:f}=x(p);return E(()=>{if(!n)return;const o=e.current?.ownerDocument?.defaultView??(typeof window>"u"?null:window);if(!o?.matchMedia)return;const i=o.matchMedia(u),a=o.matchMedia(f),t=()=>c(i.matches?"phone":a.matches?"tablet":"desktop");return t(),i.addEventListener("change",t),a.addEventListener("change",t),()=>{i.removeEventListener("change",t),a.removeEventListener("change",t)}},[e,n,u,f]),s}export{N as ENTRANCE_WRAPPER_CLASS,W as SectionAnimation,m as entranceReplay,B as phoneMediaOf,$ as useViewWidth};
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { type EntranceValue } from "efficient-shell/format";
|
|
2
|
+
import { type MotionView } from "../../../format/lib/animation/views.js";
|
|
3
|
+
export { ENTRANCE_KEYS, ENTRANCE_STORE_KEYS, LEGACY_ENTRANCE_KEY } from "../../../format/lib/animation/entrance-keys.js";
|
|
2
4
|
export declare const ENTRANCE_WRAPPER_CLASS = "sf-entrance";
|
|
3
|
-
export declare const ENTRANCE_KEYS: {
|
|
4
|
-
readonly kind: "entrance";
|
|
5
|
-
readonly from: "entranceFrom";
|
|
6
|
-
readonly duration: "entranceDuration";
|
|
7
|
-
readonly delay: "entranceDelay";
|
|
8
|
-
};
|
|
9
|
-
export declare const LEGACY_ENTRANCE_KEY = "sectionAnimation";
|
|
10
|
-
export type EntranceView = "desktop" | "phone";
|
|
11
5
|
type Props = Readonly<Record<string, unknown>>;
|
|
12
|
-
export declare function entranceOf(props: Props, view:
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} | null;
|
|
6
|
+
export declare function entranceOf(props: Props, view: MotionView): EntranceValue;
|
|
7
|
+
export type EntranceViews = Readonly<Record<MotionView, EntranceValue>>;
|
|
8
|
+
export declare const entranceViews: (props: Props) => EntranceViews;
|
|
9
|
+
export declare function entranceDrawn(props: Props): EntranceViews | null;
|
|
17
10
|
export declare const ENTRANCE_EXCLUDED_WHY: Readonly<Record<string, string>>;
|
|
18
11
|
export declare const ENTRANCE_EXCLUDED: ReadonlySet<string>;
|
|
19
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{readEntrance as a}from"efficient-shell/format";import{SECTION_THEME_EXCLUDED as s}from"../../../format/lib/content/section-surface.js";import{ENTRANCE_KEYS as i,LEGACY_ENTRANCE_KEY as c}from"../../../format/lib/animation/entrance-keys.js";import{MOTION_VIEWS as E,followedIn as d}from"../../../format/lib/animation/views.js";import{ENTRANCE_KEYS as x,ENTRANCE_STORE_KEYS as R,LEGACY_ENTRANCE_KEY as S}from"../../../format/lib/animation/entrance-keys.js";const C="sf-entrance",l=e=>e!=null&&e!=="";function f(e,t){const o=e[i[t]];return t==="kind"&&!l(o)?e[c]:o}const n=(e,t,o)=>d(e,i[t],o,f(e,t));function r(e,t){return a(n(e,"kind",t),n(e,"from",t),n(e,"duration",t),n(e,"delay",t))}const m=e=>({desktop:r(e,"desktop"),tablet:r(e,"tablet"),phone:r(e,"phone")});function k(e){const t=m(e);return E.every(o=>t[o].kind==="none")?null:t}const u={...Object.fromEntries([...s].map(e=>[e,"a root position: sticky bar; an outer box becomes its sticky containing block and the pin collapses (the same fact every wrapper pass excludes it for, lib/content/section-surface)"])),HeroSlide:"a slide is a direct child of the Hero's transform track ([&>*]:basis-full); a wrapper would take its width, and the Hero already moves one slide in at a time",HeroGroup:"a slide box is placed by grid-item properties on its own root (--sf-hg-row, justify-self); a wrapper becomes the grid item and the box loses its anchor (lib/document/blocks/general/HeroGroup/meta)"},h=new Set(Object.keys(u));export{h as ENTRANCE_EXCLUDED,u as ENTRANCE_EXCLUDED_WHY,x as ENTRANCE_KEYS,R as ENTRANCE_STORE_KEYS,C as ENTRANCE_WRAPPER_CLASS,S as LEGACY_ENTRANCE_KEY,k as entranceDrawn,r as entranceOf,m as entranceViews};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`),t.head.appendChild(e)}export{
|
|
1
|
+
import{ENTRANCE_STATE_ATTR as u,entranceAttrs as m,scrollAttrs as E}from"efficient-shell/format";import{ENTRANCE_KEYS as O,ENTRANCE_STORE_KEYS as d,ENTRANCE_WRAPPER_CLASS as _,entranceDrawn as T}from"./entrance.js";import{CARD_HOVER_KEYS as f,HOVER_KEY as l,hoverOf as R}from"../../../format/lib/animation/hover.js";import{SCROLL_KEYS as S,SCROLL_STORE_KEYS as A,scrollDrawn as P}from"../../../format/lib/animation/scroll.js";import{propsWithPartRecord as y,readPartRecord as N,readPartRecords as h}from"../../../format/lib/document/part-records.js";import{partLiftRules as L}from"../document/part-styles.js";const k={},c="_partMotion",H=[...d,l,f.duration,f.delay,...A];function W(t){return h(t,c)}function w(t,e){return N(t,c,e)}const C=new Set([O.kind,l,S.effect]);function F(t,e,r,o){const{[r]:s,...n}=w(t,e),a=o==null||o===""||o==="none"&&C.has(r)?n:{...n,[r]:o};return y(t,c,e,Object.keys(a).length?a:null)}function x(t){return{entrance:T(t),hover:R(t),scroll:P(t)}}function V(t){const e=x(t);return e.entrance!==null||e.hover!=="none"||e.scroll!==null}function B(t,e){const{attrs:r,style:o}=m(e),s=Object.keys(r).filter(n=>r[n]!==void 0);for(const n of s)t.setAttribute(n,String(r[n]));for(const[n,i]of Object.entries(o))t.style.setProperty(n,String(i));return()=>{for(const n of s)t.removeAttribute(n);for(const n of Object.keys(o))t.style.removeProperty(n);t.removeAttribute(u)}}function U(t,e){const{attrs:r,style:o}=E(e);for(const[s,n]of Object.entries(r))t.setAttribute(s,n);for(const[s,n]of Object.entries(o))t.style.setProperty(s,n);return()=>{for(const s of Object.keys(r))t.removeAttribute(s);for(const s of Object.keys(o))t.style.removeProperty(s)}}const j=4;function $(t){let e;for(const r of t)(!e||r.element.compareDocumentPosition(e.element)&j)&&(e=r);return e}const v="data-sf-part-host";function q(t){const e=t?.ownerDocument.defaultView;let r=t;for(;r&&!r.hasAttribute(v)&&!r.classList.contains(_);){const o=e?.getComputedStyle(r).display??"";if(o==="contents")return null;if(o!=="inline")return r;r=r.parentElement}return null}const M="data-sf-part-lift",p="sf-part-lift";function z(t){if(t.getElementById(p))return;const e=t.createElement("style");e.id=p,e.textContent=L(`[${M}]`).join(`
|
|
2
|
+
`),t.head.appendChild(e)}export{k as NO_MOTIONS,v as PART_HOST_ATTR,M as PART_LIFT_ATTR,H as PART_MOTION_KEYS,c as PART_MOTION_PROP,B as drawPartEntrance,U as drawPartScroll,z as ensurePartLiftSheet,$ as firstOnPage,q as partBoxOf,x as partMotionDrawn,V as partMoves,F as propsWithPartMotion,w as readPartMotion,W as readPartMotions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SECTION_WIDTH_KEYS as
|
|
1
|
+
import{SECTION_WIDTH_KEYS as D}from"../../../../../format/lib/content/section-width.js";import{BOX as w,INNER_BOX as C,LABEL_FACE as I,TEXT as U,boxPadding as v,fillSlot as _,token as y}from"../../../../../format/lib/document/seed-parts.js";import{ENTRANCE_STORE_KEYS as F,LEGACY_ENTRANCE_KEY as M}from"../../../animation/entrance.js";import{SCROLL_STORE_KEYS as K}from"../../../../../format/lib/animation/scroll.js";import{SECTION_PIN_KEYS as Y}from"../../../../../format/lib/content/section-sticky.js";import{CARD_HOVER_KEYS as E}from"../../../../../format/lib/animation/hover.js";import{COUNT_KEY_PROP as X}from"../../../../../format/lib/content/block-sources.js";import{normalizeSiteGutter as G}from"../../../../../format/lib/content/page-width.js";import{resolveSectionPadding as V}from"../../../content/section-padding.js";import{ButtonBlockMeta as $}from"../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";import{SECTION_PAD_INNER_DEFAULTS as j}from"../../passes/section-padding.js";import{finiteNumber as p}from"../../../../../format/lib/finite-number.js";import{convertTheme as P,hasWords as J}from"../../../sections/section-to-box.js";import{THEME_SECTION_BG as z}from"../../../../../format/lib/content/section-background.js";import{fillSlotOfInk as A}from"../../../../../format/lib/document/part-inks.js";import{parseHexColor as q}from"efficient-shell/format";import{convertLength as Q,isLengthUnit as Z}from"efficient-easel/screen/lib/content/length-units";import{bandPresetIndex as tt,surfacePresetIndex as ot,surfaceTwoTone as et}from"../../../../../format/lib/theme.js";import{VIEW_HIDE_KEYS as nt}from"../../../../../format/lib/content/view-hide-class.js";const B=t=>Z(t)?t:"px",r=(t,o,e,n)=>o===e?t:Q(t,o,e,n,{min:0,max:200,step:4});import{BOX as so,DIM as ro,INNER_BOX as co,TEXT as ao}from"../../../../../format/lib/document/seed-parts.js";const Ht={textFit:"line",textFitPhone:"wrap"},it={...U,[X]:""},{label:Lt,href:kt,...st}=$.defaultProps,Wt=st,Dt={buttonFillOpacity:0,buttonBorder:{width:0},buttonPaddingTop:0,buttonPaddingRight:0,buttonPaddingBottom:0,buttonPaddingLeft:0},wt={...w,sectionAccent:0},vt={sectionAccent:-1},yt=["gridSpan","sectionHeightMode","sectionHeightValue","sectionHeightUnit","sectionHeightModeTablet","sectionHeightValueTablet","sectionHeightUnitTablet","sectionHeightModePhone","sectionHeightValuePhone","sectionHeightUnitPhone","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone","sectionAccent",...Y,"anchor",M,...nt,...F,...K,"widthFit","widthFitTablet","widthFitPhone","width","widthTablet","widthPhone","minWidth","minWidthTablet","minWidthPhone","maxWidth","maxWidthTablet","maxWidthPhone",...Object.values(D)],c="a section width key, ignored since efficient-web-builder 45 (an old key; a section's own width has new keys, lib/content/section-width), so dropping it changes nothing",Ft={sectionSurface:"read by nothing in src/ (searched 2026-10-24): a retired theme key that draws nothing today, so dropping it changes nothing",widthMode:c,fullWidth:c,pageWidth:c,backgroundWidth:c,contentWidth:c,contentMax:c},Mt=Object.fromEntries(["sectionPaddingLeft","sectionPaddingRight","sectionPaddingLeftTablet","sectionPaddingRightTablet","sectionPaddingLeftPhone","sectionPaddingRightPhone"].map(t=>[t,"needs Box side padding outside its gutter: the old section added it outside its frame, a Box's side padding replaces the gutter. 0 live nodes store it (JJ's read-only export, 2026-10-24)"]));function rt(t,o){const e=p(t.sectionPaddingTop)??0,n=p(t.sectionPaddingBottom)??0,i=p(t.sectionPaddingTopTablet),s=p(t.sectionPaddingBottomTablet),l=B(t.sectionPaddingUnit),g=B(t.sectionPaddingUnitTablet),T=B(t.sectionPaddingUnitPhone),O=(h,a,x,m)=>{const d=p(h);if(d!==void 0)return d+r(m,"px",T,"mobile");const N=a===void 0?{n:x,unit:l}:{n:a,unit:g};return r(N.n,N.unit,T,"mobile")+r(m,"px",T,"mobile")},S=(h,a,x,m,d)=>a!==void 0?{[h]:a+r(d??m,"px",g,"tablet")}:d===void 0?{}:{[h]:r(x,l,g,"tablet")+r(d,"px",g,"tablet")};return{sectionPaddingTop:e+r(o.top,"px",l,"desktop"),sectionPaddingBottom:n+r(o.bottom,"px",l,"desktop"),...S("sectionPaddingTopTablet",i,e,o.top,o.topTablet),...S("sectionPaddingBottomTablet",s,n,o.bottom,o.bottomTablet),sectionPaddingTopPhone:O(t.sectionPaddingTopPhone,i,e,o.topPhone),sectionPaddingBottomPhone:O(t.sectionPaddingBottomPhone,s,n,o.bottomPhone)}}const Kt=t=>[...["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopTablet","sectionPaddingBottomTablet","sectionPaddingTopPhone","sectionPaddingBottomPhone"].map(o=>[o,o,(e,n)=>rt(n,typeof t=="function"?t(n):t)[o]]),["sectionPaddingUnit","sectionPaddingUnit"],["sectionPaddingUnitTablet","sectionPaddingUnitTablet"],["sectionPaddingUnitPhone","sectionPaddingUnitPhone"]];function f(t,o){const e=V(t,j[o]);return{sectionPaddingTop:e.top,sectionPaddingBottom:e.bottom}}const Yt=t=>[["padTop","sectionPaddingTop",(o,e)=>f(e,t).sectionPaddingTop],["padBottom","sectionPaddingBottom",(o,e)=>f(e,t).sectionPaddingBottom],["sectionPaddingTop","sectionPaddingTop",(o,e)=>f(e,t).sectionPaddingTop],["sectionPaddingBottom","sectionPaddingBottom",(o,e)=>f(e,t).sectionPaddingBottom]],dt={kind:"heading-case-upper",styles:["heading-1","heading-2","heading-3"]},Xt=t=>o=>J(o.props[t])?[dt]:[],ct=(t,o)=>({kind:"text",key:t,role:"eyebrow",props:U,...o?{style:o}:{}}),Gt=t=>({kind:"group",name:"Chip",props:{...C,..._("main"),...v(6,14)},parts:[ct(t,{color:"background",...y("label",12),weight:600,letterSpacing:.16})]}),R=t=>t.background!=="transparent",at=(t,o)=>{const[e,n]=[t,o].map(i=>typeof i=="string"?i.trim():"");return e?n?`[${e} ]{color=text}${n}`:`[${e}]{color=text}`:n},H={align:"right",alignPhone:"left"},pt=(t,o,e)=>{const n=i=>at(i[t],i[o]);return{kind:"block",type:"Text",when:(i,s)=>s!==void 0&&n(s)!=="",box:[[t,"text",(i,s)=>n(s)],[o,"text",(i,s)=>n(s)]],props:e}},Vt=(t,o,e,n={})=>pt(t,o,{...it,...H,...n,_partStyles:{text:{...I,color:"labels",...e,case:I.case,...H}}}),u=(t,o)=>typeof t=="number"&&Number.isInteger(t)&&t>=0?t:P(o)?.selected??0,L="var(--site-surface-2)",k=(t,o)=>P(o)?.themes[u(t.sectionAccent??0,o)],lt=(t,o)=>(e,n)=>{if(!o?.(e,n))return _(t);const i=k(e,n)?.[t];return i?{fillColor:i}:{}},$t=(t,o)=>b(t,o)>=0,W=t=>t.startsWith("#")&&q(t)!==null,jt=(t,o,e)=>{const n=t?.trim();if(n&&W(n))return{fillColor:n};const i=A(n);if(i)return _(i);const s=n===L?k(o,e):void 0;return s?{fillColor:et(s)}:{}},Jt=t=>{const o=t?.trim();return!o||o==="transparent"||o===z||A(o)||o===L||W(o)?void 0:"it paints a colour that no Box Fill can hold"},b=(t,o)=>{const e=P(o)?.themes;return e&&R(t)?tt(e,u(t.sectionAccent,o)):-1},zt=(t,o,e)=>{const n=b(o,e);return n>=0?n:t},qt=(t,o)=>{const e=P(o)?.themes,n=e?ot(e,u(t,o)):-1;return n>=0?n:t},Qt=(t,o)=>{const e=b(t,o);return e>=0?{sectionAccent:e}:{}},Zt=(t,o)=>R(t.props)&&b(t.props,o)<0?[{kind:"band-preset",page:u(t.props.sectionAccent,o)}]:[],to=t=>G(t.site?.siteGutter),gt=Object.fromEntries(["Top","Right","Bottom","Left","TopPhone","RightPhone","BottomPhone","LeftPhone"].map(t=>[`sectionPadding${t}`,0])),oo=t=>({top:0,right:0,bottom:0,left:0,...t}),eo=(t,o,e,n=[])=>({kind:"group",name:t,keepEmpty:!0,props:(i,s)=>({...C,...gt,...lt("surface")(i,s),...typeof e=="function"?e(i,s):e}),box:[[o,"bgImage"],E.kind,E.duration,E.delay],parts:n});export{Ht as AUTO_COLUMN,so as BOX,Wt as BUTTON,ro as DIM,Ft as DROP_COMMON,Mt as DROP_SIDE_PADDING,vt as FOLLOW_THE_BOX,dt as HEADING_CASE_UPPER,co as INNER_BOX,gt as NO_PAD,it as NUMBER_TEXT,H as RIGHT_WORDS,yt as SAME_KEYS,wt as SECTION_BOX,Dt as SH_LINK,ao as TEXT,zt as bandAccent,b as bandIndex,u as bandPage,Qt as bandProps,Zt as bandWrites,lt as fillFrom,Jt as fillNoBoxHolds,Gt as filledChip,Xt as headingCaseOf,f as innerPad,Yt as innerPadKeys,Vt as leadLine,pt as leadText,oo as lineSides,at as numberAndUnit,$t as onBandPreset,jt as ownFill,eo as pictureCell,k as sectionPage,to as siteGutterOf,ct as smallText,qt as surfaceAccent,rt as wrapperPad,Kt as wrapperPadKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{finiteNumber as a}from"../../../../../format/lib/finite-number.js";import{parseIntroBleedLayout as
|
|
1
|
+
import{phoneKey as R}from"efficient-easel/draw";import{finiteNumber as a}from"../../../../../format/lib/finite-number.js";import{parseIntroBleedLayout as U}from"../../../../../format/lib/sections/intro-bleed-layout.js";import{fluidToken as F,token as n}from"./section-head-looks.js";import{labelStyle as L}from"../../../../../format/lib/document/seed-parts.js";import{BUTTON as g,DIM as f,DROP_COMMON as c,DROP_SIDE_PADDING as S,INNER_BOX as i,NO_PAD as p,NUMBER_TEXT as C,SAME_KEYS as u,SECTION_BOX as y,TEXT as m,fillFrom as x,lineSides as r,pictureCell as w,siteGutterOf as P,smallText as s,wrapperPad as T,wrapperPadKeys as B}from"./section-to-box-row-parts.js";const H=(e,t)=>{const o=a(e),k=a(t);return{...o===void 0?{}:{size:o},...k===void 0?{}:{sizePhone:k}}},W=e=>U(e.layout)==="stacked",M=e=>Math.min(Math.max(a(e.overlay)??60,0),100),d=e=>a(e)??100,V={textStyle:"heading-1",sizeToken:{...F("headingLarge",48,7,96).sizeToken,pxPhone:36},weight:500,lineHeight:.95,letterSpacing:-.03},X=[s("eyebrow",n("label",14)),...[!0,!1].map(e=>({kind:"text",key:"title",role:"heading",props:m,style:{...V,case:e?"upper":"none"},styleFrom:t=>H(t.titleSizeDesktop,t.titleSizeMobile),when:t=>t.uppercase===!0===e})),{kind:"text",key:"body",props:{...f,maxWidth:560},style:{textStyle:"body-1",...n("body",17,16),lineHeight:1.6,paragraphSpacing:24},styleFrom:e=>H(e.bodySizeDesktop,e.bodySizeMobile)},{kind:"group",name:"Button",props:{...i,align:"start",sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:g}]}],A=e=>`${e}: a Button block has no colour of its own (it follows the site Button colour, as the old fallback did); 0 of 3 live US nodes store one (CLI read, 2026-11-03)`,j=()=>({name:"Scroll-Over Text",skip:e=>W(e)?"the stacked layout: its words row's height floor (`copyShare*`) and the header subtraction have no Box setting; 0 live US nodes":void 0,boxProps:e=>({...y,direction:"column",justify:"center",align:"start",gap:24,gapPhone:24,share:"content",...p,placement:"left",darken:M(e),darkenStyle:"even",sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:d(e.heightDesktop),sectionHeightModePhone:"fixed",sectionHeightUnitPhone:"%",sectionHeightValuePhone:d(e.heightMobile)}),box:[...u.filter(e=>!String(typeof e=="string"?e:e[0]).startsWith("sectionHeight")),["imageSrc","bgImage"],["imageSrcMobile","bgImagePhone"],["overlay","darken",(e,t)=>M(t)],["heightDesktop","sectionHeightValue",e=>d(e)],["heightMobile","sectionHeightValuePhone",e=>d(e)]],parts:X,drop:{uppercase:"not a value of its own: it picks the heading part — Case Upper when on, None (as typed) when off",layout:"not a value of its own: the overlay layout is this tree; a stacked node is skipped (`skip`)",copyShareDesktop:"the stacked layout's words-row floor, read only there; a stacked node is skipped",copyShareMobile:"the stacked layout's words-row floor, read only there; a stacked node is skipped",sticky:"the old pin key, read as `stickTop` by the section pin's one reader (lib/content/section-sticky); the Box keeps a stored `stickTop` (SAME_KEYS), and this row is switched off until the stored pages hold `stickTop`",titleSizeDesktop:"read by the heading part's `styleFrom`: a number is its Size, `inherit` and unset follow the token",titleSizeMobile:"read by the heading part's `styleFrom`: a number is its phone Size, `inherit` and unset follow the token",bodySizeDesktop:"read by the words part's `styleFrom`: a number is its Size, `inherit` and unset follow the token",bodySizeMobile:"read by the words part's `styleFrom`: a number is its phone Size, `inherit` and unset follow the token",buttonColor:A("Button color"),buttonTextColor:A("Button text color"),...c}}),v={textStyle:"heading-2",...n("headingMedium",56,36),weight:400,lineHeight:1.05,letterSpacing:-.03},G={textStyle:"body-1",...n("body",16),lineHeight:1.7},O=e=>({kind:"text",key:"body",props:{...f,maxWidth:520},style:{...G,paragraphSpacing:e}}),l={top:0,bottom:0,topPhone:0,bottomPhone:0},b=(e,t)=>typeof e.sectionHeightMode=="string"&&e.sectionHeightMode!=="auto"?{}:{sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:t,sectionHeightModePhone:"auto"},K=(e,t)=>{const o=b(e,t);return Object.keys(o).length?o:{sectionHeightMode:e.sectionHeightMode,...e.sectionHeightValue===void 0?{}:{sectionHeightValue:e.sectionHeightValue},...e.sectionHeightUnit===void 0?{}:{sectionHeightUnit:e.sectionHeightUnit},sectionHeightModePhone:"auto"}},I={boxShapePhone:"landscape"},_="needs a black-and-white setting on a Box picture (the old photograph followed it, else the site's Photography); 0 live US nodes store it (CLI read, 2026-11-03)",Y=(e,t)=>({[e]:t,[R(e)]:t}),q={textStyle:"heading-2",...n("headingMedium",40),weight:500,case:"none",lineHeight:1,letterSpacing:-.02},E=e=>(Array.isArray(e.stats)?e.stats:[]).filter(t=>t&&(String(t.value??"").trim()!==""||String(t.label??"").trim()!=="")),Z=()=>({name:"Brand Text",boxProps:(e,t)=>({...y,...x("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...T(e,l),...b(e,100)}),box:[...u,...B(l)],parts:[{kind:"group",name:"Words",props:(e,t)=>({...i,justify:"center",gap:28,gapPhone:28,sectionBorder:r({right:1}),sectionBorderPhone:r({}),...p,sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60,sectionPaddingRight:P(t)}),parts:[s("eyebrow",n("label",14)),{kind:"text",key:"heading",role:"heading",props:m,style:{...v,case:"none"},mark:"accentItalic"},O(28),{kind:"group",name:"Stats",props:{...i,sectionPaddingTop:16,sectionPaddingTopPhone:16},parts:[{kind:"group",name:"Figures",props:e=>({...i,direction:"row",share:"equal",gap:24,gapPhone:24,maxWidth:520,phoneRow:Math.min(Math.max(E(e).length,1),3),...Y("sectionBorder",r({top:1})),sectionPaddingTop:28,sectionPaddingTopPhone:28}),parts:[{kind:"list",key:"stats",name:"Stat",of:E,props:{...i,gap:4,gapPhone:4},parts:[{kind:"text",key:"value",props:C,style:q},s("label",{...n("label",13),color:"labels",letterSpacing:.2})]}]}]}]},w("Picture","imageSrc",I)],drop:{...c,grayscale:_,...S}}),h=e=>{const t=e.textAlign==="center"||e.textAlign==="right"?{align:e.textAlign}:{},o=e.textAlignPhone==="left"||e.textAlignPhone==="center"||e.textAlignPhone==="right"?{alignPhone:e.textAlignPhone}:{};return{...t,...o}},$=e=>e.textAlign==="center"?"center":e.textAlign==="right"?"end":"stretch",J=e=>Math.min(Math.max(a(e.overlay)??60,0),100),D=e=>typeof e=="string"&&e.trim()!=="",Q={...g,align:"center",alignPhone:"center",buttonFillOpacity:0,buttonBorder:{width:1},buttonPaddingTop:16,buttonPaddingRight:28,buttonPaddingBottom:16,buttonPaddingLeft:28,buttonPaddingTopPhone:12,buttonPaddingRightPhone:20,buttonPaddingBottomPhone:12,buttonPaddingLeftPhone:20},N=e=>({...w("Picture","imageSrc",(t,o)=>({...D(t.imageSrc)?{darken:40,darkenStyle:"even"}:{},placement:"center",...I,sectionBorder:r(e?{left:1}:{right:1}),...z(e?"left":"right",P(o))}),[{kind:"button",key:"imageBtnText",href:"imageBtnHref",variant:"ghost",props:Q,style:{...L(13,12),letterSpacing:.18}}]),when:t=>t.reverse===!0===e}),z=(e,t)=>{const o=Math.max(60-t,0);return{sectionPaddingLeft:e==="left"?60:o,sectionPaddingRight:e==="right"?60:o}},ee={kind:"group",name:"Words",props:(e,t)=>{const o=e.reverse===!0;return{...i,justify:"center",align:$(e),placement:e.textAlign==="center"?"center":e.textAlign==="right"?"right":"left",...K(e,72),gap:24,gapPhone:24,...D(e.textBgSrc)?{darken:J(e),darkenStyle:"even"}:{},...p,sectionPaddingTop:100,sectionPaddingBottom:100,...z(o?"right":"left",P(t)),sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60}},box:[["textBgSrc","bgImage"]],parts:[{...s("eyebrow",n("label",14)),styleFrom:h},{kind:"text",key:"title",role:"heading",props:m,style:v,styleFrom:e=>({case:e.uppercase===!0?"upper":"none",...h(e)})},{...O(24),styleFrom:h},{kind:"group",name:"Button",props:{...i,sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:e=>{const t=h(e);return{...g,...t.align?{align:t.align}:{},...t.alignPhone?{alignPhone:t.alignPhone}:{}}}}]}]},te=()=>({name:"Image & Text Split",boxProps:(e,t)=>({...y,...x("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...T(e,l),...b(e,72)}),box:[...u,...B(l)],parts:[N(!1),ee,N(!0)],drop:{reverse:"not a value of its own: it picks the order — the Picture Box first, or after the Words",uppercase:"not a value of its own: the heading part's Case — Upper when on, None (as typed) when off",textAlign:"read by each words part (its Align) and the Words Box (its Align); left writes nothing, as the old emitted no class",textAlignPhone:"read by each words part as its phone Align",textAlignTablet:"not carried to the words part's own tablet Align (`alignTablet`) yet: no old node stores it (new with the Tablet view's Text alignment row, 0 stored on the US sites 2026-11-06), so nothing moves",overlay:"read by the Words Box: its Darken over the words picture (60 when unset); no picture, no wash",grayscale:_,...c,...S}}),de={IntroBleed:j(),Manifesto:Z(),Split:te()};export{de as EDITORIAL_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as E}from"react/jsx-runtime";import{SectionAnimation as f}from"../../../components/SectionAnimation.js";import{ENTRANCE_EXCLUDED as l,entranceDrawn as p}from"../../animation/entrance.js";import{CARD_HOVER_SECTIONS as w,PICTURE_HOVER_BLOCKS as T}from"../../../../format/lib/animation/hover.js";import{BOX_TYPE as a}from"../../../../format/lib/document/container-blocks.js";import{drawsCopiesInTheBox as _}from"../../../../format/lib/content/copies-in-box.js";const c=Object.fromEntries(T.map(n=>[n,"picture"])),b={[a]:"box",Ticker:"marquee",...Object.fromEntries(w.map(n=>[n,"cards"])),...c},s=(n,e)=>!l.has(n)&&!!e&&typeof e.render=="function";function
|
|
1
|
+
import{jsx as E}from"react/jsx-runtime";import{SectionAnimation as f}from"../../../components/SectionAnimation.js";import{ENTRANCE_EXCLUDED as l,entranceDrawn as p}from"../../animation/entrance.js";import{CARD_HOVER_SECTIONS as w,PICTURE_HOVER_BLOCKS as T}from"../../../../format/lib/animation/hover.js";import{BOX_TYPE as a}from"../../../../format/lib/document/container-blocks.js";import{drawsCopiesInTheBox as _}from"../../../../format/lib/content/copies-in-box.js";const c=Object.fromEntries(T.map(n=>[n,"picture"])),b={[a]:"box",Ticker:"marquee",...Object.fromEntries(w.map(n=>[n,"cards"])),...c},s=(n,e)=>!l.has(n)&&!!e&&typeof e.render=="function";function m(n,e,i,o){n.fields={...n.fields,...i.animationTabFields(e,o)}}function d(n,e){const i=n,o=i.render;i.render=t=>{const r=p(t);return!r||_(e,t)?o(t):E(f,{views:r,editing:!!t.editor?.isEditing,takesViewHide:!0,atEdge:e===a,children:o(t)})}}const R={name:"sectionAnimation",applies:(n,e,i)=>e.isSection(n)&&s(n,i),panel:(n,e,i)=>m(n,b[e]??"section",i,e),draw:(n,e)=>d(n,e)},x={name:"blockEntrance",applies:(n,e,i)=>!e.isSection(n)&&s(n,i),panel:(n,e,i)=>m(n,c[e]??"block",i,e),draw:(n,e)=>d(n,e)};export{x as blockEntrance,R as sectionAnimation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as E}from"react/jsx-runtime";import{HideTaker as A}from"../../../components/ViewHideRoot.js";import{SectionRootChoice as D}from"../../../components/SiteGutterFrame.js";import{INTRO_OLD_STICKY_PINS as Y,PIN_AT_SCREEN_TOP as N,SECTION_PIN_ABOVE_KEY as P,SECTION_PIN_SCREENS_KEY as y,SECTION_PIN_SCREENS_KEYS as L,SECTION_PIN_STOP_KEY as x,SECTION_STICK_EXCLUDED as B,SOME_VIEW_PINS as R,sectionPinAttrs as h}from"../../../../format/lib/content/section-sticky.js";import{addShowWhenFacts as j,shownByUsedValue as p,withRowRules as w}from"../../../../format/lib/document/show-when-attach.js";import{SlotsStartAfresh as U}from"../../../components/InBoxContext.js";import{HOVER_GROUP_KEY as H}from"../../../../format/lib/animation/hover.js";import{LOOP_GROUP_KEY as v}from"../../../../format/lib/animation/loop.js";import{SCROLL_CUSTOMIZE_KEY as V,SCROLL_GROUP_KEY as m}from"../../../../format/lib/animation/scroll.js";import{PIN_ATTR as C,PIN_FRAME_ATTR as F}from"efficient-shell/format";import{CARD_BLOCK_KEYS as G}from"./corners.js";import{heldByANode as M,NOT_HELD_BY_A_NODE as W}from"../../../../format/lib/document/passes/document-position.js";const rt=k("sectionSticky",(n,i,t)=>i.isSection(n)&&!B.has(n)&&!!t&&typeof t.render=="function",!0),lt=k("cardSticky",(n,i,t)=>G.includes(n)&&!!t&&typeof t.render=="function",!1);function k(n,i,t){return{name:n,applies:i,panel(s,r,l){const c=N.has(r);s.fields=X(s.fields??{},w(l.stickFields({intro:c,screens:t,above:t}),Z(c))),t&&j(s,{heldByANode:M})},draw(s,r){const l=s.render,c=N.has(r);s.render=_=>{const o=h(_,{atScreenTop:c,above:t});if(!o)return l(_);const S=f=>{const d=E(U,{children:l(_)});return E(A,{...f.attrs,style:f.style,children:f.attrs[C]===""?E("div",{[F]:"",children:d}):d})},T=t?h(_,{atScreenTop:c,track:t,above:!0}):o;return!T||T.attrs[C]!==""?S(o):E(D,{own:()=>S(T),followed:()=>S(o)})}}}}const b=[H,v],g="_gStick";function X(n,i){const t=Object.keys(n),s=n[m];if(!s){const e=t.findIndex(a=>b.includes(a));return e<0?{...n,...i}:Object.fromEntries([...t.slice(0,e).map(a=>[a,n[a]]),...Object.entries(i),...t.slice(e).map(a=>[a,n[a]])])}const{[g]:r,...l}=i,c=e=>e.startsWith(y),_=Object.entries(l).filter(([e])=>!c(e)),o=Object.entries(l).filter(([e])=>c(e)),S=[s.dot,r?.dot].filter(e=>!!e),T=t.indexOf(m),f=t.findIndex((e,a)=>a>T&&b.includes(e)),d=f<0?t.length:f,O=t.indexOf(V),I=O>T&&O<d?O:d,u=e=>[e,e===m?{...s,dot:{any:S}}:n[e]],K=[...t.slice(0,I).map(u),..._,...t.slice(I,d).map(u),...o,...t.slice(d).map(u)];return Object.fromEntries(K)}function Z(n){const i=o=>({field:o,in:[!0,!1]}),t=o=>n&&o==="stickTop"?{any:[{field:o,is:!0},Y]}:{field:o,is:!0},s=o=>({field:o,is:!0}),r=o=>({all:[o,W,{not:{field:P,is:!0}}]}),[l,c,_]=L;return[[["stickTopDistance"],t("stickTop")],[["stickTopDistanceTablet"],p(["stickTopTablet","stickTop"],i,t)],[["stickTopDistancePhone"],p(["stickTopPhone","stickTopTablet","stickTop"],i,t)],[[l],r(s("stickTop"))],[[c],r(p(["stickTopTablet","stickTop"],i,s))],[[_],r(p(["stickTopPhone","stickTopTablet","stickTop"],i,s))],[[x],R],[[P],R]]}export{lt as cardSticky,rt as sectionSticky};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defaultTextStyles as Y,textStyleCaseCss as le,textStyleViewKey as ce}from"efficient-easel/text-styles/model";import{
|
|
2
|
-
`)}function
|
|
1
|
+
import{defaultTextStyles as Y,textStyleCaseCss as le,textStyleViewKey as ce}from"efficient-easel/text-styles/model";import{resolveViewValue as B}from"efficient-easel/draw";import{viewKey as O}from"../../../format/lib/animation/views.js";import{FONT_OPTIONS as de,normalizeFonts as U}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as pe,TABLET_MEDIA as fe,viewOverrides as C,viewRules as X}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as ue,TEXT_STYLE_ATTR as ge,paragraphRules as Z,partSpacingOf as he}from"../document/part-styles.js";import{faceClassOf as q}from"../../../format/lib/text-style-face.js";import{partColourName as Q,partInkCss as me}from"../../../format/lib/document/part-inks.js";import{compressionMetrics as Se,headingTypographyFromRow as ye,normalizeHeadingCompression as I,normalizeSizes as ee}from"../../../format/lib/theme.js";import{finiteNumber as v}from"../../../format/lib/finite-number.js";import{nonEmptyString as P}from"../../../format/lib/non-empty-string.js";const L=e=>e==="sentence"?"none":void 0,ne=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],w=["desktop","tablet","phone"],k=(e,i)=>i==="desktop"?e:ce(e,i);function j(e,i,t,n=X()){return B("textSize",i,e.sizeTablet,e.sizePhone,n)[t]}const be=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function M(e){for(const[i,t,n]of be)for(const o of w)if(e===k(i,o))return{key:O(t,o),view:o,spacing:n};return{key:e,view:"desktop",spacing:null}}function b(e){const i={};for(const t of ne)e[t]!==void 0&&(i[t]=e[t]);return i}function R(e,i){const{auto:t,...n}=e,o=new Set(i??[]),r=ne.filter(s=>o.has(s)&&e.values[s]===void 0);return r.length?{...n,auto:r}:n}function te(e){const i=e.fonts,t=e.sizes,n=e.typography,o=Se(e.compression),r={"heading-1":{font:P(i.heading),size:v(t.headingLarge),weight:v(n.weight),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case),largestSize:v(n.maxPx)},"heading-2":{font:P(i.heading2),size:v(t.headingMedium),weight:v(n.weight2),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case2)},"heading-3":{font:P(i.heading3),size:v(t.headingSmall),weight:v(n.weight3),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case3)},"body-1":{font:P(i.body),size:v(t.body)},"body-5":{font:P(i.label),size:v(t.label)}};return Y().map(({id:s,kind:l,name:d})=>({id:s,kind:l,name:d,values:b(r[s]??{})}))}function N(e){return Array.isArray(e)&&e.every(t=>t&&typeof t=="object"&&typeof t.id=="string"&&(t.kind==="heading"||t.kind==="body")&&typeof t.name=="string")?e.map(t=>R({...t,values:b(t.values??{})},Array.isArray(t.auto)?t.auto:void 0)):null}function Le(e){return N(e)??[]}function ie(e){return N(e)??Y().map(({id:i,kind:t,name:n})=>({id:i,kind:t,name:n,values:{}}))}function V(e,i){const t=te(i),n=N(e);return n?n.map(o=>{const r={...F(t,o.id)};for(const s of o.auto??[])delete r[s];return{...o,values:b({...r,...o.values})}}):t}const F=(e,i)=>e.find(t=>t.id===i)?.values??{},oe=["heading-1","heading-2","heading-3"];function je({saved:e,old:i,cur:t,next:n,sizeOf:o,panelView:r="desktop"}){const s=te(i),l=ie(e),d=V(l,i),c=[],f=n.map(a=>{const S=t.find(g=>g.id===a.id),h=l.find(g=>g.id===a.id);if(!S||!h){const g=xe([a],o,r)[0],T=g.values.color;return T===void 0?g:{...g,values:{...g.values,color:Q(T)}}}const p={...h.values},x=new Set(h.auto??[]),y=a.values,_=S.values,z=[...new Set([...Object.keys(y),...Object.keys(_)])].filter(g=>JSON.stringify(y[g])!==JSON.stringify(_[g])),D=g=>M(g).spacing==="letter";z.sort((g,T)=>Number(D(g))-Number(D(T)));for(const g of z){const{key:T,view:re,spacing:K}=M(g),$=T,A=y[g];if(A===void 0){delete p[$],F(s,a.id)[$]!==void 0&&(c.push([a.id,$]),x.add($));continue}if(x.delete($),K==="line")p[$]=H(A/100,3);else if(K==="letter"){const W={...d.find(E=>E.id===a.id)?.values??{}};for(const E of z)y[E]===void 0&&delete W[M(E).key];const G=b({...W,...p}),J=j(G,o({...a,values:G}),re);p[$]=J?H(A/J,4):0}else p[$]=A}return R({id:a.id,kind:a.kind,name:a.name,values:b(p)},x)});let u=i.compression;if(c.some(([a,S])=>(S==="lineHeight"||S==="letterSpacing")&&oe.includes(a))&&I(u)!=="normal"){for(const a of oe){const S=f.find(p=>p.id===a);if(!S)continue;const h={...S.values};for(const p of["lineHeight","letterSpacing"])c.some(([x,y])=>x===a&&y===p)||h[p]===void 0&&!(S.auto??[]).includes(p)&&(h[p]=F(s,a)[p]);S.values=b(h)}u="normal"}return{saved:f,old:{...i,compression:u}}}function Me(e,i){const t={text_styles:e.saved};return e.old.compression!==i.compression&&(t.heading_compression=I(e.old.compression)),t}const H=(e,i)=>Number(e.toFixed(i)),se=(e,i)=>w.indexOf(e)<w.indexOf(i)?i:e;function Re(e,i,t="desktop"){return e.map(n=>{const o={...n.values},r=i(n);for(const s of w){const l=O("lineHeight",s),d=n.values[l],c=n.values[O("letterSpacing",s)];delete o[l],d!==void 0&&(o[k("lineSpacing",s)]=H(d*100,1));const f=se(s,t);c!==void 0&&(o[k("letterSpacing",s)]=H(c*j(n.values,r,f),f===s?2:4))}return{id:n.id,kind:n.kind,name:n.name,values:o}})}function xe(e,i,t="desktop"){return e.map(n=>{const o=n.values,r={...o};for(const c of w)delete r[k("lineSpacing",c)],delete r[k("letterSpacing",c)];const s={id:n.id,kind:n.kind,name:n.name,values:b(r)},l={...s.values},d=i({...s,values:{...s.values}});for(const c of w){const f=o[k("lineSpacing",c)],u=o[k("letterSpacing",c)];if(typeof f=="number"&&(l[O("lineHeight",c)]=H(f/100,3)),typeof u=="number"){const m=j(s.values,d,se(c,t));l[O("letterSpacing",c)]=m?H(u/m,4):0}}return{...s,values:b(l)}})}function Ve(e){const i={fonts:U({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:ee({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:I(e.heading_compression),typography:ye(e)},t=e.text_styles??null,n=Array.isArray(t)?ae(V(t,i),i):i;return{fonts:U(n.fonts),sizes:ee(n.sizes),compression:I(n.compression),typography:n.typography,textStyles:t}}function ae(e,i){const t=m=>e.find(a=>a.id===m)?.values??{},n=t("heading-1"),o=t("heading-2"),r=t("heading-3"),s=t("body-1"),l=t("body-5"),d=i.fonts,c=i.sizes,f=i.typography,u=m=>m==="none"?"sentence":"authored";return{fonts:{...d,heading:n.font??d.heading,heading2:o.font??n.font??d.heading2,heading3:r.font??n.font??d.heading3,body:s.font??d.body,label:l.font??d.label},sizes:{...c,headingLarge:n.size??null,headingMedium:o.size??null,headingSmall:r.size??null,body:s.size??null,label:l.size??null},compression:i.compression,typography:{...f,case:u(n.letterCase),weight:n.weight??null,maxPx:n.largestSize??null,weight2:o.weight??null,weight3:r.weight??null,case2:u(o.letterCase),case3:u(r.letterCase)}}}function Fe(e){const i=N(e.textStyles);if(!i||i.every(o=>Object.keys(o.values).length===0&&!o.auto))return e;const t={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},n=ae(V(i,t),t);return{...e,fonts:n.fonts,sizes:n.sizes,headingCompression:n.compression,headingTypography:n.typography}}function De(e){const i=[];for(const t of e){const n=t.values,o=`.${q(t)}`,r=`[${ge}="${t.id}"]`,s=`${o}, ${r}`,l=[],d=n.font!==void 0?de.find(m=>m.key===n.font)?.cssVar:void 0;if(d&&l.push(`font-family: var(${d})`),n.size!==void 0){const m=n.largestSize!==void 0?Math.min(n.size,n.largestSize):n.size;l.push(`font-size: ${m}px`)}const c=me(n.color);c&&l.push(`color: ${c}`),n.italic===!0&&l.push("font-style: italic"),n.weight!==void 0&&l.push(`font-weight: ${n.weight}`);const f=[];n.lineHeight!==void 0&&f.push(`line-height: ${n.lineHeight}`),n.letterSpacing!==void 0&&f.push(`letter-spacing: ${n.letterSpacing}em`),t.kind==="body"&&l.push(...f);const u=le(n.letterCase);u&&t.kind==="body"&&l.push(`text-transform: ${u}`),n.paragraphSpacing&&l.push(`--sf-part-para: ${n.paragraphSpacing}px`),l.length&&i.push(`${s} { ${l.join("; ")} }`),t.kind==="heading"&&f.length&&i.push(`${s}, ${o}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${f.join("; ")} }`),t.kind==="heading"&&u&&i.push(`${r}, ${o}:is(h1, h2, h3, h4) { text-transform: ${u} }`),n.paragraphSpacing&&(i.push(`*:has(> ${r}) { --sf-part-para: ${n.paragraphSpacing}px }`),i.push(...Z(`:is(${s})`,`*:has(> ${r})`))),i.push(...ze(t,s,o,r))}return i.join(`
|
|
2
|
+
`)}function ze(e,i,t,n){const o=e.values,r=C("textSize",o.size,o.sizeTablet,o.sizePhone),s=C("textSize",o.largestSize,o.largestSizeTablet,o.largestSizePhone),l=C("same",o.lineHeight,o.lineHeightTablet,o.lineHeightPhone),d=C("same",o.letterSpacing,o.letterSpacingTablet,o.letterSpacingPhone),c=C("spacing",o.paragraphSpacing,o.paragraphSpacingTablet,o.paragraphSpacingPhone),f=B("textSize",o.size,o.sizeTablet,o.sizePhone,X()),u=ve[e.id],m=[];for(const[a,S]of[["tablet",fe],["phone",pe]]){const h=[],p=[],x=f[a],y=s[a],_=r[a]===void 0&&y===void 0||x===void 0?void 0:y===void 0?x:Math.min(x,y);_!==void 0&&p.push(`font-size: ${_}px`);const z=[];l[a]!==void 0&&z.push(`line-height: ${l[a]}`),d[a]!==void 0&&z.push(`letter-spacing: ${d[a]}em`),e.kind==="body"&&p.push(...z),c[a]!==void 0&&p.push(`--sf-part-para: ${c[a]}px`),p.length&&h.push(`${i} { ${p.join("; ")} }`),e.kind==="heading"&&z.length&&h.push(`${i}, ${t}:is(h1, h2, h3, h4), ${n}:is(h1, h2, h3, h4) { ${z.join("; ")} }`),c[a]!==void 0&&h.push(`*:has(> ${n}) { --sf-part-para: ${c[a]}px }`),c[a]!==void 0&&!o.paragraphSpacing&&h.push(...Z(`:is(${i})`,`*:has(> ${n})`)),_!==void 0&&u&&h.push(`.sf-themed-content { --size-${u}: ${_}px !important }`),h.length&&m.push(`@media ${S} { ${h.join(" ")} }`)}return m}const ve={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function Ke(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function We(e){return e?ue[e]:void 0}function $e(e){const i=he(e);return b({font:e.font,color:e.color===void 0?void 0:Q(e.color),size:e.size,weight:e.weight,italic:e.italic,lineHeight:i.lineHeight,letterSpacing:i.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function Ge(e){return Object.keys($e(e)).length>0}function Je({saved:e,old:i,styleId:t,values:n}){const o=ie(e);return{saved:_e(o,t,n),old:i}}function _e(e,i,t){return e.map(n=>n.id===i?R({...n,values:b({...n.values,...t})},n.auto):n)}function Ye(e){const i=e.filter(t=>t.kind==="body").map(t=>Number(/^body-(\d+)$/.exec(t.id)?.[1])).filter(t=>Number.isInteger(t)&&t>0);return i.length?`body-${Math.max(...i)}`:"body-1"}export{Ke as accentItalicCss,je as applyListChange,Ye as eyebrowStyleId,q as faceClassOf,xe as fromPanelStyles,Ge as hasStyleChange,Me as listChangePatch,ie as listToWrite,$e as partStyleToTextStyleValues,Je as pushIntoStyle,V as resolveTextStyles,_e as setStyleValues,Ve as siteTextFromRow,Le as storedTextStyles,We as styleIdOfRole,De as textStylesCss,te as textStylesFromOld,ae as textStylesToOld,Fe as themeWithTextStyles,Re as toPanelStyles,j as viewSizeOf};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "65.0.0",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
56
|
"efficient-easel": "^30.1.0",
|
|
57
|
-
"efficient-shell": "^12.
|
|
57
|
+
"efficient-shell": "^12.22.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
60
60
|
"react": ">=19",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@types/react": "^19",
|
|
74
74
|
"@types/react-dom": "^19",
|
|
75
75
|
"efficient-easel": "^30.1.0",
|
|
76
|
-
"efficient-shell": "^12.
|
|
76
|
+
"efficient-shell": "^12.22.0",
|
|
77
77
|
"esbuild": "^0.28.0",
|
|
78
78
|
"happy-dom": "^20.14.5",
|
|
79
79
|
"isomorphic-dompurify": "^3.18.0",
|