@commercelayer/react-components 3.0.0-beta.8 → 3.1.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 → lib}/components/AddToCartButton.d.ts +20 -17
- package/lib/components/AddToCartButton.js +1 -0
- package/{dist → lib}/components/Address.d.ts +13 -12
- package/lib/components/Address.js +1 -0
- package/{dist → lib}/components/AddressCountrySelector.d.ts +9 -9
- package/lib/components/AddressCountrySelector.js +1 -0
- package/{dist → lib}/components/AddressField.d.ts +15 -15
- package/lib/components/AddressField.js +1 -0
- package/{dist → lib}/components/AddressInput.d.ts +7 -7
- package/lib/components/AddressInput.js +1 -0
- package/{dist → lib}/components/AddressStateSelector.d.ts +11 -9
- package/lib/components/AddressStateSelector.js +1 -0
- package/{dist → lib}/components/AddressesContainer.d.ts +8 -7
- package/lib/components/AddressesContainer.js +1 -0
- package/lib/components/AdjustmentAmount.d.ts +4 -0
- package/lib/components/AdjustmentAmount.js +1 -0
- package/lib/components/AdyenPayment.d.ts +25 -0
- package/lib/components/AdyenPayment.js +1 -0
- package/{dist → lib}/components/AvailabilityContainer.d.ts +7 -7
- package/lib/components/AvailabilityContainer.js +1 -0
- package/{dist → lib}/components/AvailabilityTemplate.d.ts +15 -16
- package/lib/components/AvailabilityTemplate.js +1 -0
- package/{dist → lib}/components/BillingAddressContainer.d.ts +6 -6
- package/lib/components/BillingAddressContainer.js +1 -0
- package/{dist → lib}/components/BillingAddressForm.d.ts +8 -8
- package/lib/components/BillingAddressForm.js +1 -0
- package/{dist → lib}/components/BraintreePayment.d.ts +30 -30
- package/lib/components/BraintreePayment.js +1 -0
- package/{dist → lib}/components/CheckoutLink.d.ts +11 -11
- package/lib/components/CheckoutLink.js +1 -0
- package/{dist → lib}/components/CommerceLayer.d.ts +8 -9
- package/lib/components/CommerceLayer.js +1 -0
- package/{dist → lib}/components/CustomerContainer.d.ts +7 -7
- package/lib/components/CustomerContainer.js +1 -0
- package/{dist → lib}/components/CustomerInput.d.ts +11 -11
- package/lib/components/CustomerInput.js +1 -0
- package/{dist → lib}/components/DeliveryLeadTime.d.ts +10 -10
- package/lib/components/DeliveryLeadTime.js +1 -0
- package/{dist → lib}/components/DiscountAmount.d.ts +4 -4
- package/lib/components/DiscountAmount.js +1 -0
- package/{dist → lib}/components/Errors.d.ts +5 -5
- package/lib/components/Errors.js +1 -0
- package/{dist → lib}/components/ExternalFunction.d.ts +7 -7
- package/lib/components/ExternalFunction.js +1 -0
- package/{dist → lib}/components/GiftCard.d.ts +8 -8
- package/lib/components/GiftCard.js +1 -0
- package/{dist → lib}/components/GiftCardAmount.d.ts +4 -4
- package/lib/components/GiftCardAmount.js +1 -0
- package/{dist → lib}/components/GiftCardContainer.d.ts +6 -6
- package/lib/components/GiftCardContainer.js +1 -0
- package/{dist → lib}/components/GiftCardCurrencySelector.d.ts +7 -7
- package/lib/components/GiftCardCurrencySelector.js +1 -0
- package/{dist → lib}/components/GiftCardInput.d.ts +7 -7
- package/lib/components/GiftCardInput.js +1 -0
- package/{dist → lib}/components/GiftCardOrCouponCode.d.ts +13 -13
- package/lib/components/GiftCardOrCouponCode.js +1 -0
- package/{dist → lib}/components/GiftCardOrCouponForm.d.ts +10 -10
- package/lib/components/GiftCardOrCouponForm.js +1 -0
- package/{dist → lib}/components/GiftCardOrCouponInput.d.ts +8 -8
- package/lib/components/GiftCardOrCouponInput.js +1 -0
- package/{dist → lib}/components/GiftCardOrCouponRemoveButton.d.ts +16 -16
- package/lib/components/GiftCardOrCouponRemoveButton.js +1 -0
- package/{dist → lib}/components/GiftCardOrCouponSubmit.d.ts +9 -9
- package/lib/components/GiftCardOrCouponSubmit.js +1 -0
- package/{dist → lib}/components/GiftCardRecipient.d.ts +0 -0
- package/lib/components/GiftCardRecipient.js +1 -0
- package/{dist → lib}/components/GiftCardRecipientInput.d.ts +0 -0
- package/lib/components/GiftCardRecipientInput.js +1 -0
- package/{dist → lib}/components/ItemContainer.d.ts +11 -11
- package/lib/components/ItemContainer.js +1 -0
- package/{dist → lib}/components/LineItem.d.ts +8 -8
- package/lib/components/LineItem.js +1 -0
- package/{dist → lib}/components/LineItemAmount.d.ts +7 -7
- package/lib/components/LineItemAmount.js +1 -0
- package/lib/components/LineItemCode.d.ts +12 -0
- package/lib/components/LineItemCode.js +1 -0
- package/lib/components/LineItemImage.d.ts +16 -0
- package/lib/components/LineItemImage.js +1 -0
- package/lib/components/LineItemName.d.ts +11 -0
- package/lib/components/LineItemName.js +1 -0
- package/{dist → lib}/components/LineItemOption.d.ts +19 -19
- package/lib/components/LineItemOption.js +1 -0
- package/{dist → lib}/components/LineItemOptions.d.ts +14 -14
- package/lib/components/LineItemOptions.js +1 -0
- package/{dist → lib}/components/LineItemQuantity.d.ts +14 -14
- package/lib/components/LineItemQuantity.js +1 -0
- package/{dist → lib}/components/LineItemRemoveLink.d.ts +12 -12
- package/lib/components/LineItemRemoveLink.js +1 -0
- package/{dist → lib}/components/LineItemsContainer.d.ts +8 -8
- package/lib/components/LineItemsContainer.js +1 -0
- package/{dist → lib}/components/LineItemsCount.d.ts +12 -10
- package/lib/components/LineItemsCount.js +1 -0
- package/lib/components/LineItemsEmpty.d.ts +12 -0
- package/lib/components/LineItemsEmpty.js +1 -0
- package/{dist → lib}/components/MetadataInput.d.ts +5 -5
- package/lib/components/MetadataInput.js +1 -0
- package/{dist → lib}/components/OrderContainer.d.ts +11 -10
- package/lib/components/OrderContainer.js +1 -0
- package/{dist → lib}/components/OrderNumber.d.ts +5 -5
- package/lib/components/OrderNumber.js +1 -0
- package/{dist → lib}/components/OrderStorage.d.ts +8 -8
- package/lib/components/OrderStorage.js +1 -0
- package/lib/components/PaymentGateway.d.ts +16 -0
- package/lib/components/PaymentGateway.js +1 -0
- package/{dist → lib}/components/PaymentMethod.d.ts +16 -16
- package/lib/components/PaymentMethod.js +1 -0
- package/{dist → lib}/components/PaymentMethodAmount.d.ts +4 -4
- package/lib/components/PaymentMethodAmount.js +1 -0
- package/{dist → lib}/components/PaymentMethodName.d.ts +9 -9
- package/lib/components/PaymentMethodName.js +1 -0
- package/{dist → lib}/components/PaymentMethodPrice.d.ts +9 -9
- package/lib/components/PaymentMethodPrice.js +1 -0
- package/{dist → lib}/components/PaymentMethodRadioButton.d.ts +11 -11
- package/lib/components/PaymentMethodRadioButton.js +1 -0
- package/{dist → lib}/components/PaymentMethodsContainer.d.ts +8 -8
- package/lib/components/PaymentMethodsContainer.js +1 -0
- package/{dist → lib}/components/PaymentSource.d.ts +19 -18
- package/lib/components/PaymentSource.js +1 -0
- package/{dist → lib}/components/PaymentSourceBrandIcon.d.ts +15 -15
- package/lib/components/PaymentSourceBrandIcon.js +1 -0
- package/{dist → lib}/components/PaymentSourceBrandName.d.ts +12 -12
- package/lib/components/PaymentSourceBrandName.js +1 -0
- package/{dist → lib}/components/PaymentSourceDetail.d.ts +12 -12
- package/lib/components/PaymentSourceDetail.js +1 -0
- package/{dist → lib}/components/PaymentSourceEditButton.d.ts +9 -9
- package/lib/components/PaymentSourceEditButton.js +1 -0
- package/{dist → lib}/components/PaypalPayment.d.ts +12 -12
- package/lib/components/PaypalPayment.js +1 -0
- package/{dist → lib}/components/PlaceOrderButton.d.ts +12 -12
- package/lib/components/PlaceOrderButton.js +1 -0
- package/{dist → lib}/components/PlaceOrderContainer.d.ts +8 -8
- package/lib/components/PlaceOrderContainer.js +1 -0
- package/{dist → lib}/components/Price.d.ts +16 -14
- package/lib/components/Price.js +1 -0
- package/{dist → lib}/components/PricesContainer.d.ts +11 -11
- package/lib/components/PricesContainer.js +1 -0
- package/{dist → lib}/components/PrivacyAndTermsCheckbox.d.ts +4 -4
- package/lib/components/PrivacyAndTermsCheckbox.js +1 -0
- package/{dist → lib}/components/QuantitySelector.d.ts +17 -17
- package/lib/components/QuantitySelector.js +1 -0
- package/{dist → lib}/components/SaveAddressesButton.d.ts +10 -10
- package/lib/components/SaveAddressesButton.js +1 -0
- package/{dist → lib}/components/SaveCustomerButton.d.ts +13 -13
- package/lib/components/SaveCustomerButton.js +1 -0
- package/{dist → lib}/components/Shipment.d.ts +8 -8
- package/lib/components/Shipment.js +1 -0
- package/{dist → lib}/components/ShipmentField.d.ts +12 -12
- package/lib/components/ShipmentField.js +1 -0
- package/{dist → lib}/components/ShipmentsContainer.d.ts +6 -6
- package/lib/components/ShipmentsContainer.js +1 -0
- package/{dist → lib}/components/ShippingAddressContainer.d.ts +6 -6
- package/lib/components/ShippingAddressContainer.js +1 -0
- package/{dist → lib}/components/ShippingAddressForm.d.ts +8 -8
- package/lib/components/ShippingAddressForm.js +1 -0
- package/{dist → lib}/components/ShippingAmount.d.ts +4 -4
- package/lib/components/ShippingAmount.js +1 -0
- package/{dist → lib}/components/ShippingMethod.d.ts +8 -8
- package/lib/components/ShippingMethod.js +1 -0
- package/{dist → lib}/components/ShippingMethodName.d.ts +11 -7
- package/lib/components/ShippingMethodName.js +1 -0
- package/{dist → lib}/components/ShippingMethodPrice.d.ts +13 -13
- package/lib/components/ShippingMethodPrice.js +1 -0
- package/lib/components/ShippingMethodRadioButton.d.ts +13 -0
- package/lib/components/ShippingMethodRadioButton.js +1 -0
- package/{dist → lib}/components/SkuList.d.ts +7 -7
- package/lib/components/SkuList.js +1 -0
- package/{dist → lib}/components/SkuListsContainer.d.ts +6 -6
- package/lib/components/SkuListsContainer.js +1 -0
- package/{dist → lib}/components/SkuOption.d.ts +7 -7
- package/lib/components/SkuOption.js +1 -0
- package/{dist → lib}/components/SkuOptionInput.d.ts +5 -5
- package/lib/components/SkuOptionInput.js +1 -0
- package/{dist → lib}/components/SkuOptionsContainer.d.ts +7 -7
- package/lib/components/SkuOptionsContainer.js +1 -0
- package/{dist → lib}/components/StockTransfer.d.ts +6 -6
- package/lib/components/StockTransfer.js +1 -0
- package/{dist → lib}/components/StockTransferField.d.ts +9 -9
- package/lib/components/StockTransferField.js +1 -0
- package/{dist → lib}/components/StripePayment.d.ts +18 -18
- package/lib/components/StripePayment.js +1 -0
- package/{dist → lib}/components/SubTotalAmount.d.ts +4 -4
- package/lib/components/SubTotalAmount.js +1 -0
- package/{dist → lib}/components/SubmitButton.d.ts +9 -9
- package/lib/components/SubmitButton.js +1 -0
- package/{dist → lib}/components/TaxesAmount.d.ts +4 -4
- package/lib/components/TaxesAmount.js +1 -0
- package/{dist → lib}/components/TotalAmount.d.ts +4 -4
- package/lib/components/TotalAmount.js +1 -0
- package/{dist → lib}/components/VariantSelector.d.ts +29 -27
- package/lib/components/VariantSelector.js +1 -0
- package/{dist → lib}/components/VariantsContainer.d.ts +8 -8
- package/lib/components/VariantsContainer.js +1 -0
- package/{dist → lib}/components/WireTransferPayment.d.ts +10 -10
- package/lib/components/WireTransferPayment.js +1 -0
- package/lib/components/gateways/AdyenGateway.d.ts +5 -0
- package/lib/components/gateways/AdyenGateway.js +1 -0
- package/lib/components/gateways/BraintreeGateway.d.ts +5 -0
- package/lib/components/gateways/BraintreeGateway.js +1 -0
- package/lib/components/gateways/PaypalGateway.d.ts +5 -0
- package/lib/components/gateways/PaypalGateway.js +1 -0
- package/lib/components/gateways/StripeGateway.d.ts +5 -0
- package/lib/components/gateways/StripeGateway.js +1 -0
- package/lib/components/gateways/WireTransferGateway.d.ts +5 -0
- package/lib/components/gateways/WireTransferGateway.js +1 -0
- package/lib/components/utils/AddressCardsTemplate.d.ts +27 -0
- package/lib/components/utils/AddressCardsTemplate.js +1 -0
- package/{dist → lib}/components/utils/BaseField.d.ts +8 -8
- package/lib/components/utils/BaseField.js +1 -0
- package/lib/components/utils/BaseInput.d.ts +5 -0
- package/lib/components/utils/BaseInput.js +1 -0
- package/{dist → lib}/components/utils/BaseOrderPrice.d.ts +6 -6
- package/lib/components/utils/BaseOrderPrice.js +1 -0
- package/{dist → lib}/components/utils/BaseSelect.d.ts +5 -5
- package/lib/components/utils/BaseSelect.js +1 -0
- package/{dist → lib}/components/utils/Parent.d.ts +8 -8
- package/lib/components/utils/Parent.js +1 -0
- package/lib/components/utils/PaymentCardsTemplate.d.ts +23 -0
- package/lib/components/utils/PaymentCardsTemplate.js +1 -0
- package/{dist → lib}/components/utils/PriceTemplate.d.ts +8 -8
- package/lib/components/utils/PriceTemplate.js +1 -0
- package/{dist → lib}/components/utils/VariantTemplate.d.ts +36 -34
- package/lib/components/utils/VariantTemplate.js +1 -0
- package/{dist → lib}/components/utils/getAllErrors.d.ts +17 -17
- package/lib/components/utils/getAllErrors.js +1 -0
- package/{dist → lib}/config/components.d.ts +892 -881
- package/lib/config/components.js +1 -0
- package/lib/config/currency.d.ts +5 -0
- package/lib/config/currency.js +1 -0
- package/{dist → lib}/context/AddressChildrenContext.d.ts +7 -7
- package/lib/context/AddressChildrenContext.js +1 -0
- package/{dist → lib}/context/AddressContext.d.ts +17 -17
- package/lib/context/AddressContext.js +1 -0
- package/{dist → lib}/context/AvailabilityContext.d.ts +3 -3
- package/lib/context/AvailabilityContext.js +1 -0
- package/{dist → lib}/context/BillingAddressContext.d.ts +12 -12
- package/lib/context/BillingAddressContext.js +1 -0
- package/{dist → lib}/context/BillingAddressFormContext.d.ts +19 -18
- package/lib/context/BillingAddressFormContext.js +1 -0
- package/{dist → lib}/context/CommerceLayerContext.d.ts +7 -8
- package/lib/context/CommerceLayerContext.js +1 -0
- package/{dist → lib}/context/CouponAndGiftCardFormContext.d.ts +7 -7
- package/lib/context/CouponAndGiftCardFormContext.js +1 -0
- package/{dist → lib}/context/CustomerContext.d.ts +16 -14
- package/lib/context/CustomerContext.js +1 -0
- package/{dist → lib}/context/ExternalFunctionContext.d.ts +12 -12
- package/lib/context/ExternalFunctionContext.js +1 -0
- package/{dist → lib}/context/GiftCardContext.d.ts +11 -11
- package/lib/context/GiftCardContext.js +1 -0
- package/{dist → lib}/context/ItemContext.d.ts +13 -13
- package/lib/context/ItemContext.js +1 -0
- package/lib/context/LineItemChildrenContext.d.ts +9 -0
- package/lib/context/LineItemChildrenContext.js +1 -0
- package/{dist → lib}/context/LineItemContext.d.ts +8 -8
- package/lib/context/LineItemContext.js +1 -0
- package/{dist → lib}/context/LineItemOptionChildrenContext.d.ts +8 -8
- package/lib/context/LineItemOptionChildrenContext.js +1 -0
- package/lib/context/OrderContext.d.ts +26 -0
- package/lib/context/OrderContext.js +1 -0
- package/{dist → lib}/context/OrderStorageContext.d.ts +11 -11
- package/lib/context/OrderStorageContext.js +1 -0
- package/{dist → lib}/context/PaymentMethodChildrenContext.d.ts +10 -10
- package/lib/context/PaymentMethodChildrenContext.js +1 -0
- package/{dist → lib}/context/PaymentMethodContext.d.ts +23 -20
- package/lib/context/PaymentMethodContext.js +1 -0
- package/{dist → lib}/context/PaymentSourceContext.d.ts +14 -14
- package/lib/context/PaymentSourceContext.js +1 -0
- package/{dist → lib}/context/PlaceOrderContext.d.ts +16 -16
- package/lib/context/PlaceOrderContext.js +1 -0
- package/{dist → lib}/context/PricesContext.d.ts +7 -7
- package/lib/context/PricesContext.js +1 -0
- package/lib/context/ShipmentChildrenContext.d.ts +13 -0
- package/lib/context/ShipmentChildrenContext.js +1 -0
- package/{dist → lib}/context/ShipmentContext.d.ts +12 -12
- package/lib/context/ShipmentContext.js +1 -0
- package/{dist → lib}/context/ShippingAddressContext.d.ts +10 -10
- package/lib/context/ShippingAddressContext.js +1 -0
- package/{dist → lib}/context/ShippingAddressFormContext.d.ts +4 -4
- package/lib/context/ShippingAddressFormContext.js +1 -0
- package/lib/context/ShippingMethodChildrenContext.d.ts +10 -0
- package/lib/context/ShippingMethodChildrenContext.js +1 -0
- package/lib/context/SkuListsContext.d.ts +6 -0
- package/lib/context/SkuListsContext.js +1 -0
- package/{dist → lib}/context/SkuOptionChildrenContext.d.ts +8 -8
- package/lib/context/SkuOptionChildrenContext.js +1 -0
- package/{dist → lib}/context/SkuOptionsContext.d.ts +3 -3
- package/lib/context/SkuOptionsContext.js +1 -0
- package/{dist → lib}/context/StockTransferChildrenContext.d.ts +7 -7
- package/lib/context/StockTransferChildrenContext.js +1 -0
- package/{dist → lib}/context/VariantsContext.d.ts +3 -3
- package/lib/context/VariantsContext.js +1 -0
- package/lib/index.d.ts +99 -0
- package/lib/index.js +1 -0
- package/{dist → lib}/reducers/AddressReducer.d.ts +59 -57
- package/lib/reducers/AddressReducer.js +1 -0
- package/lib/reducers/AvailabilityReducer.d.ts +53 -0
- package/lib/reducers/AvailabilityReducer.js +1 -0
- package/{dist → lib}/reducers/BillingAddressReducer.d.ts +31 -32
- package/lib/reducers/BillingAddressReducer.js +1 -0
- package/{dist → lib}/reducers/CustomerReducer.d.ts +50 -60
- package/lib/reducers/CustomerReducer.js +1 -0
- package/{dist → lib}/reducers/GiftCardReducer.d.ts +76 -75
- package/lib/reducers/GiftCardReducer.js +1 -0
- package/{dist → lib}/reducers/ItemReducer.d.ts +69 -68
- package/lib/reducers/ItemReducer.js +1 -0
- package/{dist → lib}/reducers/LineItemReducer.d.ts +52 -52
- package/lib/reducers/LineItemReducer.js +1 -0
- package/lib/reducers/OrderReducer.d.ts +133 -0
- package/lib/reducers/OrderReducer.js +1 -0
- package/{dist → lib}/reducers/PaymentMethodReducer.d.ts +105 -95
- package/lib/reducers/PaymentMethodReducer.js +1 -0
- package/{dist → lib}/reducers/PlaceOrderReducer.d.ts +52 -50
- package/lib/reducers/PlaceOrderReducer.js +1 -0
- package/{dist → lib}/reducers/PriceReducer.d.ts +44 -45
- package/lib/reducers/PriceReducer.js +1 -0
- package/{dist → lib}/reducers/ShipmentReducer.d.ts +40 -37
- package/lib/reducers/ShipmentReducer.js +1 -0
- package/{dist → lib}/reducers/ShippingAddressReducer.d.ts +32 -31
- package/lib/reducers/ShippingAddressReducer.js +1 -0
- package/{dist → lib}/reducers/SkuListsReducer.d.ts +21 -22
- package/lib/reducers/SkuListsReducer.js +1 -0
- package/{dist → lib}/reducers/SkuOptionsReducer.d.ts +26 -26
- package/lib/reducers/SkuOptionsReducer.js +1 -0
- package/{dist → lib}/reducers/VariantReducer.d.ts +71 -71
- package/lib/reducers/VariantReducer.js +1 -0
- package/{dist → lib}/typings/errors.d.ts +42 -40
- package/lib/typings/errors.js +1 -0
- package/{dist → lib}/typings/index.d.ts +126 -151
- package/lib/typings/index.js +1 -0
- package/{dist → lib}/utils/PropsType.d.ts +33 -33
- package/lib/utils/PropsType.js +1 -0
- package/{dist → lib}/utils/addressesManager.d.ts +28 -27
- package/lib/utils/addressesManager.js +1 -0
- package/{dist → lib}/utils/baseReducer.d.ts +3 -3
- package/lib/utils/baseReducer.js +1 -0
- package/lib/utils/browserInfo.d.ts +9 -0
- package/lib/utils/browserInfo.js +1 -0
- package/{dist → lib}/utils/childrenTypes.d.ts +9 -9
- package/lib/utils/childrenTypes.js +1 -0
- package/lib/utils/countryStateCity.d.ts +9 -0
- package/lib/utils/countryStateCity.js +1 -0
- package/{dist → lib}/utils/customMessages.d.ts +8 -8
- package/lib/utils/customMessages.js +1 -0
- package/lib/utils/customerOrderOptions.d.ts +3 -0
- package/lib/utils/customerOrderOptions.js +1 -0
- package/{dist → lib}/utils/getAmount.d.ts +9 -9
- package/lib/utils/getAmount.js +1 -0
- package/{dist → lib}/utils/getCurrentItemKey.d.ts +6 -6
- package/lib/utils/getCurrentItemKey.js +1 -0
- package/lib/utils/getErrors.d.ts +11 -0
- package/lib/utils/getErrors.js +1 -0
- package/lib/utils/getLineItemsCount.d.ts +12 -0
- package/lib/utils/getLineItemsCount.js +1 -0
- package/{dist → lib}/utils/getLoaderComponent.d.ts +3 -3
- package/lib/utils/getLoaderComponent.js +1 -0
- package/lib/utils/getPrices.d.ts +17 -0
- package/lib/utils/getPrices.js +1 -0
- package/lib/utils/getSdk.d.ts +3 -0
- package/lib/utils/getSdk.js +1 -0
- package/lib/utils/getSkus.d.ts +3 -0
- package/lib/utils/getSkus.js +1 -0
- package/{dist → lib}/utils/isEmptyStates.d.ts +1 -1
- package/lib/utils/isEmptyStates.js +1 -0
- package/{dist → lib}/utils/isJSON.d.ts +1 -1
- package/lib/utils/isJSON.js +1 -0
- package/lib/utils/jwt.d.ts +27 -0
- package/lib/utils/jwt.js +1 -0
- package/{dist → lib}/utils/localStorage.d.ts +17 -18
- package/lib/utils/localStorage.js +1 -0
- package/lib/utils/organization.d.ts +6 -0
- package/lib/utils/organization.js +1 -0
- package/lib/utils/paypalPayment.d.ts +3 -0
- package/lib/utils/paypalPayment.js +1 -0
- package/{dist → lib}/utils/promisify.d.ts +1 -1
- package/lib/utils/promisify.js +1 -0
- package/lib/utils/shipments.d.ts +2 -0
- package/lib/utils/shipments.js +1 -0
- package/{dist → lib}/utils/validateFormFields.d.ts +22 -19
- package/lib/utils/validateFormFields.js +1 -0
- package/package.json +98 -84
- package/dist/components/CustomerField.d.ts +0 -10
- package/dist/components/LineItemImage.d.ts +0 -10
- package/dist/components/LineItemName.d.ts +0 -7
- package/dist/components/LineItemSkuCode.d.ts +0 -7
- package/dist/components/OrderList.d.ts +0 -28
- package/dist/components/OrderListRow.d.ts +0 -14
- package/dist/components/PaymentGateway.d.ts +0 -11
- package/dist/components/ShippingMethodRadioButton.d.ts +0 -9
- package/dist/components/utils/BaseInput.d.ts +0 -5
- package/dist/context/LineItemChildrenContext.d.ts +0 -7
- package/dist/context/OrderContext.d.ts +0 -4
- package/dist/context/OrderListChildrenContext.d.ts +0 -14
- package/dist/context/ShipmentChildrenContext.d.ts +0 -13
- package/dist/context/ShippingMethodChildrenContext.d.ts +0 -9
- package/dist/context/SkuListsContext.d.ts +0 -3
- package/dist/index.d.ts +0 -90
- package/dist/index.js +0 -8
- package/dist/react-components.cjs.development.js +0 -12429
- package/dist/react-components.cjs.development.js.map +0 -1
- package/dist/react-components.cjs.production.min.js +0 -2
- package/dist/react-components.cjs.production.min.js.map +0 -1
- package/dist/react-components.esm.js +0 -12332
- package/dist/react-components.esm.js.map +0 -1
- package/dist/reducers/AvailabilityReducer.d.ts +0 -40
- package/dist/reducers/OrderReducer.d.ts +0 -131
- package/dist/typings/order.d.ts +0 -120
- package/dist/utils/countryStateCity.d.ts +0 -9
- package/dist/utils/customerOrderOptions.d.ts +0 -4
- package/dist/utils/dynamicNaming.d.ts +0 -5
- package/dist/utils/getErrorsByCollection.d.ts +0 -11
- package/dist/utils/getLineItemsCount.d.ts +0 -6
- package/dist/utils/getPrices.d.ts +0 -18
- package/dist/utils/getSkus.d.ts +0 -3
- package/dist/utils/icons.d.ts +0 -3
- package/dist/utils/isDate.d.ts +0 -1
- package/dist/utils/paypalPayment.d.ts +0 -3
- package/dist/utils/scrollbarWidth.d.ts +0 -1
- package/dist/utils/shipments.d.ts +0 -5
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { PlaceOrderState, SetPlaceOrderErrors } from
|
|
3
|
-
declare type DefaultContext = {
|
|
4
|
-
setPlaceOrderErrors?: SetPlaceOrderErrors;
|
|
5
|
-
setPlaceOrder?: ({ paymentSource, }: {
|
|
6
|
-
paymentSource: Record<string, string>;
|
|
7
|
-
}) => Promise<{
|
|
8
|
-
placed: boolean;
|
|
9
|
-
}>;
|
|
10
|
-
placeOrderPermitted?: () => void;
|
|
11
|
-
} & PlaceOrderState;
|
|
12
|
-
export declare const defaultPlaceOrderContext: {
|
|
13
|
-
setPlaceOrderErrors: SetPlaceOrderErrors;
|
|
14
|
-
};
|
|
15
|
-
declare const PlaceOrderContext: import("react").Context<DefaultContext>;
|
|
16
|
-
export default PlaceOrderContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PlaceOrderState, SetPlaceOrderErrors } from '../reducers/PlaceOrderReducer';
|
|
3
|
+
declare type DefaultContext = {
|
|
4
|
+
setPlaceOrderErrors?: SetPlaceOrderErrors;
|
|
5
|
+
setPlaceOrder?: ({ paymentSource, }: {
|
|
6
|
+
paymentSource: Record<string, string>;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
placed: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
placeOrderPermitted?: () => void;
|
|
11
|
+
} & PlaceOrderState;
|
|
12
|
+
export declare const defaultPlaceOrderContext: {
|
|
13
|
+
setPlaceOrderErrors: SetPlaceOrderErrors;
|
|
14
|
+
};
|
|
15
|
+
declare const PlaceOrderContext: import("react").Context<DefaultContext>;
|
|
16
|
+
export default PlaceOrderContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";import{setPlaceOrderErrors}from"../reducers/PlaceOrderReducer";export const defaultPlaceOrderContext={setPlaceOrderErrors};const PlaceOrderContext=createContext(defaultPlaceOrderContext);export default PlaceOrderContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { PriceState } from
|
|
3
|
-
export interface PricesContextValue extends PriceState {
|
|
4
|
-
skuCode: PriceState['skuCode'];
|
|
5
|
-
}
|
|
6
|
-
declare const PricesContext: import("react").Context<PriceState>;
|
|
7
|
-
export default PricesContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PriceState } from '../reducers/PriceReducer';
|
|
3
|
+
export interface PricesContextValue extends PriceState {
|
|
4
|
+
skuCode: PriceState['skuCode'];
|
|
5
|
+
}
|
|
6
|
+
declare const PricesContext: import("react").Context<PriceState>;
|
|
7
|
+
export default PricesContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";import{priceInitialState}from"../reducers/PriceReducer";const PricesContext=createContext(priceInitialState);export default PricesContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DeliveryLeadTime, LineItem, Shipment, ShippingMethod, StockTransfer } from '@commercelayer/sdk';
|
|
3
|
+
export interface InitialShipmentContext {
|
|
4
|
+
lineItems?: LineItem[];
|
|
5
|
+
shippingMethods?: ShippingMethod[];
|
|
6
|
+
currentShippingMethodId?: string;
|
|
7
|
+
stockTransfers?: StockTransfer[];
|
|
8
|
+
deliveryLeadTimes?: DeliveryLeadTime[];
|
|
9
|
+
shipment?: Shipment;
|
|
10
|
+
keyNumber: number;
|
|
11
|
+
}
|
|
12
|
+
declare const ShipmentChildrenContext: import("react").Context<InitialShipmentContext>;
|
|
13
|
+
export default ShipmentChildrenContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";const initial={lineItems:[],shippingMethods:[],stockTransfers:[],keyNumber:0},ShipmentChildrenContext=createContext(initial);export default ShipmentChildrenContext;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ShipmentState, SetShipmentErrors } from
|
|
3
|
-
declare type DefaultContext = {
|
|
4
|
-
setShipmentErrors: SetShipmentErrors;
|
|
5
|
-
setShippingMethod: (shipmentId: string, shippingMethodId: string) => Promise<void>;
|
|
6
|
-
} & ShipmentState;
|
|
7
|
-
export declare const defaultShipmentContext: {
|
|
8
|
-
setShipmentErrors: SetShipmentErrors;
|
|
9
|
-
setShippingMethod: () => Promise<void>;
|
|
10
|
-
};
|
|
11
|
-
declare const ShipmentContext: import("react").Context<DefaultContext>;
|
|
12
|
-
export default ShipmentContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ShipmentState, SetShipmentErrors } from '../reducers/ShipmentReducer';
|
|
3
|
+
declare type DefaultContext = {
|
|
4
|
+
setShipmentErrors: SetShipmentErrors;
|
|
5
|
+
setShippingMethod: (shipmentId: string, shippingMethodId: string) => Promise<void>;
|
|
6
|
+
} & ShipmentState;
|
|
7
|
+
export declare const defaultShipmentContext: {
|
|
8
|
+
setShipmentErrors: SetShipmentErrors;
|
|
9
|
+
setShippingMethod: () => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
declare const ShipmentContext: import("react").Context<DefaultContext>;
|
|
12
|
+
export default ShipmentContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";import{setShipmentErrors}from"../reducers/ShipmentReducer";export const defaultShipmentContext={setShipmentErrors,setShippingMethod:async()=>{}};const ShipmentContext=createContext(defaultShipmentContext);export default ShipmentContext;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ShippingAddressState } from
|
|
3
|
-
declare type DefaultContext = {
|
|
4
|
-
setShippingAddress?: (id: string, options?: {
|
|
5
|
-
customerAddressId: string;
|
|
6
|
-
}) => void;
|
|
7
|
-
} & ShippingAddressState;
|
|
8
|
-
export declare const defaultShippingAddressContext: {};
|
|
9
|
-
declare const ShippingAddressContext: import("react").Context<DefaultContext>;
|
|
10
|
-
export default ShippingAddressContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ShippingAddressState } from '../reducers/ShippingAddressReducer';
|
|
3
|
+
declare type DefaultContext = {
|
|
4
|
+
setShippingAddress?: (id: string, options?: {
|
|
5
|
+
customerAddressId: string;
|
|
6
|
+
}) => void;
|
|
7
|
+
} & ShippingAddressState;
|
|
8
|
+
export declare const defaultShippingAddressContext: {};
|
|
9
|
+
declare const ShippingAddressContext: import("react").Context<DefaultContext>;
|
|
10
|
+
export default ShippingAddressContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";export const defaultShippingAddressContext={};const ShippingAddressContext=createContext(defaultShippingAddressContext);export default ShippingAddressContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DefaultContextAddress } from './BillingAddressFormContext';
|
|
3
|
-
declare const ShippingAddressFormContext: import("react").Context<DefaultContextAddress>;
|
|
4
|
-
export default ShippingAddressFormContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DefaultContextAddress } from './BillingAddressFormContext';
|
|
3
|
+
declare const ShippingAddressFormContext: import("react").Context<DefaultContextAddress>;
|
|
4
|
+
export default ShippingAddressFormContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";const ShippingAddressFormContext=createContext({});export default ShippingAddressFormContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DeliveryLeadTime, ShippingMethod } from '@commercelayer/sdk';
|
|
3
|
+
export interface InitialShippingMethodContext {
|
|
4
|
+
shippingMethod?: ShippingMethod;
|
|
5
|
+
deliveryLeadTimeForShipment?: DeliveryLeadTime;
|
|
6
|
+
currentShippingMethodId?: string;
|
|
7
|
+
shipmentId?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const ShippingMethodChildrenContext: import("react").Context<InitialShippingMethodContext>;
|
|
10
|
+
export default ShippingMethodChildrenContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";const initial={},ShippingMethodChildrenContext=createContext(initial);export default ShippingMethodChildrenContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";import{skuListsInitialState}from"../reducers/SkuListsReducer";export const SkuListsContext=createContext(skuListsInitialState);export default SkuListsContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export interface SkuOptionChildrenInitalState {
|
|
4
|
-
skuOption?:
|
|
5
|
-
skuCode: string;
|
|
6
|
-
}
|
|
7
|
-
declare const SkuOptionChildrenContext: import("react").Context<SkuOptionChildrenInitalState>;
|
|
8
|
-
export default SkuOptionChildrenContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SkuOption } from '@commercelayer/sdk';
|
|
3
|
+
export interface SkuOptionChildrenInitalState {
|
|
4
|
+
skuOption?: SkuOption | null;
|
|
5
|
+
skuCode: string;
|
|
6
|
+
}
|
|
7
|
+
declare const SkuOptionChildrenContext: import("react").Context<SkuOptionChildrenInitalState>;
|
|
8
|
+
export default SkuOptionChildrenContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";const initial={skuCode:""},SkuOptionChildrenContext=createContext(initial);export default SkuOptionChildrenContext;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const SkuOptionsContext: import("react").Context<import("../reducers/SkuOptionsReducer").SkuOptionsState>;
|
|
3
|
-
export default SkuOptionsContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const SkuOptionsContext: import("react").Context<import("../reducers/SkuOptionsReducer").SkuOptionsState>;
|
|
3
|
+
export default SkuOptionsContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";import{skuOptionsInitialState}from"../reducers/SkuOptionsReducer";const SkuOptionsContext=createContext(skuOptionsInitialState);export default SkuOptionsContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export interface InitialStockTransferContext {
|
|
4
|
-
stockTransfer
|
|
5
|
-
}
|
|
6
|
-
declare const StockTransferChildrenContext: import("react").Context<InitialStockTransferContext>;
|
|
7
|
-
export default StockTransferChildrenContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StockTransfer } from '@commercelayer/sdk';
|
|
3
|
+
export interface InitialStockTransferContext {
|
|
4
|
+
stockTransfer?: StockTransfer;
|
|
5
|
+
}
|
|
6
|
+
declare const StockTransferChildrenContext: import("react").Context<InitialStockTransferContext>;
|
|
7
|
+
export default StockTransferChildrenContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";const initial={},StockTransferChildrenContext=createContext(initial);export default StockTransferChildrenContext;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const VariantsContext: import("react").Context<import("../reducers/VariantReducer").VariantState>;
|
|
3
|
-
export default VariantsContext;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const VariantsContext: import("react").Context<import("../reducers/VariantReducer").VariantState>;
|
|
3
|
+
export default VariantsContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";import{variantInitialState}from"../reducers/VariantReducer";const VariantsContext=createContext(variantInitialState);export default VariantsContext;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export { default as AddToCartButton } from './components/AddToCartButton';
|
|
2
|
+
export { default as Address } from './components/Address';
|
|
3
|
+
export { default as AddressCountrySelector } from './components/AddressCountrySelector';
|
|
4
|
+
export { default as AddressField } from './components/AddressField';
|
|
5
|
+
export { default as AddressInput } from './components/AddressInput';
|
|
6
|
+
export { default as AddressStateSelector } from './components/AddressStateSelector';
|
|
7
|
+
export { default as AddressesContainer } from './components/AddressesContainer';
|
|
8
|
+
export { default as AdjustmentAmount } from './components/AdjustmentAmount';
|
|
9
|
+
export { default as AvailabilityContainer } from './components/AvailabilityContainer';
|
|
10
|
+
export { default as AvailabilityTemplate } from './components/AvailabilityTemplate';
|
|
11
|
+
export { default as BillingAddressContainer } from './components/BillingAddressContainer';
|
|
12
|
+
export { default as BillingAddressForm } from './components/BillingAddressForm';
|
|
13
|
+
export { default as CheckoutLink } from './components/CheckoutLink';
|
|
14
|
+
export { default as CommerceLayer } from './components/CommerceLayer';
|
|
15
|
+
export { default as CustomerContainer } from './components/CustomerContainer';
|
|
16
|
+
export { default as CustomerInput } from './components/CustomerInput';
|
|
17
|
+
export { default as DeliveryLeadTime } from './components/DeliveryLeadTime';
|
|
18
|
+
export { default as DiscountAmount } from './components/DiscountAmount';
|
|
19
|
+
export { default as Errors } from './components/Errors';
|
|
20
|
+
export { default as ExternalFunction } from './components/ExternalFunction';
|
|
21
|
+
export { default as GiftCard } from './components/GiftCard';
|
|
22
|
+
export { default as GiftCardAmount } from './components/GiftCardAmount';
|
|
23
|
+
export { default as GiftCardContainer } from './components/GiftCardContainer';
|
|
24
|
+
export { default as GiftCardCurrencySelector } from './components/GiftCardCurrencySelector';
|
|
25
|
+
export { default as GiftCardInput } from './components/GiftCardInput';
|
|
26
|
+
export { default as GiftCardOrCouponCode } from './components/GiftCardOrCouponCode';
|
|
27
|
+
export { default as GiftCardOrCouponForm } from './components/GiftCardOrCouponForm';
|
|
28
|
+
export { default as GiftCardOrCouponInput } from './components/GiftCardOrCouponInput';
|
|
29
|
+
export { default as GiftCardOrCouponRemoveButton } from './components/GiftCardOrCouponRemoveButton';
|
|
30
|
+
export { default as GiftCardOrCouponSubmit } from './components/GiftCardOrCouponSubmit';
|
|
31
|
+
export { default as ItemContainer } from './components/ItemContainer';
|
|
32
|
+
export { default as LineItem } from './components/LineItem';
|
|
33
|
+
export { default as LineItemAmount } from './components/LineItemAmount';
|
|
34
|
+
export { default as LineItemCode } from './components/LineItemCode';
|
|
35
|
+
export { default as LineItemImage } from './components/LineItemImage';
|
|
36
|
+
export { default as LineItemName } from './components/LineItemName';
|
|
37
|
+
export { default as LineItemOption } from './components/LineItemOption';
|
|
38
|
+
export { default as LineItemOptions } from './components/LineItemOptions';
|
|
39
|
+
export { default as LineItemQuantity } from './components/LineItemQuantity';
|
|
40
|
+
export { default as LineItemRemoveLink } from './components/LineItemRemoveLink';
|
|
41
|
+
export { default as LineItemsContainer } from './components/LineItemsContainer';
|
|
42
|
+
export { default as LineItemsCount } from './components/LineItemsCount';
|
|
43
|
+
export { default as LineItemsEmpty } from './components/LineItemsEmpty';
|
|
44
|
+
export { default as MetadataInput } from './components/MetadataInput';
|
|
45
|
+
export { default as OrderContainer } from './components/OrderContainer';
|
|
46
|
+
export { default as OrderNumber } from './components/OrderNumber';
|
|
47
|
+
export { default as OrderStorage } from './components/OrderStorage';
|
|
48
|
+
export { default as PaymentMethod } from './components/PaymentMethod';
|
|
49
|
+
export { default as PaymentMethodAmount } from './components/PaymentMethodAmount';
|
|
50
|
+
export { default as PaymentMethodName } from './components/PaymentMethodName';
|
|
51
|
+
export { default as PaymentMethodPrice } from './components/PaymentMethodPrice';
|
|
52
|
+
export { default as PaymentMethodRadioButton } from './components/PaymentMethodRadioButton';
|
|
53
|
+
export { default as PaymentMethodsContainer } from './components/PaymentMethodsContainer';
|
|
54
|
+
export { default as PaymentSource } from './components/PaymentSource';
|
|
55
|
+
export { default as PaymentSourceBrandIcon } from './components/PaymentSourceBrandIcon';
|
|
56
|
+
export { default as PaymentSourceBrandName } from './components/PaymentSourceBrandName';
|
|
57
|
+
export { default as PaymentSourceDetail } from './components/PaymentSourceDetail';
|
|
58
|
+
export { default as PaymentSourceEditButton } from './components/PaymentSourceEditButton';
|
|
59
|
+
export { default as PlaceOrderButton } from './components/PlaceOrderButton';
|
|
60
|
+
export { default as PlaceOrderContainer } from './components/PlaceOrderContainer';
|
|
61
|
+
export { default as Price } from './components/Price';
|
|
62
|
+
export { default as PricesContainer } from './components/PricesContainer';
|
|
63
|
+
export { default as PrivacyAndTermsCheckbox } from './components/PrivacyAndTermsCheckbox';
|
|
64
|
+
export { default as QuantitySelector } from './components/QuantitySelector';
|
|
65
|
+
export { default as SaveAddressesButton } from './components/SaveAddressesButton';
|
|
66
|
+
export { default as SaveCustomerButton } from './components/SaveCustomerButton';
|
|
67
|
+
export { default as Shipment } from './components/Shipment';
|
|
68
|
+
export { default as ShipmentField } from './components/ShipmentField';
|
|
69
|
+
export { default as ShipmentsContainer } from './components/ShipmentsContainer';
|
|
70
|
+
export { default as ShippingAddressContainer } from './components/ShippingAddressContainer';
|
|
71
|
+
export { default as ShippingAddressForm } from './components/ShippingAddressForm';
|
|
72
|
+
export { default as ShippingAmount } from './components/ShippingAmount';
|
|
73
|
+
export { default as ShippingMethod } from './components/ShippingMethod';
|
|
74
|
+
export { default as ShippingMethodName } from './components/ShippingMethodName';
|
|
75
|
+
export { default as ShippingMethodPrice } from './components/ShippingMethodPrice';
|
|
76
|
+
export { default as ShippingMethodRadioButton } from './components/ShippingMethodRadioButton';
|
|
77
|
+
export { default as SkuList } from './components/SkuList';
|
|
78
|
+
export { default as SkuListsContainer } from './components/SkuListsContainer';
|
|
79
|
+
export { default as SkuOption } from './components/SkuOption';
|
|
80
|
+
export { default as SkuOptionInput } from './components/SkuOptionInput';
|
|
81
|
+
export { default as SkuOptionsContainer } from './components/SkuOptionsContainer';
|
|
82
|
+
export { default as StockTransfer } from './components/StockTransfer';
|
|
83
|
+
export { default as StockTransferField } from './components/StockTransferField';
|
|
84
|
+
export { default as SubTotalAmount } from './components/SubTotalAmount';
|
|
85
|
+
export { default as SubmitButton } from './components/SubmitButton';
|
|
86
|
+
export { default as TaxesAmount } from './components/TaxesAmount';
|
|
87
|
+
export { default as TotalAmount } from './components/TotalAmount';
|
|
88
|
+
export { default as VariantSelector } from './components/VariantSelector';
|
|
89
|
+
export { default as VariantsContainer } from './components/VariantsContainer';
|
|
90
|
+
export type { CustomerCardsType } from './components/utils/PaymentCardsTemplate';
|
|
91
|
+
export type { AddressCardsType } from './components/utils/AddressCardsTemplate';
|
|
92
|
+
export type { AddToCartButtonType } from './components/AddToCartButton';
|
|
93
|
+
export type { ShippingMethodRadioButtonType, ShippingMethodRadioButtonOnChangeType, } from './components/ShippingMethodRadioButton';
|
|
94
|
+
export type { LineItemCodeType } from './components/LineItemCode';
|
|
95
|
+
export type { LineItemNameType } from './components/LineItemName';
|
|
96
|
+
export type { LineItemImageType } from './components/LineItemImage';
|
|
97
|
+
export type { LineItemType } from './typings/index';
|
|
98
|
+
export type { ErrorComponentProps, ResourceErrorType } from './typings/errors';
|
|
99
|
+
export type { AddressCountrySelectName, AddressInputName, AddressStateSelectName, BaseInputType, } from './typings/index';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as AddToCartButton}from"./components/AddToCartButton";export{default as Address}from"./components/Address";export{default as AddressCountrySelector}from"./components/AddressCountrySelector";export{default as AddressField}from"./components/AddressField";export{default as AddressInput}from"./components/AddressInput";export{default as AddressStateSelector}from"./components/AddressStateSelector";export{default as AddressesContainer}from"./components/AddressesContainer";export{default as AdjustmentAmount}from"./components/AdjustmentAmount";export{default as AvailabilityContainer}from"./components/AvailabilityContainer";export{default as AvailabilityTemplate}from"./components/AvailabilityTemplate";export{default as BillingAddressContainer}from"./components/BillingAddressContainer";export{default as BillingAddressForm}from"./components/BillingAddressForm";export{default as CheckoutLink}from"./components/CheckoutLink";export{default as CommerceLayer}from"./components/CommerceLayer";export{default as CustomerContainer}from"./components/CustomerContainer";export{default as CustomerInput}from"./components/CustomerInput";export{default as DeliveryLeadTime}from"./components/DeliveryLeadTime";export{default as DiscountAmount}from"./components/DiscountAmount";export{default as Errors}from"./components/Errors";export{default as ExternalFunction}from"./components/ExternalFunction";export{default as GiftCard}from"./components/GiftCard";export{default as GiftCardAmount}from"./components/GiftCardAmount";export{default as GiftCardContainer}from"./components/GiftCardContainer";export{default as GiftCardCurrencySelector}from"./components/GiftCardCurrencySelector";export{default as GiftCardInput}from"./components/GiftCardInput";export{default as GiftCardOrCouponCode}from"./components/GiftCardOrCouponCode";export{default as GiftCardOrCouponForm}from"./components/GiftCardOrCouponForm";export{default as GiftCardOrCouponInput}from"./components/GiftCardOrCouponInput";export{default as GiftCardOrCouponRemoveButton}from"./components/GiftCardOrCouponRemoveButton";export{default as GiftCardOrCouponSubmit}from"./components/GiftCardOrCouponSubmit";export{default as ItemContainer}from"./components/ItemContainer";export{default as LineItem}from"./components/LineItem";export{default as LineItemAmount}from"./components/LineItemAmount";export{default as LineItemCode}from"./components/LineItemCode";export{default as LineItemImage}from"./components/LineItemImage";export{default as LineItemName}from"./components/LineItemName";export{default as LineItemOption}from"./components/LineItemOption";export{default as LineItemOptions}from"./components/LineItemOptions";export{default as LineItemQuantity}from"./components/LineItemQuantity";export{default as LineItemRemoveLink}from"./components/LineItemRemoveLink";export{default as LineItemsContainer}from"./components/LineItemsContainer";export{default as LineItemsCount}from"./components/LineItemsCount";export{default as LineItemsEmpty}from"./components/LineItemsEmpty";export{default as MetadataInput}from"./components/MetadataInput";export{default as OrderContainer}from"./components/OrderContainer";export{default as OrderNumber}from"./components/OrderNumber";export{default as OrderStorage}from"./components/OrderStorage";export{default as PaymentMethod}from"./components/PaymentMethod";export{default as PaymentMethodAmount}from"./components/PaymentMethodAmount";export{default as PaymentMethodName}from"./components/PaymentMethodName";export{default as PaymentMethodPrice}from"./components/PaymentMethodPrice";export{default as PaymentMethodRadioButton}from"./components/PaymentMethodRadioButton";export{default as PaymentMethodsContainer}from"./components/PaymentMethodsContainer";export{default as PaymentSource}from"./components/PaymentSource";export{default as PaymentSourceBrandIcon}from"./components/PaymentSourceBrandIcon";export{default as PaymentSourceBrandName}from"./components/PaymentSourceBrandName";export{default as PaymentSourceDetail}from"./components/PaymentSourceDetail";export{default as PaymentSourceEditButton}from"./components/PaymentSourceEditButton";export{default as PlaceOrderButton}from"./components/PlaceOrderButton";export{default as PlaceOrderContainer}from"./components/PlaceOrderContainer";export{default as Price}from"./components/Price";export{default as PricesContainer}from"./components/PricesContainer";export{default as PrivacyAndTermsCheckbox}from"./components/PrivacyAndTermsCheckbox";export{default as QuantitySelector}from"./components/QuantitySelector";export{default as SaveAddressesButton}from"./components/SaveAddressesButton";export{default as SaveCustomerButton}from"./components/SaveCustomerButton";export{default as Shipment}from"./components/Shipment";export{default as ShipmentField}from"./components/ShipmentField";export{default as ShipmentsContainer}from"./components/ShipmentsContainer";export{default as ShippingAddressContainer}from"./components/ShippingAddressContainer";export{default as ShippingAddressForm}from"./components/ShippingAddressForm";export{default as ShippingAmount}from"./components/ShippingAmount";export{default as ShippingMethod}from"./components/ShippingMethod";export{default as ShippingMethodName}from"./components/ShippingMethodName";export{default as ShippingMethodPrice}from"./components/ShippingMethodPrice";export{default as ShippingMethodRadioButton}from"./components/ShippingMethodRadioButton";export{default as SkuList}from"./components/SkuList";export{default as SkuListsContainer}from"./components/SkuListsContainer";export{default as SkuOption}from"./components/SkuOption";export{default as SkuOptionInput}from"./components/SkuOptionInput";export{default as SkuOptionsContainer}from"./components/SkuOptionsContainer";export{default as StockTransfer}from"./components/StockTransfer";export{default as StockTransferField}from"./components/StockTransferField";export{default as SubTotalAmount}from"./components/SubTotalAmount";export{default as SubmitButton}from"./components/SubmitButton";export{default as TaxesAmount}from"./components/TaxesAmount";export{default as TotalAmount}from"./components/TotalAmount";export{default as VariantSelector}from"./components/VariantSelector";export{default as VariantsContainer}from"./components/VariantsContainer";
|
|
@@ -1,57 +1,59 @@
|
|
|
1
|
-
import { Dispatch } from 'react';
|
|
2
|
-
import { BaseError } from
|
|
3
|
-
import { CommerceLayerConfig } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export declare type
|
|
7
|
-
export declare type
|
|
8
|
-
export declare
|
|
9
|
-
export declare
|
|
10
|
-
export declare type
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
declare
|
|
54
|
-
export declare const
|
|
55
|
-
|
|
56
|
-
declare const
|
|
57
|
-
export
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { BaseError, ResourceErrorType } from '../typings/errors';
|
|
3
|
+
import { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
4
|
+
import { Address, AddressCreate, Order } from '@commercelayer/sdk';
|
|
5
|
+
import { updateOrder } from './OrderReducer';
|
|
6
|
+
export declare type AddressActionType = 'setErrors' | 'setAddress' | 'setShipToDifferentAddress' | 'setCloneAddress' | 'cleanup';
|
|
7
|
+
export declare type AddressField = 'city' | 'company' | 'country_code' | 'first_name' | 'last_name' | 'line_1' | 'line_2' | 'phone' | 'state_code' | 'zip_code' | 'billing_info';
|
|
8
|
+
export declare type AddressFieldView = AddressField | 'full_address' | 'full_name';
|
|
9
|
+
export declare const addressFields: AddressField[];
|
|
10
|
+
export declare type AddressResource = Extract<ResourceErrorType, 'billing_address' | 'shipping_address'>;
|
|
11
|
+
export declare type AddressSchema = Address;
|
|
12
|
+
export interface AddressActionPayload {
|
|
13
|
+
errors: BaseError[];
|
|
14
|
+
billing_address: AddressCreate;
|
|
15
|
+
shipping_address: AddressCreate;
|
|
16
|
+
shipToDifferentAddress: boolean;
|
|
17
|
+
billingAddressId: string;
|
|
18
|
+
shippingAddressId: string;
|
|
19
|
+
isBusiness: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare type AddressState = Partial<AddressActionPayload>;
|
|
22
|
+
export interface AddressAction {
|
|
23
|
+
type: AddressActionType;
|
|
24
|
+
payload: Partial<AddressActionPayload>;
|
|
25
|
+
}
|
|
26
|
+
export declare const addressInitialState: AddressState;
|
|
27
|
+
export interface SetAddressErrors {
|
|
28
|
+
<V extends BaseError[]>(args: {
|
|
29
|
+
errors: V;
|
|
30
|
+
resource: Extract<ResourceErrorType, 'billing_address' | 'shipping_address'>;
|
|
31
|
+
dispatch?: Dispatch<AddressAction>;
|
|
32
|
+
currentErrors?: V;
|
|
33
|
+
}): void;
|
|
34
|
+
}
|
|
35
|
+
export declare type SetAddressParams<V extends AddressSchema> = {
|
|
36
|
+
values: V;
|
|
37
|
+
resource: AddressResource;
|
|
38
|
+
dispatch?: Dispatch<AddressAction>;
|
|
39
|
+
};
|
|
40
|
+
export interface SetAddress {
|
|
41
|
+
<V extends AddressSchema>(params: SetAddressParams<V>): void;
|
|
42
|
+
}
|
|
43
|
+
export interface SaveAddresses {
|
|
44
|
+
(params: {
|
|
45
|
+
orderId?: string;
|
|
46
|
+
order?: Order | null;
|
|
47
|
+
updateOrder?: typeof updateOrder;
|
|
48
|
+
config: CommerceLayerConfig;
|
|
49
|
+
state: AddressState;
|
|
50
|
+
dispatch: Dispatch<AddressAction>;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export declare const setAddressErrors: SetAddressErrors;
|
|
54
|
+
export declare const setAddress: SetAddress;
|
|
55
|
+
declare type SetCloneAddress = (id: string, resource: AddressResource, dispatch: Dispatch<AddressAction>) => void;
|
|
56
|
+
export declare const setCloneAddress: SetCloneAddress;
|
|
57
|
+
export declare const saveAddresses: SaveAddresses;
|
|
58
|
+
declare const addressReducer: (state: AddressState, reducer: AddressAction) => AddressState;
|
|
59
|
+
export default addressReducer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import isEmpty from"lodash/isEmpty";import getSdk from"../utils/getSdk";import camelCase from"lodash/camelCase";export const addressFields=["city","company","country_code","first_name","last_name","line_1","line_2","phone","state_code","zip_code"],addressInitialState={errors:[]},setAddressErrors=({errors,dispatch,currentErrors=[],resource})=>{const billingErrors=resource==="billing_address"?errors.filter(e=>e.resource===resource):currentErrors.filter(e=>e.resource==="billing_address"),shippingErrors=resource==="shipping_address"?errors.filter(e=>e.resource===resource):currentErrors.filter(e=>e.resource==="shipping_address"),finalErrors=[...billingErrors,...shippingErrors];dispatch&&dispatch({type:"setErrors",payload:{errors:finalErrors}})},setAddress=({values,resource,dispatch})=>{dispatch&&dispatch({type:"setAddress",payload:{[`${resource}`]:values}})},setCloneAddress=(id,resource,dispatch)=>{dispatch({type:"setCloneAddress",payload:{[`${camelCase(resource)}Id`]:id}})},saveAddresses=async({config,updateOrder,order,state})=>{var _a,_b,_c;const{shipToDifferentAddress,billing_address,shipping_address,billingAddressId,shippingAddressId}=state;try{const sdk=getSdk(config);if(order){const currentBillingAddressRef=(_a=order==null?void 0:order.billing_address)===null||_a===void 0?void 0:_a.reference,orderAttributes={id:order==null?void 0:order.id,_billing_address_clone_id:billingAddressId,_shipping_address_clone_id:billingAddressId};if(currentBillingAddressRef===billingAddressId&&(orderAttributes._billing_address_clone_id=(_b=order==null?void 0:order.billing_address)===null||_b===void 0?void 0:_b.id,orderAttributes._shipping_address_clone_id=(_c=order==null?void 0:order.shipping_address)===null||_c===void 0?void 0:_c.id),!isEmpty(billing_address)&&billing_address){delete orderAttributes._billing_address_clone_id,delete orderAttributes._shipping_address_clone_id,orderAttributes._shipping_address_same_as_billing=!0;const address=await sdk.addresses.create(billing_address);orderAttributes.billing_address=sdk.addresses.relationship(address.id)}if(shipToDifferentAddress&&(delete orderAttributes._shipping_address_same_as_billing,shippingAddressId&&(orderAttributes._shipping_address_clone_id=shippingAddressId),!isEmpty(shipping_address)&&shipping_address)){delete orderAttributes._shipping_address_clone_id;const address=await sdk.addresses.create(shipping_address);orderAttributes.shipping_address=sdk.addresses.relationship(address.id)}!isEmpty(orderAttributes)&&updateOrder&&await updateOrder({id:order.id,attributes:orderAttributes})}}catch(error){console.error(error)}};const type=["setErrors","setAddress","setShipToDifferentAddress","setCloneAddress","cleanup"],addressReducer=(state,reducer)=>baseReducer(state,reducer,type);export default addressReducer;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BaseError } from '../typings/errors';
|
|
2
|
+
import { Sku } from '@commercelayer/sdk';
|
|
3
|
+
import { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
4
|
+
import { Dispatch } from 'react';
|
|
5
|
+
import { Items } from './ItemReducer';
|
|
6
|
+
export declare type DeliveryLeadTime = {
|
|
7
|
+
shipping_method: {
|
|
8
|
+
name: string;
|
|
9
|
+
reference: string;
|
|
10
|
+
price_amount_cents: number;
|
|
11
|
+
free_over_amount_cents: number;
|
|
12
|
+
formatted_price_amount: string;
|
|
13
|
+
formatted_free_over_amount: string;
|
|
14
|
+
};
|
|
15
|
+
min: LeadTimes;
|
|
16
|
+
max: LeadTimes;
|
|
17
|
+
};
|
|
18
|
+
declare type Level = {
|
|
19
|
+
delivery_lead_times: Partial<DeliveryLeadTime>[];
|
|
20
|
+
quantity: number;
|
|
21
|
+
};
|
|
22
|
+
declare type Inventory = {
|
|
23
|
+
inventory: {
|
|
24
|
+
available: boolean;
|
|
25
|
+
quantity: number;
|
|
26
|
+
levels: Level[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare type SkuInventory = Sku & Inventory;
|
|
30
|
+
export declare type LeadTimes = {
|
|
31
|
+
hours: number;
|
|
32
|
+
days: number;
|
|
33
|
+
};
|
|
34
|
+
export declare type AvailabilityPayload = {
|
|
35
|
+
quantity?: number | null;
|
|
36
|
+
errors?: BaseError[];
|
|
37
|
+
} & Partial<DeliveryLeadTime>;
|
|
38
|
+
export declare type AvailabilityState = AvailabilityPayload;
|
|
39
|
+
export interface AvailabilityAction {
|
|
40
|
+
type: AvailabilityActionType;
|
|
41
|
+
payload: AvailabilityPayload;
|
|
42
|
+
}
|
|
43
|
+
export declare const availabilityInitialState: AvailabilityState;
|
|
44
|
+
declare type GetAvailability = (args: {
|
|
45
|
+
skuCode: string;
|
|
46
|
+
dispatch: Dispatch<AvailabilityAction>;
|
|
47
|
+
config: CommerceLayerConfig;
|
|
48
|
+
setItem?: (item: Items) => void;
|
|
49
|
+
}) => void;
|
|
50
|
+
export declare const getAvailability: GetAvailability;
|
|
51
|
+
export declare type AvailabilityActionType = 'setAvailability' | 'setErrors';
|
|
52
|
+
declare const availabilityReducer: (state: AvailabilityState, reducer: AvailabilityAction) => AvailabilityState;
|
|
53
|
+
export default availabilityReducer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";export const availabilityInitialState={quantity:null,min:{days:0,hours:0},max:{days:0,hours:0},errors:[]},getAvailability=async({skuCode,dispatch,config,setItem})=>{var _a;const sdk=getSdk(config);try{const[sku]=await sdk.skus.list({fields:{skus:["id"]},filters:{code_in:skuCode}}),skuInventory=await sdk.skus.retrieve(sku.id,{fields:{skus:["inventory"]}}),[level]=((_a=skuInventory.inventory)===null||_a===void 0?void 0:_a.levels)||[],[delivery]=(level==null?void 0:level.delivery_lead_times)||[];dispatch({type:"setAvailability",payload:Object.assign(Object.assign({},delivery),{quantity:skuInventory.inventory.quantity})}),setItem&&setItem({[skuCode]:skuInventory})}catch(error){console.error("Get SKU availability",error)}};const typeAction=["setAvailability","setErrors"],availabilityReducer=(state,reducer)=>baseReducer(state,reducer,typeAction);export default availabilityReducer;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import { Dispatch } from 'react';
|
|
2
|
-
import { CommerceLayerConfig } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export declare type BillingAddressActionType = 'setBillingAddress' | 'setBillingCustomerAddressId' | 'cleanup';
|
|
6
|
-
export interface BillingAddressActionPayload {
|
|
7
|
-
|
|
8
|
-
billingCustomerAddressId: string;
|
|
9
|
-
}
|
|
10
|
-
export declare type BillingAddressState = Partial<BillingAddressActionPayload>;
|
|
11
|
-
export interface BillingAddressAction {
|
|
12
|
-
type: BillingAddressActionType;
|
|
13
|
-
payload: Partial<BillingAddressActionPayload>;
|
|
14
|
-
}
|
|
15
|
-
export declare const billingAddressInitialState: BillingAddressState;
|
|
16
|
-
export declare type SetBillingAddress = (id: string, options?: {
|
|
17
|
-
config: CommerceLayerConfig;
|
|
18
|
-
dispatch: Dispatch<BillingAddressAction>;
|
|
19
|
-
order?:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export default billingAddressReducer;
|
|
1
|
+
import { Dispatch } from 'react';
|
|
2
|
+
import { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
3
|
+
import { Order } from '@commercelayer/sdk';
|
|
4
|
+
import { AddressResource } from './AddressReducer';
|
|
5
|
+
export declare type BillingAddressActionType = 'setBillingAddress' | 'setBillingCustomerAddressId' | 'cleanup';
|
|
6
|
+
export interface BillingAddressActionPayload {
|
|
7
|
+
_billing_address_clone_id: string;
|
|
8
|
+
billingCustomerAddressId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare type BillingAddressState = Partial<BillingAddressActionPayload>;
|
|
11
|
+
export interface BillingAddressAction {
|
|
12
|
+
type: BillingAddressActionType;
|
|
13
|
+
payload: Partial<BillingAddressActionPayload>;
|
|
14
|
+
}
|
|
15
|
+
export declare const billingAddressInitialState: BillingAddressState;
|
|
16
|
+
export declare type SetBillingAddress = (id: string, options?: {
|
|
17
|
+
config: CommerceLayerConfig;
|
|
18
|
+
dispatch: Dispatch<BillingAddressAction>;
|
|
19
|
+
order?: Order;
|
|
20
|
+
shipToDifferentAddress?: boolean;
|
|
21
|
+
customerAddressId?: string;
|
|
22
|
+
}) => Promise<void>;
|
|
23
|
+
export declare const setBillingAddress: SetBillingAddress;
|
|
24
|
+
declare type SetBillingCustomerAddressId = (args: {
|
|
25
|
+
dispatch: Dispatch<BillingAddressAction>;
|
|
26
|
+
order: Order;
|
|
27
|
+
setCloneAddress: (id: string, resource: AddressResource) => void;
|
|
28
|
+
}) => void;
|
|
29
|
+
export declare const setBillingCustomerAddressId: SetBillingCustomerAddressId;
|
|
30
|
+
declare const billingAddressReducer: (state: BillingAddressState, reducer: BillingAddressAction) => BillingAddressState;
|
|
31
|
+
export default billingAddressReducer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";export const billingAddressInitialState={_billing_address_clone_id:""},setBillingAddress=async(id,options)=>{try{if(options==null?void 0:options.order){if(options.customerAddressId){const sdk=getSdk(options.config),attributes={id,reference:options.customerAddressId};await sdk.addresses.update(attributes)}options.dispatch({type:"setBillingAddress",payload:{_billing_address_clone_id:id}})}}catch(error){console.error("Set billing address",error)}},setBillingCustomerAddressId=async({dispatch,order,setCloneAddress})=>{var _a;const customerAddressId=(_a=order==null?void 0:order.billing_address)===null||_a===void 0?void 0:_a.reference;try{customerAddressId&&(dispatch({type:"setBillingCustomerAddressId",payload:{billingCustomerAddressId:customerAddressId}}),setCloneAddress(customerAddressId,"billing_address"))}catch(error){console.error("error",error)}};const type=["setBillingAddress","setBillingCustomerAddressId","cleanup"],billingAddressReducer=(state,reducer)=>baseReducer(state,reducer,type);export default billingAddressReducer;
|