@sailfish-ai/recorder 1.12.7 → 1.12.8
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/dist/chunks/{canvasManager-B9uQ-PFS.js → canvasManager-3AzRUaNq.js} +1 -1
- package/dist/chunks/canvasManager-3AzRUaNq.js.br +0 -0
- package/dist/chunks/canvasManager-3AzRUaNq.js.gz +0 -0
- package/dist/chunks/{canvasManager-Ce7vazTt.js → canvasManager-CDEhVz_J.js} +1 -1
- package/dist/chunks/canvasManager-CDEhVz_J.js.br +0 -0
- package/dist/chunks/canvasManager-CDEhVz_J.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-B-z7p0r-.js → chunkSerializer-B3loCr3q.js} +1 -1
- package/dist/chunks/chunkSerializer-B3loCr3q.js.br +0 -0
- package/dist/chunks/chunkSerializer-B3loCr3q.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-C1knjCQ5.js → chunkSerializer-Cz0TPV-B.js} +1 -1
- package/dist/chunks/chunkSerializer-Cz0TPV-B.js.br +0 -0
- package/dist/chunks/chunkSerializer-Cz0TPV-B.js.gz +0 -0
- package/dist/chunks/hoverDetection-Bl-yKKI3.js +137 -0
- package/dist/chunks/hoverDetection-Bl-yKKI3.js.br +0 -0
- package/dist/chunks/hoverDetection-Bl-yKKI3.js.gz +0 -0
- package/dist/chunks/hoverDetection-CYsyBQjj.js +139 -0
- package/dist/chunks/hoverDetection-CYsyBQjj.js.br +0 -0
- package/dist/chunks/hoverDetection-CYsyBQjj.js.gz +0 -0
- package/dist/chunks/{index-BMHQ-0NY.js → index-BUAmLDnY.js} +109 -103
- package/dist/chunks/index-BUAmLDnY.js.br +0 -0
- package/dist/chunks/index-BUAmLDnY.js.gz +0 -0
- package/dist/chunks/{index-qgM1hFXO.js → index-CPZwt1ko.js} +59 -53
- package/dist/chunks/index-CPZwt1ko.js.br +0 -0
- package/dist/chunks/index-CPZwt1ko.js.gz +0 -0
- package/dist/hoverDetection.js +371 -0
- package/dist/hoverDetection.js.br +0 -0
- package/dist/hoverDetection.js.gz +0 -0
- package/dist/hoverDetection.test.js +187 -0
- package/dist/hoverDetection.test.js.br +0 -0
- package/dist/hoverDetection.test.js.gz +0 -0
- package/dist/index.js +8 -0
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/recorder.cjs +1 -1
- package/dist/recorder.cjs.br +0 -0
- package/dist/recorder.cjs.gz +0 -0
- package/dist/recorder.js +1 -1
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +572 -434
- package/dist/recorder.umd.cjs.br +0 -0
- package/dist/recorder.umd.cjs.gz +0 -0
- package/dist/recording.js +27 -0
- package/dist/recording.js.br +0 -0
- package/dist/recording.js.gz +0 -0
- package/dist/types/hoverDetection.d.ts +37 -0
- package/dist/types/hoverDetection.test.d.ts +1 -0
- package/dist/types/types.d.ts +6 -0
- package/package.json +1 -1
- package/dist/chunks/canvasManager-B9uQ-PFS.js.br +0 -0
- package/dist/chunks/canvasManager-B9uQ-PFS.js.gz +0 -0
- package/dist/chunks/canvasManager-Ce7vazTt.js.br +0 -0
- package/dist/chunks/canvasManager-Ce7vazTt.js.gz +0 -0
- package/dist/chunks/chunkSerializer-B-z7p0r-.js.br +0 -0
- package/dist/chunks/chunkSerializer-B-z7p0r-.js.gz +0 -0
- package/dist/chunks/chunkSerializer-C1knjCQ5.js.br +0 -0
- package/dist/chunks/chunkSerializer-C1knjCQ5.js.gz +0 -0
- package/dist/chunks/index-BMHQ-0NY.js.br +0 -0
- package/dist/chunks/index-BMHQ-0NY.js.gz +0 -0
- package/dist/chunks/index-qgM1hFXO.js.br +0 -0
- package/dist/chunks/index-qgM1hFXO.js.gz +0 -0
package/dist/recorder.umd.cjs.br
CHANGED
|
Binary file
|
package/dist/recorder.umd.cjs.gz
CHANGED
|
Binary file
|
package/dist/recording.js
CHANGED
|
@@ -504,6 +504,33 @@ backendApi, apiKey, sessionId, envValue, deferRecordingStart = true, useWsWorker
|
|
|
504
504
|
recordCanvas: false,
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
|
+
// Hover action (DIAGPLAT-1790): rrweb has no native hover, so we detect
|
|
508
|
+
// dwell over hover-affordance elements and emit them (at hover-end, with
|
|
509
|
+
// duration) as SailfishCustom "hover" events. Opt-out via
|
|
510
|
+
// captureSettings.recordHover === false.
|
|
511
|
+
if (captureSettings.recordHover !== false) {
|
|
512
|
+
try {
|
|
513
|
+
const { installHoverDetection } = await import("./hoverDetection");
|
|
514
|
+
const num = (v, d) => typeof v === "number" ? v : d;
|
|
515
|
+
// installHoverDetection is idempotent (one detector per document), but
|
|
516
|
+
// keep its teardown and reclaim the listeners when the page ends so a
|
|
517
|
+
// re-init never stacks duplicate capture-phase handlers.
|
|
518
|
+
const teardownHover = installHoverDetection(record, {
|
|
519
|
+
dwellMs: num(captureSettings.hoverDwellMs, 500),
|
|
520
|
+
// default true: only elements with a genuine hover effect qualify
|
|
521
|
+
strictAffordance: captureSettings.hoverStrictAffordance !== false,
|
|
522
|
+
cooldownMs: num(captureSettings.hoverCooldownMs, 3000),
|
|
523
|
+
maxPerSession: num(captureSettings.hoverMaxPerSession, 300),
|
|
524
|
+
maxPerSecond: num(captureSettings.hoverMaxPerSecond, 1),
|
|
525
|
+
});
|
|
526
|
+
window.addEventListener("pagehide", () => teardownHover(), {
|
|
527
|
+
once: true,
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
catch (hoverError) {
|
|
531
|
+
console.warn("[Sailfish] Failed to enable hover detection:", hoverError);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
507
534
|
// ── Sailfish canvas recording (SFCV pipeline) — opt-in ──────────────
|
|
508
535
|
// Dynamic import keeps the capture core out of the main bundle path.
|
|
509
536
|
if (captureSettings.recordCanvas) {
|
package/dist/recording.js.br
CHANGED
|
Binary file
|
package/dist/recording.js.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Minimal shape of the rrweb record function we depend on. */
|
|
2
|
+
type SailfishRecord = {
|
|
3
|
+
addSailfishEvent?: (type: number, payload: Record<string, unknown>) => void;
|
|
4
|
+
mirror?: {
|
|
5
|
+
getId?: (node: Node) => number;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export interface HoverDetectionOptions {
|
|
9
|
+
/** Dwell (ms) before a hover counts as intentional (≈ tooltip delay). */
|
|
10
|
+
dwellMs: number;
|
|
11
|
+
/** Don't re-emit a hover on the same element within this window (ms). */
|
|
12
|
+
cooldownMs?: number;
|
|
13
|
+
/** Hard ceiling of hover events per session. */
|
|
14
|
+
maxPerSession?: number;
|
|
15
|
+
/** Sustained hover-event rate (events/sec) via a token bucket. */
|
|
16
|
+
maxPerSecond?: number;
|
|
17
|
+
/** Emit (and stop tracking) once a single hover exceeds this duration (ms). */
|
|
18
|
+
maxDwellMs?: number;
|
|
19
|
+
/** How many ancestors to search for an affordance (default 5). */
|
|
20
|
+
maxAncestorDepth?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Strict affordance (default true): an element only counts as "hover-able" if
|
|
23
|
+
* it has a genuine hover effect — a matching `:hover` CSS rule, a tooltip, or
|
|
24
|
+
* a menu/popover trigger. Bare `cursor:pointer` (which most clickable elements
|
|
25
|
+
* set, with no actual hover effect) does NOT qualify. Set false to also treat
|
|
26
|
+
* `cursor:pointer` as a hover affordance (looser, but catches elements whose
|
|
27
|
+
* `:hover` rule lives in an unreadable cross-origin stylesheet).
|
|
28
|
+
*/
|
|
29
|
+
strictAffordance?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Install document-level hover detection. Returns a teardown function. No-op
|
|
33
|
+
* (returns a no-op teardown) outside the browser. Idempotent: a second call
|
|
34
|
+
* tears down the previous install before arming a new one.
|
|
35
|
+
*/
|
|
36
|
+
export declare function installHoverDetection(record: SailfishRecord, options: HoverDetectionOptions): () => void;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -58,6 +58,12 @@ export interface CaptureSettings {
|
|
|
58
58
|
blockSelector?: string;
|
|
59
59
|
unmaskSelector?: string;
|
|
60
60
|
maskInputOptions?: MaskInputOptions;
|
|
61
|
+
recordHover?: boolean;
|
|
62
|
+
hoverDwellMs?: number;
|
|
63
|
+
hoverStrictAffordance?: boolean;
|
|
64
|
+
hoverCooldownMs?: number;
|
|
65
|
+
hoverMaxPerSession?: number;
|
|
66
|
+
hoverMaxPerSecond?: number;
|
|
61
67
|
/**
|
|
62
68
|
* Canvas text masking. `true` redacts drawn text on every recorded canvas;
|
|
63
69
|
* `false` opts out of the mirror-DOM default; unset = mirror-DOM (if DOM text
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|