efficient-web-builder 55.3.0 → 56.0.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 +41 -0
- package/dist/editor/components/BlockGapField.d.ts +1 -2
- package/dist/editor/components/BlockGapField.js +1 -1
- package/dist/editor/components/CardShadowField.d.ts +1 -2
- package/dist/editor/components/CardShadowField.js +1 -1
- package/dist/editor/components/ChatSettingsPanel.js +1 -1
- package/dist/editor/components/CornersField.d.ts +1 -2
- package/dist/editor/components/CornersField.js +1 -1
- package/dist/editor/components/HoverEffectField.d.ts +1 -2
- package/dist/editor/components/HoverEffectField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PhotographyField.d.ts +1 -2
- package/dist/editor/components/PhotographyField.js +1 -1
- package/dist/editor/components/SectionEditor.js +1 -1
- package/dist/editor/components/SectionThumbnail.js +1 -1
- package/dist/editor/components/ShadowColourField.d.ts +1 -2
- package/dist/editor/components/ShadowColourField.js +1 -1
- package/dist/editor/components/ShareButtonField.d.ts +1 -2
- package/dist/editor/components/ShareButtonField.js +1 -1
- package/dist/editor/components/SideSpaceField.d.ts +1 -2
- package/dist/editor/components/SideSpaceField.js +1 -1
- package/dist/editor/components/SocialLinksPanel.js +1 -1
- package/dist/editor/components/SourceStatus.d.ts +2 -1
- package/dist/editor/components/SourceStatus.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/StylesPanel.js +1 -1
- package/dist/editor/components/WebsiteHintsProvider.d.ts +8 -0
- package/dist/editor/components/WebsiteHintsProvider.js +1 -0
- package/dist/editor/components/WebsiteSettingsPanel.d.ts +6 -17
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +35 -34
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/sections/new-section-node.js +1 -1
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +5 -3
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/cell-picture-sizes.d.ts +31 -0
- package/dist/format/lib/content/cell-picture-sizes.js +1 -0
- package/dist/format/lib/content/image-aspect.d.ts +1 -0
- package/dist/format/lib/content/image-aspect.js +1 -1
- package/dist/format/lib/content/mirror-cards.d.ts +1 -1
- package/dist/format/lib/content/mirror-cards.js +1 -1
- package/dist/format/lib/document/article-body-seed.d.ts +10 -0
- package/dist/format/lib/document/article-body-seed.js +1 -0
- package/dist/format/lib/document/blocks/general/Timeline/meta.d.ts +2 -1
- package/dist/format/lib/document/blocks/general/Timeline/meta.js +2 -2
- package/dist/format/lib/document/blocks/placeholders.d.ts +1 -0
- package/dist/format/lib/document/blocks/placeholders.js +1 -1
- package/dist/format/lib/document/easel-row-words.d.ts +1 -1
- package/dist/format/lib/document/easel-row-words.js +1 -1
- package/dist/format/lib/document/section-catalog.js +2 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +6 -0
- package/dist/format/lib/editor-words-catalogue.js +3 -3
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/fit-words.js +2 -2
- package/dist/format/lib/hero-video.d.ts +2 -0
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/sections/timeline-year-shape.js +1 -1
- package/dist/format/lib/sized-image.d.ts +1 -0
- package/dist/format/lib/sized-image.js +1 -1
- package/dist/format/lib/source-rules/page-picture-place.d.ts +6 -0
- package/dist/format/lib/source-rules/page-picture-place.js +4 -0
- package/dist/format/lib/source-rules/part-style-naming.js +2 -2
- package/dist/format/lib/web-backend.d.ts +8 -0
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/BoxCellWidthContext.d.ts +13 -0
- package/dist/render/components/BoxCellWidthContext.js +1 -1
- package/dist/render/components/Flex.d.ts +2 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroPictures.d.ts +2 -1
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroPoster.d.ts +4 -1
- package/dist/render/components/HeroPoster.js +1 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSlide.d.ts +3 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/HeroVideoPlay.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/Manifesto.js +1 -1
- package/dist/render/components/Placeholder.d.ts +2 -1
- package/dist/render/components/Placeholder.js +1 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/lib/content/block-size.d.ts +1 -0
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/box-cell-bound.d.ts +17 -0
- package/dist/render/lib/content/box-cell-bound.js +1 -0
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Timeline/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +1 -0
- package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -2
- 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-timeline.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +2 -2
- package/dist/render/lib/document/page-render.js +1 -1
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/slot-counts.d.ts +8 -0
- package/dist/render/lib/document/slot-counts.js +1 -0
- package/dist/render/lib/first-screen.d.ts +28 -0
- package/dist/render/lib/first-screen.js +1 -0
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/site-runtime.d.ts +1 -0
- package/package.json +3 -3
- package/dist/editor/components/KeepHint.d.ts +0 -5
- package/dist/editor/components/KeepHint.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{VIEW_DESKTOP_MIN as f,VIEW_TABLET_MIN as h}from"efficient-easel/draw";import{boxPhoneRowFits as p,boxRowColumnsClass as w,boxRowTabletColumnsClass as C,boxRowTabletShareClass as T,boxShareClasses as R,boxShareTabletOf as S}from"../../../format/lib/content/box-layout.js";import{isStripBox as k}from"../../../format/lib/content/box-separator.js";import{BOX_STACK_LINE as l,storedStackLine as O}from"./box-stack-line.js";const E={phone:1,tablet:1,desktop:1},I=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1?e:void 0;function g(e){if(e.direction==="column")return E;if(e.direction!=="row"||k(e.direction,e.separator)||e.loop==="scroll"||e.line===!0||e.shared)return;const o=I(e.count),a=d=>d==="equal"&&o?1/o:1,s=w(e)!==""?1/e.columns:a(e.share),n=Number(e.phoneRow);let t=1;(n===2||n===3)&&!p(e.phoneRow,e.sharePhone)&&(t=R(e.share)!==""?o?1/(o%n||n):1:1/n);const u=C(e)!==""?e.columnsTablet:void 0,i=T(e)!==""?S(e.shareTablet):null,c=u!==void 0?1/u:i!==null?a(i):void 0,r=c===void 0?O(e.stackBelow):void 0;if(r!==void 0&&r>l)return{phone:t,tablet:1,desktop:r>f?1:s};const m=c??Math.max(t,l<f?s:0);return{phone:h<=l?t:Math.max(t,s),tablet:m,desktop:s}}export{g as boxCellFractions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{phoneKey as a,tabletKey as n}from"efficient-easel/draw";import{BOX_SWATCH_PROP as c}from"../../../../../../format/lib/content/box-background.js";import{sharedColumnsDrawn as h,sharedRowsDrawn as m}from"../../../../content/box-shared-columns.js";import{CountRowsContext as b,NO_COUNTS as g}from"../../../../../components/CountRowsContext.js";import{RowEmptyGate as f}from"../../../../../components/CardRowContext.js";import{BOX_HIDE_WHEN_ROW_EMPTY as u}from"../../../../../../format/lib/content/card-template.js";import S from"../../../../../components/Flex.js";import{loopDelayOf as w,loopSecondsOf as k,parseLoop as y,parseLoopDirection as P}from"../../../../../../format/lib/animation/index.js";import{COUNTS_SOURCE as T,declaredBlockSource as C,servedRows as x}from"../../../../../../format/lib/content/block-sources.js";import{padValuesOf as O}from"../../../../content/section-padding.js";import{sectionFillsHeight as D}from"../../../../../../format/lib/content/section-min-height.js";import{pictureHoverOf as R}from"../../../../../../format/lib/animation/hover.js";import{slotCountOf as j}from"../../../slot-counts.js";import{FlexMeta as B}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";const G={...B,render:e=>{const l=!!e.editor?.isEditing,d=t(S,{direction:e.direction,label:e.label,tabShape:e.tabShape,gap:e.gap,gapPhone:e[a("gap")],gapTablet:e[n("gap")],justify:e.justify,justifyTablet:e[n("justify")],justifyPhone:e[a("justify")],align:e.align,alignTablet:e[n("align")],alignPhone:e[a("align")],wrap:e.wrap,wrapTablet:e[n("wrap")],share:e.share,sharePhone:e[a("share")],shareTablet:e[n("share")],wrapPhone:e[a("wrap")],orderPhone:e[a("order")],phoneRow:e.phoneRow,columns:e.columns,columnsTablet:e[n("columns")],separator:e.separator,stackBelow:e.stackBelow,blockSpacing:e.blockSpacing,blockSpacingTablet:e[n("blockSpacing")],blockSpacingPhone:e[a("blockSpacing")],bgImage:e.bgImage,bgImagePhone:e.bgImagePhone,pictureHover:R(e),darken:e.darken,darkenStyle:e.darkenStyle,darkenTablet:e[n("darken")],darkenPhone:e[a("darken")],darkenStyleTablet:e[n("darkenStyle")],darkenStylePhone:e[a("darkenStyle")],placement:e.placement,padV2:e.padV2===!0,border:e.sectionBorder,borderTablet:e.sectionBorderTablet,borderPhone:e.sectionBorderPhone,pad:O(e),contained:e.contained,fillHeight:D(e),shadow:e.shadow,shadowTablet:e[n("shadow")],shadowPhone:e[a("shadow")],loop:y(e.loop),scrollDirection:P(e.scrollDirection),loopSeconds:k({loopDuration:e.loopDuration}),loopDelay:w({loopDelay:e.loopDelay}),editing:l,fillColor:e.fillColor,fillColorTablet:e[n("fillColor")],fillColorPhone:e[a("fillColor")],swatch:e[c],line:e.line,upcoming:e.upcoming,link:e.link,boxShape:e.boxShape,boxShapePhone:e[a("boxShape")],boxShapeTablet:e[n("boxShape")],jumpHighlight:e.jumpHighlight,anchor:e.anchor,sharedSides:h(e),sharedRows:m(e),boxId:typeof e.id=="string"?e.id:void 0,slotCount:j(e),mirrorCards:e.mirrorCards,content:e.content,rowTitle:e.rowTitle,startsOpen:e.startsOpen}),o=C(e),r=o?o===T?x(e):g:null,i=t(b.Provider,{value:r,children:d});return e[u]===void 0?i:t(f,{props:e,editing:l,children:i})}};export{G as FlexRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as w}from"react/jsx-runtime";import x from"../../../../../components/HeroSlide.js";import{nestedAccentValue as M,sectionThemeWrap as O}from"../../../../../../format/lib/content/section-surface.js";import{phHide as V}from"../../scaffold.js";import{HeroSlideMeta as N}from"../../../../../../format/lib/document/blocks/general/HeroSlide/meta.js";import{loadingStill as R}from"../../../../../../format/lib/hero-video.js";import{LATER_SLIDES_KEY as U}from"../../../../first-screen.js";import{viewFocusValues as c}from"../../../../../../format/lib/content/picture-focus-rows.js";const J={...N,render:o=>{const{name:p,process:u,mediaType:e,mediaVideo:y,mediaImage:f,poster:g,loadingShows:b,videoFrame:S,mediaSrc:P,videoSpeed:n,tintColor:v,overlay:h,groups:j,editor:i,overlayColor:r,overlayPosition:d,mediaLayout:C,mediaLayoutPhone:L,mediaImage2:A,tintColor2:T,tintOpacity2:k,videoSource:E,youtubeUrl:F,videoPlayback:H,_partMotion:I,id:_,...m}=o,t=c(o,"imageFocal"),a=c(o,"imageFocal2"),s=i?.metadata?.[U],l=O({...m,sectionAccent:M(m.sectionAccent)});return w(x,{themeClassName:l?.className,themeStyle:l?.style,name:p||void 0,process:V(u,"Label",i),mediaType:e,mediaSrc:(e==="image"?f:y||P)||void 0,videoSpeed:typeof n=="number"?n:void 0,poster:R({loadingShows:b,poster:g,videoFrame:S}),objectPosition:e==="image"?t.desktop:void 0,objectPositionPhone:e==="image"?t.phone:void 0,objectPositionTablet:e==="image"?t.tablet:void 0,tintColor:v,tintOpacity:e==="image"?h:0,groups:j,editing:i?.isEditing,overlayColor:typeof r=="string"?r:void 0,overlayPosition:typeof d=="string"?d:void 0,mediaLayout:C,mediaLayoutPhone:L,mediaImage2:A||void 0,objectPosition2:a.desktop,objectPosition2Phone:a.phone,objectPosition2Tablet:a.tablet,tintColor2:T,tintOpacity2:k,videoSource:E,youtubeUrl:F,videoPlayback:H,partMotion:I,...Array.isArray(s)&&s.includes(_)?{laterSlide:!0}:{}})}};export{J as HeroSlideRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import n from"../../../../../components/Timeline.js";import r from"../../../../../components/TimelineTrack.js";import{resolveSectionBackground as f}from"../../../../../../format/lib/content/section-background.js";import{SECTION_BG_BUILT_IN as l}from"../../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{TIMELINE_TRACK_PH as a,timelineTrackScaffoldEntries as c}from"../../../../../../format/lib/document/blocks/general/TimelineTrack/meta.js";import{phRows as m,phHide as e,ctaHide as o}from"../../scaffold.js";import{TimelineMeta as T,TIMELINE_PH as i,timelineScaffoldEntries as u}from"../../../../../../format/lib/document/blocks/general/Timeline/meta.js";function b(t){return{date:t.date,title:t.title,blurb:t.body,future:t.future}}const H={...T,render:t=>t.layout==="track"?d(r,{eyebrow:e(t.eyebrow,a.eyebrow,t.editor),title:e(t.title,a.title,t.editor),intro:e(t.intro,a.intro,t.editor),entries:m(Array.isArray(t.entries)?t.entries.map(b):[],c(),t.editor),cta:o(t.ctaText,t.ctaHref,t.editor),background:f(t.background,l.TimelineTrack),padTop:typeof t.padTop=="number"?t.padTop:120,padBottom:typeof t.padBottom=="number"?t.padBottom:120,editing:t.editor?.isEditing}):d(n,{layout:t.layout||"split",eyebrow:e(t.eyebrow,i.eyebrow,t.editor),title:e(t.title,i.title,t.editor),intro:e(t.intro,i.intro,t.editor),imageSrc:t.imageSrc||void 0,imageCaption:e(t.imageCaption,i.imageCaption,t.editor),imageMeta:e(t.imageMeta,i.imageMeta,t.editor),cta:o(t.ctaText,t.ctaHref,t.editor),entries:m(t.entries,u(),t.editor),padTop:typeof t.padTop=="number"?t.padTop:120,padBottom:typeof t.padBottom=="number"?t.padBottom:120,editing:t.editor?.isEditing})};export{H as TimelineRender};
|
|
@@ -6,5 +6,6 @@ export declare const HEAD_BELOW: Readonly<Record<HeadLook, number>>;
|
|
|
6
6
|
export declare function editorialHeadTree(num: string, title: string, description: string): PartRow;
|
|
7
7
|
export { token } from "../../../../../format/lib/document/seed-parts.js";
|
|
8
8
|
export declare const fluidToken: (step: string, minPx: number, vw: number, px: number) => Props;
|
|
9
|
+
export declare function headWordsOnPhoneLine(part: PartRow): PartRow;
|
|
9
10
|
export declare function headReads(type: string): Readonly<Record<string, string>>;
|
|
10
11
|
export declare function headTree(type: string): PartRow;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{SPLITTABLE_SECTIONS as k}from"../../../../../format/lib/sections/section-head-placement.js";import{AUTO_COLUMN as E,BUTTON as O,DIM as
|
|
2
|
-
one standard.`,S)]:[]]}]},{kind:"group",name:"Words",props:{...o,...
|
|
1
|
+
import{SPLITTABLE_SECTIONS as k}from"../../../../../format/lib/sections/section-head-placement.js";import{AUTO_COLUMN as E,BUTTON as O,DIM as L,INNER_BOX as o,SH_LINK as _,TEXT as h,smallText as M}from"./section-to-box-row-parts.js";import{labelTextSeed as A}from"../../../../../format/lib/document/text-seeds.js";import{labelStyle as P,token as a}from"../../../../../format/lib/document/seed-parts.js";function w(e){if(e==="ProductGrid")return"shelf";const t=k[e]?.headStyle;return t==="editorial"||t==="simple"||t==="essay"?t:"standard"}const K={standard:64,editorial:60,simple:36,essay:28,shelf:20},I={SectionHeader:"accent",FAQ:"accent",FitmentFinder:"accent",FitmentTable:"accent",SpecTable:"accent",RelatedProducts:"accent",Collections:"accentNum"};function W(e){if(e==="SectionHeader")return{num:"num",title:"title",description:"description",link:!0};const t=k[e];if(!t)throw new Error(`section-head-looks: "${e}" has no head row in SPLITTABLE_SECTIONS`);return{num:t.num,title:t.title,description:t.description,link:t.headRows.includes("linkText")&&t.headRows.includes("linkHref")}}function X(e,t,n){const i=`editorial:${e}|${t}|${n}`,r=p.get(i);if(r)return r;const l=y({num:e,title:t,description:n,link:!1});return p.set(i,l),l}const u={top:0,right:0,bottom:1,left:0};import{token as J}from"../../../../../format/lib/document/seed-parts.js";const H=(e,t,n,i)=>({sizeToken:{step:e,px:i,fluid:{minPx:t,vw:n}}}),d=(e,t,n={})=>M(e,{...a("label",t),...n}),c=(e,t)=>({kind:"text",key:e,role:"heading",props:h,style:{textStyle:"heading-2",...t}}),m=800,f=(e,t,n,i)=>({kind:"text",key:e,props:{...L,align:"right",alignPhone:"left",...n?{maxWidth:n,maxWidthPhone:m}:{}},style:{textStyle:"body-5",fontRole:"heading",alignPhone:"left",...a("body",t),...i}}),x={...O,align:"right",alignPhone:"left",..._,icon:"arrow-right",iconPosition:"after"},T=e=>({kind:"button",key:"linkText",href:"linkHref",variant:"ghost",props:x,style:{...P(e),color:"labels"}}),b=(e,t,n)=>{const i=n.role==="heading"?{tag:"h2"}:{};return{kind:"block",type:"Text",when:r=>r[e]===void 0,props:{...h,...i,...n.props,text:t,_partStyles:{text:{...n.role==="eyebrow"?C(A()):{},...n.style}}}}},C=e=>e._partStyles.text??{},s={widthFitPhone:"fill"};function R(e){if(e.kind!=="group")return e;if(e.name==="Words"){const t=e.props;return{...e,props:typeof t=="function"?(n,i)=>({...t(n,i),...s}):{...t,...s}}}return{...e,parts:e.parts.map(R)}}function F(e,t){const n=I[e],i=n==="accent",r=d(t.num,14,{color:i?"accent":"labels"}),l=n==="accentNum"&&r.kind==="text"?{...r,mark:"accentLead"}:r,S=c(t.title,i?{...H("headingMedium",36,5,64),case:"upper",lineHeight:.95,letterSpacing:-.025}:{...a("headingMedium",56,36),case:"none",lineHeight:1,letterSpacing:-.03}),g=e==="Collections";return{kind:"group",name:"Header",props:{...o,direction:"row",align:"end",justify:"between",gap:40,gapPhone:12,share:"content",sectionBorder:u,sectionPaddingBottom:24,sectionPaddingBottomPhone:20},parts:[{kind:"group",name:"Title",props:{...o,...s,direction:"row",align:"end",gap:40,gapPhone:12,share:"content"},parts:[{kind:"group",name:"Number",props:{...o,...s,align:"start",gap:12},parts:[{kind:"image",key:"logoSrc",alt:"logoAlt",props:{aspect:"auto",contained:!1}},l,...g?[b(t.num,"==01== / Collections",l)]:[]]},{kind:"group",name:"Heading",props:{...o,...s},parts:[S,...g?[b(t.title,`Three ranges,
|
|
2
|
+
one standard.`,S)]:[]]}]},{kind:"group",name:"Words",props:{...o,...s,gap:12,maxWidth:340,maxWidthPhone:m},parts:[...t.description?[f(t.description,14,void 0,{lineHeight:1.5})]:[],...t.link?[T(14)]:[],...g?[{kind:"block",type:"ButtonBlock",props:{...x,variant:"ghost",label:"View all",href:"/wheels",_partStyles:{label:T(14).style}}}]:[]]}]}}function y(e){return{kind:"group",name:"Header",props:{...o,direction:"row",align:"end",justify:"between",gap:40,gapPhone:14,share:"content",sectionBorder:u,sectionPaddingBottom:32},parts:[{kind:"group",name:"Title",props:{...o,direction:"row",align:"end",gap:40,gapPhone:14,share:"content"},parts:[{kind:"group",name:"Number",props:{...o,sectionPaddingBottom:8},parts:[{...d(e.num,13),props:{...h,...E}}]},c(e.title,{...H("headingMedium",40,5.5,80),case:"upper",weight:500,lineHeight:1,letterSpacing:-.03})]},{kind:"group",name:"Words",props:{...o,sectionPaddingBottom:4,maxWidth:360,maxWidthPhone:m},parts:e.description?[f(e.description,14,void 0,{lineHeight:1.5})]:[]}]}}function N(e,t){return{kind:"group",name:"Header",props:{...o,gap:16,gapPhone:16},parts:[d(e.num,13),c(e.title,t)]}}const B=[["para",{...P(13),weight:400,lineHeight:1,letterSpacing:.22}],["sm",{...a("headingMedium",40,28),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["md",{...a("headingMedium",48,32),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["lg",{...a("headingMedium",56,36),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}],["xl",{...a("headingMedium",64,40),case:"none",weight:500,lineHeight:1,letterSpacing:-.03}]],z=e=>B.some(([t])=>t===e.titleSize)?e.titleSize:"lg";function U(e){return{kind:"group",name:"Header",props:{...o,direction:"row",align:"center",justify:"between",gap:16,share:"content",stickTop:!0,sectionBorder:u,sectionPaddingTop:12,sectionPaddingBottom:12},parts:[{kind:"group",name:"Title",props:{...o,direction:"row",align:"end",gap:24,share:"content"},parts:[d(e.num,13,{color:"labels",letterSpacing:.22,lineHeight:1}),...B.map(([t,n])=>({...c(e.title,n),when:i=>z(i)===t}))]},{kind:"group",name:"Words",props:{...o,direction:"row",align:"center",justify:"end",gap:20,share:"content"},parts:[...e.description?[f(e.description,13,340,{lineHeight:1.4})]:[],...e.link?[T(13)]:[]]}]}}function G(e){return w(e)==="shelf"?{titleSize:"the Header Box's title Text part: its size, as the old shelf title drew it (lib/document/blocks/general/section-head-looks)"}:{}}const p=new Map;function Q(e){const t=p.get(e);if(t)return t;const n=W(e),i=w(e),r=i==="editorial"?y(n):i==="simple"?N(n,{...a("headingMedium",44,32),case:"upper",weight:500,lineHeight:1,letterSpacing:-.02}):i==="essay"?N(n,{...a("headingMedium",38,28,"headingSmall"),case:"upper",lineHeight:1,letterSpacing:-.02}):i==="shelf"?U(n):F(e,n);return p.set(e,r),r}export{K as HEAD_BELOW,X as editorialHeadTree,H as fluidToken,w as headLookOf,G as headReads,Q as headTree,R as headWordsOnPhoneLine,J as token};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasWords as p}from"../../../sections/section-to-box.js";import{BLOCK_WIDTH_LIMIT as A}from"efficient-easel/draw";import{fluidToken as C,token as o}from"./section-head-looks.js";import{STRIP_BOX as R}from"../../../../../format/lib/sections/strip-shape.js";import{PH as i}from"../../../../../format/lib/document/blocks/placeholders.js";import{DOC_MASTHEAD_PH as d}from"../../../../../format/lib/document/blocks/general/DocMasthead/meta.js";import{AUTO_COLUMN as s,BUTTON as
|
|
1
|
+
import{hasWords as p}from"../../../sections/section-to-box.js";import{BLOCK_WIDTH_LIMIT as A}from"efficient-easel/draw";import{fluidToken as C,token as o}from"./section-head-looks.js";import{STRIP_BOX as R}from"../../../../../format/lib/sections/strip-shape.js";import{PH as i,phAccentAsMarks as W}from"../../../../../format/lib/document/blocks/placeholders.js";import{DOC_MASTHEAD_PH as d}from"../../../../../format/lib/document/blocks/general/DocMasthead/meta.js";import{AUTO_COLUMN as s,BUTTON as v,DIM as U,DROP_COMMON as c,DROP_SIDE_PADDING as g,INNER_BOX as n,leadLine as f,RIGHT_WORDS as S,SAME_KEYS as h,SECTION_BOX as m,SH_LINK as X,smallText as r,TEXT as a,wrapperPad as b,wrapperPadKeys as u}from"./section-to-box-row-parts.js";const _={minWidth:A.min},w=(e,t,l)=>({...r(e,{...t,...S}),props:{...a,align:"right",...s,...l}}),T={top:1,bottom:0},k=(e,t,l,N)=>({kind:"group",name:e,props:{...n,sectionPaddingBottom:t,sectionPaddingBottomPhone:l},parts:[N]}),I={widthFit:"fill",..._},E={top:100,bottom:60,topPhone:60,bottomPhone:40},G={...o("label",13),letterSpacing:.22,lineHeight:1.8},O={textStyle:"heading-1",...C("headingLarge",56,8,128),case:"upper",weight:500,lineHeight:.88,letterSpacing:-.04},x=e=>e.titleLevel===2,K=()=>({name:"Page Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,E)}),box:[...h,...u(E)],parts:[{kind:"group",name:"Header",props:{...n,direction:"row",align:"end",justify:"between",gap:40,gapPhone:16,share:"content",sectionPaddingBottom:32},parts:[k("Eyebrow",12,0,{...r("eyebrow",o("label",13)),props:{...a,...s}}),{kind:"text",key:"title",role:"heading",props:{...a,tag:"h1",...I},style:O,mark:"accentItalic",when:e=>!x(e)},{kind:"text",key:"title",role:"heading",props:{...a,tag:"h2",...I},style:O,mark:"accentItalic",when:x},{kind:"group",name:"Details",props:{...n,align:"stretch",gap:0,gapPhone:0,sectionPaddingBottom:12,sectionPaddingBottomPhone:0},parts:[{kind:"list",key:"meta",name:"Detail",flat:!0,parts:[f("label","value",G,s)]}]}]},{kind:"group",name:"Deck",props:{...n,maxWidth:760,sectionBorder:T,sectionPaddingTop:28},parts:[{kind:"text",key:"deck",props:U,style:{textStyle:"body-1",fontRole:"accent",...o("body",22,19),italic:!0,lineHeight:1.5}}]}],drop:{...c,...g,titleLevel:"read by the title part's `when`: 2 (set by lib/document/one-h1 on a later opener) makes the Text an h2, anything else an h1"}}),te=()=>({eyebrow:d.eyebrow,title:W(d.title),deck:d.deck,meta:[{label:i.label,value:i.value},{label:i.label,value:i.value}]}),B={top:80,bottom:40,topPhone:60,bottomPhone:32},j={...o("label",13),letterSpacing:.18,lineHeight:1.8},H={...o("label",13),letterSpacing:.22,lineHeight:1.9},Y=()=>({name:"Issue Header",boxProps:e=>({...m,direction:"column",gap:0,sectionBorder:{bottom:1},...b(e,B)}),box:[...h,...u(B)],parts:[{kind:"group",name:"Top",props:{...n,direction:"row",align:"end",justify:"between",gap:60,gapPhone:16,share:"content",sectionPaddingBottom:32},parts:[k("Eyebrow",14,14,r("eyebrow",o("label",14))),{kind:"group",name:"Issue",props:{...n,align:"end",gap:0,gapPhone:0,sectionPaddingBottom:14},parts:[{kind:"list",key:"issueMeta",name:"Issue line",flat:!0,parts:[f("lead","rest",j)]}]}]},{kind:"group",name:"Bottom",props:{...n,direction:"row",align:"start",justify:"between",gap:60,gapPhone:16,share:"content",sectionBorder:T,sectionPaddingTop:32},parts:[{kind:"text",key:"lead",props:{...a,maxWidth:720,..._},style:{textStyle:"body-1",fontRole:"heading3",...o("headingSmall",20),lineHeight:1.5,letterSpacing:-.005,paragraphSpacing:16}},{kind:"group",name:"In this issue",props:{...n,align:"stretch",gap:0},parts:[k("Heading",6,6,{kind:"text",key:"issueHeading",props:{...a,align:"right",...s},style:{textStyle:"body-1",fontRole:"heading",...o("body",18),weight:400,letterSpacing:-.01,lineHeight:1.9,...S}}),{kind:"group",name:"Lines",props:{...n,align:"stretch",gap:0},parts:[{kind:"list",key:"issueList",name:"Line",flat:!0,parts:[w("text",{color:"labels",...H})]}]},w("issueTotal",H)]}]}],drop:{...c,...g}}),D={top:24,bottom:24,topPhone:16,bottomPhone:16},y={color:"labels",...o("label",13),letterSpacing:.2},L=e=>(Array.isArray(e.items)?e.items:[]).filter(t=>t&&typeof t.label=="string"&&t.label.trim()!==""),P=(e,t)=>t!==void 0&&L(e).at(-1)===t,M=(e,t)=>t!==void 0&&L(e).includes(t),F=(e,t)=>M(e,t)&&!P(e,t)&&p(t?.href),V=()=>({name:"Breadcrumb",skip:e=>p(e.meta)?'a trailing note after "·" needs a second mark; none live':void 0,boxProps:e=>({...m,...R,wrap:"wrap",gap:16,gapPhone:16,separator:"slash",sectionBorder:{bottom:1},...b(e,D)}),box:[...h,...u(D)],parts:[{kind:"list",key:"items",name:"Crumb",flat:!0,parts:[{kind:"button",key:"label",href:"href",variant:"ghost",when:F,props:{...v,...X,icon:"none"},style:y},{...r("label",y),when:(e,t)=>M(e,t)&&!P(e,t)&&!p(t?.href)},{...r("label",{...y,color:"text"}),when:P}]}],drop:{...c,...g,meta:"a node that stores a note is skipped (`skip`); an empty one draws nothing"}}),oe={DocMasthead:K(),Masthead:Y(),Breadcrumb:V()};export{oe as PAGE_HEADER_SECTION_TO_BOX,te as pageHeaderPressStarter};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { type SectionToBoxRow } from "../../../sections/section-to-box.js";
|
|
2
|
+
export declare const storyTimelinePressStarter: () => Readonly<Record<string, unknown>>;
|
|
3
|
+
export declare const milestoneTimelinePressStarter: () => Readonly<Record<string, unknown>>;
|
|
2
4
|
export declare const TIMELINE_SECTION_TO_BOX: Readonly<Record<string, SectionToBoxRow>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{resolveSectionBackground as
|
|
1
|
+
import{resolveSectionBackground as G,THEME_SECTION_BG as K}from"../../../../../format/lib/content/section-background.js";import{SECTION_BG_BUILT_IN as j}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{BUTTON as _,DIM as p,bandAccent as V,bandIndex as q,bandWrites as z,fillNoBoxHolds as J,ownFill as Q,DROP_COMMON as B,DROP_SIDE_PADDING as H,INNER_BOX as o,SAME_KEYS as A,SECTION_BOX as u,lineBorder as C,TEXT as c,innerPad as y,innerPadKeys as M}from"./section-to-box-row-parts.js";import{splitParagraphs as Z}from"../../../../components/goldPhrases.js";import{accentItalicRuns as N}from"../../../../../format/lib/markup.js";import{TIMELINE_YEAR_BOX as $,TIMELINE_YEAR_HEAD as O}from"../../../../../format/lib/sections/timeline-year-shape.js";import{boxPadding as ee,LABEL_FACE as te}from"../../../../../format/lib/document/seed-parts.js";import{editorialHeadTree as ne,fluidToken as oe,headWordsOnPhoneLine as re,token as i}from"./section-head-looks.js";import{CTA_PH as l,phAccentAsMarks as L}from"../../../../../format/lib/document/blocks/placeholders.js";import{TIMELINE_PH as b,timelineScaffoldEntries as ie}from"../../../../../format/lib/document/blocks/general/Timeline/meta.js";import{TIMELINE_TRACK_PH as T,timelineTrackScaffoldEntries as ae}from"../../../../../format/lib/document/blocks/general/TimelineTrack/meta.js";const d=(e,t,n={})=>({textStyle:"body-5",...i("label",e),letterSpacing:t,lineHeight:1.5,weight:400,...n}),a=(e,t,n={})=>({...d(e,t),...te,...n}),g=(e,t,n)=>({...e,case:"upper",weight:500,letterSpacing:t,lineHeight:n}),s=(e,t,n={})=>({textStyle:"body-1",fontRole:"heading",...e,weight:400,case:"none",lineHeight:t,...n}),r=(e,t,n={})=>({kind:"text",key:e,props:c,style:t,...n});function R(e,t){return e.kind==="text"?t.includes(e.key)?{...e,mark:"accentItalic"}:e:e.kind==="group"?{...e,parts:e.parts.map(n=>R(n,t))}:e}const W=(e,t)=>t?.future===!0,h=e=>Z(typeof e?.body=="string"?e.body:""),f=e=>G(typeof e.background=="string"?e.background:void 0,j.TimelineTrack),x=e=>f(e)===K?e:{...e,background:"transparent"},se={name:"Milestone Timeline",skip:e=>J(f(e)),boxProps:(e,t)=>{const n=q(x(e),t);return{...u,direction:"column",gap:60,gapPhone:36,sectionBorder:{bottom:1},...y(e,"TimelineTrack"),...Q(f(e),e,t),...n>=0?{sectionAccent:n}:{}}},box:[...A.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,n)=>V(e,x(t),n)],...M("TimelineTrack")],parts:[re(R(ne("eyebrow","title","intro"),["title","intro"])),{kind:"group",name:"Track",props:{...o,gap:48,gapPhone:48},parts:[{kind:"group",name:"Years",props:{...o,direction:"row",share:"equal",gap:0,line:!0},parts:[{kind:"list",key:"entries",name:"Year",props:{...o,...$},item:e=>({props:e.future===!0?{upcoming:!0}:{}}),parts:[{kind:"group",name:O.name,props:{...o,...O},parts:[r("date",d(13,.22,{color:"accent"}),{when:(e,t)=>!W(e,t)}),r("date",d(13,.22,{color:"labels"}),{when:W}),r("title",{textStyle:"heading-3",...g(i("headingSmall",20),-.02,1.1)},{role:"heading"})]},r("blurb",s(i("body",13),1.55),{props:p,mark:"accentItalic"})]}]},{kind:"group",name:"Button row",props:{...o,sectionBorder:{top:1,right:0,bottom:0,left:0},sectionPaddingTop:32},parts:[{kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:(e,t)=>({..._,align:"right",...C(e,t)}),style:a(13,.3)}]}]}],site:(e,t)=>z({props:x(e.props)},t),drop:{...B,...H,background:"another colour is the Box's Fill, or a skip if no Fill holds it; the band is the Box's theme: the site's band preset (`sectionAccent`), or a declared band-preset write (`lib/theme` `bandPresetIndex`)",headPlacement:"needs a row per head placement: an own-box Milestone Timeline draws no head (its words sit in a Section Header above it), the row always draws the head"}},w=e=>typeof e.layout=="string"?e.layout:"split",m=e=>w(e)==="split",P=e=>!m(e),F=e=>w(e)==="spine",pe=e=>P(e)&&!F(e),v=(e,t,n,X)=>({kind:"group",name:"Picture",keepEmpty:!0,box:[["imageSrc","bgImage"]],props:{...o,sectionBorder:{top:1,right:1,bottom:1,left:1},darken:75,darkenStyle:"bottom",placement:"bottom-center",sectionHeightMode:"fixed",sectionHeightValue:e,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:t,sectionHeightUnitPhone:"px",...ee(12,16),...n},when:k=>X(k)&&typeof k.imageSrc=="string"&&k.imageSrc.trim()!=="",parts:[{kind:"group",name:"Caption",props:{...o,direction:"row",justify:"between",align:"center",gap:12,gapPhone:12,share:"content",phoneRow:2},parts:[r("imageCaption",a(11,.24,{color:"text"})),r("imageMeta",a(11,.24,{color:"accent"}),{props:{...c,align:"right"}})]}]}),D=(e={})=>({kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:(t,n)=>({..._,...e,...C(t,n)}),style:a(13,.3)}),S=()=>[r("title",{textStyle:"heading-3",...g(i("headingSmall",24,20),-.02,1.5)},{role:"heading",mark:"accentItalic"}),{kind:"block",type:"Text",props:{...c,_partStyles:{text:s(i("body",17,16),1.6)}},box:[["body","text",(e,t)=>N(h(t)[0]??"")]],when:(e,t)=>h(t).length>0},{kind:"block",type:"Text",props:{...p,_partStyles:{text:s(i("body",17,16),1.6,{paragraphSpacing:14})}},box:[["body","text",(e,t)=>N(h(t).slice(1).join(`
|
|
2
2
|
|
|
3
|
-
`)]],when:(e,t)=>
|
|
3
|
+
`))]],when:(e,t)=>h(t).length>1}],E=()=>r("date",d(13,.24,{color:"accent"})),I=(e,t,n={})=>r(e,t,{...n,props:{...c,...n.props??{},align:"center"}}),Y=oe("headingMedium",40,5,76),U={sectionBorder:{bottom:1}},ce={name:"Story Timeline",skip:e=>w(e)==="track"?'display "track": not converted (it draws the Milestone rail; a Track story is not stored anywhere)':void 0,boxProps:e=>m(e)?{...u,direction:"row",share:[40],gap:80,gapPhone:48,align:"start",...U,...y(e,"Timeline")}:{...u,direction:"column",gap:48,gapPhone:48,align:"center",...U,...y(e,"Timeline")},box:[...A,...M("Timeline")],parts:[{kind:"group",name:"Heading",props:{...o,gap:24,gapPhone:24},when:m,parts:[r("eyebrow",a(12,.3,{color:"accent"}),{role:"eyebrow"}),r("title",{textStyle:"heading-2",...g(Y,-.03,.94)},{role:"heading",mark:"accentItalic"}),r("intro",s(i("body",14),1.6),{props:{...p,maxWidth:360},mark:"accentItalic"}),v(667,419,{},()=>!0),D()]},{kind:"group",name:"Chapters",props:{...o,gap:48,gapPhone:48,line:!1},when:m,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,direction:"row",gap:24,gapPhone:8,share:[12],align:"start"},parts:[E(),{kind:"group",name:"Words",props:{...o,gap:14,gapPhone:14},parts:S()}]}]},{kind:"group",name:"Heading",props:{...o,gap:24,gapPhone:24,align:"center",maxWidth:760,widthFit:"fill"},when:P,parts:[I("eyebrow",a(12,.3,{color:"accent"}),{role:"eyebrow"}),I("title",{textStyle:"heading-2",...g(Y,-.03,.94)},{role:"heading",mark:"accentItalic"}),I("intro",s(i("body",14),1.6),{props:{...p,maxWidth:520},mark:"accentItalic"}),D({align:"center"})]},v(506,192,{maxWidth:900,widthFit:"fill"},P),{kind:"group",name:"Chapters",props:{...o,gap:48,gapPhone:48,line:!0,maxWidth:760,widthFit:"fill",sectionPaddingTop:16},when:F,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,gap:8,gapPhone:8},parts:[E(),{kind:"group",name:"Words",props:{...o,gap:14,gapPhone:14},parts:S()}]}]},{kind:"group",name:"Chapters",props:{...o,gap:56,gapPhone:56,maxWidth:1e3,widthFit:"fill",sectionPaddingTop:16,mirrorCards:"even"},when:pe,parts:[{kind:"list",key:"entries",name:"Chapter",props:{...o,direction:"row",gap:64,gapPhone:0,share:[50],align:"start"},parts:[{kind:"group",name:"Entry",props:{...o,gap:8,gapPhone:8},parts:[E(),{kind:"group",name:"Words",props:{...o,gap:14,gapPhone:14},parts:S()}]},{kind:"group",name:"Spacer",props:{...o},keepEmpty:!0,parts:[]}]}]}],drop:{...B,...H,layout:"the Box's own arrangement replaces it: Split a row of two Boxes; Spine and Alternating a centred column (Track is skipped)"}},xe=()=>({eyebrow:b.eyebrow,title:L(b.title),intro:b.intro,ctaText:l.text,ctaHref:l.href,entries:ie()}),we=()=>({eyebrow:T.eyebrow,title:L(T.title),intro:T.intro,ctaText:l.text,ctaHref:l.href,entries:ae()}),Pe={TimelineTrack:se,Timeline:ce};export{Pe as TIMELINE_SECTION_TO_BOX,we as milestoneTimelinePressStarter,xe as storyTimelinePressStarter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t}from"react/jsx-runtime";import{Render as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{Render as a}from"efficient-easel/render";import{capHeroGroups as c}from"../../../format/lib/document/cap-hero-groups.js";import{BelowFirstScreen as f,LATER_SLIDES_KEY as p,firstScreenLead as d,laterSlideIdsOf as g,useLeadDrawsFirst as l}from"../first-screen.js";import{markHeadCoreBoxes as S}from"./head-core-boxes.js";import{oneH1 as u}from"../../../format/lib/document/one-h1.js";import{withPageContents as h}from"../content/page-contents.js";import{migrateLegacyPageData as w}from"./migrate-legacy.js";import{migrateRenamedProps as O}from"../../../format/lib/document/renamed-props.js";import{convertSectionsInPage as _,SECTION_TO_BOX_ON as L}from"../sections/section-to-box.js";import{siteThemeOf as P}from"../../../format/lib/theme.js";import{registerGeneralSectionRows as R}from"./blocks/general/section-to-box-rows.js";import{withSlotCounts as x}from"./slot-counts.js";function C({config:n,data:m,metadata:r}){R();const e=h(S(u(c(_(O(w(m)),L,{theme:P(r)}))))),i=l(n,d(e.content)),o=g(e.content),s=o.length>0?{...r,[p]:o}:r;return t(f,{children:t(a,{config:i,metadata:x(s,e.content),data:e})})}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as p}from"react/jsx-runtime";import{parseBlockWidthFit as P,phoneKey as l,tabletKey as o}from"efficient-easel/draw";import{blockCanWidenPastCell as K,blockFillInCellClass as A,blockPhoneHideClass as L,blockSizeOf as G,blockSizeValuesOf as X}from"../../content/block-size.js";import{NoCellBound as Z}from"../../../components/BoxCellWidthContext.js";import{CellWrap as $,useBoxCell as v}from"../../../components/InBoxContext.js";import{boxPhoneRowFits as U,boxRowColumnsClass as T,boxShareClasses as g,boxShareTabletOf as M,boxTabletColumnsClass as V}from"../../../../format/lib/content/box-layout.js";import{resolveContainerDirection as Y}from"../../../../format/lib/content/container-direction.js";import{containerBlocksFor as q}from"../../../../format/lib/document/container-blocks.js";import{readPartStyle as J}from"../part-styles.js";import{addShowWhenFacts as Q,withRowRules as S}from"../../../../format/lib/document/show-when-attach.js";import{BOX_BLOCK_KEYS as tt}from"./cell-width.js";import{findParentNode as et}from"../../../../format/lib/document/passes/document-position.js";const it=new Set(["Text","Heading"]),nt=new Set(["h1","h2","h3","h4","h5","h6"]);function O(t,e){return t==="Heading"?!0:t!=="Text"?!1:typeof e.tag=="string"&&nt.has(e.tag)?!0:J(e,"text").textStyle?.startsWith("heading-")===!0}const a={not:{context:"blockOutsideBox",is:!0}},B={all:[a,{not:{context:"boxSharesWidth",is:!0}}]},k={all:[a,{not:{context:"boxSharesWidthPhone",is:!0}}]},C={all:[a,{not:{context:"boxSharesWidthTablet",is:!0}}]};function H(t,e,i){return{any:[{field:o(t),is:e},{all:[{field:o(t),set:!1},i??{field:t,is:e}]}]}}function I(t,e,i){return{any:[{field:l(t),is:e},{all:[{field:l(t),set:!1},i??{field:t,is:e}]}]}}const N={any:[{field:"textFit",is:"shrink"},{all:[{field:"textFit",set:!1},{not:{context:"textWrapsByDefault",is:!0}}]}]},rt=[[["_gBlockSize","minWidth",o("minWidth"),l("minWidth"),"maxWidth",o("maxWidth"),l("maxWidth")],a],[["widthFit"],B],[[o("widthFit")],C],[[l("widthFit")],k],[["width"],{all:[B,{field:"widthFit",is:"fixed"}]}],[[o("width")],{all:[C,H("widthFit","fixed")]}],[[l("width")],{all:[k,I("widthFit","fixed")]}]],y=H("textFit","shrink",N),E=[[["_gText","textFit",o("textFit"),l("textFit")],a],[["minFont"],{all:[a,N]}],[[o("minFont")],{all:[a,y]}],[[l("minFont")],{all:[a,I("textFit","shrink",y)]}]],h=(t,e)=>et(e.appState,t.props?.id),d=t=>!!t&&typeof t.type=="string"&&q(t.type)!==null,b=t=>(t.type==="Flex"||t.type==="HeroGroup")&&Y(t.type,t.props?.direction)==="row",w=t=>{const e=P(t);return e!==void 0&&e!=="fit"},st={blockOutsideBox:(t,e)=>!d(h(t,e)),boxSharesWidth:(t,e)=>{const i=h(t,e);return!d(i)||!b(i)?!1:T({...i.props,direction:"row"})!==""?!0:g(i.props?.share)!==""&&!w(t.props?.widthFit)},boxSharesWidthTablet:(t,e)=>{const i=h(t,e);if(!d(i)||!b(i))return!1;if(V(i.props?.[o("columns")])!==""||T({...i.props,direction:"row"})!=="")return!0;const n=M(i.props?.[o("share")])??i.props?.share;return g(n)!==""&&!w(t.props?.[o("widthFit")]??t.props?.widthFit)},boxSharesWidthPhone:(t,e)=>{const i=h(t,e);if(!d(i)||!b(i))return!1;const n=i.props?.phoneRow;return(Number(n)===2||Number(n)===3)&&!U(n,i.props?.[l("share")])&&!w(t.props?.[l("widthFit")]??t.props?.widthFit)}},ot=t=>/^_[gds][A-Z]/.test(t);function lt(t,e,i){const n=Object.entries(t),r=n.findIndex(([c])=>c===e);if(r===-1)return null;let s=r+1;for(;s<n.length&&!ot(n[s][0]);)s++;return Object.fromEntries([...n.slice(0,s),...Object.entries(i),...n.slice(s)])}function R(t,e,i){const n=Object.entries(t);return Object.fromEntries([...n.slice(0,e),...Object.entries(i),...n.slice(e)])}function ct(t,e,i){const n=Object.keys(e);if(n.includes("_dSize")){const{_gBlockSize:r,...s}=i;return R(e,n.indexOf("_dSize")+1,s)}return at.has(t)&&n.includes("_gSpacing")?R(e,n.indexOf("_gSpacing"),i):{...e,...i}}const at=new Set(["Text","Heading"]);function ht(t,e){const{_gText:i,...n}=e;return lt(t,"_gText",n)??{...t,...e}}function dt(t){const e=new WeakMap;return i=>{if(!i||!("textFit"in i))return i;let n=e.get(i);if(!n){n={...i};for(const r of["textFit",o("textFit"),l("textFit")])r in n&&(n[r]=t[r]);e.set(i,n)}return n}}const Bt={name:"blockSize",applies:(t,e,i)=>tt.includes(t)&&!!i&&typeof i.render=="function",panel(t,e,i){const n=it.has(e),{text:r}=i.blockSizeFields(n?{tablet:!0,textFit:e==="Heading"?"shrink":"wrap"}:{}),{size:s}=i.blockSizeFields({tablet:!0});let c=ct(e,t.fields??{},S(s,rt));if(n){const u=S(r,E);if(c=ht(c,u),e==="Text"){const z=S(i.blockSizeFields({tablet:!0,textFit:"shrink"}).text,E),D=dt(z),F=t.resolveFields,j=(m,f)=>{const x=F?F(m,f):f.fields,_=W=>O(e,m?.props??{})?D(W??f.fields):W;return x instanceof Promise?x.then(_):_(x)};t.resolveFields=j}}t.fields=c,Q(t,{...st,textWrapsByDefault:u=>!O(e,u.props??{})})},draw(t){ut(t)}};function ut(t){const e=t.render;t.render=i=>{const n=X(i),r=G(n),s=e(i);if(r===null)return s;const c=L(i);return p(ft,{size:r,className:c?`${r.className} ${c}`:r.className,inCell:A(n),widens:K(n),children:s})}}function ft({size:t,className:e,inCell:i,widens:n,children:r}){const s=v()?.phoneCells===!0,c=n?p(Z,{children:r}):r;return p($,{className:s&&i?`${e} ${i}`:e,...Object.keys(t.style).length?{style:t.style}:{},attrs:t.attrs,children:c})}export{Bt as blockSize,O as textShrinksByDefault};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const SLOT_COUNTS_KEY = "slotCounts";
|
|
2
|
+
export type SlotCounts = Readonly<Record<string, number>>;
|
|
3
|
+
type Props = Readonly<Record<string, unknown>>;
|
|
4
|
+
export declare const DRAWS_FOR_SURE: Readonly<Record<string, (props: Props) => boolean>>;
|
|
5
|
+
export declare function slotCountsOf(content: unknown): SlotCounts;
|
|
6
|
+
export declare function withSlotCounts(metadata: Readonly<Record<string, unknown>> | undefined, content: unknown): Record<string, unknown>;
|
|
7
|
+
export declare function slotCountOf(props: Props): number | undefined;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isNode as m,isNodeList as S}from"efficient-easel/data";import{hidableText as _,phoneKey as w,readHidable as y}from"efficient-easel/draw";import{BLOCK_SHOW_KEY as h,blockSizeValuesOf as R}from"../content/block-size.js";import{CARD_ROW_FIELD_PROP as b,CARD_TEMPLATE_SLOT as x,namedRowField as E,ROW_BOUND_PROPS as P}from"../../../format/lib/content/card-template.js";import{SHOW_FOR_PROP as g}from"../../../format/lib/content/box-show-for-choices.js";const O="slotCounts",u=t=>!y(t).hidden&&_(t).trim()!=="",C=t=>typeof t=="string"&&t.trim()!=="",A={Flex:()=>!0,PostCard:()=>!0,ImageBlock:t=>C(t.src),Text:t=>u(t.text),Heading:t=>u(t.text),Eyebrow:t=>u(t.eyebrow)},W=["widthFit","width","minWidth"],d=t=>S(t);function F(t){if(Array.isArray(t.content))return d(t.content)?t.content:null;const e=Object.values(t).filter(d);return e.length===1?e[0]:null}function N(t,e){return[...new Set([b,...Object.values(P[t]??{})])].some(o=>E(e,o)!=="")}function D(t){const e=t.props??{},n=A[t.type];if(!n||!n(e)||N(t.type,e)||e[w(h)]===!1)return!1;const o=e[g];if(o!=null&&o!=="")return!1;const r=R(e);return!W.some(s=>r[s]!==void 0)}function I(t){let e=0;for(const n of t)if(!n.props?._hidden){if(!D(n))return;e+=1}return e>0?e:void 0}function L(t){const e={},n=new Set,o=new Set,r=(s,a)=>{if(Array.isArray(s))for(const f of s){if(!m(f))continue;const i=f.props.id;typeof i=="string"&&(n.has(i)?o:n).add(i);const l=a?null:F(f.props);if(typeof i=="string"&&l){const c=I(l);c!==void 0&&(e[i]=c)}for(const[c,p]of Object.entries(f.props))d(p)&&r(p,a||c===x)}};r(t,!1);for(const s of o)delete e[s];return e}function B(t,e){return{...t??{},[O]:L(e)}}function U(t){const n=t.editor?.metadata?.[O],o=t.id,r=typeof o=="string"&&n&&typeof n=="object"?n[o]:void 0;return typeof r=="number"&&Number.isInteger(r)&&r>0?r:void 0}export{A as DRAWS_FOR_SURE,O as SLOT_COUNTS_KEY,U as slotCountOf,L as slotCountsOf,B as withSlotCounts};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
2
|
+
import type { Config } from "efficient-easel/blocks";
|
|
3
|
+
export type FirstScreenPlace = "first" | "below";
|
|
4
|
+
export declare function FirstScreen({ children }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function BelowFirstScreen({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function useFirstScreenPlace(): FirstScreenPlace | null;
|
|
11
|
+
export declare function useDeferredPicture(): {
|
|
12
|
+
loading?: "lazy";
|
|
13
|
+
};
|
|
14
|
+
export declare function PagePicture(props: ComponentPropsWithoutRef<"img">): import("react").JSX.Element;
|
|
15
|
+
export declare const LATER_SLIDES_KEY = "laterSlideIds";
|
|
16
|
+
interface PageNode {
|
|
17
|
+
type?: string;
|
|
18
|
+
props?: {
|
|
19
|
+
id?: unknown;
|
|
20
|
+
slides?: unknown;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function firstScreenLead<T extends {
|
|
24
|
+
type?: string;
|
|
25
|
+
}>(content?: T[] | null): T | null;
|
|
26
|
+
export declare function laterSlideIdsOf(value: unknown, into?: string[]): string[];
|
|
27
|
+
export declare function useLeadDrawsFirst(config: Config, lead: PageNode | null): Config;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{createContext as p,useContext as l,useMemo as a}from"react";import{leadSection as x}from"./document/header-clearance.js";const c=p(null);function S({children:e}){return o(c.Provider,{value:"first",children:e})}function h({children:e}){return o(c.Provider,{value:"below",children:e})}function m(){return l(c)}function y(){return m()==="below"?{loading:"lazy"}:{}}function D(e){const r=y();return o("img",{...e,...r})}const F="laterSlideIds",b=new Set(["Breadcrumb","CategoryBar","Divider","Spacer","Ticker"]);function j(e){return x(e?.filter(r=>!r?.type||!b.has(r.type)))}function d(e,r=[]){if(Array.isArray(e))for(const t of e)d(t,r);else if(e&&typeof e=="object"){const{slides:t}=e;if(Array.isArray(t))for(const n of t.slice(1))typeof n?.props?.id=="string"&&r.push(n.props.id);for(const n of Object.values(e))d(n,r)}return r}function B(e,r){const t=r?.type,n=r?.props?.id;return a(()=>{const i=t?e.components[t]:void 0;if(!t||!i)return e;const u=i.render,f=s=>s.id===n?o(S,{children:o(u,{...s})}):o(u,{...s});return{...e,components:{...e.components,[t]:{...i,render:f}}}},[e,t,n])}export{h as BelowFirstScreen,S as FirstScreen,F as LATER_SLIDES_KEY,D as PagePicture,j as firstScreenLead,d as laterSlideIdsOf,y as useDeferredPicture,m as useFirstScreenPlace,B as useLeadDrawsFirst};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readHidable as Z}from"efficient-easel/draw";import{BOX_TYPE as ee,CONTAINER_BLOCKS_SLOT as te}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as oe,labelTextSeed as ne}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as se}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as R}from"../../../format/lib/finite-number.js";import{accentItalicRuns as ie}from"../../../format/lib/markup.js";import{seedNodes as re}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ae}from"../../../format/lib/locations-grid.js";import{normalizeTheme as G}from"../../../format/lib/theme.js";const P=ee,v=te;function Be(t){if(t.theme)return G(t.theme);const o=t.site?.themePresets;return o?G({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ce(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 Te(t){for(const[o,i]of Object.entries(t)){if(o in A&&A[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=i}}function _e(t){return A[t]}const V=new Set(["id"]),T={},F=[],fe=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","Stats","Logos","FitmentFinder","DocMasthead"];function Ee(t){for(const[o,i]of Object.entries(t)){if(o in T&&T[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=i}}function Pe(t){return T[t]}function ve(){return Object.keys(T)}function de(t){return t in T&&F.includes(t)}function je(t,o=fe){return t in T&&(o.includes(t)||de(t))}function Ne(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&i.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const H=t=>Z(t),Ie=t=>H(t).text.trim()!=="";function le(t){if(t.includes("=="))return t;const o=t.indexOf("/"),i=o===-1?t:t.slice(0,o),r=i.trim();if(!r)return t;const m=i.indexOf(r);return`${i.slice(0,m)}==${r}==${i.slice(m+r.length)}${o===-1?"":t.slice(o)}`}const pe=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function ue(t,o,i,r){const a={...t._partStyles?.text??{},...o??{},...i??{}};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 i=o[t.key];return{variant:typeof i=="string"&&Object.hasOwn(t.map,i)?t.map[i]:t.fallback}}function Y(t,o,i,r,m={}){const a={...o};for(const h of t){const[k,B,j]=typeof h=="string"?[h,h,void 0]:h;if(i[k]===void 0)continue;const _=j?j(i[k],i,m):i[k];_===void 0?delete a[B]:a[B]=_,r(k,B,_===void 0)}return a}function ye(t){const o=new Set([...V,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),i=m=>{for(const a of m??[])o.add(typeof a=="string"?a:a[0])},r=m=>{for(const a of m)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":i(a.box),r(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(h=>o.add(h)),Object.keys(a.rename??{}).forEach(h=>o.add(h)),a.derive?.reads.forEach(h=>o.add(h)),typeof a.slots!="function")for(const h of Object.values(a.slots??{}))for(const k of h)"kind"in k&&o.add(k.key);break}};for(const m of[t,...t.also??[]])i(m.box),r(m.parts);return o}function q(t,o,i={}){const r=t.props,m=o.skip?.(r);if(m!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:m};const a=String(r.id??t.type),h=[],k=[],B=[],j=new Set,_=(n,s)=>{h.push({key:n,home:s}),j.add(n)},X=r._partStyles??{},L=ye(o);let K=0;const $=(n,s)=>({type:n,props:{...s,id:`${a}~${n}-${++K}`}}),M=(n,s,b,y,g,d,w)=>{if(g){for(const c of n??[]){const p=typeof c=="string"?c:c[0];b[p]!==void 0&&w(p,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(r,i):s??{};return Y(n??[],e,b,(c,p,f)=>w(c,f?`nothing — the old value draws nothing (${y}: no ${p})`:`${d}${y}: ${p}`),i)},J=n=>re(n,s=>`${a}~${s}-${++K}`),W=(n,s,b)=>{const y=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],g=typeof n.props=="function"?n.props(r,i):n.props??{},d=y.map((f,x)=>{const l=f??{},u=n.item?.(l,x,r)??{},O=N(u.reverse?[...n.parts].reverse():n.parts,l,!1,`item ${x+1}: `);return n.flat?u.props?O.map(E=>({...E,props:{...E.props,...u.props,id:E.props.id}})):O:[$(P,{name:`${n.name} ${x+1}`,...g,...u.props??{},[v]:O})]});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"),ae(y.map(x=>x??{}),f.of,f.of).map((x,l)=>{const u=x.items.map(S=>S.item),O=f.parts?N(f.parts,f.head?.(u,r)??{},!1,`group ${l+1}: `):[],E=x.items.map(S=>d[S.index]),z=f.perRow?.(u.length,r),I=Number.isInteger(z)&&z>=1?z:1,C=[];if(f.perRow&&I<E.length)for(let S=0;S*I<E.length;S++)C.push(E.slice(S*I,(S+1)*I).flat());return $(P,{name:`${f.name} ${l+1}`,...f.props??{},[v]:[...O,$(P,{name:`${f.itemsName} ${l+1}`,...f.itemsProps?.(u.length,r)??{},[v]:C.length?C.map((S,U)=>$(P,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[v]:S})):E.flat()})]})})}const w=n.perRow?.(r),e=n.perRow?Number.isInteger(w)&&w>=1?w: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 d.flat();const c=typeof n.rowProps=="function"?n.rowProps(r,i):n.rowProps??{},p=[];for(let f=0;f*e<d.length;f++){const x=d.slice(f*e,(f+1)*e).flat(),l=n.rowFiller?e-d.slice(f*e,(f+1)*e).length:0;p.push($(P,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...c,[v]:[...x,...Array.from({length:l},(u,O)=>$(P,{name:`Empty ${O+1}`,...n.rowFiller,[v]:[]}))]}))}return p},N=(n,s,b,y)=>{const g=[],d=(e,c)=>b?_(e,c):void 0,w=e=>b?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:s)))switch(e.kind){case"text":{const c=H(s[e.key]);if(!c.text.trim()&&!(b&&i.press&&o.pressKeepsEmpty?.includes(e.key))){d(e.key,"nothing — empty words draw nothing, so no block");break}const p=pe(e.role??"body"),{_partStyles:f,...x}=p,l=ue(p,e.styleFrom?{...e.style,...e.styleFrom(r,i)}:e.style,w(e.key),e.props?.align);if(e.was&&b){const u=l._partStyles?.text??{};B.push({key:e.key,was:e.was,...typeof u.textStyle=="string"?{textStyle:u.textStyle}:{},...R(u.size)!==void 0?{size:R(u.size)}:{},...R(u.sizePhone)!==void 0?{sizePhone:R(u.sizePhone)}:{}})}g.push($("Text",{text:e.mark==="accentLead"?le(c.text):e.mark==="accentItalic"?ie(c.text):c.text,...x,...e.props??{},...l,...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Text block: its words${c.hidden?", hidden":""}`);break}case"button":{const c=H(s[e.key]);if(!c.text.trim()){d(e.key,"nothing — no words, no button"),d(e.href,"nothing — no button to link"),typeof e.variant=="object"&&d(e.variant.key,"nothing — no button to style");break}const p=typeof s[e.href]=="string"&&s[e.href]?s[e.href]:"#",f={...e.style??{},...w(e.key)??{}};g.push($("ButtonBlock",{label:c.text,href:p,...typeof e.props=="function"?e.props(s,i):e.props??{},...he(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Button block: its words`),d(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&d(e.variant.key,`${y}Button block: its Style`);break}case"image":{const c=s[e.key];if(typeof c!="string"||!c){d(e.key,"nothing — no picture, no block"),e.alt&&d(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";g.push($("ImageBlock",{src:c,alt:p,...e.props??{}})),d(e.key,`${y}Image block: its picture`),e.alt&&d(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...W(e,s,d));break}case"group":{const c=N(e.parts,s,b,y),p=M(e.box,e.props,s,`${e.name} Box`,!c.length&&!e.keepEmpty,y,d);p&&g.push($(P,{name:e.name,...p,[v]:c}));break}case"block":{const c=e.parts?N(e.parts,s,b,y):[],p=M(e.box,e.props,s,`${e.type} block`,!!e.parts&&!c.length&&!e.keepEmpty,y,d);p&&g.push($(e.type,{...p,...e.slot?{[e.slot]:c}:{}}));break}case"core":{const c=e.as??t.type,p={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(l=>!L.has(l)&&!(l in p)):e.keep;for(const l of f)s[l]!==void 0&&(p[l]=s[l],d(l,`the ${c} block inside the Box`));if(e.keep==="rest"){for(const u of Object.keys(e.props??{}))s[u]!==void 0&&!L.has(u)&&d(u,`nothing — the ${c} block inside the Box has the row's own value`);s.headPlacement!==void 0&&d("headPlacement",`the ${c} block inside the Box: own-box`);const l=Object.fromEntries(Object.entries(X).filter(([u])=>!L.has(u)));Object.keys(l).length&&(p._partStyles=l)}for(const[l,u]of Object.entries(e.rename??{}))s[l]!==void 0&&(p[u]=s[l],d(l,`the ${c} block inside the Box: ${u}`));if(e.derive){Object.assign(p,e.derive.props(s,i));for(const l of e.derive.reads)s[l]!==void 0&&d(l,`the ${c} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(s,i):e.slots??{};for(const[l,u]of Object.entries(x))p[l]=u.flatMap(O=>"kind"in O?W(O,s,d):J([O]));g.push($(c,p));break}}return g},Q=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,y=N(n.parts,r,!0,s===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,i):n.boxProps??{},d=Y(n.box??[],g,r,(w,e,c)=>_(w,c?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),i);return{type:P,props:{name:n.name,...d,[v]:y,id:ce(a,s)}}},D=[o,...o.also??[]].map(Q);r._partStyles!==void 0&&_("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))r[n]!==void 0&&_(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in r&&(k.push({key:n,why:s}),j.add(n));for(const n of Object.keys(r))V.has(n)||j.has(n)||k.push({key:n,why:"not in the row — not carried"});return{node:D[0],nodes:D,carried:h,dropped:k,siteWrites:[...o.site?.(t,i)??[]],restyled:B}}function Re(t,o=F,i={}){const r=t.content;if(!Array.isArray(r))return t;let m=!1;const a=r.flatMap(h=>{const k=h&&typeof h.type=="string"&&o.includes(h.type)?T[h.type]:void 0;if(!k)return[h];const B=q(h,k,i);return B.skipped!==void 0?[h]:(m=!0,B.nodes)});return m?{...t,content:a}:t}function Ae(t,o=F,i={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((m,a)=>{const h=m&&typeof m.type=="string"&&o.includes(m.type)?T[m.type]:void 0;if(!h)return;const k=q(m,h,i);k.skipped===void 0&&r.push({index:a,node:k.node,nodes:k.nodes})}),r}export{v as SECTION_BOX_SLOT,P as SECTION_BOX_TYPE,F as SECTION_TO_BOX_ON,fe as SECTION_TO_BOX_PRESS,_e as boxNativeReason,q as convertSection,Re as convertSectionsInPage,Be as convertTheme,de as convertsToBox,Ie as hasWords,Ne as headParts,je as pressesAsBox,Te as registerBoxNativeSections,Ee as registerSectionToBox,ce as sectionBoxIdOf,Ae as sectionToBoxEdits,Pe as sectionToBoxRow,ve as sectionToBoxTypes};
|
|
1
|
+
import{readHidable as Z}from"efficient-easel/draw";import{BOX_TYPE as ee,CONTAINER_BLOCKS_SLOT as te}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as oe,labelTextSeed as ne}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as se}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as R}from"../../../format/lib/finite-number.js";import{accentItalicRuns as ie}from"../../../format/lib/markup.js";import{seedNodes as re}from"../../../format/lib/document/seed-parts.js";import{bucketByGroup as ae}from"../../../format/lib/locations-grid.js";import{normalizeTheme as G}from"../../../format/lib/theme.js";const P=ee,v=te;function Be(t){if(t.theme)return G(t.theme);const o=t.site?.themePresets;return o?G({selected:t.site?.selectedPreset??0,themes:[...o]}):void 0}function ce(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 Te(t){for(const[o,i]of Object.entries(t)){if(o in A&&A[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);A[o]=i}}function _e(t){return A[t]}const V=new Set(["id"]),T={},F=[],fe=["Breadcrumb","DocBody","Form","SubmitBuild","Footprint","Stats","Logos","FitmentFinder","DocMasthead","Timeline","TimelineTrack"];function Ee(t){for(const[o,i]of Object.entries(t)){if(o in T&&T[o]!==i)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=i}}function Pe(t){return T[t]}function ve(){return Object.keys(T)}function de(t){return t in T&&F.includes(t)}function je(t,o=fe){return t in T&&(o.includes(t)||de(t))}function Ne(t){const o=se[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&i.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const H=t=>Z(t),Ie=t=>H(t).text.trim()!=="";function le(t){if(t.includes("=="))return t;const o=t.indexOf("/"),i=o===-1?t:t.slice(0,o),r=i.trim();if(!r)return t;const m=i.indexOf(r);return`${i.slice(0,m)}==${r}==${i.slice(m+r.length)}${o===-1?"":t.slice(o)}`}const pe=t=>t==="heading"?oe():t==="eyebrow"?ne():{};function ue(t,o,i,r){const a={...t._partStyles?.text??{},...o??{},...i??{}};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 i=o[t.key];return{variant:typeof i=="string"&&Object.hasOwn(t.map,i)?t.map[i]:t.fallback}}function Y(t,o,i,r,m={}){const a={...o};for(const h of t){const[k,B,j]=typeof h=="string"?[h,h,void 0]:h;if(i[k]===void 0)continue;const _=j?j(i[k],i,m):i[k];_===void 0?delete a[B]:a[B]=_,r(k,B,_===void 0)}return a}function ye(t){const o=new Set([...V,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),i=m=>{for(const a of m??[])o.add(typeof a=="string"?a:a[0])},r=m=>{for(const a of m)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":i(a.box),r(a.parts??[]);break;case"core":if(a.keep!=="rest"&&a.keep.forEach(h=>o.add(h)),Object.keys(a.rename??{}).forEach(h=>o.add(h)),a.derive?.reads.forEach(h=>o.add(h)),typeof a.slots!="function")for(const h of Object.values(a.slots??{}))for(const k of h)"kind"in k&&o.add(k.key);break}};for(const m of[t,...t.also??[]])i(m.box),r(m.parts);return o}function q(t,o,i={}){const r=t.props,m=o.skip?.(r);if(m!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:m};const a=String(r.id??t.type),h=[],k=[],B=[],j=new Set,_=(n,s)=>{h.push({key:n,home:s}),j.add(n)},X=r._partStyles??{},L=ye(o);let K=0;const $=(n,s)=>({type:n,props:{...s,id:`${a}~${n}-${++K}`}}),M=(n,s,b,y,g,d,w)=>{if(g){for(const c of n??[]){const p=typeof c=="string"?c:c[0];b[p]!==void 0&&w(p,`nothing — the ${y} has no parts, so it is not drawn`)}return}const e=typeof s=="function"?s(r,i):s??{};return Y(n??[],e,b,(c,p,f)=>w(c,f?`nothing — the old value draws nothing (${y}: no ${p})`:`${d}${y}: ${p}`),i)},J=n=>re(n,s=>`${a}~${s}-${++K}`),W=(n,s,b)=>{const y=n.of?n.of(s):Array.isArray(s[n.key])?s[n.key]:[],g=typeof n.props=="function"?n.props(r,i):n.props??{},d=y.map((f,x)=>{const l=f??{},u=n.item?.(l,x,r)??{},O=N(u.reverse?[...n.parts].reverse():n.parts,l,!1,`item ${x+1}: `);return n.flat?u.props?O.map(E=>({...E,props:{...E.props,...u.props,id:E.props.id}})):O:[$(P,{name:`${n.name} ${x+1}`,...g,...u.props??{},[v]:O})]});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"),ae(y.map(x=>x??{}),f.of,f.of).map((x,l)=>{const u=x.items.map(S=>S.item),O=f.parts?N(f.parts,f.head?.(u,r)??{},!1,`group ${l+1}: `):[],E=x.items.map(S=>d[S.index]),z=f.perRow?.(u.length,r),I=Number.isInteger(z)&&z>=1?z:1,C=[];if(f.perRow&&I<E.length)for(let S=0;S*I<E.length;S++)C.push(E.slice(S*I,(S+1)*I).flat());return $(P,{name:`${f.name} ${l+1}`,...f.props??{},[v]:[...O,$(P,{name:`${f.itemsName} ${l+1}`,...f.itemsProps?.(u.length,r)??{},[v]:C.length?C.map((S,U)=>$(P,{name:`${f.rowName??`${f.itemsName} row`} ${U+1}`,...f.rowProps??{},[v]:S})):E.flat()})]})})}const w=n.perRow?.(r),e=n.perRow?Number.isInteger(w)&&w>=1?w: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 d.flat();const c=typeof n.rowProps=="function"?n.rowProps(r,i):n.rowProps??{},p=[];for(let f=0;f*e<d.length;f++){const x=d.slice(f*e,(f+1)*e).flat(),l=n.rowFiller?e-d.slice(f*e,(f+1)*e).length:0;p.push($(P,{name:`${n.rowName??`${n.name} row`} ${f+1}`,...c,[v]:[...x,...Array.from({length:l},(u,O)=>$(P,{name:`Empty ${O+1}`,...n.rowFiller,[v]:[]}))]}))}return p},N=(n,s,b,y)=>{const g=[],d=(e,c)=>b?_(e,c):void 0,w=e=>b?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(r,b?void 0:s)))switch(e.kind){case"text":{const c=H(s[e.key]);if(!c.text.trim()&&!(b&&i.press&&o.pressKeepsEmpty?.includes(e.key))){d(e.key,"nothing — empty words draw nothing, so no block");break}const p=pe(e.role??"body"),{_partStyles:f,...x}=p,l=ue(p,e.styleFrom?{...e.style,...e.styleFrom(r,i)}:e.style,w(e.key),e.props?.align);if(e.was&&b){const u=l._partStyles?.text??{};B.push({key:e.key,was:e.was,...typeof u.textStyle=="string"?{textStyle:u.textStyle}:{},...R(u.size)!==void 0?{size:R(u.size)}:{},...R(u.sizePhone)!==void 0?{sizePhone:R(u.sizePhone)}:{}})}g.push($("Text",{text:e.mark==="accentLead"?le(c.text):e.mark==="accentItalic"?ie(c.text):c.text,...x,...e.props??{},...l,...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Text block: its words${c.hidden?", hidden":""}`);break}case"button":{const c=H(s[e.key]);if(!c.text.trim()){d(e.key,"nothing — no words, no button"),d(e.href,"nothing — no button to link"),typeof e.variant=="object"&&d(e.variant.key,"nothing — no button to style");break}const p=typeof s[e.href]=="string"&&s[e.href]?s[e.href]:"#",f={...e.style??{},...w(e.key)??{}};g.push($("ButtonBlock",{label:c.text,href:p,...typeof e.props=="function"?e.props(s,i):e.props??{},...he(e.variant,s),...Object.keys(f).length?{_partStyles:{label:f}}:{},...c.hidden?{_hidden:!0}:{}})),d(e.key,`${y}Button block: its words`),d(e.href,`${y}Button block: its link`),typeof e.variant=="object"&&d(e.variant.key,`${y}Button block: its Style`);break}case"image":{const c=s[e.key];if(typeof c!="string"||!c){d(e.key,"nothing — no picture, no block"),e.alt&&d(e.alt,"nothing — no picture to describe");break}const p=e.alt&&typeof s[e.alt]=="string"?s[e.alt]:"";g.push($("ImageBlock",{src:c,alt:p,...e.props??{}})),d(e.key,`${y}Image block: its picture`),e.alt&&d(e.alt,`${y}Image block: its alt text`);break}case"list":{g.push(...W(e,s,d));break}case"group":{const c=N(e.parts,s,b,y),p=M(e.box,e.props,s,`${e.name} Box`,!c.length&&!e.keepEmpty,y,d);p&&g.push($(P,{name:e.name,...p,[v]:c}));break}case"block":{const c=e.parts?N(e.parts,s,b,y):[],p=M(e.box,e.props,s,`${e.type} block`,!!e.parts&&!c.length&&!e.keepEmpty,y,d);p&&g.push($(e.type,{...p,...e.slot?{[e.slot]:c}:{}}));break}case"core":{const c=e.as??t.type,p={...e.headless?{}:{headPlacement:"own-box"},...e.props??{}},f=e.keep==="rest"?Object.keys(s).filter(l=>!L.has(l)&&!(l in p)):e.keep;for(const l of f)s[l]!==void 0&&(p[l]=s[l],d(l,`the ${c} block inside the Box`));if(e.keep==="rest"){for(const u of Object.keys(e.props??{}))s[u]!==void 0&&!L.has(u)&&d(u,`nothing — the ${c} block inside the Box has the row's own value`);s.headPlacement!==void 0&&d("headPlacement",`the ${c} block inside the Box: own-box`);const l=Object.fromEntries(Object.entries(X).filter(([u])=>!L.has(u)));Object.keys(l).length&&(p._partStyles=l)}for(const[l,u]of Object.entries(e.rename??{}))s[l]!==void 0&&(p[u]=s[l],d(l,`the ${c} block inside the Box: ${u}`));if(e.derive){Object.assign(p,e.derive.props(s,i));for(const l of e.derive.reads)s[l]!==void 0&&d(l,`the ${c} block inside the Box`)}const x=typeof e.slots=="function"?e.slots(s,i):e.slots??{};for(const[l,u]of Object.entries(x))p[l]=u.flatMap(O=>"kind"in O?W(O,s,d):J([O]));g.push($(c,p));break}}return g},Q=(n,s)=>{const b=s===0?"Box":`${n.name} Box`,y=N(n.parts,r,!0,s===0?"":`${b}: `),g=typeof n.boxProps=="function"?n.boxProps(r,i):n.boxProps??{},d=Y(n.box??[],g,r,(w,e,c)=>_(w,c?`nothing — the old value draws nothing (${b}: no ${e})`:`${b}: ${e}`),i);return{type:P,props:{name:n.name,...d,[v]:y,id:ce(a,s)}}},D=[o,...o.also??[]].map(Q);r._partStyles!==void 0&&_("_partStyles","each old part's style moved to its new part");for(const[n,s]of Object.entries(o.reads??{}))r[n]!==void 0&&_(n,s);for(const[n,s]of Object.entries(o.drop??{}))n in r&&(k.push({key:n,why:s}),j.add(n));for(const n of Object.keys(r))V.has(n)||j.has(n)||k.push({key:n,why:"not in the row — not carried"});return{node:D[0],nodes:D,carried:h,dropped:k,siteWrites:[...o.site?.(t,i)??[]],restyled:B}}function Re(t,o=F,i={}){const r=t.content;if(!Array.isArray(r))return t;let m=!1;const a=r.flatMap(h=>{const k=h&&typeof h.type=="string"&&o.includes(h.type)?T[h.type]:void 0;if(!k)return[h];const B=q(h,k,i);return B.skipped!==void 0?[h]:(m=!0,B.nodes)});return m?{...t,content:a}:t}function Ae(t,o=F,i={}){if(!Array.isArray(t))return[];const r=[];return t.forEach((m,a)=>{const h=m&&typeof m.type=="string"&&o.includes(m.type)?T[m.type]:void 0;if(!h)return;const k=q(m,h,i);k.skipped===void 0&&r.push({index:a,node:k.node,nodes:k.nodes})}),r}export{v as SECTION_BOX_SLOT,P as SECTION_BOX_TYPE,F as SECTION_TO_BOX_ON,fe as SECTION_TO_BOX_PRESS,_e as boxNativeReason,q as convertSection,Re as convertSectionsInPage,Be as convertTheme,de as convertsToBox,Ie as hasWords,Ne as headParts,je as pressesAsBox,Te as registerBoxNativeSections,Ee as registerSectionToBox,ce as sectionBoxIdOf,Ae as sectionToBoxEdits,Pe as sectionToBoxRow,ve as sectionToBoxTypes};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "56.0.0",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
|
-
"efficient-easel": "^28.
|
|
56
|
+
"efficient-easel": "^28.4.0",
|
|
57
57
|
"efficient-shell": "^12.13.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@types/node": "^20",
|
|
73
73
|
"@types/react": "^19",
|
|
74
74
|
"@types/react-dom": "^19",
|
|
75
|
-
"efficient-easel": "^28.
|
|
75
|
+
"efficient-easel": "^28.4.0",
|
|
76
76
|
"efficient-shell": "^12.13.0",
|
|
77
77
|
"esbuild": "^0.28.0",
|
|
78
78
|
"happy-dom": "^20.14.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";const n="sf-hint-keep";function s({children:e}){return t("span",{className:n,children:e})}export{n as KEEP_HINT_CLASS,s as default};
|