@usermaven/nextjs 1.5.9 → 1.5.10
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/lib/index.es.js +25 -22
- package/package.json +2 -2
package/lib/index.es.js
CHANGED
|
@@ -104,14 +104,14 @@ class ne {
|
|
|
104
104
|
return i ? i[0] : "";
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
const se = Object.prototype, re = se.hasOwnProperty, oe = Array.prototype, T = oe.forEach,
|
|
107
|
+
const se = Object.prototype, re = se.hasOwnProperty, oe = Array.prototype, T = oe.forEach, U = {};
|
|
108
108
|
function ae(n, e, t) {
|
|
109
109
|
if (Array.isArray(n)) {
|
|
110
110
|
if (T && n.forEach === T)
|
|
111
111
|
n.forEach(e, t);
|
|
112
112
|
else if ("length" in n && n.length === +n.length) {
|
|
113
113
|
for (let i = 0, s = n.length; i < s; i++)
|
|
114
|
-
if (i in n && e.call(t, n[i], i) ===
|
|
114
|
+
if (i in n && e.call(t, n[i], i) === U)
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
@@ -128,11 +128,11 @@ function w(n, e, t) {
|
|
|
128
128
|
n.forEach(e, t);
|
|
129
129
|
else if ("length" in n && n.length === +n.length) {
|
|
130
130
|
for (let i = 0, s = n.length; i < s; i++)
|
|
131
|
-
if (i in n && e.call(t, n[i], i) ===
|
|
131
|
+
if (i in n && e.call(t, n[i], i) === U)
|
|
132
132
|
return;
|
|
133
133
|
} else
|
|
134
134
|
for (const i in n)
|
|
135
|
-
if (re.call(n, i) && e.call(t, n[i], i) ===
|
|
135
|
+
if (re.call(n, i) && e.call(t, n[i], i) === U)
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -142,7 +142,7 @@ const le = function(n, ...e) {
|
|
|
142
142
|
t[i] !== void 0 && (n[i] = t[i]);
|
|
143
143
|
}), n;
|
|
144
144
|
};
|
|
145
|
-
function
|
|
145
|
+
function S(n, e) {
|
|
146
146
|
return n.indexOf(e) !== -1;
|
|
147
147
|
}
|
|
148
148
|
const ue = function(n) {
|
|
@@ -252,7 +252,7 @@ function G(n) {
|
|
|
252
252
|
function z(n) {
|
|
253
253
|
return !!n && n.nodeType === 11;
|
|
254
254
|
}
|
|
255
|
-
const
|
|
255
|
+
const $ = ["a", "button", "form", "input", "select", "textarea", "label"];
|
|
256
256
|
function ge(n, e) {
|
|
257
257
|
if (!n || y(n, "html") || !Y(n))
|
|
258
258
|
return !1;
|
|
@@ -265,12 +265,12 @@ function ge(n, e) {
|
|
|
265
265
|
let i = !1;
|
|
266
266
|
for (t = n; t && !y(t, "body"); ) {
|
|
267
267
|
if (t.parentNode && z(t.parentNode)) {
|
|
268
|
-
t = t.parentNode.host, t &&
|
|
268
|
+
t = t.parentNode.host, t && $.indexOf(t.tagName.toLowerCase()) > -1 && (i = !0);
|
|
269
269
|
continue;
|
|
270
270
|
}
|
|
271
271
|
const o = t.parentNode;
|
|
272
272
|
if (!o) break;
|
|
273
|
-
if (
|
|
273
|
+
if ($.indexOf(o.tagName.toLowerCase()) > -1)
|
|
274
274
|
i = !0;
|
|
275
275
|
else {
|
|
276
276
|
const a = window.getComputedStyle(o);
|
|
@@ -293,16 +293,16 @@ function ge(n, e) {
|
|
|
293
293
|
case "textarea":
|
|
294
294
|
return e.type === "change" || e.type === "click";
|
|
295
295
|
default:
|
|
296
|
-
return i ? e.type === "click" : e.type === "click" && (
|
|
296
|
+
return i ? e.type === "click" : e.type === "click" && ($.indexOf(r) > -1 || n.getAttribute("contenteditable") === "true");
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
function M(n) {
|
|
300
300
|
for (let i = n; i.parentNode && !y(i, "body"); i = i.parentNode) {
|
|
301
301
|
const s = x(i).split(" ");
|
|
302
|
-
if (
|
|
302
|
+
if (S(s, "ph-sensitive") || S(s, "ph-no-capture"))
|
|
303
303
|
return !1;
|
|
304
304
|
}
|
|
305
|
-
if (
|
|
305
|
+
if (S(x(n).split(" "), "ph-include"))
|
|
306
306
|
return !0;
|
|
307
307
|
const e = n.type || "";
|
|
308
308
|
if (typeof e == "string")
|
|
@@ -414,6 +414,9 @@ class _e {
|
|
|
414
414
|
this.send(), this.milestones = this.milestones.filter((s) => s !== i);
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
|
+
destroy() {
|
|
418
|
+
window.removeEventListener("scroll", this.debouncedHandleScroll);
|
|
419
|
+
}
|
|
417
420
|
}
|
|
418
421
|
const R = class R {
|
|
419
422
|
constructor(e, t, i = f()) {
|
|
@@ -474,7 +477,7 @@ const R = class R {
|
|
|
474
477
|
const _ = M(p);
|
|
475
478
|
p.tagName.toLowerCase() === "a" && (l = p.getAttribute("href"), l = _ && C(l) && l);
|
|
476
479
|
const u = x(p).split(" ");
|
|
477
|
-
|
|
480
|
+
S(u, "ph-no-capture") && (c = !0), a.push(
|
|
478
481
|
this.getPropertiesFromElement(
|
|
479
482
|
p,
|
|
480
483
|
this.options.maskAllElementAttributes ?? !1,
|
|
@@ -499,7 +502,7 @@ const R = class R {
|
|
|
499
502
|
w(i.event_selectors, (s) => {
|
|
500
503
|
const r = document.querySelectorAll(s);
|
|
501
504
|
w(r, (o) => {
|
|
502
|
-
|
|
505
|
+
S(e, o) && M(o) && (t[i.name] = this.extractCustomPropertyValue(i));
|
|
503
506
|
});
|
|
504
507
|
});
|
|
505
508
|
}), t;
|
|
@@ -519,7 +522,7 @@ const R = class R {
|
|
|
519
522
|
const s = e.tagName.toLowerCase(), r = {
|
|
520
523
|
tag_name: s
|
|
521
524
|
};
|
|
522
|
-
|
|
525
|
+
$.indexOf(s) > -1 && !i && (r.$el_text = V(e));
|
|
523
526
|
const o = x(e);
|
|
524
527
|
o.length > 0 && (r.classes = o.split(" ").filter(function(d) {
|
|
525
528
|
return d !== "";
|
|
@@ -772,7 +775,7 @@ class W {
|
|
|
772
775
|
h() && this.persistence.set("queue", JSON.stringify(this.queue));
|
|
773
776
|
}
|
|
774
777
|
}
|
|
775
|
-
class
|
|
778
|
+
class Se {
|
|
776
779
|
constructor(e) {
|
|
777
780
|
this.clicks = [], this.threshold = 3, this.timeWindow = 2e3, this.distanceThreshold = 30, this.client = e, this.initializeEventListener(), Z(this);
|
|
778
781
|
}
|
|
@@ -806,7 +809,7 @@ class $e {
|
|
|
806
809
|
}), this.clicks = [];
|
|
807
810
|
}
|
|
808
811
|
}
|
|
809
|
-
class
|
|
812
|
+
class $e {
|
|
810
813
|
constructor(e, t, i = f()) {
|
|
811
814
|
this.trackingHost = e, this.logger = i, this.config = t;
|
|
812
815
|
}
|
|
@@ -976,7 +979,7 @@ class N {
|
|
|
976
979
|
trackFieldChanges: !1
|
|
977
980
|
});
|
|
978
981
|
}
|
|
979
|
-
this.config.autoPageview && (this.pageviewTracking = new be(this)), this.config.crossDomainLinking && this.manageCrossDomainLinking(), this.config.rageClick && (this.rageClick = new
|
|
982
|
+
this.config.autoPageview && (this.pageviewTracking = new be(this)), this.config.crossDomainLinking && this.manageCrossDomainLinking(), this.config.rageClick && (this.rageClick = new Se(this)), this.setupPageLeaveTracking();
|
|
980
983
|
}
|
|
981
984
|
/**
|
|
982
985
|
* Recursively merge the provided configuration with the existing defaultConfig
|
|
@@ -1027,7 +1030,7 @@ class N {
|
|
|
1027
1030
|
initializeTransport(e) {
|
|
1028
1031
|
const t = "https://events.usermaven.com";
|
|
1029
1032
|
if (!h())
|
|
1030
|
-
return new
|
|
1033
|
+
return new $e(e.trackingHost || t, e);
|
|
1031
1034
|
const i = "XMLHttpRequest" in window, s = typeof fetch < "u", r = typeof navigator < "u" && "sendBeacon" in navigator;
|
|
1032
1035
|
if (e.useBeaconApi && r)
|
|
1033
1036
|
return new Ee(e.trackingHost || t, e, this.logger);
|
|
@@ -1363,7 +1366,7 @@ function He(n, e) {
|
|
|
1363
1366
|
u && i.push(u);
|
|
1364
1367
|
}
|
|
1365
1368
|
}
|
|
1366
|
-
let K = !1,
|
|
1369
|
+
let K = !1, L = null;
|
|
1367
1370
|
if (h()) {
|
|
1368
1371
|
const n = Ce();
|
|
1369
1372
|
n && n("usermaven", [], function() {
|
|
@@ -1372,15 +1375,15 @@ if (h()) {
|
|
|
1372
1375
|
UsermavenClient: N,
|
|
1373
1376
|
LogLevel: k,
|
|
1374
1377
|
// Expose the script tag client if it exists
|
|
1375
|
-
getScriptTagClient: () =>
|
|
1378
|
+
getScriptTagClient: () => L
|
|
1376
1379
|
};
|
|
1377
|
-
}), typeof window < "u" && (window.usermavenClient = I, window.UsermavenClient = N, window.usermavenScriptTagClient = () =>
|
|
1380
|
+
}), typeof window < "u" && (window.usermavenClient = I, window.UsermavenClient = N, window.usermavenScriptTagClient = () => L), function(e, t) {
|
|
1378
1381
|
const i = e.currentScript;
|
|
1379
1382
|
function s() {
|
|
1380
1383
|
return K || !i || !i.hasAttribute("data-key") || i.getAttribute("data-no-auto-init") === "true" ? !1 : i.src.includes("lib.js");
|
|
1381
1384
|
}
|
|
1382
1385
|
function r() {
|
|
1383
|
-
s() && (console.log("[Usermaven] Auto-initializing from script tag"),
|
|
1386
|
+
s() && (console.log("[Usermaven] Auto-initializing from script tag"), L = xe(i), K = !0);
|
|
1384
1387
|
}
|
|
1385
1388
|
typeof t < "u" && i && (e.readyState === "loading" ? e.addEventListener("DOMContentLoaded", r) : r());
|
|
1386
1389
|
}(document, window);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usermaven/nextjs",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.10",
|
|
4
4
|
"description": "Usermaven JavaScript SDK for NextJS",
|
|
5
5
|
"author": "Usermaven <hello@usermaven.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@usermaven/sdk-js": "1.5.
|
|
21
|
+
"@usermaven/sdk-js": "1.5.10",
|
|
22
22
|
"cookie": "^0.5.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|