@spree/dashboard-core 0.13.1 → 1.0.0-beta.2

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 (125) hide show
  1. package/README.md +4 -0
  2. package/dist/vite/index.js +17 -3
  3. package/package.json +7 -7
  4. package/src/api-client.ts +643 -0
  5. package/src/components/address-form-dialog.test.ts +25 -0
  6. package/src/components/address-form-dialog.tsx +203 -79
  7. package/src/components/app-shell.tsx +171 -0
  8. package/src/components/app-sidebar.tsx +184 -27
  9. package/src/components/bulk-action-bar.tsx +89 -157
  10. package/src/components/country-combobox.tsx +69 -34
  11. package/src/components/country-state-fields.tsx +43 -11
  12. package/src/components/currency-select.tsx +81 -66
  13. package/src/components/export-button.tsx +62 -5
  14. package/src/components/file-upload-field.tsx +32 -10
  15. package/src/components/import-button.tsx +52 -27
  16. package/src/components/import-wizard-dialog.tsx +710 -0
  17. package/src/components/locale-select.tsx +70 -57
  18. package/src/components/media-picker-sheet.tsx +307 -0
  19. package/src/components/mobile-top-bar.tsx +75 -0
  20. package/src/components/nav-main.tsx +197 -27
  21. package/src/components/page-header.tsx +203 -61
  22. package/src/components/page-tabs.tsx +4 -1
  23. package/src/components/preferences-form.tsx +98 -4
  24. package/src/components/resource-combobox.tsx +52 -4
  25. package/src/components/resource-picker-sheet.tsx +209 -73
  26. package/src/components/resource-table.tsx +383 -127
  27. package/src/components/route-announcer.tsx +64 -0
  28. package/src/components/section-heading.tsx +95 -0
  29. package/src/components/settings-sidebar.tsx +290 -60
  30. package/src/components/sheet-top-bar.tsx +44 -0
  31. package/src/components/sidebar-search.tsx +83 -0
  32. package/src/components/sidebar-user.tsx +213 -0
  33. package/src/components/skip-link.tsx +36 -0
  34. package/src/components/store-date-picker.tsx +6 -2
  35. package/src/components/store-switcher.tsx +19 -14
  36. package/src/components/table-toolbar.tsx +1357 -440
  37. package/src/components/tag-combobox.tsx +12 -4
  38. package/src/components/top-bar-breadcrumbs.tsx +235 -0
  39. package/src/components/wizard-close-guard.test.ts +54 -0
  40. package/src/hooks/use-auto-collapse-sidebar.ts +57 -0
  41. package/src/hooks/use-command-palette.tsx +13 -0
  42. package/src/hooks/use-countries.test.ts +56 -0
  43. package/src/hooks/use-countries.ts +51 -5
  44. package/src/hooks/use-direct-upload.ts +16 -3
  45. package/src/hooks/use-export.ts +51 -16
  46. package/src/hooks/use-import.ts +241 -16
  47. package/src/hooks/use-package-types.ts +132 -0
  48. package/src/hooks/use-resource-mutation.ts +74 -13
  49. package/src/hooks/use-stock-locations.ts +131 -0
  50. package/src/hooks/use-switch-admin-locale.ts +2 -2
  51. package/src/hooks/use-visual-viewport-offset.ts +61 -0
  52. package/src/index.ts +45 -1
  53. package/src/lib/cancel-order-form.ts +27 -0
  54. package/src/lib/create-action-registry.ts +278 -0
  55. package/src/lib/date-presets.test.ts +86 -0
  56. package/src/lib/date-presets.ts +98 -0
  57. package/src/lib/delivery-form.ts +15 -0
  58. package/src/lib/docs.ts +32 -0
  59. package/src/lib/download.ts +13 -1
  60. package/src/lib/filters-to-ransack.test.ts +113 -0
  61. package/src/lib/filters-to-ransack.ts +22 -1
  62. package/src/lib/form-errors.ts +122 -10
  63. package/src/lib/form-mappers.ts +76 -0
  64. package/src/lib/fulfillment-items.test.ts +213 -0
  65. package/src/lib/fulfillment-items.ts +171 -0
  66. package/src/lib/i18n.ts +19 -11
  67. package/src/lib/import-types.ts +25 -0
  68. package/src/lib/label-upload-form.ts +22 -0
  69. package/src/lib/nav-registry.ts +71 -3
  70. package/src/lib/permissions.ts +46 -1
  71. package/src/lib/progress.ts +18 -0
  72. package/src/lib/query-keys.ts +13 -13
  73. package/src/lib/sample-csv.ts +9 -6
  74. package/src/lib/search-registry.ts +6 -2
  75. package/src/lib/settings-nav-registry.ts +104 -11
  76. package/src/lib/table-registry.ts +50 -0
  77. package/src/lib/type-labels.test.ts +68 -0
  78. package/src/lib/type-labels.ts +78 -0
  79. package/src/locales/ar.json +1889 -517
  80. package/src/locales/de.json +1884 -517
  81. package/src/locales/en.json +1886 -519
  82. package/src/locales/fr.json +1884 -517
  83. package/src/locales/pl.json +1913 -517
  84. package/src/locales/zh-CN.json +1883 -517
  85. package/src/pages/package-types.tsx +484 -0
  86. package/src/pages/settings-index.tsx +112 -0
  87. package/src/pages/stock-locations.tsx +674 -0
  88. package/src/plugin.ts +29 -0
  89. package/src/products/add-video-dialog.tsx +100 -0
  90. package/src/products/bulk-variants-dialog.tsx +301 -0
  91. package/src/products/carton-size.test.ts +51 -0
  92. package/src/products/carton-size.ts +20 -0
  93. package/src/products/currency-parts.ts +21 -0
  94. package/src/products/inventory-section.tsx +259 -0
  95. package/src/products/media-edit-sheet.tsx +336 -0
  96. package/src/products/normalize-customs.test.ts +39 -0
  97. package/src/products/normalize-customs.ts +27 -0
  98. package/src/products/normalize-money.test.ts +58 -0
  99. package/src/products/normalize-money.ts +73 -0
  100. package/src/products/normalize-quantity.test.ts +32 -0
  101. package/src/products/normalize-quantity.ts +31 -0
  102. package/src/products/product-bulk-price-editor.tsx +165 -0
  103. package/src/products/product-form-cards.tsx +1167 -0
  104. package/src/products/product-form-mapping.ts +212 -0
  105. package/src/products/product-schema.ts +318 -0
  106. package/src/products/product-types.ts +130 -0
  107. package/src/products/use-product-form-data.ts +273 -0
  108. package/src/products/variant-edit-sheet.tsx +725 -0
  109. package/src/products/variants-matrix.test.ts +154 -0
  110. package/src/products/variants-matrix.ts +244 -0
  111. package/src/products/variants-options-builder.tsx +571 -0
  112. package/src/products/variants-section.tsx +535 -0
  113. package/src/products/video-url.test.ts +71 -0
  114. package/src/products/video-url.ts +83 -0
  115. package/src/providers/auth-provider.tsx +70 -12
  116. package/src/providers/permission-provider.tsx +68 -28
  117. package/src/providers/sticky-header-provider.tsx +134 -0
  118. package/src/providers/store-provider.tsx +36 -3
  119. package/src/providers/tenant-provider.tsx +33 -0
  120. package/src/schemas/package-type.ts +95 -0
  121. package/src/schemas/stock-location.ts +126 -0
  122. package/src/tables/package-types.tsx +74 -0
  123. package/src/tables/stock-locations.tsx +124 -0
  124. package/src/vite/index.ts +40 -7
  125. package/src/components/top-bar.tsx +0 -209
