mirror of
https://github.com/chenasraf/clarity.git
synced 2026-05-18 01:48:58 +00:00
Merge pull request #618 from microsoft/samart/conversions
Conversion config supporting click text reporting
This commit is contained in:
@@ -20,7 +20,8 @@ let config: Config = {
|
||||
action: null,
|
||||
dob: null,
|
||||
delayDom: false,
|
||||
throttleDom: true
|
||||
throttleDom: true,
|
||||
conversions: false,
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Constant, NodeInfo, NodeValue, TargetMetadata } from "@clarity-types/la
|
||||
import * as doc from "@src/layout/document";
|
||||
import encode from "@src/insight/encode";
|
||||
import * as interaction from "@src/interaction";
|
||||
import config from "@src/core/config";
|
||||
export let values: NodeValue[] = [];
|
||||
let index: number = 1;
|
||||
let idMap: WeakMap<Node, number> = null; // Maps node => id.
|
||||
@@ -32,7 +33,7 @@ export function target(evt: UIEvent): Node {
|
||||
}
|
||||
|
||||
export function metadata(node: Node): TargetMetadata {
|
||||
let output: TargetMetadata = { id: 0, hash: null, privacy: Privacy.Snapshot, node };
|
||||
let output: TargetMetadata = { id: 0, hash: null, privacy: config.conversions ? Privacy.Text : Privacy.Snapshot, node };
|
||||
if (node) { output.id = idMap.has(node) ? idMap.get(node) : getId(node); }
|
||||
return output;
|
||||
}
|
||||
|
||||
1
packages/clarity-js/types/core.d.ts
vendored
1
packages/clarity-js/types/core.d.ts
vendored
@@ -139,6 +139,7 @@ export interface Config {
|
||||
dob?: number;
|
||||
delayDom?: boolean;
|
||||
throttleDom?: boolean;
|
||||
conversions?: boolean;
|
||||
}
|
||||
|
||||
export const enum Constant {
|
||||
|
||||
Reference in New Issue
Block a user