@liquidcommerce/elements-sdk 2.6.0-beta.2 → 2.6.0-beta.21
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/README.md +7 -7
- package/dist/index.esm.js +11602 -11122
- package/dist/types/constants/core.constant.d.ts +11 -0
- package/dist/types/core/api/api-client.service.d.ts +15 -15
- package/dist/types/core/api/auth-client.service.d.ts +34 -23
- package/dist/types/core/api/http-client.service.d.ts +0 -1
- package/dist/types/core/client/client-action.service.d.ts +18 -12
- package/dist/types/core/client/client-config.service.d.ts +3 -0
- package/dist/types/core/command/base-command.service.d.ts +2 -2
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +14 -11
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +44 -50
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +5 -4
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
- package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -55
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +16 -107
- package/dist/types/core/store/interfaces/core.interface.d.ts +7 -5
- package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
- package/dist/types/core/store/store.constant.d.ts +1 -1
- package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
- package/dist/types/elements-base-client.d.ts +1 -1
- package/dist/types/enums/cloud.enum.d.ts +19 -76
- package/dist/types/enums/core.enum.d.ts +25 -0
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +95 -0
- package/dist/types/interfaces/api/checkout.interface.d.ts +213 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
- package/dist/types/interfaces/api/product.interface.d.ts +106 -0
- package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
- package/dist/types/interfaces/core.interface.d.ts +7 -1
- package/dist/types/modules/address/address.command.d.ts +3 -3
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/cart/cart.commands.d.ts +4 -5
- package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
- package/dist/types/modules/checkout/checkout.commands.d.ts +18 -9
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/constant.d.ts +3 -0
- package/dist/types/modules/product/components/components.d.ts +2 -4
- package/dist/types/modules/product/product.commands.d.ts +3 -2
- package/dist/types/modules/product-list/components/index.d.ts +2 -0
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
- package/dist/types/modules/product-list/product-list.commands.d.ts +4 -2
- package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
- package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +1 -0
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
- package/dist/types/static/icon/filter.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/format.d.ts +0 -13
- package/docs/ACTIONS.md +13 -13
- package/docs/EVENTS.md +7 -7
- package/package.json +8 -9
- package/umd/elements.js +1 -1
- package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
- package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -214
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -7
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
- package/dist/types/utils/helper.d.ts +0 -27
package/docs/ACTIONS.md
CHANGED
|
@@ -26,8 +26,8 @@ await actions.cart.applyPromoCode('SAVE20');
|
|
|
26
26
|
|
|
27
27
|
// 2. Listen for success/failure feedback via events
|
|
28
28
|
window.addEventListener('lce:actions.cart_promo_code_applied', function(event) {
|
|
29
|
-
const {
|
|
30
|
-
showSuccessMessage(`🎉 Promo applied! You saved $${
|
|
29
|
+
const { discount, newTotal } = event.detail.data;
|
|
30
|
+
showSuccessMessage(`🎉 Promo applied! You saved $${discount}!`);
|
|
31
31
|
updateCartDisplay(newTotal);
|
|
32
32
|
});
|
|
33
33
|
|
|
@@ -262,7 +262,7 @@ All actions provide feedback through events. Here are all available success/fail
|
|
|
262
262
|
'lce:actions.cart_product_add_failed' // { identifiers: string[], error: string }
|
|
263
263
|
|
|
264
264
|
// Promo code management
|
|
265
|
-
'lce:actions.cart_promo_code_applied' // {
|
|
265
|
+
'lce:actions.cart_promo_code_applied' // { discount?: number, newTotal?: number }
|
|
266
266
|
'lce:actions.cart_promo_code_removed' // { newTotal?: number }
|
|
267
267
|
'lce:actions.cart_promo_code_failed' // { error: string }
|
|
268
268
|
```
|
|
@@ -274,7 +274,7 @@ All actions provide feedback through events. Here are all available success/fail
|
|
|
274
274
|
'lce:actions.checkout_product_add_failed' // { identifiers: string[], error: string, isPresale?: boolean }
|
|
275
275
|
|
|
276
276
|
// Promo code management
|
|
277
|
-
'lce:actions.checkout_promo_code_applied' // {
|
|
277
|
+
'lce:actions.checkout_promo_code_applied' // { discount?: number, newTotal?: number }
|
|
278
278
|
'lce:actions.checkout_promo_code_removed' // { newTotal?: number }
|
|
279
279
|
'lce:actions.checkout_promo_code_failed' // { error: string }
|
|
280
280
|
|
|
@@ -335,10 +335,10 @@ window.addEventListener('lce:actions.cart_product_add_success', function(event)
|
|
|
335
335
|
```javascript
|
|
336
336
|
// ✅ Create reusable handlers
|
|
337
337
|
const handlePromoSuccess = (event) => {
|
|
338
|
-
const {
|
|
339
|
-
showSuccessMessage(`Discount applied! Saved: $${
|
|
338
|
+
const { discount, newTotal } = event.detail.data;
|
|
339
|
+
showSuccessMessage(`Discount applied! Saved: $${discount}`);
|
|
340
340
|
updatePriceDisplay(newTotal);
|
|
341
|
-
trackPromoSuccess(
|
|
341
|
+
trackPromoSuccess(discount);
|
|
342
342
|
};
|
|
343
343
|
|
|
344
344
|
const handlePromoFailure = (event) => {
|
|
@@ -472,12 +472,12 @@ await actions.cart.applyPromoCode('WELCOME10');
|
|
|
472
472
|
|
|
473
473
|
// Listen for success
|
|
474
474
|
window.addEventListener('lce:actions.cart_promo_code_applied', function(event) {
|
|
475
|
-
const {
|
|
476
|
-
showMessage(`Welcome discount applied! You saved $${
|
|
475
|
+
const { discount, newTotal } = event.detail.data;
|
|
476
|
+
showMessage(`Welcome discount applied! You saved $${discount}!`);
|
|
477
477
|
updateCartDisplay(newTotal);
|
|
478
478
|
|
|
479
479
|
// Track successful promo usage
|
|
480
|
-
analytics.track('Promo Applied', { discount:
|
|
480
|
+
analytics.track('Promo Applied', { discount: discount });
|
|
481
481
|
});
|
|
482
482
|
|
|
483
483
|
// Listen for failure and try fallback
|
|
@@ -624,12 +624,12 @@ const customer = getCurrentCustomer();
|
|
|
624
624
|
|
|
625
625
|
// Set up event listeners first
|
|
626
626
|
window.addEventListener('lce:actions.checkout_promo_code_applied', function(event) {
|
|
627
|
-
const {
|
|
628
|
-
showCheckoutSuccess(`Discount applied! You saved $${
|
|
627
|
+
const { discount, newTotal } = event.detail.data;
|
|
628
|
+
showCheckoutSuccess(`Discount applied! You saved $${discount}`);
|
|
629
629
|
updateCheckoutTotal(newTotal);
|
|
630
630
|
|
|
631
631
|
// Track successful conversion optimization
|
|
632
|
-
analytics.track('Checkout Discount Applied', { discount:
|
|
632
|
+
analytics.track('Checkout Discount Applied', { discount: discount });
|
|
633
633
|
});
|
|
634
634
|
|
|
635
635
|
window.addEventListener('lce:actions.checkout_promo_code_failed', function(event) {
|
package/docs/EVENTS.md
CHANGED
|
@@ -470,7 +470,7 @@ These events fire when programmatic actions succeed or fail, giving you complete
|
|
|
470
470
|
|
|
471
471
|
// Promo code feedback
|
|
472
472
|
'lce:actions.cart_promo_code_applied' // → "Promo code worked - show success!"
|
|
473
|
-
// Data: {
|
|
473
|
+
// Data: { discount?: number, newTotal?: number }
|
|
474
474
|
|
|
475
475
|
'lce:actions.cart_promo_code_removed' // → "Promo code removed successfully"
|
|
476
476
|
// Data: { newTotal?: number }
|
|
@@ -490,7 +490,7 @@ These events fire when programmatic actions succeed or fail, giving you complete
|
|
|
490
490
|
|
|
491
491
|
// Promo code feedback
|
|
492
492
|
'lce:actions.checkout_promo_code_applied' // → "Checkout discount applied!"
|
|
493
|
-
// Data: {
|
|
493
|
+
// Data: { discount?: number, newTotal?: number }
|
|
494
494
|
|
|
495
495
|
'lce:actions.checkout_promo_code_removed' // → "Checkout discount removed"
|
|
496
496
|
// Data: { newTotal?: number }
|
|
@@ -519,11 +519,11 @@ await actions.cart.applyPromoCode('SECRET20');
|
|
|
519
519
|
|
|
520
520
|
// Get feedback (secure)
|
|
521
521
|
window.addEventListener('lce:actions.cart_promo_code_applied', function(event) {
|
|
522
|
-
const {
|
|
522
|
+
const { discount, newTotal } = event.detail.data;
|
|
523
523
|
// ✅ You get: discount amount, new total
|
|
524
524
|
// 🚫 You DON'T get: 'SECRET20' (secure!)
|
|
525
525
|
|
|
526
|
-
showSuccessMessage(`🎉 Discount applied! You saved $${
|
|
526
|
+
showSuccessMessage(`🎉 Discount applied! You saved $${discount}!`);
|
|
527
527
|
updateCartTotal(newTotal);
|
|
528
528
|
});
|
|
529
529
|
```
|
|
@@ -539,14 +539,14 @@ async function applyPromoCodeWithFeedback(code) {
|
|
|
539
539
|
|
|
540
540
|
// Set up event listeners BEFORE firing action
|
|
541
541
|
const successHandler = (event) => {
|
|
542
|
-
const {
|
|
542
|
+
const { discount, newTotal } = event.detail.data;
|
|
543
543
|
hideLoadingMessage();
|
|
544
|
-
showSuccessMessage(`🎉 Success! You saved $${
|
|
544
|
+
showSuccessMessage(`🎉 Success! You saved $${discount}!`);
|
|
545
545
|
updatePriceDisplay(newTotal);
|
|
546
546
|
|
|
547
547
|
// Track successful promo usage
|
|
548
548
|
analytics.track('Promo Applied', {
|
|
549
|
-
discount:
|
|
549
|
+
discount: discount,
|
|
550
550
|
newTotal: newTotal
|
|
551
551
|
});
|
|
552
552
|
|
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.
|
|
6
|
+
"version": "2.6.0-beta.21",
|
|
7
7
|
"homepage": "https://docs.liquidcommerce.co/elements-sdk",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -53,8 +53,7 @@
|
|
|
53
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
|
-
"clean": "rm -rf dist umd",
|
|
57
|
-
"clean:hard": "rm -rf dist umd node_modules && pnpm install && pnpm build",
|
|
56
|
+
"clean": "rm -rf dist umd node_modules && pnpm install && pnpm build",
|
|
58
57
|
"prepublishOnly": "pnpm run build",
|
|
59
58
|
"deprecate:old": "npm deprecate @liquidcommerceteam/elements-sdk@\"*\" \"Package moved to @liquidcommerce/elements-sdk\"",
|
|
60
59
|
"prepare": "husky"
|
|
@@ -71,9 +70,9 @@
|
|
|
71
70
|
"embeddable commerce"
|
|
72
71
|
],
|
|
73
72
|
"devDependencies": {
|
|
74
|
-
"@biomejs/biome": "2.3.
|
|
75
|
-
"@commitlint/cli": "^20.
|
|
76
|
-
"@commitlint/config-conventional": "^20.
|
|
73
|
+
"@biomejs/biome": "2.3.10",
|
|
74
|
+
"@commitlint/cli": "^20.2.0",
|
|
75
|
+
"@commitlint/config-conventional": "^20.2.0",
|
|
77
76
|
"@rollup/plugin-alias": "^6.0.0",
|
|
78
77
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
79
78
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -84,14 +83,14 @@
|
|
|
84
83
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
85
84
|
"@semantic-release/git": "^10.0.1",
|
|
86
85
|
"@semantic-release/github": "^12.0.2",
|
|
87
|
-
"@semantic-release/npm": "^13.1.
|
|
86
|
+
"@semantic-release/npm": "^13.1.3",
|
|
88
87
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
89
88
|
"@types/core-js": "^2.5.8",
|
|
90
|
-
"@types/node": "^
|
|
89
|
+
"@types/node": "^25.0.3",
|
|
91
90
|
"conventional-changelog-cli": "^5.0.0",
|
|
92
91
|
"husky": "^9.1.7",
|
|
93
92
|
"process": "^0.11.10",
|
|
94
|
-
"rollup": "^4.53.
|
|
93
|
+
"rollup": "^4.53.5",
|
|
95
94
|
"rollup-obfuscator": "^4.1.1",
|
|
96
95
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
97
96
|
"semantic-release": "^25.0.2",
|