@abi-software/mapintegratedvuer 1.9.0-beta.0 → 1.9.0-beta.1
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/{ContentMixin-Ccjd33IX.js → ContentMixin-CukPHyXB.js} +1 -1
- package/dist/{Flatmap-B1OnfjfL.js → Flatmap-CxqtqzTG.js} +3 -3
- package/dist/{Iframe-BDDbPJx2.js → Iframe-DEbnht3D.js} +2 -2
- package/dist/{MultiFlatmap-ekGs1Vqx.js → MultiFlatmap-DB7ZL7mu.js} +3 -3
- package/dist/{Plot-ByUL7Ip1.js → Plot-eTjN3jFm.js} +2 -2
- package/dist/{Scaffold-hK8KW9Yh.js → Scaffold-EQbo-XRc.js} +19 -13
- package/dist/{Simulation-VDQUIpAa.js → Simulation-n3xUY1sG.js} +2 -2
- package/dist/{index-BGZgzrzo.js → index-BFdnIlxA.js} +8178 -8074
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +389 -389
- package/dist/{style-Dd26IITM.js → style-DeVkU2io.js} +1112 -1112
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +8 -15
- package/src/components/MapContent.vue +5 -5
- package/src/components/SplitFlow.vue +2 -2
package/package.json
CHANGED
package/src/App.vue
CHANGED
@@ -67,10 +67,9 @@ import {
|
|
67
67
|
|
68
68
|
const getAnnotationId = (api, withAnnotation) => {
|
69
69
|
return new Promise((resolve) => {
|
70
|
-
let
|
71
|
-
|
72
|
-
|
73
|
-
let maxRetry = 3
|
70
|
+
let anonymousAnnotations = JSON.parse(sessionStorage.getItem('anonymous-annotation')) || undefined;
|
71
|
+
if (withAnnotation && anonymousAnnotations) {
|
72
|
+
let maxRetry = 3;
|
74
73
|
const annotationUrl = api + '/annotation/getshareid';
|
75
74
|
const getId = (attempt) => {
|
76
75
|
fetch(annotationUrl, {
|
@@ -78,7 +77,7 @@ const getAnnotationId = (api, withAnnotation) => {
|
|
78
77
|
headers: {
|
79
78
|
'Content-type': 'application/json',
|
80
79
|
},
|
81
|
-
body: JSON.stringify({ state:
|
80
|
+
body: JSON.stringify({ state: anonymousAnnotations }),
|
82
81
|
}).then((response) => {
|
83
82
|
if (response.ok) {
|
84
83
|
return response.json();
|
@@ -89,7 +88,6 @@ const getAnnotationId = (api, withAnnotation) => {
|
|
89
88
|
resolve(data.uuid);
|
90
89
|
})
|
91
90
|
.catch((error) => {
|
92
|
-
console.log(`Unable to create permalink: attempt ${attempt} of ${maxRetry}`)
|
93
91
|
if (maxRetry > attempt) {
|
94
92
|
getId(attempt + 1);
|
95
93
|
} else {
|
@@ -106,7 +104,7 @@ const getAnnotationId = (api, withAnnotation) => {
|
|
106
104
|
|
107
105
|
const getAnnotationState = (api, annotationId) => {
|
108
106
|
return new Promise((resolve) => {
|
109
|
-
let maxRetry = 3
|
107
|
+
let maxRetry = 3;
|
110
108
|
const annotationUrl = api + '/annotation/getstate';
|
111
109
|
const getState = (attempt) => {
|
112
110
|
fetch(annotationUrl, {
|
@@ -117,16 +115,15 @@ const getAnnotationState = (api, annotationId) => {
|
|
117
115
|
body: JSON.stringify({ uuid: annotationId }),
|
118
116
|
}).then((response) => {
|
119
117
|
if (response.ok) {
|
120
|
-
return response.json()
|
118
|
+
return response.json();
|
121
119
|
}
|
122
|
-
throw new Error('Unsuccessful attempt to get annotations')
|
120
|
+
throw new Error('Unsuccessful attempt to get annotations');
|
123
121
|
})
|
124
122
|
.then((data) => {
|
125
123
|
resolve(data);
|
126
124
|
})
|
127
125
|
.catch((error) => {
|
128
|
-
console.log(
|
129
|
-
console.log(`Unable to get annotation state: attempt ${attempt} of ${maxRetry}`)
|
126
|
+
console.log(`Unable to get annotation state: attempt ${attempt} of ${maxRetry}`);
|
130
127
|
if (maxRetry > attempt) {
|
131
128
|
getState(attempt + 1);
|
132
129
|
} else {
|
@@ -225,7 +222,6 @@ export default {
|
|
225
222
|
if (annotationId) {
|
226
223
|
state.annotationId = annotationId;
|
227
224
|
}
|
228
|
-
console.log(state)
|
229
225
|
getShareLink(1)
|
230
226
|
});
|
231
227
|
|
@@ -313,7 +309,6 @@ export default {
|
|
313
309
|
if (state?.state?.annotationId) {
|
314
310
|
getAnnotationState(this.api, state.state.annotationId).
|
315
311
|
then((data) => {
|
316
|
-
console.log(data)
|
317
312
|
if (data) {
|
318
313
|
sessionStorage.setItem('anonymous-annotation', JSON.stringify(data.state))
|
319
314
|
}
|
@@ -322,8 +317,6 @@ export default {
|
|
322
317
|
} else {
|
323
318
|
this.state = state.state;
|
324
319
|
}
|
325
|
-
|
326
|
-
console.log(state)
|
327
320
|
}
|
328
321
|
}
|
329
322
|
xmlhttp.send(JSON.stringify({"uuid": this.uuid}));
|
@@ -210,12 +210,12 @@ export default {
|
|
210
210
|
* @public
|
211
211
|
* Get the current state of the map viewer, these states can be used to
|
212
212
|
* restore settings and viewers using the setState method.
|
213
|
-
* Set
|
214
|
-
* state of
|
215
|
-
* @arg `
|
213
|
+
* Set anonymousAnnotations to true if the user would like to perserve the
|
214
|
+
* state of anonymous annotations.
|
215
|
+
* @arg `anonymousAnnotations`
|
216
216
|
*/
|
217
|
-
getState: function(
|
218
|
-
return this.$refs.flow.getState(
|
217
|
+
getState: function(anonymousAnnotations = false){
|
218
|
+
return this.$refs.flow.getState(anonymousAnnotations);
|
219
219
|
},
|
220
220
|
/**
|
221
221
|
* @public
|
@@ -465,7 +465,7 @@ export default {
|
|
465
465
|
if (state.splitFlow) this.splitFlowStore.setState(state.splitFlow);
|
466
466
|
else this.entries.forEach(entry => this.splitFlowStore.setIdToPrimaryPane(entry.id));
|
467
467
|
},
|
468
|
-
getState: function (
|
468
|
+
getState: function (anonymousAnnotations = false) {
|
469
469
|
let state = JSON.parse(JSON.stringify(this.entriesStore.$state));
|
470
470
|
let splitdialog = this.$refs.splitdialog;
|
471
471
|
let dialogStates = splitdialog.getContentsState();
|
@@ -478,7 +478,7 @@ export default {
|
|
478
478
|
delete entry.viewUrl;
|
479
479
|
if (entry.type === "MultiFlatmap" && "uberonId" in entry)
|
480
480
|
delete entry.uberonId;
|
481
|
-
if (
|
481
|
+
if (anonymousAnnotations === false) {
|
482
482
|
if (entry.type === "Scaffold" && entry?.state?.offlineAnnotations) {
|
483
483
|
delete entry.state.offlineAnnotations;
|
484
484
|
} else if (entry?.state?.state?.offlineAnnotations) {
|