@plasmicpkgs/commerce 0.0.247 → 0.0.248

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 (68) hide show
  1. package/dist/api/endpoints/cart.d.ts +4 -4
  2. package/dist/api/endpoints/catalog/products.d.ts +4 -4
  3. package/dist/api/index.d.ts +75 -75
  4. package/dist/api/operations.d.ts +130 -130
  5. package/dist/api/utils/errors.d.ts +10 -10
  6. package/dist/api/utils/is-allowed-method.d.ts +3 -3
  7. package/dist/api/utils/is-allowed-operation.d.ts +6 -6
  8. package/dist/api/utils/types.d.ts +34 -34
  9. package/dist/cart/use-add-item.d.ts +5 -5
  10. package/dist/cart/use-cart.d.ts +5 -5
  11. package/dist/cart/use-remove-item.d.ts +5 -5
  12. package/dist/cart/use-update-item.d.ts +5 -5
  13. package/dist/commerce.cjs.development.js +23 -20
  14. package/dist/commerce.cjs.development.js.map +1 -1
  15. package/dist/commerce.cjs.production.min.js +1 -1
  16. package/dist/commerce.cjs.production.min.js.map +1 -1
  17. package/dist/commerce.d.ts +43 -43
  18. package/dist/commerce.esm.js +23 -20
  19. package/dist/commerce.esm.js.map +1 -1
  20. package/dist/contexts.d.ts +26 -26
  21. package/dist/index.d.ts +46 -46
  22. package/dist/product/use-price.d.ts +26 -26
  23. package/dist/product/use-product.d.ts +5 -5
  24. package/dist/product/use-search.d.ts +6 -6
  25. package/dist/registerAddToCartButton.d.ts +10 -10
  26. package/dist/registerCart.d.ts +12 -12
  27. package/dist/registerCartProvider.d.ts +6 -6
  28. package/dist/registerCategoryCollection.d.ts +20 -20
  29. package/dist/registerCategoryField.d.ts +11 -11
  30. package/dist/registerCategoryLink.d.ts +12 -12
  31. package/dist/registerCategoryMedia.d.ts +11 -11
  32. package/dist/registerProductBox.d.ts +18 -18
  33. package/dist/registerProductCollection.d.ts +29 -29
  34. package/dist/registerProductLink.d.ts +12 -12
  35. package/dist/registerProductMedia.d.ts +14 -14
  36. package/dist/registerProductMediaCollection.d.ts +11 -11
  37. package/dist/registerProductPrice.d.ts +10 -10
  38. package/dist/registerProductQuantity.d.ts +11 -11
  39. package/dist/registerProductSlider.d.ts +14 -14
  40. package/dist/registerProductTextField.d.ts +11 -11
  41. package/dist/registerProductVariantPicker.d.ts +10 -10
  42. package/dist/registerable.d.ts +4 -4
  43. package/dist/site/use-brands.d.ts +5 -5
  44. package/dist/site/use-categories.d.ts +5 -5
  45. package/dist/types/cart.d.ts +157 -157
  46. package/dist/types/checkout.d.ts +57 -57
  47. package/dist/types/common.d.ts +13 -13
  48. package/dist/types/customer/address.d.ts +110 -110
  49. package/dist/types/customer/card.d.ts +113 -113
  50. package/dist/types/customer/index.d.ts +24 -24
  51. package/dist/types/index.d.ts +12 -12
  52. package/dist/types/login.d.ts +27 -27
  53. package/dist/types/logout.d.ts +17 -17
  54. package/dist/types/page.d.ts +24 -24
  55. package/dist/types/product.d.ts +117 -117
  56. package/dist/types/signup.d.ts +23 -23
  57. package/dist/types/site.d.ts +55 -55
  58. package/dist/types/wishlist.d.ts +83 -83
  59. package/dist/utils/default-fetcher.d.ts +4 -4
  60. package/dist/utils/default-product.d.ts +2 -2
  61. package/dist/utils/define-property.d.ts +21 -21
  62. package/dist/utils/errors.d.ts +27 -27
  63. package/dist/utils/get-product-price.d.ts +2 -2
  64. package/dist/utils/types.d.ts +99 -99
  65. package/dist/utils/use-data.d.ts +13 -13
  66. package/dist/utils/use-extra-features.d.ts +1 -1
  67. package/dist/utils/use-hook.d.ts +7 -7
  68. package/package.json +5 -5
@@ -289,9 +289,9 @@ function useCommerce() {
289
289
  return React.useContext(Commerce);
290
290
  }
291
291
 
292
- /*
293
- Forked from https://github.com/vercel/commerce/tree/main/packages/commerce/src
294
- Changes: None
292
+ /*
293
+ Forked from https://github.com/vercel/commerce/tree/main/packages/commerce/src
294
+ Changes: None
295
295
  */
296
296
  // Taken from https://fettblog.eu/typescript-assertion-signatures/
