@liquidcommerce/elements-sdk 2.5.6-beta.2 → 2.5.6-beta.4

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.
@@ -42,7 +42,6 @@ export declare class AuthService {
42
42
  private constructor();
43
43
  static getInstance(config: IAuthConfig): AuthService;
44
44
  authenticate(): Promise<boolean>;
45
- private requestWithoutAuth;
46
45
  isTokenExpired(): boolean;
47
46
  private request;
48
47
  private buildUrl;
@@ -55,8 +55,8 @@ export interface ITelemetryComponentContext {
55
55
  }
56
56
  export interface ITelemetryUserContext {
57
57
  deviceId: string;
58
- sessionId?: string;
59
58
  isLocalStorageAvailable: boolean;
59
+ selectedAddress?: string;
60
60
  }
61
61
  export interface ITelemetryBrowserContext {
62
62
  userAgent: string;
@@ -4,6 +4,7 @@ export declare class TelemetryService {
4
4
  private eventQueue;
5
5
  private batchTimer;
6
6
  private readonly clientConfig;
7
+ private readonly store;
7
8
  private stats;
8
9
  private isShuttingDown;
9
10
  constructor();
@@ -66,7 +66,9 @@ export interface ILiquidCommerceElementsUIMethod {
66
66
  cartButton(containerId: string, showItemsCount?: boolean): void;
67
67
  floatingCartButton(showItemsCount?: boolean): void;
68
68
  cartSubtotal(elementId: string): void;
69
- cartItemsCount(elementId: string): void;
69
+ cartItemsCount(elementId: string, options?: {
70
+ hideZero: boolean;
71
+ }): void;
70
72
  }
71
73
  export interface ILiquidCommerceElementsActions {
72
74
  product: IProductActions;
@@ -329,8 +329,16 @@ data-cart-button="below:#main-navigation" <!-- Place below the target -->
329
329
  data-cart-button="below:main-navigation" <!-- Also works without # prefix -->
330
330
  data-cart-button="replace:.old-cart" <!-- Replace the target -->
331
331
  data-cart-button="inside:.header .nav" <!-- Place inside the target (default) -->
332
+
333
+ <!-- Floating cart button (no badge) -->
334
+ data-cart-button="" <!-- Empty value = floating button -->
332
335
  ```
333
336
 
337
+ **Smart Fallback Behavior:**
338
+ - If the target element is not found, automatically falls back to floating cart button
339
+ - If attribute is present but empty (`data-cart-button=""`), creates floating cart button without badge
340
+ - Element IDs are automatically prefixed with `#` if needed (e.g., `header-cart` becomes `#header-cart`)
341
+
334
342
  #### `data-cart-badge-button`
335
343
 
336
344
  **Type:** `string`
@@ -351,8 +359,17 @@ data-cart-badge-button="above:.header .logo" <!-- Place above the target --
351
359
  data-cart-badge-button="below:#main-navigation" <!-- Place below the target -->
352
360
  data-cart-badge-button="replace:.old-cart" <!-- Replace the target -->
353
361
  data-cart-badge-button="inside:.header .nav" <!-- Place inside the target (default) -->
362
+
363
+ <!-- Floating cart button with badge (default) -->
364
+ data-cart-badge-button="" <!-- Empty value = floating button with badge -->
354
365
  ```
355
366
 
367
+ **Smart Fallback Behavior:**
368
+ - If the target element is not found, automatically falls back to floating cart button with badge
369
+ - If attribute is present but empty (`data-cart-badge-button=""`), creates floating cart button with badge
370
+ - Element IDs are automatically prefixed with `#` if needed
371
+ - If neither `data-cart-button` nor `data-cart-badge-button` is provided, defaults to floating cart button with badge
372
+
356
373
  **Position Prefixes:**
357
374
  - `above:` - Place above the target element
358
375
  - `below:` - Place below the target element
@@ -363,12 +380,14 @@ data-cart-badge-button="inside:.header .nav" <!-- Place inside the target (d
363
380
 
364
381
  **Type:** flag (no value)
365
382
 
366
- Hide cart button completely.
383
+ Hide cart button completely. Use this when you want to manage cart display manually via `client.actions.cart.openCart()`.
367
384
 
368
385
  ```html
369
386
  data-cart-button-hidden
370
387
  ```
371
388
 
389
+ **Important:** When this attribute is present, the SDK will skip all cart button setup, including floating buttons. This takes precedence over `data-cart-button` and `data-cart-badge-button` attributes.
390
+
372
391
  ### Cart Button Examples
373
392
 
374
393
  **Simple cart button (no badge):**
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.5.6-beta.2",
6
+ "version": "2.5.6-beta.4",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",