@3cr/viewer-browser 0.0.247 → 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 +108285 -37154
- 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 +68 -43
- 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/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
package/index.html
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<meta name="msapplication-TileColor" content="#da532c" />
|
|
7
|
+
<meta name="theme-color" content="#ffffff" />
|
|
8
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
9
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
|
10
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
|
11
|
+
<link rel="manifest" href="/site.webmanifest" />
|
|
12
|
+
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
|
13
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.2.3/css/flag-icons.min.css" />
|
|
14
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
15
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
16
|
+
<title>3CR Browser Viewer</title>
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<div id="app"></div>
|
|
20
|
+
<script type="module">
|
|
21
|
+
import { mountViewer, loadViewer } from '/src/main.ts';
|
|
22
|
+
import { StatsigClient } from '@statsig/js-client';
|
|
23
|
+
import { runStatsigAutoCapture } from '@statsig/web-analytics';
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const key = 'client-YaAjxOTTRbuSN3peDAwXEzErieXpI744a3OHDgonzvV';
|
|
26
|
+
const user = { userID: undefined };
|
|
27
|
+
const options = { environment: { tier: 'development' } };
|
|
28
|
+
const client = new StatsigClient(key, user, options);
|
|
29
|
+
runStatsigAutoCapture(client);
|
|
30
|
+
await client.initializeAsync();
|
|
31
|
+
window.playgroundStatsigClient = client;
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const dynamicConfig = client.getDynamicConfig('3cr_viewer_version');
|
|
34
|
+
const testVersion = (window.location.href.includes('test.') || window.location.href.includes('localhost') || window.location.href.includes('next.')) && new URLSearchParams(window.location.search).get('build_version');
|
|
35
|
+
const version = testVersion ?? dynamicConfig.value['sdkVersion'] ?? '1.1.0';
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
await mountViewer('#app', version);
|
|
38
|
+
await loadViewer();
|
|
39
|
+
</script>
|
|
40
|
+
</body>
|
|
39
41
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3cr/viewer-browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.292",
|
|
4
4
|
"main": "./dist/Viewer3CR.umd.js",
|
|
5
5
|
"module": "dist/Viewer3CR.umd.js",
|
|
6
6
|
"homepage": "https://docs.3cr.singular.health",
|
|
@@ -23,27 +23,43 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@3cr/sdk-browser": "^1.0.17",
|
|
25
25
|
"@3cr/translations-ts": "^1.0.1",
|
|
26
|
-
"@3cr/types-ts": "^1.0.
|
|
27
|
-
"@
|
|
26
|
+
"@3cr/types-ts": "^1.0.170",
|
|
27
|
+
"@3cr/viewer-types-ts": "^1.0.22",
|
|
28
|
+
"@crowdin/ota-client": "^2.0.0",
|
|
29
|
+
"@fortawesome/free-brands-svg-icons": "^6.6.0",
|
|
30
|
+
"@fortawesome/vue-fontawesome": "^3.0.8",
|
|
31
|
+
"@kyvg/vue3-notification": "^3.4.0",
|
|
28
32
|
"@mdi/font": "^7.4.47",
|
|
29
33
|
"@mdi/js": "^7.4.47",
|
|
30
34
|
"@statsig/js-client": "^1.5.0",
|
|
31
35
|
"@statsig/session-replay": "^1.5.0",
|
|
32
36
|
"@statsig/web-analytics": "^1.5.0",
|
|
33
37
|
"axios": "^1.7.2",
|
|
38
|
+
"buffer": "^6.0.3",
|
|
39
|
+
"date-fns": "^4.1.0",
|
|
40
|
+
"device-detector-js": "^3.0.3",
|
|
41
|
+
"hotkeys-js": "^3.13.7",
|
|
42
|
+
"interactjs": "^1.10.27",
|
|
34
43
|
"intro.js": "^8.0.0-beta.1",
|
|
44
|
+
"lodash": "^4.17.21",
|
|
35
45
|
"logrocket": "^8.1.0",
|
|
36
|
-
"
|
|
46
|
+
"pinia": "^2.2.1",
|
|
47
|
+
"uuid": "^10.0.0",
|
|
37
48
|
"vue": "^3.4.29",
|
|
49
|
+
"vue-hotkeys-rt": "^0.2.3",
|
|
50
|
+
"vue-i18n": "^9.13.1",
|
|
38
51
|
"vuetify": "^3.6.12"
|
|
39
52
|
},
|
|
40
53
|
"devDependencies": {
|
|
41
54
|
"@babel/types": "^7.24.0",
|
|
42
55
|
"@faker-js/faker": "^8.4.1",
|
|
56
|
+
"@pinia/testing": "^0.1.5",
|
|
57
|
+
"@types/lodash": "^4.17.13",
|
|
43
58
|
"@types/node": "^20.14.2",
|
|
59
|
+
"@types/uuid": "^10.0.0",
|
|
44
60
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
45
|
-
"@vitest/coverage-
|
|
46
|
-
"@vitest/ui": "^2.
|
|
61
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
62
|
+
"@vitest/ui": "^2.1.8",
|
|
47
63
|
"@vue/test-utils": "^2.4.6",
|
|
48
64
|
"aws-sdk": "^2.1594.0",
|
|
49
65
|
"jsdom": "^24.0.0",
|
|
@@ -54,11 +70,14 @@
|
|
|
54
70
|
"sass": "^1.71.1",
|
|
55
71
|
"typescript": "^5.4.2",
|
|
56
72
|
"unplugin-fonts": "^1.1.1",
|
|
57
|
-
"unplugin-vue-components": "^0.27.
|
|
73
|
+
"unplugin-vue-components": "^0.27.4",
|
|
58
74
|
"vite": "^5.3.1",
|
|
59
75
|
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
60
76
|
"vite-plugin-vuetify": "^2.0.3",
|
|
61
|
-
"vitest": "^2.
|
|
77
|
+
"vitest": "^2.1.8",
|
|
62
78
|
"vue-tsc": "^2.0.21"
|
|
79
|
+
},
|
|
80
|
+
"overrides": {
|
|
81
|
+
"tough-cookie": "^5.0.0"
|
|
63
82
|
}
|
|
64
83
|
}
|
|
Binary file
|
package/playground/index.html
CHANGED
|
@@ -63,7 +63,11 @@
|
|
|
63
63
|
initServiceWorker();
|
|
64
64
|
});
|
|
65
65
|
</script>
|
|
66
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
67
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
68
|
+
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap" rel="stylesheet">
|
|
66
69
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
|
|
70
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.2.3/css/flag-icons.min.css" />
|
|
67
71
|
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
|
68
72
|
<script src="https://cdn.jsdelivr.net/npm/@statsig/js-client@latest/build/statsig-js-client+session-replay+web-analytics.min.js"></script>
|
|
69
73
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -73,7 +77,7 @@
|
|
|
73
77
|
<div id="app"></div>
|
|
74
78
|
<script type="module">
|
|
75
79
|
const { StatsigClient, runStatsigAutoCapture } = window.Statsig;
|
|
76
|
-
const isTest = (window.location.href.includes('test.') || window.location.href.includes('localhost'))
|
|
80
|
+
const isTest = (window.location.href.includes('test.') || window.location.href.includes('localhost') || window.location.href.includes('next.'))
|
|
77
81
|
const client = new StatsigClient("client-YaAjxOTTRbuSN3peDAwXEzErieXpI744a3OHDgonzvV",
|
|
78
82
|
{ userID: undefined },
|
|
79
83
|
{ environment: { tier: isTest ? 'development' : 'production' } }
|
|
@@ -90,7 +94,7 @@
|
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
client.initializeAsync().then(() => {
|
|
93
|
-
window.
|
|
97
|
+
window.mountViewer('#app', version).then(() => {
|
|
94
98
|
window.loadViewer().then()
|
|
95
99
|
})
|
|
96
100
|
}).catch((err) => console.error(err));
|
package/src/App.vue
CHANGED
|
@@ -1,110 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<DemoPatientInfoModal v-model:modal="m_demoPatient" />
|
|
8
|
-
<DemoPatientShareToMobileModal v-model:modal="m_demoPatientShareToMobile" />
|
|
9
|
-
<DemoPatientSendToPartyModal v-model:modal="m_demoPatientSendToParty" />
|
|
10
|
-
<DemoPatientEnableCloudStorageModal v-model:modal="m_demoPatientEnableCloudStorage" />
|
|
11
|
-
<Notifications />
|
|
2
|
+
<Viewer3cr ref="viewer3cr" :payload="payload" :options="options" />
|
|
3
|
+
<demo-info-modal v-model:modal="m_demoInfo" />
|
|
4
|
+
<demo-purchase-credits-modal v-model="m_demoPurchaseCredits" />
|
|
5
|
+
<demo-upgrade-cloud-storage-modal v-model="m_demoEnableCloudStorage" />
|
|
6
|
+
<demo-upgrade-plan-modal v-model="m_demoUpgradePlan" />
|
|
12
7
|
<update-snackbar />
|
|
8
|
+
<uploads-drawer v-model="showUploads" :uploads="uploads" />
|
|
13
9
|
</template>
|
|
14
10
|
|
|
15
11
|
<script setup lang="ts">
|
|
16
|
-
import { ref } from 'vue';
|
|
17
|
-
import
|
|
18
|
-
import { defaultLoadViewerPayload, LoadViewerPayload } from '@/models/loadViewerPayload';
|
|
19
|
-
import { defaultLoadViewerOptions, LoadViewerOptions } from '@/models/loadViewerOptions';
|
|
20
|
-
import {
|
|
21
|
-
isDemo,
|
|
22
|
-
m_demoLicence,
|
|
23
|
-
m_demoLicenceSendToParty,
|
|
24
|
-
m_demoLicenceShareToMobile,
|
|
25
|
-
m_demoLicenseEnableCloudStorage,
|
|
26
|
-
m_demoPatient,
|
|
27
|
-
m_demoPatientEnableCloudStorage,
|
|
28
|
-
m_demoPatientSendToParty,
|
|
29
|
-
m_demoPatientShareToMobile,
|
|
30
|
-
show
|
|
31
|
-
} from '@/components/demo/options';
|
|
32
|
-
import MftpWebGL3DRModal from '@/components/modal/MftpWebGL3DRModal.vue';
|
|
12
|
+
import { onMounted, ref } from 'vue';
|
|
13
|
+
import hotkeys from 'hotkeys-js';
|
|
33
14
|
import LogRocket from 'logrocket';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
15
|
+
import { storeToRefs } from 'pinia';
|
|
16
|
+
import Viewer3cr from '@/components/modal/Viewer3cr.vue';
|
|
17
|
+
import { HotkeyScope } from '@/functions/HotkeyScope';
|
|
18
|
+
import { useDemoStore } from '@/stores/demo.store';
|
|
19
|
+
import { useThemeStore } from '@/stores/theme.store';
|
|
20
|
+
import { useUploadStore } from '@/stores/upload.store';
|
|
21
|
+
import { ViewerOptions, ViewerPayload } from '@3cr/viewer-types-ts';
|
|
22
|
+
|
|
23
|
+
hotkeys('f5', HotkeyScope.PRIMARY, function (event, handler) {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
alert('you pressed F5!');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const { isDemo, m_demoInfo, m_demoEnableCloudStorage, m_demoPurchaseCredits, m_demoUpgradePlan } =
|
|
29
|
+
storeToRefs(useDemoStore());
|
|
30
|
+
const { theme } = storeToRefs(useThemeStore());
|
|
31
|
+
const { uploads, showUploads } = storeToRefs(useUploadStore());
|
|
32
|
+
|
|
33
|
+
const payload = ref<ViewerPayload>();
|
|
34
|
+
const options = ref<ViewerOptions>();
|
|
35
|
+
const viewer3cr = ref<InstanceType<typeof Viewer3cr>>();
|
|
36
|
+
|
|
37
|
+
onMounted(() => {
|
|
38
|
+
theme.value = 'light'; // TODO: undo this once we have Dark Mode designs
|
|
39
|
+
if (isDemo.value) {
|
|
40
|
+
LogRocket.init('qfib9l/3crviewer-browser');
|
|
41
|
+
}
|
|
42
|
+
});
|
|
47
43
|
|
|
48
44
|
async function loadSession(url: string): Promise<void> {
|
|
49
|
-
await
|
|
45
|
+
await viewer3cr.value?.loadSession(url);
|
|
50
46
|
}
|
|
51
47
|
|
|
52
|
-
async function
|
|
53
|
-
|
|
48
|
+
async function loadViewer(viewerPayload: ViewerPayload, viewerOptions: ViewerOptions) {
|
|
49
|
+
payload.value = viewerPayload;
|
|
50
|
+
options.value = viewerOptions;
|
|
54
51
|
}
|
|
55
52
|
|
|
56
|
-
defineExpose({
|
|
53
|
+
defineExpose({ loadViewer, loadSession });
|
|
57
54
|
</script>
|
|
58
|
-
|
|
59
|
-
<style>
|
|
60
|
-
.material-icons-outlined,
|
|
61
|
-
.material-symbols-outlined {
|
|
62
|
-
font-variation-settings:
|
|
63
|
-
'FILL' 0,
|
|
64
|
-
'wght' 300,
|
|
65
|
-
'GRAD' 0,
|
|
66
|
-
'opsz' 24;
|
|
67
|
-
}
|
|
68
|
-
.material-icons,
|
|
69
|
-
.material-symbols {
|
|
70
|
-
font-variation-settings:
|
|
71
|
-
'FILL' 0,
|
|
72
|
-
'wght' 300,
|
|
73
|
-
'GRAD' 0,
|
|
74
|
-
'opsz' 24;
|
|
75
|
-
}
|
|
76
|
-
.material-icons-filled,
|
|
77
|
-
.material-symbols-filled {
|
|
78
|
-
font-variation-settings:
|
|
79
|
-
'FILL' 1,
|
|
80
|
-
'wght' 300,
|
|
81
|
-
'GRAD' 0,
|
|
82
|
-
'opsz' 24 !important;
|
|
83
|
-
}
|
|
84
|
-
.overflow-y-scroll {
|
|
85
|
-
overflow-y: scroll;
|
|
86
|
-
}
|
|
87
|
-
.material-icons-outlined,
|
|
88
|
-
.material-icons {
|
|
89
|
-
font-family: 'Material Symbols Outlined' !important;
|
|
90
|
-
font-weight: normal;
|
|
91
|
-
font-style: normal;
|
|
92
|
-
font-size: 24px;
|
|
93
|
-
line-height: 1;
|
|
94
|
-
letter-spacing: normal;
|
|
95
|
-
text-transform: none;
|
|
96
|
-
display: inline-block;
|
|
97
|
-
white-space: nowrap;
|
|
98
|
-
word-wrap: normal;
|
|
99
|
-
direction: ltr;
|
|
100
|
-
-webkit-font-feature-settings: 'liga';
|
|
101
|
-
-webkit-font-smoothing: antialiased;
|
|
102
|
-
}
|
|
103
|
-
.transparent {
|
|
104
|
-
background-color: transparent;
|
|
105
|
-
}
|
|
106
|
-
.card-bg-border {
|
|
107
|
-
border-radius: 12px !important;
|
|
108
|
-
border: 2px #ffffffaa solid;
|
|
109
|
-
}
|
|
110
|
-
</style>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
import App from '@/App.vue';
|
|
3
|
+
import { demoPayload } from '@/components/demo/demo-payload';
|
|
3
4
|
|
|
4
5
|
describe('App.vue', () => {
|
|
5
6
|
it('should inflate component', () => {
|
|
@@ -9,7 +10,7 @@ describe('App.vue', () => {
|
|
|
9
10
|
|
|
10
11
|
it('should loadScan', async () => {
|
|
11
12
|
const wrapper = shallowMount(App);
|
|
12
|
-
await wrapper.vm.
|
|
13
|
+
await wrapper.vm.loadViewer(demoPayload, {});
|
|
13
14
|
expect(wrapper).toBeTruthy();
|
|
14
15
|
});
|
|
15
16
|
});
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { demoPayload } from '@/components/demo/demo-payload';
|
|
2
|
+
import { mountViewer, loadSession, loadViewer, unmountViewer } from '@/main';
|
|
3
|
+
import { nextTick } from 'vue';
|
|
2
4
|
|
|
3
5
|
describe('index tests', () => {
|
|
4
|
-
const errorMessage = 'Please call `
|
|
6
|
+
const errorMessage = 'Please call `mountViewer` first';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await mountViewer(document.body, '1.0.0');
|
|
10
|
+
await nextTick();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
afterEach(async () => {
|
|
14
|
+
await unmountViewer();
|
|
8
15
|
});
|
|
9
16
|
|
|
10
17
|
it('should reject loadSession invalid url', () => {
|
|
11
|
-
|
|
18
|
+
const execution = () => loadSession('');
|
|
19
|
+
expect(execution).rejects.toThrow('Invalid URL type');
|
|
12
20
|
});
|
|
13
21
|
|
|
14
22
|
it('should resolve loadViewer', async () => {
|
|
15
|
-
|
|
16
|
-
expect(loadViewer()).resolves.not.toThrow(errorMessage);
|
|
23
|
+
expect(loadViewer(demoPayload)).resolves.not.toThrow(errorMessage);
|
|
17
24
|
});
|
|
18
25
|
|
|
19
26
|
it('should resolve loadSession 3crds url', async () => {
|
|
20
|
-
await registerViewer(document.body, '1.0.0');
|
|
21
27
|
expect(loadSession('https://localhost/example.3crds')).resolves.not.toThrow(errorMessage);
|
|
22
28
|
});
|
|
23
29
|
|
|
24
30
|
it('should resolve loadSession 3crms url', async () => {
|
|
25
|
-
await registerViewer(document.body, '1.0.0');
|
|
26
31
|
expect(loadSession('https://localhost/example.3crms')).resolves.not.toThrow(errorMessage);
|
|
27
32
|
});
|
|
28
33
|
|
|
29
34
|
it('should resolve loadSession 3crs url', async () => {
|
|
30
|
-
await registerViewer(document.body, '1.0.0');
|
|
31
35
|
expect(loadSession('https://localhost/example.3crs')).resolves.not.toThrow(errorMessage);
|
|
32
36
|
});
|
|
33
|
-
|
|
34
|
-
it('should eject viewer', () => {
|
|
35
|
-
expect(ejectViewer()).resolves.not.toThrow();
|
|
36
|
-
});
|
|
37
37
|
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
$shark: (
|
|
2
|
+
50: #f7f7f8,
|
|
3
|
+
100: #eeeef0,
|
|
4
|
+
200: #d9d9de,
|
|
5
|
+
300: #b9bac0,
|
|
6
|
+
400: #92939e,
|
|
7
|
+
500: #757682,
|
|
8
|
+
600: #5e5e6b,
|
|
9
|
+
700: #4d4d57,
|
|
10
|
+
800: #42424a,
|
|
11
|
+
900: #3a3a40,
|
|
12
|
+
950: #1d1d20
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
$minsk: (
|
|
16
|
+
50: #eff3fe,
|
|
17
|
+
100: #e1eafe,
|
|
18
|
+
200: #c9d7fc,
|
|
19
|
+
300: #a8bcf9,
|
|
20
|
+
400: #8599f4,
|
|
21
|
+
500: #6875ec,
|
|
22
|
+
600: #4c4fdf,
|
|
23
|
+
700: #3d3dc5,
|
|
24
|
+
800: #34359f,
|
|
25
|
+
900: #2e3176,
|
|
26
|
+
950: #1d1d49
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
$picton: (
|
|
30
|
+
50: #f2f8fd,
|
|
31
|
+
100: #e4effa,
|
|
32
|
+
200: #c3def4,
|
|
33
|
+
300: #8ec4eb,
|
|
34
|
+
400: #50a5de,
|
|
35
|
+
500: #2b8bcc,
|
|
36
|
+
600: #1c6ead,
|
|
37
|
+
700: #18588c,
|
|
38
|
+
800: #184b74,
|
|
39
|
+
900: #194061,
|
|
40
|
+
950: #112940
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
$malachite: (
|
|
44
|
+
50: #f2fdf0,
|
|
45
|
+
100: #dffcdc,
|
|
46
|
+
200: #c1f7bb,
|
|
47
|
+
300: #90ee87,
|
|
48
|
+
400: #5bde50,
|
|
49
|
+
500: #2fc423,
|
|
50
|
+
600: #21a217,
|
|
51
|
+
700: #1d7f16,
|
|
52
|
+
800: #1c6417,
|
|
53
|
+
900: #175314,
|
|
54
|
+
950: #062e05,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
$viking: (
|
|
58
|
+
50: #eefcfd,
|
|
59
|
+
100: #d4f6f9,
|
|
60
|
+
200: #aeedf3,
|
|
61
|
+
300: #76deea,
|
|
62
|
+
400: #50cdde,
|
|
63
|
+
500: #1ba9bf,
|
|
64
|
+
600: #1988a1,
|
|
65
|
+
700: #1b6d83,
|
|
66
|
+
800: #1f5a6b,
|
|
67
|
+
900: #1e4b5b,
|
|
68
|
+
950: #0e313e
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
$lightning: (
|
|
72
|
+
50: #fcfde9,
|
|
73
|
+
100: #fbfcc5,
|
|
74
|
+
200: #fbf98d,
|
|
75
|
+
300: #f8ee4c,
|
|
76
|
+
400: #f5e12f,
|
|
77
|
+
500: #e4c50e,
|
|
78
|
+
600: #c59b09,
|
|
79
|
+
700: #9d700b,
|
|
80
|
+
800: #825811,
|
|
81
|
+
900: #6f4814,
|
|
82
|
+
950: #402608
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
$amaranth: (
|
|
86
|
+
50: #fdf4f3,
|
|
87
|
+
100: #fce7e8,
|
|
88
|
+
200: #f8d3d4,
|
|
89
|
+
300: #f2afb2,
|
|
90
|
+
400: #eb818a,
|
|
91
|
+
500: #dc4756,
|
|
92
|
+
600: #ca344a,
|
|
93
|
+
700: #aa263d,
|
|
94
|
+
800: #8e2338,
|
|
95
|
+
900: #7a2136,
|
|
96
|
+
950: #440d19
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
@mixin util-classes($prefix, $palette) {
|
|
100
|
+
@each $hue, $hex in $palette {
|
|
101
|
+
// e.g. class="minsk-500"
|
|
102
|
+
.#{$prefix}-#{$hue} {
|
|
103
|
+
color: $hex !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// e.g. class="bg-minsk-500"
|
|
107
|
+
.bg-#{$prefix}-#{$hue} {
|
|
108
|
+
background-color: $hex !important;
|
|
109
|
+
color: if($hue <= 400, #000, #fff);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@use 'palette' as palette;
|
|
2
|
+
@use 'typography' as typography;
|
|
3
|
+
|
|
4
|
+
@forward 'vuetify/settings' with (
|
|
5
|
+
// global
|
|
6
|
+
$body-font-family: typography.$font-family,
|
|
7
|
+
$border-radius-root: 8px,
|
|
8
|
+
$heading-font-family: typography.$font-family,
|
|
9
|
+
$typography: (
|
|
10
|
+
'd1': map-get(typography.$display, 'd1'),
|
|
11
|
+
'd2': map-get(typography.$display, 'd2'),
|
|
12
|
+
'd3': map-get(typography.$display, 'd3'),
|
|
13
|
+
'd4': map-get(typography.$display, 'd4'),
|
|
14
|
+
'h1': map-get(typography.$heading, 'h1'),
|
|
15
|
+
'h2': map-get(typography.$heading, 'h2'),
|
|
16
|
+
'h3': map-get(typography.$heading, 'h3'),
|
|
17
|
+
'h4': map-get(typography.$heading, 'h4'),
|
|
18
|
+
'h5': map-get(typography.$heading, 'h5'),
|
|
19
|
+
'h6': map-get(typography.$heading, 'h6'),
|
|
20
|
+
'lead-regular': map-get(typography.$lead, 'regular'),
|
|
21
|
+
'lead-semibold': map-get(typography.$lead, 'semibold'),
|
|
22
|
+
'base-regular': map-get(typography.$base, 'regular'),
|
|
23
|
+
'base-medium': map-get(typography.$base, 'medium'),
|
|
24
|
+
'base-semibold': map-get(typography.$base, 'semibold'),
|
|
25
|
+
'sm-regular': map-get(typography.$sm, 'regular'),
|
|
26
|
+
'sm-medium': map-get(typography.$sm, 'medium'),
|
|
27
|
+
'sm-semibold': map-get(typography.$sm, 'semibold'),
|
|
28
|
+
'xs-regular': map-get(typography.$xs, 'regular'),
|
|
29
|
+
'xs-medium': map-get(typography.$xs, 'medium'),
|
|
30
|
+
'xs-semibold': map-get(typography.$xs, 'semibold'),
|
|
31
|
+
'button': map-get(typography.$sm, 'semibold')
|
|
32
|
+
),
|
|
33
|
+
|
|
34
|
+
// v-btn
|
|
35
|
+
$button-height: 40px,
|
|
36
|
+
|
|
37
|
+
// v-card
|
|
38
|
+
$card-title-font-size: map-get(typography.$heading, 'h3', 'size'),
|
|
39
|
+
$card-title-font-weight: map-get(typography.$heading, 'h3', 'weight'),
|
|
40
|
+
$card-title-letter-spacing: map-get(typography.$heading, 'h3', 'letter-spacing'),
|
|
41
|
+
$card-title-line-height: map-get(typography.$heading, 'h3', 'line-height'),
|
|
42
|
+
|
|
43
|
+
// v-divider
|
|
44
|
+
$divider-border-color: map-get(palette.$shark, 200),
|
|
45
|
+
$divider-opacity: 1,
|
|
46
|
+
|
|
47
|
+
// v-list-item-title
|
|
48
|
+
$list-item-title-font-size: map-get(typography.$sm, 'semibold', 'size'),
|
|
49
|
+
$list-item-title-font-weight: map-get(typography.$sm, 'semibold', 'weight'),
|
|
50
|
+
$list-item-title-letter-spacing: map-get(typography.$sm, 'semibold', 'letter-spacing'),
|
|
51
|
+
|
|
52
|
+
// v-list-item-subtitle
|
|
53
|
+
$list-item-subtitle-font-size: map-get(typography.$xs, 'regular', 'size'),
|
|
54
|
+
$list-item-subtitle-font-weight: map-get(typography.$xs, 'regular', 'weight'),
|
|
55
|
+
$list-item-subtitle-letter-spacing: map-get(typography.$xs, 'regular', 'letter-spacing'),
|
|
56
|
+
$list-item-subtitle-opacity: 1,
|
|
57
|
+
|
|
58
|
+
// v-snackbar
|
|
59
|
+
$snackbar-background: #ffffffe5,
|
|
60
|
+
$snackbar-border-radius: 12px,
|
|
61
|
+
|
|
62
|
+
// v-tab
|
|
63
|
+
$tab-slider-size: 0,
|
|
64
|
+
);
|