@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.
Files changed (370) hide show
  1. package/.circleci/config.yml +46 -22
  2. package/.prettierrc +6 -0
  3. package/components.d.ts +23 -10
  4. package/dist/Viewer3CR.js +37 -46
  5. package/dist/Viewer3CR.mjs +22640 -20897
  6. package/dist/Viewer3CR.umd.js +37 -46
  7. package/dist/android-chrome-192x192.png +0 -0
  8. package/dist/android-chrome-512x512.png +0 -0
  9. package/dist/apple-touch-icon.png +0 -0
  10. package/dist/browserconfig.xml +9 -0
  11. package/dist/favicon-16x16.png +0 -0
  12. package/dist/favicon-32x32.png +0 -0
  13. package/dist/favicon.ico +0 -0
  14. package/dist/mstile-144x144.png +0 -0
  15. package/dist/mstile-150x150.png +0 -0
  16. package/dist/mstile-310x150.png +0 -0
  17. package/dist/mstile-310x310.png +0 -0
  18. package/dist/mstile-70x70.png +0 -0
  19. package/dist/safari-pinned-tab.svg +50 -0
  20. package/dist/site.webmanifest +19 -0
  21. package/index.html +34 -41
  22. package/package.json +23 -20
  23. package/playground/android-chrome-192x192.png +0 -0
  24. package/playground/android-chrome-512x512.png +0 -0
  25. package/playground/apple-touch-icon.png +0 -0
  26. package/playground/browserconfig.xml +9 -0
  27. package/playground/favicon-16x16.png +0 -0
  28. package/playground/favicon-32x32.png +0 -0
  29. package/playground/favicon.ico +0 -0
  30. package/playground/index.html +26 -29
  31. package/playground/mstile-144x144.png +0 -0
  32. package/playground/mstile-150x150.png +0 -0
  33. package/playground/mstile-310x150.png +0 -0
  34. package/playground/mstile-310x310.png +0 -0
  35. package/playground/mstile-70x70.png +0 -0
  36. package/playground/safari-pinned-tab.svg +50 -0
  37. package/playground/site.webmanifest +19 -0
  38. package/playground/sw.js +15 -1
  39. package/public/android-chrome-192x192.png +0 -0
  40. package/public/android-chrome-512x512.png +0 -0
  41. package/public/apple-touch-icon.png +0 -0
  42. package/public/browserconfig.xml +9 -0
  43. package/public/favicon-16x16.png +0 -0
  44. package/public/favicon-32x32.png +0 -0
  45. package/public/favicon.ico +0 -0
  46. package/public/mstile-144x144.png +0 -0
  47. package/public/mstile-150x150.png +0 -0
  48. package/public/mstile-310x150.png +0 -0
  49. package/public/mstile-310x310.png +0 -0
  50. package/public/mstile-70x70.png +0 -0
  51. package/public/safari-pinned-tab.svg +50 -0
  52. package/public/site.webmanifest +19 -0
  53. package/src/App.vue +35 -45
  54. package/src/__tests__/app.spec.ts +7 -8
  55. package/{__tests__/index.spec.ts → src/__tests__/main.spec.ts} +5 -6
  56. package/src/assets/logos/3dicom/white-mini.svg +20 -0
  57. package/src/assets/logos/3dicom/white.svg +30 -0
  58. package/src/assets/styles.scss +14 -4
  59. package/src/components/demo/__tests__/DemoModal.spec.ts +9 -8
  60. package/src/components/demo/__tests__/DemoPatientModal.spec.ts +11 -10
  61. package/src/components/demo/__tests__/options.spec.ts +1 -1
  62. package/src/components/demo/licence/__tests__/DemoLicenceEnableCloudStorageModal.spec.ts +11 -10
  63. package/src/components/demo/licence/__tests__/DemoLicenceInfoModal.spec.ts +21 -11
  64. package/src/components/demo/licence/__tests__/DemoLicenceSendToPartyModal.spec.ts +10 -10
  65. package/src/components/demo/licence/__tests__/DemoLicenceShareToMobileModal.spec.ts +14 -13
  66. package/src/components/demo/options.ts +54 -59
  67. package/src/components/demo/patient/__tests__/DemoPatientEnableCloudStorageModal.spec.ts +11 -10
  68. package/src/components/demo/patient/__tests__/DemoPatientInfoModal.spec.ts +12 -11
  69. package/src/components/demo/patient/__tests__/DemoPatientSendToPartyModal.spec.ts +10 -10
  70. package/src/components/demo/patient/__tests__/DemoPatientShareToMobileModal.spec.ts +14 -13
  71. package/src/components/modal/ActionRail.vue +7 -11
  72. package/src/components/modal/AskAI.vue +35 -50
  73. package/src/components/modal/CloseViewerModal.vue +22 -57
  74. package/src/components/modal/MftpWebGL3DRModal.vue +152 -570
  75. package/src/components/modal/ViewerActionRail.vue +50 -39
  76. package/src/components/modal/ViewerNavigationDrawer.vue +10 -8
  77. package/src/components/modal/ViewerNavigationDrawerContent.vue +82 -49
  78. package/src/components/modal/ViewerNavigationDrawerFooter.vue +57 -60
  79. package/src/components/modal/ViewerNavigationDrawerHeader.vue +13 -48
  80. package/src/components/modal/ViewerScanView.vue +114 -0
  81. package/src/components/modal/WebGL3DR.vue +84 -0
  82. package/src/components/modal/__tests__/ActionRail.spec.ts +10 -0
  83. package/src/components/modal/__tests__/AskAI.spec.ts +33 -0
  84. package/src/components/modal/__tests__/CloseViewerModal.spec.ts +24 -14
  85. package/src/components/modal/__tests__/MftpWebGL3DRModal.spec.ts +147 -176
  86. package/src/components/modal/__tests__/ViewerActionRail.spec.ts +11 -0
  87. package/src/components/modal/__tests__/ViewerNavigationDrawer.spec.ts +10 -12
  88. package/src/components/modal/__tests__/ViewerNavigationDrawerContent.spec.ts +4 -22
  89. package/src/components/modal/__tests__/ViewerNavigationDrawerFooter.spec.ts +35 -32
  90. package/src/components/modal/__tests__/ViewerNavigationDrawerHeader.spec.ts +11 -9
  91. package/src/components/modal/__tests__/ViewerScanView.spec.ts +60 -0
  92. package/src/components/modal/__tests__/WebGL3DR.spec.ts +57 -0
  93. package/src/components/modal/actions/Flip3dAction.vue +1 -1
  94. package/src/components/modal/actions/FlipHorizontalAction.vue +5 -10
  95. package/src/components/modal/actions/FlipVerticalAction.vue +5 -10
  96. package/src/components/modal/actions/FullscreenAction.vue +6 -11
  97. package/src/components/modal/actions/HideViewAction.vue +38 -0
  98. package/src/components/modal/actions/NavigationCubeAction.vue +7 -14
  99. package/src/components/modal/actions/PanAction.vue +4 -4
  100. package/src/components/modal/actions/ResetViewAction.vue +1 -1
  101. package/src/components/modal/actions/Rotate2dAction.vue +8 -20
  102. package/src/components/modal/actions/Slice3dAction.vue +10 -32
  103. package/src/components/modal/actions/ZoomAction.vue +1 -1
  104. package/src/components/modal/actions/__tests__/Action.spec.ts +8 -9
  105. package/src/components/modal/actions/__tests__/Flip3dAction.spec.ts +6 -8
  106. package/src/components/modal/actions/__tests__/FlipHorizontalAction.spec.ts +6 -7
  107. package/src/components/modal/actions/__tests__/FlipVerticalAction.spec.ts +6 -7
  108. package/src/components/modal/actions/__tests__/FullscreenAction.spec.ts +9 -10
  109. package/src/components/modal/actions/__tests__/NavigationCubeAction.spec.ts +11 -11
  110. package/src/components/modal/actions/__tests__/PanAction.spec.ts +9 -10
  111. package/src/components/modal/actions/__tests__/ResetViewAction.spec.ts +7 -7
  112. package/src/components/modal/actions/__tests__/Rotate2dAction.spec.ts +6 -8
  113. package/src/components/modal/actions/__tests__/Slice3dAction.spec.ts +23 -5
  114. package/src/components/modal/actions/__tests__/ZoomAction.spec.ts +8 -10
  115. package/src/components/modal/buttons/AutoAnnotateBtn.vue +29 -0
  116. package/src/components/modal/buttons/__tests__/AutoAnnotateBtn.spec.ts +28 -0
  117. package/src/components/modal/menus/FileMenu.vue +80 -0
  118. package/src/components/modal/menus/SettingsMenu.vue +111 -0
  119. package/src/components/modal/menus/__tests__/FileMenu.spec.ts +110 -0
  120. package/src/components/modal/menus/__tests__/SettingsMenu.spec.ts +71 -0
  121. package/src/components/shared/DoubleSliderSelector.vue +142 -0
  122. package/src/components/shared/UpdateSnackbar.vue +72 -0
  123. package/src/components/{selectors → shared}/ValueSelector.vue +9 -12
  124. package/src/components/shared/__tests__/DoubleSliderSelector.spec.ts +83 -0
  125. package/src/components/shared/__tests__/LoadingSpinner.spec.ts +9 -0
  126. package/src/components/shared/__tests__/UpdateSnackbar.spec.ts +116 -0
  127. package/src/components/shared/__tests__/ValueSelector.spec.ts +39 -0
  128. package/src/components/shared/__tests__/VerticalSliderSelector.spec.ts +50 -0
  129. package/src/components/views/AnnotationTreeView.vue +234 -0
  130. package/src/components/{modal/ViewerDisplaySettings.vue → views/DisplaySettings.vue} +7 -15
  131. package/src/components/views/MarkupTreeView.vue +199 -0
  132. package/src/components/views/McadObjectTreeView.vue +119 -0
  133. package/src/components/views/__tests__/AnnotationTreeView.spec.ts +62 -0
  134. package/src/components/{modal/__tests__/ViewerDisplaySettings.spec.ts → views/__tests__/DisplaySettings.spec.ts} +24 -20
  135. package/src/components/views/__tests__/MarkupTreeView.spec.ts +41 -0
  136. package/src/components/views/__tests__/McadObjectTreeView.spec.ts +47 -0
  137. package/src/components/views/modals/DataOverlayModal.vue +89 -0
  138. package/src/components/views/modals/DataOverlayModalManager.vue +104 -0
  139. package/src/components/views/modals/__tests__/DataOverlayModal.spec.ts +33 -0
  140. package/src/components/views/modals/__tests__/DataOverlayModalManager.spec.ts +93 -0
  141. package/src/components/views/shared/MaskIcon.vue +44 -0
  142. package/src/components/views/shared/ObjectColor.vue +31 -0
  143. package/src/components/views/shared/ObjectLabel.vue +30 -0
  144. package/src/components/views/shared/Opacity.vue +66 -0
  145. package/src/components/views/shared/VisibilityBtn.vue +25 -0
  146. package/src/components/views/shared/__tests__/MaskIcon.spec.ts +10 -0
  147. package/src/components/views/shared/__tests__/ObjectColor.spec.ts +10 -0
  148. package/src/components/views/shared/__tests__/ObjectLabel.spec.ts +10 -0
  149. package/src/components/views/shared/__tests__/Opacity.spec.ts +24 -0
  150. package/src/components/views/shared/__tests__/VisibilityBtn.spec.ts +11 -0
  151. package/src/components/views/types/annotation-tree-view-item-child-action.ts +6 -0
  152. package/src/components/views/types/annotation-tree-view-item-child.ts +9 -0
  153. package/src/components/views/types/annotation-tree-view-item.ts +13 -0
  154. package/src/components/views/types/markup-tree-view-item-child.ts +6 -0
  155. package/src/components/views/types/markup-tree-view-item.ts +14 -0
  156. package/src/components/views/types/mcad-object-tree-view-item.ts +13 -0
  157. package/src/composables/__tests__/useAnnotations.spec.ts +35 -0
  158. package/src/composables/__tests__/useEventListener.spec.ts +32 -0
  159. package/src/composables/__tests__/useIntroJs.spec.ts +51 -0
  160. package/src/composables/__tests__/useMarkups.spec.ts +39 -0
  161. package/src/composables/__tests__/useMcadObjects.spec.ts +36 -0
  162. package/src/composables/__tests__/useMouse.spec.ts +20 -0
  163. package/src/{components/modal/composables → composables}/__tests__/useNavigationCubeObserver.spec.ts +17 -12
  164. package/src/{dataLayer → composables}/__tests__/useViewer3cr.spec.ts +1 -2
  165. package/src/composables/useAnnotations.ts +37 -0
  166. package/src/composables/useEventListener.ts +25 -0
  167. package/src/composables/useIntroJs.ts +125 -0
  168. package/src/composables/useMarkups.ts +41 -0
  169. package/src/composables/useMcadObjects.ts +32 -0
  170. package/src/composables/useMouse.ts +14 -0
  171. package/src/{components/modal/composables → composables}/useNavigationCubeObserver.ts +35 -25
  172. package/src/composables/useScanMovement.ts +25 -0
  173. package/src/composables/useScanSliders.ts +36 -0
  174. package/src/composables/useVersion3cr.ts +7 -0
  175. package/src/composables/useViewer3cr.ts +7 -0
  176. package/src/composables/useViewerOptions.ts +35 -0
  177. package/src/{dataLayer → functions}/__tests__/clamp.spec.ts +1 -2
  178. package/src/functions/__tests__/layoutOverlayStyle.spec.ts +325 -0
  179. package/src/{helpers/__tests__/model-helper.spec.ts → functions/__tests__/modelHelper.spec.ts} +77 -40
  180. package/src/{notifications → functions}/__tests__/notification.spec.ts +19 -29
  181. package/src/functions/__tests__/parseAction.spec.ts +9 -0
  182. package/src/functions/__tests__/parseCallToAction.spec.ts +11 -0
  183. package/src/functions/__tests__/parseDataOverlay.spec.ts +15 -0
  184. package/src/functions/__tests__/parseDataOverlayData.spec.ts +9 -0
  185. package/src/functions/__tests__/parseDataOverlayEvent.spec.ts +10 -0
  186. package/src/functions/__tests__/parseMcadEvent.spec.ts +10 -0
  187. package/src/functions/layoutOverlayStyle.ts +84 -0
  188. package/src/{helpers → functions}/modelHelper.ts +79 -18
  189. package/src/{notifications → functions}/notification.ts +12 -14
  190. package/src/functions/parseAction.ts +9 -0
  191. package/src/functions/parseCallToAction.ts +9 -0
  192. package/src/functions/parseDataOverlay.ts +10 -0
  193. package/src/functions/parseDataOverlayData.ts +10 -0
  194. package/src/functions/parseDataOverlayEvent.ts +17 -0
  195. package/src/functions/parseMcadEvent.ts +10 -0
  196. package/src/functions/rgbaToCss.ts +13 -0
  197. package/src/main.ts +48 -9
  198. package/src/{dataLayer → models}/__tests__/eventHandlers.spec.ts +2 -3
  199. package/src/models/__tests__/loadViewerOptions.spec.ts +72 -0
  200. package/src/models/__tests__/loadViewerPayload.spec.ts +10 -0
  201. package/src/models/__tests__/scanState.spec.ts +190 -0
  202. package/src/models/callbacks.ts +4 -0
  203. package/src/models/loadViewerOptions.ts +40 -0
  204. package/src/models/loadViewerPayload.ts +24 -0
  205. package/src/{dataLayer → models}/scanState.ts +63 -74
  206. package/src/plugins/__tests__/usePlugins.spec.ts +12 -0
  207. package/src/plugins/__tests__/vuetify.spec.ts +3 -4
  208. package/src/plugins/usePlugins.ts +8 -0
  209. package/src/plugins/vuetify.ts +31 -65
  210. package/src/services/{gpt/__tests__ → __tests__}/gpt.service.spec.ts +2 -2
  211. package/src/services/__tests__/service-worker.service.spec.ts +32 -0
  212. package/src/{dataLayer/__tests__/viewer3cr.spec.ts → services/__tests__/viewer-3cr.service.spec.ts} +97 -36
  213. package/src/services/gpt.service.ts +17 -0
  214. package/src/services/service-worker.service.ts +16 -0
  215. package/src/{dataLayer/viewer3cr.ts → services/viewer-3cr.service.ts} +269 -150
  216. package/src/types/action.ts +13 -0
  217. package/src/types/call-to-action.ts +9 -0
  218. package/src/types/colour.ts +6 -0
  219. package/src/types/data-overlay-angle.ts +16 -0
  220. package/src/types/data-overlay-annotation.ts +18 -0
  221. package/src/types/data-overlay-data.ts +15 -0
  222. package/src/types/data-overlay-info.ts +14 -0
  223. package/src/types/data-overlay-interaction.ts +15 -0
  224. package/src/types/data-overlay-length.ts +16 -0
  225. package/src/types/data-overlay-markup.ts +7 -0
  226. package/src/types/data-overlay-mcad.ts +20 -0
  227. package/src/types/data-overlay-polygon.ts +18 -0
  228. package/src/types/data-overlay.ts +16 -0
  229. package/src/types/gpt-question.ts +4 -0
  230. package/src/types/gpt-response-payload.ts +6 -0
  231. package/src/types/mcad-object-interaction.ts +15 -0
  232. package/src/types/segment-angle.ts +5 -0
  233. package/src/types/vector2.ts +4 -0
  234. package/src/types/vector3.ts +5 -0
  235. package/test/fakers/action-data.faker.ts +11 -0
  236. package/test/fakers/action.faker.ts +19 -0
  237. package/test/fakers/call-to-action.faker.ts +17 -0
  238. package/test/fakers/colour.faker.ts +17 -0
  239. package/test/fakers/data-overlay-angle.faker.ts +37 -0
  240. package/test/fakers/data-overlay-annotation.faker.ts +41 -0
  241. package/test/fakers/data-overlay-data.faker.ts +97 -0
  242. package/test/fakers/data-overlay-info.faker.ts +29 -0
  243. package/test/fakers/data-overlay-interaction.faker.ts +62 -0
  244. package/test/fakers/data-overlay-length.faker.ts +37 -0
  245. package/test/fakers/data-overlay-mcad.faker.ts +40 -0
  246. package/test/fakers/data-overlay-polygon.faker.ts +39 -0
  247. package/test/fakers/gpt-question.faker.ts +11 -0
  248. package/test/fakers/gpt-response.faker.ts +12 -0
  249. package/test/fakers/invert-transform.faker.ts +16 -0
  250. package/test/fakers/mcad-object-interaction.faker.ts +22 -0
  251. package/test/fakers/orientation.faker.ts +17 -0
  252. package/test/fakers/segment-angle.faker.ts +12 -0
  253. package/test/fakers/vector2.faker.ts +12 -0
  254. package/test/fakers/vector3.faker.ts +16 -0
  255. package/test/plugins/findByTestId.ts +25 -0
  256. package/test/plugins/vuetify.ts +16 -0
  257. package/test/setup.ts +16 -5
  258. package/tsconfig.json +4 -15
  259. package/vite.config.mts +20 -46
  260. package/vitest.config.mts +24 -43
  261. package/index.ts +0 -72
  262. package/src/assets/images/dark/3DICOM.png +0 -0
  263. package/src/assets/images/dark/3dicom-logo.svg +0 -1
  264. package/src/assets/images/light/3DICOM.png +0 -0
  265. package/src/assets/images/light/3dicom-logo.svg +0 -1
  266. package/src/assets/logo.png +0 -0
  267. package/src/assets/logo.svg +0 -6
  268. package/src/components/WebGL3DR.vue +0 -102
  269. package/src/components/__tests__/webgl3dr.spec.ts +0 -37
  270. package/src/components/icons/liver.vue +0 -21
  271. package/src/components/loading/__tests__/loading-spinner.spec.ts +0 -11
  272. package/src/components/modal/ViewerAnnotationModal.vue +0 -115
  273. package/src/components/modal/ViewerAnnotations.vue +0 -283
  274. package/src/components/modal/__tests__/ViewerAnnotationModal.spec.ts +0 -79
  275. package/src/components/modal/composables/useEventListener.ts +0 -22
  276. package/src/components/selectors/__tests__/value-selector.spec.ts +0 -53
  277. package/src/components/sliders/DoubleSliderSelector.vue +0 -141
  278. package/src/components/sliders/__tests__/double-slider-selector.spec.ts +0 -104
  279. package/src/components/sliders/__tests__/vertical-slider-selector.spec.ts +0 -61
  280. package/src/dataLayer/__tests__/getIconForPreset.spec.ts +0 -40
  281. package/src/dataLayer/__tests__/patchDataOverlay.spec.ts +0 -88
  282. package/src/dataLayer/__tests__/scanState.spec.ts +0 -93
  283. package/src/dataLayer/getIconForPreset.ts +0 -11
  284. package/src/dataLayer/patchDataOverlay.ts +0 -101
  285. package/src/dataLayer/useViewer3cr.ts +0 -7
  286. package/src/helpers/__tests__/layout-overlay-style.spec.ts +0 -290
  287. package/src/helpers/__tests__/utils.spec.ts +0 -70
  288. package/src/helpers/layoutOverlayStyle.ts +0 -96
  289. package/src/helpers/utils.ts +0 -16
  290. package/src/models/Callbacks.ts +0 -2
  291. package/src/models/LoadViewerOptions.ts +0 -31
  292. package/src/models/LoadViewerPayload.ts +0 -9
  293. package/src/models/__tests__/load-viewer-options.spec.ts +0 -22
  294. package/src/plugins/__tests__/index.spec.ts +0 -19
  295. package/src/plugins/index.ts +0 -17
  296. package/src/services/gpt/gpt.service.ts +0 -27
  297. package/static/3cr-types-browser/index.ts +0 -74
  298. package/static/3cr-types-browser/types/Action.ts +0 -6
  299. package/static/3cr-types-browser/types/AlphaKeys.ts +0 -5
  300. package/static/3cr-types-browser/types/AnchorPoint.ts +0 -12
  301. package/static/3cr-types-browser/types/CallToAction.ts +0 -5
  302. package/static/3cr-types-browser/types/ColourData.ts +0 -7
  303. package/static/3cr-types-browser/types/ColourPresetData.ts +0 -9
  304. package/static/3cr-types-browser/types/CurrentDataOverlayState.ts +0 -6
  305. package/static/3cr-types-browser/types/CurrentScanState.ts +0 -22
  306. package/static/3cr-types-browser/types/DataOverlay.ts +0 -22
  307. package/static/3cr-types-browser/types/DataOverlayActions.ts +0 -14
  308. package/static/3cr-types-browser/types/DataOverlayData.ts +0 -8
  309. package/static/3cr-types-browser/types/DataOverlayEvent.ts +0 -8
  310. package/static/3cr-types-browser/types/DecryptionKey.ts +0 -4
  311. package/static/3cr-types-browser/types/DisplaySettings.ts +0 -10
  312. package/static/3cr-types-browser/types/EmptyPayload.ts +0 -3
  313. package/static/3cr-types-browser/types/EnumPayload.ts +0 -4
  314. package/static/3cr-types-browser/types/FileManagementActions.ts +0 -11
  315. package/static/3cr-types-browser/types/FlipValue.ts +0 -7
  316. package/static/3cr-types-browser/types/FrontEndInterfaces.ts +0 -14
  317. package/static/3cr-types-browser/types/GradientKeys.ts +0 -7
  318. package/static/3cr-types-browser/types/GreyscalePresetData.ts +0 -6
  319. package/static/3cr-types-browser/types/InitialDataOverlayState.ts +0 -6
  320. package/static/3cr-types-browser/types/InitialScanState.ts +0 -19
  321. package/static/3cr-types-browser/types/InteractionType.ts +0 -8
  322. package/static/3cr-types-browser/types/InteractivityActions.ts +0 -6
  323. package/static/3cr-types-browser/types/InteractivityState.ts +0 -4
  324. package/static/3cr-types-browser/types/InvertTransformData.ts +0 -6
  325. package/static/3cr-types-browser/types/LayoutActions.ts +0 -6
  326. package/static/3cr-types-browser/types/LayoutData.ts +0 -7
  327. package/static/3cr-types-browser/types/LoadDataSet.ts +0 -6
  328. package/static/3cr-types-browser/types/LoadSessionState.ts +0 -4
  329. package/static/3cr-types-browser/types/LocalLoadDataset.ts +0 -3
  330. package/static/3cr-types-browser/types/MovementData.ts +0 -7
  331. package/static/3cr-types-browser/types/NavigationCubeActions.ts +0 -8
  332. package/static/3cr-types-browser/types/NavigationCubeData.ts +0 -12
  333. package/static/3cr-types-browser/types/NavigationCubeTransform.ts +0 -9
  334. package/static/3cr-types-browser/types/NotificationPayload.ts +0 -7
  335. package/static/3cr-types-browser/types/NotificationsActions.ts +0 -6
  336. package/static/3cr-types-browser/types/Object.ts +0 -1
  337. package/static/3cr-types-browser/types/ObjectColour.ts +0 -7
  338. package/static/3cr-types-browser/types/ObjectIcon.ts +0 -5
  339. package/static/3cr-types-browser/types/ObjectInvert.ts +0 -7
  340. package/static/3cr-types-browser/types/ObjectSize.ts +0 -7
  341. package/static/3cr-types-browser/types/ObjectSize2D.ts +0 -7
  342. package/static/3cr-types-browser/types/ObjectVisible.ts +0 -5
  343. package/static/3cr-types-browser/types/PositionData.ts +0 -14
  344. package/static/3cr-types-browser/types/PresetsActions.ts +0 -4
  345. package/static/3cr-types-browser/types/RotationValue.ts +0 -7
  346. package/static/3cr-types-browser/types/ScanMovementActions.ts +0 -27
  347. package/static/3cr-types-browser/types/ScanMovementData.ts +0 -3
  348. package/static/3cr-types-browser/types/ScanOrientationActions.ts +0 -6
  349. package/static/3cr-types-browser/types/ScanStateActions.ts +0 -4
  350. package/static/3cr-types-browser/types/ScanView.ts +0 -6
  351. package/static/3cr-types-browser/types/SettingsData.ts +0 -12
  352. package/static/3cr-types-browser/types/SlicerData.ts +0 -9
  353. package/static/3cr-types-browser/types/SliderValue.ts +0 -4
  354. package/static/3cr-types-browser/types/SlidersActions.ts +0 -18
  355. package/static/3cr-types-browser/types/Vector2Data.ts +0 -5
  356. package/static/3cr-types-browser/types/Vector3Data.ts +0 -6
  357. package/static/3cr-types-browser/types/VectorMovementData.ts +0 -8
  358. package/static/3cr-types-browser/types/ViewInteractiveMode.ts +0 -5
  359. package/static/3cr-types-browser/types/ViewOrientation.ts +0 -8
  360. package/static/3cr-types-browser/types/ViewOrientations.ts +0 -10
  361. package/static/3cr-types-browser/types/ViewSelectionActions.ts +0 -9
  362. package/static/3cr-types-browser/types/ViewToggleData.ts +0 -7
  363. package/static/3cr-types-browser/types/VolumeOrientation.ts +0 -7
  364. package/test/helper.ts +0 -44
  365. /package/src/components/{loading → shared}/LoadingSpinner.vue +0 -0
  366. /package/src/components/{sliders → shared}/VerticalSliderSelector.vue +0 -0
  367. /package/{config.ts → src/config.ts} +0 -0
  368. /package/src/{dataLayer → functions}/clamp.ts +0 -0
  369. /package/src/{dataLayer → models}/eventHandlers.ts +0 -0
  370. /package/{static/3cr-types-browser/types/ActionData.ts → src/types/action-data.ts} +0 -0
