@vendure/dashboard 3.5.1-master-202511140232 → 3.5.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vendure/dashboard",
3
3
  "private": false,
4
- "version": "3.5.1-master-202511140232",
4
+ "version": "3.5.1",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -155,8 +155,8 @@
155
155
  "@storybook/addon-vitest": "^10.0.0-beta.9",
156
156
  "@storybook/react-vite": "^10.0.0-beta.9",
157
157
  "@types/node": "^22.13.4",
158
- "@vendure/common": "^3.5.1-master-202511140232",
159
- "@vendure/core": "^3.5.1-master-202511140232",
158
+ "@vendure/common": "3.5.1",
159
+ "@vendure/core": "3.5.1",
160
160
  "@vitest/browser": "^3.2.4",
161
161
  "@vitest/coverage-v8": "^3.2.4",
162
162
  "eslint": "^9.19.0",
@@ -173,5 +173,5 @@
173
173
  "lightningcss-linux-arm64-musl": "^1.29.3",
174
174
  "lightningcss-linux-x64-musl": "^1.29.1"
175
175
  },
176
- "gitHead": "045e4ab2482260faa3016f742cf160f5161ed4b4"
176
+ "gitHead": "e6627044e976efc7805d0f7b43325ca361ca937b"
177
177
  }
@@ -22,8 +22,7 @@ import { orderHistoryDocument, transitionOrderToStateDocument } from '../orders.
22
22
  */
