@commercelayer/app-elements 6.13.0 → 7.0.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/dist/{CodeEditorComponent-C0zWE596.js → CodeEditorComponent-C7Kbv687.js} +2 -2
- package/dist/{InputDateComponent-EVLNpuLJ.js → InputDateComponent-B1WjYtNB.js} +24 -12
- package/dist/{RuleEngineComponent-DaWdtyvW.js → RuleEngineComponent-D4oySlHj.js} +3 -3
- package/dist/{en-BbX2gWkK.js → en-CcBUYKzR.js} +4 -1
- package/dist/{fetchCoreResourcesSuggestions-B5f9Xxce.js → fetchCoreResourcesSuggestions-Cn5ddteq.js} +1 -1
- package/dist/helpers/shipments.d.ts +2 -0
- package/dist/helpers/shipments.test.d.ts +1 -0
- package/dist/{it-P4oHwKfI.js → it-y1Q1-MMT.js} +4 -1
- package/dist/locales/en.d.ts +3 -0
- package/dist/{main-DvAINdw0.js → main-B8q4zWB1.js} +7069 -6995
- package/dist/main.d.ts +2 -0
- package/dist/main.js +61 -59
- package/dist/mocks/server.d.ts +1 -1
- package/dist/{parseISO-Cas2hmx2.js → parseISO-Cchp4I6z.js} +1 -1
- package/dist/providers/TokenProvider/reducer.d.ts +2 -2
- package/dist/providers/TokenProvider/types.d.ts +1 -1
- package/dist/providers/TokenProvider/validateToken.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/tailwind.global.css +3 -3
- package/dist/ui/atoms/Icon/icons.d.ts +2 -0
- package/dist/ui/composite/Dropdown/DropdownMenu.d.ts +4 -1
- package/dist/ui/internals/InteractiveElement.className.d.ts +2 -1
- package/dist/ui/resources/ResourceLineItems/ResourceLineItems.mocks.d.ts +2 -0
- package/dist/ui/resources/ResourceListItem/ResourceListItem.d.ts +11 -1
- package/dist/ui/resources/ResourceListItem/ResourceListItem.mocks.d.ts +43 -0
- package/dist/ui/resources/useResourceList/useResourceList.d.ts +8 -1
- package/dist/ui/resources/useTrackingDetails.d.ts +6 -0
- package/package.json +24 -22
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
1
2
|
import { ListItemProps } from '../../composite/ListItem';
|
|
2
3
|
import { ResourceListItemType } from './types';
|
|
3
4
|
export interface ResourceListItemProps {
|
|
@@ -17,6 +18,10 @@ export interface ResourceListItemProps {
|
|
|
17
18
|
* Optional setting to show right content, if available, instead of right arrow
|
|
18
19
|
*/
|
|
19
20
|
showRightContent?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Optional override for the right slot. When provided, it replaces any computed right content.
|
|
23
|
+
*/
|
|
24
|
+
rightContentOverride?: JSX.Element | null;
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* This component generates a list item based on the requested resource data and type.
|
|
@@ -25,7 +30,12 @@ export declare const ResourceListItem: import('../../atoms/SkeletonTemplate').Sk
|
|
|
25
30
|
resource: ResourceListItemType;
|
|
26
31
|
href?: string | undefined;
|
|
27
32
|
onClick?: (import('react').MouseEventHandler<HTMLElement> & import('react').MouseEventHandler<HTMLAnchorElement>) | undefined;
|
|
28
|
-
showRightContent?: boolean
|
|
33
|
+
showRightContent?: boolean
|
|
34
|
+
/**
|
|
35
|
+
* Optional override for the right slot. When provided, it replaces any computed right content.
|
|
36
|
+
*/
|
|
37
|
+
| undefined;
|
|
38
|
+
rightContentOverride?: (JSX.Element | null) | undefined;
|
|
29
39
|
delayMs?: number | undefined;
|
|
30
40
|
isLoading?: boolean | undefined;
|
|
31
41
|
}>;
|
|
@@ -718,6 +718,49 @@ export declare const presetResourceListItem: {
|
|
|
718
718
|
readonly updated_at: "";
|
|
719
719
|
readonly shared_secret: "";
|
|
720
720
|
};
|
|
721
|
+
stock_transfers: never[];
|
|
722
|
+
};
|
|
723
|
+
shipmentStockTransferCancelled: {
|
|
724
|
+
type: "shipments";
|
|
725
|
+
id: string;
|
|
726
|
+
created_at: string;
|
|
727
|
+
updated_at: string;
|
|
728
|
+
number: string;
|
|
729
|
+
status: "on_hold";
|
|
730
|
+
stock_location: {
|
|
731
|
+
readonly type: "stock_locations";
|
|
732
|
+
readonly id: "";
|
|
733
|
+
readonly name: "US Warehouse";
|
|
734
|
+
readonly created_at: "";
|
|
735
|
+
readonly updated_at: "";
|
|
736
|
+
};
|
|
737
|
+
shipping_method: {
|
|
738
|
+
readonly type: "shipping_methods";
|
|
739
|
+
readonly id: "";
|
|
740
|
+
readonly name: "Standard Shipping";
|
|
741
|
+
readonly price_amount_cents: 0;
|
|
742
|
+
readonly created_at: "";
|
|
743
|
+
readonly updated_at: "";
|
|
744
|
+
readonly shared_secret: "";
|
|
745
|
+
};
|
|
746
|
+
stock_transfers: {
|
|
747
|
+
id: string;
|
|
748
|
+
type: "stock_transfers";
|
|
749
|
+
number: string;
|
|
750
|
+
sku_code: string;
|
|
751
|
+
status: "cancelled";
|
|
752
|
+
quantity: number;
|
|
753
|
+
on_hold_at: null;
|
|
754
|
+
picking_at: null;
|
|
755
|
+
in_transit_at: null;
|
|
756
|
+
completed_at: null;
|
|
757
|
+
cancelled_at: string;
|
|
758
|
+
created_at: string;
|
|
759
|
+
updated_at: string;
|
|
760
|
+
reference: null;
|
|
761
|
+
reference_origin: null;
|
|
762
|
+
metadata: {};
|
|
763
|
+
}[];
|
|
721
764
|
};
|
|
722
765
|
shipmentShipped: {
|
|
723
766
|
type: "shipments";
|
|
@@ -70,6 +70,13 @@ export type UseResourceListConfig<TResource extends ListableResourceType> = {
|
|
|
70
70
|
};
|
|
71
71
|
filter: Record<string, unknown>;
|
|
72
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Optional function to process the fetched resource list client-side before rendering.
|
|
75
|
+
* It receives the full list returned by the API and must return the processed list.
|
|
76
|
+
* Useful for client-side filtering or sorting that cannot be expressed via the API query.
|
|
77
|
+
* Affects both the `list` value returned by the hook and what is rendered by `<ResourceList>`.
|
|
78
|
+
*/
|
|
79
|
+
preProcess?: (list: Array<Resource<TResource>>) => Array<Resource<TResource>>;
|
|
73
80
|
/**
|
|
74
81
|
* Pagination type: 'infinite' for infinite scrolling (default), 'pagination' for classic prev/next pagination.
|
|
75
82
|
* Note: 'pagination' mode is only supported for Core API (not Metrics API).
|
|
@@ -88,7 +95,7 @@ export type UseResourceListConfig<TResource extends ListableResourceType> = {
|
|
|
88
95
|
interface UseResourceListReturn<TResource extends ListableResourceType> {
|
|
89
96
|
/** The component that renders the list with infinite scrolling or pagination functionality */
|
|
90
97
|
ResourceList: FC<ResourceListProps<TResource>>;
|
|
91
|
-
/** The
|
|
98
|
+
/** The array of resources to display. When `preProcess` is provided, this is the processed result; otherwise it is the raw fetched data, which grows each time a new page is fetched (infinite mode) or shows current page only (pagination mode) */
|
|
92
99
|
list?: Array<Resource<TResource>>;
|
|
93
100
|
/** Metadata related to pagination, as returned by the SDK */
|
|
94
101
|
meta?: ListMeta;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Parcel as ParcelResource } from '@commercelayer/sdk';
|
|
2
|
+
import { Rate } from '../../helpers/tracking';
|
|
3
|
+
export declare const useTrackingDetails: (parcel: ParcelResource, rate?: Rate) => {
|
|
4
|
+
TrackingDetailsModal: () => false | import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
openTrackingDetails: () => void;
|
|
6
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/app-elements",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -31,25 +31,25 @@
|
|
|
31
31
|
"url": "https://github.com/commercelayer/app-elements"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": "
|
|
35
|
-
"pnpm": "
|
|
34
|
+
"node": "22",
|
|
35
|
+
"pnpm": "10"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@commercelayer/js-auth": "^7.
|
|
39
|
-
"@commercelayer/sdk": "6.
|
|
38
|
+
"@commercelayer/js-auth": "^7.4.1",
|
|
39
|
+
"@commercelayer/sdk": "^6.57.0",
|
|
40
40
|
"@date-fns/tz": "^1.4.1",
|
|
41
|
-
"@monaco-editor/react": "4.7.0",
|
|
41
|
+
"@monaco-editor/react": "~4.7.0",
|
|
42
42
|
"@types/lodash-es": "^4.17.12",
|
|
43
43
|
"@types/react": "19.2.13",
|
|
44
44
|
"@types/react-datepicker": "^7.0.0",
|
|
45
45
|
"@types/react-dom": "19.2.3",
|
|
46
46
|
"classnames": "^2.5.1",
|
|
47
|
-
"i18next": "^25.
|
|
47
|
+
"i18next": "^25.10.10",
|
|
48
48
|
"i18next-resources-to-backend": "^1.2.1",
|
|
49
49
|
"js-cookie": "^3.0.5",
|
|
50
50
|
"jwt-decode": "^4.0.0",
|
|
51
|
-
"lodash-es": "^4.
|
|
52
|
-
"monaco-editor": "0.53.0",
|
|
51
|
+
"lodash-es": "^4.18.1",
|
|
52
|
+
"monaco-editor": "~0.53.0",
|
|
53
53
|
"pluralize": "^8.0.0",
|
|
54
54
|
"query-string": "^9.3.1",
|
|
55
55
|
"react": "19.2.4",
|
|
@@ -60,34 +60,34 @@
|
|
|
60
60
|
"react-i18next": "^15.7.4",
|
|
61
61
|
"react-select": "^5.10.2",
|
|
62
62
|
"react-toastify": "^11.0.5",
|
|
63
|
-
"react-tooltip": "^5.30.
|
|
64
|
-
"swr": "^2.4.
|
|
63
|
+
"react-tooltip": "^5.30.1",
|
|
64
|
+
"swr": "^2.4.1",
|
|
65
65
|
"ts-invariant": "^0.10.3",
|
|
66
|
-
"type-fest": "^5.
|
|
66
|
+
"type-fest": "^5.5.0",
|
|
67
67
|
"zod": "^3.25.76"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@hookform/resolvers": "^3.10.0",
|
|
71
|
-
"@phosphor-icons/react": "
|
|
71
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
72
72
|
"@tailwindcss/forms": "^0.5.11",
|
|
73
|
-
"@tailwindcss/postcss": "^4.2.
|
|
73
|
+
"@tailwindcss/postcss": "^4.2.2",
|
|
74
74
|
"@testing-library/jest-dom": "^6.9.1",
|
|
75
75
|
"@testing-library/react": "^16.3.2",
|
|
76
76
|
"@types/js-cookie": "^3.0.6",
|
|
77
|
-
"@types/node": "^
|
|
77
|
+
"@types/node": "^22.19.17",
|
|
78
78
|
"@types/pluralize": "^0.0.33",
|
|
79
79
|
"@types/react-gtm-module": "^2.0.4",
|
|
80
|
-
"@vitejs/plugin-react": "^5.
|
|
80
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
81
81
|
"cross-fetch": "^4.1.0",
|
|
82
82
|
"date-fns": "^4.1.0",
|
|
83
83
|
"date-fns-tz": "^3.2.0",
|
|
84
84
|
"jsdom": "^27.4.0",
|
|
85
|
-
"msw": "^2.
|
|
86
|
-
"postcss": "^8.5.
|
|
85
|
+
"msw": "^2.13.3",
|
|
86
|
+
"postcss": "^8.5.9",
|
|
87
87
|
"react-gtm-module": "^2.0.11",
|
|
88
|
-
"tailwindcss": "^4.2.
|
|
89
|
-
"typescript": "
|
|
90
|
-
"vite": "^7.3.
|
|
88
|
+
"tailwindcss": "^4.2.2",
|
|
89
|
+
"typescript": "^5.9.3",
|
|
90
|
+
"vite": "^7.3.2",
|
|
91
91
|
"vite-plugin-dts": "^4.5.4",
|
|
92
92
|
"vitest": "^3.2.4",
|
|
93
93
|
"wouter": "^3.9.0"
|
|
@@ -105,8 +105,10 @@
|
|
|
105
105
|
"build": "tsc && vite build && pnpm build:css-vendor && pnpm build:tailwind-cfg",
|
|
106
106
|
"build:tailwind-cfg": "cp ./src/styles/global.css ./dist/tailwind.global.css",
|
|
107
107
|
"build:css-vendor": "pnpm dlx @tailwindcss/cli -i ./src/styles/vendor.css -o ./dist/vendor.css --minify",
|
|
108
|
-
"
|
|
108
|
+
"check": "pnpm biome check",
|
|
109
|
+
"check:fix": "pnpm biome check --write",
|
|
109
110
|
"test": "vitest run",
|
|
111
|
+
"test:update": "vitest run --update",
|
|
110
112
|
"test:watch": "vitest",
|
|
111
113
|
"ts:check": "tsc --noEmit",
|
|
112
114
|
"generate:schema.order_rules": "curl -s https://core.commercelayer.io/api/public/schemas/order_rules | pnpx json-schema-to-typescript > ./src/ui/forms/RuleEngine/schema.order_rules.ts",
|