@vitrinka/web 0.5.3 → 0.7.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 +113 -0
- package/README.md +145 -20
- package/build/hud.iife.js +150 -28
- package/build/index.d.ts +1 -0
- package/build/protocol/index.d.ts +10 -0
- package/build/recorder/RecorderProvider.js +5 -18
- package/build/recorder/api.d.ts +20 -0
- package/build/recorder/api.js +21 -9
- package/build/recorder/capture/console.d.ts +6 -1
- package/build/recorder/capture/console.js +28 -5
- package/build/recorder/capture/net.d.ts +10 -1
- package/build/recorder/capture/net.js +14 -1
- package/build/recorder/capture/redact.d.ts +1 -0
- package/build/recorder/capture/redact.js +6 -1
- package/build/recorder/capture/rrweb-lane.d.ts +19 -0
- package/build/recorder/capture/rrweb-lane.js +109 -0
- package/build/recorder/capture/rrweb.d.ts +2 -9
- package/build/recorder/capture/rrweb.js +11 -86
- package/build/recorder/config.d.ts +3 -1
- package/build/recorder/config.js +15 -2
- package/build/recorder/flight.d.ts +141 -22
- package/build/recorder/flight.js +312 -27
- 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/host-style.d.ts +14 -0
- package/build/recorder/hud/host-style.js +15 -0
- package/build/recorder/hud/host.js +1 -1
- 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 +2 -30
- package/build/recorder/hud/styles.js +63 -31
- 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/session.d.ts +25 -6
- package/build/recorder/session.js +50 -8
- package/build/recorder/state.d.ts +18 -1
- package/build/recorder/state.js +40 -1
- package/build/recorder/storage/capture.d.ts +44 -0
- package/build/recorder/storage/capture.js +136 -0
- package/build/recorder/version.d.ts +2 -2
- package/build/recorder/version.js +1 -1
- package/build/report/bundle.d.ts +4 -0
- package/build/report/bundle.js +30 -0
- package/build/report/element.d.ts +86 -0
- package/build/report/element.js +146 -0
- package/build/report/engine.d.ts +144 -0
- package/build/report/engine.js +402 -0
- package/build/report/i18n.d.ts +78 -0
- package/build/report/i18n.js +151 -0
- package/build/report/identity.d.ts +26 -0
- package/build/report/identity.js +36 -0
- package/build/report/index.d.ts +12 -0
- package/build/report/index.js +15 -0
- package/build/report/keybind.d.ts +29 -0
- package/build/report/keybind.js +99 -0
- package/build/report/markers.d.ts +77 -0
- package/build/report/markers.js +162 -0
- package/build/report/profile.d.ts +62 -0
- package/build/report/profile.js +115 -0
- package/build/report/recorder-face.d.ts +2 -0
- package/build/report/recorder-face.js +20 -0
- package/build/report/styles.d.ts +7 -0
- package/build/report/styles.js +226 -0
- package/build/report/widget.d.ts +109 -0
- package/build/report/widget.js +907 -0
- package/build/report/wire.d.ts +68 -0
- package/build/report/wire.js +96 -0
- package/build/report-widget.mjs +229 -0
- package/package.json +11 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report a problem's stylesheet — it lives in the widget's shadow root (the
|
|
3
|
+
* shared HUD host), so the page restyles nothing of it and it styles nothing
|
|
4
|
+
* of the page. A dark card on any page (the D12 / D21 mockups): one accent
|
|
5
|
+
* red for the act of sending and marking, everything else quiet.
|
|
6
|
+
*/
|
|
7
|
+
export declare const REPORT_CSS = "\n:host { all: initial; }\n.vr {\n --ink: #f2f1ef;\n --dim: rgba(242, 241, 239, .62);\n --faint: rgba(242, 241, 239, .14);\n --bg: #1a191d;\n --bg-deep: #121115;\n --accent: #dc2f4c;\n --accent-soft: rgba(220, 47, 76, .28);\n font: 400 14px/1.45 -apple-system, BlinkMacSystemFont, \"Segoe UI\", Inter, Roboto, \"Helvetica Neue\", Arial, sans-serif;\n color: var(--ink);\n -webkit-font-smoothing: antialiased;\n letter-spacing: normal;\n text-align: left;\n}\n.vr *, .vr *::before, .vr *::after { box-sizing: border-box; }\n.vr [hidden] { display: none !important; }\nbutton { font: inherit; color: inherit; cursor: pointer; }\nbutton:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {\n outline: 2px solid #fff; outline-offset: 2px;\n}\n\n/* -- the floating button -------------------------------------------------- */\n.fab {\n position: fixed; right: 24px; bottom: 24px;\n display: inline-flex; align-items: center; gap: 12px;\n padding: 15px 22px; border: 0; border-radius: 999px;\n background: #131216; color: #fff;\n font-size: 17px; font-weight: 600; letter-spacing: -.005em;\n box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255, 255, 255, .08) inset;\n pointer-events: auto;\n transition: transform .14s ease, box-shadow .14s ease;\n}\n.fab:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(0, 0, 0, .32), 0 0 0 1px rgba(255, 255, 255, .12) inset; }\n.fab:active { transform: translateY(0); }\nkbd {\n font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n padding: 4px 7px; border-radius: 7px;\n border: 1px solid rgba(255, 255, 255, .26); color: rgba(255, 255, 255, .78);\n}\n\n/* -- the card --------------------------------------------------------------- */\n.card {\n position: fixed; right: 24px; bottom: 96px;\n width: min(420px, calc(100vw - 32px));\n max-height: calc(100vh - 120px); overflow: auto;\n background: var(--bg); color: var(--ink);\n border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px;\n box-shadow: 0 28px 70px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .2);\n pointer-events: auto;\n animation: vr-in .16s ease-out;\n}\n.vr.nobutton .card { bottom: 24px; }\n@keyframes vr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }\n.head {\n display: flex; align-items: center; gap: 4px;\n padding: 16px 14px 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, .07);\n}\n.head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }\n.icon {\n display: inline-grid; place-items: center; width: 32px; height: 32px;\n border: 0; border-radius: 8px; background: transparent; color: var(--dim);\n}\n.icon:hover { background: var(--faint); color: var(--ink); }\n.icon svg { width: 16px; height: 16px; }\n.pane { padding: 18px 20px 20px; }\n.prompt { display: block; margin: 0 0 8px; font-weight: 600; font-size: 14px; }\n.desc {\n display: block; width: 100%; min-height: 88px; resize: vertical;\n padding: 12px 14px; border-radius: 10px;\n border: 1px solid rgba(255, 255, 255, .2); background: var(--bg-deep); color: var(--ink);\n font-family: inherit; font-size: 15px; font-weight: 400; line-height: 1.45;\n}\n.desc::placeholder { color: rgba(242, 241, 239, .38); }\n.desc:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }\n.attached { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; color: var(--dim); font-size: 13px; }\n.attached svg { width: 14px; height: 14px; flex: none; }\n.link {\n display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none;\n color: rgba(242, 241, 239, .86); font-weight: 600; font-size: 13px;\n}\n.link:hover { color: #fff; text-decoration: underline; }\n.link svg { width: 12px; height: 12px; transition: transform .14s ease; }\n.link[aria-expanded=\"true\"] svg { transform: rotate(180deg); }\n.included { margin: 10px 0 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--bg-deep); color: var(--dim); font-size: 13px; }\n.included li { margin: 2px 0; }\n.marked { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--dim); }\n.chip {\n display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;\n border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;\n}\n.chip.hide { background: #3a3940; }\n.notify { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink); cursor: pointer; }\n.notify input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }\n.error { margin: 12px 0 0; color: #ff9aa9; font-size: 13px; }\n.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }\n.where {\n display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px;\n border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: var(--ink);\n font-size: 13px; font-weight: 600;\n}\n.where:hover:not(:disabled) { background: var(--faint); }\n.where svg { width: 14px; height: 14px; }\n.where:disabled { opacity: .45; cursor: default; }\n.send {\n padding: 10px 22px; border: 0; border-radius: 10px; background: var(--accent); color: #fff;\n font-size: 15px; font-weight: 650;\n}\n.send:hover:not(:disabled) { background: #e43a57; }\n.send:disabled { opacity: .45; cursor: default; }\n\n/* -- settings --------------------------------------------------------------- */\n.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.row .label { font-weight: 600; }\n.bind {\n min-width: 120px; padding: 8px 12px; border-radius: 9px; text-align: center;\n border: 1px solid rgba(255, 255, 255, .2); background: var(--bg-deep);\n font: 500 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n.bind[aria-pressed=\"true\"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--dim); }\n.hint, .reason { margin: 10px 0 0; color: var(--dim); font-size: 13px; }\n.reason { color: #ffc1ca; }\n.settings-foot { display: flex; justify-content: space-between; margin-top: 16px; }\n\n/* -- sent ------------------------------------------------------------------- */\n.sent-head { display: flex; align-items: center; gap: 10px; }\n.sent-head h3 { margin: 0; font-size: 17px; font-weight: 650; }\n.sent-head svg { width: 22px; height: 22px; color: #4ade80; flex: none; }\n.sent-body { margin: 8px 0 0 32px; color: var(--dim); }\n.sent-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 0 32px; }\n.see {\n display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 9px;\n background: #fff; color: #131216; font-weight: 650; font-size: 13px; text-decoration: none;\n}\n\n/* -- marking: the frozen page ---------------------------------------------- */\n.mark {\n position: fixed; inset: 0; pointer-events: auto;\n background: rgba(14, 13, 16, .16); cursor: crosshair;\n touch-action: none; user-select: none; -webkit-user-select: none;\n}\n.ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }\n.ink .stroke { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }\n.ink .veil { fill: #1b1b1f; }\n.ink .veil-label { fill: rgba(255, 255, 255, .7); font: 600 12px -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif; }\n.ink .draft { opacity: .85; }\n.pin { position: absolute; display: flex; align-items: center; gap: 6px; cursor: default; }\n.pin .num {\n display: grid; place-items: center; width: 24px; height: 24px; border-radius: 12px;\n background: var(--accent); color: #fff; font-size: 12px; font-weight: 750;\n box-shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 0 0 2px #fff;\n}\n.pin .note {\n width: 220px; padding: 6px 10px; border-radius: 9px;\n border: 1px solid rgba(255, 255, 255, .16); background: #151417; color: #fff;\n font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1.3;\n box-shadow: 0 6px 18px rgba(0, 0, 0, .3);\n}\n.pin .note::placeholder { color: rgba(255, 255, 255, .45); }\n.pin .note:focus { outline: none; border-color: var(--accent); }\n.pin .rm {\n display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 12px;\n background: #151417; color: rgba(255, 255, 255, .7); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);\n}\n.pin .rm:hover { color: #fff; }\n.pin .rm svg { width: 12px; height: 12px; }\n.toolbar {\n position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);\n display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 15px;\n background: #151417; box-shadow: 0 16px 40px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .08) inset;\n cursor: default;\n}\n.toolbar button {\n padding: 9px 15px; border: 0; border-radius: 10px; background: transparent; color: #f2f1ef;\n font-size: 15px; font-weight: 600;\n}\n.toolbar button:hover { background: rgba(255, 255, 255, .08); }\n.toolbar button[aria-pressed=\"true\"] { background: #e6455f; color: #fff; }\n.toolbar .sep { width: 1px; height: 22px; margin: 0 4px; background: rgba(255, 255, 255, .14); }\n.toolbar .done { background: var(--accent); color: #fff; }\n.toolbar .done:hover { background: #e43a57; }\n.toolbar button:disabled { opacity: .4; cursor: default; background: transparent; }\n\n/* -- the coach card (D21): stays beside the pointer until mark 1 exists --- */\n.coach {\n position: fixed; width: 300px; padding: 14px 16px 15px;\n background: #151417; color: #f2f1ef; border-radius: 14px;\n box-shadow: 0 18px 44px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .1) inset;\n pointer-events: none;\n transition: opacity .12s ease;\n}\n.coach.pressing { opacity: .55; }\n.coach svg { display: block; width: 100%; height: 64px; border-radius: 9px; background: #222126; }\n.coach p { margin: 11px 0 0; font-size: 15px; line-height: 1.4; }\n.coach p + p { margin-top: 2px; color: rgba(242, 241, 239, .66); font-size: 13px; }\n.coach p.keys { margin-top: 8px; font-size: 12px; color: rgba(242, 241, 239, .5); }\n.mark:focus { outline: none; }\n.mark:focus-visible { outline: 3px solid rgba(230, 69, 95, .65); outline-offset: -3px; }\n.coach .bar { fill: #5b5a61; }\n.coach .loop { fill: none; stroke: #e6455f; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200; animation: vr-draw 2.8s ease-in-out infinite; }\n.coach .hold { fill: none; stroke: #fff; stroke-width: 1.5; opacity: 0; animation: vr-hold 2.8s ease-in-out infinite; }\n@keyframes vr-draw { 0%, 18% { stroke-dashoffset: 200; } 72%, 100% { stroke-dashoffset: 0; } 90% { opacity: 1; } 100% { opacity: 0; } }\n@keyframes vr-hold { 0%, 8% { opacity: 0; } 14%, 72% { opacity: .9; } 80%, 100% { opacity: 0; } }\n\n@media (max-width: 520px) {\n .fab { right: 16px; bottom: 16px; padding: 13px 18px; font-size: 16px; }\n .card { right: 16px; bottom: 84px; }\n .vr.nobutton .card { bottom: 16px; }\n .toolbar { bottom: 16px; max-width: calc(100vw - 24px); overflow-x: auto; }\n .toolbar button { padding: 8px 11px; font-size: 14px; }\n .coach { width: 260px; }\n}\n@media (prefers-reduced-motion: reduce) {\n .card { animation: none; }\n .fab { transition: none; }\n .coach .loop { animation: none; stroke-dashoffset: 0; }\n .coach .hold { animation: none; opacity: .9; }\n}\n";
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report a problem's stylesheet — it lives in the widget's shadow root (the
|
|
3
|
+
* shared HUD host), so the page restyles nothing of it and it styles nothing
|
|
4
|
+
* of the page. A dark card on any page (the D12 / D21 mockups): one accent
|
|
5
|
+
* red for the act of sending and marking, everything else quiet.
|
|
6
|
+
*/
|
|
7
|
+
export const REPORT_CSS = `
|
|
8
|
+
:host { all: initial; }
|
|
9
|
+
.vr {
|
|
10
|
+
--ink: #f2f1ef;
|
|
11
|
+
--dim: rgba(242, 241, 239, .62);
|
|
12
|
+
--faint: rgba(242, 241, 239, .14);
|
|
13
|
+
--bg: #1a191d;
|
|
14
|
+
--bg-deep: #121115;
|
|
15
|
+
--accent: #dc2f4c;
|
|
16
|
+
--accent-soft: rgba(220, 47, 76, .28);
|
|
17
|
+
font: 400 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
18
|
+
color: var(--ink);
|
|
19
|
+
-webkit-font-smoothing: antialiased;
|
|
20
|
+
letter-spacing: normal;
|
|
21
|
+
text-align: left;
|
|
22
|
+
}
|
|
23
|
+
.vr *, .vr *::before, .vr *::after { box-sizing: border-box; }
|
|
24
|
+
.vr [hidden] { display: none !important; }
|
|
25
|
+
button { font: inherit; color: inherit; cursor: pointer; }
|
|
26
|
+
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
|
|
27
|
+
outline: 2px solid #fff; outline-offset: 2px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* -- the floating button -------------------------------------------------- */
|
|
31
|
+
.fab {
|
|
32
|
+
position: fixed; right: 24px; bottom: 24px;
|
|
33
|
+
display: inline-flex; align-items: center; gap: 12px;
|
|
34
|
+
padding: 15px 22px; border: 0; border-radius: 999px;
|
|
35
|
+
background: #131216; color: #fff;
|
|
36
|
+
font-size: 17px; font-weight: 600; letter-spacing: -.005em;
|
|
37
|
+
box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 0 0 1px rgba(255, 255, 255, .08) inset;
|
|
38
|
+
pointer-events: auto;
|
|
39
|
+
transition: transform .14s ease, box-shadow .14s ease;
|
|
40
|
+
}
|
|
41
|
+
.fab:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(0, 0, 0, .32), 0 0 0 1px rgba(255, 255, 255, .12) inset; }
|
|
42
|
+
.fab:active { transform: translateY(0); }
|
|
43
|
+
kbd {
|
|
44
|
+
font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
45
|
+
padding: 4px 7px; border-radius: 7px;
|
|
46
|
+
border: 1px solid rgba(255, 255, 255, .26); color: rgba(255, 255, 255, .78);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* -- the card --------------------------------------------------------------- */
|
|
50
|
+
.card {
|
|
51
|
+
position: fixed; right: 24px; bottom: 96px;
|
|
52
|
+
width: min(420px, calc(100vw - 32px));
|
|
53
|
+
max-height: calc(100vh - 120px); overflow: auto;
|
|
54
|
+
background: var(--bg); color: var(--ink);
|
|
55
|
+
border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px;
|
|
56
|
+
box-shadow: 0 28px 70px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .2);
|
|
57
|
+
pointer-events: auto;
|
|
58
|
+
animation: vr-in .16s ease-out;
|
|
59
|
+
}
|
|
60
|
+
.vr.nobutton .card { bottom: 24px; }
|
|
61
|
+
@keyframes vr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
|
|
62
|
+
.head {
|
|
63
|
+
display: flex; align-items: center; gap: 4px;
|
|
64
|
+
padding: 16px 14px 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, .07);
|
|
65
|
+
}
|
|
66
|
+
.head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
|
|
67
|
+
.icon {
|
|
68
|
+
display: inline-grid; place-items: center; width: 32px; height: 32px;
|
|
69
|
+
border: 0; border-radius: 8px; background: transparent; color: var(--dim);
|
|
70
|
+
}
|
|
71
|
+
.icon:hover { background: var(--faint); color: var(--ink); }
|
|
72
|
+
.icon svg { width: 16px; height: 16px; }
|
|
73
|
+
.pane { padding: 18px 20px 20px; }
|
|
74
|
+
.prompt { display: block; margin: 0 0 8px; font-weight: 600; font-size: 14px; }
|
|
75
|
+
.desc {
|
|
76
|
+
display: block; width: 100%; min-height: 88px; resize: vertical;
|
|
77
|
+
padding: 12px 14px; border-radius: 10px;
|
|
78
|
+
border: 1px solid rgba(255, 255, 255, .2); background: var(--bg-deep); color: var(--ink);
|
|
79
|
+
font-family: inherit; font-size: 15px; font-weight: 400; line-height: 1.45;
|
|
80
|
+
}
|
|
81
|
+
.desc::placeholder { color: rgba(242, 241, 239, .38); }
|
|
82
|
+
.desc:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
|
|
83
|
+
.attached { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; color: var(--dim); font-size: 13px; }
|
|
84
|
+
.attached svg { width: 14px; height: 14px; flex: none; }
|
|
85
|
+
.link {
|
|
86
|
+
display: inline-flex; align-items: center; gap: 3px; padding: 0; border: 0; background: none;
|
|
87
|
+
color: rgba(242, 241, 239, .86); font-weight: 600; font-size: 13px;
|
|
88
|
+
}
|
|
89
|
+
.link:hover { color: #fff; text-decoration: underline; }
|
|
90
|
+
.link svg { width: 12px; height: 12px; transition: transform .14s ease; }
|
|
91
|
+
.link[aria-expanded="true"] svg { transform: rotate(180deg); }
|
|
92
|
+
.included { margin: 10px 0 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--bg-deep); color: var(--dim); font-size: 13px; }
|
|
93
|
+
.included li { margin: 2px 0; }
|
|
94
|
+
.marked { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--dim); }
|
|
95
|
+
.chip {
|
|
96
|
+
display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
|
|
97
|
+
border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
|
|
98
|
+
}
|
|
99
|
+
.chip.hide { background: #3a3940; }
|
|
100
|
+
.notify { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink); cursor: pointer; }
|
|
101
|
+
.notify input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
|
|
102
|
+
.error { margin: 12px 0 0; color: #ff9aa9; font-size: 13px; }
|
|
103
|
+
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
|
|
104
|
+
.where {
|
|
105
|
+
display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px;
|
|
106
|
+
border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: var(--ink);
|
|
107
|
+
font-size: 13px; font-weight: 600;
|
|
108
|
+
}
|
|
109
|
+
.where:hover:not(:disabled) { background: var(--faint); }
|
|
110
|
+
.where svg { width: 14px; height: 14px; }
|
|
111
|
+
.where:disabled { opacity: .45; cursor: default; }
|
|
112
|
+
.send {
|
|
113
|
+
padding: 10px 22px; border: 0; border-radius: 10px; background: var(--accent); color: #fff;
|
|
114
|
+
font-size: 15px; font-weight: 650;
|
|
115
|
+
}
|
|
116
|
+
.send:hover:not(:disabled) { background: #e43a57; }
|
|
117
|
+
.send:disabled { opacity: .45; cursor: default; }
|
|
118
|
+
|
|
119
|
+
/* -- settings --------------------------------------------------------------- */
|
|
120
|
+
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
121
|
+
.row .label { font-weight: 600; }
|
|
122
|
+
.bind {
|
|
123
|
+
min-width: 120px; padding: 8px 12px; border-radius: 9px; text-align: center;
|
|
124
|
+
border: 1px solid rgba(255, 255, 255, .2); background: var(--bg-deep);
|
|
125
|
+
font: 500 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
126
|
+
}
|
|
127
|
+
.bind[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--dim); }
|
|
128
|
+
.hint, .reason { margin: 10px 0 0; color: var(--dim); font-size: 13px; }
|
|
129
|
+
.reason { color: #ffc1ca; }
|
|
130
|
+
.settings-foot { display: flex; justify-content: space-between; margin-top: 16px; }
|
|
131
|
+
|
|
132
|
+
/* -- sent ------------------------------------------------------------------- */
|
|
133
|
+
.sent-head { display: flex; align-items: center; gap: 10px; }
|
|
134
|
+
.sent-head h3 { margin: 0; font-size: 17px; font-weight: 650; }
|
|
135
|
+
.sent-head svg { width: 22px; height: 22px; color: #4ade80; flex: none; }
|
|
136
|
+
.sent-body { margin: 8px 0 0 32px; color: var(--dim); }
|
|
137
|
+
.sent-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 0 32px; }
|
|
138
|
+
.see {
|
|
139
|
+
display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 9px;
|
|
140
|
+
background: #fff; color: #131216; font-weight: 650; font-size: 13px; text-decoration: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* -- marking: the frozen page ---------------------------------------------- */
|
|
144
|
+
.mark {
|
|
145
|
+
position: fixed; inset: 0; pointer-events: auto;
|
|
146
|
+
background: rgba(14, 13, 16, .16); cursor: crosshair;
|
|
147
|
+
touch-action: none; user-select: none; -webkit-user-select: none;
|
|
148
|
+
}
|
|
149
|
+
.ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
|
|
150
|
+
.ink .stroke { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
|
|
151
|
+
.ink .veil { fill: #1b1b1f; }
|
|
152
|
+
.ink .veil-label { fill: rgba(255, 255, 255, .7); font: 600 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
|
|
153
|
+
.ink .draft { opacity: .85; }
|
|
154
|
+
.pin { position: absolute; display: flex; align-items: center; gap: 6px; cursor: default; }
|
|
155
|
+
.pin .num {
|
|
156
|
+
display: grid; place-items: center; width: 24px; height: 24px; border-radius: 12px;
|
|
157
|
+
background: var(--accent); color: #fff; font-size: 12px; font-weight: 750;
|
|
158
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 0 0 2px #fff;
|
|
159
|
+
}
|
|
160
|
+
.pin .note {
|
|
161
|
+
width: 220px; padding: 6px 10px; border-radius: 9px;
|
|
162
|
+
border: 1px solid rgba(255, 255, 255, .16); background: #151417; color: #fff;
|
|
163
|
+
font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1.3;
|
|
164
|
+
box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
|
|
165
|
+
}
|
|
166
|
+
.pin .note::placeholder { color: rgba(255, 255, 255, .45); }
|
|
167
|
+
.pin .note:focus { outline: none; border-color: var(--accent); }
|
|
168
|
+
.pin .rm {
|
|
169
|
+
display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 12px;
|
|
170
|
+
background: #151417; color: rgba(255, 255, 255, .7); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
|
|
171
|
+
}
|
|
172
|
+
.pin .rm:hover { color: #fff; }
|
|
173
|
+
.pin .rm svg { width: 12px; height: 12px; }
|
|
174
|
+
.toolbar {
|
|
175
|
+
position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
|
|
176
|
+
display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 15px;
|
|
177
|
+
background: #151417; box-shadow: 0 16px 40px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .08) inset;
|
|
178
|
+
cursor: default;
|
|
179
|
+
}
|
|
180
|
+
.toolbar button {
|
|
181
|
+
padding: 9px 15px; border: 0; border-radius: 10px; background: transparent; color: #f2f1ef;
|
|
182
|
+
font-size: 15px; font-weight: 600;
|
|
183
|
+
}
|
|
184
|
+
.toolbar button:hover { background: rgba(255, 255, 255, .08); }
|
|
185
|
+
.toolbar button[aria-pressed="true"] { background: #e6455f; color: #fff; }
|
|
186
|
+
.toolbar .sep { width: 1px; height: 22px; margin: 0 4px; background: rgba(255, 255, 255, .14); }
|
|
187
|
+
.toolbar .done { background: var(--accent); color: #fff; }
|
|
188
|
+
.toolbar .done:hover { background: #e43a57; }
|
|
189
|
+
.toolbar button:disabled { opacity: .4; cursor: default; background: transparent; }
|
|
190
|
+
|
|
191
|
+
/* -- the coach card (D21): stays beside the pointer until mark 1 exists --- */
|
|
192
|
+
.coach {
|
|
193
|
+
position: fixed; width: 300px; padding: 14px 16px 15px;
|
|
194
|
+
background: #151417; color: #f2f1ef; border-radius: 14px;
|
|
195
|
+
box-shadow: 0 18px 44px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .1) inset;
|
|
196
|
+
pointer-events: none;
|
|
197
|
+
transition: opacity .12s ease;
|
|
198
|
+
}
|
|
199
|
+
.coach.pressing { opacity: .55; }
|
|
200
|
+
.coach svg { display: block; width: 100%; height: 64px; border-radius: 9px; background: #222126; }
|
|
201
|
+
.coach p { margin: 11px 0 0; font-size: 15px; line-height: 1.4; }
|
|
202
|
+
.coach p + p { margin-top: 2px; color: rgba(242, 241, 239, .66); font-size: 13px; }
|
|
203
|
+
.coach p.keys { margin-top: 8px; font-size: 12px; color: rgba(242, 241, 239, .5); }
|
|
204
|
+
.mark:focus { outline: none; }
|
|
205
|
+
.mark:focus-visible { outline: 3px solid rgba(230, 69, 95, .65); outline-offset: -3px; }
|
|
206
|
+
.coach .bar { fill: #5b5a61; }
|
|
207
|
+
.coach .loop { fill: none; stroke: #e6455f; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200; animation: vr-draw 2.8s ease-in-out infinite; }
|
|
208
|
+
.coach .hold { fill: none; stroke: #fff; stroke-width: 1.5; opacity: 0; animation: vr-hold 2.8s ease-in-out infinite; }
|
|
209
|
+
@keyframes vr-draw { 0%, 18% { stroke-dashoffset: 200; } 72%, 100% { stroke-dashoffset: 0; } 90% { opacity: 1; } 100% { opacity: 0; } }
|
|
210
|
+
@keyframes vr-hold { 0%, 8% { opacity: 0; } 14%, 72% { opacity: .9; } 80%, 100% { opacity: 0; } }
|
|
211
|
+
|
|
212
|
+
@media (max-width: 520px) {
|
|
213
|
+
.fab { right: 16px; bottom: 16px; padding: 13px 18px; font-size: 16px; }
|
|
214
|
+
.card { right: 16px; bottom: 84px; }
|
|
215
|
+
.vr.nobutton .card { bottom: 16px; }
|
|
216
|
+
.toolbar { bottom: 16px; max-width: calc(100vw - 24px); overflow-x: auto; }
|
|
217
|
+
.toolbar button { padding: 8px 11px; font-size: 14px; }
|
|
218
|
+
.coach { width: 260px; }
|
|
219
|
+
}
|
|
220
|
+
@media (prefers-reduced-motion: reduce) {
|
|
221
|
+
.card { animation: none; }
|
|
222
|
+
.fab { transition: none; }
|
|
223
|
+
.coach .loop { animation: none; stroke-dashoffset: 0; }
|
|
224
|
+
.coach .hold { animation: none; opacity: .9; }
|
|
225
|
+
}
|
|
226
|
+
`;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type RecordLoader } from './engine';
|
|
2
|
+
import { type Locale } from './i18n';
|
|
3
|
+
import { type IdentifyInput } from './identity';
|
|
4
|
+
import type { CaptureNarrowing } from './profile';
|
|
5
|
+
export interface WidgetOptions {
|
|
6
|
+
base: string;
|
|
7
|
+
key: string;
|
|
8
|
+
/** null/absent = the browser's language. */
|
|
9
|
+
locale?: Locale | null;
|
|
10
|
+
/** The floating button; `false` = the host opens the card itself. */
|
|
11
|
+
button: boolean;
|
|
12
|
+
/** CSS selector of the host's own control(s) that open the card. */
|
|
13
|
+
openSelector?: string | null;
|
|
14
|
+
identity?: IdentifyInput;
|
|
15
|
+
appVersion?: string;
|
|
16
|
+
capture?: CaptureNarrowing;
|
|
17
|
+
sanitizeUrl?: (url: string) => string;
|
|
18
|
+
loadRecord: RecordLoader;
|
|
19
|
+
}
|
|
20
|
+
export declare class ReportWidget {
|
|
21
|
+
private readonly opts;
|
|
22
|
+
private readonly hud;
|
|
23
|
+
private readonly engine;
|
|
24
|
+
private config;
|
|
25
|
+
private locale;
|
|
26
|
+
private s;
|
|
27
|
+
private button;
|
|
28
|
+
private openSelector;
|
|
29
|
+
/** This widget's own word: undefined defers to the page-wide identity; null is anonymous. */
|
|
30
|
+
private identity;
|
|
31
|
+
private keybind;
|
|
32
|
+
private isOpen;
|
|
33
|
+
private view;
|
|
34
|
+
private marking;
|
|
35
|
+
private markers;
|
|
36
|
+
private nextKey;
|
|
37
|
+
private tool;
|
|
38
|
+
private frozen;
|
|
39
|
+
private job;
|
|
40
|
+
private sending;
|
|
41
|
+
private error;
|
|
42
|
+
private result;
|
|
43
|
+
private notify;
|
|
44
|
+
private sentNotify;
|
|
45
|
+
private includedOpen;
|
|
46
|
+
private recordingBind;
|
|
47
|
+
private bindRefused;
|
|
48
|
+
/** The note input the reporter is in (or just drew); others with no text fold away. */
|
|
49
|
+
private noteOpen;
|
|
50
|
+
private drawing;
|
|
51
|
+
private readonly offs;
|
|
52
|
+
private readonly pins;
|
|
53
|
+
/** Per hide mark: the page nodes it covered when drawn (they are blanked in the capture). */
|
|
54
|
+
private readonly hideIds;
|
|
55
|
+
/** Native dialogs in the order they opened (seeded with those already open, in DOM order). */
|
|
56
|
+
private dialogOrder;
|
|
57
|
+
/**
|
|
58
|
+
* Where the report must live: the modal shown last (only the top modal is
|
|
59
|
+
* not inert), else the dialog opened last, else the recorder's rule
|
|
60
|
+
* (`sheetTarget`: ARIA dialogs included).
|
|
61
|
+
*/
|
|
62
|
+
private activeDialog;
|
|
63
|
+
/** The open dialog the report lives in while one is up (a modal makes everything outside it inert). */
|
|
64
|
+
private sheet;
|
|
65
|
+
private readonly e;
|
|
66
|
+
constructor(opts: WidgetOptions);
|
|
67
|
+
/**
|
|
68
|
+
* Live inside the topmost open dialog while there is one (the recorder's
|
|
69
|
+
* sheet path, hud/host.ts): a modal makes everything outside it inert and
|
|
70
|
+
* its focus trap pulls focus back. The one DOM tree moves, so the draft,
|
|
71
|
+
* the marks and their notes go along; focus is restored after the move.
|
|
72
|
+
*/
|
|
73
|
+
private followDialog;
|
|
74
|
+
open(): void;
|
|
75
|
+
close(): void;
|
|
76
|
+
setLocale(raw: string | null | undefined): void;
|
|
77
|
+
setButton(on: boolean): void;
|
|
78
|
+
setOpenSelector(sel: string | null): void;
|
|
79
|
+
identify(input: IdentifyInput): void;
|
|
80
|
+
unmount(): void;
|
|
81
|
+
private bind;
|
|
82
|
+
private show;
|
|
83
|
+
private who;
|
|
84
|
+
private stopBindListener;
|
|
85
|
+
private startRecordingBind;
|
|
86
|
+
private stopRecordingBind;
|
|
87
|
+
private startMarking;
|
|
88
|
+
private endMarking;
|
|
89
|
+
private onChrome;
|
|
90
|
+
private pointerDown;
|
|
91
|
+
private pointerMove;
|
|
92
|
+
private pointerUp;
|
|
93
|
+
/** A new numbered mark; a hide also names the page nodes under it now, while the page sits frozen. */
|
|
94
|
+
private addMarker;
|
|
95
|
+
private cancelDraft;
|
|
96
|
+
private kbDraft;
|
|
97
|
+
private markKey;
|
|
98
|
+
private renderKbDraft;
|
|
99
|
+
/** The coach rides beside the pointer, inside the viewport. */
|
|
100
|
+
private placeCoach;
|
|
101
|
+
private shapeNodes;
|
|
102
|
+
private renderMarks;
|
|
103
|
+
/** Pin numbers, positions and which notes show; text in place (the locale may have changed). */
|
|
104
|
+
private renderPins;
|
|
105
|
+
private envelope;
|
|
106
|
+
private send;
|
|
107
|
+
private includedItems;
|
|
108
|
+
private paint;
|
|
109
|
+
}
|