@roomle/embedding-lib 6.5.0 → 6.6.0-alpha.2
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/browser-C_Dfiou7.mjs +18 -0
- package/browser-DRgK3Fk8.mjs +16 -0
- package/comlink-BipJ8Ikr.mjs +237 -0
- package/comlink-Dds_bpug.mjs +220 -0
- package/docs/md/web/embedding/CHANGELOG.md +32 -150
- package/drag-ghost-BGZWgVa7.mjs +60 -0
- package/drag-ghost-DGgvJ4Lm.mjs +65 -0
- package/drag-in-AFSAsnAN.mjs +102 -0
- package/drag-in-BwqVwCBp.mjs +96 -0
- package/embedding-plugins.js +2 -14
- package/embedding-plugins.min.js +2 -1
- package/from-custom-view-B-eXMXF1.mjs +207 -0
- package/from-custom-view-tZcYF-zX.mjs +206 -0
- package/from-website--UCl1aQs.mjs +113 -0
- package/from-website-BesXdvcV.mjs +118 -0
- package/hi.js +72 -119
- package/hi.min.js +71 -1
- package/package.json +1 -1
- package/rolldown-runtime-C-QNzSnW.mjs +11 -0
- package/rolldown-runtime-C017PlDO.mjs +9 -0
- package/roomle-embedding-lib.js +394 -576
- package/roomle-embedding-lib.min.js +365 -1
- package/utils-BnWKaFPc.mjs +126 -0
- package/utils-DfC2ZLUc.mjs +118 -0
- package/browser-BhHw2H1M.mjs +0 -1
- package/browser-CUgD7zyH.mjs +0 -21
- package/comlink-BAiXCcU9.mjs +0 -258
- package/comlink-CmT64Qi3.mjs +0 -1
- package/drag-ghost-B7UAYefM.mjs +0 -1
- package/drag-ghost-DHrf_Evu.mjs +0 -81
- package/embedding-plugins-DLVs7ER4.mjs +0 -1
- package/embedding-plugins-DqMSzAJe.mjs +0 -140
- package/from-custom-view-CaDOooe4.mjs +0 -1
- package/from-custom-view-T67aFIDR.mjs +0 -249
- package/from-website-Bvd5Pi0i.mjs +0 -134
- package/from-website-nKwD78_u.mjs +0 -1
- package/utils-BqTPLNLs.mjs +0 -1
- package/utils-Dav4kGNW.mjs +0 -150
package/hi.js
CHANGED
|
@@ -1,120 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
)).json();
|
|
74
|
-
}, E = async (e, o, n = {}) => {
|
|
75
|
-
const { baseUrl: r, om: t } = e.serverOptions ?? {}, s = encodeURIComponent(t?.endpointUrl || ""), a = encodeURIComponent(t?.subscriptionId || ""), p = t?.key || "";
|
|
76
|
-
return await (await fetch(
|
|
77
|
-
(r ?? f) + `${encodeURIComponent(o)}&subscriptionId=${a}&apiKey=${p}&baseUrl=${s}`,
|
|
78
|
-
{
|
|
79
|
-
method: "GET",
|
|
80
|
-
headers: {
|
|
81
|
-
"Content-Type": "application/json",
|
|
82
|
-
...n
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
)).json();
|
|
86
|
-
}, b = (e, o) => {
|
|
87
|
-
e.serverOptions || (e.serverOptions = {}), !e.serverOptions.language && o?.locale && (e.serverOptions.language = o.locale), e.serverOptions.language || (e.serverOptions.language = I(null, !0));
|
|
88
|
-
};
|
|
89
|
-
let i = null;
|
|
90
|
-
const O = async (e, o = {}) => {
|
|
91
|
-
i && window.removeEventListener("message", i);
|
|
92
|
-
const n = typeof e == "string" ? { libraryId: e } : e;
|
|
93
|
-
o.onLoadJavascript === void 0 && (o.onLoadJavascript = (t) => C(n)), o.onLoadArticleCatalog === void 0 && (o.onLoadArticleCatalog = (t) => w(n)), o.onLoadMasterData === void 0 && (o.onLoadMasterData = (t) => h(n));
|
|
94
|
-
const { expose: r } = await import("./comlink-BAiXCcU9.mjs");
|
|
95
|
-
i = (t) => {
|
|
96
|
-
if (t.data.type === "connect_hi" && t.data.port) {
|
|
97
|
-
const s = t.data.port;
|
|
98
|
-
b(n, t.data.globalInitData || {}), s.start?.(), r(U(o), s);
|
|
99
|
-
}
|
|
100
|
-
}, window.addEventListener("message", i);
|
|
101
|
-
}, S = () => {
|
|
102
|
-
i && (window.removeEventListener("message", i), i = null);
|
|
103
|
-
}, H = {
|
|
104
|
-
HIDE: "hide",
|
|
105
|
-
SHOW_ATTRIBUTES: "attributes",
|
|
106
|
-
SHOW_ARTICLES: "articles"
|
|
107
|
-
};
|
|
108
|
-
export {
|
|
109
|
-
H as HI_PANEL_ACTION,
|
|
110
|
-
S as cleanupHi,
|
|
111
|
-
_ as createHiLibraryCallbacks,
|
|
112
|
-
w as libLoadArticleCatalog,
|
|
113
|
-
C as libLoadCalcScript,
|
|
114
|
-
h as libLoadMasterData,
|
|
115
|
-
E as omGetRequest,
|
|
116
|
-
A as omPostRequest,
|
|
117
|
-
j as registerLegacyUrlFormat,
|
|
118
|
-
O as setupHi,
|
|
119
|
-
R as unregisterLegacyUrlFormat
|
|
1
|
+
import { t as e } from "./browser-C_Dfiou7.mjs";
|
|
2
|
+
import { t } from "./utils-BnWKaFPc.mjs";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region packages/embedding-lib/src/homag-intelligence/hi-requests.ts
|
|
5
|
+
var n = async (e, t, n, r = { property: "default" }) => {
|
|
6
|
+
let i = n.serverOptions ?? {}, a = { headers: {
|
|
7
|
+
"Content-Type": t === "json" ? "application/json" : "text/plain",
|
|
8
|
+
"Access-Control-Allow-Origin": "*"
|
|
9
|
+
} };
|
|
10
|
+
i.language && (a.headers["Accept-Language"] = i.language), i.authData && (a.headers.Authorization = i.authData);
|
|
11
|
+
try {
|
|
12
|
+
let t = performance.now(), { baseUrl: n, subscriptionId: o, key: s, endpointUrl: c } = i, l = await fetch((n ?? "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=") + encodeURIComponent(e) + (o ? `&subscriptionId=${encodeURIComponent(o || "")}` : "") + (s ? `&apiKey=${encodeURIComponent(s)}` : "") + (c ? `&baseUrl=${encodeURIComponent(c)}` : ""), a), u = performance.now() - t;
|
|
13
|
+
if (!l.ok) throw console.warn(`Failed to fetch data from ${r.property}`), Error(`Failed to fetch data from ${e}: ${l.statusText}`);
|
|
14
|
+
return console.info(`Success to fetch data from ${r.property}`), console.info(`The data for ${r.property} was fetched in ${u} milliseconds`), l;
|
|
15
|
+
} catch (e) {
|
|
16
|
+
throw console.warn(`Failed to fetch data from ${r.property}`), console.error(e), e;
|
|
17
|
+
}
|
|
18
|
+
}, r = { "e2fe8b3d-da31-4a20-92ab-ab6e3839300e": new Set(["Furniture_Smith"]) }, i = (e, t) => {
|
|
19
|
+
r[e] || (r[e] = /* @__PURE__ */ new Set()), r[e].add(t);
|
|
20
|
+
}, a = (e, t) => {
|
|
21
|
+
r[e]?.delete(t), r[e]?.size === 0 && delete r[e];
|
|
22
|
+
}, o = (e, t) => {
|
|
23
|
+
let { libraryId: n, serverOptions: i } = e;
|
|
24
|
+
return i?.subscriptionId && r[i.subscriptionId]?.has(n) ? `api/pos/${t}?libraryId=${n}` : `api/pos/libraries/${n}/${t}`;
|
|
25
|
+
}, s = async (e) => await (await n(o(e, "articles"), "json", e, { property: "articles" })).json(), c = async (e) => await (await n(o(e, "masterData"), "json", e, { property: "masterData" })).json(), l = async (e) => {
|
|
26
|
+
let t = await (await n(o(e, "calc.js"), "text", e, { property: "calc.js" })).text();
|
|
27
|
+
if (!t) throw Error("Script load error");
|
|
28
|
+
return t;
|
|
29
|
+
}, u = (e) => ({
|
|
30
|
+
onLoadJavascript: (t) => l(e),
|
|
31
|
+
onLoadArticleCatalog: (t) => s(e),
|
|
32
|
+
onLoadMasterData: (t) => c(e)
|
|
33
|
+
}), d = async (e, t, n, r = {}) => {
|
|
34
|
+
let { baseUrl: i, om: a } = e.serverOptions ?? {}, o = encodeURIComponent(a?.endpointUrl || ""), s = encodeURIComponent(a?.subscriptionId || ""), c = a?.key || "";
|
|
35
|
+
return await (await fetch((i ?? "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=") + `${encodeURIComponent(n)}&subscriptionId=${s}&apiKey=${c}&baseUrl=${o}`, {
|
|
36
|
+
method: "POST",
|
|
37
|
+
body: JSON.stringify(t),
|
|
38
|
+
headers: {
|
|
39
|
+
"Content-Type": "application/json",
|
|
40
|
+
...r
|
|
41
|
+
}
|
|
42
|
+
})).json();
|
|
43
|
+
}, f = async (e, t, n = {}) => {
|
|
44
|
+
let { baseUrl: r, om: i } = e.serverOptions ?? {}, a = encodeURIComponent(i?.endpointUrl || ""), o = encodeURIComponent(i?.subscriptionId || ""), s = i?.key || "";
|
|
45
|
+
return await (await fetch((r ?? "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=") + `${encodeURIComponent(t)}&subscriptionId=${o}&apiKey=${s}&baseUrl=${a}`, {
|
|
46
|
+
method: "GET",
|
|
47
|
+
headers: {
|
|
48
|
+
"Content-Type": "application/json",
|
|
49
|
+
...n
|
|
50
|
+
}
|
|
51
|
+
})).json();
|
|
52
|
+
}, p = (t, n) => {
|
|
53
|
+
t.serverOptions ||= {}, !t.serverOptions.language && n?.locale && (t.serverOptions.language = n.locale), t.serverOptions.language || (t.serverOptions.language = e(null, !0));
|
|
54
|
+
}, m = null, h = async (e, n = {}) => {
|
|
55
|
+
m && window.removeEventListener("message", m);
|
|
56
|
+
let r = typeof e == "string" ? { libraryId: e } : e;
|
|
57
|
+
n.onLoadJavascript === void 0 && (n.onLoadJavascript = (e) => l(r)), n.onLoadArticleCatalog === void 0 && (n.onLoadArticleCatalog = (e) => s(r)), n.onLoadMasterData === void 0 && (n.onLoadMasterData = (e) => c(r));
|
|
58
|
+
let { expose: i } = await import("./comlink-BipJ8Ikr.mjs").then((e) => e.t);
|
|
59
|
+
m = (e) => {
|
|
60
|
+
if (e.data.type === "connect_hi" && e.data.port) {
|
|
61
|
+
let a = e.data.port;
|
|
62
|
+
p(r, e.data.globalInitData || {}), a.start?.(), i(t(n), a);
|
|
63
|
+
}
|
|
64
|
+
}, window.addEventListener("message", m);
|
|
65
|
+
}, g = () => {
|
|
66
|
+
m &&= (window.removeEventListener("message", m), null);
|
|
67
|
+
}, _ = {
|
|
68
|
+
HIDE: "hide",
|
|
69
|
+
SHOW_ATTRIBUTES: "attributes",
|
|
70
|
+
SHOW_ARTICLES: "articles"
|
|
120
71
|
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { _ as HI_PANEL_ACTION, g as cleanupHi, u as createHiLibraryCallbacks, s as libLoadArticleCatalog, l as libLoadCalcScript, c as libLoadMasterData, f as omGetRequest, d as omPostRequest, i as registerLegacyUrlFormat, h as setupHi, a as unregisterLegacyUrlFormat };
|
package/hi.min.js
CHANGED
|
@@ -1 +1,71 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { t as e } from "./browser-DRgK3Fk8.mjs";
|
|
2
|
+
import { t } from "./utils-DfC2ZLUc.mjs";
|
|
3
|
+
var n = async (e, t, n, r = { property: "default" }) => {
|
|
4
|
+
let i = n.serverOptions ?? {}, a = { headers: {
|
|
5
|
+
"Content-Type": t === "json" ? "application/json" : "text/plain",
|
|
6
|
+
"Access-Control-Allow-Origin": "*"
|
|
7
|
+
} };
|
|
8
|
+
i.language && (a.headers["Accept-Language"] = i.language), i.authData && (a.headers.Authorization = i.authData);
|
|
9
|
+
try {
|
|
10
|
+
performance.now();
|
|
11
|
+
let { baseUrl: t, subscriptionId: n, key: r, endpointUrl: o } = i, s = await fetch((t ?? "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=") + encodeURIComponent(e) + (n ? `&subscriptionId=${encodeURIComponent(n || "")}` : "") + (r ? `&apiKey=${encodeURIComponent(r)}` : "") + (o ? `&baseUrl=${encodeURIComponent(o)}` : ""), a);
|
|
12
|
+
if (performance.now(), !s.ok) throw Error(`Failed to fetch data from ${e}: ${s.statusText}`);
|
|
13
|
+
return s;
|
|
14
|
+
} catch (e) {
|
|
15
|
+
throw e;
|
|
16
|
+
}
|
|
17
|
+
}, r = { "e2fe8b3d-da31-4a20-92ab-ab6e3839300e": new Set(["Furniture_Smith"]) }, i = (e, t) => {
|
|
18
|
+
r[e] || (r[e] = /* @__PURE__ */ new Set()), r[e].add(t);
|
|
19
|
+
}, a = (e, t) => {
|
|
20
|
+
r[e]?.delete(t), r[e]?.size === 0 && delete r[e];
|
|
21
|
+
}, o = (e, t) => {
|
|
22
|
+
let { libraryId: n, serverOptions: i } = e;
|
|
23
|
+
return i?.subscriptionId && r[i.subscriptionId]?.has(n) ? `api/pos/${t}?libraryId=${n}` : `api/pos/libraries/${n}/${t}`;
|
|
24
|
+
}, s = async (e) => await (await n(o(e, "articles"), "json", e, { property: "articles" })).json(), c = async (e) => await (await n(o(e, "masterData"), "json", e, { property: "masterData" })).json(), l = async (e) => {
|
|
25
|
+
let t = await (await n(o(e, "calc.js"), "text", e, { property: "calc.js" })).text();
|
|
26
|
+
if (!t) throw Error("Script load error");
|
|
27
|
+
return t;
|
|
28
|
+
}, u = (e) => ({
|
|
29
|
+
onLoadJavascript: (t) => l(e),
|
|
30
|
+
onLoadArticleCatalog: (t) => s(e),
|
|
31
|
+
onLoadMasterData: (t) => c(e)
|
|
32
|
+
}), d = async (e, t, n, r = {}) => {
|
|
33
|
+
let { baseUrl: i, om: a } = e.serverOptions ?? {}, o = encodeURIComponent(a?.endpointUrl || ""), s = encodeURIComponent(a?.subscriptionId || ""), c = a?.key || "";
|
|
34
|
+
return await (await fetch((i ?? "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=") + `${encodeURIComponent(n)}&subscriptionId=${s}&apiKey=${c}&baseUrl=${o}`, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
body: JSON.stringify(t),
|
|
37
|
+
headers: {
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
...r
|
|
40
|
+
}
|
|
41
|
+
})).json();
|
|
42
|
+
}, f = async (e, t, n = {}) => {
|
|
43
|
+
let { baseUrl: r, om: i } = e.serverOptions ?? {}, a = encodeURIComponent(i?.endpointUrl || ""), o = encodeURIComponent(i?.subscriptionId || ""), s = i?.key || "";
|
|
44
|
+
return await (await fetch((r ?? "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=") + `${encodeURIComponent(t)}&subscriptionId=${o}&apiKey=${s}&baseUrl=${a}`, {
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers: {
|
|
47
|
+
"Content-Type": "application/json",
|
|
48
|
+
...n
|
|
49
|
+
}
|
|
50
|
+
})).json();
|
|
51
|
+
}, p = null, m = async (n, r = {}) => {
|
|
52
|
+
p && window.removeEventListener("message", p);
|
|
53
|
+
let i = typeof n == "string" ? { libraryId: n } : n;
|
|
54
|
+
r.onLoadJavascript === void 0 && (r.onLoadJavascript = (e) => l(i)), r.onLoadArticleCatalog === void 0 && (r.onLoadArticleCatalog = (e) => s(i)), r.onLoadMasterData === void 0 && (r.onLoadMasterData = (e) => c(i));
|
|
55
|
+
let { expose: a } = await import("./comlink-Dds_bpug.mjs").then((e) => e.t);
|
|
56
|
+
p = (n) => {
|
|
57
|
+
if (n.data.type === "connect_hi" && n.data.port) {
|
|
58
|
+
let o = n.data.port;
|
|
59
|
+
((t, n) => {
|
|
60
|
+
t.serverOptions ||= {}, !t.serverOptions.language && n?.locale && (t.serverOptions.language = n.locale), t.serverOptions.language || (t.serverOptions.language = e(null, !0));
|
|
61
|
+
})(i, n.data.globalInitData || {}), o.start?.(), a(t(r), o);
|
|
62
|
+
}
|
|
63
|
+
}, window.addEventListener("message", p);
|
|
64
|
+
}, h = () => {
|
|
65
|
+
p &&= (window.removeEventListener("message", p), null);
|
|
66
|
+
}, g = {
|
|
67
|
+
HIDE: "hide",
|
|
68
|
+
SHOW_ATTRIBUTES: "attributes",
|
|
69
|
+
SHOW_ARTICLES: "articles"
|
|
70
|
+
};
|
|
71
|
+
export { g as HI_PANEL_ACTION, h as cleanupHi, u as createHiLibraryCallbacks, s as libLoadArticleCatalog, l as libLoadCalcScript, c as libLoadMasterData, f as omGetRequest, d as omPostRequest, i as registerLegacyUrlFormat, m as setupHi, a as unregisterLegacyUrlFormat };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0-alpha.2",
|
|
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",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = (t, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t };
|