@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
|
@@ -1,71 +1,177 @@
|
|
|
1
|
-
import { mount } from '@vue/test-utils';
|
|
2
|
-
import {
|
|
1
|
+
import { flushPromises, mount } from '@vue/test-utils';
|
|
2
|
+
import { VMenu } from 'vuetify/components';
|
|
3
3
|
import SettingsMenu from '@/components/modal/menus/SettingsMenu.vue';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { reactive } from 'vue';
|
|
5
|
+
import { inflateScanState } from '@/functions/modelHelper';
|
|
6
|
+
import OtaClient from '@crowdin/ota-client';
|
|
7
|
+
import { createTestingPinia } from '@pinia/testing';
|
|
8
|
+
import { createPinia, setActivePinia } from 'pinia';
|
|
9
|
+
import { MockImportOriginal } from '@test/MockImportOriginal';
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
vi.mock(
|
|
12
|
+
'@/stores/language.store',
|
|
13
|
+
async (importOriginal: MockImportOriginal<typeof import('@/stores/language.store')>) => {
|
|
14
|
+
return {
|
|
15
|
+
...(await importOriginal()),
|
|
16
|
+
useLanguageStore: vi.fn().mockReturnValue({
|
|
17
|
+
getLanguages: vi
|
|
18
|
+
.fn()
|
|
19
|
+
.mockResolvedValue([
|
|
20
|
+
{ language: 'english', editorCode: 'en', crowdinLanguageCode: 'en', code: 'en', countryCode: 'en' }
|
|
21
|
+
]),
|
|
22
|
+
language: 'jpn'
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
vi.mock('pinia', async (importOriginal: MockImportOriginal<typeof import('pinia')>) => {
|
|
28
|
+
return {
|
|
29
|
+
...(await importOriginal()),
|
|
30
|
+
storeToRefs: vi.fn().mockReturnValue({
|
|
31
|
+
language: { value: 'jpn' },
|
|
32
|
+
loading: { value: false }
|
|
33
|
+
})
|
|
34
|
+
};
|
|
35
|
+
});
|
|
14
36
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
await wrapper.findComponent(VMenu).setValue(false);
|
|
19
|
-
await wrapper.setProps({ modelValue: false });
|
|
20
|
-
expect(wrapper.findComponent(VCard).isVisible()).toBeFalsy();
|
|
21
|
-
});
|
|
37
|
+
describe('SettingsMenu', () => {
|
|
38
|
+
setActivePinia(createPinia());
|
|
39
|
+
vi.spyOn(OtaClient.prototype, 'listLanguages').mockResolvedValue([]);
|
|
22
40
|
|
|
23
|
-
it('should
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
it('should open menu when ModelValue is true', async () => {
|
|
42
|
+
const wrapper = mount(SettingsMenu, {
|
|
43
|
+
plugins: [createTestingPinia({ createSpy: vi.fn })]
|
|
44
|
+
});
|
|
45
|
+
const menu = wrapper.findComponent(VMenu);
|
|
46
|
+
await menu.setValue(true);
|
|
47
|
+
expect(menu.isVisible()).toBe(true);
|
|
28
48
|
});
|
|
49
|
+
it('should update brightness modelValue', async () => {
|
|
50
|
+
vi.spyOn(OtaClient.prototype, 'listLanguages').mockResolvedValue([]);
|
|
51
|
+
const scanState = reactive(inflateScanState());
|
|
52
|
+
const wrapper = mount(SettingsMenu, {
|
|
53
|
+
plugins: [createTestingPinia({ createSpy: vi.fn })],
|
|
54
|
+
global: {
|
|
55
|
+
mocks: {
|
|
56
|
+
scanState
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const menu = wrapper.findComponent(VMenu);
|
|
61
|
+
await menu.setValue(true);
|
|
62
|
+
await flushPromises();
|
|
63
|
+
const brightnessField = wrapper.findComponentByTestId('brightness');
|
|
64
|
+
await flushPromises();
|
|
65
|
+
await brightnessField.setValue(75);
|
|
29
66
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
await
|
|
34
|
-
|
|
67
|
+
scanState.Display.Brightness = 75;
|
|
68
|
+
expect(scanState.Display.Brightness).toBe(75);
|
|
69
|
+
const contrastField = wrapper.findComponentByTestId('contrast');
|
|
70
|
+
await flushPromises();
|
|
71
|
+
await contrastField.setValue(75);
|
|
72
|
+
scanState.Display.Contrast = 75;
|
|
73
|
+
expect(scanState.Display.Contrast).toBe(75);
|
|
74
|
+
const opacityField = wrapper.findComponentByTestId('opacity');
|
|
75
|
+
await flushPromises();
|
|
76
|
+
await opacityField.setValue(75);
|
|
77
|
+
scanState.Display.Opacity = 75;
|
|
78
|
+
expect(scanState.Display.Opacity).toBe(75);
|
|
35
79
|
});
|
|
80
|
+
it('should update interactionSettings modelValue', async () => {
|
|
81
|
+
vi.spyOn(OtaClient.prototype, 'listLanguages').mockResolvedValue([]);
|
|
82
|
+
const scanState = reactive(inflateScanState());
|
|
83
|
+
const wrapper = mount(SettingsMenu, {
|
|
84
|
+
plugins: [createTestingPinia({ createSpy: vi.fn })],
|
|
85
|
+
global: {
|
|
86
|
+
mocks: {
|
|
87
|
+
scanState
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const menu = wrapper.findComponent(VMenu);
|
|
92
|
+
await menu.setValue(true);
|
|
93
|
+
await flushPromises();
|
|
94
|
+
const panSensitivity = wrapper.findComponentByTestId('pan');
|
|
95
|
+
await flushPromises();
|
|
96
|
+
await panSensitivity.setValue(75);
|
|
97
|
+
scanState.InteractionSettings.PanSensivitity = 75;
|
|
98
|
+
expect(scanState.InteractionSettings.PanSensivitity).toBe(75);
|
|
36
99
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
expect(scanState.
|
|
42
|
-
});
|
|
100
|
+
const zoomSensitivity = wrapper.findComponentByTestId('zoom');
|
|
101
|
+
await flushPromises();
|
|
102
|
+
await zoomSensitivity.setValue(75);
|
|
103
|
+
scanState.InteractionSettings.ZoomSensitivity = 75;
|
|
104
|
+
expect(scanState.InteractionSettings.ZoomSensitivity).toBe(75);
|
|
43
105
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
expect(scanState.
|
|
49
|
-
});
|
|
106
|
+
const rotateSensitivity = wrapper.findComponentByTestId('rotate');
|
|
107
|
+
await flushPromises();
|
|
108
|
+
await rotateSensitivity.setValue(75);
|
|
109
|
+
scanState.InteractionSettings.RotateSensitivity = 75;
|
|
110
|
+
expect(scanState.InteractionSettings.RotateSensitivity).toBe(75);
|
|
50
111
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
expect(scanState.
|
|
112
|
+
const cameraRotateSensitivity = wrapper.findComponentByTestId('cameraRotate');
|
|
113
|
+
await flushPromises();
|
|
114
|
+
await cameraRotateSensitivity.setValue(75);
|
|
115
|
+
scanState.InteractionSettings.CameraRotateSensitivity = 75;
|
|
116
|
+
expect(scanState.InteractionSettings.CameraRotateSensitivity).toBe(75);
|
|
56
117
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const wrapper = mount(SettingsMenu, {
|
|
61
|
-
|
|
62
|
-
|
|
118
|
+
it('should change modelValue for switch', async () => {
|
|
119
|
+
vi.spyOn(OtaClient.prototype, 'listLanguages').mockResolvedValue([]);
|
|
120
|
+
const scanState = reactive(inflateScanState());
|
|
121
|
+
const wrapper = mount(SettingsMenu, {
|
|
122
|
+
plugins: [createTestingPinia({ createSpy: vi.fn })],
|
|
123
|
+
global: {
|
|
124
|
+
mocks: {
|
|
125
|
+
scanState
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const menu = wrapper.findComponent(VMenu);
|
|
130
|
+
await menu.setValue(true);
|
|
131
|
+
await flushPromises();
|
|
132
|
+
const vSwitch = wrapper.findComponentByTestId('switch');
|
|
133
|
+
expect(wrapper.vm.isVisible).toBe(true);
|
|
134
|
+
wrapper.vm.isVisible = false;
|
|
135
|
+
vSwitch.setValue(false);
|
|
136
|
+
expect(wrapper.vm.isVisible).toBe(false);
|
|
63
137
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
const wrapper = mount(SettingsMenu, {
|
|
68
|
-
|
|
69
|
-
|
|
138
|
+
it('should change modelValue for stlResolution', async () => {
|
|
139
|
+
vi.spyOn(OtaClient.prototype, 'listLanguages').mockResolvedValue([]);
|
|
140
|
+
const scanState = reactive(inflateScanState());
|
|
141
|
+
const wrapper = mount(SettingsMenu, {
|
|
142
|
+
plugins: [createTestingPinia({ createSpy: vi.fn })],
|
|
143
|
+
global: {
|
|
144
|
+
mocks: {
|
|
145
|
+
scanState
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
const menu = wrapper.findComponent(VMenu);
|
|
150
|
+
await menu.setValue(true);
|
|
151
|
+
await flushPromises();
|
|
152
|
+
const resolution = wrapper.findComponentByTestId('resolution');
|
|
153
|
+
await flushPromises();
|
|
154
|
+
await resolution.setValue(15);
|
|
155
|
+
wrapper.vm.stlResolution = 15;
|
|
156
|
+
expect(wrapper.vm.stlResolution).toBe(15);
|
|
70
157
|
});
|
|
158
|
+
// it('should set language correctly', async () => {
|
|
159
|
+
// vi.spyOn(OtaClient.prototype, 'listLanguages').mockResolvedValue([]);
|
|
160
|
+
// const scanState = reactive(inflateScanState());
|
|
161
|
+
// const wrapper = mount(SettingsMenu, {
|
|
162
|
+
// plugins: [createTestingPinia({ createSpy: vi.fn })],
|
|
163
|
+
// global: {
|
|
164
|
+
// mocks: {
|
|
165
|
+
// scanState
|
|
166
|
+
// }
|
|
167
|
+
// }
|
|
168
|
+
// });
|
|
169
|
+
// const menu = wrapper.findComponent(VMenu);
|
|
170
|
+
// await menu.setValue(true);
|
|
171
|
+
// await flushPromises();
|
|
172
|
+
// const selectedLanguage = wrapper.findComponentByTestId('language');
|
|
173
|
+
// await selectedLanguage.setValue('english');
|
|
174
|
+
// await flushPromises();
|
|
175
|
+
// expect(selectedLanguage.vm.modelValue).toBe({});
|
|
176
|
+
// });
|
|
71
177
|
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-dialog width="800">
|
|
3
|
+
<v-card>
|
|
4
|
+
<v-card-text>
|
|
5
|
+
<v-row no-gutters>
|
|
6
|
+
<v-col class="my-auto">
|
|
7
|
+
<v-img data-testid="demo-img" :src="logo" height="64" />
|
|
8
|
+
</v-col>
|
|
9
|
+
<v-col class="ma-auto text-center text-xs-regular">
|
|
10
|
+
<p>{{ t('texts.viewerAbout') }}</p>
|
|
11
|
+
<br />
|
|
12
|
+
<p>{{ t('texts.aiDisclaimer') }}</p>
|
|
13
|
+
<br />
|
|
14
|
+
<p>{{ t('texts.diagnosticDisclaimer') }}</p>
|
|
15
|
+
</v-col>
|
|
16
|
+
</v-row>
|
|
17
|
+
<div class="py-4">
|
|
18
|
+
<v-divider />
|
|
19
|
+
</div>
|
|
20
|
+
<v-row no-gutters>
|
|
21
|
+
<v-col>{{ t('labels.version') }}</v-col>
|
|
22
|
+
<v-col class="text-overline text-end">{{ version }}</v-col>
|
|
23
|
+
</v-row>
|
|
24
|
+
<v-row no-gutters>
|
|
25
|
+
<v-col>{{ t('labels.demoType') }}</v-col>
|
|
26
|
+
<v-col data-testid="demo-text" class="text-overline text-end">{{ demo }}</v-col>
|
|
27
|
+
</v-row>
|
|
28
|
+
</v-card-text>
|
|
29
|
+
</v-card>
|
|
30
|
+
</v-dialog>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup lang="ts">
|
|
34
|
+
import { computed } from 'vue';
|
|
35
|
+
import { useI18n } from 'vue-i18n';
|
|
36
|
+
import { storeToRefs } from 'pinia';
|
|
37
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
38
|
+
import { useTheme } from 'vuetify';
|
|
39
|
+
import { useDemoStore } from '@/stores/demo.store';
|
|
40
|
+
import lightLogo from '@/assets/logos/singular-health/black/black.svg';
|
|
41
|
+
import darkLogo from '@/assets/logos/singular-health/white/white.svg';
|
|
42
|
+
import { DemoType } from '@3cr/viewer-types-ts';
|
|
43
|
+
|
|
44
|
+
const theme = useTheme();
|
|
45
|
+
const { t } = useI18n();
|
|
46
|
+
const { demoType } = storeToRefs(useDemoStore());
|
|
47
|
+
const { version } = storeToRefs(useViewerStore());
|
|
48
|
+
|
|
49
|
+
const demo = computed(() => {
|
|
50
|
+
switch (demoType.value) {
|
|
51
|
+
case DemoType.Licence:
|
|
52
|
+
return t('enums.demoType.licence');
|
|
53
|
+
case DemoType.Patient:
|
|
54
|
+
return t('enums.demoType.patient');
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const logo = computed(() => {
|
|
59
|
+
return theme.current.value.dark ? darkLogo : lightLogo;
|
|
60
|
+
});
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-list v-model:selected="selected" color="primary" :items="aiModels" select-strategy="leaf" selectable>
|
|
3
|
+
<template v-for="aiModel in aiModels" :key="aiModel.key">
|
|
4
|
+
<v-list-item data-testid="item" :value="aiModel.key">
|
|
5
|
+
<template #prepend>
|
|
6
|
+
<v-img class="rounded bg-shark-200" :src="aiModel.image" :alt="aiModel.key" width="80" height="112" />
|
|
7
|
+
</template>
|
|
8
|
+
<template #append="{ isSelected }">
|
|
9
|
+
<v-btn
|
|
10
|
+
data-testid="btn"
|
|
11
|
+
variant="outlined"
|
|
12
|
+
class="circle-btn"
|
|
13
|
+
size="24"
|
|
14
|
+
:style="{
|
|
15
|
+
backgroundColor: isSelected ? '#6875EC' : 'transparent',
|
|
16
|
+
color: isSelected ? 'white' : 'transparent'
|
|
17
|
+
}"
|
|
18
|
+
:icon="isSelected ? 'check_small' : 'circle'"
|
|
19
|
+
/>
|
|
20
|
+
</template>
|
|
21
|
+
<div class="d-flex flex-column h-100 justify-space-between px-4">
|
|
22
|
+
<div>
|
|
23
|
+
<v-list-item-title>{{ aiModel.title }}</v-list-item-title>
|
|
24
|
+
<v-list-item-subtitle>{{ aiModel.description }}</v-list-item-subtitle>
|
|
25
|
+
</div>
|
|
26
|
+
<div>
|
|
27
|
+
<v-list-item-subtitle>{{ aiModel.subtitle }}</v-list-item-subtitle>
|
|
28
|
+
<v-divider color="minsk_900" class="my-1" />
|
|
29
|
+
<div class="d-flex align-center">
|
|
30
|
+
<v-icon color="minsk_500" class="mr-1" icon="toll" />
|
|
31
|
+
<v-list-item-subtitle>Credits: {{ aiModel.cost }}</v-list-item-subtitle>
|
|
32
|
+
<v-spacer />
|
|
33
|
+
<a :href="aiModel.url" target="_blank" class="text-xs-medium text-minsk_500 ml-auto">Learn more</a>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</v-list-item>
|
|
38
|
+
</template>
|
|
39
|
+
</v-list>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup lang="ts">
|
|
43
|
+
import { ref, onMounted } from 'vue';
|
|
44
|
+
import { storeToRefs } from 'pinia';
|
|
45
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
46
|
+
import { AIModel } from '@3cr/viewer-types-ts';
|
|
47
|
+
|
|
48
|
+
const { options } = storeToRefs(useViewerStore());
|
|
49
|
+
|
|
50
|
+
const selected = defineModel<string[]>('selected', { default: [] });
|
|
51
|
+
|
|
52
|
+
const aiModels = ref<AIModel[]>();
|
|
53
|
+
|
|
54
|
+
onMounted(async () => {
|
|
55
|
+
await fetchAIModels();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
async function fetchAIModels(): Promise<void> {
|
|
59
|
+
if (options.value.getAIModels) {
|
|
60
|
+
aiModels.value = await options.value.getAIModels();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
defineExpose({ fetchAIModels, aiModels, selected });
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<style scoped lang="scss">
|
|
67
|
+
:deep(.v-list-item__content) {
|
|
68
|
+
height: 100%;
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-dialog v-model="modalState" max-width="800"
|
|
2
|
+
<v-dialog v-model="modalState" max-width="800">
|
|
3
3
|
<v-card class="prompt-box pa-2 py-4" rounded="xl">
|
|
4
4
|
<v-card-title class="text-body-1 d-flex align-center text-wrap mx-3 mb-4">
|
|
5
|
-
<span>{{
|
|
5
|
+
<span>{{ gptQuestion.Question }}</span>
|
|
6
6
|
</v-card-title>
|
|
7
|
-
<!-- <v-card-subtitle> From ChatGPT: </v-card-subtitle>-->
|
|
8
7
|
<div class="bordered-gradient-box" v-if="smartResponses">
|
|
9
8
|
<div class="prompt" style="font-size: 28px">
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
<span style="font-size: 18px" v-html="smartResponses?.GptResponse"> </span>
|
|
9
|
+
<v-img src="@/assets/images/dark/magic-wand.svg" class="animated" max-width="42" />
|
|
10
|
+
<span class="mr-4" style="font-size: 18px" v-html="smartResponses?.GptResponse"></span>
|
|
13
11
|
</div>
|
|
14
12
|
</div>
|
|
15
|
-
|
|
16
|
-
<!-- <v-card-text v-html="smartResponses?.GptResponse"> </v-card-text>-->
|
|
17
13
|
<div class="prompt bordered-gradient-box" v-else>
|
|
18
14
|
<div class="loading"></div>
|
|
19
15
|
</div>
|
|
20
|
-
<v-card-text class="py-0">
|
|
21
|
-
<span class="text-caption" style="font-size: 10px !important; line-height: 10px !important"
|
|
22
|
-
>* 3Dicom's Annotiva AI is powered by AI Large Language Models (LLMs) which generate general health
|
|
23
|
-
information for improved patient comprehension. <br />It is NOT for diagnostic usage.
|
|
24
|
-
</span>
|
|
25
|
-
</v-card-text>
|
|
26
|
-
|
|
27
16
|
<v-card-title v-if="smartResponses" class="text-body-1 d-flex align-center text-wrap mx-3 mt-6 mb-0">
|
|
28
|
-
|
|
17
|
+
<span>{{ t('texts.stillCurious') }}</span>
|
|
29
18
|
</v-card-title>
|
|
30
19
|
<v-card-text class="py-0">
|
|
31
20
|
<v-chip-group column v-model="item">
|
|
@@ -51,35 +40,38 @@
|
|
|
51
40
|
<script setup lang="ts">
|
|
52
41
|
import { computed, ref, watch } from 'vue';
|
|
53
42
|
import { GptService } from '@/services/gpt.service';
|
|
54
|
-
|
|
55
|
-
import {
|
|
43
|
+
|
|
44
|
+
import { useI18n } from 'vue-i18n';
|
|
45
|
+
import { GptQuestion, GptResponsePayload } from '@3cr/viewer-types-ts';
|
|
56
46
|
|
|
57
47
|
interface Props {
|
|
58
|
-
|
|
59
|
-
questionText: string;
|
|
48
|
+
modelValue?: boolean;
|
|
60
49
|
title: string;
|
|
61
|
-
|
|
50
|
+
gptQuestion: GptQuestion;
|
|
62
51
|
}
|
|
63
52
|
|
|
64
53
|
type Emits = {
|
|
65
|
-
'update:
|
|
54
|
+
'update:modelValue': [value: boolean];
|
|
66
55
|
askFollowup: [value: GptQuestion];
|
|
67
56
|
};
|
|
68
57
|
|
|
69
|
-
const props = defineProps<Props>()
|
|
58
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
59
|
+
modelValue: false
|
|
60
|
+
});
|
|
70
61
|
|
|
71
62
|
const emit = defineEmits<Emits>();
|
|
72
63
|
|
|
73
|
-
const
|
|
64
|
+
const { t } = useI18n();
|
|
74
65
|
|
|
66
|
+
const item = ref<number>();
|
|
75
67
|
const smartResponses = ref<GptResponsePayload>();
|
|
76
68
|
|
|
77
69
|
const modalState = computed({
|
|
78
70
|
get(): boolean {
|
|
79
|
-
return props.
|
|
71
|
+
return props.modelValue;
|
|
80
72
|
},
|
|
81
73
|
set(value: boolean): void {
|
|
82
|
-
emit('update:
|
|
74
|
+
emit('update:modelValue', value);
|
|
83
75
|
}
|
|
84
76
|
});
|
|
85
77
|
|
|
@@ -94,12 +86,11 @@ watch(
|
|
|
94
86
|
);
|
|
95
87
|
|
|
96
88
|
async function getSmartResponses(): Promise<void> {
|
|
89
|
+
const key = props.gptQuestion.ApiPreFilledRequestKey;
|
|
97
90
|
smartResponses.value = await GptService.Instantiate()
|
|
98
|
-
.GenerateAnnotations(props.title,
|
|
91
|
+
.GenerateAnnotations(props.title, key)
|
|
99
92
|
.then((data) => data.data);
|
|
100
|
-
item.value = smartResponses.value?.FollowupQuestions.findIndex(
|
|
101
|
-
(question) => question.ApiPreFilledRequestKey === props.questionKey
|
|
102
|
-
);
|
|
93
|
+
item.value = smartResponses.value?.FollowupQuestions.findIndex((question) => question.ApiPreFilledRequestKey === key);
|
|
103
94
|
}
|
|
104
95
|
|
|
105
96
|
function askFollowUpQuestion(question: GptQuestion): void {
|
|
@@ -107,7 +98,7 @@ function askFollowUpQuestion(question: GptQuestion): void {
|
|
|
107
98
|
}
|
|
108
99
|
</script>
|
|
109
100
|
|
|
110
|
-
<style>
|
|
101
|
+
<style scoped lang="scss">
|
|
111
102
|
.loading {
|
|
112
103
|
font-size: 30px;
|
|
113
104
|
}
|
|
@@ -145,7 +136,6 @@ function askFollowUpQuestion(question: GptQuestion): void {
|
|
|
145
136
|
margin-right: 20px;
|
|
146
137
|
padding: 20px;
|
|
147
138
|
text-align: center;
|
|
148
|
-
color: black;
|
|
149
139
|
display: flex;
|
|
150
140
|
justify-content: space-between;
|
|
151
141
|
align-items: center;
|
|
@@ -161,12 +151,14 @@ function askFollowUpQuestion(question: GptQuestion): void {
|
|
|
161
151
|
border-radius: 16px;
|
|
162
152
|
padding: 3px;
|
|
163
153
|
background: linear-gradient(to right, #6fb3f2, #4e51f5);
|
|
164
|
-
|
|
154
|
+
mask:
|
|
155
|
+
linear-gradient(#fff 0 0) content-box,
|
|
156
|
+
linear-gradient(#fff 0 0);
|
|
157
|
+
mask-composite: exclude;
|
|
165
158
|
-webkit-mask:
|
|
166
159
|
linear-gradient(#fff 0 0) content-box,
|
|
167
160
|
linear-gradient(#fff 0 0);
|
|
168
161
|
-webkit-mask-composite: xor;
|
|
169
|
-
mask-composite: exclude;
|
|
170
162
|
}
|
|
171
163
|
|
|
172
164
|
.prompt span {
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-dialog v-model="modelValue" persistent>
|
|
3
|
+
<v-card max-width="450" class="mx-auto" style="overflow-y: hidden">
|
|
4
|
+
<v-card-title class="text-h4">
|
|
5
|
+
<span>{{ t('labels.annotivaAi') }}: {{ t('labels.autoAnnotate') }}</span>
|
|
6
|
+
</v-card-title>
|
|
7
|
+
<div class="prompt">
|
|
8
|
+
<div style="font-size: 6px; top: 30px; left: 40px">
|
|
9
|
+
<div class="cog" style="--cog-colour: #5a93ed"></div>
|
|
10
|
+
<div
|
|
11
|
+
class="cog anti-clockwise"
|
|
12
|
+
style="--cog-colour: #2955da; margin-top: 2.25em; margin-left: -3.375em"
|
|
13
|
+
></div>
|
|
14
|
+
<div class="cog" style="--cog-colour: #bad3f8; margin-top: 5.625em; margin-left: -1.125em"></div>
|
|
15
|
+
</div>
|
|
16
|
+
<v-card-text class="ml-10 text-h5">
|
|
17
|
+
{{ text }}
|
|
18
|
+
</v-card-text>
|
|
19
|
+
</div>
|
|
20
|
+
</v-card>
|
|
21
|
+
</v-dialog>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { computed, ref, watch } from 'vue';
|
|
26
|
+
import { useI18n } from 'vue-i18n';
|
|
27
|
+
|
|
28
|
+
const { t, tm } = useI18n();
|
|
29
|
+
|
|
30
|
+
const text = ref<string>('');
|
|
31
|
+
|
|
32
|
+
const modelValue = defineModel<boolean>({ default: false });
|
|
33
|
+
|
|
34
|
+
const loaderTexts = computed(() => tm('texts.autoAnnotateLoading') as string[]);
|
|
35
|
+
|
|
36
|
+
watch(modelValue, (isOpen) => {
|
|
37
|
+
if (isOpen) {
|
|
38
|
+
text.value = getRandomLoaderText();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
function getRandomLoaderText(): string {
|
|
43
|
+
const randomIndex = Math.floor(Math.random() * loaderTexts.value.length);
|
|
44
|
+
return loaderTexts.value[randomIndex];
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style scoped lang="scss">
|
|
49
|
+
.prompt {
|
|
50
|
+
margin-left: 20px;
|
|
51
|
+
margin-right: 20px;
|
|
52
|
+
padding: 20px;
|
|
53
|
+
text-align: center;
|
|
54
|
+
color: black;
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
align-items: center;
|
|
58
|
+
margin-bottom: 15px;
|
|
59
|
+
position: relative;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.prompt::before {
|
|
63
|
+
content: '';
|
|
64
|
+
position: absolute;
|
|
65
|
+
inset: 0;
|
|
66
|
+
border-radius: 16px;
|
|
67
|
+
padding: 3px;
|
|
68
|
+
background: linear-gradient(to right, #6fb3f2, #4e51f5);
|
|
69
|
+
|
|
70
|
+
-webkit-mask:
|
|
71
|
+
linear-gradient(#fff 0 0) content-box,
|
|
72
|
+
linear-gradient(#fff 0 0);
|
|
73
|
+
-webkit-mask-composite: xor;
|
|
74
|
+
|
|
75
|
+
mask:
|
|
76
|
+
linear-gradient(#fff 0 0) content-box,
|
|
77
|
+
linear-gradient(#fff 0 0);
|
|
78
|
+
mask-composite: exclude;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
div.cog {
|
|
82
|
+
border-radius: 0.25em;
|
|
83
|
+
border: solid 0.55em var(--cog-colour, #eee);
|
|
84
|
+
display: inline-block;
|
|
85
|
+
padding: 1.125em;
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: inherit;
|
|
88
|
+
left: inherit;
|
|
89
|
+
-webkit-animation: rotate var(--cog-speed, 3s) linear infinite;
|
|
90
|
+
-moz-animation: rotate var(--cog-speed, 3s) linear infinite;
|
|
91
|
+
animation: rotate var(--cog-speed, 3s) linear infinite;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
div.cog.anti-clockwise {
|
|
95
|
+
-webkit-animation-direction: reverse;
|
|
96
|
+
-moz-animation-direction: reverse;
|
|
97
|
+
animation-direction: reverse;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
div.cog::before {
|
|
101
|
+
border: solid 0.55em var(--cog-colour, #eee);
|
|
102
|
+
padding: 1.125em;
|
|
103
|
+
position: absolute;
|
|
104
|
+
content: '';
|
|
105
|
+
transform: translate(-1.675em, -1.675em) rotate(45deg);
|
|
106
|
+
border-radius: 0.25em;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
div.cog::after {
|
|
110
|
+
content: '';
|
|
111
|
+
position: absolute;
|
|
112
|
+
border: solid 1em var(--cog-colour, #eee);
|
|
113
|
+
padding: 0.375em;
|
|
114
|
+
border-radius: 1.8125em;
|
|
115
|
+
transform: translate(-1.375em, -1.375em);
|
|
116
|
+
filter: brightness(87.5%);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@-moz-keyframes rotate {
|
|
120
|
+
100% {
|
|
121
|
+
-moz-transform: rotate(360deg);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@-webkit-keyframes rotate {
|
|
126
|
+
100% {
|
|
127
|
+
-webkit-transform: rotate(360deg);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@keyframes rotate {
|
|
132
|
+
100% {
|
|
133
|
+
-webkit-transform: rotate(360deg);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
</style>
|