efficient-web-builder 73.2.0 → 74.1.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.
Files changed (114) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/editor/components/CustomHtmlCodeWindow.d.ts +11 -0
  3. package/dist/editor/components/CustomHtmlCodeWindow.js +20 -0
  4. package/dist/editor/components/PreviewPartAnchors.d.ts +2 -1
  5. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  6. package/dist/editor/components/SectionThemePicker.d.ts +3 -2
  7. package/dist/editor/components/SectionThemePicker.js +1 -1
  8. package/dist/editor/components/SiteTextStylesField.d.ts +2 -1
  9. package/dist/editor/components/SiteTextStylesField.js +1 -1
  10. package/dist/editor/components/StandaloneSectionEditor.js +1 -1
  11. package/dist/editor/components/StorefrontEditor.js +1 -1
  12. package/dist/editor/components/WebsiteSettingsPanel.d.ts +2 -0
  13. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  14. package/dist/editor/components/storefront-editor.css +111 -0
  15. package/dist/editor/lib/document/blocks/general/CustomHTML/fields.d.ts +6 -0
  16. package/dist/editor/lib/document/blocks/general/CustomHTML/fields.js +1 -0
  17. package/dist/editor/lib/document/blocks/general/index.js +1 -1
  18. package/dist/editor/lib/document/controls.d.ts +2 -0
  19. package/dist/editor/lib/document/controls.js +1 -1
  20. package/dist/editor/lib/document/custom-html-preview.d.ts +12 -0
  21. package/dist/editor/lib/document/custom-html-preview.js +1 -0
  22. package/dist/editor/lib/document/own-pad-fields.d.ts +7 -1
  23. package/dist/editor/lib/document/own-pad-fields.js +1 -1
  24. package/dist/format/lib/animation/hover.js +1 -1
  25. package/dist/format/lib/animation/loop.js +1 -1
  26. package/dist/format/lib/content/accordion-row-style.js +1 -1
  27. package/dist/format/lib/content/borders.d.ts +2 -1
  28. package/dist/format/lib/content/borders.js +1 -1
  29. package/dist/format/lib/content/box-layout.js +1 -1
  30. package/dist/format/lib/content/button-icon.js +1 -1
  31. package/dist/format/lib/content/card-place.js +1 -1
  32. package/dist/format/lib/content/chat-launcher.js +1 -1
  33. package/dist/format/lib/content/container-direction.js +1 -1
  34. package/dist/format/lib/content/footprint.js +1 -1
  35. package/dist/format/lib/content/image-fit.js +1 -1
  36. package/dist/format/lib/content/image-text-rows.js +1 -1
  37. package/dist/format/lib/content/list-number.js +1 -1
  38. package/dist/format/lib/content/list-position.js +1 -1
  39. package/dist/format/lib/content/text-tag.js +1 -1
  40. package/dist/format/lib/document/blocks/block-types.d.ts +1 -0
  41. package/dist/format/lib/document/blocks/general/text-part-shapes.json +0 -6
  42. package/dist/format/lib/document/box-footer.js +1 -1
  43. package/dist/format/lib/document/custom-html-place.d.ts +19 -0
  44. package/dist/format/lib/document/custom-html-place.js +7 -0
  45. package/dist/format/lib/document/left-view.js +1 -1
  46. package/dist/format/lib/document/mockup-variant-fields.js +1 -1
  47. package/dist/format/lib/document/part-inks.d.ts +1 -0
  48. package/dist/format/lib/document/part-inks.js +1 -1
  49. package/dist/format/lib/document/passes/types.d.ts +4 -2
  50. package/dist/format/lib/editor-words-catalogue.d.ts +19 -0
  51. package/dist/format/lib/editor-words-catalogue.js +4 -4
  52. package/dist/format/lib/hero-arrows.js +1 -1
  53. package/dist/format/lib/hero-group-placement.js +1 -1
  54. package/dist/format/lib/hero-media-layout.js +1 -1
  55. package/dist/format/lib/hero-phone-stack.js +1 -1
  56. package/dist/format/lib/hero-video.js +1 -1
  57. package/dist/format/lib/reel.js +1 -1
  58. package/dist/format/lib/sections/divider-style.js +1 -1
  59. package/dist/format/lib/sections/hero-overlay.js +1 -1
  60. package/dist/format/lib/sections/intro-bleed-layout.js +1 -1
  61. package/dist/format/lib/sections/logo-look.js +1 -1
  62. package/dist/format/lib/sections/product-card-style.js +1 -1
  63. package/dist/format/lib/sections/section-eyebrow-look.js +1 -1
  64. package/dist/format/lib/sections/section-head-placement.js +1 -1
  65. package/dist/format/lib/sections/section-head-style.js +1 -1
  66. package/dist/format/lib/sections/section-number-style.js +1 -1
  67. package/dist/format/lib/sections/strip-shape.d.ts +1 -0
  68. package/dist/format/lib/sections/strip-shape.js +1 -1
  69. package/dist/format/lib/sections/ticker-style.js +1 -1
  70. package/dist/format/lib/text-style-face.d.ts +6 -0
  71. package/dist/format/lib/text-style-face.js +2 -1
  72. package/dist/format/lib/theme.d.ts +2 -1
  73. package/dist/format/lib/theme.js +3 -3
  74. package/dist/render/components/BoxTabs.js +1 -1
  75. package/dist/render/components/Breadcrumb.d.ts +4 -1
  76. package/dist/render/components/Breadcrumb.js +1 -1
  77. package/dist/render/components/PhoneMenuTools.d.ts +3 -1
  78. package/dist/render/components/PhoneMenuTools.js +1 -1
  79. package/dist/render/components/PublishedPartStylesContext.d.ts +2 -1
  80. package/dist/render/components/PublishedPartStylesContext.js +1 -1
  81. package/dist/render/components/SpecStrip.d.ts +4 -1
  82. package/dist/render/components/SpecStrip.js +1 -1
  83. package/dist/render/lib/content/section-padding.d.ts +24 -14
  84. package/dist/render/lib/content/section-padding.js +1 -1
  85. package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
  86. package/dist/render/lib/document/blocks/general/CustomHTML/render.js +1 -1
  87. package/dist/render/lib/document/blocks/general/LocationMap/render.js +1 -1
  88. package/dist/render/lib/document/blocks/general/SpecStrip/render.js +1 -1
  89. package/dist/render/lib/document/blocks/general/section-head-looks.js +1 -1
  90. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -0
  91. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  92. package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
  93. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
  94. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
  95. package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -1
  96. package/dist/render/lib/document/custom-css.d.ts +4 -0
  97. package/dist/render/lib/document/custom-css.js +3 -2
  98. package/dist/render/lib/document/header-clearance.js +1 -1
  99. package/dist/render/lib/document/header-ink.js +1 -1
  100. package/dist/render/lib/document/part-styles.d.ts +7 -4
  101. package/dist/render/lib/document/part-styles.js +2 -2
  102. package/dist/render/lib/document/passes/clickable-parts.js +1 -1
  103. package/dist/render/lib/document/passes/section-padding.d.ts +2 -1
  104. package/dist/render/lib/document/passes/section-padding.js +1 -1
  105. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  106. package/dist/routine-index.json +1 -1
  107. package/dist/value-index.json +1 -1
  108. package/package.json +27 -6
  109. package/dist/format/lib/document/blocks/general/CustomHTML/fields.d.ts +0 -2
  110. package/dist/format/lib/document/blocks/general/CustomHTML/fields.js +0 -1
  111. package/dist/format/lib/parse-option.d.ts +0 -3
  112. package/dist/format/lib/parse-option.js +0 -1
  113. package/dist/format/lib/source-rules/one-option-parser.d.ts +0 -12
  114. package/dist/format/lib/source-rules/one-option-parser.js +0 -12
