@collabdt/core 0.9.0 → 0.10.0

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 (414) hide show
  1. package/dist/core/components/AppSidebarContent.d.ts.map +1 -1
  2. package/dist/core/components/AppSidebarContent.js +0 -6
  3. package/dist/core/components/AppSidebarContent.js.map +1 -1
  4. package/dist/core/components/ConfirmDialog.d.ts.map +1 -1
  5. package/dist/core/components/ConfirmDialog.js +1 -1
  6. package/dist/core/components/ConfirmDialog.js.map +1 -1
  7. package/dist/core/components/Toolbar.d.ts.map +1 -1
  8. package/dist/core/components/Toolbar.js +0 -7
  9. package/dist/core/components/Toolbar.js.map +1 -1
  10. package/dist/core/components/ToolbarBody.d.ts.map +1 -1
  11. package/dist/core/components/ToolbarBody.js.map +1 -1
  12. package/dist/core/components/TopNavigationBar.d.ts.map +1 -1
  13. package/dist/core/components/TopNavigationBar.js +2 -7
  14. package/dist/core/components/TopNavigationBar.js.map +1 -1
  15. package/dist/core/components/organizationConfig/src/CountrySubdivisionFields.js +3 -3
  16. package/dist/core/components/organizationConfig/src/CountrySubdivisionFields.js.map +1 -1
  17. package/dist/core/components/ui/AppSidebar.d.ts.map +1 -1
  18. package/dist/core/components/ui/AppSidebar.js.map +1 -1
  19. package/dist/core/components/ui/CollapsibleSection.d.ts +7 -1
  20. package/dist/core/components/ui/CollapsibleSection.d.ts.map +1 -1
  21. package/dist/core/components/ui/CollapsibleSection.js +57 -8
  22. package/dist/core/components/ui/CollapsibleSection.js.map +1 -1
  23. package/dist/core/components/ui/FilesManager/index.d.ts +5 -0
  24. package/dist/core/components/ui/FilesManager/index.d.ts.map +1 -1
  25. package/dist/core/components/ui/FilesManager/index.js +17 -1
  26. package/dist/core/components/ui/FilesManager/index.js.map +1 -1
  27. package/dist/core/components/ui/FilesManager/src/FileItemComponent.d.ts.map +1 -1
  28. package/dist/core/components/ui/FilesManager/src/FileItemComponent.js +1 -1
  29. package/dist/core/components/ui/FilesManager/src/FileItemComponent.js.map +1 -1
  30. package/dist/core/components/ui/FilesManager/src/UploadProgressBar.d.ts +14 -0
  31. package/dist/core/components/ui/FilesManager/src/UploadProgressBar.d.ts.map +1 -0
  32. package/dist/core/components/ui/FilesManager/src/UploadProgressBar.js +39 -0
  33. package/dist/core/components/ui/FilesManager/src/UploadProgressBar.js.map +1 -0
  34. package/dist/core/components/ui/FilesManager/src/fileType.d.ts +9 -0
  35. package/dist/core/components/ui/FilesManager/src/fileType.d.ts.map +1 -0
  36. package/dist/core/components/ui/FilesManager/src/fileType.js +70 -0
  37. package/dist/core/components/ui/FilesManager/src/fileType.js.map +1 -0
  38. package/dist/core/components/ui/FilesManager/src/uploadProgress.d.ts +22 -0
  39. package/dist/core/components/ui/FilesManager/src/uploadProgress.d.ts.map +1 -0
  40. package/dist/core/components/ui/FilesManager/src/uploadProgress.js +89 -0
  41. package/dist/core/components/ui/FilesManager/src/uploadProgress.js.map +1 -0
  42. package/dist/core/components/ui/Progress.d.ts +3 -1
  43. package/dist/core/components/ui/Progress.d.ts.map +1 -1
  44. package/dist/core/components/ui/Progress.js +10 -3
  45. package/dist/core/components/ui/Progress.js.map +1 -1
  46. package/dist/core/components/ui/ShareFeature/ShareToolSubmenu.d.ts.map +1 -1
  47. package/dist/core/components/ui/ShareFeature/ShareToolSubmenu.js +2 -7
  48. package/dist/core/components/ui/ShareFeature/ShareToolSubmenu.js.map +1 -1
  49. package/dist/core/components/ui/Sidebar.d.ts +0 -1
  50. package/dist/core/components/ui/Sidebar.d.ts.map +1 -1
  51. package/dist/core/components/ui/Sidebar.js +2 -4
  52. package/dist/core/components/ui/Sidebar.js.map +1 -1
  53. package/dist/core/components/ui/ViewerSidebar/index.d.ts +1 -2
  54. package/dist/core/components/ui/ViewerSidebar/index.d.ts.map +1 -1
  55. package/dist/core/components/ui/ViewerSidebar/index.js +2 -7
  56. package/dist/core/components/ui/ViewerSidebar/index.js.map +1 -1
  57. package/dist/core/components/ui/ViewerSidebar/useLongPressReorder.d.ts +30 -0
  58. package/dist/core/components/ui/ViewerSidebar/useLongPressReorder.d.ts.map +1 -0
  59. package/dist/core/components/ui/ViewerSidebar/useLongPressReorder.js +138 -0
  60. package/dist/core/components/ui/ViewerSidebar/useLongPressReorder.js.map +1 -0
  61. package/dist/core/components/ui/ViewerSidebar/useResizableSections.d.ts +22 -0
  62. package/dist/core/components/ui/ViewerSidebar/useResizableSections.d.ts.map +1 -0
  63. package/dist/core/components/ui/ViewerSidebar/useResizableSections.js +99 -0
  64. package/dist/core/components/ui/ViewerSidebar/useResizableSections.js.map +1 -0
  65. package/dist/core/components/ui/uploadFile.d.ts +5 -1
  66. package/dist/core/components/ui/uploadFile.d.ts.map +1 -1
  67. package/dist/core/components/ui/uploadFile.js +19 -7
  68. package/dist/core/components/ui/uploadFile.js.map +1 -1
  69. package/dist/core/components/viewers/Viewer.d.ts.map +1 -1
  70. package/dist/core/components/viewers/Viewer.js +4 -7
  71. package/dist/core/components/viewers/Viewer.js.map +1 -1
  72. package/dist/core/components/viewers/bim/BimViewer.d.ts.map +1 -1
  73. package/dist/core/components/viewers/bim/BimViewer.js +2 -0
  74. package/dist/core/components/viewers/bim/BimViewer.js.map +1 -1
  75. package/dist/core/components/viewers/bim/src/BimLoadingState/index.js +1 -1
  76. package/dist/core/components/viewers/bim/src/BimLoadingState/index.js.map +1 -1
  77. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/index.d.ts.map +1 -1
  78. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/index.js +97 -21
  79. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/index.js.map +1 -1
  80. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/BimSection.d.ts +10 -0
  81. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/BimSection.d.ts.map +1 -0
  82. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/BimSection.js +325 -0
  83. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/BimSection.js.map +1 -0
  84. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.d.ts +3 -2
  85. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.d.ts.map +1 -1
  86. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.js +81 -315
  87. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.js.map +1 -1
  88. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.d.ts +4 -3
  89. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.d.ts.map +1 -1
  90. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.js +86 -241
  91. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.js.map +1 -1
  92. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.d.ts +3 -2
  93. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.d.ts.map +1 -1
  94. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.js +116 -15
  95. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.js.map +1 -1
  96. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/orderFileTabSections.d.ts +4 -0
  97. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/orderFileTabSections.d.ts.map +1 -0
  98. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/orderFileTabSections.js +10 -0
  99. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/orderFileTabSections.js.map +1 -0
  100. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/partitionFileTab.d.ts +4 -0
  101. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/partitionFileTab.d.ts.map +1 -0
  102. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/partitionFileTab.js +18 -0
  103. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/partitionFileTab.js.map +1 -0
  104. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/resolveOpenSections.d.ts +4 -0
  105. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/resolveOpenSections.d.ts.map +1 -0
  106. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/resolveOpenSections.js +12 -0
  107. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/resolveOpenSections.js.map +1 -0
  108. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/sectionChrome.d.ts +11 -0
  109. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/sectionChrome.d.ts.map +1 -0
  110. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/sectionChrome.js +1 -0
  111. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/sectionChrome.js.map +1 -0
  112. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/usePlaceableFileRows.d.ts +30 -0
  113. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/usePlaceableFileRows.d.ts.map +1 -0
  114. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/usePlaceableFileRows.js +332 -0
  115. package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/usePlaceableFileRows.js.map +1 -0
  116. package/dist/core/components/viewers/bim/src/BimSidebar/src/LayersTab/index.d.ts.map +1 -1
  117. package/dist/core/components/viewers/bim/src/BimSidebar/src/LayersTab/index.js +12 -48
  118. package/dist/core/components/viewers/bim/src/BimSidebar/src/LayersTab/index.js.map +1 -1
  119. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/index.d.ts.map +1 -1
  120. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/index.js +2 -4
  121. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/index.js.map +1 -1
  122. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.d.ts +4 -0
  123. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.d.ts.map +1 -0
  124. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.js +24 -0
  125. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.js.map +1 -0
  126. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.d.ts +3 -0
  127. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.d.ts.map +1 -0
  128. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.js +59 -0
  129. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.js.map +1 -0
  130. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/PointCloudSettings.d.ts.map +1 -1
  131. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/PointCloudSettings.js +12 -0
  132. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/PointCloudSettings.js.map +1 -1
  133. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/WalkSettings.d.ts +4 -0
  134. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/WalkSettings.d.ts.map +1 -0
  135. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/WalkSettings.js +83 -0
  136. package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/WalkSettings.js.map +1 -0
  137. package/dist/core/components/viewers/bim/src/CameraNavigation.d.ts +56 -0
  138. package/dist/core/components/viewers/bim/src/CameraNavigation.d.ts.map +1 -0
  139. package/dist/core/components/viewers/bim/src/CameraNavigation.js +230 -0
  140. package/dist/core/components/viewers/bim/src/CameraNavigation.js.map +1 -0
  141. package/dist/core/components/viewers/bim/src/Placement/placementCapabilities.d.ts +5 -3
  142. package/dist/core/components/viewers/bim/src/Placement/placementCapabilities.d.ts.map +1 -1
  143. package/dist/core/components/viewers/bim/src/Placement/placementCapabilities.js +6 -9
  144. package/dist/core/components/viewers/bim/src/Placement/placementCapabilities.js.map +1 -1
  145. package/dist/core/components/viewers/bim/src/PointClouds/BimPointCloudSync.d.ts.map +1 -1
  146. package/dist/core/components/viewers/bim/src/PointClouds/BimPointCloudSync.js +3 -1
  147. package/dist/core/components/viewers/bim/src/PointClouds/BimPointCloudSync.js.map +1 -1
  148. package/dist/core/components/viewers/bim/src/PointClouds/index.d.ts +6 -0
  149. package/dist/core/components/viewers/bim/src/PointClouds/index.d.ts.map +1 -1
  150. package/dist/core/components/viewers/bim/src/PointClouds/index.js +17 -0
  151. package/dist/core/components/viewers/bim/src/PointClouds/index.js.map +1 -1
  152. package/dist/core/components/viewers/bim/src/PointClouds/pointCloudFiles.d.ts +14 -1
  153. package/dist/core/components/viewers/bim/src/PointClouds/pointCloudFiles.d.ts.map +1 -1
  154. package/dist/core/components/viewers/bim/src/PointClouds/pointCloudFiles.js +33 -8
  155. package/dist/core/components/viewers/bim/src/PointClouds/pointCloudFiles.js.map +1 -1
  156. package/dist/core/components/viewers/bim/src/PointClouds/usePointCloudIntake.d.ts +12 -0
  157. package/dist/core/components/viewers/bim/src/PointClouds/usePointCloudIntake.d.ts.map +1 -0
  158. package/dist/core/components/viewers/bim/src/PointClouds/usePointCloudIntake.js +120 -0
  159. package/dist/core/components/viewers/bim/src/PointClouds/usePointCloudIntake.js.map +1 -0
  160. package/dist/core/components/viewers/bim/src/SceneObjects/sceneObjectRegistry.d.ts +6 -0
  161. package/dist/core/components/viewers/bim/src/SceneObjects/sceneObjectRegistry.d.ts.map +1 -1
  162. package/dist/core/components/viewers/bim/src/SceneObjects/sceneObjectRegistry.js +12 -0
  163. package/dist/core/components/viewers/bim/src/SceneObjects/sceneObjectRegistry.js.map +1 -1
  164. package/dist/core/components/viewers/bim/src/ViewportGizmo.d.ts.map +1 -1
  165. package/dist/core/components/viewers/bim/src/ViewportGizmo.js +25 -3
  166. package/dist/core/components/viewers/bim/src/ViewportGizmo.js.map +1 -1
  167. package/dist/core/components/viewers/bim/src/lib/disposeObject3D.d.ts +1 -1
  168. package/dist/core/components/viewers/bim/src/lib/disposeObject3D.d.ts.map +1 -1
  169. package/dist/core/components/viewers/bim/src/lib/disposeObject3D.js.map +1 -1
  170. package/dist/core/components/viewers/bim/src/lib/useBimFileIntake.d.ts +18 -0
  171. package/dist/core/components/viewers/bim/src/lib/useBimFileIntake.d.ts.map +1 -0
  172. package/dist/core/components/viewers/bim/src/lib/useBimFileIntake.js +78 -0
  173. package/dist/core/components/viewers/bim/src/lib/useBimFileIntake.js.map +1 -0
  174. package/dist/core/components/viewers/bim/src/tools/AddToBim/index.d.ts.map +1 -1
  175. package/dist/core/components/viewers/bim/src/tools/AddToBim/index.js +12 -3
  176. package/dist/core/components/viewers/bim/src/tools/AddToBim/index.js.map +1 -1
  177. package/dist/core/components/viewers/bim/src/tools/AddToBim/src/FileHandler.d.ts.map +1 -1
  178. package/dist/core/components/viewers/bim/src/tools/AddToBim/src/FileHandler.js +2 -1
  179. package/dist/core/components/viewers/bim/src/tools/AddToBim/src/FileHandler.js.map +1 -1
  180. package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.d.ts +5 -5
  181. package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.d.ts.map +1 -1
  182. package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.js +27 -103
  183. package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.js.map +1 -1
  184. package/dist/core/components/viewers/bim/src/useCameraNavigation.d.ts +8 -0
  185. package/dist/core/components/viewers/bim/src/useCameraNavigation.d.ts.map +1 -0
  186. package/dist/core/components/viewers/bim/src/useCameraNavigation.js +33 -0
  187. package/dist/core/components/viewers/bim/src/useCameraNavigation.js.map +1 -0
  188. package/dist/core/components/viewers/map/MapViewer.js +2 -2
  189. package/dist/core/components/viewers/map/MapViewer.js.map +1 -1
  190. package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/src/BuildingsTools.d.ts.map +1 -1
  191. package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/src/BuildingsTools.js +1 -14
  192. package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/src/BuildingsTools.js.map +1 -1
  193. package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS.d.ts +1 -1
  194. package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS.d.ts.map +1 -1
  195. package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS.js +1 -1
  196. package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS.js.map +1 -1
  197. package/dist/core/components/viewers/map/src/tools/mapTools.d.ts +1 -1
  198. package/dist/core/components/viewers/map/src/tools/mapTools.d.ts.map +1 -1
  199. package/dist/core/components/viewers/map/src/tools/mapTools.js.map +1 -1
  200. package/dist/core/components/viewers/plugins/src/PluginCard.d.ts.map +1 -1
  201. package/dist/core/components/viewers/plugins/src/PluginCard.js +0 -1
  202. package/dist/core/components/viewers/plugins/src/PluginCard.js.map +1 -1
  203. package/dist/core/components/viewers/shared/pointcloud/pointCloudAppearance.d.ts +1 -0
  204. package/dist/core/components/viewers/shared/pointcloud/pointCloudAppearance.d.ts.map +1 -1
  205. package/dist/core/components/viewers/shared/pointcloud/pointCloudAppearance.js +4 -2
  206. package/dist/core/components/viewers/shared/pointcloud/pointCloudAppearance.js.map +1 -1
  207. package/dist/core/components/viewers/shared/pointcloud/pointCloudConversion.d.ts +34 -0
  208. package/dist/core/components/viewers/shared/pointcloud/pointCloudConversion.d.ts.map +1 -0
  209. package/dist/core/components/viewers/shared/pointcloud/pointCloudConversion.js +78 -0
  210. package/dist/core/components/viewers/shared/pointcloud/pointCloudConversion.js.map +1 -0
  211. package/dist/core/components/viewers/shared/pointcloud/pointCloudRegistry.d.ts +2 -0
  212. package/dist/core/components/viewers/shared/pointcloud/pointCloudRegistry.d.ts.map +1 -1
  213. package/dist/core/components/viewers/shared/pointcloud/pointCloudRegistry.js.map +1 -1
  214. package/dist/core/components/viewers/useCoordinateSystem.js.map +1 -1
  215. package/dist/core/hooks/ports/apiAdapter.d.ts +1 -1
  216. package/dist/core/hooks/ports/apiAdapter.d.ts.map +1 -1
  217. package/dist/core/hooks/provider.d.ts +1 -1
  218. package/dist/core/hooks/provider.js +1 -1
  219. package/dist/core/hooks/provider.js.map +1 -1
  220. package/dist/core/hooks/useCaptureScreenshot.d.ts.map +1 -1
  221. package/dist/core/hooks/useCaptureScreenshot.js +1 -2
  222. package/dist/core/hooks/useCaptureScreenshot.js.map +1 -1
  223. package/dist/core/hooks/useCurrentViewerPosition.d.ts +1 -1
  224. package/dist/core/hooks/useCurrentViewerPosition.d.ts.map +1 -1
  225. package/dist/core/hooks/useCurrentViewerPosition.js +2 -18
  226. package/dist/core/hooks/useCurrentViewerPosition.js.map +1 -1
  227. package/dist/core/hooks/useShareUrl.d.ts.map +1 -1
  228. package/dist/core/hooks/useShareUrl.js +2 -20
  229. package/dist/core/hooks/useShareUrl.js.map +1 -1
  230. package/dist/core/i18n/messages/en.json +25 -87
  231. package/dist/core/i18n/messages/es.json +25 -87
  232. package/dist/core/i18n/messages/fr.json +25 -87
  233. package/dist/core/plugins/host/context.d.ts.map +1 -1
  234. package/dist/core/plugins/host/context.js +1 -2
  235. package/dist/core/plugins/host/context.js.map +1 -1
  236. package/dist/core/plugins/host/usePluginToolbarTools.d.ts +2 -2
  237. package/dist/core/plugins/host/usePluginToolbarTools.d.ts.map +1 -1
  238. package/dist/core/plugins/host/usePluginToolbarTools.js +58 -3
  239. package/dist/core/plugins/host/usePluginToolbarTools.js.map +1 -1
  240. package/dist/core/plugins/sdk/types.d.ts +2 -4
  241. package/dist/core/plugins/sdk/types.d.ts.map +1 -1
  242. package/dist/core/plugins/sdk/types.js +0 -1
  243. package/dist/core/plugins/sdk/types.js.map +1 -1
  244. package/dist/core/plugins/sdk/viewer.d.ts +1 -2
  245. package/dist/core/plugins/sdk/viewer.d.ts.map +1 -1
  246. package/dist/core/plugins/sdk/viewer.js +0 -1
  247. package/dist/core/plugins/sdk/viewer.js.map +1 -1
  248. package/dist/core/store/CombineProviders.d.ts.map +1 -1
  249. package/dist/core/store/CombineProviders.js +0 -2
  250. package/dist/core/store/CombineProviders.js.map +1 -1
  251. package/dist/core/store/Menus/context.d.ts.map +1 -1
  252. package/dist/core/store/Menus/context.js +4 -3
  253. package/dist/core/store/Menus/context.js.map +1 -1
  254. package/dist/core/store/Menus/reducer.d.ts +5 -0
  255. package/dist/core/store/Menus/reducer.d.ts.map +1 -1
  256. package/dist/core/store/Menus/reducer.js +12 -0
  257. package/dist/core/store/Menus/reducer.js.map +1 -1
  258. package/dist/core/store/index.d.ts +0 -1
  259. package/dist/core/store/index.d.ts.map +1 -1
  260. package/dist/core/store/index.js +0 -1
  261. package/dist/core/store/index.js.map +1 -1
  262. package/dist/core/types/dbTypes.d.ts +0 -1
  263. package/dist/core/types/dbTypes.d.ts.map +1 -1
  264. package/dist/core/types/dbTypes.js +0 -1
  265. package/dist/core/types/dbTypes.js.map +1 -1
  266. package/dist/core/types/tools.d.ts +1 -2
  267. package/dist/core/types/tools.d.ts.map +1 -1
  268. package/dist/core/utils/appContent.d.ts.map +1 -1
  269. package/dist/core/utils/appContent.js +0 -1
  270. package/dist/core/utils/appContent.js.map +1 -1
  271. package/dist/core/utils/getFileIcon.d.ts.map +1 -1
  272. package/dist/core/utils/getFileIcon.js +11 -13
  273. package/dist/core/utils/getFileIcon.js.map +1 -1
  274. package/package.json +1 -3
  275. package/dist/core/components/viewers/pointcloud/PointCloudToolbar.d.ts +0 -3
  276. package/dist/core/components/viewers/pointcloud/PointCloudToolbar.d.ts.map +0 -1
  277. package/dist/core/components/viewers/pointcloud/PointCloudToolbar.js +0 -13
  278. package/dist/core/components/viewers/pointcloud/PointCloudToolbar.js.map +0 -1
  279. package/dist/core/components/viewers/pointcloud/PointCloudViewer.d.ts +0 -5
  280. package/dist/core/components/viewers/pointcloud/PointCloudViewer.d.ts.map +0 -1
  281. package/dist/core/components/viewers/pointcloud/PointCloudViewer.js +0 -228
  282. package/dist/core/components/viewers/pointcloud/PointCloudViewer.js.map +0 -1
  283. package/dist/core/components/viewers/pointcloud/define.d.ts +0 -64
  284. package/dist/core/components/viewers/pointcloud/define.d.ts.map +0 -1
  285. package/dist/core/components/viewers/pointcloud/define.js +0 -75
  286. package/dist/core/components/viewers/pointcloud/define.js.map +0 -1
  287. package/dist/core/components/viewers/pointcloud/src/PointCloudLoadingState/index.d.ts +0 -6
  288. package/dist/core/components/viewers/pointcloud/src/PointCloudLoadingState/index.d.ts.map +0 -1
  289. package/dist/core/components/viewers/pointcloud/src/PointCloudLoadingState/index.js +0 -316
  290. package/dist/core/components/viewers/pointcloud/src/PointCloudLoadingState/index.js.map +0 -1
  291. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.d.ts +0 -7
  292. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.d.ts.map +0 -1
  293. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.js +0 -22
  294. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.js.map +0 -1
  295. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/index.d.ts +0 -5
  296. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/index.d.ts.map +0 -1
  297. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/index.js +0 -38
  298. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/index.js.map +0 -1
  299. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/FilesSection.d.ts +0 -8
  300. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/FilesSection.d.ts.map +0 -1
  301. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/FilesSection.js +0 -130
  302. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/FilesSection.js.map +0 -1
  303. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/PointCloudSection.d.ts +0 -10
  304. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/PointCloudSection.d.ts.map +0 -1
  305. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/PointCloudSection.js +0 -419
  306. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/PointCloudSection.js.map +0 -1
  307. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/index.d.ts +0 -3
  308. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/index.d.ts.map +0 -1
  309. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/index.js +0 -19
  310. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/index.js.map +0 -1
  311. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/CameraSettings.d.ts +0 -3
  312. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/CameraSettings.d.ts.map +0 -1
  313. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/CameraSettings.js +0 -199
  314. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/CameraSettings.js.map +0 -1
  315. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/GridManagement.d.ts +0 -3
  316. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/GridManagement.d.ts.map +0 -1
  317. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/GridManagement.js +0 -101
  318. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/GridManagement.js.map +0 -1
  319. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/PerformanceSettings.d.ts +0 -7
  320. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/PerformanceSettings.d.ts.map +0 -1
  321. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/PerformanceSettings.js +0 -262
  322. package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/PerformanceSettings.js.map +0 -1
  323. package/dist/core/components/viewers/pointcloud/src/ViewportGizmo.d.ts +0 -27
  324. package/dist/core/components/viewers/pointcloud/src/ViewportGizmo.d.ts.map +0 -1
  325. package/dist/core/components/viewers/pointcloud/src/ViewportGizmo.js +0 -165
  326. package/dist/core/components/viewers/pointcloud/src/ViewportGizmo.js.map +0 -1
  327. package/dist/core/components/viewers/pointcloud/src/tools/ClippingTools/ClippingTool.d.ts +0 -8
  328. package/dist/core/components/viewers/pointcloud/src/tools/ClippingTools/ClippingTool.d.ts.map +0 -1
  329. package/dist/core/components/viewers/pointcloud/src/tools/ClippingTools/ClippingTool.js +0 -64
  330. package/dist/core/components/viewers/pointcloud/src/tools/ClippingTools/ClippingTool.js.map +0 -1
  331. package/dist/core/components/viewers/pointcloud/src/tools/FitToScreen.d.ts +0 -6
  332. package/dist/core/components/viewers/pointcloud/src/tools/FitToScreen.d.ts.map +0 -1
  333. package/dist/core/components/viewers/pointcloud/src/tools/FitToScreen.js +0 -37
  334. package/dist/core/components/viewers/pointcloud/src/tools/FitToScreen.js.map +0 -1
  335. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AngleMeasurement.d.ts +0 -7
  336. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AngleMeasurement.d.ts.map +0 -1
  337. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AngleMeasurement.js +0 -41
  338. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AngleMeasurement.js.map +0 -1
  339. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AreaMeasurement.d.ts +0 -7
  340. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AreaMeasurement.d.ts.map +0 -1
  341. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AreaMeasurement.js +0 -37
  342. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AreaMeasurement.js.map +0 -1
  343. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/LineMeasurement.d.ts +0 -7
  344. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/LineMeasurement.d.ts.map +0 -1
  345. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/LineMeasurement.js +0 -44
  346. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/LineMeasurement.js.map +0 -1
  347. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/MeasurePointCloudTool.d.ts +0 -8
  348. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/MeasurePointCloudTool.d.ts.map +0 -1
  349. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/MeasurePointCloudTool.js +0 -93
  350. package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/MeasurePointCloudTool.js.map +0 -1
  351. package/dist/core/components/viewers/pointcloud/src/tools/PCSearchTool.d.ts +0 -7
  352. package/dist/core/components/viewers/pointcloud/src/tools/PCSearchTool.d.ts.map +0 -1
  353. package/dist/core/components/viewers/pointcloud/src/tools/PCSearchTool.js +0 -67
  354. package/dist/core/components/viewers/pointcloud/src/tools/PCSearchTool.js.map +0 -1
  355. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/NodeSizeSelectionTool.d.ts +0 -23
  356. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/NodeSizeSelectionTool.d.ts.map +0 -1
  357. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/NodeSizeSelectionTool.js +0 -158
  358. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/NodeSizeSelectionTool.js.map +0 -1
  359. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PerformanceSettingTools.d.ts +0 -8
  360. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PerformanceSettingTools.d.ts.map +0 -1
  361. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PerformanceSettingTools.js +0 -47
  362. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PerformanceSettingTools.js.map +0 -1
  363. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PointBudgetTool.d.ts +0 -8
  364. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PointBudgetTool.d.ts.map +0 -1
  365. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PointBudgetTool.js +0 -45
  366. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PointBudgetTool.js.map +0 -1
  367. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/ShowOctreeBoxTool.d.ts +0 -12
  368. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/ShowOctreeBoxTool.d.ts.map +0 -1
  369. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/ShowOctreeBoxTool.js +0 -48
  370. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/ShowOctreeBoxTool.js.map +0 -1
  371. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/SplatQualitySelection.d.ts +0 -12
  372. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/SplatQualitySelection.d.ts.map +0 -1
  373. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/SplatQualitySelection.js +0 -62
  374. package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/SplatQualitySelection.js.map +0 -1
  375. package/dist/core/components/viewers/pointcloud/src/tools/SetCameraOption.d.ts +0 -6
  376. package/dist/core/components/viewers/pointcloud/src/tools/SetCameraOption.d.ts.map +0 -1
  377. package/dist/core/components/viewers/pointcloud/src/tools/SetCameraOption.js +0 -145
  378. package/dist/core/components/viewers/pointcloud/src/tools/SetCameraOption.js.map +0 -1
  379. package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/index.d.ts +0 -8
  380. package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/index.d.ts.map +0 -1
  381. package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/index.js +0 -49
  382. package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/index.js.map +0 -1
  383. package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/src/getCameraPosition.d.ts +0 -20
  384. package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/src/getCameraPosition.d.ts.map +0 -1
  385. package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/src/getCameraPosition.js +0 -30
  386. package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/src/getCameraPosition.js.map +0 -1
  387. package/dist/core/components/viewers/pointcloud/src/tools/index.d.ts +0 -5
  388. package/dist/core/components/viewers/pointcloud/src/tools/index.d.ts.map +0 -1
  389. package/dist/core/components/viewers/pointcloud/src/tools/index.js +0 -12
  390. package/dist/core/components/viewers/pointcloud/src/tools/index.js.map +0 -1
  391. package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.d.ts +0 -13
  392. package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.d.ts.map +0 -1
  393. package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.js +0 -30
  394. package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.js.map +0 -1
  395. package/dist/core/components/viewers/pointcloud/utils/potreeLoader.d.ts +0 -4
  396. package/dist/core/components/viewers/pointcloud/utils/potreeLoader.d.ts.map +0 -1
  397. package/dist/core/components/viewers/pointcloud/utils/potreeLoader.js +0 -43
  398. package/dist/core/components/viewers/pointcloud/utils/potreeLoader.js.map +0 -1
  399. package/dist/core/components/viewers/pointcloud/utils/restoreCameraFromUrl.d.ts +0 -10
  400. package/dist/core/components/viewers/pointcloud/utils/restoreCameraFromUrl.d.ts.map +0 -1
  401. package/dist/core/components/viewers/pointcloud/utils/restoreCameraFromUrl.js +0 -26
  402. package/dist/core/components/viewers/pointcloud/utils/restoreCameraFromUrl.js.map +0 -1
  403. package/dist/core/plugins/sdk/pointCloudViewer.d.ts +0 -14
  404. package/dist/core/plugins/sdk/pointCloudViewer.d.ts.map +0 -1
  405. package/dist/core/plugins/sdk/pointCloudViewer.js +0 -17
  406. package/dist/core/plugins/sdk/pointCloudViewer.js.map +0 -1
  407. package/dist/core/store/PointCloud/context.d.ts +0 -16
  408. package/dist/core/store/PointCloud/context.d.ts.map +0 -1
  409. package/dist/core/store/PointCloud/context.js +0 -31
  410. package/dist/core/store/PointCloud/context.js.map +0 -1
  411. package/dist/core/store/PointCloud/reducer.d.ts +0 -59
  412. package/dist/core/store/PointCloud/reducer.d.ts.map +0 -1
  413. package/dist/core/store/PointCloud/reducer.js +0 -78
  414. package/dist/core/store/PointCloud/reducer.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/core/components/ui/ViewerSidebar/useLongPressReorder.ts"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport * as React from 'react'\n\nexport interface SectionBand {\n top: number\n bottom: number\n}\n\nexport interface LongPressReorderOptions<Id extends string> {\n ids: readonly Id[]\n onReorder: (order: Id[]) => void\n /** Vertical extent of each section, for hit-testing the drag. Defaults to the registered element. */\n measure?: (id: Id) => SectionBand | null\n holdMs?: number\n moveTolerance?: number\n}\n\nexport interface LongPressReorder<Id extends string> {\n order: readonly Id[]\n activeId: Id | null\n isReordering: boolean\n handlersFor: (id: Id) => {\n ref: (element: HTMLElement | null) => void\n onPointerDown: (event: React.PointerEvent<HTMLElement>) => void\n onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void\n onClick: (event: React.MouseEvent<HTMLElement>) => void\n }\n}\n\nfunction moveTo<Id>(order: readonly Id[], id: Id, index: number): Id[] {\n const without = order.filter(other => other !== id)\n return [...without.slice(0, index), id, ...without.slice(index)]\n}\n\nfunction sameOrder<Id>(a: readonly Id[], b: readonly Id[]): boolean {\n return a.length === b.length && a.every((id, index) => id === b[index])\n}\n\n/**\n * Press-and-hold, then drag, to reorder a list of sections. A short press falls\n * through untouched so the header's own click still toggles the section.\n */\nexport function useLongPressReorder<Id extends string>(\n options: LongPressReorderOptions<Id>,\n): LongPressReorder<Id> {\n const { ids, onReorder, measure, holdMs = 400, moveTolerance = 6 } = options\n\n const [activeId, setActiveId] = React.useState<Id | null>(null)\n const [draftOrder, setDraftOrder] = React.useState<Id[] | null>(null)\n\n const elementsRef = React.useRef(new Map<Id, HTMLElement>())\n const latestRef = React.useRef({ ids, onReorder, measure })\n latestRef.current = { ids, onReorder, measure }\n\n const swallowClickRef = React.useRef(false)\n\n const pressRef = React.useRef<{\n id: Id\n startY: number\n pointerId: number\n target: HTMLElement | null\n timer: ReturnType<typeof setTimeout> | null\n started: boolean\n draft: Id[]\n } | null>(null)\n\n const bandFor = React.useCallback((id: Id): SectionBand | null => {\n const custom = latestRef.current.measure\n if (custom) return custom(id)\n\n const element = elementsRef.current.get(id)\n if (!element) return null\n const rect = element.getBoundingClientRect()\n return { top: rect.top, bottom: rect.bottom }\n }, [])\n\n const teardownRef = React.useRef<() => void>(() => {})\n\n const finishPress = React.useCallback((commit: boolean) => {\n const press = pressRef.current\n if (!press) return\n\n if (press.started) swallowClickRef.current = true\n if (press.timer) clearTimeout(press.timer)\n press.target?.releasePointerCapture?.(press.pointerId)\n pressRef.current = null\n teardownRef.current()\n\n if (commit && press.started && !sameOrder(press.draft, latestRef.current.ids)) {\n latestRef.current.onReorder(press.draft)\n }\n\n setActiveId(null)\n setDraftOrder(null)\n }, [])\n\n const handleMove = React.useCallback((event: PointerEvent) => {\n const press = pressRef.current\n if (!press) return\n\n if (!press.started) {\n if (Math.abs(event.clientY - press.startY) > moveTolerance) finishPress(false)\n return\n }\n\n const targetId = press.draft.find(id => {\n const band = bandFor(id)\n return band !== null && event.clientY >= band.top && event.clientY < band.bottom\n })\n if (targetId === undefined) return\n\n const next = moveTo(press.draft, press.id, press.draft.indexOf(targetId))\n if (sameOrder(next, press.draft)) return\n\n press.draft = next\n setDraftOrder(next)\n }, [bandFor, finishPress, moveTolerance])\n\n const handleUp = React.useCallback(() => finishPress(true), [finishPress])\n const handleCancel = React.useCallback(() => finishPress(false), [finishPress])\n\n const handleKeyDown = React.useCallback((event: KeyboardEvent) => {\n if (event.key === 'Escape') finishPress(false)\n }, [finishPress])\n\n const listen = React.useCallback(() => {\n window.addEventListener('pointermove', handleMove)\n window.addEventListener('pointerup', handleUp)\n window.addEventListener('pointercancel', handleCancel)\n window.addEventListener('keydown', handleKeyDown)\n\n teardownRef.current = () => {\n window.removeEventListener('pointermove', handleMove)\n window.removeEventListener('pointerup', handleUp)\n window.removeEventListener('pointercancel', handleCancel)\n window.removeEventListener('keydown', handleKeyDown)\n }\n }, [handleMove, handleUp, handleCancel, handleKeyDown])\n\n React.useEffect(() => () => finishPress(false), [finishPress])\n\n const onPointerDown = React.useCallback((id: Id) => (event: React.PointerEvent<HTMLElement>) => {\n if (event.button > 0) return\n finishPress(false)\n\n const target = event.currentTarget\n pressRef.current = {\n id,\n startY: event.clientY,\n pointerId: event.pointerId,\n target,\n started: false,\n draft: [...latestRef.current.ids],\n timer: setTimeout(() => {\n const press = pressRef.current\n if (!press) return\n press.started = true\n press.timer = null\n press.target?.setPointerCapture?.(press.pointerId)\n setActiveId(press.id)\n setDraftOrder(press.draft)\n }, holdMs),\n }\n\n listen()\n }, [finishPress, holdMs, listen])\n\n const onKeyDown = React.useCallback((id: Id) => (event: React.KeyboardEvent<HTMLElement>) => {\n if (!event.altKey || (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')) return\n\n const current = latestRef.current.ids\n const index = current.indexOf(id) + (event.key === 'ArrowDown' ? 1 : -1)\n if (index < 0 || index >= current.length) return\n\n event.preventDefault()\n latestRef.current.onReorder(moveTo(current, id, index))\n }, [])\n\n const onClick = React.useCallback((event: React.MouseEvent<HTMLElement>) => {\n if (!swallowClickRef.current) return\n swallowClickRef.current = false\n event.preventDefault()\n event.stopPropagation()\n }, [])\n\n const handlersFor = React.useCallback((id: Id) => ({\n ref: (element: HTMLElement | null) => {\n if (element) elementsRef.current.set(id, element)\n else elementsRef.current.delete(id)\n },\n onPointerDown: onPointerDown(id),\n onKeyDown: onKeyDown(id),\n onClick,\n }), [onPointerDown, onKeyDown, onClick])\n\n return {\n order: draftOrder ?? ids,\n activeId,\n isReordering: activeId !== null,\n handlersFor,\n }\n}\n"],"mappings":";AAKA,YAAY,WAAW;AA4BvB,SAAS,OAAW,OAAsB,IAAQ,OAAqB;AACrE,QAAM,UAAU,MAAM,OAAO,WAAS,UAAU,EAAE;AAClD,SAAO,CAAC,GAAG,QAAQ,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,QAAQ,MAAM,KAAK,CAAC;AACjE;AAEA,SAAS,UAAc,GAAkB,GAA2B;AAClE,SAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,UAAU,OAAO,EAAE,KAAK,CAAC;AACxE;AAMO,SAAS,oBACd,SACsB;AACtB,QAAM,EAAE,KAAK,WAAW,SAAS,SAAS,KAAK,gBAAgB,EAAE,IAAI;AAErE,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAAoB,IAAI;AAC9D,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAsB,IAAI;AAEpE,QAAM,cAAc,MAAM,OAAO,oB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AO,EAAE;AAAA,IACpC;AAAA,IACA,eAAe,cAAc,EAAE;AAAA,IAC/B,WAAW,UAAU,EAAE;AAAA,IACvB;AAAA,EACF,IAAI,CAAC,eAAe,WAAW,OAAO,CAAC;AAEvC,SAAO;AAAA,IACL,OAAO,kCAAc;AAAA,IACrB;AAAA,IACA,cAAc,aAAa;AAAA,IAC3B;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ export interface ResizableSectionsOptions<Id extends string> {
