@bigpixelrocket/uiok 0.2.3 → 0.4.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.
Files changed (215) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/dist/charts/Sparkline.d.ts +20 -0
  3. package/dist/charts/Sparkline.js +12 -0
  4. package/dist/charts/Sparkline.logic.d.ts +9 -0
  5. package/dist/charts/Sparkline.logic.js +27 -0
  6. package/dist/charts/charts.css +17 -0
  7. package/dist/charts/index.d.ts +2 -0
  8. package/dist/charts/index.js +2 -0
  9. package/dist/dialog/ConfirmDialog.d.ts +17 -1
  10. package/dist/dialog/ConfirmDialog.js +4 -3
  11. package/dist/dialog/ModalDialog.d.ts +8 -0
  12. package/dist/dialog/ModalDialog.js +4 -2
  13. package/dist/dialog/ProgressDialog.d.ts +40 -0
  14. package/dist/dialog/ProgressDialog.js +40 -0
  15. package/dist/dialog/TypedNameDialog.d.ts +44 -0
  16. package/dist/dialog/TypedNameDialog.js +17 -0
  17. package/dist/dialog/index.d.ts +5 -2
  18. package/dist/dialog/index.js +4 -1
  19. package/dist/field/Check.d.ts +9 -2
  20. package/dist/field/Check.js +5 -4
  21. package/dist/field/Controls.d.ts +198 -0
  22. package/dist/field/Controls.js +94 -0
  23. package/dist/field/FieldLayout.d.ts +126 -0
  24. package/dist/field/FieldLayout.js +89 -0
  25. package/dist/field/Switch.d.ts +26 -0
  26. package/dist/field/Switch.js +20 -0
  27. package/dist/field/index.d.ts +10 -6
  28. package/dist/field/index.js +10 -6
  29. package/dist/frame/AppRoot.d.ts +44 -0
  30. package/dist/frame/AppRoot.js +26 -0
  31. package/dist/frame/Dock.d.ts +88 -0
  32. package/dist/frame/Dock.js +129 -0
  33. package/dist/frame/FilterChips.d.ts +28 -0
  34. package/dist/frame/FilterChips.js +14 -0
  35. package/dist/frame/PageParts.d.ts +69 -0
  36. package/dist/frame/PageParts.js +60 -0
  37. package/dist/frame/PaneSplit.d.ts +74 -0
  38. package/dist/frame/PaneSplit.js +197 -0
  39. package/dist/frame/SidebarResizer.d.ts +35 -0
  40. package/dist/frame/SidebarResizer.js +43 -0
  41. package/dist/frame/StatusNotice.d.ts +20 -0
  42. package/dist/frame/StatusNotice.js +13 -0
  43. package/dist/frame/Tree.d.ts +147 -0
  44. package/dist/frame/Tree.js +164 -0
  45. package/dist/frame/TreeToggle.d.ts +18 -0
  46. package/dist/frame/TreeToggle.js +17 -0
  47. package/dist/frame/WindowFrame.d.ts +57 -0
  48. package/dist/frame/WindowFrame.js +19 -0
  49. package/dist/frame/frame.css +801 -0
  50. package/dist/frame/index.d.ts +22 -0
  51. package/dist/frame/index.js +22 -0
  52. package/dist/frame/sharedRef.d.ts +8 -0
  53. package/dist/frame/sharedRef.js +26 -0
  54. package/dist/index.d.ts +3 -0
  55. package/dist/index.js +3 -0
  56. package/dist/labels/UiokLabels.d.ts +6 -0
  57. package/dist/labels/UiokLabels.js +5 -1
  58. package/dist/labels/dialog.d.ts +12 -0
  59. package/dist/labels/dialog.js +7 -1
  60. package/dist/labels/index.d.ts +2 -0
  61. package/dist/labels/index.js +2 -0
  62. package/dist/labels/settings.d.ts +46 -0
  63. package/dist/labels/settings.js +29 -0
  64. package/dist/labels/viewer.d.ts +193 -0
  65. package/dist/labels/viewer.js +124 -0
  66. package/dist/listing/EmptyState.d.ts +40 -0
  67. package/dist/listing/EmptyState.js +14 -0
  68. package/dist/listing/PaneMessage.d.ts +28 -0
  69. package/dist/listing/PaneMessage.js +12 -0
  70. package/dist/listing/index.d.ts +5 -1
  71. package/dist/listing/index.js +5 -1
  72. package/dist/listing/listing.css +66 -2
  73. package/dist/log/LogWell.d.ts +34 -0
  74. package/dist/log/LogWell.js +39 -0
  75. package/dist/log/LogWell.logic.d.ts +16 -0
  76. package/dist/log/LogWell.logic.js +26 -0
  77. package/dist/log/index.d.ts +8 -0
  78. package/dist/log/index.js +8 -0
  79. package/dist/log/log.css +57 -0
  80. package/dist/pane/Pane.d.ts +49 -0
  81. package/dist/pane/Pane.js +17 -0
  82. package/dist/pane/PaneKeys.d.ts +10 -3
  83. package/dist/pane/PaneKeys.js +26 -7
  84. package/dist/pane/index.d.ts +4 -2
  85. package/dist/pane/index.js +4 -2
  86. package/dist/pane/usePaneKeys.js +9 -11
  87. package/dist/shell/AboutWindow.d.ts +21 -0
  88. package/dist/shell/AboutWindow.js +10 -0
  89. package/dist/shell/LanguageChoice.d.ts +27 -0
  90. package/dist/shell/LanguageChoice.js +17 -0
  91. package/dist/shell/LoadFailure.d.ts +22 -0
  92. package/dist/shell/LoadFailure.js +15 -0
  93. package/dist/shell/Lockup.d.ts +52 -0
  94. package/dist/shell/Lockup.js +30 -0
  95. package/dist/shell/SettingsDialog.d.ts +97 -0
  96. package/dist/shell/SettingsDialog.js +219 -0
  97. package/dist/shell/SettingsDialog.logic.d.ts +33 -0
  98. package/dist/shell/SettingsDialog.logic.js +42 -0
  99. package/dist/shell/SettingsFiles.d.ts +55 -0
  100. package/dist/shell/SettingsFiles.js +30 -0
  101. package/dist/shell/SettingsPageKeys.d.ts +42 -0
  102. package/dist/shell/SettingsPageKeys.js +70 -0
  103. package/dist/shell/SettingsSubsection.d.ts +34 -0
  104. package/dist/shell/SettingsSubsection.js +30 -0
  105. package/dist/shell/SignIn.d.ts +61 -0
  106. package/dist/shell/SignIn.js +36 -0
  107. package/dist/shell/ThemePicker.d.ts +74 -0
  108. package/dist/shell/ThemePicker.js +96 -0
  109. package/dist/shell/ThemePicker.logic.d.ts +13 -0
  110. package/dist/shell/ThemePicker.logic.js +26 -0
  111. package/dist/shell/TitleBar.d.ts +44 -0
  112. package/dist/shell/TitleBar.js +23 -0
  113. package/dist/shell/UpdatePill.d.ts +26 -0
  114. package/dist/shell/UpdatePill.js +17 -0
  115. package/dist/shell/Updates.d.ts +99 -0
  116. package/dist/shell/Updates.js +72 -0
  117. package/dist/shell/index.d.ts +27 -0
  118. package/dist/shell/index.js +27 -0
  119. package/dist/shell/shell.css +243 -4
  120. package/dist/styles.css +5 -0
  121. package/dist/surface/Card.d.ts +18 -0
  122. package/dist/surface/Card.js +10 -0
  123. package/dist/surface/Notice.d.ts +45 -0
  124. package/dist/surface/Notice.js +27 -0
  125. package/dist/surface/index.d.ts +5 -3
  126. package/dist/surface/index.js +5 -3
  127. package/dist/themes/catalog.js +4 -0
  128. package/dist/themes/themes.generated.css +245 -0
  129. package/dist/themes/tokens.d.ts +17 -5
  130. package/dist/themes/tokens.js +67 -1
  131. package/dist/tokens.css +11 -0
  132. package/dist/viewer/AudioView.d.ts +13 -0
  133. package/dist/viewer/AudioView.js +25 -0
  134. package/dist/viewer/HexJump.logic.d.ts +16 -0
  135. package/dist/viewer/HexJump.logic.js +27 -0
  136. package/dist/viewer/HexRows.logic.d.ts +55 -0
  137. package/dist/viewer/HexRows.logic.js +84 -0
  138. package/dist/viewer/HexSelection.logic.d.ts +57 -0
  139. package/dist/viewer/HexSelection.logic.js +68 -0
  140. package/dist/viewer/HexView.d.ts +10 -0
  141. package/dist/viewer/HexView.js +291 -0
  142. package/dist/viewer/HexViewport.logic.d.ts +61 -0
  143. package/dist/viewer/HexViewport.logic.js +79 -0
  144. package/dist/viewer/ImageView.d.ts +19 -0
  145. package/dist/viewer/ImageView.js +230 -0
  146. package/dist/viewer/ImageZoom.logic.d.ts +65 -0
  147. package/dist/viewer/ImageZoom.logic.js +119 -0
  148. package/dist/viewer/LatestRead.logic.d.ts +27 -0
  149. package/dist/viewer/LatestRead.logic.js +55 -0
  150. package/dist/viewer/MediaControls.d.ts +25 -0
  151. package/dist/viewer/MediaControls.js +183 -0
  152. package/dist/viewer/MediaPlayer.logic.d.ts +53 -0
  153. package/dist/viewer/MediaPlayer.logic.js +68 -0
  154. package/dist/viewer/PdfView.d.ts +23 -0
  155. package/dist/viewer/PdfView.js +25 -0
  156. package/dist/viewer/QuietFocus.d.ts +19 -0
  157. package/dist/viewer/QuietFocus.js +27 -0
  158. package/dist/viewer/ScaledScroll.logic.d.ts +30 -0
  159. package/dist/viewer/ScaledScroll.logic.js +28 -0
  160. package/dist/viewer/ScaledScrollbar.d.ts +19 -0
  161. package/dist/viewer/ScaledScrollbar.js +71 -0
  162. package/dist/viewer/SyntaxHighlighter.d.ts +29 -0
  163. package/dist/viewer/SyntaxHighlighter.js +144 -0
  164. package/dist/viewer/SyntaxLanguage.logic.d.ts +110 -0
  165. package/dist/viewer/SyntaxLanguage.logic.js +283 -0
  166. package/dist/viewer/SyntaxService.d.ts +75 -0
  167. package/dist/viewer/SyntaxService.js +49 -0
  168. package/dist/viewer/SyntaxSession.logic.d.ts +78 -0
  169. package/dist/viewer/SyntaxSession.logic.js +221 -0
  170. package/dist/viewer/SyntaxWorker.d.ts +6 -0
  171. package/dist/viewer/SyntaxWorker.js +8 -0
  172. package/dist/viewer/TextEncoding.logic.d.ts +35 -0
  173. package/dist/viewer/TextEncoding.logic.js +58 -0
  174. package/dist/viewer/TextRows.logic.d.ts +86 -0
  175. package/dist/viewer/TextRows.logic.js +241 -0
  176. package/dist/viewer/TextSelection.logic.d.ts +97 -0
  177. package/dist/viewer/TextSelection.logic.js +139 -0
  178. package/dist/viewer/TextView.d.ts +13 -0
  179. package/dist/viewer/TextView.js +448 -0
  180. package/dist/viewer/TextViewport.logic.d.ts +70 -0
  181. package/dist/viewer/TextViewport.logic.js +116 -0
  182. package/dist/viewer/VideoView.d.ts +18 -0
  183. package/dist/viewer/VideoView.js +53 -0
  184. package/dist/viewer/ViewerClipboard.d.ts +30 -0
  185. package/dist/viewer/ViewerClipboard.js +70 -0
  186. package/dist/viewer/ViewerFrame.logic.d.ts +61 -0
  187. package/dist/viewer/ViewerFrame.logic.js +130 -0
  188. package/dist/viewer/ViewerKeys.d.ts +16 -0
  189. package/dist/viewer/ViewerKeys.js +14 -0
  190. package/dist/viewer/ViewerScope.d.ts +12 -0
  191. package/dist/viewer/ViewerScope.js +22 -0
  192. package/dist/viewer/ViewerViews.d.ts +28 -0
  193. package/dist/viewer/ViewerViews.js +22 -0
  194. package/dist/viewer/ViewerWindow.d.ts +53 -0
  195. package/dist/viewer/ViewerWindow.js +219 -0
  196. package/dist/viewer/index.d.ts +12 -0
  197. package/dist/viewer/index.js +12 -0
  198. package/dist/viewer/types.d.ts +151 -0
  199. package/dist/viewer/types.js +26 -0
  200. package/dist/viewer/useElementHeight.d.ts +6 -0
  201. package/dist/viewer/useElementHeight.js +22 -0
  202. package/dist/viewer/useElementSize.d.ts +7 -0
  203. package/dist/viewer/useElementSize.js +24 -0
  204. package/dist/viewer/useEscapeToClear.d.ts +8 -0
  205. package/dist/viewer/useEscapeToClear.js +26 -0
  206. package/dist/viewer/useHexDocument.d.ts +41 -0
  207. package/dist/viewer/useHexDocument.js +144 -0
  208. package/dist/viewer/useMediaElement.d.ts +10 -0
  209. package/dist/viewer/useMediaElement.js +24 -0
  210. package/dist/viewer/useSyntaxHighlight.d.ts +24 -0
  211. package/dist/viewer/useSyntaxHighlight.js +133 -0
  212. package/dist/viewer/useTextDocument.d.ts +66 -0
  213. package/dist/viewer/useTextDocument.js +245 -0
  214. package/dist/viewer/viewer.css +645 -0
  215. package/package.json +7 -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,7 +8,9 @@ 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';
