@posthog/rrweb 0.0.41 → 0.0.43
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/{image-bitmap-data-url-worker-IJpC7g_b.js.map → image-bitmap-data-url-worker-DqRH07Di.js.map} +1 -1
- package/dist/rrweb.cjs +12 -1
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.d.cts +6 -0
- package/dist/rrweb.d.ts +6 -0
- package/dist/rrweb.js +13 -2
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +12 -1
- package/dist/rrweb.umd.cjs.map +4 -4
- package/dist/rrweb.umd.min.cjs +21 -20
- package/dist/rrweb.umd.min.cjs.map +4 -4
- package/package.json +5 -5
package/dist/rrweb.umd.cjs
CHANGED
|
@@ -1183,6 +1183,14 @@ function slimDOMExcluded(sn, slimDOMOptions) {
|
|
|
1183
1183
|
}
|
|
1184
1184
|
const DEFAULT_MAX_DEPTH = 50;
|
|
1185
1185
|
let _maxDepthWarned = false;
|
|
1186
|
+
let _maxDepthReached = false;
|
|
1187
|
+
function wasMaxDepthReached() {
|
|
1188
|
+
return _maxDepthReached;
|
|
1189
|
+
}
|
|
1190
|
+
function resetMaxDepthState() {
|
|
1191
|
+
_maxDepthReached = false;
|
|
1192
|
+
_maxDepthWarned = false;
|
|
1193
|
+
}
|
|
1186
1194
|
function serializeNodeWithId(n2, options) {
|
|
1187
1195
|
const {
|
|
1188
1196
|
doc,
|
|
@@ -1213,6 +1221,7 @@ function serializeNodeWithId(n2, options) {
|
|
|
1213
1221
|
let { needsMask } = options;
|
|
1214
1222
|
let { preserveWhiteSpace = true } = options;
|
|
1215
1223
|
if (depth >= maxDepth) {
|
|
1224
|
+
_maxDepthReached = true;
|
|
1216
1225
|
if (!_maxDepthWarned) {
|
|
1217
1226
|
_maxDepthWarned = true;
|
|
1218
1227
|
console.warn(
|
|
@@ -14409,7 +14418,7 @@ function initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, dat
|
|
|
14409
14418
|
handlers.forEach((h) => h());
|
|
14410
14419
|
};
|
|
14411
14420
|
}
|
|
14412
|
-
const jsContent = '(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-
|
|
14421
|
+
const jsContent = '(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-DqRH07Di.js.map\n';
|
|
14413
14422
|
const blob = typeof self !== "undefined" && self.Blob && new Blob([jsContent], { type: "text/javascript;charset=utf-8" });
|
|
14414
14423
|
function WorkerWrapper(options) {
|
|
14415
14424
|
let objURL;
|
|
@@ -18181,8 +18190,10 @@ exports.addCustomEvent = addCustomEvent;
|
|
|
18181
18190
|
exports.canvasMutation = canvasMutation;
|
|
18182
18191
|
exports.freezePage = freezePage;
|
|
18183
18192
|
exports.record = record;
|
|
18193
|
+
exports.resetMaxDepthState = resetMaxDepthState;
|
|
18184
18194
|
exports.takeFullSnapshot = takeFullSnapshot;
|
|
18185
18195
|
exports.utils = utils;
|
|
18196
|
+
exports.wasMaxDepthReached = wasMaxDepthReached;
|
|
18186
18197
|
;if (typeof module.exports == "object" && typeof exports == "object") {
|
|
18187
18198
|
var __cp = (to, from, except, desc) => {
|
|
18188
18199
|
if ((from && typeof from === "object") || typeof from === "function") {
|