clarity-js 0.7.48 → 0.7.49
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 +11 -4
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +11 -4
- package/build/clarity.performance.js +1 -1
- package/package.json +1 -1
- package/src/core/version.ts +1 -1
- package/src/interaction/encode.ts +1 -0
- package/src/interaction/pointer.ts +6 -1
- package/types/data.d.ts +1 -1
- package/types/interaction.d.ts +1 -0
|
@@ -37,6 +37,7 @@ export default async function (type: Event, ts: number = null): Promise<void> {
|
|
|
37
37
|
tokens.push(pTarget.id);
|
|
38
38
|
tokens.push(entry.data.x);
|
|
39
39
|
tokens.push(entry.data.y);
|
|
40
|
+
if (entry.data.id !== undefined) { tokens.push(entry.data.id); }
|
|
40
41
|
queue(tokens);
|
|
41
42
|
baseline.track(entry.event, entry.data.x, entry.data.y);
|
|
42
43
|
}
|
|
@@ -58,8 +58,13 @@ function touch(event: Event, root: Node, evt: TouchEvent): void {
|
|
|
58
58
|
x = x && frame ? x + Math.round(frame.offsetLeft) : x;
|
|
59
59
|
y = y && frame ? y + Math.round(frame.offsetTop) : y;
|
|
60
60
|
|
|
61
|
+
// identifier is 0-based, unique for each touch point and resets when all fingers are lifted
|
|
62
|
+
// that is not a part of the spec, but it is how it is implemented in browsers
|
|
63
|
+
// tested in Chromium-based browsers as well as Firefox
|
|
64
|
+
const id = "identifier" in entry ? entry["identifier"] : undefined;
|
|
65
|
+
|
|
61
66
|
// Check for null values before processing this event
|
|
62
|
-
if (x !== null && y !== null) { handler({ time: t, event, data: { target: target(evt), x, y } }); }
|
|
67
|
+
if (x !== null && y !== null) { handler({ time: t, event, data: { target: target(evt), x, y, id } }); }
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
}
|
package/types/data.d.ts
CHANGED
|
@@ -237,7 +237,7 @@ export const enum Setting {
|
|
|
237
237
|
MinUploadDelay = 100, // Minimum time before we are ready to flush events to the server
|
|
238
238
|
MaxUploadDelay = 30 * Time.Second, // Do flush out payload once every 30s,
|
|
239
239
|
ExtractLimit = 10000, // Do not extract more than 10000 characters
|
|
240
|
-
ChecksumPrecision =
|
|
240
|
+
ChecksumPrecision = 28, // n-bit integer to represent token hash
|
|
241
241
|
UploadTimeout = 15000 // Timeout in ms for XHR requests
|
|
242
242
|
}
|
|
243
243
|
|