@liquidcommerce/elements-sdk 2.6.0-beta.100 → 2.6.0-beta.102

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.
@@ -1,3 +1,4 @@
1
+ import type { FulfillmentType } from '@/enums';
1
2
  import type { DeepPartial } from '@/interfaces/config.interface';
2
3
  export type FulfillmentDisplayType = 'carousel' | 'popup';
3
4
  export type DescriptionPositionType = 'above' | 'below';
@@ -13,6 +14,7 @@ export interface IProductLayout {
13
14
  fulfillmentDisplay: FulfillmentDisplayType;
14
15
  enableShippingFulfillment: boolean;
15
16
  enableOnDemandFulfillment: boolean;
17
+ primaryFulfillmentMethod: FulfillmentType;
16
18
  addToCartButtonText: string;
17
19
  addToCartButtonShowTotalPrice: boolean;
18
20
  buyNowButtonText: string;
@@ -7,6 +7,7 @@ export declare class CheckoutPresaleCountdownComponent extends BaseComponent<nul
7
7
  private expiresAt;
8
8
  private initialDurationSeconds;
9
9
  private rootElement;
10
+ private lastRenderedTime;
10
11
  private scrollHandler;
11
12
  private scrollContainer;
12
13
  private isCurrentlyScrolled;
@@ -12,7 +12,7 @@ export declare function renderPopupRetailerCard({ fulfillment, selectedFulfillme
12
12
  selectedSizeAttributes: IProductSizeAttributes | null;
13
13
  interactive?: boolean;
14
14
  }): HTMLElement;
15
- export declare function renderFulfillmentTabsContainer({ shippingFulfillments, onDemandFulfillments, shippingSelected, onDemandSelected, onTabClick, enableShippingFulfillment, enableOnDemandFulfillment, }: {
15
+ export declare function renderFulfillmentTabsContainer({ shippingFulfillments, onDemandFulfillments, shippingSelected, onDemandSelected, onTabClick, enableShippingFulfillment, enableOnDemandFulfillment, primaryFulfillmentMethod, }: {
16
16
  shippingFulfillments: IProductFulfillmentStore[];
17
17
  onDemandFulfillments: IProductFulfillmentStore[];
18
18
  shippingSelected: boolean;
@@ -20,4 +20,5 @@ export declare function renderFulfillmentTabsContainer({ shippingFulfillments, o
20
20
  onTabClick: (event: Event) => void;
21
21
  enableShippingFulfillment: boolean;
22
22
  enableOnDemandFulfillment: boolean;
23
+ primaryFulfillmentMethod: FulfillmentType;
23
24
  }): HTMLElement;
@@ -2,6 +2,7 @@ export declare function centToDollar(cent: number): number;
2
2
  export declare function formatCentToDollarText(cent: number, showZeroDecimals?: boolean): string;
3
3
  export declare function htmlStringToElement(htmlString: string): HTMLElement;
4
4
  export declare function formatISODateToMMDDYYYY(isoDateString: string | null | undefined): string;
5
+ export declare function formatISOInstantToMMDDYYYY(isoInstant: string | null | undefined, timeZone?: string): string;
5
6
  export declare function capitalizeFirstLetter(text: string): string;
6
7
  export declare function splitCategoryPath(catPath?: string): {
7
8
  category: string;
@@ -1,15 +1,18 @@
1
1
  import type { IProductStore } from '@/core/store/interfaces/product.interface';
2
2
  import type { IPLProductStore } from '@/core/store/interfaces/product-list.interface';
3
+ import { type FulfillmentType } from '@/enums';
3
4
  import type { IProduct, IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
4
5
  export interface IPrepareApiProductForStoreParams {
5
6
  context: 'product-list' | 'product-page';
6
7
  product: IProduct;
7
8
  retailers: IProductAvailabilityResponse['retailers'];
8
9
  enableShippingFulfillment: boolean;
10
+ enableOnDemandFulfillment?: boolean;
11
+ primaryFulfillmentMethod?: FulfillmentType;
9
12
  }
10
13
  export declare function buildSizeLabel(size: {
11
14
  size: string;
12
15
  pack: boolean;
13
16
  packDesc: string;
14
17
  }): string;
15
- export declare function prepareApiProductForStore({ context, product, retailers, enableShippingFulfillment, }: IPrepareApiProductForStoreParams): IProductStore | IPLProductStore;
18
+ export declare function prepareApiProductForStore({ context, product, retailers, enableShippingFulfillment, enableOnDemandFulfillment, primaryFulfillmentMethod, }: IPrepareApiProductForStoreParams): IProductStore | IPLProductStore;
@@ -1,3 +1,9 @@
1
+ export declare const BUSINESS_CONTRACT_TIMEZONE = "America/New_York";
2
+ export declare function getDatePartsInTimezone(instant: Date, timeZone: string): {
3
+ year: string;
4
+ month: string;
5
+ day: string;
6
+ } | null;
1
7
  export declare function detectUserTimezone(addressState?: string): string;
2
8
  export declare function getCurrentTimeInTimezone(timezone: string): Date;
3
9
  export declare function getCurrentTimeInUserTimezone(addressState?: string): Date;
@@ -201,6 +201,7 @@ interface IProductLayout {
201
201
  fulfillmentDisplay: 'carousel' | 'popup';
202
202
  enableShippingFulfillment: boolean;
203
203
  enableOnDemandFulfillment: boolean;
204
+ primaryFulfillmentMethod: 'shipping' | 'onDemand';
204
205
  addToCartButtonText: string;
205
206
  addToCartButtonShowTotalPrice: boolean;
206
207
  buyNowButtonText: string;
@@ -223,6 +224,7 @@ interface IProductLayout {
223
224
  | `fulfillmentDisplay` | `'carousel' \| 'popup'` | How to display fulfillment/retailer options |
224
225
  | `enableShippingFulfillment` | `boolean` | Enable shipping fulfillment option |
225
226
  | `enableOnDemandFulfillment` | `boolean` | Enable on-demand delivery option |
227
+ | `primaryFulfillmentMethod` | `'shipping' \| 'onDemand'` | Fulfillment method shown first and selected by default; falls back to the other enabled method when it has no availability |
226
228
  | `addToCartButtonText` | `string` | Custom text for add-to-cart button |
227
229
  | `addToCartButtonShowTotalPrice` | `boolean` | Show total price on add-to-cart button |
228
230
  | `buyNowButtonText` | `string` | Custom text for buy-now button |
@@ -375,6 +375,7 @@ const client = await Elements('YOUR_API_KEY', {
375
375
  fulfillmentDisplay: 'carousel', // or 'popup'
376
376
  enableShippingFulfillment: true,
377
377
  enableOnDemandFulfillment: true,
378
+ primaryFulfillmentMethod: 'shipping', // or 'onDemand'
378
379
  addToCartButtonText: 'Add to Cart',
379
380
  addToCartButtonShowTotalPrice: true,
380
381
  buyNowButtonText: 'Buy Now',
@@ -118,6 +118,7 @@ customTheme: {
118
118
  fulfillmentDisplay: 'carousel',
119
119
  enableShippingFulfillment: true,
120
120
  enableOnDemandFulfillment: true,
121
+ primaryFulfillmentMethod: 'shipping',
121
122
  addToCartButtonText: 'Add to Cart',
122
123
  addToCartButtonShowTotalPrice: true,
123
124
  buyNowButtonText: 'Buy Now',
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.6.0-beta.100",
6
+ "version": "2.6.0-beta.102",
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.18.0",
17
+ "packageManager": "pnpm@11.21.0",
18
18
  "exports": {
19
19
  ".": {
20
20
  "types": "./dist/types/index.d.ts",
@@ -107,9 +107,9 @@
107
107
  "theming"
108
108
  ],
109
109
  "devDependencies": {
110
- "@biomejs/biome": "^2.5.6",
111
- "@commitlint/cli": "^21.2.1",
112
- "@commitlint/config-conventional": "^21.2.0",
110
+ "@biomejs/biome": "^2.5.8",
111
+ "@commitlint/cli": "^21.2.2",
112
+ "@commitlint/config-conventional": "^21.2.2",
113
113
  "@rollup/plugin-alias": "^6.0.0",
114
114
  "@rollup/plugin-commonjs": "^29.0.3",
115
115
  "@rollup/plugin-json": "^6.1.0",
@@ -123,14 +123,14 @@
123
123
  "@semantic-release/npm": "^13.1.5",
124
124
  "@semantic-release/release-notes-generator": "^14.1.1",
125
125
  "@types/core-js": "^2.5.8",
126
- "@types/node": "^26.1.2",
127
- "conventional-changelog": "8.1.0",
126
+ "@types/node": "^26.2.0",
127
+ "conventional-changelog": "8.1.3",
128
128
  "husky": "^9.1.7",
129
129
  "process": "^0.11.10",
130
- "rollup": "^4.62.3",
130
+ "rollup": "^4.62.4",
131
131
  "rollup-obfuscator": "^4.1.1",
132
132
  "rollup-plugin-typescript2": "^0.37.0",
133
- "semantic-release": "^25.0.8",
133
+ "semantic-release": "^25.0.9",
134
134
  "ts-node": "^10.9.2",
135
135
  "typescript": "6.0.3"
136
136
  },