@abi-software/scaffoldvuer 1.8.1-beta.4 → 1.9.0-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "1.8.1-beta.4",
3
+ "version": "1.9.0-beta.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,7 +41,7 @@
41
41
  "*.js"
42
42
  ],
43
43
  "dependencies": {
44
- "@abi-software/map-utilities": "^1.4.3-beta.3",
44
+ "@abi-software/map-utilities": "^1.5.0-beta.0",
45
45
  "@abi-software/sparc-annotation": "^0.3.2",
46
46
  "@abi-software/svg-sprite": "^1.0.1",
47
47
  "@element-plus/icons-vue": "^2.3.1",
@@ -54,7 +54,7 @@
54
54
  "vue": "^3.4.21",
55
55
  "vue-router": "^4.2.5",
56
56
  "vue3-component-svg-sprite": "^0.0.1",
57
- "zincjs": "^1.12.4"
57
+ "zincjs": "^1.13.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@vitejs/plugin-vue": "^4.6.2",
package/src/App.vue CHANGED
@@ -156,6 +156,36 @@
156
156
  </el-col>
157
157
  </el-row>
158
158
 
159
+ <el-row :gutter="20" justify="center" align="middle">
160
+ <el-col :span="auto">
161
+ <el-button size="small" @click="() => fitBoundingBox=!fitBoundingBox">
162
+ {{ fitBoundingBox ? 'Unfit' : 'Fit' }} BoundingBox
163
+ </el-button>
164
+ </el-col>
165
+ <el-col :span="auto">
166
+ <el-button-group>
167
+ <el-button size="small" @click="createAxisDisplay('axes', fitBoundingBox)">
168
+ Create Axes CoordSystem
169
+ </el-button>
170
+ </el-button-group>
171
+ </el-col>
172
+ <el-col :span="auto">
173
+ <el-button-group>
174
+ <el-button size="small" @click="enableAxisDisplay(true, false)">
175
+ Enable CoordSystem
176
+ </el-button>
177
+ <el-button size="small" @click="enableAxisDisplay(true, true )">
178
+ Enable MiniAxes CoordSystem
179
+ </el-button>
180
+ </el-button-group>
181
+ </el-col>
182
+ <el-col :span="auto">
183
+ <el-button size="small" @click="enableAxisDisplay(false, false)">
184
+ Disable CoordSystem
185
+ </el-button>
186
+ </el-col>
187
+ </el-row>
188
+
159
189
  <el-row justify="center" align="middle">
160
190
  <el-col>
161
191
  <el-row :gutter="20" justify="center" align="middle">
@@ -417,6 +447,7 @@ export default {
417
447
  ElIconFolderOpened: shallowRef(ElIconFolderOpened),
418
448
  auto: NaN,
419
449
  annotator: markRaw(new AnnotationService(`https://mapcore-demo.org/devel/flatmap/v4/annotator`)),
450
+ fitBoundingBox: false
420
451
  };
421
452
  },
