@commercelayer/app-elements 2.5.0 → 2.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/dist/{InputDateComponent-CtfCh91N.js → InputDateComponent-BM05fdrS.js} +1 -1
- package/dist/{main-DP8baJX-.js → main-55uQIndh.js} +3985 -3976
- package/dist/main.js +1 -1
- package/dist/providers/TokenProvider/types.d.ts +3 -3
- package/dist/ui/resources/ResourceList/ResourceList.d.ts +2 -2
- package/dist/ui/resources/ResourceList/infiniteFetcher.d.ts +2 -2
- package/dist/ui/resources/useResourceFilters/FiltersNav.d.ts +6 -1
- package/dist/ui/resources/useResourceFilters/FiltersSearchBar.d.ts +6 -1
- package/dist/ui/resources/useResourceFilters/useResourceFilters.d.ts +1 -1
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { aD as s, bh as t, aE as o, aF as r, aG as n, aH as c, aI as u, aJ as i, aK as l, aL as p, bi as d, aM as b, aN as g, aO as S, as as m, bj as I, bk as k, bl as D, bm as T, aP as R, aw as y, ax as h, bw as C, aQ as A, aR as H, bn as F, bE as P, bF as f, bH as v, bJ as B, bL as O, bP as G, bR as L, bW as N, bY as w, b$ as E, c6 as x, c8 as V, ca as M, cc as W, ce as J, ci as U, cj as Y, ck as j, aS as q, aT as z, bG as K, bI as X, bK as Z, bM as _, bO as $, bQ as Q, bS as aa, bT as ea, bU as sa, bV as ta, bX as oa, bZ as ra, c0 as na, c7 as ca, c9 as ua, cb as ia, cd as la, cf as pa, cg as da, ch as ba, bo as ga, bp as Sa, bq as ma, br as Ia, az as ka, bs as Da, aU as Ta, bt as Ra, bu as ya, aV as ha, aW as Ca, aX as Aa, aY as Ha, bv as Fa, cn as Pa, co as fa, cr as va, cs as Ba, ct as Oa, cu as Ga, cv as La, cw as Na, cx as wa, bx as Ea, aZ as xa, bA as Va, a_ as Ma, a$ as Wa, b0 as Ja, b1 as Ua, b3 as Ya, b4 as ja, b5 as qa, b6 as za, b7 as Ka, bc as Xa, b8 as Za, bB as _a, bd as $a, be as Qa, b9 as ae, bf as ee, ba as se, bC as te, aA as oe, bD as re, bg as ne, bb as ce, aa as ue, av as ie, by as le, bz as pe, Z as de, _ as be, a9 as ge, aB as Se, c1 as me, bN as Ie, $ as ke, a0 as De, a1 as Te, ab as Re, ac as ye, ad as he, cz as Ce, cA as Ae, c2 as He, a2 as Fe, a3 as Pe, a4 as fe, cB as ve, cC as Be, cD as Oe, cE as Ge, cF as Le, ae as Ne, af as we, cG as Ee, cH as xe, cI as Ve, cJ as Me, ag as We, ah as Je, cK as Ue, cL as Ye, cM as je, ak as qe, al as ze, V as Ke, ai as Xe, aj as Ze, X as _e, c3 as $e, c4 as Qe, c5 as as, a5 as es, W as ss, Y as ts, a6 as os, cp as rs, cl as ns, a7 as cs, a8 as us, am as is, at as ls, au as ps, an as ds, ao as bs, b_ as gs, ap as Ss, aq as ms, ar as Is, cq as ks, cy as Ds, ay as Ts, aC as Rs, cm as ys, b2 as hs } from "./main-
|
|
2
|
+
import { aD as s, bh as t, aE as o, aF as r, aG as n, aH as c, aI as u, aJ as i, aK as l, aL as p, bi as d, aM as b, aN as g, aO as S, as as m, bj as I, bk as k, bl as D, bm as T, aP as R, aw as y, ax as h, bw as C, aQ as A, aR as H, bn as F, bE as P, bF as f, bH as v, bJ as B, bL as O, bP as G, bR as L, bW as N, bY as w, b$ as E, c6 as x, c8 as V, ca as M, cc as W, ce as J, ci as U, cj as Y, ck as j, aS as q, aT as z, bG as K, bI as X, bK as Z, bM as _, bO as $, bQ as Q, bS as aa, bT as ea, bU as sa, bV as ta, bX as oa, bZ as ra, c0 as na, c7 as ca, c9 as ua, cb as ia, cd as la, cf as pa, cg as da, ch as ba, bo as ga, bp as Sa, bq as ma, br as Ia, az as ka, bs as Da, aU as Ta, bt as Ra, bu as ya, aV as ha, aW as Ca, aX as Aa, aY as Ha, bv as Fa, cn as Pa, co as fa, cr as va, cs as Ba, ct as Oa, cu as Ga, cv as La, cw as Na, cx as wa, bx as Ea, aZ as xa, bA as Va, a_ as Ma, a$ as Wa, b0 as Ja, b1 as Ua, b3 as Ya, b4 as ja, b5 as qa, b6 as za, b7 as Ka, bc as Xa, b8 as Za, bB as _a, bd as $a, be as Qa, b9 as ae, bf as ee, ba as se, bC as te, aA as oe, bD as re, bg as ne, bb as ce, aa as ue, av as ie, by as le, bz as pe, Z as de, _ as be, a9 as ge, aB as Se, c1 as me, bN as Ie, $ as ke, a0 as De, a1 as Te, ab as Re, ac as ye, ad as he, cz as Ce, cA as Ae, c2 as He, a2 as Fe, a3 as Pe, a4 as fe, cB as ve, cC as Be, cD as Oe, cE as Ge, cF as Le, ae as Ne, af as we, cG as Ee, cH as xe, cI as Ve, cJ as Me, ag as We, ah as Je, cK as Ue, cL as Ye, cM as je, ak as qe, al as ze, V as Ke, ai as Xe, aj as Ze, X as _e, c3 as $e, c4 as Qe, c5 as as, a5 as es, W as ss, Y as ts, a6 as os, cp as rs, cl as ns, a7 as cs, a8 as us, am as is, at as ls, au as ps, an as ds, ao as bs, b_ as gs, ap as Ss, aq as ms, ar as Is, cq as ks, cy as Ds, ay as Ts, aC as Rs, cm as ys, b2 as hs } from "./main-55uQIndh.js";
|
|
3
3
|
export {
|
|
4
4
|
s as A,
|
|
5
5
|
t as ActionButtons,
|
|
@@ -40,13 +40,13 @@ export interface TokenProviderTokenInfo {
|
|
|
40
40
|
kind: TokenProviderTokenApplicationKind;
|
|
41
41
|
/**
|
|
42
42
|
* The name of the application.
|
|
43
|
-
* When token is generated from the dashboard
|
|
43
|
+
* When token is generated from the dashboard it could be 'Imports', 'Orders', etc...
|
|
44
44
|
* When is a standard token (`integration`, `sales_channel` or `webapp`) it will be the name assigned when the application was created.
|
|
45
45
|
*/
|
|
46
46
|
name: string;
|
|
47
47
|
/**
|
|
48
|
-
* This will be `true` when the token is generated from the dashboard
|
|
49
|
-
* Only dashboard
|
|
48
|
+
* This will be `true` when the token is generated from the dashboard.
|
|
49
|
+
* Only dashboard can generate a `core` token.
|
|
50
50
|
*/
|
|
51
51
|
core: boolean;
|
|
52
52
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SectionProps } from '../../atoms/Section';
|
|
2
2
|
import { SkeletonTemplateProps } from '../../atoms/SkeletonTemplate';
|
|
3
3
|
import { FetcherResponse, Resource } from './infiniteFetcher';
|
|
4
|
-
import { ListableResourceType, QueryParamsList } from '@commercelayer/sdk';
|
|
4
|
+
import { ListableResourceType, QueryParamsList, ResourceFields } from '@commercelayer/sdk';
|
|
5
5
|
import { default as React, FC } from 'react';
|
|
6
6
|
|
|
7
7
|
export interface ResourceListItemTemplateProps<TResource extends ListableResourceType> extends SkeletonTemplateProps<{
|
|
@@ -32,7 +32,7 @@ export type ResourceListProps<TResource extends ListableResourceType> = Pick<Sec
|
|
|
32
32
|
/**
|
|
33
33
|
* SDK query object to be used to fetch the list, excluding the pageNumber that is handled internally for infinite scrolling.
|
|
34
34
|
*/
|
|
35
|
-
query?: Omit<QueryParamsList
|
|
35
|
+
query?: Omit<QueryParamsList<ResourceFields[TResource]>, 'pageNumber'>;
|
|
36
36
|
/**
|
|
37
37
|
* When set the component will fetch data from the Metrics API, and automatically use the returned cursor for infinite scrolling.
|
|
38
38
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MetricsApiClient } from './metricsApiClient';
|
|
2
|
-
import { CommerceLayerClient, ListableResourceType, QueryParamsList } from '@commercelayer/sdk';
|
|
2
|
+
import { CommerceLayerClient, ListableResourceType, QueryParamsList, ResourceFields } from '@commercelayer/sdk';
|
|
3
3
|
|
|
4
4
|
type ListResource<TResource extends ListableResourceType> = Awaited<ReturnType<CommerceLayerClient[TResource]['list']>>;
|
|
5
5
|
export type Resource<TResource extends ListableResourceType> = ListResource<TResource>[number];
|
|
@@ -19,7 +19,7 @@ export declare function infiniteFetcher<TResource extends ListableResourceType>(
|
|
|
19
19
|
} & ({
|
|
20
20
|
client: CommerceLayerClient;
|
|
21
21
|
clientType: 'coreSdkClient';
|
|
22
|
-
query?: Omit<QueryParamsList
|
|
22
|
+
query?: Omit<QueryParamsList<ResourceFields[TResource]>, 'pageNumber'>;
|
|
23
23
|
} | {
|
|
24
24
|
client: MetricsApiClient;
|
|
25
25
|
clientType: 'metricsClient';
|
|
@@ -5,6 +5,11 @@ export interface FiltersNavProps {
|
|
|
5
5
|
* Array of instruction items to build the filters behaviors
|
|
6
6
|
*/
|
|
7
7
|
instructions: FiltersInstructions;
|
|
8
|
+
/**
|
|
9
|
+
* Url query string to be parsed.
|
|
10
|
+
* It must be "reactive", so most of the time it should come for router.
|
|
11
|
+
*/
|
|
12
|
+
queryString: string;
|
|
8
13
|
/**
|
|
9
14
|
* Callback function triggered when user interacts with the filters buttons.
|
|
10
15
|
* Implemented function should update the url query string / search params,
|
|
@@ -30,4 +35,4 @@ export interface FiltersNavProps {
|
|
|
30
35
|
*/
|
|
31
36
|
predicateWhitelist: string[];
|
|
32
37
|
}
|
|
33
|
-
export declare function FiltersNav({ instructions, onFilterClick: onBtnLabelClick, onUpdate, predicateWhitelist }: FiltersNavProps): JSX.Element;
|
|
38
|
+
export declare function FiltersNav({ instructions, onFilterClick: onBtnLabelClick, onUpdate, queryString, predicateWhitelist }: FiltersNavProps): JSX.Element;
|
|
@@ -12,6 +12,11 @@ export interface FilterSearchBarProps extends Pick<SearchBarProps, 'placeholder'
|
|
|
12
12
|
* based on the new queryString received as argument.
|
|
13
13
|
*/
|
|
14
14
|
onUpdate: (queryString: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Url query string to be parsed.
|
|
17
|
+
* It must be "reactive", so most of the time it should come for router.
|
|
18
|
+
*/
|
|
19
|
+
queryString: string;
|
|
15
20
|
/**
|
|
16
21
|
* By default, we strip out all filters that are not part of the `instructions` array.
|
|
17
22
|
* The option `predicateWhitelist` is used to whitelist a set of predicates that you want to use as filters.
|
|
@@ -26,7 +31,7 @@ export interface FilterSearchBarProps extends Pick<SearchBarProps, 'placeholder'
|
|
|
26
31
|
*/
|
|
27
32
|
predicateWhitelist: string[];
|
|
28
33
|
}
|
|
29
|
-
declare function FiltersSearchBar({ instructions, placeholder, onUpdate, predicateWhitelist, debounceMs }: FilterSearchBarProps): JSX.Element;
|
|
34
|
+
declare function FiltersSearchBar({ instructions, placeholder, onUpdate, queryString, predicateWhitelist, debounceMs }: FilterSearchBarProps): JSX.Element;
|
|
30
35
|
declare namespace FiltersSearchBar {
|
|
31
36
|
var displayName: string;
|
|
32
37
|
}
|
|
@@ -33,7 +33,7 @@ interface UseResourceFiltersHook {
|
|
|
33
33
|
/**
|
|
34
34
|
* Search bar component with filters navigation buttons
|
|
35
35
|
*/
|
|
36
|
-
SearchWithNav: (props: Pick<FiltersNavProps, 'onFilterClick'> & {
|
|
36
|
+
SearchWithNav: (props: Pick<FiltersNavProps, 'onFilterClick' | 'queryString'> & {
|
|
37
37
|
/**
|
|
38
38
|
* Callback triggered when user interact with search bar or remove a filter from the buttons
|
|
39
39
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/app-elements",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"pnpm": ">=7"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@commercelayer/sdk": "6.
|
|
30
|
+
"@commercelayer/sdk": "6.19.1",
|
|
31
31
|
"@types/lodash": "^4.17.7",
|
|
32
32
|
"@types/react": "^18.3.5",
|
|
33
33
|
"@types/react-datepicker": "^6.2.0",
|