@abi-software/flatmapvuer 0.5.10 → 0.6.0-vue3-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.
Files changed (41) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +105 -105
  3. package/babel.config.js +0 -14
  4. package/dist/favicon.ico +0 -0
  5. package/dist/flatmapvuer.js +69542 -0
  6. package/dist/flatmapvuer.umd.cjs +1021 -0
  7. package/dist/index.html +17 -0
  8. package/dist/style.css +1 -0
  9. package/package.json +87 -79
  10. package/public/index.html +17 -17
  11. package/src/App.vue +303 -228
  12. package/src/assets/_variables.scss +43 -43
  13. package/src/assets/styles.scss +6 -7
  14. package/src/components/AnnotationTool.vue +443 -403
  15. package/src/components/EventBus.js +3 -3
  16. package/src/components/ExternalResourceCard.vue +108 -99
  17. package/src/components/FlatmapVuer.vue +2117 -2070
  18. package/src/components/MultiFlatmapVuer.vue +603 -535
  19. package/src/components/ProvenancePopup.vue +496 -422
  20. package/src/components/SelectionsGroup.vue +258 -249
  21. package/src/components/Tooltip.vue +50 -52
  22. package/src/components/TreeControls.vue +234 -231
  23. package/src/components/index.js +6 -9
  24. package/src/components/legends/DynamicLegends.vue +106 -112
  25. package/src/components/legends/SvgLegends.vue +112 -67
  26. package/src/components.d.ts +46 -0
  27. package/src/icons/flatmap-marker.js +1 -1
  28. package/src/icons/fonts/mapicon-species.eot +0 -0
  29. package/src/icons/fonts/mapicon-species.svg +14 -14
  30. package/src/icons/fonts/mapicon-species.ttf +0 -0
  31. package/src/icons/fonts/mapicon-species.woff +0 -0
  32. package/src/icons/mapicon-species-style.css +42 -42
  33. package/src/icons/yellowstar.js +5 -5
  34. package/src/legends/legend.svg +25 -25
  35. package/src/main.js +4 -8
  36. package/src/services/flatmapQueries.js +451 -415
  37. package/vite.config.js +76 -0
  38. package/vue.config.js +45 -31
  39. package/CHANGELOG.md +0 -402
  40. package/package-lock.json +0 -18473
  41. package/src/nerve-map.js +0 -99
