@3cr/viewer-browser 0.0.162 → 0.0.194

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 (188) hide show
  1. package/.circleci/config.yml +8 -6
  2. package/__tests__/index.spec.ts +31 -24
  3. package/components.d.ts +32 -0
  4. package/dist/Viewer3CR.js +44 -27
  5. package/dist/Viewer3CR.mjs +22731 -17742
  6. package/dist/Viewer3CR.umd.js +44 -27
  7. package/index.html +5 -8
  8. package/index.ts +7 -2
  9. package/package.json +4 -2
  10. package/playground/index.html +6 -4
  11. package/src/App.vue +12 -4
  12. package/src/__tests__/app.spec.ts +2 -13
  13. package/src/assets/magic_wand.svg +24 -0
  14. package/src/components/WebGL3DR.vue +53 -92
  15. package/src/components/__tests__/webgl3dr.spec.ts +29 -48
  16. package/src/{demo → components/demo}/DemoModal.vue +1 -1
  17. package/src/{demo → components/demo}/DemoPatientModal.vue +4 -1
  18. package/src/components/demo/__tests__/DemoModal.spec.ts +25 -0
  19. package/src/components/demo/__tests__/DemoPatientModal.spec.ts +37 -0
  20. package/src/components/demo/__tests__/options.spec.ts +25 -0
  21. package/src/components/demo/licence/DemoLicenceEnableCloudStorageModal.vue +64 -0
  22. package/src/{demo → components/demo}/licence/DemoLicenceInfoModal.vue +5 -4
  23. package/src/{demo → components/demo}/licence/DemoLicenceSendToPartyModal.vue +6 -4
  24. package/src/{demo → components/demo}/licence/DemoLicenceShareToMobileModal.vue +8 -6
  25. package/src/components/demo/licence/__tests__/DemoLicenceEnableCloudStorageModal.spec.ts +37 -0
  26. package/src/components/demo/licence/__tests__/DemoLicenceInfoModal.spec.ts +37 -0
  27. package/src/components/demo/licence/__tests__/DemoLicenceSendToPartyModal.spec.ts +36 -0
  28. package/src/components/demo/licence/__tests__/DemoLicenceShareToMobileModal.spec.ts +51 -0
  29. package/src/{demo → components/demo}/options.ts +18 -20
  30. package/src/components/demo/patient/DemoPatientEnableCloudStorageModal.vue +64 -0
  31. package/src/{demo → components/demo}/patient/DemoPatientInfoModal.vue +5 -4
  32. package/src/{demo → components/demo}/patient/DemoPatientSendToPartyModal.vue +4 -3
  33. package/src/{demo → components/demo}/patient/DemoPatientShareToMobileModal.vue +8 -6
  34. package/src/components/demo/patient/__tests__/DemoPatientEnableCloudStorageModal.spec.ts +37 -0
  35. package/src/components/demo/patient/__tests__/DemoPatientInfoModal.spec.ts +37 -0
  36. package/src/components/demo/patient/__tests__/DemoPatientSendToPartyModal.spec.ts +36 -0
  37. package/src/components/demo/patient/__tests__/DemoPatientShareToMobileModal.spec.ts +51 -0
  38. package/src/components/loading/LoadingSpinner.vue +1 -1
  39. package/src/components/modal/ActionRail.vue +96 -0
  40. package/src/components/modal/AskAI.vue +250 -0
  41. package/src/components/modal/CloseViewerModal.vue +104 -0
  42. package/src/components/modal/MftpWebGL3DRModal.vue +415 -834
  43. package/src/components/modal/ViewerActionRail.vue +123 -0
  44. package/src/components/modal/ViewerAnnotationModal.vue +115 -0
  45. package/src/components/modal/ViewerAnnotations.vue +283 -0
  46. package/src/components/modal/ViewerDisplaySettings.vue +102 -0
  47. package/src/components/modal/ViewerNavigationDrawer.vue +90 -0
  48. package/src/components/modal/ViewerNavigationDrawerContent.vue +126 -0
  49. package/src/components/modal/ViewerNavigationDrawerFooter.vue +111 -0
  50. package/src/components/modal/ViewerNavigationDrawerHeader.vue +63 -0
  51. package/src/components/modal/__tests__/CloseViewerModal.spec.ts +60 -0
  52. package/src/components/modal/__tests__/{mftp-webgl-3dr-modal.spec.ts → MftpWebGL3DRModal.spec.ts} +47 -298
  53. package/src/components/modal/__tests__/ViewerAnnotationModal.spec.ts +79 -0
  54. package/src/components/modal/__tests__/ViewerDisplaySettings.spec.ts +61 -0
  55. package/src/components/modal/__tests__/ViewerNavigationDrawer.spec.ts +32 -0
  56. package/src/components/modal/__tests__/ViewerNavigationDrawerContent.spec.ts +29 -0
  57. package/src/components/modal/__tests__/ViewerNavigationDrawerFooter.spec.ts +43 -0
  58. package/src/components/modal/__tests__/ViewerNavigationDrawerHeader.spec.ts +37 -0
  59. package/src/components/modal/actions/Action.vue +40 -0
  60. package/src/components/modal/actions/Flip3dAction.vue +79 -0
  61. package/src/components/modal/actions/FlipHorizontalAction.vue +36 -0
  62. package/src/components/modal/actions/FlipVerticalAction.vue +36 -0
  63. package/src/components/modal/actions/FullscreenAction.vue +47 -0
  64. package/src/components/modal/actions/NavigationCubeAction.vue +33 -0
  65. package/src/components/modal/actions/PanAction.vue +78 -0
  66. package/src/components/modal/actions/ResetViewAction.vue +29 -0
  67. package/src/components/modal/actions/Rotate2dAction.vue +78 -0
  68. package/src/components/modal/actions/Slice3dAction.vue +71 -0
  69. package/src/components/modal/actions/ZoomAction.vue +70 -0
  70. package/src/components/modal/actions/__tests__/Action.spec.ts +29 -0
  71. package/src/components/modal/actions/__tests__/Flip3dAction.spec.ts +48 -0
  72. package/src/components/modal/actions/__tests__/FlipHorizontalAction.spec.ts +17 -0
  73. package/src/components/modal/actions/__tests__/FlipVerticalAction.spec.ts +17 -0
  74. package/src/components/modal/actions/__tests__/FullscreenAction.spec.ts +28 -0
  75. package/src/components/modal/actions/__tests__/NavigationCubeAction.spec.ts +25 -0
  76. package/src/components/modal/actions/__tests__/PanAction.spec.ts +46 -0
  77. package/src/components/modal/actions/__tests__/ResetViewAction.spec.ts +17 -0
  78. package/src/components/modal/actions/__tests__/Rotate2dAction.spec.ts +23 -0
  79. package/src/components/modal/actions/__tests__/Slice3dAction.spec.ts +14 -0
  80. package/src/components/modal/actions/__tests__/ZoomAction.spec.ts +34 -0
  81. package/src/components/modal/composables/__tests__/useNavigationCubeObserver.spec.ts +56 -0
  82. package/src/components/modal/composables/useEventListener.ts +22 -0
  83. package/src/components/modal/composables/useNavigationCubeObserver.ts +104 -0
  84. package/src/components/selectors/ValueSelector.vue +30 -33
  85. package/src/components/selectors/__tests__/value-selector.spec.ts +1 -1
  86. package/src/components/sliders/DoubleSliderSelector.vue +79 -71
  87. package/src/components/sliders/VerticalSliderSelector.vue +12 -17
  88. package/src/components/sliders/__tests__/double-slider-selector.spec.ts +1 -1
  89. package/src/components/sliders/__tests__/vertical-slider-selector.spec.ts +1 -1
  90. package/src/dataLayer/__tests__/clamp.spec.ts +16 -0
  91. package/src/dataLayer/__tests__/eventHandlers.spec.ts +38 -0
  92. package/src/dataLayer/__tests__/getIconForPreset.spec.ts +40 -0
  93. package/src/dataLayer/__tests__/patchDataOverlay.spec.ts +88 -0
  94. package/src/dataLayer/__tests__/scanState.spec.ts +93 -0
  95. package/src/dataLayer/__tests__/useViewer3cr.spec.ts +10 -0
  96. package/src/dataLayer/__tests__/viewer3cr.spec.ts +331 -0
  97. package/src/dataLayer/clamp.ts +9 -0
  98. package/src/dataLayer/eventHandlers.ts +26 -0
  99. package/src/dataLayer/patchDataOverlay.ts +101 -0
  100. package/src/dataLayer/scanState.ts +105 -26
  101. package/src/dataLayer/useViewer3cr.ts +7 -0
  102. package/src/dataLayer/viewer3cr.ts +410 -0
  103. package/src/helpers/__tests__/layout-overlay-style.spec.ts +24 -22
  104. package/src/helpers/__tests__/model-helper.spec.ts +44 -13
  105. package/src/helpers/layoutOverlayStyle.ts +16 -27
  106. package/src/helpers/modelHelper.ts +62 -10
  107. package/src/models/Callbacks.ts +2 -2
  108. package/src/models/LoadViewerOptions.ts +2 -0
  109. package/src/models/LoadViewerPayload.ts +1 -0
  110. package/src/notifications/notification.ts +3 -4
  111. package/src/plugins/vuetify.ts +5 -0
  112. package/src/services/gpt/__tests__/gpt.service.spec.ts +27 -0
  113. package/src/services/gpt/gpt.service.ts +27 -0
  114. package/static/3cr-types-browser/index.ts +74 -0
  115. package/static/3cr-types-browser/types/Action.ts +6 -0
  116. package/static/3cr-types-browser/types/ActionData.ts +4 -0
  117. package/static/3cr-types-browser/types/AlphaKeys.ts +5 -0
  118. package/static/3cr-types-browser/types/AnchorPoint.ts +12 -0
  119. package/static/3cr-types-browser/types/CallToAction.ts +5 -0
  120. package/static/3cr-types-browser/types/ColourData.ts +7 -0
  121. package/static/3cr-types-browser/types/ColourPresetData.ts +9 -0
  122. package/static/3cr-types-browser/types/CurrentDataOverlayState.ts +6 -0
  123. package/static/3cr-types-browser/types/CurrentScanState.ts +22 -0
  124. package/static/3cr-types-browser/types/DataOverlay.ts +22 -0
  125. package/static/3cr-types-browser/types/DataOverlayActions.ts +14 -0
  126. package/static/3cr-types-browser/types/DataOverlayData.ts +8 -0
  127. package/static/3cr-types-browser/types/DataOverlayEvent.ts +8 -0
  128. package/static/3cr-types-browser/types/DecryptionKey.ts +4 -0
  129. package/static/3cr-types-browser/types/DisplaySettings.ts +10 -0
  130. package/static/3cr-types-browser/types/EmptyPayload.ts +3 -0
  131. package/static/3cr-types-browser/types/EnumPayload.ts +4 -0
  132. package/static/3cr-types-browser/types/FileManagementActions.ts +11 -0
  133. package/static/3cr-types-browser/types/FlipValue.ts +7 -0
  134. package/static/3cr-types-browser/types/FrontEndInterfaces.ts +14 -0
  135. package/static/3cr-types-browser/types/GradientKeys.ts +7 -0
  136. package/static/3cr-types-browser/types/GreyscalePresetData.ts +6 -0
  137. package/static/3cr-types-browser/types/InitialDataOverlayState.ts +6 -0
  138. package/static/3cr-types-browser/types/InitialScanState.ts +19 -0
  139. package/static/3cr-types-browser/types/InteractionType.ts +8 -0
  140. package/static/3cr-types-browser/types/InteractivityActions.ts +6 -0
  141. package/static/3cr-types-browser/types/InteractivityState.ts +4 -0
  142. package/static/3cr-types-browser/types/InvertTransformData.ts +6 -0
  143. package/static/3cr-types-browser/types/LayoutActions.ts +6 -0
  144. package/static/3cr-types-browser/types/LayoutData.ts +7 -0
  145. package/static/3cr-types-browser/types/LoadDataSet.ts +6 -0
  146. package/static/3cr-types-browser/types/LoadSessionState.ts +4 -0
  147. package/static/3cr-types-browser/types/LocalLoadDataset.ts +3 -0
  148. package/static/3cr-types-browser/types/MovementData.ts +7 -0
  149. package/static/3cr-types-browser/types/NavigationCubeActions.ts +8 -0
  150. package/static/3cr-types-browser/types/NavigationCubeData.ts +12 -0
  151. package/static/3cr-types-browser/types/NavigationCubeTransform.ts +9 -0
  152. package/static/3cr-types-browser/types/NotificationPayload.ts +7 -0
  153. package/static/3cr-types-browser/types/NotificationsActions.ts +6 -0
  154. package/static/3cr-types-browser/types/Object.ts +1 -0
  155. package/static/3cr-types-browser/types/ObjectColour.ts +7 -0
  156. package/static/3cr-types-browser/types/ObjectIcon.ts +5 -0
  157. package/static/3cr-types-browser/types/ObjectInvert.ts +7 -0
  158. package/static/3cr-types-browser/types/ObjectSize.ts +7 -0
  159. package/static/3cr-types-browser/types/ObjectSize2D.ts +7 -0
  160. package/static/3cr-types-browser/types/ObjectVisible.ts +5 -0
  161. package/static/3cr-types-browser/types/PositionData.ts +14 -0
  162. package/static/3cr-types-browser/types/PresetsActions.ts +4 -0
  163. package/static/3cr-types-browser/types/RotationValue.ts +7 -0
  164. package/static/3cr-types-browser/types/ScanMovementActions.ts +27 -0
  165. package/static/3cr-types-browser/types/ScanMovementData.ts +3 -0
  166. package/static/3cr-types-browser/types/ScanOrientationActions.ts +6 -0
  167. package/static/3cr-types-browser/types/ScanStateActions.ts +4 -0
  168. package/static/3cr-types-browser/types/ScanView.ts +6 -0
  169. package/static/3cr-types-browser/types/SettingsData.ts +12 -0
  170. package/static/3cr-types-browser/types/SlicerData.ts +9 -0
  171. package/static/3cr-types-browser/types/SliderValue.ts +4 -0
  172. package/static/3cr-types-browser/types/SlidersActions.ts +18 -0
  173. package/static/3cr-types-browser/types/Vector2Data.ts +5 -0
  174. package/static/3cr-types-browser/types/Vector3Data.ts +6 -0
  175. package/static/3cr-types-browser/types/VectorMovementData.ts +8 -0
  176. package/static/3cr-types-browser/types/ViewInteractiveMode.ts +5 -0
  177. package/static/3cr-types-browser/types/ViewOrientation.ts +8 -0
  178. package/static/3cr-types-browser/types/ViewOrientations.ts +10 -0
  179. package/static/3cr-types-browser/types/ViewSelectionActions.ts +9 -0
  180. package/static/3cr-types-browser/types/ViewToggleData.ts +7 -0
  181. package/static/3cr-types-browser/types/VolumeOrientation.ts +7 -0
  182. package/test/helper.ts +10 -1
  183. package/test/setup.ts +13 -0
  184. package/tsconfig.json +1 -0
  185. package/vite.config.mts +1 -0
  186. package/src/dataLayer/__tests__/payload-handler.spec.ts +0 -214
  187. package/src/dataLayer/payloadHandler.ts +0 -138
  188. /package/src/dataLayer/{iconData.ts → getIconForPreset.ts} +0 -0
