efficient-web-builder 66.0.0 → 67.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.
- package/CHANGELOG.md +28 -0
- package/dist/editor/components/MediaUploadField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/SectionWidthRows.d.ts +3 -1
- package/dist/editor/components/SectionWidthRows.js +1 -1
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/storefront-editor.css +47 -0
- package/dist/editor/lib/animation/hover-fields.d.ts +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/block-offer.d.ts +2 -0
- package/dist/editor/lib/document/block-offer.js +1 -1
- package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Split/fields.js +1 -1
- package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +1 -1
- package/dist/editor/lib/document/controls.d.ts +24 -14
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/document/section-own-width-fields.js +1 -1
- package/dist/format/lib/animation/views.js +1 -1
- package/dist/format/lib/content/borders.d.ts +12 -2
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/card-corners.d.ts +3 -1
- package/dist/format/lib/content/card-corners.js +1 -1
- package/dist/format/lib/content/css-length.d.ts +6 -0
- package/dist/format/lib/content/css-length.js +1 -1
- package/dist/format/lib/content/image-corners.d.ts +3 -1
- package/dist/format/lib/content/image-corners.js +1 -1
- package/dist/format/lib/content/section-corners.d.ts +3 -1
- package/dist/format/lib/content/section-corners.js +1 -1
- package/dist/format/lib/content/section-min-height.d.ts +11 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +5 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/content/section-type-size.d.ts +12 -1
- package/dist/format/lib/content/section-type-size.js +1 -1
- package/dist/format/lib/content/section-width.d.ts +8 -0
- package/dist/format/lib/content/section-width.js +1 -1
- package/dist/format/lib/content/view-tier.d.ts +10 -0
- package/dist/format/lib/content/view-tier.js +1 -0
- package/dist/format/lib/document/blocks/general/Split/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Split/meta.js +2 -2
- package/dist/format/lib/document/easel-row-words.d.ts +2 -0
- package/dist/format/lib/document/easel-row-words.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +3 -1
- package/dist/format/lib/document/section-catalog.d.ts +5 -0
- package/dist/format/lib/document/section-catalog.js +10 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +3 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/format/lib/fit-words.js +4 -2
- package/dist/format/lib/post-card-layout.d.ts +3 -0
- package/dist/format/lib/post-card-layout.js +1 -1
- package/dist/format/lib/sections/divider-style.d.ts +9 -0
- package/dist/format/lib/sections/divider-style.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/source-rules/one-length-control.js +3 -3
- package/dist/format/lib/theme.d.ts +1 -1
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/Divider.d.ts +3 -1
- package/dist/render/components/Divider.js +1 -1
- package/dist/render/components/Flex.d.ts +3 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroGroup.d.ts +3 -1
- package/dist/render/components/HeroGroup.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +2 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/IntroBleed.d.ts +3 -2
- package/dist/render/components/IntroBleed.js +1 -1
- package/dist/render/components/PictureHoverMove.d.ts +18 -0
- package/dist/render/components/PictureHoverMove.js +1 -0
- package/dist/render/components/PictureWash.d.ts +2 -1
- package/dist/render/components/PictureWash.js +1 -1
- package/dist/render/components/ViewHideRoot.d.ts +6 -0
- package/dist/render/components/ViewHideRoot.js +1 -1
- package/dist/render/lib/content/block-size.d.ts +1 -1
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/button-look.js +1 -1
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/Divider/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/IntroBleed/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +13 -0
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/borders.js +1 -1
- package/dist/render/lib/document/passes/corners.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/section-height.d.ts +5 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as
|
|
1
|
+
import{storedUnit as w}from"../../../format/lib/content/css-length.js";import{phoneKey as S,resolveViewValue as H,tabletKey as E,viewKeyAt as P}from"efficient-easel/draw";import{SECTION_PAD_UNIT_KEY as y,SITE_SIDE as F,convertLength as G,isLengthUnit as M,isSiteSide as L,sideLengthAt as U,sideValueAt as j,withLength as g}from"efficient-easel/screen/lib/content/length-units";import{siteSideRoom as O}from"../../../format/lib/content/page-width.js";import{viewRules as k}from"../../../format/lib/content/view-overrides.js";import{finiteNumber as l}from"../../../format/lib/finite-number.js";const Y={min:10,max:200,step:10};function $(t,e,n,o=0){const s=l(t),i=l(e);if(s===void 0&&i===void 0)return;const r=h(n),a=p=>p===void 0?void 0:r==="px"?p:g(p,r,o);return{paddingTop:a(s),paddingBottom:a(i)}}const h=t=>w(t),K="sf-pad-top-phone",q="sf-pad-bottom-phone",z="--sf-pad-t-phone",J="--sf-pad-b-phone",Q="sf-pad-left-phone",W="sf-pad-right-phone",X="--sf-pad-l-phone",Z="--sf-pad-r-phone",v="sf-pad-top-tablet",tt="sf-pad-bottom-tablet",et="sf-pad-left-tablet",ot="sf-pad-right-tablet",nt="--sf-pad-t-tablet",st="--sf-pad-b-tablet",it="--sf-pad-l-tablet",dt="--sf-pad-r-tablet";function D(t){const e={desktop:t.unit,tablet:t.unitTablet,phone:t.unitPhone},n=$(t.top,t.bottom,t.unit,t.frame),o=at({left:t.left,right:t.right},{top:t.topPhone,bottom:t.bottomPhone,left:t.leftPhone,right:t.rightPhone},{top:t.topTablet,bottom:t.bottomTablet,left:t.leftTablet,right:t.rightTablet},{top:t.top,bottom:t.bottom,left:t.left,right:t.right},e,t.frame,t.sideSpace);return n===void 0&&!o.classes.length&&!Object.keys(o.style).length?null:{className:["sf-section-pad",...o.classes].join(" "),style:{...n,...o.style}}}const rt=t=>L(t)?t:l(t),pt=[["top","paddingTop",[v,nt],[K,z]],["bottom","paddingBottom",[tt,st],[q,J]],["left","paddingLeft",[et,it],[Q,X]],["right","paddingRight",[ot,dt],[W,Z]]];function _t(t,e,n){return!M(e)||e==="px"?t:G(t,"px",e,n,{min:0,max:Y.max,step:1})}function ft(t,e,n,o={},s=0){const i=(b,u)=>{if(u==="px")return`${b}px`;const f=g(b,u,s);return typeof f=="number"?`${f}px`:f},r={n:t,[E("n")]:e,[S("n")]:n,u:o.desktop,[E("u")]:o.tablet,[S("u")]:o.phone},a=H("spacing",l(t),l(e),l(n),k()),p=(b,u,f)=>{if(j(r,{side:"n"},b,"side",["side"])?.value===F)return O().value;const c=U(r,{side:"n"},"u",b,"side");if(!c)return;const A=u!==null&&!f&&c.unit==="px"&&typeof a[u]=="number";return i(A?a[u]:c.value,c.unit)},_=p("desktop",null,!0),m={},T=p("tablet","tablet",e!==void 0);T!==void 0&&(e!==void 0||T!==_)&&(m.tablet=T);const d=p("mobile","phone",n!==void 0);return d!==void 0&&(n!==void 0||d!==_)&&(m.phone=d),m}function at(t,e,n={},o=t,s={},i=0,r="box"){const a={},p={},_=[],m=O(r);let T=!1;for(const[d,b,...u]of pt){const f=d==="left"||d==="right"?rt:l,c=f(t[d]),A=d==="top"||d==="bottom"?i:0;L(c)?(a[b]=m.value,T=!0):c!==void 0&&(a[b]=h(s.desktop)==="px"?c:g(c,h(s.desktop),A));const R=ft(f(o[d]),f(n[d]),f(e[d]),s,A);for(const[V,[C,I]]of[["tablet",u[0]],["phone",u[1]]]){const x=R[V];x!==void 0&&(_.push(C),p[I]=x,x===m.value&&(T=!0))}}return T&&_.push(...m.className.split(" ")),{classes:_,style:{...a,...p}}}function B(t,e,n){const o=l(t)??n,s=l(e);return o===void 0?s:s===void 0?o:o+s}function Pt(t,e={}){return{top:B(t.padTop,t.sectionPaddingTop,e.top),bottom:B(t.padBottom,t.sectionPaddingBottom,e.bottom)}}const N={top:"sectionPaddingTop",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft",right:"sectionPaddingRight"};function At(t,e=N,n=!0,o=e===N?y:void 0){const s={};if(o){t[o]!==void 0&&(s.unit=t[o]);for(const i of["tablet","mobile"])t[P(o,i)]!==void 0&&(s[P("unit",i)]=t[P(o,i)])}for(const i of n?["top","bottom","left","right"]:["top","bottom"]){s[i]=t[e[i]];for(const r of["tablet","mobile"])s[P(i,r)]=t[P(e[i],r)]}return s}function ht(t){return D(t)}function xt(t,e){const n=(o,s)=>typeof o!="number"?void 0:h(s)==="px"?o+e:o;return D({...t,frame:e,top:n(t.top,t.unit),bottom:n(t.bottom,t.unit),topTablet:n(t.topTablet,t.unitTablet),bottomTablet:n(t.bottomTablet,t.unitTablet),topPhone:n(t.topPhone,t.unitPhone),bottomPhone:n(t.bottomPhone,t.unitPhone)})}export{q as PAD_BOTTOM_PHONE_CLASS,J as PAD_BOTTOM_PHONE_VAR,tt as PAD_BOTTOM_TABLET_CLASS,st as PAD_BOTTOM_TABLET_VAR,Q as PAD_LEFT_PHONE_CLASS,X as PAD_LEFT_PHONE_VAR,et as PAD_LEFT_TABLET_CLASS,it as PAD_LEFT_TABLET_VAR,W as PAD_RIGHT_PHONE_CLASS,Z as PAD_RIGHT_PHONE_VAR,ot as PAD_RIGHT_TABLET_CLASS,dt as PAD_RIGHT_TABLET_VAR,K as PAD_TOP_PHONE_CLASS,z as PAD_TOP_PHONE_VAR,v as PAD_TOP_TABLET_CLASS,nt as PAD_TOP_TABLET_VAR,Y as SECTION_PADDING,N as SECTION_PAD_KEYS,_t as padDefaultIn,at as padSideAttrs,rt as padSideValue,At as padValuesOf,Pt as resolveSectionPadding,xt as rootPadAttrs,D as sectionPadAttrs,$ as sectionPadStyle,ft as sideViewLengths,ht as wrapperPadAttrs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import d from"../../../../../components/Divider.js";import{padValuesOf as h}from"../../../../content/section-padding.js";import{DividerMeta as m}from"../../../../../../format/lib/document/blocks/general/Divider/meta.js";const k={...m,render:t=>{const{spacing:e,contained:n,style:i,thickness:s,thicknessUnit:r,lengthPct:c,lengthPctUnit:o}=t;return a(d,{spacing:e,contained:n,style:i,thickness:s,thicknessUnit:r,lengthPct:c,lengthPctUnit:o,pad:h(t)})}};export{k as DividerRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{sectionBorderUnitsOf as f}from"../../../../../../format/lib/content/borders.js";import{BOX_ANGLE_PROP as g}from"../../../../../../format/lib/content/box-angle.js";import{BOX_SIDE_SPACE_PROP as b}from"../../../../../../format/lib/content/box-side-space.js";import{phoneKey as a,tabletKey as t}from"efficient-easel/draw";import{BOX_SWATCH_PROP as S,boxCardProps as r,boxPaintOf as u}from"../../../../../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as w}from"../../../../../../format/lib/content/box-card-rule.js";import{sharedColumnsDrawn as P,sharedRowsDrawn as O}from"../../../../content/box-shared-columns.js";import{CountRowsContext as k,NO_COUNTS as y}from"../../../../../components/CountRowsContext.js";import{RowEmptyGate as C}from"../../../../../components/CardRowContext.js";import{BOX_HIDE_WHEN_ROW_EMPTY as T,CARD_ROW_LINK_PROP as _,namedRowField as d}from"../../../../../../format/lib/content/card-template.js";import R from"../../../../../components/Flex.js";import{loopDelayOf as x,loopSecondsOf as D,parseLoop as B,parseLoopDirection as j}from"../../../../../../format/lib/animation/index.js";import{COUNTS_SOURCE as E,declaredBlockSource as H,servedRows as I}from"../../../../../../format/lib/content/block-sources.js";import{padValuesOf as N}from"../../../../content/section-padding.js";import{sectionFillsHeight as v}from"../../../../../../format/lib/content/section-min-height.js";import{boxHighlightStyle as A,pictureHoverOf as F}from"../../../../../../format/lib/animation/hover.js";import{slotCountOf as L}from"../../../slot-counts.js";import{FlexMeta as U}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";const oe={...U,render:e=>{const o=!!e.editor?.isEditing,c=n(R,{direction:e.direction,label:e.label,tabShape:e.tabShape,gap:e.gap,gapPhone:e[a("gap")],gapTablet:e[t("gap")],justify:e.justify,justifyTablet:e[t("justify")],justifyPhone:e[a("justify")],align:e.align,alignTablet:e[t("align")],alignPhone:e[a("align")],wrap:e.wrap,wrapTablet:e[t("wrap")],share:e.share,sharePhone:e[a("share")],shareTablet:e[t("share")],wrapPhone:e[a("wrap")],orderPhone:e[a("order")],phoneRow:e.phoneRow,columns:e.columns,columnsTablet:e[t("columns")],separator:e.separator,stackBelow:e.stackBelow,blockSpacing:e.blockSpacing,blockSpacingTablet:e[t("blockSpacing")],blockSpacingPhone:e[a("blockSpacing")],bgImage:e.bgImage,bgImagePhone:e.bgImagePhone,rowImage:d(e,w),pictureHover:F(e),darken:e.darken,darkenStyle:e.darkenStyle,darkenTablet:e[t("darken")],darkenPhone:e[a("darken")],darkenStyleTablet:e[t("darkenStyle")],darkenStylePhone:e[a("darkenStyle")],placement:e.placement,padV2:e.padV2===!0,border:e.sectionBorder,borderTablet:e.sectionBorderTablet,borderPhone:e.sectionBorderPhone,borderUnits:f(e),pad:N(e),contained:e.contained,fillHeight:v(e),shadow:e.shadow,shadowTablet:e[t("shadow")],shadowPhone:e[a("shadow")],loop:B(e.loop),scrollDirection:j(e.scrollDirection),loopSeconds:D({loopDuration:e.loopDuration}),loopDelay:x({loopDelay:e.loopDelay}),editing:o,fillColor:e.fillColor,fillColorTablet:e[t("fillColor")],fillColorPhone:e[a("fillColor")],swatch:e[S],line:e.line,upcoming:e.upcoming,link:e.link,rowLink:d(e,_),highlight:A(e,m=>u(m)??""),boxShape:e.boxShape,boxShapePhone:e[a("boxShape")],boxShapeTablet:e[t("boxShape")],angle:e[g],jumpHighlight:e.jumpHighlight,anchor:e.anchor,sharedSides:P(r(e,!1)),sharedRows:O(r(e,!1)),boxId:typeof e.id=="string"?e.id:void 0,slotCount:L(e),mirrorCards:e.mirrorCards,content:e.content,rowTitle:e.rowTitle,startsOpen:e.startsOpen,rowStyle:e.rowStyle,sideSpace:e[b]}),l=H(e),h=l?l===E?I(e):y:null,i=n(k.Provider,{value:h,children:c});return e[T]===void 0?i:n(C,{props:e,editing:o,children:i})}};export{oe as FlexRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{phoneKey as h,tabletKey as w}from"efficient-easel/draw";import s from"../../../../../components/HeroGroup.js";import{padValuesOf as j}from"../../../../content/section-padding.js";import{HeroGroupMeta as y}from"../../../../../../format/lib/document/blocks/general/HeroGroup/meta.js";const b={...y,render:e=>{const{placement:t,nudgeX:n,nudgeY:r,nudgeUnit:o,width:i,widthUnit:a,gap:d,direction:g,justify:p,align:u,wrap:m,content:f,editor:c}=e;return l(s,{placement:t,nudgeX:n,nudgeY:r,width:i,widthUnit:a,nudgeUnit:o,gap:d,gapPhone:e[h("gap")],gapTablet:e[w("gap")],direction:g,justify:p,align:u,wrap:m,pad:j(e),content:f,dragRef:c?.dragRef})}};export{b as HeroGroupRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as g}from"react/jsx-runtime";import{phoneKey as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{phoneKey as R}from"efficient-easel/draw";import{CardRowDrawn as v}from"../../../../../components/CardRowContext.js";import O from"../../../../../components/ImageBlock.js";import{recordPictureAlt as x}from"../../../../../../format/lib/content/record-row.js";import{CARD_ROW_LINK_PROP as B,namedRowField as h,rowFieldSpec as P,rowFieldText as S}from"../../../../../../format/lib/content/card-template.js";import{cardRowHoverMedia as b}from"../../../../../../format/lib/content/hover-media.js";import{blockSizeOf as F,blockSizeValuesOf as _}from"../../../../content/block-size.js";import{padValuesOf as z}from"../../../../content/section-padding.js";import{pictureHoverOf as H}from"../../../../../../format/lib/animation/hover.js";import{viewFocusValues as K}from"../../../../../../format/lib/content/picture-focus-rows.js";import{ImageBlockMeta as V}from"../../../../../../format/lib/document/blocks/general/ImageBlock/meta.js";const G={...V,render:e=>{const r=H(e,"ImageBlock"),o=h(e),i=h(e,B);return!o&&!i&&r.kind!=="nextImage"?w(e,e.src,e.alt,r):g(v,{type:"ImageBlock",props:e,children:(t,n,a)=>{const d=o?P(n,o):null,l=o?n?d?.alt:x(o):null,f=o?t.src:e.src,c=(l&&S(a,l))??e.alt,m=r.media?b(n,r.media):null,s=S(a,"name")??(typeof c=="string"?c:""),u=i?t.href:e.href;return w({...e,href:u},f,c,r,m&&r.media?{media:m,name:s,cover:r.media.cover}:null)}})}};function w(e,r,o,i,t=null){const{aspect:n,contained:a,grayscale:d,darken:l,darkenStyle:f,href:c,fit:m,corners:s,cornerSides:u,cornersUnit:y,editor:I}=e,k=K(e,"focal");return g(O,{src:r,alt:o,aspect:n,aspectPhone:e[R("aspect")],contained:a,grayscale:d,darken:l,darkenStyle:f,pictureHover:i,...t?{hoverLayer:t}:{},href:c,fit:m,focal:k.desktop,focalPhone:k.phone,focalTablet:k.tablet,corners:s,cornerSides:u,cornersUnit:y,pad:z(e),ownSize:F(_(e))!==null,editing:I?.isEditing===!0})}export{G as ImageBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{SITE_WIDTH_CAP as l,centredCap as d}from"../../../../../../format/lib/content/page-width.js";import
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{SITE_WIDTH_CAP as l,centredCap as d}from"../../../../../../format/lib/content/page-width.js";import n from"../../../../../components/IntroBleed.js";import{hidableText as r}from"efficient-easel/draw";import{parseIntroBleedLayout as a}from"../../../../../../format/lib/sections/intro-bleed-layout.js";import{introSizeUnitsOf as b}from"../../../../../../format/lib/content/section-type-size.js";import{phHide as i,ctaHide as m}from"../../scaffold.js";import{IntroBleedMeta as y,INTRO_PH as t}from"../../../../../../format/lib/document/blocks/general/IntroBleed/meta.js";function S(e){if(e===!1)return d(l)}const k={...y,render:e=>o(n,{eyebrow:i(e.eyebrow,t.eyebrow,e.editor),title:i(e.title,t.title,e.editor),body:i(e.body,t.body,e.editor),imageLabel:r(e.title)||t.title,imageSrc:e.imageSrc||void 0,imageSrcMobile:e.imageSrcMobile||void 0,cta:m(e.ctaText,e.ctaHref,e.editor),layout:a(e.layout),copyShareDesktop:e.copyShareDesktop,copyShareMobile:e.copyShareMobile,heightDesktop:e.heightDesktop,heightMobile:e.heightMobile,overlay:e.overlay,titleSizeDesktop:e.titleSizeDesktop,bodySizeDesktop:e.bodySizeDesktop,titleSizeMobile:e.titleSizeMobile,bodySizeMobile:e.bodySizeMobile,sizeUnits:b(e),buttonColor:e.buttonColor||void 0,buttonTextColor:e.buttonTextColor||void 0,uppercase:e.uppercase,capStyle:S(e.fullWidth)})};export{k as IntroBleedRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{pictureHoverOf as m}from"../../../../../../format/lib/animation/hover.js";import g from"../../../../../components/Split.js";import{sectionFillsHeight as d}from"../../../../../../format/lib/content/section-min-height.js";import{hidableText as f}from"efficient-easel/draw";import{phHide as t,ctaHide as c}from"../../scaffold.js";import{SplitMeta as x,SPLIT_PH as i,IMGBTN_PH as o,splitImageOverlay as u}from"../../../../../../format/lib/document/blocks/general/Split/meta.js";function y(e,n,a){const l=t(e,o.text,a);if(l!==void 0)return{text:l,href:n||"#"}}const A={...x,render:e=>r(g,{eyebrow:t(e.eyebrow,i.eyebrow,e.editor),title:t(e.title,i.title,e.editor),body:t(e.body,i.body,e.editor),imageLabel:f(e.title)||i.title,imageSrc:e.imageSrc||void 0,reverse:e.reverse,uppercase:e.uppercase,textAlign:e.textAlign,textAlignTablet:e.textAlignTablet,textAlignPhone:e.textAlignPhone,cta:c(e.ctaText,e.ctaHref,e.editor),imageButton:y(e.imageBtnText,e.imageBtnHref,e.editor),textBgSrc:e.textBgSrc||void 0,textBgTint:(typeof e.overlay=="number"?e.overlay:60)/100,imageTint:u(e.imageOverlay)/100,grayscale:e.grayscale,pictureHover:m(e,"Split"),fillHeight:d(e)})};export{A as SplitRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SECTION_WIDTH_KEYS as y}from"../../../../../format/lib/content/section-width.js";import{BLOCK_LENGTH_KEYS as C,blockLengthUnitKey as v}from"../../../content/block-size.js";import{viewStoreKeys as M}from"../../../../../format/lib/animation/views.js";import{BOX as W,INNER_BOX as I,LABEL_FACE as
|
|
1
|
+
import{storedUnit as _}from"../../../../../format/lib/content/css-length.js";import{SECTION_WIDTH_KEYS as y}from"../../../../../format/lib/content/section-width.js";import{BLOCK_LENGTH_KEYS as C,blockLengthUnitKey as v}from"../../../content/block-size.js";import{viewStoreKeys as M}from"../../../../../format/lib/animation/views.js";import{BOX as W,INNER_BOX as I,LABEL_FACE as R,TEXT as U,boxPadding as Y,fillSlot as E,token as F}from"../../../../../format/lib/document/seed-parts.js";import{ENTRANCE_STORE_KEYS as w,LEGACY_ENTRANCE_KEY as G}from"../../../animation/entrance.js";import{SCROLL_STORE_KEYS as X}from"../../../../../format/lib/animation/scroll.js";import{SECTION_PIN_KEYS as V}from"../../../../../format/lib/content/section-sticky.js";import{SECTION_CORNERS_ROW as $}from"../../../../../format/lib/content/section-corners.js";import{SECTION_BORDER_UNIT_KEYS as j}from"../../../../../format/lib/content/borders.js";import{CARD_HOVER_KEYS as O}from"../../../../../format/lib/animation/hover.js";import{COUNT_KEY_PROP as J}from"../../../../../format/lib/content/block-sources.js";import{normalizeSiteGutter as z}from"../../../../../format/lib/content/page-width.js";import{resolveSectionPadding as q}from"../../../content/section-padding.js";import{ButtonBlockMeta as Q}from"../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";import{SECTION_PAD_INNER_DEFAULTS as Z}from"../../passes/section-padding.js";import{finiteNumber as p}from"../../../../../format/lib/finite-number.js";import{convertTheme as h,hasWords as tt}from"../../../sections/section-to-box.js";import{THEME_SECTION_BG as ot}from"../../../../../format/lib/content/section-background.js";import{fillSlotOfInk as A}from"../../../../../format/lib/document/part-inks.js";import{parseHexColor as et}from"efficient-shell/format";import{convertLength as nt}from"efficient-easel/screen/lib/content/length-units";import{bandPresetIndex as it,surfacePresetIndex as rt,surfaceTwoTone as st}from"../../../../../format/lib/theme.js";import{VIEW_HIDE_KEYS as dt}from"../../../../../format/lib/content/view-hide-class.js";const s=(t,o,e,n)=>o===e?t:nt(t,o,e,n,{min:0,max:200,step:4});import{BOX as ho,DIM as fo,INNER_BOX as uo,TEXT as bo}from"../../../../../format/lib/document/seed-parts.js";const Yt={textFit:"line",textFitPhone:"wrap"},ct={...U,[J]:""},{label:Ft,href:wt,...at}=Q.defaultProps,Gt=at,Xt={buttonFillOpacity:0,buttonBorder:{width:0},buttonPaddingTop:0,buttonPaddingRight:0,buttonPaddingBottom:0,buttonPaddingLeft:0},Vt={...W,sectionAccent:0},$t={sectionAccent:-1},jt=["gridSpan","sectionHeightMode","sectionHeightValue","sectionHeightUnit","sectionHeightModeTablet","sectionHeightValueTablet","sectionHeightUnitTablet","sectionHeightModePhone","sectionHeightValuePhone","sectionHeightUnitPhone","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone","sectionAccent",$.unitKey,...j,...V,"anchor",G,...dt,...w,...X,...M(["widthFit",...C,...C.map(v)]),...Object.values(y)],c="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",Jt={sectionSurface:"read by nothing in src/ (searched 2026-10-24): a retired theme key that draws nothing today, so dropping it changes nothing",widthMode:c,fullWidth:c,pageWidth:c,backgroundWidth:c,contentWidth:c,contentMax:c},zt=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 pt(t,o){const e=p(t.sectionPaddingTop)??0,n=p(t.sectionPaddingBottom)??0,i=p(t.sectionPaddingTopTablet),r=p(t.sectionPaddingBottomTablet),l=_(t.sectionPaddingUnit),g=_(t.sectionPaddingUnitTablet),T=_(t.sectionPaddingUnitPhone),B=(m,a,x,P)=>{const d=p(m);if(d!==void 0)return d+s(P,"px",T,"mobile");const N=a===void 0?{n:x,unit:l}:{n:a,unit:g};return s(N.n,N.unit,T,"mobile")+s(P,"px",T,"mobile")},S=(m,a,x,P,d)=>a!==void 0?{[m]:a+s(d??P,"px",g,"tablet")}:d===void 0?{}:{[m]:s(x,l,g,"tablet")+s(d,"px",g,"tablet")};return{sectionPaddingTop:e+s(o.top,"px",l,"desktop"),sectionPaddingBottom:n+s(o.bottom,"px",l,"desktop"),...S("sectionPaddingTopTablet",i,e,o.top,o.topTablet),...S("sectionPaddingBottomTablet",r,n,o.bottom,o.bottomTablet),sectionPaddingTopPhone:B(t.sectionPaddingTopPhone,i,e,o.topPhone),sectionPaddingBottomPhone:B(t.sectionPaddingBottomPhone,r,n,o.bottomPhone)}}const qt=t=>[...["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopTablet","sectionPaddingBottomTablet","sectionPaddingTopPhone","sectionPaddingBottomPhone"].map(o=>[o,o,(e,n)=>pt(n,typeof t=="function"?t(n):t)[o]]),["sectionPaddingUnit","sectionPaddingUnit"],["sectionPaddingUnitTablet","sectionPaddingUnitTablet"],["sectionPaddingUnitPhone","sectionPaddingUnitPhone"]];function f(t,o){const e=q(t,Z[o]);return{sectionPaddingTop:e.top,sectionPaddingBottom:e.bottom}}const Qt=t=>[["padTop","sectionPaddingTop",(o,e)=>f(e,t).sectionPaddingTop],["padBottom","sectionPaddingBottom",(o,e)=>f(e,t).sectionPaddingBottom],["sectionPaddingTop","sectionPaddingTop",(o,e)=>f(e,t).sectionPaddingTop],["sectionPaddingBottom","sectionPaddingBottom",(o,e)=>f(e,t).sectionPaddingBottom]],lt={kind:"heading-case-upper",styles:["heading-1","heading-2","heading-3"]},Zt=t=>o=>tt(o.props[t])?[lt]:[],gt=(t,o)=>({kind:"text",key:t,role:"eyebrow",props:U,...o?{style:o}:{}}),to=t=>({kind:"group",name:"Chip",props:{...I,...E("main"),...Y(6,14)},parts:[gt(t,{color:"background",...F("label",12),weight:600,letterSpacing:.16})]}),H=t=>t.background!=="transparent",mt=(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},L={align:"right",alignPhone:"left"},Pt=(t,o,e)=>{const n=i=>mt(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}},oo=(t,o,e,n={})=>Pt(t,o,{...ct,...L,...n,_partStyles:{text:{...R,color:"labels",...e,case:R.case,...L}}}),u=(t,o)=>typeof t=="number"&&Number.isInteger(t)&&t>=0?t:h(o)?.selected??0,k="var(--site-surface-2)",K=(t,o)=>h(o)?.themes[u(t.sectionAccent??0,o)],ht=(t,o)=>(e,n)=>{if(!o?.(e,n))return E(t);const i=K(e,n)?.[t];return i?{fillColor:i}:{}},eo=(t,o)=>b(t,o)>=0,D=t=>t.startsWith("#")&&et(t)!==null,no=(t,o,e)=>{const n=t?.trim();if(n&&D(n))return{fillColor:n};const i=A(n);if(i)return E(i);const r=n===k?K(o,e):void 0;return r?{fillColor:st(r)}:{}},io=t=>{const o=t?.trim();return!o||o==="transparent"||o===ot||A(o)||o===k||D(o)?void 0:"it paints a colour that no Box Fill can hold"},b=(t,o)=>{const e=h(o)?.themes;return e&&H(t)?it(e,u(t.sectionAccent,o)):-1},ro=(t,o,e)=>{const n=b(o,e);return n>=0?n:t},so=(t,o)=>{const e=h(o)?.themes,n=e?rt(e,u(t,o)):-1;return n>=0?n:t},co=(t,o)=>{const e=b(t,o);return e>=0?{sectionAccent:e}:{}},ao=(t,o)=>H(t.props)&&b(t.props,o)<0?[{kind:"band-preset",page:u(t.props.sectionAccent,o)}]:[],po=t=>z(t.site?.siteGutter),ft=Object.fromEntries(["Top","Right","Bottom","Left","TopPhone","RightPhone","BottomPhone","LeftPhone"].map(t=>[`sectionPadding${t}`,0])),lo=t=>({top:0,right:0,bottom:0,left:0,...t}),go=(t,o,e,n=[])=>({kind:"group",name:t,keepEmpty:!0,props:(i,r)=>({...I,...ft,...ht("surface")(i,r),...typeof e=="function"?e(i,r):e}),box:[[o,"bgImage"],O.kind,O.duration,O.delay],parts:n});export{Yt as AUTO_COLUMN,ho as BOX,Gt as BUTTON,fo as DIM,Jt as DROP_COMMON,zt as DROP_SIDE_PADDING,$t as FOLLOW_THE_BOX,lt as HEADING_CASE_UPPER,uo as INNER_BOX,ft as NO_PAD,ct as NUMBER_TEXT,L as RIGHT_WORDS,jt as SAME_KEYS,Vt as SECTION_BOX,Xt as SH_LINK,bo as TEXT,ro as bandAccent,b as bandIndex,u as bandPage,co as bandProps,ao as bandWrites,ht as fillFrom,io as fillNoBoxHolds,to as filledChip,Zt as headingCaseOf,f as innerPad,Qt as innerPadKeys,oo as leadLine,Pt as leadText,lo as lineSides,mt as numberAndUnit,eo as onBandPreset,no as ownFill,go as pictureCell,K as sectionPage,po as siteGutterOf,gt as smallText,so as surfaceAccent,pt as wrapperPad,qt as wrapperPadKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as R}from"efficient-easel/draw";import{SITE_SIDE as U}from"efficient-easel/screen/lib/content/length-units";import{finiteNumber as a}from"../../../../../format/lib/finite-number.js";import{parseIntroBleedLayout as F}from"../../../../../format/lib/sections/intro-bleed-layout.js";import{fluidToken as L,token as n}from"./section-head-looks.js";import{labelStyle as C}from"../../../../../format/lib/document/seed-parts.js";import{BUTTON as g,DIM as k,DROP_COMMON as c,DROP_SIDE_PADDING as f,INNER_BOX as i,NO_PAD as p,NUMBER_TEXT as W,SAME_KEYS as u,SECTION_BOX as y,TEXT as m,fillFrom as S,lineSides as r,pictureCell as x,siteGutterOf as w,smallText as s,wrapperPad as T,wrapperPadKeys as B}from"./section-to-box-row-parts.js";const H=(e,t)=>{const o=a(e),b=a(t);return{...o===void 0?{}:{size:o},...b===void 0?{}:{sizePhone:b}}},V=e=>F(e.layout)==="stacked",M=e=>Math.min(Math.max(a(e.overlay)??60,0),100),d=e=>a(e)??100,X={textStyle:"heading-1",sizeToken:{...L("headingLarge",48,7,96).sizeToken,pxPhone:36},weight:500,lineHeight:.95,letterSpacing:-.03},j=[s("eyebrow",n("label",14)),...[!0,!1].map(e=>({kind:"text",key:"title",role:"heading",props:m,style:{...X,case:e?"upper":"none"},styleFrom:t=>H(t.titleSizeDesktop,t.titleSizeMobile),when:t=>t.uppercase===!0===e})),{kind:"text",key:"body",props:{...k,maxWidth:560},style:{textStyle:"body-1",...n("body",17,16),lineHeight:1.6,paragraphSpacing:24},styleFrom:e=>H(e.bodySizeDesktop,e.bodySizeMobile)},{kind:"group",name:"Button",props:{...i,align:"start",sectionPaddingTop:8,sectionPaddingTopPhone:8},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"primary",props:g}]}],A=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)`,G=()=>({name:"Scroll-Over Text",skip:e=>V(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",...p,placement:"left",darken:M(e),darkenStyle:"even",sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:d(e.heightDesktop),sectionHeightModePhone:"fixed",sectionHeightUnitPhone:"%",sectionHeightValuePhone:d(e.heightMobile)}),box:[...u.filter(e=>!String(typeof e=="string"?e:e[0]).startsWith("sectionHeight")),["imageSrc","bgImage"],["imageSrcMobile","bgImagePhone"],["overlay","darken",(e,t)=>M(t)],["heightDesktop","sectionHeightValue",e=>d(e)],["heightMobile","sectionHeightValuePhone",e=>d(e)]],parts:j,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",buttonColor:A("Button color"),buttonTextColor:A("Button text color"),...c}}),v={textStyle:"heading-2",...n("headingMedium",56,36),weight:400,lineHeight:1.05,letterSpacing:-.03},K={textStyle:"body-1",...n("body",16),lineHeight:1.7},O=e=>({kind:"text",key:"body",props:{...k,maxWidth:520},style:{...K,paragraphSpacing:e}}),l={top:0,bottom:0,topPhone:0,bottomPhone:0},P=(e,t)=>typeof e.sectionHeightMode=="string"&&e.sectionHeightMode!=="auto"?{}:{sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:t,sectionHeightModePhone:"auto"},Y=(e,t)=>{const o=P(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"}},I={boxShapePhone:"landscape"},_="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)",q=(e,t)=>({[e]:t,[R(e)]:t}),Z={textStyle:"heading-2",...n("headingMedium",40),weight:500,case:"none",lineHeight:1,letterSpacing:-.02},E=e=>(Array.isArray(e.stats)?e.stats:[]).filter(t=>t&&(String(t.value??"").trim()!==""||String(t.label??"").trim()!=="")),$=()=>({name:"Brand Text",boxProps:(e,t)=>({...y,...S("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...T(e,l),...P(e,100)}),box:[...u,...B(l)],parts:[{kind:"group",name:"Words",props:()=>({...i,justify:"center",gap:28,gapPhone:28,sectionBorder:r({right:1}),sectionBorderPhone:r({}),...p,sectionPaddingTop:100,sectionPaddingBottom:100,sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60,sectionPaddingRight:U}),parts:[s("eyebrow",n("label",14)),{kind:"text",key:"heading",role:"heading",props:m,style:{...v,case:"none"},mark:"accentItalic"},O(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(E(e).length,1),3),...q("sectionBorder",r({top:1})),sectionPaddingTop:28,sectionPaddingTopPhone:28}),parts:[{kind:"list",key:"stats",name:"Stat",of:E,props:{...i,gap:4,gapPhone:4},parts:[{kind:"text",key:"value",props:W,style:Z},s("label",{...n("label",13),color:"labels",letterSpacing:.2})]}]}]}]},x("Picture","imageSrc",I)],drop:{...c,grayscale:_,...f}}),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}},J=e=>e.textAlign==="center"?"center":e.textAlign==="right"?"end":"stretch",Q=e=>Math.min(Math.max(a(e.overlay)??60,0),100),D=e=>typeof e=="string"&&e.trim()!=="",ee={...g,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},N=e=>({...x("Picture","imageSrc",(t,o)=>({...D(t.imageSrc)?{darken:40,darkenStyle:"even"}:{},placement:"center",...I,sectionBorder:r(e?{left:1}:{right:1}),...z(e?"left":"right",w(o))}),[{kind:"button",key:"imageBtnText",href:"imageBtnHref",variant:"ghost",props:ee,style:{...C(13,12),letterSpacing:.18}}]),when:t=>t.reverse===!0===e}),z=(e,t)=>{const o=Math.max(60-t,0);return{sectionPaddingLeft:e==="left"?60:o,sectionPaddingRight:e==="right"?60:o}},te={kind:"group",name:"Words",props:(e,t)=>{const o=e.reverse===!0;return{...i,justify:"center",align:J(e),placement:e.textAlign==="center"?"center":e.textAlign==="right"?"right":"left",...Y(e,72),gap:24,gapPhone:24,...D(e.textBgSrc)?{darken:Q(e),darkenStyle:"even"}:{},...p,sectionPaddingTop:100,sectionPaddingBottom:100,...z(o?"right":"left",w(t)),sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60}},box:[["textBgSrc","bgImage"]],parts:[{...s("eyebrow",n("label",14)),styleFrom:h},{kind:"text",key:"title",role:"heading",props:m,style:v,styleFrom:e=>({case:e.uppercase===!0?"upper":"none",...h(e)})},{...O(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{...g,...t.align?{align:t.align}:{},...t.alignPhone?{alignPhone:t.alignPhone}:{}}}}]}]},oe=()=>({name:"Image & Text Split",boxProps:(e,t)=>({...y,...S("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...T(e,l),...P(e,72)}),box:[...u,...B(l)],parts:[N(!1),te,N(!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",grayscale:_,...c,...f}}),he={IntroBleed:G(),Manifesto:$(),Split:oe()};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{splitImageOverlay as x}from"../../../../../format/lib/document/blocks/general/Split/meta.js";import{INTRO_SIZE_UNIT_KEYS as j,introSizeUnitsOf as w}from"../../../../../format/lib/content/section-type-size.js";import{PART_UNIT_KEY_OF as T}from"../../part-styles.js";import{parseIntroBleedLayout as X}from"../../../../../format/lib/sections/intro-bleed-layout.js";import{fluidToken as G,token as n}from"./section-head-looks.js";import{labelStyle as q}from"../../../../../format/lib/document/seed-parts.js";import{BUTTON as c,DIM as B,DROP_COMMON as p,DROP_SIDE_PADDING as H,INNER_BOX as i,NO_PAD as u,NUMBER_TEXT as Z,SAME_KEYS as y,SECTION_BOX as m,TEXT as b,fillFrom as M,lineSides as a,pictureCell as O,siteGutterOf as A,smallText as s,wrapperPad as v,wrapperPadKeys as I}from"./section-to-box-row-parts.js";const _=(e,t,o)=>{const k=r(e),f=r(t),S=(V,g)=>g&&g!=="px"?{[V]:g}:{};return{...k===void 0?{}:{size:k,...S(T.size,o?.desktop)},...f===void 0?{}:{sizePhone:f,...S(T.sizePhone,o?.phone)}}},$=e=>X(e.layout)==="stacked",E=e=>Math.min(Math.max(r(e.overlay)??60,0),100),d=e=>r(e)??100,J={textStyle:"heading-1",sizeToken:{...G("headingLarge",48,7,96).sizeToken,pxPhone:36},weight:500,lineHeight:.95,letterSpacing:-.03},Q=[s("eyebrow",n("label",14)),...[!0,!1].map(e=>({kind:"text",key:"title",role:"heading",props:b,style:{...J,case:e?"upper":"none"},styleFrom:t=>{const o=w(t);return _(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=w(e);return _(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}]}],D=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)`,ee=()=>({name:"Scroll-Over Text",skip:e=>$(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=>({...m,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)}),box:[...y.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:Q,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:D("Button color"),buttonTextColor:D("Button text color"),...p}}),N={textStyle:"heading-2",...n("headingMedium",56,36),weight:400,lineHeight:1.05,letterSpacing:-.03},te={textStyle:"body-1",...n("body",16),lineHeight:1.7},z=e=>({kind:"text",key:"body",props:{...B,maxWidth:520},style:{...te,paragraphSpacing:e}}),l={top:0,bottom:0,topPhone:0,bottomPhone:0},P=(e,t)=>typeof e.sectionHeightMode=="string"&&e.sectionHeightMode!=="auto"?{}:{sectionHeightMode:"fixed",sectionHeightUnit:"%",sectionHeightValue:t,sectionHeightModePhone:"auto"},oe=(e,t)=>{const o=P(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"}},U={boxShapePhone:"landscape"},R="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)",ne=(e,t)=>({[e]:t,[K(e)]:t}),ie={textStyle:"heading-2",...n("headingMedium",40),weight:500,case:"none",lineHeight:1,letterSpacing:-.02},F=e=>(Array.isArray(e.stats)?e.stats:[]).filter(t=>t&&(String(t.value??"").trim()!==""||String(t.label??"").trim()!=="")),re=()=>({name:"Brand Text",boxProps:(e,t)=>({...m,...M("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...v(e,l),...P(e,100)}),box:[...y,...I(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:b,style:{...N,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(F(e).length,1),3),...ne("sectionBorder",a({top:1})),sectionPaddingTop:28,sectionPaddingTopPhone:28}),parts:[{kind:"list",key:"stats",name:"Stat",of:F,props:{...i,gap:4,gapPhone:4},parts:[{kind:"text",key:"value",props:Z,style:ie},s("label",{...n("label",13),color:"labels",letterSpacing:.2})]}]}]}]},O("Picture","imageSrc",U)],drop:{...p,grayscale:R,...H}}),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}},ae=e=>e.textAlign==="center"?"center":e.textAlign==="right"?"end":"stretch",se=e=>Math.min(Math.max(r(e.overlay)??60,0),100),L=e=>typeof e=="string"&&e.trim()!=="",de={...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},C=e=>({...O("Picture","imageSrc",(t,o)=>({...L(t.imageSrc)&&x(t.imageOverlay)>0?{darken:x(t.imageOverlay),darkenStyle:"even"}:{},placement:"center",...U,sectionBorder:a(e?{left:1}:{right:1}),...W(e?"left":"right",A(o))}),[{kind:"button",key:"imageBtnText",href:"imageBtnHref",variant:"ghost",props:de,style:{...q(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}},le={kind:"group",name:"Words",props:(e,t)=>{const o=e.reverse===!0;return{...i,justify:"center",align:ae(e),placement:e.textAlign==="center"?"center":e.textAlign==="right"?"right":"left",...oe(e,72),gap:24,gapPhone:24,...L(e.textBgSrc)?{darken:se(e),darkenStyle:"even"}:{},...u,sectionPaddingTop:100,sectionPaddingBottom:100,...W(o?"right":"left",A(t)),sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60}},box:[["textBgSrc","bgImage"]],parts:[{...s("eyebrow",n("label",14)),styleFrom:h},{kind:"text",key:"title",role:"heading",props:b,style:N,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}:{}}}}]}]},he=()=>({name:"Image & Text Split",boxProps:(e,t)=>({...m,...M("background")(e,t),direction:"row",share:"equal",gap:0,gapPhone:0,sectionBorder:{top:1,bottom:1},...v(e,l),...P(e,72)}),box:[...y,...I(l)],parts:[C(!1),le,C(!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:R,...p,...H}}),Se={IntroBleed:ee(),Manifesto:re(),Split:he()};export{Se as EDITORIAL_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SPLITTABLE_SECTIONS as u}from"../../../../../format/lib/sections/section-head-placement.js";import{SECTION_LABELS as b}from"../../../../../format/lib/document/section-catalog.js";import{SAME_KEYS as g,SECTION_BOX as B,innerPad as A}from"./section-to-box-row-parts.js";import{SITE_SIDE as m}from"efficient-easel/screen/lib/content/length-units";import{EDITORIAL_LINE as R,HEAD_BELOW as l,headLookOf as S,headReads as C,headTree as L}from"./section-head-looks.js";import{finiteNumber as I}from"../../../../../format/lib/finite-number.js";import{CARD_TEMPLATE_SLOT as E}from"../../../../../format/lib/content/card-template.js";import{footprintCardSeed as w}from"../../../../../format/lib/document/blocks/general/Footprint/card-seed.js";import{faqCardSeed as N,faqRunStyleKeys as k}from"../../../../../format/lib/document/blocks/general/FAQ/card-seed.js";import{PROCESS_COLUMNS_SLOT as D,processColumnSeeds as H}from"../../../../../format/lib/document/blocks/general/ProcessSteps/column-seed.js";import{BOX_SIDE_SPACE_PROP as F,BOX_SIDE_SPACE_SITE as y}from"../../../../../format/lib/content/box-side-space.js";import{INNER_BOX as j}from"../../../../../format/lib/document/seed-parts.js";import{SECTION_ACCENT_INHERIT as x}from"../../../../../format/lib/content/section-surface.js";const X=["
|
|
1
|
+
import{SPLITTABLE_SECTIONS as u}from"../../../../../format/lib/sections/section-head-placement.js";import{SECTION_LABELS as b}from"../../../../../format/lib/document/section-catalog.js";import{SAME_KEYS as g,SECTION_BOX as B,innerPad as A}from"./section-to-box-row-parts.js";import{SITE_SIDE as m}from"efficient-easel/screen/lib/content/length-units";import{EDITORIAL_LINE as R,HEAD_BELOW as l,headLookOf as S,headReads as C,headTree as L}from"./section-head-looks.js";import{finiteNumber as I}from"../../../../../format/lib/finite-number.js";import{CARD_TEMPLATE_SLOT as E}from"../../../../../format/lib/content/card-template.js";import{footprintCardSeed as w}from"../../../../../format/lib/document/blocks/general/Footprint/card-seed.js";import{faqCardSeed as N,faqRunStyleKeys as k}from"../../../../../format/lib/document/blocks/general/FAQ/card-seed.js";import{PROCESS_COLUMNS_SLOT as D,processColumnSeeds as H}from"../../../../../format/lib/document/blocks/general/ProcessSteps/column-seed.js";import{BOX_SIDE_SPACE_PROP as F,BOX_SIDE_SPACE_SITE as y}from"../../../../../format/lib/content/box-side-space.js";import{INNER_BOX as j}from"../../../../../format/lib/document/seed-parts.js";import{SECTION_ACCENT_INHERIT as x}from"../../../../../format/lib/content/section-surface.js";const X=["FAQ","Footprint","LongRead","ProcessSteps","RelatedProducts"],so=["Collections","Events","FitmentTable","GalleryB","ProductGrid","SpecTable"],s=(e,o)=>()=>({top:e,topPhone:o}),P=e=>o=>{const r=A(o,e).sectionPaddingTop;return{top:r,topPhone:r}},Y={Collections:s(120,70),Events:s(120,70),FAQ:s(120,70),GalleryB:s(120,70),FitmentTable:s(120,80),SpecTable:s(120,80),LongRead:s(120,80),RelatedProducts:s(0,0),Footprint:P("Footprint"),ProcessSteps:P("ProcessSteps"),ProductGrid:e=>({top:I(e.padTop)??120,topPhone:0})};function M(e,o={}){const r=u[e],n=Y[e];if(!r||!n)throw new Error(`section-to-box-rows-head: "${e}" has no head row or no head room`);const p=r.padKey,_=L(e),c=C(e),O=r.headRows.filter(t=>![r.num,r.title,r.description,"linkText","linkHref"].includes(t)),d={...Object.fromEntries(O.filter(t=>!(t in c)).map(t=>[t,"a head setting no Header Box part reads (lib/document/blocks/general/section-head-looks `headReads`)"])),...o.drop};return{name:b[e]??e,boxProps:(t,i)=>{const a=n(t),h=o.roomBelow?{sectionPaddingBottom:o.roomBelow.bottom,sectionPaddingBottomPhone:o.roomBelow.bottomPhone}:{},f=typeof o.boxProps=="function"?o.boxProps(t,i):o.boxProps??{},T=S(e)==="editorial"?R:{};return{...B,direction:"column",gap:l[S(e)],sectionPaddingTop:a.top,sectionPaddingTopPhone:a.topPhone,...T,...h,...f}},box:[...g,...p?[[p,"sectionPaddingTop",(t,i)=>n(i).top]]:[]],parts:[_,...(()=>{const t={...p?{[p]:0}:{},...o.coreProps},i={kind:"core",keep:"rest",...Object.keys(t).length?{props:t}:{},...o.slots?{slots:o.slots}:{}};return[o.coreBox?{kind:"group",name:o.coreBox.name,props:o.coreBox.props,parts:[i]}:i]})(),...o.partsAfter??[]],...Object.keys(c).length?{reads:c}:{},...Object.keys(d).length?{drop:d}:{},...o.pressHeading?{pressKeepsEmpty:[r.title]}:{},...o.skip?{skip:o.skip}:{}}}const Q={...j,direction:"accordion",rowStyle:"numbered"},G={sectionPaddingLeft:m,sectionPaddingRight:m},K={Footprint:{slots:{[E]:[w()]},pressHeading:!0},ProcessSteps:{slots:(e,o)=>o.press?{[D]:H().map(r=>({...r,props:{...r.props,...G}}))}:{},boxProps:{gapPhone:l.editorial}},FAQ:{slots:{[E]:[N()]},pressHeading:!0,coreBox:{name:"Questions",props:Q},coreProps:{sectionAccent:x},roomBelow:{bottom:120,bottomPhone:70},boxProps:(e,o)=>o.press?{}:{[F]:y},skip:e=>{const o=e._partStyles??{},r=k().filter(n=>o[n]!==void 0);return r.length?`held: its rows carry their own run style (_partStyles ${r.map(n=>`"${n}"`).join(", ")}), which the Box path does not draw the same`:void 0}}},no=Object.fromEntries(X.map(e=>[e,M(e,K[e])]));export{Q as FAQ_ROWS_BOX,K as HEAD_ONLY_CARD_SEEDS,no as HEAD_ONLY_SECTION_TO_BOX,X as HEAD_ONLY_TYPES,so as HOST_ROW_HEAD_TYPES,M as headOnlyRow};
|
|
@@ -3,6 +3,7 @@ import { type FontRole } from "../../../format/lib/fonts.js";
|
|
|
3
3
|
import type { PartEl } from "../../../editor/lib/document/part-anchors.js";
|
|
4
4
|
import { type PartNeedle } from "./text-parts.js";
|
|
5
5
|
import { type TextRegion } from "../../../format/lib/sections/text-regions.js";
|
|
6
|
+
import { type LengthUnit } from "efficient-easel/screen/lib/content/length-units";
|
|
6
7
|
export declare const PART_STYLES_PROP = "_partStyles";
|
|
7
8
|
export declare const PART_STYLED_ATTR = "data-sf-part-styled";
|
|
8
9
|
export declare const TEXT_STYLE_ATTR = "data-sf-text-style";
|
|
@@ -84,6 +85,11 @@ export type PartStyle = {
|
|
|
84
85
|
italic?: boolean;
|
|
85
86
|
sizePhone?: number;
|
|
86
87
|
sizeTablet?: number;
|
|
88
|
+
sizeUnit?: LengthUnit;
|
|
89
|
+
sizeUnitTablet?: LengthUnit;
|
|
90
|
+
sizeUnitPhone?: LengthUnit;
|
|
91
|
+
paragraphSpacingUnit?: LengthUnit;
|
|
92
|
+
paddingUnit?: LengthUnit;
|
|
87
93
|
alignTablet?: PartAlign;
|
|
88
94
|
alignPhone?: PartAlign;
|
|
89
95
|
};
|
|
@@ -110,6 +116,13 @@ export type StyledPartStamp = {
|
|
|
110
116
|
export declare function readPartStyles(props: Record<string, unknown> | undefined): PartStyles;
|
|
111
117
|
export declare function readPartStyle(props: Record<string, unknown> | undefined, partKey: string): PartStyle;
|
|
112
118
|
export declare function partStyleCount(props: Record<string, unknown> | undefined, partKey: string): number;
|
|
119
|
+
export declare const PART_UNIT_KEY_OF: {
|
|
120
|
+
readonly size: "sizeUnit" | "sizeUnitTablet" | "sizeUnitPhone";
|
|
121
|
+
readonly sizeTablet: "sizeUnit" | "sizeUnitTablet" | "sizeUnitPhone";
|
|
122
|
+
readonly sizePhone: "sizeUnit" | "sizeUnitTablet" | "sizeUnitPhone";
|
|
123
|
+
readonly paragraphSpacing: "paragraphSpacingUnit";
|
|
124
|
+
readonly padding: "paddingUnit";
|
|
125
|
+
};
|
|
113
126
|
export declare function propsWithPartStyleValue<K extends keyof PartStyle>(props: Record<string, unknown>, partKey: string, prop: K, value: PartStyle[K] | null): Record<string, unknown>;
|
|
114
127
|
export declare function propsWithoutPartStyle(props: Record<string, unknown>, partKey: string): Record<string, unknown>;
|
|
115
128
|
export declare function partCaseOfTransform(transform: string | null | undefined): TextStyleCase;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{textStyleCaseCss as nt,textStyleCaseOfCss as ot}from"efficient-easel/draw";import{FONT_OPTIONS as it,fontOption as rt,fontRoleOf as _,SIZE_STEP_OF_ROLE as w}from"../../../format/lib/fonts.js";import{encodePartKey as v}from"../../../format/lib/document/part-key.js";import{decodePartId as C,normalizePartText as O}from"./text-parts.js";import{partInkCss as at}from"../../../format/lib/document/part-inks.js";import{regionStyle as st}from"../../../format/lib/sections/text-regions.js";import{EDGE_PHONE_MEDIA as ft,EDGE_TABLET_MEDIA as lt,PHONE_MEDIA as ct,TABLET_MEDIA as ut,viewOverrides as pt}from"../content/view-values.js";import{plainRecord as N,propsWithPartRecord as dt,readPartRecord as xt,readPartRecords as gt}from"../../../format/lib/document/part-records.js";const k="_partStyles",ht="data-sf-part-styled",W="data-sf-text-style",St=/^(heading|body)-[1-7]$/;function S(t){return typeof t=="string"&&St.test(t)}const G={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function bt(t){if(!t)return null;for(const[e,n]of Object.entries(G))if(n===t)return e;return null}function ze(t){if(S(t.textStyle))return t.textStyle;const e=_(t.role);return e?G[e]:void 0}const mt=[400,500,600,700],A=["left","center","right","justify"],I=5,y=1e3,Tt=-5,Pt=10,At=0,Rt=64,_t=2,B={size:{min:I,max:y,step:1},sizeTablet:{min:I,max:y,step:1},sizePhone:{min:I,max:y,step:1},padding:{min:At,max:Rt,step:_t}},zt=.05,Et=.01,$t=["line","letter"],wt=.5,Ot=2.5,Nt=-1,kt=1,It=0,yt=400,Ft=[...new Set(Object.values(w))];function Ee(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 $e(t){return gt(t,k)}function K(t,e){return xt(t,k,e)}function we(t,e){return Object.values(K(t,e)).filter(n=>n!==void 0).length}function X(t,e,n){return dt(t,k,e,Mt(n).length?n:null)}function Mt(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function Lt(t){return $t.includes(t)}const R=(t,e,n)=>Math.min(n,Math.max(e,t));function Dt(t,e){if(Lt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:R(n,Tt,Pt)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?P(R(n,wt,Ot),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?P(R(n,Nt,kt),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:R(n,It,yt)}if(Object.hasOwn(B,t)){const{min:n,max:o}=B[t],i=Math.round(Number(e));return Number.isFinite(i)?R(i,n,o):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"||t==="fontRole"?_(e)?e:null:t==="sizeToken"?F(e)?e:null:t==="textStyle"?S(e)?e:null:t==="alignPhone"||t==="alignTablet"?A.includes(e)?e:null:e}const Ht=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function T(t){let e=null;const n=o=>{e??={...t},delete e[o]};for(const o of Ht){const i=t[o];i!==void 0&&!(typeof i=="number"&&Number.isFinite(i))&&n(o)}return t.align!==void 0&&!A.includes(t.align)&&n("align"),t.alignTablet!==void 0&&!A.includes(t.alignTablet)&&n("alignTablet"),t.alignPhone!==void 0&&!A.includes(t.alignPhone)&&n("alignPhone"),t.textStyle!==void 0&&!S(t.textStyle)&&n("textStyle"),t.sizeToken!==void 0&&!F(t.sizeToken)&&n("sizeToken"),t.fontRole!==void 0&&!_(t.fontRole)&&n("fontRole"),e??t}function F(t){if(!t||typeof t!="object")return!1;const{step:e,px:n,stepPhone:o,pxPhone:i,fluid:r}=t,l=c=>typeof c=="number"&&Number.isFinite(c)&&c>0,a=c=>typeof c=="string"&&Ft.includes(c);return a(e)&&l(n)&&(o===void 0||a(o))&&(i===void 0||l(i))&&(r===void 0||jt(r,n))}function jt(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 M(t){return t?.pxPhone&&F(t)?{step:t.stepPhone??t.step,px:t.pxPhone}:null}function U({step:t,px:e,fluid:n}){const o=n?`clamp(${n.minPx}px, ${n.vw}vw, ${e}px)`:`${e}px`,i=`var(--size-${t}, ${o})`;return t.startsWith("heading")?`min(${i}, var(--sf-heading-max,9999px))`:i}const vt=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Ct(t){const e=[];for(const[n,o]of vt)n===t?e.push(o):o===t&&e.push(n);return e}function Oe(t,e,n,o){const i={...K(t,e)},r=o==null?null:Dt(n,o);if(r===null)delete i[n];else{i[n]=r;for(const l of Ct(n))delete i[l]}return X(t,e,i)}function Ne(t,e){return X(t,e,{})}function Wt(t){return ot(t)??"none"}function Gt(t){return nt(t)??""}const V={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function Bt(t,e){const n=_(t.role);return n||(e?.blockDrawsStyle?null:bt(t.textStyle))}function ke(t,e){return t==="Text"&&e==="text"}const Kt={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 Xt(t){const e=w[t],n=Kt[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function Ut(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=P(Vt+t.line*zt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=P(t.letter*Et,4)),e}const Vt=1,b="--sf-part-para";function Yt(t){t=T(t);const e={};if(typeof t.sizePhone=="number"&&t.sizePhone>0)e.fontSize=`${t.sizePhone}px`;else{const o=M(t.sizeToken);if(o)e.fontSize=U(o);else{const i=E(t);i!==void 0&&(e.fontSize=`${i}px`)}}const n=t.alignPhone??z(t);return n&&(e.textAlign=n),e}function z(t){return t.alignTablet&&t.alignTablet!==t.align?t.alignTablet:void 0}function E(t){const e=pt("textSize",t.size,t.sizeTablet,void 0).tablet;return e&&e>0?e:void 0}function Zt(t){const e=T(t),n={},o=E(e);o!==void 0&&(n.fontSize=`${o}px`);const i=z(e);return i&&(n.textAlign=i),n}function Ie(t,e){if(e==="desktop")return;const n=T(t);return(e==="mobile"?z(n):void 0)??n.align}function qt(t,e){if(e==="desktop")return t;const n=T(t),o=E(n),i=z(n);if(e==="tablet"){let a=t;return o!==void 0&&(a={...a,size:o}),i&&(a={...a,align:i}),a}let r=t;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone};else{const a=M(n.sizeToken);a?r={...r,size:void 0,sizeToken:a}:o!==void 0&&(r={...r,size:o})}const l=n.alignPhone??i;return l&&(r={...r,align:l}),r}function L(t,e,n){return D(qt(t,e),$,n)}function Jt(t){return t==="mobile"?"sizePhone":t==="tablet"?"sizeTablet":"size"}function ye(t,e){if(e==="desktop")return null;const n=T(t);if(e==="mobile"){if(M(n.sizeToken))return null;const o=E(n);if(o!==void 0)return{px:o,view:"tablet"}}return typeof n.size=="number"&&n.size>0?{px:n.size,view:"desktop"}:null}function Y(t,e){const n=Jt(e);if(!Object.hasOwn(t,n))return t;const o={...t};return delete o[n],o}function Fe(t,e,n){const o=L(Y(t,e),e,n);return{fontFamily:o.fontFamily,fontSize:o.fontSize}}function D(t,e,n){t=T(t);const o=Bt(t,n),i=Ut(t),r=t.size?`${t.size}px`:t.sizeToken?U(t.sizeToken):o?Xt(o):"";return{fontFamily:t.font?ne(t.font):t.fontRole?`var(${V[t.fontRole]})`:o?`var(${V[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`:"",[b]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:Gt(t.case),textAlign:t.align??"",paddingTop:Z(t.padding),paddingBottom:Z(t.padding),color:Qt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const Qt=t=>at(t),Z=t=>t===void 0?"":`${t}px`,P=(t,e)=>Number(t.toFixed(e));function Me(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:te(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:ee(t.textAlign),case:Wt(t.textTransform),paddingPx:Number.isFinite(r)?Math.round(r):0}}function te(t){return Number.isFinite(t)?mt.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function ee(t){for(const e of A)if(e===t)return e;return t==="end"?"right":"left"}function Le(t,e){const n=q(t);if(!n)return"";for(const o of it)if(q(e(o.cssVar))===n)return o.key;return""}const q=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function ne(t){const e=rt(t);return e?`var(${e.cssVar})`:""}function De(t,e,n,o){return!e||C(e)?.nodeId!==t?null:n.find(r=>o(r.getAttribute("class")))??n[0]??null}function oe(t,e){return Object.hasOwn(t,e)?N(t[e])??{}:{}}function He(t,e,n=()=>$,o=a=>a,i=ae,r="desktop",l=()=>!1){let a=0;for(const{element:c,partId:h}of t){const x=C(h)?.propKey;if(!x)continue;const s=oe(e,o(x)),f=L(s,r,{blockDrawsStyle:l(x)});S(s.textStyle)?c.setAttribute?.(W,s.textStyle):c.removeAttribute?.(W);const d=j.some(g=>c.style[g]);let p=!1;for(const[g,u]of Object.entries(f))le(c,g,u),u&&(p=!0);if(d||j.some(g=>f[g]))for(const g of ie(c,i))for(const u of j)g.style[u]=f[u]??"";p&&(a+=1)}return a}function ie(t,e){const n=O(t.textContent??""),o=[];let i=t;for(let r=0;r<re&&e(i);r+=1){const l=i.parentElement;if(!l||O(l.textContent??"")!==n)break;o.push(l),i=l}return o}const re=8;function ae(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const $={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function se(t){if(!t||typeof t!="object")return null;const e={};return S(t.textStyle)&&(e.textStyle=t.textStyle),typeof t.size=="number"&&t.size>0&&(e.size=t.size),typeof t.sizeTablet=="number"&&t.sizeTablet>0&&(e.sizeTablet=t.sizeTablet),typeof t.sizePhone=="number"&&t.sizePhone>0&&(e.sizePhone=t.sizePhone),Object.keys(e).length?e:null}function fe(t,e){const n=se(t);if(!n)return{};const o=L(n,e);return{...o.fontFamily?{fontFamily:o.fontFamily}:{},...o.fontSize?{fontSize:o.fontSize}:{}}}function je(t){return S(t?.textStyle)||!!t?.role||typeof t?.size=="number"&&t.size>0}function ve(t,e,n){if(!t||typeof t!="object")return{};const o=st(t.role,e,w)??{},i=e.sized?fe(Y(t,n),n):{};return{...o,...i}}function Ce(t,e,n){n.fontFamily&&t.fontFamily===n.fontFamily&&(t.fontFamily=e.fontFamily),n.fontSize&&t.fontSize===n.fontSize&&(t.fontSize=e.fontSize)}function le(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===b&&(n?i.setAttribute?.(J,""):i.removeAttribute?.(J))}const J="data-sf-part-para",ce=Object.keys(D({},$)),H=new Set(["color","overflowWrap",b,"fontStyle"]),j=ce.filter(t=>!H.has(t));function We(t,e,n,o=a=>a,i=()=>!1,r=()=>null,l=[]){const a=new Map;for(const s of t){const f=v(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 c=new Map;for(const s of new Set([...Object.keys(e),...l])){if(!ue(s))continue;const f=Q(n,s,N(e[s])??{},!1,r(s));f&&c.set(s,f)}const h=s=>{const f=o(s),d=r(f);if(!Object.hasOwn(e,f)&&!d)return null;const p=N(e[f])??{};return Q(n,s,p,i(s),d)},x=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 m=h(p);m&&x.set(s,m)}for(const s of t){if(!s.keyed)continue;const f=h(v(s.key,s.row));f&&c.set(s.key,f)}return x.size||c.size?{rules:x,kindRules:c,drawn:new Set(a.keys())}:null}function Q(t,e,n,o,i){const r=D(n,$,{blockDrawsStyle:o}),l=Zt(n),a=Yt(n),c=S(n.textStyle)?n.textStyle:void 0;return!Object.values(r).some(Boolean)&&!Object.keys(l).length&&!Object.keys(a).length&&!c&&!i?null:{stamp:pe(t,e),declarations:r,...Object.keys(l).length?{tablet:l}:{},...Object.keys(a).length?{phone:a}:{},...c?{textStyle:c}:{},...i?{motion:i}:{}}}function ue(t){return t.startsWith("@")}function Ge(t,e){return t?.kindRules.get(e)??null}function pe(t,e){const n=o=>o.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function de(t){return t?{tablet:lt,phone:ft}:{tablet:ut,phone:ct}}function Be(t,{inBox:e=!1}={}){const{tablet:n,phone:o}=de(e),i=[],r=new Set,l=a=>{const{stamp:c,declarations:h}=a;if(r.has(c))return;r.add(c);const x=Object.entries(h).filter(([,u])=>u!==""),s=u=>u.map(([tt,et])=>`${ge(tt)}: ${et}`).join("; "),f=`[${ht}="${c}"]`,d=x.filter(([u])=>!H.has(u)),p=x.filter(([u])=>H.has(u));d.length&&i.push(`${f}, *:has(> ${f}) { ${s(d)} }`),p.length&&i.push(`${f} { ${s(p)} }`),h[b]&&(i.push(`*:has(> ${f}) { ${b}: ${h[b]} }`),i.push(...xe(f,`*:has(> ${f})`)));const m=Object.entries(a.tablet??{}).filter(([,u])=>u!=="");m.length&&i.push(`@media ${n} { ${f}, *:has(> ${f}) { ${s(m)} } }`);const g=Object.entries(a.phone??{}).filter(([,u])=>u!=="");g.length&&i.push(`@media ${o} { ${f}, *:has(> ${f}) { ${s(g)} } }`)};for(const a of t.rules.values())l(a);for(const a of t.kindRules.values())l(a);return i.join(`
|
|
2
|
-
`)}function
|
|
1
|
+
import{textStyleCaseCss as ce,textStyleCaseOfCss as le,viewKeyAt as K}from"efficient-easel/draw";import{FONT_OPTIONS as ue,fontOption as pe,fontRoleOf as w,SIZE_STEP_OF_ROLE as k}from"../../../format/lib/fonts.js";import{encodePartKey as B}from"../../../format/lib/document/part-key.js";import{decodePartId as X,normalizePartText as I}from"./text-parts.js";import{partInkCss as de}from"../../../format/lib/document/part-inks.js";import{regionStyle as ge}from"../../../format/lib/sections/text-regions.js";import{EDGE_PHONE_MEDIA as xe,EDGE_TABLET_MEDIA as he,PHONE_MEDIA as be,TABLET_MEDIA as Se,viewOverrides as me}from"../content/view-values.js";import{plainRecord as F,propsWithPartRecord as Te,readPartRecord as Pe,readPartRecords as ze}from"../../../format/lib/document/part-records.js";import{isLengthUnit as M}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as _,storedUnit as _e}from"../../../format/lib/content/css-length.js";const y="_partStyles",Ae="data-sf-part-styled",Y="data-sf-text-style",Re=/^(heading|body)-[1-7]$/;function S(e){return typeof e=="string"&&Re.test(e)}const V={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function Ee(e){if(!e)return null;for(const[t,n]of Object.entries(V))if(n===e)return t;return null}function Lt(e){if(S(e.textStyle))return e.textStyle;const t=w(e.role);return t?V[t]:void 0}const we=[400,500,600,700],R=["left","center","right","justify"],L=5,D=1e3,Oe=-5,Ne=10,$e=0,ke=64,Ie=2,Z={size:{min:L,max:D,step:1},sizeTablet:{min:L,max:D,step:1},sizePhone:{min:L,max:D,step:1},padding:{min:$e,max:ke,step:Ie}},Fe=.05,Me=.01,ye=["line","letter"],Le=.5,De=2.5,je=-1,He=1,Ue=0,Ce=400,ve=[...new Set(Object.values(k))];function Dt(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 jt(e){return ze(e,y)}function q(e,t){return Pe(e,y,t)}function Ht(e,t){return Object.values(q(e,t)).filter(n=>n!==void 0).length}function J(e,t,n){return Te(e,y,t,We(n).length?n:null)}function We(e){return Object.entries(e).filter(([,t])=>t!==void 0)}function Ge(e){return ye.includes(e)}const E=(e,t,n)=>Math.min(n,Math.max(t,e)),Ke=["sizeUnit","sizeUnitTablet","sizeUnitPhone"];function j(e){const t=K("sizeUnit",e),n=Ke.find(o=>o===t);if(!n)throw new Error(`a part stores no unit key ${t}`);return n}const m={size:j("desktop"),sizeTablet:j("tablet"),sizePhone:j("mobile"),paragraphSpacing:"paragraphSpacingUnit",padding:"paddingUnit"},Q=Object.values(m);function h(e,t){return _e(e[m[t]])}function Be(e,t,n={}){if(Q.includes(e))return M(t)&&t!=="px"?t:null;if(Object.hasOwn(m,e)&&h(n,e)!=="px"){const o=P(Number(t),2);return!Number.isFinite(o)||o<0||o===0&&e!=="padding"?null:o}if(Ge(e)){const o=Math.round(Number(t));return!Number.isFinite(o)||o===0?null:E(o,Oe,Ne)}if(e==="lineHeight"){const o=Number(t);return Number.isFinite(o)?P(E(o,Le,De),3):null}if(e==="letterSpacing"){const o=Number(t);return Number.isFinite(o)?P(E(o,je,He),4):null}if(e==="paragraphSpacing"){const o=Math.round(Number(t));return!Number.isFinite(o)||o<=0?null:E(o,Ue,Ce)}if(Object.hasOwn(Z,e)){const{min:o,max:i}=Z[e],r=Math.round(Number(t));return Number.isFinite(r)?E(r,o,i):null}return e==="italic"?typeof t=="boolean"?t:null:e==="role"||e==="fontRole"?w(t)?t:null:e==="sizeToken"?H(t)?t:null:e==="textStyle"?S(t)?t:null:e==="alignPhone"||e==="alignTablet"?R.includes(t)?t:null:t}const Xe=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function A(e){let t=null;const n=o=>{t??={...e},delete t[o]};for(const o of Xe){const i=e[o];i!==void 0&&!(typeof i=="number"&&Number.isFinite(i))&&n(o)}e.align!==void 0&&!R.includes(e.align)&&n("align"),e.alignTablet!==void 0&&!R.includes(e.alignTablet)&&n("alignTablet"),e.alignPhone!==void 0&&!R.includes(e.alignPhone)&&n("alignPhone"),e.textStyle!==void 0&&!S(e.textStyle)&&n("textStyle"),e.sizeToken!==void 0&&!H(e.sizeToken)&&n("sizeToken"),e.fontRole!==void 0&&!w(e.fontRole)&&n("fontRole");for(const o of Q)e[o]!==void 0&&!M(e[o])&&n(o);return t??e}function H(e){if(!e||typeof e!="object")return!1;const{step:t,px:n,stepPhone:o,pxPhone:i,fluid:r}=e,c=l=>typeof l=="number"&&Number.isFinite(l)&&l>0,a=l=>typeof l=="string"&&ve.includes(l);return a(t)&&c(n)&&(o===void 0||a(o))&&(i===void 0||c(i))&&(r===void 0||Ye(r,n))}function Ye(e,t){if(!e||typeof e!="object"||Array.isArray(e))return!1;const{minPx:n,vw:o,...i}=e;return Object.keys(i).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<t&&typeof o=="number"&&Number.isFinite(o)&&o>0&&o<=100}function U(e){return e?.pxPhone&&H(e)?{step:e.stepPhone??e.step,px:e.pxPhone}:null}function ee({step:e,px:t,fluid:n}){const o=n?`clamp(${n.minPx}px, ${n.vw}vw, ${t}px)`:`${t}px`,i=`var(--size-${e}, ${o})`;return e.startsWith("heading")?`min(${i}, var(--sf-heading-max,9999px))`:i}const Ve=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Ze(e){const t=[];for(const[n,o]of Ve)n===e?t.push(o):o===e&&t.push(n);return t}function Ut(e,t,n,o){const i={...q(e,t)},r=o==null?null:Be(n,o,i);if(r===null)delete i[n];else{i[n]=r;for(const c of Ze(n))delete i[c]}return J(e,t,i)}function Ct(e,t){return J(e,t,{})}function qe(e){return le(e)??"none"}function Je(e){return ce(e)??""}const te={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 Qe(e,t){const n=w(e.role);return n||(t?.blockDrawsStyle?null:Ee(e.textStyle))}function vt(e,t){return e==="Text"&&t==="text"}const et={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 tt(e){const t=k[e],n=et[t];return n?`var(--size-${t}, ${n})`:`var(--size-${t})`}function nt(e){const t={};return typeof e.lineHeight=="number"?t.lineHeight=e.lineHeight:e.line&&(t.lineHeight=P(ot+e.line*Fe,3)),typeof e.letterSpacing=="number"?t.letterSpacingEm=e.letterSpacing:e.letter&&(t.letterSpacingEm=P(e.letter*Me,4)),t}const ot=1,T="--sf-part-para";function it(e){e=A(e);const t={};if(typeof e.sizePhone=="number"&&e.sizePhone>0)t.fontSize=_(e.sizePhone,h(e,"sizePhone"));else{const o=U(e.sizeToken);if(o)t.fontSize=ee(o);else{const i=N(e);i!==void 0&&(t.fontSize=_(i,h(e,"sizeTablet")))}}const n=e.alignPhone??O(e);return n&&(t.textAlign=n),t}function O(e){return e.alignTablet&&e.alignTablet!==e.align?e.alignTablet:void 0}function N(e){const n=e.sizeTablet!==void 0&&h(e,"sizeTablet")!==h(e,"size")?e.sizeTablet:me("textSize",e.size,e.sizeTablet,void 0).tablet;return n&&n>0?n:void 0}function rt(e){const t=A(e),n={},o=N(t);o!==void 0&&(n.fontSize=_(o,h(t,"sizeTablet")));const i=O(t);return i&&(n.textAlign=i),n}function Wt(e,t){if(t==="desktop")return;const n=A(e);return(t==="mobile"?O(n):void 0)??n.align}function at(e,t){if(t==="desktop")return e;const n=A(e),o=N(n),i=O(n);if(t==="tablet"){let a=e;return o!==void 0&&(a={...a,size:o,sizeUnit:n[m.sizeTablet]}),i&&(a={...a,align:i}),a}let r=e;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone,sizeUnit:n[m.sizePhone]};else{const a=U(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 C(e,t,n){return v(at(e,t),$,n)}function st(e){return K("size",e)}function Gt(e,t){if(t==="desktop")return null;const n=A(e);if(t==="mobile"){if(U(n.sizeToken))return null;const o=N(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 ne(e,t){const n=st(t);if(!Object.hasOwn(e,n))return e;const o={...e};return delete o[n],o}function Kt(e,t,n){const o=C(ne(e,t),t,n);return{fontFamily:o.fontFamily,fontSize:o.fontSize}}function v(e,t,n){e=A(e);const o=Qe(e,n),i=nt(e),r=e.size?_(e.size,h(e,"size")):e.sizeToken?ee(e.sizeToken):o?tt(o):"";return{fontFamily:e.font?ut(e.font):e.fontRole?`var(${te[e.fontRole]})`:o?`var(${te[o]})`:"",fontWeight:e.weight?String(e.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]:e.paragraphSpacing?_(e.paragraphSpacing,h(e,"paragraphSpacing")):"",textTransform:Je(e.case),textAlign:e.align??"",paddingTop:oe(e.padding,h(e,"padding")),paddingBottom:oe(e.padding,h(e,"padding")),color:ft(e.color),fontStyle:e.italic===!0?"italic":e.italic===!1?"normal":""}}const ft=e=>de(e),oe=(e,t)=>e===void 0?"":_(e,t),P=(e,t)=>Number(e.toFixed(t));function Bt(e,t){const n=Number.parseFloat(e.fontSize)||16,o=Number.parseFloat(e.lineHeight),i=Number.parseFloat(e.letterSpacing),r=Number.parseFloat(e.paddingTop);return{fontKey:t,sizePx:n,weight:ct(Number.parseInt(e.fontWeight,10)),lineRatio:Number.isFinite(o)?P(o/n,3):1.2,letterEm:Number.isFinite(i)?P(i/n,4):0,align:lt(e.textAlign),case:qe(e.textTransform),paddingPx:Number.isFinite(r)?Math.round(r):0}}function ct(e){return Number.isFinite(e)?we.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t):400}function lt(e){for(const t of R)if(t===e)return t;return e==="end"?"right":"left"}function Xt(e,t){const n=ie(e);if(!n)return"";for(const o of ue)if(ie(t(o.cssVar))===n)return o.key;return""}const ie=e=>(e.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function ut(e){const t=pe(e);return t?`var(${t.cssVar})`:""}function Yt(e,t,n,o){return!t||X(t)?.nodeId!==e?null:n.find(r=>o(r.getAttribute("class")))??n[0]??null}function pt(e,t){return Object.hasOwn(e,t)?F(e[t])??{}:{}}function Vt(e,t,n=()=>$,o=a=>a,i=xt,r="desktop",c=()=>!1){let a=0;for(const{element:l,partId:b}of e){const g=X(b)?.propKey;if(!g)continue;const s=pt(t,o(g)),f=C(s,r,{blockDrawsStyle:c(g)});S(s.textStyle)?l.setAttribute?.(Y,s.textStyle):l.removeAttribute?.(Y);const d=G.some(x=>l.style[x]);let p=!1;for(const[x,u]of Object.entries(f))St(l,x,u),u&&(p=!0);if(d||G.some(x=>f[x]))for(const x of dt(l,i))for(const u of G)x.style[u]=f[u]??"";p&&(a+=1)}return a}function dt(e,t){const n=I(e.textContent??""),o=[];let i=e;for(let r=0;r<gt&&t(i);r+=1){const c=i.parentElement;if(!c||I(c.textContent??"")!==n)break;o.push(c),i=c}return o}const gt=8;function xt(e){const t=e;return typeof window>"u"||!t?.ownerDocument?!1:window.getComputedStyle(t).display==="inline"}const $={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function ht(e){if(!e||typeof e!="object")return null;const t={};S(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 o=m[n];t[n]!==void 0&&M(e[o])&&(t[o]=e[o])}return Object.keys(t).length?t:null}function bt(e,t){const n=ht(e);if(!n)return{};const o=C(n,t);return{...o.fontFamily?{fontFamily:o.fontFamily}:{},...o.fontSize?{fontSize:o.fontSize}:{}}}function Zt(e){return S(e?.textStyle)||!!e?.role||typeof e?.size=="number"&&e.size>0}function qt(e,t,n){if(!e||typeof e!="object")return{};const o=ge(e.role,t,k)??{},i=t.sized?bt(ne(e,n),n):{};return{...o,...i}}function Jt(e,t,n){n.fontFamily&&e.fontFamily===n.fontFamily&&(e.fontFamily=t.fontFamily),n.fontSize&&e.fontSize===n.fontSize&&(e.fontSize=t.fontSize)}function St(e,t,n){if(!t.startsWith("--")){e.style[t]=n;return}const o=e.style;typeof o.setProperty=="function"?n?o.setProperty(t,n):o.removeProperty?.(t):o[t]=n;const i=e;t===T&&(n?i.setAttribute?.(re,""):i.removeAttribute?.(re))}const re="data-sf-part-para",mt=Object.keys(v({},$)),W=new Set(["color","overflowWrap",T,"fontStyle"]),G=mt.filter(e=>!W.has(e));function Qt(e,t,n,o=a=>a,i=()=>!1,r=()=>null,c=[]){const a=new Map;for(const s of e){const f=B(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(t),...c])){if(!Tt(s))continue;const f=ae(n,s,F(t[s])??{},!1,r(s));f&&l.set(s,f)}const b=s=>{const f=o(s),d=r(f);if(!Object.hasOwn(t,f)&&!d)return null;const p=F(t[f])??{};return ae(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=b(p);z&&g.set(s,z)}for(const s of e){if(!s.keyed)continue;const f=b(B(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 ae(e,t,n,o,i){const r=v(n,$,{blockDrawsStyle:o}),c=rt(n),a=it(n),l=S(n.textStyle)?n.textStyle:void 0;return!Object.values(r).some(Boolean)&&!Object.keys(c).length&&!Object.keys(a).length&&!l&&!i?null:{stamp:Pt(e,t),declarations:r,...Object.keys(c).length?{tablet:c}:{},...Object.keys(a).length?{phone:a}:{},...l?{textStyle:l}:{},...i?{motion:i}:{}}}function Tt(e){return e.startsWith("@")}function en(e,t){return e?.kindRules.get(t)??null}function Pt(e,t){const n=o=>o.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(e)}~${n(t)}`}function zt(e){return e?{tablet:he,phone:xe}:{tablet:Se,phone:be}}function tn(e,{inBox:t=!1}={}){const{tablet:n,phone:o}=zt(t),i=[],r=new Set,c=a=>{const{stamp:l,declarations:b}=a;if(r.has(l))return;r.add(l);const g=Object.entries(b).filter(([,u])=>u!==""),s=u=>u.map(([se,fe])=>`${At(se)}: ${fe}`).join("; "),f=`[${Ae}="${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)} }`),b[T]&&(i.push(`*:has(> ${f}) { ${T}: ${b[T]} }`),i.push(..._t(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 e.rules.values())c(a);for(const a of e.kindRules.values())c(a);return i.join(`
|
|
2
|
+
`)}function _t(e,t){const n=`var(${T})`,o=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${e} ${o}:not(:first-child) { margin-top: ${n} }`,`${e} ${o}:not(:last-child) { margin-bottom: ${n} }`,`:is(${t}) + :is(${t}) { margin-top: ${n} }`]}const At=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function nn(e,t){if(!e)return null;const n=I(t),o=e.rules.get(n);if(o)return o;if(n.length<Rt||e.drawn.has(n))return null;let i=null;for(const[r,c]of e.rules)if(r.includes(n)){if(i&&i.stamp!==c.stamp)return null;i=c}return i}const Rt=8;export{R as PART_ALIGNS,He as PART_LETTER_EM_MAX,je as PART_LETTER_EM_MIN,Me as PART_LETTER_STEP,De as PART_LINE_HEIGHT_MAX,Le as PART_LINE_HEIGHT_MIN,Fe as PART_LINE_STEP,Z as PART_MEASURED_TRACKS,Ne as PART_NUDGE_MAX,Oe as PART_NUDGE_MIN,ke as PART_PADDING_MAX,$e as PART_PADDING_MIN,Ie as PART_PADDING_STEP,re as PART_PARAGRAPH_ATTR,Ce as PART_PARAGRAPH_MAX,Ue as PART_PARAGRAPH_MIN,T as PART_PARAGRAPH_VAR,ye as PART_RELATIVE_PROPS,D as PART_SIZE_MAX,L as PART_SIZE_MIN,ve as PART_SIZE_STEPS,Ae as PART_STYLED_ATTR,y as PART_STYLES_PROP,mt as PART_STYLE_PROPERTIES,m as PART_UNIT_KEY_OF,we as PART_WEIGHTS,G as SHARED_PART_PROPERTIES,V as STYLE_ID_OF_ROLE,Y as TEXT_STYLE_ATTR,Vt as applyPartStyles,vt as blockDrawsTextStyle,Lt as followedStyleOf,Tt as isPartKindKey,S as isTextStyleId,_t as paragraphRules,Wt as partAlignFollowed,C as partCanvasDeclarations,qe as partCaseOfTransform,Je as partCaseTransform,Xt as partFontKeyOf,Dt as partLiftRules,it as partPhoneDeclarations,en as partRuleForKind,nn as partRuleForText,Kt as partShownDeclarations,st as partSizeBoxOf,Gt as partSizeFollowed,nt as partSpacingOf,Bt as partStyleBase,Ht as partStyleCount,tn as partStyleCss,v as partStyleDeclarations,at as partStyleForScreen,Yt as partStyleSource,ne as partStyleWithoutSizeBox,rt as partTabletDeclarations,Ut as propsWithPartStyleValue,Ct as propsWithoutPartStyle,Qt as publishedPartStyles,q as readPartStyle,jt as readPartStyles,bt as regionCanvasDeclarations,Jt as regionCanvasRestore,Zt as regionHasOwnLook,ht as regionSheetStyle,qt as regionShownDeclarations,pt as storedPartStyle,zt as viewMediaOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s}from"react/jsx-runtime";import{HideTaker as d}from"../../../components/ViewHideRoot.js";import{SECTION_BORDER_CLASS as c,sectionBorderStyle as a}from"../../../../format/lib/content/borders.js";import{PAD_ON_ROOT as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{HideTaker as d}from"../../../components/ViewHideRoot.js";import{SECTION_BORDER_CLASS as c,sectionBorderStyle as a,sectionBorderUnitsOf as l}from"../../../../format/lib/content/borders.js";import{PAD_ON_ROOT as B}from"./section-padding.js";const S={name:"sectionBorder",applies:(r,o,n)=>o.isSection(r)&&!!n&&typeof n.render=="function",draw(r,o){if(B.has(o))return;const n=r.render;r.render=e=>{const t=a(e.sectionBorder,e.sectionBorderPhone,e.sectionBorderTablet,l(e)),i=n(e);return t?s(d,{className:c,style:{display:"contents",...t},children:i}):i}}};export{S as sectionBorder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{HideTaker as i}from"../../../components/ViewHideRoot.js";import{cardCornerStyle as d}from"../../../../format/lib/content/card-corners.js";import{sectionCornerStyle as c}from"../../../../format/lib/content/section-corners.js";const S={name:"sectionCorners",applies:(r,n,e)=>n.isSection(r)&&!!e&&typeof e.render=="function",panel(r,n,e){r.fields={...r.fields,...e.sectionShapeFields()}},draw(r){const n=r.render;r.render=e=>{const s=c(e.sectionCorners,e.sectionCornerSides,e.sectionCornersUnit),t=n(e);return s?o(i,{className:"sf-section-corners",style:{display:"contents",...s},children:t}):t}}},a=["CollectionCard"],m={name:"cardCorners",applies:(r,n,e)=>a.includes(r)&&!!e&&typeof e.render=="function",panel(r,n,e){r.fields={...r.fields,...e.cardShapeFields()}},draw(r){const n=r.render;r.render=e=>{const s=d(e.cardCorners,e.cardCornerSides,e.cardCornersUnit),t=n(e);return s?o(i,{className:"sf-card-corners",style:{display:"contents",...s},children:t}):t}}};export{a as CARD_BLOCK_KEYS,m as cardCorners,S as sectionCorners};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{catalogueLabel as e}from"../../../../format/lib/document/passes/catalogue-labels.js";import{blockSize as n}from"./block-size.js";import{boxJoin as
|
|
1
|
+
import{catalogueLabel as e}from"../../../../format/lib/document/passes/catalogue-labels.js";import{blockSize as n}from"./block-size.js";import{boxJoin as s}from"./box-join.js";import{cardTemplateOnInsert as p}from"../../../../format/lib/document/passes/card-template-on-insert.js";import{cellWidth as c}from"./cell-width.js";import{clickableParts as f}from"./clickable-parts.js";import{cardCorners as l,sectionCorners as a}from"./corners.js";import{emptyHeadings as d}from"../../../../format/lib/document/passes/empty-headings.js";import{showWhenRows as h}from"../../../../format/lib/document/passes/show-when-rows.js";import{headBox as S,headCore as u}from"./head-core.js";import{hiddenNodes as b}from"./hidden-nodes.js";import{showFor as g}from"./show-for.js";import{mediaValues as w}from"../../../../format/lib/document/passes/media-values.js";import{sectionAnchor as k}from"./section-anchor.js";import{blockEntrance as A,sectionAnimation as P}from"./section-animation.js";import{blockScroll as C,sectionScroll as B}from"./scroll-effect.js";import{sectionHeight as W,sectionHeightFillRoot as y}from"./section-height.js";import{cardSticky as G,sectionSticky as H}from"./section-sticky.js";import{sectionBorder as R}from"./borders.js";import{blockPadding as T,sectionPadding as x}from"./section-padding.js";import{sectionTheme as E,slideTheme as F}from"./section-theme.js";import{buttonAlignInRow as I,containedWidth as L,sectionWidth as O}from"./section-width.js";import{blockGroups as z,sectionGroups as D}from"../../../../format/lib/document/passes/settings-groups.js";import{slotsStartAfresh as J}from"./slots-start-afresh.js";import{openSlotDisallow as K,sectionGroupAllow as N}from"../../../../format/lib/document/passes/slot-rules.js";import{registryPassContext as go}from"../../../../format/lib/document/passes/registry-context.js";const V=[J,w,u,N,K,x,a,R,l,T,A,C,c,O,L,I,W,k,E,P,B,H,G,s,F,n,D,z,h,d,f,S,g,y,b,e,p];function So(r,m,o){const t=m;for(const i of V)i.applies(r,o,t)&&(o.inspector&&i.panel?.(t,r,o.inspector,o),i.draw?.(t,r,o));return m}export{V as BLOCK_PASSES,So as applyBlockPasses,go as registryPassContext};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
1
|
+
import type { BlockPass, PassResolveFields } from "../../../../format/lib/document/passes/types.js";
|
|
2
|
+
export declare function heightFillOffered(data: {
|
|
3
|
+
props?: Record<string, unknown>;
|
|
4
|
+
}, params: Parameters<PassResolveFields>[1]): boolean;
|
|
2
5
|
export declare const sectionHeight: BlockPass;
|
|
6
|
+
export declare const sectionHeightFillRoot: BlockPass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{createElement as H}from"react";import{SECTION_MIN_HEIGHT_EXCLUDED as p,sectionHeightFillClass as F,sectionHeightFillViews as w,sectionHeightWrap as E}from"../../../../format/lib/content/section-min-height.js";import{CellWrap as x}from"../../../components/InBoxContext.js";import{HeightFillContext as C,heightFillClaim as _}from"../../../components/ViewHideRoot.js";import{drawsCopiesInTheBox as g}from"../../../../format/lib/content/copies-in-box.js";import{BOX_TYPE as M}from"../../../../format/lib/document/container-blocks.js";import{findParentNode as y}from"../../../../format/lib/document/passes/document-position.js";const c=["sectionHeightMode","sectionHeightModeTablet","sectionHeightModePhone"];function N(e,o){const i=e.props??{};return c.some(r=>i[r]==="fill")?!0:("parent"in o?o.parent:y(o.appState,i.id))?.type===M}const P={name:"sectionHeight",applies:(e,o,i)=>o.isSection(e)&&!p.has(e)&&!!i&&typeof i.render=="function",panel(e,o,i){const t=i.heightFields;e.fields={...e.fields,...t()};const r=t({fill:!0}),h=new WeakMap,u=s=>{if(!s||!c.some(l=>l in s))return s;let n=h.get(s);if(!n){n={...s};for(const l of c)l in n&&(n[l]=r[l]);h.set(s,n)}return n},a=e.resolveFields;e.resolveFields=(s,n)=>{const l=a?a(s,n):n.fields,f=d=>N(s??{},n)?u(d??n.fields):d;return l instanceof Promise?l.then(f):f(l)}},draw(e,o){const i=e.render;e.render=t=>{if(g(o,t))return i(t);const r=E(t);return r?m(x,{className:r.className,style:r.style,children:i(t)}):i(t)}}},W={name:"sectionHeightFillRoot",applies:P.applies,draw(e,o){const i=e.render;e.render=t=>{const r=g(o,t)?null:_(F(t),w(t).join(" "));return H(C.Provider,{value:r},i(t))}}};export{N as heightFillOffered,P as sectionHeight,W as sectionHeightFillRoot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import{HideTaker as u}from"../../../components/ViewHideRoot.js";import{INTRO_EDGE_CLASS as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{HideTaker as u}from"../../../components/ViewHideRoot.js";import{INTRO_EDGE_CLASS as j}from"../../../../format/lib/sections/intro-bleed-layout.js";import{cssLengthOf as B}from"../../../../format/lib/content/css-length.js";import{resolveContainerDirection as X}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as q,HERO_CHROME_CAP_VAR as z,HERO_CHROME_INSET_VAR as J,FULL_SECTION_WIDTH as Q,SITE_WIDTH_CAP as _,centredCap as G,heroBackgroundTokens as Z}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as v,SECTION_WIDTH_KEYS as D,hasOwnSectionWidth as tt,hasWidthFamily as nt,resolveWidth as F,siteWidthsOf as et}from"../../../../format/lib/content/section-width.js";import{boxCardProps as ot}from"../../../../format/lib/content/box-background.js";import{cardCopyPlace as it}from"../../../../format/lib/content/card-template.js";import{BOX_GUTTER_KEY as ct,boxGutterOf as rt,boxPlaceOf as lt,boxRunsEdgeToEdge as dt,isFrameContainer as C,ownNodeWidth as ut,sectionGroundAnswer as st,siteDrawsGutter as at}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as ft}from"../../../../format/lib/document/editor-site-widths.js";import{GroundStopsAt as H,NestedBoxChoice as ht,SectionGroupChoice as _t,SectionGroupWidthsProvider as Nt,SectionRootChoice as wt,SplitBandAndColumn as M}from"../../../components/SiteGutterFrame.js";import{FRAME as L}from"../../../components/BlockFrame.js";import{sectionFillPassClass as P}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as Ct}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as O,withRowsShownWhen as T}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as Ot,heldByANode as Tt,isNestedNode as Et,NOT_HELD_BY_A_NODE as k}from"../../../../format/lib/document/passes/document-position.js";const N="--sf-sw-site",St="--sf-sw-content",mt="--sf-bg-cap",pt="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",R=({own:t,content:n,siteContent:e})=>t===!0&&n==="full"&&e!=="full",y="contents view-wide:[--sf-site-width:100vw]",A=({held:t},n,e)=>t?e:l(u,{className:n,children:e}),xt=`contents view-wide:[--sf-site-width:100vw] ${j} view-wide:[--sf-site-gutter:var(--intro-edge)]`,W=(t,n,e)=>n==="content"?`min(${B(t,e)},var(${N}))`:B(t,e);function E({content:t,contentMax:n,contentMaxUnit:e},o){return t==="full"?o!=="content"?Q:null:n===null?null:W(n,o,e)}function S(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:_},children:l(u,{className:pt,style:{[St]:n},children:t})})}const Rt="--sf-content-cap",At="contents max-view-wide:[--sf-content-cap:none]";function Wt({content:t,contentMax:n,contentMaxUnit:e},o){return t==="full"?null:n!==null?W(n,o,e):o==="content"?null:`var(${N})`}function It(t,n){return n===null?t:l(u,{className:"contents",style:{[N]:_},children:l(u,{className:At,style:{[Rt]:n},children:t})})}const U=`var(${N},${_})`,f=(t,n,e="")=>t==="content"?l(u,{className:e||void 0,style:G(_),children:l(H,{ground:U,children:n})}):n;function V(t,n,e,o,i){if(R(e))return f(o,A(e,y,l(M,{children:t({...n,contained:!0})})),i);if(e.content==="full")return f(o,t({...n,contained:!1}),i);const c=E(e,o);return o==="content"&&c===null&&!e.own?t({...n,contained:!0}):f(o,S(l(M,{children:t({...n,contained:!0})}),c),i)}function $(t,n,e,o){if(e==="hero"){const r=S(t(n),E(o,o.band));return o.band==="full"?l(u,{style:{[q]:"none",[J]:"initial",[z]:"initial"},children:r}):o.band==="content"?l(u,{style:Z(!0),children:r}):r}const i=o.band??"full",c=P(n);if(e==="rawMarkup"){if(o.content==="full")return f(i,t(n),c);const r=o.contentMax===null?_:W(o.contentMax,i,o.contentMaxUnit);return l(u,{className:"contents",style:{[N]:_},children:f(i,l(u,{className:c||void 0,style:G(r),children:t(n)}),c)})}if(e==="scrollOver"){const r=o.content==="full",d=R(o)?A(o,xt,t({...n,fullWidth:!1})):S(t({...n,fullWidth:r}),r?null:E(o,i));return i==="content"?l(u,{className:"contents",style:{[mt]:_},children:d}):d}switch(e){case"both":return f(i,It(t(n),Wt(o,i)),c);case"contained":return V(t,n,o,i,c);case"contentColumn":case"contentFull":case"productGrid":{const r=R(o),d=o.content==="full"&&!r?"full":"page",s=r?A(o,y,t({...n,widthMode:d})):S(t({...n,widthMode:d}),o.content==="full"?null:E(o,i));return e==="productGrid"&&!o.own?i==="content"?l(u,{className:c?`${L} ${c}`:L,children:s}):s:f(i,s,c)}default:return f(i,S(t(n),E(o,i)),c)}}function bt(t,n){const e=v[n],o=t.render;t.render=i=>{const c=et(i),r={band:c.background,content:c.content??"content",contentMax:null},d=()=>e==="rawMarkup"?o(i):l(_t,{draw:a=>a?.background==="content"?l(H,{ground:U,children:s(a)}):s(a)}),s=a=>{const w=a?{...r,band:a.background==="content"?r.band:a.background??r.band,content:a.content??r.content,own:a.background==="full"||a.content!==null,held:!0,siteContent:r.content}:r,x=$(o,i,e,w);if(!C(n))return x;const b=rt(i),g=b===void 0?w.content:b?"content":"full";return g===w.content?x:l(ht,{atTop:x,nested:V(o,i,{...w,content:g,own:!1},w.band??"full",P(i))})},h=ut(n,i);if(!tt(h))return d();const m=e==="rawMarkup",I=st(n,i),K=h.content??(m?"full":r.content),p={band:I,content:I==="content"?"content":K,contentMax:h.contentMax,contentMaxUnit:h.contentMaxUnit,own:!m,siteContent:r.content};return l(wt,{own:()=>l(Nt,{value:{background:p.band,content:p.content},children:$(o,i,e,p)}),followed:d})}}const gt={all:[k,{not:{context:"runsEdgeToEdge",is:!0}}]},nn={name:"sectionWidth",applies:(t,n,e)=>nt(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.sectionOwnWidthFields({drawsFullOnItsOwn:v[n]==="rawMarkup"}),i=C(n)?e.boxGutterFields():{},c={...t.fields,...i,...o},r=C(n)?Y(n,t,c,[ct]):c;O(t,{heldByANode:Tt}),C(n)&&O(t,{runsEdgeToEdge:(d,s)=>dt(ot(d.props??{},it(s.appState,d.props?.id)?.inCopy!==!1))}),t.fields=T(r,[D.background,D.content],C(n)?gt:k)},draw(t,n){bt(t,n)}};function Bt(t,n){if(!t||!("widthMode"in t))return t;const e={...t},o=e.widthMode;return o&&(e.widthMode={...o,currentValue:n.mode,inherited:n.inherited}),e}const Gt=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),en={name:"containedWidth",applies:(t,n,e)=>Gt.has(t)&&!!e&&typeof e.render=="function",panel(t,n,e){const o=e.widthField;t.fields=Y(n,t,{...t.fields,...o("page")});const i=t.resolveFields;t.resolveFields=(c,r)=>{const d=i?i(c,r):r.fields,s=F(c?.props??{},"page"),h=m=>Bt(m,s);return d&&typeof d.then=="function"?d.then(h):h(d)}},draw(t){const n=t.render;t.render=e=>{const{mode:o}=F(e,"page");return n({...e,contained:o!=="full"})}}},vt={not:{context:"inHeroGroupRow",is:!0}},on={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const n=t;n.fields=T(n.fields??{},["align"],vt),O(n,{inHeroGroupRow:(e,o)=>{const i=Ot(o.appState,e.props?.id);return!!i&&i.type==="HeroGroup"&&X("HeroGroup",i.props?.direction)==="row"}})}};function Dt(t){return Object.values(t).some(n=>!!n&&typeof n=="object"&&n.type==="slot")}const Ft={any:[]},Ht={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},Mt={not:{context:"widthCappedByParent",is:!0}};function Y(t,n,e,o=["widthMode"]){if(t==="ButtonBlock")return T(e,["_gWidth",...o],Ft);if(Dt(e)){const i=(c,r)=>lt(r.appState?.data?.content,c.props?.id,at(ft()));return O(n,{outsideBox:(c,r)=>i(c,r)?.inBox!==!0,insideSiteGutter:(c,r)=>i(c,r)?.insideGutter}),T(e,o,Ht)}return O(n,{widthCappedByParent:(i,c)=>"parent"in c?Ct(c.parent):Et({props:i.props??{}},c)}),T(e,o,Mt)}export{mt as SECTION_BACKGROUND_VAR,At as SECTION_CONTENT_CAP_CLASS,Rt as SECTION_CONTENT_CAP_VAR,pt as SECTION_CONTENT_CLASS,St as SECTION_CONTENT_VAR,N as SITE_CONTENT_VAR,on as buttonAlignInRow,en as containedWidth,nn as sectionWidth,Bt as widthModeFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readHidable as J}from"efficient-easel/draw";import{BOX_TYPE as U,CONTAINER_BLOCKS_SLOT as Z}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as ee,labelTextSeed as te}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as oe,parseSectionHeadPlacement as ne}from"../../../format/lib/sections/section-head-placement.js";import{accentItalicRuns as se}from"../../../format/lib/markup.js";import{seedNodes as re}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ie}from"../../../format/lib/locations-grid.js";import{normalizeTheme as D}from"../../../format/lib/theme.js";const v=U,E=Z;function Ee(t){if(t.theme)return D(t.theme);const o=t.site?.themePresets;return o?D({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ae(t,o){return o===0?`${t}~box`:`${t}~box-${o+1}`}const A={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box), and its Scrolling Bar is a Box in its strip slot (Hero › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function _e(t){for(const[o,s]of Object.entries(t)){if(o in A&&A[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=s}}function je(t){return A[t]}const z=new Set(["id"]),T={},L=[],ce=["ProductGrid","Events","ContactRouting","ReviewForm","AppointmentBooking","Reviews","CheckoutCTA","AlloyWheelsListing"],de=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ","ProcessSteps",...ce,"Stats","Logos","PaymentBadges","PaymentLogosBlock","FitmentFinder","DocMasthead","DocTabs","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Countdown","FeaturedCover","SectionHeader","TitleWithButtons","Prose","ParagraphsA","Banner","Cards"];function Ie(t){for(const[o,s]of Object.entries(t)){if(o in T&&T[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=s}}function Ne(t){return T[t]}function Ae(){return Object.keys(T)}function fe(t){return t in T&&L.includes(t)}function Re(t,o=de){return t in T&&(o.includes(t)||fe(t))}function Ce(t){const o=oe[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const s=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&s.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&s.push({kind:"button",key:"linkText",href:"linkHref"}),s}const F=t=>J(t),He=t=>F(t).text.trim()!=="";function le(t){if(t.includes("=="))return t;const o=t.indexOf("/"),s=o===-1?t:t.slice(0,o),r=s.trim();if(!r)return t;const c=s.indexOf(r);return`${s.slice(0,c)}==${r}==${s.slice(c+r.length)}${o===-1?"":t.slice(o)}`}const pe=t=>t==="heading"?ee():t==="eyebrow"?te():{};function ue(t,o,s,r){const a={...t._partStyles?.text??{},...o??{},...s??{}};return(r==="center"||r==="right")&&a.align===void 0&&(a.align=r),Object.keys(a).length?{_partStyles:{text:a}}:{}}function he(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const s=o[t.key];return{variant:typeof s=="string"&&Object.hasOwn(t.map,s)?t.map[s]:t.fallback}}function G(t,o,s,r,c={}){const a={...o};for(const u of t){const[m,S,_]=typeof u=="string"?[u,u,void 0]:u;if(s[m]===void 0)continue;const j=_?_(s[m],s,c):s[m];j===void 0?delete a[S]:a[S]=j,r(m,S,j===void 0)}return a}function ye(t){const o=new Set([...z,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),s=c=>{for(const a of c??[])o.add(typeof a=="string"?a:a[0])},r=c=>{for(const a of c)switch(a.kind){case"text":case"image":o.add(a.key),a.kind==="image"&&a.alt&&o.add(a.alt);break;case"button":o.add(a.key),o.add(a.href),typeof a.variant=="object"&&o.add(a.variant.key);break;case"list":o.add(a.key);break;case"group":case"block":s(a.box),r(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(u=>o.add(u)),Object.keys(a.rename??{}).forEach(u=>o.add(u)),a.derive?.reads.forEach(u=>o.add(u)),typeof a.slots!="function")for(const u of Object.values(a.slots??{}))for(const m of u)"kind"in m&&o.add(m.key);break}};for(const c of[t,...t.also??[]])s(c.box),r(c.parts);return o}const me=t=>ne(t.headPlacement)==="own-box";function ke(t){return me(t)?"its head sits in a Box of its own above it (own-box): the row draws the head inline":void 0}function be(t,o){const s=t[o];return Array.isArray(s)&&s.some(c=>!!c&&typeof c=="object"&&typeof c.type=="string")?"already on the Box path: its items draw from a filled card template":void 0}function ge(t){const o=new Set,s=r=>{for(const c of r)if(c.kind==="group"||c.kind==="block")s(c.parts??[]);else if(c.kind==="core"&&c.slots&&typeof c.slots!="function")for(const[a,u]of Object.entries(c.slots))u.length>0&&u.every(m=>!("kind"in m))&&o.add(a)};for(const r of[t,...t.also??[]])s(r.parts);return[...o]}function xe(t,o,s){if(!s.press)for(const r of ge(t)){const c=be(o,r);if(c!==void 0)return c}}function Y(t,o,s={}){const r=t.props,c=(o.ownBoxConverts?void 0:ke(r))??xe(o,r,s)??o.skip?.(r);if(c!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],skipped:c};const a=String(r.id??t.type),u=[],m=[],S=new Set,_=(n,i)=>{u.push({key:n,home:i}),S.add(n)},j=r._partStyles??{},R=ye(o);let M=0;const w=(n,i)=>({type:n,props:{...i,id:`${a}~${n}-${++M}`}}),W=(n,i,b,y,g,l,$)=>{if(g){for(const d of n??[]){const h=typeof d=="string"?d:d[0];b[h]!==void 0&&$(h,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof i=="function"?i(r,s):i??{};return G(n??[],e,b,(d,h,f)=>$(d,f?`nothing — the old value draws nothing (${y}: no ${h})`:`${l}${y}: ${h}`),s)},V=n=>re(n,i=>`${a}~${i}-${++M}`),X=(n,i,b)=>{const y=n.of?n.of(i):Array.isArray(i[n.key])?i[n.key]:[],g=typeof n.props=="function"?n.props(r,s):n.props??{},l=y.map((f,x)=>{const p=f??{},k=n.item?.(p,x,r)??{},B=I(k.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${x+1}: `);return n.flat?k.props?B.map(P=>({...P,props:{...P.props,...k.props,id:P.props.id}})):B:[w(v,{name:`${n.name} ${x+1}`,...g,...k.props??{},[E]:B})]});if(n.groups){const f=n.groups;return b(n.key,y.length?`one Box per item (${y.length}), in a Box per group`:"nothing — the list is empty"),ie(y.map(x=>x??{}),f.of,f.of).map((x,p)=>{const k=x.items.map(O=>O.item),B=f.parts?I(f.parts,f.head?.(k,r)??{},!1,`group ${p+1}: `):[],P=x.items.map(O=>l[O.index]),C=f.perRow?.(k.length,r),N=Number.isInteger(C)&&C>=1?C:1,H=[];if(f.perRow&&N<P.length)for(let O=0;O*N<P.length;O++)H.push(P.slice(O*N,(O+1)*N).flat());return w(v,{name:`${f.name} ${p+1}`,...f.props??{},[E]:[...B,w(v,{name:`${f.itemsName} ${p+1}`,...f.itemsProps?.(k.length,r)??{},[E]:H.length?H.map((O,q)=>w(v,{name:`${f.rowName??`${f.itemsName} row`} ${q+1}`,...f.rowProps??{},[E]:O})):P.flat()})]})})}const $=n.perRow?.(r),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(y.length?n.flat?`each item's parts (${y.length} items), in order`:`one Box per item (${y.length}), its parts inside`:"nothing — the list is empty")+(e&&y.length?`, in rows of ${e}`:"")),!e)return l.flat();const d=typeof n.rowProps=="function"?n.rowProps(r,s):n.rowProps??{},h=[];for(let f=0;f*e<l.length;f++){const x=l.slice(f*e,(f+1)*e).flat(),p=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;h.push(w(v,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...d,[E]:[...x,...Array.from({length:p},(k,B)=>w(v,{name:`Empty ${B+1}`,...n.rowFiller,[E]:[]}))]}))}return h},I=(n,i,b,y)=>{const g=[],l=(e,d)=>b?_(e,d):void 0,$=e=>b?j[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:i)))switch(e.kind){case"text":{const d=F(i[e.key]);if(!d.text.trim()&&!(b&&s.press&&o.pressKeepsEmpty?.includes(e.key))){l(e.key,"nothing — empty words draw nothing, so no block");break}const h=pe(e.role??"body"),{_partStyles:f,...x}=h,p=ue(h,e.styleFrom?{...e.style,...e.styleFrom(r,s)}:e.style,$(e.key),e.props?.align);g.push(w("Text",{text:e.mark==="accentLead"?le(d.text):e.mark==="accentItalic"?se(d.text):d.text,...x,...e.props??{},...p,...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Text block: its words${d.hidden?", hidden":""}`);break}case"button":{const d=F(i[e.key]);if(!d.text.trim()){l(e.key,"nothing — no words, no button"),l(e.href,"nothing — no button to link"),typeof e.variant=="object"&&l(e.variant.key,"nothing — no button to style");break}const h=typeof i[e.href]=="string"&&i[e.href]?i[e.href]:"#",f={...e.style??{},...$(e.key)??{}};g.push(w("ButtonBlock",{label:d.text,href:h,...typeof e.props=="function"?e.props(i,s):e.props??{},...he(e.variant,i),...Object.keys(f).length?{_partStyles:{label:f}}:{},...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Button block: its words`),l(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${y}Button block: its Style`);break}case"image":{const d=i[e.key];if(typeof d!="string"||!d){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const h=e.alt&&typeof i[e.alt]=="string"?i[e.alt]:"";g.push(w("ImageBlock",{src:d,alt:h,...e.props??{}})),l(e.key,`${y}Image block: its picture`),e.alt&&l(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...X(e,i,l));break}case"group":{const d=I(e.parts,i,b,y),h=W(e.box,e.props,i,`${e.name} Box`,!d.length&&!e.keepEmpty,y,l);h&&g.push(w(v,{name:e.name,...h,[E]:d}));break}case"block":{const d=e.parts?I(e.parts,i,b,y):[],h=W(e.box,e.props,i,`${e.type} block`,!!e.parts&&!d.length&&!e.keepEmpty,y,l);h&&g.push(w(e.type,{...h,...e.slot?{[e.slot]:d}:{}}));break}case"core":{const d=e.as??t.type,h={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(i).filter(p=>!R.has(p)&&!(p in h)):e.keep;for(const p of f)i[p]!==void 0&&(h[p]=i[p],l(p,`the ${d} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))i[k]!==void 0&&!R.has(k)&&l(k,`nothing — the ${d} block inside the Box has the row's own value`);i.headPlacement!==void 0&&l("headPlacement",`the ${d} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(j).filter(([k])=>!R.has(k)));Object.keys(p).length&&(h._partStyles=p)}for(const[p,k]of Object.entries(e.rename??{}))i[p]!==void 0&&(h[k]=i[p],l(p,`the ${d} block inside the Box: ${k}`));if(e.derive){Object.assign(h,e.derive.props(i,s));for(const p of e.derive.reads)i[p]!==void 0&&l(p,`the ${d} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(i,s):e.slots??{};for(const[p,k]of Object.entries(x))h[p]=k.flatMap(B=>"kind"in B?X(B,i,l):V([B]));g.push(w(d,h));break}}return g},Q=(n,i)=>{const b=i===0?"Box":`${n.name} Box`,y=I(n.parts,r,!0,i===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,s):n.boxProps??{},l=G(n.box??[],g,r,($,e,d)=>_($,d?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),s);return{type:v,props:{name:n.name,...l,[E]:y,id:ae(a,i)}}},K=[o,...o.also??[]].map(Q);r._partStyles!==void 0&&_("_partStyles","each old part's style moved to its new part");for(const[n,i]of Object.entries(o.reads??{}))r[n]!==void 0&&_(n,i);for(const[n,i]of Object.entries(o.drop??{}))n in r&&(m.push({key:n,why:i}),S.add(n));for(const n of Object.keys(r))z.has(n)||S.has(n)||m.push({key:n,why:"not in the row — not carried"});return{node:K[0],nodes:K,carried:u,dropped:m,siteWrites:[...o.site?.(t,s)??[]]}}function Le(t,o=L,s={}){const r=t.content;if(!Array.isArray(r))return t;let c=!1;const a=r.flatMap(u=>{const m=u&&typeof u.type=="string"&&o.includes(u.type)?T[u.type]:void 0;if(!m)return[u];const S=Y(u,m,s);return S.skipped!==void 0?[u]:(c=!0,S.nodes)});return c?{...t,content:a}:t}function Fe(t,o=L,s={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((c,a)=>{const u=c&&typeof c.type=="string"&&o.includes(c.type)?T[c.type]:void 0;if(!u)return;const m=Y(c,u,s);m.skipped===void 0&&r.push({index:a,node:m.node,nodes:m.nodes})}),r}export{ce as HOST_PRESS_TYPES,E as SECTION_BOX_SLOT,v as SECTION_BOX_TYPE,L as SECTION_TO_BOX_ON,de as SECTION_TO_BOX_PRESS,je as boxNativeReason,Y as convertSection,Le as convertSectionsInPage,Ee as convertTheme,fe as convertsToBox,be as filledTemplateHold,He as hasWords,me as headInOwnBox,Ce as headParts,ke as ownBoxHold,Re as pressesAsBox,_e as registerBoxNativeSections,Ie as registerSectionToBox,ae as sectionBoxIdOf,Fe as sectionToBoxEdits,Ne as sectionToBoxRow,Ae as sectionToBoxTypes};
|
|
1
|
+
import{readHidable as J}from"efficient-easel/draw";import{BOX_TYPE as U,CONTAINER_BLOCKS_SLOT as Z}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as ee,labelTextSeed as te}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as oe,parseSectionHeadPlacement as ne}from"../../../format/lib/sections/section-head-placement.js";import{accentItalicRuns as se}from"../../../format/lib/markup.js";import{seedNodes as re}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ie}from"../../../format/lib/locations-grid.js";import{normalizeTheme as D}from"../../../format/lib/theme.js";const v=U,E=Z;function Ee(t){if(t.theme)return D(t.theme);const o=t.site?.themePresets;return o?D({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ae(t,o){return o===0?`${t}~box`:`${t}~box-${o+1}`}const A={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box), and its Scrolling Bar is a Box in its strip slot (Hero › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function _e(t){for(const[o,s]of Object.entries(t)){if(o in A&&A[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=s}}function je(t){return A[t]}const G=new Set(["id"]),T={},L=[],ce=["ProductGrid","Events","Collections","GalleryB","ContactRouting","ReviewForm","AppointmentBooking","Reviews","CheckoutCTA","AlloyWheelsListing"],de=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","FAQ","ProcessSteps",...ce,"Stats","Logos","PaymentBadges","PaymentLogosBlock","FitmentFinder","DocMasthead","DocTabs","Timeline","TimelineTrack","OrderSummary","Chart","Mockup","Countdown","FeaturedCover","SectionHeader","TitleWithButtons","Prose","ParagraphsA","Banner","Cards"];function Ie(t){for(const[o,s]of Object.entries(t)){if(o in T&&T[o]!==s)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=s}}function Ne(t){return T[t]}function Ae(){return Object.keys(T)}function fe(t){return t in T&&L.includes(t)}function Re(t,o=de){return t in T&&(o.includes(t)||fe(t))}function Ce(t){const o=oe[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const s=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&s.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&s.push({kind:"button",key:"linkText",href:"linkHref"}),s}const F=t=>J(t),He=t=>F(t).text.trim()!=="";function le(t){if(t.includes("=="))return t;const o=t.indexOf("/"),s=o===-1?t:t.slice(0,o),r=s.trim();if(!r)return t;const c=s.indexOf(r);return`${s.slice(0,c)}==${r}==${s.slice(c+r.length)}${o===-1?"":t.slice(o)}`}const pe=t=>t==="heading"?ee():t==="eyebrow"?te():{};function ue(t,o,s,r){const a={...t._partStyles?.text??{},...o??{},...s??{}};return(r==="center"||r==="right")&&a.align===void 0&&(a.align=r),Object.keys(a).length?{_partStyles:{text:a}}:{}}function he(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const s=o[t.key];return{variant:typeof s=="string"&&Object.hasOwn(t.map,s)?t.map[s]:t.fallback}}function z(t,o,s,r,c={}){const a={...o};for(const u of t){const[m,S,_]=typeof u=="string"?[u,u,void 0]:u;if(s[m]===void 0)continue;const j=_?_(s[m],s,c):s[m];j===void 0?delete a[S]:a[S]=j,r(m,S,j===void 0)}return a}function ye(t){const o=new Set([...G,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),s=c=>{for(const a of c??[])o.add(typeof a=="string"?a:a[0])},r=c=>{for(const a of c)switch(a.kind){case"text":case"image":o.add(a.key),a.kind==="image"&&a.alt&&o.add(a.alt);break;case"button":o.add(a.key),o.add(a.href),typeof a.variant=="object"&&o.add(a.variant.key);break;case"list":o.add(a.key);break;case"group":case"block":s(a.box),r(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(u=>o.add(u)),Object.keys(a.rename??{}).forEach(u=>o.add(u)),a.derive?.reads.forEach(u=>o.add(u)),typeof a.slots!="function")for(const u of Object.values(a.slots??{}))for(const m of u)"kind"in m&&o.add(m.key);break}};for(const c of[t,...t.also??[]])s(c.box),r(c.parts);return o}const me=t=>ne(t.headPlacement)==="own-box";function ke(t){return me(t)?"its head sits in a Box of its own above it (own-box): the row draws the head inline":void 0}function be(t,o){const s=t[o];return Array.isArray(s)&&s.some(c=>!!c&&typeof c=="object"&&typeof c.type=="string")?"already on the Box path: its items draw from a filled card template":void 0}function ge(t){const o=new Set,s=r=>{for(const c of r)if(c.kind==="group"||c.kind==="block")s(c.parts??[]);else if(c.kind==="core"&&c.slots&&typeof c.slots!="function")for(const[a,u]of Object.entries(c.slots))u.length>0&&u.every(m=>!("kind"in m))&&o.add(a)};for(const r of[t,...t.also??[]])s(r.parts);return[...o]}function xe(t,o,s){if(!s.press)for(const r of ge(t)){const c=be(o,r);if(c!==void 0)return c}}function Y(t,o,s={}){const r=t.props,c=(o.ownBoxConverts?void 0:ke(r))??xe(o,r,s)??o.skip?.(r);if(c!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],skipped:c};const a=String(r.id??t.type),u=[],m=[],S=new Set,_=(n,i)=>{u.push({key:n,home:i}),S.add(n)},j=r._partStyles??{},R=ye(o);let M=0;const w=(n,i)=>({type:n,props:{...i,id:`${a}~${n}-${++M}`}}),W=(n,i,b,y,g,l,$)=>{if(g){for(const d of n??[]){const h=typeof d=="string"?d:d[0];b[h]!==void 0&&$(h,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof i=="function"?i(r,s):i??{};return z(n??[],e,b,(d,h,f)=>$(d,f?`nothing — the old value draws nothing (${y}: no ${h})`:`${l}${y}: ${h}`),s)},V=n=>re(n,i=>`${a}~${i}-${++M}`),X=(n,i,b)=>{const y=n.of?n.of(i):Array.isArray(i[n.key])?i[n.key]:[],g=typeof n.props=="function"?n.props(r,s):n.props??{},l=y.map((f,x)=>{const p=f??{},k=n.item?.(p,x,r)??{},B=I(k.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${x+1}: `);return n.flat?k.props?B.map(P=>({...P,props:{...P.props,...k.props,id:P.props.id}})):B:[w(v,{name:`${n.name} ${x+1}`,...g,...k.props??{},[E]:B})]});if(n.groups){const f=n.groups;return b(n.key,y.length?`one Box per item (${y.length}), in a Box per group`:"nothing — the list is empty"),ie(y.map(x=>x??{}),f.of,f.of).map((x,p)=>{const k=x.items.map(O=>O.item),B=f.parts?I(f.parts,f.head?.(k,r)??{},!1,`group ${p+1}: `):[],P=x.items.map(O=>l[O.index]),C=f.perRow?.(k.length,r),N=Number.isInteger(C)&&C>=1?C:1,H=[];if(f.perRow&&N<P.length)for(let O=0;O*N<P.length;O++)H.push(P.slice(O*N,(O+1)*N).flat());return w(v,{name:`${f.name} ${p+1}`,...f.props??{},[E]:[...B,w(v,{name:`${f.itemsName} ${p+1}`,...f.itemsProps?.(k.length,r)??{},[E]:H.length?H.map((O,q)=>w(v,{name:`${f.rowName??`${f.itemsName} row`} ${q+1}`,...f.rowProps??{},[E]:O})):P.flat()})]})})}const $=n.perRow?.(r),e=n.perRow?Number.isInteger($)&&$>=1?$:1:0;if(b(n.key,(y.length?n.flat?`each item's parts (${y.length} items), in order`:`one Box per item (${y.length}), its parts inside`:"nothing — the list is empty")+(e&&y.length?`, in rows of ${e}`:"")),!e)return l.flat();const d=typeof n.rowProps=="function"?n.rowProps(r,s):n.rowProps??{},h=[];for(let f=0;f*e<l.length;f++){const x=l.slice(f*e,(f+1)*e).flat(),p=n.rowFiller?e-l.slice(f*e,(f+1)*e).length:0;h.push(w(v,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...d,[E]:[...x,...Array.from({length:p},(k,B)=>w(v,{name:`Empty ${B+1}`,...n.rowFiller,[E]:[]}))]}))}return h},I=(n,i,b,y)=>{const g=[],l=(e,d)=>b?_(e,d):void 0,$=e=>b?j[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:i)))switch(e.kind){case"text":{const d=F(i[e.key]);if(!d.text.trim()&&!(b&&s.press&&o.pressKeepsEmpty?.includes(e.key))){l(e.key,"nothing — empty words draw nothing, so no block");break}const h=pe(e.role??"body"),{_partStyles:f,...x}=h,p=ue(h,e.styleFrom?{...e.style,...e.styleFrom(r,s)}:e.style,$(e.key),e.props?.align);g.push(w("Text",{text:e.mark==="accentLead"?le(d.text):e.mark==="accentItalic"?se(d.text):d.text,...x,...e.props??{},...p,...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Text block: its words${d.hidden?", hidden":""}`);break}case"button":{const d=F(i[e.key]);if(!d.text.trim()){l(e.key,"nothing — no words, no button"),l(e.href,"nothing — no button to link"),typeof e.variant=="object"&&l(e.variant.key,"nothing — no button to style");break}const h=typeof i[e.href]=="string"&&i[e.href]?i[e.href]:"#",f={...e.style??{},...$(e.key)??{}};g.push(w("ButtonBlock",{label:d.text,href:h,...typeof e.props=="function"?e.props(i,s):e.props??{},...he(e.variant,i),...Object.keys(f).length?{_partStyles:{label:f}}:{},...d.hidden?{_hidden:!0}:{}})),l(e.key,`${y}Button block: its words`),l(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&l(e.variant.key,`${y}Button block: its Style`);break}case"image":{const d=i[e.key];if(typeof d!="string"||!d){l(e.key,"nothing — no picture, no block"),e.alt&&l(e.alt,"nothing — no picture to describe");break}const h=e.alt&&typeof i[e.alt]=="string"?i[e.alt]:"";g.push(w("ImageBlock",{src:d,alt:h,...e.props??{}})),l(e.key,`${y}Image block: its picture`),e.alt&&l(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...X(e,i,l));break}case"group":{const d=I(e.parts,i,b,y),h=W(e.box,e.props,i,`${e.name} Box`,!d.length&&!e.keepEmpty,y,l);h&&g.push(w(v,{name:e.name,...h,[E]:d}));break}case"block":{const d=e.parts?I(e.parts,i,b,y):[],h=W(e.box,e.props,i,`${e.type} block`,!!e.parts&&!d.length&&!e.keepEmpty,y,l);h&&g.push(w(e.type,{...h,...e.slot?{[e.slot]:d}:{}}));break}case"core":{const d=e.as??t.type,h={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(i).filter(p=>!R.has(p)&&!(p in h)):e.keep;for(const p of f)i[p]!==void 0&&(h[p]=i[p],l(p,`the ${d} block inside the Box`));if(e.keep==="rest"){for(const k of Object.keys(e.props??{}))i[k]!==void 0&&!R.has(k)&&l(k,`nothing — the ${d} block inside the Box has the row's own value`);i.headPlacement!==void 0&&l("headPlacement",`the ${d} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(j).filter(([k])=>!R.has(k)));Object.keys(p).length&&(h._partStyles=p)}for(const[p,k]of Object.entries(e.rename??{}))i[p]!==void 0&&(h[k]=i[p],l(p,`the ${d} block inside the Box: ${k}`));if(e.derive){Object.assign(h,e.derive.props(i,s));for(const p of e.derive.reads)i[p]!==void 0&&l(p,`the ${d} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(i,s):e.slots??{};for(const[p,k]of Object.entries(x))h[p]=k.flatMap(B=>"kind"in B?X(B,i,l):V([B]));g.push(w(d,h));break}}return g},Q=(n,i)=>{const b=i===0?"Box":`${n.name} Box`,y=I(n.parts,r,!0,i===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,s):n.boxProps??{},l=z(n.box??[],g,r,($,e,d)=>_($,d?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),s);return{type:v,props:{name:n.name,...l,[E]:y,id:ae(a,i)}}},K=[o,...o.also??[]].map(Q);r._partStyles!==void 0&&_("_partStyles","each old part's style moved to its new part");for(const[n,i]of Object.entries(o.reads??{}))r[n]!==void 0&&_(n,i);for(const[n,i]of Object.entries(o.drop??{}))n in r&&(m.push({key:n,why:i}),S.add(n));for(const n of Object.keys(r))G.has(n)||S.has(n)||m.push({key:n,why:"not in the row — not carried"});return{node:K[0],nodes:K,carried:u,dropped:m,siteWrites:[...o.site?.(t,s)??[]]}}function Le(t,o=L,s={}){const r=t.content;if(!Array.isArray(r))return t;let c=!1;const a=r.flatMap(u=>{const m=u&&typeof u.type=="string"&&o.includes(u.type)?T[u.type]:void 0;if(!m)return[u];const S=Y(u,m,s);return S.skipped!==void 0?[u]:(c=!0,S.nodes)});return c?{...t,content:a}:t}function Fe(t,o=L,s={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((c,a)=>{const u=c&&typeof c.type=="string"&&o.includes(c.type)?T[c.type]:void 0;if(!u)return;const m=Y(c,u,s);m.skipped===void 0&&r.push({index:a,node:m.node,nodes:m.nodes})}),r}export{ce as HOST_PRESS_TYPES,E as SECTION_BOX_SLOT,v as SECTION_BOX_TYPE,L as SECTION_TO_BOX_ON,de as SECTION_TO_BOX_PRESS,je as boxNativeReason,Y as convertSection,Le as convertSectionsInPage,Ee as convertTheme,fe as convertsToBox,be as filledTemplateHold,He as hasWords,me as headInOwnBox,Ce as headParts,ke as ownBoxHold,Re as pressesAsBox,_e as registerBoxNativeSections,Ie as registerSectionToBox,ae as sectionBoxIdOf,Fe as sectionToBoxEdits,Ne as sectionToBoxRow,Ae as sectionToBoxTypes};
|