3
+ ids: readonly Id[];
4
+ defaultWeights: Record<Id, number>;
5
+ minWeights: Record<Id, number>;
6
+ open: Record<Id, boolean>;
7
+ separatorHeight?: number;
8
+ }
9
+ export interface ResizableSections<Id extends string> {
10
+ layoutRef: React.RefObject<HTMLDivElement | null>;
11
+ gridTemplateRows: string;
12
+ weights: Record<Id, number>;
13
+ separatorAfter: (id: Id) => boolean;
14
+ beginResize: (id: Id) => (event: React.PointerEvent<HTMLElement>) => void;
15
+ separatorHeight: number;
16
+ }
17
+ /**
18
+ * Draggable-separator layout for N collapsible sidebar sections. A separator
19
+ * resizes only its two neighbours, clamped against that pair's own sum.
20
+ */
21
+ export declare function useResizableSections<Id extends string>(options: ResizableSectionsOptions<Id>): ResizableSections<Id>;
22
+ //# sourceMappingURL=useResizableSections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizableSections.d.ts","sourceRoot":"","sources":["../../../../../src/core/components/ui/ViewerSidebar/useResizableSections.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,WAAW,wBAAwB,CAAC,EAAE,SAAS,MAAM;IACzD,GAAG,EAAE,SAAS,EAAE,EAAE,CAAA;IAClB,cAAc,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IAClC,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IAC9B,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,iBAAiB,CAAC,EAAE,SAAS,MAAM;IAClD,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjD,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;IAC3B,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAA;IACnC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;IACzE,eAAe,EAAE,MAAM,CAAA;CACxB;AAcD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,MAAM,EACpD,OAAO,EAAE,wBAAwB,CAAC,EAAE,CAAC,GACpC,iBAAiB,CAAC,EAAE,CAAC,CAyFvB"}
@@ -0,0 +1,99 @@
1
+ 'use client'
2
+
3
+ "use client";
4
+ var __defProp = Object.defineProperty;
5
+ var __defProps = Object.defineProperties;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ import * as React from "react";
24
+ function nextOpenAfter(ids, open, id) {
25
+ const index = ids.indexOf(id);
26
+ for (let i = index + 1; i < ids.length; i++) {
27
+ if (open[ids[i]]) return ids[i];
28
+ }
29
+ return null;
30
+ }
31
+ function useResizableSections(options) {
32
+ const { ids, defaultWeights, minWeights, open, separatorHeight = 8 } = options;
33
+ const [weights, setWeights] = React.useState(defaultWeights);
34
+ const layoutRef = React.useRef(null);
35
+ const dragStateRef = React.useRef(null);
36
+ const separatorAfter = React.useCallback(
37
+ (id) => Boolean(open[id]) && nextOpenAfter(ids, open, id) !== null,
38
+ [ids, open]
39
+ );
40
+ const handlePointerMove = React.useCallback((event) => {
41
+ const drag = dragStateRef.current;
42
+ if (!drag || drag.pixelsPerUnit <= 0) return;
43
+ const delta = (event.clientY - drag.startY) / drag.pixelsPerUnit;
44
+ const next = Math.min(
45
+ drag.pairSum - minWeights[drag.nextId],
46
+ Math.max(minWeights[drag.id], drag.startWeight + delta)
47
+ );
48
+ setWeights((current) => __spreadProps(__spreadValues({}, current), { [drag.id]: next, [drag.nextId]: drag.pairSum - next }));
49
+ }, [minWeights]);
50
+ const stopDragging = React.useCallback(() => {
51
+ dragStateRef.current = null;
52
+ window.removeEventListener("pointermove", handlePointerMove);
53
+ window.removeEventListener("pointerup", stopDragging);
54
+ window.removeEventListener("pointercancel", stopDragging);
55
+ }, [handlePointerMove]);
56
+ React.useEffect(() => stopDragging, [stopDragging]);
57
+ const beginResize = React.useCallback(
58
+ (id) => (event) => {
59
+ const layout = layoutRef.current;
60
+ if (!layout) return;
61
+ const nextId = nextOpenAfter(ids, open, id);
62
+ if (!nextId) return;
63
+ const openTotal = ids.reduce(
64
+ (sum, sectionId) => open[sectionId] ? sum + weights[sectionId] : sum,
65
+ 0
66
+ );
67
+ const renderedSeparators = ids.filter((sectionId) => separatorAfter(sectionId)).length;
68
+ const flexibleHeight = layout.clientHeight - separatorHeight * renderedSeparators;
69
+ if (flexibleHeight <= 0 || openTotal <= 0) return;
70
+ event.preventDefault();
71
+ event.currentTarget.setPointerCapture(event.pointerId);
72
+ dragStateRef.current = {
73
+ id,
74
+ nextId,
75
+ startY: event.clientY,
76
+ startWeight: weights[id],
77
+ pairSum: weights[id] + weights[nextId],
78
+ pixelsPerUnit: flexibleHeight / openTotal
79
+ };
80
+ window.addEventListener("pointermove", handlePointerMove);
81
+ window.addEventListener("pointerup", stopDragging);
82
+ window.addEventListener("pointercancel", stopDragging);
83
+ },
84
+ [ids, open, weights, separatorAfter, separatorHeight, handlePointerMove, stopDragging]
85
+ );
86
+ const gridTemplateRows = React.useMemo(() => {
87
+ const rows = [];
88
+ for (const id of ids) {
89
+ rows.push(open[id] ? `${weights[id]}fr` : "auto");
90
+ if (separatorAfter(id)) rows.push(`${separatorHeight}px`);
91
+ }
92
+ return rows.join(" ");
93
+ }, [ids, open, weights, separatorAfter, separatorHeight]);
94
+ return { layoutRef, gridTemplateRows, weights, separatorAfter, beginResize, separatorHeight };
95
+ }
96
+ export {
97
+ useResizableSections
98
+ };
99
+ //# sourceMappingURL=useResizableSections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/core/components/ui/ViewerSidebar/useResizableSections.ts"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport * as React from 'react'\n\nexport interface ResizableSectionsOptions<Id extends string> {\n ids: readonly Id[]\n defaultWeights: Record<Id, number>\n minWeights: Record<Id, number>\n open: Record<Id, boolean>\n separatorHeight?: number\n}\n\nexport interface ResizableSections<Id extends string> {\n layoutRef: React.RefObject<HTMLDivElement | null>\n gridTemplateRows: string\n weights: Record<Id, number>\n separatorAfter: (id: Id) => boolean\n beginResize: (id: Id) => (event: React.PointerEvent<HTMLElement>) => void\n separatorHeight: number\n}\n\nfunction nextOpenAfter<Id extends string>(\n ids: readonly Id[],\n open: Record<Id, boolean>,\n id: Id,\n): Id | null {\n const index = ids.indexOf(id)\n for (let i = index + 1; i < ids.length; i++) {\n if (open[ids[i]]) return ids[i]\n }\n return null\n}\n\n/**\n * Draggable-separator layout for N collapsible sidebar sections. A separator\n * resizes only its two neighbours, clamped against that pair's own sum.\n */\nexport function useResizableSections<Id extends string>(\n options: ResizableSectionsOptions<Id>,\n): ResizableSections<Id> {\n const { ids, defaultWeights, minWeights, open, separatorHeight = 8 } = options\n\n const [weights, setWeights] = React.useState<Record<Id, number>>(defaultWeights)\n\n const layoutRef = React.useRef<HTMLDivElement | null>(null)\n const dragStateRef = React.useRef<{\n id: Id\n nextId: Id\n startY: number\n startWeight: number\n /** Locked in at drag start; the pair's sum stays invariant through the drag. */\n pairSum: number\n /** Pixels per weight unit, so pointer movement maps onto the weights. */\n pixelsPerUnit: number\n } | null>(null)\n\n const separatorAfter = React.useCallback(\n (id: Id) => Boolean(open[id]) && nextOpenAfter(ids, open, id) !== null,\n [ids, open],\n )\n\n const handlePointerMove = React.useCallback((event: PointerEvent) => {\n const drag = dragStateRef.current\n if (!drag || drag.pixelsPerUnit <= 0) return\n\n const delta = (event.clientY - drag.startY) / drag.pixelsPerUnit\n const next = Math.min(\n drag.pairSum - minWeights[drag.nextId],\n Math.max(minWeights[drag.id], drag.startWeight + delta),\n )\n\n setWeights(current => ({ ...current, [drag.id]: next, [drag.nextId]: drag.pairSum - next }))\n }, [minWeights])\n\n const stopDragging = React.useCallback(() => {\n dragStateRef.current = null\n window.removeEventListener('pointermove', handlePointerMove)\n window.removeEventListener('pointerup', stopDragging)\n window.removeEventListener('pointercancel', stopDragging)\n }, [handlePointerMove])\n\n React.useEffect(() => stopDragging, [stopDragging])\n\n const beginResize = React.useCallback(\n (id: Id) => (event: React.PointerEvent<HTMLElement>) => {\n const layout = layoutRef.current\n if (!layout) return\n\n const nextId = nextOpenAfter(ids, open, id)\n if (!nextId) return\n\n const openTotal = ids.reduce(\n (sum, sectionId) => (open[sectionId] ? sum + weights[sectionId] : sum),\n 0,\n )\n const renderedSeparators = ids.filter(sectionId => separatorAfter(sectionId)).length\n const flexibleHeight = layout.clientHeight - separatorHeight * renderedSeparators\n if (flexibleHeight <= 0 || openTotal <= 0) return\n\n event.preventDefault()\n event.currentTarget.setPointerCapture(event.pointerId)\n dragStateRef.current = {\n id,\n nextId,\n startY: event.clientY,\n startWeight: weights[id],\n pairSum: weights[id] + weights[nextId],\n pixelsPerUnit: flexibleHeight / openTotal,\n }\n\n window.addEventListener('pointermove', handlePointerMove)\n window.addEventListener('pointerup', stopDragging)\n window.addEventListener('pointercancel', stopDragging)\n },\n [ids, open, weights, separatorAfter, separatorHeight, handlePointerMove, stopDragging],\n )\n\n const gridTemplateRows = React.useMemo(() => {\n const rows: string[] = []\n for (const id of ids) {\n // A collapsed section shows only its header, so its row is auto rather than a weighted fr.\n rows.push(open[id] ? `${weights[id]}fr` : 'auto')\n if (separatorAfter(id)) rows.push(`${separatorHeight}px`)\n }\n return rows.join(' ')\n }, [ids, open, weights, separatorAfter, separatorHeight])\n\n return { layoutRef, gridTemplateRows, weights, separatorAfter, beginResize, separatorHeight }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAKA,YAAY,WAAW;AAmBvB,SAAS,cACP,KACA,MACA,IACW;AACX,QAAM,QAAQ,IAAI,QAAQ,EAAE;AAC5B,WAAS,IAAI,QAAQ,GAAG,IAAI,IAAI,QAAQ,KAAK;AAC3C,QAAI,KAAK,IAAI,CAAC,CAAC,EAAG,QAAO,IAAI,CAAC;AAAA,EAChC;AACA,SAAO;AACT;AAMO,SAAS,qBACd,SACuB;AACvB,QAAM,EAAE,KAAK,gBAAgB,YAAY,MAAM,kBAAkB,EAAE,IAAI;AAEvE,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAA6B,cAAc;AAE/E,QAAM,YAAY,MAAM,OAA8B,IAAI;AAC1D,QAAM,eAAe,MAAM,OASjB,IAAI;AAEd,QAAM,iBAAiB,MAAM;AAAA,IAC3B,CAAC,OAAW,QAAQ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B,KAAK,aAAa,EAAG;AAE3C,YAAM,eAAe;AACrB,YAAM,cAAc,kBAAkB,MAAM,SAAS;AACrD,mBAAa,UAAU;AAAA,QACrB;AAAA,QACA;AAAA,QACA,QAAQ,MAAM;AAAA,QACd,aAAa,QAAQ,EAAE;AAAA,QACvB,SAAS,QAAQ,EAAE,IAAI,QAAQ,MAAM;AAAA,QACrC,eAAe,iBAAiB;AAAA,MAClC;AAEA,aAAO,iBAAiB,eAAe,iBAAiB;AACxD,aAAO,iBAAiB,aAAa,YAAY;AACjD,aAAO,iBAAiB,iBAAiB,YAAY;AAAA,IACvD;AAAA,IACA,CAAC,KAAK,MAAM,SAAS,gBAAgB,iBAAiB,mBAAmB,YAAY;AAAA,EACvF;AAEA,QAAM,mBAAmB,MAAM,QAAQ,MAAM;AAC3C,UAAM,OAAiB,CAAC;AACxB,eAAW,MAAM,KAAK;AAEpB,WAAK,KAAK,KAAK,EAAE,IAAI,GAAG,QAAQ,EAAE,CAAC,OAAO,MAAM;AAChD,UAAI,eAAe,EAAE,EAAG,MAAK,KAAK,GAAG,eAAe,IAAI;AAAA,IAC1D;AACA,WAAO,KAAK,KAAK,GAAG;AAAA,EACtB,GAAG,CAAC,KAAK,MAAM,SAAS,gBAAgB,eAAe,CAAC;AAExD,SAAO,EAAE,WAAW,kBAAkB,SAAS,gBAAgB,aAAa,gBAAgB;AAC9F;","names":[]}
@@ -16,7 +16,11 @@ interface UploadFileArgs {
16
16
  elevation?: number;
17
17
  isVisible?: boolean;
18
18
  };