@@ -11,8 +11,8 @@ jobs:
11
11
  name: Install Dependencies
12
12
  command: |
13
13
  npm install
14
- BUCKET_NAME="3cr-playground"
15
- DIST_NAME="3cr-playground-development"
14
+ export BUCKET_NAME="3cr-playground"
15
+ export DIST_NAME="3cr-playground-development"
16
16
  npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
17
17
  npm run deploy:ci
18
18
  npm run deploy:playground
@@ -26,10 +26,12 @@ jobs:
26
26
  name: Install Dependencies
27
27
  command: |
28
28
  npm install
29
- sed -i -e 's/"@3cr/viewer-browser"/"@3cr/viewer-browser-development"/g' ./package.json
30
- sed -i -e 's/"@3cr/viewer-browser"/"@3cr/viewer-browser-development"/g' ./README.md
31
- BUCKET_NAME="3cr-playground-development"
32
- DIST_NAME="EO7C7NEHS1T35"
29
+ PRE='@3cr/viewer\-browser'
30
+ POST='@3cr/viewer\-browser\-development'
31
+ sed -i -e "s:@3cr/viewer\\-browser:@3cr/viewer\\-browser\\-development:g" ./package.json
32
+ sed -i -e "s:@3cr/viewer\\-browser:@3cr/viewer\\-browser\\-development:g" ./README.md
33
+ export BUCKET_NAME="3cr-playground-development"
34
+ export DIST_NAME="EO7C7NEHS1T35"
33
35
  npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
