@geode/opengeodeweb-front 9.1.1-rc.1 → 9.2.0-rc.2

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.
@@ -26,7 +26,9 @@
26
26
  class="pa-0"
27
27
  @click="get_x_y"
28
28
  @keydown.esc="app_store.toggle_picking_mode(false)"
29
- />
29
+ >
30
+ <slot name="ui"></slot>
31
+ </v-col>
30
32
  </div>
31
33
  </ClientOnly>
32
34
  </template>
@@ -0,0 +1,117 @@
1
+ <template>
2
+ <v-sheet
3
+ v-if="props.show_dialog"
4
+ :width="props.width + 'px'"
5
+ class="screenshot_menu"
6
+ border="md"
7
+ >
8
+ <v-card class="bg-primary pa-0">
9
+ <v-card-title>
10
+ <h3 class="mt-4">Take a screenshot</h3>
11
+ </v-card-title>
12
+ <v-card-text class="pa-0">
13
+ <v-container>
14
+ <v-row>
15
+ <v-col cols="8" class="py-0">
16
+ <v-text-field v-model="filename" label="File name"></v-text-field>
17
+ </v-col>
18
+ <v-col cols="4" class="py-0">
19
+ <v-select
20
+ v-model="output_extension"
21
+ :items="output_extensions"
22
+ label="Extension"
23
+ required
24
+ />
25
+ </v-col>
26
+ </v-row>
27
+
28
+ <v-row>
29
+ <v-col cols="12" class="py-0">
30
+ <v-switch
31
+ v-model="include_background"
32
+ :disabled="output_extension !== 'png'"
33
+ label="Include background"
34
+ inset
35
+ ></v-switch>
36
+ </v-col>
37
+ </v-row>
38
+ </v-container>
39
+ </v-card-text>
40
+ <v-card-actions justify-center>
41
+ <v-btn
42
+ variant="outlined"
43
+ color="white"
44
+ text
45
+ @click="emit('close')"
46
+ class="ml-8 mb-4"
47
+ >Close</v-btn
48
+ >
49
+ <v-btn
50
+ variant="outlined"
51
+ class="mb-4"
52
+ :disabled="!filename || !output_extension"
53
+ color="white"
54
+ text
55
+ @click="takeScreenshot()"
56
+ >Screenshot</v-btn
57
+ >
58
+ </v-card-actions>
59
+ </v-card>
60
+ </v-sheet>
61
+ </template>
62
+
63
+ <script setup>
64
+ import fileDownload from "js-file-download"
65
+ import viewer_schemas from "@geode/opengeodeweb-viewer/schemas.json"
66
+
67
+ const emit = defineEmits(["close"])
68
+
69
+ const props = defineProps({
70
+ show_dialog: { type: Boolean, required: true },
71
+ width: { type: Number, required: false, default: 400 },
72
+ })
73
+
74
+ const output_extensions =
75
+ viewer_schemas.opengeodeweb_viewer.take_screenshot.properties
76
+ .output_extension.enum
77
+ const filename = ref("")
78
+ const output_extension = ref("png")
79
+ const include_background = ref(true)
80
+
81
+ async function takeScreenshot() {
82
+ await viewer_call(
83
+ {
84
+ schema: viewer_schemas.opengeodeweb_viewer.take_screenshot,
85
+ params: {
86
+ filename: filename.value,
87
+ output_extension: output_extension.value,
88
+ include_background: include_background.value,
89
+ },
90
+ },
91
+ {
92
+ response_function: async (response) => {
93
+ fileDownload(
94
+ response.blob,
95
+ filename.value + "." + output_extension.value,
96
+ )
97
+ },
98
+ },
99
+ )
100
+ emit("close")
101
+ }
102
+
103
+ watch(output_extension, (value) => {
104
+ if (value !== "png") {
105
+ include_background.value = true
106
+ }
107
+ })
108
+ </script>
109
+
110
+ <style scoped>
111
+ .screenshot_menu {
112
+ position: absolute;
113
+ z-index: 2;
114
+ top: 90px;
115
+ right: 55px;
116
+ }
117
+ </style>
@@ -1,26 +1,48 @@
1
1
  <template>
