@storecraft/dashboard 1.0.4 → 1.0.6

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.
Files changed (48) hide show
  1. package/README.md +52 -5
  2. package/dist/lib/index.cjs +373 -373
  3. package/dist/lib/index.js +15967 -15938
  4. package/dist/lib/index.umd.cjs +379 -379
  5. package/dist/lib/src/apps/gallery/gallery.d.ts +8 -0
  6. package/dist/lib/src/comps/collection-products.d.ts +12 -0
  7. package/dist/lib/src/comps/common-button.d.ts +2 -2
  8. package/dist/lib/src/comps/common-fields.d.ts +4 -0
  9. package/dist/lib/src/comps/common-table-fields.d.ts +6 -0
  10. package/dist/lib/src/comps/common-ui.d.ts +3 -0
  11. package/dist/lib/src/comps/copyable-view.d.ts +8 -1
  12. package/dist/lib/src/comps/discount-details.d.ts +5 -5
  13. package/dist/lib/src/comps/discount-filters.d.ts +12 -73
  14. package/dist/lib/src/comps/fields-view.d.ts +28 -1
  15. package/dist/lib/src/comps/home-sales-chart.d.ts +1 -1
  16. package/dist/lib/src/comps/home-stat-card.d.ts +5 -1
  17. package/dist/lib/src/comps/image-editor.d.ts +17 -4
  18. package/dist/lib/src/comps/login-form.d.ts +4 -1
  19. package/dist/lib/src/comps/login-latest-updates.d.ts +32 -0
  20. package/dist/lib/src/comps/logo-text.d.ts +2 -0
  21. package/dist/lib/src/comps/markdown-card.d.ts +10 -1
  22. package/dist/lib/src/comps/md-view.d.ts +1 -1
  23. package/dist/lib/src/comps/media.d.ts +3 -2
  24. package/dist/lib/src/comps/modal.d.ts +1 -1
  25. package/dist/lib/src/comps/order-line-items.d.ts +1 -1
  26. package/dist/lib/src/comps/order-payment-gateway.d.ts +6 -2
  27. package/dist/lib/src/comps/order-price.d.ts +7 -2
  28. package/dist/lib/src/comps/product-discounts.d.ts +6 -0
  29. package/dist/lib/src/comps/quick-search-browser.d.ts +9 -0
  30. package/dist/lib/src/comps/resource-view.d.ts +10 -0
  31. package/dist/lib/src/comps/select-resource.d.ts +15 -0
  32. package/dist/lib/src/comps/settings-change-password.d.ts +2 -0
  33. package/dist/lib/src/comps/table-schema-view.d.ts +30 -3
  34. package/dist/lib/src/comps/tags-edit.d.ts +1 -1
  35. package/dist/lib/src/comps/template-example-input.d.ts +1 -1
  36. package/dist/lib/src/comps/template-template.d.ts +1 -1
  37. package/dist/lib/src/comps/transition.d.ts +18 -0
  38. package/dist/lib/src/hooks/useCollectionsActions.d.ts +5 -5
  39. package/dist/lib/src/hooks/useDocumentActions.d.ts +6 -4
  40. package/dist/lib/src/hooks/useNavigateWithState.d.ts +9 -0
  41. package/dist/lib/src/pages/index.d.ts +4 -1
  42. package/dist/lib/src/pages/order.d.ts +9 -3
  43. package/dist/website/assets/{index-BzxD23gt.js → index-C7Q7dM9P.js} +372 -372
  44. package/dist/website/assets/style-CWN3iS8N.css +1 -0
  45. package/dist/website/index.html +2 -2
  46. package/dist/website/localhost_3000_logo.png +0 -0
  47. package/package.json +1 -1
  48. package/dist/website/assets/style-WBf4dDmi.css +0 -1
@@ -11,11 +11,19 @@ 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
+ */
14
17
  /**
15
18
  * { vql: '', limit: 5}
16
19
  */
17
20
  query_params?: import('@storecraft/core/v-api').ApiQuery;