@@ -1 +1 @@
1
- import{SECTION_CSS_KEY as G}from"../../../../../format/lib/content/section-css.js";import{siteLengthHeld as M,storedUnit as b}from"../../../../../format/lib/content/css-length.js";import{SECTION_WIDTH_KEYS as Y}from"../../../../../format/lib/content/section-width.js";import{CELL_SPAN_KEYS as W}from"../../../../../format/lib/content/grid-span.js";import{BLOCK_LENGTH_KEYS as C,blockLengthUnitKey as F}from"../../../content/block-size.js";import{viewStoreKeys as v}from"../../../../../format/lib/animation/views.js";import{BOX as w,INNER_BOX as I,LABEL_FACE as U,TEXT as R,boxPadding as X,fillSlot as O,token as V}from"../../../../../format/lib/document/seed-parts.js";import{ENTRANCE_STORE_KEYS as $,LEGACY_ENTRANCE_KEY as j}from"../../../animation/entrance.js";import{SCROLL_STORE_KEYS as z}from"../../../../../format/lib/animation/scroll.js";import{SECTION_PIN_KEYS as J}from"../../../../../format/lib/content/section-sticky.js";import{SECTION_CORNERS_ROW as q}from"../../../../../format/lib/content/section-corners.js";import{SECTION_BORDER_UNIT_KEYS as Q}from"../../../../../format/lib/content/borders.js";import{CARD_HOVER_KEYS as S}from"../../../../../format/lib/animation/hover.js";import{COUNT_KEY_PROP as Z}from"../../../../../format/lib/content/block-sources.js";import{SITE_GUTTER as tt,SITE_GUTTER_PHONE as ot,normalizeSiteGutter as et,normalizeSiteGutterPhone as nt,siteGutterPhoneFollows as it}from"../../../../../format/lib/content/page-width.js";import{BAND_TO_SECTION_PAD as A,bandTopBottom as rt}from"../../../content/section-padding.js";import{ButtonBlockMeta as st}from"../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";import{innerPaddingFallback as dt}from"../../passes/section-padding.js";import{finiteNumber as u}from"../../../../../format/lib/finite-number.js";import{convertTheme as _,hasWords as ct}from"../../../sections/section-to-box.js";import{THEME_SECTION_BG as at}from"../../../../../format/lib/content/section-background.js";import{fillSlotOfInk as H}from"../../../../../format/lib/document/part-inks.js";import{parseHexColor as pt}from"efficient-shell/format";import{convertLength as lt}from"efficient-easel/screen/lib/content/length-units";import{bandPresetIndex as mt,surfacePresetIndex as gt,surfaceTwoTone as Pt}from"../../../../../format/lib/theme.js";import{VIEW_HIDE_KEYS as ft}from"../../../../../format/lib/content/view-hide-class.js";import{tierOfView as ht}from"../../../../../format/lib/content/view-tier.js";const s=(t,o,e,n)=>o===e?t:lt(t,o,e,n,{min:0,max:200,step:4});import{BOX as Co,DIM as Io,INNER_BOX as Uo,TEXT as Ro}from"../../../../../format/lib/document/seed-parts.js";const Zt={textFit:"line",textFitPhone:"wrap"},ut={...R,[Z]:""},{label:to,href:oo,...Tt}=st.defaultProps,eo=Tt,no={buttonFillOpacity:0,buttonBorder:{width:0},buttonPaddingTop:0,buttonPaddingRight:0,buttonPaddingBottom:0,buttonPaddingLeft:0},io={...w,sectionAccent:0},ro={sectionAccent:-1},so=[...W,"sectionHeightMode","sectionHeightValue","sectionHeightUnit","sectionHeightModeTablet","sectionHeightValueTablet","sectionHeightUnitTablet","sectionHeightModePhone","sectionHeightValuePhone","sectionHeightUnitPhone","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone","sectionAccent",q.unitKey,...Q,...J,"anchor",j,...ft,G,...$,...z,...v(["widthFit",...C,...C.map(F)]),...Object.values(Y)],P="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",co={sectionSurface:"read by nothing in src/ (searched 2026-10-24): a retired theme key that draws nothing today, so dropping it changes nothing",widthMode:P,fullWidth:P,pageWidth:P,backgroundWidth:P,contentWidth:P,contentMax:P},ao=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)"]));function bt(t,o){const e=u(t.sectionPaddingTop)??0,n=u(t.sectionPaddingBottom)??0,i=u(t.sectionPaddingTopTablet),r=u(t.sectionPaddingBottomTablet),c=b(t.sectionPaddingUnit),l=b(t.sectionPaddingUnitTablet),m=b(t.sectionPaddingUnitPhone),f=(g,a,h,p)=>{const d=u(g);if(d!==void 0)return d+s(p,"px",m,"mobile");const N=a===void 0?{n:h,unit:c}:{n:a,unit:l};return s(N.n,N.unit,m,"mobile")+s(p,"px",m,"mobile")},T=(g,a,h,p,d)=>a!==void 0?{[g]:a+s(d??p,"px",l,"tablet")}:d===void 0?{}:{[g]:s(h,c,l,"tablet")+s(d,"px",l,"tablet")};return{sectionPaddingTop:e+s(o.top,"px",c,"desktop"),sectionPaddingBottom:n+s(o.bottom,"px",c,"desktop"),...T("sectionPaddingTopTablet",i,e,o.top,o.topTablet),...T("sectionPaddingBottomTablet",r,n,o.bottom,o.bottomTablet),sectionPaddingTopPhone:f(t.sectionPaddingTopPhone,i,e,o.topPhone),sectionPaddingBottomPhone:f(t.sectionPaddingBottomPhone,r,n,o.bottomPhone)}}const po=t=>[...["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopTablet","sectionPaddingBottomTablet","sectionPaddingTopPhone","sectionPaddingBottomPhone"].map(o=>[o,o,(e,n)=>bt(n,typeof t=="function"?t(n):t)[o]]),["sectionPaddingUnit","sectionPaddingUnit"],["sectionPaddingUnitTablet","sectionPaddingUnitTablet"],["sectionPaddingUnitPhone","sectionPaddingUnitPhone"]];function B(t,o){const e={};for(const[i,r]of A)t[i]!==void 0&&(e[r]=t[i]);const n=rt(t,dt(o));return{...e,sectionPaddingTop:n.top,sectionPaddingBottom:n.bottom}}const lo=t=>[...A.map(([o,e])=>[o,e,(n,i)=>B(i,t)[e]]),["sectionPaddingTop","sectionPaddingTop",(o,e)=>B(e,t).sectionPaddingTop],["sectionPaddingBottom","sectionPaddingBottom",(o,e)=>B(e,t).sectionPaddingBottom]],_t={kind:"heading-case-upper",styles:["heading-1","heading-2","heading-3"]},mo=t=>o=>ct(o.props[t])?[_t]:[],xt=(t,o)=>({kind:"text",key:t,role:"eyebrow",props:R,...o?{style:o}:{}}),go=t=>({kind:"group",name:"Chip",props:{...I,...O("main"),...X(6,14)},parts:[xt(t,{color:"background",...V("label",12),weight:600,letterSpacing:.16})]}),L=t=>t.background!=="transparent",Et=(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},k={align:"right",alignPhone:"left"},Ot=(t,o,e)=>{const n=i=>Et(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}},Po=(t,o,e,n={})=>Ot(t,o,{...ut,...k,...n,_partStyles:{text:{...U,color:"labels",...e,case:U.case,...k}}}),x=(t,o)=>typeof t=="number"&&Number.isInteger(t)&&t>=0?t:_(o)?.selected??0,K="var(--site-surface-2)",y=(t,o)=>_(o)?.themes[x(t.sectionAccent??0,o)],St=(t,o)=>(e,n)=>{if(!o?.(e,n))return O(t);const i=y(e,n)?.[t];return i?{fillColor:i}:{}},fo=(t,o)=>E(t,o)>=0,D=t=>t.startsWith("#")&&pt(t)!==null,ho=(t,o,e)=>{const n=t?.trim();if(n&&D(n))return{fillColor:n};const i=H(n);if(i)return O(i);const r=n===K?y(o,e):void 0;return r?{fillColor:Pt(r)}:{}},uo=t=>{const o=t?.trim();return!o||o==="transparent"||o===at||H(o)||o===K||D(o)?void 0:"it paints a colour that no Box Fill can hold"},E=(t,o)=>{const e=_(o)?.themes;return e&&L(t)?mt(e,x(t.sectionAccent,o)):-1},To=(t,o,e)=>{const n=E(o,e);return n>=0?n:t},bo=(t,o)=>{const e=_(o)?.themes,n=e?gt(e,x(t,o)):-1;return n>=0?n:t},_o=(t,o)=>{const e=E(t,o);return e>=0?{sectionAccent:e}:{}},xo=(t,o)=>L(t.props)&&E(t.props,o)<0?[{kind:"band-preset",page:x(t.props.sectionAccent,o)}]:[],Eo=(t,{view:o="desktop",to:e="px",maxPx:n=1/0}={})=>{const{siteGutter:i,siteGutterUnit:r,siteGutterPhone:c,siteGutterPhoneUnit:l}=t.site??{},m=ht(o),f=(g,a,h)=>{const p=b(a),d=M(g,p,"spacing",h);return d===null?null:s(d,p,"px",m)},T=o==="desktop"?f(i,r,tt)??et(i):f(c,l,ot)??nt(c)??it(i,r);return s(Math.min(n,T),"px",e,m)},Bt=Object.fromEntries(["Top","Right","Bottom","Left","TopPhone","RightPhone","BottomPhone","LeftPhone"].map(t=>[`sectionPadding${t}`,0])),Oo=t=>({top:0,right:0,bottom:0,left:0,...t}),So=(t,o,e,n=[])=>({kind:"group",name:t,keepEmpty:!0,props:(i,r)=>({...I,...Bt,...St("surface")(i,r),...typeof e=="function"?e(i,r):e}),box:[[o,"bgImage"],S.kind,S.duration,S.delay],parts:n});export{Zt as AUTO_COLUMN,Co as BOX,eo as BUTTON,Io as DIM,co as DROP_COMMON,ao as DROP_SIDE_PADDING,ro as FOLLOW_THE_BOX,_t as HEADING_CASE_UPPER,Uo as INNER_BOX,Bt as NO_PAD,ut as NUMBER_TEXT,k as RIGHT_WORDS,so as SAME_KEYS,io as SECTION_BOX,no as SH_LINK,Ro as TEXT,To as bandAccent,E as bandIndex,x as bandPage,_o as bandProps,xo as bandWrites,St as fillFrom,uo as fillNoBoxHolds,go as filledChip,mo as headingCaseOf,B as innerPad,lo as innerPadKeys,Po as leadLine,Ot as leadText,Oo as lineSides,Et as numberAndUnit,fo as onBandPreset,ho as ownFill,So as pictureCell,y as sectionPage,Eo as siteGutterOf,xt as smallText,bo as surfaceAccent,bt as wrapperPad,po as wrapperPadKeys};
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{phoneKey as K}from"efficient-easel/draw";import{SITE_SIDE as Y}from"efficient-easel/screen/lib/content/length-units";import{finiteNumber as r}from"../../../../../format/lib/finite-number.js";import{BLOCK_ALIGN_BOX_WORD as X}from"../../../../../format/lib/content/block-align.js";import{splitImageOverlay as x}from"../../../../../format/lib/document/blocks/general/Split/meta.js";import{INTRO_SIZE_UNIT_KEYS as j,introSizeUnitsOf as T}from"../../../../../format/lib/content/section-type-size.js";import{PART_UNIT_KEY_OF as w}from"../../part-styles.js";import{parseIntroBleedLayout as G}from"../../../../../format/lib/sections/intro-bleed-layout.js";import{SECTION_PIN_STOP_KEY as q,SECTION_PIN_STOP_SCREEN as Z}from"../../../../../format/lib/content/section-sticky.js";import{fluidToken as $,token as n}from"./section-head-looks.js";import{labelStyle as J}from"../../../../../format/lib/document/seed-parts.js";import{BUTTON as c,DIM as B,DROP_COMMON as p,DROP_SIDE_PADDING as O,INNER_BOX as i,NO_PAD as u,NUMBER_TEXT as Q,SAME_KEYS as m,SECTION_BOX as y,TEXT as P,fillFrom as _,lineSides as a,pictureCell as H,siteGutterOf as I,smallText as s,wrapperPad as M,wrapperPadKeys as A}from"./section-to-box-row-parts.js";import{parseOption as ee}from"../../../../../format/lib/parse-option.js";const v=(e,t,o)=>{const f=r(e),k=r(t),S=(V,g)=>g&&g!=="px"?{[V]:g}:{};return{...f===void 0?{}:{size:f,...S(w.size,o?.desktop)},...k===void 0?{}:{sizePhone:k,...S(w.sizePhone,o?.phone)}}},te=e=>G(e.layout)==="stacked",E=e=>Math.min(Math.max(r(e.overlay)??60,0),100),d=e=>r(e)??100,oe={textStyle:"heading-1",sizeToken:{...$("headingLarge",48,7,96).sizeToken,pxPhone:36},weight:500,lineHeight:.95,letterSpacing:-.03},ne=[s("eyebrow",n("label",14)),...[!0,!1].map(e=>({kind:"text",key:"title",role:"heading",props:P,style:{...oe,case:e?"upper":"none"},styleFrom:t=>{const o=T(t);return v(t.titleSizeDesktop,t.titleSizeMobile,{desktop:o.titleDesktop,phone:o.titleMobile})},when:t=>t.uppercase===!0===e})),{kind:"text",key:"body",props:{...B,maxWidth:560},style:{textStyle:"body-1",...n("body",17,16),lineHeight:1.6,paragraphSpacing:24},styleFrom:e=>{const t=T(e);return v(e.bodySizeDesktop,e.bodySizeMobile,{desktop:t.bodyDesktop,phone:t.bodyMobile})}},{kind:"group",name:"Button",props:{...i,align:"start",sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:c}]}],N=e=>`${e}: a Button block has no colour of its own (it follows the site Button colour, as the old fallback did); 0 of 3 live US nodes store one (CLI read, 2026-11-03)`,ie=()=>({name:"Scroll-Over Text",skip:e=>te(e)?"the stacked layout: its words row's height floor (`copyShare*`) and the header subtraction have no Box setting; 0 live US nodes":void 0,boxProps:e=>({...y,direction:"column",justify:"center",align:"start",gap:24,gapPhone:24,share:"content",...u,placement:"left",darken:E(e),darkenStyle:"even",sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:d(e.heightDesktop),sectionHeightModePhone:"fixed",sectionHeightUnitPhone:"%",sectionHeightValuePhone:d(e.heightMobile),[q]:Z}),box:[...m.filter(e=>!String(typeof e=="string"?e:e[0]).startsWith("sectionHeight")),["imageSrc","bgImage"],["imageSrcMobile","bgImagePhone"],["overlay","darken",(e,t)=>E(t)],["heightDesktop","sectionHeightValue",e=>d(e)],["heightMobile","sectionHeightValuePhone",e=>d(e)]],parts:ne,drop:{uppercase:"not a value of its own: it picks the heading part — Case Upper when on, None (as typed) when off",layout:"not a value of its own: the overlay layout is this tree; a stacked node is skipped (`skip`)",copyShareDesktop:"the stacked layout's words-row floor, read only there; a stacked node is skipped",copyShareMobile:"the stacked layout's words-row floor, read only there; a stacked node is skipped",sticky:"the old pin key, read as `stickTop` by the section pin's one reader (lib/content/section-sticky); the Box keeps a stored `stickTop` (SAME_KEYS), and this row is switched off until the stored pages hold `stickTop`",titleSizeDesktop:"read by the heading part's `styleFrom`: a number is its Size, `inherit` and unset follow the token",titleSizeMobile:"read by the heading part's `styleFrom`: a number is its phone Size, `inherit` and unset follow the token",bodySizeDesktop:"read by the words part's `styleFrom`: a number is its Size, `inherit` and unset follow the token",bodySizeMobile:"read by the words part's `styleFrom`: a number is its phone Size, `inherit` and unset follow the token",...Object.fromEntries(j.map(e=>[e,"read by its part's `styleFrom`: the unit of that view's Size"])),buttonColor:N("Button color"),buttonTextColor:N("Button text color"),...p}}),D={textStyle:"heading-2",...n("headingMedium",56,36),weight:400,lineHeight:1.05,letterSpacing:-.03},re={textStyle:"body-1",...n("body",16),lineHeight:1.7},z=e=>({kind:"text",key:"body",props:{...B,maxWidth:520},style:{...re,paragraphSpacing:e}}),l={top:0,bottom:0,topPhone:0,bottomPhone:0},b=(e,t)=>typeof e.sectionHeightMode=="string"&&e.sectionHeightMode!=="auto"?{}:{sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:t,sectionHeightModePhone:"auto"},ae=(e,t)=>{const o=b(e,t);return Object.keys(o).length?o:{sectionHeightMode:e.sectionHeightMode,...e.sectionHeightValue===void 0?{}:{sectionHeightValue:e.sectionHeightValue},...e.sectionHeightUnit===void 0?{}:{sectionHeightUnit:e.sectionHeightUnit},sectionHeightModePhone:"auto"}},R={boxShapePhone:"landscape"},U="needs a black-and-white setting on a Box picture (the old photograph followed it, else the site's Photography); 0 live US nodes store it (CLI read, 2026-11-03)",se=(e,t)=>({[e]:t,[K(e)]:t}),de={textStyle:"heading-2",...n("headingMedium",40),weight:500,case:"none",lineHeight:1,letterSpacing:-.02},C=e=>(Array.isArray(e.stats)?e.stats:[]).filter(t=>t&&(String(t.value??"").trim()!==""||String(t.label??"").trim()!=="")),le=()=>({name:"Brand Text",boxProps:(e,t)=>({...y,..._("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...M(e,l),...b(e,100)}),box:[...m,...A(l)],parts:[{kind:"group",name:"Words",props:()=>({...i,justify:"center",gap:28,gapPhone:28,sectionBorder:a({right:1}),sectionBorderPhone:a({}),...u,sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60,sectionPaddingRight:Y}),parts:[s("eyebrow",n("label",14)),{kind:"text",key:"heading",role:"heading",props:P,style:{...D,case:"none"},mark:"accentItalic"},z(28),{kind:"group",name:"Stats",props:{...i,sectionPaddingTop:16,sectionPaddingTopPhone:16},parts:[{kind:"group",name:"Figures",props:e=>({...i,direction:"row",share:"equal",gap:24,gapPhone:24,maxWidth:520,phoneRow:Math.min(Math.max(C(e).length,1),3),...se("sectionBorder",a({top:1})),sectionPaddingTop:28,sectionPaddingTopPhone:28}),parts:[{kind:"list",key:"stats",name:"Stat",of:C,props:{...i,gap:4,gapPhone:4},parts:[{kind:"text",key:"value",props:Q,style:de},s("label",{...n("label",13),color:"labels",letterSpacing:.2})]}]}]}]},H("Picture","imageSrc",R)],drop:{...p,grayscale:U,...O}}),h=e=>{const t=e.textAlign==="center"||e.textAlign==="right"?{align:e.textAlign}:{},o=e.textAlignPhone==="left"||e.textAlignPhone==="center"||e.textAlignPhone==="right"?{alignPhone:e.textAlignPhone}:{};return{...t,...o}},he=e=>e.textAlign==="center"||e.textAlign==="right"?X[e.textAlign]:"stretch",ge=e=>Math.min(Math.max(r(e.overlay)??60,0),100),F=e=>typeof e=="string"&&e.trim()!=="",ce={...c,align:"center",alignPhone:"center",buttonFillOpacity:0,buttonBorder:{width:1},buttonPaddingTop:16,buttonPaddingRight:28,buttonPaddingBottom:16,buttonPaddingLeft:28,buttonPaddingTopPhone:12,buttonPaddingRightPhone:20,buttonPaddingBottomPhone:12,buttonPaddingLeftPhone:20},L=e=>({...H("Picture","imageSrc",(t,o)=>({...F(t.imageSrc)&&x(t.imageOverlay)>0?{darken:x(t.imageOverlay),darkenStyle:"even"}:{},placement:"center",...R,sectionBorder:a(e?{left:1}:{right:1}),...W(e?"left":"right",I(o))}),[{kind:"button",key:"imageBtnText",href:"imageBtnHref",variant:"ghost",props:ce,style:{...J(13,12),letterSpacing:.18}}]),when:t=>t.reverse===!0===e}),W=(e,t)=>{const o=Math.max(60-t,0);return{sectionPaddingLeft:e==="left"?60:o,sectionPaddingRight:e==="right"?60:o}},pe={kind:"group",name:"Words",props:(e,t)=>{const o=e.reverse===!0;return{...i,justify:"center",align:he(e),placement:ee(["left","center","right"],"left",e.textAlign),...ae(e,72),gap:24,gapPhone:24,...F(e.textBgSrc)?{darken:ge(e),darkenStyle:"even"}:{},...u,sectionPaddingTop:100,sectionPaddingBottom:100,...W(o?"right":"left",I(t)),sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60}},box:[["textBgSrc","bgImage"]],parts:[{...s("eyebrow",n("label",14)),styleFrom:h},{kind:"text",key:"title",role:"heading",props:P,style:D,styleFrom:e=>({case:e.uppercase===!0?"upper":"none",...h(e)})},{...z(24),styleFrom:h},{kind:"group",name:"Button",props:{...i,sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:e=>{const t=h(e);return{...c,...t.align?{align:t.align}:{},...t.alignPhone?{alignPhone:t.alignPhone}:{}}}}]}]},ue=()=>({name:"Image & Text Split",boxProps:(e,t)=>({...y,..._("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...M(e,l),...b(e,72)}),box:[...m,...A(l)],parts:[L(!1),pe,L(!0)],drop:{reverse:"not a value of its own: it picks the order — the Picture Box first, or after the Words",uppercase:"not a value of its own: the heading part's Case — Upper when on, None (as typed) when off",textAlign:"read by each words part (its Align) and the Words Box (its Align); left writes nothing, as the old emitted no class",textAlignPhone:"read by each words part as its phone Align",textAlignTablet:"not carried to the words part's own tablet Align (`alignTablet`) yet: no old node stores it (new with the Tablet view's Text alignment row, 0 stored on the US sites 2026-11-06), so nothing moves",overlay:"read by the Words Box: its Darken over the words picture (60 when unset); no picture, no wash",imageOverlay:"read by the Picture Box: its Darken over the image column's picture (40 when unset, none at 0); no picture, no wash",grayscale:U,...p,...O}}),He={IntroBleed:ie(),Manifesto:le(),Split:ue()};export{He as EDITORIAL_SECTION_TO_BOX};
1
+ import{phoneKey as K}from"efficient-easel/draw";import{SITE_SIDE as Y}from"efficient-easel/screen/lib/content/length-units";import{finiteNumber as r}from"../../../../../format/lib/finite-number.js";import{BLOCK_ALIGN_BOX_WORD as X}from"../../../../../format/lib/content/block-align.js";import{splitImageOverlay as x}from"../../../../../format/lib/document/blocks/general/Split/meta.js";import{INTRO_SIZE_UNIT_KEYS as j,introSizeUnitsOf as T}from"../../../../../format/lib/content/section-type-size.js";import{PART_UNIT_KEY_OF as w}from"../../part-styles.js";import{parseIntroBleedLayout as G}from"../../../../../format/lib/sections/intro-bleed-layout.js";import{SECTION_PIN_STOP_KEY as q,SECTION_PIN_STOP_SCREEN as Z}from"../../../../../format/lib/content/section-sticky.js";import{fluidToken as $,token as n}from"./section-head-looks.js";import{labelStyle as J}from"../../../../../format/lib/document/seed-parts.js";import{BUTTON as c,DIM as B,DROP_COMMON as p,DROP_SIDE_PADDING as O,INNER_BOX as i,NO_PAD as u,NUMBER_TEXT as Q,SAME_KEYS as m,SECTION_BOX as y,TEXT as P,fillFrom as _,lineSides as a,pictureCell as H,siteGutterOf as I,smallText as s,wrapperPad as M,wrapperPadKeys as A}from"./section-to-box-row-parts.js";import{parseOption as ee}from"efficient-shell/format";const v=(e,t,o)=>{const f=r(e),k=r(t),S=(V,g)=>g&&g!=="px"?{[V]:g}:{};return{...f===void 0?{}:{size:f,...S(w.size,o?.desktop)},...k===void 0?{}:{sizePhone:k,...S(w.sizePhone,o?.phone)}}},te=e=>G(e.layout)==="stacked",E=e=>Math.min(Math.max(r(e.overlay)??60,0),100),d=e=>r(e)??100,oe={textStyle:"heading-1",sizeToken:{...$("headingLarge",48,7,96).sizeToken,pxPhone:36},weight:500,lineHeight:.95,letterSpacing:-.03},ne=[s("eyebrow",n("label",14)),...[!0,!1].map(e=>({kind:"text",key:"title",role:"heading",props:P,style:{...oe,case:e?"upper":"none"},styleFrom:t=>{const o=T(t);return v(t.titleSizeDesktop,t.titleSizeMobile,{desktop:o.titleDesktop,phone:o.titleMobile})},when:t=>t.uppercase===!0===e})),{kind:"text",key:"body",props:{...B,maxWidth:560},style:{textStyle:"body-1",...n("body",17,16),lineHeight:1.6,paragraphSpacing:24},styleFrom:e=>{const t=T(e);return v(e.bodySizeDesktop,e.bodySizeMobile,{desktop:t.bodyDesktop,phone:t.bodyMobile})}},{kind:"group",name:"Button",props:{...i,align:"start",sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:c}]}],N=e=>`${e}: a Button block has no colour of its own (it follows the site Button colour, as the old fallback did); 0 of 3 live US nodes store one (CLI read, 2026-11-03)`,ie=()=>({name:"Scroll-Over Text",skip:e=>te(e)?"the stacked layout: its words row's height floor (`copyShare*`) and the header subtraction have no Box setting; 0 live US nodes":void 0,boxProps:e=>({...y,direction:"column",justify:"center",align:"start",gap:24,gapPhone:24,share:"content",...u,placement:"left",darken:E(e),darkenStyle:"even",sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:d(e.heightDesktop),sectionHeightModePhone:"fixed",sectionHeightUnitPhone:"%",sectionHeightValuePhone:d(e.heightMobile),[q]:Z}),box:[...m.filter(e=>!String(typeof e=="string"?e:e[0]).startsWith("sectionHeight")),["imageSrc","bgImage"],["imageSrcMobile","bgImagePhone"],["overlay","darken",(e,t)=>E(t)],["heightDesktop","sectionHeightValue",e=>d(e)],["heightMobile","sectionHeightValuePhone",e=>d(e)]],parts:ne,drop:{uppercase:"not a value of its own: it picks the heading part — Case Upper when on, None (as typed) when off",layout:"not a value of its own: the overlay layout is this tree; a stacked node is skipped (`skip`)",copyShareDesktop:"the stacked layout's words-row floor, read only there; a stacked node is skipped",copyShareMobile:"the stacked layout's words-row floor, read only there; a stacked node is skipped",sticky:"the old pin key, read as `stickTop` by the section pin's one reader (lib/content/section-sticky); the Box keeps a stored `stickTop` (SAME_KEYS), and this row is switched off until the stored pages hold `stickTop`",titleSizeDesktop:"read by the heading part's `styleFrom`: a number is its Size, `inherit` and unset follow the token",titleSizeMobile:"read by the heading part's `styleFrom`: a number is its phone Size, `inherit` and unset follow the token",bodySizeDesktop:"read by the words part's `styleFrom`: a number is its Size, `inherit` and unset follow the token",bodySizeMobile:"read by the words part's `styleFrom`: a number is its phone Size, `inherit` and unset follow the token",...Object.fromEntries(j.map(e=>[e,"read by its part's `styleFrom`: the unit of that view's Size"])),buttonColor:N("Button color"),buttonTextColor:N("Button text color"),...p}}),D={textStyle:"heading-2",...n("headingMedium",56,36),weight:400,lineHeight:1.05,letterSpacing:-.03},re={textStyle:"body-1",...n("body",16),lineHeight:1.7},z=e=>({kind:"text",key:"body",props:{...B,maxWidth:520},style:{...re,paragraphSpacing:e}}),l={top:0,bottom:0,topPhone:0,bottomPhone:0},b=(e,t)=>typeof e.sectionHeightMode=="string"&&e.sectionHeightMode!=="auto"?{}:{sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:t,sectionHeightModePhone:"auto"},ae=(e,t)=>{const o=b(e,t);return Object.keys(o).length?o:{sectionHeightMode:e.sectionHeightMode,...e.sectionHeightValue===void 0?{}:{sectionHeightValue:e.sectionHeightValue},...e.sectionHeightUnit===void 0?{}:{sectionHeightUnit:e.sectionHeightUnit},sectionHeightModePhone:"auto"}},R={boxShapePhone:"landscape"},U="needs a black-and-white setting on a Box picture (the old photograph followed it, else the site's Photography); 0 live US nodes store it (CLI read, 2026-11-03)",se=(e,t)=>({[e]:t,[K(e)]:t}),de={textStyle:"heading-2",...n("headingMedium",40),weight:500,case:"none",lineHeight:1,letterSpacing:-.02},C=e=>(Array.isArray(e.stats)?e.stats:[]).filter(t=>t&&(String(t.value??"").trim()!==""||String(t.label??"").trim()!=="")),le=()=>({name:"Brand Text",boxProps:(e,t)=>({...y,..._("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...M(e,l),...b(e,100)}),box:[...m,...A(l)],parts:[{kind:"group",name:"Words",props:()=>({...i,justify:"center",gap:28,gapPhone:28,sectionBorder:a({right:1}),sectionBorderPhone:a({}),...u,sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60,sectionPaddingRight:Y}),parts:[s("eyebrow",n("label",14)),{kind:"text",key:"heading",role:"heading",props:P,style:{...D,case:"none"},mark:"accentItalic"},z(28),{kind:"group",name:"Stats",props:{...i,sectionPaddingTop:16,sectionPaddingTopPhone:16},parts:[{kind:"group",name:"Figures",props:e=>({...i,direction:"row",share:"equal",gap:24,gapPhone:24,maxWidth:520,phoneRow:Math.min(Math.max(C(e).length,1),3),...se("sectionBorder",a({top:1})),sectionPaddingTop:28,sectionPaddingTopPhone:28}),parts:[{kind:"list",key:"stats",name:"Stat",of:C,props:{...i,gap:4,gapPhone:4},parts:[{kind:"text",key:"value",props:Q,style:de},s("label",{...n("label",13),color:"labels",letterSpacing:.2})]}]}]}]},H("Picture","imageSrc",R)],drop:{...p,grayscale:U,...O}}),h=e=>{const t=e.textAlign==="center"||e.textAlign==="right"?{align:e.textAlign}:{},o=e.textAlignPhone==="left"||e.textAlignPhone==="center"||e.textAlignPhone==="right"?{alignPhone:e.textAlignPhone}:{};return{...t,...o}},he=e=>e.textAlign==="center"||e.textAlign==="right"?X[e.textAlign]:"stretch",ge=e=>Math.min(Math.max(r(e.overlay)??60,0),100),F=e=>typeof e=="string"&&e.trim()!=="",ce={...c,align:"center",alignPhone:"center",buttonFillOpacity:0,buttonBorder:{width:1},buttonPaddingTop:16,buttonPaddingRight:28,buttonPaddingBottom:16,buttonPaddingLeft:28,buttonPaddingTopPhone:12,buttonPaddingRightPhone:20,buttonPaddingBottomPhone:12,buttonPaddingLeftPhone:20},L=e=>({...H("Picture","imageSrc",(t,o)=>({...F(t.imageSrc)&&x(t.imageOverlay)>0?{darken:x(t.imageOverlay),darkenStyle:"even"}:{},placement:"center",...R,sectionBorder:a(e?{left:1}:{right:1}),...W(e?"left":"right",I(o))}),[{kind:"button",key:"imageBtnText",href:"imageBtnHref",variant:"ghost",props:ce,style:{...J(13,12),letterSpacing:.18}}]),when:t=>t.reverse===!0===e}),W=(e,t)=>{const o=Math.max(60-t,0);return{sectionPaddingLeft:e==="left"?60:o,sectionPaddingRight:e==="right"?60:o}},pe={kind:"group",name:"Words",props:(e,t)=>{const o=e.reverse===!0;return{...i,justify:"center",align:he(e),placement:ee(["left","center","right"],"left",e.textAlign),...ae(e,72),gap:24,gapPhone:24,...F(e.textBgSrc)?{darken:ge(e),darkenStyle:"even"}:{},...u,sectionPaddingTop:100,sectionPaddingBottom:100,...W(o?"right":"left",I(t)),sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60}},box:[["textBgSrc","bgImage"]],parts:[{...s("eyebrow",n("label",14)),styleFrom:h},{kind:"text",key:"title",role:"heading",props:P,style:D,styleFrom:e=>({case:e.uppercase===!0?"upper":"none",...h(e)})},{...z(24),styleFrom:h},{kind:"group",name:"Button",props:{...i,sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:e=>{const t=h(e);return{...c,...t.align?{align:t.align}:{},...t.alignPhone?{alignPhone:t.alignPhone}:{}}}}]}]},ue=()=>({name:"Image & Text Split",boxProps:(e,t)=>({...y,..._("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...M(e,l),...b(e,72)}),box:[...m,...A(l)],parts:[L(!1),pe,L(!0)],drop:{reverse:"not a value of its own: it picks the order — the Picture Box first, or after the Words",uppercase:"not a value of its own: the heading part's Case — Upper when on, None (as typed) when off",textAlign:"read by each words part (its Align) and the Words Box (its Align); left writes nothing, as the old emitted no class",textAlignPhone:"read by each words part as its phone Align",textAlignTablet:"not carried to the words part's own tablet Align (`alignTablet`) yet: no old node stores it (new with the Tablet view's Text alignment row, 0 stored on the US sites 2026-11-06), so nothing moves",overlay:"read by the Words Box: its Darken over the words picture (60 when unset); no picture, no wash",imageOverlay:"read by the Picture Box: its Darken over the image column's picture (40 when unset, none at 0); no picture, no wash",grayscale:U,...p,...O}}),He={IntroBleed:ie(),Manifesto:le(),Split:ue()};export{He as EDITORIAL_SECTION_TO_BOX};
@@ -1 +1 @@
1
- import{hasWords as n}from"../../../sections/section-to-box.js";import{DIM as L,DROP_COMMON as g,DROP_SIDE_PADDING as h,INNER_BOX as r,SAME_KEYS as P,SECTION_BOX as f,TEXT as a,smallText as O,wrapperPad as i,wrapperPadKeys as _}from"./section-to-box-row-parts.js";import{finiteNumber as x}from"../../../../../format/lib/finite-number.js";import{markBoxProps as w,token as A}from"../../../../../format/lib/document/seed-parts.js";import{LOGOS_PH as R,logosScaffoldItems as B}from"../../../../../format/lib/document/blocks/general/Logos/meta.js";import{logosCardSeed as b}from"../../../../../format/lib/document/blocks/general/Logos/card-seed.js";import{PAYMENT_PH as N,paymentScaffoldAssurances as C,paymentScaffoldBadges as I}from"../../../../../format/lib/document/blocks/general/PaymentBadges/meta.js";import{BLOCK_SOURCE_OPTIONS_PROP as s,BLOCK_SOURCE_PROP as t}from"../../../../../format/lib/content/block-sources.js";import{CARD_TEMPLATE_SLOT as k}from"../../../../../format/lib/content/card-template.js";import{BLOCK_ALIGN_BOX_WORD as M,legacyBlockAlignOf as D}from"../../../../../format/lib/content/block-align.js";import{FOOTER_PAYMENT_SEED as H}from"../../../../../format/lib/content/footer.js";import{CELL_SPAN_KEYS as K}from"../../../../../format/lib/content/grid-span.js";import{SECTION_ACCENT_INHERIT as X}from"../../../../../format/lib/content/section-surface.js";import{FOOTER_MARK_SIZES as v,FOOTER_TEXT_PX as z}from"../../../../../format/lib/document/box-footer.js";import{phoneKey as d,readHidable as F}from"efficient-easel/draw";import{parseOption as G}from"../../../../../format/lib/parse-option.js";const l={contained:!1},p=(o,e)=>({logos:[{kind:"list",key:o,name:"Logo",flat:!0,parts:[{kind:"block",type:"LogoBlock",box:["src",[e,"alt"]],when:(Z,m)=>n(m?.src)||n(m?.[e])}]}]}),c=o=>{const e=x(o.bandPadding)??40;return{top:e,bottom:e,topPhone:e,bottomPhone:e}},Y={...O("heading",{color:"labels",letterSpacing:.2}),props:{...a,align:"center"}},j={name:"Logos",boxProps:o=>({...f,direction:"column",gap:32,...i(o,c(o))}),box:[...P,..._(c),["bandPadding","sectionPaddingTop",(o,e)=>i(e,c(e)).sectionPaddingTop]],parts:[Y,{kind:"core",keep:["columns","logoHeight","grayscale"],rename:{logosPerRow:"columns"},props:l,slots:p("items","alt")}],drop:{...g,...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"}},W={kind:"group",name:"Mark",keepEmpty:!0,parts:[],props:w(4,"main",{sectionCorners:2})},E={top:24,bottom:24,topPhone:24,bottomPhone:24},U={name:"Payment Methods",boxProps:o=>({...f,direction:"column",...i(o,E)}),box:[...P,..._(E)],parts:[{kind:"group",name:"Methods",props:{...r,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:[t,s],props:o=>n(o[t])?{[t]:o[t],...o[s]!==void 0?{[s]:o[s]}:{}}:{}},props:{...l,look:"cards",grayscale:!1},slots:o=>({...p("badges","label"),...n(o[t])?{[k]:[b()]}:{}})},{kind:"group",name:"Reassurance",props:{...r,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(e=>n(e?.text)),props:{...r,direction:"row",align:"center",gap:8,gapPhone:8,phoneRow:2,[d("share")]:"content"},item:o=>F(o.text).hidden?{props:{_hidden:!0}}:{},parts:[W,{kind:"text",key:"text",props:{...a,align:"center"},style:{...A("label",13),color:"labels",lineHeight:1.5}}]}]}]}],drop:{...g,...h,contained:"the Box draws the site frame now; the Logos block inside it fills the Box's column (`contained: false`)"}},S=o=>D(o.align)??"left",T=o=>G(["sm","md"],"sm",o.size),y=12,u={name:"Payment logos",boxProps:o=>({...r,direction:"row",wrap:!0,align:"center",justify:M[S(o)],gap:y,gapPhone:y,phoneRow:2,[d("share")]:"content"}),box:[...K],parts:[{kind:"text",key:"lead",props:L,styleFrom:o=>({size:z[T(o)],lineHeight:1.5})},{kind:"core",keep:[],as:"Logos",derive:{reads:[t,s],props:o=>({logoHeight:v[T(o)].mark,align:S(o),...n(o[t])?{[t]:o[t],...o[s]!==void 0?{[s]:o[s]}:{}}:{}})},props:{...l,look:"marks",grayscale:!1,sectionAccent:X},slots:o=>({...p("methods","label"),...n(o[t])?{[k]:[b()]}:{}})}],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"}},mo={Logos:j,PaymentBadges:U,FooterPayment:u,PaymentLogosBlock:u},go=()=>({heading:R.heading,items:B()}),ho=()=>({heading:N.heading,badges:I(),assurances:C()}),Po=()=>({...H,methods:[]});export{mo as LOGOS_SECTION_TO_BOX,Po as footerPaymentPressStarter,go as logosPressStarter,ho as paymentPressStarter};
1
+ import{hasWords as n}from"../../../sections/section-to-box.js";import{DIM as L,DROP_COMMON as g,DROP_SIDE_PADDING as h,INNER_BOX as r,SAME_KEYS as P,SECTION_BOX as f,TEXT as a,smallText as O,wrapperPad as i,wrapperPadKeys as _}from"./section-to-box-row-parts.js";import{finiteNumber as x}from"../../../../../format/lib/finite-number.js";import{markBoxProps as w,token as A}from"../../../../../format/lib/document/seed-parts.js";import{LOGOS_PH as R,logosScaffoldItems as B}from"../../../../../format/lib/document/blocks/general/Logos/meta.js";import{logosCardSeed as b}from"../../../../../format/lib/document/blocks/general/Logos/card-seed.js";import{PAYMENT_PH as N,paymentScaffoldAssurances as C,paymentScaffoldBadges as I}from"../../../../../format/lib/document/blocks/general/PaymentBadges/meta.js";import{BLOCK_SOURCE_OPTIONS_PROP as s,BLOCK_SOURCE_PROP as t}from"../../../../../format/lib/content/block-sources.js";import{CARD_TEMPLATE_SLOT as k}from"../../../../../format/lib/content/card-template.js";import{BLOCK_ALIGN_BOX_WORD as M,legacyBlockAlignOf as D}from"../../../../../format/lib/content/block-align.js";import{FOOTER_PAYMENT_SEED as H}from"../../../../../format/lib/content/footer.js";import{CELL_SPAN_KEYS as K}from"../../../../../format/lib/content/grid-span.js";import{SECTION_ACCENT_INHERIT as X}from"../../../../../format/lib/content/section-surface.js";import{FOOTER_MARK_SIZES as v,FOOTER_TEXT_PX as z}from"../../../../../format/lib/document/box-footer.js";import{phoneKey as d,readHidable as F}from"efficient-easel/draw";import{parseOption as G}from"efficient-shell/format";const l={contained:!1},p=(o,e)=>({logos:[{kind:"list",key:o,name:"Logo",flat:!0,parts:[{kind:"block",type:"LogoBlock",box:["src",[e,"alt"]],when:(Z,m)=>n(m?.src)||n(m?.[e])}]}]}),c=o=>{const e=x(o.bandPadding)??40;return{top:e,bottom:e,topPhone:e,bottomPhone:e}},Y={...O("heading",{color:"labels",letterSpacing:.2}),props:{...a,align:"center"}},j={name:"Logos",boxProps:o=>({...f,direction:"column",gap:32,...i(o,c(o))}),box:[...P,..._(c),["bandPadding","sectionPaddingTop",(o,e)=>i(e,c(e)).sectionPaddingTop]],parts:[Y,{kind:"core",keep:["columns","logoHeight","grayscale"],rename:{logosPerRow:"columns"},props:l,slots:p("items","alt")}],drop:{...g,...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"}},W={kind:"group",name:"Mark",keepEmpty:!0,parts:[],props:w(4,"main",{sectionCorners:2})},E={top:24,bottom:24,topPhone:24,bottomPhone:24},U={name:"Payment Methods",boxProps:o=>({...f,direction:"column",...i(o,E)}),box:[...P,..._(E)],parts:[{kind:"group",name:"Methods",props:{...r,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:[t,s],props:o=>n(o[t])?{[t]:o[t],...o[s]!==void 0?{[s]:o[s]}:{}}:{}},props:{...l,look:"cards",grayscale:!1},slots:o=>({...p("badges","label"),...n(o[t])?{[k]:[b()]}:{}})},{kind:"group",name:"Reassurance",props:{...r,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(e=>n(e?.text)),props:{...r,direction:"row",align:"center",gap:8,gapPhone:8,phoneRow:2,[d("share")]:"content"},item:o=>F(o.text).hidden?{props:{_hidden:!0}}:{},parts:[W,{kind:"text",key:"text",props:{...a,align:"center"},style:{...A("label",13),color:"labels",lineHeight:1.5}}]}]}]}],drop:{...g,...h,contained:"the Box draws the site frame now; the Logos block inside it fills the Box's column (`contained: false`)"}},S=o=>D(o.align)??"left",T=o=>G(["sm","md"],"sm",o.size),y=12,u={name:"Payment logos",boxProps:o=>({...r,direction:"row",wrap:!0,align:"center",justify:M[S(o)],gap:y,gapPhone:y,phoneRow:2,[d("share")]:"content"}),box:[...K],parts:[{kind:"text",key:"lead",props:L,styleFrom:o=>({size:z[T(o)],lineHeight:1.5})},{kind:"core",keep:[],as:"Logos",derive:{reads:[t,s],props:o=>({logoHeight:v[T(o)].mark,align:S(o),...n(o[t])?{[t]:o[t],...o[s]!==void 0?{[s]:o[s]}:{}}:{}})},props:{...l,look:"marks",grayscale:!1,sectionAccent:X},slots:o=>({...p("methods","label"),...n(o[t])?{[k]:[b()]}:{}})}],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"}},mo={Logos:j,PaymentBadges:U,FooterPayment:u,PaymentLogosBlock:u},go=()=>({heading:R.heading,items:B()}),ho=()=>({heading:N.heading,badges:I(),assurances:C()}),Po=()=>({...H,methods:[]});export{mo as LOGOS_SECTION_TO_BOX,Po as footerPaymentPressStarter,go as logosPressStarter,ho as paymentPressStarter};
@@ -1 +1 @@
1
- import{hasWords as l}from"../../../sections/section-to-box.js";import{BLOCK_WIDTH_LIMIT as N}from"efficient-easel/draw";import{fluidToken as R,token as o}from"./section-head-looks.js";import{STRIP_BOX as C}from"../../../../../format/lib/sections/strip-shape.js";import{PH as i,phAccentAsMarks as W}from"../../../../../format/lib/document/blocks/placeholders.js";import{DOC_MASTHEAD_PH as d}from"../../../../../format/lib/document/blocks/general/DocMasthead/meta.js";import{PAGE_TITLE_LEVEL_PROP as U,pageTitleDemoted as f}from"../../../../../format/lib/document/one-h1.js";import{AUTO_COLUMN as s,BUTTON as v,DIM as G,DROP_COMMON as c,DROP_SIDE_PADDING as g,INNER_BOX as n,leadLine as _,RIGHT_WORDS as S,SAME_KEYS as h,SECTION_BOX as m,SH_LINK as X,smallText as r,TEXT as a,wrapperPad as b,wrapperPadKeys as u}from"./section-to-box-row-parts.js";const T={minWidth:N.min},E=(e,t,p)=>({...r(e,{...t,...S}),props:{...a,align:"right",...s,...p}}),w={top:1,bottom:0},k=(e,t,p,M)=>({kind:"group",name:e,props:{...n,sectionPaddingBottom:t,sectionPaddingBottomPhone:p},parts:[M]}),I={widthFit:"fill",...T},O={top:100,bottom:60,topPhone:60,bottomPhone:40},K={...o("label",13),letterSpacing:.22,lineHeight:1.8},x={textStyle:"heading-1",...R("headingLarge",56,8,128),case:"upper",weight:500,lineHeight:.88,letterSpacing:-.04},j=()=>({name:"Page Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,O)}),box:[...h,...u(O)],parts:[{kind:"group",name:"Header",props:{...n,direction:"row",align:"end",justify:"between",gap:40,gapPhone:16,share:"content",sectionPaddingBottom:32},parts:[k("Eyebrow",12,0,{...r("eyebrow",o("label",13)),props:{...a,...s}}),{kind:"text",key:"title",role:"heading",props:{...a,tag:"h1",...I},style:x,mark:"accentItalic",when:e=>!f(e)},{kind:"text",key:"title",role:"heading",props:{...a,tag:"h2",...I},style:x,mark:"accentItalic",when:f},{kind:"group",name:"Details",props:{...n,align:"stretch",gap:0,gapPhone:0,sectionPaddingBottom:12,sectionPaddingBottomPhone:0},parts:[{kind:"list",key:"meta",name:"Detail",flat:!0,parts:[_("label","value",K,s)]}]}]},{kind:"group",name:"Deck",props:{...n,maxWidth:760,sectionBorder:w,sectionPaddingTop:28},parts:[{kind:"text",key:"deck",props:G,style:{textStyle:"body-1",fontRole:"accent",...o("body",22,19),italic:!0,lineHeight:1.5}}]}],drop:{...c,...g,[U]:"read by the title part's `when`: 2 (set by lib/document/one-h1 on a later opener) makes the Text an h2, anything else an h1"}}),ne=()=>({eyebrow:d.eyebrow,title:W(d.title),deck:d.deck,meta:[{label:i.label,value:i.value},{label:i.label,value:i.value}]}),B={top:80,bottom:40,topPhone:60,bottomPhone:32},V={...o("label",13),letterSpacing:.18,lineHeight:1.8},H={...o("label",13),letterSpacing:.22,lineHeight:1.9},Y=()=>({name:"Issue Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,B)}),box:[...h,...u(B)],parts:[{kind:"group",name:"Top",props:{...n,direction:"row",align:"end",justify:"between",gap:60,gapPhone:16,share:"content",sectionPaddingBottom:32},parts:[k("Eyebrow",14,14,r("eyebrow",o("label",14))),{kind:"group",name:"Issue",props:{...n,align:"end",gap:0,gapPhone:0,sectionPaddingBottom:14},parts:[{kind:"list",key:"issueMeta",name:"Issue line",flat:!0,parts:[_("lead","rest",V)]}]}]},{kind:"group",name:"Bottom",props:{...n,direction:"row",align:"start",justify:"between",gap:60,gapPhone:16,share:"content",sectionBorder:w,sectionPaddingTop:32},parts:[{kind:"text",key:"lead",props:{...a,maxWidth:720,...T},style:{textStyle:"body-1",fontRole:"heading3",...o("headingSmall",20),lineHeight:1.5,letterSpacing:-.005,paragraphSpacing:16}},{kind:"group",name:"In this issue",props:{...n,align:"stretch",gap:0},parts:[k("Heading",6,6,{kind:"text",key:"issueHeading",props:{...a,align:"right",...s},style:{textStyle:"body-1",fontRole:"heading",...o("body",18),weight:400,letterSpacing:-.01,lineHeight:1.9,...S}}),{kind:"group",name:"Lines",props:{...n,align:"stretch",gap:0},parts:[{kind:"list",key:"issueList",name:"Line",flat:!0,parts:[E("text",{color:"labels",...H})]}]},E("issueTotal",H)]}]}],drop:{...c,...g}}),D={top:24,bottom:24,topPhone:16,bottomPhone:16},y={color:"labels",...o("label",13),letterSpacing:.2},L=e=>(Array.isArray(e.items)?e.items:[]).filter(t=>t&&typeof t.label=="string"&&t.label.trim()!==""),P=(e,t)=>t!==void 0&&L(e).at(-1)===t,A=(e,t)=>t!==void 0&&L(e).includes(t),F=(e,t)=>A(e,t)&&!P(e,t)&&l(t?.href),q=()=>({name:"Breadcrumb",skip:e=>l(e.meta)?'a trailing note after "·" needs a second mark; none live':void 0,boxProps:e=>({...m,...C,wrap:"wrap",gap:16,gapPhone:16,separator:"slash",sectionBorder:{bottom:1},...b(e,D)}),box:[...h,...u(D)],parts:[{kind:"list",key:"items",name:"Crumb",flat:!0,parts:[{kind:"button",key:"label",href:"href",variant:"ghost",when:F,props:{...v,...X,icon:"none"},style:y},{...r("label",y),when:(e,t)=>A(e,t)&&!P(e,t)&&!l(t?.href)},{...r("label",{...y,color:"text"}),when:P}]}],drop:{...c,...g,meta:"a node that stores a note is skipped (`skip`); an empty one draws nothing"}}),ae={DocMasthead:j(),Masthead:Y(),Breadcrumb:q()};export{ae as PAGE_HEADER_SECTION_TO_BOX,ne as pageHeaderPressStarter};
1
+ 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 P}from"efficient-shell/format";import{resolveSectionAccent as r,SECTION_ACCENT_INHERIT as x}from"../../../../../format/lib/content/section-surface.js";import{parseLoopDirection as E}from"../../../../../format/lib/animation/index.js";import{parseTickerSeparator as i,SEPARATOR_GLYPH as A}from"../../../../../format/lib/sections/ticker-style.js";import{tickerJoinSide as y}from"../../../../../format/lib/sections/ticker-join.js";import{convertTheme as h}from"../../../sections/section-to-box.js";import{darkBandIndex as C}from"../../../../../format/lib/theme.js";import{DIM as s,DROP_COMMON as a,DROP_SIDE_PADDING as l,fillFrom as R,SAME_KEYS as c,sectionPage as b,SECTION_BOX as p,TEXT as B,wrapperPad as d,wrapperPadKeys as m}from"./section-to-box-row-parts.js";import{SPEC_PAD as S,SPEC_STRIP as O,SPEC_TEXT as T,STRIP_BOX as _,TICKER_BARE_GAP as g,TICKER_DISPLAY as N,TICKER_PAD as f,TICKER_SMALL as K,TICKER_STRIP as M}from"../../../../../format/lib/sections/strip-shape.js";const I=e=>e.size==="display",w=(e,t)=>{const o=b(e,t),n=e.tone!=="plain"&&o?.text&&o.background?P(o.text,o.background,.3):null;return n?{color:n}:{}},L=(e,t)=>e.tone!=="plain"&&r(e.sectionAccent)===null?R("background")(e,t):{},k=(e,t)=>({kind:"list",key:"items",name:"Item",flat:!0,when:t,parts:[{kind:"text",key:"text",props:s,style:e,styleFrom:w}]}),X={name:"Scrolling Bar",boxProps:(e,t)=>({...p,..._,...M,...A[i(e.separator)]===""?g:{},...d(e,f),...L(e,t)}),box:[["scrollDirection","scrollDirection",e=>E(e)],["speed","loopDuration",(e,t)=>t.loopDuration!=null?t.loopDuration:e],["loopDuration","loopDuration",(e,t)=>e??t.speed],["loopDelay","loopDelay",e=>e],["separator","separator",e=>i(e)],["join","join",e=>y(e)??void 0],["borders","sectionBorder",e=>e===!1?void 0:{top:1,bottom:1}],...c,["tone","sectionAccent",(e,t)=>r(t.sectionAccent)??x],...m(f)],parts:[k(K,e=>!I(e)),k(N,I)],drop:{...a,...l,size:"each item's Text style: Small → Body 5, Display → Heading 3"}},D=e=>e?.tone==="muted",u=e=>C(h(e)),H={name:"Spec Strip",boxProps:(e,t)=>({...p,..._,...O,...e.fill==="none"?{sectionBorder:{top:1}}:{sectionAccent:u(t)},...d(e,S)}),box:[...c.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,o)=>t.fill==="none"?e:u(o)],...m(S)],parts:[{kind:"list",key:"cells",name:"Cell",flat:!0,parts:[{kind:"text",key:"text",props:B,style:T,when:(e,t)=>!D(t)},{kind:"text",key:"text",props:s,style:T,when:(e,t)=>D(t)}]}],drop:{...a,...l,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"}},U={Ticker:X,SpecStrip:H};export{U as STRIP_SECTION_TO_BOX};
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};
@@ -9,3 +9,7 @@ export declare function splitCustomHtml(html: string, id?: string): {
9
9
  markup: string;
10
10
  ids: ReadonlySet<string>;
11
11
  };
12
+ export declare function customHtmlDrawn(html: string, id: string): {
13
+ scoped: boolean;
14
+ inner: string;
15
+ };
@@ -1,2 +1,3 @@
1
- import O from"isomorphic-dompurify";import g from"postcss";import E from"postcss-selector-parser";import{sanitizeHtml as _,sectionIds as h}from"./sanitize.js";import{styleElementText as T}from"../../../format/lib/document/style-text.js";const v="data-sf-custom-html",w=/^[A-Za-z][\w-]*$/;function S(r){return w.test(r)?`${r}-`:""}function $(r,s=v){return`[${s}="${r}"]`}const d=new Set(["media","supports","container"]),A=new Set(["behavior","-moz-binding"]),x=/expression\s*\(|javascript:|vbscript:/i,N=/^[a-z][a-z0-9+.-]*:/i,R=new Set(["none","initial","inherit","unset","revert","revert-layer","default","auto","normal","ease","ease-in","ease-out","ease-in-out","linear","step-start","step-end","infinite","reverse","alternate","alternate-reverse","forwards","backwards","both","running","paused"]);function L(r){return r.replace(/\\([0-9a-f]{1,6})\s?|\\(.)/gi,(s,n,o)=>n?String.fromCodePoint(Math.min(+`0x${n}`,1114111)||65533):o??"")}function y(r){const s=r.trim();return s.startsWith("//")?!0:N.test(s)&&!/^https:\/\//i.test(s)}const C=/\/\*[\s\S]*?(?:\*\/|$)/g;function P(r,s){const n=L(s.replace(C,"")).replace(C,"");if(x.test(n))return!1;for(const o of n.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/gi))if(y(o[2]))return!1;if(r.startsWith("--")||/(?:image-set|image|src)\(/i.test(n)){for(const o of n.matchAll(/(['"])(.*?)\1/g))if(y(o[2]))return!1}return!0}function D(r){const s=r.find(n=>n.type==="combinator");return s?s.value.trim()||" ":null}function z(r,s,n="",o=new Set){let i;try{i=E().astSync(r)}catch{return null}const c=[];for(const a of i.nodes){const f=a.nodes;if(f.length===0)return null;let p=!1;if(a.walkNesting(()=>{p=!0}),p)continue;n&&a.walkIds(u=>{o.has(u.value)&&(u.value=n+u.value)});const t=f[0],e=t.type==="tag"&&/^(html|body)$/i.test(t.value)||t.type==="pseudo"&&t.value.toLowerCase()===":root",l=t.type==="universal",m=D(f.slice(1));if((e||l)&&(m==="~"||m==="+"))l&&c.push(`${s} ${String(a).trim()}`);else if(e||l){const u=f.slice(1).map(String).join("").trimEnd();c.push(u?s+u:l?`${s} *`:s)}else{if(t.type==="combinator"&&/^[~+]$/.test(t.value.trim()))continue;c.push(`${s} ${String(a).trim()}`)}}return c.length?c.join(", "):null}function G(r,s,n=v,o=new Set){if(!w.test(s))return"";let i;try{i=g.parse(r)}catch{return""}const c=$(s,n),a=new Map;i.walkComments(t=>{t.remove()});const f=t=>{for(const e of[...t.nodes??[]])e.type==="atrule"?d.has(e.name.toLowerCase())&&e.nodes?f(e):e.remove():e.type==="rule"&&e.remove()},p=t=>{for(const e of[...t.nodes??[]])if(e.type==="atrule"){const l=e.name.toLowerCase();if(/^(-[a-z]+-)?keyframes$/.test(l)){const m=e.params.trim();if(!/^[A-Za-z_][\w-]*$/.test(m)||R.has(m.toLowerCase()))e.remove();else{const u=`${m}-${s}`;a.set(m,u),e.params=u}}else d.has(l)&&e.nodes?p(e):e.remove()}else if(e.type==="rule"){const l=z(e.selector,c,n===v?S(s):"",o);l===null?e.remove():(e.selector=l,f(e))}else e.type==="decl"&&e.remove()};return p(i),i.walkDecls(t=>{if(A.has(t.prop.toLowerCase())||!P(t.prop,t.raws.value?.raw??t.value)){t.remove();return}a.size>0&&/^(-[a-z]+-)?animation(-name)?$/i.test(t.prop)&&(t.value=t.value.replace(/(?<![\w-])[A-Za-z_][\w-]*(?![\w(-])/g,e=>a.get(e)??e))}),i.walkAtRules(t=>{t.nodes&&t.nodes.length===0&&t.remove()}),T(i.toString()).trim()}const M={ALLOWED_TAGS:["style","#text"],ALLOWED_ATTR:[],KEEP_CONTENT:!1,FORBID_CONTENTS:[],FORCE_BODY:!0,RETURN_DOM_FRAGMENT:!0};function W(r,s=""){const n=_(r,{idPrefix:S(s)});if(!/<style/i.test(r))return{css:"",markup:n,ids:new Set};const o=h(r),i=O.sanitize(r,M).querySelectorAll("style");return{css:Array.from(i,a=>a.textContent??"").join(`
2
- `),markup:n,ids:o}}export{v as CUSTOM_HTML_SCOPE_ATTR,S as customHtmlIdPrefix,$ as customHtmlScope,G as scopeCustomCss,W as splitCustomHtml};
1
+ import g from"isomorphic-dompurify";import E from"postcss";import _ from"postcss-selector-parser";import{sanitizeHtml as h,sectionIds as $}from"./sanitize.js";import{faceClassBaseCss as T}from"../../../format/lib/text-style-face.js";import{styleElementText as A}from"../../../format/lib/document/style-text.js";const w="data-sf-custom-html",v=/^[A-Za-z][\w-]*$/;function d(n){return v.test(n)?`${n}-`:""}function S(n,e=w){return`[${e}="${n}"]`}const y=new Set(["media","supports","container"]),x=new Set(["behavior","-moz-binding"]),N=/expression\s*\(|javascript:|vbscript:/i,R=/^[a-z][a-z0-9+.-]*:/i,D=new Set(["none","initial","inherit","unset","revert","revert-layer","default","auto","normal","ease","ease-in","ease-out","ease-in-out","linear","step-start","step-end","infinite","reverse","alternate","alternate-reverse","forwards","backwards","both","running","paused"]);function L(n){return n.replace(/\\([0-9a-f]{1,6})\s?|\\(.)/gi,(e,r,o)=>r?String.fromCodePoint(Math.min(+`0x${r}`,1114111)||65533):o??"")}function C(n){const e=n.trim();return e.startsWith("//")?!0:R.test(e)&&!/^https:\/\//i.test(e)}const O=/\/\*[\s\S]*?(?:\*\/|$)/g;function P(n,e){const r=L(e.replace(O,"")).replace(O,"");if(N.test(r))return!1;for(const o of r.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/gi))if(C(o[2]))return!1;if(n.startsWith("--")||/(?:image-set|image|src)\(/i.test(r)){for(const o of r.matchAll(/(['"])(.*?)\1/g))if(C(o[2]))return!1}return!0}function b(n){const e=n.find(r=>r.type==="combinator");return e?e.value.trim()||" ":null}function k(n,e,r="",o=new Set){let a;try{a=_().astSync(n)}catch{return null}const l=[];for(const i of a.nodes){const u=i.nodes;if(u.length===0)return null;let p=!1;if(i.walkNesting(()=>{p=!0}),p)continue;r&&i.walkIds(f=>{o.has(f.value)&&(f.value=r+f.value)});const s=u[0],t=s.type==="tag"&&/^(html|body)$/i.test(s.value)||s.type==="pseudo"&&s.value.toLowerCase()===":root",c=s.type==="universal",m=b(u.slice(1));if((t||c)&&(m==="~"||m==="+"))c&&l.push(`${e} ${String(i).trim()}`);else if(t||c){const f=u.slice(1).map(String).join("").trimEnd();l.push(f?e+f:c?`${e} *`:e)}else{if(s.type==="combinator"&&/^[~+]$/.test(s.value.trim()))continue;l.push(`${e} ${String(i).trim()}`)}}return l.length?l.join(", "):null}function z(n,e,r=w,o=new Set){if(!v.test(e))return"";let a;try{a=E.parse(n)}catch{return""}const l=S(e,r),i=new Map;a.walkComments(s=>{s.remove()});const u=s=>{for(const t of[...s.nodes??[]])t.type==="atrule"?y.has(t.name.toLowerCase())&&t.nodes?u(t):t.remove():t.type==="rule"&&t.remove()},p=s=>{for(const t of[...s.nodes??[]])if(t.type==="atrule"){const c=t.name.toLowerCase();if(/^(-[a-z]+-)?keyframes$/.test(c)){const m=t.params.trim();if(!/^[A-Za-z_][\w-]*$/.test(m)||D.has(m.toLowerCase()))t.remove();else{const f=`${m}-${e}`;i.set(m,f),t.params=f}}else y.has(c)&&t.nodes?p(t):t.remove()}else if(t.type==="rule"){const c=k(t.selector,l,r===w?d(e):"",o);c===null?t.remove():(t.selector=c,u(t))}else t.type==="decl"&&t.remove()};return p(a),a.walkDecls(s=>{if(x.has(s.prop.toLowerCase())||!P(s.prop,s.raws.value?.raw??s.value)){s.remove();return}i.size>0&&/^(-[a-z]+-)?animation(-name)?$/i.test(s.prop)&&(s.value=s.value.replace(/(?<![\w-])[A-Za-z_][\w-]*(?![\w(-])/g,t=>i.get(t)??t))}),a.walkAtRules(s=>{s.nodes&&s.nodes.length===0&&s.remove()}),A(a.toString()).trim()}const M={ALLOWED_TAGS:["style","#text"],ALLOWED_ATTR:[],KEEP_CONTENT:!1,FORBID_CONTENTS:[],FORCE_BODY:!0,RETURN_DOM_FRAGMENT:!0};function I(n,e=""){const r=h(n,{idPrefix:d(e)});if(!/<style/i.test(n))return{css:"",markup:r,ids:new Set};const o=$(n),a=g.sanitize(n,M).querySelectorAll("style");return{css:Array.from(a,i=>i.textContent??"").join(`
2
+ `),markup:r,ids:o}}function U(n,e){const{css:r,markup:o,ids:a}=I(n,e),l=r?z(r,e,void 0,a):"",u=[v.test(e)?T(S(e),o):"",l].filter(Boolean).join(`
3
+ `);return u?{scoped:!0,inner:`<style>${u}</style>${o}`}:{scoped:!1,inner:o}}export{w as CUSTOM_HTML_SCOPE_ATTR,U as customHtmlDrawn,d as customHtmlIdPrefix,S as customHtmlScope,z as scopeCustomCss,I as splitCustomHtml};
@@ -1 +1 @@
1
- import{HEADER_TYPE as o,FOOTER_TYPE as a}from"efficient-easel/draw";import{parseOption as E}from"../../../format/lib/parse-option.js";const s=new Set(["Hero","HeroSingle","IntroBleed"]),n={min:56,max:140,default:88},d={min:0,max:120,step:2,default:32},l=`var(--sf-header-h, ${n.default}px)`,_="--sf-header-set-h",T="--sf-header-h",R=`var(${_}, ${n.default}px)`,D="sf-header-clearance",P="sf-sticky-underheader";function c(e){return e?.find(t=>t?.type&&t.type!==o)??null}function p(e){const t=c(e)?.type;return!t||!s.has(t)}function h(e){return!p(e)}function C(e){return!!e?.some(t=>t?.type===o)}function m(e){return!e||e.length===0?!1:!e.some(t=>t?.type===o||t?.type===a)}const u=["auto","shared","own"],S="auto",f="topSpace",O="data-top-space";function i(e){return E(u,S,e)}function x(e,t){const r=i(e?.props?.[f]);return r==="own"?!0:r==="shared"?!1:p(t)}function L(e,t){return x(e,t)?"own":null}export{S as DEFAULT_TOP_SPACE,s as FULLBLEED_LEAD_SECTIONS,D as HEADER_CLEARANCE_CLASS,T as HEADER_DRAWN_HEIGHT_VAR,l as HEADER_HEIGHT_CSS,n as HEADER_HEIGHT_PX,d as HEADER_MENU_GAP_PX,R as HEADER_SET_HEIGHT_CSS,_ as HEADER_SET_HEIGHT_VAR,P as STICKY_UNDERHEADER_CLASS,O as TOP_SPACE_ATTR,u as TOP_SPACE_MODES,f as TOP_SPACE_PROP,m as isStandaloneSectionDocument,c as leadSection,p as pageClearsHeader,C as pageHasHeaderSection,h as pageLeadsWithFullBleed,x as pageTakesTopSpace,i as resolveTopSpace,L as topSpaceMarker};
1
+ import{HEADER_TYPE as o,FOOTER_TYPE as a}from"efficient-easel/draw";import{parseOption as E}from"efficient-shell/format";const s=new Set(["Hero","HeroSingle","IntroBleed"]),n={min:56,max:140,default:88},d={min:0,max:120,step:2,default:32},l=`var(--sf-header-h, ${n.default}px)`,_="--sf-header-set-h",T="--sf-header-h",R=`var(${_}, ${n.default}px)`,D="sf-header-clearance",P="sf-sticky-underheader";function c(e){return e?.find(t=>t?.type&&t.type!==o)??null}function p(e){const t=c(e)?.type;return!t||!s.has(t)}function h(e){return!p(e)}function C(e){return!!e?.some(t=>t?.type===o)}function m(e){return!e||e.length===0?!1:!e.some(t=>t?.type===o||t?.type===a)}const u=["auto","shared","own"],S="auto",f="topSpace",O="data-top-space";function i(e){return E(u,S,e)}function x(e,t){const r=i(e?.props?.[f]);return r==="own"?!0:r==="shared"?!1:p(t)}function L(e,t){return x(e,t)?"own":null}export{S as DEFAULT_TOP_SPACE,s as FULLBLEED_LEAD_SECTIONS,D as HEADER_CLEARANCE_CLASS,T as HEADER_DRAWN_HEIGHT_VAR,l as HEADER_HEIGHT_CSS,n as HEADER_HEIGHT_PX,d as HEADER_MENU_GAP_PX,R as HEADER_SET_HEIGHT_CSS,_ as HEADER_SET_HEIGHT_VAR,P as STICKY_UNDERHEADER_CLASS,O as TOP_SPACE_ATTR,u as TOP_SPACE_MODES,f as TOP_SPACE_PROP,m as isStandaloneSectionDocument,c as leadSection,p as pageClearsHeader,C as pageHasHeaderSection,h as pageLeadsWithFullBleed,x as pageTakesTopSpace,i as resolveTopSpace,L as topSpaceMarker};
@@ -1 +1 @@
1
- import{parseIntroBleedLayout as r}from"../../../format/lib/sections/intro-bleed-layout.js";import{leadSection as n,pageLeadsWithFullBleed as a}from"./header-clearance.js";import{parseOption as l}from"../../../format/lib/parse-option.js";const _="data-lead-ink",f="data-header-ink",u=["auto","light","dark"],d="auto";function i(e){return e.type==="IntroBleed"?r(e.props?.layout)!=="stacked":!0}function p(e){const t=n(e);return t&&a(e)&&i(t)?"light":null}function s(e){return l(u,d,e)}function k(e,t){const o=s(e);return o==="auto"?p(t):o}export{d as DEFAULT_HEADER_INK,_ as HEADER_INK_ATTR,u as HEADER_INK_MODES,f as HEADER_INK_OVERRIDE_ATTR,p as leadSectionInk,k as resolveHeaderInk,s as resolveHeaderInkMode};
1
+ import{parseIntroBleedLayout as r}from"../../../format/lib/sections/intro-bleed-layout.js";import{leadSection as n,pageLeadsWithFullBleed as a}from"./header-clearance.js";import{parseOption as l}from"efficient-shell/format";const _="data-lead-ink",f="data-header-ink",u=["auto","light","dark"],d="auto";function i(e){return e.type==="IntroBleed"?r(e.props?.layout)!=="stacked":!0}function p(e){const t=n(e);return t&&a(e)&&i(t)?"light":null}function s(e){return l(u,d,e)}function k(e,t){const o=s(e);return o==="auto"?p(t):o}export{d as DEFAULT_HEADER_INK,_ as HEADER_INK_ATTR,u as HEADER_INK_MODES,f as HEADER_INK_OVERRIDE_ATTR,p as leadSectionInk,k as resolveHeaderInk,s as resolveHeaderInkMode};
@@ -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 Re(t,e){const n=`var(${T})`,o=":is([data-sf-bullet], [data-sf-number])";return[`${t} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${t} ${o}:not(:first-child) { margin-top: ${n} }`,`${t} ${o}:not(:last-child) { margin-bottom: ${n} }`,`:is(${e}) + :is(${e}) { margin-top: ${n} }`]}const Ee=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);function an(t,e){if(!t)return null;const n=F(e),o=t.rules.get(n);if(o)return o;if(n.length<we||t.drawn.has(n))return null;let i=null;for(const[r,c]of t.rules)if(r.includes(n)){if(i&&i.stamp!==c.stamp)return null;i=c}return i}const we=8;export{R as PART_ALIGNS,Ct as PART_LETTER_EM_MAX,jt as PART_LETTER_EM_MIN,Lt as PART_LETTER_STEP,Ut as PART_LINE_HEIGHT_MAX,Ht as PART_LINE_HEIGHT_MIN,Mt as PART_LINE_STEP,J as PART_MEASURED_TRACKS,kt as PART_NUDGE_MAX,$t as PART_NUDGE_MIN,Ft as PART_PADDING_MAX,It as PART_PADDING_MIN,yt as PART_PADDING_STEP,st as PART_PARAGRAPH_ATTR,Kt as PART_PARAGRAPH_MAX,vt as PART_PARAGRAPH_MIN,T as PART_PARAGRAPH_VAR,Dt as PART_RELATIVE_PROPS,H as PART_SIZE_MAX,D as PART_SIZE_MIN,Wt as PART_SIZE_STEPS,Et as PART_STYLED_ATTR,L as PART_STYLES_PROP,Pe as PART_STYLE_PROPERTIES,m as PART_UNIT_KEY_OF,Ot as PART_WEIGHTS,G as SHARED_PART_PROPERTIES,q as STYLE_ID_OF_ROLE,Z as TEXT_STYLE_ATTR,Je as applyPartStyles,Ge as blockDrawsTextStyle,Ue as followedStyleOf,ze as isPartKindKey,b as isTextStyleId,Re as paragraphRules,Be as partAlignFollowed,v as partCanvasDeclarations,Qt as partCaseOfTransform,te as partCaseTransform,Ze as partFontKeyOf,je as partLiftRules,ae as partPhoneDeclarations,on as partRuleForKind,an as partRuleForText,Ye as partShownDeclarations,ce as partSizeBoxOf,Xe as partSizeFollowed,ie as partSpacingOf,Ve as partStyleBase,ve as partStyleCount,rn as partStyleCss,K as partStyleDeclarations,fe as partStyleForScreen,qe as partStyleSource,it as partStyleWithoutSizeBox,se as partTabletDeclarations,Ke as propsWithPartStyleValue,We as propsWithoutPartStyle,nn as publishedPartStyles,Q as readPartStyle,Ce as readPartStyles,me as regionCanvasDeclarations,en as regionCanvasRestore,Qe as regionHasOwnLook,be as regionSheetStyle,tn as regionShownDeclarations,ge as storedPartStyle,Ae as viewMediaOf};
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 f}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 T,HOST_PART_TYPE as b,rowPartByKey as p}from"../../../../format/lib/content/card-template.js";import{BOX_TYPE as u}from"../../../../format/lib/document/container-blocks.js";const Y={name:"clickableParts",applies:(o,e,c)=>typeof c?.render=="function"&&o!==T&&o!==b,draw(o,e,c){const s=o,P=()=>s.textParts??s.fields,l=s.render,d=c.inspector?.PartAnchors,m=(t,r)=>x(P(),r,n=>p(e,t,n));s.render=t=>{const r=y(t),n=_(t);return t.editor?.isEditing&&d?i(f,{type:e,props:t,children:a=>i(d,{needles:m(t,a),styles:r,motions:n,type:e,children:l(t)})}):!Object.keys(r).length&&!Object.keys(n).length?l(t):i(f,{type:e,props:t,children:a=>i(h,{needles:m(t,a),styles:r,motions:n,type:e,atEdge:e===u,children:l(t)})})}}};export{Y as clickableParts};
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,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 A}from"react/jsx-runtime";import{HideTaker as D}from"../../../components/ViewHideRoot.js";import{LineChoice as E}from"../../../components/InBoxContext.js";import{isBackgroundBox as T}from"../../../../format/lib/content/box-background.js";import{boxSideSpaceOf as w}from"../../../../format/lib/content/box-side-space.js";import{BAND_PAD_KEYS as g,BAND_PAD_UNIT_KEY as O,BLOCK_PAD_FRAME as u,PAD_TOTAL_KEY as c,SECTION_PAD_KEYS as p,padTotalKeys as x,padValuesOf as N,sectionPadAttrs as I}from"../../content/section-padding.js";import{readPartStyle as C}from"../part-styles.js";import{say as F}from"../../../../format/lib/editor-words.js";import{sectionFillPassClass as b}from"../../../../format/lib/content/section-min-height.js";import{COPIES_IN_THE_BOX as L,drawsCopiesInTheBox as R}from"../../../../format/lib/content/copies-in-box.js";import{ownEntry as P}from"../../../../format/lib/own-entry.js";const m={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}},tt=new Set(Object.keys(m));function _(t,e){return e?.innerPadding??P(m,t)}const et=t=>_(t)??{},nt=t=>P({DetailRows:{top:100,bottom:100}},t),h=new Set(["Flex","Text","Heading","ImageBlock","ButtonBlock"]),y=new Set(["Divider"]),K=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),B=new Set(["ProductGrid"]);function S(t,e,n=!1){const s=t.render;t.render=o=>{if(e?.(o))return s(o);const i=I({...N(o,p,n),sideSpace:w(o.sideSpace)}),d=s(o);if(!i)return d;const a=f=>A(D,{className:f?`${i.className} ${f}`:i.className,style:i.style,children:d}),r=b(o,{atSectionLine:!0}),l=b(o);return r===l?a(r):A(E,{line:"by-box",draw:f=>a(f?l:r)})}}const ot={name:"sectionPadding",applies:(t,e,n)=>e.isSection(t)&&!K.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const s=_(e,t);if(s){t.fields={...t.fields,...n.sidesPaddingFields({keys:g,unitKey:O,fallback:s,tablet:!0,siteSide:!0})};return}if(B.has(e))return;const o=[g.top,g.bottom].filter(i=>t.fields!=null&&i in t.fields);if(o.length)throw new Error(`section-padding: ${e} declares its own ${o.join(" / ")} row; declare \`innerPadding: { top, bottom }\` in its meta and the one Padding row draws on its band`);t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(t,e){if(!_(e,t)){if(B.has(e)){S(t);return}h.has(e)||y.has(e)||S(t,e==="Flex"?n=>T(n.bgImage):L.has(e)?n=>R(e,n):void 0,!0)}}},H=["Heading","Text","ImageBlock","ButtonBlock"],W=["LogoBlock"],v={Text:t=>C(t,"text").textStyle?.startsWith("heading-")?u.heading:u.text,Heading:()=>u.heading,ButtonBlock:()=>u.text},Y={ButtonBlock:"Outer padding"};function j(t,e){const n=t[c],s=Array.isArray(n)?n.filter(r=>typeof r=="string"):[],o=x().filter(r=>e?.[r]);if(!o.length)return t;const i=[...s.filter(r=>!o.includes(r)),...o.filter(r=>typeof t[r]=="number")];if(i.length===s.length&&i.every((r,l)=>r===s[l]))return t;const{[c]:d,...a}=t;return i.length?{...a,[c]:i}:a}function k(t,e){if(e<=0)return null;const n=Array.isArray(t[c])?t[c]:[];return x().some(o=>typeof t[o]=="number"&&!n.includes(o))?F("plus {n} px (older setting)",{n:e}):null}const rt={name:"blockPadding",applies:(t,e,n)=>(H.includes(t)||W.includes(t))&&!!n&&typeof n.render=="function",panel(t,e,n){const s=P(v,e);if(!s){t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})};return}t.fields={...t.fields,...n.ownPaddingFields?.(s,k,P(Y,e))??n.sidesPaddingFields({tablet:!0,siteSide:!0})};const o=t.resolveData;t.resolveData=(i,d)=>{const a=i.props??{},r=d?.trigger==="replace"?j(a,d.changed):a,l=r===a?i:{...i,props:r};return o?o(l,d):l}},draw(t,e){h.has(e)||S(t,void 0,!0)}};export{v as OWN_PAD_FRAME,Y as OWN_PAD_LABEL,y as PADS_ITS_OWN_SPACE,h as PAD_ON_ROOT,tt as SECTION_PAD_INNER,m as SECTION_PAD_INNER_DEFAULTS,rt as blockPadding,et as innerPaddingFallback,k as olderPadNote,nt as ownPairDefault,ot as sectionPadding,j as withPadTotals};
1
+ import{jsx as b}from"react/jsx-runtime";import{HideTaker as N}from"../../../components/ViewHideRoot.js";import{LineChoice as p}from"../../../components/InBoxContext.js";import{isBackgroundBox as I}from"../../../../format/lib/content/box-background.js";import{boxSideSpaceOf as C}from"../../../../format/lib/content/box-side-space.js";import{BAND_PAD_KEYS as _,BAND_PAD_UNIT_KEY as F,BLOCK_PAD_FRAME as P,PAD_TOTAL_KEY as c,SECTION_PAD_KEYS as L,framePadAttrs as R,padTotalKeys as B,padValuesOf as K,sectionPadAttrs as H,tierFramesOf as D}from"../../content/section-padding.js";import{readPartStyle as W}from"../part-styles.js";import{CRUMB_PAD as y,SPEC_PAD as v}from"../../../../format/lib/sections/strip-shape.js";import{say as Y}from"../../../../format/lib/editor-words.js";import{sectionFillPassClass as h}from"../../../../format/lib/content/section-min-height.js";import{COPIES_IN_THE_BOX as j,drawsCopiesInTheBox as M}from"../../../../format/lib/content/copies-in-box.js";import{ownEntry as f}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}},dt=new Set(Object.keys(E));function S(t,e){return e?.innerPadding??f(E,t)}const lt=t=>S(t)??{},ft=t=>f({DetailRows:{top:100,bottom:100}},t),O=new Set(["Flex","Text","Heading","ImageBlock","ButtonBlock"]),U=new Set(["Divider"]),$=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={...K(r,L,n),sideSpace:C(r.sideSpace)},a=o?R({values:d,frame:o(r)},!0).outer:H(d),s=i(r);if(!a)return s;const l=u=>b(N,{className:u?`${a.className} ${u}`:a.className,style:a.style,children:s}),g=h(r,{atSectionLine:!0}),x=h(r);return g===x?l(g):b(p,{line:"by-box",draw:u=>l(u?x:g)})}}const ct={name:"sectionPadding",applies:(t,e,n)=>e.isSection(t)&&!$.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const o=S(e,t);if(o){t.fields={...t.fields,...n.sidesPaddingFields({keys:_,unitKey:F,fallback:o,tablet:!0,siteSide:!0})};return}if(T.has(e))return;const i=[_.top,_.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=f(m,e);if(r){w(t,e,n,r);return}t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(t,e){if(!S(e,t)){if(T.has(e)){A(t);return}O.has(e)||U.has(e)||A(t,e==="Flex"?n=>I(n.bgImage):j.has(e)?n=>M(e,n):void 0,!0,f(m,e))}}},V=["Heading","Text","ImageBlock","ButtonBlock"],X=["LogoBlock"],m={Text:t=>W(t,"text").textStyle?.startsWith("heading-")?P.heading:P.text,Heading:()=>P.heading,ButtonBlock:()=>P.text,Breadcrumb:()=>D(y),SpecStrip:()=>D(v)},k={ButtonBlock:"Outer padding"};function G(t,e){const n=t[c],o=Array.isArray(n)?n.filter(s=>typeof s=="string"):[],i=B().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{[c]:d,...a}=t;return r.length?{...a,[c]:r}:a}function q(t,e){if(e<=0)return null;const n=Array.isArray(t[c])?t[c]:[];return B().some(i=>typeof t[i]=="number"&&!n.includes(i))?Y("plus {n} px (older setting)",{n:e}):null}function w(t,e,n,o){t.fields={...t.fields,...n.ownPaddingFields?.(o,q,f(k,e))??n.sidesPaddingFields({tablet:!0,siteSide:!0})};const i=t.resolveData;t.resolveData=(r,d)=>{const a=r.props??{},s=d?.trigger==="replace"?G(a,d.changed):a,l=s===a?r:{...r,props:s};return i?i(l,d):l}}const ut={name:"blockPadding",applies:(t,e,n)=>(V.includes(t)||X.includes(t))&&!!n&&typeof n.render=="function",panel(t,e,n){const o=f(m,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{m as OWN_PAD_FRAME,k as OWN_PAD_LABEL,U as PADS_ITS_OWN_SPACE,O as PAD_ON_ROOT,dt as SECTION_PAD_INNER,E as SECTION_PAD_INNER_DEFAULTS,ut as blockPadding,lt as innerPaddingFallback,q as olderPadNote,ft as ownPairDefault,ct as sectionPadding,G as withPadTotals};
@@ -1,2 +1,2 @@
1
- import{defaultTextStyles as Y,textStyleCaseCss as le}from"efficient-easel/text-styles/model";import{resolveViewValue as B}from"efficient-easel/draw";import{viewKey as w}from"../../../format/lib/animation/views.js";import{FONT_OPTIONS as ce,normalizeFonts as U}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as de,TABLET_MEDIA as pe,viewOverrides as C,viewRules as X}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as fe,TEXT_STYLE_ATTR as ue,paragraphRules as Z,partSpacingOf as ge}from"../document/part-styles.js";import{faceClassOf as q}from"../../../format/lib/text-style-face.js";import{partColourName as Q,partInkCss as he}from"../../../format/lib/document/part-inks.js";import{compressionMetrics as me,headingTypographyFromRow as Se,normalizeHeadingCompression as I,normalizeSizes as ee}from"../../../format/lib/theme.js";import{finiteNumber as v}from"../../../format/lib/finite-number.js";import{nonEmptyString as P}from"../../../format/lib/non-empty-string.js";const L=e=>e==="sentence"?"none":void 0,ne=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],H=["desktop","tablet","phone"],k=(e,i)=>w(e,i);function j(e,i,t,n=X()){return B("textSize",i,e.sizeTablet,e.sizePhone,n)[t]}const ye=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function M(e){for(const[i,t,n]of ye)for(const o of H)if(e===k(i,o))return{key:w(t,o),view:o,spacing:n};return{key:e,view:"desktop",spacing:null}}function b(e){const i={};for(const t of ne)e[t]!==void 0&&(i[t]=e[t]);return i}function R(e,i){const{auto:t,...n}=e,o=new Set(i??[]),r=ne.filter(s=>o.has(s)&&e.values[s]===void 0);return r.length?{...n,auto:r}:n}function te(e){const i=e.fonts,t=e.sizes,n=e.typography,o=me(e.compression),r={"heading-1":{font:P(i.heading),size:v(t.headingLarge),weight:v(n.weight),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case),largestSize:v(n.maxPx)},"heading-2":{font:P(i.heading2),size:v(t.headingMedium),weight:v(n.weight2),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case2)},"heading-3":{font:P(i.heading3),size:v(t.headingSmall),weight:v(n.weight3),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:L(n.case3)},"body-1":{font:P(i.body),size:v(t.body)},"body-5":{font:P(i.label),size:v(t.label)}};return Y().map(({id:s,kind:l,name:d})=>({id:s,kind:l,name:d,values:b(r[s]??{})}))}function N(e){return Array.isArray(e)&&e.every(t=>t&&typeof t=="object"&&typeof t.id=="string"&&(t.kind==="heading"||t.kind==="body")&&typeof t.name=="string")?e.map(t=>R({...t,values:b(t.values??{})},Array.isArray(t.auto)?t.auto:void 0)):null}function Ne(e){return N(e)??[]}function ie(e){return N(e)??Y().map(({id:i,kind:t,name:n})=>({id:i,kind:t,name:n,values:{}}))}function V(e,i){const t=te(i),n=N(e);return n?n.map(o=>{const r={...F(t,o.id)};for(const s of o.auto??[])delete r[s];return{...o,values:b({...r,...o.values})}}):t}const F=(e,i)=>e.find(t=>t.id===i)?.values??{},oe=["heading-1","heading-2","heading-3"];function Le({saved:e,old:i,cur:t,next:n,sizeOf:o,panelView:r="desktop"}){const s=te(i),l=ie(e),d=V(l,i),c=[],f=n.map(a=>{const S=t.find(g=>g.id===a.id),h=l.find(g=>g.id===a.id);if(!S||!h){const g=be([a],o,r)[0],T=g.values.color;return T===void 0?g:{...g,values:{...g.values,color:Q(T)}}}const p={...h.values},x=new Set(h.auto??[]),y=a.values,_=S.values,z=[...new Set([...Object.keys(y),...Object.keys(_)])].filter(g=>JSON.stringify(y[g])!==JSON.stringify(_[g])),D=g=>M(g).spacing==="letter";z.sort((g,T)=>Number(D(g))-Number(D(T)));for(const g of z){const{key:T,view:re,spacing:K}=M(g),$=T,A=y[g];if(A===void 0){delete p[$],F(s,a.id)[$]!==void 0&&(c.push([a.id,$]),x.add($));continue}if(x.delete($),K==="line")p[$]=O(A/100,3);else if(K==="letter"){const W={...d.find(E=>E.id===a.id)?.values??{}};for(const E of z)y[E]===void 0&&delete W[M(E).key];const G=b({...W,...p}),J=j(G,o({...a,values:G}),re);p[$]=J?O(A/J,4):0}else p[$]=A}return R({id:a.id,kind:a.kind,name:a.name,values:b(p)},x)});let u=i.compression;if(c.some(([a,S])=>(S==="lineHeight"||S==="letterSpacing")&&oe.includes(a))&&I(u)!=="normal"){for(const a of oe){const S=f.find(p=>p.id===a);if(!S)continue;const h={...S.values};for(const p of["lineHeight","letterSpacing"])c.some(([x,y])=>x===a&&y===p)||h[p]===void 0&&!(S.auto??[]).includes(p)&&(h[p]=F(s,a)[p]);S.values=b(h)}u="normal"}return{saved:f,old:{...i,compression:u}}}function je(e,i){const t={text_styles:e.saved};return e.old.compression!==i.compression&&(t.heading_compression=I(e.old.compression)),t}const O=(e,i)=>Number(e.toFixed(i)),se=(e,i)=>H.indexOf(e)<H.indexOf(i)?i:e;function Me(e,i,t="desktop"){return e.map(n=>{const o={...n.values},r=i(n);for(const s of H){const l=w("lineHeight",s),d=n.values[l],c=n.values[w("letterSpacing",s)];delete o[l],d!==void 0&&(o[k("lineSpacing",s)]=O(d*100,1));const f=se(s,t);c!==void 0&&(o[k("letterSpacing",s)]=O(c*j(n.values,r,f),f===s?2:4))}return{id:n.id,kind:n.kind,name:n.name,values:o}})}function be(e,i,t="desktop"){return e.map(n=>{const o=n.values,r={...o};for(const c of H)delete r[k("lineSpacing",c)],delete r[k("letterSpacing",c)];const s={id:n.id,kind:n.kind,name:n.name,values:b(r)},l={...s.values},d=i({...s,values:{...s.values}});for(const c of H){const f=o[k("lineSpacing",c)],u=o[k("letterSpacing",c)];if(typeof f=="number"&&(l[w("lineHeight",c)]=O(f/100,3)),typeof u=="number"){const m=j(s.values,d,se(c,t));l[w("letterSpacing",c)]=m?O(u/m,4):0}}return{...s,values:b(l)}})}function Re(e){const i={fonts:U({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:ee({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:I(e.heading_compression),typography:Se(e)},t=e.text_styles??null,n=Array.isArray(t)?ae(V(t,i),i):i;return{fonts:U(n.fonts),sizes:ee(n.sizes),compression:I(n.compression),typography:n.typography,textStyles:t}}function ae(e,i){const t=m=>e.find(a=>a.id===m)?.values??{},n=t("heading-1"),o=t("heading-2"),r=t("heading-3"),s=t("body-1"),l=t("body-5"),d=i.fonts,c=i.sizes,f=i.typography,u=m=>m==="none"?"sentence":"authored";return{fonts:{...d,heading:n.font??d.heading,heading2:o.font??n.font??d.heading2,heading3:r.font??n.font??d.heading3,body:s.font??d.body,label:l.font??d.label},sizes:{...c,headingLarge:n.size??null,headingMedium:o.size??null,headingSmall:r.size??null,body:s.size??null,label:l.size??null},compression:i.compression,typography:{...f,case:u(n.letterCase),weight:n.weight??null,maxPx:n.largestSize??null,weight2:o.weight??null,weight3:r.weight??null,case2:u(o.letterCase),case3:u(r.letterCase)}}}function Ve(e){const i=N(e.textStyles);if(!i||i.every(o=>Object.keys(o.values).length===0&&!o.auto))return e;const t={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},n=ae(V(i,t),t);return{...e,fonts:n.fonts,sizes:n.sizes,headingCompression:n.compression,headingTypography:n.typography}}function Fe(e){const i=[];for(const t of e){const n=t.values,o=`.${q(t)}`,r=`[${ue}="${t.id}"]`,s=`${o}, ${r}`,l=[],d=n.font!==void 0?ce.find(m=>m.key===n.font)?.cssVar:void 0;if(d&&l.push(`font-family: var(${d})`),n.size!==void 0){const m=n.largestSize!==void 0?Math.min(n.size,n.largestSize):n.size;l.push(`font-size: ${m}px`)}const c=he(n.color);c&&l.push(`color: ${c}`),n.italic===!0&&l.push("font-style: italic"),n.weight!==void 0&&l.push(`font-weight: ${n.weight}`);const f=[];n.lineHeight!==void 0&&f.push(`line-height: ${n.lineHeight}`),n.letterSpacing!==void 0&&f.push(`letter-spacing: ${n.letterSpacing}em`),t.kind==="body"&&l.push(...f);const u=le(n.letterCase);u&&t.kind==="body"&&l.push(`text-transform: ${u}`),n.paragraphSpacing&&l.push(`--sf-part-para: ${n.paragraphSpacing}px`),l.length&&i.push(`${s} { ${l.join("; ")} }`),t.kind==="heading"&&f.length&&i.push(`${s}, ${o}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${f.join("; ")} }`),t.kind==="heading"&&u&&i.push(`${r}, ${o}:is(h1, h2, h3, h4) { text-transform: ${u} }`),n.paragraphSpacing&&(i.push(`*:has(> ${r}) { --sf-part-para: ${n.paragraphSpacing}px }`),i.push(...Z(`:is(${s})`,`*:has(> ${r})`))),i.push(...xe(t,s,o,r))}return i.join(`
2
- `)}function xe(e,i,t,n){const o=e.values,r=C("textSize",o.size,o.sizeTablet,o.sizePhone),s=C("textSize",o.largestSize,o.largestSizeTablet,o.largestSizePhone),l=C("same",o.lineHeight,o.lineHeightTablet,o.lineHeightPhone),d=C("same",o.letterSpacing,o.letterSpacingTablet,o.letterSpacingPhone),c=C("spacing",o.paragraphSpacing,o.paragraphSpacingTablet,o.paragraphSpacingPhone),f=B("textSize",o.size,o.sizeTablet,o.sizePhone,X()),u=ze[e.id],m=[];for(const[a,S]of[["tablet",pe],["phone",de]]){const h=[],p=[],x=f[a],y=s[a],_=r[a]===void 0&&y===void 0||x===void 0?void 0:y===void 0?x:Math.min(x,y);_!==void 0&&p.push(`font-size: ${_}px`);const z=[];l[a]!==void 0&&z.push(`line-height: ${l[a]}`),d[a]!==void 0&&z.push(`letter-spacing: ${d[a]}em`),e.kind==="body"&&p.push(...z),c[a]!==void 0&&p.push(`--sf-part-para: ${c[a]}px`),p.length&&h.push(`${i} { ${p.join("; ")} }`),e.kind==="heading"&&z.length&&h.push(`${i}, ${t}:is(h1, h2, h3, h4), ${n}:is(h1, h2, h3, h4) { ${z.join("; ")} }`),c[a]!==void 0&&h.push(`*:has(> ${n}) { --sf-part-para: ${c[a]}px }`),c[a]!==void 0&&!o.paragraphSpacing&&h.push(...Z(`:is(${i})`,`*:has(> ${n})`)),_!==void 0&&u&&h.push(`.sf-themed-content { --size-${u}: ${_}px !important }`),h.length&&m.push(`@media ${S} { ${h.join(" ")} }`)}return m}const ze={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function De(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function Ke(e){return e?fe[e]:void 0}function ve(e){const i=ge(e);return b({font:e.font,color:e.color===void 0?void 0:Q(e.color),size:e.size,weight:e.weight,italic:e.italic,lineHeight:i.lineHeight,letterSpacing:i.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function We(e){return Object.keys(ve(e)).length>0}function Ge({saved:e,old:i,styleId:t,values:n}){const o=ie(e);return{saved:$e(o,t,n),old:i}}function $e(e,i,t){return e.map(n=>n.id===i?R({...n,values:b({...n.values,...t})},n.auto):n)}function Je(e){const i=e.filter(t=>t.kind==="body").map(t=>Number(/^body-(\d+)$/.exec(t.id)?.[1])).filter(t=>Number.isInteger(t)&&t>0);return i.length?`body-${Math.max(...i)}`:"body-1"}export{De as accentItalicCss,Le as applyListChange,Je as eyebrowStyleId,q as faceClassOf,be as fromPanelStyles,We as hasStyleChange,je as listChangePatch,ie as listToWrite,ve as partStyleToTextStyleValues,Ge as pushIntoStyle,V as resolveTextStyles,$e as setStyleValues,Re as siteTextFromRow,Ne as storedTextStyles,Ke as styleIdOfRole,Fe as textStylesCss,te as textStylesFromOld,ae as textStylesToOld,Ve as themeWithTextStyles,Me as toPanelStyles,j as viewSizeOf};
1
+ import{defaultTextStyles as Y,textStyleCaseCss as le}from"efficient-easel/text-styles/model";import{resolveViewValue as Z}from"efficient-easel/draw";import{viewKey as w}from"../../../format/lib/animation/views.js";import{FONT_OPTIONS as ce,normalizeFonts as B}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as de,TABLET_MEDIA as pe,viewOverrides as H,viewRules as U}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as fe,TEXT_STYLE_ATTR as ue,paragraphRules as X,partSpacingOf as ge}from"../document/part-styles.js";import{FACE_SIZE as he,faceClassOf as q}from"../../../format/lib/text-style-face.js";import{partColourName as Q,partInkCss as me}from"../../../format/lib/document/part-inks.js";import{compressionMetrics as Se,headingTypographyFromRow as ye,normalizeHeadingCompression as I,normalizeSizes as ee}from"../../../format/lib/theme.js";import{finiteNumber as v}from"../../../format/lib/finite-number.js";import{nonEmptyString as P}from"../../../format/lib/non-empty-string.js";const j=e=>e==="sentence"?"none":void 0,ne=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],O=["desktop","tablet","phone"],k=(e,i)=>w(e,i);function L(e,i,t,n=U()){return Z("textSize",i,e.sizeTablet,e.sizePhone,n)[t]}const xe=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function R(e){for(const[i,t,n]of xe)for(const s of O)if(e===k(i,s))return{key:w(t,s),view:s,spacing:n};return{key:e,view:"desktop",spacing:null}}function x(e){const i={};for(const t of ne)e[t]!==void 0&&(i[t]=e[t]);return i}function F(e,i){const{auto:t,...n}=e,s=new Set(i??[]),r=ne.filter(o=>s.has(o)&&e.values[o]===void 0);return r.length?{...n,auto:r}:n}function te(e){const i=e.fonts,t=e.sizes,n=e.typography,s=Se(e.compression),r={"heading-1":{font:P(i.heading),size:v(t.headingLarge),weight:v(n.weight),lineHeight:s.lineHeight,letterSpacing:s.letterSpacing,letterCase:j(n.case),largestSize:v(n.maxPx)},"heading-2":{font:P(i.heading2),size:v(t.headingMedium),weight:v(n.weight2),lineHeight:s.lineHeight,letterSpacing:s.letterSpacing,letterCase:j(n.case2)},"heading-3":{font:P(i.heading3),size:v(t.headingSmall),weight:v(n.weight3),lineHeight:s.lineHeight,letterSpacing:s.letterSpacing,letterCase:j(n.case3)},"body-1":{font:P(i.body),size:v(t.body)},"body-5":{font:P(i.label),size:v(t.label)}};return Y().map(({id:o,kind:l,name:d})=>({id:o,kind:l,name:d,values:x(r[o]??{})}))}function N(e){return Array.isArray(e)&&e.every(t=>t&&typeof t=="object"&&typeof t.id=="string"&&(t.kind==="heading"||t.kind==="body")&&typeof t.name=="string")?e.map(t=>F({...t,values:x(t.values??{})},Array.isArray(t.auto)?t.auto:void 0)):null}function je(e){return N(e)??[]}function ie(e){return N(e)??Y().map(({id:i,kind:t,name:n})=>({id:i,kind:t,name:n,values:{}}))}function M(e,i){const t=te(i),n=N(e);return n?n.map(s=>{const r={...V(t,s.id)};for(const o of s.auto??[])delete r[o];return{...s,values:x({...r,...s.values})}}):t}const V=(e,i)=>e.find(t=>t.id===i)?.values??{},se=["heading-1","heading-2","heading-3"];function Le({saved:e,old:i,cur:t,next:n,sizeOf:s,panelView:r="desktop"}){const o=te(i),l=ie(e),d=M(l,i),c=[],f=n.map(a=>{const S=t.find(g=>g.id===a.id),h=l.find(g=>g.id===a.id);if(!S||!h){const g=be([a],s,r)[0],T=g.values.color;return T===void 0?g:{...g,values:{...g.values,color:Q(T)}}}const p={...h.values},b=new Set(h.auto??[]),y=a.values,_=S.values,z=[...new Set([...Object.keys(y),...Object.keys(_)])].filter(g=>JSON.stringify(y[g])!==JSON.stringify(_[g])),D=g=>R(g).spacing==="letter";z.sort((g,T)=>Number(D(g))-Number(D(T)));for(const g of z){const{key:T,view:re,spacing:K}=R(g),$=T,E=y[g];if(E===void 0){delete p[$],V(o,a.id)[$]!==void 0&&(c.push([a.id,$]),b.add($));continue}if(b.delete($),K==="line")p[$]=C(E/100,3);else if(K==="letter"){const W={...d.find(A=>A.id===a.id)?.values??{}};for(const A of z)y[A]===void 0&&delete W[R(A).key];const G=x({...W,...p}),J=L(G,s({...a,values:G}),re);p[$]=J?C(E/J,4):0}else p[$]=E}return F({id:a.id,kind:a.kind,name:a.name,values:x(p)},b)});let u=i.compression;if(c.some(([a,S])=>(S==="lineHeight"||S==="letterSpacing")&&se.includes(a))&&I(u)!=="normal"){for(const a of se){const S=f.find(p=>p.id===a);if(!S)continue;const h={...S.values};for(const p of["lineHeight","letterSpacing"])c.some(([b,y])=>b===a&&y===p)||h[p]===void 0&&!(S.auto??[]).includes(p)&&(h[p]=V(o,a)[p]);S.values=x(h)}u="normal"}return{saved:f,old:{...i,compression:u}}}function Re(e,i){const t={text_styles:e.saved};return e.old.compression!==i.compression&&(t.heading_compression=I(e.old.compression)),t}const C=(e,i)=>Number(e.toFixed(i)),oe=(e,i)=>O.indexOf(e)<O.indexOf(i)?i:e;function Fe(e,i,t="desktop"){return e.map(n=>{const s={...n.values},r=i(n);for(const o of O){const l=w("lineHeight",o),d=n.values[l],c=n.values[w("letterSpacing",o)];delete s[l],d!==void 0&&(s[k("lineSpacing",o)]=C(d*100,1));const f=oe(o,t);c!==void 0&&(s[k("letterSpacing",o)]=C(c*L(n.values,r,f),f===o?2:4))}return{id:n.id,kind:n.kind,name:n.name,values:s}})}function be(e,i,t="desktop"){return e.map(n=>{const s=n.values,r={...s};for(const c of O)delete r[k("lineSpacing",c)],delete r[k("letterSpacing",c)];const o={id:n.id,kind:n.kind,name:n.name,values:x(r)},l={...o.values},d=i({...o,values:{...o.values}});for(const c of O){const f=s[k("lineSpacing",c)],u=s[k("letterSpacing",c)];if(typeof f=="number"&&(l[w("lineHeight",c)]=C(f/100,3)),typeof u=="number"){const m=L(o.values,d,oe(c,t));l[w("letterSpacing",c)]=m?C(u/m,4):0}}return{...o,values:x(l)}})}function Me(e){const i={fonts:B({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:ee({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:I(e.heading_compression),typography:ye(e)},t=e.text_styles??null,n=Array.isArray(t)?ae(M(t,i),i):i;return{fonts:B(n.fonts),sizes:ee(n.sizes),compression:I(n.compression),typography:n.typography,textStyles:t}}function ae(e,i){const t=m=>e.find(a=>a.id===m)?.values??{},n=t("heading-1"),s=t("heading-2"),r=t("heading-3"),o=t("body-1"),l=t("body-5"),d=i.fonts,c=i.sizes,f=i.typography,u=m=>m==="none"?"sentence":"authored";return{fonts:{...d,heading:n.font??d.heading,heading2:s.font??n.font??d.heading2,heading3:r.font??n.font??d.heading3,body:o.font??d.body,label:l.font??d.label},sizes:{...c,headingLarge:n.size??null,headingMedium:s.size??null,headingSmall:r.size??null,body:o.size??null,label:l.size??null},compression:i.compression,typography:{...f,case:u(n.letterCase),weight:n.weight??null,maxPx:n.largestSize??null,weight2:s.weight??null,weight3:r.weight??null,case2:u(s.letterCase),case3:u(r.letterCase)}}}function Ve(e){const i=N(e.textStyles);if(!i||i.every(s=>Object.keys(s.values).length===0&&!s.auto))return e;const t={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},n=ae(M(i,t),t);return{...e,fonts:n.fonts,sizes:n.sizes,headingCompression:n.compression,headingTypography:n.typography}}function De(e){const i=[];for(const t of e){const n=t.values,s=`.${q(t)}`,r=`[${ue}="${t.id}"]`,o=`${s}, ${r}`,l=[],d=n.font!==void 0?ce.find(m=>m.key===n.font)?.cssVar:void 0;if(d&&l.push(`font-family: var(${d})`),n.size!==void 0){const m=n.largestSize!==void 0?Math.min(n.size,n.largestSize):n.size;l.push(`font-size: ${m}px`)}const c=me(n.color);c&&l.push(`color: ${c}`),n.italic===!0&&l.push("font-style: italic"),n.weight!==void 0&&l.push(`font-weight: ${n.weight}`);const f=[];n.lineHeight!==void 0&&f.push(`line-height: ${n.lineHeight}`),n.letterSpacing!==void 0&&f.push(`letter-spacing: ${n.letterSpacing}em`),t.kind==="body"&&l.push(...f);const u=le(n.letterCase);u&&t.kind==="body"&&l.push(`text-transform: ${u}`),n.paragraphSpacing&&l.push(`--sf-part-para: ${n.paragraphSpacing}px`),l.length&&i.push(`${o} { ${l.join("; ")} }`),t.kind==="heading"&&f.length&&i.push(`${o}, ${s}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${f.join("; ")} }`),t.kind==="heading"&&u&&i.push(`${r}, ${s}:is(h1, h2, h3, h4) { text-transform: ${u} }`),n.paragraphSpacing&&(i.push(`*:has(> ${r}) { --sf-part-para: ${n.paragraphSpacing}px }`),i.push(...X(`:is(${o})`,`*:has(> ${r})`))),i.push(...ze(t,o,s,r))}return i.join(`
2
+ `)}function ze(e,i,t,n){const s=e.values,r=H("textSize",s.size,s.sizeTablet,s.sizePhone),o=H("textSize",s.largestSize,s.largestSizeTablet,s.largestSizePhone),l=H("same",s.lineHeight,s.lineHeightTablet,s.lineHeightPhone),d=H("same",s.letterSpacing,s.letterSpacingTablet,s.letterSpacingPhone),c=H("spacing",s.paragraphSpacing,s.paragraphSpacingTablet,s.paragraphSpacingPhone),f=Z("textSize",s.size,s.sizeTablet,s.sizePhone,U()),u=ve[e.id],m=[];for(const[a,S]of[["tablet",pe],["phone",de]]){const h=[],p=[],b=f[a],y=o[a],_=r[a]===void 0&&y===void 0||b===void 0?void 0:y===void 0?b:Math.min(b,y);_!==void 0&&p.push(`font-size: ${_}px`);const z=[];l[a]!==void 0&&z.push(`line-height: ${l[a]}`),d[a]!==void 0&&z.push(`letter-spacing: ${d[a]}em`),e.kind==="body"&&p.push(...z),c[a]!==void 0&&p.push(`--sf-part-para: ${c[a]}px`),p.length&&h.push(`${i} { ${p.join("; ")} }`),e.kind==="heading"&&z.length&&h.push(`${i}, ${t}:is(h1, h2, h3, h4), ${n}:is(h1, h2, h3, h4) { ${z.join("; ")} }`),c[a]!==void 0&&h.push(`*:has(> ${n}) { --sf-part-para: ${c[a]}px }`),c[a]!==void 0&&!s.paragraphSpacing&&h.push(...X(`:is(${i})`,`*:has(> ${n})`)),_!==void 0&&u&&h.push(`.sf-themed-content { --size-${u}: ${_}px !important }`),h.length&&m.push(`@media ${S} { ${h.join(" ")} }`)}return m}const ve=Object.fromEntries(Object.entries(he).map(([e,{step:i}])=>[e,i]));function Ke(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function We(e){return e?fe[e]:void 0}function $e(e){const i=ge(e);return x({font:e.font,color:e.color===void 0?void 0:Q(e.color),size:e.size,weight:e.weight,italic:e.italic,lineHeight:i.lineHeight,letterSpacing:i.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function Ge(e){return Object.keys($e(e)).length>0}function Je({saved:e,old:i,styleId:t,values:n}){const s=ie(e);return{saved:_e(s,t,n),old:i}}function _e(e,i,t){return e.map(n=>n.id===i?F({...n,values:x({...n.values,...t})},n.auto):n)}function Ye(e){const i=e.filter(t=>t.kind==="body").map(t=>Number(/^body-(\d+)$/.exec(t.id)?.[1])).filter(t=>Number.isInteger(t)&&t>0);return i.length?`body-${Math.max(...i)}`:"body-1"}export{Ke as accentItalicCss,Le as applyListChange,Ye as eyebrowStyleId,q as faceClassOf,be as fromPanelStyles,Ge as hasStyleChange,Re as listChangePatch,ie as listToWrite,$e as partStyleToTextStyleValues,Je as pushIntoStyle,M as resolveTextStyles,_e as setStyleValues,Me as siteTextFromRow,je as storedTextStyles,We as styleIdOfRole,De as textStylesCss,te as textStylesFromOld,ae as textStylesToOld,Ve as themeWithTextStyles,Fe as toPanelStyles,L as viewSizeOf};