@liquidcommerce/elements-sdk 2.4.4 → 2.5.0
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 +28 -0
- package/dist/index.esm.js +11198 -9788
- package/dist/types/constants/core.constant.d.ts +32 -0
- package/dist/types/constants/index.d.ts +0 -1
- package/dist/types/{modules/api-client → core}/api-client.service.d.ts +4 -2
- package/dist/types/core/auth.service.d.ts +21 -0
- package/dist/types/core/base-component.service.d.ts +4 -3
- package/dist/types/core/client/client-action.service.d.ts +4 -2
- package/dist/types/core/client/client-config.service.d.ts +1 -0
- package/dist/types/core/command/base-command.service.d.ts +5 -3
- package/dist/types/core/command/command.service.d.ts +2 -0
- package/dist/types/core/google-tag-manager.service.d.ts +1 -2
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +4 -1
- package/dist/types/core/pubsub/pubsub.service.d.ts +1 -1
- package/dist/types/core/sdk-error-handler.d.ts +1 -0
- package/dist/types/core/store/interfaces/core.interface.d.ts +4 -2
- package/dist/types/core/store/store.constant.d.ts +5 -1
- package/dist/types/core/store/store.service.d.ts +3 -1
- package/dist/types/core/utils.d.ts +0 -4
- package/dist/types/elements-base-client.d.ts +3 -3
- package/dist/types/enums/core.enum.d.ts +10 -0
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +43 -0
- package/dist/types/interfaces/cloud/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +2 -0
- package/dist/types/interfaces/core.interface.d.ts +13 -0
- package/dist/types/modules/cart/cart.commands.d.ts +1 -2
- package/dist/types/modules/cart/cart.commands.helper.d.ts +3 -2
- package/dist/types/modules/checkout/checkout.commands.d.ts +1 -2
- package/dist/types/modules/checkout/checkout.commands.helper.d.ts +1 -1
- package/dist/types/modules/product/components/components.d.ts +1 -1
- package/dist/types/modules/product/components/index.d.ts +1 -2
- package/dist/types/modules/product/product.commands.d.ts +2 -3
- package/dist/types/modules/product/utils/helpers.d.ts +1 -1
- package/dist/types/modules/product/utils/retailer-hours.d.ts +1 -1
- package/dist/types/modules/product-list/components/index.d.ts +3 -0
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +7 -0
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +21 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +15 -0
- package/dist/types/modules/product-list/product-list.component.d.ts +76 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +0 -2
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/product-list/product-list.style.d.ts +1 -0
- package/dist/types/modules/theme-provider/styles/ui/loading.style.d.ts +1 -0
- package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +1 -1
- package/dist/types/modules/ui-components/ui.commands.d.ts +1 -1
- package/docs/ACTIONS.md +27 -0
- package/docs/TROUBLESHOOTING.md +21 -0
- package/package.json +12 -9
- package/umd/elements.js +1 -1
- package/dist/types/constants/z-index.constant.d.ts +0 -24
- package/dist/types/core/pubsub/index.d.ts +0 -2
- package/dist/types/core/pubsub/interfaces/index.d.ts +0 -5
- package/dist/types/core/store/index.d.ts +0 -2
- package/dist/types/core/store/interfaces/index.d.ts +0 -5
- package/dist/types/enums/debug.enum.d.ts +0 -6
- package/dist/types/modules/address/index.d.ts +0 -4
- package/dist/types/modules/api-client/api-client.interface.d.ts +0 -21
- package/dist/types/modules/api-client/index.d.ts +0 -2
- package/dist/types/modules/cart/index.d.ts +0 -1
- package/dist/types/modules/checkout/index.d.ts +0 -1
- package/dist/types/modules/product/constant.d.ts +0 -2
- package/dist/types/modules/product/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/index.d.ts +0 -2
- package/dist/types/modules/ui-components/loading/index.d.ts +0 -1
- /package/dist/types/modules/{ui-components/loading → product/components}/product-loading.component.d.ts +0 -0
package/README.md
CHANGED
|
@@ -791,6 +791,34 @@ const address = actions.address.getDetails();
|
|
|
791
791
|
actions.address.clear();
|
|
792
792
|
```
|
|
793
793
|
|
|
794
|
+
#### Clear Address - Complete Reset
|
|
795
|
+
|
|
796
|
+
The `actions.address.clear()` action performs a comprehensive reset of the user's address and shopping session:
|
|
797
|
+
|
|
798
|
+
**What it clears:**
|
|
799
|
+
- ✅ **Address Data**: Removes all saved address information (street, city, state, zip, coordinates)
|
|
800
|
+
- ✅ **Cart Contents**: Completely resets the cart (removes all items, totals, promo codes)
|
|
801
|
+
- ✅ **Local Storage**: Completely removes the localStorage entry and its value
|
|
802
|
+
- ✅ **Database**: Deletes the persisted store from the server database
|
|
803
|
+
- ✅ **Checkout State**: Resets any pending checkout information
|
|
804
|
+
|
|
805
|
+
**Why it resets the cart:**
|
|
806
|
+
When an address is cleared, the cart must be reset because:
|
|
807
|
+
- Cart items have location-specific pricing and availability
|
|
808
|
+
- Fulfillment options are tied to specific addresses
|
|
809
|
+
- Delivery fees and shipping costs depend on location
|
|
810
|
+
- Without a valid address, cart operations would fail or show incorrect data
|
|
811
|
+
|
|
812
|
+
**Events fired:**
|
|
813
|
+
- `lce:actions.address_cleared` - Address successfully cleared
|
|
814
|
+
- `lce:actions.cart_reset` - Cart successfully reset
|
|
815
|
+
|
|
816
|
+
**Use cases:**
|
|
817
|
+
- Guest checkout option (clear previous user's data)
|
|
818
|
+
- Location change (start fresh with new address)
|
|
819
|
+
- Privacy compliance (complete data removal)
|
|
820
|
+
- Testing/development (reset to clean state)
|
|
821
|
+
|
|
794
822
|
**Notes**:
|
|
795
823
|
- To find Google Places IDs for the `setAddressByPlacesId` action, use the [Google Places ID Finder](https://developers.google.com/maps/documentation/places/web-service/place-id#find-id)
|
|
796
824
|
- The `setAddressManually` action automatically generates a Google Places API-formatted address string from the provided components
|