@abi-software/scaffoldvuer 1.2.0-beta.0 → 1.2.1-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.
@@ -14,7 +14,7 @@
14
14
  :visible="tData.visible"
15
15
  :x="tData.x"
16
16
  :y="tData.y"
17
- :annotationDisplay="viewingMode === 'Annotation' && tData.active === true"
17
+ :annotationDisplay="viewingMode === 'Annotation' && tData.active === true && activeDrawMode === 'Edit'"
18
18
  @confirm-create="confirmCreate($event)"
19
19
  @cancel-create="cancelCreate()"
20
20
  />
@@ -26,78 +26,21 @@
26
26
  @keydown.66="backgroundChangeCallback"
27
27
  />
28
28
  <div v-show="displayUI && !isTransitioning">
29
- <div
30
- class="bottom-draw-control"
29
+ <DrawToolbar
31
30
  v-if="viewingMode === 'Annotation' && userInformation"
32
- >
33
- <el-popover
34
- content="Comment"
35
- placement="top"
36
- :teleported="false"
37
- trigger="manual"
38
- width="80"
39
- popper-class="flatmap-popper"
40
- ref="commentPopover"
41
- :visible="hoverVisibilities[9].value"
42
- >
43
- <template #reference>
44
- <map-svg-icon
45
- icon="comment"
46
- class="icon-button shape"
47
- :class="[createData.shape === '' ? 'active' : '']"
48
- @click="toggleDrawing('')"
49
- @mouseover="showHelpText(9)"
50
- @mouseout="hideHelpText(9)"
51
- />
52
- </template>
53
- </el-popover>
54
- <el-popover
55
- content="Draw Point"
56
- placement="top"
57
- :teleported="false"
58
- trigger="manual"
59
- width="80"
60
- popper-class="flatmap-popper"
61
- ref="drawPointPopover"
62
- :visible="hoverVisibilities[10].value"
63
- >
64
- <template #reference>
65
- <map-svg-icon
66
- icon="drawPoint"
67
- class="icon-button shape"
68
- :class="[createData.shape === 'Point' ? 'active' : '']"
69
- @click="toggleDrawing('Point')"
70
- @mouseover="showHelpText(10)"
71
- @mouseout="hideHelpText(10)"
72
- />
73
- </template>
74
- </el-popover>
75
- <el-popover
76
- content="Draw Line"
77
- placement="top"
78
- :teleported="false"
79
- trigger="manual"
80
- width="80"
81
- popper-class="flatmap-popper"
82
- ref="drawLinePopover"
83
- :visible="hoverVisibilities[11].value"
84
- >
85
- <template #reference>
86
- <map-svg-icon
87
- icon="drawLine"
88
- class="icon-button shape"
89
- :class="[createData.shape === 'Line' ? 'active' : '']"
90
- @click="toggleDrawing('Line')"
91
- @mouseover="showHelpText(11)"
92
- @mouseout="hideHelpText(11)"
93
- />
94
- </template>
95
- </el-popover>
96
- </div>
31
+ :toolbarOptions="toolbarOptions"
32
+ :activeDrawTool="activeDrawTool"
33
+ :activeDrawMode="activeDrawMode"
34
+ :hoverVisibilities=hoverVisibilities
35
+ @clickToolbar="toggleDrawing"
36
+ @showTooltip="showHelpText"
37
+ @hideTooltip="hideHelpText"
38
+ ref="toolbarPopover"
39
+ />
97
40
  <el-popover
98
41
  v-if="displayWarning"
99
42
  ref="warningPopover"
100
- :visible="hoverVisibilities[6].value"
43
+ :visible="hoverVisibilities[7].value"
101
44
  :content="warningMessage"
102
45
  placement="right"
103
46
  width="max-content"
@@ -108,8 +51,8 @@
108
51
  <div
109
52
  v-if="displayWarning"
110
53
  class="message-icon warning-icon"
111
- @mouseover="showHelpText(6)"
112
- @mouseout="hideHelpText(6)"
54
+ @mouseover="showHelpText(7)"
55
+ @mouseout="hideHelpText(7)"
113
56
  >
114
57
  <el-icon><el-icon-warning-filled /></el-icon>