package/README.md CHANGED
@@ -31,6 +31,10 @@ defineDashboardPlugin({
31
31
  },
32
32
  },
33
33
  formFields: { product: [{ name: 'tech_specs', from: (p) => p?.tech_specs ?? '' }] },
34
+ locales: {
35
+ en: { admin: { types: { promotion_rule: { wishlist: { name: 'On a wishlist' } } } } },
36
+ de: { admin: { types: { promotion_rule: { wishlist: { name: 'Auf einer Wunschliste' } } } } },
37
+ },
34
38
  })
35
39
  ```
36
40
 
@@ -5,7 +5,19 @@ import { fileURLToPath } from "node:url";
5
5
  import tailwindcss from "@tailwindcss/vite";
6
6
  import { discoverDashboardPlugins } from "./discover.js";
7
7
  function spreeDashboardPlugin(options = {}) {
8
- return [dashboardTailwindSourcePlugin(options), tailwindcss()];
8
+ return [dashboardProseMirrorDedupePlugin(), dashboardTailwindSourcePlugin(options), tailwindcss()];
9
+ }
10
+ function dashboardProseMirrorDedupePlugin() {
11
+ return {
12
+ name: "spree:dashboard-prosemirror-dedupe",
13
+ config() {
14
+ return {
15
+ resolve: {
16
+ dedupe: ["prosemirror-model", "prosemirror-view", "@tiptap/pm", "@tiptap/core"]
17
+ }
18
+ };
19
+ }
20
+ };
9
21
  }
10
22
  const VIRTUAL_PLUGIN_MODULE_ID = "virtual:spree-dashboard-plugins";
11
23
  const RESOLVED_VIRTUAL_PLUGIN_MODULE_ID = `\0${VIRTUAL_PLUGIN_MODULE_ID}`;
@@ -49,8 +61,10 @@ function dashboardTailwindSourcePlugin(options) {
49
61
  pluginErrors.push({ pkg, kind: "unresolved" });
50
62
  }
51
63
  }
52
- const shellDir = resolvePackageSourceDir("@spree/dashboard", fromHost);
53
- if (shellDir) resolvedSources.push(shellDir);
64
+ for (const shell of options.shellPackages ?? ["@spree/dashboard"]) {
65
+ const shellDir = resolvePackageSourceDir(shell, fromHost);
66
+ if (shellDir) resolvedSources.push(shellDir);
67
+ }
54
68
  for (const pkg of pluginPackages) {
55
69
  const dir = resolvePackageSourceDir(pkg, fromHost);
56
70
  if (dir) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spree/dashboard-core",
3
3
  "license": "MIT",
4
- "version": "0.13.1",
4
+ "version": "1.0.0-beta.2",
5
5
  "description": "Spree Dashboard framework — registries (table, nav, slot, settings-nav), providers (auth, permission, store), admin SDK client, generic infra hooks, and the defineDashboardPlugin extension API. Developer Preview.",
6
6
  "author": "Vendo Connect Inc.",
7
7
  "homepage": "https://spreecommerce.org",
@@ -48,17 +48,17 @@
48
48
  ],
49
49
  "peerDependencies": {
50
50
  "@hookform/resolvers": "^5.2.2",
51
- "@spree/admin-sdk": ">=0.7.0 <2",
52
- "@spree/dashboard-ui": ">=0.10.0 <2",
51
+ "@spree/admin-sdk": ">=0.7.0 <1.0.0-0 || >=1.0.0-0 <2.0.0-0",
52
+ "@spree/dashboard-ui": ">=0.10.0 <1.0.0-0 || >=1.0.0-0 <2.0.0-0",
53
53
  "@tanstack/react-hotkeys": "^0.10.0",
54
54
  "@tanstack/react-query": "^5.100.9",
55
55
  "@tanstack/react-router": "^1.169.2",
56
+ "@tanstack/react-table": "^8.21.3",
56
57
  "i18next": "^26.2.0",
57
58
  "react": "^19.2.6",
58
59
  "react-dom": "^19.2.6",
59
60
  "react-hook-form": "^7.75.0",
60
- "react-i18next": "^17.0.8",
61
- "sonner": "^2.0.7"
61
+ "react-i18next": "^17.0.8"
62
62
  },
63
63
  "dependencies": {
64
64
  "@dnd-kit/core": "^6.3.1",
@@ -79,8 +79,8 @@
79
79
  "typescript": "~6.0.3",
80
80
  "vite": "^8.0.16",
81
81
  "vitest": "^4.1.5",
82
- "@spree/admin-sdk": "^0.8.1",
83
- "@spree/dashboard-ui": "^0.13.1"
82
+ "@spree/admin-sdk": "^1.0.0-beta.1",
83
+ "@spree/dashboard-ui": "^1.0.0-beta.2"
84
84
  },
85
85
  "scripts": {
86
86
  "lint": "biome check src",