@zeyos/zx 5.6.0 → 5.7.0

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 (215) hide show
  1. package/CHANGELOG.md +154 -0
  2. package/README.md +73 -7
  3. package/bin/zx-css.js +328 -0
  4. package/dist/types/components/account-menu/account-menu.d.ts +4 -2
  5. package/dist/types/components/activity-list/activity-list.d.ts +14 -8
  6. package/dist/types/components/agent-thread/ag-ui.d.ts +340 -0
  7. package/dist/types/components/agent-thread/agent-thread.d.ts +142 -14
  8. package/dist/types/components/agent-thread/ui-message-stream.d.ts +401 -0
  9. package/dist/types/components/app-sidebar/app-sidebar.d.ts +14 -8
  10. package/dist/types/components/breadcrumb/breadcrumb.d.ts +3 -3
  11. package/dist/types/components/calendar/calendar-model.d.ts +9 -2
  12. package/dist/types/components/calendar/calendar.d.ts +12 -4
  13. package/dist/types/components/chart/chart.d.ts +25 -13
  14. package/dist/types/components/code-editor/code-editor.d.ts +7 -2
  15. package/dist/types/components/composer/composer.d.ts +206 -4
  16. package/dist/types/components/composer/queue.d.ts +76 -0
  17. package/dist/types/components/copy/copy-button.d.ts +6 -4
  18. package/dist/types/components/copy/copy-input.d.ts +10 -6
  19. package/dist/types/components/datebox/date-range-box.d.ts +33 -0
  20. package/dist/types/components/datebox/placeholder.d.ts +7 -0
  21. package/dist/types/components/dock/dock.d.ts +12 -3
  22. package/dist/types/components/entity-ref/entity-ref.d.ts +5 -3
  23. package/dist/types/components/field-upload/field-upload.d.ts +3 -2
  24. package/dist/types/components/file-item/file-item.d.ts +3 -2
  25. package/dist/types/components/file-list/file-list.d.ts +14 -8
  26. package/dist/types/components/filter/filter-model.d.ts +31 -1
  27. package/dist/types/components/filter/filter.d.ts +20 -2
  28. package/dist/types/components/finder/finder.d.ts +14 -6
  29. package/dist/types/components/flag/flag.d.ts +99 -0
  30. package/dist/types/components/grid/grid.d.ts +1 -1
  31. package/dist/types/components/kanban-view/kanban-view.d.ts +8 -66
  32. package/dist/types/components/launcher/launcher.d.ts +2 -0
  33. package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +3 -2
  34. package/dist/types/components/number-field/number-field.d.ts +17 -6
  35. package/dist/types/components/prompt-starters/prompt-starters.d.ts +107 -0
  36. package/dist/types/components/prose/prose.d.ts +9 -6
  37. package/dist/types/components/questionnaire/conditions.d.ts +270 -0
  38. package/dist/types/components/questionnaire/items.d.ts +52 -30
  39. package/dist/types/components/questionnaire/questionnaire.d.ts +44 -4
  40. package/dist/types/components/rating/rating.d.ts +5 -3
  41. package/dist/types/components/select/country.d.ts +106 -0
  42. package/dist/types/components/select/field-adapter.d.ts +2 -1
  43. package/dist/types/components/select/locale.d.ts +102 -0
  44. package/dist/types/components/select/select.d.ts +41 -2
  45. package/dist/types/components/slider/slider.d.ts +1 -0
  46. package/dist/types/components/sort-control/sort-control.d.ts +7 -3
  47. package/dist/types/components/source-list/source-list.d.ts +7 -5
  48. package/dist/types/components/split-view/split-view.d.ts +5 -3
  49. package/dist/types/components/surface/catalog.d.ts +260 -0
  50. package/dist/types/components/surface/elicit.d.ts +81 -0
  51. package/dist/types/components/surface/mcp.d.ts +165 -0
  52. package/dist/types/components/surface/schema.d.ts +314 -0
  53. package/dist/types/components/surface/stream.d.ts +118 -0
  54. package/dist/types/components/surface/surface.d.ts +718 -0
  55. package/dist/types/components/surface/text.d.ts +277 -0
  56. package/dist/types/components/surface/validate.d.ts +339 -0
  57. package/dist/types/components/table/table.d.ts +55 -3
  58. package/dist/types/components/table/window.d.ts +203 -0
  59. package/dist/types/components/toolbar/toolbar.d.ts +10 -6
  60. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  61. package/dist/types/components/tree/tree.d.ts +20 -13
  62. package/dist/types/core/component.d.ts +10 -0
  63. package/dist/types/core/date.d.ts +8 -1
  64. package/dist/types/core/dom.d.ts +1 -0
  65. package/dist/types/core/http.d.ts +10 -0
  66. package/dist/types/core/i18n.d.ts +38 -0
  67. package/dist/types/core/messages.d.ts +344 -1
  68. package/dist/types/core/storage.d.ts +7 -2
  69. package/dist/types/elements/define.d.ts +21 -46
  70. package/dist/types/elements/definitions.d.ts +147 -0
  71. package/dist/types/elements/kit.d.ts +7 -0
  72. package/dist/types/elements/reflect.d.ts +6 -3
  73. package/dist/types/index.d.ts +10 -1
  74. package/dist/types/internal/date-locale.d.ts +7 -0
  75. package/dist/types/internal/json-patch.d.ts +146 -0
  76. package/dist/types/locales/de.d.ts +13 -0
  77. package/dist/types/locales/en.d.ts +2 -0
  78. package/dist/types/locales/index.d.ts +823 -0
  79. package/dist/types/zeyos/view.d.ts +8 -1
  80. package/dist/zx-zeyos.esm.js +16802 -15180
  81. package/dist/zx-zeyos.esm.min.js +5 -5
  82. package/dist/zx.core.css +1276 -0
  83. package/dist/zx.core.min.css +1 -0
  84. package/dist/zx.css +498 -134
  85. package/dist/zx.esm.js +40778 -29654
  86. package/dist/zx.esm.min.js +36 -23
  87. package/dist/zx.global.js +40778 -29654
  88. package/dist/zx.global.min.js +36 -23
  89. package/dist/zx.layered.css +17302 -0
  90. package/dist/zx.layered.min.css +1 -0
  91. package/dist/zx.min.css +1 -1
  92. package/docs/agent-catalog.json +12501 -0
  93. package/docs/agent-surfaces.md +340 -0
  94. package/docs/api.json +851 -121
  95. package/docs/llms.md +1018 -71
  96. package/docs/llms.txt +30 -9
  97. package/package.json +29 -6
  98. package/src/components/account-menu/account-menu.js +6 -3
  99. package/src/components/activity-item/activity-item.js +2 -1
  100. package/src/components/activity-list/activity-list.js +16 -10
  101. package/src/components/agent-thread/ag-ui.js +1439 -0
  102. package/src/components/agent-thread/agent-thread.js +359 -54
  103. package/src/components/agent-thread/ui-message-stream.js +1281 -0
  104. package/src/components/app-sidebar/app-sidebar.js +18 -8
  105. package/src/components/approval-card/approval-card.js +3 -2
  106. package/src/components/block-view/block-view.js +7 -6
  107. package/src/components/breadcrumb/breadcrumb.js +8 -5
  108. package/src/components/calendar/calendar-model.js +8 -2
  109. package/src/components/calendar/calendar.js +53 -18
  110. package/src/components/chart/chart.js +54 -23
  111. package/src/components/code-editor/code-editor.js +45 -8
  112. package/src/components/code-editor/field-adapter.js +1 -1
  113. package/src/components/composer/composer.css +80 -1
  114. package/src/components/composer/composer.js +390 -16
  115. package/src/components/composer/queue.js +78 -0
  116. package/src/components/context-menu/context-menu.js +12 -1
  117. package/src/components/copy/copy-button.js +9 -7
  118. package/src/components/copy/copy-input.js +10 -6
  119. package/src/components/date-picker/date-picker.js +2 -1
  120. package/src/components/date-picker/date-range-picker.js +8 -7
  121. package/src/components/datebox/date-range-box.js +3 -9
  122. package/src/components/datebox/datebox.js +18 -21
  123. package/src/components/datebox/placeholder.js +18 -0
  124. package/src/components/dialog/dialog.js +1 -1
  125. package/src/components/dock/dock.js +34 -13
  126. package/src/components/entity-ref/entity-ref.js +16 -5
  127. package/src/components/field-upload/field-upload.js +81 -38
  128. package/src/components/file-item/file-item.js +70 -40
  129. package/src/components/file-list/file-list.js +15 -9
  130. package/src/components/filter/filter-model.js +46 -8
  131. package/src/components/filter/filter.css +3 -3
  132. package/src/components/filter/filter.js +29 -10
  133. package/src/components/filter-panel/filter-panel.js +13 -5
  134. package/src/components/finder/finder.js +50 -26
  135. package/src/components/flag/flag.css +40 -0
  136. package/src/components/flag/flag.js +177 -0
  137. package/src/components/form/form.js +1 -1
  138. package/src/components/grid/grid.js +22 -8
  139. package/src/components/kanban-view/kanban-view.js +51 -81
  140. package/src/components/launcher/launcher.js +17 -2
  141. package/src/components/list-toolbar/list-toolbar.js +2 -1
  142. package/src/components/master-panel/master-panel.js +1 -1
  143. package/src/components/menu-button/menu-button.js +4 -0
  144. package/src/components/message/message.js +3 -0
  145. package/src/components/multi-value-editor/multi-value-editor.js +10 -9
  146. package/src/components/navigation-bar/navigation-bar.js +3 -3
  147. package/src/components/number-field/number-field.js +29 -13
  148. package/src/components/prompt-starters/prompt-starters.css +91 -0
  149. package/src/components/prompt-starters/prompt-starters.js +206 -0
  150. package/src/components/prose/prose.js +14 -10
  151. package/src/components/questionnaire/conditions.js +666 -0
  152. package/src/components/questionnaire/items.js +150 -41
  153. package/src/components/questionnaire/questionnaire.js +126 -32
  154. package/src/components/rating/rating.js +5 -4
  155. package/src/components/run-status/run-status.js +2 -2
  156. package/src/components/select/country.js +136 -0
  157. package/src/components/select/field-adapter.js +7 -2
  158. package/src/components/select/locale.js +219 -0
  159. package/src/components/select/select.css +20 -22
  160. package/src/components/select/select.js +94 -12
  161. package/src/components/sheet/sheet-stack.js +10 -1
  162. package/src/components/slider/slider.js +7 -2
  163. package/src/components/sort-control/sort-control.js +15 -5
  164. package/src/components/source-list/source-list.js +7 -4
  165. package/src/components/split-view/split-view.js +5 -3
  166. package/src/components/surface/catalog.js +1334 -0
  167. package/src/components/surface/elicit.js +107 -0
  168. package/src/components/surface/mcp.js +243 -0
  169. package/src/components/surface/schema.js +644 -0
  170. package/src/components/surface/stream.js +245 -0
  171. package/src/components/surface/surface.css +308 -0
  172. package/src/components/surface/surface.js +2291 -0
  173. package/src/components/surface/text.js +513 -0
  174. package/src/components/surface/validate.js +2218 -0
  175. package/src/components/tabbox/tabbox.js +9 -0
  176. package/src/components/table/table.css +63 -3
  177. package/src/components/table/table.js +167 -28
  178. package/src/components/table/window.js +317 -0
  179. package/src/components/toolbar/toolbar.js +12 -7
  180. package/src/components/tooltip/tooltip.css +2 -3
  181. package/src/components/tooltip/tooltip.js +32 -5
  182. package/src/components/tree/tree.js +53 -23
  183. package/src/core/component.js +25 -1
  184. package/src/core/date.js +62 -16
  185. package/src/core/dom.js +22 -2
  186. package/src/core/format.js +15 -13
  187. package/src/core/http.js +29 -20
  188. package/src/core/i18n.js +83 -10
  189. package/src/core/keyboard.js +79 -8
  190. package/src/core/messages.js +376 -2
  191. package/src/core/overlay-host.js +1 -0
  192. package/src/core/storage.js +59 -6
  193. package/src/elements/define.js +178 -130
  194. package/src/elements/definitions.js +229 -0
  195. package/src/elements/kit.js +444 -0
  196. package/src/elements/reflect.js +8 -3
  197. package/src/index.js +10 -1
  198. package/src/internal/date-locale.js +11 -0
  199. package/src/internal/json-patch.js +405 -0
  200. package/src/locales/de.js +911 -0
  201. package/src/locales/en.js +2 -0
  202. package/src/locales/index.js +7 -0
  203. package/src/zeyos/calendar.js +2 -1
  204. package/src/zeyos/form.js +2 -1
  205. package/src/zeyos/launcher.js +7 -6
  206. package/src/zeyos/module-bar.js +2 -1
  207. package/src/zeyos/schema.js +37 -23
  208. package/src/zeyos/select.js +4 -3
  209. package/src/zeyos/table.js +2 -13
  210. package/src/zeyos/view.js +57 -17
  211. package/styles/core.css +11 -0
  212. package/styles/tokens/semantic.css +1 -0
  213. package/styles/zeyos.css +2 -0
  214. package/styles/zx.css +4 -8
  215. package/styles/zx.layered.css +1 -0
