@plattar/plattar-ar-adapter 1.139.2 → 1.140.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/build/es2015/plattar-ar-adapter.js +42 -40
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +30 -43
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/util/util.d.ts +6 -1
- package/dist/util/util.js +29 -42
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
package/dist/util/util.d.ts
CHANGED
|
@@ -6,8 +6,13 @@ export declare class Util {
|
|
|
6
6
|
static canQuicklook(): boolean;
|
|
7
7
|
static canSceneViewer(): boolean;
|
|
8
8
|
static canRealityViewer(): boolean;
|
|
9
|
-
static
|
|
9
|
+
static isSafariOnIOS(): boolean;
|
|
10
10
|
static isChromeOnIOS(): boolean;
|
|
11
|
+
static isIOS(): boolean;
|
|
12
|
+
static isAndroid(): boolean;
|
|
13
|
+
static isFirefox(): boolean;
|
|
14
|
+
static isOculus(): boolean;
|
|
15
|
+
static isSafari(): boolean;
|
|
11
16
|
static getIOSVersion(): number[];
|
|
12
17
|
static getChromeVersion(): number;
|
|
13
18
|
}
|
package/dist/util/util.js
CHANGED
|
@@ -6,58 +6,45 @@ exports.Util = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
class Util {
|
|
8
8
|
static canAugment() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// inside instagram browser
|
|
17
|
-
if (/\bInstagram/i.test(userAgent)) {
|
|
18
|
-
return false;
|
|
9
|
+
return Util.canQuicklook() || Util.canSceneViewer();
|
|
10
|
+
}
|
|
11
|
+
static canQuicklook() {
|
|
12
|
+
if (Util.isIOS()) {
|
|
13
|
+
const isWKWebView = Boolean((window && window).webkit && window.webkit.messageHandlers);
|
|
14
|
+
if (isWKWebView) {
|
|
15
|
+
return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));
|
|
19
16
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
else if (/android/i.test(userAgent)) {
|
|
23
|
-
return true;
|
|
17
|
+
const tempAnchor = document.createElement("a");
|
|
18
|
+
return tempAnchor.relList && tempAnchor.relList.supports && tempAnchor.relList.supports("ar");
|
|
24
19
|
}
|
|
25
20
|
return false;
|
|
26
21
|
}
|
|
27
|
-
static canQuicklook() {
|
|
28
|
-
const tempAnchor = document.createElement("a");
|
|
29
|
-
return tempAnchor.relList &&
|
|
30
|
-
tempAnchor.relList.supports &&
|
|
31
|
-
tempAnchor.relList.supports("ar");
|
|
32
|
-
}
|
|
33
22
|
static canSceneViewer() {
|
|
34
|
-
return Util.
|
|
23
|
+
return Util.isAndroid() && !Util.isFirefox() && !Util.isOculus();
|
|
35
24
|
}
|
|
36
25
|
static canRealityViewer() {
|
|
37
|
-
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
if (/Macintosh|iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
|
|
41
|
-
if (Util.isSafari() && Util.getIOSVersion()[0] >= 13) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return false;
|
|
26
|
+
return Util.isIOS() && Util.getIOSVersion()[0] >= 13;
|
|
46
27
|
}
|
|
47
|
-
static
|
|
48
|
-
|
|
49
|
-
return navigator.vendor.indexOf("Apple") > -1 &&
|
|
50
|
-
navigator.userAgent.indexOf("CriOS") === -1 &&
|
|
51
|
-
navigator.userAgent.indexOf("FxiOS") === -1;
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
28
|
+
static isSafariOnIOS() {
|
|
29
|
+
return Util.isIOS() && Util.isSafari();
|
|
54
30
|
}
|
|
55
31
|
static isChromeOnIOS() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
32
|
+
return Util.isIOS() && /CriOS\//.test(navigator.userAgent);
|
|
33
|
+
}
|
|
34
|
+
static isIOS() {
|
|
35
|
+
return (/iPad|iPhone|iPod/.test(navigator.userAgent) && !self.MSStream) || (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
|
|
36
|
+
}
|
|
37
|
+
static isAndroid() {
|
|
38
|
+
return /android/i.test(navigator.userAgent);
|
|
39
|
+
}
|
|
40
|
+
static isFirefox() {
|
|
41
|
+
return /firefox/i.test(navigator.userAgent);
|
|
42
|
+
}
|
|
43
|
+
static isOculus() {
|
|
44
|
+
return /OculusBrowser/.test(navigator.userAgent);
|
|
45
|
+
}
|
|
46
|
+
static isSafari() {
|
|
47
|
+
return /Safari\//.test(navigator.userAgent);
|
|
61
48
|
}
|
|
62
49
|
static getIOSVersion() {
|
|
63
50
|
if (/iP(hone|od|ad)/.test(navigator.platform)) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.
|
|
1
|
+
declare const _default: "1.140.1";
|
|
2
2
|
export default _default;
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plattar/plattar-ar-adapter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.140.1",
|
|
4
4
|
"description": "Plattar AR Adapter for interfacing with Google & Apple WebAR",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@babel/cli": "^7.19.3",
|
|
48
|
-
"@babel/core": "^7.
|
|
49
|
-
"@babel/preset-env": "^7.
|
|
48
|
+
"@babel/core": "^7.20.2",
|
|
49
|
+
"@babel/preset-env": "^7.20.2",
|
|
50
50
|
"browserify": "^17.0.0",
|
|
51
51
|
"typescript": "^4.8.4",
|
|
52
52
|
"uglify-js": "^3.17.4"
|