@abi-software/scaffoldvuer 1.11.4-beta.0 → 1.12.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/dist/scaffoldvuer.js +1631 -1605
- package/dist/scaffoldvuer.umd.cjs +159 -159
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/App.vue +9 -7
- package/src/components/ScaffoldOverlay.vue +84 -34
- package/src/components/ScaffoldVuer.vue +13 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/scaffoldvuer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.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.7.
|
|
44
|
+
"@abi-software/map-utilities": "^1.7.4",
|
|
45
45
|
"@abi-software/sparc-annotation": "^0.3.2",
|
|
46
46
|
"@abi-software/svg-sprite": "1.0.2",
|
|
47
47
|
"@element-plus/icons-vue": "^2.3.1",
|
package/src/App.vue
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<ScaffoldVuer
|
|
6
6
|
v-if="url"
|
|
7
7
|
ref="scaffold"
|
|
8
|
-
class="vuer"
|
|
8
|
+
class="demo-vuer"
|
|
9
9
|
:flatmapAPI="flatmapAPI"
|
|
10
10
|
:display-u-i="displayUI"
|
|
11
11
|
:url="url"
|
|
@@ -49,10 +49,8 @@
|
|
|
49
49
|
@show-next="onHelpModeShowNext"
|
|
50
50
|
@finish-help-mode="onFinishHelpMode"
|
|
51
51
|
/>
|
|
52
|
-
|
|
53
52
|
<el-popover popper-class="options-container" placement="bottom" trigger="click" width="500" :teleported="false">
|
|
54
53
|
<div>
|
|
55
|
-
|
|
56
54
|
<el-row :gutter="20">
|
|
57
55
|
<el-col>
|
|
58
56
|
<p>{{ selectedCoordinates }}</p>
|
|
@@ -302,12 +300,12 @@
|
|
|
302
300
|
</Suspense>
|
|
303
301
|
</template>
|
|
304
302
|
<template #reference>
|
|
305
|
-
<el-button class="models-button" :icon="ElIconFolderOpened">
|
|
303
|
+
<el-button class="models-button control-layer" :icon="ElIconFolderOpened">
|
|
306
304
|
Models
|
|
307
305
|
</el-button>
|
|
308
306
|
</template>
|
|
309
307
|
</el-popover>
|
|
310
|
-
<el-autocomplete v-model="searchText" class="search-box" placeholder="Search" :fetch-suggestions="fetchSuggestions"
|
|
308
|
+
<el-autocomplete v-model="searchText" class="search-box control-layer" placeholder="Search" :fetch-suggestions="fetchSuggestions"
|
|
311
309
|
:teleported="false" popper-class="autocomplete-popper" @keyup.enter="search(searchText)"
|
|
312
310
|
@select="search(searchText)">
|
|
313
311
|
<template #default="{ item }">
|
|
@@ -404,7 +402,7 @@ export default {
|
|
|
404
402
|
tumbleDirection: [1.0, 0.0],
|
|
405
403
|
showColourPicker: true,
|
|
406
404
|
markerCluster: false,
|
|
407
|
-
positionalRotation:
|
|
405
|
+
positionalRotation: true,
|
|
408
406
|
minimapSettings: {
|
|
409
407
|
x_offset: 16,
|
|
410
408
|
y_offset: 50,
|
|
@@ -864,7 +862,7 @@ body {
|
|
|
864
862
|
}
|
|
865
863
|
}
|
|
866
864
|
|
|
867
|
-
.vuer {
|
|
865
|
+
.demo-vuer {
|
|
868
866
|
position: absolute;
|
|
869
867
|
width: 100%;
|
|
870
868
|
height: 100%;
|
|
@@ -924,6 +922,10 @@ svg.map-icon {
|
|
|
924
922
|
color: $app-primary-color;
|
|
925
923
|
}
|
|
926
924
|
|
|
925
|
+
.control-layer {
|
|
926
|
+
z-index: 2;
|
|
927
|
+
}
|
|
928
|
+
|
|
927
929
|
input[type="file"] {
|
|
928
930
|
display: none;
|
|
929
931
|
}
|
|
@@ -2,54 +2,55 @@
|
|
|
2
2
|
<div
|
|
3
3
|
ref="overlay"
|
|
4
4
|
>
|
|
5
|
+
<div
|
|
6
|
+
class="content-layer" ref="contentLayer"
|
|
7
|
+
@mouseleave.capture="skipWhenInBound"
|
|
8
|
+
@mousedown.capture="(event) => contentMouseActive(event, true)"
|
|
9
|
+
@mouseup.capture="(event) => contentMouseActive(event, false)"
|
|
10
|
+
@touchstart.capture="(event) => contentMouseActive(event, true)"
|
|
11
|
+
@touchend.capture="(event) => contentMouseActive(event, false)"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
5
15
|
<div v-if="positionalRotation" ref="topLayer"
|
|
6
16
|
@mousemove.capture="forwardEvent"
|
|
7
17
|
@mouseover.capture="forwardEvent"
|
|
18
|
+
@touchmove.capture="forwardTouchEvent"
|
|
8
19
|
@click.capture="forwardEvent"
|
|
9
20
|
>
|
|
10
|
-
<div
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
<div class="rotation-overlay bottom"
|
|
17
|
-
@mousedown="(event) => {setRotationMode(event, 'vertical'); forwardEvent(event)}"
|
|
18
|
-
@mouseup="forwardEvent"
|
|
19
|
-
>
|
|
20
|
-
<span>Click and drag here to rotate vertically</span>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="rotation-overlay left"
|
|
23
|
-
@mousedown="(event) => {setRotationMode(event, 'horizontal'); forwardEvent(event)}"
|
|
21
|
+
<div
|
|
22
|
+
v-for="overlay in rotationOverlays"
|
|
23
|
+
:key="overlay.position"
|
|
24
|
+
:class="['rotation-overlay', overlay.position, touchActive ? 'touch-active' : '']"
|
|
25
|
+
@mousedown="(event) => {setRotationMode(event, overlay.mode); forwardEvent(event)}"
|
|
24
26
|
@mouseup="forwardEvent"
|
|
27
|
+
@touchstart="(event) => {setRotationMode(event, overlay.mode); forwardTouchEvent(event)}"
|
|
28
|
+
@touchend="forwardTouchEvent"
|
|
25
29
|
>
|
|
26
|
-
<span>
|
|
30
|
+
<span>{{ overlay.text }}</span>
|
|
27
31
|
</div>
|
|
28
|
-
<div class="rotation-overlay right"
|
|
29
|
-
@mousedown="(event) => {setRotationMode(event, 'horizontal'); forwardEvent(event)}"
|
|
30
|
-
@mouseup="forwardEvent"
|
|
31
|
-
>
|
|
32
|
-
<span>Click and drag here to rotate horizontally</span>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="content-layer" ref="contentLayer"
|
|
36
|
-
@mouseleave.capture="skipWhenInBound"
|
|
37
|
-
@mousedown.capture="(event) => contentMouseActive(event, true)"
|
|
38
|
-
@mouseup.capture="(event) => contentMouseActive(event, false)"
|
|
39
|
-
>
|
|
40
|
-
<slot />
|
|
41
32
|
</div>
|
|
33
|
+
|
|
42
34
|
</div>
|
|
43
35
|
</template>
|
|
44
36
|
|
|
45
37
|
<script>
|
|
46
38
|
/* eslint-disable no-alert, no-console */
|
|
47
39
|
|
|
40
|
+
const rotationOverlays = [
|
|
41
|
+
{ position: 'top', mode: 'vertical', text: 'Begin interaction here to rotate on the x-axis' },
|
|
42
|
+
{ position: 'bottom', mode: 'vertical', text: 'Begin interaction here to rotate on the x-axis' },
|
|
43
|
+
{ position: 'left', mode: 'horizontal', text: 'Begin interaction here to rotate on the y-axis' },
|
|
44
|
+
{ position: 'right', mode: 'horizontal', text: 'Begin interaction here to rotate on the y-axis' },
|
|
45
|
+
];
|
|
46
|
+
|
|
48
47
|
export default {
|
|
49
48
|
name: "ScaffoldOverlay",
|
|
50
49
|
data: function () {
|
|
51
50
|
return {
|
|
52
51
|
lockRotationMode: false,
|
|
52
|
+
touchActive: false,
|
|
53
|
+
rotationOverlays: rotationOverlays,
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
56
|
props: {
|
|
@@ -66,20 +67,24 @@ export default {
|
|
|
66
67
|
contentMouseActive: function(event, flag) {
|
|
67
68
|
if (this.positionalRotation) {
|
|
68
69
|
const topLayer = this.$refs.topLayer;
|
|
69
|
-
|
|
70
70
|
if (topLayer) {
|
|
71
71
|
if (!flag) {
|
|
72
72
|
this.lockRotationMode = false;
|
|
73
73
|
this.setRotationMode(undefined, "free");
|
|
74
74
|
topLayer.style.pointerEvents = 'auto';
|
|
75
|
+
if (event.type === "touchend") {
|
|
76
|
+
this.touchActive = false;
|
|
77
|
+
}
|
|
75
78
|
}
|
|
76
79
|
else {
|
|
77
80
|
this.lockRotationMode = true;
|
|
78
81
|
topLayer.style.pointerEvents = 'none';
|
|
82
|
+
if (event.type === "touchstart") {
|
|
83
|
+
this.touchActive = true;
|
|
84
|
+
}
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
|
-
event.preventDefault();
|
|
83
88
|
},
|
|
84
89
|
setRotationMode: function(event, mode) {
|
|
85
90
|
if (!this.lockRotationMode) {
|
|
@@ -113,7 +118,6 @@ export default {
|
|
|
113
118
|
topLayer.style.pointerEvents = 'none';
|
|
114
119
|
const elementBelow = document.elementFromPoint(event.clientX, event.clientY);
|
|
115
120
|
//const elementBelow = this.$el;
|
|
116
|
-
topLayer.style.pointerEvents = 'auto';
|
|
117
121
|
topLayer.style.pointerEvents = pointerEvents;
|
|
118
122
|
//const elementBelow = this.$refs.contentLayer;
|
|
119
123
|
// Hide the top layer from pointer events
|
|
@@ -132,10 +136,52 @@ export default {
|
|
|
132
136
|
button: event.button,
|
|
133
137
|
}
|
|
134
138
|
);
|
|
135
|
-
|
|
136
139
|
elementBelow.dispatchEvent(newEvent);
|
|
140
|
+
event.stopPropagation();
|
|
141
|
+
}
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
},
|
|
144
|
+
forwardTouchEvent: function(event) {
|
|
145
|
+
const topLayer = this.$refs.topLayer;
|
|
146
|
+
if (!topLayer) return;
|
|
147
|
+
// Find the element directly underneath the cursor
|
|
148
|
+
const pointerEvents = topLayer.style.pointerEvents;
|
|
149
|
+
topLayer.style.pointerEvents = 'none';
|
|
150
|
+
const firstTouch = event.changedTouches[0];
|
|
151
|
+
const clientX = firstTouch.clientX;
|
|
152
|
+
const clientY = firstTouch.clientY;
|
|
153
|
+
const elementBelow = document.elementFromPoint(clientX, clientY);
|
|
154
|
+
topLayer.style.pointerEvents = pointerEvents;
|
|
155
|
+
if (elementBelow) {
|
|
156
|
+
const newTouch = new Touch({
|
|
157
|
+
identifier: firstTouch.identifier,
|
|
158
|
+
target: elementBelow,
|
|
159
|
+
clientX: firstTouch.clientX,
|
|
160
|
+
clientY: firstTouch.clientY,
|
|
161
|
+
pageX: firstTouch.pageX,
|
|
162
|
+
pageY: firstTouch.pageY,
|
|
163
|
+
screenX: firstTouch.screenX,
|
|
164
|
+
screenY: firstTouch.screenY,
|
|
165
|
+
radiusX: firstTouch.radiusX,
|
|
166
|
+
radiusY: firstTouch.radiusY,
|
|
167
|
+
rotationAngle: firstTouch.rotationAngle,
|
|
168
|
+
force: firstTouch.force,
|
|
169
|
+
});
|
|
170
|
+
const newEvent = new TouchEvent(
|
|
171
|
+
event.type,
|
|
172
|
+
{
|
|
173
|
+
bubbles: event.bubbles,
|
|
174
|
+
cancelable: event.cancelable,
|
|
175
|
+
composed: true,
|
|
176
|
+
view: event.view,
|
|
177
|
+
touches: [newTouch],
|
|
178
|
+
targetTouches: [newTouch],
|
|
179
|
+
changedTouches: [newTouch],
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
elementBelow.dispatchEvent(newEvent);
|
|
183
|
+
event.stopPropagation();
|
|
137
184
|
}
|
|
138
|
-
event.stopPropagation();
|
|
139
185
|
event.preventDefault();
|
|
140
186
|
}
|
|
141
187
|
}
|
|
@@ -144,10 +190,14 @@ export default {
|
|
|
144
190
|
|
|
145
191
|
<style scoped lang="scss">
|
|
146
192
|
.rotation-overlay {
|
|
147
|
-
z-index:
|
|
193
|
+
z-index: 1;
|
|
148
194
|
background-color: transparent;
|
|
149
195
|
position:absolute;
|
|
150
196
|
opacity: 0;
|
|
197
|
+
&.touch-active {
|
|
198
|
+
opacity: 1;
|
|
199
|
+
background-color: rgba(173,216,230, 0.1)
|
|
200
|
+
}
|
|
151
201
|
&:hover {
|
|
152
202
|
opacity: 1;
|
|
153
203
|
background-color: rgba(173,216,230, 0.1)
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
<div v-show="displayUI && !isTransitioning">
|
|
36
36
|
<DrawToolbar
|
|
37
37
|
v-if="viewingMode === 'Annotation' && (authorisedUser || offlineAnnotationEnabled)"
|
|
38
|
+
class="control-layer"
|
|
38
39
|
:toolbarOptions="toolbarOptions"
|
|
39
40
|
:activeDrawTool="activeDrawTool"
|
|
40
41
|
:activeDrawMode="activeDrawMode"
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
<template #reference>
|
|
58
59
|
<div
|
|
59
60
|
v-if="displayWarning"
|
|
60
|
-
class="message-icon warning-icon"
|
|
61
|
+
class="message-icon warning-icon control-layer"
|
|
61
62
|
@mouseover="showHelpText(7)"
|
|
62
63
|
@mouseout="hideHelpText(7)"
|
|
63
64
|
>
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
<template #reference>
|
|
80
81
|
<div
|
|
81
82
|
v-if="displayLatestChanges && latestChangesMessage"
|
|
82
|
-
class="el-icon-warning message-icon latest-changesicon"
|
|
83
|
+
class="el-icon-warning message-icon latest-changesicon control-layer"
|
|
83
84
|
@mouseover="showHelpText(8)"
|
|
84
85
|
@mouseout="hideHelpText(8)"
|
|
85
86
|
>
|
|
@@ -100,6 +101,7 @@
|
|
|
100
101
|
>
|
|
101
102
|
<template #reference>
|
|
102
103
|
<ScaffoldTreeControls
|
|
104
|
+
class="control-layer"
|
|
103
105
|
ref="scaffoldTreeControls"
|
|
104
106
|
:isReady="isReady"
|
|
105
107
|
:show-colour-picker="enableColourPicker"
|
|
@@ -111,6 +113,7 @@
|
|
|
111
113
|
</el-popover>
|
|
112
114
|
<div class="primitive-controls-box">
|
|
113
115
|
<primitive-controls
|
|
116
|
+
class="control-layer"
|
|
114
117
|
ref="primitiveControls"
|
|
115
118
|
:createData="createData"
|
|
116
119
|
:viewingMode="viewingMode"
|
|
@@ -132,7 +135,7 @@
|
|
|
132
135
|
<template #reference>
|
|
133
136
|
<div
|
|
134
137
|
v-if="timeVarying"
|
|
135
|
-
class="time-slider-container"
|
|
138
|
+
class="time-slider-container control-layer"
|
|
136
139
|
:class="[minimisedSlider ? 'minimised' : '', sliderPosition]"
|
|
137
140
|
>
|
|
138
141
|
<el-tabs type="card">
|
|
@@ -201,7 +204,7 @@
|
|
|
201
204
|
</div>
|
|
202
205
|
</template>
|
|
203
206
|
</el-popover>
|
|
204
|
-
<div class="bottom-right-control">
|
|
207
|
+
<div class="bottom-right-control control-layer">
|
|
205
208
|
<el-popover
|
|
206
209
|
:visible="hoverVisibilities[0].value"
|
|
207
210
|
content="Zoom in"
|
|
@@ -298,7 +301,7 @@
|
|
|
298
301
|
popper-class="background-popper non-selectable h-auto"
|
|
299
302
|
virtual-triggering
|
|
300
303
|
>
|
|
301
|
-
<div>
|
|
304
|
+
<div class="control-layer">
|
|
302
305
|
<el-row class="backgroundText">Viewing Mode</el-row>
|
|
303
306
|
<el-row class="backgroundControl">
|
|
304
307
|
<div style="margin-bottom: 2px;">
|
|
@@ -362,7 +365,7 @@
|
|
|
362
365
|
</div>
|
|
363
366
|
</el-popover>
|
|
364
367
|
<div
|
|
365
|
-
class="settings-group"
|
|
368
|
+
class="settings-group control-layer"
|
|
366
369
|
:class="{ open: drawerOpen, close: !drawerOpen }"
|
|
367
370
|
>
|
|
368
371
|
<el-row v-if="showOpenMapButton">
|
|
@@ -1581,7 +1584,6 @@ export default {
|
|
|
1581
1584
|
},
|
|
1582
1585
|
setRotationMode: function(mode) {
|
|
1583
1586
|
if (this.$module.scene) {
|
|
1584
|
-
console.log("here", mode)
|
|
1585
1587
|
const cameracontrol = this.$module.scene.getZincCameraControls();
|
|
1586
1588
|
cameracontrol.setRotationMode(mode);
|
|
1587
1589
|
}
|
|
@@ -2911,6 +2913,10 @@ export default {
|
|
|
2911
2913
|
}
|
|
2912
2914
|
}
|
|
2913
2915
|
|
|
2916
|
+
.control-layer {
|
|
2917
|
+
z-index: 2;
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2914
2920
|
.time-slider-container {
|
|
2915
2921
|
text-align: left;
|
|
2916
2922
|
position: absolute;
|