efficient-web-builder 55.1.0 → 55.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/lib/document/block-source-fields.d.ts +1 -0
- package/dist/editor/lib/document/block-source-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/CardList/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Cards/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.js +1 -1
- package/dist/editor/lib/document/blocks/general/LogoBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ProcessSteps/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/card-row-fields.d.ts +2 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/choice-pictures.d.ts +2 -0
- package/dist/editor/lib/document/choice-pictures.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/live-number-field.d.ts +5 -0
- package/dist/editor/lib/document/live-number-field.js +1 -1
- package/dist/editor/lib/document/mirror-cards-field.js +1 -1
- package/dist/editor/lib/document/part-anchors.js +1 -1
- package/dist/editor/lib/document/part-panel-rows.js +1 -1
- package/dist/editor/lib/host-document-bridge.d.ts +4 -1
- package/dist/editor/lib/host-document-bridge.js +1 -1
- package/dist/editor/lib/sections/text-layouts.d.ts +2 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/content/block-sources.d.ts +18 -2
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/box-background.d.ts +3 -0
- package/dist/format/lib/content/box-background.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/card-state.d.ts +6 -0
- package/dist/format/lib/content/card-state.js +1 -1
- package/dist/format/lib/content/card-template.d.ts +14 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/count-numbers.d.ts +1 -1
- package/dist/format/lib/content/count-numbers.js +1 -1
- package/dist/format/lib/content/footer.js +1 -1
- package/dist/format/lib/content/footprint.d.ts +1 -0
- package/dist/format/lib/content/footprint.js +1 -1
- package/dist/format/lib/content/image-text-rows.d.ts +22 -0
- package/dist/format/lib/content/image-text-rows.js +1 -0
- package/dist/format/lib/content/mirror-cards.d.ts +17 -0
- package/dist/format/lib/content/mirror-cards.js +1 -1
- package/dist/format/lib/content/view-lines.d.ts +1 -1
- package/dist/format/lib/document/blocks/general/CardList/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 -0
- package/dist/format/lib/document/blocks/general/Footprint/meta.d.ts +6 -0
- package/dist/format/lib/document/blocks/general/Footprint/meta.js +2 -2
- package/dist/format/lib/document/blocks/general/Logos/card-seed.d.ts +7 -0
- package/dist/format/lib/document/blocks/general/Logos/card-seed.js +1 -0
- package/dist/format/lib/document/blocks/general/Logos/meta.d.ts +11 -0
- package/dist/format/lib/document/blocks/general/Logos/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/ProcessSteps/meta.d.ts +4 -0
- package/dist/format/lib/document/blocks/general/ProcessSteps/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/ProcessSteps/row-seed.d.ts +11 -0
- package/dist/format/lib/document/blocks/general/ProcessSteps/row-seed.js +1 -0
- package/dist/format/lib/document/container-blocks.js +1 -1
- package/dist/format/lib/document/passes/document-position.d.ts +8 -0
- package/dist/format/lib/document/passes/document-position.js +1 -1
- package/dist/format/lib/document/row-hand.d.ts +5 -0
- package/dist/format/lib/document/row-hand.js +1 -0
- package/dist/format/lib/document/section-catalog.js +20 -2
- package/dist/format/lib/document/section-descriptions.js +1 -1
- package/dist/format/lib/document/seed-parts.d.ts +3 -0
- package/dist/format/lib/document/seed-parts.js +1 -1
- package/dist/format/lib/document/text-seeds.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +38 -1
- package/dist/format/lib/editor-words-catalogue.js +6 -6
- package/dist/format/lib/editor-words-kept.d.ts +1 -0
- package/dist/format/lib/editor-words-kept.js +1 -0
- package/dist/format/lib/fonts.js +1 -1
- package/dist/format/lib/sections/strip-shape.js +1 -1
- package/dist/format/lib/sections/ticker-join.d.ts +1 -0
- package/dist/format/lib/sections/ticker-join.js +1 -1
- package/dist/format/lib/source-rules/editor-words.js +2 -2
- package/dist/format/lib/theme.d.ts +1 -0
- package/dist/format/lib/theme.js +3 -3
- package/dist/render/components/CardRowContext.d.ts +8 -2
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/ClientRows.d.ts +8 -0
- package/dist/render/components/ClientRows.js +1 -0
- package/dist/render/components/Flex.d.ts +3 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Footprint.d.ts +4 -1
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -2
- package/dist/render/components/JoinBox.d.ts +4 -0
- package/dist/render/components/JoinBox.js +1 -0
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/Logos.d.ts +4 -2
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/MirrorContext.d.ts +12 -0
- package/dist/render/components/MirrorContext.js +1 -1
- package/dist/render/components/PartStyledKind.d.ts +2 -1
- package/dist/render/components/PartStyledKind.js +1 -1
- package/dist/render/components/PaymentBadges.js +1 -1
- package/dist/render/components/ProcessSteps.d.ts +5 -1
- package/dist/render/components/ProcessSteps.js +1 -1
- package/dist/render/components/Text.d.ts +3 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/components/TickerSection.js +1 -1
- package/dist/render/lib/content/box-shared-columns.d.ts +6 -0
- package/dist/render/lib/content/box-shared-columns.js +1 -1
- package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Eyebrow/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
- package/dist/render/lib/document/blocks/general/LogoBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ProcessSteps/render.d.ts +5 -0
- package/dist/render/lib/document/blocks/general/ProcessSteps/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Split/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.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +3 -0
- 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-docbody.js +2 -2
- 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-fitment.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-fitment.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-forms.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-forms.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.d.ts +2 -0
- 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-logos.d.ts +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.d.ts +1 -0
- 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.d.ts +5 -0
- 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-strip.d.ts +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/head-core-boxes.js +1 -1
- package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
- package/dist/render/lib/document/part-styles.d.ts +2 -0
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/box-join.d.ts +2 -0
- package/dist/render/lib/document/passes/box-join.js +1 -0
- package/dist/render/lib/document/passes/clickable-parts.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/document/text-parts.d.ts +2 -1
- package/dist/render/lib/document/text-parts.js +1 -1
- package/dist/render/lib/sections/card-list-style.d.ts +18 -0
- package/dist/render/lib/sections/card-list-style.js +1 -0
- package/dist/render/lib/sections/payment-rows.d.ts +16 -0
- package/dist/render/lib/sections/payment-rows.js +1 -0
- package/dist/render/lib/sections/section-to-box.d.ts +3 -0
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tabletKey as R}from"efficient-easel/draw";import{SECTION_WIDTH_KEYS as j}from"../../../../../format/lib/content/section-width.js";import{SECTION_BOX_SLOT as D,SECTION_BOX_TYPE as G}from"../../../sections/section-to-box.js";import{BUTTON as k,DIM as i,DROP_COMMON as W,DROP_SIDE_PADDING as v,INNER_BOX as o,SAME_KEYS as K,SECTION_BOX as f,SH_LINK as S,TEXT as p,bandAccent as X,bandIndex as $,bandPage as Y,bandProps as P,bandWrites as z,smallText as
|
|
1
|
+
import{tabletKey as R}from"efficient-easel/draw";import{SECTION_WIDTH_KEYS as j}from"../../../../../format/lib/content/section-width.js";import{SECTION_BOX_SLOT as D,SECTION_BOX_TYPE as G}from"../../../sections/section-to-box.js";import{BUTTON as k,DIM as i,DROP_COMMON as W,DROP_SIDE_PADDING as v,INNER_BOX as o,SAME_KEYS as K,SECTION_BOX as f,SH_LINK as S,TEXT as p,bandAccent as X,bandIndex as $,bandPage as Y,bandProps as P,bandWrites as z,smallText as c,wrapperPad as l}from"./section-to-box-row-parts.js";import{editorialHeadTree as U,token as d}from"./section-head-looks.js";import{boxPadding as m,labelStyle as F}from"../../../../../format/lib/document/seed-parts.js";import{readAnchorName as q}from"../../../../../format/lib/content/anchor-name.js";import{declaredBlockSource as x}from"../../../../../format/lib/content/block-sources.js";import{parseLocationTileShape as V,splitLegacyRegion as T}from"../../../../../format/lib/content/contact.js";import{groupColumns as g}from"../../../../../format/lib/locations-grid.js";import{phoneHref as J}from"../../../../../format/lib/links/phone-href.js";import{hasMapCoords as Q}from"../../../../../format/lib/map-styles.js";const r=e=>typeof e=="string"?e:e==null?"":String(e),h=e=>Array.isArray(e.locations)?e.locations.map(t=>t??{}):[],s=e=>r(e.group),w=e=>`loc-${e}`,B=e=>r(e.state).trim()||T(r(e.region)).state,O=e=>r(e.country).trim()||T(r(e.region)).country,_=e=>[B(e),O(e)].filter(Boolean).join(" · "),Z=e=>h(e).some(t=>r(t.photo).trim()!==""),ee=e=>h(e).some(t=>Q(Number(t.lat),Number(t.lng))),te=(e,t)=>h(e).filter(n=>s(n)===s(t)).length,oe=(e,t)=>te(e,t)===1?"wide":V(e.imageShape),y={top:100,bottom:100,topPhone:60,bottomPhone:60},N=48,a=(e,t={})=>({...F(e),...t}),u={top:1,right:1,bottom:1,left:1},b={...o,direction:"row",share:"equal",gap:0},ne=e=>t=>t>g(t)?{...o,gap:0}:{...b,...t>1?{phoneRow:e}:{}},re={kind:"group",name:"Gallery",props:{...o,gap:20,_hidden:!0},when:Z,parts:[{kind:"group",name:"Gallery head",props:{...o,direction:"row",justify:"between",align:"end",gap:24,share:"content",sectionBorder:{bottom:1},sectionPaddingBottom:16},parts:[c("galleryKicker",a(12,{color:"accent",letterSpacing:.3})),{kind:"text",key:"galleryHint",props:{...i,align:"right",alignPhone:"left"},style:a(11,{letterSpacing:.22,alignPhone:"left"})}]},{kind:"group",name:"Groups",props:{...o,gap:24},parts:[{kind:"list",key:"locations",name:"City picture",props:{...o,darken:85,darkenStyle:"bottom",placement:"bottom-left",sectionBorder:u,...m(12,12)},item:(e,t,n)=>({props:{...r(e.photo).trim()?{bgImage:r(e.photo),hover:"mono"}:{},link:`#${w(t)}`,boxShape:oe(n,e)}}),parts:[{kind:"text",key:"name",props:p,style:a(11,{letterSpacing:.22,color:"text"})}],groups:{of:s,name:"Group",props:{...o,gap:10},head:e=>({label:s(e[0]??{})}),parts:[c("label",a(11,{color:"accent",letterSpacing:.3}))],itemsName:"Cities",itemsProps:ne(2),perRow:g,rowName:"Row",rowProps:{...b,phoneRow:2}}}]}]},ae={kind:"group",name:"Words",props:{...o,gap:12,gapPhone:12,...m(28,28),sectionHeightMode:"fixed",sectionHeightValue:280,sectionHeightUnit:"px",sectionHeightModePhone:"auto"},parts:[{kind:"group",name:"Name row",props:{...o,direction:"row",justify:"between",align:"start",gap:14,share:"content",phoneRow:2,sharePhone:"content",wrapPhone:"wrap",sectionPaddingBottom:6,sectionPaddingBottomPhone:6},parts:[{kind:"group",name:"Name",props:{...o,gap:6,gapPhone:6},parts:[{kind:"text",key:"name",role:"heading",props:p,style:{textStyle:"heading-3",...d("headingSmall",30),case:"upper",weight:500,lineHeight:1,letterSpacing:-.02}},{kind:"block",type:"Text",props:{...p,_partStyles:{text:a(12,{color:"accent",letterSpacing:.24,lineHeight:1.5})}},box:["region","state","country"].map(e=>[e,"text",(t,n)=>_(n)]),when:(e,t)=>_(t??{})!==""}]},{kind:"group",name:"Time zone",props:{...o,sectionBorder:u,...m(6,10)},parts:[{kind:"text",key:"timezone",props:{...i,textFit:"line"},style:a(12,{letterSpacing:.22,lineHeight:1.5})}]}]},{kind:"text",key:"address",props:i,style:{textStyle:"body-5",fontRole:"heading",...d("body",14),lineHeight:1.5}},{kind:"block",type:"ButtonBlock",props:{...k,...S,variant:"ghost",arrow:!1,_partStyles:{label:a(13,{letterSpacing:.18,color:"text",lineHeight:24/13})}},box:[["phone","label"],["phone","href",e=>J(r(e))??"#"]],when:(e,t)=>r(t?.phone).trim()!==""},{kind:"text",key:"hours",props:i,style:a(12,{letterSpacing:.18,lineHeight:1.7})}]},ie={kind:"block",type:"LocationMap",props:e=>({mapTheme:typeof e.mapTheme=="string"?e.mapTheme:"auto"}),box:["name","lat","lng","mapsUrl","geocode",...["region","state"].map(e=>[e,"state",(t,n)=>B(n)]),...["region","country"].map(e=>[e,"country",(t,n)=>O(n)])]},se={kind:"group",name:"Map",props:{...o,sectionBorder:{top:1,right:0,bottom:0,left:0}},parts:[ie]},pe={kind:"list",key:"locations",name:"City",props:(e,t)=>({...o,gap:0,justify:"between",sectionBorder:u,jumpHighlight:!0,sectionAccent:$(e,t)>=0?Y(e.sectionAccent,t):-1}),item:(e,t)=>({props:{anchor:w(t)}}),parts:[ae,se],groups:{of:s,name:"Group",props:{...o,gap:20},head:e=>{const t=e[0]??{};return{key:s(t),groupName:r(t.groupName),count:`${e.length} location${e.length===1?"":"s"}`}},parts:[{kind:"group",name:"Group head",props:{...o,direction:"row",justify:"between",align:"end",gap:16,share:"content",sectionBorder:{bottom:1},sectionPaddingBottom:16},when:(e,t)=>r(t?.key).trim()!=="",parts:[c("key",a(13,{color:"accent",letterSpacing:.3})),{kind:"text",key:"groupName",role:"heading",props:p,style:{textStyle:"heading-3",...d("headingSmall",24),case:"upper",weight:500,letterSpacing:-.01}},{kind:"text",key:"count",props:i,style:a(12,{letterSpacing:.22})}]}],itemsName:"Cities",itemsProps:e=>({...b,columns:g(e),[R("columns")]:1})}},C=a(10,{letterSpacing:.25}),ce={kind:"block",type:G,props:{...o,name:"Credit",direction:"row",justify:"end",align:"center",gap:6,share:"content",wrap:!0},when:ee,slot:D,keepEmpty:!0,parts:[{kind:"block",type:"Text",props:{...i,text:"Location coordinates ©",_partStyles:{text:C}}},{kind:"block",type:"ButtonBlock",props:{...k,...S,variant:"ghost",arrow:!1,label:"OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright",_partStyles:{label:{...C,color:"labels"}}}}]},E=(e,t)=>Object.fromEntries(t.filter(n=>e[n]!==void 0).map(n=>[n,e[n]])),M=["sectionPaddingTop","sectionPaddingTopTablet","sectionPaddingTopPhone"],H=["sectionPaddingBottom","sectionPaddingBottomTablet","sectionPaddingBottomPhone"],A=e=>e.map(t=>[t,t,(n,L)=>l(L,y)[t]]),I=["sectionAccent","sectionAccent",X],le=["gridSpan","_hidden",...Object.values(j)],de={name:"City pictures",skip:e=>x(e)?`fed by the data source "${x(e)}": its cities are read as the page is served, not stored on the node`:void 0,boxProps:(e,t)=>({...f,direction:"column",gap:40,anchor:"studios",...E(l(e,y),M),sectionPaddingBottom:N,sectionPaddingBottomPhone:N,...P(e,t)}),box:[...K.filter(e=>e!=="sectionAccent"&&e!=="anchor"),I,["anchor","anchor",e=>q(e).trim()?e:"studios"],...A(M)],parts:[U("sectionNumber","heading","tagline"),re],also:[{name:"City maps",boxProps:(e,t)=>({...f,direction:"column",gap:40,sectionBorder:{bottom:1},sectionPaddingTop:0,sectionPaddingTopPhone:0,...E(l(e,y),H),...P(e,t)}),box:[...le,I,...A(H)],parts:[pe,ce]}],reads:{mapTheme:"City maps Box: each Map block's Map theme",imageShape:"City pictures Box: each picture Box's Box shape"},site:z,drop:{...W,...v,apiKey:"a stored Google Maps key from before the map needed none: the website's one map (components/SiteMap) takes no key, and a key is a credential, never page content",mapId:"a Google Maps style id from the same retired map: nothing in src/ reads it",gallery:"the retired separate tile list: the wall is derived from the cities (`components/ContactLocations`), nothing in src/ reads it",dataSource:"always empty here: a node fed by a source is skipped (see skip)"}},we={ContactLocations:de};export{we as LOCATIONS_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as
|
|
1
|
+
import{hasWords as n}from"../../../sections/section-to-box.js";import{DROP_COMMON as l,DROP_SIDE_PADDING as p,INNER_BOX as c,SAME_KEYS as g,SECTION_BOX as m,TEXT as a,smallText as P,wrapperPad as r,wrapperPadKeys as h}from"./section-to-box-row-parts.js";import{finiteNumber as _}from"../../../../../format/lib/finite-number.js";import{LOGOS_PH as S,logosScaffoldItems as k}from"../../../../../format/lib/document/blocks/general/Logos/meta.js";import{logosCardSeed as L}from"../../../../../format/lib/document/blocks/general/Logos/card-seed.js";import{BLOCK_SOURCE_OPTIONS_PROP as s,BLOCK_SOURCE_PROP as t}from"../../../../../format/lib/content/block-sources.js";import{CARD_TEMPLATE_SLOT as u}from"../../../../../format/lib/content/card-template.js";import{phoneKey as T}from"efficient-easel/draw";const O={contained:!1},b=(o,e)=>({logos:[{kind:"list",key:o,name:"Logo",flat:!0,parts:[{kind:"block",type:"LogoBlock",box:["src",[e,"alt"]],when:(w,d)=>n(d?.src)||n(d?.[e])}]}]}),i=o=>{const e=_(o.bandPadding)??40;return{top:e,bottom:e,topPhone:e,bottomPhone:e}},x={...P("heading",{color:"labels",letterSpacing:.2}),props:{...a,align:"center"}},E={name:"Logos",boxProps:o=>({...m,direction:"column",gap:32,...r(o,i(o))}),box:[...g,...h(i),["bandPadding","sectionPaddingTop",(o,e)=>r(e,i(e)).sectionPaddingTop]],parts:[x,{kind:"core",keep:["columns","logoHeight","grayscale"],rename:{logosPerRow:"columns"},props:O,slots:b("items","alt")}],drop:{...l,...p,contained:"the Box draws the site frame now; the Logos block inside it fills the Box's column (`contained: false`)",headPlacement:"a Logos band has no split head (not in SPLITTABLE_SECTIONS): no stored node can hold one, and the converted block stores own-box"}},f={top:24,bottom:24,topPhone:24,bottomPhone:24},B={name:"Payment Methods",boxProps:o=>({...m,direction:"column",...r(o,f)}),box:[...g,...h(f)],parts:[{kind:"group",name:"Methods",props:{...c,align:"center",gap:20,gapPhone:20,sectionBorder:{top:1,bottom:1},sectionPaddingTop:32,sectionPaddingBottom:32},parts:[{...P("heading",{color:"labels"}),props:{...a,align:"center"}},{kind:"core",keep:[],as:"Logos",derive:{reads:[t,s],props:o=>n(o[t])?{[t]:o[t],...o[s]!==void 0?{[s]:o[s]}:{}}:{}},props:{...O,look:"cards",grayscale:!1},slots:o=>({...b("badges","label"),...n(o[t])?{[u]:[L()]}:{}})},{kind:"group",name:"Reassurance",props:{...c,direction:"row",wrap:!0,justify:"center",gap:24,gapPhone:24,phoneRow:2,[T("share")]:"content"},parts:[{kind:"list",key:"assurances",name:"Line",flat:!0,parts:[{kind:"text",key:"text",props:{...a,align:"center"},style:{size:13,color:"labels",lineHeight:1.5}}]}]}]}],drop:{...l,...p,contained:"the Box draws the site frame now; the Logos block inside it fills the Box's column (`contained: false`)"}},K={Logos:E,PaymentBadges:B},G=()=>({heading:S.heading,items:k()});export{K as LOGOS_SECTION_TO_BOX,G as logosPressStarter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as p}from"../../../sections/section-to-box.js";import{BLOCK_WIDTH_LIMIT as
|
|
1
|
+
import{hasWords as p}from"../../../sections/section-to-box.js";import{BLOCK_WIDTH_LIMIT as A}from"efficient-easel/draw";import{fluidToken as C,token as o}from"./section-head-looks.js";import{STRIP_BOX as R}from"../../../../../format/lib/sections/strip-shape.js";import{PH as i}from"../../../../../format/lib/document/blocks/placeholders.js";import{DOC_MASTHEAD_PH as d}from"../../../../../format/lib/document/blocks/general/DocMasthead/meta.js";import{AUTO_COLUMN as s,BUTTON as W,DIM as v,DROP_COMMON as c,DROP_SIDE_PADDING as g,INNER_BOX as n,leadLine as f,RIGHT_WORDS as S,SAME_KEYS as h,SECTION_BOX as m,SH_LINK as U,smallText as r,TEXT as a,wrapperPad as b,wrapperPadKeys as u}from"./section-to-box-row-parts.js";const _={minWidth:A.min},w=(e,t,l)=>({...r(e,{...t,...S}),props:{...a,align:"right",...s,...l}}),T={top:1,bottom:0},k=(e,t,l,M)=>({kind:"group",name:e,props:{...n,sectionPaddingBottom:t,sectionPaddingBottomPhone:l},parts:[M]}),I={widthFit:"fill",..._},E={top:100,bottom:60,topPhone:60,bottomPhone:40},X={...o("label",13),letterSpacing:.22,lineHeight:1.8},O={textStyle:"heading-1",...C("headingLarge",56,8,128),case:"upper",weight:500,lineHeight:.88,letterSpacing:-.04},x=e=>e.titleLevel===2,G=()=>({name:"Page Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,E)}),box:[...h,...u(E)],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:O,mark:"accentItalic",when:e=>!x(e)},{kind:"text",key:"title",role:"heading",props:{...a,tag:"h2",...I},style:O,mark:"accentItalic",when:x},{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:[f("label","value",X,s)]}]}]},{kind:"group",name:"Deck",props:{...n,maxWidth:760,sectionBorder:T,sectionPaddingTop:28},parts:[{kind:"text",key:"deck",props:v,style:{textStyle:"body-1",fontRole:"accent",...o("body",22,19),italic:!0,lineHeight:1.5}}]}],drop:{...c,...g,titleLevel:"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"}}),ee=()=>({eyebrow:d.eyebrow,title:d.title.replace(/\*([^*]+)\*/g,"==$1=="),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},K={...o("label",13),letterSpacing:.18,lineHeight:1.8},H={...o("label",13),letterSpacing:.22,lineHeight:1.9},j=()=>({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:[f("lead","rest",K)]}]}]},{kind:"group",name:"Bottom",props:{...n,direction:"row",align:"start",justify:"between",gap:60,gapPhone:16,share:"content",sectionBorder:T,sectionPaddingTop:32},parts:[{kind:"text",key:"lead",props:{...a,maxWidth:720,..._},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:[w("text",{color:"labels",...H})]}]},w("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,N=(e,t)=>t!==void 0&&L(e).includes(t),Y=(e,t)=>N(e,t)&&!P(e,t)&&p(t?.href),F=()=>({name:"Breadcrumb",skip:e=>p(e.meta)?'a trailing note after "·" needs a second mark; none live':void 0,boxProps:e=>({...m,...R,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:Y,props:{...W,...U,icon:"none"},style:y},{...r("label",y),when:(e,t)=>N(e,t)&&!P(e,t)&&!p(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"}}),te={DocMasthead:G(),Masthead:j(),Breadcrumb:F()};export{te as PAGE_HEADER_SECTION_TO_BOX,ee as pageHeaderPressStarter};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type SectionToBoxRow } from "../../../sections/section-to-box.js";
|
|
2
|
+
import { type CardStyle } from "../../../sections/card-list-style.js";
|
|
3
|
+
import type { BlockSeed } from "../../../../../format/lib/document/seed-parts.js";
|
|
2
4
|
type Props = Record<string, unknown>;
|
|
3
5
|
export declare function figureWords(item: Props): string;
|
|
4
6
|
export declare const STATS_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
|
|
7
|
+
export declare function statsPressSeed(): Props;
|
|
8
|
+
export declare function statsSeedRows(): Props[];
|
|
9
|
+
export declare function statsBoxSeed(rows: readonly Props[], style: CardStyle, columns?: number): BlockSeed;
|
|
5
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as
|
|
1
|
+
import{phoneKey as D}from"efficient-easel/draw";import{newId as K}from"efficient-easel/data";import{COUNT_KEY_PROP as y}from"../../../../../format/lib/content/block-sources.js";import{resolveSectionBackground as _,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 u}from"../../../sections/section-to-box.js";import{DROP_COMMON as k,DROP_SIDE_PADDING as x,INNER_BOX as r,NUMBER_TEXT as h,SAME_KEYS as T,SECTION_BOX as O,TEXT as i,bandAccent as Y,bandProps as U,bandWrites as W,fillFrom as G,innerPad as X,innerPadKeys as $,smallText as g,wrapperPad as q,wrapperPadKeys as j}from"./section-to-box-row-parts.js";import{fluidToken as z,headTree as V,token as n}from"./section-head-looks.js";import{SECTION_BG_BUILT_IN as P}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{CARD_STYLES as s,CARD_STYLE_KEY as m}from"../../../sections/card-list-style.js";import{CARD_LIST_TYPE as J,CARD_TEMPLATE_SLOT as Q,cardListProps as Z}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 o}from"../../../../../format/lib/editor-words.js";const S=e=>typeof e=="string"?e.trim():"";function E(e){const t=`${S(e.prefix)}${S(e.value)}`,a=S(e.suffix);return e.emphasizeAll===!0?t?`==_${t}_==`:"":`${t}${a?`==_${a}_==`:""}`}const A={textStyle:"heading-2",...z("headingMedium",56,7,96),weight:500,case:"none",lineHeight:.9,letterSpacing:-.04},f={kind:"block",type:"Text",props:{...h,_partStyles:{text:A}},box:[["value","text",(e,t)=>E(t)]],when:(e,t)=>t!==void 0&&typeof t.value=="string"&&E(t)!==""},B=e=>u(e?.supSuffix),R={textStyle:"body-1",fontRole:"heading",...n("body",16),lineHeight:1.5,letterSpacing:-.01},C={color:"labels",...n("label",12),lineHeight:1.5,letterSpacing:.24},L={...r,direction:"row",align:"start",gap:32,gapPhone:32,share:"content",phoneRow:2,[D("share")]:"content"},N={textStyle:"body-5",...n("label",13),weight:500,color:"accent",letterSpacing:.18,lineHeight:1,padding:12},b=e=>_(e.background,P.StatsParagraph),p=e=>b(e)===M,w=e=>({...e,sectionAccent:e.sectionAccent??0}),ee=(e,t)=>p(e)?G("background")(e,t):{},te={name:"Stats with Text",skip:e=>b(e)&&b(e)!=="transparent"&&!p(e)?"it paints a colour of its own, not the section band":void 0,boxProps:(e,t)=>({...O,direction:"column",gap:60,gapPhone:60,sectionBorder:{bottom:1},...X(e,"StatsParagraph"),...p(e)?U(w(e),t):{}}),box:[...T.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,a)=>p(t)?Y(e,w(t),a):e],...$("StatsParagraph")],site:(e,t)=>p(e.props)?W({props:w(e.props)},t):[],parts:[V("StatsParagraph"),{kind:"group",name:"Stats",props:{...r,...s.table.grid,[m]:"table"},parts:[{kind:"list",key:"stats",name:"Stat",perRow:()=>4,rowName:"Stats row",rowProps:{...r,direction:"row",share:"equal",phoneRow:2,...s.table.row},props:(e,t)=>({...r,...s.table.card,...ee(e,t)}),parts:[{...f,when:(e,t)=>!B(t)&&f.when(e,t)},{kind:"group",name:"Figure",props:L,when:(e,t)=>B(t),parts:[f,{kind:"text",key:"supSuffix",props:i,style:N}]},{kind:"group",name:"Words",props:{...r,gap:4,gapPhone:4},parts:[{kind:"text",key:"label",props:i,style:R},g("sub",C)]}]}]}],drop:{...k,...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"}},oe=new Set(["value","label",y]),I={top:48,bottom:48,topPhone:48,bottomPhone:48},re=e=>{const t=_(typeof e.background=="string"?e.background:void 0,P.Stats);return!!t&&t!=="transparent"},ae={name:"Stats",skip:e=>re(e)?"it paints a colour inside its padding, and a Box paints its Fill over the padding too":u(e.dataSource)?"its figures come from a source":Array.isArray(e.items)&&e.items.some(t=>u(t?.[y]))?"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(a=>!oe.has(a)))?"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=>({...O,direction:"column",gap:24,gapPhone:24,...q(e,I)}),box:[...T,...j(I)],parts:[g("heading",{color:"labels",...n("label",12),letterSpacing:.2}),{kind:"group",name:"Stats",props:{...r,...s.list.grid,[m]:"list"},parts:[{kind:"list",key:"items",name:"Stat",perRow:e=>H(e.columns)??4,rowName:"Stats row",rowProps:{...r,direction:"row",share:"equal",phoneRow:2,...s.list.row},props:{...r,...s.list.card},parts:[{kind:"text",key:"value",props:h,style:{textStyle:"heading-2",...n("headingMedium",48,36),weight:500,case:"none",lineHeight:1,letterSpacing:-.03}},g("label",{color:"labels",...n("label",12),letterSpacing:.2})]}]}],drop:{...k,...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"}},_e={StatsParagraph:te,Stats:ae};function ke(){return{eyebrow:o("By the numbers"),title:o("What we count."),desc:o("A few numbers that matter to us."),stats:[],background:"transparent"}}const se=[{key:"figure",label:"Figure"},{key:"superscript",label:"Superscript"},{key:"label",label:"Label"},{key:"body",label:"Text",multiline:!0}];function xe(){const e=(t,a,F,v="")=>({key:K("stat"),figure:t,superscript:v,label:a,body:F});return[e("28==_yr_==",o("Years in business"),o("Privately held since day one. Same two founders.")),e("==_8_==",o("Operating footprint"),o("Los Angeles · Fort Lauderdale · Bewdley · Drachten · Mumbai · Selangor · Ho Chi Minh · Sydney. Three continents covered from one California design studio."),o("cities")),e("−21==_%_==",o("Avg. weight saving"),o("Versus OEM equivalents, across our forged catalog.")),e("14==_×_==",o("Finish steps"),o("Specified in California to a 14-step protocol. No two sets are identical."))]}function ne(e){return{type:d,props:{...r,name:"Card",...structuredClone(s[e].listCard)},slots:{[l]:[{type:d,props:{...L,name:"Figure"},slots:{[l]:[c("figure",h,A),c("superscript",i,N)]}},{type:d,props:{...r,name:"Words",gap:4,gapPhone:4},slots:{[l]:[c("label",{...i,widthFit:"fill"},R),c("body",{...i,widthFit:"fill"},C,!0)]}}]}}}function Te(e,t,a=4){return{type:d,props:{...r,name:"Stats",direction:"row",columns:a,...structuredClone(s[t].items),[m]:t},slots:{[l]:[{type:J,props:Z(e,se),slots:{[Q]:[ne(t)]}}]}}}export{_e as STATS_SECTION_TO_BOX,E as figureWords,Te as statsBoxSeed,ke as statsPressSeed,xe as statsSeedRows};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SectionToBoxRow } from "../../../sections/section-to-box.js";
|
|
2
2
|
export declare const STRIP_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mixHex as u}from"efficient-shell/format";import{resolveSectionAccent as r,SECTION_ACCENT_INHERIT as
|
|
1
|
+
import{mixHex as u}from"efficient-shell/format";import{resolveSectionAccent as r,SECTION_ACCENT_INHERIT as x}from"../../../../../format/lib/content/section-surface.js";import{parseLoopDirection as E}from"../../../../../format/lib/animation/index.js";import{parseTickerSeparator as i,SEPARATOR_GLYPH as A}from"../../../../../format/lib/sections/ticker-style.js";import{tickerJoinSide as y}from"../../../../../format/lib/sections/ticker-join.js";import{convertTheme as h}from"../../../sections/section-to-box.js";import{darkPresetIndex as C}from"../../../../../format/lib/theme.js";import{DIM as s,DROP_COMMON as l,DROP_SIDE_PADDING as a,fillFrom as R,SAME_KEYS as c,sectionPage as b,SECTION_BOX as p,TEXT as O,wrapperPad as d,wrapperPadKeys as m}from"./section-to-box-row-parts.js";import{SPEC_PAD as S,SPEC_STRIP as B,SPEC_TEXT as T,STRIP_BOX as _,TICKER_BARE_GAP as N,TICKER_DISPLAY as g,TICKER_PAD as f,TICKER_SMALL as K,TICKER_STRIP as M}from"../../../../../format/lib/sections/strip-shape.js";const I=e=>e.size==="display",w=(e,t)=>{const o=b(e,t),n=e.tone!=="plain"&&o?.text&&o.background?u(o.text,o.background,.3):null;return n?{color:n}:{}},L=(e,t)=>e.tone!=="plain"&&r(e.sectionAccent)===null?R("background")(e,t):{},P=(e,t)=>({kind:"list",key:"items",name:"Item",flat:!0,when:t,parts:[{kind:"text",key:"text",props:s,style:e,styleFrom:w}]}),X={name:"Scrolling Bar",boxProps:(e,t)=>({...p,..._,...M,...A[i(e.separator)]===""?N:{},...d(e,f),...L(e,t)}),box:[["scrollDirection","scrollDirection",e=>E(e)],["speed","loopDuration",(e,t)=>t.loopDuration!=null?t.loopDuration:e],["loopDuration","loopDuration",(e,t)=>e??t.speed],["loopDelay","loopDelay",e=>e],["separator","separator",e=>i(e)],["join","join",e=>y(e)??void 0],["borders","sectionBorder",e=>e===!1?void 0:{top:1,bottom:1}],...c,["tone","sectionAccent",(e,t)=>r(t.sectionAccent)??x],...m(f)],parts:[P(K,e=>!I(e)),P(g,I)],drop:{...l,...a,size:"each item's Text style: Small → Body 5, Display → Heading 3"}},k=e=>e?.tone==="muted",D=e=>C(h(e)?.themes),H={name:"Spec Strip",boxProps:(e,t)=>({...p,..._,...B,...e.fill==="none"?{sectionBorder:{top:1}}:{sectionAccent:D(t)},...d(e,S)}),box:[...c.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,o)=>t.fill==="none"?e:D(o)],...m(S)],parts:[{kind:"list",key:"cells",name:"Cell",flat:!0,parts:[{kind:"text",key:"text",props:O,style:T,when:(e,t)=>!k(t)},{kind:"text",key:"text",props:s,style:T,when:(e,t)=>k(t)}]}],drop:{...l,...a,fill:"None → no fill and a line on top. Dark band (the default) → the Box's theme is the site's first dark preset (lib/theme `darkPresetIndex`; Theme 2 with no site theme): the old fixed `plate-band` colour, as a theme"}},U={Ticker:X,SpecStrip:H};export{U as STRIP_SECTION_TO_BOX};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{resolveSectionBackground as
|
|
1
|
+
import{resolveSectionBackground as D,THEME_SECTION_BG as F}from"../../../../../format/lib/content/section-background.js";import{SECTION_BG_BUILT_IN as L}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{BUTTON as _,DIM as p,bandAccent as v,bandIndex as R,bandWrites as Y,fillNoBoxHolds as X,ownFill as j,DROP_COMMON as E,DROP_SIDE_PADDING as B,INNER_BOX as o,SAME_KEYS as P,SECTION_BOX as u,lineBorder as I,TEXT as c,innerPad as k,innerPadKeys as C}from"./section-to-box-row-parts.js";import{splitParagraphs as U}from"../../../../components/goldPhrases.js";import{TIMELINE_YEAR_BOX as G,TIMELINE_YEAR_HEAD as A}from"../../../../../format/lib/sections/timeline-year-shape.js";import{boxPadding as K,LABEL_FACE as V}from"../../../../../format/lib/document/seed-parts.js";const q="jetbrains-mono",H="space-grotesk",l=(e,t,n={})=>({textStyle:"body-5",font:q,size:e,sizePhone:e,letterSpacing:t,lineHeight:1.5,weight:400,...n}),i=(e,t,n={})=>({...l(e,t),...V,...n}),d=(e,t,n,s)=>({font:H,size:e,sizePhone:t,case:"upper",weight:500,letterSpacing:n,lineHeight:s}),a=(e,t,n,s={})=>({textStyle:"body-1",font:H,size:e,sizePhone:t,weight:400,case:"none",lineHeight:n,...s}),r=(e,t,n={})=>({kind:"text",key:e,props:c,style:t,...n}),N=(e,t)=>t?.future===!0,g=e=>U(typeof e?.body=="string"?e.body:""),y=e=>D(typeof e.background=="string"?e.background:void 0,L.TimelineTrack),b=e=>y(e)===F?e:{...e,background:"transparent"},z={name:"Milestone Timeline",skip:e=>X(y(e)),boxProps:(e,t)=>{const n=R(b(e),t);return{...u,direction:"column",gap:60,sectionBorder:{bottom:1},...k(e,"TimelineTrack"),...j(y(e),e,t),...n>=0?{sectionAccent:n}:{}}},box:[...P.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,n)=>v(e,b(t),n)],...C("TimelineTrack")],parts:[{kind:"group",name:"Heading",props:{...o,direction:"row",align:"end",justify:"between",gap:40,share:"content",sectionPaddingBottom:32,sectionBorder:{bottom:1}},parts:[{kind:"group",name:"Title",props:{...o,direction:"row",align:"end",gap:40,share:"content"},parts:[r("eyebrow",i(13,.3,{color:"accent",padding:8}),{role:"eyebrow"}),r("title",{textStyle:"heading-2",...d(79,40,-.03,1)},{role:"heading"})]},r("intro",a(14,14,1.5),{props:{...p,align:"right",maxWidth:360}})]},{kind:"group",name:"Years",props:{...o,direction:"row",share:"equal",gap:0,line:!0},parts:[{kind:"list",key:"entries",name:"Year",props:{...o,...G},item:e=>({props:e.future===!0?{upcoming:!0}:{}}),parts:[{kind:"group",name:A.name,props:{...o,...A},parts:[r("date",l(13,.22,{color:"accent"}),{when:(e,t)=>!N(e,t)}),r("date",l(13,.22,{color:"labels"}),{when:N}),r("title",{textStyle:"heading-3",...d(20,20,-.02,1.1)},{role:"heading"})]},r("blurb",a(13,13,1.55),{props:p})]}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:(e,t)=>({..._,align:"right",...I(e,t)}),style:i(13,.3)}],site:(e,t)=>Y({props:b(e.props)},t),drop:{...E,...B,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"}},w=e=>typeof e.layout=="string"?e.layout:"split",h=e=>w(e)==="split",x=e=>!h(e),O=e=>w(e)==="spine",J=e=>x(e)&&!O(e),M=(e,t,n,s)=>({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",...K(12,16),...n},when:m=>s(m)&&typeof m.imageSrc=="string"&&m.imageSrc.trim()!=="",parts:[{kind:"group",name:"Caption",props:{...o,direction:"row",justify:"between",align:"center",gap:12,share:"content",phoneRow:2},parts:[r("imageCaption",i(11,.24,{color:"text"})),r("imageMeta",i(11,.24,{color:"accent"}),{props:{...c,align:"right"}})]}]}),W=(e={})=>({kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:(t,n)=>({..._,...e,...I(t,n)}),style:i(13,.3)}),T=()=>[r("title",{textStyle:"heading-3",...d(24,20,-.02,1.5)},{role:"heading"}),{kind:"block",type:"Text",props:{...c,_partStyles:{text:a(17,16,1.6)}},box:[["body","text",(e,t)=>g(t)[0]??""]],when:(e,t)=>g(t).length>0},{kind:"block",type:"Text",props:{...p,_partStyles:{text:a(17,16,1.6,{paragraphSpacing:14})}},box:[["body","text",(e,t)=>g(t).slice(1).join(`
|
|
2
2
|
|
|
3
|
-
`)]],when:(e,t)=>
|
|
3
|
+
`)]],when:(e,t)=>g(t).length>1}],f=()=>r("date",l(13,.24,{color:"accent"})),S=(e,t,n={})=>r(e,t,{...n,props:{...c,...n.props??{},align:"center"}}),Q={name:"Story Timeline",skip:e=>w(e)==="track"?'display "track": not converted (it draws the Milestone rail; a Track story is not stored anywhere)':void 0,boxProps:e=>h(e)?{...u,direction:"row",share:[40],gap:80,align:"start",...k(e,"Timeline")}:{...u,direction:"column",gap:48,align:"center",...k(e,"Timeline")},box:[...P,...C("Timeline")],parts:[{kind:"group",name:"Heading",props:{...o,gap:24},when:h,parts:[r("eyebrow",i(12,.3,{color:"accent"}),{role:"eyebrow"}),r("title",{textStyle:"heading-2",...d(72,40,-.03,.94)},{role:"heading"}),r("intro",a(14,14,1.6),{props:{...p,maxWidth:360}}),M(667,419,{},()=>!0),W()]},{kind:"group",name:"Chapters",props:{...o,gap:48,line:!1},when:h,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,direction:"row",gap:24,share:[25],align:"start"},parts:[f(),{kind:"group",name:"Words",props:{...o,gap:14},parts:T()}]}]},{kind:"group",name:"Heading",props:{...o,gap:24,align:"center",maxWidth:760,widthFit:"fill"},when:x,parts:[S("eyebrow",i(12,.3,{color:"accent"}),{role:"eyebrow"}),S("title",{textStyle:"heading-2",...d(72,40,-.03,.94)},{role:"heading"}),S("intro",a(14,14,1.6),{props:{...p,maxWidth:520}}),W({align:"center"})]},M(506,192,{maxWidth:900,widthFit:"fill"},x),{kind:"group",name:"Chapters",props:{...o,gap:48,line:!0,maxWidth:760,widthFit:"fill",sectionPaddingTop:16},when:O,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,gap:8},parts:[f(),{kind:"group",name:"Words",props:{...o,gap:14},parts:T()}]}]},{kind:"group",name:"Chapters",props:{...o,gap:56,maxWidth:1e3,widthFit:"fill",sectionPaddingTop:16,mirrorCards:"even"},when:J,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,direction:"row",gap:64,share:[50],align:"start"},parts:[{kind:"group",name:"Entry",props:{...o,gap:8},parts:[f(),{kind:"group",name:"Words",props:{...o,gap:14},parts:T()}]},{kind:"group",name:"Spacer",props:{...o},keepEmpty:!0,parts:[]}]}]}],drop:{...E,...B,layout:"the Box's own arrangement replaces it: Split a row of two Boxes; Spine and Alternating a centred column (Track is skipped)"}},re={TimelineTrack:z,Timeline:Q};export{re as TIMELINE_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as v,registerSectionToBox as
|
|
1
|
+
import{hasWords as v,registerSectionToBox as t}from"../../../sections/section-to-box.js";import{BUTTON as m,DIM as g,DROP_COMMON as s,DROP_SIDE_PADDING as c,INNER_BOX as o,leadLine as A,SAME_KEYS as d,SECTION_BOX as p,lineBorder as C,TEXT as l,innerPad as O,siteGutterOf as H,innerPadKeys as T,smallText as u,wrapperPad as b,wrapperPadKeys as P}from"./section-to-box-row-parts.js";import{CARDS_SECTION_TO_BOX as R}from"./section-to-box-rows-cards.js";import{normalizeSiteGutterPhone as D,siteGutterPhoneFollows as L}from"../../../../../format/lib/content/page-width.js";import{finiteNumber as W}from"../../../../../format/lib/finite-number.js";import{STATS_SECTION_TO_BOX as X}from"./section-to-box-rows-stats.js";import{LOGOS_SECTION_TO_BOX as G}from"./section-to-box-rows-logos.js";import{STRIP_SECTION_TO_BOX as M}from"./section-to-box-rows-strip.js";import{TIMELINE_SECTION_TO_BOX as F}from"./section-to-box-rows-timeline.js";import{LOCATIONS_SECTION_TO_BOX as z}from"./section-to-box-rows-locations.js";import{HEAD_ONLY_SECTION_TO_BOX as K}from"./section-to-box-rows-head.js";import{PAGE_HEADER_SECTION_TO_BOX as U}from"./section-to-box-rows-pageheader.js";import{DOCBODY_SECTION_TO_BOX as Y}from"./section-to-box-rows-docbody.js";import{EDITORIAL_SECTION_TO_BOX as j}from"./section-to-box-rows-editorial.js";import{FORMS_SECTION_TO_BOX as q}from"./section-to-box-rows-forms.js";import{FITMENT_SECTION_TO_BOX as J}from"./section-to-box-rows-fitment.js";import{fluidToken as Q,headTree as S,token as r}from"./section-head-looks.js";import{boxPadding as V}from"../../../../../format/lib/document/seed-parts.js";const w={top:72,bottom:72,topPhone:72,bottomPhone:72},Z={name:"Editorial Text",boxProps:e=>({...p,direction:"column",gap:28,gapPhone:28,sectionBorder:{top:1},...b(e,w)}),box:[["topBorder","sectionBorder",e=>e===!1?void 0:{top:1}],...d,...P(w)],parts:[S("Prose"),{kind:"text",key:"body",props:g,style:{textStyle:"body-1",...r("body",16),lineHeight:1.7,paragraphSpacing:18}}],drop:{...s,...c,headPlacement:"needs a row per head placement: an own-box Prose draws no head (its words sit in a Section Header above it), the row always draws the head. 0 of 123 live nodes store it (the live export, 2026-10-24)"}},f={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},_=(e,n)=>n?.variant==="primary",k=(e,n)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:e,parts:[{kind:"button",key:"label",href:"href",when:_,variant:"primary",style:{letterSpacing:.3},props:{...m,...f,...n}},{kind:"button",key:"label",href:"href",when:(i,a)=>!_(i,a),variant:"ghost",style:{letterSpacing:.3},props:(i,a)=>({...m,...f,...n,...C(i,a)})}]}),h=e=>v(e.title),$={name:"Call-to-Action Heading",boxProps:e=>({...p,direction:"row",align:"center",justify:h(e)?"between":"end",gap:60,gapPhone:60,share:"content",sectionBorder:{bottom:1},...O(e,"TitleWithButtons")}),box:[...d,...T("TitleWithButtons")],parts:[{kind:"group",name:"Title",props:{...o,maxWidth:1e3,widthFitPhone:"fill"},parts:[{kind:"text",key:"title",role:"heading",props:l,style:{textStyle:"heading-1",...Q("headingLarge",48,7,108),case:"upper",lineHeight:.94,letterSpacing:-.035}}]},{kind:"group",name:"Buttons",props:e=>({...o,gap:14,gapPhone:14,widthFitPhone:"fill",...h(e)?{minWidth:280,minWidthPhone:0}:{}}),parts:[k(h,{widthFit:"fill",iconPosition:"end"}),k(e=>!h(e),{})]}],drop:{...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 ee(e){const{siteGutter:n,siteGutterPhone:i}=e.site??{},a=H(e),y=Math.min(20,D(i)??L(n));return{sectionPaddingLeft:a,sectionPaddingRight:a,sectionPaddingLeftPhone:y,sectionPaddingRightPhone:y}}const B={top:40,bottom:64,topPhone:24,bottomPhone:36},te={name:"Section Header",boxProps:(e,n)=>({...p,direction:"column",gap:0,...b(e,B),...ee(n)}),box:[...d,...P(B)],parts:[S("SectionHeader")],drop:{...s,...c,headStyle:"needs a row per head look: the row draws the standard look; the editorial, simple, statement, natural and essay looks are other layouts. 0 of 69 live nodes store it (the live export, 2026-10-24)",eyebrowLook:"read only by the simple, statement, natural and essay looks, which this row does not draw. 0 of 69 live nodes store it",rowGap:"read only by the natural look, which this row does not draw. 0 of 69 live nodes store it",descriptionSize:"read only by the natural look, which this row does not draw. 0 of 69 live nodes store it",numStyle:"Solid (the default; 4 of 69 live nodes store it) IS the eyebrow Text the row draws; Outlined (0 live) needs an outlined-number text look"}},x={...o,direction:"row",share:[67],gap:30},E={...o,sectionPaddingLeft:30,sectionPaddingLeftPhone:0},N=(e,n,i)=>({kind:"group",name:e,props:n,parts:[i]}),oe={name:"Lead Text",boxProps:e=>({...p,direction:"column",gap:40,gapPhone:40,sectionBorder:{bottom:1},...O(e,"ParagraphsA")}),box:[...d,...T("ParagraphsA")],parts:[{kind:"group",name:"Numbers",props:{...x,gapPhone:24,sectionBorder:{bottom:1},sectionPaddingBottom:40,sectionPaddingBottomPhone:40},parts:[{kind:"group",name:"Eyebrow",props:{...o,sectionPaddingTop:5,sectionPaddingBottom:1,sectionPaddingTopPhone:5,sectionPaddingBottomPhone:1},parts:[u("eyebrow",{color:"labels",...r("label",12),letterSpacing:.24})]},N("Stats column",o,{kind:"group",name:"Stats",props:{...E,gap:0,gapPhone:0},parts:[{kind:"list",key:"stats",name:"Stat",flat:!0,parts:[A("value","label",{...r("label",13),letterSpacing:.18,lineHeight:1.8})]}]})]},{kind:"group",name:"Words",props:{...x,gapPhone:28},parts:[{kind:"group",name:"Lead",props:o,parts:[{kind:"group",name:"Measure",props:{...o,maxWidth:780},parts:[{kind:"text",key:"lead",props:l,style:{textStyle:"heading-3",...r("headingSmall",22,20),weight:400,case:"none",lineHeight:1.45,letterSpacing:-.005}}]}]},N("Note column",{...o,justify:"end",widthFit:"fill"},{kind:"group",name:"Founders",props:{...E,gap:8,gapPhone:8},parts:[{kind:"group",name:"Note",props:{...o,gap:6,gapPhone:6},parts:[{kind:"text",key:"foundersHeading",props:l,style:{textStyle:"body-1",fontRole:"heading",...r("body",18,16),weight:500,letterSpacing:-.01,lineHeight:1.7}},{kind:"text",key:"foundersBody",props:g,style:{textStyle:"body-5",fontRole:"heading",...r("body",14,12),lineHeight:1.7}}]},u("attribution",{...r("label",12,10),letterSpacing:.24,lineHeight:1.7})]})]}],drop:{...s}},I={top:24,bottom:24,topPhone:24,bottomPhone:24},ne={name:"Banner",boxProps:e=>({...p,direction:"column",gap:0,...b(e,I)}),box:[...d,"contained",...P(I)],parts:[{kind:"group",name:"Card",keepEmpty:!0,props:{...o,gap:28,placement:"top-left",darken:60,darkenStyle:"even",sectionBorder:{width:1},...V(64,40,40,24)},box:[["imageSrc","bgImage"],["overlay","darken",e=>Math.min(Math.max(W(e)??60,0),100)]],parts:[{kind:"group",name:"Words",props:{...o,gap:20},parts:[u("eyebrow"),{kind:"text",key:"title",role:"heading",props:{...l,maxWidth:680},style:{weight:500,lineHeight:1.05,letterSpacing:-.03,case:"none"}},{kind:"text",key:"body",props:{...g,maxWidth:680},style:{textStyle:"body-1",lineHeight:1.6},was:{size:16}}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:m}]}],drop:{...s,...c}},ie={Prose:Z,TitleWithButtons:$,SectionHeader:te,ParagraphsA:oe,Banner:ne};function fe(){t(ie),t(X),t(G),t(R),t(M),t(F),t(z),t(K),t(U),t(Y),t(j),t(q),t(J)}export{ie as GENERAL_SECTION_TO_BOX,fe as registerGeneralSectionRows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNode as
|
|
1
|
+
import{isNode as O,isNodeList as i}from"efficient-easel/data";import{storedStepsShown as g}from"../../components/ProcessSteps.js";import{declaredBlockSource as x}from"../../../format/lib/content/block-sources.js";import{HEAD_CORE_PROP as k,HOLDS_HEAD_CORE_PROP as f}from"../content/empty-hides.js";import{parseSectionHeadPlacement as P}from"../../../format/lib/sections/section-head-placement.js";const c="Flex",E="Text",m=r=>Object.values(r??{}).filter(i),p=r=>P(r.props?.headPlacement)==="own-box",u=r=>r===void 0||Array.isArray(r)&&r.length===0;function l(r){return r.type===E?!0:r.type===c&&m(r.props).every(t=>t.every(l))}const S={ProcessSteps:r=>u(r.boxes)&&g(r.steps).length===0,Logos:r=>!x(r)&&u(r.logos)&&u(r.items)};function a(r){const t=m(r.props).flat();return t.some(p)&&t.every(o=>p(o)||l(o))}function y(r){const t={...r.props};for(const[o,s]of Object.entries(r.props??{}))!i(s)||!s.some(e=>O(e)&&p(e))||(t[o]=s.map(e=>{if(!p(e))return e;const n=S[String(e.type)]?.(e.props??{})===!0;return{...e,props:{...e.props,[k]:n?"empty":!0}}}));return{...r,props:t}}function A(r){const o=Object.entries(r.props??{}).filter(([,e])=>i(e)).filter(([,e])=>e.length>0);if(o.length!==1||o[0][1].length!==1)return null;const s=o[0][1][0];return s?.type===c&&s.props?{key:o[0][0],inner:s}:null}function B(r){if(r?.type!==c||!r.props)return r;if(a(r)){const o=y(r);return{...o,props:{...o.props,[f]:!0}}}const t=A(r);return!t||!a(t.inner)?r:{...r,props:{...r.props,[t.key]:[y(t.inner)],[f]:!0}}}function L(r){const t=r;if(!t||!Array.isArray(t.content))return r;let o=!1;const s=t.content.map(e=>{const n=B(e);return n!==e&&(o=!0),n});return o?{...t,content:s}:r}export{L as markHeadCoreBoxes};
|
|
@@ -12,8 +12,8 @@ export declare const VIDEO_FILE_LABEL = "Video file";
|
|
|
12
12
|
export declare const VIDEO_FILE_PROMPT = "Upload a video file";
|
|
13
13
|
export declare function forMediaType(type: "image" | "video", fallback: "image" | "video"): {
|
|
14
14
|
readonly field: "mediaType";
|
|
15
|
-
readonly is: "
|
|
16
|
-
readonly default: "
|
|
15
|
+
readonly is: "image" | "video";
|
|
16
|
+
readonly default: "image" | "video";
|
|
17
17
|
};
|
|
18
18
|
export declare const HERO_MEDIA_PART_TYPES: ReadonlySet<string>;
|
|
19
19
|
export declare function inPart<F extends object>(part: HeroMediaPart, field: F): F;
|
|
@@ -84,6 +84,7 @@ export type PartStyle = {
|
|
|
84
84
|
italic?: boolean;
|
|
85
85
|
sizePhone?: number;
|
|
86
86
|
sizeTablet?: number;
|
|
87
|
+
alignTablet?: PartAlign;
|
|
87
88
|
alignPhone?: PartAlign;
|
|
88
89
|
};
|
|
89
90
|
export type PartStyleBase = {
|
|
@@ -124,6 +125,7 @@ export declare function partSpacingOf(style: PartStyle): {
|
|
|
124
125
|
export declare const PART_PARAGRAPH_VAR = "--sf-part-para";
|
|
125
126
|
export declare function partPhoneDeclarations(style: PartStyle): Record<string, string>;
|
|
126
127
|
export declare function partTabletDeclarations(style: PartStyle): Record<string, string>;
|
|
128
|
+
export declare function partAlignFollowed(style: PartStyle, screen: PartScreen): PartAlign | undefined;
|
|
127
129
|
export type PartScreen = "desktop" | "tablet" | "mobile";
|
|
128
130
|
export declare function partStyleForScreen(style: PartStyle, screen: PartScreen): PartStyle;
|
|
129
131
|
export declare function partCanvasDeclarations(style: PartStyle, screen: PartScreen, options?: PartDeclarationOptions): Record<string, string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{textStyleCaseCss as J,textStyleCaseOfCss as Q}from"efficient-easel/draw";import{FONT_OPTIONS as tt,fontOption as et,fontRoleOf as z,SIZE_STEP_OF_ROLE as $}from"../../../format/lib/fonts.js";import{encodePartKey as nt}from"../../../format/lib/document/part-key.js";import{decodePartId as D,normalizePartText as O}from"./text-parts.js";import{partInkCss as ot}from"../../../format/lib/document/part-inks.js";import{regionStyle as rt}from"../../../format/lib/sections/text-regions.js";import{PHONE_MEDIA as it,TABLET_MEDIA as at,viewOverrides as st}from"../content/view-values.js";import{plainRecord as w,propsWithPartRecord as ft,readPartRecord as ct,readPartRecords as lt}from"../../../format/lib/document/part-records.js";const N="_partStyles",ut="data-sf-part-styled",v="data-sf-text-style",pt=/^(heading|body)-[1-7]$/;function m(t){return typeof t=="string"&&pt.test(t)}const C={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function dt(t){if(!t)return null;for(const[e,n]of Object.entries(C))if(n===t)return e;return null}function be(t){if(m(t.textStyle))return t.textStyle;const e=z(t.role);return e?C[e]:void 0}const xt=[400,500,600,700],_=["left","center","right","justify"],y=5,k=1e3,ht=-5,St=10,mt=0,gt=64,bt=2,W={size:{min:y,max:k,step:1},sizeTablet:{min:y,max:k,step:1},sizePhone:{min:y,max:k,step:1},padding:{min:mt,max:gt,step:bt}},Pt=.05,Tt=.01,Rt=["line","letter"],zt=.5,_t=2.5,At=-1,Et=1,$t=0,Ot=400,wt=[...new Set(Object.values($))];function Pe(t){return[`${t} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${t}:hover, ${t}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function Te(t){return lt(t,N)}function G(t,e){return ct(t,N,e)}function Re(t,e){return Object.values(G(t,e)).filter(n=>n!==void 0).length}function K(t,e,n){return ft(t,N,e,Nt(n).length?n:null)}function Nt(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function yt(t){return Rt.includes(t)}const T=(t,e,n)=>Math.min(n,Math.max(e,t));function kt(t,e){if(yt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:T(n,ht,St)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?b(T(n,zt,_t),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?b(T(n,At,Et),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:T(n,$t,Ot)}if(Object.hasOwn(W,t)){const{min:n,max:o}=W[t],r=Math.round(Number(e));return Number.isFinite(r)?T(r,n,o):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"||t==="fontRole"?z(e)?e:null:t==="sizeToken"?I(e)?e:null:t==="textStyle"?m(e)?e:null:t==="alignPhone"?_.includes(e)?e:null:e}const It=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function R(t){let e=null;const n=o=>{e??={...t},delete e[o]};for(const o of It){const r=t[o];r!==void 0&&!(typeof r=="number"&&Number.isFinite(r))&&n(o)}return t.align!==void 0&&!_.includes(t.align)&&n("align"),t.alignPhone!==void 0&&!_.includes(t.alignPhone)&&n("alignPhone"),t.textStyle!==void 0&&!m(t.textStyle)&&n("textStyle"),t.sizeToken!==void 0&&!I(t.sizeToken)&&n("sizeToken"),t.fontRole!==void 0&&!z(t.fontRole)&&n("fontRole"),e??t}function I(t){if(!t||typeof t!="object")return!1;const{step:e,px:n,stepPhone:o,pxPhone:r,fluid:i}=t,s=a=>typeof a=="number"&&Number.isFinite(a)&&a>0,f=a=>typeof a=="string"&&wt.includes(a);return f(e)&&s(n)&&(o===void 0||f(o))&&(r===void 0||s(r))&&(i===void 0||Ft(i,n))}function Ft(t,e){if(!t||typeof t!="object"||Array.isArray(t))return!1;const{minPx:n,vw:o,...r}=t;return Object.keys(r).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<e&&typeof o=="number"&&Number.isFinite(o)&&o>0&&o<=100}function F(t){return t?.pxPhone&&I(t)?{step:t.stepPhone??t.step,px:t.pxPhone}:null}function B({step:t,px:e,fluid:n}){const o=n?`clamp(${n.minPx}px, ${n.vw}vw, ${e}px)`:`${e}px`,r=`var(--size-${t}, ${o})`;return t.startsWith("heading")?`min(${r}, var(--sf-heading-max,9999px))`:r}const Mt=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Lt(t){const e=[];for(const[n,o]of Mt)n===t?e.push(o):o===t&&e.push(n);return e}function ze(t,e,n,o){const r={...G(t,e)},i=o==null?null:kt(n,o);if(i===null)delete r[n];else{r[n]=i;for(const s of Lt(n))delete r[s]}return K(t,e,r)}function _e(t,e){return K(t,e,{})}function jt(t){return Q(t)??"none"}function Ht(t){return J(t)??""}const X={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function Dt(t,e){const n=z(t.role);return n||(e?.blockDrawsStyle?null:dt(t.textStyle))}function Ae(t,e){return t==="Text"&&e==="text"}const vt={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Ct(t){const e=$[t],n=vt[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function Wt(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=b(Gt+t.line*Pt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=b(t.letter*Tt,4)),e}const Gt=1,g="--sf-part-para";function Kt(t){t=R(t);const e={};if(typeof t.sizePhone=="number"&&t.sizePhone>0)e.fontSize=`${t.sizePhone}px`;else{const n=F(t.sizeToken);if(n)e.fontSize=B(n);else{const o=A(t);o!==void 0&&(e.fontSize=`${o}px`)}}return t.alignPhone&&(e.textAlign=t.alignPhone),e}function A(t){const e=st("textSize",t.size,t.sizeTablet,void 0).tablet;return e&&e>0?e:void 0}function Bt(t){const e=A(R(t));return e===void 0?{}:{fontSize:`${e}px`}}function Xt(t,e){if(e==="desktop")return t;const n=R(t),o=A(n);if(e==="tablet")return o===void 0?t:{...t,size:o};let r=t;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone};else{const i=F(n.sizeToken);i?r={...r,size:void 0,sizeToken:i}:o!==void 0&&(r={...r,size:o})}return n.alignPhone&&(r={...r,align:n.alignPhone}),r}function M(t,e,n){return L(Xt(t,e),E,n)}function Ut(t){return t==="mobile"?"sizePhone":t==="tablet"?"sizeTablet":"size"}function Ee(t,e){if(e==="desktop")return null;const n=R(t);if(e==="mobile"){if(F(n.sizeToken))return null;const o=A(n);if(o!==void 0)return{px:o,view:"tablet"}}return typeof n.size=="number"&&n.size>0?{px:n.size,view:"desktop"}:null}function U(t,e){const n=Ut(e);if(!Object.hasOwn(t,n))return t;const o={...t};return delete o[n],o}function $e(t,e,n){const o=M(U(t,e),e,n);return{fontFamily:o.fontFamily,fontSize:o.fontSize}}function L(t,e,n){t=R(t);const o=Dt(t,n),r=Wt(t),i=t.size?`${t.size}px`:t.sizeToken?B(t.sizeToken):o?Ct(o):"";return{fontFamily:t.font?qt(t.font):t.fontRole?`var(${X[t.fontRole]})`:o?`var(${X[o]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:r.lineHeight!==void 0?String(r.lineHeight):"",letterSpacing:r.letterSpacingEm!==void 0?`${r.letterSpacingEm}em`:"",[g]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:Ht(t.case),textAlign:t.align??"",paddingTop:V(t.padding),paddingBottom:V(t.padding),color:Vt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const Vt=t=>ot(t),V=t=>t===void 0?"":`${t}px`,b=(t,e)=>Number(t.toFixed(e));function Oe(t,e){const n=Number.parseFloat(t.fontSize)||16,o=Number.parseFloat(t.lineHeight),r=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop);return{fontKey:e,sizePx:n,weight:Yt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(o)?b(o/n,3):1.2,letterEm:Number.isFinite(r)?b(r/n,4):0,align:Zt(t.textAlign),case:jt(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0}}function Yt(t){return Number.isFinite(t)?xt.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function Zt(t){for(const e of _)if(e===t)return e;return t==="end"?"right":"left"}function we(t,e){const n=Y(t);if(!n)return"";for(const o of tt)if(Y(e(o.cssVar))===n)return o.key;return""}const Y=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function qt(t){const e=et(t);return e?`var(${e.cssVar})`:""}function Ne(t,e,n,o){return!e||D(e)?.nodeId!==t?null:n.find(i=>o(i.getAttribute("class")))??n[0]??null}function Jt(t,e){return Object.hasOwn(t,e)?w(t[e])??{}:{}}function ye(t,e,n=()=>E,o=f=>f,r=ee,i="desktop",s=()=>!1){let f=0;for(const{element:a,partId:u}of t){const c=D(u)?.propKey;if(!c)continue;const p=Jt(e,o(c)),x=M(p,i,{blockDrawsStyle:s(c)});m(p.textStyle)?a.setAttribute?.(v,p.textStyle):a.removeAttribute?.(v);const d=H.some(h=>a.style[h]);let l=!1;for(const[h,S]of Object.entries(x))re(a,h,S),S&&(l=!0);if(d||H.some(h=>x[h]))for(const h of Qt(a,r))for(const S of H)h.style[S]=x[S]??"";l&&(f+=1)}return f}function Qt(t,e){const n=O(t.textContent??""),o=[];let r=t;for(let i=0;i<te&&e(r);i+=1){const s=r.parentElement;if(!s||O(s.textContent??"")!==n)break;o.push(s),r=s}return o}const te=8;function ee(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const E={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function ne(t){if(!t||typeof t!="object")return null;const e={};return m(t.textStyle)&&(e.textStyle=t.textStyle),typeof t.size=="number"&&t.size>0&&(e.size=t.size),typeof t.sizeTablet=="number"&&t.sizeTablet>0&&(e.sizeTablet=t.sizeTablet),typeof t.sizePhone=="number"&&t.sizePhone>0&&(e.sizePhone=t.sizePhone),Object.keys(e).length?e:null}function oe(t,e){const n=ne(t);if(!n)return{};const o=M(n,e);return{...o.fontFamily?{fontFamily:o.fontFamily}:{},...o.fontSize?{fontSize:o.fontSize}:{}}}function ke(t){return m(t?.textStyle)||!!t?.role||typeof t?.size=="number"&&t.size>0}function Ie(t,e,n){if(!t||typeof t!="object")return{};const o=rt(t.role,e,$)??{},r=e.sized?oe(U(t,n),n):{};return{...o,...r}}function Fe(t,e,n){n.fontFamily&&t.fontFamily===n.fontFamily&&(t.fontFamily=e.fontFamily),n.fontSize&&t.fontSize===n.fontSize&&(t.fontSize=e.fontSize)}function re(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const o=t.style;typeof o.setProperty=="function"?n?o.setProperty(e,n):o.removeProperty?.(e):o[e]=n;const r=t;e===g&&(n?r.setAttribute?.(Z,""):r.removeAttribute?.(Z))}const Z="data-sf-part-para",ie=Object.keys(L({},E)),j=new Set(["color","overflowWrap",g,"fontStyle"]),H=ie.filter(t=>!j.has(t));function Me(t,e,n,o=f=>f,r=()=>!1,i=()=>null,s=[]){const f=new Map;for(const c of t){const p=nt(c.key,c.row);for(const x of c.texts){const d=f.get(x);d?(d.keys.add(c.key),d.partKeys.add(p)):f.set(x,{keys:new Set([c.key]),partKeys:new Set([p])})}}const a=new Map;for(const c of new Set([...Object.keys(e),...s])){if(!ae(c))continue;const p=q(n,c,w(e[c])??{},!1,i(c));p&&a.set(c,p)}const u=new Map;for(const[c,{keys:p,partKeys:x}]of f){const d=x.size===1?[...x][0]:p.size===1?[...p][0]:null;if(!d)continue;const l=o(d),P=i(l);if(!Object.hasOwn(e,l)&&!P)continue;const h=w(e[l])??{},S=q(n,d,h,r(d),P);S&&u.set(c,S)}return u.size||a.size?{rules:u,kindRules:a,drawn:new Set(f.keys())}:null}function q(t,e,n,o,r){const i=L(n,E,{blockDrawsStyle:o}),s=Bt(n),f=Kt(n),a=m(n.textStyle)?n.textStyle:void 0;return!Object.values(i).some(Boolean)&&!Object.keys(s).length&&!Object.keys(f).length&&!a&&!r?null:{stamp:se(t,e),declarations:i,...Object.keys(s).length?{tablet:s}:{},...Object.keys(f).length?{phone:f}:{},...a?{textStyle:a}:{},...r?{motion:r}:{}}}function ae(t){return t.startsWith("@")}function Le(t,e){return t?.kindRules.get(e)??null}function se(t,e){const n=o=>o.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function je(t){const e=[],n=new Set,o=r=>{const{stamp:i,declarations:s}=r;if(n.has(i))return;n.add(i);const f=Object.entries(s).filter(([,l])=>l!==""),a=l=>l.map(([P,h])=>`${ce(P)}: ${h}`).join("; "),u=`[${ut}="${i}"]`,c=f.filter(([l])=>!j.has(l)),p=f.filter(([l])=>j.has(l));c.length&&e.push(`${u}, *:has(> ${u}) { ${a(c)} }`),p.length&&e.push(`${u} { ${a(p)} }`),s[g]&&(e.push(`*:has(> ${u}) { ${g}: ${s[g]} }`),e.push(...fe(u,`*:has(> ${u})`)));const x=Object.entries(r.tablet??{}).filter(([,l])=>l!=="");x.length&&e.push(`@media ${at} { ${u}, *:has(> ${u}) { ${a(x)} } }`);const d=Object.entries(r.phone??{}).filter(([,l])=>l!=="");d.length&&e.push(`@media ${it} { ${u}, *:has(> ${u}) { ${a(d)} } }`)};for(const r of t.rules.values())o(r);for(const r of t.kindRules.values())o(r);return e.join(`
|
|
2
|
-
`)}function
|
|
1
|
+
import{textStyleCaseCss as tt,textStyleCaseOfCss as et}from"efficient-easel/draw";import{FONT_OPTIONS as nt,fontOption as ot,fontRoleOf as A,SIZE_STEP_OF_ROLE as w}from"../../../format/lib/fonts.js";import{encodePartKey as v}from"../../../format/lib/document/part-key.js";import{decodePartId as C,normalizePartText as O}from"./text-parts.js";import{partInkCss as rt}from"../../../format/lib/document/part-inks.js";import{regionStyle as it}from"../../../format/lib/sections/text-regions.js";import{PHONE_MEDIA as at,TABLET_MEDIA as st,viewOverrides as ft}from"../content/view-values.js";import{plainRecord as N,propsWithPartRecord as lt,readPartRecord as ct,readPartRecords as ut}from"../../../format/lib/document/part-records.js";const k="_partStyles",pt="data-sf-part-styled",W="data-sf-text-style",dt=/^(heading|body)-[1-7]$/;function h(t){return typeof t=="string"&&dt.test(t)}const G={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function xt(t){if(!t)return null;for(const[e,n]of Object.entries(G))if(n===t)return e;return null}function Pe(t){if(h(t.textStyle))return t.textStyle;const e=A(t.role);return e?G[e]:void 0}const gt=[400,500,600,700],R=["left","center","right","justify"],y=5,F=1e3,ht=-5,St=10,mt=0,bt=64,Pt=2,B={size:{min:y,max:F,step:1},sizeTablet:{min:y,max:F,step:1},sizePhone:{min:y,max:F,step:1},padding:{min:mt,max:bt,step:Pt}},Tt=.05,Rt=.01,zt=["line","letter"],At=.5,_t=2.5,Et=-1,$t=1,wt=0,Ot=400,Nt=[...new Set(Object.values(w))];function Te(t){return[`${t} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${t}:hover, ${t}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function Re(t){return ut(t,k)}function K(t,e){return ct(t,k,e)}function ze(t,e){return Object.values(K(t,e)).filter(n=>n!==void 0).length}function X(t,e,n){return lt(t,k,e,kt(n).length?n:null)}function kt(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function yt(t){return zt.includes(t)}const z=(t,e,n)=>Math.min(n,Math.max(e,t));function Ft(t,e){if(yt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:z(n,ht,St)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?b(z(n,At,_t),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?b(z(n,Et,$t),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:z(n,wt,Ot)}if(Object.hasOwn(B,t)){const{min:n,max:o}=B[t],r=Math.round(Number(e));return Number.isFinite(r)?z(r,n,o):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"||t==="fontRole"?A(e)?e:null:t==="sizeToken"?I(e)?e:null:t==="textStyle"?h(e)?e:null:t==="alignPhone"||t==="alignTablet"?R.includes(e)?e:null:e}const It=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function m(t){let e=null;const n=o=>{e??={...t},delete e[o]};for(const o of It){const r=t[o];r!==void 0&&!(typeof r=="number"&&Number.isFinite(r))&&n(o)}return t.align!==void 0&&!R.includes(t.align)&&n("align"),t.alignTablet!==void 0&&!R.includes(t.alignTablet)&&n("alignTablet"),t.alignPhone!==void 0&&!R.includes(t.alignPhone)&&n("alignPhone"),t.textStyle!==void 0&&!h(t.textStyle)&&n("textStyle"),t.sizeToken!==void 0&&!I(t.sizeToken)&&n("sizeToken"),t.fontRole!==void 0&&!A(t.fontRole)&&n("fontRole"),e??t}function I(t){if(!t||typeof t!="object")return!1;const{step:e,px:n,stepPhone:o,pxPhone:r,fluid:i}=t,f=l=>typeof l=="number"&&Number.isFinite(l)&&l>0,a=l=>typeof l=="string"&&Nt.includes(l);return a(e)&&f(n)&&(o===void 0||a(o))&&(r===void 0||f(r))&&(i===void 0||Mt(i,n))}function Mt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return!1;const{minPx:n,vw:o,...r}=t;return Object.keys(r).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<e&&typeof o=="number"&&Number.isFinite(o)&&o>0&&o<=100}function M(t){return t?.pxPhone&&I(t)?{step:t.stepPhone??t.step,px:t.pxPhone}:null}function U({step:t,px:e,fluid:n}){const o=n?`clamp(${n.minPx}px, ${n.vw}vw, ${e}px)`:`${e}px`,r=`var(--size-${t}, ${o})`;return t.startsWith("heading")?`min(${r}, var(--sf-heading-max,9999px))`:r}const Lt=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function jt(t){const e=[];for(const[n,o]of Lt)n===t?e.push(o):o===t&&e.push(n);return e}function Ae(t,e,n,o){const r={...K(t,e)},i=o==null?null:Ft(n,o);if(i===null)delete r[n];else{r[n]=i;for(const f of jt(n))delete r[f]}return X(t,e,r)}function _e(t,e){return X(t,e,{})}function Ht(t){return et(t)??"none"}function Dt(t){return tt(t)??""}const V={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function vt(t,e){const n=A(t.role);return n||(e?.blockDrawsStyle?null:xt(t.textStyle))}function Ee(t,e){return t==="Text"&&e==="text"}const Ct={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Wt(t){const e=w[t],n=Ct[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function Gt(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=b(Bt+t.line*Tt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=b(t.letter*Rt,4)),e}const Bt=1,S="--sf-part-para";function Kt(t){t=m(t);const e={};if(typeof t.sizePhone=="number"&&t.sizePhone>0)e.fontSize=`${t.sizePhone}px`;else{const o=M(t.sizeToken);if(o)e.fontSize=U(o);else{const r=E(t);r!==void 0&&(e.fontSize=`${r}px`)}}const n=t.alignPhone??_(t);return n&&(e.textAlign=n),e}function _(t){return t.alignTablet&&t.alignTablet!==t.align?t.alignTablet:void 0}function E(t){const e=ft("textSize",t.size,t.sizeTablet,void 0).tablet;return e&&e>0?e:void 0}function Xt(t){const e=m(t),n={},o=E(e);o!==void 0&&(n.fontSize=`${o}px`);const r=_(e);return r&&(n.textAlign=r),n}function $e(t,e){if(e==="desktop")return;const n=m(t);return(e==="mobile"?_(n):void 0)??n.align}function Ut(t,e){if(e==="desktop")return t;const n=m(t),o=E(n),r=_(n);if(e==="tablet"){let a=t;return o!==void 0&&(a={...a,size:o}),r&&(a={...a,align:r}),a}let i=t;if(typeof n.sizePhone=="number"&&n.sizePhone>0)i={...i,size:n.sizePhone};else{const a=M(n.sizeToken);a?i={...i,size:void 0,sizeToken:a}:o!==void 0&&(i={...i,size:o})}const f=n.alignPhone??r;return f&&(i={...i,align:f}),i}function L(t,e,n){return j(Ut(t,e),$,n)}function Vt(t){return t==="mobile"?"sizePhone":t==="tablet"?"sizeTablet":"size"}function we(t,e){if(e==="desktop")return null;const n=m(t);if(e==="mobile"){if(M(n.sizeToken))return null;const o=E(n);if(o!==void 0)return{px:o,view:"tablet"}}return typeof n.size=="number"&&n.size>0?{px:n.size,view:"desktop"}:null}function Y(t,e){const n=Vt(e);if(!Object.hasOwn(t,n))return t;const o={...t};return delete o[n],o}function Oe(t,e,n){const o=L(Y(t,e),e,n);return{fontFamily:o.fontFamily,fontSize:o.fontSize}}function j(t,e,n){t=m(t);const o=vt(t,n),r=Gt(t),i=t.size?`${t.size}px`:t.sizeToken?U(t.sizeToken):o?Wt(o):"";return{fontFamily:t.font?Jt(t.font):t.fontRole?`var(${V[t.fontRole]})`:o?`var(${V[o]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:r.lineHeight!==void 0?String(r.lineHeight):"",letterSpacing:r.letterSpacingEm!==void 0?`${r.letterSpacingEm}em`:"",[S]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:Dt(t.case),textAlign:t.align??"",paddingTop:Z(t.padding),paddingBottom:Z(t.padding),color:Yt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const Yt=t=>rt(t),Z=t=>t===void 0?"":`${t}px`,b=(t,e)=>Number(t.toFixed(e));function Ne(t,e){const n=Number.parseFloat(t.fontSize)||16,o=Number.parseFloat(t.lineHeight),r=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop);return{fontKey:e,sizePx:n,weight:Zt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(o)?b(o/n,3):1.2,letterEm:Number.isFinite(r)?b(r/n,4):0,align:qt(t.textAlign),case:Ht(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0}}function Zt(t){return Number.isFinite(t)?gt.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function qt(t){for(const e of R)if(e===t)return e;return t==="end"?"right":"left"}function ke(t,e){const n=q(t);if(!n)return"";for(const o of nt)if(q(e(o.cssVar))===n)return o.key;return""}const q=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function Jt(t){const e=ot(t);return e?`var(${e.cssVar})`:""}function ye(t,e,n,o){return!e||C(e)?.nodeId!==t?null:n.find(i=>o(i.getAttribute("class")))??n[0]??null}function Qt(t,e){return Object.hasOwn(t,e)?N(t[e])??{}:{}}function Fe(t,e,n=()=>$,o=a=>a,r=ne,i="desktop",f=()=>!1){let a=0;for(const{element:l,partId:p}of t){const x=C(p)?.propKey;if(!x)continue;const s=Qt(e,o(x)),u=L(s,i,{blockDrawsStyle:f(x)});h(s.textStyle)?l.setAttribute?.(W,s.textStyle):l.removeAttribute?.(W);const d=D.some(g=>l.style[g]);let c=!1;for(const[g,T]of Object.entries(u))ie(l,g,T),T&&(c=!0);if(d||D.some(g=>u[g]))for(const g of te(l,r))for(const T of D)g.style[T]=u[T]??"";c&&(a+=1)}return a}function te(t,e){const n=O(t.textContent??""),o=[];let r=t;for(let i=0;i<ee&&e(r);i+=1){const f=r.parentElement;if(!f||O(f.textContent??"")!==n)break;o.push(f),r=f}return o}const ee=8;function ne(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const $={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function oe(t){if(!t||typeof t!="object")return null;const e={};return h(t.textStyle)&&(e.textStyle=t.textStyle),typeof t.size=="number"&&t.size>0&&(e.size=t.size),typeof t.sizeTablet=="number"&&t.sizeTablet>0&&(e.sizeTablet=t.sizeTablet),typeof t.sizePhone=="number"&&t.sizePhone>0&&(e.sizePhone=t.sizePhone),Object.keys(e).length?e:null}function re(t,e){const n=oe(t);if(!n)return{};const o=L(n,e);return{...o.fontFamily?{fontFamily:o.fontFamily}:{},...o.fontSize?{fontSize:o.fontSize}:{}}}function Ie(t){return h(t?.textStyle)||!!t?.role||typeof t?.size=="number"&&t.size>0}function Me(t,e,n){if(!t||typeof t!="object")return{};const o=it(t.role,e,w)??{},r=e.sized?re(Y(t,n),n):{};return{...o,...r}}function Le(t,e,n){n.fontFamily&&t.fontFamily===n.fontFamily&&(t.fontFamily=e.fontFamily),n.fontSize&&t.fontSize===n.fontSize&&(t.fontSize=e.fontSize)}function ie(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const o=t.style;typeof o.setProperty=="function"?n?o.setProperty(e,n):o.removeProperty?.(e):o[e]=n;const r=t;e===S&&(n?r.setAttribute?.(J,""):r.removeAttribute?.(J))}const J="data-sf-part-para",ae=Object.keys(j({},$)),H=new Set(["color","overflowWrap",S,"fontStyle"]),D=ae.filter(t=>!H.has(t));function je(t,e,n,o=a=>a,r=()=>!1,i=()=>null,f=[]){const a=new Map;for(const s of t){const u=v(s.key,s.row);for(const d of s.texts){const c=a.get(d);c?(c.keys.add(s.key),c.partKeys.add(u)):a.set(d,{keys:new Set([s.key]),partKeys:new Set([u])})}}const l=new Map;for(const s of new Set([...Object.keys(e),...f])){if(!se(s))continue;const u=Q(n,s,N(e[s])??{},!1,i(s));u&&l.set(s,u)}const p=s=>{const u=o(s),d=i(u);if(!Object.hasOwn(e,u)&&!d)return null;const c=N(e[u])??{};return Q(n,s,c,r(s),d)},x=new Map;for(const[s,{keys:u,partKeys:d}]of a){const c=d.size===1?[...d][0]:u.size===1?[...u][0]:null;if(!c)continue;const P=p(c);P&&x.set(s,P)}for(const s of t){if(!s.keyed)continue;const u=p(v(s.key,s.row));u&&l.set(s.key,u)}return x.size||l.size?{rules:x,kindRules:l,drawn:new Set(a.keys())}:null}function Q(t,e,n,o,r){const i=j(n,$,{blockDrawsStyle:o}),f=Xt(n),a=Kt(n),l=h(n.textStyle)?n.textStyle:void 0;return!Object.values(i).some(Boolean)&&!Object.keys(f).length&&!Object.keys(a).length&&!l&&!r?null:{stamp:fe(t,e),declarations:i,...Object.keys(f).length?{tablet:f}:{},...Object.keys(a).length?{phone:a}:{},...l?{textStyle:l}:{},...r?{motion:r}:{}}}function se(t){return t.startsWith("@")}function He(t,e){return t?.kindRules.get(e)??null}function fe(t,e){const n=o=>o.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function De(t){const e=[],n=new Set,o=r=>{const{stamp:i,declarations:f}=r;if(n.has(i))return;n.add(i);const a=Object.entries(f).filter(([,c])=>c!==""),l=c=>c.map(([P,g])=>`${ce(P)}: ${g}`).join("; "),p=`[${pt}="${i}"]`,x=a.filter(([c])=>!H.has(c)),s=a.filter(([c])=>H.has(c));x.length&&e.push(`${p}, *:has(> ${p}) { ${l(x)} }`),s.length&&e.push(`${p} { ${l(s)} }`),f[S]&&(e.push(`*:has(> ${p}) { ${S}: ${f[S]} }`),e.push(...le(p,`*:has(> ${p})`)));const u=Object.entries(r.tablet??{}).filter(([,c])=>c!=="");u.length&&e.push(`@media ${st} { ${p}, *:has(> ${p}) { ${l(u)} } }`);const d=Object.entries(r.phone??{}).filter(([,c])=>c!=="");d.length&&e.push(`@media ${at} { ${p}, *:has(> ${p}) { ${l(d)} } }`)};for(const r of t.rules.values())o(r);for(const r of t.kindRules.values())o(r);return e.join(`
|
|
2
|
+
`)}function le(t,e){const n=`var(${S})`,o=":is([data-sf-bullet], [data-sf-number])";return[`${t} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${t} ${o}:not(:first-child) { margin-top: ${n} }`,`${t} ${o}:not(:last-child) { margin-bottom: ${n} }`,`:is(${e}) + :is(${e}) { margin-top: ${n} }`]}const ce=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);function ve(t,e){if(!t)return null;const n=O(e),o=t.rules.get(n);if(o)return o;if(n.length<ue||t.drawn.has(n))return null;let r=null;for(const[i,f]of t.rules)if(i.includes(n)){if(r&&r.stamp!==f.stamp)return null;r=f}return r}const ue=8;export{R as PART_ALIGNS,$t as PART_LETTER_EM_MAX,Et as PART_LETTER_EM_MIN,Rt as PART_LETTER_STEP,_t as PART_LINE_HEIGHT_MAX,At as PART_LINE_HEIGHT_MIN,Tt as PART_LINE_STEP,B as PART_MEASURED_TRACKS,St as PART_NUDGE_MAX,ht as PART_NUDGE_MIN,bt as PART_PADDING_MAX,mt as PART_PADDING_MIN,Pt as PART_PADDING_STEP,J as PART_PARAGRAPH_ATTR,Ot as PART_PARAGRAPH_MAX,wt as PART_PARAGRAPH_MIN,S as PART_PARAGRAPH_VAR,zt as PART_RELATIVE_PROPS,F as PART_SIZE_MAX,y as PART_SIZE_MIN,Nt as PART_SIZE_STEPS,pt as PART_STYLED_ATTR,k as PART_STYLES_PROP,ae as PART_STYLE_PROPERTIES,gt as PART_WEIGHTS,D as SHARED_PART_PROPERTIES,G as STYLE_ID_OF_ROLE,W as TEXT_STYLE_ATTR,Fe as applyPartStyles,Ee as blockDrawsTextStyle,Pe as followedStyleOf,se as isPartKindKey,h as isTextStyleId,le as paragraphRules,$e as partAlignFollowed,L as partCanvasDeclarations,Ht as partCaseOfTransform,Dt as partCaseTransform,ke as partFontKeyOf,Te as partLiftRules,Kt as partPhoneDeclarations,He as partRuleForKind,ve as partRuleForText,Oe as partShownDeclarations,Vt as partSizeBoxOf,we as partSizeFollowed,Gt as partSpacingOf,Ne as partStyleBase,ze as partStyleCount,De as partStyleCss,j as partStyleDeclarations,Ut as partStyleForScreen,ye as partStyleSource,Y as partStyleWithoutSizeBox,Xt as partTabletDeclarations,Ae as propsWithPartStyleValue,_e as propsWithoutPartStyle,je as publishedPartStyles,K as readPartStyle,Re as readPartStyles,re as regionCanvasDeclarations,Le as regionCanvasRestore,Ie as regionHasOwnLook,oe as regionSheetStyle,Me as regionShownDeclarations,Qt as storedPartStyle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as t,jsx as i}from"react/jsx-runtime";import{useSectionRoot as s}from"../../../components/SiteGutterFrame.js";import{BOX_TYPE as d}from"../../../../format/lib/document/container-blocks.js";import{JoinBox as m}from"../../../components/JoinBox.js";import{tickerJoinPinClass as a,tickerJoinSide as c}from"../../../../format/lib/sections/ticker-join.js";function f({side:n,children:r}){return s()?i(m,{children:i("div",{className:a(n),children:r})}):i(t,{children:r})}const h={name:"boxJoin",applies:(n,r,e)=>n===d&&!!e&&typeof e.render=="function",draw(n){const r=n.render;n.render=e=>{const o=c(e.join);return o?i(f,{side:o,children:r(e)}):r(e)}}};export{h as boxJoin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{CardRowDrawn as f}from"../../../components/CardRowContext.js";import{PublishedPartStyles as y}from"../../../components/PublishedPartStylesContext.js";import{readPartStyles as h}from"../part-styles.js";import{readPartMotions as x}from"../../animation/part-motion.js";import{partNeedles as b}from"../text-parts.js";import{CARD_LIST_TYPE as u,rowPartByKey as j}from"../../../../format/lib/content/card-template.js";const C={name:"clickableParts",applies:(i,e,c)=>typeof c?.render=="function"&&i!==u,draw(i,e,c){const o=i,P=()=>o.textParts??o.fields,l=o.render,d=c.inspector?.PartAnchors,m=(t,r)=>b(P(),r,n=>j(e,t,n));o.render=t=>{const r=h(t),n=x(t);return t.editor?.isEditing&&d?s(f,{type:e,props:t,children:a=>s(d,{needles:m(t,a),styles:r,motions:n,type:e,children:l(t)})}):!Object.keys(r).length&&!Object.keys(n).length?l(t):s(f,{type:e,props:t,children:a=>s(y,{needles:m(t,a),styles:r,motions:n,type:e,children:l(t)})})}}};export{C as clickableParts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{catalogueLabel as e}from"../../../../format/lib/document/passes/catalogue-labels.js";import{blockSize as n}from"./block-size.js";import{cardTemplateOnInsert as s}from"../../../../format/lib/document/passes/card-template-on-insert.js";import{cellWidth as
|
|
1
|
+
import{catalogueLabel as e}from"../../../../format/lib/document/passes/catalogue-labels.js";import{blockSize as n}from"./block-size.js";import{boxJoin as p}from"./box-join.js";import{cardTemplateOnInsert as s}from"../../../../format/lib/document/passes/card-template-on-insert.js";import{cellWidth as c}from"./cell-width.js";import{clickableParts as f}from"./clickable-parts.js";import{cardCorners as a,sectionCorners as l}from"./corners.js";import{emptyHeadings as d}from"../../../../format/lib/document/passes/empty-headings.js";import{showWhenRows as h}from"../../../../format/lib/document/passes/show-when-rows.js";import{headBox as u,headCore as S}from"./head-core.js";import{hiddenNodes as b}from"../../../../format/lib/document/passes/hidden-nodes.js";import{showFor as g}from"./show-for.js";import{mediaValues as w}from"../../../../format/lib/document/passes/media-values.js";import{sectionAnchor as A}from"./section-anchor.js";import{blockEntrance as P,sectionAnimation as k}from"./section-animation.js";import{sectionHeight as C}from"./section-height.js";import{cardSticky as B,sectionSticky as W}from"./section-sticky.js";import{sectionBorder as y}from"./borders.js";import{blockPadding as G,sectionPadding as T}from"./section-padding.js";import{sectionTheme as x,slideTheme as E}from"./section-theme.js";import{buttonAlignInRow as H,containedWidth as I,sectionWidth as L}from"./section-width.js";import{blockGroups as O,sectionGroups as R}from"../../../../format/lib/document/passes/settings-groups.js";import{slotsStartAfresh as z}from"./slots-start-afresh.js";import{openSlotDisallow as D,sectionGroupAllow as F}from"../../../../format/lib/document/passes/slot-rules.js";import{registryPassContext as ho}from"../../../../format/lib/document/passes/registry-context.js";const J=[z,w,S,F,D,T,l,y,a,G,P,c,L,I,H,C,A,x,k,W,B,p,E,n,R,O,h,d,f,u,g,b,e,s];function fo(r,m,o){const t=m;for(const i of J)i.applies(r,o,t)&&(o.inspector&&i.panel?.(t,r,o.inspector,o),i.draw?.(t,r,o));return m}export{J as BLOCK_PASSES,fo as applyBlockPasses,ho as registryPassContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import{INTRO_EDGE_CLASS as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{INTRO_EDGE_CLASS as V}from"../../../../format/lib/sections/intro-bleed-layout.js";import{resolveContainerDirection as U}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as $,HERO_CHROME_CAP_VAR as Y,HERO_CHROME_INSET_VAR as K,SITE_WIDTH_CAP as h,centredCap as b,heroBackgroundTokens as j}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as I,SECTION_WIDTH_KEYS as g,hasOwnSectionWidth as X,hasWidthFamily as q,resolveWidth as B,siteWidthsOf as z}from"../../../../format/lib/content/section-width.js";import{BOX_GUTTER_KEY as J,boxGutterOf as Q,boxPlaceOf as Z,boxRunsEdgeToEdge as tt,isFrameContainer as N,ownNodeWidth as nt,siteDrawsGutter as et}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as ot}from"../../../../format/lib/document/editor-site-widths.js";import{NestedBoxChoice as it,SectionGroupChoice as ct,SectionGroupWidthsProvider as rt,SectionRootChoice as lt,SplitBandAndColumn as G}from"../../../components/SiteGutterFrame.js";import{FRAME as D}from"../../../components/BlockFrame.js";import{sectionFillPassClass as F}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as dt}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as w,withRowsShownWhen as E}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as ut,heldByANode as st,isNestedNode as at,NOT_HELD_BY_A_NODE as H}from"../../../../format/lib/document/passes/document-position.js";const O="--sf-sw-site",ft="--sf-sw-content",ht="--sf-bg-cap",_t="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",x=({own:t,content:n,siteContent:e})=>t===!0&&n==="full"&&e!=="full",M="contents view-wide:[--sf-site-width:100vw]",R=({held:t},n,e)=>t?e:l("div",{className:n,children:e}),Nt=`contents view-wide:[--sf-site-width:100vw] ${V} view-wide:[--sf-site-gutter:var(--intro-edge)]`,p=(t,n)=>n==="content"?`min(${t}px,var(${O}))`:`${t}px`;function C({content:t,contentMax:n},e){return t==="full"?e!=="content"?"100vw":null:n===null?null:p(n,e)}function T(t,n){return n===null?t:l("div",{className:"contents",style:{[O]:h},children:l("div",{className:_t,style:{[ft]:n},children:t})})}const wt="--sf-content-cap",Et="contents max-view-wide:[--sf-content-cap:none]";function Ot({content:t,contentMax:n},e){return t==="full"?null:n!==null?p(n,e):e==="content"?null:`var(${O})`}function Ct(t,n){return n===null?t:l("div",{className:"contents",style:{[O]:h},children:l("div",{className:Et,style:{[wt]:n},children:t})})}const s=(t,n,e="")=>t==="content"?l("div",{className:e||void 0,style:b(h),children:n}):n;function L(t,n,e,o,i){if(x(e))return s(o,R(e,M,l(G,{children:t({...n,contained:!0})})),i);if(e.content==="full")return s(o,t({...n,contained:!1}),i);const c=C(e,o);return o==="content"&&c===null&&!e.own?t({...n,contained:!0}):s(o,T(l(G,{children:t({...n,contained:!0})}),c),i)}function P(t,n,e,o){if(e==="hero"){const r=T(t(n),C(o,o.band));return o.band==="full"?l("div",{style:{[$]:"none",[K]:"initial",[Y]:"initial"},children:r}):o.band==="content"?l("div",{style:j(!0),children:r}):r}const i=o.band??"full",c=F(n);if(e==="rawMarkup"){if(o.content==="full")return s(i,t(n),c);const r=o.contentMax===null?h:p(o.contentMax,i);return l("div",{className:"contents",style:{[O]:h},children:s(i,l("div",{className:c||void 0,style:b(r),children:t(n)}),c)})}if(e==="scrollOver"){const r=o.content==="full",d=x(o)?R(o,Nt,t({...n,fullWidth:!1})):T(t({...n,fullWidth:r}),r?null:C(o,i));return i==="content"?l("div",{className:"contents",style:{[ht]:h},children:d}):d}switch(e){case"both":return s(i,Ct(t(n),Ot(o,i)),c);case"contained":return L(t,n,o,i,c);case"contentColumn":case"contentFull":case"productGrid":{const r=x(o),d=o.content==="full"&&!r?"full":"page",u=r?R(o,M,t({...n,widthMode:d})):T(t({...n,widthMode:d}),o.content==="full"?null:C(o,i));return e==="productGrid"&&!o.own?i==="content"?l("div",{className:c?`${D} ${c}`:D,children:u}):u:s(i,u,c)}default:return s(i,T(t(n),C(o,i)),c)}}function Tt(t,n){const e=I[n],o=t.render;t.render=i=>{const c=z(i),r={band:c.background,content:c.content??"content",contentMax:null},d=()=>e==="rawMarkup"?o(i):l(ct,{draw:f=>{const _=f?{...r,band:f.background==="content"?r.band:f.background??r.band,content:f.content??r.content,own:f.background==="full"||f.content!==null,held:!0,siteContent:r.content}:r,m=P(o,i,e,_);if(!N(n))return m;const A=Q(i),W=A===void 0?_.content:A?"content":"full";return W===_.content?m:l(it,{atTop:m,nested:L(o,i,{..._,content:W,own:!1},_.band??"full",F(i))})}}),u=nt(n,i);if(!X(u))return d();const a=e==="rawMarkup",S=u.background??(a?"full":c.background),y=u.content??(a?"full":r.content),v={band:S,content:S==="content"?"content":y,contentMax:u.contentMax,own:!a,siteContent:r.content};return l(lt,{own:()=>l(rt,{value:{background:v.band,content:v.content},children:P(o,i,e,v)}),followed:d})}}const St={all:[H,{not:{context:"runsEdgeToEdge",is:!0}}]},Vt={name:"sectionWidth",applies:(t,n,e)=>q(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.sectionOwnWidthFields({drawsFullOnItsOwn:I[n]==="rawMarkup"}),i=N(n)?e.boxGutterFields():{},c={...t.fields,...i,...o},r=N(n)?k(n,t,c,[J]):c;w(t,{heldByANode:st}),N(n)&&w(t,{runsEdgeToEdge:d=>tt(d.props??{})}),t.fields=E(r,[g.background,g.content],N(n)?St:H)},draw(t,n){Tt(t,n)}};function vt(t,n){if(!t||!("widthMode"in t))return t;const e={...t},o=e.widthMode;return o&&(e.widthMode={...o,currentValue:n.mode,inherited:n.inherited}),e}const mt=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),Ut={name:"containedWidth",applies:(t,n,e)=>mt.has(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.widthField;t.fields=k(n,t,{...t.fields,...o("page")});const i=t.resolveFields;t.resolveFields=(c,r)=>{const d=i?i(c,r):r.fields,u=B(c?.props??{},"page"),a=S=>vt(S,u);return d&&typeof d.then=="function"?d.then(a):a(d)}},draw(t){const n=t.render;t.render=e=>{const{mode:o}=B(e,"page");return n({...e,contained:o!=="full"})}}},xt={not:{context:"inHeroGroupRow",is:!0}},$t={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=E(n.fields??{},["align"],xt),w(n,{inHeroGroupRow:(e,o)=>{const i=ut(o.appState,e.props?.id);return!!i&&i.type==="HeroGroup"&&U("HeroGroup",i.props?.direction)==="row"}})}};function Rt(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const pt={any:[]},At={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},Wt={not:{context:"widthCappedByParent",is:!0}};function k(t,n,e,o=["widthMode"]){if(t==="ButtonBlock")return E(e,["_gWidth",...o],pt);if(Rt(e)){const i=(c,r)=>Z(r.appState?.data?.content,c.props?.id,et(ot()));return w(n,{outsideBox:(c,r)=>i(c,r)?.inBox!==!0,insideSiteGutter:(c,r)=>i(c,r)?.insideGutter}),E(e,o,At)}return w(n,{widthCappedByParent:(i,c)=>"parent"in c?dt(c.parent):at({props:i.props??{}},c)}),E(e,o,Wt)}export{ht as SECTION_BACKGROUND_VAR,Et as SECTION_CONTENT_CAP_CLASS,wt as SECTION_CONTENT_CAP_VAR,_t as SECTION_CONTENT_CLASS,ft as SECTION_CONTENT_VAR,O as SITE_CONTENT_VAR,$t as buttonAlignInRow,Ut as containedWidth,Vt as sectionWidth,vt as widthModeFields};
|
|
@@ -20,13 +20,14 @@ export type PartNeedle = {
|
|
|
20
20
|
label: string;
|
|
21
21
|
texts: string[];
|
|
22
22
|
row?: PartRow;
|
|
23
|
+
keyed?: true;
|
|
23
24
|
};
|
|
24
25
|
export { decodePartId, encodePartId };
|
|
25
26
|
export declare function normalizePartText(value: string): string;
|
|
26
27
|
export declare function holdsAuthoredText(field: unknown): boolean;
|
|
27
28
|
export declare function partLabel(field: Record<string, unknown>, key: string): string;
|
|
28
29
|
export declare function partHeadLabel(label: string): string;
|
|
29
|
-
export declare function partNeedles(fields: Record<string, unknown> | undefined, props: Record<string, unknown> | undefined): PartNeedle[];
|
|
30
|
+
export declare function partNeedles(fields: Record<string, unknown> | undefined, props: Record<string, unknown> | undefined, keyed?: (key: string) => boolean): PartNeedle[];
|
|
30
31
|
export declare function canTypeOnCanvas(part: {
|
|
31
32
|
offPage: boolean;
|
|
32
33
|
hidden: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{decodePartId as
|
|
1
|
+
import{decodePartId as O,encodePartId as E}from"efficient-easel/draw";import{stripMarkup as R}from"../../../format/lib/markup.js";import{LINK_FIELD_MARKER as y,SCAFFOLD_FIELD_MARKER as A,TEXT_FIELD_MARKER as p}from"efficient-easel/draw";import{readHidable as h}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as L}from"efficient-easel/draw";import{isStructuralTextProp as _}from"../../../format/lib/document/neutralization-contracts.js";import{fieldInOwnBox as I}from"../../../format/lib/document/own-box.js";import{partRowTexts as S}from"./part-rows.js";import{nonEmptyString as j}from"../../../format/lib/non-empty-string.js";const q="data-sf-part",J="data-sf-region-part",Q="data-sf-part-row";function U(e,t){return`${e}[${t}]`}const V="data-sf-part-kind",N="data-sf-part-style-owner",F="data-sf-part-style-kind";function Z(e){for(let t=e;t;t=t.parentElement){const r=t.getAttribute(N),o=t.getAttribute(F);if(r&&o)return{owner:r,kind:o};if(t.getAttribute("data-easel-block"))return null}return null}const b=2;function g(e){return R(e).replace(/\s+/gu,"")}function l(e,t,r){const o=e[p];if(o){if(o.control==="textList"){const i=o.itemKey??"text";if(!Array.isArray(t))return;for(const s of t){const c=s?.[i];typeof c=="string"&&r.push(c)}return}const{text:n}=h(t);n?r.push(n):o.placeholder&&r.push(o.placeholder);return}if(!e[y]){if(e.type==="text"||e.type==="textarea"){const n=j(t);n&&r.push(n);return}if(e.arrayFields&&Array.isArray(t)){for(const n of t)for(const[i,s]of Object.entries(e.arrayFields))l(s,n?.[i],r);return}if(e.objectFields&&t&&typeof t=="object")for(const[n,i]of Object.entries(e.objectFields))l(i,t[n],r)}}function k(e){if(!e||typeof e!="object")return!1;const t=e;return t[y]?!1:!!t[p]||t.type==="text"||t.type==="textarea"}function w(e,t){const r=e[p];return r?.label?r.label:typeof e.label=="string"?e.label:t}function K(e){const t=e.indexOf(" (");return(t>0?e.slice(0,t):e).trim()}function v(e,t,r){if(!e)return[];const o=[];for(const[n,i]of Object.entries(e)){if(!i||typeof i!="object"||_(n))continue;const s=i,c=[];l(s,t?.[n],c),!c.length&&s[A]!==void 0&&l(s,s[A],c);const a=w(s,n);if(r?.(n)&&k(s)){c.length&&o.push({key:n,label:a,texts:[],keyed:!0});continue}const u=new Set;for(const{row:d,text:f}of S(s,t?.[n])){const T=g(f);T.length<b||(u.add(T),o.push({key:n,label:a,texts:[T],row:d}))}const m=new Set(u),x=[];for(const d of c){const f=g(d);f.length<b||m.has(f)||(m.add(f),x.push(f))}x.length&&o.push({key:n,label:a,texts:x})}return o}function D(e){return!e.offPage&&!e.hidden}const M=L;function P(e,t){if(!t||typeof t!="object"||_(e)||I(t))return null;const r=t[p];return!r||!M.includes(r.control)?null:r}function tt(e,t){const r=P(e,t);return r!==null&&r.identifier!==!0}function et(e,t){if(!e)return[];const r=[];for(const[o,n]of Object.entries(e)){const i=P(o,n);if(!i)continue;const{text:s,hidden:c}=h(t?.[o]);if(D({offPage:i.offPage===!0,hidden:!!c}))continue;const a=s||i.placeholder||"",u=R(a).replace(/\s+/gu," ").trim();r.push({key:o,label:K(w(n,o)),preview:u,offPage:i.offPage===!0,identifier:i.identifier===!0,hidden:!!c})}return r}export{q as PART_ATTR,V as PART_KIND_ATTR,Q as PART_ROW_ATTR,F as PART_STYLE_KIND_ATTR,N as PART_STYLE_OWNER_ATTR,J as REGION_PART_ATTR,D as canTypeOnCanvas,O as decodePartId,E as encodePartId,U as encodePartRow,P as entryPartMetaOf,tt as fieldDrawsEntryRow,k as holdsAuthoredText,g as normalizePartText,K as partHeadLabel,w as partLabel,v as partNeedles,Z as partStyleOwnerOf,et as sectionTextParts};
|