@abi-software/scaffoldvuer 0.1.54-beta.3 → 0.1.55

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": "0.1.54-beta.3",
3
+ "version": "0.1.55",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,9 @@
9
9
  "scripts": {
10
10
  "serve": "vue-cli-service serve --port 8081",
11
11
  "lint": "vue-cli-service lint --ext .js,.vue src",
12
- "build-bundle": "vue-cli-service build --target lib --name scaffoldvuer ./src/components/index.js",
12
+ "build-bundle": "npm run build:bundle && npm run build:wc",
13
+ "build:bundle": "vue-cli-service build --target lib --name scaffoldvuer ./src/components/index.js",
14
+ "build:wc": "vue-cli-service build --target lib --name scaffoldvuer-wc ./src/ScaffoldVuer-wc.js --mode wc --env bundle --no-clean",
13
15
  "styleguide": "vue-cli-service styleguidist",
14
16
  "styleguide:build": "vue-cli-service styleguidist:build"
15
17
  },
@@ -31,14 +33,15 @@
31
33
  "lodash": "^4.17.21",
32
34
  "query-string": "^6.11.1",
33
35
  "vue": "^2.6.10",
36
+ "vue-custom-element": "^3.3.0",
34
37
  "vue-drag-resize": "^1.3.2",
35
38
  "vue-router": "^3.5.1",
36
- "zincjs": "^1.0.7"
39
+ "zincjs": "^1.0.9"
37
40
  },
38
41
  "devDependencies": {
39
42
  "@vue/cli-plugin-babel": "^4.0.0",
40
43
  "@vue/cli-plugin-eslint": "^4.5.15",
41
- "@vue/cli-service": "^4.5.13",
44
+ "@vue/cli-service": "^4.5.18",
42
45
  "babel-eslint": "^10.0.3",
43
46
  "babel-plugin-component": "^1.1.1",
44
47
  "base64-inline-loader": "^1.1.1",
package/src/App.vue CHANGED
@@ -49,8 +49,17 @@
49
49
  </el-row>
50
50
  <el-row :gutter="20">
51
51
  <el-col
52
- :span="6"
53
- :offset="2"
52
+ :span="4"
53
+ :offset="1"
54
+ >
55
+ <el-switch
56
+ v-model="displayUI"
57
+ active-text="UI"
58
+ />
59
+ </el-col>
60
+ <el-col
61
+ :span="4"
62
+ :offset="1"
54
63
  >
55
64
  <el-switch
56
65
  v-model="displayMarkers"
@@ -60,8 +69,8 @@
60
69
  />
61
70
  </el-col>
62
71
  <el-col
63
- :span="6"
64
- :offset="2"
72
+ :span="4"
73
+ :offset="1"
65
74
  >
66
75
  <el-switch
67
76
  v-model="displayMinimap"
@@ -72,7 +81,7 @@
72
81
  </el-col>
73
82
  <el-col
74
83
  :span="6"
75
- :offset="2"
84
+ :offset="1"
76
85
  >
77
86
  <el-switch
78
87
  v-model="tumbleOn"
@@ -340,7 +349,6 @@ export default {
340
349
  })
341
350
  },
342
351
  saveSettings: function() {
343
- const state = this.$refs.scaffold.getState();
344
352
  this.sceneSettings.push(this.$refs.scaffold.getState());
345
353
  },
