@microsoft/applicationinsights-clickanalytics-js 2.8.0-beta.2203-10 → 2.8.0-beta.2203-11
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/browser/{ai.clck.2.8.0-beta.2203-10.cjs.js → ai.clck.2.8.0-beta.2203-11.cjs.js} +688 -514
- package/browser/ai.clck.2.8.0-beta.2203-11.cjs.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-11.cjs.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-11.cjs.min.js.map +1 -0
- package/browser/{ai.clck.2.8.0-beta.2203-10.gbl.js → ai.clck.2.8.0-beta.2203-11.gbl.js} +688 -514
- package/browser/ai.clck.2.8.0-beta.2203-11.gbl.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-11.gbl.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-11.gbl.min.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-11.integrity.json +66 -0
- package/browser/{ai.clck.2.8.0-beta.2203-10.js → ai.clck.2.8.0-beta.2203-11.js} +688 -514
- package/browser/ai.clck.2.8.0-beta.2203-11.js.map +1 -0
- package/browser/ai.clck.2.8.0-beta.2203-11.min.js +6 -0
- package/browser/ai.clck.2.8.0-beta.2203-11.min.js.map +1 -0
- package/browser/ai.clck.2.cjs.js +687 -513
- package/browser/ai.clck.2.cjs.js.map +1 -1
- package/browser/ai.clck.2.cjs.min.js +2 -2
- package/browser/ai.clck.2.cjs.min.js.map +1 -1
- package/browser/ai.clck.2.gbl.js +687 -513
- package/browser/ai.clck.2.gbl.js.map +1 -1
- package/browser/ai.clck.2.gbl.min.js +2 -2
- package/browser/ai.clck.2.gbl.min.js.map +1 -1
- package/browser/ai.clck.2.js +687 -513
- package/browser/ai.clck.2.js.map +1 -1
- package/browser/ai.clck.2.min.js +2 -2
- package/browser/ai.clck.2.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.api.json +15 -1
- package/dist/applicationinsights-clickanalytics-js.api.md +1 -0
- package/dist/applicationinsights-clickanalytics-js.d.ts +2 -5
- package/dist/applicationinsights-clickanalytics-js.js +687 -513
- package/dist/applicationinsights-clickanalytics-js.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.min.js +2 -2
- package/dist/applicationinsights-clickanalytics-js.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.rollup.d.ts +2 -5
- package/dist-esm/Behaviours.js +1 -1
- package/dist-esm/ClickAnalyticsPlugin.js +74 -50
- package/dist-esm/ClickAnalyticsPlugin.js.map +1 -1
- package/dist-esm/DataCollector.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/Interfaces/Datamodel.js +1 -1
- package/dist-esm/applicationinsights-clickanalytics-js.js +1 -1
- package/dist-esm/common/Utils.js +1 -1
- package/dist-esm/events/PageAction.js +128 -128
- package/dist-esm/events/PageAction.js.map +1 -1
- package/dist-esm/events/WebEvent.js +109 -94
- package/dist-esm/events/WebEvent.js.map +1 -1
- package/dist-esm/handlers/AutoCaptureHandler.js +85 -91
- package/dist-esm/handlers/AutoCaptureHandler.js.map +1 -1
- package/dist-esm/handlers/DomContentHandler.js +279 -280
- package/dist-esm/handlers/DomContentHandler.js.map +1 -1
- package/package.json +5 -5
- package/src/ClickAnalyticsPlugin.ts +91 -46
- package/src/Interfaces/Datamodel.ts +17 -18
- package/src/events/PageAction.ts +165 -134
- package/src/events/WebEvent.ts +147 -77
- package/src/handlers/AutoCaptureHandler.ts +88 -86
- package/src/handlers/DomContentHandler.ts +336 -310
- package/types/ClickAnalyticsPlugin.d.ts +1 -4
- package/types/Interfaces/Datamodel.d.ts +7 -6
- package/types/events/PageAction.d.ts +6 -6
- package/types/events/WebEvent.d.ts +17 -17
- package/types/handlers/AutoCaptureHandler.d.ts +2 -10
- package/types/handlers/DomContentHandler.d.ts +3 -50
- package/types/tsdoc-metadata.json +1 -1
- package/browser/ai.clck.2.8.0-beta.2203-10.cjs.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-10.cjs.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2203-10.cjs.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-10.gbl.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-10.gbl.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2203-10.gbl.min.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-10.integrity.json +0 -66
- package/browser/ai.clck.2.8.0-beta.2203-10.js.map +0 -1
- package/browser/ai.clck.2.8.0-beta.2203-10.min.js +0 -6
- package/browser/ai.clck.2.8.0-beta.2203-10.min.js.map +0 -1
|
@@ -10,10 +10,7 @@ export declare class ClickAnalyticsPlugin extends BaseTelemetryPlugin {
|
|
|
10
10
|
identifier: string;
|
|
11
11
|
priority: number;
|
|
12
12
|
static Version: string;
|
|
13
|
-
|
|
14
|
-
private pageAction;
|
|
15
|
-
private _autoCaptureHandler;
|
|
16
|
-
private _contentHandler;
|
|
13
|
+
constructor();
|
|
17
14
|
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
18
15
|
processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
19
16
|
/**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @copyright Microsoft 2020
|
|
3
3
|
*/
|
|
4
4
|
import { IEventTelemetry } from "@microsoft/applicationinsights-common";
|
|
5
|
+
import { IUnloadableComponent } from "@microsoft/applicationinsights-core-js";
|
|
5
6
|
/**
|
|
6
7
|
* ClickAnalytics Configuration
|
|
7
8
|
*/
|
|
@@ -132,7 +133,7 @@ export interface IPageTags {
|
|
|
132
133
|
/**
|
|
133
134
|
* Auto capture handler interface
|
|
134
135
|
*/
|
|
135
|
-
export interface IAutoCaptureHandler {
|
|
136
|
+
export interface IAutoCaptureHandler extends IUnloadableComponent {
|
|
136
137
|
/**
|
|
137
138
|
* Auto capture click
|
|
138
139
|
*/
|
|
@@ -169,8 +170,8 @@ export interface IPageActionOverrideValues extends IOverrideValues {
|
|
|
169
170
|
contentTags?: any;
|
|
170
171
|
}
|
|
171
172
|
/**
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
* Override values interface
|
|
174
|
+
*/
|
|
174
175
|
export interface IOverrideValues {
|
|
175
176
|
/**
|
|
176
177
|
* One of the awa.behavior values.
|
|
@@ -213,9 +214,9 @@ export interface IContent {
|
|
|
213
214
|
[name: string]: string | number | boolean | string[] | number[] | boolean[] | object | undefined;
|
|
214
215
|
}
|
|
215
216
|
/**
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
export interface IContentHandler {
|
|
217
|
+
* Content handler interface
|
|
218
|
+
*/
|
|
219
|
+
export interface IContentHandler extends IUnloadableComponent {
|
|
219
220
|
/**
|
|
220
221
|
* Get meta data
|
|
221
222
|
*/
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
* @copyright Microsoft 2020
|
|
3
3
|
*/
|
|
4
4
|
import { WebEvent } from "./WebEvent";
|
|
5
|
-
import { ICustomProperties } from "@microsoft/applicationinsights-core-js";
|
|
6
|
-
import { IPageActionOverrideValues, IPageActionTelemetry } from "../Interfaces/Datamodel";
|
|
5
|
+
import { ICustomProperties, IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
6
|
+
import { IClickAnalyticsConfiguration, IContentHandler, IPageActionOverrideValues, IPageActionTelemetry } from "../Interfaces/Datamodel";
|
|
7
|
+
import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin";
|
|
7
8
|
export declare class PageAction extends WebEvent {
|
|
9
|
+
constructor(clickAnalyticsPlugin: ClickAnalyticsPlugin, config: IClickAnalyticsConfiguration, contentHandler: IContentHandler, pageTagsCallback: any, metaTags: {
|
|
10
|
+
[name: string]: string;
|
|
11
|
+
}, traceLogger: IDiagnosticLogger);
|
|
8
12
|
/**
|
|
9
13
|
* API to send pageAction event
|
|
10
14
|
* @param pageActionEvent - PageAction event
|
|
@@ -21,8 +25,4 @@ export declare class PageAction extends WebEvent {
|
|
|
21
25
|
capturePageAction(element: Element, overrideValues?: IPageActionOverrideValues, customProperties?: {
|
|
22
26
|
[name: string]: string | number | boolean | string[] | number[] | boolean[] | object;
|
|
23
27
|
}, isRightClick?: boolean): void;
|
|
24
|
-
private _getTimeToClick;
|
|
25
|
-
private _populateEventDataIfPresent;
|
|
26
|
-
private _sanitizePageActionEventContent;
|
|
27
|
-
private _isUndefinedEvent;
|
|
28
28
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @copyright Microsoft 2020
|
|
3
3
|
*/
|
|
4
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
4
|
+
import { IDiagnosticLogger, IUnloadableComponent, IProcessTelemetryUnloadContext, ITelemetryUnloadState } from "@microsoft/applicationinsights-core-js";
|
|
5
5
|
import { IClickAnalyticsConfiguration, IPageTags, IOverrideValues, IContentHandler, IPageActionTelemetry } from "../Interfaces/Datamodel";
|
|
6
6
|
import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin";
|
|
7
|
-
export declare class WebEvent {
|
|
7
|
+
export declare class WebEvent implements IUnloadableComponent {
|
|
8
|
+
protected _pageTags: IPageTags;
|
|
9
|
+
protected _pageTypeMetaTag: string;
|
|
10
|
+
protected _marketMetaTag: string;
|
|
11
|
+
protected _behaviorMetaTag: string;
|
|
8
12
|
protected _clickAnalyticsPlugin: ClickAnalyticsPlugin;
|
|
9
13
|
protected _config: IClickAnalyticsConfiguration;
|
|
10
14
|
protected _contentHandler: IContentHandler;
|
|
@@ -13,10 +17,6 @@ export declare class WebEvent {
|
|
|
13
17
|
[name: string]: string;
|
|
14
18
|
};
|
|
15
19
|
protected _traceLogger: IDiagnosticLogger;
|
|
16
|
-
protected _pageTags: IPageTags;
|
|
17
|
-
protected _pageTypeMetaTag: string;
|
|
18
|
-
protected _marketMetaTag: string;
|
|
19
|
-
protected _behaviorMetaTag: string;
|
|
20
20
|
/**
|
|
21
21
|
* @param clickAnalyticsPlugin - Click Analytics plugin instance
|
|
22
22
|
* @param config - ClickAnalytics configuration object
|
|
@@ -26,15 +26,24 @@ export declare class WebEvent {
|
|
|
26
26
|
* @param metaTags - Meta tags
|
|
27
27
|
* @param traceLogger - Trace logger to log to console.
|
|
28
28
|
*/
|
|
29
|
-
constructor(
|
|
29
|
+
constructor(clickAnalyticsPlugin: ClickAnalyticsPlugin, config: IClickAnalyticsConfiguration, contentHandler: IContentHandler, pageTagsCallback: any, metaTags: {
|
|
30
30
|
[name: string]: string;
|
|
31
|
-
},
|
|
31
|
+
}, traceLogger: IDiagnosticLogger);
|
|
32
32
|
setBasicProperties(event: IPageActionTelemetry, overrideValues: IOverrideValues): void;
|
|
33
33
|
/**
|
|
34
34
|
* Sets common properties for events that are based on the WebEvent schema.
|
|
35
35
|
* @param event - The event
|
|
36
36
|
*/
|
|
37
37
|
setCommonProperties(event: IPageActionTelemetry, overrideValues: IOverrideValues): void;
|
|
38
|
+
/**
|
|
39
|
+
* Teardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin
|
|
40
|
+
* finishes it's removal.
|
|
41
|
+
* @param unloadCtx - This is the context that should be used during unloading.
|
|
42
|
+
* @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
|
|
43
|
+
* @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
|
|
44
|
+
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
45
|
+
*/
|
|
46
|
+
_doUnload(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean;
|
|
38
47
|
/**
|
|
39
48
|
* Sets pageTags.
|
|
40
49
|
* @param event - The event
|
|
@@ -42,13 +51,4 @@ export declare class WebEvent {
|
|
|
42
51
|
protected _setPageTags(event: IPageActionTelemetry, overrideValues: IOverrideValues): void;
|
|
43
52
|
protected _getBehavior(overrideValues?: IOverrideValues): string | number;
|
|
44
53
|
protected _getValidBehavior(behavior: string | number): string | number;
|
|
45
|
-
/**
|
|
46
|
-
* Get the specified metadata value from the collection
|
|
47
|
-
* If overrideValue is specified in the config that takes precedence.
|
|
48
|
-
* @param metaTags - Meta data.
|
|
49
|
-
* @param coreData - Coredata values from configuration.
|
|
50
|
-
* @param metaTagName - Name of the metaTag to get.
|
|
51
|
-
* @returns Meta data value
|
|
52
|
-
*/
|
|
53
|
-
private _getMetaData;
|
|
54
54
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @copyright Microsoft 2020
|
|
3
3
|
*/
|
|
4
|
-
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
4
|
+
import { IDiagnosticLogger, IProcessTelemetryUnloadContext, ITelemetryUnloadState } from "@microsoft/applicationinsights-core-js";
|
|
5
5
|
import { IAutoCaptureHandler, IClickAnalyticsConfiguration } from "../Interfaces/Datamodel";
|
|
6
6
|
import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin";
|
|
7
7
|
import { PageAction } from "../events/PageAction";
|
|
@@ -16,13 +16,5 @@ export declare class AutoCaptureHandler implements IAutoCaptureHandler {
|
|
|
16
16
|
*/
|
|
17
17
|
constructor(_analyticsPlugin: ClickAnalyticsPlugin, _config: IClickAnalyticsConfiguration, _pageAction: PageAction, _traceLogger: IDiagnosticLogger);
|
|
18
18
|
click(): void;
|
|
19
|
-
|
|
20
|
-
* API to create and send a populated PageAction event
|
|
21
|
-
* @param element - DOM element
|
|
22
|
-
* @param overrideValues - PageAction overrides
|
|
23
|
-
* @param customProperties - Custom properties(Part C)
|
|
24
|
-
* @param isRightClick - Flag for mouse right clicks
|
|
25
|
-
*/
|
|
26
|
-
private capturePageAction;
|
|
27
|
-
private _processClick;
|
|
19
|
+
_doUnload(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean;
|
|
28
20
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Microsoft 2020
|
|
3
|
+
*/
|
|
1
4
|
import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
|
|
2
5
|
import { IClickAnalyticsConfiguration, IContent, IContentHandler } from "../Interfaces/Datamodel";
|
|
3
6
|
export declare class DomContentHandler implements IContentHandler {
|
|
@@ -23,54 +26,4 @@ export declare class DomContentHandler implements IContentHandler {
|
|
|
23
26
|
* @returns String representation of the Json array of element attributes
|
|
24
27
|
*/
|
|
25
28
|
getElementContent(element: Element): IContent;
|
|
26
|
-
/**
|
|
27
|
-
* Capture current level Element content
|
|
28
|
-
*/
|
|
29
|
-
private _captureElementContentWithDataTag;
|
|
30
|
-
/**
|
|
31
|
-
* Walk Up the DOM to capture Element content
|
|
32
|
-
*/
|
|
33
|
-
private _walkUpDomChainCaptureData;
|
|
34
|
-
/**
|
|
35
|
-
* Capture Element content along with Data Tag attributes and values
|
|
36
|
-
*/
|
|
37
|
-
private _populateElementContent;
|
|
38
|
-
/**
|
|
39
|
-
* Capture Element content along with Data Tag attributes and values
|
|
40
|
-
*/
|
|
41
|
-
private _populateElementContentwithDataTag;
|
|
42
|
-
/**
|
|
43
|
-
* Retrieve a specified metadata tag value from the DOM.
|
|
44
|
-
* @param captureAllMetaDataContent - Flag to capture all metadata content
|
|
45
|
-
* @param prefix - Prefix to search the metatags with.
|
|
46
|
-
* @param removePrefix - Specifies if the prefix must be excluded from key names in the returned collection.
|
|
47
|
-
* @returns Metadata collection/property bag
|
|
48
|
-
*/
|
|
49
|
-
private _getMetaDataFromDOM;
|
|
50
|
-
/**
|
|
51
|
-
* Gets the default content name.
|
|
52
|
-
* @param element - An html element
|
|
53
|
-
* @param useDefaultContentNameOrId -Flag indicating if an element is market PII.
|
|
54
|
-
* @returns Content name
|
|
55
|
-
*/
|
|
56
|
-
private _getDefaultContentName;
|
|
57
|
-
/**
|
|
58
|
-
* Check if the user wants to track the element, which means if the element has any tags with data-* or customDataPrefix
|
|
59
|
-
* @param element - An html element
|
|
60
|
-
* @returns true if any data-* exist, otherwise return false
|
|
61
|
-
*/
|
|
62
|
-
private _isTracked;
|
|
63
|
-
private _getHtmlIdAndContentName;
|
|
64
|
-
/**
|
|
65
|
-
* Computes the parentId of a given element.
|
|
66
|
-
* @param element - An html element
|
|
67
|
-
* @returns An object containing the closest parentId , can be empty if nothing was found
|
|
68
|
-
*/
|
|
69
|
-
private _getParentDetails;
|
|
70
|
-
/**
|
|
71
|
-
* Check if parent info already set up, if so take and put into content, if not walk up the DOM to find correct info
|
|
72
|
-
* @param element - An html element that the user wants to track
|
|
73
|
-
* @returns An object containing the parent info, can be empty if nothing was found
|
|
74
|
-
*/
|
|
75
|
-
private _populateParentInfo;
|
|
76
29
|
}
|