@3cr/viewer-browser 0.0.200 → 0.0.246

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 (383) hide show
  1. package/.circleci/config.yml +46 -22
  2. package/.prettierrc +6 -0
  3. package/components.d.ts +27 -10
  4. package/dist/Viewer3CR.js +36 -45
  5. package/dist/Viewer3CR.mjs +26893 -21667
  6. package/dist/Viewer3CR.umd.js +36 -45
  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 +24 -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 +30 -41
  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 +55 -50
  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 +18 -4
  59. package/src/components/demo/DemoPatientModal.vue +12 -22
  60. package/src/components/demo/__tests__/DemoModal.spec.ts +9 -8
  61. package/src/components/demo/__tests__/DemoPatientModal.spec.ts +11 -10
  62. package/src/components/demo/__tests__/options.spec.ts +1 -1
  63. package/src/components/demo/licence/DemoLicenceInfoModal.vue +11 -29
  64. package/src/components/demo/licence/__tests__/DemoLicenceEnableCloudStorageModal.spec.ts +11 -10
  65. package/src/components/demo/licence/__tests__/DemoLicenceInfoModal.spec.ts +21 -11
  66. package/src/components/demo/licence/__tests__/DemoLicenceSendToPartyModal.spec.ts +10 -10
  67. package/src/components/demo/licence/__tests__/DemoLicenceShareToMobileModal.spec.ts +14 -13
  68. package/src/components/demo/options.ts +74 -76
  69. package/src/components/demo/patient/DemoPatientInfoModal.vue +11 -29
  70. package/src/components/demo/patient/__tests__/DemoPatientEnableCloudStorageModal.spec.ts +11 -10
  71. package/src/components/demo/patient/__tests__/DemoPatientInfoModal.spec.ts +12 -11
  72. package/src/components/demo/patient/__tests__/DemoPatientSendToPartyModal.spec.ts +10 -10
  73. package/src/components/demo/patient/__tests__/DemoPatientShareToMobileModal.spec.ts +14 -13
  74. package/src/components/modal/ActionRail.vue +7 -11
  75. package/src/components/modal/AskAI.vue +35 -50
  76. package/src/components/modal/CloseViewerModal.vue +22 -57
  77. package/src/components/modal/MftpWebGL3DRModal.vue +230 -635
  78. package/src/components/modal/ViewerActionRail.vue +44 -39
  79. package/src/components/modal/ViewerNavigationDrawer.vue +10 -8
  80. package/src/components/modal/ViewerNavigationDrawerContent.vue +91 -49
  81. package/src/components/modal/ViewerNavigationDrawerFooter.vue +83 -63
  82. package/src/components/modal/ViewerNavigationDrawerHeader.vue +14 -44
  83. package/src/components/modal/ViewerScanView.vue +114 -0
  84. package/src/components/modal/WebGL3DR.vue +91 -0
  85. package/src/components/modal/__tests__/ActionRail.spec.ts +10 -0
  86. package/src/components/modal/__tests__/AskAI.spec.ts +33 -0
  87. package/src/components/modal/__tests__/CloseViewerModal.spec.ts +24 -14
  88. package/src/components/modal/__tests__/MftpWebGL3DRModal.spec.ts +147 -176
  89. package/src/components/modal/__tests__/ViewerActionRail.spec.ts +11 -0
  90. package/src/components/modal/__tests__/ViewerNavigationDrawer.spec.ts +10 -12
  91. package/src/components/modal/__tests__/ViewerNavigationDrawerContent.spec.ts +4 -22
  92. package/src/components/modal/__tests__/ViewerNavigationDrawerFooter.spec.ts +35 -32
  93. package/src/components/modal/__tests__/ViewerNavigationDrawerHeader.spec.ts +14 -11
  94. package/src/components/modal/__tests__/ViewerScanView.spec.ts +60 -0
  95. package/src/components/modal/__tests__/WebGL3DR.spec.ts +57 -0
  96. package/src/components/modal/actions/Flip3dAction.vue +1 -1
  97. package/src/components/modal/actions/FlipHorizontalAction.vue +5 -10
  98. package/src/components/modal/actions/FlipVerticalAction.vue +5 -10
  99. package/src/components/modal/actions/FullscreenAction.vue +6 -11
  100. package/src/components/modal/actions/NavigationCubeAction.vue +7 -14
  101. package/src/components/modal/actions/PanAction.vue +4 -4
  102. package/src/components/modal/actions/ResetViewAction.vue +1 -1
  103. package/src/components/modal/actions/Rotate2dAction.vue +8 -20
  104. package/src/components/modal/actions/Slice3dAction.vue +10 -32
  105. package/src/components/modal/actions/ZoomAction.vue +1 -1
  106. package/src/components/modal/actions/__tests__/Action.spec.ts +8 -9
  107. package/src/components/modal/actions/__tests__/Flip3dAction.spec.ts +6 -8
  108. package/src/components/modal/actions/__tests__/FlipHorizontalAction.spec.ts +6 -7
  109. package/src/components/modal/actions/__tests__/FlipVerticalAction.spec.ts +6 -7
  110. package/src/components/modal/actions/__tests__/FullscreenAction.spec.ts +9 -10
  111. package/src/components/modal/actions/__tests__/NavigationCubeAction.spec.ts +11 -11
  112. package/src/components/modal/actions/__tests__/PanAction.spec.ts +9 -10
  113. package/src/components/modal/actions/__tests__/ResetViewAction.spec.ts +7 -7
  114. package/src/components/modal/actions/__tests__/Rotate2dAction.spec.ts +6 -8
  115. package/src/components/modal/actions/__tests__/Slice3dAction.spec.ts +23 -5
  116. package/src/components/modal/actions/__tests__/ZoomAction.spec.ts +8 -10
  117. package/src/components/modal/buttons/AutoAnnotateBtn.vue +197 -0
  118. package/src/components/modal/buttons/__tests__/AutoAnnotateBtn.spec.ts +28 -0
  119. package/src/components/modal/menus/FileMenu.vue +73 -0
  120. package/src/components/modal/menus/SettingsMenu.vue +106 -0
  121. package/src/components/modal/menus/__tests__/FileMenu.spec.ts +110 -0
  122. package/src/components/modal/menus/__tests__/SettingsMenu.spec.ts +71 -0
  123. package/src/components/navigation/mcad/McadGlobalActions.vue +20 -0
  124. package/src/components/navigation/mcad/McadGlobalOpacitySlider.vue +103 -0
  125. package/src/components/navigation/mcad/McadGlobalScanViewBtn.vue +28 -0
  126. package/src/components/navigation/mcad/McadGlobalVisibilityBtn.vue +38 -0
  127. package/src/components/shared/DoubleSliderSelector.vue +142 -0
  128. package/src/components/{loading → shared}/LoadingSpinner.vue +27 -36
  129. package/src/components/shared/UpdateSnackbar.vue +72 -0
  130. package/src/components/{selectors → shared}/ValueSelector.vue +9 -12
  131. package/src/components/shared/__tests__/DoubleSliderSelector.spec.ts +83 -0
  132. package/src/components/shared/__tests__/LoadingSpinner.spec.ts +9 -0
  133. package/src/components/shared/__tests__/UpdateSnackbar.spec.ts +116 -0
  134. package/src/components/shared/__tests__/ValueSelector.spec.ts +39 -0
  135. package/src/components/shared/__tests__/VerticalSliderSelector.spec.ts +50 -0
  136. package/src/components/views/AnnotationTreeView.vue +236 -0
  137. package/src/components/{modal/ViewerDisplaySettings.vue → views/DisplaySettings.vue} +7 -15
  138. package/src/components/views/MarkupTreeView.vue +201 -0
  139. package/src/components/views/McadObjectTreeView.vue +129 -0
  140. package/src/components/views/__tests__/AnnotationTreeView.spec.ts +62 -0
  141. package/src/components/{modal/__tests__/ViewerDisplaySettings.spec.ts → views/__tests__/DisplaySettings.spec.ts} +24 -20
  142. package/src/components/views/__tests__/MarkupTreeView.spec.ts +41 -0
  143. package/src/components/views/__tests__/McadObjectTreeView.spec.ts +47 -0
  144. package/src/components/views/modals/DataOverlayGeneralModal.vue +71 -0
  145. package/src/components/views/modals/DataOverlayMarkupModal.vue +60 -0
  146. package/src/components/views/modals/DataOverlayModal.vue +88 -0
  147. package/src/components/views/shared/MaskIcon.vue +44 -0
  148. package/src/components/views/shared/ObjectColor.vue +31 -0
  149. package/src/components/views/shared/ObjectLabel.vue +30 -0
  150. package/src/components/views/shared/Opacity.vue +65 -0
  151. package/src/components/views/shared/VisibilityBtn.vue +25 -0
  152. package/src/components/views/shared/__tests__/MaskIcon.spec.ts +10 -0
  153. package/src/components/views/shared/__tests__/ObjectColor.spec.ts +10 -0
  154. package/src/components/views/shared/__tests__/ObjectLabel.spec.ts +10 -0
  155. package/src/components/views/shared/__tests__/Opacity.spec.ts +24 -0
  156. package/src/components/views/shared/__tests__/VisibilityBtn.spec.ts +11 -0
  157. package/src/components/views/types/annotation-tree-view-item-child-action.ts +6 -0
  158. package/src/components/views/types/annotation-tree-view-item-child.ts +9 -0
  159. package/src/components/views/types/annotation-tree-view-item.ts +13 -0
  160. package/src/components/views/types/markup-tree-view-item-child.ts +6 -0
  161. package/src/components/views/types/markup-tree-view-item.ts +14 -0
  162. package/src/components/views/types/mcad-object-tree-view-item.ts +13 -0
  163. package/src/composables/__tests__/useAnnotations.spec.ts +35 -0
  164. package/src/composables/__tests__/useEventListener.spec.ts +32 -0
  165. package/src/composables/__tests__/useIntroJs.spec.ts +51 -0
  166. package/src/composables/__tests__/useMarkups.spec.ts +39 -0
  167. package/src/composables/__tests__/useMcadObjects.spec.ts +36 -0
  168. package/src/composables/__tests__/useMouse.spec.ts +20 -0
  169. package/src/{components/modal/composables → composables}/__tests__/useNavigationCubeObserver.spec.ts +17 -12
  170. package/src/{dataLayer → composables}/__tests__/useViewer3cr.spec.ts +1 -2
  171. package/src/composables/useAnnotations.ts +37 -0
  172. package/src/composables/useDebounce.ts +11 -0
  173. package/src/composables/useEventListener.ts +25 -0
  174. package/src/composables/useIntroJs.ts +142 -0
  175. package/src/composables/useMarkups.ts +41 -0
  176. package/src/composables/useMcadObjects.ts +32 -0
  177. package/src/composables/useMouse.ts +14 -0
  178. package/src/{components/modal/composables → composables}/useNavigationCubeObserver.ts +35 -25
  179. package/src/composables/useScanMovement.ts +25 -0
  180. package/src/composables/useScanSliders.ts +36 -0
  181. package/src/composables/useVersion3cr.ts +7 -0
  182. package/src/composables/useViewer3cr.ts +7 -0
  183. package/src/composables/useViewerOptions.ts +36 -0
  184. package/src/{dataLayer → functions}/__tests__/clamp.spec.ts +1 -2
  185. package/src/functions/__tests__/layoutOverlayStyle.spec.ts +325 -0
  186. package/src/{helpers/__tests__/model-helper.spec.ts → functions/__tests__/modelHelper.spec.ts} +77 -40
  187. package/src/{notifications → functions}/__tests__/notification.spec.ts +19 -29
  188. package/src/functions/__tests__/parseAction.spec.ts +9 -0
  189. package/src/functions/__tests__/parseCallToAction.spec.ts +11 -0
  190. package/src/functions/__tests__/parseDataOverlay.spec.ts +15 -0
  191. package/src/functions/__tests__/parseDataOverlayData.spec.ts +9 -0
  192. package/src/functions/__tests__/parseDataOverlayEvent.spec.ts +10 -0
  193. package/src/functions/__tests__/parseMcadEvent.spec.ts +10 -0
  194. package/src/functions/guards/isDataOverlayAngle.ts +6 -0
  195. package/src/functions/guards/isDataOverlayLength.ts +6 -0
  196. package/src/functions/guards/isDataOverlayPolygon.ts +6 -0
  197. package/src/functions/layoutOverlayStyle.ts +84 -0
  198. package/src/{helpers → functions}/modelHelper.ts +81 -18
  199. package/src/functions/notification.ts +82 -0
  200. package/src/functions/parseAction.ts +9 -0
  201. package/src/functions/parseCallToAction.ts +9 -0
  202. package/src/functions/parseDataOverlay.ts +10 -0
  203. package/src/functions/parseDataOverlayData.ts +10 -0
  204. package/src/functions/parseDataOverlayEvent.ts +17 -0
  205. package/src/functions/parseMcadEvent.ts +10 -0
  206. package/src/functions/rgbaToCss.ts +13 -0
  207. package/src/main.ts +57 -9
  208. package/src/{dataLayer → models}/__tests__/eventHandlers.spec.ts +2 -3
  209. package/src/models/__tests__/loadViewerOptions.spec.ts +72 -0
  210. package/src/models/__tests__/loadViewerPayload.spec.ts +10 -0
  211. package/src/models/__tests__/scanState.spec.ts +190 -0
  212. package/src/models/callbacks.ts +4 -0
  213. package/src/models/loadViewerOptions.ts +79 -0
  214. package/src/models/loadViewerPayload.ts +17 -0
  215. package/src/{dataLayer → models}/scanState.ts +63 -74
  216. package/src/plugins/__tests__/usePlugins.spec.ts +12 -0
  217. package/src/plugins/__tests__/vuetify.spec.ts +3 -4
  218. package/src/plugins/usePlugins.ts +8 -0
  219. package/src/plugins/vuetify.ts +31 -65
  220. package/src/services/{gpt/__tests__ → __tests__}/gpt.service.spec.ts +2 -2
  221. package/src/services/__tests__/service-worker.service.spec.ts +32 -0
  222. package/src/{dataLayer/__tests__/viewer3cr.spec.ts → services/__tests__/viewer-3cr.service.spec.ts} +97 -36
  223. package/src/services/gpt.service.ts +17 -0
  224. package/src/services/service-worker.service.ts +16 -0
  225. package/src/{dataLayer/viewer3cr.ts → services/viewer-3cr.service.ts} +281 -150
  226. package/src/tools/data-overlay.tool.ts +71 -0
  227. package/src/types/action.ts +13 -0
  228. package/src/types/call-to-action.ts +9 -0
  229. package/src/types/colour.ts +6 -0
  230. package/src/types/data-overlay-angle.ts +16 -0
  231. package/src/types/data-overlay-annotation.ts +18 -0
  232. package/src/types/data-overlay-data.ts +15 -0
  233. package/src/types/data-overlay-event.ts +5 -0
  234. package/src/types/data-overlay-info.ts +18 -0
  235. package/src/types/data-overlay-interaction.ts +15 -0
  236. package/src/types/data-overlay-length.ts +16 -0
  237. package/src/types/data-overlay-markup.ts +7 -0
  238. package/src/types/data-overlay-mcad.ts +20 -0
  239. package/src/types/data-overlay-polygon.ts +18 -0
  240. package/src/types/data-overlay.ts +16 -0
  241. package/src/types/demo-type.ts +4 -0
  242. package/src/types/gpt-question.ts +4 -0
  243. package/src/types/gpt-response-payload.ts +6 -0
  244. package/src/types/mcad-object-interaction.ts +15 -0
  245. package/src/types/segment-angle.ts +5 -0
  246. package/src/types/vector2.ts +4 -0
  247. package/src/types/vector3.ts +5 -0
  248. package/test/fakers/action-data.faker.ts +11 -0
  249. package/test/fakers/action.faker.ts +19 -0
  250. package/test/fakers/call-to-action.faker.ts +17 -0
  251. package/test/fakers/colour.faker.ts +17 -0
  252. package/test/fakers/data-overlay-angle.faker.ts +37 -0
  253. package/test/fakers/data-overlay-annotation.faker.ts +41 -0
  254. package/test/fakers/data-overlay-data.faker.ts +97 -0
  255. package/test/fakers/data-overlay-info.faker.ts +29 -0
  256. package/test/fakers/data-overlay-interaction.faker.ts +62 -0
  257. package/test/fakers/data-overlay-length.faker.ts +37 -0
  258. package/test/fakers/data-overlay-mcad.faker.ts +40 -0
  259. package/test/fakers/data-overlay-polygon.faker.ts +39 -0
  260. package/test/fakers/gpt-question.faker.ts +11 -0
  261. package/test/fakers/gpt-response.faker.ts +12 -0
  262. package/test/fakers/invert-transform.faker.ts +16 -0
  263. package/test/fakers/mcad-object-interaction.faker.ts +22 -0
  264. package/test/fakers/orientation.faker.ts +17 -0
  265. package/test/fakers/segment-angle.faker.ts +12 -0
  266. package/test/fakers/vector2.faker.ts +12 -0
  267. package/test/fakers/vector3.faker.ts +16 -0
  268. package/test/plugins/findByTestId.ts +25 -0
  269. package/test/plugins/vuetify.ts +16 -0
  270. package/test/setup.ts +16 -5
  271. package/tsconfig.json +4 -15
  272. package/vite.config.mts +20 -46
  273. package/vitest.config.mts +24 -43
  274. package/index.ts +0 -72
  275. package/src/assets/images/dark/3DICOM.png +0 -0
  276. package/src/assets/images/dark/3dicom-logo.svg +0 -1
  277. package/src/assets/images/light/3DICOM.png +0 -0
  278. package/src/assets/images/light/3dicom-logo.svg +0 -1
  279. package/src/assets/logo.png +0 -0
  280. package/src/assets/logo.svg +0 -6
  281. package/src/components/WebGL3DR.vue +0 -102
  282. package/src/components/__tests__/webgl3dr.spec.ts +0 -37
  283. package/src/components/icons/liver.vue +0 -21
  284. package/src/components/loading/__tests__/loading-spinner.spec.ts +0 -11
  285. package/src/components/modal/ViewerAnnotationModal.vue +0 -111
  286. package/src/components/modal/ViewerAnnotations.vue +0 -289
  287. package/src/components/modal/__tests__/ViewerAnnotationModal.spec.ts +0 -79
  288. package/src/components/modal/composables/useEventListener.ts +0 -22
  289. package/src/components/selectors/__tests__/value-selector.spec.ts +0 -53
  290. package/src/components/sliders/DoubleSliderSelector.vue +0 -141
  291. package/src/components/sliders/__tests__/double-slider-selector.spec.ts +0 -104
  292. package/src/components/sliders/__tests__/vertical-slider-selector.spec.ts +0 -61
  293. package/src/dataLayer/__tests__/getIconForPreset.spec.ts +0 -40
  294. package/src/dataLayer/__tests__/patchDataOverlay.spec.ts +0 -88
  295. package/src/dataLayer/__tests__/scanState.spec.ts +0 -93
  296. package/src/dataLayer/getIconForPreset.ts +0 -11
  297. package/src/dataLayer/patchDataOverlay.ts +0 -101
  298. package/src/dataLayer/useViewer3cr.ts +0 -7
  299. package/src/helpers/__tests__/layout-overlay-style.spec.ts +0 -290
  300. package/src/helpers/__tests__/utils.spec.ts +0 -70
  301. package/src/helpers/layoutOverlayStyle.ts +0 -96
  302. package/src/helpers/utils.ts +0 -16
  303. package/src/models/Callbacks.ts +0 -2
  304. package/src/models/LoadViewerOptions.ts +0 -31
  305. package/src/models/LoadViewerPayload.ts +0 -9
  306. package/src/models/__tests__/load-viewer-options.spec.ts +0 -22
  307. package/src/notifications/notification.ts +0 -50
  308. package/src/plugins/__tests__/index.spec.ts +0 -19
  309. package/src/plugins/index.ts +0 -17
  310. package/src/services/gpt/gpt.service.ts +0 -35
  311. package/static/3cr-types-browser/index.ts +0 -74
  312. package/static/3cr-types-browser/types/Action.ts +0 -6
  313. package/static/3cr-types-browser/types/AlphaKeys.ts +0 -5
  314. package/static/3cr-types-browser/types/AnchorPoint.ts +0 -12
  315. package/static/3cr-types-browser/types/CallToAction.ts +0 -5
  316. package/static/3cr-types-browser/types/ColourData.ts +0 -7
  317. package/static/3cr-types-browser/types/ColourPresetData.ts +0 -9
  318. package/static/3cr-types-browser/types/CurrentDataOverlayState.ts +0 -6
  319. package/static/3cr-types-browser/types/CurrentScanState.ts +0 -22
  320. package/static/3cr-types-browser/types/DataOverlay.ts +0 -22
  321. package/static/3cr-types-browser/types/DataOverlayActions.ts +0 -14
  322. package/static/3cr-types-browser/types/DataOverlayData.ts +0 -8
  323. package/static/3cr-types-browser/types/DataOverlayEvent.ts +0 -8
  324. package/static/3cr-types-browser/types/DecryptionKey.ts +0 -4
  325. package/static/3cr-types-browser/types/DisplaySettings.ts +0 -10
  326. package/static/3cr-types-browser/types/EmptyPayload.ts +0 -3
  327. package/static/3cr-types-browser/types/EnumPayload.ts +0 -4
  328. package/static/3cr-types-browser/types/FileManagementActions.ts +0 -11
  329. package/static/3cr-types-browser/types/FlipValue.ts +0 -7
  330. package/static/3cr-types-browser/types/FrontEndInterfaces.ts +0 -14
  331. package/static/3cr-types-browser/types/GradientKeys.ts +0 -7
  332. package/static/3cr-types-browser/types/GreyscalePresetData.ts +0 -6
  333. package/static/3cr-types-browser/types/InitialDataOverlayState.ts +0 -6
  334. package/static/3cr-types-browser/types/InitialScanState.ts +0 -19
  335. package/static/3cr-types-browser/types/InteractionType.ts +0 -8
  336. package/static/3cr-types-browser/types/InteractivityActions.ts +0 -6
  337. package/static/3cr-types-browser/types/InteractivityState.ts +0 -4
  338. package/static/3cr-types-browser/types/InvertTransformData.ts +0 -6
  339. package/static/3cr-types-browser/types/LayoutActions.ts +0 -6
  340. package/static/3cr-types-browser/types/LayoutData.ts +0 -7
  341. package/static/3cr-types-browser/types/LoadDataSet.ts +0 -6
  342. package/static/3cr-types-browser/types/LoadSessionState.ts +0 -4
  343. package/static/3cr-types-browser/types/LocalLoadDataset.ts +0 -3
  344. package/static/3cr-types-browser/types/MovementData.ts +0 -7
  345. package/static/3cr-types-browser/types/NavigationCubeActions.ts +0 -8
  346. package/static/3cr-types-browser/types/NavigationCubeData.ts +0 -12
  347. package/static/3cr-types-browser/types/NavigationCubeTransform.ts +0 -9
  348. package/static/3cr-types-browser/types/NotificationPayload.ts +0 -7
  349. package/static/3cr-types-browser/types/NotificationsActions.ts +0 -6
  350. package/static/3cr-types-browser/types/Object.ts +0 -1
  351. package/static/3cr-types-browser/types/ObjectColour.ts +0 -7
  352. package/static/3cr-types-browser/types/ObjectIcon.ts +0 -5
  353. package/static/3cr-types-browser/types/ObjectInvert.ts +0 -7
  354. package/static/3cr-types-browser/types/ObjectSize.ts +0 -7
  355. package/static/3cr-types-browser/types/ObjectSize2D.ts +0 -7
  356. package/static/3cr-types-browser/types/ObjectVisible.ts +0 -5
  357. package/static/3cr-types-browser/types/PositionData.ts +0 -14
  358. package/static/3cr-types-browser/types/PresetsActions.ts +0 -4
  359. package/static/3cr-types-browser/types/RotationValue.ts +0 -7
  360. package/static/3cr-types-browser/types/ScanMovementActions.ts +0 -27
  361. package/static/3cr-types-browser/types/ScanMovementData.ts +0 -3
  362. package/static/3cr-types-browser/types/ScanOrientationActions.ts +0 -6
  363. package/static/3cr-types-browser/types/ScanStateActions.ts +0 -4
  364. package/static/3cr-types-browser/types/ScanView.ts +0 -6
  365. package/static/3cr-types-browser/types/SettingsData.ts +0 -12
  366. package/static/3cr-types-browser/types/SlicerData.ts +0 -9
  367. package/static/3cr-types-browser/types/SliderValue.ts +0 -4
  368. package/static/3cr-types-browser/types/SlidersActions.ts +0 -18
  369. package/static/3cr-types-browser/types/Vector2Data.ts +0 -5
  370. package/static/3cr-types-browser/types/Vector3Data.ts +0 -6
  371. package/static/3cr-types-browser/types/VectorMovementData.ts +0 -8
  372. package/static/3cr-types-browser/types/ViewInteractiveMode.ts +0 -5
  373. package/static/3cr-types-browser/types/ViewOrientation.ts +0 -8
  374. package/static/3cr-types-browser/types/ViewOrientations.ts +0 -10
  375. package/static/3cr-types-browser/types/ViewSelectionActions.ts +0 -9
  376. package/static/3cr-types-browser/types/ViewToggleData.ts +0 -7
  377. package/static/3cr-types-browser/types/VolumeOrientation.ts +0 -7
  378. package/test/helper.ts +0 -44
  379. /package/src/components/{sliders → shared}/VerticalSliderSelector.vue +0 -0
  380. /package/{config.ts → src/config.ts} +0 -0
  381. /package/src/{dataLayer → functions}/clamp.ts +0 -0
  382. /package/src/{dataLayer → models}/eventHandlers.ts +0 -0
  383. /package/{static/3cr-types-browser/types/ActionData.ts → src/types/action-data.ts} +0 -0
