efficient-web-builder 48.1.1 → 48.3.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 +26 -0
- package/dist/editor/components/HoverEffectField.js +1 -1
- package/dist/editor/lib/animation/AnimationDurationRow.d.ts +3 -0
- package/dist/editor/lib/animation/AnimationDurationRow.js +1 -1
- package/dist/editor/lib/animation/fields.d.ts +2 -2
- package/dist/editor/lib/animation/fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.d.ts +2 -0
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
- package/dist/editor/lib/document/blocks/hero-shared-fields.d.ts +15 -0
- package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -0
- package/dist/editor/lib/document/controls.d.ts +1 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/sections/city-presets.d.ts +1 -1
- package/dist/editor/lib/sections/city-presets.js +1 -1
- package/dist/editor/lib/sections/text-layouts.d.ts +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/animation/hover.d.ts +32 -2
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/box-separator.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/box-shape.js +1 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +1 -1
- package/dist/format/lib/document/section-catalog.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +6 -1
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/global-registry.d.ts +1 -0
- package/dist/format/lib/global-registry.js +1 -0
- package/dist/format/lib/links/link-href-rewrites.d.ts +10 -0
- package/dist/format/lib/links/link-href-rewrites.js +1 -0
- package/dist/format/lib/sections/hero-overlay.d.ts +8 -0
- package/dist/format/lib/sections/hero-overlay.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.d.ts +7 -0
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -0
- package/dist/render/components/Btn.d.ts +2 -0
- package/dist/render/components/Btn.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +1 -0
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +2 -1
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/Flex.d.ts +2 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +63 -0
- package/dist/render/components/HeroPictures.js +1 -0
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +15 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +2 -0
- package/dist/render/components/InBoxContext.js +1 -1
- package/dist/render/components/SiteGutterFrame.d.ts +3 -1
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +10 -1
- 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.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.d.ts +8 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/passes/section-animation.js +1 -1
- package/dist/render/lib/sections/section-to-box.d.ts +3 -1
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/site-runtime.d.ts +3 -1
- package/dist/render/lib/site-runtime.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{finiteNumber as a}from"../../../../../format/lib/finite-number.js";import{parseIntroBleedLayout as R}from"../../../../../format/lib/sections/intro-bleed-layout.js";import{fluidToken as U,token as n}from"./section-head-looks.js";import{BUTTON as g,DIM as f,DROP_COMMON as c,DROP_SIDE_PADDING as x,INNER_BOX as i,NO_PAD as p,NUMBER_TEXT as F,SAME_KEYS as u,SECTION_BOX as y,TEXT as P,fillFrom as S,lineSides as r,pictureCell as w,siteGutterOf as m,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}}},L=e=>R(e.layout)==="stacked",M=e=>Math.min(Math.max(a(e.overlay)??60,0),100),d=e=>a(e)??100,C={textStyle:"heading-1",sizeToken:{...U("headingLarge",48,7,96).sizeToken,pxPhone:36},weight:500,lineHeight:.95,letterSpacing:-.03},W=[s("eyebrow",n("label",14)),...[!0,!1].map(e=>({kind:"text",key:"title",role:"heading",props:P,style:{...C,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)`,V=()=>({name:"Scroll-Over Text",skip:e=>L(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:W,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 never held on a live page (its theme wrapper is as tall as the section; decision 3, 2026-10-14), so the Box does not pin",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},X={textStyle:"body-1",...n("body",16),lineHeight:1.7},O=e=>({kind:"text",key:"body",props:{...f,maxWidth:520},style:{...X,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"},j=(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)",G=(e,t)=>({[e]:t,[`${e}Phone`]:t}),q={textStyle:"heading-2",...n("headingMedium",40),weight:500,case:"none",lineHeight:1,letterSpacing:-.02},D=e=>(Array.isArray(e.stats)?e.stats:[]).filter(t=>t&&(String(t.value??"").trim()!==""||String(t.label??"").trim()!=="")),Y=()=>({name:"Brand Text",boxProps:(e,t)=>({...y,...S("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:m(t)}),parts:[s("eyebrow",n("label",14)),{kind:"text",key:"heading",role:"heading",props:P,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(D(e).length,1),3),...G("sectionBorder",r({top:1})),sectionPaddingTop:28,sectionPaddingTopPhone:28}),parts:[{kind:"list",key:"stats",name:"Stat",of:D,props:{...i,gap:4,gapPhone:4},parts:[{kind:"text",key:"value",props:F,style:q},s("label",{...n("label",13),color:"labels",letterSpacing:.2})]}]}]}]},w("Picture","imageSrc",I)],drop:{...c,grayscale:_,...x}}),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}},K=e=>e.textAlign==="center"?"center":e.textAlign==="right"?"end":"stretch",$=e=>Math.min(Math.max(a(e.overlay)??60,0),100),N=e=>typeof e=="string"&&e.trim()!=="",Z={...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},E=e=>({...w("Picture","imageSrc",(t,o)=>({...N(t.imageSrc)?{darken:40,darkenStyle:"even"}:{},placement:"center",...I,sectionBorder:r(e?{left:1}:{right:1}),...z(e?"left":"right",m(o))}),[{kind:"button",key:"imageBtnText",href:"imageBtnHref",variant:"ghost",props:Z,style:{textStyle:"body-5",...n("label",13,12),case:"upper",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}},J={kind:"group",name:"Words",props:(e,t)=>{const o=e.reverse===!0;return{...i,justify:"center",align:K(e),placement:e.textAlign==="center"?"center":e.textAlign==="right"?"right":"left",...j(e,72),gap:24,gapPhone:24,...N(e.textBgSrc)?{darken:$(e),darkenStyle:"even"}:{},...p,sectionPaddingTop:100,sectionPaddingBottom:100,...z(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:P,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}:{}}}}]}]},Q=()=>({name:"Image & Text Split",boxProps:(e,t)=>({...y,...S("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:[E(!1),J,E(!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",overlay:"read by the Words Box: its Darken over the words picture (60 when unset); no picture, no wash",grayscale:_,...c,...x}}),ie={IntroBleed:V(),Manifesto:Y(),Split:Q()};export{ie as EDITORIAL_SECTION_TO_BOX};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type { SectionToBoxRow } from "../../../sections/section-to-box.js";
|
|
1
|
+
import type { PartRow, SectionToBoxRow, SlotFill } from "../../../sections/section-to-box.js";
|
|
2
2
|
export declare const HEAD_ONLY_TYPES: readonly string[];
|
|
3
|
-
export declare
|
|
3
|
+
export declare const HOST_ROW_HEAD_TYPES: readonly string[];
|
|
4
|
+
export type HeadOnlyRowExtension = {
|
|
5
|
+
slots?: Readonly<Record<string, readonly SlotFill[]>>;
|
|
6
|
+
partsAfter?: readonly PartRow[];
|
|
7
|
+
drop?: Readonly<Record<string, string>>;
|
|
8
|
+
};
|
|
9
|
+
export declare function headOnlyRow(type: string, ext?: HeadOnlyRowExtension): SectionToBoxRow;
|
|
4
10
|
export declare const HEAD_ONLY_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SPLITTABLE_SECTIONS as
|
|
1
|
+
import{SPLITTABLE_SECTIONS as m}from"../../../../../format/lib/sections/section-head-placement.js";import{SECTION_LABELS as P}from"../../../../../format/lib/document/section-catalog.js";import{SAME_KEYS as T,SECTION_BOX as E,innerPad as h}from"./section-to-box-row-parts.js";import{HEAD_BELOW as O,headLookOf as S,headTree as _}from"./section-head-looks.js";import{finiteNumber as f}from"../../../../../format/lib/finite-number.js";const u=["Collections","Events","FAQ","Footprint","GalleryB","LongRead","ProcessSteps","ProductGrid","RelatedProducts"],B=["FitmentFinder","FitmentTable","SpecTable"],n=(o,e)=>()=>({top:o,topPhone:e}),c=o=>e=>{const t=h(e,o).sectionPaddingTop;return{top:t,topPhone:t}},b={Collections:n(120,70),Events:n(120,70),FAQ:n(120,70),GalleryB:n(120,70),FitmentTable:n(120,80),SpecTable:n(120,80),LongRead:n(120,80),FitmentFinder:o=>o.layout==="bar"?{top:32,topPhone:20}:{top:80,topPhone:60},RelatedProducts:n(0,0),Footprint:c("Footprint"),ProcessSteps:c("ProcessSteps"),ProductGrid:o=>({top:f(o.padTop)??120,topPhone:0})};function g(o,e={}){const t=m[o],d=b[o];if(!t||!d)throw new Error(`section-to-box-rows-head: "${o}" has no head row or no head room`);const s=t.padKey,p=_(o),l=t.headRows.filter(r=>![t.num,t.title,t.description,"linkText","linkHref"].includes(r)),a={...Object.fromEntries(l.map(r=>[r,"a head setting: the Header Box's Text parts draw it (lib/document/blocks/general/section-head-looks)"])),...e.drop};return{name:P[o]??o,boxProps:r=>{const i=d(r);return{...E,direction:"column",gap:O[S(o)],sectionPaddingTop:i.top,sectionPaddingTopPhone:i.topPhone}},box:[...T,...s?[[s,"sectionPaddingTop",(r,i)=>d(i).top]]:[]],parts:[p,{kind:"core",keep:"rest",...s?{props:{[s]:0}}:{},...e.slots?{slots:e.slots}:{}},...e.partsAfter??[]],...Object.keys(a).length?{drop:a}:{}}}const H=Object.fromEntries(u.map(o=>[o,g(o)]));export{H as HEAD_ONLY_SECTION_TO_BOX,u as HEAD_ONLY_TYPES,B as HOST_ROW_HEAD_TYPES,g as headOnlyRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as v,registerSectionToBox as
|
|
1
|
+
import{hasWords as v,registerSectionToBox as o}from"../../../sections/section-to-box.js";import{BUTTON as g,DIM as m,DROP_COMMON as s,DROP_SIDE_PADDING as c,INNER_BOX as t,leadLine as A,SAME_KEYS as d,SECTION_BOX as p,lineBorder as H,TEXT as l,innerPad as f,siteGutterOf as R,innerPadKeys as S,smallText as P,wrapperPad as u,wrapperPadKeys as b}from"./section-to-box-row-parts.js";import{CARDS_SECTION_TO_BOX as L}from"./section-to-box-rows-cards.js";import{normalizeSiteGutterPhone as C,siteGutterPhoneFollows as D}from"../../../../../format/lib/content/page-width.js";import{finiteNumber as W}from"../../../../../format/lib/finite-number.js";import{STATS_SECTION_TO_BOX as X}from"./section-to-box-rows-stats.js";import{LOGOS_SECTION_TO_BOX as G}from"./section-to-box-rows-logos.js";import{STRIP_SECTION_TO_BOX as M}from"./section-to-box-rows-strip.js";import{TIMELINE_SECTION_TO_BOX as F}from"./section-to-box-rows-timeline.js";import{LOCATIONS_SECTION_TO_BOX as z}from"./section-to-box-rows-locations.js";import{HEAD_ONLY_SECTION_TO_BOX as K}from"./section-to-box-rows-head.js";import{PAGE_HEADER_SECTION_TO_BOX as Y}from"./section-to-box-rows-pageheader.js";import{DOCBODY_SECTION_TO_BOX as j}from"./section-to-box-rows-docbody.js";import{EDITORIAL_SECTION_TO_BOX as U}from"./section-to-box-rows-editorial.js";import{fluidToken as q,headTree as O,token as r}from"./section-head-looks.js";const T={top:72,bottom:72,topPhone:72,bottomPhone:72},J={name:"Editorial Text",boxProps:e=>({...p,direction:"column",gap:28,gapPhone:28,sectionBorder:{top:1},...u(e,T)}),box:[["topBorder","sectionBorder",e=>e===!1?void 0:{top:1}],...d,...b(T)],parts:[O("Prose"),{kind:"text",key:"body",props:m,style:{textStyle:"body-1",...r("body",16),lineHeight:1.7,paragraphSpacing:18}}],drop:{...s,...c,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)"}},w={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},k=(e,n)=>n?.variant==="primary",_=(e,n)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:e,parts:[{kind:"button",key:"label",href:"href",when:k,variant:"primary",style:{letterSpacing:.3},props:{...g,...w,...n}},{kind:"button",key:"label",href:"href",when:(i,a)=>!k(i,a),variant:"ghost",style:{letterSpacing:.3},props:(i,a)=>({...g,...w,...n,...H(i,a)})}]}),h=e=>v(e.title),Q={name:"Call-to-Action Heading",boxProps:e=>({...p,direction:"row",align:"center",justify:h(e)?"between":"end",gap:60,gapPhone:60,share:"content",sectionBorder:{bottom:1},...f(e,"TitleWithButtons")}),box:[...d,...S("TitleWithButtons")],parts:[{kind:"group",name:"Title",props:{...t,maxWidth:1e3,widthFitPhone:"fill"},parts:[{kind:"text",key:"title",role:"heading",props:l,style:{textStyle:"heading-1",...q("headingLarge",48,7,108),case:"upper",lineHeight:.94,letterSpacing:-.035}}]},{kind:"group",name:"Buttons",props:e=>({...t,gap:14,gapPhone:14,widthFitPhone:"fill",...h(e)?{minWidth:280,minWidthPhone:0}:{}}),parts:[_(h,{widthFit:"fill",iconPosition:"end"}),_(e=>!h(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"}};function V(e){const{siteGutter:n,siteGutterPhone:i}=e.site??{},a=R(e),y=Math.min(20,C(i)??D(n));return{sectionPaddingLeft:a,sectionPaddingRight:a,sectionPaddingLeftPhone:y,sectionPaddingRightPhone:y}}const B={top:40,bottom:64,topPhone:24,bottomPhone:36},Z={name:"Section Header",boxProps:(e,n)=>({...p,direction:"column",gap:0,...u(e,B),...V(n)}),box:[...d,...b(B)],parts:[O("SectionHeader")],drop:{...s,...c,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"}},x={...t,direction:"row",share:"bigLeft",gap:30},E={...t,sectionPaddingLeft:30,sectionPaddingLeftPhone:0},N=(e,n,i)=>({kind:"group",name:e,props:n,parts:[i]}),$={name:"Lead Text",boxProps:e=>({...p,direction:"column",gap:40,gapPhone:40,sectionBorder:{bottom:1},...f(e,"ParagraphsA")}),box:[...d,...S("ParagraphsA")],parts:[{kind:"group",name:"Numbers",props:{...x,gapPhone:24,sectionBorder:{bottom:1},sectionPaddingBottom:40,sectionPaddingBottomPhone:40},parts:[{kind:"group",name:"Eyebrow",props:{...t,sectionPaddingTop:5,sectionPaddingBottom:1,sectionPaddingTopPhone:5,sectionPaddingBottomPhone:1},parts:[P("eyebrow",{color:"labels",...r("label",12),letterSpacing:.24})]},N("Stats column",t,{kind:"group",name:"Stats",props:{...E,gap:0,gapPhone:0},parts:[{kind:"list",key:"stats",name:"Stat",flat:!0,parts:[A("value","label",{...r("label",13),letterSpacing:.18,lineHeight:1.8})]}]})]},{kind:"group",name:"Words",props:{...x,gapPhone:28},parts:[{kind:"group",name:"Lead",props:t,parts:[{kind:"group",name:"Measure",props:{...t,maxWidth:780},parts:[{kind:"text",key:"lead",props:l,style:{textStyle:"heading-3",...r("headingSmall",22,20),weight:400,case:"none",lineHeight:1.45,letterSpacing:-.005}}]}]},N("Note column",{...t,justify:"end",widthFit:"fill"},{kind:"group",name:"Founders",props:{...E,gap:8,gapPhone:8},parts:[{kind:"group",name:"Note",props:{...t,gap:6,gapPhone:6},parts:[{kind:"text",key:"foundersHeading",props:l,style:{textStyle:"body-1",fontRole:"heading",...r("body",18,16),weight:500,letterSpacing:-.01,lineHeight:1.7}},{kind:"text",key:"foundersBody",props:m,style:{textStyle:"body-5",fontRole:"heading",...r("body",14,12),lineHeight:1.7}}]},P("attribution",{...r("label",12,10),letterSpacing:.24,lineHeight:1.7})]})]}],drop:{...s}},I={top:24,bottom:24,topPhone:24,bottomPhone:24},ee={name:"Banner",boxProps:e=>({...p,direction:"column",gap:0,...u(e,I)}),box:[...d,"contained",...b(I)],parts:[{kind:"group",name:"Card",keepEmpty:!0,props:{...t,gap:28,placement:"top-left",darken:60,darkenStyle:"even",sectionBorder:{width:1},sectionPaddingTop:64,sectionPaddingBottom:64,sectionPaddingTopPhone:40,sectionPaddingBottomPhone:40,sectionPaddingLeft:40,sectionPaddingRight:40,sectionPaddingLeftPhone:24,sectionPaddingRightPhone:24},box:[["imageSrc","bgImage"],["overlay","darken",e=>Math.min(Math.max(W(e)??60,0),100)]],parts:[{kind:"group",name:"Words",props:{...t,gap:20},parts:[P("eyebrow"),{kind:"text",key:"title",role:"heading",props:{...l,maxWidth:680},style:{weight:500,lineHeight:1.05,letterSpacing:-.03,case:"none"}},{kind:"text",key:"body",props:{...m,maxWidth:680},style:{textStyle:"body-1",lineHeight:1.6},was:{size:16}}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:g}]}],drop:{...s,...c}},te={Prose:J,TitleWithButtons:Q,SectionHeader:Z,ParagraphsA:$,Banner:ee};function be(){o(te),o(X),o(G),o(L),o(M),o(F),o(z),o(K),o(Y),o(j),o(U)}export{te as GENERAL_SECTION_TO_BOX,be as registerGeneralSectionRows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s}from"react/jsx-runtime";import{SectionAnimation as d}from"../../../components/SectionAnimation.js";import{ENTRANCE_EXCLUDED as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{SectionAnimation as d}from"../../../components/SectionAnimation.js";import{ENTRANCE_EXCLUDED as m,entranceDrawn as l}from"../../animation/entrance.js";import{CARD_HOVER_SECTIONS as f}from"../../../../format/lib/animation/hover.js";import{BOX_TYPE as p}from"../../../../format/lib/document/container-blocks.js";const E={[p]:"box",Ticker:"marquee",...Object.fromEntries(f.map(n=>[n,"cards"]))},r=(n,e)=>!m.has(n)&&!!e&&typeof e.render=="function";function a(n,e,o,t){n.fields={...n.fields,...o.animationTabFields(e,t)}}function c(n){const e=n,o=e.render;e.render=t=>{const i=l(t);return i?s(d,{desktop:i.desktop,phone:i.phone,editing:!!t.editor?.isEditing,children:o(t)}):o(t)}}const N={name:"sectionAnimation",applies:(n,e,o)=>e.isSection(n)&&r(n,o),panel:(n,e,o)=>a(n,E[e]??"section",o,e),draw:n=>c(n)},T={name:"blockEntrance",applies:(n,e,o)=>!e.isSection(n)&&r(n,o),panel:(n,e,o)=>a(n,"block",o),draw:n=>c(n)};export{T as blockEntrance,N as sectionAnimation};
|
|
@@ -119,7 +119,7 @@ type PartRowKind = {
|
|
|
119
119
|
size: number;
|
|
120
120
|
sizePhone?: number;
|
|
121
121
|
};
|
|
122
|
-
mark?: "accentLead";
|
|
122
|
+
mark?: "accentLead" | "accentItalic";
|
|
123
123
|
} | {
|
|
124
124
|
kind: "button";
|
|
125
125
|
key: string;
|
|
@@ -176,10 +176,12 @@ export declare function sectionBoxIdOf(oldId: string, piece: number): string;
|
|
|
176
176
|
export declare function registerBoxNativeSections(types: Readonly<Record<string, string>>): void;
|
|
177
177
|
export declare function boxNativeReason(type: string): string | undefined;
|
|
178
178
|
export declare const SECTION_TO_BOX_ON: readonly string[];
|
|
179
|
+
export declare const SECTION_TO_BOX_PRESS: readonly string[];
|
|
179
180
|
export declare function registerSectionToBox(rows: Readonly<Record<string, SectionToBoxRow>>): void;
|
|
180
181
|
export declare function sectionToBoxRow(type: string): SectionToBoxRow | undefined;
|
|
181
182
|
export declare function sectionToBoxTypes(): string[];
|
|
182
183
|
export declare function convertsToBox(type: string): boolean;
|
|
184
|
+
export declare function pressesAsBox(type: string, press?: readonly string[]): boolean;
|
|
183
185
|
export declare function headParts(type: string): PartRow[];
|
|
184
186
|
export declare const hasWords: (v: unknown) => boolean;
|
|
185
187
|
export declare function convertSection(node: SectionNode, row: SectionToBoxRow, ctx?: ConvertContext): SectionConversion;
|
|
@@ -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}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as R}from"../../../format/lib/finite-number.js";import{bucketByGroup as re}from"../../../format/lib/locations-grid.js";import{normalizeTheme as V}from"../../../format/lib/theme.js";const _=ee,P=te;function ge(t){if(t.theme)return V(t.theme);const o=t.site?.themePresets;return o?V({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ie(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)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function xe(t){for(const[o,r]of Object.entries(t)){if(o in A&&A[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=r}}function we(t){return A[t]}const Y=new Set(["id"]),j={},H=[];function $e(t){for(const[o,r]of Object.entries(t)){if(o in j&&j[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);j[o]=r}}function Oe(t){return j[t]}function Se(){return Object.keys(j)}function Be(t){return t in j&&H.includes(t)}function Te(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const r=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&r.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&r.push({kind:"button",key:"linkText",href:"linkHref"}),r}const F=t=>Z(t),_e=t=>F(t).text.trim()!=="";function ae(t){if(t.includes("=="))return t;const o=t.indexOf("/"),r=o===-1?t:t.slice(0,o),i=r.trim();if(!i)return t;const h=r.indexOf(i);return`${r.slice(0,h)}==${i}==${r.slice(h+i.length)}${o===-1?"":t.slice(o)}`}const ce=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function fe(t,o,r,i){const c={...t._partStyles?.text??{},...o??{},...r??{}};return(i==="center"||i==="right")&&c.align===void 0&&(c.align=i),Object.keys(c).length?{_partStyles:{text:c}}:{}}function le(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const r=o[t.key];return{variant:typeof r=="string"&&Object.hasOwn(t.map,r)?t.map[r]:t.fallback}}function D(t,o,r,i,h={}){const c={...o};for(const y of t){const[g,S,v]=typeof y=="string"?[y,y,void 0]:y;if(r[g]===void 0)continue;const B=v?v(r[g],r,h):r[g];B===void 0?delete c[S]:c[S]=B,i(g,S,B===void 0)}return c}function de(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),r=h=>{for(const c of h??[])o.add(typeof c=="string"?c:c[0])},i=h=>{for(const c of h)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":r(c.box),i(c.parts??[]);break;case"core":c.keep!=="rest"&&c.keep.forEach(y=>o.add(y)),Object.keys(c.rename??{}).forEach(y=>o.add(y));for(const y of Object.values(c.slots??{}))for(const g of y)"kind"in g&&o.add(g.key);break}};for(const h of[t,...t.also??[]])r(h.box),i(h.parts);return o}function q(t,o,r={}){const i=t.props,h=o.skip?.(i);if(h!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:h};const c=String(i.id??t.type),y=[],g=[],S=[],v=new Set,B=(n,s)=>{y.push({key:n,home:s}),v.add(n)},X=i._partStyles??{},L=de(o);let J=0;const w=(n,s)=>({type:n,props:{...s,id:`${c}~${n}-${++J}`}}),K=(n,s,b,u,x,l,$)=>{if(x){for(const a of n??[]){const p=typeof a=="string"?a:a[0];b[p]!==void 0&&$(p,`nothing — the ${u} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(i,r):s??{};return D(n??[],e,b,(a,p,f)=>$(a,f?`nothing — the old value draws nothing (${u}: no ${p})`:`${l}${u}: ${p}`),r)},M=n=>n.map(s=>{const b={...s.props??{}};for(const[u,x]of Object.entries(s.slots??{}))b[u]=M(x);return w(s.type,b)}),W=(n,s,b)=>{const u=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],x=typeof n.props=="function"?n.props(i,r):n.props??{},l=u.map((f,d)=>{const k=f??{},m=n.item?.(k,d,i)??{},E=N(m.reverse?[...n.parts].reverse():n.parts,k,!1,`item ${d+1}: `);return n.flat?m.props?E.map(T=>({...T,props:{...T.props,...m.props,id:T.props.id}})):E:[w(_,{name:`${n.name} ${d+1}`,...x,...m.props??{},[P]:E})]});if(n.groups){const f=n.groups;return b(n.key,u.length?`one Box per item (${u.length}), in a Box per group`:"nothing — the list is empty"),re(u.map(d=>d??{}),f.of,f.of).map((d,k)=>{const m=d.items.map(O=>O.item),E=f.parts?N(f.parts,f.head?.(m,i)??{},!1,`group ${k+1}: `):[],T=d.items.map(O=>l[O.index]),z=f.perRow?.(m.length,i),I=Number.isInteger(z)&&z>=1?z:1,C=[];if(f.perRow&&I<T.length)for(let O=0;O*I<T.length;O++)C.push(T.slice(O*I,(O+1)*I).flat());return w(_,{name:`${f.name} ${k+1}`,...f.props??{},[P]:[...E,w(_,{name:`${f.itemsName} ${k+1}`,...f.itemsProps?.(m.length,i)??{},[P]:C.length?C.map((O,U)=>w(_,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[P]:O})):T.flat()})]})})}const $=n.perRow?.(i),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(u.length?n.flat?`each item's parts (${u.length} items), in order`:`one Box per item (${u.length}), its parts inside`:"nothing — the list is empty")+(e&&u.length?`, in rows of ${e}`:"")),!e)return l.flat();const a=typeof n.rowProps=="function"?n.rowProps(i,r):n.rowProps??{},p=[];for(let f=0;f*e<l.length;f++){const d=l.slice(f*e,(f+1)*e).flat(),k=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;p.push(w(_,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...a,[P]:[...d,...Array.from({length:k},(m,E)=>w(_,{name:`Empty ${E+1}`,...n.rowFiller,[P]:[]}))]}))}return p},N=(n,s,b,u)=>{const x=[],l=(e,a)=>b?B(e,a):void 0,$=e=>b?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(i,b?void 0:s)))switch(e.kind){case"text":{const a=F(s[e.key]);if(!a.text.trim()){l(e.key,"nothing — empty words draw nothing, so no block");break}const p=ce(e.role??"body"),{_partStyles:f,...d}=p,k=fe(p,e.styleFrom?{...e.style,...e.styleFrom(i,r)}:e.style,$(e.key),e.props?.align);if(e.was&&b){const m=k._partStyles?.text??{};S.push({key:e.key,was:e.was,...typeof m.textStyle=="string"?{textStyle:m.textStyle}:{},...R(m.size)!==void 0?{size:R(m.size)}:{},...R(m.sizePhone)!==void 0?{sizePhone:R(m.sizePhone)}:{}})}x.push(w("Text",{text:e.mark==="accentLead"?ae(a.text):a.text,...d,...e.props??{},...k,...a.hidden?{_hidden:!0}:{}})),l(e.key,`${u}Text block: its words${a.hidden?", hidden":""}`);break}case"button":{const a=F(s[e.key]);if(!a.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 p=typeof s[e.href]=="string"&&s[e.href]?s[e.href]:"#",f={...e.style??{},...$(e.key)??{}};x.push(w("ButtonBlock",{label:a.text,href:p,...typeof e.props=="function"?e.props(s,r):e.props??{},...le(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...a.hidden?{_hidden:!0}:{}})),l(e.key,`${u}Button block: its words`),l(e.href,`${u}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${u}Button block: its Style`);break}case"image":{const a=s[e.key];if(typeof a!="string"||!a){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";x.push(w("ImageBlock",{src:a,alt:p,...e.props??{}})),l(e.key,`${u}Image block: its picture`),e.alt&&l(e.alt,`${u}Image block: its alt text`);break}case"list":{x.push(...W(e,s,l));break}case"group":{const a=N(e.parts,s,b,u),p=K(e.box,e.props,s,`${e.name} Box`,!a.length&&!e.keepEmpty,u,l);p&&x.push(w(_,{name:e.name,...p,[P]:a}));break}case"block":{const a=e.parts?N(e.parts,s,b,u):[],p=K(e.box,e.props,s,`${e.type} block`,!!e.parts&&!a.length&&!e.keepEmpty,u,l);p&&x.push(w(e.type,{...p,...e.slot?{[e.slot]:a}:{}}));break}case"core":{const a=e.as??t.type,p={headPlacement:"own-box",...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(d=>!L.has(d)&&!(d in p)):e.keep;for(const d of f)s[d]!==void 0&&(p[d]=s[d],l(d,`the ${a} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))s[k]!==void 0&&!L.has(k)&&l(k,`nothing — the ${a} block inside the Box has the row's own value`);s.headPlacement!==void 0&&l("headPlacement",`the ${a} block inside the Box: own-box`);const d=Object.fromEntries(Object.entries(X).filter(([k])=>!L.has(k)));Object.keys(d).length&&(p._partStyles=d)}for(const[d,k]of Object.entries(e.rename??{}))s[d]!==void 0&&(p[k]=s[d],l(d,`the ${a} block inside the Box: ${k}`));for(const[d,k]of Object.entries(e.slots??{}))p[d]=k.flatMap(m=>"kind"in m?W(m,s,l):M([m]));x.push(w(a,p));break}}return x},Q=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,u=N(n.parts,i,!0,s===0?"":`${b}: `),x=typeof n.boxProps=="function"?n.boxProps(i,r):n.boxProps??{},l=D(n.box??[],x,i,($,e,a)=>B($,a?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),r);return{type:_,props:{name:n.name,...l,[P]:u,id:ie(c,s)}}},G=[o,...o.also??[]].map(Q);i._partStyles!==void 0&&B("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))i[n]!==void 0&&B(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in i&&(g.push({key:n,why:s}),v.add(n));for(const n of Object.keys(i))Y.has(n)||v.has(n)||g.push({key:n,why:"not in the row — not carried"});return{node:G[0],nodes:G,carried:y,dropped:g,siteWrites:[...o.site?.(t,r)??[]],restyled:S}}function Pe(t,o=H,r={}){const i=t.content;if(!Array.isArray(i))return t;let h=!1;const c=i.flatMap(y=>{const g=y&&typeof y.type=="string"&&o.includes(y.type)?j[y.type]:void 0;if(!g)return[y];const S=q(y,g,r);return S.skipped!==void 0?[y]:(h=!0,S.nodes)});return h?{...t,content:c}:t}function je(t,o=H,r={}){if(!Array.isArray(t))return[];const i=[];return t.forEach((h,c)=>{const y=h&&typeof h.type=="string"&&o.includes(h.type)?j[h.type]:void 0;if(!y)return;const g=q(h,y,r);g.skipped===void 0&&i.push({index:c,node:g.node,nodes:g.nodes})}),i}export{P as SECTION_BOX_SLOT,_ as SECTION_BOX_TYPE,H as SECTION_TO_BOX_ON,we as boxNativeReason,q as convertSection,Pe as convertSectionsInPage,ge as convertTheme,Be as convertsToBox,_e as hasWords,Te as headParts,xe as registerBoxNativeSections,$e as registerSectionToBox,ie as sectionBoxIdOf,je as sectionToBoxEdits,Oe as sectionToBoxRow,Se 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}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as R}from"../../../format/lib/finite-number.js";import{bucketByGroup as re}from"../../../format/lib/locations-grid.js";import{normalizeTheme as V}from"../../../format/lib/theme.js";const P=ee,E=te;function $e(t){if(t.theme)return V(t.theme);const o=t.site?.themePresets;return o?V({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ie(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)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function Oe(t){for(const[o,r]of Object.entries(t)){if(o in A&&A[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=r}}function Se(t){return A[t]}const Y=new Set(["id"]),B={},H=[],ce=[];function Be(t){for(const[o,r]of Object.entries(t)){if(o in B&&B[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);B[o]=r}}function Te(t){return B[t]}function _e(){return Object.keys(B)}function ae(t){return t in B&&H.includes(t)}function Pe(t,o=ce){return t in B&&(o.includes(t)||ae(t))}function Ee(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const r=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&r.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&r.push({kind:"button",key:"linkText",href:"linkHref"}),r}const W=t=>Z(t),je=t=>W(t).text.trim()!=="";function fe(t){return t.replace(/==(.+?)==/g,(o,r)=>r.startsWith("_")&&r.endsWith("_")?o:`==_${r}_==`)}function le(t){if(t.includes("=="))return t;const o=t.indexOf("/"),r=o===-1?t:t.slice(0,o),i=r.trim();if(!i)return t;const h=r.indexOf(i);return`${r.slice(0,h)}==${i}==${r.slice(h+i.length)}${o===-1?"":t.slice(o)}`}const de=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function pe(t,o,r,i){const a={...t._partStyles?.text??{},...o??{},...r??{}};return(i==="center"||i==="right")&&a.align===void 0&&(a.align=i),Object.keys(a).length?{_partStyles:{text:a}}:{}}function ue(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const r=o[t.key];return{variant:typeof r=="string"&&Object.hasOwn(t.map,r)?t.map[r]:t.fallback}}function D(t,o,r,i,h={}){const a={...o};for(const y of t){const[x,S,v]=typeof y=="string"?[y,y,void 0]:y;if(r[x]===void 0)continue;const T=v?v(r[x],r,h):r[x];T===void 0?delete a[S]:a[S]=T,i(x,S,T===void 0)}return a}function he(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),r=h=>{for(const a of h??[])o.add(typeof a=="string"?a:a[0])},i=h=>{for(const a of h)switch(a.kind){case"text":case"image":o.add(a.key),a.kind==="image"&&a.alt&&o.add(a.alt);break;case"button":o.add(a.key),o.add(a.href),typeof a.variant=="object"&&o.add(a.variant.key);break;case"list":o.add(a.key);break;case"group":case"block":r(a.box),i(a.parts??[]);break;case"core":a.keep!=="rest"&&a.keep.forEach(y=>o.add(y)),Object.keys(a.rename??{}).forEach(y=>o.add(y));for(const y of Object.values(a.slots??{}))for(const x of y)"kind"in x&&o.add(x.key);break}};for(const h of[t,...t.also??[]])r(h.box),i(h.parts);return o}function q(t,o,r={}){const i=t.props,h=o.skip?.(i);if(h!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:h};const a=String(i.id??t.type),y=[],x=[],S=[],v=new Set,T=(n,s)=>{y.push({key:n,home:s}),v.add(n)},X=i._partStyles??{},L=he(o);let J=0;const w=(n,s)=>({type:n,props:{...s,id:`${a}~${n}-${++J}`}}),F=(n,s,b,u,g,l,$)=>{if(g){for(const c of n??[]){const p=typeof c=="string"?c:c[0];b[p]!==void 0&&$(p,`nothing — the ${u} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(i,r):s??{};return D(n??[],e,b,(c,p,f)=>$(c,f?`nothing — the old value draws nothing (${u}: no ${p})`:`${l}${u}: ${p}`),r)},K=n=>n.map(s=>{const b={...s.props??{}};for(const[u,g]of Object.entries(s.slots??{}))b[u]=K(g);return w(s.type,b)}),M=(n,s,b)=>{const u=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],g=typeof n.props=="function"?n.props(i,r):n.props??{},l=u.map((f,d)=>{const k=f??{},m=n.item?.(k,d,i)??{},j=I(m.reverse?[...n.parts].reverse():n.parts,k,!1,`item ${d+1}: `);return n.flat?m.props?j.map(_=>({..._,props:{..._.props,...m.props,id:_.props.id}})):j:[w(P,{name:`${n.name} ${d+1}`,...g,...m.props??{},[E]:j})]});if(n.groups){const f=n.groups;return b(n.key,u.length?`one Box per item (${u.length}), in a Box per group`:"nothing — the list is empty"),re(u.map(d=>d??{}),f.of,f.of).map((d,k)=>{const m=d.items.map(O=>O.item),j=f.parts?I(f.parts,f.head?.(m,i)??{},!1,`group ${k+1}: `):[],_=d.items.map(O=>l[O.index]),z=f.perRow?.(m.length,i),N=Number.isInteger(z)&&z>=1?z:1,C=[];if(f.perRow&&N<_.length)for(let O=0;O*N<_.length;O++)C.push(_.slice(O*N,(O+1)*N).flat());return w(P,{name:`${f.name} ${k+1}`,...f.props??{},[E]:[...j,w(P,{name:`${f.itemsName} ${k+1}`,...f.itemsProps?.(m.length,i)??{},[E]:C.length?C.map((O,U)=>w(P,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[E]:O})):_.flat()})]})})}const $=n.perRow?.(i),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(u.length?n.flat?`each item's parts (${u.length} items), in order`:`one Box per item (${u.length}), its parts inside`:"nothing — the list is empty")+(e&&u.length?`, in rows of ${e}`:"")),!e)return l.flat();const c=typeof n.rowProps=="function"?n.rowProps(i,r):n.rowProps??{},p=[];for(let f=0;f*e<l.length;f++){const d=l.slice(f*e,(f+1)*e).flat(),k=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;p.push(w(P,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...c,[E]:[...d,...Array.from({length:k},(m,j)=>w(P,{name:`Empty ${j+1}`,...n.rowFiller,[E]:[]}))]}))}return p},I=(n,s,b,u)=>{const g=[],l=(e,c)=>b?T(e,c):void 0,$=e=>b?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(i,b?void 0:s)))switch(e.kind){case"text":{const c=W(s[e.key]);if(!c.text.trim()){l(e.key,"nothing — empty words draw nothing, so no block");break}const p=de(e.role??"body"),{_partStyles:f,...d}=p,k=pe(p,e.styleFrom?{...e.style,...e.styleFrom(i,r)}:e.style,$(e.key),e.props?.align);if(e.was&&b){const m=k._partStyles?.text??{};S.push({key:e.key,was:e.was,...typeof m.textStyle=="string"?{textStyle:m.textStyle}:{},...R(m.size)!==void 0?{size:R(m.size)}:{},...R(m.sizePhone)!==void 0?{sizePhone:R(m.sizePhone)}:{}})}g.push(w("Text",{text:e.mark==="accentLead"?le(c.text):e.mark==="accentItalic"?fe(c.text):c.text,...d,...e.props??{},...k,...c.hidden?{_hidden:!0}:{}})),l(e.key,`${u}Text block: its words${c.hidden?", hidden":""}`);break}case"button":{const c=W(s[e.key]);if(!c.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 p=typeof s[e.href]=="string"&&s[e.href]?s[e.href]:"#",f={...e.style??{},...$(e.key)??{}};g.push(w("ButtonBlock",{label:c.text,href:p,...typeof e.props=="function"?e.props(s,r):e.props??{},...ue(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...c.hidden?{_hidden:!0}:{}})),l(e.key,`${u}Button block: its words`),l(e.href,`${u}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${u}Button block: its Style`);break}case"image":{const c=s[e.key];if(typeof c!="string"||!c){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";g.push(w("ImageBlock",{src:c,alt:p,...e.props??{}})),l(e.key,`${u}Image block: its picture`),e.alt&&l(e.alt,`${u}Image block: its alt text`);break}case"list":{g.push(...M(e,s,l));break}case"group":{const c=I(e.parts,s,b,u),p=F(e.box,e.props,s,`${e.name} Box`,!c.length&&!e.keepEmpty,u,l);p&&g.push(w(P,{name:e.name,...p,[E]:c}));break}case"block":{const c=e.parts?I(e.parts,s,b,u):[],p=F(e.box,e.props,s,`${e.type} block`,!!e.parts&&!c.length&&!e.keepEmpty,u,l);p&&g.push(w(e.type,{...p,...e.slot?{[e.slot]:c}:{}}));break}case"core":{const c=e.as??t.type,p={headPlacement:"own-box",...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(d=>!L.has(d)&&!(d in p)):e.keep;for(const d of f)s[d]!==void 0&&(p[d]=s[d],l(d,`the ${c} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))s[k]!==void 0&&!L.has(k)&&l(k,`nothing — the ${c} block inside the Box has the row's own value`);s.headPlacement!==void 0&&l("headPlacement",`the ${c} block inside the Box: own-box`);const d=Object.fromEntries(Object.entries(X).filter(([k])=>!L.has(k)));Object.keys(d).length&&(p._partStyles=d)}for(const[d,k]of Object.entries(e.rename??{}))s[d]!==void 0&&(p[k]=s[d],l(d,`the ${c} block inside the Box: ${k}`));for(const[d,k]of Object.entries(e.slots??{}))p[d]=k.flatMap(m=>"kind"in m?M(m,s,l):K([m]));g.push(w(c,p));break}}return g},Q=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,u=I(n.parts,i,!0,s===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(i,r):n.boxProps??{},l=D(n.box??[],g,i,($,e,c)=>T($,c?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),r);return{type:P,props:{name:n.name,...l,[E]:u,id:ie(a,s)}}},G=[o,...o.also??[]].map(Q);i._partStyles!==void 0&&T("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))i[n]!==void 0&&T(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in i&&(x.push({key:n,why:s}),v.add(n));for(const n of Object.keys(i))Y.has(n)||v.has(n)||x.push({key:n,why:"not in the row — not carried"});return{node:G[0],nodes:G,carried:y,dropped:x,siteWrites:[...o.site?.(t,r)??[]],restyled:S}}function ve(t,o=H,r={}){const i=t.content;if(!Array.isArray(i))return t;let h=!1;const a=i.flatMap(y=>{const x=y&&typeof y.type=="string"&&o.includes(y.type)?B[y.type]:void 0;if(!x)return[y];const S=q(y,x,r);return S.skipped!==void 0?[y]:(h=!0,S.nodes)});return h?{...t,content:a}:t}function Ie(t,o=H,r={}){if(!Array.isArray(t))return[];const i=[];return t.forEach((h,a)=>{const y=h&&typeof h.type=="string"&&o.includes(h.type)?B[h.type]:void 0;if(!y)return;const x=q(h,y,r);x.skipped===void 0&&i.push({index:a,node:x.node,nodes:x.nodes})}),i}export{E as SECTION_BOX_SLOT,P as SECTION_BOX_TYPE,H as SECTION_TO_BOX_ON,ce as SECTION_TO_BOX_PRESS,Se as boxNativeReason,q as convertSection,ve as convertSectionsInPage,$e as convertTheme,ae as convertsToBox,je as hasWords,Ee as headParts,Pe as pressesAsBox,Oe as registerBoxNativeSections,Be as registerSectionToBox,ie as sectionBoxIdOf,Ie as sectionToBoxEdits,Te as sectionToBoxRow,_e as sectionToBoxTypes};
|
|
@@ -21,7 +21,9 @@ export declare function SiteRuntimeProvider({ runtime, children }: {
|
|
|
21
21
|
children: ReactNode;
|
|
22
22
|
}): import("react").JSX.Element;
|
|
23
23
|
export declare function useSiteRuntime(): SiteRuntime;
|
|
24
|
-
export declare function SiteLink(props: SiteLinkProps
|
|
24
|
+
export declare function SiteLink({ hrefRewrite, ...props }: SiteLinkProps & {
|
|
25
|
+
hrefRewrite?: string;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
25
27
|
export declare function SiteImage(props: SiteImageProps): import("react").JSX.Element;
|
|
26
28
|
export declare function lazyInBrowser<P extends object>(loader: () => Promise<{
|
|
27
29
|
default: ComponentType<P>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import s from"next/image";import c from"next/link";import{Component as l,createContext as u,lazy as m,Suspense as h,useContext as d}from"react";import{linkHrefRewrite as k}from"../../format/lib/links/link-href-rewrites.js";import{isSafeLinkHref as p}from"../../format/lib/markup.js";import{nonEmptyString as x}from"../../format/lib/non-empty-string.js";const S={Link:c,Image:s},o=u(S);function E({runtime:t,children:e}){return i(o.Provider,{value:t,children:e})}function f(){return d(o)}function N({hrefRewrite:t,...e}){const{Link:r}=f(),n=k(t);return n?i(L,{name:n.name,href:e.href,fallback:i(r,{...e}),children:i(w,{Link:r,rewrite:n.rewrite,...e})},n.key):i(r,{...e})}function w({Link:t,rewrite:e,...r}){const n=x(e(r.href)),a=n&&p(n)?n:r.href;return i(t,{...r,href:a})}class L extends l{state={failed:!1,href:this.props.href};static getDerivedStateFromProps(e,r){return e.href===r.href?null:{failed:!1,href:e.href}}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`The link href rewrite ${this.props.name} failed; the link goes where it was typed.`,e)}render(){return this.state.failed?this.props.fallback:this.props.children}}function b(t){const{Image:e}=f();return i(e,{...t})}function B(t){const e=m(t);return function(n){return i(h,{fallback:null,children:i(e,{...n})})}}export{b as SiteImage,N as SiteLink,E as SiteRuntimeProvider,B as lazyInBrowser,f as useSiteRuntime};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "48.
|
|
3
|
+
"version": "48.3.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",
|