clarity-js 0.7.31 → 0.7.33
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/build/clarity.extended.js +1 -1
- package/build/clarity.insight.js +1 -1
- package/build/clarity.js +73 -39
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +73 -39
- package/build/clarity.performance.js +1 -1
- package/package.json +1 -1
- package/src/core/config.ts +2 -1
- package/src/core/time.ts +7 -2
- package/src/core/version.ts +1 -1
- package/src/interaction/encode.ts +6 -2
- package/src/interaction/scroll.ts +30 -8
- package/src/layout/discover.ts +2 -1
- package/src/layout/encode.ts +4 -2
- package/src/layout/index.ts +2 -0
- package/src/layout/mutation.ts +4 -2
- package/src/layout/node.ts +1 -1
- package/types/core.d.ts +1 -0
- package/types/data.d.ts +3 -1
- package/types/interaction.d.ts +2 -2
package/src/layout/mutation.ts
CHANGED
|
@@ -17,6 +17,7 @@ import encode from "@src/layout/encode";
|
|
|
17
17
|
import * as region from "@src/layout/region";
|
|
18
18
|
import traverse from "@src/layout/traverse";
|
|
19
19
|
import processNode from "./node";
|
|
20
|
+
import config from "@src/core/config";
|
|
20
21
|
|
|
21
22
|
let observers: MutationObserver[] = [];
|
|
22
23
|
let mutations: MutationQueue[] = [];
|
|
@@ -129,7 +130,7 @@ async function process(): Promise<void> {
|
|
|
129
130
|
if (state === Task.Wait) { state = await task.suspend(timer); }
|
|
130
131
|
if (state === Task.Stop) { break; }
|
|
131
132
|
let target = mutation.target;
|
|
132
|
-
let type = track(mutation, timer, instance, record.time);
|
|
133
|
+
let type = config.throttleDom ? track(mutation, timer, instance, record.time) : mutation.type;
|
|
133
134
|
if (type && target && target.ownerDocument) { dom.parse(target.ownerDocument); }
|
|
134
135
|
if (type && target && target.nodeType == Node.DOCUMENT_FRAGMENT_NODE && (target as ShadowRoot).host) { dom.parse(target as ShadowRoot); }
|
|
135
136
|
switch (type) {
|
|
@@ -160,7 +161,8 @@ function track(m: MutationRecord, timer: Timer, instance: number, timestamp: num
|
|
|
160
161
|
let value = m.target ? dom.get(m.target.parentNode) : null;
|
|
161
162
|
// Check if the parent is already discovered and that the parent is not the document root
|
|
162
163
|
if (value && value.data.tag !== Constant.HTML) {
|
|
163
|
-
|
|
164
|
+
// calculate inactive period based on the timestamp of the mutation not when the mutation is processed
|
|
165
|
+
let inactive = timestamp > activePeriod;
|
|
164
166
|
let target = dom.get(m.target);
|
|
165
167
|
let element = target && target.selector ? target.selector.join() : m.target.nodeName;
|
|
166
168
|
let parent = value.selector ? value.selector.join() : Constant.Empty;
|
package/src/layout/node.ts
CHANGED
|
@@ -9,7 +9,7 @@ import * as schema from "@src/layout/schema";
|
|
|
9
9
|
import { checkDocumentStyles } from "@src/layout/style";
|
|
10
10
|
import { electron } from "@src/data/metadata";
|
|
11
11
|
|
|
12
|
-
const IGNORE_ATTRIBUTES = ["title", "alt", "onload", "onfocus", "onerror", "data-drupal-form-submit-last"];
|
|
12
|
+
const IGNORE_ATTRIBUTES = ["title", "alt", "onload", "onfocus", "onerror", "data-drupal-form-submit-last", "aria-label"];
|
|
13
13
|
const newlineRegex = /[\r\n]+/g;
|
|
14
14
|
|
|
15
15
|
export default function (node: Node, source: Source, timestamp: number): Node {
|
package/types/core.d.ts
CHANGED
package/types/data.d.ts
CHANGED
|
@@ -145,7 +145,9 @@ export const enum Dimension {
|
|
|
145
145
|
ConnectionType = 27,
|
|
146
146
|
Dob = 28,
|
|
147
147
|
CookieVersion = 29,
|
|
148
|
-
DeviceFamily = 30 // Allows iOS SDK to override the DeviceFamily value parsed from UserAgent.
|
|
148
|
+
DeviceFamily = 30, // Allows iOS SDK to override the DeviceFamily value parsed from UserAgent.
|
|
149
|
+
InitialScrollTop = 31,
|
|
150
|
+
InitialScrollBottom = 32
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
export const enum Check {
|
package/types/interaction.d.ts
CHANGED