@ifc-lite/viewer 1.18.0 → 1.19.1

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 (61) hide show
  1. package/.turbo/turbo-build.log +19 -16
  2. package/.turbo/turbo-typecheck.log +1 -1
  3. package/CHANGELOG.md +444 -0
  4. package/dist/assets/basketViewActivator-CA2CTcVo.js +71 -0
  5. package/dist/assets/{bcf-DOG9_WPX.js → bcf-4K724hw0.js} +18 -18
  6. package/dist/assets/decode-worker-Collf_X_.js +1320 -0
  7. package/dist/assets/{exporters-B_OBqIyD.js → exporters-xbXqEDlO.js} +2547 -1958
  8. package/dist/assets/{geometry.worker-xHHy-9DV.js → geometry.worker-DQEZB2rB.js} +1 -1
  9. package/dist/assets/ids-2WdONLlu.js +2033 -0
  10. package/dist/assets/ifc-lite_bg-4yUkDRD8.wasm +0 -0
  11. package/dist/assets/index-BXeEKqJG.css +1 -0
  12. package/dist/assets/{index-BKq-M3Mk.js → index-D8Epw-e7.js} +51781 -32599
  13. package/dist/assets/index-XwKzDuw6.js +22 -0
  14. package/dist/assets/{native-bridge-SHXiQwFW.js → native-bridge-DKmx1z95.js} +2 -2
  15. package/dist/assets/{sandbox-jez21HtV.js → sandbox-tccwm5Bo.js} +1402 -1329
  16. package/dist/assets/{server-client-ncOQVNso.js → server-client-LoWPK1N2.js} +1 -1
  17. package/dist/assets/three-CDRZThFA.js +4057 -0
  18. package/dist/assets/{wasm-bridge-DyfBSB8z.js → wasm-bridge-BsJGgPMs.js} +1 -1
  19. package/dist/index.html +8 -7
  20. package/dist/samples/building-architecture.ifc +453 -0
  21. package/dist/samples/hello-wall.ifc +1054 -0
  22. package/dist/samples/infra-bridge.ifc +962 -0
  23. package/package.json +13 -7
  24. package/public/samples/building-architecture.ifc +453 -0
  25. package/public/samples/hello-wall.ifc +1054 -0
  26. package/public/samples/infra-bridge.ifc +962 -0
  27. package/src/App.tsx +37 -3
  28. package/src/components/mcp/HeroScene.tsx +876 -0
  29. package/src/components/mcp/McpLanding.tsx +1318 -0
  30. package/src/components/mcp/McpPlayground.tsx +524 -0
  31. package/src/components/mcp/PlaygroundChat.tsx +1097 -0
  32. package/src/components/mcp/PlaygroundViewer.tsx +815 -0
  33. package/src/components/mcp/README.md +171 -0
  34. package/src/components/mcp/data.ts +659 -0
  35. package/src/components/mcp/playground-dispatcher.ts +1649 -0
  36. package/src/components/mcp/playground-files.ts +107 -0
  37. package/src/components/mcp/playground-uploads.ts +122 -0
  38. package/src/components/mcp/types.ts +65 -0
  39. package/src/components/mcp/use-mcp-page.ts +109 -0
  40. package/src/components/viewer/MainToolbar.tsx +23 -2
  41. package/src/components/viewer/PointCloudPanel.tsx +174 -0
  42. package/src/components/viewer/Viewport.tsx +18 -1
  43. package/src/components/viewer/ViewportContainer.tsx +78 -9
  44. package/src/components/viewer/ViewportOverlays.tsx +13 -2
  45. package/src/components/viewer/tools/AddElementOverlay.tsx +43 -2
  46. package/src/components/viewer/usePointCloudLifecycle.ts +64 -0
  47. package/src/components/viewer/usePointCloudSync.ts +98 -0
  48. package/src/generated/mcp-catalog.json +82 -0
  49. package/src/hooks/ingest/pointCloudIngest.ts +391 -0
  50. package/src/hooks/ingest/viewerModelIngest.ts +32 -3
  51. package/src/hooks/useIfcFederation.ts +72 -3
  52. package/src/hooks/useIfcLoader.ts +67 -3
  53. package/src/services/file-dialog.ts +4 -2
  54. package/src/store/index.ts +10 -1
  55. package/src/store/slices/pointCloudSlice.ts +102 -0
  56. package/src/store/types.ts +7 -0
  57. package/vite.config.ts +7 -0
  58. package/dist/assets/basketViewActivator-Cm1QEk_R.js +0 -1
  59. package/dist/assets/ids-DQ5jY0E8.js +0 -1
  60. package/dist/assets/ifc-lite_bg-ADjKXSms.wasm +0 -0
  61. package/dist/assets/index-COnQRuqY.css +0 -1
package/src/App.tsx CHANGED
@@ -5,13 +5,18 @@
5
5
  /**
6
6
  * Main application component.
7
7
  *
8
- * The /settings route is used by the desktop shell (Tauri) for account
9
- * and API key management. On the web viewer it is unreachable (no links
10
- * navigate there and vercel.json does not rewrite it).
8
+ * Routing is intentionally lo-fi (no router lib): we read window.location.pathname
9
+ * at boot, react to popstate, and switch by prefix. The handful of routes:
10
+ *
11
+ * / → main WebGL viewer (default)
12
+ * /settings → desktop-shell account / API-key management (Tauri)
13
+ * /mcp[/...] → @ifc-lite/mcp marketing surface
11
14
  */
12
15
 
13
16
  import { ViewerLayout } from './components/viewer/ViewerLayout';
14
17
  import { SettingsPage } from './components/viewer/SettingsPage';
18
+ import { McpLanding } from './components/mcp/McpLanding';
19
+ import { McpPlayground } from './components/mcp/McpPlayground';
15
20
  import { BimProvider } from './sdk/BimProvider';
16
21
  import { Toaster } from './components/ui/toast';
17
22
  import { useEffect, useState } from 'react';
@@ -25,6 +30,35 @@ export function App() {
25
30
  return () => window.removeEventListener('popstate', onRouteChange);
26
31
  }, []);
27
32
 
33
+ // /mcp lives outside BimProvider — it’s a pure marketing surface that
34
+ // doesn’t need the WASM viewer context. Skips a chunky dependency boot
35
+ // so cold-loading the landing page is cheap. /mcp/playground does parse
36
+ // IFCs in-browser, but uses its own minimal pipeline (parser → headless
37
+ // backend → BimContext) rather than the full viewer stack.
38
+ //
39
+ // Normalise the trailing slash before matching so `/mcp/playground/`
40
+ // (e.g. shared from a browser address bar that auto-appends `/`) hits
41
+ // the playground branch instead of falling through to the landing.
42
+ const normalizedPath = pathname.length > 1 && pathname.endsWith('/')
43
+ ? pathname.slice(0, -1)
44
+ : pathname;
45
+ if (normalizedPath === '/mcp/playground') {
46
+ return (
47
+ <>
48
+ <McpPlayground />
49
+ <Toaster />
50
+ </>
51
+ );
52
+ }
53
+ if (normalizedPath === '/mcp' || normalizedPath.startsWith('/mcp/')) {
54
+ return (
55
+ <>
56
+ <McpLanding />
57
+ <Toaster />
58
+ </>
59
+ );
60
+ }
61
+
28
62
  return (
29
63
  <BimProvider>
30
64
  {pathname === '/settings' ? <SettingsPage /> : <ViewerLayout />}