@plasmicpkgs/commerce 0.0.182 → 0.0.183

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.
@@ -700,6 +700,30 @@ var useAddItem = function useAddItem() {
700
700
  }, hook)).apply(void 0, arguments);
701
701
  };
702
702
 
703
+ var fetcher$1 = mutationFetcher;
704
+ var fn$1 = function fn(provider) {
705
+ var _provider$cart;
706
+ return (_provider$cart = provider.cart) == null ? void 0 : _provider$cart.useRemoveItem;
707
+ };
708
+ var useRemoveItem = function useRemoveItem(input) {
709
+ var hook = useHook(fn$1);
710
+ return useMutationHook(_extends({
711
+ fetcher: fetcher$1
712
+ }, hook))(input);
713
+ };
714
+
715
+ var fetcher$2 = mutationFetcher;
716
+ var fn$2 = function fn(provider) {
717
+ var _provider$cart;
718
+ return (_provider$cart = provider.cart) == null ? void 0 : _provider$cart.useUpdateItem;
719
+ };
720
+ var useUpdateItem = function useUpdateItem(input) {
721
+ var hook = useHook(fn$2);
722
+ return useMutationHook(_extends({
723
+ fetcher: fetcher$2
724
+ }, hook))(input);
725
+ };
726
+
703
727
  var defaultProduct = {
704
728
  id: "123456789",
705
729
  name: "Product name",
@@ -731,30 +755,6 @@ var defaultProduct = {
731
755
  options: []
732
756
  };
733
757
 
734
- var fetcher$1 = mutationFetcher;
735
- var fn$1 = function fn(provider) {
736
- var _provider$cart;
737
- return (_provider$cart = provider.cart) == null ? void 0 : _provider$cart.useRemoveItem;
738
- };
739
- var useRemoveItem = function useRemoveItem(input) {
740
- var hook = useHook(fn$1);
741
- return useMutationHook(_extends({
742
- fetcher: fetcher$1
743
- }, hook))(input);
744
- };
745
-
746
- var fetcher$2 = mutationFetcher;
747
- var fn$2 = function fn(provider) {
748
- var _provider$cart;
749
- return (_provider$cart = provider.cart) == null ? void 0 : _provider$cart.useUpdateItem;
750
- };
751
- var useUpdateItem = function useUpdateItem(input) {
752
- var hook = useHook(fn$2);
753
- return useMutationHook(_extends({
754
- fetcher: fetcher$2
755
- }, hook))(input);
756
- };
757
-
758
758
  var productSelector = "currentProduct";
759
759
  function ProductProvider(_ref) {
760
760
  var product = _ref.product,
@@ -809,26 +809,20 @@ function CartActionsProvider(props) {
809
809
  var _updateItem = useUpdateItem();
810
810
  var actions = React.useMemo(function () {
811
811
  return {
812
- addItem: function addItem(_ref4) {
813
- var productId = _ref4.productId,
814
- variantId = _ref4.variantId,
815
- quantity = _ref4.quantity;
812
+ addItem: function addItem(productId, variantId, quantity) {
816
813
  _addItem({
817
814
  productId: productId,
818
815
  variantId: variantId,
819
816
  quantity: quantity
820
817
  });
821
818
  },
822
- updateItem: function updateItem(_ref5) {
823
- var lineItemId = _ref5.lineItemId,
824
- quantity = _ref5.quantity;
819
+ updateItem: function updateItem(lineItemId, quantity) {
825
820
  _updateItem({
826
821
  id: lineItemId,
827
822
  quantity: quantity
828
823
  });
829
824
  },
830
- removeItem: function removeItem(_ref6) {
831
- var lineItemId = _ref6.lineItemId;
825
+ removeItem: function removeItem(lineItemId) {
832
826
  _removeItem({
833
827
  id: lineItemId
834
828
  });
@@ -843,42 +837,39 @@ function CartActionsProvider(props) {
843
837
  var globalActionsRegistrations = {
844
838
  addItem: {
845
839
  displayName: "Add item to cart",
846
- parameters: {
847
- productId: {
848
- displayName: "Product Id",
849
- type: "string"
850
- },
851
- variantId: {
852
- displayName: "Variant Id",
853
- type: "string"
854
- },
855
- quantity: {
856
- displayName: "Quantity",
857
- type: "number"
858
- }
859
- }
840
+ parameters: [{
841
+ name: "productId",
842
+ displayName: "Product Id",
843
+ type: "string"
844
+ }, {
845
+ name: "variantId",
846
+ displayName: "Variant Id",
847
+ type: "string"
848
+ }, {
849
+ name: "quantity",
850
+ displayName: "Quantity",
851
+ type: "number"
852
+ }]
860
853
  },
861
854
  updateItem: {
862
855
  displayName: "Update item in cart",
863
- parameters: {
864
- lineItemId: {
865
- displayName: "Line Item Id",
866
- type: "string"
867
- },
868
- quantity: {
869
- displayName: "New Quantity",
870
- type: "number"
871
- }
872
- }
856
+ parameters: [{
857
+ name: "lineItemId",
858
+ displayName: "Line Item Id",
859
+ type: "string"
860
+ }, {
861
+ name: "quantity",
862
+ displayName: "New Quantity",
863
+ type: "number"
864
+ }]
873
865
  },
874
866
  removeItem: {
875
867
  displayName: "Remove item from cart",
876
- parameters: {
877
- lineItemId: {
878
- displayName: "Line Item Id",
879
- type: "string"
880
- }
881
- }
868
+ parameters: [{
869
+ name: "lineItemId",
870
+ displayName: "Line Item Id",
871
+ type: "string"
872
+ }]
882
873
  }
883
874
  };
884
875