efficient-web-builder 42.0.0 → 44.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +212 -0
- package/dist/editor/components/AnchorField.js +1 -1
- package/dist/editor/components/CanvasPartsBridge.d.ts +1 -0
- package/dist/editor/components/CanvasPartsBridge.js +1 -1
- package/dist/editor/components/DuplicatePageDialog.js +1 -1
- package/dist/editor/components/MediaUploadField.d.ts +3 -1
- package/dist/editor/components/MediaUploadField.js +1 -1
- package/dist/editor/components/PagesPanel.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/PreviewThemeFrame.d.ts +1 -1
- package/dist/editor/components/PreviewThemeFrame.js +3 -19
- package/dist/editor/components/SectionEditor.d.ts +5 -1
- package/dist/editor/components/SectionEditor.js +1 -1
- package/dist/editor/components/SectionIcon.js +1 -1
- package/dist/editor/components/SectionTextPartBridge.js +1 -1
- package/dist/editor/components/SectionThumbnail.js +1 -1
- package/dist/editor/components/SiteFields.d.ts +2 -1
- package/dist/editor/components/SiteFields.js +1 -1
- package/dist/editor/components/StandaloneSectionEditor.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/StylesPanel.d.ts +3 -1
- package/dist/editor/components/StylesPanel.js +1 -1
- package/dist/editor/components/WebsiteScreenParts.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.d.ts +6 -1
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +16 -77
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- package/dist/editor/components/useLocationsTree.js +1 -1
- package/dist/editor/components/useSectionToBoxPass.js +1 -1
- package/dist/editor/components/useSocialSettings.d.ts +2 -2
- package/dist/editor/lib/document/ColourControl.d.ts +7 -2
- package/dist/editor/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/MarkupToolbar.d.ts +6 -2
- package/dist/editor/lib/document/MarkupToolbar.js +1 -1
- package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/canvas-typing.js +1 -1
- package/dist/editor/lib/document/consent-words-field.d.ts +6 -0
- package/dist/editor/lib/document/consent-words-field.js +1 -0
- package/dist/editor/lib/document/controls.d.ts +14 -2
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/footer-blocks.js +1 -1
- package/dist/editor/lib/document/locked-blocks.d.ts +3 -0
- package/dist/editor/lib/document/locked-blocks.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/document/page-root-fields.d.ts +1 -0
- package/dist/editor/lib/document/page-root-fields.js +1 -1
- package/dist/editor/lib/document/part-anchors.d.ts +7 -0
- package/dist/editor/lib/document/part-anchors.js +1 -1
- package/dist/editor/lib/document/section-width-fields.js +1 -1
- package/dist/editor/lib/document/selected-host.d.ts +2 -0
- package/dist/editor/lib/document/selected-host.js +1 -0
- package/dist/editor/lib/page-copy.js +1 -1
- package/dist/editor/lib/sections/section-dry-run.d.ts +2 -9
- package/dist/editor/lib/sections/section-dry-run.js +2 -2
- package/dist/format/lib/content/authored-props.js +1 -1
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +1 -0
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-shadow.d.ts +3 -0
- package/dist/format/lib/content/box-shadow.js +1 -0
- package/dist/format/lib/content/button-icon.d.ts +2 -1
- package/dist/format/lib/content/button-icon.js +1 -1
- package/dist/format/lib/content/consent-banner.d.ts +21 -0
- package/dist/format/lib/content/consent-banner.js +1 -1
- package/dist/format/lib/content/contact.js +1 -1
- package/dist/format/lib/content/footer.d.ts +10 -0
- package/dist/format/lib/content/footer.js +1 -1
- package/dist/format/lib/content/gallery-layout.d.ts +12 -0
- package/dist/format/lib/content/gallery-layout.js +1 -1
- package/dist/format/lib/content/section-width.d.ts +0 -4
- package/dist/format/lib/content/section-width.js +1 -1
- package/dist/format/lib/document/blocks/general/Logos/meta.d.ts +6 -0
- package/dist/format/lib/document/blocks/general/Logos/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/SectionHeader/meta.js +1 -1
- package/dist/format/lib/document/box-footer.js +1 -1
- package/dist/format/lib/document/container-blocks.js +1 -1
- package/dist/format/lib/document/media-manifest.json +3 -2
- package/dist/format/lib/document/nestable-content-sections.js +1 -1
- package/dist/format/lib/document/passes/settings-groups.js +1 -1
- package/dist/format/lib/document/root-panel.d.ts +8 -0
- package/dist/format/lib/document/root-panel.js +1 -0
- package/dist/format/lib/document/section-catalog.js +1 -1
- package/dist/format/lib/document/source-bound-parts.js +1 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +23 -5
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/editor-words.js +1 -1
- package/dist/format/lib/hero-texture.js +1 -1
- package/dist/format/lib/hero-video.d.ts +7 -0
- package/dist/format/lib/hero-video.js +1 -1
- package/dist/format/lib/links/page-link-rules.js +1 -1
- package/dist/format/lib/markup.d.ts +1 -0
- package/dist/format/lib/markup.js +2 -2
- package/dist/format/lib/non-empty-string.d.ts +1 -0
- package/dist/format/lib/non-empty-string.js +1 -0
- package/dist/format/lib/popup/look.d.ts +1 -1
- package/dist/format/lib/popup/look.js +1 -1
- package/dist/format/lib/popup/rules.d.ts +1 -1
- package/dist/format/lib/popup/rules.js +1 -1
- package/dist/format/lib/reel.d.ts +2 -1
- package/dist/format/lib/reel.js +1 -1
- package/dist/format/lib/sections/hero-overlay.js +1 -1
- package/dist/format/lib/sections/logo-look.d.ts +7 -0
- package/dist/format/lib/sections/logo-look.js +1 -0
- package/dist/format/lib/sections/section-head-placement.d.ts +1 -0
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/site-theme-row.d.ts +0 -1
- package/dist/format/lib/slugify.d.ts +1 -1
- package/dist/format/lib/slugify.js +1 -1
- package/dist/format/lib/theme.d.ts +2 -1
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/BlockFrame.d.ts +1 -1
- package/dist/render/components/BoxTabs.d.ts +2 -1
- package/dist/render/components/BoxTabs.js +1 -1
- package/dist/render/components/Btn.d.ts +1 -0
- package/dist/render/components/Btn.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +12 -1
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/ContactLocations.js +3 -45
- package/dist/render/components/Divider.d.ts +1 -1
- package/dist/render/components/Divider.js +1 -1
- package/dist/render/components/DocBody.js +5 -5
- package/dist/render/components/Flex.d.ts +5 -9
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Heading.d.ts +1 -1
- package/dist/render/components/HeroGroup.d.ts +3 -9
- package/dist/render/components/HeroGroup.js +1 -1
- package/dist/render/components/HeroSection.js +1 -11
- package/dist/render/components/HeroSingle.js +1 -11
- package/dist/render/components/LogoBlock.d.ts +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/LogoWallContext.d.ts +12 -0
- package/dist/render/components/LogoWallContext.js +1 -0
- package/dist/render/components/Logos.d.ts +16 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/PaymentBadges.d.ts +3 -1
- package/dist/render/components/PaymentBadges.js +1 -1
- package/dist/render/components/PreviewHeaderContext.d.ts +1 -3
- package/dist/render/components/PreviewHeaderContext.js +1 -1
- package/dist/render/components/PreviewTickerContext.d.ts +3 -0
- package/dist/render/components/PreviewTickerContext.js +1 -1
- package/dist/render/components/Reel.js +1 -1
- package/dist/render/components/SiteGutterFrame.d.ts +3 -2
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/Text.d.ts +1 -1
- package/dist/render/lib/content/button-look.d.ts +46 -0
- package/dist/render/lib/content/button-look.js +1 -0
- package/dist/{format → render}/lib/content/section-padding.d.ts +32 -4
- package/dist/render/lib/content/section-padding.js +1 -0
- package/dist/render/lib/content/view-values.d.ts +10 -0
- package/dist/render/lib/content/view-values.js +1 -0
- package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Divider/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Heading/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
- package/dist/render/lib/document/blocks/general/PaymentBadges/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +4 -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-logos.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.d.ts +5 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows.d.ts +0 -4
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
- package/dist/render/lib/document/page-render.js +1 -1
- package/dist/render/lib/document/part-rows.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +0 -1
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/section-anchor.js +1 -1
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/text-parts.d.ts +0 -2
- package/dist/render/lib/document/text-parts.js +1 -1
- package/dist/render/lib/sections/section-to-box.d.ts +2 -11
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +5 -5
- package/dist/format/lib/content/section-padding.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HOME_PAGE_SLUG as
|
|
1
|
+
import{HOME_PAGE_SLUG as p}from"../document/home-page.js";import{slugify as i}from"efficient-shell/format";const s=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function x(e){return e.offersCommerce&&e.offersService?s:s.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}const u="#popup:";function g(e){return`${u}${e}`}function P(e){return e.startsWith(u)&&e.slice(u.length).trim()||null}function a(e){return e===p?"/":`/${e}`}function b(e){return`/journal/${e}`}function $(e){return`/wheels/${e}`}function A(e,t){return`${a(e)}#${t}`}function y(e){return i(e)}function l(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function O(...e){const t=new Set,n=[];for(const o of e)for(const f of o?.content??[]){const c=l(f?.props?.anchor);if(!c)continue;const r=i(c);!r||t.has(r)||(t.add(r),n.push({slug:r,name:c}))}return n}function S(e){const t=e.indexOf("#"),n=t===-1?e:e.slice(0,t),o=n.indexOf("?");return o===-1?n:n.slice(0,o)}function h(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}function w(e,t){if(!e)return"page";if(e.startsWith("/journal/"))return"blog";if(h(e))return"product";if(e.includes("#")){const n=e.slice(0,e.indexOf("#"));if(n===""||n==="/"||t.includes(n))return"anchor"}return e==="/"||t.includes(e)?"page":"custom"}export{s as LINK_KINDS,u as POPUP_LINK_PREFIX,A as anchorPath,w as inferKind,h as isProductPath,x as linkKindsFor,S as linkPagePath,O as pageAnchors,a as pagePath,g as popupPath,P as popupSlugOf,b as postPath,y as slugifyAnchor,$ as wheelPath};
|
|
@@ -38,3 +38,4 @@ export declare function shopMarkupTools(): MarkupTool[];
|
|
|
38
38
|
export declare function applyShopMark(text: string, start: number, end: number, style: MarkStyle): WrapResult;
|
|
39
39
|
export declare function shopMarkedAt(text: string, start: number, end: number, style: MarkStyle): boolean;
|
|
40
40
|
export declare function stripMarkup(value: string): string;
|
|
41
|
+
export declare function clearShopStyle(value: string, start: number, end: number): WrapResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{applyMark as
|
|
2
|
-
`)}function f(e){return e.map(n=>n.kind==="text"?n.text:f(n.children)).join("")}export{
|
|
1
|
+
import{applyMark as $,markupTools as j,MARKUP_TOOLS as q,COPY_FIELD_TOOLS as H,STOREFRONT_MARKUP as z,tokenizeInline as B,stripInline as G,isSafeLinkHref as J}from"efficient-shell/markup";import{applyMark as g,clearStyle as T,markedAt as E,markupTools as R,MARKUP_TOOLS as k,parseMarkup as L,RETIRED_MARKS as a,STOREFRONT_MARKUP as m,tokenizeInline as d}from"efficient-shell/markup";import{WORD_STYLES as u,WORD_STYLE_LABELS as i,WORD_STYLE_MARKS as o}from"./word-styles.js";const M=new Set(["strong"]),S=u.map(e=>({open:o[e].delimiter,close:o[e].delimiter,kind:o[e].kind,...M.has(e)?{wordStart:!0}:{}})),W=[{style:o.highlight.kind,label:i.highlight,title:`${i.highlight} word style`},{style:o.strong.kind,label:i.strong,title:`${i.strong} word style`},{style:o.quiet.kind,label:i.quiet,title:`${i.quiet} word style`}],x=new Set(S.map(e=>e.open)),s=[...m.filter(e=>!x.has(e.open)),...S];function b(e){return d(e,s)}function y(e){return e.bullet?"- ":e.number!=null?`${e.number}. `:""}function A(e){return L(typeof e=="string"?e:"",s)}const D=k.map(e=>e.style).filter(e=>!a.includes(e)).filter(e=>s.some(n=>n.kind===e));function K(){return R(D)}const h=Object.fromEntries(u.map(e=>[o[e].kind,o[e].delimiter]));function w(e,n,r,l){const t=h[l];if(!t)return g(e,n,r,l);const c=e.slice(n,r),O=e.slice(Math.max(0,n-t.length),n),_=e.slice(r,r+t.length);if(O===t&&_===t)return{text:e.slice(0,n-t.length)+c+e.slice(r+t.length),selectionStart:n-t.length,selectionEnd:n-t.length+c.length};const p=c||"styled text";return{text:e.slice(0,n)+t+p+t+e.slice(r),selectionStart:n+t.length,selectionEnd:n+t.length+p.length}}function F(e,n,r,l){const t=h[l];return t?n>=t.length&&e.slice(n-t.length,n)===t&&e.slice(r,r+t.length)===t:E(e,n,r,l)}function I(e){return A(e).map(n=>y(n)+f(n.children)).join(`
|
|
2
|
+
`)}function U(e,n,r){return T(e,n,r,s)}function f(e){return e.map(n=>n.kind==="text"?n.text:f(n.children)).join("")}export{H as COPY_FIELD_TOOLS,q as MARKUP_TOOLS,D as SHOP_COPY_FIELD_TOOLS,s as SHOP_MARKUP,z as STOREFRONT_MARKUP,S as WORD_STYLE_RULES,W as WORD_STYLE_TOOLS,M as WORD_STYLE_WORD_START,$ as applyMark,w as applyShopMark,U as clearShopStyle,J as isSafeLinkHref,y as linePrefix,j as markupTools,F as shopMarkedAt,K as shopMarkupTools,A as storefrontLines,b as storefrontTokens,G as stripInline,I as stripMarkup,B as tokenizeInline};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nonEmptyString: (v: unknown) => string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=n=>typeof n=="string"&&n?n:void 0;export{t as nonEmptyString};
|
|
@@ -25,4 +25,4 @@ export interface PopupLook {
|
|
|
25
25
|
closeButton: PopupCloseButton;
|
|
26
26
|
}
|
|
27
27
|
export declare const POPUP_LOOK_DEFAULTS: PopupLook;
|
|
28
|
-
export declare function resolvePopupLook(rootProps: Record<string, unknown> | undefined | null): PopupLook;
|
|
28
|
+
export declare function resolvePopupLook(rootProps: Record<string, unknown> | undefined | null, defaults?: PopupLook): PopupLook;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HERO_GROUP_PLACEMENTS as
|
|
1
|
+
import{HERO_GROUP_PLACEMENTS as c}from"../hero-group-placement.js";import{authoredBoolean as l}from"../content/authored-props.js";import{inRange as r,oneOf as n}from"./behavior.js";const _="popup",P=c,p=["auto","full"],s=["inside","outside","none"],u={min:240,max:1440},O={min:0,max:100},h={placement:"center",fullWidth:!1,width:720,height:"auto",tintColor:"#000000",tintOpacity:60,outsideClick:!0,closeButton:"inside"};function a(i,e){return typeof i=="string"&&/^#[0-9a-fA-F]{6}$/.test(i.trim())?i.trim():e}function C(i,e=h){const t=i??{},o=e;return{placement:n(P,t.placement,o.placement),fullWidth:l(t.fullWidth,o.fullWidth),width:r(t.width,u,o.width),height:n(p,t.height,o.height),tintColor:a(t.tintColor,o.tintColor),tintOpacity:r(t.tintOpacity,O,o.tintOpacity),outsideClick:l(t.outsideClick,o.outsideClick),closeButton:n(s,t.closeButton,o.closeButton)}}export{s as POPUP_CLOSE_BUTTONS,p as POPUP_HEIGHTS,h as POPUP_LOOK_DEFAULTS,_ as POPUP_PAGE_KIND,P as POPUP_PLACEMENTS,O as POPUP_TINT_OPACITY_RANGE,u as POPUP_WIDTH_RANGE,C as resolvePopupLook};
|
|
@@ -32,4 +32,4 @@ export interface ListedPopup {
|
|
|
32
32
|
export declare function pickAutoPopup<T extends ListedPopup>(popups: readonly T[], ctx: PopupContext, stores: PopupStores, now: number): T | null;
|
|
33
33
|
export declare function effectiveTrigger(trigger: PopupTrigger, hasHoverPointer: boolean): PopupTrigger;
|
|
34
34
|
export declare function scrolledPercent(scrollY: number, viewportH: number, pageH: number): number;
|
|
35
|
-
export
|
|
35
|
+
export { toDateKey as localDay } from "efficient-shell/format";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SUBSCRIBE_POPUP_SLUG as a}from"../content/subscribe.js";import{canPersist as i}from"../safe-storage.js";const c=1440*60*1e3,p=["/checkout","/cart"];function u(t){return t===a?{seen:"storefront-subscribe-seen",closedAt:"storefront-popup-closed-at",sentAt:"storefront-popup-sent-at"}:{seen:`storefront-popup:${t}:seen`,closedAt:`storefront-popup:${t}:closed-at`,sentAt:`storefront-popup:${t}:sent-at`}}function f(t){const e=t.split(/[?#]/)[0]||"/",r=e.startsWith("/")?e:`/${e}`;return r.length>1?r.replace(/\/+$/,"")||"/":r}function
|
|
1
|
+
import{SUBSCRIBE_POPUP_SLUG as a}from"../content/subscribe.js";import{canPersist as i}from"../safe-storage.js";const c=1440*60*1e3,p=["/checkout","/cart"];function u(t){return t===a?{seen:"storefront-subscribe-seen",closedAt:"storefront-popup-closed-at",sentAt:"storefront-popup-sent-at"}:{seen:`storefront-popup:${t}:seen`,closedAt:`storefront-popup:${t}:closed-at`,sentAt:`storefront-popup:${t}:sent-at`}}function f(t){const e=t.split(/[?#]/)[0]||"/",r=e.startsWith("/")?e:`/${e}`;return r.length>1?r.replace(/\/+$/,"")||"/":r}function m(t,e,r){const n=f(t);if(p.some(s=>n===s||n.startsWith(`${s}/`)))return!1;if(e==="all")return!0;const o=r.some(s=>f(s)===n);return e==="chosen"?o:!o}function d(t,e){return t==="all"?!0:t==="phone"?e:!e}function h(t,e,r){return!(t&&r<t||e&&r>e)}function l(t,e){const r=Number(t.getItem(e));return Number.isFinite(r)&&r>0?r:null}function A(t,e,r,n){const o=u(t);if(e.afterSubmit==="stop"&&l(r.local,o.sentAt)!==null)return!0;if(e.hideAfter==="never")return!1;if(r.session.getItem(o.seen)==="1")return!0;if(e.hideAfter==="visit")return!1;const s=l(r.local,o.closedAt);return s===null?!1:e.hideAfter==="once"?!0:n-s<e.hideDays*c}function P(t,e,r){const n=u(t);e.session.setItem(n.seen,"1"),e.local.setItem(n.closedAt,String(r))}function O(t,e,r){P(t,e,r),e.local.setItem(u(t).sentAt,String(r))}function x(t,e,r,n,o){return!e.autoOpen||r.inEditor||!m(r.path,e.showOn,e.showOnPages)||!d(e.devices,r.isPhone)||!h(e.startDate,e.endDate,r.today)||(e.hideAfter!=="never"||e.afterSubmit==="stop")&&(!i(n.session)||!i(n.local))?!1:!A(t,e,n,o)}function g(t,e,r,n){return t.find(o=>x(o.id,o.behavior,e,r,n))??null}function k(t,e){return t==="exit"&&!e?"delay":t}function v(t,e,r){const n=r-e;return n<=0?100:Math.min(100,Math.max(0,t/n*100))}import{toDateKey as M}from"efficient-shell/format";export{p as POPUP_NEVER_ON,k as effectiveTrigger,M as localDay,P as markPopupClosed,O as markPopupSent,x as mayAutoOpen,f as normalizePath,g as pickAutoPopup,d as popupAllowedOnDevice,m as popupAllowedOnPath,A as popupHidden,h as popupInSchedule,u as popupStorageKeys,v as scrolledPercent};
|
|
@@ -2,12 +2,13 @@ import { type HeroGroupPlacement } from "./hero-group-placement.js";
|
|
|
2
2
|
export declare const REEL_PLACEMENTS: readonly ["top-left", "top-center", "top-right", "left", "center", "right", "bottom-left", "bottom-center", "bottom-right"];
|
|
3
3
|
export type ReelPlacement = HeroGroupPlacement;
|
|
4
4
|
export declare const REEL_PLACEMENT_DEFAULT: ReelPlacement;
|
|
5
|
-
export declare const REEL_SHAPES: readonly ["cards", "dots", "numbers", "bar", "squares", "tabs"];
|
|
5
|
+
export declare const REEL_SHAPES: readonly ["cards", "dots", "numbers", "bar", "squares", "tabs", "largeTabs"];
|
|
6
6
|
export type ReelShape = (typeof REEL_SHAPES)[number];
|
|
7
7
|
export declare const HERO_REEL_SHAPES: readonly ["cards", "dots", "numbers", "bar", "squares"];
|
|
8
8
|
export type HeroReelShape = (typeof HERO_REEL_SHAPES)[number];
|
|
9
9
|
export declare const REEL_SHAPE_DEFAULT: HeroReelShape;
|
|
10
10
|
export declare const REEL_SHAPE_LABELS: Readonly<Record<ReelShape, string>>;
|
|
11
|
+
export declare const BOX_TAB_SHAPES: readonly ["tabs", "largeTabs"];
|
|
11
12
|
export declare const REEL_SHOWN_DEFAULT = true;
|
|
12
13
|
export declare function normaliseReelShape(value: unknown): ReelShape;
|
|
13
14
|
export declare function normaliseHeroReelShape(value: unknown): HeroReelShape;
|
package/dist/format/lib/reel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HERO_GROUP_PLACEMENTS as l}from"./hero-group-placement.js";import{heroOverlayRailClass as c}from"./hero-overlay-anchor.js";const u=l,i="top-right",
|
|
1
|
+
import{HERO_GROUP_PLACEMENTS as l}from"./hero-group-placement.js";import{heroOverlayRailClass as c}from"./hero-overlay-anchor.js";const u=l,i="top-right",d=["cards","dots","numbers","bar","squares","tabs","largeTabs"],E=["cards","dots","numbers","bar","squares"],o="cards",S={cards:"Cards",dots:"Dots",numbers:"Numbers",bar:"Bar",squares:"Squares",tabs:"Tabs",largeTabs:"Large tabs"},b=["tabs","largeTabs"],L=!0;function a(e){return d.includes(e)?e:o}function _(e){return E.includes(e)?e:o}function p(e){return u.includes(e)?e:i}const n={cards:"flex-col gap-2.5",dots:"flex-row items-center gap-2",numbers:"flex-col gap-2",bar:"h-0.5 w-[34%] max-w-[420px] gap-px overflow-hidden rounded-full",squares:"flex-col gap-0",tabs:"flex-row items-stretch w-full overflow-x-auto",largeTabs:"items-stretch border-y border-line"};function A(e,r){return c(p(r),n[a(e)])}function g(e){return`flex ${n[a(e)]}`}function h(e){return e.shown!==!1&&(e.count??0)>1}function f(e){return{name:e.dataset.slideName||"",process:e.dataset.slideProcess||"",video:e.dataset.slideMedia==="video"}}function x(e,r){return e===r?!0:e.length!==r.length?!1:e.every((t,s)=>t.name===r[s].name&&t.process===r[s].process&&t.video===r[s].video)}function P(e,r){const t=Array.from(r,f);return x(e,t)?e:t}export{b as BOX_TAB_SHAPES,E as HERO_REEL_SHAPES,u as REEL_PLACEMENTS,i as REEL_PLACEMENT_DEFAULT,d as REEL_SHAPES,o as REEL_SHAPE_DEFAULT,S as REEL_SHAPE_LABELS,L as REEL_SHOWN_DEFAULT,P as nextReel,_ as normaliseHeroReelShape,p as normaliseReelPlacement,a as normaliseReelShape,A as reelRailClass,h as reelShown,g as reelSurfaceRailClass,x as sameReel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as
|
|
1
|
+
import{hexToRgb as a}from"efficient-shell/format";import{parseOption as O}from"../parse-option.js";const i="bottom",c="#0A0A0A",u=[{label:"Bottom",value:"bottom",cell:"bottom"},{label:"Top",value:"top",cell:"top"},{label:"Left",value:"left",cell:"left"},{label:"Right",value:"right",cell:"right"}],b={bottom:180,top:0,left:270,right:90},m=[[.55,0],[.15,18],[null,35],[null,55],[.85,100]],A=[[null,33],[.6,67],[.94,100]];function T(t,e){const{r:o,g:l,b:n}=a(t)??a(c);return`rgba(${o},${l},${n},${e})`}function g(t){return O(u,i,t)}function v(t=c,e=i){const o=g(e),p=(o==="top"||o==="bottom"?m:A).map(([r,s])=>`${r===null?"transparent":T(t,r)} ${s}%`);return`linear-gradient(${b[o]}deg, ${p.join(", ")})`}export{c as DEFAULT_OVERLAY_COLOR,i as DEFAULT_OVERLAY_POSITION,u as OVERLAY_POSITION_OPTIONS,v as overlayGradient,g as parseOverlayPosition};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseOption as a}from"../parse-option.js";const O="plain",e=[{label:"Plain",value:"plain"},{label:"Cards",value:"cards"}],p=o=>a(e,O,o);export{O as DEFAULT_LOGO_LOOK,e as LOGO_LOOK_OPTIONS,p as parseLogoLook};
|
|
@@ -31,4 +31,5 @@ export declare function widthFieldsForParent<T extends Record<string, unknown>>(
|
|
|
31
31
|
type?: string;
|
|
32
32
|
} | null | undefined, widthKeys: readonly string[]): T;
|
|
33
33
|
export declare const HEAD_ROWS_SHOW_WHEN: ShowWhenRule;
|
|
34
|
+
export declare const OWN_BOX_ROWS_SHOW_WHEN: ShowWhenRule;
|
|
34
35
|
export declare function headFieldsForPlacement<T extends Record<string, unknown>>(fields: T, _placement: unknown, headKeys: readonly string[]): T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseOption as
|
|
1
|
+
import{parseOption as d}from"../parse-option.js";import{withRowsShownWhen as r}from"../document/show-when-attach.js";import{nonEmptyString as l}from"../non-empty-string.js";const a="inline",s=[{label:"In this section",value:"inline"},{label:"In its own box",value:"own-box"}];function w(e){return[e.num,e.title,e.description,e.linkProp].filter(t=>l(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:"DynamicBundleOffer"},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"}},y="SectionHeader";function S(e){return e in p}function T(e){return d(s,a,e)}const n=new Set(["Flex"]);function R(e){return!!e?.type&&n.has(e.type)}const m={not:{context:"parentType",in:[...n]}};function b(e,t,i){return r(e,i,m)}const o={not:{field:"headPlacement",is:"own-box"}},P={not:o};function x(e,t,i){return r(e,i,o)}export{a as DEFAULT_SECTION_HEAD_PLACEMENT,o as HEAD_ROWS_SHOW_WHEN,P as OWN_BOX_ROWS_SHOW_WHEN,s as SECTION_HEAD_PLACEMENT_OPTIONS,y as SECTION_HEAD_TYPE,p as SPLITTABLE_SECTIONS,m as WIDTH_ROWS_SHOW_WHEN,S as canSplitHead,x as headFieldsForPlacement,w as headRoleProps,R as parentCapsWidth,T as parseSectionHeadPlacement,b as widthFieldsForParent};
|
|
@@ -33,7 +33,6 @@ export interface SiteThemeRow {
|
|
|
33
33
|
corner_radius_px?: number | null;
|
|
34
34
|
heading_compression: "normal" | "tight" | "compressed";
|
|
35
35
|
card_shadow?: "none" | "soft" | "lifted" | null;
|
|
36
|
-
card_theme_index?: number | null;
|
|
37
36
|
shadow_color?: string | null;
|
|
38
37
|
card_gap: "tight" | "normal" | "roomy";
|
|
39
38
|
hover_effect?: "none" | "lift" | "highlight" | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { slugify } from "efficient-shell/format";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{slugify as r}from"efficient-shell/format";export{r as slugify};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { contrastRatio } from "efficient-shell/format";
|
|
1
2
|
export declare const THEME_STORAGE_KEY = "storefront-theme";
|
|
2
3
|
export declare const THEME_MODE_KEY = "sf:theme-mode";
|
|
3
4
|
export declare const THEME_SWITCH_KEY = "sf:theme-switch";
|
|
@@ -51,7 +52,7 @@ export declare function themeSwatchColors(c: ThemeColors): {
|
|
|
51
52
|
export declare const READABILITY_AA = 4.5;
|
|
52
53
|
export declare const READABILITY_AA_LARGE = 3;
|
|
53
54
|
export type ReadabilityGrade = "good" | "large-only" | "hard";
|
|
54
|
-
export
|
|
55
|
+
export { contrastRatio };
|
|
55
56
|
export declare const GRADE_LABEL: Record<ReadabilityGrade, string>;
|
|
56
57
|
export declare function gradeContrast(ratio: number): ReadabilityGrade;
|
|
57
58
|
export declare function accentInk(accent: string): string;
|
package/dist/format/lib/theme.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{contrastRatio as L,hexToRgb as l,readableInk as k,relativeLuminance as $}from"efficient-shell/format";const F="storefront-theme",Se="sf:theme-mode",Ae="sf:theme-switch",Te="hide",be="light",we=!1,E=7,S=18;function P(e){return e>=E&&e<S}function Ce(e){const{mode:t,override:n,switchShown:r,hour:o}=e;return r&&(n==="light"||n==="dark")?n:t==="auto"?P(o)?"light":"dark":t==="light"?"light":"dark"}function Ie(e){const{mode:t,switchShown:n}=e;return`
|
|
2
2
|
try {
|
|
3
3
|
var mode = ${JSON.stringify(t)};
|
|
4
4
|
var shown = ${n?"true":"false"};
|
|
5
|
-
var override = localStorage.getItem(${JSON.stringify(
|
|
5
|
+
var override = localStorage.getItem(${JSON.stringify(F)});
|
|
6
6
|
var theme;
|
|
7
7
|
if (shown && (override === 'light' || override === 'dark')) {
|
|
8
8
|
theme = override;
|
|
9
9
|
} else if (mode === 'auto') {
|
|
10
10
|
var h = new Date().getHours();
|
|
11
|
-
theme = (h >=
|
|
11
|
+
theme = (h >= ${E} && h < ${S}) ? 'light' : 'dark';
|
|
12
12
|
} else {
|
|
13
13
|
theme = mode === 'light' ? 'light' : 'dark';
|
|
14
14
|
}
|
|
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 a={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},$=[{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"}],F={selected:0,themes:$};function A(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...F}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function f(e,t,n){const r=u(e),o=u(t);if(r===null||o===null)return e;const i=c=>Math.max(0,Math.min(255,Math.round(c))).toString(16).padStart(2,"0");return`#${r.map((c,O)=>i(c+(o[O]-c)*n)).join("")}`}const P={light:"#ffffff",dark:"#0a0a0a"},Re=["light","dark"];function we(e,t){const n=P[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:f(e,r,.1),line:f(e,r,.22),muted:f(n,e,.35),brandInk:t}}function s(e){const t=A(e);return t.themes[t.selected]}function d(e){return{text:e.text,accent:e.accent,background:e.background||a.background,surface:e.surface||a.surface,line:e.line||a.line,muted:e.muted||a.muted}}function De(e){return{fill:d(e).background,accent:e.accent}}function u(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;const n=t[1].length===3?[...t[1]].map(c=>c+c).join(""):t[1],[r,o,i]=[0,2,4].map(c=>parseInt(n.slice(c,c+2),16));return[r,o,i]}function g(e){const t=u(e);if(t===null)return null;const[n,r,o]=t.map(i=>{const c=i/255;return c<=.04045?c/12.92:((c+.055)/1.055)**2.4});return .2126*n+.7152*r+.0722*o}const U=.4,G=4.5,Y=3;function z(e,t){const n=g(e),r=g(t);if(n===null||r===null)return null;const[o,i]=n>=r?[n,r]:[r,n];return(o+.05)/(i+.05)}const He={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Ie(e){return e>=G?"good":e>=Y?"large-only":"hard"}const m=["#000000","#ffffff"];function l(e){let t=m[0],n=-1;for(const r of m){const o=z(e,r);if(o===null)return m[0];o>n&&(n=o,t=r)}return t}const B=[.25,.4,.55];function Me(e){const t=u(e);return t===null?[]:B.map(n=>"#"+t.map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function ye(e){const t=s(e),n={"--theme-fg":t.text},r=g(t.text);return(r===null||r>=U)&&(n["--overlay-fg"]=t.text),n}const X=82;function p(e){return`color-mix(in srgb, ${e} ${X}%, #000)`}function Ne(e){const t=s(e);return{"--theme-accent":t.accent,"--theme-accent-2":p(t.accent),"--theme-accent-ink":l(t.accent)}}function x(e){const t=e?.button;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Oe(e){const t=s(e),n=x(t),r=T(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=p(n)),o["--theme-btn-ink"]=r??l(n),o}function T(e){const t=e?.buttonInk;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function W(e,t){return T(e)??l(x(e)??t)}function Le(e){const t=s(e);return{fill:x(t)??t.accent.toLowerCase(),ink:W(t,t.accent)}}function ke(e){const t={};return A(e).themes.forEach((n,r)=>{const o=d(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=p(o.accent),t[`--theme-preset-${r}-accent-ink`]=l(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 $e=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function Fe(e){const t=d(s(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!==a.surface||t.line!==a.line)&&(r["--theme-surface-2"]=n),r}const K=["heading","body","label"],Pe={heading:"Headings",body:"Body",label:"Labels"};function Ue(e){if(!e)return null;for(const t of K)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const b=["headingLarge","headingMedium","headingSmall","accent","body","label"],Ge={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},Ye={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},V=8,j=200;function Z(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=V&&t<=j?t:null}function q(e){const t={};for(const n of b)t[n]=Z(e?.[n]);return t}function ze(e){const t=q(e),n={};for(const r of b){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const J=["square","small","large"],Q="small";function v(e){return J.includes(e??"")?e:Q}function Be(e){return w(te[v(e)])}const C=0,ee=40,te={square:0,small:null,large:16},ne={"--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 R(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(ee,Math.max(C,Math.round(t))):null}function w(e){const t=R(e);return t===null?{}:Object.fromEntries(Object.entries(ne).map(([n,r])=>{const o=t*r/16;return[n,o===0?"0":`${o}rem`]}))}function Xe(e){return w(R(e)??C)}const re=["none","soft","lifted"],oe="soft",D="none",ie=["tight","normal","roomy"],ce="normal",ae="normal",se=["none","lift","highlight"],ue="lift",le="highlight",H="#141416";function I(e){return re.includes(e??"")?e:oe}function he(e){return ie.includes(e??"")?e:ce}function M(e){return se.includes(e??"")?e:ue}function fe(e){return/^#[0-9a-fA-F]{6}$/.test(e??"")?e.toLowerCase():H}function We(e){const t=I(e);return t===D?void 0:t}function Ke(e){const t=he(e);return t===ae?void 0:t}function Ve(e){const t=M(e);return t===le?void 0:t}function je(e,t,n){const r=fe(t);return r===H?{}:I(e)!==D||M(n)==="lift"?{"--sf-shadow-color":r}:{}}const de=["normal","tight","compressed"],y="normal";function N(e){return de.includes(e??"")?e:y}function Ze(e){const t=N(e);return t===y?void 0:t}function qe(e){switch(N(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const Je=["authored","sentence"],Qe={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},_=100,E=900,ge=24,me=200;function h(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function S(e){const t=h(e?.weight,_,E),n=e?.case==="sentence"?"sentence":"authored",r=i=>i==null?t:h(i,_,E),o=i=>i==="sentence"?"sentence":i==="authored"?"authored":n;return{case:n,weight:t,weightStrong:h(e?.weightStrong,_,E),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:h(e?.maxPx,ge,me),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function ve(e){const t=S(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 et(e){return S({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 tt(e){const t=S(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}}export{B as ACCENT_DARKEN_STEPS,Re as BRAND_INKS,ie as CARD_GAPS,re as CARD_SHADOWS,ee as CORNER_RADIUS_MAX,C as CORNER_RADIUS_MIN,J as CORNER_STYLES,te as CORNER_STYLE_TO_PX,ce as DEFAULT_CARD_GAP,oe as DEFAULT_CARD_SHADOW,Q as DEFAULT_CORNER_STYLE,y as DEFAULT_HEADING_COMPRESSION,Qe as DEFAULT_HEADING_TYPOGRAPHY,ue as DEFAULT_HOVER_EFFECT,H as DEFAULT_SHADOW_COLOR,Ye as DEFAULT_SIZES,a as DEFAULT_SURFACES,Se as DEFAULT_SWITCH_SHOWN,$ as DEFAULT_THEMES,Ee as DEFAULT_THEME_MODE,F as DEFAULT_THEME_VALUE,He as GRADE_LABEL,Je as HEADING_CASES,de as HEADING_COMPRESSIONS,me as HEADING_MAX_PX_MAX,ge as HEADING_MAX_PX_MIN,E as HEADING_WEIGHT_MAX,_ as HEADING_WEIGHT_MIN,se as HOVER_EFFECTS,ae as IDENTITY_CARD_GAP,D as IDENTITY_CARD_SHADOW,le as IDENTITY_HOVER_EFFECT,G as READABILITY_AA,Y as READABILITY_AA_LARGE,Ge as SCALE_OF_STEP,b as SIZE_STEPS,j as TEXT_SIZE_MAX,V as TEXT_SIZE_MIN,Te as THEME_DAY_END_HOUR,Ae as THEME_DAY_START_HOUR,pe as THEME_MODE_KEY,L as THEME_STORAGE_KEY,$e as THEME_SURFACE_KEYS,_e as THEME_SWITCH_HIDE,xe as THEME_SWITCH_KEY,K as TYPE_GROUPS,Pe as TYPE_GROUP_LABELS,l as accentInk,we as brandTheme,Ce as buildThemeBootScript,Ke as cardGapAttr,We as cardShadowAttr,qe as compressionMetrics,z as contrastRatio,w as cornerRadiusTokens,Be as cornerStyleTokens,Me as darkerAccents,Ie as gradeContrast,Ze as headingCompressionAttr,et as headingTypographyFromRow,ve as headingTypographyStyle,tt as headingTypographyToRow,Ve as hoverEffectAttr,k as isDayHour,he as normalizeCardGap,I as normalizeCardShadow,R as normalizeCornerRadius,v as normalizeCornerStyle,N as normalizeHeadingCompression,S as normalizeHeadingTypography,M as normalizeHoverEffect,fe as normalizeShadowColor,Z as normalizeSize,q as normalizeSizes,A as normalizeTheme,d as normalizeThemeColors,be as resolveTheme,W as resolvedButtonInk,s as selectedThemeColors,je as shadowColorTokens,Le as siteButtonPaint,Xe as siteCornerRadiusTokens,Ne as themeAccentStyle,x as themeButtonColour,T as themeButtonInk,Oe as themeButtonStyle,ye as themeColorStyle,ke as themePresetAccentVars,Fe as themeSurfaceStyle,De as themeSwatchColors,Ue as typeScaleGroupOfClassName,ze as typeSizesStyle};
|
|
18
|
+
`}const c={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},G=[{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"}],U={selected:0,themes:G};function A(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...U}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function h(e,t,n){const r=l(e),o=l(t);if(r===null||o===null)return e;const i=(_,O)=>Math.max(0,Math.min(255,Math.round(_+(O-_)*n))).toString(16).padStart(2,"0");return`#${i(r.r,o.r)}${i(r.g,o.g)}${i(r.b,o.b)}`}const Y={light:"#ffffff",dark:"#0a0a0a"},Re=["light","dark"];function De(e,t){const n=Y[t],r=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:h(e,r,.1),line:h(e,r,.22),muted:h(n,e,.35),brandInk:t}}function a(e){const t=A(e);return t.themes[t.selected]}function f(e){return{text:e.text,accent:e.accent,background:e.background||c.background,surface:e.surface||c.surface,line:e.line||c.line,muted:e.muted||c.muted}}function ye(e){return{fill:f(e).background,accent:e.accent}}const z=.4,B=4.5,X=3,Me={good:"Good","large-only":"Large text only",hard:"Hard to read"};function He(e){return e>=B?"good":e>=X?"large-only":"hard"}const W=["#000000","#ffffff"];function s(e){return k(e,W)}const K=[.25,.4,.55];function Ne(e){const t=l(e);return t===null?[]:K.map(n=>"#"+[t.r,t.g,t.b].map(r=>Math.round(r*(1-n)).toString(16).padStart(2,"0")).join(""))}function Oe(e){const t=a(e),n={"--theme-fg":t.text},r=$(t.text);return(r===null||r>=z)&&(n["--overlay-fg"]=t.text),n}const V=82;function d(e){return`color-mix(in srgb, ${e} ${V}%, #000)`}function Le(e){const t=a(e);return{"--theme-accent":t.accent,"--theme-accent-2":d(t.accent),"--theme-accent-ink":s(t.accent)}}function g(e){const t=e?.button;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function ke(e){const t=a(e),n=g(t),r=T(t);if(n===null&&r===null)return{};const o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=d(n)),o["--theme-btn-ink"]=r??s(n),o}function T(e){const t=e?.buttonInk;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Z(e,t){return T(e)??s(g(e)??t)}function $e(e){const t=a(e);return{fill:g(t)??t.accent.toLowerCase(),ink:Z(t,t.accent)}}function Fe(e){const t={};return A(e).themes.forEach((n,r)=>{const o=f(n);t[`--theme-preset-${r}-accent`]=o.accent,t[`--theme-preset-${r}-accent-2`]=d(o.accent),t[`--theme-preset-${r}-accent-ink`]=s(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 Pe=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function Ge(e){const t=f(a(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!==c.surface||t.line!==c.line)&&(r["--theme-surface-2"]=n),r}const j=["heading","body","label"],Ue={heading:"Headings",body:"Body",label:"Labels"};function Ye(e){if(!e)return null;for(const t of j)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}const b=["headingLarge","headingMedium","headingSmall","accent","body","label"],ze={headingLarge:"heading",headingMedium:"heading",headingSmall:"heading",accent:"heading",body:"body",label:"label"},Be={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},q=8,J=200;function Q(e){if(typeof e!="number"||!Number.isFinite(e))return null;const t=Math.round(e);return t>=q&&t<=J?t:null}function v(e){const t={};for(const n of b)t[n]=Q(e?.[n]);return t}function Xe(e){const t=v(e),n={};for(const r of b){const o=t[r];o!==null&&(n[`--size-${r}`]=`${o}px`)}return n}const ee=["square","small","large"],te="small";function ne(e){return ee.includes(e??"")?e:te}function We(e){return I(oe[ne(e)])}const w=0,re=40,oe={square:0,small:null,large:16},ie={"--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(re,Math.max(w,Math.round(t))):null}function I(e){const t=C(e);return t===null?{}:Object.fromEntries(Object.entries(ie).map(([n,r])=>{const o=t*r/16;return[n,o===0?"0":`${o}rem`]}))}function Ke(e){return I(C(e)??w)}const ce=["none","soft","lifted"],ae="soft",R="none",se=["tight","normal","roomy"],ue="normal",le="normal",he=["none","lift","highlight"],fe="lift",de="highlight",D="#141416";function y(e){return ce.includes(e??"")?e:ae}function ge(e){return se.includes(e??"")?e:ue}function M(e){return he.includes(e??"")?e:fe}function me(e){return/^#[0-9a-fA-F]{6}$/.test(e??"")?e.toLowerCase():D}function Ve(e){const t=y(e);return t===R?void 0:t}function Ze(e){const t=ge(e);return t===le?void 0:t}function je(e){const t=M(e);return t===de?void 0:t}function qe(e,t,n){const r=me(t);return r===D?{}:y(e)!==R||M(n)==="lift"?{"--sf-shadow-color":r}:{}}const pe=["normal","tight","compressed"],H="normal";function N(e){return pe.includes(e??"")?e:H}function Je(e){const t=N(e);return t===H?void 0:t}function Qe(e){switch(N(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}const ve=["authored","sentence"],et={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},m=100,p=900,xe=24,_e=200;function u(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function x(e){const t=u(e?.weight,m,p),n=e?.case==="sentence"?"sentence":"authored",r=i=>i==null?t:u(i,m,p),o=i=>i==="sentence"?"sentence":i==="authored"?"authored":n;return{case:n,weight:t,weightStrong:u(e?.weightStrong,m,p),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:u(e?.maxPx,xe,_e),weight2:r(e?.weight2),weight3:r(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function tt(e){const t=x(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 nt(e){return x({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 rt(e){const t=x(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}}export{K as ACCENT_DARKEN_STEPS,Re as BRAND_INKS,se as CARD_GAPS,ce as CARD_SHADOWS,re as CORNER_RADIUS_MAX,w as CORNER_RADIUS_MIN,ee as CORNER_STYLES,oe as CORNER_STYLE_TO_PX,ue as DEFAULT_CARD_GAP,ae as DEFAULT_CARD_SHADOW,te as DEFAULT_CORNER_STYLE,H as DEFAULT_HEADING_COMPRESSION,et as DEFAULT_HEADING_TYPOGRAPHY,fe as DEFAULT_HOVER_EFFECT,D as DEFAULT_SHADOW_COLOR,Be as DEFAULT_SIZES,c as DEFAULT_SURFACES,we as DEFAULT_SWITCH_SHOWN,G as DEFAULT_THEMES,be as DEFAULT_THEME_MODE,U as DEFAULT_THEME_VALUE,Me as GRADE_LABEL,ve as HEADING_CASES,pe as HEADING_COMPRESSIONS,_e as HEADING_MAX_PX_MAX,xe as HEADING_MAX_PX_MIN,p as HEADING_WEIGHT_MAX,m as HEADING_WEIGHT_MIN,he as HOVER_EFFECTS,le as IDENTITY_CARD_GAP,R as IDENTITY_CARD_SHADOW,de as IDENTITY_HOVER_EFFECT,B as READABILITY_AA,X as READABILITY_AA_LARGE,ze as SCALE_OF_STEP,b as SIZE_STEPS,J as TEXT_SIZE_MAX,q as TEXT_SIZE_MIN,S as THEME_DAY_END_HOUR,E as THEME_DAY_START_HOUR,Se as THEME_MODE_KEY,F as THEME_STORAGE_KEY,Pe as THEME_SURFACE_KEYS,Te as THEME_SWITCH_HIDE,Ae as THEME_SWITCH_KEY,j as TYPE_GROUPS,Ue as TYPE_GROUP_LABELS,s as accentInk,De as brandTheme,Ie as buildThemeBootScript,Ze as cardGapAttr,Ve as cardShadowAttr,Qe as compressionMetrics,L as contrastRatio,I as cornerRadiusTokens,We as cornerStyleTokens,Ne as darkerAccents,He as gradeContrast,Je as headingCompressionAttr,nt as headingTypographyFromRow,tt as headingTypographyStyle,rt as headingTypographyToRow,je as hoverEffectAttr,P as isDayHour,ge as normalizeCardGap,y as normalizeCardShadow,C as normalizeCornerRadius,ne as normalizeCornerStyle,N as normalizeHeadingCompression,x as normalizeHeadingTypography,M as normalizeHoverEffect,me as normalizeShadowColor,Q as normalizeSize,v as normalizeSizes,A as normalizeTheme,f as normalizeThemeColors,Ce as resolveTheme,Z as resolvedButtonInk,a as selectedThemeColors,qe as shadowColorTokens,$e as siteButtonPaint,Ke as siteCornerRadiusTokens,Le as themeAccentStyle,g as themeButtonColour,T as themeButtonInk,ke as themeButtonStyle,Oe as themeColorStyle,Fe as themePresetAccentVars,Ge as themeSurfaceStyle,ye as themeSwatchColors,Ye as typeScaleGroupOfClassName,Xe as typeSizesStyle};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
import type { PadValues } from "
|
|
2
|
+
import type { PadValues } from "../lib/content/section-padding.js";
|
|
3
3
|
interface BlockFrameProps {
|
|
4
4
|
contained: boolean;
|
|
5
5
|
className?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
export default function BoxTabs({ children, className, style, }: {
|
|
2
|
+
export default function BoxTabs({ children, className, style, shape, }: {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
|
+
shape?: unknown;
|
|
6
7
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as
|
|
1
|
+
"use client";import{jsx as o,Fragment as _,jsxs as j}from"react/jsx-runtime";import{useEffect as i,useRef as A,useState as l}from"react";import B from"./Reel.js";import{BOX_TAB_SHAPES as S}from"../../format/lib/reel.js";import{parseOption as E}from"../../format/lib/parse-option.js";import{BoxTabPaneContext as F}from"./BoxTabPaneContext.js";import{markedChildren as c}from"../../format/lib/marked-children.js";function L({children:u,className:b,style:d,shape:m}){const s=A(null),[r,f]=l([]),p=E(S,"tabs",m),[h,x]=l(0);i(()=>{const t=s.current;if(!t)return;const a=()=>{const g=c(t,"data-tab-label");f(g.map((v,T)=>v.dataset.tabLabel?.trim()||`Tab ${T+1}`))};a();const e=new MutationObserver(a);return e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tab-label"]}),()=>e.disconnect()},[]);const n=r.length?Math.min(h,r.length-1):0;return i(()=>{const t=s.current;t&&c(t,"data-tab-label").forEach((a,e)=>{a.hidden=r.length>1&&e!==n})},[r,n]),j(_,{children:[r.length>1&&o(B,{slides:r.map(t=>({name:t,process:""})),active:n,shape:p,tone:"surface",label:"Tabs",ref:t=>{t&&(t.onclick=a=>{const e=a.target?.closest?.("[data-idx]")?.getAttribute("data-idx");e!=null&&x(Number(e))})}}),o("div",{ref:s,"data-box-tabs":!0,className:b,style:d,children:o(F.Provider,{value:!0,children:u})})]})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,Fragment as i,jsxs as l}from"react/jsx-runtime";import{SiteLink as x}from"../lib/site-runtime.js";import{BUTTON_PAD_CLASSES as y}from"../lib/content/button-look.js";const c=`sf-button group inline-flex items-center justify-center gap-2.5 border ${y} font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.2em] transition-colors`,b={primary:"border-btn bg-btn text-btn-ink hover:border-btn-2 hover:bg-btn-2",ghost:"border-current bg-transparent hover:bg-white/10"};function j(p){const{variant:m="primary",arrow:e,glyphBefore:h,spread:f,className:u,style:n,children:t,href:s,newTab:d,...g}=p,a=`${f?c.replace("justify-center","justify-between"):c} ${b[m]??b.primary} ${u??""}`,o=h?l(i,{children:[e!==null&&r("span",{"aria-hidden":!0,className:"inline-flex",children:e??"→"}),t]}):l(i,{children:[t,e!==null&&r("span",{"aria-hidden":!0,className:"transition-transform group-hover:translate-x-[3px]",children:e??"→"})]});return s?r(x,{href:s,className:a,style:n,...d?{target:"_blank",rel:"noopener noreferrer"}:{},children:o}):r("button",{type:"button",className:a,style:n,...g,children:o})}export{j as default};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BorderValue } from "../../format/lib/content/borders.js";
|
|
1
2
|
import { type BlockAlign as Align } from "../../format/lib/content/block-align.js";
|
|
2
3
|
type Variant = "primary" | "ghost";
|
|
3
4
|
export declare const BUTTON_BLOCK_CLASS = "sf-button-block";
|
|
@@ -13,6 +14,16 @@ interface ButtonBlockProps {
|
|
|
13
14
|
widthFit?: string;
|
|
14
15
|
buttonColor?: string;
|
|
15
16
|
buttonTextColor?: string;
|
|
17
|
+
buttonFillOpacity?: number;
|
|
18
|
+
buttonBorder?: BorderValue;
|
|
19
|
+
buttonPaddingTop?: number;
|
|
20
|
+
buttonPaddingRight?: number;
|
|
21
|
+
buttonPaddingBottom?: number;
|
|
22
|
+
buttonPaddingLeft?: number;
|
|
23
|
+
buttonPaddingTopPhone?: number;
|
|
24
|
+
buttonPaddingRightPhone?: number;
|
|
25
|
+
buttonPaddingBottomPhone?: number;
|
|
26
|
+
buttonPaddingLeftPhone?: number;
|
|
16
27
|
}
|
|
17
|
-
export default function ButtonBlock(
|
|
28
|
+
export default function ButtonBlock(props: ButtonBlockProps): import("react").JSX.Element;
|
|
18
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{buttonArrowShown as A}from"../../format/lib/content/button-arrow.js";import{buttonIconAtEnd as k,buttonIconSide as L,buttonWidth as N,storedButtonIcon as P}from"../../format/lib/content/button-icon.js";import{buttonPadAttrs as S,buttonPaint as T}from"../lib/content/button-look.js";import{ArrowLongRightIcon as _,ArrowRightIcon as v,ArrowUpRightIcon as O,BagIcon as j,CarIcon as G,CartIcon as R,ChevronRightIcon as U,DownloadIcon as E,EmailIcon as F,ExternalIcon as K,LocationIcon as Y,PlayIcon as $,SearchIcon as z,TagIcon as D}from"efficient-shell/icons/efficient";import H from"./BlockFrame.js";import J from"./Btn.js";import{renderGold as W}from"./goldPhrases.js";import{BLOCK_ALIGN_JUSTIFY as q}from"../../format/lib/content/block-align.js";const M="sf-button-block",Q={"arrow-right":v,"arrow-long-right":_,"arrow-up-right":O,"chevron-right":U,external:K,cart:R,bag:j,tag:D,email:F,location:Y,play:$,download:E,search:z,car:G};function V(n){const{label:u,href:f,variant:c,align:g,contained:p,arrow:w,icon:I,iconPosition:e,widthFit:l,buttonColor:o,buttonTextColor:i}=n,t=P(I),s=t&&t!=="none"?Q[t]:void 0,b=t===void 0?A(w)?{}:{arrow:null}:s?{arrow:r(s,{size:16}),...L(e)==="before"?{glyphBefore:!0}:{}}:{arrow:null},d=S(n),h=[N(l)==="fill"?"w-full":"",d?.className??""].filter(Boolean).join(" "),B=h?{className:h}:{},C=k(e,l)?{spread:!0}:{},a=T(n),y=a?a.background==="transparent"?"ghost":"primary":c,m={...a??(o?c==="ghost"?{borderColor:o}:{background:o,borderColor:o}:{}),...i?{color:i}:{},...d?.style??{}},x=Object.keys(m).length?{style:m}:{};return r(H,{contained:p,className:`${M} py-4`,children:r("div",{className:`flex ${q[g]}`,children:r(J,{href:f||"#",variant:y,...B,...C,...b,...x,children:W(u)})})})}export{M as BUTTON_BLOCK_CLASS,V as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as i,Fragment as j}from"react/jsx-runtime";import{EDITORIAL_COLUMN as G}from"../../format/lib/content/page-width.js";import{SiteImage as q}from"../lib/site-runtime.js";import{useEffect as A,useMemo as P,useState as T}from"react";import{stripMarkup as V}from"../../format/lib/markup.js";import J from"./EditorialSectionHead.js";import W from"./SectionEyebrow.js";import{scrollBehavior as M}from"./useReducedMotion.js";import{renderGold as O,renderHeadline as K}from"./goldPhrases.js";import{CONTACT_LOCATIONS_CARDS_PLACEHOLDER as Q,CONTACT_LOCATIONS_DEFAULTS as y,parseLocationTileShape as X,splitLegacyRegion as Y}from"../../format/lib/content/contact.js";import{galleryCardRatioClass as Z}from"../../format/lib/content/gallery-card-layout.js";import{hasMapCoords as C}from"../../format/lib/map-styles.js";import{bucketByGroup as ee,groupColsClass as $}from"../../format/lib/locations-grid.js";import{LocationGroupHeader as te}from"./LocationGroupHeader.js";import ne from"./SiteMap.js";import{phoneHref as re}from"../../format/lib/links/phone-href.js";const ie=`
|
|
2
2
|
.contact-loc {
|
|
3
3
|
outline: 2px solid transparent;
|
|
4
4
|
outline-offset: -2px;
|
|
@@ -10,47 +10,5 @@
|
|
|
10
10
|
.contact-loc[data-active="true"] > div:first-child { background-color: var(--accent); }
|
|
11
11
|
.contact-loc[data-active="true"] > div:first-child,
|
|
12
12
|
.contact-loc[data-active="true"] > div:first-child * { color: var(--bg) !important; }
|
|
13
|
-
|
|
14
|
-
.loc-
|
|
15
|
-
/* ⚠️ AN OVERLAY, NOT AN outline, AND THAT IS THE WHOLE FIX.
|
|
16
|
-
An inset outline is painted in the element's own box decoration and a
|
|
17
|
-
full-bleed child sitting above it hides it completely. A city TILE stacks
|
|
18
|
-
three: the picture (or its placeholder) at absolute inset-0, the gradient
|
|
19
|
-
scrim at absolute inset-0, and the caption at z-[1]. A MAP stacks its
|
|
20
|
-
canvas at absolute inset-0 and its address card at z-10 — but its
|
|
21
|
-
background is painted on the element itself, so its outline survived. That is
|
|
22
|
-
why the merchant saw the ring on the map and not on the picture: not a dead
|
|
23
|
-
control, a control that could not say it was live. Owner, 2026-09-09, having
|
|
24
|
-
clicked it: it works when clicked, hovering the picture shows nothing.
|
|
25
|
-
A ::after above every one of those children cannot be covered by any of
|
|
26
|
-
them, and it is the SAME rule for both halves rather than two that have to
|
|
27
|
-
agree. pointer-events: none so the ring never eats the click it advertises. */
|
|
28
|
-
.loc-part-pick::after {
|
|
29
|
-
content: "";
|
|
30
|
-
position: absolute;
|
|
31
|
-
inset: 0;
|
|
32
|
-
z-index: 30;
|
|
33
|
-
pointer-events: none;
|
|
34
|
-
box-shadow: inset 0 0 0 2px ${ue};
|
|
35
|
-
opacity: 0;
|
|
36
|
-
transition: opacity 120ms ease-out;
|
|
37
|
-
}
|
|
38
|
-
.loc-part-pick:hover::after {
|
|
39
|
-
/* ⚠️ THE RING FADES, ITS COLOUR DOES NOT MIX. Measured in a real editor:
|
|
40
|
-
the accent written as color-mix(in srgb, X 45%, transparent) resolved to
|
|
41
|
-
FULLY TRANSPARENT inside a box-shadow, so the hover ring computed
|
|
42
|
-
correctly and painted nothing — the exact failure this whole change is
|
|
43
|
-
fixing, reproduced one layer down. It used to be an 8-digit hex (the
|
|
44
|
-
accent + "73", 45% of 255); the accent is now a var(), which takes no
|
|
45
|
-
hex suffix. The ::after draws nothing but the ring, so 45% opacity on it
|
|
46
|
-
is the same 45% ring. */
|
|
47
|
-
opacity: 0.45;
|
|
48
|
-
}
|
|
49
|
-
.loc-part-pick[data-selected]::after {
|
|
50
|
-
opacity: 1;
|
|
51
|
-
}
|
|
52
|
-
@media (prefers-reduced-motion: reduce) {
|
|
53
|
-
.loc-part-pick::after { transition: none; }
|
|
54
|
-
}
|
|
55
|
-
`;function F({value:r}){if(typeof r=="string"){const n=r.split(`
|
|
56
|
-
`);return t(P,{children:n.map((p,i)=>a("span",{children:[p,i<n.length-1?t("br",{}):null]},i))})}return t(P,{children:r})}function be(){return t("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"repeating-linear-gradient(45deg, rgba(201,164,97,.05) 0 1px, transparent 1px 14px), linear-gradient(135deg, var(--site-surface-2), var(--site-surface))"},children:a("svg",{width:"34",height:"34",viewBox:"0 0 24 24",fill:"none",stroke:"var(--fg-dim)",strokeWidth:1.4,"aria-hidden":"true",style:{opacity:.4},children:[t("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1.5"}),t("circle",{cx:"8.5",cy:"9.5",r:"1.6"}),t("path",{d:"M21 16l-5-5-4 4-2-2-7 7"})]})})}function xe({sectionNumber:r=S.sectionNumber,heading:n=S.heading,tagline:p=S.tagline,galleryKicker:i=S.galleryKicker,galleryHint:d=S.galleryHint,locations:m=oe,mapTheme:y="auto",imageShape:f,editing:s,nodeId:c}){const[u,b]=R(!1);O(()=>{const e=()=>b(document.documentElement.getAttribute("data-theme")==="light");e();const l=new MutationObserver(e);return l.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>l.disconnect()},[]);const[x,h]=R(null),g=e=>`loc-${e}`,A=e=>{h(e),typeof document<"u"&&document.getElementById(e)?.scrollIntoView({behavior:H(),block:"start"}),!s&&typeof window<"u"&&window.history?.replaceState&&window.history.replaceState(null,"",`#${e}`)};O(()=>{if(typeof window>"u")return;const e=window.location.hash.replace(/^#/,"");!e||!document.getElementById(e)||(h(e),requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({behavior:H(),block:"start"})}))},[]);const L=ce(ie(f)),{select:z,selectedLocationPartId:V}=pe(),X=(e,l)=>c?U(c,e,l):"",M=(e,l)=>!!(s&&c&&V===X(e,l)),T=(e,l)=>s&&c?`${e}:${l}`:void 0,j=ee(null);O(()=>{if(!s||!c)return;const e=j.current;if(!e)return;const k=Array.from(e.querySelectorAll("[data-loc-pick]")).map(o=>{const v=Q(o),w=N=>{const C=o.getAttribute("data-loc-pick")??"",[E,I]=C.split(":");I!=="image"&&I!=="map"||(N.stopPropagation(),N.preventDefault(),z(U(c,Number(E),I)))};return o.addEventListener("click",w,{capture:!0}),()=>{v?.(),o.removeEventListener("click",w,{capture:!0})}});return()=>k.forEach(o=>o())},[s,c,z,m.length]);const W=m.length>0&&(s||m.some(e=>String(e?.photo??"").trim())),Y=m.some(e=>_(Number(e?.lat),Number(e?.lng))),$=le(m,e=>String(e.group??""),e=>String(e.groupName??""));return t("section",{id:"studios",ref:j,className:"scroll-mt-24 border-b border-line py-[100px] max-[1100px]:py-[60px]",style:u?void 0:{background:"var(--section-bg)"},children:a("div",{className:J,children:[t("style",{dangerouslySetInnerHTML:{__html:ge}}),s&&c&&t("style",{dangerouslySetInnerHTML:{__html:fe}}),(r||n||p)&&t(ne,{num:r,title:n?ae(n,!0):void 0,desc:p?B(p):void 0,spaceBelow:"mb-10"}),W&&a("div",{className:"mb-12",children:[(i||d)&&a("div",{className:"mb-5 flex items-baseline justify-between gap-6 border-b border-line pb-4",children:[i&&t(re,{text:i,size:12}),d&&t("span",{className:"font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.22em] text-fg-dim",children:B(d)})]}),t("div",{className:"flex flex-col gap-6",children:$.map((e,l)=>{const k=e.items.length===1;return a("div",{children:[e.key&&t("div",{className:"mb-2.5 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.3em] text-accent",children:e.key}),t("div",{className:["grid gap-[2px] border border-line bg-line",D(e.items.length),e.items.length>1?"max-[700px]:grid-cols-2":""].join(" "),children:e.items.map(({item:o,index:v})=>{const w=String(o?.name??""),N=String(o?.photo??""),C=g(v);return a("a",{href:`#${C}`,"aria-label":`Jump to ${w||"location"} map`,onClick:E=>{E.preventDefault(),A(C)},"data-loc-pick":T(v,"image"),className:["group relative block",L,"overflow-hidden bg-bg outline-none focus-visible:ring-2 focus-visible:ring-accent",k?"max-h-[440px]":"",...T(v,"image")?["loc-part-pick"]:[]].join(" "),"data-selected":M(v,"image")?"":void 0,children:[N?t(K,{src:N,alt:te(w||"Location"),fill:!0,sizes:k?"100vw":"(max-width: 700px) 50vw, 33vw",className:"object-cover grayscale transition-[filter] duration-500 group-hover:grayscale-0"}):t(be,{}),t("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg, transparent 50%, rgba(10,10,10,0.85) 100%)"}}),t("figcaption",{className:"absolute inset-x-0 bottom-0 z-[1] flex items-center justify-start gap-2 px-3 py-3 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.22em] text-overlay-fg/85",children:t("span",{children:w})})]},v)})})]},e.key?`g:${e.key}`:`ungrouped:${l}`)})})]}),$.map((e,l)=>a("div",{className:l===0?"":"mt-10",children:[e.key&&t(de,{groupKey:e.key,name:e.name,count:e.items.length}),t("div",{className:["grid gap-[2px] border border-line bg-line",D(e.items.length),e.items.length>1?"max-[1100px]:grid-cols-1":""].join(" "),children:e.items.map(({item:k,index:o})=>t(ve,{id:g(o),card:k,active:x===g(o),mapTheme:y,mapPick:T(o,"map"),mapSelected:M(o,"map"),editing:s},o))})]},e.key?`g:${e.key}`:`ungrouped:${l}`)),Y&&a("p",{className:"mt-8 text-right font-mono text-[10px] uppercase tracking-[0.25em] text-fg-dim/50",children:["Location coordinates ©"," ",t("a",{href:"https://www.openstreetmap.org/copyright",target:"_blank",rel:"noopener noreferrer",className:"hover:text-accent",children:"OpenStreetMap contributors"})]})]})})}function ve({id:r,card:n,active:p,mapTheme:i,mapPick:d,mapSelected:m,editing:y}){const f=he(n.phone),s=se(n.region),c=String(n.state??"").trim()||s.state,u=String(n.country??"").trim()||s.country,b=[c,u].filter(Boolean).join(" · "),h=_(Number(n.lat),Number(n.lng))||!!y,g=G(String(n.mapsUrl??""),String(n.name??""),c,u);return a("article",{id:r,"data-active":p?"true":void 0,className:h?"contact-loc grid min-h-[840px] scroll-mt-[120px] grid-rows-[auto_1fr] bg-bg max-[1100px]:min-h-0":"contact-loc grid scroll-mt-[120px] bg-bg",children:[a("div",{className:h?"flex min-h-[280px] flex-col gap-3 border-b border-line px-7 py-7":"flex flex-col gap-3 px-7 py-7",children:[a("div",{className:"flex items-start justify-between gap-3.5",children:[a("div",{children:[n.name&&t("div",{className:"font-heading3 text-[length:var(--size-headingSmall,30px)] font-medium uppercase leading-none tracking-[-0.02em]",children:n.name}),b&&t("div",{className:"mt-1.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-accent",children:b})]}),n.timezone&&t("span",{className:"whitespace-nowrap border border-line px-2.5 py-1.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.22em] text-fg-dim",children:n.timezone})]}),n.address!=null&&n.address!==""&&t("div",{className:"mt-1.5 font-display text-[length:var(--size-body,14px)] leading-[1.5] text-fg-dim",children:t(F,{value:n.address})}),n.phone&&t("div",{children:t("a",{href:f,className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg hover:text-accent",children:n.phone})}),n.hours!=null&&n.hours!==""&&t("div",{className:"font-mono text-[length:var(--size-label,12px)] uppercase leading-[1.7] tracking-[0.18em] text-fg-dim",children:t(F,{value:n.hours})}),!h&&g&&t("div",{children:t(q,{href:g})})]}),h&&t(ye,{name:String(n.name??""),state:c,country:u,lat:Number(n.lat),lng:Number(n.lng),mapsUrl:String(n.mapsUrl??""),mapTheme:i,pick:d,selected:m,editing:y})]})}function G(r,n,p,i){return r||(n?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent([n,p,i].filter(Boolean).join(" "))}`:"")}function q({href:r}){return t("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-accent transition-colors hover:text-fg",children:"Get directions ↗"})}function ye({name:r,state:n,country:p,lat:i,lng:d,mapsUrl:m,mapTheme:y="auto",pick:f,selected:s,editing:c}){const u=_(i,d),b=n,x=r||"Location",h=Z(()=>u?[{key:"place",label:x,lat:i,lng:d,glyph:"",tone:""}]:[],[u,x,i,d]),g=G(m,r,n,p),A=a("div",{className:"absolute left-5 top-5 z-10 flex max-w-[64%] flex-col gap-1.5 border border-line bg-bg p-3.5 shadow-[0_8px_24px_rgba(0,0,0,.4)]",children:[a("span",{className:"font-display text-[length:var(--size-body,14px)] font-medium tracking-[-0.01em]",children:[x,b?`, ${b}`:""]}),g&&t(q,{href:g})]}),L=["relative overflow-hidden max-[1100px]:aspect-square",...f?["loc-part-pick"]:[]].join(" ");return u?t("div",{"data-loc-pick":f,"data-selected":s?"":void 0,className:L,children:t(me,{pins:h,mapTheme:y,ariaLabel:x,className:"absolute inset-0",children:A})}):a("div",{"data-loc-pick":f,"data-selected":s?"":void 0,className:`${L} bg-bg`,style:{backgroundImage:"repeating-linear-gradient(45deg, rgba(201,164,97,.04) 0 1px, transparent 1px 14px), repeating-linear-gradient(-45deg, rgba(201,164,97,.04) 0 1px, transparent 1px 14px), linear-gradient(135deg, var(--site-surface-2), var(--site-surface))"},children:[A,c&&t("div",{className:"absolute inset-0 flex items-center justify-center px-6 text-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim/40",children:"Add latitude & longitude"})]})}export{xe as default};
|
|
13
|
+
`;function E({value:r}){if(typeof r=="string"){const n=r.split(`
|
|
14
|
+
`);return t(j,{children:n.map((o,a)=>i("span",{children:[o,a<n.length-1?t("br",{}):null]},a))})}return t(j,{children:r})}function ae(){return t("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"repeating-linear-gradient(45deg, rgba(201,164,97,.05) 0 1px, transparent 1px 14px), linear-gradient(135deg, var(--site-surface-2), var(--site-surface))"},children:i("svg",{width:"34",height:"34",viewBox:"0 0 24 24",fill:"none",stroke:"var(--fg-dim)",strokeWidth:1.4,"aria-hidden":"true",style:{opacity:.4},children:[t("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1.5"}),t("circle",{cx:"8.5",cy:"9.5",r:"1.6"}),t("path",{d:"M21 16l-5-5-4 4-2-2-7 7"})]})})}function oe({sectionNumber:r=y.sectionNumber,heading:n=y.heading,tagline:o=y.tagline,galleryKicker:a=y.galleryKicker,galleryHint:l=y.galleryHint,locations:c=Q,mapTheme:v="auto",imageShape:g,editing:s,nodeId:m}){const[h,f]=T(!1);A(()=>{const e=()=>f(document.documentElement.getAttribute("data-theme")==="light");e();const p=new MutationObserver(e);return p.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>p.disconnect()},[]);const[d,u]=T(null),b=e=>`loc-${e}`,N=e=>{u(e),typeof document<"u"&&document.getElementById(e)?.scrollIntoView({behavior:M(),block:"start"}),!s&&typeof window<"u"&&window.history?.replaceState&&window.history.replaceState(null,"",`#${e}`)};A(()=>{if(typeof window>"u")return;const e=window.location.hash.replace(/^#/,"");!e||!document.getElementById(e)||(u(e),requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({behavior:M(),block:"start"})}))},[]);const U=Z(X(g)),L=(e,p)=>s&&m?`${e}:${p}`:void 0,D=c.length>0&&(s||c.some(e=>String(e?.photo??"").trim())),R=c.some(e=>C(Number(e?.lat),Number(e?.lng))),I=ee(c,e=>String(e.group??""),e=>String(e.groupName??""));return t("section",{id:"studios",className:"scroll-mt-24 border-b border-line py-[100px] max-[1100px]:py-[60px]",style:h?void 0:{background:"var(--section-bg)"},children:i("div",{className:G,children:[t("style",{dangerouslySetInnerHTML:{__html:ie}}),(r||n||o)&&t(J,{num:r,title:n?K(n,!0):void 0,desc:o?O(o):void 0,spaceBelow:"mb-10"}),D&&i("div",{className:"mb-12",children:[(a||l)&&i("div",{className:"mb-5 flex items-baseline justify-between gap-6 border-b border-line pb-4",children:[a&&t(W,{text:a,size:12}),l&&t("span",{className:"font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.22em] text-fg-dim",children:O(l)})]}),t("div",{className:"flex flex-col gap-6",children:I.map((e,p)=>{const k=e.items.length===1;return i("div",{children:[e.key&&t("div",{className:"mb-2.5 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.3em] text-accent",children:e.key}),t("div",{className:["grid gap-[2px] border border-line bg-line",$(e.items.length),e.items.length>1?"max-[700px]:grid-cols-2":""].join(" "),children:e.items.map(({item:x,index:w})=>{const S=String(x?.name??""),z=String(x?.photo??""),_=b(w);return i("a",{href:`#${_}`,"aria-label":`Jump to ${S||"location"} map`,onClick:F=>{F.preventDefault(),N(_)},"data-loc-pick":L(w,"image"),className:["group relative block",U,"overflow-hidden bg-bg outline-none focus-visible:ring-2 focus-visible:ring-accent",k?"max-h-[440px]":""].join(" "),children:[z?t(q,{src:z,alt:V(S||"Location"),fill:!0,sizes:k?"100vw":"(max-width: 700px) 50vw, 33vw",className:"object-cover grayscale transition-[filter] duration-500 group-hover:grayscale-0"}):t(ae,{}),t("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg, transparent 50%, rgba(10,10,10,0.85) 100%)"}}),t("figcaption",{className:"absolute inset-x-0 bottom-0 z-[1] flex items-center justify-start gap-2 px-3 py-3 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.22em] text-overlay-fg/85",children:t("span",{children:S})})]},w)})})]},e.key?`g:${e.key}`:`ungrouped:${p}`)})})]}),I.map((e,p)=>i("div",{className:p===0?"":"mt-10",children:[e.key&&t(te,{groupKey:e.key,name:e.name,count:e.items.length}),t("div",{className:["grid gap-[2px] border border-line bg-line",$(e.items.length),e.items.length>1?"max-[1100px]:grid-cols-1":""].join(" "),children:e.items.map(({item:k,index:x})=>t(se,{id:b(x),card:k,active:d===b(x),mapTheme:v,mapPick:L(x,"map"),editing:s},x))})]},e.key?`g:${e.key}`:`ungrouped:${p}`)),R&&i("p",{className:"mt-8 text-right font-mono text-[10px] uppercase tracking-[0.25em] text-fg-dim/50",children:["Location coordinates ©"," ",t("a",{href:"https://www.openstreetmap.org/copyright",target:"_blank",rel:"noopener noreferrer",className:"hover:text-accent",children:"OpenStreetMap contributors"})]})]})})}function se({id:r,card:n,active:o,mapTheme:a,mapPick:l,editing:c}){const v=re(n.phone),g=Y(n.region),s=String(n.state??"").trim()||g.state,m=String(n.country??"").trim()||g.country,h=[s,m].filter(Boolean).join(" · "),d=C(Number(n.lat),Number(n.lng))||!!c,u=B(String(n.mapsUrl??""),String(n.name??""),s,m);return i("article",{id:r,"data-active":o?"true":void 0,className:d?"contact-loc grid min-h-[840px] scroll-mt-[120px] grid-rows-[auto_1fr] bg-bg max-[1100px]:min-h-0":"contact-loc grid scroll-mt-[120px] bg-bg",children:[i("div",{className:d?"flex min-h-[280px] flex-col gap-3 border-b border-line px-7 py-7":"flex flex-col gap-3 px-7 py-7",children:[i("div",{className:"flex items-start justify-between gap-3.5",children:[i("div",{children:[n.name&&t("div",{className:"font-heading3 text-[length:var(--size-headingSmall,30px)] font-medium uppercase leading-none tracking-[-0.02em]",children:n.name}),h&&t("div",{className:"mt-1.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-accent",children:h})]}),n.timezone&&t("span",{className:"whitespace-nowrap border border-line px-2.5 py-1.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.22em] text-fg-dim",children:n.timezone})]}),n.address!=null&&n.address!==""&&t("div",{className:"mt-1.5 font-display text-[length:var(--size-body,14px)] leading-[1.5] text-fg-dim",children:t(E,{value:n.address})}),n.phone&&t("div",{children:t("a",{href:v,className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg hover:text-accent",children:n.phone})}),n.hours!=null&&n.hours!==""&&t("div",{className:"font-mono text-[length:var(--size-label,12px)] uppercase leading-[1.7] tracking-[0.18em] text-fg-dim",children:t(E,{value:n.hours})}),!d&&u&&t("div",{children:t(H,{href:u})})]}),d&&t(le,{name:String(n.name??""),state:s,country:m,lat:Number(n.lat),lng:Number(n.lng),mapsUrl:String(n.mapsUrl??""),mapTheme:a,pick:l,editing:c})]})}function B(r,n,o,a){return r||(n?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent([n,o,a].filter(Boolean).join(" "))}`:"")}function H({href:r}){return t("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.24em] text-accent transition-colors hover:text-fg",children:"Get directions ↗"})}function le({name:r,state:n,country:o,lat:a,lng:l,mapsUrl:c,mapTheme:v="auto",pick:g,editing:s}){const m=C(a,l),h=n,f=r||"Location",d=P(()=>m?[{key:"place",label:f,lat:a,lng:l,glyph:"",tone:""}]:[],[m,f,a,l]),u=B(c,r,n,o),b=i("div",{className:"absolute left-5 top-5 z-10 flex max-w-[64%] flex-col gap-1.5 border border-line bg-bg p-3.5 shadow-[0_8px_24px_rgba(0,0,0,.4)]",children:[i("span",{className:"font-display text-[length:var(--size-body,14px)] font-medium tracking-[-0.01em]",children:[f,h?`, ${h}`:""]}),u&&t(H,{href:u})]}),N="relative overflow-hidden max-[1100px]:aspect-square";return m?t("div",{"data-loc-pick":g,className:N,children:t(ne,{pins:d,mapTheme:v,ariaLabel:f,className:"absolute inset-0",children:b})}):i("div",{"data-loc-pick":g,className:`${N} bg-bg`,style:{backgroundImage:"repeating-linear-gradient(45deg, rgba(201,164,97,.04) 0 1px, transparent 1px 14px), repeating-linear-gradient(-45deg, rgba(201,164,97,.04) 0 1px, transparent 1px 14px), linear-gradient(135deg, var(--site-surface-2), var(--site-surface))"},children:[b,s&&t("div",{className:"absolute inset-0 flex items-center justify-center px-6 text-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim/40",children:"Add latitude & longitude"})]})}export{oe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PadValues } from "
|
|
1
|
+
import { type PadValues } from "../lib/content/section-padding.js";
|
|
2
2
|
import { type DividerSpacing, type DividerStyle } from "../../format/lib/sections/divider-style.js";
|
|
3
3
|
interface DividerProps {
|
|
4
4
|
spacing: DividerSpacing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as b}from"react/jsx-runtime";import h from"./BlockFrame.js";import{sectionPadAttrs as y}from"../lib/content/section-padding.js";import{finiteNumber as a}from"../../format/lib/finite-number.js";import{DEFAULT_DIVIDER_STYLE as p,DIVIDER_SPACE_PX as P,STRIPE_BAND_HEIGHT_PX as N,parseDividerSpacing as _,parseDividerStyle as g,stripeBackground as I}from"../../format/lib/sections/divider-style.js";const D=1,E=100;function x(t,o,s){const e={};return!s&&typeof t=="number"&&t!==D&&(e.borderTopWidth=t),typeof o=="number"&&o<E&&(e.width=`${o}%`),Object.keys(e).length?e:void 0}const B={sm:"my-6",md:"my-12",lg:"my-20"},u=(...t)=>t.some(o=>a(o)!==void 0);function S(t,o,s){const e=s||u(o.top,o.topTablet,o.topPhone),n=s||u(o.bottom,o.bottomTablet,o.bottomPhone),m=u(o.left,o.right,o.leftTablet,o.rightTablet,o.leftPhone,o.rightPhone);if(!e&&!n&&!m)return null;const r=P[t],i=y({...o,top:e?a(o.top)??r:void 0,bottom:n?a(o.bottom)??r:void 0,topTablet:e?o.topTablet:void 0,bottomTablet:n?o.bottomTablet:void 0,topPhone:e?o.topPhone:void 0,bottomPhone:n?o.bottomPhone:void 0}),l={...i?.style};return e||(l.marginTop=r),n||(l.marginBottom=r),{className:i?.className??"",style:l}}function A({spacing:t,contained:o,style:s=p,thickness:e,lengthPct:n,hideOnMobile:m=!1,pad:r={}}){const i=g(s),l=_(t),c=I(i),d=x(e,n,!!c),f=S(l,r,i==="none"),T=[f?f.className:B[l],m?"max-[800px]:hidden":""].filter(Boolean).join(" ");return b(h,{contained:o,className:T,style:f?.style,children:i==="none"?null:c?b("hr",{className:"border-x-0 border-y border-line",style:{height:N,backgroundImage:c,...d}}):b("hr",{className:"border-0 border-t border-line",style:d})})}export{A as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
2
|
-
`).split(/\n[ \t]*\n/))
|
|
3
|
-
`).map(a=>a.replace(/\s+$/,"")).filter(a=>a.trim()!=="").forEach((a,
|
|
4
|
-
${a}`:s.push({type:"p",text:a})});return s}const
|
|
1
|
+
import{jsx as r,jsxs as m}from"react/jsx-runtime";import{slugify as u}from"efficient-shell/format";import{renderGold as c}from"./goldPhrases.js";import{storefrontLines as y}from"../../format/lib/markup.js";import{say as p}from"../../format/lib/editor-words.js";function v(i,s){return u(i)||`section-${s+1}`}function w(i){const s=[];for(const f of i.replace(/\r\n?/g,`
|
|
2
|
+
`).split(/\n[ \t]*\n/))f.split(`
|
|
3
|
+
`).map(a=>a.replace(/\s+$/,"")).filter(a=>a.trim()!=="").forEach((a,d)=>{const x=y(a)[0].bullet,n=s.at(-1),e=d===0||!n||n.type==="ul"!==x;if(x){const t=a.slice(2);!e&&n?.type==="ul"?n.items.push(t):s.push({type:"ul",items:[t]})}else!e&&n?.type==="p"?n.text+=`
|
|
4
|
+
${a}`:s.push({type:"p",text:a})});return s}const N=()=>[{label:p("First section"),heading:p("Your *first* section."),body:p(`Write the opening paragraph here.
|
|
5
5
|
|
|
6
6
|
- Start a line with a dash for a bullet.
|
|
7
|
-
- Add as many as you like.`)},{label:p("Second section"),heading:p("Your *second* section."),body:p("Leave a blank line between paragraphs to start a new one.")}],
|
|
7
|
+
- Add as many as you like.`)},{label:p("Second section"),heading:p("Your *second* section."),body:p("Leave a blank line between paragraphs to start a new one.")}],S=120;function k({tocTitle:i,sections:s,editing:f=!1,stickyTop:h=S}){const a=(s??[]).filter(e=>(e.heading??"").trim()!==""||(e.label??"").trim()!==""||(e.body??"").trim()!=="");if(a.length===0&&!f)return null;const d=a.length===0&&f?N():a,x=new Set,n=d.map((e,t)=>{const o=v(e.label||e.heading||"",t);let l=o,g=2;for(;x.has(l);)l=`${o}-${g++}`;return x.add(l),l});return r("section",{className:"relative z-[2] bg-bg",children:m("div",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[240px_1fr] items-start gap-20 border-b border-line px-[var(--sf-site-gutter,40px)] py-20 max-[900px]:grid-cols-1 max-[900px]:gap-10 max-[900px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[900px]:py-[60px]",children:[m("aside",{className:"sticky flex flex-col self-start max-[900px]:static",style:{top:h},children:[i&&r("h4",{className:"mb-[18px] font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-accent",children:c(i)}),d.map((e,t)=>m("a",{href:`#${n[t]}`,className:`flex items-center justify-between gap-3 border-b border-line py-2.5 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim transition-colors hover:text-fg${t===0?" border-t":""}`,children:[r("span",{children:c(e.label||"Section")}),r("span",{className:"text-accent",children:String(t+1).padStart(2,"0")})]},n[t]))]}),r("div",{className:"flex flex-col gap-16",children:d.map((e,t)=>m("article",{id:n[t],className:"flex flex-col gap-[18px]",style:{scrollMarginTop:h},children:[m("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-accent",children:[String(t+1).padStart(2,"0")," · ",c(e.label||"Section")]}),e.heading&&r("h2",{className:"mb-2 border-b border-line pb-[18px] font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3.5vw,44px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[1.04] tracking-[-0.025em]",children:c(e.heading)}),w(e.body??"").map((o,l)=>o.type==="ul"?r("ul",{className:"flex max-w-[680px] list-none flex-col gap-2.5 pl-0",children:o.items.map((g,b)=>r("li",{className:"relative pl-6 font-serif text-[length:var(--size-body,17px)] leading-[1.65] text-fg-dim before:absolute before:-top-0.5 before:left-1.5 before:text-[length:var(--size-body,24px)] before:leading-none before:text-accent before:content-['·']",children:c(g)},b))},l):r("p",{className:"max-w-[680px] font-serif text-[length:var(--size-body,17px)] leading-[1.7] text-fg-dim",children:c(o.text)},l))]},n[t]))})]})})}export{k as default,v as sectionAnchorId};
|