@zeyos/zx 5.6.0 → 5.7.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.
Files changed (227) hide show
  1. package/CHANGELOG.md +188 -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/checklist/checklist.d.ts +29 -0
  15. package/dist/types/components/code-editor/code-editor.d.ts +7 -2
  16. package/dist/types/components/composer/composer.d.ts +206 -4
  17. package/dist/types/components/composer/queue.d.ts +76 -0
  18. package/dist/types/components/copy/copy-button.d.ts +6 -4
  19. package/dist/types/components/copy/copy-input.d.ts +10 -6
  20. package/dist/types/components/datebox/date-range-box.d.ts +33 -0
  21. package/dist/types/components/datebox/placeholder.d.ts +7 -0
  22. package/dist/types/components/dialog/dialog.d.ts +2 -2
  23. package/dist/types/components/dock/dock.d.ts +12 -3
  24. package/dist/types/components/entity-ref/entity-ref.d.ts +5 -3
  25. package/dist/types/components/field-upload/field-upload.d.ts +3 -2
  26. package/dist/types/components/file-item/file-item.d.ts +3 -2
  27. package/dist/types/components/file-list/file-list.d.ts +14 -8
  28. package/dist/types/components/filter/filter-model.d.ts +31 -1
  29. package/dist/types/components/filter/filter.d.ts +20 -2
  30. package/dist/types/components/finder/finder.d.ts +14 -6
  31. package/dist/types/components/flag/flag.d.ts +99 -0
  32. package/dist/types/components/grid/grid.d.ts +1 -1
  33. package/dist/types/components/kanban-view/kanban-view.d.ts +8 -66
  34. package/dist/types/components/launcher/launcher.d.ts +2 -0
  35. package/dist/types/components/modal/modal.d.ts +34 -8
  36. package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +3 -2
  37. package/dist/types/components/number-field/number-field.d.ts +41 -7
  38. package/dist/types/components/prompt-starters/prompt-starters.d.ts +107 -0
  39. package/dist/types/components/prose/prose.d.ts +9 -6
  40. package/dist/types/components/questionnaire/conditions.d.ts +270 -0
  41. package/dist/types/components/questionnaire/items.d.ts +52 -30
  42. package/dist/types/components/questionnaire/questionnaire.d.ts +44 -4
  43. package/dist/types/components/rating/rating.d.ts +5 -3
  44. package/dist/types/components/select/country.d.ts +106 -0
  45. package/dist/types/components/select/field-adapter.d.ts +2 -1
  46. package/dist/types/components/select/locale.d.ts +102 -0
  47. package/dist/types/components/select/select.d.ts +41 -2
  48. package/dist/types/components/sheet/sheet.d.ts +2 -2
  49. package/dist/types/components/slider/slider.d.ts +1 -0
  50. package/dist/types/components/sort-control/sort-control.d.ts +7 -3
  51. package/dist/types/components/source-list/source-list.d.ts +7 -5
  52. package/dist/types/components/split-view/split-view.d.ts +5 -3
  53. package/dist/types/components/surface/catalog.d.ts +260 -0
  54. package/dist/types/components/surface/elicit.d.ts +81 -0
  55. package/dist/types/components/surface/mcp.d.ts +165 -0
  56. package/dist/types/components/surface/schema.d.ts +314 -0
  57. package/dist/types/components/surface/stream.d.ts +118 -0
  58. package/dist/types/components/surface/surface.d.ts +718 -0
  59. package/dist/types/components/surface/text.d.ts +277 -0
  60. package/dist/types/components/surface/validate.d.ts +339 -0
  61. package/dist/types/components/table/table.d.ts +55 -3
  62. package/dist/types/components/table/window.d.ts +203 -0
  63. package/dist/types/components/toolbar/toolbar.d.ts +10 -6
  64. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  65. package/dist/types/components/tree/tree.d.ts +20 -13
  66. package/dist/types/core/component.d.ts +10 -0
  67. package/dist/types/core/date.d.ts +8 -1
  68. package/dist/types/core/dom.d.ts +15 -0
  69. package/dist/types/core/http.d.ts +10 -0
  70. package/dist/types/core/i18n.d.ts +38 -0
  71. package/dist/types/core/messages.d.ts +344 -1
  72. package/dist/types/core/storage.d.ts +7 -2
  73. package/dist/types/elements/define.d.ts +21 -46
  74. package/dist/types/elements/definitions.d.ts +147 -0
  75. package/dist/types/elements/kit.d.ts +7 -0
  76. package/dist/types/elements/reflect.d.ts +6 -3
  77. package/dist/types/index.d.ts +10 -1
  78. package/dist/types/internal/date-locale.d.ts +7 -0
  79. package/dist/types/internal/json-patch.d.ts +146 -0
  80. package/dist/types/locales/de.d.ts +13 -0
  81. package/dist/types/locales/en.d.ts +2 -0
  82. package/dist/types/locales/index.d.ts +823 -0
  83. package/dist/types/zeyos/view.d.ts +8 -1
  84. package/dist/zx-zeyos.esm.js +16852 -15131
  85. package/dist/zx-zeyos.esm.min.js +5 -5
  86. package/dist/zx.core.css +1276 -0
  87. package/dist/zx.core.min.css +1 -0
  88. package/dist/zx.css +520 -143
  89. package/dist/zx.esm.js +40940 -29684
  90. package/dist/zx.esm.min.js +36 -23
  91. package/dist/zx.global.js +40940 -29684
  92. package/dist/zx.global.min.js +36 -23
  93. package/dist/zx.layered.css +17315 -0
  94. package/dist/zx.layered.min.css +1 -0
  95. package/dist/zx.min.css +1 -1
  96. package/docs/agent-catalog.json +12501 -0
  97. package/docs/agent-surfaces.md +340 -0
  98. package/docs/api.json +909 -137
  99. package/docs/llms.md +1046 -80
  100. package/docs/llms.txt +30 -9
  101. package/package.json +29 -6
  102. package/src/components/account-menu/account-menu.js +6 -3
  103. package/src/components/activity-item/activity-item.js +2 -1
  104. package/src/components/activity-list/activity-list.js +16 -10
  105. package/src/components/agent-thread/ag-ui.js +1439 -0
  106. package/src/components/agent-thread/agent-thread.js +359 -54
  107. package/src/components/agent-thread/ui-message-stream.js +1281 -0
  108. package/src/components/app-sidebar/app-sidebar.js +18 -8
  109. package/src/components/approval-card/approval-card.js +3 -2
  110. package/src/components/block-view/block-view.js +7 -6
  111. package/src/components/breadcrumb/breadcrumb.js +8 -5
  112. package/src/components/button/button.css +24 -11
  113. package/src/components/calendar/calendar-model.js +8 -2
  114. package/src/components/calendar/calendar.js +53 -18
  115. package/src/components/chart/chart.js +54 -23
  116. package/src/components/checklist/checklist.css +9 -1
  117. package/src/components/checklist/checklist.js +59 -3
  118. package/src/components/checklist/field-adapter.js +2 -11
  119. package/src/components/code-editor/code-editor.js +45 -8
  120. package/src/components/code-editor/field-adapter.js +1 -1
  121. package/src/components/composer/composer.css +80 -1
  122. package/src/components/composer/composer.js +390 -16
  123. package/src/components/composer/queue.js +78 -0
  124. package/src/components/context-menu/context-menu.js +12 -1
  125. package/src/components/copy/copy-button.js +9 -7
  126. package/src/components/copy/copy-input.js +10 -6
  127. package/src/components/date-picker/date-picker.js +2 -1
  128. package/src/components/date-picker/date-range-picker.js +8 -7
  129. package/src/components/datebox/date-range-box.js +3 -9
  130. package/src/components/datebox/datebox.js +18 -21
  131. package/src/components/datebox/placeholder.js +18 -0
  132. package/src/components/dialog/dialog.js +4 -5
  133. package/src/components/dock/dock.js +34 -13
  134. package/src/components/entity-ref/entity-ref.js +16 -5
  135. package/src/components/field-upload/field-upload.js +81 -38
  136. package/src/components/file-item/file-item.js +70 -40
  137. package/src/components/file-list/file-list.js +15 -9
  138. package/src/components/filter/filter-model.js +46 -8
  139. package/src/components/filter/filter.css +3 -3
  140. package/src/components/filter/filter.js +29 -10
  141. package/src/components/filter-panel/filter-panel.js +13 -5
  142. package/src/components/finder/finder.js +50 -26
  143. package/src/components/flag/flag.css +40 -0
  144. package/src/components/flag/flag.js +177 -0
  145. package/src/components/form/form.js +1 -1
  146. package/src/components/grid/grid.js +22 -8
  147. package/src/components/kanban-view/kanban-view.js +51 -81
  148. package/src/components/launcher/launcher.js +17 -2
  149. package/src/components/list-toolbar/list-toolbar.js +2 -1
  150. package/src/components/master-panel/master-panel.js +1 -1
  151. package/src/components/menu-button/menu-button.js +4 -0
  152. package/src/components/message/message.js +3 -0
  153. package/src/components/modal/modal.js +62 -8
  154. package/src/components/multi-value-editor/multi-value-editor.js +10 -9
  155. package/src/components/navigation-bar/navigation-bar.js +3 -3
  156. package/src/components/number-field/number-field.js +98 -29
  157. package/src/components/prompt-starters/prompt-starters.css +91 -0
  158. package/src/components/prompt-starters/prompt-starters.js +206 -0
  159. package/src/components/prose/prose.js +14 -10
  160. package/src/components/questionnaire/conditions.js +666 -0
  161. package/src/components/questionnaire/items.js +150 -41
  162. package/src/components/questionnaire/questionnaire.js +126 -32
  163. package/src/components/rating/rating.js +5 -4
  164. package/src/components/run-status/run-status.js +2 -2
  165. package/src/components/select/country.js +136 -0
  166. package/src/components/select/field-adapter.js +7 -2
  167. package/src/components/select/locale.js +219 -0
  168. package/src/components/select/select.css +20 -22
  169. package/src/components/select/select.js +94 -12
  170. package/src/components/sheet/sheet-stack.js +10 -1
  171. package/src/components/sheet/sheet.js +12 -5
  172. package/src/components/slider/slider.js +7 -2
  173. package/src/components/sort-control/sort-control.js +15 -5
  174. package/src/components/source-list/source-list.js +7 -4
  175. package/src/components/split-view/split-view.js +5 -3
  176. package/src/components/surface/catalog.js +1334 -0
  177. package/src/components/surface/elicit.js +107 -0
  178. package/src/components/surface/mcp.js +243 -0
  179. package/src/components/surface/schema.js +644 -0
  180. package/src/components/surface/stream.js +245 -0
  181. package/src/components/surface/surface.css +308 -0
  182. package/src/components/surface/surface.js +2291 -0
  183. package/src/components/surface/text.js +513 -0
  184. package/src/components/surface/validate.js +2218 -0
  185. package/src/components/tabbox/tabbox.js +9 -0
  186. package/src/components/table/table.css +63 -3
  187. package/src/components/table/table.js +167 -28
  188. package/src/components/table/window.js +317 -0
  189. package/src/components/toolbar/toolbar.js +12 -7
  190. package/src/components/tooltip/tooltip.css +2 -3
  191. package/src/components/tooltip/tooltip.js +32 -5
  192. package/src/components/tree/tree.js +53 -23
  193. package/src/core/component.js +25 -1
  194. package/src/core/date.js +62 -16
  195. package/src/core/dom.js +67 -4
  196. package/src/core/format.js +15 -13
  197. package/src/core/http.js +29 -20
  198. package/src/core/i18n.js +83 -10
  199. package/src/core/icons.js +13 -2
  200. package/src/core/keyboard.js +79 -8
  201. package/src/core/messages.js +376 -2
  202. package/src/core/overlay-host.js +1 -0
  203. package/src/core/position.js +3 -2
  204. package/src/core/storage.js +59 -6
  205. package/src/elements/define.js +178 -130
  206. package/src/elements/definitions.js +229 -0
  207. package/src/elements/kit.js +444 -0
  208. package/src/elements/reflect.js +8 -3
  209. package/src/index.js +10 -1
  210. package/src/internal/date-locale.js +11 -0
  211. package/src/internal/json-patch.js +405 -0
  212. package/src/locales/de.js +911 -0
  213. package/src/locales/en.js +2 -0
  214. package/src/locales/index.js +7 -0
  215. package/src/zeyos/calendar.js +2 -1
  216. package/src/zeyos/form.js +2 -1
  217. package/src/zeyos/launcher.js +7 -6
  218. package/src/zeyos/module-bar.js +2 -1
  219. package/src/zeyos/schema.js +37 -23
  220. package/src/zeyos/select.js +4 -3
  221. package/src/zeyos/table.js +2 -13
  222. package/src/zeyos/view.js +57 -17
  223. package/styles/core.css +11 -0
  224. package/styles/tokens/semantic.css +1 -0
  225. package/styles/zeyos.css +2 -0
  226. package/styles/zx.css +4 -8
  227. 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;
