@vitrinka/web 0.1.5 → 0.2.1
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 +63 -0
- package/README.md +73 -21
- package/build/hud.d.ts +9 -0
- package/build/hud.iife.js +411 -0
- package/build/hud.js +8 -0
- package/build/recorder/api.d.ts +2 -0
- package/build/recorder/block.d.ts +7 -0
- package/build/recorder/block.js +7 -0
- package/build/recorder/capture/click.d.ts +2 -4
- package/build/recorder/capture/click.js +2 -31
- package/build/recorder/capture/rrweb.d.ts +2 -2
- package/build/recorder/capture/rrweb.js +2 -2
- package/build/recorder/capture/selector.d.ts +8 -0
- package/build/recorder/capture/selector.js +35 -0
- package/build/recorder/hud/AnnotateOverlay.d.ts +7 -1
- package/build/recorder/hud/AnnotateOverlay.js +58 -28
- package/build/recorder/hud/Hud.d.ts +16 -1
- package/build/recorder/hud/Hud.js +255 -87
- package/build/recorder/hud/LinkSheet.d.ts +3 -3
- package/build/recorder/hud/LinkSheet.js +1 -1
- package/build/recorder/hud/Menu.d.ts +30 -0
- package/build/recorder/hud/Menu.js +73 -0
- package/build/recorder/hud/RecorderPill.d.ts +36 -27
- package/build/recorder/hud/RecorderPill.js +212 -123
- package/build/recorder/hud/Sheet.d.ts +1 -1
- package/build/recorder/hud/Sheet.js +1 -1
- package/build/recorder/hud/Tooltip.d.ts +19 -0
- package/build/recorder/hud/Tooltip.js +94 -0
- package/build/recorder/hud/controller.d.ts +148 -0
- package/build/recorder/hud/controller.js +17 -0
- package/build/recorder/hud/flow.d.ts +54 -0
- package/build/recorder/hud/flow.js +39 -0
- package/build/recorder/hud/host.js +1 -1
- package/build/recorder/hud/icons.d.ts +7 -0
- package/build/recorder/hud/icons.js +19 -0
- package/build/recorder/hud/iife.d.ts +13 -0
- package/build/recorder/hud/iife.js +11 -0
- package/build/recorder/hud/layer.d.ts +29 -6
- package/build/recorder/hud/layer.js +67 -33
- package/build/recorder/hud/listen.d.ts +24 -0
- package/build/recorder/hud/listen.js +27 -0
- package/build/recorder/hud/mount.d.ts +13 -0
- package/build/recorder/hud/mount.js +27 -0
- package/build/recorder/hud/place.d.ts +43 -0
- package/build/recorder/hud/place.js +63 -0
- package/build/recorder/hud/spots.d.ts +45 -0
- package/build/recorder/hud/spots.js +107 -0
- package/build/recorder/hud/status.d.ts +31 -0
- package/build/recorder/hud/status.js +67 -0
- package/build/recorder/hud/styles.d.ts +28 -18
- package/build/recorder/hud/styles.js +295 -122
- package/build/recorder/hud/useDock.d.ts +9 -8
- package/build/recorder/hud/useDock.js +43 -22
- package/build/recorder/index.d.ts +2 -2
- package/build/recorder/index.js +9 -18
- package/build/recorder/link.d.ts +1 -1
- package/build/recorder/link.js +9 -3
- package/build/recorder/me.d.ts +34 -0
- package/build/recorder/me.js +172 -0
- package/build/recorder/page-controller.d.ts +12 -0
- package/build/recorder/page-controller.js +100 -0
- package/build/recorder/queue.d.ts +4 -0
- package/build/recorder/queue.js +2 -0
- package/build/recorder/recents.d.ts +23 -0
- package/build/recorder/recents.js +80 -0
- package/build/recorder/session.d.ts +2 -2
- package/build/recorder/session.js +15 -1
- package/build/recorder/storage/index.js +2 -1
- package/package.json +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# @vitrinka/web
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
- **Linking survives a flaky network.** One failed approval check (a
|
|
6
|
+
dropped connection, an edge error page, a 5xx or a 429) used to end the
|
|
7
|
+
link with "Failed to fetch · Try again", even though the code was still
|
|
8
|
+
valid. Now the pill keeps waiting: it retries with a growing pause (up to
|
|
9
|
+
30s) until the code itself expires. Only an expired code, a token for
|
|
10
|
+
another workspace or Cancel ends it. Needs `@vitrinka/link` 0.1.3.
|
|
11
|
+
- **No more passive-listener errors on Angular hosts.** On a page that runs
|
|
12
|
+
zone.js (any Angular app), Esc in the menu, the note sheet or annotate
|
|
13
|
+
mode logged "Unable to preventDefault inside passive event listener
|
|
14
|
+
invocation", and the browser went ahead with the default anyway. zone.js
|
|
15
|
+
runs every listener of a kind through the first one registered, and
|
|
16
|
+
Angular CDK registers its keydown, mousedown and touchstart listeners as
|
|
17
|
+
passive. The HUD now registers every listener that cancels an event
|
|
18
|
+
directly with the browser, never passive.
|
|
19
|
+
|
|
20
|
+
## 0.2.0
|
|
21
|
+
|
|
22
|
+
- **Stop is in the pill.** A ■ next to the other tools. It asks inline
|
|
23
|
+
("Stop & save? Stop · Keep recording"; Esc or Keep cancels). Then the pill
|
|
24
|
+
says **Saving…**, with a spinner and a progress bar while the tail drains.
|
|
25
|
+
Then it says **Saved · Open board**, with the server's board link. That
|
|
26
|
+
stays until you dismiss it. If the server cannot be reached, the pill says
|
|
27
|
+
so and offers **Retry**. Nothing is lost. Unlink asks the same way.
|
|
28
|
+
- **Recents and the account.** The ⋯ menu (now on the idle puck too) names
|
|
29
|
+
who the recorder is linked as: `you@… · Workspace`, or `Recorder key ·
|
|
30
|
+
<name> · project <p>` for a key build. It lists the device's last five
|
|
31
|
+
recordings, with age, length, status and a link to each board. It has
|
|
32
|
+
**Go to vitrinka**. A recent without a board link is refreshed from the
|
|
33
|
+
session's own read.
|
|
34
|
+
- **Eight spots, and a vertical pill.** Move to is a miniature screen with
|
|
35
|
+
eight spots: a 3×3 grid without the centre. At middle left and middle
|
|
36
|
+
right, the recording pill stands up and becomes vertical. Its menu,
|
|
37
|
+
tooltips and sheets open sideways. A pushed-away tab comes back to the
|
|
38
|
+
nearest third of its edge.
|
|
39
|
+
- **Tooltips never clip.** There is one tooltip, and it shows the shortcut.
|
|
40
|
+
It is placed inside the viewport, flipping and shifting as needed from
|
|
41
|
+
every spot. Menus, sheets and the details card follow the same placement.
|
|
42
|
+
- **A sync chip you can read.** `synced`, `sending N`, `offline · N` or
|
|
43
|
+
`ended`, with an icon and a colour for each, and no hover needed. A routine
|
|
44
|
+
2s flush does not flicker it.
|
|
45
|
+
- **Size and technical details.** S · M · L scales the whole HUD. Technical
|
|
46
|
+
details shows events, queue and chunks, last sync, server seq, session id
|
|
47
|
+
and recorder version. Both are user prefs (`GET`/`PATCH
|
|
48
|
+
/api/v1/recorder/me`) and are cached on the device. They stay on the
|
|
49
|
+
device for key builds, servers without the route, and offline.
|
|
50
|
+
- **"Saved" on the pill** for a moment after a note or annotation.
|
|
51
|
+
- **Annotate does not touch the page.** A drag over text no longer selects
|
|
52
|
+
it. Presses, moves and hovers no longer reach the app. The crosshair is
|
|
53
|
+
set by a blocked stylesheet, so the page's `<html>` is never restyled.
|
|
54
|
+
- The record dot's ripple is drawn outside layout, so the dot and the clock
|
|
55
|
+
are spaced evenly.
|
|
56
|
+
- **The HUD is a seam.** `@vitrinka/web/hud` exports
|
|
57
|
+
`mountRecorderHud(controller, opts)` and the `HudController` contract. The
|
|
58
|
+
in-page recorder is one implementation of it. `build/hud.iife.js`
|
|
59
|
+
(`@vitrinka/web/hud.iife.js`) is the same mount as one self-contained
|
|
60
|
+
script with React bundled in. It defines `globalThis.VitrinkaHud.mount`.
|
|
61
|
+
- The HUD's surfaces stay out of the recording. The rrweb-blocked host is
|
|
62
|
+
0×0. rrweb 2 cannot drop a blocked node entirely, so it leaves an empty,
|
|
63
|
+
zero-size placeholder. Clicks, the recorder's own requests and `vitrinka:`
|
|
64
|
+
logs are not captured.
|
|
65
|
+
|
|
3
66
|
## 0.1.5
|
|
4
67
|
|
|
5
68
|
- **A `project` prop.** `VitrinkaRecorderRoot` takes `project`. A
|
package/README.md
CHANGED
|
@@ -118,31 +118,45 @@ returned unchanged otherwise.
|
|
|
118
118
|
|
|
119
119
|
Idle, the HUD is a 28px glass puck: a hollow ring until the device is linked
|
|
120
120
|
(**Link recorder**), a muted dot once it is (**Start recording** — the session
|
|
121
|
-
title is `document.title`, or the `title` prop); the label
|
|
122
|
-
or focus. Recording, it rests as a dot + timer capsule (**Recorder
|
|
123
|
-
that unfolds into the tools on hover, focus or tap and folds back
|
|
124
|
-
you leave (
|
|
121
|
+
title is `document.title`, or the `title` prop); the label and a ⋯ slide out
|
|
122
|
+
on hover or focus. Recording, it rests as a dot + timer capsule (**Recorder
|
|
123
|
+
controls**) that unfolds into the tools on hover, focus or tap and folds back
|
|
124
|
+
2.5s after you leave (a tooltip names each tool and its shortcut):
|
|
125
125
|
|
|
126
126
|
| Control | Shortcut | What |
|
|
127
127
|
|---|---|---|
|
|
128
|
+
| sync chip | | `synced` · `sending N` · `offline · N` · `ended` — readable without hovering |
|
|
128
129
|
| ⏸ Pause / ▶ Resume | ⌥⇧P (Alt⇧P) | freezes the clock and capture |
|
|
129
|
-
| ✎ Note | ⌥⇧N | the note sheet — Enter sends, ⇧Enter newline, Esc / ✕ / click-outside cancel (the draft survives a cancel) |
|
|
130
|
-
| ⌖ Annotate | ⌥⇧A | click or tap an element, or drag a region (a finger too
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
130
|
+
| ✎ Note | ⌥⇧N | the note sheet — Enter sends, ⇧Enter newline, Esc / ✕ / click-outside cancel (the draft survives a cancel); the pill says **Saved** |
|
|
131
|
+
| ⌖ Annotate | ⌥⇧A | click or tap an element, or drag a region (a finger too). While annotating, the page gets no press, move or hover, does not scroll, and selects no text. Then describe it: `board` (an annotation on the board) or `task` (also filed as an intake draft) |
|
|
132
|
+
| ■ Stop | ⌥⇧S | the pill asks **Stop & save?** (Esc / **Keep recording** cancels), shows **Saving…** with progress while the tail drains, then **Saved · Open board** until you dismiss it |
|
|
133
|
+
| ⋯ | | the linked account · **Open this board** · **Recent** (this device's last five recordings, each linked to its board) · **Go to vitrinka** · **Size** S/M/L · **Technical details** · **Position** · **Unlink this device** (asks first) |
|
|
134
|
+
|
|
135
|
+
Move it anywhere: drag the puck or capsule and it lands on one of eight
|
|
136
|
+
spots (a 3×3 grid without the centre). A flick lands where it is thrown.
|
|
137
|
+
Push it past a side edge and it tucks into a 6px tab (**Show recorder**
|
|
138
|
+
brings it back). At middle left and middle right the recording pill stands
|
|
139
|
+
up into a vertical bar. Arrow keys on the focused handle and **Position** do
|
|
140
|
+
the same without a drag; the spot is remembered per site. Tooltips, the
|
|
141
|
+
menu and sheets (≤ 288px at M) open toward the middle of the page from
|
|
142
|
+
wherever the HUD sits: sideways from a vertical one. They flip and shift so
|
|
143
|
+
they never leave the viewport. On a phone, sheets are a bottom sheet above
|
|
144
|
+
the keyboard and the link sheet drops the QR.
|
|
145
|
+
|
|
146
|
+
The sync chip is honest: `synced` means the server confirmed it holds
|
|
147
|
+
everything captured. A backlog reads `sending N`. An outage reads
|
|
148
|
+
`offline · N` (nothing is dropped; the tail is kept in `localStorage`). A
|
|
149
|
+
session the server closed reads `ended`. A one-line detail also unfolds for
|
|
150
|
+
an outage or an ended session. Stop drains first and refuses while the server
|
|
151
|
+
is unreachable: the pill says so and offers **Retry**.
|
|
152
|
+
|
|
153
|
+
**Size** and **Technical details** are user preferences. For a linked device
|
|
154
|
+
they are stored in vitrinka (`GET`/`PATCH /api/v1/recorder/me`), so they follow
|
|
155
|
+
the user, and are cached on the device for an instant first paint and for
|
|
156
|
+
offline use. A key build, or a server without the route, keeps them on the
|
|
157
|
+
device only. Technical details shows events captured, queue and pending
|
|
158
|
+
chunks, the last sync and its state, the server's seq, the session id and
|
|
159
|
+
the recorder version.
|
|
146
160
|
|
|
147
161
|
The sheet renders inside the topmost open dialog when one exists, so a
|
|
148
162
|
Radix focus trap or a `<dialog>.showModal()` never fights it, and nothing
|
|
@@ -160,6 +174,38 @@ const { boardUrl } = await __vitrinkaRecorder.stop();
|
|
|
160
174
|
__vitrinkaRecorder.status(); // { recording, sessionId, elapsedMs, queued, synced, … }
|
|
161
175
|
```
|
|
162
176
|
|
|
177
|
+
## The HUD on its own (`@vitrinka/web/hud`)
|
|
178
|
+
|
|
179
|
+
The HUD is driven only through a `HudController`. The in-page recorder is one
|
|
180
|
+
implementation; another host (the browser extension) mounts the same HUD with
|
|
181
|
+
its own:
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
import { mountRecorderHud, type HudController } from '@vitrinka/web/hud';
|
|
185
|
+
|
|
186
|
+
const unmount = mountRecorderHud(controller, { title: () => document.title });
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
`HudController` is a snapshot plus actions:
|
|
190
|
+
|
|
191
|
+
- `getSnapshot()` returns the same object until something changes;
|
|
192
|
+
`subscribe(fn)` calls back after a change. The snapshot holds `linked`,
|
|
193
|
+
`canUnlink`, `annotating`, `recording` (session, clock, sync), `account`,
|
|
194
|
+
`prefs`, `recents`, `workspaceUrl` and `version`.
|
|
195
|
+
- Actions: `start`, `togglePause`, `stop` (resolves `{boardUrl?}`, rejects
|
|
196
|
+
while the server is unreachable), `note`, `annotate`, `setAnnotating`,
|
|
197
|
+
`link`, `unlink`, `getMe`, `setPrefs` and `refreshRecents`.
|
|
198
|
+
|
|
199
|
+
The full contract is in `src/recorder/hud/controller.ts`.
|
|
200
|
+
|
|
201
|
+
Without a bundler, `@vitrinka/web/hud.iife.js` (`build/hud.iife.js`) is the
|
|
202
|
+
same mount as one self-contained script with React bundled in:
|
|
203
|
+
|
|
204
|
+
```html
|
|
205
|
+
<script src="hud.iife.js"></script>
|
|
206
|
+
<script>const unmount = VitrinkaHud.mount(controller);</script>
|
|
207
|
+
```
|
|
208
|
+
|
|
163
209
|
## What is captured, exactly
|
|
164
210
|
|
|
165
211
|
| Lane | Event `kind` | Payload |
|
|
@@ -174,6 +220,12 @@ __vitrinkaRecorder.status(); // { recording, sessionId, elapsedMs, queued, synce
|
|
|
174
220
|
Data goes to your vitrinka server only. Details, the redaction rules and the
|
|
175
221
|
policy fetch: [`docs/PROTOCOL.md`](../../docs/PROTOCOL.md).
|
|
176
222
|
|
|
223
|
+
The HUD itself never enters a recording. Every surface sits under one 0×0
|
|
224
|
+
shadow host carrying rrweb's block attribute. rrweb 2 always leaves a
|
|
225
|
+
placeholder for a blocked node; this one is empty, so the replay shows no
|
|
226
|
+
box. The HUD's clicks, its requests to your server and its `vitrinka:` logs
|
|
227
|
+
are not captured.
|
|
228
|
+
|
|
177
229
|
## Storage
|
|
178
230
|
|
|
179
231
|
The undelivered tail lives in `localStorage` (a recording survives a reload
|
package/build/hud.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@vitrinka/web/hud` — the recorder HUD on its own, for hosts that bring
|
|
3
|
+
* their own recorder (the browser extension). Implement `HudController` and
|
|
4
|
+
* mount it; `build/hud.iife.js` is the same mount as a self-contained script
|
|
5
|
+
* defining `globalThis.VitrinkaHud.mount`.
|
|
6
|
+
*/
|
|
7
|
+
export { mountRecorderHud, type MountHudOptions } from './recorder/hud/mount';
|
|
8
|
+
export { DEFAULT_PREFS, type HudAccount, type HudAnnotation, type HudController, type HudLinkCode, type HudLinkFlow, type HudPrefs, type HudRecent, type HudRecentStatus, type HudRecording, type HudRect, type HudSize, type HudSnapshot, type HudSync, type HudSyncState, } from './recorder/hud/controller';
|
|
9
|
+
export type { RecorderStorage } from './recorder/storage';
|