Skip to content

Commit

Permalink
Merge branch 'master' into AMP-99342-Regex-Error
Browse files Browse the repository at this point in the history
  • Loading branch information
jxiwang committed Jun 24, 2024
2 parents 25deb6d + 3f77ef2 commit 7ea50cb
Show file tree
Hide file tree
Showing 22 changed files with 213 additions and 80 deletions.
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"octopus-orange",
"popular-spies-fetch",
"rich-dots-lay",
"rotten-spies-enjoy",
"short-masks-cross"
]
}
6 changes: 6 additions & 0 deletions .changeset/rotten-spies-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@amplitude/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
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.16

### Patch Changes

- Updated dependencies []:
- @amplitude/rrweb-snapshot@2.0.0-alpha.16
- @amplitude/rrdom@2.0.0-alpha.16

## 2.0.0-alpha.15

### 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": "@amplitude/rrdom-nodejs",
"version": "2.0.0-alpha.15",
"version": "2.0.0-alpha.16",
"scripts": {
"dev": "rollup -c -w",
"bundle": "rollup --config",
Expand Down Expand Up @@ -45,8 +45,8 @@
"ts-jest": "^27.1.3"
},
"dependencies": {
"@amplitude/rrdom": "^2.0.0-alpha.15",
"@amplitude/rrweb-snapshot": "^2.0.0-alpha.15",
"@amplitude/rrdom": "^2.0.0-alpha.16",
"@amplitude/rrweb-snapshot": "^2.0.0-alpha.16",
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
"nwsapi": "^2.2.0"
Expand Down
7 changes: 7 additions & 0 deletions packages/rrdom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# rrdom

## 2.0.0-alpha.16

### Patch Changes

- Updated dependencies []:
- @amplitude/rrweb-snapshot@2.0.0-alpha.16

## 2.0.0-alpha.15

### 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": "@amplitude/rrdom",
"version": "2.0.0-alpha.15",
"version": "2.0.0-alpha.16",
"homepage": "https://github.com/rrweb-io/rrweb/tree/main/packages/rrdom#readme",
"license": "MIT",
"main": "lib/rrdom.cjs",
Expand Down Expand Up @@ -31,7 +31,7 @@
"url": "https://github.com/rrweb-io/rrweb/issues"
},
"devDependencies": {
"@amplitude/rrweb-types": "^2.0.0-alpha.15",
"@amplitude/rrweb-types": "^2.0.0-alpha.16",
"@rollup/plugin-commonjs": "^20.0.0",
"@types/jest": "^27.4.1",
"@types/puppeteer": "^5.4.4",
Expand All @@ -47,6 +47,6 @@
"ts-jest": "^27.1.3"
},
"dependencies": {
"@amplitude/rrweb-snapshot": "^2.0.0-alpha.15"
"@amplitude/rrweb-snapshot": "^2.0.0-alpha.16"
}
}
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.16

### Patch Changes

- Updated dependencies []:
- @amplitude/rrweb-player@2.0.0-alpha.16

## 2.0.0-alpha.15

### 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": "@amplitude/rrvideo",
"version": "2.0.0-alpha.15",
"version": "2.0.0-alpha.16",
"description": "transform rrweb session into video",
"main": "build/index.js",
"bin": {
Expand All @@ -20,7 +20,7 @@
"author": "Amplitude Inc",
"license": "MIT",
"devDependencies": {
"@amplitude/rrweb": "^2.0.0-alpha.15",
"@amplitude/rrweb": "^2.0.0-alpha.16",
"@types/fs-extra": "11.0.1",
"@types/jest": "^27.4.1",
"@types/minimist": "^1.2.1",
Expand All @@ -29,7 +29,7 @@
"ts-jest": "^27.1.3"
},
"dependencies": {
"@amplitude/rrweb-player": "^2.0.0-alpha.15",
"@amplitude/rrweb-player": "^2.0.0-alpha.16",
"@open-tech-world/cli-progress-bar": "^2.0.2",
"fs-extra": "^11.1.1",
"minimist": "^1.2.5",
Expand Down
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.16

### Patch Changes

- Updated dependencies [[`c7dfd53`](https://github.com/amplitude/rrweb/commit/c7dfd538c59dce2e4c3db4085beb2e2cec9168bf)]:
- @amplitude/rrweb@2.0.0-alpha.16

## 2.0.0-alpha.15

### 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,8 +1,8 @@
{
"name": "@amplitude/rrweb-player",
"version": "2.0.0-alpha.15",
"version": "2.0.0-alpha.16",
"devDependencies": {
"@amplitude/rrweb-types": "^2.0.0-alpha.15",
"@amplitude/rrweb-types": "^2.0.0-alpha.16",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"@types/offscreencanvas": "^2019.6.4",
Expand All @@ -24,7 +24,7 @@
},
"dependencies": {
"@tsconfig/svelte": "^1.0.0",
"@amplitude/rrweb": "^2.0.0-alpha.15"
"@amplitude/rrweb": "^2.0.0-alpha.16"
},
"scripts": {
"build": "rollup -c",
Expand Down
2 changes: 2 additions & 0 deletions packages/rrweb-snapshot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rrweb-snapshot

## 2.0.0-alpha.16

## 2.0.0-alpha.15

## 2.0.0-alpha.14
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": "@amplitude/rrweb-snapshot",
"version": "2.0.0-alpha.15",
"version": "2.0.0-alpha.16",
"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 @@ -942,7 +936,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
4 changes: 2 additions & 2 deletions packages/rrweb-snapshot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import snapshot, {
} from './snapshot';
import rebuild, {
buildNodeWithSN,
addHoverClass,
adaptCssForReplay,
createCache,
} from './rebuild';
export * from './types';
Expand All @@ -22,7 +22,7 @@ export {
serializeNodeWithId,
rebuild,
buildNodeWithSN,
addHoverClass,
adaptCssForReplay,
createCache,
transformAttribute,
ignoreAttribute,
Expand Down
Loading

0 comments on commit 7ea50cb

Please sign in to comment.