@zeyos/zx 4.3.4 → 4.4.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 (128) hide show
  1. package/CHANGELOG.md +155 -0
  2. package/README.md +7 -0
  3. package/dist/types/components/activity-item/activity-item.d.ts +351 -0
  4. package/dist/types/components/activity-list/activity-list.d.ts +195 -0
  5. package/dist/types/components/app-sidebar/app-sidebar.d.ts +28 -0
  6. package/dist/types/components/button/button.d.ts +8 -0
  7. package/dist/types/components/calendar/calendar.d.ts +19 -0
  8. package/dist/types/components/card/card.d.ts +7 -0
  9. package/dist/types/components/card-view/card-view.d.ts +11 -3
  10. package/dist/types/components/card-view/record-card.d.ts +7 -1
  11. package/dist/types/components/code-editor/code-editor.d.ts +160 -0
  12. package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
  13. package/dist/types/components/context-menu/context-menu.d.ts +18 -2
  14. package/dist/types/components/date-picker/date-picker.d.ts +8 -0
  15. package/dist/types/components/date-picker/time-picker.d.ts +7 -0
  16. package/dist/types/components/dialog/dialog.d.ts +29 -0
  17. package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
  18. package/dist/types/components/file-item/file-item.d.ts +234 -0
  19. package/dist/types/components/file-list/file-list.d.ts +171 -0
  20. package/dist/types/components/filter/filter.d.ts +91 -36
  21. package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
  22. package/dist/types/components/kanban-view/kanban-card.d.ts +138 -0
  23. package/dist/types/components/kanban-view/kanban-view.d.ts +170 -4
  24. package/dist/types/components/launcher/launcher.d.ts +19 -12
  25. package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
  26. package/dist/types/components/menu-button/menu-button.d.ts +4 -37
  27. package/dist/types/components/message/message.d.ts +7 -0
  28. package/dist/types/components/modal/modal.d.ts +48 -0
  29. package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
  30. package/dist/types/components/panel/panel.d.ts +7 -0
  31. package/dist/types/components/search/search.d.ts +7 -0
  32. package/dist/types/components/select/select.d.ts +4 -0
  33. package/dist/types/components/sort-control/sort-control.d.ts +105 -0
  34. package/dist/types/components/stat-tile/stat-tile.d.ts +277 -0
  35. package/dist/types/components/tabbox/tabbox.d.ts +7 -0
  36. package/dist/types/components/table/table.d.ts +144 -0
  37. package/dist/types/components/table-view/table-view.d.ts +11 -5
  38. package/dist/types/components/timebox/timebox.d.ts +7 -0
  39. package/dist/types/components/value-list/value-list.d.ts +8 -0
  40. package/dist/types/components/view/record-view.d.ts +96 -5
  41. package/dist/types/core/icons.d.ts +17 -0
  42. package/dist/types/index.d.ts +11 -0
  43. package/dist/types/internal/app-rail.d.ts +10 -0
  44. package/dist/types/internal/menu-items.d.ts +134 -0
  45. package/dist/zx-zeyos.esm.js +616 -77
  46. package/dist/zx-zeyos.esm.min.js +8 -1
  47. package/dist/zx.css +2085 -238
  48. package/dist/zx.esm.js +6704 -1542
  49. package/dist/zx.esm.min.js +10 -3
  50. package/dist/zx.global.js +6704 -1542
  51. package/dist/zx.global.min.js +10 -3
  52. package/dist/zx.min.css +1 -1
  53. package/docs/api.json +1479 -127
  54. package/docs/llms.md +315 -10
  55. package/docs/llms.txt +11 -5
  56. package/package.json +1 -1
  57. package/src/components/activity-item/activity-item.css +137 -0
  58. package/src/components/activity-item/activity-item.js +599 -0
  59. package/src/components/activity-list/activity-list.css +64 -0
  60. package/src/components/activity-list/activity-list.js +375 -0
  61. package/src/components/app-rail/app-rail.css +227 -19
  62. package/src/components/app-sidebar/app-sidebar.css +414 -24
  63. package/src/components/app-sidebar/app-sidebar.js +65 -5
  64. package/src/components/button/button.css +8 -0
  65. package/src/components/button/button.js +6 -1
  66. package/src/components/calendar/calendar.js +33 -3
  67. package/src/components/card/card.js +12 -1
  68. package/src/components/card-view/card-view.css +1 -0
  69. package/src/components/card-view/card-view.js +25 -9
  70. package/src/components/card-view/record-card.js +7 -3
  71. package/src/components/code-editor/code-editor.css +67 -0
  72. package/src/components/code-editor/code-editor.js +288 -0
  73. package/src/components/code-editor/field-adapter.js +34 -0
  74. package/src/components/context-menu/context-menu.css +80 -3
  75. package/src/components/context-menu/context-menu.js +22 -30
  76. package/src/components/date-picker/date-picker.js +22 -8
  77. package/src/components/date-picker/month-picker.js +3 -3
  78. package/src/components/date-picker/time-picker.js +20 -8
  79. package/src/components/dialog/dialog.js +88 -66
  80. package/src/components/dropdown/dropdown.js +2 -2
  81. package/src/components/entity-ref/entity-ref.css +182 -0
  82. package/src/components/entity-ref/entity-ref.js +496 -0
  83. package/src/components/file-item/file-item.css +88 -0
  84. package/src/components/file-item/file-item.js +371 -0
  85. package/src/components/file-list/file-list.css +51 -0
  86. package/src/components/file-list/file-list.js +320 -0
  87. package/src/components/filter/filter.css +27 -1
  88. package/src/components/filter/filter.js +199 -45
  89. package/src/components/filter-panel/filter-panel.css +104 -0
  90. package/src/components/filter-panel/filter-panel.js +964 -0
  91. package/src/components/kanban-view/kanban-card.js +239 -0
  92. package/src/components/kanban-view/kanban-view.css +194 -0
  93. package/src/components/kanban-view/kanban-view.js +251 -8
  94. package/src/components/launcher/launcher.js +59 -27
  95. package/src/components/list-toolbar/list-toolbar.css +189 -0
  96. package/src/components/list-toolbar/list-toolbar.js +851 -0
  97. package/src/components/menu-button/menu-button.css +80 -3
  98. package/src/components/menu-button/menu-button.js +21 -37
  99. package/src/components/message/message.css +5 -2
  100. package/src/components/message/message.js +13 -2
  101. package/src/components/modal/modal.css +15 -0
  102. package/src/components/modal/modal.js +141 -0
  103. package/src/components/navigation-bar/navigation-bar.css +77 -2
  104. package/src/components/navigation-bar/navigation-bar.js +171 -4
  105. package/src/components/panel/panel.js +13 -2
  106. package/src/components/search/search.js +17 -5
  107. package/src/components/select/field-adapter.js +4 -1
  108. package/src/components/select/select.js +3 -0
  109. package/src/components/sort-control/sort-control.css +17 -0
  110. package/src/components/sort-control/sort-control.js +140 -0
  111. package/src/components/stat-tile/stat-tile.css +213 -0
  112. package/src/components/stat-tile/stat-tile.js +590 -0
  113. package/src/components/tabbox/tabbox.js +12 -1
  114. package/src/components/table/table.css +51 -2
  115. package/src/components/table/table.js +298 -19
  116. package/src/components/table-view/table-view.css +8 -2
  117. package/src/components/table-view/table-view.js +21 -6
  118. package/src/components/tag-picker/tag-picker.css +3 -1
  119. package/src/components/timebox/timebox.js +18 -5
  120. package/src/components/value-list/value-list.js +22 -6
  121. package/src/components/view/record-view.css +5 -0
  122. package/src/components/view/record-view.js +100 -7
  123. package/src/core/icons.js +74 -5
  124. package/src/index.js +25 -0
  125. package/src/internal/app-rail.js +19 -1
  126. package/src/internal/menu-items.js +142 -0
  127. package/styles/print.css +192 -0
  128. package/styles/zx.css +11 -0
