@braze/web-sdk 5.6.0 → 5.6.1
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/index.d.ts +1 -1
- package/package.json +1 -1
- package/shared-lib/logger.js +2 -2
- package/src/managers/braze-instance.js +1 -1
- package/src/models/server-config.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/browser-detector.js +5 -4
- package/src/util/client-hints-parser.js +2 -2
- package/src/util/user-agent-parser.js +13 -13
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Type definitions for @braze/web-sdk v5.6.
|
|
2
|
+
* Type definitions for @braze/web-sdk v5.6.1
|
|
3
3
|
* Project: https://github.com/braze-inc/braze-web-sdk
|
|
4
4
|
* (c) Braze, Inc. 2024 - http://braze.com
|
|
5
5
|
* License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
|
package/package.json
CHANGED
package/shared-lib/logger.js
CHANGED
|
@@ -24,13 +24,13 @@ const N = {
|
|
|
24
24
|
},
|
|
25
25
|
warn: function (n) {
|
|
26
26
|
if (N.zg) {
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (v5.6.
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v5.6.1)";
|
|
28
28
|
null != N.vd ? N.vd(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function (n) {
|
|
32
32
|
if (N.zg) {
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (v5.6.
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v5.6.1)";
|
|
34
34
|
null != N.vd ? N.vd(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -38,7 +38,7 @@ export default class Jt {
|
|
|
38
38
|
}
|
|
39
39
|
Bs() {
|
|
40
40
|
return {
|
|
41
|
-
s: "5.6.
|
|
41
|
+
s: "5.6.1",
|
|
42
42
|
l: this.dl,
|
|
43
43
|
e: this.wl,
|
|
44
44
|
a: this.yl,
|
|
@@ -54,7 +54,7 @@ export default class Jt {
|
|
|
54
54
|
static Qn(t) {
|
|
55
55
|
let i = t.l;
|
|
56
56
|
return (
|
|
57
|
-
"5.6.
|
|
57
|
+
"5.6.1" !== t.s && (i = 0),
|
|
58
58
|
new Jt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
|
|
59
59
|
);
|
|
60
60
|
}
|
package/src/ui/js/attach-css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import r, { OPTIONS as z } from "../../managers/braze-instance.js";
|
|
2
2
|
export function attachCSS(n, t, o) {
|
|
3
3
|
const c = n || document.querySelector("head"),
|
|
4
|
-
e = `ab-${t}-css-definitions-${"5.6.
|
|
4
|
+
e = `ab-${t}-css-definitions-${"5.6.1".replace(/\./g, "-")}`;
|
|
5
5
|
if (!c) return;
|
|
6
6
|
const s = c.ownerDocument || document;
|
|
7
7
|
if (null == s.getElementById(e)) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import ai from "./client-hints-parser.js";
|
|
2
|
-
import
|
|
3
|
-
import { Browsers as
|
|
2
|
+
import gi from "./user-agent-parser.js";
|
|
3
|
+
import { Browsers as oi, OperatingSystems as so } from "./device-constants.js";
|
|
4
4
|
class ui {
|
|
5
5
|
constructor() {
|
|
6
|
-
const t = navigator.userAgentData ? ai :
|
|
6
|
+
const t = navigator.userAgentData ? ai : gi;
|
|
7
7
|
(this.Sg = new t()),
|
|
8
8
|
(this.userAgent = navigator.userAgent),
|
|
9
9
|
(this.browser = this.Sg.ef()),
|
|
@@ -21,7 +21,7 @@ class ui {
|
|
|
21
21
|
(this.Pa = ui.vg(this.userAgent));
|
|
22
22
|
}
|
|
23
23
|
dE() {
|
|
24
|
-
return this.browser ===
|
|
24
|
+
return this.browser === oi.Bg;
|
|
25
25
|
}
|
|
26
26
|
Qa() {
|
|
27
27
|
return this.OS || null;
|
|
@@ -73,6 +73,7 @@ ui.kg = [
|
|
|
73
73
|
},
|
|
74
74
|
{ string: navigator.platform, cf: "Pike v", identity: so.ao },
|
|
75
75
|
{ string: navigator.userAgent, cf: ["Web0S"], identity: "WebOS" },
|
|
76
|
+
{ string: navigator.userAgent, cf: "Tizen", identity: "Tizen" },
|
|
76
77
|
{
|
|
77
78
|
string: navigator.platform,
|
|
78
79
|
cf: ["Linux armv7l", "Android"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Oe from "./base-device-parser.js";
|
|
2
|
-
import { Browsers as
|
|
2
|
+
import { Browsers as oi } from "./device-constants.js";
|
|
3
3
|
export default class ai extends Oe {
|
|
4
4
|
constructor() {
|
|
5
5
|
if (
|
|
@@ -41,7 +41,7 @@ export default class ai extends Oe {
|
|
|
41
41
|
s = this.userAgentData.brands;
|
|
42
42
|
if (s && s.length)
|
|
43
43
|
for (const r of s) {
|
|
44
|
-
const s = this.Vc(
|
|
44
|
+
const s = this.Vc(oi),
|
|
45
45
|
i = r.brand.match(s);
|
|
46
46
|
if (i && i.length > 0) {
|
|
47
47
|
(t.browser = i[0]), (t.version = r.version);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Oe from "./base-device-parser.js";
|
|
2
|
-
import { Browsers as
|
|
3
|
-
export default class
|
|
2
|
+
import { Browsers as oi, OperatingSystems as so } from "./device-constants.js";
|
|
3
|
+
export default class gi extends Oe {
|
|
4
4
|
constructor() {
|
|
5
|
-
super(), (this.fd =
|
|
5
|
+
super(), (this.fd = gi.Bc(navigator.userAgent || ""));
|
|
6
6
|
}
|
|
7
7
|
ef() {
|
|
8
8
|
return this.fd[0] || "Unknown Browser";
|
|
@@ -13,7 +13,7 @@ export default class oi extends Oe {
|
|
|
13
13
|
Ja(r) {
|
|
14
14
|
for (let n = 0; n < r.length; n++) {
|
|
15
15
|
const e = r[n].string;
|
|
16
|
-
let i =
|
|
16
|
+
let i = gi.nf(e, r[n]);
|
|
17
17
|
if (i)
|
|
18
18
|
return (
|
|
19
19
|
i === so.Pg && navigator.maxTouchPoints > 1 && (i = so.ao),
|
|
@@ -41,37 +41,37 @@ export default class oi extends Oe {
|
|
|
41
41
|
if (r.match(/\b(Roku)\b/)) return ["Roku", null];
|
|
42
42
|
if (r.match(/\bAFTM\b/)) return ["Amazon Fire Stick", null];
|
|
43
43
|
if (
|
|
44
|
-
e[1] ===
|
|
44
|
+
e[1] === oi.rO &&
|
|
45
45
|
((n = r.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/)),
|
|
46
46
|
null != n)
|
|
47
47
|
)
|
|
48
48
|
return (
|
|
49
49
|
(n = n.slice(1)),
|
|
50
|
-
(n[0] = n[0].replace("OPR",
|
|
51
|
-
(n[0] = n[0].replace("EdgA",
|
|
52
|
-
"Edg" === n[0] && (n[0] =
|
|
50
|
+
(n[0] = n[0].replace("OPR", oi.oO)),
|
|
51
|
+
(n[0] = n[0].replace("EdgA", oi.eO)),
|
|
52
|
+
"Edg" === n[0] && (n[0] = oi.eO),
|
|
53
53
|
[n[0], n[1]]
|
|
54
54
|
);
|
|
55
55
|
if (
|
|
56
|
-
e[1] ===
|
|
56
|
+
e[1] === oi.Bg &&
|
|
57
57
|
((n = r.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/)), null != n)
|
|
58
58
|
)
|
|
59
59
|
return (
|
|
60
|
-
(n = n.slice(1)), (n[0] = n[0].replace("EdgiOS",
|
|
60
|
+
(n = n.slice(1)), (n[0] = n[0].replace("EdgiOS", oi.eO)), [n[0], n[1]]
|
|
61
61
|
);
|
|
62
62
|
if (
|
|
63
63
|
((e = e[2] ? [e[1], e[2]] : [null, null]),
|
|
64
|
-
e[0] ===
|
|
64
|
+
e[0] === oi.Bg &&
|
|
65
65
|
null != (n = r.match(/version\/(\.?\d+(\.\d+)*)/i)) &&
|
|
66
66
|
e.splice(1, 1, n[1]),
|
|
67
67
|
null != (n = r.match(/\b(UCBrowser)\/(\.?\d+(\.\d+)*)/)) &&
|
|
68
68
|
e.splice(1, 1, n[2]),
|
|
69
|
-
e[0] ===
|
|
69
|
+
e[0] === oi.oO && null != (n = r.match(/mini\/(\.?\d+(\.\d+)*)/i)))
|
|
70
70
|
)
|
|
71
71
|
return ["Opera Mini", n[1] || ""];
|
|
72
72
|
if (e[0]) {
|
|
73
73
|
const r = e[0].toLowerCase();
|
|
74
|
-
"crios" === r && (e[0] =
|
|
74
|
+
"crios" === r && (e[0] = oi.rO),
|
|
75
75
|
"tizen" === r && ((e[0] = "Samsung Smart TV"), (e[1] = null)),
|
|
76
76
|
"samsungbrowser" === r && (e[0] = "Samsung Browser");
|
|
77
77
|
}
|