@guardian/ophan-tracker-js 2.5.0 → 2.6.0
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/NPM-dist/manage-my-account.js +25 -7
- package/NPM-dist/support.js +21 -3
- package/NPM-dist/types/contribution.d.ts +1 -1
- package/NPM-dist/types/embed.d.ts +1 -1
- package/NPM-dist/types/holidays.d.ts +1 -1
- package/NPM-dist/types/jobs-courses.d.ts +1 -1
- package/NPM-dist/types/jobs.d.ts +1 -1
- package/NPM-dist/types/manage-my-account.d.ts +28 -6
- package/NPM-dist/types/membership.d.ts +1 -1
- package/NPM-dist/types/smart-news.d.ts +1 -1
- package/NPM-dist/types/support.d.ts +28 -8
- package/NPM-dist/types/witness.d.ts +1 -1
- package/package.json +10 -2
|
@@ -6,11 +6,13 @@ import visibility from './visibility.js';
|
|
|
6
6
|
import './click-path-capture.js';
|
|
7
7
|
import './perf.js';
|
|
8
8
|
import './campaign.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
export const init = () => {
|
|
10
|
+
core.init('manage-my-account');
|
|
11
|
+
if (window.addEventListener) {
|
|
12
|
+
attention.init(visibility);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export const sendInitialEvent = (url = location.href, referrer = document.referrer) => {
|
|
14
16
|
try {
|
|
15
17
|
transmit.bumpViewId();
|
|
16
18
|
core.sendInitialEvent(null, url, referrer);
|
|
@@ -20,10 +22,26 @@ const sendInitialEvent = (url = location.href, referrer = document.referrer) =>
|
|
|
20
22
|
}
|
|
21
23
|
};
|
|
22
24
|
const exports = {
|
|
25
|
+
init,
|
|
23
26
|
sendInitialEvent,
|
|
24
27
|
record: transmit.sendMore,
|
|
25
28
|
get viewId() { return transmit.viewId; },
|
|
26
29
|
};
|
|
27
|
-
window.guardian = window.guardian || {};
|
|
28
|
-
window.guardian.ophan = exports;
|
|
29
30
|
export default exports;
|
|
31
|
+
// Named exports for convenience
|
|
32
|
+
export const record = exports.record;
|
|
33
|
+
export const viewId = exports.viewId;
|
|
34
|
+
// Type exports
|
|
35
|
+
export * from './types/abtest.js';
|
|
36
|
+
export * from './types/acquisition.js';
|
|
37
|
+
export * from './types/subscription.js';
|
|
38
|
+
export * from './types/interaction.js';
|
|
39
|
+
export * from './types/inpageclick.js';
|
|
40
|
+
export * from './types/printproduct.js';
|
|
41
|
+
export * from './types/product.js';
|
|
42
|
+
export * from './types/platform.js';
|
|
43
|
+
export * from './types/media.js';
|
|
44
|
+
export * from './types/consent.js';
|
|
45
|
+
export * from './types/component-type.js';
|
|
46
|
+
export * from './types/component-event.js';
|
|
47
|
+
export * from './types/event.js';
|
package/NPM-dist/support.js
CHANGED
|
@@ -5,13 +5,13 @@ import visibility from './visibility.js';
|
|
|
5
5
|
import './click-path-capture.js';
|
|
6
6
|
import './perf.js';
|
|
7
7
|
import './campaign.js';
|
|
8
|
-
const init = () => {
|
|
8
|
+
export const init = () => {
|
|
9
9
|
core.init('support');
|
|
10
10
|
if (window.addEventListener) {
|
|
11
11
|
attention.init(visibility);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
const sendInitialEvent = (url = location.href, referrer = document.referrer) => {
|
|
14
|
+
export const sendInitialEvent = (url = location.href, referrer = document.referrer) => {
|
|
15
15
|
try {
|
|
16
16
|
transmit.bumpViewId();
|
|
17
17
|
core.sendInitialEvent(null, url, referrer);
|
|
@@ -20,9 +20,27 @@ const sendInitialEvent = (url = location.href, referrer = document.referrer) =>
|
|
|
20
20
|
console.log(error);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
const supportExports = {
|
|
24
24
|
init,
|
|
25
25
|
sendInitialEvent,
|
|
26
26
|
record: transmit.sendMore,
|
|
27
27
|
get viewId() { return transmit.viewId; },
|
|
28
28
|
};
|
|
29
|
+
export default supportExports;
|
|
30
|
+
// Named exports for convenience
|
|
31
|
+
export const record = supportExports.record;
|
|
32
|
+
export const viewId = supportExports.viewId;
|
|
33
|
+
// Type exports
|
|
34
|
+
export * from './types/abtest.js';
|
|
35
|
+
export * from './types/acquisition.js';
|
|
36
|
+
export * from './types/subscription.js';
|
|
37
|
+
export * from './types/interaction.js';
|
|
38
|
+
export * from './types/inpageclick.js';
|
|
39
|
+
export * from './types/printproduct.js';
|
|
40
|
+
export * from './types/product.js';
|
|
41
|
+
export * from './types/platform.js';
|
|
42
|
+
export * from './types/media.js';
|
|
43
|
+
export * from './types/consent.js';
|
|
44
|
+
export * from './types/component-type.js';
|
|
45
|
+
export * from './types/component-event.js';
|
|
46
|
+
export * from './types/event.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let record: (obj: import("./
|
|
2
|
+
let record: (obj: import("./manage-my-account.js").EventPayload, f?: (() => void) | undefined) => void;
|
|
3
3
|
const viewId: string;
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let record: (obj: import("./
|
|
2
|
+
let record: (obj: import("./manage-my-account.js").EventPayload, f?: (() => void) | undefined) => void;
|
|
3
3
|
const viewId: string;
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let record: (obj: import("./
|
|
2
|
+
let record: (obj: import("./manage-my-account.js").EventPayload, f?: (() => void) | undefined) => void;
|
|
3
3
|
const viewId: string;
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let record: (obj: import("./
|
|
2
|
+
let record: (obj: import("./manage-my-account.js").EventPayload, f?: (() => void) | undefined) => void;
|
|
3
3
|
const viewId: string;
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
package/NPM-dist/types/jobs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let record: (obj: import("./
|
|
2
|
+
let record: (obj: import("./manage-my-account.js").EventPayload, f?: (() => void) | undefined) => void;
|
|
3
3
|
const viewId: string;
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
|
@@ -1,7 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import './click-path-capture.js';
|
|
2
|
+
import './perf.js';
|
|
3
|
+
import './campaign.js';
|
|
4
|
+
import { EventPayload } from './types/event.js';
|
|
5
|
+
export declare const init: () => void;
|
|
6
|
+
export declare const sendInitialEvent: (url?: string, referrer?: string) => void;
|
|
7
|
+
interface MMAExports {
|
|
8
|
+
init: () => void;
|
|
9
|
+
sendInitialEvent: (url?: string, referrer?: string) => void;
|
|
10
|
+
record: (event: EventPayload, callback?: () => void) => void;
|
|
11
|
+
viewId: string;
|
|
6
12
|
}
|
|
7
|
-
declare
|
|
13
|
+
declare const exports: MMAExports;
|
|
14
|
+
export default exports;
|
|
15
|
+
export declare const record: (event: EventPayload, callback?: () => void) => void;
|
|
16
|
+
export declare const viewId: string;
|
|
17
|
+
export * from './types/abtest.js';
|
|
18
|
+
export * from './types/acquisition.js';
|
|
19
|
+
export * from './types/subscription.js';
|
|
20
|
+
export * from './types/interaction.js';
|
|
21
|
+
export * from './types/inpageclick.js';
|
|
22
|
+
export * from './types/printproduct.js';
|
|
23
|
+
export * from './types/product.js';
|
|
24
|
+
export * from './types/platform.js';
|
|
25
|
+
export * from './types/media.js';
|
|
26
|
+
export * from './types/consent.js';
|
|
27
|
+
export * from './types/component-type.js';
|
|
28
|
+
export * from './types/component-event.js';
|
|
29
|
+
export * from './types/event.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let record: (obj: import("./
|
|
2
|
+
let record: (obj: import("./manage-my-account.js").EventPayload, f?: (() => void) | undefined) => void;
|
|
3
3
|
const viewId: string;
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let record: (obj: import("./
|
|
2
|
+
let record: (obj: import("./manage-my-account.js").EventPayload, f?: (() => void) | undefined) => void;
|
|
3
3
|
const viewId: string;
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import './click-path-capture.js';
|
|
2
|
+
import './perf.js';
|
|
3
|
+
import './campaign.js';
|
|
4
|
+
import { EventPayload } from './types/event.js';
|
|
5
|
+
export declare const init: () => void;
|
|
6
|
+
export declare const sendInitialEvent: (url?: string, referrer?: string) => void;
|
|
7
|
+
interface SupportExports {
|
|
8
|
+
init: () => void;
|
|
9
|
+
sendInitialEvent: (url?: string, referrer?: string) => void;
|
|
10
|
+
record: (event: EventPayload, callback?: () => void) => void;
|
|
11
|
+
viewId: string;
|
|
6
12
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare
|
|
13
|
+
declare const supportExports: SupportExports;
|
|
14
|
+
export default supportExports;
|
|
15
|
+
export declare const record: (event: EventPayload, callback?: () => void) => void;
|
|
16
|
+
export declare const viewId: string;
|
|
17
|
+
export * from './types/abtest.js';
|
|
18
|
+
export * from './types/acquisition.js';
|
|
19
|
+
export * from './types/subscription.js';
|
|
20
|
+
export * from './types/interaction.js';
|
|
21
|
+
export * from './types/inpageclick.js';
|
|
22
|
+
export * from './types/printproduct.js';
|
|
23
|
+
export * from './types/product.js';
|
|
24
|
+
export * from './types/platform.js';
|
|
25
|
+
export * from './types/media.js';
|
|
26
|
+
export * from './types/consent.js';
|
|
27
|
+
export * from './types/component-type.js';
|
|
28
|
+
export * from './types/component-event.js';
|
|
29
|
+
export * from './types/event.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let record: (obj: import("./
|
|
2
|
+
let record: (obj: import("./manage-my-account.js").EventPayload, f?: (() => void) | undefined) => void;
|
|
3
3
|
const viewId: string;
|
|
4
4
|
}
|
|
5
5
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/ophan-tracker-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16"
|
|
@@ -19,12 +19,19 @@
|
|
|
19
19
|
"./MMA": {
|
|
20
20
|
"types": "./NPM-dist/types/manage-my-account.d.ts",
|
|
21
21
|
"default": "./NPM-dist/manage-my-account.js"
|
|
22
|
+
},
|
|
23
|
+
"./support": {
|
|
24
|
+
"types": "./NPM-dist/types/support.d.ts",
|
|
25
|
+
"default": "./NPM-dist/support.js"
|
|
22
26
|
}
|
|
23
27
|
},
|
|
24
28
|
"typesVersions": {
|
|
25
29
|
"*": {
|
|
26
30
|
"MMA": [
|
|
27
31
|
"NPM-dist/types/manage-my-account.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"support": [
|
|
34
|
+
"NPM-dist/types/support.d.ts"
|
|
28
35
|
]
|
|
29
36
|
}
|
|
30
37
|
},
|
|
@@ -50,7 +57,8 @@
|
|
|
50
57
|
"build-for-npm": "tsc",
|
|
51
58
|
"pretest": "tsc",
|
|
52
59
|
"test": "jest",
|
|
53
|
-
"format": "npx prettier --write ."
|
|
60
|
+
"format": "npx prettier --write .",
|
|
61
|
+
"changeset:publish:canary": "changeset publish --tag canary"
|
|
54
62
|
},
|
|
55
63
|
"dependencies": {
|
|
56
64
|
"@guardian/tsconfig": "^1.0.0"
|