efficient-storefront-blocks 0.125.0 → 0.125.2
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 +29 -0
- package/dist/chunks/{CustomHtmlCodeWindow-ROUI64CY.js → CustomHtmlCodeWindow-VRZ524JP.js} +1 -1
- package/dist/chunks/{EditorPreviewCheckout-F2HXHGBN.js → EditorPreviewCheckout-3TKWZ44N.js} +1 -1
- package/dist/chunks/SiteEditorProvider-OBXLJM7I.js +1 -0
- package/dist/chunks/chunk-4KN3VTQU.js +7 -0
- package/dist/chunks/{chunk-MU65AZLZ.js → chunk-6ABZ7XWF.js} +1 -1
- package/dist/chunks/{chunk-ESVLXH7T.js → chunk-FNCEZSDY.js} +1 -1
- package/dist/chunks/{chunk-2KEZPQPW.js → chunk-HQFRQZ6J.js} +1 -1
- package/dist/chunks/chunk-J6SPMJBT.js +337 -0
- package/dist/chunks/{chunk-T2LZCAFH.js → chunk-PULBLZRR.js} +1 -1
- package/dist/chunks/{chunk-O3YXHDC6.js → chunk-TVMCJUOE.js} +1 -1
- package/dist/chunks/{fitment-data-X7PIIXMU.js → fitment-data-C2NHZBPR.js} +1 -1
- package/dist/chunks/{section-css-style-Q23EN42Q.js → section-css-style-BECHWIDU.js} +1 -1
- package/dist/contract.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/lib/efficient-block-sources.js +1 -1
- package/dist/index.js +27 -27
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/HeaderToolBlocks.d.ts +2 -1
- package/dist/render/components/HeaderToolBlocks.js +1 -1
- package/dist/render/components/HeaderTools.d.ts +2 -1
- package/dist/render/components/card-pieces/HeadlineName.js +1 -1
- package/dist/render/lib/content/header-bar.d.ts +1 -0
- package/dist/render/lib/content/header-bar.js +1 -1
- package/dist/render/lib/document/linked-hero-hydrate.d.ts +2 -1
- package/dist/render/lib/document/linked-hero-hydrate.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +4 -0
- package/dist/words.js +3 -3
- package/package.json +4 -4
- package/dist/chunks/SiteEditorProvider-B7766ULW.js +0 -1
- package/dist/chunks/chunk-SEA3MICI.js +0 -7
- package/dist/chunks/chunk-WWQ5LOLU.js +0 -337
- /package/dist/chunks/{chunk-AUQZLQEO.js → chunk-7UJXVH57.js} +0 -0
- /package/dist/chunks/{chunk-NMB6BD73.js → chunk-EZ5QLDA5.js} +0 -0
- /package/dist/chunks/{chunk-ESVLXH7T.js.LEGAL.txt → chunk-FNCEZSDY.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-WWQ5LOLU.js.LEGAL.txt → chunk-J6SPMJBT.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-KFZLLS45.js → chunk-UV27QVUD.js} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CountryShowAs } from "../lib/content/country-show-as.js";
|
|
2
2
|
import type { HeaderUtilStyle } from "../lib/content/header-bar.js";
|
|
3
3
|
export type ToolStyle = HeaderUtilStyle;
|
|
4
|
-
export
|
|
4
|
+
export declare const SEARCH_STYLES: readonly ["icon", "text", "icon_text"];
|
|
5
|
+
export type SearchStyle = (typeof SEARCH_STYLES)[number];
|
|
5
6
|
export declare function SearchTool({ style, stylePhone, editing }: {
|
|
6
7
|
style?: SearchStyle;
|
|
7
8
|
stylePhone?: SearchStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{useCart as m}from"./CartContext.js";import h,{useCountrySelectShows as p}from"./CountrySelect.js";import{AccountButton as f,CartButton as x,SearchButton as a}from"./HeaderTools.js";import d from"./ThemeToggle.js";import{useOfferToPhoneMenu as s}from"efficient-web-builder/render/components/PhoneMenuTools";import{useSearch as S}from"./SearchContext.js";import{useSiteSells as u,useSiteThemeSwitchShown as T}from"./SiteRecordContext.js";import{HideTaker as c}from"efficient-web-builder/render/components/ViewHideRoot";import{parseOption as w}from"efficient-shell/format";const C=["icon","text","icon_text"];function O({style:e="icon",stylePhone:o,editing:n=!1}){const{open:r}=S(),i=u(),l=w(C,"",o)||void 0;return s(i&&!l?"search":null),i?l?t(c,{as:"span",className:"contents",children:t(a,{onClick:n?void 0:r,asText:e==="text",withWord:e==="icon_text",phoneLook:l})}):t(c,{as:"span","data-phone-menu-tool":"search",className:"contents",children:t(a,{onClick:n?void 0:r,asText:e==="text",withWord:e==="icon_text"})}):null}function V({style:e="icon",editing:o=!1}){const{open:n,totals:r}=m();return u()?t(x,{onClick:o?()=>{}:n,count:r.sets,asText:e==="text",takesViewHide:!0}):null}function W({style:e="icon"}){const o=u();return s(o?"account":null),o?t(f,{asText:e==="text",takesViewHide:!0}):null}function M(){const e=T();return s(e?"theme":null),e?t(c,{as:"span","data-phone-menu-tool":"theme",className:"contents",children:t(d,{})}):null}function P({showAs:e}){const o=p();return s(o?"region":null),o?t(c,{as:"span","data-phone-menu-tool":"region",className:"contents",children:t(h,{showAs:e})}):null}export{W as AccountTool,V as CartTool,P as CountrySwitchTool,C as SEARCH_STYLES,O as SearchTool,M as ThemeSwitchTool};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SearchStyle } from "./HeaderToolBlocks.js";
|
|
1
2
|
import { type ReactNode } from "react";
|
|
2
3
|
export declare const UTIL_WORDS: {
|
|
3
4
|
readonly search: "Search";
|
|
@@ -23,6 +24,6 @@ export declare function SearchButton({ onClick, asText, withWord, phoneLook, cla
|
|
|
23
24
|
onClick?: () => void;
|
|
24
25
|
asText?: boolean;
|
|
25
26
|
withWord?: boolean;
|
|
26
|
-
phoneLook?:
|
|
27
|
+
phoneLook?: SearchStyle;
|
|
27
28
|
className?: string;
|
|
28
29
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as
|
|
1
|
+
"use client";import{jsxs as s,Fragment as m,jsx as r}from"react/jsx-runtime";import{HideTaker as d}from"efficient-web-builder/render/components/ViewHideRoot";import{PART_SIZE_CAP_VAR as f,partCanvasDeclarations as h,regionSheetStyle as p}from"efficient-web-builder/render/lib/document/part-styles";import{VIEW_TIERS as g}from"efficient-easel/screen/lib/content/view-tiers";import{textRegionPartKey as o}from"efficient-web-builder/format/lib/sections/text-regions";import{RegionBridge as x,RegionWords as E,regionAttr as S}from"./card-text-region.js";const _=.72;function u(e,n=!0){const t=e.trim().split(/\s+/).filter(Boolean);if(t.length===0)return;const i=t.map((a,c)=>a.length+(n&&t.length>1&&c===t.length-1?1:0));return`calc(100cqi / ${(Math.max(...i)*_).toFixed(2)})`}const l="text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))]",A=`font-heading2 ${l} [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]`,N=l,y=e=>p(e?.partStyles?.[o("name")])?.textStyle!==void 0,v=e=>{const n=e?.partStyles?.[o("name")];return!!n&&g.some(t=>!!h(n,t).fontSize)},w=(e,n)=>({"--hero-name-fit":e,...e&&n?{[f]:e}:{}});function R({name:e,accentLastWord:n,region:t}){const i=n?e.lastIndexOf(" "):-1,a=r(E,{region:t,at:"name",children:i===-1?e:s(m,{children:[e.slice(0,i)," ",s("em",{className:"font-normal italic text-accent",children:[e.slice(i+1),"."]})]})});return r(x,{region:t,sectionType:"ProductName",children:r(d,{as:"div",className:"w-full [container-type:inline-size]",children:r("h1",{...S(t,"name"),className:y(t)?N:A,style:w(u(e,n),v(t)),children:a})})})}export{R as default};
|
|
@@ -20,6 +20,7 @@ export declare const HEADER_UTIL_STYLES: readonly [{
|
|
|
20
20
|
readonly value: "text";
|
|
21
21
|
}];
|
|
22
22
|
export type HeaderUtilStyle = (typeof HEADER_UTIL_STYLES)[number]["value"];
|
|
23
|
+
export declare const HEADER_UTIL_STYLE_FALLBACK = "icon";
|
|
23
24
|
export declare const resolveUtilStyle: (v: unknown) => HeaderUtilStyle;
|
|
24
25
|
export type HeaderMenuRow = "top" | "inline";
|
|
25
26
|
export declare const HEADER_MENU_ROWS: readonly [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HEADER_HEIGHT_PX as o}from"efficient-web-builder/render/lib/document/header-clearance";import{parseOption as t}from"efficient-shell/format";function i(e){return typeof e=="number"&&Number.isInteger(e)&&e>=o.min&&e<=o.max?e:o.default}const
|
|
1
|
+
import{HEADER_HEIGHT_PX as o}from"efficient-web-builder/render/lib/document/header-clearance";import{parseOption as t}from"efficient-shell/format";function i(e){return typeof e=="number"&&Number.isInteger(e)&&e>=o.min&&e<=o.max?e:o.default}const c="fixed inset-x-0 bottom-0 top-[var(--sf-header-h,88px)]",_=e=>!!e&&e.startsWith("/wheels/")&&e!=="/wheels",x=(e,r)=>!e&&r?"var(--section-bg)":"var(--bg)",l=[{label:"Uppercase",value:"uppercase"},{label:"Capitalised",value:"capitalised"}],n="uppercase",A=e=>t(l,n,e),s=[{label:"Icon",value:"icon"},{label:"Text",value:"text"}],a="icon",u=e=>t(s,a,e),H=[{label:"Own row",value:"top"},{label:"Same row",value:"inline"}],S="top",b=e=>e==="inline"?"inline":e==="top"||e==="bottom"?"top":null;export{H as HEADER_MENU_ROWS,S as HEADER_MENU_ROW_FALLBACK,l as HEADER_NAV_TEXT_CASES,n as HEADER_NAV_TEXT_CASE_FALLBACK,s as HEADER_UTIL_STYLES,a as HEADER_UTIL_STYLE_FALLBACK,c as UNDER_HEADER_SHEET_CLASS,x as headerSolidBackground,_ as isProductPage,i as resolveHeaderHeightPx,b as resolveMenuRow,A as resolveNavTextCase,u as resolveUtilStyle};
|
|
@@ -7,8 +7,9 @@ export type LinkedHeroRecord = {
|
|
|
7
7
|
kind: "tyre";
|
|
8
8
|
tyre: Tyre;
|
|
9
9
|
};
|
|
10
|
+
declare const LINKED_HERO_KINDS: readonly ["wheel", "tyre"];
|
|
10
11
|
export interface LinkedHeroSource {
|
|
11
|
-
kind:
|
|
12
|
+
kind: (typeof LINKED_HERO_KINDS)[number];
|
|
12
13
|
slug: string;
|
|
13
14
|
}
|
|
14
15
|
export declare const LINKED_HERO_RECORD_PROP = "linkedRecord";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PRODUCT_HERO_TYPE as
|
|
1
|
+
import{parseOption as p}from"efficient-shell/format";import{PRODUCT_HERO_TYPE as f,documentNodes as d,mapDocumentNodes as s}from"./document-nodes.js";const l=["wheel","tyre"],u="linkedRecord";function i(r){if(r?.type!==f)return null;const e=r.props?.source;return typeof e?.slug!="string"||!e.slug?null:{kind:p(l,"wheel",e.kind),slug:e.slug}}function g(r,e,n){const t=r;if(!t||t.kind!==e)return;const o=e==="tyre"?t.tyre:t.wheel;return o&&typeof o=="object"&&o.slug===n?t:void 0}function k(r){const e=[];for(const n of d(r)){const t=i(n);t&&!e.some(o=>o.kind===t.kind&&o.slug===t.slug)&&e.push(t)}return e}function h(r){return k(r).length>0}function O(r,e){return e.length===0?r:s(r,n=>{const t=i(n);if(!t)return n;const o=e.find(c=>g(c,t.kind,t.slug));return o?{...n,props:{...n.props??{},[u]:o}}:n})}function R(r){if(!r?.props||!(u in r.props))return r;const{[u]:e,...n}=r.props;return{...r,props:n}}function _(r){return s(r,e=>R(e))}export{u as LINKED_HERO_RECORD_PROP,O as hydrateLinkedHeroes,k as linkedHeroSources,g as matchingLinkedRecord,h as pageHasLinkedHero,R as stripLinkedHeroRecord,_ as stripLinkedHeroRecords};
|