@3cr/viewer-browser 0.0.1

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 (49) hide show
  1. package/.browserslistrc +4 -0
  2. package/.editorconfig +5 -0
  3. package/.idea/git_toolbox_prj.xml +15 -0
  4. package/.idea/vcs.xml +6 -0
  5. package/.idea/workspace.xml +183 -0
  6. package/.vite/deps/_metadata.json +8 -0
  7. package/.vite/deps/package.json +3 -0
  8. package/README.md +81 -0
  9. package/components.d.ts +19 -0
  10. package/dist/3cr-viewer-browser.mjs +18644 -0
  11. package/dist/3cr-viewer-browser.umd.js +18 -0
  12. package/dist/style.css +5 -0
  13. package/index.html +24 -0
  14. package/index.ts +37 -0
  15. package/package.json +41 -0
  16. package/src/App.vue +40 -0
  17. package/src/assets/images/MainBackdrop.svg +48 -0
  18. package/src/assets/images/dark/3DICOM.png +0 -0
  19. package/src/assets/images/dark/3dicom-logo.svg +1 -0
  20. package/src/assets/images/dark/Singular-Health-Disc-Mono.svg +9 -0
  21. package/src/assets/images/dark/Singular-Health-Trademark-mono.svg +23 -0
  22. package/src/assets/images/light/3DICOM.png +0 -0
  23. package/src/assets/images/light/3dicom-logo.svg +1 -0
  24. package/src/assets/images/light/Singular-Health-Disc-Mono.svg +9 -0
  25. package/src/assets/images/light/Singular-Health-Trademark-mono.svg +23 -0
  26. package/src/assets/logo.png +0 -0
  27. package/src/assets/logo.svg +6 -0
  28. package/src/components/DoubleSliderSelector.vue +112 -0
  29. package/src/components/ExpansionHeaderMiniMenu.vue +19 -0
  30. package/src/components/HelloWorld.vue +157 -0
  31. package/src/components/LoadingSpinner.vue +157 -0
  32. package/src/components/MftpWebGL3DRModal.vue +995 -0
  33. package/src/components/README.md +35 -0
  34. package/src/components/SliderSelector.vue +101 -0
  35. package/src/components/VerticalSliderSelector.vue +83 -0
  36. package/src/components/WebGL3DR.vue +107 -0
  37. package/src/helpers/layoutOverlayStyle.ts +86 -0
  38. package/src/helpers/modelHelper.ts +109 -0
  39. package/src/helpers/models.ts +69 -0
  40. package/src/helpers/utils.ts +16 -0
  41. package/src/main.ts +23 -0
  42. package/src/plugins/README.md +3 -0
  43. package/src/plugins/index.ts +15 -0
  44. package/src/plugins/vuetify.ts +27 -0
  45. package/src/types/window.shim.ts +24 -0
  46. package/src/vite-env.d.ts +7 -0
  47. package/tsconfig.json +34 -0
  48. package/tsconfig.node.json +9 -0
  49. package/vite.config.mts +74 -0
@@ -0,0 +1,24 @@
1
+ export {};
2
+
3
+ declare global {
4
+ interface Window {
5
+ createUnityInstance(element: HTMLElement, config: UnityConfig): Promise<UnityInstance>;
6
+ receiveMessageFromUnity(payload: string): void;
7
+ }
8
+ }
9
+ export interface UnityInstance {
10
+ SendMessage: (payload: string) => void;
11
+ }
12
+ export interface UnityConfig {
13
+ dataUrl: string;
14
+ frameworkUrl: string;
15
+ codeUrl: string;
16
+ streamingAssetsUrl: string;
17
+ companyName: string;
18
+ productName: string;
19
+ productVersion: string;
20
+ webglContextAttributes: WebglConfig;
21
+ }
22
+ export interface WebglConfig {
23
+ preserveDrawingBuffer: boolean;
24
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue'
5
+ const component: DefineComponent<{}, {}, any>
6
+ export default component
7
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
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
+
11
+ "baseUrl": ".",
12
+ "module": "ESNext",
13
+ "moduleResolution": "node",
14
+ "paths": {
15
+ "@/*": ["src/*"]
16
+ },
17
+ "resolveJsonModule": true,
18
+
19
+ "allowJs": true,
20
+ "strict": true,
21
+ "strictNullChecks": true,
22
+ "noUnusedLocals": true,
23
+ "esModuleInterop": true,
24
+ "forceConsistentCasingInFileNames": true,
25
+ "isolatedModules": false,
26
+ "skipLibCheck": true
27
+ },
28
+ "include": [
29
+ "./src/typed-router.d.ts",
30
+ "**/*.vue"
31
+ ],
32
+ "exclude": ["dist", "node_modules", "cypress"],
33
+ "references": [{ "path": "./tsconfig.node.json" }]
34
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "module": "ESNext",
5
+ "moduleResolution": "Node",
6
+ "allowSyntheticDefaultImports": true
7
+ },
8
+ "include": ["vite.config.mts"]
9
+ }
@@ -0,0 +1,74 @@
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'
6
+
7
+ // Utilities
8
+ import { defineConfig } from 'vite'
9
+ import { fileURLToPath, URL } from 'node:url'
10
+ import {resolve} from "node:dns";
11
+
12
+ // https://vitejs.dev/config/
13
+ export default defineConfig({
14
+ plugins: [
15
+ Vue({
16
+ template: { transformAssetUrls },
17
+ }),
18
+ // https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme
19
+ Vuetify(),
20
+ Components(),
21
+ ViteFonts({
22
+ google: {
23
+ families: [{
24
+ name: 'Roboto',
25
+ styles: 'wght@100;300;400;500;700;900',
26
+ }],
27
+ },
28
+ }),
29
+ ],
30
+ define: { 'process.env': {} },
31
+ build: {
32
+ lib: { // tell the build process to treat this project as library
33
+ entry: './index.ts',
34
+ name: '@3cr/viewer-browser',
35
+ fileName: "3cr-viewer-browser",
36
+ },
37
+ rollupOptions: {
38
+ // make sure to externalize deps that shouldn't be bundled
39
+ // into your library
40
+ external: [
41
+ // "vue",
42
+ // "vuetify",
43
+ // "vite/client",
44
+ // "vite-plugin-vue-layouts/client",
45
+ // "unplugin-vue-router/client"
46
+ ],
47
+ output: {
48
+ // Provide global variables to use in the UMD build
49
+ // for externalized deps
50
+ globals: {
51
+ vue: 'Vue',
52
+ },
53
+ },
54
+ },
55
+
56
+ },
57
+ resolve: {
58
+ alias: {
59
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
60
+ },
61
+ extensions: [
62
+ '.js',
63
+ '.json',
64
+ '.jsx',
65
+ '.mjs',
66
+ '.ts',
67
+ '.tsx',
68
+ '.vue',
69
+ ],
70
+ },
71
+ server: {
72
+ port: 3000,
73
+ },
74
+ })