@zeyos/zx 4.4.0 → 5.0.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 +283 -0
- package/README.md +42 -10
- package/dist/types/components/activity-list/activity-list.d.ts +22 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +5 -3
- package/dist/types/components/avatar/avatar.d.ts +46 -7
- package/dist/types/components/badge/badge.d.ts +21 -1
- package/dist/types/components/button/button.d.ts +15 -0
- package/dist/types/components/chart/chart.d.ts +10 -0
- package/dist/types/components/checklist/checklist.d.ts +9 -0
- package/dist/types/components/code-editor/code-editor.d.ts +6 -17
- package/dist/types/components/datebox/date-range-box.d.ts +5 -1
- package/dist/types/components/datebox/datebox.d.ts +7 -2
- package/dist/types/components/dialog/dialog.d.ts +46 -6
- package/dist/types/components/dropdown/dropdown.d.ts +2 -2
- package/dist/types/components/entity-ref/entity-ref.d.ts +2 -2
- package/dist/types/components/field/field.d.ts +24 -2
- package/dist/types/components/fieldset/fieldset.d.ts +19 -1
- package/dist/types/components/file-item/file-item.d.ts +34 -6
- package/dist/types/components/form/form.d.ts +12 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +8 -0
- package/dist/types/components/launcher/launcher.d.ts +260 -15
- package/dist/types/components/list-toolbar/list-toolbar.d.ts +1 -1
- package/dist/types/components/menu-button/menu-button.d.ts +33 -5
- package/dist/types/components/message/message.d.ts +119 -17
- package/dist/types/components/modal/modal.d.ts +13 -2
- package/dist/types/components/select/color.d.ts +12 -0
- package/dist/types/components/select/glyphs.d.ts +124 -0
- package/dist/types/components/select/select.d.ts +11 -3
- package/dist/types/components/stat-tile/stat-tile.d.ts +16 -5
- package/dist/types/components/tabbox/tabbox.d.ts +9 -0
- package/dist/types/components/table/table.d.ts +46 -1
- package/dist/types/components/tag-picker/tag-picker.d.ts +21 -4
- package/dist/types/components/tree/tree.d.ts +13 -0
- package/dist/types/core/breakpoint.d.ts +1 -1
- package/dist/types/core/icons.d.ts +23 -25
- package/dist/types/core/motion.d.ts +59 -0
- package/dist/types/core/overlay-host.d.ts +15 -1
- package/dist/types/index.d.ts +5 -3
- package/dist/types/zeyos/connect.d.ts +6 -0
- package/dist/types/zeyos/form.d.ts +50 -9
- package/dist/types/zeyos/index.d.ts +1 -1
- package/dist/types/zeyos/query.d.ts +79 -0
- package/dist/types/zeyos/schema.d.ts +24 -1
- package/dist/types/zeyos/table.d.ts +100 -14
- package/dist/types/zeyos/view.d.ts +10 -0
- package/dist/zx-zeyos.esm.js +1621 -443
- package/dist/zx-zeyos.esm.min.js +53 -5
- package/dist/zx.css +1411 -660
- package/dist/zx.esm.js +1976 -703
- package/dist/zx.esm.min.js +56 -8
- package/dist/zx.global.js +1978 -705
- package/dist/zx.global.min.js +56 -8
- package/dist/zx.min.css +1 -1
- package/docs/api.json +219 -34
- package/docs/llms.md +472 -110
- package/docs/llms.txt +3 -3
- package/package.json +1 -1
- package/src/components/account-menu/account-menu.css +35 -10
- package/src/components/activity-item/activity-item.css +1 -1
- package/src/components/activity-item/activity-item.js +3 -0
- package/src/components/activity-list/activity-list.css +38 -3
- package/src/components/activity-list/activity-list.js +34 -0
- package/src/components/app-icon/app-icon.css +1 -1
- package/src/components/app-rail/app-rail.css +40 -79
- package/src/components/app-sidebar/app-sidebar.css +109 -174
- package/src/components/app-sidebar/app-sidebar.js +21 -6
- package/src/components/aurora/aurora.css +5 -3
- package/src/components/avatar/avatar.css +32 -7
- package/src/components/avatar/avatar.js +72 -8
- package/src/components/badge/badge.css +54 -2
- package/src/components/badge/badge.js +29 -2
- package/src/components/button/button.css +67 -9
- package/src/components/button/button.js +38 -0
- package/src/components/calendar/calendar.css +46 -46
- package/src/components/card/card.css +2 -2
- package/src/components/card-view/card-view.css +9 -7
- package/src/components/chart/chart.css +4 -1
- package/src/components/chart/chart.js +12 -0
- package/src/components/check-button/check-button.css +10 -2
- package/src/components/checklist/checklist.css +9 -2
- package/src/components/checklist/checklist.js +11 -5
- package/src/components/checklist/field-adapter.js +3 -1
- package/src/components/code-editor/code-editor.css +6 -5
- package/src/components/code-editor/code-editor.js +19 -1
- package/src/components/context-menu/context-menu.css +9 -4
- package/src/components/copy/copy-button.css +6 -0
- package/src/components/copy/copy-input.css +8 -3
- package/src/components/data-filter/data-filter.css +5 -4
- package/src/components/date-picker/date-picker.css +6 -6
- package/src/components/date-picker/date-range-picker.css +3 -3
- package/src/components/date-picker/time-picker.css +1 -1
- package/src/components/datebox/date-range-box.css +79 -2
- package/src/components/datebox/date-range-box.js +13 -2
- package/src/components/datebox/datebox.css +79 -2
- package/src/components/datebox/datebox.js +13 -2
- package/src/components/dialog/dialog.css +26 -0
- package/src/components/dialog/dialog.js +99 -17
- package/src/components/dropdown/dropdown.css +1 -1
- package/src/components/dropdown/dropdown.js +5 -3
- package/src/components/empty-state/empty-state.css +2 -2
- package/src/components/entity-ref/entity-ref.css +1 -1
- package/src/components/entity-ref/entity-ref.js +1 -1
- package/src/components/field/field.css +28 -9
- package/src/components/field/field.js +68 -26
- package/src/components/field-upload/field-upload.css +1 -1
- package/src/components/fieldset/fieldset.css +5 -3
- package/src/components/fieldset/fieldset.js +28 -5
- package/src/components/file-item/file-item.js +144 -10
- package/src/components/filter/filter.js +7 -3
- package/src/components/filter-panel/filter-panel.css +1 -1
- package/src/components/finder/finder.css +15 -13
- package/src/components/form/form.css +5 -4
- package/src/components/form/form.js +11 -2
- package/src/components/grid/grid.css +1 -1
- package/src/components/groupbox/groupbox.css +1 -1
- package/src/components/kanban-view/kanban-card.js +11 -3
- package/src/components/kanban-view/kanban-view.css +39 -15
- package/src/components/kanban-view/kanban-view.js +4 -4
- package/src/components/launcher/launcher.css +107 -25
- package/src/components/launcher/launcher.js +503 -41
- package/src/components/list-toolbar/list-toolbar.css +13 -8
- package/src/components/list-toolbar/list-toolbar.js +1 -1
- package/src/components/master-panel/master-panel.css +2 -0
- package/src/components/menu-button/menu-button.css +9 -4
- package/src/components/menu-button/menu-button.js +65 -9
- package/src/components/message/message.css +33 -3
- package/src/components/message/message.js +217 -15
- package/src/components/modal/modal.js +18 -3
- package/src/components/navigation-bar/navigation-bar.css +18 -9
- package/src/components/number-field/field-adapter.js +1 -0
- package/src/components/number-field/number-field.css +70 -0
- package/src/components/number-field/number-field.js +2 -0
- package/src/components/pagination/pagination.css +8 -6
- package/src/components/panel/panel.css +1 -1
- package/src/components/rating/rating.css +7 -0
- package/src/components/select/color.js +22 -0
- package/src/components/select/field-adapter.js +2 -0
- package/src/components/select/glyphs.js +165 -0
- package/src/components/select/select.css +138 -45
- package/src/components/select/select.js +83 -47
- package/src/components/sheet/sheet.css +11 -8
- package/src/components/slider/slider.css +16 -2
- package/src/components/slider/slider.js +1 -1
- package/src/components/sort-control/sort-control.css +4 -1
- package/src/components/stat-tile/stat-tile.css +41 -46
- package/src/components/stat-tile/stat-tile.js +17 -6
- package/src/components/tabbox/tabbox.css +32 -27
- package/src/components/tabbox/tabbox.js +5 -1
- package/src/components/table/table.css +104 -29
- package/src/components/table/table.js +90 -16
- package/src/components/tag-picker/tag-picker.css +83 -5
- package/src/components/tag-picker/tag-picker.js +25 -8
- package/src/components/timebox/timebox.css +22 -2
- package/src/components/toggle/toggle.css +12 -1
- package/src/components/toolbar/toolbar.js +2 -2
- package/src/components/tooltip/tooltip.css +4 -0
- package/src/components/tooltip/tooltip.js +10 -3
- package/src/components/tree/tree.css +25 -16
- package/src/components/tree/tree.js +31 -0
- package/src/components/value-list/value-list.css +3 -3
- package/src/components/view/record-view.js +1 -1
- package/src/core/breakpoint.js +1 -1
- package/src/core/icons.js +193 -60
- package/src/core/motion.js +147 -0
- package/src/core/overlay-host.js +21 -2
- package/src/index.js +5 -3
- package/src/internal/app-rail.js +1 -2
- package/src/zeyos/connect.js +6 -2
- package/src/zeyos/form.js +67 -27
- package/src/zeyos/index.js +1 -1
- package/src/zeyos/query.js +153 -0
- package/src/zeyos/schema.js +144 -27
- package/src/zeyos/table.js +68 -5
- package/src/zeyos/view.js +6 -0
- package/styles/base.css +56 -0
- package/styles/icons.css +11 -1
- package/styles/tokens/dark.css +113 -37
- package/styles/tokens/global.css +121 -27
- package/styles/tokens/semantic.css +100 -31
- package/styles/tokens/themes.css +7 -6
- package/styles/zx.css +0 -1
- package/styles/tokens/density.css +0 -9
|
@@ -28,6 +28,23 @@ export type LauncherItem = {
|
|
|
28
28
|
* Compact metadata.
|
|
29
29
|
*/
|
|
30
30
|
badge?: string | number;
|
|
31
|
+
/**
|
|
32
|
+
* Muted text at the end of the row, such as a current value or a project.
|
|
33
|
+
*/
|
|
34
|
+
hint?: string | number;
|
|
35
|
+
/**
|
|
36
|
+
* Key labels drawn as
|
|
37
|
+
* key caps (`['⌘', 'K']`), or Button's `{label, keys}` shape. Display only: the Launcher binds nothing.
|
|
38
|
+
*/
|
|
39
|
+
shortcut?: string | string[] | {
|
|
40
|
+
label: string | string[];
|
|
41
|
+
keys?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The same shortcut in `aria-keyshortcuts` syntax (`'Meta+K'`), exposed on
|
|
45
|
+
* the option for assistive technology.
|
|
46
|
+
*/
|
|
47
|
+
keys?: string;
|
|
31
48
|
/**
|
|
32
49
|
* Tile or row presentation.
|
|
33
50
|
*/
|
|
@@ -72,6 +89,40 @@ export type LauncherItem = {
|
|
|
72
89
|
* Whether activation is unavailable.
|
|
73
90
|
*/
|
|
74
91
|
disabled?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Child items. An item with `items` opens them
|
|
94
|
+
* as a page instead of being selected: an array, or a loader called with the page's query.
|
|
95
|
+
*/
|
|
96
|
+
items?: LauncherItem[] | LauncherPageLoader;
|
|
97
|
+
/**
|
|
98
|
+
* Search-field placeholder while this item's page is open.
|
|
99
|
+
*/
|
|
100
|
+
placeholder?: string;
|
|
101
|
+
/**
|
|
102
|
+
* For a page whose `items` is a loader: whether Zx ranks
|
|
103
|
+
* the loaded items by the query, or keeps the loader's order.
|
|
104
|
+
*/
|
|
105
|
+
order?: 'rank' | 'source';
|
|
106
|
+
};
|
|
107
|
+
export type LauncherPageLoader = (query: string, context: {
|
|
108
|
+
signal: AbortSignal;
|
|
109
|
+
}) => LauncherItem[] | Promise<LauncherItem[]>;
|
|
110
|
+
export type LauncherOpenOptions = {
|
|
111
|
+
/**
|
|
112
|
+
* Opens straight into a page: the id of a local item
|
|
113
|
+
* with `items` (at any depth of array pages, whose path becomes the back stack), or a page item.
|
|
114
|
+
*/
|
|
115
|
+
page?: string | number | LauncherItem;
|
|
116
|
+
};
|
|
117
|
+
export type LauncherPageDetail = {
|
|
118
|
+
/**
|
|
119
|
+
* The page now shown; null on the root.
|
|
120
|
+
*/
|
|
121
|
+
page: LauncherItem | null;
|
|
122
|
+
/**
|
|
123
|
+
* Every open page from the root down, the shown one last.
|
|
124
|
+
*/
|
|
125
|
+
path: LauncherItem[];
|
|
75
126
|
};
|
|
76
127
|
export type LauncherSource = {
|
|
77
128
|
/**
|
|
@@ -160,6 +211,7 @@ export type LauncherOptions = {
|
|
|
160
211
|
hints?: false | {
|
|
161
212
|
move?: string;
|
|
162
213
|
open?: string;
|
|
214
|
+
back?: string;
|
|
163
215
|
close?: string;
|
|
164
216
|
};
|
|
165
217
|
/**
|
|
@@ -176,6 +228,10 @@ export type LauncherOptions = {
|
|
|
176
228
|
onquery?: (event: CustomEvent<{
|
|
177
229
|
query: string;
|
|
178
230
|
}>) => void;
|
|
231
|
+
/**
|
|
232
|
+
* Page-navigation listener.
|
|
233
|
+
*/
|
|
234
|
+
onpage?: (event: CustomEvent<LauncherPageDetail>) => void;
|
|
179
235
|
/**
|
|
180
236
|
* Open listener.
|
|
181
237
|
*/
|
|
@@ -187,21 +243,49 @@ export type LauncherOptions = {
|
|
|
187
243
|
/**
|
|
188
244
|
* Source error listener.
|
|
189
245
|
*/
|
|
190
|
-
onerror?: (event: CustomEvent<
|
|
191
|
-
source: LauncherSource;
|
|
192
|
-
error: unknown;
|
|
193
|
-
}>) => void;
|
|
246
|
+
onerror?: (event: CustomEvent<LauncherErrorDetail>) => void;
|
|
194
247
|
};
|
|
195
248
|
export type LauncherSelectDetail = {
|
|
196
249
|
item: LauncherItem;
|
|
197
250
|
value: unknown;
|
|
198
251
|
source: string | null;
|
|
199
252
|
query: string;
|
|
253
|
+
page: LauncherItem | null;
|
|
254
|
+
};
|
|
255
|
+
export type LauncherErrorDetail = {
|
|
256
|
+
source: LauncherSource;
|
|
257
|
+
error: unknown;
|
|
258
|
+
page: LauncherItem | null;
|
|
200
259
|
};
|
|
201
260
|
export type RankedLauncherItem = LauncherItem & {
|
|
202
261
|
_source?: string | null;
|
|
203
262
|
_score?: number;
|
|
204
263
|
};
|
|
264
|
+
export type LevelSource = LauncherSource & {
|
|
265
|
+
_page?: boolean;
|
|
266
|
+
};
|
|
267
|
+
export type LauncherPageEntry = {
|
|
268
|
+
/**
|
|
269
|
+
* The page item.
|
|
270
|
+
*/
|
|
271
|
+
page: LauncherItem;
|
|
272
|
+
/**
|
|
273
|
+
* Its normalized local items (an array page).
|
|
274
|
+
*/
|
|
275
|
+
items: LauncherItem[];
|
|
276
|
+
/**
|
|
277
|
+
* Its loader as a source (a loader page).
|
|
278
|
+
*/
|
|
279
|
+
sources: LevelSource[];
|
|
280
|
+
/**
|
|
281
|
+
* The level beneath: its query, its highlighted option, and its loaded results when they were complete.
|
|
282
|
+
*/
|
|
283
|
+
parent: {
|
|
284
|
+
query: string;
|
|
285
|
+
activeId: string | null;
|
|
286
|
+
sourceItems: Map<string, RankedLauncherItem[]> | null;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
205
289
|
/**
|
|
206
290
|
* @typedef {Object} LauncherItem
|
|
207
291
|
* @property {string|number} id Stable item identifier.
|
|
@@ -211,6 +295,11 @@ export type RankedLauncherItem = LauncherItem & {
|
|
|
211
295
|
* @property {string} [group] Result group.
|
|
212
296
|
* @property {string|Node|((item: LauncherItem) => Node|null)} [icon] Decorative icon name, node, or factory.
|
|
213
297
|
* @property {string|number} [badge] Compact metadata.
|
|
298
|
+
* @property {string|number} [hint] Muted text at the end of the row, such as a current value or a project.
|
|
299
|
+
* @property {string|string[]|{label: string|string[], keys?: string}} [shortcut] Key labels drawn as
|
|
300
|
+
* key caps (`['⌘', 'K']`), or Button's `{label, keys}` shape. Display only: the Launcher binds nothing.
|
|
301
|
+
* @property {string} [keys] The same shortcut in `aria-keyshortcuts` syntax (`'Meta+K'`), exposed on
|
|
302
|
+
* the option for assistive technology.
|
|
214
303
|
* @property {'application'|'record'|'action'} [kind='action'] Tile or row presentation.
|
|
215
304
|
* @property {boolean} [current=false] Whether this is the current application or destination.
|
|
216
305
|
* @property {'always'|'empty'|'query'} [when='always'] Query state in which the item is visible.
|
|
@@ -222,6 +311,26 @@ export type RankedLauncherItem = LauncherItem & {
|
|
|
222
311
|
* @property {() => void} [invoke] Application-owned callback for non-link actions.
|
|
223
312
|
* @property {boolean|number} [pinned] Pinned state or explicit pinned order.
|
|
224
313
|
* @property {boolean} [disabled] Whether activation is unavailable.
|
|
314
|
+
* @property {LauncherItem[]|LauncherPageLoader} [items] Child items. An item with `items` opens them
|
|
315
|
+
* as a page instead of being selected: an array, or a loader called with the page's query.
|
|
316
|
+
* @property {string} [placeholder] Search-field placeholder while this item's page is open.
|
|
317
|
+
* @property {'rank'|'source'} [order='rank'] For a page whose `items` is a loader: whether Zx ranks
|
|
318
|
+
* the loaded items by the query, or keeps the loader's order.
|
|
319
|
+
*/
|
|
320
|
+
/**
|
|
321
|
+
* Loads a page's items for its current query. It runs when the page opens and again, debounced, as
|
|
322
|
+
* the query changes; a newer query aborts `signal`.
|
|
323
|
+
* @typedef {(query: string, context: {signal: AbortSignal}) => LauncherItem[]|Promise<LauncherItem[]>} LauncherPageLoader
|
|
324
|
+
*/
|
|
325
|
+
/**
|
|
326
|
+
* @typedef {Object} LauncherOpenOptions
|
|
327
|
+
* @property {string|number|LauncherItem} [page] Opens straight into a page: the id of a local item
|
|
328
|
+
* with `items` (at any depth of array pages, whose path becomes the back stack), or a page item.
|
|
329
|
+
*/
|
|
330
|
+
/**
|
|
331
|
+
* @typedef {Object} LauncherPageDetail
|
|
332
|
+
* @property {LauncherItem|null} page The page now shown; null on the root.
|
|
333
|
+
* @property {LauncherItem[]} path Every open page from the root down, the shown one last.
|
|
225
334
|
*/
|
|
226
335
|
/**
|
|
227
336
|
* @typedef {Object} LauncherSource
|
|
@@ -247,20 +356,40 @@ export type RankedLauncherItem = LauncherItem & {
|
|
|
247
356
|
* @property {string} [emptyText] Empty-state text. Omitted resolves `launcher.empty`, English `No results`.
|
|
248
357
|
* @property {string} [loadingText] Loading-state text. Omitted resolves `launcher.loading`, English `Searching…`.
|
|
249
358
|
* @property {'mod+k'|false} [shortcut='mod+k'] Optional global keyboard shortcut.
|
|
250
|
-
* @property {false|{move?: string, open?: string, close?: string}} [hints] Visible keyboard hints, or false.
|
|
359
|
+
* @property {false|{move?: string, open?: string, back?: string, close?: string}} [hints] Visible keyboard hints, or false.
|
|
251
360
|
* @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns an internally created launcher; defaults to the opener.
|
|
252
361
|
* @property {(event: CustomEvent<LauncherSelectDetail>) => void} [onselect] Preventable selection listener.
|
|
253
362
|
* @property {(event: CustomEvent<{query: string}>) => void} [onquery] Query-change listener.
|
|
363
|
+
* @property {(event: CustomEvent<LauncherPageDetail>) => void} [onpage] Page-navigation listener.
|
|
254
364
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open listener.
|
|
255
365
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close listener.
|
|
256
|
-
* @property {(event: CustomEvent<
|
|
366
|
+
* @property {(event: CustomEvent<LauncherErrorDetail>) => void} [onerror] Source error listener.
|
|
367
|
+
*/
|
|
368
|
+
/**
|
|
369
|
+
* A selection. `page` is the page the item was chosen on, null on the root.
|
|
370
|
+
* @typedef {{item: LauncherItem, value: unknown, source: string|null, query: string, page: LauncherItem|null}} LauncherSelectDetail
|
|
371
|
+
*/
|
|
372
|
+
/**
|
|
373
|
+
* A failed load. A page loader reports as a source whose id is `page:<page id>`, with `page` set.
|
|
374
|
+
* @typedef {{source: LauncherSource, error: unknown, page: LauncherItem|null}} LauncherErrorDetail
|
|
257
375
|
*/
|
|
258
|
-
/** @typedef {{item: LauncherItem, value: unknown, source: string|null, query: string}} LauncherSelectDetail */
|
|
259
376
|
/** @typedef {LauncherItem & {_source?: string|null, _score?: number}} RankedLauncherItem */
|
|
377
|
+
/** @typedef {LauncherSource & {_page?: boolean}} LevelSource */
|
|
378
|
+
/**
|
|
379
|
+
* One open page and the level beneath it, kept so going back restores that level as it was.
|
|
380
|
+
* @typedef {Object} LauncherPageEntry
|
|
381
|
+
* @property {LauncherItem} page The page item.
|
|
382
|
+
* @property {LauncherItem[]} items Its normalized local items (an array page).
|
|
383
|
+
* @property {LevelSource[]} sources Its loader as a source (a loader page).
|
|
384
|
+
* @property {{query: string, activeId: string|null, sourceItems: Map<string, RankedLauncherItem[]>|null}} parent
|
|
385
|
+
* The level beneath: its query, its highlighted option, and its loaded results when they were complete.
|
|
386
|
+
*/
|
|
260
387
|
/**
|
|
261
388
|
* Abortable command/search dialog that emits application-owned actions without routing itself.
|
|
389
|
+
* Items with `items` open nested pages: an APG combobox whose listbox shows one page at a time.
|
|
262
390
|
* @fires Launcher#select
|
|
263
391
|
* @fires Launcher#query
|
|
392
|
+
* @fires Launcher#page
|
|
264
393
|
* @fires Launcher#open
|
|
265
394
|
* @fires Launcher#close
|
|
266
395
|
* @fires Launcher#error
|
|
@@ -283,7 +412,15 @@ export declare class Launcher extends Component<LauncherOptions> {
|
|
|
283
412
|
_requestSequence: number;
|
|
284
413
|
_queryTimer: number;
|
|
285
414
|
_busy: boolean;
|
|
415
|
+
_settled: boolean;
|
|
416
|
+
/** @type {LauncherPageEntry[]} */
|
|
417
|
+
_pages: LauncherPageEntry[];
|
|
418
|
+
_restoreActiveId: string;
|
|
419
|
+
_announcePending: boolean;
|
|
420
|
+
_announceToggle: boolean;
|
|
286
421
|
_destroyed: boolean;
|
|
422
|
+
_label: string;
|
|
423
|
+
_placeholder: string;
|
|
287
424
|
static cssName: string;
|
|
288
425
|
/** @type {Readonly<LauncherOptions>} */
|
|
289
426
|
static defaults: Readonly<LauncherOptions>;
|
|
@@ -295,8 +432,24 @@ export declare class Launcher extends Component<LauncherOptions> {
|
|
|
295
432
|
constructor(target?: HTMLDialogElement | string | null, options?: LauncherOptions);
|
|
296
433
|
/** @returns {HTMLDialogElement} */
|
|
297
434
|
render(): HTMLDialogElement;
|
|
298
|
-
/**
|
|
299
|
-
|
|
435
|
+
/**
|
|
436
|
+
* Opens the launcher and focuses/selects its query. It opens on the root unless `page` names one;
|
|
437
|
+
* already open, `page` navigates there.
|
|
438
|
+
* @param {LauncherOpenOptions} [options={}] Open options.
|
|
439
|
+
* @returns {this}
|
|
440
|
+
* @fires Launcher#open
|
|
441
|
+
* @fires Launcher#page
|
|
442
|
+
*/
|
|
443
|
+
open(options?: LauncherOpenOptions): this;
|
|
444
|
+
/**
|
|
445
|
+
* Goes back one page, restoring the level beneath with its query and highlighted option. Does
|
|
446
|
+
* nothing on the root.
|
|
447
|
+
* @returns {this}
|
|
448
|
+
* @fires Launcher#page
|
|
449
|
+
*/
|
|
450
|
+
back(): this;
|
|
451
|
+
/** Returns the page shown, or null on the root. @returns {LauncherItem|null} */
|
|
452
|
+
getPage(): LauncherItem | null;
|
|
300
453
|
/** Closes the launcher. @returns {this} */
|
|
301
454
|
close(): this;
|
|
302
455
|
/** Toggles the launcher. @returns {this} */
|
|
@@ -309,18 +462,80 @@ export declare class Launcher extends Component<LauncherOptions> {
|
|
|
309
462
|
setQuery(query: string): this;
|
|
310
463
|
/** Returns the untrimmed query. @returns {string} */
|
|
311
464
|
getQuery(): string;
|
|
312
|
-
/** Replaces local catalogue items. @param {LauncherItem[]} items @returns {this} */
|
|
465
|
+
/** Replaces the root's local catalogue items; an open page keeps its own. @param {LauncherItem[]} items @returns {this} */
|
|
313
466
|
setItems(items: LauncherItem[]): this;
|
|
314
467
|
/** Marks one local item as the current destination. @param {string|number|null} id Item id. @returns {this} */
|
|
315
468
|
setCurrent(id: string | number | null): this;
|
|
316
|
-
/** Replaces asynchronous sources and aborts work from the old set. @param {LauncherSource[]} sources @returns {this} */
|
|
469
|
+
/** Replaces the root's asynchronous sources and aborts work from the old set; on a page they load once the root is back. @param {LauncherSource[]} sources @returns {this} */
|
|
317
470
|
setSources(sources: LauncherSource[]): this;
|
|
318
471
|
/** Aborts sources and removes the owned dialog. @returns {void} */
|
|
319
472
|
destroy(): void;
|
|
320
|
-
/**
|
|
321
|
-
|
|
473
|
+
/**
|
|
474
|
+
* Re-renders the current level and reloads its sources: debounced while typing, at once when a
|
|
475
|
+
* page opens (so its loading state shows instead of a passing "No results").
|
|
476
|
+
* @param {boolean} [immediate=false] Load without the debounce.
|
|
477
|
+
* @returns {void}
|
|
478
|
+
*/
|
|
479
|
+
_refresh(immediate?: boolean): void;
|
|
322
480
|
/** @returns {Promise<void>} */
|
|
323
481
|
_loadSources(): Promise<void>;
|
|
482
|
+
/**
|
|
483
|
+
* The level on screen: the root's items and sources, or the open page's.
|
|
484
|
+
* @returns {{items: LauncherItem[], sources: LevelSource[]}}
|
|
485
|
+
*/
|
|
486
|
+
_level(): {
|
|
487
|
+
items: LauncherItem[];
|
|
488
|
+
sources: LevelSource[];
|
|
489
|
+
};
|
|
490
|
+
/**
|
|
491
|
+
* Opens a page on top of the current level: what the user activated, or ArrowRight on its row.
|
|
492
|
+
* @param {LauncherItem} item Page item.
|
|
493
|
+
* @returns {void}
|
|
494
|
+
*/
|
|
495
|
+
_openPage(item: LauncherItem): void;
|
|
496
|
+
/**
|
|
497
|
+
* Replaces the whole stack with `path` (empty for the root) and refreshes what it lands on.
|
|
498
|
+
* @param {LauncherItem[]} path Pages from the root down.
|
|
499
|
+
* @param {{emit?: boolean}} [options={}] Whether to report a change through `page`.
|
|
500
|
+
* @returns {void}
|
|
501
|
+
*/
|
|
502
|
+
_goTo(path: LauncherItem[], { emit }?: {
|
|
503
|
+
emit?: boolean;
|
|
504
|
+
}): void;
|
|
505
|
+
/** Pops every page, restoring the root's query, without rendering. @returns {void} */
|
|
506
|
+
_unwind(): void;
|
|
507
|
+
/**
|
|
508
|
+
* Pushes a page, remembering the level beneath, and clears the query for it.
|
|
509
|
+
* @param {LauncherItem} item Page item.
|
|
510
|
+
* @returns {void}
|
|
511
|
+
*/
|
|
512
|
+
_pushPage(item: LauncherItem): void;
|
|
513
|
+
/**
|
|
514
|
+
* Pops the top page and restores the level beneath.
|
|
515
|
+
* @returns {boolean} Whether that level's results came back complete (no reload needed).
|
|
516
|
+
*/
|
|
517
|
+
_popPage(): boolean;
|
|
518
|
+
/** @param {string} query @returns {void} */
|
|
519
|
+
_setInputQuery(query: string): void;
|
|
520
|
+
/**
|
|
521
|
+
* Shows the open page in the search row: the chip, the combobox name and placeholder, and the
|
|
522
|
+
* footer's Back hint.
|
|
523
|
+
* @returns {void}
|
|
524
|
+
*/
|
|
525
|
+
_syncPage(): void;
|
|
526
|
+
/** @returns {void} @fires Launcher#page */
|
|
527
|
+
_emitPage(): void;
|
|
528
|
+
/**
|
|
529
|
+
* Resolves `open({ page })`: a page item as given, or the path to a local page by id.
|
|
530
|
+
* @param {string|number|LauncherItem} target Page id or item.
|
|
531
|
+
* @returns {LauncherItem[]}
|
|
532
|
+
*/
|
|
533
|
+
_pagePath(target: string | number | LauncherItem): LauncherItem[];
|
|
534
|
+
/**
|
|
535
|
+
* The polite line a page change ends on: where the user is and how much is there.
|
|
536
|
+
* @returns {string}
|
|
537
|
+
*/
|
|
538
|
+
_pageStatus(): string;
|
|
324
539
|
/** @param {boolean} busy @returns {void} */
|
|
325
540
|
_setBusy(busy: boolean): void;
|
|
326
541
|
/** @returns {void} */
|
|
@@ -335,6 +550,14 @@ export declare class Launcher extends Component<LauncherOptions> {
|
|
|
335
550
|
_syncActive(): void;
|
|
336
551
|
/** @param {KeyboardEvent} event @returns {void} */
|
|
337
552
|
_onKeydown(event: KeyboardEvent): void;
|
|
553
|
+
/**
|
|
554
|
+
* ArrowRight on a page row opens it once the caret is at the end of the query (before that it
|
|
555
|
+
* moves the caret); ArrowLeft on an empty query goes back. Application tiles keep both arrows
|
|
556
|
+
* for moving through their grid, which the caller tries first.
|
|
557
|
+
* @param {string} key ArrowLeft or ArrowRight.
|
|
558
|
+
* @returns {boolean} Whether the key navigated.
|
|
559
|
+
*/
|
|
560
|
+
_pageKey(key: string): boolean;
|
|
338
561
|
/** @param {string} direction @param {number[]} enabled @returns {number|null} */
|
|
339
562
|
_spatialIndex(direction: string, enabled: number[]): number | null;
|
|
340
563
|
/** @param {number} index @param {Event} event @returns {void} */
|
|
@@ -345,10 +568,31 @@ export declare class Launcher extends Component<LauncherOptions> {
|
|
|
345
568
|
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
346
569
|
* @param {string} key Message key.
|
|
347
570
|
* @param {string} fallback English default.
|
|
571
|
+
* @param {...unknown} args Positional `%1`, `%2` values.
|
|
348
572
|
* @returns {string}
|
|
349
573
|
*/
|
|
350
|
-
_message(key: string, fallback: string): string;
|
|
574
|
+
_message(key: string, fallback: string, ...args: unknown[]): string;
|
|
351
575
|
}
|
|
576
|
+
/**
|
|
577
|
+
* Whether an item opens a page rather than being selected.
|
|
578
|
+
* @param {unknown} item Candidate item.
|
|
579
|
+
* @returns {boolean}
|
|
580
|
+
*/
|
|
581
|
+
export declare function isLauncherPage(item: unknown): boolean;
|
|
582
|
+
/**
|
|
583
|
+
* Finds a page among local items by id, descending through array pages (a loader's items are not
|
|
584
|
+
* known until it runs).
|
|
585
|
+
* @param {LauncherItem[]} items Root items.
|
|
586
|
+
* @param {string|number} id Page item id.
|
|
587
|
+
* @returns {LauncherItem[]} The pages from the root down to the match, or an empty array.
|
|
588
|
+
*/
|
|
589
|
+
export declare function findLauncherPage(items: LauncherItem[], id: string | number): LauncherItem[];
|
|
590
|
+
/**
|
|
591
|
+
* Normalizes an item's `shortcut` into the key labels drawn as caps.
|
|
592
|
+
* @param {unknown} shortcut `['⌘', 'K']`, one label, or `{label, keys}`.
|
|
593
|
+
* @returns {string[]}
|
|
594
|
+
*/
|
|
595
|
+
export declare function launcherShortcutCaps(shortcut: unknown): string[];
|
|
352
596
|
/**
|
|
353
597
|
* Ranks launcher items using the current ZeyOS application tiers.
|
|
354
598
|
* @param {RankedLauncherItem[]} items Items to rank.
|
|
@@ -366,6 +610,7 @@ export declare function rankLauncherItems(items: RankedLauncherItem[], query: st
|
|
|
366
610
|
export declare function orderedLauncherSourceItems(sources: LauncherSource[], sourceItems: Map<string, RankedLauncherItem[]>): RankedLauncherItem[];
|
|
367
611
|
/** Fired when a result is activated. @event Launcher#select @type {CustomEvent<LauncherSelectDetail>} */
|
|
368
612
|
/** Fired when the query changes. @event Launcher#query @type {CustomEvent<{query: string}>} */
|
|
613
|
+
/** Fired after a page opens or closes, or `open()` lands on a different page. @event Launcher#page @type {CustomEvent<LauncherPageDetail>} */
|
|
369
614
|
/** Fired after the dialog opens. @event Launcher#open @type {CustomEvent<Record<string, never>>} */
|
|
370
615
|
/** Fired after the dialog closes. @event Launcher#close @type {CustomEvent<Record<string, never>>} */
|
|
371
|
-
/** Fired when one asynchronous source fails. @event Launcher#error @type {CustomEvent<
|
|
616
|
+
/** Fired when one asynchronous source or page loader fails. @event Launcher#error @type {CustomEvent<LauncherErrorDetail>} */
|
|
@@ -193,7 +193,7 @@ export type ListToolbarOptions = {
|
|
|
193
193
|
* control, rather than found separately beside it.
|
|
194
194
|
* - **The count line is a live region**, and `setCount(null)` clears it. The previous number
|
|
195
195
|
* describes the previous filters, and a stale count during a load is worse than none.
|
|
196
|
-
* - **Tool buttons meet the 44 px target**
|
|
196
|
+
* - **Tool buttons meet the 44 px target** at any spacing. An icon button sized to its glyph is
|
|
197
197
|
* the control people miss twice before hitting once.
|
|
198
198
|
*
|
|
199
199
|
* `bind()` is optional sugar; the toolbar is fully functional without it.
|
|
@@ -38,6 +38,14 @@ export type MenuButtonOptions = {
|
|
|
38
38
|
*/
|
|
39
39
|
onclose?: (event: CustomEvent<Record<string, never>>) => void;
|
|
40
40
|
};
|
|
41
|
+
export type MenuButtonOpenOptions = {
|
|
42
|
+
/**
|
|
43
|
+
* Where focus goes when this opening ends with a
|
|
44
|
+
* selection or Escape: `true` is the trigger, an element is that element (the trigger again if
|
|
45
|
+
* it has left the document), and `false` leaves focus alone.
|
|
46
|
+
*/
|
|
47
|
+
returnFocus?: boolean | HTMLElement;
|
|
48
|
+
};
|
|
41
49
|
/** @typedef {import('../../internal/menu-items.js').MenuItem} MenuItem */
|
|
42
50
|
/** @typedef {import('../../internal/menu-items.js').MenuEntry} MenuButtonItem */
|
|
43
51
|
/**
|
|
@@ -51,8 +59,18 @@ export type MenuButtonOptions = {
|
|
|
51
59
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
|
|
52
60
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close event listener.
|
|
53
61
|
*/
|
|
62
|
+
/**
|
|
63
|
+
* @typedef {Object} MenuButtonOpenOptions
|
|
64
|
+
* @property {boolean|HTMLElement} [returnFocus=true] Where focus goes when this opening ends with a
|
|
65
|
+
* selection or Escape: `true` is the trigger, an element is that element (the trigger again if
|
|
66
|
+
* it has left the document), and `false` leaves focus alone.
|
|
67
|
+
*/
|
|
54
68
|
/**
|
|
55
69
|
* APG menu-button trigger backed by an anchored Dropdown.
|
|
70
|
+
*
|
|
71
|
+
* Choosing an item closes the menu and puts focus back on the trigger before the `select` event
|
|
72
|
+
* and the item's `onselect` run, so whatever they open — a dialog, a sheet — records the trigger
|
|
73
|
+
* as the place to return to, and focus they move themselves stays where they put it.
|
|
56
74
|
* @fires MenuButton#select
|
|
57
75
|
* @fires MenuButton#open
|
|
58
76
|
* @fires MenuButton#close
|
|
@@ -82,9 +100,11 @@ export declare class MenuButton extends Component<MenuButtonOptions> {
|
|
|
82
100
|
setItems(items: MenuButtonItem[]): this;
|
|
83
101
|
/**
|
|
84
102
|
* Opens the menu.
|
|
103
|
+
* @param {MenuButtonOpenOptions} [options={}] Where focus returns when this opening ends; ignored
|
|
104
|
+
* while the menu is already open.
|
|
85
105
|
* @returns {this}
|
|
86
106
|
*/
|
|
87
|
-
open(): this;
|
|
107
|
+
open(options?: MenuButtonOpenOptions): this;
|
|
88
108
|
/**
|
|
89
109
|
* Closes the menu.
|
|
90
110
|
* @returns {this}
|
|
@@ -99,10 +119,18 @@ export declare class MenuButton extends Component<MenuButtonOptions> {
|
|
|
99
119
|
getTrigger(): HTMLElement;
|
|
100
120
|
/** Returns the owned menu panel. @returns {HTMLElement} */
|
|
101
121
|
getPanel(): HTMLElement;
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Opens the menu and focuses its first enabled item.
|
|
124
|
+
* @param {MenuButtonOpenOptions} [options={}] Passed to `open()`.
|
|
125
|
+
* @returns {this}
|
|
126
|
+
*/
|
|
127
|
+
focusFirst(options?: MenuButtonOpenOptions): this;
|
|
128
|
+
/**
|
|
129
|
+
* Opens the menu and focuses its last enabled item.
|
|
130
|
+
* @param {MenuButtonOpenOptions} [options={}] Passed to `open()`.
|
|
131
|
+
* @returns {this}
|
|
132
|
+
*/
|
|
133
|
+
focusLast(options?: MenuButtonOpenOptions): this;
|
|
106
134
|
/**
|
|
107
135
|
* Sets the visible trigger label.
|
|
108
136
|
* @param {string} label Trigger label.
|