@plattar/plattar-ar-adapter 1.119.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/build/es2015/plattar-ar-adapter.js +81 -35
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +64 -24
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/ar/product-ar.js +1 -1
- 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 +3 -3
|
@@ -329,7 +329,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
329
329
|
// we are in Safari/Quicklook mode here
|
|
330
330
|
|
|
331
331
|
|
|
332
|
-
if (util_1.Util.isSafari()) {
|
|
332
|
+
if (util_1.Util.isSafari() || util_1.Util.isChromeOnIOS()) {
|
|
333
333
|
// model needs to have either USDZ or REALITY files defined
|
|
334
334
|
// we load REALITY stuff first if available
|
|
335
335
|
if (model.attributes.reality_filename && util_1.Util.canRealityViewer()) {
|
|
@@ -919,19 +919,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
919
919
|
_createClass(Util, null, [{
|
|
920
920
|
key: "canAugment",
|
|
921
921
|
value: function canAugment() {
|
|
922
|
-
|
|
922
|
+
var userAgent = navigator.userAgent; // test google chrome on IOS and standard IOS test
|
|
923
|
+
|
|
924
|
+
if ((/CriOS/i.test(userAgent) || /Macintosh|iPad|iPhone|iPod/.test(userAgent)) && !window.MSStream) {
|
|
923
925
|
// inside facebook browser
|
|
924
|
-
if (/\bFB[\w_]+\//.test(
|
|
926
|
+
if (/\bFB[\w_]+\//.test(userAgent)) {
|
|
925
927
|
return false;
|
|
926
928
|
} // inside instagram browser
|
|
927
929
|
|
|
928
930
|
|
|
929
|
-
if (/\bInstagram/i.test(
|
|
931
|
+
if (/\bInstagram/i.test(userAgent)) {
|
|
930
932
|
return false;
|
|
931
933
|
}
|
|
932
934
|
|
|
933
935
|
return Util.canQuicklook();
|
|
934
|
-
} else if (/android/i.test(
|
|
936
|
+
} else if (/android/i.test(userAgent)) {
|
|
935
937
|
return true;
|
|
936
938
|
}
|
|
937
939
|
|
|
@@ -973,6 +975,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
973
975
|
return false;
|
|
974
976
|
}
|
|
975
977
|
}, {
|
|
978
|
+
key: "isChromeOnIOS",
|
|
979
|
+
value: function isChromeOnIOS() {
|
|
980
|
+
var userAgent = navigator.userAgent;
|
|
981
|
+
|
|
982
|
+
if (userAgent) {
|
|
983
|
+
return Util.canAugment() && /CriOS/i.test(userAgent);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
return false;
|
|
987
|
+
}
|
|
988
|
+
}, {
|
|
976
989
|
key: "getIOSVersion",
|
|
977
990
|
value: function getIOSVersion() {
|
|
978
991
|
if (/iP(hone|od|ad)/.test(navigator.platform)) {
|
|
@@ -1017,7 +1030,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
1017
1030
|
Object.defineProperty(exports, "__esModule", {
|
|
1018
1031
|
value: true
|
|
1019
1032
|
});
|
|
1020
|
-
exports["default"] = "1.
|
|
1033
|
+
exports["default"] = "1.120.1";
|
|
1021
1034
|
}, {}],
|
|
1022
1035
|
9: [function (require, module, exports) {
|
|
1023
1036
|
"use strict";
|
|
@@ -3934,7 +3947,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3934
3947
|
api_read: "https://staging.plattar.space/api/v2/",
|
|
3935
3948
|
api_write: "https://cms.plattar.space/api/v2/",
|
|
3936
3949
|
cdn: "https://cdn-staging.plattar.space/",
|
|
3937
|
-
cdn_image: "
|
|
3950
|
+
cdn_image: "https://images.plattar.space/",
|
|
3938
3951
|
analytics: "https://c.plattar.space/api/v2/analytics",
|
|
3939
3952
|
type: "staging"
|
|
3940
3953
|
};
|
|
@@ -3948,7 +3961,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3948
3961
|
api_read: "https://app.plattar.com/api/v2/",
|
|
3949
3962
|
api_write: "https://cms.plattar.com/api/v2/",
|
|
3950
3963
|
cdn: "https://cdn.plattar.com/",
|
|
3951
|
-
cdn_image: "
|
|
3964
|
+
cdn_image: "https://images.plattar.com/",
|
|
3952
3965
|
analytics: "https://c.plattar.space/api/v2/analytics",
|
|
3953
3966
|
type: "production"
|
|
3954
3967
|
};
|
|
@@ -3964,7 +3977,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
3964
3977
|
api_read: "https://localhost/api/v2/",
|
|
3965
3978
|
api_write: "https://localhost/api/v2/",
|
|
3966
3979
|
cdn: "https://cdn-dev.plattar.space/",
|
|
3967
|
-
cdn_image: "
|
|
3980
|
+
cdn_image: "https://images-dev.plattar.space/'",
|
|
3968
3981
|
analytics: "https://localhost:3000/api/v2/analytics/",
|
|
3969
3982
|
type: "dev"
|
|
3970
3983
|
};
|
|
@@ -6552,7 +6565,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6552
6565
|
"../types/trigger/trigger-image.js": 95
|
|
6553
6566
|
}],
|
|
6554
6567
|
97: [function (require, module, exports) {
|
|
6555
|
-
module.exports = "1.
|
|
6568
|
+
module.exports = "1.120.1";
|
|
6556
6569
|
}, {}],
|
|
6557
6570
|
98: [function (require, module, exports) {
|
|
6558
6571
|
var QRCodeStyling = require("qr-code-styling");
|
|
@@ -6571,9 +6584,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6571
6584
|
_createClass(BaseElement, [{
|
|
6572
6585
|
key: "connectedCallback",
|
|
6573
6586
|
value: function connectedCallback() {
|
|
6587
|
+
var _this36 = this;
|
|
6588
|
+
|
|
6574
6589
|
if (this.hasAttribute("url")) {
|
|
6575
6590
|
this.renderQRCode();
|
|
6576
6591
|
}
|
|
6592
|
+
|
|
6593
|
+
var observer = new MutationObserver(function (mutations) {
|
|
6594
|
+
mutations.forEach(function (mutation) {
|
|
6595
|
+
if (mutation.type === "attributes") {
|
|
6596
|
+
if (_this36.hasAttribute("url")) {
|
|
6597
|
+
_this36.renderQRCode();
|
|
6598
|
+
}
|
|
6599
|
+
}
|
|
6600
|
+
});
|
|
6601
|
+
});
|
|
6602
|
+
observer.observe(this, {
|
|
6603
|
+
attributes: true
|
|
6604
|
+
});
|
|
6577
6605
|
}
|
|
6578
6606
|
}, {
|
|
6579
6607
|
key: "download",
|
|
@@ -6593,7 +6621,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6593
6621
|
var url = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
|
|
6594
6622
|
|
|
6595
6623
|
if (!url) {
|
|
6596
|
-
|
|
6624
|
+
console.warn("PlattarQR.renderQRCode() - required attribute \"url\" is missing or invalid, QR Code will not render");
|
|
6625
|
+
return;
|
|
6597
6626
|
}
|
|
6598
6627
|
|
|
6599
6628
|
var width = this.hasAttribute("width") ? parseInt(this.getAttribute("width")) : 512;
|
|
@@ -6671,10 +6700,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6671
6700
|
color2: "#ffffff",
|
|
6672
6701
|
rotation: "0"
|
|
6673
6702
|
}
|
|
6674
|
-
}
|
|
6703
|
+
},
|
|
6704
|
+
width: 1024,
|
|
6705
|
+
height: 1024,
|
|
6706
|
+
type: "canvas"
|
|
6675
6707
|
};
|
|
6676
|
-
this._options.width = 2048;
|
|
6677
|
-
this._options.height = 2048;
|
|
6678
6708
|
this._options.data = url;
|
|
6679
6709
|
this._options.margin = margin;
|
|
6680
6710
|
this._options.image = image; // set the colors
|
|
@@ -6700,24 +6730,40 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6700
6730
|
|
|
6701
6731
|
if (!qrCode) {
|
|
6702
6732
|
var div = document.createElement("div");
|
|
6703
|
-
div.style.width = width + "px";
|
|
6704
|
-
div.style.height = height + "px";
|
|
6705
6733
|
shadow.appendChild(div);
|
|
6734
|
+
this._divContainer = div;
|
|
6706
6735
|
this._qrCode = new QRCodeStyling(this._options);
|
|
6707
6736
|
|
|
6708
6737
|
this._qrCode.append(div);
|
|
6709
6738
|
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
if (canvas) {
|
|
6713
|
-
canvas.style.width = "100%";
|
|
6714
|
-
canvas.style.height = "100%";
|
|
6715
|
-
}
|
|
6739
|
+
this._UpdateCanvas(width, height);
|
|
6716
6740
|
|
|
6717
6741
|
return;
|
|
6718
6742
|
}
|
|
6719
6743
|
|
|
6720
6744
|
this._qrCode.update(this._options);
|
|
6745
|
+
|
|
6746
|
+
this._UpdateCanvas(width, height);
|
|
6747
|
+
}
|
|
6748
|
+
}, {
|
|
6749
|
+
key: "_UpdateCanvas",
|
|
6750
|
+
value: function _UpdateCanvas(width, height) {
|
|
6751
|
+
if (!this._qrCode) {
|
|
6752
|
+
return;
|
|
6753
|
+
}
|
|
6754
|
+
|
|
6755
|
+
var canvas = this._qrCode._canvas;
|
|
6756
|
+
|
|
6757
|
+
if (canvas) {
|
|
6758
|
+
canvas.style.width = "100%";
|
|
6759
|
+
canvas.style.height = "100%";
|
|
6760
|
+
}
|
|
6761
|
+
|
|
6762
|
+
if (this._divContainer) {
|
|
6763
|
+
var div = this._divContainer;
|
|
6764
|
+
div.style.width = width + "px";
|
|
6765
|
+
div.style.height = height + "px";
|
|
6766
|
+
}
|
|
6721
6767
|
}
|
|
6722
6768
|
}]);
|
|
6723
6769
|
|
|
@@ -6766,7 +6812,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6766
6812
|
"./version": 101
|
|
6767
6813
|
}],
|
|
6768
6814
|
101: [function (require, module, exports) {
|
|
6769
|
-
module.exports = "1.
|
|
6815
|
+
module.exports = "1.120.3";
|
|
6770
6816
|
}, {}],
|
|
6771
6817
|
102: [function (require, module, exports) {
|
|
6772
6818
|
var ElementController = require("../controllers/element-controller");
|
|
@@ -6879,19 +6925,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6879
6925
|
}, {
|
|
6880
6926
|
key: "allMappedAttributes",
|
|
6881
6927
|
get: function get() {
|
|
6882
|
-
var
|
|
6928
|
+
var _this37 = this;
|
|
6883
6929
|
|
|
6884
6930
|
var map = new Map();
|
|
6885
6931
|
var coreAttr = this.coreAttributes;
|
|
6886
6932
|
var optAttr = this.optionalAttributes;
|
|
6887
6933
|
coreAttr.forEach(function (ele) {
|
|
6888
|
-
if (
|
|
6889
|
-
map.set(ele.map,
|
|
6934
|
+
if (_this37.hasAttribute(ele.key)) {
|
|
6935
|
+
map.set(ele.map, _this37.getAttribute(ele.key));
|
|
6890
6936
|
}
|
|
6891
6937
|
});
|
|
6892
6938
|
optAttr.forEach(function (ele) {
|
|
6893
|
-
if (
|
|
6894
|
-
map.set(ele.map,
|
|
6939
|
+
if (_this37.hasAttribute(ele.key)) {
|
|
6940
|
+
map.set(ele.map, _this37.getAttribute(ele.key));
|
|
6895
6941
|
}
|
|
6896
6942
|
});
|
|
6897
6943
|
return map;
|
|
@@ -6947,7 +6993,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6947
6993
|
|
|
6948
6994
|
var ElementController = /*#__PURE__*/function () {
|
|
6949
6995
|
function ElementController(element) {
|
|
6950
|
-
var
|
|
6996
|
+
var _this38 = this;
|
|
6951
6997
|
|
|
6952
6998
|
_classCallCheck(this, ElementController);
|
|
6953
6999
|
|
|
@@ -6963,7 +7009,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
6963
7009
|
|
|
6964
7010
|
if (mutation.type === 'attributes' && element.usesCoreAttribute(mutation.attributeName)) {
|
|
6965
7011
|
if (element.hasAllCoreAttributes) {
|
|
6966
|
-
|
|
7012
|
+
_this38._load();
|
|
6967
7013
|
}
|
|
6968
7014
|
}
|
|
6969
7015
|
}
|
|
@@ -7063,7 +7109,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
7063
7109
|
|
|
7064
7110
|
var IFrameController = /*#__PURE__*/function () {
|
|
7065
7111
|
function IFrameController(element, src, id) {
|
|
7066
|
-
var
|
|
7112
|
+
var _this39 = this;
|
|
7067
7113
|
|
|
7068
7114
|
var onelemload = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
7069
7115
|
|
|
@@ -7075,7 +7121,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
7075
7121
|
if (!element.hasAttribute("sameorigin")) {
|
|
7076
7122
|
this._iframe.onload = function () {
|
|
7077
7123
|
if (onelemload) {
|
|
7078
|
-
onelemload(
|
|
7124
|
+
onelemload(_this39._iframe);
|
|
7079
7125
|
}
|
|
7080
7126
|
};
|
|
7081
7127
|
}
|
|
@@ -7216,15 +7262,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
7216
7262
|
var _super69 = _createSuper(EWallElement);
|
|
7217
7263
|
|
|
7218
7264
|
function EWallElement() {
|
|
7219
|
-
var
|
|
7265
|
+
var _this40;
|
|
7220
7266
|
|
|
7221
7267
|
_classCallCheck(this, EWallElement);
|
|
7222
7268
|
|
|
7223
|
-
|
|
7269
|
+
_this40 = _super69.call(this);
|
|
7224
7270
|
var tag = document.createElement("script");
|
|
7225
7271
|
tag.src = "https://cdn.8thwall.com/web/iframe/iframe.js";
|
|
7226
7272
|
tag.defer = true;
|
|
7227
|
-
return
|
|
7273
|
+
return _this40;
|
|
7228
7274
|
}
|
|
7229
7275
|
|
|
7230
7276
|
_createClass(EWallElement, [{
|