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