19
+ x?: number;
20
+ y?: number;
21
+ z?: number;
22
+ onProgress?: (percent: number) => void;
19
23
  }
20
- export declare function uploadFile({ file, files, buildingId, tag, isVisible, user, uploadFile, position, }: UploadFileArgs): Promise<any[]>;
24
+ export declare function uploadFile({ file, files, buildingId, tag, isVisible, user, uploadFile, position, x, y, z, onProgress, }: UploadFileArgs): Promise<any[]>;
21
25
  export {};
22
26
  //# sourceMappingURL=uploadFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uploadFile.d.ts","sourceRoot":"","sources":["../../../../src/core/components/ui/uploadFile.ts"],"names":[],"mappings":"AAMA,UAAU,cAAc;IAEtB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,GAAG,CAAA;IACT,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,GAAG,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IACzE,QAAQ,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CACtG;AAED,wBAAsB,UAAU,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,UAAU,EACV,GAAG,EACH,SAAS,EACT,IAAI,EACJ,UAAU,EACV,QAAQ,GACT,EAAE,cAAc,kBA2ChB"}
1
+ {"version":3,"file":"uploadFile.d.ts","sourceRoot":"","sources":["../../../../src/core/components/ui/uploadFile.ts"],"names":[],"mappings":"AAOA,UAAU,cAAc;IAEtB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,GAAG,CAAA;IACT,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,GAAG,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IACzE,QAAQ,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IACrG,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC;AAED,wBAAsB,UAAU,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,UAAU,EACV,GAAG,EACH,SAAS,EACT,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,CAAC,EACD,CAAC,EACD,CAAC,EACD,UAAU,GACX,EAAE,cAAc,kBAmDhB"}
@@ -1,5 +1,6 @@
1
1
  import { getFileExtension } from "../../utils/utils";
