@bigpixelrocket/uiok 0.3.0 → 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.
- package/CHANGELOG.md +23 -1
- package/dist/dialog/ConfirmDialog.d.ts +7 -1
- package/dist/dialog/ConfirmDialog.js +2 -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 +9 -2
- package/dist/frame/Tree.js +29 -6
- 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/viewer.d.ts +193 -0
- package/dist/labels/viewer.js +124 -0
- package/dist/listing/PaneMessage.d.ts +28 -0
- package/dist/listing/PaneMessage.js +12 -0
- package/dist/listing/index.d.ts +4 -2
- package/dist/listing/index.js +4 -2
- package/dist/styles.css +3 -0
- package/dist/surface/Card.d.ts +18 -0
- package/dist/surface/Card.js +10 -0
- package/dist/surface/Notice.d.ts +45 -0
- package/dist/surface/Notice.js +27 -0
- package/dist/surface/index.d.ts +5 -3
- package/dist/surface/index.js +5 -3
- package/dist/themes/themes.generated.css +1 -0
- package/dist/themes/tokens.js +4 -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
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
/* The viewer: a header at the shell's header height, an optional notice
|
|
2
|
+
when the file changed at its source, and the view filling the rest of its
|
|
3
|
+
container (a window's root, or a pane). */
|
|
4
|
+
.viewer-window {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
height: 100%;
|
|
8
|
+
min-height: 0;
|
|
9
|
+
font-family: var(--font-ui);
|
|
10
|
+
font-size: var(--font-size-body);
|
|
11
|
+
color: var(--text);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* The header is the title bar, at the shell's header height: it drags the
|
|
15
|
+
window everywhere but the mode switcher. Beside macOS's traffic lights
|
|
16
|
+
(data-traffic-lights) the file's name starts clear of them. It is a size
|
|
17
|
+
container, so the facts can leave a narrow window whole. */
|
|
18
|
+
.viewer-header {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex: 0 0 var(--shell-header-height);
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--space-8);
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
height: var(--shell-header-height);
|
|
25
|
+
padding: 0 var(--space-5) 0 var(--space-8);
|
|
26
|
+
border-bottom: var(--line) solid var(--border);
|
|
27
|
+
background: var(--surface-header);
|
|
28
|
+
container-type: inline-size;
|
|
29
|
+
-webkit-app-region: drag;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.viewer-window[data-traffic-lights] .viewer-header {
|
|
33
|
+
padding-inline-start: calc(var(--traffic-light-inset) + var(--space-8));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.viewer-identity {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex: 1;
|
|
39
|
+
align-items: baseline;
|
|
40
|
+
gap: var(--space-5);
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* The name is the title: it keeps its whole width while the facts give
|
|
45
|
+
way, and only a name longer than the row is cut, in its middle
|
|
46
|
+
(NameCut), so its extension stays in view. */
|
|
47
|
+
.viewer-name {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex: none;
|
|
50
|
+
min-width: 0;
|
|
51
|
+
max-width: 100%;
|
|
52
|
+
margin: 0;
|
|
53
|
+
font-family: var(--font-mono);
|
|
54
|
+
font-size: var(--font-size-body);
|
|
55
|
+
font-weight: var(--font-weight-strong);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* The facts give way first, at their end, and leave a narrow window
|
|
59
|
+
altogether rather than shrink to a bare "in …". */
|
|
60
|
+
.viewer-facts {
|
|
61
|
+
flex: 0 1000 auto;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
margin: 0;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
color: var(--text-dim);
|
|
66
|
+
font-size: var(--font-size-small);
|
|
67
|
+
font-variant-numeric: tabular-nums;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@container (max-width: 560px) {
|
|
73
|
+
.viewer-facts {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* The mode switcher is uiok's segmented choice, out of the drag region. */
|
|
79
|
+
.viewer-modes {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex: none;
|
|
82
|
+
-webkit-app-region: no-drag;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* The file on disk no longer matches what the window shows, or the view
|
|
86
|
+
fell back: a notice band under the header. */
|
|
87
|
+
.viewer-notice {
|
|
88
|
+
flex: none;
|
|
89
|
+
align-items: center;
|
|
90
|
+
margin: var(--space-3) var(--space-5) var(--space-3) var(--space-8);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.viewer-body {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex: 1;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
min-height: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Without a file's name the title is the window's kind, in the interface
|
|
101
|
+
font: it names no file. */
|
|
102
|
+
.viewer-name-generic {
|
|
103
|
+
font-family: var(--font-ui);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* A file that could not open: the danger glyph over the sentence, centred
|
|
107
|
+
in the window as every failed load is; the sentence wraps, never cut. */
|
|
108
|
+
.viewer-failure {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex: 1;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
gap: var(--space-4);
|
|
115
|
+
padding: var(--space-12);
|
|
116
|
+
text-align: center;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.viewer-failure-glyph {
|
|
120
|
+
width: var(--space-10);
|
|
121
|
+
height: var(--space-10);
|
|
122
|
+
color: var(--danger);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.viewer-failure p {
|
|
126
|
+
max-width: 44ch;
|
|
127
|
+
margin: 0;
|
|
128
|
+
color: var(--text);
|
|
129
|
+
user-select: text;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* The text and hex views' body (the rows and the scaled scrollbar beside
|
|
133
|
+
them) is the frame of their focus ring, drawn over both on a layer of its
|
|
134
|
+
own, so neither the rows' sticky line numbers nor their edge fade can cut
|
|
135
|
+
it, and it sits even in the window. The focus the window sets itself as it
|
|
136
|
+
opens draws none (data-quiet-focus, QuietFocus.ts); focus the user moves
|
|
137
|
+
there by keyboard does. */
|
|
138
|
+
.viewer-rows-frame {
|
|
139
|
+
position: relative;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.viewer-rows-frame:has(> :focus-visible:not([data-quiet-focus]))::after {
|
|
143
|
+
content: '';
|
|
144
|
+
position: absolute;
|
|
145
|
+
inset: 0;
|
|
146
|
+
z-index: var(--z-raised);
|
|
147
|
+
border: var(--focus-ring-width) solid var(--accent);
|
|
148
|
+
pointer-events: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Every view's foot is one bar (the text, hex, and image views'): the title
|
|
152
|
+
bar's height, so a small button keeps clear of the hairline above and the
|
|
153
|
+
window's edge below, and one inset at both ends. */
|
|
154
|
+
.viewer-status {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex: 0 0 var(--bar-height-lg);
|
|
157
|
+
align-items: center;
|
|
158
|
+
gap: var(--space-4);
|
|
159
|
+
box-sizing: border-box;
|
|
160
|
+
height: var(--bar-height-lg);
|
|
161
|
+
padding: 0 var(--space-4);
|
|
162
|
+
border-top: var(--line) solid var(--border);
|
|
163
|
+
background: var(--surface-header);
|
|
164
|
+
color: var(--text-dim);
|
|
165
|
+
font-size: var(--font-size-small);
|
|
166
|
+
white-space: nowrap;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* The text and hex views' scrollbar: its thumb maps to a byte of the file,
|
|
170
|
+
not to a page height, so it is the app's own, drawn as the platform's
|
|
171
|
+
overlay bar is: a thin rounded thumb on the rows' own ground, with no
|
|
172
|
+
track or divider of its own, hidden at rest and shown while the view
|
|
173
|
+
scrolls or the pointer is on the bar (the terminal's recipe). */
|
|
174
|
+
.scaled-scrollbar {
|
|
175
|
+
position: relative;
|
|
176
|
+
flex: none;
|
|
177
|
+
width: 12px;
|
|
178
|
+
background: var(--ground);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.scaled-scrollbar-thumb {
|
|
182
|
+
position: absolute;
|
|
183
|
+
top: 0;
|
|
184
|
+
right: 3px;
|
|
185
|
+
left: 3px;
|
|
186
|
+
border-radius: var(--radius-pill);
|
|
187
|
+
background: var(--scrollbar-thumb);
|
|
188
|
+
opacity: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.scaled-scrollbar:is([data-scrolling], :hover, :active) .scaled-scrollbar-thumb {
|
|
192
|
+
opacity: 1;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* The positioned thumb would otherwise defeat the UA's [hidden] rule. */
|
|
196
|
+
.scaled-scrollbar-thumb[hidden] {
|
|
197
|
+
display: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.scaled-scrollbar:hover .scaled-scrollbar-thumb,
|
|
201
|
+
.scaled-scrollbar:active .scaled-scrollbar-thumb {
|
|
202
|
+
background: var(--scrollbar-thumb-hover);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* The text view: the rows beside a scaled scrollbar, over a status bar.
|
|
206
|
+
Rows are a fixed 18px tall (ROW_PX in TextView.tsx) unless they wrap. */
|
|
207
|
+
.text-view {
|
|
208
|
+
display: flex;
|
|
209
|
+
flex: 1;
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
min-height: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.text-view-body {
|
|
215
|
+
display: flex;
|
|
216
|
+
flex: 1;
|
|
217
|
+
min-height: 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Only the rows in view are in the page, so the box scrolls vertically
|
|
221
|
+
only within a wrapped top row, and only from code; it scrolls sideways
|
|
222
|
+
when lines do not wrap. It positions its rows, so a row's offsetTop is its
|
|
223
|
+
place in the box. */
|
|
224
|
+
.text-rows {
|
|
225
|
+
position: relative;
|
|
226
|
+
flex: 1;
|
|
227
|
+
min-width: 0;
|
|
228
|
+
overflow-x: auto;
|
|
229
|
+
overflow-y: hidden;
|
|
230
|
+
background: var(--ground);
|
|
231
|
+
color: var(--text);
|
|
232
|
+
font-family: var(--font-mono);
|
|
233
|
+
font-size: var(--font-size-small);
|
|
234
|
+
line-height: var(--line-height-prose);
|
|
235
|
+
cursor: text;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* The rows take the keyboard's focus, but draw no ring of their own: the
|
|
239
|
+
sticky line numbers and the edge fade would cut a ring on the scroller.
|
|
240
|
+
Their frame draws it (.viewer-rows-frame in ViewerWindow.css). Lines
|
|
241
|
+
wider than the window scroll sideways on the platform's overlay bar. */
|
|
242
|
+
.text-rows:focus-visible {
|
|
243
|
+
outline: none;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.text-row {
|
|
247
|
+
display: flex;
|
|
248
|
+
width: max-content;
|
|
249
|
+
min-width: 100%;
|
|
250
|
+
min-height: 18px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.text-gutter {
|
|
254
|
+
position: sticky;
|
|
255
|
+
left: 0;
|
|
256
|
+
flex: none;
|
|
257
|
+
box-sizing: content-box;
|
|
258
|
+
width: var(--text-gutter-width);
|
|
259
|
+
padding: 0 var(--space-6) 0 var(--space-4);
|
|
260
|
+
background: var(--ground);
|
|
261
|
+
color: var(--text-dim);
|
|
262
|
+
font-variant-numeric: tabular-nums;
|
|
263
|
+
text-align: right;
|
|
264
|
+
user-select: none;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.text-content {
|
|
268
|
+
padding-right: var(--space-8);
|
|
269
|
+
white-space: pre;
|
|
270
|
+
tab-size: 8;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.text-rows-wrap .text-row {
|
|
274
|
+
width: auto;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.text-rows-wrap .text-content {
|
|
278
|
+
flex: 1;
|
|
279
|
+
min-width: 0;
|
|
280
|
+
white-space: pre-wrap;
|
|
281
|
+
overflow-wrap: anywhere;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.text-selected {
|
|
285
|
+
background: var(--text-selection-bg);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* In a window that is not in front, the drawn selection greys as the
|
|
289
|
+
library greys ::selection there (data-window-inactive on the root). */
|
|
290
|
+
:root[data-window-inactive] .text-selected {
|
|
291
|
+
background: var(--fill);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.text-empty {
|
|
295
|
+
margin: 0;
|
|
296
|
+
padding: var(--space-12);
|
|
297
|
+
color: var(--text-dim);
|
|
298
|
+
font-family: var(--font-ui);
|
|
299
|
+
font-size: var(--font-size-body);
|
|
300
|
+
text-align: center;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.viewer-status.text-status {
|
|
304
|
+
gap: var(--space-8);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.text-position {
|
|
308
|
+
font-variant-numeric: tabular-nums;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.text-message {
|
|
312
|
+
flex: 1;
|
|
313
|
+
min-width: 0;
|
|
314
|
+
overflow: hidden;
|
|
315
|
+
color: var(--text);
|
|
316
|
+
text-overflow: ellipsis;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* The language, and why text shows plain when it does: it gives way first
|
|
320
|
+
in a narrow window, with the whole of it in the tooltip. */
|
|
321
|
+
.text-syntax {
|
|
322
|
+
flex: 0 1 auto;
|
|
323
|
+
min-width: 0;
|
|
324
|
+
overflow: hidden;
|
|
325
|
+
text-overflow: ellipsis;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.text-wrap {
|
|
329
|
+
display: inline-flex;
|
|
330
|
+
align-items: center;
|
|
331
|
+
gap: var(--space-2);
|
|
332
|
+
color: var(--text);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.text-wrap input {
|
|
336
|
+
margin: 0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/* The hex view: the rows beside a scaled scrollbar, over a status bar.
|
|
340
|
+
Rows are a fixed 18px tall (ROW_PX in HexView.tsx) and never wrap. */
|
|
341
|
+
.hex-view {
|
|
342
|
+
display: flex;
|
|
343
|
+
flex: 1;
|
|
344
|
+
flex-direction: column;
|
|
345
|
+
min-height: 0;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.hex-view-body {
|
|
349
|
+
display: flex;
|
|
350
|
+
flex: 1;
|
|
351
|
+
min-height: 0;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* Only the rows in view are in the page; the box scrolls sideways when the
|
|
355
|
+
window is narrower than a row, its edge fading while more lies past it
|
|
356
|
+
(.scroll-fade-x). */
|
|
357
|
+
.hex-rows {
|
|
358
|
+
flex: 1;
|
|
359
|
+
min-width: 0;
|
|
360
|
+
overflow-x: auto;
|
|
361
|
+
overflow-y: hidden;
|
|
362
|
+
background: var(--ground);
|
|
363
|
+
color: var(--text);
|
|
364
|
+
font-family: var(--font-mono);
|
|
365
|
+
font-size: var(--font-size-small);
|
|
366
|
+
font-variant-numeric: tabular-nums;
|
|
367
|
+
line-height: var(--line-height-prose);
|
|
368
|
+
cursor: text;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* The rows take the keyboard's focus, but draw no ring of their own: the
|
|
372
|
+
sticky line numbers and the edge fade would cut a ring on the scroller.
|
|
373
|
+
Their frame draws it (.viewer-rows-frame in ViewerWindow.css). Lines
|
|
374
|
+
wider than the window scroll sideways on the platform's overlay bar. */
|
|
375
|
+
.hex-rows:focus-visible {
|
|
376
|
+
outline: none;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.hex-row {
|
|
380
|
+
min-width: max-content;
|
|
381
|
+
height: 18px;
|
|
382
|
+
padding: 0 var(--space-8) 0 var(--space-4);
|
|
383
|
+
white-space: pre;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* The whole line in one box, so its width over its character count is the
|
|
387
|
+
width of one character for hit testing. */
|
|
388
|
+
.hex-line {
|
|
389
|
+
display: inline-block;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.hex-offset {
|
|
393
|
+
color: var(--text-dim);
|
|
394
|
+
user-select: none;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.hex-text {
|
|
398
|
+
color: var(--text-dim);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* The selected bytes in both columns, on the marked tint, stronger in the
|
|
402
|
+
column they were selected in, whose form Copy takes: the marked cursor's
|
|
403
|
+
tint over the opaque ground, never over the first tint, so both keep the
|
|
404
|
+
text at its floor. */
|
|
405
|
+
.hex-selected {
|
|
406
|
+
background: var(--marked-bg);
|
|
407
|
+
color: var(--text);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.hex-selected-primary {
|
|
411
|
+
background: linear-gradient(var(--marked-cursor-bg), var(--marked-cursor-bg)) var(--ground);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.hex-empty {
|
|
415
|
+
margin: 0;
|
|
416
|
+
padding: var(--space-12);
|
|
417
|
+
color: var(--text-dim);
|
|
418
|
+
font-family: var(--font-ui);
|
|
419
|
+
font-size: var(--font-size-body);
|
|
420
|
+
text-align: center;
|
|
421
|
+
white-space: normal;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* The position gives way to the buttons in a narrow window. */
|
|
425
|
+
.hex-position {
|
|
426
|
+
flex: 1;
|
|
427
|
+
min-width: 0;
|
|
428
|
+
overflow: hidden;
|
|
429
|
+
font-family: var(--font-mono);
|
|
430
|
+
font-variant-numeric: tabular-nums;
|
|
431
|
+
text-overflow: ellipsis;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/* A message (a refused copy or jump, a failed read) gets a row of its own
|
|
435
|
+
over the status bar and wraps, so the narrowest window still shows all of
|
|
436
|
+
it. Empty, the row takes no room but stays a live region. */
|
|
437
|
+
.hex-message {
|
|
438
|
+
margin: 0;
|
|
439
|
+
padding: var(--space-3) var(--space-4);
|
|
440
|
+
border-top: var(--line) solid var(--border);
|
|
441
|
+
background: var(--surface-header);
|
|
442
|
+
color: var(--text);
|
|
443
|
+
font-size: var(--font-size-small);
|
|
444
|
+
line-height: var(--line-height-compact);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.hex-message:empty {
|
|
448
|
+
padding: 0;
|
|
449
|
+
border-top: 0;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/* The offset field is uiok's small field; only its width is the bar's. */
|
|
453
|
+
.hex-jump {
|
|
454
|
+
width: 180px;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/* The image view: the image on the window's ground, over a status bar with
|
|
458
|
+
its pixel dimensions, the zoom, and the Fit and Actual Size buttons. */
|
|
459
|
+
.image-view {
|
|
460
|
+
display: flex;
|
|
461
|
+
flex: 1;
|
|
462
|
+
flex-direction: column;
|
|
463
|
+
min-height: 0;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/* The image is placed by its size and a translation (ImageZoom.logic.ts),
|
|
467
|
+
never by the flow, so the canvas clips and never scrolls. */
|
|
468
|
+
.image-canvas {
|
|
469
|
+
position: relative;
|
|
470
|
+
flex: 1;
|
|
471
|
+
min-height: 0;
|
|
472
|
+
overflow: hidden;
|
|
473
|
+
background: var(--ground);
|
|
474
|
+
touch-action: none;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/* A zoomed image pans by a drag or a scroll under the arrow, as Preview
|
|
478
|
+
keeps it; no hand cursor. */
|
|
479
|
+
|
|
480
|
+
/* The checkerboard is the image's own background, so it shows only through
|
|
481
|
+
transparent pixels and keeps 8px squares at every zoom. Its two tones are
|
|
482
|
+
the flavor's panel and outline, so it follows the theme. */
|
|
483
|
+
.image-canvas img {
|
|
484
|
+
position: absolute;
|
|
485
|
+
top: 0;
|
|
486
|
+
left: 0;
|
|
487
|
+
max-width: none;
|
|
488
|
+
background-color: var(--surface);
|
|
489
|
+
background-image: conic-gradient(
|
|
490
|
+
var(--border) 25%,
|
|
491
|
+
transparent 0 50%,
|
|
492
|
+
var(--border) 0 75%,
|
|
493
|
+
transparent 0
|
|
494
|
+
);
|
|
495
|
+
background-size: 16px 16px;
|
|
496
|
+
user-select: none;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.image-facts {
|
|
500
|
+
display: flex;
|
|
501
|
+
flex: 1;
|
|
502
|
+
gap: var(--space-8);
|
|
503
|
+
min-width: 0;
|
|
504
|
+
overflow: hidden;
|
|
505
|
+
font-variant-numeric: tabular-nums;
|
|
506
|
+
text-overflow: ellipsis;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/* The media player's control bar: play, the elapsed time, the seek bar, the
|
|
510
|
+
duration, any facts the view adds, mute, volume, and a video's Full
|
|
511
|
+
Screen, on the same ground and at the same height as the other views'
|
|
512
|
+
status bars, so the window's foot never moves as the mode changes. The
|
|
513
|
+
sliders are uiok's .range, filled up to the value. */
|
|
514
|
+
.media-controls {
|
|
515
|
+
display: flex;
|
|
516
|
+
flex: 0 0 var(--bar-height-lg);
|
|
517
|
+
align-items: center;
|
|
518
|
+
gap: var(--space-5);
|
|
519
|
+
box-sizing: border-box;
|
|
520
|
+
height: var(--bar-height-lg);
|
|
521
|
+
padding: 0 var(--space-4);
|
|
522
|
+
border-top: var(--line) solid var(--border);
|
|
523
|
+
background: var(--surface-header);
|
|
524
|
+
color: var(--text-dim);
|
|
525
|
+
font-size: var(--font-size-small);
|
|
526
|
+
white-space: nowrap;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.media-time {
|
|
530
|
+
flex: none;
|
|
531
|
+
min-width: 4ch;
|
|
532
|
+
font-variant-numeric: tabular-nums;
|
|
533
|
+
text-align: center;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.media-seek {
|
|
537
|
+
flex: 1;
|
|
538
|
+
min-width: 80px;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/* The volume slider gives up width first when the bar runs out of room. */
|
|
542
|
+
.media-volume {
|
|
543
|
+
flex: 0 1 80px;
|
|
544
|
+
width: 80px;
|
|
545
|
+
min-width: 48px;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.media-facts {
|
|
549
|
+
flex: none;
|
|
550
|
+
font-variant-numeric: tabular-nums;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/* Near the viewer's minimum width, a video's bar (hour-long times, its
|
|
554
|
+
pixel size, and Full Screen) still fits on one row with tighter gaps. */
|
|
555
|
+
@media (max-width: 560px) {
|
|
556
|
+
.media-controls {
|
|
557
|
+
gap: var(--space-3);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/* The audio view: a quiet mark on the window's ground over the player's
|
|
562
|
+
control bar. The <audio> element has no controls attribute, so it draws
|
|
563
|
+
nothing. */
|
|
564
|
+
.audio-view {
|
|
565
|
+
display: flex;
|
|
566
|
+
flex: 1;
|
|
567
|
+
flex-direction: column;
|
|
568
|
+
min-height: 0;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.audio-stage {
|
|
572
|
+
display: flex;
|
|
573
|
+
flex: 1;
|
|
574
|
+
align-items: center;
|
|
575
|
+
justify-content: center;
|
|
576
|
+
min-height: 0;
|
|
577
|
+
background: var(--ground);
|
|
578
|
+
color: var(--text-faint);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/* The video view: the picture letterboxed on black, as QuickTime Player
|
|
582
|
+
shows it, over the player's control bar. The <video> element has no
|
|
583
|
+
controls attribute, so it draws only the picture. */
|
|
584
|
+
.video-view {
|
|
585
|
+
display: flex;
|
|
586
|
+
flex: 1;
|
|
587
|
+
flex-direction: column;
|
|
588
|
+
min-height: 0;
|
|
589
|
+
background: var(--ground);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.video-stage {
|
|
593
|
+
position: relative;
|
|
594
|
+
display: flex;
|
|
595
|
+
flex: 1;
|
|
596
|
+
align-items: center;
|
|
597
|
+
justify-content: center;
|
|
598
|
+
min-height: 0;
|
|
599
|
+
background: var(--letterbox);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/* Fitted to the stage on both axes, never cropped or stretched. */
|
|
603
|
+
.video-stage video {
|
|
604
|
+
position: absolute;
|
|
605
|
+
inset: 0;
|
|
606
|
+
width: 100%;
|
|
607
|
+
height: 100%;
|
|
608
|
+
object-fit: contain;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/* No picture: the audio view's quiet mark on the window's ground, and why. */
|
|
612
|
+
.video-stage[data-picture='none'] {
|
|
613
|
+
background: var(--ground);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.video-no-picture {
|
|
617
|
+
display: flex;
|
|
618
|
+
flex-direction: column;
|
|
619
|
+
align-items: center;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.video-no-picture p {
|
|
623
|
+
margin: 0;
|
|
624
|
+
color: var(--text-dim);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.video-stage[data-picture='none'] video {
|
|
628
|
+
display: none;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/* The PDF view: Chromium's PDF viewer fills the window below the header and
|
|
632
|
+
draws its own toolbar, sidebar, and page ground. */
|
|
633
|
+
.pdf-view {
|
|
634
|
+
display: flex;
|
|
635
|
+
flex: 1;
|
|
636
|
+
flex-direction: column;
|
|
637
|
+
min-height: 0;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.pdf-view-document {
|
|
641
|
+
flex: 1;
|
|
642
|
+
width: 100%;
|
|
643
|
+
min-height: 0;
|
|
644
|
+
border: 0;
|
|
645
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigpixelrocket/uiok",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A React UI library with a retro look: themeable design tokens and accessible components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -95,5 +95,11 @@
|
|
|
95
95
|
"publishConfig": {
|
|
96
96
|
"access": "public",
|
|
97
97
|
"provenance": true
|
|
98
|
+
},
|
|
99
|
+
"dependencies": {
|
|
100
|
+
"@shikijs/engine-javascript": "^4.6.0",
|
|
101
|
+
"@shikijs/langs": "^4.6.0",
|
|
102
|
+
"@shikijs/primitive": "^4.6.0",
|
|
103
|
+
"@shikijs/themes": "^4.6.0"
|
|
98
104
|
}
|
|
99
105
|
}
|