@plattar/plattar-ar-adapter 1.118.1 → 1.120.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/README.md +2 -2
- package/build/es2015/plattar-ar-adapter.js +1435 -2110
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +184 -101
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/ar/product-ar.js +1 -1
- package/dist/embed/plattar-embed.js +7 -0
- package/dist/util/util.d.ts +1 -0
- package/dist/util/util.js +13 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -7
package/dist/ar/product-ar.js
CHANGED
|
@@ -103,7 +103,7 @@ class ProductAR extends launcher_ar_1.LauncherAR {
|
|
|
103
103
|
this._setupAnalytics(product, variation);
|
|
104
104
|
// we need to define our AR module here
|
|
105
105
|
// we are in Safari/Quicklook mode here
|
|
106
|
-
if (util_1.Util.isSafari()) {
|
|
106
|
+
if (util_1.Util.isSafari() || util_1.Util.isChromeOnIOS()) {
|
|
107
107
|
// model needs to have either USDZ or REALITY files defined
|
|
108
108
|
// we load REALITY stuff first if available
|
|
109
109
|
if (model.attributes.reality_filename && util_1.Util.canRealityViewer()) {
|
|
@@ -144,6 +144,7 @@ class PlattarEmbed extends HTMLElement {
|
|
|
144
144
|
}
|
|
145
145
|
const opt = options || {
|
|
146
146
|
color: "#101721",
|
|
147
|
+
qrType: "default",
|
|
147
148
|
margin: 0
|
|
148
149
|
};
|
|
149
150
|
if (this._viewer) {
|
|
@@ -161,6 +162,9 @@ class PlattarEmbed extends HTMLElement {
|
|
|
161
162
|
if (opt.margin) {
|
|
162
163
|
viewer.setAttribute("margin", "" + opt.margin);
|
|
163
164
|
}
|
|
165
|
+
if (opt.qrType) {
|
|
166
|
+
viewer.setAttribute("qr-type", opt.qrType);
|
|
167
|
+
}
|
|
164
168
|
const dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + this._sceneID;
|
|
165
169
|
viewer.setAttribute("url", dst);
|
|
166
170
|
viewer.onload = () => {
|
|
@@ -182,6 +186,9 @@ class PlattarEmbed extends HTMLElement {
|
|
|
182
186
|
if (opt.margin) {
|
|
183
187
|
viewer.setAttribute("margin", "" + opt.margin);
|
|
184
188
|
}
|
|
189
|
+
if (opt.qrType) {
|
|
190
|
+
viewer.setAttribute("qr-type", opt.qrType);
|
|
191
|
+
}
|
|
185
192
|
let dst = plattar_api_1.Server.location().base + "renderer/product.html?product_id=" + this._productID;
|
|
186
193
|
if (this._variationID) {
|
|
187
194
|
dst += "&variation_id=" + this._variationID;
|
package/dist/util/util.d.ts
CHANGED
package/dist/util/util.js
CHANGED
|
@@ -6,18 +6,20 @@ exports.Util = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
class Util {
|
|
8
8
|
static canAugment() {
|
|
9
|
-
|
|
9
|
+
const userAgent = navigator.userAgent;
|
|
10
|
+
// test google chrome on IOS and standard IOS test
|
|
11
|
+
if ((/CriOS/i.test(userAgent) || /Macintosh|iPad|iPhone|iPod/.test(userAgent)) && !window.MSStream) {
|
|
10
12
|
// inside facebook browser
|
|
11
|
-
if (/\bFB[\w_]+\//.test(
|
|
13
|
+
if (/\bFB[\w_]+\//.test(userAgent)) {
|
|
12
14
|
return false;
|
|
13
15
|
}
|
|
14
16
|
// inside instagram browser
|
|
15
|
-
if (/\bInstagram/i.test(
|
|
17
|
+
if (/\bInstagram/i.test(userAgent)) {
|
|
16
18
|
return false;
|
|
17
19
|
}
|
|
18
20
|
return Util.canQuicklook();
|
|
19
21
|
}
|
|
20
|
-
else if (/android/i.test(
|
|
22
|
+
else if (/android/i.test(userAgent)) {
|
|
21
23
|
return true;
|
|
22
24
|
}
|
|
23
25
|
return false;
|
|
@@ -50,6 +52,13 @@ class Util {
|
|
|
50
52
|
}
|
|
51
53
|
return false;
|
|
52
54
|
}
|
|
55
|
+
static isChromeOnIOS() {
|
|
56
|
+
const userAgent = navigator.userAgent;
|
|
57
|
+
if (userAgent) {
|
|
58
|
+
return Util.canAugment() && /CriOS/i.test(userAgent);
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
53
62
|
static getIOSVersion() {
|
|
54
63
|
if (/iP(hone|od|ad)/.test(navigator.platform)) {
|
|
55
64
|
const v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.
|
|
1
|
+
declare const _default: "1.120.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.120.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",
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
"homepage": "https://www.plattar.com",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@plattar/plattar-analytics": "^1.117.2",
|
|
41
|
-
"@plattar/plattar-api": "^1.
|
|
42
|
-
"@plattar/plattar-qrcode": "1.
|
|
41
|
+
"@plattar/plattar-api": "^1.120.1",
|
|
42
|
+
"@plattar/plattar-qrcode": "1.120.3",
|
|
43
43
|
"@plattar/plattar-web": "^1.117.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@babel/cli": "^7.
|
|
47
|
-
"@babel/core": "^7.
|
|
48
|
-
"@babel/preset-env": "^7.
|
|
46
|
+
"@babel/cli": "^7.16.0",
|
|
47
|
+
"@babel/core": "^7.16.0",
|
|
48
|
+
"@babel/preset-env": "^7.16.4",
|
|
49
49
|
"browserify": "^17.0.0",
|
|
50
|
-
"typescript": "^4.
|
|
50
|
+
"typescript": "^4.5.2",
|
|
51
51
|
"uglify-es": "^3.3.9"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|