@zeyos/zx 5.7.0 → 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 +330 -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 +48 -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 +15 -4
- 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 +45 -8
- 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 +31 -1
- 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 +20 -6
- 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/dom.d.ts +14 -0
- 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 +3161 -515
- 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 +970 -57
- package/dist/zx.esm.js +6405 -2249
- package/dist/zx.esm.min.js +26 -26
- package/dist/zx.global.js +6405 -2249
- package/dist/zx.global.min.js +26 -26
- package/dist/zx.layered.css +972 -57
- 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 +3154 -518
- 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 +725 -109
- 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/button/button.css +24 -11
- 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.css +9 -1
- package/src/components/checklist/checklist.js +105 -20
- package/src/components/checklist/field-adapter.js +6 -12
- 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 +24 -33
- 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 +129 -30
- 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 +70 -16
- 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 +39 -13
- 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/dom.js +45 -2
- 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 +60 -8
- package/src/core/keyboard.js +83 -9
- package/src/core/messages.js +3 -0
- package/src/core/position.js +4 -3
- 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,165 @@
|
|
|
1
|
+
import { Component } from '../../core/component.js';
|
|
2
|
+
export { AGENT_BODIES, AGENT_EYES, agentFace, agentTraits } from './agent-face.js';
|
|
3
|
+
export type AgentBody = import('./agent-face.js').AgentBody;
|
|
4
|
+
export type AgentEyes = import('./agent-face.js').AgentEyes;
|
|
5
|
+
export type AgentTraits = import('./agent-face.js').AgentTraits;
|
|
6
|
+
export type AgentShape = import('./agent-face.js').AgentShape;
|
|
7
|
+
export type AvatarTone = import('../avatar/avatar.js').AvatarTone;
|
|
8
|
+
export type AgentActivity = import('../../internal/agent-model.js').AgentActivity;
|
|
9
|
+
export type AgentMaterial = 'flat' | 'soft';
|
|
10
|
+
export type AgentAvatarOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* The agent's stable identity — an id. Every trait is derived
|
|
13
|
+
* from it, so renaming an agent does not change its face. `null` uses `name`.
|
|
14
|
+
*/
|
|
15
|
+
seed?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* The agent's name; the seed when `seed` is null.
|
|
18
|
+
*/
|
|
19
|
+
name?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Colour from the tone palette; `null` derives it from the
|
|
22
|
+
* seed with `avatarTone()`, so the face matches an initials tile keyed the same way.
|
|
23
|
+
*/
|
|
24
|
+
tone?: AvatarTone | null;
|
|
25
|
+
/**
|
|
26
|
+
* The silhouette, instead of the derived one: one of the
|
|
27
|
+
* fourteen in {@link AGENT_BODIES}.
|
|
28
|
+
*/
|
|
29
|
+
body?: AgentBody | null;
|
|
30
|
+
/**
|
|
31
|
+
* The eye shape, instead of the derived one.
|
|
32
|
+
*/
|
|
33
|
+
eyes?: AgentEyes | null;
|
|
34
|
+
/**
|
|
35
|
+
* How far apart the eyes sit — narrow, middle, wide —
|
|
36
|
+
* instead of the derived spacing. With `tone`, `body` and `eyes` it gives back a look kept from
|
|
37
|
+
* {@link AgentAvatar#getTraits}.
|
|
38
|
+
*/
|
|
39
|
+
spacing?: 0 | 1 | 2 | null;
|
|
40
|
+
/**
|
|
41
|
+
* How the body is painted. `flat` is the tone's solid
|
|
42
|
+
* fill; `soft` adds a quiet vertical ramp — a touch lighter at the top, deeper at the foot, the plain
|
|
43
|
+
* tone across the eyes — from 28px up. Below 28px, when offline, in print and in forced colours a
|
|
44
|
+
* soft body is drawn flat.
|
|
45
|
+
*/
|
|
46
|
+
material?: AgentMaterial;
|
|
47
|
+
/**
|
|
48
|
+
* Preset — `sm` 24px, `md` 32px, `lg` 40px at the default
|
|
49
|
+
* spacing unit — or a pixel size. Small sizes draw less: no pupils below 20px, larger eyes at 24px
|
|
50
|
+
* and below.
|
|
51
|
+
*/
|
|
52
|
+
size?: string | number;
|
|
53
|
+
/**
|
|
54
|
+
* Accessible label; null makes the avatar decorative.
|
|
55
|
+
*/
|
|
56
|
+
label?: string | null;
|
|
57
|
+
/**
|
|
58
|
+
* What the agent is doing. The eyes take the
|
|
59
|
+
* activity's expression, the activity dot shows it, and its word joins the accessible name.
|
|
60
|
+
*/
|
|
61
|
+
activity?: AgentActivity | null;
|
|
62
|
+
/**
|
|
63
|
+
* The activity's word, when the default is not the one
|
|
64
|
+
* to show.
|
|
65
|
+
*/
|
|
66
|
+
activityLabel?: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* Whether to draw the activity dot. Without it, show the
|
|
69
|
+
* activity's word nearby: the expression alone is a weaker signal.
|
|
70
|
+
*/
|
|
71
|
+
indicator?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Moves the avatar with its activity in the shared presence loop
|
|
74
|
+
* (as Avatar does) and lets its eyes blink, drift and scan. Motion is never the only signal and
|
|
75
|
+
* stops under reduced motion. While it is on, the root's `transform` belongs to the loop.
|
|
76
|
+
*/
|
|
77
|
+
animate?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Where in its activity's cycle the avatar moves, as a fraction
|
|
80
|
+
* from 0 up to 1. `null` derives one from the seed.
|
|
81
|
+
*/
|
|
82
|
+
phase?: number | null;
|
|
83
|
+
/**
|
|
84
|
+
* Localized
|
|
85
|
+
* messages: the activity words, `agent.activity.<activity>`.
|
|
86
|
+
*/
|
|
87
|
+
msg?: Record<string, string> | Record<string, Record<string, string>>;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* A generated face for an agent without a picture: a coloured geometric silhouette with eyes that
|
|
91
|
+
* take the agent's activity, deterministic from the agent's seed.
|
|
92
|
+
* @extends {Component<AgentAvatarOptions>}
|
|
93
|
+
*/
|
|
94
|
+
export declare class AgentAvatar extends Component<AgentAvatarOptions> {
|
|
95
|
+
_createdRoot: boolean;
|
|
96
|
+
_original: import("../../core/dom.js").TargetSnapshot;
|
|
97
|
+
/** @type {Record<string, any>} */
|
|
98
|
+
_state: Record<string, any>;
|
|
99
|
+
/** @type {AgentTraits|null} */
|
|
100
|
+
_traits: AgentTraits | null;
|
|
101
|
+
/** A document-unique id for the soft ramp, so two avatars never share a paint server. */
|
|
102
|
+
_paintId: string;
|
|
103
|
+
_destroyed: boolean;
|
|
104
|
+
/** @type {import('../../internal/presence-loop.js').PresenceHandle|null} */
|
|
105
|
+
_presence: import('../../internal/presence-loop.js').PresenceHandle | null;
|
|
106
|
+
static cssName: string;
|
|
107
|
+
/** @type {Readonly<AgentAvatarOptions>} */
|
|
108
|
+
static defaults: Readonly<AgentAvatarOptions>;
|
|
109
|
+
/** @returns {HTMLElement} */
|
|
110
|
+
render(): HTMLElement;
|
|
111
|
+
/**
|
|
112
|
+
* Replaces identity and presentation values: any option but `msg`.
|
|
113
|
+
* @param {Partial<AgentAvatarOptions>} values New values.
|
|
114
|
+
* @returns {this}
|
|
115
|
+
*/
|
|
116
|
+
set(values?: Partial<AgentAvatarOptions>): this;
|
|
117
|
+
/**
|
|
118
|
+
* Sets what the agent is doing and, optionally, the word for it. `null` clears the activity.
|
|
119
|
+
* @param {AgentActivity|null} activity
|
|
120
|
+
* @param {string|null} [label=null] The word, when the default is not the one to show.
|
|
121
|
+
* @returns {this}
|
|
122
|
+
*/
|
|
123
|
+
setActivity(activity: AgentActivity | null, label?: string | null): this;
|
|
124
|
+
/**
|
|
125
|
+
* What the agent is doing.
|
|
126
|
+
* @returns {AgentActivity|null} The activity, or null without one.
|
|
127
|
+
*/
|
|
128
|
+
getActivity(): AgentActivity | null;
|
|
129
|
+
/**
|
|
130
|
+
* The localized word for the current activity — `activityLabel` when set — or null without an
|
|
131
|
+
* activity. A host that draws the avatar inside a control of its own adds it to that control's
|
|
132
|
+
* name, as AppSidebar and ModuleBar do.
|
|
133
|
+
* @returns {string|null}
|
|
134
|
+
*/
|
|
135
|
+
getActivityWord(): string | null;
|
|
136
|
+
/**
|
|
137
|
+
* The traits the face is drawn from, so an application can store them — to keep a look across a
|
|
138
|
+
* rename, or to settle a collision between two agents once — and give them back as the `tone`,
|
|
139
|
+
* `body`, `eyes` and `spacing` options.
|
|
140
|
+
* @returns {AgentTraits}
|
|
141
|
+
*/
|
|
142
|
+
getTraits(): AgentTraits;
|
|
143
|
+
/**
|
|
144
|
+
* Leaves the presence loop and restores an enhanced target or removes an owned root. Safe to call
|
|
145
|
+
* more than once: only the first call restores, so a target its owner has reused is left alone.
|
|
146
|
+
* @returns {void}
|
|
147
|
+
*/
|
|
148
|
+
destroy(): void;
|
|
149
|
+
/** @returns {AgentTraits} */
|
|
150
|
+
_resolveTraits(): AgentTraits;
|
|
151
|
+
/** @returns {number} The rendered size the level of detail is picked for. */
|
|
152
|
+
_px(): number;
|
|
153
|
+
/** @returns {void} */
|
|
154
|
+
_sync(): void;
|
|
155
|
+
/** The word for the current activity, or null without one. @returns {string|null} */
|
|
156
|
+
_activityWord(): string | null;
|
|
157
|
+
/**
|
|
158
|
+
* Joins, follows, or leaves the shared presence loop, and offsets the eyes' own animations.
|
|
159
|
+
* @param {AgentActivity|null} activity
|
|
160
|
+
* @returns {void}
|
|
161
|
+
*/
|
|
162
|
+
_syncMotion(activity: AgentActivity | null): void;
|
|
163
|
+
/** @returns {string} */
|
|
164
|
+
_seedKey(): string;
|
|
165
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export type AvatarTone = import('../avatar/avatar.js').AvatarTone;
|
|
2
|
+
export type AgentActivity = import('../../internal/agent-model.js').AgentActivity;
|
|
3
|
+
export type AgentBody = 'circle' | 'squircle' | 'hexagon' | 'triangle' | 'drop' | 'pill' | 'clover' | 'dome' | 'wedge' | 'pentagon' | 'trapezoid' | 'cross' | 'diamond' | 'octagon';
|
|
4
|
+
export type AgentEyes = 'round' | 'oval' | 'square';
|
|
5
|
+
export type AgentTraits = {
|
|
6
|
+
tone: AvatarTone;
|
|
7
|
+
body: AgentBody;
|
|
8
|
+
eyes: AgentEyes;
|
|
9
|
+
/**
|
|
10
|
+
* How far apart the eyes sit: narrow, middle, wide.
|
|
11
|
+
*/
|
|
12
|
+
spacing: 0 | 1 | 2;
|
|
13
|
+
};
|
|
14
|
+
export type AgentTraitOverrides = {
|
|
15
|
+
tone?: AvatarTone | null;
|
|
16
|
+
body?: AgentBody | null;
|
|
17
|
+
eyes?: AgentEyes | null;
|
|
18
|
+
/**
|
|
19
|
+
* How far apart the eyes sit, as `AgentAvatar.getTraits()` reports it.
|
|
20
|
+
*/
|
|
21
|
+
spacing?: 0 | 1 | 2 | null;
|
|
22
|
+
};
|
|
23
|
+
export type AgentShape = {
|
|
24
|
+
tag: string;
|
|
25
|
+
part: string | null;
|
|
26
|
+
attrs: Record<string, string | number>;
|
|
27
|
+
children?: AgentShape[];
|
|
28
|
+
};
|
|
29
|
+
/** @typedef {import('../avatar/avatar.js').AvatarTone} AvatarTone */
|
|
30
|
+
/** @typedef {import('../../internal/agent-model.js').AgentActivity} AgentActivity */
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {'circle'|'squircle'|'hexagon'|'triangle'|'drop'|'pill'|'clover'|'dome'
|
|
33
|
+
* |'wedge'|'pentagon'|'trapezoid'|'cross'|'diamond'|'octagon'} AgentBody
|
|
34
|
+
*/
|
|
35
|
+
/** @typedef {'round'|'oval'|'square'} AgentEyes */
|
|
36
|
+
/**
|
|
37
|
+
* The traits a seed resolves to.
|
|
38
|
+
* @typedef {Object} AgentTraits
|
|
39
|
+
* @property {AvatarTone} tone
|
|
40
|
+
* @property {AgentBody} body
|
|
41
|
+
* @property {AgentEyes} eyes
|
|
42
|
+
* @property {0|1|2} spacing How far apart the eyes sit: narrow, middle, wide.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Single traits to fix instead of deriving them. An unknown value is ignored.
|
|
46
|
+
* @typedef {Object} AgentTraitOverrides
|
|
47
|
+
* @property {AvatarTone|null} [tone]
|
|
48
|
+
* @property {AgentBody|null} [body]
|
|
49
|
+
* @property {AgentEyes|null} [eyes]
|
|
50
|
+
* @property {0|1|2|null} [spacing] How far apart the eyes sit, as `AgentAvatar.getTraits()` reports it.
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* One shape to draw: an SVG element name, the part it plays (styled as `.zx-agent-avatar__<part>`),
|
|
54
|
+
* its attributes, and, for a group, its children.
|
|
55
|
+
* @typedef {Object} AgentShape
|
|
56
|
+
* @property {string} tag
|
|
57
|
+
* @property {string|null} part
|
|
58
|
+
* @property {Record<string, string|number>} attrs
|
|
59
|
+
* @property {AgentShape[]} [children]
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* The silhouettes, in hash order.
|
|
63
|
+
* @type {ReadonlyArray<AgentBody>}
|
|
64
|
+
*/
|
|
65
|
+
export declare const AGENT_BODIES: ReadonlyArray<AgentBody>;
|
|
66
|
+
/** The eye shapes, in hash order. @type {ReadonlyArray<AgentEyes>} */
|
|
67
|
+
export declare const AGENT_EYES: ReadonlyArray<AgentEyes>;
|
|
68
|
+
/** The rendered pixel size each preset stands for when picking the level of detail. */
|
|
69
|
+
export declare const AGENT_PRESET_PX: Readonly<{
|
|
70
|
+
sm: 24;
|
|
71
|
+
md: 32;
|
|
72
|
+
lg: 40;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Resolves the face a seed gets. The tone is `avatarTone(seed)`, so an agent's initials Avatar and
|
|
76
|
+
* its face agree when they share a key; every other trait comes from FNV-1a over the same
|
|
77
|
+
* normalised key plus a per-trait salt, mixed, so traits are independent of the tone and of each
|
|
78
|
+
* other.
|
|
79
|
+
* @param {unknown} seed The agent's stable identity — an id, or its name.
|
|
80
|
+
* @param {AgentTraitOverrides} [overrides={}] Traits to fix instead of deriving them.
|
|
81
|
+
* @returns {AgentTraits}
|
|
82
|
+
*/
|
|
83
|
+
export declare function agentTraits(seed: unknown, overrides?: AgentTraitOverrides): AgentTraits;
|
|
84
|
+
/**
|
|
85
|
+
* The shapes that draw a face in one activity at one rendered size, in a 64-unit view box, as
|
|
86
|
+
* plain data. The level of detail follows `px`: the pupils go below 20px, and at 24px and below the
|
|
87
|
+
* eyes grow and sit at the middle spacing.
|
|
88
|
+
* @param {AgentTraits} traits From {@link agentTraits}.
|
|
89
|
+
* @param {AgentActivity|string|null} [activity=null] What the agent is doing; unknown is idle.
|
|
90
|
+
* @param {number} [px=32] The rendered size in CSS pixels.
|
|
91
|
+
* @returns {AgentShape[]}
|
|
92
|
+
*/
|
|
93
|
+
export declare function agentFace(traits: AgentTraits, activity?: AgentActivity | string | null, px?: number): AgentShape[];
|
|
@@ -82,7 +82,8 @@ export type AgUiProblem = {
|
|
|
82
82
|
export type AgUiOptions = {
|
|
83
83
|
/**
|
|
84
84
|
* A
|
|
85
|
-
* RunStatus the run's lifecycle drives
|
|
85
|
+
* RunStatus the run's lifecycle drives — its `agent` face, set by the application, takes each
|
|
86
|
+
* state's expression: `running` when it starts, `done`, `waiting` (an
|
|
86
87
|
* interrupt, or calls of the run still without a result), `stopped` (cancelled) or `failed`.
|
|
87
88
|
*/
|
|
88
89
|
runStatus?: {
|
|
@@ -90,7 +91,9 @@ export type AgUiOptions = {
|
|
|
90
91
|
} | null;
|
|
91
92
|
/**
|
|
92
93
|
* The thread's authors. A text message whose
|
|
93
|
-
* `name` is one of their keys is written by that author; every other item by `agent`.
|
|
94
|
+
* `name` is one of their keys is written by that author; every other item by `agent`. The thread
|
|
95
|
+
* draws them from its own `authors`, so an agent given a `face` there is drawn as its AgentAvatar
|
|
96
|
+
* in every item the adapter writes; the stream itself can never set or change a face.
|
|
94
97
|
*/
|
|
95
98
|
authors?: Record<string, Author>;
|
|
96
99
|
/**
|
|
@@ -207,6 +210,10 @@ export type Run = {
|
|
|
207
210
|
cancelAtEnd: Set<string>;
|
|
208
211
|
};
|
|
209
212
|
export type Message = {
|
|
213
|
+
/**
|
|
214
|
+
* Its first answer item: the message id, or an id of its own when the thread
|
|
215
|
+
* already holds that one.
|
|
216
|
+
*/
|
|
210
217
|
id: string;
|
|
211
218
|
run: Run;
|
|
212
219
|
open: boolean;
|
|
@@ -216,7 +223,7 @@ export type Message = {
|
|
|
216
223
|
ignored: boolean;
|
|
217
224
|
author: string | null;
|
|
218
225
|
/**
|
|
219
|
-
* Its answer items:
|
|
226
|
+
* Its answer items: `id`, then `<id>#2`, `<id>#3`…
|
|
220
227
|
*/
|
|
221
228
|
segments: string[];
|
|
222
229
|
/**
|
|
@@ -272,12 +279,13 @@ export type Call = {
|
|
|
272
279
|
*/
|
|
273
280
|
/**
|
|
274
281
|
* @typedef {Object} Message
|
|
275
|
-
* @property {string} id
|
|
282
|
+
* @property {string} id Its first answer item: the message id, or an id of its own when the thread
|
|
283
|
+
* already holds that one.
|
|
276
284
|
* @property {Run} run
|
|
277
285
|
* @property {boolean} open
|
|
278
286
|
* @property {boolean} ignored A message of a role the thread does not draw.
|
|
279
287
|
* @property {string|null} author
|
|
280
|
-
* @property {string[]} segments Its answer items:
|
|
288
|
+
* @property {string[]} segments Its answer items: `id`, then `<id>#2`, `<id>#3`…
|
|
281
289
|
* @property {Set<string>} written Segments that received text.
|
|
282
290
|
* @property {boolean} afterFence A fence's lines came since the last prose.
|
|
283
291
|
* @property {Set<string>} pending Surfaces its fences began and did not end.
|
|
@@ -320,10 +328,14 @@ export type Call = {
|
|
|
320
328
|
* interrupt is the application's: the event goes to `onunknown`. A result that arrives before
|
|
321
329
|
* the decision is drawn as it is, the card expires, and no decision is sent for that call; a
|
|
322
330
|
* surface still waiting is cancelled the same way.
|
|
323
|
-
* - A message id is the answer's item id.
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
331
|
+
* - A message id is the answer's item id. What already holds that id in the thread is never
|
|
332
|
+
* overwritten: an answer the adapter did not draw is taken over, and its content continues as a
|
|
333
|
+
* reopened message's does; anything else — a person's message, a card, a piece of another
|
|
334
|
+
* message — leaves the message an id of its own. A start for a closed message or call reopens
|
|
335
|
+
* it, in this run or a later one, and its content continues: a reopened call is asked about
|
|
336
|
+
* again once its arguments are complete. A start for an id still open, or for a call already
|
|
337
|
+
* decided or answered, is ignored and reported: `ontoolresult` fires once for a call, and a
|
|
338
|
+
* receipt stays.
|
|
327
339
|
* - A surface is the thread item `surface:<runId>/<surface>`, so a model reusing `s1` in every
|
|
328
340
|
* run gets a new surface each run. Its token is the application's for a custom event, the tool
|
|
329
341
|
* call id for a surface tool, and the run id for an inline surface.
|
|
@@ -289,6 +289,12 @@ export declare class AgentThread extends Component<AgentThreadOptions> {
|
|
|
289
289
|
/** @type {EventTarget|null} */
|
|
290
290
|
_scrollTarget: EventTarget | null;
|
|
291
291
|
_onScroll: () => void;
|
|
292
|
+
_stick: boolean;
|
|
293
|
+
_lastTop: number;
|
|
294
|
+
/** @type {ResizeObserver|null} Watches the surfaces still being streamed into, while they grow. */
|
|
295
|
+
_growth: ResizeObserver | null;
|
|
296
|
+
/** @type {Map<Element, number>} Each watched surface's height when it was last measured. */
|
|
297
|
+
_heights: Map<Element, number>;
|
|
292
298
|
/** @type {string|null} */
|
|
293
299
|
_latestAnswer: string | null;
|
|
294
300
|
/** @type {Map<string, {expanded?: boolean|null, controls?: string|null}>} Artifact open states, for answers drawn later. */
|
|
@@ -647,6 +653,26 @@ export declare class AgentThread extends Component<AgentThreadOptions> {
|
|
|
647
653
|
* @returns {void}
|
|
648
654
|
*/
|
|
649
655
|
private _follow;
|
|
656
|
+
/**
|
|
657
|
+
* Follows a surface streamed into through `surface(id)` as the thread's own updates are followed:
|
|
658
|
+
* what its operations add keeps the end in view while the reader is reading it, and offers
|
|
659
|
+
* "Jump to latest" otherwise. The surface says nothing per operation, and is fed from outside
|
|
660
|
+
* the thread, so its size is watched rather than the calls. Watching stops once its `end` has
|
|
661
|
+
* arrived or it has replied: what changes it after that is the reader's doing, and stays where
|
|
662
|
+
* they put it.
|
|
663
|
+
* @private
|
|
664
|
+
* @param {Surface} surface
|
|
665
|
+
* @returns {void}
|
|
666
|
+
*/
|
|
667
|
+
private _watchGrowth;
|
|
668
|
+
/**
|
|
669
|
+
* A watched surface may have grown since it was last measured. The reader was at the end if,
|
|
670
|
+
* measured now, nothing but the growth lies past what they see, and they had not scrolled away.
|
|
671
|
+
* @private
|
|
672
|
+
* @param {Element} element
|
|
673
|
+
* @returns {void}
|
|
674
|
+
*/
|
|
675
|
+
private _grown;
|
|
650
676
|
/** @private @returns {HTMLElement|null} */
|
|
651
677
|
private _lastArticle;
|
|
652
678
|
/** @private @param {MouseEvent} event @returns {void} */
|
|
@@ -64,7 +64,9 @@ export type UiMessageStreamOptions = {
|
|
|
64
64
|
runStatus?: RunStatus | null;
|
|
65
65
|
/**
|
|
66
66
|
* Who writes; its first author who is not a person
|
|
67
|
-
* is the agent when `agent` is not given.
|
|
67
|
+
* is the agent when `agent` is not given. The thread draws authors from its own `authors`, so an
|
|
68
|
+
* agent given a `face` there is drawn as its AgentAvatar in every item the stream writes; the
|
|
69
|
+
* stream itself can never set or change a face.
|
|
68
70
|
*/
|
|
69
71
|
authors?: Record<string, Author>;
|
|
70
72
|
/**
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
|
+
import { AgentAvatar } from '../agent-avatar/agent-avatar.js';
|
|
2
3
|
import { Dialog } from '../dialog/dialog.js';
|
|
3
4
|
import { Field } from '../field/field.js';
|
|
4
5
|
import { Fieldset } from '../fieldset/fieldset.js';
|
|
5
6
|
export type Block = import('../../internal/agent-model.js').Block;
|
|
6
7
|
export type FieldOptions = import('../field/field.js').FieldOptions;
|
|
8
|
+
export type AgentFace = import('../../internal/agent-model.js').AgentFace;
|
|
7
9
|
export type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired';
|
|
8
10
|
export type ApprovalReasonMode = 'optional' | 'required' | 'none';
|
|
9
11
|
export type ApprovalAction = 'approve' | 'edit' | 'reject';
|
|
@@ -39,6 +41,15 @@ export type ApprovalCardOptions = {
|
|
|
39
41
|
* Categorical tone of the icon tile.
|
|
40
42
|
*/
|
|
41
43
|
tone?: ApprovalTone;
|
|
44
|
+
/**
|
|
45
|
+
* The agent that asks, drawn as its AgentAvatar face in
|
|
46
|
+
* place of the icon tile: its traits and name, or `true` to derive the face from the title. The
|
|
47
|
+
* face is keyed by the agent's `seed`, else its `name`; without either it is named after the
|
|
48
|
+
* title it is given with, and a later title never changes it. The face looks up at you while
|
|
49
|
+
* the request waits and rests once it is answered; it is decorative, so the title and
|
|
50
|
+
* description say what is asked.
|
|
51
|
+
*/
|
|
52
|
+
agent?: AgentFace | true | null;
|
|
42
53
|
/**
|
|
43
54
|
* Element level of the title heading.
|
|
44
55
|
*/
|
|
@@ -134,7 +145,7 @@ export type ApprovalCardOptions = {
|
|
|
134
145
|
reason: string;
|
|
135
146
|
}>) => void;
|
|
136
147
|
};
|
|
137
|
-
export type ApprovalCardUpdate = Pick<ApprovalCardOptions, 'title' | 'description' | 'icon' | 'tone' | 'details' | 'preview' | 'fields' | 'values' | 'confirmText' | 'reason' | 'edited' | 'editedKeys'>;
|
|
148
|
+
export type ApprovalCardUpdate = Pick<ApprovalCardOptions, 'title' | 'description' | 'icon' | 'tone' | 'agent' | 'details' | 'preview' | 'fields' | 'values' | 'confirmText' | 'reason' | 'edited' | 'editedKeys'>;
|
|
138
149
|
export type ApprovalEditDetail = {
|
|
139
150
|
/**
|
|
140
151
|
* The values as saved, edits included.
|
|
@@ -205,6 +216,12 @@ export declare class ApprovalCard extends Component<ApprovalCardOptions> {
|
|
|
205
216
|
/** @type {string|null} */
|
|
206
217
|
_icon: string | null;
|
|
207
218
|
_tone: any;
|
|
219
|
+
/** @type {Record<string, any>|null} The face asked for, as traits; it wins over the icon. */
|
|
220
|
+
_face: Record<string, any> | null;
|
|
221
|
+
/** What names a face that has no seed or name: the title it was given with. */
|
|
222
|
+
_faceName: any;
|
|
223
|
+
/** @type {AgentAvatar|null} */
|
|
224
|
+
_avatar: AgentAvatar | null;
|
|
208
225
|
_confirmText: any;
|
|
209
226
|
/** @type {unknown} What `details` was drawn from, to compare an update against. */
|
|
210
227
|
_details: unknown;
|
|
@@ -380,7 +397,12 @@ export declare class ApprovalCard extends Component<ApprovalCardOptions> {
|
|
|
380
397
|
private _closeDialogs;
|
|
381
398
|
/** @private @returns {string} Who answers, as the verdict names them. */
|
|
382
399
|
private _byText;
|
|
383
|
-
/**
|
|
400
|
+
/**
|
|
401
|
+
* Draws the icon tile — or the agent's face, which takes its place — or takes it away when there
|
|
402
|
+
* is neither.
|
|
403
|
+
* @private
|
|
404
|
+
* @returns {void}
|
|
405
|
+
*/
|
|
384
406
|
private _drawTile;
|
|
385
407
|
/** @private @returns {void} Draws the line under the title, and what describes the card. */
|
|
386
408
|
private _drawDescription;
|
|
@@ -401,6 +423,13 @@ export declare class ApprovalCard extends Component<ApprovalCardOptions> {
|
|
|
401
423
|
* @returns {void}
|
|
402
424
|
*/
|
|
403
425
|
private _sync;
|
|
426
|
+
/**
|
|
427
|
+
* The expression of the agent's face: the one a run takes in the state the status is drawn as —
|
|
428
|
+
* looking up at you while the request waits, at rest once it is answered.
|
|
429
|
+
* @private
|
|
430
|
+
* @returns {import('../../internal/agent-model.js').AgentActivity}
|
|
431
|
+
*/
|
|
432
|
+
private _faceActivity;
|
|
404
433
|
/**
|
|
405
434
|
* Draws what follows the status: the state glyph and word, the line under the title, the
|
|
406
435
|
* reason, and whether the actions show.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
|
+
export type AuroraPreset = 'source' | 'confluence' | 'horizon' | 'diagonal' | 'edge' | 'curtain' | 'mesh' | 'ribbon' | 'bloom';
|
|
3
|
+
export type AuroraMotion = 'none' | 'drift' | 'flow';
|
|
2
4
|
export type AuroraOptions = {
|
|
3
5
|
/**
|
|
4
6
|
* Geometry of the ambient light field.
|
|
5
7
|
*/
|
|
6
|
-
preset?:
|
|
8
|
+
preset?: AuroraPreset;
|
|
7
9
|
/**
|
|
8
10
|
* Zero to four concrete CSS colours. An empty list uses semantic
|
|
9
11
|
* Zx colours; shorter palettes repeat across the four gradient fields.
|
|
@@ -13,19 +15,33 @@ export type AuroraOptions = {
|
|
|
13
15
|
* Strength of the light field.
|
|
14
16
|
*/
|
|
15
17
|
intensity?: 'subtle' | 'balanced' | 'vivid';
|
|
18
|
+
/**
|
|
19
|
+
* Slow ambient movement: `drift` lets the field breathe
|
|
20
|
+
* while two lights wander across it, `flow` turns a disc of colour behind it. Shown only to readers
|
|
21
|
+
* who have not asked for reduced motion; `--zx-aurora-duration` (18s) sets the pace.
|
|
22
|
+
*/
|
|
23
|
+
motion?: AuroraMotion;
|
|
16
24
|
};
|
|
25
|
+
/** @typedef {'source'|'confluence'|'horizon'|'diagonal'|'edge'|'curtain'|'mesh'|'ribbon'|'bloom'} AuroraPreset */
|
|
26
|
+
/** @typedef {'none'|'drift'|'flow'} AuroraMotion */
|
|
17
27
|
/**
|
|
18
28
|
* @typedef {Object} AuroraOptions
|
|
19
|
-
* @property {
|
|
20
|
-
* Geometry of the ambient light field.
|
|
29
|
+
* @property {AuroraPreset} [preset='source'] Geometry of the ambient light field.
|
|
21
30
|
* @property {string[]} [colors=[]] Zero to four concrete CSS colours. An empty list uses semantic
|
|
22
31
|
* Zx colours; shorter palettes repeat across the four gradient fields.
|
|
23
32
|
* @property {'subtle'|'balanced'|'vivid'} [intensity='subtle'] Strength of the light field.
|
|
33
|
+
* @property {AuroraMotion} [motion='none'] Slow ambient movement: `drift` lets the field breathe
|
|
34
|
+
* while two lights wander across it, `flow` turns a disc of colour behind it. Shown only to readers
|
|
35
|
+
* who have not asked for reduced motion; `--zx-aurora-duration` (18s) sets the pace.
|
|
24
36
|
*/
|
|
25
37
|
/**
|
|
26
38
|
* Decorative multicolour ambient light for an existing application surface.
|
|
27
39
|
* Aurora owns no application content or interaction: it enhances the target in place and renders
|
|
28
40
|
* its pointer-transparent light field behind the target's existing children.
|
|
41
|
+
*
|
|
42
|
+
* With `motion`, Aurora adds one decorative element as the target's first child —
|
|
43
|
+
* `<span class="zx-aurora__motion" aria-hidden="true">`, absolutely positioned and clipped to the
|
|
44
|
+
* surface — whose layers move by transform alone. `setMotion('none')` and `destroy()` remove it.
|
|
29
45
|
* @extends {Component<AuroraOptions>}
|
|
30
46
|
*/
|
|
31
47
|
export declare class Aurora extends Component<AuroraOptions> {
|
|
@@ -38,6 +54,8 @@ export declare class Aurora extends Component<AuroraOptions> {
|
|
|
38
54
|
priority: string;
|
|
39
55
|
}[];
|
|
40
56
|
_colors: any[] | string[];
|
|
57
|
+
/** @type {HTMLElement|null} The motion layer, while `motion` is not `none`. */
|
|
58
|
+
_motion: HTMLElement | null;
|
|
41
59
|
static cssName: string;
|
|
42
60
|
/** @type {Readonly<AuroraOptions>} */
|
|
43
61
|
static defaults: Readonly<AuroraOptions>;
|
|
@@ -49,6 +67,12 @@ export declare class Aurora extends Component<AuroraOptions> {
|
|
|
49
67
|
constructor(target?: Element | string | null, options?: AuroraOptions);
|
|
50
68
|
/** @returns {HTMLElement} */
|
|
51
69
|
render(): HTMLElement;
|
|
70
|
+
/**
|
|
71
|
+
* Starts, changes, or stops the ambient movement without replacing surface content.
|
|
72
|
+
* @param {string} motion `none`, `drift`, or `flow`.
|
|
73
|
+
* @returns {this}
|
|
74
|
+
*/
|
|
75
|
+
setMotion(motion: string): this;
|
|
52
76
|
/** Sets the light-field geometry without replacing surface content. @param {string} preset @returns {this} */
|
|
53
77
|
setPreset(preset: string): this;
|
|
54
78
|
/** Sets zero to four concrete colours without replacing surface content. @param {string[]|null} colors @returns {this} */
|
|
@@ -58,8 +82,10 @@ export declare class Aurora extends Component<AuroraOptions> {
|
|
|
58
82
|
/** Restores an enhanced target exactly, or removes an owned surface. @returns {void} */
|
|
59
83
|
destroy(): void;
|
|
60
84
|
}
|
|
61
|
-
/** @param {unknown} value @returns {
|
|
62
|
-
export declare function normalizeAuroraPreset(value: unknown):
|
|
85
|
+
/** @param {unknown} value @returns {AuroraPreset} */
|
|
86
|
+
export declare function normalizeAuroraPreset(value: unknown): AuroraPreset;
|
|
87
|
+
/** @param {unknown} value @returns {AuroraMotion} `none` for null or undefined. */
|
|
88
|
+
export declare function normalizeAuroraMotion(value: unknown): AuroraMotion;
|
|
63
89
|
/** @param {unknown} value @returns {'subtle'|'balanced'|'vivid'} */
|
|
64
90
|
export declare function normalizeAuroraIntensity(value: unknown): 'subtle' | 'balanced' | 'vivid';
|
|
65
91
|
/** @param {unknown} value @returns {string[]} */
|