@bigpixelrocket/uiok 0.2.3 → 0.3.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 +26 -1
- package/dist/charts/Sparkline.d.ts +20 -0
- package/dist/charts/Sparkline.js +12 -0
- package/dist/charts/Sparkline.logic.d.ts +9 -0
- package/dist/charts/Sparkline.logic.js +27 -0
- package/dist/charts/charts.css +17 -0
- package/dist/charts/index.d.ts +2 -0
- package/dist/charts/index.js +2 -0
- package/dist/dialog/ConfirmDialog.d.ts +11 -1
- package/dist/dialog/ConfirmDialog.js +3 -2
- package/dist/dialog/ModalDialog.d.ts +8 -0
- package/dist/dialog/ModalDialog.js +4 -2
- package/dist/dialog/ProgressDialog.d.ts +34 -0
- package/dist/dialog/ProgressDialog.js +40 -0
- package/dist/dialog/TypedNameDialog.d.ts +36 -0
- package/dist/dialog/TypedNameDialog.js +17 -0
- package/dist/dialog/index.d.ts +5 -2
- package/dist/dialog/index.js +4 -1
- package/dist/field/Switch.d.ts +26 -0
- package/dist/field/Switch.js +20 -0
- package/dist/field/index.d.ts +3 -2
- package/dist/field/index.js +3 -2
- package/dist/frame/AppRoot.d.ts +44 -0
- package/dist/frame/AppRoot.js +26 -0
- package/dist/frame/Dock.d.ts +88 -0
- package/dist/frame/Dock.js +129 -0
- package/dist/frame/FilterChips.d.ts +28 -0
- package/dist/frame/FilterChips.js +14 -0
- package/dist/frame/PageParts.d.ts +69 -0
- package/dist/frame/PageParts.js +60 -0
- package/dist/frame/PaneSplit.d.ts +74 -0
- package/dist/frame/PaneSplit.js +197 -0
- package/dist/frame/SidebarResizer.d.ts +35 -0
- package/dist/frame/SidebarResizer.js +43 -0
- package/dist/frame/StatusNotice.d.ts +20 -0
- package/dist/frame/StatusNotice.js +13 -0
- package/dist/frame/Tree.d.ts +140 -0
- package/dist/frame/Tree.js +141 -0
- package/dist/frame/TreeToggle.d.ts +18 -0
- package/dist/frame/TreeToggle.js +17 -0
- package/dist/frame/WindowFrame.d.ts +57 -0
- package/dist/frame/WindowFrame.js +19 -0
- package/dist/frame/frame.css +801 -0
- package/dist/frame/index.d.ts +22 -0
- package/dist/frame/index.js +22 -0
- package/dist/frame/sharedRef.d.ts +8 -0
- package/dist/frame/sharedRef.js +26 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/labels/UiokLabels.d.ts +3 -0
- package/dist/labels/UiokLabels.js +3 -1
- package/dist/labels/dialog.d.ts +12 -0
- package/dist/labels/dialog.js +7 -1
- package/dist/labels/index.d.ts +1 -0
- package/dist/labels/index.js +1 -0
- package/dist/labels/settings.d.ts +46 -0
- package/dist/labels/settings.js +29 -0
- package/dist/listing/EmptyState.d.ts +40 -0
- package/dist/listing/EmptyState.js +14 -0
- package/dist/listing/index.d.ts +3 -1
- package/dist/listing/index.js +3 -1
- package/dist/listing/listing.css +66 -2
- package/dist/log/LogWell.d.ts +34 -0
- package/dist/log/LogWell.js +39 -0
- package/dist/log/LogWell.logic.d.ts +16 -0
- package/dist/log/LogWell.logic.js +26 -0
- package/dist/log/index.d.ts +8 -0
- package/dist/log/index.js +8 -0
- package/dist/log/log.css +57 -0
- package/dist/pane/Pane.d.ts +49 -0
- package/dist/pane/Pane.js +17 -0
- package/dist/pane/PaneKeys.d.ts +10 -3
- package/dist/pane/PaneKeys.js +26 -7
- package/dist/pane/index.d.ts +4 -2
- package/dist/pane/index.js +4 -2
- package/dist/pane/usePaneKeys.js +9 -11
- package/dist/shell/AboutWindow.d.ts +21 -0
- package/dist/shell/AboutWindow.js +10 -0
- package/dist/shell/LanguageChoice.d.ts +27 -0
- package/dist/shell/LanguageChoice.js +17 -0
- package/dist/shell/LoadFailure.d.ts +22 -0
- package/dist/shell/LoadFailure.js +15 -0
- package/dist/shell/Lockup.d.ts +52 -0
- package/dist/shell/Lockup.js +30 -0
- package/dist/shell/SettingsDialog.d.ts +97 -0
- package/dist/shell/SettingsDialog.js +219 -0
- package/dist/shell/SettingsDialog.logic.d.ts +33 -0
- package/dist/shell/SettingsDialog.logic.js +42 -0
- package/dist/shell/SettingsFiles.d.ts +55 -0
- package/dist/shell/SettingsFiles.js +30 -0
- package/dist/shell/SettingsPageKeys.d.ts +42 -0
- package/dist/shell/SettingsPageKeys.js +70 -0
- package/dist/shell/SettingsSubsection.d.ts +34 -0
- package/dist/shell/SettingsSubsection.js +30 -0
- package/dist/shell/SignIn.d.ts +61 -0
- package/dist/shell/SignIn.js +36 -0
- package/dist/shell/ThemePicker.d.ts +74 -0
- package/dist/shell/ThemePicker.js +96 -0
- package/dist/shell/ThemePicker.logic.d.ts +13 -0
- package/dist/shell/ThemePicker.logic.js +26 -0
- package/dist/shell/TitleBar.d.ts +44 -0
- package/dist/shell/TitleBar.js +23 -0
- package/dist/shell/UpdatePill.d.ts +26 -0
- package/dist/shell/UpdatePill.js +17 -0
- package/dist/shell/Updates.d.ts +99 -0
- package/dist/shell/Updates.js +72 -0
- package/dist/shell/index.d.ts +27 -0
- package/dist/shell/index.js +27 -0
- package/dist/shell/shell.css +243 -4
- package/dist/styles.css +2 -0
- package/dist/themes/catalog.js +4 -0
- package/dist/themes/themes.generated.css +244 -0
- package/dist/themes/tokens.d.ts +17 -5
- package/dist/themes/tokens.js +64 -1
- package/dist/tokens.css +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The window frame, every part of it a component: the app's root and its
|
|
3
|
+
* content panel (`AppRoot`, `SpacePanel`), the window's grid
|
|
4
|
+
* (`WindowFrame`, with the `SidebarResizer`), the sidebar's tree
|
|
5
|
+
* (`TreePane`, `TreeList`, `TreeRow` with its `TreeToggle`, `TreeTool`,
|
|
6
|
+
* `TreeFilterInput`, `SidebarEmpty`), a pane's quick row of `FilterChips`
|
|
7
|
+
* and its `PaneWarning`, a pane status line's `StatusNotice`, the `Dock`
|
|
8
|
+
* with its log and input, the splitter between a list and the pane under
|
|
9
|
+
* it (`usePaneSplit`, `PaneSplitter`, `SplitDetail`), and a page's parts
|
|
10
|
+
* (`PageSlot`, `PanePage`, `Toolbar`, `PageNote`, `SectionHead`, and the
|
|
11
|
+
* rest). Their look is `frame.css` in `@bigpixelrocket/uiok/styles.css`.
|
|
12
|
+
*/
|
|
13
|
+
export { AppRoot, PageSlot, SpacePanel, type AppRootProps, type PageSlotProps, type SpacePanelProps } from './AppRoot.js';
|
|
14
|
+
export { Dock, dockHeight, DockInput, DockLog, DockLogEntry, type DockInputProps, type DockLogEntryProps, type DockLogProps, type DockProps } from './Dock.js';
|
|
15
|
+
export { FilterChips, type FilterChip, type FilterChipsProps } from './FilterChips.js';
|
|
16
|
+
export { EmptyAction, FootBar, PageFilter, PageNote, PanePage, PaneWarning, SectionHead, ShowSidebarButton, Toolbar, ToolbarGap, ToolbarGrow, type PageNoteProps, type PagePartProps, type SectionHeadProps, type ShowSidebarButtonProps, type ToolbarProps } from './PageParts.js';
|
|
17
|
+
export { cutRowDepth, heldSplitHeight, PaneSplitter, SplitDetail, usePaneSplit, type PaneSplit, type PaneSplitterProps, type SplitDetailProps } from './PaneSplit.js';
|
|
18
|
+
export { draggedWidth, SidebarResizer, type SidebarResizerProps } from './SidebarResizer.js';
|
|
19
|
+
export { StatusNotice, type StatusNoticeProps, type StatusNoticeTone } from './StatusNotice.js';
|
|
20
|
+
export { SidebarEmpty, TreeFilterInput, TreeList, TreePane, TreeRow, TreeTool, type SidebarEmptyProps, type TreeFilterInputProps, type TreeListProps, type TreePaneProps, type TreeRowKind, type TreeRowProps, type TreeRowToggle, type TreeToolKind, type TreeToolProps } from './Tree.js';
|
|
21
|
+
export { TreeToggle, type TreeToggleProps } from './TreeToggle.js';
|
|
22
|
+
export { WindowFrame, type WindowFrameGroup, type WindowFrameProps } from './WindowFrame.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The window frame, every part of it a component: the app's root and its
|
|
3
|
+
* content panel (`AppRoot`, `SpacePanel`), the window's grid
|
|
4
|
+
* (`WindowFrame`, with the `SidebarResizer`), the sidebar's tree
|
|
5
|
+
* (`TreePane`, `TreeList`, `TreeRow` with its `TreeToggle`, `TreeTool`,
|
|
6
|
+
* `TreeFilterInput`, `SidebarEmpty`), a pane's quick row of `FilterChips`
|
|
7
|
+
* and its `PaneWarning`, a pane status line's `StatusNotice`, the `Dock`
|
|
8
|
+
* with its log and input, the splitter between a list and the pane under
|
|
9
|
+
* it (`usePaneSplit`, `PaneSplitter`, `SplitDetail`), and a page's parts
|
|
10
|
+
* (`PageSlot`, `PanePage`, `Toolbar`, `PageNote`, `SectionHead`, and the
|
|
11
|
+
* rest). Their look is `frame.css` in `@bigpixelrocket/uiok/styles.css`.
|
|
12
|
+
*/
|
|
13
|
+
export { AppRoot, PageSlot, SpacePanel } from './AppRoot.js';
|
|
14
|
+
export { Dock, dockHeight, DockInput, DockLog, DockLogEntry } from './Dock.js';
|
|
15
|
+
export { FilterChips } from './FilterChips.js';
|
|
16
|
+
export { EmptyAction, FootBar, PageFilter, PageNote, PanePage, PaneWarning, SectionHead, ShowSidebarButton, Toolbar, ToolbarGap, ToolbarGrow } from './PageParts.js';
|
|
17
|
+
export { cutRowDepth, heldSplitHeight, PaneSplitter, SplitDetail, usePaneSplit } from './PaneSplit.js';
|
|
18
|
+
export { draggedWidth, SidebarResizer } from './SidebarResizer.js';
|
|
19
|
+
export { StatusNotice } from './StatusNotice.js';
|
|
20
|
+
export { SidebarEmpty, TreeFilterInput, TreeList, TreePane, TreeRow, TreeTool } from './Tree.js';
|
|
21
|
+
export { TreeToggle } from './TreeToggle.js';
|
|
22
|
+
export { WindowFrame } from './WindowFrame.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Ref, type RefCallback, type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A component's own ref to its element, shared with the ref its host
|
|
4
|
+
* passes: the callback hands the element to both, and its cleanup clears
|
|
5
|
+
* both, running the cleanup a host's callback ref returned (React 19) or
|
|
6
|
+
* calling it with null when it returned none. Internal to the frame area.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useSharedRef<T>(ref: Ref<T> | undefined): readonly [RefObject<T | null>, RefCallback<T>];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A component's own ref to its element, shared with the ref its host
|
|
4
|
+
* passes: the callback hands the element to both, and its cleanup clears
|
|
5
|
+
* both, running the cleanup a host's callback ref returned (React 19) or
|
|
6
|
+
* calling it with null when it returned none. Internal to the frame area.
|
|
7
|
+
*/
|
|
8
|
+
export function useSharedRef(ref) {
|
|
9
|
+
const own = useRef(null);
|
|
10
|
+
const attach = useCallback((element) => {
|
|
11
|
+
own.current = element;
|
|
12
|
+
const cleanup = typeof ref === 'function' ? ref(element) : undefined;
|
|
13
|
+
if (typeof ref !== 'function' && ref !== null && ref !== undefined)
|
|
14
|
+
ref.current = element;
|
|
15
|
+
return () => {
|
|
16
|
+
own.current = null;
|
|
17
|
+
if (typeof cleanup === 'function')
|
|
18
|
+
cleanup();
|
|
19
|
+
else if (typeof ref === 'function')
|
|
20
|
+
ref(null);
|
|
21
|
+
else if (ref !== null && ref !== undefined)
|
|
22
|
+
ref.current = null;
|
|
23
|
+
};
|
|
24
|
+
}, [ref]);
|
|
25
|
+
return [own, attach];
|
|
26
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,12 +12,14 @@ export * from './datetime/index.js';
|
|
|
12
12
|
export * from './dialog/index.js';
|
|
13
13
|
export * from './field/index.js';
|
|
14
14
|
export * from './filter/index.js';
|
|
15
|
+
export * from './frame/index.js';
|
|
15
16
|
export * from './grid/index.js';
|
|
16
17
|
export * from './icon/index.js';
|
|
17
18
|
export * from './keyboard/index.js';
|
|
18
19
|
export * from './keychord/index.js';
|
|
19
20
|
export * from './labels/index.js';
|
|
20
21
|
export * from './legend/index.js';
|
|
22
|
+
export * from './log/index.js';
|
|
21
23
|
export * from './listing/index.js';
|
|
22
24
|
export * from './menu/index.js';
|
|
23
25
|
export * from './namecut/index.js';
|
|
@@ -27,6 +29,7 @@ export * from './pane/index.js';
|
|
|
27
29
|
export * from './run/index.js';
|
|
28
30
|
export * from './segmented/index.js';
|
|
29
31
|
export * from './selectall/index.js';
|
|
32
|
+
export * from './shell/index.js';
|
|
30
33
|
export * from './store/index.js';
|
|
31
34
|
export * from './surface/index.js';
|
|
32
35
|
export * from './tabs/index.js';
|
package/dist/index.js
CHANGED
|
@@ -12,12 +12,14 @@ export * from './datetime/index.js';
|
|
|
12
12
|
export * from './dialog/index.js';
|
|
13
13
|
export * from './field/index.js';
|
|
14
14
|
export * from './filter/index.js';
|
|
15
|
+
export * from './frame/index.js';
|
|
15
16
|
export * from './grid/index.js';
|
|
16
17
|
export * from './icon/index.js';
|
|
17
18
|
export * from './keyboard/index.js';
|
|
18
19
|
export * from './keychord/index.js';
|
|
19
20
|
export * from './labels/index.js';
|
|
20
21
|
export * from './legend/index.js';
|
|
22
|
+
export * from './log/index.js';
|
|
21
23
|
export * from './listing/index.js';
|
|
22
24
|
export * from './menu/index.js';
|
|
23
25
|
export * from './namecut/index.js';
|
|
@@ -27,6 +29,7 @@ export * from './pane/index.js';
|
|
|
27
29
|
export * from './run/index.js';
|
|
28
30
|
export * from './segmented/index.js';
|
|
29
31
|
export * from './selectall/index.js';
|
|
32
|
+
export * from './shell/index.js';
|
|
30
33
|
export * from './store/index.js';
|
|
31
34
|
export * from './surface/index.js';
|
|
32
35
|
export * from './tabs/index.js';
|
|
@@ -8,6 +8,7 @@ import { type PagerLabels } from './pager.js';
|
|
|
8
8
|
import { type PaletteLabels } from './palette.js';
|
|
9
9
|
import { type PaneTabsLabels } from './paneTabs.js';
|
|
10
10
|
import { type SelectAllLabels } from './selectAll.js';
|
|
11
|
+
import { type SettingsLabels } from './settings.js';
|
|
11
12
|
import { type TerminalLabels } from './terminal.js';
|
|
12
13
|
/**
|
|
13
14
|
* Every chrome string UIOK's components share across instances, grouped by
|
|
@@ -39,6 +40,8 @@ export interface UiokLabels {
|
|
|
39
40
|
readonly terminal: TerminalLabels;
|
|
40
41
|
/** A pane's tab strip: New Tab, close and picked names, and the folded tabs' count and menu (`PaneTabs`). */
|
|
41
42
|
readonly paneTabs: PaneTabsLabels;
|
|
43
|
+
/** The Settings dialog's title, sidebar, and Done, and the Appearance page's words (`SettingsDialog`, `AppearanceSettings`). */
|
|
44
|
+
readonly settings: SettingsLabels;
|
|
42
45
|
}
|
|
43
46
|
/** The English labels every component falls back to without a `UiokProvider`. */
|
|
44
47
|
export declare const DEFAULT_LABELS: UiokLabels;
|
|
@@ -16,6 +16,7 @@ import { DEFAULT_PAGER_LABELS } from './pager.js';
|
|
|
16
16
|
import { DEFAULT_PALETTE_LABELS } from './palette.js';
|
|
17
17
|
import { DEFAULT_PANE_TABS_LABELS } from './paneTabs.js';
|
|
18
18
|
import { DEFAULT_SELECT_ALL_LABELS } from './selectAll.js';
|
|
19
|
+
import { DEFAULT_SETTINGS_LABELS } from './settings.js';
|
|
19
20
|
import { DEFAULT_TERMINAL_LABELS } from './terminal.js';
|
|
20
21
|
/** The English labels every component falls back to without a `UiokProvider`. */
|
|
21
22
|
export const DEFAULT_LABELS = {
|
|
@@ -29,5 +30,6 @@ export const DEFAULT_LABELS = {
|
|
|
29
30
|
palette: DEFAULT_PALETTE_LABELS,
|
|
30
31
|
selectAll: DEFAULT_SELECT_ALL_LABELS,
|
|
31
32
|
terminal: DEFAULT_TERMINAL_LABELS,
|
|
32
|
-
paneTabs: DEFAULT_PANE_TABS_LABELS
|
|
33
|
+
paneTabs: DEFAULT_PANE_TABS_LABELS,
|
|
34
|
+
settings: DEFAULT_SETTINGS_LABELS
|
|
33
35
|
};
|
package/dist/labels/dialog.d.ts
CHANGED
|
@@ -24,6 +24,18 @@ export interface DialogLabels {
|
|
|
24
24
|
* technology after the dialog's lead and before the names: "3 items".
|
|
25
25
|
*/
|
|
26
26
|
readonly itemCount: (count: number) => string;
|
|
27
|
+
/** The verb that acknowledges a settled outcome (`ProgressDialog`): "OK". */
|
|
28
|
+
readonly ok: string;
|
|
29
|
+
/** The leave verb of a dialog that asks nothing (an alert, `SettingsFileAlert`): "Close". */
|
|
30
|
+
readonly close: string;
|
|
31
|
+
/** The verb that ends work under way (`ProgressDialog`): "Stop". */
|
|
32
|
+
readonly stop: string;
|
|
33
|
+
/** The verb that starts again what could not start (`ProgressDialog`): "Try Again". */
|
|
34
|
+
readonly tryAgain: string;
|
|
35
|
+
/** The verb that puts a progress dialog away while its work goes on: "Run in Background". */
|
|
36
|
+
readonly runInBackground: string;
|
|
37
|
+
/** The note under a typed-name confirmation's field (`TypedNameDialog`): "Type the name to confirm." */
|
|
38
|
+
readonly typeName: string;
|
|
27
39
|
}
|
|
28
40
|
/** English dialog words: the `dialog` group `UiokProvider` starts from. */
|
|
29
41
|
export declare const DEFAULT_DIALOG_LABELS: DialogLabels;
|
package/dist/labels/dialog.js
CHANGED
|
@@ -4,5 +4,11 @@ export const DEFAULT_DIALOG_LABELS = {
|
|
|
4
4
|
clear: 'Clear',
|
|
5
5
|
affectedItems: () => 'Affected items',
|
|
6
6
|
moreItems: (count) => `+${count.toLocaleString('en-US')} more`,
|
|
7
|
-
itemCount: (count) => (count === 1 ? '1 item' : `${count.toLocaleString('en-US')} items`)
|
|
7
|
+
itemCount: (count) => (count === 1 ? '1 item' : `${count.toLocaleString('en-US')} items`),
|
|
8
|
+
ok: 'OK',
|
|
9
|
+
close: 'Close',
|
|
10
|
+
stop: 'Stop',
|
|
11
|
+
tryAgain: 'Try Again',
|
|
12
|
+
runInBackground: 'Run in Background',
|
|
13
|
+
typeName: 'Type the name to confirm.'
|
|
8
14
|
};
|
package/dist/labels/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { DEFAULT_PAGER_LABELS, type PagerLabels, type PagerStep } from './pager.
|
|
|
9
9
|
export { DEFAULT_PALETTE_LABELS, type PaletteLabels } from './palette.js';
|
|
10
10
|
export { DEFAULT_PANE_TABS_LABELS, type PaneTabsLabels } from './paneTabs.js';
|
|
11
11
|
export { DEFAULT_SELECT_ALL_LABELS, type SelectAllLabels } from './selectAll.js';
|
|
12
|
+
export { DEFAULT_SETTINGS_LABELS, type AppearanceLabels, type AppearanceMode, type SettingsLabels } from './settings.js';
|
|
12
13
|
export { DEFAULT_TERMINAL_LABELS, type TerminalLabels } from './terminal.js';
|
|
13
14
|
export { DEFAULT_LABELS, type UiokLabels } from './UiokLabels.js';
|
|
14
15
|
export { mergeLabels, UiokProvider, useLabels, type LabelsOverride, type UiokLabelsOverride, type UiokProviderProps } from './UiokProvider.js';
|
package/dist/labels/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { DEFAULT_PAGER_LABELS } from './pager.js';
|
|
|
9
9
|
export { DEFAULT_PALETTE_LABELS } from './palette.js';
|
|
10
10
|
export { DEFAULT_PANE_TABS_LABELS } from './paneTabs.js';
|
|
11
11
|
export { DEFAULT_SELECT_ALL_LABELS } from './selectAll.js';
|
|
12
|
+
export { DEFAULT_SETTINGS_LABELS } from './settings.js';
|
|
12
13
|
export { DEFAULT_TERMINAL_LABELS } from './terminal.js';
|
|
13
14
|
export { DEFAULT_LABELS } from './UiokLabels.js';
|
|
14
15
|
export { mergeLabels, UiokProvider, useLabels } from './UiokProvider.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words the Settings dialog and its shared pages repeat in every app:
|
|
3
|
+
* the dialog's title and its one verb, the sidebar's name, and the
|
|
4
|
+
* Appearance page's choices, notes, and bands (`SettingsDialog`,
|
|
5
|
+
* `AppearanceSettings`). A page's title and its own rows are the app's.
|
|
6
|
+
*/
|
|
7
|
+
/** Which appearance the windows wear: the system's, or one of the two always. */
|
|
8
|
+
export type AppearanceMode = 'system' | 'light' | 'dark';
|
|
9
|
+
/** The Appearance page's words (`AppearanceSettings`). */
|
|
10
|
+
export interface AppearanceLabels {
|
|
11
|
+
/** The subsection's name: "Theme". */
|
|
12
|
+
readonly title: string;
|
|
13
|
+
/** The appearance choice's label: "Appearance". */
|
|
14
|
+
readonly mode: string;
|
|
15
|
+
/** Each appearance choice's name: System, Light, Dark. */
|
|
16
|
+
readonly modes: Readonly<Record<AppearanceMode, string>>;
|
|
17
|
+
/**
|
|
18
|
+
* The note under the appearance choice: what it does, and, while it
|
|
19
|
+
* follows the system, what that gives now ("Follows the system, which is
|
|
20
|
+
* light now.").
|
|
21
|
+
*/
|
|
22
|
+
readonly modeNote: (mode: AppearanceMode, systemDark: boolean) => string;
|
|
23
|
+
/** The light themes' band: "Light theme". */
|
|
24
|
+
readonly lightTheme: string;
|
|
25
|
+
/** When the light band's theme shows: "Shown while the appearance is light." */
|
|
26
|
+
readonly lightNote: string;
|
|
27
|
+
/** The dark themes' band: "Dark theme". */
|
|
28
|
+
readonly darkTheme: string;
|
|
29
|
+
/** When the dark band's theme shows: "Shown while the appearance is dark." */
|
|
30
|
+
readonly darkNote: string;
|
|
31
|
+
/** The mark on the band the window wears now: "In use now". */
|
|
32
|
+
readonly inUse: string;
|
|
33
|
+
}
|
|
34
|
+
/** The Settings dialog's shared words. */
|
|
35
|
+
export interface SettingsLabels {
|
|
36
|
+
/** The dialog's title: "Settings". */
|
|
37
|
+
readonly title: string;
|
|
38
|
+
/** The sidebar's accessible name: "Settings pages". */
|
|
39
|
+
readonly sidebar: string;
|
|
40
|
+
/** The dialog's one verb, on Return and Escape: "Done". */
|
|
41
|
+
readonly done: string;
|
|
42
|
+
/** The Appearance page's words. */
|
|
43
|
+
readonly appearance: AppearanceLabels;
|
|
44
|
+
}
|
|
45
|
+
/** English Settings words: the `settings` group `UiokProvider` starts from. */
|
|
46
|
+
export declare const DEFAULT_SETTINGS_LABELS: SettingsLabels;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words the Settings dialog and its shared pages repeat in every app:
|
|
3
|
+
* the dialog's title and its one verb, the sidebar's name, and the
|
|
4
|
+
* Appearance page's choices, notes, and bands (`SettingsDialog`,
|
|
5
|
+
* `AppearanceSettings`). A page's title and its own rows are the app's.
|
|
6
|
+
*/
|
|
7
|
+
/** English Settings words: the `settings` group `UiokProvider` starts from. */
|
|
8
|
+
export const DEFAULT_SETTINGS_LABELS = {
|
|
9
|
+
title: 'Settings',
|
|
10
|
+
sidebar: 'Settings pages',
|
|
11
|
+
done: 'Done',
|
|
12
|
+
appearance: {
|
|
13
|
+
title: 'Theme',
|
|
14
|
+
mode: 'Appearance',
|
|
15
|
+
modes: { system: 'System', light: 'Light', dark: 'Dark' },
|
|
16
|
+
modeNote: (mode, systemDark) => mode === 'system'
|
|
17
|
+
? systemDark
|
|
18
|
+
? 'Follows the system, which is dark now.'
|
|
19
|
+
: 'Follows the system, which is light now.'
|
|
20
|
+
: mode === 'light'
|
|
21
|
+
? 'Light whatever the system uses.'
|
|
22
|
+
: 'Dark whatever the system uses.',
|
|
23
|
+
lightTheme: 'Light theme',
|
|
24
|
+
lightNote: 'Shown while the appearance is light.',
|
|
25
|
+
darkTheme: 'Dark theme',
|
|
26
|
+
darkNote: 'Shown while the appearance is dark.',
|
|
27
|
+
inUse: 'In use now'
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
|
+
/** One step of an empty state's way in: its words and a quieter line under them. */
|
|
4
|
+
export interface EmptyStateStep {
|
|
5
|
+
/** What to do ("Pick a folder"). */
|
|
6
|
+
readonly title: string;
|
|
7
|
+
/** More about it ("any folder of this Mac"). */
|
|
8
|
+
readonly detail?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Props for {@link EmptyState}. */
|
|
11
|
+
export interface EmptyStateProps {
|
|
12
|
+
/** The glyph over the title, in the faint tone (the danger tone for a `failure`). */
|
|
13
|
+
readonly icon?: LucideIcon;
|
|
14
|
+
/** A mark of the host's own in place of the glyph (a `BrandMark`), drawn at the glyph's place. */
|
|
15
|
+
readonly mark?: ReactNode;
|
|
16
|
+
/** What the pane is waiting for, or what went wrong, as its heading. */
|
|
17
|
+
readonly title: string;
|
|
18
|
+
/** A sentence on what the pane is for or what went wrong. */
|
|
19
|
+
readonly body?: ReactNode;
|
|
20
|
+
/** Its ways on: `Button`s, one primary at most, in a row that wraps. */
|
|
21
|
+
readonly actions?: ReactNode;
|
|
22
|
+
/** A quiet line under the actions (where an import would come from). */
|
|
23
|
+
readonly note?: ReactNode;
|
|
24
|
+
/** What the system returned, last, in the code face (an error, the tools found). */
|
|
25
|
+
readonly detail?: ReactNode;
|
|
26
|
+
/** The way in as numbered steps, side by side under the rest. */
|
|
27
|
+
readonly steps?: readonly EmptyStateStep[];
|
|
28
|
+
/** The pane could not load: announced as an alert, its glyph in the danger tone. */
|
|
29
|
+
readonly failure?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A pane with nothing in it yet (no projects, nothing installed) or one
|
|
33
|
+
* that could not load: one block centred between its path bar and its
|
|
34
|
+
* status line, its glyph, its heading, a sentence, its ways on, then a note,
|
|
35
|
+
* what the system returned, and the way in as numbered steps. Its words can
|
|
36
|
+
* be selected and copied. A list that is merely empty (a folder with no
|
|
37
|
+
* entries, a filter that matches nothing) says so with a quiet `PageNote`
|
|
38
|
+
* or a listing's `empty` instead.
|
|
39
|
+
*/
|
|
40
|
+
export declare function EmptyState({ icon: Icon, mark, title, body, actions, note, detail, steps, failure }: EmptyStateProps): ReactElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ICON_XL } from '../icon/sizes.js';
|
|
3
|
+
/**
|
|
4
|
+
* A pane with nothing in it yet (no projects, nothing installed) or one
|
|
5
|
+
* that could not load: one block centred between its path bar and its
|
|
6
|
+
* status line, its glyph, its heading, a sentence, its ways on, then a note,
|
|
7
|
+
* what the system returned, and the way in as numbered steps. Its words can
|
|
8
|
+
* be selected and copied. A list that is merely empty (a folder with no
|
|
9
|
+
* entries, a filter that matches nothing) says so with a quiet `PageNote`
|
|
10
|
+
* or a listing's `empty` instead.
|
|
11
|
+
*/
|
|
12
|
+
export function EmptyState({ icon: Icon, mark, title, body, actions, note, detail, steps, failure = false }) {
|
|
13
|
+
return (_jsxs("div", { className: "pane-empty", role: failure ? 'alert' : undefined, children: [mark ?? (Icon === undefined ? null : _jsx(Icon, { "aria-hidden": true, size: ICON_XL })), _jsx("h2", { children: title }), body === undefined ? null : _jsx("p", { children: body }), actions === undefined ? null : _jsx("div", { className: "pane-empty-actions", children: actions }), note === undefined ? null : _jsx("p", { className: "pane-empty-note", children: note }), detail === undefined ? null : _jsx("p", { className: "pane-empty-detail", children: detail }), steps === undefined || steps.length === 0 ? null : (_jsx("ol", { className: "pane-empty-steps", children: steps.map((step, index) => (_jsxs("li", { className: "pane-empty-step", children: [_jsx("span", { "aria-hidden": true, className: "pane-empty-step-number", children: index + 1 }), _jsxs("span", { className: "pane-empty-step-text", children: [_jsx("span", { className: "pane-empty-step-title", children: step.title }), step.detail === undefined ? null : (_jsx("span", { className: "pane-empty-step-detail", children: step.detail }))] })] }, step.title))) }))] }));
|
|
14
|
+
}
|
package/dist/listing/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* Listings: the column strip, rows and cells in the listing look (scoped by
|
|
3
3
|
* `.listing-root`), the row cursor they share with the keys, column widths,
|
|
4
4
|
* and the state, path, and terminal-well cells; `CurrentDot` marks the
|
|
5
|
-
* current one in a list
|
|
5
|
+
* current one in a list, and `EmptyState` fills a pane with nothing in it
|
|
6
|
+
* yet or one that could not load.
|
|
6
7
|
*/
|
|
7
8
|
export { type SortDirection } from '../labels/listing.js';
|
|
8
9
|
export { CurrentDot, type CurrentDotProps } from './CurrentDot.js';
|
|
10
|
+
export { EmptyState, type EmptyStateProps, type EmptyStateStep } from './EmptyState.js';
|
|
9
11
|
export { ACTION_COLUMN, Cell, column, ICON_LINK_PX, iconLinksColumn, linksColumn, Listing, PathCell, Row, RowCursorContext, StateMark, Strip, WellColumn, type CellProps, type ColumnSort, type ListingColumn, type ListingProps, type PathCellProps, type RowCursor, type RowProps, type StateMarkProps, type StateTone, type StripProps, type WellColumnProps } from './Listing.js';
|
|
10
12
|
export { pathParts, type PathParts } from './PathParts.logic.js';
|
package/dist/listing/index.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* Listings: the column strip, rows and cells in the listing look (scoped by
|
|
3
3
|
* `.listing-root`), the row cursor they share with the keys, column widths,
|
|
4
4
|
* and the state, path, and terminal-well cells; `CurrentDot` marks the
|
|
5
|
-
* current one in a list
|
|
5
|
+
* current one in a list, and `EmptyState` fills a pane with nothing in it
|
|
6
|
+
* yet or one that could not load.
|
|
6
7
|
*/
|
|
7
8
|
export {} from '../labels/listing.js';
|
|
8
9
|
export { CurrentDot } from './CurrentDot.js';
|
|
10
|
+
export { EmptyState } from './EmptyState.js';
|
|
9
11
|
export { ACTION_COLUMN, Cell, column, ICON_LINK_PX, iconLinksColumn, linksColumn, Listing, PathCell, Row, RowCursorContext, StateMark, Strip, WellColumn } from './Listing.js';
|
|
10
12
|
export { pathParts } from './PathParts.logic.js';
|
package/dist/listing/listing.css
CHANGED
|
@@ -1690,13 +1690,17 @@ button.crumb-label > .crumb-text {
|
|
|
1690
1690
|
where there is one (.pane-empty-detail). The pane keeps its path bar and
|
|
1691
1691
|
status line around it. A list that is merely empty (a folder with no
|
|
1692
1692
|
entries, a filter that matches nothing) says so with the quiet line
|
|
1693
|
-
`.pane-message.empty` instead.
|
|
1693
|
+
`.pane-message.empty` instead. In a pane shorter than the block, the
|
|
1694
|
+
block scrolls between the path bar and the status line, never pushing
|
|
1695
|
+
the status line out, and its top stays reachable (safe centring). */
|
|
1694
1696
|
:where(.listing-root) .pane-empty {
|
|
1695
1697
|
display: flex;
|
|
1696
1698
|
flex: 1;
|
|
1697
1699
|
flex-direction: column;
|
|
1698
1700
|
align-items: center;
|
|
1699
|
-
justify-content: center;
|
|
1701
|
+
justify-content: safe center;
|
|
1702
|
+
min-height: 0;
|
|
1703
|
+
overflow-y: auto;
|
|
1700
1704
|
gap: var(--space-2);
|
|
1701
1705
|
padding: var(--space-16);
|
|
1702
1706
|
color: var(--text-dim);
|
|
@@ -1758,6 +1762,66 @@ button.crumb-label > .crumb-text {
|
|
|
1758
1762
|
overflow-wrap: anywhere;
|
|
1759
1763
|
}
|
|
1760
1764
|
|
|
1765
|
+
/* A host's own mark (a brand mark) in the glyph's place, at the glyph's
|
|
1766
|
+
scale: the mark is 1.4em, so the glyph's size sets its em. */
|
|
1767
|
+
:where(.listing-root) .pane-empty > .brand-mark {
|
|
1768
|
+
font-size: var(--icon-xl);
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
/* A quiet line under the actions (EmptyState's note). */
|
|
1772
|
+
:where(.listing-root) .pane-empty p.pane-empty-note {
|
|
1773
|
+
margin-top: var(--space-3);
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
/* The way in as numbered steps side by side under the rest, each number in
|
|
1777
|
+
a small key-like box beside its words, its detail dim under its title. */
|
|
1778
|
+
:where(.listing-root) .pane-empty-steps {
|
|
1779
|
+
display: flex;
|
|
1780
|
+
flex-wrap: wrap;
|
|
1781
|
+
justify-content: center;
|
|
1782
|
+
gap: var(--space-4) var(--space-12);
|
|
1783
|
+
max-width: 620px;
|
|
1784
|
+
margin: var(--space-12) 0 0;
|
|
1785
|
+
padding: 0;
|
|
1786
|
+
list-style: none;
|
|
1787
|
+
font-size: var(--font-size-small);
|
|
1788
|
+
line-height: var(--line-height-prose);
|
|
1789
|
+
text-align: left;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
:where(.listing-root) .pane-empty-step {
|
|
1793
|
+
display: flex;
|
|
1794
|
+
gap: var(--space-3);
|
|
1795
|
+
max-width: 180px;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
:where(.listing-root) .pane-empty-step-number {
|
|
1799
|
+
display: inline-flex;
|
|
1800
|
+
flex: none;
|
|
1801
|
+
align-items: center;
|
|
1802
|
+
justify-content: center;
|
|
1803
|
+
min-width: var(--icon-lg);
|
|
1804
|
+
height: var(--icon-lg);
|
|
1805
|
+
margin-top: var(--space-1);
|
|
1806
|
+
border: var(--line) solid var(--control-border);
|
|
1807
|
+
border-radius: var(--radius-xs);
|
|
1808
|
+
color: var(--text-dim);
|
|
1809
|
+
font-family: var(--font-mono);
|
|
1810
|
+
font-size: var(--font-size-caption);
|
|
1811
|
+
line-height: var(--line-height-compact);
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
:where(.listing-root) .pane-empty-step-text {
|
|
1815
|
+
display: flex;
|
|
1816
|
+
flex-direction: column;
|
|
1817
|
+
-webkit-user-select: text;
|
|
1818
|
+
user-select: text;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
:where(.listing-root) .pane-empty-step-title {
|
|
1822
|
+
color: var(--text);
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1761
1825
|
/* A state (StateMark): its mark, or its spinner for a transition, and its
|
|
1762
1826
|
word, in the state's tone. The mark takes the tone everywhere, the word
|
|
1763
1827
|
inside a row only, in the text-safe tone of its state. Each mark has its
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
/** One line of a log. */
|
|
3
|
+
export interface LogLine {
|
|
4
|
+
/** Names the line among the log's; its place in the list where lines only ever append. */
|
|
5
|
+
readonly key: string | number;
|
|
6
|
+
/** What wrote it (a process's name, `queue.2`); none for a line of the log's own. */
|
|
7
|
+
readonly source?: string | null;
|
|
8
|
+
/** The line's words, as written. */
|
|
9
|
+
readonly text: ReactNode;
|
|
10
|
+
/** A line the host marks: a failure (`danger`), a warning, or one of the log's own quiet notes (`dim`). */
|
|
11
|
+
readonly tone?: 'danger' | 'warning' | 'dim';
|
|
12
|
+
}
|
|
13
|
+
/** Props for {@link LogWell}. */
|
|
14
|
+
export interface LogWellProps {
|
|
15
|
+
readonly lines: readonly LogLine[];
|
|
16
|
+
/** The log's accessible name ("Combined log"). */
|
|
17
|
+
readonly label: string;
|
|
18
|
+
/** The sources in the order their colours go, so each keeps its colour; any other takes the next in turn. */
|
|
19
|
+
readonly sources?: readonly string[];
|
|
20
|
+
/** Keeps the newest line in view while the reader is at the foot; a reader scrolled up stays put. */
|
|
21
|
+
readonly follow?: boolean;
|
|
22
|
+
/** The words shown while the log has no line. */
|
|
23
|
+
readonly empty?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A log in a well: each line in the code face, its source first in a
|
|
27
|
+
* column as wide as the longest source and in that source's own colour
|
|
28
|
+
* (`--log-source-*`, legible as text), a bar, then the words; a line the
|
|
29
|
+
* host marks takes its tone. The words can be selected and copied. With
|
|
30
|
+
* `follow`, a new line scrolls into view while the reader is at the foot.
|
|
31
|
+
* It is a `log` region, so a screen reader hears new lines without being
|
|
32
|
+
* moved; it takes the focus so the keys scroll it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function LogWell({ lines, label, sources, follow, empty }: LogWellProps): ReactElement;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useRef } from 'react';
|
|
3
|
+
import { logSourceColour, logSourceIndexes, logSourceWidth } from './LogWell.logic.js';
|
|
4
|
+
/** How near the foot, in pixels, still counts as reading the newest line. */
|
|
5
|
+
const FOOT_SLACK = 8;
|
|
6
|
+
/**
|
|
7
|
+
* A log in a well: each line in the code face, its source first in a
|
|
8
|
+
* column as wide as the longest source and in that source's own colour
|
|
9
|
+
* (`--log-source-*`, legible as text), a bar, then the words; a line the
|
|
10
|
+
* host marks takes its tone. The words can be selected and copied. With
|
|
11
|
+
* `follow`, a new line scrolls into view while the reader is at the foot.
|
|
12
|
+
* It is a `log` region, so a screen reader hears new lines without being
|
|
13
|
+
* moved; it takes the focus so the keys scroll it.
|
|
14
|
+
*/
|
|
15
|
+
export function LogWell({ lines, label, sources = [], follow = true, empty }) {
|
|
16
|
+
const well = useRef(null);
|
|
17
|
+
const atFoot = useRef(true);
|
|
18
|
+
const names = lines.map((line) => line.source);
|
|
19
|
+
const indexes = logSourceIndexes(names, sources);
|
|
20
|
+
const width = logSourceWidth(names);
|
|
21
|
+
const last = lines.at(-1)?.key;
|
|
22
|
+
useLayoutEffect(() => {
|
|
23
|
+
const element = well.current;
|
|
24
|
+
if (follow && atFoot.current && element) {
|
|
25
|
+
element.scrollTop = element.scrollHeight;
|
|
26
|
+
}
|
|
27
|
+
}, [follow, last, lines.length]);
|
|
28
|
+
return (_jsxs("div", { "aria-label": label, className: "log-well selectable", onScroll: (event) => {
|
|
29
|
+
const element = event.currentTarget;
|
|
30
|
+
atFoot.current =
|
|
31
|
+
element.scrollHeight - element.scrollTop - element.clientHeight <= FOOT_SLACK;
|
|
32
|
+
}, ref: well, role: "log", style: { '--log-source-width': `${width}ch` }, tabIndex: 0, children: [lines.length === 0 && empty !== undefined ? _jsx("p", { className: "log-empty", children: empty }) : null, lines.map((line) => {
|
|
33
|
+
const source = line.source ?? null;
|
|
34
|
+
const index = source === null ? undefined : indexes.get(source);
|
|
35
|
+
return (_jsxs("div", { className: "log-line", "data-tone": line.tone, children: [width > 0 ? (_jsx("span", { className: "log-source", style: index === undefined
|
|
36
|
+
? undefined
|
|
37
|
+
: { '--log-source': logSourceColour(index) }, children: source })) : null, width > 0 ? (_jsx("span", { "aria-hidden": true, className: "log-bar", children: "|" })) : null, _jsx("span", { className: "log-text", children: line.text })] }, line.key));
|
|
38
|
+
})] }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** How many source colours the theme defines (`--log-source-1` to `--log-source-6`). */
|
|
2
|
+
export declare const LOG_SOURCE_COLOURS = 6;
|
|
3
|
+
/**
|
|
4
|
+
* The colour token the log source at `index` (from zero) is written in, as
|
|
5
|
+
* a `var()`: `--log-source-1` for 0 through `--log-source-6` for 5,
|
|
6
|
+
* starting over at 6. Each holds 4.5:1 as text on a panel.
|
|
7
|
+
*/
|
|
8
|
+
export declare const logSourceColour: (index: number) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Each source's colour index, in the order given (`order`, then any other
|
|
11
|
+
* source in the order it first appears in `lines`), so a source keeps its
|
|
12
|
+
* colour however its lines interleave and whatever comes in later.
|
|
13
|
+
*/
|
|
14
|
+
export declare function logSourceIndexes(sources: readonly (string | null | undefined)[], order?: readonly string[]): ReadonlyMap<string, number>;
|
|
15
|
+
/** The width of a log's source column, in characters: its longest source, none when no line has one. */
|
|
16
|
+
export declare function logSourceWidth(sources: readonly (string | null | undefined)[]): number;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** How many source colours the theme defines (`--log-source-1` to `--log-source-6`). */
|
|
2
|
+
export const LOG_SOURCE_COLOURS = 6;
|
|
3
|
+
/**
|
|
4
|
+
* The colour token the log source at `index` (from zero) is written in, as
|
|
5
|
+
* a `var()`: `--log-source-1` for 0 through `--log-source-6` for 5,
|
|
6
|
+
* starting over at 6. Each holds 4.5:1 as text on a panel.
|
|
7
|
+
*/
|
|
8
|
+
export const logSourceColour = (index) => `var(--log-source-${(index % LOG_SOURCE_COLOURS) + 1})`;
|
|
9
|
+
/**
|
|
10
|
+
* Each source's colour index, in the order given (`order`, then any other
|
|
11
|
+
* source in the order it first appears in `lines`), so a source keeps its
|
|
12
|
+
* colour however its lines interleave and whatever comes in later.
|
|
13
|
+
*/
|
|
14
|
+
export function logSourceIndexes(sources, order = []) {
|
|
15
|
+
const indexes = new Map();
|
|
16
|
+
for (const source of [...order, ...sources]) {
|
|
17
|
+
if (source !== null && source !== undefined && !indexes.has(source)) {
|
|
18
|
+
indexes.set(source, indexes.size);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return indexes;
|
|
22
|
+
}
|
|
23
|
+
/** The width of a log's source column, in characters: its longest source, none when no line has one. */
|
|
24
|
+
export function logSourceWidth(sources) {
|
|
25
|
+
return sources.reduce((widest, source) => Math.max(widest, source?.length ?? 0), 0);
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logs: `LogWell`, a log's lines in a well with each source's prefix in its
|
|
3
|
+
* own colour, and the rules that give a source its colour and its column
|
|
4
|
+
* (`logSourceIndexes`, `logSourceColour`, `logSourceWidth`). Its look is
|
|
5
|
+
* `log.css` in `@bigpixelrocket/uiok/styles.css`.
|
|
6
|
+
*/
|
|
7
|
+
export { LogWell, type LogLine, type LogWellProps } from './LogWell.js';
|
|
8
|
+
export { LOG_SOURCE_COLOURS, logSourceColour, logSourceIndexes, logSourceWidth } from './LogWell.logic.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logs: `LogWell`, a log's lines in a well with each source's prefix in its
|
|
3
|
+
* own colour, and the rules that give a source its colour and its column
|
|
4
|
+
* (`logSourceIndexes`, `logSourceColour`, `logSourceWidth`). Its look is
|
|
5
|
+
* `log.css` in `@bigpixelrocket/uiok/styles.css`.
|
|
6
|
+
*/
|
|
7
|
+
export { LogWell } from './LogWell.js';
|
|
8
|
+
export { LOG_SOURCE_COLOURS, logSourceColour, logSourceIndexes, logSourceWidth } from './LogWell.logic.js';
|