Skip to content

Commit

Permalink
Merge branch 'master' into rrweb-canvas
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/rrweb/src/record/observers/canvas/canvas-manager.ts
  • Loading branch information
p-mazhnik committed Apr 5, 2024
2 parents 3ebf87c + 3d1877c commit db60778
Show file tree
Hide file tree
Showing 29 changed files with 403 additions and 156 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-cats-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rrweb': patch
---

fix: createImageBitmap throws DOMException if source is 0 width or height
2 changes: 2 additions & 0 deletions .changeset/light-fireants-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
27 changes: 27 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,91 @@
"changesets": [
"attribute-text-reductions",
"brave-numbers-joke",
"breezy-mice-breathe",
"calm-bulldogs-speak",
"calm-oranges-sin",
"chatty-cherries-train",
"clean-plants-play",
"clean-shrimps-lay",
"cold-eyes-hunt",
"cold-hounds-teach",
"controller-finish-flag",
"cuddly-readers-warn",
"curvy-apples-lay",
"date-now-guard",
"eight-terms-hunt",
"empty-bikes-cheer",
"fair-dragons-greet",
"fast-chefs-smell",
"few-rockets-travel",
"few-turkeys-reflect",
"five-peas-lay",
"fluffy-planes-retire",
"forty-elephants-attack",
"fresh-cars-impress",
"fresh-spoons-drive",
"friendly-numbers-leave",
"gold-apples-joke",
"gold-terms-look",
"grumpy-ways-own",
"hip-worms-relax",
"itchy-dryers-double",
"khaki-dots-bathe",
"large-ants-prove",
"lazy-squids-draw",
"lazy-toes-confess",
"lemon-lamps-switch",
"little-radios-thank",
"little-suits-leave",
"loud-seals-raise",
"lovely-pears-cross",
"lovely-students-boil",
"mean-tips-impress",
"mighty-bulldogs-begin",
"mighty-frogs-sparkle",
"moody-dots-refuse",
"nervous-buses-pump",
"nervous-mirrors-perform",
"nervous-poets-grin",
"nervous-tables-travel",
"new-snakes-call",
"nice-pugs-reply",
"old-dryers-hide",
"polite-olives-wave",
"pretty-plums-rescue",
"pretty-schools-remember",
"proud-experts-jam",
"rare-adults-sneeze",
"real-masks-explode",
"real-trains-switch",
"rich-crews-protect",
"rich-jars-remember",
"rotten-spies-enjoy",
"serious-ants-juggle",
"silver-windows-float",
"sixty-impalas-laugh",
"small-olives-arrive",
"smart-ears-refuse",
"smooth-papayas-boil",
"smooth-poems-bake",
"spotty-bees-destroy",
"stupid-ghosts-help",
"swift-dancers-rest",
"swift-peas-film",
"thin-vans-applaud",
"thirty-baboons-punch",
"tidy-swans-repair",
"tidy-yaks-joke",
"tiny-buckets-love",
"tiny-candles-whisper",
"tiny-chairs-build",
"tricky-panthers-guess",
"twenty-goats-kneel",
"twenty-lies-switch",
"twenty-planets-repeat",
"violet-melons-itch",
"violet-zebras-cry",
"witty-kids-talk",
"yellow-mails-cheat",
"young-timers-grow"
]
Expand Down
7 changes: 7 additions & 0 deletions .changeset/rotten-spies-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'rrweb-snapshot': patch
'rrweb': patch
---

Ensure :hover works on replayer, even if a rule is behind a media query
Respect the intent behind max-device-width and min-device-width media queries so that their effects are apparent in the replayer context
2 changes: 2 additions & 0 deletions .changeset/twenty-goats-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,10 @@ In addition to adding integration tests and unit tests, rrweb also provides a RE
<img style="padding: 8px" alt="Self-hosted website analytics with heatmaps and session recordings." width="195px" src="https://github.com/UXWizz/public-files/raw/main/assets/logo.png">
</a>
</td>
<td align="center">
<a href="https://www.howdygo.com" target="_blank">
<img style="padding: 8px" alt="Interactive product demos for small marketing teams" width="195px" src="https://assets-global.website-files.com/650afb446f1dd5bd410f00cc/650b2cec6188ff54dd9b01e1_Logo.svg">
</a>
</td>
</tr>
</table>
8 changes: 8 additions & 0 deletions packages/rrdom-nodejs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# rrdom-nodejs

## 2.0.0-alpha.12

### Patch Changes

