@konfiqo/storefront-react 0.9.0 → 0.10.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 +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ the payment form and the checkout challenge.
|
|
|
11
11
|
"build your own storefront" guide.
|
|
12
12
|
- No styling: components render a plain `<div>` you can give a `className`.
|
|
13
13
|
- No runtime dependencies. Peer dependencies: `@konfiqo/storefront-sdk`
|
|
14
|
-
`^0.
|
|
14
|
+
`^0.10.0` and `react` ≥ 18. Install the SDK yourself, so your code and this
|
|
15
15
|
package share one copy (`isStorefrontError` also recognises errors from a
|
|
16
16
|
second copy, but one copy keeps the bundle small).
|
|
17
17
|
- Server-rendering safe: nothing touches `window`, `document` or storage
|
package/dist/index.cjs
CHANGED
|
@@ -293,6 +293,8 @@ var CartStore = class {
|
|
|
293
293
|
setCustomer = (input) => this.write((id) => this.client.carts.setCustomer(id, input));
|
|
294
294
|
setAddress = (input) => this.write((id) => this.client.carts.setAddress(id, input));
|
|
295
295
|
setShippingOption = (optionId) => this.write((id) => this.client.carts.setShippingOption(id, optionId));
|
|
296
|
+
applyCode = (code) => this.write((id) => this.client.carts.applyCode(id, code));
|
|
297
|
+
removeCode = () => this.write((id) => this.client.carts.removeCode(id));
|
|
296
298
|
/** The shipping options of the cart (empty when there is no cart yet). */
|
|
297
299
|
shippingOptions = async (options) => {
|
|
298
300
|
const id = this.currentId();
|
|
@@ -657,6 +659,8 @@ function useCart() {
|
|
|
657
659
|
setCustomer: store.setCustomer,
|
|
658
660
|
setAddress: store.setAddress,
|
|
659
661
|
setShippingOption: store.setShippingOption,
|
|
662
|
+
applyCode: store.applyCode,
|
|
663
|
+
removeCode: store.removeCode,
|
|
660
664
|
shippingOptions: store.shippingOptions,
|
|
661
665
|
refresh: store.refresh,
|
|
662
666
|
reset: store.reset
|