@liquidcommerce/elements-sdk 2.7.22 → 2.7.24
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/index.checkout.esm.js +7131 -7062
- package/dist/index.esm.js +11588 -11471
- package/dist/types/auto-initialize/shared-utils.d.ts +1 -0
- package/dist/types/clients/builder.d.ts +1 -1
- package/dist/types/clients/checkout.d.ts +1 -1
- package/dist/types/clients/main.d.ts +1 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +2 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +1 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +1 -0
- package/dist/types/utils/image-bg-removal.d.ts +3 -0
- package/dist/types/utils/product.d.ts +5 -0
- package/docs/v1/guides/product-component.md +22 -0
- package/package.json +9 -8
|
@@ -39,6 +39,7 @@ export declare function getProductUrlsConfig(): ProductUrlsConfig | undefined;
|
|
|
39
39
|
export declare function triggerAutoInit(initFunction: () => Promise<void>, errorPrefix: string): void;
|
|
40
40
|
export declare function setupCheckout(script: HTMLScriptElement, injectFn: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>, exitCheckoutFn: () => void, options: {
|
|
41
41
|
errorPrefix: string;
|
|
42
|
+
warnIfMissing?: boolean;
|
|
42
43
|
}): Promise<void>;
|
|
43
44
|
export declare function setupExitCheckoutHandlers(exitCheckoutFn: () => void): void;
|
|
44
45
|
export declare function addProductViaQueryParam(actions: IQueryParamActions, script: HTMLScriptElement, errorPrefix: string): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ILiquidCommerceElementsBuilderClient } from '@/interfaces/client.interface';
|
|
2
2
|
import type { ILiquidCommerceElementsBuilderConfig } from '@/interfaces/config.interface';
|
|
3
|
-
export declare function ElementsBuilder(apiKey: string, config
|
|
3
|
+
export declare function ElementsBuilder(apiKey: string, config?: ILiquidCommerceElementsBuilderConfig): Promise<ILiquidCommerceElementsBuilderClient | null>;
|
|
@@ -3,4 +3,4 @@ import type { ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/c
|
|
|
3
3
|
import '@/modules/theme-provider/styles/register-styles';
|
|
4
4
|
import '@/modules/address/styles/register-styles';
|
|
5
5
|
import '@/modules/checkout/styles/register-styles';
|
|
6
|
-
export declare function ElementsCheckout(apiKey: string, config
|
|
6
|
+
export declare function ElementsCheckout(apiKey: string, config?: ILiquidCommerceElementsCheckoutClientConfig): Promise<IElementsCheckoutClient | null>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ILiquidCommerceElementsClient } from '@/interfaces/client.interface';
|
|
2
2
|
import type { ILiquidCommerceElementsConfig } from '@/interfaces/config.interface';
|
|
3
|
-
export declare function Elements(apiKey: string, config
|
|
3
|
+
export declare function Elements(apiKey: string, config?: ILiquidCommerceElementsConfig): Promise<ILiquidCommerceElementsClient | null>;
|
|
@@ -40,6 +40,8 @@ export interface IGlobalLayout {
|
|
|
40
40
|
personalizationCardStyle: 'outlined' | 'filled';
|
|
41
41
|
allowPromoCodes: boolean;
|
|
42
42
|
inputFieldStyle: 'outlined' | 'filled';
|
|
43
|
+
enableOrderedProductSizes: boolean;
|
|
44
|
+
orderedProductSizes: string[];
|
|
43
45
|
showPoweredBy: boolean;
|
|
44
46
|
poweredByMode: 'light' | 'dark';
|
|
45
47
|
}
|
|
@@ -8,6 +8,7 @@ export interface IImageCarouselParams {
|
|
|
8
8
|
export declare class ProductImageCarouselComponent extends BaseComponent<IImageCarouselParams, IProductComponent> {
|
|
9
9
|
get hostClasses(): string[];
|
|
10
10
|
private mainImageElement;
|
|
11
|
+
private mainImageMediaElement;
|
|
11
12
|
private galleryViewport;
|
|
12
13
|
private galleryContainer;
|
|
13
14
|
private thumbnails;
|
package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface IProductListProductPreCartComponentParams {
|
|
|
5
5
|
productId: string;
|
|
6
6
|
}
|
|
7
7
|
export declare class ProductListProductPreCartComponent extends BaseComponent<IProductListProductPreCartComponentParams, IProductListComponent> {
|
|
8
|
+
get hostClasses(): string[];
|
|
8
9
|
private showRetailersContent;
|
|
9
10
|
private showEngravingForm;
|
|
10
11
|
private isInitialRender;
|
|
@@ -7,4 +7,9 @@ export interface IPrepareApiProductForStoreParams {
|
|
|
7
7
|
retailers: IProductAvailabilityResponse['retailers'];
|
|
8
8
|
enableShippingFulfillment: boolean;
|
|
9
9
|
}
|
|
10
|
+
export declare function buildSizeLabel(size: {
|
|
11
|
+
size: string;
|
|
12
|
+
pack: boolean;
|
|
13
|
+
packDesc: string;
|
|
14
|
+
}): string;
|
|
10
15
|
export declare function prepareApiProductForStore({ context, product, retailers, enableShippingFulfillment, }: IPrepareApiProductForStoreParams): IProductStore | IPLProductStore;
|
|
@@ -157,6 +157,28 @@ For products with multiple sizes:
|
|
|
157
157
|
- Availability checking per size
|
|
158
158
|
- Out-of-stock indication
|
|
159
159
|
|
|
160
|
+
#### Preselect a Size via URL
|
|
161
|
+
|
|
162
|
+
Use the `lce_size` query parameter to preselect a size when the product page loads:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
https://yoursite.com/products/buffalo-trace?lce_size=750ml
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
- The value is compared against each size's full label as shown on the page.
|
|
169
|
+
- Matching is case-insensitive and ignores spacing and punctuation — only letters, digits, and decimal points are compared — so `750 ML`, `750ml`, and `750ML` all select a `750ml` size, while decimals are kept so `1.0L` and `1.75L` stay distinct.
|
|
170
|
+
- If the value matches no size, the default size selection is used.
|
|
171
|
+
|
|
172
|
+
**Pack sizes:** the label includes the pack description when present (e.g. `50 ML (12PK)`). To select that size, include the pack in the value:
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
https://yoursite.com/products/mini-bottles?lce_size=50ml(12pk)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Both `50ml(12pk)` and `50ml12pk` match `50 ML (12PK)` (punctuation is ignored). A value of just `50ml` only matches a size whose label is `50 ML` with no pack.
|
|
179
|
+
|
|
180
|
+
`lce_size` is a fixed parameter name (not configured through a script attribute) and only applies to the product page.
|
|
181
|
+
|
|
160
182
|
### Fulfillment Types
|
|
161
183
|
|
|
162
184
|
Two fulfillment options:
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "LiquidCommerce Elements SDK",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "LiquidCommerce Team",
|
|
6
|
-
"version": "2.7.
|
|
6
|
+
"version": "2.7.24",
|
|
7
7
|
"homepage": "https://docs.liquidcommerce.co/elements-sdk",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"module": "./dist/index.esm.js",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
|
-
"packageManager": "pnpm@11.
|
|
17
|
+
"packageManager": "pnpm@11.10.0",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"build": "rollup -c",
|
|
54
54
|
"build:checkout": "rollup -c rollup.config.checkout.mjs",
|
|
55
55
|
"build:all": "pnpm build && pnpm build:checkout",
|
|
56
|
+
"build:demo-site": "pnpm build:all && mkdir -p demo-site/sdk && cp umd/elements.js umd/elements-checkout.js demo-site/sdk/",
|
|
56
57
|
"dev": "rollup -c -w",
|
|
57
58
|
"type-check": "tsc --noEmit",
|
|
58
59
|
"lint": "pnpm biome lint --write",
|
|
@@ -77,9 +78,9 @@
|
|
|
77
78
|
"embeddable commerce"
|
|
78
79
|
],
|
|
79
80
|
"devDependencies": {
|
|
80
|
-
"@biomejs/biome": "^2.5.
|
|
81
|
-
"@commitlint/cli": "^21.0
|
|
82
|
-
"@commitlint/config-conventional": "^21.0
|
|
81
|
+
"@biomejs/biome": "^2.5.2",
|
|
82
|
+
"@commitlint/cli": "^21.2.0",
|
|
83
|
+
"@commitlint/config-conventional": "^21.2.0",
|
|
83
84
|
"@rollup/plugin-alias": "^6.0.0",
|
|
84
85
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
85
86
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -89,12 +90,12 @@
|
|
|
89
90
|
"@semantic-release/changelog": "^6.0.3",
|
|
90
91
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
91
92
|
"@semantic-release/git": "^10.0.1",
|
|
92
|
-
"@semantic-release/github": "^12.0.
|
|
93
|
+
"@semantic-release/github": "^12.0.9",
|
|
93
94
|
"@semantic-release/npm": "^13.1.5",
|
|
94
95
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
95
96
|
"@types/core-js": "^2.5.8",
|
|
96
|
-
"@types/node": "^26.
|
|
97
|
-
"conventional-changelog": "
|
|
97
|
+
"@types/node": "^26.1.0",
|
|
98
|
+
"conventional-changelog": "8.0.1",
|
|
98
99
|
"husky": "^9.1.7",
|
|
99
100
|
"process": "^0.11.10",
|
|
100
101
|
"rollup": "^4.62.2",
|