- Updated dependencies [[`58c9104`](https://github.com/rrweb-io/rrweb/commit/58c9104eddc8b7994a067a97daae5684e42f892f), [`a2be77b`](https://github.com/rrweb-io/rrweb/commit/a2be77b82826c4be0e7f3c7c9f7ee50476d5f6f8), [`a7c33f2`](https://github.com/rrweb-io/rrweb/commit/a7c33f2093c4d92faf7ae25e8bb0e088d122c13b), [`8aea5b0`](https://github.com/rrweb-io/rrweb/commit/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81), [`314a8dd`](https://github.com/rrweb-io/rrweb/commit/314a8dde5a13095873b89d07bac7c949918bf817), [`e607e83`](https://github.com/rrweb-io/rrweb/commit/e607e83b21d45131a56c1ff606e9519a5b475fc1), [`7c0dc9d`](https://github.com/rrweb-io/rrweb/commit/7c0dc9dfe1564c9d6624557c5b394e7844955882), [`07ac5c9`](https://github.com/rrweb-io/rrweb/commit/07ac5c9e1371824ec3ffb705f9250bbe10f4b73e)]:
- [email protected]
- [email protected]

## 2.0.0-alpha.11

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/rrdom-nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rrdom-nodejs",
"version": "2.0.0-alpha.11",
"version": "2.0.0-alpha.12",
"scripts": {
"dev": "rollup -c -w",
"bundle": "rollup --config",
Expand Down Expand Up @@ -48,8 +48,8 @@
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
"nwsapi": "^2.2.0",
"rrdom": "^2.0.0-alpha.11",
"rrweb-snapshot": "^2.0.0-alpha.11"
"rrdom": "^2.0.0-alpha.12",
"rrweb-snapshot": "^2.0.0-alpha.12"
},
"browserslist": [
"supports es6-class"
Expand Down
9 changes: 9 additions & 0 deletions packages/rrdom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# rrdom

## 2.0.0-alpha.12

### Patch Changes

- [#1352](https://github.com/rrweb-io/rrweb/pull/1352) [`e607e83`](https://github.com/rrweb-io/rrweb/commit/e607e83b21d45131a56c1ff606e9519a5b475fc1) Thanks [@juliecheng](https://github.com/juliecheng)! - fix: scrolling may not be applied when fast-forwarding

- Updated dependencies [[`58c9104`](https://github.com/rrweb-io/rrweb/commit/58c9104eddc8b7994a067a97daae5684e42f892f), [`a2be77b`](https://github.com/rrweb-io/rrweb/commit/a2be77b82826c4be0e7f3c7c9f7ee50476d5f6f8), [`a7c33f2`](https://github.com/rrweb-io/rrweb/commit/a7c33f2093c4d92faf7ae25e8bb0e088d122c13b), [`8aea5b0`](https://github.com/rrweb-io/rrweb/commit/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81), [`314a8dd`](https://github.com/rrweb-io/rrweb/commit/314a8dde5a13095873b89d07bac7c949918bf817), [`7c0dc9d`](https://github.com/rrweb-io/rrweb/commit/7c0dc9dfe1564c9d6624557c5b394e7844955882), [`07ac5c9`](https://github.com/rrweb-io/rrweb/commit/07ac5c9e1371824ec3ffb705f9250bbe10f4b73e)]:
- [email protected]

## 2.0.0-alpha.11

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/rrdom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rrdom",
"version": "2.0.0-alpha.11",
"version": "2.0.0-alpha.12",
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/rrdom#readme",
"license": "MIT",
"main": "lib/rrdom.cjs",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"@rollup/plugin-commonjs": "^20.0.0",
"@rrweb/types": "^2.0.0-alpha.11",
"@rrweb/types": "^2.0.0-alpha.12",
"@types/jest": "^27.4.1",
"@types/puppeteer": "^5.4.4",
"@typescript-eslint/eslint-plugin": "^5.23.0",
Expand All @@ -47,6 +47,6 @@
"ts-jest": "^27.1.3"
},
"dependencies": {
"rrweb-snapshot": "^2.0.0-alpha.11"
"rrweb-snapshot": "^2.0.0-alpha.12"
}
}
7 changes: 7 additions & 0 deletions packages/rrvideo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# rrvideo

## 2.0.0-alpha.12

### Patch Changes

- Updated dependencies []:
- [email protected]

## 2.0.0-alpha.11

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/rrvideo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rrvideo",
"version": "2.0.0-alpha.11",
"version": "2.0.0-alpha.12",
"description": "transform rrweb session into video",
"main": "build/index.js",
"bin": {
Expand All @@ -26,13 +26,13 @@
"@types/node": "^18.15.11",
"jest": "^27.5.1",
"ts-jest": "^27.1.3",
"@rrweb/types": "^2.0.0-alpha.11"
"@rrweb/types": "^2.0.0-alpha.12"
},
"dependencies": {
"@open-tech-world/cli-progress-bar": "^2.0.2",
"fs-extra": "^11.1.1",
"minimist": "^1.2.5",
"playwright": "^1.32.1",
"rrweb-player": "^2.0.0-alpha.11"
"rrweb-player": "^2.0.0-alpha.12"
}
}
7 changes: 7 additions & 0 deletions packages/rrweb-player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# rrweb-player

## 2.0.0-alpha.12

### Patch Changes

- Updated dependencies [[`af0962c`](https://github.com/rrweb-io/rrweb/commit/af0962cc6c80b693bbc622520032d17342685cf6), [`57a940a`](https://github.com/rrweb-io/rrweb/commit/57a940afac0bdd14cd82937915d53110b5311673), [`8aea5b0`](https://github.com/rrweb-io/rrweb/commit/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81), [`9c6edfe`](https://github.com/rrweb-io/rrweb/commit/9c6edfe2261680b4e92284be69f9d183b1eca8f4), [`1e0b273`](https://github.com/rrweb-io/rrweb/commit/1e0b27382210db0168d2a79d82c13698082b0983), [`1fe39ab`](https://github.com/rrweb-io/rrweb/commit/1fe39ab0db7f5d2b04f4a4f39fb5c0cfee33a1f8), [`05478c3`](https://github.com/rrweb-io/rrweb/commit/05478c36dde03a118099783d908bb3e465e9859c), [`58c9104`](https://github.com/rrweb-io/rrweb/commit/58c9104eddc8b7994a067a97daae5684e42f892f), [`980a38c`](https://github.com/rrweb-io/rrweb/commit/980a38c816d763833fc3491f56d03c959a41122d), [`a2be77b`](https://github.com/rrweb-io/rrweb/commit/a2be77b82826c4be0e7f3c7c9f7ee50476d5f6f8), [`a7c33f2`](https://github.com/rrweb-io/rrweb/commit/a7c33f2093c4d92faf7ae25e8bb0e088d122c13b), [`314a8dd`](https://github.com/rrweb-io/rrweb/commit/314a8dde5a13095873b89d07bac7c949918bf817), [`7c0dc9d`](https://github.com/rrweb-io/rrweb/commit/7c0dc9dfe1564c9d6624557c5b394e7844955882), [`07ac5c9`](https://github.com/rrweb-io/rrweb/commit/07ac5c9e1371824ec3ffb705f9250bbe10f4b73e)]:
- [email protected]

## 2.0.0-alpha.11

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/rrweb-player/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "rrweb-player",
"version": "2.0.0-alpha.11",
"version": "2.0.0-alpha.12",
"devDependencies": {
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"@rrweb/types": "^2.0.0-alpha.11",
"@rrweb/types": "^2.0.0-alpha.12",
"@types/offscreencanvas": "^2019.6.4",
"eslint-config-google": "^0.14.0",
"eslint-plugin-svelte3": "^4.0.0",
Expand All @@ -24,7 +24,7 @@
},
"dependencies": {
"@tsconfig/svelte": "^1.0.0",
"rrweb": "^2.0.0-alpha.11"
"rrweb": "^2.0.0-alpha.12"
},
"scripts": {
"build": "rollup -c",
Expand Down
23 changes: 23 additions & 0 deletions packages/rrweb-snapshot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# rrweb-snapshot

## 2.0.0-alpha.12

### Minor Changes

- [#1310](https://github.com/rrweb-io/rrweb/pull/1310) [`7c0dc9d`](https://github.com/rrweb-io/rrweb/commit/7c0dc9dfe1564c9d6624557c5b394e7844955882) Thanks [@benjackwhite](https://github.com/benjackwhite)! - Extends maskTextFn to pass the HTMLElement to the deciding function

### Patch Changes

- [#1272](https://github.com/rrweb-io/rrweb/pull/1272) [`58c9104`](https://github.com/rrweb-io/rrweb/commit/58c9104eddc8b7994a067a97daae5684e42f892f) Thanks [@eoghanmurray](https://github.com/eoghanmurray)! - Perf: Avoid creation of intermediary array when iterating over style rules

- [#1351](https://github.com/rrweb-io/rrweb/pull/1351) [`a2be77b`](https://github.com/rrweb-io/rrweb/commit/a2be77b82826c4be0e7f3c7c9f7ee50476d5f6f8) Thanks [@eoghanmurray](https://github.com/eoghanmurray)! - Don't double-record the values of <textarea>s when they already have some content prefilled #1301

- [#1431](https://github.com/rrweb-io/rrweb/pull/1431) [`a7c33f2`](https://github.com/rrweb-io/rrweb/commit/a7c33f2093c4d92faf7ae25e8bb0e088d122c13b) Thanks [@eoghanmurray](https://github.com/eoghanmurray)! - Ensure :hover works on replayer, even if a rule is behind a media query
Respect the intent behind max-device-width and min-device-width media queries so that their effects are apparent in the replayer context

- [#1155](https://github.com/rrweb-io/rrweb/pull/1155) [`8aea5b0`](https://github.com/rrweb-io/rrweb/commit/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81) Thanks [@YunFeng0817](https://github.com/YunFeng0817)! - Feat: Add 'isCustom' flag to serialized elements.

This flag is used to indicate whether the element is a custom element or not. This is useful for replaying the :defined pseudo-class of custom elements.

- [#1374](https://github.com/rrweb-io/rrweb/pull/1374) [`314a8dd`](https://github.com/rrweb-io/rrweb/commit/314a8dde5a13095873b89d07bac7c949918bf817) Thanks [@andrewpomeroy](https://github.com/andrewpomeroy)! - Capture stylesheets designated as `rel="preload"`

- [#1349](https://github.com/rrweb-io/rrweb/pull/1349) [`07ac5c9`](https://github.com/rrweb-io/rrweb/commit/07ac5c9e1371824ec3ffb705f9250bbe10f4b73e) Thanks [@eoghanmurray](https://github.com/eoghanmurray)! - Snapshot performance when masking text: Avoid the repeated calls to `closest` when recursing through the DOM

## 2.0.0-alpha.11

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb-snapshot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rrweb-snapshot",
"version": "2.0.0-alpha.11",
"version": "2.0.0-alpha.12",
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",
"scripts": {
"prepare": "npm run prepack",
Expand Down
30 changes: 12 additions & 18 deletions packages/rrweb-snapshot/src/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export interface Node {
};
}

export interface NodeWithRules extends Node {
/** Array of nodes with the types rule, comment and any of the at-rule types. */
rules: Array<Rule | Comment | AtRule>;
}

export interface Rule extends Node {
/** The list of selectors of the rule, split on commas. Each selector is trimmed from whitespace and comments. */
selectors?: string[];
Expand Down Expand Up @@ -98,13 +103,11 @@ export interface CustomMedia extends Node {
/**
* The @document at-rule.
*/
export interface Document extends Node {
export interface Document extends NodeWithRules {
/** The part following @document. */
document?: string;
/** The vendor prefix in @document, or undefined if there is none. */
vendor?: string;
/** Array of nodes with the types rule, comment and any of the at-rule types. */
rules?: Array<Rule | Comment | AtRule>;
}

/**
Expand All @@ -118,10 +121,7 @@ export interface FontFace extends Node {
/**
* The @host at-rule.
*/
export interface Host extends Node {
/** Array of nodes with the types rule, comment and any of the at-rule types. */
rules?: Array<Rule | Comment | AtRule>;
}
export type Host = NodeWithRules;

/**
* The @import at-rule.
Expand Down Expand Up @@ -153,11 +153,9 @@ export interface KeyFrame extends Node {
/**
* The @media at-rule.
*/
export interface Media extends Node {
export interface Media extends NodeWithRules {
/** The part following @media. */
media?: string;
/** Array of nodes with the types rule, comment and any of the at-rule types. */
rules?: Array<Rule | Comment | AtRule>;
}

/**
Expand All @@ -181,11 +179,9 @@ export interface Page extends Node {
/**
* The @supports at-rule.
*/
export interface Supports extends Node {
export interface Supports extends NodeWithRules {
/** The part following @supports. */
supports?: string;
/** Array of nodes with the types rule, comment and any of the at-rule types. */
rules?: Array<Rule | Comment | AtRule>;
}

/** All at-rules. */
Expand All @@ -205,10 +201,8 @@ export type AtRule =
/**
* A collection of rules
*/
export interface StyleRules {
export interface StyleRules extends NodeWithRules {
source?: string;
/** Array of nodes with the types rule, comment and any of the at-rule types. */
rules: Array<Rule | Comment | AtRule>;
/** Array of Errors. Errors collected during parsing when option silent is true. */
parsingErrors?: ParserError[];
}
Expand All @@ -224,7 +218,7 @@ export interface Stylesheet extends Node {
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;

export function parse(css: string, options: ParserOptions = {}) {
export function parse(css: string, options: ParserOptions = {}): Stylesheet {
/**
* Positional.
*/
Expand Down Expand Up @@ -882,7 +876,7 @@ function trim(str: string) {
* Adds non-enumerable parent node reference to each node.
*/

function addParent(obj: Stylesheet, parent?: Stylesheet) {
function addParent(obj: Stylesheet, parent?: Stylesheet): Stylesheet {
const isNode = obj && typeof obj.type === 'string';
const childParent = isNode ? obj : parent;

Expand Down
Loading

0 comments on commit db60778

Please sign in to comment.