@vendure/dashboard 3.3.5-master-202506250727 → 3.3.5-master-202506251305

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 (41) hide show
  1. package/dist/plugin/tests/barrel-exports.spec.js +1 -1
  2. package/dist/plugin/vite-plugin-config.js +1 -0
  3. package/dist/plugin/vite-plugin-dashboard-metadata.d.ts +1 -3
  4. package/dist/plugin/vite-plugin-dashboard-metadata.js +1 -8
  5. package/dist/plugin/vite-plugin-tailwind-source.d.ts +7 -0
  6. package/dist/plugin/vite-plugin-tailwind-source.js +49 -0
  7. package/dist/plugin/vite-plugin-vendure-dashboard.js +3 -1
  8. package/package.json +4 -4
  9. package/src/app/routes/_authenticated/_products/components/assign-facet-values-dialog.tsx +98 -0
  10. package/src/app/routes/_authenticated/_products/components/assign-to-channel-dialog.tsx +126 -0
  11. package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +268 -0
  12. package/src/app/routes/_authenticated/_products/products.graphql.ts +64 -0
  13. package/src/app/routes/_authenticated/_products/products.tsx +31 -2
  14. package/src/app/routes/_authenticated/_products/products_.$id.tsx +3 -1
  15. package/src/app/styles.css +3 -0
  16. package/src/lib/components/data-table/data-table-bulk-action-item.tsx +101 -0
  17. package/src/lib/components/data-table/data-table-bulk-actions.tsx +89 -0
  18. package/src/lib/components/data-table/data-table-filter-badge.tsx +16 -8
  19. package/src/lib/components/data-table/data-table-filter-dialog.tsx +4 -4
  20. package/src/lib/components/data-table/data-table-pagination.tsx +2 -2
  21. package/src/lib/components/data-table/data-table.tsx +50 -31
  22. package/src/lib/components/data-table/human-readable-operator.tsx +3 -3
  23. package/src/lib/components/shared/assigned-facet-values.tsx +1 -5
  24. package/src/lib/components/shared/paginated-list-data-table.tsx +47 -11
  25. package/src/lib/framework/data-table/data-table-extensions.ts +21 -0
  26. package/src/lib/framework/data-table/data-table-types.ts +25 -0
  27. package/src/lib/framework/extension-api/define-dashboard-extension.ts +11 -0
  28. package/src/lib/framework/extension-api/extension-api-types.ts +35 -0
  29. package/src/lib/framework/form-engine/use-generated-form.tsx +2 -5
  30. package/src/lib/framework/layout-engine/page-block-provider.tsx +6 -0
  31. package/src/lib/framework/layout-engine/page-layout.tsx +43 -33
  32. package/src/lib/framework/page/list-page.tsx +6 -8
  33. package/src/lib/framework/registry/registry-types.ts +4 -2
  34. package/src/lib/hooks/use-page-block.tsx +10 -0
  35. package/src/lib/index.ts +8 -1
  36. package/vite/tests/barrel-exports.spec.ts +13 -9
  37. package/vite/vite-plugin-config.ts +1 -0
  38. package/vite/vite-plugin-dashboard-metadata.ts +1 -9
  39. package/vite/vite-plugin-tailwind-source.ts +65 -0
  40. package/vite/vite-plugin-vendure-dashboard.ts +5 -3
  41. /package/src/lib/components/data-table/{data-table-types.ts → types.ts} +0 -0
