@guardian/ophan-tracker-js 2.3.1 → 2.4.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/attention.js +20 -13
- package/NPM-dist/components.js +83 -80
- package/NPM-dist/tests/attention.test.js +2 -2
- package/NPM-dist/tests/components.test.js +2 -4
- package/NPM-dist/types/components.d.ts +22 -16
- package/NPM-dist/types/types/component-event.d.ts +5 -1
- package/NPM-dist/types/types/component-type.d.ts +1 -1
- package/package.json +1 -1
package/NPM-dist/attention.js
CHANGED
|
@@ -38,11 +38,13 @@ let unrecordedAttentionStarted = null;
|
|
|
38
38
|
let reportedTotalAttentionMs = null; // setting null here forces a first report of attention time, even if it's only 0ms
|
|
39
39
|
// the decay timer if we've set one
|
|
40
40
|
let decayTimerId = null;
|
|
41
|
-
// is video currently playing?
|
|
41
|
+
// is a video currently playing?
|
|
42
42
|
let videoPlaying = false;
|
|
43
|
-
// Helper function to check if any video components are tracking
|
|
44
|
-
const
|
|
45
|
-
|
|
43
|
+
// Helper function to check if any video components are tracking, is that video in view and not playing
|
|
44
|
+
const shouldBlockVideoComponentTracking = () => {
|
|
45
|
+
const isTrackedVideoInView = components.some(component => component.isTrackingVideo && component.visible);
|
|
46
|
+
const shouldBlockVideoTracking = isTrackedVideoInView && !videoPlaying;
|
|
47
|
+
return shouldBlockVideoTracking;
|
|
46
48
|
};
|
|
47
49
|
const cancelDecayTimer = () => {
|
|
48
50
|
if (decayTimerId != null) {
|
|
@@ -51,20 +53,25 @@ const cancelDecayTimer = () => {
|
|
|
51
53
|
decayTimerId = null;
|
|
52
54
|
};
|
|
53
55
|
const makeActive = () => {
|
|
54
|
-
//
|
|
55
|
-
if (shouldBlockVideoTracking()) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
56
|
+
// Always update global attention
|
|
58
57
|
if (unrecordedAttentionStarted == null) {
|
|
59
58
|
unrecordedAttentionStarted = performance.now();
|
|
60
59
|
}
|
|
61
|
-
|
|
60
|
+
// reset decay time as the page has been considered "active"
|
|
62
61
|
cancelDecayTimer();
|
|
63
62
|
decayTimerId = window.setTimeout(() => {
|
|
64
63
|
if (!videoPlaying) {
|
|
65
64
|
makeInactive();
|
|
66
65
|
}
|
|
67
66
|
}, ATTENTIONDECAY);
|
|
67
|
+
// Only start component monitoring if allowed
|
|
68
|
+
const blockVideoComponentTracking = shouldBlockVideoComponentTracking();
|
|
69
|
+
if (blockVideoComponentTracking) {
|
|
70
|
+
componentUtils.stopVideoComponentMonitoring();
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
componentUtils.startMonitoring(videoPlaying);
|
|
74
|
+
}
|
|
68
75
|
};
|
|
69
76
|
const incrementTotalAttentionTimeByUnrecordedAmount = () => {
|
|
70
77
|
if (unrecordedAttentionStarted != null) {
|
|
@@ -113,13 +120,13 @@ const initAttention = (visibility) => {
|
|
|
113
120
|
videoPlaying = true;
|
|
114
121
|
makeActive();
|
|
115
122
|
});
|
|
116
|
-
document.addEventListener('
|
|
123
|
+
document.addEventListener('videoPause', () => {
|
|
117
124
|
videoPlaying = false;
|
|
118
|
-
|
|
125
|
+
componentUtils.stopVideoComponentMonitoring();
|
|
119
126
|
});
|
|
120
|
-
document.addEventListener('
|
|
127
|
+
document.addEventListener('videoEnded', () => {
|
|
121
128
|
videoPlaying = false;
|
|
122
|
-
|
|
129
|
+
componentUtils.stopVideoComponentMonitoring();
|
|
123
130
|
});
|
|
124
131
|
window.setTimeout(reporter, 100);
|
|
125
132
|
window.setInterval(reporter, REPORTINGINTERVAL);
|
package/NPM-dist/components.js
CHANGED
|
@@ -3,12 +3,33 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const components = [];
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @type {Object|null}
|
|
6
|
+
* Map from threshold value to its corresponding IntersectionObserver
|
|
7
|
+
* Each observer handles all components that share the same threshold.
|
|
8
|
+
* This allows us to support multiple thresholds.
|
|
10
9
|
*/
|
|
11
|
-
|
|
10
|
+
const observerMap = new Map();
|
|
11
|
+
/**
|
|
12
|
+
* Returns (or creates) a shared IntersectionObserver for the given threshold.
|
|
13
|
+
* @param {number} threshold - The visibility ratio required
|
|
14
|
+
* @returns {IntersectionObserver}
|
|
15
|
+
*/
|
|
16
|
+
const getOrCreateObserver = (threshold) => {
|
|
17
|
+
if (observerMap.has(threshold))
|
|
18
|
+
return observerMap.get(threshold);
|
|
19
|
+
const observer = new IntersectionObserver((entries) => {
|
|
20
|
+
for (const entry of entries) {
|
|
21
|
+
const component = components.find(c => c.element === entry.target);
|
|
22
|
+
if (!component)
|
|
23
|
+
continue;
|
|
24
|
+
const isVisible = entry.intersectionRatio >= component.visibilityThreshold;
|
|
25
|
+
component.handleVisibilityChange(isVisible);
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
threshold: [threshold],
|
|
29
|
+
});
|
|
30
|
+
observerMap.set(threshold, observer);
|
|
31
|
+
return observer;
|
|
32
|
+
};
|
|
12
33
|
// Tracks attention time of elements on the page with data-component attributes.
|
|
13
34
|
// This should always be less than or equal to the page attention time.
|
|
14
35
|
// If the page does not have attention, no component has attention.
|
|
@@ -19,19 +40,19 @@ class Component {
|
|
|
19
40
|
* Component constructor.
|
|
20
41
|
* @param {string} name - The name of the component.
|
|
21
42
|
* @param {HTMLElement} element - The DOM element of the component.
|
|
22
|
-
* @param {number}
|
|
43
|
+
* @param {number} visibilityThreshold -
|
|
23
44
|
* visibilityThreshold represents the fraction of each component that must
|
|
24
45
|
* be in the viewport before it is considered visible.
|
|
25
46
|
* e.g. 0.5 means that half the height or width must be in the viewport
|
|
26
47
|
* 1 means that the entire element must be in the viewport
|
|
27
|
-
* @param {number}
|
|
28
|
-
* @param {boolean} isTrackingVideo - Whether this component is
|
|
48
|
+
* @param {number} reportingInterval - How often attention is reported.
|
|
49
|
+
* @param {boolean} isTrackingVideo - Whether this component is a video.
|
|
29
50
|
*/
|
|
30
|
-
constructor(name, element,
|
|
51
|
+
constructor(name, element, visibilityThreshold, reportingInterval, isTrackingVideo = false) {
|
|
31
52
|
this.name = name;
|
|
32
53
|
this.element = element;
|
|
33
|
-
this.visibilityThreshold =
|
|
34
|
-
this.reportingInterval =
|
|
54
|
+
this.visibilityThreshold = visibilityThreshold;
|
|
55
|
+
this.reportingInterval = reportingInterval;
|
|
35
56
|
this.isTrackingVideo = isTrackingVideo;
|
|
36
57
|
this.visible = false;
|
|
37
58
|
// total attention time so far for this element
|
|
@@ -43,72 +64,28 @@ class Component {
|
|
|
43
64
|
this.unrecordedAttentionStarted = null;
|
|
44
65
|
// the attention time when getAttentionTime() was last called
|
|
45
66
|
this.reportedTotalAttentionMs = 0;
|
|
46
|
-
this.
|
|
47
|
-
this.visCheck = this.checkVisibility.bind(this);
|
|
48
|
-
if (eventEmitter != null) {
|
|
49
|
-
this.usingEmitter = true;
|
|
50
|
-
eventEmitter.on('window:throttledScroll', this.visCheck);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
window.addEventListener('scroll', this.visCheck);
|
|
54
|
-
}
|
|
55
|
-
window.addEventListener('resize', this.visCheck);
|
|
67
|
+
getOrCreateObserver(this.visibilityThreshold).observe(this.element);
|
|
56
68
|
}
|
|
57
|
-
|
|
58
|
-
if (!this.element.offsetParent) {
|
|
59
|
-
// exclude hidden elements
|
|
60
|
-
// will also exclude position: fixed elements but we don't care about these
|
|
61
|
-
// (because their attention time would always be the same as the whole page)
|
|
62
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
const box = this.element.getBoundingClientRect();
|
|
66
|
-
const width = box.width;
|
|
67
|
-
const height = box.height;
|
|
68
|
-
const windowHeight = window.innerHeight || document.documentElement.clientHeight;
|
|
69
|
-
const windowWidth = window.innerWidth || document.documentElement.clientWidth;
|
|
70
|
-
return (box.left >= -(width * (1 - threshold)) &&
|
|
71
|
-
box.top >= -(height * (1 - threshold)) &&
|
|
72
|
-
box.right <= windowWidth + width * (1 - threshold) &&
|
|
73
|
-
box.bottom <= windowHeight + height * (1 - threshold));
|
|
74
|
-
}
|
|
75
|
-
visibilityHasChanged() {
|
|
69
|
+
handleVisibilityChange(isNowVisible) {
|
|
76
70
|
const wasVisible = this.visible;
|
|
77
|
-
this.visible =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
checkVisibility() {
|
|
88
|
-
this.rebindToEventEmitter();
|
|
89
|
-
if (this.visibilityHasChanged()) {
|
|
90
|
-
return this.visible ? this.makeActive() : this.makeInactive();
|
|
71
|
+
this.visible = isNowVisible;
|
|
72
|
+
if (wasVisible !== isNowVisible) {
|
|
73
|
+
if (isNowVisible) {
|
|
74
|
+
this.makeActive();
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.makeInactive();
|
|
78
|
+
}
|
|
91
79
|
}
|
|
92
80
|
}
|
|
93
81
|
makeActive() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
? this.unrecordedAttentionStarted
|
|
98
|
-
: (this.unrecordedAttentionStarted = performance.now());
|
|
82
|
+
if (this.unrecordedAttentionStarted == null) {
|
|
83
|
+
this.unrecordedAttentionStarted = performance.now();
|
|
84
|
+
}
|
|
99
85
|
}
|
|
100
86
|
makeInactive() {
|
|
101
87
|
this.incrementTotalAttentionTimeByUnrecordedAmount();
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
hadAttentionSinceLastGet() {
|
|
105
|
-
this.incrementTotalAttentionTimeByUnrecordedAmount();
|
|
106
|
-
return this.totalAttentionMs !== this.reportedTotalAttentionMs;
|
|
107
|
-
}
|
|
108
|
-
getAttentionTime() {
|
|
109
|
-
this.incrementTotalAttentionTimeByUnrecordedAmount();
|
|
110
|
-
this.reportedTotalAttentionMs = this.totalAttentionMs;
|
|
111
|
-
return this.totalAttentionMs;
|
|
88
|
+
this.unrecordedAttentionStarted = null;
|
|
112
89
|
}
|
|
113
90
|
incrementTotalAttentionTimeByUnrecordedAmount() {
|
|
114
91
|
if (this.unrecordedAttentionStarted != null) {
|
|
@@ -118,17 +95,29 @@ class Component {
|
|
|
118
95
|
// crazy big values!
|
|
119
96
|
const unrecordedMs = Math.min(now - this.unrecordedAttentionStarted, this.reportingInterval);
|
|
120
97
|
this.totalAttentionMs += unrecordedMs;
|
|
121
|
-
|
|
98
|
+
this.unrecordedAttentionStarted = now;
|
|
122
99
|
}
|
|
123
100
|
}
|
|
101
|
+
hadAttentionSinceLastGet() {
|
|
102
|
+
this.incrementTotalAttentionTimeByUnrecordedAmount();
|
|
103
|
+
return this.totalAttentionMs !== this.reportedTotalAttentionMs;
|
|
104
|
+
}
|
|
105
|
+
getAttentionTime() {
|
|
106
|
+
this.incrementTotalAttentionTimeByUnrecordedAmount();
|
|
107
|
+
this.reportedTotalAttentionMs = this.totalAttentionMs;
|
|
108
|
+
return this.totalAttentionMs;
|
|
109
|
+
}
|
|
124
110
|
}
|
|
125
111
|
/**
|
|
126
112
|
* Begins monitoring the components on the page for attention time.
|
|
113
|
+
* We begin monitoring if the following conditions are met
|
|
114
|
+
* 1. the component is visible within the threshold set.
|
|
115
|
+
* 2. the component is not a video OR is a video which is playing
|
|
127
116
|
* @returns {Array} Array of results from makeActive() for each visible component.
|
|
128
117
|
*/
|
|
129
|
-
const startMonitoring = () => {
|
|
118
|
+
const startMonitoring = (videoPlaying = false) => {
|
|
130
119
|
return components
|
|
131
|
-
.filter((component) => component.
|
|
120
|
+
.filter((component) => component.visible && (!component.isTrackingVideo || videoPlaying))
|
|
132
121
|
.map((component) => component.makeActive());
|
|
133
122
|
};
|
|
134
123
|
/**
|
|
@@ -138,6 +127,24 @@ const startMonitoring = () => {
|
|
|
138
127
|
const stopMonitoring = () => {
|
|
139
128
|
return components.map((component) => component.makeInactive());
|
|
140
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* Stops monitoring a video on the page for attention time.
|
|
132
|
+
* This allows us to bypass the decay timer and explicitly stop monitoring video
|
|
133
|
+
* when the user is not playing the video (ie on video pause or video end) if
|
|
134
|
+
* the user is explicitly tracking a video component.
|
|
135
|
+
* @returns {Array} Array of results from makeInactive() for each component.
|
|
136
|
+
*/
|
|
137
|
+
const stopVideoComponentMonitoring = () => {
|
|
138
|
+
return components
|
|
139
|
+
.filter(component => component.isTrackingVideo)
|
|
140
|
+
.map(component => {
|
|
141
|
+
if (component.unrecordedAttentionStarted != null) {
|
|
142
|
+
return component.makeInactive();
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
})
|
|
146
|
+
.filter(result => result !== null);
|
|
147
|
+
};
|
|
141
148
|
/**
|
|
142
149
|
* Retrieves the attention times for all components.
|
|
143
150
|
* @returns {Object}
|
|
@@ -153,17 +160,13 @@ const getAttentionTimes = () => {
|
|
|
153
160
|
return obj;
|
|
154
161
|
};
|
|
155
162
|
export default {
|
|
156
|
-
/**
|
|
157
|
-
* @param {Object} emitter - The event emitter to set.
|
|
158
|
-
* @returns {Object}
|
|
159
|
-
*/
|
|
160
|
-
setEventEmitter: function (emitter) {
|
|
161
|
-
return (eventEmitter = emitter);
|
|
162
|
-
},
|
|
163
163
|
startMonitoring,
|
|
164
164
|
stopMonitoring,
|
|
165
|
+
stopVideoComponentMonitoring,
|
|
165
166
|
getAttentionTimes,
|
|
166
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* @type {(...args: ConstructorParameters<typeof Component>) => void}
|
|
169
|
+
*/
|
|
167
170
|
registerComponent: function (name, el, visibilityThreshold, reportingInterval, isTrackingVideo = false) {
|
|
168
171
|
return components.push(new Component(name, el, visibilityThreshold, reportingInterval, isTrackingVideo));
|
|
169
172
|
},
|
|
@@ -176,7 +176,7 @@ describe('attention.js', () => {
|
|
|
176
176
|
const videoEndedHandler = document.addEventListener.mock.calls.find(call => call[0] === 'videoEnded')[1];
|
|
177
177
|
videoEndedHandler();
|
|
178
178
|
// Should stop monitoring
|
|
179
|
-
expect(componentUtils.
|
|
179
|
+
expect(componentUtils.stopVideoComponentMonitoring).toHaveBeenCalled();
|
|
180
180
|
});
|
|
181
181
|
test('should stop monitoring when video is paused', () => {
|
|
182
182
|
// Initialize attention system
|
|
@@ -192,7 +192,7 @@ describe('attention.js', () => {
|
|
|
192
192
|
const videoPauseHandler = document.addEventListener.mock.calls.find(call => call[0] === 'videoPause')[1];
|
|
193
193
|
videoPauseHandler();
|
|
194
194
|
// Should stop monitoring
|
|
195
|
-
expect(componentUtils.
|
|
195
|
+
expect(componentUtils.stopVideoComponentMonitoring).toHaveBeenCalled();
|
|
196
196
|
});
|
|
197
197
|
});
|
|
198
198
|
describe('mixed component scenarios', () => {
|
|
@@ -6,7 +6,7 @@ describe('components.js', () => {
|
|
|
6
6
|
components.length = 0;
|
|
7
7
|
components.push({
|
|
8
8
|
name: 'comp1',
|
|
9
|
-
|
|
9
|
+
visible: true,
|
|
10
10
|
makeActive: jest.fn(),
|
|
11
11
|
makeInactive: jest.fn(),
|
|
12
12
|
hadAttentionSinceLastGet: jest.fn().mockReturnValue(true),
|
|
@@ -14,7 +14,7 @@ describe('components.js', () => {
|
|
|
14
14
|
});
|
|
15
15
|
components.push({
|
|
16
16
|
name: 'comp2',
|
|
17
|
-
|
|
17
|
+
visible: false,
|
|
18
18
|
makeActive: jest.fn(),
|
|
19
19
|
makeInactive: jest.fn(),
|
|
20
20
|
hadAttentionSinceLastGet: jest.fn().mockReturnValue(true),
|
|
@@ -22,8 +22,6 @@ describe('components.js', () => {
|
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
test('startMonitoring activates visible components', () => {
|
|
25
|
-
components[0].isVisible.mockReturnValue(true);
|
|
26
|
-
components[1].isVisible.mockReturnValue(false);
|
|
27
25
|
const results = startMonitoring();
|
|
28
26
|
expect(components[0].makeActive).toHaveBeenCalled();
|
|
29
27
|
expect(components[1].makeActive).not.toHaveBeenCalled();
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const components: Component[];
|
|
5
5
|
declare namespace _default {
|
|
6
|
-
export function setEventEmitter(emitter: Object): Object;
|
|
7
6
|
export { startMonitoring };
|
|
8
7
|
export { stopMonitoring };
|
|
8
|
+
export { stopVideoComponentMonitoring };
|
|
9
9
|
export { getAttentionTimes };
|
|
10
|
-
export let registerComponent: (...args: [name: string, element: HTMLElement,
|
|
10
|
+
export let registerComponent: (...args: [name: string, element: HTMLElement, visibilityThreshold: number, reportingInterval: number, isTrackingVideo?: boolean | undefined]) => void;
|
|
11
11
|
}
|
|
12
12
|
export default _default;
|
|
13
13
|
declare class Component {
|
|
@@ -15,15 +15,15 @@ declare class Component {
|
|
|
15
15
|
* Component constructor.
|
|
16
16
|
* @param {string} name - The name of the component.
|
|
17
17
|
* @param {HTMLElement} element - The DOM element of the component.
|
|
18
|
-
* @param {number}
|
|
18
|
+
* @param {number} visibilityThreshold -
|
|
19
19
|
* visibilityThreshold represents the fraction of each component that must
|
|
20
20
|
* be in the viewport before it is considered visible.
|
|
21
21
|
* e.g. 0.5 means that half the height or width must be in the viewport
|
|
22
22
|
* 1 means that the entire element must be in the viewport
|
|
23
|
-
* @param {number}
|
|
24
|
-
* @param {boolean} isTrackingVideo - Whether this component is
|
|
23
|
+
* @param {number} reportingInterval - How often attention is reported.
|
|
24
|
+
* @param {boolean} isTrackingVideo - Whether this component is a video.
|
|
25
25
|
*/
|
|
26
|
-
constructor(name: string, element: HTMLElement,
|
|
26
|
+
constructor(name: string, element: HTMLElement, visibilityThreshold: number, reportingInterval: number, isTrackingVideo?: boolean);
|
|
27
27
|
name: string;
|
|
28
28
|
element: HTMLElement;
|
|
29
29
|
visibilityThreshold: number;
|
|
@@ -33,28 +33,34 @@ declare class Component {
|
|
|
33
33
|
totalAttentionMs: number;
|
|
34
34
|
unrecordedAttentionStarted: number | null;
|
|
35
35
|
reportedTotalAttentionMs: number;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
rebindToEventEmitter(): any;
|
|
41
|
-
checkVisibility(): number | null | undefined;
|
|
42
|
-
makeActive(): number;
|
|
43
|
-
makeInactive(): null;
|
|
36
|
+
handleVisibilityChange(isNowVisible: any): void;
|
|
37
|
+
makeActive(): void;
|
|
38
|
+
makeInactive(): void;
|
|
39
|
+
incrementTotalAttentionTimeByUnrecordedAmount(): void;
|
|
44
40
|
hadAttentionSinceLastGet(): boolean;
|
|
45
41
|
getAttentionTime(): number;
|
|
46
|
-
incrementTotalAttentionTimeByUnrecordedAmount(): number | undefined;
|
|
47
42
|
}
|
|
48
43
|
/**
|
|
49
44
|
* Begins monitoring the components on the page for attention time.
|
|
45
|
+
* We begin monitoring if the following conditions are met
|
|
46
|
+
* 1. the component is visible within the threshold set.
|
|
47
|
+
* 2. the component is not a video OR is a video which is playing
|
|
50
48
|
* @returns {Array} Array of results from makeActive() for each visible component.
|
|
51
49
|
*/
|
|
52
|
-
declare function startMonitoring(): any[];
|
|
50
|
+
declare function startMonitoring(videoPlaying?: boolean): any[];
|
|
53
51
|
/**
|
|
54
52
|
* Stops monitoring the components on the page for attention time.
|
|
55
53
|
* @returns {Array} Array of results from makeInactive() for each component.
|
|
56
54
|
*/
|
|
57
55
|
declare function stopMonitoring(): any[];
|
|
56
|
+
/**
|
|
57
|
+
* Stops monitoring a video on the page for attention time.
|
|
58
|
+
* This allows us to bypass the decay timer and explicitly stop monitoring video
|
|
59
|
+
* when the user is not playing the video (ie on video pause or video end) if
|
|
60
|
+
* the user is explicitly tracking a video component.
|
|
61
|
+
* @returns {Array} Array of results from makeInactive() for each component.
|
|
62
|
+
*/
|
|
63
|
+
declare function stopVideoComponentMonitoring(): any[];
|
|
58
64
|
/**
|
|
59
65
|
* Retrieves the attention times for all components.
|
|
60
66
|
* @returns {Object}
|
|
@@ -63,7 +63,11 @@ export type TAction =
|
|
|
63
63
|
/**
|
|
64
64
|
* The component is returned to its original location
|
|
65
65
|
**/
|
|
66
|
-
| 'RETURN'
|
|
66
|
+
| 'RETURN'
|
|
67
|
+
/**
|
|
68
|
+
* The component has detected something
|
|
69
|
+
*/
|
|
70
|
+
| 'DETECT';
|
|
67
71
|
interface ComponentV2 {
|
|
68
72
|
componentType: TComponentType;
|
|
69
73
|
id?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TComponentType =
|
|
1
|
+
export type TComponentType = 'READERS_QUESTIONS_ATOM' | 'QANDA_ATOM' | 'PROFILE_ATOM' | 'GUIDE_ATOM' | 'TIMELINE_ATOM' | 'NEWSLETTER_SUBSCRIPTION' | 'SURVEYS_QUESTIONS' | 'ACQUISITIONS_EPIC' | 'ACQUISITIONS_ENGAGEMENT_BANNER' | 'ACQUISITIONS_THANK_YOU_EPIC' | 'ACQUISITIONS_HEADER' | 'ACQUISITIONS_FOOTER' | 'ACQUISITIONS_INTERACTIVE_SLICE' | 'ACQUISITIONS_NUGGET' | 'ACQUISITIONS_STANDFIRST' | 'ACQUISITIONS_THRASHER' | 'ACQUISITIONS_EDITORIAL_LINK' | 'ACQUISITIONS_MANAGE_MY_ACCOUNT' | 'ACQUISITIONS_BUTTON' | 'ACQUISITIONS_OTHER' | 'APP_ADVERT' | 'APP_AUDIO' | 'APP_BUTTON' | 'APP_CARD' | 'APP_CROSSWORDS' | 'APP_ENGAGEMENT_BANNER' | 'APP_EPIC' | 'APP_GALLERY' | 'APP_LINK' | 'APP_NAVIGATION_ITEM' | 'APP_SCREEN' | 'APP_THRASHER' | 'APP_VIDEO' | 'AUDIO_ATOM' | 'CHART_ATOM' | 'ACQUISITIONS_MERCHANDISING' | 'ACQUISITIONS_HOUSE_ADS' | 'SIGN_IN_GATE' | 'ACQUISITIONS_SUBSCRIPTIONS_BANNER' | 'MOBILE_STICKY_AD' | 'IDENTITY_AUTHENTICATION' | 'RETENTION_ENGAGEMENT_BANNER' | 'ACQUISITION_SUPPORT_SITE' | 'RETENTION_EPIC' | 'CONSENT' | 'LIVE_BLOG_PINNED_POST' | 'STICKY_VIDEO' | 'KEY_EVENT_CARD' | 'RETENTION_HEADER' | 'SLIDESHOW' | 'APP_FEATURE' | 'CARD' | 'CAROUSEL' | 'CONTAINER' | 'MENU' | 'ACQUISITIONS_GUTTER' | 'INTERACTIVE_ATOM' | 'LOOP_VIDEO' | 'AD_BLOCK_RECOVERY';
|