@commercelayer/react-components 3.4.4 → 3.5.2
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/components/AddToCartButton.d.ts +1 -20
- package/lib/components/AddToCartButton.js +1 -1
- package/lib/components/Address.d.ts +1 -13
- package/lib/components/Address.js +1 -1
- package/lib/components/AddressCountrySelector.d.ts +1 -9
- package/lib/components/AddressCountrySelector.js +1 -1
- package/lib/components/AddressField.d.ts +1 -15
- package/lib/components/AddressField.js +1 -1
- package/lib/components/AddressInput.d.ts +1 -7
- package/lib/components/AddressInput.js +1 -1
- package/lib/components/AddressStateSelector.d.ts +1 -11
- package/lib/components/AddressStateSelector.js +1 -1
- package/lib/components/AddressesContainer.d.ts +1 -8
- package/lib/components/AddressesContainer.js +1 -1
- package/lib/components/AdjustmentAmount.d.ts +1 -4
- package/lib/components/AdjustmentAmount.js +1 -1
- package/lib/components/AdyenPayment.d.ts +1 -25
- package/lib/components/AdyenPayment.js +1 -1
- package/lib/components/AvailabilityContainer.d.ts +1 -7
- package/lib/components/AvailabilityContainer.js +1 -1
- package/lib/components/AvailabilityTemplate.d.ts +1 -15
- package/lib/components/AvailabilityTemplate.js +1 -1
- package/lib/components/BillingAddressContainer.d.ts +1 -6
- package/lib/components/BillingAddressContainer.js +1 -1
- package/lib/components/BillingAddressForm.d.ts +1 -8
- package/lib/components/BillingAddressForm.js +1 -1
- package/lib/components/BraintreePayment.d.ts +1 -30
- package/lib/components/BraintreePayment.js +1 -1
- package/lib/components/CheckoutComPayment.d.ts +1 -23
- package/lib/components/CheckoutComPayment.js +1 -1
- package/lib/components/CheckoutLink.d.ts +1 -13
- package/lib/components/CheckoutLink.js +1 -1
- package/lib/components/CommerceLayer.d.ts +1 -8
- package/lib/components/CommerceLayer.js +1 -1
- package/lib/components/CustomerContainer.d.ts +1 -7
- package/lib/components/CustomerContainer.js +1 -1
- package/lib/components/CustomerInput.d.ts +1 -11
- package/lib/components/CustomerInput.js +1 -1
- package/lib/components/DeliveryLeadTime.d.ts +1 -10
- package/lib/components/DeliveryLeadTime.js +1 -1
- package/lib/components/DiscountAmount.d.ts +1 -4
- package/lib/components/DiscountAmount.js +1 -1
- package/lib/components/Errors.d.ts +1 -5
- package/lib/components/Errors.js +1 -1
- package/lib/components/ExternalFunction.d.ts +1 -7
- package/lib/components/ExternalFunction.js +1 -1
- package/lib/components/GiftCard.d.ts +1 -8
- package/lib/components/GiftCard.js +1 -1
- package/lib/components/GiftCardAmount.d.ts +1 -4
- package/lib/components/GiftCardAmount.js +1 -1
- package/lib/components/GiftCardContainer.d.ts +1 -6
- package/lib/components/GiftCardContainer.js +1 -1
- package/lib/components/GiftCardCurrencySelector.d.ts +1 -7
- package/lib/components/GiftCardCurrencySelector.js +1 -1
- package/lib/components/GiftCardInput.d.ts +1 -7
- package/lib/components/GiftCardInput.js +1 -1
- package/lib/components/GiftCardOrCouponCode.d.ts +1 -13
- package/lib/components/GiftCardOrCouponCode.js +1 -1
- package/lib/components/GiftCardOrCouponForm.d.ts +1 -10
- package/lib/components/GiftCardOrCouponForm.js +1 -1
- package/lib/components/GiftCardOrCouponInput.d.ts +1 -8
- package/lib/components/GiftCardOrCouponInput.js +1 -1
- package/lib/components/GiftCardOrCouponRemoveButton.d.ts +1 -16
- package/lib/components/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/components/GiftCardOrCouponSubmit.d.ts +1 -9
- package/lib/components/GiftCardOrCouponSubmit.js +1 -1
- package/lib/components/ItemContainer.d.ts +1 -11
- package/lib/components/ItemContainer.js +1 -1
- package/lib/components/LineItem.d.ts +1 -8
- package/lib/components/LineItem.js +1 -1
- package/lib/components/LineItemAmount.d.ts +1 -7
- package/lib/components/LineItemAmount.js +1 -1
- package/lib/components/LineItemCode.d.ts +1 -12
- package/lib/components/LineItemCode.js +1 -1
- package/lib/components/LineItemImage.d.ts +1 -16
- package/lib/components/LineItemImage.js +1 -1
- package/lib/components/LineItemName.d.ts +1 -11
- package/lib/components/LineItemName.js +1 -1
- package/lib/components/LineItemOption.d.ts +1 -19
- package/lib/components/LineItemOption.js +1 -1
- package/lib/components/LineItemOptions.d.ts +1 -14
- package/lib/components/LineItemOptions.js +1 -1
- package/lib/components/LineItemQuantity.d.ts +1 -14
- package/lib/components/LineItemQuantity.js +1 -1
- package/lib/components/LineItemRemoveLink.d.ts +1 -12
- package/lib/components/LineItemRemoveLink.js +1 -1
- package/lib/components/LineItemsContainer.d.ts +1 -8
- package/lib/components/LineItemsContainer.js +1 -1
- package/lib/components/LineItemsCount.d.ts +1 -12
- package/lib/components/LineItemsCount.js +1 -1
- package/lib/components/LineItemsEmpty.d.ts +1 -12
- package/lib/components/LineItemsEmpty.js +1 -1
- package/lib/components/MetadataInput.d.ts +1 -5
- package/lib/components/MetadataInput.js +1 -1
- package/lib/components/OrderContainer.d.ts +1 -11
- package/lib/components/OrderContainer.js +1 -1
- package/lib/components/OrderNumber.d.ts +1 -5
- package/lib/components/OrderNumber.js +1 -1
- package/lib/components/OrderStorage.d.ts +1 -8
- package/lib/components/OrderStorage.js +1 -1
- package/lib/components/PaymentGateway.d.ts +1 -16
- package/lib/components/PaymentGateway.js +1 -1
- package/lib/components/PaymentMethod.d.ts +1 -16
- package/lib/components/PaymentMethod.js +1 -1
- package/lib/components/PaymentMethodAmount.d.ts +1 -4
- package/lib/components/PaymentMethodAmount.js +1 -1
- package/lib/components/PaymentMethodName.d.ts +1 -9
- package/lib/components/PaymentMethodName.js +1 -1
- package/lib/components/PaymentMethodPrice.d.ts +1 -9
- package/lib/components/PaymentMethodPrice.js +1 -1
- package/lib/components/PaymentMethodRadioButton.d.ts +1 -11
- package/lib/components/PaymentMethodRadioButton.js +1 -1
- package/lib/components/PaymentMethodsContainer.d.ts +1 -8
- package/lib/components/PaymentMethodsContainer.js +1 -1
- package/lib/components/PaymentSource.d.ts +1 -19
- package/lib/components/PaymentSource.js +1 -1
- package/lib/components/PaymentSourceBrandIcon.d.ts +1 -15
- package/lib/components/PaymentSourceBrandIcon.js +1 -1
- package/lib/components/PaymentSourceBrandName.d.ts +1 -12
- package/lib/components/PaymentSourceBrandName.js +1 -1
- package/lib/components/PaymentSourceDetail.d.ts +1 -12
- package/lib/components/PaymentSourceDetail.js +1 -1
- package/lib/components/PaymentSourceEditButton.d.ts +1 -9
- package/lib/components/PaymentSourceEditButton.js +1 -1
- package/lib/components/PaypalPayment.d.ts +1 -12
- package/lib/components/PaypalPayment.js +1 -1
- package/lib/components/PlaceOrderButton.d.ts +1 -12
- package/lib/components/PlaceOrderButton.js +1 -1
- package/lib/components/PlaceOrderContainer.d.ts +1 -8
- package/lib/components/PlaceOrderContainer.js +1 -1
- package/lib/components/Price.d.ts +1 -16
- package/lib/components/Price.js +1 -1
- package/lib/components/PricesContainer.d.ts +1 -11
- package/lib/components/PricesContainer.js +1 -1
- package/lib/components/PrivacyAndTermsCheckbox.d.ts +1 -4
- package/lib/components/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/components/QuantitySelector.d.ts +1 -17
- package/lib/components/QuantitySelector.js +1 -1
- package/lib/components/SaveAddressesButton.d.ts +1 -10
- package/lib/components/SaveAddressesButton.js +1 -1
- package/lib/components/SaveCustomerButton.d.ts +1 -13
- package/lib/components/SaveCustomerButton.js +1 -1
- package/lib/components/Shipment.d.ts +1 -8
- package/lib/components/Shipment.js +1 -1
- package/lib/components/ShipmentField.d.ts +1 -12
- package/lib/components/ShipmentField.js +1 -1
- package/lib/components/ShipmentsContainer.d.ts +1 -6
- package/lib/components/ShipmentsContainer.js +1 -1
- package/lib/components/ShippingAddressContainer.d.ts +1 -6
- package/lib/components/ShippingAddressContainer.js +1 -1
- package/lib/components/ShippingAddressForm.d.ts +1 -8
- package/lib/components/ShippingAddressForm.js +1 -1
- package/lib/components/ShippingAmount.d.ts +1 -4
- package/lib/components/ShippingAmount.js +1 -1
- package/lib/components/ShippingMethod.d.ts +1 -8
- package/lib/components/ShippingMethod.js +1 -1
- package/lib/components/ShippingMethodName.d.ts +1 -11
- package/lib/components/ShippingMethodName.js +1 -1
- package/lib/components/ShippingMethodPrice.d.ts +1 -13
- package/lib/components/ShippingMethodPrice.js +1 -1
- package/lib/components/ShippingMethodRadioButton.d.ts +1 -13
- package/lib/components/ShippingMethodRadioButton.js +1 -1
- package/lib/components/SkuList.d.ts +1 -7
- package/lib/components/SkuList.js +1 -1
- package/lib/components/SkuListsContainer.d.ts +1 -6
- package/lib/components/SkuListsContainer.js +1 -1
- package/lib/components/SkuOption.d.ts +1 -7
- package/lib/components/SkuOption.js +1 -1
- package/lib/components/SkuOptionInput.d.ts +1 -5
- package/lib/components/SkuOptionInput.js +1 -1
- package/lib/components/SkuOptionsContainer.d.ts +1 -7
- package/lib/components/SkuOptionsContainer.js +1 -1
- package/lib/components/StockTransfer.d.ts +1 -6
- package/lib/components/StockTransfer.js +1 -1
- package/lib/components/StockTransferField.d.ts +1 -9
- package/lib/components/StockTransferField.js +1 -1
- package/lib/components/StripePayment.d.ts +1 -18
- package/lib/components/StripePayment.js +1 -1
- package/lib/components/SubTotalAmount.d.ts +1 -4
- package/lib/components/SubTotalAmount.js +1 -1
- package/lib/components/SubmitButton.d.ts +1 -9
- package/lib/components/SubmitButton.js +1 -1
- package/lib/components/TaxesAmount.d.ts +1 -4
- package/lib/components/TaxesAmount.js +1 -1
- package/lib/components/TotalAmount.d.ts +1 -4
- package/lib/components/TotalAmount.js +1 -1
- package/lib/components/VariantSelector.d.ts +1 -29
- package/lib/components/VariantSelector.js +1 -1
- package/lib/components/VariantsContainer.d.ts +1 -8
- package/lib/components/VariantsContainer.js +1 -1
- package/lib/components/WireTransferPayment.d.ts +1 -10
- package/lib/components/WireTransferPayment.js +1 -1
- package/lib/components/gateways/AdyenGateway.d.ts +1 -4
- package/lib/components/gateways/AdyenGateway.js +1 -1
- package/lib/components/gateways/BraintreeGateway.d.ts +1 -4
- package/lib/components/gateways/BraintreeGateway.js +1 -1
- package/lib/components/gateways/CheckoutComGateway.d.ts +1 -4
- package/lib/components/gateways/CheckoutComGateway.js +1 -1
- package/lib/components/gateways/PaypalGateway.d.ts +1 -4
- package/lib/components/gateways/PaypalGateway.js +1 -1
- package/lib/components/gateways/StripeGateway.d.ts +1 -4
- package/lib/components/gateways/StripeGateway.js +1 -1
- package/lib/components/gateways/WireTransferGateway.d.ts +1 -4
- package/lib/components/gateways/WireTransferGateway.js +1 -1
- package/lib/components/utils/AddressCardsTemplate.d.ts +1 -26
- package/lib/components/utils/AddressCardsTemplate.js +1 -1
- package/lib/components/utils/BaseField.d.ts +1 -8
- package/lib/components/utils/BaseField.js +1 -1
- package/lib/components/utils/BaseInput.d.ts +1 -5
- package/lib/components/utils/BaseInput.js +1 -1
- package/lib/components/utils/BaseOrderPrice.d.ts +1 -6
- package/lib/components/utils/BaseOrderPrice.js +1 -1
- package/lib/components/utils/BaseSelect.d.ts +1 -5
- package/lib/components/utils/BaseSelect.js +1 -1
- package/lib/components/utils/Parent.d.ts +1 -8
- package/lib/components/utils/Parent.js +1 -1
- package/lib/components/utils/PaymentCardsTemplate.d.ts +1 -22
- package/lib/components/utils/PaymentCardsTemplate.js +1 -1
- package/lib/components/utils/PriceTemplate.d.ts +1 -8
- package/lib/components/utils/PriceTemplate.js +1 -1
- package/lib/components/utils/VariantTemplate.d.ts +1 -36
- package/lib/components/utils/VariantTemplate.js +1 -1
- package/lib/components/utils/getAllErrors.d.ts +1 -17
- package/lib/config/components.d.ts +1 -891
- package/lib/config/currency.d.ts +1 -5
- package/lib/context/AddressChildrenContext.d.ts +1 -6
- package/lib/context/AddressContext.d.ts +1 -16
- package/lib/context/AvailabilityContext.d.ts +1 -2
- package/lib/context/BillingAddressContext.d.ts +1 -11
- package/lib/context/BillingAddressFormContext.d.ts +1 -19
- package/lib/context/CommerceLayerContext.d.ts +1 -6
- package/lib/context/CouponAndGiftCardFormContext.d.ts +1 -7
- package/lib/context/CustomerContext.d.ts +1 -15
- package/lib/context/ExternalFunctionContext.d.ts +1 -11
- package/lib/context/GiftCardContext.d.ts +1 -10
- package/lib/context/ItemContext.d.ts +1 -12
- package/lib/context/LineItemChildrenContext.d.ts +1 -8
- package/lib/context/LineItemContext.d.ts +1 -7
- package/lib/context/LineItemOptionChildrenContext.d.ts +1 -7
- package/lib/context/OrderContext.d.ts +1 -25
- package/lib/context/OrderStorageContext.d.ts +1 -10
- package/lib/context/PaymentMethodChildrenContext.d.ts +1 -9
- package/lib/context/PaymentMethodContext.d.ts +1 -22
- package/lib/context/PaymentSourceContext.d.ts +1 -13
- package/lib/context/PlaceOrderContext.d.ts +1 -17
- package/lib/context/PricesContext.d.ts +1 -6
- package/lib/context/ShipmentChildrenContext.d.ts +1 -12
- package/lib/context/ShipmentContext.d.ts +1 -11
- package/lib/context/ShippingAddressContext.d.ts +1 -9
- package/lib/context/ShippingAddressFormContext.d.ts +1 -3
- package/lib/context/ShippingMethodChildrenContext.d.ts +1 -9
- package/lib/context/SkuListsContext.d.ts +1 -5
- package/lib/context/SkuOptionChildrenContext.d.ts +1 -7
- package/lib/context/SkuOptionsContext.d.ts +1 -2
- package/lib/context/StockTransferChildrenContext.d.ts +1 -6
- package/lib/context/VariantsContext.d.ts +1 -2
- package/lib/index.d.ts +1 -99
- package/lib/reducers/AddressReducer.d.ts +1 -59
- package/lib/reducers/AvailabilityReducer.d.ts +1 -53
- package/lib/reducers/BillingAddressReducer.d.ts +1 -31
- package/lib/reducers/CustomerReducer.d.ts +1 -50
- package/lib/reducers/GiftCardReducer.d.ts +1 -76
- package/lib/reducers/ItemReducer.d.ts +1 -69
- package/lib/reducers/LineItemReducer.d.ts +1 -52
- package/lib/reducers/OrderReducer.d.ts +2 -121
- package/lib/reducers/PaymentMethodReducer.d.ts +1 -145
- package/lib/reducers/PlaceOrderReducer.d.ts +1 -57
- package/lib/reducers/PriceReducer.d.ts +1 -44
- package/lib/reducers/ShipmentReducer.d.ts +1 -40
- package/lib/reducers/ShippingAddressReducer.d.ts +1 -32
- package/lib/reducers/SkuListsReducer.d.ts +1 -21
- package/lib/reducers/SkuOptionsReducer.d.ts +1 -26
- package/lib/reducers/VariantReducer.d.ts +1 -71
- package/lib/typings/errors.d.ts +1 -42
- package/lib/typings/index.d.ts +1 -127
- package/lib/utils/PropsType.d.ts +1 -33
- package/lib/utils/addressesManager.d.ts +1 -28
- package/lib/utils/baseReducer.d.ts +1 -3
- package/lib/utils/browserInfo.d.ts +1 -9
- package/lib/utils/childrenTypes.d.ts +1 -9
- package/lib/utils/countryStateCity.d.ts +1 -9
- package/lib/utils/customMessages.d.ts +1 -8
- package/lib/utils/customerOrderOptions.d.ts +1 -3
- package/lib/utils/getAmount.d.ts +1 -9
- package/lib/utils/getCardDetails.d.ts +1 -15
- package/lib/utils/getCurrentItemKey.d.ts +1 -6
- package/lib/utils/getErrors.d.ts +1 -11
- package/lib/utils/getLineItemsCount.d.ts +1 -12
- package/lib/utils/getLoaderComponent.d.ts +1 -2
- package/lib/utils/getLoaderComponent.js +1 -1
- package/lib/utils/getPrices.d.ts +1 -17
- package/lib/utils/getPrices.js +1 -1
- package/lib/utils/getSdk.d.ts +1 -3
- package/lib/utils/getSkus.d.ts +1 -3
- package/lib/utils/hooks/useExternalScript.d.ts +1 -1
- package/lib/utils/isEmptyStates.d.ts +1 -1
- package/lib/utils/isJSON.d.ts +1 -1
- package/lib/utils/jwt.d.ts +1 -27
- package/lib/utils/localStorage.d.ts +1 -17
- package/lib/utils/organization.d.ts +1 -6
- package/lib/utils/paypalPayment.d.ts +1 -3
- package/lib/utils/promisify.d.ts +1 -1
- package/lib/utils/shipments.d.ts +1 -2
- package/lib/utils/validateFormFields.d.ts +1 -22
- package/package.json +21 -21
package/lib/typings/index.d.ts
CHANGED
|
@@ -1,127 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import PropTypes, { InferProps } from 'prop-types';
|
|
3
|
-
import { BaseError } from './errors';
|
|
4
|
-
export declare const BC: {
|
|
5
|
-
id: PropTypes.Requireable<string>;
|
|
6
|
-
className: PropTypes.Requireable<string>;
|
|
7
|
-
style: PropTypes.Requireable<object>;
|
|
8
|
-
name: PropTypes.Requireable<string>;
|
|
9
|
-
};
|
|
10
|
-
export declare const PTLoader: PropTypes.Requireable<string | PropTypes.ReactElementLike>;
|
|
11
|
-
export declare const BaseSelectComponentPropTypes: {
|
|
12
|
-
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
|
-
options: PropTypes.Validator<PropTypes.InferProps<{
|
|
14
|
-
label: PropTypes.Validator<string>;
|
|
15
|
-
value: PropTypes.Validator<string | number>;
|
|
16
|
-
selected: PropTypes.Requireable<boolean>;
|
|
17
|
-
}>[]>;
|
|
18
|
-
placeholder: PropTypes.Requireable<PropTypes.InferProps<{
|
|
19
|
-
label: PropTypes.Validator<string>;
|
|
20
|
-
value: PropTypes.Validator<string | number>;
|
|
21
|
-
}>>;
|
|
22
|
-
value: PropTypes.Requireable<string>;
|
|
23
|
-
name: PropTypes.Validator<string>;
|
|
24
|
-
};
|
|
25
|
-
export declare type SelectPlaceholder = Option;
|
|
26
|
-
declare type BaseSelectChildrenComponentProps = Omit<BaseSelectComponentProps, 'children'>;
|
|
27
|
-
declare type Option = {
|
|
28
|
-
label: string;
|
|
29
|
-
value: string | number;
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
};
|
|
32
|
-
export interface BaseSelectComponentProps {
|
|
33
|
-
children?: (props: BaseSelectChildrenComponentProps) => ReactNode;
|
|
34
|
-
options: Option[];
|
|
35
|
-
placeholder?: Option;
|
|
36
|
-
value?: string;
|
|
37
|
-
className?: string;
|
|
38
|
-
required?: boolean;
|
|
39
|
-
name: string;
|
|
40
|
-
onChange?: (event: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
41
|
-
}
|
|
42
|
-
export declare const BaseInputComponentPropTypes: {
|
|
43
|
-
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
|
-
name: PropTypes.Validator<string>;
|
|
45
|
-
type: PropTypes.Validator<BaseInputType>;
|
|
46
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
-
placeholder: PropTypes.Requireable<string>;
|
|
48
|
-
};
|
|
49
|
-
declare type BaseInputChildrenComponentProps = Omit<BaseInputComponentProps, 'children'> & {
|
|
50
|
-
handleChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
51
|
-
};
|
|
52
|
-
export interface BaseInputComponentProps {
|
|
53
|
-
ref?: () => RefObject<any>;
|
|
54
|
-
children?: (props: BaseInputChildrenComponentProps) => ReactNode;
|
|
55
|
-
name: string;
|
|
56
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
57
|
-
placeholder?: string;
|
|
58
|
-
}
|
|
59
|
-
export declare type LineItemType = 'gift_cards' | 'payment_methods' | 'promotions' | 'shipments' | 'skus' | 'bundles' | 'adjustments';
|
|
60
|
-
export declare type GiftCardInputName = 'balanceCents' | 'balanceMaxCents' | 'singleUse' | 'rechargeable' | 'imageUrl' | 'expiresAt' | 'referenceOrigin' | 'email' | 'firstName' | 'lastName' | 'reference';
|
|
61
|
-
export declare type AddressInputName = 'billing_address_city' | 'billing_address_company' | 'billing_address_first_name' | 'billing_address_email' | 'billing_address_last_name' | 'billing_address_line_1' | 'billing_address_line_2' | 'billing_address_phone' | 'billing_address_state_code' | 'billing_address_zip_code' | 'billing_address_billing_info' | 'billing_address_save_to_customer_book' | 'shipping_address_city' | 'shipping_address_company' | 'shipping_address_email' | 'shipping_address_first_name' | 'shipping_address_last_name' | 'shipping_address_line_1' | 'shipping_address_line_2' | 'shipping_address_phone' | 'shipping_address_state_code' | 'shipping_address_zip_code' | 'shipping_address_save_to_customer_book';
|
|
62
|
-
export declare type AddressCountrySelectName = 'billing_address_country_code' | 'shipping_address_country_code';
|
|
63
|
-
export declare type AddressStateSelectName = 'billing_address_state_code' | 'shipping_address_state_code';
|
|
64
|
-
export declare type BaseInputType = 'checkbox' | 'date' | 'email' | 'number' | 'tel' | 'text' | 'textarea';
|
|
65
|
-
export declare type LoaderType = string | ReactNode;
|
|
66
|
-
export declare const BMObject: PropTypes.Requireable<{
|
|
67
|
-
[x: string]: string | null | undefined;
|
|
68
|
-
}>;
|
|
69
|
-
export declare type BaseMetadataObject = {
|
|
70
|
-
[key: string]: string | undefined | null;
|
|
71
|
-
};
|
|
72
|
-
export declare type TimeFormat = 'days' | 'hours';
|
|
73
|
-
export declare type BaseComponent = InferProps<typeof BC>;
|
|
74
|
-
export interface BaseAction<A = string> {
|
|
75
|
-
type: A;
|
|
76
|
-
payload: Record<string, any>;
|
|
77
|
-
}
|
|
78
|
-
export interface BaseState {
|
|
79
|
-
[key: string]: any;
|
|
80
|
-
errors?: BaseError[];
|
|
81
|
-
}
|
|
82
|
-
export declare type BaseActionType<T = string> = T[];
|
|
83
|
-
export interface BFSetStateContainer<T> {
|
|
84
|
-
<P extends T>(param: P): void;
|
|
85
|
-
}
|
|
86
|
-
export interface BaseReducer {
|
|
87
|
-
<S extends BaseState, A extends BaseAction, T extends BaseActionType>(state: S, action: A, type: T): S;
|
|
88
|
-
}
|
|
89
|
-
export interface BaseUnsetState<A> {
|
|
90
|
-
(dispatch: Dispatch<A>): void;
|
|
91
|
-
}
|
|
92
|
-
export interface BaseMetadata {
|
|
93
|
-
[key: string]: string | undefined | null;
|
|
94
|
-
}
|
|
95
|
-
export declare type BaseFormatPrice = 'formatted' | 'cents' | 'float';
|
|
96
|
-
export declare const baseOrderPricePropTypes: {
|
|
97
|
-
id: PropTypes.Requireable<string>;
|
|
98
|
-
className: PropTypes.Requireable<string>;
|
|
99
|
-
style: PropTypes.Requireable<object>;
|
|
100
|
-
name: PropTypes.Requireable<string>;
|
|
101
|
-
base: PropTypes.Validator<string>;
|
|
102
|
-
type: PropTypes.Validator<string>;
|
|
103
|
-
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
104
|
-
format: PropTypes.Requireable<BaseFormatPrice>;
|
|
105
|
-
};
|
|
106
|
-
export declare const baseOrderComponentPricePropTypes: {
|
|
107
|
-
id: PropTypes.Requireable<string>;
|
|
108
|
-
className: PropTypes.Requireable<string>;
|
|
109
|
-
style: PropTypes.Requireable<object>;
|
|
110
|
-
name: PropTypes.Requireable<string>;
|
|
111
|
-
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
112
|
-
format: PropTypes.Requireable<BaseFormatPrice>;
|
|
113
|
-
};
|
|
114
|
-
export declare type BasePriceType = 'total' | 'option' | 'unit';
|
|
115
|
-
export declare type BaseSelectorType = 'select' | 'radio';
|
|
116
|
-
export declare type BaseAmountComponentChildren = Omit<BaseAmountComponent, 'children'>;
|
|
117
|
-
export declare type BaseAmountComponent = {
|
|
118
|
-
children?: (props: BaseAmountComponentChildren) => ReactNode;
|
|
119
|
-
format?: BaseFormatPrice;
|
|
120
|
-
price?: string;
|
|
121
|
-
priceCents?: number;
|
|
122
|
-
labelFree?: string;
|
|
123
|
-
} & JSX.IntrinsicElements['span'];
|
|
124
|
-
export interface FunctionChildren<P = Record<string, any>> {
|
|
125
|
-
(props: P): ReactNode;
|
|
126
|
-
}
|
|
127
|
-
export {};
|
|
1
|
+
import{Dispatch,ReactNode,RefObject}from'react';import PropTypes,{InferProps}from'prop-types';import{BaseError}from'./errors';export declare const BC:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;};export declare const PTLoader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;export declare const BaseSelectComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;selected:PropTypes.Requireable<boolean>;}>[]>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<string>;};export declare type SelectPlaceholder=Option;declare type BaseSelectChildrenComponentProps=Omit<BaseSelectComponentProps,'children'>;declare type Option={label:string;value:string|number;disabled?:boolean;};export interface BaseSelectComponentProps{children?:(props:BaseSelectChildrenComponentProps)=>ReactNode;options:Option[];placeholder?:Option;value?:string;className?:string;required?:boolean;name:string;onChange?:(event:React.ChangeEvent<HTMLSelectElement>)=>void;}export declare const BaseInputComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};declare type BaseInputChildrenComponentProps=Omit<BaseInputComponentProps,'children'>&{handleChange:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;};export interface BaseInputComponentProps{ref?:()=>RefObject<any>;children?:(props:BaseInputChildrenComponentProps)=>ReactNode;name:string;onChange?:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;placeholder?:string;}export declare type LineItemType='gift_cards'|'payment_methods'|'promotions'|'shipments'|'skus'|'bundles'|'adjustments';export declare type GiftCardInputName='balanceCents'|'balanceMaxCents'|'singleUse'|'rechargeable'|'imageUrl'|'expiresAt'|'referenceOrigin'|'email'|'firstName'|'lastName'|'reference';export declare type AddressInputName='billing_address_city'|'billing_address_company'|'billing_address_first_name'|'billing_address_email'|'billing_address_last_name'|'billing_address_line_1'|'billing_address_line_2'|'billing_address_phone'|'billing_address_state_code'|'billing_address_zip_code'|'billing_address_billing_info'|'billing_address_save_to_customer_book'|'shipping_address_city'|'shipping_address_company'|'shipping_address_email'|'shipping_address_first_name'|'shipping_address_last_name'|'shipping_address_line_1'|'shipping_address_line_2'|'shipping_address_phone'|'shipping_address_state_code'|'shipping_address_zip_code'|'shipping_address_save_to_customer_book';export declare type AddressCountrySelectName='billing_address_country_code'|'shipping_address_country_code';export declare type AddressStateSelectName='billing_address_state_code'|'shipping_address_state_code';export declare type BaseInputType='checkbox'|'date'|'email'|'number'|'tel'|'text'|'textarea';export declare type LoaderType=string|ReactNode;export declare const BMObject:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;export declare type BaseMetadataObject={[key:string]:string|undefined|null;};export declare type TimeFormat='days'|'hours';export declare type BaseComponent=InferProps<typeof BC>;export interface BaseAction<A=string>{type:A;payload:Record<string,any>;}export interface BaseState{[key:string]:any;errors?:BaseError[];}export declare type BaseActionType<T=string>=T[];export interface BFSetStateContainer<T>{<P extends T>(param:P):void;}export interface BaseReducer{<S extends BaseState,A extends BaseAction,T extends BaseActionType>(state:S,action:A,type:T):S;}export interface BaseUnsetState<A>{(dispatch:Dispatch<A>):void;}export interface BaseMetadata{[key:string]:string|undefined|null;}export declare type BaseFormatPrice='formatted'|'cents'|'float';export declare const baseOrderPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;base:PropTypes.Validator<string>;type:PropTypes.Validator<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare const baseOrderComponentPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare type BasePriceType='total'|'option'|'unit';export declare type BaseSelectorType='select'|'radio';export declare type BaseAmountComponentChildren=Omit<BaseAmountComponent,'children'>;export declare type BaseAmountComponent={children?:(props:BaseAmountComponentChildren)=>ReactNode;format?:BaseFormatPrice;price?:string;priceCents?:number;labelFree?:string;}&JSX.IntrinsicElements['span'];export interface FunctionChildren<P=Record<string,any>>{(props:P):ReactNode;}export{};
|
package/lib/utils/PropsType.d.ts
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
import PropTypes from
|
|
2
|
-
declare type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
3
|
-
declare type Defined<T> = T extends undefined ? never : T;
|
|
4
|
-
/**
|
|
5
|
-
* Get the type that represents the props with the defaultProps included.
|
|
6
|
-
*
|
|
7
|
-
* Alternatively, we could have done something like this:
|
|
8
|
-
* ```
|
|
9
|
-
* export type WithDefaultProps<P, DP extends Partial<P>> = Omit<P, keyof DP> &
|
|
10
|
-
* Required<Pick<P, Extract<keyof DP, keyof P>>>;
|
|
11
|
-
* ```
|
|
12
|
-
* But there were usages of `null` in `defaultProps` that would need to be changed to `undefined`
|
|
13
|
-
* to meet the `DP extends Partial<P>` constraint.
|
|
14
|
-
* So, instead we take the union type in cases when a property in defaultProps does not extend
|
|
15
|
-
* the corresponding property in the Props declaration.
|
|
16
|
-
*/
|
|
17
|
-
declare type WithDefaultProps<P, DP> = Omit<P, keyof DP> & {
|
|
18
|
-
[K in Extract<keyof DP, keyof P>]: DP[K] extends Defined<P[K]> ? Defined<P[K]> : Defined<P[K]> | DP[K];
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Get the props type from propTypes and defaultProps.
|
|
22
|
-
*
|
|
23
|
-
* Usage:
|
|
24
|
-
* ```
|
|
25
|
-
* // Without defaultProps
|
|
26
|
-
* type Props = PropsType<typeof propTypes>;
|
|
27
|
-
*
|
|
28
|
-
* // With defaultProps
|
|
29
|
-
* type Props = PropsType<typeof propTypes, typeof defaultProps>;
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare type PropsType<PT, DP = {}> = WithDefaultProps<PropTypes.InferProps<PT>, DP>;
|
|
33
|
-
export {};
|
|
1
|
+
import PropTypes from'prop-types';declare type Omit<T,K>=Pick<T,Exclude<keyof T,K>>;declare type Defined<T>=T extends undefined?never:T;declare type WithDefaultProps<P,DP>=Omit<P,keyof DP>&{[K in Extract<keyof DP,keyof P>]:DP[K]extends Defined<P[K]>?Defined<P[K]>:Defined<P[K]>|DP[K];};export declare type PropsType<PT,DP={}>=WithDefaultProps<PropTypes.InferProps<PT>,DP>;export{};
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AddressCreate } from '@commercelayer/sdk';
|
|
3
|
-
declare type BillingAddressController = (params: {
|
|
4
|
-
billing_address?: AddressCreate;
|
|
5
|
-
billingAddressId?: string;
|
|
6
|
-
errors?: BaseError[];
|
|
7
|
-
requiresBillingInfo?: boolean;
|
|
8
|
-
}) => boolean;
|
|
9
|
-
export declare const billingAddressController: BillingAddressController;
|
|
10
|
-
declare type ShippingAddressController = (params: {
|
|
11
|
-
billingDisable: boolean;
|
|
12
|
-
errors?: BaseError[];
|
|
13
|
-
shipToDifferentAddress?: boolean;
|
|
14
|
-
shipping_address?: AddressCreate;
|
|
15
|
-
shippingAddressId?: string;
|
|
16
|
-
}) => boolean;
|
|
17
|
-
export declare const shippingAddressController: ShippingAddressController;
|
|
18
|
-
declare type CountryLockController = (params: {
|
|
19
|
-
addresses?: Record<string, any>[];
|
|
20
|
-
billing_address?: Record<string, any>;
|
|
21
|
-
billingAddressId?: string;
|
|
22
|
-
countryCodeLock?: string;
|
|
23
|
-
shipToDifferentAddress?: boolean;
|
|
24
|
-
shipping_address?: Record<string, any>;
|
|
25
|
-
shippingAddressId?: string;
|
|
26
|
-
}) => boolean;
|
|
27
|
-
export declare const countryLockController: CountryLockController;
|
|
28
|
-
export {};
|
|
1
|
+
import{BaseError}from'../typings/errors';import{AddressCreate}from'@commercelayer/sdk';declare type BillingAddressController=(params:{billing_address?:AddressCreate;billingAddressId?:string;errors?:BaseError[];requiresBillingInfo?:boolean;})=>boolean;export declare const billingAddressController:BillingAddressController;declare type ShippingAddressController=(params:{billingDisable:boolean;errors?:BaseError[];shipToDifferentAddress?:boolean;shipping_address?:AddressCreate;shippingAddressId?:string;})=>boolean;export declare const shippingAddressController:ShippingAddressController;declare type CountryLockController=(params:{addresses?:Record<string,any>[];billing_address?:Record<string,any>;billingAddressId?:string;countryCodeLock?:string;shipToDifferentAddress?:boolean;shipping_address?:Record<string,any>;shippingAddressId?:string;})=>boolean;export declare const countryLockController:CountryLockController;export{};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export default function getBrowserInfo():
|
|
2
|
-
screenWidth: string | number;
|
|
3
|
-
screenHeight: string | number;
|
|
4
|
-
colorDepth: string | number;
|
|
5
|
-
userAgent: string;
|
|
6
|
-
timeZoneOffset: number;
|
|
7
|
-
language: string;
|
|
8
|
-
javaEnabled: boolean;
|
|
9
|
-
};
|
|
1
|
+
export default function getBrowserInfo():{screenWidth:string|number;screenHeight:string|number;colorDepth:string|number;userAgent:string;timeZoneOffset:number;language:string;javaEnabled:boolean;};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Requireable } from 'prop-types';
|
|
3
|
-
export interface CheckChildrenTypes {
|
|
4
|
-
(props: {
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: Requireable<ReactNode>;
|
|
9
|
-
export default _default;
|
|
1
|
+
import{ReactNode}from'react';import{Requireable}from'prop-types';export interface CheckChildrenTypes{(props:{[key:string]:any;},propName:string,componentName:string,location:string,propFullName:string):Error|null;}declare const _default:Requireable<ReactNode>;export default _default;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export declare function getCountries(): {
|
|
2
|
-
label: string;
|
|
3
|
-
value: string;
|
|
4
|
-
}[];
|
|
5
|
-
export declare function getStateOfCountry(country_code: string): {
|
|
6
|
-
label: string;
|
|
7
|
-
value: string;
|
|
8
|
-
}[];
|
|
9
|
-
export declare function isValidState(state_code: string, country_code: string): boolean;
|
|
1
|
+
export declare function getCountries():{label:string;value:string;}[];export declare function getStateOfCountry(country_code:string):{label:string;value:string;}[];export declare function isValidState(state_code:string,country_code:string):boolean;
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface CustomMessages {
|
|
3
|
-
(messages: BaseError[], v: BaseError): {
|
|
4
|
-
message?: string;
|
|
5
|
-
} | null;
|
|
6
|
-
}
|
|
7
|
-
declare const customMessages: CustomMessages;
|
|
8
|
-
export default customMessages;
|
|
1
|
+
import{BaseError}from'../typings/errors';export interface CustomMessages{(messages:BaseError[],v:BaseError):{message?:string;}|null;}declare const customMessages:CustomMessages;export default customMessages;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export declare function saveToWallet(): boolean;
|
|
2
|
-
export declare function saveBillingAddress(): boolean;
|
|
3
|
-
export declare function saveShippingAddress(): boolean;
|
|
1
|
+
export declare function saveToWallet():boolean;export declare function saveBillingAddress():boolean;export declare function saveShippingAddress():boolean;
|
package/lib/utils/getAmount.d.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
export interface GetAmountInterface<T
|
|
2
|
-
(base: string, type: string, format: string, obj: Record<string, any>): T extends number ? number : string;
|
|
3
|
-
}
|
|
4
|
-
export default function getAmount<T = string>(args: {
|
|
5
|
-
base: string;
|
|
6
|
-
type: string;
|
|
7
|
-
format: string;
|
|
8
|
-
obj: Record<string, any>;
|
|
9
|
-
}): T extends number ? number : string;
|
|
1
|
+
export interface GetAmountInterface<T=any>{(base:string,type:string,format:string,obj:Record<string,any>):T extends number?number:string;}export default function getAmount<T=string>(args:{base:string;type:string;format:string;obj:Record<string,any>;}):T extends number?number:string;
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PaymentResource } from '../reducers/PaymentMethodReducer';
|
|
3
|
-
import { CustomerPaymentSource } from '@commercelayer/sdk';
|
|
4
|
-
declare type CardDetails = {
|
|
5
|
-
brand: IconBrand | string;
|
|
6
|
-
last4: string;
|
|
7
|
-
exp_month: number | string;
|
|
8
|
-
exp_year: number | string;
|
|
9
|
-
};
|
|
10
|
-
declare type Args = {
|
|
11
|
-
paymentType: PaymentResource;
|
|
12
|
-
customerPayment: Partial<CustomerPaymentSource>;
|
|
13
|
-
};
|
|
14
|
-
export default function getCardDetails({ paymentType, customerPayment, }: Args): CardDetails;
|
|
15
|
-
export {};
|
|
1
|
+
import{IconBrand}from'../context/PaymentSourceContext';import{PaymentResource}from'../reducers/PaymentMethodReducer';import{CustomerPaymentSource}from'@commercelayer/sdk';declare type CardDetails={brand:IconBrand|string;last4:string;exp_month:number|string;exp_year:number|string;};declare type Args={paymentType:PaymentResource;customerPayment:Partial<CustomerPaymentSource>;};export default function getCardDetails({paymentType,customerPayment,}:Args):CardDetails;export{};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface GetCurrentItemKey {
|
|
3
|
-
(item: Items): string;
|
|
4
|
-
}
|
|
5
|
-
declare const getCurrentItemKey: GetCurrentItemKey;
|
|
6
|
-
export default getCurrentItemKey;
|
|
1
|
+
import{Items}from'../reducers/ItemReducer';export interface GetCurrentItemKey{(item:Items):string;}declare const getCurrentItemKey:GetCurrentItemKey;export default getCurrentItemKey;
|
package/lib/utils/getErrors.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Dispatch } from 'react';
|
|
3
|
-
export default function getErrors(error: any, resource: ResourceErrorType): BaseError[];
|
|
4
|
-
declare type SetErrorsArgs<D> = {
|
|
5
|
-
currentErrors?: BaseError[];
|
|
6
|
-
newErrors?: BaseError[];
|
|
7
|
-
dispatch?: D;
|
|
8
|
-
filterBy?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function setErrors<D extends Dispatch<any>>({ currentErrors, newErrors, dispatch, filterBy, }: SetErrorsArgs<D>): BaseError[] | void;
|
|
11
|
-
export {};
|
|
1
|
+
import{BaseError,ResourceErrorType}from'../typings/errors';import{Dispatch}from'react';export default function getErrors(error:any,resource:ResourceErrorType):BaseError[];declare type SetErrorsArgs<D>={currentErrors?:BaseError[];newErrors?:BaseError[];dispatch?:D;filterBy?:string;};export declare function setErrors<D extends Dispatch<any>>({currentErrors,newErrors,dispatch,filterBy,}:SetErrorsArgs<D>):BaseError[]|void;export{};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LineItemType } from '../typings/index';
|
|
3
|
-
export interface GetLineItemsCountInterface {
|
|
4
|
-
(args: {
|
|
5
|
-
lineItems: LineItem[];
|
|
6
|
-
quantity?: number;
|
|
7
|
-
typeAccepted?: TypeAccepted[];
|
|
8
|
-
}): number;
|
|
9
|
-
}
|
|
10
|
-
export declare type TypeAccepted = Extract<LineItemType, 'skus' | 'gift_cards' | 'bundles' | 'adjustments'>;
|
|
11
|
-
declare const getLineItemsCount: GetLineItemsCountInterface;
|
|
12
|
-
export default getLineItemsCount;
|
|
1
|
+
import{LineItem}from'@commercelayer/sdk';import{LineItemType}from'../typings/index';export interface GetLineItemsCountInterface{(args:{lineItems:LineItem[];quantity?:number;typeAccepted?:TypeAccepted[];}):number;}export declare type TypeAccepted=Extract<LineItemType,'skus'|'gift_cards'|'bundles'|'adjustments'>;declare const getLineItemsCount:GetLineItemsCountInterface;export default getLineItemsCount;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
export default function getLoaderComponent(Loader: LoaderType): JSX.Element;
|
|
2
|
+
import{LoaderType}from'../typings/index';export default function getLoaderComponent(Loader:LoaderType):JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";export default function getLoaderComponent(Loader){return typeof Loader=="function"?_jsx(Loader,{}
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";export default function getLoaderComponent(Loader){return typeof Loader=="function"?_jsx(Loader,{}):_jsx(_Fragment,{children:Loader})}
|
package/lib/utils/getPrices.d.ts
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Prices } from '../reducers/PriceReducer';
|
|
3
|
-
import { Items } from '../reducers/ItemReducer';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
|
-
import { PTemplateProps } from '../components/utils/PriceTemplate';
|
|
6
|
-
export interface GetPriceByCode {
|
|
7
|
-
(skuPrices: Price[], code: string): Price | undefined;
|
|
8
|
-
}
|
|
9
|
-
export declare const getPriceByCode: GetPriceByCode;
|
|
10
|
-
export interface GetPricesComponent {
|
|
11
|
-
(skuPrices: Price[], props: PTemplateProps): ReactNode;
|
|
12
|
-
}
|
|
13
|
-
export declare const getPricesComponent: GetPricesComponent;
|
|
14
|
-
export interface GetPrices {
|
|
15
|
-
(prices: Price[] | Items): Prices;
|
|
16
|
-
}
|
|
17
|
-
export default function getPrices<P extends Price>(prices: P[]): Record<string, any>;
|
|
1
|
+
import{Price}from'@commercelayer/sdk';import{Prices}from'../reducers/PriceReducer';import{Items}from'../reducers/ItemReducer';import{ReactNode}from'react';import{PTemplateProps}from'../components/utils/PriceTemplate';export interface GetPriceByCode{(skuPrices:Price[],code:string):Price|undefined;}export declare const getPriceByCode:GetPriceByCode;export interface GetPricesComponent{(skuPrices:Price[],props:PTemplateProps):ReactNode;}export declare const getPricesComponent:GetPricesComponent;export interface GetPrices{(prices:Price[]|Items):Prices;}export default function getPrices<P extends Price>(prices:P[]):Record<string,any>;
|
package/lib/utils/getPrices.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as _createElement}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{isEmpty,first,isArray,has}from"lodash";import PriceTemplate from"../components/utils/PriceTemplate";export const getPriceByCode=(skuPrices,code="")=>code?first(skuPrices.filter(p=>p.currency_code===code)):first(skuPrices),getPricesComponent=(skuPrices,props)=>isEmpty(skuPrices)?_jsx(PriceTemplate,Object.assign({},props)
|
|
1
|
+
import{createElement as _createElement}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{isEmpty,first,isArray,has}from"lodash";import PriceTemplate from"../components/utils/PriceTemplate";export const getPriceByCode=(skuPrices,code="")=>code?first(skuPrices.filter(p=>p.currency_code===code)):first(skuPrices),getPricesComponent=(skuPrices,props)=>isEmpty(skuPrices)?_jsx(PriceTemplate,Object.assign({},props)):skuPrices.map((p,k)=>{const showCompare=typeof props.showCompare=="undefined"&&(p==null?void 0:p.compare_at_amount_cents)>(p==null?void 0:p.amount_cents)||props.showCompare;return _createElement(PriceTemplate,Object.assign({},props,{key:k,showCompare,formattedAmount:p.formatted_amount,formattedCompare:p.formatted_compare_at_amount}))});export default function getPrices(prices){const obj={};return isArray(prices)&&prices.forEach(p=>{const sku=p.sku_code;has(obj,sku)?obj[sku].push(p):obj[sku]=[p]}),obj}
|
package/lib/utils/getSdk.d.ts
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import Sdk from
|
|
2
|
-
import { CommerceLayerConfig } from '../context/CommerceLayerContext';
|
|
3
|
-
export default function getSdk({ endpoint, accessToken, }: CommerceLayerConfig): ReturnType<typeof Sdk>;
|
|
1
|
+
import Sdk from'@commercelayer/sdk';import{CommerceLayerConfig}from'../context/CommerceLayerContext';export default function getSdk({endpoint,accessToken,}:CommerceLayerConfig):ReturnType<typeof Sdk>;
|
package/lib/utils/getSkus.d.ts
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare const getSkus: (skus: Sku[], sortBy: string[]) => Record<string, any>;
|
|
3
|
-
export default getSkus;
|
|
1
|
+
import{Sku}from'@commercelayer/sdk';declare const getSkus:(skus:Sku[],sortBy:string[])=>Record<string,any>;export default getSkus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useExternalScript(url:
|
|
1
|
+
export default function useExternalScript(url:string):boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isEmptyStates(countryCode:
|
|
1
|
+
export default function isEmptyStates(countryCode:string):boolean;
|
package/lib/utils/isJSON.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isJSON(str:
|
|
1
|
+
export default function isJSON(str:string):boolean;
|
package/lib/utils/jwt.d.ts
CHANGED
|
@@ -1,27 +1 @@
|
|
|
1
|
-
declare type JWT
|
|
2
|
-
application: {
|
|
3
|
-
id: string;
|
|
4
|
-
kind: 'sales_channel' | 'integration';
|
|
5
|
-
public: boolean;
|
|
6
|
-
};
|
|
7
|
-
exp: number;
|
|
8
|
-
market: {
|
|
9
|
-
id: string[];
|
|
10
|
-
price_list_id: string;
|
|
11
|
-
stock_location_ids: string[];
|
|
12
|
-
geocoder_id: null | string;
|
|
13
|
-
allows_external_prices: boolean;
|
|
14
|
-
};
|
|
15
|
-
organization: {
|
|
16
|
-
id: string;
|
|
17
|
-
slug: string;
|
|
18
|
-
};
|
|
19
|
-
owner: {
|
|
20
|
-
id: 'gOqzZhZrmQ';
|
|
21
|
-
type: 'Customer';
|
|
22
|
-
};
|
|
23
|
-
rand: number;
|
|
24
|
-
test: boolean;
|
|
25
|
-
};
|
|
26
|
-
export default function jwt(accessToken: string): JWT;
|
|
27
|
-
export {};
|
|
1
|
+
declare type JWT={application:{id:string;kind:'sales_channel'|'integration';public:boolean;};exp:number;market:{id:string[];price_list_id:string;stock_location_ids:string[];geocoder_id:null|string;allows_external_prices:boolean;};organization:{id:string;slug:string;};owner:{id:'gOqzZhZrmQ';type:'Customer';};rand:number;test:boolean;};export default function jwt(accessToken:string):JWT;export{};
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
export interface GetLocalOrder {
|
|
2
|
-
(key: string): string | null;
|
|
3
|
-
}
|
|
4
|
-
export declare const getLocalOrder: GetLocalOrder;
|
|
5
|
-
export interface SetLocalOrder {
|
|
6
|
-
(key: string, value: string): void;
|
|
7
|
-
}
|
|
8
|
-
export declare const setLocalOrder: SetLocalOrder;
|
|
9
|
-
export interface DeleteLocalOrder {
|
|
10
|
-
(key: string): void;
|
|
11
|
-
}
|
|
12
|
-
export declare const deleteLocalOrder: DeleteLocalOrder;
|
|
13
|
-
export declare const getSavePaymentSourceToCustomerWallet: () => boolean;
|
|
14
|
-
export declare const getSaveBillingAddressToAddressBook: () => boolean;
|
|
15
|
-
export declare const getSaveShippingAddressToAddressBook: () => boolean;
|
|
16
|
-
export declare type CustomerOrderParams = '_save_payment_source_to_customer_wallet' | '_save_billing_address_to_customer_address_book' | '_save_shipping_address_to_customer_address_book';
|
|
17
|
-
export declare function setCustomerOrderParam<T extends CustomerOrderParams>(key: T, value: string): void;
|
|
1
|
+
export interface GetLocalOrder{(key:string):string|null;}export declare const getLocalOrder:GetLocalOrder;export interface SetLocalOrder{(key:string,value:string):void;}export declare const setLocalOrder:SetLocalOrder;export interface DeleteLocalOrder{(key:string):void;}export declare const deleteLocalOrder:DeleteLocalOrder;export declare const getSavePaymentSourceToCustomerWallet:()=>boolean;export declare const getSaveBillingAddressToAddressBook:()=>boolean;export declare const getSaveShippingAddressToAddressBook:()=>boolean;export declare type CustomerOrderParams='_save_payment_source_to_customer_wallet'|'_save_billing_address_to_customer_address_book'|'_save_shipping_address_to_customer_address_book';export declare function setCustomerOrderParam<T extends CustomerOrderParams>(key:T,value:string):void;
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
declare type ReturnObj
|
|
2
|
-
organization: string;
|
|
3
|
-
domain: string;
|
|
4
|
-
};
|
|
5
|
-
export default function getOrganizationSlug<E extends string>(endpoint: E): ReturnObj;
|
|
6
|
-
export {};
|
|
1
|
+
declare type ReturnObj={organization:string;domain:string;};export default function getOrganizationSlug<E extends string>(endpoint:E):ReturnObj;export{};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PaymentResource, PaymentMethodConfig } from '../reducers/PaymentMethodReducer';
|
|
3
|
-
export default function getPaypalConfig(paymentResource: PaymentResource, config: PaymentMethodConfig): Pick<PaypalConfig, 'return_url' | 'cancel_url'> | undefined;
|
|
1
|
+
import{PaypalConfig}from'../components/PaypalPayment';import{PaymentResource,PaymentMethodConfig}from'../reducers/PaymentMethodReducer';export default function getPaypalConfig(paymentResource:PaymentResource,config:PaymentMethodConfig):Pick<PaypalConfig,'return_url'|'cancel_url'>|undefined;
|
package/lib/utils/promisify.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function promisify(cb:
|
|
1
|
+
export default function promisify(cb:any,params?:any):Promise<any>;
|
package/lib/utils/shipments.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function shipmentsFilled(shipments: Shipment[]): boolean;
|
|
1
|
+
import{Shipment}from'@commercelayer/sdk';export declare function shipmentsFilled(shipments:Shipment[]):boolean;
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ResourceErrorType, BaseError } from '../typings/errors';
|
|
3
|
-
import { AddressField } from '../reducers/AddressReducer';
|
|
4
|
-
import { AddressCreate } from '@commercelayer/sdk';
|
|
5
|
-
import { AddressInputName } from '../typings/index';
|
|
6
|
-
export interface ValidateFormFields {
|
|
7
|
-
<R extends string[]>(fields: HTMLFormControlsCollection, required: R, resourceType: ResourceErrorType): {
|
|
8
|
-
errors: BaseError[];
|
|
9
|
-
values: BaseState;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export interface ValidateValue {
|
|
13
|
-
<V extends string | boolean, N extends string, T extends string, B extends ResourceErrorType>(val: V, name: N, type: T, resourceType: B): BaseError | Record<string, any>;
|
|
14
|
-
}
|
|
15
|
-
export declare const validateValue: ValidateValue;
|
|
16
|
-
declare const validateFormFields: ValidateFormFields;
|
|
17
|
-
export interface FieldsExist {
|
|
18
|
-
(address: AddressCreate, schema?: AddressField[]): boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare const fieldsExist: FieldsExist;
|
|
21
|
-
export declare function businessMandatoryField(fieldName: AddressInputName, isBusiness?: boolean): boolean;
|
|
22
|
-
export default validateFormFields;
|
|
1
|
+
import{BaseState}from'../typings/index';import{ResourceErrorType,BaseError}from'../typings/errors';import{AddressField}from'../reducers/AddressReducer';import{AddressCreate}from'@commercelayer/sdk';import{AddressInputName}from'../typings/index';export interface ValidateFormFields{<R extends string[]>(fields:HTMLFormControlsCollection,required:R,resourceType:ResourceErrorType):{errors:BaseError[];values:BaseState;};}export interface ValidateValue{<V extends string|boolean,N extends string,T extends string,B extends ResourceErrorType>(val:V,name:N,type:T,resourceType:B):BaseError|Record<string,any>;}export declare const validateValue:ValidateValue;declare const validateFormFields:ValidateFormFields;export interface FieldsExist{(address:AddressCreate,schema?:AddressField[]):boolean;}export declare const fieldsExist:FieldsExist;export declare function businessMandatoryField(fieldName:AddressInputName,isBusiness?:boolean):boolean;export default validateFormFields;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/react-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "The Official Commerce Layer React Components",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"coverage:report": "nyc report --reporter=html",
|
|
50
50
|
"lint": "eslint src",
|
|
51
51
|
"build": "tsc -b tsconfig.prod.json --verbose",
|
|
52
|
-
"postbuild": "tsc-alias -p tsconfig.prod.json && minimize-js lib -w -s",
|
|
52
|
+
"postbuild": "tsc-alias -p tsconfig.prod.json && minimize-js lib -w -s -d",
|
|
53
53
|
"start": "NODE_OPTIONS='--inspect' next dev",
|
|
54
54
|
"version:fix": "npm version patch",
|
|
55
55
|
"version:feat": "npm version minor",
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
},
|
|
82
82
|
"homepage": "https://github.com/commercelayer/commercelayer-react-components#readme",
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@ac-dev/countries-service": "^1.
|
|
84
|
+
"@ac-dev/countries-service": "^1.2.0",
|
|
85
85
|
"@ac-dev/states-service": "^1.0.3",
|
|
86
|
-
"@adyen/adyen-web": "^5.
|
|
86
|
+
"@adyen/adyen-web": "^5.9.0",
|
|
87
87
|
"@commercelayer/js-auth": "^3.0.0",
|
|
88
88
|
"@commercelayer/sdk": "^3.5.0",
|
|
89
89
|
"@stripe/react-stripe-js": "^1.7.0",
|
|
90
|
-
"@stripe/stripe-js": "^1.
|
|
90
|
+
"@stripe/stripe-js": "^1.24.0",
|
|
91
91
|
"axios": "^0.26.0",
|
|
92
92
|
"braintree-web": "^3.85.2",
|
|
93
93
|
"frames-react": "^1.0.3",
|
|
@@ -101,26 +101,26 @@
|
|
|
101
101
|
"@babel/preset-env": "^7.16.11",
|
|
102
102
|
"@babel/preset-react": "^7.16.7",
|
|
103
103
|
"@babel/preset-typescript": "^7.16.7",
|
|
104
|
-
"@playwright/test": "^1.19.
|
|
104
|
+
"@playwright/test": "^1.19.2",
|
|
105
105
|
"@semantic-release/changelog": "^6.0.1",
|
|
106
106
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
107
107
|
"@semantic-release/git": "^10.0.1",
|
|
108
108
|
"@semantic-release/github": "^8.0.2",
|
|
109
|
-
"@semantic-release/npm": "^9.0.
|
|
109
|
+
"@semantic-release/npm": "^9.0.1",
|
|
110
110
|
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
111
111
|
"@tailwindcss/aspect-ratio": "^0.4.0",
|
|
112
|
-
"@tailwindcss/forms": "^0.
|
|
112
|
+
"@tailwindcss/forms": "^0.5.0",
|
|
113
113
|
"@tailwindcss/line-clamp": "^0.3.1",
|
|
114
114
|
"@tailwindcss/typography": "^0.5.2",
|
|
115
|
-
"@types/braintree-web": "^3.75.
|
|
115
|
+
"@types/braintree-web": "^3.75.18",
|
|
116
116
|
"@types/jest": "^27.4.1",
|
|
117
|
-
"@types/lodash": "^4.14.
|
|
117
|
+
"@types/lodash": "^4.14.179",
|
|
118
118
|
"@types/node": "^17.0.21",
|
|
119
119
|
"@types/prop-types": "^15.7.4",
|
|
120
120
|
"@types/react": "^17.0.39",
|
|
121
121
|
"@types/react-test-renderer": "^17.0.1",
|
|
122
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
123
|
-
"@typescript-eslint/parser": "^5.
|
|
122
|
+
"@typescript-eslint/eslint-plugin": "^5.13.0",
|
|
123
|
+
"@typescript-eslint/parser": "^5.13.0",
|
|
124
124
|
"@zeit/next-css": "^1.0.1",
|
|
125
125
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
126
126
|
"autoprefixer": "^10.4.2",
|
|
@@ -128,17 +128,17 @@
|
|
|
128
128
|
"babel-loader": "^8.2.3",
|
|
129
129
|
"babel-plugin-istanbul": "^6.1.1",
|
|
130
130
|
"dotenv": "^16.0.0",
|
|
131
|
-
"eslint": "^8.
|
|
132
|
-
"eslint-config-prettier": "^8.
|
|
131
|
+
"eslint": "^8.10.0",
|
|
132
|
+
"eslint-config-prettier": "^8.5.0",
|
|
133
133
|
"eslint-config-react-app": "^7.0.0",
|
|
134
|
-
"eslint-plugin-react": "^7.
|
|
134
|
+
"eslint-plugin-react": "^7.29.3",
|
|
135
135
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
136
136
|
"jest": "^27.5.1",
|
|
137
|
-
"minimize-js": "^1.
|
|
137
|
+
"minimize-js": "^1.3.0",
|
|
138
138
|
"next": "^12.1.0",
|
|
139
139
|
"nyc": "^15.1.0",
|
|
140
|
-
"playwright": "^1.19.
|
|
141
|
-
"postcss": "^8.4.
|
|
140
|
+
"playwright": "^1.19.2",
|
|
141
|
+
"postcss": "^8.4.8",
|
|
142
142
|
"postcss-loader": "^6.2.1",
|
|
143
143
|
"prettier": "^2.5.1",
|
|
144
144
|
"prop-types": "^15.8.1",
|
|
@@ -149,11 +149,11 @@
|
|
|
149
149
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
150
150
|
"tailwindcss": "^3.0.23",
|
|
151
151
|
"ts-jest": "^27.1.3",
|
|
152
|
-
"ts-loader": "^9.2.
|
|
153
|
-
"tsc-alias": "^1.6.
|
|
152
|
+
"ts-loader": "^9.2.7",
|
|
153
|
+
"tsc-alias": "^1.6.4",
|
|
154
154
|
"tsconfig-paths-jest": "^0.0.1",
|
|
155
155
|
"ttypescript": "^1.5.13",
|
|
156
|
-
"typescript": "^4.
|
|
156
|
+
"typescript": "^4.6.2",
|
|
157
157
|
"v8-to-istanbul": "^8.1.1"
|
|
158
158
|
},
|
|
159
159
|
"peerDependencies": {
|