@phantomstudios/ft-lib 0.2.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/.babelrc +6 -0
- package/.eslintrc +58 -0
- package/.github/CODEOWNERS +1 -0
- package/.github/workflows/pr.yml +31 -0
- package/.github/workflows/release.yml +44 -0
- package/.nvmrc +1 -0
- package/.prettierignore +5 -0
- package/CODE_OF_CONDUCT.md +76 -0
- package/CONTRIBUTING.md +48 -0
- package/LICENSE +21 -0
- package/README.md +158 -0
- package/SUPPORT.md +4 -0
- package/jest.config.js +24 -0
- package/lib/FTTracking/index.d.ts +24 -0
- package/lib/FTTracking/index.d.ts.map +1 -0
- package/lib/FTTracking/index.js +69 -0
- package/lib/FTTracking/index.js.map +1 -0
- package/lib/consentMonitor/index.d.ts +19 -0
- package/lib/consentMonitor/index.d.ts.map +1 -0
- package/lib/consentMonitor/index.js +117 -0
- package/lib/consentMonitor/index.js.map +1 -0
- package/lib/gaTracker/index.d.ts +13 -0
- package/lib/gaTracker/index.d.ts.map +1 -0
- package/lib/gaTracker/index.js +120 -0
- package/lib/gaTracker/index.js.map +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/oTracker/index.d.ts +14 -0
- package/lib/oTracker/index.d.ts.map +1 -0
- package/lib/oTracker/index.js +114 -0
- package/lib/oTracker/index.js.map +1 -0
- package/lib/permutiveVideoUtils/index.d.ts +12 -0
- package/lib/permutiveVideoUtils/index.d.ts.map +1 -0
- package/lib/permutiveVideoUtils/index.js +59 -0
- package/lib/permutiveVideoUtils/index.js.map +1 -0
- package/lib/reactPlayerTracking/index.d.ts +30 -0
- package/lib/reactPlayerTracking/index.d.ts.map +1 -0
- package/lib/reactPlayerTracking/index.js +85 -0
- package/lib/reactPlayerTracking/index.js.map +1 -0
- package/lib/utils/attention.d.ts +20 -0
- package/lib/utils/attention.d.ts.map +1 -0
- package/lib/utils/attention.js +142 -0
- package/lib/utils/attention.js.map +1 -0
- package/lib/utils/cookies.d.ts +2 -0
- package/lib/utils/cookies.d.ts.map +1 -0
- package/lib/utils/cookies.js +14 -0
- package/lib/utils/cookies.js.map +1 -0
- package/lib/utils/getTrace.d.ts +6 -0
- package/lib/utils/getTrace.d.ts.map +1 -0
- package/lib/utils/getTrace.js +109 -0
- package/lib/utils/getTrace.js.map +1 -0
- package/lib/utils/intersectionObserverPolyfill.d.ts +1 -0
- package/lib/utils/intersectionObserverPolyfill.d.ts.map +1 -0
- package/lib/utils/intersectionObserverPolyfill.js +421 -0
- package/lib/utils/intersectionObserverPolyfill.js.map +1 -0
- package/lib/utils/scroll.d.ts +18 -0
- package/lib/utils/scroll.d.ts.map +1 -0
- package/lib/utils/scroll.js +75 -0
- package/lib/utils/scroll.js.map +1 -0
- package/lib/utils/yupValidator.d.ts +87 -0
- package/lib/utils/yupValidator.d.ts.map +1 -0
- package/lib/utils/yupValidator.js +189 -0
- package/lib/utils/yupValidator.js.map +1 -0
- package/lib/ytIframeTracking/index.d.ts +27 -0
- package/lib/ytIframeTracking/index.d.ts.map +1 -0
- package/lib/ytIframeTracking/index.js +165 -0
- package/lib/ytIframeTracking/index.js.map +1 -0
- package/package.json +75 -0
- package/src/FTTracking/index.ts +74 -0
- package/src/consentMonitor/index.ts +120 -0
- package/src/gaTracker/index.ts +136 -0
- package/src/index.ts +12 -0
- package/src/oTracker/index.ts +122 -0
- package/src/permutiveVideoUtils/index.ts +53 -0
- package/src/reactPlayerTracking/index.ts +105 -0
- package/src/types.d.ts +33 -0
- package/src/utils/attention.js +138 -0
- package/src/utils/cookies.js +9 -0
- package/src/utils/getTrace.js +122 -0
- package/src/utils/intersectionObserverPolyfill.js +470 -0
- package/src/utils/scroll.ts +94 -0
- package/src/utils/yupValidator.ts +205 -0
- package/src/ytIframeTracking/index.ts +210 -0
- package/test/index.test.tsx +63 -0
- package/tsconfig.json +26 -0
- package/tsconfig.test.json +6 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
!(function () {
|
|
3
|
+
"use strict";
|
|
4
|
+
if ("object" == typeof window)
|
|
5
|
+
if ("IntersectionObserver" in window &&
|
|
6
|
+
"IntersectionObserverEntry" in window &&
|
|
7
|
+
"intersectionRatio" in window.IntersectionObserverEntry.prototype)
|
|
8
|
+
"isIntersecting" in window.IntersectionObserverEntry.prototype ||
|
|
9
|
+
Object.defineProperty(window.IntersectionObserverEntry.prototype, "isIntersecting", {
|
|
10
|
+
get: function () {
|
|
11
|
+
return this.intersectionRatio > 0;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
else {
|
|
15
|
+
var t = window.document, e = [], n = null, o = null;
|
|
16
|
+
(r.prototype.THROTTLE_TIMEOUT = 100),
|
|
17
|
+
(r.prototype.POLL_INTERVAL = null),
|
|
18
|
+
(r.prototype.USE_MUTATION_OBSERVER = !0),
|
|
19
|
+
(r._setupCrossOriginUpdater = function () {
|
|
20
|
+
return (n ||
|
|
21
|
+
(n = function (t, n) {
|
|
22
|
+
(o =
|
|
23
|
+
t && n
|
|
24
|
+
? a(t, n)
|
|
25
|
+
: {
|
|
26
|
+
top: 0,
|
|
27
|
+
bottom: 0,
|
|
28
|
+
left: 0,
|
|
29
|
+
right: 0,
|
|
30
|
+
width: 0,
|
|
31
|
+
height: 0,
|
|
32
|
+
}),
|
|
33
|
+
e.forEach(function (t) {
|
|
34
|
+
t._checkForIntersections();
|
|
35
|
+
});
|
|
36
|
+
}),
|
|
37
|
+
n);
|
|
38
|
+
}),
|
|
39
|
+
(r._resetCrossOriginUpdater = function () {
|
|
40
|
+
(n = null), (o = null);
|
|
41
|
+
}),
|
|
42
|
+
(r.prototype.observe = function (t) {
|
|
43
|
+
if (!this._observationTargets.some(function (e) {
|
|
44
|
+
return e.element == t;
|
|
45
|
+
})) {
|
|
46
|
+
if (!t || 1 != t.nodeType)
|
|
47
|
+
throw new Error("target must be an Element");
|
|
48
|
+
this._registerInstance(),
|
|
49
|
+
this._observationTargets.push({ element: t, entry: null }),
|
|
50
|
+
this._monitorIntersections(t.ownerDocument),
|
|
51
|
+
this._checkForIntersections();
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
(r.prototype.unobserve = function (t) {
|
|
55
|
+
(this._observationTargets = this._observationTargets.filter(function (e) {
|
|
56
|
+
return e.element != t;
|
|
57
|
+
})),
|
|
58
|
+
this._unmonitorIntersections(t.ownerDocument),
|
|
59
|
+
0 == this._observationTargets.length && this._unregisterInstance();
|
|
60
|
+
}),
|
|
61
|
+
(r.prototype.disconnect = function () {
|
|
62
|
+
(this._observationTargets = []),
|
|
63
|
+
this._unmonitorAllIntersections(),
|
|
64
|
+
this._unregisterInstance();
|
|
65
|
+
}),
|
|
66
|
+
(r.prototype.takeRecords = function () {
|
|
67
|
+
var t = this._queuedEntries.slice();
|
|
68
|
+
return (this._queuedEntries = []), t;
|
|
69
|
+
}),
|
|
70
|
+
(r.prototype._initThresholds = function (t) {
|
|
71
|
+
var e = t || [0];
|
|
72
|
+
return (Array.isArray(e) || (e = [e]),
|
|
73
|
+
e.sort().filter(function (t, e, n) {
|
|
74
|
+
if ("number" != typeof t || isNaN(t) || t < 0 || t > 1)
|
|
75
|
+
throw new Error("threshold must be a number between 0 and 1 inclusively");
|
|
76
|
+
return t !== n[e - 1];
|
|
77
|
+
}));
|
|
78
|
+
}),
|
|
79
|
+
(r.prototype._parseRootMargin = function (t) {
|
|
80
|
+
var e = (t || "0px").split(/\s+/).map(function (t) {
|
|
81
|
+
var e = /^(-?\d*\.?\d+)(px|%)$/.exec(t);
|
|
82
|
+
if (!e)
|
|
83
|
+
throw new Error("rootMargin must be specified in pixels or percent");
|
|
84
|
+
return { value: parseFloat(e[1]), unit: e[2] };
|
|
85
|
+
});
|
|
86
|
+
return ((e[1] = e[1] || e[0]),
|
|
87
|
+
(e[2] = e[2] || e[0]),
|
|
88
|
+
(e[3] = e[3] || e[1]),
|
|
89
|
+
e);
|
|
90
|
+
}),
|
|
91
|
+
(r.prototype._monitorIntersections = function (e) {
|
|
92
|
+
var n = e.defaultView;
|
|
93
|
+
if (n && -1 == this._monitoringDocuments.indexOf(e)) {
|
|
94
|
+
var o = this._checkForIntersections, i = null, r = null;
|
|
95
|
+
if ((this.POLL_INTERVAL
|
|
96
|
+
? (i = n.setInterval(o, this.POLL_INTERVAL))
|
|
97
|
+
: (s(n, "resize", o, !0),
|
|
98
|
+
s(e, "scroll", o, !0),
|
|
99
|
+
this.USE_MUTATION_OBSERVER &&
|
|
100
|
+
"MutationObserver" in n &&
|
|
101
|
+
(r = new n.MutationObserver(o)).observe(e, {
|
|
102
|
+
attributes: !0,
|
|
103
|
+
childList: !0,
|
|
104
|
+
characterData: !0,
|
|
105
|
+
subtree: !0,
|
|
106
|
+
})),
|
|
107
|
+
this._monitoringDocuments.push(e),
|
|
108
|
+
this._monitoringUnsubscribes.push(function () {
|
|
109
|
+
var t = e.defaultView;
|
|
110
|
+
t && (i && t.clearInterval(i), h(t, "resize", o, !0)),
|
|
111
|
+
h(e, "scroll", o, !0),
|
|
112
|
+
r && r.disconnect();
|
|
113
|
+
}),
|
|
114
|
+
e != ((this.root && this.root.ownerDocument) || t))) {
|
|
115
|
+
var c = p(e);
|
|
116
|
+
c && this._monitorIntersections(c.ownerDocument);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
(r.prototype._unmonitorIntersections = function (e) {
|
|
121
|
+
var n = this._monitoringDocuments.indexOf(e);
|
|
122
|
+
if (-1 != n) {
|
|
123
|
+
var o = (this.root && this.root.ownerDocument) || t;
|
|
124
|
+
if (!this._observationTargets.some(function (t) {
|
|
125
|
+
var n = t.element.ownerDocument;
|
|
126
|
+
if (n == e)
|
|
127
|
+
return !0;
|
|
128
|
+
for (; n && n != o;) {
|
|
129
|
+
var i = p(n);
|
|
130
|
+
if ((n = i && i.ownerDocument) == e)
|
|
131
|
+
return !0;
|
|
132
|
+
}
|
|
133
|
+
return !1;
|
|
134
|
+
})) {
|
|
135
|
+
var i = this._monitoringUnsubscribes[n];
|
|
136
|
+
if ((this._monitoringDocuments.splice(n, 1),
|
|
137
|
+
this._monitoringUnsubscribes.splice(n, 1),
|
|
138
|
+
i(),
|
|
139
|
+
e != o)) {
|
|
140
|
+
var r = p(e);
|
|
141
|
+
r && this._unmonitorIntersections(r.ownerDocument);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}),
|
|
146
|
+
(r.prototype._unmonitorAllIntersections = function () {
|
|
147
|
+
var t = this._monitoringUnsubscribes.slice(0);
|
|
148
|
+
(this._monitoringDocuments.length = 0),
|
|
149
|
+
(this._monitoringUnsubscribes.length = 0);
|
|
150
|
+
for (var e = 0; e < t.length; e++)
|
|
151
|
+
t[e]();
|
|
152
|
+
}),
|
|
153
|
+
(r.prototype._checkForIntersections = function () {
|
|
154
|
+
if (this.root || !n || o) {
|
|
155
|
+
var t = this._rootIsInDom(), e = t
|
|
156
|
+
? this._getRootRect()
|
|
157
|
+
: { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };
|
|
158
|
+
this._observationTargets.forEach(function (o) {
|
|
159
|
+
var r = o.element, s = c(r), h = this._rootContainsTarget(r), u = o.entry, a = t && h && this._computeTargetAndRootIntersection(r, s, e), l = (o.entry = new i({
|
|
160
|
+
time: window.performance && performance.now && performance.now(),
|
|
161
|
+
target: r,
|
|
162
|
+
boundingClientRect: s,
|
|
163
|
+
rootBounds: n && !this.root ? null : e,
|
|
164
|
+
intersectionRect: a,
|
|
165
|
+
}));
|
|
166
|
+
u
|
|
167
|
+
? t && h
|
|
168
|
+
? this._hasCrossedThreshold(u, l) &&
|
|
169
|
+
this._queuedEntries.push(l)
|
|
170
|
+
: u && u.isIntersecting && this._queuedEntries.push(l)
|
|
171
|
+
: this._queuedEntries.push(l);
|
|
172
|
+
}, this),
|
|
173
|
+
this._queuedEntries.length &&
|
|
174
|
+
this._callback(this.takeRecords(), this);
|
|
175
|
+
}
|
|
176
|
+
}),
|
|
177
|
+
(r.prototype._computeTargetAndRootIntersection = function (e, i, r) {
|
|
178
|
+
if ("none" != window.getComputedStyle(e).display) {
|
|
179
|
+
for (var s, h, u, l, p, d, g, m, v = i, _ = f(e), b = !1; !b && _;) {
|
|
180
|
+
var w = null, y = 1 == _.nodeType ? window.getComputedStyle(_) : {};
|
|
181
|
+
if ("none" == y.display)
|
|
182
|
+
return null;
|
|
183
|
+
if (_ == this.root || 9 == _.nodeType)
|
|
184
|
+
if (((b = !0), _ == this.root || _ == t))
|
|
185
|
+
n && !this.root
|
|
186
|
+
? !o || (0 == o.width && 0 == o.height)
|
|
187
|
+
? ((_ = null), (w = null), (v = null))
|
|
188
|
+
: (w = o)
|
|
189
|
+
: (w = r);
|
|
190
|
+
else {
|
|
191
|
+
var I = f(_), E = I && c(I), T = I && this._computeTargetAndRootIntersection(I, E, r);
|
|
192
|
+
E && T ? ((_ = I), (w = a(E, T))) : ((_ = null), (v = null));
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
var R = _.ownerDocument;
|
|
196
|
+
_ != R.body &&
|
|
197
|
+
_ != R.documentElement &&
|
|
198
|
+
"visible" != y.overflow &&
|
|
199
|
+
(w = c(_));
|
|
200
|
+
}
|
|
201
|
+
if ((w &&
|
|
202
|
+
((s = w),
|
|
203
|
+
(h = v),
|
|
204
|
+
(u = void 0),
|
|
205
|
+
(l = void 0),
|
|
206
|
+
(p = void 0),
|
|
207
|
+
(d = void 0),
|
|
208
|
+
(g = void 0),
|
|
209
|
+
(m = void 0),
|
|
210
|
+
(u = Math.max(s.top, h.top)),
|
|
211
|
+
(l = Math.min(s.bottom, h.bottom)),
|
|
212
|
+
(p = Math.max(s.left, h.left)),
|
|
213
|
+
(d = Math.min(s.right, h.right)),
|
|
214
|
+
(m = l - u),
|
|
215
|
+
(v =
|
|
216
|
+
((g = d - p) >= 0 &&
|
|
217
|
+
m >= 0 && {
|
|
218
|
+
top: u,
|
|
219
|
+
bottom: l,
|
|
220
|
+
left: p,
|
|
221
|
+
right: d,
|
|
222
|
+
width: g,
|
|
223
|
+
height: m,
|
|
224
|
+
}) ||
|
|
225
|
+
null)),
|
|
226
|
+
!v))
|
|
227
|
+
break;
|
|
228
|
+
_ = _ && f(_);
|
|
229
|
+
}
|
|
230
|
+
return v;
|
|
231
|
+
}
|
|
232
|
+
}),
|
|
233
|
+
(r.prototype._getRootRect = function () {
|
|
234
|
+
var e;
|
|
235
|
+
if (this.root)
|
|
236
|
+
e = c(this.root);
|
|
237
|
+
else {
|
|
238
|
+
var n = t.documentElement, o = t.body;
|
|
239
|
+
e = {
|
|
240
|
+
top: 0,
|
|
241
|
+
left: 0,
|
|
242
|
+
right: n.clientWidth || o.clientWidth,
|
|
243
|
+
width: n.clientWidth || o.clientWidth,
|
|
244
|
+
bottom: n.clientHeight || o.clientHeight,
|
|
245
|
+
height: n.clientHeight || o.clientHeight,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
return this._expandRectByRootMargin(e);
|
|
249
|
+
}),
|
|
250
|
+
(r.prototype._expandRectByRootMargin = function (t) {
|
|
251
|
+
var e = this._rootMarginValues.map(function (e, n) {
|
|
252
|
+
return "px" == e.unit
|
|
253
|
+
? e.value
|
|
254
|
+
: (e.value * (n % 2 ? t.width : t.height)) / 100;
|
|
255
|
+
}), n = {
|
|
256
|
+
top: t.top - e[0],
|
|
257
|
+
right: t.right + e[1],
|
|
258
|
+
bottom: t.bottom + e[2],
|
|
259
|
+
left: t.left - e[3],
|
|
260
|
+
};
|
|
261
|
+
return (n.width = n.right - n.left), (n.height = n.bottom - n.top), n;
|
|
262
|
+
}),
|
|
263
|
+
(r.prototype._hasCrossedThreshold = function (t, e) {
|
|
264
|
+
var n = t && t.isIntersecting ? t.intersectionRatio || 0 : -1, o = e.isIntersecting ? e.intersectionRatio || 0 : -1;
|
|
265
|
+
if (n !== o)
|
|
266
|
+
for (var i = 0; i < this.thresholds.length; i++) {
|
|
267
|
+
var r = this.thresholds[i];
|
|
268
|
+
if (r == n || r == o || r < n != r < o)
|
|
269
|
+
return !0;
|
|
270
|
+
}
|
|
271
|
+
}),
|
|
272
|
+
(r.prototype._rootIsInDom = function () {
|
|
273
|
+
return !this.root || l(t, this.root);
|
|
274
|
+
}),
|
|
275
|
+
(r.prototype._rootContainsTarget = function (e) {
|
|
276
|
+
return (l(this.root || t, e) &&
|
|
277
|
+
(!this.root || this.root.ownerDocument == e.ownerDocument));
|
|
278
|
+
}),
|
|
279
|
+
(r.prototype._registerInstance = function () {
|
|
280
|
+
e.indexOf(this) < 0 && e.push(this);
|
|
281
|
+
}),
|
|
282
|
+
(r.prototype._unregisterInstance = function () {
|
|
283
|
+
var t = e.indexOf(this);
|
|
284
|
+
-1 != t && e.splice(t, 1);
|
|
285
|
+
}),
|
|
286
|
+
(window.IntersectionObserver = r),
|
|
287
|
+
(window.IntersectionObserverEntry = i);
|
|
288
|
+
}
|
|
289
|
+
function i(t) {
|
|
290
|
+
(this.time = t.time),
|
|
291
|
+
(this.target = t.target),
|
|
292
|
+
(this.rootBounds = u(t.rootBounds)),
|
|
293
|
+
(this.boundingClientRect = u(t.boundingClientRect)),
|
|
294
|
+
(this.intersectionRect = u(t.intersectionRect || {
|
|
295
|
+
top: 0,
|
|
296
|
+
bottom: 0,
|
|
297
|
+
left: 0,
|
|
298
|
+
right: 0,
|
|
299
|
+
width: 0,
|
|
300
|
+
height: 0,
|
|
301
|
+
})),
|
|
302
|
+
(this.isIntersecting = !!t.intersectionRect);
|
|
303
|
+
var e = this.boundingClientRect, n = e.width * e.height, o = this.intersectionRect, i = o.width * o.height;
|
|
304
|
+
this.intersectionRatio = n
|
|
305
|
+
? Number((i / n).toFixed(4))
|
|
306
|
+
: this.isIntersecting
|
|
307
|
+
? 1
|
|
308
|
+
: 0;
|
|
309
|
+
}
|
|
310
|
+
function r(t, e) {
|
|
311
|
+
var n, o, i, r = e || {};
|
|
312
|
+
if ("function" != typeof t)
|
|
313
|
+
throw new Error("callback must be a function");
|
|
314
|
+
if (r.root && 1 != r.root.nodeType)
|
|
315
|
+
throw new Error("root must be an Element");
|
|
316
|
+
(this._checkForIntersections =
|
|
317
|
+
((n = this._checkForIntersections.bind(this)),
|
|
318
|
+
(o = this.THROTTLE_TIMEOUT),
|
|
319
|
+
(i = null),
|
|
320
|
+
function () {
|
|
321
|
+
i ||
|
|
322
|
+
(i = setTimeout(function () {
|
|
323
|
+
n(), (i = null);
|
|
324
|
+
}, o));
|
|
325
|
+
})),
|
|
326
|
+
(this._callback = t),
|
|
327
|
+
(this._observationTargets = []),
|
|
328
|
+
(this._queuedEntries = []),
|
|
329
|
+
(this._rootMarginValues = this._parseRootMargin(r.rootMargin)),
|
|
330
|
+
(this.thresholds = this._initThresholds(r.threshold)),
|
|
331
|
+
(this.root = r.root || null),
|
|
332
|
+
(this.rootMargin = this._rootMarginValues
|
|
333
|
+
.map(function (t) {
|
|
334
|
+
return t.value + t.unit;
|
|
335
|
+
})
|
|
336
|
+
.join(" ")),
|
|
337
|
+
(this._monitoringDocuments = []),
|
|
338
|
+
(this._monitoringUnsubscribes = []);
|
|
339
|
+
}
|
|
340
|
+
function s(t, e, n, o) {
|
|
341
|
+
"function" == typeof t.addEventListener
|
|
342
|
+
? t.addEventListener(e, n, o || !1)
|
|
343
|
+
: "function" == typeof t.attachEvent && t.attachEvent("on" + e, n);
|
|
344
|
+
}
|
|
345
|
+
function h(t, e, n, o) {
|
|
346
|
+
"function" == typeof t.removeEventListener
|
|
347
|
+
? t.removeEventListener(e, n, o || !1)
|
|
348
|
+
: "function" == typeof t.detatchEvent && t.detatchEvent("on" + e, n);
|
|
349
|
+
}
|
|
350
|
+
function c(t) {
|
|
351
|
+
var e;
|
|
352
|
+
try {
|
|
353
|
+
e = t.getBoundingClientRect();
|
|
354
|
+
}
|
|
355
|
+
catch (t) { }
|
|
356
|
+
return e
|
|
357
|
+
? ((e.width && e.height) ||
|
|
358
|
+
(e = {
|
|
359
|
+
top: e.top,
|
|
360
|
+
right: e.right,
|
|
361
|
+
bottom: e.bottom,
|
|
362
|
+
left: e.left,
|
|
363
|
+
width: e.right - e.left,
|
|
364
|
+
height: e.bottom - e.top,
|
|
365
|
+
}),
|
|
366
|
+
e)
|
|
367
|
+
: { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };
|
|
368
|
+
}
|
|
369
|
+
function u(t) {
|
|
370
|
+
return !t || "x" in t
|
|
371
|
+
? t
|
|
372
|
+
: {
|
|
373
|
+
top: t.top,
|
|
374
|
+
y: t.top,
|
|
375
|
+
bottom: t.bottom,
|
|
376
|
+
left: t.left,
|
|
377
|
+
x: t.left,
|
|
378
|
+
right: t.right,
|
|
379
|
+
width: t.width,
|
|
380
|
+
height: t.height,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
function a(t, e) {
|
|
384
|
+
var n = e.top - t.top, o = e.left - t.left;
|
|
385
|
+
return {
|
|
386
|
+
top: n,
|
|
387
|
+
left: o,
|
|
388
|
+
height: e.height,
|
|
389
|
+
width: e.width,
|
|
390
|
+
bottom: n + e.height,
|
|
391
|
+
right: o + e.width,
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function l(t, e) {
|
|
395
|
+
for (var n = e; n;) {
|
|
396
|
+
if (n == t)
|
|
397
|
+
return !0;
|
|
398
|
+
n = f(n);
|
|
399
|
+
}
|
|
400
|
+
return !1;
|
|
401
|
+
}
|
|
402
|
+
function f(e) {
|
|
403
|
+
var n = e.parentNode;
|
|
404
|
+
return 9 == e.nodeType && e != t
|
|
405
|
+
? p(e)
|
|
406
|
+
: n && 11 == n.nodeType && n.host
|
|
407
|
+
? n.host
|
|
408
|
+
: n && n.assignedSlot
|
|
409
|
+
? n.assignedSlot.parentNode
|
|
410
|
+
: n;
|
|
411
|
+
}
|
|
412
|
+
function p(t) {
|
|
413
|
+
try {
|
|
414
|
+
return (t.defaultView && t.defaultView.frameElement) || null;
|
|
415
|
+
}
|
|
416
|
+
catch (t) {
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
})();
|
|
421
|
+
//# sourceMappingURL=intersectionObserverPolyfill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersectionObserverPolyfill.js","sourceRoot":"","sources":["../../src/utils/intersectionObserverPolyfill.js"],"names":[],"mappings":";AAAA,CAAC,CAAC;IACA,YAAY,CAAC;IACb,IAAI,QAAQ,IAAI,OAAO,MAAM;QAC3B,IACE,sBAAsB,IAAI,MAAM;YAChC,2BAA2B,IAAI,MAAM;YACrC,mBAAmB,IAAI,MAAM,CAAC,yBAAyB,CAAC,SAAS;YAEjE,gBAAgB,IAAI,MAAM,CAAC,yBAAyB,CAAC,SAAS;gBAC5D,MAAM,CAAC,cAAc,CACnB,MAAM,CAAC,yBAAyB,CAAC,SAAS,EAC1C,gBAAgB,EAChB;oBACE,GAAG,EAAE;wBACH,OAAO,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;oBACpC,CAAC;iBACF,CACF,CAAC;aACD;YACH,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,EACrB,CAAC,GAAG,EAAE,EACN,CAAC,GAAG,IAAI,EACR,CAAC,GAAG,IAAI,CAAC;YACX,CAAC,CAAC,CAAC,SAAS,CAAC,gBAAgB,GAAG,GAAG,CAAC;gBAClC,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC;gBAClC,CAAC,CAAC,CAAC,SAAS,CAAC,qBAAqB,GAAG,CAAC,CAAC,CAAC;gBACxC,CAAC,CAAC,CAAC,wBAAwB,GAAG;oBAC5B,OAAO,CACL,CAAC;wBACC,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC;4BACjB,CAAC,CAAC;gCACA,CAAC,IAAI,CAAC;oCACJ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;oCACT,CAAC,CAAC;wCACE,GAAG,EAAE,CAAC;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C,CAAC,CAAC;IACZ,CAAC;IACD,SAAS,CAAC,CAAC,CAAC;QACV,IAAI,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC;YAC9B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACN,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI;gBACjC,CAAC,CAAC,CAAC,CAAC,IAAI;gBACR,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY;oBACrB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU;oBAC3B,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;IACD,SAAS,CAAC,CAAC,CAAC;QACV,IAAI;YACF,OAAO,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC;SAC9D;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,IAAI,CAAC;SACb;IACH,CAAC;AACH,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TrackingOptions } from "../FTTracking";
|
|
2
|
+
import { FTTracking } from "../FTTracking";
|
|
3
|
+
import { gaTracker } from "../gaTracker";
|
|
4
|
+
import { oTracker } from "../oTracker";
|
|
5
|
+
import { ConfigType } from "./yupValidator";
|
|
6
|
+
import "./intersectionObserverPolyfill";
|
|
7
|
+
export declare class ScrollTracker {
|
|
8
|
+
oTracker: oTracker;
|
|
9
|
+
gaTracker: gaTracker;
|
|
10
|
+
options: TrackingOptions;
|
|
11
|
+
attention: any;
|
|
12
|
+
config: ConfigType;
|
|
13
|
+
constructor(FTTracker: FTTracking);
|
|
14
|
+
reset(): void;
|
|
15
|
+
scrollDepthInit(percentages: number[], selector?: string): void;
|
|
16
|
+
intersectionCallback(observer: IntersectionObserver, changes: IntersectionObserverEntry[]): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../src/utils/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAoB,MAAM,gBAAgB,CAAC;AAE9D,OAAO,gCAAgC,CAAC;AAExC,qBAAa,aAAa;IACxB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;gBACP,SAAS,EAAE,UAAU;IAUjC,KAAK;IAQL,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,QAAQ,SAAK;IAuBpD,oBAAoB,CAClB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,yBAAyB,EAAE;CAmCvC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScrollTracker = void 0;
|
|
4
|
+
var attention_1 = require("./attention");
|
|
5
|
+
require("./intersectionObserverPolyfill");
|
|
6
|
+
var ScrollTracker = /** @class */ (function () {
|
|
7
|
+
function ScrollTracker(FTTracker) {
|
|
8
|
+
this.oTracker = FTTracker.oTracker;
|
|
9
|
+
this.gaTracker = FTTracker.gaTracker;
|
|
10
|
+
this.options = FTTracker.options;
|
|
11
|
+
this.config = FTTracker.config;
|
|
12
|
+
this.attention = new attention_1.Attention(this.oTracker);
|
|
13
|
+
this.scrollDepthInit([25, 50, 75, 100], this.options.scrollTrackerSelector);
|
|
14
|
+
}
|
|
15
|
+
ScrollTracker.prototype.reset = function () {
|
|
16
|
+
document.querySelectorAll("[data-percentage]").forEach(function (element) {
|
|
17
|
+
element.remove();
|
|
18
|
+
});
|
|
19
|
+
this.attention = new attention_1.Attention(this.oTracker);
|
|
20
|
+
this.scrollDepthInit([25, 50, 75, 100], this.options.scrollTrackerSelector);
|
|
21
|
+
};
|
|
22
|
+
ScrollTracker.prototype.scrollDepthInit = function (percentages, selector) {
|
|
23
|
+
var _this = this;
|
|
24
|
+
if (selector === void 0) { selector = ""; }
|
|
25
|
+
var element = document.querySelector(selector);
|
|
26
|
+
if (element && window.IntersectionObserver) {
|
|
27
|
+
var observer_1 = new IntersectionObserver(function (changes) {
|
|
28
|
+
_this.intersectionCallback(observer_1, changes);
|
|
29
|
+
});
|
|
30
|
+
percentages.forEach(function (percentage) {
|
|
31
|
+
// add a scroll depth marker element
|
|
32
|
+
var targetEl = document.createElement("div");
|
|
33
|
+
targetEl.className = "n-ui__scroll-depth-marker";
|
|
34
|
+
targetEl.style.position = "absolute";
|
|
35
|
+
targetEl.style.top = "".concat(percentage, "%");
|
|
36
|
+
targetEl.style.bottom = "0";
|
|
37
|
+
targetEl.style.width = "100%";
|
|
38
|
+
targetEl.style.zIndex = "-1";
|
|
39
|
+
targetEl.setAttribute("data-percentage", percentage.toString());
|
|
40
|
+
element.appendChild(targetEl);
|
|
41
|
+
observer_1.observe(targetEl);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
ScrollTracker.prototype.intersectionCallback = function (observer, changes) {
|
|
46
|
+
var _this = this;
|
|
47
|
+
changes.forEach(function (change) {
|
|
48
|
+
if (change.isIntersecting || change.intersectionRatio > 0) {
|
|
49
|
+
var scrollDepthMarkerEl = change.target;
|
|
50
|
+
var percentagesViewed = scrollDepthMarkerEl.getAttribute("data-percentage");
|
|
51
|
+
var data = {
|
|
52
|
+
action: "scrolldepth",
|
|
53
|
+
category: "page",
|
|
54
|
+
meta: {
|
|
55
|
+
percentagesViewed: percentagesViewed,
|
|
56
|
+
},
|
|
57
|
+
product: _this.config.product,
|
|
58
|
+
source: _this.config.product,
|
|
59
|
+
app: _this.config.app,
|
|
60
|
+
};
|
|
61
|
+
_this.oTracker.eventDispatcher(data);
|
|
62
|
+
//send GA scroll events if not GTM
|
|
63
|
+
if (!_this.options.isCustomGTMEvent) {
|
|
64
|
+
_this.gaTracker.GtagEventDispatcher("Scroll", "scroll - ".concat(percentagesViewed, "%"), window.location.pathname);
|
|
65
|
+
}
|
|
66
|
+
if (scrollDepthMarkerEl.parentNode) {
|
|
67
|
+
scrollDepthMarkerEl.parentNode.removeChild(scrollDepthMarkerEl);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
return ScrollTracker;
|
|
73
|
+
}());
|
|
74
|
+
exports.ScrollTracker = ScrollTracker;
|
|
75
|
+
//# sourceMappingURL=scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../src/utils/scroll.ts"],"names":[],"mappings":";;;AAIA,yCAAwC;AAGxC,0CAAwC;AAExC;IAME,uBAAY,SAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;QAE/B,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC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C,CAAC;IACL,CAAC;IACH,oBAAC;AAAD,CAAC,AApFD,IAoFC;AApFY,sCAAa"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { InferType, ValidationError } from "yup";
|
|
2
|
+
declare const configSchema: import("yup").ObjectSchema<{
|
|
3
|
+
product: any;
|
|
4
|
+
url: string;
|
|
5
|
+
feature: string;
|
|
6
|
+
author: string;
|
|
7
|
+
sponsor: string;
|
|
8
|
+
articleName: string;
|
|
9
|
+
videoName: string;
|
|
10
|
+
videoType: string;
|
|
11
|
+
hasVideo: boolean | null | undefined;
|
|
12
|
+
primaryTopic: string;
|
|
13
|
+
secondaryTopic: string;
|
|
14
|
+
advertiserIndustry: string;
|
|
15
|
+
app: string;
|
|
16
|
+
publishDate: string | null;
|
|
17
|
+
isBranded: boolean;
|
|
18
|
+
contentType: string;
|
|
19
|
+
campaign: string;
|
|
20
|
+
server: any;
|
|
21
|
+
title: string;
|
|
22
|
+
adbook_campaign_id: string;
|
|
23
|
+
source_id: string | undefined;
|
|
24
|
+
wordCount: number | undefined;
|
|
25
|
+
commercial_product: string;
|
|
26
|
+
}, import("yup").AnyObject, {
|
|
27
|
+
product: any;
|
|
28
|
+
url: undefined;
|
|
29
|
+
feature: undefined;
|
|
30
|
+
author: "";
|
|
31
|
+
sponsor: "";
|
|
32
|
+
articleName: "";
|
|
33
|
+
videoName: "";
|
|
34
|
+
videoType: "";
|
|
35
|
+
hasVideo: undefined;
|
|
36
|
+
primaryTopic: "";
|
|
37
|
+
secondaryTopic: "";
|
|
38
|
+
advertiserIndustry: "";
|
|
39
|
+
app: undefined;
|
|
40
|
+
publishDate: "";
|
|
41
|
+
isBranded: undefined;
|
|
42
|
+
contentType: "";
|
|
43
|
+
campaign: "";
|
|
44
|
+
server: any;
|
|
45
|
+
title: "";
|
|
46
|
+
adbook_campaign_id: "";
|
|
47
|
+
source_id: undefined;
|
|
48
|
+
wordCount: undefined;
|
|
49
|
+
commercial_product: "ft";
|
|
50
|
+
}, "">;
|
|
51
|
+
declare const gtmCustomEventSchema: import("yup").ObjectSchema<{
|
|
52
|
+
category: string;
|
|
53
|
+
action: string;
|
|
54
|
+
label: string;
|
|
55
|
+
}, import("yup").AnyObject, {
|
|
56
|
+
category: undefined;
|
|
57
|
+
action: undefined;
|
|
58
|
+
label: undefined;
|
|
59
|
+
}, "">;
|
|
60
|
+
declare const origamiEventSchema: import("yup").ObjectSchema<{
|
|
61
|
+
category: string;
|
|
62
|
+
action: string;
|
|
63
|
+
app: import("yup").Maybe<string | null | undefined>;
|
|
64
|
+
product: import("yup").Maybe<string | null | undefined>;
|
|
65
|
+
source: import("yup").Maybe<string | null | undefined>;
|
|
66
|
+
meta: import("yup").Maybe<{} | null | undefined>;
|
|
67
|
+
duration: import("yup").Maybe<number | null | undefined>;
|
|
68
|
+
progress: import("yup").Maybe<number | null | undefined>;
|
|
69
|
+
}, import("yup").AnyObject, {
|
|
70
|
+
category: undefined;
|
|
71
|
+
action: undefined;
|
|
72
|
+
app: undefined;
|
|
73
|
+
product: undefined;
|
|
74
|
+
source: undefined;
|
|
75
|
+
meta: undefined;
|
|
76
|
+
duration: undefined;
|
|
77
|
+
progress: undefined;
|
|
78
|
+
}, "">;
|
|
79
|
+
export type ConfigType = InferType<typeof configSchema>;
|
|
80
|
+
export type GTMCustomEventType = InferType<typeof gtmCustomEventSchema>;
|
|
81
|
+
export type OrigamiEventType = InferType<typeof origamiEventSchema>;
|
|
82
|
+
export declare const parseConfig: (config: ConfigType) => ConfigType;
|
|
83
|
+
export declare const validateConfig: (config: ConfigType) => ValidationError[] | undefined;
|
|
84
|
+
export declare const validateGTMCustomEvent: (event: GTMCustomEventType) => ValidationError[] | undefined;
|
|
85
|
+
export declare const validateOrigamiEvent: (config: OrigamiEventType) => ValidationError[] | undefined;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=yupValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yupValidator.d.ts","sourceRoot":"","sources":["../../src/utils/yupValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,SAAS,EACT,eAAe,EAChB,MAAM,KAAK,CAAC;AAqBb,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8ChB,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;;;;;;MAiBxB,CAAC;AAEH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;MAkCtB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,WAAW,WAAY,UAAU,KAAG,UAmBhD,CAAC;AAEF,eAAO,MAAM,cAAc,WACjB,UAAU,KACjB,eAAe,EAAE,GAAG,SAYtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,UAC1B,kBAAkB,KACxB,eAAe,EAAE,GAAG,SAYtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,WACvB,gBAAgB,KACvB,eAAe,EAAE,GAAG,SAatB,CAAC"}
|