23
23
  export function useTransitionOrderToState(orderId: string | undefined) {
24
24
  const [selectStateOpen, setSelectStateOpen] = useState(false);
25
- const [onSuccessFn, setOnSuccessFn] = useState<() => void>(() => {
26
- });
25
+ const [onSuccessFn, setOnSuccessFn] = useState<() => void>(() => {});
27
26
  const { data, isLoading, error } = useQuery({
28
27
  queryKey: ['orderPreModifyingState', orderId],
29
28
  queryFn: async () => {
@@ -142,7 +141,7 @@ export function useTransitionOrderToState(orderId: string | undefined) {
142
141
  transitionToPreModifyingState,
143
142
  transitionToState,
144
143
  ManuallySelectNextState,
145
- selectNextState: ({ onSuccess }: { onSuccess?: () => void }) => {
144
+ selectNextState: ({ onSuccess }: { onSuccess?: () => void | Promise<void> }) => {
146
145
  setSelectStateOpen(true);
147
146
  if (onSuccess) {
148
147
  setOnSuccessFn(() => onSuccess);
@@ -567,11 +567,11 @@ export function DefaultRelationInput({
567
567
  entityType,
568
568
  }: Readonly<DefaultRelationInputProps>) {
569
569
  const { t } = useLingui();
570
+ const ENTITY_CONFIGS = useMemo(() => createEntityConfigs(t), [t]);
570
571
  if (!fieldDef || (!isRelationCustomFieldConfig(fieldDef) && !entityType)) {
571
572
  return null;
572
573
  }
573
574
  const entityName = entityType ?? (fieldDef as RelationCustomFieldConfig).entity;
574
- const ENTITY_CONFIGS = useMemo(() => createEntityConfigs(t), [t]);
575
575
  const config = ENTITY_CONFIGS[entityName as keyof typeof ENTITY_CONFIGS];
576
576
 
577
577
  if (!config) {
@@ -75,6 +75,12 @@ function SortableItem({ id, item, isDisabled, isEditing, onRemove, onEdit, onSav
75
75
  }
76
76
  }, [isEditing]);
77
77
 
78
+ useEffect(() => {
79
+ if (item !== editValue) {
80
+ setEditValue(item);
81
+ }
82
+ }, [item]);
83
+
78
84
  return (
79
85
  <Badge
80
86
  ref={setNodeRef}
@@ -112,12 +118,13 @@ function SortableItem({ id, item, isDisabled, isEditing, onRemove, onEdit, onSav
112
118
  style={{ width: `${Math.max(editValue.length * 8, 60)}px` }}
113
119
  />
114
120
  ) : (
115
- <span
121
+ <button
122
+ type="button"
116
123
  onClick={!isDisabled ? onEdit : undefined}
117
124
  className={cn(!isDisabled && 'cursor-text hover:underline')}
118
125
  >
119
126
  {item}
120
- </span>
127
+ </button>
121
128
  )}
122
129
  {!isDisabled && (
123
130
  <button
@@ -20,7 +20,7 @@ export function DataTableFilterBadge({
20
20
  const [operator, value] = Object.entries(filter.value as Record<string, unknown>)[0];
21
21
  return (
22
22
  <Badge key={filter.id} className="flex gap-2 flex-wrap items-center" variant="outline">
23
- <div
23
+ <button
24
24
  className="flex gap-1 flex-wrap items-center cursor-pointer flex-1"
25
25
  onClick={() => onClick?.(filter)}
26
26
  >
@@ -37,7 +37,7 @@ export function DataTableFilterBadge({
37
37
  <div className="@xs:overflow-hidden @xs:text-ellipsis @xs:whitespace-nowrap flex flex-col @xl:flex-row @2xl:gap-1">
38
38
  <FilterValue value={value} dataType={dataType} currencyCode={currencyCode} />
39
39
  </div>
40
- </div>
40
+ </button>
41
41
  <button className="border-l -mr-2" onClick={() => onRemove(filter)}>
42
42
  <XIcon className="h-4 flex-shrink-0 cursor-pointer" />
43
43
  </button>
@@ -209,7 +209,6 @@ export function DataTable<TData>({
209
209
  ...pagination,
210
210
  pageIndex: 0,
211
211
  });
212
- pagination.pageIndex;
213
212
  }
214
213
  prevColumnFiltersRef.current = columnFilters;
215
214
  }, [columnFilters]);
@@ -94,17 +94,17 @@ type QueryData = {
94
94
  * ```
95
95
  */
96
96
  export function ConfigurableOperationMultiSelector({
97
- value,
98
- onChange,
99
- queryDocument,
100
- queryOptions,
101
- queryKey,
102
- dataPath,
103
- buttonText,
104
- dropdownTitle,
105
- emptyText = 'No options found',
106
- showEnhancedDropdown = true,
107
- }: Readonly<ConfigurableOperationMultiSelectorProps>) {
97
+ value,
98
+ onChange,
99
+ queryDocument,
100
+ queryOptions,
101
+ queryKey,
102
+ dataPath,
103
+ buttonText,
104
+ dropdownTitle,
105
+ emptyText = 'No options found',
106
+ showEnhancedDropdown = true,
107
+ }: Readonly<ConfigurableOperationMultiSelectorProps>) {
108
108
  const { data } = useQuery<QueryData>(
109
109
  queryOptions || {
110
110
  queryKey: [queryKey],
@@ -134,7 +134,7 @@ export function ConfigurableOperationMultiSelector({
134
134
  code: operation.code,
135
135
  arguments: operationDef.args.map(arg => ({
136
136
  name: arg.name,
137
- value: arg.defaultValue != null ? arg.defaultValue.toString() : '',
137
+ value: arg.defaultValue != null ? arg.defaultValue.toString() : arg.list ? '[]' : '',
138
138
  })),
139
139
  },
140
140
  ]);
@@ -195,10 +195,8 @@ export function ConfigurableOperationMultiSelector({
195
195
  onCombinationModeChange(index, newValue)
196
196
  }
197
197
  name={''}
198
- ref={() => {
199
- }}
200
- onBlur={() => {
201
- }}
198
+ ref={() => {}}
199
+ onBlur={() => {}}
202
200
  position={index}
203
201
  />
204
202
  </div>
@@ -47,10 +47,10 @@ export const RichTextDescriptionCell: DataTableCellComponent<{ description: stri
47
47
 
48
48
  // Strip HTML tags and decode HTML entities
49
49
  const textContent = useMemo(() => {
50
- const stripped = value?.replace(/<[^>]*>/g, '') || '';
51
- const textArea = document.createElement('textarea');
52
- textArea.innerHTML = stripped;
53
- return textArea.value;
50
+ if (!value) return '';
51
+ const div = document.createElement('div');
52
+ div.innerHTML = value;
53
+ return div.textContent ?? '';
54
54
  }, [value]);
55
55
 
56
56
  const shortLength = 100;