297
297
  function defineProperty(obj, prop, val) {
@@ -310,6 +310,8 @@ var CommerceError = /*#__PURE__*/function (_Error) {
310
310
  code: code
311
311
  } : {}) : errors[0];
312
312
  _this = _Error.call(this, error.message) || this;
313
+ _this.code = void 0;
314
+ _this.errors = void 0;
313
315
  _this.errors = message ? [error] : errors;
314
316
  if (error.code) _this.code = error.code;
315
317
  return _this;
@@ -318,24 +320,25 @@ var CommerceError = /*#__PURE__*/function (_Error) {
318
320
  return CommerceError;
319
321
  }(/*#__PURE__*/_wrapNativeSuper(Error));
320
322
  // Used for errors that come from a bad implementation of the hooks
321
- var ValidationError = /*#__PURE__*/function (_CommerceError) {
323
+ var ValidationError = /*#__PURE__*/function (_CommerceError2) {
322
324
  function ValidationError(options) {
323
325
  var _this2;
324
- _this2 = _CommerceError.call(this, options) || this;
326
+ _this2 = _CommerceError2.call(this, options) || this;
325
327
  _this2.code = 'validation_error';
326
328
  return _this2;
327
329
  }
328
- _inheritsLoose(ValidationError, _CommerceError);
330
+ _inheritsLoose(ValidationError, _CommerceError2);
329
331
  return ValidationError;
330
332
  }(CommerceError);
331
- var FetcherError = /*#__PURE__*/function (_CommerceError2) {
333
+ var FetcherError = /*#__PURE__*/function (_CommerceError3) {
332
334
  function FetcherError(options) {
333
335
  var _this3;
334
- _this3 = _CommerceError2.call(this, options) || this;
336
+ _this3 = _CommerceError3.call(this, options) || this;
337
+ _this3.status = void 0;
335
338
  _this3.status = options.status;
336
339
  return _this3;
337
340
  }
338
- _inheritsLoose(FetcherError, _CommerceError2);
341
+ _inheritsLoose(FetcherError, _CommerceError3);
339
342
  return FetcherError;
340
343
  }(CommerceError);
341
344
 
@@ -407,9 +410,9 @@ var useData = function useData(options, input, fetcherFn, swrOptions, provider)
407
410
  return response;
408
411
  };
409
412
 
410
- /*
411
- Forked from https://github.com/vercel/commerce/tree/main/packages/commerce/src
412
- Changes: Add provider to useSWRHook and useMutationHook
413
+ /*
414
+ Forked from https://github.com/vercel/commerce/tree/main/packages/commerce/src
415
+ Changes: Add provider to useSWRHook and useMutationHook
413
416
  */
414
417
  function useFetcher() {
415
418
  var _providerRef$current$;
@@ -547,7 +550,7 @@ function ProductProvider(_ref) {
547
550
  name: productSelector,
548
551
  data: product,
549
552
  key: product.id
550
- }, React__default.createElement(reactHookForm.FormProvider, Object.assign({}, methods), children));
553
+ }, React__default.createElement(reactHookForm.FormProvider, _extends({}, methods), children));
551
554
  }
552
555
  var useProduct = function useProduct() {
553
556
  var product = host.useSelector(productSelector);
@@ -775,9 +778,9 @@ var useCart = function useCart(input) {
775
778
  }))(input);
776
779
  };
777
780
 
778
- /*
779
- Forked from https://github.com/vercel/commerce/tree/main/packages/commerce/src
780
- Changes: None
781
+ /*
782
+ Forked from https://github.com/vercel/commerce/tree/main/packages/commerce/src
783
+ Changes: None
781
784
  */
782
785
  function formatPrice(_ref) {
783
786
  var amount = _ref.amount,
@@ -1889,7 +1892,7 @@ function ProductVariantPicker(props) {
1889
1892
  render: function render(_ref) {
1890
1893
  var _product$variants$map;
1891
1894
  var field = _ref.field;
1892
- return React__default.createElement("select", Object.assign({
1895
+ return React__default.createElement("select", _extends({
1893
1896
  className: className
1894
1897
  }, field), (_product$variants$map = product == null ? void 0 : product.variants.map(function (variant) {
1895
1898
  return React__default.createElement("option", {
@@ -1918,9 +1921,9 @@ var product = {
1918
1921
  __proto__: null
1919
1922
  };
1920
1923
 
1921
- /*
1922
- Forked from https://github.com/vercel/commerce/tree/main/packages/commerce/src
1923
- Changes: Added CategoryImage and depth/children/parent_id to Category
1924
+ /*
1925
+ Forked from https://github.com/vercel/commerce/tree/main/packages/commerce/src
1926
+ Changes: Added CategoryImage and depth/children/parent_id to Category
1924
1927
  */
1925
1928
 
1926
1929
  var site = {