@@ -17,13 +17,21 @@ const FOCUSABLE_SELECTOR = [
17
17
  * @property {Node|string|number|{toElement: () => Node|null}|null} [content=null] Modal content.
18
18
  * @property {string|number} [width='auto'] CSS width, or a pixel width when numeric.
19
19
  * @property {boolean} [closable=true] Whether Escape may close the modal.
20
- * @property {boolean} [lightDismiss=false] Whether a backdrop click closes the modal.
20
+ * @property {boolean} [lightDismiss=false] Whether a backdrop click closes the modal. Like every
21
+ * dismissal by the reader, it raises a preventable `cancel` first.
21
22
  * @property {boolean} [destroyOnClose=false] Whether to destroy the modal after it closes.
22
23
  * @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns the overlay; defaults to the opener. Resolved on every open, so a scope connected after construction still owns it.
23
24
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
24
25
  * @property {(event: CustomEvent<{result: unknown}>) => void} [onclose] Close event listener.
25
- * @property {(event: CustomEvent<Record<string, never>>) => void} [oncancel] Cancel event listener.
26
+ * @property {(event: CustomEvent<ModalCancelDetail>) => void} [oncancel] Cancel event listener.
26
27
  */
28
+ /**
29
+ * What the reader did to ask for dismissal: pressed Escape, used a header close button, chose a
30
+ * footer button whose action is `'cancel'`, clicked the backdrop, pressed outside a non-modal
31
+ * overlay, or dragged it away.
32
+ * @typedef {'escape'|'close-button'|'button'|'backdrop'|'outside'|'drag'} ModalDismissReason
33
+ */
34
+ /** @typedef {{reason: ModalDismissReason}} ModalCancelDetail */
27
35
 
28
36
  /**
29
37
  * Thin native-dialog overlay with lifecycle-safe content and dismissal behavior.
@@ -76,8 +84,35 @@ export class Modal extends Component {
76
84
  this.#setWidth(this.options.width);
77
85
  replaceContent(this.refs.content, this.options.content);
78
86
 
87
+ /*
88
+ * Escape on a modal presentation is answered here rather than by the browser's close request.
89
+ * A browser stops honouring a prevented `cancel` once close requests repeat without other
90
+ * interaction, which would let a third Escape through an "unsaved changes" guard; a cancelled
91
+ * keydown never becomes a close request at all. The listener sits on `window`, the last stop
92
+ * of the bubble, so everything that may use the key first has had it: a popup inside the
93
+ * dialog, the overlay stack, an application's own `document` handler. Whatever they prevented
94
+ * is not ours. Only the topmost modal answers, so a dialog opened above this one — the
95
+ * library's or the application's — keeps its key.
96
+ */
97
+ if (typeof window !== 'undefined') this.listen(window, 'keydown', (event) => {
98
+ const key = /** @type {KeyboardEvent} */ (event);
99
+ if (key.key !== 'Escape' || key.defaultPrevented || key.isComposing) return;
100
+ if (!this.isOpen() || !this.el.matches(':modal')) return;
101
+ const modals = document.querySelectorAll('dialog:modal');
102
+ if (modals[modals.length - 1] !== this.el) return;
103
+ // Reported before the key is cancelled: a `cancel` listener may ask whether something else
104
+ // had already claimed this keydown, and our own claim must not answer for it.
105
+ if (this.options.closable) this._requestDismiss('escape');
106
+ else this.emit('cancel', { reason: 'escape' });
107
+ key.preventDefault();
108
+ });
109
+ /*
110
+ * The platform's own close request, for what is not a keydown this class saw: a back gesture,
111
+ * an Escape pressed mid-composition, an assistive-technology dismiss. The browser may make
112
+ * such a request non-cancelable, and then the dialog closes whatever a listener says.
113
+ */
79
114
  this.listen(this.el, 'cancel', (event) => {
80
- const cancelEvent = this.emit('cancel');
115
+ const cancelEvent = this.emit('cancel', { reason: 'escape' });
81
116
  if (!this.options.closable || cancelEvent.defaultPrevented) event.preventDefault();
82
117
  });
83
118
  this.listen(this.el, 'close', () => {
@@ -85,7 +120,7 @@ export class Modal extends Component {
85
120
  });
86
121
  this.listen(this.el, 'click', (event) => {
87
122
  if (!this.options.lightDismiss || event.target !== this.el || !isBackdropClick(this.el, event)) return;
88
- this.close();
123
+ this._requestDismiss('backdrop');
89
124
  });
90
125
  /*
91
126
  * One listener for every close path, because `close` is the one event all four converge on:
@@ -168,8 +203,9 @@ export class Modal extends Component {
168
203
  * Describes the current presentation for the overlay stack, or returns null to stay off it.
169
204
  *
170
205
  * The kind is read from the platform like `aria-modal` is: a `showModal()` dialog is `modal`,
171
- * and its Escape and backdrop stay the browser's; anything else is `non-modal`, and a subclass
172
- * presenting that way adds the Escape and outside-press handling it wants.
206
+ * and the stack leaves its Escape alone (this class answers it, see the constructor); anything
207
+ * else is `non-modal`, and a subclass presenting that way adds the Escape and outside-press
208
+ * handling it wants.
173
209
  * @returns {import('../../core/overlay-stack.js').OverlayEntryOptions|null}
174
210
  * @protected
175
211
  */
@@ -182,6 +218,22 @@ export class Modal extends Component {
182
218
  };
183
219
  }
184
220
 
221
+ /**
222
+ * Asks to close on the reader's behalf: emits a preventable `cancel` naming what they did, and
223
+ * closes unless a listener prevented it. Every dismissal gesture goes through here; `close()`
224
+ * itself stays unconditional, for the application's own decisions.
225
+ * @param {ModalDismissReason} reason What the reader did.
226
+ * @returns {boolean} Whether the overlay is closing.
227
+ * @fires Modal#cancel
228
+ * @protected
229
+ */
230
+ _requestDismiss(reason) {
231
+ if (!this.isOpen()) return false;
232
+ if (this.emit('cancel', { reason }).defaultPrevented) return false;
233
+ this.close();
234
+ return true;
235
+ }
236
+
185
237
  /**
186
238
  * Re-registers the current presentation on the overlay stack: called after every presentation,
187
239
  * including a subclass's change of address that bypasses `open()`.
@@ -449,9 +501,11 @@ export class Modal extends Component {
449
501
  */
450
502
 
451
503
  /**
452
- * Fired when Escape requests cancellation. Preventing it keeps the modal open.
504
+ * Fired when the reader asks to dismiss the modal — Escape, a header close button, a `'cancel'`
505
+ * footer button, a backdrop click, a press outside a non-modal overlay, a drag — with the gesture
506
+ * in `detail.reason`. Preventing it keeps the modal open. A programmatic `close()` does not raise it.
453
507
  * @event Modal#cancel
454
- * @type {CustomEvent<Record<string, never>>}
508
+ * @type {CustomEvent<ModalCancelDetail>}
455
509
  */
456
510
 
457
511
  /**
@@ -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', {