@3cr/viewer-browser 0.0.248 → 0.0.292
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/.circleci/config.yml +53 -0
- package/README.md +79 -74
- package/components.d.ts +94 -36
- package/dist/Viewer3CR.js +663 -47
- package/dist/Viewer3CR.mjs +108286 -37159
- package/dist/Viewer3CR.umd.js +663 -47
- package/index.html +35 -33
- package/package.json +27 -8
- package/playground/img.png +0 -0
- package/playground/index.html +6 -2
- package/src/App.vue +41 -97
- package/src/__tests__/app.spec.ts +2 -1
- package/src/__tests__/main.spec.ts +14 -14
- package/src/assets/_palette.scss +112 -0
- package/src/assets/_settings.scss +64 -0
- package/src/assets/_typography.scss +187 -0
- package/src/assets/images/cloud-storage.svg +22 -0
- package/src/assets/images/courtney.png +0 -0
- package/src/assets/images/dark/magic-wand.svg +32 -0
- package/src/assets/images/dark-theme.svg +33 -0
- package/src/assets/images/dot.svg +5 -0
- package/src/assets/images/dr-miles.png +0 -0
- package/src/assets/images/illustration.svg +118 -0
- package/src/assets/images/intro.svg +30 -0
- package/src/assets/{magic_wand.svg → images/light/magic-wand.svg} +22 -14
- package/src/assets/images/light-theme.svg +33 -0
- package/src/assets/images/system-theme.svg +51 -0
- package/src/assets/images/totalSegmentator.png +0 -0
- package/src/assets/logos/3dicom/black/black.svg +30 -0
- package/src/assets/logos/3dicom/colour/colour.svg +18 -0
- package/src/assets/logos/3dicom/colour/colour_single.svg +18 -0
- package/src/assets/logos/3dicom/wordmark/patients/patients.svg +29 -0
- package/src/assets/logos/3dicom/wordmark/powered-by/powered-by.svg +41 -0
- package/src/assets/logos/3dicom/wordmark/practitioners/practitioner.svg +34 -0
- package/src/assets/logos/3dicom/wordmark/research/research.svg +29 -0
- package/src/assets/logos/license/black/black.svg +22 -0
- package/src/assets/logos/license/white/white.svg +22 -0
- package/src/assets/styles.scss +435 -12
- package/src/components/ShFlatIconBtn.vue +36 -0
- package/src/components/ShPlainIconBtn.vue +42 -0
- package/src/components/ShSelect.vue +48 -0
- package/src/components/ShTextField.vue +39 -0
- package/src/components/ShTextarea.vue +39 -0
- package/src/components/__tests__/ShFlatIconBtn.spec.ts +32 -0
- package/src/components/__tests__/ShPlainIconBtn.spec.ts +37 -0
- package/src/components/__tests__/ShSelect.spec.ts +30 -0
- package/src/components/__tests__/ShTextField.spec.ts +30 -0
- package/src/components/__tests__/ShTextarea.spec.ts +30 -0
- package/src/components/demo/CloudDropZone.vue +105 -0
- package/src/components/demo/DemoAvatarDropdownMenu.vue +343 -0
- package/src/components/demo/DemoInfoModal.vue +60 -0
- package/src/components/demo/DemoNotificationNavigationDrawer.vue +118 -0
- package/src/components/demo/DemoPurchaseCreditsModal.vue +141 -0
- package/src/components/demo/DemoUpgradeCloudStorageModal.vue +74 -0
- package/src/components/demo/DemoUpgradePlanModal.vue +17 -0
- package/src/components/demo/UploadDicomToCloudModal.vue +225 -0
- package/src/components/demo/__tests__/CloudDropZone.spec.ts +132 -0
- package/src/components/demo/__tests__/DemoAvatarDropdownMenu.spec.ts +16 -0
- package/src/components/demo/{licence/__tests__/DemoLicenceEnableCloudStorageModal.spec.ts → __tests__/DemoEnableCloudStorageModal.spec.ts} +11 -11
- package/src/components/demo/{licence/__tests__/DemoLicenceInfoModal.spec.ts → __tests__/DemoInfoModal.spec.ts} +11 -8
- package/src/components/demo/__tests__/DemoNotificationNavigationDrawer.spec.ts +56 -0
- package/src/components/demo/__tests__/UploadDicomToCloudModal.spec.ts +320 -0
- package/src/components/demo/__tests__/demo-payload.spec.ts +10 -0
- package/src/components/demo/demo-notifications.ts +45 -0
- package/src/components/demo/demo-payload.ts +9 -0
- package/src/components/demo/fileReader.ts +47 -0
- package/src/{composables/useViewerOptions.ts → components/demo/mockDemoViewerStlDecimator.ts} +8 -12
- package/src/components/intro/ViewerIntro.vue +56 -0
- package/src/components/intro/ViewerTour.vue +53 -0
- package/src/components/intro/tour/Tour.vue +205 -0
- package/src/components/intro/tour/step.ts +6 -0
- package/src/components/modal/ActionRail.vue +4 -0
- package/src/components/modal/Viewer3cr.vue +224 -0
- package/src/components/modal/Viewer3crWebGL.vue +65 -0
- package/src/components/modal/ViewerActionRail.vue +10 -27
- package/src/components/modal/ViewerMain.vue +83 -0
- package/src/components/modal/ViewerNavigationDrawer.vue +269 -68
- package/src/components/modal/ViewerScanView.vue +223 -67
- package/src/components/modal/__tests__/{MftpWebGL3DRModal.spec.ts → Viewer3cr.spec.ts} +154 -53
- package/src/components/modal/__tests__/{WebGL3DR.spec.ts → Viewer3crWebGL.spec.ts} +11 -11
- package/src/components/modal/__tests__/ViewerNavigationDrawer.spec.ts +271 -11
- package/src/components/modal/__tests__/ViewerScanView.spec.ts +15 -7
- package/src/components/modal/actions/Action.vue +3 -8
- package/src/components/modal/actions/Flip3dAction.vue +31 -16
- package/src/components/modal/actions/FlipHorizontalAction.vue +14 -5
- package/src/components/modal/actions/FlipVerticalAction.vue +14 -5
- package/src/components/modal/actions/FullscreenAction.vue +9 -5
- package/src/components/modal/actions/PanAction.vue +11 -51
- package/src/components/modal/actions/ResetViewAction.vue +10 -8
- package/src/components/modal/actions/Rotate2dAction.vue +25 -15
- package/src/components/modal/actions/Slice3dAction.vue +22 -10
- package/src/components/modal/actions/ZoomAction.vue +21 -13
- package/src/components/modal/actions/__tests__/Action.spec.ts +2 -2
- package/src/components/modal/actions/__tests__/Flip3dAction.spec.ts +58 -14
- package/src/components/modal/actions/__tests__/FlipHorizontalAction.spec.ts +15 -5
- package/src/components/modal/actions/__tests__/FlipVerticalAction.spec.ts +15 -5
- package/src/components/modal/actions/__tests__/FullscreenAction.spec.ts +7 -5
- package/src/components/modal/actions/__tests__/PanAction.spec.ts +13 -32
- package/src/components/modal/actions/__tests__/ResetViewAction.spec.ts +5 -3
- package/src/components/modal/actions/__tests__/Rotate2dAction.spec.ts +13 -6
- package/src/components/modal/actions/__tests__/Slice3dAction.spec.ts +1 -1
- package/src/components/modal/actions/__tests__/ZoomAction.spec.ts +25 -11
- package/src/components/modal/app-bars/ViewerActionBar.vue +224 -0
- package/src/components/modal/app-bars/ViewerAppBar.vue +126 -0
- package/src/components/modal/app-bars/__tests__/ViewerActionBar.spec.ts +176 -0
- package/src/components/modal/app-bars/__tests__/ViewerAppBar.spec.ts +99 -0
- package/src/components/modal/layouts/Layout1x3ClipPath.vue +35 -0
- package/src/components/modal/layouts/Layout2x2ClipPath.vue +35 -0
- package/src/components/modal/layouts/LayoutFullscreenClipPath.vue +29 -0
- package/src/components/modal/layouts/__tests__/Layout1x3ClipPath.spec.ts +15 -0
- package/src/components/modal/layouts/__tests__/Layout2x2ClipPath.spec.ts +15 -0
- package/src/components/modal/layouts/__tests__/LayoutFullscreenClipPath.spec.ts +15 -0
- package/src/components/modal/layouts/composables/__tests__/useLayout1x3.spec.ts +40 -0
- package/src/components/modal/layouts/composables/__tests__/useLayout2x2.spec.ts +40 -0
- package/src/components/modal/layouts/composables/__tests__/useLayoutFullscreen.spec.ts +40 -0
- package/src/components/modal/layouts/composables/useLayout1x3.ts +46 -0
- package/src/components/modal/layouts/composables/useLayout2x2.ts +46 -0
- package/src/components/modal/layouts/composables/useLayoutFullscreen.ts +24 -0
- package/src/components/modal/menus/AutoAnnotateMenu.vue +67 -0
- package/src/components/modal/menus/AvatarDropdownMenu.vue +66 -0
- package/src/components/modal/menus/HelpMenu.vue +47 -0
- package/src/components/modal/menus/SettingsMenu.vue +242 -92
- package/src/components/modal/menus/ShareMenu.vue +58 -0
- package/src/components/modal/menus/__tests__/AutoAnnotateMenu.spec.ts +80 -0
- package/src/components/modal/menus/__tests__/AvatarDropdownMenu.spec.ts +49 -0
- package/src/components/modal/menus/__tests__/HelpMenu.spec.ts +12 -0
- package/src/components/modal/menus/__tests__/SettingsMenu.spec.ts +163 -57
- package/src/components/modal/modal/AboutModal.vue +61 -0
- package/src/components/modal/modal/AiModelList.vue +70 -0
- package/src/components/modal/{AskAI.vue → modal/AskAiModal.vue} +26 -34
- package/src/components/modal/modal/AutoAnnotateModal.vue +136 -0
- package/src/components/modal/modal/CloseViewerModal.vue +108 -0
- package/src/components/modal/modal/DataOverlayGeneralModal.vue +122 -0
- package/src/components/modal/modal/DataOverlayMeasurementModal.vue +59 -0
- package/src/components/modal/modal/DataOverlayModal.vue +121 -0
- package/src/components/modal/modal/ShareModal.vue +201 -0
- package/src/components/modal/modal/UploadsDrawer.vue +165 -0
- package/src/components/modal/modal/WhatsNewModal.vue +45 -0
- package/src/components/modal/modal/__tests__/AboutModal.spec.ts +60 -0
- package/src/components/modal/modal/__tests__/AiModelList.spec.ts +50 -0
- package/src/components/modal/{__tests__ → modal/__tests__}/AskAI.spec.ts +8 -7
- package/src/components/modal/modal/__tests__/AutoAnnotateModal.spec.ts +29 -0
- package/src/components/modal/modal/__tests__/CloseViewerModal.spec.ts +60 -0
- package/src/components/modal/modal/__tests__/DataOverlayGeneralModal.spec.ts +55 -0
- package/src/components/modal/modal/__tests__/DataOverlayMeasurementModal.spec.ts +82 -0
- package/src/components/modal/modal/__tests__/DataOverlayModal.spec.ts +94 -0
- package/src/components/modal/modal/__tests__/ShareModal.spec.ts +262 -0
- package/src/components/modal/modal/__tests__/UploadsDrawer.spec.ts +174 -0
- package/src/components/modal/modal/__tests__/WhatsNewModal.spec.ts +29 -0
- package/src/components/modal/snackbars/AnnotationGeneratedSnackbar.vue +34 -0
- package/src/components/modal/snackbars/ImagesSharedSnackbar.vue +26 -0
- package/src/components/modal/snackbars/LinkCopiedSnackbar.vue +26 -0
- package/src/components/modal/snackbars/__tests__/AnnotationGeneratedSnackbar.spec.ts +43 -0
- package/src/components/modal/snackbars/__tests__/ImagesSharedSnackbar.spec.ts +22 -0
- package/src/components/modal/snackbars/__tests__/LinkCopiedSnackbar.spec.ts +21 -0
- package/src/components/navigation/annotation/AnnotationCreateModal.vue +114 -0
- package/src/components/navigation/annotation/AnnotationCreateSnackbar.vue +20 -0
- package/src/components/navigation/annotation/AnnotationDataTable.vue +157 -0
- package/src/components/navigation/annotation/AnnotationDeleteModal.vue +48 -0
- package/src/components/navigation/annotation/AnnotationDeleteSnackbar.vue +25 -0
- package/src/components/navigation/annotation/AnnotationForm.vue +277 -0
- package/src/components/navigation/annotation/AnnotationIcon.vue +45 -0
- package/src/components/navigation/annotation/AnnotationInfo.vue +141 -0
- package/src/components/navigation/annotation/AnnotationMenu.vue +99 -0
- package/src/components/navigation/annotation/AnnotationPanel.vue +30 -0
- package/src/components/navigation/annotation/AnnotationTools.vue +104 -0
- package/src/components/navigation/annotation/AnnotationUpdateModal.vue +78 -0
- package/src/components/navigation/annotation/AnnotationVisibilityBtn.vue +52 -0
- package/src/components/navigation/annotation/DrawerTitle.vue +25 -0
- package/src/components/navigation/annotation/__tests__/AnnotationCreateModal.spec.ts +178 -0
- package/src/components/navigation/annotation/__tests__/AnnotationCreateSnackbar.spec.ts +31 -0
- package/src/components/navigation/annotation/__tests__/AnnotationDataTable.spec.ts +79 -0
- package/src/components/navigation/annotation/__tests__/AnnotationDeleteSnackbar.spec.ts +66 -0
- package/src/components/navigation/annotation/__tests__/AnnotationForm.spec.ts +261 -0
- package/src/components/navigation/annotation/__tests__/AnnotationIcon.spec.ts +13 -0
- package/src/components/navigation/annotation/__tests__/AnnotationTools.spec.ts +116 -0
- package/src/components/navigation/display/DisplayPanel.vue +156 -0
- package/src/components/{views/__tests__/DisplaySettings.spec.ts → navigation/display/__tests__/DisplayPanel.spec.ts} +14 -3
- package/src/components/navigation/history/HistoryModal.vue +140 -0
- package/src/components/navigation/mcad/McadAddObjectBtn.vue +41 -0
- package/src/components/navigation/mcad/McadDataTable.vue +78 -0
- package/src/components/navigation/mcad/McadDataTableItems.vue +382 -0
- package/src/components/navigation/mcad/McadDeleteModal.vue +44 -0
- package/src/components/navigation/mcad/McadDropZone.vue +148 -0
- package/src/components/navigation/mcad/McadFloating.vue +193 -0
- package/src/components/navigation/mcad/McadIcon.vue +34 -0
- package/src/components/navigation/mcad/McadInvert.vue +91 -0
- package/src/components/navigation/mcad/McadLockBtn.vue +62 -0
- package/src/components/navigation/mcad/McadMenu.vue +248 -0
- package/src/components/navigation/mcad/McadOpacity.vue +79 -0
- package/src/components/navigation/mcad/McadPanel.vue +31 -0
- package/src/components/navigation/mcad/McadToggleSortBtn.vue +18 -0
- package/src/components/navigation/mcad/McadToggleVisibilityBtn.vue +46 -0
- package/src/components/navigation/mcad/McadUpdateModal.vue +108 -0
- package/src/components/navigation/mcad/McadVisibilityBtn.vue +46 -0
- package/src/components/navigation/mcad/__tests__/McadAddObjectBtn.spec.ts +73 -0
- package/src/components/navigation/mcad/__tests__/McadDataTable.spec.ts +27 -0
- package/src/components/navigation/mcad/__tests__/McadDataTableItems.spec.ts +621 -0
- package/src/components/navigation/mcad/__tests__/McadDeleteModal.spec.ts +67 -0
- package/src/components/navigation/mcad/__tests__/McadDropZone.spec.ts +109 -0
- package/src/components/navigation/mcad/__tests__/McadIcon.spec.ts +13 -0
- package/src/components/navigation/mcad/__tests__/McadInvert.spec.ts +45 -0
- package/src/components/navigation/mcad/__tests__/McadLockBtn.spec.ts +38 -0
- package/src/components/navigation/mcad/__tests__/McadMenu.spec.ts +258 -0
- package/src/components/navigation/mcad/__tests__/McadOpacity.spec.ts +68 -0
- package/src/components/navigation/mcad/__tests__/McadToggleSortBtn.spec.ts +36 -0
- package/src/components/navigation/mcad/__tests__/McadToggleVisibilityBtn.spec.ts +53 -0
- package/src/components/navigation/mcad/__tests__/McadUpdateModal.spec.ts +122 -0
- package/src/components/navigation/mcad/__tests__/McadVisibilityBtn.spec.ts +45 -0
- package/src/components/navigation/measurement/MeasurementAngleSnackbar.vue +18 -0
- package/src/components/navigation/measurement/MeasurementDataTable.vue +162 -0
- package/src/components/navigation/measurement/MeasurementDeleteModal.vue +49 -0
- package/src/components/navigation/measurement/MeasurementDeleteSnackbar.vue +40 -0
- package/src/components/navigation/measurement/MeasurementIcon.vue +41 -0
- package/src/components/navigation/measurement/MeasurementInfo.vue +25 -0
- package/src/components/navigation/measurement/MeasurementInfoAngle.vue +36 -0
- package/src/components/navigation/measurement/MeasurementInfoLength.vue +37 -0
- package/src/components/navigation/measurement/MeasurementInfoPolygon.vue +58 -0
- package/src/components/navigation/measurement/MeasurementLengthSnackbar.vue +18 -0
- package/src/components/navigation/measurement/MeasurementMenu.vue +97 -0
- package/src/components/navigation/measurement/MeasurementPanel.vue +30 -0
- package/src/components/navigation/measurement/MeasurementPolygonSnackbar.vue +18 -0
- package/src/components/navigation/measurement/MeasurementTools.vue +101 -0
- package/src/components/navigation/measurement/MeasurementVisibilityBtn.vue +53 -0
- package/src/components/navigation/measurement/__tests__/MeasurementAngleSnackbar.spec.ts +34 -0
- package/src/components/navigation/measurement/__tests__/MeasurementDataTable.spec.ts +79 -0
- package/src/components/navigation/measurement/__tests__/MeasurementDeleteSnackbar.spec.ts +51 -0
- package/src/components/navigation/measurement/__tests__/MeasurementInfo.spec.ts +77 -0
- package/src/components/navigation/measurement/__tests__/MeasurementLengthSnackbar.spec.ts +35 -0
- package/src/components/navigation/measurement/__tests__/MeasurementPolygonSnackbar.spec.ts +35 -0
- package/src/components/navigation/measurement/__tests__/MeasurementTools.spec.ts +87 -0
- package/src/components/shared/ColourPalette.vue +72 -0
- package/src/components/shared/DoubleSliderSelector.vue +66 -28
- package/src/components/shared/HorizontalSliderSelector.vue +80 -0
- package/src/components/shared/KeyboardShortcuts.vue +184 -0
- package/src/components/shared/LoadingSpinner.vue +508 -144
- package/src/components/shared/MultiLoginError.vue +98 -0
- package/src/components/shared/NotificationToaster.vue +112 -0
- package/src/components/shared/UpdateSnackbar.vue +22 -9
- package/src/components/shared/ValueSelector.vue +10 -10
- package/src/components/shared/VerticalSliderSelector.vue +45 -44
- package/src/components/shared/__tests__/ColourPalette.spec.ts +21 -0
- package/src/components/shared/__tests__/DoubleSliderSelector.spec.ts +58 -46
- package/src/components/shared/__tests__/HorizontalSliderSelector.spec.ts +35 -0
- package/src/components/shared/__tests__/KeyboardShortcuts.spec.ts +50 -0
- package/src/components/shared/__tests__/MultiLoginError.spec.ts +50 -0
- package/src/components/shared/__tests__/NotificationToaster.spec.ts +65 -0
- package/src/components/shared/__tests__/UpdateSnackbar.spec.ts +7 -7
- package/src/components/shared/__tests__/ValueSelector.spec.ts +6 -0
- package/src/composables/__tests__/useDebounce.spec.ts +17 -0
- package/src/composables/__tests__/useMovingAverage.spec.ts +40 -0
- package/src/composables/__tests__/useNavigationCube.spec.ts +79 -0
- package/src/{functions/__tests__/notification.spec.ts → composables/__tests__/useNotificationHandler.spec.ts} +74 -17
- package/src/composables/__tests__/useToolGroup.spec.ts +41 -0
- package/src/composables/__tests__/useViewName.spec.ts +29 -0
- package/src/composables/useBoundingBox.ts +32 -0
- package/src/composables/useEventListener.ts +7 -9
- package/src/composables/useMedia.ts +27 -0
- package/src/composables/useNavigationCube.ts +80 -0
- package/src/composables/useNotificationHandler.ts +82 -0
- package/src/composables/useResizeObserver.ts +31 -0
- package/src/composables/useToolGroup.ts +36 -0
- package/src/composables/useViewName.ts +34 -0
- package/src/composables/useViewer3cr.ts +3 -2
- package/src/config.ts +1 -1
- package/src/constants.ts +8 -0
- package/src/functions/HotkeyScope.ts +87 -0
- package/src/functions/__tests__/HotkeyScope.spec.ts +49 -0
- package/src/functions/__tests__/colours.spec.ts +42 -0
- package/src/functions/__tests__/fileReader.spec.ts +130 -0
- package/src/functions/__tests__/modelHelper.spec.ts +1 -0
- package/src/functions/__tests__/tsHelper.spec.ts +7 -0
- package/src/functions/chunker.ts +21 -0
- package/src/functions/colours.ts +45 -0
- package/src/functions/fileReader.ts +48 -0
- package/src/functions/guards/__tests__/isDataOverlayAngle.spec.ts +21 -0
- package/src/functions/guards/__tests__/isDataOverlayLength.spec.ts +21 -0
- package/src/functions/guards/__tests__/isDataOverlayPolygon.spec.ts +21 -0
- package/src/functions/guards/isDataOverlayAngle.ts +3 -4
- package/src/functions/guards/isDataOverlayLength.ts +3 -4
- package/src/functions/guards/isDataOverlayPolygon.ts +3 -4
- package/src/functions/openUrl.ts +3 -0
- package/src/functions/{__tests__ → parsers/__tests__}/parseAction.spec.ts +1 -1
- package/src/functions/{__tests__ → parsers/__tests__}/parseCallToAction.spec.ts +1 -1
- package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlay.spec.ts +1 -1
- package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlayData.spec.ts +1 -1
- package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlayEvent.spec.ts +3 -3
- package/src/functions/{__tests__ → parsers/__tests__}/parseMcadEvent.spec.ts +3 -3
- package/src/functions/{parseAction.ts → parsers/parseAction.ts} +1 -2
- package/src/functions/{parseCallToAction.ts → parsers/parseCallToAction.ts} +2 -2
- package/src/functions/{parseDataOverlay.ts → parsers/parseDataOverlay.ts} +3 -3
- package/src/functions/parsers/parseDataOverlayData.ts +9 -0
- package/src/functions/parsers/parseDataOverlayEvent.ts +19 -0
- package/src/functions/parsers/parseMcadEvent.ts +9 -0
- package/src/functions/platform.ts +7 -0
- package/src/functions/translateTooltipShortcut.ts +35 -0
- package/src/functions/tsHelper.ts +3 -0
- package/src/main.ts +70 -48
- package/src/models/__tests__/iso-languages.spec.ts +23 -0
- package/src/models/__tests__/scanState.spec.ts +14 -38
- package/src/models/iso-languages.ts +1609 -0
- package/src/models/progress.ts +23 -0
- package/src/models/scanState.ts +56 -100
- package/src/plugins/__tests__/pinia.spec.ts +7 -0
- package/src/plugins/__tests__/vue-i18n.spec.ts +7 -0
- package/src/plugins/__tests__/vuetify.spec.ts +3 -3
- package/src/plugins/locales/en.json +442 -0
- package/src/plugins/material-symbols/aliases.ts +43 -0
- package/src/plugins/material-symbols/material-symbols-filled.ts +11 -0
- package/src/plugins/material-symbols/material-symbols-outlined.ts +9 -0
- package/src/plugins/pinia.ts +3 -0
- package/src/plugins/vue-i18n.ts +9 -0
- package/src/plugins/vuetify.ts +157 -25
- package/src/services/__tests__/features.service.spec.ts +14 -0
- package/src/services/__tests__/gpt.service.spec.ts +64 -3
- package/src/services/__tests__/viewer-3cr.service.spec.ts +616 -192
- package/src/services/features.service.ts +32 -0
- package/src/services/gpt.service.ts +5 -2
- package/src/services/viewer-3cr.service.ts +374 -307
- package/src/stores/__tests__/data-overlay.store.spec.ts +92 -0
- package/src/stores/__tests__/demo.store.spec.ts +196 -0
- package/src/stores/__tests__/drawer.store.spec.ts +27 -0
- package/src/stores/__tests__/intro.store.spec.ts +102 -0
- package/src/stores/__tests__/language.store.spec.ts +83 -0
- package/src/stores/__tests__/mcad-floating.store.spec.ts +339 -0
- package/src/stores/__tests__/mcad.store.spec.ts +88 -0
- package/src/stores/__tests__/save.store.spec.ts +51 -0
- package/src/stores/__tests__/theme.store.spec.ts +18 -0
- package/src/stores/__tests__/tool.store.spec.ts +53 -0
- package/src/stores/__tests__/upload.store.spec.ts +19 -0
- package/src/stores/__tests__/viewer.store.spec.ts +20 -0
- package/src/stores/data-overlay.store.ts +93 -0
- package/src/stores/demo.store.ts +284 -0
- package/src/stores/drawer.store.ts +23 -0
- package/src/stores/intro.store.ts +35 -0
- package/src/stores/language.store.ts +59 -0
- package/src/stores/mcad-floating.store.ts +141 -0
- package/src/stores/mcad.store.ts +53 -0
- package/src/stores/save.store.ts +59 -0
- package/src/stores/theme.store.ts +45 -0
- package/src/stores/tool.store.ts +41 -0
- package/src/stores/upload.store.ts +19 -0
- package/src/stores/viewer.store.ts +34 -0
- package/src/tools/__tests__/annotation-create.tool.spec.ts +90 -0
- package/src/tools/__tests__/annotation-move.tool.spec.ts +107 -0
- package/src/tools/__tests__/data-overlay.tool.spec.ts +127 -0
- package/src/tools/__tests__/mcad-move.tool.spec.ts +106 -0
- package/src/tools/__tests__/mcad-rotate.tool.spec.ts +103 -0
- package/src/tools/__tests__/mcad-scale.tool.spec.ts +8 -0
- package/src/tools/__tests__/mcad-select.tool.spec.ts +63 -0
- package/src/tools/__tests__/measurement-angle.tool.spec.ts +26 -0
- package/src/tools/__tests__/measurement-length.tool.spec.ts +26 -0
- package/src/tools/__tests__/measurement-polygon.tool.spec.ts +26 -0
- package/src/tools/annotation-create.tool.ts +48 -0
- package/src/tools/annotation-move.tool.ts +48 -0
- package/src/tools/data-overlay.tool.ts +45 -48
- package/src/tools/mcad-move.tool.ts +47 -0
- package/src/tools/mcad-rotate.tool.ts +47 -0
- package/src/tools/mcad-scale-tool.ts +10 -0
- package/src/tools/mcad-select-tool.ts +32 -0
- package/src/tools/measurement-angle.tool.ts +20 -0
- package/src/tools/measurement-length.tool.ts +20 -0
- package/src/tools/measurement-polygon.tool.ts +20 -0
- package/src/types/feature.ts +6 -0
- package/src/types/viewer-tool.ts +5 -0
- package/test/MockImportOriginal.ts +7 -0
- package/test/assertions/beTypeOrNull.ts +24 -0
- package/test/fakers/action-data.faker.ts +1 -1
- package/test/fakers/action.faker.ts +1 -1
- package/test/fakers/call-to-action.faker.ts +1 -1
- package/test/fakers/data-overlay-angle.faker.ts +1 -1
- package/test/fakers/data-overlay-annotation.faker.ts +1 -1
- package/test/fakers/data-overlay-data.faker.ts +18 -15
- package/test/fakers/data-overlay-interaction.faker.ts +25 -17
- package/test/fakers/data-overlay-length.faker.ts +1 -1
- package/test/fakers/data-overlay-mcad.faker.ts +4 -3
- package/test/fakers/data-overlay-polygon.faker.ts +1 -1
- package/test/fakers/feature.faker.ts +13 -0
- package/test/fakers/file.faker.ts +11 -0
- package/test/fakers/gpt-question.faker.ts +1 -1
- package/test/fakers/gpt-response.faker.ts +1 -1
- package/test/fakers/mcad-object-interaction.faker.ts +4 -4
- package/test/fakers/orientation.faker.ts +1 -1
- package/test/fakers/segment-angle.faker.ts +1 -1
- package/test/fakers/upload.faker.ts +14 -0
- package/test/getAnimationFrame.ts +3 -0
- package/test/plugins/findByTestId.ts +13 -6
- package/test/plugins/pinia.ts +20 -0
- package/test/plugins/vitest.d.ts +8 -0
- package/test/plugins/vue-i18n.ts +22 -0
- package/test/plugins/vuetify.ts +10 -0
- package/test/setup.ts +37 -12
- package/tsconfig.json +1 -1
- package/vite.config.mts +48 -18
- package/vitest.config.mts +12 -3
- package/src/assets/images/MainBackdrop.svg +0 -48
- package/src/assets/images/dark/Singular-Health-Disc-Mono.svg +0 -9
- package/src/assets/images/dark/demo-icon-small.png +0 -0
- package/src/assets/images/dark/demo-logo-small.svg +0 -27
- package/src/assets/images/dark/demo-logo.svg +0 -1
- package/src/assets/images/light/Singular-Health-Disc-Mono.svg +0 -9
- package/src/assets/logos/3dicom/white-mini.svg +0 -20
- package/src/components/demo/DemoModal.vue +0 -44
- package/src/components/demo/DemoPatientModal.vue +0 -52
- package/src/components/demo/__tests__/DemoModal.spec.ts +0 -26
- package/src/components/demo/__tests__/DemoPatientModal.spec.ts +0 -38
- package/src/components/demo/__tests__/options.spec.ts +0 -25
- package/src/components/demo/licence/DemoLicenceEnableCloudStorageModal.vue +0 -64
- package/src/components/demo/licence/DemoLicenceInfoModal.vue +0 -49
- package/src/components/demo/licence/DemoLicenceSendToPartyModal.vue +0 -178
- package/src/components/demo/licence/DemoLicenceShareToMobileModal.vue +0 -102
- package/src/components/demo/licence/__tests__/DemoLicenceSendToPartyModal.spec.ts +0 -36
- package/src/components/demo/licence/__tests__/DemoLicenceShareToMobileModal.spec.ts +0 -52
- package/src/components/demo/options.ts +0 -170
- package/src/components/demo/patient/DemoPatientEnableCloudStorageModal.vue +0 -64
- package/src/components/demo/patient/DemoPatientInfoModal.vue +0 -49
- package/src/components/demo/patient/DemoPatientSendToPartyModal.vue +0 -177
- package/src/components/demo/patient/DemoPatientShareToMobileModal.vue +0 -102
- package/src/components/demo/patient/__tests__/DemoPatientEnableCloudStorageModal.spec.ts +0 -38
- package/src/components/demo/patient/__tests__/DemoPatientInfoModal.spec.ts +0 -38
- package/src/components/demo/patient/__tests__/DemoPatientSendToPartyModal.spec.ts +0 -36
- package/src/components/demo/patient/__tests__/DemoPatientShareToMobileModal.spec.ts +0 -52
- package/src/components/modal/CloseViewerModal.vue +0 -69
- package/src/components/modal/MftpWebGL3DRModal.vue +0 -336
- package/src/components/modal/ViewerNavigationDrawerContent.vue +0 -168
- package/src/components/modal/ViewerNavigationDrawerFooter.vue +0 -131
- package/src/components/modal/ViewerNavigationDrawerHeader.vue +0 -33
- package/src/components/modal/WebGL3DR.vue +0 -91
- package/src/components/modal/__tests__/CloseViewerModal.spec.ts +0 -70
- package/src/components/modal/__tests__/ViewerNavigationDrawerContent.spec.ts +0 -11
- package/src/components/modal/__tests__/ViewerNavigationDrawerFooter.spec.ts +0 -46
- package/src/components/modal/__tests__/ViewerNavigationDrawerHeader.spec.ts +0 -40
- package/src/components/modal/actions/NavigationCubeAction.vue +0 -26
- package/src/components/modal/actions/__tests__/NavigationCubeAction.spec.ts +0 -25
- package/src/components/modal/buttons/AutoAnnotateBtn.vue +0 -197
- package/src/components/modal/buttons/__tests__/AutoAnnotateBtn.spec.ts +0 -28
- package/src/components/modal/menus/FileMenu.vue +0 -73
- package/src/components/modal/menus/__tests__/FileMenu.spec.ts +0 -110
- package/src/components/navigation/mcad/McadGlobalActions.vue +0 -20
- package/src/components/navigation/mcad/McadGlobalOpacitySlider.vue +0 -103
- package/src/components/navigation/mcad/McadGlobalScanViewBtn.vue +0 -28
- package/src/components/navigation/mcad/McadGlobalVisibilityBtn.vue +0 -38
- package/src/components/views/AnnotationTreeView.vue +0 -236
- package/src/components/views/DisplaySettings.vue +0 -94
- package/src/components/views/MarkupTreeView.vue +0 -201
- package/src/components/views/McadObjectTreeView.vue +0 -129
- package/src/components/views/__tests__/AnnotationTreeView.spec.ts +0 -62
- package/src/components/views/__tests__/MarkupTreeView.spec.ts +0 -41
- package/src/components/views/__tests__/McadObjectTreeView.spec.ts +0 -47
- package/src/components/views/modals/DataOverlayGeneralModal.vue +0 -71
- package/src/components/views/modals/DataOverlayMarkupModal.vue +0 -60
- package/src/components/views/modals/DataOverlayModal.vue +0 -88
- package/src/components/views/shared/MaskIcon.vue +0 -44
- package/src/components/views/shared/ObjectColor.vue +0 -31
- package/src/components/views/shared/ObjectLabel.vue +0 -30
- package/src/components/views/shared/Opacity.vue +0 -65
- package/src/components/views/shared/VisibilityBtn.vue +0 -25
- package/src/components/views/shared/__tests__/MaskIcon.spec.ts +0 -10
- package/src/components/views/shared/__tests__/ObjectColor.spec.ts +0 -10
- package/src/components/views/shared/__tests__/ObjectLabel.spec.ts +0 -10
- package/src/components/views/shared/__tests__/Opacity.spec.ts +0 -24
- package/src/components/views/shared/__tests__/VisibilityBtn.spec.ts +0 -11
- package/src/components/views/types/annotation-tree-view-item-child-action.ts +0 -6
- package/src/components/views/types/annotation-tree-view-item-child.ts +0 -9
- package/src/components/views/types/annotation-tree-view-item.ts +0 -13
- package/src/components/views/types/markup-tree-view-item-child.ts +0 -6
- package/src/components/views/types/markup-tree-view-item.ts +0 -14
- package/src/components/views/types/mcad-object-tree-view-item.ts +0 -13
- package/src/composables/__tests__/useAnnotations.spec.ts +0 -35
- package/src/composables/__tests__/useIntroJs.spec.ts +0 -51
- package/src/composables/__tests__/useMarkups.spec.ts +0 -39
- package/src/composables/__tests__/useMcadObjects.spec.ts +0 -36
- package/src/composables/__tests__/useNavigationCubeObserver.spec.ts +0 -61
- package/src/composables/useAnnotations.ts +0 -37
- package/src/composables/useIntroJs.ts +0 -142
- package/src/composables/useMarkups.ts +0 -41
- package/src/composables/useMcadObjects.ts +0 -32
- package/src/composables/useNavigationCubeObserver.ts +0 -114
- package/src/composables/useVersion3cr.ts +0 -7
- package/src/functions/__tests__/layoutOverlayStyle.spec.ts +0 -325
- package/src/functions/asyncTools.ts +0 -3
- package/src/functions/layoutOverlayStyle.ts +0 -84
- package/src/functions/notification.ts +0 -82
- package/src/functions/parseDataOverlayData.ts +0 -10
- package/src/functions/parseDataOverlayEvent.ts +0 -17
- package/src/functions/parseMcadEvent.ts +0 -10
- package/src/functions/rgbaToCss.ts +0 -13
- package/src/models/__tests__/loadViewerOptions.spec.ts +0 -72
- package/src/models/__tests__/loadViewerPayload.spec.ts +0 -10
- package/src/models/callbacks.ts +0 -4
- package/src/models/loadViewerOptions.ts +0 -79
- package/src/models/loadViewerPayload.ts +0 -17
- package/src/plugins/__tests__/usePlugins.spec.ts +0 -12
- package/src/plugins/usePlugins.ts +0 -8
- package/src/types/action-data.ts +0 -4
- package/src/types/action.ts +0 -13
- package/src/types/call-to-action.ts +0 -9
- package/src/types/colour.ts +0 -6
- package/src/types/data-overlay-angle.ts +0 -16
- package/src/types/data-overlay-annotation.ts +0 -18
- package/src/types/data-overlay-data.ts +0 -15
- package/src/types/data-overlay-event.ts +0 -5
- package/src/types/data-overlay-info.ts +0 -18
- package/src/types/data-overlay-interaction.ts +0 -15
- package/src/types/data-overlay-length.ts +0 -16
- package/src/types/data-overlay-markup.ts +0 -7
- package/src/types/data-overlay-mcad.ts +0 -20
- package/src/types/data-overlay-polygon.ts +0 -18
- package/src/types/data-overlay.ts +0 -16
- package/src/types/demo-type.ts +0 -4
- package/src/types/gpt-question.ts +0 -4
- package/src/types/gpt-response-payload.ts +0 -6
- package/src/types/mcad-object-interaction.ts +0 -15
- package/src/types/segment-angle.ts +0 -5
- package/src/types/vector2.ts +0 -4
- package/src/types/vector3.ts +0 -5
- package/test/fakers/data-overlay-info.faker.ts +0 -29
- /package/src/assets/logos/3dicom/{white.svg → white/white.svg} +0 -0
- /package/src/assets/{images/light/Singular-Health-Trademark-mono.svg → logos/singular-health/black/black.svg} +0 -0
- /package/src/assets/{images/dark/Singular-Health-Trademark-mono.svg → logos/singular-health/white/white.svg} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type OnFileCallback = (file: File, path: string) => Promise<void>;
|
|
2
|
+
|
|
3
|
+
export async function traverseDirectoryTreeWrapper(fileList: DataTransferItemList, onFileCallback: OnFileCallback) {
|
|
4
|
+
for (const dtItem of fileList) {
|
|
5
|
+
if (dtItem) {
|
|
6
|
+
await traverseDirectoryTree(dtItem.webkitGetAsEntry(), onFileCallback);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
async function traverseDirectoryTree(item: FileSystemEntry | null, onFileCallback: OnFileCallback, path: string = '') {
|
|
11
|
+
if (item?.isFile) {
|
|
12
|
+
const fileItem = item as FileSystemFileEntry;
|
|
13
|
+
await getFileEntriesFromReader(fileItem, onFileCallback, path);
|
|
14
|
+
} else if (item?.isDirectory) {
|
|
15
|
+
const directoryItem = item as FileSystemDirectoryEntry;
|
|
16
|
+
const directoryReader = directoryItem.createReader();
|
|
17
|
+
let entries: Array<FileSystemEntry> = [];
|
|
18
|
+
let lastAdditions = 0;
|
|
19
|
+
do {
|
|
20
|
+
const entrySet = await getDirectoryEntriesFromReader(directoryReader);
|
|
21
|
+
lastAdditions = entrySet.length;
|
|
22
|
+
entries = entries.concat(entrySet);
|
|
23
|
+
} while (lastAdditions > 0);
|
|
24
|
+
for (const element of entries) {
|
|
25
|
+
await traverseDirectoryTree(element, onFileCallback, path + directoryItem.name + '/');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function getDirectoryEntriesFromReader(
|
|
31
|
+
directoryReader: FileSystemDirectoryReader
|
|
32
|
+
): Promise<Array<FileSystemEntry>> {
|
|
33
|
+
return await new Promise((resolve, reject) => {
|
|
34
|
+
directoryReader.readEntries((entries: Array<FileSystemEntry>) => {
|
|
35
|
+
resolve(entries);
|
|
36
|
+
}, reject);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function getFileEntriesFromReader(item: FileSystemFileEntry, onFileCallback: OnFileCallback, path: string) {
|
|
41
|
+
return await new Promise<void>((resolve, _reject) => {
|
|
42
|
+
item.file(async (file: File) => {
|
|
43
|
+
await onFileCallback(file, path);
|
|
44
|
+
resolve();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
package/src/{composables/useViewerOptions.ts → components/demo/mockDemoViewerStlDecimator.ts}
RENAMED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { ref } from 'vue';
|
|
2
|
-
import { defaultLoadViewerOptions, LoadViewerOptions } from '@/models/loadViewerOptions';
|
|
3
1
|
import axios from 'axios';
|
|
2
|
+
import { storeToRefs } from 'pinia';
|
|
3
|
+
import { DEMO_BUCKET_URL } from '@/constants';
|
|
4
4
|
import { stlResolution } from '@/models/scanState';
|
|
5
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
5
6
|
|
|
6
|
-
const options = ref<LoadViewerOptions>(defaultLoadViewerOptions);
|
|
7
|
-
|
|
8
|
-
const BASE_STATE_URL = 'https://webgl-3dr.singular.health/demo';
|
|
9
7
|
const ax = axios.create();
|
|
10
8
|
|
|
11
|
-
export function useViewerOptions() {
|
|
12
|
-
return options;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
9
|
export function mockDemoViewerStlDecimator() {
|
|
16
|
-
options
|
|
17
|
-
|
|
10
|
+
const { options } = storeToRefs(useViewerStore());
|
|
11
|
+
options.value.onResolveKeys = async (keys: string[]) => {
|
|
12
|
+
return await Promise.all(
|
|
18
13
|
keys.map(async (key) => {
|
|
19
14
|
if (key.includes('.stl')) {
|
|
20
15
|
try {
|
|
@@ -30,7 +25,8 @@ export function mockDemoViewerStlDecimator() {
|
|
|
30
25
|
console.error(err);
|
|
31
26
|
}
|
|
32
27
|
}
|
|
33
|
-
return `${
|
|
28
|
+
return `${DEMO_BUCKET_URL}/stl/${key}`;
|
|
34
29
|
})
|
|
35
30
|
);
|
|
31
|
+
};
|
|
36
32
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-dialog v-model="modelValue" :max-width="600" no-click-animation persistent>
|
|
3
|
+
<v-card>
|
|
4
|
+
<v-card-text class="pa-0">
|
|
5
|
+
<img src="@/assets/images/intro.svg" alt="intro" width="600" />
|
|
6
|
+
</v-card-text>
|
|
7
|
+
<v-card-text class="font-weight-bold text-h4 text-center">
|
|
8
|
+
<span>{{ t('texts.welcome') }}</span>
|
|
9
|
+
</v-card-text>
|
|
10
|
+
<v-card-text class="text-center">
|
|
11
|
+
<p>{{ t('texts.takeTour') }}</p>
|
|
12
|
+
</v-card-text>
|
|
13
|
+
<v-card-actions>
|
|
14
|
+
<v-spacer />
|
|
15
|
+
<v-btn color="primary" size="large" width="150" variant="text" @click="modelValue = false">
|
|
16
|
+
<span>{{ t('labels.dismiss') }}</span>
|
|
17
|
+
</v-btn>
|
|
18
|
+
<v-btn color="primary" size="large" width="150" variant="flat" @click="start">
|
|
19
|
+
<span>{{ t('labels.letsGo') }}</span>
|
|
20
|
+
</v-btn>
|
|
21
|
+
<v-spacer />
|
|
22
|
+
</v-card-actions>
|
|
23
|
+
<v-card-actions>
|
|
24
|
+
<v-spacer />
|
|
25
|
+
<v-checkbox v-model="dontShowAgain">
|
|
26
|
+
<template #label>
|
|
27
|
+
<span>{{ t('texts.dontShowAgain') }}</span>
|
|
28
|
+
</template>
|
|
29
|
+
</v-checkbox>
|
|
30
|
+
<v-spacer />
|
|
31
|
+
</v-card-actions>
|
|
32
|
+
</v-card>
|
|
33
|
+
</v-dialog>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
import { useIntroStore } from '@/stores/intro.store';
|
|
38
|
+
import { storeToRefs } from 'pinia';
|
|
39
|
+
import { useI18n } from 'vue-i18n';
|
|
40
|
+
|
|
41
|
+
type Emits = {
|
|
42
|
+
start: [void];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const emit = defineEmits<Emits>();
|
|
46
|
+
|
|
47
|
+
const { t } = useI18n();
|
|
48
|
+
const { dontShowAgain } = storeToRefs(useIntroStore());
|
|
49
|
+
|
|
50
|
+
const modelValue = defineModel<boolean>({ default: false });
|
|
51
|
+
|
|
52
|
+
function start(): void {
|
|
53
|
+
modelValue.value = false;
|
|
54
|
+
emit('start');
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tour v-model="modelValue" :max-width="400" :steps="steps">
|
|
3
|
+
<template #text="{ step }">
|
|
4
|
+
<v-card-text class="pa-0">
|
|
5
|
+
<img src="@/assets/images/intro.svg" alt="intro" width="400" />
|
|
6
|
+
</v-card-text>
|
|
7
|
+
<v-card-text>
|
|
8
|
+
<p>{{ step.text }}</p>
|
|
9
|
+
</v-card-text>
|
|
10
|
+
</template>
|
|
11
|
+
</tour>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import { Step } from '@/components/intro/tour/step';
|
|
16
|
+
import { computed } from 'vue';
|
|
17
|
+
import { useI18n } from 'vue-i18n';
|
|
18
|
+
|
|
19
|
+
const { t } = useI18n();
|
|
20
|
+
|
|
21
|
+
const modelValue = defineModel({ default: false });
|
|
22
|
+
|
|
23
|
+
const steps = computed<Step[]>(() => [
|
|
24
|
+
{
|
|
25
|
+
title: t('texts.tutorial.density.title'),
|
|
26
|
+
text: t('texts.tutorial.density.text'),
|
|
27
|
+
element: '#density',
|
|
28
|
+
position: 'bottom'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: t('texts.tutorial.controls3d.title'),
|
|
32
|
+
text: t('texts.tutorial.controls3d.text'),
|
|
33
|
+
element: '#volume',
|
|
34
|
+
position: 'right'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: t('texts.tutorial.controls2d.title'),
|
|
38
|
+
text: t('texts.tutorial.controls2d.text'),
|
|
39
|
+
element: '#sagittal',
|
|
40
|
+
position: 'left'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: t('texts.tutorial.settings.title'),
|
|
44
|
+
text: t('texts.tutorial.settings.text'),
|
|
45
|
+
element: '#settings',
|
|
46
|
+
position: 'top'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: t('texts.tutorial.updates.title'),
|
|
50
|
+
text: t('texts.tutorial.updates.text')
|
|
51
|
+
}
|
|
52
|
+
]);
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<teleport v-if="modelValue" to="body">
|
|
3
|
+
<div class="tour-bg"></div>
|
|
4
|
+
</teleport>
|
|
5
|
+
<v-overlay
|
|
6
|
+
v-bind="props"
|
|
7
|
+
v-model="modelValue"
|
|
8
|
+
:close-on-content-click="false"
|
|
9
|
+
location-strategy="connected"
|
|
10
|
+
no-click-animation
|
|
11
|
+
persistent
|
|
12
|
+
:scrim="false"
|
|
13
|
+
:target="target"
|
|
14
|
+
>
|
|
15
|
+
<v-card :ref="(el) => (modal = (el as VCard)?.$el)" v-bind="props">
|
|
16
|
+
<slot name="title" :step="currentStep">
|
|
17
|
+
<v-card-title>
|
|
18
|
+
<v-toolbar color="surface" density="compact">
|
|
19
|
+
<span>{{ currentStep.title }}</span>
|
|
20
|
+
<v-spacer />
|
|
21
|
+
<v-btn density="comfortable" icon="close" variant="text" @click="modelValue = false" />
|
|
22
|
+
</v-toolbar>
|
|
23
|
+
</v-card-title>
|
|
24
|
+
</slot>
|
|
25
|
+
<slot name="text" :step="currentStep">
|
|
26
|
+
<v-card-text>
|
|
27
|
+
<p>{{ currentStep.text }}</p>
|
|
28
|
+
</v-card-text>
|
|
29
|
+
</slot>
|
|
30
|
+
<slot name="actions" :step="currentStep">
|
|
31
|
+
<v-card-actions class="px-4">
|
|
32
|
+
<span class="text-primary">{{ step + 1 }} / {{ steps.length }}</span>
|
|
33
|
+
<v-spacer />
|
|
34
|
+
<v-btn v-if="hasPrevious" color="primary" variant="text" @click="previous">
|
|
35
|
+
<span>{{ t('labels.previous') }}</span>
|
|
36
|
+
</v-btn>
|
|
37
|
+
<v-btn v-if="hasNext" color="primary" variant="flat" @click="next">
|
|
38
|
+
<span>{{ t('labels.next') }}</span>
|
|
39
|
+
</v-btn>
|
|
40
|
+
<v-btn v-if="!hasNext" color="primary" variant="flat" @click="modelValue = false">
|
|
41
|
+
<span>{{ t('labels.finish') }}</span>
|
|
42
|
+
</v-btn>
|
|
43
|
+
</v-card-actions>
|
|
44
|
+
</slot>
|
|
45
|
+
</v-card>
|
|
46
|
+
</v-overlay>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
import { Step } from '@/components/intro/tour/step';
|
|
51
|
+
import { useBoundingBox } from '@/composables/useBoundingBox';
|
|
52
|
+
import { computed, ref, watch } from 'vue';
|
|
53
|
+
import { VCard } from 'vuetify/components';
|
|
54
|
+
import { useI18n } from 'vue-i18n';
|
|
55
|
+
|
|
56
|
+
interface Props {
|
|
57
|
+
gap?: number;
|
|
58
|
+
height?: string | number;
|
|
59
|
+
maxHeight?: string | number;
|
|
60
|
+
maxWidth?: string | number;
|
|
61
|
+
minHeight?: string | number;
|
|
62
|
+
minWidth?: string | number;
|
|
63
|
+
steps?: Step[];
|
|
64
|
+
width?: string | number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const { t } = useI18n();
|
|
68
|
+
|
|
69
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
70
|
+
gap: 8,
|
|
71
|
+
steps: () => []
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const element = ref<Element | null>(null);
|
|
75
|
+
const { x: ex, y: ey, width: ew, height: eh } = useBoundingBox(element);
|
|
76
|
+
|
|
77
|
+
const modal = ref<Element | null>(null);
|
|
78
|
+
const { width: mw, height: mh } = useBoundingBox(modal);
|
|
79
|
+
|
|
80
|
+
const target = ref<[number, number]>([0, 0]);
|
|
81
|
+
|
|
82
|
+
const modelValue = defineModel<boolean>({ default: false });
|
|
83
|
+
const step = defineModel<number>('step', { default: 0 });
|
|
84
|
+
|
|
85
|
+
const currentStep = computed(() => {
|
|
86
|
+
return props.steps[step.value];
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const hasPrevious = computed(() => {
|
|
90
|
+
return step.value > 0;
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const hasNext = computed(() => {
|
|
94
|
+
return step.value < props.steps.length - 1;
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const left = computed(() => {
|
|
98
|
+
return element.value !== null ? ex.value : document.documentElement.clientWidth / 2;
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const top = computed(() => {
|
|
102
|
+
return element.value !== null ? ey.value : document.documentElement.clientHeight / 2;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
watch(modelValue, (value) => {
|
|
106
|
+
if (value) {
|
|
107
|
+
refresh();
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
watch(currentStep, (step) => {
|
|
112
|
+
element.value = _queryElement(step.element);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
watch([element, currentStep, ex, ey, ew, eh, mw, mh], ([el, step, ex, ey, ew, eh, mw, mh]) => {
|
|
116
|
+
target.value = _recalculate(el, ex, ey, ew, eh, mw, mh, step.position);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
function _queryElement(selector?: string | Element): Element | null {
|
|
120
|
+
if (selector) {
|
|
121
|
+
return typeof selector === 'string' ? document.querySelector(selector) : selector;
|
|
122
|
+
} else {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function _recalculate(
|
|
128
|
+
el: Element | null,
|
|
129
|
+
ex: number,
|
|
130
|
+
ey: number,
|
|
131
|
+
ew: number,
|
|
132
|
+
eh: number,
|
|
133
|
+
mw: number,
|
|
134
|
+
mh: number,
|
|
135
|
+
pos?: string
|
|
136
|
+
): [number, number] {
|
|
137
|
+
if (el) {
|
|
138
|
+
switch (pos) {
|
|
139
|
+
case 'top': {
|
|
140
|
+
const x = Math.max(ex + ew / 2 - mw / 2, 0);
|
|
141
|
+
const y = Math.max(ey - mh - props.gap, 0);
|
|
142
|
+
return [x, y];
|
|
143
|
+
}
|
|
144
|
+
case 'right': {
|
|
145
|
+
const x = Math.max(ex + ew + props.gap, 0);
|
|
146
|
+
const y = Math.max(ey + eh / 2 - mh / 2, 0);
|
|
147
|
+
return [x, y];
|
|
148
|
+
}
|
|
149
|
+
case 'bottom': {
|
|
150
|
+
const x = Math.max(ex + ew / 2 - mw / 2, 0);
|
|
151
|
+
const y = Math.max(ey + eh + props.gap, 0);
|
|
152
|
+
return [x, y];
|
|
153
|
+
}
|
|
154
|
+
case 'left': {
|
|
155
|
+
const x = Math.max(ex - mw - props.gap, 0);
|
|
156
|
+
const y = Math.max(ey + eh / 2 - mh / 2, 0);
|
|
157
|
+
return [x, y];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// default to center
|
|
163
|
+
const x = document.documentElement.clientWidth / 2 - mw / 2;
|
|
164
|
+
const y = document.documentElement.clientHeight / 2 - mh / 2;
|
|
165
|
+
return [x, y];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function refresh(): void {
|
|
169
|
+
const step = currentStep.value;
|
|
170
|
+
element.value = _queryElement(step.element);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function previous(): void {
|
|
174
|
+
if (hasPrevious.value) {
|
|
175
|
+
step.value -= 1;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function next(): void {
|
|
180
|
+
if (hasNext.value) {
|
|
181
|
+
step.value += 1;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
defineExpose({ next, previous, refresh });
|
|
186
|
+
</script>
|
|
187
|
+
|
|
188
|
+
<style scoped lang="scss">
|
|
189
|
+
.tour-bg {
|
|
190
|
+
pointer-events: none;
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: calc(v-bind('top') * 1px);
|
|
193
|
+
left: calc(v-bind('left') * 1px);
|
|
194
|
+
width: calc(v-bind('ew') * 1px);
|
|
195
|
+
height: calc(v-bind('eh') * 1px);
|
|
196
|
+
box-shadow: 0 0 0 9999px rgba(31, 31, 55, 0.9);
|
|
197
|
+
border-radius: 8px;
|
|
198
|
+
z-index: 999;
|
|
199
|
+
transition:
|
|
200
|
+
width 500ms,
|
|
201
|
+
height 500ms,
|
|
202
|
+
top 500ms,
|
|
203
|
+
left 500ms;
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
@@ -44,12 +44,14 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
44
44
|
const rail = ref<HTMLDivElement>();
|
|
45
45
|
const splitIndex = ref<number>(0);
|
|
46
46
|
|
|
47
|
+
/* v8 ignore start -- @preserve */
|
|
47
48
|
const observer = new ResizeObserver((entries) => {
|
|
48
49
|
if (entries.length > 0) {
|
|
49
50
|
const railWidth = entries[0].contentRect.width;
|
|
50
51
|
calculateSplitIndex(railWidth);
|
|
51
52
|
}
|
|
52
53
|
});
|
|
54
|
+
/* v8 ignore stop -- @preserve */
|
|
53
55
|
|
|
54
56
|
const visible = computed(() => {
|
|
55
57
|
return props.actions.slice(0, splitIndex.value);
|
|
@@ -73,6 +75,7 @@ onBeforeUnmount(() => {
|
|
|
73
75
|
observer.disconnect();
|
|
74
76
|
});
|
|
75
77
|
|
|
78
|
+
/* v8 ignore start -- @preserve */
|
|
76
79
|
function calculateSplitIndex(railWidth: number): void {
|
|
77
80
|
const widths = props.actions.map((action) => action.width);
|
|
78
81
|
let sum = 48;
|
|
@@ -83,6 +86,7 @@ function calculateSplitIndex(railWidth: number): void {
|
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
}
|
|
89
|
+
/* v8 ignore stop -- @preserve */
|
|
86
90
|
</script>
|
|
87
91
|
|
|
88
92
|
<style lang="scss">
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-app>
|
|
3
|
+
<v-layout>
|
|
4
|
+
<demo-notification-navigation-drawer v-model="notificationDropdown.modal" />
|
|
5
|
+
<viewer-navigation-drawer @close="m_closeDialog = true" />
|
|
6
|
+
<viewer-app-bar @close="m_closeDialog = true" />
|
|
7
|
+
<viewer-action-bar />
|
|
8
|
+
<v-main id="main-panel">
|
|
9
|
+
<loading-spinner v-if="scanLoading" />
|
|
10
|
+
<viewer-main v-show="!scanLoading" @loaded="load" />
|
|
11
|
+
<data-overlay-modal />
|
|
12
|
+
<close-viewer-modal v-model:modal="m_closeDialog" />
|
|
13
|
+
<viewer-intro v-model="introActive" @start="tourActive = true" />
|
|
14
|
+
<viewer-tour v-model="tourActive" />
|
|
15
|
+
<whats-new-modal v-model="whatsNewActive" />
|
|
16
|
+
</v-main>
|
|
17
|
+
</v-layout>
|
|
18
|
+
</v-app>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { storeToRefs } from 'pinia';
|
|
23
|
+
import { nextTick, onMounted, ref, watch } from 'vue';
|
|
24
|
+
import {
|
|
25
|
+
DataOverlaysActions,
|
|
26
|
+
FileManagementActions,
|
|
27
|
+
FrontEndInterfaces,
|
|
28
|
+
GraphicType,
|
|
29
|
+
McadActions,
|
|
30
|
+
NotificationsActions,
|
|
31
|
+
ScanStateActions
|
|
32
|
+
} from '@3cr/types-ts';
|
|
33
|
+
import {
|
|
34
|
+
scanState,
|
|
35
|
+
setInitialScanStateFromPayload,
|
|
36
|
+
setScanStateFromPayload,
|
|
37
|
+
transactionStarted
|
|
38
|
+
} from '@/models/scanState';
|
|
39
|
+
import { useViewer3cr } from '@/composables/useViewer3cr';
|
|
40
|
+
import { useScanMovement } from '@/composables/useScanMovement';
|
|
41
|
+
import { useScanSliders } from '@/composables/useScanSliders';
|
|
42
|
+
import { LoadSessionState } from '@3cr/types-ts/types/LoadSessionState';
|
|
43
|
+
import { useDataOverlayStore } from '@/stores/data-overlay.store';
|
|
44
|
+
import { useMcadStore } from '@/stores/mcad.store';
|
|
45
|
+
import { mockDemoViewerStlDecimator } from '@/components/demo/mockDemoViewerStlDecimator';
|
|
46
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
47
|
+
import { useIntroStore } from '@/stores/intro.store';
|
|
48
|
+
import { useDrawerStore } from '@/stores/drawer.store';
|
|
49
|
+
import { useDemoStore } from '@/stores/demo.store';
|
|
50
|
+
import { DEMO_BUCKET_URL } from '@/constants';
|
|
51
|
+
import { useNotificationHandler } from '@/composables/useNotificationHandler';
|
|
52
|
+
import { DemoType, ViewerOptions, ViewerPayload } from '@3cr/viewer-types-ts';
|
|
53
|
+
|
|
54
|
+
interface Props {
|
|
55
|
+
payload?: ViewerPayload;
|
|
56
|
+
options?: ViewerOptions;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
60
|
+
options: () => ({})
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
useScanMovement();
|
|
64
|
+
useScanSliders();
|
|
65
|
+
const { handler } = useNotificationHandler();
|
|
66
|
+
const viewer3cr = useViewer3cr();
|
|
67
|
+
const dataOverlayStore = useDataOverlayStore();
|
|
68
|
+
const mcadStore = useMcadStore();
|
|
69
|
+
const { activeDrawer } = storeToRefs(useDrawerStore());
|
|
70
|
+
const { dontShowAgain } = storeToRefs(useIntroStore());
|
|
71
|
+
const { setIsDemo } = useDemoStore();
|
|
72
|
+
const { isDemo, demoOptions, demoType, notificationDropdown } = storeToRefs(useDemoStore());
|
|
73
|
+
const { options: opts, enableMouse, enableKeyboard } = storeToRefs(useViewerStore());
|
|
74
|
+
|
|
75
|
+
const scanLoading = ref<boolean>(true);
|
|
76
|
+
const m_closeDialog = ref<boolean>(false);
|
|
77
|
+
const introActive = ref<boolean>(false);
|
|
78
|
+
const whatsNewActive = ref<boolean>(false);
|
|
79
|
+
const tourActive = ref<boolean>(false);
|
|
80
|
+
|
|
81
|
+
watch(
|
|
82
|
+
props,
|
|
83
|
+
(props) => {
|
|
84
|
+
if (props.payload) {
|
|
85
|
+
setIsDemo(props.payload);
|
|
86
|
+
opts.value = isDemo.value ? demoOptions.value : props.options;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{ immediate: true }
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
watch([introActive, tourActive], ([intro, tour]) => {
|
|
93
|
+
if (!intro && !tour) {
|
|
94
|
+
whatsNewActive.value = true;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/* v8 ignore start -- @preserve */
|
|
99
|
+
onMounted(() => {
|
|
100
|
+
viewer3cr.addInterfaceHandler(FrontEndInterfaces.notifications, async (message: string, action: string) => {
|
|
101
|
+
await handler(action as NotificationsActions, message);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
viewer3cr.addActionHandler(FileManagementActions.fm02, async (message: string) => {
|
|
105
|
+
enableMouse.value = true;
|
|
106
|
+
enableKeyboard.value = true;
|
|
107
|
+
setInitialScanStateFromPayload(message);
|
|
108
|
+
if (opts.value.onScanLoaded) {
|
|
109
|
+
await opts.value.onScanLoaded(scanState.value);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
await nextTick();
|
|
113
|
+
|
|
114
|
+
transactionStarted.value = false;
|
|
115
|
+
scanLoading.value = false;
|
|
116
|
+
activeDrawer.value = 'display';
|
|
117
|
+
await loadDemoData();
|
|
118
|
+
switch (demoType.value) {
|
|
119
|
+
case DemoType.Licence:
|
|
120
|
+
await viewer3cr.setNavCubeGraphics(GraphicType.LETTER);
|
|
121
|
+
break;
|
|
122
|
+
case DemoType.Patient:
|
|
123
|
+
await viewer3cr.setNavCubeGraphics(GraphicType.BODY_SYMBOL);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
await nextTick();
|
|
128
|
+
|
|
129
|
+
if (!dontShowAgain.value) {
|
|
130
|
+
introActive.value = true;
|
|
131
|
+
} else {
|
|
132
|
+
whatsNewActive.value = true;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
viewer3cr.addActionHandler(
|
|
137
|
+
FileManagementActions.fm09,
|
|
138
|
+
async (_1: string, returnChannel: string, returnTo: string) => {
|
|
139
|
+
if (opts.value.onResolveKeys) {
|
|
140
|
+
const keys = JSON.parse(returnChannel) as string[];
|
|
141
|
+
const urls = await opts.value.onResolveKeys(keys);
|
|
142
|
+
await viewer3cr.loadMcadObjects({ message: undefined, returnChannel: urls, returnTo });
|
|
143
|
+
} else {
|
|
144
|
+
throw new Error('onResolveKeys has not been defined in the viewer options');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
viewer3cr.addActionHandler(ScanStateActions.ss01, async (message: string) => {
|
|
150
|
+
await setScanStateFromPayload(message);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
viewer3cr.addActionHandler(ScanStateActions.ss02, (message: string) => {
|
|
154
|
+
dataOverlayStore.setDataOverlayState(message);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
viewer3cr.addActionHandler(ScanStateActions.ss03, (message: string) => {
|
|
158
|
+
mcadStore.setMcadState(message);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
viewer3cr.addActionHandler(DataOverlaysActions.do01, (message: string) => {
|
|
162
|
+
dataOverlayStore.setInitialDataOverlayState(message);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
viewer3cr.addActionHandler(DataOverlaysActions.do02, (message: string) => {
|
|
166
|
+
dataOverlayStore.setDataOverlayEvent(message);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
viewer3cr.addActionHandler(DataOverlaysActions.do07, (message: string) => {
|
|
170
|
+
dataOverlayStore.setDataOverlayEvent(message);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
viewer3cr.addActionHandler('mu_17', (message: string) => {
|
|
174
|
+
dataOverlayStore.setDataOverlayEvent(message);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
viewer3cr.addActionHandler('mu_18', (message: string) => {
|
|
178
|
+
dataOverlayStore.setDataOverlayEvent(message);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
viewer3cr.addActionHandler(McadActions.mc01, (message: string) => {
|
|
182
|
+
mcadStore.setInitialMcadState(message);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
viewer3cr.addActionHandler(McadActions.mc02, (message: string) => {
|
|
186
|
+
mcadStore.setMcadEvent(message);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
/* v8 ignore stop -- @preserve */
|
|
190
|
+
|
|
191
|
+
/* v8 ignore start -- @preserve */
|
|
192
|
+
async function loadSession(url: string): Promise<void> {
|
|
193
|
+
const message: LoadSessionState = { Version: '0.0.0', Url: url };
|
|
194
|
+
if (url.includes('3crs')) {
|
|
195
|
+
await viewer3cr.loadScanSession({ message });
|
|
196
|
+
} else if (url.includes('3crds')) {
|
|
197
|
+
await viewer3cr.setDataOverlaySession({ message });
|
|
198
|
+
} else if (url.includes('3crms')) {
|
|
199
|
+
await viewer3cr.loadMcadObjects({ message });
|
|
200
|
+
} else {
|
|
201
|
+
throw new Error('Invalid URL type');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/* v8 ignore stop -- @preserve */
|
|
205
|
+
|
|
206
|
+
async function load(): Promise<void> {
|
|
207
|
+
scanLoading.value = true;
|
|
208
|
+
await viewer3cr.loadScan({ message: props.payload });
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* v8 ignore start -- @preserve */
|
|
212
|
+
async function loadDemoData(): Promise<void> {
|
|
213
|
+
if (isDemo.value) {
|
|
214
|
+
mockDemoViewerStlDecimator();
|
|
215
|
+
const annotations: LoadSessionState = { Version: '0.0.0', Url: `${DEMO_BUCKET_URL}/state/annotations.3crds` };
|
|
216
|
+
await viewer3cr.addDataOverlaySession({ message: annotations });
|
|
217
|
+
const measurements: LoadSessionState = { Version: '0.0.0', Url: `${DEMO_BUCKET_URL}/state/measurements.3crds` };
|
|
218
|
+
await viewer3cr.addDataOverlaySession({ message: measurements });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/* v8 ignore stop -- @preserve */
|
|
222
|
+
|
|
223
|
+
defineExpose({ loadSession, load, m_closeDialog, introActive, tourActive, whatsNewActive });
|
|
224
|
+
</script>
|