@vitrinka/web 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +24 -7
- package/build/recorder/version.d.ts +2 -2
- package/build/recorder/version.js +1 -1
- package/build/report/edge.d.ts +48 -0
- package/build/report/edge.js +71 -0
- package/build/report/element.d.ts +9 -2
- package/build/report/element.js +11 -2
- package/build/report/i18n.d.ts +5 -3
- package/build/report/i18n.js +136 -3
- package/build/report/index.d.ts +1 -0
- package/build/report/styles.d.ts +1 -1
- package/build/report/styles.js +75 -0
- package/build/report/widget.d.ts +21 -0
- package/build/report/widget.js +103 -13
- package/build/report-widget.mjs +81 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @vitrinka/web
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
- **Report a problem opens from a drop on the screen's edge.** The default
|
|
6
|
+
launcher is no longer the large button in a corner, which sat over a
|
|
7
|
+
page's own bottom bars (an order bar, a phone's tab dock): it is a small
|
|
8
|
+
ink drop resting on the right edge, a little below the middle, with a
|
|
9
|
+
meniscus where it meets the edge. Hovered or focused it grows its name
|
|
10
|
+
and swells; it slides up or down the edge (click, hold and move, or
|
|
11
|
+
Alt+↑/↓), stretches while it moves, settles when let go and is remembered
|
|
12
|
+
per site (`vitrinka.report.edge`). It never moves on its own; under
|
|
13
|
+
reduced motion it neither swells, stretches nor wobbles. The card opens
|
|
14
|
+
beside it, centred on it.
|
|
15
|
+
- **Upgrading:** to keep the corner button, pass `launcher: 'corner'` (or
|
|
16
|
+
the attribute `launcher="corner"`); its dock and its remembered corner are
|
|
17
|
+
unchanged.
|
|
18
|
+
- `edgeInsets: {top, bottom}` sets what the drop keeps clear of (default
|
|
19
|
+
80 px and 136 px); `--vr-drop-fill` and `--vr-drop-ink` on the HUD host
|
|
20
|
+
theme it.
|
|
21
|
+
- The handle has `setButton(on)`: hide the launcher while your own modal is
|
|
22
|
+
up, show it again after.
|
|
23
|
+
- **Slovak.** The report face speaks `sk` (`locale: 'sk'`, or a Slovak
|
|
24
|
+
browser), beside `cs` and `en`.
|
|
25
|
+
|
|
3
26
|
## 0.11.0
|
|
4
27
|
|
|
5
28
|
- **A report shows how the reporter got there.** Report a problem sent a
|
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ screenshots), **clicks** (selector, text, rect), **navigation**, **network**
|
|
|
15
15
|
the last minute as a bug report ([Report a bug](#report-a-bug)).
|
|
16
16
|
|
|
17
17
|
The same engine has a second face for the people who use your app:
|
|
18
|
-
**[Report a problem](#report-a-problem-vitrinkawebreport)** — a
|
|
19
|
-
|
|
18
|
+
**[Report a problem](#report-a-problem-vitrinkawebreport)** — a drop
|
|
19
|
+
resting on the screen's edge and one card: "What went wrong?", optional marks drawn on the page,
|
|
20
20
|
files, and the last minutes attached under your project's capture profile.
|
|
21
21
|
No React needed; it also ships as one file vitrinka serves.
|
|
22
22
|
|
|
@@ -295,8 +295,8 @@ offered only during one.
|
|
|
295
295
|
|
|
296
296
|
## Report a problem (`@vitrinka/web/report`)
|
|
297
297
|
|
|
298
|
-
The report face of the same engine, for the people using your app: a
|
|
299
|
-
|
|
298
|
+
The report face of the same engine, for the people using your app: a quiet
|
|
299
|
+
drop on the right edge of the screen and ONE card. Its header
|
|
300
300
|
says who is reporting (the account chip) and holds the ⋯ menu; its body
|
|
301
301
|
takes the reporter's word for it — **Bug · Suggestion · Question · Other**,
|
|
302
302
|
optional, sent as `type`, a hint for your team's triage — and **What went
|
|
@@ -307,6 +307,20 @@ view. The minutes before are attached under your project's **capture
|
|
|
307
307
|
profile** (set in vitrinka; see [`docs/PROTOCOL.md`](../../docs/PROTOCOL.md)
|
|
308
308
|
§ Report a problem). You need the project's report key (`vkb_…`).
|
|
309
309
|
|
|
310
|
+
**The drop.** The launcher is a small ink drop resting on the right edge, a
|
|
311
|
+
little below the middle — the edge is the flat surface it sits on, with a
|
|
312
|
+
meniscus where they meet. Hovered or focused it grows its name (**Report a
|
|
313
|
+
problem** / **Nahlásit problém** / **Nahlásiť problém**) and swells; click,
|
|
314
|
+
hold and move it to slide it up or down the edge (Alt+↑/↓ from the
|
|
315
|
+
keyboard) — it stretches while it moves, settles when let go and is
|
|
316
|
+
remembered per site (`vitrinka.report.edge`). It never moves on its own,
|
|
317
|
+
and under reduced motion it neither swells, stretches nor wobbles. It keeps
|
|
318
|
+
clear of your top bar and bottom bars (`edgeInsets`, default 80 px top and
|
|
319
|
+
136 px bottom), and the card opens beside it, centred on it; on a phone the
|
|
320
|
+
card takes the width. Theme it with `--vr-drop-fill` and `--vr-drop-ink` on
|
|
321
|
+
the HUD host. `launcher: 'corner'` (attribute `launcher="corner"`) keeps the
|
|
322
|
+
large button in a corner instead.
|
|
323
|
+
|
|
310
324
|
**Marking.** **Show us where** puts a glass bar at the top of the page —
|
|
311
325
|
"Mark where the problem is", a segmented **Box · Circle · Arrow · Cover**
|
|
312
326
|
(Box picked) and **Cancel** — and you box, circle, point at or cover parts
|
|
@@ -371,8 +385,10 @@ function ReportAProblem({ locale, token }: { locale: string; token?: string }) {
|
|
|
371
385
|
|---|---|
|
|
372
386
|
| `key` | the project's `vkb_` report key (required) |
|
|
373
387
|
| `base` | vitrinka's origin (the script tag defaults to where it was served from) |
|
|
374
|
-
| `locale` | `cs` · `en`; live as an attribute, and through `setLocale()` |
|
|
375
|
-
| `button` | `false` hides the
|
|
388
|
+
| `locale` | `cs` · `en` · `sk`; live as an attribute, and through `setLocale()` |
|
|
389
|
+
| `button` | `false` hides the launcher: open the card from your own control; live as an attribute, and through `setButton()` |
|
|
390
|
+
| `launcher` | `edge` (default) — the drop on the right edge — or `corner`, the large button in a corner; live as an attribute |
|
|
391
|
+
| `edgeInsets` | `{top, bottom}` in px the drop keeps clear of (your top bar, bottom bars); default `{top: 80, bottom: 136}` (npm only) |
|
|
376
392
|
| `open-selector` / `openSelector` | a CSS selector of your control(s) that open the card |
|
|
377
393
|
| `face` | `report` (default) or `recorder` — the recorder pill on the same engine (npm only; it takes a `vkr_` key or the device link). A linked member also switches in place: **The face switch** below |
|
|
378
394
|
| `capture` | narrow the capture profile: `{storage: 'memory', windowSec, maxBytes, classes}` |
|
|
@@ -382,7 +398,8 @@ function ReportAProblem({ locale, token }: { locale: string; token?: string }) {
|
|
|
382
398
|
|
|
383
399
|
The handle (and the element) has `open()`, `close()`, `identify()`,
|
|
384
400
|
`setContext()`, `setLocale()` and `face`, the face on screen (`recorder` while a member has
|
|
385
|
-
switched to the pill); the handle also `
|
|
401
|
+
switched to the pill); the handle also has `setButton()` (hide the launcher
|
|
402
|
+
while your own modal is up) and `unmount()`s. For the tag from npm, call
|
|
386
403
|
`defineReportElement()` once. Closing the card hands focus back to whatever
|
|
387
404
|
had it when the card opened (your control, the field the shortcut fired in),
|
|
388
405
|
else to the button: call `open()` once your control holds focus again — after
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Sent as `meta.recorder` and written as `data-vitrinka-page`; bumped with the package version. */
|
|
2
|
-
export declare const RECORDER_VERSION = "0.
|
|
3
|
-
export declare const RECORDER_ID = "web/0.
|
|
2
|
+
export declare const RECORDER_VERSION = "0.12.0";
|
|
3
|
+
export declare const RECORDER_ID = "web/0.12.0";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The edge drop (vt-3811): the default launcher rests on the right edge of the
|
|
3
|
+
* viewport, a little below the middle, and slides up or down along it — never
|
|
4
|
+
* off it. Its place is a fraction of the band it may use (0 = the top of the
|
|
5
|
+
* band, 1 = the bottom), so it lands in the same proportion when the window
|
|
6
|
+
* changes height; the band keeps clear of a page's top bar and its bottom bars
|
|
7
|
+
* (an order bar, a phone's tab dock). The fraction is remembered per origin.
|
|
8
|
+
*
|
|
9
|
+
* The card opens beside the drop, toward the middle of the page, centred on
|
|
10
|
+
* it and kept inside the viewport.
|
|
11
|
+
*/
|
|
12
|
+
import type { Corner } from './place';
|
|
13
|
+
export type Launcher = 'edge' | 'corner';
|
|
14
|
+
export declare const EDGE_KEY = "vitrinka.report.edge";
|
|
15
|
+
/** A little below the middle: under the content people read, above the bottom bars. */
|
|
16
|
+
export declare const EDGE_DEFAULT = 0.62;
|
|
17
|
+
/** Alt+↑/↓ moves the drop by this share of its band. */
|
|
18
|
+
export declare const EDGE_STEP = 0.1;
|
|
19
|
+
/** The clear space the drop keeps at the top and the bottom of the viewport, in CSS px. */
|
|
20
|
+
export interface EdgeInsets {
|
|
21
|
+
top: number;
|
|
22
|
+
bottom: number;
|
|
23
|
+
}
|
|
24
|
+
/** Clear of a typical top bar (64–72 px) and of a bottom bar plus a phone's tab dock. */
|
|
25
|
+
export declare const EDGE_INSETS: Readonly<EdgeInsets>;
|
|
26
|
+
/** The launcher a raw option or attribute names; anything but `corner` is the edge drop. */
|
|
27
|
+
export declare function parseLauncher(raw: string | null | undefined): Launcher;
|
|
28
|
+
/** Host insets are untrusted: only finite, non-negative numbers replace the defaults. */
|
|
29
|
+
export declare function edgeInsets(raw?: Partial<EdgeInsets> | null): EdgeInsets;
|
|
30
|
+
/** The stored place; a value this module never wrote (garbage, out of range) falls back to the default. */
|
|
31
|
+
export declare function readEdge(): number;
|
|
32
|
+
export declare function saveEdge(fraction: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* The drop's top in px for `fraction` of its band. A viewport too short for
|
|
35
|
+
* the band (a phone in landscape) centres the drop instead.
|
|
36
|
+
*/
|
|
37
|
+
export declare function edgeTop(fraction: number, vh: number, h: number, insets: EdgeInsets): number;
|
|
38
|
+
/** The fraction a drop whose top is at `top` stands at — dragged past the band, it stops at its end. */
|
|
39
|
+
export declare function edgeFraction(top: number, vh: number, h: number, insets: EdgeInsets): number;
|
|
40
|
+
/** Alt+↑/↓: the next place in that direction (staying at the end); null for any other key. */
|
|
41
|
+
export declare function edgeToward(fraction: number, key: string): number | null;
|
|
42
|
+
/**
|
|
43
|
+
* The corner marking parks the card from, and the coach reads its side from:
|
|
44
|
+
* the upper half of the band is a top-right drop, the lower half a bottom-right one.
|
|
45
|
+
*/
|
|
46
|
+
export declare function edgeCorner(fraction: number): Corner;
|
|
47
|
+
/** The card's top beside a drop at `dropTop`: centred on it, `margin` inside the viewport. */
|
|
48
|
+
export declare function cardTopBeside(dropTop: number, dropH: number, cardH: number, vh: number, margin?: number): number;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { readPref, writePref } from './settings';
|
|
2
|
+
export const EDGE_KEY = 'vitrinka.report.edge';
|
|
3
|
+
/** A little below the middle: under the content people read, above the bottom bars. */
|
|
4
|
+
export const EDGE_DEFAULT = 0.62;
|
|
5
|
+
/** Alt+↑/↓ moves the drop by this share of its band. */
|
|
6
|
+
export const EDGE_STEP = 0.1;
|
|
7
|
+
/** Clear of a typical top bar (64–72 px) and of a bottom bar plus a phone's tab dock. */
|
|
8
|
+
export const EDGE_INSETS = { top: 80, bottom: 136 };
|
|
9
|
+
/** The launcher a raw option or attribute names; anything but `corner` is the edge drop. */
|
|
10
|
+
export function parseLauncher(raw) {
|
|
11
|
+
return raw === 'corner' ? 'corner' : 'edge';
|
|
12
|
+
}
|
|
13
|
+
/** Host insets are untrusted: only finite, non-negative numbers replace the defaults. */
|
|
14
|
+
export function edgeInsets(raw) {
|
|
15
|
+
const pick = (v, d) => (typeof v === 'number' && Number.isFinite(v) && v >= 0 ? v : d);
|
|
16
|
+
return { top: pick(raw?.top, EDGE_INSETS.top), bottom: pick(raw?.bottom, EDGE_INSETS.bottom) };
|
|
17
|
+
}
|
|
18
|
+
function clamp01(v) {
|
|
19
|
+
return Math.min(1, Math.max(0, v));
|
|
20
|
+
}
|
|
21
|
+
/** The stored place; a value this module never wrote (garbage, out of range) falls back to the default. */
|
|
22
|
+
export function readEdge() {
|
|
23
|
+
const raw = readPref(EDGE_KEY);
|
|
24
|
+
if (raw === null || raw.trim() === '')
|
|
25
|
+
return EDGE_DEFAULT;
|
|
26
|
+
const v = Number(raw);
|
|
27
|
+
return Number.isFinite(v) && v >= 0 && v <= 1 ? v : EDGE_DEFAULT;
|
|
28
|
+
}
|
|
29
|
+
export function saveEdge(fraction) {
|
|
30
|
+
writePref(EDGE_KEY, String(Math.round(clamp01(fraction) * 1000) / 1000));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The drop's top in px for `fraction` of its band. A viewport too short for
|
|
34
|
+
* the band (a phone in landscape) centres the drop instead.
|
|
35
|
+
*/
|
|
36
|
+
export function edgeTop(fraction, vh, h, insets) {
|
|
37
|
+
const room = vh - insets.top - insets.bottom - h;
|
|
38
|
+
if (room <= 0)
|
|
39
|
+
return Math.max(0, Math.round((vh - h) / 2));
|
|
40
|
+
return Math.round(insets.top + clamp01(fraction) * room);
|
|
41
|
+
}
|
|
42
|
+
/** The fraction a drop whose top is at `top` stands at — dragged past the band, it stops at its end. */
|
|
43
|
+
export function edgeFraction(top, vh, h, insets) {
|
|
44
|
+
const room = vh - insets.top - insets.bottom - h;
|
|
45
|
+
if (room <= 0)
|
|
46
|
+
return EDGE_DEFAULT;
|
|
47
|
+
return clamp01((top - insets.top) / room);
|
|
48
|
+
}
|
|
49
|
+
/** Alt+↑/↓: the next place in that direction (staying at the end); null for any other key. */
|
|
50
|
+
export function edgeToward(fraction, key) {
|
|
51
|
+
if (key === 'ArrowUp')
|
|
52
|
+
return clamp01(Math.round((fraction - EDGE_STEP) * 1000) / 1000);
|
|
53
|
+
if (key === 'ArrowDown')
|
|
54
|
+
return clamp01(Math.round((fraction + EDGE_STEP) * 1000) / 1000);
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The corner marking parks the card from, and the coach reads its side from:
|
|
59
|
+
* the upper half of the band is a top-right drop, the lower half a bottom-right one.
|
|
60
|
+
*/
|
|
61
|
+
export function edgeCorner(fraction) {
|
|
62
|
+
return fraction < 0.5 ? 'tr' : 'br';
|
|
63
|
+
}
|
|
64
|
+
/** The card's top beside a drop at `dropTop`: centred on it, `margin` inside the viewport. */
|
|
65
|
+
export function cardTopBeside(dropTop, dropH, cardH, vh, margin = 16) {
|
|
66
|
+
const centred = dropTop + dropH / 2 - cardH / 2;
|
|
67
|
+
const max = vh - cardH - margin;
|
|
68
|
+
if (max < margin)
|
|
69
|
+
return Math.max(0, Math.round((vh - cardH) / 2));
|
|
70
|
+
return Math.round(Math.min(max, Math.max(margin, centred)));
|
|
71
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReportContextInput } from './context';
|
|
2
2
|
import type { RecordLoader } from './engine';
|
|
3
|
+
import { type EdgeInsets, type Launcher } from './edge';
|
|
3
4
|
import { type Locale } from './i18n';
|
|
4
5
|
import type { IdentifyInput } from './identity';
|
|
5
6
|
import type { CaptureNarrowing } from './profile';
|
|
@@ -12,6 +13,8 @@ export interface ReportScriptOptions {
|
|
|
12
13
|
capture?: CaptureNarrowing;
|
|
13
14
|
/** Rewrite captured URLs and routes before redaction (credentials in paths). */
|
|
14
15
|
sanitizeUrl?: (url: string) => string;
|
|
16
|
+
/** The clear space (px) the edge drop keeps at the top and the bottom of the viewport: your top bar and bottom bars. */
|
|
17
|
+
edgeInsets?: Partial<EdgeInsets>;
|
|
15
18
|
}
|
|
16
19
|
export interface ReportOptions extends ReportScriptOptions {
|
|
17
20
|
/** The project's `vkb_` report key (`face: 'recorder'`: a `vkr_` key, or none for the device link). */
|
|
@@ -20,10 +23,12 @@ export interface ReportOptions extends ReportScriptOptions {
|
|
|
20
23
|
base?: string;
|
|
21
24
|
/** Default `report`. */
|
|
22
25
|
face?: ReportFace;
|
|
23
|
-
/** `cs` | `en`; default: the browser's language. */
|
|
26
|
+
/** `cs` | `en` | `sk`; default: the browser's language. */
|
|
24
27
|
locale?: Locale | string;
|
|
25
|
-
/** The
|
|
28
|
+
/** The launcher (default true); false = open it from your own control. */
|
|
26
29
|
button?: boolean;
|
|
30
|
+
/** `edge` (default): the drop resting on the right edge; `corner`: the large button in a corner. */
|
|
31
|
+
launcher?: Launcher;
|
|
27
32
|
/** Your control(s) that open the card, as a CSS selector. */
|
|
28
33
|
openSelector?: string;
|
|
29
34
|
/** Who reports: a token your server signed, or an asserted email. */
|
|
@@ -46,6 +51,8 @@ export interface ReportHandle {
|
|
|
46
51
|
/** Replace the whole context the next report carries; `{}` or null clears it. Invalid entries are dropped and warned about. */
|
|
47
52
|
setContext(next: ReportContextInput): void;
|
|
48
53
|
setLocale(locale: Locale | string): void;
|
|
54
|
+
/** Show or hide the launcher, live — e.g. hide it while your own modal is open. */
|
|
55
|
+
setButton(on: boolean): void;
|
|
49
56
|
unmount(): void;
|
|
50
57
|
}
|
|
51
58
|
/** `<vitrinka-report>` as script sees it. */
|
package/build/report/element.js
CHANGED
|
@@ -21,11 +21,12 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { listen } from '../recorder/hud/listen';
|
|
23
23
|
import { normalizeContext } from './context';
|
|
24
|
+
import { parseLauncher } from './edge';
|
|
24
25
|
import { memberLinked, pillRecording, rememberFace, startFace, watchMemberLink } from './face';
|
|
25
26
|
import { parseLocale } from './i18n';
|
|
26
27
|
import { hitsOpener, ReportWidget } from './widget';
|
|
27
28
|
export const REPORT_TAG = 'vitrinka-report';
|
|
28
|
-
const ATTRS = ['key', 'base', 'open-selector', 'locale', 'button'];
|
|
29
|
+
const ATTRS = ['key', 'base', 'open-selector', 'locale', 'button', 'launcher'];
|
|
29
30
|
function trimBase(raw) {
|
|
30
31
|
return raw.trim().replace(/\/+$/, '');
|
|
31
32
|
}
|
|
@@ -88,6 +89,8 @@ export function defineReportElement(faces) {
|
|
|
88
89
|
this.widget.setLocale(value);
|
|
89
90
|
else if (name === 'button')
|
|
90
91
|
this.widget.setButton(value !== 'false');
|
|
92
|
+
else if (name === 'launcher')
|
|
93
|
+
this.widget.setLauncher(parseLauncher(value));
|
|
91
94
|
else if (name === 'open-selector')
|
|
92
95
|
this.widget.setOpenSelector(value);
|
|
93
96
|
}
|
|
@@ -187,6 +190,8 @@ export function defineReportElement(faces) {
|
|
|
187
190
|
key: at.key,
|
|
188
191
|
locale: parseLocale(this.getAttribute('locale')),
|
|
189
192
|
button: this.getAttribute('button') !== 'false',
|
|
193
|
+
launcher: parseLauncher(this.getAttribute('launcher')),
|
|
194
|
+
edgeInsets: this.options.edgeInsets,
|
|
190
195
|
openSelector: this.getAttribute('open-selector'),
|
|
191
196
|
identity: this.pendingIdentity,
|
|
192
197
|
context: this.context,
|
|
@@ -266,9 +271,11 @@ export function mountReport(opts, faces) {
|
|
|
266
271
|
el.setAttribute('locale', String(opts.locale));
|
|
267
272
|
if (opts.button === false)
|
|
268
273
|
el.setAttribute('button', 'false');
|
|
274
|
+
if (opts.launcher)
|
|
275
|
+
el.setAttribute('launcher', opts.launcher);
|
|
269
276
|
if (opts.openSelector)
|
|
270
277
|
el.setAttribute('open-selector', opts.openSelector);
|
|
271
|
-
el.options = { appVersion: opts.appVersion, capture: opts.capture, sanitizeUrl: opts.sanitizeUrl };
|
|
278
|
+
el.options = { appVersion: opts.appVersion, capture: opts.capture, sanitizeUrl: opts.sanitizeUrl, edgeInsets: opts.edgeInsets };
|
|
272
279
|
// null is a choice (anonymous, whatever the page-wide identity); only undefined defers.
|
|
273
280
|
if (opts.identity !== undefined)
|
|
274
281
|
el.identify(opts.identity);
|
|
@@ -284,6 +291,7 @@ export function mountReport(opts, faces) {
|
|
|
284
291
|
identify: (who) => el.identify(who),
|
|
285
292
|
setContext: (next) => el.setContext(next),
|
|
286
293
|
setLocale: (l) => el.setLocale(l),
|
|
294
|
+
setButton: (on) => el.setAttribute('button', on ? 'true' : 'false'),
|
|
287
295
|
unmount: () => el.remove(),
|
|
288
296
|
};
|
|
289
297
|
}
|
|
@@ -313,6 +321,7 @@ function mountRecorder(opts, faces) {
|
|
|
313
321
|
identify: inert,
|
|
314
322
|
setContext: inert,
|
|
315
323
|
setLocale: inert,
|
|
324
|
+
setButton: inert,
|
|
316
325
|
unmount: () => {
|
|
317
326
|
gone = true;
|
|
318
327
|
unmount?.();
|
package/build/report/i18n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Every string Report a problem shows, one catalog per locale (cs, en). The
|
|
2
|
+
* Every string Report a problem shows, one catalog per locale (cs, en, sk). The
|
|
3
3
|
* browser's language picks one by default; the host's `locale` option,
|
|
4
4
|
* `locale` attribute and `setLocale()` switch it live — the widget repaints
|
|
5
5
|
* its text in place, so a draft and its marks survive the switch.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* first-time reporter does not know the word.
|
|
9
9
|
*/
|
|
10
10
|
import type { MarkerShape } from './markers';
|
|
11
|
-
export type Locale = 'cs' | 'en';
|
|
11
|
+
export type Locale = 'cs' | 'en' | 'sk';
|
|
12
12
|
export type ReportKind = 'bug' | 'suggestion' | 'question' | 'other';
|
|
13
13
|
export declare const REPORT_KINDS: readonly ReportKind[];
|
|
14
14
|
export interface Strings {
|
|
@@ -133,6 +133,8 @@ export interface Strings {
|
|
|
133
133
|
incFiles: string;
|
|
134
134
|
errorFiles: string;
|
|
135
135
|
moveHint: string;
|
|
136
|
+
/** The edge drop's move hint (vt-3811): along the edge only. */
|
|
137
|
+
edgeHint: string;
|
|
136
138
|
size: string;
|
|
137
139
|
sizes: {
|
|
138
140
|
sm: string;
|
|
@@ -154,7 +156,7 @@ export interface Strings {
|
|
|
154
156
|
windowLength: (sec: number) => string;
|
|
155
157
|
}
|
|
156
158
|
export declare function strings(locale: Locale): Strings;
|
|
157
|
-
/** `cs`, `cs-CZ`, `CS` → cs; `en-GB` → en; anything else → null. */
|
|
159
|
+
/** `cs`, `cs-CZ`, `CS` → cs; `sk-SK` → sk; `en-GB` → en; anything else → null. */
|
|
158
160
|
export declare function parseLocale(raw: unknown): Locale | null;
|
|
159
161
|
/** The first of the browser's languages the widget speaks; English otherwise. */
|
|
160
162
|
export declare function browserLocale(): Locale;
|
package/build/report/i18n.js
CHANGED
|
@@ -115,6 +115,7 @@ const en = {
|
|
|
115
115
|
incFiles: 'The files you attached',
|
|
116
116
|
errorFiles: 'Your report arrived, a file not yet — try again to attach it',
|
|
117
117
|
moveHint: 'Click, hold and move it to another corner, or press Alt and an arrow key.',
|
|
118
|
+
edgeHint: 'Click, hold and move it up or down along the edge, or press Alt and the up or down arrow.',
|
|
118
119
|
size: 'Size',
|
|
119
120
|
sizes: { sm: 'Small', md: 'Medium', lg: 'Large' },
|
|
120
121
|
techDetails: 'Technical details',
|
|
@@ -244,6 +245,7 @@ const cs = {
|
|
|
244
245
|
incFiles: 'Soubory, které jste přiložili',
|
|
245
246
|
errorFiles: 'Hlášení dorazilo, soubor zatím ne — zkuste to znovu a přiložíme ho',
|
|
246
247
|
moveHint: 'Klikněte, podržte a veďte ho do jiného rohu, nebo stiskněte Alt a šipku.',
|
|
248
|
+
edgeHint: 'Klikněte, podržte a posuňte ho nahoru nebo dolů podél okraje, nebo stiskněte Alt a šipku nahoru či dolů.',
|
|
247
249
|
size: 'Velikost',
|
|
248
250
|
sizes: { sm: 'Malá', md: 'Střední', lg: 'Velká' },
|
|
249
251
|
techDetails: 'Technické údaje',
|
|
@@ -264,16 +266,147 @@ const cs = {
|
|
|
264
266
|
return csPlural(min, '1 minuta', `${min} minuty`, `${min} minut`);
|
|
265
267
|
},
|
|
266
268
|
};
|
|
267
|
-
|
|
269
|
+
/** Slovak (vt-3811): Slovak plurals take the Czech forms (1 · 2–4 · 5+), so csPlural serves both. */
|
|
270
|
+
const sk = {
|
|
271
|
+
button: 'Nahlásiť problém',
|
|
272
|
+
title: 'Nahlásiť problém',
|
|
273
|
+
close: 'Zavrieť',
|
|
274
|
+
settings: 'Nastavenia',
|
|
275
|
+
prompt: 'Čo sa pokazilo?',
|
|
276
|
+
placeholder: 'Napíšte, čo sa stalo a čo ste čakali',
|
|
277
|
+
attached: (sec) => {
|
|
278
|
+
if (sec < 60) {
|
|
279
|
+
return csPlural(sec, 'Posledná sekunda je priložená', `Posledné ${sec} sekundy sú priložené`, `Posledných ${sec} sekúnd je priložených`);
|
|
280
|
+
}
|
|
281
|
+
const min = Math.round(sec / 60);
|
|
282
|
+
return csPlural(min, 'Posledná minúta je priložená', `Posledné ${min} minúty sú priložené`, `Posledných ${min} minút je priložených`);
|
|
283
|
+
},
|
|
284
|
+
included: 'Čo je priložené',
|
|
285
|
+
incReplay: 'Záznam toho, čo sa na stránke dialo',
|
|
286
|
+
incReplayMasked: {
|
|
287
|
+
strict: 'Texty stránky aj všetko, čo ste napísali, sú v ňom skryté',
|
|
288
|
+
balanced: 'Všetko, čo ste napísali, je v ňom skryté',
|
|
289
|
+
full: 'Ukazuje stránku tak, ako ste ju videli',
|
|
290
|
+
},
|
|
291
|
+
incErrors: 'Chyby, na ktoré stránka narazila',
|
|
292
|
+
incConsole: 'Správy z konzoly prehliadača',
|
|
293
|
+
incNetwork: 'Ktoré adresy stránka načítavala a s akým výsledkom',
|
|
294
|
+
incFailedRequests: 'Požiadavky, ktoré zlyhali — len adresa a výsledok',
|
|
295
|
+
incEnv: 'Váš prehliadač, veľkosť obrazovky, jazyk a adresa stránky',
|
|
296
|
+
incIdentity: 'Vaše meno a e-mail z tejto aplikácie',
|
|
297
|
+
incMarks: 'Miesta, ktoré ste označili, aj s poznámkami',
|
|
298
|
+
showWhere: 'Ukážte nám kde',
|
|
299
|
+
kinds: { bug: 'Chyba', suggestion: 'Návrh', question: 'Otázka', other: 'Iné' },
|
|
300
|
+
kindsLabel: 'Čo to je?',
|
|
301
|
+
linesEmpty: 'Každé označené miesto tu dostane riadok na poznámku.',
|
|
302
|
+
notify: 'Pošlite mi e-mail, keď to bude opravené',
|
|
303
|
+
send: 'Odoslať',
|
|
304
|
+
sending: 'Odosielam…',
|
|
305
|
+
retry: 'Skúsiť znova',
|
|
306
|
+
errorCreate: 'Nepodarilo sa odoslať — váš text zostal, skúste to znova',
|
|
307
|
+
errorCapture: 'Hlásenie dorazilo, záznam zatiaľ nie — skúste to znova a priložíme ho',
|
|
308
|
+
sentTitle: 'Vďaka — máme to',
|
|
309
|
+
sentBody: 'Tím sa na to pozrie.',
|
|
310
|
+
sentNotify: 'Keď to bude opravené, pošleme vám e-mail.',
|
|
311
|
+
seeReport: 'Zobraziť hlásenie',
|
|
312
|
+
tools: { circle: 'Kruh', box: 'Obdĺžnik', arrow: 'Šípka', hide: 'Zakryť' },
|
|
313
|
+
toolbar: 'Nástroje na označenie',
|
|
314
|
+
barLead: 'Označte, kde je problém',
|
|
315
|
+
barLeadHide: 'Zakryte, čo tím nemá vidieť',
|
|
316
|
+
cancelMarking: 'Zrušiť',
|
|
317
|
+
discardMarks: (n) => csPlural(n, 'Zahodiť 1 značku?', `Zahodiť ${n} značky?`, `Zahodiť ${n} značiek?`),
|
|
318
|
+
discard: 'Zahodiť',
|
|
319
|
+
keep: 'Ponechať',
|
|
320
|
+
coach: {
|
|
321
|
+
box: 'Kliknite, podržte a veďte cez problém.',
|
|
322
|
+
circle: 'Kliknite, podržte a veďte okolo problému.',
|
|
323
|
+
arrow: 'Kliknite, podržte a veďte z voľného miesta k problému.',
|
|
324
|
+
hide: 'Kliknite, podržte a veďte cez všetko súkromné — v hlásení zostane prázdne.',
|
|
325
|
+
},
|
|
326
|
+
coachMore: 'Označiť môžete aj viac miest.',
|
|
327
|
+
coachDismiss: 'Rozumiem, už nezobrazovať',
|
|
328
|
+
coachSetting: 'Nápoveda pri označovaní',
|
|
329
|
+
marking: 'Označovanie',
|
|
330
|
+
keyboardHint: 'Klávesnica: Enter začne, šípky posúvajú, Shift+šípky menia veľkosť, Enter umiestni.',
|
|
331
|
+
hidden: 'Zakryté — neodošle sa',
|
|
332
|
+
notePlaceholder: 'Pridajte poznámku (nepovinné)',
|
|
333
|
+
mark: (n) => `Značka ${n}`,
|
|
334
|
+
removeMark: (n) => `Odobrať značku ${n}`,
|
|
335
|
+
shortcut: 'Klávesová skratka',
|
|
336
|
+
shortcutHint: 'Otvorí Nahlásiť problém kdekoľvek v tejto aplikácii.',
|
|
337
|
+
notSet: 'Nenastavená',
|
|
338
|
+
recordShortcut: 'Nahrať novú skratku',
|
|
339
|
+
pressKeys: 'Stlačte klávesy · Esc zruší',
|
|
340
|
+
needModifier: 'Pridajte Ctrl, Alt alebo ⌘ — samotná klávesa by prekážala pri písaní',
|
|
341
|
+
removeShortcut: 'Odobrať',
|
|
342
|
+
back: 'Späť',
|
|
343
|
+
account: 'Váš účet',
|
|
344
|
+
menu: 'Ponuka',
|
|
345
|
+
anonymous: 'Neprihlásené',
|
|
346
|
+
anonymousHint: 'Hlásenie najprv skontroluje tím.',
|
|
347
|
+
signedInByApp: 'Prihlásený touto aplikáciou',
|
|
348
|
+
linkVitrinka: 'Prepojiť s vitrinkou',
|
|
349
|
+
linkedAs: (who) => `Prepojené s vitrinkou ako ${who}`,
|
|
350
|
+
unlink: 'Odpojiť',
|
|
351
|
+
myReports: 'Moje hlásenia',
|
|
352
|
+
recentRecordings: 'Nedávne nahrávky',
|
|
353
|
+
record: 'Nahrávať',
|
|
354
|
+
recordHasDraft: 'Odošlite alebo zmažte rozpísané hlásenie',
|
|
355
|
+
openVitrinka: 'Otvoriť vitrinku',
|
|
356
|
+
openPortal: 'Otvoriť portál hlásení',
|
|
357
|
+
loading: 'Načítavam…',
|
|
358
|
+
listFailed: 'Nepodarilo sa načítať — skúste to znova',
|
|
359
|
+
noReports: 'Zatiaľ žiadne hlásenia.',
|
|
360
|
+
noRecordings: 'Zatiaľ žiadne nahrávky.',
|
|
361
|
+
fromThisBrowser: 'Odoslané z tohto prehliadača',
|
|
362
|
+
steps: { received: 'Prijaté', planned: 'Naplánované', in_progress: 'Riešime', fixed: 'Opravené', done: 'Hotovo' },
|
|
363
|
+
waiting: 'Čaká na schválenie',
|
|
364
|
+
sentQueued: 'Kým ho zaradíme, tím ho skontroluje.',
|
|
365
|
+
linkCode: 'Váš kód',
|
|
366
|
+
linkHint: 'Schváľte kód vo vitrinke — na tomto alebo inom zariadení, kde ste prihlásení.',
|
|
367
|
+
linkWaiting: 'Čakám na schválenie…',
|
|
368
|
+
linkExpired: 'Kód vypršal.',
|
|
369
|
+
linkFailed: 'Prepojenie sa nepodarilo.',
|
|
370
|
+
attach: 'Priložiť súbor',
|
|
371
|
+
removeFile: (name) => `Odobrať ${name}`,
|
|
372
|
+
fileTooBig: (name, cap) => `${name} prekračuje limit ${cap}`,
|
|
373
|
+
tooManyFiles: (n) => csPlural(n, 'Najviac 1 súbor na hlásenie', `Najviac ${n} súbory na hlásenie`, `Najviac ${n} súborov na hlásenie`),
|
|
374
|
+
fileType: (name, types) => `${name} nemožno priložiť — len ${types}`,
|
|
375
|
+
typeNames: { image: 'obrázky', pdf: 'PDF', text: 'textové súbory', office: 'kancelárske dokumenty' },
|
|
376
|
+
incFiles: 'Súbory, ktoré ste priložili',
|
|
377
|
+
errorFiles: 'Hlásenie dorazilo, súbor zatiaľ nie — skúste to znova a priložíme ho',
|
|
378
|
+
moveHint: 'Kliknite, podržte a veďte ho do iného rohu, alebo stlačte Alt a šípku.',
|
|
379
|
+
edgeHint: 'Kliknite, podržte a posuňte ho hore alebo dole pozdĺž okraja, alebo stlačte Alt a šípku hore či dole.',
|
|
380
|
+
size: 'Veľkosť',
|
|
381
|
+
sizes: { sm: 'Malá', md: 'Stredná', lg: 'Veľká' },
|
|
382
|
+
techDetails: 'Technické údaje',
|
|
383
|
+
techVersion: 'Verzia',
|
|
384
|
+
techWindow: 'Okno záznamu',
|
|
385
|
+
techCapture: 'Záznam',
|
|
386
|
+
techBuffer: 'Vyrovnávacia pamäť',
|
|
387
|
+
techServer: 'Server',
|
|
388
|
+
captureOn: 'Beží',
|
|
389
|
+
captureOff: 'Vypnutý',
|
|
390
|
+
captureStarting: 'Spúšťa sa…',
|
|
391
|
+
bufferMemory: 'V pamäti',
|
|
392
|
+
bufferBrowser: 'V tomto prehliadači',
|
|
393
|
+
windowLength: (sec) => {
|
|
394
|
+
if (sec < 60)
|
|
395
|
+
return csPlural(sec, '1 sekunda', `${sec} sekundy`, `${sec} sekúnd`);
|
|
396
|
+
const min = Math.round(sec / 60);
|
|
397
|
+
return csPlural(min, '1 minúta', `${min} minúty`, `${min} minút`);
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
const CATALOGS = { cs, en, sk };
|
|
268
401
|
export function strings(locale) {
|
|
269
402
|
return CATALOGS[locale];
|
|
270
403
|
}
|
|
271
|
-
/** `cs`, `cs-CZ`, `CS` → cs; `en-GB` → en; anything else → null. */
|
|
404
|
+
/** `cs`, `cs-CZ`, `CS` → cs; `sk-SK` → sk; `en-GB` → en; anything else → null. */
|
|
272
405
|
export function parseLocale(raw) {
|
|
273
406
|
if (typeof raw !== 'string')
|
|
274
407
|
return null;
|
|
275
408
|
const lang = raw.trim().toLowerCase().split(/[-_]/)[0];
|
|
276
|
-
return lang === 'cs' || lang === 'en' ? lang : null;
|
|
409
|
+
return lang === 'cs' || lang === 'en' || lang === 'sk' ? lang : null;
|
|
277
410
|
}
|
|
278
411
|
/** The first of the browser's languages the widget speaks; English otherwise. */
|
|
279
412
|
export function browserLocale() {
|
package/build/report/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type ReportHandle, type ReportOptions } from './element';
|
|
|
2
2
|
export type { CaptureClass, CaptureNarrowing, CaptureProfile, CaptureStorage } from './profile';
|
|
3
3
|
export type { ReportContext, ReportContextInput, ReportContextValue } from './context';
|
|
4
4
|
export type { Locale } from './i18n';
|
|
5
|
+
export type { EdgeInsets, Launcher } from './edge';
|
|
5
6
|
export type { IdentifyInput, Identity } from './identity';
|
|
6
7
|
export type { Marker, MarkerShape, WireMarker } from './markers';
|
|
7
8
|
export type { ReportEnvelope, SubmitReply } from './wire';
|