@@ -0,0 +1,39 @@
1
+ import { DataOverlayPolygon, DataOverlayPolygonRaw } from '@/types/data-overlay-polygon';
2
+ import { faker } from '@faker-js/faker';
3
+ import { Vector3Faker } from '@test/fakers/vector3.faker';
4
+ import { InvertTransformFaker } from '@test/fakers/invert-transform.faker';
5
+ import { CallToActionFaker } from '@test/fakers/call-to-action.faker';
6
+
7
+ export class DataOverlayPolygonFaker {
8
+ static random(): DataOverlayPolygon {
9
+ return {
10
+ ...DataOverlayPolygonFaker.randomBase(),
11
+ CallToAction: CallToActionFaker.random()
12
+ };
13
+ }
14
+
15
+ static randomRaw(): DataOverlayPolygonRaw {
16
+ return {
17
+ ...DataOverlayPolygonFaker.randomBase(),
18
+ CallToAction: JSON.stringify(CallToActionFaker.randomRaw())
19
+ };
20
+ }
21
+
22
+ private static randomBase() {
23
+ return {
24
+ Version: faker.system.semver(),
25
+ Id: faker.string.uuid(),
26
+ Title: faker.lorem.word(),
27
+ Description: faker.lorem.word(),
28
+ Points: faker.helpers.multiple(Vector3Faker.random, { count: 5 }),
29
+ Inverted: InvertTransformFaker.random(),
30
+ Visibility2d: faker.datatype.boolean(),
31
+ Visibility3d: faker.datatype.boolean(),
32
+ Area: faker.number.float(),
33
+ Perimeter: faker.number.float(),
34
+ AverageHU: faker.number.float(),
35
+ LowestHU: faker.number.float(),
36
+ HighestHU: faker.number.float()
37
+ };
38
+ }
39
+ }
@@ -0,0 +1,11 @@
1
+ import { faker } from '@faker-js/faker';
2
+ import { GptQuestion } from '@/types/gpt-question';
3
+
4
+ export class GptQuestionFaker {
5
+ static random(): GptQuestion {
6
+ return {
7
+ Question: faker.lorem.text(),
8
+ ApiPreFilledRequestKey: faker.number.int()
9
+ };
10
+ }
11
+ }
@@ -0,0 +1,12 @@
1
+ import { faker } from '@faker-js/faker';
2
+ import { GptQuestionFaker } from '@test/fakers/gpt-question.faker';
3
+ import { GptResponsePayload } from '@/types/gpt-response-payload';
4
+
5
+ export class GptResponseFaker {
6
+ static random(): GptResponsePayload {
7
+ return {
8
+ GptResponse: faker.lorem.paragraph(),
9
+ FollowupQuestions: faker.helpers.multiple(GptQuestionFaker.random, { count: 3 })
10
+ };
11
+ }
12
+ }
@@ -0,0 +1,16 @@
1
+ import { InvertTransformData } from '@3cr/types-ts';
2
+ import { faker } from '@faker-js/faker';
3
+
4
+ /**
5
+ * Create fake InvertTransformData objects.
6
+ */
7
+ export class InvertTransformFaker {
8
+ static random(): InvertTransformData {
9
+ return {
10
+ Version: faker.system.semver(),
11
+ InvertedCoronal: faker.datatype.boolean(),
12
+ InvertedSagittal: faker.datatype.boolean(),
13
+ InvertedTransverse: faker.datatype.boolean()
14
+ };
15
+ }
16
+ }
@@ -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 {vi} from "vitest";
1
+ import '@test/plugins/findByTestId';
2
+ import '@test/plugins/vuetify';
2
3
 
