aurea-tracking-sdk 1.3.2 → 1.3.3
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/dist/index.js +24 -20
- package/dist/index.mjs +24 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -630,26 +630,30 @@ var AureaSDK = class {
|
|
|
630
630
|
if (typeof navigator === "undefined") return void 0;
|
|
631
631
|
const parser = new import_ua_parser_js.UAParser(navigator.userAgent);
|
|
632
632
|
const result = parser.getResult();
|
|
633
|
+
const screenWidth = window.screen?.width || 0;
|
|
634
|
+
const screenHeight = window.screen?.height || 0;
|
|
633
635
|
let deviceType = "Desktop";
|
|
634
636
|
if (result.device.type) {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
637
|
+
const type = result.device.type.toLowerCase();
|
|
638
|
+
if (type === "mobile") {
|
|
639
|
+
deviceType = "Mobile";
|
|
640
|
+
} else if (type === "tablet") {
|
|
641
|
+
deviceType = "Tablet";
|
|
642
|
+
} else if (type === "smarttv") {
|
|
643
|
+
deviceType = "Smart TV";
|
|
644
|
+
} else if (type === "wearable") {
|
|
645
|
+
deviceType = "Wearable";
|
|
646
|
+
} else if (type === "console") {
|
|
647
|
+
deviceType = "Console";
|
|
648
|
+
}
|
|
649
|
+
} else {
|
|
650
|
+
const aspectRatio = screenWidth / screenHeight;
|
|
651
|
+
if (screenWidth >= 2560 || aspectRatio >= 2.2) {
|
|
652
|
+
deviceType = "Ultrawide";
|
|
653
|
+
} else if (screenWidth < 1920) {
|
|
654
|
+
deviceType = "Laptop";
|
|
655
|
+
} else {
|
|
656
|
+
deviceType = "Desktop";
|
|
653
657
|
}
|
|
654
658
|
}
|
|
655
659
|
return {
|
|
@@ -659,8 +663,8 @@ var AureaSDK = class {
|
|
|
659
663
|
browserVersion: result.browser.version || "Unknown",
|
|
660
664
|
osName: result.os.name || "Unknown",
|
|
661
665
|
osVersion: result.os.version || "Unknown",
|
|
662
|
-
screenWidth
|
|
663
|
-
screenHeight
|
|
666
|
+
screenWidth,
|
|
667
|
+
screenHeight,
|
|
664
668
|
language: navigator.language,
|
|
665
669
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
666
670
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -601,26 +601,30 @@ var AureaSDK = class {
|
|
|
601
601
|
if (typeof navigator === "undefined") return void 0;
|
|
602
602
|
const parser = new UAParser(navigator.userAgent);
|
|
603
603
|
const result = parser.getResult();
|
|
604
|
+
const screenWidth = window.screen?.width || 0;
|
|
605
|
+
const screenHeight = window.screen?.height || 0;
|
|
604
606
|
let deviceType = "Desktop";
|
|
605
607
|
if (result.device.type) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
608
|
+
const type = result.device.type.toLowerCase();
|
|
609
|
+
if (type === "mobile") {
|
|
610
|
+
deviceType = "Mobile";
|
|
611
|
+
} else if (type === "tablet") {
|
|
612
|
+
deviceType = "Tablet";
|
|
613
|
+
} else if (type === "smarttv") {
|
|
614
|
+
deviceType = "Smart TV";
|
|
615
|
+
} else if (type === "wearable") {
|
|
616
|
+
deviceType = "Wearable";
|
|
617
|
+
} else if (type === "console") {
|
|
618
|
+
deviceType = "Console";
|
|
619
|
+
}
|
|
620
|
+
} else {
|
|
621
|
+
const aspectRatio = screenWidth / screenHeight;
|
|
622
|
+
if (screenWidth >= 2560 || aspectRatio >= 2.2) {
|
|
623
|
+
deviceType = "Ultrawide";
|
|
624
|
+
} else if (screenWidth < 1920) {
|
|
625
|
+
deviceType = "Laptop";
|
|
626
|
+
} else {
|
|
627
|
+
deviceType = "Desktop";
|
|
624
628
|
}
|
|
625
629
|
}
|
|
626
630
|
return {
|
|
@@ -630,8 +634,8 @@ var AureaSDK = class {
|
|
|
630
634
|
browserVersion: result.browser.version || "Unknown",
|
|
631
635
|
osName: result.os.name || "Unknown",
|
|
632
636
|
osVersion: result.os.version || "Unknown",
|
|
633
|
-
screenWidth
|
|
634
|
-
screenHeight
|
|
637
|
+
screenWidth,
|
|
638
|
+
screenHeight,
|
|
635
639
|
language: navigator.language,
|
|
636
640
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
637
641
|
};
|