@spree/dashboard-core 0.13.1 → 1.0.0-beta.1
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 +4 -0
- package/dist/vite/index.js +17 -3
- package/package.json +7 -7
- package/src/api-client.ts +643 -0
- package/src/components/address-form-dialog.test.ts +25 -0
- package/src/components/address-form-dialog.tsx +203 -79
- package/src/components/app-shell.tsx +171 -0
- package/src/components/app-sidebar.tsx +184 -27
- package/src/components/bulk-action-bar.tsx +89 -157
- package/src/components/country-combobox.tsx +69 -34
- package/src/components/country-state-fields.tsx +43 -11
- package/src/components/currency-select.tsx +81 -66
- package/src/components/export-button.tsx +62 -5
- package/src/components/file-upload-field.tsx +32 -10
- package/src/components/import-button.tsx +52 -27
- package/src/components/import-wizard-dialog.tsx +710 -0
- package/src/components/locale-select.tsx +70 -57
- package/src/components/media-picker-sheet.tsx +307 -0
- package/src/components/mobile-top-bar.tsx +75 -0
- package/src/components/nav-main.tsx +197 -27
- package/src/components/page-header.tsx +203 -61
- package/src/components/page-tabs.tsx +4 -1
- package/src/components/preferences-form.tsx +98 -4
- package/src/components/resource-combobox.tsx +52 -4
- package/src/components/resource-picker-sheet.tsx +209 -73
- package/src/components/resource-table.tsx +383 -127
- package/src/components/route-announcer.tsx +64 -0
- package/src/components/section-heading.tsx +95 -0
- package/src/components/settings-sidebar.tsx +290 -60
- package/src/components/sheet-top-bar.tsx +44 -0
- package/src/components/sidebar-search.tsx +83 -0
- package/src/components/sidebar-user.tsx +213 -0
- package/src/components/skip-link.tsx +36 -0
- package/src/components/store-date-picker.tsx +6 -2
- package/src/components/store-switcher.tsx +19 -14
- package/src/components/table-toolbar.tsx +1357 -440
- package/src/components/tag-combobox.tsx +12 -4
- package/src/components/top-bar-breadcrumbs.tsx +235 -0
- package/src/components/wizard-close-guard.test.ts +54 -0
- package/src/hooks/use-auto-collapse-sidebar.ts +57 -0
- package/src/hooks/use-command-palette.tsx +13 -0
- package/src/hooks/use-countries.test.ts +56 -0
- package/src/hooks/use-countries.ts +51 -5
- package/src/hooks/use-direct-upload.ts +16 -3
- package/src/hooks/use-export.ts +51 -16
- package/src/hooks/use-import.ts +241 -16
- package/src/hooks/use-package-types.ts +132 -0
- package/src/hooks/use-resource-mutation.ts +74 -13
- package/src/hooks/use-stock-locations.ts +131 -0
- package/src/hooks/use-switch-admin-locale.ts +2 -2
- package/src/hooks/use-visual-viewport-offset.ts +61 -0
- package/src/index.ts +45 -1
- package/src/lib/cancel-order-form.ts +27 -0
- package/src/lib/create-action-registry.ts +278 -0
- package/src/lib/date-presets.test.ts +86 -0
- package/src/lib/date-presets.ts +98 -0
- package/src/lib/delivery-form.ts +15 -0
- package/src/lib/docs.ts +32 -0
- package/src/lib/download.ts +13 -1
- package/src/lib/filters-to-ransack.test.ts +113 -0
- package/src/lib/filters-to-ransack.ts +22 -1
- package/src/lib/form-errors.ts +122 -10
- package/src/lib/form-mappers.ts +76 -0
- package/src/lib/fulfillment-items.test.ts +213 -0
- package/src/lib/fulfillment-items.ts +171 -0
- package/src/lib/i18n.ts +19 -11
- package/src/lib/import-types.ts +25 -0
- package/src/lib/label-upload-form.ts +22 -0
- package/src/lib/nav-registry.ts +71 -3
- package/src/lib/permissions.ts +46 -1
- package/src/lib/progress.ts +18 -0
- package/src/lib/query-keys.ts +13 -13
- package/src/lib/sample-csv.ts +9 -6
- package/src/lib/search-registry.ts +6 -2
- package/src/lib/settings-nav-registry.ts +104 -11
- package/src/lib/table-registry.ts +50 -0
- package/src/lib/type-labels.test.ts +68 -0
- package/src/lib/type-labels.ts +78 -0
- package/src/locales/ar.json +1889 -517
- package/src/locales/de.json +1884 -517
- package/src/locales/en.json +1886 -519
- package/src/locales/fr.json +1884 -517
- package/src/locales/pl.json +1913 -517
- package/src/locales/zh-CN.json +1883 -517
- package/src/pages/package-types.tsx +484 -0
- package/src/pages/settings-index.tsx +112 -0
- package/src/pages/stock-locations.tsx +674 -0
- package/src/plugin.ts +29 -0
- package/src/products/add-video-dialog.tsx +100 -0
- package/src/products/bulk-variants-dialog.tsx +301 -0
- package/src/products/carton-size.test.ts +51 -0
- package/src/products/carton-size.ts +20 -0
- package/src/products/currency-parts.ts +21 -0
- package/src/products/inventory-section.tsx +259 -0
- package/src/products/media-edit-sheet.tsx +336 -0
- package/src/products/normalize-customs.test.ts +39 -0
- package/src/products/normalize-customs.ts +27 -0
- package/src/products/normalize-money.test.ts +58 -0
- package/src/products/normalize-money.ts +73 -0
- package/src/products/normalize-quantity.test.ts +32 -0
- package/src/products/normalize-quantity.ts +31 -0
- package/src/products/product-bulk-price-editor.tsx +165 -0
- package/src/products/product-form-cards.tsx +1167 -0
- package/src/products/product-form-mapping.ts +212 -0
- package/src/products/product-schema.ts +318 -0
- package/src/products/product-types.ts +130 -0
- package/src/products/use-product-form-data.ts +273 -0
- package/src/products/variant-edit-sheet.tsx +725 -0
- package/src/products/variants-matrix.test.ts +154 -0
- package/src/products/variants-matrix.ts +244 -0
- package/src/products/variants-options-builder.tsx +571 -0
- package/src/products/variants-section.tsx +535 -0
- package/src/products/video-url.test.ts +71 -0
- package/src/products/video-url.ts +83 -0
- package/src/providers/auth-provider.tsx +70 -12
- package/src/providers/permission-provider.tsx +68 -28
- package/src/providers/sticky-header-provider.tsx +134 -0
- package/src/providers/store-provider.tsx +36 -3
- package/src/providers/tenant-provider.tsx +33 -0
- package/src/schemas/package-type.ts +95 -0
- package/src/schemas/stock-location.ts +126 -0
- package/src/tables/package-types.tsx +74 -0
- package/src/tables/stock-locations.tsx +124 -0
- package/src/vite/index.ts +40 -7
- 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
|
|
package/dist/vite/index.js
CHANGED
|
@@ -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
|
|
53
|
-
|
|
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.
|
|
4
|
+
"version": "1.0.0-beta.1",
|
|
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.
|
|
83
|
-
"@spree/dashboard-ui": "^0.
|
|
82
|
+
"@spree/admin-sdk": "^1.0.0-beta.1",
|
|
83
|
+
"@spree/dashboard-ui": "^1.0.0-beta.1"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"lint": "biome check src",
|