efficient-web-builder 74.0.0 → 74.2.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 +43 -0
- package/dist/editor/components/PreviewFooterContext.d.ts +3 -1
- package/dist/editor/components/PreviewFooterContext.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.d.ts +2 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/storefront-editor.css +7 -0
- package/dist/editor/lib/document/blocks/general/ContactLocations/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Footprint/fields.d.ts +3 -0
- package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +3 -0
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/own-pad-fields.d.ts +7 -1
- package/dist/editor/lib/document/own-pad-fields.js +1 -1
- package/dist/editor/lib/document/page-root-fields.d.ts +4 -0
- package/dist/editor/lib/document/page-root-fields.js +1 -1
- package/dist/editor/lib/document/page-root.d.ts +3 -2
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/editor/lib/document/registry.js +1 -1
- package/dist/editor/lib/editor-document-adapter.d.ts +1 -0
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/format/lib/build/module-specifiers.d.ts +8 -0
- package/dist/format/lib/build/module-specifiers.js +1 -1
- package/dist/format/lib/content/block-sources.d.ts +1 -0
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/borders.d.ts +2 -1
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/page-width.d.ts +15 -0
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/section-css.d.ts +1 -1
- package/dist/format/lib/content/section-css.js +1 -1
- package/dist/format/lib/content/site-css.d.ts +5 -0
- package/dist/format/lib/content/site-css.js +1 -0
- package/dist/format/lib/content/site-offices.d.ts +7 -0
- package/dist/format/lib/content/site-offices.js +1 -0
- package/dist/format/lib/document/blocks/block-types.d.ts +1 -0
- package/dist/format/lib/document/passes/types.d.ts +4 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +5 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/format/lib/sections/strip-shape.d.ts +1 -0
- package/dist/format/lib/sections/strip-shape.js +1 -1
- package/dist/format/lib/source-rules/panel-colour-tokens.js +7 -7
- package/dist/format/lib/source-rules/site-gutter-once.d.ts +12 -0
- package/dist/format/lib/source-rules/site-gutter-once.js +23 -0
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +3 -3
- package/dist/render/components/Breadcrumb.d.ts +4 -1
- package/dist/render/components/Breadcrumb.js +1 -1
- package/dist/render/components/Cards.js +1 -1
- package/dist/render/components/ChartSection.js +1 -1
- package/dist/render/components/ContactLocations.js +2 -2
- package/dist/render/components/Countdown.js +1 -1
- package/dist/render/components/DocBody.js +5 -5
- package/dist/render/components/DocMasthead.js +1 -1
- package/dist/render/components/DocMetaCards.js +1 -1
- package/dist/render/components/FAQ.js +1 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/HeroGroup.js +1 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/LongRead.js +1 -1
- package/dist/render/components/Manifesto.js +1 -1
- package/dist/render/components/Masthead.js +1 -1
- package/dist/render/components/MockupSection.js +1 -1
- package/dist/render/components/ParagraphsA.js +1 -1
- package/dist/render/components/PhoneMenuTools.d.ts +3 -1
- package/dist/render/components/PhoneMenuTools.js +1 -1
- package/dist/render/components/ProcessSteps.js +1 -1
- package/dist/render/components/Prose.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.d.ts +2 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/Series.js +1 -1
- package/dist/render/components/SideSpaceOnce.d.ts +6 -0
- package/dist/render/components/SideSpaceOnce.js +1 -0
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/SiteOffices.d.ts +5 -0
- package/dist/render/components/SiteOffices.js +1 -0
- package/dist/render/components/SiteRootProps.d.ts +6 -0
- package/dist/render/components/SiteRootProps.js +1 -0
- package/dist/render/components/SpecStrip.d.ts +4 -1
- package/dist/render/components/SpecStrip.js +1 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/components/StatsParagraph.js +1 -1
- package/dist/render/components/Testimonials.js +1 -1
- package/dist/render/components/Timeline.js +1 -1
- package/dist/render/components/TimelineTrack.js +1 -1
- package/dist/render/components/TitleWithButtons.js +1 -1
- package/dist/render/lib/content/section-edge.d.ts +1 -1
- package/dist/render/lib/content/section-edge.js +1 -1
- package/dist/render/lib/content/section-padding.d.ts +24 -14
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ContactLocations/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
- package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
- package/dist/render/lib/document/blocks/general/SpecStrip/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -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-pageheader.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/custom-css.d.ts +2 -1
- package/dist/render/lib/document/part-styles.d.ts +7 -4
- 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-custom-css.d.ts +7 -0
- package/dist/render/lib/document/passes/section-custom-css.js +1 -1
- package/dist/render/lib/document/passes/section-padding.d.ts +2 -1
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/document/section-css-style.d.ts +3 -1
- package/dist/render/lib/document/section-css-style.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{SECTION_CSS_KEY as
|
|
1
|
+
import{SECTION_CSS_KEY as j}from"../../../../../format/lib/content/section-css.js";import{siteLengthHeld as z,storedUnit as S}from"../../../../../format/lib/content/css-length.js";import{SECTION_WIDTH_KEYS as J}from"../../../../../format/lib/content/section-width.js";import{CELL_SPAN_KEYS as q}from"../../../../../format/lib/content/grid-span.js";import{BLOCK_LENGTH_KEYS as K,blockLengthUnitKey as Q}from"../../../content/block-size.js";import{viewStoreKeys as Z}from"../../../../../format/lib/animation/views.js";import{BOX as tt,INNER_BOX as D,LABEL_FACE as w,TEXT as G,boxPadding as ot,fillSlot as I,token as et}from"../../../../../format/lib/document/seed-parts.js";import{ENTRANCE_STORE_KEYS as nt,LEGACY_ENTRANCE_KEY as it}from"../../../animation/entrance.js";import{SCROLL_STORE_KEYS as rt}from"../../../../../format/lib/animation/scroll.js";import{SECTION_PIN_KEYS as st}from"../../../../../format/lib/content/section-sticky.js";import{SECTION_CORNERS_ROW as dt}from"../../../../../format/lib/content/section-corners.js";import{SECTION_BORDER_UNIT_KEYS as ct}from"../../../../../format/lib/content/borders.js";import{CARD_HOVER_KEYS as R}from"../../../../../format/lib/animation/hover.js";import{COUNT_KEY_PROP as at}from"../../../../../format/lib/content/block-sources.js";import{SITE_GUTTER as pt,SITE_GUTTER_PHONE as lt,normalizeSiteGutter as mt,normalizeSiteGutterPhone as gt,siteGutterPhoneFollows as ht}from"../../../../../format/lib/content/page-width.js";import{BAND_TO_SECTION_PAD as Y,PAD_TOTAL_KEY as U,SECTION_PAD_KEYS as L,bandTopBottom as ft}from"../../../content/section-padding.js";import{ButtonBlockMeta as ut}from"../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";import{innerPaddingFallback as Pt}from"../../passes/section-padding.js";import{finiteNumber as P}from"../../../../../format/lib/finite-number.js";import{convertTheme as B,hasWords as bt}from"../../../sections/section-to-box.js";import{THEME_SECTION_BG as Tt}from"../../../../../format/lib/content/section-background.js";import{fillSlotOfInk as M}from"../../../../../format/lib/document/part-inks.js";import{parseHexColor as _t}from"efficient-shell/format";import{convertLength as xt}from"efficient-easel/screen/lib/content/length-units";import{viewKeyAt as v}from"efficient-easel/draw";import{bandPresetIndex as Et,surfacePresetIndex as Ot,surfaceTwoTone as St}from"../../../../../format/lib/theme.js";import{VIEW_HIDE_KEYS as Bt}from"../../../../../format/lib/content/view-hide-class.js";import{tierOfView as Nt}from"../../../../../format/lib/content/view-tier.js";const a=(t,o,e,n)=>o===e?t:xt(t,o,e,n,{min:0,max:200,step:4});import{BOX as Go,DIM as Yo,INNER_BOX as Mo,TEXT as vo}from"../../../../../format/lib/document/seed-parts.js";const lo={textFit:"line",textFitPhone:"wrap"},Ct={...G,[at]:""},{label:mo,href:go,...At}=ut.defaultProps,ho=At,fo={buttonFillOpacity:0,buttonBorder:{width:0},buttonPaddingTop:0,buttonPaddingRight:0,buttonPaddingBottom:0,buttonPaddingLeft:0},uo={...tt,sectionAccent:0},Po={sectionAccent:-1},bo=[...q,"sectionHeightMode","sectionHeightValue","sectionHeightUnit","sectionHeightModeTablet","sectionHeightValueTablet","sectionHeightUnitTablet","sectionHeightModePhone","sectionHeightValuePhone","sectionHeightUnitPhone","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone","sectionAccent",dt.unitKey,...ct,...st,"anchor",it,...Bt,j,...nt,...rt,...Z(["widthFit",...K,...K.map(Q)]),...Object.values(J)],f="a section width key, ignored since efficient-web-builder 45 (an old key; a section's own width has new keys, lib/content/section-width), so dropping it changes nothing",To={sectionSurface:"read by nothing in src/ (searched 2026-10-24): a retired theme key that draws nothing today, so dropping it changes nothing",widthMode:f,fullWidth:f,pageWidth:f,backgroundWidth:f,contentWidth:f,contentMax:f},_o=Object.fromEntries(["sectionPaddingLeft","sectionPaddingRight","sectionPaddingLeftTablet","sectionPaddingRightTablet","sectionPaddingLeftPhone","sectionPaddingRightPhone"].map(t=>[t,"needs Box side padding outside its gutter: the old section added it outside its frame, a Box's side padding replaces the gutter. 0 live nodes store it (JJ's read-only export, 2026-10-24)"])),xo={[U]:"read by `wrapperPad`: a value named here is drawn as it is, so the section's own px is not added; the Box's padding is the total"};function kt(t,o){const e=P(t.sectionPaddingTop)??0,n=P(t.sectionPaddingBottom)??0,i=P(t.sectionPaddingTopTablet),r=P(t.sectionPaddingBottomTablet),l=S(t.sectionPaddingUnit),m=S(t.sectionPaddingUnitTablet),g=S(t.sectionPaddingUnitPhone),b=Array.isArray(t[U])?t[U]:[],p=(s,u)=>b.includes(s)?0:u,T=(s,u,E,O,A,h)=>{const H=P(t[s]);if(H!==void 0)return H+a(p(s,h),"px",g,"mobile");const k=O===void 0?{n:A,unit:l,key:E}:{n:O,unit:m,key:u};return a(k.n,k.unit,g,"mobile")+a(p(k.key,h),"px",g,"mobile")},_=(s,u,E,O,A,h)=>E!==void 0?{[s]:E+a(p(s,h??A),"px",m,"tablet")}:h===void 0?{}:{[s]:a(O,l,m,"tablet")+a(p(u,h),"px",m,"tablet")},x=s=>({desktop:L[s],tablet:v(L[s],"tablet"),phone:v(L[s],"mobile")}),d=x("top"),c=x("bottom");return{[d.desktop]:e+a(p(d.desktop,o.top),"px",l,"desktop"),[c.desktop]:n+a(p(c.desktop,o.bottom),"px",l,"desktop"),..._(d.tablet,d.desktop,i,e,o.top,o.topTablet),..._(c.tablet,c.desktop,r,n,o.bottom,o.bottomTablet),[d.phone]:T(d.phone,d.tablet,d.desktop,i,e,o.topPhone),[c.phone]:T(c.phone,c.tablet,c.desktop,r,n,o.bottomPhone)}}const Eo=t=>[...["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopTablet","sectionPaddingBottomTablet","sectionPaddingTopPhone","sectionPaddingBottomPhone"].map(o=>[o,o,(e,n)=>kt(n,typeof t=="function"?t(n):t)[o]]),["sectionPaddingUnit","sectionPaddingUnit"],["sectionPaddingUnitTablet","sectionPaddingUnitTablet"],["sectionPaddingUnitPhone","sectionPaddingUnitPhone"]];function y(t,o){const e={};for(const[i,r]of Y)t[i]!==void 0&&(e[r]=t[i]);const n=ft(t,Pt(o));return{...e,sectionPaddingTop:n.top,sectionPaddingBottom:n.bottom}}const Oo=t=>[...Y.map(([o,e])=>[o,e,(n,i)=>y(i,t)[e]]),["sectionPaddingTop","sectionPaddingTop",(o,e)=>y(e,t).sectionPaddingTop],["sectionPaddingBottom","sectionPaddingBottom",(o,e)=>y(e,t).sectionPaddingBottom]],It={kind:"heading-case-upper",styles:["heading-1","heading-2","heading-3"]},So=t=>o=>bt(o.props[t])?[It]:[],Rt=(t,o)=>({kind:"text",key:t,role:"eyebrow",props:G,...o?{style:o}:{}}),Bo=t=>({kind:"group",name:"Chip",props:{...D,...I("main"),...ot(6,14)},parts:[Rt(t,{color:"background",...et("label",12),weight:600,letterSpacing:.16})]}),W=t=>t.background!=="transparent",Ut=(t,o)=>{const[e,n]=[t,o].map(i=>typeof i=="string"?i.trim():"");return e?n?`[${e} ]{color=text}${n}`:`[${e}]{color=text}`:n},F={align:"right",alignPhone:"left"},Lt=(t,o,e)=>{const n=i=>Ut(i[t],i[o]);return{kind:"block",type:"Text",when:(i,r)=>r!==void 0&&n(r)!=="",box:[[t,"text",(i,r)=>n(r)],[o,"text",(i,r)=>n(r)]],props:e}},No=(t,o,e,n={})=>Lt(t,o,{...Ct,...F,...n,_partStyles:{text:{...w,color:"labels",...e,case:w.case,...F}}}),N=(t,o)=>typeof t=="number"&&Number.isInteger(t)&&t>=0?t:B(o)?.selected??0,X="var(--site-surface-2)",V=(t,o)=>B(o)?.themes[N(t.sectionAccent??0,o)],yt=(t,o)=>(e,n)=>{if(!o?.(e,n))return I(t);const i=V(e,n)?.[t];return i?{fillColor:i}:{}},Co=(t,o)=>C(t,o)>=0,$=t=>t.startsWith("#")&&_t(t)!==null,Ao=(t,o,e)=>{const n=t?.trim();if(n&&$(n))return{fillColor:n};const i=M(n);if(i)return I(i);const r=n===X?V(o,e):void 0;return r?{fillColor:St(r)}:{}},ko=t=>{const o=t?.trim();return!o||o==="transparent"||o===Tt||M(o)||o===X||$(o)?void 0:"it paints a colour that no Box Fill can hold"},C=(t,o)=>{const e=B(o)?.themes;return e&&W(t)?Et(e,N(t.sectionAccent,o)):-1},Io=(t,o,e)=>{const n=C(o,e);return n>=0?n:t},Ro=(t,o)=>{const e=B(o)?.themes,n=e?Ot(e,N(t,o)):-1;return n>=0?n:t},Uo=(t,o)=>{const e=C(t,o);return e>=0?{sectionAccent:e}:{}},Lo=(t,o)=>W(t.props)&&C(t.props,o)<0?[{kind:"band-preset",page:N(t.props.sectionAccent,o)}]:[],yo=(t,{view:o="desktop",to:e="px",maxPx:n=1/0}={})=>{const{siteGutter:i,siteGutterUnit:r,siteGutterPhone:l,siteGutterPhoneUnit:m}=t.site??{},g=Nt(o),b=(T,_,x)=>{const d=S(_),c=z(T,d,"spacing",x);return c===null?null:a(c,d,"px",g)},p=o==="desktop"?b(i,r,pt)??mt(i):b(l,m,lt)??gt(l)??ht(i,r);return a(Math.min(n,p),"px",e,g)},Ht=Object.fromEntries(["Top","Right","Bottom","Left","TopPhone","RightPhone","BottomPhone","LeftPhone"].map(t=>[`sectionPadding${t}`,0])),Ho=t=>({top:0,right:0,bottom:0,left:0,...t}),Ko=(t,o,e,n=[])=>({kind:"group",name:t,keepEmpty:!0,props:(i,r)=>({...D,...Ht,...yt("surface")(i,r),...typeof e=="function"?e(i,r):e}),box:[[o,"bgImage"],R.kind,R.duration,R.delay],parts:n});export{lo as AUTO_COLUMN,Go as BOX,ho as BUTTON,Yo as DIM,To as DROP_COMMON,xo as DROP_PAD_TOTALS,_o as DROP_SIDE_PADDING,Po as FOLLOW_THE_BOX,It as HEADING_CASE_UPPER,Mo as INNER_BOX,Ht as NO_PAD,Ct as NUMBER_TEXT,F as RIGHT_WORDS,bo as SAME_KEYS,uo as SECTION_BOX,fo as SH_LINK,vo as TEXT,Io as bandAccent,C as bandIndex,N as bandPage,Uo as bandProps,Lo as bandWrites,yt as fillFrom,ko as fillNoBoxHolds,Bo as filledChip,So as headingCaseOf,y as innerPad,Oo as innerPadKeys,No as leadLine,Lt as leadText,Ho as lineSides,Ut as numberAndUnit,Co as onBandPreset,Ao as ownFill,Ko as pictureCell,V as sectionPage,yo as siteGutterOf,Rt as smallText,Ro as surfaceAccent,kt as wrapperPad,Eo as wrapperPadKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords 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 o}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 U,pageTitleDemoted as f}from"../../../../../format/lib/document/one-h1.js";import{AUTO_COLUMN as s,BUTTON as v,DIM as G,DROP_COMMON as g,DROP_PAD_TOTALS as X,DROP_SIDE_PADDING as c,INNER_BOX as a,leadLine as S,RIGHT_WORDS as T,SAME_KEYS as h,SECTION_BOX as m,SH_LINK as K,smallText as r,TEXT as n,wrapperPad as b,wrapperPadKeys as u}from"./section-to-box-row-parts.js";const E={minWidth:N.min},w=(e,t,l)=>({...r(e,{...t,...T}),props:{...n,align:"right",...s,...l}}),I={top:1,bottom:0},k=(e,t,l,M)=>({kind:"group",name:e,props:{...a,sectionPaddingBottom:t,sectionPaddingBottomPhone:l},parts:[M]}),O={widthFit:"fill",...E},x={top:100,bottom:60,topPhone:60,bottomPhone:40},j={...o("label",13),letterSpacing:.22,lineHeight:1.8},B={textStyle:"heading-1",...R("headingLarge",56,8,128),case:"upper",weight:500,lineHeight:.88,letterSpacing:-.04},V=()=>({name:"Page Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,x)}),box:[...h,...u(x)],parts:[{kind:"group",name:"Header",props:{...a,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:{...n,...s}}),{kind:"text",key:"title",role:"heading",props:{...n,tag:"h1",...O},style:B,mark:"accentItalic",when:e=>!f(e)},{kind:"text",key:"title",role:"heading",props:{...n,tag:"h2",...O},style:B,mark:"accentItalic",when:f},{kind:"group",name:"Details",props:{...a,align:"stretch",gap:0,gapPhone:0,sectionPaddingBottom:12,sectionPaddingBottomPhone:0},parts:[{kind:"list",key:"meta",name:"Detail",flat:!0,parts:[S("label","value",j,s)]}]}]},{kind:"group",name:"Deck",props:{...a,maxWidth:760,sectionBorder:I,sectionPaddingTop:28},parts:[{kind:"text",key:"deck",props:G,style:{textStyle:"body-1",fontRole:"accent",...o("body",22,19),italic:!0,lineHeight:1.5}}]}],drop:{...g,...c,[U]:"read by the title part's `when`: 2 (set by lib/document/one-h1 on a later opener) makes the Text an h2, anything else an h1"}}),ne=()=>({eyebrow:d.eyebrow,title:W(d.title),deck:d.deck,meta:[{label:i.label,value:i.value},{label:i.label,value:i.value}]}),D={top:80,bottom:40,topPhone:60,bottomPhone:32},Y={...o("label",13),letterSpacing:.18,lineHeight:1.8},H={...o("label",13),letterSpacing:.22,lineHeight:1.9},F=()=>({name:"Issue Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,D)}),box:[...h,...u(D)],parts:[{kind:"group",name:"Top",props:{...a,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:{...a,align:"end",gap:0,gapPhone:0,sectionPaddingBottom:14},parts:[{kind:"list",key:"issueMeta",name:"Issue line",flat:!0,parts:[S("lead","rest",Y)]}]}]},{kind:"group",name:"Bottom",props:{...a,direction:"row",align:"start",justify:"between",gap:60,gapPhone:16,share:"content",sectionBorder:I,sectionPaddingTop:32},parts:[{kind:"text",key:"lead",props:{...n,maxWidth:720,...E},style:{textStyle:"body-1",fontRole:"heading3",...o("headingSmall",20),lineHeight:1.5,letterSpacing:-.005,paragraphSpacing:16}},{kind:"group",name:"In this issue",props:{...a,align:"stretch",gap:0},parts:[k("Heading",6,6,{kind:"text",key:"issueHeading",props:{...n,align:"right",...s},style:{textStyle:"body-1",fontRole:"heading",...o("body",18),weight:400,letterSpacing:-.01,lineHeight:1.9,...T}}),{kind:"group",name:"Lines",props:{...a,align:"stretch",gap:0},parts:[{kind:"list",key:"issueList",name:"Line",flat:!0,parts:[w("text",{color:"labels",...H})]}]},w("issueTotal",H)]}]}],drop:{...g,...c}}),P={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()!==""),y=(e,t)=>t!==void 0&&L(e).at(-1)===t,A=(e,t)=>t!==void 0&&L(e).includes(t),q=(e,t)=>A(e,t)&&!y(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=>({...m,...C,wrap:"wrap",gap:16,gapPhone:16,separator:"slash",sectionBorder:{bottom:1},...b(e,_)}),box:[...h,...u(_)],parts:[{kind:"list",key:"items",name:"Crumb",flat:!0,parts:[{kind:"button",key:"label",href:"href",variant:"ghost",when:q,props:{...v,...K,icon:"none"},style:P},{...r("label",P),when:(e,t)=>A(e,t)&&!y(e,t)&&!p(t?.href)},{...r("label",{...P,color:"text"}),when:y}]}],drop:{...g,...c,meta:"a node that stores a note is skipped (`skip`); an empty one draws nothing",...X}}),re={DocMasthead:V(),Masthead:F(),Breadcrumb:z()};export{re as PAGE_HEADER_SECTION_TO_BOX,ne as pageHeaderPressStarter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mixHex as
|
|
1
|
+
import{mixHex as u}from"efficient-shell/format";import{resolveSectionAccent as r,SECTION_ACCENT_INHERIT as A}from"../../../../../format/lib/content/section-surface.js";import{parseLoopDirection as x}from"../../../../../format/lib/animation/index.js";import{parseTickerSeparator as i,SEPARATOR_GLYPH as E}from"../../../../../format/lib/sections/ticker-style.js";import{tickerJoinSide as y}from"../../../../../format/lib/sections/ticker-join.js";import{convertTheme as R}from"../../../sections/section-to-box.js";import{darkBandIndex as h}from"../../../../../format/lib/theme.js";import{DIM as s,DROP_COMMON as a,DROP_PAD_TOTALS as C,DROP_SIDE_PADDING as l,fillFrom as b,SAME_KEYS as c,sectionPage as O,SECTION_BOX as p,TEXT as B,wrapperPad as d,wrapperPadKeys as m}from"./section-to-box-row-parts.js";import{SPEC_PAD as T,SPEC_STRIP as g,SPEC_TEXT as S,STRIP_BOX as _,TICKER_BARE_GAP as N,TICKER_DISPLAY as K,TICKER_PAD as D,TICKER_SMALL as L,TICKER_STRIP as M}from"../../../../../format/lib/sections/strip-shape.js";const f=e=>e.size==="display",w=(e,t)=>{const o=O(e,t),n=e.tone!=="plain"&&o?.text&&o.background?u(o.text,o.background,.3):null;return n?{color:n}:{}},X=(e,t)=>e.tone!=="plain"&&r(e.sectionAccent)===null?b("background")(e,t):{},I=(e,t)=>({kind:"list",key:"items",name:"Item",flat:!0,when:t,parts:[{kind:"text",key:"text",props:s,style:e,styleFrom:w}]}),H={name:"Scrolling Bar",boxProps:(e,t)=>({...p,..._,...M,...E[i(e.separator)]===""?N:{},...d(e,D),...X(e,t)}),box:[["scrollDirection","scrollDirection",e=>x(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)??A],...m(D)],parts:[I(L,e=>!f(e)),I(K,f)],drop:{...a,...l,size:"each item's Text style: Small → Body 5, Display → Heading 3"}},P=e=>e?.tone==="muted",k=e=>h(R(e)),F={name:"Spec Strip",boxProps:(e,t)=>({...p,..._,...g,...e.fill==="none"?{sectionBorder:{top:1}}:{sectionAccent:k(t)},...d(e,T)}),box:[...c.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,o)=>t.fill==="none"?e:k(o)],...m(T)],parts:[{kind:"list",key:"cells",name:"Cell",flat:!0,parts:[{kind:"text",key:"text",props:B,style:S,when:(e,t)=>!P(t)},{kind:"text",key:"text",props:s,style:S,when:(e,t)=>P(t)}]}],drop:{...a,...l,...C,fill:"None → no fill and a line on top. Dark band (the default) → the Box's theme is the site's first dark preset that is not its page (lib/theme `darkBandIndex`; Theme 2 with no site theme): the old fixed `plate-band` colour, as a theme"}},V={Ticker:H,SpecStrip:F};export{V as STRIP_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as
|
|
1
|
+
import{hasWords as W,registerSectionToBox as t}from"../../../sections/section-to-box.js";import{BUTTON as P,DIM as y,DROP_COMMON as s,DROP_SIDE_PADDING as O,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 b,wrapperPad as _,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 f}from"../../../../../format/lib/document/blocks/general/Prose/meta.js";import{PARAGRAPHS_A_PH as c}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";const I={top:72,bottom:72,topPhone:72,bottomPhone:72},me={name:"Editorial Text",boxProps:e=>({...p,direction:"column",gap:28,gapPhone:28,sectionBorder:{top:1},..._(e,I)}),box:[["topBorder","sectionBorder",e=>e===!1?void 0:{top:1}],...d,...u(I)],parts:[N("Prose"),{kind:"text",key:"body",props:y,style:{textStyle:"body-1",...i("body",16),lineHeight:1.7,paragraphSpacing:18}}],drop:{...s,...O,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)"}},H={buttonPaddingTop:20,buttonPaddingBottom:20,buttonPaddingLeft:28,buttonPaddingRight:28},A=(e,n)=>n?.variant==="primary",R=(e,n)=>({kind:"list",key:"buttons",name:"Button",flat:!0,when:e,parts:[{kind:"button",key:"label",href:"href",when:A,variant:"primary",style:{letterSpacing:.3},props:{...P,...H,...n}},{kind:"button",key:"label",href:"href",when:(r,g)=>!A(r,g),variant:"ghost",style:{letterSpacing:.3},props:{...P,...H,...n}}]}),T=e=>W(e.title),ge={name:"Call-to-Action Heading",boxProps:e=>({...p,direction:"row",align:"center",justify:T(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",...T(e)?{minWidth:280,minWidthPhone:0}:{}}),parts:[R(T,{widthFit:"fill",iconPosition:"end"}),R(e=>!T(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 ce(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 C={top:40,bottom:64,topPhone:24,bottomPhone:36},Te={name:"Section Header",boxProps:(e,n)=>({...p,direction:"column",gap:0,..._(e,C),...ce(e,n)}),box:[...d,...u(C)],parts:[N("SectionHeader")],drop:{...s,...O,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"}},v={...o,direction:"row",share:[67],gap:32},L={...o,sectionPaddingLeft:24,sectionPaddingLeftPhone:0},X=(e,n,r)=>({kind:"group",name:e,props:n,parts:[r]}),Pe={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:{...v,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:[b("eyebrow",{color:"labels",...i("label",12),letterSpacing:.24})]},X("Stats column",o,{kind:"group",name:"Stats",props:{...L,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:{...v,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}}]}]},X("Note column",{...o,justify:"end"},{kind:"group",name:"Founders",props:{...L,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}}]},b("attribution",{...i("label",12,10),letterSpacing:.24,lineHeight:1.7})]})]}],drop:{...s}},D={top:24,bottom:24,topPhone:24,bottomPhone:24},Oe={name:"Banner",boxProps:e=>({...p,direction:"column",gap:0,..._(e,D)}),box:[...d,"contained",...u(D)],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:[b("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:P}]}],drop:{...s,...O}},be={Prose:me,TitleWithButtons:ge,SectionHeader:Te,ParagraphsA:Pe,Banner:Oe},Qe={Prose:()=>({eyebrow:f.eyebrow,title:m(f.title),body:f.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:c.eyebrow,lead:ae.body,foundersHeading:c.foundersHeading,foundersBody:c.foundersBody,attribution:c.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 Ve(){t(be),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{be as GENERAL_SECTION_TO_BOX,Qe as TEXT_PRESS_STARTERS,Ve as registerGeneralSectionRows};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SECTION_CSS_SCOPE_ATTR } from "../../../format/lib/content/section-css.js";
|
|
2
|
+
import { SITE_CSS_SCOPE_ATTR } from "../../../format/lib/content/site-css.js";
|
|
2
3
|
export declare const CUSTOM_HTML_SCOPE_ATTR = "data-sf-custom-html";
|
|
3
|
-
export type CssScopeAttr = typeof CUSTOM_HTML_SCOPE_ATTR | typeof SECTION_CSS_SCOPE_ATTR;
|
|
4
|
+
export type CssScopeAttr = typeof CUSTOM_HTML_SCOPE_ATTR | typeof SECTION_CSS_SCOPE_ATTR | typeof SITE_CSS_SCOPE_ATTR;
|
|
4
5
|
export declare function customHtmlIdPrefix(id: string): string;
|
|
5
6
|
export declare function customHtmlScope(id: string, attr?: CssScopeAttr): string;
|
|
6
7
|
export declare function scopeCustomCss(css: string, id: string, attr?: CssScopeAttr, ownIds?: ReadonlySet<string>): string;
|
|
@@ -129,15 +129,18 @@ export declare function partCaseOfTransform(transform: string | null | undefined
|
|
|
129
129
|
export declare function partCaseTransform(value: TextStyleCase | undefined): string;
|
|
130
130
|
export type PartDeclarationOptions = {
|
|
131
131
|
blockDrawsStyle?: boolean;
|
|
132
|
+
sizeCap?: boolean;
|
|
132
133
|
};
|
|
134
|
+
export declare const PART_SIZE_CAP_VAR = "--sf-part-size-cap";
|
|
135
|
+
export declare function blockCapsPartSize(caps: Readonly<Record<string, true>> | undefined, partKey: string): boolean;
|
|
133
136
|
export declare function blockDrawsTextStyle(type: string | undefined, partKey: string): boolean;
|
|
134
137
|
export declare function partSpacingOf(style: PartStyle): {
|
|
135
138
|
lineHeight?: number;
|
|
136
139
|
letterSpacingEm?: number;
|
|
137
140
|
};
|
|
138
141
|
export declare const PART_PARAGRAPH_VAR = "--sf-part-para";
|
|
139
|
-
export declare function partPhoneDeclarations(style: PartStyle): Record<string, string>;
|
|
140
|
-
export declare function partTabletDeclarations(style: PartStyle): Record<string, string>;
|
|
142
|
+
export declare function partPhoneDeclarations(style: PartStyle, options?: PartDeclarationOptions): Record<string, string>;
|
|
143
|
+
export declare function partTabletDeclarations(style: PartStyle, options?: PartDeclarationOptions): Record<string, string>;
|
|
141
144
|
export declare function partAlignFollowed(style: PartStyle, screen: PartScreen): PartAlign | undefined;
|
|
142
145
|
export type PartScreen = ViewTier;
|
|
143
146
|
export declare function partStyleForScreen(style: PartStyle, screen: PartScreen): PartStyle;
|
|
@@ -169,7 +172,7 @@ export declare function partStyleSource<E extends {
|
|
|
169
172
|
getAttribute(name: string): string | null;
|
|
170
173
|
}>(nodeId: string, selectedPartId: string | null, selectedElements: readonly E[], declaresStyle: (className: string | null) => boolean): E | null;
|
|
171
174
|
export declare function storedPartStyle(styles: PartStyles, styleKey: string): PartStyle;
|
|
172
|
-
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): number;
|
|
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;
|
|
173
176
|
export declare function regionSheetStyle(style: PartStyle | undefined | null): PartStyle | null;
|
|
174
177
|
export declare function regionCanvasDeclarations(style: PartStyle | undefined | null, screen: PartScreen): {
|
|
175
178
|
fontFamily?: string;
|
|
@@ -216,7 +219,7 @@ export type PublishedPartSheet = {
|
|
|
216
219
|
kindRules: ReadonlyMap<string, PublishedPartRule>;
|
|
217
220
|
drawn: ReadonlySet<string>;
|
|
218
221
|
};
|
|
219
|
-
export declare function publishedPartStyles(needles: readonly PartNeedle[], styles: PartStyles, scope: string, styleKeyOf?: (partKey: string) => string, drawsStyle?: (partKey: string) => boolean, motionOf?: (styleKey: string) => PublishedPartMotion | null, motionKeys?: readonly string[]): PublishedPartSheet | null;
|
|
222
|
+
export declare function publishedPartStyles(needles: readonly PartNeedle[], styles: PartStyles, scope: string, styleKeyOf?: (partKey: string) => string, drawsStyle?: (partKey: string) => boolean, motionOf?: (styleKey: string) => PublishedPartMotion | null, motionKeys?: readonly string[], capsSize?: (partKey: string) => boolean): PublishedPartSheet | null;
|
|
220
223
|
export declare function isPartKindKey(key: string): boolean;
|
|
221
224
|
export declare function partRuleForKind(sheet: PublishedPartSheet | null, kind: string): PublishedPartRule | null;
|
|
222
225
|
export declare function viewMediaOf(inBox: boolean): {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{textStyleCaseCss as ut,textStyleCaseOfCss as pt,viewKeyAt as B}from"efficient-easel/draw";import{FONT_OPTIONS as dt,fontOption as gt,fontRoleOf as w,SIZE_STEP_OF_ROLE as I}from"../../../format/lib/fonts.js";import{encodePartKey as X}from"../../../format/lib/document/part-key.js";import{decodePartId as Y,normalizePartText as F}from"./text-parts.js";import{partInkCss as xt}from"../../../format/lib/document/part-inks.js";import{regionStyle as ht}from"../../../format/lib/sections/text-regions.js";import{EDGE_PHONE_MEDIA as St,EDGE_TABLET_MEDIA as bt,PHONE_MEDIA as mt,TABLET_MEDIA as Tt,viewOverrides as Pt}from"../content/view-values.js";import{plainRecord as y,propsWithPartRecord as zt,readPartRecord as _t,readPartRecords as At}from"../../../format/lib/document/part-records.js";import{isLengthUnit as M}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as _,storedUnit as Rt}from"../../../format/lib/content/css-length.js";import{hasOwnEntry as N,ownEntry as V}from"../../../format/lib/own-entry.js";const L="_partStyles",Et="data-sf-part-styled",Z="data-sf-text-style",wt=/^(heading|body)-[1-7]$/;function b(t){return typeof t=="string"&&wt.test(t)}const q={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function Nt(t){if(!t)return null;for(const[e,n]of Object.entries(q))if(n===t)return e;return null}function Ue(t){if(b(t.textStyle))return t.textStyle;const e=w(t.role);return e?q[e]:void 0}const Ot=[400,500,600,700],R=["left","center","right","justify"],D=5,H=1e3,$t=-5,kt=10,It=0,Ft=64,yt=2,J={size:{min:D,max:H,step:1},sizeTablet:{min:D,max:H,step:1},sizePhone:{min:D,max:H,step:1},padding:{min:It,max:Ft,step:yt}},Mt=.05,Lt=.01,Dt=["line","letter"],Ht=.5,Ut=2.5,jt=-1,Ct=1,vt=0,Kt=400,Wt=[...new Set(Object.values(I))];function je(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 Ce(t){return At(t,L)}function Q(t,e){return _t(t,L,e)}function ve(t,e){return Object.values(Q(t,e)).filter(n=>n!==void 0).length}function tt(t,e,n){return zt(t,L,e,Gt(n).length?n:null)}function Gt(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function Bt(t){return Dt.includes(t)}const E=(t,e,n)=>Math.min(n,Math.max(e,t)),Xt=["sizeUnit","sizeUnitTablet","sizeUnitPhone"];function U(t){const e=B("sizeUnit",t),n=Xt.find(o=>o===e);if(!n)throw new Error(`a part stores no unit key ${e}`);return n}const m={size:U("desktop"),sizeTablet:U("tablet"),sizePhone:U("mobile"),paragraphSpacing:"paragraphSpacingUnit",padding:"paddingUnit"},et=Object.values(m);function h(t,e){return Rt(t[m[e]])}function Yt(t,e,n={}){if(et.includes(t))return M(e)&&e!=="px"?e:null;if(N(m,t)&&h(n,t)!=="px"){const o=P(Number(e),2);return!Number.isFinite(o)||o<0||o===0&&t!=="padding"?null:o}if(Bt(t)){const o=Math.round(Number(e));return!Number.isFinite(o)||o===0?null:E(o,$t,kt)}if(t==="lineHeight"){const o=Number(e);return Number.isFinite(o)?P(E(o,Ht,Ut),3):null}if(t==="letterSpacing"){const o=Number(e);return Number.isFinite(o)?P(E(o,jt,Ct),4):null}if(t==="paragraphSpacing"){const o=Math.round(Number(e));return!Number.isFinite(o)||o<=0?null:E(o,vt,Kt)}if(N(J,t)){const{min:o,max:i}=J[t],r=Math.round(Number(e));return Number.isFinite(r)?E(r,o,i):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"||t==="fontRole"?w(e)?e:null:t==="sizeToken"?j(e)?e:null:t==="textStyle"?b(e)?e:null:t==="alignPhone"||t==="alignTablet"?R.includes(e)?e:null:e}const Vt=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function A(t){let e=null;const n=o=>{e??={...t},delete e[o]};for(const o of Vt){const i=t[o];i!==void 0&&!(typeof i=="number"&&Number.isFinite(i))&&n(o)}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&&!b(t.textStyle)&&n("textStyle"),t.sizeToken!==void 0&&!j(t.sizeToken)&&n("sizeToken"),t.fontRole!==void 0&&!w(t.fontRole)&&n("fontRole");for(const o of et)t[o]!==void 0&&!M(t[o])&&n(o);return e??t}function j(t){if(!t||typeof t!="object")return!1;const{step:e,px:n,stepPhone:o,pxPhone:i,fluid:r}=t,c=l=>typeof l=="number"&&Number.isFinite(l)&&l>0,a=l=>typeof l=="string"&&Wt.includes(l);return a(e)&&c(n)&&(o===void 0||a(o))&&(i===void 0||c(i))&&(r===void 0||Zt(r,n))}function Zt(t,e){if(!t||typeof t!="object"||Array.isArray(t))return!1;const{minPx:n,vw:o,...i}=t;return Object.keys(i).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<e&&typeof o=="number"&&Number.isFinite(o)&&o>0&&o<=100}function C(t){return t?.pxPhone&&j(t)?{step:t.stepPhone??t.step,px:t.pxPhone}:null}function nt({step:t,px:e,fluid:n}){const o=n?`clamp(${n.minPx}px, ${n.vw}vw, ${e}px)`:`${e}px`,i=`var(--size-${t}, ${o})`;return t.startsWith("heading")?`min(${i}, var(--sf-heading-max,9999px))`:i}const qt=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Jt(t){const e=[];for(const[n,o]of qt)n===t?e.push(o):o===t&&e.push(n);return e}function Ke(t,e,n,o){const i={...Q(t,e)},r=o==null?null:Yt(n,o,i);if(r===null)delete i[n];else{i[n]=r;for(const c of Jt(n))delete i[c]}return tt(t,e,i)}function We(t,e){return tt(t,e,{})}function Qt(t){return pt(t)??"none"}function te(t){return ut(t)??""}const ot={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 ee(t,e){const n=w(t.role);return n||(e?.blockDrawsStyle?null:Nt(t.textStyle))}function Ge(t,e){return t==="Text"&&e==="text"}const ne={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 oe(t){const e=I[t],n=V(ne,e);return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function ie(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=P(re+t.line*Mt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=P(t.letter*Lt,4)),e}const re=1,T="--sf-part-para";function ae(t){t=A(t);const e={};if(typeof t.sizePhone=="number"&&t.sizePhone>0)e.fontSize=_(t.sizePhone,h(t,"sizePhone"));else{const o=C(t.sizeToken);if(o)e.fontSize=nt(o);else{const i=$(t);i!==void 0&&(e.fontSize=_(i,h(t,"sizeTablet")))}}const n=t.alignPhone??O(t);return n&&(e.textAlign=n),e}function O(t){return t.alignTablet&&t.alignTablet!==t.align?t.alignTablet:void 0}function $(t){const n=t.sizeTablet!==void 0&&h(t,"sizeTablet")!==h(t,"size")?t.sizeTablet:Pt("textSize",t.size,t.sizeTablet,void 0).tablet;return n&&n>0?n:void 0}function se(t){const e=A(t),n={},o=$(e);o!==void 0&&(n.fontSize=_(o,h(e,"sizeTablet")));const i=O(e);return i&&(n.textAlign=i),n}function Be(t,e){if(e==="desktop")return;const n=A(t);return(e==="mobile"?O(n):void 0)??n.align}function fe(t,e){if(e==="desktop")return t;const n=A(t),o=$(n),i=O(n);if(e==="tablet"){let a=t;return o!==void 0&&(a={...a,size:o,sizeUnit:n[m.sizeTablet]}),i&&(a={...a,align:i}),a}let r=t;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone,sizeUnit:n[m.sizePhone]};else{const a=C(n.sizeToken);a?r={...r,size:void 0,sizeToken:a}:o!==void 0&&(r={...r,size:o,sizeUnit:n[m.sizeTablet]})}const c=n.alignPhone??i;return c&&(r={...r,align:c}),r}function v(t,e,n){return K(fe(t,e),k,n)}function ce(t){return B("size",t)}function Xe(t,e){if(e==="desktop")return null;const n=A(t);if(e==="mobile"){if(C(n.sizeToken))return null;const o=$(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 it(t,e){const n=ce(e);if(!N(t,n))return t;const o={...t};return delete o[n],o}function Ye(t,e,n){const o=v(it(t,e),e,n);return{fontFamily:o.fontFamily,fontSize:o.fontSize}}function K(t,e,n){t=A(t);const o=ee(t,n),i=ie(t),r=t.size?_(t.size,h(t,"size")):t.sizeToken?nt(t.sizeToken):o?oe(o):"";return{fontFamily:t.font?de(t.font):t.fontRole?`var(${ot[t.fontRole]})`:o?`var(${ot[o]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:r,minWidth:r?"0":"",overflowWrap:r?"break-word":"",lineHeight:i.lineHeight!==void 0?String(i.lineHeight):"",letterSpacing:i.letterSpacingEm!==void 0?`${i.letterSpacingEm}em`:"",[T]:t.paragraphSpacing?_(t.paragraphSpacing,h(t,"paragraphSpacing")):"",textTransform:te(t.case),textAlign:t.align??"",paddingTop:rt(t.padding,h(t,"padding")),paddingBottom:rt(t.padding,h(t,"padding")),color:le(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const le=t=>xt(t),rt=(t,e)=>t===void 0?"":_(t,e),P=(t,e)=>Number(t.toFixed(e));function Ve(t,e){const n=Number.parseFloat(t.fontSize)||16,o=Number.parseFloat(t.lineHeight),i=Number.parseFloat(t.letterSpacing),r=Number.parseFloat(t.paddingTop);return{fontKey:e,sizePx:n,weight:ue(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(o)?P(o/n,3):1.2,letterEm:Number.isFinite(i)?P(i/n,4):0,align:pe(t.textAlign),case:Qt(t.textTransform),paddingPx:Number.isFinite(r)?Math.round(r):0}}function ue(t){return Number.isFinite(t)?Ot.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function pe(t){for(const e of R)if(e===t)return e;return t==="end"?"right":"left"}function Ze(t,e){const n=at(t);if(!n)return"";for(const o of dt)if(at(e(o.cssVar))===n)return o.key;return""}const at=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function de(t){const e=gt(t);return e?`var(${e.cssVar})`:""}function qe(t,e,n,o){return!e||Y(e)?.nodeId!==t?null:n.find(r=>o(r.getAttribute("class")))??n[0]??null}function ge(t,e){return y(V(t,e))??{}}function Je(t,e,n=()=>k,o=a=>a,i=Se,r="desktop",c=()=>!1){let a=0;for(const{element:l,partId:S}of t){const g=Y(S)?.propKey;if(!g)continue;const s=ge(e,o(g)),f=v(s,r,{blockDrawsStyle:c(g)});b(s.textStyle)?l.setAttribute?.(Z,s.textStyle):l.removeAttribute?.(Z);const d=G.some(x=>l.style[x]);let p=!1;for(const[x,u]of Object.entries(f))Te(l,x,u),u&&(p=!0);if(d||G.some(x=>f[x]))for(const x of xe(l,i))for(const u of G)x.style[u]=f[u]??"";p&&(a+=1)}return a}function xe(t,e){const n=F(t.textContent??""),o=[];let i=t;for(let r=0;r<he&&e(i);r+=1){const c=i.parentElement;if(!c||F(c.textContent??"")!==n)break;o.push(c),i=c}return o}const he=8;function Se(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const k={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function be(t){if(!t||typeof t!="object")return null;const e={};b(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);for(const n of["size","sizeTablet","sizePhone"]){const o=m[n];e[n]!==void 0&&M(t[o])&&(e[o]=t[o])}return Object.keys(e).length?e:null}function me(t,e){const n=be(t);if(!n)return{};const o=v(n,e);return{...o.fontFamily?{fontFamily:o.fontFamily}:{},...o.fontSize?{fontSize:o.fontSize}:{}}}function Qe(t){return b(t?.textStyle)||!!t?.role||typeof t?.size=="number"&&t.size>0}function tn(t,e,n){if(!t||typeof t!="object")return{};const o=ht(t.role,e,I)??{},i=e.sized?me(it(t,n),n):{};return{...o,...i}}function en(t,e,n){n.fontFamily&&t.fontFamily===n.fontFamily&&(t.fontFamily=e.fontFamily),n.fontSize&&t.fontSize===n.fontSize&&(t.fontSize=e.fontSize)}function Te(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 i=t;e===T&&(n?i.setAttribute?.(st,""):i.removeAttribute?.(st))}const st="data-sf-part-para",Pe=Object.keys(K({},k)),W=new Set(["color","overflowWrap",T,"fontStyle"]),G=Pe.filter(t=>!W.has(t));function nn(t,e,n,o=a=>a,i=()=>!1,r=()=>null,c=[]){const a=new Map;for(const s of t){const f=X(s.key,s.row);for(const d of s.texts){const p=a.get(d);p?(p.keys.add(s.key),p.partKeys.add(f)):a.set(d,{keys:new Set([s.key]),partKeys:new Set([f])})}}const l=new Map;for(const s of new Set([...Object.keys(e),...c])){if(!ze(s))continue;const f=ft(n,s,y(e[s])??{},!1,r(s));f&&l.set(s,f)}const S=s=>{const f=o(s),d=r(f);if(!N(e,f)&&!d)return null;const p=y(e[f])??{};return ft(n,s,p,i(s),d)},g=new Map;for(const[s,{keys:f,partKeys:d}]of a){const p=d.size===1?[...d][0]:f.size===1?[...f][0]:null;if(!p)continue;const z=S(p);z&&g.set(s,z)}for(const s of t){if(!s.keyed)continue;const f=S(X(s.key,s.row));f&&l.set(s.key,f)}return g.size||l.size?{rules:g,kindRules:l,drawn:new Set(a.keys())}:null}function ft(t,e,n,o,i){const r=K(n,k,{blockDrawsStyle:o}),c=se(n),a=ae(n),l=b(n.textStyle)?n.textStyle:void 0;return!Object.values(r).some(Boolean)&&!Object.keys(c).length&&!Object.keys(a).length&&!l&&!i?null:{stamp:_e(t,e),declarations:r,...Object.keys(c).length?{tablet:c}:{},...Object.keys(a).length?{phone:a}:{},...l?{textStyle:l}:{},...i?{motion:i}:{}}}function ze(t){return t.startsWith("@")}function on(t,e){return t?.kindRules.get(e)??null}function _e(t,e){const n=o=>o.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function Ae(t){return t?{tablet:bt,phone:St}:{tablet:Tt,phone:mt}}function rn(t,{inBox:e=!1}={}){const{tablet:n,phone:o}=Ae(e),i=[],r=new Set,c=a=>{const{stamp:l,declarations:S}=a;if(r.has(l))return;r.add(l);const g=Object.entries(S).filter(([,u])=>u!==""),s=u=>u.map(([ct,lt])=>`${Ee(ct)}: ${lt}`).join("; "),f=`[${Et}="${l}"]`,d=g.filter(([u])=>!W.has(u)),p=g.filter(([u])=>W.has(u));d.length&&i.push(`${f}, *:has(> ${f}) { ${s(d)} }`),p.length&&i.push(`${f} { ${s(p)} }`),S[T]&&(i.push(`*:has(> ${f}) { ${T}: ${S[T]} }`),i.push(...Re(f,`*:has(> ${f})`)));const z=Object.entries(a.tablet??{}).filter(([,u])=>u!=="");z.length&&i.push(`@media ${n} { ${f}, *:has(> ${f}) { ${s(z)} } }`);const x=Object.entries(a.phone??{}).filter(([,u])=>u!=="");x.length&&i.push(`@media ${o} { ${f}, *:has(> ${f}) { ${s(x)} } }`)};for(const a of t.rules.values())c(a);for(const a of t.kindRules.values())c(a);return i.join(`
|
|
2
|
-
`)}function
|
|
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,Ce as PART_LETTER_EM_MIN,De as PART_LETTER_STEP,je as PART_LINE_HEIGHT_MAX,Ue 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,U 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,Ct 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
|
|
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 _}from"../../animation/part-motion.js";import{partNeedles as x}from"../text-parts.js";import{CARD_LIST_TYPE as C,HOST_PART_TYPE as T,rowPartByKey as b}from"../../../../format/lib/content/card-template.js";import{BOX_TYPE as u}from"../../../../format/lib/document/container-blocks.js";const R={name:"clickableParts",applies:(o,e,a)=>typeof a?.render=="function"&&o!==C&&o!==T,draw(o,e,a){const r=o,p=()=>r.textParts??r.fields,d=r.partSizeCaps,c=r.render,m=a.inspector?.PartAnchors,f=(t,s)=>x(p(),s,n=>b(e,t,n));r.render=t=>{const s=y(t),n=_(t);return t.editor?.isEditing&&m?i(P,{type:e,props:t,children:l=>i(m,{needles:f(t,l),styles:s,motions:n,type:e,sizeCaps:d,children:c(t)})}):!Object.keys(s).length&&!Object.keys(n).length?c(t):i(P,{type:e,props:t,children:l=>i(h,{needles:f(t,l),styles:s,motions:n,type:e,atEdge:e===u,sizeCaps:d,children:c(t)})})}}};export{R as clickableParts};
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
2
|
+
declare const SectionCssStyle: import("react").LazyExoticComponent<typeof import("../section-css-style.js").default>;
|
|
3
|
+
export declare function ScopedCssStyle({ css, id, attr }: {
|
|
4
|
+
css: string;
|
|
5
|
+
id: string;
|
|
6
|
+
attr?: Parameters<typeof SectionCssStyle>[0]["attr"];
|
|
7
|
+
}): import("react").JSX.Element;
|
|
2
8
|
export declare const sectionCustomCss: BlockPass;
|
|
9
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as c}from"react/jsx-runtime";import{lazy as d}from"react";import{CellWrap as a}from"../../../components/InBoxContext.js";import{SECTION_CSS_KEY as f,SECTION_CSS_SCOPE_ATTR as l,sectionCssOf as C}from"../../../../format/lib/content/section-css.js";const o=d(()=>import("../section-css-style.js"));function x({css:t,id:e,attr:s}){return i(o,{css:t,id:e,attr:s})}const y={name:"sectionCustomCss",applies:(t,e,s)=>e.isSection(t)&&!!s&&typeof s.render=="function",panel(t,e,s){t.fields={...t.fields,...s.customCssFields()}},draw(t){t.defaultProps={...t.defaultProps,[f]:""};const e=t.render;t.render=s=>{const r=C(s),n=typeof s.id=="string"?s.id:"";return!r||!n?e(s):c(a,{className:"sf-section-css",attrs:{[l]:n},children:[i(o,{css:r,id:n}),e(s)]})}}};export{x as ScopedCssStyle,y as sectionCustomCss};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type TierFrames } from "../../content/section-padding.js";
|
|
1
2
|
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
2
3
|
type InnerPadding = {
|
|
3
4
|
top: number;
|
|
@@ -13,7 +14,7 @@ export declare const ownPairDefault: (key: string) => InnerPadding | undefined;
|
|
|
13
14
|
export declare const PAD_ON_ROOT: ReadonlySet<string>;
|
|
14
15
|
export declare const PADS_ITS_OWN_SPACE: ReadonlySet<string>;
|
|
15
16
|
export declare const sectionPadding: BlockPass;
|
|
16
|
-
export declare const OWN_PAD_FRAME: Readonly<Record<string, (props: Record<string, unknown>) => number>>;
|
|
17
|
+
export declare const OWN_PAD_FRAME: Readonly<Record<string, (props: Record<string, unknown>) => number | TierFrames>>;
|
|
17
18
|
export declare const OWN_PAD_LABEL: Readonly<Record<string, string>>;
|
|
18
19
|
export declare function withPadTotals(props: Record<string, unknown>, changed: Readonly<Record<string, unknown>> | undefined): Record<string, unknown>;
|
|
19
20
|
export declare function olderPadNote(props: Record<string, unknown>, frame: number): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _}from"react/jsx-runtime";import{SideOnceClass as p}from"../../../components/SideSpaceOnce.js";import{HideTaker as I}from"../../../components/ViewHideRoot.js";import{LineChoice as C}from"../../../components/InBoxContext.js";import{isBackgroundBox as F}from"../../../../format/lib/content/box-background.js";import{boxSideSpaceOf as L}from"../../../../format/lib/content/box-side-space.js";import{BAND_PAD_KEYS as S,BAND_PAD_UNIT_KEY as R,BLOCK_PAD_FRAME as P,PAD_TOTAL_KEY as f,SECTION_PAD_KEYS as K,framePadAttrs as H,padTotalKeys as h,padValuesOf as W,sectionPadAttrs as y,tierFramesOf as B}from"../../content/section-padding.js";import{readPartStyle as v}from"../part-styles.js";import{CRUMB_PAD as Y,SPEC_PAD as j}from"../../../../format/lib/sections/strip-shape.js";import{say as M}from"../../../../format/lib/editor-words.js";import{sectionFillPassClass as D}from"../../../../format/lib/content/section-min-height.js";import{COPIES_IN_THE_BOX as U,drawsCopiesInTheBox as $}from"../../../../format/lib/content/copies-in-box.js";import{ownEntry as c}from"../../../../format/lib/own-entry.js";const E={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}},ft=new Set(Object.keys(E));function m(t,e){return e?.innerPadding??c(E,t)}const ut=t=>m(t)??{},Pt=t=>c({DetailRows:{top:100,bottom:100}},t),O=new Set(["Flex","Text","Heading","ImageBlock","ButtonBlock"]),V=new Set(["Divider"]),X=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),T=new Set(["ProductGrid"]);function A(t,e,n=!1,o){const i=t.render;t.render=r=>{if(e?.(r))return i(r);const d={...W(r,K,n),sideSpace:L(r.sideSpace)},a=o?H({values:d,frame:o(r)},!0).outer:y(d),s=i(r);if(!a)return s;const l=u=>_(p,{className:u?`${a.className} ${u}`:a.className,children:N=>_(I,{className:N,style:a.style,children:s})}),g=D(r,{atSectionLine:!0}),b=D(r);return g===b?l(g):_(C,{line:"by-box",draw:u=>l(u?b:g)})}}const gt={name:"sectionPadding",applies:(t,e,n)=>e.isSection(t)&&!X.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const o=m(e,t);if(o){t.fields={...t.fields,...n.sidesPaddingFields({keys:S,unitKey:R,fallback:o,tablet:!0,siteSide:!0})};return}if(T.has(e))return;const i=[S.top,S.bottom].filter(d=>t.fields!=null&&d in t.fields);if(i.length)throw new Error(`section-padding: ${e} declares its own ${i.join(" / ")} row; declare \`innerPadding: { top, bottom }\` in its meta and the one Padding row draws on its band`);const r=c(x,e);if(r){w(t,e,n,r);return}t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(t,e){if(!m(e,t)){if(T.has(e)){A(t);return}O.has(e)||V.has(e)||A(t,e==="Flex"?n=>F(n.bgImage):U.has(e)?n=>$(e,n):void 0,!0,c(x,e))}}},k=["Heading","Text","ImageBlock","ButtonBlock"],G=["LogoBlock"],x={Text:t=>v(t,"text").textStyle?.startsWith("heading-")?P.heading:P.text,Heading:()=>P.heading,ButtonBlock:()=>P.text,Breadcrumb:()=>B(Y),SpecStrip:()=>B(j)},q={ButtonBlock:"Outer padding"};function z(t,e){const n=t[f],o=Array.isArray(n)?n.filter(s=>typeof s=="string"):[],i=h().filter(s=>e?.[s]);if(!i.length)return t;const r=[...o.filter(s=>!i.includes(s)),...i.filter(s=>typeof t[s]=="number")];if(r.length===o.length&&r.every((s,l)=>s===o[l]))return t;const{[f]:d,...a}=t;return r.length?{...a,[f]:r}:a}function J(t,e){if(e<=0)return null;const n=Array.isArray(t[f])?t[f]:[];return h().some(i=>typeof t[i]=="number"&&!n.includes(i))?M("plus {n} px (older setting)",{n:e}):null}function w(t,e,n,o){t.fields={...t.fields,...n.ownPaddingFields?.(o,J,c(q,e))??n.sidesPaddingFields({tablet:!0,siteSide:!0})};const i=t.resolveData;t.resolveData=(r,d)=>{const a=r.props??{},s=d?.trigger==="replace"?z(a,d.changed):a,l=s===a?r:{...r,props:s};return i?i(l,d):l}}const _t={name:"blockPadding",applies:(t,e,n)=>(k.includes(t)||G.includes(t))&&!!n&&typeof n.render=="function",panel(t,e,n){const o=c(x,e);if(!o){t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})};return}w(t,e,n,o)},draw(t,e){O.has(e)||A(t,void 0,!0)}};export{x as OWN_PAD_FRAME,q as OWN_PAD_LABEL,V as PADS_ITS_OWN_SPACE,O as PAD_ON_ROOT,ft as SECTION_PAD_INNER,E as SECTION_PAD_INNER_DEFAULTS,_t as blockPadding,ut as innerPaddingFallback,J as olderPadNote,Pt as ownPairDefault,gt as sectionPadding,z as withPadTotals};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as d}from"react/jsx-runtime";import{HideTaker as s}from"../../../components/ViewHideRoot.js";import{
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import{HideTaker as s}from"../../../components/ViewHideRoot.js";import{SideOnceClass as X}from"../../../components/SideSpaceOnce.js";import{LineChoice as q}from"../../../components/InBoxContext.js";import{BOX_TYPE as z}from"../../../../format/lib/document/container-blocks.js";import{INTRO_EDGE_CLASS as J}from"../../../../format/lib/sections/intro-bleed-layout.js";import{cssLengthOf as G}from"../../../../format/lib/content/css-length.js";import{resolveContainerDirection as Q}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as Z,HERO_CHROME_CAP_VAR as tt,HERO_CHROME_INSET_VAR as nt,FULL_SECTION_WIDTH as et,SITE_WIDTH_CAP as _,centredCap as v,heroBackgroundTokens as ot}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as D,SECTION_WIDTH_KEYS as F,hasOwnSectionWidth as it,hasWidthFamily as rt,resolveWidth as L,siteWidthsOf as ct}from"../../../../format/lib/content/section-width.js";import{boxCardProps as lt}from"../../../../format/lib/content/box-background.js";import{cardCopyPlace as dt}from"../../../../format/lib/content/card-template.js";import{BOX_GUTTER_KEY as ut,boxGutterOf as st,boxPlaceOf as at,boxRunsEdgeToEdge as ft,isFrameContainer as O,ownNodeWidth as ht,sectionGroundAnswer as _t,siteDrawsGutter as Nt}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as wt}from"../../../../format/lib/document/editor-site-widths.js";import{GroundStopsAt as H,NestedBoxChoice as Ct,SectionGroupChoice as Ot,SectionGroupWidthsProvider as Et,SectionRootChoice as Tt,SplitBandAndColumn as M}from"../../../components/SiteGutterFrame.js";import{FRAME as P}from"../../../components/BlockFrame.js";import{sectionFillPassClass as p}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as mt}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as E,withRowsShownWhen as T}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as St,heldByANode as pt,isNestedNode as xt,NOT_HELD_BY_A_NODE as y}from"../../../../format/lib/document/passes/document-position.js";import{ownEntry as U}from"../../../../format/lib/own-entry.js";const w="--sf-sw-site",Rt="--sf-sw-content",At="--sf-bg-cap",Wt="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",A=({own:n,content:t,siteContent:e})=>n===!0&&t==="full"&&e!=="full",k="contents view-wide:[--sf-site-width:100vw]",W=({held:n},t,e)=>n?e:d(s,{className:t,children:e}),It=`contents view-wide:[--sf-site-width:100vw] ${J} view-wide:[--sf-site-gutter:var(--intro-edge)]`,I=(n,t,e)=>t==="content"?`min(${G(n,e)},var(${w}))`:G(n,e);function m({content:n,contentMax:t,contentMaxUnit:e},o){return n==="full"?o!=="content"?et:null:t===null?null:I(t,o,e)}function S(n,t){return t===null?n:d(s,{className:"contents",style:{[w]:_},children:d(s,{className:Wt,style:{[Rt]:t},children:n})})}const bt="--sf-content-cap",gt="contents max-view-wide:[--sf-content-cap:none]";function Bt({content:n,contentMax:t,contentMaxUnit:e},o){return n==="full"?null:t!==null?I(t,o,e):o==="content"?null:`var(${w})`}function Gt(n,t){return t===null?n:d(s,{className:"contents",style:{[w]:_},children:d(s,{className:gt,style:{[bt]:t},children:n})})}const V=`var(${w},${_})`,h=(n,t,e="")=>n==="content"?d(s,{className:e||void 0,style:v(_),children:d(H,{ground:V,children:t})}):t;function $(n,t,e,o,c){if(A(e))return h(o,W(e,k,d(M,{children:n({...t,contained:!0})})),c);if(e.content==="full")return h(o,n({...t,contained:!1}),c);const i=m(e,o);return o==="content"&&i===null&&!e.own?n({...t,contained:!0}):h(o,S(d(M,{children:n({...t,contained:!0})}),i),c)}function vt(n,t,e,o,c){if(e==="hero"){const l=S(n(t),m(o,o.band));return o.band==="full"?d(s,{style:{[Z]:"none",[nt]:"initial",[tt]:"initial"},children:l}):o.band==="content"?d(s,{style:ot(!0),children:l}):l}const i=o.band??"full",r=p(t,{atSectionLine:!c});if(e==="rawMarkup"){if(o.content==="full")return h(i,n(t),r);const l=o.contentMax===null?_:I(o.contentMax,i,o.contentMaxUnit);return d(s,{className:"contents",style:{[w]:_},children:h(i,d(s,{className:r||void 0,style:v(l),children:n(t)}),r)})}if(e==="scrollOver"){const l=o.content==="full",u=A(o)?W(o,It,n({...t,fullWidth:!1})):S(n({...t,fullWidth:l}),l?null:m(o,i));return i==="content"?d(s,{className:"contents",style:{[At]:_},children:u}):u}switch(e){case"both":return h(i,Gt(n(t),Bt(o,i)),r);case"contained":return $(n,t,o,i,r);case"contentColumn":case"contentFull":case"productGrid":{const l=A(o),u=o.content==="full"&&!l?"full":"page",a=l?W(o,k,n({...t,widthMode:u})):S(n({...t,widthMode:u}),o.content==="full"?null:m(o,i));return e==="productGrid"&&!o.own?i==="content"?d(X,{className:r?`${P} ${r}`:P,children:N=>d(s,{className:N,children:a})}):a:h(i,a,r)}default:return h(i,S(n(t),m(o,i)),r)}}function Y(n,t,e,o,c){const i=c===z?"edge":"by-box",r=l=>vt(n,t,e,o,l);return i==="edge"?r(!0):p(t)===p(t,{atSectionLine:!0})?r(!1):d(q,{line:i,draw:r})}function Dt(n,t){const e=U(D,t);if(!e)return;const o=n.render;n.render=c=>{const i=ct(c),r={band:i.background,content:i.content??"content",contentMax:null},l=()=>e==="rawMarkup"?o(c):d(Ot,{draw:f=>f?.background==="content"?d(H,{ground:V,children:u(f)}):u(f)}),u=f=>{const C=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,R=Y(o,c,e,C,t);if(!O(t))return R;const g=st(c),B=g===void 0?C.content:g?"content":"full";return B===C.content?R:d(Ct,{atTop:R,nested:$(o,c,{...C,content:B,own:!1},C.band??"full",p(c))})},a=ht(t,c);if(!it(a))return l();const N=e==="rawMarkup",b=_t(t,c),j=a.content??(N?"full":r.content),x={band:b,content:b==="content"?"content":j,contentMax:a.contentMax,contentMaxUnit:a.contentMaxUnit,own:!N,siteContent:r.content};return d(Tt,{own:()=>d(Et,{value:{background:x.band,content:x.content},children:Y(o,c,e,x,t)}),followed:l})}}const Ft={all:[y,{not:{context:"runsEdgeToEdge",is:!0}}]},an={name:"sectionWidth",applies:(n,t,e)=>rt(n)&&!!e&&typeof e.render=="function",panel(n,t,e){const o=e.sectionOwnWidthFields({drawsFullOnItsOwn:U(D,t)==="rawMarkup"}),c=O(t)?e.boxGutterFields():{},i={...n.fields,...c,...o},r=O(t)?K(t,n,i,[ut]):i;E(n,{heldByANode:pt}),O(t)&&E(n,{runsEdgeToEdge:(l,u)=>ft(lt(l.props??{},dt(u.appState,l.props?.id)?.inCopy!==!1))}),n.fields=T(r,[F.background,F.content],O(t)?Ft:y)},draw(n,t){Dt(n,t)}};function Lt(n,t){if(!n||!("widthMode"in n))return n;const e={...n},o=e.widthMode;return o&&(e.widthMode={...o,currentValue:t.mode,inherited:t.inherited}),e}const Ht=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),fn={name:"containedWidth",applies:(n,t,e)=>Ht.has(n)&&!!e&&typeof e.render=="function",panel(n,t,e){const o=e.widthField;n.fields=K(t,n,{...n.fields,...o("page")});const c=n.resolveFields;n.resolveFields=(i,r)=>{const l=c?c(i,r):r.fields,u=L(i?.props??{},"page"),a=N=>Lt(N,u);return l&&typeof l.then=="function"?l.then(a):a(l)}},draw(n){const t=n.render;n.render=e=>{const{mode:o}=L(e,"page");return t({...e,contained:o!=="full"})}}},Mt={not:{context:"inHeroGroupRow",is:!0}},hn={name:"buttonAlignInRow",applies:n=>n==="ButtonBlock",panel(n){const t=n;t.fields=T(t.fields??{},["align"],Mt),E(t,{inHeroGroupRow:(e,o)=>{const c=St(o.appState,e.props?.id);return!!c&&c.type==="HeroGroup"&&Q("HeroGroup",c.props?.direction)==="row"}})}};function Pt(n){return Object.values(n).some(t=>!!t&&typeof t=="object"&&t.type==="slot")}const yt={any:[]},Ut={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},kt={not:{context:"widthCappedByParent",is:!0}};function K(n,t,e,o=["widthMode"]){if(n==="ButtonBlock")return T(e,["_gWidth",...o],yt);if(Pt(e)){const c=(i,r)=>at(r.appState?.data?.content,i.props?.id,Nt(wt()));return E(t,{outsideBox:(i,r)=>c(i,r)?.inBox!==!0,insideSiteGutter:(i,r)=>c(i,r)?.insideGutter}),T(e,o,Ut)}return E(t,{widthCappedByParent:(c,i)=>"parent"in i?mt(i.parent):xt({props:c.props??{}},i)}),T(e,o,kt)}export{At as SECTION_BACKGROUND_VAR,gt as SECTION_CONTENT_CAP_CLASS,bt as SECTION_CONTENT_CAP_VAR,Wt as SECTION_CONTENT_CLASS,Rt as SECTION_CONTENT_VAR,w as SITE_CONTENT_VAR,hn as buttonAlignInRow,fn as containedWidth,an as sectionWidth,Lt as widthModeFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{SECTION_CSS_SCOPE_ATTR as n}from"../../../format/lib/content/section-css.js";import{scopeCustomCss as m}from"./custom-css.js";function l({css:t,id:s,attr:e=n}){const o=m(t,s,e);return o?r("style",{dangerouslySetInnerHTML:{__html:o}}):null}export{l as default};
|