feat(bim): integrate portable IFC viewer, project map and prepared layers
This commit is contained in:
Generated
+11
@@ -10,6 +10,7 @@
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@noble/hashes": "^2.2.0",
|
||||
"@nodedc/bim-viewer": "file:../../vendor/bim/nodedc-bim-viewer-0.1.1.tgz",
|
||||
"@nodedc/map-cesium-react": "file:../../../NODEDC_DESIGN_GUIDELINE/packages/map-cesium-react",
|
||||
"@nodedc/page-patterns": "file:../../../NODEDC_DESIGN_GUIDELINE/packages/page-patterns",
|
||||
"@nodedc/tokens": "file:../../../NODEDC_DESIGN_GUIDELINE/packages/tokens",
|
||||
@@ -882,6 +883,16 @@
|
||||
"url": "https://paulmillr.com/funding/"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodedc/bim-viewer": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "file:../../vendor/bim/nodedc-bim-viewer-0.1.1.tgz",
|
||||
"integrity": "sha512-x01cSS6nH2xhbZzkcl6JSlZmXQnQlifalLVwMd2prNsVJotT3Arj+PkWrLOkEypMY9yZKFmmDccgE8dATXEx7Q==",
|
||||
"peerDependencies": {
|
||||
"@nodedc/ui-react": "0.7.0",
|
||||
"react": ">=19 <20",
|
||||
"react-dom": ">=19 <20"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodedc/map-cesium-react": {
|
||||
"resolved": "../../../NODEDC_DESIGN_GUIDELINE/packages/map-cesium-react",
|
||||
"link": true
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@noble/hashes": "^2.2.0",
|
||||
"@nodedc/bim-viewer": "file:../../vendor/bim/nodedc-bim-viewer-0.1.1.tgz",
|
||||
"@nodedc/map-cesium-react": "file:../../../NODEDC_DESIGN_GUIDELINE/packages/map-cesium-react",
|
||||
"@nodedc/page-patterns": "file:../../../NODEDC_DESIGN_GUIDELINE/packages/page-patterns",
|
||||
"@nodedc/tokens": "file:../../../NODEDC_DESIGN_GUIDELINE/packages/tokens",
|
||||
|
||||
@@ -59,6 +59,7 @@ import {
|
||||
type ObservationWorkspaceLayoutProfile,
|
||||
} from "./core/observation/workspaceLayout";
|
||||
import {
|
||||
capabilityStatusLabel,
|
||||
rootById,
|
||||
roots,
|
||||
workspaceById,
|
||||
@@ -852,7 +853,7 @@ export default function App() {
|
||||
onChange={openNavigationView}
|
||||
/>
|
||||
) : (
|
||||
<StatusBadge tone="warning">Интерфейс готов</StatusBadge>
|
||||
<StatusBadge tone={activeDefinition.status === "active" ? "success" : "warning"}>{capabilityStatusLabel[activeDefinition.status ?? "contract"]}</StatusBadge>
|
||||
)
|
||||
}
|
||||
utilityActions={contentActions}
|
||||
|
||||
@@ -23,6 +23,7 @@ export type WorkspaceKind =
|
||||
| "workers"
|
||||
| "vps"
|
||||
| "network-monitor"
|
||||
| "architectural-projects"
|
||||
| "datasets"
|
||||
| "artifact-health"
|
||||
| "lab-archive"
|
||||
@@ -52,6 +53,7 @@ export interface WorkspaceDefinition {
|
||||
description: string;
|
||||
icon: IconName;
|
||||
kind: WorkspaceKind;
|
||||
status?: CapabilityStatus;
|
||||
internalOnly?: boolean;
|
||||
groups: CapabilityGroup[];
|
||||
}
|
||||
@@ -148,6 +150,12 @@ export const roots: RootDefinition[] = [
|
||||
];
|
||||
|
||||
export const workspaces: WorkspaceDefinition[] = [
|
||||
{
|
||||
id: "architectural-projects", root: "data", kind: "architectural-projects", status: "active",
|
||||
label: "Архитектурные проекты", title: "Архитектурные проекты",
|
||||
eyebrow: "ДАННЫЕ / ОБЪЕКТЫ", description: "Проекты, BIM-модели и пространственные слои.",
|
||||
icon: "building", groups: [],
|
||||
},
|
||||
{
|
||||
id: "lab-archive",
|
||||
root: "polygon",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import {ArchitecturalProjectsWorkspace} from "./data/ArchitecturalProjectsWorkspace";
|
||||
import {SpatialWorkspace} from "./spatial/SpatialWorkspace";
|
||||
import { PlanningSpatialWorkspace } from "./missions/PlanningSpatialWorkspace";
|
||||
import { MissionPlannerWorkspace } from "./missions/MissionPlannerWorkspace";
|
||||
@@ -451,6 +452,8 @@ export function WorkspaceRenderer(props: WorkspaceRendererProps) {
|
||||
return <ComputeModulesWorkspace />;
|
||||
case "network-monitor":
|
||||
return <NetworkWorkspace />;
|
||||
case "architectural-projects":
|
||||
return <ArchitecturalProjectsWorkspace />;
|
||||
case "datasets":
|
||||
return <DatasetGatewayWorkspace />;
|
||||
case "artifact-health":
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import {lazy, Suspense, useCallback, useMemo, useState, type ComponentProps} from 'react';
|
||||
import {Description, ToastStack} from '@nodedc/ui-react';
|
||||
import type {BimHost, Notice} from '@nodedc/bim-viewer';
|
||||
import fragmentsWorker from '@nodedc/bim-viewer/fragments-worker?url';
|
||||
import mapWorker from '@nodedc/bim-viewer/map-worker?url';
|
||||
type NotificationMessage = ComponentProps<typeof ToastStack>['items'][number];
|
||||
|
||||
const Workspace = lazy(async () => {
|
||||
const module = await import('@nodedc/bim-viewer');
|
||||
await import('@nodedc/bim-viewer/style.css');
|
||||
return {default: module.BimWorkspace};
|
||||
});
|
||||
|
||||
/** Host composition only: the module owns its catalog, intake, maps and renderer. */
|
||||
export function ArchitecturalProjectsWorkspace() {
|
||||
const [toasts, setToasts] = useState<NotificationMessage[]>([]);
|
||||
const notify = useCallback((notice: Notice) => {
|
||||
setToasts(items => [...items, {...notice, id: 'bim:' + crypto.randomUUID()}].slice(-5));
|
||||
}, []);
|
||||
const host = useMemo<BimHost>(() => ({
|
||||
apiBase: '/api/v1/bim', assets: {fragmentsWorker, mapWorker}, notify,
|
||||
}), [notify]);
|
||||
return <>
|
||||
<Suspense fallback={<Description role="status">Открываем архитектурные проекты…</Description>}>
|
||||
<Workspace host={host}/>
|
||||
</Suspense>
|
||||
<ToastStack items={toasts} onDismiss={id => setToasts(items => items.filter(item => item.id !== id))}/>
|
||||
</>;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
declare module '@nodedc/bim-viewer/fragments-worker?url' { const url: string; export default url; }
|
||||
declare module '@nodedc/bim-viewer/map-worker?url' { const url: string; export default url; }
|
||||
declare module '@nodedc/bim-viewer/style.css';
|
||||
Reference in New Issue
Block a user