34
36
  npm run deploy:ci
35
37
  npm run deploy:playground
@@ -1,31 +1,38 @@
1
- import { describe, expect, it, vi } from "vitest";
2
- import { loadViewer, registerViewer } from "../index";
3
-
4
- vi.mock("@3cr/sdk-browser", async (importOriginal) => {
5
- const mod = (await importOriginal()) as object;
6
- return {
7
- ...mod,
8
- // replace some exports
9
- registerVersion: vi.fn(),
10
- createInstance: vi.fn(),
11
- executePayload: vi.fn(),
12
- registerOnPayloadHandler: vi.fn(),
13
- };
14
- });
1
+ import { describe, expect, it } from "vitest";
2
+ import {ejectViewer, loadSession, loadViewer, registerViewer} from "../index";
3
+
4
+ describe('index tests', () => {
5
+ const errorMessage = 'Please call `registerViewer(version: string)` first';
6
+
7
+ it('should reject loadViewer', () => {
8
+ expect(() => loadViewer()).rejects.toThrow(errorMessage);
9
+ });
10
+
11
+ it('should reject loadSession invalid url', () => {
12
+ expect(() => loadSession('')).rejects.toThrow(errorMessage);
13
+ });
14
+
15
+ it('should resolve loadViewer', async () => {
16
+ await registerViewer("1.0.0");
17
+ expect(loadViewer()).resolves.not.toThrow(errorMessage);
18
+ });
15
19
 
16
- describe("DoubleSliderSelector.vue", () => {
17
- it("loadViewer", async () => {
18
- expect(() => loadViewer()).rejects.toThrowError(
19
- "Please call `registerViewer(version: string, idSelector: string)` first"
20
- );
20
+ it('should resolve loadSession 3crds url', async () => {
21
+ await registerViewer("1.0.0");
22
+ expect(loadSession('https://localhost/example.3crds')).resolves.not.toThrow(errorMessage);
21
23
  });
22
- it("registerViewer", async () => {
24
+
25
+ it('should resolve loadSession 3crms url', async () => {
23
26
  await registerViewer("1.0.0");
27
+ expect(loadSession('https://localhost/example.3crms')).resolves.not.toThrow(errorMessage);
24
28
  });
25
- it("registerViewer", async () => {
29
+
30
+ it('should resolve loadSession 3crs url', async () => {
26
31
  await registerViewer("1.0.0");
27
- expect(() => loadViewer()).not.toThrowError(
28
- "Please call `registerViewer(version: string, idSelector: string)` first"
29
- );
32
+ expect(loadSession('https://localhost/example.3crs')).resolves.not.toThrow(errorMessage);
33
+ });
34
+
35
+ it('should eject viewer', () => {
36
+ expect(ejectViewer()).resolves.not.toThrow();
30
37
  });
31
38
  });
package/components.d.ts CHANGED
@@ -7,12 +7,44 @@ export {}
7
7
 
8
8
  declare module 'vue' {
9
9
  export interface GlobalComponents {
10
+ Action: typeof import('./src/components/modal/actions/Action.vue')['default']
11
+ ActionRail: typeof import('./src/components/modal/ActionRail.vue')['default']
12
+ AskAI: typeof import('./src/components/modal/AskAI.vue')['default']
13
+ CloseViewerModal: typeof import('./src/components/modal/CloseViewerModal.vue')['default']
14
+ DemoLicenceEnableCloudStorageModal: typeof import('./src/components/demo/licence/DemoLicenceEnableCloudStorageModal.vue')['default']
15
+ DemoLicenceInfoModal: typeof import('./src/components/demo/licence/DemoLicenceInfoModal.vue')['default']
16
+ DemoLicenceSendToPartyModal: typeof import('./src/components/demo/licence/DemoLicenceSendToPartyModal.vue')['default']
17
+ DemoLicenceShareToMobileModal: typeof import('./src/components/demo/licence/DemoLicenceShareToMobileModal.vue')['default']
18
+ DemoModal: typeof import('./src/components/demo/DemoModal.vue')['default']
19
+ DemoPatientEnableCloudStorageModal: typeof import('./src/components/demo/patient/DemoPatientEnableCloudStorageModal.vue')['default']
20
+ DemoPatientInfoModal: typeof import('./src/components/demo/patient/DemoPatientInfoModal.vue')['default']
21
+ DemoPatientModal: typeof import('./src/components/demo/DemoPatientModal.vue')['default']
22
+ DemoPatientSendToPartyModal: typeof import('./src/components/demo/patient/DemoPatientSendToPartyModal.vue')['default']
23
+ DemoPatientShareToMobileModal: typeof import('./src/components/demo/patient/DemoPatientShareToMobileModal.vue')['default']
10
24
  DoubleSliderSelector: typeof import('./src/components/sliders/DoubleSliderSelector.vue')['default']
25
+ Flip3dAction: typeof import('./src/components/modal/actions/Flip3dAction.vue')['default']
26
+ FlipHorizontalAction: typeof import('./src/components/modal/actions/FlipHorizontalAction.vue')['default']
27
+ FlipVerticalAction: typeof import('./src/components/modal/actions/FlipVerticalAction.vue')['default']
28
+ FullscreenAction: typeof import('./src/components/modal/actions/FullscreenAction.vue')['default']
11
29
  Liver: typeof import('./src/components/icons/liver.vue')['default']
12
30
  LoadingSpinner: typeof import('./src/components/loading/LoadingSpinner.vue')['default']
13
31
  MftpWebGL3DRModal: typeof import('./src/components/modal/MftpWebGL3DRModal.vue')['default']
32
+ NavigationCubeAction: typeof import('./src/components/modal/actions/NavigationCubeAction.vue')['default']
33
+ PanAction: typeof import('./src/components/modal/actions/PanAction.vue')['default']
34
+ ResetViewAction: typeof import('./src/components/modal/actions/ResetViewAction.vue')['default']
35
+ Rotate2dAction: typeof import('./src/components/modal/actions/Rotate2dAction.vue')['default']
36
+ Slice3dAction: typeof import('./src/components/modal/actions/Slice3dAction.vue')['default']
14
37
  ValueSelector: typeof import('./src/components/selectors/ValueSelector.vue')['default']
15
38
  VerticalSliderSelector: typeof import('./src/components/sliders/VerticalSliderSelector.vue')['default']
39
+ ViewerActionRail: typeof import('./src/components/modal/ViewerActionRail.vue')['default']
40
+ ViewerAnnotationModal: typeof import('./src/components/modal/ViewerAnnotationModal.vue')['default']
41
+ ViewerAnnotations: typeof import('./src/components/modal/ViewerAnnotations.vue')['default']
42
+ ViewerDisplaySettings: typeof import('./src/components/modal/ViewerDisplaySettings.vue')['default']
43
+ ViewerNavigationDrawer: typeof import('./src/components/modal/ViewerNavigationDrawer.vue')['default']
44
+ ViewerNavigationDrawerContent: typeof import('./src/components/modal/ViewerNavigationDrawerContent.vue')['default']
45
+ ViewerNavigationDrawerFooter: typeof import('./src/components/modal/ViewerNavigationDrawerFooter.vue')['default']
46
+ ViewerNavigationDrawerHeader: typeof import('./src/components/modal/ViewerNavigationDrawerHeader.vue')['default']
16
47
  WebGL3DR: typeof import('./src/components/WebGL3DR.vue')['default']
48
+ ZoomAction: typeof import('./src/components/modal/actions/ZoomAction.vue')['default']
17
49
  }
18
50
  }