@bigpixelrocket/uiok 0.3.0 → 0.5.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 +50 -1
- package/dist/button/TextLink.d.ts +19 -3
- package/dist/button/TextLink.js +4 -3
- package/dist/dialog/ConfirmDialog.d.ts +7 -1
- package/dist/dialog/ConfirmDialog.js +2 -2
- package/dist/dialog/ModalDialog.js +8 -2
- package/dist/dialog/ProgressDialog.d.ts +7 -1
- package/dist/dialog/ProgressDialog.js +2 -2
- package/dist/dialog/TypedNameDialog.d.ts +8 -0
- package/dist/field/Check.d.ts +9 -2
- package/dist/field/Check.js +5 -4
- package/dist/field/Controls.d.ts +198 -0
- package/dist/field/Controls.js +94 -0
- package/dist/field/FieldLayout.d.ts +126 -0
- package/dist/field/FieldLayout.js +89 -0
- package/dist/field/index.d.ts +9 -6
- package/dist/field/index.js +9 -6
- package/dist/frame/Dock.js +1 -1
- package/dist/frame/SidebarResizer.js +1 -1
- package/dist/frame/Tree.d.ts +17 -4
- package/dist/frame/Tree.js +34 -9
- package/dist/frame/WindowFrame.js +2 -1
- package/dist/frame/frame.css +26 -4
- 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/labels/UiokLabels.d.ts +3 -0
- package/dist/labels/UiokLabels.js +3 -1
- package/dist/labels/index.d.ts +1 -0
- package/dist/labels/index.js +1 -0
- package/dist/labels/settings.d.ts +6 -0
- package/dist/labels/settings.js +1 -0
- package/dist/labels/viewer.d.ts +193 -0
- package/dist/labels/viewer.js +124 -0
- package/dist/listing/Listing.d.ts +60 -4
- package/dist/listing/Listing.js +39 -10
- package/dist/listing/ListingScope.d.ts +7 -0
- package/dist/listing/ListingScope.js +8 -0
- package/dist/listing/PaneMessage.d.ts +28 -0
- package/dist/listing/PaneMessage.js +12 -0
- package/dist/listing/Timeline.d.ts +51 -0
- package/dist/listing/Timeline.js +28 -0
- package/dist/listing/index.d.ts +7 -3
- package/dist/listing/index.js +6 -2
- package/dist/listing/listing.css +185 -22
- 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 +89 -0
- package/dist/menu/Menu.js +143 -0
- package/dist/menu/Menu.logic.d.ts +56 -0
- package/dist/menu/Menu.logic.js +64 -0
- package/dist/menu/index.d.ts +5 -1
- package/dist/menu/index.js +5 -1
- package/dist/menu/menu.css +51 -0
- package/dist/palette/Palette.d.ts +3 -2
- package/dist/palette/Palette.js +8 -4
- package/dist/palette/PaletteRows.d.ts +129 -0
- package/dist/palette/PaletteRows.js +74 -0
- package/dist/palette/index.d.ts +5 -2
- package/dist/palette/index.js +5 -2
- package/dist/pane/PaneFrame.d.ts +22 -1
- package/dist/pane/PaneFrame.js +42 -5
- package/dist/pane/index.d.ts +1 -1
- 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 +4 -0
- package/dist/surface/Card.d.ts +18 -0
- package/dist/surface/Card.js +10 -0
- package/dist/surface/FactTable.d.ts +44 -0
- package/dist/surface/FactTable.js +33 -0
- package/dist/surface/Notice.d.ts +45 -0
- package/dist/surface/Notice.js +27 -0
- package/dist/surface/index.d.ts +7 -3
- package/dist/surface/index.js +7 -3
- package/dist/surface/surface.css +64 -0
- 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/index.d.ts +3 -1
- package/dist/terminal/index.js +3 -1
- package/dist/terminal/terminal.css +29 -0
- package/dist/themes/themes.generated.css +21 -0
- package/dist/themes/tokens.d.ts +1 -0
- package/dist/themes/tokens.js +16 -1
- package/dist/viewer/AudioView.d.ts +13 -0
- package/dist/viewer/AudioView.js +25 -0
- package/dist/viewer/HexJump.logic.d.ts +16 -0
- package/dist/viewer/HexJump.logic.js +27 -0
- package/dist/viewer/HexRows.logic.d.ts +55 -0
- package/dist/viewer/HexRows.logic.js +84 -0
- package/dist/viewer/HexSelection.logic.d.ts +57 -0
- package/dist/viewer/HexSelection.logic.js +68 -0
- package/dist/viewer/HexView.d.ts +10 -0
- package/dist/viewer/HexView.js +291 -0
- package/dist/viewer/HexViewport.logic.d.ts +61 -0
- package/dist/viewer/HexViewport.logic.js +79 -0
- package/dist/viewer/ImageView.d.ts +19 -0
- package/dist/viewer/ImageView.js +230 -0
- package/dist/viewer/ImageZoom.logic.d.ts +65 -0
- package/dist/viewer/ImageZoom.logic.js +119 -0
- package/dist/viewer/LatestRead.logic.d.ts +27 -0
- package/dist/viewer/LatestRead.logic.js +55 -0
- package/dist/viewer/MediaControls.d.ts +25 -0
- package/dist/viewer/MediaControls.js +183 -0
- package/dist/viewer/MediaPlayer.logic.d.ts +53 -0
- package/dist/viewer/MediaPlayer.logic.js +68 -0
- package/dist/viewer/PdfView.d.ts +23 -0
- package/dist/viewer/PdfView.js +25 -0
- package/dist/viewer/QuietFocus.d.ts +19 -0
- package/dist/viewer/QuietFocus.js +27 -0
- package/dist/viewer/ScaledScroll.logic.d.ts +30 -0
- package/dist/viewer/ScaledScroll.logic.js +28 -0
- package/dist/viewer/ScaledScrollbar.d.ts +19 -0
- package/dist/viewer/ScaledScrollbar.js +71 -0
- package/dist/viewer/SyntaxHighlighter.d.ts +29 -0
- package/dist/viewer/SyntaxHighlighter.js +144 -0
- package/dist/viewer/SyntaxLanguage.logic.d.ts +110 -0
- package/dist/viewer/SyntaxLanguage.logic.js +283 -0
- package/dist/viewer/SyntaxService.d.ts +75 -0
- package/dist/viewer/SyntaxService.js +49 -0
- package/dist/viewer/SyntaxSession.logic.d.ts +78 -0
- package/dist/viewer/SyntaxSession.logic.js +221 -0
- package/dist/viewer/SyntaxWorker.d.ts +6 -0
- package/dist/viewer/SyntaxWorker.js +8 -0
- package/dist/viewer/TextEncoding.logic.d.ts +35 -0
- package/dist/viewer/TextEncoding.logic.js +58 -0
- package/dist/viewer/TextRows.logic.d.ts +86 -0
- package/dist/viewer/TextRows.logic.js +241 -0
- package/dist/viewer/TextSelection.logic.d.ts +97 -0
- package/dist/viewer/TextSelection.logic.js +139 -0
- package/dist/viewer/TextView.d.ts +13 -0
- package/dist/viewer/TextView.js +448 -0
- package/dist/viewer/TextViewport.logic.d.ts +70 -0
- package/dist/viewer/TextViewport.logic.js +116 -0
- package/dist/viewer/VideoView.d.ts +18 -0
- package/dist/viewer/VideoView.js +53 -0
- package/dist/viewer/ViewerClipboard.d.ts +30 -0
- package/dist/viewer/ViewerClipboard.js +70 -0
- package/dist/viewer/ViewerFrame.logic.d.ts +61 -0
- package/dist/viewer/ViewerFrame.logic.js +130 -0
- package/dist/viewer/ViewerKeys.d.ts +16 -0
- package/dist/viewer/ViewerKeys.js +14 -0
- package/dist/viewer/ViewerScope.d.ts +12 -0
- package/dist/viewer/ViewerScope.js +22 -0
- package/dist/viewer/ViewerViews.d.ts +28 -0
- package/dist/viewer/ViewerViews.js +22 -0
- package/dist/viewer/ViewerWindow.d.ts +53 -0
- package/dist/viewer/ViewerWindow.js +219 -0
- package/dist/viewer/index.d.ts +12 -0
- package/dist/viewer/index.js +12 -0
- package/dist/viewer/types.d.ts +151 -0
- package/dist/viewer/types.js +26 -0
- package/dist/viewer/useElementHeight.d.ts +6 -0
- package/dist/viewer/useElementHeight.js +22 -0
- package/dist/viewer/useElementSize.d.ts +7 -0
- package/dist/viewer/useElementSize.js +24 -0
- package/dist/viewer/useEscapeToClear.d.ts +8 -0
- package/dist/viewer/useEscapeToClear.js +26 -0
- package/dist/viewer/useHexDocument.d.ts +41 -0
- package/dist/viewer/useHexDocument.js +144 -0
- package/dist/viewer/useMediaElement.d.ts +10 -0
- package/dist/viewer/useMediaElement.js +24 -0
- package/dist/viewer/useSyntaxHighlight.d.ts +24 -0
- package/dist/viewer/useSyntaxHighlight.js +133 -0
- package/dist/viewer/useTextDocument.d.ts +66 -0
- package/dist/viewer/useTextDocument.js +245 -0
- package/dist/viewer/viewer.css +645 -0
- package/package.json +7 -1
package/dist/icon/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Icons: the four sizes for lucide's `size` prop,
|
|
2
|
+
* Icons: the four sizes for lucide's `size` prop, the one spinner, and
|
|
3
|
+
* `ProductMark`, a product's brand mark drawn from the app's data.
|
|
3
4
|
*/
|
|
4
5
|
export * from './sizes.js';
|
|
5
6
|
export * from './Spinner.js';
|
|
7
|
+
export * from './ProductMark.js';
|
package/dist/icon/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Icons: the four sizes for lucide's `size` prop,
|
|
2
|
+
* Icons: the four sizes for lucide's `size` prop, the one spinner, and
|
|
3
|
+
* `ProductMark`, a product's brand mark drawn from the app's data.
|
|
3
4
|
*/
|
|
4
5
|
export * from './sizes.js';
|
|
5
6
|
export * from './Spinner.js';
|
|
7
|
+
export * from './ProductMark.js';
|
|
@@ -10,6 +10,7 @@ import { type PaneTabsLabels } from './paneTabs.js';
|
|
|
10
10
|
import { type SelectAllLabels } from './selectAll.js';
|
|
11
11
|
import { type SettingsLabels } from './settings.js';
|
|
12
12
|
import { type TerminalLabels } from './terminal.js';
|
|
13
|
+
import { type ViewerLabels } from './viewer.js';
|
|
13
14
|
/**
|
|
14
15
|
* Every chrome string UIOK's components share across instances, grouped by
|
|
15
16
|
* area: key names, and, as areas arrive, verbs such as Cancel and More.
|
|
@@ -42,6 +43,8 @@ export interface UiokLabels {
|
|
|
42
43
|
readonly paneTabs: PaneTabsLabels;
|
|
43
44
|
/** The Settings dialog's title, sidebar, and Done, and the Appearance page's words (`SettingsDialog`, `AppearanceSettings`). */
|
|
44
45
|
readonly settings: SettingsLabels;
|
|
46
|
+
/** The file viewer's modes, facts, notices, and each view's words and formats (`@bigpixelrocket/uiok/viewer`). */
|
|
47
|
+
readonly viewer: ViewerLabels;
|
|
45
48
|
}
|
|
46
49
|
/** The English labels every component falls back to without a `UiokProvider`. */
|
|
47
50
|
export declare const DEFAULT_LABELS: UiokLabels;
|
|
@@ -18,6 +18,7 @@ import { DEFAULT_PANE_TABS_LABELS } from './paneTabs.js';
|
|
|
18
18
|
import { DEFAULT_SELECT_ALL_LABELS } from './selectAll.js';
|
|
19
19
|
import { DEFAULT_SETTINGS_LABELS } from './settings.js';
|
|
20
20
|
import { DEFAULT_TERMINAL_LABELS } from './terminal.js';
|
|
21
|
+
import { DEFAULT_VIEWER_LABELS } from './viewer.js';
|
|
21
22
|
/** The English labels every component falls back to without a `UiokProvider`. */
|
|
22
23
|
export const DEFAULT_LABELS = {
|
|
23
24
|
keys: DEFAULT_KEY_LABELS,
|
|
@@ -31,5 +32,6 @@ export const DEFAULT_LABELS = {
|
|
|
31
32
|
selectAll: DEFAULT_SELECT_ALL_LABELS,
|
|
32
33
|
terminal: DEFAULT_TERMINAL_LABELS,
|
|
33
34
|
paneTabs: DEFAULT_PANE_TABS_LABELS,
|
|
34
|
-
settings: DEFAULT_SETTINGS_LABELS
|
|
35
|
+
settings: DEFAULT_SETTINGS_LABELS,
|
|
36
|
+
viewer: DEFAULT_VIEWER_LABELS
|
|
35
37
|
};
|
package/dist/labels/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export { DEFAULT_PANE_TABS_LABELS, type PaneTabsLabels } from './paneTabs.js';
|
|
|
11
11
|
export { DEFAULT_SELECT_ALL_LABELS, type SelectAllLabels } from './selectAll.js';
|
|
12
12
|
export { DEFAULT_SETTINGS_LABELS, type AppearanceLabels, type AppearanceMode, type SettingsLabels } from './settings.js';
|
|
13
13
|
export { DEFAULT_TERMINAL_LABELS, type TerminalLabels } from './terminal.js';
|
|
14
|
+
export { DEFAULT_VIEWER_LABELS, type ViewerContentLabels, type ViewerLabels, type ViewerModeLabels } from './viewer.js';
|
|
14
15
|
export { DEFAULT_LABELS, type UiokLabels } from './UiokLabels.js';
|
|
15
16
|
export { mergeLabels, UiokProvider, useLabels, type LabelsOverride, type UiokLabelsOverride, type UiokProviderProps } from './UiokProvider.js';
|
package/dist/labels/index.js
CHANGED
|
@@ -11,5 +11,6 @@ export { DEFAULT_PANE_TABS_LABELS } from './paneTabs.js';
|
|
|
11
11
|
export { DEFAULT_SELECT_ALL_LABELS } from './selectAll.js';
|
|
12
12
|
export { DEFAULT_SETTINGS_LABELS } from './settings.js';
|
|
13
13
|
export { DEFAULT_TERMINAL_LABELS } from './terminal.js';
|
|
14
|
+
export { DEFAULT_VIEWER_LABELS } from './viewer.js';
|
|
14
15
|
export { DEFAULT_LABELS } from './UiokLabels.js';
|
|
15
16
|
export { mergeLabels, UiokProvider, useLabels } from './UiokProvider.js';
|
|
@@ -39,6 +39,12 @@ export interface SettingsLabels {
|
|
|
39
39
|
readonly sidebar: string;
|
|
40
40
|
/** The dialog's one verb, on Return and Escape: "Done". */
|
|
41
41
|
readonly done: string;
|
|
42
|
+
/**
|
|
43
|
+
* A sidebar row's accessible name while it carries a chip: its page and
|
|
44
|
+
* the chip's words, apart, so they are not read as one word ("Updates,
|
|
45
|
+
* Update to 1.4.4").
|
|
46
|
+
*/
|
|
47
|
+
readonly pageWithChip: (page: string, chip: string) => string;
|
|
42
48
|
/** The Appearance page's words. */
|
|
43
49
|
readonly appearance: AppearanceLabels;
|
|
44
50
|
}
|
package/dist/labels/settings.js
CHANGED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words the read-only file viewer repeats for every file: its modes,
|
|
3
|
+
* the facts line, change notices, each view's status line, buttons, and
|
|
4
|
+
* fallbacks, and the number, size, and date formats it writes them with.
|
|
5
|
+
* The file's name and contents are the app's.
|
|
6
|
+
*/
|
|
7
|
+
/** The names of the viewer's modes in its switcher (`ViewerWindow`). */
|
|
8
|
+
export interface ViewerModeLabels {
|
|
9
|
+
/** A text file's text: "Text". */
|
|
10
|
+
readonly text: string;
|
|
11
|
+
/** An SVG's markup: "Source". */
|
|
12
|
+
readonly source: string;
|
|
13
|
+
/** Any file's bytes: "Hex". */
|
|
14
|
+
readonly hex: string;
|
|
15
|
+
/** An image: "Image". */
|
|
16
|
+
readonly image: string;
|
|
17
|
+
/** Audio or video: "Player". */
|
|
18
|
+
readonly player: string;
|
|
19
|
+
/** A PDF: "Document". */
|
|
20
|
+
readonly document: string;
|
|
21
|
+
}
|
|
22
|
+
/** What kind of file the facts line names, given the format where one is known. */
|
|
23
|
+
export interface ViewerContentLabels {
|
|
24
|
+
/** "Text". */
|
|
25
|
+
readonly text: string;
|
|
26
|
+
/** "Binary". */
|
|
27
|
+
readonly binary: string;
|
|
28
|
+
/** "SVG image". */
|
|
29
|
+
readonly svg: string;
|
|
30
|
+
/** "PDF document". */
|
|
31
|
+
readonly pdf: string;
|
|
32
|
+
/** "PNG image", or "Image" when `format` is null. */
|
|
33
|
+
readonly image: (format: string | null) => string;
|
|
34
|
+
/** "MP3 audio", or "Audio" when `format` is null. */
|
|
35
|
+
readonly audio: (format: string | null) => string;
|
|
36
|
+
/** "QuickTime video", or "Video" when `format` is null. */
|
|
37
|
+
readonly video: (format: string | null) => string;
|
|
38
|
+
}
|
|
39
|
+
/** The viewer's shared words. */
|
|
40
|
+
export interface ViewerLabels {
|
|
41
|
+
/** The window's title while it has no file name to show: "Viewer". */
|
|
42
|
+
readonly title: string;
|
|
43
|
+
/** The failure shown when the viewer was given no reader: "The viewer could not reach its file." */
|
|
44
|
+
readonly unreachable: string;
|
|
45
|
+
/** The failure a reader call that rejected settles into: "The app did not answer." */
|
|
46
|
+
readonly noAnswer: string;
|
|
47
|
+
/** The mode switcher's accessible name: "View as". */
|
|
48
|
+
readonly modesLabel: string;
|
|
49
|
+
/** Each mode's name. */
|
|
50
|
+
readonly modes: ViewerModeLabels;
|
|
51
|
+
/** The verb that reopens a changed file: "Reload". */
|
|
52
|
+
readonly reload: string;
|
|
53
|
+
/** The kind of file, for the facts line. */
|
|
54
|
+
readonly content: ViewerContentLabels;
|
|
55
|
+
/** Where a copy came from, first in the facts line: "in backup.zip". */
|
|
56
|
+
readonly inArchive: (archive: string) => string;
|
|
57
|
+
/** When the file last changed, in the facts line: "Modified 2026-10-05 09:30". */
|
|
58
|
+
readonly modified: (date: string) => string;
|
|
59
|
+
/** The exact size on hover over the facts line: "1,234 bytes". */
|
|
60
|
+
readonly exactSize: (count: number) => string;
|
|
61
|
+
/** The note on hover for a copy: "A read-only copy of src/a.txt in backup.zip". */
|
|
62
|
+
readonly readOnlyCopy: (path: string, archive: string) => string;
|
|
63
|
+
/** The notices that the file changed at its source. */
|
|
64
|
+
readonly change: {
|
|
65
|
+
/** "The file changed on disk." */
|
|
66
|
+
readonly modified: string;
|
|
67
|
+
/** "The file was replaced on disk." */
|
|
68
|
+
readonly replaced: string;
|
|
69
|
+
/** "The file was moved or deleted. This window still shows it as it was opened." */
|
|
70
|
+
readonly removed: string;
|
|
71
|
+
};
|
|
72
|
+
/** What the text and hex views show for an empty file: "The file is empty." */
|
|
73
|
+
readonly empty: string;
|
|
74
|
+
/** The status line while a large selection is read for copy: "Copying the selection…". */
|
|
75
|
+
readonly copying: string;
|
|
76
|
+
/** The status line when copy failed: "Could not copy the selection." */
|
|
77
|
+
readonly copyFailed: string;
|
|
78
|
+
/** The text view's words. */
|
|
79
|
+
readonly text: {
|
|
80
|
+
/** The rows' accessible name: "Text of notes.txt". */
|
|
81
|
+
readonly rows: (name: string) => string;
|
|
82
|
+
/** The status line's position: "Line 1,561". */
|
|
83
|
+
readonly line: (line: number) => string;
|
|
84
|
+
/** The position while lines are still being counted: "Byte 8,192 · Counting lines…". */
|
|
85
|
+
readonly counting: (byte: number) => string;
|
|
86
|
+
/** The wrap toggle: "Wrap". */
|
|
87
|
+
readonly wrap: string;
|
|
88
|
+
/** UTF-8 that starts with a byte order mark: "UTF-8 with BOM". */
|
|
89
|
+
readonly utf8Bom: string;
|
|
90
|
+
/** Highlighting off for a large file: "JavaScript · Not highlighted, file over 16 MB". */
|
|
91
|
+
readonly tooLarge: (language: string, size: string) => string;
|
|
92
|
+
/** Long lines left plain: "JavaScript · Lines over 4 KB not highlighted". */
|
|
93
|
+
readonly longLines: (language: string, size: string) => string;
|
|
94
|
+
/** Highlighting failed to load: "JavaScript · Could not load highlighting". */
|
|
95
|
+
readonly unavailable: (language: string) => string;
|
|
96
|
+
/** A selection too large to copy: "The selection is too large to copy. Select up to 1 MB of text at a time." */
|
|
97
|
+
readonly copyTooLarge: (size: string) => string;
|
|
98
|
+
/** A copy a reload overtook: "The file was reloaded. Select the text again." */
|
|
99
|
+
readonly copyReloaded: string;
|
|
100
|
+
};
|
|
101
|
+
/** The hex view's words. */
|
|
102
|
+
readonly hex: {
|
|
103
|
+
/** The rows' accessible name: "Bytes of photo.png". */
|
|
104
|
+
readonly rows: (name: string) => string;
|
|
105
|
+
/** The status line's position: "Offset 00001F40". */
|
|
106
|
+
readonly top: (offset: string) => string;
|
|
107
|
+
/**
|
|
108
|
+
* The status line's selection: "Offset 00000010 selected" for one byte,
|
|
109
|
+
* "00000010–0000001F · 16 bytes" for more.
|
|
110
|
+
*/
|
|
111
|
+
readonly selection: (start: string, end: string, count: number) => string;
|
|
112
|
+
/** "Copy Hex". */
|
|
113
|
+
readonly copyHex: string;
|
|
114
|
+
/** "Copy Text". */
|
|
115
|
+
readonly copyText: string;
|
|
116
|
+
/** "The selection is too large to copy. Select up to 64 KB at a time." */
|
|
117
|
+
readonly copyTooLarge: (size: string) => string;
|
|
118
|
+
/** "The file was reloaded. Select the bytes again." */
|
|
119
|
+
readonly copyReloaded: string;
|
|
120
|
+
/** The jump button and its tooltip: "Go to Offset". */
|
|
121
|
+
readonly jump: string;
|
|
122
|
+
/** The jump field's accessible name: "Offset in hex". */
|
|
123
|
+
readonly jumpLabel: string;
|
|
124
|
+
/** The jump field's placeholder: "Offset, such as 1F40". */
|
|
125
|
+
readonly jumpPlaceholder: string;
|
|
126
|
+
/** "Type an offset in hex, such as 1F40 or 0x1F40." */
|
|
127
|
+
readonly jumpInvalid: string;
|
|
128
|
+
/** A jump in an empty file: "The file is empty." */
|
|
129
|
+
readonly jumpEmpty: string;
|
|
130
|
+
/** "Offset 2000 is past the end of the file. The last offset is 1FFF." */
|
|
131
|
+
readonly jumpPastEnd: (offset: string, last: string) => string;
|
|
132
|
+
};
|
|
133
|
+
/** The image view's words. */
|
|
134
|
+
readonly image: {
|
|
135
|
+
/** Before the image decodes: "Loading…". */
|
|
136
|
+
readonly loading: string;
|
|
137
|
+
/** "1,280 × 720 px", given the numbers already formatted. */
|
|
138
|
+
readonly pixelSize: (width: string, height: string) => string;
|
|
139
|
+
/** The zoom: "25%". */
|
|
140
|
+
readonly scale: (percent: string) => string;
|
|
141
|
+
/** An SVG without a size of its own: "No intrinsic size". */
|
|
142
|
+
readonly noIntrinsicSize: string;
|
|
143
|
+
/** The fit button: "Fit". */
|
|
144
|
+
readonly fit: string;
|
|
145
|
+
/** The fit button's tooltip: "Zoom to Fit". */
|
|
146
|
+
readonly fitTooltip: string;
|
|
147
|
+
/** "Actual Size". */
|
|
148
|
+
readonly actualSize: string;
|
|
149
|
+
/** "Could not decode this image, so it shows in hex." */
|
|
150
|
+
readonly fallbackDecode: string;
|
|
151
|
+
/** "Could not render this SVG, so it shows its source." */
|
|
152
|
+
readonly fallbackSvg: string;
|
|
153
|
+
};
|
|
154
|
+
/** The audio and video players' words. */
|
|
155
|
+
readonly media: {
|
|
156
|
+
/** "Play". */
|
|
157
|
+
readonly play: string;
|
|
158
|
+
/** "Pause". */
|
|
159
|
+
readonly pause: string;
|
|
160
|
+
/** The seek bar's name: "Seek". */
|
|
161
|
+
readonly seek: string;
|
|
162
|
+
/** The seek bar's value: "1:05 of 3:20". */
|
|
163
|
+
readonly seekValue: (elapsed: string, total: string) => string;
|
|
164
|
+
/** "Mute". */
|
|
165
|
+
readonly mute: string;
|
|
166
|
+
/** "Unmute". */
|
|
167
|
+
readonly unmute: string;
|
|
168
|
+
/** The volume slider's name: "Volume". */
|
|
169
|
+
readonly volume: string;
|
|
170
|
+
/** "Full Screen". */
|
|
171
|
+
readonly enterFullScreen: string;
|
|
172
|
+
/** "Exit Full Screen". */
|
|
173
|
+
readonly exitFullScreen: string;
|
|
174
|
+
/** A format the browser does not play: "Could not play this video format, so it shows in hex." */
|
|
175
|
+
readonly fallbackFormat: (media: 'audio' | 'video') => string;
|
|
176
|
+
/** "Could not decode this video, so it shows in hex." */
|
|
177
|
+
readonly fallbackDecode: (media: 'audio' | 'video') => string;
|
|
178
|
+
/** "Could not play this video, so it shows in hex." */
|
|
179
|
+
readonly fallbackPlay: (media: 'audio' | 'video') => string;
|
|
180
|
+
/** A video file with sound only: "No picture to show". */
|
|
181
|
+
readonly noPicture: string;
|
|
182
|
+
/** "1,280 × 720 px", given the numbers already formatted. */
|
|
183
|
+
readonly pixelSize: (width: string, height: string) => string;
|
|
184
|
+
};
|
|
185
|
+
/** A whole number as the app's language writes it: "1,234". */
|
|
186
|
+
readonly number: (value: number) => string;
|
|
187
|
+
/** A size in bytes, short: "1.4 MB". */
|
|
188
|
+
readonly size: (bytes: number) => string;
|
|
189
|
+
/** A date and time: "2026-10-05 09:30"; empty for a date the file does not have. */
|
|
190
|
+
readonly dateTime: (epochMs: number) => string;
|
|
191
|
+
}
|
|
192
|
+
/** English viewer words: the `viewer` group `UiokProvider` starts from. */
|
|
193
|
+
export declare const DEFAULT_VIEWER_LABELS: ViewerLabels;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words the read-only file viewer repeats for every file: its modes,
|
|
3
|
+
* the facts line, change notices, each view's status line, buttons, and
|
|
4
|
+
* fallbacks, and the number, size, and date formats it writes them with.
|
|
5
|
+
* The file's name and contents are the app's.
|
|
6
|
+
*/
|
|
7
|
+
const WHOLE = new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 });
|
|
8
|
+
const ONE_DECIMAL = new Intl.NumberFormat('en-US', { maximumFractionDigits: 1 });
|
|
9
|
+
const SIZE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
10
|
+
/** "1.4 MB" in English: 1024 steps, one decimal under 100 of a unit, none from 100. */
|
|
11
|
+
const englishSize = (bytes) => {
|
|
12
|
+
if (!Number.isFinite(bytes) || bytes < 0)
|
|
13
|
+
return '–';
|
|
14
|
+
let value = bytes;
|
|
15
|
+
let unit = 0;
|
|
16
|
+
while (value >= 1024 && unit < SIZE_UNITS.length - 1) {
|
|
17
|
+
value /= 1024;
|
|
18
|
+
unit += 1;
|
|
19
|
+
}
|
|
20
|
+
const amount = unit === 0 || value >= 100 ? WHOLE.format(value) : ONE_DECIMAL.format(value);
|
|
21
|
+
return `${amount} ${SIZE_UNITS[unit] ?? 'B'}`;
|
|
22
|
+
};
|
|
23
|
+
/** "2026-10-05 09:30", local time. */
|
|
24
|
+
const englishDateTime = (epochMs) => {
|
|
25
|
+
if (!Number.isFinite(epochMs) || epochMs <= 0)
|
|
26
|
+
return '';
|
|
27
|
+
const date = new Date(epochMs);
|
|
28
|
+
const pad = (part) => String(part).padStart(2, '0');
|
|
29
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
30
|
+
};
|
|
31
|
+
/** English viewer words: the `viewer` group `UiokProvider` starts from. */
|
|
32
|
+
export const DEFAULT_VIEWER_LABELS = {
|
|
33
|
+
title: 'Viewer',
|
|
34
|
+
unreachable: 'The viewer could not reach its file.',
|
|
35
|
+
noAnswer: 'The app did not answer.',
|
|
36
|
+
modesLabel: 'View as',
|
|
37
|
+
modes: {
|
|
38
|
+
text: 'Text',
|
|
39
|
+
source: 'Source',
|
|
40
|
+
hex: 'Hex',
|
|
41
|
+
image: 'Image',
|
|
42
|
+
player: 'Player',
|
|
43
|
+
document: 'Document'
|
|
44
|
+
},
|
|
45
|
+
reload: 'Reload',
|
|
46
|
+
content: {
|
|
47
|
+
text: 'Text',
|
|
48
|
+
binary: 'Binary',
|
|
49
|
+
svg: 'SVG image',
|
|
50
|
+
pdf: 'PDF document',
|
|
51
|
+
image: (format) => (format ? `${format} image` : 'Image'),
|
|
52
|
+
audio: (format) => (format ? `${format} audio` : 'Audio'),
|
|
53
|
+
video: (format) => (format ? `${format} video` : 'Video')
|
|
54
|
+
},
|
|
55
|
+
inArchive: (archive) => `in ${archive}`,
|
|
56
|
+
modified: (date) => `Modified ${date}`,
|
|
57
|
+
exactSize: (count) => (count === 1 ? '1 byte' : `${WHOLE.format(count)} bytes`),
|
|
58
|
+
readOnlyCopy: (path, archive) => `A read-only copy of ${path} in ${archive}`,
|
|
59
|
+
change: {
|
|
60
|
+
modified: 'The file changed on disk.',
|
|
61
|
+
replaced: 'The file was replaced on disk.',
|
|
62
|
+
removed: 'The file was moved or deleted. This window still shows it as it was opened.'
|
|
63
|
+
},
|
|
64
|
+
empty: 'The file is empty.',
|
|
65
|
+
copying: 'Copying the selection…',
|
|
66
|
+
copyFailed: 'Could not copy the selection.',
|
|
67
|
+
text: {
|
|
68
|
+
rows: (name) => `Text of ${name}`,
|
|
69
|
+
line: (line) => `Line ${WHOLE.format(line)}`,
|
|
70
|
+
counting: (byte) => `Byte ${WHOLE.format(byte)} · Counting lines…`,
|
|
71
|
+
wrap: 'Wrap',
|
|
72
|
+
utf8Bom: 'UTF-8 with BOM',
|
|
73
|
+
tooLarge: (language, size) => `${language} · Not highlighted, file over ${size}`,
|
|
74
|
+
longLines: (language, size) => `${language} · Lines over ${size} not highlighted`,
|
|
75
|
+
unavailable: (language) => `${language} · Could not load highlighting`,
|
|
76
|
+
copyTooLarge: (size) => `The selection is too large to copy. Select up to ${size} of text at a time.`,
|
|
77
|
+
copyReloaded: 'The file was reloaded. Select the text again.'
|
|
78
|
+
},
|
|
79
|
+
hex: {
|
|
80
|
+
rows: (name) => `Bytes of ${name}`,
|
|
81
|
+
top: (offset) => `Offset ${offset}`,
|
|
82
|
+
selection: (start, end, count) => count === 1 ? `Offset ${start} selected` : `${start}–${end} · ${WHOLE.format(count)} bytes`,
|
|
83
|
+
copyHex: 'Copy Hex',
|
|
84
|
+
copyText: 'Copy Text',
|
|
85
|
+
copyTooLarge: (size) => `The selection is too large to copy. Select up to ${size} at a time.`,
|
|
86
|
+
copyReloaded: 'The file was reloaded. Select the bytes again.',
|
|
87
|
+
jump: 'Go to Offset',
|
|
88
|
+
jumpLabel: 'Offset in hex',
|
|
89
|
+
jumpPlaceholder: 'Offset, such as 1F40',
|
|
90
|
+
jumpInvalid: 'Type an offset in hex, such as 1F40 or 0x1F40.',
|
|
91
|
+
jumpEmpty: 'The file is empty.',
|
|
92
|
+
jumpPastEnd: (offset, last) => `Offset ${offset} is past the end of the file. The last offset is ${last}.`
|
|
93
|
+
},
|
|
94
|
+
image: {
|
|
95
|
+
loading: 'Loading…',
|
|
96
|
+
pixelSize: (width, height) => `${width} × ${height} px`,
|
|
97
|
+
scale: (percent) => `${percent}%`,
|
|
98
|
+
noIntrinsicSize: 'No intrinsic size',
|
|
99
|
+
fit: 'Fit',
|
|
100
|
+
fitTooltip: 'Zoom to Fit',
|
|
101
|
+
actualSize: 'Actual Size',
|
|
102
|
+
fallbackDecode: 'Could not decode this image, so it shows in hex.',
|
|
103
|
+
fallbackSvg: 'Could not render this SVG, so it shows its source.'
|
|
104
|
+
},
|
|
105
|
+
media: {
|
|
106
|
+
play: 'Play',
|
|
107
|
+
pause: 'Pause',
|
|
108
|
+
seek: 'Seek',
|
|
109
|
+
seekValue: (elapsed, total) => `${elapsed} of ${total}`,
|
|
110
|
+
mute: 'Mute',
|
|
111
|
+
unmute: 'Unmute',
|
|
112
|
+
volume: 'Volume',
|
|
113
|
+
enterFullScreen: 'Full Screen',
|
|
114
|
+
exitFullScreen: 'Exit Full Screen',
|
|
115
|
+
fallbackFormat: (media) => `Could not play this ${media} format, so it shows in hex.`,
|
|
116
|
+
fallbackDecode: (media) => `Could not decode this ${media}, so it shows in hex.`,
|
|
117
|
+
fallbackPlay: (media) => `Could not play this ${media}, so it shows in hex.`,
|
|
118
|
+
noPicture: 'No picture to show',
|
|
119
|
+
pixelSize: (width, height) => `${width} × ${height} px`
|
|
120
|
+
},
|
|
121
|
+
number: (value) => WHOLE.format(value),
|
|
122
|
+
size: englishSize,
|
|
123
|
+
dateTime: englishDateTime
|
|
124
|
+
};
|
|
@@ -111,7 +111,9 @@ export interface ListingProps {
|
|
|
111
111
|
* inside its pane. A listing with no rows says so in `empty`: a quiet row
|
|
112
112
|
* under the strip instead of a table (`.pane-message.empty`, starting where
|
|
113
113
|
* a row's icon starts, in the rows' type, dim), its column labels left out, so no
|
|
114
|
-
* header stands over a row that is not one.
|
|
114
|
+
* header stands over a row that is not one. Drawn outside the listing
|
|
115
|
+
* scope (the frame, a dialog, and a palette carry it), it carries
|
|
116
|
+
* `.listing-root` itself, so a listing looks the same anywhere.
|
|
115
117
|
*/
|
|
116
118
|
export declare function Listing({ title, label, grid, columns, className, empty, titleSort, titleLabel, children }: ListingProps): ReactElement;
|
|
117
119
|
/**
|
|
@@ -147,6 +149,36 @@ export interface RowProps {
|
|
|
147
149
|
/** The name cell's own class, beside `row-name`. */
|
|
148
150
|
readonly nameClass?: string;
|
|
149
151
|
readonly className?: string;
|
|
152
|
+
/**
|
|
153
|
+
* The row's item is not there yet (a version not installed, a product
|
|
154
|
+
* not added): its name in the quieter row-meta tone (`.row-dim`).
|
|
155
|
+
*/
|
|
156
|
+
readonly dim?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* The row adds one to its listing ("Add service…"), at the listing's
|
|
159
|
+
* foot: an accent plus in the mark's slot unless `mark` gives another
|
|
160
|
+
* glyph, and dim words that turn full under the pointer, the focus, and
|
|
161
|
+
* on the cursor row (`.pane-add`).
|
|
162
|
+
*/
|
|
163
|
+
readonly add?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Picked in a selection (`.selected`, `aria-selected`): the solid accent
|
|
166
|
+
* fill while its pane holds the keys, the neutral fill otherwise.
|
|
167
|
+
*/
|
|
168
|
+
readonly selected?: boolean;
|
|
169
|
+
/** Ticked in a checkbox column (`.marked`): the marked tint and its leading bar. */
|
|
170
|
+
readonly marked?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* A change waiting to be applied: `changed` washes the row in the
|
|
173
|
+
* warning tone with its leading bar, `removed` strikes its name and
|
|
174
|
+
* cells out on the danger wash (`.row-changed`, `.row-removed`).
|
|
175
|
+
*/
|
|
176
|
+
readonly change?: 'changed' | 'removed' | null;
|
|
177
|
+
/**
|
|
178
|
+
* The row stands out from its peers (the slowest path of a plan, the
|
|
179
|
+
* busiest item): its name in the strong weight (`.row-emphasis`).
|
|
180
|
+
*/
|
|
181
|
+
readonly emphasis?: boolean;
|
|
150
182
|
/** Opens the row's item on a click anywhere but its controls. */
|
|
151
183
|
readonly onOpen?: () => void;
|
|
152
184
|
/**
|
|
@@ -177,18 +209,42 @@ export interface RowProps {
|
|
|
177
209
|
* is a stop of its own: the cursor row in the Tab order (or, while no row
|
|
178
210
|
* is, the one marked `entry`), the others reached by the keys that move it.
|
|
179
211
|
*/
|
|
180
|
-
export declare function Row({ rowKey, mark, name, nameClass, className, onOpen, level, tabbable, focusable, entry, children }: RowProps): ReactElement;
|
|
212
|
+
export declare function Row({ rowKey, mark, name, nameClass, className, dim, add, selected, marked, change, emphasis, onOpen, level, tabbable, focusable, entry, children }: RowProps): ReactElement;
|
|
213
|
+
/**
|
|
214
|
+
* A cell's tone: `warning` a value with something waiting on it (an
|
|
215
|
+
* update), `accent` a value offered (the version an update brings),
|
|
216
|
+
* `danger` a value that failed.
|
|
217
|
+
*/
|
|
218
|
+
export type CellTone = 'warning' | 'accent' | 'danger';
|
|
181
219
|
/** Props for {@link Cell}. */
|
|
182
220
|
export interface CellProps {
|
|
183
221
|
/** Right-aligned, for numbers. */
|
|
184
222
|
readonly align?: 'right';
|
|
223
|
+
/**
|
|
224
|
+
* Its words in a tone, which holds on the cursor row and under the
|
|
225
|
+
* pointer; the row-meta tone when absent. A selection paints it in its
|
|
226
|
+
* own words, as every cell.
|
|
227
|
+
*/
|
|
228
|
+
readonly tone?: CellTone;
|
|
229
|
+
/**
|
|
230
|
+
* What the cell holds when it is not a value: `action`, the row's verbs
|
|
231
|
+
* at its end (`QuietAction`, `RowIconAction`; `.pane-action-cell`), or
|
|
232
|
+
* `hover`, secondary icon controls in view on every row in their quiet
|
|
233
|
+
* tone (`.pane-hover-cell`).
|
|
234
|
+
*/
|
|
235
|
+
readonly kind?: 'action' | 'hover';
|
|
236
|
+
/** The value is missing (SQL NULL): its words in the row-meta tone's italic (`.value-null`). */
|
|
237
|
+
readonly missing?: boolean;
|
|
185
238
|
readonly className?: string;
|
|
186
239
|
/** The cell's whole text, for one cut short, as its tooltip and description; none when null. */
|
|
187
240
|
readonly tip?: string | null;
|
|
188
241
|
readonly children?: ReactNode;
|
|
189
242
|
}
|
|
190
|
-
/**
|
|
191
|
-
|
|
243
|
+
/**
|
|
244
|
+
* A cell of a row after its name, in the listing's metadata look
|
|
245
|
+
* (`.row-meta`), in the row-meta tone or the `tone` given.
|
|
246
|
+
*/
|
|
247
|
+
export declare function Cell({ align, tone, kind, missing, className, tip, children }: CellProps): ReactElement;
|
|
192
248
|
/**
|
|
193
249
|
* The tone of a state: ready, a warning, a failure, a transition under way,
|
|
194
250
|
* quiet, or a note (`info`: an Info or Note line, in the accent).
|
package/dist/listing/Listing.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronDown, ChevronUp } from 'lucide-react';
|
|
2
|
+
import { ChevronDown, ChevronUp, Plus } from 'lucide-react';
|
|
3
3
|
import { createContext, useContext, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
4
|
-
import { ICON_SM, Spinner } from '../icon/index.js';
|
|
4
|
+
import { ICON_MD, ICON_SM, Spinner } from '../icon/index.js';
|
|
5
5
|
import { useLabels } from '../labels/UiokProvider.js';
|
|
6
6
|
import { InListingRowContext, InRowContext, RowLinkLookContext } from '../pane/PaneActions.js';
|
|
7
7
|
import { cutTooltip, describedTooltip } from '../tooltip/Tooltip.logic.js';
|
|
8
|
+
import { ListingScopeContext } from './ListingScope.js';
|
|
8
9
|
import { pathParts } from './PathParts.logic.js';
|
|
9
10
|
/**
|
|
10
11
|
* A listing column as wide as `ch` characters and the gutter before it, for
|
|
@@ -180,10 +181,17 @@ function useFittedLook(chosen, richest, listing, fitting) {
|
|
|
180
181
|
* inside its pane. A listing with no rows says so in `empty`: a quiet row
|
|
181
182
|
* under the strip instead of a table (`.pane-message.empty`, starting where
|
|
182
183
|
* a row's icon starts, in the rows' type, dim), its column labels left out, so no
|
|
183
|
-
* header stands over a row that is not one.
|
|
184
|
+
* header stands over a row that is not one. Drawn outside the listing
|
|
185
|
+
* scope (the frame, a dialog, and a palette carry it), it carries
|
|
186
|
+
* `.listing-root` itself, so a listing looks the same anywhere.
|
|
184
187
|
*/
|
|
185
188
|
export function Listing({ title, label = title, grid, columns, className, empty = null, titleSort, titleLabel, children }) {
|
|
186
|
-
|
|
189
|
+
// Outside every listing scope (a page of the app's own, a popover) the
|
|
190
|
+
// listing carries the scope itself, so its rows keep their look.
|
|
191
|
+
const scoped = useContext(ListingScopeContext);
|
|
192
|
+
const classes = ['pane-listing', scoped ? '' : 'listing-root', className ?? '']
|
|
193
|
+
.filter(Boolean)
|
|
194
|
+
.join(' ');
|
|
187
195
|
const chosen = useContext(RowLinkLookContext);
|
|
188
196
|
const listing = useRef(null);
|
|
189
197
|
const fitting = typeof grid === 'function';
|
|
@@ -213,24 +221,45 @@ export const RowCursorContext = createContext({
|
|
|
213
221
|
* is a stop of its own: the cursor row in the Tab order (or, while no row
|
|
214
222
|
* is, the one marked `entry`), the others reached by the keys that move it.
|
|
215
223
|
*/
|
|
216
|
-
export function Row({ rowKey, mark, name, nameClass, className, onOpen, level = 0, tabbable = false, focusable = false, entry = false, children }) {
|
|
224
|
+
export function Row({ rowKey, mark, name, nameClass, className, dim = false, add = false, selected = false, marked = false, change = null, emphasis = false, onOpen, level = 0, tabbable = false, focusable = false, entry = false, children }) {
|
|
217
225
|
const cursor = useContext(RowCursorContext);
|
|
218
226
|
const current = useSyncExternalStore(cursor.subscribe, () => cursor.current() === rowKey);
|
|
219
227
|
useLayoutEffect(() => {
|
|
220
228
|
cursor.rowsChanged?.();
|
|
221
229
|
return () => cursor.rowsChanged?.();
|
|
222
230
|
}, [cursor, rowKey]);
|
|
223
|
-
return (_jsx(InListingRowContext.Provider, { value: true, children: _jsx(InRowContext.Provider, { value: !tabbable, children: _jsxs("div", { "aria-current": current ? 'true' : undefined,
|
|
231
|
+
return (_jsx(InListingRowContext.Provider, { value: true, children: _jsx(InRowContext.Provider, { value: !tabbable, children: _jsxs("div", { "aria-current": current ? 'true' : undefined, "aria-selected": selected || undefined, className: [
|
|
232
|
+
'row',
|
|
233
|
+
current ? 'cursor' : '',
|
|
234
|
+
dim ? 'row-dim' : '',
|
|
235
|
+
add ? 'pane-add' : '',
|
|
236
|
+
selected ? 'selected' : '',
|
|
237
|
+
marked ? 'marked' : '',
|
|
238
|
+
change === null ? '' : `row-${change}`,
|
|
239
|
+
emphasis ? 'row-emphasis' : '',
|
|
240
|
+
className ?? ''
|
|
241
|
+
]
|
|
242
|
+
.filter(Boolean)
|
|
243
|
+
.join(' '), "data-row-key": rowKey, onClick: onOpen, onFocus: () => cursor.point(rowKey),
|
|
224
244
|
// Movement, not entry: a row scrolled under a still pointer as the
|
|
225
245
|
// keys move the cursor must not take the cursor back.
|
|
226
246
|
onPointerMove: () => {
|
|
227
247
|
if (!current)
|
|
228
248
|
cursor.point(rowKey);
|
|
229
|
-
}, role: "row", style: level > 0 ? { '--row-level': level } : undefined, tabIndex: focusable ? (current || entry ? 0 : -1) : undefined, children: [_jsx("span", { "aria-hidden": true, className: "row-icon", children: mark }), _jsx("span", { className: nameClass === undefined ? 'row-name' : `row-name ${nameClass}`, role: "cell", ...(typeof name === 'string' ? cutTooltip(name) : {}), children: name }), children] }) }) }));
|
|
249
|
+
}, role: "row", style: level > 0 ? { '--row-level': level } : undefined, tabIndex: focusable ? (current || entry ? 0 : -1) : undefined, children: [_jsx("span", { "aria-hidden": true, className: "row-icon", children: mark === undefined && add ? _jsx(Plus, { size: ICON_MD }) : mark }), _jsx("span", { className: nameClass === undefined ? 'row-name' : `row-name ${nameClass}`, role: "cell", ...(typeof name === 'string' ? cutTooltip(name) : {}), children: name }), children] }) }) }));
|
|
230
250
|
}
|
|
231
|
-
/**
|
|
232
|
-
|
|
233
|
-
|
|
251
|
+
/**
|
|
252
|
+
* A cell of a row after its name, in the listing's metadata look
|
|
253
|
+
* (`.row-meta`), in the row-meta tone or the `tone` given.
|
|
254
|
+
*/
|
|
255
|
+
export function Cell({ align, tone, kind, missing = false, className, tip, children }) {
|
|
256
|
+
return (_jsx("span", { "data-tone": tone, className: [
|
|
257
|
+
'row-meta',
|
|
258
|
+
align === 'right' ? 'align-right' : '',
|
|
259
|
+
kind === undefined ? '' : `pane-${kind}-cell`,
|
|
260
|
+
missing ? 'value-null' : '',
|
|
261
|
+
className ?? ''
|
|
262
|
+
]
|
|
234
263
|
.filter(Boolean)
|
|
235
264
|
.join(' '), role: "cell", ...(tip === undefined || tip === null ? {} : describedTooltip(tip)), children: children }));
|
|
236
265
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether what renders inside stands in the listing scope (`.listing-root`)
|
|
3
|
+
* already: the window frame, a dialog, and a palette provide it, so a
|
|
4
|
+
* `Listing` drawn anywhere else carries the scope itself and keeps its look.
|
|
5
|
+
* Internal; the scope's class is the public contract.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ListingScopeContext: import("react").Context<boolean>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Whether what renders inside stands in the listing scope (`.listing-root`)
|
|
4
|
+
* already: the window frame, a dialog, and a palette provide it, so a
|
|
5
|
+
* `Listing` drawn anywhere else carries the scope itself and keeps its look.
|
|
6
|
+
* Internal; the scope's class is the public contract.
|
|
7
|
+
*/
|
|
8
|
+
export const ListingScopeContext = createContext(false);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A pane message's tone: `danger` a refusal or a failure, `warning` a state
|
|
4
|
+
* that needs a second look, `empty` a list with no rows; a plain hint
|
|
5
|
+
* otherwise.
|
|
6
|
+
*/
|
|
7
|
+
export type PaneMessageTone = 'danger' | 'warning' | 'empty';
|
|
8
|
+
/** Props for {@link PaneMessage}. */
|
|
9
|
+
export interface PaneMessageProps {
|
|
10
|
+
/** Its words, a sentence, which may hold `<code>` for a name or a value. */
|
|
11
|
+
readonly children: ReactNode;
|
|
12
|
+
/** Its tone; a plain hint unless given. */
|
|
13
|
+
readonly tone?: PaneMessageTone;
|
|
14
|
+
/**
|
|
15
|
+
* Makes it a live region (`status`) that assistive technology reads when
|
|
16
|
+
* it changes, for a line that comes and goes with what the user does.
|
|
17
|
+
*/
|
|
18
|
+
readonly live?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One line that says something about a listing, where its rows stand: a
|
|
22
|
+
* hint, a refusal led by the danger glyph, a warning led by the warning
|
|
23
|
+
* glyph, or the line of a list with no rows, in the interface face from the
|
|
24
|
+
* rows' inset, inside a listing root. For what `Listing`'s `empty` and
|
|
25
|
+
* `PageNote` do not cover. Draws `.pane-message` (`.danger`, `.warning`,
|
|
26
|
+
* `.empty`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function PaneMessage({ children, tone, live }: PaneMessageProps): ReactElement;
|