@highlight-run/rrweb 2.1.9 → 2.1.10

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.
@@ -1644,6 +1644,22 @@ function createCache() {
1644
1644
  stylesWithHoverClass: stylesWithHoverClass
1645
1645
  };
1646
1646
  }
1647
+ function sortAttributes(attributes) {
1648
+ return Object.keys(attributes)
1649
+ .sort(function (a, b) {
1650
+ if (a.startsWith('rr_') && !b.startsWith('rr_')) {
1651
+ return 1;
1652
+ }
1653
+ if (b.startsWith('rr_') && !a.startsWith('rr_')) {
1654
+ return -1;
1655
+ }
1656
+ return 0;
1657
+ })
1658
+ .reduce(function (acc, key) {
1659
+ acc[key] = attributes[key];
1660
+ return acc;
1661
+ }, {});
1662
+ }
1647
1663
  function buildNode(n, options) {
1648
1664
  var doc = options.doc, hackCss = options.hackCss, cache = options.cache;
1649
1665
  switch (n.type) {
@@ -1790,7 +1806,7 @@ function buildNode(n, options) {
1790
1806
  }
1791
1807
  }
1792
1808
  };
1793
- for (var name_1 in n.attributes) {
1809
+ for (var name_1 in sortAttributes(n.attributes)) {
1794
1810
  _loop_1(name_1);
1795
1811
  }
1796
1812
  if (tagName === 'img') {
@@ -633,6 +633,22 @@ function createCache() {
633
633
  stylesWithHoverClass: stylesWithHoverClass
634
634
  };
635
635
  }
636
+ function sortAttributes(attributes) {
637
+ return Object.keys(attributes)
638
+ .sort(function (a, b) {
639
+ if (a.startsWith('rr_') && !b.startsWith('rr_')) {
640
+ return 1;
641
+ }
642
+ if (b.startsWith('rr_') && !a.startsWith('rr_')) {
643
+ return -1;
644
+ }
645
+ return 0;
646
+ })
647
+ .reduce(function (acc, key) {
648
+ acc[key] = attributes[key];
649
+ return acc;
650
+ }, {});
651
+ }
636
652
  function buildNode(n, options) {
637
653
  var doc = options.doc, hackCss = options.hackCss, cache = options.cache;
638
654
  switch (n.type) {
@@ -779,7 +795,7 @@ function buildNode(n, options) {
779
795
  }
780
796
  }
781
797
  };
782
- for (var name_1 in n.attributes) {
798
+ for (var name_1 in sortAttributes(n.attributes)) {
783
799
  _loop_1(name_1);
784
800
  }
785
801
  if (tagName === 'img') {
@@ -633,6 +633,22 @@ function createCache() {
633
633
  stylesWithHoverClass: stylesWithHoverClass
634
634
  };
635
635
  }
636
+ function sortAttributes(attributes) {
637
+ return Object.keys(attributes)
638
+ .sort(function (a, b) {
639
+ if (a.startsWith('rr_') && !b.startsWith('rr_')) {
640
+ return 1;
641
+ }
642
+ if (b.startsWith('rr_') && !a.startsWith('rr_')) {
643
+ return -1;
644
+ }
645
+ return 0;
646
+ })
647
+ .reduce(function (acc, key) {
648
+ acc[key] = attributes[key];
649
+ return acc;
650
+ }, {});
651
+ }
636
652
  function buildNode(n, options) {
637
653
  var doc = options.doc, hackCss = options.hackCss, cache = options.cache;
638
654
  switch (n.type) {
@@ -779,7 +795,7 @@ function buildNode(n, options) {
779
795
  }
780
796
  }
781
797
  };
782
- for (var name_1 in n.attributes) {
798
+ for (var name_1 in sortAttributes(n.attributes)) {
783
799
  _loop_1(name_1);
784
800
  }
785
801
  if (tagName === 'img') {
package/lib/rrweb-all.js CHANGED
@@ -1648,6 +1648,22 @@ function createCache() {
1648
1648
  stylesWithHoverClass: stylesWithHoverClass
1649
1649
  };
1650
1650
  }
1651
+ function sortAttributes(attributes) {
1652
+ return Object.keys(attributes)
1653
+ .sort(function (a, b) {
1654
+ if (a.startsWith('rr_') && !b.startsWith('rr_')) {
1655
+ return 1;
1656
+ }
1657
+ if (b.startsWith('rr_') && !a.startsWith('rr_')) {
1658
+ return -1;
1659
+ }
1660
+ return 0;
1661
+ })
1662
+ .reduce(function (acc, key) {
1663
+ acc[key] = attributes[key];
1664
+ return acc;
1665
+ }, {});
1666
+ }
1651
1667
  function buildNode(n, options) {
1652
1668
  var doc = options.doc, hackCss = options.hackCss, cache = options.cache;
1653
1669
  switch (n.type) {
@@ -1794,7 +1810,7 @@ function buildNode(n, options) {
1794
1810
  }
1795
1811
  }
1796
1812
  };
1797
- for (var name_1 in n.attributes) {
1813
+ for (var name_1 in sortAttributes(n.attributes)) {
1798
1814
  _loop_1(name_1);
1799
1815
  }
1800
1816
  if (tagName === 'img') {
package/lib/rrweb.js CHANGED
@@ -1648,6 +1648,22 @@ function createCache() {
1648
1648
  stylesWithHoverClass: stylesWithHoverClass
1649
1649
  };
1650
1650
  }
1651
+ function sortAttributes(attributes) {
1652
+ return Object.keys(attributes)
1653
+ .sort(function (a, b) {
1654
+ if (a.startsWith('rr_') && !b.startsWith('rr_')) {
1655
+ return 1;
1656
+ }
1657
+ if (b.startsWith('rr_') && !a.startsWith('rr_')) {
1658
+ return -1;
1659
+ }
1660
+ return 0;
1661
+ })
1662
+ .reduce(function (acc, key) {
1663
+ acc[key] = attributes[key];
1664
+ return acc;
1665
+ }, {});
1666
+ }
1651
1667
  function buildNode(n, options) {
1652
1668
  var doc = options.doc, hackCss = options.hackCss, cache = options.cache;
1653
1669
  switch (n.type) {
@@ -1794,7 +1810,7 @@ function buildNode(n, options) {
1794
1810
  }
1795
1811
  }
1796
1812
  };
1797
- for (var name_1 in n.attributes) {
1813
+ for (var name_1 in sortAttributes(n.attributes)) {
1798
1814
  _loop_1(name_1);
1799
1815
  }
1800
1816
  if (tagName === 'img') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highlight-run/rrweb",
3
- "version": "2.1.9",
3
+ "version": "2.1.10",
4
4
  "description": "record and replay the web",
5
5
  "scripts": {
6
6
  "prepare": "npm run prepack",
@@ -76,12 +76,12 @@
76
76
  },
77
77
  "dependencies": {
78
78
  "@highlight-run/rrdom": "0.1.17",
79
- "@highlight-run/rrweb-snapshot": "1.1.30",
79
+ "@highlight-run/rrweb-snapshot": "1.1.31",
80
80
  "@types/css-font-loading-module": "0.0.7",
81
81
  "@xstate/fsm": "^1.4.0",
82
82
  "base64-arraybuffer": "^1.0.1",
83
83
  "fflate": "^0.4.4",
84
84
  "mitt": "^3.0.0"
85
85
  },
86
- "gitHead": "862976e2da5287c2cbf540b0b6ac4de9242966d9"
86
+ "gitHead": "e57f041a4b6e36d0167a2a135397308993b93074"
87
87
  }