efficient-web-builder 74.1.0 → 74.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/dist/editor/components/PreviewFooterContext.d.ts +3 -1
- package/dist/editor/components/PreviewFooterContext.js +1 -1
- package/dist/editor/components/SectionTextPartBridge.d.ts +2 -8
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/storefront-editor.css +7 -0
- package/dist/editor/lib/document/blocks/general/ContactLocations/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Footprint/fields.d.ts +3 -0
- package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +1 -0
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/own-pad-fields.d.ts +4 -3
- package/dist/editor/lib/document/own-pad-fields.js +1 -1
- package/dist/editor/lib/document/page-root-fields.d.ts +4 -0
- package/dist/editor/lib/document/page-root-fields.js +1 -1
- package/dist/editor/lib/document/page-root.d.ts +3 -2
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/editor/lib/document/registry.js +1 -1
- package/dist/editor/lib/editor-document-adapter.d.ts +1 -0
- package/dist/editor/lib/editor-document-adapter.js +1 -1
- package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/format/lib/build/module-specifiers.d.ts +8 -0
- package/dist/format/lib/build/module-specifiers.js +1 -1
- package/dist/format/lib/content/block-sources.d.ts +1 -0
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/page-width.d.ts +15 -0
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/section-css.d.ts +1 -1
- package/dist/format/lib/content/section-css.js +1 -1
- package/dist/format/lib/content/site-css.d.ts +5 -0
- package/dist/format/lib/content/site-css.js +1 -0
- package/dist/format/lib/content/site-offices.d.ts +7 -0
- package/dist/format/lib/content/site-offices.js +1 -0
- package/dist/format/lib/document/passes/types.d.ts +3 -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/source-rules/panel-colour-tokens.js +7 -7
- package/dist/format/lib/source-rules/site-gutter-once.d.ts +12 -0
- package/dist/format/lib/source-rules/site-gutter-once.js +23 -0
- package/dist/render/components/Banner.d.ts +3 -1
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/Breadcrumb.js +1 -1
- package/dist/render/components/Cards.d.ts +3 -1
- package/dist/render/components/Cards.js +1 -1
- package/dist/render/components/ChartSection.d.ts +3 -1
- package/dist/render/components/ChartSection.js +1 -1
- package/dist/render/components/ContactLocations.d.ts +3 -1
- package/dist/render/components/ContactLocations.js +2 -2
- package/dist/render/components/Countdown.d.ts +3 -1
- package/dist/render/components/Countdown.js +1 -1
- package/dist/render/components/DocBody.d.ts +3 -1
- package/dist/render/components/DocBody.js +4 -4
- package/dist/render/components/DocMasthead.d.ts +3 -1
- package/dist/render/components/DocMasthead.js +1 -1
- package/dist/render/components/DocMetaCards.d.ts +3 -1
- package/dist/render/components/DocMetaCards.js +1 -1
- package/dist/render/components/FAQ.d.ts +3 -1
- package/dist/render/components/FAQ.js +1 -1
- package/dist/render/components/FeaturedCover.d.ts +3 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Footprint.js +1 -1
- package/dist/render/components/Grid.d.ts +3 -1
- package/dist/render/components/Grid.js +1 -1
- package/dist/render/components/HeroGroup.js +1 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/IntegrationsSection.d.ts +3 -1
- package/dist/render/components/IntegrationsSection.js +1 -1
- package/dist/render/components/KeyFeatures.d.ts +3 -1
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/Logos.d.ts +3 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/LongRead.d.ts +3 -1
- package/dist/render/components/LongRead.js +1 -1
- package/dist/render/components/Manifesto.js +1 -1
- package/dist/render/components/Masthead.d.ts +3 -1
- package/dist/render/components/Masthead.js +1 -1
- package/dist/render/components/MockupSection.d.ts +3 -1
- package/dist/render/components/MockupSection.js +1 -1
- package/dist/render/components/OrderSummary.d.ts +3 -1
- package/dist/render/components/OrderSummary.js +1 -1
- package/dist/render/components/ParagraphsA.js +1 -1
- package/dist/render/components/PaymentBadges.d.ts +3 -1
- package/dist/render/components/PaymentBadges.js +1 -1
- package/dist/render/components/ProcessSteps.js +1 -1
- package/dist/render/components/Prose.d.ts +3 -1
- package/dist/render/components/Prose.js +1 -1
- package/dist/render/components/SectionHeader.d.ts +2 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/Series.d.ts +3 -1
- package/dist/render/components/Series.js +1 -1
- package/dist/render/components/SideSpaceOnce.d.ts +6 -0
- package/dist/render/components/SideSpaceOnce.js +1 -0
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/SiteOffices.d.ts +5 -0
- package/dist/render/components/SiteOffices.js +1 -0
- package/dist/render/components/SiteRootProps.d.ts +6 -0
- package/dist/render/components/SiteRootProps.js +1 -0
- package/dist/render/components/SpecStrip.js +1 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/components/Stats.d.ts +3 -1
- package/dist/render/components/Stats.js +1 -1
- package/dist/render/components/StatsParagraph.js +1 -1
- package/dist/render/components/Testimonials.d.ts +3 -1
- package/dist/render/components/Testimonials.js +1 -1
- package/dist/render/components/TickerSection.d.ts +3 -1
- package/dist/render/components/TickerSection.js +1 -1
- package/dist/render/components/Timeline.js +1 -1
- package/dist/render/components/TimelineTrack.js +1 -1
- package/dist/render/components/TitleWithButtons.js +1 -1
- package/dist/render/lib/content/section-edge.d.ts +1 -1
- package/dist/render/lib/content/section-edge.js +1 -1
- package/dist/render/lib/content/section-own-pads.d.ts +35 -0
- package/dist/render/lib/content/section-own-pads.js +1 -0
- package/dist/render/lib/content/section-padding.d.ts +9 -3
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/Banner/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Chart/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ContactLocations/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Countdown/render.js +1 -1
- package/dist/render/lib/document/blocks/general/DocBody/render.js +1 -1
- package/dist/render/lib/document/blocks/general/DocMasthead/render.js +1 -1
- package/dist/render/lib/document/blocks/general/DocMetaCards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/FAQ/render.js +1 -1
- package/dist/render/lib/document/blocks/general/FeaturedCover/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Grid/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Integrations/render.js +2 -2
- package/dist/render/lib/document/blocks/general/KeyFeatures/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
- package/dist/render/lib/document/blocks/general/LongRead/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Masthead/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Mockup/render.js +2 -2
- package/dist/render/lib/document/blocks/general/OrderSummary/render.js +1 -1
- package/dist/render/lib/document/blocks/general/PaymentBadges/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Prose/render.js +1 -1
- package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Series/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Stats/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Testimonials/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Ticker/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-docbody.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-integrations.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/custom-css.d.ts +2 -1
- package/dist/render/lib/document/editing-bridges.d.ts +5 -1
- package/dist/render/lib/document/editing-bridges.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +3 -1
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/clickable-parts.js +1 -1
- package/dist/render/lib/document/passes/section-custom-css.d.ts +7 -0
- package/dist/render/lib/document/passes/section-custom-css.js +1 -1
- package/dist/render/lib/document/passes/section-padding.d.ts +3 -3
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/document/section-css-style.d.ts +3 -1
- package/dist/render/lib/document/section-css-style.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{textStyleCaseCss as pe,textStyleCaseOfCss as de,viewKeyAt as Y}from"efficient-easel/draw";import{FONT_OPTIONS as ge,fontOption as xe,fontRoleOf as $,SIZE_STEP_OF_ROLE as F}from"../../../format/lib/fonts.js";import{encodePartKey as V}from"../../../format/lib/document/part-key.js";import{decodePartId as Z,normalizePartText as y}from"./text-parts.js";import{partInkCss as he}from"../../../format/lib/document/part-inks.js";import{regionStyle as Se}from"../../../format/lib/sections/text-regions.js";import{EDGE_PHONE_MEDIA as be,EDGE_TABLET_MEDIA as me,PHONE_MEDIA as Te,TABLET_MEDIA as Pe,viewOverrides as ze}from"../content/view-values.js";import{plainRecord as M,propsWithPartRecord as _e,readPartRecord as Ae,readPartRecords as Re}from"../../../format/lib/document/part-records.js";import{isLengthUnit as L}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as A,storedUnit as Ee}from"../../../format/lib/content/css-length.js";import{hasOwnEntry as k,ownEntry as q}from"../../../format/lib/own-entry.js";const D="_partStyles",we="data-sf-part-styled",J="data-sf-text-style",$e=/^(heading|body)-[1-7]$/;function m(e){return typeof e=="string"&&$e.test(e)}const Q={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function ke(e){if(!e)return null;for(const[t,n]of Object.entries(Q))if(n===e)return t;return null}function Ct(e){if(m(e.textStyle))return e.textStyle;const t=$(e.role);return t?Q[t]:void 0}const Ne=[400,500,600,700],E=["left","center","right","justify"],H=5,U=1e3,Oe=-5,Ie=10,Fe=0,ye=64,Me=2,ee={size:{min:H,max:U,step:1},sizeTablet:{min:H,max:U,step:1},sizePhone:{min:H,max:U,step:1},padding:{min:Fe,max:ye,step:Me}},Le=.05,De=.01,He=["line","letter"],Ue=.5,je=2.5,Ce=-1,ve=1,We=0,Ge=400,Ke=[...new Set(Object.values(F))];function vt(e){return[`${e} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${e}:hover, ${e}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function Wt(e){return Re(e,D)}function te(e,t){return Ae(e,D,t)}function Gt(e,t){return Object.values(te(e,t)).filter(n=>n!==void 0).length}function ne(e,t,n){return _e(e,D,t,Be(n).length?n:null)}function Be(e){return Object.entries(e).filter(([,t])=>t!==void 0)}function Xe(e){return He.includes(e)}const w=(e,t,n)=>Math.min(n,Math.max(t,e)),Ye=["sizeUnit","sizeUnitTablet","sizeUnitPhone"];function j(e){const t=Y("sizeUnit",e),n=Ye.find(i=>i===t);if(!n)throw new Error(`a part stores no unit key ${t}`);return n}const T={size:j("desktop"),sizeTablet:j("tablet"),sizePhone:j("mobile"),paragraphSpacing:"paragraphSpacingUnit",padding:"paddingUnit"},ie=Object.values(T);function h(e,t){return Ee(e[T[t]])}function Ve(e,t,n={}){if(ie.includes(e))return L(t)&&t!=="px"?t:null;if(k(T,e)&&h(n,e)!=="px"){const i=z(Number(t),2);return!Number.isFinite(i)||i<0||i===0&&e!=="padding"?null:i}if(Xe(e)){const i=Math.round(Number(t));return!Number.isFinite(i)||i===0?null:w(i,Oe,Ie)}if(e==="lineHeight"){const i=Number(t);return Number.isFinite(i)?z(w(i,Ue,je),3):null}if(e==="letterSpacing"){const i=Number(t);return Number.isFinite(i)?z(w(i,Ce,ve),4):null}if(e==="paragraphSpacing"){const i=Math.round(Number(t));return!Number.isFinite(i)||i<=0?null:w(i,We,Ge)}if(k(ee,e)){const{min:i,max:o}=ee[e],r=Math.round(Number(t));return Number.isFinite(r)?w(r,i,o):null}return e==="italic"?typeof t=="boolean"?t:null:e==="role"||e==="fontRole"?$(t)?t:null:e==="sizeToken"?C(t)?t:null:e==="textStyle"?m(t)?t:null:e==="alignPhone"||e==="alignTablet"?E.includes(t)?t:null:t}const Ze=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function R(e){let t=null;const n=i=>{t??={...e},delete t[i]};for(const i of Ze){const o=e[i];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(i)}e.align!==void 0&&!E.includes(e.align)&&n("align"),e.alignTablet!==void 0&&!E.includes(e.alignTablet)&&n("alignTablet"),e.alignPhone!==void 0&&!E.includes(e.alignPhone)&&n("alignPhone"),e.textStyle!==void 0&&!m(e.textStyle)&&n("textStyle"),e.sizeToken!==void 0&&!C(e.sizeToken)&&n("sizeToken"),e.fontRole!==void 0&&!$(e.fontRole)&&n("fontRole");for(const i of ie)e[i]!==void 0&&!L(e[i])&&n(i);return t??e}function C(e){if(!e||typeof e!="object")return!1;const{step:t,px:n,stepPhone:i,pxPhone:o,fluid:r}=e,f=c=>typeof c=="number"&&Number.isFinite(c)&&c>0,s=c=>typeof c=="string"&&Ke.includes(c);return s(t)&&f(n)&&(i===void 0||s(i))&&(o===void 0||f(o))&&(r===void 0||qe(r,n))}function qe(e,t){if(!e||typeof e!="object"||Array.isArray(e))return!1;const{minPx:n,vw:i,...o}=e;return Object.keys(o).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<t&&typeof i=="number"&&Number.isFinite(i)&&i>0&&i<=100}function v(e){return e?.pxPhone&&C(e)?{step:e.stepPhone??e.step,px:e.pxPhone}:null}function oe({step:e,px:t,fluid:n}){const i=n?`clamp(${n.minPx}px, ${n.vw}vw, ${t}px)`:`${t}px`,o=`var(--size-${e}, ${i})`;return e.startsWith("heading")?`min(${o}, var(--sf-heading-max,9999px))`:o}const Je=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Qe(e){const t=[];for(const[n,i]of Je)n===e?t.push(i):i===e&&t.push(n);return t}function Kt(e,t,n,i){const o={...te(e,t)},r=i==null?null:Ve(n,i,o);if(r===null)delete o[n];else{o[n]=r;for(const f of Qe(n))delete o[f]}return ne(e,t,o)}function Bt(e,t){return ne(e,t,{})}function et(e){return de(e)??"none"}function tt(e){return pe(e)??""}const re={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function nt(e,t){const n=$(e.role);return n||(t?.blockDrawsStyle?null:ke(e.textStyle))}const it="--sf-part-size-cap";function W(e,t){return e&&t?.sizeCap?`min(${e}, var(${it}, ${e}))`:e}function Xt(e,t){return e?.[t]===!0}function Yt(e,t){return e==="Text"&&t==="text"}const ot={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function rt(e){const t=F[e],n=q(ot,t);return n?`var(--size-${t}, ${n})`:`var(--size-${t})`}function at(e){const t={};return typeof e.lineHeight=="number"?t.lineHeight=e.lineHeight:e.line&&(t.lineHeight=z(st+e.line*Le,3)),typeof e.letterSpacing=="number"?t.letterSpacingEm=e.letterSpacing:e.letter&&(t.letterSpacingEm=z(e.letter*De,4)),t}const st=1,P="--sf-part-para";function ft(e,t){e=R(e);const n={};if(typeof e.sizePhone=="number"&&e.sizePhone>0)n.fontSize=A(e.sizePhone,h(e,"sizePhone"));else{const o=v(e.sizeToken);if(o)n.fontSize=oe(o);else{const r=O(e);r!==void 0&&(n.fontSize=A(r,h(e,"sizeTablet")))}}n.fontSize&&(n.fontSize=W(n.fontSize,t));const i=e.alignPhone??N(e);return i&&(n.textAlign=i),n}function N(e){return e.alignTablet&&e.alignTablet!==e.align?e.alignTablet:void 0}function O(e){const n=e.sizeTablet!==void 0&&h(e,"sizeTablet")!==h(e,"size")?e.sizeTablet:ze("textSize",e.size,e.sizeTablet,void 0).tablet;return n&&n>0?n:void 0}function ct(e,t){const n=R(e),i={},o=O(n);o!==void 0&&(i.fontSize=W(A(o,h(n,"sizeTablet")),t));const r=N(n);return r&&(i.textAlign=r),i}function Vt(e,t){if(t==="desktop")return;const n=R(e);return(t==="mobile"?N(n):void 0)??n.align}function lt(e,t){if(t==="desktop")return e;const n=R(e),i=O(n),o=N(n);if(t==="tablet"){let s=e;return i!==void 0&&(s={...s,size:i,sizeUnit:n[T.sizeTablet]}),o&&(s={...s,align:o}),s}let r=e;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone,sizeUnit:n[T.sizePhone]};else{const s=v(n.sizeToken);s?r={...r,size:void 0,sizeToken:s}:i!==void 0&&(r={...r,size:i,sizeUnit:n[T.sizeTablet]})}const f=n.alignPhone??o;return f&&(r={...r,align:f}),r}function G(e,t,n){return K(lt(e,t),I,n)}function ut(e){return Y("size",e)}function Zt(e,t){if(t==="desktop")return null;const n=R(e);if(t==="mobile"){if(v(n.sizeToken))return null;const i=O(n);if(i!==void 0)return{px:i,view:"tablet"}}return typeof n.size=="number"&&n.size>0?{px:n.size,view:"desktop"}:null}function ae(e,t){const n=ut(t);if(!k(e,n))return e;const i={...e};return delete i[n],i}function qt(e,t,n){const i=G(ae(e,t),t,n);return{fontFamily:i.fontFamily,fontSize:i.fontSize}}function K(e,t,n){e=R(e);const i=nt(e,n),o=at(e),r=W(e.size?A(e.size,h(e,"size")):e.sizeToken?oe(e.sizeToken):i?rt(i):"",n);return{fontFamily:e.font?xt(e.font):e.fontRole?`var(${re[e.fontRole]})`:i?`var(${re[i]})`:"",fontWeight:e.weight?String(e.weight):"",fontSize:r,minWidth:r?"0":"",overflowWrap:r?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[P]:e.paragraphSpacing?A(e.paragraphSpacing,h(e,"paragraphSpacing")):"",textTransform:tt(e.case),textAlign:e.align??"",paddingTop:se(e.padding,h(e,"padding")),paddingBottom:se(e.padding,h(e,"padding")),color:pt(e.color),fontStyle:e.italic===!0?"italic":e.italic===!1?"normal":""}}const pt=e=>he(e),se=(e,t)=>e===void 0?"":A(e,t),z=(e,t)=>Number(e.toFixed(t));function Jt(e,t){const n=Number.parseFloat(e.fontSize)||16,i=Number.parseFloat(e.lineHeight),o=Number.parseFloat(e.letterSpacing),r=Number.parseFloat(e.paddingTop);return{fontKey:t,sizePx:n,weight:dt(Number.parseInt(e.fontWeight,10)),lineRatio:Number.isFinite(i)?z(i/n,3):1.2,letterEm:Number.isFinite(o)?z(o/n,4):0,align:gt(e.textAlign),case:et(e.textTransform),paddingPx:Number.isFinite(r)?Math.round(r):0}}function dt(e){return Number.isFinite(e)?Ne.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t):400}function gt(e){for(const t of E)if(t===e)return t;return e==="end"?"right":"left"}function Qt(e,t){const n=fe(e);if(!n)return"";for(const i of ge)if(fe(t(i.cssVar))===n)return i.key;return""}const fe=e=>(e.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function xt(e){const t=xe(e);return t?`var(${t.cssVar})`:""}function en(e,t,n,i){return!t||Z(t)?.nodeId!==e?null:n.find(r=>i(r.getAttribute("class")))??n[0]??null}function ht(e,t){return M(q(e,t))??{}}function tn(e,t,n=()=>I,i=c=>c,o=mt,r="desktop",f=()=>!1,s=()=>!1){let c=0;for(const{element:p,partId:S}of e){const g=Z(S)?.propKey;if(!g)continue;const a=ht(t,i(g)),l=G(a,r,{blockDrawsStyle:f(g),sizeCap:s(g)});m(a.textStyle)?p.setAttribute?.(J,a.textStyle):p.removeAttribute?.(J);const x=X.some(u=>p.style[u]);let d=!1;for(const[u,b]of Object.entries(l))zt(p,u,b),b&&(d=!0);if(x||X.some(u=>l[u]))for(const u of St(p,o))for(const b of X)u.style[b]=l[b]??"";d&&(c+=1)}return c}function St(e,t){const n=y(e.textContent??""),i=[];let o=e;for(let r=0;r<bt&&t(o);r+=1){const f=o.parentElement;if(!f||y(f.textContent??"")!==n)break;i.push(f),o=f}return i}const bt=8;function mt(e){const t=e;return typeof window>"u"||!t?.ownerDocument?!1:window.getComputedStyle(t).display==="inline"}const I={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function Tt(e){if(!e||typeof e!="object")return null;const t={};m(e.textStyle)&&(t.textStyle=e.textStyle),typeof e.size=="number"&&e.size>0&&(t.size=e.size),typeof e.sizeTablet=="number"&&e.sizeTablet>0&&(t.sizeTablet=e.sizeTablet),typeof e.sizePhone=="number"&&e.sizePhone>0&&(t.sizePhone=e.sizePhone);for(const n of["size","sizeTablet","sizePhone"]){const i=T[n];t[n]!==void 0&&L(e[i])&&(t[i]=e[i])}return Object.keys(t).length?t:null}function Pt(e,t){const n=Tt(e);if(!n)return{};const i=G(n,t);return{...i.fontFamily?{fontFamily:i.fontFamily}:{},...i.fontSize?{fontSize:i.fontSize}:{}}}function nn(e){return m(e?.textStyle)||!!e?.role||typeof e?.size=="number"&&e.size>0}function on(e,t,n){if(!e||typeof e!="object")return{};const i=Se(e.role,t,F)??{},o=t.sized?Pt(ae(e,n),n):{};return{...i,...o}}function rn(e,t,n){n.fontFamily&&e.fontFamily===n.fontFamily&&(e.fontFamily=t.fontFamily),n.fontSize&&e.fontSize===n.fontSize&&(e.fontSize=t.fontSize)}function zt(e,t,n){if(!t.startsWith("--")){e.style[t]=n;return}const i=e.style;typeof i.setProperty=="function"?n?i.setProperty(t,n):i.removeProperty?.(t):i[t]=n;const o=e;t===P&&(n?o.setAttribute?.(ce,""):o.removeAttribute?.(ce))}const ce="data-sf-part-para",_t=Object.keys(K({},I)),B=new Set(["color","overflowWrap",P,"fontStyle"]),X=_t.filter(e=>!B.has(e));function an(e,t,n,i=c=>c,o=()=>!1,r=()=>null,f=[],s=()=>!1){const c=new Map;for(const a of e){const l=V(a.key,a.row);for(const x of a.texts){const d=c.get(x);d?(d.keys.add(a.key),d.partKeys.add(l)):c.set(x,{keys:new Set([a.key]),partKeys:new Set([l])})}}const p=new Map;for(const a of new Set([...Object.keys(t),...f])){if(!At(a))continue;const l=le(n,a,M(t[a])??{},{blockDrawsStyle:!1},r(a));l&&p.set(a,l)}const S=a=>{const l=i(a),x=r(l);if(!k(t,l)&&!x)return null;const d=M(t[l])??{};return le(n,a,d,{blockDrawsStyle:o(a),sizeCap:s(a)},x)},g=new Map;for(const[a,{keys:l,partKeys:x}]of c){const d=x.size===1?[...x][0]:l.size===1?[...l][0]:null;if(!d)continue;const _=S(d);_&&g.set(a,_)}for(const a of e){if(!a.keyed)continue;const l=S(V(a.key,a.row));l&&p.set(a.key,l)}return g.size||p.size?{rules:g,kindRules:p,drawn:new Set(c.keys())}:null}function le(e,t,n,i,o){const r=K(n,I,i),f=ct(n,i),s=ft(n,i),c=m(n.textStyle)?n.textStyle:void 0;return!Object.values(r).some(Boolean)&&!Object.keys(f).length&&!Object.keys(s).length&&!c&&!o?null:{stamp:Rt(e,t),declarations:r,...Object.keys(f).length?{tablet:f}:{},...Object.keys(s).length?{phone:s}:{},...c?{textStyle:c}:{},...o?{motion:o}:{}}}function At(e){return e.startsWith("@")}function sn(e,t){return e?.kindRules.get(t)??null}function Rt(e,t){const n=i=>i.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(e)}~${n(t)}`}function Et(e){return e?{tablet:me,phone:be}:{tablet:Pe,phone:Te}}function fn(e,{inBox:t=!1}={}){const{tablet:n,phone:i}=Et(t),o=[],r=new Set,f=s=>{const{stamp:c,declarations:p}=s;if(r.has(c))return;r.add(c);const S=Object.entries(p).filter(([,u])=>u!==""),g=u=>u.map(([b,ue])=>`${$t(b)}: ${ue}`).join("; "),a=`[${we}="${c}"]`,l=S.filter(([u])=>!B.has(u)),x=S.filter(([u])=>B.has(u));l.length&&o.push(`${a}, *:has(> ${a}) { ${g(l)} }`),x.length&&o.push(`${a} { ${g(x)} }`),p[P]&&(o.push(`*:has(> ${a}) { ${P}: ${p[P]} }`),o.push(...wt(a,`*:has(> ${a})`)));const d=Object.entries(s.tablet??{}).filter(([,u])=>u!=="");d.length&&o.push(`@media ${n} { ${a}, *:has(> ${a}) { ${g(d)} } }`);const _=Object.entries(s.phone??{}).filter(([,u])=>u!=="");_.length&&o.push(`@media ${i} { ${a}, *:has(> ${a}) { ${g(_)} } }`)};for(const s of e.rules.values())f(s);for(const s of e.kindRules.values())f(s);return o.join(`
|
|
2
|
-
`)}function wt(e,t){const n=`var(${P})`,i=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${e} ${i}:not(:first-child) { margin-top: ${n} }`,`${e} ${i}:not(:last-child) { margin-bottom: ${n} }`,`:is(${t}) + :is(${t}) { margin-top: ${n} }`]}const $t=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function cn(e,t){if(!e)return null;const n=y(t),i=e.rules.get(n);if(i)return i;if(n.length<kt||e.drawn.has(n))return null;let o=null;for(const[r,f]of e.rules)if(r.includes(n)){if(o&&o.stamp!==f.stamp)return null;o=f}return o}const kt=8;export{E as PART_ALIGNS,ve as PART_LETTER_EM_MAX,
|
|
1
|
+
import{textStyleCaseCss as pe,textStyleCaseOfCss as de,viewKeyAt as Y}from"efficient-easel/draw";import{FONT_OPTIONS as ge,fontOption as xe,fontRoleOf as $,SIZE_STEP_OF_ROLE as F}from"../../../format/lib/fonts.js";import{encodePartKey as V}from"../../../format/lib/document/part-key.js";import{decodePartId as Z,normalizePartText as y}from"./text-parts.js";import{partInkCss as he}from"../../../format/lib/document/part-inks.js";import{regionStyle as Se}from"../../../format/lib/sections/text-regions.js";import{EDGE_PHONE_MEDIA as be,EDGE_TABLET_MEDIA as me,PHONE_MEDIA as Te,TABLET_MEDIA as Pe,viewOverrides as ze}from"../content/view-values.js";import{plainRecord as M,propsWithPartRecord as _e,readPartRecord as Ae,readPartRecords as Re}from"../../../format/lib/document/part-records.js";import{isLengthUnit as L}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as A,storedUnit as Ee}from"../../../format/lib/content/css-length.js";import{hasOwnEntry as k,ownEntry as q}from"../../../format/lib/own-entry.js";const D="_partStyles",we="data-sf-part-styled",J="data-sf-text-style",$e=/^(heading|body)-[1-7]$/;function m(e){return typeof e=="string"&&$e.test(e)}const Q={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function ke(e){if(!e)return null;for(const[t,n]of Object.entries(Q))if(n===e)return t;return null}function jt(e){if(m(e.textStyle))return e.textStyle;const t=$(e.role);return t?Q[t]:void 0}const Ne=[400,500,600,700],E=["left","center","right","justify"],H=5,C=1e3,Oe=-5,Ie=10,Fe=0,ye=64,Me=2,ee={size:{min:H,max:C,step:1},sizeTablet:{min:H,max:C,step:1},sizePhone:{min:H,max:C,step:1},padding:{min:Fe,max:ye,step:Me}},Le=.05,De=.01,He=["line","letter"],Ce=.5,Ue=2.5,je=-1,ve=1,We=0,Ge=400,Ke=[...new Set(Object.values(F))];function vt(e){return[`${e} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${e}:hover, ${e}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function Wt(e){return Re(e,D)}function te(e,t){return Ae(e,D,t)}function Gt(e,t){return Object.values(te(e,t)).filter(n=>n!==void 0).length}function ne(e,t,n){return _e(e,D,t,Be(n).length?n:null)}function Be(e){return Object.entries(e).filter(([,t])=>t!==void 0)}function Xe(e){return He.includes(e)}const w=(e,t,n)=>Math.min(n,Math.max(t,e)),Ye=["sizeUnit","sizeUnitTablet","sizeUnitPhone"];function U(e){const t=Y("sizeUnit",e),n=Ye.find(i=>i===t);if(!n)throw new Error(`a part stores no unit key ${t}`);return n}const T={size:U("desktop"),sizeTablet:U("tablet"),sizePhone:U("mobile"),paragraphSpacing:"paragraphSpacingUnit",padding:"paddingUnit"},ie=Object.values(T);function h(e,t){return Ee(e[T[t]])}function Ve(e,t,n={}){if(ie.includes(e))return L(t)&&t!=="px"?t:null;if(k(T,e)&&h(n,e)!=="px"){const i=z(Number(t),2);return!Number.isFinite(i)||i<0||i===0&&e!=="padding"?null:i}if(Xe(e)){const i=Math.round(Number(t));return!Number.isFinite(i)||i===0?null:w(i,Oe,Ie)}if(e==="lineHeight"){const i=Number(t);return Number.isFinite(i)?z(w(i,Ce,Ue),3):null}if(e==="letterSpacing"){const i=Number(t);return Number.isFinite(i)?z(w(i,je,ve),4):null}if(e==="paragraphSpacing"){const i=Math.round(Number(t));return!Number.isFinite(i)||i<=0?null:w(i,We,Ge)}if(k(ee,e)){const{min:i,max:o}=ee[e],r=Math.round(Number(t));return Number.isFinite(r)?w(r,i,o):null}return e==="italic"?typeof t=="boolean"?t:null:e==="role"||e==="fontRole"?$(t)?t:null:e==="sizeToken"?j(t)?t:null:e==="textStyle"?m(t)?t:null:e==="alignPhone"||e==="alignTablet"?E.includes(t)?t:null:t}const Ze=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function R(e){let t=null;const n=i=>{t??={...e},delete t[i]};for(const i of Ze){const o=e[i];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(i)}e.align!==void 0&&!E.includes(e.align)&&n("align"),e.alignTablet!==void 0&&!E.includes(e.alignTablet)&&n("alignTablet"),e.alignPhone!==void 0&&!E.includes(e.alignPhone)&&n("alignPhone"),e.textStyle!==void 0&&!m(e.textStyle)&&n("textStyle"),e.sizeToken!==void 0&&!j(e.sizeToken)&&n("sizeToken"),e.fontRole!==void 0&&!$(e.fontRole)&&n("fontRole");for(const i of ie)e[i]!==void 0&&!L(e[i])&&n(i);return t??e}function j(e){if(!e||typeof e!="object")return!1;const{step:t,px:n,stepPhone:i,pxPhone:o,fluid:r}=e,f=c=>typeof c=="number"&&Number.isFinite(c)&&c>0,s=c=>typeof c=="string"&&Ke.includes(c);return s(t)&&f(n)&&(i===void 0||s(i))&&(o===void 0||f(o))&&(r===void 0||qe(r,n))}function qe(e,t){if(!e||typeof e!="object"||Array.isArray(e))return!1;const{minPx:n,vw:i,...o}=e;return Object.keys(o).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<t&&typeof i=="number"&&Number.isFinite(i)&&i>0&&i<=100}function v(e){return e?.pxPhone&&j(e)?{step:e.stepPhone??e.step,px:e.pxPhone}:null}function oe({step:e,px:t,fluid:n}){const i=n?`clamp(${n.minPx}px, ${n.vw}vw, ${t}px)`:`${t}px`,o=`var(--size-${e}, ${i})`;return e.startsWith("heading")?`min(${o}, var(--sf-heading-max,9999px))`:o}const Je=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Qe(e){const t=[];for(const[n,i]of Je)n===e?t.push(i):i===e&&t.push(n);return t}function Kt(e,t,n,i){const o={...te(e,t)},r=i==null?null:Ve(n,i,o);if(r===null)delete o[n];else{o[n]=r;for(const f of Qe(n))delete o[f]}return ne(e,t,o)}function Bt(e,t){return ne(e,t,{})}function et(e){return de(e)??"none"}function tt(e){return pe(e)??""}const re={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function nt(e,t){const n=$(e.role);return n||(t?.blockDrawsStyle?null:ke(e.textStyle))}const it="--sf-part-size-cap";function W(e,t){return e&&t?.sizeCap?`min(${e}, var(${it}, ${e}))`:e}function Xt(e,t){return e?.[t]===!0}function Yt(e,t){return e==="Text"&&t==="text"}const ot={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function rt(e){const t=F[e],n=q(ot,t);return n?`var(--size-${t}, ${n})`:`var(--size-${t})`}function at(e){const t={};return typeof e.lineHeight=="number"?t.lineHeight=e.lineHeight:e.line&&(t.lineHeight=z(st+e.line*Le,3)),typeof e.letterSpacing=="number"?t.letterSpacingEm=e.letterSpacing:e.letter&&(t.letterSpacingEm=z(e.letter*De,4)),t}const st=1,P="--sf-part-para";function ft(e,t){e=R(e);const n={};if(typeof e.sizePhone=="number"&&e.sizePhone>0)n.fontSize=A(e.sizePhone,h(e,"sizePhone"));else{const o=v(e.sizeToken);if(o)n.fontSize=oe(o);else{const r=O(e);r!==void 0&&(n.fontSize=A(r,h(e,"sizeTablet")))}}n.fontSize&&(n.fontSize=W(n.fontSize,t));const i=e.alignPhone??N(e);return i&&(n.textAlign=i),n}function N(e){return e.alignTablet&&e.alignTablet!==e.align?e.alignTablet:void 0}function O(e){const n=e.sizeTablet!==void 0&&h(e,"sizeTablet")!==h(e,"size")?e.sizeTablet:ze("textSize",e.size,e.sizeTablet,void 0).tablet;return n&&n>0?n:void 0}function ct(e,t){const n=R(e),i={},o=O(n);o!==void 0&&(i.fontSize=W(A(o,h(n,"sizeTablet")),t));const r=N(n);return r&&(i.textAlign=r),i}function Vt(e,t){if(t==="desktop")return;const n=R(e);return(t==="mobile"?N(n):void 0)??n.align}function lt(e,t){if(t==="desktop")return e;const n=R(e),i=O(n),o=N(n);if(t==="tablet"){let s=e;return i!==void 0&&(s={...s,size:i,sizeUnit:n[T.sizeTablet]}),o&&(s={...s,align:o}),s}let r=e;if(typeof n.sizePhone=="number"&&n.sizePhone>0)r={...r,size:n.sizePhone,sizeUnit:n[T.sizePhone]};else{const s=v(n.sizeToken);s?r={...r,size:void 0,sizeToken:s}:i!==void 0&&(r={...r,size:i,sizeUnit:n[T.sizeTablet]})}const f=n.alignPhone??o;return f&&(r={...r,align:f}),r}function G(e,t,n){return K(lt(e,t),I,n)}function ut(e){return Y("size",e)}function Zt(e,t){if(t==="desktop")return null;const n=R(e);if(t==="mobile"){if(v(n.sizeToken))return null;const i=O(n);if(i!==void 0)return{px:i,view:"tablet"}}return typeof n.size=="number"&&n.size>0?{px:n.size,view:"desktop"}:null}function ae(e,t){const n=ut(t);if(!k(e,n))return e;const i={...e};return delete i[n],i}function qt(e,t,n){const i=G(ae(e,t),t,n);return{fontFamily:i.fontFamily,fontSize:i.fontSize}}function K(e,t,n){e=R(e);const i=nt(e,n),o=at(e),r=W(e.size?A(e.size,h(e,"size")):e.sizeToken?oe(e.sizeToken):i?rt(i):"",n);return{fontFamily:e.font?xt(e.font):e.fontRole?`var(${re[e.fontRole]})`:i?`var(${re[i]})`:"",fontWeight:e.weight?String(e.weight):"",fontSize:r,minWidth:r?"0":"",overflowWrap:r?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[P]:e.paragraphSpacing?A(e.paragraphSpacing,h(e,"paragraphSpacing")):"",textTransform:tt(e.case),textAlign:e.align??"",paddingTop:se(e.padding,h(e,"padding")),paddingBottom:se(e.padding,h(e,"padding")),color:pt(e.color),fontStyle:e.italic===!0?"italic":e.italic===!1?"normal":""}}const pt=e=>he(e),se=(e,t)=>e===void 0?"":A(e,t),z=(e,t)=>Number(e.toFixed(t));function Jt(e,t){const n=Number.parseFloat(e.fontSize)||16,i=Number.parseFloat(e.lineHeight),o=Number.parseFloat(e.letterSpacing),r=Number.parseFloat(e.paddingTop);return{fontKey:t,sizePx:n,weight:dt(Number.parseInt(e.fontWeight,10)),lineRatio:Number.isFinite(i)?z(i/n,3):1.2,letterEm:Number.isFinite(o)?z(o/n,4):0,align:gt(e.textAlign),case:et(e.textTransform),paddingPx:Number.isFinite(r)?Math.round(r):0}}function dt(e){return Number.isFinite(e)?Ne.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t):400}function gt(e){for(const t of E)if(t===e)return t;return e==="end"?"right":"left"}function Qt(e,t){const n=fe(e);if(!n)return"";for(const i of ge)if(fe(t(i.cssVar))===n)return i.key;return""}const fe=e=>(e.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function xt(e){const t=xe(e);return t?`var(${t.cssVar})`:""}function en(e,t,n,i){return!t||Z(t)?.nodeId!==e?null:n.find(r=>i(r.getAttribute("class")))??n[0]??null}function ht(e,t){return M(q(e,t))??{}}function tn(e,t,n=()=>I,i=c=>c,o=mt,r="desktop",f=()=>!1,s=()=>!1){let c=0;for(const{element:p,partId:S}of e){const g=Z(S)?.propKey;if(!g)continue;const a=ht(t,i(g)),l=G(a,r,{blockDrawsStyle:f(g),sizeCap:s(g)});m(a.textStyle)?p.setAttribute?.(J,a.textStyle):p.removeAttribute?.(J);const x=X.some(u=>p.style[u]);let d=!1;for(const[u,b]of Object.entries(l))zt(p,u,b),b&&(d=!0);if(x||X.some(u=>l[u]))for(const u of St(p,o))for(const b of X)u.style[b]=l[b]??"";d&&(c+=1)}return c}function St(e,t){const n=y(e.textContent??""),i=[];let o=e;for(let r=0;r<bt&&t(o);r+=1){const f=o.parentElement;if(!f||y(f.textContent??"")!==n)break;i.push(f),o=f}return i}const bt=8;function mt(e){const t=e;return typeof window>"u"||!t?.ownerDocument?!1:window.getComputedStyle(t).display==="inline"}const I={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function Tt(e){if(!e||typeof e!="object")return null;const t={};m(e.textStyle)&&(t.textStyle=e.textStyle),typeof e.size=="number"&&e.size>0&&(t.size=e.size),typeof e.sizeTablet=="number"&&e.sizeTablet>0&&(t.sizeTablet=e.sizeTablet),typeof e.sizePhone=="number"&&e.sizePhone>0&&(t.sizePhone=e.sizePhone);for(const n of["size","sizeTablet","sizePhone"]){const i=T[n];t[n]!==void 0&&L(e[i])&&(t[i]=e[i])}return Object.keys(t).length?t:null}function Pt(e,t,n){const i=Tt(e);if(!i)return{};const o=G(i,t,n?.sizeCap?{sizeCap:!0}:void 0);return{...o.fontFamily?{fontFamily:o.fontFamily}:{},...o.fontSize?{fontSize:o.fontSize}:{}}}function nn(e){return m(e?.textStyle)||!!e?.role||typeof e?.size=="number"&&e.size>0}function on(e,t,n){if(!e||typeof e!="object")return{};const i=Se(e.role,t,F)??{},o=t.sized?Pt(ae(e,n),n):{};return{...i,...o}}function rn(e,t,n){n.fontFamily&&e.fontFamily===n.fontFamily&&(e.fontFamily=t.fontFamily),n.fontSize&&e.fontSize===n.fontSize&&(e.fontSize=t.fontSize)}function zt(e,t,n){if(!t.startsWith("--")){e.style[t]=n;return}const i=e.style;typeof i.setProperty=="function"?n?i.setProperty(t,n):i.removeProperty?.(t):i[t]=n;const o=e;t===P&&(n?o.setAttribute?.(ce,""):o.removeAttribute?.(ce))}const ce="data-sf-part-para",_t=Object.keys(K({},I)),B=new Set(["color","overflowWrap",P,"fontStyle"]),X=_t.filter(e=>!B.has(e));function an(e,t,n,i=c=>c,o=()=>!1,r=()=>null,f=[],s=()=>!1){const c=new Map;for(const a of e){const l=V(a.key,a.row);for(const x of a.texts){const d=c.get(x);d?(d.keys.add(a.key),d.partKeys.add(l)):c.set(x,{keys:new Set([a.key]),partKeys:new Set([l])})}}const p=new Map;for(const a of new Set([...Object.keys(t),...f])){if(!At(a))continue;const l=le(n,a,M(t[a])??{},{blockDrawsStyle:!1,sizeCap:s(a)},r(a));l&&p.set(a,l)}const S=a=>{const l=i(a),x=r(l);if(!k(t,l)&&!x)return null;const d=M(t[l])??{};return le(n,a,d,{blockDrawsStyle:o(a),sizeCap:s(a)},x)},g=new Map;for(const[a,{keys:l,partKeys:x}]of c){const d=x.size===1?[...x][0]:l.size===1?[...l][0]:null;if(!d)continue;const _=S(d);_&&g.set(a,_)}for(const a of e){if(!a.keyed)continue;const l=S(V(a.key,a.row));l&&p.set(a.key,l)}return g.size||p.size?{rules:g,kindRules:p,drawn:new Set(c.keys())}:null}function le(e,t,n,i,o){const r=K(n,I,i),f=ct(n,i),s=ft(n,i),c=m(n.textStyle)?n.textStyle:void 0;return!Object.values(r).some(Boolean)&&!Object.keys(f).length&&!Object.keys(s).length&&!c&&!o?null:{stamp:Rt(e,t),declarations:r,...Object.keys(f).length?{tablet:f}:{},...Object.keys(s).length?{phone:s}:{},...c?{textStyle:c}:{},...o?{motion:o}:{}}}function At(e){return e.startsWith("@")}function sn(e,t){return e?.kindRules.get(t)??null}function Rt(e,t){const n=i=>i.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(e)}~${n(t)}`}function Et(e){return e?{tablet:me,phone:be}:{tablet:Pe,phone:Te}}function fn(e,{inBox:t=!1}={}){const{tablet:n,phone:i}=Et(t),o=[],r=new Set,f=s=>{const{stamp:c,declarations:p}=s;if(r.has(c))return;r.add(c);const S=Object.entries(p).filter(([,u])=>u!==""),g=u=>u.map(([b,ue])=>`${$t(b)}: ${ue}`).join("; "),a=`[${we}="${c}"]`,l=S.filter(([u])=>!B.has(u)),x=S.filter(([u])=>B.has(u));l.length&&o.push(`${a}, *:has(> ${a}) { ${g(l)} }`),x.length&&o.push(`${a} { ${g(x)} }`),p[P]&&(o.push(`*:has(> ${a}) { ${P}: ${p[P]} }`),o.push(...wt(a,`*:has(> ${a})`)));const d=Object.entries(s.tablet??{}).filter(([,u])=>u!=="");d.length&&o.push(`@media ${n} { ${a}, *:has(> ${a}) { ${g(d)} } }`);const _=Object.entries(s.phone??{}).filter(([,u])=>u!=="");_.length&&o.push(`@media ${i} { ${a}, *:has(> ${a}) { ${g(_)} } }`)};for(const s of e.rules.values())f(s);for(const s of e.kindRules.values())f(s);return o.join(`
|
|
2
|
+
`)}function wt(e,t){const n=`var(${P})`,i=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${e} ${i}:not(:first-child) { margin-top: ${n} }`,`${e} ${i}:not(:last-child) { margin-bottom: ${n} }`,`:is(${t}) + :is(${t}) { margin-top: ${n} }`]}const $t=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function cn(e,t){if(!e)return null;const n=y(t),i=e.rules.get(n);if(i)return i;if(n.length<kt||e.drawn.has(n))return null;let o=null;for(const[r,f]of e.rules)if(r.includes(n)){if(o&&o.stamp!==f.stamp)return null;o=f}return o}const kt=8;export{E as PART_ALIGNS,ve as PART_LETTER_EM_MAX,je as PART_LETTER_EM_MIN,De as PART_LETTER_STEP,Ue as PART_LINE_HEIGHT_MAX,Ce as PART_LINE_HEIGHT_MIN,Le as PART_LINE_STEP,ee as PART_MEASURED_TRACKS,Ie as PART_NUDGE_MAX,Oe as PART_NUDGE_MIN,ye as PART_PADDING_MAX,Fe as PART_PADDING_MIN,Me as PART_PADDING_STEP,ce as PART_PARAGRAPH_ATTR,Ge as PART_PARAGRAPH_MAX,We as PART_PARAGRAPH_MIN,P as PART_PARAGRAPH_VAR,He as PART_RELATIVE_PROPS,it as PART_SIZE_CAP_VAR,C as PART_SIZE_MAX,H as PART_SIZE_MIN,Ke as PART_SIZE_STEPS,we as PART_STYLED_ATTR,D as PART_STYLES_PROP,_t as PART_STYLE_PROPERTIES,T as PART_UNIT_KEY_OF,Ne as PART_WEIGHTS,X as SHARED_PART_PROPERTIES,Q as STYLE_ID_OF_ROLE,J as TEXT_STYLE_ATTR,tn as applyPartStyles,Xt as blockCapsPartSize,Yt as blockDrawsTextStyle,jt as followedStyleOf,At as isPartKindKey,m as isTextStyleId,wt as paragraphRules,Vt as partAlignFollowed,G as partCanvasDeclarations,et as partCaseOfTransform,tt as partCaseTransform,Qt as partFontKeyOf,vt as partLiftRules,ft as partPhoneDeclarations,sn as partRuleForKind,cn as partRuleForText,qt as partShownDeclarations,ut as partSizeBoxOf,Zt as partSizeFollowed,at as partSpacingOf,Jt as partStyleBase,Gt as partStyleCount,fn as partStyleCss,K as partStyleDeclarations,lt as partStyleForScreen,en as partStyleSource,ae as partStyleWithoutSizeBox,ct as partTabletDeclarations,Kt as propsWithPartStyleValue,Bt as propsWithoutPartStyle,an as publishedPartStyles,te as readPartStyle,Wt as readPartStyles,Pt as regionCanvasDeclarations,rn as regionCanvasRestore,nn as regionHasOwnLook,Tt as regionSheetStyle,on as regionShownDeclarations,ht as storedPartStyle,Et as viewMediaOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{CardRowDrawn as P}from"../../../components/CardRowContext.js";import{PublishedPartStyles as h}from"../../../components/PublishedPartStylesContext.js";import{readPartStyles as y}from"../part-styles.js";import{readPartMotions as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{CardRowDrawn as P}from"../../../components/CardRowContext.js";import{PublishedPartStyles as h}from"../../../components/PublishedPartStylesContext.js";import{readPartStyles as y}from"../part-styles.js";import{readPartMotions as C}from"../../animation/part-motion.js";import{partNeedles as _}from"../text-parts.js";import{CARD_LIST_TYPE as u,HOST_PART_TYPE as x,rowPartByKey as S}from"../../../../format/lib/content/card-template.js";import{BOX_TYPE as T}from"../../../../format/lib/document/container-blocks.js";import{BlockSizeCapsProvider as b}from"../editing-bridges.js";const Y={name:"clickableParts",applies:(n,e,a)=>typeof a?.render=="function"&&n!==u&&n!==x,draw(n,e,a){const r=n,p=()=>r.textParts??r.fields,c=r.partSizeCaps,l=r.render,m=a.inspector?.PartAnchors,f=(t,s)=>_(p(),s,o=>S(e,t,o));r.render=t=>{const s=y(t),o=C(t);return t.editor?.isEditing&&m?i(P,{type:e,props:t,children:d=>i(m,{needles:f(t,d),styles:s,motions:o,type:e,sizeCaps:c,children:i(b,{value:c,children:l(t)})})}):!Object.keys(s).length&&!Object.keys(o).length?l(t):i(P,{type:e,props:t,children:d=>i(h,{needles:f(t,d),styles:s,motions:o,type:e,atEdge:e===T,sizeCaps:c,children:l(t)})})}}};export{Y as clickableParts};
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
2
|
+
declare const SectionCssStyle: import("react").LazyExoticComponent<typeof import("../section-css-style.js").default>;
|
|
3
|
+
export declare function ScopedCssStyle({ css, id, attr }: {
|
|
4
|
+
css: string;
|
|
5
|
+
id: string;
|
|
6
|
+
attr?: Parameters<typeof SectionCssStyle>[0]["attr"];
|
|
7
|
+
}): import("react").JSX.Element;
|
|
2
8
|
export declare const sectionCustomCss: BlockPass;
|
|
9
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as c}from"react/jsx-runtime";import{lazy as d}from"react";import{CellWrap as a}from"../../../components/InBoxContext.js";import{SECTION_CSS_KEY as f,SECTION_CSS_SCOPE_ATTR as l,sectionCssOf as C}from"../../../../format/lib/content/section-css.js";const o=d(()=>import("../section-css-style.js"));function x({css:t,id:e,attr:s}){return i(o,{css:t,id:e,attr:s})}const y={name:"sectionCustomCss",applies:(t,e,s)=>e.isSection(t)&&!!s&&typeof s.render=="function",panel(t,e,s){t.fields={...t.fields,...s.customCssFields()}},draw(t){t.defaultProps={...t.defaultProps,[f]:""};const e=t.render;t.render=s=>{const r=C(s),n=typeof s.id=="string"?s.id:"";return!r||!n?e(s):c(a,{className:"sf-section-css",attrs:{[l]:n},children:[i(o,{css:r,id:n}),e(s)]})}}};export{x as ScopedCssStyle,y as sectionCustomCss};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type OwnFrame } from "../../content/section-padding.js";
|
|
2
2
|
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
3
3
|
type InnerPadding = {
|
|
4
4
|
top: number;
|
|
@@ -14,9 +14,9 @@ export declare const ownPairDefault: (key: string) => InnerPadding | undefined;
|
|
|
14
14
|
export declare const PAD_ON_ROOT: ReadonlySet<string>;
|
|
15
15
|
export declare const PADS_ITS_OWN_SPACE: ReadonlySet<string>;
|
|
16
16
|
export declare const sectionPadding: BlockPass;
|
|
17
|
-
export declare const OWN_PAD_FRAME: Readonly<Record<string, (props: Record<string, unknown>) =>
|
|
17
|
+
export declare const OWN_PAD_FRAME: Readonly<Record<string, (props: Record<string, unknown>) => OwnFrame>>;
|
|
18
18
|
export declare const OWN_PAD_LABEL: Readonly<Record<string, string>>;
|
|
19
19
|
export declare function withPadTotals(props: Record<string, unknown>, changed: Readonly<Record<string, unknown>> | undefined): Record<string, unknown>;
|
|
20
|
-
export declare function olderPadNote(props: Record<string, unknown>, frame: number): string | null;
|
|
20
|
+
export declare function olderPadNote(props: Record<string, unknown>, frame: number, side?: "top" | "bottom"): string | null;
|
|
21
21
|
export declare const blockPadding: BlockPass;
|
|
22
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{SideOnceClass as I}from"../../../components/SideSpaceOnce.js";import{HideTaker as C}from"../../../components/ViewHideRoot.js";import{LineChoice as F}from"../../../components/InBoxContext.js";import{isBackgroundBox as L}from"../../../../format/lib/content/box-background.js";import{boxSideSpaceOf as R}from"../../../../format/lib/content/box-side-space.js";import{SECTION_OWN_PADS as W}from"../../content/section-own-pads.js";import{BAND_PAD_KEYS as m,BAND_PAD_UNIT_KEY as y,BLOCK_PAD_FRAME as P,PAD_TOTAL_KEY as c,SECTION_PAD_KEYS as h,framePadAttrs as K,padTotalKeys as S,padValuesOf as H,sectionPadAttrs as j,tierFramesOf as D}from"../../content/section-padding.js";import{readPartStyle as v}from"../part-styles.js";import{CRUMB_PAD as Y,SPEC_PAD as M}from"../../../../format/lib/sections/strip-shape.js";import{say as U}from"../../../../format/lib/editor-words.js";import{sectionFillPassClass as E}from"../../../../format/lib/content/section-min-height.js";import{COPIES_IN_THE_BOX as $,drawsCopiesInTheBox as k}from"../../../../format/lib/content/copies-in-box.js";import{ownEntry as f}from"../../../../format/lib/own-entry.js";const B={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120}},Pt=new Set(Object.keys(B));function A(t,e){return e?.innerPadding??f(B,t)}const _t=t=>A(t)??{},gt=t=>f({DetailRows:{top:100,bottom:100}},t),T=new Set(["Flex","Text","Heading","ImageBlock","ButtonBlock"]),V=new Set(["Divider"]),X=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),N=new Set(["ProductGrid"]);function b(t,e,n=!1,o){const a=t.render;t.render=r=>{if(e?.(r))return a(r);const s={...H(r,h,n),sideSpace:R(r.sideSpace)},d=o?K({values:s,frame:o(r)},!0).outer:j(s),i=a(r);if(!d)return i;const l=u=>g(I,{className:u?`${d.className} ${u}`:d.className,children:w=>g(C,{className:w,style:d.style,children:i})}),_=E(r,{atSectionLine:!0}),x=E(r);return _===x?l(_):g(F,{line:"by-box",draw:u=>l(u?x:_)})}}const mt={name:"sectionPadding",applies:(t,e,n)=>e.isSection(t)&&!X.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const o=A(e,t);if(o){t.fields={...t.fields,...n.sidesPaddingFields({keys:m,unitKey:y,fallback:o,tablet:!0,siteSide:!0})};return}if(N.has(e))return;const a=[m.top,m.bottom].filter(s=>t.fields!=null&&s in t.fields);if(a.length)throw new Error(`section-padding: ${e} declares its own ${a.join(" / ")} row; declare \`innerPadding: { top, bottom }\` in its meta and the one Padding row draws on its band`);const r=f(O,e);if(r){p(t,e,n,r);return}t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})}},draw(t,e){if(!A(e,t)){if(N.has(e)){b(t);return}T.has(e)||V.has(e)||b(t,e==="Flex"?n=>L(n.bgImage):$.has(e)?n=>k(e,n):void 0,!0,f(O,e))}}},G=["Heading","Text","ImageBlock","ButtonBlock"],q=["LogoBlock"],O={Text:t=>v(t,"text").textStyle?.startsWith("heading-")?P.heading:P.text,Heading:()=>P.heading,ButtonBlock:()=>P.text,Breadcrumb:()=>D(Y),SpecStrip:()=>D(M),...Object.fromEntries(Object.entries(W).map(([t,e])=>[t,e.frame]))},z={ButtonBlock:"Outer padding"};function J(t,e){const n=t[c],o=Array.isArray(n)?n.filter(i=>typeof i=="string"):[],a=S().filter(i=>e?.[i]);if(!a.length)return t;const r=[...o.filter(i=>!a.includes(i)),...a.filter(i=>typeof t[i]=="number")];if(r.length===o.length&&r.every((i,l)=>i===o[l]))return t;const{[c]:s,...d}=t;return r.length?{...d,[c]:r}:d}function Q(t,e,n){if(e<=0)return null;const o=Array.isArray(t[c])?t[c]:[];return(n?S().filter(s=>s.startsWith(h[n])):S()).some(s=>typeof t[s]=="number"&&!o.includes(s))?U("plus {n} px (older setting)",{n:e}):null}function p(t,e,n,o){t.fields={...t.fields,...n.ownPaddingFields?.(o,Q,f(z,e))??n.sidesPaddingFields({tablet:!0,siteSide:!0})};const a=t.resolveData;t.resolveData=(r,s)=>{const d=r.props??{},i=s?.trigger==="replace"?J(d,s.changed):d,l=i===d?r:{...r,props:i};return a?a(l,s):l}}const St={name:"blockPadding",applies:(t,e,n)=>(G.includes(t)||q.includes(t))&&!!n&&typeof n.render=="function",panel(t,e,n){const o=f(O,e);if(!o){t.fields={...t.fields,...n.sidesPaddingFields({tablet:!0,siteSide:!0})};return}p(t,e,n,o)},draw(t,e){T.has(e)||b(t,void 0,!0)}};export{O as OWN_PAD_FRAME,z as OWN_PAD_LABEL,V as PADS_ITS_OWN_SPACE,T as PAD_ON_ROOT,Pt as SECTION_PAD_INNER,B as SECTION_PAD_INNER_DEFAULTS,St as blockPadding,_t as innerPaddingFallback,Q as olderPadNote,gt as ownPairDefault,mt as sectionPadding,J as withPadTotals};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as d}from"react/jsx-runtime";import{HideTaker as s}from"../../../components/ViewHideRoot.js";import{
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import{HideTaker as s}from"../../../components/ViewHideRoot.js";import{SideOnceClass as X}from"../../../components/SideSpaceOnce.js";import{LineChoice as q}from"../../../components/InBoxContext.js";import{BOX_TYPE as z}from"../../../../format/lib/document/container-blocks.js";import{INTRO_EDGE_CLASS as J}from"../../../../format/lib/sections/intro-bleed-layout.js";import{cssLengthOf as G}from"../../../../format/lib/content/css-length.js";import{resolveContainerDirection as Q}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as Z,HERO_CHROME_CAP_VAR as tt,HERO_CHROME_INSET_VAR as nt,FULL_SECTION_WIDTH as et,SITE_WIDTH_CAP as _,centredCap as v,heroBackgroundTokens as ot}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as D,SECTION_WIDTH_KEYS as F,hasOwnSectionWidth as it,hasWidthFamily as rt,resolveWidth as L,siteWidthsOf as ct}from"../../../../format/lib/content/section-width.js";import{boxCardProps as lt}from"../../../../format/lib/content/box-background.js";import{cardCopyPlace as dt}from"../../../../format/lib/content/card-template.js";import{BOX_GUTTER_KEY as ut,boxGutterOf as st,boxPlaceOf as at,boxRunsEdgeToEdge as ft,isFrameContainer as O,ownNodeWidth as ht,sectionGroundAnswer as _t,siteDrawsGutter as Nt}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as wt}from"../../../../format/lib/document/editor-site-widths.js";import{GroundStopsAt as H,NestedBoxChoice as Ct,SectionGroupChoice as Ot,SectionGroupWidthsProvider as Et,SectionRootChoice as Tt,SplitBandAndColumn as M}from"../../../components/SiteGutterFrame.js";import{FRAME as P}from"../../../components/BlockFrame.js";import{sectionFillPassClass as p}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as mt}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as E,withRowsShownWhen as T}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as St,heldByANode as pt,isNestedNode as xt,NOT_HELD_BY_A_NODE as y}from"../../../../format/lib/document/passes/document-position.js";import{ownEntry as U}from"../../../../format/lib/own-entry.js";const w="--sf-sw-site",Rt="--sf-sw-content",At="--sf-bg-cap",Wt="contents [--sf-site-width:var(--sf-sw-content)] max-view-wide:[--sf-site-width:var(--sf-sw-site)]",A=({own:n,content:t,siteContent:e})=>n===!0&&t==="full"&&e!=="full",k="contents view-wide:[--sf-site-width:100vw]",W=({held:n},t,e)=>n?e:d(s,{className:t,children:e}),It=`contents view-wide:[--sf-site-width:100vw] ${J} view-wide:[--sf-site-gutter:var(--intro-edge)]`,I=(n,t,e)=>t==="content"?`min(${G(n,e)},var(${w}))`:G(n,e);function m({content:n,contentMax:t,contentMaxUnit:e},o){return n==="full"?o!=="content"?et:null:t===null?null:I(t,o,e)}function S(n,t){return t===null?n:d(s,{className:"contents",style:{[w]:_},children:d(s,{className:Wt,style:{[Rt]:t},children:n})})}const bt="--sf-content-cap",gt="contents max-view-wide:[--sf-content-cap:none]";function Bt({content:n,contentMax:t,contentMaxUnit:e},o){return n==="full"?null:t!==null?I(t,o,e):o==="content"?null:`var(${w})`}function Gt(n,t){return t===null?n:d(s,{className:"contents",style:{[w]:_},children:d(s,{className:gt,style:{[bt]:t},children:n})})}const V=`var(${w},${_})`,h=(n,t,e="")=>n==="content"?d(s,{className:e||void 0,style:v(_),children:d(H,{ground:V,children:t})}):t;function $(n,t,e,o,c){if(A(e))return h(o,W(e,k,d(M,{children:n({...t,contained:!0})})),c);if(e.content==="full")return h(o,n({...t,contained:!1}),c);const i=m(e,o);return o==="content"&&i===null&&!e.own?n({...t,contained:!0}):h(o,S(d(M,{children:n({...t,contained:!0})}),i),c)}function vt(n,t,e,o,c){if(e==="hero"){const l=S(n(t),m(o,o.band));return o.band==="full"?d(s,{style:{[Z]:"none",[nt]:"initial",[tt]:"initial"},children:l}):o.band==="content"?d(s,{style:ot(!0),children:l}):l}const i=o.band??"full",r=p(t,{atSectionLine:!c});if(e==="rawMarkup"){if(o.content==="full")return h(i,n(t),r);const l=o.contentMax===null?_:I(o.contentMax,i,o.contentMaxUnit);return d(s,{className:"contents",style:{[w]:_},children:h(i,d(s,{className:r||void 0,style:v(l),children:n(t)}),r)})}if(e==="scrollOver"){const l=o.content==="full",u=A(o)?W(o,It,n({...t,fullWidth:!1})):S(n({...t,fullWidth:l}),l?null:m(o,i));return i==="content"?d(s,{className:"contents",style:{[At]:_},children:u}):u}switch(e){case"both":return h(i,Gt(n(t),Bt(o,i)),r);case"contained":return $(n,t,o,i,r);case"contentColumn":case"contentFull":case"productGrid":{const l=A(o),u=o.content==="full"&&!l?"full":"page",a=l?W(o,k,n({...t,widthMode:u})):S(n({...t,widthMode:u}),o.content==="full"?null:m(o,i));return e==="productGrid"&&!o.own?i==="content"?d(X,{className:r?`${P} ${r}`:P,children:N=>d(s,{className:N,children:a})}):a:h(i,a,r)}default:return h(i,S(n(t),m(o,i)),r)}}function Y(n,t,e,o,c){const i=c===z?"edge":"by-box",r=l=>vt(n,t,e,o,l);return i==="edge"?r(!0):p(t)===p(t,{atSectionLine:!0})?r(!1):d(q,{line:i,draw:r})}function Dt(n,t){const e=U(D,t);if(!e)return;const o=n.render;n.render=c=>{const i=ct(c),r={band:i.background,content:i.content??"content",contentMax:null},l=()=>e==="rawMarkup"?o(c):d(Ot,{draw:f=>f?.background==="content"?d(H,{ground:V,children:u(f)}):u(f)}),u=f=>{const C=f?{...r,band:f.background==="content"?r.band:f.background??r.band,content:f.content??r.content,own:f.background==="full"||f.content!==null,held:!0,siteContent:r.content}:r,R=Y(o,c,e,C,t);if(!O(t))return R;const g=st(c),B=g===void 0?C.content:g?"content":"full";return B===C.content?R:d(Ct,{atTop:R,nested:$(o,c,{...C,content:B,own:!1},C.band??"full",p(c))})},a=ht(t,c);if(!it(a))return l();const N=e==="rawMarkup",b=_t(t,c),j=a.content??(N?"full":r.content),x={band:b,content:b==="content"?"content":j,contentMax:a.contentMax,contentMaxUnit:a.contentMaxUnit,own:!N,siteContent:r.content};return d(Tt,{own:()=>d(Et,{value:{background:x.band,content:x.content},children:Y(o,c,e,x,t)}),followed:l})}}const Ft={all:[y,{not:{context:"runsEdgeToEdge",is:!0}}]},an={name:"sectionWidth",applies:(n,t,e)=>rt(n)&&!!e&&typeof e.render=="function",panel(n,t,e){const o=e.sectionOwnWidthFields({drawsFullOnItsOwn:U(D,t)==="rawMarkup"}),c=O(t)?e.boxGutterFields():{},i={...n.fields,...c,...o},r=O(t)?K(t,n,i,[ut]):i;E(n,{heldByANode:pt}),O(t)&&E(n,{runsEdgeToEdge:(l,u)=>ft(lt(l.props??{},dt(u.appState,l.props?.id)?.inCopy!==!1))}),n.fields=T(r,[F.background,F.content],O(t)?Ft:y)},draw(n,t){Dt(n,t)}};function Lt(n,t){if(!n||!("widthMode"in n))return n;const e={...n},o=e.widthMode;return o&&(e.widthMode={...o,currentValue:t.mode,inherited:t.inherited}),e}const Ht=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),fn={name:"containedWidth",applies:(n,t,e)=>Ht.has(n)&&!!e&&typeof e.render=="function",panel(n,t,e){const o=e.widthField;n.fields=K(t,n,{...n.fields,...o("page")});const c=n.resolveFields;n.resolveFields=(i,r)=>{const l=c?c(i,r):r.fields,u=L(i?.props??{},"page"),a=N=>Lt(N,u);return l&&typeof l.then=="function"?l.then(a):a(l)}},draw(n){const t=n.render;n.render=e=>{const{mode:o}=L(e,"page");return t({...e,contained:o!=="full"})}}},Mt={not:{context:"inHeroGroupRow",is:!0}},hn={name:"buttonAlignInRow",applies:n=>n==="ButtonBlock",panel(n){const t=n;t.fields=T(t.fields??{},["align"],Mt),E(t,{inHeroGroupRow:(e,o)=>{const c=St(o.appState,e.props?.id);return!!c&&c.type==="HeroGroup"&&Q("HeroGroup",c.props?.direction)==="row"}})}};function Pt(n){return Object.values(n).some(t=>!!t&&typeof t=="object"&&t.type==="slot")}const yt={any:[]},Ut={all:[{not:{context:"outsideBox",is:!0}},{not:{context:"insideSiteGutter",is:!0}}]},kt={not:{context:"widthCappedByParent",is:!0}};function K(n,t,e,o=["widthMode"]){if(n==="ButtonBlock")return T(e,["_gWidth",...o],yt);if(Pt(e)){const c=(i,r)=>at(r.appState?.data?.content,i.props?.id,Nt(wt()));return E(t,{outsideBox:(i,r)=>c(i,r)?.inBox!==!0,insideSiteGutter:(i,r)=>c(i,r)?.insideGutter}),T(e,o,Ut)}return E(t,{widthCappedByParent:(c,i)=>"parent"in i?mt(i.parent):xt({props:c.props??{}},i)}),T(e,o,kt)}export{At as SECTION_BACKGROUND_VAR,gt as SECTION_CONTENT_CAP_CLASS,bt as SECTION_CONTENT_CAP_VAR,Wt as SECTION_CONTENT_CLASS,Rt as SECTION_CONTENT_VAR,w as SITE_CONTENT_VAR,hn as buttonAlignInRow,fn as containedWidth,an as sectionWidth,Lt as widthModeFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{SECTION_CSS_SCOPE_ATTR as n}from"../../../format/lib/content/section-css.js";import{scopeCustomCss as m}from"./custom-css.js";function l({css:t,id:s,attr:e=n}){const o=m(t,s,e);return o?r("style",{dangerouslySetInnerHTML:{__html:o}}):null}export{l as default};
|