115
58
  <span class="message-text">Beta</span>
@@ -118,7 +61,7 @@
118
61
  </el-popover>
119
62
  <el-popover
120
63
  v-if="displayLatestChanges"
121
- :visible="hoverVisibilities[7].value"
64
+ :visible="hoverVisibilities[8].value"
122
65
  :content="latestChangesMessage"
123
66
  placement="right"
124
67
  :teleported="false"
@@ -130,8 +73,8 @@
130
73
  <div
131
74
  v-if="displayLatestChanges && latestChangesMessage"
132
75
  class="el-icon-warning message-icon latest-changesicon"
133
- @mouseover="showHelpText(7)"
134
- @mouseout="hideHelpText(7)"
76
+ @mouseover="showHelpText(8)"
77
+ @mouseout="hideHelpText(8)"
135
78
  >
136
79
  <el-icon><el-icon-warning-filled /></el-icon>
137
80
  <span class="message-text">What's new?</span>
@@ -139,7 +82,7 @@
139
82
  </template>
140
83
  </el-popover>
141
84
  <el-popover
142
- :visible="hoverVisibilities[5].value"
85
+ :visible="hoverVisibilities[6].value"
143
86
  content="Change region visibility"
144
87
  placement="right"
145
88
  width="max-content"
@@ -149,9 +92,8 @@
149
92
  ref="regionVisibilityPopover"
150
93
  >
151
94
  <template #reference>
152
- <tree-controls
153
- ref="treeControls"
154
- :help-mode="helpMode"
95
+ <ScaffoldTreeControls
96
+ ref="scaffoldTreeControls"
155
97
  :isReady="isReady"
156
98
  :show-colour-picker="showColourPicker"
157
99
  @object-selected="objectSelected"
@@ -167,7 +109,7 @@
167
109
  v-if="timeVarying"
168
110
  ref="sliderPopover"
169
111
  width="max-content"
170
- :visible="hoverVisibilities[4].value"
112
+ :visible="hoverVisibilities[5].value"
171
113
  content="Move the slider to animate the region"
172
114
  placement="top"
173
115
  :teleported="false"
@@ -383,7 +325,7 @@
383
325
  >
384
326
  <el-row>
385
327
  <el-popover
386
- :visible="hoverVisibilities[8].value"
328
+ :visible="hoverVisibilities[3].value"
387
329
  content="Open new map"
388
330
  placement="right"
389
331
  :teleported="false"
@@ -398,15 +340,15 @@
398
340
  ref="openMapRef"
399
341
  icon="openMap"
400
342
  class="icon-button open-map-button"
401
- @mouseover="showHelpText(8)"
402
- @mouseout="hideHelpText(8)"
343
+ @mouseover="showHelpText(3)"
344
+ @mouseout="hideHelpText(3)"
403
345
  />
404
346
  </template>
405
347
  </el-popover>
406
348
  </el-row>
407
349
  <el-row>
408
350
  <el-popover
409
- :visible="hoverVisibilities[3].value"
351
+ :visible="hoverVisibilities[4].value"
410
352
  content="Change background color"
411
353
  placement="right"
412
354
  width="max-content"
@@ -420,8 +362,8 @@
420
362
  ref="backgroundIconRef"
421
363
  icon="changeBckgd"
422
364
  class="icon-button"
423
- @mouseover="showHelpText(3)"
424
- @mouseout="hideHelpText(3)"
365
+ @mouseover="showHelpText(4)"
366
+ @mouseout="hideHelpText(4)"
425
367
  />
426
368
  </template>
427
369
  </el-popover>
@@ -441,8 +383,10 @@ import {
441
383
  } from '@element-plus/icons-vue'
442
384
  import PrimitiveControls from "./PrimitiveControls.vue";
443
385
  import ScaffoldTooltip from "./ScaffoldTooltip.vue";
444
- import TreeControls from "./TreeControls.vue";
386
+ import ScaffoldTreeControls from "./ScaffoldTreeControls.vue";
445
387
  import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
