@vitrinka/web 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -3
- package/README.md +70 -18
- package/build/hud.iife.js +150 -28
- package/build/protocol/index.d.ts +10 -0
- package/build/recorder/capture/click.js +2 -2
- package/build/recorder/capture/nav.js +1 -1
- package/build/recorder/capture/redact.d.ts +10 -2
- package/build/recorder/capture/redact.js +53 -3
- package/build/recorder/config.d.ts +10 -0
- package/build/recorder/config.js +1 -0
- package/build/recorder/flight.d.ts +5 -0
- package/build/recorder/flight.js +5 -2
- package/build/recorder/hud/Hud.js +206 -31
- package/build/recorder/hud/NotesSheet.d.ts +24 -0
- package/build/recorder/hud/NotesSheet.js +147 -0
- package/build/recorder/hud/RecorderPill.d.ts +34 -12
- package/build/recorder/hud/RecorderPill.js +52 -14
- package/build/recorder/hud/Sheet.d.ts +18 -15
- package/build/recorder/hud/Sheet.js +13 -13
- package/build/recorder/hud/controller.d.ts +81 -4
- package/build/recorder/hud/drop.d.ts +26 -0
- package/build/recorder/hud/drop.js +35 -0
- package/build/recorder/hud/icons.d.ts +6 -0
- package/build/recorder/hud/icons.js +12 -0
- package/build/recorder/hud/notes-rows.d.ts +39 -0
- package/build/recorder/hud/notes-rows.js +49 -0
- package/build/recorder/hud/resize.d.ts +6 -3
- package/build/recorder/hud/resize.js +8 -4
- package/build/recorder/hud/styles.d.ts +1 -19
- package/build/recorder/hud/styles.js +62 -19
- package/build/recorder/index.d.ts +8 -0
- package/build/recorder/index.js +1 -0
- package/build/recorder/page-controller.js +13 -7
- package/build/recorder/queue.d.ts +22 -1
- package/build/recorder/queue.js +84 -5
- package/build/recorder/recents.d.ts +20 -4
- package/build/recorder/recents.js +41 -6
- package/build/recorder/report.js +3 -11
- package/build/recorder/session.d.ts +25 -6
- package/build/recorder/session.js +53 -11
- package/build/recorder/version.d.ts +2 -2
- package/build/recorder/version.js +1 -1
- package/package.json +1 -1
|
@@ -73,6 +73,16 @@ export interface NotePayload {
|
|
|
73
73
|
* one that never arrives (the note lands without it).
|
|
74
74
|
*/
|
|
75
75
|
attachments?: number[];
|
|
76
|
+
/**
|
|
77
|
+
* The note's client id, minted by the recorder. `replaces` names an
|
|
78
|
+
* earlier note's `cid` this one supersedes — an edit: the board shows the
|
|
79
|
+
* latest version and keeps the earlier ones in the thread. `refs` lists the
|
|
80
|
+
* `cid`s of other notes this one points at. Client ids, never seqs (a seq
|
|
81
|
+
* is allocated after the push). A server that predates them ignores all three.
|
|
82
|
+
*/
|
|
83
|
+
cid?: string;
|
|
84
|
+
replaces?: string;
|
|
85
|
+
refs?: string[];
|
|
76
86
|
[key: string]: unknown;
|
|
77
87
|
}
|
|
78
88
|
export interface SessionCreateRequest {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { pushEvent } from '../queue';
|
|
10
10
|
import { currentRoute } from '../state';
|
|
11
|
-
import { maskDirectives, redactText } from './redact';
|
|
11
|
+
import { maskDirectives, redactedRoute, redactText } from './redact';
|
|
12
12
|
import { elementText, shortSelector } from './selector';
|
|
13
13
|
export { elementText, shortSelector };
|
|
14
14
|
const CLICKABLE = 'a,button,[role=button],input,select,textarea,label';
|
|
@@ -47,7 +47,7 @@ export function installClickLane(opts) {
|
|
|
47
47
|
selector: shortSelector(el),
|
|
48
48
|
text: clickText(el),
|
|
49
49
|
rect: imageRect(el),
|
|
50
|
-
route:
|
|
50
|
+
route: redactedRoute(),
|
|
51
51
|
}, { tabId: currentRoute.tabId, tabHost: currentRoute.tabHost });
|
|
52
52
|
}
|
|
53
53
|
catch {
|
|
@@ -23,7 +23,7 @@ export function noteNavigation(force = false) {
|
|
|
23
23
|
if (url === lastUrl && !force)
|
|
24
24
|
return false;
|
|
25
25
|
lastUrl = url;
|
|
26
|
-
return null !== pushEvent('nav', { url: redactUrl(url), route: loc.pathname, spa: true }, { tabId: currentRoute.tabId, tabHost: currentRoute.tabHost });
|
|
26
|
+
return null !== pushEvent('nav', { url: redactUrl(url), route: redactUrl(loc.pathname), spa: true }, { tabId: currentRoute.tabId, tabHost: currentRoute.tabHost });
|
|
27
27
|
}
|
|
28
28
|
/** Seed the dedupe with the URL the session started on (its nav is pushed by startSession). */
|
|
29
29
|
export function primeNavigation() {
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* or slow policy fetch means the defaults, never capture-everything.
|
|
10
10
|
*
|
|
11
11
|
* Capture layers import the bound helpers below so every call site stays a
|
|
12
|
-
* one-liner and can never forget to pass the rules.
|
|
12
|
+
* one-liner and can never forget to pass the rules. URLs and routes also pass
|
|
13
|
+
* the host's own `sanitizeUrl` (config) first: credentials in PATHS are the
|
|
14
|
+
* app's to name, the engine only sees query and fragment pairs.
|
|
13
15
|
*/
|
|
14
16
|
import type { eventWithTime, metaEvent } from '@rrweb/types';
|
|
15
17
|
import { type MaskDirectives, type RedactionPolicy, type RuleSet } from '@vitrinka/redact';
|
|
@@ -31,8 +33,14 @@ export declare function redactText(text: string | undefined): string | undefined
|
|
|
31
33
|
* generic text scanner.
|
|
32
34
|
*/
|
|
33
35
|
export declare function redactAndCap(body: string, cap: number, contentType?: string): string | undefined;
|
|
34
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Scrub one URL or route under the active rules: the host's `sanitizeUrl`
|
|
38
|
+
* first (path credentials), then the engine's query/fragment scrub and
|
|
39
|
+
* patterns. Every URL-bearing field the recorder captures passes here.
|
|
40
|
+
*/
|
|
35
41
|
export declare function redactUrl(url: string): string;
|
|
42
|
+
/** The `route` an event carries: the current pathname through `redactUrl`. */
|
|
43
|
+
export declare function redactedRoute(): string;
|
|
36
44
|
/** rrweb's Meta event — the head of every full snapshot (start, each checkout, resume). */
|
|
37
45
|
export declare function isMetaEvent(ev: eventWithTime): ev is metaEvent & eventWithTime;
|
|
38
46
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { compileRules, redactAndCap as engineRedactAndCap, redactHeaders as engineRedactHeaders, redactText as engineRedactText, redactUrl as engineRedactUrl, maskDirectives as engineMaskDirectives, } from '@vitrinka/redact';
|
|
1
|
+
import { compileRules, REDACTED, redactAndCap as engineRedactAndCap, redactHeaders as engineRedactHeaders, redactText as engineRedactText, redactUrl as engineRedactUrl, maskDirectives as engineMaskDirectives, } from '@vitrinka/redact';
|
|
2
|
+
import { recorderConfig } from '../config';
|
|
3
|
+
import { currentRoute } from '../state';
|
|
2
4
|
// Engine primitives that need no binding, re-exported for tests and callers.
|
|
3
5
|
export { isSecretKey, REDACTED } from '@vitrinka/redact';
|
|
4
6
|
let rules = compileRules(null);
|
|
@@ -27,9 +29,57 @@ export function redactText(text) {
|
|
|
27
29
|
export function redactAndCap(body, cap, contentType) {
|
|
28
30
|
return engineRedactAndCap(rules, body, cap, contentType);
|
|
29
31
|
}
|
|
30
|
-
/**
|
|
32
|
+
/** The sanitizer whose failure was last reported: once, not on every URL. */
|
|
33
|
+
let reportedSanitizer = null;
|
|
34
|
+
/**
|
|
35
|
+
* The host's `sanitizeUrl` over one captured URL or route. FAIL CLOSED: a
|
|
36
|
+
* sanitizer that throws or returns a non-string leaves the URL's origin, or
|
|
37
|
+
* `[redacted]` when it has none (a relative URL, a route), never the raw
|
|
38
|
+
* value. It applies under `fullFidelity` too: it is the host's statement
|
|
39
|
+
* about its own URLs, not a workspace redaction rule.
|
|
40
|
+
*/
|
|
41
|
+
function sanitizeUrl(url) {
|
|
42
|
+
const sanitize = recorderConfig().sanitizeUrl;
|
|
43
|
+
if (!sanitize)
|
|
44
|
+
return url;
|
|
45
|
+
let failure;
|
|
46
|
+
try {
|
|
47
|
+
const out = sanitize(url);
|
|
48
|
+
if (typeof out === 'string')
|
|
49
|
+
return out;
|
|
50
|
+
failure = `returned ${typeof out}`;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Nothing of the thrown value: its message or name may quote the very URL it
|
|
54
|
+
// could not handle, and reading a property (or `instanceof`) can throw again.
|
|
55
|
+
failure = 'threw';
|
|
56
|
+
}
|
|
57
|
+
if (reportedSanitizer !== sanitize) {
|
|
58
|
+
reportedSanitizer = sanitize;
|
|
59
|
+
console.warn(`vitrinka: sanitizeUrl ${failure} — such URLs are recorded as their origin only`);
|
|
60
|
+
}
|
|
61
|
+
return originOf(url) ?? REDACTED;
|
|
62
|
+
}
|
|
63
|
+
function originOf(url) {
|
|
64
|
+
try {
|
|
65
|
+
const { origin } = new URL(url);
|
|
66
|
+
return origin === 'null' ? null : origin;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Scrub one URL or route under the active rules: the host's `sanitizeUrl`
|
|
74
|
+
* first (path credentials), then the engine's query/fragment scrub and
|
|
75
|
+
* patterns. Every URL-bearing field the recorder captures passes here.
|
|
76
|
+
*/
|
|
31
77
|
export function redactUrl(url) {
|
|
32
|
-
return engineRedactUrl(rules, url);
|
|
78
|
+
return engineRedactUrl(rules, sanitizeUrl(url));
|
|
79
|
+
}
|
|
80
|
+
/** The `route` an event carries: the current pathname through `redactUrl`. */
|
|
81
|
+
export function redactedRoute() {
|
|
82
|
+
return redactUrl(currentRoute.pathname);
|
|
33
83
|
}
|
|
34
84
|
/** rrweb's `EventType.Meta`; `@rrweb/types` is type-only here, so the value. */
|
|
35
85
|
const RRWEB_META = 4;
|
|
@@ -33,6 +33,16 @@ export interface RecorderConfig {
|
|
|
33
33
|
* starts, and Report a bug is offered only during one.
|
|
34
34
|
*/
|
|
35
35
|
flightRecorder?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Rewrites every URL and route the recorder captures before the redaction
|
|
38
|
+
* engine scrubs it — for credentials an app keeps in its PATHS
|
|
39
|
+
* (`/reset-password/:token`), which the query/fragment scrub cannot see.
|
|
40
|
+
* It receives the string as captured: an absolute page URL, a request URL
|
|
41
|
+
* as the app passed it (often relative), or a bare route path. Fail closed:
|
|
42
|
+
* a sanitizer that throws (or returns a non-string) leaves the URL's origin,
|
|
43
|
+
* or `[redacted]` when it has none — never the raw value.
|
|
44
|
+
*/
|
|
45
|
+
sanitizeUrl?: (url: string) => string;
|
|
36
46
|
}
|
|
37
47
|
export declare function configureRecorder(next: RecorderConfig): void;
|
|
38
48
|
export declare function recorderConfig(): Readonly<RecorderConfig>;
|
package/build/recorder/config.js
CHANGED
|
@@ -40,6 +40,11 @@ export interface FlightWindow {
|
|
|
40
40
|
bytes: number;
|
|
41
41
|
/** The Meta event's (already redacted) page URL. */
|
|
42
42
|
href: string;
|
|
43
|
+
/**
|
|
44
|
+
* The page's route when the window opened: the raw path through `redactUrl`,
|
|
45
|
+
* so route-only rules apply (never re-derived from the scrubbed `href`).
|
|
46
|
+
*/
|
|
47
|
+
route: string;
|
|
43
48
|
}
|
|
44
49
|
/** What a report sends: oldest window first, lanes in capture order. */
|
|
45
50
|
export interface FlightClip {
|
package/build/recorder/flight.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { isMetaEvent } from './capture/redact';
|
|
1
|
+
import { isMetaEvent, redactUrl } from './capture/redact';
|
|
2
|
+
import { currentRoute } from './state';
|
|
2
3
|
export const FLIGHT_CHECKOUT_MS = 30_000;
|
|
3
4
|
export const FLIGHT_MAX_RRWEB_BYTES = 4 * 1024 * 1024;
|
|
4
5
|
export const FLIGHT_MAX_RRWEB_EVENTS = 20_000;
|
|
@@ -59,7 +60,9 @@ export function pushFlightRRWeb(ev) {
|
|
|
59
60
|
return;
|
|
60
61
|
const oldest = windows[0];
|
|
61
62
|
if (isMetaEvent(ev)) {
|
|
62
|
-
|
|
63
|
+
// rrweb stamps the Meta event synchronously: the document is still on its page.
|
|
64
|
+
const path = globalThis.location?.pathname ?? currentRoute.pathname;
|
|
65
|
+
windows.push({ events: [], bytes: 0, href: ev.data.href, route: redactUrl(path) });
|
|
63
66
|
if (windows.length > 2)
|
|
64
67
|
windows.shift();
|
|
65
68
|
}
|
|
@@ -13,6 +13,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
13
13
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, } from 'react';
|
|
14
14
|
import { createPortal } from 'react-dom';
|
|
15
15
|
import { AnnotateOverlay } from './AnnotateOverlay';
|
|
16
|
+
import { DraftDrop } from './drop';
|
|
17
|
+
import { AnnotateIcon, CloseIcon, ReplyIcon } from './icons';
|
|
18
|
+
import { NotesSheet } from './NotesSheet';
|
|
19
|
+
import { noteRows } from './notes-rows';
|
|
16
20
|
import { bindChords } from './chords';
|
|
17
21
|
import { flowReducer, NO_FLOW } from './flow';
|
|
18
22
|
import { createSheetHost, insideHud, sheetTarget } from './host';
|
|
@@ -21,7 +25,7 @@ import { LinkSheet } from './LinkSheet';
|
|
|
21
25
|
import { listen } from './listen';
|
|
22
26
|
import { Menu } from './Menu';
|
|
23
27
|
import { alignFor, towardCentre } from './place';
|
|
24
|
-
import { RecorderPill } from './RecorderPill';
|
|
28
|
+
import { newCid, RecorderPill, Stats } from './RecorderPill';
|
|
25
29
|
import { gripFor } from './resize';
|
|
26
30
|
import { Sheet } from './Sheet';
|
|
27
31
|
import { colOf, rowOf } from './spots';
|
|
@@ -48,6 +52,8 @@ function reportSheet(mark, recording) {
|
|
|
48
52
|
const MIN_SAVING_MS = 700;
|
|
49
53
|
/** How long the clock says "Saved" after a note or annotation. */
|
|
50
54
|
const FLASH_MS = 1600;
|
|
55
|
+
/** The HUD storage key that remembers the first-run hint was seen. */
|
|
56
|
+
const HINTED_KEY = 'hud.hinted';
|
|
51
57
|
/** A clock that ticks every second while `active` (the timer, ages, the sync chip). */
|
|
52
58
|
function useNow(active) {
|
|
53
59
|
const [now, setNow] = useState(() => Date.now());
|
|
@@ -80,7 +86,23 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
80
86
|
const [starting, setStarting] = useState(false);
|
|
81
87
|
const [menu, setMenu] = useState(false);
|
|
82
88
|
const [flow, dispatch] = useReducer(flowReducer, NO_FLOW);
|
|
83
|
-
|
|
89
|
+
// The clock's word after a note (D11): `queued` until the server has it, then `saved`.
|
|
90
|
+
const [flash, setFlash] = useState(null);
|
|
91
|
+
const [flashCid, setFlashCid] = useState(null);
|
|
92
|
+
// The tray is unfolded on the recording face: the stats float shows (D4).
|
|
93
|
+
const [trayOpen, setTrayOpen] = useState(false);
|
|
94
|
+
// The first-run hint (D3): once per origin, the idle puck says what Start does.
|
|
95
|
+
const [hinted, setHinted] = useState(() => storage.getString(HINTED_KEY) === '1');
|
|
96
|
+
const hintRef = useRef(null);
|
|
97
|
+
const markHinted = useCallback(() => {
|
|
98
|
+
setHinted(true);
|
|
99
|
+
try {
|
|
100
|
+
storage.set(HINTED_KEY, '1');
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
console.warn('vitrinka: could not remember the first-run hint', e);
|
|
104
|
+
}
|
|
105
|
+
}, [storage]);
|
|
84
106
|
const annotating = snap.annotating;
|
|
85
107
|
const now = useNow(rec !== null || menu || flow.face !== 'none');
|
|
86
108
|
const rootRef = useRef(null);
|
|
@@ -127,41 +149,112 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
127
149
|
})
|
|
128
150
|
.catch((e) => setLink({ phase: 'error', flow: null, error: errorText(e) }));
|
|
129
151
|
}, [controller]);
|
|
130
|
-
|
|
152
|
+
// A composer closed with words or images in it PARKS (D10/D13): the pill
|
|
153
|
+
// shows the draft drop until it is resumed, sent, or emptied.
|
|
154
|
+
const [parked, setParked] = useState(null);
|
|
155
|
+
const sheetNow = useRef(sheet);
|
|
156
|
+
sheetNow.current = sheet;
|
|
157
|
+
const draftNow = useRef({ draft, images });
|
|
158
|
+
draftNow.current = { draft, images };
|
|
159
|
+
const closeSheet = useCallback(() => {
|
|
160
|
+
const s = sheetNow.current;
|
|
161
|
+
const d = draftNow.current;
|
|
162
|
+
if (s && !s.report && !s.notes && (d.draft.trim() !== '' || d.images.length > 0))
|
|
163
|
+
setParked(s);
|
|
164
|
+
setSheet(null);
|
|
165
|
+
}, []);
|
|
131
166
|
// A drag closes the composer (its draft survives) and the menu; the link sheet follows the dock.
|
|
132
167
|
const onMoveStart = useCallback(() => {
|
|
133
|
-
|
|
168
|
+
closeSheet();
|
|
134
169
|
setMenu(false);
|
|
135
|
-
}, []);
|
|
170
|
+
}, [closeSheet]);
|
|
171
|
+
// The notes this draft references (D7), and the live recording's notes for the sheet (D5).
|
|
172
|
+
const [refs, setRefs] = useState([]);
|
|
173
|
+
const [notes, setNotes] = useState([]);
|
|
174
|
+
const [notesTick, setNotesTick] = useState(0);
|
|
175
|
+
const recId = rec?.sessionId ?? null;
|
|
176
|
+
const pendingKey = rec?.sync.pendingNotes?.join(',') ?? '';
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if (!recId || !controller.listNotes) {
|
|
179
|
+
setNotes([]);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
let live = true;
|
|
183
|
+
void controller.listNotes().then((list) => {
|
|
184
|
+
if (live)
|
|
185
|
+
setNotes(list ?? []);
|
|
186
|
+
});
|
|
187
|
+
return () => {
|
|
188
|
+
live = false;
|
|
189
|
+
};
|
|
190
|
+
}, [controller, recId, pendingKey, notesTick]);
|
|
191
|
+
const rows = useMemo(() => noteRows(notes, rec?.sync.pendingNotes ?? []), [notes, rec?.sync.pendingNotes]);
|
|
136
192
|
const dock = useDock(onMoveStart, storage);
|
|
137
193
|
const phone = useMedia(PHONE_QUERY);
|
|
194
|
+
// The composer a note opens: the PARKED draft when there is one — it carries
|
|
195
|
+
// its pick, and a fresh Note sheet would send that annotation as a plain note.
|
|
196
|
+
const parkedNow = useRef(parked);
|
|
197
|
+
parkedNow.current = parked;
|
|
198
|
+
const composeNote = useCallback(() => {
|
|
199
|
+
setSheet(parkedNow.current ?? { title: 'Note', ctx: `step · ${location.pathname}`, pick: null });
|
|
200
|
+
setParked(null);
|
|
201
|
+
}, []);
|
|
138
202
|
const openNote = useCallback(() => {
|
|
139
203
|
if (!controller.getSnapshot().recording)
|
|
140
204
|
return;
|
|
141
205
|
controller.setAnnotating(false);
|
|
142
206
|
setMenu(false);
|
|
143
|
-
|
|
144
|
-
}, [controller]);
|
|
207
|
+
composeNote();
|
|
208
|
+
}, [controller, composeNote]);
|
|
209
|
+
// The composer that Reselect left: Esc in pick mode goes back to it unchanged (D9).
|
|
210
|
+
const reselectRef = useRef(null);
|
|
145
211
|
const toggleAnnotate = useCallback(() => {
|
|
146
212
|
const s = controller.getSnapshot();
|
|
147
213
|
if (!s.recording)
|
|
148
214
|
return;
|
|
149
|
-
|
|
215
|
+
reselectRef.current = null;
|
|
216
|
+
closeSheet();
|
|
150
217
|
setMenu(false);
|
|
151
218
|
setMarking(false);
|
|
152
219
|
controller.setAnnotating(!s.annotating);
|
|
220
|
+
}, [controller, closeSheet]);
|
|
221
|
+
const reselect = useCallback(() => {
|
|
222
|
+
reselectRef.current = sheetNow.current;
|
|
223
|
+
setSheet(null);
|
|
224
|
+
controller.setAnnotating(true);
|
|
153
225
|
}, [controller]);
|
|
226
|
+
const openNotes = useCallback(() => {
|
|
227
|
+
if (!controller.getSnapshot().recording)
|
|
228
|
+
return;
|
|
229
|
+
controller.setAnnotating(false);
|
|
230
|
+
setMenu(false);
|
|
231
|
+
closeSheet();
|
|
232
|
+
setNotesTick((t) => t + 1);
|
|
233
|
+
setSheet({ title: 'Notes', ctx: '', pick: null, notes: true });
|
|
234
|
+
}, [controller, closeSheet]);
|
|
154
235
|
const onPick = useCallback((pick) => {
|
|
155
236
|
controller.setAnnotating(false);
|
|
237
|
+
reselectRef.current = null;
|
|
156
238
|
if (marking) {
|
|
157
239
|
setMarking(false);
|
|
158
240
|
setSheet(reportSheet(pick, controller.getSnapshot().recording !== null));
|
|
159
241
|
return;
|
|
160
242
|
}
|
|
161
|
-
|
|
243
|
+
setParked(null);
|
|
244
|
+
setSheet({ title: pick.selector ? 'Annotate element' : 'Annotate region', ctx: '', pick, crop: null });
|
|
245
|
+
// The host's pixels, when it has any (the extension): the header shows them once they arrive.
|
|
246
|
+
void controller.captureRegion?.(pick.rect).then((crop) => {
|
|
247
|
+
if (crop)
|
|
248
|
+
setSheet((s) => (s?.pick === pick ? { ...s, crop } : s));
|
|
249
|
+
});
|
|
162
250
|
}, [controller, marking]);
|
|
163
251
|
const cancelAnnotate = useCallback(() => {
|
|
164
252
|
controller.setAnnotating(false);
|
|
253
|
+
if (reselectRef.current) {
|
|
254
|
+
setSheet(reselectRef.current);
|
|
255
|
+
reselectRef.current = null;
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
165
258
|
if (!marking)
|
|
166
259
|
return;
|
|
167
260
|
// Back to the report as it was (its earlier mark, if any).
|
|
@@ -187,11 +280,32 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
187
280
|
controller.setAnnotating(true);
|
|
188
281
|
}, [sheet, controller]);
|
|
189
282
|
const flashTimer = useRef(undefined);
|
|
190
|
-
const
|
|
283
|
+
const sayFlash = useCallback((word) => {
|
|
191
284
|
clearTimeout(flashTimer.current);
|
|
192
|
-
setFlash(
|
|
193
|
-
flashTimer.current = setTimeout(() => setFlash(
|
|
285
|
+
setFlash(word);
|
|
286
|
+
flashTimer.current = setTimeout(() => setFlash(null), FLASH_MS);
|
|
194
287
|
}, []);
|
|
288
|
+
// A note went out under `cid`: "queued" while its event waits, "Saved" once
|
|
289
|
+
// the server acknowledged it. A host that does not report pending notes
|
|
290
|
+
// (an older extension) says Saved at once, as before.
|
|
291
|
+
const saidSaved = useCallback((cid) => {
|
|
292
|
+
const pending = controller.getSnapshot().recording?.sync.pendingNotes;
|
|
293
|
+
if (!cid || pending === undefined) {
|
|
294
|
+
setFlashCid(null);
|
|
295
|
+
sayFlash('saved');
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
clearTimeout(flashTimer.current);
|
|
299
|
+
setFlashCid(cid);
|
|
300
|
+
setFlash('queued');
|
|
301
|
+
}, [controller, sayFlash]);
|
|
302
|
+
const pendingNotes = rec?.sync.pendingNotes;
|
|
303
|
+
useEffect(() => {
|
|
304
|
+
if (flashCid === null || pendingNotes === undefined || pendingNotes.includes(flashCid))
|
|
305
|
+
return;
|
|
306
|
+
setFlashCid(null);
|
|
307
|
+
sayFlash('saved');
|
|
308
|
+
}, [flashCid, pendingNotes, sayFlash]);
|
|
195
309
|
useEffect(() => () => clearTimeout(flashTimer.current), []);
|
|
196
310
|
// The frozen last minute lives while the report is composed (sheet open or
|
|
197
311
|
// marking); any other close drops it. A send already took it.
|
|
@@ -230,11 +344,12 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
230
344
|
dispatch({ type: 'send' });
|
|
231
345
|
runReport(r);
|
|
232
346
|
}, [controller, runReport, saidSaved]);
|
|
233
|
-
const onSend = useCallback((text
|
|
347
|
+
const onSend = useCallback((text) => {
|
|
234
348
|
const s = sheet;
|
|
235
349
|
setSheet(null);
|
|
236
350
|
if (!s)
|
|
237
351
|
return;
|
|
352
|
+
setParked(null);
|
|
238
353
|
// Images ride only while the host takes them (a policy switched off mid-draft drops them).
|
|
239
354
|
const held = controller.getSnapshot().canAttach === true ? (s.report ? reportImages : images) : [];
|
|
240
355
|
const attachments = held.length ? { attachments: held } : {};
|
|
@@ -242,23 +357,22 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
242
357
|
fileReport({ text, rect: s.pick?.rect ?? null, selector: s.pick?.selector ?? '', ...attachments });
|
|
243
358
|
return;
|
|
244
359
|
}
|
|
360
|
+
const link = { cid: newCid(), ...(refs.length ? { refs: refs.map((r) => r.cid) } : {}) };
|
|
245
361
|
if (s.pick) {
|
|
246
|
-
controller.annotate({ text, rect: s.pick.rect, selector: s.pick.selector,
|
|
247
|
-
setDraft('');
|
|
248
|
-
setImages([]);
|
|
249
|
-
saidSaved();
|
|
362
|
+
controller.annotate({ text, rect: s.pick.rect, selector: s.pick.selector, ...attachments, link });
|
|
250
363
|
}
|
|
251
364
|
else if (text || held.length) {
|
|
252
365
|
// An image can BE the note: text may be empty when it carries one.
|
|
253
|
-
|
|
254
|
-
controller.note(text, held);
|
|
255
|
-
else
|
|
256
|
-
controller.note(text);
|
|
257
|
-
setDraft('');
|
|
258
|
-
setImages([]);
|
|
259
|
-
saidSaved();
|
|
366
|
+
controller.note(text, held.length ? held : undefined, link);
|
|
260
367
|
}
|
|
261
|
-
|
|
368
|
+
else
|
|
369
|
+
return;
|
|
370
|
+
setDraft('');
|
|
371
|
+
setImages([]);
|
|
372
|
+
setRefs([]);
|
|
373
|
+
setNotesTick((t) => t + 1);
|
|
374
|
+
saidSaved(link.cid);
|
|
375
|
+
}, [sheet, controller, saidSaved, fileReport, images, reportImages, refs]);
|
|
262
376
|
const onStart = useCallback(() => {
|
|
263
377
|
if (!controller.getSnapshot().linked) {
|
|
264
378
|
beginLink();
|
|
@@ -330,6 +444,21 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
330
444
|
controller.holdReport?.(false);
|
|
331
445
|
dispatch({ type: 'dismiss' });
|
|
332
446
|
}, [failedReport, controller]);
|
|
447
|
+
// The notes sheet's doors (D6/D7): an edit is a new note replacing the newest
|
|
448
|
+
// version; a reference opens the note composer with the note as a ↳ chip.
|
|
449
|
+
const onEditNote = useCallback((row, text) => {
|
|
450
|
+
const link = { cid: newCid(), replaces: row.latestCid };
|
|
451
|
+
controller.note(text, undefined, link);
|
|
452
|
+
setNotesTick((t) => t + 1);
|
|
453
|
+
saidSaved(link.cid);
|
|
454
|
+
}, [controller, saidSaved]);
|
|
455
|
+
const onReferenceNote = useCallback((row) => {
|
|
456
|
+
setRefs((list) => (list.some((r) => r.cid === row.cid) ? list : [...list, row]));
|
|
457
|
+
composeNote();
|
|
458
|
+
}, [composeNote]);
|
|
459
|
+
const onRetryBuild = useCallback((sessionId) => {
|
|
460
|
+
controller.retryBuild?.(sessionId).catch((e) => console.warn('vitrinka: retry the board build —', errorText(e)));
|
|
461
|
+
}, [controller]);
|
|
333
462
|
const onRetry = useCallback(() => {
|
|
334
463
|
// A refused Start has nothing to retry (and must never run a Stop).
|
|
335
464
|
if (flow.face === 'failed' && flow.start)
|
|
@@ -554,14 +683,30 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
554
683
|
useFloat(menuRef, anchor, side, align, menuP.mounted);
|
|
555
684
|
const tucked = 'tuck' in dock.place;
|
|
556
685
|
const line = rec ? healthLine(rec.sync, now) : '';
|
|
557
|
-
|
|
686
|
+
// The details float (D4): the stats pill while the tray is unfolded, the
|
|
687
|
+
// health line whenever something is wrong, everything in verbose mode.
|
|
688
|
+
const detailOn = rec !== null &&
|
|
689
|
+
(snap.prefs.verbose || line !== '' || trayOpen) &&
|
|
690
|
+
!menu &&
|
|
691
|
+
!layerOpen &&
|
|
692
|
+
flow.face === 'none' &&
|
|
693
|
+
!dock.dragging &&
|
|
694
|
+
!tucked;
|
|
558
695
|
const detailP = usePresence(detailOn, 150);
|
|
559
696
|
useFloat(detailRef, anchor, side, align, detailP.mounted);
|
|
697
|
+
// A first recording, however it began (puck, shortcut, the hint), has taught it.
|
|
698
|
+
useEffect(() => {
|
|
699
|
+
if (rec && !hinted)
|
|
700
|
+
markHinted();
|
|
701
|
+
}, [rec, hinted, markHinted]);
|
|
702
|
+
const hintOn = !hinted && rec === null && snap.linked && following === null && !menu && !layerOpen && flow.face === 'none' && !dock.dragging && !tucked;
|
|
703
|
+
const hintP = usePresence(hintOn, 150);
|
|
704
|
+
useFloat(hintRef, anchor, side, align, hintP.mounted);
|
|
560
705
|
const lastRec = useRef(rec);
|
|
561
706
|
if (rec)
|
|
562
707
|
lastRec.current = rec;
|
|
563
708
|
const detailRec = rec ?? lastRec.current;
|
|
564
|
-
const sheetEl = shownSheet && portal ? (_jsxs("div", { className: "hud", "data-size": snap.prefs.size, children: [portal.own ? _jsx("style", { children: HUD_CSS }) : null, _jsx("div", { ref: layerRef, className: layerCls, style: layer.style, children: _jsx(Sheet, { className: `${motionCls} ${sheetP.cls}`, origin: layer.origin, title: shownSheet.title, ctx: shownSheet.ctx, pick: shownSheet.pick
|
|
709
|
+
const sheetEl = shownSheet && portal ? (_jsxs("div", { className: "hud", "data-size": snap.prefs.size, children: [portal.own ? _jsx("style", { children: HUD_CSS }) : null, _jsx("div", { ref: layerRef, className: layerCls, style: layer.style, children: shownSheet.notes ? (_jsx(NotesSheet, { className: `${motionCls} ${sheetP.cls}`, origin: layer.origin, rows: rows, now: now, onEdit: onEditNote, onReference: onReferenceNote, onClose: closeSheet })) : (_jsx(Sheet, { className: `${motionCls} ${sheetP.cls}`, origin: layer.origin, title: shownSheet.title, ctx: shownSheet.ctx, head: shownSheet.pick && !shownSheet.report ? _jsx(PickHead, { pick: shownSheet.pick, crop: shownSheet.crop ?? null, onReselect: reselect }) : null, below: !shownSheet.report && refs.length ? (_jsx(RefChips, { refs: refs, onRemove: (cid) => setRefs((list) => list.filter((r) => r.cid !== cid)) })) : null, draft: shownSheet.report ? reportDraft : draft, onDraft: shownSheet.report ? setReportDraft : setDraft, onSend: onSend, onClose: closeSheet, kind: shownSheet.report ? 'report' : shownSheet.pick ? 'annotation' : 'note',
|
|
565
710
|
// `|| 0`: a host's snapshot from before the sheet size lacks the fields.
|
|
566
711
|
sheetW: snap.prefs.sheetW || 0, sheetH: snap.prefs.sheetH || 0, room: layer.room,
|
|
567
712
|
// A phone's bottom sheet spans the viewport: its grip sizes the cap alone.
|
|
@@ -571,7 +716,7 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
571
716
|
? shownSheet.report
|
|
572
717
|
? { images: reportImages, onImages: setReportImages, preparing: reportPreparing, onPreparing: setReportPreparing }
|
|
573
718
|
: { images, onImages: setImages, preparing, onPreparing: setPreparing }
|
|
574
|
-
: {}) }, shownSheet.report ? 'report' : 'note') })] })) : null;
|
|
719
|
+
: {}) }, shownSheet.report ? 'report' : 'note')) })] })) : null;
|
|
575
720
|
// Stable phrases only: a live region re-announces on every text change.
|
|
576
721
|
const hs = rec?.sync.state ?? null;
|
|
577
722
|
const status = !rec
|
|
@@ -590,7 +735,37 @@ export function Hud({ controller, hostMount, defaultTitle, storage }) {
|
|
|
590
735
|
? { 'data-tuck': place.tuck, style: { '--ty': String(place.y) } }
|
|
591
736
|
: { 'data-row': rowOf(place.spot), 'data-col': colOf(place.spot) };
|
|
592
737
|
// A remote shows nothing (D7: one pill per document) — except a refused
|
|
593
|
-
// Start's face, which says why the pill steps aside until it is dismissed
|
|
594
|
-
|
|
595
|
-
|
|
738
|
+
// Start's face, which says why the pill steps aside until it is dismissed,
|
|
739
|
+
// and a leader in ANOTHER document: this one would otherwise show no
|
|
740
|
+
// recorder at all, so the pill says where the recording is (HUD polish D11).
|
|
741
|
+
const hidden = following !== null && snap.followingElsewhere !== true && !(flow.face === 'failed' && flow.start === true);
|
|
742
|
+
return (_jsxs("div", { ref: rootRef, className: "hud", "data-size": snap.prefs.size, "data-spot": 'spot' in place ? place.spot : undefined, ...(hidden ? { 'data-following': following, style: { display: 'none' } } : {}), children: [_jsx("style", { children: HUD_CSS }), annotating && (rec || marking) ? _jsx(AnnotateOverlay, { onPick: onPick, onCancel: cancelAnnotate }) : null, _jsxs("div", { ref: dock.ref, className: dock.dragging ? 'dock dragging' : 'dock', ...dockAttrs, onClickCapture: dock.onClickCapture, children: [_jsx(RecorderPill, { snap: snap, now: now, flow: flow, flash: flash, composing: sheet !== null, starting: starting, menuOpen: menu, place: place, dragging: dock.dragging, handle: dock.handle, pillRef: pillRef, onMove: dock.moveTo, onLink: beginLink, onStart: onStart, onPause: onPause, onNote: openNote, onAnnotate: toggleAnnotate, onMenu: toggleMenu, onAskStop: askStop, onConfirm: onConfirm, onCancel: onCancel, onRetry: onRetry, onDismiss: onDismiss, onRetryBuild: onRetryBuild, canRetryBuild: typeof controller.retryBuild === 'function', onTrayOpen: setTrayOpen, ...(controller.listNotes ? { notesCount: rows.length } : {}), onNotes: openNotes }), parked && !sheet && rec && !annotating && 'spot' in place ? (_jsx(DraftDrop, { text: draft, crop: parked.crop ?? null, side: colOf(place.spot) === 'r' ? 'start' : 'end', onResume: () => {
|
|
743
|
+
setSheet(parked);
|
|
744
|
+
setParked(null);
|
|
745
|
+
} })) : null] }), menuP.mounted ? (_jsx(Menu, { snap: snap, now: now, place: place, className: `grow ${menuP.cls}`, menuRef: menuRef, onClose: () => setMenu(false), onMove: dock.moveTo, onSize: (size) => void controller.setPrefs({ size }), onVerbose: (verbose) => void controller.setPrefs({ verbose }), onAskUnlink: askUnlink, onLink: beginLink, ...(snap.canReport && controller.report ? { onReport: openReport } : {}) })) : null, _jsx(Tooltip, { root: rootRef, side: side, suppressed: dock.dragging || menu || layerOpen }), detailP.mounted && detailRec ? (_jsx("div", { ref: detailRef, className: [
|
|
746
|
+
'float detail grow',
|
|
747
|
+
detailP.cls,
|
|
748
|
+
snap.prefs.verbose ? '' : 'line',
|
|
749
|
+
line ? 'bad' : '',
|
|
750
|
+
snap.prefs.verbose || line ? '' : 'statsf',
|
|
751
|
+
]
|
|
752
|
+
.filter(Boolean)
|
|
753
|
+
.join(' '), "data-e2e": "recorder-detail", "aria-hidden": "true", children: snap.prefs.verbose ? (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "events" }), _jsx("dd", { children: detailRec.sync.events }), _jsx("dt", { children: "queue" }), _jsxs("dd", { children: [detailRec.sync.queued, detailRec.sync.chunks ? ` (${detailRec.sync.chunks} chunk${detailRec.sync.chunks === 1 ? '' : 's'})` : ''] }), _jsx("dt", { children: "last sync" }), _jsx("dd", { children: detailRec.sync.lastSyncAt === null ? '—' : `${fmtAgo(now - detailRec.sync.lastSyncAt)} · ${detailRec.sync.state}` }), _jsx("dt", { children: "server seq" }), _jsx("dd", { children: Math.max(0, detailRec.sync.serverMaxSeq) }), _jsx("dt", { children: "session" }), _jsx("dd", { children: detailRec.sessionId }), _jsx("dt", { children: "recorder" }), _jsx("dd", { children: snap.version })] }), line ? _jsx("div", { className: "warnline", children: line }) : null] })) : line ? (line) : (_jsx(Stats, { sync: detailRec.sync, now: now })) })) : null, hintP.mounted ? (_jsxs("div", { ref: hintRef, className: `float firstrun pop grow ${hintP.cls}`, role: "dialog", "aria-label": "Record this session", children: [_jsx("b", { children: "Record this session" }), _jsx("p", { children: "Clicks, pages, network and your notes go to a vitrinka board. Nothing is captured until you start." }), _jsxs("div", { className: "row2", children: [_jsx("button", { type: "button", className: "fb primary", onClick: () => {
|
|
754
|
+
markHinted();
|
|
755
|
+
onStart();
|
|
756
|
+
}, children: "Start" }), _jsx("button", { type: "button", className: "fb", onClick: markHinted, children: "Got it" })] })] })) : null, sheetEl && portal ? createPortal(sheetEl, portal.mount) : null, linkP.mounted && shownLink ? (_jsx("div", { ref: layerRef, className: layerCls, style: layer.style, children: _jsx(LinkSheet, { className: `${motionCls} ${linkP.cls}`, origin: layer.origin, phase: shownLink.phase, start: shownLink.flow?.start ?? null, error: shownLink.error, onRetry: beginLink, onClose: closeLink }) })) : null, _jsx("div", { className: "sr", role: "status", "aria-live": "polite", children: status })] }));
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* What an annotation points at (D9/D15): the host's crop of it when there
|
|
760
|
+
* is one (the extension), else just its size · route — never a made-up
|
|
761
|
+
* picture — and Reselect, which keeps the draft.
|
|
762
|
+
*/
|
|
763
|
+
function PickHead({ pick, crop, onReselect }) {
|
|
764
|
+
const what = pick.selector ? 'Element' : 'Region';
|
|
765
|
+
const size = `${Math.round(pick.rect.w)}×${Math.round(pick.rect.h)}`;
|
|
766
|
+
return (_jsxs("div", { className: crop ? 'selhead has-crop' : 'selhead', "data-e2e": "pick-head", children: [crop ? _jsx("img", { className: "selcrop", src: crop, alt: `The picked ${what.toLowerCase()}` }) : _jsx(AnnotateIcon, {}), _jsxs("span", { className: "selmeta", children: [_jsxs("b", { children: [what, " ", size] }), _jsx("span", { children: pick.selector || location.pathname })] }), _jsx("button", { type: "button", className: "fb", onClick: onReselect, children: "Reselect" })] }));
|
|
767
|
+
}
|
|
768
|
+
/** The notes a draft references (D7): ↳ chips, each removable. */
|
|
769
|
+
function RefChips({ refs, onRemove }) {
|
|
770
|
+
return (_jsx("ul", { className: "refs", "aria-label": "References", children: refs.map((r) => (_jsxs("li", { className: "ref", children: [_jsx(ReplyIcon, {}), _jsxs("span", { className: "t", children: ["re ", _jsxs("b", { children: ["\u2116", r.number] }), " \u00B7 ", r.text || '(no text)'] }), _jsx("button", { type: "button", "aria-label": `Remove the reference to №${r.number}`, onClick: () => onRemove(r.cid), children: _jsx(CloseIcon, {}) })] }, r.cid))) }));
|
|
596
771
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The notes sheet (recorder HUD polish D5/D12): this recording's notes and
|
|
3
|
+
* annotations in the board annotation island's anatomy, ported onto the
|
|
4
|
+
* HUD's tokens — a LIST face (№ · kind · age kicker, text, state dot; a
|
|
5
|
+
* filter; ← → ↑ ↓ walk, ↵ opens) and a SPLIT face (the № rail beside the
|
|
6
|
+
* open note: its versions, an edit box, ↳ reference). An edit is a new note
|
|
7
|
+
* that replaces the newest version (D6); a reference opens the note composer
|
|
8
|
+
* with the note as a ↳ chip (D7). Rows come from `noteRows` (notes-rows.ts).
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactElement } from 'react';
|
|
11
|
+
import { type NoteRow } from './notes-rows';
|
|
12
|
+
export interface NotesSheetProps {
|
|
13
|
+
/** Presence classes (`grow`/`rise` + `is-open`/`is-closing`). */
|
|
14
|
+
className: string;
|
|
15
|
+
origin: string;
|
|
16
|
+
rows: readonly NoteRow[];
|
|
17
|
+
now: number;
|
|
18
|
+
onEdit: (row: NoteRow, text: string) => void;
|
|
19
|
+
onReference: (row: NoteRow) => void;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function NotesSheet({ className, origin, rows, now, onEdit, onReference, onClose }: NotesSheetProps): ReactElement;
|
|
23
|
+
/** The notes sheet's CSS (appended to HUD_CSS): the island's grammar on the HUD's tokens. */
|
|
24
|
+
export declare const NOTES_CSS = "\n.pop.notes { width:min(calc(400px * var(--s)), calc(100vw - 24px)); padding:0 0 8px; overflow:hidden; }\n.pop.notes.split { width:min(calc(460px * var(--s)), calc(100vw - 24px)); }\n.notes .pop-head { height:44px; padding:0 8px 0 16px; }\n.n-title { font-weight:700; font-size:calc(var(--fs) + 2.5px); letter-spacing:-.02em; color:var(--fg); }\n.n-count, .n-kick { font:500 var(--fs-s)/1.4 ui-monospace, \"SF Mono\", Menlo, monospace; letter-spacing:.06em; text-transform:uppercase; color:var(--fg-3); }\n.n-count { margin-left:6px; }\n.n-head, .n-acts { display:flex; align-items:center; gap:6px; min-width:0; }\n.n-head .n-kick { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.n-word { all:unset; cursor:pointer; display:inline-flex; align-items:center; gap:4px; padding:5px 7px; border-radius:6px;\n font:500 var(--fs-s)/1 ui-monospace, \"SF Mono\", Menlo, monospace; letter-spacing:.06em; text-transform:uppercase; color:var(--fg-2); }\n.n-word:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; }\n@media (hover: hover) { .n-word:hover { color:var(--fg); background:var(--ink-2); } }\n.n-filter { display:flex; gap:4px; padding:0 12px 8px; }\n.n-filter button { all:unset; cursor:pointer; padding:4px 9px; border-radius:999px; font-size:calc(var(--fs) - .5px); font-weight:600; color:var(--fg-3); }\n.n-filter button[aria-pressed=\"true\"] { background:var(--ink-3); color:var(--fg); }\n.n-filter button:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; }\n.n-list { max-height:min(60vh, calc(360px * var(--s))); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }\n.n-row { position:relative; }\n.n-row + .n-row { border-top:1px solid rgba(255,255,255,.07); }\n.n-row.on::before { content:\"\"; position:absolute; left:6px; top:50%; width:4px; height:4px; margin-top:-2px; border-radius:9px; background:var(--rec); }\n.n-open { all:unset; box-sizing:border-box; cursor:pointer; width:100%; display:grid; grid-template-columns:calc(44px * var(--s)) minmax(0,1fr) 8px;\n gap:12px; align-items:center; padding:10px 16px; }\n.n-open:focus-visible { outline:2px solid var(--rec); outline-offset:-2px; border-radius:8px; }\n@media (hover: hover) { .n-open:hover { background:rgba(255,255,255,.04); } }\n.n-face { display:grid; place-items:center; height:calc(32px * var(--s)); border-radius:5px; background:rgba(0,0,0,.28);\n box-shadow:inset 0 0 0 1.5px rgba(255,59,87,.6); color:var(--rec); }\n.n-face.note { box-shadow:inset 0 0 0 1px var(--edge); color:var(--fg-3); }\n.n-lines { display:flex; flex-direction:column; gap:2px; min-width:0; }\n.n-text { color:var(--fg); font-size:calc(var(--fs) + .5px); line-height:1.35; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }\n.n-dot { width:7px; height:7px; border-radius:50%; }\n.n-dot.sent { background:var(--ok); }\n.n-dot.queued { background:var(--warn); }\n.n-dot.edited { background:#8fb8ff; }\n.n-empty { margin:4px 16px 8px; font-size:var(--fs-s); color:var(--fg-3); }\n.n-split { display:flex; min-height:0; }\n.n-rail { flex:0 0 calc(60px * var(--s)); display:flex; flex-direction:column; align-items:center; gap:7px; padding:4px 0 8px;\n border-right:1px solid rgba(255,255,255,.08); max-height:min(60vh, calc(380px * var(--s))); overflow-y:auto; scrollbar-width:none; }\n.n-th { all:unset; cursor:pointer; position:relative; display:grid; place-items:center; width:calc(40px * var(--s)); height:calc(30px * var(--s));\n border-radius:7px; background:rgba(0,0,0,.28); box-shadow:inset 0 0 0 1px var(--edge); color:var(--fg-3); opacity:.7; }\n.n-th b { position:absolute; left:4px; bottom:2px; font:600 9px/1 ui-monospace, Menlo, monospace; color:var(--fg-2); }\n.n-th.on { opacity:1; box-shadow:0 0 0 2px var(--rec); color:var(--fg); }\n.n-th:focus-visible { outline:2px solid var(--rec); outline-offset:2px; }\n.n-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; padding:4px 14px 4px;\n max-height:min(60vh, calc(380px * var(--s))); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }\n.n-meta { font-size:var(--fs-s); color:var(--fg-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.n-ver { padding:8px 10px; border-radius:9px; background:rgba(0,0,0,.22); box-shadow:inset 0 0 0 1px var(--edge);\n font-size:calc(var(--fs) + .5px); line-height:1.4; color:var(--fg); white-space:pre-wrap; overflow-wrap:anywhere; }\n.n-ver .n-kick { display:block; margin-bottom:3px; }\n.n-ver.old { color:var(--fg-3); text-decoration:line-through; text-decoration-color:rgba(244,239,234,.25); }\n.n-ver.old .n-kick { text-decoration:none; }\ntextarea.n-edit { margin-top:0; min-height:calc(44px * var(--s)); resize:vertical; overflow-y:auto; }\n.n-body .row { margin-top:0; }\n";
|