@ifc-lite/viewer 1.14.2 → 1.14.4
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/CHANGELOG.md +35 -0
- package/dist/assets/{Arrow.dom-CSgnLhN4.js → Arrow.dom-_vGzMMKs.js} +1 -1
- package/dist/assets/basketViewActivator-BZcoCL3V.js +1 -0
- package/dist/assets/{browser-qSKWrKQW.js → browser-Czmf34bo.js} +1 -1
- package/dist/assets/ifc-lite_bg-DyBKoGgk.wasm +0 -0
- package/dist/assets/index-CMQ_Dgkr.css +1 -0
- package/dist/assets/index-D7nEDctQ.js +229 -0
- package/dist/assets/{index-4Y4XaV8N.js → index-DX-Qf5fA.js} +72669 -61673
- package/dist/assets/{native-bridge-CSFDsEkg.js → native-bridge-DAOWftxE.js} +1 -1
- package/dist/assets/{wasm-bridge-Zf90ysEm.js → wasm-bridge-D7jYpn8a.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +21 -20
- package/src/App.tsx +17 -1
- package/src/components/viewer/BasketPresentationDock.tsx +8 -4
- package/src/components/viewer/ChatPanel.tsx +1402 -0
- package/src/components/viewer/CodeEditor.tsx +70 -4
- package/src/components/viewer/CommandPalette.tsx +1 -0
- package/src/components/viewer/HierarchyPanel.tsx +28 -13
- package/src/components/viewer/MainToolbar.tsx +113 -95
- package/src/components/viewer/ScriptPanel.tsx +351 -184
- package/src/components/viewer/UpgradePage.tsx +69 -0
- package/src/components/viewer/Viewport.tsx +23 -0
- package/src/components/viewer/chat/ChatMessage.tsx +144 -0
- package/src/components/viewer/chat/ExecutableCodeBlock.tsx +416 -0
- package/src/components/viewer/chat/ModelSelector.tsx +102 -0
- package/src/components/viewer/chat/renderTextContent.test.ts +23 -0
- package/src/components/viewer/chat/renderTextContent.ts +19 -0
- package/src/components/viewer/hierarchy/HierarchyNode.tsx +10 -3
- package/src/components/viewer/hierarchy/treeDataBuilder.test.ts +126 -0
- package/src/components/viewer/hierarchy/treeDataBuilder.ts +139 -38
- package/src/components/viewer/hierarchy/types.ts +6 -1
- package/src/components/viewer/hierarchy/useHierarchyTree.ts +27 -12
- package/src/hooks/useIfcCache.ts +1 -2
- package/src/hooks/useSandbox.ts +122 -6
- package/src/index.css +10 -0
- package/src/lib/attachments.ts +46 -0
- package/src/lib/llm/ClerkChatSync.tsx +74 -0
- package/src/lib/llm/clerk-auth.ts +62 -0
- package/src/lib/llm/code-extractor.ts +50 -0
- package/src/lib/llm/context-builder.test.ts +18 -0
- package/src/lib/llm/context-builder.ts +305 -0
- package/src/lib/llm/free-models.test.ts +118 -0
- package/src/lib/llm/message-capabilities.test.ts +131 -0
- package/src/lib/llm/message-capabilities.ts +94 -0
- package/src/lib/llm/models.ts +197 -0
- package/src/lib/llm/repair-loop.test.ts +91 -0
- package/src/lib/llm/repair-loop.ts +76 -0
- package/src/lib/llm/script-diagnostics.ts +445 -0
- package/src/lib/llm/script-edit-ops.test.ts +399 -0
- package/src/lib/llm/script-edit-ops.ts +954 -0
- package/src/lib/llm/script-preflight.test.ts +513 -0
- package/src/lib/llm/script-preflight.ts +990 -0
- package/src/lib/llm/script-preservation.test.ts +128 -0
- package/src/lib/llm/script-preservation.ts +152 -0
- package/src/lib/llm/stream-client.test.ts +97 -0
- package/src/lib/llm/stream-client.ts +410 -0
- package/src/lib/llm/system-prompt.test.ts +181 -0
- package/src/lib/llm/system-prompt.ts +665 -0
- package/src/lib/llm/types.ts +150 -0
- package/src/lib/scripts/templates/bim-globals.d.ts +226 -7
- package/src/lib/scripts/templates/create-building.ts +12 -12
- package/src/main.tsx +10 -1
- package/src/sdk/adapters/export-adapter.test.ts +24 -0
- package/src/sdk/adapters/export-adapter.ts +40 -16
- package/src/sdk/adapters/files-adapter.ts +39 -0
- package/src/sdk/adapters/model-compat.ts +1 -1
- package/src/sdk/adapters/mutate-adapter.ts +20 -6
- package/src/sdk/adapters/mutation-view.ts +112 -0
- package/src/sdk/adapters/query-adapter.ts +100 -4
- package/src/sdk/local-backend.ts +4 -0
- package/src/store/index.ts +15 -1
- package/src/store/slices/chatSlice.test.ts +325 -0
- package/src/store/slices/chatSlice.ts +468 -0
- package/src/store/slices/scriptSlice.test.ts +75 -0
- package/src/store/slices/scriptSlice.ts +256 -9
- package/src/vite-env.d.ts +10 -0
- package/vite.config.ts +21 -2
- package/dist/assets/ifc-lite_bg-BOvNXJA_.wasm +0 -0
- package/dist/assets/index-ByrFvN5A.css +0 -1
- package/dist/assets/index-CN7qDq7G.js +0 -216
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as f,a as m}from"./index-
|
|
1
|
+
import{I as f,a as m}from"./index-DX-Qf5fA.js";class u{bridge;initialized=!1;constructor(){this.bridge=new f}async init(){this.initialized||(await this.bridge.init(),this.initialized=!0)}isInitialized(){return this.initialized}async processGeometry(s){this.initialized||await this.init(),performance.now();const i=new m(this.bridge.getApi(),s),n=i.collectMeshes(),r=i.getBuildingRotation();performance.now();let e=0,o=0;for(const c of n)e+=c.positions.length/3,o+=c.indices.length/3;return{meshes:n,totalVertices:e,totalTriangles:o,coordinateInfo:{originShift:{x:0,y:0,z:0},originalBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},shiftedBounds:{min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},hasLargeCoordinates:!1,buildingRotation:r}}}async processGeometryStreaming(s,i){this.initialized||await this.init();const n=performance.now(),r=new m(this.bridge.getApi(),s);let e=0,o=0,a=0;try{for await(const t of r.collectMeshesStreaming(50)){if(t&&typeof t=="object"&&"type"in t&&t.type==="colorUpdate")continue;const l=t;e+=l.length;for(const d of l)o+=d.positions.length/3,a+=d.indices.length/3;i.onBatch?.({meshes:l,progress:{processed:e,total:e,currentType:"processing"}})}}catch(t){throw i.onError?.(t instanceof Error?t:new Error(String(t))),t}const h=performance.now()-n,g={totalMeshes:e,totalVertices:o,totalTriangles:a,parseTimeMs:h*.3,geometryTimeMs:h*.7};return i.onComplete?.(g),g}getApi(){return this.bridge.getApi()}}export{u as WasmBridge};
|
package/dist/index.html
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
<meta name="theme-color" content="#7aa2f7">
|
|
45
45
|
<meta name="msapplication-TileColor" content="#1a1b26">
|
|
46
46
|
<meta name="msapplication-TileImage" content="/favicon-192x192-cropped.png">
|
|
47
|
-
<script type="module" crossorigin src="/assets/index-
|
|
48
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
47
|
+
<script type="module" crossorigin src="/assets/index-DX-Qf5fA.js"></script>
|
|
48
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CMQ_Dgkr.css">
|
|
49
49
|
</head>
|
|
50
50
|
<body>
|
|
51
51
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/viewer",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.4",
|
|
4
4
|
"description": "IFC-Lite viewer application",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
+
"@clerk/clerk-react": "^5.61.3",
|
|
7
8
|
"@codemirror/autocomplete": "^6.20.0",
|
|
8
9
|
"@codemirror/commands": "^6.10.2",
|
|
9
10
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
@@ -41,24 +42,24 @@
|
|
|
41
42
|
"tailwind-merge": "^3.4.0",
|
|
42
43
|
"tailwindcss": "^4.1.18",
|
|
43
44
|
"zustand": "^4.4.0",
|
|
44
|
-
"@ifc-lite/bcf": "^1.14.
|
|
45
|
-
"@ifc-lite/cache": "^1.14.
|
|
46
|
-
"@ifc-lite/data": "^1.14.
|
|
47
|
-
"@ifc-lite/drawing-2d": "^1.14.
|
|
48
|
-
"@ifc-lite/encoding": "^1.14.
|
|
49
|
-
"@ifc-lite/export": "^1.14.
|
|
50
|
-
"@ifc-lite/geometry": "^1.14.
|
|
51
|
-
"@ifc-lite/ids": "^1.14.
|
|
52
|
-
"@ifc-lite/
|
|
53
|
-
"@ifc-lite/
|
|
54
|
-
"@ifc-lite/mutations": "^1.14.
|
|
55
|
-
"@ifc-lite/parser": "^
|
|
56
|
-
"@ifc-lite/query": "^1.14.
|
|
57
|
-
"@ifc-lite/renderer": "^1.14.
|
|
58
|
-
"@ifc-lite/
|
|
59
|
-
"@ifc-lite/
|
|
60
|
-
"@ifc-lite/
|
|
61
|
-
"@ifc-lite/wasm": "^1.14.
|
|
45
|
+
"@ifc-lite/bcf": "^1.14.3",
|
|
46
|
+
"@ifc-lite/cache": "^1.14.3",
|
|
47
|
+
"@ifc-lite/data": "^1.14.3",
|
|
48
|
+
"@ifc-lite/drawing-2d": "^1.14.3",
|
|
49
|
+
"@ifc-lite/encoding": "^1.14.3",
|
|
50
|
+
"@ifc-lite/export": "^1.14.4",
|
|
51
|
+
"@ifc-lite/geometry": "^1.14.3",
|
|
52
|
+
"@ifc-lite/ids": "^1.14.3",
|
|
53
|
+
"@ifc-lite/lists": "^1.14.3",
|
|
54
|
+
"@ifc-lite/lens": "^1.14.3",
|
|
55
|
+
"@ifc-lite/mutations": "^1.14.3",
|
|
56
|
+
"@ifc-lite/parser": "^2.0.0",
|
|
57
|
+
"@ifc-lite/query": "^1.14.4",
|
|
58
|
+
"@ifc-lite/renderer": "^1.14.3",
|
|
59
|
+
"@ifc-lite/server-client": "^1.14.3",
|
|
60
|
+
"@ifc-lite/spatial": "^1.14.3",
|
|
61
|
+
"@ifc-lite/sandbox": "^1.14.3",
|
|
62
|
+
"@ifc-lite/wasm": "^1.14.3"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
65
|
"@tailwindcss/postcss": "^4.1.18",
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
"dev": "vite",
|
|
77
78
|
"build": "NODE_OPTIONS='--max-old-space-size=4096' bash -c '(tsc || true) && vite build'",
|
|
78
79
|
"preview": "vite preview",
|
|
79
|
-
"test": "
|
|
80
|
+
"test": "tsx --test --test-concurrency=1 $(find src -type f \\( -name '*.test.ts' -o -name '*.test.tsx' \\) | sort)",
|
|
80
81
|
"check:templates": "tsc -p src/lib/scripts/templates/tsconfig.json --noEmit"
|
|
81
82
|
}
|
|
82
83
|
}
|
package/src/App.tsx
CHANGED
|
@@ -7,13 +7,29 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { ViewerLayout } from './components/viewer/ViewerLayout';
|
|
10
|
+
import { UpgradePage } from './components/viewer/UpgradePage';
|
|
10
11
|
import { BimProvider } from './sdk/BimProvider';
|
|
11
12
|
import { Toaster } from './components/ui/toast';
|
|
13
|
+
import { ClerkChatSync } from './lib/llm/ClerkChatSync';
|
|
14
|
+
import { isClerkConfigured } from './lib/llm/clerk-auth';
|
|
15
|
+
import { useEffect, useState } from 'react';
|
|
12
16
|
|
|
13
17
|
export function App() {
|
|
18
|
+
const clerkEnabled = isClerkConfigured();
|
|
19
|
+
const [pathname, setPathname] = useState(() => window.location.pathname);
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const onRouteChange = () => setPathname(window.location.pathname);
|
|
23
|
+
window.addEventListener('popstate', onRouteChange);
|
|
24
|
+
return () => window.removeEventListener('popstate', onRouteChange);
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
const isUpgradeRoute = pathname === '/upgrade';
|
|
28
|
+
|
|
14
29
|
return (
|
|
15
30
|
<BimProvider>
|
|
16
|
-
<
|
|
31
|
+
{clerkEnabled && <ClerkChatSync />}
|
|
32
|
+
{isUpgradeRoute ? <UpgradePage /> : <ViewerLayout />}
|
|
17
33
|
<Toaster />
|
|
18
34
|
</BimProvider>
|
|
19
35
|
);
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
executeBasketSaveView,
|
|
31
31
|
executeBasketClear,
|
|
32
32
|
} from '@/store/basket/basketCommands';
|
|
33
|
-
import { activateBasketViewFromStore } from '@/store/basket/basketViewActivator';
|
|
34
33
|
import { getSmartBasketInputFromStore, isBasketIsolationActiveFromStore } from '@/store/basketVisibleSet';
|
|
35
34
|
|
|
36
35
|
export function BasketPresentationDock() {
|
|
@@ -118,6 +117,11 @@ export function BasketPresentationDock() {
|
|
|
118
117
|
setPlayingAll(false);
|
|
119
118
|
}, []);
|
|
120
119
|
|
|
120
|
+
const activateSavedView = useCallback(async (viewId: string) => {
|
|
121
|
+
const { activateBasketViewFromStore } = await import('@/store/basket/basketViewActivator');
|
|
122
|
+
activateBasketViewFromStore(viewId);
|
|
123
|
+
}, []);
|
|
124
|
+
|
|
121
125
|
const startPlayAll = useCallback(async (loop = false) => {
|
|
122
126
|
if (playingAll || basketViews.length === 0) return;
|
|
123
127
|
stopPlayRef.current = false;
|
|
@@ -129,7 +133,7 @@ export function BasketPresentationDock() {
|
|
|
129
133
|
do {
|
|
130
134
|
for (const view of orderedViews) {
|
|
131
135
|
if (stopPlayRef.current) break;
|
|
132
|
-
|
|
136
|
+
await activateSavedView(view.id);
|
|
133
137
|
const transitionMs = toTransitionMs(view.transitionMs);
|
|
134
138
|
await wait(transitionMs + 180);
|
|
135
139
|
}
|
|
@@ -138,7 +142,7 @@ export function BasketPresentationDock() {
|
|
|
138
142
|
loopPlayRef.current = false;
|
|
139
143
|
setPlayingAll(false);
|
|
140
144
|
}
|
|
141
|
-
}, [basketViews, playingAll, toTransitionMs, wait]);
|
|
145
|
+
}, [activateSavedView, basketViews, playingAll, toTransitionMs, wait]);
|
|
142
146
|
|
|
143
147
|
const setViewTransitionDuration = useCallback((viewId: string, currentTransitionMs: number | null) => {
|
|
144
148
|
const defaultSeconds = currentTransitionMs && currentTransitionMs > 0
|
|
@@ -299,7 +303,7 @@ export function BasketPresentationDock() {
|
|
|
299
303
|
type="button"
|
|
300
304
|
onClick={() => {
|
|
301
305
|
if (editingViewId) return;
|
|
302
|
-
|
|
306
|
+
void activateSavedView(view.id);
|
|
303
307
|
}}
|
|
304
308
|
className={cn(
|
|
305
309
|
'h-full w-full rounded-md border bg-card text-left overflow-hidden transition-colors',
|