efficient-web-builder 68.2.0 → 69.1.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 +46 -0
- package/dist/editor/components/useSocialSettings.d.ts +2 -2
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/choice-pictures.js +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +1 -0
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/document/passes/settings-groups.js +1 -1
- package/dist/format/lib/document/section-catalog.d.ts +1 -0
- package/dist/format/lib/document/section-catalog.js +8 -2
- package/dist/format/lib/document/seed-parts.d.ts +1 -0
- package/dist/format/lib/document/seed-parts.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +1 -0
- package/dist/format/lib/editor-words-catalogue.js +1 -1
- package/dist/format/lib/sections/integrations-rows.d.ts +3 -0
- package/dist/format/lib/sections/integrations-rows.js +1 -0
- package/dist/format/lib/sections/logo-look.d.ts +1 -1
- package/dist/format/lib/sections/logo-look.js +1 -1
- package/dist/format/lib/source-rules/motion-vars-from-the-shell.js +3 -3
- package/dist/format/lib/source-rules/one-alignment-row.js +3 -3
- package/dist/format/lib/source-rules/one-block-box-word-map.d.ts +9 -0
- package/dist/format/lib/source-rules/one-block-box-word-map.js +13 -0
- package/dist/format/lib/source-rules/one-items-align-map.js +4 -7
- package/dist/format/lib/source-rules/one-loop-module.js +2 -2
- package/dist/format/lib/source-rules/one-page-theme-reader.js +2 -2
- package/dist/format/lib/source-rules/support/align-word-rule.d.ts +5 -0
- package/dist/format/lib/source-rules/support/align-word-rule.js +4 -0
- package/dist/format/lib/source-rules/support/exemptions.d.ts +2 -0
- package/dist/format/lib/source-rules/support/exemptions.js +1 -0
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +1 -0
- package/dist/render/components/IntegrationsSection.js +1 -1
- package/dist/render/components/Logos.d.ts +4 -0
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/Ticker.js +1 -1
- package/dist/render/lib/animation/LoopTrack.d.ts +1 -1
- package/dist/render/lib/animation/LoopTrack.js +1 -1
- package/dist/render/lib/animation/loop-fill.d.ts +9 -0
- package/dist/render/lib/animation/loop-fill.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-integrations.d.ts +3 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-integrations.js +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/passes/cell-width.d.ts +0 -1
- package/dist/render/lib/document/passes/cell-width.js +1 -1
- package/dist/render/lib/media.d.ts +0 -1
- package/dist/render/lib/media.js +1 -1
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/package.json +4 -6
- package/dist/render/components/integrationIcons.d.ts +0 -2
- package/dist/render/components/integrationIcons.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as x}from"react/jsx-runtime";import{HideTaker as g}from"./ViewHideRoot.js";import{AppChip as u}from"./Logos.js";import{renderGold as f,renderHeadline as v}from"./goldPhrases.js";import{say as N}from"../../format/lib/editor-words.js";import{dealRows as w,INTEGRATION_ROWS as _,rowTurnSeconds as k}from"../../format/lib/sections/integrations-rows.js";const y=(a,t)=>w(a,t).filter(i=>i.length>0),b=({name:a})=>e(u,{alt:a});function j({names:a,reverse:t}){return e("div",{className:"overflow-hidden","aria-hidden":!1,children:e("div",{className:"flex w-max gap-3 pr-3 [animation:sf-marquee_var(--sf-marquee-t)_linear_infinite] motion-reduce:[animation:none]",style:{"--sf-marquee-t":`${k(a.length)}s`,animationDirection:t?"reverse":"normal"},children:[0,1].map(i=>e("div",{className:"flex gap-3","aria-hidden":i===1,children:a.map((m,n)=>e(b,{name:m},n))},i))})})}function q({eyebrow:a,title:t,body:i,apps:m,statValue:n,statLabel:l,note:s,editing:d=!1}={}){const p=(m??[]).map(r=>(r.text??"").trim()).filter(r=>d||r).map(r=>r||N("App")),h=!!(a??"").trim()||!!(t??"").trim();if(!d&&!h&&p.length===0)return null;const c=y(p,_);return x(g,{as:"section",className:"relative z-[2] overflow-hidden border-y border-line bg-surface py-[76px]",children:[x("div",{className:"mx-auto mb-12 max-w-[860px] px-10 text-center max-[960px]:px-6",children:[(a??"").trim()&&e("span",{className:"inline-block bg-accent px-3.5 py-1.5 font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-bg",children:f(a??"")}),(t??"").trim()&&e("h2",{className:"mt-5 font-display text-[40px] font-medium uppercase leading-[1.04] tracking-[-0.02em] text-fg max-view-wide:text-[30px]",children:v(t??"",!1)}),(i??"").trim()&&e("p",{className:"mx-auto mt-5 max-w-[60ch] text-[15px] leading-relaxed text-fg/65",children:i})]}),c.length>0&&e("div",{className:"flex flex-col gap-3",children:c.map((r,o)=>e(j,{names:r,reverse:o%2===1},o))}),((n??"").trim()||(s??"").trim())&&x("div",{className:"mx-auto mt-12 max-w-[860px] px-10 text-center max-[960px]:px-6",children:[(n??"").trim()&&e("div",{className:"font-display text-[min(64px,var(--sf-heading-max,9999px))] font-medium uppercase leading-none text-accent max-view-wide:text-[min(46px,var(--sf-heading-max,9999px))]",children:n}),(l??"").trim()&&e("div",{className:"mt-2 font-display text-[18px] font-medium uppercase tracking-[0.06em] text-fg",children:f(l??"")}),(s??"").trim()&&e("p",{className:"mx-auto mt-4 max-w-[52ch] text-[13px] leading-relaxed text-fg/50",children:s})]})]})}export{q as default};
|
|
@@ -24,6 +24,10 @@ interface LogosProps {
|
|
|
24
24
|
}
|
|
25
25
|
export default function Logos({ items, contained, heading, columns, grayscale, logoHeight, bandPadding, logos: LogoBlocks, look, omitHead, cards, align, alignTablet, alignPhone, labelledBy, }: LogosProps): import("react").JSX.Element;
|
|
26
26
|
export declare const CARD_WORDS_CLASS = "font-mono text-[12px] uppercase tracking-[0.18em]";
|
|
27
|
+
export declare function AppChip({ src, alt }: {
|
|
28
|
+
src?: string;
|
|
29
|
+
alt?: string;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
27
31
|
export declare function LogoWallMark({ src, alt, look, logoHeight, grayscale, kind, }: {
|
|
28
32
|
src?: string;
|
|
29
33
|
alt?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as f,Fragment as M}from"react/jsx-runtime";import{PagePicture as u}from"../lib/first-screen.js";import{BrandNameMark as H}from"efficient-shell/icons/brands";import{PaymentMark as y,paymentMarkItems as Y}from"efficient-shell/icons/payment";import Z from"./BlockFrame.js";import{MarkZoom as h}from"./PictureZoom.js";import{renderChrome as U,renderGold as _,renderHeadline as J}from"./goldPhrases.js";import{LogoWallProvider as I}from"./LogoWallContext.js";import{useBoxCell as V}from"./InBoxContext.js";import{EMPTY_ELSE_CLASS as X,EMPTY_HIDES_CLASS as q,EmptyHidesStyle as Q}from"../lib/content/empty-hides.js";import{media as x}from"../lib/media.js";import{sizedImage as v}from"../../format/lib/sized-image.js";import{stripMarkup as g}from"../../format/lib/markup.js";import{DEFAULT_LOGO_LOOK as ee}from"../../format/lib/sections/logo-look.js";import{paymentRowMark as R}from"../lib/sections/payment-rows.js";import{alignViewClasses as ne,BLOCK_ALIGN_JUSTIFY as te,blockAlignOf as re}from"../../format/lib/content/block-align.js";import{FOOTER_MARK_SIZES as P}from"../../format/lib/document/box-footer.js";import{say as ae}from"../../format/lib/editor-words.js";const N={label:"text-[length:var(--size-label,13px)]",chip:"text-[length:var(--size-label,14px)]"},p="sf-logo-wall",se="sf-logo-items",le="flex flex-wrap items-center",ie="flex flex-nowrap items-center",oe=(n,e,r,a=!1)=>{const o=re(n)??"center";return[a?ie:le,te[o],ne("justify",o,e,r,{atSectionLine:!0})].filter(Boolean).join(" ")},O="plain",$={plain:{x:3.5,y:2},cards:{x:.75,y:.75},marks:{x:.75,y:.5},chips:{x:.75,y:.75}},w=n=>({columnGap:`${$[n].x}rem`,rowGap:`${$[n].y}rem`}),L=(n,e)=>`calc((100% - ${(n-1)*$[e].x}rem) / ${n})`;function ce({items:n,contained:e,heading:r,columns:a,grayscale:o,logoHeight:c,bandPadding:s,logos:i,look:l=ee,omitHead:m=!1,cards:d,align:j,alignTablet:T,alignPhone:G,labelledBy:D}){const S=oe(j,T,G,V()?.loops===!0),C=l==="marks",F=a!=null?{flex:`0 0 ${L(a,O)}`}:void 0,b=!m;return f(Z,{contained:e,fillWidth:C&&m?"w-auto max-w-full":void 0,className:b&&s==null?"py-10":"",style:!b||s==null?void 0:{paddingTop:`${s}px`,paddingBottom:`${s}px`},children:[!m&&r!=null&&r!==""?t("h2",{className:`mb-8 text-center font-mono ${N.label} uppercase tracking-[0.2em] text-fg-dim`,children:J(r,!1)}):null,f(me,{listed:C,labelledBy:D,children:[d!==void 0?f(I,{value:{look:l,logoHeight:c,grayscale:o},children:[a!=null?t("style",{children:`.${p}-c${a}>*{flex:0 0 ${L(a,l)}}`}):null,t("div",{className:[p,a!=null?`${p}-c${a}`:"",S].filter(Boolean).join(" "),style:w(l),children:d})]}):i?f(I,{value:{look:l,logoHeight:c,grayscale:o},children:[t(Q,{}),a!=null?t("style",{children:`.${p}-c${a}>*{flex:0 0 ${L(a,l)}}`}):null,t(i,{className:[p,q,a!=null?`${p}-c${a}`:"",S].filter(Boolean).join(" "),style:w(l),minEmptyHeight:80})]}):null,d!==void 0?null:t("div",{className:`${se} ${X} ${S}`,style:w(O),children:(n??[]).map((E,K)=>t("div",{className:"text-center",style:F,children:t(Ne,{src:E.src,alt:E.alt,look:O,logoHeight:c,grayscale:o})},K))})]})]})}function me({listed:n,labelledBy:e,children:r}){return n?t("div",{className:"contents",role:"list",...e?{"aria-labelledby":e}:{"aria-label":ae("Ways to pay")},children:r}):t(M,{children:r})}const k="font-mono text-[12px] uppercase tracking-[0.18em]";function W(n){const e=Y({name:g(n)});return!e.length||e.length===1&&e[0].kind==="words"&&!e[0].glyph?[]:e}function de({item:n,children:e}){return n.kind==="brand"?t(h,{children:e}):t(M,{children:e})}function pe(n){return n.length?t("span",{className:"flex items-center gap-3",children:n.map((e,r)=>t(y,{item:e,size:20,className:k},r))}):null}const fe="shrink-0 gap-2 whitespace-nowrap rounded bg-bg px-5",ue=`${N.chip} font-medium tracking-wide text-fg-dim`,he="sf-logo-chip flex h-10 items-center border border-line",xe={lead:"sf-card",tail:"bg-surface px-4"},z={lead:"",tail:fe};function B({look:n,children:e}){const r=[n.lead,he,n.tail].filter(Boolean).join(" ");return n===z?t("div",{className:r,"data-sf-chip":"",children:e}):t("div",{className:r,children:e})}function Se({src:n,alt:e}){return f(B,{look:z,children:[n?t(u,{...A(x(n)),alt:"",className:"h-4 w-auto"}):e?t(H,{name:e,size:16,className:"shrink-0 text-fg"}):null,e?t("span",{className:ue,children:_(e)}):null]})}const ye=P.sm.mark,_e=Object.values(P),ge=n=>_e.reduce((e,r)=>Math.abs(r.mark-n)<Math.abs(e.mark-n)?r:e).words;function Ne({src:n,alt:e,look:r,logoHeight:a,grayscale:o,kind:c}){if(r==="marks"){const s=a??ye,i=!n&&c!==void 0?R({label:e,kind:c}):null,l=i?[i]:!n&&e?W(e):[];return t("span",{role:"listitem",className:"flex items-center gap-3",style:{fontSize:`${ge(s)}px`},children:l.length?l.map((m,d)=>t(de,{item:m,children:t(y,{item:m,size:s})},d)):n?t(h,{children:t(u,{...A(x(n)),alt:g(e||""),className:"w-auto",style:{height:`${s}px`}})}):e&&t("span",{children:_(e)})})}if(r==="chips")return t(Se,{src:n,alt:e});if(r==="cards"){const s=!n&&c!==void 0?R({label:e,kind:c}):null,i=!s&&!n&&e?W(e):[],l=t(B,{look:xe,children:s?t(y,{item:s,size:20,className:k}):i.length?pe(i):n?t(u,{...A(x(n)),alt:g(e||""),className:o===!1?"max-h-5 w-auto opacity-90":"max-h-5 w-auto opacity-90 grayscale"}):e&&t("span",{className:k,children:_(e)})});return(n?!0:s?s.kind==="brand":i.length>0&&i.every(d=>d.kind==="brand"))?t(h,{children:l}):l}return n?t(h,{children:t(u,{...Oe(x(n)),alt:e,className:["mx-auto w-auto opacity-60 transition-opacity hover:opacity-100",a==null?"h-7":"",o===!1?"":"grayscale"].filter(Boolean).join(" "),style:a==null?void 0:{height:`${a}px`}})}):t("span",{className:`font-mono ${N.label} uppercase tracking-[0.2em] text-fg-dim`,children:U(e||"Logo")})}function A(n){const e=v(n,{fallbackWidth:320,maxWidth:640});return e.srcSet?{src:e.src,srcSet:e.srcSet,sizes:"120px"}:{src:n}}function Oe(n){const e=v(n,{fallbackWidth:640,maxWidth:960});return e.srcSet?{src:e.src,srcSet:e.srcSet,sizes:"240px"}:{src:n}}export{Se as AppChip,k as CARD_WORDS_CLASS,Ne as LogoWallMark,ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as p}from"react/jsx-runtime";import{DEFAULT_TICKER_SEPARATOR as D,DEFAULT_TICKER_SIZE as R,SEPARATOR_GLYPH as b,parseTickerSeparator as y,parseTickerSize as F,separatorScaleClass as k,tickerTypeClass as I}from"../../format/lib/sections/ticker-style.js";import{DEFAULT_LOOP_DELAY as P,DEFAULT_LOOP_DIRECTION as $,DEFAULT_LOOP_SECONDS as j,isVerticalLoop as U,loopAnimation as K,parseLoopDirection as G}from"../../format/lib/animation/index.js";import{loopFillSeconds as Y,useLoopFill as z}from"../lib/animation/loop-fill.js";import{renderGold as H}from"./goldPhrases.js";const V={"themed-band":"text-fg/70","themed-section":"text-fg-dim","dark-media":"text-overlay-fg/70"};function Z({items:d,separator:m=D,size:x=R,seconds:f=j,delay:w=P,scroll:h=$,backdrop:g="themed-band",className:_}){const i=F(x),r=G(h),o=y(m),L=`text-accent ${k(i,o)}`.trim(),c=b[o],T=c===""?t("span",{}):t("span",{className:L,children:c}),a=U(r),{band:A,track:E,count:n,fitted:v}=z(!a),S=a?"inline-flex flex-col items-center gap-[60px] pb-[60px] max-view-wide:gap-8 max-view-wide:pb-8":"inline-flex items-center gap-[60px] pr-[60px] max-view-wide:gap-8 max-view-wide:pr-8",u=a?"inline-flex flex-col items-center gap-[60px] max-view-wide:gap-8":"inline-flex items-center gap-[60px] max-view-wide:gap-8",s=l=>t("span",{className:S,children:d.map((e,C)=>{const N=typeof e=="string"?e:e.text,O=typeof e=="object"&&e.gold;return p("span",{className:u,children:[t("span",{className:O?"text-accent":void 0,children:H(N)}),T]},C)})},l);return t("div",{ref:A,className:`overflow-hidden ${_??""}`,children:p("div",{ref:E,className:`flex ${a?"flex-col ":""}whitespace-nowrap ${I(i)} ${V[g]}`,style:{animation:K(r,Y(f,n),w),...v?{width:"max-content"}:null},children:[s("a"),s("b"),n>1&&t("span",{className:"contents","aria-hidden":!0,inert:!0,children:Array.from({length:2*n-2},(l,e)=>s(`fill-${e}`))})]})})}export{Z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { type LoopDirection } from "../../../format/lib/animation/loop.js";
|
|
3
3
|
export declare const LOOP_COPY_CLASS: {
|
|
4
4
|
readonly across: "pr-[var(--sf-gap-len,0px)] max-view-wide:pr-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))]";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as
|
|
1
|
+
import{Fragment as d,jsx as a,jsxs as v}from"react/jsx-runtime";import{Fragment as h}from"react";import{isVerticalLoop as p,loopAnimation as g}from"../../../format/lib/animation/loop.js";import{loopFillSeconds as u,useLoopFill as w}from"./loop-fill.js";const t={across:"pr-[var(--sf-gap-len,0px)] max-view-wide:pr-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))]",down:"pb-[var(--sf-gap-len,0px)] max-view-wide:pb-[var(--sf-gap-len-phone,calc(var(--sf-gap-len,0px)/2))]"};function _(r){return p(r)?t.down:t.across}function A({direction:r,seconds:i,delay:c,editing:o,copy:e}){const n=p(r),{band:f,track:m,count:s}=w(!n&&!o);if(o)return a(d,{children:e("")});const l=_(r);return a("div",{ref:f,className:"overflow-hidden",children:v("div",{ref:m,className:n?"flex flex-col":"flex w-max",style:{animation:g(r,u(i,s),c)},children:[e(l),a("div",{className:"contents","aria-hidden":!0,inert:!0,children:Array.from({length:2*s-1},(C,x)=>a(h,{children:e(l)},x))})]})})}export{t as LOOP_COPY_CLASS,A as LoopTrack,_ as loopCopyClass};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const LOOP_FILL_MAX = 256;
|
|
2
|
+
export declare function loopFillCount(band: number, copy: number): number;
|
|
3
|
+
export declare function loopFillSeconds(seconds: number, count: number): number;
|
|
4
|
+
export declare function useLoopFill<B extends HTMLElement = HTMLDivElement, T extends HTMLElement = HTMLDivElement>(across: boolean): {
|
|
5
|
+
band: import("react").RefObject<B | null>;
|
|
6
|
+
track: import("react").RefObject<T | null>;
|
|
7
|
+
count: number;
|
|
8
|
+
fitted: boolean;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as a,useRef as f,useState as d}from"react";const h=256;function y(t,e){return!(t>0)||!(e>0)?1:Math.min(h,Math.max(1,Math.ceil(t/e)))}function F(t,e){return t*e}function b(t,e){const n=e.style.display;e.style.display="none";const r=t.clientWidth;return e.style.display=n,r}function m(t){return t.firstElementChild?.getBoundingClientRect().width??0}function L(t){const e=f(null),n=f(null),[r,u]=d(1),[p,l]=d(!1);return a(()=>{const i=e.current,o=n.current;if(!t||!i||!o||typeof ResizeObserver!="function"){u(1),l(!1);return}const c=()=>{u(y(b(i,o),m(o))),l(!0)},s=new ResizeObserver(c);return s.observe(i),s.observe(o),c(),()=>s.disconnect()},[t]),{band:e,track:n,count:t?r:1,fitted:t&&p}}export{h as LOOP_FILL_MAX,y as loopFillCount,F as loopFillSeconds,L as useLoopFill};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as K}from"efficient-easel/draw";import{SITE_SIDE as Y}from"efficient-easel/screen/lib/content/length-units";import{finiteNumber as r}from"../../../../../format/lib/finite-number.js";import{splitImageOverlay as x}from"../../../../../format/lib/document/blocks/general/Split/meta.js";import{INTRO_SIZE_UNIT_KEYS as j,introSizeUnitsOf as w}from"../../../../../format/lib/content/section-type-size.js";import{PART_UNIT_KEY_OF as T}from"../../part-styles.js";import{parseIntroBleedLayout as X}from"../../../../../format/lib/sections/intro-bleed-layout.js";import{fluidToken as G,token as n}from"./section-head-looks.js";import{labelStyle as q}from"../../../../../format/lib/document/seed-parts.js";import{BUTTON as c,DIM as B,DROP_COMMON as p,DROP_SIDE_PADDING as H,INNER_BOX as i,NO_PAD as u,NUMBER_TEXT as Z,SAME_KEYS as y,SECTION_BOX as m,TEXT as b,fillFrom as M,lineSides as a,pictureCell as O,siteGutterOf as A,smallText as s,wrapperPad as v,wrapperPadKeys as I}from"./section-to-box-row-parts.js";const _=(e,t,o)=>{const k=r(e),f=r(t),S=(V,g)=>g&&g!=="px"?{[V]:g}:{};return{...k===void 0?{}:{size:k,...S(T.size,o?.desktop)},...f===void 0?{}:{sizePhone:f,...S(T.sizePhone,o?.phone)}}},$=e=>X(e.layout)==="stacked",E=e=>Math.min(Math.max(r(e.overlay)??60,0),100),d=e=>r(e)??100,J={textStyle:"heading-1",sizeToken:{...G("headingLarge",48,7,96).sizeToken,pxPhone:36},weight:500,lineHeight:.95,letterSpacing:-.03},Q=[s("eyebrow",n("label",14)),...[!0,!1].map(e=>({kind:"text",key:"title",role:"heading",props:b,style:{...J,case:e?"upper":"none"},styleFrom:t=>{const o=w(t);return _(t.titleSizeDesktop,t.titleSizeMobile,{desktop:o.titleDesktop,phone:o.titleMobile})},when:t=>t.uppercase===!0===e})),{kind:"text",key:"body",props:{...B,maxWidth:560},style:{textStyle:"body-1",...n("body",17,16),lineHeight:1.6,paragraphSpacing:24},styleFrom:e=>{const t=w(e);return _(e.bodySizeDesktop,e.bodySizeMobile,{desktop:t.bodyDesktop,phone:t.bodyMobile})}},{kind:"group",name:"Button",props:{...i,align:"start",sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:c}]}],D=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)`,ee=()=>({name:"Scroll-Over Text",skip:e=>$(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=>({...m,direction:"column",justify:"center",align:"start",gap:24,gapPhone:24,share:"content",...u,placement:"left",darken:E(e),darkenStyle:"even",sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:d(e.heightDesktop),sectionHeightModePhone:"fixed",sectionHeightUnitPhone:"%",sectionHeightValuePhone:d(e.heightMobile)}),box:[...y.filter(e=>!String(typeof e=="string"?e:e[0]).startsWith("sectionHeight")),["imageSrc","bgImage"],["imageSrcMobile","bgImagePhone"],["overlay","darken",(e,t)=>E(t)],["heightDesktop","sectionHeightValue",e=>d(e)],["heightMobile","sectionHeightValuePhone",e=>d(e)]],parts:Q,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",...Object.fromEntries(j.map(e=>[e,"read by its part's `styleFrom`: the unit of that view's Size"])),buttonColor:D("Button color"),buttonTextColor:D("Button text color"),...p}}),N={textStyle:"heading-2",...n("headingMedium",56,36),weight:400,lineHeight:1.05,letterSpacing:-.03},te={textStyle:"body-1",...n("body",16),lineHeight:1.7},z=e=>({kind:"text",key:"body",props:{...B,maxWidth:520},style:{...te,paragraphSpacing:e}}),l={top:0,bottom:0,topPhone:0,bottomPhone:0},P=(e,t)=>typeof e.sectionHeightMode=="string"&&e.sectionHeightMode!=="auto"?{}:{sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:t,sectionHeightModePhone:"auto"},oe=(e,t)=>{const o=P(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"}},U={boxShapePhone:"landscape"},R="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)",ne=(e,t)=>({[e]:t,[K(e)]:t}),ie={textStyle:"heading-2",...n("headingMedium",40),weight:500,case:"none",lineHeight:1,letterSpacing:-.02},F=e=>(Array.isArray(e.stats)?e.stats:[]).filter(t=>t&&(String(t.value??"").trim()!==""||String(t.label??"").trim()!=="")),re=()=>({name:"Brand Text",boxProps:(e,t)=>({...m,...M("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...v(e,l),...P(e,100)}),box:[...y,...I(l)],parts:[{kind:"group",name:"Words",props:()=>({...i,justify:"center",gap:28,gapPhone:28,sectionBorder:a({right:1}),sectionBorderPhone:a({}),...u,sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60,sectionPaddingRight:Y}),parts:[s("eyebrow",n("label",14)),{kind:"text",key:"heading",role:"heading",props:b,style:{...N,case:"none"},mark:"accentItalic"},z(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(F(e).length,1),3),...ne("sectionBorder",a({top:1})),sectionPaddingTop:28,sectionPaddingTopPhone:28}),parts:[{kind:"list",key:"stats",name:"Stat",of:F,props:{...i,gap:4,gapPhone:4},parts:[{kind:"text",key:"value",props:Z,style:ie},s("label",{...n("label",13),color:"labels",letterSpacing:.2})]}]}]}]},O("Picture","imageSrc",U)],drop:{...p,grayscale:R,...H}}),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}},ae=e=>e.textAlign==="center"?"center":e.textAlign==="right"?"end":"stretch",se=e=>Math.min(Math.max(r(e.overlay)??60,0),100),L=e=>typeof e=="string"&&e.trim()!=="",de={...c,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},C=e=>({...O("Picture","imageSrc",(t,o)=>({...L(t.imageSrc)&&x(t.imageOverlay)>0?{darken:x(t.imageOverlay),darkenStyle:"even"}:{},placement:"center",...U,sectionBorder:a(e?{left:1}:{right:1}),...W(e?"left":"right",A(o))}),[{kind:"button",key:"imageBtnText",href:"imageBtnHref",variant:"ghost",props:de,style:{...q(13,12),letterSpacing:.18}}]),when:t=>t.reverse===!0===e}),W=(e,t)=>{const o=Math.max(60-t,0);return{sectionPaddingLeft:e==="left"?60:o,sectionPaddingRight:e==="right"?60:o}},le={kind:"group",name:"Words",props:(e,t)=>{const o=e.reverse===!0;return{...i,justify:"center",align:ae(e),placement:e.textAlign==="center"?"center":e.textAlign==="right"?"right":"left",...oe(e,72),gap:24,gapPhone:24,...L(e.textBgSrc)?{darken:se(e),darkenStyle:"even"}:{},...u,sectionPaddingTop:100,sectionPaddingBottom:100,...W(o?"right":"left",A(t)),sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60}},box:[["textBgSrc","bgImage"]],parts:[{...s("eyebrow",n("label",14)),styleFrom:h},{kind:"text",key:"title",role:"heading",props:b,style:N,styleFrom:e=>({case:e.uppercase===!0?"upper":"none",...h(e)})},{...z(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{...c,...t.align?{align:t.align}:{},...t.alignPhone?{alignPhone:t.alignPhone}:{}}}}]}]},he=()=>({name:"Image & Text Split",boxProps:(e,t)=>({...m,...M("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...v(e,l),...P(e,72)}),box:[...y,...I(l)],parts:[C(!1),le,C(!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",imageOverlay:"read by the Picture Box: its Darken over the image column's picture (40 when unset, none at 0); no picture, no wash",grayscale:R,...p,...H}}),Se={IntroBleed:ee(),Manifesto:re(),Split:he()};export{Se as EDITORIAL_SECTION_TO_BOX};
|
|
1
|
+
import{phoneKey as K}from"efficient-easel/draw";import{SITE_SIDE as X}from"efficient-easel/screen/lib/content/length-units";import{finiteNumber as r}from"../../../../../format/lib/finite-number.js";import{BLOCK_ALIGN_BOX_WORD as Y}from"../../../../../format/lib/content/block-align.js";import{splitImageOverlay as x}from"../../../../../format/lib/document/blocks/general/Split/meta.js";import{INTRO_SIZE_UNIT_KEYS as j,introSizeUnitsOf as w}from"../../../../../format/lib/content/section-type-size.js";import{PART_UNIT_KEY_OF as T}from"../../part-styles.js";import{parseIntroBleedLayout as G}from"../../../../../format/lib/sections/intro-bleed-layout.js";import{fluidToken as q,token as n}from"./section-head-looks.js";import{labelStyle as Z}from"../../../../../format/lib/document/seed-parts.js";import{BUTTON as c,DIM as B,DROP_COMMON as p,DROP_SIDE_PADDING as H,INNER_BOX as i,NO_PAD as u,NUMBER_TEXT as $,SAME_KEYS as m,SECTION_BOX as y,TEXT as b,fillFrom as O,lineSides as a,pictureCell as A,siteGutterOf as M,smallText as s,wrapperPad as v,wrapperPadKeys as _}from"./section-to-box-row-parts.js";const I=(e,t,o)=>{const k=r(e),f=r(t),S=(V,g)=>g&&g!=="px"?{[V]:g}:{};return{...k===void 0?{}:{size:k,...S(T.size,o?.desktop)},...f===void 0?{}:{sizePhone:f,...S(T.sizePhone,o?.phone)}}},J=e=>G(e.layout)==="stacked",E=e=>Math.min(Math.max(r(e.overlay)??60,0),100),d=e=>r(e)??100,Q={textStyle:"heading-1",sizeToken:{...q("headingLarge",48,7,96).sizeToken,pxPhone:36},weight:500,lineHeight:.95,letterSpacing:-.03},ee=[s("eyebrow",n("label",14)),...[!0,!1].map(e=>({kind:"text",key:"title",role:"heading",props:b,style:{...Q,case:e?"upper":"none"},styleFrom:t=>{const o=w(t);return I(t.titleSizeDesktop,t.titleSizeMobile,{desktop:o.titleDesktop,phone:o.titleMobile})},when:t=>t.uppercase===!0===e})),{kind:"text",key:"body",props:{...B,maxWidth:560},style:{textStyle:"body-1",...n("body",17,16),lineHeight:1.6,paragraphSpacing:24},styleFrom:e=>{const t=w(e);return I(e.bodySizeDesktop,e.bodySizeMobile,{desktop:t.bodyDesktop,phone:t.bodyMobile})}},{kind:"group",name:"Button",props:{...i,align:"start",sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:c}]}],D=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)`,te=()=>({name:"Scroll-Over Text",skip:e=>J(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",...u,placement:"left",darken:E(e),darkenStyle:"even",sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:d(e.heightDesktop),sectionHeightModePhone:"fixed",sectionHeightUnitPhone:"%",sectionHeightValuePhone:d(e.heightMobile)}),box:[...m.filter(e=>!String(typeof e=="string"?e:e[0]).startsWith("sectionHeight")),["imageSrc","bgImage"],["imageSrcMobile","bgImagePhone"],["overlay","darken",(e,t)=>E(t)],["heightDesktop","sectionHeightValue",e=>d(e)],["heightMobile","sectionHeightValuePhone",e=>d(e)]],parts:ee,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",...Object.fromEntries(j.map(e=>[e,"read by its part's `styleFrom`: the unit of that view's Size"])),buttonColor:D("Button color"),buttonTextColor:D("Button text color"),...p}}),N={textStyle:"heading-2",...n("headingMedium",56,36),weight:400,lineHeight:1.05,letterSpacing:-.03},oe={textStyle:"body-1",...n("body",16),lineHeight:1.7},z=e=>({kind:"text",key:"body",props:{...B,maxWidth:520},style:{...oe,paragraphSpacing:e}}),l={top:0,bottom:0,topPhone:0,bottomPhone:0},P=(e,t)=>typeof e.sectionHeightMode=="string"&&e.sectionHeightMode!=="auto"?{}:{sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:t,sectionHeightModePhone:"auto"},ne=(e,t)=>{const o=P(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"}},R={boxShapePhone:"landscape"},U="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)",ie=(e,t)=>({[e]:t,[K(e)]:t}),re={textStyle:"heading-2",...n("headingMedium",40),weight:500,case:"none",lineHeight:1,letterSpacing:-.02},F=e=>(Array.isArray(e.stats)?e.stats:[]).filter(t=>t&&(String(t.value??"").trim()!==""||String(t.label??"").trim()!=="")),ae=()=>({name:"Brand Text",boxProps:(e,t)=>({...y,...O("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...v(e,l),...P(e,100)}),box:[...m,..._(l)],parts:[{kind:"group",name:"Words",props:()=>({...i,justify:"center",gap:28,gapPhone:28,sectionBorder:a({right:1}),sectionBorderPhone:a({}),...u,sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60,sectionPaddingRight:X}),parts:[s("eyebrow",n("label",14)),{kind:"text",key:"heading",role:"heading",props:b,style:{...N,case:"none"},mark:"accentItalic"},z(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(F(e).length,1),3),...ie("sectionBorder",a({top:1})),sectionPaddingTop:28,sectionPaddingTopPhone:28}),parts:[{kind:"list",key:"stats",name:"Stat",of:F,props:{...i,gap:4,gapPhone:4},parts:[{kind:"text",key:"value",props:$,style:re},s("label",{...n("label",13),color:"labels",letterSpacing:.2})]}]}]}]},A("Picture","imageSrc",R)],drop:{...p,grayscale:U,...H}}),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}},se=e=>e.textAlign==="center"||e.textAlign==="right"?Y[e.textAlign]:"stretch",de=e=>Math.min(Math.max(r(e.overlay)??60,0),100),L=e=>typeof e=="string"&&e.trim()!=="",le={...c,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},C=e=>({...A("Picture","imageSrc",(t,o)=>({...L(t.imageSrc)&&x(t.imageOverlay)>0?{darken:x(t.imageOverlay),darkenStyle:"even"}:{},placement:"center",...R,sectionBorder:a(e?{left:1}:{right:1}),...W(e?"left":"right",M(o))}),[{kind:"button",key:"imageBtnText",href:"imageBtnHref",variant:"ghost",props:le,style:{...Z(13,12),letterSpacing:.18}}]),when:t=>t.reverse===!0===e}),W=(e,t)=>{const o=Math.max(60-t,0);return{sectionPaddingLeft:e==="left"?60:o,sectionPaddingRight:e==="right"?60:o}},he={kind:"group",name:"Words",props:(e,t)=>{const o=e.reverse===!0;return{...i,justify:"center",align:se(e),placement:e.textAlign==="center"?"center":e.textAlign==="right"?"right":"left",...ne(e,72),gap:24,gapPhone:24,...L(e.textBgSrc)?{darken:de(e),darkenStyle:"even"}:{},...u,sectionPaddingTop:100,sectionPaddingBottom:100,...W(o?"right":"left",M(t)),sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60}},box:[["textBgSrc","bgImage"]],parts:[{...s("eyebrow",n("label",14)),styleFrom:h},{kind:"text",key:"title",role:"heading",props:b,style:N,styleFrom:e=>({case:e.uppercase===!0?"upper":"none",...h(e)})},{...z(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{...c,...t.align?{align:t.align}:{},...t.alignPhone?{alignPhone:t.alignPhone}:{}}}}]}]},ge=()=>({name:"Image & Text Split",boxProps:(e,t)=>({...y,...O("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...v(e,l),...P(e,72)}),box:[...m,..._(l)],parts:[C(!1),he,C(!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",imageOverlay:"read by the Picture Box: its Darken over the image column's picture (40 when unset, none at 0); no picture, no wash",grayscale:U,...p,...H}}),we={IntroBleed:te(),Manifesto:ae(),Split:ge()};export{we as EDITORIAL_SECTION_TO_BOX};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{phoneKey as c}from"efficient-easel/draw";import{DIM as g,DROP_COMMON as d,DROP_SIDE_PADDING as h,INNER_BOX as o,SAME_KEYS as y,SECTION_BOX as m,TEXT as n,filledChip as k,surfaceAccent as i,wrapperPad as u,wrapperPadKeys as S}from"./section-to-box-row-parts.js";import{relaxedBodyLook as w,token as r}from"../../../../../format/lib/document/seed-parts.js";import{say as s}from"../../../../../format/lib/editor-words.js";import{loopSecondsOf as f}from"../../../../../format/lib/animation/loop.js";import{INTEGRATION_ROWS as b,dealRows as x,rowTurnSeconds as P}from"../../../../../format/lib/sections/integrations-rows.js";const l={top:76,bottom:76,topPhone:76,bottomPhone:76},A=e=>(Array.isArray(e.apps)?e.apps:[]).map(t=>t&&typeof t=="object"&&typeof t.text=="string"?t.text.trim():"").filter(Boolean),a=e=>x(A(e)),O=e=>f({loopDuration:P(e)}),N={kind:"group",name:"Header",props:{...o,align:"center",gap:20,gapPhone:20},parts:[{kind:"group",name:"Chip row",props:{...o,direction:"row",justify:"center",phoneRow:2,[c("share")]:"content"},parts:[k("eyebrow")]},{kind:"text",key:"title",role:"heading",props:{...n,align:"center"},style:{textStyle:"heading-2",...r("headingMedium",40,30),weight:500,case:"upper",lineHeight:1.04,letterSpacing:-.02}},{kind:"text",key:"body",props:{...g,align:"center",maxWidth:568},style:w(16)}]},_=e=>({kind:"group",name:`Row ${e+1}`,when:t=>a(t)[e].length>0,props:t=>({...o,direction:"row",gap:12,gapPhone:12,loop:"scroll",...e%2===1?{scrollDirection:"right"}:{},loopDuration:O(a(t)[e].length)}),parts:[{kind:"block",type:"Logos",props:{contained:!1,headPlacement:"own-box",look:"chips",grayscale:!1},slot:"logos",parts:[{kind:"list",key:"apps",name:"Logo",flat:!0,of:t=>a(t)[e].map(p=>({alt:p})),parts:[{kind:"block",type:"LogoBlock",box:["alt"]}]}]}]}),I={kind:"group",name:"Stat",props:{...o,align:"center",gap:16,gapPhone:16},parts:[{kind:"group",name:"Figure",props:{...o,align:"center",gap:8,gapPhone:8},parts:[{kind:"text",key:"statValue",props:{...n,align:"center"},style:{textStyle:"heading-1",...r("headingLarge",64,46),weight:500,case:"upper",lineHeight:1,color:"accent"}},{kind:"text",key:"statLabel",props:{...n,align:"center"},style:{textStyle:"heading-3",...r("headingSmall",18),weight:500,case:"upper",letterSpacing:.06}}]},{kind:"text",key:"note",props:{...n,align:"center",maxWidth:428},style:{textStyle:"body-1",...r("label",14),lineHeight:1.625,color:"muted"}}]},D=[...y.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,p)=>i(e,p)],...S(l)],E={name:"Integrations",boxProps:(e,t)=>({...m,sectionAccent:i(e.sectionAccent??0,t),direction:"column",gap:48,gapPhone:48,sectionBorder:{top:1,bottom:1},...u(e,l)}),box:D,parts:[N,{kind:"group",name:"Rows",props:{...o,gap:12,gapPhone:12},parts:Array.from({length:b},(e,t)=>_(t))},I],pressKeepsEmpty:["body","statValue","statLabel","note"],reads:{apps:"a Logo block per app, dealt into the three Rows"},drop:{...d,...h}},H={Integrations:E},K=()=>({eyebrow:s("Integrations"),title:s(`Plays well with
|
|
2
|
+
*your favourite apps.*`),apps:["Shopify","Xero","Stripe","Mailchimp","Zapier","HubSpot","QuickBooks","PayPal","Google Analytics"].map(e=>({text:e}))});export{H as INTEGRATIONS_SECTION_TO_BOX,K as integrationsPressStarter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DIM as
|
|
1
|
+
import{DIM as k,DROP_COMMON as r,DROP_SIDE_PADDING as n,FOLLOW_THE_BOX as s,INNER_BOX as o,SAME_KEYS as _,SECTION_BOX as g,TEXT as u,filledChip as y,smallText as P,surfaceAccent as a,wrapperPad as C,wrapperPadKeys as E}from"./section-to-box-row-parts.js";import{relaxedBodyLook as x,token as c}from"../../../../../format/lib/document/seed-parts.js";import{phoneKey as b}from"efficient-easel/draw";import{CHART_OWN_BOX_WORDS as S}from"../../../../../format/lib/document/blocks/general/Chart/meta.js";import{MOCKUP_OWN_BOX_WORDS as f}from"../../../../../format/lib/document/blocks/general/Mockup/meta.js";const i={top:76,bottom:76,topPhone:76,bottomPhone:76},d=()=>({kind:"group",name:"Words",props:{...o,gap:20,gapPhone:20},parts:[{kind:"group",name:"Chip row",props:{...o,direction:"row",phoneRow:2,[b("share")]:"content"},parts:[y("eyebrow")]},{kind:"text",key:"title",role:"heading",props:u,style:{textStyle:"heading-2",...c("headingMedium",44,32),weight:500,case:"upper",lineHeight:1.04,letterSpacing:-.02}},{kind:"text",key:"body",props:{...k,maxWidth:435},style:x(16)}]}),m=e=>(t,p)=>({...g,sectionAccent:a(t.sectionAccent??0,p),direction:"row",align:"center",gap:56,gapPhone:56,share:e,sectionBorder:{top:1,bottom:1},...C(t,i)}),O=[..._.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,p)=>a(e,p)],...E(i)],w=()=>({name:"Chart",boxProps:m([42]),box:O,parts:[d(),{kind:"group",name:"Chart",props:{...o,gap:16,gapPhone:16},keepEmpty:!0,parts:[{kind:"core",keep:"rest",props:s},P("caption",{color:"muted",...c("label",10),letterSpacing:.14})]}],pressKeepsEmpty:[...S],drop:{...r,...n}}),h=e=>e.align==="left",l={kind:"group",name:"Card",keepEmpty:!0,props:o,parts:[{kind:"core",keep:"rest",props:s}]},A=()=>({name:"Mockup Card",boxProps:m("equal"),box:O,parts:[{...l,when:h},d(),{...l,when:e=>!h(e)}],pressKeepsEmpty:[...f],drop:{...r,...n}}),T={Chart:w(),Mockup:A()};export{T as PROOF_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as
|
|
1
|
+
import{hasWords as L,registerSectionToBox as t}from"../../../sections/section-to-box.js";import{BUTTON as T,DIM as f,DROP_COMMON as s,DROP_SIDE_PADDING as O,INNER_BOX as o,leadLine as D,SAME_KEYS as d,SECTION_BOX as p,TEXT as l,innerPad as y,siteGutterOf as w,innerPadKeys as B,smallText as P,wrapperPad as _,wrapperPadKeys as u}from"./section-to-box-row-parts.js";import{CARDS_SECTION_TO_BOX as W}from"./section-to-box-rows-cards.js";import{storedUnit as k}from"../../../../../format/lib/content/css-length.js";import{finiteNumber as M}from"../../../../../format/lib/finite-number.js";import{STATS_SECTION_TO_BOX as G}from"./section-to-box-rows-stats.js";import{LOGOS_SECTION_TO_BOX as U}from"./section-to-box-rows-logos.js";import{STRIP_SECTION_TO_BOX as F}from"./section-to-box-rows-strip.js";import{TIMELINE_SECTION_TO_BOX as K}from"./section-to-box-rows-timeline.js";import{LOCATIONS_SECTION_TO_BOX as Y}from"./section-to-box-rows-locations.js";import{HEAD_ONLY_SECTION_TO_BOX as j}from"./section-to-box-rows-head.js";import{PAGE_HEADER_SECTION_TO_BOX as z}from"./section-to-box-rows-pageheader.js";import{TAB_BAR_SECTION_TO_BOX as q}from"./section-to-box-rows-tabbar.js";import{DOCBODY_SECTION_TO_BOX as J}from"./section-to-box-rows-docbody.js";import{EDITORIAL_SECTION_TO_BOX as Q}from"./section-to-box-rows-editorial.js";import{FORMS_SECTION_TO_BOX as V}from"./section-to-box-rows-forms.js";import{CHECKOUT_SECTION_TO_BOX as Z}from"./section-to-box-rows-checkout.js";import{PROOF_SECTION_TO_BOX as $}from"./section-to-box-rows-proof.js";import{INTEGRATIONS_SECTION_TO_BOX as ee}from"./section-to-box-rows-integrations.js";import{PROMO_SECTION_TO_BOX as te}from"./section-to-box-rows-promo.js";import{FITMENT_SECTION_TO_BOX as oe}from"./section-to-box-rows-fitment.js";import{fluidToken as ne,headTree as E,token as i}from"./section-head-looks.js";import{CTA_PH as b,PH as ie,phAccentAsMarks as m}from"../../../../../format/lib/document/blocks/placeholders.js";import{PROSE_PH as S}from"../../../../../format/lib/document/blocks/general/Prose/meta.js";import{PARAGRAPHS_A_PH as g}from"../../../../../format/lib/document/blocks/general/ParagraphsA/meta.js";import{BANNER_PH as re}from"../../../../../format/lib/document/blocks/general/Banner/meta.js";import{TITLE_WITH_BUTTONS_PH as ae,TITLE_WITH_BUTTONS_SCAFFOLD_BUTTONS as se}from"../../../../../format/lib/document/blocks/general/TitleWithButtons/meta.js";import{SECTION_HEADER_PH as a}from"../../../../../format/lib/document/blocks/general/SectionHeader/meta.js";import{boxPadding as de,fillSlot as pe}from"../../../../../format/lib/document/seed-parts.js";const x={top:72,bottom:72,topPhone:72,bottomPhone:72},le={name:"Editorial Text",boxProps:e=>({...p,direction:"column",gap:28,gapPhone:28,sectionBorder:{top:1},..._(e,x)}),box:[["topBorder","sectionBorder",e=>e===!1?void 0:{top:1}],...d,...u(x)],parts:[E("Prose"),{kind:"text",key:"body",props:f,style:{textStyle:"body-1",...i("body",16),lineHeight:1.7,paragraphSpacing:18}}],drop:{...s,...O,headPlacement:"needs a row per head placement: an own-box Prose draws no head (its words sit in a Section Header above it), the row always draws the head. 0 of 123 live nodes store it (the live export, 2026-10-24)"}},N={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},I=(e,n)=>n?.variant==="primary",A=(e,n)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:e,parts:[{kind:"button",key:"label",href:"href",when:I,variant:"primary",style:{letterSpacing:.3},props:{...T,...N,...n}},{kind:"button",key:"label",href:"href",when:(r,h)=>!I(r,h),variant:"ghost",style:{letterSpacing:.3},props:{...T,...N,...n}}]}),c=e=>L(e.title),he={name:"Call-to-Action Heading",boxProps:e=>({...p,direction:"row",align:"center",justify:c(e)?"between":"end",gap:60,gapPhone:60,share:"content",sectionBorder:{bottom:1},...y(e,"TitleWithButtons")}),box:[...d,...B("TitleWithButtons")],parts:[{kind:"group",name:"Title",props:{...o,maxWidth:1e3,widthFitPhone:"fill"},parts:[{kind:"text",key:"title",role:"heading",props:l,style:{textStyle:"heading-1",...ne("headingLarge",48,7,108),case:"upper",lineHeight:.94,letterSpacing:-.035},mark:"accentItalic"}]},{kind:"group",name:"Buttons",props:e=>({...o,gap:14,gapPhone:14,widthFitPhone:"fill",...c(e)?{minWidth:280,minWidthPhone:0}:{}}),parts:[A(c,{widthFit:"fill",iconPosition:"end"}),A(e=>!c(e),{})]}],drop:{...s,buttonsAlign:"moves the buttons only when there is no heading (4 of 128 live nodes), where the Box puts them at the end. 0 of 128 live nodes store it (the live export, 2026-10-24)",buttonsAlignPhone:"the phone's own side of `buttonsAlign`, read only with no heading; no old node stores it (it is new with the Phone view's Block alignment row), so nothing moves",buttonsAlignTablet:"the tablet's own side of `buttonsAlign`, read only with no heading; no old node stores it (it is new with the Tablet view's Block alignment row, 0 stored on the US sites 2026-11-05), so nothing moves"}};function me(e,n){const r=w(n,{to:k(e.sectionPaddingUnit)}),h=w(n,{view:"phone",to:k(e.sectionPaddingUnitPhone),maxPx:20});return{sectionPaddingLeft:r,sectionPaddingRight:r,sectionPaddingLeftPhone:h,sectionPaddingRightPhone:h}}const H={top:40,bottom:64,topPhone:24,bottomPhone:36},ge={name:"Section Header",boxProps:(e,n)=>({...p,direction:"column",gap:0,..._(e,H),...me(e,n)}),box:[...d,...u(H)],parts:[E("SectionHeader")],drop:{...s,...O,headStyle:"needs a row per head look: the row draws the standard look; the editorial, simple, statement, natural and essay looks are other layouts. 0 of 69 live nodes store it (the live export, 2026-10-24)",eyebrowLook:"read only by the simple, statement, natural and essay looks, which this row does not draw. 0 of 69 live nodes store it",rowGap:"read only by the natural look, which this row does not draw. 0 of 69 live nodes store it",descriptionSize:"read only by the natural look, which this row does not draw. 0 of 69 live nodes store it",numStyle:"Solid (the default; 4 of 69 live nodes store it) IS the eyebrow Text the row draws; Outlined (0 live) needs an outlined-number text look"}},R={...o,direction:"row",share:[67],gap:32},C={...o,sectionPaddingLeft:24,sectionPaddingLeftPhone:0},v=(e,n,r)=>({kind:"group",name:e,props:n,parts:[r]}),ce={name:"Lead Text",boxProps:e=>({...p,direction:"column",gap:40,gapPhone:40,sectionBorder:{bottom:1},...y(e,"ParagraphsA")}),box:[...d,...B("ParagraphsA")],parts:[{kind:"group",name:"Numbers",props:{...R,gapPhone:24,sectionBorder:{bottom:1},sectionPaddingBottom:40,sectionPaddingBottomPhone:40},parts:[{kind:"group",name:"Eyebrow",props:{...o,sectionPaddingTop:5,sectionPaddingBottom:1,sectionPaddingTopPhone:5,sectionPaddingBottomPhone:1},parts:[P("eyebrow",{color:"labels",...i("label",12),letterSpacing:.24})]},v("Stats column",o,{kind:"group",name:"Stats",props:{...C,gap:0,gapPhone:0},parts:[{kind:"list",key:"stats",name:"Stat",flat:!0,parts:[D("value","label",{...i("label",13),letterSpacing:.18,lineHeight:1.8})]}]})]},{kind:"group",name:"Words",props:{...R,gapPhone:28},parts:[{kind:"group",name:"Lead",props:o,parts:[{kind:"group",name:"Measure",props:{...o,maxWidth:780},parts:[{kind:"text",key:"lead",props:l,style:{textStyle:"heading-3",...i("headingSmall",22,20),weight:400,case:"none",lineHeight:1.45,letterSpacing:-.005}}]}]},v("Note column",{...o,justify:"end"},{kind:"group",name:"Founders",props:{...C,gap:8,gapPhone:8},parts:[{kind:"group",name:"Note",props:{...o,gap:6,gapPhone:6},parts:[{kind:"text",key:"foundersHeading",props:l,style:{textStyle:"body-1",fontRole:"heading",...i("body",18,16),weight:500,letterSpacing:-.01,lineHeight:1.7}},{kind:"text",key:"foundersBody",props:f,style:{textStyle:"body-5",fontRole:"heading",...i("body",14,12),lineHeight:1.7}}]},P("attribution",{...i("label",12,10),letterSpacing:.24,lineHeight:1.7})]})]}],drop:{...s}},X={top:24,bottom:24,topPhone:24,bottomPhone:24},Te={name:"Banner",boxProps:e=>({...p,direction:"column",gap:0,..._(e,X)}),box:[...d,"contained",...u(X)],parts:[{kind:"group",name:"Card",keepEmpty:!0,props:{...o,gap:28,gapPhone:28,placement:"top-left",darken:60,darkenStyle:"even",sectionBorder:{width:1},...pe("surface"),...de(64,40,40,24)},box:[["imageSrc","bgImage"],["overlay","darken",e=>Math.min(Math.max(M(e)??60,0),100)]],parts:[{kind:"group",name:"Words",props:{...o,gap:20,gapPhone:20},parts:[P("eyebrow"),{kind:"text",key:"title",role:"heading",props:{...l,maxWidth:680},style:{weight:500,lineHeight:1.05,letterSpacing:-.03,case:"none",...i("headingMedium",44,32)}},{kind:"text",key:"body",props:{...l,maxWidth:680},style:{textStyle:"body-1",lineHeight:1.6,...i("body",16)}}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:T}]}],drop:{...s,...O}},Oe={Prose:le,TitleWithButtons:he,SectionHeader:ge,ParagraphsA:ce,Banner:Te},je={Prose:()=>({eyebrow:S.eyebrow,title:m(S.title),body:S.body}),TitleWithButtons:()=>({title:m(ae.title),buttons:se.map(e=>({...e}))}),SectionHeader:()=>({num:a.num,title:m(a.title),description:a.description,linkText:a.linkText,linkHref:b.href}),ParagraphsA:()=>({eyebrow:g.eyebrow,lead:ie.body,foundersHeading:g.foundersHeading,foundersBody:g.foundersBody,attribution:g.attribution}),Banner:()=>({...re,ctaText:b.text,ctaHref:b.href}),ProcessSteps:()=>({num:a.num,title:m(a.title)})};function ze(){t(Oe),t(G),t(U),t(W),t(F),t(K),t(Y),t(j),t(z),t(q),t(J),t(Q),t(V),t(Z),t(oe),t($),t(ee),t(te)}export{Oe as GENERAL_SECTION_TO_BOX,je as TEXT_PRESS_STARTERS,ze as registerGeneralSectionRows};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ShowWhenRule } from "../../../../format/lib/document/show-when-attach.js";
|
|
2
2
|
import type { BlockPass, PassBlock } from "../../../../format/lib/document/passes/types.js";
|
|
3
|
-
export declare const BOX_BLOCK_KEYS: readonly string[];
|
|
4
3
|
export declare function sitsInBox(key: string, comp: Pick<PassBlock, "sitsInBox"> | undefined): boolean;
|
|
5
4
|
export declare const CELL_WIDTH_SHOW_WHEN: ShowWhenRule;
|
|
6
5
|
export declare const cellWidth: BlockPass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as d}from"react/jsx-runtime";import{HideTaker as f}from"../../../components/ViewHideRoot.js";import{GRID_ROW_SPAN_ATTR as _,GRID_SPAN_ATTR as a,resolveGridRowSpan as c,resolveGridSpan as S}from"../../../../format/lib/content/grid-span.js";import{withRowsShownWhen as m}from"../../../../format/lib/document/show-when-attach.js";import{CONTAINER_BLOCK_CHOICES as
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import{HideTaker as f}from"../../../components/ViewHideRoot.js";import{GRID_ROW_SPAN_ATTR as _,GRID_SPAN_ATTR as a,resolveGridRowSpan as c,resolveGridSpan as S}from"../../../../format/lib/content/grid-span.js";import{withRowsShownWhen as m}from"../../../../format/lib/document/show-when-attach.js";import{CONTAINER_BLOCK_CHOICES as O}from"../../../../format/lib/document/container-blocks.js";import{RETIRED_NESTABLE_SECTIONS as p}from"../../../../format/lib/document/section-catalog.js";import{BOX_MAY_HOLD as u}from"../../../../format/lib/document/passes/slot-rules.js";const l=Array.from(new Set([...O.map(e=>e.type),...u]));function E(e,t){return l.includes(e)||t?.sitsInBox===!0}const I=Array.from(new Set([...l,...p,"GalleryItem"])),R={not:{context:"parentOffersPositions",is:!1}},L={name:"cellWidth",applies:(e,t,r)=>(I.includes(e)||E(e,r))&&!!r&&typeof r.render=="function",panel(e,t,r){const n=r.cellWidthFields;e.fields={...e.fields,...n()},e.fields=m(e.fields??{},Object.keys(n()),R)},draw(e){const t=e.render;e.render=r=>{const n=S(r.gridSpan),i=c(r.gridRowSpan),s=t(r);if(n==null&&i==null)return s;const o={};return n!=null&&(o[a]=String(n)),i!=null&&(o[_]=String(i)),d(f,{className:"sf-grid-cell",...o,children:s})}}};export{R as CELL_WIDTH_SHOW_WHEN,L as cellWidth,E as sitsInBox};
|
|
@@ -5,7 +5,6 @@ export declare const efficientMediaResolve: (ref: string) => string | null;
|
|
|
5
5
|
export declare function absolutizeApiUrl(url: string | null | undefined): string | null;
|
|
6
6
|
export declare function isExternalMediaUrl(src: string): boolean;
|
|
7
7
|
export declare function resolveMedia(src?: string): string | undefined;
|
|
8
|
-
export declare function hasAv1Variant(src?: string): boolean;
|
|
9
8
|
export interface VideoFileSource {
|
|
10
9
|
src: string;
|
|
11
10
|
type: string;
|
package/dist/render/lib/media.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{currentEaselSession as s}from"efficient-easel/screen/lib/session";const n=process.env.NEXT_PUBLIC_MEDIA_URL?.replace(/\/+$/,"");function r(e){const t=s().hostBackend?.media.resolve;if(!(!t||t===c))return t(e)??e}function u(e){return/^(?:https?:)?\/\//i.test(e)||/^(?:data|blob):/i.test(e)}function d(e){return r(e)??i(e)}function i(e){return!n||u(e)?e:n+e.replace(/^\/media/,"")}const c=e=>i(e),a=process.env.NEXT_PUBLIC_API_URL??"";function
|
|
1
|
+
import{currentEaselSession as s}from"efficient-easel/screen/lib/session";const n=process.env.NEXT_PUBLIC_MEDIA_URL?.replace(/\/+$/,"");function r(e){const t=s().hostBackend?.media.resolve;if(!(!t||t===c))return t(e)??e}function u(e){return/^(?:https?:)?\/\//i.test(e)||/^(?:data|blob):/i.test(e)}function d(e){return r(e)??i(e)}function i(e){return!n||u(e)?e:n+e.replace(/^\/media/,"")}const c=e=>i(e),a=process.env.NEXT_PUBLIC_API_URL??"";function _(e){if(!e)return null;const t=r(e);return t!==void 0?t:e.startsWith("/")?`${a}${e}`:e}function h(e){return/^https?:\/\//i.test(e)&&!(n&&e.startsWith(n+"/"))}function l(e){if(!e)return;const t=r(e);return t!==void 0?t:e.startsWith("/media/")?d(e):e}const f="/videos/products/";function p(e){return!!e&&e.includes(f)}const v='video/mp4; codecs="av01.0.08M.10"';function m(e,t){if(!e)return[];const o=t||(p(e)?e.replace(/\.mp4$/,".av1.mp4"):"");return[...o?[{src:o,type:v}]:[],{src:e,type:"video/mp4"}]}function x(e,t){return t&&e.videoPhone?{video:e.videoPhone,av1:e.av1Phone}:{video:e.video,av1:e.av1}}export{_ as absolutizeApiUrl,i as efficientMedia,c as efficientMediaResolve,u as isAbsoluteUrl,h as isExternalMediaUrl,d as media,l as resolveMedia,x as videoForView,m as videoSources};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readHidable as Z}from"efficient-easel/draw";import{BOX_TYPE as ee,CONTAINER_BLOCKS_SLOT as te}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as oe,labelTextSeed as ne}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as se,parseSectionHeadPlacement as re}from"../../../format/lib/sections/section-head-placement.js";import{accentItalicRuns as ie}from"../../../format/lib/markup.js";import{seedNodes as ce}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ae}from"../../../format/lib/locations-grid.js";import{normalizeTheme as z}from"../../../format/lib/theme.js";import{hasOwnEntry as R,ownEntry as E}from"../../../format/lib/own-entry.js";const v=ee,_=te;function Ie(t){if(t.theme)return z(t.theme);const o=t.site?.themePresets;return o?z({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function de(t,o){return o===0?`${t}~box`:`${t}~box-${o+1}`}const A={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box), and its Scrolling Bar is a Box in its strip slot (Hero › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function Ne(t){for(const[o,s]of Object.entries(t)){if(R(A,o)&&E(A,o)!==s)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=s}}function Re(t){return E(A,t)}const Y=new Set(["id"]),P={},W=[],fe={ProductGrid:["ProductColour","ProductEyebrow","ProductName","ProductPicture","ProductPrice","ProductRef","ProductSpecs"],Events:[],Collections:["CollectionCard"],GalleryB:["GalleryItem"],ContactRouting:[],ReviewForm:[],AppointmentBooking:["BookingBox"],Reviews:["RatingBlock"],CheckoutCTA:[],AlloyWheelsListing:["ProductBuy","ProductColour","ProductEyebrow","ProductName","ProductPicture","ProductPrice","ProductSpecs"],SpecTable:["EuTyreLabelBlock","WheelDiagram"]},le=Object.keys(fe),pe=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ","ProcessSteps",...le,"Stats","Logos","PaymentBadges","PaymentLogosBlock","FitmentFinder","DocMasthead","DocTabs","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Countdown","FeaturedCover","SectionHeader","TitleWithButtons","Prose","ParagraphsA","Banner","Cards"];function Ae(t){for(const[o,s]of Object.entries(t)){if(R(P,o)&&E(P,o)!==s)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);P[o]=s}}function Le(t){return E(P,t)}function He(){return Object.keys(P)}function ue(t){return R(P,t)&&W.includes(t)}function Fe(t,o=pe){return R(P,t)&&(o.includes(t)||ue(t))}function We(t){const o=E(se,t);if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const s=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&s.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&s.push({kind:"button",key:"linkText",href:"linkHref"}),s}const K=t=>Z(t),Ke=t=>K(t).text.trim()!=="";function he(t){if(t.includes("=="))return t;const o=t.indexOf("/"),s=o===-1?t:t.slice(0,o),r=s.trim();if(!r)return t;const a=s.indexOf(r);return`${s.slice(0,a)}==${r}==${s.slice(a+r.length)}${o===-1?"":t.slice(o)}`}const ye=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function me(t,o,s,r){const c={...t._partStyles?.text??{},...o??{},...s??{}};return(r==="center"||r==="right")&&c.align===void 0&&(c.align=r),Object.keys(c).length?{_partStyles:{text:c}}:{}}function ke(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const s=o[t.key];return{variant:(typeof s=="string"?E(t.map,s):void 0)??t.fallback}}function V(t,o,s,r,a={}){const c={...o};for(const u of t){const[m,$,j]=typeof u=="string"?[u,u,void 0]:u;if(s[m]===void 0)continue;const C=j?j(s[m],s,a):s[m];C===void 0?delete c[$]:c[$]=C,r(m,$,C===void 0)}return c}function be(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),s=a=>{for(const c of a??[])o.add(typeof c=="string"?c:c[0])},r=a=>{for(const c of a)switch(c.kind){case"text":case"image":o.add(c.key),c.kind==="image"&&c.alt&&o.add(c.alt);break;case"button":o.add(c.key),o.add(c.href),typeof c.variant=="object"&&o.add(c.variant.key);break;case"list":o.add(c.key);break;case"group":case"block":s(c.box),r(c.parts??[]);break;case"core":if(c.keep!=="rest"&&c.keep.forEach(u=>o.add(u)),Object.keys(c.rename??{}).forEach(u=>o.add(u)),c.derive?.reads.forEach(u=>o.add(u)),typeof c.slots!="function")for(const u of Object.values(c.slots??{}))for(const m of u)"kind"in m&&o.add(m.key);break}};for(const a of[t,...t.also??[]])s(a.box),r(a.parts);return o}const ge=t=>re(t.headPlacement)==="own-box";function xe(t){return ge(t)?"its head sits in a Box of its own above it (own-box): the row draws the head inline":void 0}function we(t,o){const s=t[o];return Array.isArray(s)&&s.some(a=>!!a&&typeof a=="object"&&typeof a.type=="string")?"already on the Box path: its items draw from a filled card template":void 0}function Be(t){const o=new Set,s=r=>{for(const a of r)if(a.kind==="group"||a.kind==="block")s(a.parts??[]);else if(a.kind==="core"&&a.slots&&typeof a.slots!="function")for(const[c,u]of Object.entries(a.slots))u.length>0&&u.every(m=>!("kind"in m))&&o.add(c)};for(const r of[t,...t.also??[]])s(r.parts);return[...o]}function Se(t,o,s){if(!s.press)for(const r of Be(t)){const a=we(o,r);if(a!==void 0)return a}}function Q(t,o,s={}){const r=t.props,a=(o.ownBoxConverts?void 0:xe(r))??Se(o,r,s)??o.skip?.(r);if(a!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],skipped:a};const c=String(r.id??t.type),u=[],m=[],$=new Set,j=(n,i)=>{u.push({key:n,home:i}),$.add(n)},C=r._partStyles??{},L=be(o);let M=0;const w=(n,i)=>({type:n,props:{...i,id:`${c}~${n}-${++M}`}}),X=(n,i,b,y,g,l,B)=>{if(g){for(const d of n??[]){const h=typeof d=="string"?d:d[0];b[h]!==void 0&&B(h,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof i=="function"?i(r,s):i??{};return V(n??[],e,b,(d,h,f)=>B(d,f?`nothing — the old value draws nothing (${y}: no ${h})`:`${l}${y}: ${h}`),s)},q=n=>ce(n,i=>`${c}~${i}-${++M}`),D=(n,i,b)=>{const y=n.of?n.of(i):Array.isArray(i[n.key])?i[n.key]:[],g=typeof n.props=="function"?n.props(r,s):n.props??{},l=y.map((f,x)=>{const p=f??{},k=n.item?.(p,x,r)??{},S=I(k.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${x+1}: `);return n.flat?k.props?S.map(T=>({...T,props:{...T.props,...k.props,id:T.props.id}})):S:[w(v,{name:`${n.name} ${x+1}`,...g,...k.props??{},[_]:S})]});if(n.groups){const f=n.groups;return b(n.key,y.length?`one Box per item (${y.length}), in a Box per group`:"nothing — the list is empty"),ae(y.map(x=>x??{}),f.of,f.of).map((x,p)=>{const k=x.items.map(O=>O.item),S=f.parts?I(f.parts,f.head?.(k,r)??{},!1,`group ${p+1}: `):[],T=x.items.map(O=>l[O.index]),H=f.perRow?.(k.length,r),N=Number.isInteger(H)&&H>=1?H:1,F=[];if(f.perRow&&N<T.length)for(let O=0;O*N<T.length;O++)F.push(T.slice(O*N,(O+1)*N).flat());return w(v,{name:`${f.name} ${p+1}`,...f.props??{},[_]:[...S,w(v,{name:`${f.itemsName} ${p+1}`,...f.itemsProps?.(k.length,r)??{},[_]:F.length?F.map((O,U)=>w(v,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[_]:O})):T.flat()})]})})}const B=n.perRow?.(r),e=n.perRow?Number.isInteger(B)&&B>=1?B:1:0;if(b(n.key,(y.length?n.flat?`each item's parts (${y.length} items), in order`:`one Box per item (${y.length}), its parts inside`:"nothing — the list is empty")+(e&&y.length?`, in rows of ${e}`:"")),!e)return l.flat();const d=typeof n.rowProps=="function"?n.rowProps(r,s):n.rowProps??{},h=[];for(let f=0;f*e<l.length;f++){const x=l.slice(f*e,(f+1)*e).flat(),p=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;h.push(w(v,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...d,[_]:[...x,...Array.from({length:p},(k,S)=>w(v,{name:`Empty ${S+1}`,...n.rowFiller,[_]:[]}))]}))}return h},I=(n,i,b,y)=>{const g=[],l=(e,d)=>b?j(e,d):void 0,B=e=>b?C[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:i)))switch(e.kind){case"text":{const d=K(i[e.key]);if(!d.text.trim()&&!(b&&s.press&&o.pressKeepsEmpty?.includes(e.key))){l(e.key,"nothing — empty words draw nothing, so no block");break}const h=ye(e.role??"body"),{_partStyles:f,...x}=h,p=me(h,e.styleFrom?{...e.style,...e.styleFrom(r,s)}:e.style,B(e.key),e.props?.align);g.push(w("Text",{text:e.mark==="accentLead"?he(d.text):e.mark==="accentItalic"?ie(d.text):d.text,...x,...e.props??{},...p,...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Text block: its words${d.hidden?", hidden":""}`);break}case"button":{const d=K(i[e.key]);if(!d.text.trim()){l(e.key,"nothing — no words, no button"),l(e.href,"nothing — no button to link"),typeof e.variant=="object"&&l(e.variant.key,"nothing — no button to style");break}const h=typeof i[e.href]=="string"&&i[e.href]?i[e.href]:"#",f={...e.style??{},...B(e.key)??{}};g.push(w("ButtonBlock",{label:d.text,href:h,...typeof e.props=="function"?e.props(i,s):e.props??{},...ke(e.variant,i),...Object.keys(f).length?{_partStyles:{label:f}}:{},...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Button block: its words`),l(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${y}Button block: its Style`);break}case"image":{const d=i[e.key];if(typeof d!="string"||!d){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const h=e.alt&&typeof i[e.alt]=="string"?i[e.alt]:"";g.push(w("ImageBlock",{src:d,alt:h,...e.props??{}})),l(e.key,`${y}Image block: its picture`),e.alt&&l(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...D(e,i,l));break}case"group":{const d=I(e.parts,i,b,y),h=X(e.box,e.props,i,`${e.name} Box`,!d.length&&!e.keepEmpty,y,l);h&&g.push(w(v,{name:e.name,...h,[_]:d}));break}case"block":{const d=e.parts?I(e.parts,i,b,y):[],h=X(e.box,e.props,i,`${e.type} block`,!!e.parts&&!d.length&&!e.keepEmpty,y,l);h&&g.push(w(e.type,{...h,...e.slot?{[e.slot]:d}:{}}));break}case"core":{const d=e.as??t.type,h={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(i).filter(p=>!L.has(p)&&!(p in h)):e.keep;for(const p of f)i[p]!==void 0&&(h[p]=i[p],l(p,`the ${d} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))i[k]!==void 0&&!L.has(k)&&l(k,`nothing — the ${d} block inside the Box has the row's own value`);i.headPlacement!==void 0&&l("headPlacement",`the ${d} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(C).filter(([k])=>!L.has(k)));Object.keys(p).length&&(h._partStyles=p)}for(const[p,k]of Object.entries(e.rename??{}))i[p]!==void 0&&(h[k]=i[p],l(p,`the ${d} block inside the Box: ${k}`));if(e.derive){Object.assign(h,e.derive.props(i,s));for(const p of e.derive.reads)i[p]!==void 0&&l(p,`the ${d} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(i,s):e.slots??{};for(const[p,k]of Object.entries(x))h[p]=k.flatMap(S=>"kind"in S?D(S,i,l):q([S]));g.push(w(d,h));break}}return g},J=(n,i)=>{const b=i===0?"Box":`${n.name} Box`,y=I(n.parts,r,!0,i===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,s):n.boxProps??{},l=V(n.box??[],g,r,(B,e,d)=>j(B,d?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),s);return{type:v,props:{name:n.name,...l,[_]:y,id:de(c,i)}}},G=[o,...o.also??[]].map(J);r._partStyles!==void 0&&j("_partStyles","each old part's style moved to its new part");for(const[n,i]of Object.entries(o.reads??{}))r[n]!==void 0&&j(n,i);for(const[n,i]of Object.entries(o.drop??{}))n in r&&(m.push({key:n,why:i}),$.add(n));for(const n of Object.keys(r))Y.has(n)||$.has(n)||m.push({key:n,why:"not in the row — not carried"});return{node:G[0],nodes:G,carried:u,dropped:m,siteWrites:[...o.site?.(t,s)??[]]}}function Me(t,o=W,s={}){const r=t.content;if(!Array.isArray(r))return t;let a=!1;const c=r.flatMap(u=>{const m=u&&typeof u.type=="string"&&o.includes(u.type)?E(P,u.type):void 0;if(!m)return[u];const $=Q(u,m,s);return $.skipped!==void 0?[u]:(a=!0,$.nodes)});return a?{...t,content:c}:t}function Xe(t,o=W,s={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((a,c)=>{const u=a&&typeof a.type=="string"&&o.includes(a.type)?E(P,a.type):void 0;if(!u)return;const m=Q(a,u,s);m.skipped===void 0&&r.push({index:c,node:m.node,nodes:m.nodes})}),r}export{fe as HOST_PRESS_BLOCKS,le as HOST_PRESS_TYPES,_ as SECTION_BOX_SLOT,v as SECTION_BOX_TYPE,W as SECTION_TO_BOX_ON,pe as SECTION_TO_BOX_PRESS,Re as boxNativeReason,Q as convertSection,Me as convertSectionsInPage,Ie as convertTheme,ue as convertsToBox,we as filledTemplateHold,Ke as hasWords,ge as headInOwnBox,We as headParts,xe as ownBoxHold,Fe as pressesAsBox,Ne as registerBoxNativeSections,Ae as registerSectionToBox,de as sectionBoxIdOf,Xe as sectionToBoxEdits,Le as sectionToBoxRow,He as sectionToBoxTypes};
|
|
1
|
+
import{readHidable as Z}from"efficient-easel/draw";import{BOX_TYPE as ee,CONTAINER_BLOCKS_SLOT as te}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as oe,labelTextSeed as ne}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as se,parseSectionHeadPlacement as re}from"../../../format/lib/sections/section-head-placement.js";import{accentItalicRuns as ie}from"../../../format/lib/markup.js";import{seedNodes as ce}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ae}from"../../../format/lib/locations-grid.js";import{normalizeTheme as z}from"../../../format/lib/theme.js";import{hasOwnEntry as R,ownEntry as E}from"../../../format/lib/own-entry.js";const v=ee,_=te;function Ie(t){if(t.theme)return z(t.theme);const o=t.site?.themePresets;return o?z({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function de(t,o){return o===0?`${t}~box`:`${t}~box-${o+1}`}const A={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box), and its Scrolling Bar is a Box in its strip slot (Hero › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function Ne(t){for(const[o,s]of Object.entries(t)){if(R(A,o)&&E(A,o)!==s)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=s}}function Re(t){return E(A,t)}const Y=new Set(["id"]),P={},W=[],fe={ProductGrid:["ProductColour","ProductEyebrow","ProductName","ProductPicture","ProductPrice","ProductRef","ProductSpecs"],Events:[],Collections:["CollectionCard"],GalleryB:["GalleryItem"],ContactRouting:[],ReviewForm:[],AppointmentBooking:["BookingBox"],Reviews:["RatingBlock"],CheckoutCTA:[],AlloyWheelsListing:["ProductBuy","ProductColour","ProductEyebrow","ProductName","ProductPicture","ProductPrice","ProductSpecs"],SpecTable:["EuTyreLabelBlock","WheelDiagram"]},le=Object.keys(fe),pe=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ","ProcessSteps",...le,"Stats","Logos","PaymentBadges","PaymentLogosBlock","FitmentFinder","DocMasthead","DocTabs","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Integrations","Countdown","FeaturedCover","SectionHeader","TitleWithButtons","Prose","ParagraphsA","Banner","Cards"];function Ae(t){for(const[o,s]of Object.entries(t)){if(R(P,o)&&E(P,o)!==s)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);P[o]=s}}function Le(t){return E(P,t)}function He(){return Object.keys(P)}function ue(t){return R(P,t)&&W.includes(t)}function Fe(t,o=pe){return R(P,t)&&(o.includes(t)||ue(t))}function We(t){const o=E(se,t);if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const s=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&s.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&s.push({kind:"button",key:"linkText",href:"linkHref"}),s}const K=t=>Z(t),Ke=t=>K(t).text.trim()!=="";function he(t){if(t.includes("=="))return t;const o=t.indexOf("/"),s=o===-1?t:t.slice(0,o),r=s.trim();if(!r)return t;const a=s.indexOf(r);return`${s.slice(0,a)}==${r}==${s.slice(a+r.length)}${o===-1?"":t.slice(o)}`}const ye=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function me(t,o,s,r){const c={...t._partStyles?.text??{},...o??{},...s??{}};return(r==="center"||r==="right")&&c.align===void 0&&(c.align=r),Object.keys(c).length?{_partStyles:{text:c}}:{}}function ke(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const s=o[t.key];return{variant:(typeof s=="string"?E(t.map,s):void 0)??t.fallback}}function V(t,o,s,r,a={}){const c={...o};for(const u of t){const[m,$,j]=typeof u=="string"?[u,u,void 0]:u;if(s[m]===void 0)continue;const C=j?j(s[m],s,a):s[m];C===void 0?delete c[$]:c[$]=C,r(m,$,C===void 0)}return c}function be(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),s=a=>{for(const c of a??[])o.add(typeof c=="string"?c:c[0])},r=a=>{for(const c of a)switch(c.kind){case"text":case"image":o.add(c.key),c.kind==="image"&&c.alt&&o.add(c.alt);break;case"button":o.add(c.key),o.add(c.href),typeof c.variant=="object"&&o.add(c.variant.key);break;case"list":o.add(c.key);break;case"group":case"block":s(c.box),r(c.parts??[]);break;case"core":if(c.keep!=="rest"&&c.keep.forEach(u=>o.add(u)),Object.keys(c.rename??{}).forEach(u=>o.add(u)),c.derive?.reads.forEach(u=>o.add(u)),typeof c.slots!="function")for(const u of Object.values(c.slots??{}))for(const m of u)"kind"in m&&o.add(m.key);break}};for(const a of[t,...t.also??[]])s(a.box),r(a.parts);return o}const ge=t=>re(t.headPlacement)==="own-box";function xe(t){return ge(t)?"its head sits in a Box of its own above it (own-box): the row draws the head inline":void 0}function we(t,o){const s=t[o];return Array.isArray(s)&&s.some(a=>!!a&&typeof a=="object"&&typeof a.type=="string")?"already on the Box path: its items draw from a filled card template":void 0}function Be(t){const o=new Set,s=r=>{for(const a of r)if(a.kind==="group"||a.kind==="block")s(a.parts??[]);else if(a.kind==="core"&&a.slots&&typeof a.slots!="function")for(const[c,u]of Object.entries(a.slots))u.length>0&&u.every(m=>!("kind"in m))&&o.add(c)};for(const r of[t,...t.also??[]])s(r.parts);return[...o]}function Se(t,o,s){if(!s.press)for(const r of Be(t)){const a=we(o,r);if(a!==void 0)return a}}function Q(t,o,s={}){const r=t.props,a=(o.ownBoxConverts?void 0:xe(r))??Se(o,r,s)??o.skip?.(r);if(a!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],skipped:a};const c=String(r.id??t.type),u=[],m=[],$=new Set,j=(n,i)=>{u.push({key:n,home:i}),$.add(n)},C=r._partStyles??{},L=be(o);let M=0;const w=(n,i)=>({type:n,props:{...i,id:`${c}~${n}-${++M}`}}),X=(n,i,b,y,g,l,B)=>{if(g){for(const d of n??[]){const h=typeof d=="string"?d:d[0];b[h]!==void 0&&B(h,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof i=="function"?i(r,s):i??{};return V(n??[],e,b,(d,h,f)=>B(d,f?`nothing — the old value draws nothing (${y}: no ${h})`:`${l}${y}: ${h}`),s)},q=n=>ce(n,i=>`${c}~${i}-${++M}`),D=(n,i,b)=>{const y=n.of?n.of(i):Array.isArray(i[n.key])?i[n.key]:[],g=typeof n.props=="function"?n.props(r,s):n.props??{},l=y.map((f,x)=>{const p=f??{},k=n.item?.(p,x,r)??{},S=I(k.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${x+1}: `);return n.flat?k.props?S.map(T=>({...T,props:{...T.props,...k.props,id:T.props.id}})):S:[w(v,{name:`${n.name} ${x+1}`,...g,...k.props??{},[_]:S})]});if(n.groups){const f=n.groups;return b(n.key,y.length?`one Box per item (${y.length}), in a Box per group`:"nothing — the list is empty"),ae(y.map(x=>x??{}),f.of,f.of).map((x,p)=>{const k=x.items.map(O=>O.item),S=f.parts?I(f.parts,f.head?.(k,r)??{},!1,`group ${p+1}: `):[],T=x.items.map(O=>l[O.index]),H=f.perRow?.(k.length,r),N=Number.isInteger(H)&&H>=1?H:1,F=[];if(f.perRow&&N<T.length)for(let O=0;O*N<T.length;O++)F.push(T.slice(O*N,(O+1)*N).flat());return w(v,{name:`${f.name} ${p+1}`,...f.props??{},[_]:[...S,w(v,{name:`${f.itemsName} ${p+1}`,...f.itemsProps?.(k.length,r)??{},[_]:F.length?F.map((O,U)=>w(v,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[_]:O})):T.flat()})]})})}const B=n.perRow?.(r),e=n.perRow?Number.isInteger(B)&&B>=1?B:1:0;if(b(n.key,(y.length?n.flat?`each item's parts (${y.length} items), in order`:`one Box per item (${y.length}), its parts inside`:"nothing — the list is empty")+(e&&y.length?`, in rows of ${e}`:"")),!e)return l.flat();const d=typeof n.rowProps=="function"?n.rowProps(r,s):n.rowProps??{},h=[];for(let f=0;f*e<l.length;f++){const x=l.slice(f*e,(f+1)*e).flat(),p=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;h.push(w(v,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...d,[_]:[...x,...Array.from({length:p},(k,S)=>w(v,{name:`Empty ${S+1}`,...n.rowFiller,[_]:[]}))]}))}return h},I=(n,i,b,y)=>{const g=[],l=(e,d)=>b?j(e,d):void 0,B=e=>b?C[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:i)))switch(e.kind){case"text":{const d=K(i[e.key]);if(!d.text.trim()&&!(b&&s.press&&o.pressKeepsEmpty?.includes(e.key))){l(e.key,"nothing — empty words draw nothing, so no block");break}const h=ye(e.role??"body"),{_partStyles:f,...x}=h,p=me(h,e.styleFrom?{...e.style,...e.styleFrom(r,s)}:e.style,B(e.key),e.props?.align);g.push(w("Text",{text:e.mark==="accentLead"?he(d.text):e.mark==="accentItalic"?ie(d.text):d.text,...x,...e.props??{},...p,...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Text block: its words${d.hidden?", hidden":""}`);break}case"button":{const d=K(i[e.key]);if(!d.text.trim()){l(e.key,"nothing — no words, no button"),l(e.href,"nothing — no button to link"),typeof e.variant=="object"&&l(e.variant.key,"nothing — no button to style");break}const h=typeof i[e.href]=="string"&&i[e.href]?i[e.href]:"#",f={...e.style??{},...B(e.key)??{}};g.push(w("ButtonBlock",{label:d.text,href:h,...typeof e.props=="function"?e.props(i,s):e.props??{},...ke(e.variant,i),...Object.keys(f).length?{_partStyles:{label:f}}:{},...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Button block: its words`),l(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${y}Button block: its Style`);break}case"image":{const d=i[e.key];if(typeof d!="string"||!d){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const h=e.alt&&typeof i[e.alt]=="string"?i[e.alt]:"";g.push(w("ImageBlock",{src:d,alt:h,...e.props??{}})),l(e.key,`${y}Image block: its picture`),e.alt&&l(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...D(e,i,l));break}case"group":{const d=I(e.parts,i,b,y),h=X(e.box,e.props,i,`${e.name} Box`,!d.length&&!e.keepEmpty,y,l);h&&g.push(w(v,{name:e.name,...h,[_]:d}));break}case"block":{const d=e.parts?I(e.parts,i,b,y):[],h=X(e.box,e.props,i,`${e.type} block`,!!e.parts&&!d.length&&!e.keepEmpty,y,l);h&&g.push(w(e.type,{...h,...e.slot?{[e.slot]:d}:{}}));break}case"core":{const d=e.as??t.type,h={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(i).filter(p=>!L.has(p)&&!(p in h)):e.keep;for(const p of f)i[p]!==void 0&&(h[p]=i[p],l(p,`the ${d} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))i[k]!==void 0&&!L.has(k)&&l(k,`nothing — the ${d} block inside the Box has the row's own value`);i.headPlacement!==void 0&&l("headPlacement",`the ${d} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(C).filter(([k])=>!L.has(k)));Object.keys(p).length&&(h._partStyles=p)}for(const[p,k]of Object.entries(e.rename??{}))i[p]!==void 0&&(h[k]=i[p],l(p,`the ${d} block inside the Box: ${k}`));if(e.derive){Object.assign(h,e.derive.props(i,s));for(const p of e.derive.reads)i[p]!==void 0&&l(p,`the ${d} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(i,s):e.slots??{};for(const[p,k]of Object.entries(x))h[p]=k.flatMap(S=>"kind"in S?D(S,i,l):q([S]));g.push(w(d,h));break}}return g},J=(n,i)=>{const b=i===0?"Box":`${n.name} Box`,y=I(n.parts,r,!0,i===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,s):n.boxProps??{},l=V(n.box??[],g,r,(B,e,d)=>j(B,d?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),s);return{type:v,props:{name:n.name,...l,[_]:y,id:de(c,i)}}},G=[o,...o.also??[]].map(J);r._partStyles!==void 0&&j("_partStyles","each old part's style moved to its new part");for(const[n,i]of Object.entries(o.reads??{}))r[n]!==void 0&&j(n,i);for(const[n,i]of Object.entries(o.drop??{}))n in r&&(m.push({key:n,why:i}),$.add(n));for(const n of Object.keys(r))Y.has(n)||$.has(n)||m.push({key:n,why:"not in the row — not carried"});return{node:G[0],nodes:G,carried:u,dropped:m,siteWrites:[...o.site?.(t,s)??[]]}}function Me(t,o=W,s={}){const r=t.content;if(!Array.isArray(r))return t;let a=!1;const c=r.flatMap(u=>{const m=u&&typeof u.type=="string"&&o.includes(u.type)?E(P,u.type):void 0;if(!m)return[u];const $=Q(u,m,s);return $.skipped!==void 0?[u]:(a=!0,$.nodes)});return a?{...t,content:c}:t}function Xe(t,o=W,s={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((a,c)=>{const u=a&&typeof a.type=="string"&&o.includes(a.type)?E(P,a.type):void 0;if(!u)return;const m=Q(a,u,s);m.skipped===void 0&&r.push({index:c,node:m.node,nodes:m.nodes})}),r}export{fe as HOST_PRESS_BLOCKS,le as HOST_PRESS_TYPES,_ as SECTION_BOX_SLOT,v as SECTION_BOX_TYPE,W as SECTION_TO_BOX_ON,pe as SECTION_TO_BOX_PRESS,Re as boxNativeReason,Q as convertSection,Me as convertSectionsInPage,Ie as convertTheme,ue as convertsToBox,we as filledTemplateHold,Ke as hasWords,ge as headInOwnBox,We as headParts,xe as ownBoxHold,Fe as pressesAsBox,Ne as registerBoxNativeSections,Ae as registerSectionToBox,de as sectionBoxIdOf,Xe as sectionToBoxEdits,Le as sectionToBoxRow,He as sectionToBoxTypes};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "69.1.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",
|
|
@@ -55,11 +55,10 @@
|
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@tabler/icons-react": "^3.46.0",
|
|
57
57
|
"efficient-easel": "^34.3.0",
|
|
58
|
-
"efficient-shell": "^13.
|
|
58
|
+
"efficient-shell": "^13.3.0",
|
|
59
59
|
"isomorphic-dompurify": "^3.18.0",
|
|
60
60
|
"next": ">=16",
|
|
61
61
|
"react": ">=19",
|
|
62
|
-
"simple-icons": "^16.26.0",
|
|
63
62
|
"typescript": "^5"
|
|
64
63
|
},
|
|
65
64
|
"peerDependenciesMeta": {
|
|
@@ -74,8 +73,8 @@
|
|
|
74
73
|
"@types/node": "^20",
|
|
75
74
|
"@types/react": "^19",
|
|
76
75
|
"@types/react-dom": "^19",
|
|
77
|
-
"efficient-easel": "^34.3.
|
|
78
|
-
"efficient-shell": "^13.
|
|
76
|
+
"efficient-easel": "^34.3.2",
|
|
77
|
+
"efficient-shell": "^13.3.0",
|
|
79
78
|
"efficient-shell-checker": "npm:efficient-shell@12.37.0",
|
|
80
79
|
"esbuild": "^0.28.0",
|
|
81
80
|
"happy-dom": "^20.14.5",
|
|
@@ -85,7 +84,6 @@
|
|
|
85
84
|
"playwright": "^1.63.0",
|
|
86
85
|
"react": "19.2.4",
|
|
87
86
|
"react-dom": "19.2.4",
|
|
88
|
-
"simple-icons": "^16.26.0",
|
|
89
87
|
"tailwindcss": "^4.3.3",
|
|
90
88
|
"tsx": "4.22.3",
|
|
91
89
|
"typescript": "^5"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{siAdyen as a,siAfterpay as o,siAircall as r,siAmericanexpress as e,siApplepay as l,siBigcommerce as t,siBrevo as n,siCalendly as p,siCampaignmonitor as g,siDhl as m,siDropbox as c,siEbay as y,siEtsy as d,siFacebook as u,siFedex as b,siGmail as k,siGoogleads as h,siGoogleanalytics as x,siGooglecalendar as f,siGoogledrive as G,siGooglepay as M,siGooglesheets as v,siHubspot as S,siInstagram as q,siIntercom as w,siKlarna as A,siMailchimp as z,siMailgun as C,siMake as I,siMastercard as W,siMessenger as T,siMeta as i,siMyob as Z,siNotion as B,siPaypal as D,siPinterest as E,siQuickbooks as F,siSage as N,siShopify as P,siSquare as V,siSquarespace as H,siStripe as K,siTelegram as L,siTiktok as O,siTrello as Q,siUps as U,siVisa as X,siVonage as Y,siWhatsapp as j,siWise as J,siWix as R,siWoocommerce as _,siXero as $,siYoutube as ee,siZapier as ie,siZendesk as se,siZoom as ae}from"simple-icons";const oe={adyen:a,afterpay:o,aircall:r,americanexpress:e,amex:e,applepay:l,bigcommerce:t,brevo:n,calendly:p,campaignmonitor:g,dhl:m,dropbox:c,ebay:y,etsy:d,facebook:u,fedex:b,gmail:k,googleads:h,googleanalytics:x,googlecalendar:f,googledrive:G,googlepay:M,googlesheets:v,hubspot:S,instagram:q,intercom:w,klarna:A,mailchimp:z,mailgun:C,make:I,mastercard:W,messenger:T,meta:i,metaads:i,myob:Z,notion:B,paypal:D,pinterest:E,quickbooks:F,sage:N,shopify:P,square:V,squarespace:H,stripe:K,telegram:L,tiktok:O,trello:Q,ups:U,visa:X,vonage:Y,whatsapp:j,wise:J,wix:R,woocommerce:_,xero:$,youtube:ee,zapier:ie,zendesk:se,zoom:ae};function le(s){return oe[s.toLowerCase().replace(/[^a-z0-9]/g,"")]??null}export{le as integrationIcon};
|