@3cr/viewer-browser 0.0.144 → 0.0.146
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 +6 -3
- package/dist/Viewer3CR.umd.js +1 -1
- package/index.html +21 -3
- package/package.json +1 -1
- package/playground/index.html +22 -3
- package/src/demo/options.ts +2 -0
- package/src/models/LoadViewerOptions.ts +2 -0
package/index.html
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
|
|
8
8
|
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/npm/@statsig/js-client@latest/build/statsig-js-client+session-replay+web-analytics.min.js"></script>
|
|
10
|
+
<!-- <script src="https://cdn.jsdelivr.net/npm/statsig-js/build/statsig-prod-web-sdk.min.js" ></script>-->
|
|
9
11
|
|
|
10
12
|
<title>Welcome to Vuetify 3</title>
|
|
11
13
|
</head>
|
|
@@ -15,9 +17,25 @@
|
|
|
15
17
|
<script type="module">
|
|
16
18
|
import {registerViewer, loadViewer} from './index.ts';
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const { StatsigClient, runStatsigAutoCapture, runStatsigSessionReplay } = window.Statsig;
|
|
21
|
+
const client = new StatsigClient(
|
|
22
|
+
"client-YaAjxOTTRbuSN3peDAwXEzErieXpI744a3OHDgonzvV",
|
|
23
|
+
{ userID: undefined },
|
|
24
|
+
);
|
|
25
|
+
runStatsigAutoCapture(client);
|
|
26
|
+
window.playgroundStatsigClient = client
|
|
27
|
+
runStatsigSessionReplay(client);
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
const dynamicConfig = window.playgroundStatsigClient.getDynamicConfig("3cr_viewer_version");
|
|
31
|
+
const version = dynamicConfig.value["sdkVersion"] ?? "1.0.0";
|
|
32
|
+
|
|
33
|
+
client.initializeAsync().then(() => {
|
|
34
|
+
registerViewer(version).then(() => {
|
|
35
|
+
loadViewer().then()
|
|
36
|
+
})
|
|
37
|
+
}).catch((err) => console.error(err));
|
|
38
|
+
|
|
21
39
|
</script>
|
|
22
40
|
</body>
|
|
23
41
|
|
package/package.json
CHANGED
package/playground/index.html
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
<script src="https://cdn.jsdelivr.net/npm/@3cr/viewer-browser@{{version}}/dist/Viewer3CR.umd.js"> </script>
|
|
32
32
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
|
|
33
33
|
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
|
34
|
+
<script src="https://cdn.jsdelivr.net/npm/@statsig/js-client@latest/build/statsig-js-client+session-replay+web-analytics.min.js"></script>
|
|
34
35
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
35
36
|
<title>3CR Viewer Playground</title>
|
|
36
37
|
|
|
@@ -40,9 +41,27 @@
|
|
|
40
41
|
<div id="app"></div>
|
|
41
42
|
<script type="module">
|
|
42
43
|
|
|
43
|
-
window.
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const { StatsigClient, runStatsigAutoCapture, runStatsigSessionReplay } = window.Statsig;
|
|
45
|
+
const client = new StatsigClient(
|
|
46
|
+
"client-YaAjxOTTRbuSN3peDAwXEzErieXpI744a3OHDgonzvV",
|
|
47
|
+
{ userID: undefined },
|
|
48
|
+
);
|
|
49
|
+
runStatsigAutoCapture(client);
|
|
50
|
+
window.playgroundStatsigClient = client
|
|
51
|
+
runStatsigSessionReplay(client);
|
|
52
|
+
|
|
53
|
+
const dynamicConfig = window.playgroundStatsigClient.getDynamicConfig("3cr_viewer_version");
|
|
54
|
+
const version = dynamicConfig.value["sdkVersion"] ?? "1.0.0";
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
client.initializeAsync().initialize(
|
|
58
|
+
"client-YaAjxOTTRbuSN3peDAwXEzErieXpI744a3OHDgonzvV",
|
|
59
|
+
).then(() => {
|
|
60
|
+
window.registerViewer(version).then(() => {
|
|
61
|
+
window.loadViewer().then()
|
|
62
|
+
})
|
|
63
|
+
}).catch((err) => console.error(err));
|
|
64
|
+
|
|
46
65
|
</script>
|
|
47
66
|
</body>
|
|
48
67
|
|
package/src/demo/options.ts
CHANGED
|
@@ -71,6 +71,7 @@ export const demoLicenceOptions: LoadViewerOptions = {
|
|
|
71
71
|
// m_demo.value = true;
|
|
72
72
|
},
|
|
73
73
|
OnScreenshot: undefined,
|
|
74
|
+
OnErrorClose: () => Promise.resolve(),
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
export const demoPatientOptions: LoadViewerOptions = {
|
|
@@ -132,6 +133,7 @@ export const demoPatientOptions: LoadViewerOptions = {
|
|
|
132
133
|
// m_demoPatient.value = true;
|
|
133
134
|
},
|
|
134
135
|
OnScreenshot: undefined,
|
|
136
|
+
OnErrorClose: () => Promise.resolve(),
|
|
135
137
|
};
|
|
136
138
|
|
|
137
139
|
const optionalTypes = ["licence", "patient"];
|
|
@@ -11,6 +11,7 @@ export interface LoadViewerOptions {
|
|
|
11
11
|
OnSaveSession?: ViewerCallback | ViewerAsyncCallback | undefined;
|
|
12
12
|
OnClosePopup?: ViewerCallback | ViewerAsyncCallback | undefined;
|
|
13
13
|
OnExitViewer?: ViewerCallback | ViewerAsyncCallback | undefined;
|
|
14
|
+
OnErrorClose?: ViewerCallback | ViewerAsyncCallback | undefined;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export const defaultLoadViewerOptions: LoadViewerOptions = {
|
|
@@ -24,4 +25,5 @@ export const defaultLoadViewerOptions: LoadViewerOptions = {
|
|
|
24
25
|
OnShareToMobile: () => Promise.resolve(),
|
|
25
26
|
OnShare: () => Promise.resolve(),
|
|
26
27
|
OnScreenshot: () => Promise.resolve(),
|
|
28
|
+
OnErrorClose: () => Promise.resolve(),
|
|
27
29
|
};
|