efficient-web-builder 51.0.0 → 52.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 +33 -0
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewPartStyleContext.d.ts +2 -2
- package/dist/editor/components/SiteTextStylesField.d.ts +2 -1
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +12 -44
- package/dist/editor/lib/document/ColourControl.d.ts +11 -8
- package/dist/editor/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Series/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/StatsParagraph/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/controls.d.ts +14 -4
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/format/lib/content/borders.d.ts +4 -2
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/button-icon.d.ts +1 -1
- package/dist/format/lib/content/button-icon.js +1 -1
- package/dist/format/lib/content/card-state.d.ts +8 -0
- package/dist/format/lib/content/card-state.js +1 -0
- package/dist/format/lib/content/section-background.d.ts +10 -3
- package/dist/format/lib/content/section-background.js +1 -1
- package/dist/format/lib/content/section-min-height.d.ts +17 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +9 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/document/card-template-layers.d.ts +1 -1
- package/dist/format/lib/document/card-template-layers.js +1 -1
- package/dist/format/lib/document/part-inks.d.ts +5 -10
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +1 -0
- package/dist/format/lib/document/show-when-attach.d.ts +2 -1
- package/dist/format/lib/document/show-when-attach.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +0 -3
- package/dist/format/lib/editor-words-catalogue.js +2 -2
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.d.ts +4 -0
- package/dist/format/lib/source-rules/panel-rows-use-the-shared-row.js +37 -20
- package/dist/format/lib/source-rules/support/part-slider-call-sites.d.ts +0 -1
- package/dist/format/lib/source-rules/support/part-slider-call-sites.js +6 -6
- package/dist/format/lib/text-styles/site-text-colours.d.ts +11 -0
- package/dist/format/lib/text-styles/site-text-colours.js +1 -0
- package/dist/format/lib/theme.d.ts +1 -0
- package/dist/format/lib/theme.js +3 -3
- package/dist/format/lib/word-styles.d.ts +0 -1
- package/dist/format/lib/word-styles.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +1 -0
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +5 -2
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/Flex.d.ts +2 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/goldPhrases.js +2 -2
- 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-shared-columns.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.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-timeline.js +2 -2
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/passes/borders.js +1 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/document/passes/section-sticky.js +1 -1
- package/dist/render/lib/document/show-when.d.ts +1 -1
- package/dist/render/lib/document/show-when.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +1 -1
- package/dist/editor/components/PartInkControl.d.ts +0 -7
- package/dist/editor/components/PartInkControl.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FONT_OPTIONS as a}from"./fonts.js";const i=["highlight","strong","quiet"],
|
|
1
|
+
import{FONT_OPTIONS as a}from"./fonts.js";const i=["highlight","strong","quiet"],G={highlight:"Highlight",strong:"Bold",quiet:"Quiet"},T={highlight:{kind:"wordHighlight",delimiter:"@@"},strong:{kind:"wordStrong",delimiter:"++"},quiet:{kind:"wordQuiet",delimiter:"^^"}},N=Object.fromEntries(i.map(t=>[T[t].kind,t])),Y="data-sf-ws",g=["accent","text","labels"],E={accent:"var(--accent)",text:"var(--fg)",labels:"var(--fg-dim)"},O=80,h=120,m=100,L=900,R=.5,w=3,W=-.1,y=.5,D=3,s={font:null,size:null,weight:null,bold:null,italic:null,lineGap:null,textGap:null,colour:null},f={highlight:{...s},strong:{...s},quiet:{...s}};function _(t,e,o){return typeof t!="number"||!Number.isFinite(t)?null:Math.round(Math.min(Math.max(t,e),o))}function p(t,e,o){if(typeof t!="number"||!Number.isFinite(t))return null;const l=10**D;return Math.round(Math.min(Math.max(t,e),o)*l)/l}function d(t){return typeof t=="boolean"?t:null}function S(t){const e=typeof t?.font=="string"&&a.some(l=>l.key===t.font)?t.font:null,o=typeof t?.colour=="string"&&g.includes(t.colour)?t.colour:null;return{font:e,size:_(t?.size,O,h),weight:_(t?.weight,m,L),bold:d(t?.bold),italic:d(t?.italic),lineGap:p(t?.lineGap,R,w),textGap:p(t?.textGap,W,y),colour:o}}function c(t){const e={};for(const o of i)e[o]=t&&o in t&&t[o]?S(t[o]):{...f[o]};return e}function I(t,e){const o=S(e),l=f[t];return Object.keys(l).every(n=>o[n]===l[n])}function M(t){const e=c(t),o={};for(const l of i){const n=e[l],r=`--sf-ws-${l}`;if(n.font){const u=a.find(x=>x.key===n.font);u&&(o[`${r}-font`]=`var(${u.cssVar})`)}n.size!==null&&(o[`${r}-size`]=`${n.size/100}em`),n.weight!==null&&(o[`${r}-weight`]=String(n.weight)),n.bold!==null&&(o[`${r}-weight-bold`]=n.bold?"700":"400"),n.italic!==null&&(o[`${r}-style`]=n.italic?"italic":"normal"),n.lineGap!==null&&(o[`${r}-line`]=String(n.lineGap)),n.textGap!==null&&(o[`${r}-track`]=`${n.textGap}em`),n.colour!==null&&(o[`${r}-color`]=E[n.colour])}return o}function A(t){const e=t?.word_styles??void 0,o={};for(const l of i)e&&l in e&&(o[l]=e[l]??null);return c(o)}function $(t){return{word_styles:c(t)}}export{E as COLOUR_TOKEN,f as DEFAULT_WORD_STYLES,i as WORD_STYLES,Y as WORD_STYLE_ATTR,N as WORD_STYLE_BY_KIND,g as WORD_STYLE_COLOURS,D as WORD_STYLE_GAP_PRECISION,G as WORD_STYLE_LABELS,w as WORD_STYLE_LINE_GAP_MAX,R as WORD_STYLE_LINE_GAP_MIN,T as WORD_STYLE_MARKS,h as WORD_STYLE_SIZE_MAX,O as WORD_STYLE_SIZE_MIN,y as WORD_STYLE_TEXT_GAP_MAX,W as WORD_STYLE_TEXT_GAP_MIN,L as WORD_STYLE_WEIGHT_MAX,m as WORD_STYLE_WEIGHT_MIN,S as normalizeWordStyle,c as normalizeWordStyles,I as wordStyleIsDefault,M as wordStyleTokens,A as wordStylesFromRow,$ as wordStylesToRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import{buttonArrowShown as L}from"../../format/lib/content/button-arrow.js";import{buttonIconAtEnd as N,buttonIconSide as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{buttonArrowShown as L}from"../../format/lib/content/button-arrow.js";import{buttonIconAtEnd as N,buttonIconSide as j,buttonWidthClass as _,storedButtonIcon as v}from"../../format/lib/content/button-icon.js";import{buttonCornersStyle as F,buttonPadAttrs as O,buttonPaint as R}from"../lib/content/button-look.js";import{ArrowLongRightIcon as $,ArrowRightIcon as G,ArrowUpRightIcon as U,BagIcon as E,CarIcon as K,CartIcon as Y,ChevronRightIcon as z,DownloadIcon as D,EmailIcon as H,ExternalIcon as J,LocationIcon as W,PlayIcon as q,SearchIcon as M,TagIcon as Q}from"efficient-shell/icons/efficient";import V from"./BlockFrame.js";import X from"./Btn.js";import{renderGold as Z}from"./goldPhrases.js";import{alignPhoneClass as b,BLOCK_ALIGN_JUSTIFY as oo}from"../../format/lib/content/block-align.js";const to="sf-button-block",no={"arrow-right":G,"arrow-long-right":$,"arrow-up-right":U,"chevron-right":z,external:J,cart:Y,bag:E,tag:Q,email:H,location:W,play:q,download:D,search:M,car:K};function ro(o){const{label:p,href:c,variant:i,align:t,alignPhone:l,contained:I,arrow:C,icon:y,iconPosition:s,widthFit:d,widthFitPhone:B,widthFitTablet:P,buttonColor:n,buttonTextColor:h,hrefRewrite:m}=o,r=v(y),u=r&&r!=="none"?no[r]:void 0,x=r===void 0?L(C)?{}:{arrow:null}:u?{arrow:a(u,{size:16}),...j(s)==="before"?{glyphBefore:!0}:{}}:{arrow:null},f=O(o),g=[_(d,B,P),f?.className??""].filter(Boolean).join(" "),A=g?{className:g}:{},S=N(s,d)?{spread:!0}:{},e=R(o),T=e?e.background==="transparent"?"ghost":"primary":i,w={...e??(n?i==="ghost"?{borderColor:n}:{background:n,borderColor:n}:{}),...h?{color:h}:{},...f?.style??{},...F(o)??{}},k=Object.keys(w).length?{style:w}:{};return a(V,{contained:I,className:`${to} py-4`,children:a("div",{className:`flex${t?` ${oo[t]}`:""}${b("justify",t,l)?` ${b("justify",t,l)}`:""}`,children:a(X,{href:c||"#",variant:T,...A,...S,...x,...k,...c&&m?{hrefRewrite:m}:{},children:Z(p)})})})}export{to as BUTTON_BLOCK_CLASS,ro as default};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
3
|
+
import { type CardRowState } from "../../format/lib/content/card-state.js";
|
|
3
4
|
import type { SourceRow } from "../../format/lib/content/block-sources.js";
|
|
5
|
+
export type { CardRowState } from "../../format/lib/content/card-state.js";
|
|
4
6
|
export type CardRow = {
|
|
5
7
|
row: SourceRow;
|
|
6
8
|
index: number;
|
|
7
9
|
ownerType?: string;
|
|
8
10
|
item?: unknown;
|
|
9
11
|
nested?: boolean;
|
|
12
|
+
state?: CardRowState;
|
|
10
13
|
};
|
|
11
14
|
export declare const CardRowContext: import("react").Context<CardRow | null>;
|
|
12
15
|
export declare function useCardRow(): CardRow | null;
|
|
@@ -21,9 +24,9 @@ type CardTemplateRowsProps = {
|
|
|
21
24
|
Template: SlotComponent | undefined;
|
|
22
25
|
rows: readonly SourceRow[];
|
|
23
26
|
items?: readonly unknown[];
|
|
27
|
+
states?: readonly (CardRowState | undefined)[];
|
|
24
28
|
fallback: ReactNode;
|
|
25
29
|
wrapCopy?: (copy: ReactNode, row: CardRow) => ReactNode;
|
|
26
30
|
children: (cards: ReactNode) => ReactNode;
|
|
27
31
|
};
|
|
28
|
-
export declare function CardTemplateRows({ ownerId, ownerType, Template, rows, items, fallback, wrapCopy, children }: CardTemplateRowsProps): import("react").JSX.Element;
|
|
29
|
-
export {};
|
|
32
|
+
export declare function CardTemplateRows({ ownerId, ownerType, Template, rows, items, states, fallback, wrapCopy, children }: CardTemplateRowsProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as s,jsx as r,jsxs as h}from"react/jsx-runtime";import{createContext as x,useContext as i}from"react";import{REPEAT_ATTRIBUTE as w,REPEAT_INDEX_ATTRIBUTE as S}from"efficient-easel/draw";import{CARD_TEMPLATE_SLOT as P,rowFilledProps as j}from"../../format/lib/content/card-template.js";import{CARD_STATE_LINE_CLASS as D,cardStateAttrs as I,cardStateValue as L}from"../../format/lib/content/card-state.js";const c=x(null);function U(){return i(c)}function $({type:a,props:u,children:t}){const n=i(c);return r(s,{children:t(j(a,u,n?.row),n)})}function b({ownerId:a,ownerType:u,Template:t,rows:n,items:E,states:T,fallback:_,wrapCopy:l,children:A}){const C=i(c);if(!t||(t.blockCount??0)<=0)return r(s,{children:_});const R=C!==null,f=n.map((p,o)=>{const e=T?.[o],d={row:p,index:o,ownerType:u,item:E?.[o],nested:R,...e?{state:e}:null},m=r("div",{[w]:`${a}:${P}`,[S]:o,...I(e),children:L(e)?h(s,{children:[r(t,{}),r("span",{"aria-hidden":"true",className:D})]}):r(t,{})});return r(c.Provider,{value:d,children:l?l(m,d):m},o)});return r(s,{children:A(f)})}export{c as CardRowContext,$ as CardRowDrawn,b as CardTemplateRows,U as useCardRow};
|
|
@@ -9,6 +9,7 @@ type AlignItems = "start" | "center" | "end" | "stretch";
|
|
|
9
9
|
interface FlexProps {
|
|
10
10
|
padV2?: boolean;
|
|
11
11
|
border?: unknown;
|
|
12
|
+
borderTablet?: unknown;
|
|
12
13
|
borderPhone?: unknown;
|
|
13
14
|
direction: Direction;
|
|
14
15
|
label?: string;
|
|
@@ -60,5 +61,5 @@ interface FlexProps {
|
|
|
60
61
|
mirrorCards?: unknown;
|
|
61
62
|
content: SlotComponent;
|
|
62
63
|
}
|
|
63
|
-
export default function Flex({ direction, label, tabShape, gap, gapPhone, gapTablet, justify, align, wrap, share, sharePhone, shareTablet, wrapPhone, phoneRow, columns, columnsTablet, separator, blockSpacing, bgImage, bgImagePhone, pictureHover, darken, darkenStyle, placement, padV2, border, borderPhone, pad, contained, fillHeight, shadow, loop, scrollDirection, loopSeconds, loopDelay, editing, fillColor, line, upcoming, link, boxShape, boxShapePhone, boxShapeTablet, jumpHighlight, anchor, sharedSides, boxId, mirrorCards, content: Content, }: FlexProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
64
|
+
export default function Flex({ direction, label, tabShape, gap, gapPhone, gapTablet, justify, align, wrap, share, sharePhone, shareTablet, wrapPhone, phoneRow, columns, columnsTablet, separator, blockSpacing, bgImage, bgImagePhone, pictureHover, darken, darkenStyle, placement, padV2, border, borderTablet, borderPhone, pad, contained, fillHeight, shadow, loop, scrollDirection, loopSeconds, loopDelay, editing, fillColor, line, upcoming, link, boxShape, boxShapePhone, boxShapeTablet, jumpHighlight, anchor, sharedSides, boxId, mirrorCards, content: Content, }: FlexProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
64
65
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as g,jsx as s,jsxs as eo}from"react/jsx-runtime";import{useId as
|
|
1
|
+
import{Fragment as g,jsx as s,jsxs as eo}from"react/jsx-runtime";import{useId as Me}from"react";import{parseHexColor as We}from"efficient-shell/format";import je from"./BoxTabs.js";import{BoxTabPaneContext as He,useIsTabPane as Ue}from"./BoxTabPaneContext.js";import{CellFillContext as Xe,InBoxContext as Ge,useCellOfStretchedRow as ze,useFillsCell as Je}from"./InBoxContext.js";import Ke,{InsideSiteColumn as Ko,useInsideSiteGutter as Ye,useSectionRoot as qe}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as Qe}from"./BoxSurfaceContext.js";import Ve from"./PictureWash.js";import{BoxCellWidthContext as Ze}from"./BoxCellWidthContext.js";import{useInSiteHeader as os}from"./PhoneMenuTools.js";import{useCardRow as es}from"./CardRowContext.js";import{framesItsCards as ss}from"../../format/lib/content/card-place.js";import{MirrorContext as ts,useMirroredCopy as rs,useUnderCardBox as ns}from"./MirrorContext.js";import{isMirroredCopy as ls,mirrorCardsActs as as,mirroredBoxClass as cs,MIRROR_ROW_CLASS as ms,ownsCard as is}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as so,FRAME_GUTTER as to}from"./BlockFrame.js";import{containerGapProps as us}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as ds,boxBlockSpacingClass as fs,boxFitContentClass as Cs,boxRowColumnsClass as ps,boxRowTabletColumnsClass as Ss,boxRowTabletShareClass as xs,boxPhoneRowClasses as L,boxPhoneRowFits as bs,boxShareClasses as F,boxWrapClass as hs}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as $s,boxSeparatorSeamClass as _s,boxSeparatorStyle as Ps,isStripBox as Rs}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as ys,DEFAULT_LOOP_DIRECTION as Ls,DEFAULT_LOOP_SECONDS as As,isVerticalLoop as ws}from"../../format/lib/animation/index.js";import{LoopTrack as Os}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as m,BOX_OWNS_SIDES_CLASS as Bs,boxDarkenStyle as Ts,boxPlacementClasses as vs,CARD_SHADOW_CLASS as Ns,isBackgroundBox as Yo}from"../../format/lib/content/box-background.js";import{boxShadowAttrs as qo}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as Es,drawsSiteGutter as ks}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as gs,boxShapeClasses as Fs}from"../../format/lib/content/box-shape.js";import{BOX_JUMP_ATTR as Ds,BOX_LINK_ATTR as Qo,BOX_LINK_CLASS as Vo,BOX_LINKED_CLASS as Is,boxJumpBlocksClass as Ms,boxJumpCss as Ws,boxJumpSlug as js,boxLinkOf as Hs}from"../../format/lib/content/box-link.js";import{SiteLink as Us}from"../lib/site-runtime.js";import{sectionBorderStyle as Zo}from"../../format/lib/content/borders.js";import{finiteNumber as i}from"../../format/lib/finite-number.js";import{sectionPadAttrs as Xs}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as D}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as Gs}from"../../format/lib/content/ink.js";import{sizedBackground as ro}from"../../format/lib/sized-image.js";import{PHOTO_HOST_ATTR as zs,resolveImageTreatment as Js}from"../../format/lib/content/image-treatment.js";import{BoxRail as Ks,BoxRailStop as Ys,RAIL_STOPS_CLASS as qs,useTimelineRail as Qs}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as Vs,sharedColumnsClasses as Zs,sharedColumnsCss as ot}from"../lib/content/box-shared-columns.js";import et from"./PhotoHoverSheet.js";const no={"--sf-site-gutter":"0px"},st={overflowX:"clip",overflowY:"visible"},tt={desktop:!1,phone:!1},oe="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-tablet:bg-[image:var(--sf-box-bg-p)]",lo=o=>o==null||o==="",ao=o=>!lo(o)&&Number(o)===0;function rt({children:o}){return s(g,{children:o(Me())})}function nt({direction:o,label:ee,tabShape:se,gap:co,gapPhone:te,gapTablet:I,justify:A,align:C,wrap:mo,share:p,sharePhone:M,shareTablet:io,wrapPhone:re,phoneRow:w,columns:O,columnsTablet:W,separator:n,blockSpacing:ne,bgImage:h,bgImagePhone:uo,pictureHover:le,darken:ae,darkenStyle:ce,placement:me,padV2:fo=!1,border:Co,borderTablet:po,borderPhone:So,pad:r={},contained:j=!0,fillHeight:u=!1,shadow:xo,loop:S,scrollDirection:H=Ls,loopSeconds:ie=As,loopDelay:ue=ys,editing:bo=!1,fillColor:ho,line:$,upcoming:de,link:fe,boxShape:$o,boxShapePhone:Ce,boxShapeTablet:pe,jumpHighlight:Se,anchor:xe,sharedSides:B=tt,boxId:_o,mirrorCards:be,content:_}){const x=bo?"":Hs(fe),l=u?"":Fs($o,Ce,pe),he=!u&&gs($o)!=="",d=js(Se,xe),U=typeof ho=="string"?We(ho.trim()):null,Po=U?{backgroundColor:U}:void 0,Ro=Qs(),X=$===!0&&o!=="tabs",t=Yo(h),T=os(),$e=qe(),yo=Ue(),G=Je(),_e=ze(),v=Rs(o,n),a=S==="scroll"&&o!=="tabs",b=es(),Pe=rs(),Re=ns(),N=is({inCopy:b!==null,nestedCopy:b?.nested===!0,underBox:Re}),z=N&&ss(b?.ownerType),Lo=as({direction:o,separator:n,loop:S,line:$,bgImage:h,columns:O,columnsTablet:W,share:p,wrap:mo},N,B.desktop)&&ls(be,b?.index),Ao=t||N?"":cs(Pe,o,a?void 0:A,C),E=ps({direction:o,separator:n,loop:S,line:$,columns:O}),J=Ss({direction:o,separator:n,loop:S,line:$,columnsTablet:W}),wo=xs({direction:o,separator:n,loop:S,line:$,columns:O,columnsTablet:W,share:p,shareTablet:io}),ye=Ye(),k=Zs(B,_.blockCount??0),Le=k&&(!b||b.index===0)?ot(B,_.blockCount??0):"",Oo=[F(p),o==="row"?Cs(p):"",E,J,wo,fs(ne),$s(o,n)].filter(Boolean).join(" "),Ae=Oo?` ${Oo}`:"",Bo=["flex",o==="row"?v||a?"flex-row":`flex-row ${L(w,M,re)}`:"flex-col",hs(a?!1:mo),t?vs(me??"center",o):ds(a?void 0:A,C)+(Ao?` ${Ao}`:"")].join(" ")+Ae,P=u||t||l||G?` ${D}`:"",K=he?` ${l}`:l?`${P} ${l}`:P,To=_e&&o==="column"&&!t&&!a&&F(p)===""&&typeof A=="string"&&A!=="start",vo=P||(To?` ${D}`:""),Y=x?` ${Is}`:"",q=t||T||fo?"":" py-6",we=`${so}${q} ${to}${K}${Y}`,Oe=T?`${K}${Y}`.trim():`w-full${q}${K}${Y}`,R=us("Flex",co,o==="row"?"inline":"block",te,v||a?void 0:I),Be=v?{...R.style,...Ps(o,n)}:R.style,No=(e="")=>s(_,{className:`${Bo}${Lo?` ${ms}`:""}${R.className}${vo}${e?` ${e}`:""}${X?` ${qs}`:""}${d?` ${Ms(d)}`:""}${k}`,style:Be,minEmptyHeight:120}),Eo=ws(H)?"":_s(o,n),ko=a?s(Os,{direction:H,seconds:ie,delay:ue,editing:bo,copy:e=>No(e&&Eo?`${e} ${Eo}`:e)}):No(),go=o==="tabs"?s(je,{className:`${Bo}${R.className}${G&&!u&&!t&&!l?"":P}`,style:R.style,shape:se,children:ko}):ko,Fo=yo?s(He.Provider,{value:!1,children:go}):go,Te={stretchedRow:o==="row"&&!t&&(C===void 0||C==="stretch"),fillingColumn:o==="column"&&(G||To),columnsRow:E!==""||J!==""||k!=="",..._o?{id:_o}:null},Do=s(Ge.Provider,{value:Te,children:s(Xe.Provider,{value:!1,children:N?s(ts.Provider,{value:Lo,children:Fo}):Fo})}),Q=X?s(Ks,{row:o==="row",stops:_.blockCount??0,children:Do}):Do,ve=ee?.trim()||(yo?"":void 0),Ne={values:r,frame:q?24:0},Ee=e=>Ro?s(Ys,{on:Ro,future:de===!0,children:e}):e,ke=e=>x.startsWith("/")?s(Us,{href:x,className:Vo,"aria-labelledby":e,[Qo]:""}):s("a",{href:x,className:Vo,"aria-labelledby":e,[Qo]:""}),Io=(d?Ws(d):"")+Le,Mo=Io?s("style",{dangerouslySetInnerHTML:{__html:Io}}):null,y=Es({loop:S,direction:o,scrollDirection:H,bgImage:h}),ge=B.desktop&&k!==""&&!U&&!Zo(Co,So,po)&&Object.keys(qo(xo)).length===0&&!x&&!l&&!u&&!d&&!ks(j&&!y,ye)&&ao(co)&&(lo(I)||ao(I))&&fo&&Object.values(r).every(e=>lo(e)||ao(e)),Fe=e=>({...ge?{[Vs]:""}:null,...t?null:qo(xo),...d?{[Ds]:d}:null,...e?{id:e}:null}),Wo=E!==""?Number(O):0,De=L(w,M)===L(void 0),Ie=(o==="column"||o==="row"&&!v&&!a&&(Wo===1&&De||Wo===0&&_.blockCount===1))&&!t&&!X&&!T,jo=t&&$e&&!T,Ho=(e,c)=>Ee(s(Ke,{contained:j&&!y,style:y?no:void 0,framedClass:we,fillClass:Oe,columnClass:`${so} ${to}${vo}`,tabLabel:ve,pad:t?void 0:Ne,border:Zo(Co,So,po),outerAttrs:Fe(c),box:!0,edge:Ie,outerStyle:t?void 0:Po,bleed:jo,children:Mo||c?eo(g,{children:[Mo,c?ke(c):null,y?s(Ko,{children:e}):e]}):y?s(Ko,{children:e}):e})),Uo=e=>x?s(rt,{children:c=>Ho(e,c)}):Ho(e);if(!t){const e=C===void 0||C==="stretch",c=(F(p)!==""||E!==""||J!=="")&&!bs(w,M)&&!(wo!==""&&F(io)==="")&&(e||L(w)!==L(void 0));return Uo((o==="row"?c:o==="column"&&e)?s(Ze.Provider,{value:!0,children:Q}):Q)}const V=Ts(ae,ce),Z=Yo(uo),Xo=Z?{"--sf-box-bg":ro(h??""),"--sf-box-bg-p":ro(uo??"")}:{backgroundImage:ro(h??""),backgroundSize:"cover",backgroundPosition:"center"},Go=Js(void 0,void 0,le),f=Go.className?Go:null,oo=Xs({...r,top:i(r.top)??m.desktop,bottom:i(r.bottom)??m.desktop,topPhone:i(r.topPhone)??m.phone,bottomPhone:i(r.bottomPhone)??m.phone,left:i(r.left)??m.side,right:i(r.right)??m.side,leftPhone:i(r.leftPhone)??m.sidePhone,rightPhone:i(r.rightPhone)??m.sidePhone}),zo=s("div",{className:`relative z-[1] ${Bs} ${oo?.className??""}${u||l?` ${D}`:""}`.trimEnd(),style:V?{...oo?.style,...no,...Gs}:{...oo?.style,...no},children:Q}),Jo=jo&&j?s("div",{className:`${so} ${to}${u||l?` ${D}`:""}`,children:zo}):zo;return Uo(s(g,{children:eo("div",{className:`relative isolate overflow-hidden ${Ns}${P}${Z&&!f?` ${oe}`:""}`,style:{...z?st:{},...Po,...f?{}:Xo},...f?{[zs]:""}:{},children:[f&&eo(g,{children:[s(et,{sheet:f.sheet}),s("div",{"aria-hidden":!0,className:`absolute inset-0${z?" rounded-[inherit]":""}${Z?` ${oe}`:""} ${f.className}`,style:{...Xo,...f.style??{}}})]}),s(Ve,{wash:V,...z?{className:"rounded-[inherit]"}:{}}),V?s(Qe,{children:Jo}):Jo]})}))}export{nt as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as a,jsx as t}from"react/jsx-runtime";import{Fragment as h}from"react";import{
|
|
2
|
-
`);return t(f,{value:e,children:s.map((r,c)=>a("span",{children:[
|
|
1
|
+
import{jsxs as a,jsx as t}from"react/jsx-runtime";import{Fragment as h}from"react";import{linePrefix as N,storefrontLines as L}from"../../format/lib/markup.js";import{WORD_STYLE_ATTR as _,WORD_STYLE_BY_KIND as S}from"../../format/lib/word-styles.js";import{partInkCss as g}from"../../format/lib/document/part-inks.js";import f from"./PartStyledText.js";import{withRMark as d}from"./RMark.js";function E(e,n=!1,s){const r=m(n),c=L(e);if(c.length===1){const[i]=c,o=N(i),b=o?C(o,i.children):i.children;return a(f,{value:e,children:[s,u(b,r)]})}const l=[];return c.forEach((i,o)=>{if(i.bullet){l.push(t("span",{"data-sf-bullet":"",className:k,children:u(i.children,r)},o));return}if(i.number!=null){l.push(a("span",{"data-sf-number":i.number,className:T,children:[a("span",{className:R,children:[i.number,"."]}),u(i.children,r)]},o));return}o>0&&!A(c[o-1])&&l.push(t("br",{},`br${o}`)),l.push(t(h,{children:u(i.children,r)},o))}),a(f,{value:e,children:[s,l]})}const k="relative block pl-6 before:absolute before:left-1.5 before:font-bold before:text-accent before:content-['·']",T="relative block pl-[2em]",R="absolute left-0 w-[1.6em] text-right tabular-nums";function A(e){return e.bullet||e.number!=null}const B="text-accent underline underline-offset-[0.18em]";function C(e,n){const[s,...r]=n;return s?.kind==="text"?[{kind:"text",text:`${e}${s.text}`},...r]:[{kind:"text",text:e},...n]}function I(e){return g(e)||void 0}function u(e,n){const s=[];let r=!1;return e.forEach((c,l)=>{if(c.kind==="text"){s.push(t("span",{children:d(c.text)},l)),r=!0;return}r||s.push(t("span",{},`e${l}`)),s.push(x(c,l,n)),r=!1}),r||s.push(t("span",{},"end")),s}function p(e,n){return e.length===1&&e[0].kind==="text"?d(e[0].text):e.map((s,r)=>s.kind==="text"?t(h,{children:d(s.text)},r):x(s,r,n))}function P(e,n=!1){return u(e,m(n))}function m(e){return e?"font-normal italic text-accent":"not-italic text-accent"}function U(e){return t(f,{value:e,children:t("span",{children:e})})}function x(e,n,s){if(e.kind==="link")return t("a",{href:e.href,className:B,children:p(e.children,s)},n);const r=p(e.children,s),c=S[e.kind];if(c)return t("span",{[_]:c,children:r},n);switch(e.kind){case"underline":return t("u",{children:r},n);case"sup":return t("sup",{children:r},n);case"sub":return t("sub",{children:r},n);case"color":{const l=I(e.color);return l?t("span",{style:{color:l},children:r},n):t("span",{children:r},n)}case"accent":case"highlight":return t("em",{className:s,children:r},n);case"bold":return t("strong",{className:"font-semibold",children:r},n);case"italic":return t("em",{className:"italic",children:r},n);case"strike":return t("s",{className:"line-through",children:r},n);default:return t("span",{children:r},n)}}function Y(e,n=!0){const s=e.split(`
|
|
2
|
+
`);return t(f,{value:e,children:s.map((r,c)=>a("span",{children:[E(r,n),c<s.length-1?t("br",{}):null]},c))})}function v(e){return e.split(/\n\s*\n/).map(n=>n.trim()).filter(Boolean)}export{U as renderChrome,E as renderGold,Y as renderHeadline,P as renderMarkupNodes,v as splitParagraphs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BLOCK_FIXED_WIDTH as
|
|
1
|
+
import{BLOCK_FIXED_WIDTH as I,BLOCK_SIZE_KEYS as T,parseBlockWidthFit as l,phoneKey as F,parseTextFit as v,tabletKey as g}from"efficient-easel/draw";const L="sf-block-size",b={fit:"data-fit",fitPhone:"data-fit-phone",min:"data-fit-min",minPhone:"data-fit-min-phone"},d=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?e:void 0,E={desktop:{fill:"view-wide:w-full view-wide:[.flex-row>&]:grow",fixed:"view-wide:w-[min(var(--sf-bw),100%)] view-wide:basis-auto! view-wide:grow-0! view-wide:shrink-0"},phone:{fill:"max-view-wide:w-full",fixed:"max-view-wide:w-[min(var(--sf-bw-p),100%)] max-view-wide:basis-auto! max-view-wide:grow-0! max-view-wide:shrink-0"}},A={desktop:{fill:"view-desktop:w-full view-desktop:[.flex-row>&]:grow",fixed:"view-desktop:w-[min(var(--sf-bw),100%)] view-desktop:basis-auto! view-desktop:grow-0! view-desktop:shrink-0"},tablet:{fill:"view-tablet:max-view-desktop:w-full view-wide:max-view-desktop:[.flex-row>&]:grow",fixed:"view-tablet:max-view-desktop:w-[min(var(--sf-bw-t),100%)] view-tablet:max-view-desktop:basis-auto! view-tablet:max-view-desktop:grow-0! view-tablet:max-view-desktop:shrink-0"},phone:{fill:"max-view-tablet:w-full",fixed:"max-view-tablet:w-[min(var(--sf-bw-p),100%)] max-view-tablet:basis-auto! max-view-tablet:grow-0! max-view-tablet:shrink-0"}},C={desktop:"--sf-bw",tablet:"--sf-bw-t",phone:"--sf-bw-p"},K={minWidth:{desktop:["--sf-bmin","view-wide:min-w-[var(--sf-bmin)]!"],phone:["--sf-bmin-p","max-view-wide:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:["--sf-bmax","view-wide:max-w-[var(--sf-bmax)]"],phone:["--sf-bmax-p","max-view-wide:max-w-[var(--sf-bmax-p)]"]}},O={minWidth:{desktop:["--sf-bmin","view-desktop:min-w-[var(--sf-bmin)]!"],tablet:["--sf-bmin-t","view-tablet:max-view-desktop:min-w-[var(--sf-bmin-t)]!"],phone:["--sf-bmin-p","max-view-tablet:min-w-[var(--sf-bmin-p)]!"]},maxWidth:{desktop:["--sf-bmax","view-desktop:max-w-[var(--sf-bmax)]"],tablet:["--sf-bmax-t","view-tablet:max-view-desktop:max-w-[var(--sf-bmax-t)]"],phone:["--sf-bmax-p","max-view-tablet:max-w-[var(--sf-bmax-p)]"]}},y=["widthFit","width","minWidth","maxWidth"],k={desktop:"view-wide:whitespace-nowrap view-wide:[&_*]:whitespace-nowrap!",phone:"max-view-wide:whitespace-nowrap max-view-wide:[&_*]:whitespace-nowrap!"};function P(e){const n=[],s={},o={},w=y.some(t=>{const i=e[t]?.tablet;return t==="widthFit"?l(i)!==void 0:d(i)!==void 0}),f=w?["desktop","tablet","phone"]:["desktop","phone"],r=(t,i)=>{const a=t(i?.desktop),m=w?t(i?.tablet)??a:a;return{desktop:a,tablet:m,phone:t(i?.phone)??m}},u=r(l,e.widthFit),_=r(d,e.width);for(const t of f){const i=u[t];!i||i==="fit"||(n.push(w?A[t][i]:E[t][i]),i==="fixed"&&(s[C[t]]=`${_[t]??I.fallback}px`))}for(const t of["minWidth","maxWidth"]){const i=r(d,e[t]);for(const a of f){const m=i[a];if(m===void 0)continue;const[S,W]=w?O[t][a]:K[t][a];s[S]=`${m}px`,n.push(W)}}const p=v(e.textFit?.desktop),x=v(e.textFit?.phone),h=d(e.minFont?.desktop),c=d(e.minFont?.phone);return p==="line"&&n.push(k.desktop),(x??p)==="line"&&n.push(k.phone),p&&(o[b.fit]=p),x&&(o[b.fitPhone]=x),h!==void 0&&(o[b.min]=String(h)),c!==void 0&&(o[b.minPhone]=String(c)),n.length===0&&Object.keys(o).length===0?null:{className:[L,...n].join(" "),style:s,attrs:o}}function B(e){if(d(e.maxWidth?.desktop)!==void 0)return!0;const n=l(e.widthFit?.desktop);return n==="fill"||n==="fixed"}function H(e){const n={};for(const s of T){const o=e[s],w=e[g(s)],f=e[F(s)];(o!==void 0||w!==void 0||f!==void 0)&&(n[s]={desktop:o,tablet:w,phone:f})}return n}export{L as BLOCK_SIZE_CLASS,b as TEXT_FIT_ATTR,B as blockSetsItsWidth,P as blockSizeOf,H as blockSizeValuesOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{REPEAT_ATTRIBUTE as l,phoneKey as f,tabletKey as b}from"efficient-easel/draw";import{parseLoop as C}from"../../../format/lib/animation/loop.js";import{finiteNumber as S}from"../../../format/lib/finite-number.js";import{isBackgroundBox as _}from"../../../format/lib/content/box-background.js";import{isStripBox as g}from"../../../format/lib/content/box-separator.js";import{BOX_ALIGN_CLASS as r,boxRowColumnsClass as
|
|
1
|
+
import{REPEAT_ATTRIBUTE as l,phoneKey as f,tabletKey as b}from"efficient-easel/draw";import{parseLoop as C}from"../../../format/lib/animation/loop.js";import{finiteNumber as S}from"../../../format/lib/finite-number.js";import{isBackgroundBox as _}from"../../../format/lib/content/box-background.js";import{isStripBox as g}from"../../../format/lib/content/box-separator.js";import{CARD_STATE_ATTR as A}from"../../../format/lib/content/card-state.js";import{BOX_ALIGN_CLASS as r,boxRowColumnsClass as E,boxRowTabletColumnsClass as x}from"../../../format/lib/content/box-layout.js";const i="sharedColumns",$="shared",c="own",u="scroll",B="Row columns",K=[{value:c,label:"Each row"},{value:$,label:"Shared"}],F=[{value:c,label:"Each row"},{value:u,label:"Shared, scroll"}],O="(width >= 800px)",R="(width < 800px)";function N(t){const o={direction:t.direction,separator:t.separator,loop:C(t.loop),line:t.line};return o.direction==="row"&&!g(o.direction,o.separator)&&o.loop!=="scroll"&&o.line!==!0&&!_(typeof t.bgImage=="string"?t.bgImage:void 0)&&E({...o,columns:t.columns})===""&&x({...o,columnsTablet:t[b("columns")]})===""}function y(t){return Array.isArray(t)?t.filter(o=>typeof o?.type=="string").length:S(t?.blockCount)??0}function w(t){return N(t)&&a(y(t.content))>0?T(t[i],t[f(i)]):{desktop:!1,phone:!1}}const a=t=>Number.isInteger(t)&&t>0?t:0,d=t=>`sf-shared-cols-${t}`,m=t=>`sf-shared-cols-phone-${t}`;function T(t,o){return{desktop:t===$,phone:o===u}}function G(t,o){const n=a(o);return n?`${t.desktop?` ${d(n)}`:""}${t.phone?` ${m(n)}`:""}`:""}function p(t){const o=`[${l}]`;return`:has(> ${o} ${t}):not(:has(> ${o} ${o} ${t}))`}function h(t,o,n=""){const e=p(t);return`${e}{display:grid;grid-template-columns:${o};column-gap:0${n}}${e}>:not(:has(${t})):not(${t}){grid-column:1/-1}${e} :has(${t}),${e} ${t}{display:grid;grid-template-columns:subgrid;grid-column:1/-1;min-width:0}`}const L="data-sf-shared-plain";function D(t){const o=`[${l}]`,n=`[${L}]`,e=p(t)+`:not(:has(> :not(${o}) > :not(${n}) ${t})):not(:has(> ${o} > * > :not(${n}) ${t})):not(:has(:not(${n}) > :not(${n}) > ${t})):not(:has(> ${o}[${A}]))`,s=`${e}>:not(style):not(:has(${t})):not(${t})`;return`${e}{display:table;width:100%;border-collapse:collapse}${e}>:has(${t}),${e}>${o}>:has(${t}),${e} ${n}:has(${t}),${e} ${n}>:has(${t}){display:contents}${e} ${t}{display:table-row}${e} ${t}>*{display:table-cell;width:auto;vertical-align:top}${e} ${t}.${r.center}>*{vertical-align:middle}${e} ${t}.${r.end}>*{vertical-align:bottom}${s}{display:table-caption;caption-side:bottom}${s}:has(~ ${o}){caption-side:top}`}function X(t,o){const n=a(o);if(!n)return"";let e="";if(t.desktop){const s=`.${d(n)}`;e+=`@media ${O}{${h(s,`repeat(${n},auto)`)}${D(s)}}`}return t.phone&&(e+=`@media ${R}{${h(`.${m(n)}`,`repeat(${n},minmax(max-content,auto))`,";overflow-x:auto")}}`),e}export{i as SHARED_COLUMNS_KEY,B as SHARED_COLUMNS_LABEL,c as SHARED_COLUMNS_OFF,F as SHARED_COLUMNS_PHONE_POINTS,K as SHARED_COLUMNS_POINTS,L as SHARED_PLAIN_ATTR,G as sharedColumnsClasses,X as sharedColumnsCss,w as sharedColumnsDrawn,N as sharedColumnsFits};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as m,Fragment as b}from"react/jsx-runtime";import{SECTION_GRID_COLUMN_CLASS as I}from"../../../../../../format/lib/content/section-min-height.js";import T,{cardGridCornerClasses as x}from"../../../../../components/Cards.js";import{CardTemplateRows as H}from"../../../../../components/CardRowContext.js";import{cardKeyOf as F,cardRow as L}from"../../../../../../format/lib/content/card-template.js";import D from"../../../../../components/KeyFeatures.js";import{hidableText as K}from"efficient-easel/draw";import{declaredBlockSource as u,sourceChoices as O,sourcedRows as C}from"../../../../../../format/lib/content/block-sources.js";import{KEY_FEATURES_PH as w,keyFeaturesScaffoldItems as B}from"../../../../../../format/lib/document/blocks/general/KeyFeatures/meta.js";import{parseSectionHeadPlacement as G}from"../../../../../../format/lib/sections/section-head-placement.js";import{parseSectionEyebrowLook as S}from"../../../../../../format/lib/sections/section-eyebrow-look.js";import{phRows as k,phHide as g}from"../../scaffold.js";import{say as h}from"../../../../../../format/lib/editor-words.js";import{SERVED_CARD_FIELDS as f}from"../../../../../../format/lib/document/blocks/general/Cards/card-seed.js";import{CardsMeta as N,CARDS_PH as E}from"../../../../../../format/lib/document/blocks/general/Cards/meta.js";const _=()=>[{title:h("Card title one"),body:h("A short line about this card.")},{title:h("Card title two"),body:h("A short line about this card.")},{title:h("Card title three"),body:h("A short line about this card.")}],R=()=>_().map(e=>({[f.title]:e.title??"",[f.body]:e.body??""}));function P(e){return u(e)?C(e,e.editor?.isEditing===!0,R()).rows.filter(i=>i[f.title]||i[f.body]).map(i=>({title:i[f.title]??"",body:i[f.body]??""})):null}const j=e=>typeof e.highlightedCard=="string"?e.highlightedCard.trim():"",A=e=>Object.entries(e).some(([i,o])=>i!=="key"&&i!=="badge"&&typeof o=="string"&&o.trim()!=="");function v(e){const i=e.editor?.isEditing===!0,o=u(e),d=j(e),n=typeof e.highlightBadge=="string"?e.highlightBadge:"",s=(t,r=[])=>t.map((a,c)=>({...a,key:a.key||r[c]?.key||F(a,c)})),l=t=>{const r=d?t.findIndex(a=>a.key===d):-1;return{rows:t.map((a,c)=>({...a,badge:c===r?n:""})),states:t.map((a,c)=>c===r?$:M)}};if(o){const t=C(e,i,R());return l(s(t.rows,t.sample?O(o):[]).filter(A))}const y=k(e.items,_(),e.editor).map(L);return l(s(y).filter(t=>i||A(t)))}const $={highlighted:!0},M={};function U(e,i,o){const d=o?`relative grid ${I} bg-bg`:"relative bg-bg";return m("div",{className:i?`${d} ${i}`:d,children:e})}const de={...N,render:e=>{const i=G(e.headPlacement)==="own-box",o=t=>i?void 0:t,d=(e.template?.blockCount??0)>0,n=P(e);if((!d||e.cardStyle==="label-only")&&n&&!n.length)return m(b,{});if(e.cardStyle==="label-only"){const t=n?n.map(r=>({label:r.title??"",href:void 0})):Array.isArray(e.items)?e.items.map(r=>({label:K(r.title)??"",href:typeof r.href=="string"?r.href:void 0})):[];return m(D,{look:S(e.eyebrowLook,"KeyFeatures"),eyebrow:o(g(e.eyebrow,w.eyebrow,e.editor)),title:o(g(e.title,w.title,e.editor)),items:n?t:k(t,B(),e.editor),columns:e.columns,editing:e.editor?.isEditing})}const s=t=>m(T,{look:S(e.eyebrowLook,"Cards"),eyebrow:o(g(e.eyebrow,E.eyebrow,e.editor)),title:o(g(e.title,E.title,e.editor)),omitHead:i,editing:e.editor?.isEditing,cards:t}),{rows:l,states:y}=d?v(e):{rows:[],states:[]};return d&&n&&!l.length?m(b,{}):m(H,{ownerId:String(e.id??""),ownerType:"Cards",Template:e.template,rows:l,states:y,fallback:s(),wrapCopy:(t,r)=>U(t,x(r.index,l.length,e.columns),r.state?.highlighted===!0),children:t=>l.length?s(t):s()})}};export{de as CardsRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{phoneKey as a,tabletKey as o}from"efficient-easel/draw";import{sharedColumnsDrawn as r}from"../../../../content/box-shared-columns.js";import{CountRowsContext as c,NO_COUNTS as d}from"../../../../../components/CountRowsContext.js";import m from"../../../../../components/Flex.js";import{loopDelayOf as h,loopSecondsOf as g,parseLoop as b,parseLoopDirection as u}from"../../../../../../format/lib/animation/index.js";import{COUNTS_SOURCE as f,declaredBlockSource as S,servedRows as x}from"../../../../../../format/lib/content/block-sources.js";import{padValuesOf as w}from"../../../../content/section-padding.js";import{sectionFillsHeight as y}from"../../../../../../format/lib/content/section-min-height.js";import{pictureHoverOf as C}from"../../../../../../format/lib/animation/hover.js";import{FlexMeta as D}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";const N={...D,render:e=>{const t=l(m,{direction:e.direction,label:e.label,tabShape:e.tabShape,gap:e.gap,gapPhone:e[a("gap")],gapTablet:e[o("gap")],justify:e.justify,align:e.align,wrap:e.wrap,share:e.share,sharePhone:e[a("share")],shareTablet:e[o("share")],wrapPhone:e[a("wrap")],phoneRow:e.phoneRow,columns:e.columns,columnsTablet:e[o("columns")],separator:e.separator,blockSpacing:e.blockSpacing,bgImage:e.bgImage,bgImagePhone:e.bgImagePhone,pictureHover:C(e),darken:e.darken,darkenStyle:e.darkenStyle,placement:e.placement,padV2:e.padV2===!0,border:e.sectionBorder,borderTablet:e.sectionBorderTablet,borderPhone:e.sectionBorderPhone,pad:w(e),contained:e.contained,fillHeight:y(e),shadow:e.shadow,loop:b(e.loop),scrollDirection:u(e.scrollDirection),loopSeconds:g({loopDuration:e.loopDuration}),loopDelay:h({loopDelay:e.loopDelay}),editing:!!e.editor?.isEditing,fillColor:e.fillColor,line:e.line,upcoming:e.upcoming,link:e.link,boxShape:e.boxShape,boxShapePhone:e[a("boxShape")],boxShapeTablet:e[o("boxShape")],jumpHighlight:e.jumpHighlight,anchor:e.anchor,sharedSides:r(e),boxId:typeof e.id=="string"?e.id:void 0,mirrorCards:e.mirrorCards,content:e.content}),n=S(e),i=n?n===f?x(e):d:null;return l(c.Provider,{value:i,children:t})}};export{N as FlexRender};
|
|
@@ -31,6 +31,8 @@ export declare const leadLine: (lead: string, rest: string, run: Props, own?: Pr
|
|
|
31
31
|
export declare const bandPage: (stored: unknown, ctx: ConvertContext) => number;
|
|
32
32
|
export declare const sectionPage: (p: Props, ctx: ConvertContext) => import("../../../../../format/lib/theme.js").ThemeColors | undefined;
|
|
33
33
|
export declare const fillFrom: (colour: "surface" | "background") => (p: Props, ctx: ConvertContext) => Props;
|
|
34
|
+
export declare const ownFill: (painted: string | undefined, p: Props, ctx: ConvertContext) => Props;
|
|
35
|
+
export declare const fillNoBoxHolds: (painted: string | undefined) => string | undefined;
|
|
34
36
|
export declare const lineBorder: (p: Props, ctx: ConvertContext) => Props;
|
|
35
37
|
export declare const bandIndex: (p: Props, ctx: ConvertContext) => number;
|
|
36
38
|
export declare const bandAccent: (stored: unknown, p: Props, ctx: ConvertContext) => unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as
|
|
1
|
+
import{phoneKey as B}from"efficient-easel/draw";import{BOX as _,INNER_BOX as E,TEXT as P}from"../../../../../format/lib/document/seed-parts.js";import{ENTRANCE_KEYS as S}from"../../../animation/entrance.js";import{CARD_HOVER_KEYS as a}from"../../../../../format/lib/animation/hover.js";import{COUNT_KEY_PROP as O}from"../../../../../format/lib/content/block-sources.js";import{normalizeSiteGutter as N}from"../../../../../format/lib/content/page-width.js";import{resolveSectionPadding as R}from"../../../content/section-padding.js";import{ButtonBlockMeta as A}from"../../../../../format/lib/document/blocks/general/ButtonBlock/meta.js";import{SECTION_PAD_INNER_DEFAULTS as C}from"../../passes/section-padding.js";import{finiteNumber as r}from"../../../../../format/lib/finite-number.js";import{convertTheme as p,hasWords as I}from"../../../sections/section-to-box.js";import{THEME_SECTION_BG as H}from"../../../../../format/lib/content/section-background.js";import{parseHexColor as y}from"efficient-shell/format";import{bandPresetIndex as D,surfaceTwoTone as k}from"../../../../../format/lib/theme.js";import{BOX as Nt,DIM as Rt,INNER_BOX as At,TEXT as Ct}from"../../../../../format/lib/document/seed-parts.js";const w={...P,[O]:""},{label:et,href:nt,...W}=A.defaultProps,it=W,st={buttonFillOpacity:0,buttonBorder:{width:0},buttonPaddingTop:0,buttonPaddingRight:0,buttonPaddingBottom:0,buttonPaddingLeft:0},rt={..._,sectionAccent:0},dt=["gridSpan","sectionHeightMode","sectionHeightValue","sectionHeightUnit","sectionHeightModeTablet","sectionHeightValueTablet","sectionHeightUnitTablet","sectionHeightModePhone","sectionHeightValuePhone","sectionHeightUnitPhone","sectionCorners","sectionCornerSides","sectionBorder","sectionBorderTablet","sectionBorderPhone","sectionAccent","stickTop","stickTopDistance","stickTopTablet","stickTopDistanceTablet","stickTopPhone","stickTopDistancePhone","anchor","sectionAnimation","_hidden",...Object.values(S).flatMap(t=>[t,B(t)]),"widthFit","widthFitTablet","widthFitPhone","width","widthTablet","widthPhone","minWidth","minWidthTablet","minWidthPhone","maxWidth","maxWidthTablet","maxWidthPhone"],d="a section width key, ignored since efficient-web-builder 45 (every section, and a section's root Box, follows Site styles only; Lewis 2026-10-29), so dropping it changes nothing",ct={sectionSurface:"read by nothing in src/ (searched 2026-10-24): a retired theme key that draws nothing today, so dropping it changes nothing",widthMode:d,fullWidth:d,pageWidth:d,backgroundWidth:d,contentWidth:d,contentMax:d},at=Object.fromEntries(["sectionPaddingLeft","sectionPaddingRight","sectionPaddingLeftTablet","sectionPaddingRightTablet","sectionPaddingLeftPhone","sectionPaddingRightPhone"].map(t=>[t,"needs Box side padding outside its gutter: the old section added it outside its frame, a Box's side padding replaces the gutter. 0 live nodes store it (JJ's read-only export, 2026-10-24)"]));function v(t,o){const e=r(t.sectionPaddingTop)??0,n=r(t.sectionPaddingBottom)??0,i=r(t.sectionPaddingTopTablet),s=r(t.sectionPaddingBottomTablet);return{sectionPaddingTop:e+o.top,sectionPaddingBottom:n+o.bottom,...i===void 0?{}:{sectionPaddingTopTablet:i+o.top},...s===void 0?{}:{sectionPaddingBottomTablet:s+o.bottom},sectionPaddingTopPhone:(r(t.sectionPaddingTopPhone)??i??e)+o.topPhone,sectionPaddingBottomPhone:(r(t.sectionPaddingBottomPhone)??s??n)+o.bottomPhone}}const pt=t=>["sectionPaddingTop","sectionPaddingBottom","sectionPaddingTopTablet","sectionPaddingBottomTablet","sectionPaddingTopPhone","sectionPaddingBottomPhone"].map(o=>[o,o,(e,n)=>v(n,typeof t=="function"?t(n):t)[o]]);function c(t,o){const e=R(t,C[o]);return{sectionPaddingTop:e.top,sectionPaddingBottom:e.bottom}}const lt=t=>[["padTop","sectionPaddingTop",(o,e)=>c(e,t).sectionPaddingTop],["padBottom","sectionPaddingBottom",(o,e)=>c(e,t).sectionPaddingBottom],["sectionPaddingTop","sectionPaddingTop",(o,e)=>c(e,t).sectionPaddingTop],["sectionPaddingBottom","sectionPaddingBottom",(o,e)=>c(e,t).sectionPaddingBottom]],M={kind:"heading-case-upper",styles:["heading-1","heading-2","heading-3"]},gt=t=>o=>I(o.props[t])?[M]:[],ht=(t,o)=>({kind:"text",key:t,role:"eyebrow",props:P,...o?{style:o}:{}}),m=t=>t.background!=="transparent",L=(t,o)=>{const[e,n]=[t,o].map(i=>typeof i=="string"?i.trim():"");return e?n?`[${e} ]{color=text}${n}`:`[${e}]{color=text}`:n},T={align:"right",alignPhone:"left"},U=(t,o,e)=>{const n=i=>L(i[t],i[o]);return{kind:"block",type:"Text",when:(i,s)=>s!==void 0&&n(s)!=="",box:[[t,"text",(i,s)=>n(s)],[o,"text",(i,s)=>n(s)]],props:e}},Pt=(t,o,e,n={})=>U(t,o,{...w,...T,...n,_partStyles:{text:{textStyle:"body-5",color:"labels",...e,case:"upper",...T}}}),l=(t,o)=>typeof t=="number"&&Number.isInteger(t)&&t>=0?t:p(o)?.selected??0,u="var(--site-surface)",b="var(--site-surface-2)",g=(t,o)=>p(o)?.themes[l(t.sectionAccent??0,o)],f=t=>(o,e)=>{const n=g(o,e)?.[t];return n?{fillColor:n}:{}},x=t=>t.startsWith("#")&&y(t)!==null,mt=(t,o,e)=>{const n=t?.trim();if(n&&x(n))return{fillColor:n};if(n===u)return f("surface")(o,e);const i=n===b?g(o,e):void 0;return i?{fillColor:k(i)}:{}},Tt=t=>{const o=t?.trim();return!o||o==="transparent"||o===H||o===u||o===b||x(o)?void 0:"it paints a colour that no Box Fill can hold"},ut=(t,o)=>{const e=g(t,o)?.line;return e?{buttonBorder:{width:1,color:e}}:{}},h=(t,o)=>{const e=p(o)?.themes;return e&&m(t)?D(e,l(t.sectionAccent,o)):-1},bt=(t,o,e)=>{const n=h(o,e);return n>=0?n:t},ft=(t,o)=>{const e=h(t,o);return e>=0?{sectionAccent:e}:{}},xt=(t,o)=>m(t.props)&&h(t.props,o)<0?[{kind:"band-preset",page:l(t.props.sectionAccent,o)}]:[],Bt=t=>N(t.site?.siteGutter),F=Object.fromEntries(["Top","Right","Bottom","Left","TopPhone","RightPhone","BottomPhone","LeftPhone"].map(t=>[`sectionPadding${t}`,0])),_t=t=>({top:0,right:0,bottom:0,left:0,...t}),Et=(t,o,e,n=[])=>({kind:"group",name:t,keepEmpty:!0,props:(i,s)=>({...E,...F,...f("surface")(i,s),...typeof e=="function"?e(i,s):e}),box:[[o,"bgImage"],a.kind,a.duration,a.delay],parts:n});export{Nt as BOX,it as BUTTON,Rt as DIM,ct as DROP_COMMON,at as DROP_SIDE_PADDING,M as HEADING_CASE_UPPER,At as INNER_BOX,F as NO_PAD,w as NUMBER_TEXT,T as RIGHT_WORDS,dt as SAME_KEYS,rt as SECTION_BOX,st as SH_LINK,Ct as TEXT,bt as bandAccent,h as bandIndex,l as bandPage,ft as bandProps,xt as bandWrites,f as fillFrom,Tt as fillNoBoxHolds,gt as headingCaseOf,c as innerPad,lt as innerPadKeys,Pt as leadLine,U as leadText,ut as lineBorder,_t as lineSides,L as numberAndUnit,mt as ownFill,Et as pictureCell,g as sectionPage,Bt as siteGutterOf,ht as smallText,v as wrapperPad,pt as wrapperPadKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as
|
|
1
|
+
import{phoneKey as W,readHidable as f}from"efficient-easel/draw";import{cardColumns as M}from"../../../../components/Cards.js";import{resolveSectionBackground as X,THEME_SECTION_BG as j}from"../../../../../format/lib/content/section-background.js";import{CardsMeta as G}from"../../../../../format/lib/document/blocks/general/Cards/meta.js";import{KeyFeaturesMeta as J}from"../../../../../format/lib/document/blocks/general/KeyFeatures/meta.js";import{finiteNumber as x}from"../../../../../format/lib/finite-number.js";import{nonEmptyString as q}from"../../../../../format/lib/non-empty-string.js";import{parseSectionHeadPlacement as U}from"../../../../../format/lib/sections/section-head-placement.js";import{hasWords as V}from"../../../sections/section-to-box.js";import{BOX_TYPE as d,CONTAINER_BLOCKS_SLOT as l}from"../../../../../format/lib/document/container-blocks.js";import{labelTextSeed as Y}from"../../../../../format/lib/document/text-seeds.js";import{CARDS_BODY_LOOK as z,CARDS_CARD as Q,CARDS_TITLE_LOOK as Z,rowFieldTextSeed as a}from"../../../../../format/lib/document/blocks/general/Cards/card-seed.js";import{bandAccent as $,bandProps as ee,bandWrites as oe,BUTTON as te,DIM as p,DROP_COMMON as c,DROP_SIDE_PADDING as h,INNER_BOX as t,SAME_KEYS as m,SECTION_BOX as g,fillFrom as w,fillNoBoxHolds as ne,ownFill as se,SH_LINK as ae,TEXT as n,smallText as re,wrapperPad as y,wrapperPadKeys as b}from"./section-to-box-row-parts.js";import{headTree as k,token as r}from"./section-head-looks.js";import{boxPadding as ie}from"../../../../../format/lib/document/seed-parts.js";import{SECTION_BG_BUILT_IN as de}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";const i=(e,o,u,K)=>({sectionBorder:{top:e,right:o,bottom:u,left:K}}),O=e=>o=>M(x(o.columns)??x(e.columns)),_=e=>({kind:"group",name:"Grid",props:{...t,gap:0,...i(1,0,0,1)},parts:[e]}),C={...t,direction:"row",gap:0,share:"equal"},R="its head sits in a Box of its own above it (own-box): the row draws the head inline",T=e=>U(e.headPlacement)==="own-box",E="inline is the head the row draws; an own-box node is skipped (`skip`)",le=e=>({kind:"group",name:"Heading",props:e,parts:[re("eyebrow"),{kind:"text",key:"title",role:"heading",props:n,style:{textStyle:"heading-3",case:"upper"},was:{size:44}}]}),B={top:72,bottom:72,topPhone:72,bottomPhone:72},pe={...Q,...i(0,1,1,0)},ce={name:"Cards",boxProps:(e,o)=>({...g,direction:"column",gap:36,gapPhone:28,...w("surface")(e,o),...y(e,B)}),box:[...m,...b(B)],skip:e=>T(e)?R:typeof e.dataSource=="string"&&e.dataSource?"its cards come from a source: they are drawn from the card template on Cards":e.template!==void 0?"its cards are drawn from its own card template (an emptied one draws none): the shape the other rows land on":e.cardStyle==="label-only"?"Label only is Key Features' look: no live node holds it, so it has no row of its own yet":void 0,parts:[k("Cards"),_({kind:"list",key:"items",name:"Card",perRow:O(G.defaultProps),rowName:"Row",rowProps:C,props:(e,o)=>({...pe,...w("background")(e,o)}),parts:[{kind:"text",key:"title",props:n,style:Z},{kind:"text",key:"body",props:p,style:z}]})],drop:{...c,...h,columns:"the rows of N: one Row Box per `columns` cards, which the Box draws as N equal blocks",cardStyle:"the standard card is what the row draws; a Label only node is skipped (0 live nodes)",dataSource:"an empty source is typed cards, what the row draws; a sourced node is skipped (0 live nodes)",dataSourceOptions:"read only with a source; a sourced node is skipped (0 live nodes)",template:"an empty card template is typed cards, what the row draws; a node with a template is skipped",highlightedCard:"read only with a card template; a node with a template is skipped",highlightBadge:"read only with a card template; a node with a template is skipped",headPlacement:E,eyebrowLook:"needs the eyebrow's Filled look on a Text block: Plain is the eyebrow start look the row draws; 2 of 62 live nodes store it (JJ's export, 2026-10-24)"}},N={top:76,bottom:76,topPhone:76,bottomPhone:76},he={...t,direction:"row",align:"center",gap:16,sectionPaddingTop:32,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,...i(0,1,1,0)},L={textStyle:"body-1",color:"text"},A=(e,o)=>typeof o?.href=="string"&&o.href.trim()!=="",me={name:"Key Features",boxProps:e=>({...g,direction:"column",gap:44,...i(1,0,1,0),...y(e,N)}),box:[...m,...b(N)],parts:[le({...t,direction:"row",align:"end",gap:20,wrap:!0,share:"content"}),_({kind:"list",key:"items",name:"Feature",perRow:O(J.defaultProps),rowName:"Row",rowProps:C,props:he,parts:[{kind:"button",key:"label",href:"href",when:A,variant:"ghost",props:{...te,...ae,icon:"none"},style:L},{kind:"text",key:"label",when:(e,o)=>!A(e,o),props:n,style:L,was:{size:17}}]})],drop:{...c,...h,columns:"the rows of N: one Row Box per `columns` cells, which the Box draws as N equal blocks",eyebrowLook:"needs the eyebrow's Filled look on a Text block: Filled is Key Features' own default (lib/sections/section-eyebrow-look), so 20 of 21 published nodes draw it with nothing stored; the row draws the Plain start look (JJ's export, 2026-10-24)"}},D={top:120,bottom:120,topPhone:80,bottomPhone:80},P=e=>{const o=X(typeof e.background=="string"?e.background:void 0,de.Series);return o&&o!=="transparent"?o:void 0},S=e=>P(e)===j,ge={...t,justify:"between",gap:16,gapPhone:16,sectionHeightMode:"fixed",sectionHeightValue:340,sectionHeightUnit:"px",sectionPaddingTop:36,sectionPaddingRight:28,sectionPaddingBottom:32,sectionPaddingLeft:28,sectionPaddingTopPhone:36,sectionPaddingRightPhone:28,sectionPaddingBottomPhone:32,sectionPaddingLeftPhone:28},F={...t,direction:"row",justify:"between",gap:12,share:"content",phoneRow:2,[W("share")]:"content"},I={textStyle:"body-5",...r("label",12),letterSpacing:.22,case:"upper",lineHeight:1.5},we=e=>V(e.viewLabel)&&!f(e.viewLabel).hidden,s=e=>f(e).text?.trim?.()??"",v=e=>Object.fromEntries(Object.entries(e).filter(([,o])=>q(o)!==void 0)),ye={name:"Recurring Columns",boxProps:(e,o)=>({...g,direction:"column",gap:60,gapPhone:60,...i(0,0,1,0),...S(e)?ee(e,o):{},...se(P(e),e,o),...y(e,D)}),box:[...m.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,o,u)=>S(o)?$(e,o,u):e],...b(D)],skip:e=>ne(P(e))??(T(e)?R:void 0),site:(e,o)=>S(e.props)?oe(e,o):[],parts:[k("Series"),{kind:"core",as:"Cards",keep:[],props:{columns:4},derive:{reads:["cards"],props:e=>({items:(Array.isArray(e.cards)?e.cards:[]).map(o=>v({num:s(o.num),since:s(o.since),title:s(o.title),body:s(o.desc),count:[s(o.entries),s(o.entriesLabel)].filter(Boolean).join(" ")}))})},slots:(e,o)=>({template:[{type:d,props:{...ge,...w("background")(e,o),name:"Card"},slots:{[l]:[{type:d,props:{...t,name:"Words",gap:16,gapPhone:16},slots:{[l]:[{type:d,props:{...F,name:"Top"},slots:{[l]:[a("num",n,r("label",13),!0),a("since",n,r("label",13),!0)]}},a("title",{...n,tag:"h3"},{textStyle:"heading-3",...r("headingSmall",28),weight:500,case:"upper",lineHeight:1.04,letterSpacing:-.02}),a("body",p,{textStyle:"body-5",fontRole:"heading",...r("body",14),lineHeight:1.6})]}},{type:d,props:{...F,name:"Footer",align:"center",gap:0,gapPhone:0,sectionPaddingTop:16,sectionPaddingTopPhone:16,...i(1,0,0,0)},slots:{[l]:[a("count",p,I),...we(e)?[{type:d,props:{...t,name:"View",maxWidthPhone:266},slots:{[l]:[{type:"Text",props:{...n,text:f(e.viewLabel).text,_partStyles:{text:{...Y()._partStyles.text,...I}}}}]}}]:[]]}}]}}]})}],reads:{viewLabel:"a Text typed once in the card template: the far end of every card's footer",background:"the Box's theme (the band preset) or its Fill"},drop:{...c,...h,headPlacement:E}},H={top:60,bottom:60,topPhone:40,bottomPhone:40},be={...t,gap:8,gapPhone:8,...ie(24),...i(1,1,1,1)},ue={name:"Document Detail Cards",boxProps:e=>({...g,direction:"column",gap:40,gapPhone:16,...i(0,0,1,0),...y(e,H)}),box:[...m,...b(H)],parts:[{kind:"core",as:"Cards",keep:[],props:{columns:3},derive:{reads:["cards"],props:e=>({items:(Array.isArray(e.cards)?e.cards:[]).map(o=>v({label:s(o.label),value:s(o.value),body:s(o.desc)}))})},slots:(e,o)=>({template:[{type:d,props:{...be,...w("surface")(e,o),name:"Card"},slots:{[l]:[a("label",n,{...r("label",12),lineHeight:1.5},!0),{type:d,props:{...t,name:"Words",gap:14,gapPhone:14},slots:{[l]:[a("value",n,{textStyle:"heading-3",...r("headingSmall",20),weight:500,letterSpacing:-.015,lineHeight:1.5}),a("body",p,{textStyle:"body-5",fontRole:"accent",...r("body",14),italic:!0,lineHeight:1.5})]}}]}}]})}],drop:{...c,...h}},Fe={Cards:ce,KeyFeatures:me,Series:ye,DocMetaCards:ue};export{Fe as CARDS_SECTION_TO_BOX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as
|
|
1
|
+
import{phoneKey as h}from"efficient-easel/draw";import{COUNT_KEY_PROP as g}from"../../../../../format/lib/content/block-sources.js";import{resolveSectionBackground as u,THEME_SECTION_BG as T}from"../../../../../format/lib/content/section-background.js";import{finiteNumber as B}from"../../../../../format/lib/finite-number.js";import{hasWords as s}from"../../../sections/section-to-box.js";import{DROP_COMMON as m,DROP_SIDE_PADDING as f,INNER_BOX as o,NUMBER_TEXT as w,SAME_KEYS as S,SECTION_BOX as b,TEXT as y,bandAccent as O,bandProps as A,bandWrites as E,fillFrom as N,innerPad as R,innerPadKeys as H,smallText as i,wrapperPad as I,wrapperPadKeys as v}from"./section-to-box-row-parts.js";import{fluidToken as M,headTree as F,token as n}from"./section-head-looks.js";import{SECTION_BG_BUILT_IN as P}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";const p=e=>typeof e=="string"?e.trim():"";function k(e){const t=`${p(e.prefix)}${p(e.value)}`,a=p(e.suffix);return e.emphasizeAll===!0?t?`==_${t}_==`:"":`${t}${a?`==_${a}_==`:""}`}const d={kind:"block",type:"Text",props:{...w,_partStyles:{text:{textStyle:"heading-2",...M("headingMedium",56,7,96),weight:500,case:"none",lineHeight:.9,letterSpacing:-.04}}},box:[["value","text",(e,t)=>k(t)]],when:(e,t)=>t!==void 0&&typeof t.value=="string"&&k(t)!==""},x=e=>s(e?.supSuffix),c=e=>u(e.background,P.StatsParagraph),r=e=>c(e)===T,l=e=>({...e,sectionAccent:e.sectionAccent??0}),C=(e,t)=>r(e)?N("background")(e,t):{},D={name:"Stats with Text",skip:e=>c(e)&&c(e)!=="transparent"&&!r(e)?"it paints a colour of its own, not the section band":void 0,boxProps:(e,t)=>({...b,direction:"column",gap:60,gapPhone:60,sectionBorder:{bottom:1},...R(e,"StatsParagraph"),...r(e)?A(l(e),t):{}}),box:[...S.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,a)=>r(t)?O(e,l(t),a):e],...H("StatsParagraph")],site:(e,t)=>r(e.props)?E({props:l(e.props)},t):[],parts:[F("StatsParagraph"),{kind:"group",name:"Stats",props:{...o,gap:0},parts:[{kind:"list",key:"stats",name:"Stat",perRow:()=>4,rowName:"Stats row",rowProps:{...o,direction:"row",gap:0,share:"equal",phoneRow:2,[h("share")]:"content"},props:(e,t)=>({...o,justify:"between",gap:12,gapPhone:12,sectionHeightMode:"fixed",sectionHeightValue:242,sectionHeightUnit:"px",widthFitPhone:"fixed",widthPhone:800,sectionPaddingTop:48,sectionPaddingBottom:48,sectionPaddingLeft:32,sectionPaddingRight:32,sectionBorder:{top:1,right:1,bottom:1,left:1},...C(e,t)}),parts:[{...d,when:(e,t)=>!x(t)&&d.when(e,t)},{kind:"group",name:"Figure",props:{...o,direction:"row",align:"start",gap:32,gapPhone:32,share:"content",phoneRow:2,[h("share")]:"content"},when:(e,t)=>x(t),parts:[d,{kind:"text",key:"supSuffix",props:y,style:{textStyle:"body-5",...n("label",13),weight:500,color:"accent",letterSpacing:.18,lineHeight:1,padding:12}}]},{kind:"group",name:"Words",props:{...o,gap:4,gapPhone:4},parts:[{kind:"text",key:"label",props:y,style:{textStyle:"body-1",fontRole:"heading",...n("body",16),lineHeight:1.5,letterSpacing:-.01}},i("sub",{color:"labels",...n("label",12),lineHeight:1.5,letterSpacing:.24})]}]}]}],drop:{...m,...f,background:"the band is the Box's theme: the site's band preset (`sectionAccent`), or a declared band-preset write; none paints nothing, and any other colour is skipped",headPlacement:"needs a row per head placement: an own-box Stats with Text draws no head (its words sit in a Section Header above it), the row always draws the head"}},K=new Set(["value","label",g]),_={top:48,bottom:48,topPhone:48,bottomPhone:48},U=e=>{const t=u(typeof e.background=="string"?e.background:void 0,P.Stats);return!!t&&t!=="transparent"},$={name:"Stats",skip:e=>U(e)?"it paints a colour inside its padding, and a Box paints its Fill over the padding too":s(e.dataSource)?"its figures come from a source":Array.isArray(e.items)&&e.items.some(t=>s(t?.[g]))?"a figure names a count, and each figure Text here is typed by hand until it is linked":Array.isArray(e.items)&&e.items.some(t=>Object.keys(t??{}).some(a=>!K.has(a)))?"a figure has a key no part here reads":Object.keys(e._partStyles??{}).some(t=>t!=="heading")?"a figure or a name has a style of its own, kept by kind, which no part here reads":void 0,boxProps:e=>({...b,direction:"column",gap:24,gapPhone:24,...I(e,_)}),box:[...S,...v(_)],parts:[i("heading",{color:"labels",...n("label",12),letterSpacing:.2}),{kind:"group",name:"Stats",props:{...o,gap:32,gapPhone:32},parts:[{kind:"list",key:"items",name:"Stat",perRow:e=>B(e.columns)??4,rowName:"Stats row",rowProps:{...o,direction:"row",gap:32,gapPhone:32,share:"equal",phoneRow:2},props:{...o,gap:8,gapPhone:8,sectionBorder:{top:1},sectionPaddingTop:20},parts:[{kind:"text",key:"value",props:w,style:{textStyle:"heading-2",...n("headingMedium",48,36),weight:500,case:"none",lineHeight:1,letterSpacing:-.03}},i("label",{color:"labels",...n("label",12),letterSpacing:.2})]}]}],drop:{...m,...f,columns:"the rows of N: one row Box per `columns` figures, which the Box draws",dataSource:"an empty source is typed figures, what the row draws; a sourced node is skipped (0 Hartes nodes)",dataSourceOptions:"read only with a source; a sourced node is skipped (0 Hartes nodes)",contained:"the Box draws the site frame now; each figure fills the Box's column",background:"only no fill reaches here: a node that paints a colour is skipped"}},V={StatsParagraph:D,Stats:$};export{V as STATS_SECTION_TO_BOX,k as figureWords};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{BUTTON as
|
|
1
|
+
import{resolveSectionBackground as E,THEME_SECTION_BG as I}from"../../../../../format/lib/content/section-background.js";import{SECTION_BG_BUILT_IN as P}from"../../../../../format/lib/document/blocks/general/section-bg-built-in.js";import{BUTTON as m,DIM as s,bandAccent as B,bandIndex as N,bandWrites as O,fillNoBoxHolds as H,ownFill as M,DROP_COMMON as b,DROP_SIDE_PADDING as u,INNER_BOX as r,SAME_KEYS as y,SECTION_BOX as k,lineBorder as x,TEXT as l,innerPad as T,innerPadKeys as w}from"./section-to-box-row-parts.js";import{splitParagraphs as A}from"../../../../components/goldPhrases.js";import{TIMELINE_YEAR_BOX as C,TIMELINE_YEAR_HEAD as f}from"../../../../../format/lib/sections/timeline-year-shape.js";import{boxPadding as v}from"../../../../../format/lib/document/seed-parts.js";const D="jetbrains-mono",S="space-grotesk",i=(e,t,n={})=>({textStyle:"body-5",font:D,size:e,sizePhone:e,letterSpacing:t,lineHeight:1.5,weight:400,...n}),p=(e,t,n,d)=>({font:S,size:e,sizePhone:t,case:"upper",weight:500,letterSpacing:n,lineHeight:d}),a=(e,t,n,d={})=>({textStyle:"body-1",font:S,size:e,sizePhone:t,weight:400,case:"none",lineHeight:n,...d}),o=(e,t,n={})=>({kind:"text",key:e,props:l,style:t,...n}),_=(e,t)=>t?.future===!0,c=e=>A(typeof e?.body=="string"?e.body:""),g=e=>E(typeof e.background=="string"?e.background:void 0,P.TimelineTrack),h=e=>g(e)===I?e:{...e,background:"transparent"},R={name:"Milestone Timeline",skip:e=>H(g(e)),boxProps:(e,t)=>{const n=N(h(e),t);return{...k,direction:"column",gap:60,sectionBorder:{bottom:1},...T(e,"TimelineTrack"),...M(g(e),e,t),...n>=0?{sectionAccent:n}:{}}},box:[...y.filter(e=>e!=="sectionAccent"),["sectionAccent","sectionAccent",(e,t,n)=>B(e,h(t),n)],...w("TimelineTrack")],parts:[{kind:"group",name:"Heading",props:{...r,direction:"row",align:"end",justify:"between",gap:40,share:"content",sectionPaddingBottom:32,sectionBorder:{bottom:1}},parts:[{kind:"group",name:"Title",props:{...r,direction:"row",align:"end",gap:40,share:"content"},parts:[o("eyebrow",i(13,.3,{case:"upper",color:"accent",padding:8}),{role:"eyebrow"}),o("title",{textStyle:"heading-2",...p(79,40,-.03,1)},{role:"heading"})]},o("intro",a(14,14,1.5),{props:{...s,align:"right",maxWidth:360}})]},{kind:"group",name:"Years",props:{...r,direction:"row",share:"equal",gap:0,line:!0},parts:[{kind:"list",key:"entries",name:"Year",props:{...r,...C},item:e=>({props:e.future===!0?{upcoming:!0}:{}}),parts:[{kind:"group",name:f.name,props:{...r,...f},parts:[o("date",i(13,.22,{color:"accent"}),{when:(e,t)=>!_(e,t)}),o("date",i(13,.22,{color:"labels"}),{when:_}),o("title",{textStyle:"heading-3",...p(20,20,-.02,1.1)},{role:"heading"})]},o("blurb",a(13,13,1.55),{props:s})]}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:(e,t)=>({...m,align:"right",...x(e,t)}),style:i(13,.3,{case:"upper"})}],site:(e,t)=>O({props:h(e.props)},t),drop:{...b,...u,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"}},Y={name:"Story Timeline",skip:e=>{const t=typeof e.layout=="string"?e.layout:"split";return t==="split"?void 0:`display "${t}": not converted (0 live pages; Spine and Alternating are not offered, a Track story is not stored anywhere)`},boxProps:e=>({...k,direction:"row",share:"twoThree",gap:80,align:"start",...T(e,"Timeline")}),box:[...y,...w("Timeline")],parts:[{kind:"group",name:"Heading",props:{...r,gap:24},parts:[o("eyebrow",i(12,.3,{case:"upper",color:"accent"}),{role:"eyebrow"}),o("title",{textStyle:"heading-2",...p(72,40,-.03,.94)},{role:"heading"}),o("intro",a(14,14,1.6),{props:{...s,maxWidth:360}}),{kind:"group",name:"Picture",keepEmpty:!0,box:[["imageSrc","bgImage"]],props:{...r,sectionBorder:{top:1,right:1,bottom:1,left:1},darken:75,darkenStyle:"bottom",placement:"bottom-center",sectionHeightMode:"fixed",sectionHeightValue:667,sectionHeightUnit:"px",sectionHeightModePhone:"fixed",sectionHeightValuePhone:419,sectionHeightUnitPhone:"px",...v(12,16)},when:e=>typeof e.imageSrc=="string"&&e.imageSrc.trim()!=="",parts:[{kind:"group",name:"Caption",props:{...r,direction:"row",justify:"between",align:"center",gap:12,share:"content",phoneRow:2},parts:[o("imageCaption",i(11,.24,{case:"upper",color:"text"})),o("imageMeta",i(11,.24,{case:"upper",color:"accent"}),{props:{...l,align:"right"}})]}]},{kind:"button",key:"ctaText",href:"ctaHref",variant:"ghost",props:(e,t)=>({...m,...x(e,t)}),style:i(13,.3,{case:"upper"})}]},{kind:"group",name:"Chapters",props:{...r,gap:48,line:!1},parts:[{kind:"list",key:"entries",name:"Chapter",props:{...r,direction:"row",gap:24,share:"biggerRight",align:"start"},parts:[o("date",i(13,.24,{color:"accent"})),{kind:"group",name:"Words",props:{...r,gap:14},parts:[o("title",{textStyle:"heading-3",...p(24,20,-.02,1.5)},{role:"heading"}),{kind:"block",type:"Text",props:{...l,_partStyles:{text:a(17,16,1.6)}},box:[["body","text",(e,t)=>c(t)[0]??""]],when:(e,t)=>c(t).length>0},{kind:"block",type:"Text",props:{...s,_partStyles:{text:a(17,16,1.6,{paragraphSpacing:14})}},box:[["body","text",(e,t)=>c(t).slice(1).join(`
|
|
2
2
|
|
|
3
|
-
`)]],when:(e,t)=>c(t).length>1}]}]}]}],drop:{...
|
|
3
|
+
`)]],when:(e,t)=>c(t).length>1}]}]}]}],drop:{...b,...u,layout:"Split is the only display converted (see skip); the Box's own arrangement replaces it"}},G={TimelineTrack:R,Timeline:Y};export{G as TIMELINE_SECTION_TO_BOX};
|