@commercelayer/react-components 2.49.0 → 2.49.4
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/lib/cjs/components/AddToCartButton.js +1 -1
- package/lib/cjs/components/Address.js +1 -1
- package/lib/cjs/components/AddressCountrySelector.js +1 -1
- package/lib/cjs/components/AddressField.js +1 -1
- package/lib/cjs/components/AddressInput.js +1 -1
- package/lib/cjs/components/AddressStateSelector.js +1 -1
- package/lib/cjs/components/AddressesContainer.js +1 -1
- package/lib/cjs/components/AdyenPayment.js +1 -1
- package/lib/cjs/components/AvailabilityContainer.js +1 -1
- package/lib/cjs/components/AvailabilityTemplate.js +1 -1
- package/lib/cjs/components/BillingAddressContainer.js +1 -1
- package/lib/cjs/components/BillingAddressForm.js +1 -1
- package/lib/cjs/components/BraintreePayment.js +1 -1
- package/lib/cjs/components/CheckoutLink.js +1 -1
- package/lib/cjs/components/CommerceLayer.js +1 -1
- package/lib/cjs/components/CustomerContainer.js +1 -1
- package/lib/cjs/components/CustomerInput.js +1 -1
- package/lib/cjs/components/DeliveryLeadTime.js +1 -1
- package/lib/cjs/components/DiscountAmount.js +1 -1
- package/lib/cjs/components/Errors.js +1 -1
- package/lib/cjs/components/ExternalFunction.js +1 -1
- package/lib/cjs/components/GiftCard.js +1 -1
- package/lib/cjs/components/GiftCardAmount.js +1 -1
- package/lib/cjs/components/GiftCardContainer.js +1 -1
- package/lib/cjs/components/GiftCardCurrencySelector.js +1 -1
- package/lib/cjs/components/GiftCardInput.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponCode.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponForm.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponInput.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponSubmit.js +1 -1
- package/lib/cjs/components/ItemContainer.js +1 -1
- package/lib/cjs/components/LineItem.js +1 -1
- package/lib/cjs/components/LineItemAmount.js +1 -1
- package/lib/cjs/components/LineItemCode.js +1 -1
- package/lib/cjs/components/LineItemImage.js +1 -1
- package/lib/cjs/components/LineItemName.js +1 -1
- package/lib/cjs/components/LineItemOption.js +1 -1
- package/lib/cjs/components/LineItemOptions.js +1 -1
- package/lib/cjs/components/LineItemQuantity.js +1 -1
- package/lib/cjs/components/LineItemRemoveLink.js +1 -1
- package/lib/cjs/components/LineItemsContainer.js +1 -1
- package/lib/cjs/components/LineItemsCount.js +1 -1
- package/lib/cjs/components/MetadataInput.js +1 -1
- package/lib/cjs/components/OrderContainer.js +1 -1
- package/lib/cjs/components/OrderNumber.js +1 -1
- package/lib/cjs/components/OrderStorage.js +1 -1
- package/lib/cjs/components/PaymentGateway.js +1 -1
- package/lib/cjs/components/PaymentMethod.js +1 -1
- package/lib/cjs/components/PaymentMethodAmount.js +1 -1
- package/lib/cjs/components/PaymentMethodName.js +1 -1
- package/lib/cjs/components/PaymentMethodPrice.js +1 -1
- package/lib/cjs/components/PaymentMethodRadioButton.js +1 -1
- package/lib/cjs/components/PaymentMethodsContainer.js +1 -1
- package/lib/cjs/components/PaymentSource.js +1 -1
- package/lib/cjs/components/PaymentSourceBrandIcon.js +1 -1
- package/lib/cjs/components/PaymentSourceBrandName.js +1 -1
- package/lib/cjs/components/PaymentSourceDetail.js +1 -1
- package/lib/cjs/components/PaymentSourceEditButton.js +1 -1
- package/lib/cjs/components/PaypalPayment.js +1 -1
- package/lib/cjs/components/PlaceOrderButton.js +1 -1
- package/lib/cjs/components/PlaceOrderContainer.js +1 -1
- package/lib/cjs/components/Price.js +1 -1
- package/lib/cjs/components/PricesContainer.js +1 -1
- package/lib/cjs/components/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/cjs/components/QuantitySelector.js +1 -1
- package/lib/cjs/components/SaveAddressesButton.js +1 -1
- package/lib/cjs/components/SaveCustomerButton.js +1 -1
- package/lib/cjs/components/Shipment.js +1 -1
- package/lib/cjs/components/ShipmentField.js +1 -1
- package/lib/cjs/components/ShipmentsContainer.js +1 -1
- package/lib/cjs/components/ShippingAddressContainer.js +1 -1
- package/lib/cjs/components/ShippingAddressForm.js +1 -1
- package/lib/cjs/components/ShippingAmount.js +1 -1
- package/lib/cjs/components/ShippingMethod.js +1 -1
- package/lib/cjs/components/ShippingMethodName.js +1 -1
- package/lib/cjs/components/ShippingMethodPrice.js +1 -1
- package/lib/cjs/components/ShippingMethodRadioButton.js +1 -1
- package/lib/cjs/components/SkuList.js +1 -1
- package/lib/cjs/components/SkuListsContainer.js +1 -1
- package/lib/cjs/components/SkuOption.js +1 -1
- package/lib/cjs/components/SkuOptionInput.js +1 -1
- package/lib/cjs/components/SkuOptionsContainer.js +1 -1
- package/lib/cjs/components/StockTransfer.js +1 -1
- package/lib/cjs/components/StockTransferField.js +1 -1
- package/lib/cjs/components/StripePayment.js +1 -1
- package/lib/cjs/components/SubTotalAmount.js +1 -1
- package/lib/cjs/components/SubmitButton.js +1 -1
- package/lib/cjs/components/TaxesAmount.js +1 -1
- package/lib/cjs/components/TotalAmount.js +1 -1
- package/lib/cjs/components/VariantSelector.js +1 -1
- package/lib/cjs/components/VariantsContainer.js +1 -1
- package/lib/cjs/components/WireTransferPayment.js +1 -1
- package/lib/cjs/components/gateways/AdyenGateway.js +1 -1
- package/lib/cjs/components/gateways/BraintreeGateway.js +1 -1
- package/lib/cjs/components/gateways/PaypalGateway.js +1 -1
- package/lib/cjs/components/gateways/StripeGateway.js +1 -1
- package/lib/cjs/components/gateways/WireTransferGateway.js +1 -1
- package/lib/cjs/components/utils/AddressCardsTemplate.js +1 -1
- package/lib/cjs/components/utils/BaseField.js +1 -1
- package/lib/cjs/components/utils/BaseInput.js +1 -1
- package/lib/cjs/components/utils/BaseOrderPrice.js +1 -1
- package/lib/cjs/components/utils/BaseSelect.js +1 -1
- package/lib/cjs/components/utils/Parent.js +1 -1
- package/lib/cjs/components/utils/PaymentCardsTemplate.js +1 -1
- package/lib/cjs/components/utils/PriceTemplate.js +1 -1
- package/lib/cjs/components/utils/VariantTemplate.js +1 -1
- package/lib/cjs/components/utils/getAllErrors.js +1 -1
- package/lib/cjs/config/components.js +1 -1
- package/lib/cjs/config/currency.js +1 -1
- package/lib/cjs/context/AddressChildrenContext.js +1 -1
- package/lib/cjs/context/AddressContext.js +1 -1
- package/lib/cjs/context/AvailabilityContext.js +1 -1
- package/lib/cjs/context/BillingAddressContext.js +1 -1
- package/lib/cjs/context/BillingAddressFormContext.js +1 -1
- package/lib/cjs/context/CommerceLayerContext.js +1 -1
- package/lib/cjs/context/CouponAndGiftCardFormContext.js +1 -1
- package/lib/cjs/context/CustomerContext.js +1 -1
- package/lib/cjs/context/ExternalFunctionContext.js +1 -1
- package/lib/cjs/context/GiftCardContext.js +1 -1
- package/lib/cjs/context/ItemContext.js +1 -1
- package/lib/cjs/context/LineItemChildrenContext.js +1 -1
- package/lib/cjs/context/LineItemContext.js +1 -1
- package/lib/cjs/context/LineItemOptionChildrenContext.js +1 -1
- package/lib/cjs/context/OrderContext.js +1 -1
- package/lib/cjs/context/OrderStorageContext.js +1 -1
- package/lib/cjs/context/PaymentMethodChildrenContext.js +1 -1
- package/lib/cjs/context/PaymentMethodContext.js +1 -1
- package/lib/cjs/context/PaymentSourceContext.js +1 -1
- package/lib/cjs/context/PlaceOrderContext.js +1 -1
- package/lib/cjs/context/PricesContext.js +1 -1
- package/lib/cjs/context/ShipmentChildrenContext.js +1 -1
- package/lib/cjs/context/ShipmentContext.js +1 -1
- package/lib/cjs/context/ShippingAddressContext.js +1 -1
- package/lib/cjs/context/ShippingAddressFormContext.js +1 -1
- package/lib/cjs/context/ShippingMethodChildrenContext.js +1 -1
- package/lib/cjs/context/SkuListsContext.js +1 -1
- package/lib/cjs/context/SkuOptionChildrenContext.js +1 -1
- package/lib/cjs/context/SkuOptionsContext.js +1 -1
- package/lib/cjs/context/StockTransferChildrenContext.js +1 -1
- package/lib/cjs/context/VariantsContext.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/reducers/AddressReducer.js +1 -1
- package/lib/cjs/reducers/AvailabilityReducer.js +1 -1
- package/lib/cjs/reducers/BillingAddressReducer.js +1 -1
- package/lib/cjs/reducers/CustomerReducer.js +1 -1
- package/lib/cjs/reducers/GiftCardReducer.js +1 -1
- package/lib/cjs/reducers/ItemReducer.js +1 -1
- package/lib/cjs/reducers/LineItemReducer.js +1 -1
- package/lib/cjs/reducers/OrderReducer.js +1 -1
- package/lib/cjs/reducers/PaymentMethodReducer.js +1 -1
- package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
- package/lib/cjs/reducers/PriceReducer.js +1 -1
- package/lib/cjs/reducers/ShipmentReducer.js +1 -1
- package/lib/cjs/reducers/ShippingAddressReducer.js +1 -1
- package/lib/cjs/reducers/SkuListsReducer.js +1 -1
- package/lib/cjs/reducers/SkuOptionsReducer.js +1 -1
- package/lib/cjs/reducers/VariantReducer.js +1 -1
- package/lib/cjs/typings/errors.js +1 -1
- package/lib/cjs/typings/index.js +1 -1
- package/lib/cjs/utils/PropsType.js +1 -1
- package/lib/cjs/utils/addressesManager.js +1 -1
- package/lib/cjs/utils/baseReducer.js +1 -1
- package/lib/cjs/utils/browserInfo.js +1 -1
- package/lib/cjs/utils/childrenTypes.js +1 -1
- package/lib/cjs/utils/countryStateCity.js +1 -1
- package/lib/cjs/utils/customMessages.js +1 -1
- package/lib/cjs/utils/customerOrderOptions.js +1 -1
- package/lib/cjs/utils/getAmount.js +1 -1
- package/lib/cjs/utils/getCurrentItemKey.js +1 -1
- package/lib/cjs/utils/getErrors.js +1 -1
- package/lib/cjs/utils/getLineItemsCount.js +1 -1
- package/lib/cjs/utils/getLoaderComponent.js +1 -1
- package/lib/cjs/utils/getPrices.js +1 -1
- package/lib/cjs/utils/getSdk.js +1 -1
- package/lib/cjs/utils/getSkus.js +1 -1
- package/lib/cjs/utils/isEmptyStates.js +1 -1
- package/lib/cjs/utils/isJSON.js +1 -1
- package/lib/cjs/utils/jwt.js +1 -1
- package/lib/cjs/utils/localStorage.js +1 -1
- package/lib/cjs/utils/organization.js +1 -1
- package/lib/cjs/utils/paypalPayment.js +1 -1
- package/lib/cjs/utils/promisify.js +1 -1
- package/lib/cjs/utils/shipments.js +1 -1
- package/lib/cjs/utils/validateFormFields.js +1 -1
- package/lib/esm/components/AddToCartButton.js +1 -1
- package/lib/esm/components/Address.js +1 -1
- package/lib/esm/components/AddressCountrySelector.js +1 -1
- package/lib/esm/components/AddressField.js +1 -1
- package/lib/esm/components/AddressInput.js +1 -1
- package/lib/esm/components/AddressStateSelector.js +1 -1
- package/lib/esm/components/AddressesContainer.js +1 -1
- package/lib/esm/components/AdyenPayment.js +1 -1
- package/lib/esm/components/AvailabilityContainer.js +1 -1
- package/lib/esm/components/AvailabilityTemplate.js +1 -1
- package/lib/esm/components/BillingAddressContainer.js +1 -1
- package/lib/esm/components/BillingAddressForm.js +1 -1
- package/lib/esm/components/BraintreePayment.js +1 -1
- package/lib/esm/components/CheckoutLink.js +1 -1
- package/lib/esm/components/CommerceLayer.js +1 -1
- package/lib/esm/components/CustomerContainer.js +1 -1
- package/lib/esm/components/CustomerInput.js +1 -1
- package/lib/esm/components/DeliveryLeadTime.js +1 -1
- package/lib/esm/components/DiscountAmount.js +1 -1
- package/lib/esm/components/Errors.js +1 -1
- package/lib/esm/components/ExternalFunction.js +1 -1
- package/lib/esm/components/GiftCard.js +1 -1
- package/lib/esm/components/GiftCardAmount.js +1 -1
- package/lib/esm/components/GiftCardContainer.js +1 -1
- package/lib/esm/components/GiftCardCurrencySelector.js +1 -1
- package/lib/esm/components/GiftCardInput.js +1 -1
- package/lib/esm/components/GiftCardOrCouponCode.js +1 -1
- package/lib/esm/components/GiftCardOrCouponForm.js +1 -1
- package/lib/esm/components/GiftCardOrCouponInput.js +1 -1
- package/lib/esm/components/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/esm/components/GiftCardOrCouponSubmit.js +1 -1
- package/lib/esm/components/ItemContainer.js +1 -1
- package/lib/esm/components/LineItem.js +1 -1
- package/lib/esm/components/LineItemAmount.js +1 -1
- package/lib/esm/components/LineItemCode.js +1 -1
- package/lib/esm/components/LineItemImage.js +1 -1
- package/lib/esm/components/LineItemName.js +1 -1
- package/lib/esm/components/LineItemOption.js +1 -1
- package/lib/esm/components/LineItemOptions.js +1 -1
- package/lib/esm/components/LineItemQuantity.js +1 -1
- package/lib/esm/components/LineItemRemoveLink.js +1 -1
- package/lib/esm/components/LineItemsContainer.js +1 -1
- package/lib/esm/components/LineItemsCount.js +1 -1
- package/lib/esm/components/MetadataInput.js +1 -1
- package/lib/esm/components/OrderContainer.js +1 -1
- package/lib/esm/components/OrderNumber.js +1 -1
- package/lib/esm/components/OrderStorage.js +1 -1
- package/lib/esm/components/PaymentGateway.js +1 -1
- package/lib/esm/components/PaymentMethod.js +1 -1
- package/lib/esm/components/PaymentMethodAmount.js +1 -1
- package/lib/esm/components/PaymentMethodName.js +1 -1
- package/lib/esm/components/PaymentMethodPrice.js +1 -1
- package/lib/esm/components/PaymentMethodRadioButton.js +1 -1
- package/lib/esm/components/PaymentMethodsContainer.js +1 -1
- package/lib/esm/components/PaymentSource.js +1 -1
- package/lib/esm/components/PaymentSourceBrandIcon.js +1 -1
- package/lib/esm/components/PaymentSourceBrandName.js +1 -1
- package/lib/esm/components/PaymentSourceDetail.js +1 -1
- package/lib/esm/components/PaymentSourceEditButton.js +1 -1
- package/lib/esm/components/PaypalPayment.js +1 -1
- package/lib/esm/components/PlaceOrderButton.js +1 -1
- package/lib/esm/components/PlaceOrderContainer.js +1 -1
- package/lib/esm/components/Price.js +1 -1
- package/lib/esm/components/PricesContainer.js +1 -1
- package/lib/esm/components/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/esm/components/QuantitySelector.js +1 -1
- package/lib/esm/components/SaveAddressesButton.js +1 -1
- package/lib/esm/components/SaveCustomerButton.js +1 -1
- package/lib/esm/components/Shipment.js +1 -1
- package/lib/esm/components/ShipmentField.js +1 -1
- package/lib/esm/components/ShipmentsContainer.js +1 -1
- package/lib/esm/components/ShippingAddressContainer.js +1 -1
- package/lib/esm/components/ShippingAddressForm.js +1 -1
- package/lib/esm/components/ShippingAmount.js +1 -1
- package/lib/esm/components/ShippingMethod.js +1 -1
- package/lib/esm/components/ShippingMethodName.js +1 -1
- package/lib/esm/components/ShippingMethodPrice.js +1 -1
- package/lib/esm/components/ShippingMethodRadioButton.js +1 -1
- package/lib/esm/components/SkuList.js +1 -1
- package/lib/esm/components/SkuListsContainer.js +1 -1
- package/lib/esm/components/SkuOption.js +1 -1
- package/lib/esm/components/SkuOptionInput.js +1 -1
- package/lib/esm/components/SkuOptionsContainer.js +1 -1
- package/lib/esm/components/StockTransfer.js +1 -1
- package/lib/esm/components/StockTransferField.js +1 -1
- package/lib/esm/components/StripePayment.js +1 -1
- package/lib/esm/components/SubTotalAmount.js +1 -1
- package/lib/esm/components/SubmitButton.js +1 -1
- package/lib/esm/components/TaxesAmount.js +1 -1
- package/lib/esm/components/TotalAmount.js +1 -1
- package/lib/esm/components/VariantSelector.js +1 -1
- package/lib/esm/components/VariantsContainer.js +1 -1
- package/lib/esm/components/WireTransferPayment.js +1 -1
- package/lib/esm/components/gateways/AdyenGateway.js +1 -1
- package/lib/esm/components/gateways/BraintreeGateway.js +1 -1
- package/lib/esm/components/gateways/PaypalGateway.js +1 -1
- package/lib/esm/components/gateways/StripeGateway.js +1 -1
- package/lib/esm/components/gateways/WireTransferGateway.js +1 -1
- package/lib/esm/components/utils/AddressCardsTemplate.js +1 -1
- package/lib/esm/components/utils/BaseField.js +1 -1
- package/lib/esm/components/utils/BaseInput.js +1 -1
- package/lib/esm/components/utils/BaseOrderPrice.js +1 -1
- package/lib/esm/components/utils/BaseSelect.js +1 -1
- package/lib/esm/components/utils/Parent.js +1 -1
- package/lib/esm/components/utils/PaymentCardsTemplate.js +1 -1
- package/lib/esm/components/utils/PriceTemplate.js +1 -1
- package/lib/esm/components/utils/VariantTemplate.js +1 -1
- package/lib/esm/components/utils/getAllErrors.js +1 -1
- package/lib/esm/config/components.js +1 -1
- package/lib/esm/context/AddressChildrenContext.js +1 -1
- package/lib/esm/context/AddressContext.js +1 -1
- package/lib/esm/context/AvailabilityContext.js +1 -1
- package/lib/esm/context/BillingAddressContext.js +1 -1
- package/lib/esm/context/BillingAddressFormContext.js +1 -1
- package/lib/esm/context/CommerceLayerContext.js +1 -1
- package/lib/esm/context/CouponAndGiftCardFormContext.js +1 -1
- package/lib/esm/context/CustomerContext.js +1 -1
- package/lib/esm/context/ExternalFunctionContext.js +1 -1
- package/lib/esm/context/GiftCardContext.js +1 -1
- package/lib/esm/context/ItemContext.js +1 -1
- package/lib/esm/context/LineItemChildrenContext.js +1 -1
- package/lib/esm/context/LineItemContext.js +1 -1
- package/lib/esm/context/LineItemOptionChildrenContext.js +1 -1
- package/lib/esm/context/OrderContext.js +1 -1
- package/lib/esm/context/OrderStorageContext.js +1 -1
- package/lib/esm/context/PaymentMethodChildrenContext.js +1 -1
- package/lib/esm/context/PaymentMethodContext.js +1 -1
- package/lib/esm/context/PaymentSourceContext.js +1 -1
- package/lib/esm/context/PlaceOrderContext.js +1 -1
- package/lib/esm/context/PricesContext.js +1 -1
- package/lib/esm/context/ShipmentChildrenContext.js +1 -1
- package/lib/esm/context/ShipmentContext.js +1 -1
- package/lib/esm/context/ShippingAddressContext.js +1 -1
- package/lib/esm/context/ShippingAddressFormContext.js +1 -1
- package/lib/esm/context/ShippingMethodChildrenContext.js +1 -1
- package/lib/esm/context/SkuListsContext.js +1 -1
- package/lib/esm/context/SkuOptionChildrenContext.js +1 -1
- package/lib/esm/context/SkuOptionsContext.js +1 -1
- package/lib/esm/context/StockTransferChildrenContext.js +1 -1
- package/lib/esm/context/VariantsContext.js +1 -1
- package/lib/esm/reducers/AddressReducer.js +1 -1
- package/lib/esm/reducers/AvailabilityReducer.js +1 -1
- package/lib/esm/reducers/BillingAddressReducer.js +1 -1
- package/lib/esm/reducers/CustomerReducer.js +1 -1
- package/lib/esm/reducers/GiftCardReducer.js +1 -1
- package/lib/esm/reducers/ItemReducer.js +1 -1
- package/lib/esm/reducers/LineItemReducer.js +1 -1
- package/lib/esm/reducers/OrderReducer.js +1 -1
- package/lib/esm/reducers/PaymentMethodReducer.js +1 -1
- package/lib/esm/reducers/PlaceOrderReducer.js +1 -1
- package/lib/esm/reducers/PriceReducer.js +1 -1
- package/lib/esm/reducers/ShipmentReducer.js +1 -1
- package/lib/esm/reducers/ShippingAddressReducer.js +1 -1
- package/lib/esm/reducers/SkuListsReducer.js +1 -1
- package/lib/esm/reducers/SkuOptionsReducer.js +1 -1
- package/lib/esm/reducers/VariantReducer.js +1 -1
- package/lib/esm/typings/errors.js +1 -1
- package/lib/esm/typings/index.js +1 -1
- package/lib/esm/utils/addressesManager.js +1 -1
- package/lib/esm/utils/baseReducer.js +1 -1
- package/lib/esm/utils/browserInfo.js +1 -1
- package/lib/esm/utils/childrenTypes.js +1 -1
- package/lib/esm/utils/countryStateCity.js +1 -1
- package/lib/esm/utils/customMessages.js +1 -1
- package/lib/esm/utils/customerOrderOptions.js +1 -1
- package/lib/esm/utils/getAmount.js +1 -1
- package/lib/esm/utils/getCurrentItemKey.js +1 -1
- package/lib/esm/utils/getErrors.js +1 -1
- package/lib/esm/utils/getLineItemsCount.js +1 -1
- package/lib/esm/utils/getLoaderComponent.js +1 -1
- package/lib/esm/utils/getPrices.js +1 -1
- package/lib/esm/utils/getSdk.js +1 -1
- package/lib/esm/utils/getSkus.js +1 -1
- package/lib/esm/utils/isEmptyStates.js +1 -1
- package/lib/esm/utils/isJSON.js +1 -1
- package/lib/esm/utils/jwt.js +1 -1
- package/lib/esm/utils/localStorage.js +1 -1
- package/lib/esm/utils/organization.js +1 -1
- package/lib/esm/utils/paypalPayment.js +1 -1
- package/lib/esm/utils/promisify.js +1 -1
- package/lib/esm/utils/shipments.js +1 -1
- package/lib/esm/utils/validateFormFields.js +1 -1
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +4 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";import getErrors from"../utils/getErrors";export const getLineItems=e=>{const{order:t,dispatch:r,config:s}=e;const o=getSdk(s);let i=[];t&&o.orders.retrieve(t===null||t===void 0?void 0:t.id,{include:["line_items","line_items.line_item_options.sku_option"],fields:{orders:["line_items"]}}).then((e=>{r({type:"setLoading",payload:{loading:false}});const t=e.line_items||[];i=[...i,...t];r({type:"setLineItems",payload:{lineItems:i}})})).catch((e=>{const t=getErrors(e,"line_items");r({type:"setErrors",payload:{errors:t}})}))};export const updateLineItem=async e=>{const{config:t,lineItemId:r,quantity:s,getOrder:o,orderId:i,dispatch:n}=e;const a=getSdk(t);try{await a.line_items.update({id:r,quantity:s});o&&await o(i);n({type:"setErrors",payload:{errors:[]}})}catch(e){const t=getErrors(e,"line_items");n({type:"setErrors",payload:{errors:t}})}};export const deleteLineItem=async e=>{const{config:t,lineItemId:r,getOrder:s,orderId:o,dispatch:i}=e;const n=getSdk(t);try{await n.line_items.delete(r);s&&await s(o);i({type:"setErrors",payload:{errors:[]}})}catch(e){const t=getErrors(e,"line_items");i({type:"setErrors",payload:{errors:t}})}};export const lineItemInitialState={loading:false,lineItems:[],errors:[]};const actionType=["setLineItems","setErrors","setLoading"];const lineItemReducer=(e,t)=>baseReducer(e,t,actionType);export default lineItemReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import{isEmpty,size,map}from"lodash";import getSdk from"../utils/getSdk";import getErrors,{setErrors}from"../utils/getErrors";const actionType=["setLoading","setOrderId","setOrder","setSingleQuantity","setCurrentSkuCodes","setCurrentSkuPrices","setErrors","setCurrentItem","setSaveAddressToCustomerAddressBook","setIncludesResource"];export const createOrder=async r=>{if(r){const{persistKey:e,state:t,dispatch:s,config:o,orderMetadata:d,orderAttributes:c={},setLocalOrder:n}=r;if(t===null||t===void 0?void 0:t.orderId)return t.orderId;const a=getSdk(o);try{const r=await(a===null||a===void 0?void 0:a.orders.create(Object.assign({metadata:d},c)));s&&s({type:"setOrderId",payload:{orderId:r===null||r===void 0?void 0:r.id}});e&&n&&n(e,r.id);return r.id}catch(r){const e=getErrors(r,"orders");console.error("Create order",e);if(s)setErrors({currentErrors:t===null||t===void 0?void 0:t.errors,newErrors:e,dispatch:s})}}return""};export const getApiOrder=async r=>{const{id:e,dispatch:t,config:s,clearWhenPlaced:o,persistKey:d,deleteLocalOrder:c,state:n}=r;const a=getSdk(s);try{const r={};if((n===null||n===void 0?void 0:n.include)&&n.include.length>0){r.include=n.include}const s=await a.orders.retrieve(e,r);if(o&&s.status==="placed"||s.status==="approved"||s.status==="cancelled"){d&&c&&c(d);t&&t({type:"setOrder",payload:{order:undefined,orderId:""}})}else{t&&t({type:"setOrder",payload:{order:s,orderId:s.id}})}return s}catch(r){const e=getErrors(r,"orders");console.error("Retrieve order",e);if(t)setErrors({currentErrors:n===null||n===void 0?void 0:n.errors,newErrors:e,dispatch:t});return}};export async function updateOrder({id:r,attributes:e,dispatch:t,config:s,include:o}){const d=getSdk(s);try{const s=Object.assign(Object.assign({},e),{id:r});const c=await d.orders.update(s,{include:o});t&&t({type:"setOrder",payload:{order:c}})}catch(r){const e=getErrors(r,"orders");if(t){setOrderErrors({errors:e,dispatch:t});t({type:"setErrors",payload:{errors:e}})}}}export const setOrder=(r,e)=>{e&&e({type:"setOrder",payload:{order:r}})};export function addResourceToInclude({resourcesIncluded:r=[],dispatch:e,newResource:t}){const s=[...r,...typeof t==="string"?[t]:t];e&&e({type:"setIncludesResource",payload:{include:s}})}export const addToCart=async r=>{const{skuCode:e,bundleCode:t,skuId:s,quantity:o,option:d,config:c,dispatch:n,lineItem:a,state:i,errors:u=[]}=r;try{const p=getSdk(c);const l=await createOrder(r);if(l){const c=p.orders.relationship(l);const y=a===null||a===void 0?void 0:a.name;const f=a===null||a===void 0?void 0:a.imageUrl;const g={order:c,sku_code:e,name:y,image_url:f,quantity:o||1,_update_quantity:true,bundle_code:t};if(s){g["item"]=p.skus.relationship(s)}const m=await p.line_items.create(g);if(!isEmpty(d)){let e=0;map(d,(async t=>{const{options:s,skuOptionId:o}=t;const c=p.sku_options.relationship(o);const n=p.line_items.relationship(m.id);const a={quantity:1,options:s,sku_option:c,line_item:n};await p.line_item_options.create(a);e+=1;if(e===size(d)){await getApiOrder(Object.assign({id:l},r))}}))}else{await getApiOrder(Object.assign(Object.assign({id:l},r),{state:i}))}if(!isEmpty(u)&&n){n({type:"setErrors",payload:{errors:[]}})}return{success:true}}return{success:false}}catch(r){const e=getErrors(r,"orders");console.error("Add to cart",e);if(n)setErrors({currentErrors:i===null||i===void 0?void 0:i.errors,newErrors:e,dispatch:n});return{success:false}}};export const unsetOrderState=r=>{r({type:"setOrderId",payload:{orderId:""}});r({type:"setOrder",payload:{order:undefined}})};export function setOrderErrors({dispatch:r,errors:e}){r&&r({type:"setErrors",payload:{errors:e}});return{success:false}}export const saveAddressToCustomerAddressBook=({type:r,value:e,dispatch:t})=>{const s=`save_${r}_to_customer_book`;const o=`${e}`;localStorage.setItem(s,o);t&&t({type:"setSaveAddressToCustomerAddressBook",payload:{[s]:o}})};export const setGiftCardOrCouponCode=async({code:r,dispatch:e,config:t,order:s})=>{try{if(t&&s&&r&&e){const o=getSdk(t);const d={id:s.id,gift_card_or_coupon_code:r};const c=await o.orders.update(d);e({type:"setErrors",payload:{errors:[],order:c}});return{success:true}}return{success:false}}catch(r){const t=getErrors(r,"gift_card_or_coupon_code");e&&setOrderErrors({errors:t,dispatch:e});return{success:false}}};export const removeGiftCardOrCouponCode=async({codeType:r,dispatch:e,config:t,order:s})=>{try{if(t&&s&&e){const o=getSdk(t);const d={id:s.id,[r]:""};const c=await o.orders.update(d);e({type:"setErrors",payload:{errors:[],order:c}});return{success:true}}return{success:false}}catch(r){const t=getErrors(r,"gift_card_or_coupon_code");console.error("Remove gift card o coupon code",t);e&&setOrderErrors({errors:t,dispatch:e});return{success:false}}};export const orderInitialState={loading:false,orderId:"",order:undefined,errors:[]};const orderReducer=(r,e)=>baseReducer(r,e,actionType);export default orderReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getErrors,{setErrors}from"../utils/getErrors";import getSdk from"../utils/getSdk";import camelCase from"lodash/camelCase";import has from"lodash/has";import isEmpty from"lodash/isEmpty";export function setLoading({loading:e,dispatch:t}){t&&t({type:"setLoading",payload:{loading:e}})}export const setPaymentRef=({ref:e,dispatch:t})=>{if(e&&t){t({type:"setPaymentRef",payload:{currentPaymentMethodRef:e}})}};export const paymentMethodInitialState={errors:[]};export const setPaymentMethodErrors=(e,t)=>{t&&t({type:"setErrors",payload:{errors:e}})};export const getPaymentMethods=async({order:e,dispatch:t})=>{const r=e.available_payment_methods;const o=e.payment_method;const a=e.payment_source;t({type:"setPaymentMethods",payload:{paymentMethods:r,currentPaymentMethodId:o===null||o===void 0?void 0:o.id,currentPaymentMethodType:o===null||o===void 0?void 0:o.payment_source_type,paymentSource:a}})};export const setPaymentMethod=async({config:e,dispatch:t,order:r,paymentMethodId:o,updateOrder:a,setOrderErrors:s,paymentResource:n})=>{try{if(e&&r&&t&&n){localStorage.removeItem("_save_payment_source_to_customer_wallet");const d=getSdk(e);const c={payment_method:d.payment_methods.relationship(o)};t({type:"setPaymentMethods",payload:{currentPaymentMethodId:o,currentPaymentMethodType:n,errors:[]}});a&&await a({id:r.id,attributes:c});s&&s([])}}catch(e){const t=getErrors(e,"orders");console.error("Set payment method",t)}};export const setPaymentSource=async({config:e,dispatch:t,getOrder:r,attributes:o={},order:a,paymentResource:s,customerPaymentSourceId:n,paymentSourceId:d,updateOrder:c,errors:y})=>{try{if(e&&a){let y;const p=getSdk(e);if(!n){if(!d){const e=Object.assign(Object.assign({},o),{order:p.orders.relationship(a.id)});y=await p[s].create(e)}else{y=await p[s].update(Object.assign({id:d},o))}t&&t({type:"setPaymentSource",payload:{paymentSource:y,errors:[]}});r&&await r(a.id);return y}else{c&&await c({id:a.id,attributes:{_customer_payment_source_id:n}})}}}catch(e){const r=getErrors(e,"payment_methods");console.error("Set payment source:",r);if(t)setErrors({currentErrors:y,newErrors:r,dispatch:t})}return};export const updatePaymentSource=async({id:e,attributes:t,config:r,dispatch:o,paymentResource:a})=>{if(r){try{const s=getSdk(r);const n=await s[a].update(Object.assign({id:e},t));o&&o({type:"setPaymentSource",payload:{paymentSource:n}})}catch(e){console.error("Update payment source:",e)}}};export const destroyPaymentSource=async({paymentSourceId:e,paymentResource:t,dispatch:r})=>{if(e&&t){r&&r({type:"setPaymentSource",payload:{paymentSource:undefined}})}};export const setPaymentMethodConfig=(e,t)=>{t({type:"setPaymentMethodConfig",payload:{config:e}})};export function getPaymentConfig(e,t){const r=camelCase(e).replace("Payments","Payment").replace("Transfers","Transfer");return!isEmpty(t)&&has(t,r)?t[r]:undefined}const type=["setErrors","setPaymentMethodConfig","setPaymentMethods","setPaymentSource","setPaymentRef","setLoading"];const paymentMethodReducer=(e,t)=>baseReducer(e,t,type);export default paymentMethodReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import isEmpty from"lodash/isEmpty";import{shipmentsFilled}from"../utils/shipments";import{saveBillingAddress,saveShippingAddress,saveToWallet}from"../utils/customerOrderOptions";import getSdk from"../utils/getSdk";import getErrors from"../utils/getErrors";export const placeOrderInitialState={errors:[],isPermitted:false};export const setPlaceOrderErrors=(e,t)=>{t&&t({type:"setErrors",payload:{errors:e}})};export const placeOrderPermitted=async({config:e,order:t,dispatch:r,options:s})=>{var a;if(t&&e){let e=true;if(t.privacy_url&&t.terms_url){e=localStorage.getItem("privacy-terms")==="true"}const i=t.billing_address;if(isEmpty(i))e=false;const o=t.shipping_address;if(isEmpty(o))e=false;const d=t.shipments;const p=d&&shipmentsFilled(d);if(!isEmpty(d)&&!p)e=false;const l=t.payment_method;const n=t.payment_source;if(t.total_amount_with_taxes_cents!==0&&isEmpty(l===null||l===void 0?void 0:l.id))e=false;r({type:"setPlaceOrderPermitted",payload:{isPermitted:e,paymentType:l===null||l===void 0?void 0:l.payment_source_type,paymentSecret:n===null||n===void 0?void 0:n.client_secret,paymentId:(a=n===null||n===void 0?void 0:n.options)===null||a===void 0?void 0:a.id,paymentSource:n,options:s}})}};export const setPlaceOrder=async({state:e,order:t,config:r,setOrderErrors:s,paymentSource:a})=>{const i={placed:false};try{if(e&&t&&r&&a){const o=getSdk(r);const{options:d,paymentType:p}=e;if(p==="paypal_payments"){if(!(d===null||d===void 0?void 0:d.paypalPayerId)&&(a===null||a===void 0?void 0:a.approval_url)){window.location.href=a===null||a===void 0?void 0:a.approval_url;return i}await o.paypal_payments.update({id:a.id,paypal_payer_id:d===null||d===void 0?void 0:d.paypalPayerId})}const l={id:t.id,_place:true};if(saveBillingAddress()){await o.orders.update({id:t.id,_save_billing_address_to_customer_address_book:true})}if(saveShippingAddress()){await o.orders.update({id:t.id,_save_shipping_address_to_customer_address_book:true})}switch(p){case"braintree_payments":if(saveToWallet()){await o.orders.update({id:t.id,_save_payment_source_to_customer_wallet:true})}await o.orders.update(l);s&&s([]);return{placed:true};default:if(saveToWallet()){await o.orders.update({id:t.id,_save_payment_source_to_customer_wallet:true})}await o.orders.update(l);s&&s([]);return{placed:true}}}return i}catch(e){const t=getErrors(e,"orders");s&&s(t);return Object.assign(Object.assign({},i),{errors:t})}};const type=["setErrors","setPlaceOrderPermitted"];const placeOrderReducer=(e,t)=>baseReducer(e,t,type);export default placeOrderReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getPrices from"../utils/getPrices";import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";import getErrors from"../utils/getErrors";export const priceInitialState={loading:true,prices:{},skuCodes:[],errors:[]};export const getSkusPrice=(e,{config:t,dispatch:s,setPrices:r,prices:i,perPage:c,filters:o})=>{let a={};const p=getSdk(t);p.prices.list({filters:Object.assign({sku_code_in:e.join(",")},o),pageSize:c}).then((async t=>{const n=getPrices(t);a=Object.assign(Object.assign(Object.assign({},a),i),n);if(r){r(a)}s({type:"setPrices",payload:{prices:a}});s({type:"setLoading",payload:{loading:false}});const g=t.meta;if(g.pageCount>1){for(let t=g.currentPage+1;t<=g.pageCount;t++){const i=await p.prices.list({filters:Object.assign({sku_code_in:e.join(",")},o),pageSize:c,pageNumber:t});const n=getPrices(i);a=Object.assign(Object.assign({},a),n);if(r){r(a)}s({type:"setPrices",payload:{prices:a}})}}})).catch((e=>{const t=getErrors(e,"prices");s({type:"setErrors",payload:{errors:t}})}))};export const unsetPriceState=e=>{e({type:"setPrices",payload:{prices:{}}});e({type:"setLoading",payload:{loading:false}})};const typeAction=["setLoading","setPrices","setSkuCodes","setErrors"];const priceReducer=(e,t)=>baseReducer(e,t,typeAction);export default priceReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";export const shipmentInitialState={errors:[]};export const setShipmentErrors=(e,t)=>{t&&t({type:"setErrors",payload:{errors:e}})};export const getShipments=async({order:e,dispatch:t,config:s})=>{try{const i=getSdk(s);const o=e.shipments;const r=await i.delivery_lead_times.list({include:["shipping_method","stock_location"]});t({type:"setShipments",payload:{shipments:o,deliveryLeadTimes:r}})}catch(e){console.error(e)}};export const setShippingMethod=async({config:e,shipmentId:t,shippingMethodId:s,getOrder:i,order:o})=>{try{if(s){const r=getSdk(e);await r.shipments.update({id:t,shipping_method:r.shipping_methods.relationship(s)});if(i&&o)i(o.id)}}catch(e){console.error(e)}};const type=["setErrors","setShipments","setShippingMethod"];const shipmentReducer=(e,t)=>baseReducer(e,t,type);export default shipmentReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";export const shippingAddressInitialState={_shipping_address_clone_id:""};export const setShippingAddress=async(e,s)=>{try{if(s===null||s===void 0?void 0:s.order){if(s.customerAddressId){const d=getSdk(s.config);const r={id:e,reference:s.customerAddressId};await d.addresses.update(r)}s.dispatch({type:"setShippingAddress",payload:{_shipping_address_clone_id:e}})}}catch(e){console.error(e)}};export const setShippingCustomerAddressId=async({dispatch:e,order:s,setCloneAddress:d})=>{var r;const i=(r=s===null||s===void 0?void 0:s.shipping_address)===null||r===void 0?void 0:r.reference;try{if(i){e({type:"setShippingCustomerAddressId",payload:{shippingCustomerAddressId:i}});d(i,"shipping_address")}}catch(e){console.error("error",e)}};const type=["setShippingAddress","setShippingCustomerAddressId","cleanup"];const shippingAddressReducer=(e,s)=>baseReducer(e,s,type);export default shippingAddressReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";const actionType=["getSkuList","setSkuList"];export const skuListsInitialState={listIds:[]};export const getSkuList=async({listIds:s,config:t,dispatch:e})=>{const c={};try{const i=getSdk(t);s.forEach((async s=>{const t=await i.sku_lists.retrieve(s,{include:["skus"],fields:{skus:["code"]}});const e=t.skus;c[s]=e}));e({payload:{skuLists:c},type:"getSkuList"})}catch(s){console.error(s)}};const skuListsReducer=(s,t)=>baseReducer(s,t,actionType);export default skuListsReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";export const getSkuOptions=async t=>{const{skuOptions:s,dispatch:e}=t;e({type:"setSkuOptions",payload:{skuOptions:s}})};export const unsetSkuOptionsState=t=>{t({type:"setSkuOptions",payload:{skuOptions:[]}});t({type:"setErrors",payload:{errors:[]}})};const actionType=["setSkuOptions","setErrors"];export const skuOptionsInitialState={skuCode:"",skuOptions:[]};const skuOptionsReducer=(t,s)=>baseReducer(t,s,actionType);export default skuOptionsReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getSkus from"../utils/getSkus";import{isEmpty,has}from"lodash";import getSdk from"../utils/getSdk";export const setVariantSkuCodes=({skuCodes:e,dispatch:t,setCustomLineItems:s})=>{const o={};const a=e.map((e=>{if(has(e,"lineItem")){o[e.code]=e.lineItem}return e.code}));if(!isEmpty(o)){s&&s(o)}t({type:"setSkuCodes",payload:{skuCodes:a}})};export const setSkuCode=e=>{const{id:t,code:s,config:o,setItem:a,dispatch:r}=e;if(t){const e=getSdk(o);e.skus.retrieve(t,{include:["sku_options"]}).then((e=>{a&&a({[`${s}`]:e})})).catch((e=>{debugger;r({type:"setErrors",payload:{errors:e}})}))}};export const getVariants=e=>{const{config:t,state:s,skuCode:o,dispatch:a,setItem:r,filters:n}=e;const i=getSdk(t);i.skus.list({filters:Object.assign({code_in:s.skuCodes.join(",")},n)}).then((e=>{const n=getSkus(e,s.skuCodes);if(o){setSkuCode({code:n[o].code,id:n[o].id,config:t,dispatch:a,setItem:r})}a({type:"setVariants",payload:{variants:n}});a({type:"setLoading",payload:{loading:false}})})).catch((e=>{a({type:"setErrors",payload:{errors:e}})}))};export const unsetVariantState=e=>{e({type:"setSkuCode",payload:{skuCode:""}});e({type:"setVariants",payload:{variants:{}}});e({type:"setLoading",payload:{loading:false}})};export const variantInitialState={loading:false,variants:{},skuCodes:[],skuCode:"",errors:[],currentSkuId:"",currentSkuInventory:{available:false,quantity:0,levels:[]},currentQuantity:1,currentPrices:[]};const actionType=["setLoading","setVariants","setSkuCodes","setSkuCode","setCurrentSkuId","setCurrentSkuInventory","setCurrentPrices","setErrors"];const variantReducer=(e,t)=>baseReducer(e,t,actionType);export default variantReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PropTypes from"prop-types";const CEType=["EMPTY_ERROR","FILTER_NOT_ALLOWED","FORBIDDEN","INTERNAL_SERVER_ERROR","INVALID_DATA_FORMAT","INVALID_FIELD","INVALID_FIELD_FORMAT","INVALID_FIELD_VALUE","INVALID_FILTERS_SYNTAX","INVALID_FILTER_VALUE","INVALID_INCLUDE","INVALID_LINKS_OBJECT","INVALID_PAGE_OBJECT","INVALID_PAGE_VALUE","INVALID_RESOURCE","INVALID_RESOURCE_ID","INVALID_SORT_CRITERIA","INVALID_TOKEN","KEY_NOT_INCLUDED_IN_URL","KEY_ORDER_MISMATCH","LOCKED","NOT_ACCEPTABLE","PARAM_MISSING","PARAM_NOT_ALLOWED","RECORD_NOT_FOUND","RECORD_NOT_FOUND","RELATION_EXISTS","SAVE_FAILED","TYPE_MISMATCH","UNAUTHORIZED","UNSUPPORTED_MEDIA_TYPE","VALIDATION_ERROR"];export const REType=["gift_cards","line_items","orders","prices","sku_options","variant"];export const BaseErrorObject=PropTypes.shape({code:PropTypes.oneOf(CEType).isRequired,message:PropTypes.string.isRequired,resource:PropTypes.oneOf(REType),field:PropTypes.string,id:PropTypes.string});export const ErrorPropTypes={resource:PropTypes.oneOf(["billing_address","gift_cards","line_items","orders","payment_methods","prices","shipping_address","sku_options","variant"]).isRequired,children:PropTypes.func,field:PropTypes.string};
|
package/lib/esm/typings/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PropTypes from"prop-types";export const BC={id:PropTypes.string,className:PropTypes.string,style:PropTypes.object,name:PropTypes.string};export const PTLoader=PropTypes.oneOfType([PropTypes.element,PropTypes.string]);export const BaseSelectComponentPropTypes={children:PropTypes.func,options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,selected:PropTypes.bool}).isRequired).isRequired,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.string.isRequired};export const BaseInputComponentPropTypes={children:PropTypes.func,name:PropTypes.string.isRequired,type:PropTypes.oneOf(["text","email","number","date","checkbox","textarea"]).isRequired,onChange:PropTypes.func,placeholder:PropTypes.string};export const BMObject=PropTypes.objectOf(PropTypes.string);export const baseOrderPricePropTypes=Object.assign({base:PropTypes.string.isRequired,type:PropTypes.string.isRequired,children:PropTypes.func,format:PropTypes.oneOf(["formatted","cents","float"])},BC);export const baseOrderComponentPricePropTypes=Object.assign({children:baseOrderPricePropTypes["children"],format:baseOrderPricePropTypes["format"]},BC);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isEmpty
|
|
1
|
+
import{isEmpty}from"lodash";import{fieldsExist}from"./validateFormFields";import{addressFields}from"../reducers/AddressReducer";export const billingAddressController=({billing_address:i,billingAddressId:s,errors:e,requiresBillingInfo:r})=>{let d=!isEmpty(e)||isEmpty(i);if(isEmpty(e)&&!isEmpty(i)){let s=[...addressFields];if(r)s=[...s,"billing_info"];d=!!(i&&fieldsExist(i,s))}if(d&&!isEmpty(s)&&isEmpty(i)){d=false}return d};export const shippingAddressController=({billingDisable:i,errors:s,shipToDifferentAddress:e,shipping_address:r,shippingAddressId:d})=>{let t=!!(!i&&e);if(t&&isEmpty(s)&&!isEmpty(r)){t=!!(r&&fieldsExist(r))}if(t&&!isEmpty(d)&&isEmpty(r)){t=false}return t};export const countryLockController=({addresses:i,billing_address:s,billingAddressId:e,countryCodeLock:r,shipToDifferentAddress:d,shipping_address:t,shippingAddressId:o})=>{if(r&&!isEmpty(i)&&e&&!d){const s=i===null||i===void 0?void 0:i.find((i=>(i.id===e||i.reference===e)&&i.countryCode!==r));if(!isEmpty(s))return true}if(r&&!isEmpty(s)&&!d){return(s===null||s===void 0?void 0:s["country_code"])!==r}if(r&&!isEmpty(t)&&d){return(t===null||t===void 0?void 0:t["country_code"])!==r}if(r&&!isEmpty(i)&&o&&d){const s=i===null||i===void 0?void 0:i.find((i=>(i.id===o||i.reference===o)&&i.countryCode!==r));if(!isEmpty(s))return true}return false};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const baseReducer=(e,s,t)=>{const a=t;if(a.indexOf(s.type)!==-1){const t=s.payload;e=Object.assign(Object.assign({},e),t)}return e};export default baseReducer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function
|
|
1
|
+
export default function getBrowserInfo(){const n=window&&window.screen?window.screen.width:"";const e=window&&window.screen?window.screen.height:"";const o=window&&window.screen?window.screen.colorDepth:"";const w=window&&window.navigator?window.navigator.userAgent:"";const t=window&&window.navigator?navigator.javaEnabled():false;let i="";if(window&&window.navigator)i=window.navigator.language;const a=new Date;const r=a.getTimezoneOffset();const d={screenWidth:n,screenHeight:e,colorDepth:o,userAgent:w,timeZoneOffset:r,language:i,javaEnabled:t};return d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidElement
|
|
1
|
+
import{isValidElement,Children}from"react";import{isEmpty,isFunction,has,get}from"lodash";import components from"../config/components";const checkChildrenTypes=(e,i,n)=>{let t=null;const s=e[i];const r=n.replace("CL","");if((isEmpty(s)&&typeof s!=="function"||typeof s==="function"&&!s)&&e["isRequired"]){t=new Error(`The prop '${i}' is marked as required in '${r}', but its value is '${s}'.`)}Children.map(s,(e=>{if(t)return t;const n=e.type;const s=get(components,`${r}.permittedChildren`);const o=`Invalid prop '${i}' supplied to ${r}. Only components ${s.join(", ")} are allowed.`;if(isFunction(n)&&has(n,"displayName")){const e=get(n,"displayName");const i=n.name;if(e&&e===`${i}`){if(!s.includes(i)){t=new Error(o)}}}if(!isValidElement(e)){t=new Error(o)}}));return t};const childrenTypes=checkChildrenTypes;childrenTypes["isRequired"]=(e,i,n,t,s)=>checkChildrenTypes(Object.assign(Object.assign({},e),{isRequired:true}),i,n,t,s);export default childrenTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Countries
|
|
1
|
+
import{Countries,States}from"countries-states-cities-service";export function getCountries(){return Countries.getCountries({sort:{mode:"alphabetical",key:"name"}}).map((({name:e,iso2:t})=>({label:e,value:t})))}export function getStateOfCountry(e){const t={country_code:e};if(e==="IT")t.is_region=false;return States.getStates({filters:t,sort:{mode:"alphabetical",key:"name"}}).map((({name:e,state_code:t})=>({label:e.replace("Province of",""),value:t})))}export function isValidState(e,t){return States.getStates({filters:{state_code:e,country_code:t}}).length>0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import findIndex from"lodash/findIndex";import pick from"lodash/pick";const customMessages=(e=[],o)=>{const s=findIndex(e,pick(o,["field","code","resource"]));return s!==-1?e[s]:null};export default customMessages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getSaveBillingAddressToAddressBook
|
|
1
|
+
import{getSaveBillingAddressToAddressBook,getSavePaymentSourceToCustomerWallet,getSaveShippingAddressToAddressBook}from"./localStorage";export function saveToWallet(){return getSavePaymentSourceToCustomerWallet()}export function saveBillingAddress(){return getSaveBillingAddressToAddressBook()}export function saveShippingAddress(){return getSaveShippingAddressToAddressBook()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{keys
|
|
1
|
+
import{keys}from"lodash";export default function getAmount(o){const{format:t,type:e,obj:s,base:$}=o;let r;keys(s).map((o=>{const a=o.toLowerCase();const n=`${t}_${e}_${$}`.toLowerCase();const f=`${e}_${$}_${t}`.toLowerCase();const _=`${t}_${$}_${e}`.toLowerCase();const c=`${$}_${e}_${t}`.toLowerCase();if(a===n){r=s[o]}if(a===f){r=s[o]}if(a===_){r=s[o]}if(a===c){r=s[o]}}));return r}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{first
|
|
1
|
+
import{first,keys}from"lodash";const getCurrentItemKey=e=>first(keys(e))||"";export default getCurrentItemKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import differenceBy from"lodash/differenceBy";export default function getErrors(r,e){return r.errors.map((r=>Object.assign(Object.assign({},r),{resource:e})))}export function setErrors({currentErrors:r=[],newErrors:e=[],dispatch:o,filterBy:t="code"}){const s=differenceBy(r,e,t);const n=(r===null||r===void 0?void 0:r.length)===0?e:s;const c=[...r||[],...n];if(!o){return c}o({type:"setErrors",payload:{errors:c}})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const getLineItemsCount=(t,e=0)=>{const n=["skus","gift_cards","bundles","adjustments"];t.filter((t=>t.item_type&&n.includes(t.item_type))).forEach((t=>{if(t.quantity)e+=t.quantity}));return e};export default getLineItemsCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";export default function getLoaderComponent(t){return typeof t==="function"?_jsx(t,{},void 0):_jsx(_Fragment,{children:t},void 0)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as
|
|
1
|
+
import{createElement as _createElement}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{isEmpty,first,isArray,has}from"lodash";import PriceTemplate from"../components/utils/PriceTemplate";export const getPriceByCode=(e,t="")=>t?first(e.filter((e=>e.currency_code===t))):first(e);export const getPricesComponent=(e,t)=>{if(isEmpty(e)){return _jsx(PriceTemplate,Object.assign({},t),void 0)}return e.map(((e,r)=>{const o=typeof t.showCompare==="undefined"&&(e===null||e===void 0?void 0:e.compare_at_amount_cents)>(e===null||e===void 0?void 0:e.amount_cents)||t.showCompare;return _createElement(PriceTemplate,Object.assign({},t,{key:r,showCompare:o,formattedAmount:e.formatted_amount,formattedCompare:e.formatted_compare_at_amount}))}))};export default function getPrices(e){const t={};if(isArray(e)){e.forEach((e=>{const r=e.sku_code;if(has(t,r)){t[r].push(e)}else{t[r]=[e]}}))}return t}
|
package/lib/esm/utils/getSdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getOrganizationSlug from"./organization";import Sdk from"@commercelayer/sdk";export default function getSdk({endpoint:e,accessToken:n}){const o=getOrganizationSlug(e);return Sdk(Object.assign({accessToken:n},o))}
|
package/lib/esm/utils/getSkus.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const getSkus=(o,e)=>{const t={};e.forEach((e=>{o.forEach((o=>{if((o===null||o===void 0?void 0:o.code)===e)t[o.code]=o}))}));return t};export default getSkus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const countryLock=["IT","US"];export default function isEmptyStates(t){return!countryLock.includes(t)}
|
package/lib/esm/utils/isJSON.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function r
|
|
1
|
+
export default function isJSON(r){try{JSON.parse(r);return true}catch(r){return false}}
|
package/lib/esm/utils/jwt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import jwtDecode from"jwt-decode";export default function jwt(e){return jwtDecode(e)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const getLocalOrder=e=>localStorage.getItem(e)
|
|
1
|
+
export const getLocalOrder=e=>localStorage.getItem(e);export const setLocalOrder=(e,t)=>localStorage.setItem(e,t);export const deleteLocalOrder=e=>{localStorage.removeItem(e)};export const getSavePaymentSourceToCustomerWallet=()=>localStorage.getItem("_save_payment_source_to_customer_wallet")==="true";export const getSaveBillingAddressToAddressBook=()=>localStorage.getItem("_save_billing_address_to_customer_address_book")==="true";export const getSaveShippingAddressToAddressBook=()=>localStorage.getItem("_save_shipping_address_to_customer_address_book")==="true";export function setCustomerOrderParam(e,t){return setLocalOrder(e,t)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function
|
|
1
|
+
export default function getOrganizationSlug(e){const o={organization:"",domain:"commercelayer.io"};if(e.search("commercelayer.io")===-1)o.domain="commercelayer.co";o.organization=e.replace("https://","").replace(`.${o.domain}`,"");return o}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getPaymentConfig
|
|
1
|
+
import{getPaymentConfig}from"../reducers/PaymentMethodReducer";import pick from"lodash/pick";export default function getPaypalConfig(e,t){const r=getPaymentConfig(e,t);return r&&pick(r,["return_url","cancel_url"])}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isFunction from"lodash/isFunction";export default function promisify(i,o){return new Promise(((n,e)=>{if(o)i(o,((i,o)=>{if(i)e(i);n(o)}));else if(isFunction(i===null||i===void 0?void 0:i.tokenize)){i===null||i===void 0?void 0:i.tokenize(((i,o)=>{if(i)e(i);n(o)}))}else i(((i,o)=>{if(i)e(i);n(o)}))}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import compact from"lodash/compact";import isEmpty from"lodash/isEmpty";export function shipmentsFilled(t){const m=compact(t.filter((t=>!isEmpty(t.shipping_method))));return!isEmpty(m)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isEmpty from"lodash/isEmpty";import isString from"lodash/isString";import without from"lodash/without";import keys from"lodash/keys";import map from"lodash/map";import get from"lodash/get";import{addressFields}from"../reducers/AddressReducer";const EMAIL_PATTERN=/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$/;export const validateValue=(e,t,s,a)=>{if(!e){return{field:t,code:"VALIDATION_ERROR",message:`${t} - is required`,resourceType:a}}if(s==="email"&&isString(e)&&!e.match(EMAIL_PATTERN)){return{field:t,code:"VALIDATION_ERROR",message:`${t} - is not valid`,resourceType:a}}return{}};const validateFormFields=(e,t,s)=>{const a=[];let i={metadata:{}};map(e,(e=>{const r=!!get(e,"checked");const n=r?r:e.value==="on"?false:e.value;const o=e.getAttribute("name");if(o&&t.indexOf(o)!==-1||e.required){const t=validateValue(n,e.name,e.type,s);if(!isEmpty(t)){a.push(t)}i=Object.assign(Object.assign({},i),{[`${e.name}`]:n})}if(e.getAttribute("name")){const t=!!e.getAttribute("data-metadata");i=t?Object.assign(Object.assign({},i),{metadata:Object.assign(Object.assign({},i.metadata),{[`${e.name}`]:n})}):Object.assign(Object.assign({},i),{[`${e.name}`]:n})}}));return{errors:a,values:i}};export const fieldsExist=(e,t=addressFields)=>{if(!e["business"]){const s=without(t,"line_2","company");const a=keys(e).filter((e=>s.includes(e)));return s.length>a.length}else{const s=without(t,"first_name","last_name");const a=keys(e).filter((e=>s.includes(e)));return s.length>a.length}};export default validateFormFields;
|