346
354
  restoreSettings: function() {
@@ -0,0 +1,14 @@
1
+ import Vue from 'vue'
2
+ import vueCustomElement from 'vue-custom-element';
3
+
4
+ Vue.use(vueCustomElement);
5
+
6
+ import ScaffoldVuer from "./components/ScaffoldVuer.vue";
7
+
8
+ Vue.customElement("scaffoldvuer-wc", ScaffoldVuer);
9
+
10
+ /*
11
+ const wrappedElement = wrap(Vue, ScaffoldVuer);
12
+
13
+ window.customElements.define("scaffoldvuer-wc", wrappedElement);
14
+ */
@@ -38,7 +38,8 @@ export default {
38
38
  for (const [key, file] of Object.entries(list)) {
39
39
  if (content.includes(key)) {
40
40
  const objectURL = URL.createObjectURL(file);
41
- content = content.replace(key, objectURL);
41
+ const re = new RegExp(key, "g");
42
+ content = content.replace(re, objectURL);
42
43
  this.objectURLs.push(objectURL);
43
44
  }
44
45
  }
@@ -8,7 +8,8 @@
8
8
  trigger="manual"
9
9
  popper-class="tooltip-popper non-selectable"
10
10
  >
11
- <div>{{ label }}</div>
11
+ <div class="tooltip-text">{{ label }}</div>
12
+ <div class="tooltip-text" v-if="region">Region: {{ region }}</div>
12
13
  <i v-popover:tooltip />
13
14
  </el-popover>
14
15
  </div>
@@ -34,6 +35,10 @@ export default {
34
35
  type: String,
35
36
  default: "",
36
37
  },
38
+ region: {
39
+ type: String,
40
+ default: "",
41
+ },
37
42
  visible: {
38
43
  type: Boolean,
39
44
  default: false,
@@ -118,6 +123,10 @@ export default {
118
123
  }
119
124
  }
120
125
 
126
+ .tooltip-text {
127
+ text-align: center;
128
+ }
129
+
121
130
  ::v-deep .non-selectable {
122
131
  user-select: none;
123
132
  pointer-events: none;
@@ -10,6 +10,7 @@
10
10
  <map-svg-sprite-color />
11
11
  <scaffold-tooltip
12
12
  :label="tData.label"
13
+ :region="tData.region"
13
14
  :visible="tData.visible"
14
15
  :x="tData.x"
15
16
  :y="tData.y"
@@ -354,7 +355,7 @@ export default {
354
355
  */
355
356
  displayMarkers: {
356
357
  type: Boolean,
357
- default: true
358
+ default: false
358
359
  },
359
360
  /**
360
361
  * Show/hide minimap.
@@ -477,6 +478,7 @@ export default {
477
478
  defaultCheckedKeys: [],
478
479
  tData: {
479
480
  label: "",
481
+ region: "",
480
482
  visible: false,
481
483
  x: 200,
482
484
  y: 200
@@ -701,15 +703,16 @@ export default {
701
703
  viewRegion: function(names) {
702
704
  const rootRegion = this.$module.scene.getRootRegion();
703
705
  const groups = Array.isArray(names) ? names : [names];
704
- const dist = this.$module.scene.camera.far - this.$module.scene.camera.near;
705
706
  const objects = findObjectsWithNames(rootRegion, groups, "");
706
707
  let box = this.$module.scene.getBoundingBoxOfZincObjects(objects);
707
708
  if (box) {
708
709
  if (this.$module.isSyncControl()) {
709
710
  this.$module.setSyncControlZoomToBox(box);
710
711
  } else {
712
+ const dist = this.$module.scene.camera.far - this.$module.scene.camera.near;
711
713
  this.$module.scene.viewAllWithBoundingBox(box);
712
714
  this.$module.scene.camera.far = this.$module.scene.camera.near + dist;
715
+ this.$module.scene.camera.updateProjectionMatrix();
713
716
  }
714
717
  return true;
715
718
  }
@@ -807,6 +810,10 @@ export default {
807
810
  if (event.identifiers[0].coords) {
808
811
  this.tData.visible = true;
809
812
  this.tData.label = id;
813
+ if (event.identifiers[0].data.region)
814
+ this.tData.region = event.identifiers[0].data.region;
815
+ else
816
+ this.tData.region = "Root";
810
817
  this.tData.x = event.identifiers[0].coords.x;
811
818
  this.tData.y = event.identifiers[0].coords.y;
812
819
  }
@@ -21,6 +21,7 @@
21
21
  :data="treeData"
22
22
  :default-checked-keys="['__r/']"
23
23
  :expand-on-click-node="false"
24
+ :renderAfterExpand="false"
24
25
  @check="checkChanged"
25
26
  >
26
27
  <span
@@ -142,6 +143,7 @@ export default {
142
143
  },
143
144
  methods: {
144
145
  addTreeItem: function (parentContainer, item) {
146
+ //The following block prevent duplicate graphics with the same name
145
147
  for (let i = 0; i < parentContainer.length; i++) {
146
148
  if (parentContainer[i].id === item.id) {
147
149
  if (item.primitives && parentContainer[i].primitives) {
@@ -231,7 +233,7 @@ export default {
231
233
  label: zincObject.groupName,
232
234
  id: id,
233
235
  primitives: [zincObject],
234
- regionPath: zincObject.region.getFullPath()
236
+ regionPath: zincObject.region.getFullPath(),
235
237
  };
236
238
  this.addTreeItem(regionData.children, child);
237
239
  }
@@ -250,9 +252,8 @@ export default {
250
252
  });
251
253
  },
252
254
  updateActiveUI: function (primitives) {
253
- this.active = [];
254
- const list = createListFromPrimitives(primitives);
255
- this.active.push(...list);
255
+ this.active.length = 0;
256
+ createListFromPrimitives(primitives, this.active);
256
257
  },
257
258
  changeActiveByPrimitives: function (primitives, propagate) {
258
259
  if (primitives && primitives.length > 0) {
@@ -264,9 +265,8 @@ export default {
264
265
  this.removeHover(propagate);
265
266
  },
266
267
  updateHoverUI: function (primitives) {
267
- this.hover = [];
268
- const list = createListFromPrimitives(primitives);
269
- this.hover.push(...list);
268
+ this.hover.length = 0;
269
+ createListFromPrimitives(primitives, this.hover);
270
270
  },
271
271
  changeHoverByPrimitives: function (primitives, propagate) {
272
272
  if (primitives && primitives.length > 0) {
@@ -593,9 +593,8 @@ export default {
593
593
  height: 40px;
594
594
  z-index: 8;
595
595
  margin-top: calc(50% - 52px);
596
- border: solid 1px #e4e7ed;
597
- border-left: 0;
598
- background-color: #ffffff;
596
+ border: solid 1px $app-primary-color;
597
+ background-color: #F9F2FC;
599
598
  text-align: center;
600
599
  vertical-align: middle;
601
600
  cursor: pointer;
@@ -604,18 +603,19 @@ export default {
604
603
 
605
604
  .drawer-button {
606
605
  i {
606
+ font-weight:600;
607
607
  margin-top: 12px;
608
608
  color: $app-primary-color;
609
609
  transition-delay: 0.9s;
610
610
  }
611
611
  &.open {
612
612
  i {
613
- transform: rotate(0deg) scaleY(2.5);
613
+ transform: rotate(0deg) scaleY(2);
614
614
  }
615
615
  }
616
616
  &.close {
617
617
  i {
618
- transform: rotate(180deg) scaleY(2.5);
618
+ transform: rotate(180deg) scaleY(2);
619
619
  }
620
620
  }
621
621
  }
@@ -48,7 +48,7 @@ RendererModule.prototype.getIntersectedObject = function(intersects) {
48
48
  intersects[i].object.userData &&
49
49
  intersects[i].object.userData.isZincObject &&
50
50
  ((intersects[i].object.name &&
51
- intersects[i].object.name !== "_Unnamed") ||
51
+ intersects[i].object.name !== "") ||
52
52
  intersects[i].object.userData.isMarker))
53
53
  return intersects[i];
54
54
  }
@@ -12,6 +12,8 @@ exports.GraphicsHighlight = function() {
12
12
  this.highlightColour = [1, 0, 0];
13
13
  this.selectColour = [0, 1, 0];
14
14
  this.originalColour = [0, 0, 0];
15
+ const _temp1 = [];
16
+ const _temp2 = [];
15
17
  const _this = this;
16
18
 
17
19
  const isDifferent = function(array1, array2) {
@@ -41,7 +43,7 @@ exports.GraphicsHighlight = function() {
41
43
  }
42
44
 
43
45
  const getUnmatchingObjects = function(objectsArray1, objectsArray2) {
44
- const unmatchingObjects = [];
46
+ _temp1.length = 0;
45
47
  if (objectsArray2.length == 0)
46
48
  return objectsArray1;
47
49
  for (let i = 0; i < objectsArray1.length; i++) {
@@ -52,9 +54,9 @@ exports.GraphicsHighlight = function() {
52
54
  }
53
55
  }
54
56
  if (!matched)
55
- unmatchingObjects.push(objectsArray1[i]);
57
+ _temp1.push(objectsArray1[i]);
56
58
  }
57
- return unmatchingObjects;
59
+ return _temp1;
58
60
  }
59
61
 
60
62
  this.setHighlighted = function(objects) {
@@ -87,12 +89,12 @@ exports.GraphicsHighlight = function() {
87
89
  }
88
90
 
89
91
  const getFullListOfObjects = function(objects) {
90
- let fullList = [];
92
+ _temp2.length = 0;
91
93
  for (let i = 0; i < objects.length; i++) {
92
94
  if (objects[i].material)
93
- fullList.push(objects[i]);
95
+ _temp2.push(objects[i]);
94
96
  }
95
- return fullList;
97
+ return _temp2;
96
98
  }
97
99
 
98
100
  this.resetHighlighted = function() {
@@ -1,5 +1,4 @@
1
- export const createListFromPrimitives = primitives => {
2
- const list = [];
1
+ export const createListFromPrimitives = (primitives, list) => {
3
2
  if (primitives) {
4
3
  primitives.forEach(primitive => {
5
4
  if (primitive && primitive.getVisibility()) {
package/vue.config.js CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  const nodeExternals = require('webpack-node-externals');
2
3
 
3
4
  module.exports = {
@@ -28,6 +29,8 @@ module.exports = {
28
29
  .end()
29
30
  },
30
31
  css: {
32
+ sourceMap: process.env.NODE_ENV === 'wc',
33
+ extract: process.env.NODE_ENV !== 'wc',
31
34
  //Import variables into all stylesheets.
32
35
  loaderOptions: {
33
36
  sass: {