18
21
  onClickImage?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>, data: import('@storecraft/core/v-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
+ */
19
27
  /**
20
28
  * Use url navigation
21
29
  * to paginate through search params, as opposed to in-memory. This
@@ -3,18 +3,30 @@ export type ImpInterface = {
3
3
  refresh: () => Promise<void>;
4
4
  };
5
5
  export type CollectionBaseParams = {
6
+ /**
7
+ * `handle` or `id`
8
+ */
6
9
  /**
7
10
  * `handle` or `id`
8
11
  */
9
12
  collection_handle_or_id: string;
13
+ /**
14
+ * `limit` of query
15
+ */
10
16
  /**
11
17
  * `limit` of query
12
18
  */
13
19
  limit: number;
20
+ /**
21
+ * when loaded reports query count
22
+ */
14
23
  /**
15
24
  * when loaded reports query count
16
25
  */
17
26
  onLoaded: (count: number) => void;
27
+ /**
28
+ * context
29
+ */
18
30
  /**
19
31
  * context
20
32
  */
@@ -4,9 +4,9 @@ export function LoadingButton({ Icon, show, text, keep_text_on_load, className,
4
4
  /**
5
5
  * A loading button which expects a promise for onClick
6
6
  */
7
- export type PromisableLoadingButton = InternalPromisableLoadingButton & Omit<LoadingButtonParams, 'onClick'>;
7
+ export type PromisableLoadingButton = InternalPromisableLoadingButton & Omit<LoadingButtonParams, "onClick">;
8
8
  export function PromisableLoadingButton({ onClick, loading: $loading, ...rest }: PromisableLoadingButton): import("react").JSX.Element;
9
- export type PromisableLoadingBlingButton = InternalPromisableLoadingBlingButton & Omit<LoadingButtonParams, 'onClick'>;
9
+ export type PromisableLoadingBlingButton = InternalPromisableLoadingBlingButton & Omit<LoadingButtonParams, "onClick">;
10
10
  export function PromisableLoadingBlingButton({ onClick, show, className, loading: $loading, stroke, rounded, from, to, ...rest }: PromisableLoadingBlingButton): import("react").JSX.Element;
11
11
  export function BlingButton({ from, to, rounded, stroke, children, text, className, btnClassName, ...rest }: import('./common-ui.jsx').InternalBlingParams & {
12
12
  btnClassName?: string;
@@ -53,6 +53,10 @@ 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
+ */
56
60
  /**
57
61
  * process the value
58
62
  * before copying
@@ -5,10 +5,16 @@ 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
+ */
8
11
  /**
9
12
  * create a `url`
10
13
  */
11
14
  url_fn: (item: T) => string;
15
+ /**
16
+ * get current navigatio `state`
17
+ */
12
18
  /**
13
19
  * get current navigatio `state`
14
20
  */
@@ -52,6 +52,9 @@ export function Card({ name, setError, error, children, border, desc, rightView,
52
52
  export type InternalCreateDateParams = {
53
53
  time: string;
54
54
  changes_made?: boolean;
55
+ /**
56
+ * override
57
+ */
55
58
  /**
56
59
  * override
57
60
  */
@@ -1,12 +1,19 @@
1
- export function CopyableView({ value, process_before_copy, ...rest }: CopyableViewParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'value'>): import("react").JSX.Element;
1
+ export function CopyableView({ value, process_before_copy, ...rest }: CopyableViewParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "value">): import("react").JSX.Element;
2
2
  /**
3
3
  * A view with `markdown` context, that is `copyable`
4
4
  */
5
5
  export type CopyableViewParams = {
6
+ /**
7
+ * markdown text
8
+ */
6
9
  /**
7
10
  * markdown text
8
11
  */
9
12
  value: string;
13
+ /**
14
+ * process the value
15
+ * before copying
16
+ */
10
17
  /**
11
18
  * process the value
12
19
  * before copying
@@ -11,12 +11,12 @@ export type DiscountTypesParams = {
11
11
  onChange: (meta: import('@storecraft/core/v-api').DiscountDetails["meta"]) => void;
12
12
  };
13
13
  export type BulkDiscountParams = {
14
- type: 'bulk';
14
+ type: "bulk";
15
15
  value: import('@storecraft/core/v-api').BulkDiscountExtra;
16
16
  onChange: (extra: import('@storecraft/core/v-api').BulkDiscountExtra) => void;
17
17
  };
18
18
  export type BundleDiscountParams = {
19
- meta: 'bundle';
19
+ meta: "bundle";
20
20
  value: import('@storecraft/core/v-api').BundleDiscountExtra;
21
21
  context: import('./fields-view.jsx').FieldContextData;
22
22
  onChange: (extra: import('@storecraft/core/v-api').BundleDiscountExtra) => void;
@@ -27,18 +27,18 @@ export type ExplainPriceParams = {
27
27
  fixed: number;
28
28
  };
29
29
  export type RegularDiscountParams = {
30
- type: 'regular';
30
+ type: "regular";
31
31
  value: import('@storecraft/core/v-api').RegularDiscountExtra;
32
32
  onChange: (extra: import('@storecraft/core/v-api').RegularDiscountExtra) => void;
33
33
  };
34
34
  export type BuyXGetYDiscountParams = {
35
- type: 'buy_x_get_y';
35
+ type: "buy_x_get_y";
36
36
  value: import('@storecraft/core/v-api').BuyXGetYDiscountExtra;
37
37
  onChange: (extra: import('@storecraft/core/v-api').BuyXGetYDiscountExtra) => void;
38
38
  context: import('../pages/discount.jsx').Context;
39
39
  };
40
40
  export type OrderDiscountParams = {
41
- type: 'order';
41
+ type: "order";
42
42
  value: import('@storecraft/core/v-api').OrderDiscountExtra;
43
43
  onChange: (extra: import('@storecraft/core/v-api').OrderDiscountExtra) => void;
44
44
  };
@@ -39,78 +39,8 @@ export type Filter_OrderHasCustomersParams = {
39
39
  export type ProductFilterContainerParams = {
40
40
  name: string;
41
41
  value: import('@storecraft/core/v-api').Filter["value"];
42
- Comp: ({
43
- Comp: ({ onChange, value, context }: Filter_ProductInCollectionsParams) => import("react").JSX.Element;
44
- CompParams: {};
45
- id: number;
46
- type: string;
47
- op: string;
48
- name: string;
49
- } | {
50
- Comp: ({ onChange, value, context }: Filter_ProductHasTagsParams) => import("react").JSX.Element;
51
- CompParams: {};
52
- id: number;
53
- type: string;
54
- op: string;
55
- name: string;
56
- } | {
57
- Comp: ({ onChange, value, }: Filter_ProductPriceInRangeParams) => import("react").JSX.Element;
58
- CompParams: {};
59
- id: number;
60
- type: string;
61
- op: string;
62
- name: string;
63
- } | {
64
- Comp: ({ onChange, value }: Filter_OrderDateParams) => import("react").JSX.Element;
65
- CompParams: {};
66
- id: number;
67
- type: string;
68
- op: string;
69
- name: string;
70
- } | {
71
- Comp: ({ onChange, value, context }: Filter_OrderHasCustomersParams) => import("react").JSX.Element;
72
- CompParams: {};
73
- id: number;
74
- type: string;
75
- op: string;
76
- name: string;
77
- })[][0]["Comp"];
78
- CompParams: ({
79
- Comp: ({ onChange, value, context }: Filter_ProductInCollectionsParams) => import("react").JSX.Element;
80
- CompParams: {};
81
- id: number;
82
- type: string;
83
- op: string;
84
- name: string;
85
- } | {
86
- Comp: ({ onChange, value, context }: Filter_ProductHasTagsParams) => import("react").JSX.Element;
87
- CompParams: {};
88
- id: number;
89
- type: string;
90
- op: string;
91
- name: string;
92
- } | {
93
- Comp: ({ onChange, value, }: Filter_ProductPriceInRangeParams) => import("react").JSX.Element;
94
- CompParams: {};
95
- id: number;
96
- type: string;
97
- op: string;
98
- name: string;
99
- } | {
100
- Comp: ({ onChange, value }: Filter_OrderDateParams) => import("react").JSX.Element;
101
- CompParams: {};
102
- id: number;
103
- type: string;
104
- op: string;
105
- name: string;
106
- } | {
107
- Comp: ({ onChange, value, context }: Filter_OrderHasCustomersParams) => import("react").JSX.Element;
108
- CompParams: {};
109
- id: number;
110
- type: string;
111
- op: string;
112
- name: string;
113
- })[][0]["CompParams"];
42
+ Comp: (({ onChange, value, context }: Filter_ProductInCollectionsParams) => import("react").JSX.Element) | (({ onChange, value, context }: Filter_ProductHasTagsParams) => import("react").JSX.Element) | (({ onChange, value, }: Filter_ProductPriceInRangeParams) => import("react").JSX.Element) | (({ onChange, value }: Filter_OrderDateParams) => import("react").JSX.Element) | (({ onChange, value, context }: Filter_OrderHasCustomersParams) => import("react").JSX.Element);
43
+ CompParams: {} | {} | {} | {} | {};
114
44
  type: import('@storecraft/core/v-api').Filter["meta"]["type"];
115
45
  onChange: (value: import('@storecraft/core/v-api').Filter["value"]) => void;
116
46
  onRemove: () => void;
@@ -122,6 +52,9 @@ export type AddFilterParams = {
122
52
  onAdd: (filter_id: string | number) => void;
123
53
  };
124
54
  export type DiscountFiltersParams = {
55
+ /**
56
+ * bunch of filters
57
+ */
125
58
  /**
126
59
  * bunch of filters
127
60
  */
@@ -129,7 +62,13 @@ export type DiscountFiltersParams = {
129
62
  /**
130
63
  * bunch of filters
131
64
  */
132
- types: ('product' | 'order')[];
65
+ /**
66
+ * bunch of filters
67
+ */
68
+ types: ("product" | "order")[];
69
+ /**
70
+ * bunch of filters
71
+ */
133
72
  /**
134
73
  * bunch of filters
135
74
  */
@@ -10,29 +10,47 @@ export type FieldData = {
10
10
  defaultValue?: any;
11
11
  name?: string;
12
12
  desc?: string;
13
+ /**
14
+ * nested fields
15
+ */
13
16
  /**
14
17
  * nested fields
15
18
  */
16
19
  fields?: FieldData[];
20
+ /**
21
+ * a react component
22
+ */
17
23
  /**
18
24
  * a react component
19
25
  */
20
26
  comp?: React.ComponentType;
27
+ /**
28
+ * params for comp
29
+ */
21
30
  /**
22
31
  * params for comp
23
32
  */
24
33
  comp_params?: object;
25
34
  };
26
35
  export type FieldContextData<D extends unknown = {}> = {
36
+ /**
37
+ * running key for leafs
38
+ */
27
39
  /**
28
40
  * running key for leafs
29
41
  */
30
42
  running_key?: string;
31
43
  pubsub?: PubSub;
44
+ /**
45
+ * the entire original data
46
+ */
32
47
  /**
33
48
  * the entire original data
34
49
  */
35
50
  data?: D;
51
+ /**
52
+ * the entire original data
53
+ */
36
54
  /**
37
55
  * the entire original data
38
56
  */
@@ -45,6 +63,9 @@ export type FieldContextData<D extends unknown = {}> = {
45
63
  * Root view params
46
64
  */
47
65
  export type FieldViewParams<O extends unknown = {}, C extends unknown = {}> = {
66
+ /**
67
+ * running key for leafs
68
+ */
48
69
  /**
49
70
  * running key for leafs
50
71
  */
@@ -56,6 +77,9 @@ export type FieldViewParams<O extends unknown = {}, C extends unknown = {}> = {
56
77
  isViewMode: boolean;
57
78
  };
58
79
  export type FieldNodeViewParams<V extends unknown = any, C extends {} = {}, O extends unknown = {}> = {
80
+ /**
81
+ * running key for leafs
82
+ */
59
83
  /**
60
84
  * running key for leafs
61
85
  */
@@ -79,7 +103,10 @@ export type FieldLeafViewParams<V, C = {}, O = {}> = {
79
103
  setError?: (error: string) => void;
80
104
  error?: string;
81
105
  };
82
- export type FieldViewImperativeInterface<T extends import('@storecraft/core/v-api').BaseType = {}> = {
106
+ export type FieldViewImperativeInterface<T> = {
107
+ /**
108
+ * Drill and get all nodes rendered data
109
+ */
83
110
  /**
84
111
  * Drill and get all nodes rendered data
85
112
  */
@@ -2,7 +2,7 @@ export default SalesChart;
2
2
  export type InnerSalesChartParams = {
3
3
  data: import('@storecraft/core/v-api').OrdersStatisticsType;
4
4
  };
5
- export type SalesChartParams = InnerSalesChartParams & Omit<import('./base-chart-view.jsx').BaseChartViewParams, 'config'>;
5
+ export type SalesChartParams = InnerSalesChartParams & Omit<import('./base-chart-view.jsx').BaseChartViewParams, "config">;
6
6
  /**
7
7
  *
8
8
  * @typedef {object} InnerSalesChartParams
@@ -1,8 +1,12 @@
1
+ import { default as Statistics } from '@storecraft/sdk/src/statistics.js';
1
2
  export default StatCard;
2
3
  export type StatCardParams = {
3
- which_table: [table: "search" | "products" | "collections" | "discounts" | "tags" | "shipping_methods" | "posts" | "auth_users" | "customers" | "storefronts" | "images" | "templates" | "notifications" | "orders", query?: import('@storecraft/core/v-api').ApiQuery]["0"];
4
+ which_table: Parameters<Statistics["countOf"]>["0"];
4
5
  msg: string;
5
6
  link: string;
7
+ /**
8
+ * `VQL` search query
9
+ */
6
10
  /**
7
11
  * `VQL` search query
8
12
  */
@@ -1,3 +1,4 @@
1
+ import { useState } from 'react';
1
2
  export function Switch({ left: $left, onSwitch, children, className, ...rest }: SwitchParams & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element;
2
3
  export default ImageEditor;
3
4
  /**
@@ -19,8 +20,8 @@ export type OptionsImpInterface = {
19
20
  * image editor options
20
21
  */
21
22
  export type EditingOptions = {
22
- format: 'jpeg' | 'png' | 'webp';
23
- quality: 0.5 | 0.75 | 0.8 | 0.9 | 1.0;
23
+ format: "jpeg" | "png" | "webp";
24
+ quality: 0.5 | 0.75 | 0.8 | 0.9 | 1;
24
25
  height: 128 | 256 | 384 | 512 | 640 | 768 | 896 | 1024;
25
26
  };
26
27
  /**
@@ -33,24 +34,36 @@ export type TransformValues = {
33
34
  x: number;
34
35
  y: number;
35
36
  };
36
- mode: 'crop' | 'move';
37
+ mode: "crop" | "move";
37
38
  };
38
39
  /**
39
40
  * `TopPanel` view of image editor
40
41
  */
41
42
  export type InnerTopPanelParams = {
43
+ /**
44
+ * current values
45
+ */
42
46
  /**
43
47
  * current values
44
48
  */
45
49
  values: TransformValues;
50
+ /**
51
+ * notify editing action
52
+ */
46
53
  /**
47
54
  * notify editing action
48
55
  */
49
56
  notify: (values: TransformValues) => void;
57
+ /**
58
+ * notify close
59
+ */
50
60
  /**
51
61
  * notify close
52
62
  */
53
63
  onComplete: ImageEditorParams["onComplete"];
64
+ /**
65
+ * approve editing
66
+ */
54
67
  /**
55
68
  * approve editing
56
69
  */
@@ -60,7 +73,7 @@ export type InnerTopPanelParams = {
60
73
  * `TopPanel` view of image editor
61
74
  */
62
75
  export type TopPanelParams = InnerTopPanelParams & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
63
- export type useStateInfer<T> = [T, import('react').Dispatch<import('react').SetStateAction<T>>];
76
+ export type useStateInfer<T> = ReturnType<typeof useState<T>>;
64
77
  /**
65
78
  * `ImageEditor` is a simple and effective image editor, supports:
66
79
  * - Transformations: `translate`, `rotate`, `scale`
@@ -7,6 +7,9 @@ export type LoginFormFieldsType = {
7
7
  export type InnerFieldParams = {
8
8
  value: object;
9
9
  desc: string;
10
+ /**
11
+ * key in value
12
+ */
10
13
  /**
11
14
  * key in value
12
15
  */
@@ -41,4 +44,4 @@ export type InnerLoginFormParams = {
41
44
  * } params
42
45
  *
43
46
  */
44
- declare function LoginForm({ onChange, onSubmit, error, className, credentials, is_backend_endpoint_editable, ...rest }: InnerLoginFormParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'value' | 'onChange' | 'onSubmit'>): import("react").JSX.Element;
47
+ declare function LoginForm({ onChange, onSubmit, error, className, credentials, is_backend_endpoint_editable, ...rest }: InnerLoginFormParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "value" | "onChange" | "onSubmit">): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ export default LoginLatestUpdates;
2
+ export type GithubCommit = {
3
+ sha: string;
4
+ node_id: string;
5
+ commit: {
6
+ author: {
7
+ name: string;
8
+ email: string;
9
+ date: string;
10
+ };
11
+ message: string;
12
+ url: string;
13
+ };
14
+ url: string;
15
+ html_url: string;
16
+ author: {
17
+ login: string;
18
+ id: string;
19
+ avatar_url: string;
20
+ url: string;
21
+ html_url: string;
22
+ };
23
+ };
24
+ export type GithubCommits = GithubCommit[];
25
+ export type CommitViewParams = {
26
+ commit: GithubCommit;
27
+ };
28
+ /**
29
+ *
30
+ * @param {React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>} params
31
+ */
32
+ declare function LoginLatestUpdates({ ...rest }: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export function LogoText({ children, ...rest }: React.SVGProps<SVGSVGElement>): import("react").JSX.Element;
2
+ export function LogoGradient({ className }: React.SVGProps<SVGSVGElement>): import("react").JSX.Element;
@@ -1,16 +1,25 @@
1
- export function MarkdownViewCard({ value, title, description, ...rest }: MarkdownViewCardParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'value'>): import("react").JSX.Element;
1
+ export function MarkdownViewCard({ value, title, description, ...rest }: MarkdownViewCardParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "value">): import("react").JSX.Element;
2
2
  /**
3
3
  * A card with `markdown content`
4
4
  */
5
5
  export type MarkdownViewCardParams = {
6
+ /**
7
+ * markdown text
8
+ */
6
9
  /**
7
10
  * markdown text
8
11
  */
9
12
  value: string;
13
+ /**
14
+ * card title
15
+ */
10
16
  /**
11
17
  * card title
12
18
  */
13
19
  title: string;
20
+ /**
21
+ * card description
22
+ */
14
23
  /**
15
24
  * card description
16
25
  */
@@ -2,7 +2,7 @@ export default MDView;
2
2
  export type InternalMDViewParams = {
3
3
  value?: string;
4
4
  };
5
- export type MDViewParams = InternalMDViewParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'value'>;
5
+ export type MDViewParams = InternalMDViewParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "value">;
6
6
  /**
7
7
  * @typedef {object} InternalMDViewParams
8
8
  * @prop {string} [value]
@@ -1,3 +1,4 @@
1
+ import { useState } from 'react';
1
2
  export default Media;
2
3
  /**
3
4
  * `CameraSource` will fetch image from local camera
@@ -20,7 +21,7 @@ export type GallerySourceParams = {
20
21
  onFinish: (url: string, requires_edit?: boolean) => void;
21
22
  className: string;
22
23
  };
23
- export type useStateInfer<T> = [T, import('react').Dispatch<import('react').SetStateAction<T>>];
24
+ export type useStateInfer<T> = ReturnType<typeof useState<T>>;
24
25
  /**
25
26
  * `UrlSource` will fetch image from a simple `url`
26
27
  */
@@ -38,7 +39,7 @@ export type InnerMediaParams = {
38
39
  * `Media` wraps a few media fetching sources together.
39
40
  */
40
41
  export type Upload = {
41
- status: 'working' | 'failed';
42
+ status: "working" | "failed";
42
43
  id: string | number;
43
44
  preview: string;
44
45
  error_code?: string;
@@ -11,5 +11,5 @@ export type InnerModalParams = {
11
11
  title?: React.ReactElement;
12
12
  onApprove: (key: string, value: any) => void;
13
13
  };
14
- export type ModalParams = InnerModalParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'title'>;
14
+ export type ModalParams = InnerModalParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title">;
15
15
  declare const Modal: import('react').ForwardRefExoticComponent<Omit<ModalParams, "ref"> & import('react').RefAttributes<any>>;
@@ -1,5 +1,5 @@
1
1
  export default OrderLineItems;
2
- export type Op = 'change-qty' | 'stock-change';
2
+ export type Op = "change-qty" | "stock-change";
3
3
  export type InternalLineitemsTableParams = {
4
4
  items?: import('@storecraft/core/v-api').LineItem[];
5
5
  context?: import('./fields-view.jsx').FieldContextData & import('../pages/order.jsx').Context;
@@ -7,7 +7,11 @@ export type ActionButtonParams = {
7
7
  action: import('@storecraft/core/v-api').PaymentGatewayAction;
8
8
  onClick: (action: import('@storecraft/core/v-api').PaymentGatewayAction) => Promise<void>;
9
9
  };
10
- export type OrderPaymentGatewayParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/v-api').OrderPaymentGatewayData, import('../pages/order.jsx').Context, import('@storecraft/core/v-api').OrderData> & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
10
+ export type ChoosePaymentGatewayParams = {
11
+ full_order?: import('@storecraft/core/v-api').OrderData;
12
+ onCreate: (pg_handle: string) => Promise<any>;
13
+ };
14
+ export type OrderPaymentGatewayParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/v-api').OrderPaymentGatewayData, import('../pages/order.jsx').Context, import('@storecraft/core/v-api').OrderData> & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "onChange">;
11
15
  /**
12
16
  *
13
17
  * @typedef {import('./fields-view.jsx').FieldLeafViewParams<
@@ -15,7 +19,7 @@ export type OrderPaymentGatewayParams = import('./fields-view.jsx').FieldLeafVie
15
19
  * import('../pages/order.jsx').Context,
16
20
  * import('@storecraft/core/v-api').OrderData
17
21
  * > &
18
- * React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
22
+ * Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange'>
19
23
  * } OrderPaymentGatewayParams
20
24
  *
21
25
  * @param {OrderPaymentGatewayParams} param
@@ -1,12 +1,17 @@
1
1
  export default OrderPrice;
2
2
  export type EntryParams = {
3
3
  title: string;
4
+ link?: string;
4
5
  value: number;
6
+ context?: import('../pages/order.jsx').Context;
5
7
  };
6
- export type OrderPriceParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/v-api').PricingData> & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
8
+ export type OrderPriceParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/v-api').PricingData, import('../pages/order.jsx').Context, import('@storecraft/core/v-api').OrderData> & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
7
9
  /**
8
10
  * @typedef {import('./fields-view.jsx').FieldLeafViewParams<
9
- * import('@storecraft/core/v-api').PricingData> &
11
+ * import('@storecraft/core/v-api').PricingData,
12
+ * import('@/pages/order.jsx').Context,
13
+ * import('@storecraft/core/v-api').OrderData
14
+ * > &
10
15
  * React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
11
16
  * } OrderPriceParams
12
17
  *
@@ -1,9 +1,15 @@
1
1
  export default ProductDiscounts;
2
2
  export type ItemParams = {
3
+ /**
4
+ * `discount`
5
+ */
3
6
  /**
4
7
  * `discount`
5
8
  */
6
9
  value: import('@storecraft/core/v-api').DiscountType;
10
+ /**
11
+ * callback
12
+ */
7
13
  /**
8
14
  * callback
9
15
  */
@@ -3,14 +3,23 @@ export default QuickSearchBrowser;
3
3
  export type SearchGroupParams = {
4
4
  name: string;
5
5
  group: import('@storecraft/core/v-api').QuickSearchResource[];
6
+ /**
7
+ * The group index
8
+ */
6
9
  /**
7
10
  * The group index
8
11
  */
9
12
  index: number;
13
+ /**
14
+ * The item index
15
+ */
10
16
  /**
11
17
  * The item index
12
18
  */
13
19
  selectedItemIndex: number;
20
+ /**
21
+ * The item index
22
+ */
14
23
  /**
15
24
  * The item index
16
25
  */