@vendure/dashboard 3.3.6-master-202507021511 → 3.3.6-master-202507030648
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 +41 -4
- package/dist/plugin/vite-plugin-config.js +4 -2
- package/package.json +4 -4
- package/src/app/routes/_authenticated/_administrators/components/administrator-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +1 -1
- package/src/app/routes/_authenticated/_channels/components/channel-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +1 -2
- package/src/app/routes/_authenticated/_collections/components/collection-contents-table.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/components/collection-filters-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_countries/components/country-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-container.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-order-table.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-status-badge.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +1 -2
- package/src/app/routes/_authenticated/_facets/components/facet-values-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/money-gross-net.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-address.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history.tsx +6 -1
- package/src/app/routes/_authenticated/_orders/components/order-line-custom-fields-form.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +3 -3
- package/src/app/routes/_authenticated/_orders/components/order-table.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-tax-summary.tsx +2 -2
- package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/shipping-method-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_payment-methods/components/payment-handler-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_payment-methods/components/payment-method-bulk-actions.tsx +1 -2
- package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +1 -2
- package/src/app/routes/_authenticated/_products/components/create-product-variants.tsx +4 -1
- package/src/app/routes/_authenticated/_products/components/option-value-input.tsx +5 -1
- package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +1 -2
- package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +6 -1
- package/src/app/routes/_authenticated/_promotions/components/promotion-actions-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_promotions/components/promotion-bulk-actions.tsx +1 -2
- package/src/app/routes/_authenticated/_promotions/components/promotion-conditions-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_roles/components/expandable-permissions.tsx +1 -1
- package/src/app/routes/_authenticated/_roles/components/permissions-grid.tsx +1 -1
- package/src/app/routes/_authenticated/_roles/components/role-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_sellers/components/seller-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_shipping-methods/components/fulfillment-handler-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-calculator-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-bulk-actions.tsx +1 -2
- package/src/app/routes/_authenticated/_stock-locations/components/stock-location-bulk-actions.tsx +1 -2
- package/src/app/routes/_authenticated/_system/components/payload-dialog.tsx +1 -1
- package/src/app/routes/_authenticated/_tax-categories/components/tax-category-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_tax-rates/components/tax-rate-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_zones/components/zone-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_zones/components/zone-countries-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_zones/components/zone-countries-table.tsx +1 -1
- package/src/app/routes/_authenticated/index.tsx +1 -1
- package/src/lib/components/data-display/boolean.tsx +1 -1
- package/src/lib/components/data-display/date-time.tsx +1 -1
- package/src/lib/components/data-display/json.tsx +1 -1
- package/src/lib/components/data-input/affixed-input.tsx +1 -1
- package/src/lib/components/data-input/index.ts +11 -0
- package/src/lib/components/data-input/relation-input.tsx +156 -0
- package/src/lib/components/data-input/relation-selector.tsx +350 -0
- package/src/lib/components/data-input/{richt-text-input.tsx → rich-text-input.tsx} +1 -1
- package/src/lib/components/data-table/add-filter-menu.tsx +1 -1
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +1 -1
- package/src/lib/components/data-table/data-table-column-header.tsx +1 -1
- package/src/lib/components/data-table/data-table-filter-dialog.tsx +1 -1
- package/src/lib/components/data-table/data-table.tsx +1 -1
- package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +4 -1
- package/src/lib/components/data-table/filters/data-table-datetime-filter.tsx +4 -1
- package/src/lib/components/data-table/filters/data-table-id-filter.tsx +1 -1
- package/src/lib/components/data-table/filters/data-table-number-filter.tsx +5 -1
- package/src/lib/components/data-table/filters/data-table-string-filter.tsx +4 -1
- package/src/lib/components/data-table/refresh-button.tsx +4 -1
- package/src/lib/components/layout/nav-main.tsx +1 -1
- package/src/lib/components/shared/asset/asset-bulk-actions.tsx +1 -1
- package/src/lib/components/shared/asset/asset-preview-selector.tsx +1 -1
- package/src/lib/components/shared/asset/asset-preview.tsx +1 -1
- package/src/lib/components/shared/asset/asset-properties.tsx +1 -1
- package/src/lib/components/shared/asset/focal-point-control.tsx +1 -1
- package/src/lib/components/shared/channel-code-label.tsx +1 -1
- package/src/lib/components/shared/copyable-text.tsx +2 -3
- package/src/lib/components/shared/custom-fields-form.tsx +1 -1
- package/src/lib/components/shared/error-page.tsx +1 -1
- package/src/lib/components/shared/history-timeline/history-entry.tsx +7 -1
- package/src/lib/components/shared/history-timeline/history-note-checkbox.tsx +1 -1
- package/src/lib/components/shared/history-timeline/history-note-input.tsx +1 -1
- package/src/lib/components/shared/history-timeline/history-timeline.tsx +1 -1
- package/src/lib/components/shared/option-value-input.tsx +1 -1
- package/src/lib/components/shared/paginated-list-data-table.tsx +1 -1
- package/src/lib/components/shared/permission-guard.tsx +1 -1
- package/src/lib/components/shared/product-variant-selector.tsx +1 -1
- package/src/lib/components/shared/role-code-label.tsx +1 -1
- package/src/lib/components/shared/stock-level-label.tsx +5 -5
- package/src/lib/components/shared/tax-category-selector.tsx +1 -1
- package/src/lib/components/shared/zone-selector.tsx +1 -1
- package/src/lib/framework/alert/alert-extensions.tsx +2 -3
- package/src/lib/framework/alert/alert-item.tsx +2 -1
- package/src/lib/framework/dashboard-widget/base-widget.tsx +2 -10
- package/src/lib/framework/dashboard-widget/widget-extensions.tsx +1 -1
- package/src/lib/framework/data-table/data-table-extensions.ts +1 -1
- package/src/lib/framework/extension-api/extension-api-types.ts +0 -3
- package/src/lib/framework/extension-api/types/data-table.ts +25 -2
- package/src/lib/framework/extension-api/types/widgets.ts +7 -4
- package/src/lib/framework/layout-engine/location-wrapper.tsx +4 -1
- package/src/lib/framework/layout-engine/page-layout.tsx +16 -9
- package/src/lib/framework/page/list-page.tsx +2 -8
- package/src/lib/framework/registry/registry-types.ts +7 -7
- package/src/lib/graphql/graphql-env.d.ts +31 -14
- package/src/lib/index.ts +7 -12
- package/src/lib/lib/trans.tsx +3 -3
- package/src/lib/providers/auth.tsx +1 -1
- package/src/lib/providers/channel-provider.tsx +1 -1
- package/src/lib/providers/theme-provider.tsx +2 -3
- package/vite/vite-plugin-config.ts +2 -1
- package/src/lib/framework/alert/types.ts +0 -13
- package/src/lib/framework/dashboard-widget/types.ts +0 -22
- package/src/lib/framework/data-table/data-table-types.ts +0 -25
package/src/lib/index.ts
CHANGED
|
@@ -8,7 +8,10 @@ export * from './components/data-input/affixed-input.js';
|
|
|
8
8
|
export * from './components/data-input/customer-group-input.js';
|
|
9
9
|
export * from './components/data-input/datetime-input.js';
|
|
10
10
|
export * from './components/data-input/facet-value-input.js';
|
|
11
|
+
export * from './components/data-input/index.js';
|
|
11
12
|
export * from './components/data-input/money-input.js';
|
|
13
|
+
export * from './components/data-input/relation-input.js';
|
|
14
|
+
export * from './components/data-input/relation-selector.js';
|
|
12
15
|
export * from './components/data-input/richt-text-input.js';
|
|
13
16
|
export * from './components/data-table/add-filter-menu.js';
|
|
14
17
|
export * from './components/data-table/data-table-bulk-action-item.js';
|
|
@@ -130,21 +133,15 @@ export * from './components/ui/tooltip.js';
|
|
|
130
133
|
export * from './framework/alert/alert-extensions.js';
|
|
131
134
|
export * from './framework/alert/alert-item.js';
|
|
132
135
|
export * from './framework/alert/alerts-indicator.js';
|
|
133
|
-
export * from './framework/alert/types.js';
|
|
134
136
|
export * from './framework/component-registry/component-registry.js';
|
|
135
137
|
export * from './framework/component-registry/dynamic-component.js';
|
|
136
138
|
export * from './framework/dashboard-widget/base-widget.js';
|
|
137
|
-
export * from './framework/dashboard-widget/latest-orders-widget/index.js';
|
|
138
139
|
export * from './framework/dashboard-widget/latest-orders-widget/latest-orders-widget.graphql.js';
|
|
139
140
|
export * from './framework/dashboard-widget/metrics-widget/chart.js';
|
|
140
|
-
export * from './framework/dashboard-widget/metrics-widget/index.js';
|
|
141
141
|
export * from './framework/dashboard-widget/metrics-widget/metrics-widget.graphql.js';
|
|
142
|
-
export * from './framework/dashboard-widget/orders-summary/index.js';
|
|
143
142
|
export * from './framework/dashboard-widget/orders-summary/order-summary-widget.graphql.js';
|
|
144
|
-
export * from './framework/dashboard-widget/types.js';
|
|
145
143
|
export * from './framework/dashboard-widget/widget-extensions.js';
|
|
146
144
|
export * from './framework/data-table/data-table-extensions.js';
|
|
147
|
-
export * from './framework/data-table/data-table-types.js';
|
|
148
145
|
export * from './framework/defaults.js';
|
|
149
146
|
export * from './framework/document-extension/extend-detail-form-query.js';
|
|
150
147
|
export * from './framework/document-extension/extend-document.js';
|
|
@@ -159,7 +156,6 @@ export * from './framework/extension-api/logic/alerts.js';
|
|
|
159
156
|
export * from './framework/extension-api/logic/data-table.js';
|
|
160
157
|
export * from './framework/extension-api/logic/detail-forms.js';
|
|
161
158
|
export * from './framework/extension-api/logic/form-components.js';
|
|
162
|
-
export * from './framework/extension-api/logic/index.js';
|
|
163
159
|
export * from './framework/extension-api/logic/layout.js';
|
|
164
160
|
export * from './framework/extension-api/logic/navigation.js';
|
|
165
161
|
export * from './framework/extension-api/logic/widgets.js';
|
|
@@ -167,7 +163,6 @@ export * from './framework/extension-api/types/alerts.js';
|
|
|
167
163
|
export * from './framework/extension-api/types/data-table.js';
|
|
168
164
|
export * from './framework/extension-api/types/detail-forms.js';
|
|
169
165
|
export * from './framework/extension-api/types/form-components.js';
|
|
170
|
-
export * from './framework/extension-api/types/index.js';
|
|
171
166
|
export * from './framework/extension-api/types/layout.js';
|
|
172
167
|
export * from './framework/extension-api/types/navigation.js';
|
|
173
168
|
export * from './framework/extension-api/types/widgets.js';
|
|
@@ -192,10 +187,6 @@ export * from './framework/page/use-detail-page.js';
|
|
|
192
187
|
export * from './framework/page/use-extended-router.js';
|
|
193
188
|
export * from './framework/registry/global-registry.js';
|
|
194
189
|
export * from './framework/registry/registry-types.js';
|
|
195
|
-
export * from './graphql/api.js';
|
|
196
|
-
export * from './graphql/common-operations.js';
|
|
197
|
-
export * from './graphql/fragments.js';
|
|
198
|
-
export * from './graphql/graphql.js';
|
|
199
190
|
export * from './hooks/use-auth.js';
|
|
200
191
|
export * from './hooks/use-channel.js';
|
|
201
192
|
export * from './hooks/use-custom-field-config.js';
|
|
@@ -212,3 +203,7 @@ export * from './hooks/use-theme.js';
|
|
|
212
203
|
export * from './hooks/use-user-settings.js';
|
|
213
204
|
export * from './lib/trans.js';
|
|
214
205
|
export * from './lib/utils.js';
|
|
206
|
+
export * from './graphql/api.js';
|
|
207
|
+
export * from './graphql/common-operations.js';
|
|
208
|
+
export * from './graphql/fragments.js';
|
|
209
|
+
export * from './graphql/graphql.js';
|
package/src/lib/lib/trans.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This is a temporary work-around because the Lingui macros do not
|
|
2
|
+
* This is a temporary work-around because the Lingui macros do not
|
|
3
3
|
* currently work when the dashboard is packaged in an npm
|
|
4
4
|
* module. Related issue: https://github.com/kentcdodds/babel-plugin-macros/issues/87
|
|
5
5
|
*/
|
|
6
|
-
export function Trans({ children }: { children: React.ReactNode }) {
|
|
7
|
-
return <>{children}
|
|
6
|
+
export function Trans({ children }: Readonly<{ children: React.ReactNode; context?: string }>) {
|
|
7
|
+
return <>{children}</>;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function useLingui() {
|
|
@@ -70,7 +70,7 @@ const CurrentUserQuery = graphql(`
|
|
|
70
70
|
|
|
71
71
|
export const AuthContext = React.createContext<AuthContext | null>(null);
|
|
72
72
|
|
|
73
|
-
export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
73
|
+
export function AuthProvider({ children }: Readonly<{ children: React.ReactNode }>) {
|
|
74
74
|
const [status, setStatus] = React.useState<AuthContext['status']>('initial');
|
|
75
75
|
const [authenticationError, setAuthenticationError] = React.useState<string | undefined>();
|
|
76
76
|
const [isLoginLogoutInProgress, setIsLoginLogoutInProgress] = React.useState(false);
|
|
@@ -65,7 +65,7 @@ export const ChannelContext = React.createContext<ChannelContext | undefined>(un
|
|
|
65
65
|
const SELECTED_CHANNEL_KEY = 'vendure-selected-channel';
|
|
66
66
|
const SELECTED_CHANNEL_TOKEN_KEY = 'vendure-selected-channel-token';
|
|
67
67
|
|
|
68
|
-
export function ChannelProvider({ children }: { children: React.ReactNode }) {
|
|
68
|
+
export function ChannelProvider({ children }: Readonly<{ children: React.ReactNode }>) {
|
|
69
69
|
const queryClient = useQueryClient();
|
|
70
70
|
const { channels: userChannels, isAuthenticated } = useAuth();
|
|
71
71
|
const [selectedChannelId, setSelectedChannelId] = React.useState<string | undefined>(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, useEffect
|
|
1
|
+
import { createContext, useEffect } from 'react';
|
|
2
2
|
import { useUserSettings } from '../hooks/use-user-settings.js';
|
|
3
3
|
|
|
4
4
|
export type Theme = 'dark' | 'light' | 'system';
|
|
@@ -21,7 +21,7 @@ const initialState: ThemeProviderState = {
|
|
|
21
21
|
|
|
22
22
|
export const ThemeProviderContext = createContext<ThemeProviderState>(initialState);
|
|
23
23
|
|
|
24
|
-
export function ThemeProvider({ children, defaultTheme = 'system', ...props }: ThemeProviderProps) {
|
|
24
|
+
export function ThemeProvider({ children, defaultTheme = 'system', ...props }: Readonly<ThemeProviderProps>) {
|
|
25
25
|
const { settings, setTheme } = useUserSettings();
|
|
26
26
|
|
|
27
27
|
useEffect(() => {
|
|
@@ -51,4 +51,3 @@ export function ThemeProvider({ children, defaultTheme = 'system', ...props }: T
|
|
|
51
51
|
</ThemeProviderContext.Provider>
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
-
|
|
@@ -8,7 +8,7 @@ export function viteConfigPlugin({ packageRoot }: { packageRoot: string }): Plug
|
|
|
8
8
|
// Only set the vite `root` to the dashboard package when running the dev server.
|
|
9
9
|
// During a production build we still need to reference the dashboard source which
|
|
10
10
|
// lives in `node_modules`, but we don't want the build output to be emitted in there.
|
|
11
|
-
// Therefore we set `root` only for `serve` and, for `build`, we instead make sure that
|
|
11
|
+
// Therefore, we set `root` only for `serve` and, for `build`, we instead make sure that
|
|
12
12
|
// an `outDir` **outside** of `node_modules` is used (defaulting to the current working
|
|
13
13
|
// directory if the user did not provide one already).
|
|
14
14
|
config.root = packageRoot;
|
|
@@ -37,6 +37,7 @@ export function viteConfigPlugin({ packageRoot }: { packageRoot: string }): Plug
|
|
|
37
37
|
config.resolve = {
|
|
38
38
|
alias: {
|
|
39
39
|
...(config.resolve?.alias ?? {}),
|
|
40
|
+
// See the readme for an explanation of this alias.
|
|
40
41
|
'@/vdb': path.resolve(packageRoot, './src/lib'),
|
|
41
42
|
'@/graphql': path.resolve(packageRoot, './src/lib/graphql'),
|
|
42
43
|
},
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface DashboardAlertDefinition<TResponse = any> {
|
|
2
|
-
id: string;
|
|
3
|
-
title: string | ((data: TResponse) => string);
|
|
4
|
-
description?: string | ((data: TResponse) => string);
|
|
5
|
-
severity: 'info' | 'warning' | 'error';
|
|
6
|
-
check: () => Promise<TResponse> | TResponse;
|
|
7
|
-
recheckInterval?: number;
|
|
8
|
-
shouldShow?: (data: TResponse) => boolean;
|
|
9
|
-
actions?: Array<{
|
|
10
|
-
label: string;
|
|
11
|
-
onClick: (data: TResponse) => void;
|
|
12
|
-
}>;
|
|
13
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DashboardBaseWidgetProps } from './base-widget.js';
|
|
2
|
-
|
|
3
|
-
export type DashboardWidgetInstance = {
|
|
4
|
-
id: string;
|
|
5
|
-
widgetId: string;
|
|
6
|
-
layout: {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
w: number;
|
|
10
|
-
h: number;
|
|
11
|
-
};
|
|
12
|
-
config?: Record<string, unknown>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type DashboardWidgetDefinition = {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
component: React.ComponentType<DashboardBaseWidgetProps>;
|
|
19
|
-
defaultSize: { w: number; h: number; x?: number; y?: number };
|
|
20
|
-
minSize?: { w: number; h: number };
|
|
21
|
-
maxSize?: { w: number; h: number };
|
|
22
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Table } from '@tanstack/react-table';
|
|
2
|
-
|
|
3
|
-
export type BulkActionContext<Item extends { id: string } & Record<string, any>> = {
|
|
4
|
-
selection: Item[];
|
|
5
|
-
table: Table<Item>;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type BulkActionComponent<Item extends { id: string } & Record<string, any>> = React.FunctionComponent<
|
|
9
|
-
BulkActionContext<Item>
|
|
10
|
-
>;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description
|
|
14
|
-
* **Status: Developer Preview**
|
|
15
|
-
*
|
|
16
|
-
* A bulk action is a component that will be rendered in the bulk actions dropdown.
|
|
17
|
-
*
|
|
18
|
-
* @docsCategory components
|
|
19
|
-
* @docsPage DataTableBulkActions
|
|
20
|
-
* @since 3.4.0
|
|
21
|
-
*/
|
|
22
|
-
export type BulkAction = {
|
|
23
|
-
order?: number;
|
|
24
|
-
component: BulkActionComponent<any>;
|
|
25
|
-
};
|