@commercelayer/react-components 4.13.1-beta.1 → 4.13.1-beta.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.
@@ -1,4 +1,5 @@
1
1
  import { type LoaderType } from '../../typings/index';
2
+ import { type QueryPageSize } from '@commercelayer/sdk';
2
3
  interface Props {
3
4
  /**
4
5
  * Any valid JSX.Element(s).
@@ -17,7 +18,7 @@ interface Props {
17
18
  /**
18
19
  * Prices per page to be fetched
19
20
  */
20
- perPage?: number;
21
+ perPage?: QueryPageSize;
21
22
  /**
22
23
  * SKU code to fetch the prices for. If not provided, the `sku_code` will be retrieved from the `<Price>` component(s) nested as children.
23
24
  */
@@ -1,9 +1,8 @@
1
1
  import { type Dispatch } from 'react';
2
2
  import { type BaseError } from '../typings/errors';
3
- import type { Address, AddressCreate, AddressUpdate, Customer, CustomerPaymentSource, Order, OrderSubscription } from '@commercelayer/sdk';
3
+ import type { Address, AddressCreate, AddressUpdate, Customer, CustomerPaymentSource, ListResponse, Order, OrderSubscription, QueryPageSize } from '@commercelayer/sdk';
4
4
  import { type CommerceLayerConfig } from '../context/CommerceLayerContext';
5
5
  import { type updateOrder } from './OrderReducer';
6
- import { type ListResponse } from '@commercelayer/sdk/lib/cjs/resource';
7
6
  import { type TriggerAttributeHelper } from '../utils/triggerAttributeHelper';
8
7
  export type CustomerActionType = 'setErrors' | 'setCustomerEmail' | 'setAddresses' | 'setPayments' | 'setOrders' | 'setSubscriptions' | 'setCustomers';
9
8
  export interface CustomerActionPayload {
@@ -112,7 +111,7 @@ interface GetCustomerOrdersProps {
112
111
  /**
113
112
  * The page size
114
113
  */
115
- pageSize?: number;
114
+ pageSize?: QueryPageSize;
116
115
  /**
117
116
  * The page number
118
117
  */
@@ -160,7 +159,7 @@ export type SetResourceTriggerParams = {
160
159
  /**
161
160
  * The page size
162
161
  */
163
- pageSize?: number;
162
+ pageSize?: QueryPageSize;
164
163
  /**
165
164
  * The page number
166
165
  */
@@ -1,5 +1,5 @@
1
1
  import { type BaseAction, type LoaderType } from '../typings/index';
2
- import { type Price } from '@commercelayer/sdk';
2
+ import { type QueryPageSize, type Price } from '@commercelayer/sdk';
3
3
  import { type CommerceLayerConfig } from '../context/CommerceLayerContext';
4
4
  import { type Dispatch } from 'react';
5
5
  import { type BaseError } from '../typings/errors';
@@ -25,7 +25,7 @@ export declare function setSkuCodes({ skuCodes, dispatch }: {
25
25
  export declare function getSkusPrice(skuCodes: SkuCodesPrice, { config, dispatch, perPage, filters }: {
26
26
  config: CommerceLayerConfig;
27
27
  dispatch: Dispatch<PriceAction>;
28
- perPage: number;
28
+ perPage: QueryPageSize;
29
29
  filters: Record<string, any>;
30
30
  }): void;
31
31
  export type UnsetPriceState = (dispatch: Dispatch<PriceAction>) => void;
@@ -1,4 +1,5 @@
1
1
  import { type LoaderType } from '../../typings/index';
2
+ import { type QueryPageSize } from '@commercelayer/sdk';
2
3
  interface Props {
3
4
  /**
4
5
  * Any valid JSX.Element(s).
@@ -17,7 +18,7 @@ interface Props {
17
18
  /**
18
19
  * Prices per page to be fetched
19
20
  */
20
- perPage?: number;
21
+ perPage?: QueryPageSize;
21
22
  /**
22
23
  * SKU code to fetch the prices for. If not provided, the `sku_code` will be retrieved from the `<Price>` component(s) nested as children.
23
24
  */
@@ -1,9 +1,8 @@
1
1
  import { type Dispatch } from 'react';
2
2
  import { type BaseError } from '../typings/errors';
3
- import type { Address, AddressCreate, AddressUpdate, Customer, CustomerPaymentSource, Order, OrderSubscription } from '@commercelayer/sdk';
3
+ import type { Address, AddressCreate, AddressUpdate, Customer, CustomerPaymentSource, ListResponse, Order, OrderSubscription, QueryPageSize } from '@commercelayer/sdk';
4
4
  import { type CommerceLayerConfig } from '../context/CommerceLayerContext';
5
5
  import { type updateOrder } from './OrderReducer';
6
- import { type ListResponse } from '@commercelayer/sdk/lib/cjs/resource';
7
6
  import { type TriggerAttributeHelper } from '../utils/triggerAttributeHelper';
8
7
  export type CustomerActionType = 'setErrors' | 'setCustomerEmail' | 'setAddresses' | 'setPayments' | 'setOrders' | 'setSubscriptions' | 'setCustomers';
9
8
  export interface CustomerActionPayload {
@@ -112,7 +111,7 @@ interface GetCustomerOrdersProps {
112
111
  /**
113
112
  * The page size
114
113
  */
115
- pageSize?: number;
114
+ pageSize?: QueryPageSize;
116
115
  /**
117
116
  * The page number
118
117
  */
@@ -160,7 +159,7 @@ export type SetResourceTriggerParams = {
160
159
  /**
161
160
  * The page size
162
161
  */
163
- pageSize?: number;
162
+ pageSize?: QueryPageSize;
164
163
  /**
165
164
  * The page number
166
165
  */
@@ -1,5 +1,5 @@
1
1
  import { type BaseAction, type LoaderType } from '../typings/index';
2
- import { type Price } from '@commercelayer/sdk';
2
+ import { type QueryPageSize, type Price } from '@commercelayer/sdk';
3
3
  import { type CommerceLayerConfig } from '../context/CommerceLayerContext';
4
4
  import { type Dispatch } from 'react';
5
5
  import { type BaseError } from '../typings/errors';
@@ -25,7 +25,7 @@ export declare function setSkuCodes({ skuCodes, dispatch }: {
25
25
  export declare function getSkusPrice(skuCodes: SkuCodesPrice, { config, dispatch, perPage, filters }: {
26
26
  config: CommerceLayerConfig;
27
27
  dispatch: Dispatch<PriceAction>;
28
- perPage: number;
28
+ perPage: QueryPageSize;
29
29
  filters: Record<string, any>;
30
30
  }): void;
31
31
  export type UnsetPriceState = (dispatch: Dispatch<PriceAction>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/react-components",
3
- "version": "4.13.1-beta.1",
3
+ "version": "4.13.1-beta.2",
4
4
  "description": "The Official Commerce Layer React Components",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -167,7 +167,7 @@
167
167
  "dependencies": {
168
168
  "@adyen/adyen-web": "^5.58.0",
169
169
  "@commercelayer/organization-config": "^1.4.5",
170
- "@commercelayer/sdk": "^5.36.0",
170
+ "@commercelayer/sdk": "6.0.0-rc.2",
171
171
  "@stripe/react-stripe-js": "^2.4.0",
172
172
  "@stripe/stripe-js": "^3.0.5",
173
173
  "@tanstack/react-table": "^8.11.8",