update dependencies

In this commit, we updated rrweb-snapshot to 0.6.0 which including
a breaking change in data structure.
This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 8567114688
commit fdcf1d0bb2
2 changed files with 6 additions and 6 deletions

View File

@@ -44,10 +44,10 @@
"ts-node": "^7.0.1", "ts-node": "^7.0.1",
"tslib": "^1.9.3", "tslib": "^1.9.3",
"tslint": "^4.5.1", "tslint": "^4.5.1",
"typescript": "^3.1.1" "typescript": "^3.1.6"
}, },
"dependencies": { "dependencies": {
"mitt": "^1.1.3", "mitt": "^1.1.3",
"rrweb-snapshot": "^0.5.6" "rrweb-snapshot": "^0.6.0"
} }
} }

View File

@@ -132,14 +132,14 @@ function initMutationObserver(cb: mutationCallBack): MutationObserver {
}); });
Array.from(addsSet).forEach(n => { Array.from(addsSet).forEach(n => {
const parentId = mirror.getId(n.parentNode as INode); const parentId = mirror.getId((n.parentNode as Node) as INode);
if ( if (
parentId && parentId &&
!dropped.some(d => d === n.parentNode) && !dropped.some(d => d === n.parentNode) &&
!removes.some(r => r.id === parentId) !removes.some(r => r.id === parentId)
) { ) {
adds.push({ adds.push({
parentId: mirror.getId(n.parentNode as INode), parentId: mirror.getId((n.parentNode as Node) as INode),
previousId: !n.previousSibling previousId: !n.previousSibling
? n.previousSibling ? n.previousSibling
: mirror.getId(n.previousSibling as INode), : mirror.getId(n.previousSibling as INode),
@@ -256,8 +256,8 @@ function initScrollObserver(cb: scrollCallback): listenerHandler {
if (evt.target === document) { if (evt.target === document) {
cb({ cb({
id, id,
x: document.documentElement.scrollLeft, x: document.documentElement!.scrollLeft,
y: document.documentElement.scrollTop, y: document.documentElement!.scrollTop,
}); });
} else { } else {
cb({ cb({