3
- global.ResizeObserver = require("resize-observer-polyfill");
4
+ global.ResizeObserver = require('resize-observer-polyfill');
4
5
 
5
- vi.mock("@3cr/sdk-browser", async (importOriginal) => {
6
- const mod = (await importOriginal()) as object;
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.intl", "ESNext","es2017.object", "es6", "dom", "dom.iterable", "es2015.promise", "es2015.core"],
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
- "~/*": ["test/*"]
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
- // Plugins
2
- import Components from 'unplugin-vue-components/vite'
3
- import Vue from '@vitejs/plugin-vue'
4
- import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
5
- import ViteFonts from 'unplugin-fonts/vite'
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({styleId: injectedStyleId}),
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: { // tell the build process to treat this project as library
36
- entry: './index.ts',
32
+ lib: {
33
+ entry: 'src/main.ts',
37
34
  name: 'Viewer3CR',
38
- fileName: "Viewer3CR",
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
- // Provide global variables to use in the UMD build
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
- '@3cr/types-ts': fileURLToPath(new URL('./static/3cr-types-browser', import.meta.url)),
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
- /// <reference types="vitest" />
2
- // vitest.config.ts
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(viteConfig, defineConfig({
7
- test: {
8
- globals: true,
9
- environment: 'jsdom',
10
- server: {
11
- deps: {
12
- inline: ['vuetify'],
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
- exclude: ['node_modules/**'],
16
- include: ['**/*.spec.ts'],
17
- setupFiles: ['/test/setup.ts'],
18
- coverage: {
19
- provider: 'v8', // or 'v8',
20
- enabled: true,
21
- reporter: ['html'],
22
- include: ['src/**/*', 'index.ts'],
23
- exclude: [
24
- 'src/demo/**',
25
- 'coverage/**',
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>
Binary file
@@ -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>