@@ -1,7 +1,7 @@
1
1
  // @ts-check
2
2
  import { h, restoreTarget, snapshotTarget } from '../../core/dom.js';
3
3
  import { ICON_SIZE, icon } from '../../core/icons.js';
4
- import { printf } from '../../core/i18n.js';
4
+ import { printf, translate } from '../../core/i18n.js';
5
5
  import { uid } from '../../core/util.js';
6
6
  import { badge } from '../badge/badge.js';
7
7
  import { createRecordCard, resolveRecordActions } from '../card-view/record-card.js';
@@ -187,7 +187,9 @@ import {
187
187
  * @property {((context:KanbanHeaderContext)=>Node|null|undefined)|null} [renderSwimlaneHeader=null] Replaces lane header content.
188
188
  * @property {((context:KanbanHeaderContext)=>Node|null|undefined)|null} [renderColumnEmpty=null] Empty-column placeholder.
189
189
  * @property {((context:{records:KanbanRecord[],ids:unknown[],count:number})=>Node|null|undefined)|null} [renderDragPreview=null] Replaces the floating drag preview.
190
- * @property {Record<string,string>} [labels={}] Overrides for every visible and announced string.
190
+ * @property {Record<string,string>} [labels={}] Per-instance overrides of the board's text. Each key is
191
+ * the part after `kanbanView.` in the message catalogue, where every visible and announced string
192
+ * lives, and a value may reorder or drop the named placeholders.
191
193
  * @property {string[]} [columnOrder=[]] Preferred column order.
192
194
  * @property {string[]} [swimlaneOrder=[]] Preferred swim-lane order.
193
195
  * @property {string[]} [collapsedColumns=[]] Initially collapsed columns.
@@ -195,7 +197,8 @@ import {
195
197
  * @property {boolean} [showCounts=true] Show record counts and WIP indicators.
196
198
  * @property {boolean} [showEmptyColumns=true] Keep configured empty columns visible.
197
199
  * @property {'outlined'|'raised'|'filled'} [variant='outlined'] Shared record-card treatment.
198
- * @property {string} [label='Kanban board'] Accessible board label.
200
+ * @property {string|null} [label] Accessible board label, by default the `kanbanView.label` message
201
+ * ("Kanban board"). Null leaves the board unnamed.
199
202
  * @property {(event: CustomEvent<Record<string,unknown>>) => void} [onrecordmove]
200
203
  * @property {(event: CustomEvent<Record<string,unknown>>) => void} [onmovereject]
201
204
  * @property {(event: CustomEvent<Record<string,unknown>>) => void} [onrecordaction]
@@ -235,67 +238,6 @@ const SEARCH_DEBOUNCE = 120;
235
238
  const SCROLL_EDGE = 56;
236
239
  const SCROLL_SPEED = 18;
237
240
 
238
- /**
239
- * Every user-visible and announced string, so a host can translate the board without patching it.
240
- * Values run through `printf`, so named placeholders may be reordered or dropped by a translation.
241
- */
242
- const DEFAULT_LABELS = Object.freeze({
243
- fields: 'Fields',
244
- search: 'Search board',
245
- searchPlaceholder: 'Search cards',
246
- clearSearch: 'Clear search',
247
- searchSummary: '%count% of %total% cards match.',
248
- undo: 'Undo',
249
- redo: 'Redo',
250
- add: 'Add card',
251
- addTo: 'Add card to %target%',
252
- move: 'Move %name%',
253
- moveMultiple: 'Move %count% selected cards',
254
- collapseColumn: 'Collapse column %label%',
255
- expandColumn: 'Expand column %label%',
256
- collapseLane: 'Collapse swim lane %label%',
257
- expandLane: 'Expand swim lane %label%',
258
- count: '%count% records',
259
- countFiltered: '%count% of %total% records',
260
- countLimit: '%count% records, work-in-progress limit %limit%',
261
- countLimitInLane: '%count% records in this lane, %total% of work-in-progress limit %limit% in the column',
262
- empty: 'No records',
263
- columnEmpty: 'Drop a card here',
264
- identifier: 'Record',
265
- priorityLabel: 'Priority',
266
- statusLabel: 'Status',
267
- progress: 'Progress',
268
- progressValue: '%percent%%',
269
- assignees: 'Assigned to %names%',
270
- assigneeOverflow: '+%count%',
271
- selected: 'Selected',
272
- notSelected: 'Not selected',
273
- noMatches: 'No cards match the current search.',
274
- record: 'record',
275
- grabbed: 'Grabbed %name%. Use left and right for columns, up and down for position, and Alt plus up or down for swim lanes.',
276
- grabbedMultiple: 'Grabbed %count% cards. Use left and right for columns, up and down for position, and Alt plus up or down for swim lanes.',
277
- target: 'Target %target%, position %position% of %total%.',
278
- moved: 'Moved %name% to %target%.%wip%',
279
- movedMultiple: 'Moved %count% cards to %target%.%wip%',
280
- moveRequested: 'Move requested for %name% to %target%.%wip%',
281
- moveCanceled: 'Move canceled for %name%.',
282
- moveCanceledPlain: 'Move canceled.',
283
- limitReached: ' Work-in-progress limit %limit% reached.',
284
- limitExceeded: ' Work-in-progress limit %limit% exceeded.',
285
- rejectAccept: 'Move rejected: %target% does not accept %name%.',
286
- rejectTransition: 'Move rejected: %target% does not accept cards from %origin%.',
287
- rejectWip: 'Move rejected: %target% is at its work-in-progress limit of %limit%.',
288
- rejectDestination: 'Move rejected: the destination is not available.',
289
- rejectGrouping: 'Move rejected: callback grouping requires external move mode.',
290
- undone: 'Move undone.',
291
- redone: 'Move redone.',
292
- nothingToUndo: 'Nothing to undo.',
293
- nothingToRedo: 'Nothing to redo.',
294
- menuMoveTo: 'Move to %target%',
295
- menuMoveToLane: 'Move to lane %target%',
296
- dragPreview: '%count% cards'
297
- });
298
-
299
241
  /**
300
242
  * A field consumed by the card head or footer — the `identifier`, `status`, `priority`,
301
243
  * `progress`, or `assignees` source — is dropped from the shared metadata list so the same value
@@ -371,7 +313,8 @@ export class KanbanView extends RecordView {
371
313
  showCounts: true,
372
314
  showEmptyColumns: true,
373
315
  variant: 'outlined',
374
- label: 'Kanban board'
316
+ // Undefined rather than null, which leaves the board unnamed.
317
+ label: undefined
375
318
  };
376
319
 
377
320
  /**
@@ -393,9 +336,9 @@ export class KanbanView extends RecordView {
393
336
  try {
394
337
  this._initRecordView(root);
395
338
  this._kanbanColumns = options.columns === null
396
- ? null : normalizeKanbanDescriptors(options.columns, 'column');
339
+ ? null : kanbanDescriptors(options.columns, 'column', this._text('unassigned'));
397
340
  this._kanbanSwimlanes = options.swimlanes === null
398
- ? null : normalizeKanbanDescriptors(options.swimlanes, 'swimlane');
341
+ ? null : kanbanDescriptors(options.swimlanes, 'swimlane', this._text('unassigned'));
399
342
  this._kanbanColumnOrder = normalizeOrder(options.columnOrder);
400
343
  this._kanbanSwimlaneOrder = normalizeOrder(options.swimlaneOrder);
401
344
  this._collapsedColumns = new Set(normalizeOrder(options.collapsedColumns));
@@ -442,9 +385,8 @@ export class KanbanView extends RecordView {
442
385
  }
443
386
  if (options.searchControl) this._toolbar.append(this._createSearchControl());
444
387
  if (options.historyControls) this._toolbar.append(this._createHistoryControls());
445
- this._board = h('div', {
446
- class: 'zx-kanban-view__board', role: 'region', ariaLabel: options.label
447
- });
388
+ const { label = this.msg('kanbanView.label') } = options;
389
+ this._board = h('div', { class: 'zx-kanban-view__board', role: 'region', ariaLabel: label });
448
390
  this._live = h('div', {
449
391
  class: 'zx-kanban-view__live', role: 'status', ariaLive: 'polite', ariaAtomic: 'true'
450
392
  });
@@ -487,7 +429,7 @@ export class KanbanView extends RecordView {
487
429
  * @returns {this}
488
430
  */
489
431
  setColumns(columns) {
490
- this._kanbanColumns = columns === null ? null : normalizeKanbanDescriptors(columns, 'column');
432
+ this._kanbanColumns = columns === null ? null : kanbanDescriptors(columns, 'column', this._text('unassigned'));
491
433
  const descriptors = this._rawColumns();
492
434
  this._kanbanColumnOrder = reconcileKanbanPreference(
493
435
  descriptors, this._kanbanColumnOrder, this._kanbanColumns === null);
@@ -511,7 +453,7 @@ export class KanbanView extends RecordView {
511
453
  * @returns {this}
512
454
  */
513
455
  setSwimlanes(lanes) {
514
- this._kanbanSwimlanes = lanes === null ? null : normalizeKanbanDescriptors(lanes, 'swimlane');
456
+ this._kanbanSwimlanes = lanes === null ? null : kanbanDescriptors(lanes, 'swimlane', this._text('unassigned'));
515
457
  const descriptors = this._rawSwimlanes();
516
458
  const preserveUnknown = this._kanbanSwimlanes === null && this._kanbanOptions().swimlaneBy != null;
517
459
  this._kanbanSwimlaneOrder = reconcileKanbanPreference(
@@ -1409,7 +1351,8 @@ export class KanbanView extends RecordView {
1409
1351
  _rawColumns() {
1410
1352
  const options = this._kanbanOptions();
1411
1353
  return this._kanbanColumns === null
1412
- ? deriveKanbanDescriptors(this._viewData, (record, index) => this._readAxis(options.columnBy, record, index))
1354
+ ? derivedDescriptors(this._viewData, (record, index) => this._readAxis(options.columnBy, record, index),
1355
+ this._text('unassigned'))
1413
1356
  : this._kanbanColumns.map((column) => ({ ...column }));
1414
1357
  }
1415
1358
 
@@ -1426,7 +1369,8 @@ export class KanbanView extends RecordView {
1426
1369
  const options = this._kanbanOptions();
1427
1370
  if (options.swimlaneBy == null) return [];
1428
1371
  return this._kanbanSwimlanes === null
1429
- ? deriveKanbanDescriptors(this._viewData, (record, index) => this._readAxis(options.swimlaneBy, record, index))
1372
+ ? derivedDescriptors(this._viewData, (record, index) => this._readAxis(options.swimlaneBy, record, index),
1373
+ this._text('unassigned'))
1430
1374
  : this._kanbanSwimlanes.map((lane) => ({ ...lane }));
1431
1375
  }
1432
1376
 
@@ -2144,6 +2088,7 @@ export class KanbanView extends RecordView {
2144
2088
  this._pointerStart = null;
2145
2089
  if (!this._dragIds.length) return;
2146
2090
  event.preventDefault();
2091
+ this._updateDropTarget(event.clientX, event.clientY);
2147
2092
  const ids = [...this._dragIds];
2148
2093
  const destination = this._dragDestination ? { ...this._dragDestination } : null;
2149
2094
  this._clearDrag();
@@ -2245,6 +2190,7 @@ export class KanbanView extends RecordView {
2245
2190
  this._dragFrame = 0;
2246
2191
  if (!this._dragIds.length) return;
2247
2192
  this._autoScroll();
2193
+ this._updateDropTarget(this._dragPoint.x, this._dragPoint.y);
2248
2194
  this._scheduleAutoScroll();
2249
2195
  });
2250
2196
  }
@@ -2451,14 +2397,18 @@ export class KanbanView extends RecordView {
2451
2397
 
2452
2398
  /**
2453
2399
  * Resolves one localizable string.
2454
- * @param {keyof typeof DEFAULT_LABELS|string} key Label key.
2400
+ * @param {string} key Label key.
2455
2401
  * @param {Record<string, unknown>} [args] Placeholder values.
2456
2402
  * @returns {string} Resolved text.
2457
2403
  */
2458
2404
  _text(key, args) {
2459
2405
  const overrides = this._kanbanOptions().labels;
2406
+ // `msg()` fills positional placeholders and these are named, so it only supplies the template.
2460
2407
  const source = overrides && typeof overrides === 'object' && key in overrides
2461
- ? overrides[key] : /** @type {Record<string,string>} */ (DEFAULT_LABELS)[key];
2408
+ ? overrides[key]
2409
+ : ['count', 'countFiltered', 'countLimit', 'countLimitInLane', 'dragPreview'].includes(key)
2410
+ ? this.msgPlural(`kanbanView.${key}`, Number(key === 'countFiltered' ? args?.total : args?.count))
2411
+ : this.msg(`kanbanView.${key}`);
2462
2412
  return printf(source == null ? String(key) : String(source), args);
2463
2413
  }
2464
2414
 
@@ -2489,6 +2439,16 @@ export class KanbanView extends RecordView {
2489
2439
  * @returns {KanbanColumn[]}
2490
2440
  */
2491
2441
  export function normalizeKanbanDescriptors(descriptors, axis = 'column') {
2442
+ return kanbanDescriptors(descriptors, axis, translate('kanbanView.unassigned'));
2443
+ }
2444
+
2445
+ /**
2446
+ * @param {unknown} descriptors Descriptors.
2447
+ * @param {'column'|'swimlane'} axis Descriptor kind.
2448
+ * @param {string} unassigned Name of a descriptor with no label or id.
2449
+ * @returns {KanbanColumn[]}
2450
+ */
2451
+ function kanbanDescriptors(descriptors, axis, unassigned) {
2492
2452
  if (!Array.isArray(descriptors)) throw new TypeError(`Kanban ${axis}s must be an array or null`);
2493
2453
  const seen = new Set();
2494
2454
  return /** @type {KanbanColumn[]} */ (descriptors.map((descriptor, index) => {
@@ -2509,7 +2469,7 @@ export function normalizeKanbanDescriptors(descriptors, axis = 'column') {
2509
2469
  const normalized = /** @type {Record<string, any>} */ ({
2510
2470
  ...source,
2511
2471
  id,
2512
- label: String(source.label ?? axisLabel(source.id)),
2472
+ label: String(source.label ?? axisLabel(source.id, unassigned)),
2513
2473
  limit: normalizeLimit(source.limit),
2514
2474
  from: Array.isArray(source.from) ? source.from.map(String) : null,
2515
2475
  ...(Object.prototype.hasOwnProperty.call(source, 'value') ? {} : { value: source.id })
@@ -2535,6 +2495,16 @@ export function normalizeKanbanDescriptors(descriptors, axis = 'column') {
2535
2495
  * @returns {KanbanColumn[]}
2536
2496
  */
2537
2497
  export function deriveKanbanDescriptors(records, accessor) {
2498
+ return derivedDescriptors(records, accessor, translate('kanbanView.unassigned'));
2499
+ }
2500
+
2501
+ /**
2502
+ * @param {KanbanRecord[]} records Records.
2503
+ * @param {KanbanAccessor} accessor Grouping accessor.
2504
+ * @param {string} unassigned Name of the group without a value.
2505
+ * @returns {KanbanColumn[]}
2506
+ */
2507
+ function derivedDescriptors(records, accessor, unassigned) {
2538
2508
  const result = [];
2539
2509
  const seen = new Set();
2540
2510
  records.forEach((record, index) => {
@@ -2542,7 +2512,7 @@ export function deriveKanbanDescriptors(records, accessor) {
2542
2512
  const id = normalizeAxisId(value);
2543
2513
  if (seen.has(id)) return;
2544
2514
  seen.add(id);
2545
- result.push({ id, label: axisLabel(value), value, limit: null });
2515
+ result.push({ id, label: axisLabel(value, unassigned), value, limit: null });
2546
2516
  });
2547
2517
  return result;
2548
2518
  }
@@ -2591,9 +2561,9 @@ export function reorderKanbanData(records, id, movedRecord, options) {
2591
2561
  return result ? { records: result.records, from: result.moves[0].from, to: result.to } : null;
2592
2562
  }
2593
2563
 
2594
- /** @param {unknown} value @returns {string} */
2595
- function axisLabel(value) {
2596
- if (value == null || String(value).trim() === '') return 'Unassigned';
2564
+ /** @param {unknown} value @param {string} unassigned @returns {string} */
2565
+ function axisLabel(value, unassigned) {
2566
+ if (value == null || String(value).trim() === '') return unassigned;
2597
2567
  return String(value);
2598
2568
  }
2599
2569
 
@@ -189,6 +189,8 @@ export class Launcher extends Component {
189
189
  this._announcePending = false;
190
190
  this._announceToggle = false;
191
191
  this._destroyed = false;
192
+ this._presentation = 0;
193
+ this._closingPresentations = [];
192
194
 
193
195
  const listId = uid('zx-launcher-results');
194
196
  const label = String(this.options.label ?? this._message('launcher.label', 'Launcher'));
@@ -305,7 +307,11 @@ export class Launcher extends Component {
305
307
  this.close();
306
308
  });
307
309
  this.listen(dialog, 'close', () => {
308
- if (!dialog.open) this._releaseOverlay();
310
+ // Native close is queued; a newer presentation owns its state and requests now.
311
+ const presentation = this._closingPresentations.shift();
312
+ if (presentation !== undefined && presentation !== this._presentation) return;
313
+ if (dialog.open) return;
314
+ this._releaseOverlay();
309
315
  dialog.dataset.state = 'closed';
310
316
  input.setAttribute('aria-expanded', 'false');
311
317
  this._abortRequest();
@@ -342,6 +348,11 @@ export class Launcher extends Component {
342
348
  if (path.length) this._goTo(path);
343
349
  return this;
344
350
  }
351
+ // A caller may close an enhanced native dialog directly. Its queued close still needs its
352
+ // own ticket before a new presentation queues another one through close().
353
+ if (this.el.dataset.state === 'open' && !this._closingPresentations.includes(this._presentation)) {
354
+ this._closingPresentations.push(this._presentation);
355
+ }
345
356
  if (this._createdRoot) {
346
357
  const host = overlayScope(this.options.scope);
347
358
  if (this.el.parentElement !== host) host.append(this.el);
@@ -349,6 +360,7 @@ export class Launcher extends Component {
349
360
  const before = this._pages.map((entry) => entry.page);
350
361
  const opener = document.activeElement;
351
362
  this.el.showModal();
363
+ this._presentation += 1;
352
364
  /*
353
365
  * A modal on the overlay stack, like every Modal: Escape and presses inside it then reach no
354
366
  * popup left open behind it, and toast regions move into it while it is open.
@@ -392,7 +404,10 @@ export class Launcher extends Component {
392
404
 
393
405
  /** Closes the launcher. @returns {this} */
394
406
  close() {
395
- if (this.isOpen()) this.el.close();
407
+ if (this.isOpen()) {
408
+ this._closingPresentations.push(this._presentation);
409
+ this.el.close();
410
+ }
396
411
  return this;
397
412
  }
398
413
 
@@ -1,5 +1,6 @@
1
1
  import { Component } from '../../core/component.js';
2
2
  import { h, restoreTarget, snapshotTarget } from '../../core/dom.js';
3
+ import { formatNumber } from '../../core/format.js';
3
4
  import { printf } from '../../core/i18n.js';
4
5
  import { icon } from '../../core/icons.js';
5
6
  import { isElement } from '../../core/util.js';
@@ -471,7 +472,7 @@ export class ListToolbar extends Component {
471
472
  _countFormat() {
472
473
  const custom = this.options.countText;
473
474
  if (typeof custom === 'function') return (value) => String(custom(value));
474
- return (value) => this._message('listToolbar.results', '%1 results', value.toLocaleString());
475
+ return (value) => this.msgPlural('listToolbar.results', value, formatNumber(value));
475
476
  }
476
477
 
477
478
  /**
@@ -73,7 +73,7 @@ export class MasterPanel extends Component {
73
73
  class: 'zx-master-panel__buttons',
74
74
  ref: 'buttons',
75
75
  role: 'group',
76
- ariaLabel: 'Panel actions'
76
+ ariaLabel: this.msg('panel.actions')
77
77
  })
78
78
  );
79
79
  const content = h('div', {
@@ -277,7 +277,11 @@ export class MenuButton extends Component {
277
277
  /** @param {KeyboardEvent} event @returns {void} */
278
278
  #onMenuKeydown(event) {
279
279
  if (event.key === 'Tab') {
280
+ // Let the browser continue sequential navigation from the trigger's document position.
281
+ // Focus first: close callbacks may deliberately move it elsewhere, and their choice wins.
282
+ /** @type {HTMLElement} */ (this.el).focus();
280
283
  this.close();
284
+ if (document.activeElement !== this.el) event.preventDefault();
281
285
  return;
282
286
  }
283
287
  if (event.key === 'Enter' || event.key === ' ') {
@@ -329,6 +329,7 @@ export class Message extends Component {
329
329
  settled = true;
330
330
  state.pct = 100;
331
331
  syncProgress(entry, state);
332
+ entry.timeout = 600;
332
333
  entry.remaining = 600;
333
334
  if (this._queue.isActive(entry)) this._schedule(entry);
334
335
  },
@@ -341,6 +342,7 @@ export class Message extends Component {
341
342
  entry.node.setAttribute('role', 'alert');
342
343
  entry.iconHost.replaceChildren(icon('error', { size: 18 }));
343
344
  syncProgress(entry, state);
345
+ entry.timeout = 4000;
344
346
  entry.remaining = 4000;
345
347
  if (this._queue.isActive(entry)) this._schedule(entry);
346
348
  }
@@ -480,6 +482,7 @@ export class Message extends Component {
480
482
  /** @param {any} entry @returns {void} */
481
483
  _resume(entry) {
482
484
  if (entry.closed || entry.timer !== null || entry.hovered || entry.focused) return;
485
+ if (entry.timeout === 0) return;
483
486
  if (entry.remaining <= 0) {
484
487
  this._close(entry);
485
488
  return;
@@ -6,7 +6,8 @@ import { ICON_SIZE, icon } from '../../core/icons.js';
6
6
  * @typedef {Object} MultiValueEditorOptions
7
7
  * @property {unknown[]} [values=[]] Initial ordered values.
8
8
  * @property {unknown[]|Record<string, string>|null} [options=null] Allowed values; null uses text inputs.
9
- * @property {string} [addLabel='Add value'] Add-row button text.
9
+ * @property {string|null} [addLabel=null] Add-row button text; null reads the `multiValueEditor.add`
10
+ * message ("Add value").
10
11
  * @property {'both'|'buttons'|'drag'|'none'} [reorder='both'] Reordering affordances each row gets:
11
12
  * a drag handle, the up/down buttons, both, or neither.
12
13
  * @property {(event: CustomEvent<{values: string[]}>) => void} [onchange] Values change listener.
@@ -41,7 +42,7 @@ export class MultiValueEditor extends Component {
41
42
  static cssName = 'multi-value-editor';
42
43
 
43
44
  /** @type {MultiValueEditorOptions} */
44
- static defaults = { values: [], options: null, addLabel: 'Add value', reorder: 'both' };
45
+ static defaults = { values: [], options: null, addLabel: null, reorder: 'both' };
45
46
 
46
47
  /** @returns {HTMLElement} */
47
48
  render() {
@@ -58,7 +59,7 @@ export class MultiValueEditor extends Component {
58
59
  class: 'zx-btn zx-multi-value-editor__add',
59
60
  type: 'button',
60
61
  dataset: { action: 'add' }
61
- }, String(this.options.addLabel ?? 'Add value'));
62
+ }, String(this.options.addLabel ?? this.msg('multiValueEditor.add')));
62
63
  this._ownedNodes.push(this._rows, this._add);
63
64
  root.append(this._rows, this._add);
64
65
  this.listen(root, 'click', (event) => this._handleClick(event));
@@ -124,7 +125,7 @@ export class MultiValueEditor extends Component {
124
125
  : [[value, value], ...choices];
125
126
  const control = useSelect ? h('select', {
126
127
  class: 'zx-multi-value-editor__value',
127
- ariaLabel: `Value ${index + 1}`,
128
+ ariaLabel: this.msg('multiValueEditor.value', index + 1),
128
129
  dataset: { index }
129
130
  }, entries.map(([optionValue, label]) => h('option', {
130
131
  value: optionValue,
@@ -133,14 +134,14 @@ export class MultiValueEditor extends Component {
133
134
  class: 'zx-multi-value-editor__value',
134
135
  type: 'text',
135
136
  value,
136
- ariaLabel: `Value ${index + 1}`,
137
+ ariaLabel: this.msg('multiValueEditor.value', index + 1),
137
138
  dataset: { index }
138
139
  });
139
140
  return h('div', { class: 'zx-multi-value-editor__row', dataset: { row: index } },
140
141
  drag ? h('button', {
141
142
  class: 'zx-multi-value-editor__handle',
142
143
  type: 'button',
143
- ariaLabel: `Reorder value ${index + 1}. Use the arrow keys to move it.`,
144
+ ariaLabel: this.msg('multiValueEditor.reorder', index + 1),
144
145
  dataset: { action: 'grab', index }
145
146
  }, icon('drag', { size: 12 })) : null,
146
147
  control,
@@ -151,20 +152,20 @@ export class MultiValueEditor extends Component {
151
152
  // `aria-disabled` rather than `disabled`: the buttons re-render on every move, and a
152
153
  // control that disables itself under the reader's finger drops focus to the document.
153
154
  ariaDisabled: String(index === 0),
154
- ariaLabel: `Move value ${index + 1} up`,
155
+ ariaLabel: this.msg('multiValueEditor.moveUp', index + 1),
155
156
  dataset: { action: 'up', index }
156
157
  }, icon('chevron-up', { size: ICON_SIZE.chevron })) : null,
157
158
  buttons ? h('button', {
158
159
  class: 'zx-btn',
159
160
  type: 'button',
160
161
  ariaDisabled: String(index === last),
161
- ariaLabel: `Move value ${index + 1} down`,
162
+ ariaLabel: this.msg('multiValueEditor.moveDown', index + 1),
162
163
  dataset: { action: 'down', index }
163
164
  }, icon('chevron-down', { size: ICON_SIZE.chevron })) : null,
164
165
  h('button', {
165
166
  class: 'zx-btn',
166
167
  type: 'button',
167
- ariaLabel: `Remove value ${index + 1}`,
168
+ ariaLabel: this.msg('multiValueEditor.remove', index + 1),
168
169
  dataset: { action: 'remove', index }
169
170
  }, icon('x', { size: ICON_SIZE.dismiss }))
170
171
  )
@@ -94,7 +94,7 @@ export class NavigationBar extends Component {
94
94
  constructor(target, options = {}) {
95
95
  super(target, options);
96
96
  this._overflow = new MenuButton(this.refs.moreTrigger, {
97
- label: 'More',
97
+ label: this.msg('navigationBar.more'),
98
98
  icon: 'dots',
99
99
  kind: 'ghost',
100
100
  items: [],
@@ -131,7 +131,7 @@ export class NavigationBar extends Component {
131
131
  h('div', { class: 'zx-navigation-bar__brand', ref: 'title' }),
132
132
  h('nav', {
133
133
  class: 'zx-navigation-bar__navigation',
134
- ariaLabel: 'Primary navigation'
134
+ ariaLabel: this.msg('navigationBar.primary')
135
135
  },
136
136
  h('div', { class: 'zx-navigation-bar__items', ref: 'items' }),
137
137
  h('div', { class: 'zx-navigation-bar__more', ref: 'more' },
@@ -141,7 +141,7 @@ export class NavigationBar extends Component {
141
141
  class: 'zx-navigation-bar__actions',
142
142
  ref: 'actions',
143
143
  role: 'group',
144
- ariaLabel: 'Application actions'
144
+ ariaLabel: this.msg('navigationBar.actions')
145
145
  })
146
146
  );
147
147
  const panels = h('div', {
@@ -1,5 +1,6 @@
1
1
  import { Component } from '../../core/component.js';
2
2
  import { h, restoreTarget, snapshotTarget } from '../../core/dom.js';
3
+ import { formattingLocale } from '../../core/i18n.js';
3
4
  import { icon } from '../../core/icons.js';
4
5
 
5
6
  /**
@@ -19,7 +20,7 @@ import { icon } from '../../core/icons.js';
19
20
  * @property {boolean} [required=false] Whether an empty value is invalid.
20
21
  * @property {string|null} [name=null] Native form field name.
21
22
  * @property {boolean} [group=false] Whether to render thousands separators while idle.
22
- * @property {string|null} [locale=null] Locale for formatting; defaults to the document locale.
23
+ * @property {string|null} [locale=null] Locale for formatting; defaults to the active language.
23
24
  * @property {Record<string, string>|Record<string, Record<string, string>>} [msg] Localized messages.
24
25
  * @property {(event: CustomEvent<{value: number|null}>) => void} [onchange] Committed-value listener.
25
26
  * @property {(event: CustomEvent<{value: number|null}>) => void} [oninput] Per-keystroke listener.
@@ -295,7 +296,7 @@ export class NumberField extends Component {
295
296
  const max = this._rangeMax;
296
297
  // Step from whatever is in the field right now: typing 25 then pressing ArrowUp must give 26,
297
298
  // not commit-value + 1.
298
- const typed = parseNumber(this.refs.input.value);
299
+ const typed = parseNumber(this.refs.input.value, this.options.group ? this._separators(this._inputLocale) : null);
299
300
  const current = typed ?? this._value;
300
301
  const base = current === null ? (min ?? 0) : current;
301
302
  // An empty field steps to the lower bound first, so the first click lands on a real value.
@@ -311,24 +312,33 @@ export class NumberField extends Component {
311
312
  }
312
313
 
313
314
  /**
314
- * The grouping and decimal separators of the configured locale.
315
- * @returns {{group: string, decimal: string}}
315
+ * The grouping and decimal separators of the effective formatting locale.
316
+ * @param {string|string[]} [locale] Locale of the text being parsed.
317
+ * @returns {{group: string, decimal: string, minus: string, digits: Record<string, string>}}
316
318
  */
317
- _separators() {
318
- if (this._localeSeparators) return this._localeSeparators;
319
- const parts = new Intl.NumberFormat(this.options.locale ?? undefined, {
319
+ _separators(locale = formattingLocale(this.options.locale)) {
320
+ const key = String(locale);
321
+ if (this._localeSeparators && this._separatorLocale === key) return this._localeSeparators;
322
+ this._separatorLocale = key;
323
+ const parts = new Intl.NumberFormat(locale, {
320
324
  minimumFractionDigits: 1
321
325
  }).formatToParts(1234.5);
326
+ const digitFormatter = new Intl.NumberFormat(locale, { useGrouping: false });
322
327
  this._localeSeparators = {
323
328
  group: parts.find((part) => part.type === 'group')?.value ?? ',',
324
- decimal: parts.find((part) => part.type === 'decimal')?.value ?? '.'
329
+ decimal: parts.find((part) => part.type === 'decimal')?.value ?? '.',
330
+ minus: digitFormatter.formatToParts(-1).find((part) => part.type === 'minusSign')?.value ?? '-',
331
+ digits: Object.fromEntries(Array.from({ length: 10 }, (_, value) => [
332
+ digitFormatter.formatToParts(value).find((part) => part.type === 'integer')?.value ?? String(value),
333
+ String(value)
334
+ ]))
325
335
  };
326
336
  return this._localeSeparators;
327
337
  }
328
338
 
329
339
  /** @returns {void} */
330
340
  _onInput() {
331
- const parsed = parseNumber(this.refs.input.value, this.options.group ? this._separators() : null);
341
+ const parsed = parseNumber(this.refs.input.value, this.options.group ? this._separators(this._inputLocale) : null);
332
342
  this._syncAria(parsed);
333
343
  this.emit('input', { value: parsed });
334
344
  }
@@ -359,12 +369,13 @@ export class NumberField extends Component {
359
369
 
360
370
  /** Parses whatever the user typed and normalizes the displayed text. @returns {void} */
361
371
  _commit() {
362
- this.set(this.refs.input.value);
372
+ this.set(parseNumber(this.refs.input.value, this.options.group ? this._separators(this._inputLocale) : null));
363
373
  }
364
374
 
365
375
  /** @returns {void} */
366
376
  _syncInput() {
367
377
  const input = /** @type {HTMLInputElement} */ (this.refs.input);
378
+ this._inputLocale = formattingLocale(this.options.locale);
368
379
  const text = this._value === null ? '' : this._format(this._value, this._editing);
369
380
  if (input.value !== text) input.value = text;
370
381
  this._syncAria(this._value);
@@ -405,7 +416,7 @@ export class NumberField extends Component {
405
416
  // Grouped fields stay in the locale's notation even while editing — only the thousands
406
417
  // separators drop away. Display and input therefore always use the same decimal character,
407
418
  // so a value the field rendered is always a value it can read back.
408
- return new Intl.NumberFormat(this.options.locale ?? undefined, {
419
+ return new Intl.NumberFormat(formattingLocale(this.options.locale), {
409
420
  minimumFractionDigits: this._precision,
410
421
  maximumFractionDigits: this._precision,
411
422
  useGrouping: !editing
@@ -464,7 +475,7 @@ export class NumberField extends Component {
464
475
  * which is the best available guess for free-form typing.
465
476
  *
466
477
  * @param {unknown} raw Value to parse.
467
- * @param {{group: string, decimal: string}|null} [separators=null] Known locale separators.
478
+ * @param {{group: string, decimal: string, minus?: string, digits?: Record<string, string>}|null} [separators=null] Known locale separators, minus sign, and digit mappings.
468
479
  * @returns {number|null} The number, or null when the input is empty or unparseable.
469
480
  */
470
481
  export function parseNumber(raw, separators = null) {
@@ -475,9 +486,14 @@ export function parseNumber(raw, separators = null) {
475
486
 
476
487
  let normalized;
477
488
  if (separators) {
478
- normalized = text
489
+ normalized = text;
490
+ for (const [digit, ascii] of Object.entries(separators.digits ?? {})) {
491
+ normalized = normalized.split(digit).join(ascii);
492
+ }
493
+ normalized = normalized
479
494
  .split(separators.group).join('')
480
495
  .replace(separators.decimal, '.')
496
+ .replace(separators.minus ?? '-', '-')
481
497
  .replace(/[^\d.\-+eE]/g, '');
482
498
  } else {
483
499
  // Keep the last separator as the decimal point; everything before it is grouping.