422
453
  watch: {
@@ -472,6 +503,12 @@ export default {
472
503
  this.$refs.dropzone.revokeURLs();
473
504
  },
474
505
  methods: {
506
+ enableAxisDisplay: function (enable, miniaxes) {
507
+ this.$refs.scaffold.enableAxisDisplay(enable, miniaxes);
508
+ },
509
+ createAxisDisplay: function (type, fitBoundingBox) {
510
+ this.$refs.scaffold.createAxisDisplay(fitBoundingBox);
511
+ },
475
512
  exportGLTF: function () {
476
513
  this.$refs.scaffold.exportGLTF(false).then((data) => {
477
514
  const filename = 'export' + JSON.stringify(new Date()) + '.gltf';
@@ -314,7 +314,7 @@
314
314
  {{ modeDescription }}
315
315
  </el-row>
316
316
  <el-row v-if="viewingMode === 'Annotation' && offlineAnnotationEnabled" class="viewing-mode-description">
317
- (Offline annotate)
317
+ (Anonymous annotate)
318
318
  </el-row>
319
319
  </el-row>
320
320
  <el-row class="backgroundSpacer"></el-row>
@@ -976,6 +976,16 @@ export default {
976
976
  },
977
977
  },
978
978
  methods: {
979
+ enableAxisDisplay: function (enable, miniaxes) {
980
+ if (this.$module.scene) {
981
+ this.$module.scene.enableAxisDisplay(enable, miniaxes);
982
+ }
983
+ },
984
+ createAxisDisplay: function (fit) {
985
+ if (this.$module.scene) {
986
+ this.$module.scene.createAxisDisplay(fit);
987
+ }
988
+ },
979
989
  /**
980
990
  * @public
981
991
  * Call this to manually add a zinc object into the current scene.
@@ -1120,9 +1130,9 @@ export default {
1120
1130
  regionPath = regionPath.slice(0, -1);
1121
1131
  }
1122
1132
  annotation.region = regionPath;
1123
- this.offlineAnnotations = JSON.parse(sessionStorage.getItem('offline-annotation')) || [];
1133
+ this.offlineAnnotations = JSON.parse(sessionStorage.getItem('anonymous-annotation')) || [];
1124
1134
  this.offlineAnnotations.push(annotation);
1125
- sessionStorage.setItem('offline-annotation', JSON.stringify(this.offlineAnnotations));
1135
+ sessionStorage.setItem('anonymous-annotation', JSON.stringify(this.offlineAnnotations));
1126
1136
  }
1127
1137
  this.$emit('userPrimitivesUpdated', {region, group, zincObject});
1128
1138
  },
@@ -1220,9 +1230,9 @@ export default {
1220
1230
  if (this.offlineAnnotationEnabled) {
1221
1231
  annotation.group = this._editingZincObject.groupName;;
1222
1232
  annotation.region = this._editingZincObject.region.getFullPath();
1223
- this.offlineAnnotations = JSON.parse(sessionStorage.getItem('offline-annotation')) || [];
1233
+ this.offlineAnnotations = JSON.parse(sessionStorage.getItem('anonymous-annotation')) || [];
1224
1234
  this.offlineAnnotations.push(annotation);
1225
- sessionStorage.setItem('offline-annotation', JSON.stringify(this.offlineAnnotations));
1235
+ sessionStorage.setItem('anonymous-annotation', JSON.stringify(this.offlineAnnotations));
1226
1236
  }
1227
1237
  }
1228
1238
  },
@@ -1242,9 +1252,9 @@ export default {
1242
1252
  const childRegion = this.$module.scene.getRootRegion().findChildFromPath(regionPath);
1243
1253
  childRegion.removeZincObject(this._editingZincObject);
1244
1254
  if (this.offlineAnnotationEnabled) {
1245
- this.offlineAnnotations = JSON.parse(sessionStorage.getItem('offline-annotation')) || [];
1255
+ this.offlineAnnotations = JSON.parse(sessionStorage.getItem('anonymous-annotation')) || [];
1246
1256
  this.offlineAnnotations = this.offlineAnnotations.filter(offline => offline.item.id !== annotation.item.id);
1247
- sessionStorage.setItem('offline-annotation', JSON.stringify(this.offlineAnnotations));
1257
+ sessionStorage.setItem('anonymous-annotation', JSON.stringify(this.offlineAnnotations));
1248
1258
  }
1249
1259
  }
1250
1260
  }
@@ -2023,7 +2033,7 @@ export default {
2023
2033
  addAnnotationFeature: async function () {
2024
2034
  let drawnFeatures;
2025
2035
  if (this.offlineAnnotationEnabled) {
2026
- this.offlineAnnotations = JSON.parse(sessionStorage.getItem('offline-annotation')) || [];
2036
+ this.offlineAnnotations = JSON.parse(sessionStorage.getItem('anonymous-annotation')) || [];
2027
2037
  drawnFeatures = this.offlineAnnotations.filter((offline) => {
2028
2038
  return offline.resource === this.url && offline.feature.properties.drawn;
2029
2039
  }).map(offline => offline.feature);
@@ -2258,7 +2268,7 @@ export default {
2258
2268
  this.backgroundChangeCallback(options.background);
2259
2269
  }
2260
2270
  if (options.offlineAnnotations) {
2261
- sessionStorage.setItem('offline-annotation', options.offlineAnnotations);
2271
+ sessionStorage.setItem('anonymous-annotation', options.offlineAnnotations);
2262
2272
  }
2263
2273
  if (options.viewingMode) {
2264
2274
  this.changeViewingMode(options.viewingMode);
@@ -2302,6 +2312,8 @@ export default {
2302
2312
  this.boundingDims.centre = centre;
2303
2313
  this.boundingDims.size = size;
2304
2314
  this.$nextTick(() => this.restoreSettings(options) );
2315
+ //this.$module.scene.createAxisDisplay(false);
2316
+ //this.$module.scene.enableAxisDisplay(true, true);
2305
2317
  this.isReady = true;
2306
2318
  };
2307
2319
  },
@@ -2330,7 +2342,7 @@ export default {
2330
2342
  state.search = {...this.lastSelected};
2331
2343
  }
2332
2344
  if (this.offlineAnnotationEnabled) {
2333
- state.offlineAnnotations = sessionStorage.getItem('offline-annotation');
2345
+ state.offlineAnnotations = sessionStorage.getItem('anonymous-annotation');
2334
2346
  }
2335
2347
  return state;
2336
2348
  },
@@ -2349,7 +2361,7 @@ export default {
2349
2361
  viewport: state.viewport,
2350
2362
  visibility: state.visibility,
2351
2363
  background: state.background,
2352
- viewingMode: this.viewingMode,
2364
+ viewingMode: state.viewingMode,
2353
2365
  search: state.search,
2354
2366
  offlineAnnotations: state.offlineAnnotations,
2355
2367
  });
@@ -2420,7 +2432,7 @@ export default {
2420
2432
  annotationsList.forEach((annotation) => {
2421
2433
  this.offlineAnnotations.push({...annotation});
2422
2434
  });
2423
- sessionStorage.setItem('offline-annotation', JSON.stringify(this.offlineAnnotations));
2435
+ sessionStorage.setItem('anonymous-annotation', JSON.stringify(this.offlineAnnotations));
2424
2436
  }
2425
2437
  },
2426
2438
 
@@ -0,0 +1,36 @@
1
+ import { defineConfig } from 'vite'
2
+ import rootConfig from './vite.config.js'
3
+ import { nodePolyfills } from 'vite-plugin-node-polyfills'
4
+ import vue from '@vitejs/plugin-vue'
5
+
6
+ // defineWorkspace provides a nice type hinting DX
7
+ export default defineConfig((configEnv) => {
8
+ const config = rootConfig(configEnv);
9
+ config.css.extract = false
10
+ config.plugins.push(
11
+ nodePolyfills({
12
+ // To add only specific polyfills, add them here. If no option is passed, adds all polyfills
13
+ include: ['path']
14
+ })
15
+ );
16
+ // config.plugins.push(
17
+ // cssInjectedByJsPlugin()
18
+ // );
19
+ config.plugins[0] = vue({
20
+ template: {
21
+ compilerOptions: {
22
+ isCustomElement: (tag) => tag.includes('scaffoldvuer-wc')
23
+ }
24
+ }
25
+ }),
26
+ config.build = {
27
+ lib: {
28
+ entry: './src/ScaffoldVuer-wc.js',
29
+ name: 'scaffoldvuer-wc',
30
+ // the proper extensions will be added
31
+ fileName: 'scaffoldvuer-wc'
32
+ },
33
+ }
34
+
35
+ return config;
36
+ })