@plattar/plattar-ar-adapter 1.129.1 → 1.130.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 +67 -11
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +51 -13
- package/build/es2019/plattar-ar-adapter.min.js +2 -2
- package/dist/ar/launcher-ar.d.ts +8 -0
- package/dist/ar/launcher-ar.js +11 -1
- package/dist/ar/model-ar.js +4 -2
- package/dist/ar/product-ar.js +11 -2
- package/dist/ar/raw-ar.js +4 -2
- package/dist/ar/scene-ar.js +7 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.LauncherAR = void 0;
|
|
5
5
|
class LauncherAR {
|
|
6
|
-
constructor() {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._opt = {
|
|
8
|
+
anchor: "horizontal_vertical"
|
|
9
|
+
};
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* Initialise and launch with a single function call. this is mostly for convenience.
|
|
9
13
|
* Use .init() and .start() separately for fine-grained control
|
|
@@ -16,6 +20,12 @@ class LauncherAR {
|
|
|
16
20
|
}).catch(reject);
|
|
17
21
|
});
|
|
18
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* AR Options used for launching AR
|
|
25
|
+
*/
|
|
26
|
+
get options() {
|
|
27
|
+
return this._opt;
|
|
28
|
+
}
|
|
19
29
|
}
|
|
20
30
|
exports.LauncherAR = LauncherAR;
|
|
21
31
|
|
|
@@ -102,8 +112,10 @@ class ModelAR extends launcher_ar_1.LauncherAR {
|
|
|
102
112
|
}
|
|
103
113
|
// check android
|
|
104
114
|
if (util_1.Util.canSceneViewer()) {
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
const arviewer = new scene_viewer_1.default();
|
|
116
|
+
arviewer.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.original_filename;
|
|
117
|
+
arviewer.isVertical = this.options.anchor === "vertical" ? true : false;
|
|
118
|
+
this._ar = arviewer;
|
|
107
119
|
return accept(this);
|
|
108
120
|
}
|
|
109
121
|
// otherwise, we didn't have AR available - it should never really reach this stage as this should be caught
|
|
@@ -267,8 +279,17 @@ class ProductAR extends launcher_ar_1.LauncherAR {
|
|
|
267
279
|
}
|
|
268
280
|
// check android
|
|
269
281
|
if (util_1.Util.canSceneViewer()) {
|
|
270
|
-
|
|
271
|
-
|
|
282
|
+
const arviewer = new scene_viewer_1.default();
|
|
283
|
+
arviewer.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.original_filename;
|
|
284
|
+
arviewer.isVertical = this.options.anchor === "vertical" ? true : false;
|
|
285
|
+
const scene = product.relationships.find(plattar_api_1.Scene);
|
|
286
|
+
if (scene) {
|
|
287
|
+
const sceneOpt = scene.attributes.custom_json || {};
|
|
288
|
+
if (sceneOpt.anchor === "vertical") {
|
|
289
|
+
arviewer.isVertical = true;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
this._ar = arviewer;
|
|
272
293
|
return accept(this);
|
|
273
294
|
}
|
|
274
295
|
// otherwise, we didn't have AR available - it should never really reach this stage as this should be caught
|
|
@@ -374,8 +395,10 @@ class RawAR extends launcher_ar_1.LauncherAR {
|
|
|
374
395
|
// check android
|
|
375
396
|
if (util_1.Util.canSceneViewer()) {
|
|
376
397
|
if (lowerLoc.endsWith("glb") || lowerLoc.endsWith("gltf")) {
|
|
377
|
-
|
|
378
|
-
|
|
398
|
+
const arviewer = new scene_viewer_1.default();
|
|
399
|
+
arviewer.modelUrl = modelLocation;
|
|
400
|
+
arviewer.isVertical = this.options.anchor === "vertical" ? true : false;
|
|
401
|
+
this._ar = arviewer;
|
|
379
402
|
return accept(this);
|
|
380
403
|
}
|
|
381
404
|
return reject(new Error("RawAR.init() - cannot proceed as model is not a .glb or .gltf file"));
|
|
@@ -533,8 +556,13 @@ class SceneAR extends launcher_ar_1.LauncherAR {
|
|
|
533
556
|
// check android
|
|
534
557
|
if (util_1.Util.canSceneViewer()) {
|
|
535
558
|
return this._ComposeScene(scene, "glb").then((modelUrl) => {
|
|
536
|
-
|
|
537
|
-
|
|
559
|
+
const arviewer = new scene_viewer_1.default();
|
|
560
|
+
arviewer.modelUrl = modelUrl;
|
|
561
|
+
arviewer.isVertical = this.options.anchor === "vertical" ? true : false;
|
|
562
|
+
if (sceneOpt.anchor === "vertical") {
|
|
563
|
+
arviewer.isVertical = true;
|
|
564
|
+
}
|
|
565
|
+
this._ar = arviewer;
|
|
538
566
|
return accept(this);
|
|
539
567
|
}).catch(reject);
|
|
540
568
|
}
|
|
@@ -1711,10 +1739,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
1711
1739
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1712
1740
|
};
|
|
1713
1741
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1714
|
-
exports.ConfiguratorState = exports.Util = exports.RawAR = exports.ModelAR = exports.SceneAR = exports.SceneProductAR = exports.ProductAR = exports.version = exports.PlattarQRCode = exports.PlattarWeb = void 0;
|
|
1742
|
+
exports.ConfiguratorState = exports.Util = exports.RawAR = exports.ModelAR = exports.SceneAR = exports.SceneProductAR = exports.ProductAR = exports.LauncherAR = exports.version = exports.PlattarQRCode = exports.PlattarWeb = void 0;
|
|
1715
1743
|
exports.PlattarWeb = __importStar(require("@plattar/plattar-web"));
|
|
1716
1744
|
exports.PlattarQRCode = __importStar(require("@plattar/plattar-qrcode"));
|
|
1717
1745
|
exports.version = __importStar(require("./version"));
|
|
1746
|
+
var launcher_ar_1 = require("./ar/launcher-ar");
|
|
1747
|
+
Object.defineProperty(exports, "LauncherAR", { enumerable: true, get: function () { return launcher_ar_1.LauncherAR; } });
|
|
1718
1748
|
var product_ar_1 = require("./ar/product-ar");
|
|
1719
1749
|
Object.defineProperty(exports, "ProductAR", { enumerable: true, get: function () { return product_ar_1.ProductAR; } });
|
|
1720
1750
|
var scene_product_ar_1 = require("./ar/scene-product-ar");
|
|
@@ -1738,7 +1768,7 @@ if (customElements) {
|
|
|
1738
1768
|
}
|
|
1739
1769
|
console.log("using @plattar/plattar-ar-adapter v" + version_1.default);
|
|
1740
1770
|
|
|
1741
|
-
},{"./ar/model-ar":2,"./ar/product-ar":3,"./ar/raw-ar":4,"./ar/scene-ar":5,"./ar/scene-product-ar":6,"./embed/plattar-embed":12,"./util/configurator-state":14,"./util/util":15,"./version":16,"@plattar/plattar-qrcode":108,"@plattar/plattar-web":127}],14:[function(require,module,exports){
|
|
1771
|
+
},{"./ar/launcher-ar":1,"./ar/model-ar":2,"./ar/product-ar":3,"./ar/raw-ar":4,"./ar/scene-ar":5,"./ar/scene-product-ar":6,"./embed/plattar-embed":12,"./util/configurator-state":14,"./util/util":15,"./version":16,"@plattar/plattar-qrcode":108,"@plattar/plattar-web":127}],14:[function(require,module,exports){
|
|
1742
1772
|
"use strict";
|
|
1743
1773
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1744
1774
|
exports.ConfiguratorState = void 0;
|
|
@@ -2053,7 +2083,7 @@ exports.Util = Util;
|
|
|
2053
2083
|
},{}],16:[function(require,module,exports){
|
|
2054
2084
|
"use strict";
|
|
2055
2085
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2056
|
-
exports.default = "1.
|
|
2086
|
+
exports.default = "1.130.1";
|
|
2057
2087
|
|
|
2058
2088
|
},{}],17:[function(require,module,exports){
|
|
2059
2089
|
"use strict";
|
|
@@ -6255,6 +6285,10 @@ class BaseElement extends HTMLElement {
|
|
|
6255
6285
|
return this._controller ? this._controller.context : undefined;
|
|
6256
6286
|
}
|
|
6257
6287
|
|
|
6288
|
+
get parent() {
|
|
6289
|
+
return this._controller ? this._controller.parent : undefined;
|
|
6290
|
+
}
|
|
6291
|
+
|
|
6258
6292
|
get element() {
|
|
6259
6293
|
return this._controller;
|
|
6260
6294
|
}
|
|
@@ -6477,6 +6511,10 @@ class ElementController {
|
|
|
6477
6511
|
return messenger.self;
|
|
6478
6512
|
}
|
|
6479
6513
|
|
|
6514
|
+
get parent() {
|
|
6515
|
+
return messenger.parent;
|
|
6516
|
+
}
|
|
6517
|
+
|
|
6480
6518
|
get controller() {
|
|
6481
6519
|
return this._controller;
|
|
6482
6520
|
}
|
|
@@ -6939,7 +6977,7 @@ class Util {
|
|
|
6939
6977
|
|
|
6940
6978
|
module.exports = Util;
|
|
6941
6979
|
},{}],129:[function(require,module,exports){
|
|
6942
|
-
module.exports = "1.
|
|
6980
|
+
module.exports = "1.129.1";
|
|
6943
6981
|
|
|
6944
6982
|
},{}],130:[function(require,module,exports){
|
|
6945
6983
|
(function (global){(function (){
|