@3cr/viewer-browser 0.0.196 → 0.0.220
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 +46 -22
- package/.prettierrc +6 -0
- package/components.d.ts +23 -10
- package/dist/Viewer3CR.js +37 -46
- package/dist/Viewer3CR.mjs +22640 -20897
- package/dist/Viewer3CR.umd.js +37 -46
- package/dist/android-chrome-192x192.png +0 -0
- package/dist/android-chrome-512x512.png +0 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/browserconfig.xml +9 -0
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/mstile-144x144.png +0 -0
- package/dist/mstile-150x150.png +0 -0
- package/dist/mstile-310x150.png +0 -0
- package/dist/mstile-310x310.png +0 -0
- package/dist/mstile-70x70.png +0 -0
- package/dist/safari-pinned-tab.svg +50 -0
- package/dist/site.webmanifest +19 -0
- package/index.html +34 -41
- package/package.json +23 -20
- package/playground/android-chrome-192x192.png +0 -0
- package/playground/android-chrome-512x512.png +0 -0
- package/playground/apple-touch-icon.png +0 -0
- package/playground/browserconfig.xml +9 -0
- package/playground/favicon-16x16.png +0 -0
- package/playground/favicon-32x32.png +0 -0
- package/playground/favicon.ico +0 -0
- package/playground/index.html +26 -29
- package/playground/mstile-144x144.png +0 -0
- package/playground/mstile-150x150.png +0 -0
- package/playground/mstile-310x150.png +0 -0
- package/playground/mstile-310x310.png +0 -0
- package/playground/mstile-70x70.png +0 -0
- package/playground/safari-pinned-tab.svg +50 -0
- package/playground/site.webmanifest +19 -0
- package/playground/sw.js +15 -1
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/browserconfig.xml +9 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/mstile-144x144.png +0 -0
- package/public/mstile-150x150.png +0 -0
- package/public/mstile-310x150.png +0 -0
- package/public/mstile-310x310.png +0 -0
- package/public/mstile-70x70.png +0 -0
- package/public/safari-pinned-tab.svg +50 -0
- package/public/site.webmanifest +19 -0
- package/src/App.vue +35 -45
- package/src/__tests__/app.spec.ts +7 -8
- package/{__tests__/index.spec.ts → src/__tests__/main.spec.ts} +5 -6
- package/src/assets/logos/3dicom/white-mini.svg +20 -0
- package/src/assets/logos/3dicom/white.svg +30 -0
- package/src/assets/styles.scss +14 -4
- package/src/components/demo/__tests__/DemoModal.spec.ts +9 -8
- package/src/components/demo/__tests__/DemoPatientModal.spec.ts +11 -10
- package/src/components/demo/__tests__/options.spec.ts +1 -1
- package/src/components/demo/licence/__tests__/DemoLicenceEnableCloudStorageModal.spec.ts +11 -10
- package/src/components/demo/licence/__tests__/DemoLicenceInfoModal.spec.ts +21 -11
- package/src/components/demo/licence/__tests__/DemoLicenceSendToPartyModal.spec.ts +10 -10
- package/src/components/demo/licence/__tests__/DemoLicenceShareToMobileModal.spec.ts +14 -13
- package/src/components/demo/options.ts +54 -59
- package/src/components/demo/patient/__tests__/DemoPatientEnableCloudStorageModal.spec.ts +11 -10
- package/src/components/demo/patient/__tests__/DemoPatientInfoModal.spec.ts +12 -11
- package/src/components/demo/patient/__tests__/DemoPatientSendToPartyModal.spec.ts +10 -10
- package/src/components/demo/patient/__tests__/DemoPatientShareToMobileModal.spec.ts +14 -13
- package/src/components/modal/ActionRail.vue +7 -11
- package/src/components/modal/AskAI.vue +35 -50
- package/src/components/modal/CloseViewerModal.vue +22 -57
- package/src/components/modal/MftpWebGL3DRModal.vue +152 -570
- package/src/components/modal/ViewerActionRail.vue +50 -39
- package/src/components/modal/ViewerNavigationDrawer.vue +10 -8
- package/src/components/modal/ViewerNavigationDrawerContent.vue +82 -49
- package/src/components/modal/ViewerNavigationDrawerFooter.vue +57 -60
- package/src/components/modal/ViewerNavigationDrawerHeader.vue +13 -48
- package/src/components/modal/ViewerScanView.vue +114 -0
- package/src/components/modal/WebGL3DR.vue +84 -0
- package/src/components/modal/__tests__/ActionRail.spec.ts +10 -0
- package/src/components/modal/__tests__/AskAI.spec.ts +33 -0
- package/src/components/modal/__tests__/CloseViewerModal.spec.ts +24 -14
- package/src/components/modal/__tests__/MftpWebGL3DRModal.spec.ts +147 -176
- package/src/components/modal/__tests__/ViewerActionRail.spec.ts +11 -0
- package/src/components/modal/__tests__/ViewerNavigationDrawer.spec.ts +10 -12
- package/src/components/modal/__tests__/ViewerNavigationDrawerContent.spec.ts +4 -22
- package/src/components/modal/__tests__/ViewerNavigationDrawerFooter.spec.ts +35 -32
- package/src/components/modal/__tests__/ViewerNavigationDrawerHeader.spec.ts +11 -9
- package/src/components/modal/__tests__/ViewerScanView.spec.ts +60 -0
- package/src/components/modal/__tests__/WebGL3DR.spec.ts +57 -0
- package/src/components/modal/actions/Flip3dAction.vue +1 -1
- package/src/components/modal/actions/FlipHorizontalAction.vue +5 -10
- package/src/components/modal/actions/FlipVerticalAction.vue +5 -10
- package/src/components/modal/actions/FullscreenAction.vue +6 -11
- package/src/components/modal/actions/HideViewAction.vue +38 -0
- package/src/components/modal/actions/NavigationCubeAction.vue +7 -14
- package/src/components/modal/actions/PanAction.vue +4 -4
- package/src/components/modal/actions/ResetViewAction.vue +1 -1
- package/src/components/modal/actions/Rotate2dAction.vue +8 -20
- package/src/components/modal/actions/Slice3dAction.vue +10 -32
- package/src/components/modal/actions/ZoomAction.vue +1 -1
- package/src/components/modal/actions/__tests__/Action.spec.ts +8 -9
- package/src/components/modal/actions/__tests__/Flip3dAction.spec.ts +6 -8
- package/src/components/modal/actions/__tests__/FlipHorizontalAction.spec.ts +6 -7
- package/src/components/modal/actions/__tests__/FlipVerticalAction.spec.ts +6 -7
- package/src/components/modal/actions/__tests__/FullscreenAction.spec.ts +9 -10
- package/src/components/modal/actions/__tests__/NavigationCubeAction.spec.ts +11 -11
- package/src/components/modal/actions/__tests__/PanAction.spec.ts +9 -10
- package/src/components/modal/actions/__tests__/ResetViewAction.spec.ts +7 -7
- package/src/components/modal/actions/__tests__/Rotate2dAction.spec.ts +6 -8
- package/src/components/modal/actions/__tests__/Slice3dAction.spec.ts +23 -5
- package/src/components/modal/actions/__tests__/ZoomAction.spec.ts +8 -10
- package/src/components/modal/buttons/AutoAnnotateBtn.vue +29 -0
- package/src/components/modal/buttons/__tests__/AutoAnnotateBtn.spec.ts +28 -0
- package/src/components/modal/menus/FileMenu.vue +80 -0
- package/src/components/modal/menus/SettingsMenu.vue +111 -0
- package/src/components/modal/menus/__tests__/FileMenu.spec.ts +110 -0
- package/src/components/modal/menus/__tests__/SettingsMenu.spec.ts +71 -0
- package/src/components/shared/DoubleSliderSelector.vue +142 -0
- package/src/components/shared/UpdateSnackbar.vue +72 -0
- package/src/components/{selectors → shared}/ValueSelector.vue +9 -12
- package/src/components/shared/__tests__/DoubleSliderSelector.spec.ts +83 -0
- package/src/components/shared/__tests__/LoadingSpinner.spec.ts +9 -0
- package/src/components/shared/__tests__/UpdateSnackbar.spec.ts +116 -0
- package/src/components/shared/__tests__/ValueSelector.spec.ts +39 -0
- package/src/components/shared/__tests__/VerticalSliderSelector.spec.ts +50 -0
- package/src/components/views/AnnotationTreeView.vue +234 -0
- package/src/components/{modal/ViewerDisplaySettings.vue → views/DisplaySettings.vue} +7 -15
- package/src/components/views/MarkupTreeView.vue +199 -0
- package/src/components/views/McadObjectTreeView.vue +119 -0
- package/src/components/views/__tests__/AnnotationTreeView.spec.ts +62 -0
- package/src/components/{modal/__tests__/ViewerDisplaySettings.spec.ts → views/__tests__/DisplaySettings.spec.ts} +24 -20
- package/src/components/views/__tests__/MarkupTreeView.spec.ts +41 -0
- package/src/components/views/__tests__/McadObjectTreeView.spec.ts +47 -0
- package/src/components/views/modals/DataOverlayModal.vue +89 -0
- package/src/components/views/modals/DataOverlayModalManager.vue +104 -0
- package/src/components/views/modals/__tests__/DataOverlayModal.spec.ts +33 -0
- package/src/components/views/modals/__tests__/DataOverlayModalManager.spec.ts +93 -0
- package/src/components/views/shared/MaskIcon.vue +44 -0
- package/src/components/views/shared/ObjectColor.vue +31 -0
- package/src/components/views/shared/ObjectLabel.vue +30 -0
- package/src/components/views/shared/Opacity.vue +66 -0
- package/src/components/views/shared/VisibilityBtn.vue +25 -0
- package/src/components/views/shared/__tests__/MaskIcon.spec.ts +10 -0
- package/src/components/views/shared/__tests__/ObjectColor.spec.ts +10 -0
- package/src/components/views/shared/__tests__/ObjectLabel.spec.ts +10 -0
- package/src/components/views/shared/__tests__/Opacity.spec.ts +24 -0
- package/src/components/views/shared/__tests__/VisibilityBtn.spec.ts +11 -0
- package/src/components/views/types/annotation-tree-view-item-child-action.ts +6 -0
- package/src/components/views/types/annotation-tree-view-item-child.ts +9 -0
- package/src/components/views/types/annotation-tree-view-item.ts +13 -0
- package/src/components/views/types/markup-tree-view-item-child.ts +6 -0
- package/src/components/views/types/markup-tree-view-item.ts +14 -0
- package/src/components/views/types/mcad-object-tree-view-item.ts +13 -0
- package/src/composables/__tests__/useAnnotations.spec.ts +35 -0
- package/src/composables/__tests__/useEventListener.spec.ts +32 -0
- package/src/composables/__tests__/useIntroJs.spec.ts +51 -0
- package/src/composables/__tests__/useMarkups.spec.ts +39 -0
- package/src/composables/__tests__/useMcadObjects.spec.ts +36 -0
- package/src/composables/__tests__/useMouse.spec.ts +20 -0
- package/src/{components/modal/composables → composables}/__tests__/useNavigationCubeObserver.spec.ts +17 -12
- package/src/{dataLayer → composables}/__tests__/useViewer3cr.spec.ts +1 -2
- package/src/composables/useAnnotations.ts +37 -0
- package/src/composables/useEventListener.ts +25 -0
- package/src/composables/useIntroJs.ts +125 -0
- package/src/composables/useMarkups.ts +41 -0
- package/src/composables/useMcadObjects.ts +32 -0
- package/src/composables/useMouse.ts +14 -0
- package/src/{components/modal/composables → composables}/useNavigationCubeObserver.ts +35 -25
- package/src/composables/useScanMovement.ts +25 -0
- package/src/composables/useScanSliders.ts +36 -0
- package/src/composables/useVersion3cr.ts +7 -0
- package/src/composables/useViewer3cr.ts +7 -0
- package/src/composables/useViewerOptions.ts +35 -0
- package/src/{dataLayer → functions}/__tests__/clamp.spec.ts +1 -2
- package/src/functions/__tests__/layoutOverlayStyle.spec.ts +325 -0
- package/src/{helpers/__tests__/model-helper.spec.ts → functions/__tests__/modelHelper.spec.ts} +77 -40
- package/src/{notifications → functions}/__tests__/notification.spec.ts +19 -29
- package/src/functions/__tests__/parseAction.spec.ts +9 -0
- package/src/functions/__tests__/parseCallToAction.spec.ts +11 -0
- package/src/functions/__tests__/parseDataOverlay.spec.ts +15 -0
- package/src/functions/__tests__/parseDataOverlayData.spec.ts +9 -0
- package/src/functions/__tests__/parseDataOverlayEvent.spec.ts +10 -0
- package/src/functions/__tests__/parseMcadEvent.spec.ts +10 -0
- package/src/functions/layoutOverlayStyle.ts +84 -0
- package/src/{helpers → functions}/modelHelper.ts +79 -18
- package/src/{notifications → functions}/notification.ts +12 -14
- package/src/functions/parseAction.ts +9 -0
- package/src/functions/parseCallToAction.ts +9 -0
- package/src/functions/parseDataOverlay.ts +10 -0
- package/src/functions/parseDataOverlayData.ts +10 -0
- package/src/functions/parseDataOverlayEvent.ts +17 -0
- package/src/functions/parseMcadEvent.ts +10 -0
- package/src/functions/rgbaToCss.ts +13 -0
- package/src/main.ts +48 -9
- package/src/{dataLayer → models}/__tests__/eventHandlers.spec.ts +2 -3
- package/src/models/__tests__/loadViewerOptions.spec.ts +72 -0
- package/src/models/__tests__/loadViewerPayload.spec.ts +10 -0
- package/src/models/__tests__/scanState.spec.ts +190 -0
- package/src/models/callbacks.ts +4 -0
- package/src/models/loadViewerOptions.ts +40 -0
- package/src/models/loadViewerPayload.ts +24 -0
- package/src/{dataLayer → models}/scanState.ts +63 -74
- package/src/plugins/__tests__/usePlugins.spec.ts +12 -0
- package/src/plugins/__tests__/vuetify.spec.ts +3 -4
- package/src/plugins/usePlugins.ts +8 -0
- package/src/plugins/vuetify.ts +31 -65
- package/src/services/{gpt/__tests__ → __tests__}/gpt.service.spec.ts +2 -2
- package/src/services/__tests__/service-worker.service.spec.ts +32 -0
- package/src/{dataLayer/__tests__/viewer3cr.spec.ts → services/__tests__/viewer-3cr.service.spec.ts} +97 -36
- package/src/services/gpt.service.ts +17 -0
- package/src/services/service-worker.service.ts +16 -0
- package/src/{dataLayer/viewer3cr.ts → services/viewer-3cr.service.ts} +269 -150
- package/src/types/action.ts +13 -0
- package/src/types/call-to-action.ts +9 -0
- package/src/types/colour.ts +6 -0
- package/src/types/data-overlay-angle.ts +16 -0
- package/src/types/data-overlay-annotation.ts +18 -0
- package/src/types/data-overlay-data.ts +15 -0
- package/src/types/data-overlay-info.ts +14 -0
- package/src/types/data-overlay-interaction.ts +15 -0
- package/src/types/data-overlay-length.ts +16 -0
- package/src/types/data-overlay-markup.ts +7 -0
- package/src/types/data-overlay-mcad.ts +20 -0
- package/src/types/data-overlay-polygon.ts +18 -0
- package/src/types/data-overlay.ts +16 -0
- package/src/types/gpt-question.ts +4 -0
- package/src/types/gpt-response-payload.ts +6 -0
- package/src/types/mcad-object-interaction.ts +15 -0
- package/src/types/segment-angle.ts +5 -0
- package/src/types/vector2.ts +4 -0
- package/src/types/vector3.ts +5 -0
- package/test/fakers/action-data.faker.ts +11 -0
- package/test/fakers/action.faker.ts +19 -0
- package/test/fakers/call-to-action.faker.ts +17 -0
- package/test/fakers/colour.faker.ts +17 -0
- package/test/fakers/data-overlay-angle.faker.ts +37 -0
- package/test/fakers/data-overlay-annotation.faker.ts +41 -0
- package/test/fakers/data-overlay-data.faker.ts +97 -0
- package/test/fakers/data-overlay-info.faker.ts +29 -0
- package/test/fakers/data-overlay-interaction.faker.ts +62 -0
- package/test/fakers/data-overlay-length.faker.ts +37 -0
- package/test/fakers/data-overlay-mcad.faker.ts +40 -0
- package/test/fakers/data-overlay-polygon.faker.ts +39 -0
- package/test/fakers/gpt-question.faker.ts +11 -0
- package/test/fakers/gpt-response.faker.ts +12 -0
- package/test/fakers/invert-transform.faker.ts +16 -0
- package/test/fakers/mcad-object-interaction.faker.ts +22 -0
- package/test/fakers/orientation.faker.ts +17 -0
- package/test/fakers/segment-angle.faker.ts +12 -0
- package/test/fakers/vector2.faker.ts +12 -0
- package/test/fakers/vector3.faker.ts +16 -0
- package/test/plugins/findByTestId.ts +25 -0
- package/test/plugins/vuetify.ts +16 -0
- package/test/setup.ts +16 -5
- package/tsconfig.json +4 -15
- package/vite.config.mts +20 -46
- package/vitest.config.mts +24 -43
- package/index.ts +0 -72
- package/src/assets/images/dark/3DICOM.png +0 -0
- package/src/assets/images/dark/3dicom-logo.svg +0 -1
- package/src/assets/images/light/3DICOM.png +0 -0
- package/src/assets/images/light/3dicom-logo.svg +0 -1
- package/src/assets/logo.png +0 -0
- package/src/assets/logo.svg +0 -6
- package/src/components/WebGL3DR.vue +0 -102
- package/src/components/__tests__/webgl3dr.spec.ts +0 -37
- package/src/components/icons/liver.vue +0 -21
- package/src/components/loading/__tests__/loading-spinner.spec.ts +0 -11
- package/src/components/modal/ViewerAnnotationModal.vue +0 -115
- package/src/components/modal/ViewerAnnotations.vue +0 -283
- package/src/components/modal/__tests__/ViewerAnnotationModal.spec.ts +0 -79
- package/src/components/modal/composables/useEventListener.ts +0 -22
- package/src/components/selectors/__tests__/value-selector.spec.ts +0 -53
- package/src/components/sliders/DoubleSliderSelector.vue +0 -141
- package/src/components/sliders/__tests__/double-slider-selector.spec.ts +0 -104
- package/src/components/sliders/__tests__/vertical-slider-selector.spec.ts +0 -61
- package/src/dataLayer/__tests__/getIconForPreset.spec.ts +0 -40
- package/src/dataLayer/__tests__/patchDataOverlay.spec.ts +0 -88
- package/src/dataLayer/__tests__/scanState.spec.ts +0 -93
- package/src/dataLayer/getIconForPreset.ts +0 -11
- package/src/dataLayer/patchDataOverlay.ts +0 -101
- package/src/dataLayer/useViewer3cr.ts +0 -7
- package/src/helpers/__tests__/layout-overlay-style.spec.ts +0 -290
- package/src/helpers/__tests__/utils.spec.ts +0 -70
- package/src/helpers/layoutOverlayStyle.ts +0 -96
- package/src/helpers/utils.ts +0 -16
- package/src/models/Callbacks.ts +0 -2
- package/src/models/LoadViewerOptions.ts +0 -31
- package/src/models/LoadViewerPayload.ts +0 -9
- package/src/models/__tests__/load-viewer-options.spec.ts +0 -22
- package/src/plugins/__tests__/index.spec.ts +0 -19
- package/src/plugins/index.ts +0 -17
- package/src/services/gpt/gpt.service.ts +0 -27
- package/static/3cr-types-browser/index.ts +0 -74
- package/static/3cr-types-browser/types/Action.ts +0 -6
- package/static/3cr-types-browser/types/AlphaKeys.ts +0 -5
- package/static/3cr-types-browser/types/AnchorPoint.ts +0 -12
- package/static/3cr-types-browser/types/CallToAction.ts +0 -5
- package/static/3cr-types-browser/types/ColourData.ts +0 -7
- package/static/3cr-types-browser/types/ColourPresetData.ts +0 -9
- package/static/3cr-types-browser/types/CurrentDataOverlayState.ts +0 -6
- package/static/3cr-types-browser/types/CurrentScanState.ts +0 -22
- package/static/3cr-types-browser/types/DataOverlay.ts +0 -22
- package/static/3cr-types-browser/types/DataOverlayActions.ts +0 -14
- package/static/3cr-types-browser/types/DataOverlayData.ts +0 -8
- package/static/3cr-types-browser/types/DataOverlayEvent.ts +0 -8
- package/static/3cr-types-browser/types/DecryptionKey.ts +0 -4
- package/static/3cr-types-browser/types/DisplaySettings.ts +0 -10
- package/static/3cr-types-browser/types/EmptyPayload.ts +0 -3
- package/static/3cr-types-browser/types/EnumPayload.ts +0 -4
- package/static/3cr-types-browser/types/FileManagementActions.ts +0 -11
- package/static/3cr-types-browser/types/FlipValue.ts +0 -7
- package/static/3cr-types-browser/types/FrontEndInterfaces.ts +0 -14
- package/static/3cr-types-browser/types/GradientKeys.ts +0 -7
- package/static/3cr-types-browser/types/GreyscalePresetData.ts +0 -6
- package/static/3cr-types-browser/types/InitialDataOverlayState.ts +0 -6
- package/static/3cr-types-browser/types/InitialScanState.ts +0 -19
- package/static/3cr-types-browser/types/InteractionType.ts +0 -8
- package/static/3cr-types-browser/types/InteractivityActions.ts +0 -6
- package/static/3cr-types-browser/types/InteractivityState.ts +0 -4
- package/static/3cr-types-browser/types/InvertTransformData.ts +0 -6
- package/static/3cr-types-browser/types/LayoutActions.ts +0 -6
- package/static/3cr-types-browser/types/LayoutData.ts +0 -7
- package/static/3cr-types-browser/types/LoadDataSet.ts +0 -6
- package/static/3cr-types-browser/types/LoadSessionState.ts +0 -4
- package/static/3cr-types-browser/types/LocalLoadDataset.ts +0 -3
- package/static/3cr-types-browser/types/MovementData.ts +0 -7
- package/static/3cr-types-browser/types/NavigationCubeActions.ts +0 -8
- package/static/3cr-types-browser/types/NavigationCubeData.ts +0 -12
- package/static/3cr-types-browser/types/NavigationCubeTransform.ts +0 -9
- package/static/3cr-types-browser/types/NotificationPayload.ts +0 -7
- package/static/3cr-types-browser/types/NotificationsActions.ts +0 -6
- package/static/3cr-types-browser/types/Object.ts +0 -1
- package/static/3cr-types-browser/types/ObjectColour.ts +0 -7
- package/static/3cr-types-browser/types/ObjectIcon.ts +0 -5
- package/static/3cr-types-browser/types/ObjectInvert.ts +0 -7
- package/static/3cr-types-browser/types/ObjectSize.ts +0 -7
- package/static/3cr-types-browser/types/ObjectSize2D.ts +0 -7
- package/static/3cr-types-browser/types/ObjectVisible.ts +0 -5
- package/static/3cr-types-browser/types/PositionData.ts +0 -14
- package/static/3cr-types-browser/types/PresetsActions.ts +0 -4
- package/static/3cr-types-browser/types/RotationValue.ts +0 -7
- package/static/3cr-types-browser/types/ScanMovementActions.ts +0 -27
- package/static/3cr-types-browser/types/ScanMovementData.ts +0 -3
- package/static/3cr-types-browser/types/ScanOrientationActions.ts +0 -6
- package/static/3cr-types-browser/types/ScanStateActions.ts +0 -4
- package/static/3cr-types-browser/types/ScanView.ts +0 -6
- package/static/3cr-types-browser/types/SettingsData.ts +0 -12
- package/static/3cr-types-browser/types/SlicerData.ts +0 -9
- package/static/3cr-types-browser/types/SliderValue.ts +0 -4
- package/static/3cr-types-browser/types/SlidersActions.ts +0 -18
- package/static/3cr-types-browser/types/Vector2Data.ts +0 -5
- package/static/3cr-types-browser/types/Vector3Data.ts +0 -6
- package/static/3cr-types-browser/types/VectorMovementData.ts +0 -8
- package/static/3cr-types-browser/types/ViewInteractiveMode.ts +0 -5
- package/static/3cr-types-browser/types/ViewOrientation.ts +0 -8
- package/static/3cr-types-browser/types/ViewOrientations.ts +0 -10
- package/static/3cr-types-browser/types/ViewSelectionActions.ts +0 -9
- package/static/3cr-types-browser/types/ViewToggleData.ts +0 -7
- package/static/3cr-types-browser/types/VolumeOrientation.ts +0 -7
- package/test/helper.ts +0 -44
- /package/src/components/{loading → shared}/LoadingSpinner.vue +0 -0
- /package/src/components/{sliders → shared}/VerticalSliderSelector.vue +0 -0
- /package/{config.ts → src/config.ts} +0 -0
- /package/src/{dataLayer → functions}/clamp.ts +0 -0
- /package/src/{dataLayer → models}/eventHandlers.ts +0 -0
- /package/{static/3cr-types-browser/types/ActionData.ts → src/types/action-data.ts} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { faker } from '@faker-js/faker';
|
|
2
|
+
import { McadObjectInteraction, McadObjectInteractionRaw } from '@/types/mcad-object-interaction';
|
|
3
|
+
import { DataOverlayMcadFaker } from '@test/fakers/data-overlay-mcad.faker';
|
|
4
|
+
import { Interactiontype } from '@3cr/types-ts';
|
|
5
|
+
|
|
6
|
+
export class McadObjectInteractionFaker {
|
|
7
|
+
static random(interaction: Interactiontype): McadObjectInteraction {
|
|
8
|
+
return {
|
|
9
|
+
Version: faker.system.semver(),
|
|
10
|
+
Mcad: DataOverlayMcadFaker.random(),
|
|
11
|
+
Interaction: interaction
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static randomRaw(interaction: Interactiontype): McadObjectInteractionRaw {
|
|
16
|
+
return {
|
|
17
|
+
Version: faker.system.semver(),
|
|
18
|
+
Mcad: DataOverlayMcadFaker.randomRaw(),
|
|
19
|
+
Interaction: interaction
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OrientationSetting } from '@3cr/types-ts/types/OrientationSetting';
|
|
2
|
+
import { faker } from '@faker-js/faker';
|
|
3
|
+
import { Orientation } from '@3cr/types-ts';
|
|
4
|
+
import { Vector3Faker } from '@test/fakers/vector3.faker';
|
|
5
|
+
|
|
6
|
+
export class OrientationFaker {
|
|
7
|
+
static random(): OrientationSetting {
|
|
8
|
+
return {
|
|
9
|
+
Version: faker.system.semver(),
|
|
10
|
+
Modifiers: faker.helpers.enumValue(Orientation),
|
|
11
|
+
ReferencePoint: Vector3Faker.random(),
|
|
12
|
+
Position: Vector3Faker.random(),
|
|
13
|
+
Rotation: Vector3Faker.random(),
|
|
14
|
+
Scale: Vector3Faker.random()
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SegmentAngle } from '@/types/segment-angle';
|
|
2
|
+
import { faker } from '@faker-js/faker';
|
|
3
|
+
|
|
4
|
+
export class SegmentAngleFaker {
|
|
5
|
+
static random(): SegmentAngle {
|
|
6
|
+
return {
|
|
7
|
+
Version: faker.system.semver(),
|
|
8
|
+
Acute: faker.number.float(),
|
|
9
|
+
Reflex: faker.number.float()
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { faker } from '@faker-js/faker';
|
|
2
|
+
import { Vector2Data } from '@3cr/types-ts';
|
|
3
|
+
|
|
4
|
+
export class Vector2Faker {
|
|
5
|
+
static random(): Vector2Data {
|
|
6
|
+
return {
|
|
7
|
+
Version: faker.system.semver(),
|
|
8
|
+
X: faker.number.float(),
|
|
9
|
+
Y: faker.number.float()
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Vector3Data } from '@3cr/types-ts';
|
|
2
|
+
import { faker } from '@faker-js/faker';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Create fake Vector3Data objects.
|
|
6
|
+
*/
|
|
7
|
+
export class Vector3Faker {
|
|
8
|
+
static random(): Vector3Data {
|
|
9
|
+
return {
|
|
10
|
+
Version: faker.system.semver(),
|
|
11
|
+
X: faker.number.float(),
|
|
12
|
+
Y: faker.number.float(),
|
|
13
|
+
Z: faker.number.float()
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { config, DOMWrapper, VueWrapper } from '@vue/test-utils';
|
|
2
|
+
import { ComponentOptions } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare module '@vue/test-utils' {
|
|
5
|
+
interface VueWrapper {
|
|
6
|
+
findByTestId(selector: string): DOMWrapper<HTMLElement>;
|
|
7
|
+
findComponentByTestId<T extends ComponentOptions>(selector: string): VueWrapper<T>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const findByTestIdPlugin = (wrapper: VueWrapper<unknown>) => {
|
|
12
|
+
function findByTestId(selector: string): DOMWrapper<HTMLElement> {
|
|
13
|
+
const testId = `[data-testid="${selector}"]`;
|
|
14
|
+
return wrapper.find(testId);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function findComponentByTestId<T extends ComponentOptions>(selector: string) {
|
|
18
|
+
const testId = `[data-testid="${selector}"]`;
|
|
19
|
+
return wrapper.findComponent<T>(testId);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return { findByTestId, findComponentByTestId };
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
config.plugins.VueWrapper.install(findByTestIdPlugin);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { config } from '@vue/test-utils';
|
|
2
|
+
import { createVuetify } from 'vuetify';
|
|
3
|
+
import * as components from 'vuetify/components';
|
|
4
|
+
import * as directives from 'vuetify/directives';
|
|
5
|
+
import { VTreeview, VTreeviewItem } from 'vuetify/labs/components';
|
|
6
|
+
|
|
7
|
+
config.global.plugins.push(
|
|
8
|
+
createVuetify({
|
|
9
|
+
components: {
|
|
10
|
+
...components,
|
|
11
|
+
VTreeview,
|
|
12
|
+
VTreeviewItem
|
|
13
|
+
},
|
|
14
|
+
directives
|
|
15
|
+
})
|
|
16
|
+
);
|
package/test/setup.ts
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@test/plugins/findByTestId';
|
|
2
|
+
import '@test/plugins/vuetify';
|
|
2
3
|
|
|
3
|
-
global.ResizeObserver = require(
|
|
4
|
+
global.ResizeObserver = require('resize-observer-polyfill');
|
|
4
5
|
|
|
5
|
-
vi.mock(
|
|
6
|
-
const mod =
|
|
6
|
+
vi.mock('@3cr/sdk-browser', async (importOriginal) => {
|
|
7
|
+
const mod = await importOriginal<typeof import('@3cr/sdk-browser')>();
|
|
7
8
|
return {
|
|
8
9
|
...mod,
|
|
9
10
|
registerVersion: vi.fn(),
|
|
10
11
|
createInstance: vi.fn(),
|
|
11
12
|
executePayload: vi.fn(),
|
|
12
|
-
registerOnPayloadHandler: vi.fn()
|
|
13
|
+
registerOnPayloadHandler: vi.fn()
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
vi.mock('@kyvg/vue3-notification', async (importOriginal) => {
|
|
18
|
+
const mod = await importOriginal<typeof import('@kyvg/vue3-notification')>();
|
|
19
|
+
return {
|
|
20
|
+
...mod,
|
|
21
|
+
useNotification: vi.fn().mockReturnValue({
|
|
22
|
+
notify: vi.fn()
|
|
23
|
+
})
|
|
13
24
|
};
|
|
14
25
|
});
|
package/tsconfig.json
CHANGED
|
@@ -2,22 +2,16 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ESNext",
|
|
4
4
|
"jsx": "preserve",
|
|
5
|
-
"lib": ["esnext
|
|
6
|
-
"types": [
|
|
7
|
-
|
|
8
|
-
],
|
|
9
|
-
"typeRoots": ["./node_modules/vuetify/types"],
|
|
10
|
-
|
|
5
|
+
"lib": ["esnext", "esnext.intl", "dom", "dom.iterable"],
|
|
6
|
+
"types": ["vitest/globals"],
|
|
11
7
|
"baseUrl": ".",
|
|
12
8
|
"module": "ESNext",
|
|
13
9
|
"moduleResolution": "node",
|
|
14
10
|
"paths": {
|
|
15
|
-
"@3cr/types-ts": ["static/3cr-types-browser"],
|
|
16
11
|
"@/*": ["src/*"],
|
|
17
|
-
"
|
|
12
|
+
"@test/*": ["test/*"]
|
|
18
13
|
},
|
|
19
14
|
"resolveJsonModule": true,
|
|
20
|
-
|
|
21
15
|
"allowJs": true,
|
|
22
16
|
"strict": true,
|
|
23
17
|
"strictNullChecks": true,
|
|
@@ -27,12 +21,7 @@
|
|
|
27
21
|
"isolatedModules": false,
|
|
28
22
|
"skipLibCheck": true
|
|
29
23
|
},
|
|
30
|
-
"include": [
|
|
31
|
-
"./src/typed-router.d.ts",
|
|
32
|
-
"**/*.ts",
|
|
33
|
-
"**/*.spec.ts",
|
|
34
|
-
"**/*.vue",
|
|
35
|
-
],
|
|
24
|
+
"include": ["**/*.ts", "**/*.vue"],
|
|
36
25
|
"exclude": ["dist", "node_modules", "cypress"],
|
|
37
26
|
"references": [{ "path": "./tsconfig.node.json" }]
|
|
38
27
|
}
|
package/vite.config.mts
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import Components from 'unplugin-vue-components/vite';
|
|
2
|
+
import Vue from '@vitejs/plugin-vue';
|
|
3
|
+
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
|
|
4
|
+
import ViteFonts from 'unplugin-fonts/vite';
|
|
5
|
+
import { defineConfig } from 'vite';
|
|
6
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
7
|
+
import { injectedStyleId } from './src/config';
|
|
8
|
+
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
|
|
6
9
|
|
|
7
|
-
// Utilities
|
|
8
|
-
import { defineConfig } from 'vite'
|
|
9
|
-
import { fileURLToPath, URL } from 'node:url'
|
|
10
|
-
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
|
|
11
|
-
import {injectedStyleId} from "./config";
|
|
12
|
-
|
|
13
|
-
// https://vitejs.dev/config/
|
|
14
10
|
export default defineConfig({
|
|
15
11
|
plugins: [
|
|
16
12
|
Vue({
|
|
17
13
|
template: { transformAssetUrls },
|
|
18
14
|
}),
|
|
19
|
-
// https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme
|
|
20
15
|
Vuetify(),
|
|
21
16
|
Components(),
|
|
22
|
-
cssInjectedByJsPlugin({
|
|
17
|
+
cssInjectedByJsPlugin({
|
|
18
|
+
styleId: injectedStyleId
|
|
19
|
+
}),
|
|
23
20
|
ViteFonts({
|
|
24
21
|
google: {
|
|
25
22
|
families: [{
|
|
@@ -32,28 +29,15 @@ export default defineConfig({
|
|
|
32
29
|
define: { 'process.env': {} },
|
|
33
30
|
build: {
|
|
34
31
|
target: 'esnext',
|
|
35
|
-
lib: {
|
|
36
|
-
entry: '
|
|
32
|
+
lib: {
|
|
33
|
+
entry: 'src/main.ts',
|
|
37
34
|
name: 'Viewer3CR',
|
|
38
|
-
fileName:
|
|
35
|
+
fileName: 'Viewer3CR',
|
|
39
36
|
formats: ['cjs', 'es', 'umd'],
|
|
40
37
|
},
|
|
41
38
|
rollupOptions: {
|
|
42
|
-
// make sure to externalize deps that shouldn't be bundled
|
|
43
|
-
// into your library
|
|
44
|
-
external: [
|
|
45
|
-
// "vue",
|
|
46
|
-
// "vuetify",
|
|
47
|
-
// "vite/client",
|
|
48
|
-
// "vite-plugin-vue-layouts/client",
|
|
49
|
-
// "unplugin-vue-router/client"
|
|
50
|
-
],
|
|
51
39
|
output: {
|
|
52
|
-
|
|
53
|
-
// for externalized deps
|
|
54
|
-
globals: {
|
|
55
|
-
vue: 'Vue',
|
|
56
|
-
},
|
|
40
|
+
globals: { vue: 'Vue' },
|
|
57
41
|
footer: `
|
|
58
42
|
if (globalThis.Viewer3CR) {
|
|
59
43
|
for (const key of Object.keys(globalThis.Viewer3CR)) {
|
|
@@ -63,25 +47,15 @@ if (globalThis.Viewer3CR) {
|
|
|
63
47
|
`
|
|
64
48
|
},
|
|
65
49
|
},
|
|
66
|
-
|
|
67
50
|
},
|
|
68
51
|
resolve: {
|
|
69
|
-
alias:
|
|
70
|
-
'@
|
|
71
|
-
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
72
|
-
'~': fileURLToPath(new URL('./test', import.meta.url)),
|
|
73
|
-
},
|
|
74
|
-
extensions: [
|
|
75
|
-
'.js',
|
|
76
|
-
'.json',
|
|
77
|
-
'.jsx',
|
|
78
|
-
'.mjs',
|
|
79
|
-
'.ts',
|
|
80
|
-
'.tsx',
|
|
81
|
-
'.vue',
|
|
52
|
+
alias: [
|
|
53
|
+
{ find: '@test', replacement: fileURLToPath(new URL('./test', import.meta.url)) },
|
|
54
|
+
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }
|
|
82
55
|
],
|
|
56
|
+
extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue'],
|
|
83
57
|
},
|
|
84
58
|
server: {
|
|
85
59
|
port: 3000,
|
|
86
60
|
},
|
|
87
|
-
})
|
|
61
|
+
});
|
package/vitest.config.mts
CHANGED
|
@@ -1,45 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {defineConfig, mergeConfig} from 'vite'
|
|
4
|
-
import viteConfig from "./vite.config.mjs";
|
|
1
|
+
import { defineConfig, mergeConfig } from 'vite';
|
|
2
|
+
import viteConfig from './vite.config.mjs';
|
|
5
3
|
|
|
6
|
-
export default mergeConfig(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
export default mergeConfig(
|
|
5
|
+
viteConfig,
|
|
6
|
+
defineConfig({
|
|
7
|
+
test: {
|
|
8
|
+
globals: true,
|
|
9
|
+
environment: 'jsdom',
|
|
10
|
+
server: {
|
|
11
|
+
deps: {
|
|
12
|
+
inline: ['vuetify']
|
|
13
|
+
}
|
|
13
14
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'dist/**',
|
|
27
|
-
'scripts/**',
|
|
28
|
-
'**/[.]**',
|
|
29
|
-
'packages/*/test?(s)/**',
|
|
30
|
-
'**/*.d.ts',
|
|
31
|
-
'**/virtual:*',
|
|
32
|
-
'**/__x00__*',
|
|
33
|
-
'**/\x00*',
|
|
34
|
-
'cypress/**',
|
|
35
|
-
'test?(s)/**',
|
|
36
|
-
'test?(-*).?(c|m)[jt]s?(x)',
|
|
37
|
-
'**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)',
|
|
38
|
-
'**/__tests__/**',
|
|
39
|
-
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
|
|
40
|
-
'**/vitest.{workspace,projects}.[jt]s?(on)',
|
|
41
|
-
'**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}',
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
}))
|
|
15
|
+
include: ['src/**/*.spec.ts'],
|
|
16
|
+
setupFiles: ['test/setup.ts'],
|
|
17
|
+
coverage: {
|
|
18
|
+
provider: 'istanbul',
|
|
19
|
+
enabled: true,
|
|
20
|
+
reporter: ['html'],
|
|
21
|
+
include: ['src/**/*.{ts,vue}', 'test/**/*.{ts}'],
|
|
22
|
+
exclude: ['src/**/*.spec.ts']
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
);
|
package/index.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { registerVersion } from "@3cr/sdk-browser";
|
|
2
|
-
import { ComponentPublicInstance, createApp } from "vue";
|
|
3
|
-
import { registerPlugins } from "@/plugins";
|
|
4
|
-
import { App as BrowserViewer } from "./src/main";
|
|
5
|
-
import {
|
|
6
|
-
defaultLoadViewerOptions,
|
|
7
|
-
LoadViewerOptions,
|
|
8
|
-
} from "@/models/LoadViewerOptions";
|
|
9
|
-
import { LoadViewerPayload } from "@/models/LoadViewerPayload";
|
|
10
|
-
import { disableTheme } from "@/plugins/vuetify";
|
|
11
|
-
import { injectedStyleId } from "./config";
|
|
12
|
-
|
|
13
|
-
let mountedApp: ComponentPublicInstance | undefined = undefined;
|
|
14
|
-
|
|
15
|
-
let modalId = `__modal_set__`;
|
|
16
|
-
// function uuidv4() {
|
|
17
|
-
// return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) =>
|
|
18
|
-
// (
|
|
19
|
-
// +c ^
|
|
20
|
-
// (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))
|
|
21
|
-
// ).toString(16)
|
|
22
|
-
// );
|
|
23
|
-
// }
|
|
24
|
-
export async function registerViewer(
|
|
25
|
-
version: string,
|
|
26
|
-
options = {
|
|
27
|
-
disableTheme: false,
|
|
28
|
-
}
|
|
29
|
-
) {
|
|
30
|
-
const newElement = document.createElement("div");
|
|
31
|
-
|
|
32
|
-
newElement.style.width = "0";
|
|
33
|
-
newElement.style.height = "0";
|
|
34
|
-
newElement.id = modalId;
|
|
35
|
-
|
|
36
|
-
document.body.appendChild(newElement);
|
|
37
|
-
|
|
38
|
-
const app = createApp(BrowserViewer);
|
|
39
|
-
if (options.disableTheme) {
|
|
40
|
-
disableTheme.value = true;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
registerPlugins(app);
|
|
44
|
-
|
|
45
|
-
mountedApp = app.mount(newElement);
|
|
46
|
-
|
|
47
|
-
await registerVersion(version);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export async function loadViewer(
|
|
51
|
-
payload: LoadViewerPayload | undefined = undefined,
|
|
52
|
-
options: LoadViewerOptions = defaultLoadViewerOptions
|
|
53
|
-
): Promise<void> {
|
|
54
|
-
if (!mountedApp) {
|
|
55
|
-
throw new Error("Please call `registerViewer(version: string)` first");
|
|
56
|
-
}
|
|
57
|
-
await (mountedApp as any).loadInstance(payload, options);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export async function loadSession(url: string): Promise<void> {
|
|
61
|
-
if (!mountedApp) {
|
|
62
|
-
throw new Error("Please call `registerViewer(version: string)` first");
|
|
63
|
-
}
|
|
64
|
-
await (mountedApp as any).loadSession(url);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export async function ejectViewer() {
|
|
68
|
-
const modal = document.getElementById(modalId);
|
|
69
|
-
const styleSheet = document.getElementById(injectedStyleId);
|
|
70
|
-
modal?.remove();
|
|
71
|
-
styleSheet?.remove();
|
|
72
|
-
}
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:serif="http://www.serif.com/" width="100%" height="100%" viewBox="0 0 150 46" version="1.1" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="#FFFFFF" d="M13.982,11.87c-0,-2.007 -0.331,-3.363 -0.992,-4.068c-0.662,-0.704 -1.547,-1.056 -2.656,-1.056c-1.109,-0 -1.994,0.331 -2.656,0.992c-0.661,0.662 -0.991,1.804 -0.991,3.427l-0,2.882l-6.655,0l-0,-2.434c-0,-3.629 0.885,-6.415 2.655,-8.358c1.771,-1.943 4.384,-2.914 7.839,-2.914c3.456,-0 6.068,0.971 7.839,2.914c1.77,1.943 2.655,4.729 2.655,8.358l0,1.153c0,4.782 -1.642,7.857 -4.927,9.223c1.792,0.769 3.061,1.954 3.808,3.555c0.746,1.601 1.119,3.554 1.119,5.86l0,3.523c0,3.629 -0.885,6.415 -2.655,8.358c-1.771,1.943 -4.383,2.914 -7.839,2.914c-3.455,0 -6.068,-0.971 -7.839,-2.914c-1.77,-1.943 -2.655,-4.729 -2.655,-8.358l-0,-3.715l6.655,0l-0,4.163c-0,1.623 0.33,2.765 0.991,3.427c0.662,0.662 1.547,0.992 2.656,0.992c1.109,0 1.994,-0.341 2.656,-1.024c0.661,-0.683 0.992,-2.028 0.992,-4.035l-0,-3.523c-0,-2.092 -0.363,-3.565 -1.088,-4.419c-0.726,-0.854 -1.899,-1.281 -3.52,-1.281l-2.367,-0l-0,-6.405l2.751,-0c1.323,-0 2.357,-0.342 3.104,-1.025c0.746,-0.683 1.12,-1.921 1.12,-3.715l-0,-2.497Z" style="fill-rule:nonzero;"></path><path fill="#FFFFFF" d="M27.036,0.853l11.134,0c3.541,0 6.175,0.94 7.903,2.818c1.727,1.879 2.591,4.633 2.591,8.263l0,22.673c0,3.629 -0.864,6.383 -2.591,8.262c-1.728,1.879 -4.362,2.818 -7.903,2.818l-11.134,-0l-0,-44.834Zm7.038,6.405l0,32.024l3.968,0c1.109,0 1.984,-0.32 2.623,-0.961c0.64,-0.64 0.96,-1.772 0.96,-3.394l0,-23.314c0,-1.622 -0.32,-2.754 -0.96,-3.394c-0.639,-0.641 -1.514,-0.961 -2.623,-0.961l-3.968,0Z" style="fill-rule:nonzero;"></path><rect fill="#FFFFFF" x="54.423" y="0.853" width="7.039" height="44.834" style="fill-rule:nonzero;"></rect><path fill="#FFFFFF" d="M88.274,28.97l0,5.957c0,3.629 -0.885,6.415 -2.655,8.358c-1.771,1.943 -4.384,2.914 -7.839,2.914c-3.456,0 -6.069,-0.971 -7.839,-2.914c-1.77,-1.943 -2.656,-4.729 -2.656,-8.358l0,-23.314c0,-3.629 0.886,-6.415 2.656,-8.358c1.77,-1.943 4.383,-2.914 7.839,-2.914c3.455,-0 6.068,0.971 7.839,2.914c1.77,1.943 2.655,4.729 2.655,8.358l0,4.356l-6.655,-0l0,-4.804c0,-1.623 -0.33,-2.765 -0.992,-3.427c-0.661,-0.661 -1.546,-0.992 -2.655,-0.992c-1.109,-0 -1.995,0.331 -2.656,0.992c-0.661,0.662 -0.992,1.804 -0.992,3.427l0,24.21c0,1.623 0.331,2.754 0.992,3.395c0.661,0.64 1.547,0.96 2.656,0.96c1.109,0 1.994,-0.32 2.655,-0.96c0.662,-0.641 0.992,-1.772 0.992,-3.395l0,-6.405l6.655,0Z" style="fill-rule:nonzero;"></path><path fill="#FFFFFF" d="M100.304,35.375c0,1.623 0.331,2.765 0.992,3.427c0.661,0.662 1.547,0.992 2.656,0.992c1.109,0 1.994,-0.33 2.655,-0.992c0.662,-0.662 0.992,-1.804 0.992,-3.427l0,-24.21c0,-1.623 -0.33,-2.765 -0.992,-3.427c-0.661,-0.661 -1.546,-0.992 -2.655,-0.992c-1.109,-0 -1.995,0.331 -2.656,0.992c-0.661,0.662 -0.992,1.804 -0.992,3.427l0,24.21Zm-7.039,-23.762c0,-3.629 0.918,-6.415 2.752,-8.358c1.834,-1.943 4.479,-2.914 7.935,-2.914c3.455,-0 6.1,0.971 7.935,2.914c1.834,1.943 2.751,4.729 2.751,8.358l0,23.314c0,3.629 -0.917,6.415 -2.751,8.358c-1.835,1.943 -4.48,2.914 -7.935,2.914c-3.456,0 -6.101,-0.971 -7.935,-2.914c-1.834,-1.943 -2.752,-4.729 -2.752,-8.358l0,-23.314Z" style="fill-rule:nonzero;"></path><path fill="#FFFFFF" d="M135.371,32.685l4.799,-31.832l9.791,0l-0,44.834l-6.655,-0l-0,-32.152l-4.863,32.152l-6.655,-0l-5.248,-31.704l0,31.704l-6.143,-0l0,-44.834l9.791,0l5.183,31.832Z" style="fill-rule:nonzero;"></path></svg>
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:serif="http://www.serif.com/" width="100%" height="100%" viewBox="0 0 150 46" version="1.1" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path d="M13.982,11.87c-0,-2.007 -0.331,-3.363 -0.992,-4.068c-0.662,-0.704 -1.547,-1.056 -2.656,-1.056c-1.109,-0 -1.994,0.331 -2.656,0.992c-0.661,0.662 -0.991,1.804 -0.991,3.427l-0,2.882l-6.655,0l-0,-2.434c-0,-3.629 0.885,-6.415 2.655,-8.358c1.771,-1.943 4.384,-2.914 7.839,-2.914c3.456,-0 6.068,0.971 7.839,2.914c1.77,1.943 2.655,4.729 2.655,8.358l0,1.153c0,4.782 -1.642,7.857 -4.927,9.223c1.792,0.769 3.061,1.954 3.808,3.555c0.746,1.601 1.119,3.554 1.119,5.86l0,3.523c0,3.629 -0.885,6.415 -2.655,8.358c-1.771,1.943 -4.383,2.914 -7.839,2.914c-3.455,0 -6.068,-0.971 -7.839,-2.914c-1.77,-1.943 -2.655,-4.729 -2.655,-8.358l-0,-3.715l6.655,0l-0,4.163c-0,1.623 0.33,2.765 0.991,3.427c0.662,0.662 1.547,0.992 2.656,0.992c1.109,0 1.994,-0.341 2.656,-1.024c0.661,-0.683 0.992,-2.028 0.992,-4.035l-0,-3.523c-0,-2.092 -0.363,-3.565 -1.088,-4.419c-0.726,-0.854 -1.899,-1.281 -3.52,-1.281l-2.367,-0l-0,-6.405l2.751,-0c1.323,-0 2.357,-0.342 3.104,-1.025c0.746,-0.683 1.12,-1.921 1.12,-3.715l-0,-2.497Z" style="fill-rule:nonzero;"></path><path d="M27.036,0.853l11.134,0c3.541,0 6.175,0.94 7.903,2.818c1.727,1.879 2.591,4.633 2.591,8.263l0,22.673c0,3.629 -0.864,6.383 -2.591,8.262c-1.728,1.879 -4.362,2.818 -7.903,2.818l-11.134,-0l-0,-44.834Zm7.038,6.405l0,32.024l3.968,0c1.109,0 1.984,-0.32 2.623,-0.961c0.64,-0.64 0.96,-1.772 0.96,-3.394l0,-23.314c0,-1.622 -0.32,-2.754 -0.96,-3.394c-0.639,-0.641 -1.514,-0.961 -2.623,-0.961l-3.968,0Z" style="fill-rule:nonzero;"></path><rect x="54.423" y="0.853" width="7.039" height="44.834" style="fill-rule:nonzero;"></rect><path d="M88.274,28.97l0,5.957c0,3.629 -0.885,6.415 -2.655,8.358c-1.771,1.943 -4.384,2.914 -7.839,2.914c-3.456,0 -6.069,-0.971 -7.839,-2.914c-1.77,-1.943 -2.656,-4.729 -2.656,-8.358l0,-23.314c0,-3.629 0.886,-6.415 2.656,-8.358c1.77,-1.943 4.383,-2.914 7.839,-2.914c3.455,-0 6.068,0.971 7.839,2.914c1.77,1.943 2.655,4.729 2.655,8.358l0,4.356l-6.655,-0l0,-4.804c0,-1.623 -0.33,-2.765 -0.992,-3.427c-0.661,-0.661 -1.546,-0.992 -2.655,-0.992c-1.109,-0 -1.995,0.331 -2.656,0.992c-0.661,0.662 -0.992,1.804 -0.992,3.427l0,24.21c0,1.623 0.331,2.754 0.992,3.395c0.661,0.64 1.547,0.96 2.656,0.96c1.109,0 1.994,-0.32 2.655,-0.96c0.662,-0.641 0.992,-1.772 0.992,-3.395l0,-6.405l6.655,0Z" style="fill-rule:nonzero;"></path><path d="M100.304,35.375c0,1.623 0.331,2.765 0.992,3.427c0.661,0.662 1.547,0.992 2.656,0.992c1.109,0 1.994,-0.33 2.655,-0.992c0.662,-0.662 0.992,-1.804 0.992,-3.427l0,-24.21c0,-1.623 -0.33,-2.765 -0.992,-3.427c-0.661,-0.661 -1.546,-0.992 -2.655,-0.992c-1.109,-0 -1.995,0.331 -2.656,0.992c-0.661,0.662 -0.992,1.804 -0.992,3.427l0,24.21Zm-7.039,-23.762c0,-3.629 0.918,-6.415 2.752,-8.358c1.834,-1.943 4.479,-2.914 7.935,-2.914c3.455,-0 6.1,0.971 7.935,2.914c1.834,1.943 2.751,4.729 2.751,8.358l0,23.314c0,3.629 -0.917,6.415 -2.751,8.358c-1.835,1.943 -4.48,2.914 -7.935,2.914c-3.456,0 -6.101,-0.971 -7.935,-2.914c-1.834,-1.943 -2.752,-4.729 -2.752,-8.358l0,-23.314Z" style="fill-rule:nonzero;"></path><path d="M135.371,32.685l4.799,-31.832l9.791,0l-0,44.834l-6.655,-0l-0,-32.152l-4.863,32.152l-6.655,-0l-5.248,-31.704l0,31.704l-6.143,-0l0,-44.834l9.791,0l5.183,31.832Z" style="fill-rule:nonzero;"></path></svg>
|
package/src/assets/logo.png
DELETED
|
Binary file
|
package/src/assets/logo.svg
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M261.126 140.65L164.624 307.732L256.001 466L377.028 256.5L498.001 47H315.192L261.126 140.65Z" fill="#1697F6"/>
|
|
3
|
-
<path d="M135.027 256.5L141.365 267.518L231.64 111.178L268.731 47H256H14L135.027 256.5Z" fill="#AEDDFF"/>
|
|
4
|
-
<path d="M315.191 47C360.935 197.446 256 466 256 466L164.624 307.732L315.191 47Z" fill="#1867C0"/>
|
|
5
|
-
<path d="M268.731 47C76.0026 47 141.366 267.518 141.366 267.518L268.731 47Z" fill="#7BC6FF"/>
|
|
6
|
-
</svg>
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div id="webgl-container">
|
|
3
|
-
<canvas
|
|
4
|
-
id="canvas"
|
|
5
|
-
ref="canvas"
|
|
6
|
-
width="100%"
|
|
7
|
-
height="100%"
|
|
8
|
-
tabindex="-1"
|
|
9
|
-
>
|
|
10
|
-
</canvas>
|
|
11
|
-
<div id="overlay" ref="overlay">
|
|
12
|
-
<slot></slot>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
import { onMounted, ref } from "vue";
|
|
19
|
-
import { useViewer3cr } from '@/dataLayer/useViewer3cr';
|
|
20
|
-
|
|
21
|
-
const viewer3cr = useViewer3cr();
|
|
22
|
-
const canvas = ref<HTMLCanvasElement>();
|
|
23
|
-
const overlay = ref<HTMLDivElement>();
|
|
24
|
-
|
|
25
|
-
const emit = defineEmits<{
|
|
26
|
-
instance_loaded: [void];
|
|
27
|
-
}>();
|
|
28
|
-
|
|
29
|
-
onMounted(async () => {
|
|
30
|
-
if (!canvas.value || !overlay.value) {
|
|
31
|
-
throw new Error('One or more canvases failed to load');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* c8 ignore start */
|
|
35
|
-
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
|
|
36
|
-
// Mobile device style: fill the whole browser client area with the game canvas:
|
|
37
|
-
const meta = document.createElement("meta");
|
|
38
|
-
meta.name = "viewport";
|
|
39
|
-
meta.content = "width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes";
|
|
40
|
-
document.getElementsByTagName("head")[0].appendChild(meta);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (navigator.storage && navigator.storage.estimate) {
|
|
44
|
-
const quota = await navigator.storage.estimate();
|
|
45
|
-
if (quota) {
|
|
46
|
-
const percentageUsed = (quota.usage! / quota.quota!) * 100;
|
|
47
|
-
console.log(`You've used ${percentageUsed}% of the available storage.`);
|
|
48
|
-
const remaining = quota.quota! - quota.usage!;
|
|
49
|
-
console.log(`You can write up to ${remaining} more bytes.`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/* c8 ignore stop */
|
|
53
|
-
|
|
54
|
-
// Overlay scroll events to the container instance
|
|
55
|
-
/* c8 ignore start */
|
|
56
|
-
function injectEventListener(type: keyof HTMLElementEventMap) {
|
|
57
|
-
overlay.value!.addEventListener(type, (e: Event) => {
|
|
58
|
-
e.preventDefault();
|
|
59
|
-
canvas.value!.dispatchEvent(new MouseEvent(type, e));
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
overlay.value!.addEventListener("wheel", (e: WheelEvent) => {
|
|
64
|
-
e.preventDefault();
|
|
65
|
-
canvas.value!.dispatchEvent(new WheelEvent(e.type, e));
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
injectEventListener('click');
|
|
69
|
-
injectEventListener('dblclick');
|
|
70
|
-
injectEventListener('auxclick');
|
|
71
|
-
injectEventListener('mousedown');
|
|
72
|
-
injectEventListener('mousemove');
|
|
73
|
-
injectEventListener('mouseup');
|
|
74
|
-
injectEventListener('mouseout');
|
|
75
|
-
injectEventListener('mouseover');
|
|
76
|
-
injectEventListener('mouseenter');
|
|
77
|
-
injectEventListener('mouseleave');
|
|
78
|
-
injectEventListener('contextmenu');
|
|
79
|
-
|
|
80
|
-
await viewer3cr.register(canvas.value);
|
|
81
|
-
emit("instance_loaded");
|
|
82
|
-
|
|
83
|
-
/* c8 ignore stop */
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
defineExpose({ canvas });
|
|
87
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<style scoped lang="scss">
|
|
90
|
-
#webgl-container {
|
|
91
|
-
position: relative;
|
|
92
|
-
width: 100%;
|
|
93
|
-
height: 100%;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
#canvas, #overlay {
|
|
97
|
-
position: absolute;
|
|
98
|
-
inset: 0;
|
|
99
|
-
width: 100%;
|
|
100
|
-
height: 100%;
|
|
101
|
-
}
|
|
102
|
-
</style>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { expect, describe, it } from "vitest";
|
|
2
|
-
import { registerOnPayloadHandler, createInstance } from "@3cr/sdk-browser";
|
|
3
|
-
import { mountVuetify } from "~/helper";
|
|
4
|
-
import { nextTick } from "vue";
|
|
5
|
-
import WebGL3DR from "../WebGL3DR.vue";
|
|
6
|
-
|
|
7
|
-
describe('WebGL3DR spec', () => {
|
|
8
|
-
it("creates instance", async () => {
|
|
9
|
-
mountVuetify(WebGL3DR);
|
|
10
|
-
await nextTick();
|
|
11
|
-
expect(createInstance).toHaveBeenCalled();
|
|
12
|
-
expect(registerOnPayloadHandler).toHaveBeenCalled();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("should emit wheel event", () => {
|
|
16
|
-
const wrapper = mountVuetify(WebGL3DR);
|
|
17
|
-
const overlay = wrapper.find("#overlay");
|
|
18
|
-
overlay.trigger("wheel");
|
|
19
|
-
expect(wrapper.emitted()["wheel"]).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("should emit mouseover event", () => {
|
|
23
|
-
const wrapper = mountVuetify(WebGL3DR);
|
|
24
|
-
const overlay = wrapper.find("#overlay");
|
|
25
|
-
overlay.trigger("mouseover");
|
|
26
|
-
expect(wrapper.emitted()["mouseover"]).toBeTruthy();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("should emit mouseout event", () => {
|
|
30
|
-
const wrapper = mountVuetify(WebGL3DR);
|
|
31
|
-
const overlay = wrapper.find("#overlay");
|
|
32
|
-
overlay.trigger("mouseover");
|
|
33
|
-
overlay.trigger("mouseout");
|
|
34
|
-
expect(wrapper.emitted()["mouseover"]).toBeTruthy();
|
|
35
|
-
expect(wrapper.emitted()["mouseout"]).toBeTruthy();
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg
|
|
3
|
-
version="1.1"
|
|
4
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
-
x="0px"
|
|
6
|
-
y="0px"
|
|
7
|
-
viewBox="0 0 100 125"
|
|
8
|
-
>
|
|
9
|
-
<g>
|
|
10
|
-
<path
|
|
11
|
-
d="M58.355,24.95c0,0-1.507,2.912-1.83,7.202c-0.263,3.507,0.686,11.987,1.338,14.719
|
|
12
|
-
c0.776,3.244,2.289,4.015,5.194,4.081c2.904,0.064,9.256-3.611,10.933-4.511c1.539-0.824,9.579-5.862,18.858-15.958
|
|
13
|
-
c0.565-0.615,3.947-5.196,0.141-6.338c-2.401-0.721-28.486-2.227-31.397-2.028c-2.912,0.199-15.201-0.224-17.393-0.566
|
|
14
|
-
c-1.672-0.26-15.038-2.543-26.261,3.018C6.715,30.128,4.773,37.822,4.773,45.939c0,6.012,2.826,9.781,5.405,18.088
|
|
15
|
-
c2.386,7.685,4.956,13.356,5.994,15.462c0.351,0.71,2.582,2.7,4.718,1.69c2.137-1.009,15.874-17.219,20.704-20.546
|
|
16
|
-
c4.832-3.325,14.231-5.497,14.323-9.52c0.091-4.022-0.587-20.948-2.675-22.053c-2.088-1.105-0.901-3.289-0.451-3.445
|
|
17
|
-
C54.538,25.009,58.692,24.486,58.355,24.95z"
|
|
18
|
-
/>
|
|
19
|
-
</g>
|
|
20
|
-
</svg>
|
|
21
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { expect, describe, it } from "vitest";
|
|
2
|
-
import { mountVuetify } from "~/helper";
|
|
3
|
-
import LoadingSpinner from "@/components/loading/LoadingSpinner.vue";
|
|
4
|
-
|
|
5
|
-
const wrapper = mountVuetify(LoadingSpinner);
|
|
6
|
-
|
|
7
|
-
describe("LoadingSpinner.vue", () => {
|
|
8
|
-
it("should inflate component", () => {
|
|
9
|
-
expect(wrapper).toBeTruthy();
|
|
10
|
-
});
|
|
11
|
-
});
|