@storecraft/dashboard 1.0.19 → 1.0.21
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/lib/index.cjs +331 -330
- package/dist/lib/index.js +13234 -13706
- package/dist/lib/index.umd.cjs +332 -331
- package/dist/lib/src/apps/gallery/gallery.d.ts +0 -8
- package/dist/lib/src/comps/collection-products.d.ts +0 -12
- package/dist/lib/src/comps/common-fields.d.ts +0 -4
- package/dist/lib/src/comps/common-table-fields.d.ts +0 -6
- package/dist/lib/src/comps/common-ui.d.ts +0 -3
- package/dist/lib/src/comps/copyable-view.d.ts +0 -7
- package/dist/lib/src/comps/discount-filters.d.ts +0 -9
- package/dist/lib/src/comps/fields-view.d.ts +0 -27
- package/dist/lib/src/comps/home-stat-card.d.ts +0 -3
- package/dist/lib/src/comps/image-editor.d.ts +0 -12
- package/dist/lib/src/comps/login-form.d.ts +0 -3
- package/dist/lib/src/comps/markdown-card.d.ts +0 -9
- package/dist/lib/src/comps/product-discounts.d.ts +0 -6
- package/dist/lib/src/comps/quick-search-browser.d.ts +0 -9
- package/dist/lib/src/comps/resource-view.d.ts +0 -10
- package/dist/lib/src/comps/select-resource.d.ts +0 -15
- package/dist/lib/src/comps/table-schema-view.d.ts +0 -27
- package/dist/lib/src/comps/transition.d.ts +0 -18
- package/dist/lib/src/hooks/useCollectionsActions.d.ts +7 -6
- package/dist/lib/src/hooks/useNavigateWithState.d.ts +0 -9
- package/dist/lib/src/pages/index.d.ts +0 -3
- package/dist/website/assets/index-Cgap6Djf.js +803 -0
- package/dist/website/assets/style-CmvNSwgQ.css +1 -0
- package/dist/website/index.html +2 -2
- package/package.json +4 -4
- package/dist/website/assets/index-BhvrnsoR.js +0 -802
- package/dist/website/assets/style-V32WbvBl.css +0 -1
@@ -11,19 +11,11 @@ export default Gallery;
|
|
11
11
|
* this is useful for re-routing of all kinds
|
12
12
|
*/
|
13
13
|
export type InnerGalleryParams = {
|
14
|
-
/**
|
15
|
-
* { vql: '', limit: 5}
|
16
|
-
*/
|
17
14
|
/**
|
18
15
|
* { vql: '', limit: 5}
|
19
16
|
*/
|
20
17
|
query_params?: import('@storecraft/core/api').ApiQuery;
|
21
18
|
onClickImage?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>, data: import('@storecraft/core/api').ImageType) => void;
|
22
|
-
/**
|
23
|
-
* Use url navigation
|
24
|
-
* to paginate through search params, as opposed to in-memory. This
|
25
|
-
* is suited for pages, the later for individual components.
|
26
|
-
*/
|
27
19
|
/**
|
28
20
|
* Use url navigation
|
29
21
|
* to paginate through search params, as opposed to in-memory. This
|
@@ -3,30 +3,18 @@ export type ImpInterface = {
|
|
3
3
|
refresh: () => Promise<void>;
|
4
4
|
};
|
5
5
|
export type CollectionBaseParams = {
|
6
|
-
/**
|
7
|
-
* `handle` or `id`
|
8
|
-
*/
|
9
6
|
/**
|
10
7
|
* `handle` or `id`
|
11
8
|
*/
|
12
9
|
collection_handle_or_id: string;
|
13
|
-
/**
|
14
|
-
* `limit` of query
|
15
|
-
*/
|
16
10
|
/**
|
17
11
|
* `limit` of query
|
18
12
|
*/
|
19
13
|
limit?: number;
|
20
|
-
/**
|
21
|
-
* when loaded reports query count
|
22
|
-
*/
|
23
14
|
/**
|
24
15
|
* when loaded reports query count
|
25
16
|
*/
|
26
17
|
onLoaded: (count: number) => void;
|
27
|
-
/**
|
28
|
-
* context
|
29
|
-
*/
|
30
18
|
/**
|
31
19
|
* context
|
32
20
|
*/
|
@@ -53,10 +53,6 @@ export type SwitchParams = InternalSwitchParams & React.DetailedHTMLProps<React.
|
|
53
53
|
export type ClipBoardCopyButtonParams = {
|
54
54
|
value: string;
|
55
55
|
config?: 0 | 1;
|
56
|
-
/**
|
57
|
-
* process the value
|
58
|
-
* before copying
|
59
|
-
*/
|
60
56
|
/**
|
61
57
|
* process the value
|
62
58
|
* before copying
|
@@ -5,16 +5,10 @@ export function SimpleLink({ context, value, children, className, extra, url_fn,
|
|
5
5
|
export type InternalSpanParams<T extends unknown> = {
|
6
6
|
className?: string;
|
7
7
|
extra?: string;
|
8
|
-
/**
|
9
|
-
* create a `url`
|
10
|
-
*/
|
11
8
|
/**
|
12
9
|
* create a `url`
|
13
10
|
*/
|
14
11
|
url_fn: (item: T) => string;
|
15
|
-
/**
|
16
|
-
* get current navigatio `state`
|
17
|
-
*/
|
18
12
|
/**
|
19
13
|
* get current navigatio `state`
|
20
14
|
*/
|
@@ -3,17 +3,10 @@ export function CopyableView({ value, process_before_copy, ...rest }: CopyableVi
|
|
3
3
|
* A view with `markdown` context, that is `copyable`
|
4
4
|
*/
|
5
5
|
export type CopyableViewParams = {
|
6
|
-
/**
|
7
|
-
* markdown text
|
8
|
-
*/
|
9
6
|
/**
|
10
7
|
* markdown text
|
11
8
|
*/
|
12
9
|
value: string;
|
13
|
-
/**
|
14
|
-
* process the value
|
15
|
-
* before copying
|
16
|
-
*/
|
17
10
|
/**
|
18
11
|
* process the value
|
19
12
|
* before copying
|
@@ -52,23 +52,14 @@ export type AddFilterParams = {
|
|
52
52
|
onAdd: (filter_id: string | number) => void;
|
53
53
|
};
|
54
54
|
export type DiscountFiltersParams = {
|
55
|
-
/**
|
56
|
-
* bunch of filters
|
57
|
-
*/
|
58
55
|
/**
|
59
56
|
* bunch of filters
|
60
57
|
*/
|
61
58
|
value: import('@storecraft/core/api').Filter[];
|
62
|
-
/**
|
63
|
-
* bunch of filters
|
64
|
-
*/
|
65
59
|
/**
|
66
60
|
* bunch of filters
|
67
61
|
*/
|
68
62
|
types: ("product" | "order")[];
|
69
|
-
/**
|
70
|
-
* bunch of filters
|
71
|
-
*/
|
72
63
|
/**
|
73
64
|
* bunch of filters
|
74
65
|
*/
|
@@ -10,47 +10,29 @@ export type FieldData = {
|
|
10
10
|
defaultValue?: any;
|
11
11
|
name?: string;
|
12
12
|
desc?: string;
|
13
|
-
/**
|
14
|
-
* nested fields
|
15
|
-
*/
|
16
13
|
/**
|
17
14
|
* nested fields
|
18
15
|
*/
|
19
16
|
fields?: FieldData[];
|
20
|
-
/**
|
21
|
-
* a react component
|
22
|
-
*/
|
23
17
|
/**
|
24
18
|
* a react component
|
25
19
|
*/
|
26
20
|
comp?: React.ComponentType;
|
27
|
-
/**
|
28
|
-
* params for comp
|
29
|
-
*/
|
30
21
|
/**
|
31
22
|
* params for comp
|
32
23
|
*/
|
33
24
|
comp_params?: object;
|
34
25
|
};
|
35
26
|
export type FieldContextData<D extends unknown = {}> = {
|
36
|
-
/**
|
37
|
-
* running key for leafs
|
38
|
-
*/
|
39
27
|
/**
|
40
28
|
* running key for leafs
|
41
29
|
*/
|
42
30
|
running_key?: string;
|
43
31
|
pubsub?: PubSub;
|
44
|
-
/**
|
45
|
-
* the entire original data
|
46
|
-
*/
|
47
32
|
/**
|
48
33
|
* the entire original data
|
49
34
|
*/
|
50
35
|
data?: D;
|
51
|
-
/**
|
52
|
-
* the entire original data
|
53
|
-
*/
|
54
36
|
/**
|
55
37
|
* the entire original data
|
56
38
|
*/
|
@@ -63,9 +45,6 @@ export type FieldContextData<D extends unknown = {}> = {
|
|
63
45
|
* Root view params
|
64
46
|
*/
|
65
47
|
export type FieldViewParams<O extends unknown = {}, C extends unknown = {}> = {
|
66
|
-
/**
|
67
|
-
* running key for leafs
|
68
|
-
*/
|
69
48
|
/**
|
70
49
|
* running key for leafs
|
71
50
|
*/
|
@@ -77,9 +56,6 @@ export type FieldViewParams<O extends unknown = {}, C extends unknown = {}> = {
|
|
77
56
|
isViewMode: boolean;
|
78
57
|
};
|
79
58
|
export type FieldNodeViewParams<V extends unknown = any, C extends {} = {}, O extends unknown = {}> = {
|
80
|
-
/**
|
81
|
-
* running key for leafs
|
82
|
-
*/
|
83
59
|
/**
|
84
60
|
* running key for leafs
|
85
61
|
*/
|
@@ -104,9 +80,6 @@ export type FieldLeafViewParams<V, C = {}, O = {}> = {
|
|
104
80
|
error?: string;
|
105
81
|
};
|
106
82
|
export type FieldViewImperativeInterface<T> = {
|
107
|
-
/**
|
108
|
-
* Drill and get all nodes rendered data
|
109
|
-
*/
|
110
83
|
/**
|
111
84
|
* Drill and get all nodes rendered data
|
112
85
|
*/
|
@@ -40,30 +40,18 @@ export type TransformValues = {
|
|
40
40
|
* `TopPanel` view of image editor
|
41
41
|
*/
|
42
42
|
export type InnerTopPanelParams = {
|
43
|
-
/**
|
44
|
-
* current values
|
45
|
-
*/
|
46
43
|
/**
|
47
44
|
* current values
|
48
45
|
*/
|
49
46
|
values: TransformValues;
|
50
|
-
/**
|
51
|
-
* notify editing action
|
52
|
-
*/
|
53
47
|
/**
|
54
48
|
* notify editing action
|
55
49
|
*/
|
56
50
|
notify: (values: TransformValues) => void;
|
57
|
-
/**
|
58
|
-
* notify close
|
59
|
-
*/
|
60
51
|
/**
|
61
52
|
* notify close
|
62
53
|
*/
|
63
54
|
onComplete: ImageEditorParams["onComplete"];
|
64
|
-
/**
|
65
|
-
* approve editing
|
66
|
-
*/
|
67
55
|
/**
|
68
56
|
* approve editing
|
69
57
|
*/
|
@@ -3,23 +3,14 @@ export function MarkdownViewCard({ value, title, description, ...rest }: Markdow
|
|
3
3
|
* A card with `markdown content`
|
4
4
|
*/
|
5
5
|
export type MarkdownViewCardParams = {
|
6
|
-
/**
|
7
|
-
* markdown text
|
8
|
-
*/
|
9
6
|
/**
|
10
7
|
* markdown text
|
11
8
|
*/
|
12
9
|
value: string;
|
13
|
-
/**
|
14
|
-
* card title
|
15
|
-
*/
|
16
10
|
/**
|
17
11
|
* card title
|
18
12
|
*/
|
19
13
|
title: string;
|
20
|
-
/**
|
21
|
-
* card description
|
22
|
-
*/
|
23
14
|
/**
|
24
15
|
* card description
|
25
16
|
*/
|
@@ -3,23 +3,14 @@ export default QuickSearchBrowser;
|
|
3
3
|
export type SearchGroupParams = {
|
4
4
|
name: string;
|
5
5
|
group: import('@storecraft/core/api').QuickSearchResource[];
|
6
|
-
/**
|
7
|
-
* The group index
|
8
|
-
*/
|
9
6
|
/**
|
10
7
|
* The group index
|
11
8
|
*/
|
12
9
|
index: number;
|
13
|
-
/**
|
14
|
-
* The item index
|
15
|
-
*/
|
16
10
|
/**
|
17
11
|
* The item index
|
18
12
|
*/
|
19
13
|
selectedItemIndex: number;
|
20
|
-
/**
|
21
|
-
* The item index
|
22
|
-
*/
|
23
14
|
/**
|
24
15
|
* The item index
|
25
16
|
*/
|
@@ -3,26 +3,16 @@ export type ImpInterface = {
|
|
3
3
|
refresh: () => Promise<void>;
|
4
4
|
};
|
5
5
|
export type ResourceViewParams = {
|
6
|
-
/**
|
7
|
-
* `resource` at the backend endpoint, that supports
|
8
|
-
* querying
|
9
|
-
*/
|
10
6
|
/**
|
11
7
|
* `resource` at the backend endpoint, that supports
|
12
8
|
* querying
|
13
9
|
*/
|
14
10
|
resource: string;
|
15
|
-
/**
|
16
|
-
* `limit` of query
|
17
|
-
*/
|
18
11
|
/**
|
19
12
|
* `limit` of query
|
20
13
|
*/
|
21
14
|
limit?: number;
|
22
15
|
schema: any[];
|
23
|
-
/**
|
24
|
-
* context
|
25
|
-
*/
|
26
16
|
/**
|
27
17
|
* context
|
28
18
|
*/
|
@@ -15,38 +15,23 @@ export function SelectResourceWithTags<T extends import('@storecraft/core/api').
|
|
15
15
|
* If you need something with pagination, try `BrowseCollection` instead.
|
16
16
|
*/
|
17
17
|
export type SelectResourceParams<T, TRANSFORM = T> = {
|
18
|
-
/**
|
19
|
-
* callback when selection is made (value) => any
|
20
|
-
*/
|
21
18
|
/**
|
22
19
|
* callback when selection is made (value) => any
|
23
20
|
*/
|
24
21
|
onSelect: (value: TRANSFORM) => any;
|
25
22
|
header: string;
|
26
|
-
/**
|
27
|
-
* add all sentinal
|
28
|
-
*/
|
29
23
|
/**
|
30
24
|
* add all sentinal
|
31
25
|
*/
|
32
26
|
add_all?: boolean;
|
33
|
-
/**
|
34
|
-
* add all sentinal
|
35
|
-
*/
|
36
27
|
/**
|
37
28
|
* add all sentinal
|
38
29
|
*/
|
39
30
|
layout: 0 | 1;
|
40
|
-
/**
|
41
|
-
* table identifier to query
|
42
|
-
*/
|
43
31
|
/**
|
44
32
|
* table identifier to query
|
45
33
|
*/
|
46
34
|
resource: keyof App["db"]["resources"];
|
47
|
-
/**
|
48
|
-
* number of item to query
|
49
|
-
*/
|
50
35
|
/**
|
51
36
|
* number of item to query
|
52
37
|
*/
|
@@ -10,9 +10,6 @@ export function TableSchemaView<T>({ context, fields, data, recordClassName, cla
|
|
10
10
|
* components of `TableSchemaView`
|
11
11
|
*/
|
12
12
|
export type TableSchemaViewContext<T extends unknown> = {
|
13
|
-
/**
|
14
|
-
* item
|
15
|
-
*/
|
16
13
|
/**
|
17
14
|
* item
|
18
15
|
*/
|
@@ -30,37 +27,22 @@ export type Params<T> = T extends React.FC<infer P> ? P : never;
|
|
30
27
|
* components
|
31
28
|
*/
|
32
29
|
export type TableSchemaViewField<T extends unknown, Key extends keyof T = keyof T, Comp extends React.FC = import('react').FC<TableSchemaViewComponentParams<T, Key>>> = {
|
33
|
-
/**
|
34
|
-
* Key of field in the data
|
35
|
-
*/
|
36
30
|
/**
|
37
31
|
* Key of field in the data
|
38
32
|
*/
|
39
33
|
key: Key;
|
40
|
-
/**
|
41
|
-
* Name of field
|
42
|
-
*/
|
43
34
|
/**
|
44
35
|
* Name of field
|
45
36
|
*/
|
46
37
|
name: string;
|
47
|
-
/**
|
48
|
-
* Name of field
|
49
|
-
*/
|
50
38
|
/**
|
51
39
|
* Name of field
|
52
40
|
*/
|
53
41
|
comp: React.FC<Params<Comp> & TableSchemaViewComponentParams<T[Key], T>>;
|
54
|
-
/**
|
55
|
-
* component parameters
|
56
|
-
*/
|
57
42
|
/**
|
58
43
|
* component parameters
|
59
44
|
*/
|
60
45
|
comp_params?: Params<Comp>;
|
61
|
-
/**
|
62
|
-
* transform data
|
63
|
-
*/
|
64
46
|
/**
|
65
47
|
* transform data
|
66
48
|
*/
|
@@ -71,23 +53,14 @@ export type TableSchemaViewField<T extends unknown, Key extends keyof T = keyof
|
|
71
53
|
* `TableSchemaView`
|
72
54
|
*/
|
73
55
|
export type TableSchemaViewComponentParams<V extends unknown, T extends unknown = any> = {
|
74
|
-
/**
|
75
|
-
* Key of field in the data
|
76
|
-
*/
|
77
56
|
/**
|
78
57
|
* Key of field in the data
|
79
58
|
*/
|
80
59
|
field?: TableSchemaViewField<T>;
|
81
|
-
/**
|
82
|
-
* Context
|
83
|
-
*/
|
84
60
|
/**
|
85
61
|
* Context
|
86
62
|
*/
|
87
63
|
context?: TableSchemaViewContext<T>;
|
88
|
-
/**
|
89
|
-
* Value of field
|
90
|
-
*/
|
91
64
|
/**
|
92
65
|
* Value of field
|
93
66
|
*/
|
@@ -3,44 +3,26 @@ export type InnerTransitionParams = {
|
|
3
3
|
show: boolean;
|
4
4
|
unMountOnExit: boolean;
|
5
5
|
duration: number;
|
6
|
-
/**
|
7
|
-
* class-names for `event`
|
8
|
-
*/
|
9
6
|
/**
|
10
7
|
* class-names for `event`
|
11
8
|
*/
|
12
9
|
enter: string;
|
13
|
-
/**
|
14
|
-
* class-names for `event`
|
15
|
-
*/
|
16
10
|
/**
|
17
11
|
* class-names for `event`
|
18
12
|
*/
|
19
13
|
enterFrom: string;
|
20
|
-
/**
|
21
|
-
* class-names for `event`
|
22
|
-
*/
|
23
14
|
/**
|
24
15
|
* class-names for `event`
|
25
16
|
*/
|
26
17
|
enterTo: string;
|
27
|
-
/**
|
28
|
-
* class-names for `event`
|
29
|
-
*/
|
30
18
|
/**
|
31
19
|
* class-names for `event`
|
32
20
|
*/
|
33
21
|
leave: string;
|
34
|
-
/**
|
35
|
-
* class-names for `event`
|
36
|
-
*/
|
37
22
|
/**
|
38
23
|
* class-names for `event`
|
39
24
|
*/
|
40
25
|
leaveFrom: string;
|
41
|
-
/**
|
42
|
-
* class-names for `event`
|
43
|
-
*/
|
44
26
|
/**
|
45
27
|
* class-names for `event`
|
46
28
|
*/
|
@@ -35,7 +35,7 @@ export type HookReturnType<T> = Omit<ReturnType<typeof useCollectionsActions<T>>
|
|
35
35
|
* @param {import('@storecraft/core/api').ApiQuery} [autoLoadQuery=q_initial]
|
36
36
|
*/
|
37
37
|
declare function useCollectionsActions<T extends unknown = any>(resource: ((keyof App["db"]["resources"]) | "payments/gateways" | "extensions"), slug?: string, autoLoad?: boolean, autoLoadQuery?: import('@storecraft/core/api').ApiQuery): {
|
38
|
-
resource: "
|
38
|
+
resource: "auth_users" | "tags" | "collections" | "customers" | "products" | "storefronts" | "images" | "posts" | "templates" | "shipping_methods" | "notifications" | "discounts" | "orders" | "search" | "payments/gateways" | "extensions";
|
39
39
|
query_api: import('@storecraft/core/api').ApiQuery;
|
40
40
|
ref_actions: import('react').MutableRefObject<import('../comps/collection-actions.jsx').ImperativeInterface>;
|
41
41
|
context: {
|
@@ -51,16 +51,17 @@ declare function useCollectionsActions<T extends unknown = any>(resource: ((keyo
|
|
51
51
|
error: any;
|
52
52
|
queryCount: number;
|
53
53
|
actions: {
|
54
|
-
onLimitChange: ($limit: number, perform_navigation?: boolean) => import('@storecraft/core/api').ApiQuery
|
54
|
+
onLimitChange: ($limit: number, perform_navigation?: boolean) => import('@storecraft/core/api').ApiQuery<undefined>;
|
55
55
|
onReload: (perform_navigation?: boolean) => Promise<{
|
56
56
|
limit: number;
|
57
57
|
vql: string;
|
58
|
-
expand?:
|
58
|
+
expand?: string[];
|
59
59
|
vqlParsed?: import("@storecraft/core/vql").VQL.AST;
|
60
|
-
sortBy?:
|
60
|
+
sortBy?: string[];
|
61
61
|
order?: import('@storecraft/core/api').SortOrder;
|
62
|
+
equals?: import('@storecraft/core/api').Tuple<string, import('@storecraft/core/api').legal_value_types>[];
|
62
63
|
}>;
|
63
|
-
prev: (perform_navigation?: boolean) => Promise<import('@storecraft/core/api').ApiQuery
|
64
|
-
next: (perform_navigation?: boolean) => Promise<import('@storecraft/core/api').ApiQuery
|
64
|
+
prev: (perform_navigation?: boolean) => Promise<import('@storecraft/core/api').ApiQuery<undefined>>;
|
65
|
+
next: (perform_navigation?: boolean) => Promise<import('@storecraft/core/api').ApiQuery<undefined>>;
|
65
66
|
};
|
66
67
|
};
|
@@ -2,23 +2,14 @@ export function LinkWithState({ to, current_state, next_state, onClick, ...rest
|
|
2
2
|
export default useNavigateWithState;
|
3
3
|
export type Params = {
|
4
4
|
to: import('react-router-dom').To;
|
5
|
-
/**
|
6
|
-
* object or function
|
7
|
-
*/
|
8
5
|
/**
|
9
6
|
* object or function
|
10
7
|
*/
|
11
8
|
current_state: () => any | object;
|
12
|
-
/**
|
13
|
-
* object or function
|
14
|
-
*/
|
15
9
|
/**
|
16
10
|
* object or function
|
17
11
|
*/
|
18
12
|
next_state?: () => any | object;
|
19
|
-
/**
|
20
|
-
* callback
|
21
|
-
*/
|
22
13
|
/**
|
23
14
|
* callback
|
24
15
|
*/
|
@@ -29,9 +29,6 @@ export type BaseDocumentState<T extends unknown = any> = {
|
|
29
29
|
data?: T;
|
30
30
|
};
|
31
31
|
export type BaseDocumentContext<State extends BaseDocumentState = any> = {
|
32
|
-
/**
|
33
|
-
* Get the values of the `fields-view` tree
|
34
|
-
*/
|
35
32
|
/**
|
36
33
|
* Get the values of the `fields-view` tree
|
37
34
|
*/
|