@ifc-lite/viewer 1.17.4 → 1.17.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.
Files changed (80) hide show
  1. package/.turbo/turbo-build.log +16 -16
  2. package/.turbo/turbo-typecheck.log +1 -1
  3. package/CHANGELOG.md +117 -0
  4. package/DESKTOP_CONTRACT_VERSION +1 -1
  5. package/dist/assets/{basketViewActivator-BmnNtVfZ.js → basketViewActivator-86rgogji.js} +1 -1
  6. package/dist/assets/drawing-2d-DoxKMqbO.js +257 -0
  7. package/dist/assets/{exporters-ChAtBmlj.js → exporters-CcPS9MK5.js} +2274 -2227
  8. package/dist/assets/{geometry.worker-BQ0rzNo-.js → geometry.worker-BFUYA08u.js} +1 -1
  9. package/dist/assets/ids-DQ5jY0E8.js +1 -0
  10. package/dist/assets/ifc-lite_bg-BINvzoCP.wasm +0 -0
  11. package/dist/assets/{index-Co8E2-FE.js → index-Bfms9I4A.js} +35160 -33084
  12. package/dist/assets/index-_bfZsDCC.css +1 -0
  13. package/dist/assets/{native-bridge-BRvbckFQ.js → native-bridge-DUyLCMZS.js} +104 -104
  14. package/dist/assets/{sandbox-DZiNLNMk.js → sandbox-C8575tul.js} +4340 -4322
  15. package/dist/assets/{server-client-BV8zHZ7Y.js → server-client-BuZK7OST.js} +1 -1
  16. package/dist/assets/{wasm-bridge-g01g7T9b.js → wasm-bridge-JsqEGDV8.js} +1 -1
  17. package/dist/index.html +8 -7
  18. package/index.html +1 -0
  19. package/package.json +7 -7
  20. package/src/App.tsx +16 -2
  21. package/src/components/viewer/CesiumOverlay.tsx +62 -19
  22. package/src/components/viewer/ChatPanel.tsx +195 -91
  23. package/src/components/viewer/MainToolbar.tsx +4 -3
  24. package/src/components/viewer/PropertiesPanel.tsx +16 -2
  25. package/src/components/viewer/SettingsPage.tsx +252 -101
  26. package/src/components/viewer/ThemeSwitch.tsx +63 -7
  27. package/src/components/viewer/ViewerLayout.tsx +1 -0
  28. package/src/components/viewer/Viewport.tsx +14 -2
  29. package/src/components/viewer/ViewportContainer.tsx +49 -64
  30. package/src/components/viewer/ViewportOverlays.tsx +5 -2
  31. package/src/components/viewer/bcf/BCFTopicDetail.tsx +4 -4
  32. package/src/components/viewer/chat/ModelSelector.tsx +90 -54
  33. package/src/components/viewer/properties/GeoreferencingPanel.tsx +113 -51
  34. package/src/components/viewer/properties/LocationMap.tsx +9 -7
  35. package/src/components/viewer/properties/ModelMetadataPanel.tsx +1 -1
  36. package/src/components/viewer/tools/SectionCapControls.tsx +237 -0
  37. package/src/components/viewer/tools/SectionPanel.tsx +39 -18
  38. package/src/components/viewer/useAnimationLoop.ts +9 -1
  39. package/src/components/viewer/useRenderUpdates.ts +1 -1
  40. package/src/hooks/ids/idsDataAccessor.ts +60 -24
  41. package/src/hooks/ingest/viewerModelIngest.ts +7 -2
  42. package/src/hooks/useIfcFederation.ts +326 -71
  43. package/src/hooks/useIfcLoader.ts +1 -0
  44. package/src/hooks/useViewControls.ts +13 -5
  45. package/src/index.css +484 -10
  46. package/src/lib/desktop-entitlement.ts +2 -4
  47. package/src/lib/geo/cesium-bridge.ts +15 -7
  48. package/src/lib/geo/effective-georef.test.ts +73 -0
  49. package/src/lib/geo/effective-georef.ts +111 -0
  50. package/src/lib/geo/reproject.ts +105 -19
  51. package/src/lib/llm/byok-guard.test.ts +77 -0
  52. package/src/lib/llm/byok-guard.ts +39 -0
  53. package/src/lib/llm/free-models.test.ts +0 -6
  54. package/src/lib/llm/models.ts +104 -42
  55. package/src/lib/llm/stream-client.ts +74 -110
  56. package/src/lib/llm/stream-direct.test.ts +130 -0
  57. package/src/lib/llm/stream-direct.ts +316 -0
  58. package/src/lib/llm/types.ts +14 -2
  59. package/src/main.tsx +1 -10
  60. package/src/services/api-keys.ts +73 -0
  61. package/src/store/constants.ts +20 -2
  62. package/src/store/index.ts +12 -5
  63. package/src/store/slices/cesiumSlice.ts +5 -0
  64. package/src/store/slices/chatSlice.test.ts +6 -76
  65. package/src/store/slices/chatSlice.ts +17 -58
  66. package/src/store/slices/sectionSlice.test.ts +87 -7
  67. package/src/store/slices/sectionSlice.ts +151 -5
  68. package/src/store/slices/uiSlice.ts +28 -5
  69. package/src/store/types.ts +26 -0
  70. package/src/utils/nativeSpatialDataStore.ts +4 -1
  71. package/src/utils/viewportUtils.ts +7 -2
  72. package/src/vite-env.d.ts +0 -4
  73. package/dist/assets/drawing-2d-gWfpdfYe.js +0 -257
  74. package/dist/assets/ids-B4jTqB1O.js +0 -1
  75. package/dist/assets/ifc-lite_bg-BX4E7TX8.wasm +0 -0
  76. package/dist/assets/index-DckuDqlv.css +0 -1
  77. package/src/components/viewer/UpgradePage.tsx +0 -71
  78. package/src/lib/desktop/ClerkDesktopEntitlementSync.tsx +0 -175
  79. package/src/lib/llm/ClerkChatSync.tsx +0 -74
  80. package/src/lib/llm/clerk-auth.ts +0 -62
