@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,103 @@
|
|
|
1
|
+
export type ChartData = import('./chart.js').ChartData;
|
|
2
|
+
export type ChartHandle = import('./chart.js').ChartHandle;
|
|
3
|
+
export type ChartSpec = import('./chart.js').ChartSpec;
|
|
4
|
+
export type SvgChartAdapterOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Whether a chart grows into place the first time it is
|
|
7
|
+
* drawn. Reduced motion stops it whatever this says; `chartOptions.animation` decides per chart.
|
|
8
|
+
*/
|
|
9
|
+
animation?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether a legend is drawn: null draws one for two or
|
|
12
|
+
* more series and for pie and doughnut charts; `chartOptions.legend` decides per chart.
|
|
13
|
+
*/
|
|
14
|
+
legend?: boolean | null;
|
|
15
|
+
};
|
|
16
|
+
export type SeriesModel = {
|
|
17
|
+
/**
|
|
18
|
+
* Index of the dataset.
|
|
19
|
+
*/
|
|
20
|
+
index: number;
|
|
21
|
+
/**
|
|
22
|
+
* The dataset's label, or "Series n".
|
|
23
|
+
*/
|
|
24
|
+
name: string;
|
|
25
|
+
/**
|
|
26
|
+
* One per category; NaN where there is no value.
|
|
27
|
+
*/
|
|
28
|
+
values: number[];
|
|
29
|
+
};
|
|
30
|
+
export type ChartModel = {
|
|
31
|
+
/**
|
|
32
|
+
* One per category.
|
|
33
|
+
*/
|
|
34
|
+
labels: string[];
|
|
35
|
+
/**
|
|
36
|
+
* One per dataset.
|
|
37
|
+
*/
|
|
38
|
+
series: SeriesModel[];
|
|
39
|
+
};
|
|
40
|
+
export type Formats = {
|
|
41
|
+
/**
|
|
42
|
+
* Tick labels.
|
|
43
|
+
*/
|
|
44
|
+
ticks: (ticks: number[], step: number) => (value: number) => string;
|
|
45
|
+
/**
|
|
46
|
+
* A value as the tooltip writes it.
|
|
47
|
+
*/
|
|
48
|
+
value: (value: number) => string;
|
|
49
|
+
/**
|
|
50
|
+
* A share of a pie.
|
|
51
|
+
*/
|
|
52
|
+
percent: (value: number) => string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* @typedef {Object} SeriesModel
|
|
56
|
+
* @property {number} index Index of the dataset.
|
|
57
|
+
* @property {string} name The dataset's label, or "Series n".
|
|
58
|
+
* @property {number[]} values One per category; NaN where there is no value.
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* @typedef {Object} ChartModel
|
|
62
|
+
* @property {string[]} labels One per category.
|
|
63
|
+
* @property {SeriesModel[]} series One per dataset.
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* @typedef {Object} Formats
|
|
67
|
+
* @property {(ticks: number[], step: number) => (value: number) => string} ticks Tick labels.
|
|
68
|
+
* @property {(value: number) => string} value A value as the tooltip writes it.
|
|
69
|
+
* @property {(value: number) => string} percent A share of a pie.
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* A chart engine with no dependency: draws `bar` (grouped), `line`, `pie` and `doughnut` charts as
|
|
73
|
+
* SVG for `Chart`, through the adapter's `mount()` contract. Colours come from the theme's chart
|
|
74
|
+
* palette (`--zx-color-chart-1`…`-8`) through CSS, so a theme or preset switch repaints without a
|
|
75
|
+
* redraw. The drawing is presentational: the chart's canvas keeps its accessible name and
|
|
76
|
+
* description, and its summary table carries the values.
|
|
77
|
+
*
|
|
78
|
+
* `Surface` draws its `chart` nodes with a shared instance unless the application passes another
|
|
79
|
+
* adapter, or `null` for the data table alone.
|
|
80
|
+
*/
|
|
81
|
+
export declare class SvgChartAdapter {
|
|
82
|
+
/** @type {Readonly<Required<SvgChartAdapterOptions>>} */
|
|
83
|
+
options: Readonly<Required<SvgChartAdapterOptions>>;
|
|
84
|
+
/**
|
|
85
|
+
* @param {SvgChartAdapterOptions} [options={}] Defaults for every chart the adapter draws.
|
|
86
|
+
*/
|
|
87
|
+
constructor(options?: SvgChartAdapterOptions);
|
|
88
|
+
/**
|
|
89
|
+
* Whether the adapter draws a chart type: `bar`, `line`, `pie` or `doughnut`.
|
|
90
|
+
* @param {string} type Chart type.
|
|
91
|
+
* @returns {boolean}
|
|
92
|
+
*/
|
|
93
|
+
static supports(type: string): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Draws one chart into the viewport Chart hands over and returns its lifecycle handle. The
|
|
96
|
+
* handle's `instance` is the drawing element.
|
|
97
|
+
* @param {HTMLElement} viewport The chart's viewport; the drawing is appended to it and removed
|
|
98
|
+
* by the handle's `destroy()`.
|
|
99
|
+
* @param {ChartSpec} spec Initial chart specification.
|
|
100
|
+
* @returns {ChartHandle}
|
|
101
|
+
*/
|
|
102
|
+
mount(viewport: HTMLElement, spec: ChartSpec): ChartHandle;
|
|
103
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry for `SvgChartAdapter`: a value scale with round ticks, the bars of a category, how
|
|
3
|
+
* often a category label fits, a line with gaps, and the slices and rings of a pie.
|
|
4
|
+
*
|
|
5
|
+
* Plain numbers in, plain numbers and SVG path strings out — no DOM — so the arithmetic is tested
|
|
6
|
+
* on its own (`tests/unit/chart-svg.test.js`). Angles are radians clockwise from twelve o'clock,
|
|
7
|
+
* the way a pie is read; coordinates are SVG user units, y growing downwards. Path coordinates are
|
|
8
|
+
* rounded to two decimals, which is finer than any screen draws and keeps the markup short.
|
|
9
|
+
* @module zx/components/chart/svg-geometry
|
|
10
|
+
*/
|
|
11
|
+
export type NiceScale = {
|
|
12
|
+
/**
|
|
13
|
+
* The lowest tick, at or below the lowest value.
|
|
14
|
+
*/
|
|
15
|
+
min: number;
|
|
16
|
+
/**
|
|
17
|
+
* The highest tick, at or above the highest value.
|
|
18
|
+
*/
|
|
19
|
+
max: number;
|
|
20
|
+
/**
|
|
21
|
+
* The distance between ticks: 1, 2 or 5 × 10ⁿ.
|
|
22
|
+
*/
|
|
23
|
+
step: number;
|
|
24
|
+
/**
|
|
25
|
+
* Every tick from `min` to `max`, distinct and free of float noise
|
|
26
|
+
* (0.3, not 0.30000000000000004).
|
|
27
|
+
*/
|
|
28
|
+
ticks: number[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {Object} NiceScale
|
|
32
|
+
* @property {number} min The lowest tick, at or below the lowest value.
|
|
33
|
+
* @property {number} max The highest tick, at or above the highest value.
|
|
34
|
+
* @property {number} step The distance between ticks: 1, 2 or 5 × 10ⁿ.
|
|
35
|
+
* @property {number[]} ticks Every tick from `min` to `max`, distinct and free of float noise
|
|
36
|
+
* (0.3, not 0.30000000000000004).
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* A linear scale over `[min, max]`, widened outwards to round ticks. A range of one value is
|
|
40
|
+
* widened to zero (or to one when the value is zero), so a flat series still sits on an axis;
|
|
41
|
+
* values that are not finite count as zero. Any finite bounds give a few distinct ticks: the step
|
|
42
|
+
* is never finer than the values can tell apart, and an outer tick a double cannot hold is the
|
|
43
|
+
* largest one it can.
|
|
44
|
+
* @param {number} min Lowest value.
|
|
45
|
+
* @param {number} max Highest value.
|
|
46
|
+
* @param {number} [count=5] About how many intervals the scale should have, 1 to 50.
|
|
47
|
+
* @returns {NiceScale}
|
|
48
|
+
*/
|
|
49
|
+
export declare function niceScale(min: number, max: number, count?: number): NiceScale;
|
|
50
|
+
/**
|
|
51
|
+
* The round step nearest `raw`: 1, 2 or 5 × 10ⁿ, choosing at the geometric midpoints between
|
|
52
|
+
* them, as most axis libraries do.
|
|
53
|
+
* @param {number} raw Unrounded step, positive.
|
|
54
|
+
* @returns {number}
|
|
55
|
+
*/
|
|
56
|
+
export declare function niceStep(raw: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* Maps a value of `[min, max]` to a position of `[from, to]`; the range may run backwards, as a
|
|
59
|
+
* vertical axis does.
|
|
60
|
+
* @param {number} min Domain start.
|
|
61
|
+
* @param {number} max Domain end.
|
|
62
|
+
* @param {number} from Position of `min`.
|
|
63
|
+
* @param {number} to Position of `max`.
|
|
64
|
+
* @returns {(value: number) => number}
|
|
65
|
+
*/
|
|
66
|
+
export declare function linearScale(min: number, max: number, from: number, to: number): (value: number) => number;
|
|
67
|
+
export type BarSlot = {
|
|
68
|
+
/**
|
|
69
|
+
* Left edge.
|
|
70
|
+
*/
|
|
71
|
+
x: number;
|
|
72
|
+
/**
|
|
73
|
+
* Width, never more than its slot.
|
|
74
|
+
*/
|
|
75
|
+
width: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @typedef {Object} BarSlot
|
|
79
|
+
* @property {number} x Left edge.
|
|
80
|
+
* @property {number} width Width, never more than its slot.
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Where the bars of one category go: `count` series side by side across the middle 80% of the
|
|
84
|
+
* band, each bar 90% of its slot (at least one unit where the slot has room) and at most
|
|
85
|
+
* `maxWidth` wide, the group centred in the band. A bar never leaves its slot, so in a band too
|
|
86
|
+
* narrow for whole pixels the bars grow thin rather than paint over each other.
|
|
87
|
+
* @param {number} start Left edge of the band.
|
|
88
|
+
* @param {number} band Width of the band.
|
|
89
|
+
* @param {number} count Series in the group, at least 1.
|
|
90
|
+
* @param {number} [maxWidth=Infinity] Widest a bar may be.
|
|
91
|
+
* @returns {BarSlot[]}
|
|
92
|
+
*/
|
|
93
|
+
export declare function barSlots(start: number, band: number, count: number, maxWidth?: number): BarSlot[];
|
|
94
|
+
/**
|
|
95
|
+
* Every how many categories a label is written so that none overlaps the next: 1 when the
|
|
96
|
+
* widest label and a gap fit in one band, more as bands get narrow.
|
|
97
|
+
* @param {number} widest Width of the widest label.
|
|
98
|
+
* @param {number} band Width of one category.
|
|
99
|
+
* @param {number} [gap=0] Least space between two labels.
|
|
100
|
+
* @returns {number} A whole number, at least 1.
|
|
101
|
+
*/
|
|
102
|
+
export declare function labelStep(widest: number, band: number, gap?: number): number;
|
|
103
|
+
/**
|
|
104
|
+
* A polyline through the points, broken where a point is missing: each run of points starts a
|
|
105
|
+
* new subpath, so a gap in the data is a gap in the line.
|
|
106
|
+
* @param {Array<[number, number]|null>} points Positions in order; null where there is no value.
|
|
107
|
+
* @returns {string} SVG path data; empty for no points.
|
|
108
|
+
*/
|
|
109
|
+
export declare function linePath(points: Array<[number, number] | null>): string;
|
|
110
|
+
export type ArcSlice = {
|
|
111
|
+
/**
|
|
112
|
+
* Position of the value in the list.
|
|
113
|
+
*/
|
|
114
|
+
index: number;
|
|
115
|
+
/**
|
|
116
|
+
* The value.
|
|
117
|
+
*/
|
|
118
|
+
value: number;
|
|
119
|
+
/**
|
|
120
|
+
* The value's part of the whole, 0 to 1.
|
|
121
|
+
*/
|
|
122
|
+
share: number;
|
|
123
|
+
/**
|
|
124
|
+
* Start angle.
|
|
125
|
+
*/
|
|
126
|
+
start: number;
|
|
127
|
+
/**
|
|
128
|
+
* End angle.
|
|
129
|
+
*/
|
|
130
|
+
end: number;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* @typedef {Object} ArcSlice
|
|
134
|
+
* @property {number} index Position of the value in the list.
|
|
135
|
+
* @property {number} value The value.
|
|
136
|
+
* @property {number} share The value's part of the whole, 0 to 1.
|
|
137
|
+
* @property {number} start Start angle.
|
|
138
|
+
* @property {number} end End angle.
|
|
139
|
+
*/
|
|
140
|
+
/**
|
|
141
|
+
* The slices of a pie: one per positive value, in order clockwise from twelve o'clock, each
|
|
142
|
+
* sweeping its share of the circle. Zero, negative and non-finite values have no slice. With two
|
|
143
|
+
* slices or more, each gives up `padAngle` (half at either edge, never more than half its sweep)
|
|
144
|
+
* so neighbours stand apart whatever lies behind the chart. Shares are taken relative to the
|
|
145
|
+
* largest value, so values whose sum a double cannot hold (1e308 twice) still divide the circle.
|
|
146
|
+
* @param {unknown[]} values Values.
|
|
147
|
+
* @param {number} [padAngle=0] Gap between slices.
|
|
148
|
+
* @returns {ArcSlice[]} Empty when no value is positive.
|
|
149
|
+
*/
|
|
150
|
+
export declare function arcSlices(values: unknown[], padAngle?: number): ArcSlice[];
|
|
151
|
+
export type Ring = {
|
|
152
|
+
/**
|
|
153
|
+
* Outer radius.
|
|
154
|
+
*/
|
|
155
|
+
outer: number;
|
|
156
|
+
/**
|
|
157
|
+
* Inner radius; 0 for the centre of a pie.
|
|
158
|
+
*/
|
|
159
|
+
inner: number;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* @typedef {Object} Ring
|
|
163
|
+
* @property {number} outer Outer radius.
|
|
164
|
+
* @property {number} inner Inner radius; 0 for the centre of a pie.
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* The rings of a pie or doughnut with several datasets, outermost first: equal thickness between
|
|
168
|
+
* `radius` and the hole, `gap` apart. The gap gives up at most half a ring's share of the radius,
|
|
169
|
+
* so however many datasets there are, each keeps a ring of its own.
|
|
170
|
+
* @param {number} count Rings, at least 1.
|
|
171
|
+
* @param {number} radius Outer radius of the outermost ring.
|
|
172
|
+
* @param {number} [hole=0] Radius of the hole as a fraction of `radius`: 0 for a pie.
|
|
173
|
+
* @param {number} [gap=0] Space between neighbouring rings.
|
|
174
|
+
* @returns {Ring[]}
|
|
175
|
+
*/
|
|
176
|
+
export declare function ringRadii(count: number, radius: number, hole?: number, gap?: number): Ring[];
|
|
177
|
+
/**
|
|
178
|
+
* The outline of a slice: a wedge from the centre when `inner` is 0, a band of a ring otherwise.
|
|
179
|
+
* A sweep of the whole circle is drawn as two half circles (an arc command cannot close on its
|
|
180
|
+
* own start), the hole of a ring the other way round so the default fill rule leaves it empty.
|
|
181
|
+
* @param {number} cx Centre x.
|
|
182
|
+
* @param {number} cy Centre y.
|
|
183
|
+
* @param {number} outer Outer radius.
|
|
184
|
+
* @param {number} inner Inner radius.
|
|
185
|
+
* @param {number} start Start angle.
|
|
186
|
+
* @param {number} end End angle.
|
|
187
|
+
* @returns {string} SVG path data; empty when there is nothing to draw.
|
|
188
|
+
*/
|
|
189
|
+
export declare function arcPath(cx: number, cy: number, outer: number, inner: number, start: number, end: number): string;
|
|
190
|
+
/**
|
|
191
|
+
* The point at `radius` from the centre, `angle` clockwise from twelve o'clock.
|
|
192
|
+
* @param {number} cx @param {number} cy @param {number} radius @param {number} angle
|
|
193
|
+
* @returns {[number, number]}
|
|
194
|
+
*/
|
|
195
|
+
export declare function polar(cx: number, cy: number, radius: number, angle: number): [number, number];
|
|
196
|
+
/**
|
|
197
|
+
* Significant digits a tick label needs so that no two ticks read alike: enough for the largest
|
|
198
|
+
* tick's magnitude down to the step's, whatever unit a compact number format abbreviates to.
|
|
199
|
+
* @param {number[]} ticks Ticks of a `niceScale()`.
|
|
200
|
+
* @param {number} step Its step.
|
|
201
|
+
* @returns {number} 1 to 21.
|
|
202
|
+
*/
|
|
203
|
+
export declare function tickPrecision(ticks: number[], step: number): number;
|
|
@@ -38,10 +38,7 @@ export type CheckButtonOptions = {
|
|
|
38
38
|
*/
|
|
39
39
|
export declare class CheckButton extends Component<CheckButtonOptions> {
|
|
40
40
|
_createdRoot: boolean;
|
|
41
|
-
_original:
|
|
42
|
-
attributes: [string, string][];
|
|
43
|
-
children: Node[];
|
|
44
|
-
};
|
|
41
|
+
_original: import("../../core/dom.js").TargetSnapshot;
|
|
45
42
|
_checked: any;
|
|
46
43
|
_disabled: boolean;
|
|
47
44
|
_labels: {
|
|
@@ -29,6 +29,15 @@ export type ChecklistOptions = {
|
|
|
29
29
|
* Fallback initial checked state.
|
|
30
30
|
*/
|
|
31
31
|
defaultChecked?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Heading text, which is also the group's accessible name;
|
|
34
|
+
* null uses the `checklist.label` message.
|
|
35
|
+
*/
|
|
36
|
+
label?: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the search field and every checkbox are disabled.
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean;
|
|
32
41
|
/**
|
|
33
42
|
* Whether the heading is left out. The group keeps the
|
|
34
43
|
* heading text as its accessible name (`aria-label`); a Field labelling the checklist names it
|
|
@@ -68,6 +77,9 @@ export type ChecklistLoadedDetail = {
|
|
|
68
77
|
* @property {boolean} [search=true] Whether the search field is shown.
|
|
69
78
|
* @property {number} [height=280] Maximum list height in pixels.
|
|
70
79
|
* @property {boolean} [defaultChecked=false] Fallback initial checked state.
|
|
80
|
+
* @property {string|null} [label=null] Heading text, which is also the group's accessible name;
|
|
81
|
+
* null uses the `checklist.label` message.
|
|
82
|
+
* @property {boolean} [disabled=false] Whether the search field and every checkbox are disabled.
|
|
71
83
|
* @property {boolean} [hideLabel=false] Whether the heading is left out. The group keeps the
|
|
72
84
|
* heading text as its accessible name (`aria-label`); a Field labelling the checklist names it
|
|
73
85
|
* instead, which is why the `checklist` field type sets this.
|
|
@@ -89,27 +101,49 @@ export declare class Checklist extends Component<ChecklistOptions> {
|
|
|
89
101
|
_items: any[] | ChecklistItem[];
|
|
90
102
|
_visibleItems: any[];
|
|
91
103
|
_checked: Set<any> | Set<unknown>;
|
|
104
|
+
_pending: any;
|
|
92
105
|
_query: string;
|
|
93
106
|
_loadSequence: number;
|
|
94
107
|
_createdRoot: boolean;
|
|
95
108
|
_active: boolean;
|
|
96
109
|
_originalChildren: any[] | ChildNode[];
|
|
97
110
|
_originalAttributes: Map<any, any>;
|
|
111
|
+
_disabled: boolean;
|
|
98
112
|
static cssName: string;
|
|
99
113
|
/** @type {ChecklistOptions} */
|
|
100
114
|
static defaults: ChecklistOptions;
|
|
101
115
|
/** @returns {HTMLElement} */
|
|
102
116
|
render(): HTMLElement;
|
|
103
117
|
/**
|
|
104
|
-
* Replaces items and derives checked state from `checkedKey` and `defaultChecked
|
|
118
|
+
* Replaces items and derives checked state from `checkedKey` and `defaultChecked` — unless
|
|
119
|
+
* `setValues()` asked for IDs the earlier items did not have yet, in which case the requested
|
|
120
|
+
* values are checked instead.
|
|
105
121
|
* @param {ChecklistItem[]} items New items.
|
|
106
122
|
* @returns {this}
|
|
107
123
|
*/
|
|
108
124
|
setItems(items: ChecklistItem[]): this;
|
|
109
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* Replaces the heading text, which is also the group's accessible name.
|
|
127
|
+
* @param {string|null} label New label; null restores the `checklist.label` message.
|
|
128
|
+
* @returns {this}
|
|
129
|
+
*/
|
|
130
|
+
setLabel(label: string | null): this;
|
|
131
|
+
/** Enables the search field and the checkboxes. @returns {this} */
|
|
132
|
+
enable(): this;
|
|
133
|
+
/** Disables the search field and the checkboxes; values can still be set programmatically. @returns {this} */
|
|
134
|
+
disable(): this;
|
|
135
|
+
/** Whether the checklist is disabled. @returns {boolean} */
|
|
136
|
+
isDisabled(): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Returns checked IDs in item order, followed by requested IDs whose items have not been loaded
|
|
139
|
+
* yet (see `setValues()`).
|
|
140
|
+
* @returns {unknown[]}
|
|
141
|
+
*/
|
|
110
142
|
getValues(): unknown[];
|
|
111
143
|
/**
|
|
112
|
-
* Replaces the checked IDs.
|
|
144
|
+
* Replaces the checked IDs. IDs that none of the current items carries are kept as requested,
|
|
145
|
+
* and checked as soon as items carrying them arrive — through `setItems()` or the `load`
|
|
146
|
+
* loader — so a value set before the items load is not lost.
|
|
113
147
|
* @param {Iterable<unknown>|unknown[]} ids Checked item IDs.
|
|
114
148
|
* @returns {this}
|
|
115
149
|
* @fires Checklist#change
|
|
@@ -137,8 +171,17 @@ export declare class Checklist extends Component<ChecklistOptions> {
|
|
|
137
171
|
_replaceItems(items: ChecklistItem[]): void;
|
|
138
172
|
/** @returns {void} */
|
|
139
173
|
_renderItems(): void;
|
|
140
|
-
/** @
|
|
141
|
-
|
|
174
|
+
/** @returns {void} */
|
|
175
|
+
_syncDisabled(): void;
|
|
176
|
+
/** @param {string|null|undefined} label @returns {string} */
|
|
177
|
+
_labelText(label: string | null | undefined): string;
|
|
178
|
+
/**
|
|
179
|
+
* @param {Set<unknown>} next
|
|
180
|
+
* @param {unknown[]|null} pending Requested IDs no item carries yet, or null when no request waits
|
|
181
|
+
* for items; an empty array is a request made before any item existed.
|
|
182
|
+
* @returns {void}
|
|
183
|
+
*/
|
|
184
|
+
_replaceChecked(next: Set<unknown>, pending: unknown[] | null): void;
|
|
142
185
|
/** @param {ChecklistItem} item @returns {unknown} */
|
|
143
186
|
_itemValue(item: ChecklistItem): unknown;
|
|
144
187
|
/** @param {ChecklistItem} item @returns {string} */
|
|
@@ -26,7 +26,13 @@ export type CodeEditorOptions = {
|
|
|
26
26
|
*/
|
|
27
27
|
rows?: number;
|
|
28
28
|
/**
|
|
29
|
-
* Text inserted by Tab and removed by Shift+Tab
|
|
29
|
+
* Text inserted by Tab and removed by Shift+Tab — a tab by
|
|
30
|
+
* default, `' '` for two spaces. While it is non-empty the editor captures Tab: Tab inserts it at
|
|
31
|
+
* the caret or indents every selected line, Shift+Tab outdents them, and focus stays in the
|
|
32
|
+
* editor. Escape releases the capture for the next keystroke, so Escape then Tab (or Shift+Tab)
|
|
33
|
+
* moves focus on. `indent: ''` switches the capture off: Tab and Shift+Tab move focus as in any
|
|
34
|
+
* other field and nothing is indented. Tab with Ctrl, Alt or Meta, and Tab in a read-only or
|
|
35
|
+
* disabled editor, are never captured.
|
|
30
36
|
*/
|
|
31
37
|
indent?: string;
|
|
32
38
|
/**
|
|
@@ -61,6 +67,13 @@ export type CodeEditorOptions = {
|
|
|
61
67
|
onchange?: (event: CustomEvent<{
|
|
62
68
|
value: string;
|
|
63
69
|
}>) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Listener called when
|
|
72
|
+
* `setHighlight()` puts the editor in its error state.
|
|
73
|
+
*/
|
|
74
|
+
oninvalid?: (event: CustomEvent<{
|
|
75
|
+
message: string;
|
|
76
|
+
}>) => void;
|
|
64
77
|
};
|
|
65
78
|
/**
|
|
66
79
|
* Dependency-free source editor for structured text, Markdown, JSON and code. It deliberately uses
|
|
@@ -70,8 +83,13 @@ export type CodeEditorOptions = {
|
|
|
70
83
|
* Capturing Tab is what a code surface has to do, and it would be a keyboard trap if nothing undid
|
|
71
84
|
* it: Escape releases the capture until the next keystroke in the editor, so Escape then Tab (or
|
|
72
85
|
* Shift+Tab) moves focus out of the editor as it would leave any other field.
|
|
86
|
+
*
|
|
87
|
+
* A standalone editor reports a validation or status message the way a Field does, with
|
|
88
|
+
* `setHighlight()` and `clearHighlight()`. Inside a Field (the `code` field type) the Field's own
|
|
89
|
+
* message is the one to set; it marks the editor's textarea invalid and the frame follows.
|
|
73
90
|
* @fires CodeEditor#input
|
|
74
91
|
* @fires CodeEditor#change
|
|
92
|
+
* @fires CodeEditor#invalid
|
|
75
93
|
* @extends {Component<CodeEditorOptions>}
|
|
76
94
|
*/
|
|
77
95
|
export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
@@ -83,6 +101,7 @@ export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
|
83
101
|
_position: HTMLElement;
|
|
84
102
|
_header: HTMLElement;
|
|
85
103
|
_input: HTMLTextAreaElement;
|
|
104
|
+
_highlight: HTMLElement;
|
|
86
105
|
_committedValue: any;
|
|
87
106
|
_indentEditing: boolean;
|
|
88
107
|
/** Set by Escape: the next Tab moves focus instead of indenting. */
|
|
@@ -105,6 +124,29 @@ export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
|
105
124
|
}): this;
|
|
106
125
|
/** @param {unknown} language New language identifier. @returns {this} */
|
|
107
126
|
setLanguage(language: unknown): this;
|
|
127
|
+
/**
|
|
128
|
+
* Returns the native textarea — the element that carries the editor's name, validity and
|
|
129
|
+
* description, and the one a `<label for>` or a Field labels.
|
|
130
|
+
* @returns {HTMLTextAreaElement}
|
|
131
|
+
*/
|
|
132
|
+
getInput(): HTMLTextAreaElement;
|
|
133
|
+
/**
|
|
134
|
+
* Displays a validation or status message under the text, as `Field#setHighlight()` does for a
|
|
135
|
+
* field: the kind is reflected as `data-state` on the root, and `'danger'` is the error state —
|
|
136
|
+
* the textarea gets `aria-invalid="true"`, the message is announced as an alert, the frame takes
|
|
137
|
+
* the danger colour, and `invalid` is emitted. The message is the textarea's description
|
|
138
|
+
* (`aria-describedby`) for as long as it is shown. An empty message clears it.
|
|
139
|
+
* @param {string} message Message text.
|
|
140
|
+
* @param {'danger'|'warning'|'success'} [kind='danger'] Message kind.
|
|
141
|
+
* @returns {this}
|
|
142
|
+
* @fires CodeEditor#invalid
|
|
143
|
+
*/
|
|
144
|
+
setHighlight(message: string, kind?: 'danger' | 'warning' | 'success'): this;
|
|
145
|
+
/**
|
|
146
|
+
* Clears the current validation or status message.
|
|
147
|
+
* @returns {this}
|
|
148
|
+
*/
|
|
149
|
+
clearHighlight(): this;
|
|
108
150
|
/** @returns {this} */
|
|
109
151
|
focus(): this;
|
|
110
152
|
/** @returns {this} */
|
|
@@ -115,6 +157,13 @@ export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
|
115
157
|
setReadOnly(value: boolean): this;
|
|
116
158
|
/** @param {KeyboardEvent} event @returns {void} */
|
|
117
159
|
_handleKeydown(event: KeyboardEvent): void;
|
|
160
|
+
/**
|
|
161
|
+
* Adds the message to, or takes it out of, the textarea's `aria-describedby`, leaving any id
|
|
162
|
+
* something else put there (a Field's description) in place.
|
|
163
|
+
* @param {boolean} described Whether the message describes the textarea.
|
|
164
|
+
* @returns {void}
|
|
165
|
+
*/
|
|
166
|
+
_describe(described: boolean): void;
|
|
118
167
|
/** Commits once, whether the browser emits change before blur or the fallback edited text. @returns {void} */
|
|
119
168
|
_commitValue(): void;
|
|
120
169
|
/** @returns {void} */
|
|
@@ -152,3 +201,8 @@ export declare function editorPosition(value: string, start: number, end?: numbe
|
|
|
152
201
|
* @event CodeEditor#change
|
|
153
202
|
* @type {CustomEvent<{value:string}>}
|
|
154
203
|
*/
|
|
204
|
+
/**
|
|
205
|
+
* Emitted when `setHighlight()` puts the editor in its error state (`kind: 'danger'`).
|
|
206
|
+
* @event CodeEditor#invalid
|
|
207
|
+
* @type {CustomEvent<{message:string}>}
|
|
208
|
+
*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
|
+
import { AgentAvatar } from '../agent-avatar/agent-avatar.js';
|
|
3
|
+
import { Dialog } from '../dialog/dialog.js';
|
|
2
4
|
import { Launcher } from '../launcher/launcher.js';
|
|
3
5
|
export type LauncherItem = import('../launcher/launcher.js').LauncherItem;
|
|
4
6
|
export type MentionItem = {
|
|
@@ -18,6 +20,12 @@ export type MentionItem = {
|
|
|
18
20
|
* Icon name drawn before the label.
|
|
19
21
|
*/
|
|
20
22
|
icon?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Draws the item as an
|
|
25
|
+
* agent: its AgentAvatar, still, in place of `icon` — these options, or `true` to derive it from
|
|
26
|
+
* the label. An activity's word joins the option's accessible name.
|
|
27
|
+
*/
|
|
28
|
+
agent?: import('../../internal/app-rail.js').AppNavAgent | true;
|
|
21
29
|
};
|
|
22
30
|
export type MentionSource = {
|
|
23
31
|
/**
|
|
@@ -235,8 +243,9 @@ export type ComposerOptions = {
|
|
|
235
243
|
busy?: boolean;
|
|
236
244
|
/**
|
|
237
245
|
* Whether the send key holds a message back while the agent works.
|
|
238
|
-
* It is sent when the agent is no longer busy, one message each time busy ends, in order
|
|
239
|
-
*
|
|
246
|
+
* It is sent when the agent is no longer busy, one message each time busy ends, in order; busy that
|
|
247
|
+
* ends while the composer is disabled sends when it is enabled again. The queue lives as long as
|
|
248
|
+
* the composer: it is not kept with the draft.
|
|
240
249
|
*/
|
|
241
250
|
queue?: boolean;
|
|
242
251
|
/**
|
|
@@ -398,7 +407,9 @@ export declare function mentionQuery(text: string, caret: number, trigger?: stri
|
|
|
398
407
|
*/
|
|
399
408
|
export declare function filterMentions(items: MentionItem[], query: string): MentionItem[];
|
|
400
409
|
/**
|
|
401
|
-
* The picked mentions whose `@<label>` is still in the text, each once
|
|
410
|
+
* The picked mentions whose `@<label>` is still in the text as a whole mention, each once: not
|
|
411
|
+
* right after a letter or digit (`ann@ledger.example` mentions nobody) and not right before one
|
|
412
|
+
* (`@Annabel` does not mention Ann), in any script — the rule AgentThread marks mentions by.
|
|
402
413
|
* @param {string} text
|
|
403
414
|
* @param {MentionItem[]} mentions Mentions in the order they were picked.
|
|
404
415
|
* @param {string} [trigger='@']
|
|
@@ -497,6 +508,15 @@ export declare function normalizeTools(tools: unknown): ComposerTool[];
|
|
|
497
508
|
*/
|
|
498
509
|
export declare class Composer extends Component<ComposerOptions> {
|
|
499
510
|
_original: import("../../core/dom.js").TargetSnapshot;
|
|
511
|
+
/**
|
|
512
|
+
* The faces of agent mentions, one per item id, reused while the list redraws on every
|
|
513
|
+
* keystroke and destroyed with the composer.
|
|
514
|
+
* @type {Map<string, {signature: string, avatar: AgentAvatar}>}
|
|
515
|
+
*/
|
|
516
|
+
_mentionFaces: Map<string, {
|
|
517
|
+
signature: string;
|
|
518
|
+
avatar: AgentAvatar;
|
|
519
|
+
}>;
|
|
500
520
|
/** @type {{id: string, file: File}[]} */
|
|
501
521
|
_files: {
|
|
502
522
|
id: string;
|
|
@@ -537,6 +557,10 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
537
557
|
/** Whether a queued message is being sent, and whether busy ended again meanwhile. */
|
|
538
558
|
_sendingQueued: boolean;
|
|
539
559
|
_busyEndedAgain: boolean;
|
|
560
|
+
/** Whether busy ended while input was off, so a queued message goes when it is back on. */
|
|
561
|
+
_sendOwed: boolean;
|
|
562
|
+
/** @type {Dialog|null} The question before a queued message replaces the text, while it is open. */
|
|
563
|
+
_confirm: Dialog | null;
|
|
540
564
|
/** The application's hint, which `_syncHint()` shows unless the queue has something to say. */
|
|
541
565
|
_hint: string;
|
|
542
566
|
_mentionSource: {
|
|
@@ -585,7 +609,8 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
585
609
|
clear(): this;
|
|
586
610
|
/**
|
|
587
611
|
* Shows Stop in place of Send while an agent works; Escape in the text then emits `stop`. When
|
|
588
|
-
* busy ends, the first queued message is sent; the next waits for the next time it ends.
|
|
612
|
+
* busy ends, the first queued message is sent; the next waits for the next time it ends. Busy
|
|
613
|
+
* that ends while the composer is disabled sends when it is enabled again.
|
|
589
614
|
* @param {boolean} busy
|
|
590
615
|
* @returns {this}
|
|
591
616
|
* @fires Composer#send
|
|
@@ -609,9 +634,12 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
609
634
|
*/
|
|
610
635
|
setNote(text: string): this;
|
|
611
636
|
/**
|
|
612
|
-
* Turns input on or off.
|
|
637
|
+
* Turns input on or off. Turned back on, it sends the queued message that an end of busy owed
|
|
638
|
+
* while it was off.
|
|
613
639
|
* @param {boolean} disabled
|
|
614
640
|
* @returns {this}
|
|
641
|
+
* @fires Composer#send
|
|
642
|
+
* @fires Composer#dequeue
|
|
615
643
|
*/
|
|
616
644
|
setDisabled(disabled: boolean): this;
|
|
617
645
|
/**
|
|
@@ -763,7 +791,14 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
763
791
|
*/
|
|
764
792
|
private _highlight;
|
|
765
793
|
/** @private @returns {void} */
|
|
766
|
-
|
|
794
|
+
/**
|
|
795
|
+
* The AgentAvatar an agent mention draws, kept per item id and rebuilt only when the item changes.
|
|
796
|
+
* @private
|
|
797
|
+
* @param {MentionItem} item
|
|
798
|
+
* @returns {AgentAvatar|null}
|
|
799
|
+
*/
|
|
800
|
+
private _mentionFace;
|
|
801
|
+
_closeMentions(): void;
|
|
767
802
|
/**
|
|
768
803
|
* Writes `@<label> ` where the mention was typed and records the item.
|
|
769
804
|
* @private
|