@tanqory/theme-kit 0.1.0 → 2.0.0-alpha.3
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/LICENSE +21 -0
- package/README.md +98 -10
- package/dist/abi/canvas-live.d.ts +49 -0
- package/dist/abi/canvas-live.js +88 -0
- package/dist/abi/cart.d.ts +48 -0
- package/dist/abi/cart.js +256 -0
- package/dist/abi/convert.d.ts +126 -0
- package/dist/abi/convert.js +493 -0
- package/dist/abi/data-api.d.ts +11 -0
- package/dist/abi/data-api.js +178 -0
- package/dist/abi/jcs.d.ts +6 -0
- package/dist/abi/jcs.js +28 -0
- package/dist/abi/page-data.d.ts +198 -0
- package/dist/abi/page-data.js +577 -0
- package/dist/abi/page.d.ts +23 -0
- package/dist/abi/page.js +46 -0
- package/dist/abi/referrals.d.ts +23 -0
- package/dist/abi/referrals.js +89 -0
- package/dist/abi/rewards.d.ts +27 -0
- package/dist/abi/rewards.js +82 -0
- package/dist/abi/seo.d.ts +47 -0
- package/dist/abi/seo.js +68 -0
- package/dist/abi/shell.d.ts +22 -0
- package/dist/abi/shell.js +10 -0
- package/dist/abi/wire.d.ts +38 -0
- package/dist/abi/wire.js +84 -0
- package/dist/build.d.ts +113 -0
- package/dist/build.js +294 -0
- package/dist/client.d.ts +19 -0
- package/dist/client.js +76 -0
- package/dist/contract.d.ts +6 -0
- package/dist/contract.js +6 -0
- package/dist/headless/ai.d.ts +132 -0
- package/dist/headless/ai.js +99 -0
- package/dist/headless/hooks.d.ts +273 -0
- package/dist/headless/hooks.js +533 -0
- package/dist/headless/i18n.d.ts +13 -0
- package/dist/headless/i18n.js +45 -0
- package/dist/headless/index.d.ts +36 -0
- package/dist/headless/index.js +38 -0
- package/dist/headless/money.d.ts +25 -0
- package/dist/headless/money.js +61 -0
- package/dist/headless/page.d.ts +43 -0
- package/dist/headless/page.js +53 -0
- package/dist/headless/platform.d.ts +55 -0
- package/dist/headless/platform.js +77 -0
- package/dist/headless/primitives/cart.d.ts +90 -0
- package/dist/headless/primitives/cart.js +153 -0
- package/dist/headless/primitives/collection.d.ts +68 -0
- package/dist/headless/primitives/collection.js +80 -0
- package/dist/headless/primitives/product.d.ts +101 -0
- package/dist/headless/primitives/product.js +117 -0
- package/dist/headless/primitives/storefront.d.ts +106 -0
- package/dist/headless/primitives/storefront.js +186 -0
- package/dist/headless/primitives/util.d.ts +19 -0
- package/dist/headless/primitives/util.js +42 -0
- package/dist/headless/strings.d.ts +9 -0
- package/dist/headless/strings.js +186 -0
- package/dist/headless/structured-data.d.ts +31 -0
- package/dist/headless/structured-data.js +57 -0
- package/dist/headless/theme.d.ts +99 -0
- package/dist/headless/theme.js +54 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +18 -553
- package/dist/runtime/data/StoreProvider.d.ts +56 -0
- package/dist/runtime/data/StoreProvider.js +308 -0
- package/dist/runtime/data/handle.d.ts +14 -0
- package/dist/runtime/data/handle.js +16 -0
- package/dist/runtime/data/routes.d.ts +87 -0
- package/dist/runtime/data/routes.js +154 -0
- package/dist/runtime/data/to-ui.d.ts +237 -0
- package/dist/runtime/data/to-ui.js +759 -0
- package/dist/runtime/entries/register.d.ts +9 -0
- package/dist/runtime/entries/register.js +9 -0
- package/dist/runtime/entries/sections.d.ts +16 -0
- package/dist/runtime/entries/sections.js +19 -0
- package/dist/{types → runtime/kit}/SectionTree.d.ts +2 -1
- package/dist/runtime/kit/SectionTree.js +100 -0
- package/dist/runtime/kit/analytics.d.ts +63 -0
- package/dist/runtime/kit/analytics.js +233 -0
- package/dist/runtime/kit/cart.d.ts +167 -0
- package/dist/runtime/kit/cart.js +544 -0
- package/dist/{types → runtime/kit}/composition.d.ts +1 -1
- package/dist/runtime/kit/composition.js +3 -0
- package/dist/{types → runtime/kit}/config.d.ts +2 -2
- package/dist/runtime/kit/config.js +6 -0
- package/dist/runtime/kit/consent.d.ts +29 -0
- package/dist/runtime/kit/consent.js +159 -0
- package/dist/runtime/kit/contract/content.d.ts +164 -0
- package/dist/runtime/kit/contract/content.js +83 -0
- package/dist/runtime/kit/contract/field-types.d.ts +290 -0
- package/dist/runtime/kit/contract/field-types.js +129 -0
- package/dist/runtime/kit/contract/groups.d.ts +230 -0
- package/dist/runtime/kit/contract/groups.js +402 -0
- package/dist/runtime/kit/contract/index.d.ts +33 -0
- package/dist/runtime/kit/contract/index.js +33 -0
- package/dist/runtime/kit/contract/transform.d.ts +82 -0
- package/dist/runtime/kit/contract/transform.js +133 -0
- package/dist/runtime/kit/contract/validate.d.ts +67 -0
- package/dist/runtime/kit/contract/validate.js +388 -0
- package/dist/{types → runtime/kit}/data.d.ts +276 -7
- package/dist/runtime/kit/data.js +1117 -0
- package/dist/{types → runtime/kit}/defineSection.d.ts +1 -1
- package/dist/runtime/kit/defineSection.js +10 -0
- package/dist/{types → runtime/kit}/dynamic-source.d.ts +4 -4
- package/dist/runtime/kit/dynamic-source.js +143 -0
- package/dist/runtime/kit/index.d.ts +24 -0
- package/dist/runtime/kit/index.js +24 -0
- package/dist/{types → runtime/kit}/jsx-to-json.d.ts +1 -1
- package/dist/runtime/kit/jsx-to-json.js +28 -0
- package/dist/{types → runtime/kit}/mount.d.ts +25 -4
- package/dist/runtime/kit/mount.js +124 -0
- package/dist/{types → runtime/kit}/registry.d.ts +1 -1
- package/dist/runtime/kit/registry.js +12 -0
- package/dist/{types → runtime/kit}/ssg.d.ts +9 -3
- package/dist/runtime/kit/ssg.js +56 -0
- package/dist/{types → runtime/kit}/storefront.d.ts +206 -7
- package/dist/runtime/kit/storefront.js +723 -0
- package/dist/{types → runtime/kit}/theme-context.d.ts +8 -2
- package/dist/runtime/kit/theme-context.js +25 -0
- package/dist/runtime/kit/types.d.ts +142 -0
- package/dist/runtime/kit/types.js +1 -0
- package/dist/runtime/platform/TrackingPixels.d.ts +14 -0
- package/dist/runtime/platform/TrackingPixels.js +63 -0
- package/dist/runtime/platform/environment.d.ts +68 -0
- package/dist/runtime/platform/environment.js +85 -0
- package/dist/runtime/platform/locale.d.ts +27 -0
- package/dist/runtime/platform/locale.js +42 -0
- package/dist/runtime/platform/route-analytics.d.ts +15 -0
- package/dist/runtime/platform/route-analytics.js +72 -0
- package/dist/runtime/platform/safe-href.d.ts +25 -0
- package/dist/runtime/platform/safe-href.js +69 -0
- package/dist/runtime/platform/safe-values.d.ts +37 -0
- package/dist/runtime/platform/safe-values.js +140 -0
- package/dist/runtime/render/SectionRenderer.d.ts +4 -0
- package/dist/runtime/render/SectionRenderer.js +111 -0
- package/dist/runtime/render/listing-query.d.ts +47 -0
- package/dist/runtime/render/listing-query.js +114 -0
- package/dist/runtime/render/localized-copy.d.ts +86 -0
- package/dist/runtime/render/localized-copy.js +129 -0
- package/dist/runtime/render/product-listing.d.ts +11 -0
- package/dist/runtime/render/product-listing.js +240 -0
- package/dist/runtime/render/section-actions.d.ts +44 -0
- package/dist/runtime/render/section-actions.js +169 -0
- package/dist/runtime/render/starter.d.ts +11 -0
- package/dist/runtime/render/starter.js +81 -0
- package/dist/runtime/seo/head.d.ts +87 -0
- package/dist/runtime/seo/head.js +224 -0
- package/dist/runtime/seo/structured-data.d.ts +22 -0
- package/dist/runtime/seo/structured-data.js +115 -0
- package/dist/runtime/shell/PageShell.d.ts +18 -0
- package/dist/runtime/shell/PageShell.js +113 -0
- package/dist/runtime/shell/RuntimeBridge.d.ts +14 -0
- package/dist/runtime/shell/RuntimeBridge.js +82 -0
- package/dist/runtime/shell/overlay-state.d.ts +31 -0
- package/dist/runtime/shell/overlay-state.js +59 -0
- package/dist/runtime/shell/preview-mode.d.ts +2 -0
- package/dist/runtime/shell/preview-mode.js +11 -0
- package/dist/runtime/shell/spa-router.d.ts +14 -0
- package/dist/runtime/shell/spa-router.js +76 -0
- package/dist/runtime/shell/url-redirects.d.ts +6 -0
- package/dist/runtime/shell/url-redirects.js +37 -0
- package/dist/runtime/slots.d.ts +74 -0
- package/dist/runtime/slots.js +16 -0
- package/dist/runtime.d.ts +34 -0
- package/dist/runtime.js +40 -0
- package/dist/sdk/index.d.ts +24 -0
- package/dist/sdk/index.js +24 -0
- package/dist/sdk/referrals.d.ts +62 -0
- package/dist/sdk/referrals.js +20 -0
- package/dist/sdk/rewards.d.ts +85 -0
- package/dist/sdk/rewards.js +29 -0
- package/dist/sdk/runtime-context.d.ts +120 -0
- package/dist/sdk/runtime-context.js +73 -0
- package/dist/sdk/schema.d.ts +197 -0
- package/dist/sdk/schema.js +121 -0
- package/dist/sdk/server-render.d.ts +8 -0
- package/dist/sdk/server-render.js +12 -0
- package/dist/sdk/store-lookup.d.ts +27 -0
- package/dist/sdk/store-lookup.js +29 -0
- package/dist/sdk/store.d.ts +115 -0
- package/dist/sdk/store.js +1 -0
- package/dist/sdk/sx.d.ts +40 -0
- package/dist/sdk/sx.js +112 -0
- package/dist/sdk/theme.d.ts +152 -0
- package/dist/sdk/theme.js +10 -0
- package/dist/sdk/types.d.ts +395 -0
- package/dist/sdk/types.js +7 -0
- package/dist/server.d.ts +65 -0
- package/dist/server.js +370 -0
- package/docs/headless-api.md +220 -0
- package/package.json +77 -23
- package/dist/index.js.map +0 -1
- package/dist/ssg-BZ5FYTw7.js +0 -1802
- package/dist/ssg-BZ5FYTw7.js.map +0 -1
- package/dist/ssg.js +0 -8
- package/dist/ssg.js.map +0 -1
- package/dist/types/cart.d.ts +0 -86
- package/dist/types/editor.d.ts +0 -5
- package/dist/types/index.d.ts +0 -20
- package/dist/types/preview-bridge.d.ts +0 -9
- package/dist/types/types.d.ts +0 -44
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime shapes → UI shapes.
|
|
3
|
+
*
|
|
4
|
+
* app/platform/tanqory (DataApi · storefront · cart) ──► to-ui.ts ──► ui/types
|
|
5
|
+
*
|
|
6
|
+
* Every function here is PURE and TOTAL: no fetching, no globals, no throwing on
|
|
7
|
+
* a missing optional field. The runtime's payloads are partial by design — a
|
|
8
|
+
* card listing has no variants, the offline fixture has no ids or image
|
|
9
|
+
* dimensions, an older payload has no languages — so every read is guarded.
|
|
10
|
+
*
|
|
11
|
+
* Two rules decide what an absent value becomes:
|
|
12
|
+
* - A UI field that is optional (or nullable) stays undefined / null.
|
|
13
|
+
* - A UI field that is required gets the documented empty value ('' / [] / 0),
|
|
14
|
+
* never a made-up one. Nothing here invents a price, stock level, rating,
|
|
15
|
+
* review, badge or policy text.
|
|
16
|
+
*
|
|
17
|
+
* Money keeps the precision the backend sent: the runtime carries decimal
|
|
18
|
+
* strings ("5000" for JPY, "8.750" for KWD); the UI carries numbers and lets
|
|
19
|
+
* Intl pick the decimals when it formats. Nothing here rounds.
|
|
20
|
+
*/
|
|
21
|
+
import type * as R from '../kit/data.js';
|
|
22
|
+
import type * as S from '../kit/storefront.js';
|
|
23
|
+
import type * as C from '../kit/cart.js';
|
|
24
|
+
import type * as UI from '../../sdk/index.js';
|
|
25
|
+
export declare const productUrl: (handle: string) => string;
|
|
26
|
+
export declare const collectionUrl: (handle: string) => string;
|
|
27
|
+
export declare const pageUrl: (handle: string) => string;
|
|
28
|
+
export declare const blogUrl: (handle: string) => string;
|
|
29
|
+
export declare const articleUrl: (blogHandle: string, articleHandle: string) => string;
|
|
30
|
+
export declare const policyUrl: (handle: string) => string;
|
|
31
|
+
type ImageLike = {
|
|
32
|
+
url?: string | null;
|
|
33
|
+
altText?: string | null;
|
|
34
|
+
width?: number | null;
|
|
35
|
+
height?: number | null;
|
|
36
|
+
} | null | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* A runtime image → Image, or null when there is no URL.
|
|
39
|
+
*
|
|
40
|
+
* `width`/`height` are required by the UI type but optional in the runtime (the
|
|
41
|
+
* offline fixture, collection images, article images and the theme logo setting
|
|
42
|
+
* carry none). An unknown dimension is `0` — "unknown", never a guessed size.
|
|
43
|
+
* UI images are CSS-sized (`width:100%; height:100%; object-fit`), and a
|
|
44
|
+
* `0 / 0` aspect-ratio is invalid CSS, so the frame keeps its own ratio.
|
|
45
|
+
*/
|
|
46
|
+
export declare function toImage(img: ImageLike): UI.Image | null;
|
|
47
|
+
/** Decimal string → number, keeping every digit the source sent. null when absent or not a number. */
|
|
48
|
+
export declare function toMoney(m: {
|
|
49
|
+
amount?: string | number | null;
|
|
50
|
+
currencyCode?: string | null;
|
|
51
|
+
} | null | undefined): UI.Money | null;
|
|
52
|
+
/**
|
|
53
|
+
* A runtime variant → ProductVariant.
|
|
54
|
+
*
|
|
55
|
+
* `quantityAvailable` is the on-hand count only when it LIMITS a purchase:
|
|
56
|
+
* `inventoryPolicy: CONTINUE` sells past zero, so there is no cap, and a
|
|
57
|
+
* negative count under DENY means nothing is purchasable (0). Unknown — no
|
|
58
|
+
* count, or a count that does not limit — is an ABSENT key, never 0 or null.
|
|
59
|
+
*/
|
|
60
|
+
export declare function toVariant(v: R.ProductVariant, fallbackCurrency?: string): UI.ProductVariant;
|
|
61
|
+
/**
|
|
62
|
+
* A runtime product → Product.
|
|
63
|
+
*
|
|
64
|
+
* The runtime has two product shapes: the CARD (bootstrap, collection pages,
|
|
65
|
+
* search, recommendations) with one price, one compare-at and no variants; and
|
|
66
|
+
* the DETAIL (`fetchProduct`) with options + variants. Ranges come from the
|
|
67
|
+
* variants when they are there. On a card the runtime knows only the minimum
|
|
68
|
+
* price and the maximum compare-at, so both ends of each range are that one
|
|
69
|
+
* value — see the data-gap notes in the report.
|
|
70
|
+
*/
|
|
71
|
+
export declare function toProduct(p: R.Product): UI.Product;
|
|
72
|
+
export declare const toProducts: (list: readonly R.Product[] | null | undefined) => UI.Product[];
|
|
73
|
+
/** Products by handle, for StoreContext.products. */
|
|
74
|
+
export declare function toProductMap(list: readonly R.Product[] | null | undefined): Record<string, UI.Product>;
|
|
75
|
+
/**
|
|
76
|
+
* A runtime collection → Collection.
|
|
77
|
+
*
|
|
78
|
+
* `products`: pass the live page (`collectionProducts(...).products`) when you
|
|
79
|
+
* have it. Otherwise the bootstrap cache is used ONLY when it actually has
|
|
80
|
+
* products — an empty cached list can be a shell baked before products were
|
|
81
|
+
* assigned, so it maps to `products: undefined` ("not loaded"), not "empty".
|
|
82
|
+
* Pass `products: []` to state that the collection is known to be empty.
|
|
83
|
+
*/
|
|
84
|
+
export declare function toCollection(c: R.Collection, opts?: {
|
|
85
|
+
products?: readonly R.Product[] | null;
|
|
86
|
+
}): UI.Collection;
|
|
87
|
+
/** Collections by handle, for StoreContext.collections (card-level: no product lists). */
|
|
88
|
+
export declare function toCollectionMap(list: readonly R.Collection[] | null | undefined, opts?: {
|
|
89
|
+
withProducts?: boolean;
|
|
90
|
+
}): Record<string, UI.Collection>;
|
|
91
|
+
export interface MenuOptions {
|
|
92
|
+
/** The current pathname — marks the matching item at each level `active`. */
|
|
93
|
+
currentPath?: string;
|
|
94
|
+
/** Hosts that ARE this store (e.g. `shop.primaryDomain.host`); their absolute URLs become paths. */
|
|
95
|
+
storeHosts?: readonly string[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A menu URL the theme can render, or null.
|
|
99
|
+
*
|
|
100
|
+
* Unsafe schemes are dropped (app/platform/safe-href). A menu item that points at one of
|
|
101
|
+
* the store's own resources (any type but HTTP) — or at one of `storeHosts` —
|
|
102
|
+
* may still arrive as an absolute store URL; it becomes a same-origin path so
|
|
103
|
+
* soft navigation and the active rule both work. A genuine external HTTP link
|
|
104
|
+
* is kept absolute.
|
|
105
|
+
*/
|
|
106
|
+
export declare function toMenuHref(url: string | null | undefined, type?: S.MenuItemType | string | null, storeHosts?: readonly string[]): string | null;
|
|
107
|
+
/** A runtime menu → Menu (recursive, every level). null when there is no menu. */
|
|
108
|
+
export declare function toMenu(menu: S.Menu | null | undefined, opts?: MenuOptions): UI.Menu | null;
|
|
109
|
+
/** Menus by handle, for StoreContext.menus. Missing menus are left out. */
|
|
110
|
+
export declare function toMenuMap(menus: ReadonlyArray<S.Menu | null | undefined>, opts?: MenuOptions): Record<string, UI.Menu>;
|
|
111
|
+
export declare function toPaymentMethods(settings: S.Shop['paymentSettings'] | null | undefined): UI.PaymentMethod[];
|
|
112
|
+
/**
|
|
113
|
+
* Settings → Social → the design's drawn networks (`social`) and the rest (`otherSocial`, generic
|
|
114
|
+
* link mark). Only https: URLs; one link per network, the first wins. Empty → both absent.
|
|
115
|
+
*/
|
|
116
|
+
export declare function toSocial(links: S.Shop['socialLinks']): Pick<UI.Shop, 'social' | 'otherSocial'>;
|
|
117
|
+
/**
|
|
118
|
+
* The shop + the theme's Brand settings → Shop.
|
|
119
|
+
*
|
|
120
|
+
* Name: the store name (Settings › General), else the theme's `shopName` setting
|
|
121
|
+
* (a fallback only — D-13). Logo: the theme's
|
|
122
|
+
* `logo` setting, else Settings → Brand (the same precedence as
|
|
123
|
+
* app/platform/safe-values `resolveLogo`, which this reuses).
|
|
124
|
+
*/
|
|
125
|
+
export declare function toShop(shop: S.Shop | null | undefined, settings?: {
|
|
126
|
+
shopName?: string;
|
|
127
|
+
logo?: string;
|
|
128
|
+
}): UI.Shop;
|
|
129
|
+
/**
|
|
130
|
+
* Localization → Localization, or null (no Markets: the picker hides).
|
|
131
|
+
*
|
|
132
|
+
* The runtime publishes countries and languages as two independent lists —
|
|
133
|
+
* every published language is available in every country — so `available` is
|
|
134
|
+
* their product. `current` is always included in `available`.
|
|
135
|
+
*/
|
|
136
|
+
export declare function toLocalization(loc: R.Localization | null | undefined): UI.Localization | null;
|
|
137
|
+
export declare function toCartSummary(cart: Pick<C.CartState, 'lines' | 'totalQuantity'> | null | undefined): UI.CartSummary;
|
|
138
|
+
/**
|
|
139
|
+
* One cart line → CartLine.
|
|
140
|
+
*
|
|
141
|
+
* A line carries id + title + image + price, its product as handle + title, and
|
|
142
|
+
* — when the cart source sends the whole variant (Theme ABI v2) — its options,
|
|
143
|
+
* compare-at and availability. No vendor and no stock. `variant.available` is
|
|
144
|
+
* true unless the source says otherwise: the backend accepted the line, and it
|
|
145
|
+
* refuses unpurchasable merchandise at add/update time.
|
|
146
|
+
*/
|
|
147
|
+
export declare function toCartLine(line: C.CartLine): UI.CartLine;
|
|
148
|
+
/** The full cart (cart page). `discounts` is left out: the runtime keeps no per-code amount. */
|
|
149
|
+
export declare function toCart(cart: C.CartState | null | undefined): UI.Cart;
|
|
150
|
+
/** A page → the UI's page-body shape (StoreContext.currentPage / pages). */
|
|
151
|
+
export declare function toPage(page: R.Page | null | undefined): {
|
|
152
|
+
title: string;
|
|
153
|
+
html: string;
|
|
154
|
+
} | null;
|
|
155
|
+
/**
|
|
156
|
+
* An article → Article, or null when its blog is unknown (no URL can be built —
|
|
157
|
+
* search results arrive without one). Pass the blog handle when the caller
|
|
158
|
+
* knows it.
|
|
159
|
+
*/
|
|
160
|
+
export declare function toArticle(a: S.Article | null | undefined, blogHandle?: string): UI.Article | null;
|
|
161
|
+
export declare function toBlog(blog: S.Blog | null | undefined): UI.Blog | null;
|
|
162
|
+
/**
|
|
163
|
+
* A shop policy → Policy. The URL is the theme's own policy route (the runtime's
|
|
164
|
+
* `url` may be absolute). `bodyHtml` is '' when the payload carries no body.
|
|
165
|
+
*/
|
|
166
|
+
export declare function toPolicy(p: S.ShopPolicy | null | undefined): UI.Policy | null;
|
|
167
|
+
/** Every published policy by handle, for StoreContext.policies. */
|
|
168
|
+
export declare function toPolicies(shop: S.Shop | null | undefined): Record<string, UI.Policy>;
|
|
169
|
+
type RuntimeLocation = NonNullable<Awaited<ReturnType<NonNullable<R.DataApi['locations']>>>>[number];
|
|
170
|
+
/** Store locations. The platform returns a postal address only — no hours, email, image or coordinates. */
|
|
171
|
+
export declare function toLocations(list: readonly RuntimeLocation[] | null | undefined): UI.StoreLocation[];
|
|
172
|
+
/**
|
|
173
|
+
* Search → SearchResults. `total` is the backend's count across every type.
|
|
174
|
+
* Articles whose blog is unknown are left out (see toArticle).
|
|
175
|
+
*/
|
|
176
|
+
export declare function toSearchResults(query: string, r: S.SearchResults | null | undefined): UI.SearchResults;
|
|
177
|
+
/**
|
|
178
|
+
* Listing filters → Facets. List filters map value-for-value; `active` is set
|
|
179
|
+
* for the values whose `input` the shopper has applied. A PRICE_RANGE filter
|
|
180
|
+
* becomes a price facet only when its input carries the store's bounds and a
|
|
181
|
+
* currency is known.
|
|
182
|
+
*/
|
|
183
|
+
export declare function toFacets(filters: readonly S.Filter[] | null | undefined, opts?: {
|
|
184
|
+
activeInputs?: readonly string[];
|
|
185
|
+
currencyCode?: string;
|
|
186
|
+
}): UI.Facet[];
|
|
187
|
+
export interface BreadcrumbInput {
|
|
188
|
+
pathname: string;
|
|
189
|
+
/** Interface words, already translated by the caller. Without `home` there is no trail. */
|
|
190
|
+
labels: {
|
|
191
|
+
home: string;
|
|
192
|
+
collections?: string;
|
|
193
|
+
search?: string;
|
|
194
|
+
cart?: string;
|
|
195
|
+
account?: string;
|
|
196
|
+
};
|
|
197
|
+
/** The route's collection — or, on a product page, the collection the shopper came from. */
|
|
198
|
+
collection?: {
|
|
199
|
+
handle: string;
|
|
200
|
+
title: string;
|
|
201
|
+
} | null;
|
|
202
|
+
product?: {
|
|
203
|
+
title: string;
|
|
204
|
+
} | null;
|
|
205
|
+
page?: {
|
|
206
|
+
title: string;
|
|
207
|
+
} | null;
|
|
208
|
+
blog?: {
|
|
209
|
+
title: string;
|
|
210
|
+
} | null;
|
|
211
|
+
article?: {
|
|
212
|
+
title: string;
|
|
213
|
+
} | null;
|
|
214
|
+
policy?: {
|
|
215
|
+
title: string;
|
|
216
|
+
} | null;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The trail for a route. The last item is the current page and carries no URL.
|
|
220
|
+
* A route whose own title is unknown returns [] rather than a trail that ends
|
|
221
|
+
* on a link — the breadcrumbs section then renders nothing.
|
|
222
|
+
*/
|
|
223
|
+
export declare function toBreadcrumbs(input: BreadcrumbInput): UI.BreadcrumbItem[];
|
|
224
|
+
/**
|
|
225
|
+
* Whether the cookie banner shows to a shopper who has not decided yet (Settings › Customer privacy,
|
|
226
|
+
* contract rev 2): the platform's legal floor first (EEA, UK, unknown location — or a platform that
|
|
227
|
+
* does not say), then the merchant's switch — everywhere with "Use automated settings", else only in
|
|
228
|
+
* the regions the merchant chose. No merchant config (older data) = shown, as before.
|
|
229
|
+
*/
|
|
230
|
+
export declare function consentBannerShows(readout: {
|
|
231
|
+
regionRequiresBanner?: boolean;
|
|
232
|
+
geo?: {
|
|
233
|
+
country?: string;
|
|
234
|
+
region?: string;
|
|
235
|
+
};
|
|
236
|
+
}, banner: S.ConsentBannerConfig | null | undefined): boolean;
|
|
237
|
+
export {};
|