@storecraft/dashboard 1.0.34 → 1.0.36
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/src/index.js +34719 -62337
- package/dist/lib/src/index.umd.cjs +459 -573
- package/dist/lib/src/src/apps/gallery/gallery-image-grid.d.ts +14 -0
- package/dist/lib/src/src/apps/gallery/gallery-page.d.ts +2 -0
- package/dist/lib/src/{apps → src/apps}/gallery/gallery-searchbar.d.ts +8 -7
- package/dist/lib/src/src/apps/gallery/gallery-select.d.ts +9 -0
- package/dist/lib/src/src/apps/gallery/gallery.d.ts +29 -0
- package/dist/lib/src/src/apps/gallery/image-header.d.ts +9 -0
- package/dist/lib/src/src/apps/gallery/image-page.d.ts +16 -0
- package/dist/lib/src/src/apps/gallery/utils.d.ts +2 -0
- package/dist/lib/src/src/apps/index.d.ts +2 -0
- package/dist/lib/src/src/comps/action-bar.d.ts +8 -0
- package/dist/lib/src/src/comps/air-date-picker.d.ts +6 -0
- package/dist/lib/src/src/comps/asset-favicon.d.ts +1 -0
- package/dist/lib/src/src/comps/attributes.d.ts +23 -0
- package/dist/lib/src/src/comps/base-chart-view.d.ts +31 -0
- package/dist/lib/src/src/comps/bulk-tag-products-in-collection.d.ts +9 -0
- package/dist/lib/src/src/comps/capsule.d.ts +8 -0
- package/dist/lib/src/src/comps/capsules-view.d.ts +10 -0
- package/dist/lib/src/src/comps/chart.demo.tsx.d.ts +2 -0
- package/dist/lib/src/src/comps/client-only.d.ts +3 -0
- package/dist/lib/src/src/comps/collection-actions.d.ts +21 -0
- package/dist/lib/src/src/comps/collection-products.d.ts +26 -0
- package/dist/lib/src/src/comps/common-button.d.ts +78 -0
- package/dist/lib/src/src/comps/common-fields.d.ts +83 -0
- package/dist/lib/src/src/comps/common-table-fields.d.ts +18 -0
- package/dist/lib/src/src/comps/common-ui.d.ts +97 -0
- package/dist/lib/src/{comps → src/comps}/copyable-view.d.ts +5 -2
- package/dist/lib/src/src/comps/customer-orders.d.ts +5 -0
- package/dist/lib/src/src/comps/dark-mode.d.ts +2 -0
- package/dist/lib/src/src/comps/discount-details.d.ts +54 -0
- package/dist/lib/src/src/comps/discount-filters.d.ts +60 -0
- package/dist/lib/src/src/comps/discount-performance.d.ts +5 -0
- package/dist/lib/src/src/comps/discounts-quick-search-actions.d.ts +2 -0
- package/dist/lib/src/src/comps/discounts-table-code.d.ts +8 -0
- package/dist/lib/src/src/comps/discounts-table-type.d.ts +6 -0
- package/dist/lib/src/src/comps/document-actions.d.ts +10 -0
- package/dist/lib/src/src/comps/document-details.d.ts +7 -0
- package/dist/lib/src/src/comps/document-title.d.ts +7 -0
- package/dist/lib/src/src/comps/drawer.d.ts +6 -0
- package/dist/lib/src/src/comps/error-message.d.ts +18 -0
- package/dist/lib/src/{comps → src/comps}/fields-view.d.ts +24 -27
- package/dist/lib/src/src/comps/gradient-text.d.ts +1 -0
- package/dist/lib/src/src/comps/home-header.d.ts +10 -0
- package/dist/lib/src/src/comps/home-invite-action-card.d.ts +7 -0
- package/dist/lib/src/src/comps/home-performace.d.ts +19 -0
- package/dist/lib/src/src/comps/home-sales-chart.d.ts +8 -0
- package/dist/lib/src/src/comps/home-stat-card.d.ts +10 -0
- package/dist/lib/src/src/comps/home-time-frame.d.ts +10 -0
- package/dist/lib/src/{comps → src/comps}/image-editor.d.ts +9 -42
- package/dist/lib/src/src/comps/img.d.ts +11 -0
- package/dist/lib/src/src/comps/json.d.ts +8 -0
- package/dist/lib/src/src/comps/lazy-carousel.d.ts +9 -0
- package/dist/lib/src/src/comps/loading-image.d.ts +3 -0
- package/dist/lib/src/src/comps/login-connect.d.ts +3 -0
- package/dist/lib/src/{comps → src/comps}/login-content.d.ts +1 -1
- package/dist/lib/src/src/comps/login-copyright.d.ts +3 -0
- package/dist/lib/src/src/comps/login-form.d.ts +16 -0
- package/dist/lib/src/{comps → src/comps}/login-latest-updates.d.ts +3 -6
- package/dist/lib/src/src/comps/login-marquee.d.ts +3 -0
- package/dist/lib/src/src/comps/logo-text.d.ts +4 -0
- package/dist/lib/src/src/comps/logo.d.ts +8 -0
- package/dist/lib/src/{comps → src/comps}/markdown-card.d.ts +2 -2
- package/dist/lib/src/src/comps/md-editor.d.ts +8 -0
- package/dist/lib/src/src/comps/md-view.d.ts +5 -0
- package/dist/lib/src/{comps → src/comps}/media.d.ts +13 -37
- package/dist/lib/src/{comps → src/comps}/modal.d.ts +4 -5
- package/dist/lib/src/src/comps/notifications-button.d.ts +11 -0
- package/dist/lib/src/{comps → src/comps}/notifications.d.ts +6 -5
- package/dist/lib/src/src/comps/order-coupon-info.d.ts +5 -0
- package/dist/lib/src/src/comps/order-delivery-method.d.ts +5 -0
- package/dist/lib/src/src/comps/order-line-items.d.ts +12 -0
- package/dist/lib/src/src/comps/order-payment-gateway.d.ts +16 -0
- package/dist/lib/src/src/comps/order-price.d.ts +12 -0
- package/dist/lib/src/src/comps/orders-quick-search-actions.d.ts +4 -0
- package/dist/lib/src/src/comps/overlay.d.ts +11 -0
- package/dist/lib/src/src/comps/portal-creator.d.ts +12 -0
- package/dist/lib/src/src/comps/product-discounts.d.ts +15 -0
- package/dist/lib/src/src/comps/product-related-products.d.ts +10 -0
- package/dist/lib/src/src/comps/products-variants.d.ts +26 -0
- package/dist/lib/src/src/comps/quick-search-browser.d.ts +26 -0
- package/dist/lib/src/src/comps/resource-browse.d.ts +30 -0
- package/dist/lib/src/src/comps/resource-onboard-svg.d.ts +2 -0
- package/dist/lib/src/src/comps/resource-title.d.ts +7 -0
- package/dist/lib/src/{comps → src/comps}/resource-view.d.ts +2 -2
- package/dist/lib/src/src/comps/secret-view.d.ts +4 -0
- package/dist/lib/src/src/comps/select-resource.d.ts +80 -0
- package/dist/lib/src/src/comps/settings-api-keys.d.ts +12 -0
- package/dist/lib/src/src/comps/settings-change-password.d.ts +1 -0
- package/dist/lib/src/src/comps/show-if.d.ts +14 -0
- package/dist/lib/src/src/comps/side-menu.d.ts +22 -0
- package/dist/lib/src/src/comps/splitter-view.d.ts +1 -0
- package/dist/lib/src/src/comps/storefront-products.d.ts +11 -0
- package/dist/lib/src/src/comps/symbols.d.ts +4 -0
- package/dist/lib/src/{comps → src/comps}/table-schema-view.d.ts +11 -10
- package/dist/lib/src/src/comps/tag-values.d.ts +5 -0
- package/dist/lib/src/src/comps/tags-edit.d.ts +12 -0
- package/dist/lib/src/src/comps/template-example-input.d.ts +5 -0
- package/dist/lib/src/src/comps/template-template.d.ts +18 -0
- package/dist/lib/src/src/comps/transition.d.ts +32 -0
- package/dist/lib/src/{hooks → src/hooks}/create-media-query-hook.d.ts +3 -3
- package/dist/lib/src/src/hooks/use-collections-actions.d.ts +48 -0
- package/dist/lib/src/src/hooks/use-document-actions.d.ts +64 -0
- package/dist/lib/src/src/hooks/use-interval.d.ts +8 -0
- package/dist/lib/src/src/hooks/use-keyboard-match.d.ts +5 -0
- package/dist/lib/src/src/hooks/use-media-query.d.ts +1 -0
- package/dist/lib/src/src/hooks/use-mounted.d.ts +1 -0
- package/dist/lib/src/src/hooks/use-navigate-with-state.d.ts +18 -0
- package/dist/lib/src/src/hooks/use-on-click-outside.d.ts +5 -0
- package/dist/lib/src/{hooks → src/hooks}/use-preferences.d.ts +4 -4
- package/dist/lib/src/src/hooks/use-scroll-delta.d.ts +13 -0
- package/dist/lib/src/src/hooks/use-toggle.d.ts +5 -0
- package/dist/lib/src/{hooks → src/hooks}/use-trigger.d.ts +2 -2
- package/dist/lib/src/src/hooks/utils.browser.d.ts +11 -0
- package/dist/lib/src/src/index.d.ts +13 -0
- package/dist/lib/src/src/layout.d.ts +9 -0
- package/dist/lib/src/src/login.d.ts +5 -0
- package/dist/lib/src/src/pages/collection.d.ts +17 -0
- package/dist/lib/src/src/pages/collections.d.ts +2 -0
- package/dist/lib/src/src/pages/customer.d.ts +17 -0
- package/dist/lib/src/src/pages/customers.d.ts +4 -0
- package/dist/lib/src/src/pages/discount.d.ts +18 -0
- package/dist/lib/src/src/pages/discounts.d.ts +2 -0
- package/dist/lib/src/src/pages/extension.d.ts +14 -0
- package/dist/lib/src/src/pages/extensions.d.ts +8 -0
- package/dist/lib/src/src/pages/home.d.ts +2 -0
- package/dist/lib/src/src/pages/index.d.ts +33 -0
- package/dist/lib/src/src/pages/order.d.ts +24 -0
- package/dist/lib/src/src/pages/orders.d.ts +2 -0
- package/dist/lib/src/src/pages/payment-gateway.d.ts +14 -0
- package/dist/lib/src/src/pages/payment-gateways.d.ts +8 -0
- package/dist/lib/src/src/pages/post.d.ts +18 -0
- package/dist/lib/src/src/pages/posts.d.ts +2 -0
- package/dist/lib/src/src/pages/product.d.ts +30 -0
- package/dist/lib/src/src/pages/products.d.ts +2 -0
- package/dist/lib/src/src/pages/settings.d.ts +2 -0
- package/dist/lib/src/src/pages/shipping-method.d.ts +18 -0
- package/dist/lib/src/src/pages/shipping-methods.d.ts +2 -0
- package/dist/lib/src/src/pages/storefront.d.ts +18 -0
- package/dist/lib/src/src/pages/storefronts.d.ts +2 -0
- package/dist/lib/src/src/pages/tag.d.ts +17 -0
- package/dist/lib/src/src/pages/tags.d.ts +2 -0
- package/dist/lib/src/src/pages/template.d.ts +13 -0
- package/dist/lib/src/src/pages/templates.d.ts +2 -0
- package/dist/lib/src/src/routes.d.ts +1 -0
- package/dist/lib/src/src/screens.d.ts +10 -0
- package/dist/lib/src/src/utils/index.d.ts +7 -0
- package/dist/lib/src/src/utils/time.d.ts +7 -0
- package/dist/website/assets/index-BjGWqHuK.js +685 -0
- package/dist/website/assets/style-BJD2VYZP.css +1 -0
- package/dist/website/index.html +2 -2
- package/package.json +29 -24
- package/dist/lib/src/apps/gallery/gallery-image-grid.d.ts +0 -30
- package/dist/lib/src/apps/gallery/gallery-page.d.ts +0 -2
- package/dist/lib/src/apps/gallery/gallery-select.d.ts +0 -7
- package/dist/lib/src/apps/gallery/gallery.d.ts +0 -56
- package/dist/lib/src/apps/gallery/image-header.d.ts +0 -18
- package/dist/lib/src/apps/gallery/image-page.d.ts +0 -16
- package/dist/lib/src/apps/gallery/index.d.ts +0 -1
- package/dist/lib/src/apps/gallery/utils.d.ts +0 -2
- package/dist/lib/src/apps/index.d.ts +0 -2
- package/dist/lib/src/comps/action-bar.d.ts +0 -25
- package/dist/lib/src/comps/asset-favicon.d.ts +0 -1
- package/dist/lib/src/comps/attributes.d.ts +0 -16
- package/dist/lib/src/comps/base-chart-view.d.ts +0 -20
- package/dist/lib/src/comps/bulk-tag-products-in-collection.d.ts +0 -5
- package/dist/lib/src/comps/capsule.d.ts +0 -8
- package/dist/lib/src/comps/capsules-view.d.ts +0 -27
- package/dist/lib/src/comps/client-only.d.ts +0 -11
- package/dist/lib/src/comps/collection-actions.d.ts +0 -35
- package/dist/lib/src/comps/collection-products.d.ts +0 -33
- package/dist/lib/src/comps/common-button.d.ts +0 -77
- package/dist/lib/src/comps/common-fields.d.ts +0 -61
- package/dist/lib/src/comps/common-table-fields.d.ts +0 -18
- package/dist/lib/src/comps/common-ui.d.ts +0 -101
- package/dist/lib/src/comps/customer-orders.d.ts +0 -13
- package/dist/lib/src/comps/dark-mode.d.ts +0 -5
- package/dist/lib/src/comps/discount-details.d.ts +0 -60
- package/dist/lib/src/comps/discount-filters.d.ts +0 -83
- package/dist/lib/src/comps/discount-performance.d.ts +0 -13
- package/dist/lib/src/comps/discounts-quick-search-actions.d.ts +0 -6
- package/dist/lib/src/comps/discounts-table-code.d.ts +0 -12
- package/dist/lib/src/comps/discounts-table-type.d.ts +0 -9
- package/dist/lib/src/comps/document-actions.d.ts +0 -11
- package/dist/lib/src/comps/document-details.d.ts +0 -20
- package/dist/lib/src/comps/document-title.d.ts +0 -20
- package/dist/lib/src/comps/drawer.d.ts +0 -18
- package/dist/lib/src/comps/error-message.d.ts +0 -29
- package/dist/lib/src/comps/gradient-text.d.ts +0 -1
- package/dist/lib/src/comps/home-header.d.ts +0 -24
- package/dist/lib/src/comps/home-invite-action-card.d.ts +0 -17
- package/dist/lib/src/comps/home-performace.d.ts +0 -33
- package/dist/lib/src/comps/home-sales-chart.d.ts +0 -20
- package/dist/lib/src/comps/home-stat-card.d.ts +0 -25
- package/dist/lib/src/comps/home-time-frame.d.ts +0 -21
- package/dist/lib/src/comps/img.d.ts +0 -11
- package/dist/lib/src/comps/json.d.ts +0 -14
- package/dist/lib/src/comps/lazy-carousel.d.ts +0 -20
- package/dist/lib/src/comps/login-connect.d.ts +0 -4
- package/dist/lib/src/comps/login-copyright.d.ts +0 -7
- package/dist/lib/src/comps/login-form.d.ts +0 -45
- package/dist/lib/src/comps/login-marquee.d.ts +0 -4
- package/dist/lib/src/comps/logo-text.d.ts +0 -2
- package/dist/lib/src/comps/logo.d.ts +0 -8
- package/dist/lib/src/comps/md-editor.d.ts +0 -20
- package/dist/lib/src/comps/md-view.d.ts +0 -16
- package/dist/lib/src/comps/notifications-button.d.ts +0 -28
- package/dist/lib/src/comps/order-coupon-info.d.ts +0 -12
- package/dist/lib/src/comps/order-delivery-method.d.ts +0 -11
- package/dist/lib/src/comps/order-line-items.d.ts +0 -19
- package/dist/lib/src/comps/order-payment-gateway.d.ts +0 -27
- package/dist/lib/src/comps/order-price.d.ts +0 -21
- package/dist/lib/src/comps/orders-quick-search-actions.d.ts +0 -9
- package/dist/lib/src/comps/overlay.d.ts +0 -19
- package/dist/lib/src/comps/portal-creator.d.ts +0 -6
- package/dist/lib/src/comps/product-discounts.d.ts +0 -22
- package/dist/lib/src/comps/product-related-products.d.ts +0 -10
- package/dist/lib/src/comps/products-variants-test.d.ts +0 -1
- package/dist/lib/src/comps/products-variants.d.ts +0 -38
- package/dist/lib/src/comps/quick-search-browser.d.ts +0 -32
- package/dist/lib/src/comps/resource-browse.d.ts +0 -51
- package/dist/lib/src/comps/resource-onboard-svg.d.ts +0 -2
- package/dist/lib/src/comps/resource-title.d.ts +0 -7
- package/dist/lib/src/comps/secret-view.d.ts +0 -9
- package/dist/lib/src/comps/select-resource.d.ts +0 -88
- package/dist/lib/src/comps/settings-api-keys.d.ts +0 -2
- package/dist/lib/src/comps/settings-change-password.d.ts +0 -2
- package/dist/lib/src/comps/settings-storage.d.ts +0 -15
- package/dist/lib/src/comps/show-if.d.ts +0 -25
- package/dist/lib/src/comps/side-menu.d.ts +0 -50
- package/dist/lib/src/comps/splitter-view.d.ts +0 -1
- package/dist/lib/src/comps/storefront-products.d.ts +0 -12
- package/dist/lib/src/comps/symbols.d.ts +0 -4
- package/dist/lib/src/comps/tag-values.d.ts +0 -9
- package/dist/lib/src/comps/tags-edit.d.ts +0 -13
- package/dist/lib/src/comps/template-example-input.d.ts +0 -3
- package/dist/lib/src/comps/template-template.d.ts +0 -6
- package/dist/lib/src/comps/transition.d.ts +0 -51
- package/dist/lib/src/hooks/use-collections-actions.d.ts +0 -43
- package/dist/lib/src/hooks/use-document-actions.d.ts +0 -37
- package/dist/lib/src/hooks/use-interval.d.ts +0 -13
- package/dist/lib/src/hooks/use-keyboard-match.d.ts +0 -6
- package/dist/lib/src/hooks/use-media-query.d.ts +0 -3
- package/dist/lib/src/hooks/use-mounted.d.ts +0 -1
- package/dist/lib/src/hooks/use-navigate-with-state.d.ts +0 -26
- package/dist/lib/src/hooks/use-on-click-outside.d.ts +0 -7
- package/dist/lib/src/hooks/use-scroll-delta.d.ts +0 -4
- package/dist/lib/src/hooks/use-toggle.d.ts +0 -7
- package/dist/lib/src/hooks/utils.browser.d.ts +0 -7
- package/dist/lib/src/index.cjs +0 -800
- package/dist/lib/src/index.d.ts +0 -6
- package/dist/lib/src/layout.d.ts +0 -18
- package/dist/lib/src/login.d.ts +0 -17
- package/dist/lib/src/pages/collection.d.ts +0 -15
- package/dist/lib/src/pages/collections.d.ts +0 -2
- package/dist/lib/src/pages/customer.d.ts +0 -15
- package/dist/lib/src/pages/customers.d.ts +0 -3
- package/dist/lib/src/pages/discount.d.ts +0 -15
- package/dist/lib/src/pages/discounts.d.ts +0 -2
- package/dist/lib/src/pages/extension.d.ts +0 -13
- package/dist/lib/src/pages/extensions.d.ts +0 -16
- package/dist/lib/src/pages/home.d.ts +0 -2
- package/dist/lib/src/pages/index.d.ts +0 -36
- package/dist/lib/src/pages/order.d.ts +0 -21
- package/dist/lib/src/pages/orders.d.ts +0 -2
- package/dist/lib/src/pages/payment-gateway.d.ts +0 -13
- package/dist/lib/src/pages/payment-gateways.d.ts +0 -16
- package/dist/lib/src/pages/post.d.ts +0 -15
- package/dist/lib/src/pages/posts.d.ts +0 -2
- package/dist/lib/src/pages/product.d.ts +0 -22
- package/dist/lib/src/pages/products.d.ts +0 -2
- package/dist/lib/src/pages/settings.d.ts +0 -4
- package/dist/lib/src/pages/shipping-method.d.ts +0 -15
- package/dist/lib/src/pages/shipping-methods.d.ts +0 -2
- package/dist/lib/src/pages/storefront.d.ts +0 -15
- package/dist/lib/src/pages/storefronts.d.ts +0 -2
- package/dist/lib/src/pages/tag.d.ts +0 -15
- package/dist/lib/src/pages/tags.d.ts +0 -2
- package/dist/lib/src/pages/template.d.ts +0 -15
- package/dist/lib/src/pages/templates.d.ts +0 -2
- package/dist/lib/src/routes.d.ts +0 -1
- package/dist/lib/src/utils/index.d.ts +0 -7
- package/dist/lib/src/utils/time.d.ts +0 -7
- package/dist/website/assets/index-DxEM6N8c.js +0 -813
- package/dist/website/assets/style-DkU0t4eA.css +0 -1
- /package/dist/lib/src/{auto-mount.d.ts → src/auto-mount.d.ts} +0 -0
- /package/dist/lib/src/{hooks → src/hooks}/use-dark-mode.d.ts +0 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
import { InferQueryableType, queryable_resources } from '@storecraft/sdk-react-hooks';
|
2
|
+
import { FieldViewImperativeInterface } from '../comps/fields-view';
|
3
|
+
import { BaseDocumentContext } from '../pages';
|
4
|
+
import { CreateDateImperativeInterface } from '../comps/common-ui';
|
5
|
+
/**
|
6
|
+
* @template T the `document` type
|
7
|
+
*
|
8
|
+
* @typedef {Omit<ReturnType<typeof useDocumentActions<T>>, 'doc'> &
|
9
|
+
* {
|
10
|
+
* doc: T
|
11
|
+
* }
|
12
|
+
* } HookReturnType This `type` will give you the return type of the hook
|
13
|
+
*
|
14
|
+
*/
|
15
|
+
export type DocumentActionsMode = 'edit' | 'view' | 'create';
|
16
|
+
/**
|
17
|
+
* Your definitive hook for `document` adventures with UI. Compared
|
18
|
+
* to `useDocument`, it adds:
|
19
|
+
* - Aggregating from a functional component
|
20
|
+
* - Paginating by url navigation, for state saving.
|
21
|
+
* - Context
|
22
|
+
*
|
23
|
+
*
|
24
|
+
* @template T The type of `document`
|
25
|
+
*
|
26
|
+
*
|
27
|
+
* @param {string | queryable_resources} resource
|
28
|
+
* resource `identifier`
|
29
|
+
* @param resource the collection id in backend
|
30
|
+
* @param document document `handle` or `id`
|
31
|
+
* @param slug resource `slug` at backend
|
32
|
+
* @param {DocumentActionsMode} mode
|
33
|
+
* @param {string} [base] base64 encoded base `document` to merge with
|
34
|
+
*
|
35
|
+
*/
|
36
|
+
export declare const useDocumentActions: <RESOURCE extends (string | queryable_resources) = queryable_resources, T extends InferQueryableType<RESOURCE> = InferQueryableType<RESOURCE>>(resource: RESOURCE, document: string, slug: string, mode?: DocumentActionsMode, base?: string) => {
|
37
|
+
actions: {
|
38
|
+
reloadPromise: (try_cache?: boolean) => Promise<void>;
|
39
|
+
reload_hard: import('react').MutableRefObject<(try_cache?: boolean) => Promise<InferQueryableType<RESOURCE>>>;
|
40
|
+
savePromise: () => Promise<InferQueryableType<RESOURCE>>;
|
41
|
+
deletePromise: () => Promise<string>;
|
42
|
+
duplicate: (state_next_extra?: Partial<T>) => Promise<void>;
|
43
|
+
navWithState: (to: import('react-router').To, current_state?: (() => any) | any, next_state?: (() => any) | any) => void;
|
44
|
+
reload: (try_cache?: boolean) => Promise<InferQueryableType<RESOURCE>>;
|
45
|
+
setError: import('react').Dispatch<any>;
|
46
|
+
};
|
47
|
+
error: any;
|
48
|
+
key: string;
|
49
|
+
ref_head: import('react').RefObject<CreateDateImperativeInterface>;
|
50
|
+
ref_root: import('react').RefObject<FieldViewImperativeInterface<T>>;
|
51
|
+
doc: T;
|
52
|
+
sdk: import('@storecraft/sdk').StorecraftSDK;
|
53
|
+
isEditMode: boolean;
|
54
|
+
isCreateMode: boolean;
|
55
|
+
isViewMode: boolean;
|
56
|
+
op: import('@storecraft/sdk-react-hooks').Op;
|
57
|
+
loading: boolean;
|
58
|
+
hasChanged: any;
|
59
|
+
hasLoaded: boolean;
|
60
|
+
context: BaseDocumentContext<{
|
61
|
+
hasChanged?: boolean;
|
62
|
+
data?: T;
|
63
|
+
}>;
|
64
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const useBreakpoint: (breakpoint: any, defaultValue?: boolean) => boolean, useBreakpointEffect: (breakpoint: any, effect: any) => any, useBreakpointValue: (breakpoint: any, valid: any, invalid: any) => any;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useMounted(): () => boolean;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
export type LinkWithStateProps = {
|
3
|
+
to: import('react-router-dom').To;
|
4
|
+
current_state: any | (() => any);
|
5
|
+
next_state?: any | (() => any);
|
6
|
+
onClick?: () => any;
|
7
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
8
|
+
export declare const LinkWithState: ({ to, current_state, next_state, onClick, ...rest }: LinkWithStateProps) => import("react/jsx-runtime").JSX.Element;
|
9
|
+
/**
|
10
|
+
* A hook that navigates, BUT saves the state of the current
|
11
|
+
*/
|
12
|
+
declare const useNavigateWithState: () => {
|
13
|
+
nav: import('react-router').NavigateFunction;
|
14
|
+
navWithState: (to: import('react-router-dom').To, current_state?: (() => any) | any, next_state?: (() => any) | any) => void;
|
15
|
+
location: import('react-router').Location<any>;
|
16
|
+
state: any;
|
17
|
+
};
|
18
|
+
export default useNavigateWithState;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export const usePreferences: () => {
|
2
|
-
state: StorecraftDashboardPreferences;
|
3
|
-
setState: ($state: StorecraftDashboardPreferences) => void;
|
4
|
-
};
|
5
1
|
export type StorecraftDashboardPreferences = {
|
6
2
|
darkMode?: boolean;
|
7
3
|
};
|
4
|
+
export declare const usePreferences: () => {
|
5
|
+
state: StorecraftDashboardPreferences;
|
6
|
+
setState: ($state: StorecraftDashboardPreferences) => void;
|
7
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* This hook will give a `div` reference and will decide based
|
3
|
+
* on scrolling if a `delta` area was going up or down more than
|
4
|
+
* `delta` threshold.
|
5
|
+
*
|
6
|
+
* This can be used to `open` or `close` a switch, which can be
|
7
|
+
* used for many things.
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
export declare const useScrollDelta: (scroll_delta?: number, default_open?: boolean) => {
|
11
|
+
ref_scroll_element: import('react').RefObject<HTMLDivElement>;
|
12
|
+
open: boolean;
|
13
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export declare const hasWindow: () => boolean;
|
2
|
+
export declare const LS: {
|
3
|
+
get: (key: string) => any;
|
4
|
+
set: (key: string, value: any) => void;
|
5
|
+
remove: (key: string) => void;
|
6
|
+
};
|
7
|
+
export declare const SS: {
|
8
|
+
get: (key: string) => any;
|
9
|
+
set: (key: string, value: any) => void;
|
10
|
+
remove: (key: string) => void;
|
11
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* @description mount `storecraft` inside an `HTML` element.
|
4
|
+
* This method returns an invokable `unmount` function.
|
5
|
+
* @param el html element to mount the dashboard
|
6
|
+
* @param is_backend_endpoint_editable to show the backend endpoint input field ?
|
7
|
+
*/
|
8
|
+
export declare const mountStorecraftDashboard: (el: HTMLElement, is_backend_endpoint_editable?: boolean) => () => void;
|
9
|
+
type DashboardParams = {
|
10
|
+
is_backend_endpoint_editable?: boolean;
|
11
|
+
};
|
12
|
+
export declare const Dashboard: ({ is_backend_endpoint_editable }: DashboardParams) => import("react/jsx-runtime").JSX.Element;
|
13
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
export declare const MainPortal: {
|
3
|
+
Portal: React.FC<{}>;
|
4
|
+
PortalChild: React.FC<{
|
5
|
+
children?: React.ReactNode;
|
6
|
+
}>;
|
7
|
+
};
|
8
|
+
declare const Layout: ({ children, className, ...rest }: React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
9
|
+
export default Layout;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { CollectionType } from '@storecraft/core/api';
|
2
|
+
import { BaseDocumentContext } from '.';
|
3
|
+
/**
|
4
|
+
* Intrinsic state of `collection`
|
5
|
+
*/
|
6
|
+
export type State = {
|
7
|
+
data: CollectionType;
|
8
|
+
hasChanged: boolean;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* Public `collection` context
|
12
|
+
*/
|
13
|
+
export type Context = BaseDocumentContext<State>;
|
14
|
+
declare const _default: ({ mode, ...rest }: {
|
15
|
+
mode: "view" | "edit" | "create";
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
17
|
+
export default _default;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { CustomerType } from '@storecraft/core/api';
|
2
|
+
import { BaseDocumentContext } from '.';
|
3
|
+
/**
|
4
|
+
* Intrinsic state
|
5
|
+
*/
|
6
|
+
export type State = {
|
7
|
+
data: CustomerType;
|
8
|
+
hasChanged: boolean;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* Public `tag` context
|
12
|
+
*/
|
13
|
+
export type Context = BaseDocumentContext<State>;
|
14
|
+
declare const _default: ({ mode, ...rest }: {
|
15
|
+
mode: "view" | "edit" | "create";
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
17
|
+
export default _default;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { DocumentActionsMode } from '../hooks/use-document-actions';
|
2
|
+
import { DiscountType } from '@storecraft/core/api';
|
3
|
+
import { BaseDocumentContext } from '.';
|
4
|
+
/**
|
5
|
+
* Intrinsic state
|
6
|
+
*/
|
7
|
+
export type State = {
|
8
|
+
data: DiscountType;
|
9
|
+
hasChanged: boolean;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* Public context
|
13
|
+
*/
|
14
|
+
export type Context = BaseDocumentContext<State>;
|
15
|
+
declare const _default: ({ mode, ...rest }: {
|
16
|
+
mode: DocumentActionsMode;
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
18
|
+
export default _default;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { BaseDocumentContext } from '.';
|
2
|
+
/**
|
3
|
+
* Intrinsic state
|
4
|
+
*/
|
5
|
+
export type State = {
|
6
|
+
data: undefined;
|
7
|
+
hasChanged: boolean;
|
8
|
+
};
|
9
|
+
/**
|
10
|
+
* Public context
|
11
|
+
*/
|
12
|
+
export type Context = BaseDocumentContext<State>;
|
13
|
+
declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
|
14
|
+
export default _default;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { TableSchemaViewComponentParams } from '../comps/table-schema-view';
|
2
|
+
import { ExtensionItemGet } from '@storecraft/core/api';
|
3
|
+
export type SpanWithLogoParams = TableSchemaViewComponentParams<ExtensionItemGet["info"]["name"], ExtensionItemGet> & React.ComponentProps<'div'> & {
|
4
|
+
extra?: string;
|
5
|
+
};
|
6
|
+
export declare const SpanWithLogo: ({ value, children, className, context, extra, ...rest }: SpanWithLogoParams) => import("react/jsx-runtime").JSX.Element;
|
7
|
+
declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
|
8
|
+
export default _default;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
export { default as Home } from './home';
|
2
|
+
export { default as Orders } from './orders';
|
3
|
+
export { default as Order } from './order';
|
4
|
+
export { default as Customers } from './customers';
|
5
|
+
export { default as Customer } from './customer';
|
6
|
+
export { default as Tags } from './tags';
|
7
|
+
export { default as Tag } from './tag';
|
8
|
+
export { default as Templates } from './templates';
|
9
|
+
export { default as Template } from './template';
|
10
|
+
export { default as Products } from './products';
|
11
|
+
export { default as Product } from './product';
|
12
|
+
export { default as Collections } from './collections';
|
13
|
+
export { default as Collection } from './collection';
|
14
|
+
export { default as Discounts } from './discounts';
|
15
|
+
export { default as Discount } from './discount';
|
16
|
+
export { default as ShippingMethods } from './shipping-methods';
|
17
|
+
export { default as ShippingMethod } from './shipping-method';
|
18
|
+
export { default as Storefronts } from './storefronts';
|
19
|
+
export { default as Storefront } from './storefront';
|
20
|
+
export { default as Posts } from './posts';
|
21
|
+
export { default as Post } from './post';
|
22
|
+
export { default as PaymentGateways } from './payment-gateways';
|
23
|
+
export { default as PaymentGateway } from './payment-gateway';
|
24
|
+
export { default as Extensions } from './extensions';
|
25
|
+
export { default as Extension } from './extension';
|
26
|
+
export { default as Settings } from './settings';
|
27
|
+
export type BaseDocumentState<T = any> = {
|
28
|
+
hasChanged?: boolean;
|
29
|
+
data?: T;
|
30
|
+
};
|
31
|
+
export type BaseDocumentContext<State extends BaseDocumentState = any> = {
|
32
|
+
getState?: () => State;
|
33
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { DocumentActionsMode } from '../hooks/use-document-actions';
|
2
|
+
import { OrderData } from '@storecraft/core/api';
|
3
|
+
import { BaseDocumentContext } from '.';
|
4
|
+
/**
|
5
|
+
* Intrinsic state of `order`
|
6
|
+
*/
|
7
|
+
export type State = {
|
8
|
+
data: OrderData;
|
9
|
+
hasChanged: boolean;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* Inner `order` context
|
13
|
+
*/
|
14
|
+
export type InnerContext = {
|
15
|
+
create_checkout: (gateay: string) => Promise<any>;
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* Public `order` context
|
19
|
+
*/
|
20
|
+
export type Context = BaseDocumentContext<State> & InnerContext;
|
21
|
+
declare const _default: ({ mode, ...rest }: {
|
22
|
+
mode: DocumentActionsMode;
|
23
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
24
|
+
export default _default;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { BaseDocumentContext } from './index';
|
2
|
+
/**
|
3
|
+
* Intrinsic state
|
4
|
+
*/
|
5
|
+
export type State = {
|
6
|
+
data: undefined;
|
7
|
+
hasChanged: boolean;
|
8
|
+
};
|
9
|
+
/**
|
10
|
+
* Public context
|
11
|
+
*/
|
12
|
+
export type Context = BaseDocumentContext<State>;
|
13
|
+
declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
|
14
|
+
export default _default;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { TableSchemaViewComponentParams } from '../comps/table-schema-view';
|
2
|
+
import { PaymentGatewayItemGet } from '@storecraft/core/api';
|
3
|
+
export type SpanWithLogoParams = TableSchemaViewComponentParams<PaymentGatewayItemGet["info"]["name"], PaymentGatewayItemGet> & React.ComponentProps<'div'> & {
|
4
|
+
extra?: string;
|
5
|
+
};
|
6
|
+
export declare const SpanWithLogo: ({ value, children, className, context, extra, ...rest }: SpanWithLogoParams) => import("react/jsx-runtime").JSX.Element;
|
7
|
+
declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
|
8
|
+
export default _default;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { PostType } from '@storecraft/core/api';
|
2
|
+
import { BaseDocumentContext } from '.';
|
3
|
+
/**
|
4
|
+
* Intrinsic state of `post`
|
5
|
+
*/
|
6
|
+
export type State = {
|
7
|
+
data: PostType;
|
8
|
+
hasChanged: boolean;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* Public `post` context
|
12
|
+
*/
|
13
|
+
export type Context = BaseDocumentContext<State>;
|
14
|
+
declare const _default: ({ mode, ...rest }: {
|
15
|
+
[x: string]: any;
|
16
|
+
mode: any;
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
18
|
+
export default _default;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { ProductType, VariantType } from '@storecraft/core/api';
|
2
|
+
import { BaseDocumentContext } from '.';
|
3
|
+
/**
|
4
|
+
* Intrinsic state of `product`
|
5
|
+
*/
|
6
|
+
export type State = {
|
7
|
+
data: ProductType | VariantType;
|
8
|
+
hasChanged: boolean;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* Inner `product` context
|
12
|
+
*/
|
13
|
+
export type InnerProductContext = {
|
14
|
+
removeVariant: (product_variant_handle: string) => Promise<void>;
|
15
|
+
preCreateVariant: () => Promise<void>;
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* Public `product` context
|
19
|
+
*/
|
20
|
+
export type Context = InnerProductContext & BaseDocumentContext<State>;
|
21
|
+
/**
|
22
|
+
* @param {{
|
23
|
+
* mode: import('@/hooks/use-document-actions.js').DocumentActionsMode
|
24
|
+
* }} params
|
25
|
+
*/
|
26
|
+
declare const _default: ({ mode, ...rest }: {
|
27
|
+
[x: string]: any;
|
28
|
+
mode: any;
|
29
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
30
|
+
export default _default;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { DocumentActionsMode } from '../hooks/use-document-actions';
|
2
|
+
import { ShippingMethodType } from '@storecraft/core/api';
|
3
|
+
import { BaseDocumentContext } from '.';
|
4
|
+
/**
|
5
|
+
* Intrinsic state of `shipping`
|
6
|
+
*/
|
7
|
+
export type State = {
|
8
|
+
data: ShippingMethodType;
|
9
|
+
hasChanged: boolean;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* Public `shipping` context
|
13
|
+
*/
|
14
|
+
export type Context = BaseDocumentContext<State>;
|
15
|
+
declare const _default: ({ mode, ...rest }: {
|
16
|
+
mode: DocumentActionsMode;
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
18
|
+
export default _default;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { DocumentActionsMode } from '../hooks/use-document-actions';
|
2
|
+
import { StorefrontType } from '@storecraft/core/api';
|
3
|
+
import { BaseDocumentContext } from '.';
|
4
|
+
/**
|
5
|
+
* Intrinsic state
|
6
|
+
*/
|
7
|
+
export type State = {
|
8
|
+
data: StorefrontType;
|
9
|
+
hasChanged: boolean;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* Public context
|
13
|
+
*/
|
14
|
+
export type Context = BaseDocumentContext<State>;
|
15
|
+
declare const _default: ({ mode, ...rest }: {
|
16
|
+
mode: DocumentActionsMode;
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
18
|
+
export default _default;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { TagType } from '@storecraft/core/api';
|
2
|
+
import { BaseDocumentContext } from '.';
|
3
|
+
/**
|
4
|
+
* Intrinsic state of `tag`
|
5
|
+
*/
|
6
|
+
export type State = {
|
7
|
+
data: TagType;
|
8
|
+
hasChanged: boolean;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* Public `tag` context
|
12
|
+
*/
|
13
|
+
export type Context = BaseDocumentContext<State>;
|
14
|
+
declare const _default: ({ mode, ...rest }: {
|
15
|
+
mode: "create" | "edit" | "view";
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
17
|
+
export default _default;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { TemplateType } from '@storecraft/core/api';
|
2
|
+
import { BaseDocumentContext } from '.';
|
3
|
+
/** Intrinsic state */
|
4
|
+
export type State = {
|
5
|
+
data: TemplateType;
|
6
|
+
hasChanged: boolean;
|
7
|
+
};
|
8
|
+
/** Public context */
|
9
|
+
export type Context = BaseDocumentContext<State>;
|
10
|
+
declare const _default: ({ mode, ...rest }: {
|
11
|
+
mode: "view" | "edit" | "create";
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
13
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function Main(props: any): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export declare const to_slug: (val: string) => string;
|
2
|
+
export declare const capFirstLetter: (v: string) => string;
|
3
|
+
export declare const read_clipboard: () => Promise<any>;
|
4
|
+
export declare const write_clipboard: (text: string) => Promise<void>;
|
5
|
+
export declare const hasTouchScreen: () => boolean;
|
6
|
+
export declare const encode: (o: object) => string;
|
7
|
+
export declare const decode: (c: string) => any;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export declare const SECOND = 1000;
|
2
|
+
export declare const MINUTE: number;
|
3
|
+
export declare const HOUR: number;
|
4
|
+
export declare const DAY: number;
|
5
|
+
export declare const MONTH: number;
|
6
|
+
export declare const YEAR: number;
|
7
|
+
export declare const timeSince: (date: number | string | Date) => string;
|