package/src/App.vue CHANGED
@@ -1,84 +1,74 @@
1
1
  <template>
2
- <div data-vuetify>
3
- <v-app style="height: 0; width: 0">
4
- <MftpWebGL3DRModal
5
- ref="mftpWebGL3DRModal"
6
- :payload="payload"
7
- :options="options"
8
- />
9
- </v-app>
2
+ <v-app style="height: 0; width: 0">
3
+ <MftpWebGL3DRModal ref="mftpWebGL3DRModal" :payload="payload" :options="options" />
10
4
  <Notifications />
11
- </div>
5
+ <update-snackbar />
6
+ </v-app>
12
7
  </template>
13
8
 
14
9
  <script setup lang="ts">
15
- import MftpWebGL3DRModal from "@/components/modal/MftpWebGL3DRModal.vue";
16
- import { nextTick, ref, unref } from "vue";
17
- import { Notifications } from "@kyvg/vue3-notification";
18
- import { LoadViewerPayload } from "@/models/LoadViewerPayload";
19
- import {
20
- defaultLoadViewerOptions,
21
- LoadViewerOptions,
22
- } from "@/models/LoadViewerOptions";
23
- import { isDemo } from "@/components/demo/options";
24
- import LogRocket from "logrocket";
10
+ import { nextTick, ref } from 'vue';
11
+ import { Notifications } from '@kyvg/vue3-notification';
12
+ import { defaultLoadViewerPayload, LoadViewerPayload } from '@/models/loadViewerPayload';
13
+ import { defaultLoadViewerOptions, LoadViewerOptions } from '@/models/loadViewerOptions';
14
+ import { isDemo } from '@/components/demo/options';
15
+ import MftpWebGL3DRModal from '@/components/modal/MftpWebGL3DRModal.vue';
16
+ import LogRocket from 'logrocket';
25
17
 
