@highlight-run/rrweb 2.0.1 → 2.0.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/plugins/console-record.js +408 -609
- package/dist/plugins/console-record.min.js +12 -15
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.js +142 -271
- package/dist/plugins/console-replay.min.js +4 -15
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/plugins/sequential-id-record.js +23 -26
- package/dist/plugins/sequential-id-record.min.js +1 -1
- package/dist/plugins/sequential-id-record.min.js.map +1 -1
- package/dist/plugins/sequential-id-replay.js +26 -30
- package/dist/plugins/sequential-id-replay.min.js +1 -1
- package/dist/plugins/sequential-id-replay.min.js.map +1 -1
- package/dist/record/rrweb-record-pack.js +63 -146
- package/dist/record/rrweb-record-pack.min.js +3 -15
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +3002 -3118
- package/dist/record/rrweb-record.min.js +4 -15
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.js +4354 -4054
- package/dist/replay/rrweb-replay-unpack.min.js +5 -17
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.js +4286 -3984
- package/dist/replay/rrweb-replay.min.js +5 -17
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.js +7634 -7453
- package/dist/rrweb-all.min.js +16 -17
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.js +7339 -7075
- package/dist/rrweb.min.js +6 -17
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
- package/es/rrweb/_virtual/image-bitmap-data-url-worker.js +6 -0
- package/es/rrweb/ext/mitt/dist/mitt.es.js +1 -1
- package/es/rrweb/ext/tslib/tslib.es6.js +38 -0
- package/es/rrweb/packages/rrdom/es/virtual-dom.js +1099 -0
- package/es/rrweb/packages/rrweb/src/index.js +6 -4
- package/es/rrweb/packages/rrweb/src/packer/base.js +1 -1
- package/es/rrweb/packages/rrweb/src/packer/pack.js +4 -5
- package/es/rrweb/packages/rrweb/src/packer/unpack.js +24 -24
- package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +175 -176
- package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +109 -128
- package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +125 -138
- package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +88 -105
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +19 -20
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +25 -25
- package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +29 -30
- package/es/rrweb/packages/rrweb/src/record/index.js +348 -373
- package/es/rrweb/packages/rrweb/src/record/mutation.js +487 -528
- package/es/rrweb/packages/rrweb/src/record/observer.js +584 -659
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +44 -73
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +166 -87
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +21 -26
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +119 -112
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +53 -72
- package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +38 -40
- package/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js +31 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +27 -23
- package/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js +67 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +37 -29
- package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +58 -120
- package/es/rrweb/packages/rrweb/src/replay/index.js +1545 -1854
- package/es/rrweb/packages/rrweb/src/replay/machine.js +275 -315
- package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +216 -218
- package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +7 -7
- package/es/rrweb/packages/rrweb/src/replay/timer.js +87 -91
- package/es/rrweb/packages/rrweb/src/types.js +72 -72
- package/es/rrweb/packages/rrweb/src/utils.js +312 -506
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +195 -71
- package/lib/plugins/console-record.js +469 -627
- package/lib/plugins/console-replay.js +198 -268
- package/lib/plugins/sequential-id-record.js +19 -20
- package/lib/plugins/sequential-id-replay.js +25 -25
- package/lib/record/rrweb-record-pack.js +184 -139
- package/lib/record/rrweb-record.js +2473 -2425
- package/lib/replay/rrweb-replay-unpack.js +3797 -3343
- package/lib/replay/rrweb-replay.js +3742 -3288
- package/lib/rrweb-all.js +6725 -6247
- package/lib/rrweb.js +6157 -5632
- package/package.json +14 -13
- package/typings/packer/base.d.ts +1 -1
- package/typings/plugins/console/record/index.d.ts +1 -1
- package/typings/plugins/console/record/stringify.d.ts +1 -1
- package/typings/plugins/sequential-id/record/index.d.ts +1 -1
- package/typings/plugins/sequential-id/replay/index.d.ts +1 -1
- package/typings/record/iframe-manager.d.ts +3 -3
- package/typings/record/index.d.ts +1 -1
- package/typings/record/mutation.d.ts +2 -1
- package/typings/record/observers/canvas/2d.d.ts +2 -1
- package/typings/record/observers/canvas/canvas-manager.d.ts +5 -2
- package/typings/record/observers/canvas/canvas.d.ts +1 -1
- package/typings/record/observers/canvas/serialize-args.d.ts +5 -5
- package/typings/record/observers/canvas/webgl.d.ts +2 -1
- package/typings/record/shadow-dom-manager.d.ts +2 -1
- package/typings/record/stylesheet-manager.d.ts +12 -0
- package/typings/record/workers/image-bitmap-data-url-worker.d.ts +5 -0
- package/typings/replay/canvas/2d.d.ts +3 -3
- package/typings/replay/canvas/deserialize-args.d.ts +7 -0
- package/typings/replay/canvas/index.d.ts +4 -3
- package/typings/replay/canvas/webgl.d.ts +3 -5
- package/typings/replay/index.d.ts +7 -10
- package/typings/types.d.ts +45 -17
- package/typings/utils.d.ts +17 -44
- package/dist/replay/rrweb-replay-unpack.min.css +0 -2
- package/dist/replay/rrweb-replay-unpack.min.css.map +0 -1
- package/dist/replay/rrweb-replay.min.css +0 -2
- package/dist/replay/rrweb-replay.min.css.map +0 -1
- package/dist/rrweb-all.min.css +0 -2
- package/dist/rrweb-all.min.css.map +0 -1
- package/dist/rrweb.min.css +0 -2
- package/dist/rrweb.min.css.map +0 -1
- package/es/rrweb/packages/rrweb/ext/tslib/tslib.es6.js +0 -78
- package/es/rrweb/packages/rrweb/src/replay/virtual-styles.js +0 -121
- package/typings/replay/virtual-styles.d.ts +0 -43
package/dist/rrweb.min.css.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["style.css"],"names":[],"mappings":"AAAA,kBACE,iBACF,CACA,gBACE,iBAAkB,CAClB,UAAW,CACX,WAAY,CACZ,2CAA+C,CAC/C,uBAAwB,CACxB,uBAAkC,CAClC,2BAA4B,CAC5B,0cAAuzB,CACvzB,wBACF,CAEA,sBACE,sBACF,CAEA,6BACE,iCACF,CACA,6BACE,qBAAsB,CACtB,UAAW,CACX,WAAY,CAGZ,kBAAmB,CACnB,iBAAkB,CAClB,gBAAiB,CACjB,kCAAkC,CAClC,oEACF,CACA,0CACE,oBAAkC,CAClC,wEACF,CACA,mCACE,SACF,CACA,0CACE,uCACF,CACA,qBACE,iBAAkB,CAClB,mBACF,CAEA,iBACE,GACE,UAAY,CACZ,UAAW,CACX,WAAY,CACZ,sBACF,CACA,IACE,UAAW,CACX,WAAY,CACZ,UAAY,CACZ,kBACF,CACA,GACE,sBACF,CACF,CAEA,uBACE,GACE,SAAU,CACV,UAAW,CACX,WACF,CACA,IACE,UAAY,CACZ,UAAW,CACX,WACF,CACF","file":"rrweb.min.css","sourcesContent":[".replayer-wrapper {\n position: relative;\n}\n.replayer-mouse {\n position: absolute;\n width: 20px;\n height: 20px;\n transition: left 0.05s linear, top 0.05s linear;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iNyA1IDE4IDE4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAyOCAyOCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgaGVpZ2h0PSIzMDBweCIgd2lkdGg9IjMwMHB4Ij4NCjxwb2x5Z29uIGZpbGw9IiNGRkZGRkYiIHBvaW50cz0iOC4yLDIwLjkgOC4yLDQuOSAxOS44LDE2LjUgMTMsMTYuNSAxMi42LDE2LjYgIi8+DQo8cG9seWdvbiBmaWxsPSIjRkZGRkZGIiBwb2ludHM9IjE3LjMsMjEuNiAxMy43LDIzLjEgOSwxMiAxMi43LDEwLjUgIi8+DQo8cmVjdCB4PSIxMi41IiB5PSIxMy42IiB0cmFuc2Zvcm09Im1hdHJpeCgwLjkyMjEgLTAuMzg3MSAwLjM4NzEgMC45MjIxIC01Ljc2MDUgNi41OTA5KSIgd2lkdGg9IjIiIGhlaWdodD0iOCIvPg0KPHBvbHlnb24gcG9pbnRzPSI5LjIsNy4zIDkuMiwxOC41IDEyLjIsMTUuNiAxMi42LDE1LjUgMTcuNCwxNS41ICIvPg0KPC9zdmc+DQo=');\n border-color: transparent; /* otherwise we transition from black when .touch-device class is added */\n}\n\n.replayer-mouse::after {\n background: transparent;\n}\n\n.replayer-mouse.active::after {\n animation: click 0.2s ease-in-out 1;\n}\n.replayer-mouse.touch-device {\n background-image: none; /* there's no passive cursor on touch-only screens */\n width: 70px;\n height: 70px;\n border-width: 4px;\n border-style: solid;\n border-radius: 100%;\n margin-left: -37px;\n margin-top: -37px;\n border-color: rgba(73, 80, 246, 0);\n transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device.touch-active {\n border-color: rgba(73, 80, 246, 1);\n transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device::after {\n opacity: 0; /* there's no passive cursor on touch-only screens */\n}\n.replayer-mouse.touch-device.active::after {\n animation: touch-click 0.2s ease-in-out 1;\n}\n.replayer-mouse-tail {\n position: absolute;\n pointer-events: none;\n}\n\n@keyframes click {\n 0% {\n opacity: 0.3;\n width: 20px;\n height: 20px;\n background: transparent;\n }\n 75% {\n width: 24px;\n height: 24px;\n opacity: 0.8;\n background: #dc2626;\n }\n 100% {\n background: transparent;\n }\n}\n\n@keyframes touch-click {\n 0% {\n opacity: 0;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n"]}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
|
|
16
|
-
var __assign = function() {
|
|
17
|
-
__assign = Object.assign || function __assign(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
function __rest(s, e) {
|
|
28
|
-
var t = {};
|
|
29
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
-
t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
-
t[p[i]] = s[p[i]];
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function __values(o) {
|
|
40
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
41
|
-
if (m) return m.call(o);
|
|
42
|
-
if (o && typeof o.length === "number") return {
|
|
43
|
-
next: function () {
|
|
44
|
-
if (o && i >= o.length) o = void 0;
|
|
45
|
-
return { value: o && o[i++], done: !o };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function __read(o, n) {
|
|
52
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
53
|
-
if (!m) return o;
|
|
54
|
-
var i = m.call(o), r, ar = [], e;
|
|
55
|
-
try {
|
|
56
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
57
|
-
}
|
|
58
|
-
catch (error) { e = { error: error }; }
|
|
59
|
-
finally {
|
|
60
|
-
try {
|
|
61
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
62
|
-
}
|
|
63
|
-
finally { if (e) throw e.error; }
|
|
64
|
-
}
|
|
65
|
-
return ar;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function __spreadArray(to, from, pack) {
|
|
69
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
70
|
-
if (ar || !(i in from)) {
|
|
71
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
72
|
-
ar[i] = from[i];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export { __assign, __read, __rest, __spreadArray, __values };
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { __spreadArray, __read } from '../../ext/tslib/tslib.es6.js';
|
|
2
|
-
|
|
3
|
-
var StyleRuleType;
|
|
4
|
-
(function (StyleRuleType) {
|
|
5
|
-
StyleRuleType[StyleRuleType["Insert"] = 0] = "Insert";
|
|
6
|
-
StyleRuleType[StyleRuleType["Remove"] = 1] = "Remove";
|
|
7
|
-
StyleRuleType[StyleRuleType["Snapshot"] = 2] = "Snapshot";
|
|
8
|
-
StyleRuleType[StyleRuleType["SetProperty"] = 3] = "SetProperty";
|
|
9
|
-
StyleRuleType[StyleRuleType["RemoveProperty"] = 4] = "RemoveProperty";
|
|
10
|
-
})(StyleRuleType || (StyleRuleType = {}));
|
|
11
|
-
function getNestedRule(rules, position) {
|
|
12
|
-
var rule = rules[position[0]];
|
|
13
|
-
if (position.length === 1) {
|
|
14
|
-
return rule;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
return getNestedRule(rule.cssRules[position[1]]
|
|
18
|
-
.cssRules, position.slice(2));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function getPositionsAndIndex(nestedIndex) {
|
|
22
|
-
var positions = __spreadArray([], __read(nestedIndex), false);
|
|
23
|
-
var index = positions.pop();
|
|
24
|
-
return { positions: positions, index: index };
|
|
25
|
-
}
|
|
26
|
-
function applyVirtualStyleRulesToNode(storedRules, styleNode) {
|
|
27
|
-
var sheet = styleNode.sheet;
|
|
28
|
-
if (!sheet) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
storedRules.forEach(function (rule) {
|
|
32
|
-
if (rule.type === StyleRuleType.Insert) {
|
|
33
|
-
try {
|
|
34
|
-
if (Array.isArray(rule.index)) {
|
|
35
|
-
var _a = getPositionsAndIndex(rule.index), positions = _a.positions, index = _a.index;
|
|
36
|
-
var nestedRule = getNestedRule(sheet.cssRules, positions);
|
|
37
|
-
nestedRule.insertRule(rule.cssText, index);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
sheet.insertRule(rule.cssText, rule.index);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (e) {
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else if (rule.type === StyleRuleType.Remove) {
|
|
47
|
-
try {
|
|
48
|
-
if (Array.isArray(rule.index)) {
|
|
49
|
-
var _b = getPositionsAndIndex(rule.index), positions = _b.positions, index = _b.index;
|
|
50
|
-
var nestedRule = getNestedRule(sheet.cssRules, positions);
|
|
51
|
-
nestedRule.deleteRule(index || 0);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
sheet.deleteRule(rule.index);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
catch (e) {
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else if (rule.type === StyleRuleType.Snapshot) {
|
|
61
|
-
restoreSnapshotOfStyleRulesToNode(rule.cssTexts, styleNode);
|
|
62
|
-
}
|
|
63
|
-
else if (rule.type === StyleRuleType.SetProperty) {
|
|
64
|
-
var nativeRule = getNestedRule(sheet.cssRules, rule.index);
|
|
65
|
-
nativeRule.style.setProperty(rule.property, rule.value, rule.priority);
|
|
66
|
-
}
|
|
67
|
-
else if (rule.type === StyleRuleType.RemoveProperty) {
|
|
68
|
-
var nativeRule = getNestedRule(sheet.cssRules, rule.index);
|
|
69
|
-
nativeRule.style.removeProperty(rule.property);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
function restoreSnapshotOfStyleRulesToNode(cssTexts, styleNode) {
|
|
74
|
-
var _a;
|
|
75
|
-
try {
|
|
76
|
-
var existingRules = Array.from(((_a = styleNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) || []).map(function (rule) { return rule.cssText; });
|
|
77
|
-
var existingRulesReversed = Object.entries(existingRules).reverse();
|
|
78
|
-
var lastMatch_1 = existingRules.length;
|
|
79
|
-
existingRulesReversed.forEach(function (_a) {
|
|
80
|
-
var _b;
|
|
81
|
-
var _c = __read(_a, 2), index = _c[0], rule = _c[1];
|
|
82
|
-
var indexOf = cssTexts.indexOf(rule);
|
|
83
|
-
if (indexOf === -1 || indexOf > lastMatch_1) {
|
|
84
|
-
try {
|
|
85
|
-
(_b = styleNode.sheet) === null || _b === void 0 ? void 0 : _b.deleteRule(Number(index));
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
lastMatch_1 = indexOf;
|
|
91
|
-
});
|
|
92
|
-
cssTexts.forEach(function (cssText, index) {
|
|
93
|
-
var _a, _b, _c;
|
|
94
|
-
try {
|
|
95
|
-
if (((_b = (_a = styleNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules[index]) === null || _b === void 0 ? void 0 : _b.cssText) !== cssText) {
|
|
96
|
-
(_c = styleNode.sheet) === null || _c === void 0 ? void 0 : _c.insertRule(cssText, index);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
catch (e) {
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function storeCSSRules(parentElement, virtualStyleRulesMap) {
|
|
107
|
-
var _a;
|
|
108
|
-
try {
|
|
109
|
-
var cssTexts = Array.from(((_a = parentElement.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) || []).map(function (rule) { return rule.cssText; });
|
|
110
|
-
virtualStyleRulesMap.set(parentElement, [
|
|
111
|
-
{
|
|
112
|
-
type: StyleRuleType.Snapshot,
|
|
113
|
-
cssTexts: cssTexts,
|
|
114
|
-
},
|
|
115
|
-
]);
|
|
116
|
-
}
|
|
117
|
-
catch (e) {
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export { StyleRuleType, applyVirtualStyleRulesToNode, getNestedRule, getPositionsAndIndex, storeCSSRules };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { INode } from '@highlight-run/rrweb-snapshot';
|
|
2
|
-
export declare enum StyleRuleType {
|
|
3
|
-
Insert = 0,
|
|
4
|
-
Remove = 1,
|
|
5
|
-
Snapshot = 2,
|
|
6
|
-
SetProperty = 3,
|
|
7
|
-
RemoveProperty = 4
|
|
8
|
-
}
|
|
9
|
-
declare type InsertRule = {
|
|
10
|
-
cssText: string;
|
|
11
|
-
type: StyleRuleType.Insert;
|
|
12
|
-
index?: number | number[];
|
|
13
|
-
};
|
|
14
|
-
declare type RemoveRule = {
|
|
15
|
-
type: StyleRuleType.Remove;
|
|
16
|
-
index: number | number[];
|
|
17
|
-
};
|
|
18
|
-
declare type SnapshotRule = {
|
|
19
|
-
type: StyleRuleType.Snapshot;
|
|
20
|
-
cssTexts: string[];
|
|
21
|
-
};
|
|
22
|
-
declare type SetPropertyRule = {
|
|
23
|
-
type: StyleRuleType.SetProperty;
|
|
24
|
-
index: number[];
|
|
25
|
-
property: string;
|
|
26
|
-
value: string | null;
|
|
27
|
-
priority: string | undefined;
|
|
28
|
-
};
|
|
29
|
-
declare type RemovePropertyRule = {
|
|
30
|
-
type: StyleRuleType.RemoveProperty;
|
|
31
|
-
index: number[];
|
|
32
|
-
property: string;
|
|
33
|
-
};
|
|
34
|
-
export declare type VirtualStyleRules = Array<InsertRule | RemoveRule | SnapshotRule | SetPropertyRule | RemovePropertyRule>;
|
|
35
|
-
export declare type VirtualStyleRulesMap = Map<INode, VirtualStyleRules>;
|
|
36
|
-
export declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
|
|
37
|
-
export declare function getPositionsAndIndex(nestedIndex: number[]): {
|
|
38
|
-
positions: number[];
|
|
39
|
-
index: number | undefined;
|
|
40
|
-
};
|
|
41
|
-
export declare function applyVirtualStyleRulesToNode(storedRules: VirtualStyleRules, styleNode: HTMLStyleElement): void;
|
|
42
|
-
export declare function storeCSSRules(parentElement: HTMLStyleElement, virtualStyleRulesMap: VirtualStyleRulesMap): void;
|
|
43
|
-
export {};
|