@3cr/viewer-browser 0.0.109 → 0.0.112
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 +11 -11
- package/dist/Viewer3CR.mjs +1838 -1813
- package/dist/Viewer3CR.umd.js +11 -11
- package/index.ts +11 -1
- package/package.json +1 -1
- package/src/plugins/vuetify.ts +30 -5
package/index.ts
CHANGED
|
@@ -7,10 +7,16 @@ import {
|
|
|
7
7
|
LoadViewerOptions,
|
|
8
8
|
} from "@/models/LoadViewerOptions";
|
|
9
9
|
import { LoadViewerPayload } from "@/models/LoadViewerPayload";
|
|
10
|
+
import { disableTheme } from "@/plugins/vuetify";
|
|
10
11
|
|
|
11
12
|
let mountedApp: ComponentPublicInstance | undefined = undefined;
|
|
12
13
|
|
|
13
|
-
export async function registerViewer(
|
|
14
|
+
export async function registerViewer(
|
|
15
|
+
version: string,
|
|
16
|
+
options = {
|
|
17
|
+
disableTheme: false,
|
|
18
|
+
}
|
|
19
|
+
) {
|
|
14
20
|
const newElement = document.createElement("div");
|
|
15
21
|
|
|
16
22
|
newElement.style.width = "0";
|
|
@@ -20,6 +26,10 @@ export async function registerViewer(version: string) {
|
|
|
20
26
|
document.body.appendChild(newElement);
|
|
21
27
|
|
|
22
28
|
const app = createApp(BrowserViewer);
|
|
29
|
+
if (options.disableTheme) {
|
|
30
|
+
disableTheme.value = true;
|
|
31
|
+
}
|
|
32
|
+
|
|
23
33
|
registerPlugins(app);
|
|
24
34
|
|
|
25
35
|
mountedApp = app.mount(newElement);
|
package/package.json
CHANGED
package/src/plugins/vuetify.ts
CHANGED
|
@@ -12,19 +12,44 @@ import { createVuetify, IconProps } from "vuetify";
|
|
|
12
12
|
import { aliases, md } from "vuetify/iconsets/md";
|
|
13
13
|
import { mdi } from "vuetify/iconsets/mdi";
|
|
14
14
|
import { fa } from "vuetify/iconsets/fa";
|
|
15
|
-
import { h } from "vue";
|
|
15
|
+
import { h, ref } from "vue";
|
|
16
16
|
import liver from "@/components/icons/liver.vue";
|
|
17
17
|
|
|
18
18
|
const customComponents: any = {
|
|
19
19
|
liver,
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
export const disableTheme = ref<boolean>(false);
|
|
22
22
|
// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
|
|
23
23
|
/* istanbul ignore next -- @preserve */
|
|
24
24
|
export default createVuetify({
|
|
25
|
-
theme:
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
theme: disableTheme.value
|
|
26
|
+
? false
|
|
27
|
+
: {
|
|
28
|
+
defaultTheme: "__light",
|
|
29
|
+
themes: {
|
|
30
|
+
__light: {
|
|
31
|
+
dark: false,
|
|
32
|
+
colors: {
|
|
33
|
+
background: "#FFFFFF",
|
|
34
|
+
surface: "#FFFFFF",
|
|
35
|
+
"surface-bright": "#FFFFFF",
|
|
36
|
+
"surface-light": "#EEEEEE",
|
|
37
|
+
"surface-variant": "#424242",
|
|
38
|
+
"on-surface-variant": "#EEEEEE",
|
|
39
|
+
primary: "#1867C0",
|
|
40
|
+
"primary-darken-1": "#1F5592",
|
|
41
|
+
secondary: "#48A9A6",
|
|
42
|
+
"secondary-darken-1": "#018786",
|
|
43
|
+
error: "#B00020",
|
|
44
|
+
info: "#2196F3",
|
|
45
|
+
success: "#4CAF50",
|
|
46
|
+
warning: "#FB8C00",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
light: {},
|
|
50
|
+
dark: {},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
28
53
|
icons: {
|
|
29
54
|
defaultSet: "md",
|
|
30
55
|
aliases,
|