@extn/segi-js 0.2.3 → 0.2.4
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/replay/index.js
CHANGED
|
@@ -367,7 +367,7 @@ async function activateReplay(args) {
|
|
|
367
367
|
setTimeout(onIdle, 5e3);
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
|
-
void Promise.resolve().then(() => _interopRequireWildcard(require("../rrweb-
|
|
370
|
+
void Promise.resolve().then(() => _interopRequireWildcard(require("../rrweb-5RF4GJUU.js"))).then(
|
|
371
371
|
({ startRrweb }) => new Promise((resolve) => {
|
|
372
372
|
scheduleRrwebStart(() => {
|
|
373
373
|
startRrweb({
|
package/dist/replay/index.mjs
CHANGED
|
@@ -367,7 +367,7 @@ async function activateReplay(args) {
|
|
|
367
367
|
setTimeout(onIdle, 5e3);
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
|
-
void import("../rrweb-
|
|
370
|
+
void import("../rrweb-7F2GWQCE.mjs").then(
|
|
371
371
|
({ startRrweb }) => new Promise((resolve) => {
|
|
372
372
|
scheduleRrwebStart(() => {
|
|
373
373
|
startRrweb({
|
|
@@ -17,7 +17,7 @@ async function startRrweb(args) {
|
|
|
17
17
|
let rrweb;
|
|
18
18
|
try {
|
|
19
19
|
rrweb = await Promise.resolve().then(() => _interopRequireWildcard(require("rrweb")));
|
|
20
|
-
} catch (
|
|
20
|
+
} catch (e2) {
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
const maskClass = _nullishCoalesce(_optionalChain([args, 'access', _ => _.options, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.class]), () => ( "segi-mask"));
|
|
@@ -48,13 +48,35 @@ async function startRrweb(args) {
|
|
|
48
48
|
}, IDLE_CHECK_MS);
|
|
49
49
|
function startRecorder() {
|
|
50
50
|
if (stopFn) return;
|
|
51
|
+
let emitCount = 0;
|
|
52
|
+
const log = (...args2) => {
|
|
53
|
+
if (typeof console !== "undefined") {
|
|
54
|
+
console.log("[segi.replay]", ...args2);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
log("startRecorder() called, rrweb keys:", Object.keys(rrweb).slice(0, 12));
|
|
51
58
|
const stop = rrweb.record({
|
|
52
59
|
emit(event) {
|
|
60
|
+
emitCount++;
|
|
61
|
+
const e = event;
|
|
62
|
+
if (emitCount <= 10) {
|
|
63
|
+
log(
|
|
64
|
+
`emit #${emitCount}`,
|
|
65
|
+
"type:",
|
|
66
|
+
e.type,
|
|
67
|
+
"source:",
|
|
68
|
+
_optionalChain([e, 'access', _7 => _7.data, 'optionalAccess', _8 => _8.source]),
|
|
69
|
+
"paused:",
|
|
70
|
+
paused,
|
|
71
|
+
"stopped:",
|
|
72
|
+
stopped
|
|
73
|
+
);
|
|
74
|
+
}
|
|
53
75
|
if (paused || stopped) return;
|
|
54
76
|
buffer.push(event);
|
|
55
77
|
try {
|
|
56
78
|
bufferBytes += JSON.stringify(event).length;
|
|
57
|
-
} catch (
|
|
79
|
+
} catch (e3) {
|
|
58
80
|
}
|
|
59
81
|
if (bufferBytes >= FLUSH_BYTES) flush();
|
|
60
82
|
},
|
|
@@ -69,23 +91,42 @@ async function startRrweb(args) {
|
|
|
69
91
|
maskTextClass: maskClass,
|
|
70
92
|
recordCanvas: false,
|
|
71
93
|
collectFonts: false,
|
|
72
|
-
checkoutEveryNms: CHECKOUT_EVERY_MS
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
inlineStylesheet: true
|
|
94
|
+
checkoutEveryNms: CHECKOUT_EVERY_MS
|
|
95
|
+
// inlineStylesheet intentionally NOT set explicitly; in
|
|
96
|
+
// 2.0.0-alpha.20 the default is `true` but setting it explicitly
|
|
97
|
+
// appears to defer the initial FullSnapshot until all stylesheet
|
|
98
|
+
// fetches complete (or fail). Leaving the default makes rrweb
|
|
99
|
+
// emit the FullSnapshot immediately and inline async-best-effort.
|
|
79
100
|
});
|
|
80
101
|
stopFn = typeof stop === "function" ? stop : null;
|
|
81
|
-
|
|
102
|
+
log(
|
|
103
|
+
"record() returned, stopFn:",
|
|
104
|
+
typeof stop,
|
|
105
|
+
"rrweb.record.takeFullSnapshot:",
|
|
106
|
+
typeof rrweb.record.takeFullSnapshot,
|
|
107
|
+
"rrweb.takeFullSnapshot:",
|
|
108
|
+
typeof rrweb.takeFullSnapshot
|
|
109
|
+
);
|
|
110
|
+
const forceSnapshot = (label) => {
|
|
82
111
|
if (stopped || paused) return;
|
|
83
112
|
try {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
113
|
+
const rrwebMod = rrweb;
|
|
114
|
+
if (typeof rrwebMod.record.takeFullSnapshot === "function") {
|
|
115
|
+
log(`forceSnapshot[${label}] via record.takeFullSnapshot`);
|
|
116
|
+
rrwebMod.record.takeFullSnapshot(true);
|
|
117
|
+
} else if (typeof rrwebMod.takeFullSnapshot === "function") {
|
|
118
|
+
log(`forceSnapshot[${label}] via top-level takeFullSnapshot`);
|
|
119
|
+
rrwebMod.takeFullSnapshot(true);
|
|
120
|
+
} else {
|
|
121
|
+
log(`forceSnapshot[${label}] no takeFullSnapshot found`);
|
|
122
|
+
}
|
|
123
|
+
} catch (err) {
|
|
124
|
+
log(`forceSnapshot[${label}] threw:`, err);
|
|
87
125
|
}
|
|
88
|
-
}
|
|
126
|
+
};
|
|
127
|
+
setTimeout(() => forceSnapshot("100ms"), 100);
|
|
128
|
+
setTimeout(() => forceSnapshot("500ms"), 500);
|
|
129
|
+
setTimeout(() => forceSnapshot("2000ms"), 2e3);
|
|
89
130
|
}
|
|
90
131
|
function stopRrwebOnly() {
|
|
91
132
|
try {
|
|
@@ -48,8 +48,30 @@ async function startRrweb(args) {
|
|
|
48
48
|
}, IDLE_CHECK_MS);
|
|
49
49
|
function startRecorder() {
|
|
50
50
|
if (stopFn) return;
|
|
51
|
+
let emitCount = 0;
|
|
52
|
+
const log = (...args2) => {
|
|
53
|
+
if (typeof console !== "undefined") {
|
|
54
|
+
console.log("[segi.replay]", ...args2);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
log("startRecorder() called, rrweb keys:", Object.keys(rrweb).slice(0, 12));
|
|
51
58
|
const stop = rrweb.record({
|
|
52
59
|
emit(event) {
|
|
60
|
+
emitCount++;
|
|
61
|
+
const e = event;
|
|
62
|
+
if (emitCount <= 10) {
|
|
63
|
+
log(
|
|
64
|
+
`emit #${emitCount}`,
|
|
65
|
+
"type:",
|
|
66
|
+
e.type,
|
|
67
|
+
"source:",
|
|
68
|
+
e.data?.source,
|
|
69
|
+
"paused:",
|
|
70
|
+
paused,
|
|
71
|
+
"stopped:",
|
|
72
|
+
stopped
|
|
73
|
+
);
|
|
74
|
+
}
|
|
53
75
|
if (paused || stopped) return;
|
|
54
76
|
buffer.push(event);
|
|
55
77
|
try {
|
|
@@ -69,23 +91,42 @@ async function startRrweb(args) {
|
|
|
69
91
|
maskTextClass: maskClass,
|
|
70
92
|
recordCanvas: false,
|
|
71
93
|
collectFonts: false,
|
|
72
|
-
checkoutEveryNms: CHECKOUT_EVERY_MS
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
inlineStylesheet: true
|
|
94
|
+
checkoutEveryNms: CHECKOUT_EVERY_MS
|
|
95
|
+
// inlineStylesheet intentionally NOT set explicitly; in
|
|
96
|
+
// 2.0.0-alpha.20 the default is `true` but setting it explicitly
|
|
97
|
+
// appears to defer the initial FullSnapshot until all stylesheet
|
|
98
|
+
// fetches complete (or fail). Leaving the default makes rrweb
|
|
99
|
+
// emit the FullSnapshot immediately and inline async-best-effort.
|
|
79
100
|
});
|
|
80
101
|
stopFn = typeof stop === "function" ? stop : null;
|
|
81
|
-
|
|
102
|
+
log(
|
|
103
|
+
"record() returned, stopFn:",
|
|
104
|
+
typeof stop,
|
|
105
|
+
"rrweb.record.takeFullSnapshot:",
|
|
106
|
+
typeof rrweb.record.takeFullSnapshot,
|
|
107
|
+
"rrweb.takeFullSnapshot:",
|
|
108
|
+
typeof rrweb.takeFullSnapshot
|
|
109
|
+
);
|
|
110
|
+
const forceSnapshot = (label) => {
|
|
82
111
|
if (stopped || paused) return;
|
|
83
112
|
try {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
113
|
+
const rrwebMod = rrweb;
|
|
114
|
+
if (typeof rrwebMod.record.takeFullSnapshot === "function") {
|
|
115
|
+
log(`forceSnapshot[${label}] via record.takeFullSnapshot`);
|
|
116
|
+
rrwebMod.record.takeFullSnapshot(true);
|
|
117
|
+
} else if (typeof rrwebMod.takeFullSnapshot === "function") {
|
|
118
|
+
log(`forceSnapshot[${label}] via top-level takeFullSnapshot`);
|
|
119
|
+
rrwebMod.takeFullSnapshot(true);
|
|
120
|
+
} else {
|
|
121
|
+
log(`forceSnapshot[${label}] no takeFullSnapshot found`);
|
|
122
|
+
}
|
|
123
|
+
} catch (err) {
|
|
124
|
+
log(`forceSnapshot[${label}] threw:`, err);
|
|
87
125
|
}
|
|
88
|
-
}
|
|
126
|
+
};
|
|
127
|
+
setTimeout(() => forceSnapshot("100ms"), 100);
|
|
128
|
+
setTimeout(() => forceSnapshot("500ms"), 500);
|
|
129
|
+
setTimeout(() => forceSnapshot("2000ms"), 2e3);
|
|
89
130
|
}
|
|
90
131
|
function stopRrwebOnly() {
|
|
91
132
|
try {
|