@shop-on/theme-runtime 0.11.1 → 0.12.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/dist/LICENSE.md +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/product-variants/types.d.ts +2 -0
- package/dist/template-types.d.ts +11 -0
- package/package.json +2 -2
package/dist/LICENSE.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ShopOn Theme Development License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026 Cody LLC. All rights reserved except as granted below.
|
|
4
4
|
|
|
5
5
|
"The Software" is this package, its source, and its documentation. "The
|
|
6
|
-
Platform" is
|
|
6
|
+
Platform" is ShopOn, the commerce platform operated by Cody LLC.
|
|
7
7
|
|
|
8
8
|
## 1. Grant
|
|
9
9
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { escapeForScriptTag } from "./json-ld-escape.js";
|
|
|
3
3
|
import { defaultPriceMaxBound } from "./listing-price.js";
|
|
4
4
|
import { Money, currencySymbol, formatMoney, formatMoneyWithCurrency } from "./money.js";
|
|
5
5
|
import { Embed, EmbedKind, PlayerEmbed, embedBackgroundSrc, parseEmbedUrl } from "./parse-embed-url.js";
|
|
6
|
+
import "./product-variants/index.js";
|
|
6
7
|
import { OptionAvailability, OptionSwatch, ProductOption, ProductOptionValue, ProductVariant, SelectedOption, SwatchVariant, VariantState } from "./product-variants/types.js";
|
|
7
8
|
import { buildAvailabilityIndex } from "./product-variants/build-availability-index.js";
|
|
8
9
|
import { ProductForVariantState, buildVariantState } from "./product-variants/build-variant-state.js";
|
|
@@ -11,7 +12,6 @@ import { isDefaultSingleVariant } from "./product-variants/is-default-single-var
|
|
|
11
12
|
import { isVariantSelectable } from "./product-variants/is-variant-selectable.js";
|
|
12
13
|
import { ResolvedVariant, resolveSelectedVariant } from "./product-variants/resolve-selected-variant.js";
|
|
13
14
|
import { selectionKey } from "./product-variants/selection-key.js";
|
|
14
|
-
import "./product-variants/index.js";
|
|
15
15
|
import { staleVariantFlag } from "./product-variants/stale-variant.js";
|
|
16
16
|
import { SwatchSource, isSwatchOption, swatchSource } from "./product-variants/swatch-source.js";
|
|
17
17
|
import { VariantPriceRange, variantPriceRange } from "./product-variants/variant-price-range.js";
|
|
@@ -19,6 +19,6 @@ import { productHref } from "./product-href.js";
|
|
|
19
19
|
import { isOnSale, savePercent } from "./sale.js";
|
|
20
20
|
import { BuildSeoHeadArgs, SEO_DESCRIPTION_MAX_LENGTH, SeoHead, buildSeoHead, canonicalPath, isNarrowedListing, localizedUrl, truncateSeoDescription } from "./seo.js";
|
|
21
21
|
import { stripPostAuthParams } from "./strip-handoff-url.js";
|
|
22
|
-
import { ArticleSchemaSource, BlockInstance, BreadcrumbSchemaSource, OrganizationSchemaSource, ProductSchemaSource, ReturnPolicySchemaSource, SectionGroupConfig, TemplateJSON, TemplateSeoSource, WebsiteSchemaSource } from "./template-types.js";
|
|
22
|
+
import { ArticleSchemaSource, BlockInstance, BreadcrumbSchemaSource, JsonValue, MetafieldMap, OrganizationSchemaSource, ProductSchemaSource, ReturnPolicySchemaSource, SectionGroupConfig, TemplateJSON, TemplateSeoSource, WebsiteSchemaSource } from "./template-types.js";
|
|
23
23
|
import { thumbhashDataUrl } from "./thumbhash.js";
|
|
24
|
-
export { ArticleSchemaSource, BlockInstance, BreadcrumbSchemaSource, BuildSeoHeadArgs, Embed, EmbedKind, Money, type OptionAvailability, type OptionSwatch, OrganizationSchemaSource, PlayerEmbed, type ProductForVariantState, type ProductOption, type ProductOptionValue, ProductSchemaSource, type ProductVariant, type ResolvedVariant, ReturnPolicySchemaSource, SEO_DESCRIPTION_MAX_LENGTH, SectionGroupConfig, type SelectedOption, SeoHead, type SwatchSource, type SwatchVariant, TemplateJSON, TemplateSeoSource, type VariantPriceRange, type VariantState, WebsiteSchemaSource, buildAvailabilityIndex, buildSeoHead, buildVariantState, canonicalPath, currencySymbol, defaultPriceMaxBound, embedBackgroundSrc, escapeForScriptTag, findClosestVariant, formatMoney, formatMoneyWithCurrency, initials, isDefaultSingleVariant, isNarrowedListing, isOnSale, isSwatchOption, isVariantSelectable, localizedUrl, parseEmbedUrl, productHref, resolveSelectedVariant, savePercent, selectionKey, staleVariantFlag, stripPostAuthParams, swatchSource, thumbhashDataUrl, truncateSeoDescription, variantPriceRange };
|
|
24
|
+
export { ArticleSchemaSource, BlockInstance, BreadcrumbSchemaSource, BuildSeoHeadArgs, Embed, EmbedKind, JsonValue, MetafieldMap, Money, type OptionAvailability, type OptionSwatch, OrganizationSchemaSource, PlayerEmbed, type ProductForVariantState, type ProductOption, type ProductOptionValue, ProductSchemaSource, type ProductVariant, type ResolvedVariant, ReturnPolicySchemaSource, SEO_DESCRIPTION_MAX_LENGTH, SectionGroupConfig, type SelectedOption, SeoHead, type SwatchSource, type SwatchVariant, TemplateJSON, TemplateSeoSource, type VariantPriceRange, type VariantState, WebsiteSchemaSource, buildAvailabilityIndex, buildSeoHead, buildVariantState, canonicalPath, currencySymbol, defaultPriceMaxBound, embedBackgroundSrc, escapeForScriptTag, findClosestVariant, formatMoney, formatMoneyWithCurrency, initials, isDefaultSingleVariant, isNarrowedListing, isOnSale, isSwatchOption, isVariantSelectable, localizedUrl, parseEmbedUrl, productHref, resolveSelectedVariant, savePercent, selectionKey, staleVariantFlag, stripPostAuthParams, swatchSource, thumbhashDataUrl, truncateSeoDescription, variantPriceRange };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Money } from "../money.js";
|
|
2
|
+
import { MetafieldMap } from "../template-types.js";
|
|
2
3
|
/** How an option value's swatch draws, from the entry the value is linked to:
|
|
3
4
|
* its colour (a CSS colour) and its image (a URL at swatch size). Null on a
|
|
4
5
|
* value no entry of a storefront-visible type is linked to. */
|
|
@@ -39,6 +40,7 @@ export type ProductVariant = {
|
|
|
39
40
|
featuredMedia: {
|
|
40
41
|
id: string;
|
|
41
42
|
} | null;
|
|
43
|
+
metafields?: MetafieldMap;
|
|
42
44
|
};
|
|
43
45
|
export type OptionAvailability = Map<string, Map<string, Set<string>>>;
|
|
44
46
|
export type VariantState = {
|
package/dist/template-types.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { TemplateBlock, TemplateSection } from "@shop-on/theme-contract";
|
|
2
2
|
export type BlockInstance = TemplateBlock;
|
|
3
|
+
/** A value as JSON holds it: what a metafield's value is on the wire, and
|
|
4
|
+
* what a server function's answer may carry. */
|
|
5
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
6
|
+
[key: string]: JsonValue;
|
|
7
|
+
};
|
|
8
|
+
/** A resource's storefront metafields keyed `"namespace.key"`, each its
|
|
9
|
+
* value type's name and its value (theme-contract's `CustomDataValue`). */
|
|
10
|
+
export type MetafieldMap = Record<string, {
|
|
11
|
+
type: string;
|
|
12
|
+
value: JsonValue;
|
|
13
|
+
}>;
|
|
3
14
|
export interface SectionGroupConfig {
|
|
4
15
|
sections: Record<string, TemplateSection>;
|
|
5
16
|
order: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shop-on/theme-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"license": "SEE LICENSE IN dist/LICENSE.md",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@shop-on/theme-contract": "0.
|
|
36
|
+
"@shop-on/theme-contract": "0.12.0",
|
|
37
37
|
"thumbhash": "0.1.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|