@3cr/viewer-browser 0.0.52 → 0.0.55

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 (71) hide show
  1. package/README.md +108 -81
  2. package/__tests__/index.spec.ts +31 -0
  3. package/components.d.ts +2 -2
  4. package/coverage/3cr-viewer-browser/index.html +116 -0
  5. package/coverage/3cr-viewer-browser/index.ts.html +211 -0
  6. package/coverage/3cr-viewer-browser/src/App.vue.html +313 -0
  7. package/coverage/3cr-viewer-browser/src/components/WebGL3DR.vue.html +442 -0
  8. package/coverage/3cr-viewer-browser/src/components/icons/index.html +116 -0
  9. package/coverage/3cr-viewer-browser/src/components/icons/liver.vue.html +148 -0
  10. package/coverage/3cr-viewer-browser/src/components/index.html +116 -0
  11. package/coverage/3cr-viewer-browser/src/components/loading/LoadingSpinner.vue.html +556 -0
  12. package/coverage/3cr-viewer-browser/src/components/loading/index.html +116 -0
  13. package/coverage/3cr-viewer-browser/src/components/modal/MftpWebGL3DRModal.vue.html +3931 -0
  14. package/coverage/3cr-viewer-browser/src/components/modal/index.html +116 -0
  15. package/coverage/3cr-viewer-browser/src/components/selectors/ValueSelector.vue.html +331 -0
  16. package/coverage/3cr-viewer-browser/src/components/selectors/index.html +116 -0
  17. package/coverage/3cr-viewer-browser/src/components/sliders/DoubleSliderSelector.vue.html +445 -0
  18. package/coverage/3cr-viewer-browser/src/components/sliders/VerticalSliderSelector.vue.html +349 -0
  19. package/coverage/3cr-viewer-browser/src/components/sliders/index.html +131 -0
  20. package/coverage/3cr-viewer-browser/src/helpers/index.html +146 -0
  21. package/coverage/3cr-viewer-browser/src/helpers/layoutOverlayStyle.ts.html +406 -0
  22. package/coverage/3cr-viewer-browser/src/helpers/modelHelper.ts.html +412 -0
  23. package/coverage/3cr-viewer-browser/src/helpers/utils.ts.html +133 -0
  24. package/coverage/3cr-viewer-browser/src/index.html +131 -0
  25. package/coverage/3cr-viewer-browser/src/main.ts.html +124 -0
  26. package/coverage/3cr-viewer-browser/src/plugins/index.html +131 -0
  27. package/coverage/3cr-viewer-browser/src/plugins/index.ts.html +130 -0
  28. package/coverage/3cr-viewer-browser/src/plugins/vuetify.ts.html +220 -0
  29. package/coverage/base.css +224 -0
  30. package/coverage/block-navigation.js +87 -0
  31. package/coverage/favicon.png +0 -0
  32. package/coverage/index.html +251 -0
  33. package/coverage/prettify.css +1 -0
  34. package/coverage/prettify.js +2 -0
  35. package/coverage/sort-arrow-sprite.png +0 -0
  36. package/coverage/sorter.js +196 -0
  37. package/dist/Viewer3CR.js +17 -11
  38. package/dist/Viewer3CR.mjs +5352 -5183
  39. package/dist/Viewer3CR.umd.js +17 -11
  40. package/index.html +4 -1
  41. package/index.ts +16 -12
  42. package/package.json +8 -3
  43. package/src/App.vue +1 -9
  44. package/src/__tests__/app.spec.ts +27 -0
  45. package/src/components/WebGL3DR.vue +49 -37
  46. package/src/components/__tests__/webgl3dr.spec.ts +56 -0
  47. package/src/components/icons/liver.vue +21 -0
  48. package/src/components/loading/__tests__/loading-spinner.spec.ts +11 -0
  49. package/src/components/modal/MftpWebGL3DRModal.vue +662 -394
  50. package/src/components/modal/__tests__/mftp-webgl-3dr-modal.spec.ts +690 -0
  51. package/src/components/selectors/__tests__/value-selector.spec.ts +35 -0
  52. package/src/components/sliders/DoubleSliderSelector.vue +30 -24
  53. package/src/components/sliders/VerticalSliderSelector.vue +25 -21
  54. package/src/components/sliders/__tests__/double-slider-selector.spec.ts +72 -0
  55. package/src/components/sliders/__tests__/vertical-slider-selector.spec.ts +61 -0
  56. package/src/helpers/__tests__/layout-overlay-style.spec.ts +288 -0
  57. package/src/helpers/__tests__/model-helper.spec.ts +118 -0
  58. package/src/helpers/__tests__/utils.spec.ts +70 -0
  59. package/src/helpers/layoutOverlayStyle.ts +50 -30
  60. package/src/plugins/__tests__/index.spec.ts +19 -0
  61. package/src/plugins/__tests__/vuetify.spec.ts +8 -0
  62. package/src/plugins/vuetify.ts +25 -8
  63. package/test/helper.ts +35 -0
  64. package/test/setup.ts +1 -0
  65. package/tsconfig.json +5 -2
  66. package/vite.config.mts +1 -0
  67. package/vitest.config.mts +44 -0
  68. package/README2.md +0 -201
  69. package/src/components/expansion-panels/ExpansionHeaderMiniMenu.vue +0 -19
  70. package/src/helpers/models.ts +0 -69
  71. /package/src/components/{sliders/SliderSelector.vue → selectors/ValueSelector.vue} +0 -0