2
- <v-row dense :class="[$style.floatToolbar, 'flex-column']">
3
- <v-col>
4
- <v-btn
5
- density="comfortable"
6
- icon
7
- @click.stop="reset_camera"
8
- v-tooltip:left="'Reset camera'"
9
- >
10
- <v-icon icon="mdi-cube-scan" size="32" />
11
- </v-btn>
12
- </v-col>
13
- </v-row>
2
+ <v-container :class="[$style.floatToolbar, 'pa-0']" width="auto">
3
+ <v-row
4
+ v-for="camera_option in camera_options"
5
+ :key="camera_option.icon"
6
+ dense
7
+ >
8
+ <v-col>
9
+ <v-btn
10
+ density="comfortable"
11
+ icon
12
+ @click.stop="camera_option.action"
13
+ v-tooltip:left="camera_option.tooltip"
14
+ >
15
+ <v-icon :icon="camera_option.icon" size="32" />
16
+ </v-btn>
17
+ </v-col>
18
+ </v-row>
19
+ </v-container>
20
+ <Screenshot :show_dialog="take_screenshot" @close="take_screenshot = false" />
14
21
  </template>
15
22
 
16
23
  <script setup>
17
24
  import schemas from "@geode/opengeodeweb-viewer/schemas.json"
18
25
 
19
- function reset_camera() {
20
- viewer_call({
21
- schema: schemas.opengeodeweb_viewer.reset_camera,
22
- })
23
- }
26
+ const take_screenshot = ref(false)
27
+
28
+ const camera_options = [
29
+ {
30
+ tooltip: "Reset camera",
31
+ icon: "mdi-cube-scan",
32
+ action: () => {
33
+ viewer_call({
34
+ schema: schemas.opengeodeweb_viewer.reset_camera,
35
+ })
36
+ },
37
+ },
38
+ {
39
+ tooltip: "Take a screenshot",
40
+ icon: "mdi-camera",
41
+ action: () => {
42
+ take_screenshot.value = !take_screenshot.value
43
+ },
44
+ },
45
+ ]
24
46
  </script>
25
47
 
26
48
  <style module>
@@ -29,7 +51,6 @@
29
51
  z-index: 2;
30
52
  right: 20px;
31
53
  top: 20px;
32
- background-color: rgba(0, 0, 0, 0.4);
33
- border-radius: 16px;
54
+ background-color: rgba(0, 0, 0, 0);
34
55
  }
35
56
  </style>
package/nuxt.config.js CHANGED
@@ -36,12 +36,13 @@ export default defineNuxtConfig({
36
36
  vite: {
37
37
  optimizeDeps: {
38
38
  include: [
39
- "is-electron",
40
- "fast-deep-equal",
41
- "seedrandom",
42
- "lodash",
43
39
  "ajv",
40
+ "fast-deep-equal",
44
41
  "globalthis",
42
+ "is-electron",
43
+ "js-file-download",
44
+ "lodash",
45
+ "seedrandom",
45
46
  ],
46
47
  },
47
48
  },
package/package.json CHANGED
@@ -37,11 +37,11 @@
37
37
  },
38
38
  "description": "OpenSource Vue/Vuetify framework for web applications",
39
39
  "type": "module",
40
- "version": "9.1.1-rc.1",
40
+ "version": "9.2.0-rc.2",
41
41
  "main": "./nuxt.config.js",
42
42
  "dependencies": {
43
- "@geode/opengeodeweb-back": "5.3.0",
44
- "@geode/opengeodeweb-viewer": "0.2.0",
43
+ "@geode/opengeodeweb-back": "5.3.1",
44
+ "@geode/opengeodeweb-viewer": "0.3.0",
45
45
  "@kitware/vtk.js": "30.3.1",
46
46
  "@mdi/font": "^7.4.47",
47
47
  "@pinia/nuxt": "^0.5.4",
@@ -50,6 +50,7 @@
50
50
  "@vueuse/nuxt": "^11.0.3",
51
51
  "ajv": "^8.17.1",
52
52
  "is-electron": "^2.2.2",
53
+ "js-file-download": "^0.4.12",
53
54
  "pinia": "^2.2.2",
54
55
  "sass": "^1.77.8",
55
56
  "semver": "^7.6.3",