@roomle/embedding-lib 8.2.0-alpha.2 → 8.2.0-alpha.4
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 +4 -31
- package/package.json +1 -1
- package/roomle-embedding-lib.js +45 -37
- package/roomle-embedding-lib.min.js +38 -30
|
@@ -1,32 +1,5 @@
|
|
|
1
|
-
## 8.2.0-alpha.
|
|
1
|
+
## 8.2.0-alpha.4 (2026-10-09)
|
|
2
2
|
|
|
3
|
-
* Merge
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Merge branch 'master' into feat/hi-row-edit-commands-RML-18045 ([1a3749e](https://github.com/roomle-dev/roomle-ui/commit/1a3749e))
|
|
7
|
-
* Merge branch 'master' into feat/hi-row-edit-commands-RML-18045 ([d5effc9](https://github.com/roomle-dev/roomle-ui/commit/d5effc9))
|
|
8
|
-
* Merge branch 'master' into feat/hi-row-edit-commands-RML-18045 ([f250c65](https://github.com/roomle-dev/roomle-ui/commit/f250c65))
|
|
9
|
-
* Merge branch 'master' into fix/firefox-dragging-in-hi ([70ce163](https://github.com/roomle-dev/roomle-ui/commit/70ce163))
|
|
10
|
-
* Merge branch 'master' into fix/hide-only-components-cut-by-camera ([370eda1](https://github.com/roomle-dev/roomle-ui/commit/370eda1))
|
|
11
|
-
* Merge branch 'master' into fix/hide-only-components-cut-by-camera ([5440884](https://github.com/roomle-dev/roomle-ui/commit/5440884))
|
|
12
|
-
* Merge pull request #3034 from roomle-dev/fix/hide-only-components-cut-by-camera ([be0cecf](https://github.com/roomle-dev/roomle-ui/commit/be0cecf)), closes [#3034](https://github.com/roomle-dev/roomle-ui/issues/3034)
|
|
13
|
-
* Merge pull request #3079 from roomle-dev/feat/enable-initialFloorMaterial-for-sky-mode ([6f21e11](https://github.com/roomle-dev/roomle-ui/commit/6f21e11)), closes [#3079](https://github.com/roomle-dev/roomle-ui/issues/3079)
|
|
14
|
-
* Merge pull request #3086 from roomle-dev/chore/refactor-requestAnimationFrame-setAnimationLoop ([267e55c](https://github.com/roomle-dev/roomle-ui/commit/267e55c)), closes [#3086](https://github.com/roomle-dev/roomle-ui/issues/3086)
|
|
15
|
-
* Merge pull request #3087 from roomle-dev/feat/hi-row-edit-commands-RML-18045 ([7cf9966](https://github.com/roomle-dev/roomle-ui/commit/7cf9966)), closes [#3087](https://github.com/roomle-dev/roomle-ui/issues/3087)
|
|
16
|
-
* Merge pull request #3089 from roomle-dev/upgraded-by-ci/core-3.1.0-alpha.4 ([812707c](https://github.com/roomle-dev/roomle-ui/commit/812707c)), closes [#3089](https://github.com/roomle-dev/roomle-ui/issues/3089)
|
|
17
|
-
* Merge pull request #3090 from roomle-dev/fix/resolve-duplicate-docking-vector-names-RML-18054 ([93bb768](https://github.com/roomle-dev/roomle-ui/commit/93bb768)), closes [#3090](https://github.com/roomle-dev/roomle-ui/issues/3090)
|
|
18
|
-
* Merge pull request #3091 from roomle-dev/fix/firefox-dragging-in-hi ([2fbd6c7](https://github.com/roomle-dev/roomle-ui/commit/2fbd6c7)), closes [#3091](https://github.com/roomle-dev/roomle-ui/issues/3091)
|
|
19
|
-
* fix: address the review of the row edit commands ([65b13c5](https://github.com/roomle-dev/roomle-ui/commit/65b13c5))
|
|
20
|
-
* fix: dock hi roots at the outermost of several docking vectors with one name ([5d00e65](https://github.com/roomle-dev/roomle-ui/commit/5d00e65))
|
|
21
|
-
* fix: drop the docking to a deleted root module ([20d95fa](https://github.com/roomle-dev/roomle-ui/commit/20d95fa))
|
|
22
|
-
* fix: element dragin not working on firefox ([af91650](https://github.com/roomle-dev/roomle-ui/commit/af91650))
|
|
23
|
-
* fix(planner): hide only the configuration components cut by the camera ([928d107](https://github.com/roomle-dev/roomle-ui/commit/928d107))
|
|
24
|
-
* fix(planner): keep camera-cut visibility off the render loop's allocation path ([4bbf5ce](https://github.com/roomle-dev/roomle-ui/commit/4bbf5ce))
|
|
25
|
-
* test: cover the resolution of duplicate back docking vectors ([1ebf183](https://github.com/roomle-dev/roomle-ui/commit/1ebf183))
|
|
26
|
-
* feat: add the obstacles section to the plan context ([c8f61d0](https://github.com/roomle-dev/roomle-ui/commit/c8f61d0))
|
|
27
|
-
* feat: enable initialFloorMaterial for planner in sky mode ([6611345](https://github.com/roomle-dev/roomle-ui/commit/6611345))
|
|
28
|
-
* feat: insert, remove and swap root modules of a group ([ff972b3](https://github.com/roomle-dev/roomle-ui/commit/ff972b3))
|
|
29
|
-
* feat: read the obstacle map of the plan ([c6d274f](https://github.com/roomle-dev/roomle-ui/commit/c6d274f))
|
|
30
|
-
* feat(core): upgrade to version 3.1.0-alpha.4 ([d2b46b2](https://github.com/roomle-dev/roomle-ui/commit/d2b46b2))
|
|
31
|
-
* feat: use setAnimationLoop instead of requestAnimationFrame and add inspector textures + add flag to ([b47e110](https://github.com/roomle-dev/roomle-ui/commit/b47e110))
|
|
32
|
-
* refactor: share the rearranged load of swapRootModule ([385a642](https://github.com/roomle-dev/roomle-ui/commit/385a642))
|
|
3
|
+
* Merge pull request #3077 from roomle-dev/innovation/curved-walls-poc-ui ([32d10ab](https://github.com/roomle-dev/roomle-ui/commit/32d10ab)), closes [#3077](https://github.com/roomle-dev/roomle-ui/issues/3077)
|
|
4
|
+
* fix: commit setWallCurve immediately and assert curved wall positions ([8841fa9](https://github.com/roomle-dev/roomle-ui/commit/8841fa9))
|
|
5
|
+
* feat: add a curved walls proof of concept to the wall drawer ([9c43118](https://github.com/roomle-dev/roomle-ui/commit/9c43118))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "8.2.0-alpha.
|
|
3
|
+
"version": "8.2.0-alpha.4",
|
|
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
|
@@ -120,6 +120,7 @@ var t = class {
|
|
|
120
120
|
featureFlags: {
|
|
121
121
|
mocAr: !0,
|
|
122
122
|
wallAutoHeight: !1,
|
|
123
|
+
curvedWalls: !1,
|
|
123
124
|
openCloseAnimation: !0,
|
|
124
125
|
localExport3d: !1
|
|
125
126
|
},
|
|
@@ -138,7 +139,7 @@ var t = class {
|
|
|
138
139
|
let t = l(u);
|
|
139
140
|
t.locale ||= e(null, !0), t.id === "(idle)" && delete t.id;
|
|
140
141
|
let n = i();
|
|
141
|
-
return n && a(n) && (t.configuratorId = "demoConfigurator"), t.customApiUrl = "https://rubens.alpha.roomle.com/api/
|
|
142
|
+
return n && a(n) && (t.configuratorId = "demoConfigurator"), t.customApiUrl = "https://rubens.alpha.roomle.com/api/v2", t.emails = !1, t;
|
|
142
143
|
}, h = "<CONF_ID>", g = "#CONFIGURATIONID#", _ = (e) => {
|
|
143
144
|
let t = e.featureFlags;
|
|
144
145
|
if (!t || typeof t != "object" || Array.isArray(t)) return;
|
|
@@ -224,7 +225,14 @@ var t = class {
|
|
|
224
225
|
resolve: e,
|
|
225
226
|
reject: t
|
|
226
227
|
};
|
|
227
|
-
}, C = {
|
|
228
|
+
}, C = (/* @__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, "[^/]+") + "/?$")), w = /\/v[23]\/?$/, T = (e) => {
|
|
229
|
+
let t = e.split("?")[0];
|
|
230
|
+
return C.some((e) => e.test(t));
|
|
231
|
+
}, E = (e, t) => {
|
|
232
|
+
if (!w.test(e)) return e + t;
|
|
233
|
+
let n = T(t) ? "v3" : "v2";
|
|
234
|
+
return e.replace(w, "/" + n) + t;
|
|
235
|
+
}, D = {
|
|
228
236
|
SDK: "extended",
|
|
229
237
|
CONFIGURATOR_SDK: "configurator",
|
|
230
238
|
CALLBACKS: "callbacks",
|
|
@@ -232,22 +240,22 @@ var t = class {
|
|
|
232
240
|
ANALYTICS: "analytics",
|
|
233
241
|
GLOBAL: "global",
|
|
234
242
|
RAPI: "rapi"
|
|
235
|
-
},
|
|
243
|
+
}, O = ".", k = D.SDK + "." + D.CALLBACKS, A = {
|
|
236
244
|
REQUEST_BOOT: "requestBoot",
|
|
237
245
|
SETUP: "setup",
|
|
238
246
|
WEBSITE_READY: "websiteReady"
|
|
239
|
-
},
|
|
247
|
+
}, j = {
|
|
240
248
|
GET_METHODS: "getMethods",
|
|
241
249
|
RETURN_METHODS: "returnMethods",
|
|
242
250
|
REGISTER_CUSTOM_VIEW: "registerCustomView",
|
|
243
251
|
REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
|
|
244
|
-
},
|
|
252
|
+
}, M = ["constructor", "callbacks"], N = (e) => e[0] !== "_" && !M.includes(e), P = (e, t, n = !1) => {
|
|
245
253
|
if (!e) return [];
|
|
246
|
-
let r = Object.getOwnPropertyNames(e), i = n ?
|
|
247
|
-
return r.filter(
|
|
248
|
-
},
|
|
254
|
+
let r = Object.getOwnPropertyNames(e), i = n ? D.CALLBACKS + "." : "";
|
|
255
|
+
return r.filter(N).map((e) => t + "." + i + e);
|
|
256
|
+
}, F = async (e, t) => {
|
|
249
257
|
if (typeof e != "string") throw Error("Configurator ID is not a string type: \"" + typeof e + "\"");
|
|
250
|
-
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/
|
|
258
|
+
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = E(n, "/configurators/" + e), a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;roomle_portal_v2"), o = new Request(i, {
|
|
251
259
|
method: "GET",
|
|
252
260
|
headers: new Headers({
|
|
253
261
|
apiKey: "roomle_portal_v2",
|
|
@@ -262,7 +270,7 @@ var t = class {
|
|
|
262
270
|
cache: "default"
|
|
263
271
|
}), { configurator: s } = await (await fetch(o)).json();
|
|
264
272
|
return s;
|
|
265
|
-
},
|
|
273
|
+
}, I = "data-rml-interaction-container", L = (e, t, n) => {
|
|
266
274
|
let r = null;
|
|
267
275
|
Object.defineProperty(e, t, {
|
|
268
276
|
get() {
|
|
@@ -272,16 +280,16 @@ var t = class {
|
|
|
272
280
|
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);
|
|
273
281
|
}
|
|
274
282
|
});
|
|
275
|
-
},
|
|
276
|
-
e && setTimeout(() => e.style.setProperty(
|
|
277
|
-
},
|
|
283
|
+
}, R = () => window.innerHeight * .01 + "px", z = (e) => {
|
|
284
|
+
e && setTimeout(() => e.style.setProperty(H, R()), 0);
|
|
285
|
+
}, B = "rml-styles", V = 450, H = "--rml-full-height", U = {
|
|
278
286
|
CONTAINER: "rml-container",
|
|
279
287
|
FILL: "rml-fill",
|
|
280
288
|
POSITION: "rml-pos",
|
|
281
289
|
TRANSITION: "rml-transition",
|
|
282
290
|
ANDROID_HEIGHT: "rml-android-height",
|
|
283
291
|
OVERFLOW_HIDDEN: "rml-overflow-hidden"
|
|
284
|
-
},
|
|
292
|
+
}, W = /* @__PURE__ */ new Map(), G = class extends x {
|
|
285
293
|
static createPlanner(e, t, n, r = []) {
|
|
286
294
|
return this._create(e, t, n, r);
|
|
287
295
|
}
|
|
@@ -290,10 +298,10 @@ var t = class {
|
|
|
290
298
|
r.viewName = e;
|
|
291
299
|
let { resolve: i, promise: a } = S(), { resolve: o, promise: s } = S(), c = new t("custom-view-" + e, window, window.parent, ({ message: e, args: t }) => {
|
|
292
300
|
switch (e) {
|
|
293
|
-
case
|
|
301
|
+
case j.REGISTER_CUSTOM_VIEW_DONE:
|
|
294
302
|
i();
|
|
295
303
|
break;
|
|
296
|
-
case
|
|
304
|
+
case j.RETURN_METHODS:
|
|
297
305
|
r.handleSetup(t[0]), o();
|
|
298
306
|
break;
|
|
299
307
|
default: if (r.isSetupDone) return r.executeMessage({
|
|
@@ -304,7 +312,7 @@ var t = class {
|
|
|
304
312
|
});
|
|
305
313
|
r.setMessageHandler(c);
|
|
306
314
|
let l = [e];
|
|
307
|
-
return c.sendMessage(
|
|
315
|
+
return c.sendMessage(j.REGISTER_CUSTOM_VIEW, l), await a, c.sendMessage(j.GET_METHODS, l), await s, r.setupPlugins(n, document.body, "custom-view"), await Promise.allSettled(r.pluginsLoaded), r;
|
|
308
316
|
}
|
|
309
317
|
static createConfigurator(e, t, n, r = []) {
|
|
310
318
|
return this._create(e, t, n, r);
|
|
@@ -320,7 +328,7 @@ var t = class {
|
|
|
320
328
|
try {
|
|
321
329
|
let a = d(n), s = m();
|
|
322
330
|
v(s);
|
|
323
|
-
let c = await
|
|
331
|
+
let c = await F(e, o(s, a));
|
|
324
332
|
n = y(c, a);
|
|
325
333
|
let l = new this(c, t, n, r, i);
|
|
326
334
|
return await Promise.allSettled(l.pluginsLoaded), l;
|
|
@@ -336,51 +344,51 @@ var t = class {
|
|
|
336
344
|
_iframe;
|
|
337
345
|
constructor(e, n, r, i, a) {
|
|
338
346
|
if (super(), !e || typeof e.id != "string") throw Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");
|
|
339
|
-
if (
|
|
340
|
-
if (!document.getElementById(
|
|
347
|
+
if (W.has(n)) throw Error("There is already an instance on this DOM element");
|
|
348
|
+
if (!document.getElementById(B)) {
|
|
341
349
|
let e = r.zIndex || 9999999, t = document.createElement("style");
|
|
342
|
-
t.type = "text/css", t.id =
|
|
343
|
-
let n = "transition:all ease-in-out " +
|
|
350
|
+
t.type = "text/css", t.id = B;
|
|
351
|
+
let n = "transition:all ease-in-out " + V + "ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e += t + n, "") + n, a = R();
|
|
344
352
|
t.innerHTML = `
|
|
345
|
-
.${
|
|
346
|
-
.${
|
|
347
|
-
.${
|
|
348
|
-
.${
|
|
349
|
-
.${
|
|
350
|
-
.${
|
|
353
|
+
.${U.CONTAINER}{${H}:${a};}
|
|
354
|
+
.${U.POSITION}{position:fixed;top:0;left:0;z-index:${e};opacity:0}
|
|
355
|
+
.${U.TRANSITION}{${i}}
|
|
356
|
+
.${U.FILL}{width:100%;height:100%;opacity:1}
|
|
357
|
+
.${U.ANDROID_HEIGHT}{height:calc(var(${H},1vh)*100)}
|
|
358
|
+
.${U.OVERFLOW_HIDDEN}{overflow:hidden}
|
|
351
359
|
`, document.head.appendChild(t);
|
|
352
360
|
}
|
|
353
361
|
this._executeMessage = this._executeMessage.bind(this);
|
|
354
362
|
let o = new t("website", window, null, this._executeMessage);
|
|
355
363
|
this.setMessageHandler(o), this._onResize = this._onResize.bind(this), b() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = r, this._configuratorSettings = e;
|
|
356
364
|
let s = this._createIframe();
|
|
357
|
-
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),
|
|
365
|
+
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), W.set(n, !0);
|
|
358
366
|
}
|
|
359
367
|
teardown() {
|
|
360
|
-
this._container &&
|
|
368
|
+
this._container && W.delete(this._container);
|
|
361
369
|
let e = this._container.querySelector("iframe");
|
|
362
370
|
e && this._container.removeChild(e), window.removeEventListener("resize", this._onResize);
|
|
363
371
|
}
|
|
364
372
|
_createIframe() {
|
|
365
373
|
let e = document.createElement("iframe"), t = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
|
|
366
|
-
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.classList.add(
|
|
374
|
+
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.classList.add(U.CONTAINER), e.classList.add(U.FILL), e;
|
|
367
375
|
}
|
|
368
376
|
_onResize() {
|
|
369
|
-
|
|
377
|
+
z(this._iframe);
|
|
370
378
|
}
|
|
371
379
|
_onUseFullPage() {
|
|
372
|
-
this._iframe.classList.add(
|
|
380
|
+
this._iframe.classList.add(U.POSITION), document.documentElement.classList.add(U.OVERFLOW_HIDDEN), window.document.body.classList.add(U.OVERFLOW_HIDDEN), b() && (z(this._iframe), this._iframe.classList.add(U.ANDROID_HEIGHT));
|
|
373
381
|
}
|
|
374
382
|
_onBackToWebsite() {
|
|
375
|
-
this._iframe.classList.remove(
|
|
383
|
+
this._iframe.classList.remove(U.POSITION), this._iframe.classList.remove(U.ANDROID_HEIGHT), document.documentElement.classList.remove(U.OVERFLOW_HIDDEN), window.document.body.classList.remove(U.OVERFLOW_HIDDEN);
|
|
376
384
|
}
|
|
377
385
|
_executeMessage({ message: e, args: t }, n) {
|
|
378
|
-
if (n.source && n.source === this._iframe?.contentWindow) return e ===
|
|
386
|
+
if (n.source && n.source === this._iframe?.contentWindow) return e === A.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 === A.SETUP ? (this.handleSetup(t[0]), L(this.ui.callbacks, "onUseFullPage", this._onUseFullPage), L(this.ui.callbacks, "onBackToWebsite", this._onBackToWebsite), this._waitForIframe(this), setTimeout(() => {
|
|
379
387
|
if (!this._messageHandler) {
|
|
380
388
|
console.error("MessageHandler not set");
|
|
381
389
|
return;
|
|
382
390
|
}
|
|
383
|
-
this._messageHandler.sendMessage(
|
|
391
|
+
this._messageHandler.sendMessage(A.WEBSITE_READY);
|
|
384
392
|
}, 0), Promise.resolve({ result: null })) : this.executeMessage({
|
|
385
393
|
message: e,
|
|
386
394
|
args: t
|
|
@@ -388,4 +396,4 @@ var t = class {
|
|
|
388
396
|
}
|
|
389
397
|
};
|
|
390
398
|
//#endregion
|
|
391
|
-
export {
|
|
399
|
+
export { A as HANDSHAKE_MESSAGES, I as INTERACTION_CONTAINER_SELECTOR, D as NAMESPACE, O as NAMESPACE_SEPARATOR, k as SDK_CALLBACK, j as WELL_KNOWN_MESSAGES, G as default, F as getConfiguratorSettings, P as getMethodNames, N as isExposable };
|
|
@@ -98,6 +98,7 @@ var t = class {
|
|
|
98
98
|
featureFlags: {
|
|
99
99
|
mocAr: !0,
|
|
100
100
|
wallAutoHeight: !1,
|
|
101
|
+
curvedWalls: !1,
|
|
101
102
|
openCloseAnimation: !0,
|
|
102
103
|
localExport3d: !1
|
|
103
104
|
},
|
|
@@ -133,7 +134,7 @@ var t = class {
|
|
|
133
134
|
return r && ((e) => {
|
|
134
135
|
let t = /* @__PURE__ */ new RegExp(/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/);
|
|
135
136
|
return !!(n.includes(e) || t.test(e) || e.endsWith("roomle.com") || e.endsWith("gitlab.io") || e.endsWith("gitlab.com"));
|
|
136
|
-
})(r) && (t.configuratorId = "demoConfigurator"), t.customApiUrl = "https://rubens.alpha.roomle.com/api/
|
|
137
|
+
})(r) && (t.configuratorId = "demoConfigurator"), t.customApiUrl = "https://rubens.alpha.roomle.com/api/v2", t.emails = !1, t;
|
|
137
138
|
}, d = (e) => {
|
|
138
139
|
e.featureFlags ||= {}, typeof e.featureFlags.realPartList != "boolean" && (e.featureFlags.realPartList = !0), typeof e.featureFlags.globalCallbacks != "boolean" && (e.featureFlags.globalCallbacks = !0), typeof e.featureFlags.mocAr != "boolean" && (e.featureFlags.mocAr = !1);
|
|
139
140
|
}, f = () => /(android)/i.test(navigator.userAgent), p = class {
|
|
@@ -205,7 +206,7 @@ var t = class {
|
|
|
205
206
|
resolve: e,
|
|
206
207
|
reject: t
|
|
207
208
|
};
|
|
208
|
-
}, h = {
|
|
209
|
+
}, 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]\/?$/, _ = {
|
|
209
210
|
SDK: "extended",
|
|
210
211
|
CONFIGURATOR_SDK: "configurator",
|
|
211
212
|
CALLBACKS: "callbacks",
|
|
@@ -213,22 +214,29 @@ var t = class {
|
|
|
213
214
|
ANALYTICS: "analytics",
|
|
214
215
|
GLOBAL: "global",
|
|
215
216
|
RAPI: "rapi"
|
|
216
|
-
},
|
|
217
|
+
}, v = ".", y = _.SDK + "." + _.CALLBACKS, b = {
|
|
217
218
|
REQUEST_BOOT: "requestBoot",
|
|
218
219
|
SETUP: "setup",
|
|
219
220
|
WEBSITE_READY: "websiteReady"
|
|
220
|
-
},
|
|
221
|
+
}, x = {
|
|
221
222
|
GET_METHODS: "getMethods",
|
|
222
223
|
RETURN_METHODS: "returnMethods",
|
|
223
224
|
REGISTER_CUSTOM_VIEW: "registerCustomView",
|
|
224
225
|
REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
|
|
225
|
-
},
|
|
226
|
+
}, S = ["constructor", "callbacks"], C = (e) => e[0] !== "_" && !S.includes(e), w = (e, t, n = !1) => {
|
|
226
227
|
if (!e) return [];
|
|
227
|
-
let r = Object.getOwnPropertyNames(e), i = n ?
|
|
228
|
-
return r.filter(
|
|
229
|
-
},
|
|
228
|
+
let r = Object.getOwnPropertyNames(e), i = n ? _.CALLBACKS + "." : "";
|
|
229
|
+
return r.filter(C).map((e) => t + "." + i + e);
|
|
230
|
+
}, T = async (e, t) => {
|
|
230
231
|
if (typeof e != "string") throw Error("Configurator ID is not a string type: \"" + typeof e + "\"");
|
|
231
|
-
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/
|
|
232
|
+
let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = ((e, t) => {
|
|
233
|
+
if (!g.test(e)) return e + t;
|
|
234
|
+
let n = ((e) => {
|
|
235
|
+
let t = e.split("?")[0];
|
|
236
|
+
return h.some((e) => e.test(t));
|
|
237
|
+
})(t) ? "v3" : "v2";
|
|
238
|
+
return e.replace(g, "/" + n) + t;
|
|
239
|
+
})(n, "/configurators/" + e), a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;roomle_portal_v2"), o = new Request(i, {
|
|
232
240
|
method: "GET",
|
|
233
241
|
headers: new Headers({
|
|
234
242
|
apiKey: "roomle_portal_v2",
|
|
@@ -243,7 +251,7 @@ var t = class {
|
|
|
243
251
|
cache: "default"
|
|
244
252
|
}), { configurator: s } = await (await fetch(o)).json();
|
|
245
253
|
return s;
|
|
246
|
-
},
|
|
254
|
+
}, E = "data-rml-interaction-container", D = (e, t, n) => {
|
|
247
255
|
let r = null;
|
|
248
256
|
Object.defineProperty(e, t, {
|
|
249
257
|
get: () => r || n,
|
|
@@ -251,9 +259,9 @@ var t = class {
|
|
|
251
259
|
r = e?.mute ? e.value : e;
|
|
252
260
|
}
|
|
253
261
|
});
|
|
254
|
-
},
|
|
255
|
-
e && setTimeout(() => e.style.setProperty(
|
|
256
|
-
},
|
|
262
|
+
}, O = () => .01 * window.innerHeight + "px", k = (e) => {
|
|
263
|
+
e && setTimeout(() => e.style.setProperty(j, O()), 0);
|
|
264
|
+
}, 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 {
|
|
257
265
|
static createPlanner(e, t, n, r = []) {
|
|
258
266
|
return this._create(e, t, n, r);
|
|
259
267
|
}
|
|
@@ -262,10 +270,10 @@ var t = class {
|
|
|
262
270
|
r.viewName = e;
|
|
263
271
|
let { resolve: i, promise: a } = m(), { resolve: o, promise: s } = m(), c = new t("custom-view-" + e, window, window.parent, ({ message: e, args: t }) => {
|
|
264
272
|
switch (e) {
|
|
265
|
-
case
|
|
273
|
+
case x.REGISTER_CUSTOM_VIEW_DONE:
|
|
266
274
|
i();
|
|
267
275
|
break;
|
|
268
|
-
case
|
|
276
|
+
case x.RETURN_METHODS:
|
|
269
277
|
r.handleSetup(t[0]), o();
|
|
270
278
|
break;
|
|
271
279
|
default: if (r.isSetupDone) return r.executeMessage({
|
|
@@ -276,7 +284,7 @@ var t = class {
|
|
|
276
284
|
});
|
|
277
285
|
r.setMessageHandler(c);
|
|
278
286
|
let l = [e];
|
|
279
|
-
return c.sendMessage(
|
|
287
|
+
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;
|
|
280
288
|
}
|
|
281
289
|
static createConfigurator(e, t, n, r = []) {
|
|
282
290
|
return this._create(e, t, n, r);
|
|
@@ -292,7 +300,7 @@ var t = class {
|
|
|
292
300
|
try {
|
|
293
301
|
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();
|
|
294
302
|
d(c);
|
|
295
|
-
let f = await
|
|
303
|
+
let f = await T(e, r(c, s));
|
|
296
304
|
n = ((e, t) => {
|
|
297
305
|
let n = o(t), i = u();
|
|
298
306
|
d(i);
|
|
@@ -318,44 +326,44 @@ var t = class {
|
|
|
318
326
|
_iframe;
|
|
319
327
|
constructor(e, n, r, i, a) {
|
|
320
328
|
if (super(), !e || typeof e.id != "string") throw Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");
|
|
321
|
-
if (
|
|
322
|
-
if (!document.getElementById(
|
|
329
|
+
if (L.has(n)) throw Error("There is already an instance on this DOM element");
|
|
330
|
+
if (!document.getElementById(A)) {
|
|
323
331
|
let e = r.zIndex || 9999999, t = document.createElement("style");
|
|
324
|
-
t.type = "text/css", t.id =
|
|
332
|
+
t.type = "text/css", t.id = A;
|
|
325
333
|
let n = "transition:all ease-in-out 450ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e + (t + n), "") + n;
|
|
326
|
-
t.innerHTML = `\n .${
|
|
334
|
+
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);
|
|
327
335
|
}
|
|
328
336
|
this._executeMessage = this._executeMessage.bind(this);
|
|
329
337
|
let o = new t("website", window, null, this._executeMessage);
|
|
330
338
|
this.setMessageHandler(o), this._onResize = this._onResize.bind(this), f() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = r, this._configuratorSettings = e;
|
|
331
339
|
let s = this._createIframe();
|
|
332
|
-
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),
|
|
340
|
+
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);
|
|
333
341
|
}
|
|
334
342
|
teardown() {
|
|
335
|
-
this._container &&
|
|
343
|
+
this._container && L.delete(this._container);
|
|
336
344
|
let e = this._container.querySelector("iframe");
|
|
337
345
|
e && this._container.removeChild(e), window.removeEventListener("resize", this._onResize);
|
|
338
346
|
}
|
|
339
347
|
_createIframe() {
|
|
340
348
|
let e = document.createElement("iframe"), t = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
|
|
341
|
-
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.classList.add(
|
|
349
|
+
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.classList.add(M), e.classList.add(N), e;
|
|
342
350
|
}
|
|
343
351
|
_onResize() {
|
|
344
|
-
|
|
352
|
+
k(this._iframe);
|
|
345
353
|
}
|
|
346
354
|
_onUseFullPage() {
|
|
347
|
-
this._iframe.classList.add(
|
|
355
|
+
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));
|
|
348
356
|
}
|
|
349
357
|
_onBackToWebsite() {
|
|
350
|
-
this._iframe.classList.remove(
|
|
358
|
+
this._iframe.classList.remove(P), this._iframe.classList.remove(F), document.documentElement.classList.remove(I), window.document.body.classList.remove(I);
|
|
351
359
|
}
|
|
352
360
|
_executeMessage({ message: e, args: t }, n) {
|
|
353
|
-
if (n.source && n.source === this._iframe?.contentWindow) return e ===
|
|
354
|
-
this._messageHandler && this._messageHandler.sendMessage(
|
|
361
|
+
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(() => {
|
|
362
|
+
this._messageHandler && this._messageHandler.sendMessage(b.WEBSITE_READY);
|
|
355
363
|
}, 0), Promise.resolve({ result: null })) : this.executeMessage({
|
|
356
364
|
message: e,
|
|
357
365
|
args: t
|
|
358
366
|
});
|
|
359
367
|
}
|
|
360
368
|
};
|
|
361
|
-
export {
|
|
369
|
+
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 };
|