@plattar/plattar-ar-adapter 1.167.6 → 1.167.7
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 +108 -51
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +102 -46
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/embed/controllers/configurator-controller.d.ts +0 -1
- package/dist/embed/controllers/configurator-controller.js +0 -9
- package/dist/embed/controllers/plattar-controller.d.ts +6 -1
- package/dist/embed/controllers/plattar-controller.js +27 -0
- package/dist/embed/controllers/product-controller.d.ts +0 -1
- package/dist/embed/controllers/product-controller.js +0 -8
- package/dist/embed/controllers/vto-controller.d.ts +0 -1
- package/dist/embed/controllers/vto-controller.js +0 -9
- package/dist/embed/plattar-embed.d.ts +1 -0
- package/dist/embed/plattar-embed.js +34 -12
- package/dist/util/util.d.ts +1 -0
- package/dist/util/util.js +24 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -7
|
@@ -1881,17 +1881,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1881
1881
|
}
|
|
1882
1882
|
return _InitARGenerated;
|
|
1883
1883
|
}())
|
|
1884
|
-
}, {
|
|
1885
|
-
key: "removeRenderer",
|
|
1886
|
-
value: function removeRenderer() {
|
|
1887
|
-
if (this._element) {
|
|
1888
|
-
this._element.remove();
|
|
1889
|
-
this._element = null;
|
|
1890
|
-
return true;
|
|
1891
|
-
}
|
|
1892
|
-
this.removeMessengerObservers();
|
|
1893
|
-
return false;
|
|
1894
|
-
}
|
|
1895
1884
|
}, {
|
|
1896
1885
|
key: "element",
|
|
1897
1886
|
get: function get() {
|
|
@@ -2220,9 +2209,28 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2220
2209
|
return startARQRCode;
|
|
2221
2210
|
}()
|
|
2222
2211
|
/**
|
|
2223
|
-
*
|
|
2212
|
+
* Removes the currently active renderer view from the DOM
|
|
2224
2213
|
*/
|
|
2225
2214
|
)
|
|
2215
|
+
}, {
|
|
2216
|
+
key: "removeRenderer",
|
|
2217
|
+
value: function removeRenderer() {
|
|
2218
|
+
// remove all other children
|
|
2219
|
+
var shadow = this.parent.shadowRoot;
|
|
2220
|
+
if (shadow) {
|
|
2221
|
+
var child = shadow.lastElementChild;
|
|
2222
|
+
while (child) {
|
|
2223
|
+
shadow.removeChild(child);
|
|
2224
|
+
child = shadow.lastElementChild;
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
this._element = null;
|
|
2228
|
+
this.removeMessengerObservers();
|
|
2229
|
+
return true;
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* Returns the Parent Instance
|
|
2233
|
+
*/
|
|
2226
2234
|
}, {
|
|
2227
2235
|
key: "parent",
|
|
2228
2236
|
get: function get() {
|
|
@@ -2286,6 +2294,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2286
2294
|
});
|
|
2287
2295
|
shadow.append(element);
|
|
2288
2296
|
}
|
|
2297
|
+
/**
|
|
2298
|
+
*
|
|
2299
|
+
* @param element
|
|
2300
|
+
*/
|
|
2301
|
+
}, {
|
|
2302
|
+
key: "removeChild",
|
|
2303
|
+
value: function removeChild(element) {
|
|
2304
|
+
var shadow = this.parent.shadowRoot;
|
|
2305
|
+
if (shadow) {
|
|
2306
|
+
shadow.removeChild(element);
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2289
2309
|
}]);
|
|
2290
2310
|
return PlattarController;
|
|
2291
2311
|
}();
|
|
@@ -2569,16 +2589,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2569
2589
|
return reject(new Error("ProductController.initAR() - minimum required attributes not set, use product-id as a minimum"));
|
|
2570
2590
|
});
|
|
2571
2591
|
}
|
|
2572
|
-
}, {
|
|
2573
|
-
key: "removeRenderer",
|
|
2574
|
-
value: function removeRenderer() {
|
|
2575
|
-
if (this._element) {
|
|
2576
|
-
this._element.remove();
|
|
2577
|
-
this._element = null;
|
|
2578
|
-
return true;
|
|
2579
|
-
}
|
|
2580
|
-
return false;
|
|
2581
|
-
}
|
|
2582
2592
|
}, {
|
|
2583
2593
|
key: "element",
|
|
2584
2594
|
get: function get() {
|
|
@@ -3034,17 +3044,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3034
3044
|
}
|
|
3035
3045
|
return _InitARGenerated;
|
|
3036
3046
|
}())
|
|
3037
|
-
}, {
|
|
3038
|
-
key: "removeRenderer",
|
|
3039
|
-
value: function removeRenderer() {
|
|
3040
|
-
if (this._element) {
|
|
3041
|
-
this._element.remove();
|
|
3042
|
-
this._element = null;
|
|
3043
|
-
return true;
|
|
3044
|
-
}
|
|
3045
|
-
this.removeMessengerObservers();
|
|
3046
|
-
return false;
|
|
3047
|
-
}
|
|
3048
3047
|
}, {
|
|
3049
3048
|
key: "element",
|
|
3050
3049
|
get: function get() {
|
|
@@ -3071,6 +3070,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3071
3070
|
var configurator_controller_1 = require("./controllers/configurator-controller");
|
|
3072
3071
|
var vto_controller_1 = require("./controllers/vto-controller");
|
|
3073
3072
|
var product_controller_1 = require("./controllers/product-controller");
|
|
3073
|
+
var util_1 = require("../util/util");
|
|
3074
3074
|
/**
|
|
3075
3075
|
* This tracks the current embed type
|
|
3076
3076
|
*/
|
|
@@ -3104,6 +3104,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3104
3104
|
_this25._observerState = ObserverState.Unlocked;
|
|
3105
3105
|
_this25._controller = null;
|
|
3106
3106
|
_this25._currentSceneID = null;
|
|
3107
|
+
_this25._currentServer = null;
|
|
3107
3108
|
_this25._observer = null;
|
|
3108
3109
|
return _this25;
|
|
3109
3110
|
}
|
|
@@ -3127,9 +3128,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3127
3128
|
key: "create",
|
|
3128
3129
|
value: function create() {
|
|
3129
3130
|
var _this26 = this;
|
|
3130
|
-
// server cannot be changed once its set - defaults to production
|
|
3131
|
-
var server = this.hasAttribute("server") ? this.getAttribute("server") : "production";
|
|
3132
|
-
plattar_api_1.Server.create(plattar_api_1.Server.match(server || "production"));
|
|
3133
3131
|
if (!this._observer) {
|
|
3134
3132
|
this._observer = new MutationObserver(function (mutations) {
|
|
3135
3133
|
if (_this26._observerState === ObserverState.Unlocked) {
|
|
@@ -3193,15 +3191,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3193
3191
|
}, {
|
|
3194
3192
|
key: "_CreateLegacyEmbed",
|
|
3195
3193
|
value: function _CreateLegacyEmbed() {
|
|
3196
|
-
|
|
3197
|
-
var
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3194
|
+
// server cannot be changed once its set - defaults to production
|
|
3195
|
+
var server = this.hasAttribute("server") ? this.getAttribute("server") : "production";
|
|
3196
|
+
if (util_1.Util.isValidServerLocation(server)) {
|
|
3197
|
+
plattar_api_1.Server.create(plattar_api_1.Server.match(server || "production"));
|
|
3198
|
+
this._controller = new product_controller_1.ProductController(this);
|
|
3199
|
+
var init = this.hasAttribute("init") ? this.getAttribute("init") : null;
|
|
3200
|
+
switch (init) {
|
|
3201
|
+
case "viewer":
|
|
3202
|
+
this.startViewer();
|
|
3203
|
+
break;
|
|
3204
|
+
case "qrcode":
|
|
3205
|
+
this.startQRCode();
|
|
3206
|
+
break;
|
|
3207
|
+
}
|
|
3208
|
+
} else {
|
|
3209
|
+
console.warn("PlattarEmbed.CreateLegacy - cannot create as server attribute " + server + " is invalid, embed status remains unchanged");
|
|
3205
3210
|
}
|
|
3206
3211
|
}
|
|
3207
3212
|
/**
|
|
@@ -3211,6 +3216,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3211
3216
|
}, {
|
|
3212
3217
|
key: "_CreateEmbed",
|
|
3213
3218
|
value: function _CreateEmbed(attributeName) {
|
|
3219
|
+
// check if controller needs to be destroyed due to server change
|
|
3220
|
+
var serverAttribute = this.hasAttribute("server") ? this.getAttribute("server") : "production";
|
|
3221
|
+
if (this._currentServer !== serverAttribute) {
|
|
3222
|
+
this._currentServer = serverAttribute || "production";
|
|
3223
|
+
// reset the controller if any
|
|
3224
|
+
if (this._controller) {
|
|
3225
|
+
this._controller.removeRenderer();
|
|
3226
|
+
this._controller = null;
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
if (!util_1.Util.isValidServerLocation(this._currentServer)) {
|
|
3230
|
+
console.warn("PlattarEmbed.Create - cannot create as server attribute " + this._currentServer + " is invalid, embed status remains unchanged");
|
|
3231
|
+
return;
|
|
3232
|
+
}
|
|
3233
|
+
plattar_api_1.Server.create(plattar_api_1.Server.match(this._currentServer || "production"));
|
|
3214
3234
|
var embedType = this.hasAttribute("embed-type") ? this.getAttribute("embed-type") : "configurator";
|
|
3215
3235
|
var currentEmbed = this._currentType;
|
|
3216
3236
|
if (embedType) {
|
|
@@ -3416,6 +3436,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
3416
3436
|
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
3417
3437
|
exports["default"] = PlattarEmbed;
|
|
3418
3438
|
}, {
|
|
3439
|
+
"../util/util": 15,
|
|
3419
3440
|
"./controllers/configurator-controller": 8,
|
|
3420
3441
|
"./controllers/product-controller": 10,
|
|
3421
3442
|
"./controllers/vto-controller": 11,
|
|
@@ -4089,6 +4110,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4089
4110
|
_classCallCheck(this, Util);
|
|
4090
4111
|
}
|
|
4091
4112
|
_createClass(Util, null, [{
|
|
4113
|
+
key: "isValidServerLocation",
|
|
4114
|
+
value: function isValidServerLocation(server) {
|
|
4115
|
+
if (!server) {
|
|
4116
|
+
return false;
|
|
4117
|
+
}
|
|
4118
|
+
switch (server.toLowerCase()) {
|
|
4119
|
+
case "staging.plattar.space":
|
|
4120
|
+
case "cdn-staging.plattar.space":
|
|
4121
|
+
case "staging":
|
|
4122
|
+
case "app.plattar.com":
|
|
4123
|
+
case "cdn.plattar.com":
|
|
4124
|
+
case "prod":
|
|
4125
|
+
case "production":
|
|
4126
|
+
case "review.plattar.com":
|
|
4127
|
+
case "review":
|
|
4128
|
+
case "qa":
|
|
4129
|
+
case "dev":
|
|
4130
|
+
case "developer":
|
|
4131
|
+
case "development":
|
|
4132
|
+
case "local":
|
|
4133
|
+
case "localhost":
|
|
4134
|
+
return true;
|
|
4135
|
+
}
|
|
4136
|
+
return false;
|
|
4137
|
+
}
|
|
4138
|
+
}, {
|
|
4092
4139
|
key: "canAugment",
|
|
4093
4140
|
value: function canAugment() {
|
|
4094
4141
|
return Util.canQuicklook() || Util.canSceneViewer();
|
|
@@ -4188,7 +4235,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4188
4235
|
Object.defineProperty(exports, "__esModule", {
|
|
4189
4236
|
value: true
|
|
4190
4237
|
});
|
|
4191
|
-
exports["default"] = "1.167.
|
|
4238
|
+
exports["default"] = "1.167.7";
|
|
4192
4239
|
}, {}],
|
|
4193
4240
|
17: [function (require, module, exports) {
|
|
4194
4241
|
"use strict";
|
|
@@ -9111,11 +9158,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9111
9158
|
var shortenURL = this.hasAttribute("shorten") ? this.getAttribute("shorten") : "false";
|
|
9112
9159
|
if (shortenURL && shortenURL.toLowerCase() === "true") {
|
|
9113
9160
|
this._ShortenURL(url).then(function (newURL) {
|
|
9114
|
-
|
|
9161
|
+
// make sure by time promise is resolved that the original url hasn't been updated
|
|
9162
|
+
var updatedURL = _this56.hasAttribute("url") ? _this56.getAttribute("url") : undefined;
|
|
9163
|
+
if (updatedURL === url) {
|
|
9164
|
+
_this56._GenerateQRCode(newURL, width, height);
|
|
9165
|
+
}
|
|
9115
9166
|
})["catch"](function (_err) {
|
|
9116
9167
|
console.warn(_err);
|
|
9117
9168
|
// ignore error and just generate normal QR Code
|
|
9118
|
-
|
|
9169
|
+
// make sure by time promise is resolved that the original url hasn't been updated
|
|
9170
|
+
var updatedURL = _this56.hasAttribute("url") ? _this56.getAttribute("url") : undefined;
|
|
9171
|
+
if (updatedURL === url) {
|
|
9172
|
+
_this56._GenerateQRCode(url, width, height);
|
|
9173
|
+
}
|
|
9119
9174
|
});
|
|
9120
9175
|
} else {
|
|
9121
9176
|
this._GenerateQRCode(url, width, height);
|
|
@@ -9261,7 +9316,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
9261
9316
|
"./version": 111
|
|
9262
9317
|
}],
|
|
9263
9318
|
111: [function (require, module, exports) {
|
|
9264
|
-
module.exports = "1.
|
|
9319
|
+
module.exports = "1.165.1";
|
|
9265
9320
|
}, {}],
|
|
9266
9321
|
112: [function (require, module, exports) {
|
|
9267
9322
|
"use strict";
|
|
@@ -10566,8 +10621,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
10566
10621
|
module.exports = Util;
|
|
10567
10622
|
}, {}],
|
|
10568
10623
|
131: [function (require, module, exports) {
|
|
10569
|
-
|
|
10570
|
-
}, {
|
|
10624
|
+
arguments[4][111][0].apply(exports, arguments);
|
|
10625
|
+
}, {
|
|
10626
|
+
"dup": 111
|
|
10627
|
+
}],
|
|
10571
10628
|
132: [function (require, module, exports) {
|
|
10572
10629
|
(function (global) {
|
|
10573
10630
|
(function () {
|