@thatopen/components 2.0.24 → 2.0.25

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/dist/index.mjs CHANGED
@@ -2964,7 +2964,7 @@ const Fs = class Fs {
2964
2964
  /**
2965
2965
  * The version of the @thatopen/components library.
2966
2966
  */
2967
- I(Fs, "release", "2.0.24");
2967
+ I(Fs, "release", "2.0.25");
2968
2968
  let pi = Fs;
2969
2969
  class Rr {
2970
2970
  constructor(s) {
@@ -7117,7 +7117,6 @@ const vn = /* @__PURE__ */ new Set([
7117
7117
  3737207727,
7118
7118
  1660063152,
7119
7119
  2347385850,
7120
- 3940055652,
7121
7120
  2705031697,
7122
7121
  3732776249,
7123
7122
  2485617015,
@@ -9035,7 +9034,7 @@ class Kt {
9035
9034
  if (!h || !h.UnitType || !h.UnitType.value || h.UnitType.value !== "LENGTHUNIT")
9036
9035
  continue;
9037
9036
  let E = 1, u = 1;
9038
- return h.Name.value === "METRE" && (u = 1), h.Name.value === "FOOT" && (u = 0.3048), ((n = h.Prefix) == null ? void 0 : n.value) === "MILLI" ? E = 1e-3 : (((r = h.Prefix) == null ? void 0 : r.value) === "CENTI" || ((a = h.Prefix) == null ? void 0 : a.value) === "DECI") && (E = 0.01), u * E;
9037
+ return h.Name.value === "METRE" && (u = 1), h.Name.value === "FOOT" && (u = 0.3048), ((n = h.Prefix) == null ? void 0 : n.value) === "MILLI" ? E = 1e-3 : ((r = h.Prefix) == null ? void 0 : r.value) === "CENTI" ? E = 0.01 : ((a = h.Prefix) == null ? void 0 : a.value) === "DECI" && (E = 0.1), u * E;
9039
9038
  }
9040
9039
  return 1;
9041
9040
  }
@@ -10242,32 +10241,48 @@ const Ls = class Ls extends et {
10242
10241
  * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
10243
10242
  */
10244
10243
  async bySpatialStructure(t) {
10245
- var n;
10244
+ var n, r;
10246
10245
  const e = this.components.get(ke), i = e.relationMaps[t.uuid];
10247
10246
  if (!i)
10248
10247
  throw new Error(
10249
10248
  `Classifier: model relations of ${t.name || t.uuid} have to exists to group by spatial structure.`
10250
10249
  );
10251
10250
  const o = "spatialStructures";
10252
- for (const [r] of i) {
10253
- const a = e.getEntityRelations(
10251
+ for (const [a] of i) {
10252
+ const c = e.getEntityRelations(
10254
10253
  t,
10255
- r,
10254
+ a,
10255
+ "Decomposes"
10256
+ );
10257
+ if (c)
10258
+ for (const u of c) {
10259
+ const f = await t.getProperties(u);
10260
+ if (!f)
10261
+ continue;
10262
+ const R = (n = f.Name) == null ? void 0 : n.value;
10263
+ this.saveItem(t, o, R, a);
10264
+ }
10265
+ const h = e.getEntityRelations(
10266
+ t,
10267
+ a,
10256
10268
  "ContainsElements"
10257
- ), c = await t.getProperties(r);
10258
- if (!(a && c))
10269
+ );
10270
+ if (!h)
10271
+ continue;
10272
+ const d = await t.getProperties(a);
10273
+ if (!d)
10259
10274
  continue;
10260
- const h = (n = c.Name) == null ? void 0 : n.value;
10261
- for (const d of a) {
10262
- this.saveItem(t, o, h, d);
10263
- const E = e.getEntityRelations(
10275
+ const E = (r = d.Name) == null ? void 0 : r.value;
10276
+ for (const u of h) {
10277
+ this.saveItem(t, o, E, u);
10278
+ const f = e.getEntityRelations(
10264
10279
  t,
10265
- Number(d),
10280
+ Number(u),
10266
10281
  "IsDecomposedBy"
10267
10282
  );
10268
- if (E)
10269
- for (const u of E)
10270
- this.saveItem(t, o, h, u);
10283
+ if (f)
10284
+ for (const R of f)
10285
+ this.saveItem(t, o, E, R);
10271
10286
  }
10272
10287
  }
10273
10288
  }