@liquidcommerce/elements-sdk 2.5.6-beta.1 → 2.5.6-beta.10

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.
Files changed (60) hide show
  1. package/README.md +99 -25
  2. package/dist/index.esm.js +11375 -10521
  3. package/dist/types/constants/core.constant.d.ts +1 -0
  4. package/dist/types/core/auth.service.d.ts +0 -1
  5. package/dist/types/core/client/client-action.service.d.ts +0 -4
  6. package/dist/types/core/google-tag-manager.service.d.ts +0 -19
  7. package/dist/types/core/logger/logger.service.d.ts +0 -2
  8. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +0 -2
  9. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +0 -10
  10. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +14 -8
  11. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +0 -6
  12. package/dist/types/core/singleton-manager.service.d.ts +6 -1
  13. package/dist/types/core/store/interfaces/checkout.interface.d.ts +72 -80
  14. package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
  15. package/dist/types/core/telemetry/telemetry.interface.d.ts +1 -1
  16. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  17. package/dist/types/enums/core.enum.d.ts +15 -10
  18. package/dist/types/interfaces/cloud/checkout.interface.d.ts +1 -1
  19. package/dist/types/interfaces/configs/checkout.interface.d.ts +0 -1
  20. package/dist/types/interfaces/core.interface.d.ts +3 -1
  21. package/dist/types/modules/cart/components/cart-retailer.component.d.ts +0 -2
  22. package/dist/types/modules/checkout/checkout.commands.d.ts +25 -23
  23. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +14 -0
  24. package/dist/types/modules/checkout/components/checkout-buyer-summary.component.d.ts +7 -0
  25. package/dist/types/modules/checkout/components/{checkout-information-section.component.d.ts → checkout-buyer.component.d.ts} +5 -5
  26. package/dist/types/modules/checkout/components/checkout-deliver-to-summary.component.d.ts +7 -0
  27. package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +13 -0
  28. package/dist/types/modules/checkout/components/checkout-information.component.d.ts +17 -0
  29. package/dist/types/modules/checkout/components/{checkout-summary-section.component.d.ts → checkout-order-summary.component.d.ts} +1 -1
  30. package/dist/types/modules/checkout/components/checkout-payment-summary.component.d.ts +7 -0
  31. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +47 -0
  32. package/dist/types/modules/checkout/components/{summary/checkout-place-order-button.component.d.ts → checkout-place-order-button.component.d.ts} +1 -5
  33. package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +7 -0
  34. package/dist/types/modules/checkout/components/{information/checkout-stripe-form.component.d.ts → checkout-stripe-form.component.d.ts} +5 -3
  35. package/dist/types/modules/checkout/components/index.d.ts +22 -18
  36. package/dist/types/modules/checkout/constant.d.ts +0 -1
  37. package/dist/types/modules/product/utils/helpers.d.ts +0 -7
  38. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +4 -4
  39. package/dist/types/modules/ui-components/input/input.component.d.ts +4 -4
  40. package/docs/ACTIONS.md +29 -29
  41. package/docs/CONFIGURATION.md +20 -1
  42. package/docs/EVENTS.md +62 -29
  43. package/docs/THEMING.md +2 -5
  44. package/package.json +7 -7
  45. package/umd/elements.js +1 -1
  46. package/dist/types/modules/checkout/checkout.commands.helper.d.ts +0 -13
  47. package/dist/types/modules/checkout/components/information/checkout-billing-form.component.d.ts +0 -18
  48. package/dist/types/modules/checkout/components/information/checkout-buyer-information-form.component.d.ts +0 -12
  49. package/dist/types/modules/checkout/components/information/checkout-delivery-information-form.component.d.ts +0 -17
  50. package/dist/types/modules/checkout/components/information/checkout-payment-form.component.d.ts +0 -21
  51. /package/dist/types/modules/checkout/components/{summary/checkout-amounts.component.d.ts → checkout-amounts.component.d.ts} +0 -0
  52. /package/dist/types/modules/checkout/components/{summary/checkout-completed.component.d.ts → checkout-completed.component.d.ts} +0 -0
  53. /package/dist/types/modules/checkout/components/{summary/checkout-gift-cards.component.d.ts → checkout-gift-cards.component.d.ts} +0 -0
  54. /package/dist/types/modules/checkout/components/{summary/checkout-item-quantity.component.d.ts → checkout-item-quantity.component.d.ts} +0 -0
  55. /package/dist/types/modules/checkout/components/{summary/checkout-item.component.d.ts → checkout-item.component.d.ts} +0 -0
  56. /package/dist/types/modules/checkout/components/{summary/checkout-items.component.d.ts → checkout-items.component.d.ts} +0 -0
  57. /package/dist/types/modules/checkout/components/{summary/checkout-presale-expired.component.d.ts → checkout-presale-expired.component.d.ts} +0 -0
  58. /package/dist/types/modules/checkout/components/{summary/checkout-promo-code.component.d.ts → checkout-promo-code.component.d.ts} +0 -0
  59. /package/dist/types/modules/checkout/components/{summary/checkout-tips.component.d.ts → checkout-tips.component.d.ts} +0 -0
  60. /package/dist/types/modules/checkout/components/{summary/promo-pc-gc.component.d.ts → promo-pc-gc.component.d.ts} +0 -0
