@storecraft/dashboard 1.0.10 → 1.0.11
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/README.md +2 -2
- package/dist/lib/index.cjs +92 -92
- package/dist/lib/index.js +1244 -1237
- package/dist/lib/index.umd.cjs +94 -94
- package/dist/lib/src/apps/gallery/gallery-image-grid.d.ts +6 -6
- package/dist/lib/src/apps/gallery/gallery-select.d.ts +2 -2
- package/dist/lib/src/apps/gallery/gallery.d.ts +4 -4
- package/dist/lib/src/comps/attributes.d.ts +4 -4
- package/dist/lib/src/comps/collection-products.d.ts +4 -4
- package/dist/lib/src/comps/customer-orders.d.ts +3 -3
- package/dist/lib/src/comps/discount-details.d.ts +19 -19
- package/dist/lib/src/comps/discount-filters.d.ts +24 -24
- package/dist/lib/src/comps/discount-performance.d.ts +2 -2
- package/dist/lib/src/comps/discounts-table-code.d.ts +2 -2
- package/dist/lib/src/comps/discounts-table-type.d.ts +3 -3
- package/dist/lib/src/comps/document-details.d.ts +2 -2
- package/dist/lib/src/comps/error-message.d.ts +3 -3
- package/dist/lib/src/comps/home-performace.d.ts +2 -2
- package/dist/lib/src/comps/home-sales-chart.d.ts +2 -2
- package/dist/lib/src/comps/notifications.d.ts +3 -3
- package/dist/lib/src/comps/order-coupon-info.d.ts +2 -2
- package/dist/lib/src/comps/order-delivery-method.d.ts +2 -2
- package/dist/lib/src/comps/order-line-items.d.ts +4 -4
- package/dist/lib/src/comps/order-payment-gateway.d.ts +6 -6
- package/dist/lib/src/comps/order-price.d.ts +3 -3
- package/dist/lib/src/comps/product-discounts.d.ts +4 -4
- package/dist/lib/src/comps/product-related-products.d.ts +2 -2
- package/dist/lib/src/comps/products-variants.d.ts +13 -13
- package/dist/lib/src/comps/quick-search-browser.d.ts +3 -3
- package/dist/lib/src/comps/resource-browse.d.ts +6 -6
- package/dist/lib/src/comps/select-resource.d.ts +2 -2
- package/dist/lib/src/comps/storefront-products.d.ts +2 -2
- package/dist/lib/src/comps/tags-edit.d.ts +1 -1
- package/dist/lib/src/comps/template-example-input.d.ts +1 -1
- package/dist/lib/src/comps/template-template.d.ts +1 -1
- package/dist/lib/src/hooks/useCollectionsActions.d.ts +11 -11
- package/dist/lib/src/pages/collection.d.ts +1 -1
- package/dist/lib/src/pages/customer.d.ts +1 -1
- package/dist/lib/src/pages/customers.d.ts +1 -1
- package/dist/lib/src/pages/discount.d.ts +1 -1
- package/dist/lib/src/pages/extension.d.ts +1 -1
- package/dist/lib/src/pages/extensions.d.ts +1 -1
- package/dist/lib/src/pages/order.d.ts +1 -1
- package/dist/lib/src/pages/payment-gateway.d.ts +1 -1
- package/dist/lib/src/pages/payment-gateways.d.ts +1 -1
- package/dist/lib/src/pages/post.d.ts +1 -1
- package/dist/lib/src/pages/product.d.ts +1 -1
- package/dist/lib/src/pages/shipping-method.d.ts +1 -1
- package/dist/lib/src/pages/storefront.d.ts +1 -1
- package/dist/lib/src/pages/tag.d.ts +1 -1
- package/dist/lib/src/pages/template.d.ts +1 -1
- package/dist/website/assets/{index-CUE9OKd2.js → index-Mf1yKRWi.js} +92 -92
- package/dist/website/index.html +1 -1
- package/package.json +1 -1
@@ -1,38 +1,38 @@
|
|
1
1
|
export default ProductVariants;
|
2
2
|
export type ProductOptionParams = {
|
3
|
-
option: import('@storecraft/core/
|
4
|
-
onRemove: (option: import('@storecraft/core/
|
5
|
-
onChange: (option: import('@storecraft/core/
|
3
|
+
option: import('@storecraft/core/api').VariantOption;
|
4
|
+
onRemove: (option: import('@storecraft/core/api').VariantOption) => void;
|
5
|
+
onChange: (option: import('@storecraft/core/api').VariantOption) => void;
|
6
6
|
};
|
7
7
|
export type ProductOptionsParams = {
|
8
|
-
options: import('@storecraft/core/
|
9
|
-
onChange: (option: import('@storecraft/core/
|
8
|
+
options: import('@storecraft/core/api').VariantOption[];
|
9
|
+
onChange: (option: import('@storecraft/core/api').VariantOption[]) => void;
|
10
10
|
};
|
11
11
|
export type VariantParams = {
|
12
|
-
options: import('@storecraft/core/
|
13
|
-
combination: import('@storecraft/core/
|
12
|
+
options: import('@storecraft/core/api').VariantOption[];
|
13
|
+
combination: import('@storecraft/core/api').VariantOptionSelection[];
|
14
14
|
context: Context;
|
15
15
|
setError: (error: string) => void;
|
16
16
|
};
|
17
17
|
export type VariantsViewParams = {
|
18
|
-
options: import('@storecraft/core/
|
18
|
+
options: import('@storecraft/core/api').VariantOption[];
|
19
19
|
context: Context;
|
20
20
|
setError: (error: string) => void;
|
21
21
|
};
|
22
|
-
export type Context = import('./fields-view.jsx').FieldContextData<import('@storecraft/core/
|
22
|
+
export type Context = import('./fields-view.jsx').FieldContextData<import('@storecraft/core/api').VariantType & import('@storecraft/core/api').ProductType> & import('../pages/product.jsx').Context;
|
23
23
|
/**
|
24
24
|
* @typedef {import('./fields-view.jsx').FieldContextData<
|
25
|
-
* import('@storecraft/core/
|
26
|
-
* import('@storecraft/core/
|
25
|
+
* import('@storecraft/core/api').VariantType &
|
26
|
+
* import('@storecraft/core/api').ProductType> &
|
27
27
|
* import('../pages/product.jsx').Context
|
28
28
|
* } Context
|
29
29
|
*
|
30
30
|
*
|
31
31
|
* @param {import('./fields-view.jsx').FieldLeafViewParams<
|
32
|
-
* import('@storecraft/core/
|
32
|
+
* import('@storecraft/core/api').VariantOption[],
|
33
33
|
* Context> &
|
34
34
|
* React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
35
35
|
* } params
|
36
36
|
*
|
37
37
|
*/
|
38
|
-
declare function ProductVariants({ value, onChange, context, setError, ...rest }: import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/
|
38
|
+
declare function ProductVariants({ value, onChange, context, setError, ...rest }: import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/api').VariantOption[], Context> & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element | "You have to create the product before you add variants";
|
@@ -2,7 +2,7 @@ export function QuickSearchButton({ onClick, ...rest }: React.DetailedHTMLProps<
|
|
2
2
|
export default QuickSearchBrowser;
|
3
3
|
export type SearchGroupParams = {
|
4
4
|
name: string;
|
5
|
-
group: import('@storecraft/core/
|
5
|
+
group: import('@storecraft/core/api').QuickSearchResource[];
|
6
6
|
/**
|
7
7
|
* The group index
|
8
8
|
*/
|
@@ -29,12 +29,12 @@ export type SearchGroupParams = {
|
|
29
29
|
};
|
30
30
|
export type QuickSearchBrowserParams = {
|
31
31
|
onCancel?: () => any;
|
32
|
-
onSelect?: (name: string, value: import('@storecraft/core/
|
32
|
+
onSelect?: (name: string, value: import('@storecraft/core/api').QuickSearchResource) => any;
|
33
33
|
};
|
34
34
|
/**
|
35
35
|
* @typedef {object} QuickSearchBrowserParams
|
36
36
|
* @prop {() => any} [onCancel]
|
37
|
-
* @prop {(name: string, value: import('@storecraft/core/
|
37
|
+
* @prop {(name: string, value: import('@storecraft/core/api').QuickSearchResource) => any} [onSelect]
|
38
38
|
*
|
39
39
|
* @param {QuickSearchBrowserParams} params
|
40
40
|
*/
|
@@ -9,7 +9,7 @@ export default BrowseCollection;
|
|
9
9
|
* - query and filtering with `vql` search query
|
10
10
|
* - designed to be used inside a popup modal.
|
11
11
|
*/
|
12
|
-
export type BrowseCollectionParams<T extends import('@storecraft/core/
|
12
|
+
export type BrowseCollectionParams<T extends import('@storecraft/core/api').BaseType = import('@storecraft/core/api').BaseType> = {
|
13
13
|
resource: keyof App["db"]["resources"];
|
14
14
|
title?: string;
|
15
15
|
Comp?: React.FC<{
|
@@ -19,11 +19,11 @@ export type BrowseCollectionParams<T extends import('@storecraft/core/v-api').Ba
|
|
19
19
|
onCancel: () => void;
|
20
20
|
};
|
21
21
|
export type BrowseCustomersParams = {
|
22
|
-
onSave: (v: import('@storecraft/core/
|
22
|
+
onSave: (v: import('@storecraft/core/api').CustomerType[]) => void;
|
23
23
|
onCancel: () => void;
|
24
24
|
};
|
25
25
|
export type BrowseProductsParams = {
|
26
|
-
onSave: (v: import('@storecraft/core/
|
26
|
+
onSave: (v: import('@storecraft/core/api').ProductType[]) => void;
|
27
27
|
onCancel: () => void;
|
28
28
|
};
|
29
29
|
/**
|
@@ -33,7 +33,7 @@ export type BrowseProductsParams = {
|
|
33
33
|
* - query and filtering with `vql` search query
|
34
34
|
* - designed to be used inside a popup modal.
|
35
35
|
*
|
36
|
-
* @template {import('@storecraft/core/
|
36
|
+
* @template {import('@storecraft/core/api').BaseType} [T=import('@storecraft/core/api').BaseType]
|
37
37
|
*
|
38
38
|
*
|
39
39
|
* @typedef {object} BrowseCollectionParams
|
@@ -44,8 +44,8 @@ export type BrowseProductsParams = {
|
|
44
44
|
* @prop {() => void} onCancel
|
45
45
|
*/
|
46
46
|
/**
|
47
|
-
* @template {import('@storecraft/core/
|
47
|
+
* @template {import('@storecraft/core/api').BaseType} [T=import('@storecraft/core/api').BaseType]
|
48
48
|
*
|
49
49
|
* @param {BrowseCollectionParams<T>} params
|
50
50
|
*/
|
51
|
-
declare function BrowseCollection<T extends import('@storecraft/core/
|
51
|
+
declare function BrowseCollection<T extends import('@storecraft/core/api').BaseType = import('@storecraft/core/api').BaseType>({ resource, title, Comp, onSave, onCancel }: BrowseCollectionParams<T>): import("react").JSX.Element;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { App } from '@storecraft/core';
|
2
|
-
export function default_name_fn(it: import('@storecraft/core/
|
2
|
+
export function default_name_fn(it: import('@storecraft/core/api').BaseType): any;
|
3
3
|
export function default_transform_fn(window: any[]): any[];
|
4
4
|
export default SelectResource;
|
5
|
-
export function SelectResourceWithTags<T extends import('@storecraft/core/
|
5
|
+
export function SelectResourceWithTags<T extends import('@storecraft/core/api').BaseType>({ field, context, value, onChange, resource, add_all, transform_fn, name_fn, slug, label, className, ...rest }: SelectResourceWithTagsParams<T>): import("react").JSX.Element;
|
6
6
|
/**
|
7
7
|
* A simple `select` control, that fetches all documents in a `collection`,
|
8
8
|
* this is a good option for super small collections/tables such as:
|
@@ -5,8 +5,8 @@ export default StorefrontProducts;
|
|
5
5
|
* with pagination and selecting them.
|
6
6
|
*
|
7
7
|
* @param {import('./fields-view.jsx').FieldLeafViewParams<
|
8
|
-
* import('@storecraft/core/
|
8
|
+
* import('@storecraft/core/api').ProductType[],
|
9
9
|
* import('../pages/storefront.jsx').Context>} params
|
10
10
|
*
|
11
11
|
*/
|
12
|
-
declare function StorefrontProducts({ field, context, value, onChange }: import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/
|
12
|
+
declare function StorefrontProducts({ field, context, value, onChange }: import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/api').ProductType[], import('../pages/storefront.jsx').Context>): import("react").JSX.Element;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export function SelectTags({ onSelect, header, limit, layout, className, clsHeader, clsReload, ...rest }: Omit<import('./select-resource.jsx').SelectResourceParams<import('@storecraft/core/
|
1
|
+
export function SelectTags({ onSelect, header, limit, layout, className, clsHeader, clsReload, ...rest }: Omit<import('./select-resource.jsx').SelectResourceParams<import('@storecraft/core/api').TagType, string>, "resource" | "transform_fn" | "name_fn">): import("react").JSX.Element;
|
2
2
|
export default TagsEdit;
|
3
3
|
export type InternalManualTagParams = {
|
4
4
|
onAdd: (values: string[]) => void;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
export function TemplateExampleInput({ field, context, setError, value, onChange, ...rest }: TemplateTemplateParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "onChange">): import("react").JSX.Element;
|
2
2
|
export default TemplateExampleInput;
|
3
|
-
export type TemplateTemplateParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/
|
3
|
+
export type TemplateTemplateParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/api').TemplateType["reference_example_input"]>;
|
@@ -3,4 +3,4 @@ export default TemplateTemplate;
|
|
3
3
|
export type DangerousHTMLViewParams = {
|
4
4
|
value?: string | TrustedHTML;
|
5
5
|
};
|
6
|
-
export type TemplateTemplateParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/
|
6
|
+
export type TemplateTemplateParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/api').TemplateType["template_html" | "template_text"]>;
|
@@ -27,16 +27,16 @@ export type HookReturnType<T> = Omit<ReturnType<typeof useCollectionsActions<T>>
|
|
27
27
|
*
|
28
28
|
* This hook wraps `useCollection` hook
|
29
29
|
*
|
30
|
-
* @template {Partial<import('@storecraft/core/
|
30
|
+
* @template {Partial<import('@storecraft/core/api').BaseType> | any} [T=any]
|
31
31
|
*
|
32
32
|
* @param {((keyof App["db"]["resources"]) | 'payments/gateways' | 'extensions')} resource the collection id in backend
|
33
33
|
* @param {string} [slug] front end slug
|
34
34
|
* @param {boolean} [autoLoad=true]
|
35
|
-
* @param {import('@storecraft/core/
|
35
|
+
* @param {import('@storecraft/core/api').ApiQuery} [autoLoadQuery=q_initial]
|
36
36
|
*/
|
37
|
-
declare function useCollectionsActions<T extends unknown = any>(resource: ((keyof App["db"]["resources"]) | "payments/gateways" | "extensions"), slug?: string, autoLoad?: boolean, autoLoadQuery?: import('@storecraft/core/
|
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
38
|
resource: "search" | "auth_users" | "tags" | "collections" | "customers" | "products" | "storefronts" | "images" | "posts" | "templates" | "shipping_methods" | "notifications" | "discounts" | "orders" | "payments/gateways" | "extensions";
|
39
|
-
query_api: import('@storecraft/core/
|
39
|
+
query_api: import('@storecraft/core/api').ApiQuery;
|
40
40
|
ref_actions: import('react').MutableRefObject<import('../comps/collection-actions.jsx').ImperativeInterface>;
|
41
41
|
context: {
|
42
42
|
viewDocumentUrl: (id: string) => string;
|
@@ -51,16 +51,16 @@ 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/
|
54
|
+
onLimitChange: ($limit: number, perform_navigation?: boolean) => import('@storecraft/core/api').ApiQuery;
|
55
55
|
onReload: (perform_navigation?: boolean) => Promise<{
|
56
56
|
limit: number;
|
57
57
|
vql: string;
|
58
|
-
expand?: import('@storecraft/core/
|
59
|
-
vqlParsed?: import("@storecraft/core/
|
60
|
-
sortBy?: import('@storecraft/core/
|
61
|
-
order?: import('@storecraft/core/
|
58
|
+
expand?: import('@storecraft/core/api').ExpandQuery;
|
59
|
+
vqlParsed?: import("@storecraft/core/vql").VQL.AST;
|
60
|
+
sortBy?: import('@storecraft/core/api').SortCursor;
|
61
|
+
order?: import('@storecraft/core/api').SortOrder;
|
62
62
|
}>;
|
63
|
-
prev: (perform_navigation?: boolean) => Promise<import('@storecraft/core/
|
64
|
-
next: (perform_navigation?: boolean) => Promise<import('@storecraft/core/
|
63
|
+
prev: (perform_navigation?: boolean) => Promise<import('@storecraft/core/api').ApiQuery>;
|
64
|
+
next: (perform_navigation?: boolean) => Promise<import('@storecraft/core/api').ApiQuery>;
|
65
65
|
};
|
66
66
|
};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export function extract_contact_field(item: import('@storecraft/core/
|
1
|
+
export function extract_contact_field(item: import('@storecraft/core/api').CustomerType): string;
|
2
2
|
declare function _default({}: {}): import("react").JSX.Element;
|
3
3
|
export default _default;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export function SpanWithLogo({ value, children, className, context, extra, ...rest }: SpanWithLogoParams): import("react").JSX.Element;
|
2
2
|
declare function _default({}: {}): import("react").JSX.Element;
|
3
3
|
export default _default;
|
4
|
-
export type ExtensionItemGet = import('@storecraft/core/
|
4
|
+
export type ExtensionItemGet = import('@storecraft/core/api').ExtensionItemGet;
|
5
5
|
/**
|
6
6
|
* This is used in `TableSchemaView`
|
7
7
|
*/
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export function SpanWithLogo({ value, children, className, context, extra, ...rest }: SpanWithLogoParams): import("react").JSX.Element;
|
2
2
|
declare function _default({}: {}): import("react").JSX.Element;
|
3
3
|
export default _default;
|
4
|
-
export type PaymentGatewayItemGet = import('@storecraft/core/
|
4
|
+
export type PaymentGatewayItemGet = import('@storecraft/core/api').PaymentGatewayItemGet;
|
5
5
|
/**
|
6
6
|
* This is used in `TableSchemaView`
|
7
7
|
*/
|
@@ -6,7 +6,7 @@ export default _default;
|
|
6
6
|
* Intrinsic state of `product`
|
7
7
|
*/
|
8
8
|
export type State = {
|
9
|
-
data: import('@storecraft/core/
|
9
|
+
data: import('@storecraft/core/api').ProductType | import('@storecraft/core/api').VariantType;
|
10
10
|
hasChanged: boolean;
|
11
11
|
};
|
12
12
|
/**
|