388
+ import { DrawToolbar } from '@abi-software/map-utilities'
389
+ import '@abi-software/map-utilities/dist/style.css'
446
390
  import {
447
391
  addUserAnnotationWithFeature,
448
392
  annotationFeaturesToPrimitives,
@@ -495,10 +439,11 @@ export default {
495
439
  MapSvgSpriteColor,
496
440
  PrimitiveControls,
497
441
  ScaffoldTooltip,
498
- TreeControls,
499
442
  ElIconWarningFilled,
500
443
  ElIconArrowDown,
501
444
  ElIconArrowLeft,
445
+ DrawToolbar,
446
+ ScaffoldTreeControls
502
447
  },
503
448
  setup(props) {
504
449
  const annotator = markRaw(new AnnotationService(`${props.flatmapAPI}annotator`));
@@ -753,15 +698,15 @@ export default {
753
698
  { value: false, ref: 'zoomInPopover' }, // 0
754
699
  { value: false, ref: 'zoomOutPopover' }, // 1
755
700
  { value: false, ref: 'zoomFitPopover' }, // 2
756
- { value: false, ref: 'settingsPopover' }, // 3
757
- { value: false, ref: 'sliderPopover' }, // 4
758
- { value: false, ref: 'regionVisibilityPopover' }, // 5
759
- { value: false, ref: 'warningPopover' }, // 6
760
- { value: false, ref: 'whatsNewPopover' }, // 7
761
- { value: false, ref: 'openMapPopover' }, // 8
762
- { value: false, ref: 'commentPopover' }, //9
763
- { value: false, ref: 'drawPointPopover' }, //10
764
- { value: false, ref: 'drawLinePopover' }, //11
701
+ { value: false, ref: 'openMapPopover' }, // 3
702
+ { value: false, ref: 'settingsPopover' }, // 4
703
+ { value: false, ref: 'sliderPopover' }, // 5
704
+ { value: false, ref: 'regionVisibilityPopover' }, // 6
705
+ { value: false, ref: 'warningPopover' }, // 7
706
+ { value: false, ref: 'whatsNewPopover' }, // 8
707
+ { value: false, refs: 'toolbarPopover', ref: 'editPopover' }, // 9
708
+ { value: false, refs: 'toolbarPopover', ref: 'pointPopover' }, // 10
709
+ { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' }, // 11
765
710
  ],
766
711
  inHelp: false,
767
712
  helpModeActiveIndex: this.helpModeInitialIndex,
@@ -822,6 +767,13 @@ export default {
822
767
  openMapRef: undefined,
823
768
  backgroundIconRef: undefined,
824
769
  userInformation: undefined,
770
+ toolbarOptions: [
771
+ "Edit",
772
+ "Point",
773
+ "LineString",
774
+ ],
775
+ activeDrawTool: undefined,
776
+ activeDrawMode: undefined,
825
777
  };
826
778
  },
827
779
  watch: {
@@ -923,7 +875,7 @@ export default {
923
875
  mounted: function () {
924
876
  this.openMapRef = shallowRef(this.$refs.openMapRef);
925
877
  this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef);
926
- this.$refs.treeControls.setModule(this.$module);
878
+ this.$refs.scaffoldTreeControls.setModule(this.$module);
927
879
  let eventNotifier = new EventNotifier();
928
880
  eventNotifier.subscribe(this, this.eventNotifierCallback);
929
881
  this.$module.addNotifier(eventNotifier);
@@ -1037,7 +989,7 @@ export default {
1037
989
  * Function to clear current scene, the tree controls and the search index.
1038
990
  */
1039
991
  clearScene: function () {
1040
- if (this.$refs.treeControls) this.$refs.treeControls.clear();
992
+ if (this.$refs.scaffoldTreeControls) this.$refs.scaffoldTreeControls.clear();
1041
993
  if (this.$_searchIndex) this.$_searchIndex.removeAll();
1042
994
  if (this.$module.scene) this.$module.scene.clearAll();
1043
995
  },
@@ -1056,7 +1008,7 @@ export default {
1056
1008
  undefined,
1057
1009
  0x0022ee,
1058
1010
  );
1059
- } else if (payload.shape === "Line") {
1011
+ } else if (payload.shape === "LineString") {
1060
1012
  object = this.$module.scene.createLines(
1061
1013
  payload.region,
1062
1014
  payload.group,
@@ -1191,12 +1143,14 @@ export default {
1191
1143
  *
1192
1144
  * @vuese
1193
1145
  */
1194
- toggleDrawing: function (shapeName) {
1195
- if (shapeName === this.createData.shape) {
1196
- this.createData.shape = "";
1146
+ toggleDrawing: function (type, icon) {
1147
+ if (type === 'mode') {
1148
+ this.activeDrawMode = icon
1149
+ this.createData.shape = '';
1197
1150
  this.$module.selectObjectOnPick = true;
1198
- } else {
1199
- this.createData.shape = shapeName;
1151
+ } else if (type === 'tool') {
1152
+ this.activeDrawTool = icon
1153
+ this.createData.shape = this.activeDrawTool;
1200
1154
  this.$module.selectObjectOnPick = false;
1201
1155
  }
1202
1156
  },
@@ -1258,7 +1212,7 @@ export default {
1258
1212
  },
1259
1213
  createEditTemporaryLines: function(worldCoords) {
1260
1214
  if (worldCoords) {
1261
- if (this.createData.shape === "Line" || this.createData.editingIndex > -1) {
1215
+ if (this.createData.shape === "LineString" || this.createData.editingIndex > -1) {
1262
1216
  if (this.createData.points.length === 1) {
1263
1217
  if (this._tempLine) {
1264
1218
  const positionAttribute = this._tempLine.geometry.getAttribute( 'position' );
@@ -1277,7 +1231,7 @@ export default {
1277
1231
  if (data[0].extraData.worldCoords) {
1278
1232
  if (this.createData.shape === "Point") {
1279
1233
  this.drawPoint(data[0].extraData.worldCoords, data);
1280
- } else if (this.createData.shape === "Line" ||
1234
+ } else if (this.createData.shape === "LineString" ||
1281
1235
  this.createData.editingIndex > -1) {
1282
1236
  this.drawLine(data[0].extraData.worldCoords, data);
1283
1237
  }
@@ -1385,14 +1339,14 @@ export default {
1385
1339
  this.activateAnnotationMode(names, event);
1386
1340
 
1387
1341
  } else {
1388
- if (this.$refs.treeControls) {
1342
+ if (this.$refs.scaffoldTreeControls) {
1389
1343
  if (names.length > 0) {
1390
- //this.$refs.treeControls.changeActiveByNames(names, region, false);
1391
- this.$refs.treeControls.updateActiveUI(zincObjects);
1344
+ //this.$refs.scaffoldTreeControls.changeActiveByNames(names, region, false);
1345
+ this.$refs.scaffoldTreeControls.updateActiveUI(zincObjects);
1392
1346
  this.updatePrimitiveControls(zincObjects);
1393
1347
  } else {
1394
1348
  this.hideRegionTooltip();
1395
- this.$refs.treeControls.removeActive(false);
1349
+ this.$refs.scaffoldTreeControls.removeActive(false);
1396
1350
  }
1397
1351
  }
1398
1352
  //Emit when an object is selected
@@ -1403,12 +1357,12 @@ export default {
1403
1357
  if (this.selectedObjects.length === 0) {
1404
1358
  this.hideRegionTooltip();
1405
1359
  // const offsets = this.$refs.scaffoldContainer.getBoundingClientRect();
1406
- if (this.$refs.treeControls) {
1360
+ if (this.$refs.scaffoldTreeControls) {
1407
1361
  if (names.length > 0) {
1408
- //this.$refs.treeControls.changeHoverByNames(names, region, false);
1409
- this.$refs.treeControls.updateHoverUI(zincObjects);
1362
+ //this.$refs.scaffoldTreeControls.changeHoverByNames(names, region, false);
1363
+ this.$refs.scaffoldTreeControls.updateHoverUI(zincObjects);
1410
1364
  } else {
1411
- this.$refs.treeControls.removeHover(true);
1365
+ this.$refs.scaffoldTreeControls.removeHover(true);
1412
1366
  }
1413
1367
  }
1414
1368
  if (event.identifiers.length > 0 && event.identifiers[0]) {
@@ -1521,11 +1475,11 @@ export default {
1521
1475
  changeActiveByName: function (names, region, propagate) {
1522
1476
  const isArray = Array.isArray(names);
1523
1477
  if (names === undefined || (isArray && names.length === 0)) {
1524
- this.$refs.treeControls.removeActive(propagate);
1478
+ this.$refs.scaffoldTreeControls.removeActive(propagate);
1525
1479
  } else {
1526
1480
  let array = names;
1527
1481
  if (!isArray) array = [array];
1528
- this.$refs.treeControls.changeActiveByNames(array, region, propagate);
1482
+ this.$refs.scaffoldTreeControls.changeActiveByNames(array, region, propagate);
1529
1483
  }
1530
1484
  },
1531
1485
  /**
@@ -1536,11 +1490,11 @@ export default {
1536
1490
  changeHighlightedByName: function (names, region, propagate) {
1537
1491
  const isArray = Array.isArray(names);
1538
1492
  if (names === undefined || (isArray && names.length === 0)) {
1539
- this.$refs.treeControls.removeHover(propagate);
1493
+ this.$refs.scaffoldTreeControls.removeHover(propagate);
1540
1494
  } else {
1541
1495
  let array = names;
1542
1496
  if (!isArray) array = [array];
1543
- this.$refs.treeControls.changeHoverByNames(array, region, propagate);
1497
+ this.$refs.scaffoldTreeControls.changeHoverByNames(array, region, propagate);
1544
1498
  }
1545
1499
  },
1546
1500
  /**
@@ -1565,26 +1519,11 @@ export default {
1565
1519
  const activePopoverObj = this.hoverVisibilities[this.helpModeActiveIndex];
1566
1520
 
1567
1521
  if (activePopoverObj) {
1522
+ const popoverRefsId = activePopoverObj?.refs;
1568
1523
  const popoverRefId = activePopoverObj?.ref;
1569
- const popoverRef = this.$refs[popoverRefId];
1570
-
1571
- if (popoverRef) {
1572
- // Open pathway drawer if the tooltip is inside or beside
1573
- const { parentElement, nextElementSibling } = popoverRef.$el;
1574
- const isPathwayContainer = (element) => {
1575
- return element && (
1576
- element.classList.contains('pathway-container') ||
1577
- element.classList.contains('pathway-location')
1578
- );
1579
- };
1580
-
1581
- if (
1582
- isPathwayContainer(parentElement) ||
1583
- isPathwayContainer(nextElementSibling)
1584
- ) {
1585
- this.drawerOpen = true;
1586
- }
1587
- } else {
1524
+ const popoverRef = this.$refs[popoverRefsId ? popoverRefsId : popoverRefId];
1525
+
1526
+ if (!popoverRef) {
1588
1527
  // skip the unavailable tooltips
1589
1528
  this.helpModeActiveIndex += 1;
1590
1529
  }
@@ -1974,7 +1913,7 @@ export default {
1974
1913
  if (options.visibility) {
1975
1914
  // Some UIs may not be ready at this time.
1976
1915
  this.$nextTick(() => {
1977
- this.$refs.treeControls.setState(options.visibility);
1916
+ this.$refs.scaffoldTreeControls.setState(options.visibility);
1978
1917
  });
1979
1918
  }
1980
1919
  }
@@ -2004,8 +1943,8 @@ export default {
2004
1943
  viewport: undefined,
2005
1944
  visibility: undefined,
2006
1945
  };
2007
- if (this.$refs.treeControls)
2008
- state.visibility = this.$refs.treeControls.getState();
1946
+ if (this.$refs.scaffoldTreeControls)
1947
+ state.visibility = this.$refs.scaffoldTreeControls.getState();
2009
1948
  if (this.$module.scene) {
2010
1949
  let zincCameraControls = this.$module.scene.getZincCameraControls();
2011
1950
  state.viewport = zincCameraControls.getCurrentViewport();
@@ -2034,7 +1973,7 @@ export default {
2034
1973
  .getZincCameraControls()
2035
1974
  .setCurrentCameraSettings(state.viewport);
2036
1975
  if (state.visibility)
2037
- this.$refs.treeControls.setState(state.visibility);
1976
+ this.$refs.scaffoldTreeControls.setState(state.visibility);
2038
1977
  } else {
2039
1978
  this.$module.setFinishDownloadCallback(
2040
1979
  this.setURLFinishCallback({
@@ -2070,7 +2009,7 @@ export default {
2070
2009
  let visibility =
2071
2010
  state && state.visibility ? state.visibility : undefined;
2072
2011
  this._currentURL = newValue;
2073
- if (this.$refs.treeControls) this.$refs.treeControls.clear();
2012
+ if (this.$refs.scaffoldTreeControls) this.$refs.scaffoldTreeControls.clear();
2074
2013
  this.loading = true;
2075
2014
  this.timeVarying = false;
2076
2015
  this.isReady = false;
@@ -1,9 +1,5 @@
1
1
  // The Vue build version to load with the `import` command
2
2
  // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3
3
  import ScaffoldVuer from "./ScaffoldVuer.vue";
4
- import HelpModeDialog from "./HelpModeDialog.vue";
5
4
 
6
- export {
7
- ScaffoldVuer,
8
- HelpModeDialog,
9
- };
5
+ export { ScaffoldVuer };
@@ -12,7 +12,6 @@ declare module 'vue' {
12
12
  ElCol: typeof import('element-plus/es')['ElCol']
13
13
  ElCollapse: typeof import('element-plus/es')['ElCollapse']
14
14
  ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
15
- ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
16
15
  ElContainer: typeof import('element-plus/es')['ElContainer']
17
16
  ElFooter: typeof import('element-plus/es')['ElFooter']
18
17
  ElHeader: typeof import('element-plus/es')['ElHeader']
@@ -32,8 +31,6 @@ declare module 'vue' {
32
31
  ElSlider: typeof import('element-plus/es')['ElSlider']
33
32
  ElTabPane: typeof import('element-plus/es')['ElTabPane']
34
33
  ElTabs: typeof import('element-plus/es')['ElTabs']
35
- ElTree: typeof import('element-plus/es')['ElTree']
36
- HelpModeDialog: typeof import('./components/HelpModeDialog.vue')['default']
37
34
  LinesControls: typeof import('./components/LinesControls.vue')['default']
38
35
  OpacityControls: typeof import('./components/OpacityControls.vue')['default']
39
36
  PointsControls: typeof import('./components/PointsControls.vue')['default']
@@ -41,10 +38,10 @@ declare module 'vue' {
41
38
  RouterLink: typeof import('vue-router')['RouterLink']
42
39
  RouterView: typeof import('vue-router')['RouterView']
43
40
  ScaffoldTooltip: typeof import('./components/ScaffoldTooltip.vue')['default']
41
+ ScaffoldTreeControls: typeof import('./components/ScaffoldTreeControls.vue')['default']
44
42
  ScaffoldVuer: typeof import('./components/ScaffoldVuer.vue')['default']
45
43
  TextureSlidesControls: typeof import('./components/TextureSlidesControls.vue')['default']
46
44
  TransformationControls: typeof import('./components/TransformationControls.vue')['default']
47
- TreeControls: typeof import('./components/TreeControls.vue')['default']
48
45
  }
49
46
  export interface ComponentCustomProperties {
50
47
  vLoading: typeof import('element-plus/es')['ElLoadingDirective']
package/vite.config.js CHANGED
@@ -46,12 +46,12 @@ export default defineConfig(({ command, mode }) => {
46
46
  fileName: 'scaffoldvuer',
47
47
  },
48
48
  rollupOptions: {
49
- external: ["vue", "@abi-software/flatmapvuer", "@abi-software/svg-sprite"],
49
+ external: ["vue", "@abi-software/svg-sprite", "@abi-software/map-utilities"],
50
50
  output: {
51
51
  globals: {
52
52
  vue: "Vue",
53
- "@abi-software/flatmapvuer": "@abi-software/flatmapvuer",
54
- "@abi-software/svg-sprite": "@abi-software/svg-sprite"
53
+ "@abi-software/svg-sprite": "@abi-software/svg-sprite",
54
+ "@abi-software/map-utilities": "@abi-software/map-utilities"
55
55
  },
56
56
  },
57
57
  },