efficient-web-builder 67.8.1 → 68.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/dist/editor/components/BlockGapField.d.ts +4 -1
- package/dist/editor/components/BlockGapField.js +1 -1
- package/dist/editor/components/CornersField.d.ts +3 -1
- package/dist/editor/components/CornersField.js +1 -1
- package/dist/editor/components/SideSpaceField.d.ts +5 -1
- package/dist/editor/components/SideSpaceField.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.d.ts +0 -5
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +6 -1
- package/dist/editor/components/useSiteLengthRow.d.ts +15 -0
- package/dist/editor/components/useSiteLengthRow.js +1 -0
- package/dist/editor/lib/content/site-length-rows.d.ts +15 -0
- package/dist/editor/lib/content/site-length-rows.js +1 -0
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ProcessSteps/fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +2 -0
- package/dist/editor/lib/document/box-fields.js +1 -1
- package/dist/editor/lib/document/choice-pictures.d.ts +2 -0
- package/dist/editor/lib/document/choice-pictures.js +1 -1
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/shape-picker.js +1 -1
- package/dist/format/lib/content/block-align.d.ts +2 -0
- package/dist/format/lib/content/block-align.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/container-gap.d.ts +1 -0
- package/dist/format/lib/content/container-gap.js +1 -1
- package/dist/format/lib/content/css-length.d.ts +5 -6
- package/dist/format/lib/content/css-length.js +1 -1
- package/dist/format/lib/content/gallery-layout.d.ts +25 -11
- package/dist/format/lib/content/gallery-layout.js +1 -1
- package/dist/format/lib/content/grid-span.d.ts +4 -0
- package/dist/format/lib/content/grid-span.js +1 -1
- package/dist/format/lib/content/image-text-rows.d.ts +1 -0
- package/dist/format/lib/content/image-text-rows.js +1 -1
- package/dist/format/lib/content/page-width.d.ts +2 -1
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/section-min-height.d.ts +3 -1
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/view-lines.d.ts +7 -0
- package/dist/format/lib/content/view-lines.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +2 -0
- package/dist/format/lib/editor-words-catalogue.js +2 -2
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/source-rules/site-length-writes.d.ts +18 -0
- package/dist/format/lib/source-rules/site-length-writes.js +2 -0
- package/dist/format/lib/theme.d.ts +5 -0
- package/dist/format/lib/theme.js +1 -1
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +2 -1
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/Eyebrow.js +1 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +6 -0
- package/dist/render/components/InBoxContext.js +1 -1
- package/dist/render/components/Logo.js +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/PreviewHeaderContext.d.ts +3 -1
- package/dist/render/components/PreviewHeaderContext.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/SectionAnimation.js +1 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/components/ViewHideRoot.d.ts +2 -1
- package/dist/render/components/ViewHideRoot.js +1 -1
- package/dist/render/lib/content/section-edge.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-docbody.js +2 -2
- package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
- package/dist/render/lib/document/passes/block-size.js +1 -1
- package/dist/render/lib/document/passes/cell-width.js +1 -1
- package/dist/render/lib/document/passes/section-anchor.js +1 -1
- package/dist/render/lib/document/passes/section-height.js +1 -1
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/package.json +10 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as n}from"../parse-option.js";import{withRowsShownWhen as o}from"../document/show-when-attach.js";import{nonEmptyString as d}from"../non-empty-string.js";import{hasOwnEntry as l}from"../own-entry.js";const a="inline",s=[{label:"In this section",value:"inline"},{label:"In its own box",value:"own-box"}];function y(e){return[e.num,e.title,e.description,e.linkProp].filter(t=>d(t)!==void 0)}const p={ProductGrid:{num:"num",title:"title",description:"description",headRows:["num","title","titleSize","description","linkText","linkHref"],renderer:"ProductGridSection",padKey:"padTop",linkProp:"link"},TyreSizes:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicTyreSizes"},FitmentFinder:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"FitmentFinder"},TyreFitment:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicTyreFitment"},BundleOffer:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},CompatibleTyres:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},RelatedProducts:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},SpecTable:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"SpecTable"},FAQ:{num:"num",title:"title",linkProp:"link",headRows:["num","title","linkText","linkHref"],renderer:"FAQ"},GalleryB:{num:"num",title:"title",headRows:["num","title","linkText","linkHref"],renderer:"GalleryGrid"},FitmentTable:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"FitmentTable"},Events:{num:"num",title:"title",linkProp:"link",headRows:["num","title","linkText","linkHref"],renderer:"Events"},ProcessSteps:{num:"num",title:"title",description:"description",headRows:["num","title","description"],headStyle:"editorial",renderer:"ProcessSteps",padKey:"padTop"},LongRead:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"LongRead"},Series:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"Series"},TimelineTrack:{num:"eyebrow",title:"title",description:"intro",headRows:["eyebrow","title","intro"],headStyle:"editorial",renderer:"TimelineTrack",padKey:"padTop"},StatsParagraph:{num:"eyebrow",title:"title",description:"desc",headRows:["eyebrow","title","desc"],headStyle:"editorial",renderer:"StatsParagraph"},Footprint:{num:"sectionNumber",title:"heading",description:"tagline",headRows:["sectionNumber","heading","tagline"],headStyle:"editorial",renderer:"Footprint",padKey:"padTop"},Collections:{num:"eyebrow",title:"heading",headRows:["eyebrow","heading"],renderer:"Collections"},Cards:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Cards"},Testimonials:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Testimonials"},Reviews:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Reviews"},Prose:{num:"eyebrow",title:"title",headRows:["eyebrow","title"],headStyle:"essay",renderer:"Prose"},ReviewForm:{num:"eyebrow",title:"title",headRows:["eyebrow","title"],headStyle:"simple",renderer:"ReviewForm"},DeliveryOptions:{num:"eyebrow",title:"title",description:"body",headRows:["eyebrow","title","body"],headStyle:"natural",headRowGap:"gap-3",headDescriptionSize:"text-[15px]",renderer:"DeliveryOptions"}},S="SectionHeader";function R(e){return l(p,e)}function T(e){return n(s,a,e)}const m=new Set(["Flex"]);function b(e){return!!e?.type&&m.has(e.type)}const i={not:{field:"headPlacement",is:"own-box"}},P={not:i};function E(e,t,r){return o(e,r,i)}export{a as DEFAULT_SECTION_HEAD_PLACEMENT,i as HEAD_ROWS_SHOW_WHEN,P as OWN_BOX_ROWS_SHOW_WHEN,s as SECTION_HEAD_PLACEMENT_OPTIONS,S as SECTION_HEAD_TYPE,p as SPLITTABLE_SECTIONS,R as canSplitHead,E as headFieldsForPlacement,y as headRoleProps,b as parentCapsWidth,T as parseSectionHeadPlacement};
|
|
1
|
+
import{parseOption as n}from"../parse-option.js";import{withRowsShownWhen as o}from"../document/show-when-attach.js";import{nonEmptyString as d}from"../non-empty-string.js";import{hasOwnEntry as l}from"../own-entry.js";const a="inline",s=[{label:"In this section",value:"inline"},{label:"In its own box",value:"own-box"}];function y(e){return[e.num,e.title,e.description,e.linkProp].filter(t=>d(t)!==void 0)}const p={ProductGrid:{num:"num",title:"title",description:"description",headRows:["num","title","titleSize","description","linkText","linkHref"],renderer:"ProductGridSection",padKey:"padTop",linkProp:"link"},TyreSizes:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicTyreSizes"},FitmentFinder:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"FitmentFinder"},TyreFitment:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicTyreFitment"},BundleOffer:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},CompatibleTyres:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},RelatedProducts:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},SpecTable:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"SpecTable"},FAQ:{num:"num",title:"title",linkProp:"link",headRows:["num","title","linkText","linkHref"],renderer:"FAQ"},GalleryB:{num:"num",title:"title",headRows:["num","title","linkText","linkHref"],renderer:"GalleryGrid"},FitmentTable:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"FitmentTable"},Events:{num:"num",title:"title",linkProp:"link",headRows:["num","title","linkText","linkHref"],renderer:"Events"},ProcessSteps:{num:"num",title:"title",description:"description",headRows:["num","title","description"],headStyle:"editorial",renderer:"ProcessSteps",padKey:"padTop"},LongRead:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"LongRead"},Series:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"Series"},Subscribe:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"Subscribe"},TimelineTrack:{num:"eyebrow",title:"title",description:"intro",headRows:["eyebrow","title","intro"],headStyle:"editorial",renderer:"TimelineTrack",padKey:"padTop"},StatsParagraph:{num:"eyebrow",title:"title",description:"desc",headRows:["eyebrow","title","desc"],headStyle:"editorial",renderer:"StatsParagraph"},Footprint:{num:"sectionNumber",title:"heading",description:"tagline",headRows:["sectionNumber","heading","tagline"],headStyle:"editorial",renderer:"Footprint",padKey:"padTop"},Collections:{num:"eyebrow",title:"heading",headRows:["eyebrow","heading"],renderer:"Collections"},Cards:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Cards"},Testimonials:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Testimonials"},Reviews:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Reviews"},Prose:{num:"eyebrow",title:"title",headRows:["eyebrow","title"],headStyle:"essay",renderer:"Prose"},ReviewForm:{num:"eyebrow",title:"title",headRows:["eyebrow","title"],headStyle:"simple",renderer:"ReviewForm"},DeliveryOptions:{num:"eyebrow",title:"title",description:"body",headRows:["eyebrow","title","body"],headStyle:"natural",headRowGap:"gap-3",headDescriptionSize:"text-[15px]",renderer:"DeliveryOptions"}},S="SectionHeader";function R(e){return l(p,e)}function T(e){return n(s,a,e)}const m=new Set(["Flex"]);function b(e){return!!e?.type&&m.has(e.type)}const i={not:{field:"headPlacement",is:"own-box"}},P={not:i};function E(e,t,r){return o(e,r,i)}export{a as DEFAULT_SECTION_HEAD_PLACEMENT,i as HEAD_ROWS_SHOW_WHEN,P as OWN_BOX_ROWS_SHOW_WHEN,s as SECTION_HEAD_PLACEMENT_OPTIONS,S as SECTION_HEAD_TYPE,p as SPLITTABLE_SECTIONS,R as canSplitHead,E as headFieldsForPlacement,y as headRoleProps,b as parentCapsWidth,T as parseSectionHeadPlacement};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as TS from "typescript";
|
|
2
|
+
import { type RuleReport, type SourceFile } from "./rule.js";
|
|
3
|
+
export type SiteLengthColumnMention = {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly line: number;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
};
|
|
8
|
+
export type SiteLengthWritesOptions = {
|
|
9
|
+
readonly names: readonly string[];
|
|
10
|
+
readonly homes: readonly {
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly count: number;
|
|
13
|
+
readonly why: string;
|
|
14
|
+
}[];
|
|
15
|
+
readonly minFiles: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function siteLengthColumnMentions(ts: typeof TS, files: readonly SourceFile[], names: readonly string[]): SiteLengthColumnMention[];
|
|
18
|
+
export declare function siteLengthWrites(ts: typeof TS, files: readonly SourceFile[], options: SiteLengthWritesOptions): RuleReport;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ruleChecks as g}from"./rule.js";function u(n,p,o){const s=new Set(o),m=o.map(i=>[i,new RegExp(`(?<![A-Za-z0-9_])${i}(?![A-Za-z0-9_])`)]),c=[];for(const i of p){if(!/\.tsx?$/.test(i.path))continue;const a=n.createSourceFile(i.path,i.text,n.ScriptTarget.Latest,!0,i.path.endsWith(".tsx")?n.ScriptKind.TSX:n.ScriptKind.TS),r=(t,e)=>c.push({path:i.path,line:a.getLineAndCharacterOfPosition(t.getStart(a)).line+1,name:e}),h=t=>{if(n.isIdentifier(t)||n.isPrivateIdentifier(t)){const e=t.text.replace(/^#/,"");s.has(e)&&r(t,e)}else if(n.isStringLiteral(t)||n.isNoSubstitutionTemplateLiteral(t)||n.isTemplateHead(t)||n.isTemplateMiddle(t)||n.isTemplateTail(t)||n.isJsxText(t))for(const[e,l]of m)l.test(t.text)&&r(t,e);n.forEachChild(t,h)};h(a)}return c}function x(n,p,o){const{check:s,report:m}=g("site length columns"),c=u(n,[{path:"fixture.ts",text:`// col
|
|
2
|
+
const p = { col: 1 }; save("col"); const colx = 2;`}],["col"]).map(e=>`${e.line}:${e.name}`);s("the reader finds a key and a string, and passes a comment and a longer name",c.join(",")==="2:col,2:col",`got ${c.join(",")}`);const i=p.filter(e=>/\.tsx?$/.test(e.path));s(`read the source (${i.length} TS/TSX files, at least ${o.minFiles})`,i.length>=o.minFiles,"fewer means the walk broke");const a=new Map;for(const e of u(n,i,o.names))a.set(e.path,[...a.get(e.path)??[],e]);const r=new Map(o.homes.map(e=>[e.path,e.count])),h=[...a].filter(([e,l])=>l.length>(r.get(e)??0));s("no file spells a site length number column beyond its home's count",h.length===0,h.map(([e,l])=>`${e} (${l.length}, home ${r.get(e)??0}): ${l.map(f=>`${f.line} ${f.name}`).join(", ")}`).join("; "));const t=o.homes.filter(e=>(a.get(e.path)?.length??0)<e.count);return s("every home still holds its count (no stale home)",t.length===0,t.map(e=>`${e.path} (${a.get(e.path)?.length??0} of ${e.count})`).join("; ")),m()}export{u as siteLengthColumnMentions,x as siteLengthWrites};
|
|
@@ -103,6 +103,11 @@ export declare function normalizeCornerStyle(v?: string | null): CornerStyle;
|
|
|
103
103
|
export declare function cornerStyleTokens(v?: string | null): Record<string, string>;
|
|
104
104
|
export declare const CORNER_RADIUS_MIN = 0;
|
|
105
105
|
export declare const CORNER_RADIUS_MAX = 40;
|
|
106
|
+
export declare const CORNER_RADIUS_GRID: {
|
|
107
|
+
readonly min: 0;
|
|
108
|
+
readonly max: 40;
|
|
109
|
+
readonly step: 1;
|
|
110
|
+
};
|
|
106
111
|
export declare const CORNER_STYLE_TO_PX: Record<CornerStyle, number | null>;
|
|
107
112
|
export declare function normalizeCornerRadius(v?: number | string | null): number | null;
|
|
108
113
|
export declare function cornerRadiusTokens(v?: number | string | null, unit?: unknown): Record<string, string>;
|
package/dist/format/lib/theme.js
CHANGED
|
@@ -15,4 +15,4 @@ import{contrastRatio as J,hexToRgb as d,parseHexColor as s,readableInk as H,rela
|
|
|
15
15
|
if (theme === 'light') document.documentElement.setAttribute('data-theme', 'light');
|
|
16
16
|
else document.documentElement.removeAttribute('data-theme');
|
|
17
17
|
} catch (e) {}
|
|
18
|
-
`}const l={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},ce=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],ie={selected:0,themes:ce};function k(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...ie}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function E(e,t,n){const r=d(e),o=d(t);if(r===null||o===null)return e;const c=(i,a)=>Math.max(0,Math.min(255,Math.round(i+(a-i)*n))).toString(16).padStart(2,"0");return`#${c(r.r,o.r)}${c(r.g,o.g)}${c(r.b,o.b)}`}const se={light:"#ffffff",dark:"#0a0a0a"},et=["light","dark"];function tt(e,t){const n=se[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:E(e,r,.1),line:E(e,r,.22),muted:E(n,e,.35),brandInk:t}}function f(e){const t=k(e);return t.themes[t.selected]}function u(e){return{text:e.text,accent:e.accent,background:e.background||l.background,surface:e.surface||l.surface,line:e.line||l.line,muted:e.muted||l.muted}}function nt(e){return{fill:u(e).background,accent:e.accent}}const ae=.4,ue="#f5f1e8",P="#0a0a0a";function le(e){const t=f(e).text,n=g(t);return n===null||n>=ae?t:null}const fe=4.5,he=3,rt={good:"Good","large-only":"Large text only",hard:"Hard to read"};function ot(e){return e>=fe?"good":e>=he?"large-only":"hard"}const de=["#000000","#ffffff"];function m(e){return H(e,de)}function ct(e,t){const n=t!==void 0&&g(t)!==null?t:ue;return H(e,[P,n])===n&&n!==P}const ge=[.25,.4,.55];function it(e){const t=d(e);return t===null?[]:ge.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function st(e){const n={"--theme-fg":f(e).text},r=le(e);return r!==null&&(n["--overlay-fg"]=r),n}const me=82;function S(e){return`color-mix(in srgb, ${e} ${me}%, #000)`}function at(e){const t=f(e);return{"--theme-accent":t.accent,"--theme-accent-2":S(t.accent),"--theme-accent-ink":m(t.accent)}}function A(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function ut(e){const t=f(e),n=A(t),r=F(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=S(n)),o["--theme-btn-ink"]=r??m(n),o}function F(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function xe(e,t){return F(e)??m(A(e)??t)}function lt(e){const t=f(e);return{fill:A(t)??t.accent.toLowerCase(),ink:xe(t,t.accent)}}function ft(e){const t={};return k(e).themes.forEach((n,r)=>{const o=u(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=S(o.accent),t[`--theme-preset-${r}-accent-ink`]=m(o.accent),t[`--theme-preset-${r}-bg`]=o.background,t[`--theme-preset-${r}-fg`]=o.text,t[`--theme-preset-${r}-surface`]=o.surface,t[`--theme-preset-${r}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${r}-line`]=o.line,t[`--theme-preset-${r}-muted`]=o.muted}),t}const T=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},b=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function $([e,t,n]){const[r,o,c]=[T(e),T(t),T(n)],i=Math.cbrt(.4122214708*r+.5363325363*o+.0514459929*c),a=Math.cbrt(.2119034982*r+.6806995451*o+.1073969566*c),h=Math.cbrt(.0883024619*r+.2817188376*o+.6299787005*c);return[.2104542553*i+.793617785*a-.0040720468*h,1.9779984951*i-2.428592205*a+.4505937099*h,.0259040371*i+.7827717662*a-.808675766*h]}function pe([e,t,n]){const r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,c=(e-.0894841775*t-1.291485548*n)**3;return[b(4.0767416621*r-3.3077115913*o+.2309699292*c),b(-1.2684380046*r+2.6097574011*o-.3413193965*c),b(-.0041960863*r-.7034186147*o+1.707614701*c)]}const I=e=>{const t=d(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},U=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],G=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,Y=e=>U(I(e.surface),I(e.line),.6);function ht(e){return G(Y(u(e)))}function z(e){const t=u(e);return G(pe(U($(Y(t)),$(I(t.text)),.92)))}function dt(e){return{...e,background:z(e)}}function B(e,t,n,r){const o=e[t];if(!o)return-1;const c=n(o);if(!c)return-1;const i=u(o);return e.findIndex((a,h)=>{if(h===t)return!1;const _=u(a);return s(_.background)!==c?!1:!r||s(_.text??"")===s(i.text??"")&&s(_.accent??"")===s(i.accent??"")})}function gt(e,t){return B(e,t,z,!1)}function mt(e,t){return B(e,t,n=>s(n.surface??""),!0)}const _e=1;function Ee(e,t){const n=(e??[]).flatMap((r,o)=>{const c=g(r.background??""),i=g(r.text??"");return c!==null&&i!==null&&c<i?[o]:[]});return n.find(r=>r!==t)??n[0]??_e}function xt(e){return Ee(e?.themes,e?.selected)}const pt=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function _t(e){const t=u(f(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,r={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==l.surface||t.line!==l.line)&&(r["--theme-surface-2"]=n),r}const Se=["heading","body","label"],Et={heading:"Headings",body:"Body",label:"Labels"};function St(e){if(!e)return null;for(const t of Se)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const X=["headingLarge","headingMedium","headingSmall","accent","body","label"],At={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},Tt={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Ae=8,Te=200;function be(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=Ae&&t<=Te?t:null}function Ie(e){const t={};for(const n of X)t[n]=be(e?.[n]);return t}function bt(e){const t=Ie(e),n={};for(const r of X){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const Re=["square","small","large"],Ce="small";function De(e){return Re.includes(e??"")?e:Ce}function It(e){return D(ye[De(e)])}const x=0,K=40,Me={min:x,max:K,step:1},ye={square:0,small:null,large:16},R={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function C(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;const t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(K,Math.max(x,Math.round(t))):null}function D(e,t){if(ee(t)&&t!=="px"){if(typeof e!="number"||!Number.isFinite(e))return{};const r=Math.max(0,e);return Object.fromEntries(Object.entries(R).map(([o,c])=>{const i=Math.round(r*c*1e4)/1e4;return[o,i===0?"0":te(i,t)]}))}const n=C(e);return n===null?{}:Object.fromEntries(Object.entries(R).map(([r,o])=>{const c=n*o/16;return[r,c===0?"0":`${c}rem`]}))}function Rt(e){return(C(e)??x)*R["--sf-button-radius"]}function Ct(e,t){const n=ne(e,t,"radius",Me);return n!==null?D(n,t):D(C(e)??x)}const Oe=["none","soft","lifted"],we="soft",W="none",He=["tight","normal","roomy"],Le="normal",Ne="normal",ke=["none","lift","highlight"],Pe="lift",Fe="highlight";import{DEFAULT_SHADOW_COLOR as Yt}from"efficient-easel/screen/lib/document/shadow-values";function j(e){return Oe.includes(e??"")?e:we}function $e(e){return He.includes(e??"")?e:Le}function V(e){return ke.includes(e??"")?e:Pe}function Dt(e){const t=j(e);return t===W?void 0:t}function Mt(e){const t=$e(e);return t===Ne?void 0:t}function yt(e){const t=V(e);return t===Fe?void 0:t}function Ot(e,t,n){const r=v(t);return r===Q?{}:j(e)!==W||V(n)==="lift"?{"--sf-shadow-color":r}:{}}const Ue=["normal","tight","compressed"],Z="normal";function q(e){return Ue.includes(e??"")?e:Z}function wt(e){const t=q(e);return t===Z?void 0:t}function Ht(e){switch(q(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Lt=["authored","sentence"],Nt={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},M=100,y=900,Ge=24,Ye=200;function p(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function O(e){const t=p(e?.weight,M,y),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:p(c,M,y),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:p(e?.weightStrong,M,y),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:p(e?.maxPx,Ge,Ye),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function kt(e){const t=O(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function Pt(e){return O({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}function Ft(e){const t=O(e);return{heading_case:t.case,heading_weight:t.weight,heading_weight_strong:t.weightStrong,heading_max_px:t.maxPx,heading_2_weight:t.weight2,heading_3_weight:t.weight3,heading_2_case:t.case2,heading_3_case:t.case3}}const w="siteTheme";function ze(e){const t=e;if(!t||typeof t!="object"||!Array.isArray(t.themes)||!t.themes.every(r=>!!r&&typeof r=="object"))return{};const n=typeof t.selected=="number"&&Number.isInteger(t.selected)&&t.selected>=0?t.selected:0;return{[w]:{selected:n,themes:t.themes}}}function $t(e){return ze(e?.[w])[w]}export{ge as ACCENT_DARKEN_STEPS,et as BRAND_INKS,He as CARD_GAPS,Oe as CARD_SHADOWS,K as CORNER_RADIUS_MAX,x as CORNER_RADIUS_MIN,Re as CORNER_STYLES,ye as CORNER_STYLE_TO_PX,Le as DEFAULT_CARD_GAP,we as DEFAULT_CARD_SHADOW,Ce as DEFAULT_CORNER_STYLE,Z as DEFAULT_HEADING_COMPRESSION,Nt as DEFAULT_HEADING_TYPOGRAPHY,Pe as DEFAULT_HOVER_EFFECT,Yt as DEFAULT_SHADOW_COLOR,Tt as DEFAULT_SIZES,l as DEFAULT_SURFACES,Je as DEFAULT_SWITCH_SHOWN,ce as DEFAULT_THEMES,qe as DEFAULT_THEME_MODE,ie as DEFAULT_THEME_VALUE,rt as GRADE_LABEL,Lt as HEADING_CASES,Ue as HEADING_COMPRESSIONS,Ye as HEADING_MAX_PX_MAX,Ge as HEADING_MAX_PX_MIN,y as HEADING_WEIGHT_MAX,M as HEADING_WEIGHT_MIN,ke as HOVER_EFFECTS,Ne as IDENTITY_CARD_GAP,W as IDENTITY_CARD_SHADOW,Fe as IDENTITY_HOVER_EFFECT,P as OVERLAY_INK_DARK,ue as OVERLAY_INK_LIGHT,fe as READABILITY_AA,he as READABILITY_AA_LARGE,At as SCALE_OF_STEP,w as SITE_THEME_KEY,X as SIZE_STEPS,Te as TEXT_SIZE_MAX,Ae as TEXT_SIZE_MIN,N as THEME_DAY_END_HOUR,L as THEME_DAY_START_HOUR,je as THEME_MODE_KEY,re as THEME_STORAGE_KEY,pt as THEME_SURFACE_KEYS,Ze as THEME_SWITCH_HIDE,Ve as THEME_SWITCH_KEY,Se as TYPE_GROUPS,Et as TYPE_GROUP_LABELS,m as accentInk,dt as bandPresetFor,gt as bandPresetIndex,tt as brandTheme,ve as buildThemeBootScript,Mt as cardGapAttr,Dt as cardShadowAttr,Ht as compressionMetrics,J as contrastRatio,D as cornerRadiusTokens,It as cornerStyleTokens,xt as darkBandIndex,Ee as darkPresetIndex,it as darkerAccents,ct as fillIsDark,ot as gradeContrast,wt as headingCompressionAttr,Pt as headingTypographyFromRow,kt as headingTypographyStyle,Ft as headingTypographyToRow,yt as hoverEffectAttr,oe as isDayHour,$e as normalizeCardGap,j as normalizeCardShadow,C as normalizeCornerRadius,De as normalizeCornerStyle,q as normalizeHeadingCompression,O as normalizeHeadingTypography,V as normalizeHoverEffect,be as normalizeSize,Ie as normalizeSizes,k as normalizeTheme,u as normalizeThemeColors,Qe as resolveTheme,xe as resolvedButtonInk,z as sectionBandTone,f as selectedThemeColors,Ot as shadowColorTokens,lt as siteButtonPaint,Rt as siteButtonRadiusPx,Ct as siteCornerRadiusTokens,ze as siteThemeMetadata,$t as siteThemeOf,mt as surfacePresetIndex,ht as surfaceTwoTone,at as themeAccentStyle,A as themeButtonColour,F as themeButtonInk,ut as themeButtonStyle,st as themeColorStyle,le as themeLightInk,ft as themePresetAccentVars,_t as themeSurfaceStyle,nt as themeSwatchColors,St as typeScaleGroupOfClassName,bt as typeSizesStyle};
|
|
18
|
+
`}const l={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},ce=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],ie={selected:0,themes:ce};function k(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...ie}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function E(e,t,n){const r=d(e),o=d(t);if(r===null||o===null)return e;const c=(i,a)=>Math.max(0,Math.min(255,Math.round(i+(a-i)*n))).toString(16).padStart(2,"0");return`#${c(r.r,o.r)}${c(r.g,o.g)}${c(r.b,o.b)}`}const se={light:"#ffffff",dark:"#0a0a0a"},et=["light","dark"];function tt(e,t){const n=se[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:E(e,r,.1),line:E(e,r,.22),muted:E(n,e,.35),brandInk:t}}function f(e){const t=k(e);return t.themes[t.selected]}function u(e){return{text:e.text,accent:e.accent,background:e.background||l.background,surface:e.surface||l.surface,line:e.line||l.line,muted:e.muted||l.muted}}function nt(e){return{fill:u(e).background,accent:e.accent}}const ae=.4,ue="#f5f1e8",P="#0a0a0a";function le(e){const t=f(e).text,n=g(t);return n===null||n>=ae?t:null}const fe=4.5,he=3,rt={good:"Good","large-only":"Large text only",hard:"Hard to read"};function ot(e){return e>=fe?"good":e>=he?"large-only":"hard"}const de=["#000000","#ffffff"];function m(e){return H(e,de)}function ct(e,t){const n=t!==void 0&&g(t)!==null?t:ue;return H(e,[P,n])===n&&n!==P}const ge=[.25,.4,.55];function it(e){const t=d(e);return t===null?[]:ge.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function st(e){const n={"--theme-fg":f(e).text},r=le(e);return r!==null&&(n["--overlay-fg"]=r),n}const me=82;function S(e){return`color-mix(in srgb, ${e} ${me}%, #000)`}function at(e){const t=f(e);return{"--theme-accent":t.accent,"--theme-accent-2":S(t.accent),"--theme-accent-ink":m(t.accent)}}function A(e){const t=e?.button;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function ut(e){const t=f(e),n=A(t),r=F(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=S(n)),o["--theme-btn-ink"]=r??m(n),o}function F(e){const t=e?.buttonInk;return t&&s(t)===t.toLowerCase()?t.toLowerCase():null}function xe(e,t){return F(e)??m(A(e)??t)}function lt(e){const t=f(e);return{fill:A(t)??t.accent.toLowerCase(),ink:xe(t,t.accent)}}function ft(e){const t={};return k(e).themes.forEach((n,r)=>{const o=u(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=S(o.accent),t[`--theme-preset-${r}-accent-ink`]=m(o.accent),t[`--theme-preset-${r}-bg`]=o.background,t[`--theme-preset-${r}-fg`]=o.text,t[`--theme-preset-${r}-surface`]=o.surface,t[`--theme-preset-${r}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${r}-line`]=o.line,t[`--theme-preset-${r}-muted`]=o.muted}),t}const T=e=>{const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},b=e=>255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055);function $([e,t,n]){const[r,o,c]=[T(e),T(t),T(n)],i=Math.cbrt(.4122214708*r+.5363325363*o+.0514459929*c),a=Math.cbrt(.2119034982*r+.6806995451*o+.1073969566*c),h=Math.cbrt(.0883024619*r+.2817188376*o+.6299787005*c);return[.2104542553*i+.793617785*a-.0040720468*h,1.9779984951*i-2.428592205*a+.4505937099*h,.0259040371*i+.7827717662*a-.808675766*h]}function pe([e,t,n]){const r=(e+.3963377774*t+.2158037573*n)**3,o=(e-.1055613458*t-.0638541728*n)**3,c=(e-.0894841775*t-1.291485548*n)**3;return[b(4.0767416621*r-3.3077115913*o+.2309699292*c),b(-1.2684380046*r+2.6097574011*o-.3413193965*c),b(-.0041960863*r-.7034186147*o+1.707614701*c)]}const I=e=>{const t=d(e);return t===null?[0,0,0]:[t.r,t.g,t.b]},U=(e,t,n)=>[e[0]*n+t[0]*(1-n),e[1]*n+t[1]*(1-n),e[2]*n+t[2]*(1-n)],G=e=>`#${e.map(t=>Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")).join("")}`,Y=e=>U(I(e.surface),I(e.line),.6);function ht(e){return G(Y(u(e)))}function z(e){const t=u(e);return G(pe(U($(Y(t)),$(I(t.text)),.92)))}function dt(e){return{...e,background:z(e)}}function B(e,t,n,r){const o=e[t];if(!o)return-1;const c=n(o);if(!c)return-1;const i=u(o);return e.findIndex((a,h)=>{if(h===t)return!1;const _=u(a);return s(_.background)!==c?!1:!r||s(_.text??"")===s(i.text??"")&&s(_.accent??"")===s(i.accent??"")})}function gt(e,t){return B(e,t,z,!1)}function mt(e,t){return B(e,t,n=>s(n.surface??""),!0)}const _e=1;function Ee(e,t){const n=(e??[]).flatMap((r,o)=>{const c=g(r.background??""),i=g(r.text??"");return c!==null&&i!==null&&c<i?[o]:[]});return n.find(r=>r!==t)??n[0]??_e}function xt(e){return Ee(e?.themes,e?.selected)}const pt=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function _t(e){const t=u(f(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,r={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==l.surface||t.line!==l.line)&&(r["--theme-surface-2"]=n),r}const Se=["heading","body","label"],Et={heading:"Headings",body:"Body",label:"Labels"};function St(e){if(!e)return null;for(const t of Se)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const X=["headingLarge","headingMedium","headingSmall","accent","body","label"],At={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},Tt={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Ae=8,Te=200;function be(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=Ae&&t<=Te?t:null}function Ie(e){const t={};for(const n of X)t[n]=be(e?.[n]);return t}function bt(e){const t=Ie(e),n={};for(const r of X){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const Re=["square","small","large"],Ce="small";function De(e){return Re.includes(e??"")?e:Ce}function It(e){return D(ye[De(e)])}const x=0,K=40,Me={min:x,max:K,step:1},ye={square:0,small:null,large:16},R={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function C(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;const t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(K,Math.max(x,Math.round(t))):null}function D(e,t){if(ee(t)&&t!=="px"){if(typeof e!="number"||!Number.isFinite(e))return{};const r=Math.max(0,e);return Object.fromEntries(Object.entries(R).map(([o,c])=>{const i=Math.round(r*c*1e4)/1e4;return[o,i===0?"0":te(i,t)]}))}const n=C(e);return n===null?{}:Object.fromEntries(Object.entries(R).map(([r,o])=>{const c=n*o/16;return[r,c===0?"0":`${c}rem`]}))}function Rt(e){return(C(e)??x)*R["--sf-button-radius"]}function Ct(e,t){const n=ne(e,t,"radius",Me);return n!==null?D(n,t):D(C(e)??x)}const Oe=["none","soft","lifted"],we="soft",W="none",He=["tight","normal","roomy"],Le="normal",Ne="normal",ke=["none","lift","highlight"],Pe="lift",Fe="highlight";import{DEFAULT_SHADOW_COLOR as Yt}from"efficient-easel/screen/lib/document/shadow-values";function j(e){return Oe.includes(e??"")?e:we}function $e(e){return He.includes(e??"")?e:Le}function V(e){return ke.includes(e??"")?e:Pe}function Dt(e){const t=j(e);return t===W?void 0:t}function Mt(e){const t=$e(e);return t===Ne?void 0:t}function yt(e){const t=V(e);return t===Fe?void 0:t}function Ot(e,t,n){const r=v(t);return r===Q?{}:j(e)!==W||V(n)==="lift"?{"--sf-shadow-color":r}:{}}const Ue=["normal","tight","compressed"],Z="normal";function q(e){return Ue.includes(e??"")?e:Z}function wt(e){const t=q(e);return t===Z?void 0:t}function Ht(e){switch(q(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Lt=["authored","sentence"],Nt={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},M=100,y=900,Ge=24,Ye=200;function p(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function O(e){const t=p(e?.weight,M,y),n=e?.case==="sentence"?"sentence":"authored",r=c=>c==null?t:p(c,M,y),o=c=>c==="sentence"?"sentence":c==="authored"?"authored":n;return{case:n,weight:t,weightStrong:p(e?.weightStrong,M,y),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:p(e?.maxPx,Ge,Ye),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function kt(e){const t=O(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function Pt(e){return O({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}function Ft(e){const t=O(e);return{heading_case:t.case,heading_weight:t.weight,heading_weight_strong:t.weightStrong,heading_max_px:t.maxPx,heading_2_weight:t.weight2,heading_3_weight:t.weight3,heading_2_case:t.case2,heading_3_case:t.case3}}const w="siteTheme";function ze(e){const t=e;if(!t||typeof t!="object"||!Array.isArray(t.themes)||!t.themes.every(r=>!!r&&typeof r=="object"))return{};const n=typeof t.selected=="number"&&Number.isInteger(t.selected)&&t.selected>=0?t.selected:0;return{[w]:{selected:n,themes:t.themes}}}function $t(e){return ze(e?.[w])[w]}export{ge as ACCENT_DARKEN_STEPS,et as BRAND_INKS,He as CARD_GAPS,Oe as CARD_SHADOWS,Me as CORNER_RADIUS_GRID,K as CORNER_RADIUS_MAX,x as CORNER_RADIUS_MIN,Re as CORNER_STYLES,ye as CORNER_STYLE_TO_PX,Le as DEFAULT_CARD_GAP,we as DEFAULT_CARD_SHADOW,Ce as DEFAULT_CORNER_STYLE,Z as DEFAULT_HEADING_COMPRESSION,Nt as DEFAULT_HEADING_TYPOGRAPHY,Pe as DEFAULT_HOVER_EFFECT,Yt as DEFAULT_SHADOW_COLOR,Tt as DEFAULT_SIZES,l as DEFAULT_SURFACES,Je as DEFAULT_SWITCH_SHOWN,ce as DEFAULT_THEMES,qe as DEFAULT_THEME_MODE,ie as DEFAULT_THEME_VALUE,rt as GRADE_LABEL,Lt as HEADING_CASES,Ue as HEADING_COMPRESSIONS,Ye as HEADING_MAX_PX_MAX,Ge as HEADING_MAX_PX_MIN,y as HEADING_WEIGHT_MAX,M as HEADING_WEIGHT_MIN,ke as HOVER_EFFECTS,Ne as IDENTITY_CARD_GAP,W as IDENTITY_CARD_SHADOW,Fe as IDENTITY_HOVER_EFFECT,P as OVERLAY_INK_DARK,ue as OVERLAY_INK_LIGHT,fe as READABILITY_AA,he as READABILITY_AA_LARGE,At as SCALE_OF_STEP,w as SITE_THEME_KEY,X as SIZE_STEPS,Te as TEXT_SIZE_MAX,Ae as TEXT_SIZE_MIN,N as THEME_DAY_END_HOUR,L as THEME_DAY_START_HOUR,je as THEME_MODE_KEY,re as THEME_STORAGE_KEY,pt as THEME_SURFACE_KEYS,Ze as THEME_SWITCH_HIDE,Ve as THEME_SWITCH_KEY,Se as TYPE_GROUPS,Et as TYPE_GROUP_LABELS,m as accentInk,dt as bandPresetFor,gt as bandPresetIndex,tt as brandTheme,ve as buildThemeBootScript,Mt as cardGapAttr,Dt as cardShadowAttr,Ht as compressionMetrics,J as contrastRatio,D as cornerRadiusTokens,It as cornerStyleTokens,xt as darkBandIndex,Ee as darkPresetIndex,it as darkerAccents,ct as fillIsDark,ot as gradeContrast,wt as headingCompressionAttr,Pt as headingTypographyFromRow,kt as headingTypographyStyle,Ft as headingTypographyToRow,yt as hoverEffectAttr,oe as isDayHour,$e as normalizeCardGap,j as normalizeCardShadow,C as normalizeCornerRadius,De as normalizeCornerStyle,q as normalizeHeadingCompression,O as normalizeHeadingTypography,V as normalizeHoverEffect,be as normalizeSize,Ie as normalizeSizes,k as normalizeTheme,u as normalizeThemeColors,Qe as resolveTheme,xe as resolvedButtonInk,z as sectionBandTone,f as selectedThemeColors,Ot as shadowColorTokens,lt as siteButtonPaint,Rt as siteButtonRadiusPx,Ct as siteCornerRadiusTokens,ze as siteThemeMetadata,$t as siteThemeOf,mt as surfacePresetIndex,ht as surfaceTwoTone,at as themeAccentStyle,A as themeButtonColour,F as themeButtonInk,ut as themeButtonStyle,st as themeColorStyle,le as themeLightInk,ft as themePresetAccentVars,_t as themeSurfaceStyle,nt as themeSwatchColors,St as typeScaleGroupOfClassName,bt as typeSizesStyle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{buttonArrowShown as v}from"../../format/lib/content/button-arrow.js";import{buttonIconAtEnd as N,buttonIconSide as R,buttonWidthClass as _,storedButtonIcon as j}from"../../format/lib/content/button-icon.js";import{buttonCornersStyle as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{buttonArrowShown as v}from"../../format/lib/content/button-arrow.js";import{buttonIconAtEnd as N,buttonIconSide as R,buttonWidthClass as _,storedButtonIcon as j}from"../../format/lib/content/button-icon.js";import{buttonCornersStyle as E,buttonPadAttrs as F,buttonPaint as O}from"../lib/content/button-look.js";import{ArrowLongRightIcon as $,ArrowRightIcon as G,ArrowUpRightIcon as U,BagIcon as D,CarIcon as K,CartIcon as V,ChatIcon as W,ChevronLeftIcon as Y,ChevronRightIcon as z,DownloadIcon as H,EmailIcon as J,ExternalIcon as q,LocationIcon as M,PackageIcon as Q,PhoneIcon as X,PlayIcon as Z,ReceiptRefundIcon as oo,SearchIcon as to,ShieldCheckIcon as no,TagIcon as ro,TruckIcon as eo,WheelIcon as co}from"efficient-shell/icons/efficient";import ao from"./BlockFrame.js";import io from"./Btn.js";import{renderGold as lo}from"./goldPhrases.js";import{alignViewClasses as so,BLOCK_ALIGN_JUSTIFY as ho}from"../../format/lib/content/block-align.js";import{useDrawsAtEdge as uo}from"./InBoxContext.js";const fo="sf-button-block",go={"arrow-right":G,"arrow-long-right":$,"arrow-up-right":U,"chevron-right":z,external:q,cart:V,bag:D,tag:ro,email:J,location:M,play:Z,download:H,search:to,car:K,phone:X,wheel:co,chat:W,"chevron-left":Y,package:Q,truck:eo,"shield-check":no,"receipt-refund":oo},mo=o=>o?` ${o}`:"";function Io(o){const{label:w,href:a,variant:i,align:e,alignTablet:p,alignPhone:b,contained:C,arrow:k,icon:y,iconPosition:l,widthFit:s,widthFitPhone:B,widthFitTablet:P,buttonColor:t,buttonTextColor:h,hrefRewrite:d}=o,u=uo(),n=j(y),f=n&&n!=="none"?go[n]:void 0,S=n===void 0?v(k)?{}:{arrow:null}:f?{arrow:r(f,{size:16}),...R(l)==="before"?{glyphBefore:!0}:{}}:{arrow:null},g=F(o),m=[_(s,B,P,{atSectionLine:!u}),g?.className??""].filter(Boolean).join(" "),L=m?{className:m}:{},T=N(l,s)?{spread:!0}:{},c=O(o),A=c?c.background==="transparent"?"ghost":"primary":i,I={...c??(t?i==="ghost"?{borderColor:t}:{background:t,borderColor:t}:{}),...h?{color:h}:{},...g?.style??{},...E(o)??{}},x=Object.keys(I).length?{style:I}:{};return r(ao,{contained:C,className:`${fo} py-4`,children:r("div",{className:`flex${e?` ${ho[e]}`:""}${mo(so("justify",e,p,b,{atSectionLine:!u}))}`,children:r(io,{href:a||"#",variant:A,...L,...T,...S,...x,...a&&d?{hrefRewrite:d}:{},children:lo(w)})})})}export{fo as BUTTON_BLOCK_CLASS,Io as default};
|
|
@@ -57,7 +57,8 @@ type CardTemplateRowsProps = {
|
|
|
57
57
|
fallback: ReactNode;
|
|
58
58
|
copyAttrs?: Readonly<Record<string, string>> | ((row: CardRow) => Readonly<Record<string, string>>);
|
|
59
59
|
wrapCopy?: (copy: ReactNode, row: CardRow) => ReactNode;
|
|
60
|
+
rowKey?: (row: CardRow, index: number) => string;
|
|
60
61
|
hostParts?: HostParts;
|
|
61
62
|
children: (cards: ReactNode) => ReactNode;
|
|
62
63
|
};
|
|
63
|
-
export declare function CardTemplateRows({ ownerId, ownerType, slot, Template, rows, items, fields, states, stateLine, actions, pressTitles, previewHover, fallback, copyAttrs, wrapCopy, hostParts, children }: CardTemplateRowsProps): import("react").JSX.Element;
|
|
64
|
+
export declare function CardTemplateRows({ ownerId, ownerType, slot, Template, rows, items, fields, states, stateLine, actions, pressTitles, previewHover, fallback, copyAttrs, wrapCopy, rowKey, hostParts, children }: CardTemplateRowsProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as d,jsx as t,jsxs as I}from"react/jsx-runtime";import{createContext as b,useContext as c,useId as Z}from"react";import{REPEAT_ATTRIBUTE as q,REPEAT_INDEX_ATTRIBUTE as J}from"efficient-easel/draw";import{BOX_LINKED_CLASS as $}from"../../format/lib/content/box-link.js";import{BOX_HIDE_WHEN_ROW_EMPTY as Q,CARD_TEMPLATE_SLOT as ee,cardTemplateLinesBetween as te,rowFilledProps as re,templateBoxIsEmpty as F}from"../../format/lib/content/card-template.js";import{CARD_ACTION_ATTR as ne,CARD_ACTION_CLASS as oe,CARD_ACTION_HOVER_CLASS as se,CARD_ACTION_OFF_CLASS as le,CARD_STATE_LINE_CLASS as ie,CARD_STATE_PICKED_BAR_CLASS as ae,CARD_STATE_PICKED_CLASS as ce,CARD_STATE_PICKED_WASH_CLASS as de,CARD_STATE_UNDER_LINE_CLASS as ue,cardStateAttrs as _e,cardStatePicked as Ce,cardStateValue as me}from"../../format/lib/content/card-state.js";import{usePageRecordRow as Ae}from"./CurrentRecord.js";import{CardCopyCell as pe}from"./InBoxContext.js";import{SECTION_FILL_CLASS as Se}from"../../format/lib/content/section-min-height.js";import{say as fe}from"../../format/lib/editor-words.js";import{HideTaker as j,usePeekViewHide as Te}from"./ViewHideRoot.js";function ke({props:o,editing:r,children:n}){const e=c(A);return!r&&F(o,e?.row)?null:t(d,{children:n})}const f=b(null);function ge({field:o,children:r}){const n=c(f);return t(d,{children:r(n&&n.field===o?n.id:void 0)})}function he(o,r){return o?.find(e=>!!r[e.field]?.trim()&&!e.gates.some(l=>F({[Q]:l},r)))?.field??""}const A=b(null),T=b(null),Ee={label:"text-[length:var(--size-label,12px)]"},Re=`flex min-h-6 items-center border border-dashed border-line px-2 py-1 ${Ee.label} text-fg-dim`;function Be({name:o,label:r,editing:n}){const e=c(T)?.(o),l=Te()!=="";return e!=null&&e!==!1?l?t(j,{className:"contents",children:e}):t(d,{children:e}):n?t(j,{className:Re,children:fe("Shown by the section: {name}",{name:r?.trim()||o})}):null}function $e(){return c(A)}function Fe({type:o,props:r,children:n}){const e=c(A),l=Ae(),u=e?.row??l;return t(d,{children:n(re(o,r,u,e?.ownerType,e?.fields,e?.slot),e,u)})}function Pe({attrs:o,selected:r,hover:n,action:e,titleField:l,children:u}){const _=Z(),{press:h,disabled:a}=e,C=e.label?.trim(),p=!C&&l?{id:`${_}-title`,field:l}:null;return I("div",{...o,id:_,className:n&&!a?`${$} ${se}`:$,children:[t("button",{type:"button",[ne]:"",className:a?le:oe,"aria-pressed":r,...C?{"aria-label":C}:{"aria-labelledby":p?.id??_},...a?{"aria-disabled":!0,tabIndex:-1}:null,onClick:a?void 0:h}),t(f.Provider,{value:p,children:u})]})}function je({ownerId:o,ownerType:r,slot:n=ee,Template:e,rows:l,items:u,fields:_,states:h,stateLine:a,actions:C,pressTitles:p,previewHover:K,fallback:U,copyAttrs:E,wrapCopy:v,rowKey:w,hostParts:L,children:X}){const x=c(A),V=c(f),W=c(T);if(!e||(e.blockCount??0)<=0)return t(d,{children:U});const M=x!==null,O=te(r),H=K??x?.previewHover,y=e.blockCount===1?t(pe,{children:t(e,{className:Se})}):t(e,{}),k=new Set,z=(S,i)=>{if(!w)return i;let s=w(S,i);for(;k.has(s);)s=`${s}#${i}`;return k.add(s),s},G=l.map((S,i)=>{const s=h?.[i],m={row:S,index:i,ownerType:r,slot:n,item:u?.[i],nested:M,..._?{fields:_}:null,...s?{state:s}:null,...O?{linesBetween:O}:null,...H?{previewHover:H}:null},R=me(s)?I(d,{children:[y,a==="under"?t("span",{"aria-hidden":"true",className:ue}):Ce(s)?I("span",{"aria-hidden":"true",className:ce,children:[t("span",{className:ae}),t("span",{className:de})]}):t("span",{"aria-hidden":"true",className:ie})]}):y,P={[q]:`${o}:${n}`,[J]:i,...typeof E=="function"?E(m):E},g=C?.[i],N=_e(s,a),B=g?t(Pe,{attrs:{...P,...N},selected:s?.selected===!0,hover:a!=="under",action:g,titleField:he(p,S),children:R}):V?t("div",{...P,...N,children:t(f.Provider,{value:null,children:R})}):t("div",{...P,...N,children:R}),D=v?v(B,m):B;return t(A.Provider,{value:m,children:L?t(T.Provider,{value:Y=>L(m,Y),children:D}):W?t(T.Provider,{value:null,children:D}):D},z(m,i))});return t(d,{children:X(G)})}export{ge as CardPressTitled,A as CardRowContext,Fe as CardRowDrawn,je as CardTemplateRows,Be as HostPartDrawn,T as HostPartsContext,ke as RowEmptyGate,$e as useCardRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import a from"./SectionEyebrow.js";import{DEFAULT_EYEBROW_BLOCK_LOOK as m}from"../../format/lib/sections/section-eyebrow-look.js";import{alignViewClasses as l}from"../../format/lib/content/block-align.js";import{useDrawsAtEdge as c}from"./InBoxContext.js";const p={left:"",center:"justify-center",right:"justify-end"};function u({text:o,align:e="left",alignTablet:r,alignPhone:i,look:t=m,takesViewHide:s=!1}){const f=c();return n(a,{text:o,look:t,takesViewHide:s,classNameAfter:t==="line"?[p[e],l("justify",e,r,i,{atSectionLine:!f})].filter(Boolean).join(" "):""})}export{p as ALIGN_JUSTIFY,u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as P,jsx as e,jsxs as A}from"react/jsx-runtime";import{useContext as ur,useId as mr,useState as fr}from"react";import hr from"./BoxTabs.js";import{AccordionRowStyleContext as qe,BoxTabPaneContext as Qe,useAccordionRowStyle as Cr,useBoxPaneKind as br,useFirstCopyOpens as Sr,useIsTabPane as wr}from"./BoxTabPaneContext.js";import xr,{ACCORDION_COUNTER_RESET as pr}from"./BoxAccordionRow.js";import{ACCORDION_MARK_SHEET as _r}from"./AccordionMark.js";import{accordionRowStyleOf as vr}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as Rr,boxPhoneOrder as Or}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as _s,InBoxContext as vs,useCellOfStretchedRow as Pr,useFillsCell as Ar}from"./InBoxContext.js";import $r,{InsideSiteColumn as Rs,useInsideSiteGutter as Lr,useSectionRoot as yr}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as Nr}from"./BoxSurfaceContext.js";import Er from"./PictureWash.js";import{BoxCellContext as Os,NoCellBound as kr}from"./BoxCellContext.js";import{boxCellFractions as Ir}from"../lib/content/box-cell-bound.js";import{boundOf as Br}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as gr}from"./PhoneMenuTools.js";import{useCardRow as Tr}from"./CardRowContext.js";import{cardLineBetween as eo,framesItsCards as Fr}from"../../format/lib/content/card-place.js";import{rowLinkText as Hr}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as Dr,MirrorContext as Vr,RowHandContext as Ps,boxPlace as Mr,useHandedMirrorAbove as Wr,useHandedRows as Xr,useMirroredCopy as Gr,useUnderCardBox as jr}from"./MirrorContext.js";import{boxChildrenHand as Kr,isMirroredCopy as Ur,mirrorCardsActs as As,mirrorCardsOf as zr,mirroredBoxClass as Yr,MIRROR_ROW_CLASS as Jr,ownsCard as Zr}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as oo,frameGutterOf as qr}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as Qr,boxSideSpaceOf as et}from"../../format/lib/content/box-side-space.js";import{containerGapProps as $s}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as ot,boxAlignViewClasses as st,boxBlockSpacingClass as nt,boxBlockSpacingViewClasses as rt,boxJustifyViewClasses as tt,boxWrapTabletClass as lt,boxFitContentClass as it,boxAccordionColumnsClass as Ls,boxRowColumnsClass as ct,boxRowTabletColumnsClass as at,boxRowTabletShareClass as dt,boxPhoneCellsShareLine as ut,boxPhoneRowClasses as ce,boxPhoneRowFits as mt,boxShareClasses as K,boxShareVars as ft,boxWrapClass as ht,BOX_GAP_ONLY_CLASS as Ct}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as bt,boxSeparatorSeamClass as St,boxSeparatorStyle as wt,isStripBox as xt}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as pt,DEFAULT_LOOP_DIRECTION as _t,DEFAULT_LOOP_SECONDS as vt,isVerticalLoop as Rt}from"../../format/lib/animation/index.js";import{LoopTrack as Ot}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as $,BOX_OWNS_SIDES_CLASS as Pt,boxDarkenStyle as ys,boxPaintOf as At,boxFillFadeStyle as $t,boxFillViews as Lt,boxPlacementClasses as yt,boxCardProps as Nt,boxIsCard as Ns,boxRowPicture as Et,boxSwatchFill as kt,boxWashViews as It,CARD_NO_LIFT_CLASS as Bt,CARD_SHADOW_CLASS as gt,isBackgroundBox as _e}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as x}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Tt,boxShadowOnAnyView as Ft,boxShadowViewAttrs as Ht}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as Dt,drawsSiteGutter as Vt}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as Mt,boxShapeClasses as Wt}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as Xt}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as Gt,BOX_LINK_ATTR as Es,BOX_LINK_CLASS as ks,BOX_LINKED_CLASS as jt,boxJumpBlocksClass as Kt,boxJumpCss as Ut,boxJumpSlug as zt,boxLinkOf as Yt,siteLinkDraws as Jt}from"../../format/lib/content/box-link.js";import{SiteLink as Zt}from"../lib/site-runtime.js";import{sectionBorderStyle as Is}from"../../format/lib/content/borders.js";import{finiteNumber as ve}from"../../format/lib/finite-number.js";import{padDefaultIn as L,padSideValue as Re,sectionPadAttrs as qt}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as Oe}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as Qt,rowFillInkStyle as el}from"../../format/lib/content/ink.js";import{useThemeLightInk as ol}from"./ThemeLightInkContext.js";import{sizedBackground as so}from"../../format/lib/sized-image.js";import{BOX_REVEAL_CLASS as sl,BOX_REVEAL_CSS as nl,BOX_REVEAL_SHEET as rl,PHOTO_HOST_ATTR as tl,resolveImageTreatment as ll}from"../../format/lib/content/image-treatment.js";import il,{HoverArrowsSlot as cl,HoverMediaArrows as al}from"./HoverMediaLayer.js";import{HOVER_ARROWS_HOST_ATTR as dl,HOVER_ARROWS_HOST_CLASS as ul,HOVER_LAYER_GROUND as ml,cardRowHoverMedia as fl,hoverLayerName as hl}from"../../format/lib/content/hover-media.js";import{BOX_HIGHLIGHT_CLASS as Cl,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as bl,BOX_SHOW_ON_CARD_HOVER as Sl}from"../../format/lib/animation/hover.js";import{BoxRail as wl,BoxRailStop as xl,RAIL_STOPS_CLASS as pl,useTimelineRail as _l}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as vl,sharedColumnsClasses as Rl,sharedColumnsCss as Ol,sharedRowsClasses as Pl,sharedRowsCss as Al}from"../lib/content/box-shared-columns.js";import Bs from"./PhotoHoverSheet.js";import{PICTURE_FRAME_ONLY as $l,PictureHoverMoveSheet as Ll,PictureHoverZoom as yl,pictureHoverMoveOf as Nl}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as El,stackGutterClass as kl,stackLineCss as Il,stackOuterClass as Bl,stackRowClass as gl,storedStackLine as no}from"../lib/content/box-stack-line.js";const ro={"--sf-site-gutter":"0px"},Tl={overflowX:"clip",overflowY:"visible"},Fl={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},gs={desktop:!1,phone:!1},Ts="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",to=u=>u==null||u==="",lo=u=>!to(u)&&Number(u)===0;function Hl({children:u}){return e(P,{children:u(mr())})}function Dl({direction:u,label:Fs,tabShape:Hs,gap:io,gapPhone:Ds,gapTablet:Pe,justify:U,align:y,wrap:ae,share:Vs,sharePhone:z,shareTablet:T,wrapPhone:Ms,orderPhone:Ws,phoneRow:p,columns:m,columnsTablet:F,separator:f,stackBelow:de,blockSpacing:co,bgImage:Xs,bgImagePhone:Gs,rowImage:js,hoverShow:Ks,pictureHover:H,darken:Ae,darkenStyle:ue,darkenTablet:Us,darkenPhone:zs,darkenStyleTablet:Ys,darkenStylePhone:Js,placement:Zs,padV2:ao=!1,border:qs,borderTablet:Qs,borderPhone:en,borderUnits:uo,pad:r={},contained:$e=!0,fillHeight:N=!1,shadow:Le,shadowTablet:mo,shadowPhone:fo,justifyTablet:ho,justifyPhone:on,alignTablet:sn,alignPhone:nn,wrapTablet:Co,blockSpacingTablet:rn,blockSpacingPhone:tn,loop:C,scrollDirection:ye=_t,loopSeconds:ln=vt,loopDelay:cn=pt,editing:E=!1,fillColor:bo,fillColorTablet:an,fillColorPhone:dn,fillFade:un,swatch:mn,line:_,upcoming:fn,link:hn,rowLink:So,highlight:Cn,boxShape:wo,boxShapePhone:bn,boxShapeTablet:Sn,angle:wn,jumpHighlight:xn,anchor:pn,sharedSides:_n=gs,sharedRows:vn=!1,boxId:D,slotCount:Rn,mirrorCards:xo,content:i,rowTitle:Ne,startsOpen:On,rowStyle:Pn,sideSpace:An}){const n=Tr(),k=Nt({[x]:js},n!==null)[x],po=Ns({[x]:k}),c=po?gs:_n,$n=po?!1:vn,_o=Et({[x]:k},n?.row),b=_o??Xs,Ee=_o===null?Gs:void 0,vo=ur(Os),[Ro,Ln]=fr(null),yn=Wr(),Oo=jr()&&!(yn&&n!==null),v=Xr(),h=Zr({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:Oo}),ke=Ks===Sl&&n!==null&&!h&&!(E&&n.previewHover===!0),Po=eo(qs,n,h),Ao=eo(Qs,n,h),$o=eo(en,n,h),Lo=n===null&&!Oo&&v?.ids&&D?v.ids.indexOf(D):-1,me=Lo>=0&&v&&D?Mr(v,D,Lo):-1,S=me>=0?v?.hand??null:h&&v?.copies===!0?v.hand:null,s=S?.row?"row":u,d=S?.row?S.row.share:Vs,Nn=S?.row?S.row.phoneReverse?[...i.blockIds??[]].reverse():void 0:Ws,fe=$n&&!S?.row,V=E?"":So&&n?Hr(n.row,So)??"":Yt(hn),R=N?"":Wt(wo,bn,Sn),En=!N&&Mt(wo)!=="",I=zt(xn,pn),Ie=kt({swatch:mn},n?.row),Y=Ie??At(bo),B=Ie?{className:"",style:{}}:Lt(bo,an,dn),kn=ol(),yo=el(Ie,kn??void 0),In=_e(b)||_e(Ee),Bn=(Y||B.className)&&!In?$t(un):null,No=Y||B.className?{...Y?{backgroundColor:Y}:{},...B.style,...Bn,...yo}:void 0,Eo=_l(),J=_===!0&&s!=="tabs"&&s!=="accordion",t=Ns({bgImage:b,[x]:k}),ko=Xt(wn),Io=t?void 0:No,he=t?null:Cn??null,gn=ko||he?{...Io,...ko,...he}:Io,Ce=gr(),Tn=yr(),Fn=wr(),Bo=br(),go=Cr(),Hn=Sr(),l=s==="accordion",Be=vr(Pn),Z=l&&Be==="numbered",ge=l&&Be==="chevron",Te=Ar(),Dn=Pr(),M=xt(s,f),a=C==="scroll"&&s!=="tabs"&&!l,Vn=Gr(),be=h||me>=0&&S!==null,To=S?S.mirror:xo,Mn=me>=0?me:n?.index,q=h&&Fr(n?.ownerType),Fo=As({direction:s,separator:f,loop:C,line:_,bgImage:b,[x]:k,columns:m,columnsTablet:F,share:d,wrap:ae},be,c.desktop)&&Ur(To,Mn),Wn=As({direction:s,separator:f,loop:C,line:_,bgImage:b,[x]:k,columns:m,columnsTablet:F,share:d,wrap:ae},be,c.desktop)&&zr(To)!==null,W=ct({direction:s,separator:f,loop:C,line:_,columns:m}),g=at({direction:s,separator:f,loop:C,line:_,columnsTablet:F}),Q=dt({direction:s,separator:f,loop:C,line:_,columns:m,columnsTablet:F,share:d,shareTablet:T}),ee=et(An)===Qr,Fe=qr(ee),Ho=J&&no(de)===El,X=s==="row"&&!t&&!M&&!a&&(!J||Ho)&&g===""&&Q===""?no(de):void 0,G=X??(s==="column"&&!t?no(de):void 0),Xn=Lr(),Se=Rl(c,i.blockCount??0,X),Gn=(Se&&(!n||n.index===0)?Ol(c,i.blockCount??0,X):"")+(fe&&(!n||n.index===0)?Al(fe,i.blockCount??0):""),Do=Pl(fe,i.blockCount??0),Vo=g!==""?Number(F)>=2:Q===""||K(T)!=="",Mo=g!==""||Q!=="",Wo=s==="row"&&!M&&!a&&_!==!0,He=Wo&&!c.phone&&!c.desktop?Rr(Or(Nn,i.blockIds??[]),{editing:E}):void 0,Xo=He!==void 0&&!E,jn=W!==""?Number(m)>=2:K(d)!=="",Go=!t&&!l&&!Wn&&!c.desktop&&!c.phone,we=Go&&!a?tt(U,ho,on):"",De=t||be?"":Yr(Vn,s,a?void 0:U,y,we?ho:void 0),Kn=/view-wide:max-view-desktop:justify-/.test(De)?we.split(" ").filter(o=>!o.startsWith("view-wide:max-view-desktop:justify-")).join(" "):we,Un=Go&&s==="row"?st(y,sn,nn):"",zn=!a&&!l&&W===""&&g===""&&!c.desktop?lt(ae,Co):"",jo=[l?"":K(d),s==="row"?it(d):"",W,g,Q,nt(l?"gap":co),bt(s,f),l&&!Z&&!ge?"border-t border-line":"",Kn,Un,zn,l?"":rt(co,rn,tn),l?Ls(m,p,Z||ge):"",Z?pr:""].filter(Boolean).join(" "),Yn=jo?` ${jo}`:"",Ko=["flex",s==="row"?M||a?"flex-row":`flex-row ${ce(p,z,Ms,Co)}`:"flex-col",ht(a||l?!1:ae),t?yt(Zs??"center",s):ot(a||l?void 0:U,l?void 0:y)+(De?` ${De}`:"")].join(" ")+Yn,oe=N||t||R||Te?` ${Oe}`:"",Ve=En?` ${R}`:R?`${oe} ${R}`:oe,Uo=Dn&&s==="column"&&!t&&!a&&K(d)===""&&(typeof U=="string"&&U!=="start"||we!==""),zo=oe||(Uo?` ${Oe}`:""),Me=V?` ${jt}`:"",We=t||Ce||ao?"":" py-6",Jn=X===void 0?"":` ${gl(X)}`,Yo=G===void 0||ee?"":` ${kl(G)}`,Xe=G===void 0?"":` ${Bl(G)}`,Zn=`${oo}${We} ${Fe}${Ve}${Me}${Yo}${Xe}`,qn=Ce?`${Ve}${Me}${Xe}`.trim():`w-full${We}${Ve}${Me}${Xe}`,se=(Z||ge)&&Ls(m,p)===""?$s("Flex",0,"block"):$s("Flex",io,s==="row"?"inline":"block",Ds,M||a?void 0:Pe),Jo=ft(d,T,s==="row"?i.blockCount??0:0),Zo=M?{...se.style,...wt(s,f)}:se.style,Qn=Jo?{...Zo,...Jo}:Zo,Ge=(o="")=>e(i,{className:`${Ko}${Fo?` ${Jr}`:""}${se.className}${zo}${Jn}${o?` ${o}`:""}${J?` ${pl}`:""}${I?` ${Kt(I)}`:""}${Se}${Do}`,style:Qn,minEmptyHeight:120,...He?{cell:He}:null}),qo=Rt(ye)?"":St(s,f),Qo=a?e(Ot,{direction:ye,seconds:ln,delay:cn,editing:E,copy:o=>Ge(o&&qo?`${o} ${qo}`:o)}):Z?A(P,{children:[e("style",{children:_r}),Ge()]}):Ge(),je=s==="tabs"?e(hr,{className:`${Ko}${se.className}${Te&&!N&&!t&&!R?"":oe}`,style:se.style,shape:Hs,children:Qo}):Qo,Ke=l?e(Qe.Provider,{value:"accordion",children:e(qe.Provider,{value:Be,children:je})}):Bo?e(Qe.Provider,{value:!1,children:e(qe.Provider,{value:"plain",children:je})}):je,es=s==="row"&&!t&&(y===void 0||y==="stretch"),er={stretchedRow:es,fillingColumn:s==="column"&&(Te||Uo),columnsRow:W!==""||g!==""||Se!==""||Do!==""||s==="row"&&(Array.isArray(d)||Array.isArray(T))||Xo,...Xo?{phoneCells:!0}:null,...es&&Wo&&(i.blockCount??0)>=2&&jn?{picturesFillRow:!0}:null,...Mo&&!Vo?{fillFrom:"desktop"}:null,...ut(p,z)&&(!Mo||Vo)?{phoneRowFills:!0}:null,...D?{id:D}:null},os=n===null?Kr({direction:s,loop:C,bgImage:b,[x]:k,columns:m,mirrorCards:xo},!1):null,ss=os?e(Ps.Provider,{value:{hand:os,ids:i.blockIds??[],boxes:[]},children:Ke}):v?e(Ps.Provider,{value:null,children:Ke}):Ke,ns=e(vs.Provider,{value:er,children:e(_s.Provider,{value:!1,children:be?e(Vr.Provider,{value:Fo,children:e(Dr.Provider,{value:!h,children:ss})}):ss})}),or=Ne?.blockCount??0,rs=Bo==="accordion"&&!!Ne&&(E||or>0)?e(xr,{startsOpen:On===!0||Hn&&h&&n?.index===0,editing:E,numbered:go==="numbered",chevron:go==="chevron",title:e(vs.Provider,{value:Fl,children:e(_s.Provider,{value:!1,children:e(Qe.Provider,{value:!1,children:e(qe.Provider,{value:"plain",children:e(Ne,{className:`min-w-0 flex-1 ${Ct}`,minEmptyHeight:24})})})})}),children:ns}):ns,Ue=J?e(wl,{row:s==="row",stops:i.blockCount??0,desktopLine:X!==void 0&&Ho,children:rs}):rs,sr=Fs?.trim()||(Fn?"":void 0),nr={values:r,frame:We?24:0},rr=o=>Eo?e(xl,{on:Eo,future:fn===!0,children:o}):o,tr=o=>Jt(V)?e(Zt,{href:V,newTab:"auto",className:ks,"aria-labelledby":o,[Es]:""}):e("a",{href:V,className:ks,"aria-labelledby":o,[Es]:""}),ts=(I?Ut(I):"")+Gn+(G===void 0||n&&n.index!==0?"":Il(G,{gutter:!ee})),ls=ts?e("style",{dangerouslySetInnerHTML:{__html:ts}}):null,ne=Dt({loop:C,direction:s,scrollDirection:ye,bgImage:b,[x]:k}),lr=c.desktop&&Se!==""&&!Y&&!B.className&&!Is(Po,$o,Ao,uo)&&!Ft(Le,mo,fo)&&!V&&!R&&!N&&!I&&!Vt($e&&!ne,Xn)&&lo(io)&&(to(Pe)||lo(Pe))&&ao&&Object.values(r).every(o=>to(o)||lo(o)),ir=o=>({...lr?{[vl]:""}:null,...t?null:{...Tt(Le),...Ht(Le,mo,fo)},...I?{[Gt]:I}:null,...o?{id:o}:null}),is=W!==""?Number(m):0,cr=ce(p,z)===ce(void 0),ar=(s==="column"||s==="row"&&!M&&!a&&(is===1&&cr||is===0&&i.blockCount===1))&&!t&&!J&&!Ce,cs=t&&Tn&&!Ce,xe=!t&&n!==null?ys(Ae,ue):null,as=ke||xe?A(P,{children:[ke?e(Bs,{sheet:nl,name:rl}):null,xe?e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:xe}):null]}):null,ds=[ke?sl:"",xe?"relative isolate":""].filter(Boolean).join(" "),us=o=>as?A(P,{children:[as,o]}):o,ms=(o,O)=>rr(e($r,{contained:$e&&!ne,style:ne?ro:void 0,framedClass:Zn,fillClass:qn,columnClass:`${oo} ${Fe}${zo}${Yo}`,tabLabel:sr,pad:t?void 0:nr,border:Is(Po,$o,Ao,uo),outerAttrs:ir(O),box:!0,edge:ar,outerStyle:gn,outerClass:t?ds||void 0:[B.className,he?Cl:"",he&&yo?bl:"",ds].filter(Boolean).join(" ")||void 0,bleed:cs,siteSide:ee,children:ls||O?A(P,{children:[ls,O?tr(O):null,ne?e(Rs,{children:o}):o]}):ne?e(Rs,{children:o}):o})),ze=o=>V?e(Hl,{children:O=>ms(us(o),O)}):ms(us(o)),fs=o=>vo.bound?e(kr,{children:o}):o;if(!t){const o=y===void 0||y==="stretch",O=(K(d)!==""||W!==""||g!=="")&&!mt(p,z)&&!(Q!==""&&K(T)==="")&&(o||ce(p)!==ce(void 0));if(!(s==="row"?O:s==="column"&&o))return ze(fs(Ue));const ps=Ir({direction:s,separator:f,loop:C,line:_,share:d,shareTablet:T,sharePhone:z,phoneRow:p,columns:m,columnsTablet:F,stackBelow:de,shared:c.desktop||c.phone||fe,count:Rn}),dr={hasWidth:!0,...ps?{bound:Br(ps,vo.bound)}:null};return ze(e(Os.Provider,{value:dr,children:Ue}))}const re=_e(b),te=re?ys(Ae,ue):null,pe=re?It({darken:Ae,darkenStyle:ue,darkenTablet:Us,darkenStyleTablet:Ys,darkenPhone:zs,darkenStylePhone:Js}):{className:"",style:{}},Ye=_e(Ee),hs=re?Ye?{"--sf-box-bg":so(b??""),"--sf-box-bg-p":so(Ee??"")}:{backgroundImage:so(b??""),backgroundSize:"cover",backgroundPosition:"center"}:{},Cs=ll(void 0,void 0,H),j=Cs.className?Cs:null,le=re&&n&&H?.kind==="nextImage"&&H.media?fl(n,H.media):null,w=re?Nl(H,ue)??(le?$l:null):null,bs=H?.media?.cover??"picture",Je=le?e("div",{className:`absolute inset-0 isolate${q?" rounded-[inherit]":""}`,children:e(cl.Provider,{value:Ln,children:e(il,{media:le,name:hl(n?.row),cover:bs,ground:ml[bs],arrowsAbove:!0})})}):null,ie=j!==null||!!w?.zoom,Ss=ie?e("div",{"aria-hidden":!0,className:`absolute inset-0${q?" rounded-[inherit]":""}${Ye?` ${Ts}`:""}${j?` ${j.className}`:""}`,style:{...hs,...j?.style??{}}}):null,Ze=qt({...r,top:ve(r.top)??L($.desktop,r.unit,"desktop"),bottom:ve(r.bottom)??L($.desktop,r.unit,"desktop"),topPhone:ve(r.topPhone)??L($.phone,r.unitPhone,"mobile"),bottomPhone:ve(r.bottomPhone)??L($.phone,r.unitPhone,"mobile"),left:Re(r.left)??L($.side,r.unit,"desktop"),right:Re(r.right)??L($.side,r.unit,"desktop"),leftPhone:Re(r.leftPhone)??L($.sidePhone,r.unitPhone,"mobile"),rightPhone:Re(r.rightPhone)??L($.sidePhone,r.unitPhone,"mobile"),sideSpace:ee?"site":"box"}),ws=e("div",{className:`relative z-[1] ${Pt} ${Ze?.className??""}${N||R?` ${Oe}`:""}`.trimEnd(),style:te?{...Ze?.style,...ro,...Qt}:{...Ze?.style,...ro},children:fs(Ue)}),xs=cs&&$e?e("div",{className:`${oo} ${Fe}${N||R?` ${Oe}`:""}`,children:ws}):ws;return ze(e(P,{children:A("div",{className:`relative isolate overflow-hidden ${gt}${n!==null&&!h?` ${Bt}`:""}${oe}${Ye&&!ie?` ${Ts}`:""}${B.className?` ${B.className}`:""}${w?` ${w.className}`:""}`,style:{...q?Tl:{},...No,...ie?{}:hs,...w?w.style:{}},...j||le?{[tl]:""}:{},children:[e(Ll,{move:w}),ie&&A(P,{children:[e(Bs,{sheet:j?.sheet}),w?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${q?" rounded-[inherit]":""}`,children:A(yl,{move:w,className:"absolute inset-0",children:[Ss,Je]})}):A(P,{children:[Ss,Je]})]}),!ie&&Je,e(Er,{wash:te&&pe.className?{...te,...pe.style}:te,hover:w?.washHover,...q?{className:"rounded-[inherit]"}:{},...pe.className?{restClassName:pe.className}:{}}),te?e(Nr,{children:xs}):xs,le?e("div",{[dl]:"",className:ul,children:Ro?e(al,{state:Ro}):null}):null]})}))}export{Dl as default};
|
|
1
|
+
import{Fragment as P,jsx as e,jsxs as A}from"react/jsx-runtime";import{useContext as ur,useId as mr,useState as fr}from"react";import hr from"./BoxTabs.js";import{AccordionRowStyleContext as qe,BoxTabPaneContext as Qe,useAccordionRowStyle as Cr,useBoxPaneKind as br,useFirstCopyOpens as Sr,useIsTabPane as wr}from"./BoxTabPaneContext.js";import pr,{ACCORDION_COUNTER_RESET as xr}from"./BoxAccordionRow.js";import{ACCORDION_MARK_SHEET as _r}from"./AccordionMark.js";import{EDGE_LINE_ATTRS as vr}from"../../format/lib/content/view-lines.js";import{accordionRowStyleOf as Rr}from"../../format/lib/content/accordion-row-style.js";import{boxPhoneCell as Or,boxPhoneOrder as Pr}from"../../format/lib/content/box-phone-place.js";import{CellFillContext as _s,InBoxContext as vs,useCellOfStretchedRow as Ar,useFillsCell as Lr}from"./InBoxContext.js";import $r,{InsideSiteColumn as Rs,useInsideSiteGutter as yr,useSectionRoot as Nr}from"./SiteGutterFrame.js";import{BoxSurfaceProvider as Er}from"./BoxSurfaceContext.js";import Ir from"./PictureWash.js";import{BoxCellContext as Os,NoCellBound as kr}from"./BoxCellContext.js";import{boxCellFractions as Br}from"../lib/content/box-cell-bound.js";import{boundOf as gr}from"../../format/lib/content/cell-picture-sizes.js";import{useInSiteHeader as Tr}from"./PhoneMenuTools.js";import{useCardRow as Fr}from"./CardRowContext.js";import{cardLineBetween as eo,framesItsCards as Hr}from"../../format/lib/content/card-place.js";import{rowLinkText as Dr}from"../../format/lib/content/card-template.js";import{HandedMirrorContext as Vr,MirrorContext as Mr,RowHandContext as Ps,boxPlace as Gr,useHandedMirrorAbove as Wr,useHandedRows as Xr,useMirroredCopy as jr,useUnderCardBox as Kr}from"./MirrorContext.js";import{boxChildrenHand as Ur,isMirroredCopy as zr,mirrorCardsActs as As,mirrorCardsOf as Yr,mirroredBoxClass as Jr,MIRROR_ROW_CLASS as Zr,ownsCard as qr}from"../../format/lib/content/mirror-cards.js";import{FRAME_BASE as oo,frameGutterOf as Qr}from"./BlockFrame.js";import{BOX_SIDE_SPACE_SITE as et,boxSideSpaceOf as ot}from"../../format/lib/content/box-side-space.js";import{containerGapProps as Ls}from"../../format/lib/content/container-gap.js";import{boxLayoutClasses as st,boxAlignViewClasses as nt,boxBlockSpacingClass as rt,boxBlockSpacingViewClasses as tt,boxJustifyViewClasses as lt,boxWrapTabletClass as it,boxFitContentClass as ct,boxAccordionColumnsClass as $s,boxRowColumnsClass as at,boxRowTabletColumnsClass as dt,boxRowTabletShareClass as ut,boxPhoneCellsShareLine as mt,boxPhoneRowClasses as ce,boxPhoneRowFits as ft,boxShareClasses as K,boxShareVars as ht,boxWrapClass as Ct,BOX_GAP_ONLY_CLASS as bt}from"../../format/lib/content/box-layout.js";import{boxSeparatorClasses as St,boxSeparatorSeamClass as wt,boxSeparatorStyle as pt,isStripBox as xt}from"../../format/lib/content/box-separator.js";import{DEFAULT_LOOP_DELAY as _t,DEFAULT_LOOP_DIRECTION as vt,DEFAULT_LOOP_SECONDS as Rt,isVerticalLoop as Ot}from"../../format/lib/animation/index.js";import{LoopTrack as Pt}from"../lib/animation/LoopTrack.js";import{BOX_CARD_PAD as L,BOX_OWNS_SIDES_CLASS as At,boxDarkenStyle as ys,boxPaintOf as Lt,boxFillFadeStyle as $t,boxFillViews as yt,boxPlacementClasses as Nt,boxCardProps as Et,boxIsCard as Ns,boxRowPicture as It,boxSwatchFill as kt,boxWashViews as Bt,CARD_NO_LIFT_CLASS as gt,CARD_SHADOW_CLASS as Tt,isBackgroundBox as _e}from"../../format/lib/content/box-background.js";import{BOX_ROW_IMAGE_PROP as p}from"../../format/lib/content/box-card-rule.js";import{boxShadowAttrs as Ft,boxShadowOnAnyView as Ht,boxShadowViewAttrs as Dt}from"../../format/lib/content/box-shadow.js";import{boxRunsEdgeToEdge as Vt,drawsSiteGutter as Mt}from"../../format/lib/content/site-gutter.js";import{boxShapeClass as Gt,boxShapeClasses as Wt}from"../../format/lib/content/box-shape.js";import{boxAngleStyle as Xt}from"../../format/lib/content/box-angle.js";import{BOX_JUMP_ATTR as jt,BOX_LINK_ATTR as Es,BOX_LINK_CLASS as Is,BOX_LINKED_CLASS as Kt,boxJumpBlocksClass as Ut,boxJumpCss as zt,boxJumpSlug as Yt,boxLinkOf as Jt,siteLinkDraws as Zt}from"../../format/lib/content/box-link.js";import{SiteLink as qt}from"../lib/site-runtime.js";import{sectionBorderStyle as ks}from"../../format/lib/content/borders.js";import{finiteNumber as ve}from"../../format/lib/finite-number.js";import{padDefaultIn as $,padSideValue as Re,sectionPadAttrs as Qt}from"../lib/content/section-padding.js";import{SECTION_FILL_CLASS as Oe}from"../../format/lib/content/section-min-height.js";import{ON_MEDIA_INK_STYLE as el,rowFillInkStyle as ol}from"../../format/lib/content/ink.js";import{useThemeLightInk as sl}from"./ThemeLightInkContext.js";import{sizedBackground as so}from"../../format/lib/sized-image.js";import{BOX_REVEAL_CLASS as nl,BOX_REVEAL_CSS as rl,BOX_REVEAL_SHEET as tl,PHOTO_HOST_ATTR as ll,resolveImageTreatment as il}from"../../format/lib/content/image-treatment.js";import cl,{HoverArrowsSlot as al,HoverMediaArrows as dl}from"./HoverMediaLayer.js";import{HOVER_ARROWS_HOST_ATTR as ul,HOVER_ARROWS_HOST_CLASS as ml,HOVER_LAYER_GROUND as fl,cardRowHoverMedia as hl,hoverLayerName as Cl}from"../../format/lib/content/hover-media.js";import{BOX_HIGHLIGHT_CLASS as bl,BOX_HIGHLIGHT_OVER_ROW_INK_CLASS as Sl,BOX_SHOW_ON_CARD_HOVER as wl}from"../../format/lib/animation/hover.js";import{BoxRail as pl,BoxRailStop as xl,RAIL_STOPS_CLASS as _l,useTimelineRail as vl}from"./TimelineRail.js";import{SHARED_PLAIN_ATTR as Rl,sharedColumnsClasses as Ol,sharedColumnsCss as Pl,sharedRowsClasses as Al,sharedRowsCss as Ll}from"../lib/content/box-shared-columns.js";import Bs from"./PhotoHoverSheet.js";import{PICTURE_FRAME_ONLY as $l,PictureHoverMoveSheet as yl,PictureHoverZoom as Nl,pictureHoverMoveOf as El}from"./PictureHoverMove.js";import{BOX_DESKTOP_LINE as Il,stackGutterClass as kl,stackLineCss as Bl,stackOuterClass as gl,stackRowClass as Tl,storedStackLine as no}from"../lib/content/box-stack-line.js";const ro={"--sf-site-gutter":"0px"},Fl={overflowX:"clip",overflowY:"visible"},Hl={stretchedRow:!1,fillingColumn:!1,columnsRow:!1},gs={desktop:!1,phone:!1},Ts="bg-cover bg-center bg-[image:var(--sf-box-bg)] max-view-wide:bg-[image:var(--sf-box-bg-p)]",to=u=>u==null||u==="",lo=u=>!to(u)&&Number(u)===0;function Dl({children:u}){return e(P,{children:u(mr())})}function Vl({direction:u,label:Fs,tabShape:Hs,gap:io,gapPhone:Ds,gapTablet:Pe,justify:U,align:y,wrap:ae,share:Vs,sharePhone:z,shareTablet:T,wrapPhone:Ms,orderPhone:Gs,phoneRow:x,columns:m,columnsTablet:F,separator:f,stackBelow:de,blockSpacing:co,bgImage:Ws,bgImagePhone:Xs,rowImage:js,hoverShow:Ks,pictureHover:H,darken:Ae,darkenStyle:ue,darkenTablet:Us,darkenPhone:zs,darkenStyleTablet:Ys,darkenStylePhone:Js,placement:Zs,padV2:ao=!1,border:qs,borderTablet:Qs,borderPhone:en,borderUnits:uo,pad:r={},contained:Le=!0,fillHeight:N=!1,shadow:$e,shadowTablet:mo,shadowPhone:fo,justifyTablet:ho,justifyPhone:on,alignTablet:sn,alignPhone:nn,wrapTablet:Co,blockSpacingTablet:rn,blockSpacingPhone:tn,loop:C,scrollDirection:ye=vt,loopSeconds:ln=Rt,loopDelay:cn=_t,editing:E=!1,fillColor:bo,fillColorTablet:an,fillColorPhone:dn,fillFade:un,swatch:mn,line:_,upcoming:fn,link:hn,rowLink:So,highlight:Cn,boxShape:wo,boxShapePhone:bn,boxShapeTablet:Sn,angle:wn,jumpHighlight:pn,anchor:xn,sharedSides:_n=gs,sharedRows:vn=!1,boxId:D,slotCount:Rn,mirrorCards:po,content:i,rowTitle:Ne,startsOpen:On,rowStyle:Pn,sideSpace:An}){const n=Fr(),I=Et({[p]:js},n!==null)[p],xo=Ns({[p]:I}),c=xo?gs:_n,Ln=xo?!1:vn,_o=It({[p]:I},n?.row),b=_o??Ws,Ee=_o===null?Xs:void 0,vo=ur(Os),[Ro,$n]=fr(null),yn=Wr(),Oo=Kr()&&!(yn&&n!==null),v=Xr(),h=qr({inCopy:n!==null,nestedCopy:n?.nested===!0,underBox:Oo}),Ie=Ks===wl&&n!==null&&!h&&!(E&&n.previewHover===!0),Po=eo(qs,n,h),Ao=eo(Qs,n,h),Lo=eo(en,n,h),$o=n===null&&!Oo&&v?.ids&&D?v.ids.indexOf(D):-1,me=$o>=0&&v&&D?Gr(v,D,$o):-1,S=me>=0?v?.hand??null:h&&v?.copies===!0?v.hand:null,s=S?.row?"row":u,d=S?.row?S.row.share:Vs,Nn=S?.row?S.row.phoneReverse?[...i.blockIds??[]].reverse():void 0:Gs,fe=Ln&&!S?.row,V=E?"":So&&n?Dr(n.row,So)??"":Jt(hn),R=N?"":Wt(wo,bn,Sn),En=!N&&Gt(wo)!=="",k=Yt(pn,xn),ke=kt({swatch:mn},n?.row),Y=ke??Lt(bo),B=ke?{className:"",style:{}}:yt(bo,an,dn),In=sl(),yo=ol(ke,In??void 0),kn=_e(b)||_e(Ee),Bn=(Y||B.className)&&!kn?$t(un):null,No=Y||B.className?{...Y?{backgroundColor:Y}:{},...B.style,...Bn,...yo}:void 0,Eo=vl(),J=_===!0&&s!=="tabs"&&s!=="accordion",t=Ns({bgImage:b,[p]:I}),Io=Xt(wn),ko=t?void 0:No,he=t?null:Cn??null,gn=Io||he?{...ko,...Io,...he}:ko,Ce=Tr(),Tn=Nr(),Fn=wr(),Bo=br(),go=Cr(),Hn=Sr(),l=s==="accordion",Be=Rr(Pn),Z=l&&Be==="numbered",ge=l&&Be==="chevron",Te=Lr(),Dn=Ar(),M=xt(s,f),a=C==="scroll"&&s!=="tabs"&&!l,Vn=jr(),be=h||me>=0&&S!==null,To=S?S.mirror:po,Mn=me>=0?me:n?.index,q=h&&Hr(n?.ownerType),Fo=As({direction:s,separator:f,loop:C,line:_,bgImage:b,[p]:I,columns:m,columnsTablet:F,share:d,wrap:ae},be,c.desktop)&&zr(To,Mn),Gn=As({direction:s,separator:f,loop:C,line:_,bgImage:b,[p]:I,columns:m,columnsTablet:F,share:d,wrap:ae},be,c.desktop)&&Yr(To)!==null,G=at({direction:s,separator:f,loop:C,line:_,columns:m}),g=dt({direction:s,separator:f,loop:C,line:_,columnsTablet:F}),Q=ut({direction:s,separator:f,loop:C,line:_,columns:m,columnsTablet:F,share:d,shareTablet:T}),ee=ot(An)===et,Fe=Qr(ee),Ho=J&&no(de)===Il,W=s==="row"&&!t&&!M&&!a&&(!J||Ho)&&g===""&&Q===""?no(de):void 0,X=W??(s==="column"&&!t?no(de):void 0),Wn=yr(),Se=Ol(c,i.blockCount??0,W),Xn=(Se&&(!n||n.index===0)?Pl(c,i.blockCount??0,W):"")+(fe&&(!n||n.index===0)?Ll(fe,i.blockCount??0):""),Do=Al(fe,i.blockCount??0),Vo=g!==""?Number(F)>=2:Q===""||K(T)!=="",Mo=g!==""||Q!=="",Go=s==="row"&&!M&&!a&&_!==!0,He=Go&&!c.phone&&!c.desktop?Or(Pr(Nn,i.blockIds??[]),{editing:E}):void 0,Wo=He!==void 0&&!E,jn=G!==""?Number(m)>=2:K(d)!=="",Xo=!t&&!l&&!Gn&&!c.desktop&&!c.phone,we=Xo&&!a?lt(U,ho,on):"",De=t||be?"":Jr(Vn,s,a?void 0:U,y,we?ho:void 0),Kn=/view-wide:max-view-desktop:justify-/.test(De)?we.split(" ").filter(o=>!o.startsWith("view-wide:max-view-desktop:justify-")).join(" "):we,Un=Xo&&s==="row"?nt(y,sn,nn):"",zn=!a&&!l&&G===""&&g===""&&!c.desktop?it(ae,Co):"",jo=[l?"":K(d),s==="row"?ct(d):"",G,g,Q,rt(l?"gap":co),St(s,f),l&&!Z&&!ge?"border-t border-line":"",Kn,Un,zn,l?"":tt(co,rn,tn),l?$s(m,x,Z||ge):"",Z?xr:""].filter(Boolean).join(" "),Yn=jo?` ${jo}`:"",Ko=["flex",s==="row"?M||a?"flex-row":`flex-row ${ce(x,z,Ms,Co)}`:"flex-col",Ct(a||l?!1:ae),t?Nt(Zs??"center",s):st(a||l?void 0:U,l?void 0:y)+(De?` ${De}`:"")].join(" ")+Yn,oe=N||t||R||Te?` ${Oe}`:"",Ve=En?` ${R}`:R?`${oe} ${R}`:oe,Uo=Dn&&s==="column"&&!t&&!a&&K(d)===""&&(typeof U=="string"&&U!=="start"||we!==""),zo=oe||(Uo?` ${Oe}`:""),Me=V?` ${Kt}`:"",Ge=t||Ce||ao?"":" py-6",Jn=W===void 0?"":` ${Tl(W)}`,Yo=X===void 0||ee?"":` ${kl(X)}`,We=X===void 0?"":` ${gl(X)}`,Zn=`${oo}${Ge} ${Fe}${Ve}${Me}${Yo}${We}`,qn=Ce?`${Ve}${Me}${We}`.trim():`w-full${Ge}${Ve}${Me}${We}`,se=(Z||ge)&&$s(m,x)===""?Ls("Flex",0,"block"):Ls("Flex",io,s==="row"?"inline":"block",Ds,M||a?void 0:Pe),Jo=ht(d,T,s==="row"?i.blockCount??0:0),Zo=M?{...se.style,...pt(s,f)}:se.style,Qn=Jo?{...Zo,...Jo}:Zo,Xe=(o="")=>e(i,{className:`${Ko}${Fo?` ${Zr}`:""}${se.className}${zo}${Jn}${o?` ${o}`:""}${J?` ${_l}`:""}${k?` ${Ut(k)}`:""}${Se}${Do}`,style:Qn,minEmptyHeight:120,...He?{cell:He}:null}),qo=Ot(ye)?"":wt(s,f),Qo=a?e(Pt,{direction:ye,seconds:ln,delay:cn,editing:E,copy:o=>Xe(o&&qo?`${o} ${qo}`:o)}):Z?A(P,{children:[e("style",{children:_r}),Xe()]}):Xe(),je=s==="tabs"?e(hr,{className:`${Ko}${se.className}${Te&&!N&&!t&&!R?"":oe}`,style:se.style,shape:Hs,children:Qo}):Qo,Ke=l?e(Qe.Provider,{value:"accordion",children:e(qe.Provider,{value:Be,children:je})}):Bo?e(Qe.Provider,{value:!1,children:e(qe.Provider,{value:"plain",children:je})}):je,es=s==="row"&&!t&&(y===void 0||y==="stretch"),er={stretchedRow:es,fillingColumn:s==="column"&&(Te||Uo),columnsRow:G!==""||g!==""||Se!==""||Do!==""||s==="row"&&(Array.isArray(d)||Array.isArray(T))||Wo,...Wo?{phoneCells:!0}:null,...es&&Go&&(i.blockCount??0)>=2&&jn?{picturesFillRow:!0}:null,...Mo&&!Vo?{fillFrom:"desktop"}:null,...mt(x,z)&&(!Mo||Vo)?{phoneRowFills:!0}:null,...D?{id:D}:null},os=n===null?Ur({direction:s,loop:C,bgImage:b,[p]:I,columns:m,mirrorCards:po},!1):null,ss=os?e(Ps.Provider,{value:{hand:os,ids:i.blockIds??[],boxes:[]},children:Ke}):v?e(Ps.Provider,{value:null,children:Ke}):Ke,ns=e(vs.Provider,{value:er,children:e(_s.Provider,{value:!1,children:be?e(Mr.Provider,{value:Fo,children:e(Vr.Provider,{value:!h,children:ss})}):ss})}),or=Ne?.blockCount??0,rs=Bo==="accordion"&&!!Ne&&(E||or>0)?e(pr,{startsOpen:On===!0||Hn&&h&&n?.index===0,editing:E,numbered:go==="numbered",chevron:go==="chevron",title:e(vs.Provider,{value:Hl,children:e(_s.Provider,{value:!1,children:e(Qe.Provider,{value:!1,children:e(qe.Provider,{value:"plain",children:e(Ne,{className:`min-w-0 flex-1 ${bt}`,minEmptyHeight:24})})})})}),children:ns}):ns,Ue=J?e(pl,{row:s==="row",stops:i.blockCount??0,desktopLine:W!==void 0&&Ho,children:rs}):rs,sr=Fs?.trim()||(Fn?"":void 0),nr={values:r,frame:Ge?24:0},rr=o=>Eo?e(xl,{on:Eo,future:fn===!0,children:o}):o,tr=o=>Zt(V)?e(qt,{href:V,newTab:"auto",className:Is,"aria-labelledby":o,[Es]:""}):e("a",{href:V,className:Is,"aria-labelledby":o,[Es]:""}),ts=(k?zt(k):"")+Xn+(X===void 0||n&&n.index!==0?"":Bl(X,{gutter:!ee})),ls=ts?e("style",{dangerouslySetInnerHTML:{__html:ts}}):null,ne=Vt({loop:C,direction:s,scrollDirection:ye,bgImage:b,[p]:I}),lr=c.desktop&&Se!==""&&!Y&&!B.className&&!ks(Po,Lo,Ao,uo)&&!Ht($e,mo,fo)&&!V&&!R&&!N&&!k&&!Mt(Le&&!ne,Wn)&&lo(io)&&(to(Pe)||lo(Pe))&&ao&&Object.values(r).every(o=>to(o)||lo(o)),ir=o=>({...vr,...lr?{[Rl]:""}:null,...t?null:{...Ft($e),...Dt($e,mo,fo)},...k?{[jt]:k}:null,...o?{id:o}:null}),is=G!==""?Number(m):0,cr=ce(x,z)===ce(void 0),ar=(s==="column"||s==="row"&&!M&&!a&&(is===1&&cr||is===0&&i.blockCount===1))&&!t&&!J&&!Ce,cs=t&&Tn&&!Ce,pe=!t&&n!==null?ys(Ae,ue):null,as=Ie||pe?A(P,{children:[Ie?e(Bs,{sheet:rl,name:tl}):null,pe?e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:pe}):null]}):null,ds=[Ie?nl:"",pe?"relative isolate":""].filter(Boolean).join(" "),us=o=>as?A(P,{children:[as,o]}):o,ms=(o,O)=>rr(e($r,{contained:Le&&!ne,style:ne?ro:void 0,framedClass:Zn,fillClass:qn,columnClass:`${oo} ${Fe}${zo}${Yo}`,tabLabel:sr,pad:t?void 0:nr,border:ks(Po,Lo,Ao,uo),outerAttrs:ir(O),box:!0,edge:ar,outerStyle:gn,outerClass:t?ds||void 0:[B.className,he?bl:"",he&&yo?Sl:"",ds].filter(Boolean).join(" ")||void 0,bleed:cs,siteSide:ee,children:ls||O?A(P,{children:[ls,O?tr(O):null,ne?e(Rs,{children:o}):o]}):ne?e(Rs,{children:o}):o})),ze=o=>V?e(Dl,{children:O=>ms(us(o),O)}):ms(us(o)),fs=o=>vo.bound?e(kr,{children:o}):o;if(!t){const o=y===void 0||y==="stretch",O=(K(d)!==""||G!==""||g!=="")&&!ft(x,z)&&!(Q!==""&&K(T)==="")&&(o||ce(x)!==ce(void 0));if(!(s==="row"?O:s==="column"&&o))return ze(fs(Ue));const xs=Br({direction:s,separator:f,loop:C,line:_,share:d,shareTablet:T,sharePhone:z,phoneRow:x,columns:m,columnsTablet:F,stackBelow:de,shared:c.desktop||c.phone||fe,count:Rn}),dr={hasWidth:!0,...xs?{bound:gr(xs,vo.bound)}:null};return ze(e(Os.Provider,{value:dr,children:Ue}))}const re=_e(b),te=re?ys(Ae,ue):null,xe=re?Bt({darken:Ae,darkenStyle:ue,darkenTablet:Us,darkenStyleTablet:Ys,darkenPhone:zs,darkenStylePhone:Js}):{className:"",style:{}},Ye=_e(Ee),hs=re?Ye?{"--sf-box-bg":so(b??""),"--sf-box-bg-p":so(Ee??"")}:{backgroundImage:so(b??""),backgroundSize:"cover",backgroundPosition:"center"}:{},Cs=il(void 0,void 0,H),j=Cs.className?Cs:null,le=re&&n&&H?.kind==="nextImage"&&H.media?hl(n,H.media):null,w=re?El(H,ue)??(le?$l:null):null,bs=H?.media?.cover??"picture",Je=le?e("div",{className:`absolute inset-0 isolate${q?" rounded-[inherit]":""}`,children:e(al.Provider,{value:$n,children:e(cl,{media:le,name:Cl(n?.row),cover:bs,ground:fl[bs],arrowsAbove:!0})})}):null,ie=j!==null||!!w?.zoom,Ss=ie?e("div",{"aria-hidden":!0,className:`absolute inset-0${q?" rounded-[inherit]":""}${Ye?` ${Ts}`:""}${j?` ${j.className}`:""}`,style:{...hs,...j?.style??{}}}):null,Ze=Qt({...r,top:ve(r.top)??$(L.desktop,r.unit,"desktop"),bottom:ve(r.bottom)??$(L.desktop,r.unit,"desktop"),topPhone:ve(r.topPhone)??$(L.phone,r.unitPhone,"mobile"),bottomPhone:ve(r.bottomPhone)??$(L.phone,r.unitPhone,"mobile"),left:Re(r.left)??$(L.side,r.unit,"desktop"),right:Re(r.right)??$(L.side,r.unit,"desktop"),leftPhone:Re(r.leftPhone)??$(L.sidePhone,r.unitPhone,"mobile"),rightPhone:Re(r.rightPhone)??$(L.sidePhone,r.unitPhone,"mobile"),sideSpace:ee?"site":"box"}),ws=e("div",{className:`relative z-[1] ${At} ${Ze?.className??""}${N||R?` ${Oe}`:""}`.trimEnd(),style:te?{...Ze?.style,...ro,...el}:{...Ze?.style,...ro},children:fs(Ue)}),ps=cs&&Le?e("div",{className:`${oo} ${Fe}${N||R?` ${Oe}`:""}`,children:ws}):ws;return ze(e(P,{children:A("div",{className:`relative isolate overflow-hidden ${Tt}${n!==null&&!h?` ${gt}`:""}${oe}${Ye&&!ie?` ${Ts}`:""}${B.className?` ${B.className}`:""}${w?` ${w.className}`:""}`,style:{...q?Fl:{},...No,...ie?{}:hs,...w?w.style:{}},...j||le?{[ll]:""}:{},children:[e(yl,{move:w}),ie&&A(P,{children:[e(Bs,{sheet:j?.sheet}),w?.zoom?e("div",{className:`absolute inset-0 overflow-hidden${q?" rounded-[inherit]":""}`,children:A(Nl,{move:w,className:"absolute inset-0",children:[Ss,Je]})}):A(P,{children:[Ss,Je]})]}),!ie&&Je,e(Ir,{wash:te&&xe.className?{...te,...xe.style}:te,hover:w?.washHover,...q?{className:"rounded-[inherit]"}:{},...xe.className?{restClassName:xe.className}:{}}),te?e(Er,{children:ps}):ps,le?e("div",{[ul]:"",className:ml,children:Ro?e(dl,{state:Ro}):null}):null]})}))}export{Vl as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { type DrawLine } from "../../format/lib/content/view-lines.js";
|
|
2
3
|
export type BoxCell = {
|
|
3
4
|
stretchedRow: boolean;
|
|
4
5
|
fillingColumn: boolean;
|
|
@@ -11,6 +12,11 @@ export type BoxCell = {
|
|
|
11
12
|
};
|
|
12
13
|
export declare const InBoxContext: import("react").Context<BoxCell | null>;
|
|
13
14
|
export declare const useInBox: () => boolean;
|
|
15
|
+
export declare function LineChoice({ line, draw }: {
|
|
16
|
+
line: DrawLine;
|
|
17
|
+
draw: (atEdge: boolean) => ReactNode;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
export declare const useDrawsAtEdge: (line?: DrawLine) => boolean;
|
|
14
20
|
export declare const useBoxCell: () => BoxCell | null;
|
|
15
21
|
export declare const useBoxId: () => string | null;
|
|
16
22
|
export declare const CellFillContext: import("react").Context<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t}from"react/jsx-runtime";import{createContext as a,useContext as
|
|
1
|
+
"use client";import{Fragment as m,jsx as t}from"react/jsx-runtime";import{createContext as a,useContext as r}from"react";import{PictureZoomEnds as h}from"./PictureZoom.js";import{SECTION_FILL_CLASS as v}from"../../format/lib/content/section-min-height.js";import{drawsAtEdge as x}from"../../format/lib/content/view-lines.js";import{useTakeViewHide as w,withViewHide as P}from"./ViewHideRoot.js";const p={stretchedRow:!1,fillingColumn:!1},l=a(null),C=()=>r(l)!==null;function b({line:e,draw:o}){return t(m,{children:o(x(e,C()))})}const B=(e="by-box")=>x(e,C()),_=()=>r(l),H=()=>r(l)?.id??null,c=a(!1);function S(){const e=r(l)?.stretchedRow===!0,o=r(c);return e&&!o}const g=()=>r(c);function F(){const e=r(l),o=S(),n=g();return{fill:n?` ${v}`:"",inner:s=>{const i=o||n?t(c.Provider,{value:!0,children:s}):s;return e?.columnsRow?t(l.Provider,{value:{...e,columnsRow:!1},children:i}):i}}}function N({className:e,style:o,attrs:n,children:s}){const{fill:i,inner:d}=F(),u=w();return u.scope(t("div",{className:P(`${e}${i}`,u.className),...o?{style:o}:{},...n,...u.attrs,children:d(s)}))}const f=a(!1);function $({children:e}){return t(f.Provider,{value:!0,children:t(c.Provider,{value:!0,children:e})})}function j({children:e,ownPictures:o=!1}){const n=r(l),s=r(f),i=r(c),d=s&&i,u=n===null?null:n.id===void 0?p:{...p,id:n.id};return t(l.Provider,{value:u,children:t(f.Provider,{value:!1,children:t(c.Provider,{value:d,children:o?e:t(h,{children:e})})})})}export{$ as CardCopyCell,c as CellFillContext,N as CellWrap,l as InBoxContext,b as LineChoice,j as SlotsStartAfresh,_ as useBoxCell,H as useBoxId,F as useCellLayer,S as useCellOfStretchedRow,B as useDrawsAtEdge,g as useFillsCell,C as useInBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as v}from"react/jsx-runtime";import{withViewHide as at}from"./ViewHideRoot.js";import{useEffect as h,useId as ut,useRef as W,useState as p}from"react";import{NEUTRAL_SITE_NAME as dt}from"../../format/lib/content/site-name.js";import{useRootIsDark as mt}from"efficient-shell/theme";import{isSvgUrl as ft}from"../../format/lib/logo/reverse-svg.js";import{analyzeLogoViaServer as ht}from"../lib/logo/analyze-logo-client.js";import{siteLengthCss as pt}from"../../format/lib/content/css-length.js";import{FOOTER_LOGO_PX as _t,HEADER_LOGO_GRID as Ot,HEADER_LOGO_PX as gt}from"../../format/lib/logo/logo-size.js";import{FOOTER_LOGO_PX as Ht,HEADER_LOGO_PX as Tt,HEADER_LOGO_PX_MAX as Mt,HEADER_LOGO_PX_MIN as Nt,LOGO_BLOCK_PX_MAX as Wt}from"../../format/lib/logo/logo-size.js";const Et=202/22,Rt=.88,Ft=16,It="invert(1)";function Lt({variant:b="header",scrolled:C=!0,src:_,reverse:j=!1,color:O=null,onLightSurface:P,reversedSrc:D,inkIsDark:K,size:U="medium",sizePx:
|
|
1
|
+
"use client";import{jsx as a,jsxs as v}from"react/jsx-runtime";import{withViewHide as at}from"./ViewHideRoot.js";import{useEffect as h,useId as ut,useRef as W,useState as p}from"react";import{NEUTRAL_SITE_NAME as dt}from"../../format/lib/content/site-name.js";import{useRootIsDark as mt}from"efficient-shell/theme";import{isSvgUrl as ft}from"../../format/lib/logo/reverse-svg.js";import{analyzeLogoViaServer as ht}from"../lib/logo/analyze-logo-client.js";import{siteLengthCss as pt}from"../../format/lib/content/css-length.js";import{FOOTER_LOGO_PX as _t,HEADER_LOGO_GRID as Ot,HEADER_LOGO_PX as gt}from"../../format/lib/logo/logo-size.js";import{FOOTER_LOGO_PX as Ht,HEADER_LOGO_PX as Tt,HEADER_LOGO_PX_MAX as Mt,HEADER_LOGO_PX_MIN as Nt,LOGO_BLOCK_PX_MAX as Wt}from"../../format/lib/logo/logo-size.js";const Et=202/22,Rt=.88,Ft=16,It="invert(1)";function Lt({variant:b="header",scrolled:C=!0,src:_,reverse:j=!1,color:O=null,onLightSurface:P,reversedSrc:D,inkIsDark:K,size:U="medium",sizePx:o,sizeUnit:V,wordmark:g,siteName:q=dt,fitToContainer:x=!1,fitWordmarkToContainer:B=!1,fitFloorPx:u,hideClass:Z,hideAttrs:z}){const d=g&&g.trim()?g.trim():q,[J,Q]=p(null),S=W(null),Y=t=>{S.current=t};h(()=>{Q(S.current?.ownerDocument??null)},[]);const tt=!mt({doc:J,whenUnset:!0}),n=_&&_.trim()?_.trim():null,m=!!n&&ft(n),$=P??(tt&&C),l=O&&O.trim()?O.trim():null,f=j&&!l,k=`logo-color-${ut().replace(/[^A-Za-z0-9_-]/g,"")}`,y=f&&m&&n&&D!=null?{reversed:D,inkIsDark:K??null}:null,w=y!==null,[et,E]=p(null);h(()=>{if(!f||!n||!m||w){E(null);return}let t=!1;return E(null),ht(n).then(c=>{t||E(c)}),()=>{t=!0}},[f,n,m,w]);const s=y??et,F=!!s&&s.inkIsDark!==null&&($?!s.inkIsDark:s.inkIsDark),nt=f&&!!n&&!m&&!$,R=F&&s?s.reversed:n,G=R?[R]:[],[X,I]=p(0);h(()=>{I(0)},[n,F]);const lt=b==="footer"?_t:gt[U],i=o&&o>0?o:lt,r=(o&&o>0?pt(o,V,"size",Ot):null)??`${i}px`,ot=Math.round(i*Et),e=X<G.length?G[X]:null,[st,L]=p(R),H=e!==null&&e===st,T=W(null);h(()=>{const t=T.current;if(!t||!t.complete)return;if(t.naturalWidth>0||t.naturalHeight>0){L(e);return}let c=!1;return t.decode().then(()=>!c&&L(e),()=>!c&&I(ct=>ct+1)),()=>{c=!0}},[e]);const M=x||B,N=`calc(100cqi / ${((d.length+1)*Rt).toFixed(2)})`,A=M&&u&&u>0?r===`${i}px`?`${Math.min(u,i)}px`:`min(${u}px, ${r})`:null,rt=M?A===null?`min(${r}, ${N})`:`clamp(${A}, ${N}, ${r})`:r,it=v("span",{className:`font-display font-bold tracking-[0.18em] ${A===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:rt,lineHeight:1,...l?{color:l}:{}},"aria-label":d,children:[d,a("span",{className:"text-accent",style:l?{color:l}:void 0,children:"."})]});return v("span",{ref:Y,className:at("inline-flex items-center",Z??""),...z,children:[!H&&it,l&&e&&a("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:v("filter",{id:k,colorInterpolationFilters:"sRGB",children:[a("feFlood",{style:{floodColor:l}}),a("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),e&&a("img",{ref:T,src:e,alt:d,width:ot,height:i,className:"shrink-0 object-contain",style:{...H?{height:r,width:"auto",...x?{maxWidth:"100cqi"}:{}}:{display:"none"},...nt?{filter:It}:{},...l?{filter:`url(#${k})`}:{}},onLoad:()=>L(e),onError:()=>I(t=>t+1)},e)]})}export{Ht as FOOTER_LOGO_PX,Tt as HEADER_LOGO_PX,Mt as HEADER_LOGO_PX_MAX,Nt as HEADER_LOGO_PX_MIN,Wt as LOGO_BLOCK_PX_MAX,Ft as WORDMARK_FIT_FLOOR_PX,Lt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{HideTaker as W,NO_HIDE as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{HideTaker as W,NO_HIDE as H,useTakeViewHide as j,withViewHide as k}from"./ViewHideRoot.js";import{useContext as y}from"react";import{SiteLink as F}from"../lib/site-runtime.js";import R,{FOOTER_LOGO_PX as A,WORDMARK_FIT_FLOOR_PX as M}from"./Logo.js";import{media as P}from"../lib/media.js";import{BoxSurfaceContext as E}from"./BoxSurfaceContext.js";import{useBoxCellHasWidth as V}from"./BoxCellContext.js";import{useInSiteHeader as z}from"./PhoneMenuTools.js";import{useSiteLogo as G}from"./SiteLogoContext.js";import{useLogoWall as K}from"./LogoWallContext.js";import{LogoWallMark as X}from"./Logos.js";import{MarkZoom as I}from"./PictureZoom.js";import{useCardRow as J}from"./CardRowContext.js";import{alignViewClasses as v,BLOCK_ALIGN_JUSTIFY as U}from"../../format/lib/content/block-align.js";import{useDrawsAtEdge as Y}from"./InBoxContext.js";function Z(s){const o=K(),t=J();if(!o)return e(b,{...s});const m=(s.src??"").trim();return e(W,{className:"text-center",children:e(X,{src:m||void 0,alt:s.alt,look:o.look,logoHeight:o.logoHeight,grayscale:o.grayscale,kind:t?.row.kind})})}function b({src:s,alt:o,href:t,heightPx:m=A,reverse:D=!0,align:i,alignTablet:u,alignPhone:w,color:O=null}){const n=G(),p=(s??"").trim(),l=p?{src:P(p),reversedSrc:null,inkIsDark:null,wordmark:o?.trim()||null}:{src:n.src,reversedSrc:n.reversedSrc,inkIsDark:n.inkIsDark,wordmark:n.wordmark},_=y(E),x=z(),T=V(),r=!x&&T,a=j(),L={atSectionLine:!Y()},h=!!(i||r||v("justify",i,u,w,L)),c=h?H:a,d=t||r?H:c,N=e(R,{variant:"footer",sizePx:m,src:l.src,reverse:D,color:O,reversedSrc:l.reversedSrc,inkIsDark:l.inkIsDark,wordmark:l.wordmark,siteName:n.siteName,fitToContainer:x,fitWordmarkToContainer:r,fitFloorPx:r?M:void 0,..._?.dark?{onLightSurface:!1}:{},...d.className?{hideClass:d.className,hideAttrs:d.attrs}:{}}),C=r?"inline-flex max-w-full overflow-x-clip":"inline-flex",f=r?N:e(I,{children:N}),S=t?e(F,{href:t,newTab:"auto",className:k(C,c.className),...c.attrs,children:f}):r?e("span",{className:k(C,c.className),...c.attrs,children:f}):f,g=r?e(I,{inCell:!0,children:S}):S;if(!h)return a.scope(g);const B=["flex min-w-0",i?U[i]:"",v("justify",i,u,w,L),r?"[container-type:inline-size]":""].filter(Boolean).join(" ");return a.scope(e("div",{className:k(B,a.className),...a.attrs,children:g}))}export{Z as default};
|
|
@@ -48,6 +48,7 @@ type Ctx = {
|
|
|
48
48
|
blockGap: number | null;
|
|
49
49
|
blockGapPhone: number | null;
|
|
50
50
|
siteLengthUnits: SiteLengthUnits;
|
|
51
|
+
setSiteLengthUnits: (patch: SiteLengthUnits) => void;
|
|
51
52
|
setSiteGutter: (v: number | null) => void;
|
|
52
53
|
setSiteGutterPhone: (v: number | null) => void;
|
|
53
54
|
setBlockGap: (v: number | null) => void;
|
|
@@ -65,7 +66,7 @@ type Ctx = {
|
|
|
65
66
|
themeFromDocument: boolean;
|
|
66
67
|
};
|
|
67
68
|
export declare const PreviewHeaderContext: import("react").Context<Ctx>;
|
|
68
|
-
export declare function PreviewHeaderProvider({ children, websiteName, templateChrome, templateName, chromePlaceholder, themeMode, onThemeModeChange, themeSwitchShown, onThemeSwitchShownChange, theme, themeRow, onThemeChange, fonts, onFontsChange, sizes, onSizesChange, cornerRadiusPx, onCornerRadiusPxChange, cardShadow, onCardShadowChange, shadowColor, onShadowColorChange, cardGap, onCardGapChange, hoverEffect, onHoverEffectChange, headingCompression, onHeadingCompressionChange, siteWidth, onSiteWidthChange, siteGutter, siteGutterPhone, blockGap, blockGapPhone, siteLengthUnits, onSiteGutterChange, onSiteGutterPhoneChange, onBlockGapChange, onBlockGapPhoneChange, headingTypography, onHeadingTypographyChange, textStyles, onTextStylesChange, wordStyles, heroBackgroundFollowsWidth, onHeroBackgroundFollowsWidthChange, sectionBackgroundWidth, onSectionBackgroundWidthChange, sectionContentWidth, onSectionContentWidthChange, photographyGrayscale, onPhotographyGrayscaleChange, shareButtonOnPosts, onShareButtonOnPostsChange, themeFromDocument, }: {
|
|
69
|
+
export declare function PreviewHeaderProvider({ children, websiteName, templateChrome, templateName, chromePlaceholder, themeMode, onThemeModeChange, themeSwitchShown, onThemeSwitchShownChange, theme, themeRow, onThemeChange, fonts, onFontsChange, sizes, onSizesChange, cornerRadiusPx, onCornerRadiusPxChange, cardShadow, onCardShadowChange, shadowColor, onShadowColorChange, cardGap, onCardGapChange, hoverEffect, onHoverEffectChange, headingCompression, onHeadingCompressionChange, siteWidth, onSiteWidthChange, siteGutter, siteGutterPhone, blockGap, blockGapPhone, siteLengthUnits, onSiteLengthUnitsChange, onSiteGutterChange, onSiteGutterPhoneChange, onBlockGapChange, onBlockGapPhoneChange, headingTypography, onHeadingTypographyChange, textStyles, onTextStylesChange, wordStyles, heroBackgroundFollowsWidth, onHeroBackgroundFollowsWidthChange, sectionBackgroundWidth, onSectionBackgroundWidthChange, sectionContentWidth, onSectionContentWidthChange, photographyGrayscale, onPhotographyGrayscaleChange, shareButtonOnPosts, onShareButtonOnPostsChange, themeFromDocument, }: {
|
|
69
70
|
children: ReactNode;
|
|
70
71
|
websiteName?: string | null;
|
|
71
72
|
templateChrome?: boolean;
|
|
@@ -99,6 +100,7 @@ export declare function PreviewHeaderProvider({ children, websiteName, templateC
|
|
|
99
100
|
blockGap?: number | null;
|
|
100
101
|
blockGapPhone?: number | null;
|
|
101
102
|
siteLengthUnits?: SiteLengthUnits;
|
|
103
|
+
onSiteLengthUnitsChange?: (patch: SiteLengthUnits) => void;
|
|
102
104
|
onSiteGutterChange?: (v: number | null) => void;
|
|
103
105
|
siteGutterPhone?: number | null;
|
|
104
106
|
onSiteGutterPhoneChange?: (v: number | null) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as B}from"react/jsx-runtime";import{createContext as Jt,useCallback as e,useContext as Kt,useMemo as Qt,useState as Xt}from"react";import{EditorSiteLogoContext as $t}from"./SiteLogoContext.js";import{IDENTITY_CARD_GAP as M,DEFAULT_HEADING_COMPRESSION as N,DEFAULT_HEADING_TYPOGRAPHY as g,DEFAULT_SIZES as Y,DEFAULT_SWITCH_SHOWN as b,DEFAULT_THEME_MODE as j,DEFAULT_THEME_VALUE as z}from"../../format/lib/theme.js";import{DEFAULT_FONTS as V}from"../../format/lib/fonts.js";const Z={},q=Jt({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:j,setThemeMode:()=>{},themeSwitchShown:b,setThemeSwitchShown:()=>{},theme:z,themeRow:"none",setTheme:()=>{},fonts:V,setFonts:()=>{},sizes:Y,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:M,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:N,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,siteGutterPhone:null,blockGap:null,blockGapPhone:null,siteLengthUnits:Z,setSiteLengthUnits:()=>{},setSiteGutter:()=>{},setSiteGutterPhone:()=>{},setBlockGap:()=>{},setBlockGapPhone:()=>{},headingTypography:g,setHeadingTypography:()=>{},textStyles:null,setTextStyles:()=>{},wordStyles:null,heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},sectionBackgroundWidth:null,setSectionBackgroundWidth:()=>{},sectionContentWidth:null,setSectionContentWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},shareButtonOnPosts:null,setShareButtonOnPosts:()=>{},themeFromDocument:!1});function ne({children:o,websiteName:s=null,templateChrome:l=!1,templateName:r=null,chromePlaceholder:u=!1,themeMode:J=j,onThemeModeChange:i,themeSwitchShown:K=b,onThemeSwitchShownChange:c,theme:Q=z,themeRow:X="none",onThemeChange:d,fonts:$=V,onFontsChange:S,sizes:C=Y,onSizesChange:a,cornerRadiusPx:tt=null,onCornerRadiusPxChange:p,cardShadow:et=null,onCardShadowChange:h,shadowColor:st=null,onShadowColorChange:m,cardGap:ot=M,onCardGapChange:E,hoverEffect:lt=null,onHoverEffectChange:T,headingCompression:nt=N,onHeadingCompressionChange:f,siteWidth:rt=null,onSiteWidthChange:P,siteGutter:ut=null,siteGutterPhone:it=null,blockGap:ct=null,blockGapPhone:dt=null,siteLengthUnits:St=Z,onSiteLengthUnitsChange:_,onSiteGutterChange:x,onSiteGutterPhoneChange:G,onBlockGapChange:w,onBlockGapPhoneChange:D,headingTypography:at=g,onHeadingTypographyChange:F,textStyles:pt=null,onTextStylesChange:H,wordStyles:ht=null,heroBackgroundFollowsWidth:mt=null,onHeroBackgroundFollowsWidthChange:k,sectionBackgroundWidth:Et=null,onSectionBackgroundWidthChange:A,sectionContentWidth:Tt=null,onSectionContentWidthChange:I,photographyGrayscale:ft=null,onPhotographyGrayscaleChange:L,shareButtonOnPosts:Pt=null,onShareButtonOnPostsChange:U,themeFromDocument:_t=!1}){const[n,v]=Xt(null),xt=e(t=>v(qt=>qt??t),[]),Gt=e(t=>i?.(t),[i]),wt=e(t=>c?.(t),[c]),Dt=e(t=>d?.(t),[d]),Ft=e(t=>S?.(t),[S]),Ht=e(t=>a?.(t),[a]),kt=e(t=>P?.(t),[P]),At=e(t=>x?.(t),[x]),It=e(t=>G?.(t),[G]),Lt=e(t=>w?.(t),[w]),Ut=e(t=>D?.(t),[D]),vt=e(t=>_?.(t),[_]),Wt=e(t=>k?.(t),[k]),yt=e(t=>A?.(t),[A]),Ot=e(t=>I?.(t),[I]),Rt=e(t=>L?.(t),[L]),Bt=e(t=>U?.(t),[U]),Mt=e(t=>p?.(t),[p]),Nt=e(t=>h?.(t),[h]),gt=e(t=>m?.(t),[m]),Yt=e(t=>E?.(t),[E]),bt=e(t=>T?.(t),[T]),jt=e(t=>f?.(t),[f]),zt=e(t=>F?.(t),[F]),Vt=e(t=>H?.(t),[H]),W=n?.logoUrl,y=n?.logoReversed,O=n?.logoInkIsDark,R=n!==null,Zt=Qt(()=>({logo:R?{logoUrl:W,logoReversed:y,logoInkIsDark:O}:null,placeholder:l||u,wordmark:l?r:s}),[R,W,y,O,l,u,r,s]);return B($t.Provider,{value:Zt,children:B(q.Provider,{value:{settings:n,setSettings:v,primeSettings:xt,websiteName:s,templateChrome:l,templateName:r,chromePlaceholder:u,themeMode:J,setThemeMode:Gt,themeSwitchShown:K,setThemeSwitchShown:wt,theme:Q,themeRow:X,setTheme:Dt,fonts:$,setFonts:Ft,sizes:C,setSizes:Ht,cornerRadiusPx:tt,setCornerRadiusPx:Mt,cardShadow:et,setCardShadow:Nt,shadowColor:st,setShadowColor:gt,cardGap:ot,setCardGap:Yt,hoverEffect:lt,setHoverEffect:bt,headingCompression:nt,setHeadingCompression:jt,siteWidth:rt,setSiteWidth:kt,siteGutter:ut,siteGutterPhone:it,blockGap:ct,blockGapPhone:dt,siteLengthUnits:St,setSiteLengthUnits:vt,setSiteGutter:At,setSiteGutterPhone:It,setBlockGap:Lt,setBlockGapPhone:Ut,headingTypography:at,setHeadingTypography:zt,textStyles:pt,setTextStyles:Vt,wordStyles:ht,heroBackgroundFollowsWidth:mt,setHeroBackgroundFollowsWidth:Wt,sectionBackgroundWidth:Et,setSectionBackgroundWidth:yt,sectionContentWidth:Tt,setSectionContentWidth:Ot,photographyGrayscale:ft,setPhotographyGrayscale:Rt,shareButtonOnPosts:Pt,setShareButtonOnPosts:Bt,themeFromDocument:_t},children:o})})}const Ct=()=>Kt(q);function re(o,s,l){return o?s===l?"read":"loading":"none"}function ue(o,s){return{value:o,readFor:s}}function ie(o,s,l){return{value:s,readFor:o.readFor===l?l:null}}function ce(){const{sectionContentWidth:o,themeFromDocument:s}=Ct();return s?null:o}export{q as PreviewHeaderContext,ne as PreviewHeaderProvider,re as siteThemeRow,ie as themeEdited,ue as themeSeeded,Ct as usePreviewHeader,ce as useSiteContentWidth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as E,jsx as f,jsxs as O}from"react/jsx-runtime";import{createContext as P,useContext as m,useEffect as A,useId as k,useMemo as F,useRef as M}from"react";import{armEntrance as j}from"efficient-shell/format";import{blockDrawsTextStyle as D,partRuleForKind as y,partRuleForText as K,partStyleCss as L,publishedPartStyles as N}from"../lib/document/part-styles.js";import{useViewWidth as I}from"./SectionAnimation.js";import{useDrawsAtEdge as $}from"./InBoxContext.js";import{styleKeyForPart as B}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as H,PART_LIFT_ATTR as b,drawPartEntrance as J,drawPartScroll as W,ensurePartLiftSheet as Y,firstOnPage as R,partBoxOf as V,partMotionDrawn as q,partMoves as z}from"../lib/animation/part-motion.js";const S=P(null),T=P(null),_=P(null);function le({needles:e,styles:t,motions:r=H,type:o,atEdge:n=!1,children:i}){const u=k(),d=$(n?"edge":"by-box"),x=JSON.stringify([u,e,t,r,o]),c=F(()=>{const p=Object.keys(r).filter(l=>z(r[l]));return N(e,t,u,l=>B(o,l),l=>D(o,l),l=>p.includes(l)?q(r[l]):null,p)},[x]);if(!c)return f(E,{children:i});const s=L(c,{inBox:d});return O(E,{children:[s&&f("style",{href:`${G}${u}-${Q(s)}`,precedence:w,dangerouslySetInnerHTML:{__html:s.replace(/</g,"\\3c ")}}),f(S.Provider,{value:c,children:i})]})}const g=new WeakMap;function v(e,t){const r=R(t.filter(n=>n.arm)),o=t.some(n=>n.entering)?void 0:R(t.filter(n=>n.scroll));for(const n of t)n!==r&&n.undo&&(n.undo(),n.undo=void 0),n!==o&&n.undoScroll&&(n.undoScroll(),n.undoScroll=void 0);r?.arm&&!r.undo&&(r.undo=r.arm()),o?.scroll&&!o.undoScroll&&(o.undoScroll=o.scroll()),t.some(n=>n.lift)?(Y(e.ownerDocument),e.setAttribute(b,"")):e.removeAttribute(b)}function se(e){const t=M(null),r=e?.motion?.entrance??null,o=e?.motion?.scroll??null,n=e?.motion?.hover==="lift",i=I(t,r!==null||o!==null),u=r?r[i]:null,d=o&&o[i].effect!=="none"?o[i]:null,x=JSON.stringify([u,d]);return A(()=>{const c=t.current,s=V(c?.parentElement??null);if(!r&&!o&&!n||!c||!s)return;const p=u?()=>{const h=J(s,u),C=j(s);return()=>{C?.(),h()}}:null,l=g.get(s)??[];g.set(s,l);const a={element:c,arm:p,entering:u!==null&&u.kind!=="none",scroll:d?()=>W(s,d):null,lift:n};return l.push(a),v(s,l),()=>{const h=l.indexOf(a);h<0||(l.splice(h,1),a.undo?.(),a.undo=void 0,a.undoScroll?.(),a.undoScroll=void 0,v(s,l),l.length||g.delete(s))}},[x,n]),t}const w="sf-part-styles",G=`${w}-`;function Q(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function ue(e){const t=m(S),r=m(T),o=K(t,e);return o&&o.stamp!==r?o:null}function ce(e){return y(m(S),e)}function ie({stamp:e,children:t}){return f(T.Provider,{value:e,children:t})}function ae({children:e}){const t=m(S);return f(_.Provider,{value:t,children:e})}function de(e){return y(m(_),e)}export{ie as ClaimedStamp,w as PART_STYLES_PRECEDENCE,le as PublishedPartStyles,ae as SharedPartKinds,se as usePartEntrance,ce as usePublishedPartKindRule,ue as usePublishedPartRule,de as usePublishedSharedKindRule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as M}from"react/jsx-runtime";import{NO_HIDE as S,useTakeViewHide as
|
|
1
|
+
"use client";import{jsx as M}from"react/jsx-runtime";import{NO_HIDE as S,useTakeViewHide as b,withViewHide as A}from"./ViewHideRoot.js";import{useEffect as E,useRef as g,useState as L}from"react";import{armEntrance as R,entranceAttrs as V,playEntrance as v}from"efficient-shell/format";import{useCellLayer as J,useDrawsAtEdge as _}from"./InBoxContext.js";import{ENTRANCE_WRAPPER_CLASS as x}from"../lib/animation/entrance.js";import{viewMediaOf as N}from"../lib/document/part-styles.js";function K({views:e,editing:t,boxClass:n,boxAttrs:s,boxStyle:a,takesViewHide:f=!1,atEdge:u=!1,children:d}){const o=g(null),i=J(),c=b(),r=f?c:S,p=$(o,!0,u),{attrs:k,style:h}=V(e[p]),y=g(m.seed(e)),O=JSON.stringify(e);return E(()=>{const l=o.current;if(l){if(t){const w=m.next(y.current,e,p);y.current=w.seen,w.play&&v(l);return}return R(l)}},[O,p,t]),r.scope(M("div",{ref:o,className:A(`${x}${i.fill}${n?` ${n}`:""}`,r.className),...s,...r.attrs,...k,...Object.keys(h).length||a?{style:{...a,...h}}:{},children:i.inner(d)}))}const m={seed(e){return{desktop:JSON.stringify(e.desktop),tablet:JSON.stringify(e.tablet),phone:JSON.stringify(e.phone)}},next(e,t,n){const s=m.seed(t);return{play:s[n]!==e[n],seen:s}}};function q(e){return N(e).phone}function $(e,t=!0,n=!1){return j(e,t,n)??"desktop"}function j(e,t=!0,n=!1){const[s,a]=L(void 0),f=_(n?"edge":"by-box"),{phone:u,tablet:d}=N(f);return E(()=>{if(!t)return;const o=e.current?.ownerDocument?.defaultView??(typeof window>"u"?null:window);if(!o?.matchMedia){a("desktop");return}const i=o.matchMedia(u),c=o.matchMedia(d),r=()=>a(i.matches?"phone":c.matches?"tablet":"desktop");return r(),i.addEventListener("change",r),c.addEventListener("change",r),()=>{i.removeEventListener("change",r),c.removeEventListener("change",r)}},[e,t,u,d]),s}export{x as ENTRANCE_WRAPPER_CLASS,K as SectionAnimation,m as entranceReplay,q as phoneMediaOf,$ as useViewWidth,j as useViewWidthRead};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{alignViewAnswers as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{alignViewAnswers as H,alignViewClasses as V,BLOCK_ALIGN_TEXT as x}from"../../format/lib/content/block-align.js";import{SiteLink as T}from"../lib/site-runtime.js";import K from"./Btn.js";import{resolveImageTreatment as Z}from"../../format/lib/content/image-treatment.js";import $ from"./Placeholder.js";import{useSitePhotography as D}from"./SitePhotographyContext.js";import R from"./SectionEyebrow.js";import{renderGold as s,renderHeadline as Y,splitParagraphs as q}from"./goldPhrases.js";import{ON_MEDIA_INK_STYLE as J}from"../../format/lib/content/ink.js";import{scrim as Q}from"../../format/lib/content/scrim.js";import{SECTION_FILL_CLASS as W}from"../../format/lib/content/section-min-height.js";import{HALF_SIZES as E}from"../../format/lib/sized-image.js";const a={headingMediumUpTo800:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",labelUpTo800:"max-view-wide:text-[length:var(--size-label,12px)]",headingMedium:"text-[length:min(var(--size-headingMedium,56px),var(--sf-heading-max,9999px))]",body:"text-[length:var(--size-body,16px)]",label:"text-[length:var(--size-label,13px)]"},z={words:{left:"min-[961px]:pl-[max(60px,calc(100%_-_var(--sf-content-cap,200%)/2_+_60px))]",right:"min-[961px]:pr-[max(60px,calc(100%_-_var(--sf-content-cap,200%)/2_+_60px))]"},buttons:{left:"min-[961px]:pl-[max(var(--sf-site-gutter,40px),calc(100%_-_var(--sf-content-cap,200%)/2_+_var(--sf-site-gutter,40px)))]",right:"min-[961px]:pr-[max(var(--sf-site-gutter,40px),calc(100%_-_var(--sf-content-cap,200%)/2_+_var(--sf-site-gutter,40px)))]"}};function B({imageLabel:f,imageSrc:v,imageTint:h=.4,imageObjectPosition:S,eyebrow:b,title:g,body:w,cta:c,reverse:n=!1,uppercase:I=!1,textAlign:m="left",textAlignTablet:u,textAlignPhone:_,textBgSrc:p,textBgLabel:C,textBgTint:y=.6,textBgObjectPosition:M,featureBar:r,imageButton:l,grayscale:O,pictureHover:P,fillHeight:U=!1}){const N=Z(O,D(),P),j={left:{items:"",text:x.left,cta:"self-start"},center:{items:"items-center",text:x.center,cta:"self-center"},right:{items:"items-end",text:x.right,cta:"self-end"}},d=j[m]??j.left,k={left:{items:"view-tablet:max-view-desktop:items-stretch",cta:"view-tablet:max-view-desktop:self-start"},center:{items:"view-tablet:max-view-desktop:items-center",cta:"view-tablet:max-view-desktop:self-center"},right:{items:"view-tablet:max-view-desktop:items-end",cta:"view-tablet:max-view-desktop:self-end"}},L={left:{items:"max-view-tablet:items-stretch",cta:"max-view-tablet:self-start"},center:{items:"max-view-tablet:items-center",cta:"max-view-tablet:self-center"},right:{items:"max-view-tablet:items-end",cta:"max-view-tablet:self-end"}},t=H(m,u,_),o={text:V("text",m,u,_,{atSectionLine:!0}),items:[t.tablet&&k[t.tablet].items,t.phone&&L[t.phone].items].filter(Boolean).join(" "),cta:[t.tablet&&k[t.tablet].cta,t.phone&&L[t.phone].cta].filter(Boolean).join(" ")},A=n?"right":"left",F=n?"left":"right";return e("section",{className:"relative z-[2] bg-bg p-0",children:i("div",{className:["grid min-h-[72vh] grid-cols-2 border-t border-b border-line","max-[960px]:grid-cols-1","max-[960px]:min-h-0",n?"min-[961px]:[direction:rtl]":"",...U?[W]:[]].join(" "),children:[i("div",{className:"sf-card relative flex items-center justify-center overflow-hidden bg-surface [direction:ltr] max-[960px]:aspect-[4/3] max-[960px]:order-2",style:n?{borderLeft:"1px solid var(--site-line)"}:{borderRight:"1px solid var(--site-line)"},children:[e($,{label:f,src:v,objectPosition:S,treatment:N,sizes:E}),v&&h>0&&e("div",{className:"absolute inset-0",style:{background:`rgba(0,0,0,${h})`}}),(r||l)&&i("div",{className:`pointer-events-none absolute inset-0 z-[3] flex flex-col items-center justify-center gap-4 px-[var(--sf-site-gutter,40px)] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] ${z.buttons[A]}`,children:[r&&i(T,{newTab:"auto",href:r.href,className:`pointer-events-auto inline-flex items-center justify-center gap-3 border px-7 py-4 font-mono ${a.label} uppercase tracking-[0.18em] backdrop-blur-sm transition-colors max-view-wide:gap-2 max-view-wide:px-5 max-view-wide:py-3 ${a.labelUpTo800}`,style:{borderColor:"color-mix(in srgb, var(--overlay-fg) 30%, transparent)",color:"color-mix(in srgb, var(--overlay-fg) 85%, transparent)",background:Q(.45)},children:[e("span",{children:s(r.wheel)}),e("span",{"aria-hidden":!0,style:{opacity:.55},children:"·"}),e("span",{children:s(r.category)}),e("span",{"aria-hidden":!0,children:"→"}),e("span",{children:s(r.cta??"Shop now")})]}),l&&i(T,{newTab:"auto",href:l.href,className:`pointer-events-auto inline-flex items-center justify-center gap-2 border px-7 py-4 font-mono ${a.label} uppercase tracking-[0.18em] backdrop-blur-sm transition-colors hover:bg-[color-mix(in_srgb,var(--overlay-fg)_10%,transparent)] max-view-wide:gap-2 max-view-wide:px-5 max-view-wide:py-3 ${a.labelUpTo800}`,style:{borderColor:"color-mix(in srgb, var(--overlay-fg) 50%, transparent)",color:"color-mix(in srgb, var(--overlay-fg) 95%, transparent)",background:"transparent"},children:[e("span",{children:s(l.text??"Learn more")}),e("span",{"aria-hidden":!0,children:"→"})]})]})]}),i("div",{className:"relative overflow-hidden [direction:ltr] max-[960px]:order-1",children:[p&&i("div",{className:"absolute inset-0","aria-hidden":!0,children:[e($,{label:C??f,src:p,objectPosition:M,treatment:N,sizes:E}),y>0&&e("div",{className:"absolute inset-0",style:{background:`rgba(0,0,0,${y})`}})]}),e("div",{className:`relative z-[2] flex h-full min-h-full flex-col px-[60px] py-[100px] max-[960px]:px-6 max-[960px]:py-[60px] ${z.words[F]}`,style:p?J:void 0,children:i("div",{className:["flex flex-1 flex-col justify-center gap-6",d.items,d.text,o.items,o.text].filter(Boolean).join(" "),children:[b&&e(R,{text:b,size:14}),g&&e("h2",{className:[`font-heading2 ${a.headingMedium} font-normal leading-[1.05] tracking-[-0.03em]`,`${a.headingMediumUpTo800} max-view-wide:leading-[1]`,I?"uppercase":""].join(" "),children:Y(g,!1)}),w&&q(w).map((X,G)=>e("p",{className:[`max-w-[520px] ${a.body} leading-[1.7]`,"text-fg-dim"].join(" "),children:s(X)},G)),c.text&&e("div",{className:`mt-2 ${d.cta}${o.cta?` ${o.cta}`:""}`,children:e(K,{href:c.href,variant:"primary",children:s(c.text)})})]})})]})]})})}export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
1
|
+
import{jsx as r,jsxs as B}from"react/jsx-runtime";import E from"./BlockFrame.js";import{renderGold as g,renderHeadline as G,renderPlain as _,splitParagraphs as H}from"./goldPhrases.js";import{headingLook as M}from"./Heading.js";import{alignViewClasses as U,BLOCK_ALIGN_PLACE as y}from"../../format/lib/content/block-align.js";import{useDrawsAtEdge as X}from"./InBoxContext.js";import{textTagOf as D}from"../../format/lib/content/text-tag.js";import{KICKER_NUMBER_ATTR as F,kickerLead as V}from"../lib/content/page-contents.js";import{isTextStyleId as W}from"../lib/document/part-styles.js";import{faceClassOf as w}from"../../format/lib/text-style-face.js";import{useMirroredCopy as Z}from"./MirrorContext.js";import{mirroredTextClasses as A}from"../../format/lib/content/mirror-cards.js";import q from"./PartStyledKind.js";import{SiteLink as J}from"../lib/site-runtime.js";import{markupHoldsLink as Q}from"../../format/lib/markup.js";const p={bodyUpTo800:"max-view-wide:text-[length:var(--size-body,14px)]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,17px)]",label:"text-[length:var(--size-label,13px)]"},Y="underline underline-offset-2",n=e=>e?` ${e}`:"";function ee(e,o,l,a){const c=U("place",e,o,l,{atSectionLine:!a});return c?` ${c}`:""}const te={left:`text-left${n(y.left)}`,center:`text-left${n(y.center)}`,right:`text-left${n(y.right)}`},re=`max-w-[380px] ${p.bodySmall} leading-[1.5] opacity-80 ${p.bodyUpTo800}`,se={default:"text-fg",dim:"text-fg-dim"};function ne(e){return String(Math.min(Number(e.slice(8)),6))}function ae({text:e,labelId:o,number:l,align:a,alignTablet:c,alignPhone:O,tone:$,contained:T,hero:j=!1,pad:f,tag:z,textStyle:N,ownWidth:I=!1,partAlign:b,onLine:m=!1,partKey:L,partDeclare:K=!1,plain:u=!1,href:S}){const P=t=>L?r(q,{kind:L,declare:K,children:t}):t,k=S&&!Q(e)?S:void 0,h=t=>P(k?r(J,{href:k,className:Y,newTab:"auto",children:t}):t),v=Z(),R=X();if(j)return r("p",{className:re,children:g(e)});const d=l?r("span",{[F]:"",children:V(l)}):void 0,i=W(N)?N:void 0,C=`${i?`${w({id:i})} `:""}${I?"":"max-w-[680px] "}whitespace-pre-line ${i==="body-5"?p.label:p.bodyLarge} leading-[1.7]${n(a?te[a]:"")}${ee(a,c,O,R)}${n($?se[$]:"")}${n(A(v,a,b))}`,x=D(z);if(i?.startsWith("heading-")){const t=ne(i),s=M(t,w({id:i}));return r(E,{contained:T,className:m?"":"py-6",pad:f?{values:f,frame:m?0:24}:void 0,children:B(x,{id:o,className:`${s.className}${n(A(v,void 0,b))}`,style:s.style,children:[d,h(G(e.trim(),!1,u))]})})}return r(E,{contained:T,className:m?"":"py-4",pad:f?{values:f,frame:m?0:16}:void 0,children:x==="p"?H(e).map((t,s)=>r("p",{id:s===0?o:void 0,className:C,children:h(u?_(t,s===0?d:void 0):g(t,!1,s===0?d:void 0))},s)):r(x,{id:o,className:C,children:h(u?_(e.trim(),d):g(e.trim(),!1,d))})})}export{ae as default,ne as headingLevelOfStyle};
|