@kerros/editor 0.0.0-stage → 0.1.0-rc.2
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/LICENSE +21 -0
- package/README.md +35 -2
- package/dist/SitePlanner.js +1189 -0
- package/dist/SitePlanner.js.map +1 -0
- package/dist/adapters/basemap.js +11 -0
- package/dist/adapters/basemap.js.map +1 -0
- package/dist/adapters/persistence.js +121 -0
- package/dist/adapters/persistence.js.map +1 -0
- package/dist/adapters/status.js +11 -0
- package/dist/adapters/status.js.map +1 -0
- package/dist/adapters/useProjectPersistence.js +56 -0
- package/dist/adapters/useProjectPersistence.js.map +1 -0
- package/dist/components/AiImportPanel.js +635 -0
- package/dist/components/AiImportPanel.js.map +1 -0
- package/dist/components/AnalysisPreview.js +179 -0
- package/dist/components/AnalysisPreview.js.map +1 -0
- package/dist/components/ElevatorPanel.js +120 -0
- package/dist/components/ElevatorPanel.js.map +1 -0
- package/dist/components/Icons.js +57 -0
- package/dist/components/Icons.js.map +1 -0
- package/dist/components/ImportDialog.js +467 -0
- package/dist/components/ImportDialog.js.map +1 -0
- package/dist/components/Inspector.js +1184 -0
- package/dist/components/Inspector.js.map +1 -0
- package/dist/components/NavigatePanel.js +301 -0
- package/dist/components/NavigatePanel.js.map +1 -0
- package/dist/components/NavigationGraph.js +234 -0
- package/dist/components/NavigationGraph.js.map +1 -0
- package/dist/components/StructureExplorer.js +510 -0
- package/dist/components/StructureExplorer.js.map +1 -0
- package/dist/components/StructureView.js +286 -0
- package/dist/components/StructureView.js.map +1 -0
- package/dist/components/controls.js +209 -0
- package/dist/components/controls.js.map +1 -0
- package/dist/components/graphLayout.js +27 -0
- package/dist/components/graphLayout.js.map +1 -0
- package/dist/host.js +175 -0
- package/dist/host.js.map +1 -0
- package/dist/i18n.js +88 -0
- package/dist/i18n.js.map +1 -0
- package/dist/import/analysisPreview.js +41 -0
- package/dist/import/analysisPreview.js.map +1 -0
- package/dist/import/brief.js +29 -0
- package/dist/import/brief.js.map +1 -0
- package/dist/import/checkpoint.js +50 -0
- package/dist/import/checkpoint.js.map +1 -0
- package/dist/import/detect.js +120 -0
- package/dist/import/detect.js.map +1 -0
- package/dist/import/documentSvg.js +49 -0
- package/dist/import/documentSvg.js.map +1 -0
- package/dist/import/instructions.js +20 -0
- package/dist/import/instructions.js.map +1 -0
- package/dist/import/openings.js +61 -0
- package/dist/import/openings.js.map +1 -0
- package/dist/import/planImport.js +233 -0
- package/dist/import/planImport.js.map +1 -0
- package/dist/import/register.js +47 -0
- package/dist/import/register.js.map +1 -0
- package/dist/import/runs.js +67 -0
- package/dist/import/runs.js.map +1 -0
- package/dist/import/session.js +23 -0
- package/dist/import/session.js.map +1 -0
- package/dist/import/types.js +13 -0
- package/dist/import/types.js.map +1 -0
- package/dist/import/usage.js +29 -0
- package/dist/import/usage.js.map +1 -0
- package/dist/import/walls.js +112 -0
- package/dist/import/walls.js.map +1 -0
- package/dist/index.js +178 -0
- package/dist/index.js.map +1 -0
- package/dist/map/CabinMaterials.js +81 -0
- package/dist/map/CabinMaterials.js.map +1 -0
- package/dist/map/CabinMirror.js +43 -0
- package/dist/map/CabinMirror.js.map +1 -0
- package/dist/map/Doors.js +80 -0
- package/dist/map/Doors.js.map +1 -0
- package/dist/map/ElevatorCabin.js +93 -0
- package/dist/map/ElevatorCabin.js.map +1 -0
- package/dist/map/FixtureLights.js +117 -0
- package/dist/map/FixtureLights.js.map +1 -0
- package/dist/map/MapCanvas.js +2161 -0
- package/dist/map/MapCanvas.js.map +1 -0
- package/dist/map/Passenger.js +69 -0
- package/dist/map/Passenger.js.map +1 -0
- package/dist/map/SceneLayer.js +1534 -0
- package/dist/map/SceneLayer.js.map +1 -0
- package/dist/map/UndergroundContext.js +153 -0
- package/dist/map/UndergroundContext.js.map +1 -0
- package/dist/map/ambience.js +194 -0
- package/dist/map/ambience.js.map +1 -0
- package/dist/map/architecture.js +305 -0
- package/dist/map/architecture.js.map +1 -0
- package/dist/map/bathMusic.js +92 -0
- package/dist/map/bathMusic.js.map +1 -0
- package/dist/map/cameraAim.js +33 -0
- package/dist/map/cameraAim.js.map +1 -0
- package/dist/map/elevators.js +56 -0
- package/dist/map/elevators.js.map +1 -0
- package/dist/map/excavation.js +52 -0
- package/dist/map/excavation.js.map +1 -0
- package/dist/map/exteriors.js +25 -0
- package/dist/map/exteriors.js.map +1 -0
- package/dist/map/features.js +218 -0
- package/dist/map/features.js.map +1 -0
- package/dist/map/fences.js +29 -0
- package/dist/map/fences.js.map +1 -0
- package/dist/map/journey.js +112 -0
- package/dist/map/journey.js.map +1 -0
- package/dist/map/levels.js +6 -0
- package/dist/map/levels.js.map +1 -0
- package/dist/map/lighting.js +143 -0
- package/dist/map/lighting.js.map +1 -0
- package/dist/map/loadBasemap.js +26 -0
- package/dist/map/loadBasemap.js.map +1 -0
- package/dist/map/materials.js +183 -0
- package/dist/map/materials.js.map +1 -0
- package/dist/map/poolLighting.js +39 -0
- package/dist/map/poolLighting.js.map +1 -0
- package/dist/map/projection.js +24 -0
- package/dist/map/projection.js.map +1 -0
- package/dist/map/rampGeometry.js +38 -0
- package/dist/map/rampGeometry.js.map +1 -0
- package/dist/map/route.js +107 -0
- package/dist/map/route.js.map +1 -0
- package/dist/map/stairSurfaces.js +115 -0
- package/dist/map/stairSurfaces.js.map +1 -0
- package/dist/map/surfaces.js +136 -0
- package/dist/map/surfaces.js.map +1 -0
- package/dist/map/textures.js +95 -0
- package/dist/map/textures.js.map +1 -0
- package/dist/map/underground.js +34 -0
- package/dist/map/underground.js.map +1 -0
- package/dist/map/walk.js +433 -0
- package/dist/map/walk.js.map +1 -0
- package/dist/map/walkContext.js +46 -0
- package/dist/map/walkContext.js.map +1 -0
- package/dist/map/walkDimensions.js +7 -0
- package/dist/map/walkDimensions.js.map +1 -0
- package/dist/map/walkJourney.js +85 -0
- package/dist/map/walkJourney.js.map +1 -0
- package/dist/map/walkSurfaces.js +106 -0
- package/dist/map/walkSurfaces.js.map +1 -0
- package/dist/map/wallJoins.js +70 -0
- package/dist/map/wallJoins.js.map +1 -0
- package/dist/map/water.js +274 -0
- package/dist/map/water.js.map +1 -0
- package/dist/model/authoring.js +99 -0
- package/dist/model/authoring.js.map +1 -0
- package/dist/model/boundaries.js +548 -0
- package/dist/model/boundaries.js.map +1 -0
- package/dist/model/coverage.js +30 -0
- package/dist/model/coverage.js.map +1 -0
- package/dist/model/document.js +52 -0
- package/dist/model/document.js.map +1 -0
- package/dist/model/doors.js +47 -0
- package/dist/model/doors.js.map +1 -0
- package/dist/model/factory.js +56 -0
- package/dist/model/factory.js.map +1 -0
- package/dist/model/geometry.js +454 -0
- package/dist/model/geometry.js.map +1 -0
- package/dist/model/history.js +29 -0
- package/dist/model/history.js.map +1 -0
- package/dist/model/imports.js +45 -0
- package/dist/model/imports.js.map +1 -0
- package/dist/model/inference.js +182 -0
- package/dist/model/inference.js.map +1 -0
- package/dist/model/materials.js +11 -0
- package/dist/model/materials.js.map +1 -0
- package/dist/model/mutations.js +157 -0
- package/dist/model/mutations.js.map +1 -0
- package/dist/model/navigation.js +275 -0
- package/dist/model/navigation.js.map +1 -0
- package/dist/model/ontology.js +109 -0
- package/dist/model/ontology.js.map +1 -0
- package/dist/model/passages.js +5 -0
- package/dist/model/passages.js.map +1 -0
- package/dist/model/portals.js +42 -0
- package/dist/model/portals.js.map +1 -0
- package/dist/model/precision.js +11 -0
- package/dist/model/precision.js.map +1 -0
- package/dist/model/project.js +31 -0
- package/dist/model/project.js.map +1 -0
- package/dist/model/ramps.js +10 -0
- package/dist/model/ramps.js.map +1 -0
- package/dist/model/roomNavigation.js +87 -0
- package/dist/model/roomNavigation.js.map +1 -0
- package/dist/model/routeClearance.js +72 -0
- package/dist/model/routeClearance.js.map +1 -0
- package/dist/model/spaces.js +104 -0
- package/dist/model/spaces.js.map +1 -0
- package/dist/model/stairGeometry.js +40 -0
- package/dist/model/stairGeometry.js.map +1 -0
- package/dist/model/stairTraversal.js +48 -0
- package/dist/model/stairTraversal.js.map +1 -0
- package/dist/model/topology.js +63 -0
- package/dist/model/topology.js.map +1 -0
- package/dist/model/types.js +35 -0
- package/dist/model/types.js.map +1 -0
- package/dist/model/validate.js +240 -0
- package/dist/model/validate.js.map +1 -0
- package/dist/model/vertical.js +129 -0
- package/dist/model/vertical.js.map +1 -0
- package/dist/model/walls.js +261 -0
- package/dist/model/walls.js.map +1 -0
- package/dist/planner/DrawingDock.js +231 -0
- package/dist/planner/DrawingDock.js.map +1 -0
- package/dist/planner/FloorControls.js +93 -0
- package/dist/planner/FloorControls.js.map +1 -0
- package/dist/planner/MapSettings.js +143 -0
- package/dist/planner/MapSettings.js.map +1 -0
- package/dist/planner/PlannerHelp.js +57 -0
- package/dist/planner/PlannerHelp.js.map +1 -0
- package/dist/planner/ProjectSidebar.js +246 -0
- package/dist/planner/ProjectSidebar.js.map +1 -0
- package/dist/planner/floors.js +18 -0
- package/dist/planner/floors.js.map +1 -0
- package/dist/planner/useDrawingTools.js +341 -0
- package/dist/planner/useDrawingTools.js.map +1 -0
- package/dist/planner/useMapDisplay.js +51 -0
- package/dist/planner/useMapDisplay.js.map +1 -0
- package/dist/planner/usePlannerKeyboard.js +138 -0
- package/dist/planner/usePlannerKeyboard.js.map +1 -0
- package/dist/planner/useReferenceAlignment.js +50 -0
- package/dist/planner/useReferenceAlignment.js.map +1 -0
- package/dist/styles.css +4931 -0
- package/dist/theme/index.js +34 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/types/SitePlanner.d.ts +5 -0
- package/dist/types/adapters/basemap.d.ts +2 -0
- package/dist/types/adapters/persistence.d.ts +29 -0
- package/dist/types/adapters/status.d.ts +4 -0
- package/dist/types/adapters/useProjectPersistence.d.ts +13 -0
- package/dist/types/components/AiImportPanel.d.ts +9 -0
- package/dist/types/components/AnalysisPreview.d.ts +4 -0
- package/dist/types/components/ElevatorPanel.d.ts +18 -0
- package/dist/types/components/Icons.d.ts +8 -0
- package/dist/types/components/ImportDialog.d.ts +42 -0
- package/dist/types/components/Inspector.d.ts +38 -0
- package/dist/types/components/NavigatePanel.d.ts +27 -0
- package/dist/types/components/NavigationGraph.d.ts +10 -0
- package/dist/types/components/StructureExplorer.d.ts +8 -0
- package/dist/types/components/StructureView.d.ts +22 -0
- package/dist/types/components/controls.d.ts +52 -0
- package/dist/types/components/graphLayout.d.ts +9 -0
- package/dist/types/editor/host.d.ts +9 -0
- package/dist/types/editor/index.d.ts +2 -0
- package/dist/types/i18n.d.ts +85 -0
- package/dist/types/import/analysisPreview.d.ts +27 -0
- package/dist/types/import/brief.d.ts +22 -0
- package/dist/types/import/checkpoint.d.ts +49 -0
- package/dist/types/import/detect.d.ts +34 -0
- package/dist/types/import/documentSvg.d.ts +2 -0
- package/dist/types/import/index.d.ts +10 -0
- package/dist/types/import/instructions.d.ts +7 -0
- package/dist/types/import/openings.d.ts +22 -0
- package/dist/types/import/planImport.d.ts +22 -0
- package/dist/types/import/register.d.ts +25 -0
- package/dist/types/import/runs.d.ts +31 -0
- package/dist/types/import/session.d.ts +33 -0
- package/dist/types/import/types.d.ts +56 -0
- package/dist/types/import/usage.d.ts +10 -0
- package/dist/types/import/walls.d.ts +37 -0
- package/dist/types/map/CabinMaterials.d.ts +18 -0
- package/dist/types/map/CabinMirror.d.ts +13 -0
- package/dist/types/map/Doors.d.ts +11 -0
- package/dist/types/map/ElevatorCabin.d.ts +20 -0
- package/dist/types/map/FixtureLights.d.ts +35 -0
- package/dist/types/map/MapCanvas.d.ts +87 -0
- package/dist/types/map/Passenger.d.ts +18 -0
- package/dist/types/map/SceneLayer.d.ts +306 -0
- package/dist/types/map/UndergroundContext.d.ts +18 -0
- package/dist/types/map/ambience.d.ts +29 -0
- package/dist/types/map/architecture.d.ts +8 -0
- package/dist/types/map/bathMusic.d.ts +14 -0
- package/dist/types/map/cameraAim.d.ts +20 -0
- package/dist/types/map/elevators.d.ts +16 -0
- package/dist/types/map/excavation.d.ts +9 -0
- package/dist/types/map/exteriors.d.ts +3 -0
- package/dist/types/map/features.d.ts +33 -0
- package/dist/types/map/fences.d.ts +4 -0
- package/dist/types/map/journey.d.ts +36 -0
- package/dist/types/map/levels.d.ts +4 -0
- package/dist/types/map/lighting.d.ts +103 -0
- package/dist/types/map/loadBasemap.d.ts +4 -0
- package/dist/types/map/materials.d.ts +38 -0
- package/dist/types/map/poolLighting.d.ts +11 -0
- package/dist/types/map/projection.d.ts +9 -0
- package/dist/types/map/rampGeometry.d.ts +8 -0
- package/dist/types/map/route.d.ts +59 -0
- package/dist/types/map/stairSurfaces.d.ts +29 -0
- package/dist/types/map/surfaces.d.ts +36 -0
- package/dist/types/map/textures.d.ts +8 -0
- package/dist/types/map/underground.d.ts +30 -0
- package/dist/types/map/walk.d.ts +232 -0
- package/dist/types/map/walkContext.d.ts +11 -0
- package/dist/types/map/walkDimensions.d.ts +5 -0
- package/dist/types/map/walkJourney.d.ts +33 -0
- package/dist/types/map/walkSurfaces.d.ts +27 -0
- package/dist/types/map/wallJoins.d.ts +6 -0
- package/dist/types/map/water.d.ts +12 -0
- package/dist/types/model/authoring.d.ts +38 -0
- package/dist/types/model/boundaries.d.ts +41 -0
- package/dist/types/model/coverage.d.ts +8 -0
- package/dist/types/model/document.d.ts +9 -0
- package/dist/types/model/doors.d.ts +19 -0
- package/dist/types/model/factory.d.ts +5 -0
- package/dist/types/model/geometry.d.ts +99 -0
- package/dist/types/model/history.d.ts +10 -0
- package/dist/types/model/host.d.ts +154 -0
- package/dist/types/model/imports.d.ts +7 -0
- package/dist/types/model/inference.d.ts +46 -0
- package/dist/types/model/live.d.ts +60 -0
- package/dist/types/model/materials.d.ts +28 -0
- package/dist/types/model/mutations.d.ts +178 -0
- package/dist/types/model/navigation.d.ts +70 -0
- package/dist/types/model/ontology.d.ts +43 -0
- package/dist/types/model/passages.d.ts +2 -0
- package/dist/types/model/portals.d.ts +9 -0
- package/dist/types/model/precision.d.ts +11 -0
- package/dist/types/model/project.d.ts +8 -0
- package/dist/types/model/ramps.d.ts +7 -0
- package/dist/types/model/roomNavigation.d.ts +15 -0
- package/dist/types/model/routeClearance.d.ts +11 -0
- package/dist/types/model/spaces.d.ts +46 -0
- package/dist/types/model/stairGeometry.d.ts +27 -0
- package/dist/types/model/stairTraversal.d.ts +8 -0
- package/dist/types/model/topology.d.ts +14 -0
- package/dist/types/model/types.d.ts +369 -0
- package/dist/types/model/validate.d.ts +38 -0
- package/dist/types/model/vertical.d.ts +145 -0
- package/dist/types/model/walls.d.ts +71 -0
- package/dist/types/planner/DrawingDock.d.ts +16 -0
- package/dist/types/planner/FloorControls.d.ts +17 -0
- package/dist/types/planner/MapSettings.d.ts +16 -0
- package/dist/types/planner/PlannerHelp.d.ts +3 -0
- package/dist/types/planner/ProjectSidebar.d.ts +32 -0
- package/dist/types/planner/floors.d.ts +3 -0
- package/dist/types/planner/types.d.ts +3 -0
- package/dist/types/planner/useDrawingTools.d.ts +52 -0
- package/dist/types/planner/useMapDisplay.d.ts +29 -0
- package/dist/types/planner/usePlannerKeyboard.d.ts +18 -0
- package/dist/types/planner/useReferenceAlignment.d.ts +30 -0
- package/dist/types/schema/index.d.ts +25 -0
- package/dist/types/theme/index.d.ts +55 -0
- package/package.json +58 -4
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as u, useState as i, useEffect as m, useContext as f, useMemo as d } from "react";
|
|
3
|
+
import { en as s } from "../i18n.js";
|
|
4
|
+
function h() {
|
|
5
|
+
const [e, r] = i(() => localStorage.getItem("kerros:dark") === "1");
|
|
6
|
+
return m(() => {
|
|
7
|
+
document.documentElement.classList.toggle("dark", e), localStorage.setItem("kerros:dark", e ? "1" : "0");
|
|
8
|
+
}, [e]), [e, () => r((o) => !o)];
|
|
9
|
+
}
|
|
10
|
+
const c = u({});
|
|
11
|
+
function j({ theme: e = {}, children: r }) {
|
|
12
|
+
const o = Object.fromEntries(
|
|
13
|
+
Object.entries(e.tokens ?? {}).map(([t, a]) => [t.startsWith("--") ? t : `--${t}`, a])
|
|
14
|
+
);
|
|
15
|
+
return /* @__PURE__ */ n(c.Provider, { value: e, children: /* @__PURE__ */ n("div", { className: "kerros-root kerros-passthrough", style: o, children: r }) });
|
|
16
|
+
}
|
|
17
|
+
const l = () => f(c);
|
|
18
|
+
function v() {
|
|
19
|
+
const { strings: e } = l();
|
|
20
|
+
return d(() => {
|
|
21
|
+
if (!e) return s;
|
|
22
|
+
const r = { ...s };
|
|
23
|
+
for (const [o, t] of Object.entries(e))
|
|
24
|
+
r[o] = t && typeof t == "object" && !Array.isArray(t) ? { ...s[o], ...t } : t;
|
|
25
|
+
return r;
|
|
26
|
+
}, [e]);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
j as KerrosThemeProvider,
|
|
30
|
+
h as useDarkMode,
|
|
31
|
+
l as useKerrosTheme,
|
|
32
|
+
v as useStrings
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/theme/index.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n type ComponentType,\n type CSSProperties,\n type ReactNode,\n} from 'react';\nimport type { SiteObject } from '../model/types';\nimport type { StatusTone } from '../model/live';\nimport { en, type En } from '../i18n';\n\ntype DeepPartial<T> = { [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K] };\n\n/** App-wide dark mode: a `dark` class on the root element, remembered per browser. */\nexport function useDarkMode(): [boolean, () => void] {\n const [dark, setDark] = useState(() => localStorage.getItem('kerros:dark') === '1');\n useEffect(() => {\n document.documentElement.classList.toggle('dark', dark);\n localStorage.setItem('kerros:dark', dark ? '1' : '0');\n }, [dark]);\n return [dark, () => setDark(d => !d)];\n}\n\n// ——— Theming & pluggable chrome. Hosts wrap the viewer/editor in <KerrosThemeProvider> to override\n// design tokens, supply custom icons, and route notifications/confirms into their own UI. Every\n// field is optional; unset falls back to the built-in default, so the components work with no theme.\nexport interface ConfirmOptions {\n title: string;\n body?: string;\n danger?: boolean;\n confirmLabel?: string;\n}\n/** Plan/route/device rendering colours, per deployment (\"operation model\"). Basemap is separate (BasemapConfig). */\nexport interface MapStyleOptions {\n /** Plan area fill and wall colour (top-down 2D). */\n room?: string;\n wall?: string;\n route?: string;\n routeActive?: string;\n /** Selection/hover/draft highlight colours, applied on both the 2D plan and the 3D scene. */\n selection?: string;\n /** Soft (translucent) selection fill for areas; defaults to a light tint of the selection colour. */\n selectionFill?: string;\n hover?: string;\n draft?: string;\n statusTones?: Partial<Record<StatusTone, string>>;\n /** Last-word override for any area/object fill and marker accent; return undefined to fall through. */\n objectColor?: (object: SiteObject) => string | undefined;\n}\nexport interface KerrosTheme {\n /** CSS custom-property overrides (e.g. { '--accent': '#e8562f' }); applied to the theme wrapper. */\n tokens?: Record<string, string>;\n /** Per kind/tool/POI-symbol icon overrides; keys match EntityIcon's `kind`/`symbol`. */\n icons?: Record<string, ComponentType<{ size?: number }>>;\n /** Show a transient notification. Unset → the built-in toast. */\n notify?: (message: string, tone?: 'info' | 'error') => void;\n /** Ask the user to confirm a destructive action. Unset → the built-in dialog. */\n confirm?: (options: ConfirmOptions) => Promise<boolean>;\n /** Plan/route/device rendering colours. */\n mapStyle?: MapStyleOptions;\n /** Override any library UI strings (deep-merged over the built-in English); read via useStrings(). */\n strings?: DeepPartial<En>;\n}\nconst ThemeContext = createContext<KerrosTheme>({});\nexport function KerrosThemeProvider({ theme = {}, children }: { theme?: KerrosTheme; children: ReactNode }) {\n // Only the tokens are inline — they are the one genuinely dynamic part. The wrapper's layout role\n // (none: display:contents) is .kerros-passthrough in the stylesheet, kept apart from .kerros-root so\n // that \"scope for the resets\" and \"box in the layout\" stay two separate, legible ideas.\n const style = Object.fromEntries(\n Object.entries(theme.tokens ?? {}).map(([k, v]) => [k.startsWith('--') ? k : `--${k}`, v]),\n ) as CSSProperties;\n return (\n <ThemeContext.Provider value={theme}>\n <div className=\"kerros-root kerros-passthrough\" style={style}>\n {children}\n </div>\n </ThemeContext.Provider>\n );\n}\nexport const useKerrosTheme = () => useContext(ThemeContext);\n\n// Library UI strings with the host's overrides deep-merged over the built-in English (one level of\n// nesting — tools/navigate/map — is enough for the current dictionary).\nexport function useStrings(): En {\n const { strings } = useKerrosTheme();\n return useMemo(() => {\n if (!strings) return en;\n const out = { ...en } as Record<string, unknown>;\n for (const [k, v] of Object.entries(strings))\n out[k] =\n v && typeof v === 'object' && !Array.isArray(v)\n ? { ...((en as Record<string, unknown>)[k] as object), ...v }\n : v;\n return out as En;\n }, [strings]);\n}\n"],"names":["useDarkMode","dark","setDark","useState","useEffect","d","ThemeContext","createContext","KerrosThemeProvider","theme","children","style","k","v","jsx","useKerrosTheme","useContext","useStrings","strings","useMemo","en","out"],"mappings":";;;AAiBO,SAASA,IAAqC;AACnD,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAS,MAAM,aAAa,QAAQ,aAAa,MAAM,GAAG;AAClF,SAAAC,EAAU,MAAM;AACd,aAAS,gBAAgB,UAAU,OAAO,QAAQH,CAAI,GACtD,aAAa,QAAQ,eAAeA,IAAO,MAAM,GAAG;AAAA,EACtD,GAAG,CAACA,CAAI,CAAC,GACF,CAACA,GAAM,MAAMC,EAAQ,CAAAG,MAAK,CAACA,CAAC,CAAC;AACtC;AA0CA,MAAMC,IAAeC,EAA2B,EAAE;AAC3C,SAASC,EAAoB,EAAE,OAAAC,IAAQ,CAAA,GAAI,UAAAC,KAA0D;AAI1G,QAAMC,IAAQ,OAAO;AAAA,IACnB,OAAO,QAAQF,EAAM,UAAU,CAAA,CAAE,EAAE,IAAI,CAAC,CAACG,GAAGC,CAAC,MAAM,CAACD,EAAE,WAAW,IAAI,IAAIA,IAAI,KAAKA,CAAC,IAAIC,CAAC,CAAC;AAAA,EAAA;AAE3F,SACE,gBAAAC,EAACR,EAAa,UAAb,EAAsB,OAAOG,GAC5B,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAU,kCAAiC,OAAAH,GAC7C,UAAAD,EAAA,CACH,GACF;AAEJ;AACO,MAAMK,IAAiB,MAAMC,EAAWV,CAAY;AAIpD,SAASW,IAAiB;AAC/B,QAAM,EAAE,SAAAC,EAAA,IAAYH,EAAA;AACpB,SAAOI,EAAQ,MAAM;AACnB,QAAI,CAACD,EAAS,QAAOE;AACrB,UAAMC,IAAM,EAAE,GAAGD,EAAA;AACjB,eAAW,CAACR,GAAGC,CAAC,KAAK,OAAO,QAAQK,CAAO;AACzC,MAAAG,EAAIT,CAAC,IACHC,KAAK,OAAOA,KAAM,YAAY,CAAC,MAAM,QAAQA,CAAC,IAC1C,EAAE,GAAKO,EAA+BR,CAAC,GAAc,GAAGC,MACxDA;AACR,WAAOQ;AAAA,EACT,GAAG,CAACH,CAAO,CAAC;AACd;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SitePlannerProps } from './model/host';
|
|
2
|
+
export declare function SitePlanner({ project: initial, adapters, onChange, onSelectionChange, onBack, initialView, onViewChange, onModeChange, renderStatusPanel, elevators, readOnly, }: SitePlannerProps & {
|
|
3
|
+
readOnly?: boolean;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function SiteViewer(props: SitePlannerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AssetRepository, ProjectDocument, ProjectRepository, ProjectSummary } from '../model/types';
|
|
2
|
+
export { validateProject } from '../model/validate';
|
|
3
|
+
export { exportProject, importProject, blobDataUrl } from '../model/document';
|
|
4
|
+
export declare class LocalProjectRepository implements ProjectRepository {
|
|
5
|
+
list(): Promise<ProjectSummary[]>;
|
|
6
|
+
load(id: string): Promise<ProjectDocument | null>;
|
|
7
|
+
save(project: ProjectDocument): Promise<void>;
|
|
8
|
+
delete(id: string): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
/** Large documents belong in IndexedDB rather than localStorage's small synchronous quota.
|
|
11
|
+
* An optional previous repository keeps existing browser saves readable; new saves take precedence. */
|
|
12
|
+
export declare class IndexedProjectRepository implements ProjectRepository {
|
|
13
|
+
private previous?;
|
|
14
|
+
private db?;
|
|
15
|
+
constructor(previous?: ProjectRepository | undefined);
|
|
16
|
+
private open;
|
|
17
|
+
list(): Promise<ProjectSummary[]>;
|
|
18
|
+
load(id: string): Promise<ProjectDocument | null>;
|
|
19
|
+
private write;
|
|
20
|
+
save(project: ProjectDocument): Promise<void>;
|
|
21
|
+
delete(id: string): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export declare class IndexedAssetRepository implements AssetRepository {
|
|
24
|
+
private db?;
|
|
25
|
+
private open;
|
|
26
|
+
get(id: string): Promise<Blob | undefined>;
|
|
27
|
+
put(id: string, asset: Blob): Promise<void>;
|
|
28
|
+
delete(id: string): Promise<void>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StatusReading, StatusTone } from '../model/live';
|
|
2
|
+
export declare const unknownStatus: (feedId: string) => StatusReading;
|
|
3
|
+
export declare function statusTone(status?: StatusReading, now?: number): StatusTone;
|
|
4
|
+
export declare function statusLabel(status?: StatusReading, now?: number): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ProjectDocument, ProjectRepository } from '../model/types';
|
|
2
|
+
/** Orders writes even when a future server repository responds slowly. */
|
|
3
|
+
export declare class ProjectWriter {
|
|
4
|
+
private readonly repository;
|
|
5
|
+
private queue;
|
|
6
|
+
constructor(repository: ProjectRepository);
|
|
7
|
+
save(project: ProjectDocument): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function useProjectPersistence(project: ProjectDocument, repository: ProjectRepository, enabled: boolean, onError: (message: string) => void): {
|
|
10
|
+
state: "error" | "saved" | "saving";
|
|
11
|
+
flush: () => Promise<void>;
|
|
12
|
+
saveNow: (snapshot: ProjectDocument) => Promise<void>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AiImportAdapter } from '../model/host';
|
|
2
|
+
import type { AssetRepository, ProjectDocument } from '../model/types';
|
|
3
|
+
export declare function AiImportPanel({ adapter, assets, onProject, onRunningChange, currentProject, }: {
|
|
4
|
+
adapter: AiImportAdapter;
|
|
5
|
+
assets: AssetRepository;
|
|
6
|
+
onProject: (project: ProjectDocument) => void | Promise<void>;
|
|
7
|
+
onRunningChange: (running: boolean) => void;
|
|
8
|
+
currentProject: ProjectDocument;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ElevatorControls } from '../model/host';
|
|
2
|
+
import type { ProjectDocument } from '../model/types';
|
|
3
|
+
import type { WalkController } from '../map/walk';
|
|
4
|
+
export declare function ElevatorPanel({ project, floorId, controls, walker, riding, onRide, onFloor, requested, onWave, soundOn, onSound, }: {
|
|
5
|
+
project: ProjectDocument;
|
|
6
|
+
floorId: string | null;
|
|
7
|
+
controls: ElevatorControls;
|
|
8
|
+
walker: {
|
|
9
|
+
current: WalkController | null;
|
|
10
|
+
};
|
|
11
|
+
riding: string | null;
|
|
12
|
+
onRide(id: string | null): void;
|
|
13
|
+
onFloor?(id: string): void;
|
|
14
|
+
requested: number;
|
|
15
|
+
onWave(): void;
|
|
16
|
+
soundOn: boolean;
|
|
17
|
+
onSound(): void;
|
|
18
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ObjectKind, SiteObject, Tool } from '../model/types';
|
|
2
|
+
export declare function EntityIcon({ kind, size, symbol, travel, }: {
|
|
3
|
+
kind: ObjectKind | Tool | 'wall' | 'fence';
|
|
4
|
+
size?: number;
|
|
5
|
+
symbol?: SiteObject['symbol'];
|
|
6
|
+
/** An escalator's direction, so a descending one is not drawn with an arrow pointing up. */
|
|
7
|
+
travel?: SiteObject['travel'];
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AssetRepository, Drawing, Point, ProjectDocument } from '../model/types';
|
|
2
|
+
import type { AiImportAdapter, ImportProjection, PdfDrawingAdapter } from '../model/host';
|
|
3
|
+
import type { PlanEntity } from '../import/planImport';
|
|
4
|
+
import type { PlanLayerMap } from '../import/types';
|
|
5
|
+
export interface PreparedDrawing {
|
|
6
|
+
blob: Blob;
|
|
7
|
+
name: string;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function ImportDialog({ project, floorId, assets, onClose, onProject, onAiProject, onAiRunningChange, onFootprints, onDrawing, onPlan, onOrigin, importProjections, aiImport, pdfDrawing, mode, }: {
|
|
12
|
+
project: ProjectDocument;
|
|
13
|
+
floorId: string | null;
|
|
14
|
+
assets: AssetRepository;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
onProject: (p: ProjectDocument) => void | Promise<void>;
|
|
17
|
+
onAiProject?: (p: ProjectDocument) => void | Promise<void>;
|
|
18
|
+
onAiRunningChange?: (running: boolean) => void;
|
|
19
|
+
onFootprints: (objects: ProjectDocument['objects']) => void;
|
|
20
|
+
onDrawing: (drawing: PreparedDrawing) => void | Promise<void>;
|
|
21
|
+
/** CAD plan entities (metres, extracted host-side — see scripts/plan-import). The handler builds
|
|
22
|
+
* walls, rooms and openings on the chosen floor through the editor's transactional commit. */
|
|
23
|
+
onPlan?: (entities: PlanEntity[], floorId: string | null, layers?: PlanLayerMap) => void;
|
|
24
|
+
/** Turn the site to a new bearing (degrees clockwise from north) before the plan is applied. */
|
|
25
|
+
onOrigin?: (bearing: number) => void;
|
|
26
|
+
importProjections?: ImportProjection[];
|
|
27
|
+
aiImport?: AiImportAdapter;
|
|
28
|
+
pdfDrawing?: PdfDrawingAdapter;
|
|
29
|
+
mode?: 'reference' | 'plan';
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
|
+
export declare function AlignmentPanel({ drawing, mapPoints, imagePoints, setImagePoints, onCancel, onPreview, onConfirm, onKnownDistance, preview, }: {
|
|
32
|
+
drawing: PreparedDrawing;
|
|
33
|
+
mapPoints: Point[];
|
|
34
|
+
imagePoints: Point[];
|
|
35
|
+
setImagePoints: (points: Point[]) => void;
|
|
36
|
+
onCancel: () => void;
|
|
37
|
+
onPreview: () => void;
|
|
38
|
+
onConfirm: () => void;
|
|
39
|
+
onKnownDistance: (metres: number) => void;
|
|
40
|
+
preview: boolean;
|
|
41
|
+
}): import("react").JSX.Element;
|
|
42
|
+
export declare const makeDrawing: (prepared: PreparedDrawing, floorId: string | null) => Drawing;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Barrier, Drawing, Floor, ProjectDocument, SiteObject } from '../model/types';
|
|
3
|
+
import type { StatusReading } from '../model/live';
|
|
4
|
+
import type { StatusPanelContext } from '../model/host';
|
|
5
|
+
export interface InspectorProps {
|
|
6
|
+
project: ProjectDocument;
|
|
7
|
+
floorId: string | null;
|
|
8
|
+
selected: string | null;
|
|
9
|
+
statuses: Map<string, StatusReading>;
|
|
10
|
+
/** Whether the host supplied a StatusFeed at all. False hides every live-status surface — a
|
|
11
|
+
* rollup of bindings that can only ever read "unknown" is worse than no rollup. */
|
|
12
|
+
monitoring: boolean;
|
|
13
|
+
editing: boolean;
|
|
14
|
+
live: boolean;
|
|
15
|
+
renderStatusPanel?: (ctx: StatusPanelContext) => ReactNode;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
onUpdateObject: (id: string, patch: Partial<SiteObject>) => void;
|
|
18
|
+
/** Apply an arbitrary change through the host's commit/undo path — used for the ontology, which
|
|
19
|
+
* edits entities beside the object rather than fields on it. */
|
|
20
|
+
onEdit?: (change: (draft: ProjectDocument) => void) => void;
|
|
21
|
+
/** Editing operations are supplied by the editor, so read-only consumers need no authoring engine. */
|
|
22
|
+
onSpaceGeometry?: (id: string, source: 'outline' | 'walls' | 'independent') => void;
|
|
23
|
+
onShiftOrigin?: (east: number, north: number) => void;
|
|
24
|
+
onUpdateBarrier: (id: string, patch: Partial<Barrier>) => void;
|
|
25
|
+
onUpdateDrawing: (id: string, patch: Partial<Drawing>) => void;
|
|
26
|
+
onUpdateFloor: (id: string, patch: Partial<Floor>) => void;
|
|
27
|
+
/** Set (or clear, with null) the floor a viewer opens this document on. */
|
|
28
|
+
onSetInitialFloor: (id: string | null) => void;
|
|
29
|
+
/** Remove a floor and everything on it (confirms first). */
|
|
30
|
+
onDeleteFloor: (id: string) => void;
|
|
31
|
+
onDuplicate: () => void;
|
|
32
|
+
onDelete: () => void;
|
|
33
|
+
onSelect: (id: string) => void;
|
|
34
|
+
/** Open a floor — a lift's levels are the one relation that crosses them. */
|
|
35
|
+
onFloor: (id: string) => void;
|
|
36
|
+
onTraceFootprint: (id: string) => void;
|
|
37
|
+
}
|
|
38
|
+
export declare function Inspector(props: InspectorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Point, ProjectDocument } from '../model/types';
|
|
2
|
+
import type { Route } from '../model/navigation';
|
|
3
|
+
export interface NavigatePanelProps {
|
|
4
|
+
project: ProjectDocument;
|
|
5
|
+
/** Where the person is — the walk's avatar — offered as "Where you are" and proposed as the
|
|
6
|
+
* start whenever nothing else has been chosen. Null when nobody has walked yet. */
|
|
7
|
+
here?: {
|
|
8
|
+
floorId: string | null;
|
|
9
|
+
position: Point;
|
|
10
|
+
} | null;
|
|
11
|
+
from: string | null;
|
|
12
|
+
to: string | null;
|
|
13
|
+
route: Route | null;
|
|
14
|
+
playing: boolean;
|
|
15
|
+
activeStep: number | null;
|
|
16
|
+
editing: boolean;
|
|
17
|
+
onFrom: (id: string | null) => void;
|
|
18
|
+
onTo: (id: string | null) => void;
|
|
19
|
+
onSwap: () => void;
|
|
20
|
+
onClear: () => void;
|
|
21
|
+
onPlay: () => void;
|
|
22
|
+
onPause: () => void;
|
|
23
|
+
onStep: (delta: 1 | -1) => void;
|
|
24
|
+
onSeek: (index: number) => void;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function NavigatePanel({ project, here, from, to, route, playing, activeStep, editing, onFrom, onTo, onSwap, onClear, onPlay, onPause, onStep, onSeek, onClose, }: NavigatePanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ProjectDocument } from '../model/types';
|
|
2
|
+
import type { StructureTarget } from './StructureView';
|
|
3
|
+
export interface NavigationGraphProps {
|
|
4
|
+
project: ProjectDocument;
|
|
5
|
+
initialFloor?: string | null;
|
|
6
|
+
dark: boolean;
|
|
7
|
+
onLocate: (target: StructureTarget) => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function NavigationGraph({ project, initialFloor, dark, onLocate, onClose }: NavigationGraphProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { StructureViewProps } from './StructureView';
|
|
3
|
+
export declare function StructureExplorer({ project, selected, onSelect, onFloorChange, onLocate, onGraphView, renderZones, }: StructureViewProps & {
|
|
4
|
+
renderZones: (filter: {
|
|
5
|
+
query: string;
|
|
6
|
+
floor: string;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Point, type ProjectDocument, type SiteObject, type Zone } from '../model/types';
|
|
2
|
+
export interface StructureViewProps {
|
|
3
|
+
project: ProjectDocument;
|
|
4
|
+
selected?: string | null;
|
|
5
|
+
/** Fires when a space or opening is picked, so a host can follow along on the plan. */
|
|
6
|
+
onSelect?: (id: string) => void;
|
|
7
|
+
/** Fires alongside onSelect when the pick lives on a particular floor. */
|
|
8
|
+
onFloorChange?: (floorId: string | null) => void;
|
|
9
|
+
onLocate?: (target: StructureTarget) => void;
|
|
10
|
+
onGraphView?: (floorId?: string | null) => void;
|
|
11
|
+
/** Omit to keep the panel read-only. Given, the panel can author zones: the host applies the
|
|
12
|
+
* mutation to a draft and owns undo, exactly as the map tools do. */
|
|
13
|
+
onEdit?: (change: (draft: ProjectDocument) => void) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface StructureTarget {
|
|
16
|
+
objectIds?: string[];
|
|
17
|
+
floorId?: string | null;
|
|
18
|
+
position?: Point;
|
|
19
|
+
}
|
|
20
|
+
export declare function StructureView(props: StructureViewProps): import("react").JSX.Element;
|
|
21
|
+
/** Exported for hosts that want the same grouping without the chrome. */
|
|
22
|
+
export declare const zoneMembers: (project: ProjectDocument, zone: Zone) => SiteObject[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export declare function Modal({ title, subtitle, onClose, children, wide, fullscreen, }: {
|
|
3
|
+
title: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
wide?: boolean;
|
|
8
|
+
fullscreen?: boolean;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function Field({ label, value, onChange, type, suffix, min, max, step, }: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string | number;
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
type?: string;
|
|
15
|
+
suffix?: string;
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
step?: number;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
export declare function Toggle({ label, value, onChange, description, }: {
|
|
21
|
+
label: string;
|
|
22
|
+
value: boolean;
|
|
23
|
+
onChange: () => void;
|
|
24
|
+
description?: string;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
/** A row of mutually exclusive choices, for a setting that has three answers rather than two.
|
|
27
|
+
* Same shape as `Toggle` — label, optional description, the control on the right — so a panel of
|
|
28
|
+
* switches does not acquire a second visual language for the one setting that needs a third state. */
|
|
29
|
+
export declare function Choice<T extends string>({ label, value, options, onChange, description, }: {
|
|
30
|
+
label: string;
|
|
31
|
+
value: T;
|
|
32
|
+
options: {
|
|
33
|
+
value: T;
|
|
34
|
+
label: string;
|
|
35
|
+
title?: string;
|
|
36
|
+
}[];
|
|
37
|
+
onChange: (value: T) => void;
|
|
38
|
+
description?: string;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
/** Searchable dropdown for level selection: projects like the Silo carry a hundred floors. */
|
|
41
|
+
export interface FloorEntry {
|
|
42
|
+
id: string;
|
|
43
|
+
code: string;
|
|
44
|
+
name: string;
|
|
45
|
+
hint?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function FloorSelect({ entries, value, onPick, ariaLabel, }: {
|
|
48
|
+
entries: FloorEntry[];
|
|
49
|
+
value: string;
|
|
50
|
+
onPick: (id: string) => void;
|
|
51
|
+
ariaLabel: string;
|
|
52
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface GraphPoint {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
vx: number;
|
|
5
|
+
vy: number;
|
|
6
|
+
pinned?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Bounded sampled repulsion keeps large navigation graphs out of quadratic per-frame work. */
|
|
9
|
+
export declare function balanceGraph(points: GraphPoint[], links: [number, number][], tick: number): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { ProjectRepository, AssetRepository, Tool } from '../model/types';
|
|
2
|
+
export type { StatusFeed, StatusReading, StatusMetrics, StatusTone } from '../model/live';
|
|
3
|
+
export type { SitePlannerProps, ElevatorControls, PlannerAdapters, AiImportAdapter, PdfDrawingAdapter, BasemapConfig, BasemapVectorSchema, PlannerMode, StatusPanelContext, ImportProjection, ViewState, CameraState, } from '../model/host';
|
|
4
|
+
export { LocalProjectRepository, IndexedProjectRepository, IndexedAssetRepository } from '../adapters/persistence';
|
|
5
|
+
export { neutralBasemap } from '../adapters/basemap';
|
|
6
|
+
export { KerrosThemeProvider, useKerrosTheme, useDarkMode, useStrings, type KerrosTheme, type MapStyleOptions, type ConfirmOptions, } from '../theme';
|
|
7
|
+
export * from '../schema';
|
|
8
|
+
export * from '../import';
|
|
9
|
+
export { StructureView, type StructureViewProps, type StructureTarget } from '../components/StructureView';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export declare const en: {
|
|
2
|
+
app: string;
|
|
3
|
+
brand: string;
|
|
4
|
+
viewer: string;
|
|
5
|
+
editor: string;
|
|
6
|
+
monitor: string;
|
|
7
|
+
overview: string;
|
|
8
|
+
floors: string;
|
|
9
|
+
drawings: string;
|
|
10
|
+
objects: string;
|
|
11
|
+
import: string;
|
|
12
|
+
export: string;
|
|
13
|
+
saved: string;
|
|
14
|
+
saving: string;
|
|
15
|
+
saveError: string;
|
|
16
|
+
outdoors: string;
|
|
17
|
+
tools: {
|
|
18
|
+
select: string;
|
|
19
|
+
pan: string;
|
|
20
|
+
wall: string;
|
|
21
|
+
boundary: string;
|
|
22
|
+
partition: string;
|
|
23
|
+
fence: string;
|
|
24
|
+
zone: string;
|
|
25
|
+
room: string;
|
|
26
|
+
rectangle: string;
|
|
27
|
+
hole: string;
|
|
28
|
+
door: string;
|
|
29
|
+
window: string;
|
|
30
|
+
gate: string;
|
|
31
|
+
turnstile: string;
|
|
32
|
+
reader: string;
|
|
33
|
+
camera: string;
|
|
34
|
+
elevator: string;
|
|
35
|
+
stairs: string;
|
|
36
|
+
office: string;
|
|
37
|
+
container: string;
|
|
38
|
+
storage: string;
|
|
39
|
+
poi: string;
|
|
40
|
+
measure: string;
|
|
41
|
+
adopt: string;
|
|
42
|
+
split: string;
|
|
43
|
+
enclose: string;
|
|
44
|
+
route: string;
|
|
45
|
+
sensor: string;
|
|
46
|
+
light: string;
|
|
47
|
+
alarm: string;
|
|
48
|
+
equipment: string;
|
|
49
|
+
evacuation: string;
|
|
50
|
+
};
|
|
51
|
+
navigate: {
|
|
52
|
+
title: string;
|
|
53
|
+
from: string;
|
|
54
|
+
to: string;
|
|
55
|
+
choose: string;
|
|
56
|
+
swap: string;
|
|
57
|
+
clear: string;
|
|
58
|
+
play: string;
|
|
59
|
+
pause: string;
|
|
60
|
+
prev: string;
|
|
61
|
+
next: string;
|
|
62
|
+
walking: string;
|
|
63
|
+
floors: string;
|
|
64
|
+
steps: string;
|
|
65
|
+
noGraph: string;
|
|
66
|
+
noGraphHintEdit: string;
|
|
67
|
+
noGraphHintView: string;
|
|
68
|
+
unreachable: string;
|
|
69
|
+
unreachableHint: string;
|
|
70
|
+
pick: string;
|
|
71
|
+
here: string;
|
|
72
|
+
hereHint: string;
|
|
73
|
+
levels: string;
|
|
74
|
+
allLevels: string;
|
|
75
|
+
places: string;
|
|
76
|
+
more: string;
|
|
77
|
+
};
|
|
78
|
+
map: {
|
|
79
|
+
basemapUnavailable: string;
|
|
80
|
+
basemapUnavailablePlan: string;
|
|
81
|
+
adoptMiss: string;
|
|
82
|
+
adoptFail: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export type En = typeof en;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AssetRepository } from '../model/types';
|
|
2
|
+
/** Human-only vector evidence. Never part of the model checkpoint or its conversation. */
|
|
3
|
+
export interface ImportAnalysisPreview {
|
|
4
|
+
artifactId: string;
|
|
5
|
+
page: number;
|
|
6
|
+
units: 'm' | 'px' | 'pt';
|
|
7
|
+
transformId?: string;
|
|
8
|
+
metresPerUnit?: number;
|
|
9
|
+
calibration?: string;
|
|
10
|
+
svg: string;
|
|
11
|
+
/** Human-only source raster, located in the SVG display coordinate frame. */
|
|
12
|
+
background?: {
|
|
13
|
+
pngBase64: string;
|
|
14
|
+
bounds: [number, number, number, number];
|
|
15
|
+
matrix: [number, number, number, number, number, number];
|
|
16
|
+
};
|
|
17
|
+
shown: number;
|
|
18
|
+
total: number;
|
|
19
|
+
counts: Record<string, number>;
|
|
20
|
+
warnings: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function readAnalysisPreview(value: unknown): ImportAnalysisPreview;
|
|
23
|
+
export declare function saveAnalysisPreview(assets: AssetRepository, sourceId: string, preview: ImportAnalysisPreview): Promise<void>;
|
|
24
|
+
export declare function loadAnalysisPreview(assets: AssetRepository, sourceId: string): Promise<ImportAnalysisPreview | undefined>;
|
|
25
|
+
export declare const deleteAnalysisPreview: (assets: AssetRepository, sourceId: string) => Promise<void>;
|
|
26
|
+
/** Compose only validated local evidence. Render as an inert image, never innerHTML. */
|
|
27
|
+
export declare function analysisPreviewSvg(preview: ImportAnalysisPreview, hidden?: string[], showBackground?: boolean, opacity?: number): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** User-supplied import scope and whole-floor exterior scale references. */
|
|
2
|
+
export interface ImportBrief {
|
|
3
|
+
buildingType?: 'apartment' | 'house' | 'office' | 'retail' | 'other';
|
|
4
|
+
floorCount?: number;
|
|
5
|
+
widthMetres?: number;
|
|
6
|
+
depthMetres?: number;
|
|
7
|
+
footprintAreaM2?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function readImportBrief(value: unknown): ImportBrief | undefined;
|
|
10
|
+
export declare function importBriefInstructions(brief?: ImportBrief): string;
|
|
11
|
+
export interface SourceCalibration {
|
|
12
|
+
drawingWidth?: number;
|
|
13
|
+
drawingDepth?: number;
|
|
14
|
+
drawingArea?: number;
|
|
15
|
+
drawingLength?: number;
|
|
16
|
+
realLengthMetres?: number;
|
|
17
|
+
basis: string;
|
|
18
|
+
metresPerUnit: number;
|
|
19
|
+
}
|
|
20
|
+
/** Compute scale from the user's references; never let the model silently substitute a smaller
|
|
21
|
+
* real-world width. Multiple references must agree within 10% in linear scale. */
|
|
22
|
+
export declare function calibrateImport(value: unknown, brief?: ImportBrief): SourceCalibration;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ImportBrief, type SourceCalibration } from './brief';
|
|
2
|
+
import { type ImportInstruction } from './instructions';
|
|
3
|
+
/** Serializable continuation state, never a second copy of project geometry or source pixels.
|
|
4
|
+
* Extraction recipes restore cached backend artifacts after a worker/container restart. */
|
|
5
|
+
export interface ImportCheckpoint {
|
|
6
|
+
version: 1;
|
|
7
|
+
projectId: string;
|
|
8
|
+
brief?: ImportBrief;
|
|
9
|
+
phase: 'inspect' | 'build' | 'review';
|
|
10
|
+
notes: string;
|
|
11
|
+
sourcePlan: string;
|
|
12
|
+
calibration?: SourceCalibration;
|
|
13
|
+
mutationKinds: string[];
|
|
14
|
+
lastAssistantText: string;
|
|
15
|
+
lastToolReport: string;
|
|
16
|
+
analysis: {
|
|
17
|
+
artifactId: string;
|
|
18
|
+
sourceHash: string;
|
|
19
|
+
request: Record<string, unknown>;
|
|
20
|
+
calibration?: {
|
|
21
|
+
input: Record<string, unknown>;
|
|
22
|
+
revision: number;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
decisions?: CandidateDecision[];
|
|
26
|
+
steering?: ImportInstruction[];
|
|
27
|
+
}
|
|
28
|
+
export interface CandidateDecision {
|
|
29
|
+
artifactId: string;
|
|
30
|
+
transformId: string;
|
|
31
|
+
floorId: string;
|
|
32
|
+
candidateId: string;
|
|
33
|
+
status: 'accepted' | 'rejected' | 'needs-review';
|
|
34
|
+
modelIds: string[];
|
|
35
|
+
}
|
|
36
|
+
export declare function readImportCheckpoint(value: unknown): ImportCheckpoint | undefined;
|
|
37
|
+
export interface ImportBudget {
|
|
38
|
+
inputTokens: number;
|
|
39
|
+
outputTokens: number;
|
|
40
|
+
/** Maximum provider turns in this run. Omitted by older hosts: 40. */
|
|
41
|
+
maxTurns?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare const DEFAULT_IMPORT_BUDGET: ImportBudget;
|
|
44
|
+
export declare function readImportBudget(value: unknown): ImportBudget;
|
|
45
|
+
export interface ImportPause {
|
|
46
|
+
reason: 'input-budget' | 'output-budget' | 'turn-limit' | 'refusals' | 'repeated-tools';
|
|
47
|
+
message: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function readImportPause(value: unknown): ImportPause | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { PlanEntity, PlanLayerMap } from './types';
|
|
2
|
+
export type LayerRole = keyof PlanLayerMap;
|
|
3
|
+
export declare const LAYER_ROLES: LayerRole[];
|
|
4
|
+
export interface LayerReport {
|
|
5
|
+
layer: string;
|
|
6
|
+
entities: number;
|
|
7
|
+
/** Entity counts by DXF type, for the census a person reads. */
|
|
8
|
+
types: Record<string, number>;
|
|
9
|
+
/** Extent in metres. */
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
/** Total length of its axis-aligned segments — how much wall it could possibly describe. */
|
|
13
|
+
length: number;
|
|
14
|
+
/** Walls its own runs pair into, and their median thickness. A layer that pairs with itself is
|
|
15
|
+
* carrying both faces, which is the case no amount of renaming fixes. */
|
|
16
|
+
selfPaired: number;
|
|
17
|
+
thickness: number;
|
|
18
|
+
/** 0..1 per role, best first in `ranked`. */
|
|
19
|
+
scores: Partial<Record<LayerRole, number>>;
|
|
20
|
+
ranked: LayerRole[];
|
|
21
|
+
/** The role this layer was assigned, if any. */
|
|
22
|
+
role?: LayerRole;
|
|
23
|
+
}
|
|
24
|
+
export interface LayerDetection {
|
|
25
|
+
/** Ready to hand to importPlanEntities. Roles nothing matched are left at the Vertex default. */
|
|
26
|
+
suggested: PlanLayerMap;
|
|
27
|
+
layers: LayerReport[];
|
|
28
|
+
/** Roles no layer could be found for — the ones worth asking a person about. */
|
|
29
|
+
missing: LayerRole[];
|
|
30
|
+
}
|
|
31
|
+
/** A regex matching exactly this layer. Layer names carry underscores, dots and accented letters. */
|
|
32
|
+
export declare const layerPattern: (...names: string[]) => RegExp;
|
|
33
|
+
/** Read every layer's shape, then score each against the six roles. */
|
|
34
|
+
export declare function detectLayers(entities: PlanEntity[]): LayerDetection;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { importPlanEntities } from './planImport';
|
|
2
|
+
export { VERTEX_LAYERS } from './types';
|
|
3
|
+
export { detectLayers, layerPattern, LAYER_ROLES } from './detect';
|
|
4
|
+
export type { LayerDetection, LayerReport, LayerRole } from './detect';
|
|
5
|
+
export type { PlanEntity, PlanImportOptions, PlanImportReport, PlanLayerMap } from './types';
|
|
6
|
+
export type { AiTokenUsage } from './usage';
|
|
7
|
+
export type { ImportBrief, SourceCalibration } from './brief';
|
|
8
|
+
export { documentSvg } from './documentSvg';
|
|
9
|
+
export { landmarks, sheetOffset, shiftEntities, type Landmark } from './register';
|
|
10
|
+
export type { ImportInstruction } from './instructions';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ImportInstruction {
|
|
2
|
+
id: string;
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function readImportInstruction(value: unknown): ImportInstruction;
|
|
6
|
+
/** Keep the latest human steering separately from model-authored notes. */
|
|
7
|
+
export declare function mergeImportInstructions(...groups: ImportInstruction[][]): ImportInstruction[];
|