@@ -0,0 +1,65 @@
1
+ import path from 'path';
2
+ import { Plugin } from 'vite';
3
+
4
+ import { LoadVendureConfigResult } from './utils/config-loader.js';
5
+ import { ConfigLoaderApi, getConfigLoaderApi } from './vite-plugin-config-loader.js';
6
+
7
+ /**
8
+ * This Vite plugin transforms the `app/styles.css` file to include a `@source` directive
9
+ * for each dashboard extension's source directory. This allows Tailwind CSS to
10
+ * include styles from these extensions when processing the CSS.
11
+ */
12
+ export function dashboardTailwindSourcePlugin(): Plugin {
13
+ let configLoaderApi: ConfigLoaderApi;
14
+ let loadVendureConfigResult: LoadVendureConfigResult;
15
+ return {
16
+ name: 'vendure:dashboard-tailwind-source',
17
+ // Ensure this plugin runs before Tailwind CSS processing
18
+ enforce: 'pre',
19
+ configResolved({ plugins }) {
20
+ configLoaderApi = getConfigLoaderApi(plugins);
21
+ },
22
+ async transform(src, id) {
23
+ if (/app\/styles.css$/.test(id)) {
24
+ if (!loadVendureConfigResult) {
25
+ loadVendureConfigResult = await configLoaderApi.getVendureConfig();
26
+ }
27
+ const { pluginInfo } = loadVendureConfigResult;
28
+ const dashboardExtensionDirs =
29
+ pluginInfo
30
+ ?.map(
31
+ ({ dashboardEntryPath, pluginPath }) =>
32
+ dashboardEntryPath && path.join(pluginPath, path.dirname(dashboardEntryPath)),
33
+ )
34
+ .filter(x => x != null) ?? [];
35
+ const sources = dashboardExtensionDirs
36
+ .map(extension => {
37
+ return `@source '${extension}';`;
38
+ })
39
+ .join('\n');
40
+
41
+ // Find the line with the specific comment and insert sources after it
42
+ const lines = src.split('\n');
43
+ const sourceCommentIndex = lines.findIndex(line =>
44
+ line.includes(
45
+ '/* @source rules from extensions will be added here by the dashboardTailwindSourcePlugin */',
46
+ ),
47
+ );
48
+
49
+ if (sourceCommentIndex !== -1) {
50
+ // Insert the sources after the comment line
51
+ lines.splice(sourceCommentIndex + 1, 0, sources);
52
+ const modifiedSrc = lines.join('\n');
53
+ return {
54
+ code: modifiedSrc,
55
+ };
56
+ }
57
+
58
+ // If the comment is not found, append sources at the end
59
+ return {
60
+ code: src + '\n' + sources,
61
+ };
62
+ }
63
+ },
64
+ };
65
+ }
@@ -10,9 +10,10 @@ import { configLoaderPlugin } from './vite-plugin-config-loader.js';
10
10
  import { viteConfigPlugin } from './vite-plugin-config.js';
11
11
  import { dashboardMetadataPlugin } from './vite-plugin-dashboard-metadata.js';
12
12
  import { gqlTadaPlugin } from './vite-plugin-gql-tada.js';
13
- import { ThemeVariablesPluginOptions, themeVariablesPlugin } from './vite-plugin-theme.js';
13
+ import { dashboardTailwindSourcePlugin } from './vite-plugin-tailwind-source.js';
14
+ import { themeVariablesPlugin, ThemeVariablesPluginOptions } from './vite-plugin-theme.js';
14
15
  import { transformIndexHtmlPlugin } from './vite-plugin-transform-index.js';
15
- import { UiConfigPluginOptions, uiConfigPlugin } from './vite-plugin-ui-config.js';
16
+ import { uiConfigPlugin, UiConfigPluginOptions } from './vite-plugin-ui-config.js';
16
17
 
17
18
  /**
18
19
  * @description
@@ -121,6 +122,7 @@ export function vendureDashboardPlugin(options: VitePluginVendureDashboardOption
121
122
  // },
122
123
  }),
123
124
  themeVariablesPlugin({ theme: options.theme }),
125
+ dashboardTailwindSourcePlugin(),
124
126
  tailwindcss(),
125
127
  configLoaderPlugin({
126
128
  vendureConfigPath: normalizedVendureConfigPath,
@@ -130,7 +132,7 @@ export function vendureDashboardPlugin(options: VitePluginVendureDashboardOption
130
132
  }),
131
133
  viteConfigPlugin({ packageRoot }),
132
134
  adminApiSchemaPlugin(),
133
- dashboardMetadataPlugin({ rootDir: tempDir }),
135
+ dashboardMetadataPlugin(),
134
136
  uiConfigPlugin({ adminUiConfig: options.adminUiConfig }),
135
137
  ...(options.gqlTadaOutputPath
136
138
  ? [gqlTadaPlugin({ gqlTadaOutputPath: options.gqlTadaOutputPath, tempDir, packageRoot })]