@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.
Files changed (287) hide show
  1. package/dist/lib/src/index.js +34719 -62337
  2. package/dist/lib/src/index.umd.cjs +459 -573
  3. package/dist/lib/src/src/apps/gallery/gallery-image-grid.d.ts +14 -0
  4. package/dist/lib/src/src/apps/gallery/gallery-page.d.ts +2 -0
  5. package/dist/lib/src/{apps → src/apps}/gallery/gallery-searchbar.d.ts +8 -7
  6. package/dist/lib/src/src/apps/gallery/gallery-select.d.ts +9 -0
  7. package/dist/lib/src/src/apps/gallery/gallery.d.ts +29 -0
  8. package/dist/lib/src/src/apps/gallery/image-header.d.ts +9 -0
  9. package/dist/lib/src/src/apps/gallery/image-page.d.ts +16 -0
  10. package/dist/lib/src/src/apps/gallery/utils.d.ts +2 -0
  11. package/dist/lib/src/src/apps/index.d.ts +2 -0
  12. package/dist/lib/src/src/comps/action-bar.d.ts +8 -0
  13. package/dist/lib/src/src/comps/air-date-picker.d.ts +6 -0
  14. package/dist/lib/src/src/comps/asset-favicon.d.ts +1 -0
  15. package/dist/lib/src/src/comps/attributes.d.ts +23 -0
  16. package/dist/lib/src/src/comps/base-chart-view.d.ts +31 -0
  17. package/dist/lib/src/src/comps/bulk-tag-products-in-collection.d.ts +9 -0
  18. package/dist/lib/src/src/comps/capsule.d.ts +8 -0
  19. package/dist/lib/src/src/comps/capsules-view.d.ts +10 -0
  20. package/dist/lib/src/src/comps/chart.demo.tsx.d.ts +2 -0
  21. package/dist/lib/src/src/comps/client-only.d.ts +3 -0
  22. package/dist/lib/src/src/comps/collection-actions.d.ts +21 -0
  23. package/dist/lib/src/src/comps/collection-products.d.ts +26 -0
  24. package/dist/lib/src/src/comps/common-button.d.ts +78 -0
  25. package/dist/lib/src/src/comps/common-fields.d.ts +83 -0
  26. package/dist/lib/src/src/comps/common-table-fields.d.ts +18 -0
  27. package/dist/lib/src/src/comps/common-ui.d.ts +97 -0
  28. package/dist/lib/src/{comps → src/comps}/copyable-view.d.ts +5 -2
  29. package/dist/lib/src/src/comps/customer-orders.d.ts +5 -0
  30. package/dist/lib/src/src/comps/dark-mode.d.ts +2 -0
  31. package/dist/lib/src/src/comps/discount-details.d.ts +54 -0
  32. package/dist/lib/src/src/comps/discount-filters.d.ts +60 -0
  33. package/dist/lib/src/src/comps/discount-performance.d.ts +5 -0
  34. package/dist/lib/src/src/comps/discounts-quick-search-actions.d.ts +2 -0
  35. package/dist/lib/src/src/comps/discounts-table-code.d.ts +8 -0
  36. package/dist/lib/src/src/comps/discounts-table-type.d.ts +6 -0
  37. package/dist/lib/src/src/comps/document-actions.d.ts +10 -0
  38. package/dist/lib/src/src/comps/document-details.d.ts +7 -0
  39. package/dist/lib/src/src/comps/document-title.d.ts +7 -0
  40. package/dist/lib/src/src/comps/drawer.d.ts +6 -0
  41. package/dist/lib/src/src/comps/error-message.d.ts +18 -0
  42. package/dist/lib/src/{comps → src/comps}/fields-view.d.ts +24 -27
  43. package/dist/lib/src/src/comps/gradient-text.d.ts +1 -0
  44. package/dist/lib/src/src/comps/home-header.d.ts +10 -0
  45. package/dist/lib/src/src/comps/home-invite-action-card.d.ts +7 -0
  46. package/dist/lib/src/src/comps/home-performace.d.ts +19 -0
  47. package/dist/lib/src/src/comps/home-sales-chart.d.ts +8 -0
  48. package/dist/lib/src/src/comps/home-stat-card.d.ts +10 -0
  49. package/dist/lib/src/src/comps/home-time-frame.d.ts +10 -0
  50. package/dist/lib/src/{comps → src/comps}/image-editor.d.ts +9 -42
  51. package/dist/lib/src/src/comps/img.d.ts +11 -0
  52. package/dist/lib/src/src/comps/json.d.ts +8 -0
  53. package/dist/lib/src/src/comps/lazy-carousel.d.ts +9 -0
  54. package/dist/lib/src/src/comps/loading-image.d.ts +3 -0
  55. package/dist/lib/src/src/comps/login-connect.d.ts +3 -0
  56. package/dist/lib/src/{comps → src/comps}/login-content.d.ts +1 -1
  57. package/dist/lib/src/src/comps/login-copyright.d.ts +3 -0
  58. package/dist/lib/src/src/comps/login-form.d.ts +16 -0
  59. package/dist/lib/src/{comps → src/comps}/login-latest-updates.d.ts +3 -6
  60. package/dist/lib/src/src/comps/login-marquee.d.ts +3 -0
  61. package/dist/lib/src/src/comps/logo-text.d.ts +4 -0
  62. package/dist/lib/src/src/comps/logo.d.ts +8 -0
  63. package/dist/lib/src/{comps → src/comps}/markdown-card.d.ts +2 -2
  64. package/dist/lib/src/src/comps/md-editor.d.ts +8 -0
  65. package/dist/lib/src/src/comps/md-view.d.ts +5 -0
  66. package/dist/lib/src/{comps → src/comps}/media.d.ts +13 -37
  67. package/dist/lib/src/{comps → src/comps}/modal.d.ts +4 -5
  68. package/dist/lib/src/src/comps/notifications-button.d.ts +11 -0
  69. package/dist/lib/src/{comps → src/comps}/notifications.d.ts +6 -5
  70. package/dist/lib/src/src/comps/order-coupon-info.d.ts +5 -0
  71. package/dist/lib/src/src/comps/order-delivery-method.d.ts +5 -0
  72. package/dist/lib/src/src/comps/order-line-items.d.ts +12 -0
  73. package/dist/lib/src/src/comps/order-payment-gateway.d.ts +16 -0
  74. package/dist/lib/src/src/comps/order-price.d.ts +12 -0
  75. package/dist/lib/src/src/comps/orders-quick-search-actions.d.ts +4 -0
  76. package/dist/lib/src/src/comps/overlay.d.ts +11 -0
  77. package/dist/lib/src/src/comps/portal-creator.d.ts +12 -0
  78. package/dist/lib/src/src/comps/product-discounts.d.ts +15 -0
  79. package/dist/lib/src/src/comps/product-related-products.d.ts +10 -0
  80. package/dist/lib/src/src/comps/products-variants.d.ts +26 -0
  81. package/dist/lib/src/src/comps/quick-search-browser.d.ts +26 -0
  82. package/dist/lib/src/src/comps/resource-browse.d.ts +30 -0
  83. package/dist/lib/src/src/comps/resource-onboard-svg.d.ts +2 -0
  84. package/dist/lib/src/src/comps/resource-title.d.ts +7 -0
  85. package/dist/lib/src/{comps → src/comps}/resource-view.d.ts +2 -2
  86. package/dist/lib/src/src/comps/secret-view.d.ts +4 -0
  87. package/dist/lib/src/src/comps/select-resource.d.ts +80 -0
  88. package/dist/lib/src/src/comps/settings-api-keys.d.ts +12 -0
  89. package/dist/lib/src/src/comps/settings-change-password.d.ts +1 -0
  90. package/dist/lib/src/src/comps/show-if.d.ts +14 -0
  91. package/dist/lib/src/src/comps/side-menu.d.ts +22 -0
  92. package/dist/lib/src/src/comps/splitter-view.d.ts +1 -0
  93. package/dist/lib/src/src/comps/storefront-products.d.ts +11 -0
  94. package/dist/lib/src/src/comps/symbols.d.ts +4 -0
  95. package/dist/lib/src/{comps → src/comps}/table-schema-view.d.ts +11 -10
  96. package/dist/lib/src/src/comps/tag-values.d.ts +5 -0
  97. package/dist/lib/src/src/comps/tags-edit.d.ts +12 -0
  98. package/dist/lib/src/src/comps/template-example-input.d.ts +5 -0
  99. package/dist/lib/src/src/comps/template-template.d.ts +18 -0
  100. package/dist/lib/src/src/comps/transition.d.ts +32 -0
  101. package/dist/lib/src/{hooks → src/hooks}/create-media-query-hook.d.ts +3 -3
  102. package/dist/lib/src/src/hooks/use-collections-actions.d.ts +48 -0
  103. package/dist/lib/src/src/hooks/use-document-actions.d.ts +64 -0
  104. package/dist/lib/src/src/hooks/use-interval.d.ts +8 -0
  105. package/dist/lib/src/src/hooks/use-keyboard-match.d.ts +5 -0
  106. package/dist/lib/src/src/hooks/use-media-query.d.ts +1 -0
  107. package/dist/lib/src/src/hooks/use-mounted.d.ts +1 -0
  108. package/dist/lib/src/src/hooks/use-navigate-with-state.d.ts +18 -0
  109. package/dist/lib/src/src/hooks/use-on-click-outside.d.ts +5 -0
  110. package/dist/lib/src/{hooks → src/hooks}/use-preferences.d.ts +4 -4
  111. package/dist/lib/src/src/hooks/use-scroll-delta.d.ts +13 -0
  112. package/dist/lib/src/src/hooks/use-toggle.d.ts +5 -0
  113. package/dist/lib/src/{hooks → src/hooks}/use-trigger.d.ts +2 -2
  114. package/dist/lib/src/src/hooks/utils.browser.d.ts +11 -0
  115. package/dist/lib/src/src/index.d.ts +13 -0
  116. package/dist/lib/src/src/layout.d.ts +9 -0
  117. package/dist/lib/src/src/login.d.ts +5 -0
  118. package/dist/lib/src/src/pages/collection.d.ts +17 -0
  119. package/dist/lib/src/src/pages/collections.d.ts +2 -0
  120. package/dist/lib/src/src/pages/customer.d.ts +17 -0
  121. package/dist/lib/src/src/pages/customers.d.ts +4 -0
  122. package/dist/lib/src/src/pages/discount.d.ts +18 -0
  123. package/dist/lib/src/src/pages/discounts.d.ts +2 -0
  124. package/dist/lib/src/src/pages/extension.d.ts +14 -0
  125. package/dist/lib/src/src/pages/extensions.d.ts +8 -0
  126. package/dist/lib/src/src/pages/home.d.ts +2 -0
  127. package/dist/lib/src/src/pages/index.d.ts +33 -0
  128. package/dist/lib/src/src/pages/order.d.ts +24 -0
  129. package/dist/lib/src/src/pages/orders.d.ts +2 -0
  130. package/dist/lib/src/src/pages/payment-gateway.d.ts +14 -0
  131. package/dist/lib/src/src/pages/payment-gateways.d.ts +8 -0
  132. package/dist/lib/src/src/pages/post.d.ts +18 -0
  133. package/dist/lib/src/src/pages/posts.d.ts +2 -0
  134. package/dist/lib/src/src/pages/product.d.ts +30 -0
  135. package/dist/lib/src/src/pages/products.d.ts +2 -0
  136. package/dist/lib/src/src/pages/settings.d.ts +2 -0
  137. package/dist/lib/src/src/pages/shipping-method.d.ts +18 -0
  138. package/dist/lib/src/src/pages/shipping-methods.d.ts +2 -0
  139. package/dist/lib/src/src/pages/storefront.d.ts +18 -0
  140. package/dist/lib/src/src/pages/storefronts.d.ts +2 -0
  141. package/dist/lib/src/src/pages/tag.d.ts +17 -0
  142. package/dist/lib/src/src/pages/tags.d.ts +2 -0
  143. package/dist/lib/src/src/pages/template.d.ts +13 -0
  144. package/dist/lib/src/src/pages/templates.d.ts +2 -0
  145. package/dist/lib/src/src/routes.d.ts +1 -0
  146. package/dist/lib/src/src/screens.d.ts +10 -0
  147. package/dist/lib/src/src/utils/index.d.ts +7 -0
  148. package/dist/lib/src/src/utils/time.d.ts +7 -0
  149. package/dist/website/assets/index-BjGWqHuK.js +685 -0
  150. package/dist/website/assets/style-BJD2VYZP.css +1 -0
  151. package/dist/website/index.html +2 -2
  152. package/package.json +29 -24
  153. package/dist/lib/src/apps/gallery/gallery-image-grid.d.ts +0 -30
  154. package/dist/lib/src/apps/gallery/gallery-page.d.ts +0 -2
  155. package/dist/lib/src/apps/gallery/gallery-select.d.ts +0 -7
  156. package/dist/lib/src/apps/gallery/gallery.d.ts +0 -56
  157. package/dist/lib/src/apps/gallery/image-header.d.ts +0 -18
  158. package/dist/lib/src/apps/gallery/image-page.d.ts +0 -16
  159. package/dist/lib/src/apps/gallery/index.d.ts +0 -1
  160. package/dist/lib/src/apps/gallery/utils.d.ts +0 -2
  161. package/dist/lib/src/apps/index.d.ts +0 -2
  162. package/dist/lib/src/comps/action-bar.d.ts +0 -25
  163. package/dist/lib/src/comps/asset-favicon.d.ts +0 -1
  164. package/dist/lib/src/comps/attributes.d.ts +0 -16
  165. package/dist/lib/src/comps/base-chart-view.d.ts +0 -20
  166. package/dist/lib/src/comps/bulk-tag-products-in-collection.d.ts +0 -5
  167. package/dist/lib/src/comps/capsule.d.ts +0 -8
  168. package/dist/lib/src/comps/capsules-view.d.ts +0 -27
  169. package/dist/lib/src/comps/client-only.d.ts +0 -11
  170. package/dist/lib/src/comps/collection-actions.d.ts +0 -35
  171. package/dist/lib/src/comps/collection-products.d.ts +0 -33
  172. package/dist/lib/src/comps/common-button.d.ts +0 -77
  173. package/dist/lib/src/comps/common-fields.d.ts +0 -61
  174. package/dist/lib/src/comps/common-table-fields.d.ts +0 -18
  175. package/dist/lib/src/comps/common-ui.d.ts +0 -101
  176. package/dist/lib/src/comps/customer-orders.d.ts +0 -13
  177. package/dist/lib/src/comps/dark-mode.d.ts +0 -5
  178. package/dist/lib/src/comps/discount-details.d.ts +0 -60
  179. package/dist/lib/src/comps/discount-filters.d.ts +0 -83
  180. package/dist/lib/src/comps/discount-performance.d.ts +0 -13
  181. package/dist/lib/src/comps/discounts-quick-search-actions.d.ts +0 -6
  182. package/dist/lib/src/comps/discounts-table-code.d.ts +0 -12
  183. package/dist/lib/src/comps/discounts-table-type.d.ts +0 -9
  184. package/dist/lib/src/comps/document-actions.d.ts +0 -11
  185. package/dist/lib/src/comps/document-details.d.ts +0 -20
  186. package/dist/lib/src/comps/document-title.d.ts +0 -20
  187. package/dist/lib/src/comps/drawer.d.ts +0 -18
  188. package/dist/lib/src/comps/error-message.d.ts +0 -29
  189. package/dist/lib/src/comps/gradient-text.d.ts +0 -1
  190. package/dist/lib/src/comps/home-header.d.ts +0 -24
  191. package/dist/lib/src/comps/home-invite-action-card.d.ts +0 -17
  192. package/dist/lib/src/comps/home-performace.d.ts +0 -33
  193. package/dist/lib/src/comps/home-sales-chart.d.ts +0 -20
  194. package/dist/lib/src/comps/home-stat-card.d.ts +0 -25
  195. package/dist/lib/src/comps/home-time-frame.d.ts +0 -21
  196. package/dist/lib/src/comps/img.d.ts +0 -11
  197. package/dist/lib/src/comps/json.d.ts +0 -14
  198. package/dist/lib/src/comps/lazy-carousel.d.ts +0 -20
  199. package/dist/lib/src/comps/login-connect.d.ts +0 -4
  200. package/dist/lib/src/comps/login-copyright.d.ts +0 -7
  201. package/dist/lib/src/comps/login-form.d.ts +0 -45
  202. package/dist/lib/src/comps/login-marquee.d.ts +0 -4
  203. package/dist/lib/src/comps/logo-text.d.ts +0 -2
  204. package/dist/lib/src/comps/logo.d.ts +0 -8
  205. package/dist/lib/src/comps/md-editor.d.ts +0 -20
  206. package/dist/lib/src/comps/md-view.d.ts +0 -16
  207. package/dist/lib/src/comps/notifications-button.d.ts +0 -28
  208. package/dist/lib/src/comps/order-coupon-info.d.ts +0 -12
  209. package/dist/lib/src/comps/order-delivery-method.d.ts +0 -11
  210. package/dist/lib/src/comps/order-line-items.d.ts +0 -19
  211. package/dist/lib/src/comps/order-payment-gateway.d.ts +0 -27
  212. package/dist/lib/src/comps/order-price.d.ts +0 -21
  213. package/dist/lib/src/comps/orders-quick-search-actions.d.ts +0 -9
  214. package/dist/lib/src/comps/overlay.d.ts +0 -19
  215. package/dist/lib/src/comps/portal-creator.d.ts +0 -6
  216. package/dist/lib/src/comps/product-discounts.d.ts +0 -22
  217. package/dist/lib/src/comps/product-related-products.d.ts +0 -10
  218. package/dist/lib/src/comps/products-variants-test.d.ts +0 -1
  219. package/dist/lib/src/comps/products-variants.d.ts +0 -38
  220. package/dist/lib/src/comps/quick-search-browser.d.ts +0 -32
  221. package/dist/lib/src/comps/resource-browse.d.ts +0 -51
  222. package/dist/lib/src/comps/resource-onboard-svg.d.ts +0 -2
  223. package/dist/lib/src/comps/resource-title.d.ts +0 -7
  224. package/dist/lib/src/comps/secret-view.d.ts +0 -9
  225. package/dist/lib/src/comps/select-resource.d.ts +0 -88
  226. package/dist/lib/src/comps/settings-api-keys.d.ts +0 -2
  227. package/dist/lib/src/comps/settings-change-password.d.ts +0 -2
  228. package/dist/lib/src/comps/settings-storage.d.ts +0 -15
  229. package/dist/lib/src/comps/show-if.d.ts +0 -25
  230. package/dist/lib/src/comps/side-menu.d.ts +0 -50
  231. package/dist/lib/src/comps/splitter-view.d.ts +0 -1
  232. package/dist/lib/src/comps/storefront-products.d.ts +0 -12
  233. package/dist/lib/src/comps/symbols.d.ts +0 -4
  234. package/dist/lib/src/comps/tag-values.d.ts +0 -9
  235. package/dist/lib/src/comps/tags-edit.d.ts +0 -13
  236. package/dist/lib/src/comps/template-example-input.d.ts +0 -3
  237. package/dist/lib/src/comps/template-template.d.ts +0 -6
  238. package/dist/lib/src/comps/transition.d.ts +0 -51
  239. package/dist/lib/src/hooks/use-collections-actions.d.ts +0 -43
  240. package/dist/lib/src/hooks/use-document-actions.d.ts +0 -37
  241. package/dist/lib/src/hooks/use-interval.d.ts +0 -13
  242. package/dist/lib/src/hooks/use-keyboard-match.d.ts +0 -6
  243. package/dist/lib/src/hooks/use-media-query.d.ts +0 -3
  244. package/dist/lib/src/hooks/use-mounted.d.ts +0 -1
  245. package/dist/lib/src/hooks/use-navigate-with-state.d.ts +0 -26
  246. package/dist/lib/src/hooks/use-on-click-outside.d.ts +0 -7
  247. package/dist/lib/src/hooks/use-scroll-delta.d.ts +0 -4
  248. package/dist/lib/src/hooks/use-toggle.d.ts +0 -7
  249. package/dist/lib/src/hooks/utils.browser.d.ts +0 -7
  250. package/dist/lib/src/index.cjs +0 -800
  251. package/dist/lib/src/index.d.ts +0 -6
  252. package/dist/lib/src/layout.d.ts +0 -18
  253. package/dist/lib/src/login.d.ts +0 -17
  254. package/dist/lib/src/pages/collection.d.ts +0 -15
  255. package/dist/lib/src/pages/collections.d.ts +0 -2
  256. package/dist/lib/src/pages/customer.d.ts +0 -15
  257. package/dist/lib/src/pages/customers.d.ts +0 -3
  258. package/dist/lib/src/pages/discount.d.ts +0 -15
  259. package/dist/lib/src/pages/discounts.d.ts +0 -2
  260. package/dist/lib/src/pages/extension.d.ts +0 -13
  261. package/dist/lib/src/pages/extensions.d.ts +0 -16
  262. package/dist/lib/src/pages/home.d.ts +0 -2
  263. package/dist/lib/src/pages/index.d.ts +0 -36
  264. package/dist/lib/src/pages/order.d.ts +0 -21
  265. package/dist/lib/src/pages/orders.d.ts +0 -2
  266. package/dist/lib/src/pages/payment-gateway.d.ts +0 -13
  267. package/dist/lib/src/pages/payment-gateways.d.ts +0 -16
  268. package/dist/lib/src/pages/post.d.ts +0 -15
  269. package/dist/lib/src/pages/posts.d.ts +0 -2
  270. package/dist/lib/src/pages/product.d.ts +0 -22
  271. package/dist/lib/src/pages/products.d.ts +0 -2
  272. package/dist/lib/src/pages/settings.d.ts +0 -4
  273. package/dist/lib/src/pages/shipping-method.d.ts +0 -15
  274. package/dist/lib/src/pages/shipping-methods.d.ts +0 -2
  275. package/dist/lib/src/pages/storefront.d.ts +0 -15
  276. package/dist/lib/src/pages/storefronts.d.ts +0 -2
  277. package/dist/lib/src/pages/tag.d.ts +0 -15
  278. package/dist/lib/src/pages/tags.d.ts +0 -2
  279. package/dist/lib/src/pages/template.d.ts +0 -15
  280. package/dist/lib/src/pages/templates.d.ts +0 -2
  281. package/dist/lib/src/routes.d.ts +0 -1
  282. package/dist/lib/src/utils/index.d.ts +0 -7
  283. package/dist/lib/src/utils/time.d.ts +0 -7
  284. package/dist/website/assets/index-DxEM6N8c.js +0 -813
  285. package/dist/website/assets/style-DkU0t4eA.css +0 -1
  286. /package/dist/lib/src/{auto-mount.d.ts → src/auto-mount.d.ts} +0 -0
  287. /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,8 @@
