@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,45 @@
|
|
|
1
|
+
import { clamp } from '@/functions/clamp';
|
|
2
|
+
import { ColourData } from '@3cr/types-ts/types/ColourData';
|
|
3
|
+
|
|
4
|
+
function toHex(n: number): string {
|
|
5
|
+
return Math.floor(clamp(n, 0, 255))
|
|
6
|
+
.toString(16)
|
|
7
|
+
.padStart(2, '0');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function rgbToHex(r: number, g: number, b: number): string {
|
|
11
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function rgbaToHex(r: number, g: number, b: number, a: number): string {
|
|
15
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}${toHex(a)}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function hexToRgb(hex: string): [number, number, number] {
|
|
19
|
+
const digits = hex.replace('#', '');
|
|
20
|
+
const red = parseInt(digits.substring(0, 2), 16);
|
|
21
|
+
const green = parseInt(digits.substring(2, 4), 16);
|
|
22
|
+
const blue = parseInt(digits.substring(4, 6), 16);
|
|
23
|
+
return [red, green, blue];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function hexToRgba(hex: string): [number, number, number, number] {
|
|
27
|
+
const digits = hex.replace('#', '');
|
|
28
|
+
const red = parseInt(digits.substring(0, 2), 16);
|
|
29
|
+
const green = parseInt(digits.substring(2, 4), 16);
|
|
30
|
+
const blue = parseInt(digits.substring(4, 6), 16);
|
|
31
|
+
const alpha = parseInt(digits.substring(6, 8), 16);
|
|
32
|
+
return [red, green, blue, alpha];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function fromColourData(value: ColourData): string {
|
|
36
|
+
const { R, G, B } = value;
|
|
37
|
+
const toByte = (x: number) => Math.floor(x * 255);
|
|
38
|
+
return rgbToHex(toByte(R), toByte(G), toByte(B));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function toColourData(value: string): ColourData {
|
|
42
|
+
const [r, g, b] = hexToRgb(value);
|
|
43
|
+
const toFloat = (x: number) => x / 255;
|
|
44
|
+
return { Version: '0.0.0', R: toFloat(r), G: toFloat(g), B: toFloat(b), A: 1 };
|
|
45
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
|
|
11
|
+
async function traverseDirectoryTree(item: FileSystemEntry | null, onFileCallback: OnFileCallback, path: string = '') {
|
|
12
|
+
if (item?.isFile) {
|
|
13
|
+
const fileItem = item as FileSystemFileEntry;
|
|
14
|
+
await getFileEntriesFromReader(fileItem, onFileCallback, path);
|
|
15
|
+
} else if (item?.isDirectory) {
|
|
16
|
+
const directoryItem = item as FileSystemDirectoryEntry;
|
|
17
|
+
const directoryReader = directoryItem.createReader();
|
|
18
|
+
let entries: Array<FileSystemEntry> = [];
|
|
19
|
+
let lastAdditions = 0;
|
|
20
|
+
do {
|
|
21
|
+
const entrySet = await getDirectoryEntriesFromReader(directoryReader);
|
|
22
|
+
lastAdditions = entrySet.length;
|
|
23
|
+
entries = entries.concat(entrySet);
|
|
24
|
+
} while (lastAdditions > 0);
|
|
25
|
+
for (const element of entries) {
|
|
26
|
+
await traverseDirectoryTree(element, onFileCallback, path + directoryItem.name + '/');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function getDirectoryEntriesFromReader(
|
|
32
|
+
directoryReader: FileSystemDirectoryReader
|
|
33
|
+
): Promise<Array<FileSystemEntry>> {
|
|
34
|
+
return await new Promise((resolve, reject) => {
|
|
35
|
+
directoryReader.readEntries((entries: Array<FileSystemEntry>) => {
|
|
36
|
+
resolve(entries);
|
|
37
|
+
}, reject);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function getFileEntriesFromReader(item: FileSystemFileEntry, onFileCallback: OnFileCallback, path: string) {
|
|
42
|
+
return await new Promise<void>((resolve, _reject) => {
|
|
43
|
+
item.file(async (file: File) => {
|
|
44
|
+
await onFileCallback(file, path);
|
|
45
|
+
resolve();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataOverlayAngleFaker } from '@test/fakers/data-overlay-angle.faker';
|
|
2
|
+
import { DataOverlayLengthFaker } from '@test/fakers/data-overlay-length.faker';
|
|
3
|
+
import { DataOverlayPolygonFaker } from '@test/fakers/data-overlay-polygon.faker';
|
|
4
|
+
import { isDataOverlayAngle } from '@/functions/guards/isDataOverlayAngle';
|
|
5
|
+
|
|
6
|
+
describe('isDataOverlayAngle', () => {
|
|
7
|
+
it('should accept angles', () => {
|
|
8
|
+
const angle = DataOverlayAngleFaker.random();
|
|
9
|
+
expect(isDataOverlayAngle(angle)).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should reject lengths', () => {
|
|
13
|
+
const length = DataOverlayLengthFaker.random();
|
|
14
|
+
expect(isDataOverlayAngle(length)).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should reject polygons', () => {
|
|
18
|
+
const polygon = DataOverlayPolygonFaker.random();
|
|
19
|
+
expect(isDataOverlayAngle(polygon)).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataOverlayAngleFaker } from '@test/fakers/data-overlay-angle.faker';
|
|
2
|
+
import { DataOverlayLengthFaker } from '@test/fakers/data-overlay-length.faker';
|
|
3
|
+
import { DataOverlayPolygonFaker } from '@test/fakers/data-overlay-polygon.faker';
|
|
4
|
+
import { isDataOverlayLength } from '@/functions/guards/isDataOverlayLength';
|
|
5
|
+
|
|
6
|
+
describe('isDataOverlayLength', () => {
|
|
7
|
+
it('should accept lengths', () => {
|
|
8
|
+
const length = DataOverlayLengthFaker.random();
|
|
9
|
+
expect(isDataOverlayLength(length)).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should reject angles', () => {
|
|
13
|
+
const angle = DataOverlayAngleFaker.random();
|
|
14
|
+
expect(isDataOverlayLength(angle)).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should reject polygons', () => {
|
|
18
|
+
const polygon = DataOverlayPolygonFaker.random();
|
|
19
|
+
expect(isDataOverlayLength(polygon)).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataOverlayLengthFaker } from '@test/fakers/data-overlay-length.faker';
|
|
2
|
+
import { DataOverlayAngleFaker } from '@test/fakers/data-overlay-angle.faker';
|
|
3
|
+
import { DataOverlayPolygonFaker } from '@test/fakers/data-overlay-polygon.faker';
|
|
4
|
+
import { isDataOverlayPolygon } from '@/functions/guards/isDataOverlayPolygon';
|
|
5
|
+
|
|
6
|
+
describe('isDataOverlayPolygon', () => {
|
|
7
|
+
it('should accept polygons', () => {
|
|
8
|
+
const polygon = DataOverlayPolygonFaker.random();
|
|
9
|
+
expect(isDataOverlayPolygon(polygon)).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should reject lengths', () => {
|
|
13
|
+
const length = DataOverlayLengthFaker.random();
|
|
14
|
+
expect(isDataOverlayPolygon(length)).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should reject angles', () => {
|
|
18
|
+
const angle = DataOverlayAngleFaker.random();
|
|
19
|
+
expect(isDataOverlayPolygon(angle)).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { DataOverlayAngle } from '
|
|
2
|
-
import { DataOverlay } from '@/types/data-overlay';
|
|
1
|
+
import { DataOverlay, DataOverlayAngle } from '@3cr/viewer-types-ts';
|
|
3
2
|
|
|
4
|
-
export function isDataOverlayAngle(
|
|
5
|
-
return 'SegmentAngles' in
|
|
3
|
+
export function isDataOverlayAngle(measurement: DataOverlay): measurement is DataOverlayAngle {
|
|
4
|
+
return 'SegmentAngles' in measurement;
|
|
6
5
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { DataOverlayLength } from '
|
|
2
|
-
import { DataOverlay } from '@/types/data-overlay';
|
|
1
|
+
import { DataOverlay, DataOverlayLength } from '@3cr/viewer-types-ts';
|
|
3
2
|
|
|
4
|
-
export function isDataOverlayLength(
|
|
5
|
-
return 'SegmentLengths' in
|
|
3
|
+
export function isDataOverlayLength(measurement: DataOverlay): measurement is DataOverlayLength {
|
|
4
|
+
return 'SegmentLengths' in measurement;
|
|
6
5
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { DataOverlayPolygon } from '
|
|
2
|
-
import { DataOverlay } from '@/types/data-overlay';
|
|
1
|
+
import { DataOverlay, DataOverlayPolygon } from '@3cr/viewer-types-ts';
|
|
3
2
|
|
|
4
|
-
export function isDataOverlayPolygon(
|
|
5
|
-
return 'Area' in
|
|
3
|
+
export function isDataOverlayPolygon(measurement: DataOverlay): measurement is DataOverlayPolygon {
|
|
4
|
+
return 'Area' in measurement;
|
|
6
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseDataOverlay } from '@/functions/parseDataOverlay';
|
|
1
|
+
import { parseDataOverlay } from '@/functions/parsers/parseDataOverlay';
|
|
2
2
|
import { DataOverlayAnnotationFaker } from '@test/fakers/data-overlay-annotation.faker';
|
|
3
3
|
|
|
4
4
|
describe('parseDataOverlay tests', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataOverlayDataFaker } from '@test/fakers/data-overlay-data.faker';
|
|
2
|
-
import { parseDataOverlayData } from '@/functions/parseDataOverlayData';
|
|
2
|
+
import { parseDataOverlayData } from '@/functions/parsers/parseDataOverlayData';
|
|
3
3
|
|
|
4
4
|
describe('parseDataOverlayData tests', () => {
|
|
5
5
|
it('should parse', () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DataOverlayDataFaker } from '@test/fakers/data-overlay-data.faker';
|
|
2
|
-
import { parseDataOverlayEvent } from '@/functions/parseDataOverlayEvent';
|
|
3
|
-
import {
|
|
2
|
+
import { parseDataOverlayEvent } from '@/functions/parsers/parseDataOverlayEvent';
|
|
3
|
+
import { InteractionType } from '@3cr/types-ts';
|
|
4
4
|
|
|
5
5
|
describe('parseDataOverlayEvent tests', () => {
|
|
6
6
|
it('should parse', () => {
|
|
7
|
-
const result = parseDataOverlayEvent(DataOverlayDataFaker.angleEventRaw(
|
|
7
|
+
const result = parseDataOverlayEvent(DataOverlayDataFaker.angleEventRaw(InteractionType.HOVER_START));
|
|
8
8
|
expect(typeof result.Data).not.toBe('string');
|
|
9
9
|
});
|
|
10
10
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { parseMcadEvent } from '@/functions/parseMcadEvent';
|
|
1
|
+
import { InteractionType } from '@3cr/types-ts';
|
|
2
|
+
import { parseMcadEvent } from '@/functions/parsers/parseMcadEvent';
|
|
3
3
|
import { McadObjectInteractionFaker } from '@test/fakers/mcad-object-interaction.faker';
|
|
4
4
|
|
|
5
5
|
describe('parseMcadEvent tests', () => {
|
|
6
6
|
it('should parse', () => {
|
|
7
|
-
const result = parseMcadEvent(McadObjectInteractionFaker.randomRaw(
|
|
7
|
+
const result = parseMcadEvent(McadObjectInteractionFaker.randomRaw(InteractionType.HOVER_START));
|
|
8
8
|
expect(typeof result.Mcad.CallToAction).not.toBe('string');
|
|
9
9
|
});
|
|
10
10
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { parseAction } from '@/functions/parsers/parseAction';
|
|
2
|
+
import { CallToAction, CallToActionRaw } from '@3cr/viewer-types-ts';
|
|
3
3
|
|
|
4
4
|
export function parseCallToAction(data: CallToActionRaw): CallToAction {
|
|
5
5
|
return {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { CallToActionRaw } from '@/types/call-to-action';
|
|
1
|
+
import { parseCallToAction } from '@/functions/parsers/parseCallToAction';
|
|
2
|
+
import { CallToActionRaw, DataOverlay, DataOverlayRaw } from '@3cr/viewer-types-ts';
|
|
4
3
|
|
|
5
4
|
export function parseDataOverlay(data: DataOverlayRaw): DataOverlay {
|
|
6
5
|
return {
|
|
7
6
|
...data,
|
|
7
|
+
/* v8 ignore next */
|
|
8
8
|
CallToAction: data.CallToAction ? parseCallToAction(JSON.parse(data.CallToAction) as CallToActionRaw) : null
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { parseDataOverlay } from '@/functions/parsers/parseDataOverlay';
|
|
2
|
+
import { DataOverlay, DataOverlayDataRaw, DataOverlayRaw, DataOverlayData } from '@3cr/viewer-types-ts';
|
|
3
|
+
|
|
4
|
+
export function parseDataOverlayData<T extends DataOverlay>(data: DataOverlayDataRaw): DataOverlayData<T> {
|
|
5
|
+
return {
|
|
6
|
+
...data,
|
|
7
|
+
Data: parseDataOverlay(JSON.parse(data.Data) as DataOverlayRaw) as T
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { parseDataOverlay } from '@/functions/parsers/parseDataOverlay';
|
|
2
|
+
import {
|
|
3
|
+
DataOverlay,
|
|
4
|
+
DataOverlayDataRaw,
|
|
5
|
+
DataOverlayEvent,
|
|
6
|
+
DataOverlayInteractionRaw,
|
|
7
|
+
DataOverlayRaw
|
|
8
|
+
} from '@3cr/viewer-types-ts';
|
|
9
|
+
|
|
10
|
+
export function parseDataOverlayEvent<T extends DataOverlay>(data: DataOverlayDataRaw): DataOverlayEvent<T> {
|
|
11
|
+
const interaction = JSON.parse(data.Data) as DataOverlayInteractionRaw<DataOverlayRaw>;
|
|
12
|
+
return {
|
|
13
|
+
...data,
|
|
14
|
+
Data: {
|
|
15
|
+
...interaction,
|
|
16
|
+
DataOverlay: parseDataOverlay(interaction.DataOverlay) as T
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { parseDataOverlay } from '@/functions/parsers/parseDataOverlay';
|
|
2
|
+
import { DataOverlayMcad, McadObjectInteraction, McadObjectInteractionRaw } from '@3cr/viewer-types-ts';
|
|
3
|
+
|
|
4
|
+
export function parseMcadEvent(data: McadObjectInteractionRaw): McadObjectInteraction {
|
|
5
|
+
return {
|
|
6
|
+
...data,
|
|
7
|
+
Mcad: parseDataOverlay(data.Mcad) as DataOverlayMcad
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isMac } from '@/functions/platform';
|
|
2
|
+
|
|
3
|
+
export const SHORTCUT_TEXT = {
|
|
4
|
+
altA: 'Alt + A',
|
|
5
|
+
altD: 'Alt + D',
|
|
6
|
+
altE: 'Alt + E',
|
|
7
|
+
altF: 'Alt + F',
|
|
8
|
+
altH: 'Alt + H',
|
|
9
|
+
altM: 'Alt + M',
|
|
10
|
+
c: 'Ctrl + Shift + C',
|
|
11
|
+
d: 'Ctrl + Shift + D',
|
|
12
|
+
del: 'Ctrl + Shift + Del',
|
|
13
|
+
a: 'Ctrl + Shift + A',
|
|
14
|
+
e: 'Ctrl + Shift + E',
|
|
15
|
+
f: 'Ctrl + Shift + F',
|
|
16
|
+
g: 'Ctrl + Shift + G',
|
|
17
|
+
h: 'Ctrl + Shift + H',
|
|
18
|
+
l: 'Ctrl + Shift + L',
|
|
19
|
+
m: 'Ctrl + Shift + M',
|
|
20
|
+
p: 'Ctrl + Shift + P',
|
|
21
|
+
q: 'Ctrl + Shift + Q',
|
|
22
|
+
r: 'Ctrl + Shift + R',
|
|
23
|
+
s: 'Ctrl + Shift + S',
|
|
24
|
+
v: 'Ctrl + Shift + V',
|
|
25
|
+
plus: 'Ctrl + Shift + Plus',
|
|
26
|
+
minus: 'Ctrl + Shift + Minus',
|
|
27
|
+
space: 'Ctrl + Shift + Space'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/* v8 ignore start -- @preserve */
|
|
31
|
+
export function translateTooltipShortcut(shortcut: string) {
|
|
32
|
+
if (isMac()) return shortcut.replaceAll('Ctrl', '⌘').replaceAll('Alt', '⌥');
|
|
33
|
+
return shortcut;
|
|
34
|
+
}
|
|
35
|
+
/* v8 ignore stop -- @preserve */
|
package/src/main.ts
CHANGED
|
@@ -1,63 +1,85 @@
|
|
|
1
|
+
import '@/assets/styles.scss';
|
|
1
2
|
import { registerVersion, quit } from '@3cr/sdk-browser';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { injectedStyleId } from './config';
|
|
7
|
-
import { useVersion3cr } from '@/composables/useVersion3cr';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
4
|
+
import Notifications from '@kyvg/vue3-notification';
|
|
5
|
+
import { App as VueApp, createApp } from 'vue';
|
|
6
|
+
import { storeToRefs } from 'pinia';
|
|
8
7
|
import App from '@/App.vue';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { demoPayload } from '@/components/demo/demo-payload';
|
|
9
|
+
import { injectedStyleId } from '@/config';
|
|
10
|
+
import { i18n } from '@/plugins/vue-i18n';
|
|
11
|
+
import { pinia } from '@/plugins/pinia';
|
|
12
|
+
import { vuetify } from '@/plugins/vuetify';
|
|
13
|
+
import { useViewerStore } from '@/stores/viewer.store';
|
|
14
|
+
import { ViewerOptions, ViewerPayload } from '@3cr/viewer-types-ts';
|
|
11
15
|
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
MockRunOnNewThread(async () => {
|
|
21
|
-
const languages = await getAvailableLanguages();
|
|
22
|
-
if (language && languages.includes(language)) {
|
|
23
|
-
await setLanguage(language);
|
|
24
|
-
} else {
|
|
25
|
-
const documentLanguage = document.querySelector('html')?.getAttribute('lang');
|
|
26
|
-
const defaultLanguage = documentLanguage ?? languages[0];
|
|
27
|
-
await setLanguage(defaultLanguage);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const version3cr = useVersion3cr();
|
|
32
|
-
version3cr.value = version;
|
|
16
|
+
let app: VueApp<Element> | null = null;
|
|
17
|
+
let mounted: InstanceType<typeof App> | null = null;
|
|
18
|
+
declare global {
|
|
19
|
+
interface Window {
|
|
20
|
+
mobileCheck: () => boolean;
|
|
21
|
+
opera: string;
|
|
22
|
+
}
|
|
33
23
|
}
|
|
24
|
+
window.mobileCheck = function () {
|
|
25
|
+
let check = false;
|
|
26
|
+
(function (a) {
|
|
27
|
+
if (
|
|
28
|
+
/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(
|
|
29
|
+
a
|
|
30
|
+
) ||
|
|
31
|
+
/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
|
|
32
|
+
a.substr(0, 4)
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
check = true;
|
|
36
|
+
})(navigator.userAgent || navigator.vendor || window.opera);
|
|
37
|
+
return check;
|
|
38
|
+
};
|
|
34
39
|
|
|
35
|
-
export async function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
export async function mountViewer(host: Element | string, sdkVersion: string): Promise<void> {
|
|
41
|
+
if (!app) {
|
|
42
|
+
await registerVersion(sdkVersion);
|
|
43
|
+
app = createApp(App);
|
|
44
|
+
app.component('font-awesome-icon', FontAwesomeIcon);
|
|
45
|
+
app.use(i18n);
|
|
46
|
+
app.use(pinia);
|
|
47
|
+
app.use(vuetify);
|
|
48
|
+
app.use(Notifications);
|
|
49
|
+
mounted = app.mount(host) as InstanceType<typeof App>;
|
|
50
|
+
const { version } = storeToRefs(useViewerStore());
|
|
51
|
+
version.value = sdkVersion;
|
|
52
|
+
} else {
|
|
53
|
+
throw new Error('Please call `unmountViewer` before registering again');
|
|
41
54
|
}
|
|
42
|
-
await (mountedApp as any).loadInstance(payload, options);
|
|
43
55
|
}
|
|
44
56
|
|
|
45
|
-
export async function
|
|
46
|
-
if (
|
|
47
|
-
|
|
57
|
+
export async function loadViewer(payload: ViewerPayload = demoPayload, options: ViewerOptions = {}): Promise<void> {
|
|
58
|
+
if (mounted) {
|
|
59
|
+
await mounted.loadViewer(payload, options);
|
|
60
|
+
} else {
|
|
61
|
+
throw new Error('Please call `mountViewer` first');
|
|
48
62
|
}
|
|
49
|
-
await (mountedApp as any).loadSession(url);
|
|
50
63
|
}
|
|
51
64
|
|
|
52
|
-
export async function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
export async function loadSession(url: string): Promise<void> {
|
|
66
|
+
if (mounted) {
|
|
67
|
+
await mounted.loadSession(url);
|
|
68
|
+
} else {
|
|
69
|
+
throw new Error('Please call `mountViewer` first');
|
|
70
|
+
}
|
|
56
71
|
}
|
|
57
72
|
|
|
58
|
-
export async function
|
|
59
|
-
if (
|
|
60
|
-
|
|
73
|
+
export async function unmountViewer(): Promise<void> {
|
|
74
|
+
if (app) {
|
|
75
|
+
document.getElementById(injectedStyleId)?.remove();
|
|
76
|
+
app.unmount();
|
|
77
|
+
mounted = null;
|
|
78
|
+
app = null;
|
|
79
|
+
try {
|
|
80
|
+
await quit();
|
|
81
|
+
} catch (e) {}
|
|
82
|
+
} else {
|
|
83
|
+
throw new Error('Please call `mountViewer` first');
|
|
61
84
|
}
|
|
62
|
-
await (mountedApp as any).close();
|
|
63
85
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ISO_LANGUAGES } from '@/models/iso-languages';
|
|
2
|
+
|
|
3
|
+
describe('iso languages', () => {
|
|
4
|
+
it('should be defined', () => {
|
|
5
|
+
expect(ISO_LANGUAGES).toBeDefined();
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it('should have default languages', () => {
|
|
9
|
+
expect(ISO_LANGUAGES.en).toBeDefined();
|
|
10
|
+
expect(ISO_LANGUAGES.ar).toBeDefined();
|
|
11
|
+
expect(ISO_LANGUAGES.bn).toBeDefined();
|
|
12
|
+
expect(ISO_LANGUAGES['zh-CN']).toBeDefined();
|
|
13
|
+
expect(ISO_LANGUAGES['en-US']).toBeDefined();
|
|
14
|
+
expect(ISO_LANGUAGES.fr).toBeDefined();
|
|
15
|
+
expect(ISO_LANGUAGES.de).toBeDefined();
|
|
16
|
+
expect(ISO_LANGUAGES.hi).toBeDefined();
|
|
17
|
+
expect(ISO_LANGUAGES.id).toBeDefined();
|
|
18
|
+
expect(ISO_LANGUAGES.it).toBeDefined();
|
|
19
|
+
expect(ISO_LANGUAGES.ja).toBeDefined();
|
|
20
|
+
expect(ISO_LANGUAGES['pt-PT']).toBeDefined();
|
|
21
|
+
expect(ISO_LANGUAGES['es-ES']).toBeDefined();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -6,18 +6,11 @@ import {
|
|
|
6
6
|
inflateMcadObjectState,
|
|
7
7
|
inflateScanState
|
|
8
8
|
} from '@/functions/modelHelper';
|
|
9
|
-
import { AnchorPoint,
|
|
9
|
+
import { AnchorPoint, InteractionType, ScanView } from '@3cr/types-ts';
|
|
10
10
|
import {
|
|
11
11
|
cSlider,
|
|
12
12
|
getCurrentView,
|
|
13
|
-
getViewName,
|
|
14
|
-
setDataOverlayEvent,
|
|
15
|
-
setDataOverlayState,
|
|
16
|
-
setInitialDataOverlayState,
|
|
17
|
-
setInitialMcadState,
|
|
18
13
|
setInitialScanStateFromPayload,
|
|
19
|
-
setMcadEvent,
|
|
20
|
-
setMcadState,
|
|
21
14
|
setScanState,
|
|
22
15
|
setScanStateFromPayload,
|
|
23
16
|
sSlider,
|
|
@@ -27,8 +20,13 @@ import {
|
|
|
27
20
|
} from '@/models/scanState';
|
|
28
21
|
import { DataOverlayDataFaker } from '@test/fakers/data-overlay-data.faker';
|
|
29
22
|
import { McadObjectInteractionFaker } from '@test/fakers/mcad-object-interaction.faker';
|
|
23
|
+
import { useDataOverlayStore } from '@/stores/data-overlay.store';
|
|
24
|
+
import { useMcadStore } from '@/stores/mcad.store';
|
|
30
25
|
|
|
31
26
|
describe('scanState tests', () => {
|
|
27
|
+
const dataOverlayStore = useDataOverlayStore();
|
|
28
|
+
const mcadStore = useMcadStore();
|
|
29
|
+
|
|
32
30
|
it('should getCurrentView Sagittal', () => {
|
|
33
31
|
expect(
|
|
34
32
|
getCurrentView({
|
|
@@ -137,54 +135,32 @@ describe('scanState tests', () => {
|
|
|
137
135
|
|
|
138
136
|
it('should set initial data overlay state', () => {
|
|
139
137
|
const payload = JSON.stringify(inflateInitialDataOverlayState());
|
|
140
|
-
expect(() => setInitialDataOverlayState(payload)).not.toThrow();
|
|
138
|
+
expect(() => dataOverlayStore.setInitialDataOverlayState(payload)).not.toThrow();
|
|
141
139
|
});
|
|
142
140
|
|
|
143
141
|
it('should set current data overlay state', () => {
|
|
144
142
|
const payload = JSON.stringify(inflateDataOverlayState());
|
|
145
|
-
expect(() => setDataOverlayState(payload)).not.toThrow();
|
|
143
|
+
expect(() => dataOverlayStore.setDataOverlayState(payload)).not.toThrow();
|
|
146
144
|
});
|
|
147
145
|
|
|
148
146
|
it('should set data overlay event', () => {
|
|
149
|
-
const payload = JSON.stringify(DataOverlayDataFaker.annotationEventRaw(
|
|
150
|
-
expect(() => setDataOverlayEvent(payload)).not.toThrow();
|
|
147
|
+
const payload = JSON.stringify(DataOverlayDataFaker.annotationEventRaw(InteractionType.HOVER_START));
|
|
148
|
+
expect(() => dataOverlayStore.setDataOverlayEvent(payload)).not.toThrow();
|
|
151
149
|
});
|
|
152
150
|
|
|
153
151
|
it('should set initial mcad state', () => {
|
|
154
152
|
const payload = JSON.stringify(inflateInitialMcadObjectState());
|
|
155
|
-
expect(() => setInitialMcadState(payload)).not.toThrow();
|
|
153
|
+
expect(() => mcadStore.setInitialMcadState(payload)).not.toThrow();
|
|
156
154
|
});
|
|
157
155
|
|
|
158
156
|
it('should set current data overlay state', () => {
|
|
159
157
|
const payload = JSON.stringify(inflateMcadObjectState());
|
|
160
|
-
expect(() => setMcadState(payload)).not.toThrow();
|
|
158
|
+
expect(() => mcadStore.setMcadState(payload)).not.toThrow();
|
|
161
159
|
});
|
|
162
160
|
|
|
163
161
|
it('should set data overlay event', () => {
|
|
164
|
-
const payload = JSON.stringify(McadObjectInteractionFaker.randomRaw(
|
|
165
|
-
expect(() => setMcadEvent(payload)).not.toThrow();
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
describe('getViewName tests', () => {
|
|
170
|
-
it('should get name for coronal', () => {
|
|
171
|
-
expect(getViewName(ScanView.Coronal)).toBe('Coronal');
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
it('should get name for sagittal', () => {
|
|
175
|
-
expect(getViewName(ScanView.Sagittal)).toBe('Sagittal');
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
it('should get name for transverse', () => {
|
|
179
|
-
expect(getViewName(ScanView.Transverse)).toBe('Transverse');
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('should get name for volume', () => {
|
|
183
|
-
expect(getViewName(ScanView.Volume)).toBe('3D Volume');
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
it('should get empty string for unknown', () => {
|
|
187
|
-
expect(getViewName(-1 as ScanView)).toBe('');
|
|
162
|
+
const payload = JSON.stringify(McadObjectInteractionFaker.randomRaw(InteractionType.HOVER_START));
|
|
163
|
+
expect(() => mcadStore.setMcadEvent(payload)).not.toThrow();
|
|
188
164
|
});
|
|
189
165
|
});
|
|
190
166
|
});
|