@3cr/viewer-browser 0.0.19 → 0.0.22
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.
- package/dist/Viewer3CR.js +1 -1
- package/dist/Viewer3CR.mjs +8 -6
- package/dist/Viewer3CR.umd.js +1 -1
- package/package.json +1 -1
- package/playground/index.html +2 -2
- package/scripts/postPublish.js +2 -1
- package/scripts/postPublish.ts +3 -1
- package/src/App.vue +15 -6
package/package.json
CHANGED
package/playground/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8" />
|
|
6
6
|
<link rel="icon" href="/favicon.ico" />
|
|
7
|
-
<script src="https://cdn.jsdelivr.net/npm/@3cr/viewer-browser@
|
|
7
|
+
<script src="https://cdn.jsdelivr.net/npm/@3cr/viewer-browser@{{version}}/dist/Viewer3CR.umd.js"> </script>
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
9
9
|
<title>3CR Viewer Playground</title>
|
|
10
10
|
</head>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<body>
|
|
13
13
|
<div id="app"></div>
|
|
14
14
|
<script type="module">
|
|
15
|
-
window.registerViewer('1.0.
|
|
15
|
+
window.registerViewer('1.0.0_234', '#app').then(() => {
|
|
16
16
|
window.loadViewer().then()
|
|
17
17
|
})
|
|
18
18
|
</script>
|
package/scripts/postPublish.js
CHANGED
|
@@ -9,6 +9,7 @@ const path_1 = require("path");
|
|
|
9
9
|
const mime_types_1 = require("mime-types");
|
|
10
10
|
const fs_1 = require("fs");
|
|
11
11
|
const aws_sdk_1 = __importDefault(require("aws-sdk"));
|
|
12
|
+
const package_json_1 = require("../package.json");
|
|
12
13
|
const { CloudFront, S3 } = aws_sdk_1.default;
|
|
13
14
|
//Note: Config is injected in CI now. (leaving this for in case we need to do a local)
|
|
14
15
|
// import dotenv from 'dotenv';
|
|
@@ -45,7 +46,7 @@ async function executeUpload(s3Path, filePath) {
|
|
|
45
46
|
const options = {
|
|
46
47
|
Bucket: BucketName,
|
|
47
48
|
Key: `${bucketPath}`,
|
|
48
|
-
Body: (0, fs_1.readFileSync)(filePath),
|
|
49
|
+
Body: (0, fs_1.readFileSync)(filePath).toString().replace("{{version}}", package_json_1.version),
|
|
49
50
|
};
|
|
50
51
|
if (typeof (0, mime_types_1.lookup)(bucketPath) === 'string') {
|
|
51
52
|
options.ContentType = (0, mime_types_1.lookup)(bucketPath);
|
package/scripts/postPublish.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { join } from 'path';
|
|
|
4
4
|
import { lookup } from 'mime-types';
|
|
5
5
|
import { readdirSync, statSync, readFileSync } from 'fs';
|
|
6
6
|
import pkg from 'aws-sdk';
|
|
7
|
+
import {version} from '../package.json';
|
|
7
8
|
const { CloudFront, S3 } = pkg;
|
|
8
9
|
|
|
10
|
+
|
|
9
11
|
import { CreateInvalidationRequest } from 'aws-sdk/clients/cloudfront';
|
|
10
12
|
import {DeleteObjectsRequest, ListObjectsV2Request, PutObjectRequest } from 'aws-sdk/clients/s3';
|
|
11
13
|
|
|
@@ -46,7 +48,7 @@ async function executeUpload(s3Path: string, filePath: string) {
|
|
|
46
48
|
const options: PutObjectRequest = {
|
|
47
49
|
Bucket: BucketName,
|
|
48
50
|
Key: `${bucketPath}`,
|
|
49
|
-
Body: readFileSync(filePath),
|
|
51
|
+
Body: readFileSync(filePath).toString().replace("{{version}}", version),
|
|
50
52
|
};
|
|
51
53
|
if (typeof lookup(bucketPath) === 'string') {
|
|
52
54
|
options.ContentType = lookup(bucketPath) as string;
|
package/src/App.vue
CHANGED
|
@@ -10,13 +10,22 @@ import MftpWebGL3DRModal from "@/components/MftpWebGL3DRModal.vue";
|
|
|
10
10
|
import {ref, unref} from "vue";
|
|
11
11
|
import {LoadViewerPayload} from "../index";
|
|
12
12
|
|
|
13
|
-
const payload = ref<LoadViewerPayload>({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
// const payload = ref<LoadViewerPayload>({
|
|
14
|
+
// Url:"https://webgl-3dr.singular.health/test_scans/01440d4e-8b04-4b90-bb2c-698535ce16d6/CHEST.3vxl",
|
|
15
|
+
// DecryptionKey:{
|
|
16
|
+
// Iv:"XEloSh+OcO7TG77au6HjPw==",
|
|
17
|
+
// Key:"KUc722X1y4w42M+jCf9a3+6EGz66z7UMWK3m2aMqGxM="
|
|
18
|
+
// }
|
|
19
|
+
// });
|
|
20
|
+
const payload = ref<LoadViewerPayload>(
|
|
21
|
+
{
|
|
22
|
+
Url:"https://webgl-3dr.singular.health/test_scans/8bdddee1-e581-485d-827d-6aa12eef2fc8/Head+Axial+Axial.3vxl",
|
|
23
|
+
DecryptionKey: {
|
|
24
|
+
Iv:"x856FgjpYDsRhIa3BFj5cg==",
|
|
25
|
+
Key:"OWjSMiL/ewUV1V6fGybhKcTyiysTPsIMp2DjdVoOUGI="
|
|
26
|
+
}
|
|
18
27
|
}
|
|
19
|
-
|
|
28
|
+
);
|
|
20
29
|
const mftpWebGL3DRModal = ref<typeof MftpWebGL3DRModal | null>(null)
|
|
21
30
|
defineExpose({
|
|
22
31
|
loadInstance
|