@collabdt/core 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/components/AppSidebarContent.d.ts.map +1 -1
- package/dist/core/components/AppSidebarContent.js +0 -6
- package/dist/core/components/AppSidebarContent.js.map +1 -1
- package/dist/core/components/ConfirmDialog.d.ts.map +1 -1
- package/dist/core/components/ConfirmDialog.js +1 -1
- package/dist/core/components/ConfirmDialog.js.map +1 -1
- package/dist/core/components/Toolbar.d.ts.map +1 -1
- package/dist/core/components/Toolbar.js +0 -7
- package/dist/core/components/Toolbar.js.map +1 -1
- package/dist/core/components/ToolbarBody.d.ts.map +1 -1
- package/dist/core/components/ToolbarBody.js.map +1 -1
- package/dist/core/components/TopNavigationBar.d.ts.map +1 -1
- package/dist/core/components/TopNavigationBar.js +2 -7
- package/dist/core/components/TopNavigationBar.js.map +1 -1
- package/dist/core/components/organizationConfig/src/CountrySubdivisionFields.js +3 -3
- package/dist/core/components/organizationConfig/src/CountrySubdivisionFields.js.map +1 -1
- package/dist/core/components/ui/AppSidebar.d.ts.map +1 -1
- package/dist/core/components/ui/AppSidebar.js.map +1 -1
- package/dist/core/components/ui/CollapsibleSection.d.ts +7 -1
- package/dist/core/components/ui/CollapsibleSection.d.ts.map +1 -1
- package/dist/core/components/ui/CollapsibleSection.js +57 -8
- package/dist/core/components/ui/CollapsibleSection.js.map +1 -1
- package/dist/core/components/ui/Comments/Comment.d.ts +3 -1
- package/dist/core/components/ui/Comments/Comment.d.ts.map +1 -1
- package/dist/core/components/ui/Comments/Comment.js +3 -1
- package/dist/core/components/ui/Comments/Comment.js.map +1 -1
- package/dist/core/components/ui/FilesManager/index.d.ts +5 -0
- package/dist/core/components/ui/FilesManager/index.d.ts.map +1 -1
- package/dist/core/components/ui/FilesManager/index.js +17 -1
- package/dist/core/components/ui/FilesManager/index.js.map +1 -1
- package/dist/core/components/ui/FilesManager/src/FileItemComponent.d.ts.map +1 -1
- package/dist/core/components/ui/FilesManager/src/FileItemComponent.js +1 -1
- package/dist/core/components/ui/FilesManager/src/FileItemComponent.js.map +1 -1
- package/dist/core/components/ui/FilesManager/src/UploadProgressBar.d.ts +14 -0
- package/dist/core/components/ui/FilesManager/src/UploadProgressBar.d.ts.map +1 -0
- package/dist/core/components/ui/FilesManager/src/UploadProgressBar.js +39 -0
- package/dist/core/components/ui/FilesManager/src/UploadProgressBar.js.map +1 -0
- package/dist/core/components/ui/FilesManager/src/fileType.d.ts +9 -0
- package/dist/core/components/ui/FilesManager/src/fileType.d.ts.map +1 -0
- package/dist/core/components/ui/FilesManager/src/fileType.js +70 -0
- package/dist/core/components/ui/FilesManager/src/fileType.js.map +1 -0
- package/dist/core/components/ui/FilesManager/src/uploadProgress.d.ts +22 -0
- package/dist/core/components/ui/FilesManager/src/uploadProgress.d.ts.map +1 -0
- package/dist/core/components/ui/FilesManager/src/uploadProgress.js +89 -0
- package/dist/core/components/ui/FilesManager/src/uploadProgress.js.map +1 -0
- package/dist/core/components/ui/Progress.d.ts +3 -1
- package/dist/core/components/ui/Progress.d.ts.map +1 -1
- package/dist/core/components/ui/Progress.js +10 -3
- package/dist/core/components/ui/Progress.js.map +1 -1
- package/dist/core/components/ui/Sensors/Sensor.d.ts +3 -1
- package/dist/core/components/ui/Sensors/Sensor.d.ts.map +1 -1
- package/dist/core/components/ui/Sensors/Sensor.js +3 -1
- package/dist/core/components/ui/Sensors/Sensor.js.map +1 -1
- package/dist/core/components/ui/ShareFeature/ShareToolSubmenu.d.ts.map +1 -1
- package/dist/core/components/ui/ShareFeature/ShareToolSubmenu.js +2 -7
- package/dist/core/components/ui/ShareFeature/ShareToolSubmenu.js.map +1 -1
- package/dist/core/components/ui/Sidebar.d.ts +0 -1
- package/dist/core/components/ui/Sidebar.d.ts.map +1 -1
- package/dist/core/components/ui/Sidebar.js +2 -4
- package/dist/core/components/ui/Sidebar.js.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/index.d.ts +1 -2
- package/dist/core/components/ui/ViewerSidebar/index.d.ts.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/index.js +2 -7
- package/dist/core/components/ui/ViewerSidebar/index.js.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/useLongPressReorder.d.ts +30 -0
- package/dist/core/components/ui/ViewerSidebar/useLongPressReorder.d.ts.map +1 -0
- package/dist/core/components/ui/ViewerSidebar/useLongPressReorder.js +138 -0
- package/dist/core/components/ui/ViewerSidebar/useLongPressReorder.js.map +1 -0
- package/dist/core/components/ui/ViewerSidebar/useResizableSections.d.ts +22 -0
- package/dist/core/components/ui/ViewerSidebar/useResizableSections.d.ts.map +1 -0
- package/dist/core/components/ui/ViewerSidebar/useResizableSections.js +99 -0
- package/dist/core/components/ui/ViewerSidebar/useResizableSections.js.map +1 -0
- package/dist/core/components/ui/uploadFile.d.ts +5 -1
- package/dist/core/components/ui/uploadFile.d.ts.map +1 -1
- package/dist/core/components/ui/uploadFile.js +19 -7
- package/dist/core/components/ui/uploadFile.js.map +1 -1
- package/dist/core/components/viewers/Viewer.d.ts.map +1 -1
- package/dist/core/components/viewers/Viewer.js +4 -7
- package/dist/core/components/viewers/Viewer.js.map +1 -1
- package/dist/core/components/viewers/bim/BimViewer.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/BimViewer.js +2 -0
- package/dist/core/components/viewers/bim/BimViewer.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimLoadingState/index.js +1 -1
- package/dist/core/components/viewers/bim/src/BimLoadingState/index.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/index.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/index.js +97 -21
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/index.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/BimSection.d.ts +10 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/BimSection.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/BimSection.js +325 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/BimSection.js.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.d.ts +3 -2
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.js +81 -315
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.d.ts +4 -3
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.js +86 -241
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.d.ts +3 -2
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.js +116 -15
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/orderFileTabSections.d.ts +4 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/orderFileTabSections.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/orderFileTabSections.js +10 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/orderFileTabSections.js.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/partitionFileTab.d.ts +4 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/partitionFileTab.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/partitionFileTab.js +18 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/partitionFileTab.js.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/resolveOpenSections.d.ts +4 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/resolveOpenSections.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/resolveOpenSections.js +12 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/resolveOpenSections.js.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/sectionChrome.d.ts +11 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/sectionChrome.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/sectionChrome.js +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/sectionChrome.js.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/usePlaceableFileRows.d.ts +30 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/usePlaceableFileRows.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/usePlaceableFileRows.js +332 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/usePlaceableFileRows.js.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/LayersTab/index.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/LayersTab/index.js +12 -48
- package/dist/core/components/viewers/bim/src/BimSidebar/src/LayersTab/index.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/index.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/index.js +2 -4
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/index.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.d.ts +4 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.js +24 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.js.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.d.ts +3 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.js +59 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.js.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/PointCloudSettings.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/PointCloudSettings.js +12 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/PointCloudSettings.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/WalkSettings.d.ts +4 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/WalkSettings.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/WalkSettings.js +83 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/WalkSettings.js.map +1 -0
- package/dist/core/components/viewers/bim/src/CameraNavigation.d.ts +56 -0
- package/dist/core/components/viewers/bim/src/CameraNavigation.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/CameraNavigation.js +230 -0
- package/dist/core/components/viewers/bim/src/CameraNavigation.js.map +1 -0
- package/dist/core/components/viewers/bim/src/Placement/placementCapabilities.d.ts +5 -3
- package/dist/core/components/viewers/bim/src/Placement/placementCapabilities.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/Placement/placementCapabilities.js +6 -9
- package/dist/core/components/viewers/bim/src/Placement/placementCapabilities.js.map +1 -1
- package/dist/core/components/viewers/bim/src/PointClouds/BimPointCloudSync.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/PointClouds/BimPointCloudSync.js +3 -1
- package/dist/core/components/viewers/bim/src/PointClouds/BimPointCloudSync.js.map +1 -1
- package/dist/core/components/viewers/bim/src/PointClouds/index.d.ts +6 -0
- package/dist/core/components/viewers/bim/src/PointClouds/index.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/PointClouds/index.js +17 -0
- package/dist/core/components/viewers/bim/src/PointClouds/index.js.map +1 -1
- package/dist/core/components/viewers/bim/src/PointClouds/pointCloudFiles.d.ts +14 -1
- package/dist/core/components/viewers/bim/src/PointClouds/pointCloudFiles.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/PointClouds/pointCloudFiles.js +33 -8
- package/dist/core/components/viewers/bim/src/PointClouds/pointCloudFiles.js.map +1 -1
- package/dist/core/components/viewers/bim/src/PointClouds/usePointCloudIntake.d.ts +12 -0
- package/dist/core/components/viewers/bim/src/PointClouds/usePointCloudIntake.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/PointClouds/usePointCloudIntake.js +120 -0
- package/dist/core/components/viewers/bim/src/PointClouds/usePointCloudIntake.js.map +1 -0
- package/dist/core/components/viewers/bim/src/SceneObjects/sceneObjectRegistry.d.ts +6 -0
- package/dist/core/components/viewers/bim/src/SceneObjects/sceneObjectRegistry.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/SceneObjects/sceneObjectRegistry.js +12 -0
- package/dist/core/components/viewers/bim/src/SceneObjects/sceneObjectRegistry.js.map +1 -1
- package/dist/core/components/viewers/bim/src/ViewportGizmo.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/ViewportGizmo.js +25 -3
- package/dist/core/components/viewers/bim/src/ViewportGizmo.js.map +1 -1
- package/dist/core/components/viewers/bim/src/lib/disposeObject3D.d.ts +1 -1
- package/dist/core/components/viewers/bim/src/lib/disposeObject3D.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/lib/disposeObject3D.js.map +1 -1
- package/dist/core/components/viewers/bim/src/lib/useBimFileIntake.d.ts +18 -0
- package/dist/core/components/viewers/bim/src/lib/useBimFileIntake.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/lib/useBimFileIntake.js +78 -0
- package/dist/core/components/viewers/bim/src/lib/useBimFileIntake.js.map +1 -0
- package/dist/core/components/viewers/bim/src/tools/AddToBim/index.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/tools/AddToBim/index.js +12 -3
- package/dist/core/components/viewers/bim/src/tools/AddToBim/index.js.map +1 -1
- package/dist/core/components/viewers/bim/src/tools/AddToBim/src/FileHandler.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/tools/AddToBim/src/FileHandler.js +2 -1
- package/dist/core/components/viewers/bim/src/tools/AddToBim/src/FileHandler.js.map +1 -1
- package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.d.ts +5 -5
- package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.js +27 -103
- package/dist/core/components/viewers/bim/src/tools/AddToBim/src/useFilePlacement.js.map +1 -1
- package/dist/core/components/viewers/bim/src/useCameraNavigation.d.ts +8 -0
- package/dist/core/components/viewers/bim/src/useCameraNavigation.d.ts.map +1 -0
- package/dist/core/components/viewers/bim/src/useCameraNavigation.js +33 -0
- package/dist/core/components/viewers/bim/src/useCameraNavigation.js.map +1 -0
- package/dist/core/components/viewers/map/MapViewer.d.ts.map +1 -1
- package/dist/core/components/viewers/map/MapViewer.js +33 -5
- package/dist/core/components/viewers/map/MapViewer.js.map +1 -1
- package/dist/core/components/viewers/map/datasets/src/useOrganizationalDatasets.js +1 -1
- package/dist/core/components/viewers/map/datasets/src/useOrganizationalDatasets.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/index.d.ts +2 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/index.js +4 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/index.d.ts +2 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/index.js +3 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/src/BuildingsTools.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/src/BuildingsTools.js +1 -14
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/DatabaseBuildingPopover/src/BuildingsTools.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/NonDatabaseBuildingPopover.d.ts +2 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/NonDatabaseBuildingPopover.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/NonDatabaseBuildingPopover.js +116 -112
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/NonDatabaseBuildingPopover.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/OpenDataFeaturePopover.d.ts +2 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/OpenDataFeaturePopover.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/OpenDataFeaturePopover.js +52 -48
- package/dist/core/components/viewers/map/src/MapFeaturePopoverMenu/src/OpenDataFeaturePopover.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/index.js +3 -1
- package/dist/core/components/viewers/map/src/MapLayers/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/BimLayer/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/BimLayer/index.js +2 -2
- package/dist/core/components/viewers/map/src/MapLayers/src/BimLayer/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/BuildingLayers/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/BuildingLayers/index.js +92 -76
- package/dist/core/components/viewers/map/src/MapLayers/src/BuildingLayers/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/CommentLayer/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/CommentLayer/index.js +104 -109
- package/dist/core/components/viewers/map/src/MapLayers/src/CommentLayer/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/CountryLayer/index.d.ts +1 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/CountryLayer/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/CountryLayer/index.js +13 -19
- package/dist/core/components/viewers/map/src/MapLayers/src/CountryLayer/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/FileLayer/utils/CustomModelLayer.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/FileLayer/utils/CustomModelLayer.js +2 -2
- package/dist/core/components/viewers/map/src/MapLayers/src/FileLayer/utils/CustomModelLayer.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/MapPopupStack.d.ts +3 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/MapPopupStack.d.ts.map +1 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/MapPopupStack.js +88 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/MapPopupStack.js.map +1 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/index.js +79 -99
- package/dist/core/components/viewers/map/src/MapLayers/src/OpenDataLayer/src/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/PlaceOnMap.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/SensorsLayer/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/SensorsLayer/index.js +125 -121
- package/dist/core/components/viewers/map/src/MapLayers/src/SensorsLayer/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/SiteLayer.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/SiteLayer.js +67 -35
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/SiteLayer.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/{SiteContextMenu.d.ts → SiteMenu.d.ts} +4 -5
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/SiteMenu.d.ts.map +1 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/{SiteContextMenu.js → SiteMenu.js} +8 -9
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/SiteMenu.js.map +1 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/clusterPopupEntry.d.ts +23 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/clusterPopupEntry.d.ts.map +1 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/clusterPopupEntry.js +88 -0
- package/dist/core/components/viewers/map/src/MapLayers/src/clusterPopupEntry.js.map +1 -0
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/BuildingVisibility.d.ts +3 -0
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/BuildingVisibility.d.ts.map +1 -0
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/BuildingVisibility.js +28 -0
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/BuildingVisibility.js.map +1 -0
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/MapCustomization.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/MapCustomization.js +3 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/MapCustomization.js.map +1 -1
- package/dist/core/components/viewers/map/src/SimpleMap.js +1 -1
- package/dist/core/components/viewers/map/src/SimpleMap.js.map +1 -1
- package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/FileAdder.js +1 -1
- package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/FileAdder.js.map +1 -1
- package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS.d.ts +1 -1
- package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS.js +1 -1
- package/dist/core/components/viewers/map/src/tools/AddTools/AddFile/utils/uploadToPresignedURLS.js.map +1 -1
- package/dist/core/components/viewers/map/src/tools/AddTools/AddSite/SiteAdder.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/tools/AddTools/AddSite/SiteAdder.js.map +1 -1
- package/dist/core/components/viewers/map/src/tools/mapTools.d.ts +1 -1
- package/dist/core/components/viewers/map/src/tools/mapTools.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/tools/mapTools.js.map +1 -1
- package/dist/core/components/viewers/map/src/tools/measureMapTool.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/tools/measureMapTool.js +1 -1
- package/dist/core/components/viewers/map/src/tools/measureMapTool.js.map +1 -1
- package/dist/core/components/viewers/map/utils/MapEventManager/MapClickManager.d.ts +12 -5
- package/dist/core/components/viewers/map/utils/MapEventManager/MapClickManager.d.ts.map +1 -1
- package/dist/core/components/viewers/map/utils/MapEventManager/MapClickManager.js +46 -12
- package/dist/core/components/viewers/map/utils/MapEventManager/MapClickManager.js.map +1 -1
- package/dist/core/components/viewers/map/utils/MapEventManager/MapHoverManager.d.ts +1 -1
- package/dist/core/components/viewers/map/utils/MapEventManager/MapHoverManager.d.ts.map +1 -1
- package/dist/core/components/viewers/map/utils/MapEventManager/MapHoverManager.js +1 -1
- package/dist/core/components/viewers/map/utils/MapEventManager/MapHoverManager.js.map +1 -1
- package/dist/core/components/viewers/map/utils/getOsmIdFromMartin.d.ts +1 -1
- package/dist/core/components/viewers/map/utils/getOsmIdFromMartin.d.ts.map +1 -1
- package/dist/core/components/viewers/map/utils/getOsmIdFromMartin.js.map +1 -1
- package/dist/core/components/viewers/map/utils/mapStyleSpec.d.ts +4 -0
- package/dist/core/components/viewers/map/utils/mapStyleSpec.d.ts.map +1 -1
- package/dist/core/components/viewers/map/utils/mapStyleSpec.js +3 -1
- package/dist/core/components/viewers/map/utils/mapStyleSpec.js.map +1 -1
- package/dist/core/components/viewers/map/utils/modelMatrix.d.ts +8 -0
- package/dist/core/components/viewers/map/utils/modelMatrix.d.ts.map +1 -0
- package/dist/core/components/viewers/map/utils/modelMatrix.js +13 -0
- package/dist/core/components/viewers/map/utils/modelMatrix.js.map +1 -0
- package/dist/core/components/viewers/map/utils/validateBounds.d.ts +5 -10
- package/dist/core/components/viewers/map/utils/validateBounds.d.ts.map +1 -1
- package/dist/core/components/viewers/map/utils/validateBounds.js +5 -6
- package/dist/core/components/viewers/map/utils/validateBounds.js.map +1 -1
- package/dist/core/components/viewers/plugins/src/PluginCard.d.ts.map +1 -1
- package/dist/core/components/viewers/plugins/src/PluginCard.js +0 -1
- package/dist/core/components/viewers/plugins/src/PluginCard.js.map +1 -1
- package/dist/core/components/viewers/shared/pointcloud/pointCloudAppearance.d.ts +1 -0
- package/dist/core/components/viewers/shared/pointcloud/pointCloudAppearance.d.ts.map +1 -1
- package/dist/core/components/viewers/shared/pointcloud/pointCloudAppearance.js +4 -2
- package/dist/core/components/viewers/shared/pointcloud/pointCloudAppearance.js.map +1 -1
- package/dist/core/components/viewers/shared/pointcloud/pointCloudConversion.d.ts +34 -0
- package/dist/core/components/viewers/shared/pointcloud/pointCloudConversion.d.ts.map +1 -0
- package/dist/core/components/viewers/shared/pointcloud/pointCloudConversion.js +78 -0
- package/dist/core/components/viewers/shared/pointcloud/pointCloudConversion.js.map +1 -0
- package/dist/core/components/viewers/shared/pointcloud/pointCloudRegistry.d.ts +2 -0
- package/dist/core/components/viewers/shared/pointcloud/pointCloudRegistry.d.ts.map +1 -1
- package/dist/core/components/viewers/shared/pointcloud/pointCloudRegistry.js.map +1 -1
- package/dist/core/components/viewers/useCoordinateSystem.js.map +1 -1
- package/dist/core/hooks/ports/apiAdapter.d.ts +1 -1
- package/dist/core/hooks/ports/apiAdapter.d.ts.map +1 -1
- package/dist/core/hooks/provider.d.ts +1 -1
- package/dist/core/hooks/provider.js +1 -1
- package/dist/core/hooks/provider.js.map +1 -1
- package/dist/core/hooks/useCaptureScreenshot.d.ts.map +1 -1
- package/dist/core/hooks/useCaptureScreenshot.js +1 -2
- package/dist/core/hooks/useCaptureScreenshot.js.map +1 -1
- package/dist/core/hooks/useCurrentViewerPosition.d.ts +1 -1
- package/dist/core/hooks/useCurrentViewerPosition.d.ts.map +1 -1
- package/dist/core/hooks/useCurrentViewerPosition.js +2 -18
- package/dist/core/hooks/useCurrentViewerPosition.js.map +1 -1
- package/dist/core/hooks/useShareUrl.d.ts.map +1 -1
- package/dist/core/hooks/useShareUrl.js +2 -20
- package/dist/core/hooks/useShareUrl.js.map +1 -1
- package/dist/core/i18n/messages/en.json +40 -91
- package/dist/core/i18n/messages/es.json +40 -91
- package/dist/core/i18n/messages/fr.json +40 -91
- package/dist/core/plugins/host/context.d.ts.map +1 -1
- package/dist/core/plugins/host/context.js +1 -2
- package/dist/core/plugins/host/context.js.map +1 -1
- package/dist/core/plugins/host/usePluginToolbarTools.d.ts +2 -2
- package/dist/core/plugins/host/usePluginToolbarTools.d.ts.map +1 -1
- package/dist/core/plugins/host/usePluginToolbarTools.js +58 -3
- package/dist/core/plugins/host/usePluginToolbarTools.js.map +1 -1
- package/dist/core/plugins/sdk/types.d.ts +2 -4
- package/dist/core/plugins/sdk/types.d.ts.map +1 -1
- package/dist/core/plugins/sdk/types.js +0 -1
- package/dist/core/plugins/sdk/types.js.map +1 -1
- package/dist/core/plugins/sdk/viewer.d.ts +1 -2
- package/dist/core/plugins/sdk/viewer.d.ts.map +1 -1
- package/dist/core/plugins/sdk/viewer.js +0 -1
- package/dist/core/plugins/sdk/viewer.js.map +1 -1
- package/dist/core/store/CombineProviders.d.ts.map +1 -1
- package/dist/core/store/CombineProviders.js +0 -2
- package/dist/core/store/CombineProviders.js.map +1 -1
- package/dist/core/store/Map/context.d.ts.map +1 -1
- package/dist/core/store/Map/context.js +3 -1
- package/dist/core/store/Map/context.js.map +1 -1
- package/dist/core/store/Map/reducer.d.ts +10 -1
- package/dist/core/store/Map/reducer.d.ts.map +1 -1
- package/dist/core/store/Map/reducer.js +20 -0
- package/dist/core/store/Map/reducer.js.map +1 -1
- package/dist/core/store/Menus/context.d.ts.map +1 -1
- package/dist/core/store/Menus/context.js +4 -3
- package/dist/core/store/Menus/context.js.map +1 -1
- package/dist/core/store/Menus/reducer.d.ts +5 -0
- package/dist/core/store/Menus/reducer.d.ts.map +1 -1
- package/dist/core/store/Menus/reducer.js +12 -0
- package/dist/core/store/Menus/reducer.js.map +1 -1
- package/dist/core/store/index.d.ts +0 -1
- package/dist/core/store/index.d.ts.map +1 -1
- package/dist/core/store/index.js +0 -1
- package/dist/core/store/index.js.map +1 -1
- package/dist/core/types/dbTypes.d.ts +0 -1
- package/dist/core/types/dbTypes.d.ts.map +1 -1
- package/dist/core/types/dbTypes.js +0 -1
- package/dist/core/types/dbTypes.js.map +1 -1
- package/dist/core/types/map.d.ts +17 -1
- package/dist/core/types/map.d.ts.map +1 -1
- package/dist/core/types/tools.d.ts +1 -2
- package/dist/core/types/tools.d.ts.map +1 -1
- package/dist/core/utils/appContent.d.ts.map +1 -1
- package/dist/core/utils/appContent.js +0 -1
- package/dist/core/utils/appContent.js.map +1 -1
- package/dist/core/utils/getFileIcon.d.ts.map +1 -1
- package/dist/core/utils/getFileIcon.js +11 -13
- package/dist/core/utils/getFileIcon.js.map +1 -1
- package/package.json +5 -7
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/SiteContextMenu.d.ts.map +0 -1
- package/dist/core/components/viewers/map/src/MapLayers/src/SiteLayer/SiteContextMenu.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/PointCloudToolbar.d.ts +0 -3
- package/dist/core/components/viewers/pointcloud/PointCloudToolbar.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/PointCloudToolbar.js +0 -13
- package/dist/core/components/viewers/pointcloud/PointCloudToolbar.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/PointCloudViewer.d.ts +0 -5
- package/dist/core/components/viewers/pointcloud/PointCloudViewer.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/PointCloudViewer.js +0 -228
- package/dist/core/components/viewers/pointcloud/PointCloudViewer.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/define.d.ts +0 -64
- package/dist/core/components/viewers/pointcloud/define.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/define.js +0 -75
- package/dist/core/components/viewers/pointcloud/define.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudLoadingState/index.d.ts +0 -6
- package/dist/core/components/viewers/pointcloud/src/PointCloudLoadingState/index.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudLoadingState/index.js +0 -316
- package/dist/core/components/viewers/pointcloud/src/PointCloudLoadingState/index.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.d.ts +0 -7
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.js +0 -22
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/index.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/index.d.ts +0 -5
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/index.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/index.js +0 -38
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/index.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/FilesSection.d.ts +0 -8
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/FilesSection.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/FilesSection.js +0 -130
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/FilesSection.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/PointCloudSection.d.ts +0 -10
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/PointCloudSection.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/PointCloudSection.js +0 -419
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/FileTab/src/PointCloudSection.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/index.d.ts +0 -3
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/index.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/index.js +0 -19
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/index.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/CameraSettings.d.ts +0 -3
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/CameraSettings.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/CameraSettings.js +0 -199
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/CameraSettings.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/GridManagement.d.ts +0 -3
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/GridManagement.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/GridManagement.js +0 -101
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/GridManagement.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/PerformanceSettings.d.ts +0 -7
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/PerformanceSettings.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/PerformanceSettings.js +0 -262
- package/dist/core/components/viewers/pointcloud/src/PointCloudSidebar/src/SettingsTab/src/PerformanceSettings.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/ViewportGizmo.d.ts +0 -27
- package/dist/core/components/viewers/pointcloud/src/ViewportGizmo.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/ViewportGizmo.js +0 -165
- package/dist/core/components/viewers/pointcloud/src/ViewportGizmo.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/ClippingTools/ClippingTool.d.ts +0 -8
- package/dist/core/components/viewers/pointcloud/src/tools/ClippingTools/ClippingTool.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/ClippingTools/ClippingTool.js +0 -64
- package/dist/core/components/viewers/pointcloud/src/tools/ClippingTools/ClippingTool.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/FitToScreen.d.ts +0 -6
- package/dist/core/components/viewers/pointcloud/src/tools/FitToScreen.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/FitToScreen.js +0 -37
- package/dist/core/components/viewers/pointcloud/src/tools/FitToScreen.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AngleMeasurement.d.ts +0 -7
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AngleMeasurement.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AngleMeasurement.js +0 -41
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AngleMeasurement.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AreaMeasurement.d.ts +0 -7
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AreaMeasurement.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AreaMeasurement.js +0 -37
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/AreaMeasurement.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/LineMeasurement.d.ts +0 -7
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/LineMeasurement.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/LineMeasurement.js +0 -44
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/LineMeasurement.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/MeasurePointCloudTool.d.ts +0 -8
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/MeasurePointCloudTool.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/MeasurePointCloudTool.js +0 -93
- package/dist/core/components/viewers/pointcloud/src/tools/MeasureTools/MeasurePointCloudTool.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PCSearchTool.d.ts +0 -7
- package/dist/core/components/viewers/pointcloud/src/tools/PCSearchTool.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PCSearchTool.js +0 -67
- package/dist/core/components/viewers/pointcloud/src/tools/PCSearchTool.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/NodeSizeSelectionTool.d.ts +0 -23
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/NodeSizeSelectionTool.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/NodeSizeSelectionTool.js +0 -158
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/NodeSizeSelectionTool.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PerformanceSettingTools.d.ts +0 -8
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PerformanceSettingTools.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PerformanceSettingTools.js +0 -47
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PerformanceSettingTools.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PointBudgetTool.d.ts +0 -8
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PointBudgetTool.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PointBudgetTool.js +0 -45
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/PointBudgetTool.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/ShowOctreeBoxTool.d.ts +0 -12
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/ShowOctreeBoxTool.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/ShowOctreeBoxTool.js +0 -48
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/ShowOctreeBoxTool.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/SplatQualitySelection.d.ts +0 -12
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/SplatQualitySelection.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/SplatQualitySelection.js +0 -62
- package/dist/core/components/viewers/pointcloud/src/tools/PerformanceSettingsTools/SplatQualitySelection.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/SetCameraOption.d.ts +0 -6
- package/dist/core/components/viewers/pointcloud/src/tools/SetCameraOption.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/SetCameraOption.js +0 -145
- package/dist/core/components/viewers/pointcloud/src/tools/SetCameraOption.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/index.d.ts +0 -8
- package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/index.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/index.js +0 -49
- package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/index.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/src/getCameraPosition.d.ts +0 -20
- package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/src/getCameraPosition.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/src/getCameraPosition.js +0 -30
- package/dist/core/components/viewers/pointcloud/src/tools/SharePointCloudTool/src/getCameraPosition.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/index.d.ts +0 -5
- package/dist/core/components/viewers/pointcloud/src/tools/index.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/index.js +0 -12
- package/dist/core/components/viewers/pointcloud/src/tools/index.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.d.ts +0 -13
- package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.js +0 -30
- package/dist/core/components/viewers/pointcloud/src/tools/pointcloudToolbarTools.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/utils/potreeLoader.d.ts +0 -4
- package/dist/core/components/viewers/pointcloud/utils/potreeLoader.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/utils/potreeLoader.js +0 -43
- package/dist/core/components/viewers/pointcloud/utils/potreeLoader.js.map +0 -1
- package/dist/core/components/viewers/pointcloud/utils/restoreCameraFromUrl.d.ts +0 -10
- package/dist/core/components/viewers/pointcloud/utils/restoreCameraFromUrl.d.ts.map +0 -1
- package/dist/core/components/viewers/pointcloud/utils/restoreCameraFromUrl.js +0 -26
- package/dist/core/components/viewers/pointcloud/utils/restoreCameraFromUrl.js.map +0 -1
- package/dist/core/plugins/sdk/pointCloudViewer.d.ts +0 -14
- package/dist/core/plugins/sdk/pointCloudViewer.d.ts.map +0 -1
- package/dist/core/plugins/sdk/pointCloudViewer.js +0 -17
- package/dist/core/plugins/sdk/pointCloudViewer.js.map +0 -1
- package/dist/core/store/PointCloud/context.d.ts +0 -16
- package/dist/core/store/PointCloud/context.d.ts.map +0 -1
- package/dist/core/store/PointCloud/context.js +0 -31
- package/dist/core/store/PointCloud/context.js.map +0 -1
- package/dist/core/store/PointCloud/reducer.d.ts +0 -59
- package/dist/core/store/PointCloud/reducer.d.ts.map +0 -1
- package/dist/core/store/PointCloud/reducer.js +0 -78
- package/dist/core/store/PointCloud/reducer.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../src/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.tsx"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport * as LR from 'lucide-react'\nimport { useTranslations } from 'next-intl'\nimport * as React from 'react'\nimport { toast } from 'sonner'\nimport * as THREE from 'three'\n\nimport { useDeleteFile, useFile } from '../../../../../../../../hooks/files/files'\nimport { BimContext, BuildingsContext, MenusContext, ToolsContext } from '../../../../../../../../store'\nimport ConfirmDialog from '../../../../../../../ConfirmDialog'\nimport { CollapsibleSection } from '../../../../../../../ui/CollapsibleSection'\nimport { useFileDeleteHandler, FileItemComponent, useFileActions } from '../../../../../../../ui/FilesManager'\nimport { BCFTopicsManager } from '../../../../BCFTopicsManager'\nimport { CurrentWorld } from '../../../../CurrentWorld'\nimport { Cursor } from '../../../../Cursor'\nimport { DXFManager } from '../../../../DXFLoader'\nimport { Highlighter } from '../../../../Highlighter'\nimport { IDSManager } from '../../../../IDSManager'\nimport { needsMarker } from '../../../../lib/needsMarker'\nimport { isFileInScene, sceneObjectForFile } from '../../../../lib/sceneContent'\nimport { selectSceneSeedFiles } from '../../../../lib/sceneSeed'\nimport { ModelManager } from '../../../../ModelManager'\nimport { AnimationSession } from '../../../../Placement/AnimationSession'\nimport { markerActionsFor } from '../../../../Placement/markerActions'\nimport { capabilitiesForFile } from '../../../../Placement/placementCapabilities'\nimport { PlacementEditor } from '../../../../Placement/PlacementEditor'\nimport { objectTarget } from '../../../../Placement/targets/objectTarget'\nimport { usePlacementSession } from '../../../../Placement/usePlacementSession'\nimport { BimSceneObjects } from '../../../../SceneObjects'\nimport { createFileMarker, removeMarker, type AddedFile } from '../../../../tools/AddToBim/src/FileMarkerUtils'\n\nimport type { DbFile as IFile } from '../../../../../../../../types/dbTypes'\nimport type { PlacementMode } from '../../../../Placement/PlacementEditor'\nimport type { SceneObject } from '../../../../SceneObjects'\nimport type { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js'\n\n// Hoist options arrays so the array identity is stable across renders.\n// Inline `options={[...]}` defeats React.memo on FileItemComponent.\ntype FileAction = import('../../../../../../../../types/global').FileAction\nconst OPTIONS_3D: FileAction[] = ['download', 'view', 'move', 'info', 'delete']\nconst OPTIONS_NON_3D: FileAction[] = ['download', 'view', 'delete']\n\ninterface FilesSectionProps {\n files: IFile[]\n query?: string\n}\n\nconst is3DFile = (ext?: string | null): boolean => {\n if (!ext) return false\n return ['glb', 'gltf', 'fbx', 'obj', 'collada'].includes(ext.toLowerCase())\n}\n\n// Files that live in the 3D scene and can be moved/scaled (3D models + DXF drawings).\nconst isPlaceable = (ext?: string | null): boolean => is3DFile(ext) || ext?.toLowerCase() === 'dxf'\n\nconst PLACE_TOAST_ID = 'bim-file-place-toast'\n\nconst placedPosition = (file: IFile): THREE.Vector3 =>\n file.x != null && file.y != null && file.z != null\n ? new THREE.Vector3(file.x as number, file.y as number, file.z as number)\n : new THREE.Vector3()\n\nexport function FilesSection({ files, query = '' }: FilesSectionProps) {\n const t = useTranslations('FileSelection')\n\n const { state: bimState, dispatch: bimDispatch } = React.useContext(BimContext)\n const { bimComponents, fragments, world } = bimState.bim\n const { state: buildingsState } = React.useContext(BuildingsContext)\n const { building } = buildingsState.buildings\n const buildingId = building?.id || -1\n const { dispatch: menusDispatch } = React.useContext(MenusContext)\n const { dispatch: toolsDispatch } = React.useContext(ToolsContext)\n\n const { deleteFile } = useDeleteFile(buildingId)\n\n const { handleDeleteFile } = useFileDeleteHandler({\n deleteFile,\n })\n\n // Local state for file management with isVisible property\n const [localFiles, setLocalFiles] = React.useState<(IFile & { isVisible?: boolean })[]>([])\n const [activeIDSFileId, setActiveIDSFileId] = React.useState<number | null>(null)\n\n // Initialize and sync files\n React.useEffect(() => {\n setLocalFiles(prevFiles => {\n const visibilityMap = new Map(\n prevFiles.map(f => [f.id, f.isVisible ?? false])\n )\n // The record seeds a placeable file; after that the scene is the truth.\n const inScene = (file: IFile): boolean => {\n if (file.extension === 'ids') return activeIDSFileId === file.id\n if (!isPlaceable(file.extension)) return false\n\n return isFileInScene(file, registryRef.current) || (file as any).isVisible === true\n }\n return files\n .filter(file => file.tag !== 'user')\n .filter(file => (file as any).type !== 'map-file')\n .map(file => {\n // A tracked file keeps the user's toggle; a first-seen one asks the scene.\n let isVisible = visibilityMap.has(file.id) ? visibilityMap.get(file.id)! : inScene(file)\n if (file.extension === 'ids' && activeIDSFileId === file.id) {\n isVisible = true\n } else if (file.extension === 'ids' && activeIDSFileId !== null && activeIDSFileId !== file.id) {\n isVisible = false\n }\n return { ...file, isVisible }\n })\n .sort((a, b) => a.name.localeCompare(b.name))\n })\n }, [files, activeIDSFileId])\n\n // Listen to IDS reset events\n React.useEffect(() => {\n if (!bimComponents) return\n try {\n const idsManager = bimComponents.get(IDSManager)\n const handleIDSReset = () => {\n setActiveIDSFileId(null)\n setLocalFiles(prevFiles =>\n prevFiles.map(file =>\n file.extension === 'ids' ? { ...file, isVisible: false } : file\n )\n )\n }\n idsManager.onReset.add(handleIDSReset)\n return () => { idsManager.onReset.remove(handleIDSReset) }\n } catch {\n return\n }\n }, [bimComponents])\n\n const modelManager = React.useMemo(() => {\n if (!bimComponents) return null\n try { return bimComponents.get(ModelManager) } catch { return null }\n }, [bimComponents])\n\n const dxfManager = React.useMemo(() => {\n if (!bimComponents) return null\n try { return bimComponents.get(DXFManager) } catch { return null }\n }, [bimComponents])\n\n const registry = React.useMemo(() => {\n if (!bimComponents) return null\n try { return bimComponents.get(BimSceneObjects).registry } catch { return null }\n }, [bimComponents, world])\n const registryRef = React.useRef(registry)\n React.useEffect(() => { registryRef.current = registry }, [registry])\n\n // Floating scene markers (pin + actions card) for visible placeable files.\n const markersRef = React.useRef<Map<string, { marker: CSS2DObject; file: IFile }>>(new Map())\n // Bumped after an object finishes loading so the marker reconcile effect re-runs.\n const [loadedTick, setLoadedTick] = React.useState(0)\n\n // Anyone may put an object in the scene; the list follows it rather than being told twice.\n React.useEffect(() => {\n if (!registry) return\n const track = (visible: boolean) => (entry: SceneObject) => {\n setLoadedTick(tick => tick + 1)\n // A pin standing in for a PDF is in the scene, but the list has no visibility to report.\n if (!entry.fileId || entry.kind === 'marker') return\n setLocalFiles(prev => prev.map(f =>\n f.id.toString() === entry.fileId ? { ...f, isVisible: visible } : f))\n }\n const stopAdded = registry.onAdded(track(true))\n const stopRemoved = registry.onRemoved(track(false))\n return () => { stopAdded(); stopRemoved() }\n }, [registry])\n\n const toggleModelVisibility = React.useCallback(async (\n file: IFile,\n visible: boolean,\n position?: THREE.Vector3,\n ) => {\n if (!modelManager || !registry) return\n\n const key = file.id.toString()\n if (!visible) { registry.setVisible(key, false); return }\n\n const existing = registry.get(key)\n if (existing) {\n registry.setVisible(key, true)\n if (position) existing.root.position.copy(position)\n return\n }\n\n try {\n const res = await fetch(`/api/presignedUrlDownload/${file.id}`)\n if (!res.ok) throw new Error(`Failed to get download URL: ${res.status}`)\n const { presignedUrl } = await res.json()\n const info = await modelManager.load(presignedUrl, key, file.name, {\n position: position ?? placedPosition(file),\n rotation: file.bimRotation != null ? new THREE.Euler(0, file.bimRotation, 0) : undefined,\n extension: file.extension ?? undefined,\n })\n if (info) {\n registry.add({ key, fileId: key, kind: 'model', root: info.model, dispose: () => { modelManager.remove(key) } })\n }\n } catch (err) {\n console.error(`[FilesSection] Failed to load model \"${file.name}\":`, err)\n }\n }, [modelManager, registry])\n\n const toggleDxfVisibility = React.useCallback(async (file: IFile, visible: boolean) => {\n if (!dxfManager || !registry) return\n\n const key = file.id.toString()\n if (!visible) { registry.setVisible(key, false); return }\n if (registry.has(key)) { registry.setVisible(key, true); return }\n\n try {\n const res = await fetch(`/api/presignedUrlDownload/${file.id}`)\n if (!res.ok) throw new Error(`Failed to get download URL: ${res.status}`)\n const { presignedUrl } = await res.json()\n const group = await dxfManager.parse(presignedUrl)\n const placed = file.x != null && file.y != null && file.z != null\n group.position.copy(placed\n ? new THREE.Vector3(file.x as number, file.y as number, file.z as number)\n : new THREE.Vector3())\n group.scale.setScalar(0.001)\n if (file.bimRotation != null) group.rotation.y = file.bimRotation as number\n registry.add({ key, fileId: key, kind: 'dxf', root: group })\n } catch (err) {\n console.error(`[FilesSection] Failed to load DXF \"${file.name}\":`, err)\n }\n }, [dxfManager, registry])\n\n // Keyed on the building id, not unmount: closing the sidebar tab must not empty the scene.\n const loadedBuildingRef = React.useRef<number | null>(null)\n React.useEffect(() => {\n if (loadedBuildingRef.current === buildingId) return\n const previous = loadedBuildingRef.current\n loadedBuildingRef.current = buildingId\n if (previous === null) return\n\n registry?.clear()\n }, [buildingId, registry])\n\n // Claimed per building so a revalidation cannot re-add what the user just switched off.\n const seededBuildingRef = React.useRef<number | null>(null)\n React.useEffect(() => {\n if (!registry || !modelManager || files.length === 0) return\n if (seededBuildingRef.current === buildingId) return\n seededBuildingRef.current = buildingId\n\n for (const file of selectSceneSeedFiles(files as IFile[], isPlaceable, key => registry.has(key))) {\n void (file.extension?.toLowerCase() === 'dxf'\n ? toggleDxfVisibility(file, true)\n : toggleModelVisibility(file, true))\n }\n }, [buildingId, files, registry, modelManager, toggleModelVisibility, toggleDxfVisibility])\n\n // Read by the marker rAF loop, so it hides the marker of whatever is being placed.\n const placingIdRef = React.useRef<string | null>(null)\n\n // Track the file ID currently being repositioned so useFile can provide updateFile\n const [moveFileId, setMoveFileId] = React.useState<number | null>(null)\n const placementSession = usePlacementSession()\n React.useEffect(() => {\n placingIdRef.current = placementSession?.id ?? null\n if (!placementSession) setMoveFileId(null)\n }, [placementSession])\n const { updateFile } = useFile(moveFileId)\n const updateFileRef = React.useRef(updateFile)\n React.useEffect(() => { updateFileRef.current = updateFile }, [updateFile])\n\n const fetchDbFileAsFile = async (file: IFile): Promise<globalThis.File> => {\n const response = await fetch(file.url)\n const blob = await response.blob()\n const mimeType = file.extension === 'ids' ? 'application/xml' : 'application/octet-stream'\n return new globalThis.File([blob], file.name, { type: mimeType })\n }\n\n // View handler: IDS, BCF, and 3D file visibility\n const handleBimView = React.useCallback(async (file: IFile & { isVisible?: boolean }, newVisibility: boolean) => {\n // IDS files\n if (file.extension === 'ids') {\n const idsManager = bimComponents?.get(IDSManager)\n if (!idsManager) return\n idsManager.enabled = newVisibility\n if (newVisibility) {\n setActiveIDSFileId(file.id)\n try {\n const dbFile = await fetchDbFileAsFile(file)\n await idsManager.loadFromFile(dbFile)\n await idsManager.loadAndTestIDS()\n } catch (error) {\n console.error('Error loading IDS file:', error)\n }\n } else {\n setActiveIDSFileId(null)\n await idsManager.reset()\n }\n }\n\n // BCF files\n if (file.extension === 'bcf') {\n menusDispatch({ type: 'SET_SIDEBAR_SELECTED_TAB', payload: { selectedTab: 'communication' } })\n if (!bimComponents) return\n let bcfManager: BCFTopicsManager | undefined\n try {\n bcfManager = bimComponents.get(BCFTopicsManager)\n } catch {\n bcfManager = new BCFTopicsManager(bimComponents)\n }\n if (!bcfManager) return\n try {\n const { topics } = await bcfManager.loadBCFFromUrl(file.url)\n if (topics?.length) {\n topics.forEach((topic) => {\n const exists = bimState.bim.bcfTopics.find(t => t.guid === topic.guid)\n if (!exists) {\n bimDispatch({ type: 'ADD_BCF_TOPIC', payload: { bcfTopic: topic } })\n }\n })\n }\n } catch (error) {\n console.error('Failed to load BCF from URL:', error)\n }\n }\n\n if (is3DFile(file.extension)) {\n await toggleModelVisibility(file, newVisibility)\n if (fragments) void fragments.core.update(true)\n }\n\n // DXF files managed via DXFManager\n if (file.extension === 'dxf') {\n await toggleDxfVisibility(file, newVisibility)\n if (fragments) void fragments.core.update(true)\n }\n }, [bimComponents, menusDispatch, bimState, bimDispatch, fragments, toggleModelVisibility, toggleDxfVisibility])\n\n const highlighter = React.useMemo(() => {\n if (!bimComponents) return null\n try { return bimComponents.get(Highlighter) } catch { return null }\n }, [bimComponents])\n\n // Raycast into fragments (same logic as useFilePlacement)\n const raycast = React.useCallback(async (data: {\n camera: THREE.PerspectiveCamera | THREE.OrthographicCamera\n mouse: THREE.Vector2\n dom: HTMLCanvasElement\n }) => {\n if (!fragments || !highlighter) return null\n const results = []\n for (const [modelName, model] of fragments.core.models.list) {\n if (highlighter.isModelDisabled(modelName)) continue\n const result = await model.raycast(data)\n if (result) results.push(result)\n }\n await Promise.all(results)\n if (results.length === 0) return null\n let closest = results[0]\n for (let i = 1; i < results.length; i++) {\n if (results[i].distance < closest.distance) closest = results[i]\n }\n return closest\n }, [fragments, highlighter])\n\n // Track the file currently being placed (unplaced file → click-to-place)\n const [placingFile, setPlacingFile] = React.useState<IFile | null>(null)\n\n // Click-to-place effect: crosshair + double-click raycast for unplaced files\n React.useEffect(() => {\n if (!placingFile || !bimComponents) return\n\n const world = bimComponents.get(CurrentWorld).world\n if (!world) return\n\n const cursor = bimComponents.get(Cursor)\n if (cursor) cursor.cursor = 'crosshair'\n toast.info(t('placeHint', { name: placingFile.name }), { id: PLACE_TOAST_ID, duration: Infinity })\n\n const mouse = new THREE.Vector2()\n\n const handleDblClick = async (e: MouseEvent) => {\n mouse.x = e.clientX\n mouse.y = e.clientY\n\n const result = await raycast({\n camera: world.camera.three,\n mouse,\n dom: world.renderer!.three.domElement!,\n })\n\n // A click that hit nothing carries no position, so the object lands at the origin.\n const { x, y, z } = result?.point ?? new THREE.Vector3()\n setMoveFileId(placingFile.id)\n // Save coordinates to DB\n setTimeout(() => {\n updateFileRef.current({ x, y, z } as any)\n .catch((err: unknown) => console.error(`Failed to save placement for \"${placingFile.name}\":`, err))\n }, 50)\n if (is3DFile(placingFile.extension)) {\n void toggleModelVisibility(placingFile, true, new THREE.Vector3(x, y, z))\n }\n // Update local state so it shows as placed and visible\n placingFile.x = x\n placingFile.y = y\n placingFile.z = z\n setLocalFiles(prev => prev.map(f => f.id === placingFile.id ? { ...f, x, y, z, isVisible: true } : f))\n setPlacingFile(null)\n if (cursor) cursor.cursor = ''\n }\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n setPlacingFile(null)\n if (cursor) cursor.cursor = ''\n }\n }\n\n const onDblClick = (e: MouseEvent) => { void handleDblClick(e) }\n\n document.addEventListener('dblclick', onDblClick)\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('dblclick', onDblClick)\n document.removeEventListener('keydown', handleKeyDown)\n if (cursor) cursor.cursor = ''\n toast.dismiss(PLACE_TOAST_ID)\n }\n }, [placingFile, bimComponents, raycast, t, toggleModelVisibility])\n\n const getSceneObject = React.useCallback((file: IFile): THREE.Object3D | null => {\n return sceneObjectForFile(file, registryRef.current)\n }, [])\n\n const editObject = React.useCallback((file: IFile, mode: PlacementMode = 'translate') => {\n if (!bimComponents) return\n if (!getSceneObject(file)) return\n\n setMoveFileId(file.id)\n void bimComponents.get(PlacementEditor).begin(objectTarget({\n id: file.id.toString(),\n name: file.name,\n object: () => getSceneObject(file),\n updateFile: async (patch) => {\n Object.assign(file, patch)\n await updateFileRef.current(patch as never)\n },\n capabilities: capabilitiesForFile(file),\n }), mode)\n }, [bimComponents, getSceneObject])\n\n // Move handler: unplaced files → click-to-place; placed files → gizmo (load DXF first if needed)\n const handleBimMove = React.useCallback((file: IFile) => {\n const isPlaced = file.x != null && file.y != null && file.z != null\n if (!isPlaced) {\n setPlacingFile(file)\n setMoveFileId(file.id)\n return\n }\n if (!registry?.has(file.id.toString())) {\n const load = file.extension === 'dxf'\n ? toggleDxfVisibility(file, true)\n : toggleModelVisibility(file, true)\n void load.then(() => editObject(file, 'translate'))\n return\n }\n editObject(file, 'translate')\n }, [editObject, registry, toggleDxfVisibility, toggleModelVisibility])\n\n const { handleAction, deleteDialog } = useFileActions({\n files: localFiles,\n setFiles: setLocalFiles,\n buildingId,\n handleDeleteFile,\n onView: handleBimView,\n shouldPersistVisibility: (file) => isPlaceable(file.extension),\n onMove: handleBimMove,\n onDelete: (file) => { registry?.remove(file.id.toString()) },\n })\n\n // AddToBim owns adding: crosshair on file choice, and the upload carries the placement.\n const addFile = React.useCallback(() => {\n toolsDispatch({ type: 'SET-TOOL', payload: { currentToolId: 'bim-add-file' } })\n }, [toolsDispatch])\n\n const filteredFiles = React.useMemo(() => {\n if (!query.trim()) return localFiles\n return localFiles.filter(file =>\n file.name.toLowerCase().includes(query.toLowerCase())\n )\n }, [localFiles, query])\n\n const areAllHidden = localFiles.every(f => !f.isVisible)\n\n const handleSwitchVariant = () => ({\n checked: !areAllHidden,\n onCheckedChange: async (checked: boolean) => {\n setLocalFiles(prev => prev.map(f => ({ ...f, isVisible: checked })))\n for (const f of localFiles) {\n if (is3DFile(f.extension)) await toggleModelVisibility(f, checked)\n else if (f.extension === 'dxf') await toggleDxfVisibility(f, checked)\n }\n if (fragments) void fragments.core.update(true)\n },\n })\n\n // createFileMarker expects an AddedFile; build a lightweight one from the DB file.\n const makeMarkerInput = React.useCallback((file: IFile, position: THREE.Vector3): AddedFile => ({\n id: file.id.toString(),\n file: new File([], file.name, { type: (file as any).mimeType ?? '' }),\n position,\n }), [])\n\n // Reconcile floating markers with the visible + loaded placeable files.\n React.useEffect(() => {\n if (!bimComponents) return\n const world = bimComponents.get(CurrentWorld).world\n if (!world) return\n\n const wanted = new Map(\n localFiles\n .filter(f => f.isVisible && isPlaceable(f.extension))\n .map(f => [f.id.toString(), f] as const),\n )\n\n for (const [key, entry] of markersRef.current) {\n if (!wanted.has(key)) {\n removeMarker(entry.marker, world)\n markersRef.current.delete(key)\n }\n }\n\n for (const [key, file] of wanted) {\n if (markersRef.current.has(key)) continue\n const obj = getSceneObject(file)\n if (!obj) continue // not loaded yet — picked up once loadedTick bumps\n const clips = modelManager?.getClips(file.id.toString()) ?? []\n const marker = createFileMarker(makeMarkerInput(file, obj.position.clone()), obj, world, (action) => {\n if (action === 'delete') { void handleAction('delete', file); return }\n if (action === 'animate') {\n bimComponents.get(AnimationSession).begin({ fileId: file.id.toString(), name: file.name })\n return\n }\n editObject(file, action === 'move' ? 'translate' : action)\n }, markerActionsFor(capabilitiesForFile(file), { animated: clips.length > 0 }))\n if (marker) markersRef.current.set(key, { marker, file })\n }\n }, [localFiles, loadedTick, bimComponents, getSceneObject, editObject, handleAction, makeMarkerInput, modelManager])\n\n // Markers follow their object; one only earns its place when the geometry is too small to hit.\n React.useEffect(() => {\n if (!bimComponents) return\n let raf = 0\n const worldPos = new THREE.Vector3()\n const tick = () => {\n const world = bimComponents.get(CurrentWorld).world\n const camera = world?.camera?.three\n const viewportHeight = world?.renderer?.three.domElement.clientHeight ?? 0\n\n markersRef.current.forEach(({ marker, file }, key) => {\n const obj = getSceneObject(file)\n if (!obj) { marker.visible = false; return }\n obj.getWorldPosition(worldPos)\n marker.position.set(worldPos.x, worldPos.y + 0.2, worldPos.z)\n marker.visible = placingIdRef.current !== key\n && !!camera\n && needsMarker(obj, camera, viewportHeight)\n })\n raf = requestAnimationFrame(tick)\n }\n raf = requestAnimationFrame(tick)\n return () => cancelAnimationFrame(raf)\n }, [bimComponents, getSceneObject])\n\n // Clean up all markers on unmount so their DOM/React roots don't leak.\n const markersCleanupRef = React.useRef(markersRef.current)\n React.useEffect(() => {\n const markers = markersCleanupRef.current\n return () => {\n markers.forEach(({ marker }) => removeMarker(marker))\n markers.clear()\n }\n }, [])\n\n return (\n <>\n <CollapsibleSection\n title={t('filesTitle')}\n icon={LR.FileText}\n className=\"max-h-40 overflow-y-auto\"\n itemCount={filteredFiles.length}\n switchVariant={handleSwitchVariant()}\n onAddItem={addFile}\n addItemTitle={t('addFileTitle')}\n >\n <div className=\"space-y-1\">\n {filteredFiles.map((item) => (\n <FileItemComponent\n key={item.id}\n file={item}\n onAction={handleAction}\n options={isPlaceable(item.extension) ? OPTIONS_3D : OPTIONS_NON_3D}\n translationKey=\"FileSelection\"\n confirmDelete={false}\n />\n ))}\n </div>\n </CollapsibleSection>\n\n <ConfirmDialog\n isOpen={deleteDialog.isOpen}\n isDeleting={deleteDialog.isDeleting}\n onOpenChange={deleteDialog.onOpenChange}\n handleConfirm={deleteDialog.onConfirm}\n itemName={deleteDialog.itemName}\n />\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwkBI,mBAYQ,KAZR;AArkBJ,YAAY,QAAQ;AACpB,SAAS,uBAAuB;AAChC,YAAY,WAAW;AACvB,SAAS,aAAa;AACtB,YAAY,WAAW;AAEvB,SAAS,eAAe,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aAAa;AAAA,QACzB,cAAc,aAAa;AAAA,QAC3B,eAAe,aAAa;AAAA,QAC5B,UAAU,aAAa;AAAA;AAAA,IACzB;AAAA,KACF;AAEJ;","names":["t","world"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../src/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/FilesSection.tsx"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport * as LR from 'lucide-react'\nimport { useTranslations } from 'next-intl'\nimport * as React from 'react'\nimport * as THREE from 'three'\n\nimport { useDeleteFile } from '../../../../../../../../hooks/files/files'\nimport { BimContext, BuildingsContext, MenusContext, ToolsContext } from '../../../../../../../../store'\nimport ConfirmDialog from '../../../../../../../ConfirmDialog'\nimport { CollapsibleSection } from '../../../../../../../ui/CollapsibleSection'\nimport { useFileDeleteHandler, FileItemComponent, useFileActions, UploadProgressBar, useUploadTasks } from '../../../../../../../ui/FilesManager'\nimport { BCFTopicsManager } from '../../../../BCFTopicsManager'\nimport { CurrentWorld } from '../../../../CurrentWorld'\nimport { IDSManager } from '../../../../IDSManager'\nimport { needsMarker } from '../../../../lib/needsMarker'\nimport { ModelManager } from '../../../../ModelManager'\nimport { AnimationSession } from '../../../../Placement/AnimationSession'\nimport { markerActionsFor } from '../../../../Placement/markerActions'\nimport { capabilitiesForFile } from '../../../../Placement/placementCapabilities'\nimport { createFileMarker, removeMarker, type AddedFile } from '../../../../tools/AddToBim/src/FileMarkerUtils'\n\nimport { usePlaceableFileRows } from './usePlaceableFileRows'\n\nimport type { FileTabSectionChrome } from './sectionChrome'\nimport type { DbFile as IFile } from '../../../../../../../../types/dbTypes'\nimport type { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js'\n\n// Hoisted so identity is stable — inline `options={[...]}` defeats React.memo on FileItemComponent.\ntype FileAction = import('../../../../../../../../types/global').FileAction\nconst OPTIONS_PLACEABLE: FileAction[] = ['download', 'view', 'move', 'info', 'delete']\nconst OPTIONS_PLAIN: FileAction[] = ['download', 'view', 'delete']\n\ninterface FilesSectionProps extends FileTabSectionChrome {\n files: IFile[]\n query?: string\n}\n\n// 3D geometry has its own section, so the only file left here that holds a place is a drawing.\nconst isPlaceable = (ext?: string | null): boolean => ext?.toLowerCase() === 'dxf'\n\nexport function FilesSection({ files, query = '', ...chrome }: FilesSectionProps) {\n const t = useTranslations('FileSelection')\n\n const { state: bimState, dispatch: bimDispatch } = React.useContext(BimContext)\n const { bimComponents, fragments } = bimState.bim\n const { state: buildingsState } = React.useContext(BuildingsContext)\n const { building } = buildingsState.buildings\n const buildingId = building?.id ?? 0\n const { dispatch: menusDispatch } = React.useContext(MenusContext)\n const { dispatch: toolsDispatch } = React.useContext(ToolsContext)\n\n const { deleteFile } = useDeleteFile(buildingId)\n\n const { handleDeleteFile } = useFileDeleteHandler({\n deleteFile,\n })\n\n const placeHint = React.useCallback((name: string) => t('placeHint', { name }), [t])\n\n const {\n rows: localFiles,\n setRows: setLocalFiles,\n toggleVisibility,\n handleMove: handleBimMove,\n registry,\n getSceneObject,\n editObject,\n placingIdRef,\n loadedTick,\n } = usePlaceableFileRows({\n files,\n buildingId: building?.id,\n isPlaceable,\n placeHint,\n })\n const [activeIDSFileId, setActiveIDSFileId] = React.useState<number | null>(null)\n\n // An IDS file is not in the scene, so only the active one counts as shown.\n React.useEffect(() => {\n if (activeIDSFileId === null) return\n setLocalFiles(prevFiles => prevFiles.map(file =>\n file.extension === 'ids' ? { ...file, isVisible: activeIDSFileId === file.id } : file))\n }, [files, activeIDSFileId, setLocalFiles])\n\n // Listen to IDS reset events\n React.useEffect(() => {\n if (!bimComponents) return\n try {\n const idsManager = bimComponents.get(IDSManager)\n const handleIDSReset = () => {\n setActiveIDSFileId(null)\n setLocalFiles(prevFiles =>\n prevFiles.map(file =>\n file.extension === 'ids' ? { ...file, isVisible: false } : file\n )\n )\n }\n idsManager.onReset.add(handleIDSReset)\n return () => { idsManager.onReset.remove(handleIDSReset) }\n } catch {\n return\n }\n }, [bimComponents])\n\n const modelManager = React.useMemo(() => {\n if (!bimComponents) return null\n try { return bimComponents.get(ModelManager) } catch { return null }\n }, [bimComponents])\n\n // Floating scene markers (pin + actions card) for visible placeable files.\n const markersRef = React.useRef<Map<string, { marker: CSS2DObject; file: IFile }>>(new Map())\n\n const fetchDbFileAsFile = async (file: IFile): Promise<globalThis.File> => {\n const response = await fetch(file.url)\n const blob = await response.blob()\n const mimeType = file.extension === 'ids' ? 'application/xml' : 'application/octet-stream'\n return new globalThis.File([blob], file.name, { type: mimeType })\n }\n\n // View handler: IDS, BCF, and 3D file visibility\n const handleBimView = React.useCallback(async (file: IFile & { isVisible?: boolean }, newVisibility: boolean) => {\n // IDS files\n if (file.extension === 'ids') {\n const idsManager = bimComponents?.get(IDSManager)\n if (!idsManager) return\n idsManager.enabled = newVisibility\n if (newVisibility) {\n setActiveIDSFileId(file.id)\n try {\n const dbFile = await fetchDbFileAsFile(file)\n await idsManager.loadFromFile(dbFile)\n await idsManager.loadAndTestIDS()\n } catch (error) {\n console.error('Error loading IDS file:', error)\n }\n } else {\n setActiveIDSFileId(null)\n await idsManager.reset()\n }\n }\n\n // BCF files\n if (file.extension === 'bcf') {\n menusDispatch({ type: 'SET_SIDEBAR_SELECTED_TAB', payload: { selectedTab: 'communication' } })\n if (!bimComponents) return\n let bcfManager: BCFTopicsManager | undefined\n try {\n bcfManager = bimComponents.get(BCFTopicsManager)\n } catch {\n bcfManager = new BCFTopicsManager(bimComponents)\n }\n if (!bcfManager) return\n try {\n const { topics } = await bcfManager.loadBCFFromUrl(file.url)\n if (topics?.length) {\n topics.forEach((topic) => {\n const exists = bimState.bim.bcfTopics.find(t => t.guid === topic.guid)\n if (!exists) {\n bimDispatch({ type: 'ADD_BCF_TOPIC', payload: { bcfTopic: topic } })\n }\n })\n }\n } catch (error) {\n console.error('Failed to load BCF from URL:', error)\n }\n }\n\n if (isPlaceable(file.extension)) {\n await toggleVisibility(file, newVisibility)\n if (fragments) void fragments.core.update(true)\n }\n }, [bimComponents, menusDispatch, bimState, bimDispatch, fragments, toggleVisibility])\n\n const { handleAction, deleteDialog } = useFileActions({\n files: localFiles,\n setFiles: setLocalFiles,\n buildingId,\n handleDeleteFile,\n onView: handleBimView,\n shouldPersistVisibility: (file) => isPlaceable(file.extension),\n onMove: handleBimMove,\n onDelete: (file) => { registry?.remove(file.id.toString()) },\n })\n\n // AddToBim owns adding: crosshair on file choice, and the upload carries the placement.\n const addFile = React.useCallback(() => {\n toolsDispatch({ type: 'SET-TOOL', payload: { currentToolId: 'bim-add-file' } })\n }, [toolsDispatch])\n\n const tasks = useUploadTasks('files')\n\n const filteredFiles = React.useMemo(() => {\n if (!query.trim()) return localFiles\n return localFiles.filter(file =>\n file.name.toLowerCase().includes(query.toLowerCase())\n )\n }, [localFiles, query])\n\n const areAllHidden = localFiles.every(f => !f.isVisible)\n\n const handleSwitchVariant = () => ({\n checked: !areAllHidden,\n onCheckedChange: async (checked: boolean) => {\n setLocalFiles(prev => prev.map(f => ({ ...f, isVisible: checked })))\n for (const f of localFiles) {\n if (isPlaceable(f.extension)) await toggleVisibility(f, checked)\n }\n if (fragments) void fragments.core.update(true)\n },\n })\n\n // createFileMarker expects an AddedFile; build a lightweight one from the DB file.\n const makeMarkerInput = React.useCallback((file: IFile, position: THREE.Vector3): AddedFile => ({\n id: file.id.toString(),\n file: new File([], file.name, { type: file.mimeType ?? '' }),\n position,\n }), [])\n\n // Reconcile floating markers with the visible + loaded placeable files.\n React.useEffect(() => {\n if (!bimComponents) return\n const world = bimComponents.get(CurrentWorld).world\n if (!world) return\n\n const wanted = new Map(\n localFiles\n .filter(f => f.isVisible && isPlaceable(f.extension))\n .map(f => [f.id.toString(), f] as const),\n )\n\n for (const [key, entry] of markersRef.current) {\n if (!wanted.has(key)) {\n removeMarker(entry.marker, world)\n markersRef.current.delete(key)\n }\n }\n\n for (const [key, file] of wanted) {\n if (markersRef.current.has(key)) continue\n const obj = getSceneObject(file)\n if (!obj) continue // not loaded yet — picked up once loadedTick bumps\n const clips = modelManager?.getClips(file.id.toString()) ?? []\n const marker = createFileMarker(makeMarkerInput(file, obj.position.clone()), obj, world, (action) => {\n if (action === 'delete') { void handleAction('delete', file); return }\n if (action === 'animate') {\n bimComponents.get(AnimationSession).begin({ fileId: file.id.toString(), name: file.name })\n return\n }\n editObject(file, action === 'move' ? 'translate' : action)\n }, markerActionsFor(capabilitiesForFile(file), { animated: clips.length > 0 }))\n if (marker) markersRef.current.set(key, { marker, file })\n }\n }, [localFiles, loadedTick, bimComponents, getSceneObject, editObject, handleAction, makeMarkerInput, modelManager])\n\n // Markers follow their object; one only earns its place when the geometry is too small to hit.\n React.useEffect(() => {\n if (!bimComponents) return\n let raf = 0\n const worldPos = new THREE.Vector3()\n const tick = () => {\n const world = bimComponents.get(CurrentWorld).world\n const camera = world?.camera?.three\n const viewportHeight = world?.renderer?.three.domElement.clientHeight ?? 0\n\n markersRef.current.forEach(({ marker, file }, key) => {\n const obj = getSceneObject(file)\n if (!obj) { marker.visible = false; return }\n obj.getWorldPosition(worldPos)\n marker.position.set(worldPos.x, worldPos.y + 0.2, worldPos.z)\n marker.visible = placingIdRef.current !== key\n && !!camera\n && needsMarker(obj, camera, viewportHeight)\n })\n raf = requestAnimationFrame(tick)\n }\n raf = requestAnimationFrame(tick)\n return () => cancelAnimationFrame(raf)\n }, [bimComponents, getSceneObject])\n\n // Clean up all markers on unmount so their DOM/React roots don't leak.\n const markersCleanupRef = React.useRef(markersRef.current)\n React.useEffect(() => {\n const markers = markersCleanupRef.current\n return () => {\n markers.forEach(({ marker }) => removeMarker(marker))\n markers.clear()\n }\n }, [])\n\n return (\n <>\n <CollapsibleSection\n title={t('filesTitle')}\n icon={LR.FileText}\n className=\"min-h-0 overflow-y-auto\"\n style={{ height: '100%', minHeight: 0 }}\n itemCount={filteredFiles.length}\n switchVariant={handleSwitchVariant()}\n onAddItem={addFile}\n addItemTitle={t('addFileTitle')}\n {...chrome}\n >\n {tasks.map(task => (\n <div key={task.id} className=\"px-2 py-1\">\n <UploadProgressBar label={task.label} progress={task.progress} />\n </div>\n ))}\n\n <div className=\"space-y-1\">\n {filteredFiles.map((item) => (\n <FileItemComponent\n key={item.id}\n file={item}\n onAction={handleAction}\n options={isPlaceable(item.extension) ? OPTIONS_PLACEABLE : OPTIONS_PLAIN}\n translationKey=\"FileSelection\"\n confirmDelete={false}\n />\n ))}\n </div>\n </CollapsibleSection>\n\n <ConfirmDialog\n isOpen={deleteDialog.isOpen}\n isDeleting={deleteDialog.isDeleting}\n onOpenChange={deleteDialog.onOpenChange}\n handleConfirm={deleteDialog.onConfirm}\n itemName={deleteDialog.itemName}\n />\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoSI,mBAcQ,KAbN,YADF;AAjSJ,YAAY,QAAQ;AACpB,SAAS,uBAAuB;AAChC,YAAY,WAAW;AACvB,YAAY,WAAW;AAEvB,SAAS,qBAAqB;AAC9B,SAAS,YAAY,kBAAkB,cAAc,oBAAoB;AACzE,OAAO,mBAAmB;AAC1B,SAAS,0BAA0B;AACnC,SAAS,sBAAsB,mBAAmB,gBAAgB,mBAAmB,sBAAsB;AAC3G,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,kBAAkB,oBAAoC;AAE/D,SAAS,4BAA4B;AAQrC,MAAM,oBAAkC,CAAC,YAAY,QAAQ,QAAQ,QAAQ,QAAQ;AACrF,MAAM,gBAA8B,CAAC,YAAY,QAAQ,QAAQ;AAQjE,MAAM,cAAc,CAAC,SAAiC,2BAAK,mBAAkB;AAEtE,SAAS,aAAa,IAAqD;AAArD,eAAE,SAAO,QAAQ,GA1C9C,IA0C6B,IAAwB,mBAAxB,IAAwB,CAAtB,SAAO;AA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AAAA,QACnC,WAAW;AAAA,QACX,cAAc,EAAE,cAAc;AAAA,SAC1B,SATL;AAAA,QAWE;AAAA,gBAAM,IAAI,UACT,oBAAC,SAAkB,WAAU,aAC3B,8BAAC,qBAAkB,OAAO,KAAK,OAAO,UAAU,KAAK,UAAU,KADvD,KAAK,EAEf,CACD;AAAA,UAED,oBAAC,SAAI,WAAU,aACZ,wBAAc,IAAI,CAAC,SAClB;AAAA,YAAC;AAAA;AAAA,cAEC,MAAM;AAAA,cACN,UAAU;AAAA,cACV,SAAS,YAAY,KAAK,SAAS,IAAI,oBAAoB;AAAA,cAC3D,gBAAe;AAAA,cACf,eAAe;AAAA;AAAA,YALV,KAAK;AAAA,UAMZ,CACD,GACH;AAAA;AAAA;AAAA,IACF;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ,aAAa;AAAA,QACrB,YAAY,aAAa;AAAA,QACzB,cAAc,aAAa;AAAA,QAC3B,eAAe,aAAa;AAAA,QAC5B,UAAU,aAAa;AAAA;AAAA,IACzB;AAAA,KACF;AAEJ;","names":["_a","t","_b"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { FileTabSectionChrome } from './sectionChrome';
|
|
3
|
+
import type { DbFile } from '../../../../../../../../types/dbTypes';
|
|
4
|
+
interface ModelsSectionProps extends FileTabSectionChrome {
|
|
4
5
|
files: DbFile[];
|
|
5
6
|
query?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function ModelsSection({ files, query }: ModelsSectionProps): React.JSX.Element;
|
|
8
|
+
export declare function ModelsSection({ files, query, ...chrome }: ModelsSectionProps): React.JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=ModelsSection.d.ts.map
|
package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelsSection.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ModelsSection.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAA;AAQnE,UAAU,kBAAmB,SAAQ,oBAAoB;IACvD,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAU,EAAE,GAAG,MAAM,EAAE,EAAE,kBAAkB,qBA8FjF"}
|
|
@@ -20,268 +20,113 @@ var __spreadValues = (a, b) => {
|
|
|
20
20
|
return a;
|
|
21
21
|
};
|
|
22
22
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
23
35
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
36
|
import * as LR from "lucide-react";
|
|
25
37
|
import { useTranslations } from "next-intl";
|
|
26
38
|
import * as React from "react";
|
|
27
|
-
import {
|
|
39
|
+
import { useDeleteFile, useUploadFileToBuilding } from "../../../../../../../../hooks/files/files";
|
|
28
40
|
import { BimContext, BuildingsContext } from "../../../../../../../../store";
|
|
29
41
|
import ConfirmDialog from "../../../../../../../ConfirmDialog";
|
|
30
42
|
import { CollapsibleSection } from "../../../../../../../ui/CollapsibleSection";
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function ModelsSection({ files, query = "" }) {
|
|
43
|
+
import { FileItemComponent, useFileActions, useFileDeleteHandler, ACCEPT_FOR_TYPE, EXTENSIONS_FOR_TYPE, UploadProgressBar, useUploadTasks } from "../../../../../../../ui/FilesManager";
|
|
44
|
+
import { useBimFileIntake } from "../../../../lib/useBimFileIntake";
|
|
45
|
+
import { BimPointClouds } from "../../../../PointClouds";
|
|
46
|
+
import { usePlaceableFileRows } from "./usePlaceableFileRows";
|
|
47
|
+
const MODEL_OPTIONS = ["download", "view", "move", "info", "delete"];
|
|
48
|
+
const is3dFile = (extension) => {
|
|
49
|
+
var _a;
|
|
50
|
+
return EXTENSIONS_FOR_TYPE["3d-file"].includes((_a = extension == null ? void 0 : extension.toLowerCase()) != null ? _a : "");
|
|
51
|
+
};
|
|
52
|
+
function ModelsSection(_a) {
|
|
53
|
+
var _b = _a, { files, query = "" } = _b, chrome = __objRest(_b, ["files", "query"]);
|
|
54
|
+
var _a2, _b2;
|
|
44
55
|
const t = useTranslations("FileItemComponent");
|
|
45
|
-
const
|
|
46
|
-
const {
|
|
56
|
+
const tFiles = useTranslations("FileSelection");
|
|
57
|
+
const { state: bimState } = React.useContext(BimContext);
|
|
58
|
+
const { bimComponents } = bimState.bim;
|
|
47
59
|
const { state: buildingsState } = React.useContext(BuildingsContext);
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const { uploadFile } = useUploadFileToBuilding(buildingId);
|
|
60
|
+
const buildingId = (_a2 = buildingsState.buildings.building) == null ? void 0 : _a2.id;
|
|
61
|
+
const { uploadFile } = useUploadFileToBuilding(buildingId != null ? buildingId : 0);
|
|
51
62
|
const { deleteFile } = useDeleteFile(buildingId);
|
|
52
|
-
const {
|
|
53
|
-
const {
|
|
63
|
+
const { handleDeleteFile } = useFileDeleteHandler({ deleteFile });
|
|
64
|
+
const { rows, setRows, toggleVisibility, handleMove, registry } = usePlaceableFileRows({
|
|
65
|
+
files,
|
|
54
66
|
buildingId,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
uploadFile
|
|
67
|
+
isPlaceable: is3dFile,
|
|
68
|
+
placeHint: (name) => tFiles("placeHint", { name })
|
|
58
69
|
});
|
|
59
|
-
const
|
|
60
|
-
|
|
70
|
+
const intake = useBimFileIntake({
|
|
71
|
+
buildingId: buildingId != null ? buildingId : 0,
|
|
72
|
+
apiBase: (_b2 = bimComponents == null ? void 0 : bimComponents.get(BimPointClouds).apiBase) != null ? _b2 : "",
|
|
73
|
+
existingNames: files.map((file) => file.name),
|
|
74
|
+
uploadFile
|
|
61
75
|
});
|
|
62
|
-
const
|
|
63
|
-
files.map((file) => {
|
|
64
|
-
var _a, _b, _c, _d, _e;
|
|
65
|
-
return __spreadProps(__spreadValues({}, file), {
|
|
66
|
-
isVisible: (_c = (_b = (_a = modelUIState[file.id]) == null ? void 0 : _a.isVisible) != null ? _b : file.isVisible) != null ? _c : false,
|
|
67
|
-
isGhost: (_e = (_d = modelUIState[file.id]) == null ? void 0 : _d.isGhost) != null ? _e : false
|
|
68
|
-
});
|
|
69
|
-
})
|
|
70
|
-
);
|
|
71
|
-
React.useEffect(() => {
|
|
72
|
-
setLoadedModels((prev) => {
|
|
73
|
-
const prevMap = new Map(prev.map((f) => [f.id, f]));
|
|
74
|
-
return files.map((file) => {
|
|
75
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
76
|
-
return __spreadProps(__spreadValues({}, file), {
|
|
77
|
-
isVisible: (_c = (_b = (_a = modelUIState[file.id]) == null ? void 0 : _a.isVisible) != null ? _b : file.isVisible) != null ? _c : false,
|
|
78
|
-
isGhost: (_g = (_f = (_d = modelUIState[file.id]) == null ? void 0 : _d.isGhost) != null ? _f : (_e = prevMap.get(file.id)) == null ? void 0 : _e.isGhost) != null ? _g : false
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}, [files, modelUIState]);
|
|
83
|
-
const modelManager = React.useMemo(() => {
|
|
84
|
-
if (!bimComponents) return null;
|
|
85
|
-
try {
|
|
86
|
-
return bimComponents.get(ModelManager);
|
|
87
|
-
} catch (e) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
}, [bimComponents]);
|
|
91
|
-
const bimManager = React.useMemo(() => {
|
|
92
|
-
if (!bimComponents) return null;
|
|
93
|
-
try {
|
|
94
|
-
return bimComponents.get(BIMManager);
|
|
95
|
-
} catch (e) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
}, [bimComponents]);
|
|
99
|
-
const ghostMode = React.useMemo(() => {
|
|
100
|
-
if (!bimComponents) return null;
|
|
101
|
-
try {
|
|
102
|
-
return bimComponents.get(GhostMode);
|
|
103
|
-
} catch (e) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
}, [bimComponents]);
|
|
107
|
-
const { targetFor, clearMoving } = useModelTarget();
|
|
108
|
-
const placementSession = usePlacementSession();
|
|
109
|
-
React.useEffect(() => {
|
|
110
|
-
if (!placementSession) clearMoving();
|
|
111
|
-
}, [placementSession, clearMoving]);
|
|
112
|
-
const highlighter = React.useMemo(() => {
|
|
113
|
-
if (!bimComponents) return null;
|
|
114
|
-
try {
|
|
115
|
-
return bimComponents.get(Highlighter);
|
|
116
|
-
} catch (e) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
}, [bimComponents]);
|
|
120
|
-
const handleBimView = React.useCallback(async (file, newVisibility) => {
|
|
121
|
-
var _a, _b, _c;
|
|
122
|
-
const isGhosted = (_b = (_a = modelUIState[file.id]) == null ? void 0 : _a.isGhost) != null ? _b : false;
|
|
123
|
-
if (highlighter) {
|
|
124
|
-
if (!newVisibility || isGhosted) highlighter.disableModel(file.name);
|
|
125
|
-
else highlighter.enableModel(file.name);
|
|
126
|
-
}
|
|
127
|
-
if (modelManager) {
|
|
128
|
-
const modelInfo = modelManager.getModel(file.id.toString());
|
|
129
|
-
if (modelInfo) {
|
|
130
|
-
modelInfo.model.visible = newVisibility;
|
|
131
|
-
bimDispatch({ type: "SET_MODEL_UI_STATE", payload: { fileId: file.id, isVisible: newVisibility } });
|
|
132
|
-
if (fragments) void fragments.core.update(true);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (!bimComponents || !fragments) return;
|
|
137
|
-
const loadModels = bimComponents.get(LoadModels);
|
|
138
|
-
if (!newVisibility) {
|
|
139
|
-
bimDispatch({ type: "SET_MODEL_UI_STATE", payload: { fileId: file.id, isVisible: false, isGhost: false } });
|
|
140
|
-
const ghosted = isGhosted ? fragments.core.models.list.get(file.name) : void 0;
|
|
141
|
-
if (ghosted) ghostMode == null ? void 0 : ghostMode.setModelGhost(ghosted, false);
|
|
142
|
-
bimManager == null ? void 0 : bimManager.remove(file.name);
|
|
143
|
-
try {
|
|
144
|
-
bimComponents.get(SpatialStructure).forgetModel(file.name);
|
|
145
|
-
} catch (e) {
|
|
146
|
-
}
|
|
147
|
-
await loadModels.unload(file.name);
|
|
148
|
-
void fragments.core.update(true);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
try {
|
|
152
|
-
loadModels.sharing = true;
|
|
153
|
-
const model = (_c = fragments.core.models.list.get(file.name)) != null ? _c : await loadModels.load(file.url, file.name);
|
|
154
|
-
if (!model) throw new Error("the model could not be loaded");
|
|
155
|
-
applyModelPlacement(model.object, file);
|
|
156
|
-
model.object.visible = true;
|
|
157
|
-
void fragments.core.update(true);
|
|
158
|
-
bimDispatch({ type: "SET_MODEL_UI_STATE", payload: { fileId: file.id, isVisible: true } });
|
|
159
|
-
if (!isGhosted) highlighter == null ? void 0 : highlighter.enableModel(file.name);
|
|
160
|
-
} catch (error) {
|
|
161
|
-
console.error(`Could not show model "${file.name}":`, error);
|
|
162
|
-
bimDispatch({ type: "SET_MODEL_UI_STATE", payload: { fileId: file.id, isVisible: false } });
|
|
163
|
-
}
|
|
164
|
-
}, [bimComponents, modelManager, fragments, highlighter, ghostMode, bimManager, bimDispatch, modelUIState]);
|
|
165
|
-
const handleBimDelete = React.useCallback((file) => {
|
|
166
|
-
if (modelManager) {
|
|
167
|
-
const modelIdStr = file.id.toString();
|
|
168
|
-
modelManager.remove(modelIdStr);
|
|
169
|
-
}
|
|
170
|
-
if (fragments) {
|
|
171
|
-
const fragModel = fragments.core.models.list.get(file.name);
|
|
172
|
-
if (fragModel) {
|
|
173
|
-
fragments.core.disposeModel(fragModel.modelId).catch((err) => {
|
|
174
|
-
console.error(`Failed to dispose fragment model "${file.name}":`, err);
|
|
175
|
-
});
|
|
176
|
-
bimManager == null ? void 0 : bimManager.remove(file.name);
|
|
177
|
-
try {
|
|
178
|
-
bimComponents == null ? void 0 : bimComponents.get(SpatialStructure).clearForModel(file.name);
|
|
179
|
-
} catch (e) {
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}, [modelManager, bimComponents, fragments, bimManager]);
|
|
184
|
-
const handleBimMove = React.useCallback((file) => {
|
|
185
|
-
if (!bimComponents || !fragments) return;
|
|
186
|
-
const editor = bimComponents.get(PlacementEditor);
|
|
187
|
-
if (editor.activeId === String(file.id)) {
|
|
188
|
-
editor.accept();
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (!fragments.core.models.list.get(file.name)) {
|
|
192
|
-
console.warn(`[BimMove] Model not found: "${file.name}"`);
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
void editor.begin(targetFor(file, () => {
|
|
196
|
-
var _a, _b;
|
|
197
|
-
return (_b = (_a = fragments.core.models.list.get(file.name)) == null ? void 0 : _a.object) != null ? _b : null;
|
|
198
|
-
}));
|
|
199
|
-
}, [bimComponents, fragments, targetFor]);
|
|
200
|
-
const handleBimGhost = React.useCallback((file, ghostState) => {
|
|
201
|
-
var _a, _b;
|
|
202
|
-
if (!fragments || !ghostMode) return;
|
|
203
|
-
const fragModel = fragments.core.models.list.get(file.name);
|
|
204
|
-
if (!fragModel) {
|
|
205
|
-
console.warn(`[BimGhost] Model not found: "${file.name}"`);
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
ghostMode.setModelGhost(fragModel, ghostState);
|
|
209
|
-
bimDispatch({ type: "SET_MODEL_UI_STATE", payload: { fileId: file.id, isGhost: ghostState } });
|
|
210
|
-
if (highlighter) {
|
|
211
|
-
const isVisible = (_b = (_a = modelUIState[file.id]) == null ? void 0 : _a.isVisible) != null ? _b : true;
|
|
212
|
-
if (ghostState || !isVisible) {
|
|
213
|
-
highlighter.disableModel(file.name);
|
|
214
|
-
} else {
|
|
215
|
-
highlighter.enableModel(file.name);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}, [fragments, ghostMode, bimDispatch, highlighter, modelUIState]);
|
|
76
|
+
const tasks = useUploadTasks("models");
|
|
219
77
|
const { handleAction, deleteDialog } = useFileActions({
|
|
220
|
-
files:
|
|
221
|
-
setFiles:
|
|
222
|
-
buildingId,
|
|
78
|
+
files: rows,
|
|
79
|
+
setFiles: setRows,
|
|
80
|
+
buildingId: buildingId != null ? buildingId : 0,
|
|
223
81
|
handleDeleteFile,
|
|
224
|
-
onView:
|
|
82
|
+
onView: toggleVisibility,
|
|
225
83
|
shouldPersistVisibility: () => true,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
});
|
|
230
|
-
const { handleAddFile } = useCommonFileUpload({
|
|
231
|
-
buildingId,
|
|
232
|
-
acceptedFileTypes: ".ifc,.frag",
|
|
233
|
-
handleFileUpload,
|
|
234
|
-
onUploadError: (error) => {
|
|
235
|
-
console.error("Error uploading model:", error);
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
const filteredModels = React.useMemo(() => {
|
|
239
|
-
if (!query.trim()) return loadedModels;
|
|
240
|
-
return loadedModels.filter(
|
|
241
|
-
(file) => file.name.toLowerCase().includes(query.toLowerCase())
|
|
242
|
-
);
|
|
243
|
-
}, [loadedModels, query]);
|
|
244
|
-
const areAllHidden = loadedModels.every((f) => !f.isVisible);
|
|
245
|
-
const handleSwitchVariant = () => ({
|
|
246
|
-
checked: !areAllHidden,
|
|
247
|
-
onCheckedChange: (checked) => {
|
|
248
|
-
const changing = loadedModels.filter((file) => {
|
|
249
|
-
var _a;
|
|
250
|
-
return ((_a = file.isVisible) != null ? _a : false) !== checked;
|
|
251
|
-
});
|
|
252
|
-
if (changing.length === 0) return;
|
|
253
|
-
void (async () => {
|
|
254
|
-
for (const file of changing) await handleBimView(file, checked);
|
|
255
|
-
try {
|
|
256
|
-
await setVisibleMany(changing, checked);
|
|
257
|
-
} catch (error) {
|
|
258
|
-
console.error("Could not save model visibility:", error);
|
|
259
|
-
}
|
|
260
|
-
})();
|
|
84
|
+
onMove: handleMove,
|
|
85
|
+
onDelete: (file) => {
|
|
86
|
+
registry == null ? void 0 : registry.remove(String(file.id));
|
|
261
87
|
}
|
|
262
88
|
});
|
|
89
|
+
const addModel = React.useCallback(() => {
|
|
90
|
+
const input = document.createElement("input");
|
|
91
|
+
input.type = "file";
|
|
92
|
+
input.accept = ACCEPT_FOR_TYPE["3d-file"];
|
|
93
|
+
input.addEventListener("change", () => {
|
|
94
|
+
var _a3;
|
|
95
|
+
const picked = (_a3 = input.files) == null ? void 0 : _a3[0];
|
|
96
|
+
if (picked) void intake.submit(picked);
|
|
97
|
+
});
|
|
98
|
+
input.click();
|
|
99
|
+
}, [intake]);
|
|
100
|
+
const filtered = React.useMemo(() => {
|
|
101
|
+
const needle = query.trim().toLowerCase();
|
|
102
|
+
return needle ? rows.filter((file) => file.name.toLowerCase().includes(needle)) : rows;
|
|
103
|
+
}, [rows, query]);
|
|
263
104
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
264
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ jsxs(
|
|
265
106
|
CollapsibleSection,
|
|
266
|
-
{
|
|
107
|
+
__spreadProps(__spreadValues({
|
|
267
108
|
title: t("modelsTitles"),
|
|
268
|
-
icon: LR.
|
|
269
|
-
className: "
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
109
|
+
icon: LR.FileAxis3d,
|
|
110
|
+
className: "min-h-0 overflow-y-auto",
|
|
111
|
+
style: { height: "100%", minHeight: 0 },
|
|
112
|
+
itemCount: filtered.length,
|
|
113
|
+
onAddItem: addModel,
|
|
114
|
+
addItemTitle: t("addModelTitle")
|
|
115
|
+
}, chrome), {
|
|
116
|
+
children: [
|
|
117
|
+
tasks.map((task) => /* @__PURE__ */ jsx("div", { className: "px-2 py-1", children: /* @__PURE__ */ jsx(UploadProgressBar, { label: task.label, progress: task.progress }) }, task.id)),
|
|
118
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: filtered.map((file) => /* @__PURE__ */ jsx(
|
|
119
|
+
FileItemComponent,
|
|
120
|
+
{
|
|
121
|
+
file,
|
|
122
|
+
onAction: handleAction,
|
|
123
|
+
options: MODEL_OPTIONS,
|
|
124
|
+
confirmDelete: false
|
|
125
|
+
},
|
|
126
|
+
file.id
|
|
127
|
+
)) })
|
|
128
|
+
]
|
|
129
|
+
})
|
|
285
130
|
),
|
|
286
131
|
/* @__PURE__ */ jsx(
|
|
287
132
|
ConfirmDialog,
|
package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../../src/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.tsx"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport * as LR from 'lucide-react'\nimport { useTranslations } from 'next-intl'\nimport * as React from 'react'\n\nimport { useUploadFileToBuilding, useDeleteFile } from '../../../../../../../../hooks/files/files'\nimport { BimContext, BuildingsContext } from '../../../../../../../../store'\nimport ConfirmDialog from '../../../../../../../ConfirmDialog'\nimport { CollapsibleSection } from '../../../../../../../ui/CollapsibleSection'\nimport { useFileUploadHandler, useFileDeleteHandler, FileItemComponent, useFileActions, useCommonFileUpload, useFileVisibility } from '../../../../../../../ui/FilesManager'\nimport { BIMManager } from '../../../../BIMManager'\nimport { CurrentWorld } from '../../../../CurrentWorld'\nimport { GhostMode } from '../../../../GhostMode'\nimport { Highlighter } from '../../../../Highlighter'\nimport { applyModelPlacement } from '../../../../lib/applyModelPlacement'\nimport { LoadModels } from '../../../../LoadModels'\nimport { ModelManager } from '../../../../ModelManager'\nimport { PlacementEditor } from '../../../../Placement/PlacementEditor'\nimport { useModelTarget } from '../../../../Placement/targets/useModelTarget'\nimport { usePlacementSession } from '../../../../Placement/usePlacementSession'\nimport { SpatialStructure } from '../../../../SpatialStructure'\n\nimport type { DbFile as DbFile } from '../../../../../../../../types/dbTypes'\n\nconst BIM_MODEL_OPTIONS: import('../../../../../../../../types/global').FileAction[] = ['view', 'ghost', 'move', 'info', 'delete']\n\ninterface ModelsSectionProps {\n files: DbFile[]\n query?: string\n}\n\nexport function ModelsSection({ files, query = '' }: ModelsSectionProps) {\n // Translation\n const t = useTranslations('FileItemComponent')\n\n // Get BIM context\n const { state: bimState, dispatch: bimDispatch } = React.useContext(BimContext)\n const { bimComponents, fragments, modelId, modelUIState } = bimState.bim\n\n // Get Buildings context for buildingId\n const { state: buildingsState } = React.useContext(BuildingsContext)\n const { building } = buildingsState.buildings\n const buildingId = building?.id || 0\n\n // Upload file hook and session\n const { uploadFile } = useUploadFileToBuilding(buildingId)\n const { deleteFile } = useDeleteFile(buildingId)\n const { setVisibleMany } = useFileVisibility(buildingId)\n\n // Use the reusable upload handler\n const { handleFileUpload } = useFileUploadHandler({\n buildingId,\n tag: 'bim-file',\n isVisible: true,\n uploadFile,\n })\n\n // Use the reusable delete handler\n const { handleDeleteFile } = useFileDeleteHandler({\n deleteFile,\n\n })\n\n // Local state for file management with isVisible property\n const [loadedModels, setLoadedModels] = React.useState<(DbFile & { isVisible?: boolean })[]>(\n files.map(file => ({\n ...file,\n isVisible: modelUIState[file.id]?.isVisible ?? (file as any).isVisible ?? false,\n isGhost: modelUIState[file.id]?.isGhost ?? false,\n }))\n )\n\n // Keep local list in sync with incoming props and store UI state changes\n React.useEffect(() => {\n setLoadedModels(prev => {\n const prevMap = new Map(prev.map(f => [f.id, f as any]))\n return files.map(file => ({\n ...file,\n isVisible: modelUIState[file.id]?.isVisible ?? (file as any).isVisible ?? false,\n isGhost: modelUIState[file.id]?.isGhost ?? prevMap.get(file.id)?.isGhost ?? false,\n }))\n })\n }, [files, modelUIState])\n\n // Get ModelManager from BIM components\n const modelManager = React.useMemo(() => {\n if (!bimComponents) return null\n try {\n return bimComponents.get(ModelManager)\n }\n catch {\n return null\n }\n }, [bimComponents])\n\n // Get BIMManager from BIM components\n const bimManager = React.useMemo(() => {\n if (!bimComponents) return null\n try {\n return bimComponents.get(BIMManager)\n }\n catch {\n return null\n }\n }, [bimComponents])\n\n // Get GhostMode from BIM components\n const ghostMode = React.useMemo(() => {\n if (!bimComponents) return null\n try {\n return bimComponents.get(GhostMode)\n }\n catch {\n return null\n }\n }, [bimComponents])\n\n const { targetFor, clearMoving } = useModelTarget()\n\n const placementSession = usePlacementSession()\n React.useEffect(() => { if (!placementSession) clearMoving() }, [placementSession, clearMoving])\n\n // Get Highlighter from BIM components\n const highlighter = React.useMemo(() => {\n if (!bimComponents) return null\n try {\n return bimComponents.get(Highlighter)\n }\n catch {\n return null\n }\n }, [bimComponents])\n\n // Custom handlers for BIM-specific actions (view and delete only - download uses default)\n const handleBimView = React.useCallback(async (file: DbFile, newVisibility: boolean) => {\n const isGhosted = modelUIState[file.id]?.isGhost ?? false\n\n if (highlighter) {\n if (!newVisibility || isGhosted) highlighter.disableModel(file.name)\n else highlighter.enableModel(file.name)\n }\n\n // Non-fragment models (gltf/obj/fbx) managed by ModelManager\n if (modelManager) {\n const modelInfo = modelManager.getModel(file.id.toString())\n if (modelInfo) {\n modelInfo.model.visible = newVisibility\n bimDispatch({ type: 'SET_MODEL_UI_STATE', payload: { fileId: file.id, isVisible: newVisibility } })\n if (fragments) void fragments.core.update(true)\n return\n }\n }\n\n if (!bimComponents || !fragments) return\n const loadModels = bimComponents.get(LoadModels)\n\n if (!newVisibility) {\n bimDispatch({ type: 'SET_MODEL_UI_STATE', payload: { fileId: file.id, isVisible: false, isGhost: false } })\n const ghosted = isGhosted ? fragments.core.models.list.get(file.name) : undefined\n if (ghosted) ghostMode?.setModelGhost(ghosted, false)\n bimManager?.remove(file.name)\n try {\n bimComponents.get(SpatialStructure).forgetModel(file.name)\n } catch {\n // The viewer may already be tearing down; nothing to forget then.\n }\n await loadModels.unload(file.name)\n void fragments.core.update(true)\n return\n }\n\n try {\n // A toggle must not reframe the scene the way a first load does.\n loadModels.sharing = true\n const model = fragments.core.models.list.get(file.name) ?? await loadModels.load(file.url, file.name)\n if (!model) throw new Error('the model could not be loaded')\n\n applyModelPlacement(model.object, file)\n model.object.visible = true\n void fragments.core.update(true)\n bimDispatch({ type: 'SET_MODEL_UI_STATE', payload: { fileId: file.id, isVisible: true } })\n if (!isGhosted) highlighter?.enableModel(file.name)\n } catch (error) {\n console.error(`Could not show model \"${file.name}\":`, error)\n bimDispatch({ type: 'SET_MODEL_UI_STATE', payload: { fileId: file.id, isVisible: false } })\n }\n }, [bimComponents, modelManager, fragments, highlighter, ghostMode, bimManager, bimDispatch, modelUIState])\n\n const handleBimDelete = React.useCallback((file: DbFile) => {\n // Remove from ModelManager if it exists (gltf/obj/fbx models)\n if (modelManager) {\n const modelIdStr = file.id.toString()\n modelManager.remove(modelIdStr)\n }\n\n // Remove fragment model from scene if it exists (ifc/frag models)\n if (fragments) {\n const fragModel = fragments.core.models.list.get(file.name)\n if (fragModel) {\n fragments.core.disposeModel(fragModel.modelId).catch((err: unknown) => {\n console.error(`Failed to dispose fragment model \"${file.name}\":`, err)\n })\n // Also clean up BIMManager tracking\n bimManager?.remove(file.name)\n // Drop the model's spatial tree too, otherwise the sidebar keeps\n // rendering it and pushing visibility changes at a disposed model.\n try {\n bimComponents?.get(SpatialStructure).clearForModel(file.name)\n } catch {\n // The viewer may already be tearing down; nothing to clean up then.\n }\n }\n }\n }, [modelManager, bimComponents, fragments, bimManager])\n\n const handleBimMove = React.useCallback((file: DbFile) => {\n if (!bimComponents || !fragments) return\n\n const editor = bimComponents.get(PlacementEditor)\n if (editor.activeId === String(file.id)) {\n editor.accept()\n return\n }\n\n if (!fragments.core.models.list.get(file.name)) {\n console.warn(`[BimMove] Model not found: \"${file.name}\"`)\n return\n }\n\n void editor.begin(targetFor(file, () => fragments.core.models.list.get(file.name)?.object ?? null))\n }, [bimComponents, fragments, targetFor])\n\n const handleBimGhost = React.useCallback((file: DbFile, ghostState: boolean) => {\n if (!fragments || !ghostMode) return\n\n const fragModel = fragments.core.models.list.get(file.name)\n if (!fragModel) {\n console.warn(`[BimGhost] Model not found: \"${file.name}\"`)\n return\n }\n\n ghostMode.setModelGhost(fragModel, ghostState)\n bimDispatch({ type: 'SET_MODEL_UI_STATE', payload: { fileId: file.id, isGhost: ghostState } })\n\n // Disable highlighting for ghosted models; re-enable only when visible and not ghosted\n if (highlighter) {\n const isVisible = modelUIState[file.id]?.isVisible ?? true\n if (ghostState || !isVisible) {\n highlighter.disableModel(file.name)\n } else {\n highlighter.enableModel(file.name)\n }\n }\n }, [fragments, ghostMode, bimDispatch, highlighter, modelUIState])\n\n // Use the common file actions hook (no custom download handler - use default for all files)\n const { handleAction, deleteDialog } = useFileActions({\n files: loadedModels,\n setFiles: setLoadedModels,\n buildingId,\n handleDeleteFile,\n onView: handleBimView,\n shouldPersistVisibility: () => true,\n onDelete: handleBimDelete,\n onMove: handleBimMove,\n onGhost: handleBimGhost\n })\n\n // Use the common file upload hook\n const { handleAddFile } = useCommonFileUpload({\n buildingId,\n acceptedFileTypes: '.ifc,.frag',\n handleFileUpload,\n onUploadError: (error) => {\n console.error('Error uploading model:', error)\n }\n })\n\n // Filter models based on search query\n const filteredModels = React.useMemo(() => {\n if (!query.trim()) return loadedModels\n return loadedModels.filter(file =>\n file.name.toLowerCase().includes(query.toLowerCase())\n )\n }, [loadedModels, query])\n\n const areAllHidden = loadedModels.every(f => !f.isVisible)\n\n const handleSwitchVariant = () => ({\n checked: !areAllHidden,\n onCheckedChange: (checked: boolean) => {\n const changing = loadedModels.filter(file => (file.isVisible ?? false) !== checked)\n if (changing.length === 0) return\n\n void (async () => {\n for (const file of changing) await handleBimView(file, checked)\n try {\n await setVisibleMany(changing, checked)\n } catch (error) {\n console.error('Could not save model visibility:', error)\n }\n })()\n },\n })\n\n return (\n <>\n <CollapsibleSection\n title={t('modelsTitles')}\n icon={LR.Box}\n className=\"max-h-40 overflow-y-auto\"\n itemCount={filteredModels.length}\n onAddItem={handleAddFile}\n addItemTitle={t('addBimTitle')}\n switchVariant={handleSwitchVariant()}\n >\n <div className=\"space-y-1\">\n {filteredModels.map((file) => (\n <FileItemComponent\n key={file.id}\n file={file}\n onAction={handleAction}\n options={BIM_MODEL_OPTIONS}\n confirmDelete={false}\n />\n ))}\n </div>\n </CollapsibleSection>\n\n <ConfirmDialog\n isOpen={deleteDialog.isOpen}\n isDeleting={deleteDialog.isDeleting}\n onOpenChange={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AI;AACF,gBAAM,eAAe,UAAU,OAAO;AAAA,QACxC,SAAS,OAAO;AACd,kBAAQ,MAAM,oCAAoC,KAAK;AAAA,QACzD;AAAA,MACF,GAAG;AAAA,IACL;AAAA,EACF;AAEA,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,EAAE,cAAc;AAAA,QACvB,MAAM,GAAG;AAAA,QACT,WAAU;AAAA,QACV,WAAW,eAAe;AAAA,QAC1B,WAAW;AAAA,QACX,cAAc,EAAE,aAAa;AAAA,QAC7B,eAAe,oBAAoB;AAAA,QAEnC,8BAAC,SAAI,WAAU,aACZ,yBAAe,IAAI,CAAC,SACnB;AAAA,UAAC;AAAA;AAAA,YAEC;AAAA,YACA,UAAU;AAAA,YACV,SAAS;AAAA,YACT,eAAe;AAAA;AAAA,UAJV,KAAK;AAAA,QAKZ,CACD,GACH;AAAA;AAAA,IACF;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ,aAAa;AAAA,QACrB,YAAY,aAAa;AAAA,QACzB,cAAc,aAAa;AAAA,QAC3B,eAAe,aAAa;AAAA,QAC5B,UAAU,aAAa;AAAA;AAAA,IACzB;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../src/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/ModelsSection.tsx"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport * as LR from 'lucide-react'\nimport { useTranslations } from 'next-intl'\nimport * as React from 'react'\n\nimport { useDeleteFile, useUploadFileToBuilding } from '../../../../../../../../hooks/files/files'\nimport { BimContext, BuildingsContext } from '../../../../../../../../store'\nimport ConfirmDialog from '../../../../../../../ConfirmDialog'\nimport { CollapsibleSection } from '../../../../../../../ui/CollapsibleSection'\nimport { FileItemComponent, useFileActions, useFileDeleteHandler, ACCEPT_FOR_TYPE, EXTENSIONS_FOR_TYPE, UploadProgressBar, useUploadTasks } from '../../../../../../../ui/FilesManager'\nimport { useBimFileIntake } from '../../../../lib/useBimFileIntake'\nimport { BimPointClouds } from '../../../../PointClouds'\n\nimport { usePlaceableFileRows } from './usePlaceableFileRows'\n\nimport type { FileTabSectionChrome } from './sectionChrome'\nimport type { DbFile } from '../../../../../../../../types/dbTypes'\nimport type { FileAction } from '../../../../../../../../types/global'\n\nconst MODEL_OPTIONS: FileAction[] = ['download', 'view', 'move', 'info', 'delete']\n\nconst is3dFile = (extension?: string | null): boolean =>\n EXTENSIONS_FOR_TYPE['3d-file'].includes(extension?.toLowerCase() ?? '')\n\ninterface ModelsSectionProps extends FileTabSectionChrome {\n files: DbFile[]\n query?: string\n}\n\nexport function ModelsSection({ files, query = '', ...chrome }: ModelsSectionProps) {\n const t = useTranslations('FileItemComponent')\n const tFiles = useTranslations('FileSelection')\n\n const { state: bimState } = React.useContext(BimContext)\n const { bimComponents } = bimState.bim\n const { state: buildingsState } = React.useContext(BuildingsContext)\n const buildingId = buildingsState.buildings.building?.id\n\n const { uploadFile } = useUploadFileToBuilding(buildingId ?? 0)\n const { deleteFile } = useDeleteFile(buildingId)\n const { handleDeleteFile } = useFileDeleteHandler({ deleteFile })\n\n const { rows, setRows, toggleVisibility, handleMove, registry } = usePlaceableFileRows({\n files,\n buildingId,\n isPlaceable: is3dFile,\n placeHint: name => tFiles('placeHint', { name }),\n })\n\n const intake = useBimFileIntake({\n buildingId: buildingId ?? 0,\n apiBase: bimComponents?.get(BimPointClouds).apiBase ?? '',\n existingNames: files.map(file => file.name),\n uploadFile,\n })\n const tasks = useUploadTasks('models')\n\n const { handleAction, deleteDialog } = useFileActions({\n files: rows,\n setFiles: setRows,\n buildingId: buildingId ?? 0,\n handleDeleteFile,\n onView: toggleVisibility,\n shouldPersistVisibility: () => true,\n onMove: handleMove,\n onDelete: file => { registry?.remove(String(file.id)) },\n })\n\n const addModel = React.useCallback(() => {\n const input = document.createElement('input')\n input.type = 'file'\n input.accept = ACCEPT_FOR_TYPE['3d-file']\n input.addEventListener('change', () => {\n const picked = input.files?.[0]\n if (picked) void intake.submit(picked)\n })\n input.click()\n }, [intake])\n\n const filtered = React.useMemo(() => {\n const needle = query.trim().toLowerCase()\n return needle ? rows.filter(file => file.name.toLowerCase().includes(needle)) : rows\n }, [rows, query])\n\n return (\n <>\n <CollapsibleSection\n title={t('modelsTitles')}\n icon={LR.FileAxis3d}\n className=\"min-h-0 overflow-y-auto\"\n style={{ height: '100%', minHeight: 0 }}\n itemCount={filtered.length}\n onAddItem={addModel}\n addItemTitle={t('addModelTitle')}\n {...chrome}\n >\n {tasks.map(task => (\n <div key={task.id} className=\"px-2 py-1\">\n <UploadProgressBar label={task.label} progress={task.progress} />\n </div>\n ))}\n <div className=\"space-y-1\">\n {filtered.map(file => (\n <FileItemComponent\n key={file.id}\n file={file}\n onAction={handleAction}\n options={MODEL_OPTIONS}\n confirmDelete={false}\n />\n ))}\n </div>\n </CollapsibleSection>\n\n <ConfirmDialog\n isOpen={deleteDialog.isOpen}\n isDeleting={deleteDialog.isDeleting}\n onOpenChange={deleteDialog.onOpenChange}\n handleConfirm={deleteDialog.onConfirm}\n itemName={deleteDialog.itemName}\n />\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFI,mBAaQ,KAZN,YADF;AApFJ,YAAY,QAAQ;AACpB,SAAS,uBAAuB;AAChC,YAAY,WAAW;AAEvB,SAAS,eAAe,+BAA+B;AACvD,SAAS,YAAY,wBAAwB;AAC7C,OAAO,mBAAmB;AAC1B,SAAS,0BAA0B;AACnC,SAAS,mBAAmB,gBAAgB,sBAAsB,iBAAiB,qBAAqB,mBAAmB,sBAAsB;AACjJ,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAE/B,SAAS,4BAA4B;AAMrC,MAAM,gBAA8B,CAAC,YAAY,QAAQ,QAAQ,QAAQ,QAAQ;AAEjF,MAAM,WAAW,CAAC,cAAoC;AAzBtD;AA0BE,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AAAA;AAAA,QACC,QAAQ,aAAa;AAAA,QACrB,YAAY,aAAa;AAAA,QACzB,cAAc,aAAa;AAAA,QAC3B,eAAe,aAAa;AAAA,QAC5B,UAAU,aAAa;AAAA;AAAA,IACzB;AAAA,KACF;AAEJ;","names":["_a","_b"]}
|
package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { FileTabSectionChrome } from './sectionChrome';
|
|
2
3
|
import type { DbFile } from '../../../../../../../../types/dbTypes';
|
|
3
|
-
interface PointCloudsSectionProps {
|
|
4
|
+
interface PointCloudsSectionProps extends FileTabSectionChrome {
|
|
4
5
|
files: DbFile[];
|
|
5
6
|
query?: string;
|
|
6
7
|
buildingId: number;
|
|
7
8
|
}
|
|
8
|
-
export declare function PointCloudsSection({ files, query, buildingId }: PointCloudsSectionProps): React.JSX.Element;
|
|
9
|
+
export declare function PointCloudsSection({ files, query, buildingId, ...chrome }: PointCloudsSectionProps): React.JSX.Element;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=PointCloudsSection.d.ts.map
|
package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointCloudsSection.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"PointCloudsSection.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/core/components/viewers/bim/src/BimSidebar/src/FileTab/src/PointCloudsSection.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAgB9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAA;AAWnE,UAAU,uBAAwB,SAAQ,oBAAoB;IAC5D,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,KAAU,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,EAAE,uBAAuB,qBA+MvG"}
|