@collabdt/core 0.4.8 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/core/components/AppSidebarContent.js +2 -2
  2. package/dist/core/components/AppSidebarContent.js.map +1 -1
  3. package/dist/core/components/viewers/Data/DataMenu.js +1 -1
  4. package/dist/core/components/viewers/Data/DataMenu.js.map +1 -1
  5. package/dist/core/components/viewers/Data/utils/viewerConfig.js +1 -1
  6. package/dist/core/components/viewers/Data/utils/viewerConfig.js.map +1 -1
  7. package/dist/core/components/viewers/Viewer.d.ts.map +1 -1
  8. package/dist/core/components/viewers/Viewer.js +6 -1
  9. package/dist/core/components/viewers/Viewer.js.map +1 -1
  10. package/dist/core/components/viewers/bim/BimViewer.d.ts.map +1 -1
  11. package/dist/core/components/viewers/bim/BimViewer.js +4 -0
  12. package/dist/core/components/viewers/bim/BimViewer.js.map +1 -1
  13. package/dist/core/components/viewers/bim/src/ModelsSync.d.ts +17 -0
  14. package/dist/core/components/viewers/bim/src/ModelsSync.d.ts.map +1 -0
  15. package/dist/core/components/viewers/bim/src/ModelsSync.js +35 -0
  16. package/dist/core/components/viewers/bim/src/ModelsSync.js.map +1 -0
  17. package/dist/core/components/viewers/bim/src/SelectionSync.d.ts +15 -0
  18. package/dist/core/components/viewers/bim/src/SelectionSync.d.ts.map +1 -0
  19. package/dist/core/components/viewers/bim/src/SelectionSync.js +24 -0
  20. package/dist/core/components/viewers/bim/src/SelectionSync.js.map +1 -0
  21. package/dist/core/components/viewers/bim/src/lib/bimCamera.d.ts +17 -0
  22. package/dist/core/components/viewers/bim/src/lib/bimCamera.d.ts.map +1 -0
  23. package/dist/core/components/viewers/bim/src/lib/bimCamera.js +16 -0
  24. package/dist/core/components/viewers/bim/src/lib/bimCamera.js.map +1 -0
  25. package/dist/core/components/viewers/bim/src/lib/bimItemActions.d.ts +13 -0
  26. package/dist/core/components/viewers/bim/src/lib/bimItemActions.d.ts.map +1 -1
  27. package/dist/core/components/viewers/bim/src/lib/bimItemActions.js +13 -0
  28. package/dist/core/components/viewers/bim/src/lib/bimItemActions.js.map +1 -1
  29. package/dist/core/components/viewers/bim/src/lib/bimQueries.d.ts +26 -0
  30. package/dist/core/components/viewers/bim/src/lib/bimQueries.d.ts.map +1 -0
  31. package/dist/core/components/viewers/bim/src/lib/bimQueries.js +72 -0
  32. package/dist/core/components/viewers/bim/src/lib/bimQueries.js.map +1 -0
  33. package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.d.ts +1 -1
  34. package/dist/core/components/viewers/bim/src/tools/bimToolbar.d.ts.map +1 -1
  35. package/dist/core/components/viewers/bim/src/tools/bimToolbar.js +7 -1
  36. package/dist/core/components/viewers/bim/src/tools/bimToolbar.js.map +1 -1
  37. package/dist/core/components/viewers/map/datasets/RowActions.d.ts.map +1 -1
  38. package/dist/core/components/viewers/map/datasets/RowActions.js +90 -20
  39. package/dist/core/components/viewers/map/datasets/RowActions.js.map +1 -1
  40. package/dist/core/components/viewers/map/datasets/index.d.ts +1 -2
  41. package/dist/core/components/viewers/map/datasets/index.d.ts.map +1 -1
  42. package/dist/core/components/viewers/map/datasets/index.js +13 -104
  43. package/dist/core/components/viewers/map/datasets/index.js.map +1 -1
  44. package/dist/core/components/viewers/map/datasets/src/minioDatasets.d.ts +1 -1
  45. package/dist/core/components/viewers/map/datasets/src/minioDatasets.d.ts.map +1 -1
  46. package/dist/core/components/viewers/map/datasets/src/minioDatasets.js +5 -8
  47. package/dist/core/components/viewers/map/datasets/src/minioDatasets.js.map +1 -1
  48. package/dist/core/components/viewers/map/datasets/src/orgVisibility.d.ts +16 -0
  49. package/dist/core/components/viewers/map/datasets/src/orgVisibility.d.ts.map +1 -0
  50. package/dist/core/components/viewers/map/datasets/src/orgVisibility.js +21 -0
  51. package/dist/core/components/viewers/map/datasets/src/orgVisibility.js.map +1 -0
  52. package/dist/core/components/viewers/map/datasets/src/useOrganizationalDatasets.d.ts +28 -0
  53. package/dist/core/components/viewers/map/datasets/src/useOrganizationalDatasets.d.ts.map +1 -0
  54. package/dist/core/components/viewers/map/datasets/src/useOrganizationalDatasets.js +80 -0
  55. package/dist/core/components/viewers/map/datasets/src/useOrganizationalDatasets.js.map +1 -0
  56. package/dist/core/components/viewers/map/legends/MapLegendHost.d.ts.map +1 -1
  57. package/dist/core/components/viewers/map/legends/MapLegendHost.js +2 -4
  58. package/dist/core/components/viewers/map/legends/MapLegendHost.js.map +1 -1
  59. package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/geometryGroups.d.ts +27 -0
  60. package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/geometryGroups.d.ts.map +1 -0
  61. package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/geometryGroups.js +53 -0
  62. package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/geometryGroups.js.map +1 -0
  63. package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/index.d.ts.map +1 -1
  64. package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/index.js +102 -100
  65. package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/index.js.map +1 -1
  66. package/dist/core/components/viewers/map/src/MapSidebar/src/LayersTab/index.d.ts.map +1 -1
  67. package/dist/core/components/viewers/map/src/MapSidebar/src/LayersTab/index.js +2 -34
  68. package/dist/core/components/viewers/map/src/MapSidebar/src/LayersTab/index.js.map +1 -1
  69. package/dist/core/components/viewers/map/src/tools/AddTools/AddDataset/DatasetAdder.d.ts +3 -11
  70. package/dist/core/components/viewers/map/src/tools/AddTools/AddDataset/DatasetAdder.d.ts.map +1 -1
  71. package/dist/core/components/viewers/map/src/tools/AddTools/AddDataset/DatasetAdder.js +28 -13
  72. package/dist/core/components/viewers/map/src/tools/AddTools/AddDataset/DatasetAdder.js.map +1 -1
  73. package/dist/core/components/viewers/map/src/tools/AddTools/AddToMap.d.ts +1 -2
  74. package/dist/core/components/viewers/map/src/tools/AddTools/AddToMap.d.ts.map +1 -1
  75. package/dist/core/components/viewers/map/src/tools/AddTools/AddToMap.js +1 -2
  76. package/dist/core/components/viewers/map/src/tools/AddTools/AddToMap.js.map +1 -1
  77. package/dist/core/components/viewers/map/src/tools/DatasetMapTool.d.ts +1 -2
  78. package/dist/core/components/viewers/map/src/tools/DatasetMapTool.d.ts.map +1 -1
  79. package/dist/core/components/viewers/map/src/tools/DatasetMapTool.js +1 -2
  80. package/dist/core/components/viewers/map/src/tools/DatasetMapTool.js.map +1 -1
  81. package/dist/core/components/viewers/map/src/tools/mapTools.d.ts.map +1 -1
  82. package/dist/core/components/viewers/map/src/tools/mapTools.js +28 -1
  83. package/dist/core/components/viewers/map/src/tools/mapTools.js.map +1 -1
  84. package/dist/core/components/viewers/plugins/PluginsManager.d.ts +20 -0
  85. package/dist/core/components/viewers/plugins/PluginsManager.d.ts.map +1 -0
  86. package/dist/core/components/viewers/plugins/PluginsManager.js +245 -0
  87. package/dist/core/components/viewers/plugins/PluginsManager.js.map +1 -0
  88. package/dist/core/components/viewers/plugins/src/PluginCard.d.ts +14 -0
  89. package/dist/core/components/viewers/plugins/src/PluginCard.d.ts.map +1 -0
  90. package/dist/core/components/viewers/plugins/src/PluginCard.js +235 -0
  91. package/dist/core/components/viewers/plugins/src/PluginCard.js.map +1 -0
  92. package/dist/core/components/viewers/plugins/src/pluginStatus.d.ts +9 -0
  93. package/dist/core/components/viewers/plugins/src/pluginStatus.d.ts.map +1 -0
  94. package/dist/core/components/viewers/plugins/src/pluginStatus.js +10 -0
  95. package/dist/core/components/viewers/plugins/src/pluginStatus.js.map +1 -0
  96. package/dist/core/components/viewers/plugins/src/useMountedPlugins.d.ts +14 -0
  97. package/dist/core/components/viewers/plugins/src/useMountedPlugins.d.ts.map +1 -0
  98. package/dist/core/components/viewers/plugins/src/useMountedPlugins.js +24 -0
  99. package/dist/core/components/viewers/plugins/src/useMountedPlugins.js.map +1 -0
  100. package/dist/core/components/viewers/plugins/src/usePluginEnablement.d.ts +16 -0
  101. package/dist/core/components/viewers/plugins/src/usePluginEnablement.d.ts.map +1 -0
  102. package/dist/core/components/viewers/plugins/src/usePluginEnablement.js +18 -0
  103. package/dist/core/components/viewers/plugins/src/usePluginEnablement.js.map +1 -0
  104. package/dist/core/components/viewers/plugins/src/usePluginsData.d.ts +22 -0
  105. package/dist/core/components/viewers/plugins/src/usePluginsData.d.ts.map +1 -0
  106. package/dist/core/components/viewers/plugins/src/usePluginsData.js +81 -0
  107. package/dist/core/components/viewers/plugins/src/usePluginsData.js.map +1 -0
  108. package/dist/core/components/viewers/plugins/types.d.ts +66 -0
  109. package/dist/core/components/viewers/plugins/types.d.ts.map +1 -0
  110. package/dist/core/components/viewers/plugins/types.js +1 -0
  111. package/dist/core/components/viewers/plugins/types.js.map +1 -0
  112. package/dist/core/components/viewers/pointcloud/PointCloudToolbar.js +2 -2
  113. package/dist/core/components/viewers/pointcloud/PointCloudToolbar.js.map +1 -1
  114. package/dist/core/components/viewers/pointcloud/src/tools/index.d.ts +1 -1
  115. package/dist/core/components/viewers/pointcloud/src/tools/index.d.ts.map +1 -1
  116. package/dist/core/components/viewers/pointcloud/src/tools/index.js +3 -2
  117. package/dist/core/components/viewers/pointcloud/src/tools/index.js.map +1 -1
  118. package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.d.ts +10 -1
  119. package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.d.ts.map +1 -1
  120. package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.js +11 -3
  121. package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.js.map +1 -1
  122. package/dist/core/hooks/plugins/createPluginHooks.d.ts +40 -0
  123. package/dist/core/hooks/plugins/createPluginHooks.d.ts.map +1 -0
  124. package/dist/core/hooks/plugins/createPluginHooks.js +71 -0
  125. package/dist/core/hooks/plugins/createPluginHooks.js.map +1 -0
  126. package/dist/core/hooks/plugins/plugins.d.ts +18 -0
  127. package/dist/core/hooks/plugins/plugins.d.ts.map +1 -0
  128. package/dist/core/hooks/plugins/plugins.js +10 -0
  129. package/dist/core/hooks/plugins/plugins.js.map +1 -0
  130. package/dist/core/hooks/ports/apiAdapter.d.ts +9 -0
  131. package/dist/core/hooks/ports/apiAdapter.d.ts.map +1 -1
  132. package/dist/core/hooks/provider.d.ts +2 -0
  133. package/dist/core/hooks/provider.d.ts.map +1 -1
  134. package/dist/core/hooks/provider.js +3 -1
  135. package/dist/core/hooks/provider.js.map +1 -1
  136. package/dist/core/i18n/index.d.ts +6 -0
  137. package/dist/core/i18n/index.d.ts.map +1 -1
  138. package/dist/core/i18n/index.js +29 -1
  139. package/dist/core/i18n/index.js.map +1 -1
  140. package/dist/core/i18n/messages/en.json +81 -4
  141. package/dist/core/i18n/messages/es.json +82 -5
  142. package/dist/core/i18n/messages/fr.json +81 -4
  143. package/dist/core/plugins/enablement.d.ts +50 -0
  144. package/dist/core/plugins/enablement.d.ts.map +1 -0
  145. package/dist/core/plugins/enablement.js +37 -0
  146. package/dist/core/plugins/enablement.js.map +1 -0
  147. package/dist/core/plugins/hello-bim/components/HelloBimTool.d.ts +18 -0
  148. package/dist/core/plugins/hello-bim/components/HelloBimTool.d.ts.map +1 -0
  149. package/dist/core/plugins/hello-bim/components/HelloBimTool.js +142 -0
  150. package/dist/core/plugins/hello-bim/components/HelloBimTool.js.map +1 -0
  151. package/dist/core/plugins/hello-bim/index.d.ts +11 -0
  152. package/dist/core/plugins/hello-bim/index.d.ts.map +1 -0
  153. package/dist/core/plugins/hello-bim/index.js +14 -0
  154. package/dist/core/plugins/hello-bim/index.js.map +1 -0
  155. package/dist/core/plugins/hello-bim/manifest.json +61 -0
  156. package/dist/core/plugins/hello-map/components/HelloMapTool.d.ts +14 -0
  157. package/dist/core/plugins/hello-map/components/HelloMapTool.d.ts.map +1 -0
  158. package/dist/core/plugins/hello-map/components/HelloMapTool.js +59 -0
  159. package/dist/core/plugins/hello-map/components/HelloMapTool.js.map +1 -0
  160. package/dist/core/plugins/hello-map/index.d.ts +10 -0
  161. package/dist/core/plugins/hello-map/index.d.ts.map +1 -0
  162. package/dist/core/plugins/hello-map/index.js +14 -0
  163. package/dist/core/plugins/hello-map/index.js.map +1 -0
  164. package/dist/core/plugins/hello-map/manifest.json +56 -0
  165. package/dist/core/plugins/host/context.d.ts.map +1 -1
  166. package/dist/core/plugins/host/context.js.map +1 -1
  167. package/dist/core/plugins/host/errors.d.ts +11 -0
  168. package/dist/core/plugins/host/errors.d.ts.map +1 -1
  169. package/dist/core/plugins/host/errors.js +22 -1
  170. package/dist/core/plugins/host/errors.js.map +1 -1
  171. package/dist/core/plugins/host/host.d.ts +7 -0
  172. package/dist/core/plugins/host/host.d.ts.map +1 -1
  173. package/dist/core/plugins/host/host.js +62 -8
  174. package/dist/core/plugins/host/host.js.map +1 -1
  175. package/dist/core/plugins/host/pluginKit.tsconfig.json +45 -0
  176. package/dist/core/plugins/host/provider.d.ts +37 -2
  177. package/dist/core/plugins/host/provider.d.ts.map +1 -1
  178. package/dist/core/plugins/host/provider.js +95 -9
  179. package/dist/core/plugins/host/provider.js.map +1 -1
  180. package/dist/core/plugins/host/registry.d.ts +14 -0
  181. package/dist/core/plugins/host/registry.d.ts.map +1 -1
  182. package/dist/core/plugins/host/registry.js +37 -4
  183. package/dist/core/plugins/host/registry.js.map +1 -1
  184. package/dist/core/plugins/host/runtimeShims.d.ts +15 -0
  185. package/dist/core/plugins/host/runtimeShims.d.ts.map +1 -0
  186. package/dist/core/plugins/host/runtimeShims.js +110 -0
  187. package/dist/core/plugins/host/runtimeShims.js.map +1 -0
  188. package/dist/core/plugins/host/scope.d.ts +21 -0
  189. package/dist/core/plugins/host/scope.d.ts.map +1 -0
  190. package/dist/core/plugins/host/scope.js +36 -0
  191. package/dist/core/plugins/host/scope.js.map +1 -0
  192. package/dist/core/plugins/host/usePluginToolbarTools.d.ts +18 -0
  193. package/dist/core/plugins/host/usePluginToolbarTools.d.ts.map +1 -0
  194. package/dist/core/plugins/host/usePluginToolbarTools.js +93 -0
  195. package/dist/core/plugins/host/usePluginToolbarTools.js.map +1 -0
  196. package/dist/core/plugins/installed.d.ts +14 -11
  197. package/dist/core/plugins/installed.d.ts.map +1 -1
  198. package/dist/core/plugins/installed.js +10 -1
  199. package/dist/core/plugins/installed.js.map +1 -1
  200. package/dist/core/plugins/manifests.d.ts +11 -0
  201. package/dist/core/plugins/manifests.d.ts.map +1 -0
  202. package/dist/core/plugins/manifests.js +10 -0
  203. package/dist/core/plugins/manifests.js.map +1 -0
  204. package/dist/core/plugins/messages.d.ts +15 -0
  205. package/dist/core/plugins/messages.d.ts.map +1 -0
  206. package/dist/core/plugins/messages.js +20 -0
  207. package/dist/core/plugins/messages.js.map +1 -0
  208. package/dist/core/plugins/sdk/bimViewer.d.ts +48 -0
  209. package/dist/core/plugins/sdk/bimViewer.d.ts.map +1 -0
  210. package/dist/core/plugins/sdk/bimViewer.js +50 -0
  211. package/dist/core/plugins/sdk/bimViewer.js.map +1 -0
  212. package/dist/core/plugins/sdk/config.d.ts +10 -0
  213. package/dist/core/plugins/sdk/config.d.ts.map +1 -0
  214. package/dist/core/plugins/sdk/config.js +7 -0
  215. package/dist/core/plugins/sdk/config.js.map +1 -0
  216. package/dist/core/plugins/sdk/data.d.ts +22 -0
  217. package/dist/core/plugins/sdk/data.d.ts.map +1 -0
  218. package/dist/core/plugins/sdk/data.js +68 -0
  219. package/dist/core/plugins/sdk/data.js.map +1 -0
  220. package/dist/core/plugins/sdk/index.d.ts +3 -0
  221. package/dist/core/plugins/sdk/index.d.ts.map +1 -1
  222. package/dist/core/plugins/sdk/index.js +6 -0
  223. package/dist/core/plugins/sdk/index.js.map +1 -1
  224. package/dist/core/plugins/sdk/mapViewer.d.ts +14 -0
  225. package/dist/core/plugins/sdk/mapViewer.d.ts.map +1 -0
  226. package/dist/core/plugins/sdk/mapViewer.js +13 -0
  227. package/dist/core/plugins/sdk/mapViewer.js.map +1 -0
  228. package/dist/core/plugins/sdk/messages.d.ts +27 -0
  229. package/dist/core/plugins/sdk/messages.d.ts.map +1 -0
  230. package/dist/core/plugins/sdk/messages.js +47 -0
  231. package/dist/core/plugins/sdk/messages.js.map +1 -0
  232. package/dist/core/plugins/sdk/permissions.d.ts +14 -0
  233. package/dist/core/plugins/sdk/permissions.d.ts.map +1 -0
  234. package/dist/core/plugins/sdk/permissions.js +10 -0
  235. package/dist/core/plugins/sdk/permissions.js.map +1 -0
  236. package/dist/core/plugins/sdk/pointCloudViewer.d.ts +14 -0
  237. package/dist/core/plugins/sdk/pointCloudViewer.d.ts.map +1 -0
  238. package/dist/core/plugins/sdk/pointCloudViewer.js +15 -0
  239. package/dist/core/plugins/sdk/pointCloudViewer.js.map +1 -0
  240. package/dist/core/plugins/sdk/store.d.ts +35 -0
  241. package/dist/core/plugins/sdk/store.d.ts.map +1 -0
  242. package/dist/core/plugins/sdk/store.js +37 -0
  243. package/dist/core/plugins/sdk/store.js.map +1 -0
  244. package/dist/core/plugins/sdk/types.d.ts +42 -47
  245. package/dist/core/plugins/sdk/types.d.ts.map +1 -1
  246. package/dist/core/plugins/sdk/types.js +10 -6
  247. package/dist/core/plugins/sdk/types.js.map +1 -1
  248. package/dist/core/plugins/sdk/version.d.ts +10 -0
  249. package/dist/core/plugins/sdk/version.d.ts.map +1 -0
  250. package/dist/core/plugins/sdk/version.js +5 -0
  251. package/dist/core/plugins/sdk/version.js.map +1 -0
  252. package/dist/core/plugins/sdk/viewer.d.ts +16 -0
  253. package/dist/core/plugins/sdk/viewer.d.ts.map +1 -0
  254. package/dist/core/plugins/sdk/viewer.js +5 -0
  255. package/dist/core/plugins/sdk/viewer.js.map +1 -0
  256. package/dist/core/store/BIM/context.d.ts.map +1 -1
  257. package/dist/core/store/BIM/context.js +1 -0
  258. package/dist/core/store/BIM/context.js.map +1 -1
  259. package/dist/core/store/BIM/reducer.d.ts +22 -0
  260. package/dist/core/store/BIM/reducer.d.ts.map +1 -1
  261. package/dist/core/store/BIM/reducer.js +11 -1
  262. package/dist/core/store/BIM/reducer.js.map +1 -1
  263. package/dist/core/store/CombineProviders.d.ts +5 -2
  264. package/dist/core/store/CombineProviders.d.ts.map +1 -1
  265. package/dist/core/store/CombineProviders.js +9 -4
  266. package/dist/core/store/CombineProviders.js.map +1 -1
  267. package/dist/core/types/dbTypes.d.ts +1 -0
  268. package/dist/core/types/dbTypes.d.ts.map +1 -1
  269. package/dist/core/types/dbTypes.js.map +1 -1
  270. package/dist/core/types/plugins.d.ts +56 -0
  271. package/dist/core/types/plugins.d.ts.map +1 -0
  272. package/dist/core/types/plugins.js +1 -0
  273. package/dist/core/types/plugins.js.map +1 -0
  274. package/dist/core/types/tools.d.ts +9 -1
  275. package/dist/core/types/tools.d.ts.map +1 -1
  276. package/package.json +9 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/plugins/host/runtimeShims.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\n/** One bare specifier a runtime-loaded plugin may import, and the shim the host serves. */\r\nexport interface RuntimeShim {\r\n /** Filename served under `/plugin-runtime/`. */\r\n file: string\r\n /** Key on `globalThis.__CDT_RUNTIME__` that the host bridge populates. */\r\n bridge: string\r\n /** The bare specifier the plugin writes. */\r\n specifier: string\r\n /** Re-exported by name, because an import map cannot rewrite a namespace. */\r\n exports: string[]\r\n}\r\n\r\n// Part of the host contract, so it lives beside `PLUGIN_HOST_API` rather than in the\r\n// app. Three consumers derive from it — the app's shim generator, the published import\r\n// map, and `@collabdt/plugin-kit`'s build preset — and when they disagree a plugin\r\n// either bundles a second copy of a singleton or dies on an unmapped specifier.\r\n//\r\n// Absent on purpose: `@thatopen/components`, `three`, `maplibre-gl`, `lucide-react`. A\r\n// plugin gets viewer instances as props and names icons by string, so it never imports\r\n// those at runtime — which is what stops a second copy of three.js loading.\r\nexport const PLUGIN_RUNTIME_SHIMS: readonly RuntimeShim[] = [\r\n {\r\n file: 'react.js',\r\n bridge: 'react',\r\n specifier: 'react',\r\n exports: [\r\n 'Children', 'Component', 'Fragment', 'Profiler', 'PureComponent',\r\n 'StrictMode', 'Suspense', 'cloneElement', 'createContext',\r\n 'createElement', 'createRef', 'forwardRef', 'isValidElement', 'lazy',\r\n 'memo', 'startTransition', 'useCallback', 'useContext', 'useDebugValue',\r\n 'useDeferredValue', 'useEffect', 'useId', 'useImperativeHandle',\r\n 'useInsertionEffect', 'useLayoutEffect', 'useMemo', 'useReducer',\r\n 'useRef', 'useState', 'useSyncExternalStore', 'useTransition', 'version',\r\n ],\r\n },\r\n {\r\n file: 'react-dom.js',\r\n bridge: 'reactDom',\r\n specifier: 'react-dom',\r\n exports: ['createPortal', 'flushSync', 'version'],\r\n },\r\n {\r\n file: 'jsx-runtime.js',\r\n bridge: 'jsxRuntime',\r\n specifier: 'react/jsx-runtime',\r\n exports: ['Fragment', 'jsx', 'jsxs'],\r\n },\r\n {\r\n file: 'sdk.js',\r\n bridge: 'sdk',\r\n specifier: '@collabdt/core/plugins-sdk',\r\n exports: ['VALID_CAPABILITIES', 'validateManifest', 'PLUGIN_HOST_API', 'resolvePluginEntry'],\r\n },\r\n {\r\n file: 'sdk-config.js',\r\n bridge: 'sdkConfig',\r\n specifier: '@collabdt/core/plugins-sdk/config',\r\n exports: ['usePluginConfig', 'usePluginId'],\r\n },\r\n {\r\n file: 'sdk-messages.js',\r\n bridge: 'sdkMessages',\r\n specifier: '@collabdt/core/plugins-sdk/messages',\r\n exports: ['usePluginMessage', 'usePluginTranslations', 'useCoreTranslations'],\r\n },\r\n {\r\n file: 'sdk-store.js',\r\n bridge: 'sdkStore',\r\n specifier: '@collabdt/core/plugins-sdk/store',\r\n exports: ['usePluginStore'],\r\n },\r\n {\r\n file: 'sdk-components.js',\r\n bridge: 'sdkComponents',\r\n specifier: '@collabdt/core/plugins-sdk/components',\r\n exports: [\r\n 'Badge', 'Button', 'Input', 'Separator',\r\n 'Card', 'CardContent', 'CardDescription', 'CardFooter', 'CardHeader', 'CardTitle',\r\n 'Dialog', 'DialogClose', 'DialogContent', 'DialogDescription',\r\n 'DialogFooter', 'DialogHeader', 'DialogTitle', 'DialogTrigger',\r\n ],\r\n },\r\n]\r\n\r\n/** Just the specifiers, which is what a bundler's `external` option wants. */\r\nexport const PLUGIN_EXTERNALS: readonly string[] = PLUGIN_RUNTIME_SHIMS.map(\r\n shim => shim.specifier,\r\n)\r\n"],"mappings":"AAuBO,MAAM,uBAA+C;AAAA,EAC1D;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS;AAAA,MACP;AAAA,MAAY;AAAA,MAAa;AAAA,MAAY;AAAA,MAAY;AAAA,MACjD;AAAA,MAAc;AAAA,MAAY;AAAA,MAAgB;AAAA,MAC1C;AAAA,MAAiB;AAAA,MAAa;AAAA,MAAc;AAAA,MAAkB;AAAA,MAC9D;AAAA,MAAQ;AAAA,MAAmB;AAAA,MAAe;AAAA,MAAc;AAAA,MACxD;AAAA,MAAoB;AAAA,MAAa;AAAA,MAAS;AAAA,MAC1C;AAAA,MAAsB;AAAA,MAAmB;AAAA,MAAW;AAAA,MACpD;AAAA,MAAU;AAAA,MAAY;AAAA,MAAwB;AAAA,MAAiB;AAAA,IACjE;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS,CAAC,gBAAgB,aAAa,SAAS;AAAA,EAClD;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS,CAAC,YAAY,OAAO,MAAM;AAAA,EACrC;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS,CAAC,sBAAsB,oBAAoB,mBAAmB,oBAAoB;AAAA,EAC7F;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS,CAAC,mBAAmB,aAAa;AAAA,EAC5C;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS,CAAC,oBAAoB,yBAAyB,qBAAqB;AAAA,EAC9E;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS,CAAC,gBAAgB;AAAA,EAC5B;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,SAAS;AAAA,MACP;AAAA,MAAS;AAAA,MAAU;AAAA,MAAS;AAAA,MAC5B;AAAA,MAAQ;AAAA,MAAe;AAAA,MAAmB;AAAA,MAAc;AAAA,MAAc;AAAA,MACtE;AAAA,MAAU;AAAA,MAAe;AAAA,MAAiB;AAAA,MAC1C;AAAA,MAAgB;AAAA,MAAgB;AAAA,MAAe;AAAA,IACjD;AAAA,EACF;AACF;AAGO,MAAM,mBAAsC,qBAAqB;AAAA,EACtE,UAAQ,KAAK;AACf;","names":[]}
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Names the plugin that owns the subtree, and carries its configuration. Every
4
+ * capability host wraps what it renders from the registry in one of these, which is
5
+ * how the SDK hooks are scoped without a plugin passing its own id around.
6
+ * `pluginId` comes from the registry entry, never from the plugin.
7
+ *
8
+ * Holds no reference to the host or `installed.ts`: plugin components import from
9
+ * here and `installed.ts` imports plugin components, so reaching back would make the
10
+ * module graph a cycle and leave the bindings undefined at render time.
11
+ */
12
+ export declare function PluginScopeProvider({ pluginId, config, children, }: {
13
+ pluginId: string;
14
+ config?: Record<string, unknown>;
15
+ children: React.ReactNode;
16
+ }): React.JSX.Element;
17
+ /** The owning plugin's id. Throws outside a plugin subtree: a shared fallback would mix plugins' data. */
18
+ export declare function usePluginId(): string;
19
+ /** The org's config for this plugin, layered with per-user overrides. Shaped by the manifest's `configSchema`. */
20
+ export declare function usePluginConfig<T extends Record<string, unknown> = Record<string, unknown>>(): T;
21
+ //# sourceMappingURL=scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/host/scope.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,qBAWA;AAED,0GAA0G;AAC1G,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,kHAAkH;AAClH,wBAAgB,eAAe,CAC7B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACxD,CAAC,CAEL"}
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ const PluginScopeContext = React.createContext(null);
5
+ function PluginScopeProvider({
6
+ pluginId,
7
+ config,
8
+ children
9
+ }) {
10
+ const value = React.useMemo(
11
+ () => ({ pluginId, config: config != null ? config : {} }),
12
+ [pluginId, config]
13
+ );
14
+ return /* @__PURE__ */ jsx(PluginScopeContext.Provider, { value, children });
15
+ }
16
+ function usePluginId() {
17
+ return usePluginScope().pluginId;
18
+ }
19
+ function usePluginConfig() {
20
+ return usePluginScope().config;
21
+ }
22
+ function usePluginScope() {
23
+ const scope = React.useContext(PluginScopeContext);
24
+ if (scope === null) {
25
+ throw new Error(
26
+ "This hook is only available inside a plugin component. It must be rendered by a plugin capability host, which supplies the plugin scope."
27
+ );
28
+ }
29
+ return scope;
30
+ }
31
+ export {
32
+ PluginScopeProvider,
33
+ usePluginConfig,
34
+ usePluginId
35
+ };
36
+ //# sourceMappingURL=scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/plugins/host/scope.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\ninterface PluginScope {\r\n pluginId: string\r\n config: Record<string, unknown>\r\n}\r\n\r\nconst PluginScopeContext = React.createContext<PluginScope | null>(null)\r\n\r\n/**\r\n * Names the plugin that owns the subtree, and carries its configuration. Every\r\n * capability host wraps what it renders from the registry in one of these, which is\r\n * how the SDK hooks are scoped without a plugin passing its own id around.\r\n * `pluginId` comes from the registry entry, never from the plugin.\r\n *\r\n * Holds no reference to the host or `installed.ts`: plugin components import from\r\n * here and `installed.ts` imports plugin components, so reaching back would make the\r\n * module graph a cycle and leave the bindings undefined at render time.\r\n */\r\nexport function PluginScopeProvider({\r\n pluginId,\r\n config,\r\n children,\r\n}: {\r\n pluginId: string\r\n config?: Record<string, unknown>\r\n children: React.ReactNode\r\n}) {\r\n const value = React.useMemo(\r\n () => ({ pluginId, config: config ?? {} }),\r\n [pluginId, config],\r\n )\r\n\r\n return (\r\n <PluginScopeContext.Provider value={value}>\r\n {children}\r\n </PluginScopeContext.Provider>\r\n )\r\n}\r\n\r\n/** The owning plugin's id. Throws outside a plugin subtree: a shared fallback would mix plugins' data. */\r\nexport function usePluginId(): string {\r\n return usePluginScope().pluginId\r\n}\r\n\r\n/** The org's config for this plugin, layered with per-user overrides. Shaped by the manifest's `configSchema`. */\r\nexport function usePluginConfig<\r\n T extends Record<string, unknown> = Record<string, unknown>,\r\n>(): T {\r\n return usePluginScope().config as T\r\n}\r\n\r\nfunction usePluginScope(): PluginScope {\r\n const scope = React.useContext(PluginScopeContext)\r\n if (scope === null) {\r\n throw new Error(\r\n 'This hook is only available inside a plugin component. It must be rendered by a plugin capability host, which supplies the plugin scope.',\r\n )\r\n }\r\n return scope\r\n}\r\n"],"mappings":";AAuCI;AAlCJ,YAAY,WAAW;AAOvB,MAAM,qBAAqB,MAAM,cAAkC,IAAI;AAYhE,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,QAAQ,MAAM;AAAA,IAClB,OAAO,EAAE,UAAU,QAAQ,0BAAU,CAAC,EAAE;AAAA,IACxC,CAAC,UAAU,MAAM;AAAA,EACnB;AAEA,SACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAC1B,UACH;AAEJ;AAGO,SAAS,cAAsB;AACpC,SAAO,eAAe,EAAE;AAC1B;AAGO,SAAS,kBAET;AACL,SAAO,eAAe,EAAE;AAC1B;AAEA,SAAS,iBAA8B;AACrC,QAAM,QAAQ,MAAM,WAAW,kBAAkB;AACjD,MAAI,UAAU,MAAM;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import type { Tool } from '../../types/tools';
3
+ import type { ToolbarRegistration } from '../sdk/types';
4
+ import type { LucideProps } from 'lucide-react';
5
+ /** The three toolbar capabilities. All share `ToolbarRegistration`. */
6
+ export type ToolbarCapability = 'map.tools' | 'bim.tools' | 'pointcloud.tools';
7
+ /** A plugin may pass a lucide component, or its name as a string — JSON manifests only carry the string. */
8
+ export declare function resolvePluginIcon(icon: ToolbarRegistration['icon']): React.ComponentType<LucideProps>;
9
+ /**
10
+ * Plugin contributions for one toolbar, as `Tool` objects the toolbars already
11
+ * render: `[...coreTools, ...usePluginToolbarTools('bim.tools', viewerProps)]`.
12
+ *
13
+ * `extraProps` is spread onto the plugin's component by `ToolbarButton` — how a BIM
14
+ * tool gets its viewer handles. Each viewer passes its own, keeping this module free
15
+ * of viewer-engine imports that would pull three into the map bundle.
16
+ */
17
+ export declare function usePluginToolbarTools(capability: ToolbarCapability, extraProps?: Record<string, unknown>): Tool[];
18
+ //# sourceMappingURL=usePluginToolbarTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePluginToolbarTools.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/host/usePluginToolbarTools.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,uEAAuE;AACvE,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,WAAW,GAAG,kBAAkB,CAAA;AAQ9E,4GAA4G;AAC5G,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAChC,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAKlC;AASD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,iBAAiB,EAC7B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,IAAI,EAAE,CAyCR"}
@@ -0,0 +1,93 @@
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
+ var __objRest = (source, exclude) => {
19
+ var target = {};
20
+ for (var prop in source)
21
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
22
+ target[prop] = source[prop];
23
+ if (source != null && __getOwnPropSymbols)
24
+ for (var prop of __getOwnPropSymbols(source)) {
25
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
26
+ target[prop] = source[prop];
27
+ }
28
+ return target;
29
+ };
30
+ import { jsx } from "react/jsx-runtime";
31
+ import * as LR from "lucide-react";
32
+ import * as React from "react";
33
+ import { ToolbarSubmenu } from "../../components/ToolbarSubmenu";
34
+ import { usePluginConfigs, usePluginContributions } from "./provider";
35
+ import { PluginScopeProvider } from "./scope";
36
+ const FALLBACK_ICON = LR.Puzzle;
37
+ function resolvePluginIcon(icon) {
38
+ if (typeof icon !== "string") return icon;
39
+ const candidate = LR[icon];
40
+ return isComponent(candidate) ? candidate : FALLBACK_ICON;
41
+ }
42
+ function isComponent(value) {
43
+ if (typeof value === "function") return true;
44
+ return typeof value === "object" && value !== null && "$$typeof" in value;
45
+ }
46
+ function usePluginToolbarTools(capability, extraProps) {
47
+ const contributions = usePluginContributions(capability);
48
+ const configs = usePluginConfigs();
49
+ const wrapped = React.useRef(/* @__PURE__ */ new Map());
50
+ return React.useMemo(() => {
51
+ const live = /* @__PURE__ */ new Set();
52
+ const tools = contributions.map((contribution) => {
53
+ const id = pluginToolId(contribution);
54
+ live.add(id);
55
+ let Component = wrapped.current.get(id);
56
+ if (!Component) {
57
+ Component = wrapPluginComponent(contribution, () => configs[contribution.pluginId]);
58
+ wrapped.current.set(id, Component);
59
+ }
60
+ return {
61
+ id,
62
+ title: contribution.label,
63
+ icon: resolvePluginIcon(contribution.icon),
64
+ // An invented cursor is a CSS no-op, not a crash, so it goes unvalidated.
65
+ cursor: contribution.cursor,
66
+ stayActive: contribution.stayActive,
67
+ component: Component,
68
+ extraProps
69
+ };
70
+ });
71
+ for (const id of wrapped.current.keys()) {
72
+ if (!live.has(id)) wrapped.current.delete(id);
73
+ }
74
+ return tools;
75
+ }, [contributions, extraProps]);
76
+ }
77
+ function pluginToolId(contribution) {
78
+ return `plugin:${contribution.pluginId}:${contribution.id}`;
79
+ }
80
+ function wrapPluginComponent(contribution, readConfig) {
81
+ const Component = contribution.component;
82
+ function PluginToolboxItem(_a) {
83
+ var _b = _a, { tool } = _b, rest = __objRest(_b, ["tool"]);
84
+ return /* @__PURE__ */ jsx(ToolbarSubmenu, { tool, children: /* @__PURE__ */ jsx(PluginScopeProvider, { pluginId: contribution.pluginId, config: readConfig(), children: /* @__PURE__ */ jsx(Component, __spreadValues({ tool }, rest)) }) });
85
+ }
86
+ PluginToolboxItem.displayName = `PluginTool(${contribution.pluginId}/${contribution.id})`;
87
+ return PluginToolboxItem;
88
+ }
89
+ export {
90
+ resolvePluginIcon,
91
+ usePluginToolbarTools
92
+ };
93
+ //# sourceMappingURL=usePluginToolbarTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/plugins/host/usePluginToolbarTools.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 LR from 'lucide-react'\r\nimport * as React from 'react'\r\n\r\nimport { ToolbarSubmenu } from '../../components/ToolbarSubmenu'\r\n\r\nimport { usePluginConfigs, usePluginContributions, type PluginContribution } from './provider'\r\nimport { PluginScopeProvider } from './scope'\r\n\r\nimport type { CursorType } from '../../types/global'\r\nimport type { Tool } from '../../types/tools'\r\nimport type { ToolbarRegistration } from '../sdk/types'\r\nimport type { LucideProps } from 'lucide-react'\r\n\r\n/** The three toolbar capabilities. All share `ToolbarRegistration`. */\r\nexport type ToolbarCapability = 'map.tools' | 'bim.tools' | 'pointcloud.tools'\r\n\r\n/** What `ToolbarButton` renders for a tool that supplies its own component. */\r\ntype ToolComponent = NonNullable<Tool['component']>\r\n\r\n/** Shown when a plugin names an icon that does not exist, so the button still appears. */\r\nconst FALLBACK_ICON = LR.Puzzle\r\n\r\n/** A plugin may pass a lucide component, or its name as a string — JSON manifests only carry the string. */\r\nexport function resolvePluginIcon(\r\n icon: ToolbarRegistration['icon'],\r\n): React.ComponentType<LucideProps> {\r\n if (typeof icon !== 'string') return icon\r\n\r\n const candidate = (LR as unknown as Record<string, unknown>)[icon]\r\n return isComponent(candidate) ? candidate : FALLBACK_ICON\r\n}\r\n\r\n// Lucide icons are `forwardRef` objects, so a bare `typeof === 'function'` check\r\n// rejects every real icon. Anything renderable is callable or carries `$$typeof`.\r\nfunction isComponent(value: unknown): value is React.ComponentType<LucideProps> {\r\n if (typeof value === 'function') return true\r\n return typeof value === 'object' && value !== null && '$$typeof' in value\r\n}\r\n\r\n/**\r\n * Plugin contributions for one toolbar, as `Tool` objects the toolbars already\r\n * render: `[...coreTools, ...usePluginToolbarTools('bim.tools', viewerProps)]`.\r\n *\r\n * `extraProps` is spread onto the plugin's component by `ToolbarButton` — how a BIM\r\n * tool gets its viewer handles. Each viewer passes its own, keeping this module free\r\n * of viewer-engine imports that would pull three into the map bundle.\r\n */\r\nexport function usePluginToolbarTools(\r\n capability: ToolbarCapability,\r\n extraProps?: Record<string, unknown>,\r\n): Tool[] {\r\n const contributions = usePluginContributions(capability)\r\n const configs = usePluginConfigs()\r\n\r\n // Cached by tool id to keep component identity stable. `extraProps` changes on\r\n // most renders (it carries live viewer handles), and rebuilding on each would\r\n // remount the plugin's panel and lose its state on every camera move.\r\n const wrapped = React.useRef(new Map<string, ToolComponent>())\r\n\r\n return React.useMemo(() => {\r\n const live = new Set<string>()\r\n\r\n const tools = contributions.map(contribution => {\r\n const id = pluginToolId(contribution)\r\n live.add(id)\r\n\r\n let Component = wrapped.current.get(id)\r\n if (!Component) {\r\n Component = wrapPluginComponent(contribution, () => configs[contribution.pluginId])\r\n wrapped.current.set(id, Component)\r\n }\r\n\r\n return {\r\n id,\r\n title: contribution.label,\r\n icon: resolvePluginIcon(contribution.icon),\r\n // An invented cursor is a CSS no-op, not a crash, so it goes unvalidated.\r\n cursor: contribution.cursor as CursorType | undefined,\r\n stayActive: contribution.stayActive,\r\n component: Component,\r\n extraProps,\r\n } satisfies Tool\r\n })\r\n\r\n // Drop cache entries for plugins that have since been disabled.\r\n for (const id of wrapped.current.keys()) {\r\n if (!live.has(id)) wrapped.current.delete(id)\r\n }\r\n\r\n return tools\r\n }, [contributions, extraProps])\r\n}\r\n\r\nfunction pluginToolId(contribution: PluginContribution<ToolbarCapability>) {\r\n return `plugin:${contribution.pluginId}:${contribution.id}` as const\r\n}\r\n\r\n/**\r\n * Wrap a plugin's component into a real toolbar entry.\r\n *\r\n * `ToolbarButton` renders `tool.component` *instead of* a button, so a plugin\r\n * returning a panel would render it inline and blow the strip out of the viewport.\r\n * `ToolbarSubmenu` gives it the same ghost button and dropdown every core tool has,\r\n * built from the `label` and `icon` it already declared. The wrapper also supplies\r\n * the plugin scope the scoped SDK hooks read.\r\n */\r\nfunction wrapPluginComponent(\r\n contribution: PluginContribution<ToolbarCapability>,\r\n // Lazily, because the component identity is cached: capturing the config by value\r\n // would freeze it at whatever it was on first render.\r\n readConfig: () => Record<string, unknown> | undefined,\r\n): ToolComponent {\r\n // Props are typed per capability at `ctx.register`. This wrapper forwards whatever\r\n // the hosting toolbar passed, so the shape is erased here on purpose.\r\n const Component = contribution.component as unknown as React.ComponentType<Record<string, unknown>>\r\n\r\n function PluginToolboxItem({ tool, ...rest }: React.ComponentProps<ToolComponent>) {\r\n return (\r\n <ToolbarSubmenu tool={tool}>\r\n <PluginScopeProvider pluginId={contribution.pluginId} config={readConfig()}>\r\n <Component tool={tool} {...rest} />\r\n </PluginScopeProvider>\r\n </ToolbarSubmenu>\r\n )\r\n }\r\n\r\n PluginToolboxItem.displayName = `PluginTool(${contribution.pluginId}/${contribution.id})`\r\n return PluginToolboxItem\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HU;AAxHV,YAAY,QAAQ;AACpB,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB,8BAAuD;AAClF,SAAS,2BAA2B;AAcpC,MAAM,gBAAgB,GAAG;AAGlB,SAAS,kBACd,MACkC;AAClC,MAAI,OAAO,SAAS,SAAU,QAAO;AAErC,QAAM,YAAa,GAA0C,IAAI;AACjE,SAAO,YAAY,SAAS,IAAI,YAAY;AAC9C;AAIA,SAAS,YAAY,OAA2D;AAC9E,MAAI,OAAO,UAAU,WAAY,QAAO;AACxC,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,cAAc;AACtE;AAUO,SAAS,sBACd,YACA,YACQ;AACR,QAAM,gBAAgB,uBAAuB,UAAU;AACvD,QAAM,UAAU,iBAAiB;AAKjC,QAAM,UAAU,MAAM,OAAO,oBAAI,IAA2B,CAAC;AAE7D,SAAO,MAAM,QAAQ,MAAM;AACzB,UAAM,OAAO,oBAAI,IAAY;AAE7B,UAAM,QAAQ,cAAc,IAAI,kBAAgB;AAC9C,YAAM,KAAK,aAAa,YAAY;AACpC,WAAK,IAAI,EAAE;AAEX,UAAI,YAAY,QAAQ,QAAQ,IAAI,EAAE;AACtC,UAAI,CAAC,WAAW;AACd,oBAAY,oBAAoB,cAAc,MAAM,QAAQ,aAAa,QAAQ,CAAC;AAClF,gBAAQ,QAAQ,IAAI,IAAI,SAAS;AAAA,MACnC;AAEA,aAAO;AAAA,QACL;AAAA,QACA,OAAO,aAAa;AAAA,QACpB,MAAM,kBAAkB,aAAa,IAAI;AAAA;AAAA,QAEzC,QAAQ,aAAa;AAAA,QACrB,YAAY,aAAa;AAAA,QACzB,WAAW;AAAA,QACX;AAAA,MACF;AAAA,IACF,CAAC;AAGD,eAAW,MAAM,QAAQ,QAAQ,KAAK,GAAG;AACvC,UAAI,CAAC,KAAK,IAAI,EAAE,EAAG,SAAQ,QAAQ,OAAO,EAAE;AAAA,IAC9C;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,UAAU,CAAC;AAChC;AAEA,SAAS,aAAa,cAAqD;AACzE,SAAO,UAAU,aAAa,QAAQ,IAAI,aAAa,EAAE;AAC3D;AAWA,SAAS,oBACP,cAGA,YACe;AAGf,QAAM,YAAY,aAAa;AAE/B,WAAS,kBAAkB,IAAwD;AAAxD,iBAAE,OAzH/B,IAyH6B,IAAW,iBAAX,IAAW,CAAT;AAC3B,WACE,oBAAC,kBAAe,MACd,8BAAC,uBAAoB,UAAU,aAAa,UAAU,QAAQ,WAAW,GACvE,8BAAC,4BAAU,QAAgB,KAAM,GACnC,GACF;AAAA,EAEJ;AAEA,oBAAkB,cAAc,cAAc,aAAa,QAAQ,IAAI,aAAa,EAAE;AACtF,SAAO;AACT;","names":[]}
@@ -1,16 +1,19 @@
1
- import type { PluginEntry, PluginManifest } from './sdk/types';
1
+ import type { PluginSource } from './sdk/types';
2
2
  /**
3
- * The plugins this app runs, in load order.
3
+ * The plugins compiled into this build of core, in load order. To add one: put its
4
+ * manifest in `manifests.ts`, then pair that slug with a dynamic import here.
4
5
  *
5
- * To add a plugin: import its manifest and entry, then push a new entry onto this array.
6
- * import * as myPlugin from './my-plugin'
7
- * import myManifest from './my-plugin/manifest.json'
8
- * INSTALLED_PLUGINS.push({ manifest: myManifest as PluginManifest, entry: myPlugin })
6
+ * Entries must stay dynamic imports. `installed.ts` is reachable from
7
+ * `PluginHostProvider`, which sits in every route's provider tree, so a static
8
+ * import would put every plugin's components — `@thatopen` and three among them —
9
+ * in the eager bundle. Resolved at activation time instead, one chunk each.
9
10
  *
10
- * To disable a plugin: comment out or remove its entry.
11
+ * A default only: a consumer can pass its own list via
12
+ * `<PluginHostProvider plugins={...}>` and gate it with `enabledSlugs`.
13
+ *
14
+ * The `hello-*` pair are the documentation's worked examples and the boundary's
15
+ * regression test — they import nothing outside `sdk/`, so an insufficient plugin
16
+ * surface stops them compiling.
11
17
  */
