@collabdt/core 0.5.1 → 0.5.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/dist/core/components/AppSidebarContent.d.ts +2 -3
- package/dist/core/components/AppSidebarContent.d.ts.map +1 -1
- package/dist/core/components/AppSidebarContent.js +10 -1
- package/dist/core/components/AppSidebarContent.js.map +1 -1
- package/dist/core/components/Toolbar.d.ts +2 -3
- package/dist/core/components/Toolbar.d.ts.map +1 -1
- package/dist/core/components/Toolbar.js.map +1 -1
- package/dist/core/components/ui/AppSidebar.d.ts +2 -2
- package/dist/core/components/ui/AppSidebar.d.ts.map +1 -1
- package/dist/core/components/ui/AppSidebar.js.map +1 -1
- package/dist/core/components/ui/Comments/CommentsSection.d.ts.map +1 -1
- package/dist/core/components/ui/Comments/CommentsSection.js +10 -9
- package/dist/core/components/ui/Comments/CommentsSection.js.map +1 -1
- package/dist/core/components/ui/Sensors/SensorsSection.d.ts.map +1 -1
- package/dist/core/components/ui/Sensors/SensorsSection.js +24 -23
- package/dist/core/components/ui/Sensors/SensorsSection.js.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/Shell.js +1 -1
- package/dist/core/components/ui/ViewerSidebar/Shell.js.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/TabStrip.d.ts +6 -5
- package/dist/core/components/ui/ViewerSidebar/TabStrip.d.ts.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/TabStrip.js +6 -4
- package/dist/core/components/ui/ViewerSidebar/TabStrip.js.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/sidebarTabs.d.ts +16 -9
- package/dist/core/components/ui/ViewerSidebar/sidebarTabs.d.ts.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/sidebarTabs.js.map +1 -1
- package/dist/core/components/viewers/Viewer.d.ts.map +1 -1
- package/dist/core/components/viewers/Viewer.js +17 -8
- package/dist/core/components/viewers/Viewer.js.map +1 -1
- package/dist/core/components/viewers/bim/BimViewer.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/BimViewer.js +6 -1
- package/dist/core/components/viewers/bim/BimViewer.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/index.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/index.js +5 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/index.js.map +1 -1
- package/dist/core/components/viewers/bim/src/ElementAppearance.d.ts +10 -1
- package/dist/core/components/viewers/bim/src/ElementAppearance.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/ElementAppearance.js +36 -1
- package/dist/core/components/viewers/bim/src/ElementAppearance.js.map +1 -1
- package/dist/core/components/viewers/bim/src/ModelsSync.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/ModelsSync.js +6 -5
- package/dist/core/components/viewers/bim/src/ModelsSync.js.map +1 -1
- package/dist/core/components/viewers/bim/src/lib/appearanceOverrides.d.ts +12 -1
- package/dist/core/components/viewers/bim/src/lib/appearanceOverrides.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/lib/appearanceOverrides.js +18 -2
- package/dist/core/components/viewers/bim/src/lib/appearanceOverrides.js.map +1 -1
- package/dist/core/components/viewers/map/MapViewer.d.ts.map +1 -1
- package/dist/core/components/viewers/map/MapViewer.js +6 -3
- package/dist/core/components/viewers/map/MapViewer.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/index.js +5 -1
- package/dist/core/components/viewers/map/src/MapSidebar/index.js.map +1 -1
- package/dist/core/components/viewers/map/utils/stringToColour.d.ts +3 -0
- package/dist/core/components/viewers/map/utils/stringToColour.d.ts.map +1 -1
- package/dist/core/components/viewers/map/utils/stringToColour.js +72 -70
- package/dist/core/components/viewers/map/utils/stringToColour.js.map +1 -1
- package/dist/core/components/viewers/plugins/src/PluginCard.d.ts.map +1 -1
- package/dist/core/components/viewers/plugins/src/PluginCard.js +8 -4
- package/dist/core/components/viewers/plugins/src/PluginCard.js.map +1 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.d.ts.map +1 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.js +5 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.js.map +1 -1
- package/dist/core/components/viewers/shared/legends/ViewerLegendHost.d.ts +10 -0
- package/dist/core/components/viewers/shared/legends/ViewerLegendHost.d.ts.map +1 -0
- package/dist/core/components/viewers/{map/legends/MapLegendHost.js → shared/legends/ViewerLegendHost.js} +48 -8
- package/dist/core/components/viewers/shared/legends/ViewerLegendHost.js.map +1 -0
- package/dist/core/components/viewers/viewerAccess.d.ts +7 -0
- package/dist/core/components/viewers/viewerAccess.d.ts.map +1 -0
- package/dist/core/components/viewers/viewerAccess.js +9 -0
- package/dist/core/components/viewers/viewerAccess.js.map +1 -0
- package/dist/core/i18n/messages/en.json +5 -0
- package/dist/core/i18n/messages/es.json +5 -0
- package/dist/core/i18n/messages/fr.json +5 -0
- package/dist/core/plugins/hello-bim/components/SpaceDialog.d.ts +13 -0
- package/dist/core/plugins/hello-bim/components/SpaceDialog.d.ts.map +1 -0
- package/dist/core/plugins/hello-bim/components/SpaceDialog.js +80 -0
- package/dist/core/plugins/hello-bim/components/SpaceDialog.js.map +1 -0
- package/dist/core/plugins/hello-bim/components/SpacesLegend.d.ts +11 -0
- package/dist/core/plugins/hello-bim/components/SpacesLegend.d.ts.map +1 -0
- package/dist/core/plugins/hello-bim/components/SpacesLegend.js +16 -0
- package/dist/core/plugins/hello-bim/components/SpacesLegend.js.map +1 -0
- package/dist/core/plugins/hello-bim/components/SpacesTab.d.ts +4 -0
- package/dist/core/plugins/hello-bim/components/SpacesTab.d.ts.map +1 -0
- package/dist/core/plugins/hello-bim/components/SpacesTab.js +211 -0
- package/dist/core/plugins/hello-bim/components/SpacesTab.js.map +1 -0
- package/dist/core/plugins/hello-bim/components/SpacesTool.d.ts +8 -0
- package/dist/core/plugins/hello-bim/components/SpacesTool.d.ts.map +1 -0
- package/dist/core/plugins/hello-bim/components/SpacesTool.js +68 -0
- package/dist/core/plugins/hello-bim/components/SpacesTool.js.map +1 -0
- package/dist/core/plugins/hello-bim/components/icons.d.ts +13 -0
- package/dist/core/plugins/hello-bim/components/icons.d.ts.map +1 -0
- package/dist/core/plugins/hello-bim/components/icons.js +52 -0
- package/dist/core/plugins/hello-bim/components/icons.js.map +1 -0
- package/dist/core/plugins/hello-bim/index.d.ts +2 -6
- package/dist/core/plugins/hello-bim/index.d.ts.map +1 -1
- package/dist/core/plugins/hello-bim/index.js +27 -3
- package/dist/core/plugins/hello-bim/index.js.map +1 -1
- package/dist/core/plugins/hello-bim/manifest.json +97 -31
- package/dist/core/plugins/hello-bim/spaces.d.ts +57 -0
- package/dist/core/plugins/hello-bim/spaces.d.ts.map +1 -0
- package/dist/core/plugins/hello-bim/spaces.js +207 -0
- package/dist/core/plugins/hello-bim/spaces.js.map +1 -0
- package/dist/core/plugins/hello-map/components/MapTool.d.ts +9 -0
- package/dist/core/plugins/hello-map/components/MapTool.d.ts.map +1 -0
- package/dist/core/plugins/hello-map/components/{HelloMapTool.js → MapTool.js} +30 -11
- package/dist/core/plugins/hello-map/components/MapTool.js.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkerDialog.d.ts +9 -0
- package/dist/core/plugins/hello-map/components/MarkerDialog.d.ts.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkerDialog.js +47 -0
- package/dist/core/plugins/hello-map/components/MarkerDialog.js.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkersLayer.d.ts +8 -0
- package/dist/core/plugins/hello-map/components/MarkersLayer.d.ts.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkersLayer.js +133 -0
- package/dist/core/plugins/hello-map/components/MarkersLayer.js.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkersLegend.d.ts +11 -0
- package/dist/core/plugins/hello-map/components/MarkersLegend.d.ts.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkersLegend.js +20 -0
- package/dist/core/plugins/hello-map/components/MarkersLegend.js.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkersPage.d.ts +6 -0
- package/dist/core/plugins/hello-map/components/MarkersPage.d.ts.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkersPage.js +40 -0
- package/dist/core/plugins/hello-map/components/MarkersPage.js.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkersTab.d.ts +4 -0
- package/dist/core/plugins/hello-map/components/MarkersTab.d.ts.map +1 -0
- package/dist/core/plugins/hello-map/components/MarkersTab.js +275 -0
- package/dist/core/plugins/hello-map/components/MarkersTab.js.map +1 -0
- package/dist/core/plugins/hello-map/index.d.ts +2 -5
- package/dist/core/plugins/hello-map/index.d.ts.map +1 -1
- package/dist/core/plugins/hello-map/index.js +43 -3
- package/dist/core/plugins/hello-map/index.js.map +1 -1
- package/dist/core/plugins/hello-map/manifest.json +85 -12
- package/dist/core/plugins/hello-map/markers.d.ts +32 -0
- package/dist/core/plugins/hello-map/markers.d.ts.map +1 -0
- package/dist/core/plugins/hello-map/markers.js +143 -0
- package/dist/core/plugins/hello-map/markers.js.map +1 -0
- package/dist/core/plugins/host/PluginDataPageHost.d.ts +10 -0
- package/dist/core/plugins/host/PluginDataPageHost.d.ts.map +1 -0
- package/dist/core/plugins/host/PluginDataPageHost.js +142 -0
- package/dist/core/plugins/host/PluginDataPageHost.js.map +1 -0
- package/dist/core/plugins/host/PluginDialogHost.d.ts +7 -0
- package/dist/core/plugins/host/PluginDialogHost.d.ts.map +1 -0
- package/dist/core/plugins/host/PluginDialogHost.js +80 -0
- package/dist/core/plugins/host/PluginDialogHost.js.map +1 -0
- package/dist/core/plugins/host/PluginMapLayerHost.d.ts +6 -0
- package/dist/core/plugins/host/PluginMapLayerHost.d.ts.map +1 -0
- package/dist/core/plugins/host/PluginMapLayerHost.js +26 -0
- package/dist/core/plugins/host/PluginMapLayerHost.js.map +1 -0
- package/dist/core/plugins/host/dialogs.d.ts +25 -0
- package/dist/core/plugins/host/dialogs.d.ts.map +1 -0
- package/dist/core/plugins/host/dialogs.js +50 -0
- package/dist/core/plugins/host/dialogs.js.map +1 -0
- package/dist/core/plugins/host/host.d.ts.map +1 -1
- package/dist/core/plugins/host/host.js +2 -0
- package/dist/core/plugins/host/host.js.map +1 -1
- package/dist/core/plugins/host/pluginState.d.ts +28 -0
- package/dist/core/plugins/host/pluginState.d.ts.map +1 -0
- package/dist/core/plugins/host/pluginState.js +49 -0
- package/dist/core/plugins/host/pluginState.js.map +1 -0
- package/dist/core/plugins/host/pluginViewerKey.d.ts +13 -0
- package/dist/core/plugins/host/pluginViewerKey.d.ts.map +1 -0
- package/dist/core/plugins/host/pluginViewerKey.js +18 -0
- package/dist/core/plugins/host/pluginViewerKey.js.map +1 -0
- package/dist/core/plugins/host/provider.d.ts.map +1 -1
- package/dist/core/plugins/host/provider.js +2 -1
- package/dist/core/plugins/host/provider.js.map +1 -1
- package/dist/core/plugins/host/runtimeShims.d.ts.map +1 -1
- package/dist/core/plugins/host/runtimeShims.js +61 -1
- package/dist/core/plugins/host/runtimeShims.js.map +1 -1
- package/dist/core/plugins/host/usePluginDataPages.d.ts +15 -0
- package/dist/core/plugins/host/usePluginDataPages.d.ts.map +1 -0
- package/dist/core/plugins/host/usePluginDataPages.js +22 -0
- package/dist/core/plugins/host/usePluginDataPages.js.map +1 -0
- package/dist/core/plugins/host/usePluginViewerTabs.d.ts +11 -0
- package/dist/core/plugins/host/usePluginViewerTabs.d.ts.map +1 -0
- package/dist/core/plugins/host/usePluginViewerTabs.js +41 -0
- package/dist/core/plugins/host/usePluginViewerTabs.js.map +1 -0
- package/dist/core/plugins/sdk/bimViewer.d.ts +29 -13
- package/dist/core/plugins/sdk/bimViewer.d.ts.map +1 -1
- package/dist/core/plugins/sdk/bimViewer.js +17 -1
- package/dist/core/plugins/sdk/bimViewer.js.map +1 -1
- package/dist/core/plugins/sdk/index.d.ts +1 -0
- package/dist/core/plugins/sdk/index.d.ts.map +1 -1
- package/dist/core/plugins/sdk/index.js +4 -1
- package/dist/core/plugins/sdk/index.js.map +1 -1
- package/dist/core/plugins/sdk/messages.d.ts +6 -0
- package/dist/core/plugins/sdk/messages.d.ts.map +1 -1
- package/dist/core/plugins/sdk/messages.js +11 -0
- package/dist/core/plugins/sdk/messages.js.map +1 -1
- package/dist/core/plugins/sdk/state.d.ts +6 -0
- package/dist/core/plugins/sdk/state.d.ts.map +1 -0
- package/dist/core/plugins/sdk/state.js +30 -0
- package/dist/core/plugins/sdk/state.js.map +1 -0
- package/dist/core/plugins/sdk/types.d.ts +55 -10
- package/dist/core/plugins/sdk/types.d.ts.map +1 -1
- package/dist/core/plugins/sdk/types.js +7 -3
- package/dist/core/plugins/sdk/types.js.map +1 -1
- package/dist/core/plugins/sdk/ui.d.ts +12 -0
- package/dist/core/plugins/sdk/ui.d.ts.map +1 -0
- package/dist/core/plugins/sdk/ui.js +16 -0
- package/dist/core/plugins/sdk/ui.js.map +1 -0
- package/dist/core/store/CombineProviders.d.ts.map +1 -1
- package/dist/core/store/CombineProviders.js +6 -2
- package/dist/core/store/CombineProviders.js.map +1 -1
- package/dist/core/store/Menus/reducer.d.ts +5 -3
- package/dist/core/store/Menus/reducer.d.ts.map +1 -1
- package/dist/core/store/Menus/reducer.js.map +1 -1
- package/dist/core/types/dbTypes.d.ts +5 -0
- package/dist/core/types/dbTypes.d.ts.map +1 -1
- package/dist/core/types/dbTypes.js.map +1 -1
- package/package.json +3 -1
- package/dist/core/components/viewers/map/legends/MapLegendHost.d.ts +0 -10
- package/dist/core/components/viewers/map/legends/MapLegendHost.d.ts.map +0 -1
- package/dist/core/components/viewers/map/legends/MapLegendHost.js.map +0 -1
- package/dist/core/plugins/hello-bim/components/HelloBimTool.d.ts +0 -18
- package/dist/core/plugins/hello-bim/components/HelloBimTool.d.ts.map +0 -1
- package/dist/core/plugins/hello-bim/components/HelloBimTool.js +0 -142
- package/dist/core/plugins/hello-bim/components/HelloBimTool.js.map +0 -1
- package/dist/core/plugins/hello-map/components/HelloMapTool.d.ts +0 -14
- package/dist/core/plugins/hello-map/components/HelloMapTool.d.ts.map +0 -1
- package/dist/core/plugins/hello-map/components/HelloMapTool.js.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function Glyph({ children }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
className: "h-4 w-4",
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: "2",
|
|
12
|
+
strokeLinecap: "round",
|
|
13
|
+
strokeLinejoin: "round",
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
children
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function CheckIcon() {
|
|
20
|
+
return /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" });
|
|
21
|
+
}
|
|
22
|
+
function XIcon() {
|
|
23
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }),
|
|
25
|
+
/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
function PlusIcon() {
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
"svg",
|
|
31
|
+
{
|
|
32
|
+
viewBox: "0 0 24 24",
|
|
33
|
+
className: "h-3 w-3",
|
|
34
|
+
fill: "none",
|
|
35
|
+
stroke: "currentColor",
|
|
36
|
+
strokeWidth: "2.5",
|
|
37
|
+
strokeLinecap: "round",
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx("path", { d: "M5 12h14" }),
|
|
41
|
+
/* @__PURE__ */ jsx("path", { d: "M12 5v14" })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
CheckIcon,
|
|
48
|
+
Glyph,
|
|
49
|
+
PlusIcon,
|
|
50
|
+
XIcon
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/core/plugins/hello-bim/components/icons.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\n/**\r\n * Drawn here: `lucide-react` is unshimmed, so a plugin cannot import it. Icon *names* work in\r\n * registrations, where the host resolves them. Labels live on each button's aria-label.\r\n */\r\nexport function Glyph({ children }: { children: React.ReactNode }) {\r\n return (\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n className=\"h-4 w-4\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n aria-hidden=\"true\"\r\n >\r\n {children}\r\n </svg>\r\n )\r\n}\r\n\r\nexport function CheckIcon() {\r\n return <path d=\"M20 6 9 17l-5-5\" />\r\n}\r\n\r\nexport function XIcon() {\r\n return <><path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" /></>\r\n}\r\n\r\n/** Smaller than the button glyphs — it sits inside a 24px swatch, not a 32px button. */\r\nexport function PlusIcon() {\r\n return (\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n className=\"h-3 w-3\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2.5\"\r\n strokeLinecap=\"round\"\r\n aria-hidden=\"true\"\r\n >\r\n <path d=\"M5 12h14\" />\r\n <path d=\"M12 5v14\" />\r\n </svg>\r\n )\r\n}\r\n"],"mappings":";AAaI,SAoBK,UApBL,KAoBK,YApBL;AAFG,SAAS,MAAM,EAAE,SAAS,GAAkC;AACjE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,WAAU;AAAA,MACV,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAY;AAAA,MAEX;AAAA;AAAA,EACH;AAEJ;AAEO,SAAS,YAAY;AAC1B,SAAO,oBAAC,UAAK,GAAE,mBAAkB;AACnC;AAEO,SAAS,QAAQ;AACtB,SAAO,iCAAE;AAAA,wBAAC,UAAK,GAAE,cAAa;AAAA,IAAE,oBAAC,UAAK,GAAE,cAAa;AAAA,KAAE;AACzD;AAGO,SAAS,WAAW;AACzB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,WAAU;AAAA,MACV,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,eAAY;AAAA,MAEZ;AAAA,4BAAC,UAAK,GAAE,YAAW;AAAA,QACnB,oBAAC,UAAK,GAAE,YAAW;AAAA;AAAA;AAAA,EACrB;AAEJ;","names":[]}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { PluginContext } from '../sdk/types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* the camera — so a regression at the plugin/core boundary breaks a test.
|
|
6
|
-
*
|
|
7
|
-
* ESLint enforces the isolation rule — a plugin imports from `../sdk/*` and its own
|
|
8
|
-
* files, never the rest of core.
|
|
3
|
+
* Four surfaces over the model IfcSpaces, all reading one hook. The IFC is never written to:
|
|
4
|
+
* a renamed space is an annotation this plugin stores, and the dialog shows both names.
|
|
9
5
|
*/
|
|
10
6
|
export declare function activate(ctx: PluginContext): void;
|
|
11
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/hello-bim/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/hello-bim/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA+BjD"}
|
|
@@ -1,12 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ViewerNames } from "../sdk/types";
|
|
2
|
+
import { SpaceDialog } from "./components/SpaceDialog";
|
|
3
|
+
import { useSpacesLegend } from "./components/SpacesLegend";
|
|
4
|
+
import { SpacesTab } from "./components/SpacesTab";
|
|
5
|
+
import { SpacesTool } from "./components/SpacesTool";
|
|
2
6
|
function activate(ctx) {
|
|
3
7
|
ctx.register("bim.tools", {
|
|
4
8
|
id: "hello-bim",
|
|
5
|
-
label: "
|
|
9
|
+
label: "Spaces",
|
|
6
10
|
icon: "Boxes",
|
|
7
|
-
component:
|
|
11
|
+
component: SpacesTool,
|
|
8
12
|
stayActive: true
|
|
9
13
|
});
|
|
14
|
+
ctx.register("viewer.tabs", {
|
|
15
|
+
id: "spaces",
|
|
16
|
+
labelKey: "tabTitle",
|
|
17
|
+
icon: "Boxes",
|
|
18
|
+
// BIM only: there are no IfcSpaces to annotate on the map or in a point cloud.
|
|
19
|
+
viewers: [ViewerNames.bim],
|
|
20
|
+
component: SpacesTab
|
|
21
|
+
});
|
|
22
|
+
ctx.register("viewer.legends", {
|
|
23
|
+
id: "spaces",
|
|
24
|
+
title: "Spaces",
|
|
25
|
+
viewers: [ViewerNames.bim],
|
|
26
|
+
useLegend: useSpacesLegend
|
|
27
|
+
});
|
|
28
|
+
ctx.register("ui.dialogs", {
|
|
29
|
+
id: "detail",
|
|
30
|
+
titleKey: "dialogTitle",
|
|
31
|
+
size: "md",
|
|
32
|
+
component: SpaceDialog
|
|
33
|
+
});
|
|
10
34
|
}
|
|
11
35
|
export {
|
|
12
36
|
activate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/plugins/hello-bim/index.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/plugins/hello-bim/index.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { ViewerNames } from '../sdk/types'\r\n\r\nimport { SpaceDialog } from './components/SpaceDialog'\r\nimport { useSpacesLegend } from './components/SpacesLegend'\r\nimport { SpacesTab } from './components/SpacesTab'\r\nimport { SpacesTool } from './components/SpacesTool'\r\n\r\nimport type { PluginContext } from '../sdk/types'\r\n\r\n/**\r\n * Four surfaces over the model IfcSpaces, all reading one hook. The IFC is never written to:\r\n * a renamed space is an annotation this plugin stores, and the dialog shows both names.\r\n */\r\nexport function activate(ctx: PluginContext): void {\r\n ctx.register('bim.tools', {\r\n id: 'hello-bim',\r\n label: 'Spaces',\r\n icon: 'Boxes',\r\n component: SpacesTool,\r\n stayActive: true,\r\n })\r\n\r\n ctx.register('viewer.tabs', {\r\n id: 'spaces',\r\n labelKey: 'tabTitle',\r\n icon: 'Boxes',\r\n // BIM only: there are no IfcSpaces to annotate on the map or in a point cloud.\r\n viewers: [ViewerNames.bim],\r\n component: SpacesTab,\r\n })\r\n\r\n ctx.register('viewer.legends', {\r\n id: 'spaces',\r\n title: 'Spaces',\r\n viewers: [ViewerNames.bim],\r\n useLegend: useSpacesLegend,\r\n })\r\n\r\n ctx.register('ui.dialogs', {\r\n id: 'detail',\r\n titleKey: 'dialogTitle',\r\n size: 'md',\r\n component: SpaceDialog,\r\n })\r\n}\r\n"],"mappings":"AAGA,SAAS,mBAAmB;AAE5B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAQpB,SAAS,SAAS,KAA0B;AACjD,MAAI,SAAS,aAAa;AAAA,IACxB,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd,CAAC;AAED,MAAI,SAAS,eAAe;AAAA,IAC1B,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA;AAAA,IAEN,SAAS,CAAC,YAAY,GAAG;AAAA,IACzB,WAAW;AAAA,EACb,CAAC;AAED,MAAI,SAAS,kBAAkB;AAAA,IAC7B,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,YAAY,GAAG;AAAA,IACzB,WAAW;AAAA,EACb,CAAC;AAED,MAAI,SAAS,cAAc;AAAA,IACzB,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"slug": "hello-bim",
|
|
3
3
|
"name": "Hello BIM",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"hostApi": 1,
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Annotates the model's IfcSpaces: rename and colour them, across a toolbar panel, a sidebar tab, a legend and a dialog.",
|
|
7
7
|
"author": "Collab Digital Twins",
|
|
8
8
|
"capabilities": [
|
|
9
|
-
"bim.tools"
|
|
9
|
+
"bim.tools",
|
|
10
|
+
"viewer.tabs",
|
|
11
|
+
"viewer.legends",
|
|
12
|
+
"ui.dialogs"
|
|
10
13
|
],
|
|
11
14
|
"requiredPermissions": [],
|
|
12
15
|
"configSchema": {
|
|
@@ -14,7 +17,7 @@
|
|
|
14
17
|
"properties": {
|
|
15
18
|
"category": {
|
|
16
19
|
"type": "string",
|
|
17
|
-
"description": "
|
|
20
|
+
"description": "The IFC category to annotate.",
|
|
18
21
|
"default": "IFCSPACE"
|
|
19
22
|
}
|
|
20
23
|
},
|
|
@@ -23,39 +26,102 @@
|
|
|
23
26
|
"messages": {
|
|
24
27
|
"en": {
|
|
25
28
|
"name": "Hello BIM",
|
|
26
|
-
"description": "
|
|
27
|
-
"title": "
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
29
|
+
"description": "Annotates the model's IfcSpaces: rename and colour them, across a toolbar panel, a sidebar tab, a legend and a dialog.",
|
|
30
|
+
"title": "Spaces",
|
|
31
|
+
"tabTitle": "Spaces",
|
|
32
|
+
"dialogTitle": "Space",
|
|
33
|
+
"legendTitle": "Spaces",
|
|
34
|
+
"loading": "Reading the model…",
|
|
35
|
+
"empty": "This model has no IfcSpaces.",
|
|
36
|
+
"noModel": "Load a model to see its spaces.",
|
|
37
|
+
"count": "Spaces in this model: ",
|
|
38
|
+
"details": "Details",
|
|
39
|
+
"saveName": "Save name",
|
|
40
|
+
"revertName": "Discard the change",
|
|
41
|
+
"ifcName": "In the model: ",
|
|
42
|
+
"ifcNameLabel": "Name in the model",
|
|
43
|
+
"modelLabel": "Model",
|
|
44
|
+
"idLabel": "Element id",
|
|
45
|
+
"colour": "Colour",
|
|
46
|
+
"customColour": "Pick any colour",
|
|
47
|
+
"attributes": "IFC attributes",
|
|
48
|
+
"reset": "Reset to the model's name and colour",
|
|
49
|
+
"close": "Close",
|
|
50
|
+
"gone": "That space is no longer loaded.",
|
|
51
|
+
"saveFailed": "Could not save: ",
|
|
52
|
+
"nameLabel": "Name",
|
|
53
|
+
"colourSpaces": "Colour the spaces",
|
|
54
|
+
"resetView": "Reset the view",
|
|
55
|
+
"clearColours": "Clear colours",
|
|
56
|
+
"showAllElements": "Show all elements",
|
|
57
|
+
"isolateSpaces": "Isolate spaces",
|
|
58
|
+
"isolateSpace": "Isolate space"
|
|
35
59
|
},
|
|
36
60
|
"fr": {
|
|
37
61
|
"name": "Bonjour BIM",
|
|
38
|
-
"description": "
|
|
39
|
-
"title": "
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
62
|
+
"description": "Annote les IfcSpaces du modèle : renommage et couleur, via un panneau d'outils, un onglet, une légende et une boîte de dialogue.",
|
|
63
|
+
"title": "Espaces",
|
|
64
|
+
"tabTitle": "Espaces",
|
|
65
|
+
"dialogTitle": "Espace",
|
|
66
|
+
"legendTitle": "Espaces",
|
|
67
|
+
"loading": "Lecture du modèle…",
|
|
68
|
+
"empty": "Ce modèle ne contient aucun IfcSpace.",
|
|
69
|
+
"noModel": "Chargez un modèle pour voir ses espaces.",
|
|
70
|
+
"count": "Espaces dans ce modèle : ",
|
|
71
|
+
"details": "Détails",
|
|
72
|
+
"saveName": "Enregistrer le nom",
|
|
73
|
+
"revertName": "Annuler la modification",
|
|
74
|
+
"ifcName": "Dans le modèle : ",
|
|
75
|
+
"ifcNameLabel": "Nom dans le modèle",
|
|
76
|
+
"modelLabel": "Modèle",
|
|
77
|
+
"idLabel": "Identifiant de l'élément",
|
|
78
|
+
"colour": "Couleur",
|
|
79
|
+
"customColour": "Choisir une couleur libre",
|
|
80
|
+
"attributes": "Attributs IFC",
|
|
81
|
+
"reset": "Rétablir le nom et la couleur du modèle",
|
|
82
|
+
"close": "Fermer",
|
|
83
|
+
"gone": "Cet espace n'est plus chargé.",
|
|
84
|
+
"saveFailed": "Échec de l’enregistrement : ",
|
|
85
|
+
"nameLabel": "Nom",
|
|
86
|
+
"colourSpaces": "Colorer les espaces",
|
|
87
|
+
"resetView": "Réinitialiser la vue",
|
|
88
|
+
"clearColours": "Effacer les couleurs",
|
|
89
|
+
"showAllElements": "Afficher tous les éléments",
|
|
90
|
+
"isolateSpaces": "Isoler les espaces",
|
|
91
|
+
"isolateSpace": "Isoler cet espace"
|
|
47
92
|
},
|
|
48
93
|
"es": {
|
|
49
94
|
"name": "Hola BIM",
|
|
50
|
-
"description": "
|
|
51
|
-
"title": "
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
95
|
+
"description": "Anota los IfcSpaces del modelo: renombrarlos y colorearlos, con un panel de herramientas, una pestaña, una leyenda y un diálogo.",
|
|
96
|
+
"title": "Espacios",
|
|
97
|
+
"tabTitle": "Espacios",
|
|
98
|
+
"dialogTitle": "Espacio",
|
|
99
|
+
"legendTitle": "Espacios",
|
|
100
|
+
"loading": "Leyendo el modelo…",
|
|
101
|
+
"empty": "Este modelo no contiene ningún IfcSpace.",
|
|
102
|
+
"noModel": "Cargue un modelo para ver sus espacios.",
|
|
103
|
+
"count": "Espacios en este modelo: ",
|
|
104
|
+
"details": "Detalles",
|
|
105
|
+
"saveName": "Guardar el nombre",
|
|
106
|
+
"revertName": "Descartar el cambio",
|
|
107
|
+
"ifcName": "En el modelo: ",
|
|
108
|
+
"ifcNameLabel": "Nombre en el modelo",
|
|
109
|
+
"modelLabel": "Modelo",
|
|
110
|
+
"idLabel": "Identificador del elemento",
|
|
111
|
+
"colour": "Color",
|
|
112
|
+
"customColour": "Elegir cualquier color",
|
|
113
|
+
"attributes": "Atributos IFC",
|
|
114
|
+
"reset": "Restablecer el nombre y el color del modelo",
|
|
115
|
+
"close": "Cerrar",
|
|
116
|
+
"gone": "Ese espacio ya no está cargado.",
|
|
117
|
+
"saveFailed": "No se pudo guardar: ",
|
|
118
|
+
"nameLabel": "Nombre",
|
|
119
|
+
"colourSpaces": "Colorear los espacios",
|
|
120
|
+
"resetView": "Restablecer la vista",
|
|
121
|
+
"clearColours": "Borrar los colores",
|
|
122
|
+
"showAllElements": "Mostrar todos los elementos",
|
|
123
|
+
"isolateSpaces": "Aislar los espacios",
|
|
124
|
+
"isolateSpace": "Aislar este espacio"
|
|
59
125
|
}
|
|
60
126
|
}
|
|
61
127
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ModelIdMap } from '../sdk/bimViewer';
|
|
2
|
+
/** What the plugin stores about one space. The IFC model itself is never written to. */
|
|
3
|
+
export interface SpaceAnnotation extends Record<string, unknown> {
|
|
4
|
+
/** Replaces the IFC name in this plugin's own surfaces. */
|
|
5
|
+
name: string;
|
|
6
|
+
colour: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Space {
|
|
9
|
+
/** `<modelId>::<localId>` — stable for as long as the model is, and safe as a record key. */
|
|
10
|
+
key: string;
|
|
11
|
+
modelId: string;
|
|
12
|
+
localId: number;
|
|
13
|
+
/** From the IFC, and never changed. */
|
|
14
|
+
ifcName: string;
|
|
15
|
+
/** The annotation's name when there is one, otherwise the IFC's. */
|
|
16
|
+
name: string;
|
|
17
|
+
colour: string;
|
|
18
|
+
/** Whether the plugin has stored anything for this space. */
|
|
19
|
+
annotated: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function spaceKey(modelId: string, localId: number): string;
|
|
22
|
+
/** Sets, not arrays: `ModelIdMap` is `Record<string, Set<number>>`. */
|
|
23
|
+
export declare function toModelIdMap(spaces: Space[]): ModelIdMap;
|
|
24
|
+
export interface DiscoveredSpace {
|
|
25
|
+
modelId: string;
|
|
26
|
+
localId: number;
|
|
27
|
+
ifcName: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function useSpaceDiscovery(): {
|
|
30
|
+
discovered: DiscoveredSpace[];
|
|
31
|
+
scanning: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The spaces, plus the annotations this plugin stores against them. The IFC is read-only, so
|
|
35
|
+
* a rename is an annotation, never a write to the model.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useSpaces(): {
|
|
38
|
+
spaces: Space[];
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
lastError: string;
|
|
41
|
+
selected: Space;
|
|
42
|
+
select: (next: string | ((previous: string) => string)) => void;
|
|
43
|
+
rename: (key: string, name: string) => Promise<void>;
|
|
44
|
+
setColour: (key: string, colour: string) => Promise<void>;
|
|
45
|
+
reset: (key: string) => Promise<void>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Whether the spaces are painted, applied from an effect so a recolour repaints at once.
|
|
49
|
+
* The flag is plugin state, so the toolbar and the tab agree on it.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useSpacePainting(): {
|
|
52
|
+
painted: boolean;
|
|
53
|
+
setPainted: (next: boolean | ((previous: boolean) => boolean)) => void;
|
|
54
|
+
};
|
|
55
|
+
/** `#rrggbb` to the `0xRRGGBB` the appearance API takes. */
|
|
56
|
+
export declare function hexToInt(colour: string): number;
|
|
57
|
+
//# sourceMappingURL=spaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/hello-bim/spaces.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,wFAAwF;AACxF,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9D,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,KAAK;IACpB,6FAA6F;IAC7F,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAA;IACf,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,6DAA6D;IAC7D,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAMxD;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB;AAKD,wBAAgB,iBAAiB,IAAI;IAAE,UAAU,EAAE,eAAe,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAiDxF;AAgBD;;;GAGG;AACH,wBAAgB,SAAS;;;;;;kBAoET,MAAM,QAAQ,MAAM;qBAS1B,MAAM,UAAU,MAAM;iBAMhB,MAAM;EAiBrB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB;;;EAuB/B;AAED,4DAA4D;AAC5D,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
if (__hasOwnProp.call(b, prop))
|
|
10
|
+
__defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
+
if (__propIsEnum.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
}
|
|
16
|
+
return a;
|
|
17
|
+
};
|
|
18
|
+
import * as React from "react";
|
|
19
|
+
import { stringToColour } from "../sdk";
|
|
20
|
+
import { usePluginBimAppearance, useBimViewer } from "../sdk/bimViewer";
|
|
21
|
+
import { usePluginState } from "../sdk/state";
|
|
22
|
+
import { usePluginStore } from "../sdk/store";
|
|
23
|
+
function spaceKey(modelId, localId) {
|
|
24
|
+
return `${modelId}::${localId}`;
|
|
25
|
+
}
|
|
26
|
+
function toModelIdMap(spaces) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const items = {};
|
|
29
|
+
for (const space of spaces) {
|
|
30
|
+
((_b = items[_a = space.modelId]) != null ? _b : items[_a] = /* @__PURE__ */ new Set()).add(space.localId);
|
|
31
|
+
}
|
|
32
|
+
return items;
|
|
33
|
+
}
|
|
34
|
+
const scans = /* @__PURE__ */ new Map();
|
|
35
|
+
function useSpaceDiscovery() {
|
|
36
|
+
const { components, modelIds, getItemsOfCategory, getProperties } = useBimViewer();
|
|
37
|
+
const [discovered, setDiscovered] = usePluginState("discovered", []);
|
|
38
|
+
const [scannedFor, setScannedFor] = usePluginState("scannedFor", null);
|
|
39
|
+
const modelKey = modelIds.join("|");
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
var _a;
|
|
42
|
+
if (!components || modelKey === scannedFor) return;
|
|
43
|
+
if (modelIds.length === 0) {
|
|
44
|
+
setDiscovered([]);
|
|
45
|
+
setScannedFor(modelKey);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
let cancelled = false;
|
|
49
|
+
const scan = (_a = scans.get(modelKey)) != null ? _a : (async () => {
|
|
50
|
+
const items = await getItemsOfCategory("IFCSPACE");
|
|
51
|
+
const properties = await getProperties(items, ["Name", "LongName"]);
|
|
52
|
+
return properties.map((entry) => {
|
|
53
|
+
var _a2;
|
|
54
|
+
return {
|
|
55
|
+
modelId: entry.modelId,
|
|
56
|
+
localId: entry.localId,
|
|
57
|
+
ifcName: (_a2 = readName(entry)) != null ? _a2 : `Space ${entry.localId}`
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
})();
|
|
61
|
+
scans.set(modelKey, scan);
|
|
62
|
+
void scan.then((found) => {
|
|
63
|
+
if (cancelled) return;
|
|
64
|
+
setDiscovered(found);
|
|
65
|
+
setScannedFor(modelKey);
|
|
66
|
+
}).catch((error) => {
|
|
67
|
+
console.error("[hello-bim] could not read the model's spaces:", error);
|
|
68
|
+
scans.delete(modelKey);
|
|
69
|
+
});
|
|
70
|
+
return () => {
|
|
71
|
+
cancelled = true;
|
|
72
|
+
};
|
|
73
|
+
}, [components, modelKey, modelIds, scannedFor, getItemsOfCategory, getProperties, setDiscovered, setScannedFor]);
|
|
74
|
+
return { discovered, scanning: components !== null && modelKey !== scannedFor };
|
|
75
|
+
}
|
|
76
|
+
function readName(entry) {
|
|
77
|
+
for (const key of ["LongName", "Name"]) {
|
|
78
|
+
const raw = entry[key];
|
|
79
|
+
if (typeof raw === "string" && raw.trim()) return raw.trim();
|
|
80
|
+
if (raw && typeof raw === "object" && "value" in raw) {
|
|
81
|
+
const value = raw.value;
|
|
82
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
function useSpaces() {
|
|
88
|
+
var _a;
|
|
89
|
+
const { discovered, scanning } = useSpaceDiscovery();
|
|
90
|
+
const store = usePluginStore("spaces");
|
|
91
|
+
const [selectedKey, setSelectedKey] = usePluginState("selected", null);
|
|
92
|
+
const [lastError, setLastError] = usePluginState("lastError", null);
|
|
93
|
+
const attempt = React.useCallback(
|
|
94
|
+
async (action) => {
|
|
95
|
+
try {
|
|
96
|
+
await action();
|
|
97
|
+
setLastError(null);
|
|
98
|
+
return true;
|
|
99
|
+
} catch (error) {
|
|
100
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
101
|
+
console.error("[hello-bim] save failed:", error);
|
|
102
|
+
setLastError(message);
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
[setLastError]
|
|
107
|
+
);
|
|
108
|
+
const annotations = React.useMemo(
|
|
109
|
+
() => new Map(store.items.map((item) => [item.key, item.data])),
|
|
110
|
+
[store.items]
|
|
111
|
+
);
|
|
112
|
+
const spaces = React.useMemo(
|
|
113
|
+
() => discovered.map((found) => {
|
|
114
|
+
var _a2, _b;
|
|
115
|
+
const key = spaceKey(found.modelId, found.localId);
|
|
116
|
+
const annotation = annotations.get(key);
|
|
117
|
+
return {
|
|
118
|
+
key,
|
|
119
|
+
modelId: found.modelId,
|
|
120
|
+
localId: found.localId,
|
|
121
|
+
ifcName: found.ifcName,
|
|
122
|
+
name: (_a2 = annotation == null ? void 0 : annotation.name) != null ? _a2 : found.ifcName,
|
|
123
|
+
// Hashed, so an unpicked colour is stable per space rather than shuffling.
|
|
124
|
+
colour: (_b = annotation == null ? void 0 : annotation.colour) != null ? _b : stringToColour(key),
|
|
125
|
+
annotated: annotation !== void 0
|
|
126
|
+
};
|
|
127
|
+
}),
|
|
128
|
+
[discovered, annotations]
|
|
129
|
+
);
|
|
130
|
+
const byKey = React.useMemo(
|
|
131
|
+
() => new Map(spaces.map((space) => [space.key, space])),
|
|
132
|
+
[spaces]
|
|
133
|
+
);
|
|
134
|
+
const patch = React.useCallback(
|
|
135
|
+
async (key, changes) => {
|
|
136
|
+
const current = byKey.get(key);
|
|
137
|
+
if (!current) return;
|
|
138
|
+
await attempt(() => store.put(key, __spreadValues({
|
|
139
|
+
name: current.name,
|
|
140
|
+
colour: current.colour
|
|
141
|
+
}, changes)));
|
|
142
|
+
},
|
|
143
|
+
[store, byKey, attempt]
|
|
144
|
+
);
|
|
145
|
+
const rename = React.useCallback(
|
|
146
|
+
async (key, name) => {
|
|
147
|
+
var _a2;
|
|
148
|
+
const trimmed = name.trim();
|
|
149
|
+
if (!trimmed || trimmed === ((_a2 = byKey.get(key)) == null ? void 0 : _a2.name)) return;
|
|
150
|
+
await patch(key, { name: trimmed });
|
|
151
|
+
},
|
|
152
|
+
[patch, byKey]
|
|
153
|
+
);
|
|
154
|
+
const setColour = React.useCallback(
|
|
155
|
+
(key, colour) => patch(key, { colour }),
|
|
156
|
+
[patch]
|
|
157
|
+
);
|
|
158
|
+
const reset = React.useCallback(
|
|
159
|
+
async (key) => {
|
|
160
|
+
var _a2;
|
|
161
|
+
if (!((_a2 = byKey.get(key)) == null ? void 0 : _a2.annotated)) return;
|
|
162
|
+
await attempt(() => store.remove(key));
|
|
163
|
+
},
|
|
164
|
+
[store, byKey, attempt]
|
|
165
|
+
);
|
|
166
|
+
return {
|
|
167
|
+
spaces,
|
|
168
|
+
isLoading: store.isLoading || scanning,
|
|
169
|
+
lastError,
|
|
170
|
+
selected: selectedKey === null ? null : (_a = byKey.get(selectedKey)) != null ? _a : null,
|
|
171
|
+
select: setSelectedKey,
|
|
172
|
+
rename,
|
|
173
|
+
setColour,
|
|
174
|
+
reset
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function useSpacePainting() {
|
|
178
|
+
const { spaces } = useSpaces();
|
|
179
|
+
const { setItemsVisible } = useBimViewer();
|
|
180
|
+
const { setAppearance, clearAppearance } = usePluginBimAppearance();
|
|
181
|
+
const [painted, setPainted] = usePluginState("painted", false);
|
|
182
|
+
React.useEffect(() => {
|
|
183
|
+
if (!painted) {
|
|
184
|
+
clearAppearance();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (spaces.length === 0) return;
|
|
188
|
+
void setItemsVisible(toModelIdMap(spaces), true);
|
|
189
|
+
setAppearance(spaces.map((space) => ({
|
|
190
|
+
items: toModelIdMap([space]),
|
|
191
|
+
appearance: { color: hexToInt(space.colour) }
|
|
192
|
+
})));
|
|
193
|
+
}, [painted, spaces, setAppearance, clearAppearance, setItemsVisible]);
|
|
194
|
+
return { painted, setPainted };
|
|
195
|
+
}
|
|
196
|
+
function hexToInt(colour) {
|
|
197
|
+
return Number.parseInt(colour.replace("#", ""), 16);
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
hexToInt,
|
|
201
|
+
spaceKey,
|
|
202
|
+
toModelIdMap,
|
|
203
|
+
useSpaceDiscovery,
|
|
204
|
+
useSpacePainting,
|
|
205
|
+
useSpaces
|
|
206
|
+
};
|
|
207
|
+
//# sourceMappingURL=spaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/plugins/hello-bim/spaces.ts"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\nimport { stringToColour } from '../sdk'\r\nimport { usePluginBimAppearance, useBimViewer } from '../sdk/bimViewer'\r\nimport { usePluginState } from '../sdk/state'\r\nimport { usePluginStore } from '../sdk/store'\r\n\r\nimport type { ModelIdMap } from '../sdk/bimViewer'\r\n\r\n/** What the plugin stores about one space. The IFC model itself is never written to. */\r\nexport interface SpaceAnnotation extends Record<string, unknown> {\r\n /** Replaces the IFC name in this plugin's own surfaces. */\r\n name: string\r\n colour: string\r\n}\r\n\r\nexport interface Space {\r\n /** `<modelId>::<localId>` — stable for as long as the model is, and safe as a record key. */\r\n key: string\r\n modelId: string\r\n localId: number\r\n /** From the IFC, and never changed. */\r\n ifcName: string\r\n /** The annotation's name when there is one, otherwise the IFC's. */\r\n name: string\r\n colour: string\r\n /** Whether the plugin has stored anything for this space. */\r\n annotated: boolean\r\n}\r\n\r\nexport function spaceKey(modelId: string, localId: number): string {\r\n return `${modelId}::${localId}`\r\n}\r\n\r\n/** Sets, not arrays: `ModelIdMap` is `Record<string, Set<number>>`. */\r\nexport function toModelIdMap(spaces: Space[]): ModelIdMap {\r\n const items: ModelIdMap = {}\r\n for (const space of spaces) {\r\n (items[space.modelId] ??= new Set<number>()).add(space.localId)\r\n }\r\n return items\r\n}\r\n\r\nexport interface DiscoveredSpace {\r\n modelId: string\r\n localId: number\r\n ifcName: string\r\n}\r\n\r\n// Module scope, not plugin state: a state claim is an effect dep, so it cancels its own scan.\r\nconst scans = new Map<string, Promise<DiscoveredSpace[]>>()\r\n\r\nexport function useSpaceDiscovery(): { discovered: DiscoveredSpace[]; scanning: boolean } {\r\n const { components, modelIds, getItemsOfCategory, getProperties } = useBimViewer()\r\n const [discovered, setDiscovered] = usePluginState<DiscoveredSpace[]>('discovered', [])\r\n const [scannedFor, setScannedFor] = usePluginState<string | null>('scannedFor', null)\r\n\r\n const modelKey = modelIds.join('|')\r\n\r\n React.useEffect(() => {\r\n if (!components || modelKey === scannedFor) return\r\n\r\n if (modelIds.length === 0) {\r\n setDiscovered([])\r\n setScannedFor(modelKey)\r\n return\r\n }\r\n\r\n let cancelled = false\r\n\r\n const scan = scans.get(modelKey) ?? (async () => {\r\n const items = await getItemsOfCategory('IFCSPACE')\r\n const properties = await getProperties(items, ['Name', 'LongName'])\r\n\r\n return properties.map(entry => ({\r\n modelId: entry.modelId,\r\n localId: entry.localId,\r\n ifcName: readName(entry) ?? `Space ${entry.localId}`,\r\n }))\r\n })()\r\n\r\n scans.set(modelKey, scan)\r\n\r\n void scan\r\n .then((found) => {\r\n if (cancelled) return\r\n setDiscovered(found)\r\n // Only once there is a result, or a cancelled surface marks it looked-at.\r\n setScannedFor(modelKey)\r\n })\r\n .catch((error) => {\r\n console.error('[hello-bim] could not read the model\\'s spaces:', error)\r\n scans.delete(modelKey)\r\n })\r\n\r\n return () => {\r\n cancelled = true\r\n }\r\n }, [components, modelKey, modelIds, scannedFor, getItemsOfCategory, getProperties, setDiscovered, setScannedFor])\r\n\r\n return { discovered, scanning: components !== null && modelKey !== scannedFor }\r\n}\r\n\r\n/** IFC attributes arrive bare or wrapped in `{ value }`, depending on the model. */\r\nfunction readName(entry: Record<string, unknown>): string | null {\r\n for (const key of ['LongName', 'Name']) {\r\n const raw = entry[key]\r\n if (typeof raw === 'string' && raw.trim()) return raw.trim()\r\n\r\n if (raw && typeof raw === 'object' && 'value' in raw) {\r\n const value = (raw as { value: unknown }).value\r\n if (typeof value === 'string' && value.trim()) return value.trim()\r\n }\r\n }\r\n return null\r\n}\r\n\r\n/**\r\n * The spaces, plus the annotations this plugin stores against them. The IFC is read-only, so\r\n * a rename is an annotation, never a write to the model.\r\n */\r\nexport function useSpaces() {\r\n const { discovered, scanning } = useSpaceDiscovery()\r\n const store = usePluginStore<SpaceAnnotation>('spaces')\r\n const [selectedKey, setSelectedKey] = usePluginState<string | null>('selected', null)\r\n const [lastError, setLastError] = usePluginState<string | null>('lastError', null)\r\n\r\n const attempt = React.useCallback(\r\n async (action: () => Promise<void>) => {\r\n try {\r\n await action()\r\n setLastError(null)\r\n return true\r\n }\r\n catch (error) {\r\n const message = error instanceof Error ? error.message : String(error)\r\n console.error('[hello-bim] save failed:', error)\r\n setLastError(message)\r\n return false\r\n }\r\n },\r\n [setLastError],\r\n )\r\n\r\n const annotations = React.useMemo(\r\n () => new Map(store.items.map(item => [item.key, item.data])),\r\n [store.items],\r\n )\r\n\r\n const spaces = React.useMemo<Space[]>(\r\n () => discovered.map((found) => {\r\n const key = spaceKey(found.modelId, found.localId)\r\n const annotation = annotations.get(key)\r\n\r\n return {\r\n key,\r\n modelId: found.modelId,\r\n localId: found.localId,\r\n ifcName: found.ifcName,\r\n name: annotation?.name ?? found.ifcName,\r\n // Hashed, so an unpicked colour is stable per space rather than shuffling.\r\n colour: annotation?.colour ?? stringToColour(key),\r\n annotated: annotation !== undefined,\r\n }\r\n }),\r\n [discovered, annotations],\r\n )\r\n\r\n const byKey = React.useMemo(\r\n () => new Map(spaces.map(space => [space.key, space])),\r\n [spaces],\r\n )\r\n\r\n /** One edit path, so a field added to the annotation cannot be dropped by a rename. */\r\n const patch = React.useCallback(\r\n async (key: string, changes: Partial<SpaceAnnotation>) => {\r\n const current = byKey.get(key)\r\n if (!current) return\r\n\r\n await attempt(() => store.put(key, {\r\n name: current.name,\r\n colour: current.colour,\r\n ...changes,\r\n }))\r\n },\r\n [store, byKey, attempt],\r\n )\r\n\r\n const rename = React.useCallback(\r\n async (key: string, name: string) => {\r\n const trimmed = name.trim()\r\n if (!trimmed || trimmed === byKey.get(key)?.name) return\r\n await patch(key, { name: trimmed })\r\n },\r\n [patch, byKey],\r\n )\r\n\r\n const setColour = React.useCallback(\r\n (key: string, colour: string) => patch(key, { colour }),\r\n [patch],\r\n )\r\n\r\n /** Drops the annotation, so the space goes back to its IFC name and a hashed colour. */\r\n const reset = React.useCallback(\r\n async (key: string) => {\r\n if (!byKey.get(key)?.annotated) return\r\n await attempt(() => store.remove(key))\r\n },\r\n [store, byKey, attempt],\r\n )\r\n\r\n return {\r\n spaces,\r\n isLoading: store.isLoading || scanning,\r\n lastError,\r\n selected: selectedKey === null ? null : byKey.get(selectedKey) ?? null,\r\n select: setSelectedKey,\r\n rename,\r\n setColour,\r\n reset,\r\n }\r\n}\r\n\r\n/**\r\n * Whether the spaces are painted, applied from an effect so a recolour repaints at once.\r\n * The flag is plugin state, so the toolbar and the tab agree on it.\r\n */\r\nexport function useSpacePainting() {\r\n const { spaces } = useSpaces()\r\n const { setItemsVisible } = useBimViewer()\r\n const { setAppearance, clearAppearance } = usePluginBimAppearance()\r\n const [painted, setPainted] = usePluginState('painted', false)\r\n\r\n React.useEffect(() => {\r\n if (!painted) {\r\n clearAppearance()\r\n return\r\n }\r\n if (spaces.length === 0) return\r\n\r\n // IfcSpaces start hidden, so painting them without this colours nothing visible.\r\n void setItemsVisible(toModelIdMap(spaces), true)\r\n\r\n setAppearance(spaces.map(space => ({\r\n items: toModelIdMap([space]),\r\n appearance: { color: hexToInt(space.colour) },\r\n })))\r\n }, [painted, spaces, setAppearance, clearAppearance, setItemsVisible])\r\n\r\n return { painted, setPainted }\r\n}\r\n\r\n/** `#rrggbb` to the `0xRRGGBB` the appearance API takes. */\r\nexport function hexToInt(colour: string): number {\r\n return Number.parseInt(colour.replace('#', ''), 16)\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;AAKA,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB,oBAAoB;AACrD,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAyBxB,SAAS,SAAS,SAAi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AS,QAAwB;AAC/C,SAAO,OAAO,SAAS,OAAO,QAAQ,KAAK,EAAE,GAAG,EAAE;AACpD;","names":["_a"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MapToolProps } from '../../sdk/mapViewer';
|
|
3
|
+
import type { ToolbarToolProps } from '../../sdk/types';
|
|
4
|
+
/**
|
|
5
|
+
* Where the map is, and a button to record it. The marker itself is drawn by `MarkersLayer`,
|
|
6
|
+
* because this panel unmounts as soon as the dropdown closes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function MapTool({ map }: ToolbarToolProps & MapToolProps): React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=MapTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapTool.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-map/components/MapTool.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAMvD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,gBAAgB,GAAG,YAAY,qBA4E/D"}
|