@@ -1,403 +1,443 @@
1
- <template>
2
- <el-main class="main">
3
- <div class="block">
4
- <el-row class="info-field">
5
- <span class="title">Feature Annotations</span>
6
- </el-row>
7
- <template v-if="annotationEntry">
8
- <el-row
9
- v-for="(key, label) in displayPair"
10
- v-show="annotationEntry[key]"
11
- class="dialog-text"
12
- :key="key"
13
- >
14
- <strong>{{ label }}: </strong> {{ annotationEntry[key] }}
15
- </el-row>
16
- <template v-if="prevSubs.length > 0">
17
- <div v-show="showSubmissions" class="hide" @click="showSubmissions = false">
18
- Hide previous submissions
19
- <i class="el-icon-arrow-up"></i>
20
- </div>
21
- <div v-show="!showSubmissions" class="hide" @click="showSubmissions = true">
22
- Show previous {{ prevSubs.length }} submission(s)
23
- <i class="el-icon-arrow-down"></i>
24
- </div>
25
- <template v-if="showSubmissions">
26
- <el-row class="dialog-spacer"></el-row>
27
- <el-row class="dialog-text">
28
- <strong class="sub-title">Previous submissions:</strong>
29
- </el-row>
30
- <div class="entry" v-for="(sub, index) in prevSubs" :key="index">
31
- <el-row class="dialog-text">
32
- <strong>{{ formatTime(sub.created) }}</strong> {{ sub.creator.name }}
33
- </el-row>
34
- <el-row class="dialog-text">
35
- <strong>Evidence: </strong>
36
- <el-row v-for="(evidence) in sub.evidence" :key="evidence" class="dialog-text">
37
- <a :href="evidence" target="_blank"> {{ evidence }}</a>
38
- </el-row>
39
- </el-row>
40
- <el-row class="dialog-text">
41
- <strong>Comment: </strong> {{ sub.comment }}
42
- </el-row>
43
- </div>
44
- </template>
45
- </template>
46
- <template v-if="authenticated">
47
- <template v-if="isEditable">
48
- <el-row class="dialog-spacer"></el-row>
49
- <el-row v-if="!editing">
50
- <i
51
- class="el-icon-edit standard-icon"
52
- @click="editing = true"
53
- />
54
- </el-row>
55
- <template v-else>
56
- <el-row class="dialog-text">
57
- <strong class="sub-title">Suggest changes:</strong>
58
- </el-row>
59
- <el-row class="dialog-text">
60
- <strong>Evidvence:</strong>
61
- </el-row>
62
- <el-row v-for="(value, index) in evidence" :key="value">
63
- <el-col :span="20">
64
- {{ evidence[index] }}
65
- </el-col>
66
- <el-col :span="4">
67
- <i
68
- class="el-icon-close standard-icon"
69
- @click="removeEvidence(index)"
70
- />
71
- </el-col>
72
- </el-row>
73
- <el-row>
74
- <el-input
75
- size="mini"
76
- placeholder="Enter"
77
- v-model="newEvidence"
78
- @change="evidenceEntered($event)"
79
- >
80
- <el-select
81
- :popper-append-to-body="false"
82
- v-model="evidencePrefix"
83
- placeholder="Select"
84
- class="select-box"
85
- popper-class="flatmap_dropdown"
86
- slot="prepend"
87
- >
88
- <el-option v-for="item in evidencePrefixes" :key="item" :label="item" :value="item">
89
- <el-row>
90
- <el-col :span="12">{{ item }}</el-col>
91
- </el-row>
92
- </el-option>
93
- </el-select>
94
- </el-input>
95
- </el-row>
96
- <el-row>
97
- <strong>Comment:</strong>
98
- </el-row>
99
- <el-row class="dialog-text">
100
- <el-input
101
- type="textarea"
102
- :autosize="{ minRows: 2, maxRows: 4}"
103
- placeholder="Enter"
104
- v-model="comment"
105
- />
106
- </el-row>
107
- <el-row class="dialog-text">
108
- <el-button
109
- class="button"
110
- type="primary"
111
- plain
112
- @click="submit"
113
- >
114
- Submit
115
- </el-button>
116
- </el-row>
117
- </template>
118
- <el-row class="dialog-text" v-if="errorMessage">
119
- <strong class="sub-title"> {{ errorMessage }}
120
- </strong>
121
- </el-row>
122
- </template>
123
- </template>
124
- </template>
125
- </div>
126
- </el-main>
127
- </template>
128
-
129
-
130
- <script>
131
- /* eslint-disable no-alert, no-console */
132
- /* eslint-disable no-alert, no-console */
133
- import Vue from "vue";
134
- import { AnnotationService } from "@abi-software/sparc-annotation";
135
- import { Button, Col, Input, Main, Row, Select } from "element-ui";
136
- import lang from "element-ui/lib/locale/lang/en";
137
- import locale from "element-ui/lib/locale";
138
-
139
- locale.use(lang);
140
- Vue.use(Button);
141
- Vue.use(Col);
142
- Vue.use(Input);
143
- Vue.use(Main);
144
- Vue.use(Row);
145
- Vue.use(Select);
146
-
147
- export default {
148
- name: "AnnotationTool",
149
- props: {
150
- annotationEntry: {
151
- type: Object,
152
- },
153
- },
154
- inject: ['flatmapAPI'],
155
- data: function() {
156
- return {
157
- displayPair: {
158
- "Feature ID": "featureId",
159
- "Tooltip": "label",
160
- "Models": "models",
161
- "Name": "name",
162
- "Resource": "resourceId"
163
- },
164
- editing: false,
165
- evidencePrefixes: [
166
- "DOI:",
167
- "PMID:",
168
- ],
169
- evidencePrefix: "DOI:",
170
- evidence: [ ],
171
- authenticated: false,
172
- newEvidence: '',
173
- comment: '',
174
- prevSubs: [ ],
175
- showSubmissions: true,
176
- errorMessage: "",
177
- }
178
- },
179
- computed: {
180
- isEditable: function() {
181
- return this.annotationEntry['resourceId'] && this.annotationEntry['featureId'];
182
- },
183
- },
184
- methods: {
185
- evidenceEntered: function(value) {
186
- if (value) {
187
- this.evidence.push(this.evidencePrefix + value);
188
- this.newEvidence = "";
189
- }
190
- },
191
- formatTime: function(dateString) {
192
- const options = { year: "numeric", month: "long", day: "numeric",
193
- hour: "numeric", minute: "numeric", second: "numeric" };
194
- return new Date(dateString).toLocaleDateString(undefined, options);
195
- },
196
- updatePrevSubmissions: function() {
197
- if (this.$annotator && this.authenticated) {
198
- if (this.annotationEntry['resourceId'] &&
199
- this.annotationEntry['featureId']) {
200
- this.$annotator.itemAnnotations(this.annotationEntry['resourceId'],
201
- this.annotationEntry['featureId']).then((value) => {
202
- this.prevSubs = value;
203
- })
204
- .catch((reason) => {
205
- console.log(reason); // Error!
206
- });
207
- }
208
- }
209
- },
210
- submit: function() {
211
- if ((this.evidence.length > 0) || this.comment) {
212
- if (this.annotationEntry['resourceId'] &&
213
- this.annotationEntry['featureId']) {
214
- const evidenceURLs = [];
215
- this.evidence.forEach((evidence) => {
216
- if (evidence.includes("DOI:")) {
217
- const link = evidence.replace("DOI:", "https://doi.org/");
218
- evidenceURLs.push(new URL(link));
219
- } else if (evidence.includes("PMID:")) {
220
- const link = evidence.replace("PMID:", "https://pubmed.ncbi.nlm.nih.gov/");
221
- evidenceURLs.push(new URL(link));
222
- }
223
- });
224
- const userAnnotation = {
225
- resource: this.annotationEntry['resourceId'],
226
- item: this.annotationEntry['featureId'],
227
- evidence: evidenceURLs,
228
- comment: this.comment,
229
- }
230
- this.$annotator.addAnnotation(userAnnotation).then(() => {
231
- this.errorMessage = "";
232
- this.resetSubmission();
233
- this.updatePrevSubmissions();
234
- })
235
- .catch(() => {
236
- this.errorMessage = "There is a problem with the submission, please try again later";
237
- });
238
- }
239
- }
240
- },
241
- removeEvidence: function(index) {
242
- this.evidence.splice(index, 1);
243
- },
244
- resetSubmission: function() {
245
- this.editing = false;
246
- this.evidence = [];
247
- this.newFeature = '';
248
- this.comment = '';
249
- },
250
- },
251
- watch: {
252
- annotationEntry: {
253
- handler: function() {
254
- this.resetSubmission();
255
- this.updatePrevSubmissions();
256
- },
257
- immediate: false,
258
- deep: false,
259
- }
260
- },
261
- mounted: function() {
262
- if (!this.$annotator) {
263
- Vue.prototype.$annotator = new AnnotationService(
264
- `${this.flatmapAPI}annotator`);
265
- }
266
- this.$annotator.authenticate().then((userData) => {
267
- if (userData.name && userData.email) {
268
- this.authenticated = true;
269
- this.updatePrevSubmissions();
270
- } else {
271
- this.errorMessage = "";
272
- }
273
- })
274
- }
275
- };
276
- </script>
277
-
278
- <style scoped lang="scss">
279
- @import "~element-ui/packages/theme-chalk/src/button";
280
- @import "~element-ui/packages/theme-chalk/src/col";
281
- @import "~element-ui/packages/theme-chalk/src/input";
282
- @import "~element-ui/packages/theme-chalk/src/main";
283
- @import "~element-ui/packages/theme-chalk/src/row";
284
- @import "~element-ui/packages/theme-chalk/src/select";
285
-
286
- .info-field {
287
- display:flex;
288
- }
289
-
290
- .block {
291
- margin-bottom: 0.5em;
292
- }
293
-
294
- .button {
295
- padding-top:5px;
296
- padding-bottom:5px;
297
- }
298
-
299
- .standard-icon {
300
- color: $app-primary-color;
301
- &:hover {
302
- cursor: pointer;
303
- }
304
- }
305
-
306
- .dialog-text {
307
- color: rgb(48, 49, 51);
308
- font-size: 14px;
309
- font-weight: normal;
310
- line-height: 20px;
311
- }
312
-
313
- .main {
314
- font-size: 14px;
315
- text-align: left;
316
- line-height: 1.5em;
317
- font-family: Asap, sans-serif,Helvetica;
318
- font-weight: 400;
319
- /* outline: thin red solid; */
320
- padding: 1em !important;
321
- overflow-x: hidden;
322
- overflow-y: auto;
323
- min-width: 20rem;
324
- max-height: 400px;
325
- scrollbar-width: thin;
326
-
327
- &::-webkit-scrollbar {
328
- width: 4px;
329
- }
330
-
331
- &::-webkit-scrollbar-thumb {
332
- border-radius: 10px;
333
- box-shadow: inset 0 0 6px #c0c4cc;
334
- }
335
- }
336
-
337
- .title {
338
- font-size: 18px;
339
- font-weight: 500;
340
- font-weight: bold;
341
- padding-bottom: 8px;
342
- color: rgb(131, 0, 191);
343
- }
344
-
345
- .sub-title {
346
- font-size: 16px;
347
- }
348
-
349
-
350
- .dialog-spacer {
351
- border-bottom: 1px solid #e4e7ed;
352
- margin-bottom: 10px;
353
- }
354
-
355
- .submit {
356
- color: $app-primary-color;
357
- &:hover {
358
- cursor: pointer;
359
- }
360
- }
361
-
362
- .entry ~ .entry {
363
- border-top: 1px solid #e4e7ed;
364
- margin-top: 10px;
365
- }
366
-
367
- .hide{
368
- color: $app-primary-color;
369
- cursor: pointer;
370
- margin-right: 6px;
371
- margin-top: 3px;
372
- }
373
-
374
- ::v-deep .el-input__inner, ::v-deep .el-textarea__inner{
375
- font-family: Asap, sans-serif;
376
- }
377
-
378
- .select-box {
379
- width:80px;
380
- background-color: var(--white);
381
- font-weight: 500;
382
- color:rgb(48, 49, 51);;
383
- ::v-deep .el-input__inner {
384
- height:30px;
385
- color: rgb(48, 49, 51);
386
- }
387
- ::v-deep .el-input__icon {
388
- line-height:30px
389
- }
390
- }
391
-
392
- ::v-deep .flatmap_dropdown {
393
- min-width: 80px!important;
394
- .el-select-dropdown__item {
395
- white-space: nowrap;
396
- text-align: left;
397
- &.selected {
398
- color: $app-primary-color;
399
- font-weight: normal;
400
- }
401
- }
402
- }
403
- </style>
1
+ <template>
2
+ <el-main class="main">
3
+ <div class="block">
4
+ <el-row class="info-field">
5
+ <span class="title">Feature Annotations</span>
6
+ </el-row>
7
+ <template v-if="annotationEntry">
8
+ <el-row
9
+ v-for="(key, label) in displayPair"
10
+ v-show="annotationEntry[key]"
11
+ class="dialog-text"
12
+ :key="key"
13
+ >
14
+ <strong>{{ label }}: </strong> {{ annotationEntry[key] }}
15
+ </el-row>
16
+ <template v-if="prevSubs.length > 0">
17
+ <div
18
+ v-show="showSubmissions"
19
+ class="hide"
20
+ @click="showSubmissions = false"
21
+ >
22
+ Hide previous submissions
23
+ <el-icon><el-icon-arrow-up /></el-icon>
24
+ </div>
25
+ <div
26
+ v-show="!showSubmissions"
27
+ class="hide"
28
+ @click="showSubmissions = true"
29
+ >
30
+ Show previous {{ prevSubs.length }} submission(s)
31
+ <el-icon><el-icon-arrow-down /></el-icon>
32
+ </div>
33
+ <template v-if="showSubmissions">
34
+ <el-row class="dialog-spacer"></el-row>
35
+ <el-row class="dialog-text">
36
+ <strong class="sub-title">Previous submissions:</strong>
37
+ </el-row>
38
+ <div class="entry" v-for="(sub, index) in prevSubs" :key="index">
39
+ <el-row class="dialog-text">
40
+ <strong>{{ formatTime(sub.created) }}</strong>
41
+ {{ sub.creator.name }}
42
+ </el-row>
43
+ <el-row class="dialog-text">
44
+ <strong>Evidence: </strong>
45
+ <el-row
46
+ v-for="evidence in sub.evidence"
47
+ :key="evidence"
48
+ class="dialog-text"
49
+ >
50
+ <a :href="evidence" target="_blank"> {{ evidence }}</a>
51
+ </el-row>
52
+ </el-row>
53
+ <el-row class="dialog-text">
54
+ <strong>Comment: </strong> {{ sub.comment }}
55
+ </el-row>
56
+ </div>
57
+ </template>
58
+ </template>
59
+ <template v-if="authenticated">
60
+ <template v-if="isEditable">
61
+ <el-row class="dialog-spacer"></el-row>
62
+ <el-row v-if="!editing">
63
+ <el-icon class="standard-icon"><el-icon-edit /></el-icon>
64
+ </el-row>
65
+ <template v-else>
66
+ <el-row class="dialog-text">
67
+ <strong class="sub-title">Suggest changes:</strong>
68
+ </el-row>
69
+ <el-row class="dialog-text">
70
+ <strong>Evidvence:</strong>
71
+ </el-row>
72
+ <el-row v-for="(value, index) in evidence" :key="value">
73
+ <el-col :span="20">
74
+ {{ evidence[index] }}
75
+ </el-col>
76
+ <el-col :span="4">
77
+ <el-icon class="standard-icon"><el-icon-close /></el-icon>
78
+ </el-col>
79
+ </el-row>
80
+ <el-row>
81
+ <el-input
82
+ size="mini"
83
+ placeholder="Enter"
84
+ v-model="newEvidence"
85
+ @change="evidenceEntered($event)"
86
+ >
87
+ <template #prepend>
88
+ <el-select
89
+ :teleported="false"
90
+ v-model="evidencePrefix"
91
+ placeholder="Select"
92
+ class="select-box"
93
+ popper-class="flatmap_dropdown"
94
+ >
95
+ <el-option
96
+ v-for="item in evidencePrefixes"
97
+ :key="item"
98
+ :label="item"
99
+ :value="item"
100
+ >
101
+ <el-row>
102
+ <el-col :span="12">{{ item }}</el-col>
103
+ </el-row>
104
+ </el-option>
105
+ </el-select>
106
+ </template>
107
+ </el-input>
108
+ </el-row>
109
+ <el-row>
110
+ <strong>Comment:</strong>
111
+ </el-row>
112
+ <el-row class="dialog-text">
113
+ <el-input
114
+ type="textarea"
115
+ :autosize="{ minRows: 2, maxRows: 4 }"
116
+ placeholder="Enter"
117
+ v-model="comment"
118
+ />
119
+ </el-row>
120
+ <el-row class="dialog-text">
121
+ <el-button class="button" type="primary" plain @click="submit">
122
+ Submit
123
+ </el-button>
124
+ </el-row>
125
+ </template>
126
+ <el-row class="dialog-text" v-if="errorMessage">
127
+ <strong class="sub-title"> {{ errorMessage }} </strong>
128
+ </el-row>
129
+ </template>
130
+ </template>
131
+ </template>
132
+ </div>
133
+ </el-main>
134
+ </template>
135
+
136
+ <script>
137
+ import {
138
+ ArrowUp as ElIconArrowUp,
139
+ ArrowDown as ElIconArrowDown,
140
+ Edit as ElIconEdit,
141
+ Close as ElIconClose,
142
+ } from '@element-plus/icons-vue'
143
+ /* eslint-disable no-alert, no-console */
144
+ /* eslint-disable no-alert, no-console */
145
+ import { AnnotationService } from '@abi-software/sparc-annotation'
146
+ import {
147
+ ElButton as Button,
148
+ ElCol as Col,
149
+ ElInput as Input,
150
+ ElMain as Main,
151
+ ElRow as Row,
152
+ ElSelect as Select,
153
+ } from 'element-plus'
154
+
155
+ export default {
156
+ name: 'AnnotationTool',
157
+ components: {
158
+ Button,
159
+ Col,
160
+ Input,
161
+ Main,
162
+ Row,
163
+ Select,
164
+ ElIconArrowUp,
165
+ ElIconArrowDown,
166
+ ElIconEdit,
167
+ ElIconClose,
168
+ },
169
+ props: {
170
+ annotationEntry: {
171
+ type: Object,
172
+ },
173
+ },
174
+ inject: ['flatmapAPI'],
175
+ data: function () {
176
+ return {
177
+ displayPair: {
178
+ 'Feature ID': 'featureId',
179
+ Tooltip: 'label',
180
+ Models: 'models',
181
+ Name: 'name',
182
+ Resource: 'resourceId',
183
+ },
184
+ editing: false,
185
+ evidencePrefixes: ['DOI:', 'PMID:'],
186
+ evidencePrefix: 'DOI:',
187
+ evidence: [],
188
+ authenticated: false,
189
+ newEvidence: '',
190
+ comment: '',
191
+ prevSubs: [],
192
+ showSubmissions: true,
193
+ errorMessage: '',
194
+ }
195
+ },
196
+ computed: {
197
+ isEditable: function () {
198
+ return (
199
+ this.annotationEntry['resourceId'] && this.annotationEntry['featureId']
200
+ )
201
+ },
202
+ },
203
+ methods: {
204
+ evidenceEntered: function (value) {
205
+ if (value) {
206
+ this.evidence.push(this.evidencePrefix + value)
207
+ this.newEvidence = ''
208
+ }
209
+ },
210
+ formatTime: function (dateString) {
211
+ const options = {
212
+ year: 'numeric',
213
+ month: 'long',
214
+ day: 'numeric',
215
+ hour: 'numeric',
216
+ minute: 'numeric',
217
+ second: 'numeric',
218
+ }
219
+ return new Date(dateString).toLocaleDateString(undefined, options)
220
+ },
221
+ updatePrevSubmissions: function () {
222
+ if (this.$annotator && this.authenticated) {
223
+ if (
224
+ this.annotationEntry['resourceId'] &&
225
+ this.annotationEntry['featureId']
226
+ ) {
227
+ this.$annotator
228
+ .itemAnnotations(
229
+ this.annotationEntry['resourceId'],
230
+ this.annotationEntry['featureId']
231
+ )
232
+ .then((value) => {
233
+ this.prevSubs = value
234
+ })
235
+ .catch((reason) => {
236
+ console.log(reason) // Error!
237
+ })
238
+ }
239
+ }
240
+ },
241
+ submit: function () {
242
+ if (this.evidence.length > 0 || this.comment) {
243
+ if (
244
+ this.annotationEntry['resourceId'] &&
245
+ this.annotationEntry['featureId']
246
+ ) {
247
+ const evidenceURLs = []
248
+ this.evidence.forEach((evidence) => {
249
+ if (evidence.includes('DOI:')) {
250
+ const link = evidence.replace('DOI:', 'https://doi.org/')
251
+ evidenceURLs.push(new URL(link))
252
+ } else if (evidence.includes('PMID:')) {
253
+ const link = evidence.replace(
254
+ 'PMID:',
255
+ 'https://pubmed.ncbi.nlm.nih.gov/'
256
+ )
257
+ evidenceURLs.push(new URL(link))
258
+ }
259
+ })
260
+ const userAnnotation = {
261
+ resource: this.annotationEntry['resourceId'],
262
+ item: this.annotationEntry['featureId'],
263
+ evidence: evidenceURLs,
264
+ comment: this.comment,
265
+ }
266
+ this.$annotator
267
+ .addAnnotation(userAnnotation)
268
+ .then(() => {
269
+ this.errorMessage = ''
270
+ this.resetSubmission()
271
+ this.updatePrevSubmissions()
272
+ })
273
+ .catch(() => {
274
+ this.errorMessage =
275
+ 'There is a problem with the submission, please try again later'
276
+ })
277
+ }
278
+ }
279
+ },
280
+ removeEvidence: function (index) {
281
+ this.evidence.splice(index, 1)
282
+ },
283
+ resetSubmission: function () {
284
+ this.editing = false
285
+ this.evidence = []
286
+ this.newFeature = ''
287
+ this.comment = ''
288
+ },
289
+ },
290
+ watch: {
291
+ annotationEntry: {
292
+ handler: function () {
293
+ this.resetSubmission()
294
+ this.updatePrevSubmissions()
295
+ },
296
+ immediate: false,
297
+ deep: false,
298
+ },
299
+ },
300
+ mounted: function () {
301
+ if (!this.$annotator) {
302
+ this.$annotator = new AnnotationService(
303
+ `${this.flatmapAPI}annotator`
304
+ )
305
+ }
306
+ this.$annotator.authenticate().then((userData) => {
307
+ if (userData.name && userData.email) {
308
+ this.authenticated = true
309
+ this.updatePrevSubmissions()
310
+ } else {
311
+ this.errorMessage = ''
312
+ }
313
+ })
314
+ },
315
+ }
316
+ </script>
317
+
318
+ <style lang="scss" scoped>
319
+ @use 'element-plus/theme-chalk/src/button';
320
+ @use 'element-plus/theme-chalk/src/col';
321
+ @use 'element-plus/theme-chalk/src/input';
322
+ @use 'element-plus/theme-chalk/src/main';
323
+ @use 'element-plus/theme-chalk/src/row';
324
+ @use 'element-plus/theme-chalk/src/select';
325
+
326
+ .info-field {
327
+ display: flex;
328
+ }
329
+
330
+ .block {
331
+ margin-bottom: 0.5em;
332
+ }
333
+
334
+ .button {
335
+ padding-top: 5px;
336
+ padding-bottom: 5px;
337
+ }
338
+
339
+ .standard-icon {
340
+ color: $app-primary-color;
341
+ &:hover {
342
+ cursor: pointer;
343
+ }
344
+ }
345
+
346
+ .dialog-text {
347
+ color: rgb(48, 49, 51);
348
+ font-size: 14px;
349
+ font-weight: normal;
350
+ line-height: 20px;
351
+ }
352
+
353
+ .main {
354
+ font-size: 14px;
355
+ text-align: left;
356
+ line-height: 1.5em;
357
+ font-family: Asap, sans-serif, Helvetica;
358
+ font-weight: 400;
359
+ /* outline: thin red solid; */
360
+ padding: 1em !important;
361
+ overflow-x: hidden;
362
+ overflow-y: auto;
363
+ min-width: 20rem;
364
+ max-height: 400px;
365
+ scrollbar-width: thin;
366
+
367
+ &::-webkit-scrollbar {
368
+ width: 4px;
369
+ }
370
+
371
+ &::-webkit-scrollbar-thumb {
372
+ border-radius: 10px;
373
+ box-shadow: inset 0 0 6px #c0c4cc;
374
+ }
375
+ }
376
+
377
+ .title {
378
+ font-size: 18px;
379
+ font-weight: 500;
380
+ font-weight: bold;
381
+ padding-bottom: 8px;
382
+ color: rgb(131, 0, 191);
383
+ }
384
+
385
+ .sub-title {
386
+ font-size: 16px;
387
+ }
388
+
389
+ .dialog-spacer {
390
+ border-bottom: 1px solid #e4e7ed;
391
+ margin-bottom: 10px;
392
+ }
393
+
394
+ .submit {
395
+ color: $app-primary-color;
396
+ &:hover {
397
+ cursor: pointer;
398
+ }
399
+ }
400
+
401
+ .entry ~ .entry {
402
+ border-top: 1px solid #e4e7ed;
403
+ margin-top: 10px;
404
+ }
405
+
406
+ .hide {
407
+ color: $app-primary-color;
408
+ cursor: pointer;
409
+ margin-right: 6px;
410
+ margin-top: 3px;
411
+ }
412
+
413
+ :deep(.el-input__inner),
414
+ :deep(.el-textarea__inner) {
415
+ font-family: Asap, sans-serif;
416
+ }
417
+
418
+ .select-box {
419
+ width: 80px;
420
+ background-color: var(--white);
421
+ font-weight: 500;
422
+ color: rgb(48, 49, 51);
423
+ :deep(.el-input__inner) {
424
+ height: 30px;
425
+ color: rgb(48, 49, 51);
426
+ }
427
+ :deep(.el-input__icon) {
428
+ line-height: 30px;
429
+ }
430
+ }
431
+
432
+ :deep(.flatmap_dropdown) {
433
+ min-width: 80px !important;
434
+ .el-select-dropdown__item {
435
+ white-space: nowrap;
436
+ text-align: left;
437
+ &.selected {
438
+ color: $app-primary-color;
439
+ font-weight: normal;
440
+ }
441
+ }
442
+ }
443
+ </style>