@numueg/theme-sdk 0.2.2 → 0.3.1
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 -1
- package/README.md +8 -8
- package/dist/{entities-iiuRSPpk.d.mts → entities-6MGANln7.d.mts} +64 -1
- package/dist/{entities-iiuRSPpk.d.ts → entities-6MGANln7.d.ts} +64 -1
- package/dist/index.cjs +227 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +221 -45
- package/dist/index.d.ts +221 -45
- package/dist/index.mjs +222 -68
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/v2-compat.d.mts +1 -1
- package/dist/v2-compat.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as Address, a as CartItem, O as Order, d as OrderItem, f as ProductImage,
|
|
1
|
+
import { i as Store, e as Product, b as Collection, C as Cart, c as Customer, P as Page, S as SizeChart, g as ProductVariant } from './entities-6MGANln7.mjs';
|
|
2
|
+
export { A as Address, a as CartItem, O as Order, d as OrderItem, f as ProductImage, j as ProductOption, h as SizeChartMode } from './entities-6MGANln7.mjs';
|
|
3
3
|
import { T as ThemeSettingsV3, c as SectionInstance, M as MountResult, B as BlockInstance, b as BlockSchema, a as BlockProps$1, f as SectionSchema, e as SectionProps$1 } from './theme-D0QybTQS.mjs';
|
|
4
4
|
export { E as ExternalThemeMetadata, h as MAX_BLOCK_DEPTH, P as PageTemplate, i as PresetBlock, S as SectionGroup, d as SectionPreset, g as SettingDefinition } from './theme-D0QybTQS.mjs';
|
|
5
5
|
import * as react from 'react';
|
|
6
|
-
import { ReactNode, ElementType, ImgHTMLAttributes, AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, FormHTMLAttributes, ComponentType } from 'react';
|
|
6
|
+
import { ReactNode, ReactElement, ElementType, CSSProperties, ImgHTMLAttributes, AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, FormHTMLAttributes, ComponentType } from 'react';
|
|
7
7
|
export { resolveThemeSettings } from './normalize.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -744,6 +744,33 @@ declare function useRelatedProducts(productId: string | null | undefined, option
|
|
|
744
744
|
limit?: number;
|
|
745
745
|
}): RelatedProductsState;
|
|
746
746
|
|
|
747
|
+
/**
|
|
748
|
+
* useProductSizeChart — resolve the size chart to show for a product.
|
|
749
|
+
*
|
|
750
|
+
* The merchant hub writes the per-product chart to
|
|
751
|
+
* `product.attributes.size_chart` and the store-wide default to
|
|
752
|
+
* `store.settings.size_chart`, with an explicit `mode`:
|
|
753
|
+
*
|
|
754
|
+
* "off" → never show, even if a store default exists
|
|
755
|
+
* "custom" → use the product's own chart
|
|
756
|
+
* "default" → fall back to the store-wide chart
|
|
757
|
+
* (legacy) → no `mode`: a populated product chart wins, else the default
|
|
758
|
+
*
|
|
759
|
+
* This hook centralises that precedence so every theme resolves it identically
|
|
760
|
+
* (the backend `SizeChartSchema` validator and the hub editor share the same
|
|
761
|
+
* shape). Returns `null` when there is nothing to show — render the size-guide
|
|
762
|
+
* trigger only when this is non-null.
|
|
763
|
+
*
|
|
764
|
+
* @param productOverride - resolve against this product instead of the one in
|
|
765
|
+
* context (e.g. when rendering a chart for a related/quick-view product).
|
|
766
|
+
*/
|
|
767
|
+
declare function useProductSizeChart(productOverride?: Product | null): SizeChart | null;
|
|
768
|
+
/**
|
|
769
|
+
* Pure resolver (no React) — exported so non-hook code (SSR helpers, tests)
|
|
770
|
+
* can apply the same precedence.
|
|
771
|
+
*/
|
|
772
|
+
declare function resolveSizeChart(productAttributes: Record<string, unknown> | undefined, storeSettings: Record<string, unknown> | undefined): SizeChart | null;
|
|
773
|
+
|
|
747
774
|
/**
|
|
748
775
|
* Multi-currency presentment — Phase 6.
|
|
749
776
|
*
|
|
@@ -1155,6 +1182,14 @@ interface ThemeMountContext {
|
|
|
1155
1182
|
demo?: boolean;
|
|
1156
1183
|
/** Store navigation menus keyed by handle, resolved server-side. */
|
|
1157
1184
|
navigation?: Record<string, MenuItemData[]>;
|
|
1185
|
+
/**
|
|
1186
|
+
* Host signal that the container already holds server-rendered HTML for
|
|
1187
|
+
* this exact ctx (produced via `createApp` from `defineThemeEntry`).
|
|
1188
|
+
* `mountTheme` then adopts it with `hydrateRoot` instead of re-rendering
|
|
1189
|
+
* from scratch. Ignored when the container is empty, so a host can pass
|
|
1190
|
+
* it optimistically and still get a plain client mount on SSR failure.
|
|
1191
|
+
*/
|
|
1192
|
+
hydrate?: boolean;
|
|
1158
1193
|
[extra: string]: unknown;
|
|
1159
1194
|
}
|
|
1160
1195
|
/** Arguments handed to a theme's render callback on every (re)render. */
|
|
@@ -1170,17 +1205,81 @@ interface ThemeRenderArgs {
|
|
|
1170
1205
|
/** Live theme settings (reflects customizer drafts via applyDraft). */
|
|
1171
1206
|
themeSettings: ThemeSettingsV3;
|
|
1172
1207
|
}
|
|
1208
|
+
interface DraftHandle {
|
|
1209
|
+
applyDraft: (next: ThemeSettingsV3) => void;
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Build the canonical theme element tree for a ctx. BOTH render paths go
|
|
1213
|
+
* through here — `mountTheme` (client mount/hydrate) and `createApp`
|
|
1214
|
+
* (host-side `renderToString`) — so the server markup and the hydration
|
|
1215
|
+
* tree are the same React tree by construction. `mountEl` is a prop, not
|
|
1216
|
+
* DOM output, so it differing between server (null) and client (the
|
|
1217
|
+
* container) cannot cause a hydration mismatch.
|
|
1218
|
+
*/
|
|
1219
|
+
declare function buildThemeElement(ctx: ThemeMountContext, mountEl: HTMLElement | null, renderApp: (args: ThemeRenderArgs) => ReactNode, ref?: (h: DraftHandle | null) => void): ReactElement;
|
|
1173
1220
|
/**
|
|
1174
1221
|
* Mount a V3 theme. Owns the React root, the provider stack (catalog + nav +
|
|
1175
1222
|
* style tokens), and the live-preview draft cycle. Returns the host-contract
|
|
1176
1223
|
* `MountResult` (`cleanup` + `applyDraft`).
|
|
1177
1224
|
*
|
|
1225
|
+
* When the host passes `ctx.hydrate === true` and the container already
|
|
1226
|
+
* holds server-rendered HTML (produced by this theme's `createApp` with the
|
|
1227
|
+
* identical ctx), the tree is adopted via `hydrateRoot` — no re-render, no
|
|
1228
|
+
* flash. An empty container downgrades to a plain client mount so hosts can
|
|
1229
|
+
* pass the flag optimistically.
|
|
1230
|
+
*
|
|
1178
1231
|
* @param el the host-supplied container element
|
|
1179
1232
|
* @param ctx the mount context (either host or legacy/dev shape)
|
|
1180
1233
|
* @param renderApp returns the theme's section tree for the current args
|
|
1181
1234
|
*/
|
|
1182
1235
|
declare function mountTheme(el: HTMLElement, ctx: ThemeMountContext, renderApp: (args: ThemeRenderArgs) => ReactNode): MountResult;
|
|
1183
1236
|
|
|
1237
|
+
/**
|
|
1238
|
+
* `defineThemeEntry(renderApp)` — one-call theme entry that yields BOTH
|
|
1239
|
+
* halves of the V3 contract from a single component:
|
|
1240
|
+
*
|
|
1241
|
+
* - `mount(el, ctx)` — the client entry every host already calls
|
|
1242
|
+
* (now hydration-aware via `ctx.hydrate`).
|
|
1243
|
+
* - `createApp(ctx)` — the same React tree as a plain element, so the
|
|
1244
|
+
* host can `renderToString(createApp(ctx))` on the
|
|
1245
|
+
* server and ship real HTML before any JS runs.
|
|
1246
|
+
*
|
|
1247
|
+
* ```tsx
|
|
1248
|
+
* // src/main.tsx
|
|
1249
|
+
* import { defineThemeEntry } from "@numueg/theme-sdk";
|
|
1250
|
+
*
|
|
1251
|
+
* const entry = defineThemeEntry(({ currentTemplate }) => (
|
|
1252
|
+
* <ThemeApp currentTemplate={currentTemplate} />
|
|
1253
|
+
* ));
|
|
1254
|
+
*
|
|
1255
|
+
* export const mount = entry.mount;
|
|
1256
|
+
* export const createApp = entry.createApp;
|
|
1257
|
+
* ```
|
|
1258
|
+
*
|
|
1259
|
+
* Why both MUST come from one definition: hydration only succeeds when the
|
|
1260
|
+
* server markup and the client tree are identical. Routing both through
|
|
1261
|
+
* `buildThemeElement` makes that true by construction — a theme cannot
|
|
1262
|
+
* accidentally ship a `createApp` that disagrees with its `mount`.
|
|
1263
|
+
*
|
|
1264
|
+
* Themes that only export `mount` keep working exactly as before; they are
|
|
1265
|
+
* simply never server-rendered (the host detects the missing `createApp`
|
|
1266
|
+
* and falls back to today's client-only mount).
|
|
1267
|
+
*/
|
|
1268
|
+
|
|
1269
|
+
/** The pair of entry points a V3 theme bundle exports. */
|
|
1270
|
+
interface ThemeEntry {
|
|
1271
|
+
/** Client entry — host contract `mount(el, ctx): MountResult`. */
|
|
1272
|
+
mount: (el: HTMLElement, ctx: ThemeMountContext) => MountResult;
|
|
1273
|
+
/**
|
|
1274
|
+
* Server entry — returns the exact element tree `mount` would render,
|
|
1275
|
+
* for host-side `renderToString`. Must stay side-effect free: no DOM
|
|
1276
|
+
* access happens until React effects run (which they don't on the
|
|
1277
|
+
* server).
|
|
1278
|
+
*/
|
|
1279
|
+
createApp: (ctx: ThemeMountContext) => ReactElement;
|
|
1280
|
+
}
|
|
1281
|
+
declare function defineThemeEntry(renderApp: (args: ThemeRenderArgs) => ReactNode): ThemeEntry;
|
|
1282
|
+
|
|
1184
1283
|
interface NuMuProviderProps {
|
|
1185
1284
|
store: Store;
|
|
1186
1285
|
themeSettings: ThemeSettingsV3;
|
|
@@ -1263,6 +1362,78 @@ interface MoneyProps {
|
|
|
1263
1362
|
*/
|
|
1264
1363
|
declare function Money({ amount, currency, compareAt, className, as, }: MoneyProps): react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
1265
1364
|
|
|
1365
|
+
/**
|
|
1366
|
+
* Non-destructive image framing transform (focal / zoom / rotation).
|
|
1367
|
+
*
|
|
1368
|
+
* An image setting value may carry optional `transform` metadata
|
|
1369
|
+
* (`{ url, alt, transform }`). The original asset is never modified — the
|
|
1370
|
+
* storefront reproduces the framing purely from these numbers via CSS, so the
|
|
1371
|
+
* SAME uploaded image can be framed differently per placement (hero vs card).
|
|
1372
|
+
*
|
|
1373
|
+
* Hoisted into the SDK (was duplicated in every theme's `_shared.ts` and in
|
|
1374
|
+
* the merchant-hub editor's `imageTransform.ts`). The editor copy MUST stay
|
|
1375
|
+
* equivalent so its preview matches the storefront render exactly.
|
|
1376
|
+
*/
|
|
1377
|
+
interface ImageTransform {
|
|
1378
|
+
v: 1;
|
|
1379
|
+
focal?: {
|
|
1380
|
+
x: number;
|
|
1381
|
+
y: number;
|
|
1382
|
+
};
|
|
1383
|
+
zoom?: number;
|
|
1384
|
+
rotation?: number;
|
|
1385
|
+
fit?: "cover" | "contain";
|
|
1386
|
+
}
|
|
1387
|
+
/** Read the transform off an image setting value (string | {url,alt,transform}). */
|
|
1388
|
+
declare function asImageTransform(v: unknown): ImageTransform | undefined;
|
|
1389
|
+
/**
|
|
1390
|
+
* CSS reproducing the transform on an `<img>` that fills a fixed-aspect,
|
|
1391
|
+
* overflow-hidden frame. Default fit is `cover` (Shopify-style: the image
|
|
1392
|
+
* fills its frame, cropping to the focal point) — pass `"contain"` only for
|
|
1393
|
+
* placements that must show the whole image (e.g. a logo). Empty object when
|
|
1394
|
+
* there is no transform AND the caller wants the section's own className to
|
|
1395
|
+
* decide; pass an explicit `fit` to force a default even without a transform.
|
|
1396
|
+
*/
|
|
1397
|
+
declare function applyImageTransform(t: ImageTransform | undefined | null, fit?: "cover" | "contain"): CSSProperties;
|
|
1398
|
+
/**
|
|
1399
|
+
* focalSrc — build a URL for a server-side, focal-point-aware image transform.
|
|
1400
|
+
*
|
|
1401
|
+
* OPT-IN helper. A theme that wants a bandwidth-efficient SMART CROP for a big
|
|
1402
|
+
* image (typically a hero) calls this to point the <img src> at the storefront's
|
|
1403
|
+
* `/api/image-transform` endpoint with focal/aspect params. The endpoint honors
|
|
1404
|
+
* them only when Cloudflare Image Resizing is enabled on the zone
|
|
1405
|
+
* (NUMU_CF_IMAGE_RESIZING=1); otherwise it gracefully ignores them and serves a
|
|
1406
|
+
* plain resized image — so the theme's CSS `applyImageTransform` framing remains
|
|
1407
|
+
* the correctness baseline either way. This is purely a perf optimization.
|
|
1408
|
+
*
|
|
1409
|
+
* Returns a RELATIVE path (`/api/image-transform?...`) — the SDK runs
|
|
1410
|
+
* same-origin inside the storefront, matching how <Form>/useShop build URLs.
|
|
1411
|
+
*
|
|
1412
|
+
* @example
|
|
1413
|
+
* <img
|
|
1414
|
+
* src={focalSrc(hero.url, { width: 1600, focal: t?.focal, aspect: "16/9" })}
|
|
1415
|
+
* style={applyImageTransform(t, "cover")} // CSS still frames as fallback
|
|
1416
|
+
* />
|
|
1417
|
+
*/
|
|
1418
|
+
interface FocalSrcOptions {
|
|
1419
|
+
/** Target width in px (e.g. 1600 for a desktop hero). Required for a crop. */
|
|
1420
|
+
width?: number;
|
|
1421
|
+
/** Focal point, normalized 0..1 (0.5,0.5 = center). */
|
|
1422
|
+
focal?: {
|
|
1423
|
+
x?: number;
|
|
1424
|
+
y?: number;
|
|
1425
|
+
};
|
|
1426
|
+
/** Target aspect ratio "W/H" (e.g. "16/9"); drives the crop box height. */
|
|
1427
|
+
aspect?: string;
|
|
1428
|
+
/** Crop mode. Default "cover". */
|
|
1429
|
+
fit?: "cover" | "contain";
|
|
1430
|
+
/** Quality 1..100. */
|
|
1431
|
+
quality?: number;
|
|
1432
|
+
/** Output format. */
|
|
1433
|
+
format?: "webp" | "avif" | "jpeg" | "jpg" | "png";
|
|
1434
|
+
}
|
|
1435
|
+
declare function focalSrc(url: string | null | undefined, options?: FocalSrcOptions): string;
|
|
1436
|
+
|
|
1266
1437
|
interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "srcSet"> {
|
|
1267
1438
|
src: string | undefined | null;
|
|
1268
1439
|
alt: string;
|
|
@@ -1283,6 +1454,29 @@ interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "
|
|
|
1283
1454
|
* "eager" for above-the-fold imagery.
|
|
1284
1455
|
*/
|
|
1285
1456
|
loading?: "eager" | "lazy";
|
|
1457
|
+
/**
|
|
1458
|
+
* Shopify-style frame. When set (e.g. "3/4", "16/9", "1/1") the image is
|
|
1459
|
+
* wrapped in a fixed-aspect, overflow-hidden box and the `<img>` fills it.
|
|
1460
|
+
* Combined with `objectFit="cover"` (the default) this guarantees the image
|
|
1461
|
+
* ALWAYS fits its frame — no letterboxing, no overflow — cropping to the
|
|
1462
|
+
* focal point. Omit to render a bare `<img>` (legacy behavior).
|
|
1463
|
+
*/
|
|
1464
|
+
aspectRatio?: string;
|
|
1465
|
+
/**
|
|
1466
|
+
* How the image fills its box. Default "cover" (fill + crop) — the merchant
|
|
1467
|
+
* never sees a letterboxed/squashed image. Use "contain" for logos/badges
|
|
1468
|
+
* that must show in full.
|
|
1469
|
+
*/
|
|
1470
|
+
objectFit?: "cover" | "contain" | "fill" | "scale-down" | "none";
|
|
1471
|
+
/** CSS object-position (e.g. "50% 50%"). Ignored if `transform` is set. */
|
|
1472
|
+
objectPosition?: string;
|
|
1473
|
+
/**
|
|
1474
|
+
* Non-destructive focal/zoom/rotation metadata from the image setting value
|
|
1475
|
+
* (`asImageTransform(setting)`). When present it drives object-fit +
|
|
1476
|
+
* object-position + scale/rotate so the editor preview and the live render
|
|
1477
|
+
* match exactly. Overrides `objectFit`/`objectPosition`.
|
|
1478
|
+
*/
|
|
1479
|
+
transform?: ImageTransform | null;
|
|
1286
1480
|
}
|
|
1287
1481
|
/**
|
|
1288
1482
|
* <Image> — drop-in replacement for `<img>` with srcSet + lazy loading
|
|
@@ -1293,7 +1487,7 @@ interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "
|
|
|
1293
1487
|
* If `src` is empty/null, renders a placeholder div so the layout
|
|
1294
1488
|
* doesn't shift while a merchant configures images in the customizer.
|
|
1295
1489
|
*/
|
|
1296
|
-
declare function Image({ src, alt, sizes, responsive, loading, className, style, ...rest }: ImageProps): react.JSX.Element;
|
|
1490
|
+
declare function Image({ src, alt, sizes, responsive, loading, aspectRatio, objectFit, objectPosition, transform, className, style, ...rest }: ImageProps): react.JSX.Element;
|
|
1297
1491
|
|
|
1298
1492
|
interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {
|
|
1299
1493
|
/**
|
|
@@ -1993,45 +2187,6 @@ declare function collectBlocks<T extends Record<string, unknown>>(modules: T): R
|
|
|
1993
2187
|
*/
|
|
1994
2188
|
declare function assetUrl(name: string): string;
|
|
1995
2189
|
|
|
1996
|
-
/**
|
|
1997
|
-
* focalSrc — build a URL for a server-side, focal-point-aware image transform.
|
|
1998
|
-
*
|
|
1999
|
-
* OPT-IN helper. A theme that wants a bandwidth-efficient SMART CROP for a big
|
|
2000
|
-
* image (typically a hero) calls this to point the <img src> at the storefront's
|
|
2001
|
-
* `/api/image-transform` endpoint with focal/aspect params. The endpoint honors
|
|
2002
|
-
* them only when Cloudflare Image Resizing is enabled on the zone
|
|
2003
|
-
* (NUMU_CF_IMAGE_RESIZING=1); otherwise it gracefully ignores them and serves a
|
|
2004
|
-
* plain resized image — so the theme's CSS `applyImageTransform` framing remains
|
|
2005
|
-
* the correctness baseline either way. This is purely a perf optimization.
|
|
2006
|
-
*
|
|
2007
|
-
* Returns a RELATIVE path (`/api/image-transform?...`) — the SDK runs
|
|
2008
|
-
* same-origin inside the storefront, matching how <Form>/useShop build URLs.
|
|
2009
|
-
*
|
|
2010
|
-
* @example
|
|
2011
|
-
* <img
|
|
2012
|
-
* src={focalSrc(hero.url, { width: 1600, focal: t?.focal, aspect: "16/9" })}
|
|
2013
|
-
* style={applyImageTransform(t, "cover")} // CSS still frames as fallback
|
|
2014
|
-
* />
|
|
2015
|
-
*/
|
|
2016
|
-
interface FocalSrcOptions {
|
|
2017
|
-
/** Target width in px (e.g. 1600 for a desktop hero). Required for a crop. */
|
|
2018
|
-
width?: number;
|
|
2019
|
-
/** Focal point, normalized 0..1 (0.5,0.5 = center). */
|
|
2020
|
-
focal?: {
|
|
2021
|
-
x?: number;
|
|
2022
|
-
y?: number;
|
|
2023
|
-
};
|
|
2024
|
-
/** Target aspect ratio "W/H" (e.g. "16/9"); drives the crop box height. */
|
|
2025
|
-
aspect?: string;
|
|
2026
|
-
/** Crop mode. Default "cover". */
|
|
2027
|
-
fit?: "cover" | "contain";
|
|
2028
|
-
/** Quality 1..100. */
|
|
2029
|
-
quality?: number;
|
|
2030
|
-
/** Output format. */
|
|
2031
|
-
format?: "webp" | "avif" | "jpeg" | "jpg" | "png";
|
|
2032
|
-
}
|
|
2033
|
-
declare function focalSrc(url: string | null | undefined, options?: FocalSrcOptions): string;
|
|
2034
|
-
|
|
2035
2190
|
/**
|
|
2036
2191
|
* `applyGlobalStyleTokens(globalSettings, el)` — Phase 3.5.
|
|
2037
2192
|
*
|
|
@@ -2070,11 +2225,32 @@ type GlobalSettings = Record<string, unknown> | null | undefined;
|
|
|
2070
2225
|
* family/stack the theme author supplied.
|
|
2071
2226
|
*/
|
|
2072
2227
|
declare function resolveFontStack(value: string): string;
|
|
2228
|
+
/** Result of `computeGlobalStyleTokens` — everything a host needs to paint
|
|
2229
|
+
* global settings without a DOM. */
|
|
2230
|
+
interface ComputedStyleTokens {
|
|
2231
|
+
/** CSS custom properties to set on the theme's mount root. */
|
|
2232
|
+
cssVars: Record<string, string>;
|
|
2233
|
+
/** Google-Fonts stylesheet hrefs for any registry fonts in use. */
|
|
2234
|
+
fontHrefs: string[];
|
|
2235
|
+
}
|
|
2236
|
+
/**
|
|
2237
|
+
* Pure half of `applyGlobalStyleTokens`: compute the exact CSS custom
|
|
2238
|
+
* properties (and webfont hrefs) a settings object maps to, without touching
|
|
2239
|
+
* any DOM. This is what lets a host SERVER-render a theme with the same vars
|
|
2240
|
+
* the bundle applies on mount — both sides call this one function, so the
|
|
2241
|
+
* values cannot drift (drift = unstyled flash or hydration noise).
|
|
2242
|
+
*
|
|
2243
|
+
* Includes the explicit `heading_font` / `body_font` resolution that
|
|
2244
|
+
* `mountTheme` historically layered on top: any string value for those two
|
|
2245
|
+
* ids resolves through the registry (or passes verbatim) so a picked font
|
|
2246
|
+
* gets a real stack even when it isn't a known token.
|
|
2247
|
+
*/
|
|
2248
|
+
declare function computeGlobalStyleTokens(globalSettings: GlobalSettings): ComputedStyleTokens;
|
|
2073
2249
|
/**
|
|
2074
2250
|
* Map a store's global settings onto CSS custom properties on `el`. Call on
|
|
2075
2251
|
* mount and on every `applyDraft` (live preview). No-op when `el` or the
|
|
2076
2252
|
* settings are missing. Reserved `__`-prefixed keys (e.g. `__translations`)
|
|
2077
|
-
* are skipped.
|
|
2253
|
+
* are skipped. Thin DOM shell over `computeGlobalStyleTokens`.
|
|
2078
2254
|
*/
|
|
2079
2255
|
declare function applyGlobalStyleTokens(globalSettings: GlobalSettings, el: HTMLElement | null | undefined): void;
|
|
2080
2256
|
|
|
@@ -2136,4 +2312,4 @@ declare function pickTranslations(bundle: LocaleBundle, locale: string): LocaleM
|
|
|
2136
2312
|
*/
|
|
2137
2313
|
declare function buildLocaleBundle<T extends Record<string, unknown>>(modules: T): LocaleBundle;
|
|
2138
2314
|
|
|
2139
|
-
export { AddToCartButton, type AddressInput, type AnalyticsApi, type AnalyticsPayload, type AppManifestBlock, type AppPayload, type AppState, Block, BlockInstance, BlockProps$1 as BlockProps, BlockSchema, Cart, CartContext, type CheckoutAddress, type CheckoutApi, type CheckoutSessionState, type CheckoutStep, Collection, CollectionCard, type CollectionCardProps, type CollectionCardSlots, CollectionContext, CollectionProvider, type CurrencyConfig, type CurrencyState, CurrencySwitcher, type CurrencySwitcherProps, Customer, type CustomerAddress, type CustomerAddressesState, CustomerContext, type DefineBlockInput, type DefineSectionInput, type DefinedBlock, type DefinedSection, type DynamicResolveContext, type DynamicSourceRef, EditableImage, type EditableImageProps, EditableText, type EditableTextProps, type FocalSrcOptions, Form, type GiftCardBalance, ICON_NAMES, Icon, IconMap, type IconProps, Image, Link, type LocaleBundle, type LocaleMessages, LocaleSwitcher, type LocaleSwitcherProps, LocalizationContext, type MenuItemData, Money, MountResult, NavigationContext, type NavigationItem, type NavigationState, NuMuProvider, type OrderDetail, type OrderListEntry, type OrderListState, type OrderState, Page, PageContext, type PlaceOrderResult, Product, ProductCard, type ProductCardProps, type ProductCardSlots, ProductContext, ProductProvider, ProductVariant, type RelatedProductsState, type ReorderResult, type ReorderSkipReason, type ReorderSkippedItem, RichText, type RichTextProps, type SearchResults, type SearchState, Section, SectionContext, SectionInstance, SectionProps$1 as SectionProps, SectionSchema, type ShippingRateOption, ShopContext, type ShopWithHelpers, Store, type ThemeMountContext, type ThemeMountPage, type ThemeRenderArgs, ThemeSettingsContext, ThemeSettingsV3, type UseGiftCardBalance, type UseReorder, type UseSearchOptions, type UseShippingRatesOptions, type UseShippingRatesState, type UseVariantSelection, type WishlistItem, type WishlistState, applyGlobalStyleTokens, assetUrl, availableValues, buildLocaleBundle, clearSdkSingleton, collectBlocks, collectSections, defaultVariant, defineBlock, defineSection, dynamicSource, findVariantByOptions, flattenMessages, focalSrc, getReactSingleton, getSdkSingleton, isDefinedBlock, isDefinedSection, isDynamicSource, isSdkAvailable, mountTheme, pickTranslations, registerReactSingleton, registerSdkSingleton, resolveDynamicValue, resolveFontStack, resolveSettingsMap, resolveSourcePath, sanitizeHtml, useAnalytics, useApp, useCart, useCheckout, useCollection, useCollectionOptional, useCollections, useCurrency, useCurrentTemplate, useCustomer, useCustomerActions, useCustomerAddresses, useDirection, useFieldTranslation, useGiftCardBalance, useImage, useLocale, useLocalization, useMoney, useNavigation, useNumberFormat, useOrder, useOrders, usePage, useProduct, useProductOptional, useProducts, useRelatedProducts, useReorder, useResolvedSettings, useSearch, useSection, useSectionOptional, useShippingRates, useShop, useThemeSettings, useTranslation, useVariantSelection, useWishlist };
|
|
2315
|
+
export { AddToCartButton, type AddressInput, type AnalyticsApi, type AnalyticsPayload, type AppManifestBlock, type AppPayload, type AppState, Block, BlockInstance, BlockProps$1 as BlockProps, BlockSchema, Cart, CartContext, type CheckoutAddress, type CheckoutApi, type CheckoutSessionState, type CheckoutStep, Collection, CollectionCard, type CollectionCardProps, type CollectionCardSlots, CollectionContext, CollectionProvider, type ComputedStyleTokens, type CurrencyConfig, type CurrencyState, CurrencySwitcher, type CurrencySwitcherProps, Customer, type CustomerAddress, type CustomerAddressesState, CustomerContext, type DefineBlockInput, type DefineSectionInput, type DefinedBlock, type DefinedSection, type DynamicResolveContext, type DynamicSourceRef, EditableImage, type EditableImageProps, EditableText, type EditableTextProps, type FocalSrcOptions, Form, type GiftCardBalance, ICON_NAMES, Icon, IconMap, type IconProps, Image, type ImageTransform, Link, type LocaleBundle, type LocaleMessages, LocaleSwitcher, type LocaleSwitcherProps, LocalizationContext, type MenuItemData, Money, MountResult, NavigationContext, type NavigationItem, type NavigationState, NuMuProvider, type OrderDetail, type OrderListEntry, type OrderListState, type OrderState, Page, PageContext, type PlaceOrderResult, Product, ProductCard, type ProductCardProps, type ProductCardSlots, ProductContext, ProductProvider, ProductVariant, type RelatedProductsState, type ReorderResult, type ReorderSkipReason, type ReorderSkippedItem, RichText, type RichTextProps, type SearchResults, type SearchState, Section, SectionContext, SectionInstance, SectionProps$1 as SectionProps, SectionSchema, type ShippingRateOption, ShopContext, type ShopWithHelpers, SizeChart, Store, type ThemeEntry, type ThemeMountContext, type ThemeMountPage, type ThemeRenderArgs, ThemeSettingsContext, ThemeSettingsV3, type UseGiftCardBalance, type UseReorder, type UseSearchOptions, type UseShippingRatesOptions, type UseShippingRatesState, type UseVariantSelection, type WishlistItem, type WishlistState, applyGlobalStyleTokens, applyImageTransform, asImageTransform, assetUrl, availableValues, buildLocaleBundle, buildThemeElement, clearSdkSingleton, collectBlocks, collectSections, computeGlobalStyleTokens, defaultVariant, defineBlock, defineSection, defineThemeEntry, dynamicSource, findVariantByOptions, flattenMessages, focalSrc, getReactSingleton, getSdkSingleton, isDefinedBlock, isDefinedSection, isDynamicSource, isSdkAvailable, mountTheme, pickTranslations, registerReactSingleton, registerSdkSingleton, resolveDynamicValue, resolveFontStack, resolveSettingsMap, resolveSizeChart, resolveSourcePath, sanitizeHtml, useAnalytics, useApp, useCart, useCheckout, useCollection, useCollectionOptional, useCollections, useCurrency, useCurrentTemplate, useCustomer, useCustomerActions, useCustomerAddresses, useDirection, useFieldTranslation, useGiftCardBalance, useImage, useLocale, useLocalization, useMoney, useNavigation, useNumberFormat, useOrder, useOrders, usePage, useProduct, useProductOptional, useProductSizeChart, useProducts, useRelatedProducts, useReorder, useResolvedSettings, useSearch, useSection, useSectionOptional, useShippingRates, useShop, useThemeSettings, useTranslation, useVariantSelection, useWishlist };
|