@roomle/embedding-lib 6.4.0-alpha.14 → 6.4.0-alpha.16

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.
@@ -1,56 +1,19 @@
1
- ## 6.4.0-alpha.14 (2026-03-05)
1
+ ## 6.4.0-alpha.16 (2026-03-10)
2
2
 
3
- * Initial plan ([539fb9f](https://github.com/roomle-dev/roomle-ui/commit/539fb9f))
4
- * Initial plan ([517a747](https://github.com/roomle-dev/roomle-ui/commit/517a747))
5
- * Merge branch 'master' into chore/strict-null-checks-web-sdk-plan ([56472d1](https://github.com/roomle-dev/roomle-ui/commit/56472d1))
6
- * Merge branch 'master' into copilot/upgrade-web-sdk-to-strict-null-checks ([fe5326a](https://github.com/roomle-dev/roomle-ui/commit/fe5326a))
7
- * Merge branch 'master' into copilot/upgrade-web-sdk-to-strict-null-checks ([5000662](https://github.com/roomle-dev/roomle-ui/commit/5000662))
8
- * Merge branch 'master' into feat/camera-rotation ([c6910b8](https://github.com/roomle-dev/roomle-ui/commit/c6910b8))
9
- * Merge branch 'master' into feat/core-api-try-merge ([3a11487](https://github.com/roomle-dev/roomle-ui/commit/3a11487))
10
- * Merge branch 'master' into fix/disabled-parameters-position ([4dd9ed5](https://github.com/roomle-dev/roomle-ui/commit/4dd9ed5))
11
- * Merge branch 'master' into fix/disabled-parameters-position ([3728868](https://github.com/roomle-dev/roomle-ui/commit/3728868))
12
- * Merge branch 'master' into fix/disabled-parameters-position ([60aff45](https://github.com/roomle-dev/roomle-ui/commit/60aff45))
13
- * Merge branch 'master' into fix/rml-16215-hi-examples-double-sdk-instantiation ([6f133ac](https://github.com/roomle-dev/roomle-ui/commit/6f133ac))
14
- * Merge pull request #2283 from roomle-dev/fix/disabled-parameters-position ([82d5dbe](https://github.com/roomle-dev/roomle-ui/commit/82d5dbe)), closes [#2283](https://github.com/roomle-dev/roomle-ui/issues/2283)
15
- * Merge pull request #2347 from roomle-dev/chore/strict-null-checks-web-sdk-plan ([6ef74ad](https://github.com/roomle-dev/roomle-ui/commit/6ef74ad)), closes [#2347](https://github.com/roomle-dev/roomle-ui/issues/2347)
16
- * Merge pull request #2348 from roomle-dev/copilot/upgrade-web-sdk-to-strict-null-checks ([4f2817b](https://github.com/roomle-dev/roomle-ui/commit/4f2817b)), closes [#2348](https://github.com/roomle-dev/roomle-ui/issues/2348)
17
- * Merge pull request #2349 from roomle-dev/upgraded-by-ci/core-2.71.0-alpha.12 ([9ddb0c6](https://github.com/roomle-dev/roomle-ui/commit/9ddb0c6)), closes [#2349](https://github.com/roomle-dev/roomle-ui/issues/2349)
18
- * Merge pull request #2351 from roomle-dev/upgraded-by-ci/core-2.71.0-alpha.13 ([7036aed](https://github.com/roomle-dev/roomle-ui/commit/7036aed)), closes [#2351](https://github.com/roomle-dev/roomle-ui/issues/2351)
19
- * Merge pull request #2352 from roomle-dev/copilot/upgrade-web-sdk-strict-null-checks ([74e7ebc](https://github.com/roomle-dev/roomle-ui/commit/74e7ebc)), closes [#2352](https://github.com/roomle-dev/roomle-ui/issues/2352)
20
- * Merge pull request #2354 from roomle-dev/fix/rml-16215-hi-examples-double-sdk-instantiation ([ab028b1](https://github.com/roomle-dev/roomle-ui/commit/ab028b1)), closes [#2354](https://github.com/roomle-dev/roomle-ui/issues/2354)
21
- * Merge pull request #2355 from roomle-dev/feat/camera-rotation ([5876cc6](https://github.com/roomle-dev/roomle-ui/commit/5876cc6)), closes [#2355](https://github.com/roomle-dev/roomle-ui/issues/2355)
22
- * Merge pull request #2356 from roomle-dev/upgraded-by-ci/core-2.71.0-alpha.14 ([ad06ab4](https://github.com/roomle-dev/roomle-ui/commit/ad06ab4)), closes [#2356](https://github.com/roomle-dev/roomle-ui/issues/2356)
23
- * Merge pull request #2357 from roomle-dev/feat/core-api-try-merge ([cb5b2d1](https://github.com/roomle-dev/roomle-ui/commit/cb5b2d1)), closes [#2357](https://github.com/roomle-dev/roomle-ui/issues/2357)
24
- * Merge pull request #2359 from roomle-dev/upgraded-by-ci/core-2.71.0-alpha.15 ([950e999](https://github.com/roomle-dev/roomle-ui/commit/950e999)), closes [#2359](https://github.com/roomle-dev/roomle-ui/issues/2359)
25
- * Merge pull request #2360 from roomle-dev/docs/require-comment-before-resolving-review-threads ([d89a175](https://github.com/roomle-dev/roomle-ui/commit/d89a175)), closes [#2360](https://github.com/roomle-dev/roomle-ui/issues/2360)
26
- * docs: add lessons learned from PR #2352 review to strictNullChecks plan ([16274ed](https://github.com/roomle-dev/roomle-ui/commit/16274ed)), closes [#2352](https://github.com/roomle-dev/roomle-ui/issues/2352)
27
- * docs: document web-sdk strictNullChecks scope in typescript and web-sdk guidelines ([d932b5a](https://github.com/roomle-dev/roomle-ui/commit/d932b5a))
28
- * docs: require reply comment before resolving review threads ([c20cbed](https://github.com/roomle-dev/roomle-ui/commit/c20cbed))
29
- * feat: core api - respondWithPositionInPlan ([2c277bd](https://github.com/roomle-dev/roomle-ui/commit/2c277bd))
30
- * feat: core api - tryToMergeNewGroups ([0c2e7a4](https://github.com/roomle-dev/roomle-ui/commit/0c2e7a4))
31
- * feat: featureFlags.mergeOnInsert ([837596d](https://github.com/roomle-dev/roomle-ui/commit/837596d))
32
- * feat(core): upgrade to version 2.71.0-alpha.12 ([4a09bf6](https://github.com/roomle-dev/roomle-ui/commit/4a09bf6))
33
- * feat(core): upgrade to version 2.71.0-alpha.13 ([f5d738e](https://github.com/roomle-dev/roomle-ui/commit/f5d738e))
34
- * feat(core): upgrade to version 2.71.0-alpha.14 ([8fdc7a6](https://github.com/roomle-dev/roomle-ui/commit/8fdc7a6))
35
- * feat(core): upgrade to version 2.71.0-alpha.15 ([3af1f3e](https://github.com/roomle-dev/roomle-ui/commit/3af1f3e))
36
- * fix: address Copilot review comments on PR #2347 ([4752006](https://github.com/roomle-dev/roomle-ui/commit/4752006)), closes [#2347](https://github.com/roomle-dev/roomle-ui/issues/2347)
37
- * fix: address Copilot review comments on PR #2352 ([e42e253](https://github.com/roomle-dev/roomle-ui/commit/e42e253)), closes [#2352](https://github.com/roomle-dev/roomle-ui/issues/2352)
38
- * fix: construction object isolation mode rotation ([21b54ec](https://github.com/roomle-dev/roomle-ui/commit/21b54ec))
39
- * fix: feedback adaptations ([4bedbc5](https://github.com/roomle-dev/roomle-ui/commit/4bedbc5))
40
- * fix: prevent web-sdk barrel import in embedding-lib dev mode ([a47a95b](https://github.com/roomle-dev/roomle-ui/commit/a47a95b))
41
- * fix: removed condition which is always true ([715aadc](https://github.com/roomle-dev/roomle-ui/commit/715aadc))
42
- * fix: wrong order of disabled params ([176518b](https://github.com/roomle-dev/roomle-ui/commit/176518b))
43
- * chore: add follow-up for null vs undefined convention ([37b309c](https://github.com/roomle-dev/roomle-ui/commit/37b309c))
44
- * chore: add strictNullChecks migration plan for web-sdk ([c133962](https://github.com/roomle-dev/roomle-ui/commit/c133962))
45
- * chore: add test ([b05699b](https://github.com/roomle-dev/roomle-ui/commit/b05699b))
46
- * chore: copilot code review suggestions ([05df54e](https://github.com/roomle-dev/roomle-ui/commit/05df54e))
47
- * chore: expand test suite ([b578951](https://github.com/roomle-dev/roomle-ui/commit/b578951))
48
- * chore: fix missing disabled parameters ([60b7784](https://github.com/roomle-dev/roomle-ui/commit/60b7784))
49
- * chore: fix oxlint issues ([faa5d12](https://github.com/roomle-dev/roomle-ui/commit/faa5d12))
50
- * chore: fix strictNullChecks errors in material-viewer and glb-viewer-core (phase 1) ([cb146b1](https://github.com/roomle-dev/roomle-ui/commit/cb146b1))
51
- * chore(web-sdk): fix strictNullChecks errors in tools-core, test-helpers, and typings (phase 0) ([07b832b](https://github.com/roomle-dev/roomle-ui/commit/07b832b))
52
- * chore: revert unrelated package-lock.json changes ([e2ee10a](https://github.com/roomle-dev/roomle-ui/commit/e2ee10a))
53
- * chore: set up LWH translations for HI ([a20e2bc](https://github.com/roomle-dev/roomle-ui/commit/a20e2bc))
54
- * chore: start phase 1 strict null checks for leaf packages ([0e1c351](https://github.com/roomle-dev/roomle-ui/commit/0e1c351))
55
- * chore: undo mistake ([16e56ec](https://github.com/roomle-dev/roomle-ui/commit/16e56ec))
56
- * style(web-sdk): format roomle-tools-core.ts with prettier ([1253d48](https://github.com/roomle-dev/roomle-ui/commit/1253d48))
3
+ * Merge pull request #2376 from roomle-dev/upgraded-by-ci/core-2.71.0-alpha.22 ([70a083b](https://github.com/roomle-dev/roomle-ui/commit/70a083b)), closes [#2376](https://github.com/roomle-dev/roomle-ui/issues/2376)
4
+ * Merge pull request #2377 from roomle-dev/feat/merge-groups ([3c9ec42](https://github.com/roomle-dev/roomle-ui/commit/3c9ec42)), closes [#2377](https://github.com/roomle-dev/roomle-ui/issues/2377)
5
+ * Merge pull request #2379 from roomle-dev/upgraded-by-ci/core-2.71.0 ([c55db99](https://github.com/roomle-dev/roomle-ui/commit/c55db99)), closes [#2379](https://github.com/roomle-dev/roomle-ui/issues/2379)
6
+ * Merge pull request #2380 from roomle-dev/upgraded-by-ci/core-2.72.0-alpha.1 ([9deaf31](https://github.com/roomle-dev/roomle-ui/commit/9deaf31)), closes [#2380](https://github.com/roomle-dev/roomle-ui/issues/2380)
7
+ * Merge pull request #2381 from roomle-dev/fix/adaptEnvMapIntensity ([385f017](https://github.com/roomle-dev/roomle-ui/commit/385f017)), closes [#2381](https://github.com/roomle-dev/roomle-ui/issues/2381)
8
+ * Merge pull request #2382 from roomle-dev/upgraded-by-ci/core-2.72.0-alpha.2 ([b38c33c](https://github.com/roomle-dev/roomle-ui/commit/b38c33c)), closes [#2382](https://github.com/roomle-dev/roomle-ui/issues/2382)
9
+ * feat: core api - external object library id ([3a0d4b8](https://github.com/roomle-dev/roomle-ui/commit/3a0d4b8))
10
+ * feat: logic for showing merge button ([d2c356f](https://github.com/roomle-dev/roomle-ui/commit/d2c356f))
11
+ * feat: merge objects button ([642c24c](https://github.com/roomle-dev/roomle-ui/commit/642c24c))
12
+ * feat: merge objects button visibility ([ea3db86](https://github.com/roomle-dev/roomle-ui/commit/ea3db86))
13
+ * feat(core): upgrade to version 2.71.0-alpha.22 ([2f29cb7](https://github.com/roomle-dev/roomle-ui/commit/2f29cb7))
14
+ * feat(core): upgrade to version 2.71.0 ([34c3b25](https://github.com/roomle-dev/roomle-ui/commit/34c3b25))
15
+ * feat(core): upgrade to version 2.72.0-alpha.1 ([c2af036](https://github.com/roomle-dev/roomle-ui/commit/c2af036))
16
+ * feat(core): upgrade to version 2.72.0-alpha.2 ([3981f25](https://github.com/roomle-dev/roomle-ui/commit/3981f25))
17
+ * fix: increase environment map intensity to 1.2 ([9c7fd97](https://github.com/roomle-dev/roomle-ui/commit/9c7fd97))
18
+ * test: add missing test case for different libraryIds in isMergeElementsPossible ([2ade786](https://github.com/roomle-dev/roomle-ui/commit/2ade786))
19
+ * chore: tidy up core api ([40c6bbc](https://github.com/roomle-dev/roomle-ui/commit/40c6bbc))
package/hi.js CHANGED
@@ -1,46 +1,50 @@
1
- import { c as I } from "./utils-Dav4kGNW.mjs";
2
- import { g as b } from "./browser-CUgD7zyH.mjs";
3
- const m = "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=", f = async (e, o, n, s = { property: "default" }) => {
4
- const t = n.serverOptions ?? {}, r = {
1
+ import { c as U } from "./utils-Dav4kGNW.mjs";
2
+ import { g as I } from "./browser-CUgD7zyH.mjs";
3
+ const f = "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=", y = async (e, o, n, r = { property: "default" }) => {
4
+ const t = n.serverOptions ?? {}, s = {
5
5
  headers: {
6
6
  "Content-Type": o === "json" ? "application/json" : "text/plain",
7
7
  "Access-Control-Allow-Origin": "*"
8
8
  }
9
9
  };
10
- t.language && (r.headers["Accept-Language"] = t.language), t.authData && (r.headers.Authorization = t.authData);
10
+ t.language && (s.headers["Accept-Language"] = t.language), t.authData && (s.headers.Authorization = t.authData);
11
11
  try {
12
- const a = performance.now(), { baseUrl: c, subscriptionId: p, key: d, endpointUrl: l } = t, u = await fetch(
13
- (c ?? m) + encodeURIComponent(e) + (p ? `&subscriptionId=${encodeURIComponent(p || "")}` : "") + (d ? `&apiKey=${encodeURIComponent(d)}` : "") + (l ? `&baseUrl=${encodeURIComponent(l)}` : ""),
14
- r
15
- ), h = performance.now() - a;
16
- if (!u.ok)
17
- throw console.warn(`Failed to fetch data from ${s.property}`), new Error(
18
- `Failed to fetch data from ${e}: ${u.statusText}`
12
+ const a = performance.now(), { baseUrl: p, subscriptionId: d, key: l, endpointUrl: u } = t, m = await fetch(
13
+ (p ?? f) + encodeURIComponent(e) + (d ? `&subscriptionId=${encodeURIComponent(d || "")}` : "") + (l ? `&apiKey=${encodeURIComponent(l)}` : "") + (u ? `&baseUrl=${encodeURIComponent(u)}` : ""),
14
+ s
15
+ ), L = performance.now() - a;
16
+ if (!m.ok)
17
+ throw console.warn(`Failed to fetch data from ${r.property}`), new Error(
18
+ `Failed to fetch data from ${e}: ${m.statusText}`
19
19
  );
20
- return console.info(`Success to fetch data from ${s.property}`), console.info(
21
- `The data for ${s.property} was fetched in ${h} milliseconds`
22
- ), u;
20
+ return console.info(`Success to fetch data from ${r.property}`), console.info(
21
+ `The data for ${r.property} was fetched in ${L} milliseconds`
22
+ ), m;
23
23
  } catch (a) {
24
- throw console.warn(`Failed to fetch data from ${s.property}`), console.error(a), a;
24
+ throw console.warn(`Failed to fetch data from ${r.property}`), console.error(a), a;
25
25
  }
26
- }, L = {
26
+ }, c = {
27
27
  "e2fe8b3d-da31-4a20-92ab-ab6e3839300e": /* @__PURE__ */ new Set(["Furniture_Smith"])
28
- }, y = (e, o) => {
29
- const { libraryId: n, serverOptions: s } = e;
30
- return s?.subscriptionId && L[s.subscriptionId]?.has(n) ? `api/pos/${o}?libraryId=${n}` : `api/pos/libraries/${n}/${o}`;
31
- }, w = async (e) => await (await f(
32
- y(e, "articles"),
28
+ }, j = (e, o) => {
29
+ c[e] || (c[e] = /* @__PURE__ */ new Set()), c[e].add(o);
30
+ }, R = (e, o) => {
31
+ c[e]?.delete(o), c[e]?.size === 0 && delete c[e];
32
+ }, g = (e, o) => {
33
+ const { libraryId: n, serverOptions: r } = e;
34
+ return r?.subscriptionId && c[r.subscriptionId]?.has(n) ? `api/pos/${o}?libraryId=${n}` : `api/pos/libraries/${n}/${o}`;
35
+ }, w = async (e) => await (await y(
36
+ g(e, "articles"),
33
37
  "json",
34
38
  e,
35
39
  { property: "articles" }
36
- )).json(), g = async (e) => await (await f(
37
- y(e, "masterData"),
40
+ )).json(), h = async (e) => await (await y(
41
+ g(e, "masterData"),
38
42
  "json",
39
43
  e,
40
44
  { property: "masterData" }
41
45
  )).json(), C = async (e) => {
42
- let n = await (await f(
43
- y(e, "calc.js"),
46
+ const n = await (await y(
47
+ g(e, "calc.js"),
44
48
  "text",
45
49
  e,
46
50
  {
@@ -50,27 +54,27 @@ const m = "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?u
50
54
  if (!n)
51
55
  throw new Error("Script load error");
52
56
  return n;
53
- }, j = (e) => ({
57
+ }, _ = (e) => ({
54
58
  onLoadJavascript: (o) => C(e),
55
59
  onLoadArticleCatalog: (o) => w(e),
56
- onLoadMasterData: (o) => g(e)
57
- }), A = async (e, o, n, s = {}) => {
58
- const { baseUrl: t, om: r } = e.serverOptions ?? {}, a = encodeURIComponent(r?.endpointUrl || ""), c = encodeURIComponent(r?.subscriptionId || ""), p = r?.key || "";
60
+ onLoadMasterData: (o) => h(e)
61
+ }), A = async (e, o, n, r = {}) => {
62
+ const { baseUrl: t, om: s } = e.serverOptions ?? {}, a = encodeURIComponent(s?.endpointUrl || ""), p = encodeURIComponent(s?.subscriptionId || ""), d = s?.key || "";
59
63
  return await (await fetch(
60
- (t ?? m) + `${encodeURIComponent(n)}&subscriptionId=${c}&apiKey=${p}&baseUrl=${a}`,
64
+ (t ?? f) + `${encodeURIComponent(n)}&subscriptionId=${p}&apiKey=${d}&baseUrl=${a}`,
61
65
  {
62
66
  method: "POST",
63
67
  body: JSON.stringify(o),
64
68
  headers: {
65
69
  "Content-Type": "application/json",
66
- ...s
70
+ ...r
67
71
  }
68
72
  }
69
73
  )).json();
70
74
  }, E = async (e, o, n = {}) => {
71
- const { baseUrl: s, om: t } = e.serverOptions ?? {}, r = encodeURIComponent(t?.endpointUrl || ""), a = encodeURIComponent(t?.subscriptionId || ""), c = t?.key || "";
75
+ const { baseUrl: r, om: t } = e.serverOptions ?? {}, s = encodeURIComponent(t?.endpointUrl || ""), a = encodeURIComponent(t?.subscriptionId || ""), p = t?.key || "";
72
76
  return await (await fetch(
73
- (s ?? m) + `${encodeURIComponent(o)}&subscriptionId=${a}&apiKey=${c}&baseUrl=${r}`,
77
+ (r ?? f) + `${encodeURIComponent(o)}&subscriptionId=${a}&apiKey=${p}&baseUrl=${s}`,
74
78
  {
75
79
  method: "GET",
76
80
  headers: {
@@ -79,36 +83,38 @@ const m = "https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?u
79
83
  }
80
84
  }
81
85
  )).json();
82
- }, U = (e, o) => {
83
- e.serverOptions || (e.serverOptions = {}), !e.serverOptions.language && o?.locale && (e.serverOptions.language = o.locale), e.serverOptions.language || (e.serverOptions.language = b(null, !0));
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));
84
88
  };
85
89
  let i = null;
86
- const _ = async (e, o = {}) => {
90
+ const O = async (e, o = {}) => {
87
91
  i && window.removeEventListener("message", i);
88
92
  const n = typeof e == "string" ? { libraryId: e } : e;
89
- 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) => g(n));
90
- const { expose: s } = await import("./comlink-BAiXCcU9.mjs");
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");
91
95
  i = (t) => {
92
96
  if (t.data.type === "connect_hi" && t.data.port) {
93
- const r = t.data.port;
94
- U(n, t.data.globalInitData || {}), r.start?.(), s(I(o), r);
97
+ const s = t.data.port;
98
+ b(n, t.data.globalInitData || {}), s.start?.(), r(U(o), s);
95
99
  }
96
100
  }, window.addEventListener("message", i);
97
- }, O = () => {
101
+ }, S = () => {
98
102
  i && (window.removeEventListener("message", i), i = null);
99
- }, R = {
103
+ }, H = {
100
104
  HIDE: "hide",
101
105
  SHOW_ATTRIBUTES: "attributes",
102
106
  SHOW_ARTICLES: "articles"
103
107
  };
104
108
  export {
105
- R as HI_PANEL_ACTION,
106
- O as cleanupHi,
107
- j as createHiLibraryCallbacks,
109
+ H as HI_PANEL_ACTION,
110
+ S as cleanupHi,
111
+ _ as createHiLibraryCallbacks,
108
112
  w as libLoadArticleCatalog,
109
113
  C as libLoadCalcScript,
110
- g as libLoadMasterData,
114
+ h as libLoadMasterData,
111
115
  E as omGetRequest,
112
116
  A as omPostRequest,
113
- _ as setupHi
117
+ j as registerLegacyUrlFormat,
118
+ O as setupHi,
119
+ R as unregisterLegacyUrlFormat
114
120
  };
package/hi.min.js CHANGED
@@ -1 +1 @@
1
- import{c as e}from"./utils-BqTPLNLs.mjs";import{g as a}from"./browser-BhHw2H1M.mjs";const t="https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=",o=async(e,a,o,n={property:"default"})=>{const s=o.serverOptions??{},r={headers:{"Content-Type":"json"===a?"application/json":"text/plain","Access-Control-Allow-Origin":"*"}};s.language&&(r.headers["Accept-Language"]=s.language),s.authData&&(r.headers.Authorization=s.authData);try{performance.now();const{baseUrl:a,subscriptionId:o,key:n,endpointUrl:i}=s,c=await fetch((a??t)+encodeURIComponent(e)+(o?`&subscriptionId=${encodeURIComponent(o||"")}`:"")+(n?`&apiKey=${encodeURIComponent(n)}`:"")+(i?`&baseUrl=${encodeURIComponent(i)}`:""),r);if(performance.now(),!c.ok)throw new Error(`Failed to fetch data from ${e}: ${c.statusText}`);return c}catch(e){throw e}},n={"e2fe8b3d-da31-4a20-92ab-ab6e3839300e":new Set(["Furniture_Smith"])},s=(e,a)=>{const{libraryId:t,serverOptions:o}=e;return o?.subscriptionId&&n[o.subscriptionId]?.has(t)?`api/pos/${a}?libraryId=${t}`:`api/pos/libraries/${t}/${a}`},r=async e=>await(await o(s(e,"articles"),"json",e,{property:"articles"})).json(),i=async e=>await(await o(s(e,"masterData"),"json",e,{property:"masterData"})).json(),c=async e=>{let a=await(await o(s(e,"calc.js"),"text",e,{property:"calc.js"})).text();if(!a)throw new Error("Script load error");return a},p=e=>({onLoadJavascript:a=>c(e),onLoadArticleCatalog:a=>r(e),onLoadMasterData:a=>i(e)}),l=async(e,a,o,n={})=>{const{baseUrl:s,om:r}=e.serverOptions??{},i=encodeURIComponent(r?.endpointUrl||""),c=encodeURIComponent(r?.subscriptionId||""),p=r?.key||"";return await(await fetch((s??t)+`${encodeURIComponent(o)}&subscriptionId=${c}&apiKey=${p}&baseUrl=${i}`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",...n}})).json()},d=async(e,a,o={})=>{const{baseUrl:n,om:s}=e.serverOptions??{},r=encodeURIComponent(s?.endpointUrl||""),i=encodeURIComponent(s?.subscriptionId||""),c=s?.key||"";return await(await fetch((n??t)+`${encodeURIComponent(a)}&subscriptionId=${i}&apiKey=${c}&baseUrl=${r}`,{method:"GET",headers:{"Content-Type":"application/json",...o}})).json()};let u=null;const m=async(t,o={})=>{u&&window.removeEventListener("message",u);const n="string"==typeof t?{libraryId:t}:t;void 0===o.onLoadJavascript&&(o.onLoadJavascript=e=>c(n)),void 0===o.onLoadArticleCatalog&&(o.onLoadArticleCatalog=e=>r(n)),void 0===o.onLoadMasterData&&(o.onLoadMasterData=e=>i(n));const{expose:s}=await import("./comlink-CmT64Qi3.mjs");u=t=>{if("connect_hi"===t.data.type&&t.data.port){const r=t.data.port;((e,t)=>{e.serverOptions||(e.serverOptions={}),!e.serverOptions.language&&t?.locale&&(e.serverOptions.language=t.locale),e.serverOptions.language||(e.serverOptions.language=a(null,!0))})(n,t.data.globalInitData||{}),r.start?.(),s(e(o),r)}},window.addEventListener("message",u)},b=()=>{u&&(window.removeEventListener("message",u),u=null)},w={HIDE:"hide",SHOW_ATTRIBUTES:"attributes",SHOW_ARTICLES:"articles"};export{w as HI_PANEL_ACTION,b as cleanupHi,p as createHiLibraryCallbacks,r as libLoadArticleCatalog,c as libLoadCalcScript,i as libLoadMasterData,d as omGetRequest,l as omPostRequest,m as setupHi};
1
+ import{c as e}from"./utils-BqTPLNLs.mjs";import{g as a}from"./browser-BhHw2H1M.mjs";const t="https://europe-west3-rml-showcases.cloudfunctions.net/proxy_request?url=",o=async(e,a,o,n={property:"default"})=>{const r=o.serverOptions??{},s={headers:{"Content-Type":"json"===a?"application/json":"text/plain","Access-Control-Allow-Origin":"*"}};r.language&&(s.headers["Accept-Language"]=r.language),r.authData&&(s.headers.Authorization=r.authData);try{performance.now();const{baseUrl:a,subscriptionId:o,key:n,endpointUrl:i}=r,c=await fetch((a??t)+encodeURIComponent(e)+(o?`&subscriptionId=${encodeURIComponent(o||"")}`:"")+(n?`&apiKey=${encodeURIComponent(n)}`:"")+(i?`&baseUrl=${encodeURIComponent(i)}`:""),s);if(performance.now(),!c.ok)throw new Error(`Failed to fetch data from ${e}: ${c.statusText}`);return c}catch(e){throw e}},n={"e2fe8b3d-da31-4a20-92ab-ab6e3839300e":new Set(["Furniture_Smith"])},r=(e,a)=>{n[e]||(n[e]=new Set),n[e].add(a)},s=(e,a)=>{n[e]?.delete(a),0===n[e]?.size&&delete n[e]},i=(e,a)=>{const{libraryId:t,serverOptions:o}=e;return o?.subscriptionId&&n[o.subscriptionId]?.has(t)?`api/pos/${a}?libraryId=${t}`:`api/pos/libraries/${t}/${a}`},c=async e=>await(await o(i(e,"articles"),"json",e,{property:"articles"})).json(),p=async e=>await(await o(i(e,"masterData"),"json",e,{property:"masterData"})).json(),l=async e=>{const a=await(await o(i(e,"calc.js"),"text",e,{property:"calc.js"})).text();if(!a)throw new Error("Script load error");return a},d=e=>({onLoadJavascript:a=>l(e),onLoadArticleCatalog:a=>c(e),onLoadMasterData:a=>p(e)}),u=async(e,a,o,n={})=>{const{baseUrl:r,om:s}=e.serverOptions??{},i=encodeURIComponent(s?.endpointUrl||""),c=encodeURIComponent(s?.subscriptionId||""),p=s?.key||"";return await(await fetch((r??t)+`${encodeURIComponent(o)}&subscriptionId=${c}&apiKey=${p}&baseUrl=${i}`,{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",...n}})).json()},m=async(e,a,o={})=>{const{baseUrl:n,om:r}=e.serverOptions??{},s=encodeURIComponent(r?.endpointUrl||""),i=encodeURIComponent(r?.subscriptionId||""),c=r?.key||"";return await(await fetch((n??t)+`${encodeURIComponent(a)}&subscriptionId=${i}&apiKey=${c}&baseUrl=${s}`,{method:"GET",headers:{"Content-Type":"application/json",...o}})).json()};let y=null;const w=async(t,o={})=>{y&&window.removeEventListener("message",y);const n="string"==typeof t?{libraryId:t}:t;void 0===o.onLoadJavascript&&(o.onLoadJavascript=e=>l(n)),void 0===o.onLoadArticleCatalog&&(o.onLoadArticleCatalog=e=>c(n)),void 0===o.onLoadMasterData&&(o.onLoadMasterData=e=>p(n));const{expose:r}=await import("./comlink-CmT64Qi3.mjs");y=t=>{if("connect_hi"===t.data.type&&t.data.port){const s=t.data.port;((e,t)=>{e.serverOptions||(e.serverOptions={}),!e.serverOptions.language&&t?.locale&&(e.serverOptions.language=t.locale),e.serverOptions.language||(e.serverOptions.language=a(null,!0))})(n,t.data.globalInitData||{}),s.start?.(),r(e(o),s)}},window.addEventListener("message",y)},b=()=>{y&&(window.removeEventListener("message",y),y=null)},g={HIDE:"hide",SHOW_ATTRIBUTES:"attributes",SHOW_ARTICLES:"articles"};export{g as HI_PANEL_ACTION,b as cleanupHi,d as createHiLibraryCallbacks,c as libLoadArticleCatalog,l as libLoadCalcScript,p as libLoadMasterData,m as omGetRequest,u as omPostRequest,r as registerLegacyUrlFormat,w as setupHi,s as unregisterLegacyUrlFormat};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomle/embedding-lib",
3
- "version": "6.4.0-alpha.14",
3
+ "version": "6.4.0-alpha.16",
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",
@@ -11,7 +11,7 @@
11
11
  * ```
12
12
  */
13
13
  export { createHiLibraryCallbacks } from './homag-intelligence/hi-callbacks';
14
- export { libLoadArticleCatalog, libLoadMasterData, libLoadCalcScript, } from './homag-intelligence/hi-requests';
14
+ export { libLoadArticleCatalog, libLoadMasterData, libLoadCalcScript, registerLegacyUrlFormat, unregisterLegacyUrlFormat, } from './homag-intelligence/hi-requests';
15
15
  export { omPostRequest, omGetRequest, } from './homag-intelligence/hi-order-manager';
16
16
  export { setupHi, cleanupHi } from './homag-intelligence/hi-setup';
17
17
  export { type ExternalObjectSnapshotSaveResult, type HiContextAction, } from '../../web-sdk/packages';
@@ -1,4 +1,35 @@
1
1
  import { HomagIntelligenceInitData } from '../../../web-sdk/packages';
2
+ /**
3
+ * Register a subscription/library combination that requires the legacy
4
+ * TecConfig URL format.
5
+ *
6
+ * Call this **before** `setupHi` so that subsequent data fetches
7
+ * (`libLoadArticleCatalog`, `libLoadMasterData`, `libLoadCalcScript`)
8
+ * use the correct URL scheme.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { registerLegacyUrlFormat, setupHi } from '@roomle/embedding-lib/hi';
13
+ *
14
+ * registerLegacyUrlFormat('5bf5fac8-58af-4a95-a5e0-41a4dc52d5f5', 'Furniture_Smith');
15
+ * await setupHi(hiOptions, callbacks);
16
+ * ```
17
+ */
18
+ export declare const registerLegacyUrlFormat: (subscriptionId: string, libraryId: string) => void;
19
+ /**
20
+ * Unregister a subscription/library combination so it no longer uses the
21
+ * legacy TecConfig URL format.
22
+ *
23
+ * Useful when HOMAG migrates a subscription to the newer URL scheme.
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * import { unregisterLegacyUrlFormat } from '@roomle/embedding-lib/hi';
28
+ *
29
+ * unregisterLegacyUrlFormat('e2fe8b3d-da31-4a20-92ab-ab6e3839300e', 'Furniture_Smith');
30
+ * ```
31
+ */
32
+ export declare const unregisterLegacyUrlFormat: (subscriptionId: string, libraryId: string) => void;
2
33
  export declare const libLoadArticleCatalog: (hiInitData: HomagIntelligenceInitData) => Promise<any>;
3
34
  export declare const libLoadMasterData: (hiInitData: HomagIntelligenceInitData) => Promise<any>;
4
35
  export declare const libLoadCalcScript: (hiInitData: HomagIntelligenceInitData) => Promise<string>;