@bigpixelrocket/uiok 0.4.0 → 0.6.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 +63 -1
- package/dist/button/TextLink.d.ts +26 -3
- package/dist/button/TextLink.js +5 -3
- package/dist/button/button.css +7 -0
- package/dist/dialog/ModalDialog.js +8 -2
- package/dist/dialog/SectionedDialog.d.ts +37 -0
- package/dist/dialog/SectionedDialog.js +157 -0
- package/dist/dialog/dialog.css +102 -0
- package/dist/dialog/index.d.ts +4 -2
- package/dist/dialog/index.js +4 -2
- package/dist/frame/AppRoot.d.ts +1 -1
- package/dist/frame/AppRoot.js +2 -1
- package/dist/frame/Dock.d.ts +1 -1
- package/dist/frame/Dock.js +2 -1
- package/dist/frame/FilterChips.d.ts +5 -2
- package/dist/frame/FilterChips.js +35 -2
- package/dist/frame/FilterChips.logic.d.ts +24 -0
- package/dist/frame/FilterChips.logic.js +34 -0
- package/dist/frame/PageParts.d.ts +4 -3
- package/dist/frame/PageParts.js +10 -3
- package/dist/frame/SideBySide.d.ts +32 -0
- package/dist/frame/SideBySide.js +50 -0
- package/dist/frame/Tree.d.ts +9 -3
- package/dist/frame/Tree.js +8 -5
- package/dist/frame/WindowFrame.d.ts +1 -1
- package/dist/frame/WindowFrame.js +3 -1
- package/dist/frame/frame.css +74 -5
- package/dist/frame/index.d.ts +4 -2
- package/dist/frame/index.js +4 -2
- package/dist/grid/grid.css +1 -0
- package/dist/icon/ProductMark.d.ts +57 -0
- package/dist/icon/ProductMark.js +26 -0
- package/dist/icon/icon.css +53 -0
- package/dist/icon/index.d.ts +3 -1
- package/dist/icon/index.js +3 -1
- package/dist/keyboard/Keyboard.logic.js +20 -3
- package/dist/keychord/KeyChord.d.ts +17 -1
- package/dist/keychord/KeyChord.js +16 -1
- package/dist/keychord/ShortcutIndex.d.ts +49 -0
- package/dist/keychord/ShortcutIndex.js +28 -0
- package/dist/keychord/index.d.ts +8 -2
- package/dist/keychord/index.js +8 -2
- package/dist/keychord/keychord.css +101 -0
- package/dist/labels/dialog.d.ts +2 -0
- package/dist/labels/dialog.js +2 -1
- package/dist/labels/keys.d.ts +5 -0
- package/dist/labels/keys.js +2 -1
- package/dist/labels/settings.d.ts +6 -0
- package/dist/labels/settings.js +1 -0
- package/dist/listing/Listing.d.ts +95 -7
- package/dist/listing/Listing.js +57 -13
- package/dist/listing/ListingScope.d.ts +7 -0
- package/dist/listing/ListingScope.js +8 -0
- package/dist/listing/PaneMessage.d.ts +7 -4
- package/dist/listing/PaneMessage.js +11 -4
- package/dist/listing/Timeline.d.ts +51 -0
- package/dist/listing/Timeline.js +28 -0
- package/dist/listing/index.d.ts +4 -2
- package/dist/listing/index.js +3 -1
- package/dist/listing/listing.css +268 -25
- package/dist/log/Ansi.logic.d.ts +27 -0
- package/dist/log/Ansi.logic.js +203 -0
- package/dist/log/LogWell.d.ts +11 -2
- package/dist/log/LogWell.js +15 -3
- package/dist/log/index.d.ts +1 -0
- package/dist/log/index.js +1 -0
- package/dist/log/log.css +80 -0
- package/dist/menu/Menu.d.ts +133 -0
- package/dist/menu/Menu.js +351 -0
- package/dist/menu/Menu.logic.d.ts +83 -0
- package/dist/menu/Menu.logic.js +92 -0
- package/dist/menu/index.d.ts +6 -1
- package/dist/menu/index.js +6 -1
- package/dist/menu/menu.css +57 -0
- package/dist/palette/Palette.d.ts +3 -2
- package/dist/palette/Palette.js +8 -4
- package/dist/palette/PaletteRows.d.ts +138 -0
- package/dist/palette/PaletteRows.js +76 -0
- package/dist/palette/index.d.ts +5 -2
- package/dist/palette/index.js +5 -2
- package/dist/pane/Pane.d.ts +42 -6
- package/dist/pane/Pane.js +92 -5
- package/dist/pane/PaneFrame.d.ts +22 -1
- package/dist/pane/PaneFrame.js +42 -5
- package/dist/pane/PaneKeys.d.ts +5 -1
- package/dist/pane/PaneKeys.js +28 -3
- package/dist/pane/PaneKeys.logic.d.ts +25 -0
- package/dist/pane/PaneKeys.logic.js +30 -0
- package/dist/pane/index.d.ts +2 -2
- package/dist/pane/index.js +1 -1
- package/dist/pane/usePaneKeys.d.ts +8 -1
- package/dist/pane/usePaneKeys.js +32 -12
- package/dist/shell/SettingsDialog.d.ts +20 -2
- package/dist/shell/SettingsDialog.js +13 -3
- package/dist/shell/index.d.ts +1 -1
- package/dist/styles.css +18 -3
- package/dist/surface/FactList.d.ts +54 -0
- package/dist/surface/FactList.js +33 -0
- package/dist/surface/FactTable.d.ts +44 -0
- package/dist/surface/FactTable.js +33 -0
- package/dist/surface/index.d.ts +7 -2
- package/dist/surface/index.js +7 -2
- package/dist/surface/surface.css +139 -2
- package/dist/tabs/PageTabs.d.ts +6 -0
- package/dist/tabs/PageTabs.js +1 -1
- package/dist/tabs/tabs.css +14 -0
- package/dist/terminal/TerminalBox.d.ts +30 -0
- package/dist/terminal/TerminalBox.js +17 -0
- package/dist/terminal/ghostty/core.d.ts +12 -4
- package/dist/terminal/ghostty/core.js +12 -4
- package/dist/terminal/index.d.ts +6 -2
- package/dist/terminal/index.js +6 -2
- package/dist/terminal/terminal.css +29 -0
- package/dist/text/Code.d.ts +15 -0
- package/dist/text/Code.js +12 -0
- package/dist/text/index.d.ts +6 -1
- package/dist/text/index.js +6 -1
- package/dist/text/text.css +21 -0
- package/dist/themes/themes.generated.css +20 -0
- package/dist/themes/tokens.d.ts +1 -0
- package/dist/themes/tokens.js +16 -2
- package/package.json +1 -1
package/dist/palette/Palette.js
CHANGED
|
@@ -3,6 +3,7 @@ import { ArrowLeft } from 'lucide-react';
|
|
|
3
3
|
import { FilterIcon } from '../filter/FilterIcon.js';
|
|
4
4
|
import { ICON_SM } from '../icon/index.js';
|
|
5
5
|
import { useLabels } from '../labels/UiokProvider.js';
|
|
6
|
+
import { ListingScopeContext } from '../listing/ListingScope.js';
|
|
6
7
|
import { useBellBeat } from '../menu/useBellBeat.js';
|
|
7
8
|
import { tooltip } from '../tooltip/Tooltip.logic.js';
|
|
8
9
|
/**
|
|
@@ -25,8 +26,9 @@ const keepFocus = (event) => {
|
|
|
25
26
|
* answers its own keys first. A press inside never takes the focus from the
|
|
26
27
|
* field. The caller draws the query row (`PaletteQuery`), the list, any
|
|
27
28
|
* notes, and the legend inside, and owns filtering and the cursor
|
|
28
|
-
* (`matchQuery`, `menuQueryRefused`, `moveMenuCursor`).
|
|
29
|
-
* listing scope (`.listing-root`)
|
|
29
|
+
* (`matchQuery`, `menuQueryRefused`, `moveMenuCursor`). The box carries
|
|
30
|
+
* the listing scope (`.listing-root`), so rows and listings drawn in it keep
|
|
31
|
+
* their look wherever the palette mounts.
|
|
30
32
|
*/
|
|
31
33
|
export function Palette({ label, className, busy = false, onClose, children }) {
|
|
32
34
|
return (_jsx("div", { className: "palette-backdrop", onMouseDown: (event) => {
|
|
@@ -37,12 +39,14 @@ export function Palette({ label, className, busy = false, onClose, children }) {
|
|
|
37
39
|
// waits on a request) must not leave the keys on the page behind.
|
|
38
40
|
event.preventDefault();
|
|
39
41
|
onClose();
|
|
40
|
-
}, children: _jsx("div", { "aria-busy": busy || undefined, "aria-label": label, "aria-modal": "true", className: className === undefined
|
|
42
|
+
}, children: _jsx("div", { "aria-busy": busy || undefined, "aria-label": label, "aria-modal": "true", className: className === undefined
|
|
43
|
+
? 'folder-menu palette listing-root'
|
|
44
|
+
: `folder-menu palette listing-root ${className}`, onKeyDown: (event) => {
|
|
41
45
|
if (event.key === 'Escape' && !event.nativeEvent.isComposing) {
|
|
42
46
|
event.preventDefault();
|
|
43
47
|
onClose();
|
|
44
48
|
}
|
|
45
|
-
}, onMouseDown: keepFocus, role: "dialog", children: children }) }));
|
|
49
|
+
}, onMouseDown: keepFocus, role: "dialog", children: _jsx(ListingScopeContext, { value: true, children: children }) }) }));
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
48
52
|
* A palette's query row: the filter mark, the level chip while the palette
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode, type Ref } from 'react';
|
|
2
|
+
/** Props for {@link PaletteList}. */
|
|
3
|
+
export interface PaletteListProps {
|
|
4
|
+
/** The listbox's id, which `PaletteQuery`'s `listId` names. */
|
|
5
|
+
readonly id: string;
|
|
6
|
+
/** The list's accessible name: "Runtimes", "PHP versions". */
|
|
7
|
+
readonly label: string;
|
|
8
|
+
/** Its rows: `PaletteOption`s, `PaletteHeading`s, and a `PaletteNote` when it is empty. */
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A palette's list: the listbox its query field drives, seventeen rows tall
|
|
13
|
+
* at most and fading the edge that has more (`.folder-menu-options`). The
|
|
14
|
+
* caller filters and orders the rows and keeps the cursor.
|
|
15
|
+
*/
|
|
16
|
+
export declare function PaletteList({ id, label, children }: PaletteListProps): ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* How a row's context reads: a `path` gives way at its start so the folder
|
|
19
|
+
* it ends in stays; a `sentence` (what the item is) and a `command` (what a
|
|
20
|
+
* script runs, in the code face) give way at their end.
|
|
21
|
+
*/
|
|
22
|
+
export type PaletteContextKind = 'path' | 'sentence' | 'command';
|
|
23
|
+
/** Props for {@link PaletteOption}. */
|
|
24
|
+
export interface PaletteOptionProps {
|
|
25
|
+
/** The row's id, which the query field names as its active descendant while it is the cursor. */
|
|
26
|
+
readonly id: string;
|
|
27
|
+
/** The row's name: words, or `MarkedText` with the query's matches lit. */
|
|
28
|
+
readonly name: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* The row's accessible name. Pass it whenever `name` is markup
|
|
31
|
+
* (`MarkedText`): without it the row is named by the drawn words, which a
|
|
32
|
+
* screen reader may read split at the highlights ("Po stgreSQL").
|
|
33
|
+
*/
|
|
34
|
+
readonly label?: string;
|
|
35
|
+
/** The glyph in the icon column (a `ProductMark`, a lucide icon), decorative. */
|
|
36
|
+
readonly mark?: ReactNode;
|
|
37
|
+
/** What the row says after its name, quieter: where the item is, or what it does. */
|
|
38
|
+
readonly context?: string;
|
|
39
|
+
/** How the context reads and gives way; a sentence when absent. */
|
|
40
|
+
readonly contextKind?: PaletteContextKind;
|
|
41
|
+
/** The trailing column: a version, a count (words in the quiet tone), or a `KeyChord`. */
|
|
42
|
+
readonly trail?: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Marks the row's item as the current one (the version in use, the place
|
|
45
|
+
* shown), with what current means here ("Installed", "Shown") as the dot's
|
|
46
|
+
* name: a `CurrentDot` after the trail.
|
|
47
|
+
*/
|
|
48
|
+
readonly current?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* The row is one of several that can be picked together (the scripts a
|
|
51
|
+
* project includes): true draws the check mark in the icon column, in
|
|
52
|
+
* place of `mark`, and false leaves it empty (`aria-checked`). A press
|
|
53
|
+
* calls `onPick`, which toggles it; absent, the row is a plain option.
|
|
54
|
+
*/
|
|
55
|
+
readonly checked?: boolean;
|
|
56
|
+
/** The keyboard's cursor stands on it: the cursor fill and bar. */
|
|
57
|
+
readonly cursor?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* It cannot be picked (already added, taken): dimmed, passed over by the
|
|
60
|
+
* keys and the pointer, and its press refused. Say why in `description`.
|
|
61
|
+
*/
|
|
62
|
+
readonly disabled?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Read after the name by assistive technology, in place of what the row
|
|
65
|
+
* derives: its context, a trail in words, and what `current` means, in
|
|
66
|
+
* that order. Give it to say why the row is disabled, or to word a trail
|
|
67
|
+
* that is not text (a `KeyChord`); an empty string reads nothing after
|
|
68
|
+
* the name.
|
|
69
|
+
*/
|
|
70
|
+
readonly description?: string;
|
|
71
|
+
/** A press picks it; never called while it is disabled. */
|
|
72
|
+
readonly onPick: () => void;
|
|
73
|
+
/** The pointer moved over it, which moves the cursor there; never called while it is disabled. */
|
|
74
|
+
readonly onPoint?: () => void;
|
|
75
|
+
/** The row's element, for the caller to scroll the cursor row into view. */
|
|
76
|
+
readonly ref?: Ref<HTMLDivElement>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* One option of a palette's list: its mark, its name, its context (a
|
|
80
|
+
* sentence, a path, or a command, one line, cut with an ellipsis and shown
|
|
81
|
+
* whole in its tooltip), and a trailing column (a version, a count, a
|
|
82
|
+
* chord) with the current item's dot. The cursor row wears the cursor fill
|
|
83
|
+
* and bar, its quiet words in the tone made for that fill; a disabled row
|
|
84
|
+
* is dimmed and never takes the cursor or a pick. A `checked` row, one of
|
|
85
|
+
* several picked together, wears the check mark while it is ticked, as a
|
|
86
|
+
* menu's setting does. The palette keeps the
|
|
87
|
+
* focus in its field, so a press here never takes it. Its name is `label`
|
|
88
|
+
* or its words; the context, a trail in words, and what `current` means
|
|
89
|
+
* are read after it as its description, unless `description` says it.
|
|
90
|
+
*/
|
|
91
|
+
export declare function PaletteOption({ id, name, label, mark, context, contextKind, trail, current, checked, cursor, disabled, description, onPick, onPoint, ref }: PaletteOptionProps): ReactElement;
|
|
92
|
+
/** Props for {@link PaletteHeading}. */
|
|
93
|
+
export interface PaletteHeadingProps {
|
|
94
|
+
/** The group's name: "Installed", "Databases". */
|
|
95
|
+
readonly children: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A group's name over its rows in a palette's or a menu's list, with a
|
|
99
|
+
* hairline running out from it, exactly one row tall so the list still
|
|
100
|
+
* ends on a whole row. Drawn, not listed: assistive technology hears the
|
|
101
|
+
* options alone.
|
|
102
|
+
*/
|
|
103
|
+
export declare function PaletteHeading({ children }: PaletteHeadingProps): ReactElement;
|
|
104
|
+
/** Props for {@link PaletteNote}. */
|
|
105
|
+
export interface PaletteNoteProps {
|
|
106
|
+
/** The note's words: why the list is empty, what a key does. */
|
|
107
|
+
readonly children: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A note in a palette, in the interface face with its text over the rows'
|
|
111
|
+
* names, two lines at most: inside the list, why it is empty ("No runtime
|
|
112
|
+
* matches"); inside `PaletteNotes`, something about the list as a whole.
|
|
113
|
+
*/
|
|
114
|
+
export declare function PaletteNote({ children }: PaletteNoteProps): ReactElement;
|
|
115
|
+
/** Props for {@link PaletteFailure}. */
|
|
116
|
+
export interface PaletteFailureProps {
|
|
117
|
+
/** What failed, in strong words: "Could not install PHP 8.5.4." */
|
|
118
|
+
readonly message: string;
|
|
119
|
+
/** Why, or what to do, after it: the tool's own words. */
|
|
120
|
+
readonly detail?: string | null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A failure under a palette's list, inside `PaletteNotes`: the danger glyph
|
|
124
|
+
* in the icon column, the message in strong words and its detail after,
|
|
125
|
+
* announced as an alert, and its words can be swept and copied.
|
|
126
|
+
*/
|
|
127
|
+
export declare function PaletteFailure({ message, detail }: PaletteFailureProps): ReactElement;
|
|
128
|
+
/** Props for {@link PaletteNotes}. */
|
|
129
|
+
export interface PaletteNotesProps {
|
|
130
|
+
/** `PaletteNote`s and a `PaletteFailure`. */
|
|
131
|
+
readonly children: ReactNode;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The notes under a palette's list, ruled off from it: what the list as a
|
|
135
|
+
* whole needs said, and a failure of the pick that was tried. Draw it only
|
|
136
|
+
* while it has something to say.
|
|
137
|
+
*/
|
|
138
|
+
export declare function PaletteNotes({ children }: PaletteNotesProps): ReactElement;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { CurrentDot } from '../listing/CurrentDot.js';
|
|
4
|
+
import { cutTooltip } from '../tooltip/Tooltip.logic.js';
|
|
5
|
+
/**
|
|
6
|
+
* A palette's list: the listbox its query field drives, seventeen rows tall
|
|
7
|
+
* at most and fading the edge that has more (`.folder-menu-options`). The
|
|
8
|
+
* caller filters and orders the rows and keeps the cursor.
|
|
9
|
+
*/
|
|
10
|
+
export function PaletteList({ id, label, children }) {
|
|
11
|
+
return (_jsx("div", { "aria-label": label, className: "folder-menu-options", id: id, role: "listbox", children: children }));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* One option of a palette's list: its mark, its name, its context (a
|
|
15
|
+
* sentence, a path, or a command, one line, cut with an ellipsis and shown
|
|
16
|
+
* whole in its tooltip), and a trailing column (a version, a count, a
|
|
17
|
+
* chord) with the current item's dot. The cursor row wears the cursor fill
|
|
18
|
+
* and bar, its quiet words in the tone made for that fill; a disabled row
|
|
19
|
+
* is dimmed and never takes the cursor or a pick. A `checked` row, one of
|
|
20
|
+
* several picked together, wears the check mark while it is ticked, as a
|
|
21
|
+
* menu's setting does. The palette keeps the
|
|
22
|
+
* focus in its field, so a press here never takes it. Its name is `label`
|
|
23
|
+
* or its words; the context, a trail in words, and what `current` means
|
|
24
|
+
* are read after it as its description, unless `description` says it.
|
|
25
|
+
*/
|
|
26
|
+
export function PaletteOption({ id, name, label, mark, context, contextKind = 'sentence', trail, current = null, checked, cursor = false, disabled = false, description, onPick, onPoint, ref }) {
|
|
27
|
+
// The name's own id, private to the row, so it never meets a caller's id.
|
|
28
|
+
const nameId = useId();
|
|
29
|
+
const contextClass = contextKind === 'path' ? 'palette-context' : `palette-context palette-${contextKind}`;
|
|
30
|
+
// The row is named by its name alone, which hides the words drawn after
|
|
31
|
+
// it, so those are read as its description unless the caller words one.
|
|
32
|
+
const described = description ??
|
|
33
|
+
[context, typeof trail === 'string' || typeof trail === 'number' ? String(trail) : '', current]
|
|
34
|
+
.filter((part) => typeof part === 'string' && part !== '')
|
|
35
|
+
.join(', ');
|
|
36
|
+
return (_jsxs("div", { "aria-checked": checked, "aria-description": described === '' ? undefined : described, "aria-disabled": disabled || undefined, "aria-label": label ?? (typeof name === 'string' ? name : undefined), "aria-labelledby": label === undefined && typeof name !== 'string' ? nameId : undefined, "aria-selected": cursor, className: cursor ? 'folder-menu-option cursor' : 'folder-menu-option', id: id, onClick: () => {
|
|
37
|
+
if (!disabled)
|
|
38
|
+
onPick();
|
|
39
|
+
}, onMouseMove: () => {
|
|
40
|
+
if (!disabled && !cursor)
|
|
41
|
+
onPoint?.();
|
|
42
|
+
}, ref: ref, role: "option", children: [_jsx("span", { "aria-hidden": true, className: "row-icon", children: checked === undefined ? mark : null }), _jsxs("span", { className: "palette-text", children: [_jsx("span", { className: "row-name", id: nameId, children: name }), context === undefined || context === '' ? null : (_jsx("span", { className: contextClass, ...cutTooltip(context), children: contextKind === 'path' ? _jsx("bdi", { children: context }) : context }))] }), _jsxs("span", { className: "palette-trail", children: [trail === undefined || trail === null ? null : (_jsx("span", { className: "palette-meta", children: trail })), current === null ? null : _jsx(CurrentDot, { label: current })] })] }));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A group's name over its rows in a palette's or a menu's list, with a
|
|
46
|
+
* hairline running out from it, exactly one row tall so the list still
|
|
47
|
+
* ends on a whole row. Drawn, not listed: assistive technology hears the
|
|
48
|
+
* options alone.
|
|
49
|
+
*/
|
|
50
|
+
export function PaletteHeading({ children }) {
|
|
51
|
+
return (_jsx("div", { className: "entry-menu-heading", role: "presentation", children: children }));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A note in a palette, in the interface face with its text over the rows'
|
|
55
|
+
* names, two lines at most: inside the list, why it is empty ("No runtime
|
|
56
|
+
* matches"); inside `PaletteNotes`, something about the list as a whole.
|
|
57
|
+
*/
|
|
58
|
+
export function PaletteNote({ children }) {
|
|
59
|
+
return _jsx("p", { className: "folder-menu-note", children: children });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A failure under a palette's list, inside `PaletteNotes`: the danger glyph
|
|
63
|
+
* in the icon column, the message in strong words and its detail after,
|
|
64
|
+
* announced as an alert, and its words can be swept and copied.
|
|
65
|
+
*/
|
|
66
|
+
export function PaletteFailure({ message, detail = null }) {
|
|
67
|
+
return (_jsxs("p", { className: "folder-menu-note palette-failure", role: "alert", children: [_jsx("strong", { children: message }), detail === null || detail === '' ? null : ` ${detail}`] }));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The notes under a palette's list, ruled off from it: what the list as a
|
|
71
|
+
* whole needs said, and a failure of the pick that was tried. Draw it only
|
|
72
|
+
* while it has something to say.
|
|
73
|
+
*/
|
|
74
|
+
export function PaletteNotes({ children }) {
|
|
75
|
+
return _jsx("div", { className: "palette-notes", children: children });
|
|
76
|
+
}
|
package/dist/palette/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Palettes: `Palette`, the modal frame (backdrop, box, Escape, focus kept in
|
|
3
|
-
* the field),
|
|
4
|
-
* and refusal
|
|
3
|
+
* the field), `PaletteQuery`, its query row with the level chip, count,
|
|
4
|
+
* and refusal, and its rows: `PaletteList` of `PaletteOption`s under
|
|
5
|
+
* `PaletteHeading`s, with `PaletteNote`, and `PaletteNotes` holding notes
|
|
6
|
+
* and a `PaletteFailure` under the list. Styled by palette.css over the menu look, under `.listing-root`.
|
|
5
7
|
*/
|
|
6
8
|
export { Palette, PaletteQuery, type PaletteLevel, type PaletteProps, type PaletteQueryProps } from './Palette.js';
|
|
9
|
+
export { PaletteFailure, PaletteHeading, PaletteList, PaletteNote, PaletteNotes, PaletteOption, type PaletteContextKind, type PaletteFailureProps, type PaletteHeadingProps, type PaletteListProps, type PaletteNoteProps, type PaletteNotesProps, type PaletteOptionProps } from './PaletteRows.js';
|
package/dist/palette/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Palettes: `Palette`, the modal frame (backdrop, box, Escape, focus kept in
|
|
3
|
-
* the field),
|
|
4
|
-
* and refusal
|
|
3
|
+
* the field), `PaletteQuery`, its query row with the level chip, count,
|
|
4
|
+
* and refusal, and its rows: `PaletteList` of `PaletteOption`s under
|
|
5
|
+
* `PaletteHeading`s, with `PaletteNote`, and `PaletteNotes` holding notes
|
|
6
|
+
* and a `PaletteFailure` under the list. Styled by palette.css over the menu look, under `.listing-root`.
|
|
5
7
|
*/
|
|
6
8
|
export { Palette, PaletteQuery } from './Palette.js';
|
|
9
|
+
export { PaletteFailure, PaletteHeading, PaletteList, PaletteNote, PaletteNotes, PaletteOption } from './PaletteRows.js';
|
package/dist/pane/Pane.d.ts
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DOMAttributes, type MouseEvent, type ReactElement, type ReactNode, type Ref } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* The event handlers a host hangs on a pane or a region of the window for
|
|
4
|
-
* its keys, its focus,
|
|
4
|
+
* its keys, its focus, its drop zone, and its menu; nothing that styles it.
|
|
5
|
+
* `onContextMenu` is the region's own menu (open it at `event.clientX` and
|
|
6
|
+
* `event.clientY`): it runs for a secondary click nothing inside the region
|
|
7
|
+
* took (`unclaimedContextMenu`), so the innermost part with a menu wins (a
|
|
8
|
+
* row's, then its pane's, then the region's around it) and one click never
|
|
9
|
+
* opens two.
|
|
5
10
|
*/
|
|
6
|
-
export type RegionHandlers = Pick<DOMAttributes<HTMLElement>, 'onBlur' | 'onDragEnter' | 'onDragLeave' | 'onDragOver' | 'onDrop' | 'onFocus' | 'onKeyDown' | 'onKeyDownCapture' | 'onMouseDown' | 'onPointerDown'>;
|
|
11
|
+
export type RegionHandlers = Pick<DOMAttributes<HTMLElement>, 'onBlur' | 'onContextMenu' | 'onDragEnter' | 'onDragLeave' | 'onDragOver' | 'onDrop' | 'onFocus' | 'onKeyDown' | 'onKeyDownCapture' | 'onMouseDown' | 'onPointerDown'>;
|
|
12
|
+
/**
|
|
13
|
+
* A secondary-click handler that runs only for a click nothing inside its
|
|
14
|
+
* element took: a click whose default is already cancelled (a row's menu, a
|
|
15
|
+
* terminal's, a `Menu` opened from inside, whose events reach its owner
|
|
16
|
+
* through React) passes it by, and so does one in a text field (a text
|
|
17
|
+
* input, a textarea, editable content, read-only ones too), which keeps the
|
|
18
|
+
* browser's own Cut, Copy, and Paste. It cancels the browser's own menu
|
|
19
|
+
* before it runs, so the parts around it pass the click by in turn, and one
|
|
20
|
+
* click opens one menu, the innermost's.
|
|
21
|
+
*/
|
|
22
|
+
export declare const unclaimedContextMenu: <Target extends Element>(handler: ((event: MouseEvent<Target>) => void) | undefined) => ((event: MouseEvent<Target>) => void) | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* A region's handlers as its element wears them: as given, but for
|
|
25
|
+
* `onContextMenu`, which runs only for a click nothing inside took
|
|
26
|
+
* (`unclaimedContextMenu`). Every part that takes `RegionHandlers` spreads
|
|
27
|
+
* these.
|
|
28
|
+
*/
|
|
29
|
+
export declare function regionHandlers<Handlers extends RegionHandlers>(handlers: Handlers): Handlers;
|
|
7
30
|
/** Props for {@link PaneBox}. */
|
|
8
31
|
export interface PaneBoxProps extends RegionHandlers {
|
|
9
32
|
/** The pane holds the keyboard: its frame wears the accent. */
|
|
@@ -17,6 +40,14 @@ export interface PaneBoxProps extends RegionHandlers {
|
|
|
17
40
|
readonly tone?: 'danger';
|
|
18
41
|
/** The element it draws: a `section` by default, an `aside` for a sidebar. */
|
|
19
42
|
readonly as?: 'section' | 'aside';
|
|
43
|
+
/**
|
|
44
|
+
* The visual bell: a count the host raises each time a key could not act
|
|
45
|
+
* (a move past the last row, a verb the cursor row does not offer). Each
|
|
46
|
+
* rise shoves the cursor row sideways for one beat; under reduced motion
|
|
47
|
+
* the row flashes the selection fill instead. The count's value means
|
|
48
|
+
* nothing; only its change rings.
|
|
49
|
+
*/
|
|
50
|
+
readonly bell?: number;
|
|
20
51
|
readonly ref?: Ref<HTMLElement>;
|
|
21
52
|
/** Its tabs (`PaneTabs`), path bar, list, and status line, top to bottom. */
|
|
22
53
|
readonly children?: ReactNode;
|
|
@@ -25,9 +56,11 @@ export interface PaneBoxProps extends RegionHandlers {
|
|
|
25
56
|
* A pane in the listing look (under the listing root a `WindowFrame`
|
|
26
57
|
* wears): a framed column of its tab strip or path bar, its list, and its
|
|
27
58
|
* status line. `active` marks the pane that holds the keyboard; the others
|
|
28
|
-
* show their cursor row quietly.
|
|
59
|
+
* show their cursor row quietly. `bell` rings on its cursor row
|
|
60
|
+
* (`useBellBeat`; `.bell-0`, `.bell-1`). Its `onContextMenu` takes a
|
|
61
|
+
* secondary click no row or part inside it took.
|
|
29
62
|
*/
|
|
30
|
-
export declare function PaneBox({ active, label, tone, as: Element, ref, children, ...handlers }: PaneBoxProps): ReactElement;
|
|
63
|
+
export declare function PaneBox({ active, label, tone, as: Element, bell, ref, children, ...handlers }: PaneBoxProps): ReactElement;
|
|
31
64
|
/** Props for {@link PaneList}. */
|
|
32
65
|
export interface PaneListProps extends RegionHandlers {
|
|
33
66
|
/**
|
|
@@ -44,6 +77,9 @@ export interface PaneListProps extends RegionHandlers {
|
|
|
44
77
|
}
|
|
45
78
|
/**
|
|
46
79
|
* The scrolling body of a pane, between its path bar and its status line:
|
|
47
|
-
* the listings and notes the pane shows.
|
|
80
|
+
* the listings and notes the pane shows. As the pane's home, which holds
|
|
81
|
+
* the focus while the keys move its cursor, it hands the keyboard's menu
|
|
82
|
+
* key (the Menu key, Shift-F10) to the cursor row's `onContextMenu`, so a
|
|
83
|
+
* row's menu is reached from the keys too.
|
|
48
84
|
*/
|
|
49
85
|
export declare function PaneList({ home, pointer, label, ref, children, ...handlers }: PaneListProps): ReactElement;
|
package/dist/pane/Pane.js
CHANGED
|
@@ -1,17 +1,104 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { isTextEditingTarget } from '../keyboard/Keyboard.logic.js';
|
|
4
|
+
import { useBellBeat } from '../menu/useBellBeat.js';
|
|
5
|
+
/**
|
|
6
|
+
* A secondary-click handler that runs only for a click nothing inside its
|
|
7
|
+
* element took: a click whose default is already cancelled (a row's menu, a
|
|
8
|
+
* terminal's, a `Menu` opened from inside, whose events reach its owner
|
|
9
|
+
* through React) passes it by, and so does one in a text field (a text
|
|
10
|
+
* input, a textarea, editable content, read-only ones too), which keeps the
|
|
11
|
+
* browser's own Cut, Copy, and Paste. It cancels the browser's own menu
|
|
12
|
+
* before it runs, so the parts around it pass the click by in turn, and one
|
|
13
|
+
* click opens one menu, the innermost's.
|
|
14
|
+
*/
|
|
15
|
+
export const unclaimedContextMenu = (handler) => handler === undefined
|
|
16
|
+
? undefined
|
|
17
|
+
: (event) => {
|
|
18
|
+
if (event.nativeEvent.defaultPrevented || isTextEditingTarget(event.target))
|
|
19
|
+
return;
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
handler(event);
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A region's handlers as its element wears them: as given, but for
|
|
25
|
+
* `onContextMenu`, which runs only for a click nothing inside took
|
|
26
|
+
* (`unclaimedContextMenu`). Every part that takes `RegionHandlers` spreads
|
|
27
|
+
* these.
|
|
28
|
+
*/
|
|
29
|
+
export function regionHandlers(handlers) {
|
|
30
|
+
const { onContextMenu } = handlers;
|
|
31
|
+
return onContextMenu === undefined
|
|
32
|
+
? handlers
|
|
33
|
+
: { ...handlers, onContextMenu: unclaimedContextMenu(onContextMenu) };
|
|
34
|
+
}
|
|
2
35
|
/**
|
|
3
36
|
* A pane in the listing look (under the listing root a `WindowFrame`
|
|
4
37
|
* wears): a framed column of its tab strip or path bar, its list, and its
|
|
5
38
|
* status line. `active` marks the pane that holds the keyboard; the others
|
|
6
|
-
* show their cursor row quietly.
|
|
39
|
+
* show their cursor row quietly. `bell` rings on its cursor row
|
|
40
|
+
* (`useBellBeat`; `.bell-0`, `.bell-1`). Its `onContextMenu` takes a
|
|
41
|
+
* secondary click no row or part inside it took.
|
|
7
42
|
*/
|
|
8
|
-
export function PaneBox({ active = false, label, tone, as: Element = 'section', ref, children, ...handlers }) {
|
|
9
|
-
|
|
43
|
+
export function PaneBox({ active = false, label, tone, as: Element = 'section', bell = 0, ref, children, ...handlers }) {
|
|
44
|
+
const beat = useBellBeat(bell);
|
|
45
|
+
return (_jsx(Element, { "aria-label": label, className: ['pane', active ? 'active' : '', beat === null ? '' : `bell-${beat}`]
|
|
46
|
+
.filter(Boolean)
|
|
47
|
+
.join(' '), "data-tone": tone, ref: ref, ...regionHandlers(handlers), children: children }));
|
|
10
48
|
}
|
|
11
49
|
/**
|
|
12
50
|
* The scrolling body of a pane, between its path bar and its status line:
|
|
13
|
-
* the listings and notes the pane shows.
|
|
51
|
+
* the listings and notes the pane shows. As the pane's home, which holds
|
|
52
|
+
* the focus while the keys move its cursor, it hands the keyboard's menu
|
|
53
|
+
* key (the Menu key, Shift-F10) to the cursor row's `onContextMenu`, so a
|
|
54
|
+
* row's menu is reached from the keys too.
|
|
14
55
|
*/
|
|
15
56
|
export function PaneList({ home = false, pointer = false, label, ref, children, ...handlers }) {
|
|
16
|
-
|
|
57
|
+
const region = regionHandlers(handlers);
|
|
58
|
+
// Whether the keyboard's menu key (the Menu key, Shift-F10) was the last
|
|
59
|
+
// thing pressed: only it makes a menu the keyboard's, until the menu it
|
|
60
|
+
// asks for, another key, or a press of the pointer. The event alone cannot
|
|
61
|
+
// tell: Chromium sends the Menu key's as a mouse's pointer event.
|
|
62
|
+
const menuKey = useRef(false);
|
|
63
|
+
return (_jsx("div", { "aria-label": label, className: pointer ? 'pane-list pointer' : 'pane-list', "data-pane-home": home ? '' : undefined, ref: ref, tabIndex: home ? -1 : undefined, ...region, onContextMenu: (event) => {
|
|
64
|
+
const fromKeys = menuKey.current;
|
|
65
|
+
menuKey.current = false;
|
|
66
|
+
if (home && fromKeys && event.target === event.currentTarget)
|
|
67
|
+
menuOnCursorRow(event);
|
|
68
|
+
region.onContextMenu?.(event);
|
|
69
|
+
}, onKeyDownCapture: (event) => {
|
|
70
|
+
menuKey.current =
|
|
71
|
+
event.key === 'ContextMenu' ||
|
|
72
|
+
(event.key === 'F10' &&
|
|
73
|
+
event.shiftKey &&
|
|
74
|
+
!event.ctrlKey &&
|
|
75
|
+
!event.altKey &&
|
|
76
|
+
!event.metaKey);
|
|
77
|
+
region.onKeyDownCapture?.(event);
|
|
78
|
+
}, onPointerDownCapture: () => {
|
|
79
|
+
menuKey.current = false;
|
|
80
|
+
}, children: children }));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The keyboard's menu key aimed at a pane's home, which holds the focus
|
|
84
|
+
* while its cursor row does not: the cursor row with a menu of its own
|
|
85
|
+
* (`Row`'s `onContextMenu`, `data-row-menu`) takes it, as a secondary click
|
|
86
|
+
* on it, placed under the row's leading edge rather than wherever the
|
|
87
|
+
* keyboard's event says, and the home's own claims none.
|
|
88
|
+
*/
|
|
89
|
+
function menuOnCursorRow(event) {
|
|
90
|
+
const row = event.currentTarget.querySelector('[data-row-key][aria-current="true"][data-row-menu]');
|
|
91
|
+
if (row === null || event.nativeEvent.defaultPrevented)
|
|
92
|
+
return;
|
|
93
|
+
const box = row.getBoundingClientRect();
|
|
94
|
+
const rtl = getComputedStyle(row).direction === 'rtl';
|
|
95
|
+
const click = new globalThis.MouseEvent('contextmenu', {
|
|
96
|
+
bubbles: true,
|
|
97
|
+
cancelable: true,
|
|
98
|
+
clientX: rtl ? box.right : box.left,
|
|
99
|
+
clientY: box.bottom
|
|
100
|
+
});
|
|
101
|
+
row.dispatchEvent(click);
|
|
102
|
+
if (click.defaultPrevented)
|
|
103
|
+
event.preventDefault();
|
|
17
104
|
}
|
package/dist/pane/PaneFrame.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type MenuEntry } from '../menu/Menu.js';
|
|
2
3
|
/** A crumb that is a control: a press goes to the place it names. */
|
|
3
4
|
export interface PaneCrumb {
|
|
4
5
|
readonly label: string;
|
|
@@ -7,6 +8,18 @@ export interface PaneCrumb {
|
|
|
7
8
|
/** What a press does, when the label alone does not say it. */
|
|
8
9
|
readonly tip?: string;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* The other places beside the last crumb's (a service's other versions, a
|
|
13
|
+
* project's other commands), which a ⌄ after its words opens as a `Menu`.
|
|
14
|
+
*/
|
|
15
|
+
export interface PaneSiblings {
|
|
16
|
+
/** The menu's accessible name and what the ⌄ says it opens: "Other versions". */
|
|
17
|
+
readonly label: string;
|
|
18
|
+
/** The places, the one shown among them with its `current`; `MenuEntry`s. */
|
|
19
|
+
readonly entries: readonly MenuEntry[];
|
|
20
|
+
/** Goes to the place picked, by its entry's id; the menu closes itself. */
|
|
21
|
+
readonly onPick: (id: string) => void;
|
|
22
|
+
}
|
|
10
23
|
/** Props for {@link PanePathBar}. */
|
|
11
24
|
export interface PanePathBarProps {
|
|
12
25
|
/**
|
|
@@ -23,6 +36,12 @@ export interface PanePathBarProps {
|
|
|
23
36
|
readonly heading?: boolean;
|
|
24
37
|
/** Drawn after the last crumb's label, inside its crumb: the `CurrentDot` of the one shown. */
|
|
25
38
|
readonly here?: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* The last crumb's siblings: the crumb becomes a button with a ⌄ after
|
|
41
|
+
* its words that drops them as a menu under it, the cursor on the one
|
|
42
|
+
* shown (the entry with `current`).
|
|
43
|
+
*/
|
|
44
|
+
readonly siblings?: PaneSiblings | null;
|
|
26
45
|
/** Facts and compact controls at the bar's end. */
|
|
27
46
|
readonly children?: ReactNode;
|
|
28
47
|
}
|
|
@@ -34,6 +53,8 @@ export interface PanePathBarProps {
|
|
|
34
53
|
* way first, the last one only once they have. A cut crumb opens its whole
|
|
35
54
|
* text as a tooltip, and a crumb in full view opens none (a control's
|
|
36
55
|
* `tip`, when it has one, says what a press does instead, cut or not).
|
|
56
|
+
* A bar with `siblings` makes its last crumb a ⌄ button that drops the
|
|
57
|
+
* places beside it (a service's other versions) as a `Menu`.
|
|
37
58
|
* Facts and controls sit at the bar's end (`.path-tools`): a state
|
|
38
59
|
* as `PathFact`, compact verbs as `QuietAction` and `.path-star` icon
|
|
39
60
|
* buttons. In a bar too narrow for everything, things give way in one
|
|
@@ -44,7 +65,7 @@ export interface PanePathBarProps {
|
|
|
44
65
|
* Nothing is drawn over anything, and no control leaves the row. The bar
|
|
45
66
|
* fits itself after every render and whenever any box in it resizes.
|
|
46
67
|
*/
|
|
47
|
-
export declare function PanePathBar({ trail, mark, heading, here, children }: PanePathBarProps): ReactElement;
|
|
68
|
+
export declare function PanePathBar({ trail, mark, heading, here, siblings, children }: PanePathBarProps): ReactElement;
|
|
48
69
|
/** Props for {@link PathFact}. */
|
|
49
70
|
export interface PathFactProps {
|
|
50
71
|
/**
|
package/dist/pane/PaneFrame.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown } from 'lucide-react';
|
|
3
|
+
import { Fragment, useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
+
import { ICON_SM } from '../icon/sizes.js';
|
|
5
|
+
import { Menu } from '../menu/Menu.js';
|
|
6
|
+
import { cutTooltip, describedTooltip, tooltip } from '../tooltip/Tooltip.logic.js';
|
|
4
7
|
import { InPathBarContext } from './PaneActions.js';
|
|
5
8
|
import { clearWordTips, giveWordTips } from './toolWords.js';
|
|
6
9
|
/** A fact of words alone, or of words after marks: the bar cuts its words. */
|
|
@@ -132,6 +135,38 @@ function showFocusedCrumb(trail, crumb) {
|
|
|
132
135
|
trail.scrollLeft = Math.min(max, Math.ceil(trail.scrollLeft + (at.right + ring - (box.right - fade))));
|
|
133
136
|
}
|
|
134
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* The last crumb with its siblings: a button with the crumb's words and a
|
|
140
|
+
* ⌄ (`aria-haspopup="menu"`) that drops the siblings' `Menu` under it and
|
|
141
|
+
* takes it away again; picking one or a key that closes the menu gives
|
|
142
|
+
* the focus back to the crumb. On a page's path bar it stands in the
|
|
143
|
+
* page's heading.
|
|
144
|
+
*/
|
|
145
|
+
function SiblingsCrumb({ label, heading, siblings }) {
|
|
146
|
+
const [crumb, setCrumb] = useState(null);
|
|
147
|
+
const [open, setOpen] = useState(false);
|
|
148
|
+
const current = siblings.entries.find((entry) => (entry.kind === undefined || entry.kind === 'item') &&
|
|
149
|
+
entry.current !== undefined &&
|
|
150
|
+
entry.current !== null);
|
|
151
|
+
const close = (by) => {
|
|
152
|
+
setOpen(false);
|
|
153
|
+
if (by === 'keyboard')
|
|
154
|
+
crumb?.focus();
|
|
155
|
+
};
|
|
156
|
+
const button = (_jsxs("button", { "aria-expanded": open, "aria-haspopup": "menu", className: "crumb-label crumb-siblings",
|
|
157
|
+
// A press while the menu is open closes it and gives the focus back
|
|
158
|
+
// here, since the menu that held it goes away.
|
|
159
|
+
onClick: () => (open ? close('keyboard') : setOpen(true)),
|
|
160
|
+
// While the menu holds the focus, a press here closes it, not the focus.
|
|
161
|
+
onMouseDown: (event) => {
|
|
162
|
+
if (open)
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
}, ref: setCrumb, type: "button", ...tooltip(`${label} · ${siblings.label}`), children: [_jsx("span", { className: "crumb-text", children: label }), _jsx(ChevronDown, { "aria-hidden": true, size: ICON_SM })] }));
|
|
165
|
+
return (_jsxs(_Fragment, { children: [heading ? _jsx("h2", { className: "crumb-heading", children: button }) : button, open && crumb !== null && (_jsx(Menu, { anchor: crumb, compact: true, entries: siblings.entries, initial: current?.id ?? null, label: siblings.label, onClose: close, onPick: (id) => {
|
|
166
|
+
siblings.onPick(id);
|
|
167
|
+
close('keyboard');
|
|
168
|
+
} }))] }));
|
|
169
|
+
}
|
|
135
170
|
/**
|
|
136
171
|
* The row a pane opens with: a path bar, in the listing look (under
|
|
137
172
|
* `.listing-root`). Its crumbs say where the pane is; one handed as a
|
|
@@ -140,6 +175,8 @@ function showFocusedCrumb(trail, crumb) {
|
|
|
140
175
|
* way first, the last one only once they have. A cut crumb opens its whole
|
|
141
176
|
* text as a tooltip, and a crumb in full view opens none (a control's
|
|
142
177
|
* `tip`, when it has one, says what a press does instead, cut or not).
|
|
178
|
+
* A bar with `siblings` makes its last crumb a ⌄ button that drops the
|
|
179
|
+
* places beside it (a service's other versions) as a `Menu`.
|
|
143
180
|
* Facts and controls sit at the bar's end (`.path-tools`): a state
|
|
144
181
|
* as `PathFact`, compact verbs as `QuietAction` and `.path-star` icon
|
|
145
182
|
* buttons. In a bar too narrow for everything, things give way in one
|
|
@@ -150,7 +187,7 @@ function showFocusedCrumb(trail, crumb) {
|
|
|
150
187
|
* Nothing is drawn over anything, and no control leaves the row. The bar
|
|
151
188
|
* fits itself after every render and whenever any box in it resizes.
|
|
152
189
|
*/
|
|
153
|
-
export function PanePathBar({ trail, mark, heading = false, here, children }) {
|
|
190
|
+
export function PanePathBar({ trail, mark, heading = false, here, siblings = null, children }) {
|
|
154
191
|
const rowRef = useRef(null);
|
|
155
192
|
const sizes = useRef(null);
|
|
156
193
|
const last = trail.at(-1);
|
|
@@ -239,7 +276,7 @@ export function PanePathBar({ trail, mark, heading = false, here, children }) {
|
|
|
239
276
|
const last = index === trail.length - 1;
|
|
240
277
|
const label = typeof crumb === 'string' ? crumb : crumb.label;
|
|
241
278
|
const Label = last && heading ? 'h2' : 'span';
|
|
242
|
-
return (_jsxs(Fragment, { children: [index > 0 && (_jsx("span", { "aria-hidden": true, className: "crumb-separator", children: "/" })), _jsxs("span", { className: last ? 'crumb here' : 'crumb', children: [typeof crumb === 'string' ? (_jsx(Label, { className: "crumb-label", children: _jsx("span", { className: "crumb-text", ...cutTooltip(label), children: label }) })) : (_jsx("button", { className: "crumb-label", onClick: crumb.onOpen, type: "button", ...describedTooltip(crumb.tip), children: _jsx("span", { className: "crumb-text", ...(crumb.tip === undefined ? cutTooltip(label) : {}), children: label }) })), last && here] })] }, `${index}:${label}`));
|
|
279
|
+
return (_jsxs(Fragment, { children: [index > 0 && (_jsx("span", { "aria-hidden": true, className: "crumb-separator", children: "/" })), _jsxs("span", { className: last ? 'crumb here' : 'crumb', children: [last && siblings !== null ? (_jsx(SiblingsCrumb, { heading: heading, label: label, siblings: siblings })) : typeof crumb === 'string' ? (_jsx(Label, { className: "crumb-label", children: _jsx("span", { className: "crumb-text", ...cutTooltip(label), children: label }) })) : (_jsx("button", { className: "crumb-label", onClick: crumb.onOpen, type: "button", ...describedTooltip(crumb.tip), children: _jsx("span", { className: "crumb-text", ...(crumb.tip === undefined ? cutTooltip(label) : {}), children: label }) })), last && here] })] }, last && siblings !== null ? 'siblings' : `${index}:${label}`));
|
|
243
280
|
})] }), children !== undefined && children !== null && children !== false && (_jsx("div", { className: "path-tools", children: _jsx(InPathBarContext.Provider, { value: true, children: children }) }))] }));
|
|
244
281
|
}
|
|
245
282
|
/**
|
package/dist/pane/PaneKeys.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ControlVerb } from './PaneActions.js';
|
|
2
|
+
import { type TabOrder } from './PaneKeys.logic.js';
|
|
2
3
|
/**
|
|
3
4
|
* A pane's home that shows: the first `data-pane-home` element in it (the
|
|
4
5
|
* sidebar's with `"sidebar"`) outside a hidden page, or null for none.
|
|
@@ -37,8 +38,11 @@ export interface SidebarTabStops {
|
|
|
37
38
|
* its listing keeps them in the Tab order (`Row`'s `tabbable`); a sidebar
|
|
38
39
|
* row's never are. With `alone` (no sidebar shown) the page's stops make
|
|
39
40
|
* the one cycle, wrapping at either end, and the sidebar is never named.
|
|
41
|
+
* With `order` `listing`, each pane's listing comes first instead of where
|
|
42
|
+
* the document puts it (`listingFirstStop`): the page's listing, its other
|
|
43
|
+
* stops, then the sidebar's listing and, with `sidebar`, its stops.
|
|
40
44
|
*/
|
|
41
|
-
export declare function nextTabStop(main: Element, home: HTMLElement, from: TabStop, back: boolean, sidebar?: SidebarTabStops | null, alone?: boolean): TabStop;
|
|
45
|
+
export declare function nextTabStop(main: Element, home: HTMLElement, from: TabStop, back: boolean, sidebar?: SidebarTabStops | null, alone?: boolean, order?: TabOrder): TabStop;
|
|
42
46
|
/**
|
|
43
47
|
* The rows one Page Up or Page Down moves in a pane: what its home
|
|
44
48
|
* (`data-pane-home`) shows of 24px rows, less one kept in view.
|