13
+ import { type ViewerLabels } from './viewer.js';
12
14
  /**
13
15
  * Every chrome string UIOK's components share across instances, grouped by
14
16
  * area: key names, and, as areas arrive, verbs such as Cancel and More.
@@ -39,6 +41,10 @@ export interface UiokLabels {
39
41
  readonly terminal: TerminalLabels;
40
42
  /** A pane's tab strip: New Tab, close and picked names, and the folded tabs' count and menu (`PaneTabs`). */
41
43
  readonly paneTabs: PaneTabsLabels;
44
+ /** The Settings dialog's title, sidebar, and Done, and the Appearance page's words (`SettingsDialog`, `AppearanceSettings`). */
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;
42
48
  }
43
49
  /** The English labels every component falls back to without a `UiokProvider`. */
44
50
  export declare const DEFAULT_LABELS: UiokLabels;
@@ -16,7 +16,9 @@ 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';
21
+ import { DEFAULT_VIEWER_LABELS } from './viewer.js';
20
22
  /** The English labels every component falls back to without a `UiokProvider`. */
21
23
  export const DEFAULT_LABELS = {
22
24
  keys: DEFAULT_KEY_LABELS,
@@ -29,5 +31,7 @@ export const DEFAULT_LABELS = {
29
31
  palette: DEFAULT_PALETTE_LABELS,
30
32
  selectAll: DEFAULT_SELECT_ALL_LABELS,
31
33
  terminal: DEFAULT_TERMINAL_LABELS,
32
- paneTabs: DEFAULT_PANE_TABS_LABELS
34
+ paneTabs: DEFAULT_PANE_TABS_LABELS,
35
+ settings: DEFAULT_SETTINGS_LABELS,
36
+ viewer: DEFAULT_VIEWER_LABELS
33
37
  };
@@ -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;
@@ -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
  };
@@ -9,6 +9,8 @@ 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';
14
+ export { DEFAULT_VIEWER_LABELS, type ViewerContentLabels, type ViewerLabels, type ViewerModeLabels } from './viewer.js';
13
15
  export { DEFAULT_LABELS, type UiokLabels } from './UiokLabels.js';
14
16
  export { mergeLabels, UiokProvider, useLabels, type LabelsOverride, type UiokLabelsOverride, type UiokProviderProps } from './UiokProvider.js';
@@ -9,6 +9,8 @@ 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';
14
+ export { DEFAULT_VIEWER_LABELS } from './viewer.js';
13
15
  export { DEFAULT_LABELS } from './UiokLabels.js';
14
16
  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,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
+ };