package/docs/EVENTS.md CHANGED
@@ -293,10 +293,13 @@ window.addEventListener('lce:actions.cart_loaded', function(event) {
293
293
  'lce:actions.checkout_submit_completed' // → "SALE COMPLETED! 🎉"
294
294
  'lce:actions.checkout_submit_failed' // → "Sale lost - fix the issue!"
295
295
 
296
- // Form updates
296
+ // Form updates (Security: returns boolean only, no sensitive data)
297
297
  'lce:actions.checkout_customer_information_updated' // → "Customer filling out details"
298
+ // Data: boolean (true) - No customer data exposed for security
298
299
  'lce:actions.checkout_billing_information_updated' // → "Payment info being entered"
300
+ // Data: boolean (true) - No billing data exposed for security
299
301
  'lce:actions.checkout_gift_information_updated' // → "Gift recipient info updated"
302
+ // Data: boolean (true) - No recipient data exposed for security
300
303
 
301
304
  // Checkout options
302
305
  'lce:actions.checkout_is_gift_toggled' // → "Customer toggled gift option"
@@ -313,7 +316,37 @@ window.addEventListener('lce:actions.cart_loaded', function(event) {
313
316
  'lce:actions.checkout_tip_updated' // → "Customer updated delivery tip"
314
317
  ```
315
318
 
316
- **Important Note on Checkout Personalization:**
319
+ **🔒 Security Note on Form Update Events:**
320
+ The following events return only a boolean `true` value instead of customer data for security reasons:
321
+ - `checkout_customer_information_updated` - No customer contact details exposed
322
+ - `checkout_billing_information_updated` - No payment or billing address details exposed
323
+ - `checkout_gift_information_updated` - No gift recipient details exposed
324
+
325
+ This design prevents malicious scripts from intercepting sensitive customer information (names, emails, phone numbers, addresses, etc.) while still allowing you to track form completion for analytics. **This is intentional and prioritizes customer privacy and security.**
326
+
327
+ ```javascript
328
+ // ✅ Correct: Track form completion securely
329
+ window.addEventListener('lce:actions.checkout_customer_information_updated', function(event) {
330
+ const completed = event.detail.data; // boolean: true
331
+
332
+ // Track the milestone without exposing customer data
333
+ analytics.track('Checkout Step Completed', { step: 'customer_info' });
334
+ updateProgressBar('customer_info');
335
+ });
336
+
337
+ window.addEventListener('lce:actions.checkout_billing_information_updated', function(event) {
338
+ const completed = event.detail.data; // boolean: true
339
+
340
+ // Track billing form completion
341
+ analytics.track('Checkout Step Completed', { step: 'billing_info' });
342
+ updateProgressBar('billing_info');
343
+ });
344
+
345
+ // 🚫 You will NOT receive customer data like names, emails, addresses, etc.
346
+ // This protects your customers from malicious scripts and data breaches.
347
+ ```
348
+
349
+ **Important Note on Checkout Personalization:**
317
350
  Personalization cannot be edited during checkout - only removed. This is by design to prevent order processing complications. If a customer wants to modify personalization, they must return to the cart. The checkout only displays personalization details and provides a remove option.
318
351
 
319
352
  #### Checkout Details Event Data
@@ -432,48 +465,48 @@ These events fire when programmatic actions succeed or fail, giving you complete
432
465
  'lce:actions.cart_product_add_success' // → "Products successfully added to cart"
433
466
  // Data: { itemsAdded: number, identifiers: string[] }
434
467
 
435
- 'lce:actions.cart_product_add_failed' // → "Products could not be added to cart"
468
+ 'lce:actions.cart_product_add_failed' // → "Products could not be added to cart"
436
469
  // Data: { identifiers: string[], error: string }
437
470
 
438
471
  // Promo code feedback
439
472
  'lce:actions.cart_promo_code_applied' // → "Promo code worked - show success!"
440
- // Data: { applied: true, discountAmount?: number, newTotal?: number }
473
+ // Data: { discountAmount?: number, newTotal?: number }
441
474
 
442
475
  'lce:actions.cart_promo_code_removed' // → "Promo code removed successfully"
443
- // Data: { applied: false }
476
+ // Data: { newTotal?: number }
444
477
 
445
478
  'lce:actions.cart_promo_code_failed' // → "Promo code didn't work - show error"
446
- // Data: { attempted: true, error: string }
479
+ // Data: { error: string }
447
480
  ```
448
481
 
449
482
  #### 💳 **Checkout Action Feedback**
450
483
  ```javascript
451
484
  // Product addition feedback
452
485
  'lce:actions.checkout_product_add_success' // → "Products added to checkout successfully"
453
- // Data: { itemsAdded: number, identifiers: string[] }
486
+ // Data: { itemsAdded: number, identifiers: string[], isPresale?: boolean }
454
487
 
455
488
  'lce:actions.checkout_product_add_failed' // → "Could not add products to checkout"
456
- // Data: { identifiers: string[], error: string }
489
+ // Data: { identifiers: string[], error: string, isPresale?: boolean }
457
490
 
458
491
  // Promo code feedback
459
492
  'lce:actions.checkout_promo_code_applied' // → "Checkout discount applied!"
460
- // Data: { applied: true, discountAmount?: number, newTotal?: number }
493
+ // Data: { discountAmount?: number, newTotal?: number }
461
494
 
462
495
  'lce:actions.checkout_promo_code_removed' // → "Checkout discount removed"
463
- // Data: { applied: false }
496
+ // Data: { newTotal?: number }
464
497
 
465
498
  'lce:actions.checkout_promo_code_failed' // → "Checkout discount failed"
466
- // Data: { attempted: true, error: string }
499
+ // Data: { error: string }
467
500
 
468
- // Gift card feedback
501
+ // Gift card feedback
469
502
  'lce:actions.checkout_gift_card_applied' // → "Gift card applied successfully!"
470
- // Data: { applied: true, newTotal?: number }
503
+ // Data: { newTotal?: number }
471
504
 
472
505
  'lce:actions.checkout_gift_card_removed' // → "Gift card removed"
473
- // Data: { applied: false }
506
+ // Data: { newTotal?: number }
474
507
 
475
508
  'lce:actions.checkout_gift_card_failed' // → "Gift card could not be applied"
476
- // Data: { attempted: true, error: string }
509
+ // Data: { error: string }
477
510
  ```
478
511
 
479
512
  #### 🔒 **Security Note**
@@ -484,12 +517,12 @@ Action feedback events **never expose sensitive information** like promo codes o
484
517
  // Fire the action (simple)
485
518
  await actions.cart.applyPromoCode('SECRET20');
486
519
 
487
- // Get feedback (secure)
520
+ // Get feedback (secure)
488
521
  window.addEventListener('lce:actions.cart_promo_code_applied', function(event) {
489
- const { applied, discountAmount, newTotal } = event.detail.data;
490
- // ✅ You get: success status, discount amount, new total
522
+ const { discountAmount, newTotal } = event.detail.data;
523
+ // ✅ You get: discount amount, new total
491
524
  // 🚫 You DON'T get: 'SECRET20' (secure!)
492
-
525
+
493
526
  showSuccessMessage(`🎉 Discount applied! You saved $${discountAmount}!`);
494
527
  updateCartTotal(newTotal);
495
528
  });
@@ -506,32 +539,32 @@ async function applyPromoCodeWithFeedback(code) {
506
539
 
507
540
  // Set up event listeners BEFORE firing action
508
541
  const successHandler = (event) => {
509
- const { applied, discountAmount, newTotal } = event.detail.data;
542
+ const { discountAmount, newTotal } = event.detail.data;
510
543
  hideLoadingMessage();
511
544
  showSuccessMessage(`🎉 Success! You saved $${discountAmount}!`);
512
545
  updatePriceDisplay(newTotal);
513
-
546
+
514
547
  // Track successful promo usage
515
- analytics.track('Promo Applied', {
548
+ analytics.track('Promo Applied', {
516
549
  discount: discountAmount,
517
- newTotal: newTotal
550
+ newTotal: newTotal
518
551
  });
519
-
552
+
520
553
  // Clean up
521
554
  cleanup();
522
555
  };
523
-
556
+
524
557
  const failureHandler = (event) => {
525
- const { attempted, error } = event.detail.data;
558
+ const { error } = event.detail.data;
526
559
  hideLoadingMessage();
527
560
  showErrorMessage('Promo code could not be applied. Please try again.');
528
-
561
+
529
562
  // Track failed attempts (for optimization)
530
563
  analytics.track('Promo Failed', { error: error });
531
-
564
+
532
565
  // Maybe suggest alternatives
533
566
  suggestAlternativePromos();
534
-
567
+
535
568
  // Clean up
536
569
  cleanup();
537
570
  };
package/docs/THEMING.md CHANGED
@@ -284,7 +284,6 @@ interface ICheckoutComponent {
284
284
  thankYouButtonText: string;
285
285
  drawerHeaderText: string;
286
286
  placeOrderButtonText: string;
287
- placeOrderButtonShowRequiredFields: boolean;
288
287
  };
289
288
  }
290
289
  ```
@@ -319,8 +318,7 @@ customTheme: {
319
318
  exitUrl: '/',
320
319
  thankYouButtonText: 'Continue Shopping',
321
320
  drawerHeaderText: 'Checkout',
322
- placeOrderButtonText: 'Place Order',
323
- placeOrderButtonShowRequiredFields: true
321
+ placeOrderButtonText: 'Place Order'
324
322
  }
325
323
  }
326
324
  }
@@ -441,8 +439,7 @@ const client = await Elements('YOUR_API_KEY', {
441
439
  exitUrl: '/',
442
440
  thankYouButtonText: 'Continue Shopping',
443
441
  drawerHeaderText: 'Checkout',
444
- placeOrderButtonText: 'Place Order',
445
- placeOrderButtonShowRequiredFields: true
442
+ placeOrderButtonText: 'Place Order'
446
443
  }
447
444
  },
448
445
  address: {
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.1",
6
+ "version": "2.5.6-beta.10",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",
@@ -50,7 +50,7 @@
50
50
  "type-check": "tsc --noEmit",
51
51
  "lint": "pnpm biome lint --write",
52
52
  "format": "biome format --write",
53
- "check": "pnpm biome check --write",
53
+ "check": "pnpm biome check --write .",
54
54
  "fl": "pnpm check && pnpm build:dev",
55
55
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
56
56
  "clean": "rm -rf dist umd",
@@ -71,7 +71,7 @@
71
71
  "embeddable commerce"
72
72
  ],
73
73
  "devDependencies": {
74
- "@biomejs/biome": "2.3.3",
74
+ "@biomejs/biome": "2.3.5",
75
75
  "@commitlint/cli": "^20.1.0",
76
76
  "@commitlint/config-conventional": "^20.0.0",
77
77
  "@rollup/plugin-alias": "^6.0.0",
@@ -83,18 +83,18 @@
83
83
  "@semantic-release/changelog": "^6.0.3",
84
84
  "@semantic-release/commit-analyzer": "^13.0.1",
85
85
  "@semantic-release/git": "^10.0.1",
86
- "@semantic-release/github": "^12.0.1",
86
+ "@semantic-release/github": "^12.0.2",
87
87
  "@semantic-release/npm": "^13.1.1",
88
88
  "@semantic-release/release-notes-generator": "^14.1.0",
89
89
  "@types/core-js": "^2.5.8",
90
- "@types/node": "^24.10.0",
90
+ "@types/node": "^24.10.1",
91
91
  "conventional-changelog-cli": "^5.0.0",
92
92
  "husky": "^9.1.7",
93
93
  "process": "^0.11.10",
94
- "rollup": "^4.52.5",
94
+ "rollup": "^4.53.2",
95
95
  "rollup-obfuscator": "^4.1.1",
96
96
  "rollup-plugin-typescript2": "^0.36.0",
97
- "semantic-release": "^25.0.1",
97
+ "semantic-release": "^25.0.2",
98
98
  "ts-node": "^10.9.2",
99
99
  "typescript": "^5.9.3"
100
100
  },