efficient-web-builder 55.3.1 → 57.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/dist/editor/components/BlockGapField.d.ts +1 -2
- package/dist/editor/components/BlockGapField.js +1 -1
- package/dist/editor/components/CardShadowField.d.ts +1 -2
- package/dist/editor/components/CardShadowField.js +1 -1
- package/dist/editor/components/ChatSettingsPanel.js +1 -1
- package/dist/editor/components/CornersField.d.ts +1 -2
- package/dist/editor/components/CornersField.js +1 -1
- package/dist/editor/components/HeroPartPanel.js +1 -1
- package/dist/editor/components/HoverEffectField.d.ts +1 -2
- package/dist/editor/components/HoverEffectField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PhotographyField.d.ts +1 -2
- package/dist/editor/components/PhotographyField.js +1 -1
- package/dist/editor/components/SectionEditor.js +1 -1
- package/dist/editor/components/SectionThumbnail.js +1 -1
- package/dist/editor/components/ShadowColourField.d.ts +1 -2
- package/dist/editor/components/ShadowColourField.js +1 -1
- package/dist/editor/components/ShareButtonField.d.ts +1 -2
- package/dist/editor/components/ShareButtonField.js +1 -1
- package/dist/editor/components/SideSpaceField.d.ts +1 -2
- package/dist/editor/components/SideSpaceField.js +1 -1
- package/dist/editor/components/SiteFields.d.ts +2 -1
- package/dist/editor/components/SiteFields.js +1 -1
- package/dist/editor/components/SocialLinksPanel.js +1 -1
- package/dist/editor/components/SourceStatus.d.ts +2 -1
- package/dist/editor/components/SourceStatus.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/StylesPanel.js +1 -1
- package/dist/editor/components/WebsiteHintsProvider.d.ts +8 -0
- package/dist/editor/components/WebsiteHintsProvider.js +1 -0
- package/dist/editor/components/WebsiteSettingsPanel.d.ts +6 -17
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +40 -39
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- package/dist/editor/components/useSectionToBoxPass.js +1 -1
- package/dist/editor/lib/animation/entrance-fields.d.ts +0 -3
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/fields.js +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/animation/loop-fields.d.ts +2 -0
- package/dist/editor/lib/animation/loop-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +2 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/editor/lib/host-document-bridge.d.ts +2 -1
- package/dist/editor/lib/host-document-bridge.js +1 -1
- package/dist/editor/lib/keyed-store.d.ts +7 -0
- package/dist/editor/lib/keyed-store.js +1 -0
- package/dist/editor/lib/page-live-state.js +1 -1
- package/dist/editor/lib/page-video-frames.d.ts +11 -0
- package/dist/editor/lib/page-video-frames.js +1 -0
- package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/editor/lib/sections/new-section-node.js +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/animation/hover.d.ts +2 -3
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/animation/loop.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +5 -3
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/cell-picture-sizes.d.ts +31 -0
- package/dist/format/lib/content/cell-picture-sizes.js +1 -0
- package/dist/format/lib/content/image-aspect.d.ts +1 -0
- package/dist/format/lib/content/image-aspect.js +1 -1
- package/dist/format/lib/content/mirror-cards.d.ts +1 -1
- package/dist/format/lib/content/mirror-cards.js +1 -1
- package/dist/format/lib/document/article-body-seed.d.ts +10 -0
- package/dist/format/lib/document/article-body-seed.js +1 -0
- package/dist/format/lib/document/blocks/general/Timeline/meta.d.ts +2 -1
- package/dist/format/lib/document/blocks/general/Timeline/meta.js +2 -2
- package/dist/format/lib/document/blocks/placeholders.d.ts +1 -0
- package/dist/format/lib/document/blocks/placeholders.js +1 -1
- package/dist/format/lib/document/easel-row-words.d.ts +1 -1
- package/dist/format/lib/document/easel-row-words.js +1 -1
- package/dist/format/lib/document/passes/settings-groups.js +1 -1
- package/dist/format/lib/document/section-catalog.js +6 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +13 -2
- package/dist/format/lib/editor-words-catalogue.js +5 -5
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/fit-words.js +2 -2
- package/dist/format/lib/hero-video.d.ts +12 -0
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/sections/active-press-context.d.ts +4 -0
- package/dist/format/lib/sections/active-press-context.js +1 -0
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/sections/section-presets.d.ts +5 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/sections/timeline-year-shape.js +1 -1
- package/dist/format/lib/sized-image.d.ts +1 -0
- package/dist/format/lib/sized-image.js +1 -1
- package/dist/format/lib/source-rules/page-picture-place.d.ts +6 -0
- package/dist/format/lib/source-rules/page-picture-place.js +4 -0
- package/dist/format/lib/source-rules/part-style-naming.js +2 -2
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +2 -2
- package/dist/format/lib/web-backend.d.ts +17 -0
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/BoxCellContext.d.ts +14 -0
- package/dist/render/components/BoxCellContext.js +1 -0
- package/dist/render/components/Flex.d.ts +2 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -1
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroPoster.d.ts +4 -1
- package/dist/render/components/HeroPoster.js +1 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +3 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/HeroVideoPlay.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/Manifesto.js +1 -1
- package/dist/render/components/Placeholder.d.ts +2 -1
- package/dist/render/components/Placeholder.js +1 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/lib/content/block-size.d.ts +1 -0
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-cell-bound.d.ts +17 -0
- package/dist/render/lib/content/box-cell-bound.js +1 -0
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Timeline/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +1 -0
- package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +0 -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-pageheader.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/page-render.js +1 -1
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/sanitize.d.ts +1 -0
- package/dist/render/lib/document/sanitize.js +1 -1
- package/dist/render/lib/document/slot-counts.d.ts +8 -0
- package/dist/render/lib/document/slot-counts.js +1 -0
- package/dist/render/lib/first-screen.d.ts +28 -0
- package/dist/render/lib/first-screen.js +1 -0
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/site-runtime.d.ts +1 -0
- package/package.json +5 -5
- package/dist/editor/components/KeepHint.d.ts +0 -5
- package/dist/editor/components/KeepHint.js +0 -1
- package/dist/render/components/BoxCellWidthContext.d.ts +0 -2
- package/dist/render/components/BoxCellWidthContext.js +0 -1
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { type SectionToBoxRow } from "../../../sections/section-to-box.js";
|
|
2
|
+
export declare const storyTimelinePressStarter: () => Readonly<Record<string, unknown>>;
|
|
3
|
+
export declare const milestoneTimelinePressStarter: () => Readonly<Record<string, unknown>>;
|
|
2
4
|
export declare const TIMELINE_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{resolveSectionBackground as
|
|
1
|
+
import{resolveSectionBackground as G,THEME_SECTION_BG as K}from"../../../../../format/lib/content/section-background.js";import{SECTION_BG_BUILT_IN as j}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{BUTTON as _,DIM as p,bandAccent as V,bandIndex as q,bandWrites as z,fillNoBoxHolds as J,ownFill as Q,DROP_COMMON as B,DROP_SIDE_PADDING as H,INNER_BOX as o,SAME_KEYS as A,SECTION_BOX as u,TEXT as c,innerPad as b,innerPadKeys as C}from"./section-to-box-row-parts.js";import{splitParagraphs as Z}from"../../../../components/goldPhrases.js";import{accentItalicRuns as O}from"../../../../../format/lib/markup.js";import{TIMELINE_YEAR_BOX as $,TIMELINE_YEAR_HEAD as M}from"../../../../../format/lib/sections/timeline-year-shape.js";import{boxPadding as ee,LABEL_FACE as te}from"../../../../../format/lib/document/seed-parts.js";import{editorialHeadTree as ne,fluidToken as oe,headWordsOnPhoneLine as re,token as i}from"./section-head-looks.js";import{CTA_PH as d,phAccentAsMarks as N}from"../../../../../format/lib/document/blocks/placeholders.js";import{TIMELINE_PH as y,timelineScaffoldEntries as ie}from"../../../../../format/lib/document/blocks/general/Timeline/meta.js";import{TIMELINE_TRACK_PH as T,timelineTrackScaffoldEntries as ae}from"../../../../../format/lib/document/blocks/general/TimelineTrack/meta.js";const L={buttonBorder:{width:0}},l=(e,t,n={})=>({textStyle:"body-5",...i("label",e),letterSpacing:t,lineHeight:1.5,weight:400,...n}),a=(e,t,n={})=>({...l(e,t),...te,...n}),g=(e,t,n)=>({...e,case:"upper",weight:500,letterSpacing:t,lineHeight:n}),s=(e,t,n={})=>({textStyle:"body-1",fontRole:"heading",...e,weight:400,case:"none",lineHeight:t,...n}),r=(e,t,n={})=>({kind:"text",key:e,props:c,style:t,...n});function R(e,t){return e.kind==="text"?t.includes(e.key)?{...e,mark:"accentItalic"}:e:e.kind==="group"?{...e,parts:e.parts.map(n=>R(n,t))}:e}const W=(e,t)=>t?.future===!0,h=e=>Z(typeof e?.body=="string"?e.body:""),f=e=>G(typeof e.background=="string"?e.background:void 0,j.TimelineTrack),w=e=>f(e)===K?e:{...e,background:"transparent"},se={name:"Milestone Timeline",skip:e=>J(f(e)),boxProps:(e,t)=>{const n=q(w(e),t);return{...u,direction:"column",gap:60,gapPhone:36,sectionBorder:{bottom:1},...b(e,"TimelineTrack"),...Q(f(e),e,t),...n>=0?{sectionAccent:n}:{}}},box:[...A.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,n)=>V(e,w(t),n)],...C("TimelineTrack")],parts:[re(R(ne("eyebrow","title","intro"),["title","intro"])),{kind:"group",name:"Track",props:{...o,gap:48,gapPhone:48},parts:[{kind:"group",name:"Years",props:{...o,direction:"row",share:"equal",gap:0,line:!0},parts:[{kind:"list",key:"entries",name:"Year",props:{...o,...$},item:e=>({props:e.future===!0?{upcoming:!0}:{}}),parts:[{kind:"group",name:M.name,props:{...o,...M},parts:[r("date",l(13,.22,{color:"accent"}),{when:(e,t)=>!W(e,t)}),r("date",l(13,.22,{color:"labels"}),{when:W}),r("title",{textStyle:"heading-3",...g(i("headingSmall",20),-.02,1.1)},{role:"heading"})]},r("blurb",s(i("body",13),1.55),{props:p,mark:"accentItalic"})]}]},{kind:"group",name:"Button row",props:{...o,sectionBorder:{top:1,right:0,bottom:0,left:0},sectionPaddingTop:32},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:{..._,align:"right",...L},style:a(13,.3)}]}]}],site:(e,t)=>z({props:w(e.props)},t),drop:{...B,...H,background:"another colour is the Box's Fill, or a skip if no Fill holds it; the band is the Box's theme: the site's band preset (`sectionAccent`), or a declared band-preset write (`lib/theme` `bandPresetIndex`)",headPlacement:"needs a row per head placement: an own-box Milestone Timeline draws no head (its words sit in a Section Header above it), the row always draws the head"}},x=e=>typeof e.layout=="string"?e.layout:"split",m=e=>x(e)==="split",P=e=>!m(e),F=e=>x(e)==="spine",pe=e=>P(e)&&!F(e),v=(e,t,n,U)=>({kind:"group",name:"Picture",keepEmpty:!0,box:[["imageSrc","bgImage"]],props:{...o,sectionBorder:{top:1,right:1,bottom:1,left:1},darken:75,darkenStyle:"bottom",placement:"bottom-center",sectionHeightMode:"fixed",sectionHeightValue:e,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:t,sectionHeightUnitPhone:"px",...ee(12,16),...n},when:k=>U(k)&&typeof k.imageSrc=="string"&&k.imageSrc.trim()!=="",parts:[{kind:"group",name:"Caption",props:{...o,direction:"row",justify:"between",align:"center",gap:12,gapPhone:12,share:"content",phoneRow:2},parts:[r("imageCaption",a(11,.24,{color:"text"})),r("imageMeta",a(11,.24,{color:"accent"}),{props:{...c,align:"right"}})]}]}),D=(e={})=>({kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:{..._,...e,...L},style:a(13,.3)}),S=()=>[r("title",{textStyle:"heading-3",...g(i("headingSmall",24,20),-.02,1.5)},{role:"heading",mark:"accentItalic"}),{kind:"block",type:"Text",props:{...c,_partStyles:{text:s(i("body",17,16),1.6)}},box:[["body","text",(e,t)=>O(h(t)[0]??"")]],when:(e,t)=>h(t).length>0},{kind:"block",type:"Text",props:{...p,_partStyles:{text:s(i("body",17,16),1.6,{paragraphSpacing:14})}},box:[["body","text",(e,t)=>O(h(t).slice(1).join(`
|
|
2
2
|
|
|
3
|
-
`)]],when:(e,t)=>
|
|
3
|
+
`))]],when:(e,t)=>h(t).length>1}],E=()=>r("date",l(13,.24,{color:"accent"})),I=(e,t,n={})=>r(e,t,{...n,props:{...c,...n.props??{},align:"center"}}),Y=oe("headingMedium",40,5,76),X={sectionBorder:{bottom:1}},ce={name:"Story Timeline",skip:e=>x(e)==="track"?'display "track": not converted (it draws the Milestone rail; a Track story is not stored anywhere)':void 0,boxProps:e=>m(e)?{...u,direction:"row",share:[40],gap:80,gapPhone:48,align:"start",...X,...b(e,"Timeline")}:{...u,direction:"column",gap:48,gapPhone:48,align:"center",...X,...b(e,"Timeline")},box:[...A,...C("Timeline")],parts:[{kind:"group",name:"Heading",props:{...o,gap:24,gapPhone:24},when:m,parts:[r("eyebrow",a(12,.3,{color:"accent"}),{role:"eyebrow"}),r("title",{textStyle:"heading-2",...g(Y,-.03,.94)},{role:"heading",mark:"accentItalic"}),r("intro",s(i("body",14),1.6),{props:{...p,maxWidth:360},mark:"accentItalic"}),v(667,419,{},()=>!0),D()]},{kind:"group",name:"Chapters",props:{...o,gap:48,gapPhone:48,line:!1},when:m,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,direction:"row",gap:24,gapPhone:8,share:[12],align:"start"},parts:[E(),{kind:"group",name:"Words",props:{...o,gap:14,gapPhone:14},parts:S()}]}]},{kind:"group",name:"Heading",props:{...o,gap:24,gapPhone:24,align:"center",maxWidth:760,widthFit:"fill"},when:P,parts:[I("eyebrow",a(12,.3,{color:"accent"}),{role:"eyebrow"}),I("title",{textStyle:"heading-2",...g(Y,-.03,.94)},{role:"heading",mark:"accentItalic"}),I("intro",s(i("body",14),1.6),{props:{...p,maxWidth:520},mark:"accentItalic"}),D({align:"center"})]},v(506,192,{maxWidth:900,widthFit:"fill"},P),{kind:"group",name:"Chapters",props:{...o,gap:48,gapPhone:48,line:!0,maxWidth:760,widthFit:"fill",sectionPaddingTop:16},when:F,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,gap:8,gapPhone:8},parts:[E(),{kind:"group",name:"Words",props:{...o,gap:14,gapPhone:14},parts:S()}]}]},{kind:"group",name:"Chapters",props:{...o,gap:56,gapPhone:56,maxWidth:1e3,widthFit:"fill",sectionPaddingTop:16,mirrorCards:"even"},when:pe,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,direction:"row",gap:64,gapPhone:0,share:[50],align:"start"},parts:[{kind:"group",name:"Entry",props:{...o,gap:8,gapPhone:8},parts:[E(),{kind:"group",name:"Words",props:{...o,gap:14,gapPhone:14},parts:S()}]},{kind:"group",name:"Spacer",props:{...o},keepEmpty:!0,parts:[]}]}]}],drop:{...B,...H,layout:"the Box's own arrangement replaces it: Split a row of two Boxes; Spine and Alternating a centred column (Track is skipped)"}},we=()=>({eyebrow:y.eyebrow,title:N(y.title),intro:y.intro,ctaText:d.text,ctaHref:d.href,entries:ie()}),xe=()=>({eyebrow:T.eyebrow,title:N(T.title),intro:T.intro,ctaText:d.text,ctaHref:d.href,entries:ae()}),Pe={TimelineTrack:se,Timeline:ce};export{Pe as TIMELINE_SECTION_TO_BOX,xe as milestoneTimelinePressStarter,we as storyTimelinePressStarter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as v,registerSectionToBox as t}from"../../../sections/section-to-box.js";import{BUTTON as m,DIM as g,DROP_COMMON as
|
|
1
|
+
import{hasWords as v,registerSectionToBox as t}from"../../../sections/section-to-box.js";import{BUTTON as m,DIM as g,DROP_COMMON as a,DROP_SIDE_PADDING as c,INNER_BOX as o,leadLine as A,SAME_KEYS as s,SECTION_BOX as d,TEXT as l,innerPad as O,siteGutterOf as C,innerPadKeys as T,smallText as u,wrapperPad as b,wrapperPadKeys as P}from"./section-to-box-row-parts.js";import{CARDS_SECTION_TO_BOX as H}from"./section-to-box-rows-cards.js";import{normalizeSiteGutterPhone as R,siteGutterPhoneFollows as D}from"../../../../../format/lib/content/page-width.js";import{finiteNumber as L}from"../../../../../format/lib/finite-number.js";import{STATS_SECTION_TO_BOX as W}from"./section-to-box-rows-stats.js";import{LOGOS_SECTION_TO_BOX as X}from"./section-to-box-rows-logos.js";import{STRIP_SECTION_TO_BOX as G}from"./section-to-box-rows-strip.js";import{TIMELINE_SECTION_TO_BOX as M}from"./section-to-box-rows-timeline.js";import{LOCATIONS_SECTION_TO_BOX as F}from"./section-to-box-rows-locations.js";import{HEAD_ONLY_SECTION_TO_BOX as z}from"./section-to-box-rows-head.js";import{PAGE_HEADER_SECTION_TO_BOX as K}from"./section-to-box-rows-pageheader.js";import{DOCBODY_SECTION_TO_BOX as U}from"./section-to-box-rows-docbody.js";import{EDITORIAL_SECTION_TO_BOX as Y}from"./section-to-box-rows-editorial.js";import{FORMS_SECTION_TO_BOX as j}from"./section-to-box-rows-forms.js";import{FITMENT_SECTION_TO_BOX as q}from"./section-to-box-rows-fitment.js";import{fluidToken as J,headTree as S,token as i}from"./section-head-looks.js";import{boxPadding as Q}from"../../../../../format/lib/document/seed-parts.js";const w={top:72,bottom:72,topPhone:72,bottomPhone:72},V={name:"Editorial Text",boxProps:e=>({...d,direction:"column",gap:28,gapPhone:28,sectionBorder:{top:1},...b(e,w)}),box:[["topBorder","sectionBorder",e=>e===!1?void 0:{top:1}],...s,...P(w)],parts:[S("Prose"),{kind:"text",key:"body",props:g,style:{textStyle:"body-1",...i("body",16),lineHeight:1.7,paragraphSpacing:18}}],drop:{...a,...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)"}},f={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},_=(e,n)=>n?.variant==="primary",k=(e,n)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:e,parts:[{kind:"button",key:"label",href:"href",when:_,variant:"primary",style:{letterSpacing:.3},props:{...m,...f,...n}},{kind:"button",key:"label",href:"href",when:(r,p)=>!_(r,p),variant:"ghost",style:{letterSpacing:.3},props:{...m,...f,...n}}]}),h=e=>v(e.title),Z={name:"Call-to-Action Heading",boxProps:e=>({...d,direction:"row",align:"center",justify:h(e)?"between":"end",gap:60,gapPhone:60,share:"content",sectionBorder:{bottom:1},...O(e,"TitleWithButtons")}),box:[...s,...T("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",...J("headingLarge",48,7,108),case:"upper",lineHeight:.94,letterSpacing:-.035}}]},{kind:"group",name:"Buttons",props:e=>({...o,gap:14,gapPhone:14,widthFitPhone:"fill",...h(e)?{minWidth:280,minWidthPhone:0}:{}}),parts:[k(h,{widthFit:"fill",iconPosition:"end"}),k(e=>!h(e),{})]}],drop:{...a,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 $(e){const{siteGutter:n,siteGutterPhone:r}=e.site??{},p=C(e),y=Math.min(20,R(r)??D(n));return{sectionPaddingLeft:p,sectionPaddingRight:p,sectionPaddingLeftPhone:y,sectionPaddingRightPhone:y}}const B={top:40,bottom:64,topPhone:24,bottomPhone:36},ee={name:"Section Header",boxProps:(e,n)=>({...d,direction:"column",gap:0,...b(e,B),...$(n)}),box:[...s,...P(B)],parts:[S("SectionHeader")],drop:{...a,...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={...o,direction:"row",share:[67],gap:30},E={...o,sectionPaddingLeft:30,sectionPaddingLeftPhone:0},N=(e,n,r)=>({kind:"group",name:e,props:n,parts:[r]}),te={name:"Lead Text",boxProps:e=>({...d,direction:"column",gap:40,gapPhone:40,sectionBorder:{bottom:1},...O(e,"ParagraphsA")}),box:[...s,...T("ParagraphsA")],parts:[{kind:"group",name:"Numbers",props:{...x,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:[u("eyebrow",{color:"labels",...i("label",12),letterSpacing:.24})]},N("Stats column",o,{kind:"group",name:"Stats",props:{...E,gap:0,gapPhone:0},parts:[{kind:"list",key:"stats",name:"Stat",flat:!0,parts:[A("value","label",{...i("label",13),letterSpacing:.18,lineHeight:1.8})]}]})]},{kind:"group",name:"Words",props:{...x,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}}]}]},N("Note column",{...o,justify:"end",widthFit:"fill"},{kind:"group",name:"Founders",props:{...E,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:g,style:{textStyle:"body-5",fontRole:"heading",...i("body",14,12),lineHeight:1.7}}]},u("attribution",{...i("label",12,10),letterSpacing:.24,lineHeight:1.7})]})]}],drop:{...a}},I={top:24,bottom:24,topPhone:24,bottomPhone:24},oe={name:"Banner",boxProps:e=>({...d,direction:"column",gap:0,...b(e,I)}),box:[...s,"contained",...P(I)],parts:[{kind:"group",name:"Card",keepEmpty:!0,props:{...o,gap:28,placement:"top-left",darken:60,darkenStyle:"even",sectionBorder:{width:1},...Q(64,40,40,24)},box:[["imageSrc","bgImage"],["overlay","darken",e=>Math.min(Math.max(L(e)??60,0),100)]],parts:[{kind:"group",name:"Words",props:{...o,gap:20},parts:[u("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:{...g,maxWidth:680},style:{textStyle:"body-1",lineHeight:1.6},was:{size:16}}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:m}]}],drop:{...a,...c}},ne={Prose:V,TitleWithButtons:Z,SectionHeader:ee,ParagraphsA:te,Banner:oe};function we(){t(ne),t(W),t(X),t(H),t(G),t(M),t(F),t(z),t(K),t(U),t(Y),t(j),t(q)}export{ne as GENERAL_SECTION_TO_BOX,we as registerGeneralSectionRows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t}from"react/jsx-runtime";import{Render as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{Render as a}from"efficient-easel/render";import{capHeroGroups as c}from"../../../format/lib/document/cap-hero-groups.js";import{BelowFirstScreen as f,LATER_SLIDES_KEY as p,firstScreenLead as d,laterSlideIdsOf as g,useLeadDrawsFirst as l}from"../first-screen.js";import{markHeadCoreBoxes as S}from"./head-core-boxes.js";import{oneH1 as u}from"../../../format/lib/document/one-h1.js";import{withPageContents as h}from"../content/page-contents.js";import{migrateLegacyPageData as w}from"./migrate-legacy.js";import{migrateRenamedProps as O}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as _,SECTION_TO_BOX_ON as L}from"../sections/section-to-box.js";import{siteThemeOf as P}from"../../../format/lib/theme.js";import{registerGeneralSectionRows as R}from"./blocks/general/section-to-box-rows.js";import{withSlotCounts as x}from"./slot-counts.js";function C({config:n,data:m,metadata:r}){R();const e=h(S(u(c(_(O(w(m)),L,{theme:P(r)}))))),i=l(n,d(e.content)),o=g(e.content),s=o.length>0?{...r,[p]:o}:r;return t(f,{children:t(a,{config:i,metadata:x(s,e.content),data:e})})}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as p}from"react/jsx-runtime";import{parseBlockWidthFit as P,phoneKey as l,tabletKey as o}from"efficient-easel/draw";import{blockCanWidenPastCell as K,blockFillInCellClass as A,blockPhoneHideClass as L,blockSizeOf as G,blockSizeValuesOf as X}from"../../content/block-size.js";import{NoCellBound as Z}from"../../../components/BoxCellContext.js";import{CellWrap as $,useBoxCell as v}from"../../../components/InBoxContext.js";import{boxPhoneRowFits as U,boxRowColumnsClass as T,boxShareClasses as g,boxShareTabletOf as M,boxTabletColumnsClass as V}from"../../../../format/lib/content/box-layout.js";import{resolveContainerDirection as Y}from"../../../../format/lib/content/container-direction.js";import{containerBlocksFor as q}from"../../../../format/lib/document/container-blocks.js";import{readPartStyle as J}from"../part-styles.js";import{addShowWhenFacts as Q,withRowRules as S}from"../../../../format/lib/document/show-when-attach.js";import{BOX_BLOCK_KEYS as tt}from"./cell-width.js";import{findParentNode as et}from"../../../../format/lib/document/passes/document-position.js";const it=new Set(["Text","Heading"]),nt=new Set(["h1","h2","h3","h4","h5","h6"]);function O(t,e){return t==="Heading"?!0:t!=="Text"?!1:typeof e.tag=="string"&&nt.has(e.tag)?!0:J(e,"text").textStyle?.startsWith("heading-")===!0}const a={not:{context:"blockOutsideBox",is:!0}},B={all:[a,{not:{context:"boxSharesWidth",is:!0}}]},k={all:[a,{not:{context:"boxSharesWidthPhone",is:!0}}]},C={all:[a,{not:{context:"boxSharesWidthTablet",is:!0}}]};function H(t,e,i){return{any:[{field:o(t),is:e},{all:[{field:o(t),set:!1},i??{field:t,is:e}]}]}}function I(t,e,i){return{any:[{field:l(t),is:e},{all:[{field:l(t),set:!1},i??{field:t,is:e}]}]}}const N={any:[{field:"textFit",is:"shrink"},{all:[{field:"textFit",set:!1},{not:{context:"textWrapsByDefault",is:!0}}]}]},rt=[[["_gBlockSize","minWidth",o("minWidth"),l("minWidth"),"maxWidth",o("maxWidth"),l("maxWidth")],a],[["widthFit"],B],[[o("widthFit")],C],[[l("widthFit")],k],[["width"],{all:[B,{field:"widthFit",is:"fixed"}]}],[[o("width")],{all:[C,H("widthFit","fixed")]}],[[l("width")],{all:[k,I("widthFit","fixed")]}]],y=H("textFit","shrink",N),E=[[["_gText","textFit",o("textFit"),l("textFit")],a],[["minFont"],{all:[a,N]}],[[o("minFont")],{all:[a,y]}],[[l("minFont")],{all:[a,I("textFit","shrink",y)]}]],h=(t,e)=>et(e.appState,t.props?.id),d=t=>!!t&&typeof t.type=="string"&&q(t.type)!==null,b=t=>(t.type==="Flex"||t.type==="HeroGroup")&&Y(t.type,t.props?.direction)==="row",w=t=>{const e=P(t);return e!==void 0&&e!=="fit"},st={blockOutsideBox:(t,e)=>!d(h(t,e)),boxSharesWidth:(t,e)=>{const i=h(t,e);return!d(i)||!b(i)?!1:T({...i.props,direction:"row"})!==""?!0:g(i.props?.share)!==""&&!w(t.props?.widthFit)},boxSharesWidthTablet:(t,e)=>{const i=h(t,e);if(!d(i)||!b(i))return!1;if(V(i.props?.[o("columns")])!==""||T({...i.props,direction:"row"})!=="")return!0;const n=M(i.props?.[o("share")])??i.props?.share;return g(n)!==""&&!w(t.props?.[o("widthFit")]??t.props?.widthFit)},boxSharesWidthPhone:(t,e)=>{const i=h(t,e);if(!d(i)||!b(i))return!1;const n=i.props?.phoneRow;return(Number(n)===2||Number(n)===3)&&!U(n,i.props?.[l("share")])&&!w(t.props?.[l("widthFit")]??t.props?.widthFit)}},ot=t=>/^_[gds][A-Z]/.test(t);function lt(t,e,i){const n=Object.entries(t),r=n.findIndex(([c])=>c===e);if(r===-1)return null;let s=r+1;for(;s<n.length&&!ot(n[s][0]);)s++;return Object.fromEntries([...n.slice(0,s),...Object.entries(i),...n.slice(s)])}function R(t,e,i){const n=Object.entries(t);return Object.fromEntries([...n.slice(0,e),...Object.entries(i),...n.slice(e)])}function ct(t,e,i){const n=Object.keys(e);if(n.includes("_dSize")){const{_gBlockSize:r,...s}=i;return R(e,n.indexOf("_dSize")+1,s)}return at.has(t)&&n.includes("_gSpacing")?R(e,n.indexOf("_gSpacing"),i):{...e,...i}}const at=new Set(["Text","Heading"]);function ht(t,e){const{_gText:i,...n}=e;return lt(t,"_gText",n)??{...t,...e}}function dt(t){const e=new WeakMap;return i=>{if(!i||!("textFit"in i))return i;let n=e.get(i);if(!n){n={...i};for(const r of["textFit",o("textFit"),l("textFit")])r in n&&(n[r]=t[r]);e.set(i,n)}return n}}const Bt={name:"blockSize",applies:(t,e,i)=>tt.includes(t)&&!!i&&typeof i.render=="function",panel(t,e,i){const n=it.has(e),{text:r}=i.blockSizeFields(n?{tablet:!0,textFit:e==="Heading"?"shrink":"wrap"}:{}),{size:s}=i.blockSizeFields({tablet:!0});let c=ct(e,t.fields??{},S(s,rt));if(n){const u=S(r,E);if(c=ht(c,u),e==="Text"){const z=S(i.blockSizeFields({tablet:!0,textFit:"shrink"}).text,E),D=dt(z),F=t.resolveFields,j=(m,f)=>{const x=F?F(m,f):f.fields,_=W=>O(e,m?.props??{})?D(W??f.fields):W;return x instanceof Promise?x.then(_):_(x)};t.resolveFields=j}}t.fields=c,Q(t,{...st,textWrapsByDefault:u=>!O(e,u.props??{})})},draw(t){ut(t)}};function ut(t){const e=t.render;t.render=i=>{const n=X(i),r=G(n),s=e(i);if(r===null)return s;const c=L(i);return p(ft,{size:r,className:c?`${r.className} ${c}`:r.className,inCell:A(n),widens:K(n),children:s})}}function ft({size:t,className:e,inCell:i,widens:n,children:r}){const s=v()?.phoneCells===!0,c=n?p(Z,{children:r}):r;return p($,{className:s&&i?`${e} ${i}`:e,...Object.keys(t.style).length?{style:t.style}:{},attrs:t.attrs,children:c})}export{Bt as blockSize,O as textShrinksByDefault};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"isomorphic-dompurify";e.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener noreferrer")});
|
|
1
|
+
import e from"isomorphic-dompurify";e.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener noreferrer")});const r={ALLOWED_TAGS:["p","br","hr","span","div","section","article","header","footer","h1","h2","h3","h4","h5","h6","strong","em","b","i","u","small","sup","sub","mark","ul","ol","li","blockquote","a","img","picture","source","figure","figcaption","video","table","thead","tbody","tr","th","td"],ALLOWED_ATTR:["href","title","alt","src","srcset","sizes","class","style","target","rel","width","height","loading","poster","controls"],ALLOW_DATA_ATTR:!1};function a(t){return e.sanitize(t,r)}function o(t){return e.sanitize(t,{...r,RETURN_DOM_FRAGMENT:!0})}export{a as sanitizeHtml,o as sanitizeHtmlFragment};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SLOT_COUNTS_KEY = "slotCounts";
|
|
2
|
+
export type SlotCounts = Readonly<Record<string, number>>;
|
|
3
|
+
type Props = Readonly<Record<string, unknown>>;
|
|
4
|
+
export declare const DRAWS_FOR_SURE: Readonly<Record<string, (props: Props) => boolean>>;
|
|
5
|
+
export declare function slotCountsOf(content: unknown): SlotCounts;
|
|
6
|
+
export declare function withSlotCounts(metadata: Readonly<Record<string, unknown>> | undefined, content: unknown): Record<string, unknown>;
|
|
7
|
+
export declare function slotCountOf(props: Props): number | undefined;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isNode as m,isNodeList as S}from"efficient-easel/data";import{hidableText as _,phoneKey as w,readHidable as y}from"efficient-easel/draw";import{BLOCK_SHOW_KEY as h,blockSizeValuesOf as R}from"../content/block-size.js";import{CARD_ROW_FIELD_PROP as b,CARD_TEMPLATE_SLOT as x,namedRowField as E,ROW_BOUND_PROPS as P}from"../../../format/lib/content/card-template.js";import{SHOW_FOR_PROP as g}from"../../../format/lib/content/box-show-for-choices.js";const O="slotCounts",u=t=>!y(t).hidden&&_(t).trim()!=="",C=t=>typeof t=="string"&&t.trim()!=="",A={Flex:()=>!0,PostCard:()=>!0,ImageBlock:t=>C(t.src),Text:t=>u(t.text),Heading:t=>u(t.text),Eyebrow:t=>u(t.eyebrow)},W=["widthFit","width","minWidth"],d=t=>S(t);function F(t){if(Array.isArray(t.content))return d(t.content)?t.content:null;const e=Object.values(t).filter(d);return e.length===1?e[0]:null}function N(t,e){return[...new Set([b,...Object.values(P[t]??{})])].some(o=>E(e,o)!=="")}function D(t){const e=t.props??{},n=A[t.type];if(!n||!n(e)||N(t.type,e)||e[w(h)]===!1)return!1;const o=e[g];if(o!=null&&o!=="")return!1;const r=R(e);return!W.some(s=>r[s]!==void 0)}function I(t){let e=0;for(const n of t)if(!n.props?._hidden){if(!D(n))return;e+=1}return e>0?e:void 0}function L(t){const e={},n=new Set,o=new Set,r=(s,a)=>{if(Array.isArray(s))for(const f of s){if(!m(f))continue;const i=f.props.id;typeof i=="string"&&(n.has(i)?o:n).add(i);const l=a?null:F(f.props);if(typeof i=="string"&&l){const c=I(l);c!==void 0&&(e[i]=c)}for(const[c,p]of Object.entries(f.props))d(p)&&r(p,a||c===x)}};r(t,!1);for(const s of o)delete e[s];return e}function B(t,e){return{...t??{},[O]:L(e)}}function U(t){const n=t.editor?.metadata?.[O],o=t.id,r=typeof o=="string"&&n&&typeof n=="object"?n[o]:void 0;return typeof r=="number"&&Number.isInteger(r)&&r>0?r:void 0}export{A as DRAWS_FOR_SURE,O as SLOT_COUNTS_KEY,U as slotCountOf,L as slotCountsOf,B as withSlotCounts};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
2
|
+
import type { Config } from "efficient-easel/blocks";
|
|
3
|
+
export type FirstScreenPlace = "first" | "below";
|
|
4
|
+
export declare function FirstScreen({ children }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function BelowFirstScreen({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function useFirstScreenPlace(): FirstScreenPlace | null;
|
|
11
|
+
export declare function useDeferredPicture(): {
|
|
12
|
+
loading?: "lazy";
|
|
13
|
+
};
|
|
14
|
+
export declare function PagePicture(props: ComponentPropsWithoutRef<"img">): import("react").JSX.Element;
|
|
15
|
+
export declare const LATER_SLIDES_KEY = "laterSlideIds";
|
|
16
|
+
interface PageNode {
|
|
17
|
+
type?: string;
|
|
18
|
+
props?: {
|
|
19
|
+
id?: unknown;
|
|
20
|
+
slides?: unknown;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function firstScreenLead<T extends {
|
|
24
|
+
type?: string;
|
|
25
|
+
}>(content?: T[] | null): T | null;
|
|
26
|
+
export declare function laterSlideIdsOf(value: unknown, into?: string[]): string[];
|
|
27
|
+
export declare function useLeadDrawsFirst(config: Config, lead: PageNode | null): Config;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{createContext as p,useContext as l,useMemo as a}from"react";import{leadSection as x}from"./document/header-clearance.js";const c=p(null);function S({children:e}){return o(c.Provider,{value:"first",children:e})}function h({children:e}){return o(c.Provider,{value:"below",children:e})}function m(){return l(c)}function y(){return m()==="below"?{loading:"lazy"}:{}}function D(e){const r=y();return o("img",{...e,...r})}const F="laterSlideIds",b=new Set(["Breadcrumb","CategoryBar","Divider","Spacer","Ticker"]);function j(e){return x(e?.filter(r=>!r?.type||!b.has(r.type)))}function d(e,r=[]){if(Array.isArray(e))for(const t of e)d(t,r);else if(e&&typeof e=="object"){const{slides:t}=e;if(Array.isArray(t))for(const n of t.slice(1))typeof n?.props?.id=="string"&&r.push(n.props.id);for(const n of Object.values(e))d(n,r)}return r}function B(e,r){const t=r?.type,n=r?.props?.id;return a(()=>{const i=t?e.components[t]:void 0;if(!t||!i)return e;const u=i.render,f=s=>s.id===n?o(S,{children:o(u,{...s})}):o(u,{...s});return{...e,components:{...e.components,[t]:{...i,render:f}}}},[e,t,n])}export{h as BelowFirstScreen,S as FirstScreen,F as LATER_SLIDES_KEY,D as PagePicture,j as firstScreenLead,d as laterSlideIdsOf,y as useDeferredPicture,m as useFirstScreenPlace,B as useLeadDrawsFirst};
|
|
@@ -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{accentItalicRuns as ie}from"../../../format/lib/markup.js";import{seedNodes as re}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ae}from"../../../format/lib/locations-grid.js";import{normalizeTheme as G}from"../../../format/lib/theme.js";const P=ee,v=te;function Be(t){if(t.theme)return G(t.theme);const o=t.site?.themePresets;return o?G({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ce(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 Te(t){for(const[o,i]of Object.entries(t)){if(o in A&&A[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=i}}function _e(t){return A[t]}const V=new Set(["id"]),T={},F=[],fe=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","Stats","Logos","FitmentFinder","DocMasthead"];function Ee(t){for(const[o,i]of Object.entries(t)){if(o in T&&T[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=i}}function Pe(t){return T[t]}function ve(){return Object.keys(T)}function de(t){return t in T&&F.includes(t)}function je(t,o=fe){return t in T&&(o.includes(t)||de(t))}function Ne(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&i.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const H=t=>Z(t),Ie=t=>H(t).text.trim()!=="";function le(t){if(t.includes("=="))return t;const o=t.indexOf("/"),i=o===-1?t:t.slice(0,o),r=i.trim();if(!r)return t;const m=i.indexOf(r);return`${i.slice(0,m)}==${r}==${i.slice(m+r.length)}${o===-1?"":t.slice(o)}`}const pe=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function ue(t,o,i,r){const a={...t._partStyles?.text??{},...o??{},...i??{}};return(r==="center"||r==="right")&&a.align===void 0&&(a.align=r),Object.keys(a).length?{_partStyles:{text:a}}:{}}function he(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const i=o[t.key];return{variant:typeof i=="string"&&Object.hasOwn(t.map,i)?t.map[i]:t.fallback}}function Y(t,o,i,r,m={}){const a={...o};for(const h of t){const[k,B,j]=typeof h=="string"?[h,h,void 0]:h;if(i[k]===void 0)continue;const _=j?j(i[k],i,m):i[k];_===void 0?delete a[B]:a[B]=_,r(k,B,_===void 0)}return a}function ye(t){const o=new Set([...V,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),i=m=>{for(const a of m??[])o.add(typeof a=="string"?a:a[0])},r=m=>{for(const a of m)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":i(a.box),r(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(h=>o.add(h)),Object.keys(a.rename??{}).forEach(h=>o.add(h)),a.derive?.reads.forEach(h=>o.add(h)),typeof a.slots!="function")for(const h of Object.values(a.slots??{}))for(const k of h)"kind"in k&&o.add(k.key);break}};for(const m of[t,...t.also??[]])i(m.box),r(m.parts);return o}function q(t,o,i={}){const r=t.props,m=o.skip?.(r);if(m!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:m};const a=String(r.id??t.type),h=[],k=[],B=[],j=new Set,_=(n,s)=>{h.push({key:n,home:s}),j.add(n)},X=r._partStyles??{},L=ye(o);let K=0;const $=(n,s)=>({type:n,props:{...s,id:`${a}~${n}-${++K}`}}),M=(n,s,b,y,g,d,w)=>{if(g){for(const c of n??[]){const p=typeof c=="string"?c:c[0];b[p]!==void 0&&w(p,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(r,i):s??{};return Y(n??[],e,b,(c,p,f)=>w(c,f?`nothing — the old value draws nothing (${y}: no ${p})`:`${d}${y}: ${p}`),i)},J=n=>re(n,s=>`${a}~${s}-${++K}`),W=(n,s,b)=>{const y=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],g=typeof n.props=="function"?n.props(r,i):n.props??{},d=y.map((f,x)=>{const l=f??{},u=n.item?.(l,x,r)??{},O=N(u.reverse?[...n.parts].reverse():n.parts,l,!1,`item ${x+1}: `);return n.flat?u.props?O.map(E=>({...E,props:{...E.props,...u.props,id:E.props.id}})):O:[$(P,{name:`${n.name} ${x+1}`,...g,...u.props??{},[v]:O})]});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,l)=>{const u=x.items.map(S=>S.item),O=f.parts?N(f.parts,f.head?.(u,r)??{},!1,`group ${l+1}: `):[],E=x.items.map(S=>d[S.index]),z=f.perRow?.(u.length,r),I=Number.isInteger(z)&&z>=1?z:1,C=[];if(f.perRow&&I<E.length)for(let S=0;S*I<E.length;S++)C.push(E.slice(S*I,(S+1)*I).flat());return $(P,{name:`${f.name} ${l+1}`,...f.props??{},[v]:[...O,$(P,{name:`${f.itemsName} ${l+1}`,...f.itemsProps?.(u.length,r)??{},[v]:C.length?C.map((S,U)=>$(P,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[v]:S})):E.flat()})]})})}const w=n.perRow?.(r),e=n.perRow?Number.isInteger(w)&&w>=1?w: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 d.flat();const c=typeof n.rowProps=="function"?n.rowProps(r,i):n.rowProps??{},p=[];for(let f=0;f*e<d.length;f++){const x=d.slice(f*e,(f+1)*e).flat(),l=n.rowFiller?e-d.slice(f*e,(f+1)*e).length:0;p.push($(P,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...c,[v]:[...x,...Array.from({length:l},(u,O)=>$(P,{name:`Empty ${O+1}`,...n.rowFiller,[v]:[]}))]}))}return p},N=(n,s,b,y)=>{const g=[],d=(e,c)=>b?_(e,c):void 0,w=e=>b?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:s)))switch(e.kind){case"text":{const c=H(s[e.key]);if(!c.text.trim()&&!(b&&i.press&&o.pressKeepsEmpty?.includes(e.key))){d(e.key,"nothing — empty words draw nothing, so no block");break}const p=pe(e.role??"body"),{_partStyles:f,...x}=p,l=ue(p,e.styleFrom?{...e.style,...e.styleFrom(r,i)}:e.style,w(e.key),e.props?.align);if(e.was&&b){const u=l._partStyles?.text??{};B.push({key:e.key,was:e.was,...typeof u.textStyle=="string"?{textStyle:u.textStyle}:{},...R(u.size)!==void 0?{size:R(u.size)}:{},...R(u.sizePhone)!==void 0?{sizePhone:R(u.sizePhone)}:{}})}g.push($("Text",{text:e.mark==="accentLead"?le(c.text):e.mark==="accentItalic"?ie(c.text):c.text,...x,...e.props??{},...l,...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Text block: its words${c.hidden?", hidden":""}`);break}case"button":{const c=H(s[e.key]);if(!c.text.trim()){d(e.key,"nothing — no words, no button"),d(e.href,"nothing — no button to link"),typeof e.variant=="object"&&d(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??{},...w(e.key)??{}};g.push($("ButtonBlock",{label:c.text,href:p,...typeof e.props=="function"?e.props(s,i):e.props??{},...he(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Button block: its words`),d(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&d(e.variant.key,`${y}Button block: its Style`);break}case"image":{const c=s[e.key];if(typeof c!="string"||!c){d(e.key,"nothing — no picture, no block"),e.alt&&d(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";g.push($("ImageBlock",{src:c,alt:p,...e.props??{}})),d(e.key,`${y}Image block: its picture`),e.alt&&d(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...W(e,s,d));break}case"group":{const c=N(e.parts,s,b,y),p=M(e.box,e.props,s,`${e.name} Box`,!c.length&&!e.keepEmpty,y,d);p&&g.push($(P,{name:e.name,...p,[v]:c}));break}case"block":{const c=e.parts?N(e.parts,s,b,y):[],p=M(e.box,e.props,s,`${e.type} block`,!!e.parts&&!c.length&&!e.keepEmpty,y,d);p&&g.push($(e.type,{...p,...e.slot?{[e.slot]:c}:{}}));break}case"core":{const c=e.as??t.type,p={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(l=>!L.has(l)&&!(l in p)):e.keep;for(const l of f)s[l]!==void 0&&(p[l]=s[l],d(l,`the ${c} block inside the Box`));if(e.keep==="rest"){for(const u of Object.keys(e.props??{}))s[u]!==void 0&&!L.has(u)&&d(u,`nothing — the ${c} block inside the Box has the row's own value`);s.headPlacement!==void 0&&d("headPlacement",`the ${c} block inside the Box: own-box`);const l=Object.fromEntries(Object.entries(X).filter(([u])=>!L.has(u)));Object.keys(l).length&&(p._partStyles=l)}for(const[l,u]of Object.entries(e.rename??{}))s[l]!==void 0&&(p[u]=s[l],d(l,`the ${c} block inside the Box: ${u}`));if(e.derive){Object.assign(p,e.derive.props(s,i));for(const l of e.derive.reads)s[l]!==void 0&&d(l,`the ${c} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(s,i):e.slots??{};for(const[l,u]of Object.entries(x))p[l]=u.flatMap(O=>"kind"in O?W(O,s,d):J([O]));g.push($(c,p));break}}return g},Q=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,y=N(n.parts,r,!0,s===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,i):n.boxProps??{},d=Y(n.box??[],g,r,(w,e,c)=>_(w,c?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),i);return{type:P,props:{name:n.name,...d,[v]:y,id:ce(a,s)}}},D=[o,...o.also??[]].map(Q);r._partStyles!==void 0&&_("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))r[n]!==void 0&&_(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in r&&(k.push({key:n,why:s}),j.add(n));for(const n of Object.keys(r))V.has(n)||j.has(n)||k.push({key:n,why:"not in the row — not carried"});return{node:D[0],nodes:D,carried:h,dropped:k,siteWrites:[...o.site?.(t,i)??[]],restyled:B}}function Re(t,o=F,i={}){const r=t.content;if(!Array.isArray(r))return t;let m=!1;const a=r.flatMap(h=>{const k=h&&typeof h.type=="string"&&o.includes(h.type)?T[h.type]:void 0;if(!k)return[h];const B=q(h,k,i);return B.skipped!==void 0?[h]:(m=!0,B.nodes)});return m?{...t,content:a}:t}function Ae(t,o=F,i={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((m,a)=>{const h=m&&typeof m.type=="string"&&o.includes(m.type)?T[m.type]:void 0;if(!h)return;const k=q(m,h,i);k.skipped===void 0&&r.push({index:a,node:k.node,nodes:k.nodes})}),r}export{v as SECTION_BOX_SLOT,P as SECTION_BOX_TYPE,F as SECTION_TO_BOX_ON,fe as SECTION_TO_BOX_PRESS,_e as boxNativeReason,q as convertSection,Re as convertSectionsInPage,Be as convertTheme,de as convertsToBox,Ie as hasWords,Ne as headParts,je as pressesAsBox,Te as registerBoxNativeSections,Ee as registerSectionToBox,ce as sectionBoxIdOf,Ae as sectionToBoxEdits,Pe as sectionToBoxRow,ve 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{accentItalicRuns as ie}from"../../../format/lib/markup.js";import{seedNodes as re}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ae}from"../../../format/lib/locations-grid.js";import{normalizeTheme as G}from"../../../format/lib/theme.js";const P=ee,v=te;function Be(t){if(t.theme)return G(t.theme);const o=t.site?.themePresets;return o?G({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ce(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 Te(t){for(const[o,i]of Object.entries(t)){if(o in A&&A[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=i}}function _e(t){return A[t]}const V=new Set(["id"]),T={},F=[],fe=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","Stats","Logos","FitmentFinder","DocMasthead","Timeline","TimelineTrack"];function Ee(t){for(const[o,i]of Object.entries(t)){if(o in T&&T[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=i}}function Pe(t){return T[t]}function ve(){return Object.keys(T)}function de(t){return t in T&&F.includes(t)}function je(t,o=fe){return t in T&&(o.includes(t)||de(t))}function Ne(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&i.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const H=t=>Z(t),Ie=t=>H(t).text.trim()!=="";function le(t){if(t.includes("=="))return t;const o=t.indexOf("/"),i=o===-1?t:t.slice(0,o),r=i.trim();if(!r)return t;const m=i.indexOf(r);return`${i.slice(0,m)}==${r}==${i.slice(m+r.length)}${o===-1?"":t.slice(o)}`}const pe=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function ue(t,o,i,r){const a={...t._partStyles?.text??{},...o??{},...i??{}};return(r==="center"||r==="right")&&a.align===void 0&&(a.align=r),Object.keys(a).length?{_partStyles:{text:a}}:{}}function he(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const i=o[t.key];return{variant:typeof i=="string"&&Object.hasOwn(t.map,i)?t.map[i]:t.fallback}}function Y(t,o,i,r,m={}){const a={...o};for(const h of t){const[k,B,j]=typeof h=="string"?[h,h,void 0]:h;if(i[k]===void 0)continue;const _=j?j(i[k],i,m):i[k];_===void 0?delete a[B]:a[B]=_,r(k,B,_===void 0)}return a}function ye(t){const o=new Set([...V,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),i=m=>{for(const a of m??[])o.add(typeof a=="string"?a:a[0])},r=m=>{for(const a of m)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":i(a.box),r(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(h=>o.add(h)),Object.keys(a.rename??{}).forEach(h=>o.add(h)),a.derive?.reads.forEach(h=>o.add(h)),typeof a.slots!="function")for(const h of Object.values(a.slots??{}))for(const k of h)"kind"in k&&o.add(k.key);break}};for(const m of[t,...t.also??[]])i(m.box),r(m.parts);return o}function q(t,o,i={}){const r=t.props,m=o.skip?.(r);if(m!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:m};const a=String(r.id??t.type),h=[],k=[],B=[],j=new Set,_=(n,s)=>{h.push({key:n,home:s}),j.add(n)},X=r._partStyles??{},L=ye(o);let K=0;const $=(n,s)=>({type:n,props:{...s,id:`${a}~${n}-${++K}`}}),M=(n,s,b,y,g,d,w)=>{if(g){for(const c of n??[]){const p=typeof c=="string"?c:c[0];b[p]!==void 0&&w(p,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(r,i):s??{};return Y(n??[],e,b,(c,p,f)=>w(c,f?`nothing — the old value draws nothing (${y}: no ${p})`:`${d}${y}: ${p}`),i)},J=n=>re(n,s=>`${a}~${s}-${++K}`),W=(n,s,b)=>{const y=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],g=typeof n.props=="function"?n.props(r,i):n.props??{},d=y.map((f,x)=>{const l=f??{},u=n.item?.(l,x,r)??{},O=N(u.reverse?[...n.parts].reverse():n.parts,l,!1,`item ${x+1}: `);return n.flat?u.props?O.map(E=>({...E,props:{...E.props,...u.props,id:E.props.id}})):O:[$(P,{name:`${n.name} ${x+1}`,...g,...u.props??{},[v]:O})]});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,l)=>{const u=x.items.map(S=>S.item),O=f.parts?N(f.parts,f.head?.(u,r)??{},!1,`group ${l+1}: `):[],E=x.items.map(S=>d[S.index]),z=f.perRow?.(u.length,r),I=Number.isInteger(z)&&z>=1?z:1,C=[];if(f.perRow&&I<E.length)for(let S=0;S*I<E.length;S++)C.push(E.slice(S*I,(S+1)*I).flat());return $(P,{name:`${f.name} ${l+1}`,...f.props??{},[v]:[...O,$(P,{name:`${f.itemsName} ${l+1}`,...f.itemsProps?.(u.length,r)??{},[v]:C.length?C.map((S,U)=>$(P,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[v]:S})):E.flat()})]})})}const w=n.perRow?.(r),e=n.perRow?Number.isInteger(w)&&w>=1?w: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 d.flat();const c=typeof n.rowProps=="function"?n.rowProps(r,i):n.rowProps??{},p=[];for(let f=0;f*e<d.length;f++){const x=d.slice(f*e,(f+1)*e).flat(),l=n.rowFiller?e-d.slice(f*e,(f+1)*e).length:0;p.push($(P,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...c,[v]:[...x,...Array.from({length:l},(u,O)=>$(P,{name:`Empty ${O+1}`,...n.rowFiller,[v]:[]}))]}))}return p},N=(n,s,b,y)=>{const g=[],d=(e,c)=>b?_(e,c):void 0,w=e=>b?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:s)))switch(e.kind){case"text":{const c=H(s[e.key]);if(!c.text.trim()&&!(b&&i.press&&o.pressKeepsEmpty?.includes(e.key))){d(e.key,"nothing — empty words draw nothing, so no block");break}const p=pe(e.role??"body"),{_partStyles:f,...x}=p,l=ue(p,e.styleFrom?{...e.style,...e.styleFrom(r,i)}:e.style,w(e.key),e.props?.align);if(e.was&&b){const u=l._partStyles?.text??{};B.push({key:e.key,was:e.was,...typeof u.textStyle=="string"?{textStyle:u.textStyle}:{},...R(u.size)!==void 0?{size:R(u.size)}:{},...R(u.sizePhone)!==void 0?{sizePhone:R(u.sizePhone)}:{}})}g.push($("Text",{text:e.mark==="accentLead"?le(c.text):e.mark==="accentItalic"?ie(c.text):c.text,...x,...e.props??{},...l,...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Text block: its words${c.hidden?", hidden":""}`);break}case"button":{const c=H(s[e.key]);if(!c.text.trim()){d(e.key,"nothing — no words, no button"),d(e.href,"nothing — no button to link"),typeof e.variant=="object"&&d(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??{},...w(e.key)??{}};g.push($("ButtonBlock",{label:c.text,href:p,...typeof e.props=="function"?e.props(s,i):e.props??{},...he(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Button block: its words`),d(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&d(e.variant.key,`${y}Button block: its Style`);break}case"image":{const c=s[e.key];if(typeof c!="string"||!c){d(e.key,"nothing — no picture, no block"),e.alt&&d(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";g.push($("ImageBlock",{src:c,alt:p,...e.props??{}})),d(e.key,`${y}Image block: its picture`),e.alt&&d(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...W(e,s,d));break}case"group":{const c=N(e.parts,s,b,y),p=M(e.box,e.props,s,`${e.name} Box`,!c.length&&!e.keepEmpty,y,d);p&&g.push($(P,{name:e.name,...p,[v]:c}));break}case"block":{const c=e.parts?N(e.parts,s,b,y):[],p=M(e.box,e.props,s,`${e.type} block`,!!e.parts&&!c.length&&!e.keepEmpty,y,d);p&&g.push($(e.type,{...p,...e.slot?{[e.slot]:c}:{}}));break}case"core":{const c=e.as??t.type,p={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(l=>!L.has(l)&&!(l in p)):e.keep;for(const l of f)s[l]!==void 0&&(p[l]=s[l],d(l,`the ${c} block inside the Box`));if(e.keep==="rest"){for(const u of Object.keys(e.props??{}))s[u]!==void 0&&!L.has(u)&&d(u,`nothing — the ${c} block inside the Box has the row's own value`);s.headPlacement!==void 0&&d("headPlacement",`the ${c} block inside the Box: own-box`);const l=Object.fromEntries(Object.entries(X).filter(([u])=>!L.has(u)));Object.keys(l).length&&(p._partStyles=l)}for(const[l,u]of Object.entries(e.rename??{}))s[l]!==void 0&&(p[u]=s[l],d(l,`the ${c} block inside the Box: ${u}`));if(e.derive){Object.assign(p,e.derive.props(s,i));for(const l of e.derive.reads)s[l]!==void 0&&d(l,`the ${c} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(s,i):e.slots??{};for(const[l,u]of Object.entries(x))p[l]=u.flatMap(O=>"kind"in O?W(O,s,d):J([O]));g.push($(c,p));break}}return g},Q=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,y=N(n.parts,r,!0,s===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,i):n.boxProps??{},d=Y(n.box??[],g,r,(w,e,c)=>_(w,c?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),i);return{type:P,props:{name:n.name,...d,[v]:y,id:ce(a,s)}}},D=[o,...o.also??[]].map(Q);r._partStyles!==void 0&&_("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))r[n]!==void 0&&_(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in r&&(k.push({key:n,why:s}),j.add(n));for(const n of Object.keys(r))V.has(n)||j.has(n)||k.push({key:n,why:"not in the row — not carried"});return{node:D[0],nodes:D,carried:h,dropped:k,siteWrites:[...o.site?.(t,i)??[]],restyled:B}}function Re(t,o=F,i={}){const r=t.content;if(!Array.isArray(r))return t;let m=!1;const a=r.flatMap(h=>{const k=h&&typeof h.type=="string"&&o.includes(h.type)?T[h.type]:void 0;if(!k)return[h];const B=q(h,k,i);return B.skipped!==void 0?[h]:(m=!0,B.nodes)});return m?{...t,content:a}:t}function Ae(t,o=F,i={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((m,a)=>{const h=m&&typeof m.type=="string"&&o.includes(m.type)?T[m.type]:void 0;if(!h)return;const k=q(m,h,i);k.skipped===void 0&&r.push({index:a,node:k.node,nodes:k.nodes})}),r}export{v as SECTION_BOX_SLOT,P as SECTION_BOX_TYPE,F as SECTION_TO_BOX_ON,fe as SECTION_TO_BOX_PRESS,_e as boxNativeReason,q as convertSection,Re as convertSectionsInPage,Be as convertTheme,de as convertsToBox,Ie as hasWords,Ne as headParts,je as pressesAsBox,Te as registerBoxNativeSections,Ee as registerSectionToBox,ce as sectionBoxIdOf,Ae as sectionToBoxEdits,Pe as sectionToBoxRow,ve as sectionToBoxTypes};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "57.0.0",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
|
-
"efficient-easel": "^
|
|
57
|
-
"efficient-shell": "^12.
|
|
56
|
+
"efficient-easel": "^29.0.0",
|
|
57
|
+
"efficient-shell": "^12.16.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
60
60
|
"react": ">=19",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@types/node": "^20",
|
|
73
73
|
"@types/react": "^19",
|
|
74
74
|
"@types/react-dom": "^19",
|
|
75
|
-
"efficient-easel": "^
|
|
76
|
-
"efficient-shell": "^12.
|
|
75
|
+
"efficient-easel": "^29.0.0",
|
|
76
|
+
"efficient-shell": "^12.16.0",
|
|
77
77
|
"esbuild": "^0.28.0",
|
|
78
78
|
"happy-dom": "^20.14.5",
|
|
79
79
|
"isomorphic-dompurify": "^3.18.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";const n="sf-hint-keep";function s({children:e}){return t("span",{className:n,children:e})}export{n as KEEP_HINT_CLASS,s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{createContext as t,useContext as e}from"react";const o=t(!1);function r(){return e(o)}export{o as BoxCellWidthContext,r as useBoxCellHasWidth};
|