package/README.md CHANGED
@@ -1,81 +1,108 @@
1
- # Vuetify (Default)
2
-
3
- This is the official scaffolding tool for Vuetify, designed to give you a head start in building your new Vuetify application. It sets up a base template with all the necessary configurations and standard directory structure, enabling you to begin development without the hassle of setting up the project from scratch.
4
-
5
- ## ❗️ Important Links
6
-
7
- - 📄 [Docs](https://vuetifyjs.com/)
8
- - 🚨 [Issues](https://issues.vuetifyjs.com/)
9
- - 🏬 [Store](https://store.vuetifyjs.com/)
10
- - 🎮 [Playground](https://play.vuetifyjs.com/)
11
- - 💬 [Discord](https://community.vuetifyjs.com)
12
-
13
- ## 💿 Install
14
-
15
- Set up your project using your preferred package manager. Use the corresponding command to install the dependencies:
16
-
17
- | Package Manager | Command |
18
- |---------------------------------------------------------------|----------------|
19
- | [yarn](https://yarnpkg.com/getting-started) | `yarn install` |
20
- | [npm](https://docs.npmjs.com/cli/v7/commands/npm-install) | `npm install` |
21
- | [pnpm](https://pnpm.io/installation) | `pnpm install` |
22
- | [bun](https://bun.sh/#getting-started) | `bun install` |
23
-
24
- After completing the installation, your environment is ready for Vuetify development.
25
-
26
- ## ✨ Features
27
-
28
- - 🖼️ **Optimized Front-End Stack**: Leverage the latest Vue 3 and Vuetify 3 for a modern, reactive UI development experience. [Vue 3](https://v3.vuejs.org/) | [Vuetify 3](https://vuetifyjs.com/en/)
29
- - 🗃️ **State Management**: Integrated with [Pinia](https://pinia.vuejs.org/), the intuitive, modular state management solution for Vue.
30
- - 🚦 **Routing and Layouts**: Utilizes Vue Router for SPA navigation and vite-plugin-vue-layouts for organizing Vue file layouts. [Vue Router](https://router.vuejs.org/) | [vite-plugin-vue-layouts](https://github.com/JohnCampionJr/vite-plugin-vue-layouts)
31
- - 💻 **Enhanced Development Experience**: Benefit from TypeScript's static type checking and the ESLint plugin suite for Vue, ensuring code quality and consistency. [TypeScript](https://www.typescriptlang.org/) | [ESLint Plugin Vue](https://eslint.vuejs.org/)
32
- - **Next-Gen Tooling**: Powered by Vite, experience fast cold starts and instant HMR (Hot Module Replacement). [Vite](https://vitejs.dev/)
33
- - 🧩 **Automated Component Importing**: Streamline your workflow with unplugin-vue-components, automatically importing components as you use them. [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components)
34
- - 🛠️ **Strongly-Typed Vue**: Use vue-tsc for type-checking your Vue components, and enjoy a robust development experience. [vue-tsc](https://github.com/johnsoncodehk/volar/tree/master/packages/vue-tsc)
35
-
36
- These features are curated to provide a seamless development experience from setup to deployment, ensuring that your Vuetify application is both powerful and maintainable.
37
-
38
- ## 💡 Usage
39
-
40
- This section covers how to start the development server and build your project for production.
41
-
42
- ### Starting the Development Server
43
-
44
- To start the development server with hot-reload, run the following command. The server will be accessible at [http://localhost:3000](http://localhost:3000):
45
-
46
- ```bash
47
- yarn dev
48
- ```
49
-
50
- (Repeat for npm, pnpm, and bun with respective commands.)
51
-
52
- > Add NODE_OPTIONS='--no-warnings' to suppress the JSON import warnings that happen as part of the Vuetify import mapping. If you are on Node [v21.3.0](https://nodejs.org/en/blog/release/v21.3.0) or higher, you can change this to NODE_OPTIONS='--disable-warning=5401'. If you don't mind the warning, you can remove this from your package.json dev script.
53
-
54
- ### Building for Production
55
-
56
- To build your project for production, use:
57
-
58
- ```bash
59
- yarn build
60
- ```
61
-
62
- (Repeat for npm, pnpm, and bun with respective commands.)
63
-
64
- Once the build process is completed, your application will be ready for deployment in a production environment.
65
-
66
- ## 💪 Support Vuetify Development
67
-
68
- This project is built with [Vuetify](https://vuetifyjs.com/en/), a UI Library with a comprehensive collection of Vue components. Vuetify is an MIT licensed Open Source project that has been made possible due to the generous contributions by our [sponsors and backers](https://vuetifyjs.com/introduction/sponsors-and-backers/). If you are interested in supporting this project, please consider:
69
-
70
- - [Requesting Enterprise Support](https://support.vuetifyjs.com/)
71
- - [Sponsoring John on Github](https://github.com/users/johnleider/sponsorship)
72
- - [Sponsoring Kael on Github](https://github.com/users/kaelwd/sponsorship)
73
- - [Supporting the team on Open Collective](https://opencollective.com/vuetify)
74
- - [Becoming a sponsor on Patreon](https://www.patreon.com/vuetify)
75
- - [Becoming a subscriber on Tidelift](https://tidelift.com/subscription/npm/vuetify)
76
- - [Making a one-time donation with Paypal](https://paypal.me/vuetify)
77
-
78
- ## 📑 License
79
- [MIT](http://opensource.org/licenses/MIT)
80
-
81
- Copyright (c) 2016-present Vuetify, LLC
1
+ # @3cr/viewer-browser
2
+
3
+ ![](https://img.shields.io/badge/tests-successful-green)
4
+ ![](https://img.shields.io/circleci/build/bitbucket/medvr/3cr-sdk-browser/main)
5
+
6
+
7
+ Ecosystem integration for installing and running [3DICOM Online Viewer (3CR-OV)](https://docs.3cr.singular.health/) within the Browser (client-side)
8
+
9
+ [3DICOM Online Viewer (3CR-OV) Playground](https://playground.3cr.singular.health/)
10
+
11
+ ## Include `@3cr/viewer-browser` script
12
+
13
+ Choose one of the following ways
14
+ - ### HTML Script Tag
15
+
16
+ Insert this line into your `index.html`
17
+
18
+ ```html
19
+ <script src="https://cdn.jsdelivr.net/npm/@3cr/viewer-browser@{{version}}/dist/Viewer3CR.umd.js"> </script>
20
+ ```
21
+ Note: Please ensure you replace the `{{version}}` with the version of the viewer you want.
22
+
23
+ - ### JS/TS way
24
+
25
+ You can also include it dynamically within your code.
26
+
27
+ `Typescript (.ts)`
28
+ ```ts
29
+ export async function loadViewerScript(version: string): Promise<void> {
30
+ return new Promise<void>((resolve) => {
31
+ const s = document.createElement('script');
32
+ s.onload = () => {
33
+ resolve()
34
+ }
35
+ s.src = `https://cdn.jsdelivr.net/npm/@3cr/viewer-browser@${version}/dist/Viewer3CR.umd.js`;
36
+ document.head.appendChild(s);
37
+ })
38
+ }
39
+
40
+ // ...
41
+
42
+ await loadViewerScript("1.0.0");
43
+ ```
44
+ `Javascript (.js)`
45
+ ```js
46
+ export async function loadViewerScript(version) {
47
+ return new Promise((resolve) => {
48
+ const s = document.createElement('script');
49
+ s.onload = () => {
50
+ resolve()
51
+ }
52
+ s.src = `https://cdn.jsdelivr.net/npm/@3cr/viewer-browser@${version}/dist/Viewer3CR.umd.js`;
53
+ document.head.appendChild(s);
54
+ })
55
+ }
56
+
57
+ // ...
58
+
59
+ await loadViewerScript("1.0.0");
60
+ ```
61
+
62
+
63
+ ## Using the Package
64
+
65
+ 1. #### Register 3DICOM Online Viewer version
66
+
67
+ Call the `registerViewer` function with the version of 3CR you would like to view. This will generate a new container to load the viewer within and register the 3CR Instance.
68
+
69
+ `Typescript (.ts) / Javascript (.js)`
70
+ ```ts
71
+ const VERSION_3CR: string = '1.0.0';
72
+
73
+ await window.registerViewer(VERSION_3CR)
74
+ ```
75
+
76
+ 2. #### Load in the 3VXL file
77
+
78
+ Generate the 3VXL file and Decryption Key/Iv and supply that to the `loadViewer` function
79
+
80
+ Note: You can supply undefined/nothing to the loadViewer() function to display a default scan for testing purposes.
81
+
82
+ `Typescript (.ts) / Javascript (.js)`
83
+ ```ts
84
+ const payload = {
85
+ Url: "<Some presigned URL to a 3VXL file.>",
86
+ DecryptionKey: {
87
+ Iv: "<Initialisation Vector of the Key>",
88
+ Key: "<Decryption Key>"
89
+ }
90
+ }
91
+ await window.loadViewer(payload)
92
+
93
+ // OR
94
+
95
+ await window.loadViewer()
96
+ ```
97
+
98
+
99
+ ## Contributing
100
+
101
+ Pull requests are welcome. For changes, please open an issue first
102
+ to discuss what you would like to change.
103
+
104
+ Please make sure to update tests as appropriate.
105
+
106
+ ## License
107
+
108
+ [MIT](https://choosealicense.com/licenses/mit/)
@@ -0,0 +1,31 @@
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
+ });
15
+
16
+ describe("DoubleSliderSelector.vue", () => {
17
+ it("loadViewer", async () => {
18
+ expect(() => loadViewer()).rejects.toThrowError(
19
+ "Please call `registerViewer(version: string, idSelector: string)` first"
20
+ );
21
+ });
22
+ it("registerViewer", async () => {
23
+ await registerViewer("1.0.0");
24
+ });
25
+ it("registerViewer", async () => {
26
+ await registerViewer("1.0.0");
27
+ expect(() => loadViewer()).not.toThrowError(
28
+ "Please call `registerViewer(version: string, idSelector: string)` first"
29
+ );
30
+ });
31
+ });
package/components.d.ts CHANGED
@@ -8,10 +8,10 @@ export {}
8
8
  declare module 'vue' {
9
9
  export interface GlobalComponents {
10
10
  DoubleSliderSelector: typeof import('./src/components/sliders/DoubleSliderSelector.vue')['default']
11
- ExpansionHeaderMiniMenu: typeof import('./src/components/expansion-panels/ExpansionHeaderMiniMenu.vue')['default']
11
+ Liver: typeof import('./src/components/icons/liver.vue')['default']
12
12
  LoadingSpinner: typeof import('./src/components/loading/LoadingSpinner.vue')['default']
13
13
  MftpWebGL3DRModal: typeof import('./src/components/modal/MftpWebGL3DRModal.vue')['default']
14
- SliderSelector: typeof import('./src/components/sliders/SliderSelector.vue')['default']
14
+ ValueSelector: typeof import('./src/components/selectors/ValueSelector.vue')['default']
15
15
  VerticalSliderSelector: typeof import('./src/components/sliders/VerticalSliderSelector.vue')['default']
16
16
  WebGL3DR: typeof import('./src/components/WebGL3DR.vue')['default']
17
17
  }
@@ -0,0 +1,116 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for 3cr-viewer-browser</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../prettify.css" />
9
+ <link rel="stylesheet" href="../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../index.html">All files</a> 3cr-viewer-browser</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">100% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>42/42</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">100% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>3/3</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">100% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>2/2</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">100% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>42/42</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line high'></div>
65
+ <div class="pad1">
66
+ <table class="coverage-summary">
67
+ <thead>
68
+ <tr>
69
+ <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
70
+ <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
71
+ <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
72
+ <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
73
+ <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
74
+ <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
75
+ <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
76
+ <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
77
+ <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
78
+ <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
79
+ </tr>
80
+ </thead>
81
+ <tbody><tr>
82
+ <td class="file high" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
83
+ <td data-value="100" class="pic high">
84
+ <div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
85
+ </td>
86
+ <td data-value="100" class="pct high">100%</td>
87
+ <td data-value="42" class="abs high">42/42</td>
88
+ <td data-value="100" class="pct high">100%</td>
89
+ <td data-value="3" class="abs high">3/3</td>
90
+ <td data-value="100" class="pct high">100%</td>
91
+ <td data-value="2" class="abs high">2/2</td>
92
+ <td data-value="100" class="pct high">100%</td>
93
+ <td data-value="42" class="abs high">42/42</td>
94
+ </tr>
95
+
96
+ </tbody>
97
+ </table>
98
+ </div>
99
+ <div class='push'></div><!-- for sticky footer -->
100
+ </div><!-- /wrapper -->
101
+ <div class='footer quiet pad2 space-top1 center small'>
102
+ Code coverage generated by
103
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
+ at 2024-04-09T08:33:16.899Z
105
+ </div>
106
+ <script src="../prettify.js"></script>
107
+ <script>
108
+ window.onload = function () {
109
+ prettyPrint();
110
+ };
111
+ </script>
112
+ <script src="../sorter.js"></script>
113
+ <script src="../block-navigation.js"></script>
114
+ </body>
115
+ </html>
116
+
@@ -0,0 +1,211 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for 3cr-viewer-browser/index.ts</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../prettify.css" />
9
+ <link rel="stylesheet" href="../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../index.html">All files</a> / <a href="index.html">3cr-viewer-browser</a> index.ts</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">100% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>42/42</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">100% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>3/3</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">100% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>2/2</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">100% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>42/42</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input type="search" id="fileSearch">
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <div class='status-line high'></div>
65
+ <pre><table class="coverage">
66
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
+ <a name='L2'></a><a href='#L2'>2</a>
68
+ <a name='L3'></a><a href='#L3'>3</a>
69
+ <a name='L4'></a><a href='#L4'>4</a>
70
+ <a name='L5'></a><a href='#L5'>5</a>
71
+ <a name='L6'></a><a href='#L6'>6</a>
72
+ <a name='L7'></a><a href='#L7'>7</a>
73
+ <a name='L8'></a><a href='#L8'>8</a>
74
+ <a name='L9'></a><a href='#L9'>9</a>
75
+ <a name='L10'></a><a href='#L10'>10</a>
76
+ <a name='L11'></a><a href='#L11'>11</a>
77
+ <a name='L12'></a><a href='#L12'>12</a>
78
+ <a name='L13'></a><a href='#L13'>13</a>
79
+ <a name='L14'></a><a href='#L14'>14</a>
80
+ <a name='L15'></a><a href='#L15'>15</a>
81
+ <a name='L16'></a><a href='#L16'>16</a>
82
+ <a name='L17'></a><a href='#L17'>17</a>
83
+ <a name='L18'></a><a href='#L18'>18</a>
84
+ <a name='L19'></a><a href='#L19'>19</a>
85
+ <a name='L20'></a><a href='#L20'>20</a>
86
+ <a name='L21'></a><a href='#L21'>21</a>
87
+ <a name='L22'></a><a href='#L22'>22</a>
88
+ <a name='L23'></a><a href='#L23'>23</a>
89
+ <a name='L24'></a><a href='#L24'>24</a>
90
+ <a name='L25'></a><a href='#L25'>25</a>
91
+ <a name='L26'></a><a href='#L26'>26</a>
92
+ <a name='L27'></a><a href='#L27'>27</a>
93
+ <a name='L28'></a><a href='#L28'>28</a>
94
+ <a name='L29'></a><a href='#L29'>29</a>
95
+ <a name='L30'></a><a href='#L30'>30</a>
96
+ <a name='L31'></a><a href='#L31'>31</a>
97
+ <a name='L32'></a><a href='#L32'>32</a>
98
+ <a name='L33'></a><a href='#L33'>33</a>
99
+ <a name='L34'></a><a href='#L34'>34</a>
100
+ <a name='L35'></a><a href='#L35'>35</a>
101
+ <a name='L36'></a><a href='#L36'>36</a>
102
+ <a name='L37'></a><a href='#L37'>37</a>
103
+ <a name='L38'></a><a href='#L38'>38</a>
104
+ <a name='L39'></a><a href='#L39'>39</a>
105
+ <a name='L40'></a><a href='#L40'>40</a>
106
+ <a name='L41'></a><a href='#L41'>41</a>
107
+ <a name='L42'></a><a href='#L42'>42</a>
108
+ <a name='L43'></a><a href='#L43'>43</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
109
+ <span class="cline-any cline-yes">1x</span>
110
+ <span class="cline-any cline-yes">1x</span>
111
+ <span class="cline-any cline-yes">1x</span>
112
+ <span class="cline-any cline-yes">1x</span>
113
+ <span class="cline-any cline-yes">1x</span>
114
+ <span class="cline-any cline-yes">1x</span>
115
+ <span class="cline-any cline-yes">1x</span>
116
+ <span class="cline-any cline-yes">1x</span>
117
+ <span class="cline-any cline-yes">1x</span>
118
+ <span class="cline-any cline-yes">1x</span>
119
+ <span class="cline-any cline-yes">1x</span>
120
+ <span class="cline-any cline-yes">1x</span>
121
+ <span class="cline-any cline-yes">1x</span>
122
+ <span class="cline-any cline-yes">1x</span>
123
+ <span class="cline-any cline-yes">1x</span>
124
+ <span class="cline-any cline-yes">2x</span>
125
+ <span class="cline-any cline-yes">2x</span>
126
+ <span class="cline-any cline-yes">2x</span>
127
+ <span class="cline-any cline-yes">2x</span>
128
+ <span class="cline-any cline-yes">2x</span>
129
+ <span class="cline-any cline-yes">2x</span>
130
+ <span class="cline-any cline-yes">2x</span>
131
+ <span class="cline-any cline-yes">2x</span>
132
+ <span class="cline-any cline-yes">2x</span>
133
+ <span class="cline-any cline-yes">2x</span>
134
+ <span class="cline-any cline-yes">2x</span>
135
+ <span class="cline-any cline-yes">2x</span>
136
+ <span class="cline-any cline-yes">2x</span>
137
+ <span class="cline-any cline-yes">2x</span>
138
+ <span class="cline-any cline-yes">1x</span>
139
+ <span class="cline-any cline-yes">1x</span>
140
+ <span class="cline-any cline-yes">2x</span>
141
+ <span class="cline-any cline-yes">2x</span>
142
+ <span class="cline-any cline-yes">2x</span>
143
+ <span class="cline-any cline-yes">2x</span>
144
+ <span class="cline-any cline-yes">1x</span>
145
+ <span class="cline-any cline-yes">1x</span>
146
+ <span class="cline-any cline-yes">1x</span>
147
+ <span class="cline-any cline-yes">1x</span>
148
+ <span class="cline-any cline-yes">1x</span>
149
+ <span class="cline-any cline-yes">1x</span>
150
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { registerVersion } from "@3cr/sdk-browser";
151
+ import { ComponentPublicInstance, createApp } from "vue";
152
+ import { registerPlugins } from "./src/plugins";
153
+ import { App as BrowserViewer } from "./src/main";
154
+ &nbsp;
155
+ export interface LoadViewerPayload {
156
+ Url: string;
157
+ DecryptionKey: MftpDecryptionKey;
158
+ }
159
+ export interface MftpDecryptionKey {
160
+ Key: string;
161
+ Iv: string;
162
+ }
163
+ &nbsp;
164
+ let mountedApp: ComponentPublicInstance | undefined = undefined;
165
+ &nbsp;
166
+ export async function registerViewer(version: string) {
167
+ const newElement = document.createElement("div");
168
+ &nbsp;
169
+ newElement.style.width = "0";
170
+ newElement.style.height = "0";
171
+ &nbsp;
172
+ document.body.appendChild(newElement);
173
+ &nbsp;
174
+ const app = createApp(BrowserViewer);
175
+ registerPlugins(app);
176
+ &nbsp;
177
+ mountedApp = app.mount(newElement);
178
+ await registerVersion(version);
179
+ }
180
+ &nbsp;
181
+ // TODO: accept callbacks for each function we want the parent to handle
182
+ export async function loadViewer(
183
+ payload: LoadViewerPayload | undefined = undefined
184
+ ): Promise&lt;void&gt; {
185
+ if (!mountedApp) {
186
+ throw new Error(
187
+ "Please call `registerViewer(version: string, idSelector: string)` first"
188
+ );
189
+ }
190
+ await (mountedApp as any).loadInstance(payload);
191
+ }
192
+ &nbsp;</pre></td></tr></table></pre>
193
+
194
+ <div class='push'></div><!-- for sticky footer -->
195
+ </div><!-- /wrapper -->
196
+ <div class='footer quiet pad2 space-top1 center small'>
197
+ Code coverage generated by
198
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
199
+ at 2024-04-09T08:33:16.899Z
200
+ </div>
201
+ <script src="../prettify.js"></script>
202
+ <script>
203
+ window.onload = function () {
204
+ prettyPrint();
205
+ };
206
+ </script>
207
+ <script src="../sorter.js"></script>
208
+ <script src="../block-navigation.js"></script>
209
+ </body>
210
+ </html>
211
+