26
18
  if (isDemo.value) {
27
- LogRocket.init("qfib9l/3crviewer-browser");
19
+ LogRocket.init('qfib9l/3crviewer-browser');
28
20
  }
29
21
 
30
- const payload = ref<LoadViewerPayload>({
31
- Url: "https://webgl-3dr.singular.health/test_scans/01440d4e-8b04-4b90-bb2c-698535ce16d6/CHEST.3vxl",
32
- DecryptionKey: {
33
- Iv: "XEloSh+OcO7TG77au6HjPw==",
34
- Key: "KUc722X1y4w42M+jCf9a3+6EGz66z7UMWK3m2aMqGxM=",
35
- },
36
- });
37
-
22
+ const payload = ref<LoadViewerPayload>(defaultLoadViewerPayload);
38
23
  const options = ref<LoadViewerOptions>(defaultLoadViewerOptions);
24
+ const mftpWebGL3DRModal = ref<typeof MftpWebGL3DRModal>();
39
25
 
40
- const mftpWebGL3DRModal = ref<typeof MftpWebGL3DRModal | null>(null);
41
-
42
- async function loadInstance(
43
- payloadIncoming: LoadViewerPayload | undefined,
44
- optionsIncoming: LoadViewerOptions
45
- ) {
26
+ async function loadInstance(payloadIncoming: LoadViewerPayload | undefined, optionsIncoming: LoadViewerOptions) {
46
27
  payload.value = payloadIncoming || payload.value;
47
28
  options.value = optionsIncoming;
48
29
 
49
30
  await nextTick();
50
- unref(mftpWebGL3DRModal)?.alterValue(true);
31
+ mftpWebGL3DRModal.value?.alterValue(true);
51
32
  }
52
33
 
53
34
  async function loadSession(url: string): Promise<void> {
54
- await unref(mftpWebGL3DRModal)?.loadSession(url);
35
+ await mftpWebGL3DRModal.value?.loadSession(url);
55
36
  }
56
37
 
57
- defineExpose({
58
- loadInstance,
59
- loadSession,
60
- });
38
+ defineExpose({ loadInstance, loadSession });
61
39
  </script>
62
40
 
63
41
  <style>
64
42
  .material-icons-outlined,
65
43
  .material-symbols-outlined {
66
- font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
44
+ font-variation-settings:
45
+ 'FILL' 0,
46
+ 'wght' 300,
47
+ 'GRAD' 0,
48
+ 'opsz' 24;
67
49
  }
68
50
  .material-icons,
69
51
  .material-symbols {
70
- font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
52
+ font-variation-settings:
53
+ 'FILL' 0,
54
+ 'wght' 300,
55
+ 'GRAD' 0,
56
+ 'opsz' 24;
71
57
  }
72
58
  .material-icons-filled,
73
59
  .material-symbols-filled {
74
- font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 24 !important;
60
+ font-variation-settings:
61
+ 'FILL' 1,
62
+ 'wght' 300,
63
+ 'GRAD' 0,
64
+ 'opsz' 24 !important;
75
65
  }
76
66
  .overflow-y-scroll {
77
67
  overflow-y: scroll;
78
68
  }
79
69
  .material-icons-outlined,
80
70
  .material-icons {
81
- font-family: "Material Symbols Outlined" !important;
71
+ font-family: 'Material Symbols Outlined' !important;
82
72
  font-weight: normal;
83
73
  font-style: normal;
84
74
  font-size: 24px;
@@ -89,7 +79,7 @@ defineExpose({
89
79
  white-space: nowrap;
90
80
  word-wrap: normal;
91
81
  direction: ltr;
92
- -webkit-font-feature-settings: "liga";
82
+ -webkit-font-feature-settings: 'liga';
93
83
  -webkit-font-smoothing: antialiased;
94
84
  }
95
85
  .transparent {
@@ -1,15 +1,14 @@
1
- import { expect, describe, it } from "vitest";
2
- import { shallowMountVuetify } from "~/helper";
3
- import App from "@/App.vue";
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import App from '@/App.vue';
4
3
 
5
- const wrapper = shallowMountVuetify(App);
6
-
7
- describe("App.vue", () => {
8
- it("should inflate component", () => {
4
+ describe('App.vue', () => {
5
+ it('should inflate component', () => {
6
+ const wrapper = shallowMount(App);
9
7
  expect(wrapper).toBeTruthy();
10
8
  });
11
9
 
12
- it("should loadScan", async () => {
10
+ it('should loadScan', async () => {
11
+ const wrapper = shallowMount(App);
13
12
  await wrapper.vm.loadInstance(undefined, {});
14
13
  expect(wrapper).toBeTruthy();
15
14
  });
@@ -1,5 +1,4 @@
1
- import { describe, expect, it } from "vitest";
2
- import {ejectViewer, loadSession, loadViewer, registerViewer} from "../index";
1
+ import { ejectViewer, loadSession, loadViewer, registerViewer } from '@/main';
3
2
 
4
3
  describe('index tests', () => {
5
4
  const errorMessage = 'Please call `registerViewer(version: string)` first';
@@ -13,22 +12,22 @@ describe('index tests', () => {
13
12
  });
14
13
 
15
14
  it('should resolve loadViewer', async () => {
16
- await registerViewer("1.0.0");
15
+ await registerViewer('1.0.0');
17
16
  expect(loadViewer()).resolves.not.toThrow(errorMessage);
18
17
  });
19
18
 
20
19
  it('should resolve loadSession 3crds url', async () => {
21
- await registerViewer("1.0.0");
20
+ await registerViewer('1.0.0');
22
21
  expect(loadSession('https://localhost/example.3crds')).resolves.not.toThrow(errorMessage);
23
22
  });
24
23
 
25
24
  it('should resolve loadSession 3crms url', async () => {
26
- await registerViewer("1.0.0");
25
+ await registerViewer('1.0.0');
27
26
  expect(loadSession('https://localhost/example.3crms')).resolves.not.toThrow(errorMessage);
28
27
  });
29
28
 
30
29
  it('should resolve loadSession 3crs url', async () => {
31
- await registerViewer("1.0.0");
30
+ await registerViewer('1.0.0');
32
31
  expect(loadSession('https://localhost/example.3crs')).resolves.not.toThrow(errorMessage);
33
32
  });
34
33
 
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg viewBox="0 0 130 155" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <defs>
4
+ <linearGradient id="paint0_linear_184_3640" x1="97.4467" y1="10.5294" x2="85.8199" y2="69.4832" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="white" stop-opacity="0.8"/>
6
+ <stop offset="1" stop-color="white" stop-opacity="0.5"/>
7
+ </linearGradient>
8
+ <linearGradient id="paint1_linear_184_3640" x1="68.472" y1="34.3899" x2="55.5909" y2="102.885" gradientUnits="userSpaceOnUse">
9
+ <stop stop-color="white" stop-opacity="0.8"/>
10
+ <stop offset="1" stop-color="white" stop-opacity="0.5"/>
11
+ </linearGradient>
12
+ <linearGradient id="paint2_linear_184_3640" x1="41.2011" y1="58.2533" x2="26.3355" y2="135.999" gradientUnits="userSpaceOnUse">
13
+ <stop stop-color="white" stop-opacity="0.8"/>
14
+ <stop offset="1" stop-color="white" stop-opacity="0.5"/>
15
+ </linearGradient>
16
+ </defs>
17
+ <path d="M121.308 23.4829L73.585 10.5294V61.048L121.308 75.2969V23.4829Z" stroke="url(#paint0_linear_184_3640)" stroke-width="16" transform="matrix(1, 0, 0, 1, 0, 7.105427357601002e-15)"/>
18
+ <path d="M97.447 49.3887L39.4971 34.3899V92.8852L97.447 109.384V49.3887Z" stroke="url(#paint1_linear_184_3640)" stroke-width="16" transform="matrix(1, 0, 0, 1, 0, 7.105427357601002e-15)"/>
19
+ <path d="M73.5849 75.2974L8.81738 58.2533V124.725L73.5849 143.474V75.2974Z" stroke="url(#paint2_linear_184_3640)" stroke-width="16" transform="matrix(1, 0, 0, 1, 0, 7.105427357601002e-15)"/>
20
+ </svg>
@@ -0,0 +1,30 @@
1
+ <svg width="498" height="155" viewBox="0 0 498 155" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M121.308 23.4829L73.585 10.5294V61.048L121.308 75.2969V23.4829Z" stroke="url(#paint0_linear_184_3640)" stroke-width="16"/>
3
+ <path d="M97.447 49.3887L39.4971 34.3899V92.8852L97.447 109.384V49.3887Z" stroke="url(#paint1_linear_184_3640)" stroke-width="16"/>
4
+ <path d="M73.5849 75.2974L8.81738 58.2533V124.725L73.5849 143.474V75.2974Z" stroke="url(#paint2_linear_184_3640)" stroke-width="16"/>
5
+ <g clip-path="url(#clip0_184_3640)">
6
+ <path d="M428.03 110.332V43.6685H441.452L466.418 76.7767H460.154L484.404 43.6685H497.826V110.332H483.956V58.9699L489.504 60.2226L463.823 93.3307H462.033L437.247 60.2226L441.9 58.9699V110.332H428.03Z" fill="white"/>
7
+ <path d="M386.427 111.406C381.416 111.406 376.763 110.541 372.468 108.811C368.173 107.081 364.415 104.665 361.193 101.563C358.032 98.401 355.556 94.7323 353.766 90.5565C351.977 86.3807 351.082 81.847 351.082 76.9553C351.082 72.0637 351.947 67.5299 353.677 63.3541C355.467 59.1783 357.942 55.5394 361.104 52.4374C364.325 49.3354 368.083 46.9194 372.379 45.1894C376.674 43.4594 381.357 42.5944 386.427 42.5944C391.498 42.5944 396.181 43.4594 400.476 45.1894C404.771 46.9194 408.499 49.3354 411.661 52.4374C414.882 55.5394 417.358 59.1783 419.088 63.3541C420.878 67.5299 421.772 72.0637 421.772 76.9553C421.772 81.847 420.878 86.3807 419.088 90.5565C417.298 94.7323 414.793 98.401 411.572 101.563C408.41 104.665 404.681 107.081 400.386 108.811C396.091 110.541 391.438 111.406 386.427 111.406ZM386.427 98.8783C389.47 98.8783 392.273 98.3414 394.838 97.2676C397.463 96.1938 399.76 94.7025 401.729 92.7935C403.697 90.8249 405.218 88.4984 406.292 85.814C407.366 83.1295 407.903 80.1766 407.903 76.9553C407.903 73.734 407.366 70.8109 406.292 68.1861C405.218 65.5017 403.697 63.1752 401.729 61.2066C399.76 59.238 397.463 57.7466 394.838 56.7325C392.273 55.6587 389.47 55.1218 386.427 55.1218C383.385 55.1218 380.551 55.6587 377.926 56.7325C375.361 57.7466 373.094 59.238 371.126 61.2066C369.157 63.1752 367.636 65.5017 366.562 68.1861C365.489 70.8109 364.952 73.734 364.952 76.9553C364.952 80.1766 365.489 83.1295 366.562 85.814C367.636 88.4984 369.157 90.8249 371.126 92.7935C373.094 94.7025 375.361 96.1938 377.926 97.2676C380.551 98.3414 383.385 98.8783 386.427 98.8783Z" fill="white"/>
8
+ <path d="M319.185 111.406C314.413 111.406 309.968 110.541 305.852 108.811C301.796 107.081 298.246 104.665 295.204 101.563C292.162 98.4609 289.775 94.822 288.046 90.6462C286.375 86.4704 285.54 81.9068 285.54 76.9555C285.54 72.0042 286.375 67.4406 288.046 63.2648C289.716 59.0294 292.072 55.3905 295.115 52.3481C298.157 49.2461 301.706 46.8599 305.763 45.1896C309.879 43.4596 314.353 42.5946 319.185 42.5946C324.017 42.5946 328.342 43.3999 332.16 45.0106C336.037 46.6213 339.318 48.7688 342.003 51.4533C344.687 54.1377 346.596 57.1204 347.73 60.4014L335.471 66.3072C334.337 63.0859 332.339 60.4312 329.475 58.3433C326.672 56.1958 323.242 55.122 319.185 55.122C315.248 55.122 311.788 56.0467 308.805 57.8959C305.823 59.7452 303.496 62.3104 301.826 65.5913C300.215 68.8127 299.41 72.6007 299.41 76.9555C299.41 81.3103 300.215 85.1281 301.826 88.4091C303.496 91.6901 305.823 94.2552 308.805 96.1045C311.788 97.9538 315.248 98.8785 319.185 98.8785C323.242 98.8785 326.672 97.8345 329.475 95.7466C332.339 93.599 334.337 90.9146 335.471 87.6933L347.73 93.599C346.596 96.88 344.687 99.8627 342.003 102.547C339.318 105.232 336.037 107.379 332.16 108.99C328.342 110.601 324.017 111.406 319.185 111.406Z" fill="white"/>
9
+ <path d="M265.397 110.332V43.6685H279.267V110.332H265.397Z" fill="white"/>
10
+ <path d="M202.827 110.332V43.6685H224.571C231.789 43.6685 238.053 45.1002 243.362 47.9636C248.671 50.827 252.788 54.7642 255.711 59.7752C258.634 64.7861 260.095 70.513 260.095 76.9556C260.095 83.3983 258.634 89.1549 255.711 94.2255C252.788 99.2365 248.671 103.174 243.362 106.037C238.053 108.9 231.789 110.332 224.571 110.332H202.827ZM216.697 98.2522H224.929C229.284 98.2522 233.042 97.3872 236.204 95.6573C239.365 93.8676 241.811 91.392 243.541 88.2303C245.331 85.009 246.226 81.2507 246.226 76.9556C246.226 72.6009 245.331 68.8426 243.541 65.681C241.811 62.5193 239.365 60.0735 236.204 58.3435C233.042 56.6135 229.284 55.7485 224.929 55.7485H216.697V98.2522Z" fill="white"/>
11
+ <path d="M171.839 111.406C168.14 111.406 164.62 110.72 161.28 109.348C157.939 107.916 155.106 105.918 152.779 103.353C150.452 100.788 148.901 97.775 148.126 94.315L160.385 90.1989C161.399 93.0623 162.89 95.2397 164.859 96.731C166.828 98.1627 169.154 98.8786 171.839 98.8786C174.046 98.8786 175.925 98.461 177.476 97.6258C179.087 96.7907 180.339 95.6274 181.234 94.1361C182.129 92.5851 182.576 90.7954 182.576 88.7672C182.576 86.7389 182.129 85.009 181.234 83.5773C180.399 82.0859 179.176 80.9525 177.565 80.177C176.014 79.3418 174.105 78.9242 171.839 78.9242C170.526 78.9242 169.214 79.0734 167.901 79.3716C166.589 79.6699 165.396 80.0875 164.322 80.6244L161.101 73.9133L178.192 55.3011H152.153V43.6685H193.762V54.4063L176.223 74.3607L176.671 68.7233C180.667 68.7233 184.127 69.5585 187.05 71.2288C190.033 72.8395 192.33 75.1063 193.94 78.0294C195.611 80.9525 196.446 84.3528 196.446 88.2303C196.446 92.6447 195.372 96.6117 193.225 100.131C191.077 103.651 188.154 106.425 184.455 108.453C180.757 110.422 176.551 111.406 171.839 111.406Z" fill="white"/>
12
+ </g>
13
+ <defs>
14
+ <linearGradient id="paint0_linear_184_3640" x1="97.4467" y1="10.5294" x2="85.8199" y2="69.4832" gradientUnits="userSpaceOnUse">
15
+ <stop stop-color="white" stop-opacity="0.8"/>
16
+ <stop offset="1" stop-color="white" stop-opacity="0.5"/>
17
+ </linearGradient>
18
+ <linearGradient id="paint1_linear_184_3640" x1="68.472" y1="34.3899" x2="55.5909" y2="102.885" gradientUnits="userSpaceOnUse">
19
+ <stop stop-color="white" stop-opacity="0.8"/>
20
+ <stop offset="1" stop-color="white" stop-opacity="0.5"/>
21
+ </linearGradient>
22
+ <linearGradient id="paint2_linear_184_3640" x1="41.2011" y1="58.2533" x2="26.3355" y2="135.999" gradientUnits="userSpaceOnUse">
23
+ <stop stop-color="white" stop-opacity="0.8"/>
24
+ <stop offset="1" stop-color="white" stop-opacity="0.5"/>
25
+ </linearGradient>
26
+ <clipPath id="clip0_184_3640">
27
+ <rect width="349.699" height="68.8112" fill="white" transform="translate(148.126 42.5944)"/>
28
+ </clipPath>
29
+ </defs>
30
+ </svg>
@@ -1,6 +1,16 @@
1
- @use "sass:meta";
1
+ @import 'vuetify/styles';
2
+ @import 'intro.js/introjs.css';
2
3
 
3
- [data-vuetify] {
4
- @import "vuetify/_styles.scss";
4
+ .introjs-tooltipReferenceLayer {
5
+ z-index: 2401;
6
+ }
7
+
8
+ .introjs-overlay,
9
+ .introjs-helperLayer {
10
+ pointer-events: none;
11
+ z-index: 2401;
12
+ }
13
+
14
+ .introjs-dontShowAgain {
15
+ display: none;
5
16
  }
6
- @import "vuetify/_styles.scss";
@@ -1,25 +1,26 @@
1
- import { describe, it, expect } from "vitest";
2
- import {mountVuetify, openAllModals} from "~/helper";
3
- import DemoModal from "@/components/demo/DemoModal.vue";
1
+ import { mount } from '@vue/test-utils';
2
+ import { VDialog } from 'vuetify/components';
3
+ import DemoModal from '@/components/demo/DemoModal.vue';
4
4
 
5
5
  describe('DemoModal tests', () => {
6
6
  it('should mount', () => {
7
7
  const props = { modal: true };
8
- const wrapper = mountVuetify(DemoModal, props);
8
+ const wrapper = mount(DemoModal, { props });
9
9
  expect(wrapper).toBeTruthy();
10
10
  });
11
11
 
12
12
  it('should close', async () => {
13
13
  const props = { modal: true };
14
- const wrapper = mountVuetify(DemoModal, props);
14
+ const wrapper = mount(DemoModal, { props });
15
15
  const button = wrapper.findComponent('[data-testid="close"]');
16
16
  await button.trigger('click');
17
- expect(wrapper.emitted()['update:modal']).toBeTruthy();
17
+ expect(wrapper.emitted('update:modal')).toBeTruthy();
18
18
  });
19
19
 
20
20
  it('should open via input', async () => {
21
21
  const props = { modal: false };
22
- const wrapper = mountVuetify(DemoModal, props);
23
- await openAllModals(wrapper);
22
+ const wrapper = mount(DemoModal, { props });
23
+ const dialog = wrapper.findComponent(VDialog);
24
+ await dialog.setValue(true);
24
25
  });
25
26
  });
@@ -1,28 +1,28 @@
1
- import { describe, it, expect, vi } from "vitest";
2
- import { mountVuetify, openAllModals } from "~/helper";
3
- import { PRICING_URL } from "@/components/demo/options";
4
- import DemoPatientModal from "@/components/demo/DemoPatientModal.vue";
1
+ import { PRICING_URL } from '@/components/demo/options';
2
+ import { mount } from '@vue/test-utils';
3
+ import { VDialog } from 'vuetify/components';
4
+ import DemoPatientModal from '@/components/demo/DemoPatientModal.vue';
5
5
 
6
6
  describe('DemoPatientModal tests', () => {
7
7
  it('should mount', () => {
8
8
  const props = { modal: true, isModalOpen: true };
9
- const wrapper = mountVuetify(DemoPatientModal, props);
9
+ const wrapper = mount(DemoPatientModal, { props });
10
10
  expect(wrapper).toBeTruthy();
11
11
  });
12
12
 
13
13
  it('should close', async () => {
14
14
  const props = { modal: true, isModalOpen: true };
15
- const wrapper = mountVuetify(DemoPatientModal, props);
15
+ const wrapper = mount(DemoPatientModal, { props });
16
16
  const button = wrapper.findComponent('[data-testid="close"]');
17
17
  await button.trigger('click');
18
- expect(wrapper.emitted()['update:modal']).toBeTruthy();
18
+ expect(wrapper.emitted('update:modal')).toBeTruthy();
19
19
  });
20
20
 
21
21
  it('should open pricing url', async () => {
22
22
  vi.stubGlobal('open', vi.fn());
23
23
  const spy = vi.spyOn(window, 'open');
24
24
  const props = { modal: true, isModalOpen: true };
25
- const wrapper = mountVuetify(DemoPatientModal, props);
25
+ const wrapper = mount(DemoPatientModal, { props });
26
26
  const button = wrapper.findComponent('[data-testid="select-plan"]');
27
27
  await button.trigger('click');
28
28
  expect(spy).toHaveBeenCalledWith(PRICING_URL, '_self');
@@ -31,7 +31,8 @@ describe('DemoPatientModal tests', () => {
31
31
 
32
32
  it('should open via input', async () => {
33
33
  const props = { modal: false, isModalOpen: true };
34
- const wrapper = mountVuetify(DemoPatientModal, props);
35
- await openAllModals(wrapper);
34
+ const wrapper = mount(DemoPatientModal, { props });
35
+ const dialog = wrapper.findComponent(VDialog);
36
+ await dialog.setValue(true);
36
37
  });
37
38
  });
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it } from "vitest";
2
2
  import { demoLicenceOptions, demoPatientOptions } from "@/components/demo/options";
3
- import { LoadViewerOptions } from "@/models/LoadViewerOptions";
3
+ import { LoadViewerOptions } from "@/models/loadViewerOptions";
4
4
 
5
5
  describe('options tests', () => {
6
6
  it('should call demo license options', () => {
@@ -1,28 +1,28 @@
1
- import { describe, it, expect, vi } from "vitest";
2
- import { mountVuetify, openAllModals } from "~/helper";
3
- import DemoLicenceEnableCloudStorageModal from "@/components/demo/licence/DemoLicenceEnableCloudStorageModal.vue";
4
- import { PRICING_URL } from "../../options";
1
+ import { PRICING_URL } from '../../options';
2
+ import { mount } from '@vue/test-utils';
3
+ import { VDialog } from 'vuetify/components';
4
+ import DemoLicenceEnableCloudStorageModal from '@/components/demo/licence/DemoLicenceEnableCloudStorageModal.vue';
5
5
 
6
6
  describe('DemoLicenceEnableCloudStorageModal tests', () => {
7
7
  it('should mount', () => {
8
8
  const props = { modal: true };
9
- const wrapper = mountVuetify(DemoLicenceEnableCloudStorageModal, props);
9
+ const wrapper = mount(DemoLicenceEnableCloudStorageModal, { props });
10
10
  expect(wrapper).toBeTruthy();
11
11
  });
12
12
 
13
13
  it('should close modal', async () => {
14
14
  const props = { modal: true };
15
- const wrapper = mountVuetify(DemoLicenceEnableCloudStorageModal, props);
15
+ const wrapper = mount(DemoLicenceEnableCloudStorageModal, { props });
16
16
  const close = wrapper.findComponent('[data-testid="close"]');
17
17
  await close.trigger('click');
18
- expect(wrapper.emitted()['update:modal']).toBeTruthy();
18
+ expect(wrapper.emitted('update:modal')).toBeTruthy();
19
19
  });
20
20
 
21
21
  it('should open pricing url', async () => {
22
22
  vi.stubGlobal('open', vi.fn());
23
23
  const spy = vi.spyOn(window, 'open');
24
24
  const props = { modal: true };
25
- const wrapper = mountVuetify(DemoLicenceEnableCloudStorageModal, props);
25
+ const wrapper = mount(DemoLicenceEnableCloudStorageModal, { props });
26
26
  const button = wrapper.findComponent('[data-testid="confirm"]');
27
27
  await button.trigger('click');
28
28
  expect(spy).toHaveBeenCalledWith(PRICING_URL, '_self');
@@ -31,7 +31,8 @@ describe('DemoLicenceEnableCloudStorageModal tests', () => {
31
31
 
32
32
  it('should open via input', async () => {
33
33
  const props = { modal: false };
34
- const wrapper = mountVuetify(DemoLicenceEnableCloudStorageModal, props);
35
- await openAllModals(wrapper);
34
+ const wrapper = mount(DemoLicenceEnableCloudStorageModal, { props });
35
+ const dialog = wrapper.findComponent(VDialog);
36
+ await dialog.setValue(true);
36
37
  });
37
38
  });
@@ -1,28 +1,28 @@
1
- import { describe, it, expect, vi } from "vitest";
2
- import { mountVuetify, openAllModals } from "~/helper";
3
- import { SUPPORT_URL } from "@/components/demo/options";
4
- import DemoLicenceInfoModal from "@/components/demo/licence/DemoLicenceInfoModal.vue";
1
+ import { demoLicenceSubtitles, demoLicenceTitle, SUPPORT_URL } from '@/components/demo/options';
2
+ import { mount } from '@vue/test-utils';
3
+ import { VCardText, VCardTitle, VDialog } from 'vuetify/components';
4
+ import DemoLicenceInfoModal from '@/components/demo/licence/DemoLicenceInfoModal.vue';
5
5
 
6
6
  describe('DemoLicenceInfoModal tests', () => {
7
7
  it('should mount', () => {
8
8
  const props = { modal: true, isModalOpen: true };
9
- const wrapper = mountVuetify(DemoLicenceInfoModal, props);
9
+ const wrapper = mount(DemoLicenceInfoModal, { props });
10
10
  expect(wrapper).toBeTruthy();
11
11
  });
12
12
 
13
13
  it('should close modal', async () => {
14
14
  const props = { modal: true, isModalOpen: true };
15
- const wrapper = mountVuetify(DemoLicenceInfoModal, props);
15
+ const wrapper = mount(DemoLicenceInfoModal, { props });
16
16
  const close = wrapper.findComponent('[data-testid="close"]');
17
17
  await close.trigger('click');
18
- expect(wrapper.emitted()['update:modal']).toBeTruthy();
18
+ expect(wrapper.emitted('update:modal')).toBeTruthy();
19
19
  });
20
20
 
21
21
  it('should open support url', async () => {
22
22
  vi.stubGlobal('open', vi.fn());
23
23
  const spy = vi.spyOn(window, 'open');
24
- const props = { modal: true };
25
- const wrapper = mountVuetify(DemoLicenceInfoModal, props);
24
+ const props = { modal: true, isModalOpen: true };
25
+ const wrapper = mount(DemoLicenceInfoModal, { props });
26
26
  const button = wrapper.findComponent('[data-testid="confirm"]');
27
27
  await button.trigger('click');
28
28
  expect(spy).toHaveBeenCalledWith(SUPPORT_URL, '_self');
@@ -31,7 +31,17 @@ describe('DemoLicenceInfoModal tests', () => {
31
31
 
32
32
  it('should open via input', async () => {
33
33
  const props = { modal: false, isModalOpen: true };
34
- const wrapper = mountVuetify(DemoLicenceInfoModal, props);
35
- await openAllModals(wrapper);
34
+ const wrapper = mount(DemoLicenceInfoModal, { props });
35
+ const dialog = wrapper.findComponent(VDialog);
36
+ await dialog.setValue(true);
37
+ });
38
+
39
+ it('should show title and subtitle', async () => {
40
+ vi.spyOn(demoLicenceTitle, 'value', 'get').mockReturnValue('Title');
41
+ vi.spyOn(demoLicenceSubtitles, 'value', 'get').mockReturnValue(['Subtitle']);
42
+ const props = { modal: true, isModalOpen: true };
43
+ const wrapper = mount(DemoLicenceInfoModal, { props });
44
+ expect(wrapper.findComponent(VCardTitle).text()).contains('Title');
45
+ expect(wrapper.findComponent(VCardText).text()).contains('Subtitle');
36
46
  });
37
47
  });
@@ -1,18 +1,17 @@
1
- import { describe, expect, it } from "vitest";
2
- import { mountVuetify, openAllModals } from "~/helper";
3
- import { VTextField } from "vuetify/components";
4
- import DemoLicenceSendToPartyModal from "@/components/demo/licence/DemoLicenceSendToPartyModal.vue";
1
+ import { VDialog, VTextField } from 'vuetify/components';
2
+ import { mount } from '@vue/test-utils';
3
+ import DemoLicenceSendToPartyModal from '@/components/demo/licence/DemoLicenceSendToPartyModal.vue';
5
4
 
6
5
  describe('DemoLicenceSendToPartyModal tests', () => {
7
6
  it('should mount', () => {
8
7
  const props = { modal: true };
9
- const wrapper = mountVuetify(DemoLicenceSendToPartyModal, props);
8
+ const wrapper = mount(DemoLicenceSendToPartyModal, { props });
10
9
  expect(wrapper).toBeTruthy();
11
10
  });
12
11
 
13
12
  it('should enter email', async () => {
14
13
  const props = { modal: true };
15
- const wrapper = mountVuetify(DemoLicenceSendToPartyModal, props);
14
+ const wrapper = mount(DemoLicenceSendToPartyModal, { props });
16
15
  const input = wrapper.getComponent(VTextField);
17
16
  await input.setValue('example@singular.health');
18
17
  await input.trigger('keyup.enter');
@@ -22,15 +21,16 @@ describe('DemoLicenceSendToPartyModal tests', () => {
22
21
 
23
22
  it('should close modal', async () => {
24
23
  const props = { modal: true };
25
- const wrapper = mountVuetify(DemoLicenceSendToPartyModal, props);
24
+ const wrapper = mount(DemoLicenceSendToPartyModal, { props });
26
25
  const close = wrapper.findComponent('[data-testid="close"]');
27
26
  await close.trigger('click');
28
- expect(wrapper.emitted()['update:modal']).toBeTruthy();
27
+ expect(wrapper.emitted('update:modal')).toBeTruthy();
29
28
  });
30
29
 
31
30
  it('should open via input', async () => {
32
31
  const props = { modal: false };
33
- const wrapper = mountVuetify(DemoLicenceSendToPartyModal, props);
34
- await openAllModals(wrapper);
32
+ const wrapper = mount(DemoLicenceSendToPartyModal, { props });
33
+ const dialog = wrapper.findComponent(VDialog);
34
+ await dialog.setValue(true);
35
35
  });
36
36
  });
@@ -1,31 +1,31 @@
1
- import { describe, expect, it, vi } from "vitest";
2
- import { mountVuetify, openAllModals } from "~/helper";
3
- import { PRICING_URL } from "../../options";
4
- import DemoLicenceShareToMobileModal from "@/components/demo/licence/DemoLicenceShareToMobileModal.vue";
1
+ import { PRICING_URL } from '../../options';
2
+ import { mount } from '@vue/test-utils';
3
+ import { VDialog } from 'vuetify/components';
4
+ import DemoLicenceShareToMobileModal from '@/components/demo/licence/DemoLicenceShareToMobileModal.vue';
5
5
 
6
6
  describe('DemoLicenceShareToMobileModal tests', () => {
7
7
  it('should mount', () => {
8
8
  const props = { modal: true };
9
- const wrapper = mountVuetify(DemoLicenceShareToMobileModal, props);
9
+ const wrapper = mount(DemoLicenceShareToMobileModal, { props });
10
10
  expect(wrapper).toBeTruthy();
11
11
  });
12
12
 
13
13
  it('should close modal', async () => {
14
14
  const props = { modal: true };
15
- const wrapper = mountVuetify(DemoLicenceShareToMobileModal, props);
15
+ const wrapper = mount(DemoLicenceShareToMobileModal, { props });
16
16
  const close = wrapper.findComponent('[data-testid="close-1"]');
17
17
  await close.trigger('click');
18
- expect(wrapper.emitted()['update:modal']).toBeTruthy();
18
+ expect(wrapper.emitted('update:modal')).toBeTruthy();
19
19
  });
20
20
 
21
21
  it('should go to next step and open url', async () => {
22
22
  vi.stubGlobal('open', vi.fn());
23
23
  const spy = vi.spyOn(window, 'open');
24
24
  const props = { modal: true };
25
- const wrapper = mountVuetify(DemoLicenceShareToMobileModal, props);
25
+ const wrapper = mount(DemoLicenceShareToMobileModal, { props });
26
26
  const confirm1 = wrapper.findComponent('[data-testid="confirm-1"]');
27
27
  await confirm1.trigger('click');
28
- expect(wrapper.emitted()['update:modal']).toBeTruthy();
28
+ expect(wrapper.emitted('update:modal')).toBeTruthy();
29
29
  const confirm2 = wrapper.findComponent('[data-testid="confirm-2"]');
30
30
  await confirm2.trigger('click');
31
31
  expect(spy).toHaveBeenCalledWith(PRICING_URL, '_self');
@@ -34,10 +34,10 @@ describe('DemoLicenceShareToMobileModal tests', () => {
34
34
 
35
35
  it('should go to next step and close', async () => {
36
36
  const props = { modal: true };
37
- const wrapper = mountVuetify(DemoLicenceShareToMobileModal, props);
37
+ const wrapper = mount(DemoLicenceShareToMobileModal, { props });
38
38
  const confirm1 = wrapper.findComponent('[data-testid="confirm-1"]');
39
39
  await confirm1.trigger('click');
40
- expect(wrapper.emitted()['update:modal']).toBeTruthy();
40
+ expect(wrapper.emitted('update:modal')).toBeTruthy();
41
41
  const close2 = wrapper.findComponent('[data-testid="close-2"]');
42
42
  await close2.trigger('click');
43
43
  expect(wrapper.text()).toBe('');
@@ -45,7 +45,8 @@ describe('DemoLicenceShareToMobileModal tests', () => {
45
45
 
46
46
  it('should open via input', async () => {
47
47
  const props = { modal: false };
48
- const wrapper = mountVuetify(DemoLicenceShareToMobileModal, props);
49
- await openAllModals(wrapper);
48
+ const wrapper = mount(DemoLicenceShareToMobileModal, { props });
49
+ const dialog = wrapper.findComponent(VDialog);
50
+ await dialog.setValue(true);
50
51
  });
51
52
  });