12
- export declare const INSTALLED_PLUGINS: Array<{
13
- manifest: PluginManifest;
14
- entry: PluginEntry;
15
- }>;
18
+ export declare const INSTALLED_PLUGINS: PluginSource[];
16
19
  //# sourceMappingURL=installed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installed.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/installed.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC;IACpC,QAAQ,EAAE,cAAc,CAAA;IACxB,KAAK,EAAE,WAAW,CAAA;CACnB,CAAM,CAAA"}
1
+ {"version":3,"file":"installed.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/installed.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,aAAa,CAAA;AAS/D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAG3C,CAAA"}
@@ -1,4 +1,13 @@
1
- const INSTALLED_PLUGINS = [];
1
+ import { PLUGIN_MANIFESTS } from "./manifests";
2
+ function manifestFor(slug) {
3
+ const manifest = PLUGIN_MANIFESTS.find((candidate) => candidate.slug === slug);
4
+ if (!manifest) throw new Error(`No manifest registered in manifests.ts for plugin "${slug}"`);
5
+ return manifest;
6
+ }
7
+ const INSTALLED_PLUGINS = [
8
+ { manifest: manifestFor("hello-map"), entry: () => import("./hello-map") },
9
+ { manifest: manifestFor("hello-bim"), entry: () => import("./hello-bim") }
10
+ ];
2
11
  export {
3
12
  INSTALLED_PLUGINS
4
13
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/core/plugins/installed.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport type { PluginEntry, PluginManifest } from './sdk/types'\r\n\r\n/**\r\n * The plugins this app runs, in load order.\r\n *\r\n * To add a plugin: import its manifest and entry, then push a new entry onto this array.\r\n * import * as myPlugin from './my-plugin'\r\n * import myManifest from './my-plugin/manifest.json'\r\n * INSTALLED_PLUGINS.push({ manifest: myManifest as PluginManifest, entry: myPlugin })\r\n *\r\n * To disable a plugin: comment out or remove its entry.\r\n */\r\nexport const INSTALLED_PLUGINS: Array<{\r\n manifest: PluginManifest\r\n entry: PluginEntry\r\n}> = []\r\n"],"mappings":"AAeO,MAAM,oBAGR,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/core/plugins/installed.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { PLUGIN_MANIFESTS } from './manifests'\r\n\r\nimport type { PluginManifest, PluginSource } from './sdk/types'\r\n\r\n/** Looked up by slug, not by position: reordering `manifests.ts` must not mispair. */\r\nfunction manifestFor(slug: string): PluginManifest {\r\n const manifest = PLUGIN_MANIFESTS.find(candidate => candidate.slug === slug)\r\n if (!manifest) throw new Error(`No manifest registered in manifests.ts for plugin \"${slug}\"`)\r\n return manifest\r\n}\r\n\r\n/**\r\n * The plugins compiled into this build of core, in load order. To add one: put its\r\n * manifest in `manifests.ts`, then pair that slug with a dynamic import here.\r\n *\r\n * Entries must stay dynamic imports. `installed.ts` is reachable from\r\n * `PluginHostProvider`, which sits in every route's provider tree, so a static\r\n * import would put every plugin's components — `@thatopen` and three among them —\r\n * in the eager bundle. Resolved at activation time instead, one chunk each.\r\n *\r\n * A default only: a consumer can pass its own list via\r\n * `<PluginHostProvider plugins={...}>` and gate it with `enabledSlugs`.\r\n *\r\n * The `hello-*` pair are the documentation's worked examples and the boundary's\r\n * regression test — they import nothing outside `sdk/`, so an insufficient plugin\r\n * surface stops them compiling.\r\n */\r\nexport const INSTALLED_PLUGINS: PluginSource[] = [\r\n { manifest: manifestFor('hello-map'), entry: () => import('./hello-map') },\r\n { manifest: manifestFor('hello-bim'), entry: () => import('./hello-bim') },\r\n]\r\n"],"mappings":"AAGA,SAAS,wBAAwB;AAKjC,SAAS,YAAY,MAA8B;AACjD,QAAM,WAAW,iBAAiB,KAAK,eAAa,UAAU,SAAS,IAAI;AAC3E,MAAI,CAAC,SAAU,OAAM,IAAI,MAAM,sDAAsD,IAAI,GAAG;AAC5F,SAAO;AACT;AAkBO,MAAM,oBAAoC;AAAA,EAC/C,EAAE,UAAU,YAAY,WAAW,GAAG,OAAO,MAAM,OAAO,aAAa,EAAE;AAAA,EACzE,EAAE,UAAU,YAAY,WAAW,GAAG,OAAO,MAAM,OAAO,aAAa,EAAE;AAC3E;","names":[]}
@@ -0,0 +1,11 @@
1
+ import type { PluginManifest } from './sdk/types';
2
+ /**
3
+ * The manifests of the plugins compiled into this build, separate from
4
+ * `installed.ts` so they can be read without their entry modules.
5
+ *
6
+ * `i18n/index.ts` collects plugin strings and is reachable from the server graph
7
+ * through the `./messages` export, so it must read manifests without dragging in a
8
+ * plugin's components and, with them, a viewer engine. Plain JSON, no runtime deps.
9
+ */
10
+ export declare const PLUGIN_MANIFESTS: PluginManifest[];
11
+ //# sourceMappingURL=manifests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/manifests.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAG5C,CAAA"}
@@ -0,0 +1,10 @@
1
+ import helloBimManifest from "./hello-bim/manifest.json";
2
+ import helloMapManifest from "./hello-map/manifest.json";
3
+ const PLUGIN_MANIFESTS = [
4
+ helloMapManifest,
5
+ helloBimManifest
6
+ ];
7
+ export {
8
+ PLUGIN_MANIFESTS
9
+ };
10
+ //# sourceMappingURL=manifests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/plugins/manifests.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport helloBimManifest from './hello-bim/manifest.json'\r\nimport helloMapManifest from './hello-map/manifest.json'\r\n\r\nimport type { PluginManifest } from './sdk/types'\r\n\r\n/**\r\n * The manifests of the plugins compiled into this build, separate from\r\n * `installed.ts` so they can be read without their entry modules.\r\n *\r\n * `i18n/index.ts` collects plugin strings and is reachable from the server graph\r\n * through the `./messages` export, so it must read manifests without dragging in a\r\n * plugin's components and, with them, a viewer engine. Plain JSON, no runtime deps.\r\n */\r\nexport const PLUGIN_MANIFESTS: PluginManifest[] = [\r\n helloMapManifest as PluginManifest,\r\n helloBimManifest as PluginManifest,\r\n]\r\n"],"mappings":"AAGA,OAAO,sBAAsB;AAC7B,OAAO,sBAAsB;AAYtB,MAAM,mBAAqC;AAAA,EAChD;AAAA,EACA;AACF;","names":[]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Plugin-owned strings, re-keyed from `manifest.messages[locale][key]` into
3
+ * `locale → slug → key`, the shape `coreMessages` needs. Keeping them in the
4
+ * manifest makes a plugin one file to write and one to hand a translator, and lets
5
+ * mounted plugins resolve identically at `plugins.<slug>.<key>`.
6
+ *
7
+ * A plugin with no `messages` contributes nothing and falls back to the inline
8
+ * English its components pass to `usePluginTranslations`.
9
+ */
10
+ export declare const pluginMessages: Record<string, Record<string, unknown>>;
11
+ export declare function collectPluginMessages(manifests: Array<{
12
+ slug: string;
13
+ messages?: Record<string, Record<string, unknown>>;
14
+ }>): Record<string, Record<string, unknown>>;
15
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/core/plugins/messages.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAA2C,CAAA;AAE9G,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAAC,GACrF,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAczC"}
@@ -0,0 +1,20 @@
1
+ import { PLUGIN_MANIFESTS } from "./manifests";
2
+ const pluginMessages = collectPluginMessages(PLUGIN_MANIFESTS);
3
+ function collectPluginMessages(manifests) {
4
+ var _a;
5
+ const byLocale = {};
6
+ for (const { slug, messages } of manifests) {
7
+ if (!messages) continue;
8
+ for (const [locale, strings] of Object.entries(messages)) {
9
+ if (!strings || typeof strings !== "object") continue;
10
+ (_a = byLocale[locale]) != null ? _a : byLocale[locale] = {};
11
+ byLocale[locale][slug] = strings;
12
+ }
13
+ }
14
+ return byLocale;
15
+ }
16
+ export {
17
+ collectPluginMessages,
18
+ pluginMessages
19
+ };
20
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/core/plugins/messages.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { PLUGIN_MANIFESTS } from './manifests'\r\n\r\n/**\r\n * Plugin-owned strings, re-keyed from `manifest.messages[locale][key]` into\r\n * `locale → slug → key`, the shape `coreMessages` needs. Keeping them in the\r\n * manifest makes a plugin one file to write and one to hand a translator, and lets\r\n * mounted plugins resolve identically at `plugins.<slug>.<key>`.\r\n *\r\n * A plugin with no `messages` contributes nothing and falls back to the inline\r\n * English its components pass to `usePluginTranslations`.\r\n */\r\nexport const pluginMessages: Record<string, Record<string, unknown>> = collectPluginMessages(PLUGIN_MANIFESTS)\r\n\r\nexport function collectPluginMessages(\r\n manifests: Array<{ slug: string; messages?: Record<string, Record<string, unknown>> }>,\r\n): Record<string, Record<string, unknown>> {\r\n const byLocale: Record<string, Record<string, unknown>> = {}\r\n\r\n for (const { slug, messages } of manifests) {\r\n if (!messages) continue\r\n\r\n for (const [locale, strings] of Object.entries(messages)) {\r\n if (!strings || typeof strings !== 'object') continue\r\n byLocale[locale] ??= {}\r\n byLocale[locale][slug] = strings\r\n }\r\n }\r\n\r\n return byLocale\r\n}\r\n"],"mappings":"AAGA,SAAS,wBAAwB;AAW1B,MAAM,iBAA0D,sBAAsB,gBAAgB;AAEtG,SAAS,sBACd,WACyC;AAlB3C;AAmBE,QAAM,WAAoD,CAAC;AAE3D,aAAW,EAAE,MAAM,SAAS,KAAK,WAAW;AAC1C,QAAI,CAAC,SAAU;AAEf,eAAW,CAAC,QAAQ,OAAO,KAAK,OAAO,QAAQ,QAAQ,GAAG;AACxD,UAAI,CAAC,WAAW,OAAO,YAAY,SAAU;AAC7C,gEAAqB,CAAC;AACtB,eAAS,MAAM,EAAE,IAAI,IAAI;AAAA,IAC3B;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,48 @@
1
+ import type { BimItemProperties } from '../../components/viewers/bim/src/lib/bimQueries';
2
+ import type { ModelIdMap } from '../../components/viewers/bim/src/lib/bimTree';
3
+ import type * as OBC from '@thatopen/components';
4
+ /**
5
+ * The BIM viewer, as a plugin sees it.
6
+ *
7
+ * Has a runtime dependency on `@thatopen/components` and three, so it stays out of
8
+ * the `plugins-sdk` barrel and out of anything the map route imports. Core reaches
9
+ * it only from inside the BIM viewer's own lazy chunk; plugins import
10
+ * `@collabdt/core/plugins-sdk/bimViewer`.
11
+ */
12
+ export interface BimToolProps {
13
+ components: OBC.Components | null;
14
+ world: OBC.World | null;
15
+ fragments: OBC.FragmentsManager | null;
16
+ /** Ids of every loaded model, in load order. */
17
+ modelIds: string[];
18
+ /** The live selection, keyed by model id. Updates as the user clicks in the viewport. */
19
+ selection: ModelIdMap;
20
+ select: (items: ModelIdMap) => Promise<void>;
21
+ clearSelection: () => void;
22
+ /** Frame the camera on whatever is currently selected. */
23
+ fitToSelection: () => Promise<void>;
24
+ /** Hides everything except `items`, across every loaded model. */
25
+ isolate: (items: ModelIdMap) => Promise<void>;
26
+ setItemsVisible: (items: ModelIdMap, visible: boolean) => Promise<void>;
27
+ /** The escape hatch from `isolate`: makes everything visible again. */
28
+ showAll: () => Promise<void>;
29
+ /**
30
+ * Every element of one IFC class, e.g. `getItemsOfCategory('IFCSPACE')`. Spaces
31
+ * start hidden, being volumetric, so showing them needs `setItemsVisible` too.
32
+ */
33
+ getItemsOfCategory: (category: string) => Promise<ModelIdMap>;
34
+ /** Attributes for the given elements. Omit `attributes` for the default set. */
35
+ getProperties: (items: ModelIdMap, attributes?: string[]) => Promise<BimItemProperties[]>;
36
+ }
37
+ /**
38
+ * Thin façade over the same `lib/bim*` helpers the core sidebar and toolbars use, so
39
+ * a plugin cannot drift from core behaviour.
40
+ *
41
+ * No colour or opacity overrides, on purpose: raw per-element painting spends one of
42
+ * the model's ~65 500 Fragments material slots per element per call and exhausts
43
+ * them. Core buckets those through `ElementAppearance`; plugins use `select` and
44
+ * `isolate` to draw attention.
45
+ */
46
+ export declare function useBimViewer(): BimToolProps;
47
+ export type { ModelIdMap, BimItemProperties };
48
+ //# sourceMappingURL=bimViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bimViewer.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/sdk/bimViewer.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AACxF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;AAC9E,OAAO,KAAK,KAAK,GAAG,MAAM,sBAAsB,CAAA;AAEhD;;;;;;;GAOG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,IAAI,CAAA;IACjC,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,IAAI,CAAA;IACvB,SAAS,EAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAA;IACtC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,EAAE,CAAA;IAElB,yFAAyF;IACzF,SAAS,EAAE,UAAU,CAAA;IAIrB,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5C,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,0DAA0D;IAC1D,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC,kEAAkE;IAClE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7C,eAAe,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACvE,uEAAuE;IACvE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5B;;;OAGG;IACH,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAC7D,gFAAgF;IAChF,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAA;CAC1F;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,IAAI,YAAY,CAoC3C;AAED,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { fitToSelection } from "../../components/viewers/bim/src/lib/bimCamera";
4
+ import {
5
+ clearSelection,
6
+ isolateItems,
7
+ selectItems,
8
+ setItemsVisible,
9
+ showAllItems
10
+ } from "../../components/viewers/bim/src/lib/bimItemActions";
11
+ import {
12
+ getItemProperties,
13
+ getItemsOfCategory
14
+ } from "../../components/viewers/bim/src/lib/bimQueries";
15
+ import { BimContext } from "../../store/BIM/context";
16
+ function useBimViewer() {
17
+ const { state } = React.useContext(BimContext);
18
+ const { bimComponents, world, fragments, modelIds, selection } = state.bim;
19
+ return React.useMemo(() => ({
20
+ components: bimComponents,
21
+ world,
22
+ fragments,
23
+ modelIds,
24
+ selection,
25
+ select: async (items) => {
26
+ if (bimComponents) await selectItems(bimComponents, items);
27
+ },
28
+ clearSelection: () => {
29
+ if (bimComponents) clearSelection(bimComponents);
30
+ },
31
+ fitToSelection: async () => {
32
+ if (bimComponents) await fitToSelection(bimComponents);
33
+ },
34
+ isolate: async (items) => {
35
+ if (bimComponents) await isolateItems(bimComponents, items);
36
+ },
37
+ setItemsVisible: async (items, visible) => {
38
+ if (bimComponents) await setItemsVisible(bimComponents, items, visible);
39
+ },
40
+ showAll: async () => {
41
+ if (bimComponents) await showAllItems(bimComponents);
42
+ },
43
+ getItemsOfCategory: async (category) => bimComponents ? getItemsOfCategory(bimComponents, category) : {},
44
+ getProperties: async (items, attributes) => bimComponents ? getItemProperties(bimComponents, items, attributes) : []
45
+ }), [bimComponents, world, fragments, modelIds, selection]);
46
+ }
47
+ export {
48
+ useBimViewer
49
+ };
50
+ //# sourceMappingURL=bimViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/plugins/sdk/bimViewer.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 { fitToSelection } from '../../components/viewers/bim/src/lib/bimCamera'\r\nimport {\r\n clearSelection,\r\n isolateItems,\r\n selectItems,\r\n setItemsVisible,\r\n showAllItems,\r\n} from '../../components/viewers/bim/src/lib/bimItemActions'\r\nimport {\r\n getItemProperties,\r\n getItemsOfCategory,\r\n} from '../../components/viewers/bim/src/lib/bimQueries'\r\nimport { BimContext } from '../../store/BIM/context'\r\n\r\nimport type { BimItemProperties } from '../../components/viewers/bim/src/lib/bimQueries'\r\nimport type { ModelIdMap } from '../../components/viewers/bim/src/lib/bimTree'\r\nimport type * as OBC from '@thatopen/components'\r\n\r\n/**\r\n * The BIM viewer, as a plugin sees it.\r\n *\r\n * Has a runtime dependency on `@thatopen/components` and three, so it stays out of\r\n * the `plugins-sdk` barrel and out of anything the map route imports. Core reaches\r\n * it only from inside the BIM viewer's own lazy chunk; plugins import\r\n * `@collabdt/core/plugins-sdk/bimViewer`.\r\n */\r\n\r\nexport interface BimToolProps {\r\n components: OBC.Components | null\r\n world: OBC.World | null\r\n fragments: OBC.FragmentsManager | null\r\n /** Ids of every loaded model, in load order. */\r\n modelIds: string[]\r\n\r\n /** The live selection, keyed by model id. Updates as the user clicks in the viewport. */\r\n selection: ModelIdMap\r\n\r\n // Properties, not methods: standalone closures with no `this`, so a plugin can\r\n // destructure them out of the props without an unbound-`this` hazard.\r\n select: (items: ModelIdMap) => Promise<void>\r\n clearSelection: () => void\r\n /** Frame the camera on whatever is currently selected. */\r\n fitToSelection: () => Promise<void>\r\n\r\n /** Hides everything except `items`, across every loaded model. */\r\n isolate: (items: ModelIdMap) => Promise<void>\r\n setItemsVisible: (items: ModelIdMap, visible: boolean) => Promise<void>\r\n /** The escape hatch from `isolate`: makes everything visible again. */\r\n showAll: () => Promise<void>\r\n\r\n /**\r\n * Every element of one IFC class, e.g. `getItemsOfCategory('IFCSPACE')`. Spaces\r\n * start hidden, being volumetric, so showing them needs `setItemsVisible` too.\r\n */\r\n getItemsOfCategory: (category: string) => Promise<ModelIdMap>\r\n /** Attributes for the given elements. Omit `attributes` for the default set. */\r\n getProperties: (items: ModelIdMap, attributes?: string[]) => Promise<BimItemProperties[]>\r\n}\r\n\r\n/**\r\n * Thin façade over the same `lib/bim*` helpers the core sidebar and toolbars use, so\r\n * a plugin cannot drift from core behaviour.\r\n *\r\n * No colour or opacity overrides, on purpose: raw per-element painting spends one of\r\n * the model's ~65 500 Fragments material slots per element per call and exhausts\r\n * them. Core buckets those through `ElementAppearance`; plugins use `select` and\r\n * `isolate` to draw attention.\r\n */\r\nexport function useBimViewer(): BimToolProps {\r\n const { state } = React.useContext(BimContext)\r\n const { bimComponents, world, fragments, modelIds, selection } = state.bim\r\n\r\n return React.useMemo<BimToolProps>(() => ({\r\n components: bimComponents,\r\n world,\r\n fragments,\r\n modelIds,\r\n selection,\r\n\r\n select: async (items: ModelIdMap) => {\r\n if (bimComponents) await selectItems(bimComponents, items)\r\n },\r\n clearSelection: () => {\r\n if (bimComponents) clearSelection(bimComponents)\r\n },\r\n fitToSelection: async () => {\r\n if (bimComponents) await fitToSelection(bimComponents)\r\n },\r\n\r\n isolate: async (items: ModelIdMap) => {\r\n if (bimComponents) await isolateItems(bimComponents, items)\r\n },\r\n setItemsVisible: async (items: ModelIdMap, visible: boolean) => {\r\n if (bimComponents) await setItemsVisible(bimComponents, items, visible)\r\n },\r\n showAll: async () => {\r\n if (bimComponents) await showAllItems(bimComponents)\r\n },\r\n\r\n getItemsOfCategory: async (category: string) =>\r\n bimComponents ? getItemsOfCategory(bimComponents, category) : {},\r\n getProperties: async (items: ModelIdMap, attributes?: string[]) =>\r\n bimComponents ? getItemProperties(bimComponents, items, attributes) : [],\r\n }), [bimComponents, world, fragments, modelIds, selection])\r\n}\r\n\r\nexport type { ModelIdMap, BimItemProperties }\r\n"],"mappings":";AAKA,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAwDpB,SAAS,eAA6B;AAC3C,QAAM,EAAE,MAAM,IAAI,MAAM,WAAW,UAAU;AAC7C,QAAM,EAAE,eAAe,OAAO,WAAW,UAAU,UAAU,IAAI,MAAM;AAEvE,SAAO,MAAM,QAAsB,OAAO;AAAA,IACxC,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA,QAAQ,OAAO,UAAsB;AACnC,UAAI,cAAe,OAAM,YAAY,eAAe,KAAK;AAAA,IAC3D;AAAA,IACA,gBAAgB,MAAM;AACpB,UAAI,cAAe,gBAAe,aAAa;AAAA,IACjD;AAAA,IACA,gBAAgB,YAAY;AAC1B,UAAI,cAAe,OAAM,eAAe,aAAa;AAAA,IACvD;AAAA,IAEA,SAAS,OAAO,UAAsB;AACpC,UAAI,cAAe,OAAM,aAAa,eAAe,KAAK;AAAA,IAC5D;AAAA,IACA,iBAAiB,OAAO,OAAmB,YAAqB;AAC9D,UAAI,cAAe,OAAM,gBAAgB,eAAe,OAAO,OAAO;AAAA,IACxE;AAAA,IACA,SAAS,YAAY;AACnB,UAAI,cAAe,OAAM,aAAa,aAAa;AAAA,IACrD;AAAA,IAEA,oBAAoB,OAAO,aACzB,gBAAgB,mBAAmB,eAAe,QAAQ,IAAI,CAAC;AAAA,IACjE,eAAe,OAAO,OAAmB,eACvC,gBAAgB,kBAAkB,eAAe,OAAO,UAAU,IAAI,CAAC;AAAA,EAC3E,IAAI,CAAC,eAAe,OAAO,WAAW,UAAU,SAAS,CAAC;AAC5D;","names":[]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A plugin's own configuration and identity.
3
+ *
4
+ * Re-exported from the scope module rather than from the plugin host on purpose.
5
+ * `installed.ts` imports plugin components, so anything a plugin component
6
+ * imports must not reach back to the host — that cycle leaves the bindings
7
+ * undefined by the time the plugin renders.
8
+ */
9
+ export { usePluginConfig, usePluginId } from '../host/scope';
10
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/sdk/config.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { usePluginConfig, usePluginId } from "../host/scope";
3
+ export {
4
+ usePluginConfig,
5
+ usePluginId
6
+ };
7
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/core/plugins/sdk/config.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\n/**\r\n * A plugin's own configuration and identity.\r\n *\r\n * Re-exported from the scope module rather than from the plugin host on purpose.\r\n * `installed.ts` imports plugin components, so anything a plugin component\r\n * imports must not reach back to the host — that cycle leaves the bindings\r\n * undefined by the time the plugin renders.\r\n */\r\nexport { usePluginConfig, usePluginId } from '../host/scope'\r\n"],"mappings":";AAaA,SAAS,iBAAiB,mBAAmB;","names":[]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Data access for plugins: core's own bound hooks, re-exported. A plugin goes
3
+ * through the same `ApiAdapter` as everything else and inherits its auth, org
4
+ * scoping and SWR cache — no second data path, and no way past the tenant boundary.
5
+ *
6
+ * Read-only where the write belongs to core: buildings and sites are canonical asset
7
+ * records, so changing them is a core change. Sensors and comments are read-write,
8
+ * being the domains plugins are expected to author. A plugin's own data goes in
9
+ * `plugins-sdk/store`.
10
+ */
11
+ export { useBuildings, useBuilding, useBuildingsByOsm, useBuildingOsmIds, } from '../../hooks/buildings/buildings';
12
+ export { useSites, useSite } from '../../hooks/sites/sites';
13
+ export { useInfrastructures, useInfrastructure } from '../../hooks/infrastructures/infrastructures';
14
+ export { useOrganization, useOrganizationByName } from '../../hooks/organizations/organizations';
15
+ export { useFiles, useFile, useFilesByBuildingId, useFilesBySiteId, useDownloadFile, } from '../../hooks/files/files';
16
+ export { useSensors, useSensor, useSensorsByBuilding, useSensorsByAuthor, useCreateSensor, } from '../../hooks/sensors/sensors';
17
+ export { useSensorTypes, useSensorType } from '../../hooks/sensorTypes/sensorTypes';
18
+ export { useComments, useComment, useCommentsByBuilding, useCommentsByAuthor, useCreateComment, useDeleteComments, } from '../../hooks/comments/comments';
19
+ /** The plugin's config for this organization, shaped by the manifest's `configSchema`. */
20
+ export { usePluginConfig } from './config';
21
+ export { usePluginPermissions } from './permissions';
22
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/sdk/data.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AAGH,OAAO,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AAGnG,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AAChG,OAAO,EACL,QAAQ,EACR,OAAO,EACP,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,GAChB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EACL,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,GAChB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAGnF,OAAO,EACL,WAAW,EACX,UAAU,EACV,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,+BAA+B,CAAA;AAItC,0FAA0F;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA"}
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import {
3
+ useBuildings,
4
+ useBuilding,
5
+ useBuildingsByOsm,
6
+ useBuildingOsmIds
7
+ } from "../../hooks/buildings/buildings";
8
+ import { useSites, useSite } from "../../hooks/sites/sites";
9
+ import { useInfrastructures, useInfrastructure } from "../../hooks/infrastructures/infrastructures";
10
+ import { useOrganization, useOrganizationByName } from "../../hooks/organizations/organizations";
11
+ import {
12
+ useFiles,
13
+ useFile,
14
+ useFilesByBuildingId,
15
+ useFilesBySiteId,
16
+ useDownloadFile
17
+ } from "../../hooks/files/files";
18
+ import {
19
+ useSensors,
20
+ useSensor,
21
+ useSensorsByBuilding,
22
+ useSensorsByAuthor,
23
+ useCreateSensor
24
+ } from "../../hooks/sensors/sensors";
25
+ import { useSensorTypes, useSensorType } from "../../hooks/sensorTypes/sensorTypes";
26
+ import {
27
+ useComments,
28
+ useComment,
29
+ useCommentsByBuilding,
30
+ useCommentsByAuthor,
31
+ useCreateComment,
32
+ useDeleteComments
33
+ } from "../../hooks/comments/comments";
34
+ import { usePluginConfig } from "./config";
35
+ import { usePluginPermissions } from "./permissions";
36
+ export {
37
+ useBuilding,
38
+ useBuildingOsmIds,
39
+ useBuildings,
40
+ useBuildingsByOsm,
41
+ useComment,
42
+ useComments,
43
+ useCommentsByAuthor,
44
+ useCommentsByBuilding,
45
+ useCreateComment,
46
+ useCreateSensor,
47
+ useDeleteComments,
48
+ useDownloadFile,
49
+ useFile,
50
+ useFiles,
51
+ useFilesByBuildingId,
52
+ useFilesBySiteId,
53
+ useInfrastructure,
54
+ useInfrastructures,
55
+ useOrganization,
56
+ useOrganizationByName,
57
+ usePluginConfig,
58
+ usePluginPermissions,
59
+ useSensor,
60
+ useSensorType,
61
+ useSensorTypes,
62
+ useSensors,
63
+ useSensorsByAuthor,
64
+ useSensorsByBuilding,
65
+ useSite,
66
+ useSites
67
+ };
68
+ //# sourceMappingURL=data.js.map