@roomle/embedding-lib 9.0.0-alpha.5 → 9.0.0-alpha.6
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/docs/md/web/embedding/CHANGELOG.md +26 -60
- package/package.json +1 -1
- package/roomle-embedding-lib.js +43 -40
- package/roomle-embedding-lib.min.js +39 -36
|
@@ -1,61 +1,27 @@
|
|
|
1
|
-
## 9.0.0-alpha.
|
|
1
|
+
## 9.0.0-alpha.6 (2026-10-27)
|
|
2
2
|
|
|
3
|
-
* Merge branch 'master' into
|
|
4
|
-
* Merge branch 'master' into
|
|
5
|
-
* Merge branch 'master' into
|
|
6
|
-
* Merge branch 'master' into
|
|
7
|
-
* Merge
|
|
8
|
-
* Merge pull request #
|
|
9
|
-
* Merge pull request #
|
|
10
|
-
* Merge pull request #
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* feat
|
|
23
|
-
* feat:
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* chore(ai-render-eval): staged variants for the keep-showroom spike ([4022fbe](https://github.com/roomle-dev/roomle-ui/commit/4022fbe))
|
|
29
|
-
* docs(progress): decision to keep the archviz VIEW block for birdsEyeView=keep ([2b025cc](https://github.com/roomle-dev/roomle-ui/commit/2b025cc))
|
|
30
|
-
* docs(hi): describe how the units of other groups follow their carriers on every row edit ([8124668](https://github.com/roomle-dev/roomle-ui/commit/8124668))
|
|
31
|
-
* docs(hi): describe when the planner loads the hi agent tools ([9da9439](https://github.com/roomle-dev/roomle-ui/commit/9da9439))
|
|
32
|
-
* docs(ai-chat): level 2 evidence for the window-independent upload ([46b79eb](https://github.com/roomle-dev/roomle-ui/commit/46b79eb))
|
|
33
|
-
* docs(hi): move the HI tool documentation from roomle-hi-example ([e2899dc](https://github.com/roomle-dev/roomle-ui/commit/e2899dc))
|
|
34
|
-
* docs(ai-chat): upload size independent of the window, 2D always adjusts ([6f1c871](https://github.com/roomle-dev/roomle-ui/commit/6f1c871))
|
|
35
|
-
* fix(hi): answer a tool call after the reloads of the plan changes its step reports ([9ba1fc0](https://github.com/roomle-dev/roomle-ui/commit/9ba1fc0))
|
|
36
|
-
* fix(hi): answer an inherited name as an unknown agent tool and load the tools again after a failed i ([f649372](https://github.com/roomle-dev/roomle-ui/commit/f649372))
|
|
37
|
-
* fix(hi): apply the group position when a root module gains or loses its docking vectors ([2d13dc5](https://github.com/roomle-dev/roomle-ui/commit/2d13dc5))
|
|
38
|
-
* fix(hi): declare the docking vector indices of the docking context optional ([2cca910](https://github.com/roomle-dev/roomle-ui/commit/2cca910))
|
|
39
|
-
* fix(hi): dock a root module the library calculates for the first time from its neighbour instead of ([7c12f90](https://github.com/roomle-dev/roomle-ui/commit/7c12f90))
|
|
40
|
-
* fix(hi): give the agent every attribute of the library and the attributes of the sub modules ([ffed98c](https://github.com/roomle-dev/roomle-ui/commit/ffed98c))
|
|
41
|
-
* fix(hi): give the sdk programs the vite client types instead of the skills module ([b5a7556](https://github.com/roomle-dev/roomle-ui/commit/b5a7556))
|
|
42
|
-
* fix(hi): keep the initial checks off split-off and duplicated groups and drop a failed check ([0df932f](https://github.com/roomle-dev/roomle-ui/commit/0df932f))
|
|
43
|
-
* fix(hi): keep the sub module inputs of a root a replace keeps ([e05c597](https://github.com/roomle-dev/roomle-ui/commit/e05c597))
|
|
44
|
-
* fix(hi): keep the units hanging above another one in the group after a delete in place ([5269f14](https://github.com/roomle-dev/roomle-ui/commit/5269f14))
|
|
45
|
-
* fix(ai-chat): keep worktop roles in the material legend stable ([feba857](https://github.com/roomle-dev/roomle-ui/commit/feba857)), closes [#3170](https://github.com/roomle-dev/roomle-ui/issues/3170)
|
|
46
|
-
* fix(hi): leave the element type out of the interior fittings the agent reads ([593b919](https://github.com/roomle-dev/roomle-ui/commit/593b919))
|
|
47
|
-
* fix(hi): move the groups of units above with their carriers when a delete and compact turns or shift ([abd5285](https://github.com/roomle-dev/roomle-ui/commit/abd5285))
|
|
48
|
-
* fix(hi): move the units above in other groups with their carriers on every row edit, each within its ([44c1c8c](https://github.com/roomle-dev/roomle-ui/commit/44c1c8c))
|
|
49
|
-
* fix(hi): name the attribute by its name and its id in the find-attributes answer ([fa76c8b](https://github.com/roomle-dev/roomle-ui/commit/fa76c8b))
|
|
50
|
-
* fix(sdk): set the image renderer's mode once at planner start ([4070792](https://github.com/roomle-dev/roomle-ui/commit/4070792)), closes [#3170](https://github.com/roomle-dev/roomle-ui/issues/3170)
|
|
51
|
-
* fix: set the water connection level – only for PoC and has to be removed again ([0f33f07](https://github.com/roomle-dev/roomle-ui/commit/0f33f07))
|
|
52
|
-
* fix(hi): stand a unit behind flush with the end its row starts from ([e76558b](https://github.com/roomle-dev/roomle-ui/commit/e76558b))
|
|
53
|
-
* fix(sdk): wait for the plan and its materials before renderCameraImage ([97c146b](https://github.com/roomle-dev/roomle-ui/commit/97c146b)), closes [#3170](https://github.com/roomle-dev/roomle-ui/issues/3170)
|
|
54
|
-
* style: format photo-camera spec ([1ef1343](https://github.com/roomle-dev/roomle-ui/commit/1ef1343))
|
|
55
|
-
* style: format scene-context ([32cc4b0](https://github.com/roomle-dev/roomle-ui/commit/32cc4b0))
|
|
56
|
-
* test(hi): calculate the failed root module from its value in the tool test ([49d09b6](https://github.com/roomle-dev/roomle-ui/commit/49d09b6))
|
|
57
|
-
* test(hi): expect a unit behind flush with the end its row starts from ([7a5258a](https://github.com/roomle-dev/roomle-ui/commit/7a5258a))
|
|
58
|
-
* test(hi): expect the group to keep its place when a root module gains or loses its docking vectors ([48bd05f](https://github.com/roomle-dev/roomle-ui/commit/48bd05f))
|
|
59
|
-
* test(hi): expect the units above in other groups to follow their carriers on every row edit, each wi ([acd66c9](https://github.com/roomle-dev/roomle-ui/commit/acd66c9))
|
|
60
|
-
* test(hi): expect units above in other groups to follow their carriers on a delete and compact ([6f44a41](https://github.com/roomle-dev/roomle-ui/commit/6f44a41))
|
|
61
|
-
* test: render the object perspective and the top view without the plan perspective ([40c9df5](https://github.com/roomle-dev/roomle-ui/commit/40c9df5))
|
|
3
|
+
* Merge branch 'master' into fix/model-exporter-adaptions ([eed910c](https://github.com/roomle-dev/roomle-ui/commit/eed910c))
|
|
4
|
+
* Merge branch 'master' into fix/model-exporter-adaptions ([0c5d5c0](https://github.com/roomle-dev/roomle-ui/commit/0c5d5c0))
|
|
5
|
+
* Merge branch 'master' into fix/model-exporter-adaptions ([5953903](https://github.com/roomle-dev/roomle-ui/commit/5953903))
|
|
6
|
+
* Merge branch 'master' into release/test ([01d311e](https://github.com/roomle-dev/roomle-ui/commit/01d311e))
|
|
7
|
+
* Merge pull request #3118 from roomle-dev/fix/model-exporter-adaptions ([7e2e54f](https://github.com/roomle-dev/roomle-ui/commit/7e2e54f)), closes [#3118](https://github.com/roomle-dev/roomle-ui/issues/3118)
|
|
8
|
+
* Merge pull request #3139 from roomle-dev/fix/planner-load-plan-guards-pending-RML-17873 ([11667f5](https://github.com/roomle-dev/roomle-ui/commit/11667f5)), closes [#3139](https://github.com/roomle-dev/roomle-ui/issues/3139)
|
|
9
|
+
* Merge pull request #3184 from roomle-dev/upgraded-by-ci/core-3.2.0-alpha.5 ([d158003](https://github.com/roomle-dev/roomle-ui/commit/d158003)), closes [#3184](https://github.com/roomle-dev/roomle-ui/issues/3184)
|
|
10
|
+
* Merge pull request #3185 from roomle-dev/chore/rapi-v3-reenable-RML-17813 ([a6c2b51](https://github.com/roomle-dev/roomle-ui/commit/a6c2b51)), closes [#3185](https://github.com/roomle-dev/roomle-ui/issues/3185)
|
|
11
|
+
* test(e2e): move RAPI mocks of v3 paths back to v3 ([9788ebf](https://github.com/roomle-dev/roomle-ui/commit/9788ebf))
|
|
12
|
+
* test(e2e): re-record sidebar-selection-reset HAR files ([2e7e0ac](https://github.com/roomle-dev/roomle-ui/commit/2e7e0ac))
|
|
13
|
+
* test(sdk): use the coverage test timeout in test:ci ([66123bc](https://github.com/roomle-dev/roomle-ui/commit/66123bc))
|
|
14
|
+
* chore: enable v3 for a bit ([156de86](https://github.com/roomle-dev/roomle-ui/commit/156de86))
|
|
15
|
+
* chore: feedback fixes and e2e fixes ([3bc0956](https://github.com/roomle-dev/roomle-ui/commit/3bc0956))
|
|
16
|
+
* chore: fix incorrect AR model mocks ([5495691](https://github.com/roomle-dev/roomle-ui/commit/5495691))
|
|
17
|
+
* chore: make the AR endpoint use the specified API URL, optimize make AR QR flow ([9775cd5](https://github.com/roomle-dev/roomle-ui/commit/9775cd5))
|
|
18
|
+
* chore: merge master ([e0e3430](https://github.com/roomle-dev/roomle-ui/commit/e0e3430))
|
|
19
|
+
* chore: merge master into fix/planner-load-plan-guards-pending-RML-17873 ([3f01666](https://github.com/roomle-dev/roomle-ui/commit/3f01666))
|
|
20
|
+
* chore(rapi): re-enable RAPI v3 routing ([efedce6](https://github.com/roomle-dev/roomle-ui/commit/efedce6))
|
|
21
|
+
* chore: update endpoints, fix e2e test ([7781bee](https://github.com/roomle-dev/roomle-ui/commit/7781bee))
|
|
22
|
+
* feat: core api - terrain and fence authoring interfaces ([a0c3352](https://github.com/roomle-dev/roomle-ui/commit/a0c3352))
|
|
23
|
+
* feat(core): upgrade to version 3.2.0-alpha.5 ([4065b6a](https://github.com/roomle-dev/roomle-ui/commit/4065b6a))
|
|
24
|
+
* fix(planner): finish plan load after switching from a populated plan ([a9b380f](https://github.com/roomle-dev/roomle-ui/commit/a9b380f))
|
|
25
|
+
* fix(sdk): reject material promises when a texture image fails to load ([bddd3b7](https://github.com/roomle-dev/roomle-ui/commit/bddd3b7))
|
|
26
|
+
* fix(planner): skip load completion for a plan switched away from ([43d57a7](https://github.com/roomle-dev/roomle-ui/commit/43d57a7))
|
|
27
|
+
* fix: v2 compat fix ([a86406a](https://github.com/roomle-dev/roomle-ui/commit/a86406a))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.6",
|
|
4
4
|
"description": "This is a small library which can be used to communicate with the Roomle Configurator. ES modules only (browser-compatible).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./roomle-embedding-lib.js",
|
package/roomle-embedding-lib.js
CHANGED
|
@@ -234,11 +234,14 @@ var t = class {
|
|
|
234
234
|
resolve: e,
|
|
235
235
|
reject: t
|
|
236
236
|
};
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
}, w = (/* @__PURE__ */ "/items./items/{id}./items/{id}/renderings./items/{id}/conversions./items/{id}/3d-exports./items/{id}/perspectiveImage./items/{id}/perspectiveImageHD./items/{id}/topImage./items/{id}/tags./items/{id}/tagConnections./items/{id}/additionalContents./items/{id}/assetProcessings./items/{id}/3dAssets/{format}./items/{id}/3dAssets/{format}/{dummyFileName}./configurations./configurations/{id}./configurations/{id}/shares./configurations/{id}/renderings./configurations/{id}/3d-exports./configurations/{id}/3dAssets/{format}./configurations/{id}/3dAssets/{format}/{dummyFileName}./auth/signin./auth/signout./auth/reset./auth/reset/confirm./auth/change/pwd./auth/context./assets/analyze./version".split(".")).map((e) => RegExp("^" + e.replace(/\{[^}]+\}/g, "[^/]+") + "/?$")), T = /\/v[23]\/?$/, E = (e) => {
|
|
238
|
+
let t = e.split("?")[0];
|
|
239
|
+
return w.some((e) => e.test(t));
|
|
240
|
+
}, D = (e, t) => {
|
|
241
|
+
if (!T.test(e)) return e + t;
|
|
242
|
+
let n = E(t) ? "v3" : "v2";
|
|
243
|
+
return e.replace(T, "/" + n) + t;
|
|
244
|
+
}, O = {
|
|
242
245
|
SDK: "extended",
|
|
243
246
|
CONFIGURATOR_SDK: "configurator",
|
|
244
247
|
CALLBACKS: "callbacks",
|
|
@@ -246,22 +249,22 @@ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t
|
|
|
246
249
|
ANALYTICS: "analytics",
|
|
247
250
|
GLOBAL: "global",
|
|
248
251
|
RAPI: "rapi"
|
|
249
|
-
},
|
|
252
|
+
}, k = ".", A = O.SDK + "." + O.CALLBACKS, j = {
|
|
250
253
|
REQUEST_BOOT: "requestBoot",
|
|
251
254
|
SETUP: "setup",
|
|
252
255
|
WEBSITE_READY: "websiteReady"
|
|
253
|
-
},
|
|
256
|
+
}, M = {
|
|
254
257
|
GET_METHODS: "getMethods",
|
|
255
258
|
RETURN_METHODS: "returnMethods",
|
|
256
259
|
REGISTER_CUSTOM_VIEW: "registerCustomView",
|
|
257
260
|
REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
|
|
258
|
-
},
|
|
261
|
+
}, N = ["constructor", "callbacks"], P = (e) => e[0] !== "_" && !N.includes(e), F = (e, t, n = !1) => {
|
|
259
262
|
if (!e) return [];
|
|
260
|
-
let r = Object.getOwnPropertyNames(e), i = n ?
|
|
261
|
-
return r.filter(
|
|
262
|
-
},
|
|
263
|
+
let r = Object.getOwnPropertyNames(e), i = n ? O.CALLBACKS + "." : "";
|
|
264
|
+
return r.filter(P).map((e) => t + "." + i + e);
|
|
265
|
+
}, I = async (e, t) => {
|
|
263
266
|
if (typeof e != "string") throw Error("Configurator ID is not a string type: \"" + typeof e + "\"");
|
|
264
|
-
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i =
|
|
267
|
+
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = D(n, "/configurators/" + e), a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;roomle_portal_v2"), o = new Request(i, {
|
|
265
268
|
method: "GET",
|
|
266
269
|
headers: new Headers({
|
|
267
270
|
apiKey: "roomle_portal_v2",
|
|
@@ -276,7 +279,7 @@ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t
|
|
|
276
279
|
cache: "default"
|
|
277
280
|
}), { configurator: s } = await (await fetch(o)).json();
|
|
278
281
|
return s;
|
|
279
|
-
},
|
|
282
|
+
}, L = "data-rml-interaction-container", R = (e, t, n) => {
|
|
280
283
|
let r = null;
|
|
281
284
|
Object.defineProperty(e, t, {
|
|
282
285
|
get() {
|
|
@@ -286,16 +289,16 @@ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t
|
|
|
286
289
|
e?.mute ? r = e.value : (console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"), console.warn("{ mute: true, value: () => void }"), r = e);
|
|
287
290
|
}
|
|
288
291
|
});
|
|
289
|
-
},
|
|
290
|
-
e && setTimeout(() => e.style.setProperty(
|
|
291
|
-
},
|
|
292
|
+
}, z = () => window.innerHeight * .01 + "px", B = (e) => {
|
|
293
|
+
e && setTimeout(() => e.style.setProperty(U, z()), 0);
|
|
294
|
+
}, V = "rml-styles", H = 450, U = "--rml-full-height", W = {
|
|
292
295
|
CONTAINER: "rml-container",
|
|
293
296
|
FILL: "rml-fill",
|
|
294
297
|
POSITION: "rml-pos",
|
|
295
298
|
TRANSITION: "rml-transition",
|
|
296
299
|
ANDROID_HEIGHT: "rml-android-height",
|
|
297
300
|
OVERFLOW_HIDDEN: "rml-overflow-hidden"
|
|
298
|
-
},
|
|
301
|
+
}, G = /* @__PURE__ */ new Map(), K = class extends S {
|
|
299
302
|
static createPlanner(e, t, n, r = []) {
|
|
300
303
|
return this._create(e, t, n, r);
|
|
301
304
|
}
|
|
@@ -304,10 +307,10 @@ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t
|
|
|
304
307
|
r.viewName = e;
|
|
305
308
|
let { resolve: i, promise: a } = C(), { resolve: o, promise: s } = C(), c = new t("custom-view-" + e, window, window.parent, ({ message: e, args: t }) => {
|
|
306
309
|
switch (e) {
|
|
307
|
-
case
|
|
310
|
+
case M.REGISTER_CUSTOM_VIEW_DONE:
|
|
308
311
|
i();
|
|
309
312
|
break;
|
|
310
|
-
case
|
|
313
|
+
case M.RETURN_METHODS:
|
|
311
314
|
r.handleSetup(t[0]), o();
|
|
312
315
|
break;
|
|
313
316
|
default: if (r.isSetupDone) return r.executeMessage({
|
|
@@ -318,7 +321,7 @@ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t
|
|
|
318
321
|
});
|
|
319
322
|
r.setMessageHandler(c);
|
|
320
323
|
let l = [e];
|
|
321
|
-
return c.sendMessage(
|
|
324
|
+
return c.sendMessage(M.REGISTER_CUSTOM_VIEW, l), await a, c.sendMessage(M.GET_METHODS, l), await s, r.setupPlugins(n, document.body, "custom-view"), await Promise.allSettled(r.pluginsLoaded), r;
|
|
322
325
|
}
|
|
323
326
|
static createConfigurator(e, t, n, r = []) {
|
|
324
327
|
return this._create(e, t, n, r);
|
|
@@ -334,7 +337,7 @@ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t
|
|
|
334
337
|
try {
|
|
335
338
|
let a = f(n), s = h();
|
|
336
339
|
y(s);
|
|
337
|
-
let c = await
|
|
340
|
+
let c = await I(e, o(s, a));
|
|
338
341
|
n = b(c, a);
|
|
339
342
|
let l = new this(c, t, n, r, i);
|
|
340
343
|
return await Promise.allSettled(l.pluginsLoaded), l;
|
|
@@ -350,51 +353,51 @@ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t
|
|
|
350
353
|
_iframe;
|
|
351
354
|
constructor(e, n, r, i, a) {
|
|
352
355
|
if (super(), !e || typeof e.id != "string") throw Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");
|
|
353
|
-
if (
|
|
354
|
-
if (!document.getElementById(
|
|
356
|
+
if (G.has(n)) throw Error("There is already an instance on this DOM element");
|
|
357
|
+
if (!document.getElementById(V)) {
|
|
355
358
|
let e = r.zIndex || 9999999, t = document.createElement("style");
|
|
356
|
-
t.type = "text/css", t.id =
|
|
357
|
-
let n = "transition:all ease-in-out " +
|
|
359
|
+
t.type = "text/css", t.id = V;
|
|
360
|
+
let n = "transition:all ease-in-out " + H + "ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e += t + n, "") + n, a = z();
|
|
358
361
|
t.innerHTML = `
|
|
359
|
-
.${
|
|
360
|
-
.${
|
|
361
|
-
.${
|
|
362
|
-
.${
|
|
363
|
-
.${
|
|
364
|
-
.${
|
|
362
|
+
.${W.CONTAINER}{${U}:${a};}
|
|
363
|
+
.${W.POSITION}{position:fixed;top:0;left:0;z-index:${e};opacity:0}
|
|
364
|
+
.${W.TRANSITION}{${i}}
|
|
365
|
+
.${W.FILL}{width:100%;height:100%;opacity:1}
|
|
366
|
+
.${W.ANDROID_HEIGHT}{height:calc(var(${U},1vh)*100)}
|
|
367
|
+
.${W.OVERFLOW_HIDDEN}{overflow:hidden}
|
|
365
368
|
`, document.head.appendChild(t);
|
|
366
369
|
}
|
|
367
370
|
this._executeMessage = this._executeMessage.bind(this);
|
|
368
371
|
let o = new t("website", window, null, this._executeMessage);
|
|
369
372
|
this.setMessageHandler(o), this._onResize = this._onResize.bind(this), x() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = r, this._configuratorSettings = e;
|
|
370
373
|
let s = this._createIframe();
|
|
371
|
-
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe),
|
|
374
|
+
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe), G.set(n, !0);
|
|
372
375
|
}
|
|
373
376
|
teardown() {
|
|
374
|
-
this._container &&
|
|
377
|
+
this._container && G.delete(this._container);
|
|
375
378
|
let e = this._container.querySelector("iframe");
|
|
376
379
|
e && this._container.removeChild(e), window.removeEventListener("resize", this._onResize);
|
|
377
380
|
}
|
|
378
381
|
_createIframe() {
|
|
379
382
|
let e = document.createElement("iframe"), t = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
|
|
380
|
-
return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(
|
|
383
|
+
return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(W.CONTAINER), e.classList.add(W.FILL), e;
|
|
381
384
|
}
|
|
382
385
|
_onResize() {
|
|
383
|
-
|
|
386
|
+
B(this._iframe);
|
|
384
387
|
}
|
|
385
388
|
_onUseFullPage() {
|
|
386
|
-
this._iframe.classList.add(
|
|
389
|
+
this._iframe.classList.add(W.POSITION), document.documentElement.classList.add(W.OVERFLOW_HIDDEN), window.document.body.classList.add(W.OVERFLOW_HIDDEN), x() && (B(this._iframe), this._iframe.classList.add(W.ANDROID_HEIGHT));
|
|
387
390
|
}
|
|
388
391
|
_onBackToWebsite() {
|
|
389
|
-
this._iframe.classList.remove(
|
|
392
|
+
this._iframe.classList.remove(W.POSITION), this._iframe.classList.remove(W.ANDROID_HEIGHT), document.documentElement.classList.remove(W.OVERFLOW_HIDDEN), window.document.body.classList.remove(W.OVERFLOW_HIDDEN);
|
|
390
393
|
}
|
|
391
394
|
_executeMessage({ message: e, args: t }, n) {
|
|
392
|
-
if (n.source && n.source === this._iframe?.contentWindow) return e ===
|
|
395
|
+
if (n.source && n.source === this._iframe?.contentWindow) return e === j.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(n.source), Promise.resolve({ result: this._initData })) : (console.error("MessageHandler not set"), Promise.resolve({ error: "MessageHandler not set" })) : e === j.SETUP ? (this.handleSetup(t[0]), R(this.ui.callbacks, "onUseFullPage", this._onUseFullPage), R(this.ui.callbacks, "onBackToWebsite", this._onBackToWebsite), this._waitForIframe(this), setTimeout(() => {
|
|
393
396
|
if (!this._messageHandler) {
|
|
394
397
|
console.error("MessageHandler not set");
|
|
395
398
|
return;
|
|
396
399
|
}
|
|
397
|
-
this._messageHandler.sendMessage(
|
|
400
|
+
this._messageHandler.sendMessage(j.WEBSITE_READY);
|
|
398
401
|
}, 0), Promise.resolve({ result: null })) : this.executeMessage({
|
|
399
402
|
message: e,
|
|
400
403
|
args: t
|
|
@@ -402,4 +405,4 @@ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t
|
|
|
402
405
|
}
|
|
403
406
|
};
|
|
404
407
|
//#endregion
|
|
405
|
-
export {
|
|
408
|
+
export { j as HANDSHAKE_MESSAGES, L as INTERACTION_CONTAINER_SELECTOR, O as NAMESPACE, k as NAMESPACE_SEPARATOR, A as SDK_CALLBACK, M as WELL_KNOWN_MESSAGES, K as default, I as getConfiguratorSettings, F as getMethodNames, P as isExposable };
|
|
@@ -215,9 +215,7 @@ var t = class {
|
|
|
215
215
|
resolve: e,
|
|
216
216
|
reject: t
|
|
217
217
|
};
|
|
218
|
-
}
|
|
219
|
-
(/* @__PURE__ */ "/items./items/{id}./items/{id}/renderings./items/{id}/conversions./items/{id}/3d-exports./items/{id}/perspectiveImage./items/{id}/perspectiveImageHD./items/{id}/topImage./items/{id}/tags./items/{id}/tagConnections./items/{id}/additionalContents./items/{id}/assetProcessings./items/{id}/3dAssets/{format}./items/{id}/3dAssets/{format}/{dummyFileName}./configurations./configurations/{id}./configurations/{id}/shares./configurations/{id}/renderings./configurations/{id}/3d-exports./configurations/{id}/3dAssets/{format}./configurations/{id}/3dAssets/{format}/{dummyFileName}./auth/signin./auth/signout./auth/reset./auth/reset/confirm./auth/change/pwd./auth/context./assets/analyze./version".split(".")).map((e) => RegExp("^" + e.replace(/\{[^}]+\}/g, "[^/]+") + "/?$"));
|
|
220
|
-
var h = /\/v[23]\/?$/, g = {
|
|
218
|
+
}, h = (/* @__PURE__ */ "/items./items/{id}./items/{id}/renderings./items/{id}/conversions./items/{id}/3d-exports./items/{id}/perspectiveImage./items/{id}/perspectiveImageHD./items/{id}/topImage./items/{id}/tags./items/{id}/tagConnections./items/{id}/additionalContents./items/{id}/assetProcessings./items/{id}/3dAssets/{format}./items/{id}/3dAssets/{format}/{dummyFileName}./configurations./configurations/{id}./configurations/{id}/shares./configurations/{id}/renderings./configurations/{id}/3d-exports./configurations/{id}/3dAssets/{format}./configurations/{id}/3dAssets/{format}/{dummyFileName}./auth/signin./auth/signout./auth/reset./auth/reset/confirm./auth/change/pwd./auth/context./assets/analyze./version".split(".")).map((e) => RegExp("^" + e.replace(/\{[^}]+\}/g, "[^/]+") + "/?$")), g = /\/v[23]\/?$/, _ = {
|
|
221
219
|
SDK: "extended",
|
|
222
220
|
CONFIGURATOR_SDK: "configurator",
|
|
223
221
|
CALLBACKS: "callbacks",
|
|
@@ -225,24 +223,29 @@ var h = /\/v[23]\/?$/, g = {
|
|
|
225
223
|
ANALYTICS: "analytics",
|
|
226
224
|
GLOBAL: "global",
|
|
227
225
|
RAPI: "rapi"
|
|
228
|
-
},
|
|
226
|
+
}, v = ".", y = _.SDK + "." + _.CALLBACKS, b = {
|
|
229
227
|
REQUEST_BOOT: "requestBoot",
|
|
230
228
|
SETUP: "setup",
|
|
231
229
|
WEBSITE_READY: "websiteReady"
|
|
232
|
-
},
|
|
230
|
+
}, x = {
|
|
233
231
|
GET_METHODS: "getMethods",
|
|
234
232
|
RETURN_METHODS: "returnMethods",
|
|
235
233
|
REGISTER_CUSTOM_VIEW: "registerCustomView",
|
|
236
234
|
REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
|
|
237
|
-
},
|
|
235
|
+
}, S = ["constructor", "callbacks"], C = (e) => e[0] !== "_" && !S.includes(e), w = (e, t, n = !1) => {
|
|
238
236
|
if (!e) return [];
|
|
239
|
-
let r = Object.getOwnPropertyNames(e), i = n ?
|
|
240
|
-
return r.filter(
|
|
241
|
-
},
|
|
237
|
+
let r = Object.getOwnPropertyNames(e), i = n ? _.CALLBACKS + "." : "";
|
|
238
|
+
return r.filter(C).map((e) => t + "." + i + e);
|
|
239
|
+
}, T = async (e, t) => {
|
|
242
240
|
if (typeof e != "string") throw Error("Configurator ID is not a string type: \"" + typeof e + "\"");
|
|
243
|
-
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = (
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = ((e, t) => {
|
|
242
|
+
if (!g.test(e)) return e + t;
|
|
243
|
+
let n = ((e) => {
|
|
244
|
+
let t = e.split("?")[0];
|
|
245
|
+
return h.some((e) => e.test(t));
|
|
246
|
+
})(t) ? "v3" : "v2";
|
|
247
|
+
return e.replace(g, "/" + n) + t;
|
|
248
|
+
})(n, "/configurators/" + e), a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;roomle_portal_v2"), o = new Request(i, {
|
|
246
249
|
method: "GET",
|
|
247
250
|
headers: new Headers({
|
|
248
251
|
apiKey: "roomle_portal_v2",
|
|
@@ -250,14 +253,14 @@ var h = /\/v[23]\/?$/, g = {
|
|
|
250
253
|
locale: "en",
|
|
251
254
|
language: "en",
|
|
252
255
|
device: 1,
|
|
253
|
-
token:
|
|
256
|
+
token: a,
|
|
254
257
|
platform: "web"
|
|
255
258
|
}),
|
|
256
259
|
mode: "cors",
|
|
257
260
|
cache: "default"
|
|
258
|
-
}), { configurator:
|
|
259
|
-
return
|
|
260
|
-
},
|
|
261
|
+
}), { configurator: s } = await (await fetch(o)).json();
|
|
262
|
+
return s;
|
|
263
|
+
}, E = "data-rml-interaction-container", D = (e, t, n) => {
|
|
261
264
|
let r = null;
|
|
262
265
|
Object.defineProperty(e, t, {
|
|
263
266
|
get: () => r || n,
|
|
@@ -265,9 +268,9 @@ var h = /\/v[23]\/?$/, g = {
|
|
|
265
268
|
r = e?.mute ? e.value : e;
|
|
266
269
|
}
|
|
267
270
|
});
|
|
268
|
-
},
|
|
269
|
-
e && setTimeout(() => e.style.setProperty(
|
|
270
|
-
},
|
|
271
|
+
}, O = () => .01 * window.innerHeight + "px", k = (e) => {
|
|
272
|
+
e && setTimeout(() => e.style.setProperty(j, O()), 0);
|
|
273
|
+
}, A = "rml-styles", j = "--rml-full-height", M = "rml-container", N = "rml-fill", P = "rml-pos", F = "rml-android-height", I = "rml-overflow-hidden", L = /* @__PURE__ */ new Map(), R = class extends p {
|
|
271
274
|
static createPlanner(e, t, n, r = []) {
|
|
272
275
|
return this._create(e, t, n, r);
|
|
273
276
|
}
|
|
@@ -276,10 +279,10 @@ var h = /\/v[23]\/?$/, g = {
|
|
|
276
279
|
r.viewName = e;
|
|
277
280
|
let { resolve: i, promise: a } = m(), { resolve: o, promise: s } = m(), c = new t("custom-view-" + e, window, window.parent, ({ message: e, args: t }) => {
|
|
278
281
|
switch (e) {
|
|
279
|
-
case
|
|
282
|
+
case x.REGISTER_CUSTOM_VIEW_DONE:
|
|
280
283
|
i();
|
|
281
284
|
break;
|
|
282
|
-
case
|
|
285
|
+
case x.RETURN_METHODS:
|
|
283
286
|
r.handleSetup(t[0]), o();
|
|
284
287
|
break;
|
|
285
288
|
default: if (r.isSetupDone) return r.executeMessage({
|
|
@@ -290,7 +293,7 @@ var h = /\/v[23]\/?$/, g = {
|
|
|
290
293
|
});
|
|
291
294
|
r.setMessageHandler(c);
|
|
292
295
|
let l = [e];
|
|
293
|
-
return c.sendMessage(
|
|
296
|
+
return c.sendMessage(x.REGISTER_CUSTOM_VIEW, l), await a, c.sendMessage(x.GET_METHODS, l), await s, r.setupPlugins(n, document.body, "custom-view"), await Promise.allSettled(r.pluginsLoaded), r;
|
|
294
297
|
}
|
|
295
298
|
static createConfigurator(e, t, n, r = []) {
|
|
296
299
|
return this._create(e, t, n, r);
|
|
@@ -306,7 +309,7 @@ var h = /\/v[23]\/?$/, g = {
|
|
|
306
309
|
try {
|
|
307
310
|
let s = ((e) => (l(e), e?.customApiUrl && (e.customApiUrl = decodeURIComponent(e.customApiUrl)), e.shareUrl && (e.deeplink = e.shareUrl.replace("<CONF_ID>", "#CONFIGURATIONID#")), e))(n), c = u();
|
|
308
311
|
d(c);
|
|
309
|
-
let f = await
|
|
312
|
+
let f = await T(e, r(c, s));
|
|
310
313
|
n = ((e, t) => {
|
|
311
314
|
let n = o(t), i = u();
|
|
312
315
|
d(i);
|
|
@@ -332,44 +335,44 @@ var h = /\/v[23]\/?$/, g = {
|
|
|
332
335
|
_iframe;
|
|
333
336
|
constructor(e, n, r, i, a) {
|
|
334
337
|
if (super(), !e || typeof e.id != "string") throw Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");
|
|
335
|
-
if (
|
|
336
|
-
if (!document.getElementById(
|
|
338
|
+
if (L.has(n)) throw Error("There is already an instance on this DOM element");
|
|
339
|
+
if (!document.getElementById(A)) {
|
|
337
340
|
let e = r.zIndex || 9999999, t = document.createElement("style");
|
|
338
|
-
t.type = "text/css", t.id =
|
|
341
|
+
t.type = "text/css", t.id = A;
|
|
339
342
|
let n = "transition:all ease-in-out 450ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e + (t + n), "") + n;
|
|
340
|
-
t.innerHTML = `\n .${
|
|
343
|
+
t.innerHTML = `\n .${M}{${j}:${O()};}\n .${P}{position:fixed;top:0;left:0;z-index:${e};opacity:0}\n .rml-transition{${i}}\n .${N}{width:100%;height:100%;opacity:1}\n .${F}{height:calc(var(${j},1vh)*100)}\n .${I}{overflow:hidden}\n `, document.head.appendChild(t);
|
|
341
344
|
}
|
|
342
345
|
this._executeMessage = this._executeMessage.bind(this);
|
|
343
346
|
let o = new t("website", window, null, this._executeMessage);
|
|
344
347
|
this.setMessageHandler(o), this._onResize = this._onResize.bind(this), f() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = r, this._configuratorSettings = e;
|
|
345
348
|
let s = this._createIframe();
|
|
346
|
-
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe),
|
|
349
|
+
this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe), L.set(n, !0);
|
|
347
350
|
}
|
|
348
351
|
teardown() {
|
|
349
|
-
this._container &&
|
|
352
|
+
this._container && L.delete(this._container);
|
|
350
353
|
let e = this._container.querySelector("iframe");
|
|
351
354
|
e && this._container.removeChild(e), window.removeEventListener("resize", this._onResize);
|
|
352
355
|
}
|
|
353
356
|
_createIframe() {
|
|
354
357
|
let e = document.createElement("iframe"), t = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
|
|
355
|
-
return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(
|
|
358
|
+
return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(M), e.classList.add(N), e;
|
|
356
359
|
}
|
|
357
360
|
_onResize() {
|
|
358
|
-
|
|
361
|
+
k(this._iframe);
|
|
359
362
|
}
|
|
360
363
|
_onUseFullPage() {
|
|
361
|
-
this._iframe.classList.add(
|
|
364
|
+
this._iframe.classList.add(P), document.documentElement.classList.add(I), window.document.body.classList.add(I), f() && (k(this._iframe), this._iframe.classList.add(F));
|
|
362
365
|
}
|
|
363
366
|
_onBackToWebsite() {
|
|
364
|
-
this._iframe.classList.remove(
|
|
367
|
+
this._iframe.classList.remove(P), this._iframe.classList.remove(F), document.documentElement.classList.remove(I), window.document.body.classList.remove(I);
|
|
365
368
|
}
|
|
366
369
|
_executeMessage({ message: e, args: t }, n) {
|
|
367
|
-
if (n.source && n.source === this._iframe?.contentWindow) return e ===
|
|
368
|
-
this._messageHandler && this._messageHandler.sendMessage(
|
|
370
|
+
if (n.source && n.source === this._iframe?.contentWindow) return e === b.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(n.source), Promise.resolve({ result: this._initData })) : Promise.resolve({ error: "MessageHandler not set" }) : e === b.SETUP ? (this.handleSetup(t[0]), D(this.ui.callbacks, "onUseFullPage", this._onUseFullPage), D(this.ui.callbacks, "onBackToWebsite", this._onBackToWebsite), this._waitForIframe(this), setTimeout(() => {
|
|
371
|
+
this._messageHandler && this._messageHandler.sendMessage(b.WEBSITE_READY);
|
|
369
372
|
}, 0), Promise.resolve({ result: null })) : this.executeMessage({
|
|
370
373
|
message: e,
|
|
371
374
|
args: t
|
|
372
375
|
});
|
|
373
376
|
}
|
|
374
377
|
};
|
|
375
|
-
export {
|
|
378
|
+
export { b as HANDSHAKE_MESSAGES, E as INTERACTION_CONTAINER_SELECTOR, _ as NAMESPACE, v as NAMESPACE_SEPARATOR, y as SDK_CALLBACK, x as WELL_KNOWN_MESSAGES, R as default, T as getConfiguratorSettings, w as getMethodNames, C as isExposable };
|