efficient-web-builder 64.0.0 → 66.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 +94 -0
- package/dist/editor/components/AnchorField.js +1 -1
- package/dist/editor/components/CardShadowField.js +1 -1
- package/dist/editor/components/PagesPanel.js +1 -1
- package/dist/editor/components/SectionEditor.js +1 -1
- package/dist/editor/components/WebsitePreviewButton.js +1 -1
- package/dist/editor/components/storefront-editor.css +16 -24
- package/dist/editor/components/usePreviewHref.js +1 -1
- package/dist/editor/lib/animation/entrance-fields.js +1 -1
- package/dist/editor/lib/animation/scroll-fields.js +1 -1
- package/dist/editor/lib/animation/view-rows.d.ts +20 -0
- package/dist/editor/lib/animation/view-rows.js +1 -0
- package/dist/editor/lib/document/blocks/general/Banner/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/FAQ/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Footprint/fields.d.ts +0 -1
- package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/LogoBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ProcessSteps/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/box-fields.d.ts +2 -1
- package/dist/editor/lib/document/box-fields.js +1 -1
- package/dist/editor/lib/document/card-row-fields.d.ts +3 -0
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +12 -10
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.d.ts +0 -3
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/part-motion-canvas.d.ts +2 -2
- package/dist/editor/lib/document/part-motion-canvas.js +1 -1
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/sections/section-dry-run.d.ts +1 -20
- package/dist/editor/lib/sections/section-dry-run.js +2 -2
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/animation/entrance-keys.d.ts +8 -0
- package/dist/format/lib/animation/entrance-keys.js +1 -0
- package/dist/format/lib/animation/scroll.d.ts +5 -6
- package/dist/format/lib/animation/scroll.js +1 -1
- package/dist/format/lib/animation/views.d.ts +6 -0
- package/dist/format/lib/animation/views.js +1 -0
- package/dist/format/lib/content/block-sources.d.ts +3 -0
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/box-background.d.ts +1 -0
- package/dist/format/lib/content/box-background.js +1 -1
- package/dist/format/lib/content/box-link.d.ts +11 -0
- package/dist/format/lib/content/box-link.js +8 -8
- package/dist/format/lib/content/box-phone-place.d.ts +0 -2
- package/dist/format/lib/content/box-phone-place.js +1 -1
- package/dist/format/lib/content/box-side-space.js +1 -1
- package/dist/format/lib/content/card-image-shape.d.ts +5 -1
- package/dist/format/lib/content/card-image-shape.js +1 -1
- package/dist/format/lib/content/card-template.d.ts +1 -0
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/contact.d.ts +0 -1
- package/dist/format/lib/content/contact.js +2 -2
- package/dist/format/lib/content/css-length.d.ts +1 -0
- package/dist/format/lib/content/css-length.js +1 -0
- package/dist/format/lib/content/page-width.d.ts +17 -1
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +28 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/document/blocks/general/Banner/meta.d.ts +5 -0
- package/dist/format/lib/document/blocks/general/Banner/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Footprint/card-seed.d.ts +2 -0
- package/dist/format/lib/document/blocks/general/Footprint/card-seed.js +1 -1
- package/dist/format/lib/document/blocks/general/Footprint/meta.js +2 -2
- package/dist/format/lib/document/blocks/general/ProcessSteps/column-seed.d.ts +5 -0
- package/dist/format/lib/document/blocks/general/ProcessSteps/column-seed.js +1 -0
- package/dist/format/lib/document/blocks/general/ProcessSteps/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/SectionHeader/meta.d.ts +6 -0
- package/dist/format/lib/document/blocks/general/SectionHeader/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/TitleWithButtons/meta.d.ts +2 -0
- package/dist/format/lib/document/blocks/general/TitleWithButtons/meta.js +2 -2
- package/dist/format/lib/document/media-drop.js +1 -1
- package/dist/format/lib/document/one-h1.d.ts +2 -0
- package/dist/format/lib/document/one-h1.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +2 -0
- package/dist/format/lib/document/renamed-props.d.ts +1 -0
- package/dist/format/lib/document/renamed-props.js +1 -1
- package/dist/format/lib/document/section-catalog.js +10 -2
- package/dist/format/lib/document/section-descriptions.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +16 -0
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/fit-words.js +4 -1
- package/dist/format/lib/links/page-link-rules.d.ts +0 -1
- package/dist/format/lib/links/page-link-rules.js +1 -1
- package/dist/format/lib/markup.d.ts +1 -0
- package/dist/format/lib/markup.js +2 -2
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -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/source-rules/editor-words.js +1 -1
- package/dist/format/lib/source-rules/motion-vars-from-the-shell.d.ts +6 -0
- package/dist/format/lib/source-rules/motion-vars-from-the-shell.js +4 -0
- package/dist/format/lib/source-rules/one-length-control.d.ts +18 -0
- package/dist/format/lib/source-rules/one-length-control.js +16 -0
- package/dist/format/lib/source-rules/support/label-extraction.js +3 -3
- package/dist/format/lib/theme.d.ts +0 -1
- package/dist/format/lib/theme.js +3 -3
- package/dist/format/lib/web-runtime.d.ts +2 -0
- package/dist/format/lib/web-runtime.js +1 -1
- package/dist/render/components/BlockFrame.d.ts +3 -3
- package/dist/render/components/BlockFrame.js +1 -1
- package/dist/render/components/Breadcrumb.js +1 -1
- package/dist/render/components/Btn.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +7 -1
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/CategoryBar.js +1 -1
- package/dist/render/components/ContactLocations.js +2 -2
- package/dist/render/components/DealerFinder.d.ts +4 -1
- package/dist/render/components/DealerFinder.js +1 -1
- package/dist/render/components/Divider.js +1 -1
- package/dist/render/components/DocMasthead.js +1 -1
- package/dist/render/components/DocTabs.js +1 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Footprint.d.ts +5 -3
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/Heading.d.ts +0 -1
- package/dist/render/components/Heading.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -5
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/LocationMap.js +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/Logos.d.ts +1 -2
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/LongRead.js +1 -1
- package/dist/render/components/PictureZoom.js +1 -1
- package/dist/render/components/PostCard.js +1 -1
- package/dist/render/components/ProcessSteps.d.ts +2 -1
- package/dist/render/components/ProcessSteps.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/SectionAnimation.d.ts +8 -16
- package/dist/render/components/SectionAnimation.js +1 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/SideListLayout.d.ts +4 -1
- package/dist/render/components/SideListLayout.js +1 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/components/Text.d.ts +2 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/components/Timeline.js +1 -1
- package/dist/render/components/TimelineRail.d.ts +11 -3
- package/dist/render/components/TimelineRail.js +1 -1
- package/dist/render/components/TimelineTrack.js +1 -1
- package/dist/render/components/TitleWithButtons.js +1 -1
- package/dist/render/components/goldPhrases.js +3 -3
- package/dist/render/lib/animation/entrance.d.ts +6 -14
- package/dist/render/lib/animation/entrance.js +1 -1
- package/dist/render/lib/animation/part-motion.js +2 -2
- package/dist/render/lib/content/block-size.d.ts +5 -1
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-stack-line.d.ts +1 -1
- package/dist/render/lib/content/box-stack-line.js +1 -1
- package/dist/render/lib/content/button-look.d.ts +2 -0
- package/dist/render/lib/content/button-look.js +1 -1
- package/dist/render/lib/content/section-edge.js +1 -1
- package/dist/render/lib/content/section-padding.d.ts +5 -2
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/dealer-source.d.ts +6 -2
- package/dist/render/lib/dealer-source.js +1 -1
- package/dist/render/lib/document/blocks/general/Banner/render.js +1 -1
- package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
- package/dist/render/lib/document/blocks/general/TitleWithButtons/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +2 -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.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.d.ts +2 -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-locations.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-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-tabbar.d.ts +3 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-tabbar.js +1 -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.d.ts +3 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/card-press-titles.d.ts +10 -0
- package/dist/render/lib/document/card-press-titles.js +1 -0
- package/dist/render/lib/document/part-styles.d.ts +1 -0
- package/dist/render/lib/document/passes/section-animation.js +1 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/passes/section-sticky.js +1 -1
- package/dist/render/lib/document/published-passes.js +1 -1
- package/dist/render/lib/document/slot-specs.js +1 -1
- package/dist/render/lib/sections/section-to-box.d.ts +0 -15
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/site-runtime.d.ts +4 -1
- package/dist/render/lib/site-runtime.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +5 -5
- package/dist/editor/components/TemplateFieldRow.d.ts +0 -11
- package/dist/editor/components/TemplateFieldRow.js +0 -1
- package/dist/editor/lib/document/panel-heading-scope.d.ts +0 -8
- package/dist/editor/lib/document/panel-heading-scope.js +0 -1
- package/dist/editor/lib/document/template-field.d.ts +0 -13
- package/dist/editor/lib/document/template-field.js +0 -1
- package/dist/format/lib/canvas-accent.d.ts +0 -1
- package/dist/format/lib/canvas-accent.js +0 -1
- package/dist/format/lib/source-rules/padding-units-declared.d.ts +0 -2
- package/dist/format/lib/source-rules/padding-units-declared.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as
|
|
1
|
+
import{hasWords as l}from"../../../sections/section-to-box.js";import{BLOCK_WIDTH_LIMIT as N}from"efficient-easel/draw";import{fluidToken as R,token as o}from"./section-head-looks.js";import{STRIP_BOX as C}from"../../../../../format/lib/sections/strip-shape.js";import{PH as i,phAccentAsMarks as W}from"../../../../../format/lib/document/blocks/placeholders.js";import{DOC_MASTHEAD_PH as d}from"../../../../../format/lib/document/blocks/general/DocMasthead/meta.js";import{PAGE_TITLE_LEVEL_PROP as U,pageTitleDemoted as f}from"../../../../../format/lib/document/one-h1.js";import{AUTO_COLUMN as s,BUTTON as v,DIM as G,DROP_COMMON as c,DROP_SIDE_PADDING as g,INNER_BOX as n,leadLine as _,RIGHT_WORDS as S,SAME_KEYS as h,SECTION_BOX as m,SH_LINK as X,smallText as r,TEXT as a,wrapperPad as b,wrapperPadKeys as u}from"./section-to-box-row-parts.js";const T={minWidth:N.min},E=(e,t,p)=>({...r(e,{...t,...S}),props:{...a,align:"right",...s,...p}}),w={top:1,bottom:0},k=(e,t,p,M)=>({kind:"group",name:e,props:{...n,sectionPaddingBottom:t,sectionPaddingBottomPhone:p},parts:[M]}),I={widthFit:"fill",...T},O={top:100,bottom:60,topPhone:60,bottomPhone:40},K={...o("label",13),letterSpacing:.22,lineHeight:1.8},x={textStyle:"heading-1",...R("headingLarge",56,8,128),case:"upper",weight:500,lineHeight:.88,letterSpacing:-.04},j=()=>({name:"Page Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,O)}),box:[...h,...u(O)],parts:[{kind:"group",name:"Header",props:{...n,direction:"row",align:"end",justify:"between",gap:40,gapPhone:16,share:"content",sectionPaddingBottom:32},parts:[k("Eyebrow",12,0,{...r("eyebrow",o("label",13)),props:{...a,...s}}),{kind:"text",key:"title",role:"heading",props:{...a,tag:"h1",...I},style:x,mark:"accentItalic",when:e=>!f(e)},{kind:"text",key:"title",role:"heading",props:{...a,tag:"h2",...I},style:x,mark:"accentItalic",when:f},{kind:"group",name:"Details",props:{...n,align:"stretch",gap:0,gapPhone:0,sectionPaddingBottom:12,sectionPaddingBottomPhone:0},parts:[{kind:"list",key:"meta",name:"Detail",flat:!0,parts:[_("label","value",K,s)]}]}]},{kind:"group",name:"Deck",props:{...n,maxWidth:760,sectionBorder:w,sectionPaddingTop:28},parts:[{kind:"text",key:"deck",props:G,style:{textStyle:"body-1",fontRole:"accent",...o("body",22,19),italic:!0,lineHeight:1.5}}]}],drop:{...c,...g,[U]:"read by the title part's `when`: 2 (set by lib/document/one-h1 on a later opener) makes the Text an h2, anything else an h1"}}),ne=()=>({eyebrow:d.eyebrow,title:W(d.title),deck:d.deck,meta:[{label:i.label,value:i.value},{label:i.label,value:i.value}]}),B={top:80,bottom:40,topPhone:60,bottomPhone:32},V={...o("label",13),letterSpacing:.18,lineHeight:1.8},H={...o("label",13),letterSpacing:.22,lineHeight:1.9},Y=()=>({name:"Issue Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,B)}),box:[...h,...u(B)],parts:[{kind:"group",name:"Top",props:{...n,direction:"row",align:"end",justify:"between",gap:60,gapPhone:16,share:"content",sectionPaddingBottom:32},parts:[k("Eyebrow",14,14,r("eyebrow",o("label",14))),{kind:"group",name:"Issue",props:{...n,align:"end",gap:0,gapPhone:0,sectionPaddingBottom:14},parts:[{kind:"list",key:"issueMeta",name:"Issue line",flat:!0,parts:[_("lead","rest",V)]}]}]},{kind:"group",name:"Bottom",props:{...n,direction:"row",align:"start",justify:"between",gap:60,gapPhone:16,share:"content",sectionBorder:w,sectionPaddingTop:32},parts:[{kind:"text",key:"lead",props:{...a,maxWidth:720,...T},style:{textStyle:"body-1",fontRole:"heading3",...o("headingSmall",20),lineHeight:1.5,letterSpacing:-.005,paragraphSpacing:16}},{kind:"group",name:"In this issue",props:{...n,align:"stretch",gap:0},parts:[k("Heading",6,6,{kind:"text",key:"issueHeading",props:{...a,align:"right",...s},style:{textStyle:"body-1",fontRole:"heading",...o("body",18),weight:400,letterSpacing:-.01,lineHeight:1.9,...S}}),{kind:"group",name:"Lines",props:{...n,align:"stretch",gap:0},parts:[{kind:"list",key:"issueList",name:"Line",flat:!0,parts:[E("text",{color:"labels",...H})]}]},E("issueTotal",H)]}]}],drop:{...c,...g}}),D={top:24,bottom:24,topPhone:16,bottomPhone:16},y={color:"labels",...o("label",13),letterSpacing:.2},L=e=>(Array.isArray(e.items)?e.items:[]).filter(t=>t&&typeof t.label=="string"&&t.label.trim()!==""),P=(e,t)=>t!==void 0&&L(e).at(-1)===t,A=(e,t)=>t!==void 0&&L(e).includes(t),F=(e,t)=>A(e,t)&&!P(e,t)&&l(t?.href),q=()=>({name:"Breadcrumb",skip:e=>l(e.meta)?'a trailing note after "·" needs a second mark; none live':void 0,boxProps:e=>({...m,...C,wrap:"wrap",gap:16,gapPhone:16,separator:"slash",sectionBorder:{bottom:1},...b(e,D)}),box:[...h,...u(D)],parts:[{kind:"list",key:"items",name:"Crumb",flat:!0,parts:[{kind:"button",key:"label",href:"href",variant:"ghost",when:F,props:{...v,...X,icon:"none"},style:y},{...r("label",y),when:(e,t)=>A(e,t)&&!P(e,t)&&!l(t?.href)},{...r("label",{...y,color:"text"}),when:P}]}],drop:{...c,...g,meta:"a node that stores a note is skipped (`skip`); an empty one draws nothing"}}),ae={DocMasthead:j(),Masthead:Y(),Breadcrumb:q()};export{ae as PAGE_HEADER_SECTION_TO_BOX,ne as pageHeaderPressStarter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as
|
|
1
|
+
import{phoneKey as v}from"efficient-easel/draw";import{newId as K}from"efficient-easel/data";import{COUNT_KEY_PROP as _}from"../../../../../format/lib/content/block-sources.js";import{resolveSectionBackground as k,THEME_SECTION_BG as M}from"../../../../../format/lib/content/section-background.js";import{finiteNumber as H}from"../../../../../format/lib/finite-number.js";import{hasWords as g}from"../../../sections/section-to-box.js";import{DROP_COMMON as T,DROP_SIDE_PADDING as x,INNER_BOX as a,NUMBER_TEXT as m,SAME_KEYS as O,SECTION_BOX as P,TEXT as i,bandAccent as Y,bandProps as U,bandWrites as W,fillFrom as G,onBandPreset as X,innerPad as $,innerPadKeys as q,smallText as S,wrapperPad as j,wrapperPadKeys as z}from"./section-to-box-row-parts.js";import{EDITORIAL_LINE as V,fluidToken as J,headTree as Q,token as n}from"./section-head-looks.js";import{SECTION_BG_BUILT_IN as E}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{CARD_STYLES as s,CARD_STYLE_KEY as f}from"../../../sections/card-list-style.js";import{CARD_LIST_TYPE as Z,CARD_TEMPLATE_SLOT as ee,cardListProps as te}from"../../../../../format/lib/content/card-template.js";import{BOX_TYPE as d,CONTAINER_BLOCKS_SLOT as l}from"../../../../../format/lib/document/container-blocks.js";import{rowFieldTextSeed as c}from"../../../../../format/lib/document/blocks/general/Cards/card-seed.js";import{say as r}from"../../../../../format/lib/editor-words.js";const b=e=>typeof e=="string"?e.trim():"";function A(e){const t=`${b(e.prefix)}${b(e.value)}`,o=b(e.suffix);return e.emphasizeAll===!0?t?`==_${t}_==`:"":`${t}${o?`==_${o}_==`:""}`}const B={textStyle:"heading-2",...J("headingMedium",56,7,96),weight:500,case:"none",lineHeight:.9,letterSpacing:-.04},w={kind:"block",type:"Text",props:{...m,_partStyles:{text:B}},box:[["value","text",(e,t)=>A(t)]],when:(e,t)=>t!==void 0&&typeof t.value=="string"&&A(t)!==""},R=e=>g(e?.supSuffix),L={textStyle:"body-1",fontRole:"heading",...n("body",16),lineHeight:1.5,letterSpacing:-.01},C={color:"labels",...n("label",12),lineHeight:1.5,letterSpacing:.24},I={...a,direction:"row",align:"start",gap:32,gapPhone:32,share:"content",phoneRow:2,[v("share")]:"content"},N={textStyle:"body-5",...n("label",13),weight:500,color:"accent",letterSpacing:.18,lineHeight:1,padding:12},y=e=>k(e.background,E.StatsParagraph),p=e=>y(e)===M,u=e=>({...e,sectionAccent:e.sectionAccent??0}),oe=(e,t)=>p(e)?G("background",(o,h)=>X(u(o),h))(e,t):{},re={name:"Stats with Text",skip:e=>y(e)&&y(e)!=="transparent"&&!p(e)?"it paints a colour of its own, not the section band":void 0,boxProps:(e,t)=>({...P,direction:"column",gap:60,gapPhone:60,sectionBorder:{bottom:1},...V,...$(e,"StatsParagraph"),...p(e)?U(u(e),t):{}}),box:[...O.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,o)=>p(t)?Y(e,u(t),o):e],...q("StatsParagraph")],site:(e,t)=>p(e.props)?W({props:u(e.props)},t):[],parts:[Q("StatsParagraph"),{kind:"group",name:"Stats",props:{...a,...s.table.grid,[f]:"table"},parts:[{kind:"list",key:"stats",name:"Stat",perRow:()=>4,rowName:"Stats row",rowProps:{...a,direction:"row",share:"equal",phoneRow:2,...s.table.row},props:(e,t)=>({...a,...s.table.card,...oe(e,t)}),parts:[{...w,when:(e,t)=>!R(t)&&w.when(e,t)},{kind:"group",name:"Figure",props:I,when:(e,t)=>R(t),parts:[w,{kind:"text",key:"supSuffix",props:i,style:N}]},{kind:"group",name:"Words",props:{...a,gap:4,gapPhone:4},parts:[{kind:"text",key:"label",props:i,style:L},S("sub",C)]}]}]}],drop:{...T,...x,background:"the band is the Box's theme: the site's band preset (`sectionAccent`), or a declared band-preset write; none paints nothing, and any other colour is skipped",headPlacement:"needs a row per head placement: an own-box Stats with Text draws no head (its words sit in a Section Header above it), the row always draws the head"}},ae=new Set(["value","label",_]),F={top:48,bottom:48,topPhone:48,bottomPhone:48},se=e=>{const t=k(typeof e.background=="string"?e.background:void 0,E.Stats);return!!t&&t!=="transparent"},ne={name:"Stats",skip:e=>se(e)?"it paints a colour inside its padding, and a Box paints its Fill over the padding too":g(e.dataSource)?"its figures come from a source":Array.isArray(e.items)&&e.items.some(t=>g(t?.[_]))?"a figure names a count, and each figure Text here is typed by hand until it is linked":Array.isArray(e.items)&&e.items.some(t=>Object.keys(t??{}).some(o=>!ae.has(o)))?"a figure has a key no part here reads":Object.keys(e._partStyles??{}).some(t=>t!=="heading")?"a figure or a name has a style of its own, kept by kind, which no part here reads":void 0,boxProps:e=>({...P,direction:"column",gap:24,gapPhone:24,...j(e,F)}),box:[...O,...z(F)],parts:[S("heading",{color:"labels",...n("label",12),letterSpacing:.2}),{kind:"group",name:"Stats",props:{...a,...s.list.grid,[f]:"list"},parts:[{kind:"list",key:"items",name:"Stat",perRow:e=>H(e.columns)??4,rowName:"Stats row",rowProps:{...a,direction:"row",share:"equal",phoneRow:2,...s.list.row},props:{...a,...s.list.card},parts:[{kind:"text",key:"value",props:m,style:{textStyle:"heading-2",...n("headingMedium",48,36),weight:500,case:"none",lineHeight:1,letterSpacing:-.03}},S("label",{color:"labels",...n("label",12),letterSpacing:.2})]}]}],drop:{...T,...x,columns:"the rows of N: one row Box per `columns` figures, which the Box draws",dataSource:"an empty source is typed figures, what the row draws; a sourced node is skipped (0 Hartes nodes)",dataSourceOptions:"read only with a source; a sourced node is skipped (0 Hartes nodes)",contained:"the Box draws the site frame now; each figure fills the Box's column",background:"only no fill reaches here: a node that paints a colour is skipped"}},Te={StatsParagraph:re,Stats:ne};function xe(){return{eyebrow:r("By the numbers"),title:r("What we count."),desc:r("A few numbers that matter to us."),stats:[],background:"transparent"}}const ie=[{key:"figure",label:"Figure"},{key:"superscript",label:"Superscript"},{key:"label",label:"Label"},{key:"body",label:"Text",multiline:!0}];function Oe(){const e=(t,o,h,D="")=>({key:K("stat"),figure:t,superscript:D,label:o,body:h});return[e("28==_yr_==",r("Years in business"),r("Privately held since day one. Same two founders.")),e("==_8_==",r("Operating footprint"),r("Los Angeles · Fort Lauderdale · Bewdley · Drachten · Mumbai · Selangor · Ho Chi Minh · Sydney. Three continents covered from one California design studio."),r("cities")),e("−21==_%_==",r("Avg. weight saving"),r("Versus OEM equivalents, across our forged catalog.")),e("14==_×_==",r("Finish steps"),r("Specified in California to a 14-step protocol. No two sets are identical."))]}function pe(e){return{type:d,props:{...a,name:"Card",...structuredClone(s[e].listCard)},slots:{[l]:[{type:d,props:{...I,name:"Figure"},slots:{[l]:[c("figure",m,B),c("superscript",i,N)]}},{type:d,props:{...a,name:"Words",gap:4,gapPhone:4},slots:{[l]:[c("label",{...i,widthFit:"fill"},L),c("body",{...i,widthFit:"fill"},C,!0)]}}]}}}function Pe(e,t,o=4){return{type:d,props:{...a,name:"Stats",direction:"row",columns:o,...structuredClone(s[t].items),[f]:t},slots:{[l]:[{type:Z,props:te(e,ie),slots:{[ee]:[pe(t)]}}]}}}export{Te as STATS_SECTION_TO_BOX,A as figureWords,Pe as statsBoxSeed,xe as statsPressSeed,Oe as statsSeedRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BLOCK_WIDTH_LIMIT as u,hiddenKeyOf as _}from"efficient-easel/draw";import{hidableRow as g}from"../scaffold.js";import{hasWords as k}from"../../../sections/section-to-box.js";import{BLOCK_SOURCE_PROP as w,BLOG_CATEGORIES_SOURCE as y}from"../../../../../format/lib/content/block-sources.js";import{SECTION_PIN_ABOVE_KEY as B,SECTION_PIN_SCREENS_KEY as T}from"../../../../../format/lib/content/section-sticky.js";import{LABEL_FACE as E,token as O}from"../../../../../format/lib/document/seed-parts.js";import{PART_STYLES_PROP as f}from"../../part-styles.js";import{PH as s}from"../../../../../format/lib/document/blocks/placeholders.js";import{DROP_COMMON as a,DROP_SIDE_PADDING as i,INNER_BOX as S,SAME_KEYS as C,SECTION_BOX as P,TEXT as N,wrapperPad as A,wrapperPadKeys as R}from"./section-to-box-row-parts.js";const l="MenuBlock",n=e=>(Array.isArray(e)?e:[]).filter(t=>t&&k(t.label)),d=e=>{const[t,o]=[e.metaLabel,e.metaValue].map(m=>(g(m)??"").trim());if(!o)return t;const r=o.includes("==")?o:`==${o}==`;return t?`${t} ${r}`:r},p={top:0,bottom:0,topPhone:0,bottomPhone:0},x={...E,color:"labels",...O("label",12),letterSpacing:.24},I={kind:"group",name:"Note",props:{...S,justify:"center",sectionBorder:{top:0,right:0,bottom:0,left:1},sectionPaddingLeft:28,[_("mobile")]:!0},parts:[{kind:"block",type:"Text",when:e=>d(e)!=="",props:e=>({...N,textFit:"line",text:d(e),[f]:{text:x}})}]},$=()=>({tabs:[],metaLabel:s.label,metaValue:s.value}),b="the note Text inside the Box (the label, then the value in the accent); no words, no Text",h={direction:"row",menuStyle:"tabs",currentPage:!0,minWidth:u.min},c=e=>({...e,boxProps:t=>({...P,direction:"row",align:"stretch",justify:"between",gap:0,stickTop:!0,[T]:0,[B]:!0,sectionBorder:{bottom:1},...A(t,p)}),box:[...C,...R(p)]}),L=()=>c({name:"Tab Bar",skip:e=>n(e.tabs).length?"its tabs need a Console menu first: they are typed labels and links, and the Menu block draws only a Console menu":void 0,reads:{metaLabel:b,metaValue:b},parts:[{kind:"block",type:l,props:h},I],drop:{...a,...i,tabs:"a node whose tabs hold words is skipped (`skip`): typed tabs are not a Console menu; a list of blank tabs draws nothing, so nothing is lost"}}),M=()=>c({name:"Category Bar",skip:e=>{if(n(e.tabs).length)return"its tabs are typed words with typed counts, not the blog's categories: a Blog categories Menu would replace them";if(n(e.links).length)return"its right-hand links are typed words: the bar holds the Menu only"},parts:[{kind:"block",type:l,props:{...h,[w]:y}}],drop:{...a,...i,tabs:"a node whose tabs hold words is skipped (`skip`); blank tabs draw nothing on a page, so nothing is lost. The Menu draws the blog's own categories",activeTab:"the Menu marks the page's own entry (Current page), not a typed active tab",links:"a node whose links hold words is skipped (`skip`); blank links draw nothing",sticky:"the bar is always pinned (the Box's own pin, Stays above): the merchant turns the Box's pin off",editing:"the editor's preview flag, never a stored setting: the editor tells every block it is editing"}}),j={DocTabs:L(),CategoryBar:M()};export{j as TAB_BAR_SECTION_TO_BOX,$ as tabBarPressStarter};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{resolveSectionBackground as
|
|
1
|
+
import{resolveSectionBackground as K,THEME_SECTION_BG as G}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 s,bandAccent as V,bandIndex as q,bandWrites as z,fillNoBoxHolds as J,ownFill as Q,DROP_COMMON as B,DROP_SIDE_PADDING as A,INNER_BOX as o,SAME_KEYS as H,SECTION_BOX as b,TEXT as c,innerPad as y,innerPadKeys as O}from"./section-to-box-row-parts.js";import{splitParagraphs as Z}from"../../../../components/goldPhrases.js";import{accentItalicRuns as C}from"../../../../../format/lib/markup.js";import{TIMELINE_YEAR_BOX as $,TIMELINE_YEAR_HEAD as N}from"../../../../../format/lib/sections/timeline-year-shape.js";import{boxPadding as ee,LABEL_FACE as te}from"../../../../../format/lib/document/seed-parts.js";import{tabletKey as oe}from"efficient-easel/draw";import{EDITORIAL_LINE as M,editorialHeadTree as ne,fluidToken as re,headWordsOnPhoneLine as ie,token as i,withAccentItalic as ae}from"./section-head-looks.js";import{CTA_PH as l,phAccentAsMarks as L}from"../../../../../format/lib/document/blocks/placeholders.js";import{TIMELINE_PH as u,timelineScaffoldEntries as pe}from"../../../../../format/lib/document/blocks/general/Timeline/meta.js";import{TIMELINE_TRACK_PH as T,timelineTrackScaffoldEntries as se}from"../../../../../format/lib/document/blocks/general/TimelineTrack/meta.js";const R={buttonBorder:{width:0}},d=(e,t,n={})=>({textStyle:"body-5",...i("label",e),letterSpacing:t,lineHeight:1.5,weight:400,...n}),a=(e,t,n={})=>({...d(e,t),...te,...n}),g=(e,t,n)=>({...e,case:"upper",weight:500,letterSpacing:t,lineHeight:n}),p=(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}),W=(e,t)=>t?.future===!0,h=e=>Z(typeof e?.body=="string"?e.body:""),w=e=>K(typeof e.background=="string"?e.background:void 0,j.TimelineTrack),x=e=>w(e)===G?e:{...e,background:"transparent"},ce={name:"Milestone Timeline",skip:e=>J(w(e)),boxProps:(e,t)=>{const n=q(x(e),t);return{...b,direction:"column",gap:60,[oe("gap")]:36,gapPhone:36,sectionBorder:{bottom:1},...M,...y(e,"TimelineTrack"),...Q(w(e),e,t),...n>=0?{sectionAccent:n}:{}}},box:[...H.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,n)=>V(e,x(t),n)],...O("TimelineTrack")],parts:[ie(ae(ne("eyebrow","title","intro"),["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,...M},parts:[{kind:"list",key:"entries",name:"Year",props:{...o,...$},item:e=>({props:e.future===!0?{upcoming:!0}:{}}),parts:[{kind:"group",name:N.name,props:{...o,...N},parts:[r("date",d(13,.22,{color:"accent"}),{when:(e,t)=>!W(e,t)}),r("date",d(13,.22,{color:"labels"}),{when:W}),r("title",{textStyle:"heading-3",...g(i("headingSmall",20),-.02,1.1)},{role:"heading"})]},r("blurb",p(i("body",13),1.55),{props:s,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",...R},style:a(13,.3)}]}]}],site:(e,t)=>z({props:x(e.props)},t),drop:{...B,...A,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"}},f=e=>typeof e.layout=="string"?e.layout:"split",m=e=>f(e)==="split",P=e=>!m(e),D=e=>f(e)==="spine",le=e=>P(e)&&!D(e),F=(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"}})]}]}),v=(e={})=>({kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:{..._,...e,...R},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:p(i("body",17,16),1.6)}},box:[["body","text",(e,t)=>C(h(t)[0]??"")]],when:(e,t)=>h(t).length>0},{kind:"block",type:"Text",props:{...s,_partStyles:{text:p(i("body",17,16),1.6,{paragraphSpacing:14})}},box:[["body","text",(e,t)=>C(h(t).slice(1).join(`
|
|
2
2
|
|
|
3
|
-
`))]],when:(e,t)=>h(t).length>1}],E=()=>r("date",
|
|
3
|
+
`))]],when:(e,t)=>h(t).length>1}],E=()=>r("date",d(13,.24,{color:"accent"})),I=(e,t,n={})=>r(e,t,{...n,props:{...c,...n.props??{},align:"center"}}),Y=re("headingMedium",40,5,76),X={sectionBorder:{bottom:1}},de={name:"Story Timeline",skip:e=>f(e)==="track"?'display "track": not converted (it draws the Milestone rail; a Track story is not stored anywhere)':void 0,boxProps:e=>m(e)?{...b,direction:"row",share:[40],gap:80,gapPhone:48,align:"start",...X,...y(e,"Timeline")}:{...b,direction:"column",gap:48,gapPhone:48,align:"center",...X,...y(e,"Timeline")},box:[...H,...O("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",p(i("body",14),1.6),{props:{...s,maxWidth:360},mark:"accentItalic"}),F(667,419,{},()=>!0),v()]},{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",p(i("body",14),1.6),{props:{...s,maxWidth:520},mark:"accentItalic"}),v({align:"center"})]},F(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:D,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:le,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,...A,layout:"the Box's own arrangement replaces it: Split a row of two Boxes; Spine and Alternating a centred column (Track is skipped)"}},Se=()=>({eyebrow:u.eyebrow,title:L(u.title),intro:u.intro,ctaText:l.text,ctaHref:l.href,entries:pe()}),Ee=()=>({eyebrow:T.eyebrow,title:L(T.title),intro:T.intro,ctaText:l.text,ctaHref:l.href,entries:se()}),Ie={TimelineTrack:ce,Timeline:de};export{Ie as TIMELINE_SECTION_TO_BOX,Ee as milestoneTimelinePressStarter,Se as storyTimelinePressStarter};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { type SectionToBoxRow } from "../../../sections/section-to-box.js";
|
|
2
|
+
type Props = Record<string, unknown>;
|
|
2
3
|
export declare const GENERAL_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
|
|
4
|
+
export declare const TEXT_PRESS_STARTERS: Readonly<Record<string, () => Readonly<Props>>>;
|
|
3
5
|
export declare function registerGeneralSectionRows(): void;
|
|
6
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as
|
|
1
|
+
import{hasWords as L,registerSectionToBox as t}from"../../../sections/section-to-box.js";import{BUTTON as T,DIM as y,DROP_COMMON as s,DROP_SIDE_PADDING as u,INNER_BOX as o,leadLine as X,SAME_KEYS as d,SECTION_BOX as p,TEXT as l,innerPad as w,siteGutterOf as D,innerPadKeys as B,smallText as P,wrapperPad as O,wrapperPadKeys as _}from"./section-to-box-row-parts.js";import{CARDS_SECTION_TO_BOX as W}from"./section-to-box-rows-cards.js";import{normalizeSiteGutterPhone as M,siteGutterPhoneFollows as G}from"../../../../../format/lib/content/page-width.js";import{finiteNumber as F}from"../../../../../format/lib/finite-number.js";import{STATS_SECTION_TO_BOX as U}from"./section-to-box-rows-stats.js";import{LOGOS_SECTION_TO_BOX as K}from"./section-to-box-rows-logos.js";import{STRIP_SECTION_TO_BOX as Y}from"./section-to-box-rows-strip.js";import{TIMELINE_SECTION_TO_BOX as j}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 q}from"./section-to-box-rows-head.js";import{PAGE_HEADER_SECTION_TO_BOX as J}from"./section-to-box-rows-pageheader.js";import{TAB_BAR_SECTION_TO_BOX as Q}from"./section-to-box-rows-tabbar.js";import{DOCBODY_SECTION_TO_BOX as V}from"./section-to-box-rows-docbody.js";import{EDITORIAL_SECTION_TO_BOX as Z}from"./section-to-box-rows-editorial.js";import{FORMS_SECTION_TO_BOX as $}from"./section-to-box-rows-forms.js";import{CHECKOUT_SECTION_TO_BOX as ee}from"./section-to-box-rows-checkout.js";import{PROOF_SECTION_TO_BOX as te}from"./section-to-box-rows-proof.js";import{PROMO_SECTION_TO_BOX as oe}from"./section-to-box-rows-promo.js";import{FITMENT_SECTION_TO_BOX as ne}from"./section-to-box-rows-fitment.js";import{fluidToken as ie,headTree as k,token as i}from"./section-head-looks.js";import{CTA_PH as b,PH as re,phAccentAsMarks as m}from"../../../../../format/lib/document/blocks/placeholders.js";import{PROSE_PH as S}from"../../../../../format/lib/document/blocks/general/Prose/meta.js";import{PARAGRAPHS_A_PH as g}from"../../../../../format/lib/document/blocks/general/ParagraphsA/meta.js";import{BANNER_PH as ae}from"../../../../../format/lib/document/blocks/general/Banner/meta.js";import{TITLE_WITH_BUTTONS_PH as se,TITLE_WITH_BUTTONS_SCAFFOLD_BUTTONS as de}from"../../../../../format/lib/document/blocks/general/TitleWithButtons/meta.js";import{SECTION_HEADER_PH as r}from"../../../../../format/lib/document/blocks/general/SectionHeader/meta.js";import{boxPadding as pe,fillSlot as le}from"../../../../../format/lib/document/seed-parts.js";const E={top:72,bottom:72,topPhone:72,bottomPhone:72},he={name:"Editorial Text",boxProps:e=>({...p,direction:"column",gap:28,gapPhone:28,sectionBorder:{top:1},...O(e,E)}),box:[["topBorder","sectionBorder",e=>e===!1?void 0:{top:1}],...d,..._(E)],parts:[k("Prose"),{kind:"text",key:"body",props:y,style:{textStyle:"body-1",...i("body",16),lineHeight:1.7,paragraphSpacing:18}}],drop:{...s,...u,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)"}},x={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},N=(e,n)=>n?.variant==="primary",I=(e,n)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:e,parts:[{kind:"button",key:"label",href:"href",when:N,variant:"primary",style:{letterSpacing:.3},props:{...T,...x,...n}},{kind:"button",key:"label",href:"href",when:(a,h)=>!N(a,h),variant:"ghost",style:{letterSpacing:.3},props:{...T,...x,...n}}]}),c=e=>L(e.title),me={name:"Call-to-Action Heading",boxProps:e=>({...p,direction:"row",align:"center",justify:c(e)?"between":"end",gap:60,gapPhone:60,share:"content",sectionBorder:{bottom:1},...w(e,"TitleWithButtons")}),box:[...d,...B("TitleWithButtons")],parts:[{kind:"group",name:"Title",props:{...o,maxWidth:1e3,widthFitPhone:"fill"},parts:[{kind:"text",key:"title",role:"heading",props:l,style:{textStyle:"heading-1",...ie("headingLarge",48,7,108),case:"upper",lineHeight:.94,letterSpacing:-.035},mark:"accentItalic"}]},{kind:"group",name:"Buttons",props:e=>({...o,gap:14,gapPhone:14,widthFitPhone:"fill",...c(e)?{minWidth:280,minWidthPhone:0}:{}}),parts:[I(c,{widthFit:"fill",iconPosition:"end"}),I(e=>!c(e),{})]}],drop:{...s,buttonsAlign:"moves the buttons only when there is no heading (4 of 128 live nodes), where the Box puts them at the end. 0 of 128 live nodes store it (the live export, 2026-10-24)",buttonsAlignPhone:"the phone's own side of `buttonsAlign`, read only with no heading; no old node stores it (it is new with the Phone view's Block alignment row), so nothing moves",buttonsAlignTablet:"the tablet's own side of `buttonsAlign`, read only with no heading; no old node stores it (it is new with the Tablet view's Block alignment row, 0 stored on the US sites 2026-11-05), so nothing moves"}};function ge(e){const{siteGutter:n,siteGutterPhone:a}=e.site??{},h=D(e),f=Math.min(20,M(a)??G(n));return{sectionPaddingLeft:h,sectionPaddingRight:h,sectionPaddingLeftPhone:f,sectionPaddingRightPhone:f}}const H={top:40,bottom:64,topPhone:24,bottomPhone:36},ce={name:"Section Header",boxProps:(e,n)=>({...p,direction:"column",gap:0,...O(e,H),...ge(n)}),box:[...d,..._(H)],parts:[k("SectionHeader")],drop:{...s,...u,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"}},A={...o,direction:"row",share:[67],gap:32},R={...o,sectionPaddingLeft:24,sectionPaddingLeftPhone:0},C=(e,n,a)=>({kind:"group",name:e,props:n,parts:[a]}),Te={name:"Lead Text",boxProps:e=>({...p,direction:"column",gap:40,gapPhone:40,sectionBorder:{bottom:1},...w(e,"ParagraphsA")}),box:[...d,...B("ParagraphsA")],parts:[{kind:"group",name:"Numbers",props:{...A,gapPhone:24,sectionBorder:{bottom:1},sectionPaddingBottom:40,sectionPaddingBottomPhone:40},parts:[{kind:"group",name:"Eyebrow",props:{...o,sectionPaddingTop:5,sectionPaddingBottom:1,sectionPaddingTopPhone:5,sectionPaddingBottomPhone:1},parts:[P("eyebrow",{color:"labels",...i("label",12),letterSpacing:.24})]},C("Stats column",o,{kind:"group",name:"Stats",props:{...R,gap:0,gapPhone:0},parts:[{kind:"list",key:"stats",name:"Stat",flat:!0,parts:[X("value","label",{...i("label",13),letterSpacing:.18,lineHeight:1.8})]}]})]},{kind:"group",name:"Words",props:{...A,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}}]}]},C("Note column",{...o,justify:"end"},{kind:"group",name:"Founders",props:{...R,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:y,style:{textStyle:"body-5",fontRole:"heading",...i("body",14,12),lineHeight:1.7}}]},P("attribution",{...i("label",12,10),letterSpacing:.24,lineHeight:1.7})]})]}],drop:{...s}},v={top:24,bottom:24,topPhone:24,bottomPhone:24},ue={name:"Banner",boxProps:e=>({...p,direction:"column",gap:0,...O(e,v)}),box:[...d,"contained",..._(v)],parts:[{kind:"group",name:"Card",keepEmpty:!0,props:{...o,gap:28,gapPhone:28,placement:"top-left",darken:60,darkenStyle:"even",sectionBorder:{width:1},...le("surface"),...pe(64,40,40,24)},box:[["imageSrc","bgImage"],["overlay","darken",e=>Math.min(Math.max(F(e)??60,0),100)]],parts:[{kind:"group",name:"Words",props:{...o,gap:20,gapPhone:20},parts:[P("eyebrow"),{kind:"text",key:"title",role:"heading",props:{...l,maxWidth:680},style:{weight:500,lineHeight:1.05,letterSpacing:-.03,case:"none",...i("headingMedium",44,32)}},{kind:"text",key:"body",props:{...l,maxWidth:680},style:{textStyle:"body-1",lineHeight:1.6,...i("body",16)}}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:T}]}],drop:{...s,...u}},Pe={Prose:he,TitleWithButtons:me,SectionHeader:ce,ParagraphsA:Te,Banner:ue},je={Prose:()=>({eyebrow:S.eyebrow,title:m(S.title),body:S.body}),TitleWithButtons:()=>({title:m(se.title),buttons:de.map(e=>({...e}))}),SectionHeader:()=>({num:r.num,title:m(r.title),description:r.description,linkText:r.linkText,linkHref:b.href}),ParagraphsA:()=>({eyebrow:g.eyebrow,lead:re.body,foundersHeading:g.foundersHeading,foundersBody:g.foundersBody,attribution:g.attribution}),Banner:()=>({...ae,ctaText:b.text,ctaHref:b.href}),ProcessSteps:()=>({num:r.num,title:m(r.title)})};function ze(){t(Pe),t(U),t(K),t(W),t(Y),t(j),t(z),t(q),t(J),t(Q),t(V),t(Z),t($),t(ee),t(ne),t(te),t(oe)}export{Pe as GENERAL_SECTION_TO_BOX,je as TEXT_PRESS_STARTERS,ze as registerGeneralSectionRows};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Props = Record<string, unknown>;
|
|
2
|
+
export type CardPressTitle = {
|
|
3
|
+
readonly field: string;
|
|
4
|
+
readonly gates: readonly (readonly string[])[];
|
|
5
|
+
};
|
|
6
|
+
export declare const CARD_PRESS_TITLES_PROP = "_cardPressTitles";
|
|
7
|
+
export declare const CARD_PRESS_TITLE_PROP = "_cardPressTitle";
|
|
8
|
+
export declare function cardPressTitlesOf(props: Props | null | undefined, slot: string): readonly CardPressTitle[] | undefined;
|
|
9
|
+
export declare function markCardPressTitles<T>(data: T): T;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isNodeList as m}from"efficient-easel/data";import{readHidable as E}from"efficient-easel/draw";import{BOX_HIDE_WHEN_ROW_EMPTY as h,isCardTemplateSlot as y,namedRowField as x}from"../../../format/lib/content/card-template.js";import{SHOW_FOR_PROP as d}from"../../../format/lib/content/box-show-for-choices.js";import{COUNT_KEY_PROP as L}from"../../../format/lib/content/block-sources.js";import{WALL_LABEL_ID_PROP as S}from"./wall-labels.js";const P="_cardPressTitles",k="_cardPressTitle";function j(t,r){const e=t?.[P],i=e&&typeof e=="object"?e[r]:void 0;return Array.isArray(i)&&i.length?i:void 0}const O=(t,r)=>({...t,props:{...t.props,...r}});function C(t){const r=t.props??{};return t.type!=="Text"||E(r.text).hidden||typeof r[L]=="string"||typeof r[S]=="string"?"":x(r)}function T(t,r,e,i){let n=null;return t.forEach((o,s)=>{let p=o;const f=C(o);if(f&&!i.has(f))i.add(f),e.push({field:f,gates:r}),p=O(o,{[k]:!0});else if(o.type!=="Text"&&!Array.isArray(o.props?.[d])){const l=o.props?.[h],R=Array.isArray(l)&&l.length?[...r,l.filter(c=>typeof c=="string")]:r;let u=null;for(const[c,a]of Object.entries(o.props??{})){if(!m(a)||y(o.type,c))continue;const _=T(a,R,e,i);_!==a&&((u??={})[c]=_)}u&&(p=O(o,u))}p!==o&&((n??=t.slice())[s]=p)}),n??t}function A(t){let r=null;return t.forEach((e,i)=>{const n=b(e);n!==e&&((r??=t.slice())[i]=n)}),r??t}function b(t){let r,e;for(const[i,n]of Object.entries(t.props??{})){if(!m(n))continue;let o=A(n);if(y(t.type,i)){const s=[];o=T(o,[],s,new Set),s.length&&((e??={})[i]=s)}o!==n&&((r??={...t.props})[i]=o)}return e&&((r??={...t.props})[P]=e),r?{...t,props:r}:t}function w(t){const r=t;if(!r||!Array.isArray(r.content))return t;const e=A(r.content);return e===r.content?t:{...r,content:e}}export{P as CARD_PRESS_TITLES_PROP,k as CARD_PRESS_TITLE_PROP,j as cardPressTitlesOf,w as markCardPressTitles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as E}from"react/jsx-runtime";import{SectionAnimation as f}from"../../../components/SectionAnimation.js";import{ENTRANCE_EXCLUDED as l,entranceDrawn as p}from"../../animation/entrance.js";import{CARD_HOVER_SECTIONS as w,PICTURE_HOVER_BLOCKS as T}from"../../../../format/lib/animation/hover.js";import{BOX_TYPE as a}from"../../../../format/lib/document/container-blocks.js";import{drawsCopiesInTheBox as _}from"../../../../format/lib/content/copies-in-box.js";const c=Object.fromEntries(T.map(n=>[n,"picture"])),b={[a]:"box",Ticker:"marquee",...Object.fromEntries(w.map(n=>[n,"cards"])),...c},s=(n,e)=>!l.has(n)&&!!e&&typeof e.render=="function";function
|
|
1
|
+
import{jsx as E}from"react/jsx-runtime";import{SectionAnimation as f}from"../../../components/SectionAnimation.js";import{ENTRANCE_EXCLUDED as l,entranceDrawn as p}from"../../animation/entrance.js";import{CARD_HOVER_SECTIONS as w,PICTURE_HOVER_BLOCKS as T}from"../../../../format/lib/animation/hover.js";import{BOX_TYPE as a}from"../../../../format/lib/document/container-blocks.js";import{drawsCopiesInTheBox as _}from"../../../../format/lib/content/copies-in-box.js";const c=Object.fromEntries(T.map(n=>[n,"picture"])),b={[a]:"box",Ticker:"marquee",...Object.fromEntries(w.map(n=>[n,"cards"])),...c},s=(n,e)=>!l.has(n)&&!!e&&typeof e.render=="function";function m(n,e,i,o){n.fields={...n.fields,...i.animationTabFields(e,o)}}function d(n,e){const i=n,o=i.render;i.render=t=>{const r=p(t);return!r||_(e,t)?o(t):E(f,{views:r,editing:!!t.editor?.isEditing,takesViewHide:!0,atEdge:e===a,children:o(t)})}}const R={name:"sectionAnimation",applies:(n,e,i)=>e.isSection(n)&&s(n,i),panel:(n,e,i)=>m(n,b[e]??"section",i,e),draw:(n,e)=>d(n,e)},x={name:"blockEntrance",applies:(n,e,i)=>!e.isSection(n)&&s(n,i),panel:(n,e,i)=>m(n,c[e]??"block",i,e),draw:(n,e)=>d(n,e)};export{x as blockEntrance,R as sectionAnimation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{SECTION_MIN_HEIGHT_EXCLUDED as o,sectionMinHeightAttrs as a}from"../../../../format/lib/content/section-min-height.js";import{CellWrap as l}from"../../../components/InBoxContext.js";import{drawsCopiesInTheBox as d}from"../../../../format/lib/content/copies-in-box.js";const g={name:"sectionHeight",applies:(e,n,t)=>n.isSection(e)&&!o.has(e)&&!!t&&typeof t.render=="function",panel(e,n,t){const i=t.heightFields;e.fields={...e.fields,...i()}},draw(e,n){const t=e.render;e.render=i=>{if(d(n,i))return t(i);const r=a(i);return r?s(l,{className:r.className,style:r.style,children:t(i)}):t(i)}}};export{g as sectionHeight};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as S}from"react/jsx-runtime";import{HideTaker as _}from"../../../components/ViewHideRoot.js";import{isBackgroundBox as m}from"../../../../format/lib/content/box-background.js";import{boxSideSpaceOf as u}from"../../../../format/lib/content/box-side-space.js";import{SECTION_PAD_KEYS as p,padValuesOf as T,resolveSectionPadding as g,sectionPadAttrs as I}from"../../content/section-padding.js";import{sectionFillPassClass as b}from"../../../../format/lib/content/section-min-height.js";import{COPIES_IN_THE_BOX as E,drawsCopiesInTheBox as O}from"../../../../format/lib/content/copies-in-box.js";const l={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120},DetailRows:{top:100,bottom:100}},c=new Set(Object.keys(l)),P=new Set(["Flex","Text","Heading","ImageBlock"]),x=new Set(["Divider"]),N=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),f=new Set(["ProductGrid"]);function s(e,t,o=!1){const i=e.render;e.render=n=>{if(t?.(n))return i(n);const r=I({...T(n,p,o),sideSpace:u(n.sideSpace)}),a=i(n),d=b(n);return r?S(_,{className:d?`${r.className} ${d}`:r.className,style:r.style,children:a}):a}}const L={name:"sectionPadding",applies:(e,t,o)=>t.isSection(e)&&!N.has(e)&&!!o&&typeof o.render=="function",panel(e,t,o){c.has(t)||f.has(t)||(e.fields={...e.fields,...o.sidesPaddingFields({tablet:!0,siteSide:!0})})},draw(e,t){if(c.has(t)){const o=e.render,i=l[t];e.render=n=>{const r=g(n,i);return o({...n,padTop:r.top,padBottom:r.bottom})};return}if(f.has(t)){s(e);return}P.has(t)||x.has(t)||s(e,t==="Flex"?o=>m(o.bgImage):E.has(t)?o=>O(t,o):void 0,!0)}},h=["Heading","Text","ImageBlock"],A=["LogoBlock"],W={name:"blockPadding",applies:(e,t,o)=>(h.includes(e)||A.includes(e))&&!!o&&typeof o.render=="function",panel(e,t,o){e.fields={...e.fields,...o.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(e,t){P.has(t)||s(e,void 0,!0)}};export{x as PADS_ITS_OWN_SPACE,P as PAD_ON_ROOT,c as SECTION_PAD_INNER,l as SECTION_PAD_INNER_DEFAULTS,W as blockPadding,L as sectionPadding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as E}from"react/jsx-runtime";import{HideTaker as A}from"../../../components/ViewHideRoot.js";import{SectionRootChoice as D}from"../../../components/SiteGutterFrame.js";import{INTRO_OLD_STICKY_PINS as Y,PIN_AT_SCREEN_TOP as N,SECTION_PIN_ABOVE_KEY as P,SECTION_PIN_SCREENS_KEY as y,SECTION_PIN_SCREENS_KEYS as L,SECTION_PIN_STOP_KEY as x,SECTION_STICK_EXCLUDED as B,SOME_VIEW_PINS as R,sectionPinAttrs as h}from"../../../../format/lib/content/section-sticky.js";import{addShowWhenFacts as j,shownByUsedValue as p,withRowRules as w}from"../../../../format/lib/document/show-when-attach.js";import{SlotsStartAfresh as U}from"../../../components/InBoxContext.js";import{HOVER_GROUP_KEY as H}from"../../../../format/lib/animation/hover.js";import{LOOP_GROUP_KEY as v}from"../../../../format/lib/animation/loop.js";import{SCROLL_CUSTOMIZE_KEY as V,SCROLL_GROUP_KEY as m}from"../../../../format/lib/animation/scroll.js";import{PIN_ATTR as C,PIN_FRAME_ATTR as F}from"efficient-shell/format";import{CARD_BLOCK_KEYS as G}from"./corners.js";import{heldByANode as M,NOT_HELD_BY_A_NODE as W}from"../../../../format/lib/document/passes/document-position.js";const rt=k("sectionSticky",(n,i,t)=>i.isSection(n)&&!B.has(n)&&!!t&&typeof t.render=="function",!0),lt=k("cardSticky",(n,i,t)=>G.includes(n)&&!!t&&typeof t.render=="function",!1);function k(n,i,t){return{name:n,applies:i,panel(s,r,l){const c=N.has(r);s.fields=X(s.fields??{},w(l.stickFields({intro:c,screens:t,above:t}),Z(c))),t&&j(s,{heldByANode:M})},draw(s,r){const l=s.render,c=N.has(r);s.render=_=>{const o=h(_,{atScreenTop:c,above:t});if(!o)return l(_);const S=f=>{const d=E(U,{children:l(_)});return E(A,{...f.attrs,style:f.style,children:f.attrs[C]===""?E("div",{[F]:"",children:d}):d})},T=t?h(_,{atScreenTop:c,track:t,above:!0}):o;return!T||T.attrs[C]!==""?S(o):E(D,{own:()=>S(T),followed:()=>S(o)})}}}}const b=[H,v],g="_gStick";function X(n,i){const t=Object.keys(n),s=n[m];if(!s){const e=t.findIndex(a=>b.includes(a));return e<0?{...n,...i}:Object.fromEntries([...t.slice(0,e).map(a=>[a,n[a]]),...Object.entries(i),...t.slice(e).map(a=>[a,n[a]])])}const{[g]:r,...l}=i,c=e=>e.startsWith(y),_=Object.entries(l).filter(([e])=>!c(e)),o=Object.entries(l).filter(([e])=>c(e)),S=[s.dot,r?.dot].filter(e=>!!e),T=t.indexOf(m),f=t.findIndex((e,a)=>a>T&&b.includes(e)),d=f<0?t.length:f,O=t.indexOf(V),I=O>T&&O<d?O:d,u=e=>[e,e===m?{...s,dot:{any:S}}:n[e]],K=[...t.slice(0,I).map(u),..._,...t.slice(I,d).map(u),...o,...t.slice(d).map(u)];return Object.fromEntries(K)}function Z(n){const i=o=>({field:o,in:[!0,!1]}),t=o=>n&&o==="stickTop"?{any:[{field:o,is:!0},Y]}:{field:o,is:!0},s=o=>({field:o,is:!0}),r=o=>({all:[o,W,{not:{field:P,is:!0}}]}),[l,c,_]=L;return[[["stickTopDistance"],t("stickTop")],[["stickTopDistanceTablet"],p(["stickTopTablet","stickTop"],i,t)],[["stickTopDistancePhone"],p(["stickTopPhone","stickTopTablet","stickTop"],i,t)],[[l],r(s("stickTop"))],[[c],r(p(["stickTopTablet","stickTop"],i,s))],[[_],r(p(["stickTopPhone","stickTopTablet","stickTop"],i,s))],[[x],R],[[P],R]]}export{lt as cardSticky,rt as sectionSticky};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{capHeroGroups as s}from"../../../format/lib/document/cap-hero-groups.js";import{markListSearchScopes as m}from"../../../format/lib/document/list-search-scopes.js";import{dropEmptySourcedBoxes as i,markHeadCoreBoxes as h}from"./head-core-boxes.js";import{oneH1 as
|
|
1
|
+
import{capHeroGroups as s}from"../../../format/lib/document/cap-hero-groups.js";import{markListSearchScopes as m}from"../../../format/lib/document/list-search-scopes.js";import{dropEmptySourcedBoxes as i,markHeadCoreBoxes as h}from"./head-core-boxes.js";import{oneH1 as l}from"../../../format/lib/document/one-h1.js";import{withPageContents as c}from"../content/page-contents.js";import{markCardPressTitles as p}from"./card-press-titles.js";import{markWallLabels as d}from"./wall-labels.js";import{migrateLegacyPageData as u}from"./migrate-legacy.js";import{migrateRenamedProps as f}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as y,SECTION_TO_BOX_ON as g}from"../sections/section-to-box.js";import{siteThemeOf as w}from"../../../format/lib/theme.js";import{registerGeneralSectionRows as b}from"./blocks/general/section-to-box-rows.js";const k=[{name:"migrateLegacyPageData",chrome:!1,why:"page-only: it walks the top-level sections (Gallery B's array to its slot, a second pinned Header or Footer); a chrome document's one top-level node is the chrome itself",run:e=>u(e)},{name:"migrateRenamedProps",chrome:!0,why:"every document built from stored props: a renamed key still reads its stored answer (lib/source-rules/document-surfaces)",run:e=>f(e)},{name:"convertSectionsInPage",chrome:!1,why:"page-only: it turns an old top-level SECTION into its Box, with the site theme off the page's metadata; chrome is a Box group, never one of those sections",run:(e,{metadata:o})=>(b(),y(e,g,{theme:w(o)}))},{name:"capHeroGroups",chrome:!1,why:"page-only: it caps a top-level Hero's slide groups, and a Hero is a page section",run:e=>s(e)},{name:"oneH1",chrome:!1,why:"page-only: it hands the h1 to the first opener in the PAGE's document order; on a chrome document it would count a second document on its own",run:e=>l(e)},{name:"dropEmptySourcedBoxes",chrome:!0,why:"any document: a nested head over sourced cores served none goes (the Box footer's payment line), at any depth inside a slot",run:e=>i(e)},{name:"markHeadCoreBoxes",chrome:!1,why:"page-only: it marks a head Box at the TOP of the page, where the mark element draws (lib/content/empty-hides); a chrome document's top is the chrome group",run:e=>h(e)},{name:"markListSearchScopes",chrome:!1,why:"page-only for now: it ties a Search to the lists of the page's Box; no chrome holds a Search, and a chrome entry is one flag when one does",run:e=>m(e)},{name:"withPageContents",chrome:!1,why:"page-only: a Contents block lists the PAGE's anchored sections and numbers their kickers",run:e=>c(e)},{name:"markWallLabels",chrome:!0,why:"any document: each Marks wall is named by the lead Text drawn before it (aria-labelledby), the Box footer's walls too",run:e=>d(e)},{name:"markCardPressTitles",chrome:!0,why:"any document: an acting copy's press button is named by its template's title Text (aria-labelledby), a header or footer list too; after the wall labels, so a Text keeps one id",run:e=>p(e)}];function a(e,o,n){let r=e;for(const t of k)(!n||t.chrome)&&(r=t.run(r,o));return r}function D(e,o){return a(e,{metadata:o},!1)}function I(e,o){return a(e,{metadata:o},!0)}export{k as PUBLISHED_PASSES,I as publishedChromeData,D as publishedPageData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HERO_SLIDE_SEEDS as h}from"../../components/HeroSlide.js";import{heroGroupAddBlocked as
|
|
1
|
+
import{HERO_SLIDE_SEEDS as h}from"../../components/HeroSlide.js";import{heroGroupAddBlocked as p,heroGroupOverCapNotice as i}from"../../../format/lib/hero-group-placement.js";import{newNodeId as n}from"efficient-easel/draw";import{BOX_TYPE as c}from"../../../format/lib/document/container-blocks.js";import{BOX_LABEL as s}from"../../../format/lib/document/section-catalog.js";import{seedNodes as E}from"../../../format/lib/document/seed-parts.js";import{isNodeList as T}from"efficient-easel/data";import{PROCESS_COLUMNS_SLOT as _,PROCESS_STEPS_SEED_COUNT as O,processColumnSeed as u}from"../../../format/lib/document/blocks/general/ProcessSteps/column-seed.js";import{HERO_STRIP_SLOT as S}from"../../../format/lib/hero-ticker.js";const a=(e,o)=>({type:e.type,props:{...o?.(e.type)??{},...Object.fromEntries(Object.entries(e.props).map(([r,t])=>[r,T(t)?t.map(l=>a(l,o)):t]))}}),C=e=>{const[o]=E([u()],l=>n(l)),{id:r,...t}=a(o,e).props;return t},d={Hero:{slot:"slides",childType:"HeroSlide",addLabel:"Add slide",slider:!0,seeds:()=>h.map(e=>({...e}))},HeroSlide:{slot:"groups",childType:"HeroGroup",addLabel:`Add ${s.toLowerCase()}`,seeds:()=>[],addBlocked:p,notice:i},HeroSingle:{slot:"boxes",childType:"HeroGroup",addLabel:`Add ${s.toLowerCase()}`,seeds:()=>[],addBlocked:p,notice:i},ProcessSteps:{slot:_,childType:c,addLabel:`Add ${s.toLowerCase()}`,seeds:e=>Array.from({length:O},()=>C(e)),skipSeed:e=>Array.isArray(e.steps)&&e.steps.length>0}},m=1,L={slot:S,childType:c,addLabel:`Add ${s.toLowerCase()}`,seeds:()=>[],addBlocked:e=>e.length>=m?"This Hero has its Scrolling Bar already. Delete it to add another.":null,notice:e=>e.length>m?`This Hero holds ${e.length} Scrolling Bars. Keep one and delete the others.`:null},w={Hero:{[S]:L}};function x(e){for(const[o,r]of Object.entries(e)){if(o in d&&d[o]!==r)throw new Error(`lib/document/slot-specs: "${o}" already has a slot spec`);d[o]=r}}function N(e,o){const r=d[e];return r?{slot:r.slot,children:r.seeds(o).map(t=>({type:r.childType,props:{id:n(r.childType),...t}}))}:null}export{m as HERO_STRIP_CAP,L as HERO_STRIP_SPEC,w as SLOT_SECTION_EXTRA_SPECS,d as SLOT_SECTION_SPECS,N as buildSlotSeedChildren,x as registerSlotSectionSpecs};
|
|
@@ -43,23 +43,12 @@ export type ConvertContext = {
|
|
|
43
43
|
press?: boolean;
|
|
44
44
|
};
|
|
45
45
|
export declare function convertTheme(ctx: ConvertContext): ThemeValue | undefined;
|
|
46
|
-
export type Restyled = {
|
|
47
|
-
key: string;
|
|
48
|
-
was: {
|
|
49
|
-
size: number;
|
|
50
|
-
sizePhone?: number;
|
|
51
|
-
};
|
|
52
|
-
textStyle?: string;
|
|
53
|
-
size?: number;
|
|
54
|
-
sizePhone?: number;
|
|
55
|
-
};
|
|
56
46
|
export type SectionConversion = {
|
|
57
47
|
node: SectionNode;
|
|
58
48
|
nodes: SectionNode[];
|
|
59
49
|
carried: Carried[];
|
|
60
50
|
dropped: Dropped[];
|
|
61
51
|
siteWrites: SiteWrite[];
|
|
62
|
-
restyled: Restyled[];
|
|
63
52
|
skipped?: string;
|
|
64
53
|
};
|
|
65
54
|
export type TextRole = "heading" | "body" | "eyebrow";
|
|
@@ -113,10 +102,6 @@ type PartRowKind = {
|
|
|
113
102
|
style?: Props;
|
|
114
103
|
styleFrom?: (node: Props, ctx: ConvertContext) => Props;
|
|
115
104
|
props?: Props;
|
|
116
|
-
was?: {
|
|
117
|
-
size: number;
|
|
118
|
-
sizePhone?: number;
|
|
119
|
-
};
|
|
120
105
|
mark?: "accentLead" | "accentItalic";
|
|
121
106
|
} | {
|
|
122
107
|
kind: "button";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readHidable as Z}from"efficient-easel/draw";import{BOX_TYPE as ee,CONTAINER_BLOCKS_SLOT as te}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as oe,labelTextSeed as ne}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as se,parseSectionHeadPlacement as ie}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as R}from"../../../format/lib/finite-number.js";import{accentItalicRuns as re}from"../../../format/lib/markup.js";import{seedNodes as ae}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ce}from"../../../format/lib/locations-grid.js";import{normalizeTheme as G}from"../../../format/lib/theme.js";const _=ee,E=te;function Ie(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 fe(t,o){return o===0?`${t}~box`:`${t}~box-${o+1}`}const A={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box), and its Scrolling Bar is a Box in its strip slot (Hero › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function Ne(t){for(const[o,s]of Object.entries(t)){if(o in A&&A[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=s}}function Re(t){return A[t]}const Y=new Set(["id"]),T={},F=[],de=["ProductGrid","Events","ContactRouting","ReviewForm","AppointmentBooking","Reviews","CheckoutCTA"],le=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ",...de,"Stats","Logos","PaymentBadges","PaymentLogosBlock","FitmentFinder","DocMasthead","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Countdown","FeaturedCover","Cards"];function Ae(t){for(const[o,s]of Object.entries(t)){if(o in T&&T[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=s}}function Ce(t){return T[t]}function He(){return Object.keys(T)}function pe(t){return t in T&&F.includes(t)}function Le(t,o=le){return t in T&&(o.includes(t)||pe(t))}function Fe(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const s=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&s.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&s.push({kind:"button",key:"linkText",href:"linkHref"}),s}const z=t=>Z(t),ze=t=>z(t).text.trim()!=="";function ue(t){if(t.includes("=="))return t;const o=t.indexOf("/"),s=o===-1?t:t.slice(0,o),i=s.trim();if(!i)return t;const c=s.indexOf(i);return`${s.slice(0,c)}==${i}==${s.slice(c+i.length)}${o===-1?"":t.slice(o)}`}const he=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function ye(t,o,s,i){const a={...t._partStyles?.text??{},...o??{},...s??{}};return(i==="center"||i==="right")&&a.align===void 0&&(a.align=i),Object.keys(a).length?{_partStyles:{text:a}}:{}}function me(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const s=o[t.key];return{variant:typeof s=="string"&&Object.hasOwn(t.map,s)?t.map[s]:t.fallback}}function V(t,o,s,i,c={}){const a={...o};for(const u of t){const[k,O,j]=typeof u=="string"?[u,u,void 0]:u;if(s[k]===void 0)continue;const P=j?j(s[k],s,c):s[k];P===void 0?delete a[O]:a[O]=P,i(k,O,P===void 0)}return a}function ke(t){const o=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),s=c=>{for(const a of c??[])o.add(typeof a=="string"?a:a[0])},i=c=>{for(const a of c)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":s(a.box),i(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(u=>o.add(u)),Object.keys(a.rename??{}).forEach(u=>o.add(u)),a.derive?.reads.forEach(u=>o.add(u)),typeof a.slots!="function")for(const u of Object.values(a.slots??{}))for(const k of u)"kind"in k&&o.add(k.key);break}};for(const c of[t,...t.also??[]])s(c.box),i(c.parts);return o}const be=t=>ie(t.headPlacement)==="own-box";function xe(t){return be(t)?"its head sits in a Box of its own above it (own-box): the row draws the head inline":void 0}function ge(t,o){const s=t[o];return Array.isArray(s)&&s.some(c=>!!c&&typeof c=="object"&&typeof c.type=="string")?"already on the Box path: its items draw from a filled card template":void 0}function we(t){const o=new Set,s=i=>{for(const c of i)if(c.kind==="group"||c.kind==="block")s(c.parts??[]);else if(c.kind==="core"&&c.slots&&typeof c.slots!="function")for(const[a,u]of Object.entries(c.slots))u.length>0&&u.every(k=>!("kind"in k))&&o.add(a)};for(const i of[t,...t.also??[]])s(i.parts);return[...o]}function $e(t,o,s){if(!s.press)for(const i of we(t)){const c=ge(o,i);if(c!==void 0)return c}}function Q(t,o,s={}){const i=t.props,c=(o.ownBoxConverts?void 0:xe(i))??$e(o,i,s)??o.skip?.(i);if(c!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:c};const a=String(i.id??t.type),u=[],k=[],O=[],j=new Set,P=(n,r)=>{u.push({key:n,home:r}),j.add(n)},M=i._partStyles??{},C=ke(o);let X=0;const w=(n,r)=>({type:n,props:{...r,id:`${a}~${n}-${++X}`}}),K=(n,r,b,m,x,l,$)=>{if(x){for(const f of n??[]){const h=typeof f=="string"?f:f[0];b[h]!==void 0&&$(h,`nothing — the ${m} has no parts, so it is not drawn`)}return}const e=typeof r=="function"?r(i,s):r??{};return V(n??[],e,b,(f,h,d)=>$(f,d?`nothing — the old value draws nothing (${m}: no ${h})`:`${l}${m}: ${h}`),s)},q=n=>ae(n,r=>`${a}~${r}-${++X}`),W=(n,r,b)=>{const m=n.of?n.of(r):Array.isArray(r[n.key])?r[n.key]:[],x=typeof n.props=="function"?n.props(i,s):n.props??{},l=m.map((d,g)=>{const p=d??{},y=n.item?.(p,g,i)??{},S=I(y.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${g+1}: `);return n.flat?y.props?S.map(v=>({...v,props:{...v.props,...y.props,id:v.props.id}})):S:[w(_,{name:`${n.name} ${g+1}`,...x,...y.props??{},[E]:S})]});if(n.groups){const d=n.groups;return b(n.key,m.length?`one Box per item (${m.length}), in a Box per group`:"nothing — the list is empty"),ce(m.map(g=>g??{}),d.of,d.of).map((g,p)=>{const y=g.items.map(B=>B.item),S=d.parts?I(d.parts,d.head?.(y,i)??{},!1,`group ${p+1}: `):[],v=g.items.map(B=>l[B.index]),H=d.perRow?.(y.length,i),N=Number.isInteger(H)&&H>=1?H:1,L=[];if(d.perRow&&N<v.length)for(let B=0;B*N<v.length;B++)L.push(v.slice(B*N,(B+1)*N).flat());return w(_,{name:`${d.name} ${p+1}`,...d.props??{},[E]:[...S,w(_,{name:`${d.itemsName} ${p+1}`,...d.itemsProps?.(y.length,i)??{},[E]:L.length?L.map((B,U)=>w(_,{name:`${d.rowName??`${d.itemsName} row`} ${U+1}`,...d.rowProps??{},[E]:B})):v.flat()})]})})}const $=n.perRow?.(i),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(m.length?n.flat?`each item's parts (${m.length} items), in order`:`one Box per item (${m.length}), its parts inside`:"nothing — the list is empty")+(e&&m.length?`, in rows of ${e}`:"")),!e)return l.flat();const f=typeof n.rowProps=="function"?n.rowProps(i,s):n.rowProps??{},h=[];for(let d=0;d*e<l.length;d++){const g=l.slice(d*e,(d+1)*e).flat(),p=n.rowFiller?e-l.slice(d*e,(d+1)*e).length:0;h.push(w(_,{name:`${n.rowName??`${n.name} row`} ${d+1}`,...f,[E]:[...g,...Array.from({length:p},(y,S)=>w(_,{name:`Empty ${S+1}`,...n.rowFiller,[E]:[]}))]}))}return h},I=(n,r,b,m)=>{const x=[],l=(e,f)=>b?P(e,f):void 0,$=e=>b?M[e]:void 0;for(const e of n)if(!(e.when&&!e.when(i,b?void 0:r)))switch(e.kind){case"text":{const f=z(r[e.key]);if(!f.text.trim()&&!(b&&s.press&&o.pressKeepsEmpty?.includes(e.key))){l(e.key,"nothing — empty words draw nothing, so no block");break}const h=he(e.role??"body"),{_partStyles:d,...g}=h,p=ye(h,e.styleFrom?{...e.style,...e.styleFrom(i,s)}:e.style,$(e.key),e.props?.align);if(e.was&&b){const y=p._partStyles?.text??{};O.push({key:e.key,was:e.was,...typeof y.textStyle=="string"?{textStyle:y.textStyle}:{},...R(y.size)!==void 0?{size:R(y.size)}:{},...R(y.sizePhone)!==void 0?{sizePhone:R(y.sizePhone)}:{}})}x.push(w("Text",{text:e.mark==="accentLead"?ue(f.text):e.mark==="accentItalic"?re(f.text):f.text,...g,...e.props??{},...p,...f.hidden?{_hidden:!0}:{}})),l(e.key,`${m}Text block: its words${f.hidden?", hidden":""}`);break}case"button":{const f=z(r[e.key]);if(!f.text.trim()){l(e.key,"nothing — no words, no button"),l(e.href,"nothing — no button to link"),typeof e.variant=="object"&&l(e.variant.key,"nothing — no button to style");break}const h=typeof r[e.href]=="string"&&r[e.href]?r[e.href]:"#",d={...e.style??{},...$(e.key)??{}};x.push(w("ButtonBlock",{label:f.text,href:h,...typeof e.props=="function"?e.props(r,s):e.props??{},...me(e.variant,r),...Object.keys(d).length?{_partStyles:{label:d}}:{},...f.hidden?{_hidden:!0}:{}})),l(e.key,`${m}Button block: its words`),l(e.href,`${m}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${m}Button block: its Style`);break}case"image":{const f=r[e.key];if(typeof f!="string"||!f){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const h=e.alt&&typeof r[e.alt]=="string"?r[e.alt]:"";x.push(w("ImageBlock",{src:f,alt:h,...e.props??{}})),l(e.key,`${m}Image block: its picture`),e.alt&&l(e.alt,`${m}Image block: its alt text`);break}case"list":{x.push(...W(e,r,l));break}case"group":{const f=I(e.parts,r,b,m),h=K(e.box,e.props,r,`${e.name} Box`,!f.length&&!e.keepEmpty,m,l);h&&x.push(w(_,{name:e.name,...h,[E]:f}));break}case"block":{const f=e.parts?I(e.parts,r,b,m):[],h=K(e.box,e.props,r,`${e.type} block`,!!e.parts&&!f.length&&!e.keepEmpty,m,l);h&&x.push(w(e.type,{...h,...e.slot?{[e.slot]:f}:{}}));break}case"core":{const f=e.as??t.type,h={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},d=e.keep==="rest"?Object.keys(r).filter(p=>!C.has(p)&&!(p in h)):e.keep;for(const p of d)r[p]!==void 0&&(h[p]=r[p],l(p,`the ${f} block inside the Box`));if(e.keep==="rest"){for(const y of Object.keys(e.props??{}))r[y]!==void 0&&!C.has(y)&&l(y,`nothing — the ${f} block inside the Box has the row's own value`);r.headPlacement!==void 0&&l("headPlacement",`the ${f} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(M).filter(([y])=>!C.has(y)));Object.keys(p).length&&(h._partStyles=p)}for(const[p,y]of Object.entries(e.rename??{}))r[p]!==void 0&&(h[y]=r[p],l(p,`the ${f} block inside the Box: ${y}`));if(e.derive){Object.assign(h,e.derive.props(r,s));for(const p of e.derive.reads)r[p]!==void 0&&l(p,`the ${f} block inside the Box`)}const g=typeof e.slots=="function"?e.slots(r,s):e.slots??{};for(const[p,y]of Object.entries(g))h[p]=y.flatMap(S=>"kind"in S?W(S,r,l):q([S]));x.push(w(f,h));break}}return x},J=(n,r)=>{const b=r===0?"Box":`${n.name} Box`,m=I(n.parts,i,!0,r===0?"":`${b}: `),x=typeof n.boxProps=="function"?n.boxProps(i,s):n.boxProps??{},l=V(n.box??[],x,i,($,e,f)=>P($,f?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),s);return{type:_,props:{name:n.name,...l,[E]:m,id:fe(a,r)}}},D=[o,...o.also??[]].map(J);i._partStyles!==void 0&&P("_partStyles","each old part's style moved to its new part");for(const[n,r]of Object.entries(o.reads??{}))i[n]!==void 0&&P(n,r);for(const[n,r]of Object.entries(o.drop??{}))n in i&&(k.push({key:n,why:r}),j.add(n));for(const n of Object.keys(i))Y.has(n)||j.has(n)||k.push({key:n,why:"not in the row — not carried"});return{node:D[0],nodes:D,carried:u,dropped:k,siteWrites:[...o.site?.(t,s)??[]],restyled:O}}function Me(t,o=F,s={}){const i=t.content;if(!Array.isArray(i))return t;let c=!1;const a=i.flatMap(u=>{const k=u&&typeof u.type=="string"&&o.includes(u.type)?T[u.type]:void 0;if(!k)return[u];const O=Q(u,k,s);return O.skipped!==void 0?[u]:(c=!0,O.nodes)});return c?{...t,content:a}:t}function Xe(t,o=F,s={}){if(!Array.isArray(t))return[];const i=[];return t.forEach((c,a)=>{const u=c&&typeof c.type=="string"&&o.includes(c.type)?T[c.type]:void 0;if(!u)return;const k=Q(c,u,s);k.skipped===void 0&&i.push({index:a,node:k.node,nodes:k.nodes})}),i}export{de as HOST_PRESS_TYPES,E as SECTION_BOX_SLOT,_ as SECTION_BOX_TYPE,F as SECTION_TO_BOX_ON,le as SECTION_TO_BOX_PRESS,Re as boxNativeReason,Q as convertSection,Me as convertSectionsInPage,Ie as convertTheme,pe as convertsToBox,ge as filledTemplateHold,ze as hasWords,be as headInOwnBox,Fe as headParts,xe as ownBoxHold,Le as pressesAsBox,Ne as registerBoxNativeSections,Ae as registerSectionToBox,fe as sectionBoxIdOf,Xe as sectionToBoxEdits,Ce as sectionToBoxRow,He as sectionToBoxTypes};
|
|
1
|
+
import{readHidable as J}from"efficient-easel/draw";import{BOX_TYPE as U,CONTAINER_BLOCKS_SLOT as Z}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as ee,labelTextSeed as te}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as oe,parseSectionHeadPlacement as ne}from"../../../format/lib/sections/section-head-placement.js";import{accentItalicRuns as se}from"../../../format/lib/markup.js";import{seedNodes as re}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ie}from"../../../format/lib/locations-grid.js";import{normalizeTheme as D}from"../../../format/lib/theme.js";const v=U,E=Z;function Ee(t){if(t.theme)return D(t.theme);const o=t.site?.themePresets;return o?D({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ae(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 _e(t){for(const[o,s]of Object.entries(t)){if(o in A&&A[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=s}}function je(t){return A[t]}const z=new Set(["id"]),T={},L=[],ce=["ProductGrid","Events","ContactRouting","ReviewForm","AppointmentBooking","Reviews","CheckoutCTA","AlloyWheelsListing"],de=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ","ProcessSteps",...ce,"Stats","Logos","PaymentBadges","PaymentLogosBlock","FitmentFinder","DocMasthead","DocTabs","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Countdown","FeaturedCover","SectionHeader","TitleWithButtons","Prose","ParagraphsA","Banner","Cards"];function Ie(t){for(const[o,s]of Object.entries(t)){if(o in T&&T[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=s}}function Ne(t){return T[t]}function Ae(){return Object.keys(T)}function fe(t){return t in T&&L.includes(t)}function Re(t,o=de){return t in T&&(o.includes(t)||fe(t))}function Ce(t){const o=oe[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const s=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&s.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&s.push({kind:"button",key:"linkText",href:"linkHref"}),s}const F=t=>J(t),He=t=>F(t).text.trim()!=="";function le(t){if(t.includes("=="))return t;const o=t.indexOf("/"),s=o===-1?t:t.slice(0,o),r=s.trim();if(!r)return t;const c=s.indexOf(r);return`${s.slice(0,c)}==${r}==${s.slice(c+r.length)}${o===-1?"":t.slice(o)}`}const pe=t=>t==="heading"?ee():t==="eyebrow"?te():{};function ue(t,o,s,r){const a={...t._partStyles?.text??{},...o??{},...s??{}};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 s=o[t.key];return{variant:typeof s=="string"&&Object.hasOwn(t.map,s)?t.map[s]:t.fallback}}function G(t,o,s,r,c={}){const a={...o};for(const u of t){const[m,S,_]=typeof u=="string"?[u,u,void 0]:u;if(s[m]===void 0)continue;const j=_?_(s[m],s,c):s[m];j===void 0?delete a[S]:a[S]=j,r(m,S,j===void 0)}return a}function ye(t){const o=new Set([...z,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),s=c=>{for(const a of c??[])o.add(typeof a=="string"?a:a[0])},r=c=>{for(const a of c)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":s(a.box),r(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(u=>o.add(u)),Object.keys(a.rename??{}).forEach(u=>o.add(u)),a.derive?.reads.forEach(u=>o.add(u)),typeof a.slots!="function")for(const u of Object.values(a.slots??{}))for(const m of u)"kind"in m&&o.add(m.key);break}};for(const c of[t,...t.also??[]])s(c.box),r(c.parts);return o}const me=t=>ne(t.headPlacement)==="own-box";function ke(t){return me(t)?"its head sits in a Box of its own above it (own-box): the row draws the head inline":void 0}function be(t,o){const s=t[o];return Array.isArray(s)&&s.some(c=>!!c&&typeof c=="object"&&typeof c.type=="string")?"already on the Box path: its items draw from a filled card template":void 0}function ge(t){const o=new Set,s=r=>{for(const c of r)if(c.kind==="group"||c.kind==="block")s(c.parts??[]);else if(c.kind==="core"&&c.slots&&typeof c.slots!="function")for(const[a,u]of Object.entries(c.slots))u.length>0&&u.every(m=>!("kind"in m))&&o.add(a)};for(const r of[t,...t.also??[]])s(r.parts);return[...o]}function xe(t,o,s){if(!s.press)for(const r of ge(t)){const c=be(o,r);if(c!==void 0)return c}}function Y(t,o,s={}){const r=t.props,c=(o.ownBoxConverts?void 0:ke(r))??xe(o,r,s)??o.skip?.(r);if(c!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],skipped:c};const a=String(r.id??t.type),u=[],m=[],S=new Set,_=(n,i)=>{u.push({key:n,home:i}),S.add(n)},j=r._partStyles??{},R=ye(o);let M=0;const w=(n,i)=>({type:n,props:{...i,id:`${a}~${n}-${++M}`}}),W=(n,i,b,y,g,l,$)=>{if(g){for(const d of n??[]){const h=typeof d=="string"?d:d[0];b[h]!==void 0&&$(h,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof i=="function"?i(r,s):i??{};return G(n??[],e,b,(d,h,f)=>$(d,f?`nothing — the old value draws nothing (${y}: no ${h})`:`${l}${y}: ${h}`),s)},V=n=>re(n,i=>`${a}~${i}-${++M}`),X=(n,i,b)=>{const y=n.of?n.of(i):Array.isArray(i[n.key])?i[n.key]:[],g=typeof n.props=="function"?n.props(r,s):n.props??{},l=y.map((f,x)=>{const p=f??{},k=n.item?.(p,x,r)??{},B=I(k.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${x+1}: `);return n.flat?k.props?B.map(P=>({...P,props:{...P.props,...k.props,id:P.props.id}})):B:[w(v,{name:`${n.name} ${x+1}`,...g,...k.props??{},[E]:B})]});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"),ie(y.map(x=>x??{}),f.of,f.of).map((x,p)=>{const k=x.items.map(O=>O.item),B=f.parts?I(f.parts,f.head?.(k,r)??{},!1,`group ${p+1}: `):[],P=x.items.map(O=>l[O.index]),C=f.perRow?.(k.length,r),N=Number.isInteger(C)&&C>=1?C:1,H=[];if(f.perRow&&N<P.length)for(let O=0;O*N<P.length;O++)H.push(P.slice(O*N,(O+1)*N).flat());return w(v,{name:`${f.name} ${p+1}`,...f.props??{},[E]:[...B,w(v,{name:`${f.itemsName} ${p+1}`,...f.itemsProps?.(k.length,r)??{},[E]:H.length?H.map((O,q)=>w(v,{name:`${f.rowName??`${f.itemsName} row`} ${q+1}`,...f.rowProps??{},[E]:O})):P.flat()})]})})}const $=n.perRow?.(r),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(y.length?n.flat?`each item's parts (${y.length} items), in order`:`one Box per item (${y.length}), its parts inside`:"nothing — the list is empty")+(e&&y.length?`, in rows of ${e}`:"")),!e)return l.flat();const d=typeof n.rowProps=="function"?n.rowProps(r,s):n.rowProps??{},h=[];for(let f=0;f*e<l.length;f++){const x=l.slice(f*e,(f+1)*e).flat(),p=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;h.push(w(v,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...d,[E]:[...x,...Array.from({length:p},(k,B)=>w(v,{name:`Empty ${B+1}`,...n.rowFiller,[E]:[]}))]}))}return h},I=(n,i,b,y)=>{const g=[],l=(e,d)=>b?_(e,d):void 0,$=e=>b?j[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:i)))switch(e.kind){case"text":{const d=F(i[e.key]);if(!d.text.trim()&&!(b&&s.press&&o.pressKeepsEmpty?.includes(e.key))){l(e.key,"nothing — empty words draw nothing, so no block");break}const h=pe(e.role??"body"),{_partStyles:f,...x}=h,p=ue(h,e.styleFrom?{...e.style,...e.styleFrom(r,s)}:e.style,$(e.key),e.props?.align);g.push(w("Text",{text:e.mark==="accentLead"?le(d.text):e.mark==="accentItalic"?se(d.text):d.text,...x,...e.props??{},...p,...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Text block: its words${d.hidden?", hidden":""}`);break}case"button":{const d=F(i[e.key]);if(!d.text.trim()){l(e.key,"nothing — no words, no button"),l(e.href,"nothing — no button to link"),typeof e.variant=="object"&&l(e.variant.key,"nothing — no button to style");break}const h=typeof i[e.href]=="string"&&i[e.href]?i[e.href]:"#",f={...e.style??{},...$(e.key)??{}};g.push(w("ButtonBlock",{label:d.text,href:h,...typeof e.props=="function"?e.props(i,s):e.props??{},...he(e.variant,i),...Object.keys(f).length?{_partStyles:{label:f}}:{},...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Button block: its words`),l(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${y}Button block: its Style`);break}case"image":{const d=i[e.key];if(typeof d!="string"||!d){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const h=e.alt&&typeof i[e.alt]=="string"?i[e.alt]:"";g.push(w("ImageBlock",{src:d,alt:h,...e.props??{}})),l(e.key,`${y}Image block: its picture`),e.alt&&l(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...X(e,i,l));break}case"group":{const d=I(e.parts,i,b,y),h=W(e.box,e.props,i,`${e.name} Box`,!d.length&&!e.keepEmpty,y,l);h&&g.push(w(v,{name:e.name,...h,[E]:d}));break}case"block":{const d=e.parts?I(e.parts,i,b,y):[],h=W(e.box,e.props,i,`${e.type} block`,!!e.parts&&!d.length&&!e.keepEmpty,y,l);h&&g.push(w(e.type,{...h,...e.slot?{[e.slot]:d}:{}}));break}case"core":{const d=e.as??t.type,h={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(i).filter(p=>!R.has(p)&&!(p in h)):e.keep;for(const p of f)i[p]!==void 0&&(h[p]=i[p],l(p,`the ${d} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))i[k]!==void 0&&!R.has(k)&&l(k,`nothing — the ${d} block inside the Box has the row's own value`);i.headPlacement!==void 0&&l("headPlacement",`the ${d} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(j).filter(([k])=>!R.has(k)));Object.keys(p).length&&(h._partStyles=p)}for(const[p,k]of Object.entries(e.rename??{}))i[p]!==void 0&&(h[k]=i[p],l(p,`the ${d} block inside the Box: ${k}`));if(e.derive){Object.assign(h,e.derive.props(i,s));for(const p of e.derive.reads)i[p]!==void 0&&l(p,`the ${d} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(i,s):e.slots??{};for(const[p,k]of Object.entries(x))h[p]=k.flatMap(B=>"kind"in B?X(B,i,l):V([B]));g.push(w(d,h));break}}return g},Q=(n,i)=>{const b=i===0?"Box":`${n.name} Box`,y=I(n.parts,r,!0,i===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,s):n.boxProps??{},l=G(n.box??[],g,r,($,e,d)=>_($,d?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),s);return{type:v,props:{name:n.name,...l,[E]:y,id:ae(a,i)}}},K=[o,...o.also??[]].map(Q);r._partStyles!==void 0&&_("_partStyles","each old part's style moved to its new part");for(const[n,i]of Object.entries(o.reads??{}))r[n]!==void 0&&_(n,i);for(const[n,i]of Object.entries(o.drop??{}))n in r&&(m.push({key:n,why:i}),S.add(n));for(const n of Object.keys(r))z.has(n)||S.has(n)||m.push({key:n,why:"not in the row — not carried"});return{node:K[0],nodes:K,carried:u,dropped:m,siteWrites:[...o.site?.(t,s)??[]]}}function Le(t,o=L,s={}){const r=t.content;if(!Array.isArray(r))return t;let c=!1;const a=r.flatMap(u=>{const m=u&&typeof u.type=="string"&&o.includes(u.type)?T[u.type]:void 0;if(!m)return[u];const S=Y(u,m,s);return S.skipped!==void 0?[u]:(c=!0,S.nodes)});return c?{...t,content:a}:t}function Fe(t,o=L,s={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((c,a)=>{const u=c&&typeof c.type=="string"&&o.includes(c.type)?T[c.type]:void 0;if(!u)return;const m=Y(c,u,s);m.skipped===void 0&&r.push({index:a,node:m.node,nodes:m.nodes})}),r}export{ce as HOST_PRESS_TYPES,E as SECTION_BOX_SLOT,v as SECTION_BOX_TYPE,L as SECTION_TO_BOX_ON,de as SECTION_TO_BOX_PRESS,je as boxNativeReason,Y as convertSection,Le as convertSectionsInPage,Ee as convertTheme,fe as convertsToBox,be as filledTemplateHold,He as hasWords,me as headInOwnBox,Ce as headParts,ke as ownBoxHold,Re as pressesAsBox,_e as registerBoxNativeSections,Ie as registerSectionToBox,ae as sectionBoxIdOf,Fe as sectionToBoxEdits,Ne as sectionToBoxRow,Ae as sectionToBoxTypes};
|
|
@@ -24,8 +24,11 @@ export declare function SiteRuntimeProvider({ runtime, children }: {
|
|
|
24
24
|
}): import("react").JSX.Element;
|
|
25
25
|
export declare function useSiteRuntime(): SiteRuntime;
|
|
26
26
|
export declare function useCurrentPagePath(): string | null;
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function useSiteHost(): string | null;
|
|
28
|
+
export type SiteLinkNewTab = "auto" | true;
|
|
29
|
+
export declare function SiteLink({ hrefRewrite, newTab, ...rest }: SiteLinkProps & {
|
|
28
30
|
hrefRewrite?: string;
|
|
31
|
+
newTab?: SiteLinkNewTab;
|
|
29
32
|
}): import("react").JSX.Element;
|
|
30
33
|
export declare function SiteImage(props: SiteImageProps): import("react").JSX.Element;
|
|
31
34
|
export declare function lazyInBrowser<P extends object>(loader: () => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import c from"next/image";import l from"next/link";import{Component as m,createContext as h,lazy as p,Suspense as d,useContext as x,useSyncExternalStore as k}from"react";import{linkTargetAttrs as S,NEW_TAB_ATTRS as g}from"../../format/lib/content/box-link.js";import{linkHrefRewrite as w}from"../../format/lib/links/link-href-rewrites.js";import{shopHost as L}from"../../format/lib/web-runtime.js";import{isSafeLinkHref as y}from"../../format/lib/markup.js";import{nonEmptyString as R}from"../../format/lib/non-empty-string.js";const C={Link:l,Image:c},u=h(C);function M({runtime:r,children:e}){return o(u.Provider,{value:r,children:e})}function a(){return x(u)}function U(){return a().pagePath??null}const H=()=>()=>{},I=()=>L()||null,v=()=>null;function E(){return k(H,I,v)}function W({hrefRewrite:r,newTab:e,...t}){const{Link:n}=a(),f=E(),i=e===!0?{...t,...g}:e==="auto"?{...t,...S(t.href,f)}:t,s=w(r);return s?o(T,{name:s.name,href:i.href,fallback:o(n,{...i}),children:o(P,{Link:n,rewrite:s.rewrite,...i})},s.key):o(n,{...i})}function P({Link:r,rewrite:e,...t}){const n=R(e(t.href)),f=n&&y(n)?n:t.href;return o(r,{...t,href:f})}class T extends m{state={failed:!1,href:this.props.href};static getDerivedStateFromProps(e,t){return e.href===t.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 X(r){const{Image:e}=a();return o(e,{...r})}function $(r){const e=p(r);return function(n){return o(d,{fallback:null,children:o(e,{...n})})}}export{X as SiteImage,W as SiteLink,M as SiteRuntimeProvider,$ as lazyInBrowser,U as useCurrentPagePath,E as useSiteHost,a as useSiteRuntime};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defaultTextStyles as Y,textStyleCaseCss as le,textStyleViewKey as ce}from"efficient-easel/text-styles/model";import{
|
|
2
|
-
`)}function
|
|
1
|
+
import{defaultTextStyles as Y,textStyleCaseCss as le,textStyleViewKey as ce}from"efficient-easel/text-styles/model";import{resolveViewValue as B}from"efficient-easel/draw";import{viewKey as O}from"../../../format/lib/animation/views.js";import{FONT_OPTIONS as de,normalizeFonts as U}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as pe,TABLET_MEDIA as fe,viewOverrides as C,viewRules as X}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as ue,TEXT_STYLE_ATTR as ge,paragraphRules as Z,partSpacingOf as he}from"../document/part-styles.js";import{faceClassOf as q}from"../../../format/lib/text-style-face.js";import{partColourName as Q,partInkCss as me}from"../../../format/lib/document/part-inks.js";import{compressionMetrics as Se,headingTypographyFromRow as ye,normalizeHeadingCompression as I,normalizeSizes as ee}from"../../../format/lib/theme.js";import{finiteNumber as v}from"../../../format/lib/finite-number.js";import{nonEmptyString as P}from"../../../format/lib/non-empty-string.js";const L=e=>e==="sentence"?"none":void 0,ne=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],w=["desktop","tablet","phone"],k=(e,i)=>i==="desktop"?e:ce(e,i);function j(e,i,t,n=X()){return B("textSize",i,e.sizeTablet,e.sizePhone,n)[t]}const be=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function M(e){for(const[i,t,n]of be)for(const o of w)if(e===k(i,o))return{key:O(t,o),view:o,spacing:n};return{key:e,view:"desktop",spacing:null}}function b(e){const i={};for(const t of ne)e[t]!==void 0&&(i[t]=e[t]);return i}function R(e,i){const{auto:t,...n}=e,o=new Set(i??[]),r=ne.filter(s=>o.has(s)&&e.values[s]===void 0);return r.length?{...n,auto:r}:n}function te(e){const i=e.fonts,t=e.sizes,n=e.typography,o=Se(e.compression),r={"heading-1":{font:P(i.heading),size:v(t.headingLarge),weight:v(n.weight),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case),largestSize:v(n.maxPx)},"heading-2":{font:P(i.heading2),size:v(t.headingMedium),weight:v(n.weight2),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case2)},"heading-3":{font:P(i.heading3),size:v(t.headingSmall),weight:v(n.weight3),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case3)},"body-1":{font:P(i.body),size:v(t.body)},"body-5":{font:P(i.label),size:v(t.label)}};return Y().map(({id:s,kind:l,name:d})=>({id:s,kind:l,name:d,values:b(r[s]??{})}))}function N(e){return Array.isArray(e)&&e.every(t=>t&&typeof t=="object"&&typeof t.id=="string"&&(t.kind==="heading"||t.kind==="body")&&typeof t.name=="string")?e.map(t=>R({...t,values:b(t.values??{})},Array.isArray(t.auto)?t.auto:void 0)):null}function Le(e){return N(e)??[]}function ie(e){return N(e)??Y().map(({id:i,kind:t,name:n})=>({id:i,kind:t,name:n,values:{}}))}function V(e,i){const t=te(i),n=N(e);return n?n.map(o=>{const r={...F(t,o.id)};for(const s of o.auto??[])delete r[s];return{...o,values:b({...r,...o.values})}}):t}const F=(e,i)=>e.find(t=>t.id===i)?.values??{},oe=["heading-1","heading-2","heading-3"];function je({saved:e,old:i,cur:t,next:n,sizeOf:o,panelView:r="desktop"}){const s=te(i),l=ie(e),d=V(l,i),c=[],f=n.map(a=>{const S=t.find(g=>g.id===a.id),h=l.find(g=>g.id===a.id);if(!S||!h){const g=xe([a],o,r)[0],T=g.values.color;return T===void 0?g:{...g,values:{...g.values,color:Q(T)}}}const p={...h.values},x=new Set(h.auto??[]),y=a.values,_=S.values,z=[...new Set([...Object.keys(y),...Object.keys(_)])].filter(g=>JSON.stringify(y[g])!==JSON.stringify(_[g])),D=g=>M(g).spacing==="letter";z.sort((g,T)=>Number(D(g))-Number(D(T)));for(const g of z){const{key:T,view:re,spacing:K}=M(g),$=T,A=y[g];if(A===void 0){delete p[$],F(s,a.id)[$]!==void 0&&(c.push([a.id,$]),x.add($));continue}if(x.delete($),K==="line")p[$]=H(A/100,3);else if(K==="letter"){const W={...d.find(E=>E.id===a.id)?.values??{}};for(const E of z)y[E]===void 0&&delete W[M(E).key];const G=b({...W,...p}),J=j(G,o({...a,values:G}),re);p[$]=J?H(A/J,4):0}else p[$]=A}return R({id:a.id,kind:a.kind,name:a.name,values:b(p)},x)});let u=i.compression;if(c.some(([a,S])=>(S==="lineHeight"||S==="letterSpacing")&&oe.includes(a))&&I(u)!=="normal"){for(const a of oe){const S=f.find(p=>p.id===a);if(!S)continue;const h={...S.values};for(const p of["lineHeight","letterSpacing"])c.some(([x,y])=>x===a&&y===p)||h[p]===void 0&&!(S.auto??[]).includes(p)&&(h[p]=F(s,a)[p]);S.values=b(h)}u="normal"}return{saved:f,old:{...i,compression:u}}}function Me(e,i){const t={text_styles:e.saved};return e.old.compression!==i.compression&&(t.heading_compression=I(e.old.compression)),t}const H=(e,i)=>Number(e.toFixed(i)),se=(e,i)=>w.indexOf(e)<w.indexOf(i)?i:e;function Re(e,i,t="desktop"){return e.map(n=>{const o={...n.values},r=i(n);for(const s of w){const l=O("lineHeight",s),d=n.values[l],c=n.values[O("letterSpacing",s)];delete o[l],d!==void 0&&(o[k("lineSpacing",s)]=H(d*100,1));const f=se(s,t);c!==void 0&&(o[k("letterSpacing",s)]=H(c*j(n.values,r,f),f===s?2:4))}return{id:n.id,kind:n.kind,name:n.name,values:o}})}function xe(e,i,t="desktop"){return e.map(n=>{const o=n.values,r={...o};for(const c of w)delete r[k("lineSpacing",c)],delete r[k("letterSpacing",c)];const s={id:n.id,kind:n.kind,name:n.name,values:b(r)},l={...s.values},d=i({...s,values:{...s.values}});for(const c of w){const f=o[k("lineSpacing",c)],u=o[k("letterSpacing",c)];if(typeof f=="number"&&(l[O("lineHeight",c)]=H(f/100,3)),typeof u=="number"){const m=j(s.values,d,se(c,t));l[O("letterSpacing",c)]=m?H(u/m,4):0}}return{...s,values:b(l)}})}function Ve(e){const i={fonts:U({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:ee({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:I(e.heading_compression),typography:ye(e)},t=e.text_styles??null,n=Array.isArray(t)?ae(V(t,i),i):i;return{fonts:U(n.fonts),sizes:ee(n.sizes),compression:I(n.compression),typography:n.typography,textStyles:t}}function ae(e,i){const t=m=>e.find(a=>a.id===m)?.values??{},n=t("heading-1"),o=t("heading-2"),r=t("heading-3"),s=t("body-1"),l=t("body-5"),d=i.fonts,c=i.sizes,f=i.typography,u=m=>m==="none"?"sentence":"authored";return{fonts:{...d,heading:n.font??d.heading,heading2:o.font??n.font??d.heading2,heading3:r.font??n.font??d.heading3,body:s.font??d.body,label:l.font??d.label},sizes:{...c,headingLarge:n.size??null,headingMedium:o.size??null,headingSmall:r.size??null,body:s.size??null,label:l.size??null},compression:i.compression,typography:{...f,case:u(n.letterCase),weight:n.weight??null,maxPx:n.largestSize??null,weight2:o.weight??null,weight3:r.weight??null,case2:u(o.letterCase),case3:u(r.letterCase)}}}function Fe(e){const i=N(e.textStyles);if(!i||i.every(o=>Object.keys(o.values).length===0&&!o.auto))return e;const t={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},n=ae(V(i,t),t);return{...e,fonts:n.fonts,sizes:n.sizes,headingCompression:n.compression,headingTypography:n.typography}}function De(e){const i=[];for(const t of e){const n=t.values,o=`.${q(t)}`,r=`[${ge}="${t.id}"]`,s=`${o}, ${r}`,l=[],d=n.font!==void 0?de.find(m=>m.key===n.font)?.cssVar:void 0;if(d&&l.push(`font-family: var(${d})`),n.size!==void 0){const m=n.largestSize!==void 0?Math.min(n.size,n.largestSize):n.size;l.push(`font-size: ${m}px`)}const c=me(n.color);c&&l.push(`color: ${c}`),n.italic===!0&&l.push("font-style: italic"),n.weight!==void 0&&l.push(`font-weight: ${n.weight}`);const f=[];n.lineHeight!==void 0&&f.push(`line-height: ${n.lineHeight}`),n.letterSpacing!==void 0&&f.push(`letter-spacing: ${n.letterSpacing}em`),t.kind==="body"&&l.push(...f);const u=le(n.letterCase);u&&t.kind==="body"&&l.push(`text-transform: ${u}`),n.paragraphSpacing&&l.push(`--sf-part-para: ${n.paragraphSpacing}px`),l.length&&i.push(`${s} { ${l.join("; ")} }`),t.kind==="heading"&&f.length&&i.push(`${s}, ${o}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${f.join("; ")} }`),t.kind==="heading"&&u&&i.push(`${r}, ${o}:is(h1, h2, h3, h4) { text-transform: ${u} }`),n.paragraphSpacing&&(i.push(`*:has(> ${r}) { --sf-part-para: ${n.paragraphSpacing}px }`),i.push(...Z(`:is(${s})`,`*:has(> ${r})`))),i.push(...ze(t,s,o,r))}return i.join(`
|
|
2
|
+
`)}function ze(e,i,t,n){const o=e.values,r=C("textSize",o.size,o.sizeTablet,o.sizePhone),s=C("textSize",o.largestSize,o.largestSizeTablet,o.largestSizePhone),l=C("same",o.lineHeight,o.lineHeightTablet,o.lineHeightPhone),d=C("same",o.letterSpacing,o.letterSpacingTablet,o.letterSpacingPhone),c=C("spacing",o.paragraphSpacing,o.paragraphSpacingTablet,o.paragraphSpacingPhone),f=B("textSize",o.size,o.sizeTablet,o.sizePhone,X()),u=ve[e.id],m=[];for(const[a,S]of[["tablet",fe],["phone",pe]]){const h=[],p=[],x=f[a],y=s[a],_=r[a]===void 0&&y===void 0||x===void 0?void 0:y===void 0?x:Math.min(x,y);_!==void 0&&p.push(`font-size: ${_}px`);const z=[];l[a]!==void 0&&z.push(`line-height: ${l[a]}`),d[a]!==void 0&&z.push(`letter-spacing: ${d[a]}em`),e.kind==="body"&&p.push(...z),c[a]!==void 0&&p.push(`--sf-part-para: ${c[a]}px`),p.length&&h.push(`${i} { ${p.join("; ")} }`),e.kind==="heading"&&z.length&&h.push(`${i}, ${t}:is(h1, h2, h3, h4), ${n}:is(h1, h2, h3, h4) { ${z.join("; ")} }`),c[a]!==void 0&&h.push(`*:has(> ${n}) { --sf-part-para: ${c[a]}px }`),c[a]!==void 0&&!o.paragraphSpacing&&h.push(...Z(`:is(${i})`,`*:has(> ${n})`)),_!==void 0&&u&&h.push(`.sf-themed-content { --size-${u}: ${_}px !important }`),h.length&&m.push(`@media ${S} { ${h.join(" ")} }`)}return m}const ve={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function Ke(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function We(e){return e?ue[e]:void 0}function $e(e){const i=he(e);return b({font:e.font,color:e.color===void 0?void 0:Q(e.color),size:e.size,weight:e.weight,italic:e.italic,lineHeight:i.lineHeight,letterSpacing:i.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function Ge(e){return Object.keys($e(e)).length>0}function Je({saved:e,old:i,styleId:t,values:n}){const o=ie(e);return{saved:_e(o,t,n),old:i}}function _e(e,i,t){return e.map(n=>n.id===i?R({...n,values:b({...n.values,...t})},n.auto):n)}function Ye(e){const i=e.filter(t=>t.kind==="body").map(t=>Number(/^body-(\d+)$/.exec(t.id)?.[1])).filter(t=>Number.isInteger(t)&&t>0);return i.length?`body-${Math.max(...i)}`:"body-1"}export{Ke as accentItalicCss,je as applyListChange,Ye as eyebrowStyleId,q as faceClassOf,xe as fromPanelStyles,Ge as hasStyleChange,Me as listChangePatch,ie as listToWrite,$e as partStyleToTextStyleValues,Je as pushIntoStyle,V as resolveTextStyles,_e as setStyleValues,Ve as siteTextFromRow,Le as storedTextStyles,We as styleIdOfRole,De as textStylesCss,te as textStylesFromOld,ae as textStylesToOld,Fe as themeWithTextStyles,Re as toPanelStyles,j as viewSizeOf};
|