@@ -7,6 +7,9 @@ export type RecordCardLink = import('../card-view/record-card.js').RecordCardLin
7
7
  export type RecordCardAction = import('../card-view/record-card.js').RecordCardAction;
8
8
  export type MenuItem = import('../menu-button/menu-button.js').MenuItem;
9
9
  export type KanbanRule = import('./kanban-policy.js').KanbanRule;
10
+ export type KanbanIndicator = import('./kanban-card.js').KanbanIndicator;
11
+ export type KanbanIndicatorSource = string | KanbanIndicator | ((record: KanbanRecord, index: number) => KanbanIndicator | Node | unknown) | null;
12
+ export type KanbanAssignee = import('./kanban-card.js').KanbanAssignee;
10
13
  export type KanbanRejectReason = import('./kanban-policy.js').KanbanRejectReason;
11
14
  export type KanbanMoveEvaluation = import('./kanban-policy.js').KanbanMoveEvaluation;
12
15
  export type KanbanAccessor = string | ((record: KanbanRecord, index: number) => unknown) | null;
@@ -253,6 +256,10 @@ export type KanbanViewOptions = {
253
256
  * Shared selection mode.
254
257
  */
255
258
  selectable?: false | 'single' | 'multi';
259
+ /**
260
+ * Select through a checkbox or the non-interactive card surface.
261
+ */
262
+ selectionTrigger?: 'checkbox' | 'card';
256
263
  /**
257
264
  * Initial record ids.
258
265
  */
@@ -266,9 +273,10 @@ export type KanbanViewOptions = {
266
273
  */
267
274
  hiddenFields?: string[];
268
275
  /**
269
- * Show shared field controls.
276
+ * Show shared field controls. Redeclared narrower than `RecordViewOptions` it fails declaration
277
+ * emit, because the two option types are intersected.
270
278
  */
271
- fieldControls?: boolean;
279
+ fieldControls?: boolean | import('../view/record-view.js').ViewFieldControlsConfig;
272
280
  /**
273
281
  * Empty-board content.
274
282
  */
@@ -322,6 +330,54 @@ export type KanbanViewOptions = {
322
330
  * pointer drag. Touch drags from the card body require a long press so the board still scrolls.
323
331
  */
324
332
  dragFrom?: 'card' | 'handle';
333
+ /**
334
+ * Move-handle presentation. `keyboard`
335
+ * keeps it announced and tabbable but out of sight until it takes focus, because the card itself
336
+ * is already the pointer drag source; `always` shows it alongside the card's other controls.
337
+ * `dragFrom:'handle'` overrides this — a drag source a pointer user cannot see is not a control.
338
+ */
339
+ moveHandle?: 'keyboard' | 'always';
340
+ /**
341
+ * Icon
342
+ * naming what the record is, drawn before the identifier.
343
+ */
344
+ entityIcon?: string | ((record: KanbanRecord, index: number) => string | null) | null;
345
+ /**
346
+ * Stable record key shown on the card head.
347
+ */
348
+ identifier?: KanbanCardField;
349
+ /**
350
+ * Status indicator source.
351
+ */
352
+ status?: KanbanIndicatorSource;
353
+ /**
354
+ * Maps a status value to a semantic tone.
355
+ */
356
+ statusTones?: Record<string, string>;
357
+ /**
358
+ * Priority indicator source.
359
+ */
360
+ priority?: KanbanIndicatorSource;
361
+ /**
362
+ * Maps a priority value to a semantic tone.
363
+ */
364
+ priorityTones?: Record<string, string>;
365
+ /**
366
+ * Completion source; a number or `{value,max,label}`.
367
+ */
368
+ progress?: KanbanCardField;
369
+ /**
370
+ * Amount that counts as finished.
371
+ */
372
+ progressMax?: number;
373
+ /**
374
+ * Responsible people; a name, a list, or descriptors.
375
+ */
376
+ assignees?: KanbanCardField;
377
+ /**
378
+ * Faces drawn before the overflow chip.
379
+ */
380
+ maxAvatars?: number;
325
381
  /**
326
382
  * Move the whole selection when a selected card is picked up.
327
383
  */
@@ -380,7 +436,10 @@ export type KanbanViewOptions = {
380
436
  */
381
437
  contextMenu?: boolean | MenuItem[] | ((context: KanbanCardContext) => MenuItem[]);
382
438
  /**
383
- * Replaces card content.
439
+ * Replaces the
440
+ * shared record-card content — eyebrow, titles, and metadata. The preview, selection control,
441
+ * action group, move handle, rule badges, and any configured card head and footer still render,
442
+ * because each of those answers to its own option; clear those options to remove them.
384
443
  */
385
444
  renderCard?: ((context: KanbanCardContext) => Node | null | undefined) | null;
386
445
  /**
@@ -472,6 +531,41 @@ export type KanbanKeyboardMove = {
472
531
  from: KanbanMovePoint;
473
532
  to: KanbanMovePoint;
474
533
  };
534
+ export type KanbanCardReader = ((record: KanbanRecord, index: number) => unknown) | null;
535
+ export type KanbanCardSources = {
536
+ /**
537
+ * Record-key reader.
538
+ */
539
+ identifier: KanbanCardReader;
540
+ /**
541
+ * Status reader.
542
+ */
543
+ status: KanbanCardReader;
544
+ /**
545
+ * Priority reader.
546
+ */
547
+ priority: KanbanCardReader;
548
+ /**
549
+ * Completion reader.
550
+ */
551
+ progress: KanbanCardReader;
552
+ /**
553
+ * Responsible-people reader.
554
+ */
555
+ assignees: KanbanCardReader;
556
+ /**
557
+ * Entity-icon reader.
558
+ */
559
+ entityIcon: KanbanCardReader;
560
+ /**
561
+ * Field ids the anatomy consumes.
562
+ */
563
+ fieldIds: Set<string>;
564
+ /**
565
+ * Whether any source is configured.
566
+ */
567
+ any: boolean;
568
+ };
475
569
  /**
476
570
  * Every user-visible and announced string, so a host can translate the board without patching it.
477
571
  * Values run through `printf`, so named placeholders may be reordered or dropped by a translation.
@@ -497,7 +591,14 @@ declare const DEFAULT_LABELS: Readonly<{
497
591
  countLimit: "%count% records, work-in-progress limit %limit%";
498
592
  countLimitInLane: "%count% records in this lane, %total% of work-in-progress limit %limit% in the column";
499
593
  empty: "No records";
500
- columnEmpty: "";
594
+ columnEmpty: "Drop a card here";
595
+ identifier: "Record";
596
+ priorityLabel: "Priority";
597
+ statusLabel: "Status";
598
+ progress: "Progress";
599
+ progressValue: "%percent%%";
600
+ assignees: "Assigned to %names%";
601
+ assigneeOverflow: "+%count%";
501
602
  selected: "Selected";
502
603
  notSelected: "Not selected";
503
604
  noMatches: "No cards match the current search.";
@@ -526,6 +627,11 @@ declare const DEFAULT_LABELS: Readonly<{
526
627
  dragPreview: "%count% cards";
527
628
  }>;
528
629
  /**
630
+ * A field consumed by the card head or footer — the `identifier`, `status`, `priority`,
631
+ * `progress`, or `assignees` source — is dropped from the shared metadata list so the same value
632
+ * is never shown twice. `field.duplicate === true` opts it back in, extending the rule the shared
633
+ * record card already applies to title and subtitle fields.
634
+ *
529
635
  * Configurable record board with semantic columns, optional swim lanes, and equivalent pointer,
530
636
  * touch, keyboard, context-menu, and programmatic movement. Local moves clone records; callback
531
637
  * grouping remains fully usable for display and external moves but cannot be written safely by
@@ -611,6 +717,15 @@ export declare class KanbanView extends RecordView {
611
717
  _sectionMeta: WeakMap<object, any>;
612
718
  _cardsById: Map<any, any>;
613
719
  _visibleIds: Set<any>;
720
+ _cardSources: KanbanCardSources;
721
+ _fieldIndex: Map<string, any> | Map<string, import("../view/record-view.js").ViewField>;
722
+ _cardFields: {
723
+ all: any[];
724
+ metadata: any[];
725
+ } | {
726
+ all: import("../view/record-view.js").ViewField[];
727
+ metadata: import("../view/record-view.js").ViewField[];
728
+ };
614
729
  _kanbanMenu: ContextMenu;
615
730
  _searchInput: HTMLInputElement;
616
731
  _undoButton: HTMLButtonElement;
@@ -820,6 +935,49 @@ export declare class KanbanView extends RecordView {
820
935
  }[], hasLanes: boolean): HTMLElement;
821
936
  /** @param {KanbanRecord} record @param {number} index @param {string} column @param {string|null} lane @param {boolean} hasLanes @returns {HTMLLIElement} */
822
937
  _renderCard(record: KanbanRecord, index: number, column: string, lane: string | null, hasLanes: boolean): HTMLLIElement;
938
+ /**
939
+ * Builds the two field arrays every card needs, once per refresh.
940
+ * @returns {{all:import('../view/record-view.js').ViewField[],metadata:import('../view/record-view.js').ViewField[]}}
941
+ */
942
+ _resolvedCardFields(): {
943
+ all: import('../view/record-view.js').ViewField[];
944
+ metadata: import('../view/record-view.js').ViewField[];
945
+ };
946
+ /**
947
+ * Returns the fields the shared metadata list may show. A field the card head or footer already
948
+ * projects is dropped, because repeating it as a labelled row is the same value twice; a field
949
+ * marked `duplicate` opts back in, matching how title and subtitle already behave.
950
+ * @returns {import('../view/record-view.js').ViewField[]} Metadata fields.
951
+ */
952
+ _cardMetadataFields(): import('../view/record-view.js').ViewField[];
953
+ /**
954
+ * Resolves the card-anatomy readers once per refresh. A field id would otherwise be looked up
955
+ * through `getFields()` — which clones every descriptor — once per source per card, so a board
956
+ * with six anatomy sources rebuilt the whole field array six times for every card it drew.
957
+ * @returns {void}
958
+ */
959
+ _resolveCardSources(): void;
960
+ /**
961
+ * Adds the two Kanban-owned regions that bracket the shared record-card anatomy: a head naming
962
+ * what the record is and how urgent it is, and a footer carrying completion and the people
963
+ * responsible. Each part is omitted when its option is unset, so a board that configures none of
964
+ * them renders exactly the card it rendered before.
965
+ * @param {HTMLElement} card Card element.
966
+ * @param {KanbanRecord} record Record.
967
+ * @param {number} index Display index.
968
+ * @returns {void}
969
+ */
970
+ _applyCardAnatomy(card: HTMLElement, record: KanbanRecord, index: number): void;
971
+ /**
972
+ * Resolves one indicator from an already-resolved reader. A reader may return a ready-made
973
+ * `Node`, which is adopted rather than described, so an application keeps full control.
974
+ * @param {((record:KanbanRecord,index:number)=>unknown)|null} source Resolved reader.
975
+ * @param {unknown} tones Value-to-tone map.
976
+ * @param {KanbanRecord} record Record.
977
+ * @param {number} index Display index.
978
+ * @returns {KanbanIndicator|Node|null} Indicator, node, or null.
979
+ */
980
+ _cardIndicator(source: ((record: KanbanRecord, index: number) => unknown) | null, tones: unknown, record: KanbanRecord, index: number): KanbanIndicator | Node | null;
823
981
  /**
824
982
  * Hands card content to `renderCard` while keeping the managed shell: the list item, its
825
983
  * selection control, the action group, and the move handle are never given away, because they
@@ -876,6 +1034,14 @@ export declare class KanbanView extends RecordView {
876
1034
  _resolvedSwimlanes(): KanbanSwimlane[];
877
1035
  /** @param {KanbanAccessor} accessor @param {KanbanRecord} record @param {number} index @returns {unknown} */
878
1036
  _readAxis(accessor: KanbanAccessor, record: KanbanRecord, index: number): unknown;
1037
+ /**
1038
+ * Resolves one field descriptor by id through a per-refresh index. `getFields()` rebuilds a Map
1039
+ * and clones every descriptor on each call, and a string column or lane accessor is read once
1040
+ * per record per column per lane — which made this the most expensive line in a board render.
1041
+ * @param {string} id Field id.
1042
+ * @returns {import('../view/record-view.js').ViewField|undefined} Descriptor, if any.
1043
+ */
1044
+ _axisField(id: string): import('../view/record-view.js').ViewField | undefined;
879
1045
  /** @param {string} column @param {string|null} lane @returns {{record:KanbanRecord,index:number}[]} */
880
1046
  _recordsIn(column: string, lane: string | null): {
881
1047
  record: KanbanRecord;
@@ -127,27 +127,27 @@ export type LauncherOptions = {
127
127
  */
128
128
  maxResults?: number;
129
129
  /**
130
- * Search-field placeholder.
130
+ * Search-field placeholder. Omitted resolves `launcher.placeholder`, English `Search applications and records`.
131
131
  */
132
132
  placeholder?: string;
133
133
  /**
134
- * Dialog and field label.
134
+ * Dialog and field label. Omitted resolves `launcher.label`, English `Launcher`.
135
135
  */
136
136
  label?: string;
137
137
  /**
138
- * Close-button accessible label.
138
+ * Close-button accessible label. Omitted resolves `launcher.close`, English `Close launcher`.
139
139
  */
140
140
  closeLabel?: string;
141
141
  /**
142
- * Results-region accessible label.
142
+ * Results-region accessible label. Omitted resolves `launcher.results`, English `Launcher results`.
143
143
  */
144
144
  resultsLabel?: string;
145
145
  /**
146
- * Empty-state text.
146
+ * Empty-state text. Omitted resolves `launcher.empty`, English `No results`.
147
147
  */
148
148
  emptyText?: string;
149
149
  /**
150
- * Loading-state text.
150
+ * Loading-state text. Omitted resolves `launcher.loading`, English `Searching…`.
151
151
  */
152
152
  loadingText?: string;
153
153
  /**
@@ -240,12 +240,12 @@ export type RankedLauncherItem = LauncherItem & {
240
240
  * @property {number} [debounce=250] Source-query delay in milliseconds.
241
241
  * @property {number} [minQuery=0] Global source minimum query length.
242
242
  * @property {number} [maxResults=100] Maximum combined results.
243
- * @property {string} [placeholder='Search applications and records'] Search-field placeholder.
244
- * @property {string} [label='Launcher'] Dialog and field label.
245
- * @property {string} [closeLabel='Close launcher'] Close-button accessible label.
246
- * @property {string} [resultsLabel='Launcher results'] Results-region accessible label.
247
- * @property {string} [emptyText='No results'] Empty-state text.
248
- * @property {string} [loadingText='Searching…'] Loading-state text.
243
+ * @property {string} [placeholder] Search-field placeholder. Omitted resolves `launcher.placeholder`, English `Search applications and records`.
244
+ * @property {string} [label] Dialog and field label. Omitted resolves `launcher.label`, English `Launcher`.
245
+ * @property {string} [closeLabel] Close-button accessible label. Omitted resolves `launcher.close`, English `Close launcher`.
246
+ * @property {string} [resultsLabel] Results-region accessible label. Omitted resolves `launcher.results`, English `Launcher results`.
247
+ * @property {string} [emptyText] Empty-state text. Omitted resolves `launcher.empty`, English `No results`.
248
+ * @property {string} [loadingText] Loading-state text. Omitted resolves `launcher.loading`, English `Searching…`.
249
249
  * @property {'mod+k'|false} [shortcut='mod+k'] Optional global keyboard shortcut.
250
250
  * @property {false|{move?: string, open?: string, close?: string}} [hints] Visible keyboard hints, or false.
251
251
  * @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns an internally created launcher; defaults to the opener.
@@ -341,6 +341,13 @@ export declare class Launcher extends Component<LauncherOptions> {
341
341
  _activate(index: number, event: Event): void;
342
342
  /** @param {KeyboardEvent} event @returns {void} */
343
343
  _onDocumentKeydown(event: KeyboardEvent): void;
344
+ /**
345
+ * Resolves a message through the host translator, falling back to the built-in English text.
346
+ * @param {string} key Message key.
347
+ * @param {string} fallback English default.
348
+ * @returns {string}
349
+ */
350
+ _message(key: string, fallback: string): string;
344
351
  }
345
352
  /**
346
353
  * Ranks launcher items using the current ZeyOS application tiers.