@commercelayer/react-components 4.17.0-beta.2 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/cjs/components/ExternalFunction.d.ts +1 -1
- package/lib/cjs/components/MetadataInput.d.ts +1 -0
- package/lib/cjs/components/SubmitButton.d.ts +2 -2
- package/lib/cjs/components/addresses/Address.d.ts +1 -0
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +1 -0
- package/lib/cjs/components/addresses/AddressField.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressInput.d.ts +1 -0
- package/lib/cjs/components/addresses/AddressInputSelect.d.ts +1 -0
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +1 -0
- package/lib/cjs/components/addresses/AddressesContainer.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressesEmpty.d.ts +1 -0
- package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +1 -1
- package/lib/cjs/components/addresses/BillingAddressForm.d.ts +1 -1
- package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +1 -1
- package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +1 -0
- package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +1 -1
- package/lib/cjs/components/auth/CommerceLayer.d.ts +1 -0
- package/lib/cjs/components/customers/CustomerAddressForm.d.ts +1 -1
- package/lib/cjs/components/customers/CustomerContainer.d.ts +1 -0
- package/lib/cjs/components/customers/CustomerField.d.ts +1 -0
- package/lib/cjs/components/customers/CustomerInput.d.ts +1 -0
- package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +1 -0
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +1 -0
- package/lib/cjs/components/customers/MyAccountLink.d.ts +1 -0
- package/lib/cjs/components/customers/MyAccountLink.js +1 -1
- package/lib/cjs/components/customers/MyIdentityLink.d.ts +1 -0
- package/lib/cjs/components/customers/MyIdentityLink.js +1 -1
- package/lib/cjs/components/customers/SaveCustomerButton.d.ts +1 -1
- package/lib/cjs/components/errors/Errors.d.ts +1 -0
- package/lib/cjs/components/gift_cards/GiftCard.d.ts +3 -1
- package/lib/cjs/components/gift_cards/GiftCard.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -0
- package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +1 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +1 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +1 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +1 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +1 -1
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +1 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItem.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemAmount.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemCode.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemField.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemImage.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemName.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemOption.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemOptions.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemQuantity.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemsContainer.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemsCount.d.ts +1 -0
- package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +1 -0
- package/lib/cjs/components/orders/AddToCartButton.d.ts +1 -1
- package/lib/cjs/components/orders/AddToCartButton.js +1 -1
- package/lib/cjs/components/orders/AdjustmentAmount.d.ts +1 -0
- package/lib/cjs/components/orders/CartLink.d.ts +1 -1
- package/lib/cjs/components/orders/CartLink.js +1 -1
- package/lib/cjs/components/orders/CheckoutLink.d.ts +1 -0
- package/lib/cjs/components/orders/CheckoutLink.js +1 -1
- package/lib/cjs/components/orders/DiscountAmount.d.ts +1 -0
- package/lib/cjs/components/orders/GiftCardAmount.d.ts +1 -0
- package/lib/cjs/components/orders/HostedCart.d.ts +1 -1
- package/lib/cjs/components/orders/HostedCart.js +1 -1
- package/lib/cjs/components/orders/OrderContainer.d.ts +1 -0
- package/lib/cjs/components/orders/OrderList.d.ts +1 -0
- package/lib/cjs/components/orders/OrderListEmpty.d.ts +1 -0
- package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +1 -0
- package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +1 -0
- package/lib/cjs/components/orders/OrderListRow.d.ts +1 -0
- package/lib/cjs/components/orders/OrderNumber.d.ts +1 -0
- package/lib/cjs/components/orders/OrderStorage.d.ts +1 -1
- package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +1 -0
- package/lib/cjs/components/orders/PlaceOrderButton.d.ts +1 -1
- package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +1 -1
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +1 -0
- package/lib/cjs/components/orders/ShippingAmount.d.ts +1 -0
- package/lib/cjs/components/orders/SubTotalAmount.d.ts +1 -0
- package/lib/cjs/components/orders/TaxesAmount.d.ts +1 -0
- package/lib/cjs/components/orders/TotalAmount.d.ts +1 -0
- package/lib/cjs/components/parcels/ParcelField.d.ts +1 -0
- package/lib/cjs/components/parcels/ParcelLineItem.d.ts +1 -0
- package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +1 -0
- package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +1 -0
- package/lib/cjs/components/parcels/Parcels.d.ts +1 -0
- package/lib/cjs/components/parcels/ParcelsCount.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +1 -0
- package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +1 -0
- package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +1 -0
- package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +1 -0
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +1 -0
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.d.ts +1 -1
- package/lib/cjs/components/payment_source/AdyenPayment.d.ts +1 -1
- package/lib/cjs/components/payment_source/BraintreePayment.d.ts +1 -0
- package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +1 -0
- package/lib/cjs/components/payment_source/ExternalPayment.d.ts +1 -0
- package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +1 -0
- package/lib/cjs/components/payment_source/PaymentSource.d.ts +1 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +1 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +1 -0
- package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +1 -0
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
- package/lib/cjs/components/payment_source/PaypalPayment.d.ts +1 -1
- package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +1 -0
- package/lib/cjs/components/payment_source/StripePayment.d.ts +2 -1
- package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +1 -0
- package/lib/cjs/components/prices/Price.d.ts +2 -1
- package/lib/cjs/components/prices/PricesContainer.d.ts +1 -0
- package/lib/cjs/components/shipments/Shipment.d.ts +1 -1
- package/lib/cjs/components/shipments/ShipmentField.d.ts +2 -1
- package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +1 -1
- package/lib/cjs/components/shipments/ShipmentsCount.d.ts +2 -1
- package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +2 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +1 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +2 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
- package/lib/cjs/components/skus/AvailabilityContainer.d.ts +1 -1
- package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +2 -1
- package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +3 -2
- package/lib/cjs/components/skus/SkuField.d.ts +1 -0
- package/lib/cjs/components/skus/SkuList.d.ts +1 -1
- package/lib/cjs/components/skus/SkuListsContainer.d.ts +1 -1
- package/lib/cjs/components/skus/Skus.d.ts +1 -1
- package/lib/cjs/components/skus/SkusContainer.d.ts +1 -1
- package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +1 -0
- package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +1 -0
- package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +1 -0
- package/lib/cjs/components/utils/BaseField.d.ts +2 -2
- package/lib/cjs/components/utils/BaseInput.d.ts +1 -1
- package/lib/cjs/components/utils/BaseOrderPrice.d.ts +2 -1
- package/lib/cjs/components/utils/ErrorBoundary.d.ts +1 -1
- package/lib/cjs/components/utils/GenericFieldComponent.d.ts +1 -1
- package/lib/cjs/components/utils/Parent.d.ts +1 -1
- package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +1 -0
- package/lib/cjs/components/utils/PriceTemplate.d.ts +1 -0
- package/lib/cjs/components/utils/getAllErrors.d.ts +2 -1
- package/lib/cjs/context/OrderListChildrenContext.d.ts +1 -0
- package/lib/cjs/context/PlaceOrderContext.d.ts +1 -1
- package/lib/cjs/reducers/OrderReducer.js +1 -1
- package/lib/cjs/reducers/PlaceOrderReducer.d.ts +2 -2
- package/lib/cjs/typings/globals.d.ts +1 -0
- package/lib/cjs/typings/index.d.ts +2 -2
- package/lib/cjs/utils/filterChildren.d.ts +1 -0
- package/lib/cjs/utils/getLoaderComponent.d.ts +1 -0
- package/lib/cjs/utils/getPrices.d.ts +1 -0
- package/lib/cjs/utils/organization.js +1 -1
- package/lib/esm/components/ExternalFunction.d.ts +1 -1
- package/lib/esm/components/MetadataInput.d.ts +1 -0
- package/lib/esm/components/SubmitButton.d.ts +2 -2
- package/lib/esm/components/addresses/Address.d.ts +1 -0
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +1 -0
- package/lib/esm/components/addresses/AddressField.d.ts +1 -1
- package/lib/esm/components/addresses/AddressInput.d.ts +1 -0
- package/lib/esm/components/addresses/AddressInputSelect.d.ts +1 -0
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +1 -0
- package/lib/esm/components/addresses/AddressesContainer.d.ts +1 -1
- package/lib/esm/components/addresses/AddressesEmpty.d.ts +1 -0
- package/lib/esm/components/addresses/BillingAddressContainer.d.ts +1 -1
- package/lib/esm/components/addresses/BillingAddressForm.d.ts +1 -1
- package/lib/esm/components/addresses/SaveAddressesButton.d.ts +1 -1
- package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +1 -0
- package/lib/esm/components/addresses/ShippingAddressForm.d.ts +1 -1
- package/lib/esm/components/auth/CommerceLayer.d.ts +1 -0
- package/lib/esm/components/customers/CustomerAddressForm.d.ts +1 -1
- package/lib/esm/components/customers/CustomerContainer.d.ts +1 -0
- package/lib/esm/components/customers/CustomerField.d.ts +1 -0
- package/lib/esm/components/customers/CustomerInput.d.ts +1 -0
- package/lib/esm/components/customers/CustomerPaymentSource.d.ts +1 -0
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +1 -0
- package/lib/esm/components/customers/MyAccountLink.d.ts +1 -0
- package/lib/esm/components/customers/MyAccountLink.js +1 -1
- package/lib/esm/components/customers/MyIdentityLink.d.ts +1 -0
- package/lib/esm/components/customers/MyIdentityLink.js +1 -1
- package/lib/esm/components/customers/SaveCustomerButton.d.ts +1 -1
- package/lib/esm/components/errors/Errors.d.ts +1 -0
- package/lib/esm/components/gift_cards/GiftCard.d.ts +3 -1
- package/lib/esm/components/gift_cards/GiftCard.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -0
- package/lib/esm/components/gift_cards/GiftCardInput.d.ts +1 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +1 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +1 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +1 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +1 -1
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +1 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +1 -0
- package/lib/esm/components/line_items/LineItem.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemAmount.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemCode.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemField.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemImage.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemName.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemOption.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemOptions.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemsContainer.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemsCount.d.ts +1 -0
- package/lib/esm/components/line_items/LineItemsEmpty.d.ts +1 -0
- package/lib/esm/components/orders/AddToCartButton.d.ts +1 -1
- package/lib/esm/components/orders/AddToCartButton.js +1 -1
- package/lib/esm/components/orders/AdjustmentAmount.d.ts +1 -0
- package/lib/esm/components/orders/CartLink.d.ts +1 -1
- package/lib/esm/components/orders/CartLink.js +1 -1
- package/lib/esm/components/orders/CheckoutLink.d.ts +1 -0
- package/lib/esm/components/orders/CheckoutLink.js +1 -1
- package/lib/esm/components/orders/DiscountAmount.d.ts +1 -0
- package/lib/esm/components/orders/GiftCardAmount.d.ts +1 -0
- package/lib/esm/components/orders/HostedCart.d.ts +1 -1
- package/lib/esm/components/orders/HostedCart.js +1 -1
- package/lib/esm/components/orders/OrderContainer.d.ts +1 -0
- package/lib/esm/components/orders/OrderList.d.ts +1 -0
- package/lib/esm/components/orders/OrderListEmpty.d.ts +1 -0
- package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +1 -0
- package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +1 -0
- package/lib/esm/components/orders/OrderListRow.d.ts +1 -0
- package/lib/esm/components/orders/OrderNumber.d.ts +1 -0
- package/lib/esm/components/orders/OrderStorage.d.ts +1 -1
- package/lib/esm/components/orders/PaymentMethodAmount.d.ts +1 -0
- package/lib/esm/components/orders/PlaceOrderButton.d.ts +1 -1
- package/lib/esm/components/orders/PlaceOrderContainer.d.ts +1 -1
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +1 -0
- package/lib/esm/components/orders/ShippingAmount.d.ts +1 -0
- package/lib/esm/components/orders/SubTotalAmount.d.ts +1 -0
- package/lib/esm/components/orders/TaxesAmount.d.ts +1 -0
- package/lib/esm/components/orders/TotalAmount.d.ts +1 -0
- package/lib/esm/components/parcels/ParcelField.d.ts +1 -0
- package/lib/esm/components/parcels/ParcelLineItem.d.ts +1 -0
- package/lib/esm/components/parcels/ParcelLineItemField.d.ts +1 -0
- package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +1 -0
- package/lib/esm/components/parcels/Parcels.d.ts +1 -0
- package/lib/esm/components/parcels/ParcelsCount.d.ts +1 -0
- package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +1 -0
- package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +1 -0
- package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +1 -0
- package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +1 -0
- package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +1 -0
- package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +1 -0
- package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +1 -0
- package/lib/esm/components/payment_gateways/StripeGateway.d.ts +1 -0
- package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +1 -0
- package/lib/esm/components/payment_methods/PaymentMethod.d.ts +1 -0
- package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +1 -0
- package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +1 -0
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.d.ts +1 -1
- package/lib/esm/components/payment_source/AdyenPayment.d.ts +1 -1
- package/lib/esm/components/payment_source/BraintreePayment.d.ts +1 -0
- package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +1 -0
- package/lib/esm/components/payment_source/ExternalPayment.d.ts +1 -0
- package/lib/esm/components/payment_source/KlarnaPayment.d.ts +1 -0
- package/lib/esm/components/payment_source/PaymentSource.d.ts +1 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +1 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +1 -0
- package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +1 -0
- package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
- package/lib/esm/components/payment_source/PaypalPayment.d.ts +1 -1
- package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +1 -0
- package/lib/esm/components/payment_source/StripePayment.d.ts +2 -1
- package/lib/esm/components/payment_source/WireTransferPayment.d.ts +1 -0
- package/lib/esm/components/prices/Price.d.ts +2 -1
- package/lib/esm/components/prices/PricesContainer.d.ts +1 -0
- package/lib/esm/components/shipments/Shipment.d.ts +1 -1
- package/lib/esm/components/shipments/ShipmentField.d.ts +2 -1
- package/lib/esm/components/shipments/ShipmentsContainer.d.ts +1 -1
- package/lib/esm/components/shipments/ShipmentsCount.d.ts +2 -1
- package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +2 -1
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +1 -0
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +2 -1
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
- package/lib/esm/components/skus/AvailabilityContainer.d.ts +1 -1
- package/lib/esm/components/skus/AvailabilityTemplate.d.ts +2 -1
- package/lib/esm/components/skus/DeliveryLeadTime.d.ts +3 -2
- package/lib/esm/components/skus/SkuField.d.ts +1 -0
- package/lib/esm/components/skus/SkuList.d.ts +1 -1
- package/lib/esm/components/skus/SkuListsContainer.d.ts +1 -1
- package/lib/esm/components/skus/Skus.d.ts +1 -1
- package/lib/esm/components/skus/SkusContainer.d.ts +1 -1
- package/lib/esm/components/stock_transfers/StockTransfer.d.ts +1 -0
- package/lib/esm/components/stock_transfers/StockTransferField.d.ts +1 -0
- package/lib/esm/components/utils/AddressCardsTemplate.d.ts +1 -0
- package/lib/esm/components/utils/BaseField.d.ts +2 -2
- package/lib/esm/components/utils/BaseInput.d.ts +1 -1
- package/lib/esm/components/utils/BaseOrderPrice.d.ts +2 -1
- package/lib/esm/components/utils/ErrorBoundary.d.ts +1 -1
- package/lib/esm/components/utils/GenericFieldComponent.d.ts +1 -1
- package/lib/esm/components/utils/Parent.d.ts +1 -1
- package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +1 -0
- package/lib/esm/components/utils/PriceTemplate.d.ts +1 -0
- package/lib/esm/components/utils/getAllErrors.d.ts +2 -1
- package/lib/esm/context/OrderListChildrenContext.d.ts +1 -0
- package/lib/esm/context/PlaceOrderContext.d.ts +1 -1
- package/lib/esm/reducers/OrderReducer.js +1 -1
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +2 -2
- package/lib/esm/typings/globals.d.ts +1 -0
- package/lib/esm/typings/index.d.ts +2 -2
- package/lib/esm/utils/filterChildren.d.ts +1 -0
- package/lib/esm/utils/getLoaderComponent.d.ts +1 -0
- package/lib/esm/utils/getPrices.d.ts +1 -0
- package/lib/esm/utils/organization.js +1 -1
- package/package.json +27 -27
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ConditionalElement } from '../../typings/index';
|
|
2
2
|
import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
|
|
3
|
+
import type { JSX } from "react";
|
|
3
4
|
type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['StockTransfer']>;
|
|
4
5
|
type TCondition = ConditionalElement<Exclude<TResources['StockTransfer'], 'resource'>>;
|
|
5
6
|
type Props = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type FunctionComponent } from 'react';
|
|
1
|
+
import { type FunctionComponent, type JSX } from 'react';
|
|
2
2
|
type BaseFieldChildren = Omit<BaseFieldProps, 'children'>;
|
|
3
|
-
export interface BaseFieldProps extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
3
|
+
export interface BaseFieldProps extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
|
|
4
4
|
attribute: 'number' | 'id';
|
|
5
5
|
children?: (props: BaseFieldChildren) => JSX.Element;
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type JSX } from 'react';
|
|
2
2
|
import { type BaseInputComponentProps } from '../../typings/index';
|
|
3
3
|
export type BaseInputProps = BaseInputComponentProps & Omit<JSX.IntrinsicElements['input'], 'children' | 'pattern'> & Omit<JSX.IntrinsicElements['textarea'], 'children' | 'pattern'>;
|
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<Omit<BaseInputProps, "ref"> & React.RefAttributes<any>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
1
2
|
import { type PropsType } from '../../utils/PropsType';
|
|
2
3
|
import { type baseOrderPricePropTypes } from '../../typings/index';
|
|
3
|
-
export type BaseOrderPriceProps = PropsType<typeof baseOrderPricePropTypes, unknown> & Omit<JSX.IntrinsicElements['span'], 'children'>;
|
|
4
|
+
export type BaseOrderPriceProps = PropsType<typeof baseOrderPricePropTypes, unknown> & Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'>;
|
|
4
5
|
export declare function BaseOrderPrice(props: BaseOrderPriceProps): JSX.Element;
|
|
5
6
|
export default BaseOrderPrice;
|
|
@@ -2,7 +2,7 @@ import { type InitialSkuContext } from '../../context/SkuChildrenContext';
|
|
|
2
2
|
import { type InitialStockTransferContext } from '../../context/StockTransferChildrenContext';
|
|
3
3
|
import type { Customer, LineItem, Sku, Parcel, ParcelLineItem } from '@commercelayer/sdk';
|
|
4
4
|
import { type InitialLineItemChildrenContext } from '../../context/LineItemChildrenContext';
|
|
5
|
-
import { type Context } from 'react';
|
|
5
|
+
import { type Context, type JSX } from 'react';
|
|
6
6
|
import { type InitialCustomerContext } from '../../context/CustomerContext';
|
|
7
7
|
import { type InitialParcelContext } from '../../context/ParcelChildrenContext';
|
|
8
8
|
import { type InitialParcelLineItemContext } from '../../context/ParcelLineItemChildrenContext';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type LineItem } from '@commercelayer/sdk';
|
|
2
2
|
import { type BaseError } from '../../typings/errors';
|
|
3
3
|
import { type TResourceError } from '../errors/Errors';
|
|
4
|
+
import type { JSX } from "react";
|
|
4
5
|
export interface AllErrorsParams {
|
|
5
6
|
allErrors: BaseError[];
|
|
6
7
|
messages: BaseError[];
|
|
7
8
|
field?: string;
|
|
8
|
-
props: JSX.IntrinsicElements['span']
|
|
9
|
+
props: Omit<JSX.IntrinsicElements['span'], 'ref'>;
|
|
9
10
|
lineItem?: LineItem | null;
|
|
10
11
|
resource?: TResourceError;
|
|
11
12
|
returnHtml?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Order, OrderSubscription } from '@commercelayer/sdk';
|
|
2
2
|
import { type Row } from '@tanstack/react-table';
|
|
3
|
+
import { type JSX } from 'react';
|
|
3
4
|
export type TOrderList = 'orders' | 'subscriptions';
|
|
4
5
|
export type TableAccessor<T extends TOrderList> = T extends 'orders' ? keyof Order : keyof OrderSubscription;
|
|
5
6
|
export type OrderListContent<T extends TOrderList> = T extends 'orders' ? Order : OrderSubscription;
|
|
@@ -4,7 +4,7 @@ type DefaultContext = {
|
|
|
4
4
|
setPlaceOrderErrors?: typeof setPlaceOrderErrors;
|
|
5
5
|
setPlaceOrder?: typeof setPlaceOrder;
|
|
6
6
|
placeOrderPermitted?: () => void;
|
|
7
|
-
setButtonRef?: (ref: RefObject<HTMLButtonElement>) => void;
|
|
7
|
+
setButtonRef?: (ref: RefObject<HTMLButtonElement | null>) => void;
|
|
8
8
|
setPlaceOrderStatus?: typeof setPlaceOrderStatus;
|
|
9
9
|
} & PlaceOrderState;
|
|
10
10
|
export declare const defaultPlaceOrderContext: DefaultContext;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{setCustomerOrderParam}from"../utils/localStorage";import baseReducer from"../utils/baseReducer";import isEmpty from"lodash/isEmpty";import getSdk from"../utils/getSdk";import getErrors,{setErrors}from"../utils/getErrors";import{getOrganizationConfig}from"../utils/organization";import{publish}from"../utils/events";import{getDomain}from"../utils/getDomain";import{getApplicationLink}from"../utils/getApplicationLink";const actionType=["setLoading","setOrderId","setOrder","setSingleQuantity","setCurrentSkuCodes","setCurrentSkuPrices","setErrors","setCurrentItem","setSaveAddressToCustomerAddressBook","setIncludesResource"];export async function createOrder(params){if(params){const{persistKey,state,dispatch,config,orderMetadata:metadata,orderAttributes={},setLocalOrder}=params;if(state?.orderId)return state.orderId;const sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return"";const o=await sdk?.orders.create({metadata,...orderAttributes});return dispatch&&dispatch({type:"setOrderId",payload:{orderId:o?.id}}),persistKey&&setLocalOrder&&setLocalOrder(persistKey,o.id),o.id}catch(error){const errors=getErrors({error,resource:"orders"});console.error("Create order",errors),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors,dispatch})}}return""}export const getApiOrder=async params=>{const{id,dispatch,config,clearWhenPlaced,persistKey,deleteLocalOrder,state}=params,sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return;const options={};state?.include&&state.include.length>0&&(options.include=state.include);const order=await sdk.orders.retrieve(id??"",options);return clearWhenPlaced&&order.editable===!1?(persistKey&&deleteLocalOrder&&deleteLocalOrder(persistKey),dispatch&&dispatch({type:"setOrder",payload:{order:void 0,orderId:""}})):dispatch&&dispatch({type:"setOrder",payload:{order,orderId:order.id}}),order}catch(error){const errors=getErrors({error,resource:"orders"});console.error("Retrieve order",errors),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors,dispatch});return}};export async function updateOrder({id,attributes,dispatch,config,include,state}){const sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return{success:!1};const resource={...attributes,id};await sdk.orders.update(resource,{include});const order=await getApiOrder({id,config,dispatch,state});return dispatch&&order&&dispatch({type:"setOrder",payload:{order}}),{success:!0,order}}catch(error){const errors=getErrors({error,resource:"orders"});return dispatch&&(setOrderErrors({errors,dispatch}),dispatch({type:"setErrors",payload:{errors}})),{success:!1,error}}}export const setOrder=(order,dispatch)=>{dispatch&&dispatch({type:"setOrder",payload:{order}})};export function addResourceToInclude({resourcesIncluded=[],dispatch,newResource,newResourceLoaded,resourceIncludedLoaded}){const payload={include:void 0,includeLoaded:void 0};if(newResource){const resources=typeof newResource=="string"?[newResource]:newResource;payload.include=[...new Set([...resourcesIncluded,...resources])],resources.forEach(resource=>{const includeLoaded={...payload.includeLoaded,[resource]:!0};payload.includeLoaded=includeLoaded})}else delete payload.include;const payloadIncludeLoaded={...resourceIncludedLoaded,...newResourceLoaded,...payload.includeLoaded&&payload.includeLoaded};payload.includeLoaded=payloadIncludeLoaded,dispatch&&dispatch({type:"setIncludesResource",payload:{...payload,withoutIncludes:!1}})}export async function addToCart(params){const{skuCode,bundleCode,quantity,config,dispatch,lineItem,state,errors=[],buyNowMode,checkoutUrl,lineItemOption,openMiniCart=!0}=params;try{if(config){const sdk=getSdk(config),id=await createOrder(params);if(id){const order=sdk.orders.relationship(id),name=lineItem?.name,imageUrl=lineItem?.imageUrl,metadata=lineItem?.metadata,frequency=lineItem?.frequency,externalPrice=lineItem?.externalPrice;if(buyNowMode)if(state?.order?.line_items)await Promise.all(state?.order?.line_items.map(async lineItem2=>{await sdk.line_items.delete(lineItem2.id)}));else{const{line_items:lineItems}=await sdk.orders.retrieve(id,{fields:["line_items"],include:["line_items"]});lineItems&&lineItems?.length>0&&await Promise.all(lineItems.map(async lineItem2=>{await sdk.line_items.delete(lineItem2.id)}))}const attrs={order,sku_code:skuCode,name,image_url:imageUrl,quantity:quantity??1,_update_quantity:lineItem?._update_quantity??!0,bundle_code:bundleCode,metadata,frequency};externalPrice===!0&&(attrs._external_price=externalPrice);const newLineItem=await sdk.line_items.create(attrs);if(lineItemOption!=null){const{skuOptionId,options,quantity:quantity2}=lineItemOption,skuOption=sdk.sku_options.relationship(skuOptionId),lineItemRel=sdk.line_items.relationship(newLineItem.id),lineItemOptionsAttributes={quantity:quantity2??1,options,sku_option:skuOption,line_item:lineItemRel};await sdk.line_item_options.create(lineItemOptionsAttributes),await getApiOrder({id,...params})}else await getApiOrder({id,...params,state});if(!isEmpty(errors)&&dispatch&&dispatch({type:"setErrors",payload:{errors:[]}}),buyNowMode&&id&&config?.accessToken!=null&&config?.endpoint!=null){const params2=`${id}?accessToken=${config.accessToken??""}`,{domain,slug}=getDomain(config.endpoint),href=getApplicationLink({slug,orderId:id,accessToken:config.accessToken,applicationType:"checkout",domain}),organizationConfig=await getOrganizationConfig({accessToken:config.accessToken,endpoint:config.endpoint,params:{accessToken:config.accessToken,orderId:order?.id}}),redirectUrl=checkoutUrl?`${checkoutUrl}/${params2}`:organizationConfig?.links?.checkout??href;location.href=redirectUrl}else openMiniCart&&publish("open-cart");return{success:!0,orderId:id}}}return{success:!1}}catch(error){const errors2=getErrors({error,resource:"orders"});return console.error("Add to cart",errors2),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors2,dispatch}),{success:!1}}}export const unsetOrderState=dispatch=>{dispatch({type:"setOrderId",payload:{orderId:""}}),dispatch({type:"setOrder",payload:{order:void 0}})};export function setOrderErrors({dispatch,errors=[]}){return dispatch&&dispatch({type:"setErrors",payload:{errors}}),{success:!1}}export const saveAddressToCustomerAddressBook=({type,value,dispatch})=>{const k=`_save_${type}_to_customer_address_book`,v=`${value.toString()}`;setCustomerOrderParam(k,v),dispatch&&dispatch({type:"setSaveAddressToCustomerAddressBook",payload:{[k]:v}})};export async function setGiftCardOrCouponCode({code,codeType,dispatch,config,order,include,state}){try{if(config&&order&&code&&dispatch){const attributes={[codeType]:code},{success,order:currentOrder,error}=await updateOrder({id:order.id,attributes,config,include,dispatch,state});if(!success)throw error;return dispatch({type:"setErrors",payload:{errors:[]}}),{success,order:currentOrder}}return{success:!1}}catch(error){const errors=getErrors({error,resource:"orders",field:codeType});return dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}}export async function removeGiftCardOrCouponCode({codeType,dispatch,config,order,include,state}){try{if(config&&order&&dispatch){const attributes={[codeType]:""},orderUpdated=await updateOrder({id:order.id,attributes,config,include,dispatch,state});return dispatch({type:"setErrors",payload:{errors:[]}}),{success:!0,order:orderUpdated?.order}}return{success:!1}}catch(error){const errors=getErrors({error,resource:"orders",field:codeType});return console.error("Remove gift card o coupon code",errors),dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}}export const orderInitialState={loading:!0,orderId:"",order:void 0,errors:[],include:void 0,withoutIncludes:!0};const orderReducer=(state,reducer)=>baseReducer(state,reducer,actionType);export default orderReducer;
|
|
2
|
+
import{setCustomerOrderParam}from"../utils/localStorage";import baseReducer from"../utils/baseReducer";import isEmpty from"lodash/isEmpty";import getSdk from"../utils/getSdk";import getErrors,{setErrors}from"../utils/getErrors";import{getOrganizationConfig}from"../utils/organization";import{publish}from"../utils/events";import{getDomain}from"../utils/getDomain";import{getApplicationLink}from"../utils/getApplicationLink";const actionType=["setLoading","setOrderId","setOrder","setSingleQuantity","setCurrentSkuCodes","setCurrentSkuPrices","setErrors","setCurrentItem","setSaveAddressToCustomerAddressBook","setIncludesResource"];export async function createOrder(params){if(params){const{persistKey,state,dispatch,config,orderMetadata:metadata,orderAttributes={},setLocalOrder}=params;if(state?.orderId)return state.orderId;const sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return"";const o=await sdk?.orders.create({metadata,...orderAttributes});return dispatch&&dispatch({type:"setOrderId",payload:{orderId:o?.id}}),persistKey&&setLocalOrder&&setLocalOrder(persistKey,o.id),o.id}catch(error){const errors=getErrors({error,resource:"orders"});console.error("Create order",errors),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors,dispatch})}}return""}export const getApiOrder=async params=>{const{id,dispatch,config,clearWhenPlaced,persistKey,deleteLocalOrder,state}=params,sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return;const options={};state?.include&&state.include.length>0&&(options.include=state.include);const order=await sdk.orders.retrieve(id??"",options);return clearWhenPlaced&&order.editable===!1?(persistKey&&deleteLocalOrder&&deleteLocalOrder(persistKey),dispatch&&dispatch({type:"setOrder",payload:{order:void 0,orderId:""}})):dispatch&&dispatch({type:"setOrder",payload:{order,orderId:order.id}}),order}catch(error){const errors=getErrors({error,resource:"orders"});console.error("Retrieve order",errors),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors,dispatch});return}};export async function updateOrder({id,attributes,dispatch,config,include,state}){const sdk=config!=null?getSdk(config):void 0;try{if(sdk==null)return{success:!1};const resource={...attributes,id};await sdk.orders.update(resource,{include});const order=await getApiOrder({id,config,dispatch,state});return dispatch&&order&&dispatch({type:"setOrder",payload:{order}}),{success:!0,order}}catch(error){const errors=getErrors({error,resource:"orders"});return dispatch&&(setOrderErrors({errors,dispatch}),dispatch({type:"setErrors",payload:{errors}})),{success:!1,error}}}export const setOrder=(order,dispatch)=>{dispatch&&dispatch({type:"setOrder",payload:{order}})};export function addResourceToInclude({resourcesIncluded=[],dispatch,newResource,newResourceLoaded,resourceIncludedLoaded}){const payload={include:void 0,includeLoaded:void 0};if(newResource){const resources=typeof newResource=="string"?[newResource]:newResource;payload.include=[...new Set([...resourcesIncluded,...resources])],resources.forEach(resource=>{const includeLoaded={...payload.includeLoaded,[resource]:!0};payload.includeLoaded=includeLoaded})}else delete payload.include;const payloadIncludeLoaded={...resourceIncludedLoaded,...newResourceLoaded,...payload.includeLoaded&&payload.includeLoaded};payload.includeLoaded=payloadIncludeLoaded,dispatch&&dispatch({type:"setIncludesResource",payload:{...payload,withoutIncludes:!1}})}export async function addToCart(params){const{skuCode,bundleCode,quantity,config,dispatch,lineItem,state,errors=[],buyNowMode,checkoutUrl,lineItemOption,openMiniCart=!0}=params;try{if(config){const sdk=getSdk(config),id=await createOrder(params);if(id){const order=sdk.orders.relationship(id),name=lineItem?.name,imageUrl=lineItem?.imageUrl,metadata=lineItem?.metadata,frequency=lineItem?.frequency,externalPrice=lineItem?.externalPrice;if(buyNowMode)if(state?.order?.line_items)await Promise.all(state?.order?.line_items.map(async lineItem2=>{await sdk.line_items.delete(lineItem2.id)}));else{const{line_items:lineItems}=await sdk.orders.retrieve(id,{fields:["line_items"],include:["line_items"]});lineItems&&lineItems?.length>0&&await Promise.all(lineItems.map(async lineItem2=>{await sdk.line_items.delete(lineItem2.id)}))}const attrs={order,sku_code:skuCode,name,image_url:imageUrl,quantity:quantity??1,_update_quantity:lineItem?._update_quantity??!0,bundle_code:bundleCode,metadata,frequency};externalPrice===!0&&(attrs._external_price=externalPrice);const newLineItem=await sdk.line_items.create(attrs);if(lineItemOption!=null){const{skuOptionId,options,quantity:quantity2}=lineItemOption,skuOption=sdk.sku_options.relationship(skuOptionId),lineItemRel=sdk.line_items.relationship(newLineItem.id),lineItemOptionsAttributes={quantity:quantity2??1,options,sku_option:skuOption,line_item:lineItemRel};await sdk.line_item_options.create(lineItemOptionsAttributes),await getApiOrder({id,...params})}else await getApiOrder({id,...params,state});if(!isEmpty(errors)&&dispatch&&dispatch({type:"setErrors",payload:{errors:[]}}),buyNowMode&&id&&config?.accessToken!=null&&config?.endpoint!=null){const params2=`${id}?accessToken=${config.accessToken??""}`,{domain,slug}=getDomain(config.endpoint),href=getApplicationLink({slug,orderId:id,accessToken:config.accessToken,applicationType:"checkout",domain}),organizationConfig=await getOrganizationConfig({accessToken:config.accessToken,endpoint:config.endpoint,params:{accessToken:config.accessToken,orderId:order?.id,slug}}),redirectUrl=checkoutUrl?`${checkoutUrl}/${params2}`:organizationConfig?.links?.checkout??href;location.href=redirectUrl}else openMiniCart&&publish("open-cart");return{success:!0,orderId:id}}}return{success:!1}}catch(error){const errors2=getErrors({error,resource:"orders"});return console.error("Add to cart",errors2),dispatch&&setErrors({currentErrors:state?.errors,newErrors:errors2,dispatch}),{success:!1}}}export const unsetOrderState=dispatch=>{dispatch({type:"setOrderId",payload:{orderId:""}}),dispatch({type:"setOrder",payload:{order:void 0}})};export function setOrderErrors({dispatch,errors=[]}){return dispatch&&dispatch({type:"setErrors",payload:{errors}}),{success:!1}}export const saveAddressToCustomerAddressBook=({type,value,dispatch})=>{const k=`_save_${type}_to_customer_address_book`,v=`${value.toString()}`;setCustomerOrderParam(k,v),dispatch&&dispatch({type:"setSaveAddressToCustomerAddressBook",payload:{[k]:v}})};export async function setGiftCardOrCouponCode({code,codeType,dispatch,config,order,include,state}){try{if(config&&order&&code&&dispatch){const attributes={[codeType]:code},{success,order:currentOrder,error}=await updateOrder({id:order.id,attributes,config,include,dispatch,state});if(!success)throw error;return dispatch({type:"setErrors",payload:{errors:[]}}),{success,order:currentOrder}}return{success:!1}}catch(error){const errors=getErrors({error,resource:"orders",field:codeType});return dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}}export async function removeGiftCardOrCouponCode({codeType,dispatch,config,order,include,state}){try{if(config&&order&&dispatch){const attributes={[codeType]:""},orderUpdated=await updateOrder({id:order.id,attributes,config,include,dispatch,state});return dispatch({type:"setErrors",payload:{errors:[]}}),{success:!0,order:orderUpdated?.order}}return{success:!1}}catch(error){const errors=getErrors({error,resource:"orders",field:codeType});return console.error("Remove gift card o coupon code",errors),dispatch&&setOrderErrors({errors,dispatch}),{success:!1}}}export const orderInitialState={loading:!0,orderId:"",order:void 0,errors:[],include:void 0,withoutIncludes:!0};const orderReducer=(state,reducer)=>baseReducer(state,reducer,actionType);export default orderReducer;
|
|
@@ -31,10 +31,10 @@ export interface PlaceOrderActionPayload {
|
|
|
31
31
|
paymentId: string;
|
|
32
32
|
paymentSource: PaymentSourceType;
|
|
33
33
|
options?: PlaceOrderOptions;
|
|
34
|
-
placeOrderButtonRef?: RefObject<HTMLButtonElement>;
|
|
34
|
+
placeOrderButtonRef?: RefObject<HTMLButtonElement | null>;
|
|
35
35
|
status: 'placing' | 'standby';
|
|
36
36
|
}
|
|
37
|
-
export declare function setButtonRef(ref: RefObject<HTMLButtonElement>, dispatch: Dispatch<PlaceOrderAction>): void;
|
|
37
|
+
export declare function setButtonRef(ref: RefObject<HTMLButtonElement | null>, dispatch: Dispatch<PlaceOrderAction>): void;
|
|
38
38
|
export type PlaceOrderState = Partial<PlaceOrderActionPayload>;
|
|
39
39
|
export interface PlaceOrderAction {
|
|
40
40
|
type: PlaceOrderActionType;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
1
2
|
export type DefaultChildrenType = JSX.Element[] | JSX.Element | null;
|
|
2
3
|
type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
|
|
3
4
|
export type TRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Dispatch, type ForwardedRef, type Ref } from 'react';
|
|
1
|
+
import { type Dispatch, type ForwardedRef, type Ref, type JSX } from 'react';
|
|
2
2
|
import PropTypes, { type InferProps } from 'prop-types';
|
|
3
3
|
import { type BaseError } from './errors';
|
|
4
4
|
export declare const BC: {
|
|
@@ -96,7 +96,7 @@ export declare const baseOrderComponentPricePropTypes: {
|
|
|
96
96
|
export type BasePriceType = 'total' | 'option' | 'unit';
|
|
97
97
|
export type BaseSelectorType = 'select' | 'radio';
|
|
98
98
|
export type BaseAmountComponentChildren = Omit<BaseAmountComponent, 'children'>;
|
|
99
|
-
export interface BaseAmountComponent extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
99
|
+
export interface BaseAmountComponent extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
|
|
100
100
|
children?: ChildrenFunction<BaseAmountComponentChildren>;
|
|
101
101
|
format?: BaseFormatPrice;
|
|
102
102
|
price?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Price } from '@commercelayer/sdk';
|
|
2
2
|
import { type PTemplateProps } from '../components/utils/PriceTemplate';
|
|
3
|
+
import type { JSX } from "react";
|
|
3
4
|
export declare function getPriceByCode(skuPrices: Price[], code?: string): Price | undefined;
|
|
4
5
|
export declare function getPricesComponent(skuPrices: Price[], props: PTemplateProps): JSX.Element[] | JSX.Element;
|
|
5
6
|
export default function getPrices<P extends Price>(prices: P[]): Record<string, P[]>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{useState,useEffect}from"react";import{getDomain}from"./getDomain";import getSdk from"./getSdk";import{getConfig}from"@commercelayer/organization-config";import{jwt}from"./jwt";export function getOrganizationSlug(endpoint){const org={organization:"",domain:"commercelayer.io"},{domain,slug}=getDomain(endpoint);return{organization:slug,domain:domain||org.domain}}export async function getOrganizationConfig(config){const{market}=jwt(config.accessToken),organization=await getSdk(config).organization.retrieve({fields:{
|
|
2
|
+
import{useState,useEffect}from"react";import{getDomain}from"./getDomain";import getSdk from"./getSdk";import{getConfig}from"@commercelayer/organization-config";import{jwt}from"./jwt";export function getOrganizationSlug(endpoint){const org={organization:"",domain:"commercelayer.io"},{domain,slug}=getDomain(endpoint);return{organization:slug,domain:domain||org.domain}}export async function getOrganizationConfig(config){const{market}=jwt(config.accessToken),organization=await getSdk(config).organization.retrieve({fields:{organizations:["id","config"]}});return getConfig({jsonConfig:organization.config??{},market:`market:id:${market.id.join(",")}`,params:config.params})}export function useOrganizationConfig({accessToken,endpoint,params}){const[organizationConfig,setOrganizationConfig]=useState(null);return useEffect(()=>{accessToken==null||endpoint==null||getOrganizationConfig({accessToken,endpoint,params}).then(config=>{setOrganizationConfig(config)})},[accessToken,endpoint]),organizationConfig}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/react-components",
|
|
3
|
-
"version": "4.17.0
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"description": "The Official Commerce Layer React Components",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -166,47 +166,47 @@
|
|
|
166
166
|
"homepage": "https://github.com/commercelayer/commercelayer-react-components#readme",
|
|
167
167
|
"dependencies": {
|
|
168
168
|
"@adyen/adyen-web": "^5.71.1",
|
|
169
|
-
"@commercelayer/organization-config": "^1.4.
|
|
170
|
-
"@commercelayer/sdk": "^6.
|
|
171
|
-
"@stripe/react-stripe-js": "^
|
|
172
|
-
"@stripe/stripe-js": "^
|
|
169
|
+
"@commercelayer/organization-config": "^1.4.12",
|
|
170
|
+
"@commercelayer/sdk": "^6.26.0",
|
|
171
|
+
"@stripe/react-stripe-js": "^3.0.0",
|
|
172
|
+
"@stripe/stripe-js": "^5.2.0",
|
|
173
173
|
"@tanstack/react-table": "^8.17.3",
|
|
174
174
|
"@types/iframe-resizer": "^3.5.13",
|
|
175
|
-
"braintree-web": "^3.112.
|
|
176
|
-
"frames-react": "^1.
|
|
175
|
+
"braintree-web": "^3.112.1",
|
|
176
|
+
"frames-react": "^1.2.2",
|
|
177
177
|
"iframe-resizer": "^4.4.5",
|
|
178
178
|
"jwt-decode": "^4.0.0",
|
|
179
179
|
"lodash": "^4.17.21",
|
|
180
|
-
"rapid-form": "
|
|
180
|
+
"rapid-form": "2.1.0"
|
|
181
181
|
},
|
|
182
182
|
"devDependencies": {
|
|
183
183
|
"@commercelayer/js-auth": "^6.7.0",
|
|
184
|
-
"@faker-js/faker": "^9.
|
|
185
|
-
"@playwright/test": "^1.
|
|
184
|
+
"@faker-js/faker": "^9.3.0",
|
|
185
|
+
"@playwright/test": "^1.49.1",
|
|
186
186
|
"@testing-library/dom": "^10.4.0",
|
|
187
|
-
"@testing-library/react": "^16.
|
|
188
|
-
"@types/braintree-web": "^3.96.
|
|
187
|
+
"@testing-library/react": "^16.1.0",
|
|
188
|
+
"@types/braintree-web": "^3.96.16",
|
|
189
189
|
"@types/lodash": "^4.17.13",
|
|
190
|
-
"@types/node": "^22.
|
|
191
|
-
"@types/prop-types": "^15.7.
|
|
192
|
-
"@types/react": "^18.3.
|
|
193
|
-
"@types/react-test-renderer": "^18.
|
|
190
|
+
"@types/node": "^22.10.2",
|
|
191
|
+
"@types/prop-types": "^15.7.14",
|
|
192
|
+
"@types/react": "^18.3.1",
|
|
193
|
+
"@types/react-test-renderer": "^18.3.1",
|
|
194
194
|
"@types/react-window": "^1.8.8",
|
|
195
|
-
"@vitejs/plugin-react": "^4.3.
|
|
196
|
-
"@vitest/coverage-v8": "^2.1.
|
|
197
|
-
"eslint": "~9.
|
|
195
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
196
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
197
|
+
"eslint": "~9.16.0",
|
|
198
198
|
"jsdom": "^25.0.1",
|
|
199
199
|
"minimize-js": "^1.4.0",
|
|
200
|
-
"msw": "^2.6.
|
|
201
|
-
"react": "^18.
|
|
202
|
-
"react-dom": "^18.
|
|
203
|
-
"react-test-renderer": "^18.
|
|
200
|
+
"msw": "^2.6.8",
|
|
201
|
+
"react": "^18.3.1",
|
|
202
|
+
"react-dom": "^18.3.1",
|
|
203
|
+
"react-test-renderer": "^18.3.1",
|
|
204
204
|
"tsc-alias": "^1.8.8",
|
|
205
205
|
"tslib": "^2.6.3",
|
|
206
|
-
"typescript": "^5.
|
|
207
|
-
"vite": "^
|
|
208
|
-
"vite-tsconfig-paths": "^5.1.
|
|
209
|
-
"vitest": "^2.1.
|
|
206
|
+
"typescript": "^5.7.2",
|
|
207
|
+
"vite": "^6.0.3",
|
|
208
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
209
|
+
"vitest": "^2.1.8"
|
|
210
210
|
},
|
|
211
211
|
"peerDependencies": {
|
|
212
212
|
"react": ">=18.0.0"
|