@commercelayer/react-components 2.48.0 → 2.49.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/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.d.ts +5 -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.d.ts +5 -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 +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"../utils/baseReducer";export const setItemState=(t,e,s)=>{s({type:e.type,payload:{[`${e.key}`]:t}})},unsetItemState=t=>{t({type:"setItem",payload:{item:{}}}),t({type:"setItems",payload:{items:{}}}),t({type:"setQuantity",payload:{quantity:{}}}),t({type:"setOption",payload:{option:{}}}),t({type:"setCustomLineItems",payload:{lineItems:{}}}),t({type:"setCustomLineItem",payload:{lineItem:{}}})};const m=["setItem","setItems","setQuantity","setOption","setPrices","setCustomLineItems","setCustomLineItem","setSkuCode"];export const itemInitialState={items:{},item:{},quantity:{},option:{},prices:{},lineItems:{},lineItem:{},skuCode:""};const i=(t,e)=>o(t,e,m);export default i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m from"../utils/baseReducer";import l from"../utils/getSdk";import c from"../utils/getErrors";export const getLineItems=s=>{const{order:e,dispatch:o,config:n}=s,a=l(n);let t=[];e&&a.orders.retrieve(e==null?void 0:e.id,{include:["line_items","line_items.line_item_options.sku_option"],fields:{orders:["line_items"]}}).then(r=>{o({type:"setLoading",payload:{loading:!1}});const i=r.line_items||[];t=[...t,...i],o({type:"setLineItems",payload:{lineItems:t}})}).catch(r=>{const i=c(r,"line_items");o({type:"setErrors",payload:{errors:i}})})},updateLineItem=async s=>{const{config:e,lineItemId:o,quantity:n,getOrder:a,orderId:t,dispatch:r}=s,i=l(e);try{await i.line_items.update({id:o,quantity:n}),a&&await a(t),r({type:"setErrors",payload:{errors:[]}})}catch(d){const p=c(d,"line_items");r({type:"setErrors",payload:{errors:p}})}},deleteLineItem=async s=>{const{config:e,lineItemId:o,getOrder:n,orderId:a,dispatch:t}=s,r=l(e);try{await r.line_items.delete(o),n&&await n(a),t({type:"setErrors",payload:{errors:[]}})}catch(i){const d=c(i,"line_items");t({type:"setErrors",payload:{errors:d}})}},lineItemInitialState={loading:!1,lineItems:[],errors:[]};const y=["setLineItems","setErrors","setLoading"],I=(s,e)=>m(s,e,y);export default I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import R from"../utils/baseReducer";import{isEmpty as _,size as j,map as T}from"lodash";import y from"../utils/getSdk";import f,{setErrors as m}from"../utils/getErrors";const q=["setLoading","setOrderId","setOrder","setSingleQuantity","setCurrentSkuCodes","setCurrentSkuPrices","setErrors","setCurrentItem","setSaveAddressToCustomerAddressBook","setIncludesResource"];export const createOrder=async e=>{if(e){const{persistKey:t,state:r,dispatch:o,config:n,orderMetadata:d,orderAttributes:a={},setLocalOrder:s}=e;if(r==null?void 0:r.orderId)return r.orderId;const u=y(n);try{const c=await(u==null?void 0:u.orders.create(Object.assign({metadata:d},a)));return o&&o({type:"setOrderId",payload:{orderId:c==null?void 0:c.id}}),t&&s&&s(t,c.id),c.id}catch(c){const i=f(c,"orders");console.error("Create order",i),o&&m({currentErrors:r==null?void 0:r.errors,newErrors:i,dispatch:o})}}return""},getApiOrder=async e=>{const{id:t,dispatch:r,config:o,clearWhenPlaced:n,persistKey:d,deleteLocalOrder:a,state:s}=e,u=y(o);try{const c={};(s==null?void 0:s.include)&&s.include.length>0&&(c.include=s.include);const i=await u.orders.retrieve(t,c);return n&&i.status==="placed"||i.status==="approved"||i.status==="cancelled"?(d&&a&&a(d),r&&r({type:"setOrder",payload:{order:void 0,orderId:""}})):r&&r({type:"setOrder",payload:{order:i,orderId:i.id}}),i}catch(c){const i=f(c,"orders");console.error("Retrieve order",i),r&&m({currentErrors:s==null?void 0:s.errors,newErrors:i,dispatch:r});return}};export async function updateOrder({id:e,attributes:t,dispatch:r,config:o,include:n}){const d=y(o);try{const a=Object.assign(Object.assign({},t),{id:e}),s=await d.orders.update(a,{include:n});r&&r({type:"setOrder",payload:{order:s}})}catch(a){const s=f(a,"orders");r&&(setOrderErrors({errors:s,dispatch:r}),r({type:"setErrors",payload:{errors:s}}))}}export const setOrder=(e,t)=>{t&&t({type:"setOrder",payload:{order:e}})};export function addResourceToInclude({resourcesIncluded:e=[],dispatch:t,newResource:r}){const o=[...e,...typeof r=="string"?[r]:r];t&&t({type:"setIncludesResource",payload:{include:o}})}export const addToCart=async e=>{const{skuCode:t,bundleCode:r,skuId:o,quantity:n,option:d,config:a,dispatch:s,lineItem:u,state:c,errors:i=[]}=e;try{const l=y(a),p=await createOrder(e);if(p){const g=l.orders.relationship(p),k=u==null?void 0:u.name,I=u==null?void 0:u.imageUrl,v={order:g,sku_code:t,name:k,image_url:I,quantity:n||1,_update_quantity:!0,bundle_code:r};o&&(v.item=l.skus.relationship(o));const C=await l.line_items.create(v);if(_(d))await getApiOrder(Object.assign(Object.assign({id:p},e),{state:c}));else{let O=0;T(d,async E=>{const{options:b,skuOptionId:x}=E,w=l.sku_options.relationship(x),A=l.line_items.relationship(C.id),S={quantity:1,options:b,sku_option:w,line_item:A};await l.line_item_options.create(S),O+=1,O===j(d)&&await getApiOrder(Object.assign({id:p},e))})}return!_(i)&&s&&s({type:"setErrors",payload:{errors:[]}}),{success:!0}}return{success:!1}}catch(l){const p=f(l,"orders");return console.error("Add to cart",p),s&&m({currentErrors:c==null?void 0:c.errors,newErrors:p,dispatch:s}),{success:!1}}},unsetOrderState=e=>{e({type:"setOrderId",payload:{orderId:""}}),e({type:"setOrder",payload:{order:void 0}})};export function setOrderErrors({dispatch:e,errors:t}){return e&&e({type:"setErrors",payload:{errors:t}}),{success:!1}}export const saveAddressToCustomerAddressBook=({type:e,value:t,dispatch:r})=>{const o=`save_${e}_to_customer_book`,n=`${t}`;localStorage.setItem(o,n),r&&r({type:"setSaveAddressToCustomerAddressBook",payload:{[o]:n}})},setGiftCardOrCouponCode=async({code:e,dispatch:t,config:r,order:o})=>{try{if(r&&o&&e&&t){const n=y(r),d={id:o.id,gift_card_or_coupon_code:e},a=await n.orders.update(d);return t({type:"setErrors",payload:{errors:[],order:a}}),{success:!0}}return{success:!1}}catch(n){const d=f(n,"gift_card_or_coupon_code");return t&&setOrderErrors({errors:d,dispatch:t}),{success:!1}}},removeGiftCardOrCouponCode=async({codeType:e,dispatch:t,config:r,order:o})=>{try{if(r&&o&&t){const n=y(r),d={id:o.id,[e]:""},a=await n.orders.update(d);return t({type:"setErrors",payload:{errors:[],order:a}}),{success:!0}}return{success:!1}}catch(n){const d=f(n,"gift_card_or_coupon_code");return console.error("Remove gift card o coupon code",d),t&&setOrderErrors({errors:d,dispatch:t}),{success:!1}}},orderInitialState={loading:!1,orderId:"",order:void 0,errors:[]};const L=(e,t)=>R(e,t,q);export default L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import P from"../utils/baseReducer";import i,{setErrors as h}from"../utils/getErrors";import d from"../utils/getSdk";import f from"lodash/camelCase";import _ from"lodash/has";import M from"lodash/isEmpty";export function setLoading({loading:t,dispatch:e}){e&&e({type:"setLoading",payload:{loading:t}})}export const setPaymentRef=({ref:t,dispatch:e})=>{t&&e&&e({type:"setPaymentRef",payload:{currentPaymentMethodRef:t}})},paymentMethodInitialState={errors:[]},setPaymentMethodErrors=(t,e)=>{e&&e({type:"setErrors",payload:{errors:t}})},getPaymentMethods=async({order:t,dispatch:e})=>{const o=t.available_payment_methods,r=t.payment_method,a=t.payment_source;e({type:"setPaymentMethods",payload:{paymentMethods:o,currentPaymentMethodId:r==null?void 0:r.id,currentPaymentMethodType:r==null?void 0:r.payment_source_type,paymentSource:a}})},setPaymentMethod=async({config:t,dispatch:e,order:o,paymentMethodId:r,updateOrder:a,setOrderErrors:s,paymentResource:n})=>{try{if(t&&o&&e&&n){localStorage.removeItem("_save_payment_source_to_customer_wallet");const y={payment_method:d(t).payment_methods.relationship(r)};e({type:"setPaymentMethods",payload:{currentPaymentMethodId:r,currentPaymentMethodType:n,errors:[]}}),a&&await a({id:o.id,attributes:y}),s&&s([])}}catch(p){const y=i(p,"orders");console.error("Set payment method",y)}},setPaymentSource=async({config:t,dispatch:e,getOrder:o,attributes:r={},order:a,paymentResource:s,customerPaymentSourceId:n,paymentSourceId:p,updateOrder:y,errors:l})=>{try{if(t&&a){let m;const c=d(t);if(n)y&&await y({id:a.id,attributes:{_customer_payment_source_id:n}});else{if(p)m=await c[s].update(Object.assign({id:p},r));else{const u=Object.assign(Object.assign({},r),{order:c.orders.relationship(a.id)});m=await c[s].create(u)}return e&&e({type:"setPaymentSource",payload:{paymentSource:m,errors:[]}}),o&&await o(a.id),m}}}catch(m){const c=i(m,"payment_methods");console.error("Set payment source:",c),e&&h({currentErrors:l,newErrors:c,dispatch:e})}},updatePaymentSource=async({id:t,attributes:e,config:o,dispatch:r,paymentResource:a})=>{if(o)try{const n=await d(o)[a].update(Object.assign({id:t},e));r&&r({type:"setPaymentSource",payload:{paymentSource:n}})}catch(s){console.error("Update payment source:",s)}},destroyPaymentSource=async({paymentSourceId:t,paymentResource:e,dispatch:o})=>{t&&e&&o&&o({type:"setPaymentSource",payload:{paymentSource:void 0}})},setPaymentMethodConfig=(t,e)=>{e({type:"setPaymentMethodConfig",payload:{config:t}})};export function getPaymentConfig(t,e){const o=f(t).replace("Payments","Payment").replace("Transfers","Transfer");return!M(e)&&_(e,o)?e[o]:void 0}const S=["setErrors","setPaymentMethodConfig","setPaymentMethods","setPaymentSource","setPaymentRef","setLoading"],g=(t,e)=>P(t,e,S);export default g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m from"../utils/baseReducer";import c from"lodash/isEmpty";import{shipmentsFilled as v}from"../utils/shipments";import{saveBillingAddress as y,saveShippingAddress as f,saveToWallet as _}from"../utils/customerOrderOptions";import g from"../utils/getSdk";import h from"../utils/getErrors";export const placeOrderInitialState={errors:[],isPermitted:!1},setPlaceOrderErrors=(d,e)=>{e&&e({type:"setErrors",payload:{errors:d}})},placeOrderPermitted=async({config:d,order:e,dispatch:n,options:r})=>{var t;if(e&&d){let a=!0;e.privacy_url&&e.terms_url&&(a=localStorage.getItem("privacy-terms")==="true");const s=e.billing_address;c(s)&&(a=!1);const i=e.shipping_address;c(i)&&(a=!1);const l=e.shipments,u=l&&v(l);!c(l)&&!u&&(a=!1);const p=e.payment_method,o=e.payment_source;e.total_amount_with_taxes_cents!==0&&c(p==null?void 0:p.id)&&(a=!1),n({type:"setPlaceOrderPermitted",payload:{isPermitted:a,paymentType:p==null?void 0:p.payment_source_type,paymentSecret:o==null?void 0:o.client_secret,paymentId:(t=o==null?void 0:o.options)===null||t===void 0?void 0:t.id,paymentSource:o,options:r}})}},setPlaceOrder=async({state:d,order:e,config:n,setOrderErrors:r,paymentSource:t})=>{const a={placed:!1};try{debugger;if(d&&e&&n&&t){const s=g(n),{options:i,paymentType:l}=d;if(l==="paypal_payments"){if(!(i==null?void 0:i.paypalPayerId)&&(t==null?void 0:t.approval_url))return window.location.href=t==null?void 0:t.approval_url,a;await s.paypal_payments.update({id:t.id,paypal_payer_id:i==null?void 0:i.paypalPayerId})}const u={id:e.id,_place:!0};switch(y()&&await s.orders.update({id:e.id,_save_billing_address_to_customer_address_book:!0}),f()&&await s.orders.update({id:e.id,_save_shipping_address_to_customer_address_book:!0}),l){case"braintree_payments":return _()&&await s.orders.update({id:e.id,_save_payment_source_to_customer_wallet:!0}),await s.orders.update(u),r&&r([]),{placed:!0};default:return _()&&await s.orders.update({id:e.id,_save_payment_source_to_customer_wallet:!0}),await s.orders.update(u),r&&r([]),{placed:!0}}}return a}catch(s){const i=h(s,"orders");return r&&r(i),Object.assign(Object.assign({},a),{errors:i})}};const w=["setErrors","setPlaceOrderPermitted"],b=(d,e)=>m(d,e,w);export default b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from"../utils/getPrices";import f from"../utils/baseReducer";import j from"../utils/getSdk";import m from"../utils/getErrors";export const priceInitialState={loading:!0,prices:{},skuCodes:[],errors:[]},getSkusPrice=(t,{config:o,dispatch:s,setPrices:r,prices:u,perPage:p,filters:g})=>{let e={};const l=j(o);l.prices.list({filters:Object.assign({sku_code_in:t.join(",")},g),pageSize:p}).then(async i=>{const a=d(i);e=Object.assign(Object.assign(Object.assign({},e),u),a),r&&r(e),s({type:"setPrices",payload:{prices:e}}),s({type:"setLoading",payload:{loading:!1}});const c=i.meta;if(c.pageCount>1)for(let n=c.currentPage+1;n<=c.pageCount;n++){const y=await l.prices.list({filters:Object.assign({sku_code_in:t.join(",")},g),pageSize:p,pageNumber:n}),b=d(y);e=Object.assign(Object.assign({},e),b),r&&r(e),s({type:"setPrices",payload:{prices:e}})}}).catch(i=>{const a=m(i,"prices");s({type:"setErrors",payload:{errors:a}})})},unsetPriceState=t=>{t({type:"setPrices",payload:{prices:{}}}),t({type:"setLoading",payload:{loading:!1}})};const O=["setLoading","setPrices","setSkuCodes","setErrors"],S=(t,o)=>f(t,o,O);export default S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import p from"../utils/baseReducer";import n from"../utils/getSdk";export const shipmentInitialState={errors:[]},setShipmentErrors=(e,t)=>{t&&t({type:"setErrors",payload:{errors:e}})},getShipments=async({order:e,dispatch:t,config:i})=>{try{const s=n(i),r=e.shipments,o=await s.delivery_lead_times.list({include:["shipping_method","stock_location"]});t({type:"setShipments",payload:{shipments:r,deliveryLeadTimes:o}})}catch(s){console.error(s)}},setShippingMethod=async({config:e,shipmentId:t,shippingMethodId:i,getOrder:s,order:r})=>{try{if(i){const o=n(e);await o.shipments.update({id:t,shipping_method:o.shipping_methods.relationship(i)}),s&&r&&s(r.id)}}catch(o){console.error(o)}};const c=["setErrors","setShipments","setShippingMethod"],a=(e,t)=>p(e,t,c);export default a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import p from"../utils/baseReducer";import o from"../utils/getSdk";export const shippingAddressInitialState={_shipping_address_clone_id:""},setShippingAddress=async(s,e)=>{try{if(e==null?void 0:e.order){if(e.customerAddressId){const d=o(e.config),r={id:s,reference:e.customerAddressId};await d.addresses.update(r)}e.dispatch({type:"setShippingAddress",payload:{_shipping_address_clone_id:s}})}}catch(d){console.error(d)}},setShippingCustomerAddressId=async({dispatch:s,order:e,setCloneAddress:d})=>{var r;const t=(r=e==null?void 0:e.shipping_address)===null||r===void 0?void 0:r.reference;try{t&&(s({type:"setShippingCustomerAddressId",payload:{shippingCustomerAddressId:t}}),d(t,"shipping_address"))}catch(i){console.error("error",i)}};const c=["setShippingAddress","setShippingCustomerAddressId","cleanup"],n=(s,e)=>p(s,e,c);export default n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"../utils/baseReducer";import k from"../utils/getSdk";const a=["getSkuList","setSkuList"];export const skuListsInitialState={listIds:[]},getSkuList=async({listIds:s,config:t,dispatch:u})=>{const o={};try{const e=k(t);s.forEach(async i=>{const c=(await e.sku_lists.retrieve(i,{include:["skus"],fields:{skus:["code"]}})).skus;o[i]=c}),u({payload:{skuLists:o},type:"getSkuList"})}catch(e){console.error(e)}};const n=(s,t)=>r(s,t,a);export default n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"../utils/baseReducer";export const getSkuOptions=async t=>{const{skuOptions:s,dispatch:o}=t;o({type:"setSkuOptions",payload:{skuOptions:s}})},unsetSkuOptionsState=t=>{t({type:"setSkuOptions",payload:{skuOptions:[]}}),t({type:"setErrors",payload:{errors:[]}})};const p=["setSkuOptions","setErrors"];export const skuOptionsInitialState={skuCode:"",skuOptions:[]};const n=(t,s)=>e(t,s,p);export default n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from"../utils/baseReducer";import p from"../utils/getSkus";import{isEmpty as k,has as y}from"lodash";import c from"../utils/getSdk";export const setVariantSkuCodes=({skuCodes:e,dispatch:t,setCustomLineItems:r})=>{const s={},o=e.map(a=>(y(a,"lineItem")&&(s[a.code]=a.lineItem),a.code));k(s)||r&&r(s),t({type:"setSkuCodes",payload:{skuCodes:o}})},setSkuCode=e=>{const{id:t,code:r,config:s,setItem:o,dispatch:a}=e;t&&c(s).skus.retrieve(t,{include:["sku_options"]}).then(n=>{o&&o({[`${r}`]:n})}).catch(n=>{debugger;a({type:"setErrors",payload:{errors:n}})})},getVariants=e=>{const{config:t,state:r,skuCode:s,dispatch:o,setItem:a,filters:u}=e;c(t).skus.list({filters:Object.assign({code_in:r.skuCodes.join(",")},u)}).then(i=>{const d=p(i,r.skuCodes);s&&setSkuCode({code:d[s].code,id:d[s].id,config:t,dispatch:o,setItem:a}),o({type:"setVariants",payload:{variants:d}}),o({type:"setLoading",payload:{loading:!1}})}).catch(i=>{o({type:"setErrors",payload:{errors:i}})})},unsetVariantState=e=>{e({type:"setSkuCode",payload:{skuCode:""}}),e({type:"setVariants",payload:{variants:{}}}),e({type:"setLoading",payload:{loading:!1}})},variantInitialState={loading:!1,variants:{},skuCodes:[],skuCode:"",errors:[],currentSkuId:"",currentSkuInventory:{available:!1,quantity:0,levels:[]},currentQuantity:1,currentPrices:[]};const f=["setLoading","setVariants","setSkuCodes","setSkuCode","setCurrentSkuId","setCurrentSkuInventory","setCurrentPrices","setErrors"],g=(e,t)=>l(e,t,f);export default g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _ from"prop-types";const I=["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"],BaseErrorObject=_.shape({code:_.oneOf(I).isRequired,message:_.string.isRequired,resource:_.oneOf(REType),field:_.string,id:_.string}),ErrorPropTypes={resource:_.oneOf(["billing_address","gift_cards","line_items","orders","payment_methods","prices","shipping_address","sku_options","variant"]).isRequired,children:_.func,field:_.string};
|
package/lib/esm/typings/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"prop-types";export const BC={id:e.string,className:e.string,style:e.object,name:e.string},PTLoader=e.oneOfType([e.element,e.string]),BaseSelectComponentPropTypes={children:e.func,options:e.arrayOf(e.shape({label:e.string.isRequired,value:e.oneOfType([e.string,e.number]).isRequired,selected:e.bool}).isRequired).isRequired,placeholder:e.shape({label:e.string.isRequired,value:e.oneOfType([e.string,e.number]).isRequired}),value:e.string,name:e.string.isRequired},BaseInputComponentPropTypes={children:e.func,name:e.string.isRequired,type:e.oneOf(["text","email","number","date","checkbox","textarea"]).isRequired,onChange:e.func,placeholder:e.string},BMObject=e.objectOf(e.string),baseOrderPricePropTypes=Object.assign({base:e.string.isRequired,type:e.string.isRequired,children:e.func,format:e.oneOf(["formatted","cents","float"])},BC),baseOrderComponentPricePropTypes=Object.assign({children:baseOrderPricePropTypes.children,format:baseOrderPricePropTypes.format},BC);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isEmpty}from"lodash";import{fieldsExist}from"./validateFormFields";import{addressFields}from"../reducers/AddressReducer";export const billingAddressController=({billing_address:
|
|
1
|
+
import{isEmpty as o}from"lodash";import{fieldsExist as c}from"./validateFormFields";import{addressFields as x}from"../reducers/AddressReducer";export const billingAddressController=({billing_address:t,billingAddressId:r,errors:n,requiresBillingInfo:f})=>{let u=!o(n)||o(t);if(o(n)&&!o(t)){let l=[...x];f&&(l=[...l,"billing_info"]),u=!!(t&&c(t,l))}return u&&!o(r)&&o(t)&&(u=!1),u},shippingAddressController=({billingDisable:t,errors:r,shipToDifferentAddress:n,shipping_address:f,shippingAddressId:u})=>{let l=!!(!t&&n);return l&&o(r)&&!o(f)&&(l=!!(f&&c(f))),l&&!o(u)&&o(f)&&(l=!1),l},countryLockController=({addresses:t,billing_address:r,billingAddressId:n,countryCodeLock:f,shipToDifferentAddress:u,shipping_address:l,shippingAddressId:m})=>{if(f&&!o(t)&&n&&!u){const i=t==null?void 0:t.find(v=>(v.id===n||v.reference===n)&&v.countryCode!==f);if(!o(i))return!0}if(f&&!o(r)&&!u)return(r==null?void 0:r.country_code)!==f;if(f&&!o(l)&&u)return(l==null?void 0:l.country_code)!==f;if(f&&!o(t)&&m&&u){const i=t==null?void 0:t.find(v=>(v.id===m||v.reference===m)&&v.countryCode!==f);if(!o(i))return!0}return!1};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c=(e,n,s)=>{if(s.indexOf(n.type)!==-1){const a=n.payload;e=Object.assign(Object.assign({},e),a)}return e};export default c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function
|
|
1
|
+
export default function a(){const e=window&&window.screen?window.screen.width:"",o=window&&window.screen?window.screen.height:"",w=window&&window.screen?window.screen.colorDepth:"",t=window&&window.navigator?window.navigator.userAgent:"",i=window&&window.navigator?navigator.javaEnabled():!1;let n="";window&&window.navigator&&(n=window.navigator.language);const r=new Date().getTimezoneOffset();return{screenWidth:e,screenHeight:o,colorDepth:w,userAgent:t,timeZoneOffset:r,language:n,javaEnabled:i}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidElement,Children}from"react";import{isEmpty
|
|
1
|
+
import{isValidElement as y,Children as h}from"react";import{isEmpty as $,isFunction as g,has as C,get as m}from"lodash";import E from"../config/components";const u=(r,n,o)=>{let e=null;const i=r[n],s=o.replace("CL","");return($(i)&&typeof i!="function"||typeof i=="function"&&!i)&&r.isRequired&&(e=new Error(`The prop '${n}' is marked as required in '${s}', but its value is '${i}'.`)),h.map(i,c=>{if(e)return e;const t=c.type,l=m(E,`${s}.permittedChildren`),p=`Invalid prop '${n}' supplied to ${s}. Only components ${l.join(", ")} are allowed.`;if(g(t)&&C(t,"displayName")){const a=m(t,"displayName"),d=t.name;a&&a===`${d}`&&(l.includes(d)||(e=new Error(p)))}y(c)||(e=new Error(p))}),e},f=u;f.isRequired=(r,n,o,e,i)=>u(Object.assign(Object.assign({},r),{isRequired:!0}),n,o,e,i);export default f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Countries,States}from"countries-states-cities-service";export function getCountries(){return
|
|
1
|
+
import{Countries as n,States as a}from"countries-states-cities-service";export function getCountries(){return n.getCountries({sort:{mode:"alphabetical",key:"name"}}).map(({name:e,iso2:t})=>({label:e,value:t}))}export function getStateOfCountry(e){const t={country_code:e};return e==="IT"&&(t.is_region=!1),a.getStates({filters:t,sort:{mode:"alphabetical",key:"name"}}).map(({name:r,state_code:i})=>({label:r.replace("Province of",""),value:i}))}export function isValidState(e,t){return a.getStates({filters:{state_code:e,country_code:t}}).length>0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"lodash/findIndex";import i from"lodash/pick";const n=(o=[],e)=>{const d=r(o,i(e,["field","code","resource"]));return d!==-1?o[d]:null};export default n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getSaveBillingAddressToAddressBook,getSavePaymentSourceToCustomerWallet,getSaveShippingAddressToAddressBook}from"./localStorage";export function saveToWallet(){return
|
|
1
|
+
import{getSaveBillingAddressToAddressBook as e,getSavePaymentSourceToCustomerWallet as o,getSaveShippingAddressToAddressBook as r}from"./localStorage";export function saveToWallet(){return o()}export function saveBillingAddress(){return e()}export function saveShippingAddress(){return r()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{keys}from"lodash";export default function
|
|
1
|
+
import{keys as y}from"lodash";export default function i(a){const{format:s,type:r,obj:e,base:$}=a;let o;return y(e).map(t=>{const n=t.toLowerCase(),f=`${s}_${r}_${$}`.toLowerCase(),p=`${r}_${$}_${s}`.toLowerCase(),_=`${s}_${$}_${r}`.toLowerCase(),c=`${$}_${r}_${s}`.toLowerCase();n===f&&(o=e[t]),n===p&&(o=e[t]),n===_&&(o=e[t]),n===c&&(o=e[t])}),o}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{first,keys}from"lodash";const
|
|
1
|
+
import{first as e,keys as r}from"lodash";const o=t=>e(r(t))||"";export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from"lodash/differenceBy";export default function d(e,o){return e.errors.map(t=>Object.assign(Object.assign({},t),{resource:o}))}export function setErrors({currentErrors:e=[],newErrors:o=[],dispatch:t,filterBy:r="code"}){const f=i(e,o,r),s=(e==null?void 0:e.length)===0?o:f,n=[...e||[],...s];if(!t)return n;t({type:"setErrors",payload:{errors:n}})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i=(s,e=0)=>{const n=["skus","gift_cards","bundles","adjustments"];return s.filter(t=>t.item_type&&n.includes(t.item_type)).forEach(t=>{t.quantity&&(e+=t.quantity)}),e};export default i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,Fragment as e}from"react/jsx-runtime";export default function o(t){return typeof t=="function"?n(t,{},void 0):n(e,{children:t},void 0)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as
|
|
1
|
+
import{createElement as s}from"react";import{jsx as i}from"react/jsx-runtime";import{isEmpty as c,first as a,isArray as u,has as f}from"lodash";import m from"../components/utils/PriceTemplate";export const getPriceByCode=(o,e="")=>e?a(o.filter(t=>t.currency_code===e)):a(o),getPricesComponent=(o,e)=>c(o)?i(m,Object.assign({},e),void 0):o.map((t,r)=>{const n=typeof e.showCompare=="undefined"&&(t==null?void 0:t.compare_at_amount_cents)>(t==null?void 0:t.amount_cents)||e.showCompare;return s(m,Object.assign({},e,{key:r,showCompare:n,formattedAmount:t.formatted_amount,formattedCompare:t.formatted_compare_at_amount}))});export default function d(o){const e={};return u(o)&&o.forEach(t=>{const r=t.sku_code;f(e,r)?e[r].push(t):e[r]=[t]}),e}
|
package/lib/esm/utils/getSdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./organization";import n from"@commercelayer/sdk";export default function i({endpoint:o,accessToken:r}){const t=e(o);return n(Object.assign({accessToken:r},t))}
|
package/lib/esm/utils/getSkus.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const r=(o,t)=>{const e={};return t.forEach(d=>{o.forEach(c=>{(c==null?void 0:c.code)===d&&(e[c.code]=c)})}),e};export default r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n=["IT","US"];export default function c(t){return!n.includes(t)}
|
package/lib/esm/utils/isJSON.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function
|
|
1
|
+
export default function r(e){try{return JSON.parse(e),!0}catch{return!1}}
|
package/lib/esm/utils/jwt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"jwt-decode";export default function o(t){return e(t)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const getLocalOrder=e=>localStorage.getItem(e)
|
|
1
|
+
export const getLocalOrder=e=>localStorage.getItem(e),setLocalOrder=(e,t)=>localStorage.setItem(e,t),deleteLocalOrder=e=>{localStorage.removeItem(e)},getSavePaymentSourceToCustomerWallet=()=>localStorage.getItem("_save_payment_source_to_customer_wallet")==="true",getSaveBillingAddressToAddressBook=()=>localStorage.getItem("_save_billing_address_to_customer_address_book")==="true",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 a(o){const e={organization:"",domain:"commercelayer.io"};return o.search("commercelayer.io")===-1&&(e.domain="commercelayer.co"),e.organization=o.replace("https://","").replace(`.${e.domain}`,""),e}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getPaymentConfig}from"../reducers/PaymentMethodReducer";import
|
|
1
|
+
import{getPaymentConfig as o}from"../reducers/PaymentMethodReducer";import n from"lodash/pick";export default function u(e,r){const t=o(e,r);return t&&n(t,["return_url","cancel_url"])}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from"lodash/isFunction";export default function l(i,u){return new Promise((f,t)=>{u?i(u,(o,n)=>{o&&t(o),f(n)}):d(i==null?void 0:i.tokenize)?i==null||i.tokenize((o,n)=>{o&&t(o),f(n)}):i((o,n)=>{o&&t(o),f(n)})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import p from"lodash/compact";import t from"lodash/isEmpty";export function shipmentsFilled(o){const i=p(o.filter(m=>!t(m.shipping_method)));return!t(i)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"lodash/isEmpty";import f from"lodash/isString";import m from"lodash/without";import c from"lodash/keys";import g from"lodash/map";import p from"lodash/get";import{addressFields as h}from"../reducers/AddressReducer";const O=/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$/;export const validateValue=(s,a,i,r)=>s?i==="email"&&f(s)&&!s.match(O)?{field:a,code:"VALIDATION_ERROR",message:`${a} - is not valid`,resourceType:r}:{}:{field:a,code:"VALIDATION_ERROR",message:`${a} - is required`,resourceType:r};const b=(s,a,i)=>{const r=[];let e={metadata:{}};return g(s,t=>{const d=!!p(t,"checked"),n=d||(t.value==="on"?!1:t.value),l=t.getAttribute("name");if(l&&a.indexOf(l)!==-1||t.required){const o=validateValue(n,t.name,t.type,i);u(o)||r.push(o),e=Object.assign(Object.assign({},e),{[`${t.name}`]:n})}t.getAttribute("name")&&(e=!!t.getAttribute("data-metadata")?Object.assign(Object.assign({},e),{metadata:Object.assign(Object.assign({},e.metadata),{[`${t.name}`]:n})}):Object.assign(Object.assign({},e),{[`${t.name}`]:n}))}),{errors:r,values:e}};export const fieldsExist=(s,a=h)=>{if(s.business){const i=m(a,"first_name","last_name"),r=c(s).filter(e=>i.includes(e));return i.length>r.length}else{const i=m(a,"line_2","company"),r=c(s).filter(e=>i.includes(e));return i.length>r.length}};export default b;
|