@@ -1,4 +1,4 @@
1
- import { _ as $, __tla as __tla_0 } from "./exporters-ChAtBmlj.js";
1
+ import { _ as $, __tla as __tla_0 } from "./exporters-CcPS9MK5.js";
2
2
  import "./bcf-DOG9_WPX.js";
3
3
  import "./zip-DBEtpeu6.js";
4
4
  import "./cesium-DUOzBlqv.js";
@@ -11,8 +11,100 @@ let __tla = Promise.all([
11
11
  } catch {}
12
12
  })()
13
13
  ]).then(async ()=>{
14
- const W = 4, Y = 8192, G = 10;
15
- function P() {
14
+ function W(t) {
15
+ if (t instanceof ArrayBuffer) return t;
16
+ if (t instanceof Uint8Array) return t.byteOffset === 0 && t.byteLength === t.buffer.byteLength && t.buffer instanceof ArrayBuffer ? t.buffer : t.slice().buffer;
17
+ if (Array.isArray(t)) return Uint8Array.from(t).buffer;
18
+ throw new Error(`Unsupported packed geometry shard payload: ${typeof t}`);
19
+ }
20
+ function P(t, i, r) {
21
+ const o = W(t), s = new Uint32Array(o, 0, 8), [c, a, n, m, d, p, y, e] = s;
22
+ if (c !== 1229341506) throw new Error("Invalid packed geometry cache shard magic");
23
+ if (a !== 1) throw new Error(`Unsupported packed geometry cache shard version: ${a}`);
24
+ const l = 11, h = 8, T = n * l, g = (h + T) * Uint32Array.BYTES_PER_ELEMENT, M = m * Float32Array.BYTES_PER_ELEMENT, L = d * Float32Array.BYTES_PER_ELEMENT, E = g, _ = E + M, I = _ + L, N = new Float32Array(o, E, m), U = new Float32Array(o, _, d), x = new Uint32Array(o, I, p), f = new DataView(o, h * Uint32Array.BYTES_PER_ELEMENT, T * Uint32Array.BYTES_PER_ELEMENT), C = [];
25
+ for(let w = 0; w < n; w += 1){
26
+ const u = w * l * Uint32Array.BYTES_PER_ELEMENT, D = f.getUint32(u, !0), v = f.getUint32(u + 4, !0), O = f.getUint32(u + 8, !0), S = f.getUint32(u + 12, !0), V = f.getUint32(u + 16, !0), A = f.getUint32(u + 20, !0), F = f.getUint32(u + 24, !0), z = [
27
+ f.getFloat32(u + 28, !0),
28
+ f.getFloat32(u + 32, !0),
29
+ f.getFloat32(u + 36, !0),
30
+ f.getFloat32(u + 40, !0)
31
+ ];
32
+ C.push({
33
+ expressId: D,
34
+ positions: N.subarray(v, v + O),
35
+ normals: U.subarray(S, S + V),
36
+ indices: x.subarray(A, A + F),
37
+ color: z
38
+ });
39
+ }
40
+ return {
41
+ meshes: C,
42
+ progress: {
43
+ processed: y,
44
+ total: e,
45
+ currentType: "cached"
46
+ },
47
+ nativeTelemetry: {
48
+ batchSequence: r,
49
+ payloadKind: "packed-cache-shard",
50
+ meshCount: n,
51
+ positionsLen: m,
52
+ normalsLen: d,
53
+ indicesLen: p,
54
+ chunkReadyTimeMs: 0,
55
+ packTimeMs: 0,
56
+ emitTimeMs: 0,
57
+ emittedTimeMs: 0,
58
+ jsReceivedTimeMs: i
59
+ }
60
+ };
61
+ }
62
+ function k(t) {
63
+ return {
64
+ expressId: t.expressId,
65
+ ifcType: t.ifcType,
66
+ positions: new Float32Array(t.positions),
67
+ normals: new Float32Array(t.normals),
68
+ indices: new Uint32Array(t.indices),
69
+ color: t.color
70
+ };
71
+ }
72
+ function Y(t) {
73
+ const i = Float32Array.from(t.positions), r = Float32Array.from(t.normals), o = Uint32Array.from(t.indices);
74
+ return t.meshes.map((s)=>({
75
+ expressId: s.expressId,
76
+ ifcType: s.ifcType,
77
+ positions: i.subarray(s.positionsOffset, s.positionsOffset + s.positionsLen),
78
+ normals: r.subarray(s.normalsOffset, s.normalsOffset + s.normalsLen),
79
+ indices: o.subarray(s.indicesOffset, s.indicesOffset + s.indicesLen),
80
+ color: s.color
81
+ }));
82
+ }
83
+ function b(t, i) {
84
+ if (t) return {
85
+ batchSequence: t.batchSequence,
86
+ payloadKind: t.payloadKind,
87
+ meshCount: t.meshCount,
88
+ positionsLen: t.positionsLen,
89
+ normalsLen: t.normalsLen,
90
+ indicesLen: t.indicesLen,
91
+ chunkReadyTimeMs: t.chunkReadyTimeMs,
92
+ packTimeMs: t.packTimeMs,
93
+ emitTimeMs: t.emitTimeMs,
94
+ emittedTimeMs: t.emittedTimeMs,
95
+ jsReceivedTimeMs: i
96
+ };
97
+ }
98
+ function R(t) {
99
+ return {
100
+ originShift: t.originShift,
101
+ originalBounds: t.originalBounds,
102
+ shiftedBounds: t.shiftedBounds,
103
+ hasLargeCoordinates: t.hasLargeCoordinates
104
+ };
105
+ }
106
+ const G = 4, q = 8192, X = 10;
107
+ function B() {
16
108
  const t = globalThis.scheduler;
17
109
  return typeof t?.yield == "function" ? t.yield() : new Promise((i)=>{
18
110
  const r = new MessageChannel;
@@ -54,17 +146,17 @@ let __tla = Promise.all([
54
146
  total: n.progress.total,
55
147
  currentType: n.progress.currentType
56
148
  },
57
- nativeTelemetry: R(n.telemetry, performance.now() - o)
149
+ nativeTelemetry: b(n.telemetry, performance.now() - o)
58
150
  } : {
59
- meshes: q(n.payload),
151
+ meshes: Y(n.payload),
60
152
  progress: {
61
153
  processed: n.payload.progress.processed,
62
154
  total: n.payload.progress.total,
63
155
  currentType: n.payload.progress.currentType
64
156
  },
65
- nativeTelemetry: R(n.payload.telemetry, performance.now() - o)
157
+ nativeTelemetry: b(n.payload.telemetry, performance.now() - o)
66
158
  };
67
- r.onBatch?.(m), s += 1, c += m.meshes.length, i.length > 0 && (s >= W || c >= Y || performance.now() - a >= G) && (await P(), s = 0, c = 0, a = performance.now());
159
+ r.onBatch?.(m), s += 1, c += m.meshes.length, i.length > 0 && (s >= G || c >= q || performance.now() - a >= X) && (await B(), s = 0, c = 0, a = performance.now());
68
160
  }
69
161
  }
70
162
  async processEventDrivenNativeStream(i, r, o, s) {
@@ -125,7 +217,7 @@ let __tla = Promise.all([
125
217
  (!this.initialized || !this.invoke) && await this.init();
126
218
  const r = this.toNativeBuffer(i), o = await this.invoke("get_geometry", {
127
219
  buffer: r
128
- }), s = o.meshes.map(k), c = B(o.coordinateInfo);
220
+ }), s = o.meshes.map(k), c = R(o.coordinateInfo);
129
221
  return {
130
222
  meshes: s,
131
223
  totalVertices: o.totalVertices,
@@ -142,7 +234,7 @@ let __tla = Promise.all([
142
234
  meshes: r.meshes.map(k),
143
235
  totalVertices: r.totalVertices,
144
236
  totalTriangles: r.totalTriangles,
145
- coordinateInfo: B(r.coordinateInfo)
237
+ coordinateInfo: R(r.coordinateInfo)
146
238
  };
147
239
  }
148
240
  async processGeometryStreaming(i, r) {
@@ -247,8 +339,8 @@ let __tla = Promise.all([
247
339
  const m = await this.invoke("get_native_geometry_cache_packed_shard", {
248
340
  cacheKey: i,
249
341
  shardIndex: n
250
- }), d = b(m, performance.now() - o, n + 1);
251
- c = d.progress.processed, r.onBatch?.(d), n + 1 < s.shardCount && await P();
342
+ }), d = P(m, performance.now() - o, n + 1);
343
+ c = d.progress.processed, r.onBatch?.(d), n + 1 < s.shardCount && await B();
252
344
  }
253
345
  const a = {
254
346
  totalMeshes: s.totalMeshes,
@@ -302,7 +394,7 @@ let __tla = Promise.all([
302
394
  const g = await this.invoke("get_native_geometry_cache_packed_shard", {
303
395
  cacheKey: r,
304
396
  shardIndex: a
305
- }), M = b(g, performance.now() - s, a + 1);
397
+ }), M = P(g, performance.now() - s, a + 1);
306
398
  m = Math.max(m, M.progress.processed), n = performance.now(), o.onBatch?.(M), a += 1;
307
399
  }
308
400
  if (h?.done && a >= T) break;
@@ -333,97 +425,5 @@ let __tla = Promise.all([
333
425
  return null;
334
426
  }
335
427
  };
336
- function k(t) {
337
- return {
338
- expressId: t.expressId,
339
- ifcType: t.ifcType,
340
- positions: new Float32Array(t.positions),
341
- normals: new Float32Array(t.normals),
342
- indices: new Uint32Array(t.indices),
343
- color: t.color
344
- };
345
- }
346
- function q(t) {
347
- const i = Float32Array.from(t.positions), r = Float32Array.from(t.normals), o = Uint32Array.from(t.indices);
348
- return t.meshes.map((s)=>({
349
- expressId: s.expressId,
350
- ifcType: s.ifcType,
351
- positions: i.subarray(s.positionsOffset, s.positionsOffset + s.positionsLen),
352
- normals: r.subarray(s.normalsOffset, s.normalsOffset + s.normalsLen),
353
- indices: o.subarray(s.indicesOffset, s.indicesOffset + s.indicesLen),
354
- color: s.color
355
- }));
356
- }
357
- function X(t) {
358
- if (t instanceof ArrayBuffer) return t;
359
- if (t instanceof Uint8Array) return t.byteOffset === 0 && t.byteLength === t.buffer.byteLength && t.buffer instanceof ArrayBuffer ? t.buffer : t.slice().buffer;
360
- if (Array.isArray(t)) return Uint8Array.from(t).buffer;
361
- throw new Error(`Unsupported packed geometry shard payload: ${typeof t}`);
362
- }
363
- function b(t, i, r) {
364
- const o = X(t), s = new Uint32Array(o, 0, 8), [c, a, n, m, d, p, y, e] = s;
365
- if (c !== 1229341506) throw new Error("Invalid packed geometry cache shard magic");
366
- if (a !== 1) throw new Error(`Unsupported packed geometry cache shard version: ${a}`);
367
- const l = 11, h = 8, T = n * l, g = (h + T) * Uint32Array.BYTES_PER_ELEMENT, M = m * Float32Array.BYTES_PER_ELEMENT, L = d * Float32Array.BYTES_PER_ELEMENT, E = g, _ = E + M, I = _ + L, N = new Float32Array(o, E, m), U = new Float32Array(o, _, d), x = new Uint32Array(o, I, p), f = new DataView(o, h * Uint32Array.BYTES_PER_ELEMENT, T * Uint32Array.BYTES_PER_ELEMENT), C = [];
368
- for(let w = 0; w < n; w += 1){
369
- const u = w * l * Uint32Array.BYTES_PER_ELEMENT, D = f.getUint32(u, !0), v = f.getUint32(u + 4, !0), O = f.getUint32(u + 8, !0), S = f.getUint32(u + 12, !0), V = f.getUint32(u + 16, !0), A = f.getUint32(u + 20, !0), F = f.getUint32(u + 24, !0), z = [
370
- f.getFloat32(u + 28, !0),
371
- f.getFloat32(u + 32, !0),
372
- f.getFloat32(u + 36, !0),
373
- f.getFloat32(u + 40, !0)
374
- ];
375
- C.push({
376
- expressId: D,
377
- positions: N.subarray(v, v + O),
378
- normals: U.subarray(S, S + V),
379
- indices: x.subarray(A, A + F),
380
- color: z
381
- });
382
- }
383
- return {
384
- meshes: C,
385
- progress: {
386
- processed: y,
387
- total: e,
388
- currentType: "cached"
389
- },
390
- nativeTelemetry: {
391
- batchSequence: r,
392
- payloadKind: "packed-cache-shard",
393
- meshCount: n,
394
- positionsLen: m,
395
- normalsLen: d,
396
- indicesLen: p,
397
- chunkReadyTimeMs: 0,
398
- packTimeMs: 0,
399
- emitTimeMs: 0,
400
- emittedTimeMs: 0,
401
- jsReceivedTimeMs: i
402
- }
403
- };
404
- }
405
- function R(t, i) {
406
- if (t) return {
407
- batchSequence: t.batchSequence,
408
- payloadKind: t.payloadKind,
409
- meshCount: t.meshCount,
410
- positionsLen: t.positionsLen,
411
- normalsLen: t.normalsLen,
412
- indicesLen: t.indicesLen,
413
- chunkReadyTimeMs: t.chunkReadyTimeMs,
414
- packTimeMs: t.packTimeMs,
415
- emitTimeMs: t.emitTimeMs,
416
- emittedTimeMs: t.emittedTimeMs,
417
- jsReceivedTimeMs: i
418
- };
419
- }
420
- function B(t) {
421
- return {
422
- originShift: t.originShift,
423
- originalBounds: t.originalBounds,
424
- shiftedBounds: t.shiftedBounds,
425
- hasLargeCoordinates: t.hasLargeCoordinates
426
- };
427
- }
428
428
  });
429
429
  export { K as NativeBridge, __tla };