efficient-web-builder 74.2.0 → 74.4.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 +38 -0
- package/dist/editor/components/SectionTextPartBridge.d.ts +2 -8
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/FAQ/fields.js +1 -1
- package/dist/editor/lib/document/own-pad-fields.d.ts +4 -3
- package/dist/editor/lib/document/own-pad-fields.js +1 -1
- package/dist/format/lib/content/faq-row-anchor.d.ts +1 -0
- package/dist/format/lib/content/faq-row-anchor.js +1 -0
- package/dist/format/lib/content/unique-ids.d.ts +1 -0
- package/dist/format/lib/content/unique-ids.js +1 -0
- package/dist/format/lib/document/passes/types.d.ts +3 -2
- package/dist/format/lib/document/section-catalog.js +2 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +4 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/render/components/Banner.d.ts +3 -1
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/BoxAccordionRow.d.ts +2 -1
- package/dist/render/components/BoxAccordionRow.js +1 -1
- package/dist/render/components/BoxTabPaneContext.d.ts +12 -0
- package/dist/render/components/BoxTabPaneContext.js +1 -1
- package/dist/render/components/Cards.d.ts +3 -1
- package/dist/render/components/Cards.js +1 -1
- package/dist/render/components/ChartSection.d.ts +3 -1
- package/dist/render/components/ChartSection.js +1 -1
- package/dist/render/components/ContactLocations.d.ts +3 -1
- package/dist/render/components/ContactLocations.js +2 -2
- package/dist/render/components/ContentsCurrentMark.d.ts +7 -0
- package/dist/render/components/ContentsCurrentMark.js +1 -0
- package/dist/render/components/ContentsList.d.ts +2 -1
- package/dist/render/components/ContentsList.js +1 -1
- package/dist/render/components/Countdown.d.ts +3 -1
- package/dist/render/components/Countdown.js +1 -1
- package/dist/render/components/DocBody.d.ts +3 -1
- package/dist/render/components/DocBody.js +5 -5
- package/dist/render/components/DocMasthead.d.ts +3 -1
- package/dist/render/components/DocMasthead.js +1 -1
- package/dist/render/components/DocMetaCards.d.ts +3 -1
- package/dist/render/components/DocMetaCards.js +1 -1
- package/dist/render/components/FAQ.d.ts +5 -1
- package/dist/render/components/FAQ.js +1 -1
- package/dist/render/components/FeaturedCover.d.ts +3 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Grid.d.ts +3 -1
- package/dist/render/components/Grid.js +1 -1
- package/dist/render/components/IntegrationsSection.d.ts +3 -1
- package/dist/render/components/IntegrationsSection.js +1 -1
- package/dist/render/components/KeyFeatures.d.ts +3 -1
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/Logos.d.ts +3 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/LongRead.d.ts +3 -1
- package/dist/render/components/LongRead.js +1 -1
- package/dist/render/components/Masthead.d.ts +3 -1
- package/dist/render/components/Masthead.js +1 -1
- package/dist/render/components/MockupSection.d.ts +3 -1
- package/dist/render/components/MockupSection.js +1 -1
- package/dist/render/components/OpenFromLink.d.ts +3 -0
- package/dist/render/components/OpenFromLink.js +1 -0
- package/dist/render/components/OrderSummary.d.ts +3 -1
- package/dist/render/components/OrderSummary.js +1 -1
- package/dist/render/components/PaymentBadges.d.ts +3 -1
- package/dist/render/components/PaymentBadges.js +1 -1
- package/dist/render/components/Prose.d.ts +3 -1
- package/dist/render/components/Prose.js +1 -1
- package/dist/render/components/SectionHeader.d.ts +2 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/Series.d.ts +3 -1
- package/dist/render/components/Series.js +1 -1
- package/dist/render/components/Stats.d.ts +3 -1
- package/dist/render/components/Stats.js +1 -1
- package/dist/render/components/Testimonials.d.ts +3 -1
- package/dist/render/components/Testimonials.js +1 -1
- package/dist/render/components/TickerSection.d.ts +3 -1
- package/dist/render/components/TickerSection.js +1 -1
- package/dist/render/lib/content/section-own-pads.d.ts +35 -0
- package/dist/render/lib/content/section-own-pads.js +1 -0
- package/dist/render/lib/content/section-padding.d.ts +9 -3
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/Banner/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Chart/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ContactLocations/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Countdown/render.js +1 -1
- package/dist/render/lib/document/blocks/general/DocBody/render.js +1 -1
- package/dist/render/lib/document/blocks/general/DocMasthead/render.js +1 -1
- package/dist/render/lib/document/blocks/general/DocMetaCards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/FAQ/render.js +1 -1
- package/dist/render/lib/document/blocks/general/FeaturedCover/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Grid/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Integrations/render.js +2 -2
- package/dist/render/lib/document/blocks/general/KeyFeatures/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
- package/dist/render/lib/document/blocks/general/LongRead/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Masthead/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Mockup/render.js +2 -2
- package/dist/render/lib/document/blocks/general/OrderSummary/render.js +1 -1
- package/dist/render/lib/document/blocks/general/PaymentBadges/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Prose/render.js +1 -1
- package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Series/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Stats/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Testimonials/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Ticker/render.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-head.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-integrations.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.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/editing-bridges.d.ts +5 -1
- package/dist/render/lib/document/editing-bridges.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +3 -1
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/clickable-parts.js +1 -1
- package/dist/render/lib/document/passes/section-padding.d.ts +3 -3
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tabletKey as D}from"efficient-easel/draw";import{SECTION_WIDTH_KEYS as W}from"../../../../../format/lib/content/section-width.js";import{CELL_SPAN_KEYS as j}from"../../../../../format/lib/content/grid-span.js";import{SECTION_BOX_SLOT as G,SECTION_BOX_TYPE as K}from"../../../sections/section-to-box.js";import{BUTTON as k,DIM as i,DROP_COMMON as v,DROP_SIDE_PADDING as Y,INNER_BOX as o,SAME_KEYS as X,SECTION_BOX as f,SH_LINK as S,TEXT as p,bandAccent as $,bandIndex as z,bandPage as U,bandProps as P,bandWrites as F,smallText as c,wrapperPad as l}from"./section-to-box-row-parts.js";import{EDITORIAL_LINE as
|
|
1
|
+
import{tabletKey as D}from"efficient-easel/draw";import{SECTION_WIDTH_KEYS as W}from"../../../../../format/lib/content/section-width.js";import{CELL_SPAN_KEYS as j}from"../../../../../format/lib/content/grid-span.js";import{SECTION_BOX_SLOT as G,SECTION_BOX_TYPE as K}from"../../../sections/section-to-box.js";import{BUTTON as k,DIM as i,DROP_COMMON as v,DROP_SIDE_PADDING as Y,INNER_BOX as o,SAME_KEYS as X,SECTION_BOX as f,SH_LINK as S,TEXT as p,bandAccent as $,bandIndex as z,bandPage as U,bandProps as P,bandWrites as F,smallText as c,wrapperPad as l}from"./section-to-box-row-parts.js";import{EDITORIAL_LINE as T,editorialHeadTree as V,token as d}from"./section-head-looks.js";import{boxPadding as m,labelStyle as q}from"../../../../../format/lib/document/seed-parts.js";import{readAnchorName as J}from"../../../../../format/lib/content/anchor-name.js";import{declaredBlockSource as _}from"../../../../../format/lib/content/block-sources.js";import{parseLocationTileShape as Q,splitLegacyRegion as x}from"../../../../../format/lib/content/contact.js";import{groupColumns as g}from"../../../../../format/lib/locations-grid.js";import{phoneHref as Z}from"../../../../../format/lib/links/phone-href.js";import{hasMapCoords as ee}from"../../../../../format/lib/map-styles.js";import{VIEW_HIDE_KEYS as te}from"../../../../../format/lib/content/view-hide-class.js";import{CONTACT_LOCATIONS_OWN as h}from"../../../content/section-own-pads.js";const r=e=>typeof e=="string"?e:e==null?"":String(e),y=e=>Array.isArray(e.locations)?e.locations.map(t=>t??{}):[],s=e=>r(e.group),O=e=>`loc-${e}`,w=e=>r(e.state).trim()||x(r(e.region)).state,B=e=>r(e.country).trim()||x(r(e.region)).country,E=e=>[w(e),B(e)].filter(Boolean).join(" · "),oe=e=>y(e).some(t=>r(t.photo).trim()!==""),ne=e=>y(e).some(t=>ee(Number(t.lat),Number(t.lng))),re=(e,t)=>y(e).filter(n=>s(n)===s(t)).length,ae=(e,t)=>re(e,t)===1?"wide":Q(e.imageShape),N=48,a=(e,t={})=>({...q(e),...t}),u={top:1,right:1,bottom:1,left:1},b={...o,direction:"row",share:"equal",gap:0},ie=e=>t=>t>g(t)?{...o,gap:0}:{...b,...t>1?{phoneRow:e}:{}},se=!0,pe={kind:"group",name:"Gallery",props:{...o,gap:20,...se?{_hidden:!0}:{}},when:oe,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:`#${O(t)}`,boxShape:ae(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:ie(2),perRow:g,rowName:"Row",rowProps:{...b,phoneRow:2}}}]}]},ce={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)=>E(n)]),when:(e,t)=>E(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=>Z(r(e))??"#"]],when:(e,t)=>r(t?.phone).trim()!==""},{kind:"text",key:"hours",props:i,style:a(12,{letterSpacing:.18,lineHeight:1.7})}]},le={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)=>w(n)]),...["region","country"].map(e=>[e,"country",(t,n)=>B(n)])]},de={kind:"group",name:"Map",props:{...o,sectionBorder:{top:1,right:0,bottom:0,left:0}},parts:[le]},me={kind:"list",key:"locations",name:"City",props:(e,t)=>({...o,gap:0,justify:"between",sectionBorder:u,jumpHighlight:!0,sectionAccent:z(e,t)>=0?U(e.sectionAccent,t):-1}),item:(e,t)=>({props:{anchor:O(t)}}),parts:[ce,de],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),[D("columns")]:1})}},C=a(10,{letterSpacing:.25}),ge={kind:"block",type:K,props:{...o,name:"Credit",direction:"row",justify:"end",align:"center",gap:6,share:"content",wrap:!0},when:ne,slot:G,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"}}}}]},I=(e,t)=>Object.fromEntries(t.filter(n=>e[n]!==void 0).map(n=>[n,e[n]])),A=["sectionPaddingTop","sectionPaddingTopTablet","sectionPaddingTopPhone"],H=["sectionPaddingBottom","sectionPaddingBottomTablet","sectionPaddingBottomPhone"],L=e=>e.map(t=>[t,t,(n,R)=>l(R,h)[t]]),M=["sectionAccent","sectionAccent",$],he=[...j,...te,...Object.values(W)],ye={name:"City pictures",skip:e=>_(e)?`fed by the data source "${_(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",...T,...I(l(e,h),A),sectionPaddingBottom:N,sectionPaddingBottomPhone:N,...P(e,t)}),box:[...X.filter(e=>e!=="sectionAccent"&&e!=="anchor"),M,["anchor","anchor",e=>J(e).trim()?e:"studios"],...L(A)],parts:[V("sectionNumber","heading","tagline"),pe],also:[{name:"City maps",boxProps:(e,t)=>({...f,direction:"column",gap:40,sectionBorder:{bottom:1},...T,sectionPaddingTop:0,sectionPaddingTopPhone:0,...I(l(e,h),H),...P(e,t)}),box:[...he,M,...L(H)],parts:[me,ge]}],reads:{mapTheme:"City maps Box: each Map block's Map theme",imageShape:"City pictures Box: each picture Box's Box shape"},site:F,drop:{...v,...Y,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)"}},Ie={ContactLocations:ye};export{se as CITY_PHOTO_WALL_HIDDEN,Ie as LOCATIONS_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as
|
|
1
|
+
import{hasWords as r}from"../../../sections/section-to-box.js";import{DIM as L,DROP_COMMON as m,DROP_SIDE_PADDING as h,INNER_BOX as n,SAME_KEYS as f,SECTION_BOX as P,TEXT as a,smallText as O,wrapperPad as i,wrapperPadKeys as _}from"./section-to-box-row-parts.js";import{PAYMENT_BADGES_OWN as k,logosBandOwn as l}from"../../../content/section-own-pads.js";import{markBoxProps as x,token as A}from"../../../../../format/lib/document/seed-parts.js";import{LOGOS_PH as B,logosScaffoldItems as w}from"../../../../../format/lib/document/blocks/general/Logos/meta.js";import{logosCardSeed as E}from"../../../../../format/lib/document/blocks/general/Logos/card-seed.js";import{PAYMENT_PH as R,paymentScaffoldAssurances as N,paymentScaffoldBadges as C}from"../../../../../format/lib/document/blocks/general/PaymentBadges/meta.js";import{BLOCK_SOURCE_OPTIONS_PROP as t,BLOCK_SOURCE_PROP as e}from"../../../../../format/lib/content/block-sources.js";import{CARD_TEMPLATE_SLOT as S}from"../../../../../format/lib/content/card-template.js";import{BLOCK_ALIGN_BOX_WORD as I,legacyBlockAlignOf as M}from"../../../../../format/lib/content/block-align.js";import{FOOTER_PAYMENT_SEED as D}from"../../../../../format/lib/content/footer.js";import{CELL_SPAN_KEYS as H}from"../../../../../format/lib/content/grid-span.js";import{SECTION_ACCENT_INHERIT as K}from"../../../../../format/lib/content/section-surface.js";import{FOOTER_MARK_SIZES as X,FOOTER_TEXT_PX as v}from"../../../../../format/lib/document/box-footer.js";import{phoneKey as d,readHidable as G}from"efficient-easel/draw";import{parseOption as z}from"efficient-shell/format";const p={contained:!1},c=(o,s)=>({logos:[{kind:"list",key:o,name:"Logo",flat:!0,parts:[{kind:"block",type:"LogoBlock",box:["src",[s,"alt"]],when:(U,g)=>r(g?.src)||r(g?.[s])}]}]}),F={...O("heading",{color:"labels",letterSpacing:.2}),props:{...a,align:"center"}},Y={name:"Logos",boxProps:o=>({...P,direction:"column",gap:32,...i(o,l(o))}),box:[...f,..._(l),["bandPadding","sectionPaddingTop",(o,s)=>i(s,l(s)).sectionPaddingTop]],parts:[F,{kind:"core",keep:["columns","logoHeight","grayscale"],rename:{logosPerRow:"columns"},props:p,slots:c("items","alt")}],drop:{...m,...h,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"}},j={kind:"group",name:"Mark",keepEmpty:!0,parts:[],props:x(4,"main",{sectionCorners:2})},W={name:"Payment Methods",boxProps:o=>({...P,direction:"column",...i(o,k)}),box:[...f,..._(k)],parts:[{kind:"group",name:"Methods",props:{...n,align:"center",gap:20,gapPhone:20,sectionBorder:{top:1,bottom:1},sectionPaddingTop:32,sectionPaddingBottom:32},parts:[{...O("heading",{color:"labels"}),props:{...a,align:"center"}},{kind:"core",keep:[],as:"Logos",derive:{reads:[e,t],props:o=>r(o[e])?{[e]:o[e],...o[t]!==void 0?{[t]:o[t]}:{}}:{}},props:{...p,look:"cards",grayscale:!1},slots:o=>({...c("badges","label"),...r(o[e])?{[S]:[E()]}:{}})},{kind:"group",name:"Reassurance",props:{...n,direction:"row",wrap:!0,justify:"center",gap:24,gapPhone:24,phoneRow:2,[d("share")]:"content"},parts:[{kind:"list",key:"assurances",name:"Line",of:o=>(Array.isArray(o.assurances)?o.assurances:[]).filter(s=>r(s?.text)),props:{...n,direction:"row",align:"center",gap:8,gapPhone:8,phoneRow:2,[d("share")]:"content"},item:o=>G(o.text).hidden?{props:{_hidden:!0}}:{},parts:[j,{kind:"text",key:"text",props:{...a,align:"center"},style:{...A("label",13),color:"labels",lineHeight:1.5}}]}]}]}],drop:{...m,...h,contained:"the Box draws the site frame now; the Logos block inside it fills the Box's column (`contained: false`)"}},T=o=>M(o.align)??"left",y=o=>z(["sm","md"],"sm",o.size),b=12,u={name:"Payment logos",boxProps:o=>({...n,direction:"row",wrap:!0,align:"center",justify:I[T(o)],gap:b,gapPhone:b,phoneRow:2,[d("share")]:"content"}),box:[...H],parts:[{kind:"text",key:"lead",props:L,styleFrom:o=>({size:v[y(o)],lineHeight:1.5})},{kind:"core",keep:[],as:"Logos",derive:{reads:[e,t],props:o=>({logoHeight:X[y(o)].mark,align:T(o),...r(o[e])?{[e]:o[e],...o[t]!==void 0?{[t]:o[t]}:{}}:{}})},props:{...p,look:"marks",grayscale:!1,sectionAccent:K},slots:o=>({...c("methods","label"),...r(o[e])?{[S]:[E()]}:{}})}],drop:{size:"read as the wall's Logo height (S 16, M 20) and the lead's size (the footer size table, 12 / 13)",align:"read as the Box's justify and the wall's own Alignment (start is left, end is right)",editing:"the editor's preview flag, never a stored setting: the editor tells every block it is editing"}},co={Logos:Y,PaymentBadges:W,FooterPayment:u,PaymentLogosBlock:u},go=()=>({heading:B.heading,items:w()}),mo=()=>({heading:R.heading,badges:C(),assurances:N()}),ho=()=>({...D,methods:[]});export{co as LOGOS_SECTION_TO_BOX,ho as footerPaymentPressStarter,go as logosPressStarter,mo as paymentPressStarter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as p}from"../../../sections/section-to-box.js";import{BLOCK_WIDTH_LIMIT as N}from"efficient-easel/draw";import{fluidToken as R,token as
|
|
1
|
+
import{hasWords as p}from"../../../sections/section-to-box.js";import{BLOCK_WIDTH_LIMIT as N}from"efficient-easel/draw";import{fluidToken as R,token as a}from"./section-head-looks.js";import{CRUMB_PAD as _,STRIP_BOX as C}from"../../../../../format/lib/sections/strip-shape.js";import{PH as i,phAccentAsMarks as W}from"../../../../../format/lib/document/blocks/placeholders.js";import{DOC_MASTHEAD_PH as d}from"../../../../../format/lib/document/blocks/general/DocMasthead/meta.js";import{PAGE_TITLE_LEVEL_PROP as v,pageTitleDemoted as T}from"../../../../../format/lib/document/one-h1.js";import{AUTO_COLUMN as s,BUTTON as U,DIM as G,DROP_COMMON as g,DROP_PAD_TOTALS as X,DROP_SIDE_PADDING as c,INNER_BOX as o,leadLine as f,RIGHT_WORDS as S,SAME_KEYS as m,SECTION_BOX as h,SH_LINK as K,smallText as r,TEXT as n,wrapperPad as b,wrapperPadKeys as u}from"./section-to-box-row-parts.js";import{DOC_MASTHEAD_OWN as E,MASTHEAD_OWN as w}from"../../../content/section-own-pads.js";const O={minWidth:N.min},I=(e,t,l)=>({...r(e,{...t,...S}),props:{...n,align:"right",...s,...l}}),D={top:1,bottom:0},k=(e,t,l,M)=>({kind:"group",name:e,props:{...o,sectionPaddingBottom:t,sectionPaddingBottomPhone:l},parts:[M]}),x={widthFit:"fill",...O},j={...a("label",13),letterSpacing:.22,lineHeight:1.8},A={textStyle:"heading-1",...R("headingLarge",56,8,128),case:"upper",weight:500,lineHeight:.88,letterSpacing:-.04},V=()=>({name:"Page Header",boxProps:e=>({...h,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,E)}),box:[...m,...u(E)],parts:[{kind:"group",name:"Header",props:{...o,direction:"row",align:"end",justify:"between",gap:40,gapPhone:16,share:"content",sectionPaddingBottom:32},parts:[k("Eyebrow",12,0,{...r("eyebrow",a("label",13)),props:{...n,...s}}),{kind:"text",key:"title",role:"heading",props:{...n,tag:"h1",...x},style:A,mark:"accentItalic",when:e=>!T(e)},{kind:"text",key:"title",role:"heading",props:{...n,tag:"h2",...x},style:A,mark:"accentItalic",when:T},{kind:"group",name:"Details",props:{...o,align:"stretch",gap:0,gapPhone:0,sectionPaddingBottom:12,sectionPaddingBottomPhone:0},parts:[{kind:"list",key:"meta",name:"Detail",flat:!0,parts:[f("label","value",j,s)]}]}]},{kind:"group",name:"Deck",props:{...o,maxWidth:760,sectionBorder:D,sectionPaddingTop:28},parts:[{kind:"text",key:"deck",props:G,style:{textStyle:"body-1",fontRole:"accent",...a("body",22,19),italic:!0,lineHeight:1.5}}]}],drop:{...g,...c,[v]:"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"}}),re=()=>({eyebrow:d.eyebrow,title:W(d.title),deck:d.deck,meta:[{label:i.label,value:i.value},{label:i.label,value:i.value}]}),Y={...a("label",13),letterSpacing:.18,lineHeight:1.8},B={...a("label",13),letterSpacing:.22,lineHeight:1.9},F=()=>({name:"Issue Header",boxProps:e=>({...h,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,w)}),box:[...m,...u(w)],parts:[{kind:"group",name:"Top",props:{...o,direction:"row",align:"end",justify:"between",gap:60,gapPhone:16,share:"content",sectionPaddingBottom:32},parts:[k("Eyebrow",14,14,r("eyebrow",a("label",14))),{kind:"group",name:"Issue",props:{...o,align:"end",gap:0,gapPhone:0,sectionPaddingBottom:14},parts:[{kind:"list",key:"issueMeta",name:"Issue line",flat:!0,parts:[f("lead","rest",Y)]}]}]},{kind:"group",name:"Bottom",props:{...o,direction:"row",align:"start",justify:"between",gap:60,gapPhone:16,share:"content",sectionBorder:D,sectionPaddingTop:32},parts:[{kind:"text",key:"lead",props:{...n,maxWidth:720,...O},style:{textStyle:"body-1",fontRole:"heading3",...a("headingSmall",20),lineHeight:1.5,letterSpacing:-.005,paragraphSpacing:16}},{kind:"group",name:"In this issue",props:{...o,align:"stretch",gap:0},parts:[k("Heading",6,6,{kind:"text",key:"issueHeading",props:{...n,align:"right",...s},style:{textStyle:"body-1",fontRole:"heading",...a("body",18),weight:400,letterSpacing:-.01,lineHeight:1.9,...S}}),{kind:"group",name:"Lines",props:{...o,align:"stretch",gap:0},parts:[{kind:"list",key:"issueList",name:"Line",flat:!0,parts:[I("text",{color:"labels",...B})]}]},I("issueTotal",B)]}]}],drop:{...g,...c}}),y={color:"labels",...a("label",13),letterSpacing:.2},H=e=>(Array.isArray(e.items)?e.items:[]).filter(t=>t&&typeof t.label=="string"&&t.label.trim()!==""),P=(e,t)=>t!==void 0&&H(e).at(-1)===t,L=(e,t)=>t!==void 0&&H(e).includes(t),q=(e,t)=>L(e,t)&&!P(e,t)&&p(t?.href),z=()=>({name:"Breadcrumb",skip:e=>p(e.meta)?'a trailing note after "·" needs a second mark; none live':void 0,boxProps:e=>({...h,...C,wrap:"wrap",gap:16,gapPhone:16,separator:"slash",sectionBorder:{bottom:1},...b(e,_)}),box:[...m,...u(_)],parts:[{kind:"list",key:"items",name:"Crumb",flat:!0,parts:[{kind:"button",key:"label",href:"href",variant:"ghost",when:q,props:{...U,...K,icon:"none"},style:y},{...r("label",y),when:(e,t)=>L(e,t)&&!P(e,t)&&!p(t?.href)},{...r("label",{...y,color:"text"}),when:P}]}],drop:{...g,...c,meta:"a node that stores a note is skipped (`skip`); an empty one draws nothing",...X}}),ie={DocMasthead:V(),Masthead:F(),Breadcrumb:z()};export{ie as PAGE_HEADER_SECTION_TO_BOX,re as pageHeaderPressStarter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DROP_COMMON as
|
|
1
|
+
import{DROP_COMMON as e,DROP_SIDE_PADDING as r,FOLLOW_THE_BOX as t,SAME_KEYS as n,SECTION_BOX as p,TEXT as c,smallText as m,wrapperPad as O,wrapperPadKeys as a}from"./section-to-box-row-parts.js";import{labelLook as _}from"../../../../../format/lib/document/seed-parts.js";import{COUNTDOWN_OWN_BOX_WORDS as i}from"../../../../../format/lib/document/blocks/general/Countdown/meta.js";import{COUNTDOWN_OWN as s,FEATURED_COVER_OWN as d}from"../../../content/section-own-pads.js";const E={...m("title",{..._(12),color:"muted"}),props:{...c,align:"center"}},N=()=>({name:"Countdown",boxProps:o=>({...p,direction:"column",align:"center",gap:16,gapPhone:16,...O(o,s)}),box:[...n,...a(s)],parts:[E,{kind:"core",keep:"rest",props:t}],pressKeepsEmpty:[...i],drop:{...e,...r}}),l=()=>({name:"Feature Banner",boxProps:o=>({...p,direction:"column",sectionBorder:{bottom:1},...O(o,d)}),box:[...n,...a(d)],parts:[{kind:"core",keep:"rest",props:t}],drop:{...e,...r}}),P={Countdown:N(),FeaturedCover:l()};export{P as PROMO_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DIM as k,DROP_COMMON as r,DROP_SIDE_PADDING as n,FOLLOW_THE_BOX as
|
|
1
|
+
import{DIM as k,DROP_COMMON as r,DROP_SIDE_PADDING as n,FOLLOW_THE_BOX as a,INNER_BOX as o,SAME_KEYS as _,SECTION_BOX as g,TEXT as u,filledChip as y,smallText as C,surfaceAccent as s,wrapperPad as E,wrapperPadKeys as P}from"./section-to-box-row-parts.js";import{relaxedBodyLook as x,token as c}from"../../../../../format/lib/document/seed-parts.js";import{phoneKey as f}from"efficient-easel/draw";import{CHART_OWN_BOX_WORDS as S}from"../../../../../format/lib/document/blocks/general/Chart/meta.js";import{MOCKUP_OWN_BOX_WORDS as w}from"../../../../../format/lib/document/blocks/general/Mockup/meta.js";import{PROOF_OWN as i}from"../../../content/section-own-pads.js";const d=()=>({kind:"group",name:"Words",props:{...o,gap:20,gapPhone:20},parts:[{kind:"group",name:"Chip row",props:{...o,direction:"row",phoneRow:2,[f("share")]:"content"},parts:[y("eyebrow")]},{kind:"text",key:"title",role:"heading",props:u,style:{textStyle:"heading-2",...c("headingMedium",44,32),weight:500,case:"upper",lineHeight:1.04,letterSpacing:-.02}},{kind:"text",key:"body",props:{...k,maxWidth:435},style:x(16)}]}),m=e=>(t,p)=>({...g,sectionAccent:s(t.sectionAccent??0,p),direction:"row",align:"center",gap:56,gapPhone:56,share:e,sectionBorder:{top:1,bottom:1},...E(t,i)}),O=[..._.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,p)=>s(e,p)],...P(i)],A=()=>({name:"Chart",boxProps:m([42]),box:O,parts:[d(),{kind:"group",name:"Chart",props:{...o,gap:16,gapPhone:16},keepEmpty:!0,parts:[{kind:"core",keep:"rest",props:a},C("caption",{color:"muted",...c("label",10),letterSpacing:.14})]}],pressKeepsEmpty:[...S],drop:{...r,...n}}),l=e=>e.align==="left",h={kind:"group",name:"Card",keepEmpty:!0,props:o,parts:[{kind:"core",keep:"rest",props:a}]},B=()=>({name:"Mockup Card",boxProps:m("equal"),box:O,parts:[{...h,when:l},d(),{...h,when:e=>!l(e)}],pressKeepsEmpty:[...w],drop:{...r,...n}}),W={Chart:A(),Mockup:B()};export{W as PROOF_SECTION_TO_BOX};
|
|
@@ -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 _}from"../../../../../format/lib/content/block-sources.js";import{resolveSectionBackground as k,THEME_SECTION_BG as M}from"../../../../../format/lib/content/section-background.js";import{finiteNumber as H}from"../../../../../format/lib/finite-number.js";import{hasWords as g}from"../../../sections/section-to-box.js";import{DROP_COMMON as T,DROP_SIDE_PADDING as x,INNER_BOX as a,NUMBER_TEXT as m,SAME_KEYS as O,SECTION_BOX as P,TEXT as i,bandAccent as Y,bandProps as W,bandWrites as U,fillFrom as G,onBandPreset as X,innerPad as $,innerPadKeys as q,smallText as S,wrapperPad as j,wrapperPadKeys as z}from"./section-to-box-row-parts.js";import{EDITORIAL_LINE as V,fluidToken as J,headTree as Q,token as n}from"./section-head-looks.js";import{SECTION_BG_BUILT_IN as E}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{CARD_STYLES as s,CARD_STYLE_KEY as f}from"../../../sections/card-list-style.js";import{CARD_LIST_TYPE as Z,CARD_TEMPLATE_SLOT as ee,cardListProps as te}from"../../../../../format/lib/content/card-template.js";import{BOX_TYPE as d,CONTAINER_BLOCKS_SLOT as l}from"../../../../../format/lib/document/container-blocks.js";import{rowFieldTextSeed as c}from"../../../../../format/lib/document/blocks/general/Cards/card-seed.js";import{say as r}from"../../../../../format/lib/editor-words.js";import{STATS_OWN as A}from"../../../content/section-own-pads.js";const w=e=>typeof e=="string"?e.trim():"";function B(e){const t=`${w(e.prefix)}${w(e.value)}`,o=w(e.suffix);return e.emphasizeAll===!0?t?`==_${t}_==`:"":`${t}${o?`==_${o}_==`:""}`}const R={textStyle:"heading-2",...J("headingMedium",56,7,96),weight:500,case:"none",lineHeight:.9,letterSpacing:-.04},b={kind:"block",type:"Text",props:{...m,_partStyles:{text:R}},box:[["value","text",(e,t)=>B(t)]],when:(e,t)=>t!==void 0&&typeof t.value=="string"&&B(t)!==""},L=e=>g(e?.supSuffix),N={textStyle:"body-1",fontRole:"heading",...n("body",16),lineHeight:1.5,letterSpacing:-.01},C={color:"labels",...n("label",12),lineHeight:1.5,letterSpacing:.24},I={...a,direction:"row",align:"start",gap:32,gapPhone:32,share:"content",phoneRow:2,[D("share")]:"content"},F={textStyle:"body-5",...n("label",13),weight:500,color:"accent",letterSpacing:.18,lineHeight:1,padding:12},y=e=>k(e.background,E.StatsParagraph),p=e=>y(e)===M,u=e=>({...e,sectionAccent:e.sectionAccent??0}),oe=(e,t)=>p(e)?G("background",(o,h)=>X(u(o),h))(e,t):{},re={name:"Stats with Text",skip:e=>y(e)&&y(e)!=="transparent"&&!p(e)?"it paints a colour of its own, not the section band":void 0,boxProps:(e,t)=>({...P,direction:"column",gap:60,gapPhone:60,sectionBorder:{bottom:1},...V,...$(e,"StatsParagraph"),...p(e)?W(u(e),t):{}}),box:[...O.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,o)=>p(t)?Y(e,u(t),o):e],...q("StatsParagraph")],site:(e,t)=>p(e.props)?U({props:u(e.props)},t):[],parts:[Q("StatsParagraph"),{kind:"group",name:"Stats",props:{...a,...s.table.grid,[f]:"table"},parts:[{kind:"list",key:"stats",name:"Stat",perRow:()=>4,rowName:"Stats row",rowProps:{...a,direction:"row",share:"equal",phoneRow:2,...s.table.row},props:(e,t)=>({...a,...s.table.card,...oe(e,t)}),parts:[{...b,when:(e,t)=>!L(t)&&b.when(e,t)},{kind:"group",name:"Figure",props:I,when:(e,t)=>L(t),parts:[b,{kind:"text",key:"supSuffix",props:i,style:F}]},{kind:"group",name:"Words",props:{...a,gap:4,gapPhone:4},parts:[{kind:"text",key:"label",props:i,style:N},S("sub",C)]}]}]}],drop:{...T,...x,background:"the band is the Box's theme: the site's band preset (`sectionAccent`), or a declared band-preset write; none paints nothing, and any other colour is skipped",headPlacement:"needs a row per head placement: an own-box Stats with Text draws no head (its words sit in a Section Header above it), the row always draws the head"}},ae=new Set(["value","label",_]),se=e=>{const t=k(typeof e.background=="string"?e.background:void 0,E.Stats);return!!t&&t!=="transparent"},ne={name:"Stats",skip:e=>se(e)?"it paints a colour inside its padding, and a Box paints its Fill over the padding too":g(e.dataSource)?"its figures come from a source":Array.isArray(e.items)&&e.items.some(t=>g(t?.[_]))?"a figure names a count, and each figure Text here is typed by hand until it is linked":Array.isArray(e.items)&&e.items.some(t=>Object.keys(t??{}).some(o=>!ae.has(o)))?"a figure has a key no part here reads":Object.keys(e._partStyles??{}).some(t=>t!=="heading")?"a figure or a name has a style of its own, kept by kind, which no part here reads":void 0,boxProps:e=>({...P,direction:"column",gap:24,gapPhone:24,...j(e,A)}),box:[...O,...z(A)],parts:[S("heading",{color:"labels",...n("label",12),letterSpacing:.2}),{kind:"group",name:"Stats",props:{...a,...s.list.grid,[f]:"list"},parts:[{kind:"list",key:"items",name:"Stat",perRow:e=>H(e.columns)??4,rowName:"Stats row",rowProps:{...a,direction:"row",share:"equal",phoneRow:2,...s.list.row},props:{...a,...s.list.card},parts:[{kind:"text",key:"value",props:m,style:{textStyle:"heading-2",...n("headingMedium",48,36),weight:500,case:"none",lineHeight:1,letterSpacing:-.03}},S("label",{color:"labels",...n("label",12),letterSpacing:.2})]}]}],drop:{...T,...x,columns:"the rows of N: one row Box per `columns` figures, which the Box draws",dataSource:"an empty source is typed figures, what the row draws; a sourced node is skipped (0 Hartes nodes)",dataSourceOptions:"read only with a source; a sourced node is skipped (0 Hartes nodes)",contained:"the Box draws the site frame now; each figure fills the Box's column",background:"only no fill reaches here: a node that paints a colour is skipped"}},xe={StatsParagraph:re,Stats:ne};function Oe(){return{eyebrow:r("By the numbers"),title:r("What we count."),desc:r("A few numbers that matter to us."),stats:[],background:"transparent"}}const ie=[{key:"figure",label:"Figure"},{key:"superscript",label:"Superscript"},{key:"label",label:"Label"},{key:"body",label:"Text",multiline:!0}];function Pe(){const e=(t,o,h,v="")=>({key:K("stat"),figure:t,superscript:v,label:o,body:h});return[e("28==_yr_==",r("Years in business"),r("Privately held since day one. Same two founders.")),e("==_8_==",r("Operating footprint"),r("Los Angeles · Fort Lauderdale · Bewdley · Drachten · Mumbai · Selangor · Ho Chi Minh · Sydney. Three continents covered from one California design studio."),r("cities")),e("−21==_%_==",r("Avg. weight saving"),r("Versus OEM equivalents, across our forged catalog.")),e("14==_×_==",r("Finish steps"),r("Specified in California to a 14-step protocol. No two sets are identical."))]}function pe(e){return{type:d,props:{...a,name:"Card",...structuredClone(s[e].listCard)},slots:{[l]:[{type:d,props:{...I,name:"Figure"},slots:{[l]:[c("figure",m,R),c("superscript",i,F)]}},{type:d,props:{...a,name:"Words",gap:4,gapPhone:4},slots:{[l]:[c("label",{...i,widthFit:"fill"},N),c("body",{...i,widthFit:"fill"},C,!0)]}}]}}}function Ee(e,t,o=4){return{type:d,props:{...a,name:"Stats",direction:"row",columns:o,...structuredClone(s[t].items),[f]:t},slots:{[l]:[{type:Z,props:te(e,ie),slots:{[ee]:[pe(t)]}}]}}}export{xe as STATS_SECTION_TO_BOX,B as figureWords,Ee as statsBoxSeed,Oe as statsPressSeed,Pe as statsSeedRows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as W,registerSectionToBox as t}from"../../../sections/section-to-box.js";import{BUTTON as
|
|
1
|
+
import{hasWords as W,registerSectionToBox as t}from"../../../sections/section-to-box.js";import{BUTTON as O,DIM as y,DROP_COMMON as s,DROP_SIDE_PADDING as _,INNER_BOX as o,leadLine as M,SAME_KEYS as d,SECTION_BOX as p,TEXT as l,innerPad as w,siteGutterOf as B,innerPadKeys as k,smallText as P,wrapperPad as f,wrapperPadKeys as u}from"./section-to-box-row-parts.js";import{CARDS_SECTION_TO_BOX as U}from"./section-to-box-rows-cards.js";import{SITE_SIDE as E}from"efficient-easel/screen/lib/content/length-units";import{storedUnit as x}from"../../../../../format/lib/content/css-length.js";import{finiteNumber as G}from"../../../../../format/lib/finite-number.js";import{STATS_SECTION_TO_BOX as F}from"./section-to-box-rows-stats.js";import{LOGOS_SECTION_TO_BOX as K}from"./section-to-box-rows-logos.js";import{STRIP_SECTION_TO_BOX as Y}from"./section-to-box-rows-strip.js";import{TIMELINE_SECTION_TO_BOX as j}from"./section-to-box-rows-timeline.js";import{LOCATIONS_SECTION_TO_BOX as z}from"./section-to-box-rows-locations.js";import{HEAD_ONLY_SECTION_TO_BOX as q}from"./section-to-box-rows-head.js";import{PAGE_HEADER_SECTION_TO_BOX as J}from"./section-to-box-rows-pageheader.js";import{TAB_BAR_SECTION_TO_BOX as Q}from"./section-to-box-rows-tabbar.js";import{DOCBODY_SECTION_TO_BOX as V}from"./section-to-box-rows-docbody.js";import{EDITORIAL_SECTION_TO_BOX as Z}from"./section-to-box-rows-editorial.js";import{FORMS_SECTION_TO_BOX as $}from"./section-to-box-rows-forms.js";import{CHECKOUT_SECTION_TO_BOX as ee}from"./section-to-box-rows-checkout.js";import{PROOF_SECTION_TO_BOX as te}from"./section-to-box-rows-proof.js";import{INTEGRATIONS_SECTION_TO_BOX as oe}from"./section-to-box-rows-integrations.js";import{PROMO_SECTION_TO_BOX as ne}from"./section-to-box-rows-promo.js";import{FITMENT_SECTION_TO_BOX as ie}from"./section-to-box-rows-fitment.js";import{fluidToken as re,headTree as N,token as i}from"./section-head-looks.js";import{CTA_PH as h,PH as ae,phAccentAsMarks as m}from"../../../../../format/lib/document/blocks/placeholders.js";import{PROSE_PH as b}from"../../../../../format/lib/document/blocks/general/Prose/meta.js";import{PARAGRAPHS_A_PH as T}from"../../../../../format/lib/document/blocks/general/ParagraphsA/meta.js";import{BANNER_PH as se}from"../../../../../format/lib/document/blocks/general/Banner/meta.js";import{TITLE_WITH_BUTTONS_PH as de,TITLE_WITH_BUTTONS_SCAFFOLD_BUTTONS as pe}from"../../../../../format/lib/document/blocks/general/TitleWithButtons/meta.js";import{SECTION_HEADER_PH as a}from"../../../../../format/lib/document/blocks/general/SectionHeader/meta.js";import{INTRO_PH as S}from"../../../../../format/lib/document/blocks/general/IntroBleed/meta.js";import{boxPadding as le,fillSlot as he}from"../../../../../format/lib/document/seed-parts.js";import{BANNER_OWN as I,PROSE_OWN as H,SECTION_HEADER_OWN as A}from"../../../content/section-own-pads.js";const me={name:"Editorial Text",boxProps:e=>({...p,direction:"column",gap:28,gapPhone:28,sectionBorder:{top:1},...f(e,H)}),box:[["topBorder","sectionBorder",e=>e===!1?void 0:{top:1}],...d,...u(H)],parts:[N("Prose"),{kind:"text",key:"body",props:y,style:{textStyle:"body-1",...i("body",16),lineHeight:1.7,paragraphSpacing:18}}],drop:{...s,..._,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)"}},R={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},C=(e,n)=>n?.variant==="primary",v=(e,n)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:e,parts:[{kind:"button",key:"label",href:"href",when:C,variant:"primary",style:{letterSpacing:.3},props:{...O,...R,...n}},{kind:"button",key:"label",href:"href",when:(r,g)=>!C(r,g),variant:"ghost",style:{letterSpacing:.3},props:{...O,...R,...n}}]}),c=e=>W(e.title),ge={name:"Call-to-Action Heading",boxProps:e=>({...p,direction:"row",align:"center",justify:c(e)?"between":"end",gap:60,gapPhone:60,share:"content",sectionBorder:{bottom:1},...w(e,"TitleWithButtons")}),box:[...d,...k("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",...re("headingLarge",48,7,108),case:"upper",lineHeight:.94,letterSpacing:-.035},mark:"accentItalic"}]},{kind:"group",name:"Buttons",props:e=>({...o,gap:14,gapPhone:14,widthFitPhone:"fill",...c(e)?{minWidth:280,minWidthPhone:0}:{}}),parts:[v(c,{widthFit:"fill",iconPosition:"end"}),v(e=>!c(e),{})]}],drop:{...s,buttonsAlign:"moves the buttons only when there is no heading (4 of 128 live nodes), where the Box puts them at the end. 0 of 128 live nodes store it (the live export, 2026-10-24)",buttonsAlignPhone:"the phone's own side of `buttonsAlign`, read only with no heading; no old node stores it (it is new with the Phone view's Block alignment row), so nothing moves",buttonsAlignTablet:"the tablet's own side of `buttonsAlign`, read only with no heading; no old node stores it (it is new with the Tablet view's Block alignment row, 0 stored on the US sites 2026-11-05), so nothing moves"}};function Te(e,n){const r=B(n,{to:x(e.sectionPaddingUnitTablet??e.sectionPaddingUnit)}),g=B(n,{view:"phone",to:x(e.sectionPaddingUnitPhone),maxPx:20});return{sectionPaddingLeft:E,sectionPaddingRight:E,sectionPaddingLeftTablet:r,sectionPaddingRightTablet:r,sectionPaddingLeftPhone:g,sectionPaddingRightPhone:g}}const ce={name:"Section Header",boxProps:(e,n)=>({...p,direction:"column",gap:0,...f(e,A),...Te(e,n)}),box:[...d,...u(A)],parts:[N("SectionHeader")],drop:{...s,..._,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"}},L={...o,direction:"row",share:[67],gap:32},X={...o,sectionPaddingLeft:24,sectionPaddingLeftPhone:0},D=(e,n,r)=>({kind:"group",name:e,props:n,parts:[r]}),Oe={name:"Lead Text",boxProps:e=>({...p,direction:"column",gap:40,gapPhone:40,sectionBorder:{bottom:1},...w(e,"ParagraphsA")}),box:[...d,...k("ParagraphsA")],parts:[{kind:"group",name:"Numbers",props:{...L,gapPhone:24,sectionBorder:{bottom:1},sectionPaddingBottom:40,sectionPaddingBottomPhone:40},parts:[{kind:"group",name:"Eyebrow",props:{...o,sectionPaddingTop:5,sectionPaddingBottom:1,sectionPaddingTopPhone:5,sectionPaddingBottomPhone:1},parts:[P("eyebrow",{color:"labels",...i("label",12),letterSpacing:.24})]},D("Stats column",o,{kind:"group",name:"Stats",props:{...X,gap:0,gapPhone:0},parts:[{kind:"list",key:"stats",name:"Stat",flat:!0,parts:[M("value","label",{...i("label",13),letterSpacing:.18,lineHeight:1.8})]}]})]},{kind:"group",name:"Words",props:{...L,gapPhone:28},parts:[{kind:"group",name:"Lead",props:o,parts:[{kind:"group",name:"Measure",props:{...o,maxWidth:780},parts:[{kind:"text",key:"lead",props:l,style:{textStyle:"heading-3",...i("headingSmall",22,20),weight:400,case:"none",lineHeight:1.45,letterSpacing:-.005}}]}]},D("Note column",{...o,justify:"end"},{kind:"group",name:"Founders",props:{...X,gap:8,gapPhone:8},parts:[{kind:"group",name:"Note",props:{...o,gap:6,gapPhone:6},parts:[{kind:"text",key:"foundersHeading",props:l,style:{textStyle:"body-1",fontRole:"heading",...i("body",18,16),weight:500,letterSpacing:-.01,lineHeight:1.7}},{kind:"text",key:"foundersBody",props:y,style:{textStyle:"body-5",fontRole:"heading",...i("body",14,12),lineHeight:1.7}}]},P("attribution",{...i("label",12,10),letterSpacing:.24,lineHeight:1.7})]})]}],drop:{...s}},_e={name:"Banner",boxProps:e=>({...p,direction:"column",gap:0,...f(e,I)}),box:[...d,"contained",...u(I)],parts:[{kind:"group",name:"Card",keepEmpty:!0,props:{...o,gap:28,gapPhone:28,placement:"top-left",darken:60,darkenStyle:"even",sectionBorder:{width:1},...he("surface"),...le(64,40,40,24)},box:[["imageSrc","bgImage"],["overlay","darken",e=>Math.min(Math.max(G(e)??60,0),100)]],parts:[{kind:"group",name:"Words",props:{...o,gap:20,gapPhone:20},parts:[P("eyebrow"),{kind:"text",key:"title",role:"heading",props:{...l,maxWidth:680},style:{weight:500,lineHeight:1.05,letterSpacing:-.03,case:"none",...i("headingMedium",44,32)}},{kind:"text",key:"body",props:{...l,maxWidth:680},style:{textStyle:"body-1",lineHeight:1.6,...i("body",16)}}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:O}]}],drop:{...s,..._}},Pe={Prose:me,TitleWithButtons:ge,SectionHeader:ce,ParagraphsA:Oe,Banner:_e},Ve={Prose:()=>({eyebrow:b.eyebrow,title:m(b.title),body:b.body}),TitleWithButtons:()=>({title:m(de.title),buttons:pe.map(e=>({...e}))}),SectionHeader:()=>({num:a.num,title:m(a.title),description:a.description,linkText:a.linkText,linkHref:h.href}),ParagraphsA:()=>({eyebrow:T.eyebrow,lead:ae.body,foundersHeading:T.foundersHeading,foundersBody:T.foundersBody,attribution:T.attribution}),Banner:()=>({...se,ctaText:h.text,ctaHref:h.href}),ProcessSteps:()=>({num:a.num,title:m(a.title)}),IntroBleed:()=>({eyebrow:S.eyebrow,title:m(S.title),body:S.body,ctaText:h.text,ctaHref:h.href})};function Ze(){t(Pe),t(F),t(K),t(U),t(Y),t(j),t(z),t(q),t(J),t(Q),t(V),t(Z),t($),t(ee),t(ie),t(te),t(oe),t(ne)}export{Pe as GENERAL_SECTION_TO_BOX,Ve as TEXT_PRESS_STARTERS,Ze as registerGeneralSectionRows};
|
|
@@ -6,8 +6,12 @@ export type SectionTextPartsProps = {
|
|
|
6
6
|
partStyles?: PartStyles;
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
};
|
|
9
|
+
export type SectionTextBridgeProps = SectionTextPartsProps & {
|
|
10
|
+
sizeCaps?: Readonly<Record<string, true>>;
|
|
11
|
+
};
|
|
9
12
|
export type EditingBridges = {
|
|
10
|
-
SectionTextParts?: ComponentType<
|
|
13
|
+
SectionTextParts?: ComponentType<SectionTextBridgeProps>;
|
|
11
14
|
};
|
|
12
15
|
export declare const EditingBridgesProvider: import("react").Provider<EditingBridges>;
|
|
16
|
+
export declare const BlockSizeCapsProvider: import("react").Provider<Readonly<Record<string, true>> | undefined>;
|
|
13
17
|
export declare function SectionTextParts(props: SectionTextPartsProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,Fragment as
|
|
1
|
+
"use client";import{jsx as r,Fragment as d}from"react/jsx-runtime";import{createContext as o,useContext as i}from"react";const n=o({}),C=n.Provider,s=o(void 0),g=s.Provider;function p(e){const{SectionTextParts:t}=i(n),c=i(s);return t?r(t,{...e,sizeCaps:c}):r(d,{children:e.children})}export{g as BlockSizeCapsProvider,C as EditingBridgesProvider,p as SectionTextParts};
|
|
@@ -174,7 +174,9 @@ export declare function partStyleSource<E extends {
|
|
|
174
174
|
export declare function storedPartStyle(styles: PartStyles, styleKey: string): PartStyle;
|
|
175
175
|
export declare function applyPartStyles(stamps: readonly StyledPartStamp[], styles: PartStyles, baseOf?: (element: StyledPartEl) => PartStyleBase, styleKeyOf?: (partKey: string) => string, isInline?: (element: StyledPartEl) => boolean, screen?: PartScreen, drawsStyle?: (partKey: string) => boolean, capsSize?: (partKey: string) => boolean): number;
|
|
176
176
|
export declare function regionSheetStyle(style: PartStyle | undefined | null): PartStyle | null;
|
|
177
|
-
export declare function regionCanvasDeclarations(style: PartStyle | undefined | null, screen: PartScreen
|
|
177
|
+
export declare function regionCanvasDeclarations(style: PartStyle | undefined | null, screen: PartScreen, options?: {
|
|
178
|
+
sizeCap?: boolean;
|
|
179
|
+
}): {
|
|
178
180
|
fontFamily?: string;
|
|
179
181
|
fontSize?: string;
|
|
180
182
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{textStyleCaseCss as pe,textStyleCaseOfCss as de,viewKeyAt as Y}from"efficient-easel/draw";import{FONT_OPTIONS as ge,fontOption as xe,fontRoleOf as $,SIZE_STEP_OF_ROLE as F}from"../../../format/lib/fonts.js";import{encodePartKey as V}from"../../../format/lib/document/part-key.js";import{decodePartId as Z,normalizePartText as y}from"./text-parts.js";import{partInkCss as he}from"../../../format/lib/document/part-inks.js";import{regionStyle as Se}from"../../../format/lib/sections/text-regions.js";import{EDGE_PHONE_MEDIA as be,EDGE_TABLET_MEDIA as me,PHONE_MEDIA as Te,TABLET_MEDIA as Pe,viewOverrides as ze}from"../content/view-values.js";import{plainRecord as M,propsWithPartRecord as _e,readPartRecord as Ae,readPartRecords as Re}from"../../../format/lib/document/part-records.js";import{isLengthUnit as L}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as A,storedUnit as Ee}from"../../../format/lib/content/css-length.js";import{hasOwnEntry as k,ownEntry as q}from"../../../format/lib/own-entry.js";const D="_partStyles",we="data-sf-part-styled",J="data-sf-text-style",$e=/^(heading|body)-[1-7]$/;function m(e){return typeof e=="string"&&$e.test(e)}const Q={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function ke(e){if(!e)return null;for(const[t,n]of Object.entries(Q))if(n===e)return t;return null}function Ct(e){if(m(e.textStyle))return e.textStyle;const t=$(e.role);return t?Q[t]:void 0}const Ne=[400,500,600,700],E=["left","center","right","justify"],H=5,U=1e3,Oe=-5,Ie=10,Fe=0,ye=64,Me=2,ee={size:{min:H,max:U,step:1},sizeTablet:{min:H,max:U,step:1},sizePhone:{min:H,max:U,step:1},padding:{min:Fe,max:ye,step:Me}},Le=.05,De=.01,He=["line","letter"],Ue=.5,je=2.5,Ce=-1,ve=1,We=0,Ge=400,Ke=[...new Set(Object.values(F))];function vt(e){return[`${e} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${e}:hover, ${e}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function Wt(e){return Re(e,D)}function te(e,t){return Ae(e,D,t)}function Gt(e,t){return Object.values(te(e,t)).filter(n=>n!==void 0).length}function ne(e,t,n){return _e(e,D,t,Be(n).length?n:null)}function Be(e){return Object.entries(e).filter(([,t])=>t!==void 0)}function Xe(e){return He.includes(e)}const w=(e,t,n)=>Math.min(n,Math.max(t,e)),Ye=["sizeUnit","sizeUnitTablet","sizeUnitPhone"];function j(e){const t=Y("sizeUnit",e),n=Ye.find(i=>i===t);if(!n)throw new Error(`a part stores no unit key ${t}`);return n}const T={size:j("desktop"),sizeTablet:j("tablet"),sizePhone:j("mobile"),paragraphSpacing:"paragraphSpacingUnit",padding:"paddingUnit"},ie=Object.values(T);function h(e,t){return Ee(e[T[t]])}function Ve(e,t,n={}){if(ie.includes(e))return L(t)&&t!=="px"?t:null;if(k(T,e)&&h(n,e)!=="px"){const i=z(Number(t),2);return!Number.isFinite(i)||i<0||i===0&&e!=="padding"?null:i}if(Xe(e)){const i=Math.round(Number(t));return!Number.isFinite(i)||i===0?null:w(i,Oe,Ie)}if(e==="lineHeight"){const i=Number(t);return Number.isFinite(i)?z(w(i,Ue,je),3):null}if(e==="letterSpacing"){const i=Number(t);return Number.isFinite(i)?z(w(i,Ce,ve),4):null}if(e==="paragraphSpacing"){const i=Math.round(Number(t));return!Number.isFinite(i)||i<=0?null:w(i,We,Ge)}if(k(ee,e)){const{min:i,max:o}=ee[e],r=Math.round(Number(t));return Number.isFinite(r)?w(r,i,o):null}return e==="italic"?typeof t=="boolean"?t:null:e==="role"||e==="fontRole"?$(t)?t:null:e==="sizeToken"?C(t)?t:null:e==="textStyle"?m(t)?t:null:e==="alignPhone"||e==="alignTablet"?E.includes(t)?t:null:t}const Ze=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function R(e){let t=null;const n=i=>{t??={...e},delete t[i]};for(const i of Ze){const o=e[i];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(i)}e.align!==void 0&&!E.includes(e.align)&&n("align"),e.alignTablet!==void 0&&!E.includes(e.alignTablet)&&n("alignTablet"),e.alignPhone!==void 0&&!E.includes(e.alignPhone)&&n("alignPhone"),e.textStyle!==void 0&&!m(e.textStyle)&&n("textStyle"),e.sizeToken!==void 0&&!C(e.sizeToken)&&n("sizeToken"),e.fontRole!==void 0&&!$(e.fontRole)&&n("fontRole");for(const i of ie)e[i]!==void 0&&!L(e[i])&&n(i);return t??e}function C(e){if(!e||typeof e!="object")return!1;const{step:t,px:n,stepPhone:i,pxPhone:o,fluid:r}=e,f=c=>typeof c=="number"&&Number.isFinite(c)&&c>0,s=c=>typeof c=="string"&&Ke.includes(c);return s(t)&&f(n)&&(i===void 0||s(i))&&(o===void 0||f(o))&&(r===void 0||qe(r,n))}function qe(e,t){if(!e||typeof e!="object"||Array.isArray(e))return!1;const{minPx:n,vw:i,...o}=e;return Object.keys(o).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<t&&typeof i=="number"&&Number.isFinite(i)&&i>0&&i<=100}function v(e){return e?.pxPhone&&C(e)?{step:e.stepPhone??e.step,px:e.pxPhone}:null}function oe({step:e,px:t,fluid:n}){const i=n?`clamp(${n.minPx}px, ${n.vw}vw, ${t}px)`:`${t}px`,o=`var(--size-${e}, ${i})`;return e.startsWith("heading")?`min(${o}, var(--sf-heading-max,9999px))`:o}const Je=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Qe(e){const t=[];for(const[n,i]of Je)n===e?t.push(i):i===e&&t.push(n);return t}function Kt(e,t,n,i){const o={...te(e,t)},r=i==null?null:Ve(n,i,o);if(r===null)delete o[n];else{o[n]=r;for(const f of Qe(n))delete o[f]}return ne(e,t,o)}function Bt(e,t){return ne(e,t,{})}function et(e){return de(e)??"none"}function tt(e){return pe(e)??""}const re={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 nt(e,t){const n=$(e.role);return n||(t?.blockDrawsStyle?null:ke(e.textStyle))}const it="--sf-part-size-cap";function W(e,t){return e&&t?.sizeCap?`min(${e}, var(${it}, ${e}))`:e}function Xt(e,t){return e?.[t]===!0}function Yt(e,t){return e==="Text"&&t==="text"}const ot={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 rt(e){const t=F[e],n=q(ot,t);return n?`var(--size-${t}, ${n})`:`var(--size-${t})`}function at(e){const t={};return typeof e.lineHeight=="number"?t.lineHeight=e.lineHeight:e.line&&(t.lineHeight=z(st+e.line*Le,3)),typeof e.letterSpacing=="number"?t.letterSpacingEm=e.letterSpacing:e.letter&&(t.letterSpacingEm=z(e.letter*De,4)),t}const st=1,P="--sf-part-para";function ft(e,t){e=R(e);const n={};if(typeof e.sizePhone=="number"&&e.sizePhone>0)n.fontSize=A(e.sizePhone,h(e,"sizePhone"));else{const o=v(e.sizeToken);if(o)n.fontSize=oe(o);else{const r=O(e);r!==void 0&&(n.fontSize=A(r,h(e,"sizeTablet")))}}n.fontSize&&(n.fontSize=W(n.fontSize,t));const i=e.alignPhone??N(e);return i&&(n.textAlign=i),n}function N(e){return e.alignTablet&&e.alignTablet!==e.align?e.alignTablet:void 0}function O(e){const n=e.sizeTablet!==void 0&&h(e,"sizeTablet")!==h(e,"size")?e.sizeTablet:ze("textSize",e.size,e.sizeTablet,void 0).tablet;return n&&n>0?n:void 0}function ct(e,t){const n=R(e),i={},o=O(n);o!==void 0&&(i.fontSize=W(A(o,h(n,"sizeTablet")),t));const r=N(n);return r&&(i.textAlign=r),i}function Vt(e,t){if(t==="desktop")return;const n=R(e);return(t==="mobile"?N(n):void 0)??n.align}function lt(e,t){if(t==="desktop")return e;const n=R(e),i=O(n),o=N(n);if(t==="tablet"){let s=e;return i!==void 0&&(s={...s,size:i,sizeUnit:n[T.sizeTablet]}),o&&(s={...s,align:o}),s}let r=e;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone,sizeUnit:n[T.sizePhone]};else{const s=v(n.sizeToken);s?r={...r,size:void 0,sizeToken:s}:i!==void 0&&(r={...r,size:i,sizeUnit:n[T.sizeTablet]})}const f=n.alignPhone??o;return f&&(r={...r,align:f}),r}function G(e,t,n){return K(lt(e,t),I,n)}function ut(e){return Y("size",e)}function Zt(e,t){if(t==="desktop")return null;const n=R(e);if(t==="mobile"){if(v(n.sizeToken))return null;const i=O(n);if(i!==void 0)return{px:i,view:"tablet"}}return typeof n.size=="number"&&n.size>0?{px:n.size,view:"desktop"}:null}function ae(e,t){const n=ut(t);if(!k(e,n))return e;const i={...e};return delete i[n],i}function qt(e,t,n){const i=G(ae(e,t),t,n);return{fontFamily:i.fontFamily,fontSize:i.fontSize}}function K(e,t,n){e=R(e);const i=nt(e,n),o=at(e),r=W(e.size?A(e.size,h(e,"size")):e.sizeToken?oe(e.sizeToken):i?rt(i):"",n);return{fontFamily:e.font?xt(e.font):e.fontRole?`var(${re[e.fontRole]})`:i?`var(${re[i]})`:"",fontWeight:e.weight?String(e.weight):"",fontSize:r,minWidth:r?"0":"",overflowWrap:r?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[P]:e.paragraphSpacing?A(e.paragraphSpacing,h(e,"paragraphSpacing")):"",textTransform:tt(e.case),textAlign:e.align??"",paddingTop:se(e.padding,h(e,"padding")),paddingBottom:se(e.padding,h(e,"padding")),color:pt(e.color),fontStyle:e.italic===!0?"italic":e.italic===!1?"normal":""}}const pt=e=>he(e),se=(e,t)=>e===void 0?"":A(e,t),z=(e,t)=>Number(e.toFixed(t));function Jt(e,t){const n=Number.parseFloat(e.fontSize)||16,i=Number.parseFloat(e.lineHeight),o=Number.parseFloat(e.letterSpacing),r=Number.parseFloat(e.paddingTop);return{fontKey:t,sizePx:n,weight:dt(Number.parseInt(e.fontWeight,10)),lineRatio:Number.isFinite(i)?z(i/n,3):1.2,letterEm:Number.isFinite(o)?z(o/n,4):0,align:gt(e.textAlign),case:et(e.textTransform),paddingPx:Number.isFinite(r)?Math.round(r):0}}function dt(e){return Number.isFinite(e)?Ne.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t):400}function gt(e){for(const t of E)if(t===e)return t;return e==="end"?"right":"left"}function Qt(e,t){const n=fe(e);if(!n)return"";for(const i of ge)if(fe(t(i.cssVar))===n)return i.key;return""}const fe=e=>(e.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function xt(e){const t=xe(e);return t?`var(${t.cssVar})`:""}function en(e,t,n,i){return!t||Z(t)?.nodeId!==e?null:n.find(r=>i(r.getAttribute("class")))??n[0]??null}function ht(e,t){return M(q(e,t))??{}}function tn(e,t,n=()=>I,i=c=>c,o=mt,r="desktop",f=()=>!1,s=()=>!1){let c=0;for(const{element:p,partId:S}of e){const g=Z(S)?.propKey;if(!g)continue;const a=ht(t,i(g)),l=G(a,r,{blockDrawsStyle:f(g),sizeCap:s(g)});m(a.textStyle)?p.setAttribute?.(J,a.textStyle):p.removeAttribute?.(J);const x=X.some(u=>p.style[u]);let d=!1;for(const[u,b]of Object.entries(l))zt(p,u,b),b&&(d=!0);if(x||X.some(u=>l[u]))for(const u of St(p,o))for(const b of X)u.style[b]=l[b]??"";d&&(c+=1)}return c}function St(e,t){const n=y(e.textContent??""),i=[];let o=e;for(let r=0;r<bt&&t(o);r+=1){const f=o.parentElement;if(!f||y(f.textContent??"")!==n)break;i.push(f),o=f}return i}const bt=8;function mt(e){const t=e;return typeof window>"u"||!t?.ownerDocument?!1:window.getComputedStyle(t).display==="inline"}const I={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function Tt(e){if(!e||typeof e!="object")return null;const t={};m(e.textStyle)&&(t.textStyle=e.textStyle),typeof e.size=="number"&&e.size>0&&(t.size=e.size),typeof e.sizeTablet=="number"&&e.sizeTablet>0&&(t.sizeTablet=e.sizeTablet),typeof e.sizePhone=="number"&&e.sizePhone>0&&(t.sizePhone=e.sizePhone);for(const n of["size","sizeTablet","sizePhone"]){const i=T[n];t[n]!==void 0&&L(e[i])&&(t[i]=e[i])}return Object.keys(t).length?t:null}function Pt(e,t){const n=Tt(e);if(!n)return{};const i=G(n,t);return{...i.fontFamily?{fontFamily:i.fontFamily}:{},...i.fontSize?{fontSize:i.fontSize}:{}}}function nn(e){return m(e?.textStyle)||!!e?.role||typeof e?.size=="number"&&e.size>0}function on(e,t,n){if(!e||typeof e!="object")return{};const i=Se(e.role,t,F)??{},o=t.sized?Pt(ae(e,n),n):{};return{...i,...o}}function rn(e,t,n){n.fontFamily&&e.fontFamily===n.fontFamily&&(e.fontFamily=t.fontFamily),n.fontSize&&e.fontSize===n.fontSize&&(e.fontSize=t.fontSize)}function zt(e,t,n){if(!t.startsWith("--")){e.style[t]=n;return}const i=e.style;typeof i.setProperty=="function"?n?i.setProperty(t,n):i.removeProperty?.(t):i[t]=n;const o=e;t===P&&(n?o.setAttribute?.(ce,""):o.removeAttribute?.(ce))}const ce="data-sf-part-para",_t=Object.keys(K({},I)),B=new Set(["color","overflowWrap",P,"fontStyle"]),X=_t.filter(e=>!B.has(e));function an(e,t,n,i=c=>c,o=()=>!1,r=()=>null,f=[],s=()=>!1){const c=new Map;for(const a of e){const l=V(a.key,a.row);for(const x of a.texts){const d=c.get(x);d?(d.keys.add(a.key),d.partKeys.add(l)):c.set(x,{keys:new Set([a.key]),partKeys:new Set([l])})}}const p=new Map;for(const a of new Set([...Object.keys(t),...f])){if(!At(a))continue;const l=le(n,a,M(t[a])??{},{blockDrawsStyle:!1},r(a));l&&p.set(a,l)}const S=a=>{const l=i(a),x=r(l);if(!k(t,l)&&!x)return null;const d=M(t[l])??{};return le(n,a,d,{blockDrawsStyle:o(a),sizeCap:s(a)},x)},g=new Map;for(const[a,{keys:l,partKeys:x}]of c){const d=x.size===1?[...x][0]:l.size===1?[...l][0]:null;if(!d)continue;const _=S(d);_&&g.set(a,_)}for(const a of e){if(!a.keyed)continue;const l=S(V(a.key,a.row));l&&p.set(a.key,l)}return g.size||p.size?{rules:g,kindRules:p,drawn:new Set(c.keys())}:null}function le(e,t,n,i,o){const r=K(n,I,i),f=ct(n,i),s=ft(n,i),c=m(n.textStyle)?n.textStyle:void 0;return!Object.values(r).some(Boolean)&&!Object.keys(f).length&&!Object.keys(s).length&&!c&&!o?null:{stamp:Rt(e,t),declarations:r,...Object.keys(f).length?{tablet:f}:{},...Object.keys(s).length?{phone:s}:{},...c?{textStyle:c}:{},...o?{motion:o}:{}}}function At(e){return e.startsWith("@")}function sn(e,t){return e?.kindRules.get(t)??null}function Rt(e,t){const n=i=>i.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(e)}~${n(t)}`}function Et(e){return e?{tablet:me,phone:be}:{tablet:Pe,phone:Te}}function fn(e,{inBox:t=!1}={}){const{tablet:n,phone:i}=Et(t),o=[],r=new Set,f=s=>{const{stamp:c,declarations:p}=s;if(r.has(c))return;r.add(c);const S=Object.entries(p).filter(([,u])=>u!==""),g=u=>u.map(([b,ue])=>`${$t(b)}: ${ue}`).join("; "),a=`[${we}="${c}"]`,l=S.filter(([u])=>!B.has(u)),x=S.filter(([u])=>B.has(u));l.length&&o.push(`${a}, *:has(> ${a}) { ${g(l)} }`),x.length&&o.push(`${a} { ${g(x)} }`),p[P]&&(o.push(`*:has(> ${a}) { ${P}: ${p[P]} }`),o.push(...wt(a,`*:has(> ${a})`)));const d=Object.entries(s.tablet??{}).filter(([,u])=>u!=="");d.length&&o.push(`@media ${n} { ${a}, *:has(> ${a}) { ${g(d)} } }`);const _=Object.entries(s.phone??{}).filter(([,u])=>u!=="");_.length&&o.push(`@media ${i} { ${a}, *:has(> ${a}) { ${g(_)} } }`)};for(const s of e.rules.values())f(s);for(const s of e.kindRules.values())f(s);return o.join(`
|
|
2
|
-
`)}function wt(e,t){const n=`var(${P})`,i=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${e} ${i}:not(:first-child) { margin-top: ${n} }`,`${e} ${i}:not(:last-child) { margin-bottom: ${n} }`,`:is(${t}) + :is(${t}) { margin-top: ${n} }`]}const $t=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function cn(e,t){if(!e)return null;const n=y(t),i=e.rules.get(n);if(i)return i;if(n.length<kt||e.drawn.has(n))return null;let o=null;for(const[r,f]of e.rules)if(r.includes(n)){if(o&&o.stamp!==f.stamp)return null;o=f}return o}const kt=8;export{E as PART_ALIGNS,ve as PART_LETTER_EM_MAX,
|
|
1
|
+
import{textStyleCaseCss as pe,textStyleCaseOfCss as de,viewKeyAt as Y}from"efficient-easel/draw";import{FONT_OPTIONS as ge,fontOption as xe,fontRoleOf as $,SIZE_STEP_OF_ROLE as F}from"../../../format/lib/fonts.js";import{encodePartKey as V}from"../../../format/lib/document/part-key.js";import{decodePartId as Z,normalizePartText as y}from"./text-parts.js";import{partInkCss as he}from"../../../format/lib/document/part-inks.js";import{regionStyle as Se}from"../../../format/lib/sections/text-regions.js";import{EDGE_PHONE_MEDIA as be,EDGE_TABLET_MEDIA as me,PHONE_MEDIA as Te,TABLET_MEDIA as Pe,viewOverrides as ze}from"../content/view-values.js";import{plainRecord as M,propsWithPartRecord as _e,readPartRecord as Ae,readPartRecords as Re}from"../../../format/lib/document/part-records.js";import{isLengthUnit as L}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as A,storedUnit as Ee}from"../../../format/lib/content/css-length.js";import{hasOwnEntry as k,ownEntry as q}from"../../../format/lib/own-entry.js";const D="_partStyles",we="data-sf-part-styled",J="data-sf-text-style",$e=/^(heading|body)-[1-7]$/;function m(e){return typeof e=="string"&&$e.test(e)}const Q={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function ke(e){if(!e)return null;for(const[t,n]of Object.entries(Q))if(n===e)return t;return null}function jt(e){if(m(e.textStyle))return e.textStyle;const t=$(e.role);return t?Q[t]:void 0}const Ne=[400,500,600,700],E=["left","center","right","justify"],H=5,C=1e3,Oe=-5,Ie=10,Fe=0,ye=64,Me=2,ee={size:{min:H,max:C,step:1},sizeTablet:{min:H,max:C,step:1},sizePhone:{min:H,max:C,step:1},padding:{min:Fe,max:ye,step:Me}},Le=.05,De=.01,He=["line","letter"],Ce=.5,Ue=2.5,je=-1,ve=1,We=0,Ge=400,Ke=[...new Set(Object.values(F))];function vt(e){return[`${e} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${e}:hover, ${e}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function Wt(e){return Re(e,D)}function te(e,t){return Ae(e,D,t)}function Gt(e,t){return Object.values(te(e,t)).filter(n=>n!==void 0).length}function ne(e,t,n){return _e(e,D,t,Be(n).length?n:null)}function Be(e){return Object.entries(e).filter(([,t])=>t!==void 0)}function Xe(e){return He.includes(e)}const w=(e,t,n)=>Math.min(n,Math.max(t,e)),Ye=["sizeUnit","sizeUnitTablet","sizeUnitPhone"];function U(e){const t=Y("sizeUnit",e),n=Ye.find(i=>i===t);if(!n)throw new Error(`a part stores no unit key ${t}`);return n}const T={size:U("desktop"),sizeTablet:U("tablet"),sizePhone:U("mobile"),paragraphSpacing:"paragraphSpacingUnit",padding:"paddingUnit"},ie=Object.values(T);function h(e,t){return Ee(e[T[t]])}function Ve(e,t,n={}){if(ie.includes(e))return L(t)&&t!=="px"?t:null;if(k(T,e)&&h(n,e)!=="px"){const i=z(Number(t),2);return!Number.isFinite(i)||i<0||i===0&&e!=="padding"?null:i}if(Xe(e)){const i=Math.round(Number(t));return!Number.isFinite(i)||i===0?null:w(i,Oe,Ie)}if(e==="lineHeight"){const i=Number(t);return Number.isFinite(i)?z(w(i,Ce,Ue),3):null}if(e==="letterSpacing"){const i=Number(t);return Number.isFinite(i)?z(w(i,je,ve),4):null}if(e==="paragraphSpacing"){const i=Math.round(Number(t));return!Number.isFinite(i)||i<=0?null:w(i,We,Ge)}if(k(ee,e)){const{min:i,max:o}=ee[e],r=Math.round(Number(t));return Number.isFinite(r)?w(r,i,o):null}return e==="italic"?typeof t=="boolean"?t:null:e==="role"||e==="fontRole"?$(t)?t:null:e==="sizeToken"?j(t)?t:null:e==="textStyle"?m(t)?t:null:e==="alignPhone"||e==="alignTablet"?E.includes(t)?t:null:t}const Ze=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function R(e){let t=null;const n=i=>{t??={...e},delete t[i]};for(const i of Ze){const o=e[i];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(i)}e.align!==void 0&&!E.includes(e.align)&&n("align"),e.alignTablet!==void 0&&!E.includes(e.alignTablet)&&n("alignTablet"),e.alignPhone!==void 0&&!E.includes(e.alignPhone)&&n("alignPhone"),e.textStyle!==void 0&&!m(e.textStyle)&&n("textStyle"),e.sizeToken!==void 0&&!j(e.sizeToken)&&n("sizeToken"),e.fontRole!==void 0&&!$(e.fontRole)&&n("fontRole");for(const i of ie)e[i]!==void 0&&!L(e[i])&&n(i);return t??e}function j(e){if(!e||typeof e!="object")return!1;const{step:t,px:n,stepPhone:i,pxPhone:o,fluid:r}=e,f=c=>typeof c=="number"&&Number.isFinite(c)&&c>0,s=c=>typeof c=="string"&&Ke.includes(c);return s(t)&&f(n)&&(i===void 0||s(i))&&(o===void 0||f(o))&&(r===void 0||qe(r,n))}function qe(e,t){if(!e||typeof e!="object"||Array.isArray(e))return!1;const{minPx:n,vw:i,...o}=e;return Object.keys(o).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<t&&typeof i=="number"&&Number.isFinite(i)&&i>0&&i<=100}function v(e){return e?.pxPhone&&j(e)?{step:e.stepPhone??e.step,px:e.pxPhone}:null}function oe({step:e,px:t,fluid:n}){const i=n?`clamp(${n.minPx}px, ${n.vw}vw, ${t}px)`:`${t}px`,o=`var(--size-${e}, ${i})`;return e.startsWith("heading")?`min(${o}, var(--sf-heading-max,9999px))`:o}const Je=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Qe(e){const t=[];for(const[n,i]of Je)n===e?t.push(i):i===e&&t.push(n);return t}function Kt(e,t,n,i){const o={...te(e,t)},r=i==null?null:Ve(n,i,o);if(r===null)delete o[n];else{o[n]=r;for(const f of Qe(n))delete o[f]}return ne(e,t,o)}function Bt(e,t){return ne(e,t,{})}function et(e){return de(e)??"none"}function tt(e){return pe(e)??""}const re={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 nt(e,t){const n=$(e.role);return n||(t?.blockDrawsStyle?null:ke(e.textStyle))}const it="--sf-part-size-cap";function W(e,t){return e&&t?.sizeCap?`min(${e}, var(${it}, ${e}))`:e}function Xt(e,t){return e?.[t]===!0}function Yt(e,t){return e==="Text"&&t==="text"}const ot={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 rt(e){const t=F[e],n=q(ot,t);return n?`var(--size-${t}, ${n})`:`var(--size-${t})`}function at(e){const t={};return typeof e.lineHeight=="number"?t.lineHeight=e.lineHeight:e.line&&(t.lineHeight=z(st+e.line*Le,3)),typeof e.letterSpacing=="number"?t.letterSpacingEm=e.letterSpacing:e.letter&&(t.letterSpacingEm=z(e.letter*De,4)),t}const st=1,P="--sf-part-para";function ft(e,t){e=R(e);const n={};if(typeof e.sizePhone=="number"&&e.sizePhone>0)n.fontSize=A(e.sizePhone,h(e,"sizePhone"));else{const o=v(e.sizeToken);if(o)n.fontSize=oe(o);else{const r=O(e);r!==void 0&&(n.fontSize=A(r,h(e,"sizeTablet")))}}n.fontSize&&(n.fontSize=W(n.fontSize,t));const i=e.alignPhone??N(e);return i&&(n.textAlign=i),n}function N(e){return e.alignTablet&&e.alignTablet!==e.align?e.alignTablet:void 0}function O(e){const n=e.sizeTablet!==void 0&&h(e,"sizeTablet")!==h(e,"size")?e.sizeTablet:ze("textSize",e.size,e.sizeTablet,void 0).tablet;return n&&n>0?n:void 0}function ct(e,t){const n=R(e),i={},o=O(n);o!==void 0&&(i.fontSize=W(A(o,h(n,"sizeTablet")),t));const r=N(n);return r&&(i.textAlign=r),i}function Vt(e,t){if(t==="desktop")return;const n=R(e);return(t==="mobile"?N(n):void 0)??n.align}function lt(e,t){if(t==="desktop")return e;const n=R(e),i=O(n),o=N(n);if(t==="tablet"){let s=e;return i!==void 0&&(s={...s,size:i,sizeUnit:n[T.sizeTablet]}),o&&(s={...s,align:o}),s}let r=e;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone,sizeUnit:n[T.sizePhone]};else{const s=v(n.sizeToken);s?r={...r,size:void 0,sizeToken:s}:i!==void 0&&(r={...r,size:i,sizeUnit:n[T.sizeTablet]})}const f=n.alignPhone??o;return f&&(r={...r,align:f}),r}function G(e,t,n){return K(lt(e,t),I,n)}function ut(e){return Y("size",e)}function Zt(e,t){if(t==="desktop")return null;const n=R(e);if(t==="mobile"){if(v(n.sizeToken))return null;const i=O(n);if(i!==void 0)return{px:i,view:"tablet"}}return typeof n.size=="number"&&n.size>0?{px:n.size,view:"desktop"}:null}function ae(e,t){const n=ut(t);if(!k(e,n))return e;const i={...e};return delete i[n],i}function qt(e,t,n){const i=G(ae(e,t),t,n);return{fontFamily:i.fontFamily,fontSize:i.fontSize}}function K(e,t,n){e=R(e);const i=nt(e,n),o=at(e),r=W(e.size?A(e.size,h(e,"size")):e.sizeToken?oe(e.sizeToken):i?rt(i):"",n);return{fontFamily:e.font?xt(e.font):e.fontRole?`var(${re[e.fontRole]})`:i?`var(${re[i]})`:"",fontWeight:e.weight?String(e.weight):"",fontSize:r,minWidth:r?"0":"",overflowWrap:r?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[P]:e.paragraphSpacing?A(e.paragraphSpacing,h(e,"paragraphSpacing")):"",textTransform:tt(e.case),textAlign:e.align??"",paddingTop:se(e.padding,h(e,"padding")),paddingBottom:se(e.padding,h(e,"padding")),color:pt(e.color),fontStyle:e.italic===!0?"italic":e.italic===!1?"normal":""}}const pt=e=>he(e),se=(e,t)=>e===void 0?"":A(e,t),z=(e,t)=>Number(e.toFixed(t));function Jt(e,t){const n=Number.parseFloat(e.fontSize)||16,i=Number.parseFloat(e.lineHeight),o=Number.parseFloat(e.letterSpacing),r=Number.parseFloat(e.paddingTop);return{fontKey:t,sizePx:n,weight:dt(Number.parseInt(e.fontWeight,10)),lineRatio:Number.isFinite(i)?z(i/n,3):1.2,letterEm:Number.isFinite(o)?z(o/n,4):0,align:gt(e.textAlign),case:et(e.textTransform),paddingPx:Number.isFinite(r)?Math.round(r):0}}function dt(e){return Number.isFinite(e)?Ne.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t):400}function gt(e){for(const t of E)if(t===e)return t;return e==="end"?"right":"left"}function Qt(e,t){const n=fe(e);if(!n)return"";for(const i of ge)if(fe(t(i.cssVar))===n)return i.key;return""}const fe=e=>(e.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function xt(e){const t=xe(e);return t?`var(${t.cssVar})`:""}function en(e,t,n,i){return!t||Z(t)?.nodeId!==e?null:n.find(r=>i(r.getAttribute("class")))??n[0]??null}function ht(e,t){return M(q(e,t))??{}}function tn(e,t,n=()=>I,i=c=>c,o=mt,r="desktop",f=()=>!1,s=()=>!1){let c=0;for(const{element:p,partId:S}of e){const g=Z(S)?.propKey;if(!g)continue;const a=ht(t,i(g)),l=G(a,r,{blockDrawsStyle:f(g),sizeCap:s(g)});m(a.textStyle)?p.setAttribute?.(J,a.textStyle):p.removeAttribute?.(J);const x=X.some(u=>p.style[u]);let d=!1;for(const[u,b]of Object.entries(l))zt(p,u,b),b&&(d=!0);if(x||X.some(u=>l[u]))for(const u of St(p,o))for(const b of X)u.style[b]=l[b]??"";d&&(c+=1)}return c}function St(e,t){const n=y(e.textContent??""),i=[];let o=e;for(let r=0;r<bt&&t(o);r+=1){const f=o.parentElement;if(!f||y(f.textContent??"")!==n)break;i.push(f),o=f}return i}const bt=8;function mt(e){const t=e;return typeof window>"u"||!t?.ownerDocument?!1:window.getComputedStyle(t).display==="inline"}const I={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function Tt(e){if(!e||typeof e!="object")return null;const t={};m(e.textStyle)&&(t.textStyle=e.textStyle),typeof e.size=="number"&&e.size>0&&(t.size=e.size),typeof e.sizeTablet=="number"&&e.sizeTablet>0&&(t.sizeTablet=e.sizeTablet),typeof e.sizePhone=="number"&&e.sizePhone>0&&(t.sizePhone=e.sizePhone);for(const n of["size","sizeTablet","sizePhone"]){const i=T[n];t[n]!==void 0&&L(e[i])&&(t[i]=e[i])}return Object.keys(t).length?t:null}function Pt(e,t,n){const i=Tt(e);if(!i)return{};const o=G(i,t,n?.sizeCap?{sizeCap:!0}:void 0);return{...o.fontFamily?{fontFamily:o.fontFamily}:{},...o.fontSize?{fontSize:o.fontSize}:{}}}function nn(e){return m(e?.textStyle)||!!e?.role||typeof e?.size=="number"&&e.size>0}function on(e,t,n){if(!e||typeof e!="object")return{};const i=Se(e.role,t,F)??{},o=t.sized?Pt(ae(e,n),n):{};return{...i,...o}}function rn(e,t,n){n.fontFamily&&e.fontFamily===n.fontFamily&&(e.fontFamily=t.fontFamily),n.fontSize&&e.fontSize===n.fontSize&&(e.fontSize=t.fontSize)}function zt(e,t,n){if(!t.startsWith("--")){e.style[t]=n;return}const i=e.style;typeof i.setProperty=="function"?n?i.setProperty(t,n):i.removeProperty?.(t):i[t]=n;const o=e;t===P&&(n?o.setAttribute?.(ce,""):o.removeAttribute?.(ce))}const ce="data-sf-part-para",_t=Object.keys(K({},I)),B=new Set(["color","overflowWrap",P,"fontStyle"]),X=_t.filter(e=>!B.has(e));function an(e,t,n,i=c=>c,o=()=>!1,r=()=>null,f=[],s=()=>!1){const c=new Map;for(const a of e){const l=V(a.key,a.row);for(const x of a.texts){const d=c.get(x);d?(d.keys.add(a.key),d.partKeys.add(l)):c.set(x,{keys:new Set([a.key]),partKeys:new Set([l])})}}const p=new Map;for(const a of new Set([...Object.keys(t),...f])){if(!At(a))continue;const l=le(n,a,M(t[a])??{},{blockDrawsStyle:!1,sizeCap:s(a)},r(a));l&&p.set(a,l)}const S=a=>{const l=i(a),x=r(l);if(!k(t,l)&&!x)return null;const d=M(t[l])??{};return le(n,a,d,{blockDrawsStyle:o(a),sizeCap:s(a)},x)},g=new Map;for(const[a,{keys:l,partKeys:x}]of c){const d=x.size===1?[...x][0]:l.size===1?[...l][0]:null;if(!d)continue;const _=S(d);_&&g.set(a,_)}for(const a of e){if(!a.keyed)continue;const l=S(V(a.key,a.row));l&&p.set(a.key,l)}return g.size||p.size?{rules:g,kindRules:p,drawn:new Set(c.keys())}:null}function le(e,t,n,i,o){const r=K(n,I,i),f=ct(n,i),s=ft(n,i),c=m(n.textStyle)?n.textStyle:void 0;return!Object.values(r).some(Boolean)&&!Object.keys(f).length&&!Object.keys(s).length&&!c&&!o?null:{stamp:Rt(e,t),declarations:r,...Object.keys(f).length?{tablet:f}:{},...Object.keys(s).length?{phone:s}:{},...c?{textStyle:c}:{},...o?{motion:o}:{}}}function At(e){return e.startsWith("@")}function sn(e,t){return e?.kindRules.get(t)??null}function Rt(e,t){const n=i=>i.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(e)}~${n(t)}`}function Et(e){return e?{tablet:me,phone:be}:{tablet:Pe,phone:Te}}function fn(e,{inBox:t=!1}={}){const{tablet:n,phone:i}=Et(t),o=[],r=new Set,f=s=>{const{stamp:c,declarations:p}=s;if(r.has(c))return;r.add(c);const S=Object.entries(p).filter(([,u])=>u!==""),g=u=>u.map(([b,ue])=>`${$t(b)}: ${ue}`).join("; "),a=`[${we}="${c}"]`,l=S.filter(([u])=>!B.has(u)),x=S.filter(([u])=>B.has(u));l.length&&o.push(`${a}, *:has(> ${a}) { ${g(l)} }`),x.length&&o.push(`${a} { ${g(x)} }`),p[P]&&(o.push(`*:has(> ${a}) { ${P}: ${p[P]} }`),o.push(...wt(a,`*:has(> ${a})`)));const d=Object.entries(s.tablet??{}).filter(([,u])=>u!=="");d.length&&o.push(`@media ${n} { ${a}, *:has(> ${a}) { ${g(d)} } }`);const _=Object.entries(s.phone??{}).filter(([,u])=>u!=="");_.length&&o.push(`@media ${i} { ${a}, *:has(> ${a}) { ${g(_)} } }`)};for(const s of e.rules.values())f(s);for(const s of e.kindRules.values())f(s);return o.join(`
|
|
2
|
+
`)}function wt(e,t){const n=`var(${P})`,i=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${e} ${i}:not(:first-child) { margin-top: ${n} }`,`${e} ${i}:not(:last-child) { margin-bottom: ${n} }`,`:is(${t}) + :is(${t}) { margin-top: ${n} }`]}const $t=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function cn(e,t){if(!e)return null;const n=y(t),i=e.rules.get(n);if(i)return i;if(n.length<kt||e.drawn.has(n))return null;let o=null;for(const[r,f]of e.rules)if(r.includes(n)){if(o&&o.stamp!==f.stamp)return null;o=f}return o}const kt=8;export{E as PART_ALIGNS,ve as PART_LETTER_EM_MAX,je as PART_LETTER_EM_MIN,De as PART_LETTER_STEP,Ue as PART_LINE_HEIGHT_MAX,Ce as PART_LINE_HEIGHT_MIN,Le as PART_LINE_STEP,ee as PART_MEASURED_TRACKS,Ie as PART_NUDGE_MAX,Oe as PART_NUDGE_MIN,ye as PART_PADDING_MAX,Fe as PART_PADDING_MIN,Me as PART_PADDING_STEP,ce as PART_PARAGRAPH_ATTR,Ge as PART_PARAGRAPH_MAX,We as PART_PARAGRAPH_MIN,P as PART_PARAGRAPH_VAR,He as PART_RELATIVE_PROPS,it as PART_SIZE_CAP_VAR,C as PART_SIZE_MAX,H as PART_SIZE_MIN,Ke as PART_SIZE_STEPS,we as PART_STYLED_ATTR,D as PART_STYLES_PROP,_t as PART_STYLE_PROPERTIES,T as PART_UNIT_KEY_OF,Ne as PART_WEIGHTS,X as SHARED_PART_PROPERTIES,Q as STYLE_ID_OF_ROLE,J as TEXT_STYLE_ATTR,tn as applyPartStyles,Xt as blockCapsPartSize,Yt as blockDrawsTextStyle,jt as followedStyleOf,At as isPartKindKey,m as isTextStyleId,wt as paragraphRules,Vt as partAlignFollowed,G as partCanvasDeclarations,et as partCaseOfTransform,tt as partCaseTransform,Qt as partFontKeyOf,vt as partLiftRules,ft as partPhoneDeclarations,sn as partRuleForKind,cn as partRuleForText,qt as partShownDeclarations,ut as partSizeBoxOf,Zt as partSizeFollowed,at as partSpacingOf,Jt as partStyleBase,Gt as partStyleCount,fn as partStyleCss,K as partStyleDeclarations,lt as partStyleForScreen,en as partStyleSource,ae as partStyleWithoutSizeBox,ct as partTabletDeclarations,Kt as propsWithPartStyleValue,Bt as propsWithoutPartStyle,an as publishedPartStyles,te as readPartStyle,Wt as readPartStyles,Pt as regionCanvasDeclarations,rn as regionCanvasRestore,nn as regionHasOwnLook,Tt as regionSheetStyle,on as regionShownDeclarations,ht as storedPartStyle,Et as viewMediaOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{CardRowDrawn as P}from"../../../components/CardRowContext.js";import{PublishedPartStyles as h}from"../../../components/PublishedPartStylesContext.js";import{readPartStyles as y}from"../part-styles.js";import{readPartMotions as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{CardRowDrawn as P}from"../../../components/CardRowContext.js";import{PublishedPartStyles as h}from"../../../components/PublishedPartStylesContext.js";import{readPartStyles as y}from"../part-styles.js";import{readPartMotions as C}from"../../animation/part-motion.js";import{partNeedles as _}from"../text-parts.js";import{CARD_LIST_TYPE as u,HOST_PART_TYPE as x,rowPartByKey as S}from"../../../../format/lib/content/card-template.js";import{BOX_TYPE as T}from"../../../../format/lib/document/container-blocks.js";import{BlockSizeCapsProvider as b}from"../editing-bridges.js";const Y={name:"clickableParts",applies:(n,e,a)=>typeof a?.render=="function"&&n!==u&&n!==x,draw(n,e,a){const r=n,p=()=>r.textParts??r.fields,c=r.partSizeCaps,l=r.render,m=a.inspector?.PartAnchors,f=(t,s)=>_(p(),s,o=>S(e,t,o));r.render=t=>{const s=y(t),o=C(t);return t.editor?.isEditing&&m?i(P,{type:e,props:t,children:d=>i(m,{needles:f(t,d),styles:s,motions:o,type:e,sizeCaps:c,children:i(b,{value:c,children:l(t)})})}):!Object.keys(s).length&&!Object.keys(o).length?l(t):i(P,{type:e,props:t,children:d=>i(h,{needles:f(t,d),styles:s,motions:o,type:e,atEdge:e===T,sizeCaps:c,children:l(t)})})}}};export{Y as clickableParts};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type OwnFrame } from "../../content/section-padding.js";
|
|
2
2
|
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
3
3
|
type InnerPadding = {
|
|
4
4
|
top: number;
|
|
@@ -14,9 +14,9 @@ export declare const ownPairDefault: (key: string) => InnerPadding | undefined;
|
|
|
14
14
|
export declare const PAD_ON_ROOT: ReadonlySet<string>;
|
|
15
15
|
export declare const PADS_ITS_OWN_SPACE: ReadonlySet<string>;
|
|
16
16
|
export declare const sectionPadding: BlockPass;
|
|
17
|
-
export declare const OWN_PAD_FRAME: Readonly<Record<string, (props: Record<string, unknown>) =>
|
|
17
|
+
export declare const OWN_PAD_FRAME: Readonly<Record<string, (props: Record<string, unknown>) => OwnFrame>>;
|
|
18
18
|
export declare const OWN_PAD_LABEL: Readonly<Record<string, string>>;
|
|
19
19
|
export declare function withPadTotals(props: Record<string, unknown>, changed: Readonly<Record<string, unknown>> | undefined): Record<string, unknown>;
|
|
20
|
-
export declare function olderPadNote(props: Record<string, unknown>, frame: number): string | null;
|
|
20
|
+
export declare function olderPadNote(props: Record<string, unknown>, frame: number, side?: "top" | "bottom"): string | null;
|
|
21
21
|
export declare const blockPadding: BlockPass;
|
|
22
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{SideOnceClass as I}from"../../../components/SideSpaceOnce.js";import{HideTaker as C}from"../../../components/ViewHideRoot.js";import{LineChoice as F}from"../../../components/InBoxContext.js";import{isBackgroundBox as L}from"../../../../format/lib/content/box-background.js";import{boxSideSpaceOf as R}from"../../../../format/lib/content/box-side-space.js";import{SECTION_OWN_PADS as W}from"../../content/section-own-pads.js";import{BAND_PAD_KEYS as m,BAND_PAD_UNIT_KEY as y,BLOCK_PAD_FRAME as P,PAD_TOTAL_KEY as c,SECTION_PAD_KEYS as h,framePadAttrs as K,padTotalKeys as S,padValuesOf as H,sectionPadAttrs as j,tierFramesOf as D}from"../../content/section-padding.js";import{readPartStyle as v}from"../part-styles.js";import{CRUMB_PAD as Y,SPEC_PAD as M}from"../../../../format/lib/sections/strip-shape.js";import{say as U}from"../../../../format/lib/editor-words.js";import{sectionFillPassClass as E}from"../../../../format/lib/content/section-min-height.js";import{COPIES_IN_THE_BOX as $,drawsCopiesInTheBox as k}from"../../../../format/lib/content/copies-in-box.js";import{ownEntry as f}from"../../../../format/lib/own-entry.js";const B={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120}},Pt=new Set(Object.keys(B));function A(t,e){return e?.innerPadding??f(B,t)}const _t=t=>A(t)??{},gt=t=>f({DetailRows:{top:100,bottom:100}},t),T=new Set(["Flex","Text","Heading","ImageBlock","ButtonBlock"]),V=new Set(["Divider"]),X=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),N=new Set(["ProductGrid"]);function b(t,e,n=!1,o){const a=t.render;t.render=r=>{if(e?.(r))return a(r);const s={...H(r,h,n),sideSpace:R(r.sideSpace)},d=o?K({values:s,frame:o(r)},!0).outer:j(s),i=a(r);if(!d)return i;const l=u=>g(I,{className:u?`${d.className} ${u}`:d.className,children:w=>g(C,{className:w,style:d.style,children:i})}),_=E(r,{atSectionLine:!0}),x=E(r);return _===x?l(_):g(F,{line:"by-box",draw:u=>l(u?x:_)})}}const mt={name:"sectionPadding",applies:(t,e,n)=>e.isSection(t)&&!X.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const o=A(e,t);if(o){t.fields={...t.fields,...n.sidesPaddingFields({keys:m,unitKey:y,fallback:o,tablet:!0,siteSide:!0})};return}if(N.has(e))return;const a=[m.top,m.bottom].filter(s=>t.fields!=null&&s in t.fields);if(a.length)throw new Error(`section-padding: ${e} declares its own ${a.join(" / ")} row; declare \`innerPadding: { top, bottom }\` in its meta and the one Padding row draws on its band`);const r=f(O,e);if(r){p(t,e,n,r);return}t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(t,e){if(!A(e,t)){if(N.has(e)){b(t);return}T.has(e)||V.has(e)||b(t,e==="Flex"?n=>L(n.bgImage):$.has(e)?n=>k(e,n):void 0,!0,f(O,e))}}},G=["Heading","Text","ImageBlock","ButtonBlock"],q=["LogoBlock"],O={Text:t=>v(t,"text").textStyle?.startsWith("heading-")?P.heading:P.text,Heading:()=>P.heading,ButtonBlock:()=>P.text,Breadcrumb:()=>D(Y),SpecStrip:()=>D(M),...Object.fromEntries(Object.entries(W).map(([t,e])=>[t,e.frame]))},z={ButtonBlock:"Outer padding"};function J(t,e){const n=t[c],o=Array.isArray(n)?n.filter(i=>typeof i=="string"):[],a=S().filter(i=>e?.[i]);if(!a.length)return t;const r=[...o.filter(i=>!a.includes(i)),...a.filter(i=>typeof t[i]=="number")];if(r.length===o.length&&r.every((i,l)=>i===o[l]))return t;const{[c]:s,...d}=t;return r.length?{...d,[c]:r}:d}function Q(t,e,n){if(e<=0)return null;const o=Array.isArray(t[c])?t[c]:[];return(n?S().filter(s=>s.startsWith(h[n])):S()).some(s=>typeof t[s]=="number"&&!o.includes(s))?U("plus {n} px (older setting)",{n:e}):null}function p(t,e,n,o){t.fields={...t.fields,...n.ownPaddingFields?.(o,Q,f(z,e))??n.sidesPaddingFields({tablet:!0,siteSide:!0})};const a=t.resolveData;t.resolveData=(r,s)=>{const d=r.props??{},i=s?.trigger==="replace"?J(d,s.changed):d,l=i===d?r:{...r,props:i};return a?a(l,s):l}}const St={name:"blockPadding",applies:(t,e,n)=>(G.includes(t)||q.includes(t))&&!!n&&typeof n.render=="function",panel(t,e,n){const o=f(O,e);if(!o){t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})};return}p(t,e,n,o)},draw(t,e){T.has(e)||b(t,void 0,!0)}};export{O as OWN_PAD_FRAME,z as OWN_PAD_LABEL,V as PADS_ITS_OWN_SPACE,T as PAD_ON_ROOT,Pt as SECTION_PAD_INNER,B as SECTION_PAD_INNER_DEFAULTS,St as blockPadding,_t as innerPaddingFallback,Q as olderPadNote,gt as ownPairDefault,mt as sectionPadding,J as withPadTotals};
|