@collabdt/core 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/components/AppSidebarContent.d.ts.map +1 -1
- package/dist/core/components/AppSidebarContent.js +47 -43
- 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 +2 -1
- package/dist/core/components/ConfirmDialog.js.map +1 -1
- package/dist/core/components/ToolbarBody.d.ts.map +1 -1
- package/dist/core/components/ToolbarBody.js +2 -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 +5 -2
- package/dist/core/components/TopNavigationBar.js.map +1 -1
- package/dist/core/components/settings/index.js +1 -1
- package/dist/core/components/settings/index.js.map +1 -1
- package/dist/core/components/settings/src/SettingsContent.js +1 -1
- package/dist/core/components/settings/src/SettingsContent.js.map +1 -1
- package/dist/core/components/settings/src/SettingsSidebar.d.ts.map +1 -1
- package/dist/core/components/settings/src/SettingsSidebar.js +3 -10
- package/dist/core/components/settings/src/SettingsSidebar.js.map +1 -1
- package/dist/core/components/settings/src/settingsTabs.d.ts +6 -0
- package/dist/core/components/settings/src/settingsTabs.d.ts.map +1 -0
- package/dist/core/components/settings/src/settingsTabs.js +12 -0
- package/dist/core/components/settings/src/settingsTabs.js.map +1 -0
- package/dist/core/components/support/SupportMenu.d.ts +2 -1
- package/dist/core/components/support/SupportMenu.d.ts.map +1 -1
- package/dist/core/components/support/SupportMenu.js +12 -1
- package/dist/core/components/support/SupportMenu.js.map +1 -1
- package/dist/core/components/tour/GuidedTour.d.ts +5 -0
- package/dist/core/components/tour/GuidedTour.d.ts.map +1 -0
- package/dist/core/components/tour/GuidedTour.js +191 -0
- package/dist/core/components/tour/GuidedTour.js.map +1 -0
- package/dist/core/components/tour/TourBody.d.ts +8 -0
- package/dist/core/components/tour/TourBody.d.ts.map +1 -0
- package/dist/core/components/tour/TourBody.js +28 -0
- package/dist/core/components/tour/TourBody.js.map +1 -0
- package/dist/core/components/tour/TourItems.d.ts +7 -0
- package/dist/core/components/tour/TourItems.d.ts.map +1 -0
- package/dist/core/components/tour/TourItems.js +19 -0
- package/dist/core/components/tour/TourItems.js.map +1 -0
- package/dist/core/components/tour/contentBox.d.ts +4 -0
- package/dist/core/components/tour/contentBox.d.ts.map +1 -0
- package/dist/core/components/tour/contentBox.js +43 -0
- package/dist/core/components/tour/contentBox.js.map +1 -0
- package/dist/core/components/tour/hostTargets.d.ts +11 -0
- package/dist/core/components/tour/hostTargets.d.ts.map +1 -0
- package/dist/core/components/tour/hostTargets.js +24 -0
- package/dist/core/components/tour/hostTargets.js.map +1 -0
- package/dist/core/components/tour/index.d.ts +8 -0
- package/dist/core/components/tour/index.d.ts.map +1 -0
- package/dist/core/components/tour/index.js +15 -0
- package/dist/core/components/tour/index.js.map +1 -0
- package/dist/core/components/tour/placement.d.ts +24 -0
- package/dist/core/components/tour/placement.d.ts.map +1 -0
- package/dist/core/components/tour/placement.js +100 -0
- package/dist/core/components/tour/placement.js.map +1 -0
- package/dist/core/components/tour/platform/MenuPathText.d.ts +7 -0
- package/dist/core/components/tour/platform/MenuPathText.d.ts.map +1 -0
- package/dist/core/components/tour/platform/MenuPathText.js +22 -0
- package/dist/core/components/tour/platform/MenuPathText.js.map +1 -0
- package/dist/core/components/tour/platform/PlatformTour.d.ts +7 -0
- package/dist/core/components/tour/platform/PlatformTour.d.ts.map +1 -0
- package/dist/core/components/tour/platform/PlatformTour.js +57 -0
- package/dist/core/components/tour/platform/PlatformTour.js.map +1 -0
- package/dist/core/components/tour/platform/TourLegendDemo.d.ts +4 -0
- package/dist/core/components/tour/platform/TourLegendDemo.d.ts.map +1 -0
- package/dist/core/components/tour/platform/TourLegendDemo.js +26 -0
- package/dist/core/components/tour/platform/TourLegendDemo.js.map +1 -0
- package/dist/core/components/tour/platform/helloMapDemo.d.ts +13 -0
- package/dist/core/components/tour/platform/helloMapDemo.d.ts.map +1 -0
- package/dist/core/components/tour/platform/helloMapDemo.js +147 -0
- package/dist/core/components/tour/platform/helloMapDemo.js.map +1 -0
- package/dist/core/components/tour/platform/liveDemo.d.ts +10 -0
- package/dist/core/components/tour/platform/liveDemo.d.ts.map +1 -0
- package/dist/core/components/tour/platform/liveDemo.js +58 -0
- package/dist/core/components/tour/platform/liveDemo.js.map +1 -0
- package/dist/core/components/tour/platform/placeDemo.d.ts +30 -0
- package/dist/core/components/tour/platform/placeDemo.d.ts.map +1 -0
- package/dist/core/components/tour/platform/placeDemo.js +168 -0
- package/dist/core/components/tour/platform/placeDemo.js.map +1 -0
- package/dist/core/components/tour/platform/platformHost.d.ts +57 -0
- package/dist/core/components/tour/platform/platformHost.d.ts.map +1 -0
- package/dist/core/components/tour/platform/platformHost.js +290 -0
- package/dist/core/components/tour/platform/platformHost.js.map +1 -0
- package/dist/core/components/tour/platform/platformTourSteps.d.ts +50 -0
- package/dist/core/components/tour/platform/platformTourSteps.d.ts.map +1 -0
- package/dist/core/components/tour/platform/platformTourSteps.js +168 -0
- package/dist/core/components/tour/platform/platformTourSteps.js.map +1 -0
- package/dist/core/components/tour/platform/platformTourTypes.d.ts +51 -0
- package/dist/core/components/tour/platform/platformTourTypes.d.ts.map +1 -0
- package/dist/core/components/tour/platform/platformTourTypes.js +1 -0
- package/dist/core/components/tour/platform/platformTourTypes.js.map +1 -0
- package/dist/core/components/tour/platform/subTourSteps.d.ts +15 -0
- package/dist/core/components/tour/platform/subTourSteps.d.ts.map +1 -0
- package/dist/core/components/tour/platform/subTourSteps.js +482 -0
- package/dist/core/components/tour/platform/subTourSteps.js.map +1 -0
- package/dist/core/components/tour/platform/tourDemos.d.ts +8 -0
- package/dist/core/components/tour/platform/tourDemos.d.ts.map +1 -0
- package/dist/core/components/tour/platform/tourDemos.js +26 -0
- package/dist/core/components/tour/platform/tourDemos.js.map +1 -0
- package/dist/core/components/tour/platform/tourPlace.d.ts +25 -0
- package/dist/core/components/tour/platform/tourPlace.d.ts.map +1 -0
- package/dist/core/components/tour/platform/tourPlace.js +72 -0
- package/dist/core/components/tour/platform/tourPlace.js.map +1 -0
- package/dist/core/components/tour/platform/tourRoutes.d.ts +20 -0
- package/dist/core/components/tour/platform/tourRoutes.d.ts.map +1 -0
- package/dist/core/components/tour/platform/tourRoutes.js +60 -0
- package/dist/core/components/tour/platform/tourRoutes.js.map +1 -0
- package/dist/core/components/tour/platform/useDatasetPort.d.ts +4 -0
- package/dist/core/components/tour/platform/useDatasetPort.d.ts.map +1 -0
- package/dist/core/components/tour/platform/useDatasetPort.js +20 -0
- package/dist/core/components/tour/platform/useDatasetPort.js.map +1 -0
- package/dist/core/components/tour/platform/useGuideStart.d.ts +7 -0
- package/dist/core/components/tour/platform/useGuideStart.d.ts.map +1 -0
- package/dist/core/components/tour/platform/useGuideStart.js +34 -0
- package/dist/core/components/tour/platform/useGuideStart.js.map +1 -0
- package/dist/core/components/tour/platform/useMapItemPorts.d.ts +6 -0
- package/dist/core/components/tour/platform/useMapItemPorts.d.ts.map +1 -0
- package/dist/core/components/tour/platform/useMapItemPorts.js +96 -0
- package/dist/core/components/tour/platform/useMapItemPorts.js.map +1 -0
- package/dist/core/components/tour/platform/useMapStyleTour.d.ts +8 -0
- package/dist/core/components/tour/platform/useMapStyleTour.d.ts.map +1 -0
- package/dist/core/components/tour/platform/useMapStyleTour.js +42 -0
- package/dist/core/components/tour/platform/useMapStyleTour.js.map +1 -0
- package/dist/core/components/tour/platform/usePlatformTour.d.ts +15 -0
- package/dist/core/components/tour/platform/usePlatformTour.d.ts.map +1 -0
- package/dist/core/components/tour/platform/usePlatformTour.js +119 -0
- package/dist/core/components/tour/platform/usePlatformTour.js.map +1 -0
- package/dist/core/components/tour/platform/usePlatformTourActions.d.ts +4 -0
- package/dist/core/components/tour/platform/usePlatformTourActions.d.ts.map +1 -0
- package/dist/core/components/tour/platform/usePlatformTourActions.js +125 -0
- package/dist/core/components/tour/platform/usePlatformTourActions.js.map +1 -0
- package/dist/core/components/tour/platform/usePluginTourEntries.d.ts +16 -0
- package/dist/core/components/tour/platform/usePluginTourEntries.d.ts.map +1 -0
- package/dist/core/components/tour/platform/usePluginTourEntries.js +37 -0
- package/dist/core/components/tour/platform/usePluginTourEntries.js.map +1 -0
- package/dist/core/components/tour/platform/zoningDemo.d.ts +30 -0
- package/dist/core/components/tour/platform/zoningDemo.d.ts.map +1 -0
- package/dist/core/components/tour/platform/zoningDemo.js +280 -0
- package/dist/core/components/tour/platform/zoningDemo.js.map +1 -0
- package/dist/core/components/tour/tourQueue.d.ts +9 -0
- package/dist/core/components/tour/tourQueue.d.ts.map +1 -0
- package/dist/core/components/tour/tourQueue.js +43 -0
- package/dist/core/components/tour/tourQueue.js.map +1 -0
- package/dist/core/components/tour/tourStore.d.ts +15 -0
- package/dist/core/components/tour/tourStore.d.ts.map +1 -0
- package/dist/core/components/tour/tourStore.js +30 -0
- package/dist/core/components/tour/tourStore.js.map +1 -0
- package/dist/core/components/tour/tourStyles.d.ts +3 -0
- package/dist/core/components/tour/tourStyles.d.ts.map +1 -0
- package/dist/core/components/tour/tourStyles.js +95 -0
- package/dist/core/components/tour/tourStyles.js.map +1 -0
- package/dist/core/components/tour/tourTypes.d.ts +61 -0
- package/dist/core/components/tour/tourTypes.d.ts.map +1 -0
- package/dist/core/components/tour/tourTypes.js +1 -0
- package/dist/core/components/tour/tourTypes.js.map +1 -0
- package/dist/core/components/tour/useTour.d.ts +8 -0
- package/dist/core/components/tour/useTour.d.ts.map +1 -0
- package/dist/core/components/tour/useTour.js +20 -0
- package/dist/core/components/tour/useTour.js.map +1 -0
- package/dist/core/components/tour/useTourLayout.d.ts +26 -0
- package/dist/core/components/tour/useTourLayout.d.ts.map +1 -0
- package/dist/core/components/tour/useTourLayout.js +197 -0
- package/dist/core/components/tour/useTourLayout.js.map +1 -0
- package/dist/core/components/ui/AppSidebar.d.ts.map +1 -1
- package/dist/core/components/ui/AppSidebar.js +5 -3
- package/dist/core/components/ui/AppSidebar.js.map +1 -1
- package/dist/core/components/ui/CollapsibleSection.d.ts +3 -1
- package/dist/core/components/ui/CollapsibleSection.d.ts.map +1 -1
- package/dist/core/components/ui/CollapsibleSection.js +4 -2
- package/dist/core/components/ui/CollapsibleSection.js.map +1 -1
- package/dist/core/components/ui/Comments/CollapsibleCommentItem.d.ts.map +1 -1
- package/dist/core/components/ui/Comments/CollapsibleCommentItem.js +1 -0
- package/dist/core/components/ui/Comments/CollapsibleCommentItem.js.map +1 -1
- package/dist/core/components/ui/Comments/CommentActionButtons.d.ts.map +1 -1
- package/dist/core/components/ui/Comments/CommentActionButtons.js +1 -0
- package/dist/core/components/ui/Comments/CommentActionButtons.js.map +1 -1
- package/dist/core/components/ui/Comments/CommentInput.d.ts.map +1 -1
- package/dist/core/components/ui/Comments/CommentInput.js +7 -2
- package/dist/core/components/ui/Comments/CommentInput.js.map +1 -1
- package/dist/core/components/ui/Comments/CommentsSection.js +1 -1
- package/dist/core/components/ui/Comments/CommentsSection.js.map +1 -1
- package/dist/core/components/ui/Sensors/CollapsibleSensorItem.d.ts.map +1 -1
- package/dist/core/components/ui/Sensors/CollapsibleSensorItem.js +1 -0
- package/dist/core/components/ui/Sensors/CollapsibleSensorItem.js.map +1 -1
- package/dist/core/components/ui/Sensors/SensorInput.d.ts.map +1 -1
- package/dist/core/components/ui/Sensors/SensorInput.js +9 -3
- package/dist/core/components/ui/Sensors/SensorInput.js.map +1 -1
- package/dist/core/components/ui/Sensors/SensorsSection.d.ts.map +1 -1
- package/dist/core/components/ui/Sensors/SensorsSection.js +5 -2
- package/dist/core/components/ui/Sensors/SensorsSection.js.map +1 -1
- package/dist/core/components/ui/SettingsButton.js +1 -1
- package/dist/core/components/ui/SettingsButton.js.map +1 -1
- package/dist/core/components/ui/ShareFeature/ShareToolSubmenu.js +5 -5
- package/dist/core/components/ui/ShareFeature/ShareToolSubmenu.js.map +1 -1
- package/dist/core/components/ui/Sidebar.d.ts +2 -0
- package/dist/core/components/ui/Sidebar.d.ts.map +1 -1
- package/dist/core/components/ui/Sidebar.js +5 -2
- package/dist/core/components/ui/Sidebar.js.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/Panel.js +1 -1
- package/dist/core/components/ui/ViewerSidebar/Panel.js.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/SettingsSection.d.ts +3 -1
- package/dist/core/components/ui/ViewerSidebar/SettingsSection.d.ts.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/SettingsSection.js +3 -1
- package/dist/core/components/ui/ViewerSidebar/SettingsSection.js.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/Shell.d.ts.map +1 -1
- package/dist/core/components/ui/ViewerSidebar/Shell.js +2 -1
- package/dist/core/components/ui/ViewerSidebar/Shell.js.map +1 -1
- package/dist/core/components/viewers/Data/DataMenu.js +3 -3
- package/dist/core/components/viewers/Data/DataMenu.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.js +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/FileTab/index.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/LayersTab/index.js +2 -2
- 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/src/CameraSettings.js +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/CameraSettings.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/GridManagement.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/GridManagement.js +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/GridManagement.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/LightingManagement.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/LightingManagement.js +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/LightingManagement.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/MeasurementSettings.d.ts.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/MeasurementSettings.js +1 -0
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/MeasurementSettings.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.js +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/NavigationMode.js.map +1 -1
- 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 +1 -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/RenderMode.js +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/RenderMode.js.map +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/ToggleProjection.js +1 -1
- package/dist/core/components/viewers/bim/src/BimSidebar/src/SettingsTab/src/ToggleProjection.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 +3 -1
- package/dist/core/components/viewers/bim/src/ViewportGizmo.js.map +1 -1
- package/dist/core/components/viewers/map/MapViewer.d.ts.map +1 -1
- package/dist/core/components/viewers/map/MapViewer.js +3 -1
- package/dist/core/components/viewers/map/MapViewer.js.map +1 -1
- package/dist/core/components/viewers/map/datasets/DatasetManager/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/datasets/DatasetManager/index.js +3 -2
- package/dist/core/components/viewers/map/datasets/DatasetManager/index.js.map +1 -1
- package/dist/core/components/viewers/map/datasets/DatasetManager/src/DatasetLayerActions.d.ts.map +1 -1
- package/dist/core/components/viewers/map/datasets/DatasetManager/src/DatasetLayerActions.js +2 -1
- package/dist/core/components/viewers/map/datasets/DatasetManager/src/DatasetLayerActions.js.map +1 -1
- package/dist/core/components/viewers/map/datasets/DatasetManager/src/DatasetStylePanel.d.ts.map +1 -1
- package/dist/core/components/viewers/map/datasets/DatasetManager/src/DatasetStylePanel.js +1 -0
- package/dist/core/components/viewers/map/datasets/DatasetManager/src/DatasetStylePanel.js.map +1 -1
- package/dist/core/components/viewers/map/datasets/RowActions.js +1 -1
- package/dist/core/components/viewers/map/datasets/RowActions.js.map +1 -1
- package/dist/core/components/viewers/map/datasets/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/datasets/index.js +13 -12
- package/dist/core/components/viewers/map/datasets/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/FileTab/index.js +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/FileTab/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/LayersTab/index.js +2 -2
- package/dist/core/components/viewers/map/src/MapSidebar/src/LayersTab/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/BuildingVisibility.js +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/BuildingVisibility.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/LocationSettings.js +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/LocationSettings.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/MapCustomization.js +3 -3
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/MapCustomization.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/MapProjection.js +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/MapProjection.js.map +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/TerrainLevel.js +1 -1
- package/dist/core/components/viewers/map/src/MapSidebar/src/SettingsTab/src/TerrainLevel.js.map +1 -1
- package/dist/core/components/viewers/map/src/compare/index.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/compare/index.js +4 -1
- package/dist/core/components/viewers/map/src/compare/index.js.map +1 -1
- package/dist/core/components/viewers/map/src/tools/DatasetMapTool.d.ts.map +1 -1
- package/dist/core/components/viewers/map/src/tools/DatasetMapTool.js +3 -1
- package/dist/core/components/viewers/map/src/tools/DatasetMapTool.js.map +1 -1
- package/dist/core/components/viewers/map/src/tools/measureMapTool.js +2 -2
- package/dist/core/components/viewers/map/src/tools/measureMapTool.js.map +1 -1
- package/dist/core/components/viewers/plugins/PluginsManager.d.ts.map +1 -1
- package/dist/core/components/viewers/plugins/PluginsManager.js +36 -17
- package/dist/core/components/viewers/plugins/PluginsManager.js.map +1 -1
- package/dist/core/components/viewers/plugins/src/PluginDetails.d.ts +2 -1
- package/dist/core/components/viewers/plugins/src/PluginDetails.d.ts.map +1 -1
- package/dist/core/components/viewers/plugins/src/PluginDetails.js +8 -3
- package/dist/core/components/viewers/plugins/src/PluginDetails.js.map +1 -1
- package/dist/core/components/viewers/plugins/src/PluginRow.js +1 -1
- package/dist/core/components/viewers/plugins/src/PluginRow.js.map +1 -1
- package/dist/core/hooks/ui/useChangeViewer.d.ts +4 -0
- package/dist/core/hooks/ui/useChangeViewer.d.ts.map +1 -0
- package/dist/core/hooks/ui/useChangeViewer.js +22 -0
- package/dist/core/hooks/ui/useChangeViewer.js.map +1 -0
- package/dist/core/i18n/messages/en.json +965 -0
- package/dist/core/i18n/messages/es.json +965 -0
- package/dist/core/i18n/messages/fr.json +965 -0
- package/dist/core/plugins/host/runtimeShims.d.ts.map +1 -1
- package/dist/core/plugins/host/runtimeShims.js +14 -0
- package/dist/core/plugins/host/runtimeShims.js.map +1 -1
- package/dist/core/plugins/host/usePluginToolbarTools.d.ts +2 -0
- package/dist/core/plugins/host/usePluginToolbarTools.d.ts.map +1 -1
- package/dist/core/plugins/host/usePluginToolbarTools.js +1 -0
- package/dist/core/plugins/host/usePluginToolbarTools.js.map +1 -1
- package/dist/core/plugins/sdk/tour.d.ts +3 -0
- package/dist/core/plugins/sdk/tour.d.ts.map +1 -0
- package/dist/core/plugins/sdk/tour.js +22 -0
- package/dist/core/plugins/sdk/tour.js.map +1 -0
- package/package.json +1 -1
|
@@ -13,7 +13,8 @@ function SupportMenu({
|
|
|
13
13
|
item,
|
|
14
14
|
isCollapsed,
|
|
15
15
|
onOpenBug,
|
|
16
|
-
onOpenFeature
|
|
16
|
+
onOpenFeature,
|
|
17
|
+
onOpenGuide
|
|
17
18
|
}) {
|
|
18
19
|
const t = useTranslations("supportMenu");
|
|
19
20
|
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
@@ -36,6 +37,16 @@ function SupportMenu({
|
|
|
36
37
|
}
|
|
37
38
|
) }),
|
|
38
39
|
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", children: [
|
|
40
|
+
onOpenGuide && /* @__PURE__ */ jsxs(
|
|
41
|
+
DropdownMenuItem,
|
|
42
|
+
{
|
|
43
|
+
onSelect: () => openDialogAfterMenuCloses(onOpenGuide),
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx(LR.Compass, { className: "mr-2 h-4 w-4" }),
|
|
46
|
+
t("guide")
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
39
50
|
/* @__PURE__ */ jsxs(
|
|
40
51
|
DropdownMenuItem,
|
|
41
52
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/components/support/SupportMenu.tsx"],"sourcesContent":["import * as LR from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport * as React from \"react\";\n\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n} from \"../ui/DropdownMenu\";\nimport { SidebarMenuButton } from \"../ui/Sidebar\";\n\ntype Props = {\n item: any;\n isCollapsed: boolean;\n onOpenBug: () => void;\n onOpenFeature: () => void;\n};\n\nexport function SupportMenu({\n item,\n isCollapsed,\n onOpenBug,\n onOpenFeature,\n}: Props) {\n const t = useTranslations(\"supportMenu\");\n const [menuOpen, setMenuOpen] = React.useState(false);\n\n const openDialogAfterMenuCloses = (callback: () => void) => {\n setMenuOpen(false);\n\n requestAnimationFrame(() => {\n callback();\n });\n };\n\n return (\n <DropdownMenu open={menuOpen} onOpenChange={setMenuOpen}>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n title={item.tooltip}\n className={`text-xs flex items-center gap-2 w-full ${isCollapsed ? \"justify-center p-2\" : \"justify-start p-2\"\n }`}\n >\n <LR.LifeBuoy className=\"h-4 w-4\" />\n {!isCollapsed && <span>{item.title}</span>}\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onSelect={() =>\n window.open(\"https://collabdt.org/En/contact\", \"_blank\")\n }\n >\n <LR.Send className=\"mr-2 h-4 w-4\" />\n {t(\"contactTeam\")}\n </DropdownMenuItem>\n\n <DropdownMenuItem\n onSelect={() =>\n openDialogAfterMenuCloses(onOpenFeature)\n }\n >\n <LR.SquarePlus className=\"mr-2 h-4 w-4\" />\n {t(\"suggestFeature\")}\n </DropdownMenuItem>\n\n <DropdownMenuItem\n onSelect={() =>\n openDialogAfterMenuCloses(onOpenBug)\n }\n >\n <LR.Bug className=\"mr-2 h-4 w-4\" />\n {t(\"reportBug\")}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/components/support/SupportMenu.tsx"],"sourcesContent":["import * as LR from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport * as React from \"react\";\n\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n} from \"../ui/DropdownMenu\";\nimport { SidebarMenuButton } from \"../ui/Sidebar\";\n\ntype Props = {\n item: any;\n isCollapsed: boolean;\n onOpenBug: () => void;\n onOpenFeature: () => void;\n // Without it the menu has no Guide item.\n onOpenGuide?: () => void;\n};\n\nexport function SupportMenu({\n item,\n isCollapsed,\n onOpenBug,\n onOpenFeature,\n onOpenGuide,\n}: Props) {\n const t = useTranslations(\"supportMenu\");\n const [menuOpen, setMenuOpen] = React.useState(false);\n\n const openDialogAfterMenuCloses = (callback: () => void) => {\n setMenuOpen(false);\n\n requestAnimationFrame(() => {\n callback();\n });\n };\n\n return (\n <DropdownMenu open={menuOpen} onOpenChange={setMenuOpen}>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n title={item.tooltip}\n className={`text-xs flex items-center gap-2 w-full ${isCollapsed ? \"justify-center p-2\" : \"justify-start p-2\"\n }`}\n >\n <LR.LifeBuoy className=\"h-4 w-4\" />\n {!isCollapsed && <span>{item.title}</span>}\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n {onOpenGuide && (\n <DropdownMenuItem\n onSelect={() =>\n openDialogAfterMenuCloses(onOpenGuide)\n }\n >\n <LR.Compass className=\"mr-2 h-4 w-4\" />\n {t(\"guide\")}\n </DropdownMenuItem>\n )}\n\n <DropdownMenuItem\n onSelect={() =>\n window.open(\"https://collabdt.org/En/contact\", \"_blank\")\n }\n >\n <LR.Send className=\"mr-2 h-4 w-4\" />\n {t(\"contactTeam\")}\n </DropdownMenuItem>\n\n <DropdownMenuItem\n onSelect={() =>\n openDialogAfterMenuCloses(onOpenFeature)\n }\n >\n <LR.SquarePlus className=\"mr-2 h-4 w-4\" />\n {t(\"suggestFeature\")}\n </DropdownMenuItem>\n\n <DropdownMenuItem\n onSelect={() =>\n openDialogAfterMenuCloses(onOpenBug)\n }\n >\n <LR.Bug className=\"mr-2 h-4 w-4\" />\n {t(\"reportBug\")}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n"],"mappings":"AA0CQ,SAKE,KALF;AA1CR,YAAY,QAAQ;AACpB,SAAS,uBAAuB;AAChC,YAAY,WAAW;AAEvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAW3B,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAU;AACR,QAAM,IAAI,gBAAgB,aAAa;AACvC,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAAS,KAAK;AAEpD,QAAM,4BAA4B,CAAC,aAAyB;AAC1D,gBAAY,KAAK;AAEjB,0BAAsB,MAAM;AAC1B,eAAS;AAAA,IACX,CAAC;AAAA,EACH;AAEA,SACE,qBAAC,gBAAa,MAAM,UAAU,cAAc,aAC1C;AAAA,wBAAC,uBAAoB,SAAO,MAC1B;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,KAAK;AAAA,QACZ,WAAW,0CAA0C,cAAc,uBAAuB,mBACxF;AAAA,QAEF;AAAA,8BAAC,GAAG,UAAH,EAAY,WAAU,WAAU;AAAA,UAChC,CAAC,eAAe,oBAAC,UAAM,eAAK,OAAM;AAAA;AAAA;AAAA,IACrC,GACF;AAAA,IAEA,qBAAC,uBAAoB,OAAM,SACxB;AAAA,qBACC;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,MACR,0BAA0B,WAAW;AAAA,UAGvC;AAAA,gCAAC,GAAG,SAAH,EAAW,WAAU,gBAAe;AAAA,YACpC,EAAE,OAAO;AAAA;AAAA;AAAA,MACZ;AAAA,MAGF;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,MACR,OAAO,KAAK,mCAAmC,QAAQ;AAAA,UAGzD;AAAA,gCAAC,GAAG,MAAH,EAAQ,WAAU,gBAAe;AAAA,YACjC,EAAE,aAAa;AAAA;AAAA;AAAA,MAClB;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,MACR,0BAA0B,aAAa;AAAA,UAGzC;AAAA,gCAAC,GAAG,YAAH,EAAc,WAAU,gBAAe;AAAA,YACvC,EAAE,gBAAgB;AAAA;AAAA;AAAA,MACrB;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,MACR,0BAA0B,SAAS;AAAA,UAGrC;AAAA,gCAAC,GAAG,KAAH,EAAO,WAAU,gBAAe;AAAA,YAChC,EAAE,WAAW;AAAA;AAAA;AAAA,MAChB;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { GuidedTourProps } from './tourTypes';
|
|
3
|
+
/** A step-by-step guide that spotlights parts of the page while leaving it usable underneath; open tours show one at a time. */
|
|
4
|
+
export declare function GuidedTour(props: GuidedTourProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=GuidedTour.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuidedTour.d.ts","sourceRoot":"","sources":["../../../../src/core/components/tour/GuidedTour.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,OAAO,KAAK,EAAoB,eAAe,EAAY,MAAM,aAAa,CAAA;AAoG9E,gIAAgI;AAChI,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAEhD"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
"use client";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { useTranslations } from "next-intl";
|
|
22
|
+
import * as React from "react";
|
|
23
|
+
import { createPortal } from "react-dom";
|
|
24
|
+
import { placeCard, visiblePart } from "./placement";
|
|
25
|
+
import { TourBody } from "./TourBody";
|
|
26
|
+
import { TourItems } from "./TourItems";
|
|
27
|
+
import { useTourTurn } from "./tourQueue";
|
|
28
|
+
import { TOUR_CSS } from "./tourStyles";
|
|
29
|
+
import { cardWidthFor, HIDE_BUTTON_CLASS, useFinishOnClick, useLatest, useMeasuredHeight, useTourKeys, useTourLayout, useViewportSize } from "./useTourLayout";
|
|
30
|
+
const SPOT_PADDING = 6;
|
|
31
|
+
const ARROW_GAP = 10;
|
|
32
|
+
const ARROW_SIZE = { width: 44, height: 32 };
|
|
33
|
+
const FALLBACK_CARD_HEIGHT = 280;
|
|
34
|
+
const TARGET_WAIT_MS = 4e3;
|
|
35
|
+
const padded = (box) => ({
|
|
36
|
+
left: box.left - SPOT_PADDING,
|
|
37
|
+
top: box.top - SPOT_PADDING,
|
|
38
|
+
width: box.width + SPOT_PADDING * 2,
|
|
39
|
+
height: box.height + SPOT_PADDING * 2
|
|
40
|
+
});
|
|
41
|
+
const arrowBox = (spot) => __spreadValues({ left: spot.left + spot.width + ARROW_GAP, top: spot.top + spot.height / 2 - ARROW_SIZE.height / 2 }, ARROW_SIZE);
|
|
42
|
+
const settledClass = (base, settled) => settled ? `${base} is-settled` : base;
|
|
43
|
+
function useLabels(overrides) {
|
|
44
|
+
const t = useTranslations("GuidedTour");
|
|
45
|
+
return __spreadValues({
|
|
46
|
+
next: t("next"),
|
|
47
|
+
back: t("back"),
|
|
48
|
+
finish: t("finish"),
|
|
49
|
+
hide: t("hide"),
|
|
50
|
+
missing: t("missing"),
|
|
51
|
+
progress: (step, total) => t("progress", { step, total })
|
|
52
|
+
}, overrides);
|
|
53
|
+
}
|
|
54
|
+
function useIsClient() {
|
|
55
|
+
const [client, setClient] = React.useState(false);
|
|
56
|
+
React.useEffect(() => setClient(true), []);
|
|
57
|
+
return client;
|
|
58
|
+
}
|
|
59
|
+
function useStepEntry(index, onEnter) {
|
|
60
|
+
const latest = useLatest(onEnter);
|
|
61
|
+
React.useEffect(() => {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
return (_b = (_a = latest.current) == null ? void 0 : _a.call(latest)) != null ? _b : void 0;
|
|
64
|
+
}, [index, latest]);
|
|
65
|
+
}
|
|
66
|
+
function useWaitingForTarget(index, missing) {
|
|
67
|
+
const [timedOut, setTimedOut] = React.useState(false);
|
|
68
|
+
React.useEffect(() => {
|
|
69
|
+
setTimedOut(false);
|
|
70
|
+
const timer = window.setTimeout(() => setTimedOut(true), TARGET_WAIT_MS);
|
|
71
|
+
return () => window.clearTimeout(timer);
|
|
72
|
+
}, [index]);
|
|
73
|
+
return missing && !timedOut;
|
|
74
|
+
}
|
|
75
|
+
function TargetSkeleton({ label }) {
|
|
76
|
+
return /* @__PURE__ */ jsxs("div", { className: "cdt-tour-waiting", role: "status", children: [
|
|
77
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
78
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
79
|
+
/* @__PURE__ */ jsx("span", { className: "cdt-tour-sr", children: label })
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
function useFocusHandoff(ref, mounted) {
|
|
83
|
+
React.useEffect(() => {
|
|
84
|
+
var _a;
|
|
85
|
+
if (!mounted) return;
|
|
86
|
+
const previous = document.activeElement;
|
|
87
|
+
(_a = ref.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
88
|
+
return () => {
|
|
89
|
+
if (previous instanceof HTMLElement && previous.isConnected) previous.focus({ preventScroll: true });
|
|
90
|
+
};
|
|
91
|
+
}, [ref, mounted]);
|
|
92
|
+
}
|
|
93
|
+
function nextIndex(steps, from, delta) {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
for (let i = from + delta; i >= 0 && i < steps.length; i += delta) {
|
|
96
|
+
if (!((_b = (_a = steps[i]).skip) == null ? void 0 : _b.call(_a))) return i;
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
function useStepReport(stepId, onStepChange) {
|
|
101
|
+
const latest = useLatest(onStepChange);
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
var _a;
|
|
104
|
+
return (_a = latest.current) == null ? void 0 : _a.call(latest, stepId);
|
|
105
|
+
}, [stepId, latest]);
|
|
106
|
+
}
|
|
107
|
+
const HOST_PRESS_EVENTS = ["pointerdown", "mousedown", "touchstart", "touchmove", "wheel"];
|
|
108
|
+
function useHostPressShield() {
|
|
109
|
+
const [root, setRoot] = React.useState(null);
|
|
110
|
+
React.useEffect(() => {
|
|
111
|
+
if (!root) return;
|
|
112
|
+
const stop = (event) => event.stopPropagation();
|
|
113
|
+
HOST_PRESS_EVENTS.forEach((type) => root.addEventListener(type, stop, { passive: true }));
|
|
114
|
+
return () => HOST_PRESS_EVENTS.forEach((type) => root.removeEventListener(type, stop));
|
|
115
|
+
}, [root]);
|
|
116
|
+
return setRoot;
|
|
117
|
+
}
|
|
118
|
+
function GuidedTour(props) {
|
|
119
|
+
return useTourTurn() ? /* @__PURE__ */ jsx(ActiveTour, __spreadValues({}, props)) : null;
|
|
120
|
+
}
|
|
121
|
+
function ActiveTour({ steps, onHide, onFinish = onHide, onStepChange, startAt, avoid, header, labels, className }) {
|
|
122
|
+
const text = useLabels(labels);
|
|
123
|
+
const titleId = React.useId();
|
|
124
|
+
const [index, setIndex] = React.useState(() => Math.max(0, steps.findIndex((s) => s.id === startAt)));
|
|
125
|
+
const step = steps[Math.min(index, steps.length - 1)];
|
|
126
|
+
const last = nextIndex(steps, index, 1) === null;
|
|
127
|
+
const layout = useTourLayout(index, step, avoid);
|
|
128
|
+
const cardRef = React.useRef(null);
|
|
129
|
+
const nextRef = React.useRef(null);
|
|
130
|
+
const cardHeight = useMeasuredHeight(cardRef, FALLBACK_CARD_HEIGHT);
|
|
131
|
+
const client = useIsClient();
|
|
132
|
+
const viewport = useViewportSize();
|
|
133
|
+
const waiting = useWaitingForTarget(index, step.target !== null && !layout.target);
|
|
134
|
+
useStepEntry(index, step.onEnter);
|
|
135
|
+
useFocusHandoff(nextRef, client);
|
|
136
|
+
const go = React.useCallback((delta) => {
|
|
137
|
+
const next = nextIndex(steps, index, delta);
|
|
138
|
+
if (next === null) {
|
|
139
|
+
if (delta > 0) onFinish();
|
|
140
|
+
} else setIndex(next);
|
|
141
|
+
}, [steps, index, onFinish]);
|
|
142
|
+
useStepReport(step.id, onStepChange);
|
|
143
|
+
const rootRef = useHostPressShield();
|
|
144
|
+
useTourKeys(go, onHide);
|
|
145
|
+
useFinishOnClick(index, step, onHide);
|
|
146
|
+
if (!client) return null;
|
|
147
|
+
const visible = layout.target && visiblePart(layout.target, viewport);
|
|
148
|
+
const spot = visible && padded(visible);
|
|
149
|
+
const arrow = step.invite && spot ? arrowBox(spot) : null;
|
|
150
|
+
const card = placeCard(spot, { width: cardWidthFor(viewport.width), height: cardHeight }, viewport, arrow ? [...layout.avoid, arrow] : layout.avoid);
|
|
151
|
+
return createPortal(
|
|
152
|
+
/* @__PURE__ */ jsxs("div", { ref: rootRef, className: className ? `cdt-tour ${className}` : "cdt-tour", children: [
|
|
153
|
+
/* @__PURE__ */ jsx("style", { children: TOUR_CSS }),
|
|
154
|
+
spot ? /* @__PURE__ */ jsx("div", { className: settledClass("cdt-tour-spot", layout.settled), style: spot }) : /* @__PURE__ */ jsx("div", { className: "cdt-tour-scrim" }),
|
|
155
|
+
spot && /* @__PURE__ */ jsx("div", { className: settledClass("cdt-tour-ring", layout.settled), style: spot }),
|
|
156
|
+
arrow && /* @__PURE__ */ jsx("div", { className: settledClass("cdt-tour-arrow", layout.settled), style: arrow, "aria-hidden": true, children: "\u2190" }),
|
|
157
|
+
/* @__PURE__ */ jsxs("button", { type: "button", className: HIDE_BUTTON_CLASS, onClick: onHide, children: [
|
|
158
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xD7" }),
|
|
159
|
+
text.hide
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ jsxs("div", { ref: cardRef, className: settledClass("cdt-tour-card", layout.settled), role: "dialog", "aria-modal": "false", "aria-labelledby": titleId, style: { left: card.left, top: card.top, maxHeight: card.maxHeight }, children: [
|
|
162
|
+
/* @__PURE__ */ jsxs("header", { children: [
|
|
163
|
+
header,
|
|
164
|
+
step.shortcut && /* @__PURE__ */ jsxs("button", { type: "button", className: "cdt-tour-shortcut", onClick: step.shortcut.onSelect, children: [
|
|
165
|
+
step.shortcut.label,
|
|
166
|
+
" \u203A"
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ jsx("small", { children: text.progress(index + 1, steps.length) })
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ jsxs("div", { className: "cdt-tour-body", "aria-live": "polite", children: [
|
|
171
|
+
/* @__PURE__ */ jsx("h3", { id: titleId, children: step.title }),
|
|
172
|
+
/* @__PURE__ */ jsx(TourBody, { body: step.body }),
|
|
173
|
+
step.items && /* @__PURE__ */ jsx(TourItems, { items: step.items }),
|
|
174
|
+
waiting && /* @__PURE__ */ jsx(TargetSkeleton, { label: text.missing })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ jsxs("footer", { children: [
|
|
177
|
+
/* @__PURE__ */ jsx("div", { className: "cdt-tour-dots", children: steps.map((s, i) => /* @__PURE__ */ jsx("button", { type: "button", "aria-label": s.title, "aria-current": i === index ? "step" : void 0, onClick: () => setIndex(i) }, s.id)) }),
|
|
178
|
+
/* @__PURE__ */ jsxs("div", { className: "cdt-tour-actions", children: [
|
|
179
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "cdt-tour-back", disabled: index === 0, onClick: () => go(-1), children: text.back }),
|
|
180
|
+
/* @__PURE__ */ jsx("button", { ref: nextRef, type: "button", className: "cdt-tour-next", onClick: () => go(1), children: last ? text.finish : text.next })
|
|
181
|
+
] })
|
|
182
|
+
] })
|
|
183
|
+
] })
|
|
184
|
+
] }),
|
|
185
|
+
document.body
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
export {
|
|
189
|
+
GuidedTour
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=GuidedTour.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/components/tour/GuidedTour.tsx"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport { useTranslations } from 'next-intl'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { placeCard, visiblePart } from './placement'\nimport { TourBody } from './TourBody'\nimport { TourItems } from './TourItems'\nimport { useTourTurn } from './tourQueue'\nimport { TOUR_CSS } from './tourStyles'\nimport { cardWidthFor, HIDE_BUTTON_CLASS, useFinishOnClick, useLatest, useMeasuredHeight, useTourKeys, useTourLayout, useViewportSize } from './useTourLayout'\n\nimport type { Box } from './placement'\nimport type { GuidedTourLabels, GuidedTourProps, TourStep } from './tourTypes'\n\nconst SPOT_PADDING = 6\nconst ARROW_GAP = 10\nconst ARROW_SIZE = { width: 44, height: 32 }\nconst FALLBACK_CARD_HEIGHT = 280\nconst TARGET_WAIT_MS = 4000\n\nconst padded = (box: Box): Box => ({\n left: box.left - SPOT_PADDING, top: box.top - SPOT_PADDING,\n width: box.width + SPOT_PADDING * 2, height: box.height + SPOT_PADDING * 2,\n})\n\nconst arrowBox = (spot: Box): Box => ({ left: spot.left + spot.width + ARROW_GAP, top: spot.top + spot.height / 2 - ARROW_SIZE.height / 2, ...ARROW_SIZE })\n\nconst settledClass = (base: string, settled: boolean) => (settled ? `${base} is-settled` : base)\n\nfunction useLabels(overrides: Partial<GuidedTourLabels> | undefined): GuidedTourLabels {\n const t = useTranslations('GuidedTour')\n return {\n next: t('next'),\n back: t('back'),\n finish: t('finish'),\n hide: t('hide'),\n missing: t('missing'),\n progress: (step, total) => t('progress', { step, total }),\n ...overrides,\n }\n}\n\nfunction useIsClient() {\n const [client, setClient] = React.useState(false)\n React.useEffect(() => setClient(true), [])\n return client\n}\n\nfunction useStepEntry(index: number, onEnter: TourStep['onEnter']) {\n const latest = useLatest(onEnter)\n React.useEffect(() => latest.current?.() ?? undefined, [index, latest])\n}\n\n/** Whether the step is still worth waiting on for its target, which can mount late; resets on every step. */\nfunction useWaitingForTarget(index: number, missing: boolean): boolean {\n const [timedOut, setTimedOut] = React.useState(false)\n React.useEffect(() => {\n setTimedOut(false)\n const timer = window.setTimeout(() => setTimedOut(true), TARGET_WAIT_MS)\n return () => window.clearTimeout(timer)\n }, [index])\n return missing && !timedOut\n}\n\nfunction TargetSkeleton({ label }: { label: string }) {\n return (\n <div className=\"cdt-tour-waiting\" role=\"status\">\n <span /><span />\n <span className=\"cdt-tour-sr\">{label}</span>\n </div>\n )\n}\n\n/** Focuses `ref` on open and hands focus back to whatever had it when the tour closes. */\nfunction useFocusHandoff(ref: React.RefObject<HTMLElement | null>, mounted: boolean) {\n React.useEffect(() => {\n if (!mounted) return\n const previous = document.activeElement\n ref.current?.focus({ preventScroll: true })\n return () => {\n if (previous instanceof HTMLElement && previous.isConnected) previous.focus({ preventScroll: true })\n }\n }, [ref, mounted])\n}\n\n/** The next step in `delta`'s direction that does not ask to be skipped, or null past either end. */\nfunction nextIndex(steps: TourStep[], from: number, delta: number): number | null {\n for (let i = from + delta; i >= 0 && i < steps.length; i += delta) {\n if (!steps[i].skip?.()) return i\n }\n return null\n}\n\nfunction useStepReport(stepId: string, onStepChange: GuidedTourProps['onStepChange']) {\n const latest = useLatest(onStepChange)\n React.useEffect(() => latest.current?.(stepId), [stepId, latest])\n}\n\nconst HOST_PRESS_EVENTS = ['pointerdown', 'mousedown', 'touchstart', 'touchmove', 'wheel'] as const\n\n// Radix menus close on presses that reach `document`, and modal dialogs block scrolls there.\nfunction useHostPressShield() {\n const [root, setRoot] = React.useState<HTMLDivElement | null>(null)\n React.useEffect(() => {\n if (!root) return\n const stop = (event: Event) => event.stopPropagation()\n HOST_PRESS_EVENTS.forEach(type => root.addEventListener(type, stop, { passive: true }))\n return () => HOST_PRESS_EVENTS.forEach(type => root.removeEventListener(type, stop))\n }, [root])\n return setRoot\n}\n\n/** A step-by-step guide that spotlights parts of the page while leaving it usable underneath; open tours show one at a time. */\nexport function GuidedTour(props: GuidedTourProps) {\n return useTourTurn() ? <ActiveTour {...props} /> : null\n}\n\nfunction ActiveTour({ steps, onHide, onFinish = onHide, onStepChange, startAt, avoid, header, labels, className }: GuidedTourProps) {\n const text = useLabels(labels)\n const titleId = React.useId()\n const [index, setIndex] = React.useState(() => Math.max(0, steps.findIndex(s => s.id === startAt)))\n const step = steps[Math.min(index, steps.length - 1)]\n const last = nextIndex(steps, index, 1) === null\n const layout = useTourLayout(index, step, avoid)\n const cardRef = React.useRef<HTMLDivElement>(null)\n const nextRef = React.useRef<HTMLButtonElement>(null)\n const cardHeight = useMeasuredHeight(cardRef, FALLBACK_CARD_HEIGHT)\n const client = useIsClient()\n const viewport = useViewportSize()\n\n const waiting = useWaitingForTarget(index, step.target !== null && !layout.target)\n useStepEntry(index, step.onEnter)\n useFocusHandoff(nextRef, client)\n\n const go = React.useCallback((delta: number) => {\n const next = nextIndex(steps, index, delta)\n if (next === null) {\n if (delta > 0) onFinish()\n } else setIndex(next)\n }, [steps, index, onFinish])\n useStepReport(step.id, onStepChange)\n const rootRef = useHostPressShield()\n useTourKeys(go, onHide)\n useFinishOnClick(index, step, onHide)\n\n if (!client) return null\n\n const visible = layout.target && visiblePart(layout.target, viewport)\n const spot = visible && padded(visible)\n const arrow = step.invite && spot ? arrowBox(spot) : null\n const card = placeCard(spot, { width: cardWidthFor(viewport.width), height: cardHeight }, viewport, arrow ? [...layout.avoid, arrow] : layout.avoid)\n\n return createPortal(\n <div ref={rootRef} className={className ? `cdt-tour ${className}` : 'cdt-tour'}>\n <style>{TOUR_CSS}</style>\n {spot ? <div className={settledClass('cdt-tour-spot', layout.settled)} style={spot} /> : <div className=\"cdt-tour-scrim\" />}\n {spot && <div className={settledClass('cdt-tour-ring', layout.settled)} style={spot} />}\n {arrow && <div className={settledClass('cdt-tour-arrow', layout.settled)} style={arrow} aria-hidden>←</div>}\n\n <button type=\"button\" className={HIDE_BUTTON_CLASS} onClick={onHide}>\n <span aria-hidden>×</span>{text.hide}\n </button>\n\n <div ref={cardRef} className={settledClass('cdt-tour-card', layout.settled)} role=\"dialog\" aria-modal=\"false\" aria-labelledby={titleId} style={{ left: card.left, top: card.top, maxHeight: card.maxHeight }}>\n <header>\n {header}\n {step.shortcut && <button type=\"button\" className=\"cdt-tour-shortcut\" onClick={step.shortcut.onSelect}>{step.shortcut.label} ›</button>}\n <small>{text.progress(index + 1, steps.length)}</small>\n </header>\n <div className=\"cdt-tour-body\" aria-live=\"polite\">\n <h3 id={titleId}>{step.title}</h3>\n <TourBody body={step.body} />\n {step.items && <TourItems items={step.items} />}\n {waiting && <TargetSkeleton label={text.missing} />}\n </div>\n <footer>\n <div className=\"cdt-tour-dots\">\n {steps.map((s, i) => (\n <button key={s.id} type=\"button\" aria-label={s.title} aria-current={i === index ? 'step' : undefined} onClick={() => setIndex(i)} />\n ))}\n </div>\n <div className=\"cdt-tour-actions\">\n <button type=\"button\" className=\"cdt-tour-back\" disabled={index === 0} onClick={() => go(-1)}>{text.back}</button>\n <button ref={nextRef} type=\"button\" className=\"cdt-tour-next\" onClick={() => go(1)}>{last ? text.finish : text.next}</button>\n </div>\n </footer>\n </div>\n </div>,\n document.body,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAuEI,SACE,KADF;AAlEJ,SAAS,uBAAuB;AAChC,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAE7B,SAAS,WAAW,mBAAmB;AACvC,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,cAAc,mBAAmB,kBAAkB,WAAW,mBAAmB,aAAa,eAAe,uBAAuB;AAK7I,MAAM,eAAe;AACrB,MAAM,YAAY;AAClB,MAAM,aAAa,EAAE,OAAO,IAAI,QAAQ,GAAG;AAC3C,MAAM,uBAAuB;AAC7B,MAAM,iBAAiB;AAEvB,MAAM,SAAS,CAAC,SAAmB;AAAA,EACjC,MAAM,IAAI,OAAO;AAAA,EAAc,KAAK,IAAI,MAAM;AAAA,EAC9C,OAAO,IAAI,QAAQ,eAAe;AAAA,EAAG,QAAQ,IAAI,SAAS,eAAe;AAC3E;AAEA,MAAM,WAAW,CAAC,SAAoB,iBAAE,MAAM,KAAK,OAAO,KAAK,QAAQ,WAAW,KAAK,KAAK,MAAM,KAAK,SAAS,IAAI,WAAW,SAAS,KAAM;AAE9I,MAAM,eAAe,CAAC,MAAc,YAAsB,UAAU,GAAG,IAAI,gBAAgB;AAE3F,SAAS,UAAU,WAAoE;AACrF,QAAM,IAAI,gBAAgB,YAAY;AACtC,SAAO;AAAA,IACL,MAAM,EAAE,MAAM;AAAA,IACd,MAAM,EAAE,MAAM;AAAA,IACd,QAAQ,EAAE,QAAQ;AAAA,IAClB,MAAM,EAAE,MAAM;AAAA,IACd,SAAS,EAAE,SAAS;AAAA,IACpB,UAAU,CAAC,MAAM,UAAU,EAAE,Y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AI,WAAU,oBACb;AAAA,gCAAC,YAAO,MAAK,UAAS,WAAU,iBAAgB,UAAU,UAAU,GAAG,SAAS,MAAM,GAAG,EAAE,GAAI,eAAK,MAAK;AAAA,YACzG,oBAAC,YAAO,KAAK,SAAS,MAAK,UAAS,WAAU,iBAAgB,SAAS,MAAM,GAAG,CAAC,GAAI,iBAAO,KAAK,SAAS,KAAK,MAAK;AAAA,aACtH;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,IACA,SAAS;AAAA,EACX;AACF;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Splits a `term — description` line so the term can be set in bold; other lines have no term. */
|
|
3
|
+
export declare function splitTerm(line: string): [string | null, string];
|
|
4
|
+
/** A step's body: strings become paragraphs and definition lists, anything else renders as given. */
|
|
5
|
+
export declare function TourBody({ body }: {
|
|
6
|
+
body: React.ReactNode;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
//# sourceMappingURL=TourBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TourBody.d.ts","sourceRoot":"","sources":["../../../../src/core/components/tour/TourBody.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,mGAAmG;AACnG,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,CAG/D;AAgBD,qGAAqG;AACrG,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAS3D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function splitTerm(line) {
|
|
3
|
+
const at = line.indexOf(" \u2014 ");
|
|
4
|
+
return at > 0 ? [line.slice(0, at), line.slice(at + 3)] : [null, line];
|
|
5
|
+
}
|
|
6
|
+
function toBlocks(text) {
|
|
7
|
+
const blocks = [];
|
|
8
|
+
for (const line of text.split("\n")) {
|
|
9
|
+
const [term, description] = splitTerm(line);
|
|
10
|
+
const last = blocks[blocks.length - 1];
|
|
11
|
+
if (term === null) blocks.push(description);
|
|
12
|
+
else if (Array.isArray(last)) last.push([term, description]);
|
|
13
|
+
else blocks.push([[term, description]]);
|
|
14
|
+
}
|
|
15
|
+
return blocks;
|
|
16
|
+
}
|
|
17
|
+
function TourBody({ body }) {
|
|
18
|
+
if (typeof body !== "string") return /* @__PURE__ */ jsx(Fragment, { children: body });
|
|
19
|
+
return /* @__PURE__ */ jsx(Fragment, { children: toBlocks(body).map((block, i) => typeof block === "string" ? /* @__PURE__ */ jsx("p", { children: block }, i) : /* @__PURE__ */ jsx("dl", { children: block.map(([term, description]) => /* @__PURE__ */ jsxs("div", { children: [
|
|
20
|
+
/* @__PURE__ */ jsx("dt", { children: term }),
|
|
21
|
+
/* @__PURE__ */ jsx("dd", { children: description })
|
|
22
|
+
] }, term)) }, i)) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
TourBody,
|
|
26
|
+
splitTerm
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=TourBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/components/tour/TourBody.tsx"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport * as React from 'react'\n\n/** Splits a `term — description` line so the term can be set in bold; other lines have no term. */\nexport function splitTerm(line: string): [string | null, string] {\n const at = line.indexOf(' — ')\n return at > 0 ? [line.slice(0, at), line.slice(at + 3)] : [null, line]\n}\n\ntype Block = string | [string, string][]\n\nfunction toBlocks(text: string): Block[] {\n const blocks: Block[] = []\n for (const line of text.split('\\n')) {\n const [term, description] = splitTerm(line)\n const last = blocks[blocks.length - 1]\n if (term === null) blocks.push(description)\n else if (Array.isArray(last)) last.push([term, description])\n else blocks.push([[term, description]])\n }\n return blocks\n}\n\n/** A step's body: strings become paragraphs and definition lists, anything else renders as given. */\nexport function TourBody({ body }: { body: React.ReactNode }) {\n if (typeof body !== 'string') return <>{body}</>\n return (\n <>\n {toBlocks(body).map((block, i) => (typeof block === 'string'\n ? <p key={i}>{block}</p>\n : <dl key={i}>{block.map(([term, description]) => <div key={term}><dt>{term}</dt><dd>{description}</dd></div>)}</dl>))}\n </>\n )\n}\n"],"mappings":"AA2BuC,wBAKmB,YALnB;AArBhC,SAAS,UAAU,MAAuC;AAC/D,QAAM,KAAK,KAAK,QAAQ,UAAK;AAC7B,SAAO,KAAK,IAAI,CAAC,KAAK,MAAM,GAAG,EAAE,GAAG,KAAK,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI;AACvE;AAIA,SAAS,SAAS,MAAuB;AACvC,QAAM,SAAkB,CAAC;AACzB,aAAW,QAAQ,KAAK,MAAM,IAAI,GAAG;AACnC,UAAM,CAAC,MAAM,WAAW,IAAI,UAAU,IAAI;AAC1C,UAAM,OAAO,OAAO,OAAO,SAAS,CAAC;AACrC,QAAI,SAAS,KAAM,QAAO,KAAK,WAAW;AAAA,aACjC,MAAM,QAAQ,IAAI,EAAG,MAAK,KAAK,CAAC,MAAM,WAAW,CAAC;AAAA,QACtD,QAAO,KAAK,CAAC,CAAC,MAAM,WAAW,CAAC,CAAC;AAAA,EACxC;AACA,SAAO;AACT;AAGO,SAAS,SAAS,EAAE,KAAK,GAA8B;AAC5D,MAAI,OAAO,SAAS,SAAU,QAAO,gCAAG,gBAAK;AAC7C,SACE,gCACG,mBAAS,IAAI,EAAE,IAAI,CAAC,OAAO,MAAO,OAAO,UAAU,WAChD,oBAAC,OAAW,mBAAJ,CAAU,IAClB,oBAAC,QAAY,gBAAM,IAAI,CAAC,CAAC,MAAM,WAAW,MAAM,qBAAC,SAAe;AAAA,wBAAC,QAAI,gBAAK;AAAA,IAAK,oBAAC,QAAI,uBAAY;AAAA,OAAtC,IAA2C,CAAM,KAAlG,CAAoG,CAAM,GACzH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { TourItem } from './tourTypes';
|
|
3
|
+
/** A step's items as icon rows; rows with `onSelect` are buttons. */
|
|
4
|
+
export declare function TourItems({ items }: {
|
|
5
|
+
items: TourItem[];
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=TourItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TourItems.d.ts","sourceRoot":"","sources":["../../../../src/core/components/tour/TourItems.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAgB3C,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,qBAYzD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function ItemContent({ item }) {
|
|
3
|
+
const Icon = item.icon;
|
|
4
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5
|
+
/* @__PURE__ */ jsx("span", { className: "cdt-tour-item-icon", "aria-hidden": true, children: Icon && /* @__PURE__ */ jsx(Icon, {}) }),
|
|
6
|
+
/* @__PURE__ */ jsxs("span", { className: "cdt-tour-item-text", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("strong", { children: item.term }),
|
|
8
|
+
/* @__PURE__ */ jsx("span", { children: item.description })
|
|
9
|
+
] }),
|
|
10
|
+
item.onSelect && /* @__PURE__ */ jsx("span", { className: "cdt-tour-item-go", "aria-hidden": true, children: "\u203A" })
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
function TourItems({ items }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("ul", { className: "cdt-tour-items", children: items.map((item) => /* @__PURE__ */ jsx("li", { children: item.onSelect ? /* @__PURE__ */ jsx("button", { type: "button", className: "cdt-tour-item", onClick: item.onSelect, children: /* @__PURE__ */ jsx(ItemContent, { item }) }) : /* @__PURE__ */ jsx("div", { className: "cdt-tour-item", children: /* @__PURE__ */ jsx(ItemContent, { item }) }) }, item.id)) });
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
TourItems
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=TourItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/components/tour/TourItems.tsx"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport * as React from 'react'\n\nimport type { TourItem } from './tourTypes'\n\nfunction ItemContent({ item }: { item: TourItem }) {\n const Icon = item.icon\n return (\n <>\n <span className=\"cdt-tour-item-icon\" aria-hidden>{Icon && <Icon />}</span>\n <span className=\"cdt-tour-item-text\">\n <strong>{item.term}</strong>\n <span>{item.description}</span>\n </span>\n {item.onSelect && <span className=\"cdt-tour-item-go\" aria-hidden>›</span>}\n </>\n )\n}\n\n/** A step's items as icon rows; rows with `onSelect` are buttons. */\nexport function TourItems({ items }: { items: TourItem[] }) {\n return (\n <ul className=\"cdt-tour-items\">\n {items.map(item => (\n <li key={item.id}>\n {item.onSelect\n ? <button type=\"button\" className=\"cdt-tour-item\" onClick={item.onSelect}><ItemContent item={item} /></button>\n : <div className=\"cdt-tour-item\"><ItemContent item={item} /></div>}\n </li>\n ))}\n </ul>\n )\n}\n"],"mappings":"AAUI,mBAC4D,KAC1D,YAFF;AAHJ,SAAS,YAAY,EAAE,KAAK,GAAuB;AACjD,QAAM,OAAO,KAAK;AAClB,SACE,iCACE;AAAA,wBAAC,UAAK,WAAU,sBAAqB,eAAW,MAAE,kBAAQ,oBAAC,QAAK,GAAG;AAAA,IACnE,qBAAC,UAAK,WAAU,sBACd;AAAA,0BAAC,YAAQ,eAAK,MAAK;AAAA,MACnB,oBAAC,UAAM,eAAK,aAAY;AAAA,OAC1B;AAAA,IACC,KAAK,YAAY,oBAAC,UAAK,WAAU,oBAAmB,eAAW,MAAC,oBAAC;AAAA,KACpE;AAEJ;AAGO,SAAS,UAAU,EAAE,MAAM,GAA0B;AAC1D,SACE,oBAAC,QAAG,WAAU,kBACX,gBAAM,IAAI,UACT,oBAAC,QACE,eAAK,WACF,oBAAC,YAAO,MAAK,UAAS,WAAU,iBAAgB,SAAS,KAAK,UAAU,8BAAC,eAAY,MAAY,GAAE,IACnG,oBAAC,SAAI,WAAU,iBAAgB,8BAAC,eAAY,MAAY,GAAE,KAHvD,KAAK,EAId,CACD,GACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contentBox.d.ts","sourceRoot":"","sources":["../../../../src/core/components/tour/contentBox.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAwCtC,sHAAsH;AACtH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,GAAG,IAAI,CAKvD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { intersect } from "./placement";
|
|
2
|
+
const MEDIA = "svg, img, canvas, video, input, select, textarea";
|
|
3
|
+
const MIN_SIDE = 2;
|
|
4
|
+
const toBox = ({ left, top, width, height }) => ({ left, top, width, height });
|
|
5
|
+
const visible = (box) => box.width >= MIN_SIDE && box.height >= MIN_SIDE;
|
|
6
|
+
function union(boxes) {
|
|
7
|
+
if (boxes.length === 0) return null;
|
|
8
|
+
const left = Math.min(...boxes.map((b) => b.left));
|
|
9
|
+
const top = Math.min(...boxes.map((b) => b.top));
|
|
10
|
+
const right = Math.max(...boxes.map((b) => b.left + b.width));
|
|
11
|
+
const bottom = Math.max(...boxes.map((b) => b.top + b.height));
|
|
12
|
+
return { left, top, width: right - left, height: bottom - top };
|
|
13
|
+
}
|
|
14
|
+
function drawn(node, root) {
|
|
15
|
+
for (let current = node; current; current = current === root ? null : current.parentElement) {
|
|
16
|
+
const style = getComputedStyle(current);
|
|
17
|
+
if (style.opacity === "0" || style.visibility === "hidden") return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
function textBoxes(element) {
|
|
22
|
+
var _a;
|
|
23
|
+
const range = element.ownerDocument.createRange();
|
|
24
|
+
if (typeof range.getBoundingClientRect !== "function") return [];
|
|
25
|
+
const walker = element.ownerDocument.createTreeWalker(element, NodeFilter.SHOW_TEXT);
|
|
26
|
+
const boxes = [];
|
|
27
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
28
|
+
if (!((_a = node.textContent) == null ? void 0 : _a.trim()) || !drawn(node.parentElement, element)) continue;
|
|
29
|
+
range.selectNodeContents(node);
|
|
30
|
+
boxes.push(toBox(range.getBoundingClientRect()));
|
|
31
|
+
}
|
|
32
|
+
return boxes;
|
|
33
|
+
}
|
|
34
|
+
function contentBox(element) {
|
|
35
|
+
const own = toBox(element.getBoundingClientRect());
|
|
36
|
+
const media = [...element.matches(MEDIA) ? [element] : [], ...element.querySelectorAll(MEDIA)].filter((m) => drawn(m, element));
|
|
37
|
+
const boxes = [...media.map((m) => toBox(m.getBoundingClientRect())), ...textBoxes(element)];
|
|
38
|
+
return union(boxes.map((box) => intersect(box, own)).filter((box) => box !== null && visible(box)));
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
contentBox
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=contentBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/components/tour/contentBox.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport { intersect } from './placement'\n\nimport type { Box } from './placement'\n\nconst MEDIA = 'svg, img, canvas, video, input, select, textarea'\nconst MIN_SIDE = 2\n\nconst toBox = ({ left, top, width, height }: DOMRect): Box => ({ left, top, width, height })\n\nconst visible = (box: Box) => box.width >= MIN_SIDE && box.height >= MIN_SIDE\n\nfunction union(boxes: Box[]): Box | null {\n if (boxes.length === 0) return null\n const left = Math.min(...boxes.map(b => b.left))\n const top = Math.min(...boxes.map(b => b.top))\n const right = Math.max(...boxes.map(b => b.left + b.width))\n const bottom = Math.max(...boxes.map(b => b.top + b.height))\n return { left, top, width: right - left, height: bottom - top }\n}\n\n/** Opacity 0 and `visibility: hidden` keep their layout box, as a collapsed sidebar's group labels do. */\nfunction drawn(node: Element | null, root: Element): boolean {\n for (let current = node; current; current = current === root ? null : current.parentElement) {\n const style = getComputedStyle(current)\n if (style.opacity === '0' || style.visibility === 'hidden') return false\n }\n return true\n}\n\nfunction textBoxes(element: Element): Box[] {\n const range = element.ownerDocument.createRange()\n if (typeof range.getBoundingClientRect !== 'function') return []\n const walker = element.ownerDocument.createTreeWalker(element, NodeFilter.SHOW_TEXT)\n const boxes: Box[] = []\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n if (!node.textContent?.trim() || !drawn(node.parentElement, element)) continue\n range.selectNodeContents(node)\n boxes.push(toBox(range.getBoundingClientRect()))\n }\n return boxes\n}\n\n/** The box around what `element` visibly draws (icons, text, fields), which can sit off-centre in a padded button. */\nexport function contentBox(element: Element): Box | null {\n const own = toBox(element.getBoundingClientRect())\n const media = [...(element.matches(MEDIA) ? [element] : []), ...element.querySelectorAll(MEDIA)].filter(m => drawn(m, element))\n const boxes = [...media.map(m => toBox(m.getBoundingClientRect())), ...textBoxes(element)]\n return union(boxes.map(box => intersect(box, own)).filter((box): box is Box => box !== null && visible(box)))\n}\n"],"mappings":"AAGA,SAAS,iBAAiB;AAI1B,MAAM,QAAQ;AACd,MAAM,WAAW;AAEjB,MAAM,QAAQ,CAAC,EAAE,MAAM,KAAK,OAAO,OAAO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T;AAGO,SAAS,WAAW,SAA8B;AACvD,QAAM,MAAM,MAAM,QAAQ,sBAAsB,CAAC;AACjD,QAAM,QAAQ,CAAC,GAAI,QAAQ,QAAQ,KAAK,IAAI,CAAC,OAAO,IAAI,CAAC,GAAI,GAAG,QAAQ,iBAAiB,KAAK,CAAC,EAAE,OAAO,OAAK,MAAM,GAAG,OAAO,CAAC;AAC9H,QAAM,QAAQ,CAAC,GAAG,MAAM,IAAI,OAAK,MAAM,EAAE,sBAAsB,CAAC,CAAC,GAAG,GAAG,UAAU,OAAO,CAAC;AACzF,SAAO,MAAM,MAAM,IAAI,SAAO,UAAU,KAAK,GAAG,CAAC,EAAE,OAAO,CAAC,QAAoB,QAAQ,QAAQ,QAAQ,GAAG,CAAC,CAAC;AAC9G;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The selector for `data-tour="<name>"`, with quotes and backslashes in the name escaped. */
|
|
2
|
+
export declare const anchorSelector: (name: string) => string;
|
|
3
|
+
/** The element marked `data-tour="<name>"`, or null. */
|
|
4
|
+
export declare const findAnchor: <T extends HTMLElement = HTMLElement>(name: string, root?: ParentNode) => T;
|
|
5
|
+
type Lookup = Pick<Document, 'querySelectorAll' | 'getElementById'>;
|
|
6
|
+
/** The app sidebar's button for a page, matched on its title, which stays in the text while the sidebar is collapsed. */
|
|
7
|
+
export declare function findSidebarPageLink(title: string, lookup?: Pick<Document, 'querySelectorAll'>): HTMLElement | null;
|
|
8
|
+
/** Opens or closes the toolbar dropdown holding `element` by clicking the toggle that controls it. */
|
|
9
|
+
export declare function setToolbarPanel(element: Element | null, open: boolean, lookup?: Lookup): void;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=hostTargets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostTargets.d.ts","sourceRoot":"","sources":["../../../../src/core/components/tour/hostTargets.ts"],"names":[],"mappings":"AAGA,8FAA8F;AAC9F,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,WAAsD,CAAA;AAEjG,wDAAwD;AACxD,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,MAAM,MAAM,EAAE,OAAM,UAAqB,MAC5D,CAAA;AAE7C,KAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,kBAAkB,GAAG,gBAAgB,CAAC,CAAA;AAEnE,yHAAyH;AACzH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAY,GAAG,WAAW,GAAG,IAAI,CAG5H;AAED,sGAAsG;AACtG,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAE,MAAiB,GAAG,IAAI,CAKvG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const anchorSelector = (name) => `[data-tour="${name.replace(/["\\]/g, "\\$&")}"]`;
|
|
2
|
+
const findAnchor = (name, root = document) => root.querySelector(anchorSelector(name));
|
|
3
|
+
function findSidebarPageLink(title, lookup = document) {
|
|
4
|
+
var _a;
|
|
5
|
+
return (_a = Array.from(lookup.querySelectorAll('[data-sidebar="menu-button"]')).find((button) => {
|
|
6
|
+
var _a2;
|
|
7
|
+
return ((_a2 = button.textContent) == null ? void 0 : _a2.trim()) === title;
|
|
8
|
+
})) != null ? _a : null;
|
|
9
|
+
}
|
|
10
|
+
function setToolbarPanel(element, open, lookup = document) {
|
|
11
|
+
if (!element) return;
|
|
12
|
+
const toggle = Array.from(lookup.querySelectorAll("[aria-controls]")).find((t) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return (_b = lookup.getElementById((_a = t.getAttribute("aria-controls")) != null ? _a : "")) == null ? void 0 : _b.contains(element);
|
|
15
|
+
});
|
|
16
|
+
if (toggle && toggle.getAttribute("aria-expanded") === "true" !== open) toggle.click();
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
anchorSelector,
|
|
20
|
+
findAnchor,
|
|
21
|
+
findSidebarPageLink,
|
|
22
|
+
setToolbarPanel
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=hostTargets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/components/tour/hostTargets.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\n/** The selector for `data-tour=\"<name>\"`, with quotes and backslashes in the name escaped. */\nexport const anchorSelector = (name: string) => `[data-tour=\"${name.replace(/[\"\\\\]/g, '\\\\$&')}\"]`\n\n/** The element marked `data-tour=\"<name>\"`, or null. */\nexport const findAnchor = <T extends HTMLElement = HTMLElement>(name: string, root: ParentNode = document) =>\n root.querySelector<T>(anchorSelector(name))\n\ntype Lookup = Pick<Document, 'querySelectorAll' | 'getElementById'>\n\n/** The app sidebar's button for a page, matched on its title, which stays in the text while the sidebar is collapsed. */\nexport function findSidebarPageLink(title: string, lookup: Pick<Document, 'querySelectorAll'> = document): HTMLElement | null {\n return Array.from(lookup.querySelectorAll<HTMLElement>('[data-sidebar=\"menu-button\"]'))\n .find(button => button.textContent?.trim() === title) ?? null\n}\n\n/** Opens or closes the toolbar dropdown holding `element` by clicking the toggle that controls it. */\nexport function setToolbarPanel(element: Element | null, open: boolean, lookup: Lookup = document): void {\n if (!element) return\n const toggle = Array.from(lookup.querySelectorAll<HTMLElement>('[aria-controls]'))\n .find(t => lookup.getElementById(t.getAttribute('aria-controls') ?? '')?.contains(element))\n if (toggle && (toggle.getAttribute('aria-expanded') === 'true') !== open) toggle.click()\n}\n"],"mappings":"AAIO,MAAM,iBAAiB,CAAC,SAAiB,eAAe,KAAK,QAAQ,UAAU,MAAM,CAAC;AAGtF,MAAM,aAAa,CAAsC,MAAc,OAAmB,aAC/F,KAAK,cAAiB,eAAe,IAAI,CAAC;AAKrC,SAAS,oBAAoB,OAAe,SAA6C,UAA8B;AAb9H;AAcE,UAAO,WAAM,KAAK,OAAO,iBAA8B,8BAA8B,CAAC,EACnF,KAAK,YAAO;AAfjB,QAAAA;AAeoB,aAAAA,MAAA,OAAO,gBAAP,gBAAAA,IAAoB,YAAW;AAAA,GAAK,MAD/C,YACoD;AAC7D;AAGO,SAAS,gBAAgB,SAAyB,MAAe,SAAiB,UAAgB;AACvG,MAAI,CAAC,QAAS;AACd,QAAM,SAAS,MAAM,KAAK,OAAO,iBAA8B,iBAAiB,CAAC,EAC9E,KAAK,OAAE;AAtBZ;AAsBe,wBAAO,gBAAe,OAAE,aAAa,eAAe,MAA9B,YAAmC,EAAE,MAA3D,mBAA8D,SAAS;AAAA,GAAQ;AAC5F,MAAI,UAAW,OAAO,aAAa,eAAe,MAAM,WAAY,KAAM,QAAO,MAAM;AACzF;","names":["_a"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { GuidedTour } from './GuidedTour';
|
|
2
|
+
export { TourBody, splitTerm } from './TourBody';
|
|
3
|
+
export { useTour } from './useTour';
|
|
4
|
+
export { browserTourStore } from './tourStore';
|
|
5
|
+
export { findSidebarPageLink, setToolbarPanel } from './hostTargets';
|
|
6
|
+
export type { TourStore, BrowserTourStoreOptions } from './tourStore';
|
|
7
|
+
export type { GuidedTourLabels, GuidedTourProps, TourItem, TourStep, TourTarget } from './tourTypes';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/components/tour/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpE,YAAY,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACrE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GuidedTour } from "./GuidedTour";
|
|
2
|
+
import { TourBody, splitTerm } from "./TourBody";
|
|
3
|
+
import { useTour } from "./useTour";
|
|
4
|
+
import { browserTourStore } from "./tourStore";
|
|
5
|
+
import { findSidebarPageLink, setToolbarPanel } from "./hostTargets";
|
|
6
|
+
export {
|
|
7
|
+
GuidedTour,
|
|
8
|
+
TourBody,
|
|
9
|
+
browserTourStore,
|
|
10
|
+
findSidebarPageLink,
|
|
11
|
+
setToolbarPanel,
|
|
12
|
+
splitTerm,
|
|
13
|
+
useTour
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/components/tour/index.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nexport { GuidedTour } from './GuidedTour'\nexport { TourBody, splitTerm } from './TourBody'\nexport { useTour } from './useTour'\nexport { browserTourStore } from './tourStore'\nexport { findSidebarPageLink, setToolbarPanel } from './hostTargets'\nexport type { TourStore, BrowserTourStoreOptions } from './tourStore'\nexport type { GuidedTourLabels, GuidedTourProps, TourItem, TourStep, TourTarget } from './tourTypes'\n"],"mappings":"AAGA,SAAS,kBAAkB;AAC3B,SAAS,UAAU,iBAAiB;AACpC,SAAS,eAAe;AACxB,SAAS,wBAAwB;AACjC,SAAS,qBAAqB,uBAAuB;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface Box {
|
|
2
|
+
left: number;
|
|
3
|
+
top: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Size {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
/** Where `a` and `b` overlap, or null when they do not. */
|
|
12
|
+
export declare function intersect(a: Box, b: Box): Box | null;
|
|
13
|
+
/** The part of `box` inside the viewport, or null when none of it is. */
|
|
14
|
+
export declare const visiblePart: (box: Box, viewport: Size) => Box;
|
|
15
|
+
/** Whether the card fits to the left or right of the target. */
|
|
16
|
+
export declare const fitsBeside: (target: Box, cardWidth: number, viewportWidth: number) => boolean;
|
|
17
|
+
export interface Placement {
|
|
18
|
+
left: number;
|
|
19
|
+
top: number;
|
|
20
|
+
maxHeight?: number;
|
|
21
|
+
}
|
|
22
|
+
/** The free spot nearest the target, clear of it and of `avoid`, shortening the card before covering the target. */
|
|
23
|
+
export declare function placeCard(target: Box | null, card: Size, viewport: Size, avoid?: Box[]): Placement;
|
|
24
|
+
//# sourceMappingURL=placement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placement.d.ts","sourceRoot":"","sources":["../../../../src/core/components/tour/placement.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,GAAG;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AACjF,MAAM,WAAW,IAAI;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAevD,2DAA2D;AAC3D,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,IAAI,CAMpD;AAED,yEAAyE;AACzE,eAAO,MAAM,WAAW,GAAI,KAAK,GAAG,EAAE,UAAU,IAAI,QAAqD,CAAA;AAoCzG,gEAAgE;AAChE,eAAO,MAAM,UAAU,GAAI,QAAQ,GAAG,EAAE,WAAW,MAAM,EAAE,eAAe,MAAM,YACE,CAAA;AAElF,MAAM,WAAW,SAAS;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;AAkB5E,oHAAoH;AACpH,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,GAAE,GAAG,EAAO,GAAG,SAAS,CAUtG"}
|