@zeyos/zx 5.7.1 → 5.8.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.
- package/CHANGELOG.md +296 -0
- package/README.md +47 -9
- package/dist/types/components/activity-item/activity-item.d.ts +14 -3
- package/dist/types/components/agent-avatar/agent-avatar.d.ts +165 -0
- package/dist/types/components/agent-avatar/agent-face.d.ts +93 -0
- package/dist/types/components/agent-thread/ag-ui.d.ts +21 -9
- package/dist/types/components/agent-thread/agent-thread.d.ts +26 -0
- package/dist/types/components/agent-thread/ui-message-stream.d.ts +3 -1
- package/dist/types/components/approval-card/approval-card.d.ts +31 -2
- package/dist/types/components/aurora/aurora.d.ts +31 -5
- package/dist/types/components/calendar/calendar.d.ts +39 -26
- package/dist/types/components/chart/chart.d.ts +250 -20
- package/dist/types/components/chart/color.d.ts +66 -0
- package/dist/types/components/chart/svg-adapter.d.ts +103 -0
- package/dist/types/components/chart/svg-geometry.d.ts +203 -0
- package/dist/types/components/check-button/check-button.d.ts +1 -4
- package/dist/types/components/checklist/checklist.d.ts +19 -5
- package/dist/types/components/code-editor/code-editor.d.ts +55 -1
- package/dist/types/components/composer/composer.d.ts +41 -6
- package/dist/types/components/context-menu/context-menu.d.ts +36 -8
- package/dist/types/components/copy/copy-button.d.ts +6 -0
- package/dist/types/components/copy/copy-input.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +14 -0
- package/dist/types/components/date-picker/time-picker.d.ts +26 -17
- package/dist/types/components/datebox/datebox.d.ts +8 -4
- package/dist/types/components/dialog/dialog.d.ts +13 -2
- package/dist/types/components/empty-state/empty-state.d.ts +10 -1
- package/dist/types/components/field/field.d.ts +4 -2
- package/dist/types/components/form/form.d.ts +2 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +7 -0
- package/dist/types/components/kanban-view/kanban-view.d.ts +15 -3
- package/dist/types/components/launcher/launcher.d.ts +26 -0
- package/dist/types/components/master-panel/master-panel.d.ts +9 -4
- package/dist/types/components/menu-button/menu-button.d.ts +29 -5
- package/dist/types/components/message/message.d.ts +308 -5
- package/dist/types/components/modal/modal.d.ts +11 -0
- package/dist/types/components/modal/native-dialog.d.ts +40 -0
- package/dist/types/components/module-bar/module-bar.d.ts +9 -2
- package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +5 -4
- package/dist/types/components/number-field/number-field.d.ts +7 -0
- package/dist/types/components/pagination/pagination.d.ts +341 -19
- package/dist/types/components/run-status/run-status.d.ts +26 -0
- package/dist/types/components/run-trace/run-trace.d.ts +10 -6
- package/dist/types/components/search/search.d.ts +16 -4
- package/dist/types/components/select/select.d.ts +19 -1
- package/dist/types/components/sheet/sheet.d.ts +18 -4
- package/dist/types/components/slider/slider.d.ts +2 -1
- package/dist/types/components/stat-tile/stat-tile.d.ts +20 -3
- package/dist/types/components/stepper/stepper.d.ts +17 -4
- package/dist/types/components/surface/catalog.d.ts +61 -17
- package/dist/types/components/surface/surface.d.ts +6 -4
- package/dist/types/components/table/table.d.ts +207 -5
- package/dist/types/components/table/window.d.ts +25 -1
- package/dist/types/components/toggle/toggle.d.ts +38 -6
- package/dist/types/components/tooltip/tooltip.d.ts +5 -4
- package/dist/types/components/tree/tree.d.ts +43 -6
- package/dist/types/components/truncate/truncate.d.ts +4 -2
- package/dist/types/components/value-list/value-list.d.ts +9 -2
- package/dist/types/core/date.d.ts +2 -1
- package/dist/types/core/drag-axis.d.ts +10 -5
- package/dist/types/core/export.d.ts +2 -2
- package/dist/types/core/format.d.ts +3 -1
- package/dist/types/core/icons.d.ts +36 -3
- package/dist/types/core/keyboard.d.ts +7 -3
- package/dist/types/core/messages.d.ts +3 -0
- package/dist/types/core/storage.d.ts +4 -3
- package/dist/types/core/util.d.ts +3 -1
- package/dist/types/elements/define.d.ts +5 -2
- package/dist/types/index.d.ts +6 -4
- package/dist/types/internal/agent-model.d.ts +99 -0
- package/dist/types/internal/app-rail.d.ts +37 -2
- package/dist/types/internal/collections.d.ts +18 -0
- package/dist/types/internal/menu-items.d.ts +27 -0
- package/dist/types/internal/overlay-content.d.ts +23 -0
- package/dist/types/internal/presence-loop.d.ts +5 -2
- package/dist/types/locales/index.d.ts +3 -0
- package/dist/types/zeyos/calendar.d.ts +43 -7
- package/dist/types/zeyos/connect.d.ts +4 -0
- package/dist/types/zeyos/form.d.ts +13 -5
- package/dist/types/zeyos/select.d.ts +5 -2
- package/dist/types/zeyos/table.d.ts +16 -8
- package/dist/types/zeyos/view.d.ts +2 -1
- package/dist/zx-zeyos.esm.js +2998 -451
- package/dist/zx-zeyos.esm.min.js +4 -4
- package/dist/zx.core.css +4 -0
- package/dist/zx.core.min.css +1 -1
- package/dist/zx.css +948 -48
- package/dist/zx.esm.js +7432 -3408
- package/dist/zx.esm.min.js +26 -26
- package/dist/zx.global.js +7432 -3408
- package/dist/zx.global.min.js +26 -26
- package/dist/zx.layered.css +950 -48
- package/dist/zx.layered.min.css +1 -1
- package/dist/zx.min.css +1 -1
- package/docs/agent-catalog.json +159 -1
- package/docs/agent-surfaces.md +21 -21
- package/docs/api.json +3122 -528
- package/docs/components/account-menu.md +24 -0
- package/docs/components/activity-item.md +23 -0
- package/docs/components/activity-list.md +28 -0
- package/docs/components/agent-avatar.md +59 -0
- package/docs/components/agent-thread.md +275 -0
- package/docs/components/app-icon.md +36 -0
- package/docs/components/app-sidebar.md +92 -0
- package/docs/components/approval-card.md +71 -0
- package/docs/components/aurora.md +34 -0
- package/docs/components/avatar.md +37 -0
- package/docs/components/badge.md +36 -0
- package/docs/components/block-view.md +34 -0
- package/docs/components/breadcrumb.md +20 -0
- package/docs/components/button.md +23 -0
- package/docs/components/calendar.md +68 -0
- package/docs/components/card-view.md +73 -0
- package/docs/components/card.md +25 -0
- package/docs/components/chart.md +109 -0
- package/docs/components/check-button.md +16 -0
- package/docs/components/checklist.md +19 -0
- package/docs/components/code-editor.md +38 -0
- package/docs/components/composer.md +107 -0
- package/docs/components/context-menu.md +32 -0
- package/docs/components/copy.md +37 -0
- package/docs/components/data-filter.md +16 -0
- package/docs/components/date-picker.md +31 -0
- package/docs/components/date-range.md +21 -0
- package/docs/components/datebox.md +31 -0
- package/docs/components/dialog.md +25 -0
- package/docs/components/dock.md +57 -0
- package/docs/components/dropdown.md +39 -0
- package/docs/components/elements.md +63 -0
- package/docs/components/empty-state.md +17 -0
- package/docs/components/entity-ref.md +26 -0
- package/docs/components/field-upload.md +18 -0
- package/docs/components/file-item.md +27 -0
- package/docs/components/file-list.md +23 -0
- package/docs/components/filter-panel.md +45 -0
- package/docs/components/filter.md +47 -0
- package/docs/components/finder.md +25 -0
- package/docs/components/form-widgets.md +42 -0
- package/docs/components/form.md +80 -0
- package/docs/components/grid.md +26 -0
- package/docs/components/groupbox.md +11 -0
- package/docs/components/helpers.md +359 -0
- package/docs/components/icons.md +87 -0
- package/docs/components/index.md +99 -0
- package/docs/components/kanban-view.md +42 -0
- package/docs/components/kbd.md +23 -0
- package/docs/components/kernel.md +41 -0
- package/docs/components/launcher.md +66 -0
- package/docs/components/layout.md +33 -0
- package/docs/components/list-toolbar.md +38 -0
- package/docs/components/loading.md +48 -0
- package/docs/components/menu-button.md +47 -0
- package/docs/components/message.md +76 -0
- package/docs/components/modal.md +27 -0
- package/docs/components/module-bar.md +71 -0
- package/docs/components/multi-value-editor.md +16 -0
- package/docs/components/navigation-bar.md +22 -0
- package/docs/components/number-field.md +34 -0
- package/docs/components/pagination.md +73 -0
- package/docs/components/panel.md +28 -0
- package/docs/components/prompt-starters.md +40 -0
- package/docs/components/prose.md +38 -0
- package/docs/components/questionnaire.md +115 -0
- package/docs/components/rating.md +19 -0
- package/docs/components/run-status.md +50 -0
- package/docs/components/run-trace.md +72 -0
- package/docs/components/search.md +11 -0
- package/docs/components/select.md +129 -0
- package/docs/components/sheet-stack.md +39 -0
- package/docs/components/sheet.md +77 -0
- package/docs/components/skeleton.md +27 -0
- package/docs/components/slider.md +29 -0
- package/docs/components/sort-control.md +21 -0
- package/docs/components/source-list.md +30 -0
- package/docs/components/split-view.md +12 -0
- package/docs/components/stat-tile.md +49 -0
- package/docs/components/stepper.md +27 -0
- package/docs/components/surface.md +152 -0
- package/docs/components/tabbox.md +33 -0
- package/docs/components/table-view.md +43 -0
- package/docs/components/table.md +232 -0
- package/docs/components/tag-picker.md +39 -0
- package/docs/components/timebox.md +16 -0
- package/docs/components/toggle.md +21 -0
- package/docs/components/tokens.md +82 -0
- package/docs/components/toolbar.md +26 -0
- package/docs/components/tooltip.md +16 -0
- package/docs/components/tree.md +48 -0
- package/docs/components/truncate.md +21 -0
- package/docs/components/value-list.md +14 -0
- package/docs/components/view-settings.md +56 -0
- package/docs/components/workspace-switcher.md +42 -0
- package/docs/components/zeyos.md +196 -0
- package/docs/llms-small.txt +299 -0
- package/docs/llms.md +697 -100
- package/docs/llms.txt +46 -19
- package/package.json +9 -4
- package/src/components/activity-item/activity-item.js +21 -2
- package/src/components/agent-avatar/agent-avatar.css +195 -0
- package/src/components/agent-avatar/agent-avatar.js +333 -0
- package/src/components/agent-avatar/agent-face.js +292 -0
- package/src/components/agent-thread/ag-ui.js +44 -11
- package/src/components/agent-thread/agent-thread.js +103 -11
- package/src/components/agent-thread/ui-message-stream.js +3 -1
- package/src/components/app-rail/app-rail.css +5 -0
- package/src/components/app-sidebar/app-sidebar.css +3 -0
- package/src/components/app-sidebar/app-sidebar.js +4 -3
- package/src/components/approval-card/approval-card.css +6 -0
- package/src/components/approval-card/approval-card.js +55 -7
- package/src/components/aurora/aurora.css +149 -14
- package/src/components/aurora/aurora.js +49 -6
- package/src/components/calendar/calendar.css +6 -2
- package/src/components/calendar/calendar.js +127 -47
- package/src/components/card-view/card-view.js +5 -6
- package/src/components/chart/chart.css +159 -1
- package/src/components/chart/chart.js +450 -62
- package/src/components/chart/color.js +297 -0
- package/src/components/chart/svg-adapter.js +576 -0
- package/src/components/chart/svg-geometry.js +323 -0
- package/src/components/check-button/check-button.js +3 -18
- package/src/components/checklist/checklist.js +46 -17
- package/src/components/checklist/field-adapter.js +4 -1
- package/src/components/code-editor/code-editor.css +33 -0
- package/src/components/code-editor/code-editor.js +97 -8
- package/src/components/code-editor/field-adapter.js +3 -0
- package/src/components/composer/composer.css +3 -0
- package/src/components/composer/composer.js +100 -22
- package/src/components/context-menu/context-menu.js +41 -5
- package/src/components/copy/copy-button.js +9 -1
- package/src/components/copy/copy-input.js +5 -0
- package/src/components/data-filter/filter-core.js +0 -1
- package/src/components/date-picker/date-picker.css +8 -0
- package/src/components/date-picker/date-picker.js +47 -8
- package/src/components/date-picker/date-range-picker.js +1 -1
- package/src/components/date-picker/month-picker.js +19 -3
- package/src/components/date-picker/time-picker.js +54 -19
- package/src/components/datebox/date-range-box.js +7 -3
- package/src/components/datebox/datebox.js +32 -6
- package/src/components/dialog/dialog.css +6 -0
- package/src/components/dialog/dialog.js +22 -30
- package/src/components/dropdown/dropdown.js +1 -18
- package/src/components/empty-state/empty-state.js +21 -2
- package/src/components/field/field.js +19 -3
- package/src/components/fieldset/fieldset.js +3 -1
- package/src/components/filter/filter.js +9 -0
- package/src/components/form/form.js +19 -2
- package/src/components/kanban-view/kanban-card.js +15 -2
- package/src/components/kanban-view/kanban-view.css +21 -0
- package/src/components/kanban-view/kanban-view.js +29 -16
- package/src/components/launcher/launcher.css +14 -0
- package/src/components/launcher/launcher.js +54 -9
- package/src/components/master-panel/master-panel.js +24 -22
- package/src/components/menu-button/menu-button.js +26 -4
- package/src/components/message/message.css +228 -29
- package/src/components/message/message.js +664 -30
- package/src/components/modal/modal.js +70 -25
- package/src/components/modal/native-dialog.js +91 -0
- package/src/components/module-bar/module-bar.css +3 -0
- package/src/components/module-bar/module-bar.js +17 -4
- package/src/components/multi-value-editor/multi-value-editor.css +7 -2
- package/src/components/multi-value-editor/multi-value-editor.js +3 -2
- package/src/components/navigation-bar/navigation-bar.js +13 -1
- package/src/components/number-field/field-adapter.js +3 -0
- package/src/components/number-field/number-field.js +2 -1
- package/src/components/pagination/pagination.css +26 -2
- package/src/components/pagination/pagination.js +551 -65
- package/src/components/prose/prose.js +7 -1
- package/src/components/rating/field-adapter.js +3 -0
- package/src/components/run-status/run-status.js +43 -3
- package/src/components/run-trace/run-trace.js +15 -7
- package/src/components/search/search.js +3 -18
- package/src/components/select/field-adapter.js +8 -1
- package/src/components/select/select.js +68 -13
- package/src/components/sheet/sheet.js +27 -8
- package/src/components/slider/field-adapter.js +3 -0
- package/src/components/slider/slider.js +4 -6
- package/src/components/stat-tile/stat-tile.js +24 -9
- package/src/components/stepper/stepper.css +15 -0
- package/src/components/stepper/stepper.js +34 -2
- package/src/components/surface/catalog.js +185 -28
- package/src/components/surface/surface.js +10 -5
- package/src/components/tabbox/tabbox.js +13 -1
- package/src/components/table/table.css +160 -2
- package/src/components/table/table.js +479 -52
- package/src/components/table/window.js +46 -4
- package/src/components/table-view/table-view.js +1 -10
- package/src/components/tag-picker/field-adapter.js +3 -0
- package/src/components/tag-picker/tag-picker.js +2 -0
- package/src/components/timebox/field-adapter.js +3 -0
- package/src/components/toggle/toggle.js +51 -27
- package/src/components/tooltip/tooltip.js +21 -14
- package/src/components/tree/tree.js +87 -14
- package/src/components/truncate/truncate.js +21 -5
- package/src/components/value-list/value-list.js +37 -9
- package/src/components/view-settings/view-settings.js +1 -5
- package/src/core/component.js +34 -2
- package/src/core/date.js +5 -4
- package/src/core/drag-axis.js +24 -7
- package/src/core/export.js +4 -4
- package/src/core/fontawesome.js +34 -3
- package/src/core/format.js +3 -1
- package/src/core/http.js +23 -11
- package/src/core/icons.js +51 -10
- package/src/core/keyboard.js +83 -9
- package/src/core/messages.js +3 -0
- package/src/core/position.js +2 -2
- package/src/core/storage.js +80 -31
- package/src/core/util.js +16 -5
- package/src/elements/define.js +82 -47
- package/src/elements/kit.js +46 -35
- package/src/index.js +8 -4
- package/src/internal/agent-model.js +152 -0
- package/src/internal/app-rail.js +53 -2
- package/src/internal/collections.js +25 -0
- package/src/internal/menu-items.js +59 -0
- package/src/internal/overlay-content.js +35 -0
- package/src/internal/presence-loop.js +61 -14
- package/src/locales/de.js +3 -0
- package/src/zeyos/calendar.js +81 -19
- package/src/zeyos/connect.js +5 -1
- package/src/zeyos/form.js +29 -10
- package/src/zeyos/select.js +36 -12
- package/src/zeyos/table.js +43 -11
- package/src/zeyos/view.js +2 -1
- package/styles/tokens/semantic.css +7 -1
- package/styles/zx.css +1 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Composer — the message box of an agent conversation
|
|
2
|
+
|
|
3
|
+
The message box of an agent conversation: a growing text with Send and Stop, attachments, @-mentions, / commands, context chips, and queued messages.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/composer · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
A text that grows with what is written, Send (Stop while the agent works), attachments, `@`
|
|
8
|
+
mentions, `/` commands, extra tools, removable context chips, and a queue for messages written while
|
|
9
|
+
the agent works. It keeps only unsent messages: `send` hands the text, files, mentions and context to
|
|
10
|
+
the application, which owns the conversation and the transport.
|
|
11
|
+
|
|
12
|
+
- **Constructor** — `new Composer(null, options)` creates its own root; `new Composer(element,
|
|
13
|
+
options)` takes over an element and restores it on `destroy()`.
|
|
14
|
+
- **Options** — `label` (accessible name of the text and of the `role="group"` root, English
|
|
15
|
+
`Message`), `placeholder`, `value`, `submitKey: 'enter'|'mod+enter'`, `busy: false`,
|
|
16
|
+
`queue: false`, `queueLimit: 10` (see Queue),
|
|
17
|
+
`disabled: false`, `attachments: false`, `accept: ''` (the `<input type="file">` syntax),
|
|
18
|
+
`maxFiles: 10`, `mentions: null|{trigger: '@', items}` where `items` is `[{id, label,
|
|
19
|
+
description?, icon?, agent?}]` (`agent`: AgentAvatar options or `true` draws the item as its still
|
|
20
|
+
face instead of the icon, with an activity's word in the option's name) or `(query) => items | Promise<items>`, `commands: null|LauncherItem[]`,
|
|
21
|
+
`tools: []` (`[{id, label, icon, pressed?, expanded?, controls?, disabled?}]` — `pressed` makes a
|
|
22
|
+
toggle, `expanded`/`controls` a disclosure; see Tools), `icons: {}` (`attach`, `commands` glyphs),
|
|
23
|
+
`context: [{id, label,
|
|
24
|
+
icon?, ref?}]`, `hint` (quiet text beside Send), `note` (a quiet line under the composer, also
|
|
25
|
+
its description), `sendLabel: null` (visible text on Send, see Send), `draftKey: null`,
|
|
26
|
+
`minRows: 1` (the text never shrinks below it, even empty; capped at `maxRows`), `maxRows: 10`
|
|
27
|
+
(it scrolls beyond), `msg`.
|
|
28
|
+
- **Methods** — `focus()`, `getValue()`, `setValue(text)`, `insertText(text)` (types at the caret
|
|
29
|
+
as the person would — text ending in `@` opens the suggestions), `clear()` (text, files and draft;
|
|
30
|
+
context stays), `setBusy(busy)`, `isBusy()`, `setDisabled(disabled)`, `setHint(text)`,
|
|
31
|
+
`setNote(text)` (an empty text hides either), `update(partial)`, `setTools(tools)`,
|
|
32
|
+
`setToolPressed(id, pressed)`, `addFiles(files)`, `getFiles()`, `addContext(chip)` (replaces a
|
|
33
|
+
chip with the same id), `removeContext(id)`, `getContext()`, `getQueue()`, `clearQueue()`,
|
|
34
|
+
`removeQueued(id)`, `destroy()`. The setters emit nothing, except that `setBusy(false)` sends the
|
|
35
|
+
next queued message; `clearQueue()` and `removeQueued(id)` emit `dequeue`.
|
|
36
|
+
- **update(partial)** — changes `label`, `placeholder`, `hint`, `note`, `submitKey`, `sendLabel`,
|
|
37
|
+
`disabled` and `busy` in place; a key left out or `undefined` is kept, other keys are ignored.
|
|
38
|
+
The text, its caret and selection, the focus, the attachments, the context chips and the draft
|
|
39
|
+
all stay, so a placeholder that names the chosen model follows the model picker without
|
|
40
|
+
recreating the composer: `composer.update({placeholder: 'Message Halden 3 Deep'})`.
|
|
41
|
+
`label: null` returns to `composer.label`; an empty `placeholder` removes it.
|
|
42
|
+
- **Events** — `send {text, files, mentions, context}` is preventable: unless prevented, the text,
|
|
43
|
+
files and draft clear; it never fires with an empty text and no files, nor while busy. `text` is
|
|
44
|
+
trimmed; `mentions` are the picked items whose `@<label>` is still in the text. A message from the
|
|
45
|
+
queue also carries `queued: true`. `queue {item, items}`, `dequeue {item, items, reason:
|
|
46
|
+
'sent'|'removed'|'edited'|'cleared'}`; `items` is the queue as it then stands. `stop`,
|
|
47
|
+
`input {text}`, `attach {files}` (preventable, before the files are added), `remove {kind:
|
|
48
|
+
'file'|'context', id, file?, chip?}` (after the reader removes one), `mention {item}`,
|
|
49
|
+
`command {item}` (the application's own item), `tool {id, tool}` (a copy of the tool as it
|
|
50
|
+
stands, `pressed` included), `historyprevious`.
|
|
51
|
+
- **Keyboard** — `submitKey: 'enter'`: Enter sends, Shift+Enter breaks the line;
|
|
52
|
+
`'mod+enter'`: Cmd+Enter (Ctrl+Enter elsewhere) sends, Enter breaks the line. A key during an IME
|
|
53
|
+
composition never sends. Escape closes the suggestions, otherwise emits `stop` while busy (and is
|
|
54
|
+
left alone when idle, so a surrounding dialog can close). ArrowUp on an empty text emits
|
|
55
|
+
`historyprevious`; `/` on an empty text opens the commands. In the suggestions, Up and Down move,
|
|
56
|
+
Enter or Tab picks, Escape closes. Tools are ordinary buttons in the tab order (Enter or Space).
|
|
57
|
+
With `queue`, the send key queues while busy. Tab reaches each queued row, a toolbar of Edit and
|
|
58
|
+
Remove: Left and Right move between them, Home and End go to the first and last, and Delete on
|
|
59
|
+
either removes the row. No key is bound on the document.
|
|
60
|
+
- **Tools** — icon buttons in the bar after Attach and Commands, each named by its `label` (also
|
|
61
|
+
its `title` tooltip). A boolean `pressed` makes a toggle with `aria-pressed`, drawn with the
|
|
62
|
+
neutral current fill and an edge; without it the tool is a plain button. Pressing one emits
|
|
63
|
+
`tool`; the composer never changes `pressed` itself — call `setToolPressed(id, !tool.pressed)`.
|
|
64
|
+
`setTools(tools)` redraws them, keeping the focus on the tool with the same id (on the text when
|
|
65
|
+
that tool is gone or disabled). An entry without `id`, `label` or `icon` is left out, as is a
|
|
66
|
+
repeated id; other fields on a tool are handed back in `tool`. `icon` is a built-in glyph name or
|
|
67
|
+
one the application registered with `registerIcons()`. Tools are disabled with the composer.
|
|
68
|
+
- **Send** — one button that swaps its glyph, name and `aria-keyshortcuts` between Send and Stop.
|
|
69
|
+
With `sendLabel` (`'Start task'`) it shows the glyph and that text, which is also its accessible
|
|
70
|
+
name; while busy it reads `composer.stop` ("Stop"). In a composer narrower than 24rem (a phone, a
|
|
71
|
+
side column) the text is visually hidden and Send is the square glyph again — the text stays its
|
|
72
|
+
accessible name and its tooltip.
|
|
73
|
+
- **Queue** — with `queue: true`, the send key while busy adds the message to the queue and clears
|
|
74
|
+
the composer; the button stays Stop and Escape still stops the run. A queued message keeps the
|
|
75
|
+
text, files, mentions and context chips it had when it was queued. The queue shows at the top of
|
|
76
|
+
the box as a list labelled "Queued (2)", each row with its text on one line, Edit and Remove, and a
|
|
77
|
+
polite status says "Queued; sends when the agent finishes" once per message. When `setBusy(false)`
|
|
78
|
+
ends busy, the first message is sent as a normal `send`, and the next waits for the next time busy
|
|
79
|
+
ends. Nothing is sent while the composer is disabled, and what is being written stays in the text.
|
|
80
|
+
A prevented `send` keeps the message first in line. Edit takes the text, files and mentions back
|
|
81
|
+
into the composer, removes the row and emits `input`; when something is already written or
|
|
82
|
+
attached it asks first through `Dialog.confirm`. At `queueLimit` the send key is refused, the
|
|
83
|
+
message stays where it is, and the hint says why until there is room. Stop keeps the queue, so the
|
|
84
|
+
next message goes when the application ends busy: call `clearQueue()` in the `stop` listener to
|
|
85
|
+
drop it with the run. The queue is session state: it is not kept with the draft, and `destroy()`
|
|
86
|
+
drops it. Only a sent message belongs in the conversation, so queued messages are not thread items.
|
|
87
|
+
- **Mentions** — the query is the text after the trigger up to the caret, with no whitespace;
|
|
88
|
+
picking writes `@<label> `. An array is filtered by label prefix, word prefix, label substring,
|
|
89
|
+
then id prefix or a word of the description, ignoring case and accents. A function answers the
|
|
90
|
+
query itself; a stale Promise is ignored.
|
|
91
|
+
- **Commands** — opened in a `Launcher` the composer creates on first use and destroys with
|
|
92
|
+
itself; an item with `items` opens a page. The commands keep the order given. A Commands button
|
|
93
|
+
in the bar opens the same list for pointer and touch.
|
|
94
|
+
- **Files** — the Attach button, pasting files, and dropping files on the composer (the root shows
|
|
95
|
+
`data-state="dropping"` and a drop label meanwhile) add attachments, filtered by `accept` and
|
|
96
|
+
capped by `maxFiles`.
|
|
97
|
+
- **Accessibility** — the `<textarea>` keeps its textbox role. While suggestions show it carries
|
|
98
|
+
`aria-autocomplete="list"`, `aria-controls` (the listbox) and `aria-activedescendant` (the
|
|
99
|
+
highlighted `role="option"`), and a polite status says how many there are. Attachments and
|
|
100
|
+
context chips are labelled lists, each chip with a button named "Remove <name>". Send is never
|
|
101
|
+
disabled while the composer is live (it is `aria-disabled` when there is nothing to send), so
|
|
102
|
+
the focus it holds survives a run ending. A toggled tool states itself with `aria-pressed`, not
|
|
103
|
+
colour alone. The queue is a labelled ordered list; each row's toolbar is named by its text, and
|
|
104
|
+
when a message leaves the queue the focus stays on the row, on the row now in its place, or in the
|
|
105
|
+
text.
|
|
106
|
+
- **Draft** — with `draftKey`, the unsent text is kept through `storage('composer')`, restored
|
|
107
|
+
when the composer is created without a `value`, and cleared on send and `clear()`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ContextMenu
|
|
2
|
+
|
|
3
|
+
Right-click menu for a region or a row.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/context-menu · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Right-click menu for a region or a row, implementing the APG menu pattern. Attaches to an existing
|
|
8
|
+
element and never changes it: the menu lives in the top layer, anchored to a zero-sized element
|
|
9
|
+
parked at the pointer, so it flips near a viewport edge like every other floating panel.
|
|
10
|
+
|
|
11
|
+
- **Constructor** — `new ContextMenu(target, options)` where `target` is an element or selector.
|
|
12
|
+
Unlike most components the target is not enhanced or replaced; `destroy()` removes only the
|
|
13
|
+
anchor the menu created.
|
|
14
|
+
- **Options** — `items: []` uses the same headings, separators, links, descriptions, trailing
|
|
15
|
+
metadata, checked roles, and ordinary action shape MenuButton takes, **or a function**
|
|
16
|
+
`(context) => items` called on
|
|
17
|
+
every opening so a row menu can disable the actions that row does not allow; returning an empty
|
|
18
|
+
array cancels the opening and leaves the platform menu alone. `selector: null` restricts the
|
|
19
|
+
menu to matching descendants and reports the matched element as the context — a table passes
|
|
20
|
+
`'tbody tr'` here and needs one instance, not one per row.
|
|
21
|
+
- **Methods** — `setItems(items)`, `openAt(x, y, context?)` (viewport coordinates),
|
|
22
|
+
`openAtElement(element)`, `close()`, `isOpen()`, `getContext()`.
|
|
23
|
+
- **Events** — `select {value, item, context}`, `open {context}`, `close`. Subscribe with
|
|
24
|
+
`menu.on('select', …)` or the `onselect` option: the component's root is the anchor on
|
|
25
|
+
`<body>`, so the bubbling `zx-select` DOM event is dispatched there and not through the
|
|
26
|
+
region the menu belongs to — delegation on the target will not see it.
|
|
27
|
+
- **Keyboard** — the Menu key and Shift+F10 open the menu at the focused element, which is the
|
|
28
|
+
half most pointer-only context menus miss. Arrows move between items, typing jumps to one by its
|
|
29
|
+
first letters, Enter and Space activate, Escape and Tab close — and closing returns focus to
|
|
30
|
+
wherever it came from.
|
|
31
|
+
- **Cancellation** — `select` is cancelable just like MenuButton. Preventing it suppresses the
|
|
32
|
+
item callback and native navigation and leaves the context menu open.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# copyButton() / CopyInput
|
|
2
|
+
|
|
3
|
+
Copying a value, and saying so.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/copy · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Copying a value, and saying so. A clipboard write is silent, so both of these confirm it in place
|
|
8
|
+
— and stay quiet when the browser refuses. Both go through `copyToClipboard()`, which falls back
|
|
9
|
+
to a hidden textarea when the async Clipboard API is unavailable or denied.
|
|
10
|
+
|
|
11
|
+
## copyButton()
|
|
12
|
+
|
|
13
|
+
- **Signature** — `copyButton({text, label, title, feedback, feedbackDuration, size, kind, oncopy, signal})`
|
|
14
|
+
→ `HTMLButtonElement`.
|
|
15
|
+
- **Options** — `text: ''` — a string, or **a function returning one**, which is what a button
|
|
16
|
+
beside a live value needs so the copy is never stale; `label: ''` (empty renders an icon-only
|
|
17
|
+
ghost button), `title`, `feedback` (by default the `copy.copy` and `copy.copied` messages, and `null` gives no text), `feedbackDuration: 2000`,
|
|
18
|
+
`size: 'md'|'sm'`, `kind: 'default'|'primary'|'ghost'`, `signal` (an `AbortSignal`: aborting
|
|
19
|
+
removes the button's listener and timer, and a copy still waiting on the clipboard then reports
|
|
20
|
+
nothing — what a component owning the button passes from its own lifecycle).
|
|
21
|
+
- **Events** — `oncopy(text, copied)` is called for every attempt; `copied` is `false` when the
|
|
22
|
+
clipboard refused the write, and the button then stays untouched rather than claiming a copy
|
|
23
|
+
that did not happen.
|
|
24
|
+
- **Accessibility** — on success the glyph becomes a tick and a visually hidden `role="status"`
|
|
25
|
+
speaks the confirmation, then both revert. The icon-only form carries the `title` as its
|
|
26
|
+
accessible name. The status line is positioned inside the button, so it never adds scrollable
|
|
27
|
+
overflow to the page or to a scrolling pane.
|
|
28
|
+
|
|
29
|
+
## CopyInput
|
|
30
|
+
|
|
31
|
+
- **Options** — `value: ''`, `label: ''`, `hideLabel: false`, `feedback`, `buttonTitle` (by default
|
|
32
|
+
the `copy.copied` and `copy.copy` messages, and `null` gives no text), `size: 'md'|'sm'`.
|
|
33
|
+
- **Methods** — `get()`, `set(value)`, `focus()` (focuses and selects the whole value).
|
|
34
|
+
- **Events** — `copy {value, copied}`.
|
|
35
|
+
- **Behaviour** — the field is `readonly`, not `disabled`, so the text stays selectable and
|
|
36
|
+
reachable by keyboard; focusing it selects the whole value, which is what someone reaching for
|
|
37
|
+
Ctrl+C expects.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# DataFilter
|
|
2
|
+
|
|
3
|
+
The filter bar above a list: typed filter descriptors in, the matching rows out.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/data-filter · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Declarative client-side filter bar producing a filtered array, commonly wired to a Table with
|
|
8
|
+
`onfilter: (e) => table.setData(e.detail.rows)`.
|
|
9
|
+
|
|
10
|
+
- **Options** — `filters: [{ type: 'select'|'text'|'custom', id, label, field(s)|get, options?,
|
|
11
|
+
predicate?, emptyLabel?, placeholder? }]`, `data`, `autoApply: true`, `clearLabel`.
|
|
12
|
+
- **Messages** — `dataFilter.clear` ("Clear", unless `clearLabel` is given) and `dataFilter.all`
|
|
13
|
+
("All", a select filter's empty option unless it sets `emptyLabel`).
|
|
14
|
+
- **Methods** — `setData()`, `apply()` → rows, `clear()`, `getState()`, `setState()`,
|
|
15
|
+
`addFilter()`.
|
|
16
|
+
- **Events** — `filter {rows, state}`.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# DatePicker / MonthPicker / TimePicker
|
|
2
|
+
|
|
3
|
+
Three inline pickers — a calendar, a month grid, and a time control — each a roving grid with one tab stop.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/date-picker · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Inline, embeddable pickers.
|
|
8
|
+
|
|
9
|
+
## DatePicker — APG date grid
|
|
10
|
+
|
|
11
|
+
- **Options** — `value: Date|null`, `min`, `max`, `weekStart: 1`, `showWeekNumbers: false`,
|
|
12
|
+
`time: false`.
|
|
13
|
+
- **Methods** — `get()`, `set()`, `focus()`.
|
|
14
|
+
- **Events** — `change {date}`, `monthchange {year, month}`.
|
|
15
|
+
- **Keyboard** — arrows move a day, PageUp/PageDown a month, Shift+PageUp/PageDown a year,
|
|
16
|
+
Home/End, Enter/Space select. Day cells carry an `aria-label`.
|
|
17
|
+
|
|
18
|
+
## MonthPicker
|
|
19
|
+
|
|
20
|
+
A 12-month grid. `get()`/`set()` work on the first of the month; event `change {date}`.
|
|
21
|
+
|
|
22
|
+
## TimePicker
|
|
23
|
+
|
|
24
|
+
Two spinbuttons (three with `seconds`), plus an optional clock face behind a toggle button: pick an
|
|
25
|
+
hour on the outer (1–12) or inner (13–23, 00) ring and the dial moves on to the minutes. Every mark
|
|
26
|
+
is a radio in an APG radio group; the spinbuttons stay the primary control.
|
|
27
|
+
|
|
28
|
+
- **Options** — `value: null`, `seconds: false`, `step: 5` (minute increment for the arrow keys),
|
|
29
|
+
`clock: true`.
|
|
30
|
+
- **Methods** — `get()`, `set()`, `openClock(unit)`, `closeClock()`, `toggleClock()`.
|
|
31
|
+
- **Events** — `change {time}`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# DateRangePicker / DateRangeBox
|
|
2
|
+
|
|
3
|
+
Two calendars driven as one roving-focus grid: the first click opens a range, hovering or arrowing previews where it would end, and the second click closes it.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/date-range · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
An inline two-month calendar for picking a start and an end day, plus the form-usable text input that wraps it. The first click opens a range and the second closes it; while an end is pending, hovering and arrow-key focus preview where the range would land, and clicking on or before the pending start restarts it there instead of producing an inverted range. Both grids behave as one roving-focus unit, so arrowing right off 31 August continues on 1 September. Range maths is exported separately as `normalizeRange`, `rangeNights`, `rangeStateOf`, and `clampRange`, so the rules can be reused and tested without a DOM.
|
|
8
|
+
|
|
9
|
+
## DateRangePicker
|
|
10
|
+
|
|
11
|
+
- **Options** — `start: null`, `end: null` (Dates), `min: null`, `max: null`, `months: 2` (a container query drops to one month in narrow hosts), `weekStart: 1`, `showWeekNumbers: false`, `minNights: 0`, `maxNights: null`, `presets: []` (an array of `{name, label, range: () => ({start, end})}`, or `true` for the built-in Today, Yesterday, Last 7 days, Last 30 days, This month, Last month, This quarter, This year), `disabled: false`.
|
|
12
|
+
- **Methods** — `get()` → `{start, end}` copies, `set({start, end}, {silent})` (clamped to the bounds, scrolls the first month to the start), `clear({silent})`, `focus()`, `enable()`, `disable()`, `destroy()`.
|
|
13
|
+
- **Events** — `change {start, end}` once a range is complete and on clear, `select {start, end}` on every click including the half-open state where `end` is still null, `monthchange {year, month}` when the first visible month moves.
|
|
14
|
+
- **Keyboard** — arrows move a day, PageUp/PageDown a month, Shift+PageUp/PageDown a year, Home/End the ends of the week, Enter or Space selects, Escape abandons a half-picked range and restores the last complete one. Days outside `min`/`max` — and, once a start is pending, days that would break `minNights`/`maxNights` — stay keyboard-focusable but carry `aria-disabled="true"`. Committed days carry `data-range="start" | "middle" | "end"` and previewed days `data-range="preview"`; the picker is a `role="group"` holding one `role="grid"` per month, and the selection is announced through a visually hidden `aria-live="polite"` region ("1 – 14 August 2026, 13 nights").
|
|
15
|
+
- **Exported helpers** — `normalizeRange(start, end)` orders a pair at local midnight (invalid values become null), `rangeNights(start, end)` counts nights from calendar days so DST never shifts the total, `rangeStateOf(day, start, end)` → `'start' | 'middle' | 'end' | null`, `clampRange(range, {min, max, minNights, maxNights})` pulls a range inside its bounds.
|
|
16
|
+
|
|
17
|
+
## DateRangeBox
|
|
18
|
+
|
|
19
|
+
- **Options** — everything DateRangePicker takes, plus `format: '%d.%m.%Y'`, `displayFormat: null`, `separator: ' – '`, `placeholder: null` (derived from the format when null), `clearable: true` (no clear button while disabled, and no room kept for one without it). Typed text is parsed as `"<start><separator><end>"`; a lone date reads as a one-day range and a trailing separator keeps the range half open. `displayFormat` is the endpoints' format at rest, as on Datebox (`'%e %b %Y'` → "3 Aug 2026 – 9 Aug 2026"); focus switches to `format`, and text left untouched while the calendar holds focus goes back to the display format.
|
|
20
|
+
- **Methods** — `get(unit = 'date')` (`'seconds'` returns `{start, end}` as Unix seconds), `set(range, {silent})` accepting `{start, end}` of Dates, Unix-seconds numbers, or formatted strings, `clear({silent})`, `open()`, `close()`, `enable()`, `disable()`, `focus()`, `destroy()`.
|
|
21
|
+
- **Events** — `change {start, end}`, `invalid {text}` when the typed value cannot be parsed (the text stays editable and the field takes `data-state="invalid"` plus `aria-invalid`), `open`, `close`.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Datebox / DateTimeBox
|
|
2
|
+
|
|
3
|
+
A text date field: it parses what the reader types against a strftime-style format, and keeps unparseable text on screen instead of silently discarding it.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/datebox · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Text date input with a calendar popover. `DateTimeBox(target, opts)` is a Datebox with
|
|
8
|
+
`time: true`, which also brings the TimePicker (and its clock face) into the popover. Format
|
|
9
|
+
tokens are the date-utility ones: `%d %m %Y %H %M`.
|
|
10
|
+
|
|
11
|
+
- **Options** — `value: Date | number(unix) | string`, `format: '%d.%m.%Y'`, `displayFormat: null`,
|
|
12
|
+
`time: false`, `min`, `max`, `placeholder`, `clearable: true` (the clear button shows while
|
|
13
|
+
there is a value and the box is enabled; without `clearable` the input keeps no room for it),
|
|
14
|
+
`disabled`.
|
|
15
|
+
- **Two formats** — `format` is what the reader types, and what the field shows while it has
|
|
16
|
+
focus; it is parsed, so it takes numeric tokens only. `displayFormat` is what the field shows at
|
|
17
|
+
rest, so a date field reads the way the rest of the screen writes dates (`'%e %b %Y'` → "2 Nov
|
|
18
|
+
2026" beside a header that says "Created 19 Jul 2026"). It is never parsed, so month and weekday
|
|
19
|
+
names (`%b %B %a %A`) are fine; `null` shows `format`. Focus switches the text to the typing
|
|
20
|
+
format, a valid commit on blur or Enter switches it back, and text that failed to parse stays as
|
|
21
|
+
typed. With `time`, a format without `%H`/`%M` gets ` %H:%M` appended, the display format too.
|
|
22
|
+
The placeholder still describes `format`, and string values passed to `set()` are parsed with it.
|
|
23
|
+
`dateboxFormats({format, displayFormat, time})` → `{format, display}` resolves both the same way.
|
|
24
|
+
- **In a Field** — field types `date`/`datetime` (and `daterange`) fill the control column like a
|
|
25
|
+
text input and give way in a narrow two-column row; standalone, the box keeps its own width.
|
|
26
|
+
- **Methods** — `get(unit='date')` (`'seconds'` → unix), `set(value, {silent})` (accepts a Date;
|
|
27
|
+
pass Date objects, not display strings), `open()`/`close()`, `enable()`/`disable()`, `focus()`.
|
|
28
|
+
- **Events** — `change {date}`, `invalid {text}`, `open`, `close`.
|
|
29
|
+
- **Quiet fields** — inside `[data-zx-fields="quiet"]` the date reads as text: no border, no fill,
|
|
30
|
+
the calendar button hidden until hover; full chrome on focus. An invalid value keeps its danger
|
|
31
|
+
border. DateRangeBox behaves the same way.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Dialog (extends Modal)
|
|
2
|
+
|
|
3
|
+
A modal built on native `<dialog>`: focus trapping, Escape, and the top layer come from the platform, and Modal adds initial focus and the return to the opener on top of them.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/dialog · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Structured modal: a header with title and close button, a body, and footer buttons.
|
|
8
|
+
|
|
9
|
+
- **Options** — `title`, `size: 'sm'|'md'|'lg'|number`,
|
|
10
|
+
`buttons: [{ label, kind, action: 'close'|'cancel'|fn(dialog), autofocus, shortcut }]`, `closable: true`.
|
|
11
|
+
`closable: false` refuses Escape and takes the header ✕ away entirely: it is not displayed, not
|
|
12
|
+
focusable, and closes nothing. Close such a dialog from a footer button or with `close()`.
|
|
13
|
+
- **Methods** — `setTitle()`, `setContent()`, `setButtons()`,
|
|
14
|
+
`addView(key, { content, buttons? })`, `showView(key)`.
|
|
15
|
+
- **Statics returning Promises** — `Dialog.alert({ title, message, okLabel })`,
|
|
16
|
+
`Dialog.confirm({ title, message, okLabel, cancelLabel, danger })` → boolean,
|
|
17
|
+
`Dialog.prompt({ title, message, value, placeholder, okLabel, cancelLabel })` → string|null.
|
|
18
|
+
The labels default to the translated "OK" and "Cancel"; name the action instead where you can
|
|
19
|
+
("Delete", "Rename").
|
|
20
|
+
- **Type to confirm** — `Dialog.confirm({ ..., confirmText: 'Website Redesign' })` adds an input
|
|
21
|
+
labelled "Type **Website Redesign** to confirm" (a real `<label>`; message
|
|
22
|
+
`dialog.typeToConfirm`, `'Type %1 to confirm'`). Focus starts in the input; the confirm button
|
|
23
|
+
stays disabled, and Enter does nothing, until the value matches exactly (case-sensitive, ignoring
|
|
24
|
+
surrounding spaces). Escape, the close button, and Cancel resolve `false` as before. Use it for
|
|
25
|
+
deletes that cannot be undone, with `danger: true` and an `okLabel` that names the action.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Dock
|
|
2
|
+
|
|
3
|
+
A stack of collapsible, resizable panes — the inspector column of a design tool, and the detail side of a master–detail screen.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/dock · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
A stack of collapsible, resizable panes: the docked inspector column of a design tool, and the
|
|
8
|
+
detail side of a master–detail screen. Give the root a size of its own (a grid area, `block-size:
|
|
9
|
+
100%`, a flex child) when the panes should fill a shell rather than grow with their content.
|
|
10
|
+
|
|
11
|
+
- **Options** — `orientation: 'vertical'`, `content: null`, `panes: []`, `resizable: true`,
|
|
12
|
+
`collapsible: true`, `lazy: true`, `storageKey: null`.
|
|
13
|
+
- **Pane** — `{name, title?, content?, tabs?, active?, size?, min?, grow?, collapsed?,
|
|
14
|
+
collapsible?, side?}`. `content` takes a string, Node, Component, or a factory called on first
|
|
15
|
+
reveal. A pane with `tabs` renders its strip in place of the title; `content` is then ignored.
|
|
16
|
+
`side` (`'start' | 'end'`) only applies when the dock has a `content`.
|
|
17
|
+
- **Tab** — `{name, title, content?}`, same content shapes.
|
|
18
|
+
- **Methods** — `pane(name)`, `names()`, `add(pane, {index})`, `remove(name)`,
|
|
19
|
+
`collapse(name)`, `expand(name)`, `toggle(name)`, `isCollapsed(name)`, `reveal(name)`,
|
|
20
|
+
`setSize(name, size)`, `getSize(name)`, `activate(pane, tab)`, `getActive(pane)`,
|
|
21
|
+
`state()`, `setState(state)`, `adopt(sheet, options)`, `release(sheet)`.
|
|
22
|
+
- **Adopting a Sheet** — `adopt(sheet, {name?, side?, index?, size?, min?, dockAt?})` takes over a
|
|
23
|
+
`Sheet`'s positioning: it becomes a track in the dock rather than an overlay. The dock owns
|
|
24
|
+
where it sits, its size, and its resizing; the sheet keeps its content, header, footer, events,
|
|
25
|
+
and its own `open()`/`close()`. `dockAt` names a breakpoint below which the dock hands the sheet
|
|
26
|
+
back to a free overlay and reclaims the track, re-adopting it above — measured on the **dock's
|
|
27
|
+
own width**, so a dock inside a split pane behaves correctly where a viewport media query would
|
|
28
|
+
not. Because a dock is a flex container by construction it is always a valid host, which is why
|
|
29
|
+
docking needs no arrangement from the application.
|
|
30
|
+
- **Ownership** — the dock never owns an adopted sheet: `destroy()` releases them rather than
|
|
31
|
+
destroying them, `remove(name)` on a sheet releases it, and a sheet that destroys itself while
|
|
32
|
+
adopted drops out of the dock cleanly.
|
|
33
|
+
- **Events** — `collapse {name}`, `expand {name}`, `resize {name, size}`,
|
|
34
|
+
`tabchange {pane, tab, previous}`, `reveal {name}`.
|
|
35
|
+
- **Sizing** — one custom property per pane and one flex rule: a sized pane is
|
|
36
|
+
`flex: 0 0 var(--zx-pane-size)`, a collapsed one falls to `flex: 0 0 auto` with its body hidden,
|
|
37
|
+
and exactly one element grows. With a `content` that is always the content; without one it is the
|
|
38
|
+
pane declaring `grow`, or the last expanded pane. A drag therefore rewrites at most two
|
|
39
|
+
properties, and collapsing a pane feeds the grower rather than redistributing across the stack.
|
|
40
|
+
- **Regions** — with `content` the dock is a region rather than a plain stack: panes sit on either
|
|
41
|
+
`side` of the flexible middle. Nesting one dock inside another dock's pane gives a workbench —
|
|
42
|
+
a canvas with an inspector column beside it.
|
|
43
|
+
- **`reveal(name)`** — accepts a pane name or a tab name. Expands whichever pane holds it,
|
|
44
|
+
activates the tab when the name is a tab's, and scrolls it into view.
|
|
45
|
+
- **Persistence** — `storageKey` remembers sizes, collapsed panes, and active tabs through
|
|
46
|
+
`storage()`, which degrades to memory rather than throwing. `state()`/`setState()` expose the
|
|
47
|
+
same shape for storing it elsewhere; unknown pane names are ignored, so a stored layout survives
|
|
48
|
+
a release that added or removed panes.
|
|
49
|
+
- **Keyboard and screen readers** — each pane header is a row, not one big button, so the collapse
|
|
50
|
+
toggle and the tab strip can coexist; the toggle carries `aria-expanded` and `aria-controls`.
|
|
51
|
+
Tabs follow the APG tab pattern with one roving tab stop, Left/Right moving between them.
|
|
52
|
+
Dividers are focusable `separator`s carrying live `aria-valuenow`/`aria-valuemin`/`aria-valuemax`
|
|
53
|
+
in pixels: Up/Down (or Left/Right when horizontal) resize by 16px, Shift by 64px, and Enter or
|
|
54
|
+
Space collapses the pane before the divider. A divider with nothing to resize is taken out of the
|
|
55
|
+
tab order.
|
|
56
|
+
- **Out of scope** — drag-to-rearrange, tear-off panels, and multi-column docks. All three are
|
|
57
|
+
additive without changing the API above.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Dropdown
|
|
2
|
+
|
|
3
|
+
A top-layer panel tethered to an anchor.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/dropdown · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Generic anchored popover in the top layer, constructed as `new Dropdown(anchor, options)`. It
|
|
8
|
+
light-dismisses on an outside click or Esc, mirrors `aria-expanded` onto the anchor, and stays a
|
|
9
|
+
DOM child of the anchor's nearest Zx theme scope while the browser lifts it into the top layer.
|
|
10
|
+
|
|
11
|
+
- **Options** — `content`,
|
|
12
|
+
`placement: 'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'` plus the matching
|
|
13
|
+
`left*` and `right*` placements, `offset: 4`,
|
|
14
|
+
`matchWidth: false`, `openOn: 'click'|'manual'`, `closeOnSelect: false`, `scope: null` (the
|
|
15
|
+
anchor's nearest Zx theme scope by default).
|
|
16
|
+
- **Hosting** — the host is resolved again on every `open()`. A dropdown created before its anchor
|
|
17
|
+
is in the document keeps its panel detached until the first open instead of parking it on
|
|
18
|
+
`<body>`, so an anchor inserted into a `[data-zx-theme]` region or a `.zx-scope` afterwards still
|
|
19
|
+
gets its theme. Tooltip, MenuButton, and ContextMenu panels follow the same rule. While open, a
|
|
20
|
+
panel whose anchor sits in an open `<dialog>` (a modal Dialog or Sheet, a focus-trapping or
|
|
21
|
+
non-modal Sheet) is hosted by that dialog instead, so `showModal()` does not make it inert and a
|
|
22
|
+
focus trap still reaches it; it returns to the theme scope when it closes.
|
|
23
|
+
- **Overlay stack** — an open panel is one entry on the shared overlay stack
|
|
24
|
+
(`src/core/overlay-stack.js`). Esc closes only the topmost layer that takes it, and an Esc that
|
|
25
|
+
something inside already handled (`defaultPrevented`) closes nothing. A press outside the panel
|
|
26
|
+
and every overlay opened from it closes it; a press on the anchor does not. Light dismiss stops
|
|
27
|
+
at the first layer that contains the press, so a press inside an overlay above the panel (one
|
|
28
|
+
not opened from it) leaves the panel open; nothing below an open modal reacts at all. A panel
|
|
29
|
+
opened from inside another overlay closes with that overlay.
|
|
30
|
+
- **Keyboard** — the panel follows its trigger in the Tab order: Tab on the anchor of an open panel
|
|
31
|
+
moves to the panel's first Tab stop, or onto the panel itself when it has a `tabindex`; Tab past
|
|
32
|
+
the last stop continues with whatever follows the anchor; Shift+Tab from the first
|
|
33
|
+
stop returns to the anchor. A Tab stop is what the browser itself stops at: a `tabindex="-1"` part
|
|
34
|
+
of a composite (a Select's toggle), a roving toolbar's inactive items, disabled, hidden and inert
|
|
35
|
+
controls, and all but one radio of a group are not. A panel with no Tab stop is skipped. Esc and `close()` with
|
|
36
|
+
focus inside return focus to the anchor. Opening moves no focus — give the panel `role` and
|
|
37
|
+
`aria-*` semantics yourself if it is more than a disclosure.
|
|
38
|
+
- **Methods** — `open()`, `close()`, `toggle()`, `isOpen()`, `setContent()`, `getPanel()`.
|
|
39
|
+
- **Events** — `open`, `close`.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Custom elements — `defineElements()`
|
|
2
|
+
|
|
3
|
+
Form controls, containers, the agent kit and the data views also ship as custom elements, so a screen can be written as markup and configured with attributes instead of constructor calls.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/elements · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Call `defineElements()` once to register `<zx-*>` light-DOM wrappers with attribute↔option
|
|
8
|
+
reflection and ElementInternals form association, so they participate in a native `<form>` and its
|
|
9
|
+
`FormData`. Events bubble as `zx-*` on the host element, and removing an element from the DOM
|
|
10
|
+
destroys its component.
|
|
11
|
+
|
|
12
|
+
Registered elements: `<zx-toggle>`, `<zx-check-button>`, `<zx-select items='[…]' required>`,
|
|
13
|
+
`<zx-checklist>`, `<zx-datebox>`, `<zx-timebox>`, `<zx-search>`, `<zx-groupbox>`, `<zx-tabbox>`,
|
|
14
|
+
`<zx-table>`, `<zx-dialog>`. `<zx-datebox>` takes `display-format` beside `format`, as the
|
|
15
|
+
Datebox options `displayFormat` and `format`.
|
|
16
|
+
|
|
17
|
+
**Agent kit and data views.** `<zx-agent-thread>`, `<zx-composer>`, `<zx-block-view>`,
|
|
18
|
+
`<zx-run-trace>`, `<zx-approval-card>`, `<zx-source-list>`, `<zx-run-status>`, `<zx-card-view>`,
|
|
19
|
+
`<zx-kanban-view>`, `<zx-tree>` (TreeView) and `<zx-chart>` are made for an application written in a
|
|
20
|
+
framework: it renders the tag, sets properties, calls methods, and listens for events. None of them
|
|
21
|
+
is form-associated.
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
thread.authors = authors; // data goes on the property
|
|
25
|
+
thread.items = items;
|
|
26
|
+
composer.addEventListener('send', (event) => {
|
|
27
|
+
thread.upsert({ id, type: 'user', text: event.detail.text });
|
|
28
|
+
composer.busy = true;
|
|
29
|
+
});
|
|
30
|
+
thread.appendText('answer-1', chunk); // forwarded to the component
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- **Options.** Every component option keeps its name and default. A scalar is an attribute, kebab-cased
|
|
34
|
+
(`heading-level`, `submit-key`), and its property reflects to it. Two stay on the property: a
|
|
35
|
+
Composer's `value`, as an input's does, and an ApprovalCard's `title`, which as an attribute
|
|
36
|
+
would be a tooltip over the whole card. A boolean that defaults to `true` is turned off with
|
|
37
|
+
`="false"` (`numbered="false"`, `follow-output="false"`).
|
|
38
|
+
- **Data is a property.** Lists, items, columns and records are properties first. A JSON attribute
|
|
39
|
+
is read for static markup, but a value set on the property is never written to an attribute, so
|
|
40
|
+
a long thread does not pass through `JSON.stringify`. Functions, nodes and the chart `adapter`
|
|
41
|
+
have no attribute at all: `chart.adapter = new ChartJsAdapter(ChartJs)`, `tree.load = fetchChildren`.
|
|
42
|
+
A property set before `defineElements()` ran is taken over at upgrade.
|
|
43
|
+
- **Methods are forwarded.** Call them on the element: `thread.upsert(item)`, `composer.setBusy(true)`,
|
|
44
|
+
`tree.expandAll()`, not `element.component`. The streaming and update methods of every component
|
|
45
|
+
are forwarded, and on AgentThread also `get`, `getItems` and `getComponent`. A call made before
|
|
46
|
+
the component exists is queued and runs, in order, once it does; a queued call returns
|
|
47
|
+
`undefined`. Once running, a call returns the component's answer, with the component replaced by
|
|
48
|
+
the element so a chain stays on it.
|
|
49
|
+
- **Two names shared with the DOM.** `thread.remove(id)` removes an item and `thread.remove()` the
|
|
50
|
+
element. `blockView.append(block)` adds a block and `blockView.append(node)` a child node.
|
|
51
|
+
- **Events.** Each event the component documents is dispatched on the host under its plain name,
|
|
52
|
+
so `addEventListener('send', …)` and a framework's `onsend` both work. It does not bubble, and
|
|
53
|
+
`zx-send` does; use that one to delegate. Cancelling either cancels the component's event. A
|
|
54
|
+
DOM event of a declared name stops at the component's root, so `input` on `<zx-composer>` is the
|
|
55
|
+
component's, with `detail.text`, once per change. Setting a property emits nothing; a forwarded
|
|
56
|
+
method emits what the component's method emits.
|
|
57
|
+
- **Lifecycle.** Removing the element destroys its component, and re-inserting it rebuilds one from
|
|
58
|
+
the current properties, including what forwarded methods changed: a streamed answer, a board's
|
|
59
|
+
moved records, a tree's selection. Unsent attachments, a tree's open branches and a stopped
|
|
60
|
+
answer's note live only in the component and do not come back. An option the component cannot
|
|
61
|
+
change in place rebuilds it the same way.
|
|
62
|
+
- **Display.** A host is `display: inline` until the page says otherwise. Give it `display: block`
|
|
63
|
+
when it must fill a height, as a scrolling thread does.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# EmptyState — `emptyState(options)`
|
|
2
|
+
|
|
3
|
+
The placeholder that stands where content would have been — in a table body, a panel, or a whole page.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/empty-state · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
A factory (not a class) returning the placeholder shown where a list, table, or panel has no content
|
|
8
|
+
yet: an optional decorative icon, a headline, a sentence, and optional actions. The headline is a
|
|
9
|
+
paragraph rather than a heading, so dropping one into a Table's empty slot or a Panel body never
|
|
10
|
+
disturbs the page's heading outline.
|
|
11
|
+
|
|
12
|
+
- **Options** — `icon` (an icon name, `null` for none; default `'folder-open'`), `agent`
|
|
13
|
+
(`{seed?, name?, tone?, body?, eyes?, material?}` or `true`: an agent's AgentAvatar face, at rest,
|
|
14
|
+
in place of the icon — an empty conversation, an agent with nothing to do yet), `title`,
|
|
15
|
+
`description`, `actions: [Element | buttonOptions]`, `size: 'md'|'sm'`, `align: 'center'|'start'`.
|
|
16
|
+
- **Methods** — none. `emptyState(options)` → `HTMLDivElement`, which you own and place yourself.
|
|
17
|
+
- **Events** — none; action buttons carry their own `onclick`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# EntityRef
|
|
2
|
+
|
|
3
|
+
Dense linked or static record identity with labelled metadata and host-injected actions.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/entity-ref · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Dense record identity for table cells, feeds, selectors, and detail metadata. It owns presentation
|
|
8
|
+
and safe native interaction semantics; the application injects routes, permissions, context menus,
|
|
9
|
+
and record mutations.
|
|
10
|
+
|
|
11
|
+
- **Options** — `id`, `title`, `subtitle` (text, Node, or Component), `icon` (name, Node,
|
|
12
|
+
Component, or lazy renderer), `metadata: [{label,value,icon?,showLabel?}]`, `link` (a URL or
|
|
13
|
+
`{href,target?,rel?,download?,onclick?}`), `actions`, `size: 'sm'|'md'|'lg'`, `wrap: false`, and
|
|
14
|
+
`actionsLabel`.
|
|
15
|
+
- **Actions** — an action is a caller-owned Element or
|
|
16
|
+
`{id,label?,icon?,title?,href?,target?,rel?,kind?,disabled?,onselect?}`. Descriptors with `href`
|
|
17
|
+
remain native anchors; others are buttons. Executable destinations are discarded, `_blank`
|
|
18
|
+
gains `noopener`, and an icon-only action requires `title`.
|
|
19
|
+
- **Methods** — `set(values)`, `setMetadata()`, `setActions()`, `setLink()`, `getEntity()`,
|
|
20
|
+
`focus()`, and `destroy()`.
|
|
21
|
+
- **Events** — cancelable `activate {id,entity,href,event}` before a primary-link callback/native
|
|
22
|
+
navigation and `action {id,action,entity,event}` before an action callback/navigation. The
|
|
23
|
+
bubbling `zx-*` mirrors may cancel the same boundary.
|
|
24
|
+
- **Accessibility** — metadata is a definition list; `showLabel:false` clips its label visually
|
|
25
|
+
while keeping it available to assistive technology. Identity links and secondary controls keep
|
|
26
|
+
native keyboard and modifier-click behavior.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# FieldUpload
|
|
2
|
+
|
|
3
|
+
Click/drop file upload with progress.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/field-upload · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
Click/drop file upload with progress. The drop zone is keyboard-accessible and progress comes from
|
|
8
|
+
`XMLHttpRequest`. Passing the shipped `Http` client keeps XHR upload progress while applying its
|
|
9
|
+
base URL, default headers, timeout, JSON/envelope parsing, and error observer. Per-upload headers
|
|
10
|
+
can override defaults; the browser supplies the multipart boundary. Custom `upload()` or
|
|
11
|
+
`request()` transports receive files, `paramName`, a cancellation signal, and a progress callback.
|
|
12
|
+
Aborted uploads ignore late progress and success callbacks.
|
|
13
|
+
|
|
14
|
+
- **Options** — `url`, `paramName: 'upload'`, `params`, `headers`, `multiple: false`, `accept`,
|
|
15
|
+
`maxSize`, `autoUpload: true`, `preview: true`, `http`.
|
|
16
|
+
- **Methods** — `upload(files?)`, `abort()`, `clear()`, `setDisabled()`.
|
|
17
|
+
- **Events** — `select {files}`, `progress {percent}`, `success {response}`, `error {error}`,
|
|
18
|
+
`abort`.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# FileItem
|
|
2
|
+
|
|
3
|
+
A durable or transient file row with a readable type and size, native downloads, actions, and accessible progress.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/file-item · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
A durable or transient file row composed from `EntityRef`, MIME/byte-size metadata, lifecycle
|
|
8
|
+
status, and accessible progress. It never starts a transfer, decides authorization, resolves a
|
|
9
|
+
preview, or persists a file.
|
|
10
|
+
|
|
11
|
+
- **Options** — `id`, `name`, `size` (bytes), `mime`, `typeLabel: null`, `subtitle`,
|
|
12
|
+
`icon: 'file'`, additional
|
|
13
|
+
`metadata`, safe native `link`, `actions`, status (`ready` | `temporary` | `waiting` |
|
|
14
|
+
`uploading` | `processing` | `success` | `error`), `statusLabel`, `progress` (0–100), `indeterminate`,
|
|
15
|
+
`identitySize: 'sm'|'md'|'lg'`, `wrap`, `actionsLabel`, and `locale`.
|
|
16
|
+
- **Methods** — `set(values)`, `setStatus(status,label?)`,
|
|
17
|
+
`setProgress(percent|null,{indeterminate?})`, `getFile()`, `focus()`, and `destroy()`.
|
|
18
|
+
- **Events** — cancelable `activate {id,file,href,event}` and
|
|
19
|
+
`action {id,fileId,action,file,event}`. Cancellation propagates to the composed EntityRef, so it
|
|
20
|
+
suppresses callbacks and navigation rather than merely observing them.
|
|
21
|
+
- **Progress** — determinate work exposes min/max/now and percentage text. Indeterminate work
|
|
22
|
+
omits `aria-valuenow`; status changes are announced separately.
|
|
23
|
+
- **Type** — the MIME type is shown as a readable type ("PDF", "CSV", "Image", "Spreadsheet"),
|
|
24
|
+
falling back to the name's extension ("EXE") when it is unfamiliar and never to the raw string;
|
|
25
|
+
`typeLabel` overrides it and `''` hides it. The default `icon: 'file'` gives way to a glyph for
|
|
26
|
+
the MIME type (`file-pdf`, `file-image`, …) when the active icon set has one — Font Awesome, or
|
|
27
|
+
a glyph added with `registerIcons()`; any other `icon` is used as given.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# FileList
|
|
2
|
+
|
|
3
|
+
An accessible ordered file collection with empty/loading states and incremental host-controlled mutation.
|
|
4
|
+
|
|
5
|
+
Full reference: https://zx.zeyos.com/docs/llms.md · Live demo: https://zx.zeyos.com/docs.html#components/file-list · All components: https://zx.zeyos.com/docs/components/index.md
|
|
6
|
+
|
|
7
|
+
An accessible ordered collection of `FileItem` rows with loading and empty presentations.
|
|
8
|
+
Explicit duplicate file IDs are rejected; source order is preserved.
|
|
9
|
+
|
|
10
|
+
- **Options** — `items`, `label`, `loading`, `loadingCount: 3`, `loadingText`, and `emptyText` (text,
|
|
11
|
+
Node, or Component). Unset, the three read the `fileList.*` messages; `loadingText` or `emptyText`
|
|
12
|
+
set to `null` shows no text.
|
|
13
|
+
- **Methods** — `setItems(items,{silent?})`, `getItems()`, `getItem(id)`,
|
|
14
|
+
`addItem(item,index?,{silent?})`, `updateItem(id,values,{silent?})`,
|
|
15
|
+
`removeItem(id,{silent?})`, `setLoading()`, and `destroy()`.
|
|
16
|
+
- **Events** — cancelable `activate {id,index,file,href,event}` and
|
|
17
|
+
`action {id,fileId,index,action,file,event}`, plus `datachange {items}` after a collection
|
|
18
|
+
mutation. Returned items are defensive snapshots.
|
|
19
|
+
- **Updates in place** — mutations are reconciled by file `id`: unchanged rows are left alone and a
|
|
20
|
+
changed one is updated through `FileItem.set()`, so upload progress can tick through
|
|
21
|
+
`updateItem(id, {progress})` while focus (say, on that file's Cancel action) and the scroll
|
|
22
|
+
position stay put. Removing the focused file moves focus to the file that takes its place. Files
|
|
23
|
+
without an `id` are rebuilt on every mutation.
|