@storecraft/dashboard 1.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/README.md +54 -0
- package/dist/a.html +31 -0
- package/dist/lib/index.cjs +802 -0
- package/dist/lib/index.js +67697 -0
- package/dist/lib/index.umd.cjs +802 -0
- package/dist/lib/src/apps/gallery/gallery-image-grid.d.ts +30 -0
- package/dist/lib/src/apps/gallery/gallery-page.d.ts +2 -0
- package/dist/lib/src/apps/gallery/gallery-searchbar.d.ts +17 -0
- package/dist/lib/src/apps/gallery/gallery-select.d.ts +7 -0
- package/dist/lib/src/apps/gallery/gallery.d.ts +56 -0
- package/dist/lib/src/apps/gallery/image-header.d.ts +18 -0
- package/dist/lib/src/apps/gallery/image-page.d.ts +16 -0
- package/dist/lib/src/apps/gallery/index.d.ts +1 -0
- package/dist/lib/src/apps/gallery/utils.d.ts +2 -0
- package/dist/lib/src/apps/index.d.ts +2 -0
- package/dist/lib/src/auto-mount.d.ts +1 -0
- package/dist/lib/src/comps/action-bar.d.ts +25 -0
- package/dist/lib/src/comps/attributes.d.ts +16 -0
- package/dist/lib/src/comps/base-chart-view.d.ts +20 -0
- package/dist/lib/src/comps/bulk-tag-products-in-collection.d.ts +5 -0
- package/dist/lib/src/comps/capsule.d.ts +8 -0
- package/dist/lib/src/comps/capsules-view.d.ts +27 -0
- package/dist/lib/src/comps/client-only.d.ts +11 -0
- package/dist/lib/src/comps/collection-actions.d.ts +35 -0
- package/dist/lib/src/comps/collection-products.d.ts +32 -0
- package/dist/lib/src/comps/common-button.d.ts +77 -0
- package/dist/lib/src/comps/common-fields.d.ts +61 -0
- package/dist/lib/src/comps/common-table-fields.d.ts +18 -0
- package/dist/lib/src/comps/common-ui.d.ts +101 -0
- package/dist/lib/src/comps/copyable-view.d.ts +15 -0
- package/dist/lib/src/comps/customer-orders.d.ts +13 -0
- package/dist/lib/src/comps/dark-mode.d.ts +5 -0
- package/dist/lib/src/comps/discount-details.d.ts +60 -0
- package/dist/lib/src/comps/discount-filters.d.ts +153 -0
- package/dist/lib/src/comps/discount-performance.d.ts +13 -0
- package/dist/lib/src/comps/discounts-quick-search-actions.d.ts +6 -0
- package/dist/lib/src/comps/discounts-table-code.d.ts +12 -0
- package/dist/lib/src/comps/discounts-table-type.d.ts +9 -0
- package/dist/lib/src/comps/document-actions.d.ts +11 -0
- package/dist/lib/src/comps/document-details.d.ts +20 -0
- package/dist/lib/src/comps/document-title.d.ts +20 -0
- package/dist/lib/src/comps/drawer.d.ts +18 -0
- package/dist/lib/src/comps/error-message.d.ts +29 -0
- package/dist/lib/src/comps/fields-view.d.ts +107 -0
- package/dist/lib/src/comps/gradient-text.d.ts +1 -0
- package/dist/lib/src/comps/home-header.d.ts +24 -0
- package/dist/lib/src/comps/home-invite-action-card.d.ts +17 -0
- package/dist/lib/src/comps/home-performace.d.ts +33 -0
- package/dist/lib/src/comps/home-sales-chart.d.ts +20 -0
- package/dist/lib/src/comps/home-stat-card.d.ts +24 -0
- package/dist/lib/src/comps/home-time-frame.d.ts +21 -0
- package/dist/lib/src/comps/image-editor.d.ts +111 -0
- package/dist/lib/src/comps/img.d.ts +11 -0
- package/dist/lib/src/comps/json.d.ts +14 -0
- package/dist/lib/src/comps/lazy-carousel.d.ts +20 -0
- package/dist/lib/src/comps/login-connect.d.ts +4 -0
- package/dist/lib/src/comps/login-content.d.ts +7 -0
- package/dist/lib/src/comps/login-copyright.d.ts +7 -0
- package/dist/lib/src/comps/login-form.d.ts +44 -0
- package/dist/lib/src/comps/login-marquee.d.ts +4 -0
- package/dist/lib/src/comps/logo.d.ts +4 -0
- package/dist/lib/src/comps/markdown-card.d.ts +18 -0
- package/dist/lib/src/comps/md-editor.d.ts +20 -0
- package/dist/lib/src/comps/md-view.d.ts +16 -0
- package/dist/lib/src/comps/media.d.ts +107 -0
- package/dist/lib/src/comps/modal.d.ts +15 -0
- package/dist/lib/src/comps/notifications-button.d.ts +28 -0
- package/dist/lib/src/comps/notifications.d.ts +15 -0
- package/dist/lib/src/comps/order-coupon-info.d.ts +12 -0
- package/dist/lib/src/comps/order-delivery-method.d.ts +11 -0
- package/dist/lib/src/comps/order-line-items.d.ts +19 -0
- package/dist/lib/src/comps/order-payment-gateway.d.ts +23 -0
- package/dist/lib/src/comps/order-price.d.ts +15 -0
- package/dist/lib/src/comps/orders-quick-search-actions.d.ts +9 -0
- package/dist/lib/src/comps/overlay.d.ts +19 -0
- package/dist/lib/src/comps/portal-creator.d.ts +6 -0
- package/dist/lib/src/comps/product-discounts.d.ts +22 -0
- package/dist/lib/src/comps/product-related-products.d.ts +10 -0
- package/dist/lib/src/comps/products-variants-test.d.ts +1 -0
- package/dist/lib/src/comps/products-variants.d.ts +38 -0
- package/dist/lib/src/comps/quick-search-browser.d.ts +32 -0
- package/dist/lib/src/comps/resource-browse.d.ts +51 -0
- package/dist/lib/src/comps/resource-onboard-svg.d.ts +2 -0
- package/dist/lib/src/comps/resource-title.d.ts +7 -0
- package/dist/lib/src/comps/resource-view.d.ts +25 -0
- package/dist/lib/src/comps/secret-view.d.ts +9 -0
- package/dist/lib/src/comps/select-resource.d.ts +88 -0
- package/dist/lib/src/comps/settings-api-keys.d.ts +2 -0
- package/dist/lib/src/comps/settings-storage.d.ts +15 -0
- package/dist/lib/src/comps/show-if.d.ts +25 -0
- package/dist/lib/src/comps/side-menu.d.ts +50 -0
- package/dist/lib/src/comps/splitter-view.d.ts +1 -0
- package/dist/lib/src/comps/storefront-products.d.ts +12 -0
- package/dist/lib/src/comps/symbols.d.ts +4 -0
- package/dist/lib/src/comps/table-schema-view.d.ts +68 -0
- package/dist/lib/src/comps/tag-values.d.ts +9 -0
- package/dist/lib/src/comps/tags-edit.d.ts +13 -0
- package/dist/lib/src/comps/template-example-input.d.ts +3 -0
- package/dist/lib/src/comps/template-template.d.ts +6 -0
- package/dist/lib/src/comps/transition.d.ts +51 -0
- package/dist/lib/src/hooks/createMediaQueryHook.d.ts +8 -0
- package/dist/lib/src/hooks/useCollectionsActions.d.ts +66 -0
- package/dist/lib/src/hooks/useDarkMode.d.ts +9 -0
- package/dist/lib/src/hooks/useDocumentActions.d.ts +35 -0
- package/dist/lib/src/hooks/useInterval.d.ts +13 -0
- package/dist/lib/src/hooks/useKeyboardMatch.d.ts +6 -0
- package/dist/lib/src/hooks/useMediaQuery.d.ts +3 -0
- package/dist/lib/src/hooks/useMounted.d.ts +1 -0
- package/dist/lib/src/hooks/useNavigateWithState.d.ts +26 -0
- package/dist/lib/src/hooks/useOnClickOutside.d.ts +7 -0
- package/dist/lib/src/hooks/usePreferences.d.ts +7 -0
- package/dist/lib/src/hooks/useScrollDelta.d.ts +4 -0
- package/dist/lib/src/hooks/useToggle.d.ts +7 -0
- package/dist/lib/src/hooks/useTrigger.d.ts +5 -0
- package/dist/lib/src/hooks/utils.browser.d.ts +7 -0
- package/dist/lib/src/index.d.ts +6 -0
- package/dist/lib/src/layout.d.ts +18 -0
- package/dist/lib/src/login.d.ts +17 -0
- package/dist/lib/src/main.d.ts +1 -0
- package/dist/lib/src/pages/collection.d.ts +15 -0
- package/dist/lib/src/pages/collections.d.ts +2 -0
- package/dist/lib/src/pages/customer.d.ts +15 -0
- package/dist/lib/src/pages/customers.d.ts +3 -0
- package/dist/lib/src/pages/discount.d.ts +15 -0
- package/dist/lib/src/pages/discounts.d.ts +2 -0
- package/dist/lib/src/pages/extension.d.ts +13 -0
- package/dist/lib/src/pages/extensions.d.ts +16 -0
- package/dist/lib/src/pages/home.d.ts +2 -0
- package/dist/lib/src/pages/index.d.ts +36 -0
- package/dist/lib/src/pages/order.d.ts +15 -0
- package/dist/lib/src/pages/orders.d.ts +2 -0
- package/dist/lib/src/pages/payment-gateway.d.ts +13 -0
- package/dist/lib/src/pages/payment-gateways.d.ts +16 -0
- package/dist/lib/src/pages/post.d.ts +15 -0
- package/dist/lib/src/pages/posts.d.ts +2 -0
- package/dist/lib/src/pages/product.d.ts +22 -0
- package/dist/lib/src/pages/products.d.ts +2 -0
- package/dist/lib/src/pages/settings.d.ts +4 -0
- package/dist/lib/src/pages/shipping-method.d.ts +15 -0
- package/dist/lib/src/pages/shipping-methods.d.ts +2 -0
- package/dist/lib/src/pages/storefront.d.ts +15 -0
- package/dist/lib/src/pages/storefronts.d.ts +2 -0
- package/dist/lib/src/pages/tag.d.ts +15 -0
- package/dist/lib/src/pages/tags.d.ts +2 -0
- package/dist/lib/src/pages/template.d.ts +15 -0
- package/dist/lib/src/pages/templates.d.ts +2 -0
- package/dist/lib/src/routes.d.ts +1 -0
- package/dist/lib/src/utils/index.d.ts +7 -0
- package/dist/lib/src/utils/time.d.ts +7 -0
- package/dist/website/a.html +31 -0
- package/dist/website/assets/index-Bcp1qc1F.js +801 -0
- package/dist/website/assets/index-C-yHq9o3.js +801 -0
- package/dist/website/assets/index-CUTe6Gm_.js +801 -0
- package/dist/website/assets/index-N4DVLmRv.js +801 -0
- package/dist/website/assets/style-AZ1dEhGu.css +1 -0
- package/dist/website/index.html +14 -0
- package/dist/website/index.js +67682 -0
- package/dist/website/index.umd.cjs +802 -0
- package/dist/website/main-old.png +0 -0
- package/dist/website/main.png +0 -0
- package/dist/website/main2.png +0 -0
- package/dist/website/main3.png +0 -0
- package/dist/website/main4.png +0 -0
- package/dist/website/main5.png +0 -0
- package/dist/website/main_half.png +0 -0
- package/dist/website/vite.svg +1 -0
- package/package.json +83 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
export default ProductVariants;
|
2
|
+
export type ProductOptionParams = {
|
3
|
+
option: import('@storecraft/core/v-api').VariantOption;
|
4
|
+
onRemove: (option: import('@storecraft/core/v-api').VariantOption) => void;
|
5
|
+
onChange: (option: import('@storecraft/core/v-api').VariantOption) => void;
|
6
|
+
};
|
7
|
+
export type ProductOptionsParams = {
|
8
|
+
options: import('@storecraft/core/v-api').VariantOption[];
|
9
|
+
onChange: (option: import('@storecraft/core/v-api').VariantOption[]) => void;
|
10
|
+
};
|
11
|
+
export type VariantParams = {
|
12
|
+
options: import('@storecraft/core/v-api').VariantOption[];
|
13
|
+
combination: import('@storecraft/core/v-api').VariantOptionSelection[];
|
14
|
+
context: Context;
|
15
|
+
setError: (error: string) => void;
|
16
|
+
};
|
17
|
+
export type VariantsViewParams = {
|
18
|
+
options: import('@storecraft/core/v-api').VariantOption[];
|
19
|
+
context: Context;
|
20
|
+
setError: (error: string) => void;
|
21
|
+
};
|
22
|
+
export type Context = import('./fields-view.jsx').FieldContextData<import('@storecraft/core/v-api').VariantType & import('@storecraft/core/v-api').ProductType> & import('../pages/product.jsx').Context;
|
23
|
+
/**
|
24
|
+
* @typedef {import('./fields-view.jsx').FieldContextData<
|
25
|
+
* import('@storecraft/core/v-api').VariantType &
|
26
|
+
* import('@storecraft/core/v-api').ProductType> &
|
27
|
+
* import('../pages/product.jsx').Context
|
28
|
+
* } Context
|
29
|
+
*
|
30
|
+
*
|
31
|
+
* @param {import('./fields-view.jsx').FieldLeafViewParams<
|
32
|
+
* import('@storecraft/core/v-api').VariantOption[],
|
33
|
+
* Context> &
|
34
|
+
* React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
35
|
+
* } params
|
36
|
+
*
|
37
|
+
*/
|
38
|
+
declare function ProductVariants({ value, onChange, context, setError, ...rest }: import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/v-api').VariantOption[], Context> & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element | "You have to create the product before you add variants";
|
@@ -0,0 +1,32 @@
|
|
1
|
+
export function QuickSearchButton({ onClick, ...rest }: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element;
|
2
|
+
export default QuickSearchBrowser;
|
3
|
+
export type SearchGroupParams = {
|
4
|
+
name: string;
|
5
|
+
group: import('@storecraft/core/v-api').QuickSearchResource[];
|
6
|
+
/**
|
7
|
+
* The group index
|
8
|
+
*/
|
9
|
+
index: number;
|
10
|
+
/**
|
11
|
+
* The item index
|
12
|
+
*/
|
13
|
+
selectedItemIndex: number;
|
14
|
+
/**
|
15
|
+
* The item index
|
16
|
+
*/
|
17
|
+
scrollIntoView?: boolean;
|
18
|
+
onHover: (groupindex: number, itemIndex: number) => any;
|
19
|
+
onClick: (groupindex: number, itemIndex: number) => any;
|
20
|
+
};
|
21
|
+
export type QuickSearchBrowserParams = {
|
22
|
+
onCancel?: () => any;
|
23
|
+
onSelect?: (name: string, value: import('@storecraft/core/v-api').QuickSearchResource) => any;
|
24
|
+
};
|
25
|
+
/**
|
26
|
+
* @typedef {object} QuickSearchBrowserParams
|
27
|
+
* @prop {() => any} [onCancel]
|
28
|
+
* @prop {(name: string, value: import('@storecraft/core/v-api').QuickSearchResource) => any} [onSelect]
|
29
|
+
*
|
30
|
+
* @param {QuickSearchBrowserParams} params
|
31
|
+
*/
|
32
|
+
declare function QuickSearchBrowser({ onCancel, onSelect }: QuickSearchBrowserParams): import("react").JSX.Element;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { App } from '@storecraft/core';
|
2
|
+
export function BrowseCustomers({ onSave, onCancel }: BrowseCustomersParams): import("react").JSX.Element;
|
3
|
+
export function BrowseProducts({ onSave, onCancel }: BrowseProductsParams): import("react").JSX.Element;
|
4
|
+
export default BrowseCollection;
|
5
|
+
/**
|
6
|
+
* `BrowseCollection` is used to :
|
7
|
+
* - **view** and **select** items in big collections
|
8
|
+
* - Infinite pagination
|
9
|
+
* - query and filtering with `vql` search query
|
10
|
+
* - designed to be used inside a popup modal.
|
11
|
+
*/
|
12
|
+
export type BrowseCollectionParams<T extends import('@storecraft/core/v-api').BaseType = import('@storecraft/core/v-api').BaseType> = {
|
13
|
+
resource: keyof App["db"]["resources"];
|
14
|
+
title?: string;
|
15
|
+
Comp?: React.FC<{
|
16
|
+
data: object;
|
17
|
+
}>;
|
18
|
+
onSave: (v: T[]) => void;
|
19
|
+
onCancel: () => void;
|
20
|
+
};
|
21
|
+
export type BrowseCustomersParams = {
|
22
|
+
onSave: (v: import('@storecraft/core/v-api').CustomerType[]) => void;
|
23
|
+
onCancel: () => void;
|
24
|
+
};
|
25
|
+
export type BrowseProductsParams = {
|
26
|
+
onSave: (v: import('@storecraft/core/v-api').ProductType[]) => void;
|
27
|
+
onCancel: () => void;
|
28
|
+
};
|
29
|
+
/**
|
30
|
+
* `BrowseCollection` is used to :
|
31
|
+
* - **view** and **select** items in big collections
|
32
|
+
* - Infinite pagination
|
33
|
+
* - query and filtering with `vql` search query
|
34
|
+
* - designed to be used inside a popup modal.
|
35
|
+
*
|
36
|
+
* @template {import('@storecraft/core/v-api').BaseType} [T=import('@storecraft/core/v-api').BaseType]
|
37
|
+
*
|
38
|
+
*
|
39
|
+
* @typedef {object} BrowseCollectionParams
|
40
|
+
* @prop {keyof App["db"]["resources"]} resource
|
41
|
+
* @prop {string} [title]
|
42
|
+
* @prop {React.FC<{data: object}>} [Comp]
|
43
|
+
* @prop {(v: T[]) => void} onSave
|
44
|
+
* @prop {() => void} onCancel
|
45
|
+
*/
|
46
|
+
/**
|
47
|
+
* @template {import('@storecraft/core/v-api').BaseType} [T=import('@storecraft/core/v-api').BaseType]
|
48
|
+
*
|
49
|
+
* @param {BrowseCollectionParams<T>} params
|
50
|
+
*/
|
51
|
+
declare function BrowseCollection<T extends import('@storecraft/core/v-api').BaseType = import('@storecraft/core/v-api').BaseType>({ resource, title, Comp, onSave, onCancel }: BrowseCollectionParams<T>): import("react").JSX.Element;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export function ResourceTitle({ resource, should_onboard, hasLoaded, overallColelctionCount: overallCollectionCount }: ResourceTitleParams): import("react").JSX.Element;
|
2
|
+
export type ResourceTitleParams = {
|
3
|
+
resource: string;
|
4
|
+
should_onboard?: boolean;
|
5
|
+
hasLoaded?: boolean;
|
6
|
+
overallColelctionCount?: number;
|
7
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
export default ResourceView;
|
2
|
+
export type ImpInterface = {
|
3
|
+
refresh: () => Promise<void>;
|
4
|
+
};
|
5
|
+
export type ResourceViewParams = {
|
6
|
+
/**
|
7
|
+
* `resource` at the backend endpoint, that supports
|
8
|
+
* querying
|
9
|
+
*/
|
10
|
+
resource: string;
|
11
|
+
/**
|
12
|
+
* `limit` of query
|
13
|
+
*/
|
14
|
+
limit?: number;
|
15
|
+
schema: any[];
|
16
|
+
/**
|
17
|
+
* context
|
18
|
+
*/
|
19
|
+
context?: any;
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* `ResourceView` lets you view and paginate big collections
|
23
|
+
* rendered in `TableSchemaView`
|
24
|
+
*/
|
25
|
+
declare const ResourceView: import('react').ForwardRefExoticComponent<ResourceViewParams & import('react').RefAttributes<any>>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export default SecretView;
|
2
|
+
/**
|
3
|
+
*
|
4
|
+
* @param {import('./fields-view.jsx').FieldLeafViewParams<
|
5
|
+
* string> &
|
6
|
+
* React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
7
|
+
* } params
|
8
|
+
*/
|
9
|
+
declare function SecretView({ value, field, onChange, context, setError, ...rest }: import('./fields-view.jsx').FieldLeafViewParams<string> & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element;
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import { App } from '@storecraft/core';
|
2
|
+
export function default_name_fn(it: import('@storecraft/core/v-api').BaseType): any;
|
3
|
+
export function default_transform_fn(window: any[]): any[];
|
4
|
+
export default SelectResource;
|
5
|
+
export function SelectResourceWithTags<T extends import('@storecraft/core/v-api').BaseType>({ field, context, value, onChange, resource, add_all, transform_fn, name_fn, slug, label, className, ...rest }: SelectResourceWithTagsParams<T>): import("react").JSX.Element;
|
6
|
+
/**
|
7
|
+
* A simple `select` control, that fetches all documents in a `collection`,
|
8
|
+
* this is a good option for super small collections/tables such as:
|
9
|
+
* - `Shipping Methods`
|
10
|
+
* - `Collections`
|
11
|
+
* - `Posts`
|
12
|
+
* - `Discounts`
|
13
|
+
* Which will mostly have no more that 50 items each.
|
14
|
+
*
|
15
|
+
* If you need something with pagination, try `BrowseCollection` instead.
|
16
|
+
*/
|
17
|
+
export type SelectResourceParams<T, TRANSFORM = T> = {
|
18
|
+
/**
|
19
|
+
* callback when selection is made (value) => any
|
20
|
+
*/
|
21
|
+
onSelect: (value: TRANSFORM) => any;
|
22
|
+
header: string;
|
23
|
+
/**
|
24
|
+
* add all sentinal
|
25
|
+
*/
|
26
|
+
add_all?: boolean;
|
27
|
+
/**
|
28
|
+
* add all sentinal
|
29
|
+
*/
|
30
|
+
layout: 0 | 1;
|
31
|
+
/**
|
32
|
+
* table identifier to query
|
33
|
+
*/
|
34
|
+
resource: keyof App["db"]["resources"];
|
35
|
+
/**
|
36
|
+
* number of item to query
|
37
|
+
*/
|
38
|
+
limit?: number;
|
39
|
+
className?: string;
|
40
|
+
clsHeader?: string;
|
41
|
+
clsReload?: string;
|
42
|
+
transform_fn?: (value: T[]) => TRANSFORM[];
|
43
|
+
name_fn?: (value: TRANSFORM) => string;
|
44
|
+
};
|
45
|
+
/**
|
46
|
+
* A `FieldView` `select` control with `capsules`
|
47
|
+
*/
|
48
|
+
export type InnerSelectResourceWithTagsParams = {
|
49
|
+
label: string;
|
50
|
+
slug: string;
|
51
|
+
};
|
52
|
+
export type SelectResourceWithTagsParams<T> = InnerSelectResourceWithTagsParams & SelectResourceParams<T> & import('./fields-view.jsx').FieldLeafViewParams<T[], import('../pages/index.jsx').BaseDocumentContext>;
|
53
|
+
/**
|
54
|
+
* A simple `select` control, that fetches all documents in a `collection`,
|
55
|
+
* this is a good option for super small collections/tables such as:
|
56
|
+
* - `Shipping Methods`
|
57
|
+
* - `Collections`
|
58
|
+
* - `Posts`
|
59
|
+
* - `Discounts`
|
60
|
+
* Which will mostly have no more that 50 items each.
|
61
|
+
*
|
62
|
+
* If you need something with pagination, try `BrowseCollection` instead.
|
63
|
+
*
|
64
|
+
* @template T
|
65
|
+
* @template [TRANSFORM=T]
|
66
|
+
*
|
67
|
+
* @typedef {object} SelectResourceParams
|
68
|
+
* @property {(value: TRANSFORM) => any} onSelect callback when selection is made (value) => any
|
69
|
+
* @property {string} header
|
70
|
+
* @property {boolean} [add_all] add all sentinal
|
71
|
+
* @property {0 | 1} layout add all sentinal
|
72
|
+
* @property {keyof App["db"]["resources"]} resource table identifier to query
|
73
|
+
* @property {number} [limit] number of item to query
|
74
|
+
* @property {string} [className]
|
75
|
+
* @property {string} [clsHeader]
|
76
|
+
* @property {string} [clsReload]
|
77
|
+
* @property {(value: T[]) => TRANSFORM[]} [transform_fn]
|
78
|
+
* @property {(value: TRANSFORM) => string} [name_fn]
|
79
|
+
*/
|
80
|
+
/**
|
81
|
+
*
|
82
|
+
* @template T
|
83
|
+
* @template [TRANSFORM=T]
|
84
|
+
*
|
85
|
+
* @param {SelectResourceParams<T, TRANSFORM>} params
|
86
|
+
*
|
87
|
+
*/
|
88
|
+
declare function SelectResource<T, TRANSFORM = T>({ onSelect, header, resource, limit, layout, add_all, transform_fn, name_fn, className, clsHeader, clsReload, ...rest }: SelectResourceParams<T, TRANSFORM>): import("react").JSX.Element;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export default StorageSettingsView;
|
2
|
+
export type StorageProvider = {
|
3
|
+
key: string;
|
4
|
+
name: string;
|
5
|
+
select_comp: any;
|
6
|
+
config_comp: any;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
*
|
10
|
+
* @param {object} param0
|
11
|
+
* @param {StorageSettings} param0.value
|
12
|
+
*/
|
13
|
+
declare function StorageSettingsView({ field, value, onChange, className, ...rest }: {
|
14
|
+
value: StorageSettings;
|
15
|
+
}): import("react").JSX.Element;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
export function ShowSwitch({ index, children, ...rest }: ShowSwitchParams): React.JSX.Element;
|
3
|
+
export function ShowBinarySwitch({ toggle, children, ...rest }: InternalShowBinarySwitchParams & ShowSwitchParams): React.JSX.Element;
|
4
|
+
export default ShowIf;
|
5
|
+
export type ShowIfParams = {
|
6
|
+
show: any;
|
7
|
+
children: React.ReactNode;
|
8
|
+
};
|
9
|
+
export type internalShowSwitchParams = {
|
10
|
+
index?: number;
|
11
|
+
};
|
12
|
+
export type ShowSwitchParams = internalShowSwitchParams & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
13
|
+
export type InternalShowBinarySwitchParams = {
|
14
|
+
toggle?: any;
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
*
|
18
|
+
* @typedef {object} ShowIfParams
|
19
|
+
* @prop {any} show
|
20
|
+
* @prop {React.ReactNode} children
|
21
|
+
*
|
22
|
+
*
|
23
|
+
* @param {ShowIfParams} params
|
24
|
+
*/
|
25
|
+
declare function ShowIf({ show, children }: ShowIfParams): React.ReactNode;
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
export default SideMenu;
|
3
|
+
export type MenuItemType = {
|
4
|
+
name: string;
|
5
|
+
slug?: string;
|
6
|
+
icon?: React.JSX.Element;
|
7
|
+
extra?: object;
|
8
|
+
items?: MenuItemType[];
|
9
|
+
};
|
10
|
+
export type MenuType = {
|
11
|
+
items: MenuItemType[];
|
12
|
+
info: {
|
13
|
+
name?: string;
|
14
|
+
icon?: React.JSX.Element;
|
15
|
+
};
|
16
|
+
};
|
17
|
+
export type InnerSideMenuParams = {
|
18
|
+
menu: MenuType;
|
19
|
+
onCloseClick: () => void;
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
*
|
23
|
+
* @typedef {object} MenuItemType
|
24
|
+
* @prop {string} name
|
25
|
+
* @prop {string} [slug]
|
26
|
+
* @prop {React.JSX.Element} [icon]
|
27
|
+
* @prop {object} [extra]
|
28
|
+
* @prop {MenuItemType[]} [items]
|
29
|
+
*
|
30
|
+
*
|
31
|
+
* @typedef {object} MenuType
|
32
|
+
* @prop {MenuItemType[]} items
|
33
|
+
* @prop {object} info
|
34
|
+
* @prop {string} [info.name]
|
35
|
+
* @prop {React.JSX.Element} [info.icon]
|
36
|
+
*
|
37
|
+
*/
|
38
|
+
/**
|
39
|
+
*
|
40
|
+
* @typedef {object} InnerSideMenuParams
|
41
|
+
* @prop {MenuType} menu
|
42
|
+
* @prop {() => void} onCloseClick
|
43
|
+
*
|
44
|
+
*
|
45
|
+
* @param {InnerSideMenuParams &
|
46
|
+
* React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
47
|
+
* } params
|
48
|
+
*
|
49
|
+
*/
|
50
|
+
declare function SideMenu({ className, onCloseClick, menu: { items, info } }: InnerSideMenuParams & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): React.JSX.Element;
|
@@ -0,0 +1 @@
|
|
1
|
+
export function Splitter({ children, ...rest }: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export default StorefrontProducts;
|
2
|
+
/**
|
3
|
+
* `StorefrontProducts` is located at the `storefront.jsx` page.
|
4
|
+
* It consists of abutton, that opens a modal to query `products`
|
5
|
+
* with pagination and selecting them.
|
6
|
+
*
|
7
|
+
* @param {import('./fields-view.jsx').FieldLeafViewParams<
|
8
|
+
* import('@storecraft/core/v-api').ProductType[],
|
9
|
+
* import('../pages/storefront.jsx').Context>} params
|
10
|
+
*
|
11
|
+
*/
|
12
|
+
declare function StorefrontProducts({ field, context, value, onChange }: import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/v-api').ProductType[], import('../pages/storefront.jsx').Context>): import("react").JSX.Element;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
export function TableSchemaView<T>({ context, fields, data, recordClassName, className }: {
|
2
|
+
context: any;
|
3
|
+
fields: TableSchemaViewField<T, keyof T, import('react').FC<TableSchemaViewComponentParams<T, keyof T>>>[];
|
4
|
+
data: object[];
|
5
|
+
recordClassName?: string;
|
6
|
+
className?: string;
|
7
|
+
}): import("react").JSX.Element;
|
8
|
+
/**
|
9
|
+
* The context provided to
|
10
|
+
* components of `TableSchemaView`
|
11
|
+
*/
|
12
|
+
export type TableSchemaViewContext<T extends import('@storecraft/core/v-api').BaseType> = {
|
13
|
+
/**
|
14
|
+
* item
|
15
|
+
*/
|
16
|
+
item: T;
|
17
|
+
deleteDocument: (id: string) => Promise<void>;
|
18
|
+
editDocumentUrl: (id: string) => string;
|
19
|
+
viewDocumentUrl: (id: string) => string;
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* infer `params` of `react` functional component
|
23
|
+
*/
|
24
|
+
export type Params<T> = T extends import('react').FC<infer P> ? P : never;
|
25
|
+
/**
|
26
|
+
* The `field` parameter given to `TableSchemaView`
|
27
|
+
* components
|
28
|
+
*/
|
29
|
+
export type TableSchemaViewField<T extends unknown, Key extends keyof T = keyof T, Comp extends import('react').FC<{}> = import('react').FC<TableSchemaViewComponentParams<T, Key>>> = {
|
30
|
+
/**
|
31
|
+
* Key of field in the data
|
32
|
+
*/
|
33
|
+
key: Key;
|
34
|
+
/**
|
35
|
+
* Name of field
|
36
|
+
*/
|
37
|
+
name: string;
|
38
|
+
/**
|
39
|
+
* Name of field
|
40
|
+
*/
|
41
|
+
comp: React.FC<Params<Comp> & TableSchemaViewComponentParams<T[Key], T>>;
|
42
|
+
/**
|
43
|
+
* component parameters
|
44
|
+
*/
|
45
|
+
comp_params?: Params<Comp>;
|
46
|
+
/**
|
47
|
+
* transform data
|
48
|
+
*/
|
49
|
+
transform?: Key extends undefined ? (x: T) => any : (x: T[Key]) => T[Key];
|
50
|
+
};
|
51
|
+
/**
|
52
|
+
* The `params` of components of
|
53
|
+
* `TableSchemaView`
|
54
|
+
*/
|
55
|
+
export type TableSchemaViewComponentParams<V extends unknown, T extends unknown = any> = {
|
56
|
+
/**
|
57
|
+
* Key of field in the data
|
58
|
+
*/
|
59
|
+
field?: TableSchemaViewField<T>;
|
60
|
+
/**
|
61
|
+
* Context
|
62
|
+
*/
|
63
|
+
context?: TableSchemaViewContext<T>;
|
64
|
+
/**
|
65
|
+
* Value of field
|
66
|
+
*/
|
67
|
+
value?: V;
|
68
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export function values_validator(v: any): (string | number)[];
|
2
|
+
export default TagValues;
|
3
|
+
/**
|
4
|
+
*
|
5
|
+
* @param {import("./fields-view.jsx").FieldLeafViewParams<
|
6
|
+
* string[]>
|
7
|
+
* } params
|
8
|
+
*/
|
9
|
+
declare function TagValues({ field, value, onChange, ...rest }: import('./fields-view.jsx').FieldLeafViewParams<string[]>): import("react").JSX.Element;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export function SelectTags({ onSelect, header, limit, layout, className, clsHeader, clsReload, ...rest }: Omit<import('./select-resource.jsx').SelectResourceParams<import('@storecraft/core/v-api').TagType, string>, 'resource' | 'transform_fn' | 'name_fn'>): import("react").JSX.Element;
|
2
|
+
export default TagsEdit;
|
3
|
+
export type InternalManualTagParams = {
|
4
|
+
onAdd: (values: string[]) => void;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
*
|
8
|
+
* @param {import("./fields-view.jsx").FieldLeafViewParams<string[],
|
9
|
+
* import("../pages/index.jsx").BaseDocumentContext> &
|
10
|
+
* React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
11
|
+
* } param0
|
12
|
+
*/
|
13
|
+
declare function TagsEdit({ field, context, value, onChange, ...rest }: import('./fields-view.jsx').FieldLeafViewParams<string[], import('../pages/index.jsx').BaseDocumentContext> & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
export function TemplateExampleInput({ field, context, setError, value, onChange, ...rest }: TemplateTemplateParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange'>): import("react").JSX.Element;
|
2
|
+
export default TemplateExampleInput;
|
3
|
+
export type TemplateTemplateParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/v-api').TemplateType["reference_example_input"]>;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export function TemplateTemplate({ field, context, setError, value, onChange, ...rest }: TemplateTemplateParams & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange'>): import("react").JSX.Element;
|
2
|
+
export default TemplateTemplate;
|
3
|
+
export type DangerousHTMLViewParams = {
|
4
|
+
value?: string | TrustedHTML;
|
5
|
+
};
|
6
|
+
export type TemplateTemplateParams = import('./fields-view.jsx').FieldLeafViewParams<import('@storecraft/core/v-api').TemplateType["template_html" | "template_text"]>;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
export default Transition;
|
2
|
+
export type InnerTransitionParams = {
|
3
|
+
show: boolean;
|
4
|
+
unMountOnExit: boolean;
|
5
|
+
duration: number;
|
6
|
+
/**
|
7
|
+
* class-names for `event`
|
8
|
+
*/
|
9
|
+
enter: string;
|
10
|
+
/**
|
11
|
+
* class-names for `event`
|
12
|
+
*/
|
13
|
+
enterFrom: string;
|
14
|
+
/**
|
15
|
+
* class-names for `event`
|
16
|
+
*/
|
17
|
+
enterTo: string;
|
18
|
+
/**
|
19
|
+
* class-names for `event`
|
20
|
+
*/
|
21
|
+
leave: string;
|
22
|
+
/**
|
23
|
+
* class-names for `event`
|
24
|
+
*/
|
25
|
+
leaveFrom: string;
|
26
|
+
/**
|
27
|
+
* class-names for `event`
|
28
|
+
*/
|
29
|
+
leaveTo: string;
|
30
|
+
};
|
31
|
+
/**
|
32
|
+
*
|
33
|
+
* @typedef {object} InnerTransitionParams
|
34
|
+
* @prop {boolean} show
|
35
|
+
* @prop {boolean} unMountOnExit
|
36
|
+
* @prop {number} duration
|
37
|
+
* @prop {string} enter class-names for `event`
|
38
|
+
* @prop {string} enterFrom class-names for `event`
|
39
|
+
* @prop {string} enterTo class-names for `event`
|
40
|
+
* @prop {string} leave class-names for `event`
|
41
|
+
* @prop {string} leaveFrom class-names for `event`
|
42
|
+
* @prop {string} leaveTo class-names for `event`
|
43
|
+
*
|
44
|
+
*
|
45
|
+
*
|
46
|
+
* @param {InnerTransitionParams &
|
47
|
+
* React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
48
|
+
* } params
|
49
|
+
*
|
50
|
+
*/
|
51
|
+
declare function Transition({ show, duration, unMountOnExit, enter, enterFrom, enterTo, leave, leaveFrom, leaveTo, children, className, ...rest }: InnerTransitionParams & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>): import("react").JSX.Element;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export function create(screens: any): {
|
2
|
+
useBreakpoint: (breakpoint: any, defaultValue?: boolean) => boolean;
|
3
|
+
useBreakpointEffect: (breakpoint: any, effect: any) => any;
|
4
|
+
useBreakpointValue: (breakpoint: any, valid: any, invalid: any) => any;
|
5
|
+
};
|
6
|
+
export const isSSR: boolean;
|
7
|
+
export const isBrowser: boolean;
|
8
|
+
export default create;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { App } from '@storecraft/core';
|
2
|
+
export default useCollectionsActions;
|
3
|
+
/**
|
4
|
+
* This `type` will give you the return type of the hook
|
5
|
+
*/
|
6
|
+
export type HookReturnType<T> = Omit<ReturnType<typeof useCollectionsActions<T>>, 'page' | 'pages'> & {
|
7
|
+
page: T[];
|
8
|
+
pages: T[][];
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* @template T the `document` type
|
12
|
+
*
|
13
|
+
* @typedef {Omit<ReturnType<typeof useCollectionsActions<T>>, 'page' | 'pages'> &
|
14
|
+
* {
|
15
|
+
* page: T[],
|
16
|
+
* pages: T[][]
|
17
|
+
* }
|
18
|
+
* } HookReturnType This `type` will give you the return type of the hook
|
19
|
+
*
|
20
|
+
*/
|
21
|
+
/**
|
22
|
+
* `useCollectionsActions` is a hook designed for the collections pages,
|
23
|
+
* for performing:
|
24
|
+
* - Viewing of collections
|
25
|
+
* - Pagination through querying or navigation
|
26
|
+
* - Querying
|
27
|
+
*
|
28
|
+
* This hook wraps `useCollection` hook
|
29
|
+
*
|
30
|
+
* @template {Partial<import('@storecraft/core/v-api').BaseType>} T
|
31
|
+
*
|
32
|
+
* @param {((keyof App["db"]["resources"]) | 'payments/gateways' | 'extensions')} resource the collection id in backend
|
33
|
+
* @param {string} [slug] front end slug
|
34
|
+
* @param {boolean} [autoLoad=true]
|
35
|
+
* @param {import('@storecraft/core/v-api').ApiQuery} [autoLoadQuery=q_initial]
|
36
|
+
*/
|
37
|
+
declare function useCollectionsActions<T extends Partial<import('@storecraft/core/v-api').BaseType>>(resource: ((keyof App["db"]["resources"]) | 'payments/gateways' | 'extensions'), slug?: string, autoLoad?: boolean, autoLoadQuery?: import('@storecraft/core/v-api').ApiQuery): {
|
38
|
+
resource: "search" | "products" | "collections" | "discounts" | "tags" | "shipping_methods" | "posts" | "auth_users" | "customers" | "storefronts" | "images" | "templates" | "notifications" | "orders" | "extensions" | "payments/gateways";
|
39
|
+
query_api: import('@storecraft/core/v-api').ApiQuery;
|
40
|
+
ref_actions: import('react').MutableRefObject<import('../comps/collection-actions.jsx').ImperativeInterface>;
|
41
|
+
context: {
|
42
|
+
viewDocumentUrl: (id: string) => string;
|
43
|
+
editDocumentUrl: (id: string) => string;
|
44
|
+
deleteDocument: (document: string) => Promise<string>;
|
45
|
+
};
|
46
|
+
pages: T[][];
|
47
|
+
page: T[];
|
48
|
+
loading: boolean;
|
49
|
+
hasLoaded: boolean;
|
50
|
+
resource_is_probably_empty: boolean;
|
51
|
+
error: any;
|
52
|
+
queryCount: number;
|
53
|
+
actions: {
|
54
|
+
onLimitChange: ($limit: number, perform_navigation?: boolean) => import('@storecraft/core/v-api').ApiQuery;
|
55
|
+
onReload: (perform_navigation?: boolean) => Promise<{
|
56
|
+
limit: number;
|
57
|
+
vql: string;
|
58
|
+
expand?: import('@storecraft/core/v-api').ExpandQuery;
|
59
|
+
vqlParsed?: import("@storecraft/core/v-ql").VQL.Node;
|
60
|
+
sortBy?: import('@storecraft/core/v-api').SortCursor;
|
61
|
+
order?: import('@storecraft/core/v-api').SortOrder;
|
62
|
+
}>;
|
63
|
+
prev: (perform_navigation?: boolean) => Promise<import('@storecraft/core/v-api').ApiQuery>;
|
64
|
+
next: (perform_navigation?: boolean) => Promise<import('@storecraft/core/v-api').ApiQuery>;
|
65
|
+
};
|
66
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { App } from '@storecraft/core';
|
2
|
+
export function useDocumentActions<T extends {}>(resource: (keyof App["db"]["resources"] | 'payments/gateways' | 'extensions'), document: string, slug: string, mode?: DocumentActionsMode, base?: string): {
|
3
|
+
actions: {
|
4
|
+
reloadPromise: (try_cache?: boolean) => Promise<void>;
|
5
|
+
savePromise: () => Promise<T>;
|
6
|
+
deletePromise: () => Promise<string>;
|
7
|
+
duplicate: (state_next_extra?: Partial<T>) => Promise<void>;
|
8
|
+
navWithState: (to: import('react-router').To, current_state?: any, next_state?: any) => void;
|
9
|
+
reload: (try_cache?: boolean) => Promise<T>;
|
10
|
+
setError: import('react').Dispatch<any>;
|
11
|
+
};
|
12
|
+
error: any;
|
13
|
+
key: string;
|
14
|
+
ref_head: import('react').MutableRefObject<import('../comps/common-ui.jsx').CreateDateImperativeInterface>;
|
15
|
+
ref_root: import('react').MutableRefObject<import('../comps/fields-view.jsx').FieldViewImperativeInterface<T>>;
|
16
|
+
doc: T;
|
17
|
+
sdk: import('@storecraft/sdk').StorecraftSDK;
|
18
|
+
isEditMode: boolean;
|
19
|
+
isCreateMode: boolean;
|
20
|
+
isViewMode: boolean;
|
21
|
+
loading: boolean;
|
22
|
+
hasChanged: any;
|
23
|
+
hasLoaded: boolean;
|
24
|
+
context: import('../pages/index.jsx').BaseDocumentContext<{
|
25
|
+
hasChanged?: boolean;
|
26
|
+
data?: T;
|
27
|
+
}>;
|
28
|
+
};
|
29
|
+
/**
|
30
|
+
* This `type` will give you the return type of the hook
|
31
|
+
*/
|
32
|
+
export type HookReturnType<T> = Omit<ReturnType<typeof useDocumentActions<T>>, 'doc'> & {
|
33
|
+
doc: T;
|
34
|
+
};
|
35
|
+
export type DocumentActionsMode = 'edit' | 'view' | 'create';
|