@ifc-lite/viewer 1.19.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.
- package/.turbo/turbo-build.log +15 -14
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/assets/basketViewActivator-CA2CTcVo.js +71 -0
- package/dist/assets/{bcf-DOG9_WPX.js → bcf-4K724hw0.js} +18 -18
- package/dist/assets/{exporters-BraHBeoi.js → exporters-xbXqEDlO.js} +53 -46
- package/dist/assets/ids-2WdONLlu.js +2033 -0
- package/dist/assets/index-BXeEKqJG.css +1 -0
- package/dist/assets/{index-BOi3BuUI.js → index-D8Epw-e7.js} +48072 -30928
- package/dist/assets/{native-bridge-CpBeOPQa.js → native-bridge-DKmx1z95.js} +2 -2
- package/dist/assets/{sandbox-Baez7n-t.js → sandbox-tccwm5Bo.js} +547 -529
- package/dist/assets/{server-client-BB6cMAXE.js → server-client-LoWPK1N2.js} +1 -1
- package/dist/assets/three-CDRZThFA.js +4057 -0
- package/dist/assets/{wasm-bridge-CAYCUHbE.js → wasm-bridge-BsJGgPMs.js} +1 -1
- package/dist/index.html +8 -7
- package/dist/samples/building-architecture.ifc +453 -0
- package/dist/samples/hello-wall.ifc +1054 -0
- package/dist/samples/infra-bridge.ifc +962 -0
- package/package.json +7 -2
- package/public/samples/building-architecture.ifc +453 -0
- package/public/samples/hello-wall.ifc +1054 -0
- package/public/samples/infra-bridge.ifc +962 -0
- package/src/App.tsx +37 -3
- package/src/components/mcp/HeroScene.tsx +876 -0
- package/src/components/mcp/McpLanding.tsx +1318 -0
- package/src/components/mcp/McpPlayground.tsx +524 -0
- package/src/components/mcp/PlaygroundChat.tsx +1097 -0
- package/src/components/mcp/PlaygroundViewer.tsx +815 -0
- package/src/components/mcp/README.md +171 -0
- package/src/components/mcp/data.ts +659 -0
- package/src/components/mcp/playground-dispatcher.ts +1649 -0
- package/src/components/mcp/playground-files.ts +107 -0
- package/src/components/mcp/playground-uploads.ts +122 -0
- package/src/components/mcp/types.ts +65 -0
- package/src/components/mcp/use-mcp-page.ts +109 -0
- package/src/components/viewer/MainToolbar.tsx +19 -0
- package/src/components/viewer/ViewportContainer.tsx +35 -4
- package/src/generated/mcp-catalog.json +82 -0
- package/vite.config.ts +6 -0
- package/dist/assets/basketViewActivator-RZy5c3Td.js +0 -1
- package/dist/assets/ids-DQ5jY0E8.js +0 -1
- package/dist/assets/index-0XpVr_S5.css +0 -1
package/src/App.tsx
CHANGED
|
@@ -5,13 +5,18 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Main application component.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
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 />}
|