1
+ /**
2
+ * can be a finite integer or `Number.POSITIVE_INFINITY`
3
+ */
4
+ declare const useInterval: (cb: (count: number) => void, millis?: number, autoStart?: boolean, runCount?: number) => {
5
+ start: () => void;
6
+ stop: () => void;
7
+ };
8
+ export default useInterval;
@@ -0,0 +1,5 @@
1
+ export type KeyboardMatch = string[];
2
+ /**
3
+ * Create a `hook`, that matches any of the given keyboard matches.
4
+ */
5
+ export declare const createKeyboardMatchHook: (...matches: KeyboardMatch[]) => (onMatch: (match: KeyboardMatch) => void) => void;
@@ -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;
@@ -0,0 +1,5 @@
1
+ /**
2
+ *
3
+ */
4
+ declare const useOnClickOutside: (handler: (e: Event) => void) => import('react').RefObject<HTMLDivElement>;
5
+ export default useOnClickOutside;
@@ -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,5 @@
1
+ /**
2
+ * Hook for triggering an update
3
+ */
4
+ declare const useToggle: (initial?: boolean) => (boolean | (() => void))[];
5
+ export default useToggle;
@@ -1,5 +1,5 @@
1
- export default useTrigger;
2
1
  /**
3
2
  * Hook for triggering an update
4
3
  */
5
- declare function useTrigger(): () => void;
4
+ declare const useTrigger: () => () => void;
5
+ export default useTrigger;
@@ -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,5 @@
1
+ declare const Login: ({ is_backend_endpoint_editable }: {
2
+ is_backend_endpoint_editable?: boolean;
3
+ trigger?: () => void;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default Login;
@@ -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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,4 @@
1
+ import { CustomerType } from '@storecraft/core/api';
2
+ export declare const extract_contact_field: (item: CustomerType) => string;
3
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
4
+ 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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,2 @@
1
+ declare function _default({}: {}): import("react/jsx-runtime").JSX.Element;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ 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,2 @@
1
+ declare const _default: ({}: {}) => import("react/jsx-runtime").JSX.Element;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default function Main(props: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ xs: string;
3
+ sm: string;
4
+ md: string;
5
+ 'md-lg': string;
6
+ lg: string;
7
+ xl: string;
8
+ '2xl': string;
9
+ };
10
+ export default _default;
@@ -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;