2
2
  import { getAttachmentFieldName } from "../viewers/Data/details/getAttachmentFileName";
3
+ import { uploadFileWithProgress } from "../viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS";
3
4
  async function uploadFile({
4
5
  file,
5
6
  files,
@@ -8,7 +9,11 @@ async function uploadFile({
8
9
  isVisible,
9
10
  user,
10
11
  uploadFile: uploadFile2,
11
- position
12
+ position,
13
+ x,
14
+ y,
15
+ z,
16
+ onProgress
12
17
  }) {
13
18
  if (!file && (!files || files.length === 0) || !buildingId) return null;
14
19
  const filesToProcess = files != null ? files : file ? [file] : [];
@@ -18,12 +23,16 @@ async function uploadFile({
18
23
  const presignedResponse = await fetch(`/api/presigned-url-upload?asset=${fileId}`);
19
24
  if (!presignedResponse.ok) throw new Error("Failed to fetch presigned URL");
20
25
  const { presignedUrl } = await presignedResponse.json();
21
- const uploadResponse = await fetch(presignedUrl, {
22
- method: "PUT",
23
- body: currentFile,
24
- headers: { "Content-Type": currentFile.type }
25
- });
26
- if (!uploadResponse.ok) throw new Error(`Failed to upload file to storage: ${uploadResponse.status}`);
26
+ if (onProgress) {
27
+ await uploadFileWithProgress(presignedUrl, currentFile, (percent) => onProgress(percent));
28
+ } else {
29
+ const uploadResponse = await fetch(presignedUrl, {
30
+ method: "PUT",
31
+ body: currentFile,
32
+ headers: { "Content-Type": currentFile.type }
33
+ });
34
+ if (!uploadResponse.ok) throw new Error(`Failed to upload file to storage: ${uploadResponse.status}`);
35
+ }
27
36
  const attachmentFieldName = getAttachmentFieldName(tag);
28
37
  const fileData = {
29
38
  name: currentFile.name,
@@ -39,6 +48,9 @@ async function uploadFile({
39
48
  [attachmentFieldName]: buildingId,
40
49
  fileOrganizationId: (user == null ? void 0 : user.organizationId) || null,
41
50
  position: JSON.stringify(position) || null,
51
+ x,
52
+ y,
53
+ z,
42
54
  isVisible: isVisible != null ? isVisible : false
43
55
  };
44
56
  const result = await uploadFile2({ fileData, buildingId });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/components/ui/uploadFile.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport { getFileExtension } from '../../utils/utils'\nimport { getAttachmentFieldName } from '../viewers/Data/details/getAttachmentFileName'\n\ninterface UploadFileArgs {\n // Support both single and multiple files; prefer `files` when passing many\n file?: File\n files?: File[]\n buildingId: number\n tag?: string\n user: any\n isVisible?: boolean\n uploadFile: (args: { fileData: any, buildingId: number }) => Promise<any>\n position?: { lng?: number, lat?: number, rotation?: number, elevation?: number, isVisible?: boolean }\n}\n\nexport async function uploadFile({\n file,\n files,\n buildingId,\n tag,\n isVisible,\n user,\n uploadFile,\n position,\n}: UploadFileArgs) {\n if ((!file && (!files || files.length === 0)) || !buildingId) return null\n\n const filesToProcess: File[] = files ?? (file ? [file] : [])\n\n const uploadResults: any[] = []\n\n for (const currentFile of filesToProcess) {\n const fileId = crypto.randomUUID()\n const presignedResponse = await fetch(`/api/presigned-url-upload?asset=${fileId}`)\n if (!presignedResponse.ok) throw new Error('Failed to fetch presigned URL')\n const { presignedUrl } = await presignedResponse.json()\n\n const uploadResponse = await fetch(presignedUrl, {\n method: 'PUT',\n body: currentFile,\n headers: { 'Content-Type': currentFile.type },\n })\n if (!uploadResponse.ok) throw new Error(`Failed to upload file to storage: ${uploadResponse.status}`)\n\n const attachmentFieldName = getAttachmentFieldName(tag as string)\n const fileData = {\n name: currentFile.name,\n type: 'system',\n mimeType: currentFile.type,\n extension: getFileExtension(currentFile),\n sizeBytes: currentFile.size,\n tag,\n uploadedAt: new Date().toISOString(),\n url: '',\n assetId: fileId,\n description: '',\n [attachmentFieldName]: buildingId,\n fileOrganizationId: user?.organizationId || null,\n position: JSON.stringify(position) || null,\n isVisible: isVisible ?? false,\n }\n\n const result = await uploadFile({ fileData, buildingId })\n uploadResults.push(result)\n }\n\n return uploadResults\n}\n"],"mappings":"AAGA,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AAcvC,eAAsB,WAAW;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAAA;AAAA,EACA;AACF,GAAmB;AACjB,MAAK,CAAC,SAAS,CAAC,SAAS,MAAM,WAAW,MAAO,CAAC,WAAY,QAAO;AAErE,QAAM,iBAAyB,wBAAU,OAAO,CAAC,IAAI,IAAI,CAAC;AAE1D,QAAM,gBAAuB,CAAC;AAE9B,aAAW,eAAe,gBAAgB;AACxC,UAAM,SAAS,OAAO,WAAW;AACjC,UAAM,oBAAoB,MAAM,MAAM,mCAAmC,MAAM,EAAE;AACjF,QAAI,CAAC,kBAAkB,GAAI,OAAM,IAAI,MAAM,+BAA+B;AAC1E,UAAM,EAAE,aAAa,IAAI,MAAM,kBAAkB,KAAK;AAEtD,UAAM,iBAAiB,MAAM,MAAM,cAAc;AAAA,MAC/C,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,SAAS,EAAE,gBAAgB,YAAY,KAAK;AAAA,IAC9C,CAAC;AACD,QAAI,CAAC,eAAe,GAAI,OAAM,IAAI,MAAM,qCAAqC,eAAe,MAAM,EAAE;AAEpG,UAAM,sBAAsB,uBAAuB,GAAa;AAChE,UAAM,WAAW;AAAA,MACf,MAAM,YAAY;AAAA,MAClB,MAAM;AAAA,MACN,UAAU,YAAY;AAAA,MACtB,WAAW,iBAAiB,WAAW;AAAA,MACvC,WAAW,YAAY;AAAA,MACvB;AAAA,MACA,aAAY,oBAAI,KAAK,GAAE,YAAY;AAAA,MACnC,KAAK;AAAA,MACL,SAAS;AAAA,MACT,aAAa;AAAA,MACb,CAAC,mBAAmB,GAAG;AAAA,MACvB,qBAAoB,6BAAM,mBAAkB;AAAA,MAC5C,UAAU,KAAK,UAAU,QAAQ,KAAK;AAAA,MACtC,WAAW,gCAAa;AAAA,IAC1B;AAEA,UAAM,SAAS,MAAMA,YAAW,EAAE,UAAU,WAAW,CAAC;AACxD,kBAAc,KAAK,MAAM;AAAA,EAC3B;AAEA,SAAO;AACT;","names":["uploadFile"]}
1
+ {"version":3,"sources":["../../../../src/core/components/ui/uploadFile.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport { getFileExtension } from '../../utils/utils'\nimport { getAttachmentFieldName } from '../viewers/Data/details/getAttachmentFileName'\nimport { uploadFileWithProgress } from '../viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS'\n\ninterface UploadFileArgs {\n // Support both single and multiple files; prefer `files` when passing many\n file?: File\n files?: File[]\n buildingId: number\n tag?: string\n user: any\n isVisible?: boolean\n uploadFile: (args: { fileData: any, buildingId: number }) => Promise<any>\n position?: { lng?: number, lat?: number, rotation?: number, elevation?: number, isVisible?: boolean }\n x?: number\n y?: number\n z?: number\n onProgress?: (percent: number) => void\n}\n\nexport async function uploadFile({\n file,\n files,\n buildingId,\n tag,\n isVisible,\n user,\n uploadFile,\n position,\n x,\n y,\n z,\n onProgress,\n}: UploadFileArgs) {\n if ((!file && (!files || files.length === 0)) || !buildingId) return null\n\n const filesToProcess: File[] = files ?? (file ? [file] : [])\n\n const uploadResults: any[] = []\n\n for (const currentFile of filesToProcess) {\n const fileId = crypto.randomUUID()\n const presignedResponse = await fetch(`/api/presigned-url-upload?asset=${fileId}`)\n if (!presignedResponse.ok) throw new Error('Failed to fetch presigned URL')\n const { presignedUrl } = await presignedResponse.json()\n\n if (onProgress) {\n await uploadFileWithProgress(presignedUrl, currentFile, percent => onProgress(percent))\n }\n else {\n const uploadResponse = await fetch(presignedUrl, {\n method: 'PUT',\n body: currentFile,\n headers: { 'Content-Type': currentFile.type },\n })\n if (!uploadResponse.ok) throw new Error(`Failed to upload file to storage: ${uploadResponse.status}`)\n }\n\n const attachmentFieldName = getAttachmentFieldName(tag as string)\n const fileData = {\n name: currentFile.name,\n type: 'system',\n mimeType: currentFile.type,\n extension: getFileExtension(currentFile),\n sizeBytes: currentFile.size,\n tag,\n uploadedAt: new Date().toISOString(),\n url: '',\n assetId: fileId,\n description: '',\n [attachmentFieldName]: buildingId,\n fileOrganizationId: user?.organizationId || null,\n position: JSON.stringify(position) || null,\n x,\n y,\n z,\n isVisible: isVisible ?? false,\n }\n\n const result = await uploadFile({ fileData, buildingId })\n uploadResults.push(result)\n }\n\n return uploadResults\n}\n"],"mappings":"AAGA,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AACvC,SAAS,8BAA8B;AAkBvC,eAAsB,WAAW;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,MAAK,CAAC,SAAS,CAAC,SAAS,MAAM,WAAW,MAAO,CAAC,WAAY,QAAO;AAErE,QAAM,iBAAyB,wBAAU,OAAO,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["../../../../src/core/components/viewers/Viewer.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAe9B,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,qBAAqB,CAAA;AAyClE,UAAU,WAAW;IACnB,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,MAAM,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,EAAE,WAAW,qBA2IhJ"}
1
+ {"version":3,"file":"Viewer.d.ts","sourceRoot":"","sources":["../../../../src/core/components/viewers/Viewer.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAgB9B,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,qBAAqB,CAAA;AAqClE,UAAU,WAAW;IACnB,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,MAAM,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,EAAE,WAAW,qBA2IhJ"}
@@ -12,6 +12,7 @@ import { ViewerNames } from "../../types";
12
12
  import { switchLanguage } from "../../utils/utils";
13
13
  import { UserSettings } from "../settings";
14
14
  import { Toolbar } from "../Toolbar";
15
+ import { UploadProgressToasts } from "../ui/FilesManager/src/UploadProgressBar";
15
16
  import { SidebarTrigger } from "../ui/Sidebar";
16
17
  import { MapViewer } from "./map/MapViewer";
17
18
  import { isViewerAllowed } from "./viewerAccess";
@@ -19,10 +20,6 @@ const BimViewer = dynamic(
19
20
  () => import("./bim/BimViewer").then((m) => ({ default: m.BimViewer })),
20
21
  { ssr: false, loading: () => /* @__PURE__ */ jsx(ViewerLoadingFallback, { label: "Loading BIM viewer\u2026" }) }
21
22
  );
22
- const PointCloudViewer = dynamic(
23
- () => import("./pointcloud/PointCloudViewer").then((m) => ({ default: m.PointCloudViewer })),
24
- { ssr: false, loading: () => /* @__PURE__ */ jsx(ViewerLoadingFallback, { label: "Loading point cloud viewer\u2026" }) }
25
- );
26
23
  const PluginsManager = dynamic(
27
24
  () => import("./plugins/PluginsManager").then((m) => ({ default: m.PluginsManager })),
28
25
  { ssr: false, loading: () => /* @__PURE__ */ jsx(ViewerLoadingFallback, { label: "Loading plugins\u2026" }) }
@@ -110,11 +107,10 @@ function Viewer({ organization, minioBaseUrl, martinBaseUrl, pointcloudApiUrl, m
110
107
  }, [validViewer, menusDispatch, isMounted, currentViewer]);
111
108
  const builtInViewer = pluginPage ? null : validViewer;
112
109
  const selectedViewer = /* @__PURE__ */ jsxs(Fragment, { children: [
113
- builtInViewer !== null && [ViewerNames.map, ViewerNames.bim, ViewerNames.pointcloud].includes(builtInViewer) && /* @__PURE__ */ jsx(SidebarTrigger, {}),
110
+ builtInViewer !== null && [ViewerNames.map, ViewerNames.bim].includes(builtInViewer) && /* @__PURE__ */ jsx(SidebarTrigger, {}),
114
111
  /* @__PURE__ */ jsxs("div", { style: { height: "100%", width: "100%", position: "relative" }, children: [
115
112
  /* @__PURE__ */ jsx("div", { style: { display: builtInViewer === ViewerNames.map ? "block" : "none", width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(MapViewer, { organization, maptilerKey }) }),
116
113
  builtInViewer === ViewerNames.bim && /* @__PURE__ */ jsx(BimViewer, { pointcloudApiUrl }),
117
- builtInViewer === ViewerNames.pointcloud && /* @__PURE__ */ jsx(PointCloudViewer, { pointcloudApiUrl }),
118
114
  builtInViewer !== null && [ViewerNames.buildings, ViewerNames.sites, ViewerNames.files, ViewerNames.land, ViewerNames.infrastructure, ViewerNames.users].includes(builtInViewer) && /* @__PURE__ */ jsx(DataMenu, { currentViewer: builtInViewer, organization, geocodeEarthApiKey, geocoderUrl }),
119
115
  builtInViewer === ViewerNames.extensions && /* @__PURE__ */ jsx("div", { className: "h-full w-full overflow-y-auto", children: /* @__PURE__ */ jsx(PluginsManager, {}) }),
120
116
  builtInViewer === ViewerNames.settings && /* @__PURE__ */ jsx(UserSettings, { minioBaseUrl }),
@@ -123,7 +119,8 @@ function Viewer({ organization, minioBaseUrl, martinBaseUrl, pointcloudApiUrl, m
123
119
  ] });
124
120
  return /* @__PURE__ */ jsxs(Fragment, { children: [
125
121
  selectedViewer,
126
- /* @__PURE__ */ jsx(Toolbar, { viewer: validViewer, minioBaseUrl, martinBaseUrl, organization, geocodeEarthApiKey, geocoderUrl })
122
+ /* @__PURE__ */ jsx(Toolbar, { viewer: validViewer, minioBaseUrl, martinBaseUrl, organization, geocodeEarthApiKey, geocoderUrl }),
123
+ /* @__PURE__ */ jsx(UploadProgressToasts, {})
127
124
  ] });
128
125
  }
129
126
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/components/viewers/Viewer.tsx"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\n// Dependencies\nimport { Loader2 } from 'lucide-react'\nimport dynamic from 'next/dynamic'\nimport { useSearchParams, useRouter, usePathname } from 'next/navigation'\nimport * as React from 'react'\n\nimport { parsePluginViewerKey } from '../../plugins/host/pluginViewerKey'\nimport { BuildingsContext, MenusContext } from '../../store'\nimport { ViewerNames } from '../../types'\n\n// Deep import, not the ui barrel: the barrel drags heavy modules into the eager map bundle.\nimport { switchLanguage } from '../../utils/utils'\nimport { UserSettings } from '../settings'\nimport { Toolbar } from '../Toolbar'\nimport { SidebarTrigger } from '../ui/Sidebar'\n\nimport { MapViewer } from './map/MapViewer'\nimport { isViewerAllowed } from './viewerAccess'\n\nimport type { Organization, ViewerKey } from '../../types/dbTypes'\n\n// Code-split: map-only sessions must not pay for @thatopen or the Potree stack.\nconst BimViewer = dynamic(\n () => import('./bim/BimViewer').then(m => ({ default: m.BimViewer })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading BIM viewer…\" /> },\n)\nconst PointCloudViewer = dynamic(\n () => import('./pointcloud/PointCloudViewer').then(m => ({ default: m.PointCloudViewer })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading point cloud viewer…\" /> },\n)\n\n// DataMenu reaches BimViewer through FilePreview, so a static import undoes the split above.\nconst PluginsManager = dynamic(\n () => import('./plugins/PluginsManager').then(m => ({ default: m.PluginsManager })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading plugins…\" /> },\n)\n\nconst DataMenu = dynamic(\n () => import('./Data/DataMenu').then(m => ({ default: m.DataMenu })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading data…\" /> },\n)\n\n// Lazy too, or every plugin's page code lands in the eager bundle for every user.\nconst PluginDataPageHost = dynamic(\n () => import('../../plugins/host/PluginDataPageHost').then(m => ({ default: m.PluginDataPageHost })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading page…\" /> },\n)\n\n// Matches BimLoadingState using only Tailwind tokens, so the eager bundle stays light.\nfunction ViewerLoadingFallback({ label }: { label: string }) {\n return (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-background/50 backdrop-blur-[1px]\">\n <div className=\"flex items-center gap-3 rounded-md border border-border bg-card px-5 py-4 shadow-sm\">\n <Loader2 className=\"h-5 w-5 animate-spin text-muted-foreground\" />\n <span className=\"text-foreground text-base font-medium font-['Inter'] leading-7\">{label}</span>\n </div>\n </div>\n )\n}\n\ninterface ViewerProps {\n organization: Organization\n minioBaseUrl?: string\n martinBaseUrl?: string\n pointcloudApiUrl?: string\n maptilerKey?: string\n geocodeEarthApiKey?: string\n geocoderUrl?: string\n}\n\nexport function Viewer({ organization, minioBaseUrl, martinBaseUrl, pointcloudApiUrl, maptilerKey, geocodeEarthApiKey, geocoderUrl }: ViewerProps) {\n\n const searchParams = useSearchParams()\n const viewer = (searchParams.get('viewer') as ViewerKey) || ViewerNames.map\n\n const { dispatch: menusDispatch, state: menusState } = React.useContext(MenusContext)\n const { state: buildingState } = React.useContext(BuildingsContext)\n // const { dispatch: appConfigDispatch } = React.useContext(AppConfigContext)\n const { building } = buildingState.buildings\n const { currentViewer } = menusState.menus\n const router = useRouter()\n const pathname = usePathname()\n const [isMounted, setIsMounted] = React.useState(false)\n\n // Use a ref to track if we're currently updating -> prevent circular updates\n const isUpdatingRef = React.useRef(false)\n\n const { appContent } = organization\n\n const pluginPage = parsePluginViewerKey(viewer)\n const isViewerValid = isViewerAllowed(viewer, appContent)\n\n // Use default viewer (map) if current viewer is not valid\n const validViewer = isViewerValid ? viewer : ViewerNames.map\n\n // Update URL if viewer was not available for the organization\n React.useEffect(() => {\n if (isMounted && !isViewerValid && viewer !== ViewerNames.map) {\n const newSearchParams = new URLSearchParams(searchParams.toString())\n newSearchParams.delete('viewer')\n if (building?.id) {\n newSearchParams.set('buildingId', String(building.id))\n }\n router.replace(`${pathname}?${newSearchParams.toString()}`, { scroll: false })\n }\n }, [isMounted, isViewerValid, viewer, searchParams, pathname, router, building?.id])\n\n // On first mount, respond to URL\n React.useEffect(() => {\n if (!isMounted) {\n menusDispatch({\n type: 'SET_VIEWER',\n payload: { currentViewer: validViewer },\n })\n setIsMounted(true)\n }\n }, [isMounted, validViewer, menusDispatch])\n\n React.useEffect(() => {\n if (!organization) return\n const defaultLanguage = organization.languages?.[0] || 'En'\n if (defaultLanguage) void switchLanguage(defaultLanguage)\n }, [organization])\n\n // Handle context changes (from sidebar, HeaderButtons, etc.)\n React.useEffect(() => {\n if (!isMounted || !currentViewer || currentViewer === validViewer || isUpdatingRef.current) {\n return\n }\n\n isUpdatingRef.current = true\n\n // Create URLSearchParams to preserve existing search params\n\n const newSearchParams = new URLSearchParams(searchParams.toString())\n newSearchParams.set('viewer', currentViewer)\n if (building?.id) {\n newSearchParams.set('buildingId', String(building.id))\n }\n\n\n router.replace(`${pathname}?${newSearchParams.toString()}`, { scroll: false })\n\n // Reset the flag after a brief delay to allow the navigation to complete\n setTimeout(() => {\n isUpdatingRef.current = false\n }, 100)\n }, [currentViewer, isMounted, pathname, router, viewer, searchParams])\n\n // Handle URL changes (direct navigation)\n React.useEffect(() => {\n if (isMounted && currentViewer !== validViewer && !isUpdatingRef.current) {\n isUpdatingRef.current = true\n\n menusDispatch({\n type: 'SET_VIEWER',\n payload: { currentViewer: validViewer },\n })\n\n // Reset the flag after a brief delay\n setTimeout(() => {\n isUpdatingRef.current = false\n }, 100)\n }\n }, [validViewer, menusDispatch, isMounted, currentViewer])\n\n // Null while a plugin page shows, so the branches below stay exhaustive over ViewerNames.\n const builtInViewer = pluginPage ? null : (validViewer as ViewerNames)\n\n const selectedViewer = (\n <>\n {builtInViewer !== null\n && [ViewerNames.map, ViewerNames.bim, ViewerNames.pointcloud].includes(builtInViewer)\n && <SidebarTrigger />}\n <div style={{ height: '100%', width: '100%', position: 'relative' }}>\n <div style={{ display: builtInViewer === ViewerNames.map ? 'block' : 'none', width: '100%', height: '100%' }}>\n <MapViewer organization={organization} maptilerKey={maptilerKey} />\n </div>\n {builtInViewer === ViewerNames.bim && <BimViewer pointcloudApiUrl={pointcloudApiUrl} />}\n {builtInViewer === ViewerNames.pointcloud && <PointCloudViewer pointcloudApiUrl={pointcloudApiUrl} />}\n {builtInViewer !== null\n && [ViewerNames.buildings, ViewerNames.sites, ViewerNames.files, ViewerNames.land, ViewerNames.infrastructure, ViewerNames.users].includes(builtInViewer) && (\n <DataMenu currentViewer={builtInViewer} organization={organization} geocodeEarthApiKey={geocodeEarthApiKey} geocoderUrl={geocoderUrl} />\n )}\n {/* `plugins` used to route through DataMenu, which rendered nothing:\n VIEWER_CONFIG gives it no dataType. It has its own page now. */}\n {builtInViewer === ViewerNames.extensions && (\n <div className=\"h-full w-full overflow-y-auto\">\n <PluginsManager />\n </div>\n )}\n {builtInViewer === ViewerNames.settings && (\n <UserSettings minioBaseUrl={minioBaseUrl} />\n )}\n {pluginPage && (\n <div className=\"h-full w-full overflow-y-auto\">\n <PluginDataPageHost viewer={validViewer} />\n </div>\n )}\n </div>\n </>\n )\n\n return (\n <>\n {selectedViewer}\n <Toolbar viewer={validViewer} minioBaseUrl={minioBaseUrl} martinBaseUrl={martinBaseUrl} organization={organization} geocodeEarthApiKey={geocodeEarthApiKey} geocoderUrl={geocoderUrl} />\n </>\n )\n}"],"mappings":";AA6B+B,SAkJ3B,UAlJ2B,KA4BzB,YA5ByB;AAvB/B,SAAS,eAAe;AACxB,OAAO,aAAa;AACpB,SAAS,iBAAiB,WAAW,mBAAmB;AACxD,YAAY,WAAW;AAEvB,SAAS,4BAA4B;AACrC,SAAS,kBAAkB,oBAAoB;AAC/C,SAAS,mBAAmB;AAG5B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAE/B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAKhC,MAAM,YAAY;AAAA,EAChB,MAAM,OAAO,iBAAiB,EAAE,KAAK,QAAM,EAAE,SAAS,EAAE,UAAU,EAAE;AAAA,EACpE,EAAE,KAAK,OAAO,SAAS,MAAM,oBAAC,yBAAsB,OAAM,4BAAsB,EAAG;AACrF;AACA,MAAM,mBAAmB;AAAA,EACvB,MAAM,OAAO,+BAA+B,EAAE,KAAK,QAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE;AAAA,EACzF,EAAE,KAAK,OAAO,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AgB,YAAY,KAAK,EAAE,SAAS,aAAa,KACxJ,oBAAC,YAAS,eAAe,eAAe,cAA4B,oBAAwC,aAA0B;AAAA,MAIvI,kBAAkB,YAAY,cAC7B,oBAAC,SAAI,WAAU,iCACb,8BAAC,kBAAe,GAClB;AAAA,MAED,kBAAkB,YAAY,YAC7B,oBAAC,gBAAa,cAA4B;AAAA,MAE3C,cACC,oBAAC,SAAI,WAAU,iCACb,8BAAC,sBAAmB,QAAQ,aAAa,GAC3C;AAAA,OAEJ;AAAA,KACF;AAGF,SACE,iCACG;AAAA;AAAA,IACD,oBAAC,WAAQ,QAAQ,aAAa,cAA4B,eAA8B,cAA4B,oBAAwC,aAA0B;AAAA,KACxL;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/components/viewers/Viewer.tsx"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\n// Dependencies\nimport { Loader2 } from 'lucide-react'\nimport dynamic from 'next/dynamic'\nimport { useSearchParams, useRouter, usePathname } from 'next/navigation'\nimport * as React from 'react'\n\nimport { parsePluginViewerKey } from '../../plugins/host/pluginViewerKey'\nimport { BuildingsContext, MenusContext } from '../../store'\nimport { ViewerNames } from '../../types'\n\n// Deep import, not the ui barrel: the barrel drags heavy modules into the eager map bundle.\nimport { switchLanguage } from '../../utils/utils'\nimport { UserSettings } from '../settings'\nimport { Toolbar } from '../Toolbar'\nimport { UploadProgressToasts } from '../ui/FilesManager/src/UploadProgressBar'\nimport { SidebarTrigger } from '../ui/Sidebar'\n\nimport { MapViewer } from './map/MapViewer'\nimport { isViewerAllowed } from './viewerAccess'\n\nimport type { Organization, ViewerKey } from '../../types/dbTypes'\n\n// Code-split: map-only sessions must not pay for @thatopen or the Potree stack.\nconst BimViewer = dynamic(\n () => import('./bim/BimViewer').then(m => ({ default: m.BimViewer })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading BIM viewer…\" /> },\n)\n\n// DataMenu reaches BimViewer through FilePreview, so a static import undoes the split above.\nconst PluginsManager = dynamic(\n () => import('./plugins/PluginsManager').then(m => ({ default: m.PluginsManager })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading plugins…\" /> },\n)\n\nconst DataMenu = dynamic(\n () => import('./Data/DataMenu').then(m => ({ default: m.DataMenu })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading data…\" /> },\n)\n\n// Lazy too, or every plugin's page code lands in the eager bundle for every user.\nconst PluginDataPageHost = dynamic(\n () => import('../../plugins/host/PluginDataPageHost').then(m => ({ default: m.PluginDataPageHost })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading page…\" /> },\n)\n\n// Matches BimLoadingState using only Tailwind tokens, so the eager bundle stays light.\nfunction ViewerLoadingFallback({ label }: { label: string }) {\n return (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-background/50 backdrop-blur-[1px]\">\n <div className=\"flex items-center gap-3 rounded-md border border-border bg-card px-5 py-4 shadow-sm\">\n <Loader2 className=\"h-5 w-5 animate-spin text-muted-foreground\" />\n <span className=\"text-foreground text-base font-medium font-['Inter'] leading-7\">{label}</span>\n </div>\n </div>\n )\n}\n\ninterface ViewerProps {\n organization: Organization\n minioBaseUrl?: string\n martinBaseUrl?: string\n pointcloudApiUrl?: string\n maptilerKey?: string\n geocodeEarthApiKey?: string\n geocoderUrl?: string\n}\n\nexport function Viewer({ organization, minioBaseUrl, martinBaseUrl, pointcloudApiUrl, maptilerKey, geocodeEarthApiKey, geocoderUrl }: ViewerProps) {\n\n const searchParams = useSearchParams()\n const viewer = (searchParams.get('viewer') as ViewerKey) || ViewerNames.map\n\n const { dispatch: menusDispatch, state: menusState } = React.useContext(MenusContext)\n const { state: buildingState } = React.useContext(BuildingsContext)\n // const { dispatch: appConfigDispatch } = React.useContext(AppConfigContext)\n const { building } = buildingState.buildings\n const { currentViewer } = menusState.menus\n const router = useRouter()\n const pathname = usePathname()\n const [isMounted, setIsMounted] = React.useState(false)\n\n // Use a ref to track if we're currently updating -> prevent circular updates\n const isUpdatingRef = React.useRef(false)\n\n const { appContent } = organization\n\n const pluginPage = parsePluginViewerKey(viewer)\n const isViewerValid = isViewerAllowed(viewer, appContent)\n\n // Use default viewer (map) if current viewer is not valid\n const validViewer = isViewerValid ? viewer : ViewerNames.map\n\n // Update URL if viewer was not available for the organization\n React.useEffect(() => {\n if (isMounted && !isViewerValid && viewer !== ViewerNames.map) {\n const newSearchParams = new URLSearchParams(searchParams.toString())\n newSearchParams.delete('viewer')\n if (building?.id) {\n newSearchParams.set('buildingId', String(building.id))\n }\n router.replace(`${pathname}?${newSearchParams.toString()}`, { scroll: false })\n }\n }, [isMounted, isViewerValid, viewer, searchParams, pathname, router, building?.id])\n\n // On first mount, respond to URL\n React.useEffect(() => {\n if (!isMounted) {\n menusDispatch({\n type: 'SET_VIEWER',\n payload: { currentViewer: validViewer },\n })\n setIsMounted(true)\n }\n }, [isMounted, validViewer, menusDispatch])\n\n React.useEffect(() => {\n if (!organization) return\n const defaultLanguage = organization.languages?.[0] || 'En'\n if (defaultLanguage) void switchLanguage(defaultLanguage)\n }, [organization])\n\n // Handle context changes (from sidebar, HeaderButtons, etc.)\n React.useEffect(() => {\n if (!isMounted || !currentViewer || currentViewer === validViewer || isUpdatingRef.current) {\n return\n }\n\n isUpdatingRef.current = true\n\n // Create URLSearchParams to preserve existing search params\n\n const newSearchParams = new URLSearchParams(searchParams.toString())\n newSearchParams.set('viewer', currentViewer)\n if (building?.id) {\n newSearchParams.set('buildingId', String(building.id))\n }\n\n\n router.replace(`${pathname}?${newSearchParams.toString()}`, { scroll: false })\n\n // Reset the flag after a brief delay to allow the navigation to complete\n setTimeout(() => {\n isUpdatingRef.current = false\n }, 100)\n }, [currentViewer, isMounted, pathname, router, viewer, searchParams])\n\n // Handle URL changes (direct navigation)\n React.useEffect(() => {\n if (isMounted && currentViewer !== validViewer && !isUpdatingRef.current) {\n isUpdatingRef.current = true\n\n menusDispatch({\n type: 'SET_VIEWER',\n payload: { currentViewer: validViewer },\n })\n\n // Reset the flag after a brief delay\n setTimeout(() => {\n isUpdatingRef.current = false\n }, 100)\n }\n }, [validViewer, menusDispatch, isMounted, currentViewer])\n\n // Null while a plugin page shows, so the branches below stay exhaustive over ViewerNames.\n const builtInViewer = pluginPage ? null : (validViewer as ViewerNames)\n\n const selectedViewer = (\n <>\n {builtInViewer !== null\n && [ViewerNames.map, ViewerNames.bim].includes(builtInViewer)\n && <SidebarTrigger />}\n <div style={{ height: '100%', width: '100%', position: 'relative' }}>\n <div style={{ display: builtInViewer === ViewerNames.map ? 'block' : 'none', width: '100%', height: '100%' }}>\n <MapViewer organization={organization} maptilerKey={maptilerKey} />\n </div>\n {builtInViewer === ViewerNames.bim && <BimViewer pointcloudApiUrl={pointcloudApiUrl} />}\n {builtInViewer !== null\n && [ViewerNames.buildings, ViewerNames.sites, ViewerNames.files, ViewerNames.land, ViewerNames.infrastructure, ViewerNames.users].includes(builtInViewer) && (\n <DataMenu currentViewer={builtInViewer} organization={organization} geocodeEarthApiKey={geocodeEarthApiKey} geocoderUrl={geocoderUrl} />\n )}\n {/* `plugins` used to route through DataMenu, which rendered nothing:\n VIEWER_CONFIG gives it no dataType. It has its own page now. */}\n {builtInViewer === ViewerNames.extensions && (\n <div className=\"h-full w-full overflow-y-auto\">\n <PluginsManager />\n </div>\n )}\n {builtInViewer === ViewerNames.settings && (\n <UserSettings minioBaseUrl={minioBaseUrl} />\n )}\n {pluginPage && (\n <div className=\"h-full w-full overflow-y-auto\">\n <PluginDataPageHost viewer={validViewer} />\n </div>\n )}\n </div>\n </>\n )\n\n return (\n <>\n {selectedViewer}\n <Toolbar viewer={validViewer} minioBaseUrl={minioBaseUrl} martinBaseUrl={martinBaseUrl} organization={organization} geocodeEarthApiKey={geocodeEarthApiKey} geocoderUrl={geocoderUrl} />\n <UploadProgressToasts />\n </>\n )\n}"],"mappings":";AA8B+B,SA8I3B,UA9I2B,KAwBzB,YAx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AAC,kBAAe;AAAA,IACrB,qBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,QAAQ,UAAU,WAAW,GAChE;AAAA,0BAAC,SAAI,OAAO,EAAE,SAAS,kBAAkB,YAAY,MAAM,UAAU,QAAQ,OAAO,QAAQ,QAAQ,OAAO,GACzG,8BAAC,aAAU,cAA4B,aAA0B,GACnE;AAAA,MACC,kBAAkB,YAAY,OAAO,oBAAC,aAAU,kBAAoC;AAAA,MACpF,kBAAkB,QACd,CAAC,YAAY,WAAW,YAAY,OAAO,YAAY,OAAO,YAAY,MAAM,YAAY,gBAAgB,YAAY,KAAK,EAAE,SAAS,aAAa,KACxJ,oBAAC,YAAS,eAAe,eAAe,cAA4B,oBAAwC,aAA0B;AAAA,MAIvI,kBAAkB,YAAY,cAC7B,oBAAC,SAAI,WAAU,iCACb,8BAAC,kBAAe,GAClB;AAAA,MAED,kBAAkB,YAAY,YAC7B,oBAAC,gBAAa,cAA4B;AAAA,MAE3C,cACC,oBAAC,SAAI,WAAU,iCACb,8BAAC,sBAAmB,QAAQ,aAAa,GAC3C;AAAA,OAEJ;AAAA,KACF;AAGF,SACE,iCACG;AAAA;AAAA,IACD,oBAAC,WAAQ,QAAQ,aAAa,cAA4B,eAA8B,cAA4B,oBAAwC,aAA0B;AAAA,IACtL,oBAAC,wBAAqB;AAAA,KACxB;AAEJ;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"BimViewer.d.ts","sourceRoot":"","sources":["../../../../../src/core/components/viewers/bim/BimViewer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmC/B,wBAAgB,SAAS,CAAC,EAAE,gBAAgB,EAAE,EAAE;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,qBAiO5E"}
1
+ {"version":3,"file":"BimViewer.d.ts","sourceRoot":"","sources":["../../../../../src/core/components/viewers/bim/BimViewer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoC/B,wBAAgB,SAAS,CAAC,EAAE,gBAAgB,EAAE,EAAE;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,qBAkO5E"}
@@ -13,6 +13,7 @@ import { ViewerLegendHost } from "../shared/legends/ViewerLegendHost";
13
13
  import { useBimCoordinateSystem } from "../useCoordinateSystem";
14
14
  import { BimLoadingState } from "./src/BimLoadingState";
15
15
  import { BuildingLocationSync } from "./src/BuildingLocationSync";
16
+ import { CameraNavigation } from "./src/CameraNavigation";
16
17
  import { ElementAppearance } from "./src/ElementAppearance";
17
18
  import { ElevationsTool } from "./src/ElevationsTool";
18
19
  import { FloorplanTool } from "./src/FloorplanTool";
@@ -101,6 +102,7 @@ function BimViewer({ pointcloudApiUrl }) {
101
102
  components.get(ElevationsTool);
102
103
  components.get(BimPointClouds);
103
104
  components.get(PlacementEditor);
105
+ components.get(CameraNavigation);
104
106
  if (grid) {
105
107
  components.get(FloorplanTool).setGrid(grid);
106
108
  components.get(ElevationsTool).setGrid(grid);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/core/components/viewers/bim/BimViewer.tsx"],"sourcesContent":["\"use client\";\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport { useTranslations, useLocale } from 'next-intl';\nimport * as React from \"react\";\nimport * as THREE from \"three\";\n\nimport { useUndoRedoShortcuts } from \"../../../hooks/useUndoRedoShortcuts\";\nimport { ToolsContext, BimContext, MenusContext } from \"../../../store\";\nimport { ViewerNames } from \"../../../types/dbTypes\";\nimport { SensorLegend } from \"../../ui/Sensors/SensorLegend\";\nimport { ViewerLegendHost } from \"../shared/legends/ViewerLegendHost\";\nimport { useBimCoordinateSystem } from \"../useCoordinateSystem\";\n\nimport { BimLoadingState } from \"./src/BimLoadingState\";\nimport { BuildingLocationSync } from \"./src/BuildingLocationSync\";\nimport { ElementAppearance } from \"./src/ElementAppearance\";\nimport { ElevationsTool } from \"./src/ElevationsTool\";\nimport { FloorplanTool } from \"./src/FloorplanTool\";\nimport { Highlighter } from \"./src/Highlighter\";\nimport { IfcClasses } from \"./src/IfcClasses\";\nimport { createBimWorld } from \"./src/lib/createBimWorld\";\n\nimport { ViewModeCoordinator } from \"./src/lib/ViewModeCoordinator\";\nimport { ModelsSync } from \"./src/ModelsSync\";\nimport { PlacementEditor } from \"./src/Placement/PlacementEditor\";\nimport { PlacementEditorHost } from \"./src/Placement/PlacementEditorHost\";\nimport { BimPointClouds } from \"./src/PointClouds\";\nimport { BimPointCloudSync } from \"./src/PointClouds/BimPointCloudSync\";\nimport { PropertiesMenu } from \"./src/propertiesMenu\";\nimport { SelectionSync } from \"./src/SelectionSync\";\nimport { ClippingPlanes } from \"./src/tools/ClippingTool/ClippingPlanes\";\nimport { ViewportGizmo } from \"./src/ViewportGizmo\";\n\nimport type { PivotIndicator } from \"./src/lib/PivotIndicator\";\n\nimport type * as OBC from \"@thatopen/components\";\n\n\nexport function BimViewer({ pointcloudApiUrl }: { pointcloudApiUrl?: string }) {\n\n const t = useTranslations('ViewportGizmo');\n const locale = useLocale();\n\n const { dispatch: bimDispatch, state: bimState } = React.useContext(BimContext);\n const { bimComponents } = bimState.bim;\n\n const { dispatch: toolsDispatch, state: toolsState } = React.useContext(ToolsContext);\n const { currentToolId } = toolsState.tools;\n\n const { state: menusState } = React.useContext(MenusContext);\n const { currentViewer } = menusState.menus;\n\n // Appearance and clipping keep separate undo stacks; the most recently changed one wins.\n const lastTouchedHistory = React.useRef<'appearance' | 'clipping'>('appearance');\n\n React.useEffect(() => {\n if (!bimComponents) return;\n const appearance = bimComponents.get(ElementAppearance);\n const clipping = bimComponents.get(ClippingPlanes);\n const offAppearance = appearance.history.onChanged(() => {\n lastTouchedHistory.current = 'appearance';\n });\n const offClipping = clipping.history.onChanged(() => {\n lastTouchedHistory.current = 'clipping';\n });\n return () => {\n offAppearance();\n offClipping();\n };\n }, [bimComponents]);\n\n const undoRedoTarget = React.useCallback((direction: 'undo' | 'redo') => {\n if (!bimComponents) return null;\n const appearance = bimComponents.get(ElementAppearance);\n const clipping = bimComponents.get(ClippingPlanes);\n const canRun = (target: typeof appearance | typeof clipping) =>\n direction === 'undo' ? target.history.canUndo : target.history.canRedo;\n\n const preferred = lastTouchedHistory.current === 'clipping' ? clipping : appearance;\n if (canRun(preferred)) return preferred;\n\n const other = preferred === clipping ? appearance : clipping;\n return canRun(other) ? other : null;\n }, [bimComponents]);\n\n useUndoRedoShortcuts({\n undo: () => { void undoRedoTarget('undo')?.undo(); },\n redo: () => { void undoRedoTarget('redo')?.redo(); },\n });\n\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const workerUrlRef = React.useRef<string | null>(null);\n const resizeObserverRef = React.useRef<ResizeObserver | null>(null);\n // This mount's own instance, so cleanup and the create-guard cannot read a stale [] closure.\n const componentsRef = React.useRef<OBC.Components | null>(null);\n const pivotRef = React.useRef<PivotIndicator | null>(null);\n\n const createViewer = React.useCallback(\n async (isCancelled: () => boolean) => {\n // Keyed to the ref, not the [] closure: a second init builds a second detached canvas.\n if (!containerRef.current || componentsRef.current) return;\n\n const container = containerRef.current;\n const { components, world, fragments, grid, workerUrl, pivot } = await createBimWorld(container);\n workerUrlRef.current = workerUrl;\n pivotRef.current = pivot;\n\n if (grid) {\n bimDispatch({\n \"type\": \"SET_GRID\",\n \"payload\": { grid }\n });\n }\n\n components.get(Highlighter);\n // Up front so it subscribes to model loads before any model arrives.\n components.get(IfcClasses);\n components.get(ViewModeCoordinator);\n // Same reason, plus drawing modes releasing the viewer both need its overrides repainted.\n components.get(ElementAppearance);\n components.get(FloorplanTool);\n components.get(ElevationsTool);\n components.get(BimPointClouds);\n components.get(PlacementEditor);\n\n // Grid injection is safe here — fragments.core is initialized.\n if (grid) {\n components.get(FloorplanTool).setGrid(grid);\n components.get(ElevationsTool).setGrid(grid);\n }\n\n // Superseded or unmounted while awaiting: drop it rather than let it win the store.\n if (isCancelled()) {\n components.dispose();\n return;\n }\n componentsRef.current = components;\n bimDispatch({\n type: \"SET_COMPONENTS\",\n payload: { bimComponents: components, world, fragments }\n });\n\n // Ensure canvas takes full container size\n const canvas = container.querySelector('canvas');\n if (canvas) {\n canvas.style.width = '100%';\n canvas.style.height = '100%';\n canvas.style.display = 'block';\n }\n\n // Handle resize using container dimensions\n const handleResize = () => {\n const width = container.clientWidth;\n const height = container.clientHeight;\n if (width && height) {\n world.renderer?.resize(new THREE.Vector2(width, height));\n }\n };\n\n // Initial resize\n handleResize();\n\n // Covers window resize too: the flex layout reshapes this container, which fires it.\n const resizeObserver = new ResizeObserver(() => {\n handleResize();\n });\n resizeObserver.observe(container);\n resizeObserverRef.current = resizeObserver;\n\n }, []\n );\n\n React.useEffect(() => {\n let cancelled = false;\n void createViewer(() => cancelled);\n\n // Cancels an in-flight createViewer and disposes the instance this mount created.\n return () => {\n cancelled = true;\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n pivotRef.current?.dispose();\n pivotRef.current = null;\n // OBC's disposal loop is unguarded, so one throw skips every component after it.\n try {\n componentsRef.current?.dispose();\n } catch (error) {\n console.error(\"BIM teardown did not complete cleanly\", error);\n } finally {\n componentsRef.current = null;\n bimDispatch({\n type: \"DISPOSE-BIM\"\n });\n }\n };\n }, []);\n\n // Enforces Y-up for three / camera-controls whenever the world's controls appear.\n useBimCoordinateSystem(bimState.bim.world?.camera?.controls ?? null);\n\n // Control ViewportGizmo based on current viewer\n React.useEffect(() => {\n if (!bimComponents) return;\n\n const viewportGizmo = bimComponents.get(ViewportGizmo);\n\n viewportGizmo.setLabels({\n top: t('top'),\n right: t('right'),\n bottom: t('bottom'),\n left: t('left'),\n front: t('front'),\n back: t('back')\n });\n\n if (!viewportGizmo) return;\n\n if (currentViewer === 'bim') {\n viewportGizmo.enabled = true;\n viewportGizmo.add();\n } else {\n viewportGizmo.enabled = false;\n viewportGizmo.remove();\n }\n }, [bimComponents, currentViewer, locale, t]);\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n overflow: \"hidden\"\n }}\n >\n <BimLoadingState />\n <ModelsSync />\n <BuildingLocationSync />\n <BimPointCloudSync pointcloudApiUrl={pointcloudApiUrl} />\n <PlacementEditorHost />\n <SelectionSync />\n <div\n className=\"bim-container\"\n id=\"bim-viewer-container\"\n ref={containerRef}\n style={{\n width: \"100%\",\n height: \"100%\",\n position: \"relative\",\n background: \"radial-gradient(circle, rgba(255, 255, 255, 1) 50%, rgba(220, 220, 220, 1) 100%)\",\n }}\n />\n {/* Bottom-left stack, mirroring MapViewer: cards stack upward with flex so a new\n overlay never needs a hand-tuned bottom offset. */}\n <div className=\"absolute bottom-20 md:bottom-3 left-3 z-10 flex max-w-[calc(100vw-1.5rem)] flex-col gap-2 pointer-events-none\">\n <SensorLegend />\n <ViewerLegendHost viewer={ViewerNames.bim} />\n </div>\n <PropertiesMenu />\n </div>\n );\n}"],"mappings":";AAgPY,cAmBA,YAnBA;AA3OZ,SAAS,iBAAiB,iBAAiB;AAC3C,YAAY,WAAW;AACvB,YAAY,WAAW;AAEvB,SAAS,4BAA4B;AACrC,SAAS,cAAc,YAAY,oBAAoB;AACvD,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AAEvC,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAE/B,SAAS,2BAA2B;AACpC,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAOvB,SAAS,UAAU,EAAE,iBAAiB,GAAkC;A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AgB,cAAc,IAAI,aAAa;AAErD,kBAAc,UAAU;AAAA,MACpB,KAAK,EAAE,KAAK;AAAA,MACZ,OAAO,EAAE,OAAO;AAAA,MAChB,QAAQ,EAAE,QAAQ;AAAA,MAClB,MAAM,EAAE,MAAM;AAAA,MACd,OAAO,EAAE,OAAO;AAAA,MAChB,MAAM,EAAE,MAAM;AAAA,IAClB,CAAC;AAED,QAAI,CAAC,cAAe;AAEpB,QAAI,kBAAkB,OAAO;AACzB,oBAAc,UAAU;AACxB,oBAAc,IAAI;AAAA,IACtB,OAAO;AACH,oBAAc,UAAU;AACxB,oBAAc,OAAO;AAAA,IACzB;AAAA,EACJ,GAAG,CAAC,eAAe,eAAe,QAAQ,CAAC,CAAC;AAE5C,SACI;AAAA,IAAC;AAAA;AAAA,MACG,OAAO;AAAA,QACH,UAAU;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,UAAU;AAAA,MACd;AAAA,MAEA;AAAA,4BAAC,mBAAgB;AAAA,QACjB,oBAAC,cAAW;AAAA,QACZ,oBAAC,wBAAqB;AAAA,QACtB,oBAAC,qBAAkB,kBAAoC;AAAA,QACvD,oBAAC,uBAAoB;AAAA,QACrB,oBAAC,iBAAc;AAAA,QACf;AAAA,UAAC;AAAA;AAAA,YACG,WAAU;AAAA,YACV,IAAG;AAAA,YACH,KAAK;AAAA,YACL,OAAO;AAAA,cACH,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,UAAU;AAAA,cACV,YAAY;AAAA,YAChB;AAAA;AAAA,QACJ;AAAA,QAGA,qBAAC,SAAI,WAAU,iHACX;AAAA,8BAAC,gBAAa;AAAA,UACd,oBAAC,oBAAiB,QAAQ,YAAY,KAAK;AAAA,WAC/C;AAAA,QACA,oBAAC,kBAAe;AAAA;AAAA;AAAA,EACpB;AAER;","names":["_a","_b"]}
1
+ {"version":3,"sources":["../../../../../src/core/components/viewers/bim/BimViewer.tsx"],"sourcesContent":["\"use client\";\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport { useTranslations, useLocale } from 'next-intl';\nimport * as React from \"react\";\nimport * as THREE from \"three\";\n\nimport { useUndoRedoShortcuts } from \"../../../hooks/useUndoRedoShortcuts\";\nimport { ToolsContext, BimContext, MenusContext } from \"../../../store\";\nimport { ViewerNames } from \"../../../types/dbTypes\";\nimport { SensorLegend } from \"../../ui/Sensors/SensorLegend\";\nimport { ViewerLegendHost } from \"../shared/legends/ViewerLegendHost\";\nimport { useBimCoordinateSystem } from \"../useCoordinateSystem\";\n\nimport { BimLoadingState } from \"./src/BimLoadingState\";\nimport { BuildingLocationSync } from \"./src/BuildingLocationSync\";\nimport { CameraNavigation } from \"./src/CameraNavigation\";\nimport { ElementAppearance } from \"./src/ElementAppearance\";\nimport { ElevationsTool } from \"./src/ElevationsTool\";\nimport { FloorplanTool } from \"./src/FloorplanTool\";\nimport { Highlighter } from \"./src/Highlighter\";\nimport { IfcClasses } from \"./src/IfcClasses\";\nimport { createBimWorld } from \"./src/lib/createBimWorld\";\n\nimport { ViewModeCoordinator } from \"./src/lib/ViewModeCoordinator\";\nimport { ModelsSync } from \"./src/ModelsSync\";\nimport { PlacementEditor } from \"./src/Placement/PlacementEditor\";\nimport { PlacementEditorHost } from \"./src/Placement/PlacementEditorHost\";\nimport { BimPointClouds } from \"./src/PointClouds\";\nimport { BimPointCloudSync } from \"./src/PointClouds/BimPointCloudSync\";\nimport { PropertiesMenu } from \"./src/propertiesMenu\";\nimport { SelectionSync } from \"./src/SelectionSync\";\nimport { ClippingPlanes } from \"./src/tools/ClippingTool/ClippingPlanes\";\nimport { ViewportGizmo } from \"./src/ViewportGizmo\";\n\nimport type { PivotIndicator } from \"./src/lib/PivotIndicator\";\n\nimport type * as OBC from \"@thatopen/components\";\n\n\nexport function BimViewer({ pointcloudApiUrl }: { pointcloudApiUrl?: string }) {\n\n const t = useTranslations('ViewportGizmo');\n const locale = useLocale();\n\n const { dispatch: bimDispatch, state: bimState } = React.useContext(BimContext);\n const { bimComponents } = bimState.bim;\n\n const { dispatch: toolsDispatch, state: toolsState } = React.useContext(ToolsContext);\n const { currentToolId } = toolsState.tools;\n\n const { state: menusState } = React.useContext(MenusContext);\n const { currentViewer } = menusState.menus;\n\n // Appearance and clipping keep separate undo stacks; the most recently changed one wins.\n const lastTouchedHistory = React.useRef<'appearance' | 'clipping'>('appearance');\n\n React.useEffect(() => {\n if (!bimComponents) return;\n const appearance = bimComponents.get(ElementAppearance);\n const clipping = bimComponents.get(ClippingPlanes);\n const offAppearance = appearance.history.onChanged(() => {\n lastTouchedHistory.current = 'appearance';\n });\n const offClipping = clipping.history.onChanged(() => {\n lastTouchedHistory.current = 'clipping';\n });\n return () => {\n offAppearance();\n offClipping();\n };\n }, [bimComponents]);\n\n const undoRedoTarget = React.useCallback((direction: 'undo' | 'redo') => {\n if (!bimComponents) return null;\n const appearance = bimComponents.get(ElementAppearance);\n const clipping = bimComponents.get(ClippingPlanes);\n const canRun = (target: typeof appearance | typeof clipping) =>\n direction === 'undo' ? target.history.canUndo : target.history.canRedo;\n\n const preferred = lastTouchedHistory.current === 'clipping' ? clipping : appearance;\n if (canRun(preferred)) return preferred;\n\n const other = preferred === clipping ? appearance : clipping;\n return canRun(other) ? other : null;\n }, [bimComponents]);\n\n useUndoRedoShortcuts({\n undo: () => { void undoRedoTarget('undo')?.undo(); },\n redo: () => { void undoRedoTarget('redo')?.redo(); },\n });\n\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const workerUrlRef = React.useRef<string | null>(null);\n const resizeObserverRef = React.useRef<ResizeObserver | null>(null);\n // This mount's own instance, so cleanup and the create-guard cannot read a stale [] closure.\n const componentsRef = React.useRef<OBC.Components | null>(null);\n const pivotRef = React.useRef<PivotIndicator | null>(null);\n\n const createViewer = React.useCallback(\n async (isCancelled: () => boolean) => {\n // Keyed to the ref, not the [] closure: a second init builds a second detached canvas.\n if (!containerRef.current || componentsRef.current) return;\n\n const container = containerRef.current;\n const { components, world, fragments, grid, workerUrl, pivot } = await createBimWorld(container);\n workerUrlRef.current = workerUrl;\n pivotRef.current = pivot;\n\n if (grid) {\n bimDispatch({\n \"type\": \"SET_GRID\",\n \"payload\": { grid }\n });\n }\n\n components.get(Highlighter);\n // Up front so it subscribes to model loads before any model arrives.\n components.get(IfcClasses);\n components.get(ViewModeCoordinator);\n // Same reason, plus drawing modes releasing the viewer both need its overrides repainted.\n components.get(ElementAppearance);\n components.get(FloorplanTool);\n components.get(ElevationsTool);\n components.get(BimPointClouds);\n components.get(PlacementEditor);\n components.get(CameraNavigation);\n\n // Grid injection is safe here — fragments.core is initialized.\n if (grid) {\n components.get(FloorplanTool).setGrid(grid);\n components.get(ElevationsTool).setGrid(grid);\n }\n\n // Superseded or unmounted while awaiting: drop it rather than let it win the store.\n if (isCancelled()) {\n components.dispose();\n return;\n }\n componentsRef.current = components;\n bimDispatch({\n type: \"SET_COMPONENTS\",\n payload: { bimComponents: components, world, fragments }\n });\n\n // Ensure canvas takes full container size\n const canvas = container.querySelector('canvas');\n if (canvas) {\n canvas.style.width = '100%';\n canvas.style.height = '100%';\n canvas.style.display = 'block';\n }\n\n // Handle resize using container dimensions\n const handleResize = () => {\n const width = container.clientWidth;\n const height = container.clientHeight;\n if (width && height) {\n world.renderer?.resize(new THREE.Vector2(width, height));\n }\n };\n\n // Initial resize\n handleResize();\n\n // Covers window resize too: the flex layout reshapes this container, which fires it.\n const resizeObserver = new ResizeObserver(() => {\n handleResize();\n });\n resizeObserver.observe(container);\n resizeObserverRef.current = resizeObserver;\n\n }, []\n );\n\n React.useEffect(() => {\n let cancelled = false;\n void createViewer(() => cancelled);\n\n // Cancels an in-flight createViewer and disposes the instance this mount created.\n return () => {\n cancelled = true;\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n }\n pivotRef.current?.dispose();\n pivotRef.current = null;\n // OBC's disposal loop is unguarded, so one throw skips every component after it.\n try {\n componentsRef.current?.dispose();\n } catch (error) {\n console.error(\"BIM teardown did not complete cleanly\", error);\n } finally {\n componentsRef.current = null;\n bimDispatch({\n type: \"DISPOSE-BIM\"\n });\n }\n };\n }, []);\n\n // Enforces Y-up for three / camera-controls whenever the world's controls appear.\n useBimCoordinateSystem(bimState.bim.world?.camera?.controls ?? null);\n\n // Control ViewportGizmo based on current viewer\n React.useEffect(() => {\n if (!bimComponents) return;\n\n const viewportGizmo = bimComponents.get(ViewportGizmo);\n\n viewportGizmo.setLabels({\n top: t('top'),\n right: t('right'),\n bottom: t('bottom'),\n left: t('left'),\n front: t('front'),\n back: t('back')\n });\n\n if (!viewportGizmo) return;\n\n if (currentViewer === 'bim') {\n viewportGizmo.enabled = true;\n viewportGizmo.add();\n } else {\n viewportGizmo.enabled = false;\n viewportGizmo.remove();\n }\n }, [bimComponents, currentViewer, locale, t]);\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n overflow: \"hidden\"\n }}\n >\n <BimLoadingState />\n <ModelsSync />\n <BuildingLocationSync />\n <BimPointCloudSync pointcloudApiUrl={pointcloudApiUrl} />\n <PlacementEditorHost />\n <SelectionSync />\n <div\n className=\"bim-container\"\n id=\"bim-viewer-container\"\n ref={containerRef}\n style={{\n width: \"100%\",\n height: \"100%\",\n position: \"relative\",\n background: \"radial-gradient(circle, rgba(255, 255, 255, 1) 50%, rgba(220, 220, 220, 1) 100%)\",\n }}\n />\n {/* Bottom-left stack, mirroring MapViewer: cards stack upward with flex so a new\n overlay never needs a hand-tuned bottom offset. */}\n <div className=\"absolute bottom-20 md:bottom-3 left-3 z-10 flex max-w-[calc(100vw-1.5rem)] flex-col gap-2 pointer-events-none\">\n <SensorLegend />\n <ViewerLegendHost viewer={ViewerNames.bim} />\n </div>\n <PropertiesMenu />\n </div>\n );\n}"],"mappings":";AAkPY,cAmBA,YAnBA;AA7OZ,SAAS,iBAAiB,iBAAiB;AAC3C,YAAY,WAAW;AACvB,YAAY,WAAW;AAEvB,SAAS,4BAA4B;AACrC,SAAS,cAAc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wBAAqB;AAAA,QACtB,oBAAC,qBAAkB,kBAAoC;AAAA,QACvD,oBAAC,uBAAoB;AAAA,QACrB,oBAAC,iBAAc;AAAA,QACf;AAAA,UAAC;AAAA;AAAA,YACG,WAAU;AAAA,YACV,IAAG;AAAA,YACH,KAAK;AAAA,YACL,OAAO;AAAA,cACH,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,UAAU;AAAA,cACV,YAAY;AAAA,YAChB;AAAA;AAAA,QACJ;AAAA,QAGA,qBAAC,SAAI,WAAU,iHACX;AAAA,8BAAC,gBAAa;AAAA,UACd,oBAAC,oBAAiB,QAAQ,YAAY,KAAK;AAAA,WAC/C;AAAA,QACA,oBAAC,kBAAe;AAAA;AAAA;AAAA,EACpB;AAER;","names":["_a","_b"]}
@@ -55,7 +55,7 @@ function BimLoadingState() {
55
55
  void (fragments == null ? void 0 : fragments.core.disposeModel(modelId).catch(() => void 0));
56
56
  }
57
57
  try {
58
- (_c = bimComponents == null ? void 0 : bimComponents.get(BimSceneObjects).registry) == null ? void 0 : _c.clear();
58
+ (_c = bimComponents == null ? void 0 : bimComponents.get(BimSceneObjects).registry) == null ? void 0 : _c.resetForBuilding(id);
59
59
  } catch (e) {
60
60
  }
61
61
  bimDispatch({ type: "SET_POINT_CLOUD_IDS", payload: { pointCloudIds: [] } });