@zeyos/zx 5.6.0 → 5.7.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 +154 -0
- package/README.md +73 -7
- package/bin/zx-css.js +328 -0
- package/dist/types/components/account-menu/account-menu.d.ts +4 -2
- package/dist/types/components/activity-list/activity-list.d.ts +14 -8
- package/dist/types/components/agent-thread/ag-ui.d.ts +340 -0
- package/dist/types/components/agent-thread/agent-thread.d.ts +142 -14
- package/dist/types/components/agent-thread/ui-message-stream.d.ts +401 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +14 -8
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +3 -3
- package/dist/types/components/calendar/calendar-model.d.ts +9 -2
- package/dist/types/components/calendar/calendar.d.ts +12 -4
- package/dist/types/components/chart/chart.d.ts +25 -13
- package/dist/types/components/code-editor/code-editor.d.ts +7 -2
- package/dist/types/components/composer/composer.d.ts +206 -4
- package/dist/types/components/composer/queue.d.ts +76 -0
- package/dist/types/components/copy/copy-button.d.ts +6 -4
- package/dist/types/components/copy/copy-input.d.ts +10 -6
- package/dist/types/components/datebox/date-range-box.d.ts +33 -0
- package/dist/types/components/datebox/placeholder.d.ts +7 -0
- package/dist/types/components/dock/dock.d.ts +12 -3
- package/dist/types/components/entity-ref/entity-ref.d.ts +5 -3
- package/dist/types/components/field-upload/field-upload.d.ts +3 -2
- package/dist/types/components/file-item/file-item.d.ts +3 -2
- package/dist/types/components/file-list/file-list.d.ts +14 -8
- package/dist/types/components/filter/filter-model.d.ts +31 -1
- package/dist/types/components/filter/filter.d.ts +20 -2
- package/dist/types/components/finder/finder.d.ts +14 -6
- package/dist/types/components/flag/flag.d.ts +99 -0
- package/dist/types/components/grid/grid.d.ts +1 -1
- package/dist/types/components/kanban-view/kanban-view.d.ts +8 -66
- package/dist/types/components/launcher/launcher.d.ts +2 -0
- package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +3 -2
- package/dist/types/components/number-field/number-field.d.ts +17 -6
- package/dist/types/components/prompt-starters/prompt-starters.d.ts +107 -0
- package/dist/types/components/prose/prose.d.ts +9 -6
- package/dist/types/components/questionnaire/conditions.d.ts +270 -0
- package/dist/types/components/questionnaire/items.d.ts +52 -30
- package/dist/types/components/questionnaire/questionnaire.d.ts +44 -4
- package/dist/types/components/rating/rating.d.ts +5 -3
- package/dist/types/components/select/country.d.ts +106 -0
- package/dist/types/components/select/field-adapter.d.ts +2 -1
- package/dist/types/components/select/locale.d.ts +102 -0
- package/dist/types/components/select/select.d.ts +41 -2
- package/dist/types/components/slider/slider.d.ts +1 -0
- package/dist/types/components/sort-control/sort-control.d.ts +7 -3
- package/dist/types/components/source-list/source-list.d.ts +7 -5
- package/dist/types/components/split-view/split-view.d.ts +5 -3
- package/dist/types/components/surface/catalog.d.ts +260 -0
- package/dist/types/components/surface/elicit.d.ts +81 -0
- package/dist/types/components/surface/mcp.d.ts +165 -0
- package/dist/types/components/surface/schema.d.ts +314 -0
- package/dist/types/components/surface/stream.d.ts +118 -0
- package/dist/types/components/surface/surface.d.ts +718 -0
- package/dist/types/components/surface/text.d.ts +277 -0
- package/dist/types/components/surface/validate.d.ts +339 -0
- package/dist/types/components/table/table.d.ts +55 -3
- package/dist/types/components/table/window.d.ts +203 -0
- package/dist/types/components/toolbar/toolbar.d.ts +10 -6
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tree/tree.d.ts +20 -13
- package/dist/types/core/component.d.ts +10 -0
- package/dist/types/core/date.d.ts +8 -1
- package/dist/types/core/dom.d.ts +1 -0
- package/dist/types/core/http.d.ts +10 -0
- package/dist/types/core/i18n.d.ts +38 -0
- package/dist/types/core/messages.d.ts +344 -1
- package/dist/types/core/storage.d.ts +7 -2
- package/dist/types/elements/define.d.ts +21 -46
- package/dist/types/elements/definitions.d.ts +147 -0
- package/dist/types/elements/kit.d.ts +7 -0
- package/dist/types/elements/reflect.d.ts +6 -3
- package/dist/types/index.d.ts +10 -1
- package/dist/types/internal/date-locale.d.ts +7 -0
- package/dist/types/internal/json-patch.d.ts +146 -0
- package/dist/types/locales/de.d.ts +13 -0
- package/dist/types/locales/en.d.ts +2 -0
- package/dist/types/locales/index.d.ts +823 -0
- package/dist/types/zeyos/view.d.ts +8 -1
- package/dist/zx-zeyos.esm.js +16802 -15180
- package/dist/zx-zeyos.esm.min.js +5 -5
- package/dist/zx.core.css +1276 -0
- package/dist/zx.core.min.css +1 -0
- package/dist/zx.css +498 -134
- package/dist/zx.esm.js +40778 -29654
- package/dist/zx.esm.min.js +36 -23
- package/dist/zx.global.js +40778 -29654
- package/dist/zx.global.min.js +36 -23
- package/dist/zx.layered.css +17302 -0
- package/dist/zx.layered.min.css +1 -0
- package/dist/zx.min.css +1 -1
- package/docs/agent-catalog.json +12501 -0
- package/docs/agent-surfaces.md +340 -0
- package/docs/api.json +851 -121
- package/docs/llms.md +1018 -71
- package/docs/llms.txt +30 -9
- package/package.json +29 -6
- package/src/components/account-menu/account-menu.js +6 -3
- package/src/components/activity-item/activity-item.js +2 -1
- package/src/components/activity-list/activity-list.js +16 -10
- package/src/components/agent-thread/ag-ui.js +1439 -0
- package/src/components/agent-thread/agent-thread.js +359 -54
- package/src/components/agent-thread/ui-message-stream.js +1281 -0
- package/src/components/app-sidebar/app-sidebar.js +18 -8
- package/src/components/approval-card/approval-card.js +3 -2
- package/src/components/block-view/block-view.js +7 -6
- package/src/components/breadcrumb/breadcrumb.js +8 -5
- package/src/components/calendar/calendar-model.js +8 -2
- package/src/components/calendar/calendar.js +53 -18
- package/src/components/chart/chart.js +54 -23
- package/src/components/code-editor/code-editor.js +45 -8
- package/src/components/code-editor/field-adapter.js +1 -1
- package/src/components/composer/composer.css +80 -1
- package/src/components/composer/composer.js +390 -16
- package/src/components/composer/queue.js +78 -0
- package/src/components/context-menu/context-menu.js +12 -1
- package/src/components/copy/copy-button.js +9 -7
- package/src/components/copy/copy-input.js +10 -6
- package/src/components/date-picker/date-picker.js +2 -1
- package/src/components/date-picker/date-range-picker.js +8 -7
- package/src/components/datebox/date-range-box.js +3 -9
- package/src/components/datebox/datebox.js +18 -21
- package/src/components/datebox/placeholder.js +18 -0
- package/src/components/dialog/dialog.js +1 -1
- package/src/components/dock/dock.js +34 -13
- package/src/components/entity-ref/entity-ref.js +16 -5
- package/src/components/field-upload/field-upload.js +81 -38
- package/src/components/file-item/file-item.js +70 -40
- package/src/components/file-list/file-list.js +15 -9
- package/src/components/filter/filter-model.js +46 -8
- package/src/components/filter/filter.css +3 -3
- package/src/components/filter/filter.js +29 -10
- package/src/components/filter-panel/filter-panel.js +13 -5
- package/src/components/finder/finder.js +50 -26
- package/src/components/flag/flag.css +40 -0
- package/src/components/flag/flag.js +177 -0
- package/src/components/form/form.js +1 -1
- package/src/components/grid/grid.js +22 -8
- package/src/components/kanban-view/kanban-view.js +51 -81
- package/src/components/launcher/launcher.js +17 -2
- package/src/components/list-toolbar/list-toolbar.js +2 -1
- package/src/components/master-panel/master-panel.js +1 -1
- package/src/components/menu-button/menu-button.js +4 -0
- package/src/components/message/message.js +3 -0
- package/src/components/multi-value-editor/multi-value-editor.js +10 -9
- package/src/components/navigation-bar/navigation-bar.js +3 -3
- package/src/components/number-field/number-field.js +29 -13
- package/src/components/prompt-starters/prompt-starters.css +91 -0
- package/src/components/prompt-starters/prompt-starters.js +206 -0
- package/src/components/prose/prose.js +14 -10
- package/src/components/questionnaire/conditions.js +666 -0
- package/src/components/questionnaire/items.js +150 -41
- package/src/components/questionnaire/questionnaire.js +126 -32
- package/src/components/rating/rating.js +5 -4
- package/src/components/run-status/run-status.js +2 -2
- package/src/components/select/country.js +136 -0
- package/src/components/select/field-adapter.js +7 -2
- package/src/components/select/locale.js +219 -0
- package/src/components/select/select.css +20 -22
- package/src/components/select/select.js +94 -12
- package/src/components/sheet/sheet-stack.js +10 -1
- package/src/components/slider/slider.js +7 -2
- package/src/components/sort-control/sort-control.js +15 -5
- package/src/components/source-list/source-list.js +7 -4
- package/src/components/split-view/split-view.js +5 -3
- package/src/components/surface/catalog.js +1334 -0
- package/src/components/surface/elicit.js +107 -0
- package/src/components/surface/mcp.js +243 -0
- package/src/components/surface/schema.js +644 -0
- package/src/components/surface/stream.js +245 -0
- package/src/components/surface/surface.css +308 -0
- package/src/components/surface/surface.js +2291 -0
- package/src/components/surface/text.js +513 -0
- package/src/components/surface/validate.js +2218 -0
- package/src/components/tabbox/tabbox.js +9 -0
- package/src/components/table/table.css +63 -3
- package/src/components/table/table.js +167 -28
- package/src/components/table/window.js +317 -0
- package/src/components/toolbar/toolbar.js +12 -7
- package/src/components/tooltip/tooltip.css +2 -3
- package/src/components/tooltip/tooltip.js +32 -5
- package/src/components/tree/tree.js +53 -23
- package/src/core/component.js +25 -1
- package/src/core/date.js +62 -16
- package/src/core/dom.js +22 -2
- package/src/core/format.js +15 -13
- package/src/core/http.js +29 -20
- package/src/core/i18n.js +83 -10
- package/src/core/keyboard.js +79 -8
- package/src/core/messages.js +376 -2
- package/src/core/overlay-host.js +1 -0
- package/src/core/storage.js +59 -6
- package/src/elements/define.js +178 -130
- package/src/elements/definitions.js +229 -0
- package/src/elements/kit.js +444 -0
- package/src/elements/reflect.js +8 -3
- package/src/index.js +10 -1
- package/src/internal/date-locale.js +11 -0
- package/src/internal/json-patch.js +405 -0
- package/src/locales/de.js +911 -0
- package/src/locales/en.js +2 -0
- package/src/locales/index.js +7 -0
- package/src/zeyos/calendar.js +2 -1
- package/src/zeyos/form.js +2 -1
- package/src/zeyos/launcher.js +7 -6
- package/src/zeyos/module-bar.js +2 -1
- package/src/zeyos/schema.js +37 -23
- package/src/zeyos/select.js +4 -3
- package/src/zeyos/table.js +2 -13
- package/src/zeyos/view.js +57 -17
- package/styles/core.css +11 -0
- package/styles/tokens/semantic.css +1 -0
- package/styles/zeyos.css +2 -0
- package/styles/zx.css +4 -8
- package/styles/zx.layered.css +1 -0
|
@@ -94,14 +94,16 @@ export type AppSidebarOptions = {
|
|
|
94
94
|
*/
|
|
95
95
|
presentationSwitch?: boolean;
|
|
96
96
|
/**
|
|
97
|
-
* Navigation accessible label.
|
|
97
|
+
* Navigation accessible label, by default the `appSidebar.label`
|
|
98
|
+
* message ("Applications"). Null leaves the navigation unnamed.
|
|
98
99
|
*/
|
|
99
|
-
label?: string;
|
|
100
|
+
label?: string | null;
|
|
100
101
|
/**
|
|
101
|
-
* Name of a destination's overflow menu when its
|
|
102
|
-
*
|
|
102
|
+
* Name of a destination's overflow menu when its `actions`
|
|
103
|
+
* fold; every action name is followed by the destination's label. Null reads the `appSidebar.more`
|
|
104
|
+
* message ("More actions").
|
|
103
105
|
*/
|
|
104
|
-
moreLabel?: string;
|
|
106
|
+
moreLabel?: string | null;
|
|
105
107
|
/**
|
|
106
108
|
* Expanded header content;
|
|
107
109
|
* in the modules layout, content above every module's menu.
|
|
@@ -225,9 +227,11 @@ export type AppSidebarOptions = {
|
|
|
225
227
|
* @property {boolean} [presentationSwitch=true] Modules layout: whether the strip's foot carries the
|
|
226
228
|
* switch between presentations. Turn it off when the choice lives elsewhere — an account menu,
|
|
227
229
|
* through `presentationChoice()`.
|
|
228
|
-
* @property {string} [label
|
|
229
|
-
*
|
|
230
|
-
*
|
|
230
|
+
* @property {string|null} [label] Navigation accessible label, by default the `appSidebar.label`
|
|
231
|
+
* message ("Applications"). Null leaves the navigation unnamed.
|
|
232
|
+
* @property {string|null} [moreLabel=null] Name of a destination's overflow menu when its `actions`
|
|
233
|
+
* fold; every action name is followed by the destination's label. Null reads the `appSidebar.more`
|
|
234
|
+
* message ("More actions").
|
|
231
235
|
* @property {Node|string|number|{toElement: () => Node|null}|null} [header=null] Expanded header content;
|
|
232
236
|
* in the modules layout, content above every module's menu.
|
|
233
237
|
* @property {Node|string|number|{toElement: () => Node|null}|null} [footer=null] Expanded sticky footer content.
|
|
@@ -416,6 +420,8 @@ export declare class AppSidebar extends Component<AppSidebarOptions> {
|
|
|
416
420
|
destroy(): void;
|
|
417
421
|
/** Mounts exactly one expanded tree or minimized flyout presentation. @returns {void} */
|
|
418
422
|
_renderMode(): void;
|
|
423
|
+
/** @returns {string|null} The navigation's name: unset reads the catalogue, and null is no name. */
|
|
424
|
+
_navigationLabel(): string | null;
|
|
419
425
|
/** @returns {void} */
|
|
420
426
|
_renderExpanded(): void;
|
|
421
427
|
/** @returns {HTMLButtonElement} The minimize control of an expanded presentation. */
|
|
@@ -179,10 +179,10 @@ export declare class Breadcrumb extends Component<BreadcrumbOptions> {
|
|
|
179
179
|
_renderSeparator(): HTMLElement;
|
|
180
180
|
/**
|
|
181
181
|
* @param {string|undefined} name Item name from a control's `data-crumb`.
|
|
182
|
-
* @returns {
|
|
182
|
+
* @returns {CustomEvent<BreadcrumbSelectDetail>|undefined}
|
|
183
183
|
* @fires Breadcrumb#select
|
|
184
184
|
*/
|
|
185
|
-
_select(name: string | undefined):
|
|
185
|
+
_select(name: string | undefined): CustomEvent<BreadcrumbSelectDetail> | undefined;
|
|
186
186
|
/**
|
|
187
187
|
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
188
188
|
* @param {string} key Message key.
|
|
@@ -194,7 +194,7 @@ export declare class Breadcrumb extends Component<BreadcrumbOptions> {
|
|
|
194
194
|
}
|
|
195
195
|
/**
|
|
196
196
|
* Fired when an interactive crumb is chosen, from the trail itself or from the overflow menu. A
|
|
197
|
-
* crumb with an `href`
|
|
197
|
+
* crumb with an `href` navigates natively unless the selection is prevented.
|
|
198
198
|
* @event Breadcrumb#select
|
|
199
199
|
* @type {CustomEvent<BreadcrumbSelectDetail>}
|
|
200
200
|
*/
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** @typedef {'agenda'|'day'|'week'|'month'|'year'} CalendarView */
|
|
2
|
-
/** @typedef {string|((record: Record<string, any>) => unknown)} CalendarReader */
|
|
3
1
|
export type CalendarView = 'agenda' | 'day' | 'week' | 'month' | 'year';
|
|
4
2
|
export type CalendarReader = string | ((record: Record<string, any>) => unknown);
|
|
5
3
|
export type CalendarEvent = {
|
|
@@ -85,7 +83,14 @@ export type CalendarNormalizeOptions = {
|
|
|
85
83
|
* Unit used for numeric dates.
|
|
86
84
|
*/
|
|
87
85
|
dateUnit?: 'milliseconds' | 'seconds';
|
|
86
|
+
/**
|
|
87
|
+
* Title of an event without one, by default the `calendar.untitled`
|
|
88
|
+
* message ("Untitled event").
|
|
89
|
+
*/
|
|
90
|
+
untitledTitle?: string;
|
|
88
91
|
};
|
|
92
|
+
/** @typedef {'agenda'|'day'|'week'|'month'|'year'} CalendarView */
|
|
93
|
+
/** @typedef {string|((record: Record<string, any>) => unknown)} CalendarReader */
|
|
89
94
|
/**
|
|
90
95
|
* @typedef {Object} CalendarEvent
|
|
91
96
|
* @property {string|number} id Stable event identifier.
|
|
@@ -111,6 +116,8 @@ export type CalendarNormalizeOptions = {
|
|
|
111
116
|
* @property {CalendarReader} [eventEditable='editable'] Move-policy reader.
|
|
112
117
|
* @property {CalendarReader} [eventDurationEditable='durationEditable'] Resize-policy reader.
|
|
113
118
|
* @property {'milliseconds'|'seconds'} [dateUnit='milliseconds'] Unit used for numeric dates.
|
|
119
|
+
* @property {string} [untitledTitle] Title of an event without one, by default the `calendar.untitled`
|
|
120
|
+
* message ("Untitled event").
|
|
114
121
|
*/
|
|
115
122
|
/** @type {readonly CalendarView[]} */
|
|
116
123
|
export declare const CALENDAR_VIEWS: readonly CalendarView[];
|
|
@@ -20,7 +20,8 @@ export type CalendarOptions = {
|
|
|
20
20
|
*/
|
|
21
21
|
views?: CalendarView[];
|
|
22
22
|
/**
|
|
23
|
-
* Intl locale override.
|
|
23
|
+
* Intl locale override. Unset, dates follow `setLanguage()`, and
|
|
24
|
+
* the browser's language under an English one.
|
|
24
25
|
*/
|
|
25
26
|
locale?: string | string[];
|
|
26
27
|
/**
|
|
@@ -259,7 +260,8 @@ export type CalendarSetOptions = {
|
|
|
259
260
|
* @property {Date|string|number|null} [date=null] Initial local anchor date; null uses today.
|
|
260
261
|
* @property {CalendarView} [view='month'] Initial view.
|
|
261
262
|
* @property {CalendarView[]} [views=['agenda','day','week','month','year']] Allowed views.
|
|
262
|
-
* @property {string|string[]} [locale] Intl locale override.
|
|
263
|
+
* @property {string|string[]} [locale] Intl locale override. Unset, dates follow `setLanguage()`, and
|
|
264
|
+
* the browser's language under an English one.
|
|
263
265
|
* @property {number} [weekStart=1] First weekday, 0 (Sunday) through 6 (Saturday).
|
|
264
266
|
* @property {boolean} [weekNumbers=true] Show ISO week numbers in month view.
|
|
265
267
|
* @property {boolean} [workweek=false] Show Monday–Friday in the week time grid.
|
|
@@ -540,6 +542,8 @@ export declare class Calendar extends Component<CalendarOptions> {
|
|
|
540
542
|
_eventLabel(event: CalendarEvent): string;
|
|
541
543
|
/** @param {Date} date @returns {string} */
|
|
542
544
|
_dateTimeLabel(date: Date): string;
|
|
545
|
+
/** @returns {string|string[]|undefined} The locale this calendar writes its dates in. */
|
|
546
|
+
_locale(): string | string[] | undefined;
|
|
543
547
|
/** @param {Date} date @param {Intl.DateTimeFormatOptions} options @returns {string} */
|
|
544
548
|
_format(date: Date, options: Intl.DateTimeFormatOptions): string;
|
|
545
549
|
/** @returns {Date} */
|
|
@@ -548,19 +552,23 @@ export declare class Calendar extends Component<CalendarOptions> {
|
|
|
548
552
|
_dateFromTarget(target: HTMLElement): Date | null;
|
|
549
553
|
/** @param {HTMLElement} target @returns {void} */
|
|
550
554
|
_rememberFocusedDate(target: HTMLElement): void;
|
|
551
|
-
/** @returns {{eventId?: string, eventAction?: string, date?: string, slot?: string}|null} */
|
|
555
|
+
/** @returns {{eventId?: string, eventAction?: string, date?: string, slot?: string, row?: string, column?: string}|null} */
|
|
552
556
|
_focusIdentity(): {
|
|
553
557
|
eventId?: string;
|
|
554
558
|
eventAction?: string;
|
|
555
559
|
date?: string;
|
|
556
560
|
slot?: string;
|
|
561
|
+
row?: string;
|
|
562
|
+
column?: string;
|
|
557
563
|
} | null;
|
|
558
|
-
/** @param {{eventId?: string, eventAction?: string, date?: string, slot?: string}} identity @returns {void} */
|
|
564
|
+
/** @param {{eventId?: string, eventAction?: string, date?: string, slot?: string, row?: string, column?: string}} identity @returns {void} */
|
|
559
565
|
_restoreFocus(identity: {
|
|
560
566
|
eventId?: string;
|
|
561
567
|
eventAction?: string;
|
|
562
568
|
date?: string;
|
|
563
569
|
slot?: string;
|
|
570
|
+
row?: string;
|
|
571
|
+
column?: string;
|
|
564
572
|
}): void;
|
|
565
573
|
/** @returns {void} */
|
|
566
574
|
_scrollTimeGrid(): void;
|
|
@@ -9,6 +9,7 @@ export type ChartData = {
|
|
|
9
9
|
datasets?: ChartDataset[];
|
|
10
10
|
[key: string]: unknown;
|
|
11
11
|
};
|
|
12
|
+
export type ChartText = (key: string, ...args: unknown[]) => string;
|
|
12
13
|
export type ChartSpec = {
|
|
13
14
|
/**
|
|
14
15
|
* Chart type.
|
|
@@ -99,9 +100,10 @@ export type ChartOptions = {
|
|
|
99
100
|
*/
|
|
100
101
|
chartOptions?: Record<string, unknown>;
|
|
101
102
|
/**
|
|
102
|
-
* Accessible canvas and summary label; blank text
|
|
103
|
+
* Accessible canvas and summary label; null or blank text reads
|
|
104
|
+
* the `chart.label` message ("Chart").
|
|
103
105
|
*/
|
|
104
|
-
label?: string;
|
|
106
|
+
label?: string | null;
|
|
105
107
|
/**
|
|
106
108
|
* Accessible description.
|
|
107
109
|
*/
|
|
@@ -115,17 +117,20 @@ export type ChartOptions = {
|
|
|
115
117
|
*/
|
|
116
118
|
loading?: boolean;
|
|
117
119
|
/**
|
|
118
|
-
* Empty-state text.
|
|
120
|
+
* Empty-state text, by default the `chart.empty` message
|
|
121
|
+
* ("No chart data"). Null shows none.
|
|
119
122
|
*/
|
|
120
|
-
emptyText?: string;
|
|
123
|
+
emptyText?: string | null;
|
|
121
124
|
/**
|
|
122
|
-
* Loading-state text.
|
|
125
|
+
* Loading-state text, by default the `chart.loading` message
|
|
126
|
+
* ("Loading chart…"). Null shows none.
|
|
123
127
|
*/
|
|
124
|
-
loadingText?: string;
|
|
128
|
+
loadingText?: string | null;
|
|
125
129
|
/**
|
|
126
|
-
* Error fallback text.
|
|
130
|
+
* Error fallback text, by default the `chart.error` message
|
|
131
|
+
* ("Unable to render chart"). Null shows none.
|
|
127
132
|
*/
|
|
128
|
-
errorText?: string;
|
|
133
|
+
errorText?: string | null;
|
|
129
134
|
/**
|
|
130
135
|
* Responsive container aspect ratio.
|
|
131
136
|
*/
|
|
@@ -156,6 +161,7 @@ export type ChartOptions = {
|
|
|
156
161
|
};
|
|
157
162
|
/** @typedef {{label?: string, data?: unknown[], [key: string]: unknown}} ChartDataset */
|
|
158
163
|
/** @typedef {{labels?: unknown[], datasets?: ChartDataset[], [key: string]: unknown}} ChartData */
|
|
164
|
+
/** @typedef {(key: string, ...args: unknown[]) => string} ChartText Resolves a message. */
|
|
159
165
|
/**
|
|
160
166
|
* @typedef {Object} ChartSpec
|
|
161
167
|
* @property {string} type Chart type.
|
|
@@ -194,13 +200,17 @@ export type ChartOptions = {
|
|
|
194
200
|
* @property {string} [type='bar'] Chart type passed to the adapter.
|
|
195
201
|
* @property {ChartData} [data={labels: [], datasets: []}] Chart data.
|
|
196
202
|
* @property {Record<string, unknown>} [chartOptions={}] Engine-specific options.
|
|
197
|
-
* @property {string} [label=
|
|
203
|
+
* @property {string|null} [label=null] Accessible canvas and summary label; null or blank text reads
|
|
204
|
+
* the `chart.label` message ("Chart").
|
|
198
205
|
* @property {string} [description=''] Accessible description.
|
|
199
206
|
* @property {'hidden'|'visible'} [summary='hidden'] Semantic data-table presentation.
|
|
200
207
|
* @property {boolean} [loading=false] Initial loading state.
|
|
201
|
-
* @property {string} [emptyText
|
|
202
|
-
*
|
|
203
|
-
* @property {string} [
|
|
208
|
+
* @property {string|null} [emptyText] Empty-state text, by default the `chart.empty` message
|
|
209
|
+
* ("No chart data"). Null shows none.
|
|
210
|
+
* @property {string|null} [loadingText] Loading-state text, by default the `chart.loading` message
|
|
211
|
+
* ("Loading chart…"). Null shows none.
|
|
212
|
+
* @property {string|null} [errorText] Error fallback text, by default the `chart.error` message
|
|
213
|
+
* ("Unable to render chart"). Null shows none.
|
|
204
214
|
* @property {string} [aspectRatio='16 / 9'] Responsive container aspect ratio.
|
|
205
215
|
* @property {(event: CustomEvent<{instance: unknown}>) => void} [onready] Engine-ready listener.
|
|
206
216
|
* @property {(event: CustomEvent<{data: ChartData, type: string}>) => void} [onupdate] Update listener.
|
|
@@ -274,6 +284,8 @@ export declare class Chart extends Component<ChartOptions> {
|
|
|
274
284
|
_destroyHandle(): void;
|
|
275
285
|
/** @returns {void} */
|
|
276
286
|
_syncState(): void;
|
|
287
|
+
/** @returns {string} What an error without a message of its own says. */
|
|
288
|
+
_errorText(): string;
|
|
277
289
|
/** @returns {void} */
|
|
278
290
|
_renderSummary(): void;
|
|
279
291
|
}
|
|
@@ -310,7 +322,7 @@ export declare function isEmptyChartData(data: ChartData): boolean;
|
|
|
310
322
|
/**
|
|
311
323
|
* Builds the semantic table mirrored alongside the canvas.
|
|
312
324
|
* @param {ChartData} data Chart data.
|
|
313
|
-
* @param {string} label Caption.
|
|
325
|
+
* @param {string} [label] Caption, by default the `chart.summary` message ("Chart data").
|
|
314
326
|
* @returns {HTMLTableElement}
|
|
315
327
|
*/
|
|
316
328
|
export declare function chartSummaryTable(data: ChartData, label?: string): HTMLTableElement;
|
|
@@ -13,9 +13,10 @@ export type CodeEditorOptions = {
|
|
|
13
13
|
*/
|
|
14
14
|
language?: string;
|
|
15
15
|
/**
|
|
16
|
-
* Accessible editor label.
|
|
16
|
+
* Accessible editor label; null reads the `codeEditor.label`
|
|
17
|
+
* message ("Code editor").
|
|
17
18
|
*/
|
|
18
|
-
label?: string;
|
|
19
|
+
label?: string | null;
|
|
19
20
|
/**
|
|
20
21
|
* Placeholder text.
|
|
21
22
|
*/
|
|
@@ -82,6 +83,8 @@ export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
|
82
83
|
_position: HTMLElement;
|
|
83
84
|
_header: HTMLElement;
|
|
84
85
|
_input: HTMLTextAreaElement;
|
|
86
|
+
_committedValue: any;
|
|
87
|
+
_indentEditing: boolean;
|
|
85
88
|
/** Set by Escape: the next Tab moves focus instead of indenting. */
|
|
86
89
|
_tabReleased: boolean;
|
|
87
90
|
static cssName: string;
|
|
@@ -112,6 +115,8 @@ export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
|
112
115
|
setReadOnly(value: boolean): this;
|
|
113
116
|
/** @param {KeyboardEvent} event @returns {void} */
|
|
114
117
|
_handleKeydown(event: KeyboardEvent): void;
|
|
118
|
+
/** Commits once, whether the browser emits change before blur or the fallback edited text. @returns {void} */
|
|
119
|
+
_commitValue(): void;
|
|
115
120
|
/** @returns {void} */
|
|
116
121
|
_updatePosition(): void;
|
|
117
122
|
/** @returns {void} */
|
|
@@ -141,6 +141,56 @@ export type ComposerSendDetail = {
|
|
|
141
141
|
* The context chips.
|
|
142
142
|
*/
|
|
143
143
|
context: ContextChip[];
|
|
144
|
+
/**
|
|
145
|
+
* `true` on a message that waited in the queue. Absent otherwise.
|
|
146
|
+
*/
|
|
147
|
+
queued?: boolean;
|
|
148
|
+
};
|
|
149
|
+
export type QueuedMessage = {
|
|
150
|
+
/**
|
|
151
|
+
* Stable identifier, for `removeQueued()`.
|
|
152
|
+
*/
|
|
153
|
+
id: string;
|
|
154
|
+
/**
|
|
155
|
+
* The message, trimmed.
|
|
156
|
+
*/
|
|
157
|
+
text: string;
|
|
158
|
+
/**
|
|
159
|
+
* Attached files, in the order they were added.
|
|
160
|
+
*/
|
|
161
|
+
files: File[];
|
|
162
|
+
/**
|
|
163
|
+
* The picked mentions whose `@<label>` is in the text.
|
|
164
|
+
*/
|
|
165
|
+
mentions: MentionItem[];
|
|
166
|
+
/**
|
|
167
|
+
* The context chips when it was queued.
|
|
168
|
+
*/
|
|
169
|
+
context: ContextChip[];
|
|
170
|
+
};
|
|
171
|
+
export type ComposerQueueDetail = {
|
|
172
|
+
/**
|
|
173
|
+
* The message added.
|
|
174
|
+
*/
|
|
175
|
+
item: QueuedMessage;
|
|
176
|
+
/**
|
|
177
|
+
* The whole queue, in order, the message added included.
|
|
178
|
+
*/
|
|
179
|
+
items: QueuedMessage[];
|
|
180
|
+
};
|
|
181
|
+
export type ComposerDequeueDetail = {
|
|
182
|
+
/**
|
|
183
|
+
* The message that left the queue.
|
|
184
|
+
*/
|
|
185
|
+
item: QueuedMessage;
|
|
186
|
+
/**
|
|
187
|
+
* What is left of the queue, in order.
|
|
188
|
+
*/
|
|
189
|
+
items: QueuedMessage[];
|
|
190
|
+
/**
|
|
191
|
+
* Why it left.
|
|
192
|
+
*/
|
|
193
|
+
reason: 'sent' | 'removed' | 'edited' | 'cleared';
|
|
144
194
|
};
|
|
145
195
|
export type ComposerRemoveDetail = {
|
|
146
196
|
/**
|
|
@@ -183,6 +233,17 @@ export type ComposerOptions = {
|
|
|
183
233
|
* Whether an agent is working: Send becomes Stop.
|
|
184
234
|
*/
|
|
185
235
|
busy?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* 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. The queue
|
|
239
|
+
* lives as long as the composer: it is not kept with the draft.
|
|
240
|
+
*/
|
|
241
|
+
queue?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Most messages that wait at once. At the limit the send key is
|
|
244
|
+
* refused, and the hint says why.
|
|
245
|
+
*/
|
|
246
|
+
queueLimit?: number;
|
|
186
247
|
/**
|
|
187
248
|
* Whether the composer takes no input.
|
|
188
249
|
*/
|
|
@@ -299,6 +360,16 @@ export type ComposerOptions = {
|
|
|
299
360
|
* Tool listener.
|
|
300
361
|
*/
|
|
301
362
|
ontool?: (event: CustomEvent<ComposerToolDetail>) => void;
|
|
363
|
+
/**
|
|
364
|
+
* Listener for a message being
|
|
365
|
+
* queued.
|
|
366
|
+
*/
|
|
367
|
+
onqueue?: (event: CustomEvent<ComposerQueueDetail>) => void;
|
|
368
|
+
/**
|
|
369
|
+
* Listener for a message
|
|
370
|
+
* leaving the queue.
|
|
371
|
+
*/
|
|
372
|
+
ondequeue?: (event: CustomEvent<ComposerDequeueDetail>) => void;
|
|
302
373
|
/**
|
|
303
374
|
* Listener for
|
|
304
375
|
* ArrowUp on an empty text.
|
|
@@ -408,7 +479,8 @@ export declare function normalizeTools(tools: unknown): ComposerTool[];
|
|
|
408
479
|
* A message box for talking to an agent: a text that grows with what is written, Send (Stop while
|
|
409
480
|
* the agent works), attachments, `@` mentions, `/` commands, and context chips. It keeps nothing
|
|
410
481
|
* but the unsent message: sending hands the text, files, mentions and context to the application,
|
|
411
|
-
* which owns the conversation.
|
|
482
|
+
* which owns the conversation. With `queue`, a message written while the agent works waits here
|
|
483
|
+
* until it is no longer busy.
|
|
412
484
|
*
|
|
413
485
|
* @fires Composer#send
|
|
414
486
|
* @fires Composer#stop
|
|
@@ -418,6 +490,8 @@ export declare function normalizeTools(tools: unknown): ComposerTool[];
|
|
|
418
490
|
* @fires Composer#mention
|
|
419
491
|
* @fires Composer#command
|
|
420
492
|
* @fires Composer#tool
|
|
493
|
+
* @fires Composer#queue
|
|
494
|
+
* @fires Composer#dequeue
|
|
421
495
|
* @fires Composer#historyprevious
|
|
422
496
|
* @extends {Component<ComposerOptions>}
|
|
423
497
|
*/
|
|
@@ -451,6 +525,20 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
451
525
|
_width: any;
|
|
452
526
|
/** What the Send button last drew: mode, send key and label, so it redraws only on a change. */
|
|
453
527
|
_sendDrawn: any;
|
|
528
|
+
/** @type {QueuedMessage[]} Session state: never saved with the draft. */
|
|
529
|
+
_queue: QueuedMessage[];
|
|
530
|
+
_queueLimit: number;
|
|
531
|
+
/** Whether the send key was refused at the limit, which the hint then says. */
|
|
532
|
+
_queueRefused: boolean;
|
|
533
|
+
/** @type {{destroy: () => void}[]} The keyboard of each queued row. */
|
|
534
|
+
_queueRoving: {
|
|
535
|
+
destroy: () => void;
|
|
536
|
+
}[];
|
|
537
|
+
/** Whether a queued message is being sent, and whether busy ended again meanwhile. */
|
|
538
|
+
_sendingQueued: boolean;
|
|
539
|
+
_busyEndedAgain: boolean;
|
|
540
|
+
/** The application's hint, which `_syncHint()` shows unless the queue has something to say. */
|
|
541
|
+
_hint: string;
|
|
454
542
|
_mentionSource: {
|
|
455
543
|
trigger: string;
|
|
456
544
|
items: MentionSource['items'];
|
|
@@ -496,9 +584,12 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
496
584
|
*/
|
|
497
585
|
clear(): this;
|
|
498
586
|
/**
|
|
499
|
-
* Shows Stop in place of Send while an agent works; Escape in the text then emits `stop`.
|
|
587
|
+
* 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.
|
|
500
589
|
* @param {boolean} busy
|
|
501
590
|
* @returns {this}
|
|
591
|
+
* @fires Composer#send
|
|
592
|
+
* @fires Composer#dequeue
|
|
502
593
|
*/
|
|
503
594
|
setBusy(busy: boolean): this;
|
|
504
595
|
/** @returns {boolean} Whether Stop is showing. */
|
|
@@ -568,7 +659,27 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
568
659
|
removeContext(id: string): this;
|
|
569
660
|
/** @returns {ContextChip[]} The context chips. */
|
|
570
661
|
getContext(): ContextChip[];
|
|
571
|
-
/**
|
|
662
|
+
/** @returns {QueuedMessage[]} Copies of the queued messages, the next to be sent first. */
|
|
663
|
+
getQueue(): QueuedMessage[];
|
|
664
|
+
/**
|
|
665
|
+
* Removes every queued message. Emits `dequeue` for each, with `reason: 'cleared'`. Stop does not
|
|
666
|
+
* do this: call it from a `stop` listener to drop what was waiting along with the run.
|
|
667
|
+
* @returns {this}
|
|
668
|
+
* @fires Composer#dequeue
|
|
669
|
+
*/
|
|
670
|
+
clearQueue(): this;
|
|
671
|
+
/**
|
|
672
|
+
* Removes one queued message. Emits `dequeue` with `reason: 'removed'`. An id that is not queued,
|
|
673
|
+
* because the message has been sent, say, changes nothing.
|
|
674
|
+
* @param {string} id
|
|
675
|
+
* @returns {this}
|
|
676
|
+
* @fires Composer#dequeue
|
|
677
|
+
*/
|
|
678
|
+
removeQueued(id: string): this;
|
|
679
|
+
/**
|
|
680
|
+
* Removes what the composer drew and the launcher it opened, drops the queue, and stops listening.
|
|
681
|
+
* @returns {void}
|
|
682
|
+
*/
|
|
572
683
|
destroy(): void;
|
|
573
684
|
/** @private @returns {void} */
|
|
574
685
|
private _onInput;
|
|
@@ -584,7 +695,13 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
584
695
|
* @returns {void}
|
|
585
696
|
*/
|
|
586
697
|
private _onKeydown;
|
|
587
|
-
/**
|
|
698
|
+
/**
|
|
699
|
+
* The message as it stands in the composer, or null when there is nothing to send.
|
|
700
|
+
* @private
|
|
701
|
+
* @returns {ComposerSendDetail|null}
|
|
702
|
+
*/
|
|
703
|
+
private _message;
|
|
704
|
+
/** @private @returns {void} @fires Composer#send @fires Composer#queue */
|
|
588
705
|
private _send;
|
|
589
706
|
/** @private @returns {void} @fires Composer#stop */
|
|
590
707
|
private _stop;
|
|
@@ -595,6 +712,8 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
595
712
|
* @returns {void}
|
|
596
713
|
*/
|
|
597
714
|
private _syncSend;
|
|
715
|
+
/** The quiet text beside Send: why the queue refused, else the application's. @private @returns {void} */
|
|
716
|
+
private _syncHint;
|
|
598
717
|
/** Disabled state on the text and the buttons. @private @returns {void} */
|
|
599
718
|
private _syncState;
|
|
600
719
|
/**
|
|
@@ -657,9 +776,90 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
657
776
|
* Sets the polite status, once per change.
|
|
658
777
|
* @private
|
|
659
778
|
* @param {string} text
|
|
779
|
+
* @param {boolean} [again=false] Whether the same text is news again: a no-break space then tells
|
|
780
|
+
* it apart from the last time, because a live region says nothing about a text that did not change.
|
|
660
781
|
* @returns {void}
|
|
661
782
|
*/
|
|
662
783
|
private _announce;
|
|
784
|
+
/**
|
|
785
|
+
* Holds the message back until the agent is no longer busy, or refuses it at the limit: the
|
|
786
|
+
* message then stays where it was written.
|
|
787
|
+
* @private
|
|
788
|
+
* @returns {void}
|
|
789
|
+
* @fires Composer#queue
|
|
790
|
+
*/
|
|
791
|
+
private _enqueue;
|
|
792
|
+
/**
|
|
793
|
+
* Sends the first queued message for an end of busy. A `send` listener that ends busy again,
|
|
794
|
+
* before it returns, does not send from inside this one: the next message goes when it is done.
|
|
795
|
+
* @private
|
|
796
|
+
* @returns {void}
|
|
797
|
+
*/
|
|
798
|
+
private _sendNextQueued;
|
|
799
|
+
/**
|
|
800
|
+
* Sends the first queued message, unless it must wait. What is being written stays: it is not the
|
|
801
|
+
* message that goes. A prevented `send` was not sent, so the message stays first in line.
|
|
802
|
+
* @private
|
|
803
|
+
* @returns {void}
|
|
804
|
+
* @fires Composer#send
|
|
805
|
+
* @fires Composer#dequeue
|
|
806
|
+
*/
|
|
807
|
+
private _sendQueued;
|
|
808
|
+
/**
|
|
809
|
+
* @private
|
|
810
|
+
* @param {QueuedMessage} item
|
|
811
|
+
* @param {ComposerDequeueDetail['reason']} reason
|
|
812
|
+
* @returns {void}
|
|
813
|
+
* @fires Composer#dequeue
|
|
814
|
+
*/
|
|
815
|
+
private _emitDequeue;
|
|
816
|
+
/**
|
|
817
|
+
* Takes a queued message back into the composer, asking first when that would replace what is
|
|
818
|
+
* being written. The message may have been sent while the question was open; nothing happens then.
|
|
819
|
+
* @private
|
|
820
|
+
* @param {string} id
|
|
821
|
+
* @returns {Promise<void>}
|
|
822
|
+
* @fires Composer#dequeue
|
|
823
|
+
* @fires Composer#input
|
|
824
|
+
*/
|
|
825
|
+
private _editQueued;
|
|
826
|
+
/**
|
|
827
|
+
* @private
|
|
828
|
+
* @param {MouseEvent} event
|
|
829
|
+
* @returns {void}
|
|
830
|
+
*/
|
|
831
|
+
private _onQueueClick;
|
|
832
|
+
/**
|
|
833
|
+
* Delete on a focused row removes it. The arrow keys inside a row belong to its toolbar.
|
|
834
|
+
* @private
|
|
835
|
+
* @param {KeyboardEvent} event
|
|
836
|
+
* @returns {void}
|
|
837
|
+
*/
|
|
838
|
+
private _onQueueKeydown;
|
|
839
|
+
/**
|
|
840
|
+
* Draws the queue, and keeps the focus in it: on the same button of the same row, on the row now
|
|
841
|
+
* in that place when the row has gone, and in the text when no row is left.
|
|
842
|
+
* @private
|
|
843
|
+
* @returns {void}
|
|
844
|
+
*/
|
|
845
|
+
private _renderQueue;
|
|
846
|
+
/**
|
|
847
|
+
* One queued message on one line: its text, or the names of its files when it has none, and a
|
|
848
|
+
* toolbar named by that line.
|
|
849
|
+
* @private
|
|
850
|
+
* @param {QueuedMessage} item
|
|
851
|
+
* @returns {HTMLElement}
|
|
852
|
+
*/
|
|
853
|
+
private _queueRow;
|
|
854
|
+
/**
|
|
855
|
+
* @private
|
|
856
|
+
* @param {'edit'|'remove'} action
|
|
857
|
+
* @param {string} label
|
|
858
|
+
* @returns {HTMLElement}
|
|
859
|
+
*/
|
|
860
|
+
private _queueButton;
|
|
861
|
+
/** @private @returns {void} */
|
|
862
|
+
private _releaseQueueRoving;
|
|
663
863
|
/**
|
|
664
864
|
* Opens the commands in a launcher, created on first use.
|
|
665
865
|
* @private
|
|
@@ -733,4 +933,6 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
733
933
|
/** Fired when a suggestion is picked. @event Composer#mention @type {CustomEvent<{item: MentionItem}>} */
|
|
734
934
|
/** Fired when a command is chosen. @event Composer#command @type {CustomEvent<{item: LauncherItem}>} */
|
|
735
935
|
/** Fired when one of the extra tools is pressed; the composer changes nothing itself. @event Composer#tool @type {CustomEvent<ComposerToolDetail>} */
|
|
936
|
+
/** Fired when a message is added to the queue. @event Composer#queue @type {CustomEvent<ComposerQueueDetail>} */
|
|
937
|
+
/** Fired when a message leaves the queue: sent, removed, taken back to edit, or cleared. @event Composer#dequeue @type {CustomEvent<ComposerDequeueDetail>} */
|
|
736
938
|
/** Fired for ArrowUp on an empty text. @event Composer#historyprevious @type {CustomEvent<Record<string, never>>} */
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The queue behind the Composer's queued messages, as pure functions: each takes the queue as it
|
|
3
|
+
* stands and answers with a new one, in the order the messages were added, and never changes what
|
|
4
|
+
* it was given. It knows nothing of messages but their `id`.
|
|
5
|
+
*/
|
|
6
|
+
/** Most messages that wait at once when `queueLimit` names no usable number. */
|
|
7
|
+
export declare const QUEUE_LIMIT = 10;
|
|
8
|
+
/**
|
|
9
|
+
* The limit an option names: a whole number of one or more, anything else `QUEUE_LIMIT`.
|
|
10
|
+
* @param {unknown} value
|
|
11
|
+
* @returns {number}
|
|
12
|
+
*/
|
|
13
|
+
export declare function queueLimit(value: unknown): number;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the queue has no room for another message.
|
|
16
|
+
* @param {readonly {id: string}[]} queue
|
|
17
|
+
* @param {unknown} [limit]
|
|
18
|
+
* @returns {boolean}
|
|
19
|
+
*/
|
|
20
|
+
export declare function isQueueFull(queue: readonly {
|
|
21
|
+
id: string;
|
|
22
|
+
}[], limit?: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Adds a message at the end, as far as the limit allows.
|
|
25
|
+
* @template {{id: string}} T
|
|
26
|
+
* @param {readonly T[]} queue
|
|
27
|
+
* @param {T} entry
|
|
28
|
+
* @param {unknown} [limit]
|
|
29
|
+
* @returns {{queue: T[], item: T|null}} The new queue, and the message added: null when the queue
|
|
30
|
+
* was full and stays as it was.
|
|
31
|
+
*/
|
|
32
|
+
export declare function addToQueue<T extends {
|
|
33
|
+
id: string;
|
|
34
|
+
}>(queue: readonly T[], entry: T, limit?: unknown): {
|
|
35
|
+
queue: T[];
|
|
36
|
+
item: T | null;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Takes one message out, wherever it stands.
|
|
40
|
+
* @template {{id: string}} T
|
|
41
|
+
* @param {readonly T[]} queue
|
|
42
|
+
* @param {string} id
|
|
43
|
+
* @returns {{queue: T[], item: T|null}} The new queue, and the message taken: null when no message
|
|
44
|
+
* has that id.
|
|
45
|
+
*/
|
|
46
|
+
export declare function removeFromQueue<T extends {
|
|
47
|
+
id: string;
|
|
48
|
+
}>(queue: readonly T[], id: string): {
|
|
49
|
+
queue: T[];
|
|
50
|
+
item: T | null;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Takes the message whose turn it is.
|
|
54
|
+
* @template {{id: string}} T
|
|
55
|
+
* @param {readonly T[]} queue
|
|
56
|
+
* @returns {{queue: T[], item: T|null}} The new queue, and the first message: null when there is
|
|
57
|
+
* none.
|
|
58
|
+
*/
|
|
59
|
+
export declare function takeNext<T extends {
|
|
60
|
+
id: string;
|
|
61
|
+
}>(queue: readonly T[]): {
|
|
62
|
+
queue: T[];
|
|
63
|
+
item: T | null;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Takes every message out.
|
|
67
|
+
* @template {{id: string}} T
|
|
68
|
+
* @param {readonly T[]} queue
|
|
69
|
+
* @returns {{queue: T[], items: T[]}} The empty queue, and the messages taken, in order.
|
|
70
|
+
*/
|
|
71
|
+
export declare function emptyQueue<T extends {
|
|
72
|
+
id: string;
|
|
73
|
+
}>(queue: readonly T[]): {
|
|
74
|
+
queue: T[];
|
|
75
|
+
items: T[];
|
|
76
|
+
};
|
|
@@ -9,13 +9,15 @@ export type CopyButtonOptions = {
|
|
|
9
9
|
*/
|
|
10
10
|
label?: string;
|
|
11
11
|
/**
|
|
12
|
-
* Accessible name, and the native tooltip on the icon-only form
|
|
12
|
+
* Accessible name, and the native tooltip on the icon-only form; by
|
|
13
|
+
* default the `copy.copy` message ("Copy"). Null gives none.
|
|
13
14
|
*/
|
|
14
|
-
title?: string;
|
|
15
|
+
title?: string | null;
|
|
15
16
|
/**
|
|
16
|
-
* Confirmation announced and shown after a copy
|
|
17
|
+
* Confirmation announced and shown after a copy; by default the
|
|
18
|
+
* `copy.copied` message ("Copied"). Null says nothing.
|
|
17
19
|
*/
|
|
18
|
-
feedback?: string;
|
|
20
|
+
feedback?: string | null;
|
|
19
21
|
/**
|
|
20
22
|
* Milliseconds the confirmation stays.
|
|
21
23
|
*/
|