@abi-software/mapintegratedvuer 1.21.1 → 1.22.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 (68) hide show
  1. package/README.md +23 -5
  2. package/assets/location-icon.html +33 -1
  3. package/assets/styleguide.css +18 -18
  4. package/cypress.config.js +7 -9
  5. package/dist/{ConnectivityGraph-CZMROk9r.js → ConnectivityGraph-BBZ3Dgat.js} +3 -3
  6. package/dist/{ContentMixin-Vn34n5t2.js → ContentMixin-B-O_IwPg.js} +16 -18
  7. package/dist/{DynamicMarkerMixin-BS6t7w_i.js → DynamicMarkerMixin-B9iqtP_f.js} +1 -1
  8. package/dist/{Flatmap-BejxA0uz.js → Flatmap-BoEFI50b.js} +4 -4
  9. package/dist/{Iframe-BWbhTjCR.js → Iframe-Slj-LQTF.js} +4 -4
  10. package/dist/{MultiFlatmap-nlmsH-Ib.js → MultiFlatmap-l6aBn6x3.js} +17 -5
  11. package/dist/{Plot-ChbPsDZX.js → Plot-CIhEip5b.js} +2 -2
  12. package/dist/{Scaffold-C6f7c7Ha.js → Scaffold-D5ZGCDvt.js} +4 -4
  13. package/dist/{Simulation-DcJScRYo.js → Simulation-C5o5DXRb.js} +2 -2
  14. package/dist/{connectivities-UXTqf7_0.js → connectivities-Br3MpoAv.js} +154 -95
  15. package/dist/index.html +9 -6
  16. package/dist/mapintegratedvuer.js +5506 -5582
  17. package/dist/mapintegratedvuer.umd.cjs +196 -196
  18. package/dist/style.css +1 -1
  19. package/eslint.config.js +39 -15
  20. package/package.json +12 -6
  21. package/public/index.html +9 -6
  22. package/src/App.vue +224 -255
  23. package/src/assets/_variables.scss +12 -10
  24. package/src/assets/header-icon.scss +8 -9
  25. package/src/assets/mapicon-species-style.css +10 -8
  26. package/src/assets/styles.scss +1 -1
  27. package/src/components/ContentBar.vue +99 -106
  28. package/src/components/ContentVuer.vue +36 -39
  29. package/src/components/ContextCard.vue +238 -199
  30. package/src/components/ContextHelp.vue +22 -26
  31. package/src/components/CustomSplitter.vue +32 -43
  32. package/src/components/DatasetHeader.vue +37 -41
  33. package/src/components/DialogToolbarContent.vue +292 -256
  34. package/src/components/FlatmapContextCard.vue +52 -57
  35. package/src/components/MapContent.vue +111 -87
  36. package/src/components/ResizeSensor.vue +8 -13
  37. package/src/components/SearchControls.vue +26 -35
  38. package/src/components/SimulatedData.js +196 -219
  39. package/src/components/SplitDialog.vue +139 -129
  40. package/src/components/SplitFlow.vue +433 -239
  41. package/src/components/index.js +1 -3
  42. package/src/components/scripts/simulation_data.js +393 -397
  43. package/src/components/scripts/utilities.js +108 -78
  44. package/src/components/viewers/CellDLViewer.vue +9 -9
  45. package/src/components/viewers/ConnectivityGraph.vue +9 -12
  46. package/src/components/viewers/Flatmap.vue +23 -25
  47. package/src/components/viewers/Iframe.vue +8 -10
  48. package/src/components/viewers/MultiFlatmap.vue +73 -69
  49. package/src/components/viewers/Plot.vue +6 -7
  50. package/src/components/viewers/Scaffold.vue +73 -63
  51. package/src/components/viewers/Simulation.vue +10 -15
  52. package/src/main.js +16 -21
  53. package/src/mixins/ContentMixin.js +208 -178
  54. package/src/mixins/DynamicMarkerMixin.js +14 -18
  55. package/src/mixins/RetrieveContextCardMixin.js +35 -30
  56. package/src/mixins/S3Bucket.vue +10 -13
  57. package/src/services/knowledgeMapping.js +53 -53
  58. package/src/services/tagging.js +4 -4
  59. package/src/stores/connectivities.js +46 -8
  60. package/src/stores/entries.js +7 -9
  61. package/src/stores/index.js +7 -7
  62. package/src/stores/settings.js +23 -31
  63. package/src/stores/splitFlow.js +395 -298
  64. package/vite.bundle-build.js +24 -26
  65. package/vite.config.js +22 -21
  66. package/vite.static-build.js +4 -4
  67. package/vitest.workspace.js +1 -3
  68. package/vuese-generator.js +47 -55
@@ -1,14 +1,16 @@
1
1
  <template>
2
- <div v-loading="loading" class="flatmap-context-card" >
2
+ <div v-loading="loading" class="flatmap-context-card">
3
3
  <div class="card-right scrollbar">
4
4
  <div class="title">Flatmap Provenance</div>
5
- SCKAN version: <a :href="sckanReleaseLink" target="_blank"> {{sckanReleaseDisplay}} </a>
6
- <br>
7
- Published on:
8
- {{flatmapPublishedDisplay}}
9
- <br>
10
- View publication <a :href="flatmapSource" class="publication-link" target="_blank">here</a>
11
- <br/>
5
+ SCKAN version:
6
+ <a :href="sckanReleaseLink" target="_blank">{{ sckanReleaseDisplay }}</a>
7
+ <br />
8
+ Published on:
9
+ {{ flatmapPublishedDisplay }}
10
+ <br />
11
+ View publication
12
+ <a :href="flatmapSource" class="publication-link" target="_blank">here</a>
13
+ <br />
12
14
  </div>
13
15
 
14
16
  <!-- Copy to clipboard button container -->
@@ -18,20 +20,14 @@
18
20
  </div>
19
21
  </template>
20
22
 
21
-
22
23
  <script>
23
- /* eslint-disable no-alert, no-console */
24
- import {
25
- ElLoading as Loading
26
- } from "element-plus";
27
- import { CopyToClipboard } from "@abi-software/map-utilities";
24
+ import { CopyToClipboard } from '@abi-software/map-utilities';
28
25
  import tagging from '../services/tagging';
29
26
  import '@abi-software/map-utilities/dist/style.css';
30
27
 
31
28
  export default {
32
- name: "FlatmapContextCard",
29
+ name: 'FlatmapContextCard',
33
30
  components: {
34
- Loading,
35
31
  CopyToClipboard,
36
32
  },
37
33
  props: {
@@ -51,57 +47,59 @@ export default {
51
47
  };
52
48
  },
53
49
  computed: {
54
- flatmapPublishedDisplay: function() {
55
- let flatmapPublished = "Unknown"
56
- if(this.mapImpProv){
50
+ flatmapPublishedDisplay: function () {
51
+ let flatmapPublished = 'Unknown';
52
+ if (this.mapImpProv) {
57
53
  flatmapPublished = new Date(this.mapImpProv.created).toLocaleDateString('en-US', {
58
- day: '2-digit',
59
- month: 'long',
60
- year: 'numeric',
61
- })
54
+ day: '2-digit',
55
+ month: 'long',
56
+ year: 'numeric',
57
+ });
62
58
  }
63
- return flatmapPublished
59
+ return flatmapPublished;
64
60
  },
65
- sckanReleaseDisplay: function() {
66
- let sckanRelease = "Unknown"
67
- if(this.mapImpProv){
68
- sckanRelease = this.mapImpProv.connectivity?.npo?.date
61
+ sckanReleaseDisplay: function () {
62
+ let sckanRelease = 'Unknown';
63
+ if (this.mapImpProv) {
64
+ sckanRelease = this.mapImpProv.connectivity?.npo?.date;
69
65
  if (!sckanRelease) {
70
- let sckanCreated = this.mapImpProv.sckan?.created ? this.mapImpProv.sckan.created : this.mapImpProv.sckan
66
+ let sckanCreated = this.mapImpProv.sckan?.created
67
+ ? this.mapImpProv.sckan.created
68
+ : this.mapImpProv.sckan;
71
69
  if (sckanCreated) {
72
- let isoTime = sckanCreated.replace(',', '.') // Date time does not accept commas but Sckan uses them
70
+ let isoTime = sckanCreated.replace(',', '.'); // Date time does not accept commas but Sckan uses them
73
71
  sckanRelease = new Date(isoTime).toLocaleDateString('en-US', {
74
- day: '2-digit',
75
- month: 'long',
76
- year: 'numeric',
77
- })
72
+ day: '2-digit',
73
+ month: 'long',
74
+ year: 'numeric',
75
+ });
78
76
  }
79
77
  }
80
78
  if (!sckanRelease) {
81
- sckanRelease = "Unknown";
79
+ sckanRelease = 'Unknown';
82
80
  }
83
81
  }
84
- return sckanRelease
82
+ return sckanRelease;
85
83
  },
86
- sckanReleaseLink: function() {
87
- let sckanLink = "Unknown"
88
- if(this.mapImpProv){
89
- sckanLink = this.mapImpProv.connectivity?.npo?.path
84
+ sckanReleaseLink: function () {
85
+ let sckanLink = 'Unknown';
86
+ if (this.mapImpProv) {
87
+ sckanLink = this.mapImpProv.connectivity?.npo?.path;
90
88
  if (!sckanLink) {
91
- sckanLink = this.mapImpProv.sckan?.release
89
+ sckanLink = this.mapImpProv.sckan?.release;
92
90
  }
93
91
  if (!sckanLink) {
94
- sckanLink = "Unknown"
92
+ sckanLink = 'Unknown';
95
93
  }
96
94
  }
97
- return sckanLink
95
+ return sckanLink;
98
96
  },
99
- flatmapSource: function() {
100
- let flatmapSource = "Unknown"
101
- if(this.mapImpProv){
102
- flatmapSource = this.mapImpProv.source
97
+ flatmapSource: function () {
98
+ let flatmapSource = 'Unknown';
99
+ if (this.mapImpProv) {
100
+ flatmapSource = this.mapImpProv.source;
103
101
  }
104
- return flatmapSource
102
+ return flatmapSource;
105
103
  },
106
104
  updatedCopyContent: function () {
107
105
  const contentArray = [];
@@ -132,10 +130,10 @@ export default {
132
130
  methods: {
133
131
  onCopied: function () {
134
132
  tagging.sendEvent({
135
- 'event': 'interaction_event',
136
- 'event_name': `portal_maps_context_card_copy`,
137
- 'category': this.mapImpProv?.id || 'Flatmap Provenance',
138
- 'location': 'map_toolbar'
133
+ event: 'interaction_event',
134
+ event_name: `portal_maps_context_card_copy`,
135
+ category: this.mapImpProv?.id || 'Flatmap Provenance',
136
+ location: 'map_toolbar',
139
137
  });
140
138
  },
141
139
  },
@@ -144,9 +142,7 @@ export default {
144
142
 
145
143
  <!-- Add "scoped" attribute to limit CSS to this component only -->
146
144
  <style scoped lang="scss">
147
-
148
-
149
- .flatmap-context-card{
145
+ .flatmap-context-card {
150
146
  background-color: white;
151
147
  font-size: 12px;
152
148
  position: relative;
@@ -164,11 +160,10 @@ export default {
164
160
  cursor: pointer;
165
161
  }
166
162
 
167
- .title{
163
+ .title {
168
164
  font-weight: bold;
169
165
  }
170
166
 
171
-
172
167
  .scrollbar::-webkit-scrollbar-track {
173
168
  border-radius: 10px;
174
169
  background-color: #f5f5f5;
@@ -1,25 +1,24 @@
1
1
  <template>
2
- <div
3
- ref="MapApp"
4
- v-loading="!isReady"
5
- class="mapcontent"
6
- element-loading-text="Loading..."
7
- element-loading-background="rgba(0, 0, 0, 0.3)"
8
- >
9
- <map-svg-sprite-color/>
10
- <SplitFlow
11
- v-if="isReady"
12
- @onFullscreen="onFullscreen"
13
- :state="stateToSet"
14
- :showLongLabel="showLongLabel"
15
- ref="flow"
16
- @vue:mounted="flowMounted"
17
- />
18
- </div>
2
+ <div
3
+ ref="MapApp"
4
+ v-loading="!isReady"
5
+ class="mapcontent"
6
+ element-loading-text="Loading..."
7
+ element-loading-background="rgba(0, 0, 0, 0.3)"
8
+ >
9
+ <map-svg-sprite-color />
10
+ <SplitFlow
11
+ v-if="isReady"
12
+ @onFullscreen="onFullscreen"
13
+ :state="stateToSet"
14
+ :showLongLabel="showLongLabel"
15
+ ref="flow"
16
+ @vue:mounted="flowMounted"
17
+ />
18
+ </div>
19
19
  </template>
20
20
 
21
21
  <script>
22
- /* eslint-disable no-alert, no-console */
23
22
  import { computed } from 'vue';
24
23
  import Tagging from '../services/tagging.js';
25
24
  import SplitFlow from './SplitFlow.vue';
@@ -28,21 +27,17 @@ import { mapStores } from 'pinia';
28
27
  import { useSettingsStore } from '../stores/settings';
29
28
  import { useSplitFlowStore } from '../stores/splitFlow';
30
29
  import { defaultSpecies, findSpeciesKey } from './scripts/utilities.js';
31
- import { MapSvgSpriteColor} from '@abi-software/svg-sprite';
32
- import { initialState, getBodyScaffoldInfo } from "./scripts/utilities.js";
33
- import RetrieveContextCardMixin from "../mixins/RetrieveContextCardMixin.js"
34
- import {
35
- ElLoading as Loading
36
- } from "element-plus";
30
+ import { MapSvgSpriteColor } from '@abi-software/svg-sprite';
31
+ import { initialState, getBodyScaffoldInfo } from './scripts/utilities.js';
32
+ import RetrieveContextCardMixin from '../mixins/RetrieveContextCardMixin.js';
37
33
 
38
34
  /**
39
35
  * Content of the app. More work flows will be added here.
40
36
  */
41
37
  export default {
42
- name: "MapContent",
38
+ name: 'MapContent',
43
39
  components: {
44
40
  MapSvgSpriteColor,
45
- Loading,
46
41
  SplitFlow,
47
42
  },
48
43
  mixins: [RetrieveContextCardMixin],
@@ -52,14 +47,14 @@ export default {
52
47
  */
53
48
  shareLink: {
54
49
  type: String,
55
- default: undefined
50
+ default: undefined,
56
51
  },
57
52
  /**
58
53
  * State containing state of the scaffold.
59
54
  */
60
55
  state: {
61
56
  type: Object,
62
- default: undefined
57
+ default: undefined,
63
58
  },
64
59
  showLongLabel: {
65
60
  type: Boolean,
@@ -79,14 +74,14 @@ export default {
79
74
  options: {
80
75
  type: Object,
81
76
  default: () => ({}),
82
- required: true
77
+ required: true,
83
78
  },
84
79
  /**
85
80
  * New option to start the map in AC, FC or WholeBody.
86
81
  */
87
82
  startingMap: {
88
83
  type: String,
89
- default: "AC"
84
+ default: 'AC',
90
85
  },
91
86
  /**
92
87
  * To use help-mode-dialog when user clicks "Help".
@@ -109,7 +104,7 @@ export default {
109
104
  * The option to show annotation in sidebar.
110
105
  * Default is `true`. Set `false` to show as popup on map.
111
106
  */
112
- annotationSidebar: {
107
+ annotationSidebar: {
113
108
  type: Boolean,
114
109
  default: true,
115
110
  },
@@ -117,7 +112,7 @@ export default {
117
112
  * All panes including primary default viewer will be closable
118
113
  * when this is set to true.
119
114
  */
120
- allClosable: {
115
+ allClosable: {
121
116
  type: Boolean,
122
117
  default: true,
123
118
  },
@@ -137,6 +132,16 @@ export default {
137
132
  type: Boolean,
138
133
  default: true,
139
134
  },
135
+ /**
136
+ * The option to open a species from the species dropdown's "open new view"
137
+ * in a split view. From a single view, it opens as a vertical split on the right.
138
+ * From a split view, it replaces the other pane's view.
139
+ * Default is `true`.
140
+ */
141
+ openNewSpeciesInSplitView: {
142
+ type: Boolean,
143
+ default: true,
144
+ },
140
145
  },
141
146
  provide: function () {
142
147
  return {
@@ -151,7 +156,7 @@ export default {
151
156
  isReady: false,
152
157
  initialState: undefined,
153
158
  displaySearchFromQuery: '',
154
- }
159
+ };
155
160
  },
156
161
  methods: {
157
162
  /**
@@ -159,31 +164,35 @@ export default {
159
164
  * Function to check whether it is in fullscreen mode or not.
160
165
  *
161
166
  */
162
- isFullscreen: function(){
163
- return (document.fullscreenElement || document.webkitFullscreenElement ||
164
- document.mozFullScreenElement || document.msFullscreenElement )
167
+ isFullscreen: function () {
168
+ return (
169
+ document.fullscreenElement ||
170
+ document.webkitFullscreenElement ||
171
+ document.mozFullScreenElement ||
172
+ document.msFullscreenElement
173
+ );
165
174
  },
166
175
  /**
167
176
  * @public
168
177
  * Function to toggle fullscreen.
169
178
  * @arg `fullscreenReq`
170
179
  */
171
- onFullscreen: function(fullscreenReq) {
180
+ onFullscreen: function (fullscreenReq) {
172
181
  //If a request is sent, try it
173
- if (fullscreenReq !== undefined){
174
- if (fullscreenReq && !this.isFullscreen()){
175
- this.goFullscreen()
182
+ if (fullscreenReq !== undefined) {
183
+ if (fullscreenReq && !this.isFullscreen()) {
184
+ this.goFullscreen();
176
185
  }
177
- if(!fullscreenReq && this.isFullscreen()){
178
- this.leaveFullscreen()
186
+ if (!fullscreenReq && this.isFullscreen()) {
187
+ this.leaveFullscreen();
179
188
  }
180
189
  }
181
190
  // Else we toggle fullscreen
182
- else{
183
- if(this.isFullscreen()){
184
- this.leaveFullscreen()
191
+ else {
192
+ if (this.isFullscreen()) {
193
+ this.leaveFullscreen();
185
194
  } else {
186
- this.goFullscreen()
195
+ this.goFullscreen();
187
196
  }
188
197
  }
189
198
  },
@@ -191,15 +200,18 @@ export default {
191
200
  * @public
192
201
  * Function to leave fullscreen mode.
193
202
  */
194
- leaveFullscreen: function(){
203
+ leaveFullscreen: function () {
195
204
  if (this.isFullscreen()) {
196
205
  if (document.exitFullscreen) {
197
206
  document.exitFullscreen();
198
- } else if (document.mozCancelFullScreen) { /* Firefox */
207
+ } else if (document.mozCancelFullScreen) {
208
+ /* Firefox */
199
209
  document.mozCancelFullScreen();
200
- } else if (document.webkitExitFullscreen) { /* Chrome, Safari and Opera */
210
+ } else if (document.webkitExitFullscreen) {
211
+ /* Chrome, Safari and Opera */
201
212
  document.webkitExitFullscreen();
202
- } else if (document.msExitFullscreen) { /* IE/Edge */
213
+ } else if (document.msExitFullscreen) {
214
+ /* IE/Edge */
203
215
  document.msExitFullscreen();
204
216
  }
205
217
 
@@ -211,15 +223,18 @@ export default {
211
223
  * @public
212
224
  * Function to go to fullscreen mode.
213
225
  */
214
- goFullscreen: function(){
226
+ goFullscreen: function () {
215
227
  let mapApp = this.$refs.MapApp;
216
228
  if (mapApp.requestFullscreen) {
217
229
  mapApp.requestFullscreen();
218
- } else if (mapApp.mozRequestFullScreen) { /* Firefox */
230
+ } else if (mapApp.mozRequestFullScreen) {
231
+ /* Firefox */
219
232
  mapApp.mozRequestFullScreen();
220
- } else if (mapApp.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
233
+ } else if (mapApp.webkitRequestFullscreen) {
234
+ /* Chrome, Safari and Opera */
221
235
  mapApp.webkitRequestFullscreen();
222
- } else if (parent.msRequestFullscreen) { /* IE/Edge */
236
+ } else if (parent.msRequestFullscreen) {
237
+ /* IE/Edge */
223
238
  mapApp.msRequestFullscreen();
224
239
  }
225
240
 
@@ -239,7 +254,7 @@ export default {
239
254
  *
240
255
  * @arg `state`
241
256
  */
242
- setState: function(state){
257
+ setState: function (state) {
243
258
  return this.$refs.flow.setState(state);
244
259
  },
245
260
  /**
@@ -250,7 +265,7 @@ export default {
250
265
  * state of anonymous annotations.
251
266
  * @arg `anonymousAnnotations`
252
267
  */
253
- getState: function(anonymousAnnotations = false){
268
+ getState: function (anonymousAnnotations = false) {
254
269
  return this.$refs.flow.getState(anonymousAnnotations);
255
270
  },
256
271
  /**
@@ -261,9 +276,9 @@ export default {
261
276
  * instead change the current entry by setting the state.
262
277
  * @arg `state`
263
278
  */
264
- setCurrentEntry: async function(state) {
279
+ setCurrentEntry: async function (state) {
265
280
  if (state && state.type) {
266
- if (state.type === "Scaffold" && (state.url || state.isBodyScaffold)) {
281
+ if (state.type === 'Scaffold' && (state.url || state.isBodyScaffold)) {
267
282
  //State for scaffold containing the following items:
268
283
  // label - Setting the name of the dialog
269
284
  // region - Which region/group currently focusing on
@@ -289,7 +304,7 @@ export default {
289
304
  newView = { ...newView, ...contextCardInfo };
290
305
  }
291
306
  this.$refs.flow.createNewEntry(newView);
292
- } else if (state.type === "MultiFlatmap") {
307
+ } else if (state.type === 'MultiFlatmap') {
293
308
  if (state.resource) {
294
309
  //State for new multiflatmap containing the following items:
295
310
  // label - Setting the name of the dialog
@@ -303,7 +318,11 @@ export default {
303
318
  discoverId: state.dataset_id,
304
319
  version: state.dataset_version,
305
320
  };
306
- this.$refs.flow.createNewEntry(newView);
321
+ // sourceId is only provided by "open new view" from the species dropdown
322
+ this.$refs.flow.createNewEntry(newView, {
323
+ openInSplitView: this.openNewSpeciesInSplitView && state.sourceId !== undefined,
324
+ sourceId: state.sourceId,
325
+ });
307
326
  } else {
308
327
  //State for multiflatmap containing the following items:
309
328
  // taxo - taxo of species to set
@@ -330,7 +349,7 @@ export default {
330
349
  if (currentState && currentState.entries) {
331
350
  for (let i = 0; i < currentState.entries.length; i++) {
332
351
  const entry = currentState.entries[i];
333
- if (entry.type === "MultiFlatmap") {
352
+ if (entry.type === 'MultiFlatmap') {
334
353
  entry.resource = key;
335
354
  entry.state = { species: key };
336
355
  if (state.organ || state.uuid) {
@@ -352,7 +371,7 @@ export default {
352
371
  }
353
372
  }
354
373
  }
355
- } else if (state.type === "Flatmap") {
374
+ } else if (state.type === 'Flatmap') {
356
375
  //State for flatmap containing the following items:
357
376
  // label - Setting the name of the dialog
358
377
  // resource - the url to metadata
@@ -375,7 +394,7 @@ export default {
375
394
  * @arg `facets`,
376
395
  * @arg `query`
377
396
  */
378
- openSearch: function(facets, query) {
397
+ openSearch: function (facets, query) {
379
398
  return this.$refs.flow.openSearch(facets, query);
380
399
  },
381
400
  /**
@@ -387,15 +406,15 @@ export default {
387
406
  /**
388
407
  * This event emit when the component is mounted.
389
408
  */
390
- this.$emit("isReady");
409
+ this.$emit('isReady');
391
410
 
392
411
  // GA Tagging
393
412
  // Page view tracking for maps' buttons click on portal
394
413
  // category: AC | FC | WholeBody
395
414
  Tagging.sendEvent({
396
- 'event': 'interaction_event',
397
- 'event_name': 'portal_maps_page_view',
398
- 'category': this.startingMap
415
+ event: 'interaction_event',
416
+ event_name: 'portal_maps_page_view',
417
+ category: this.startingMap,
399
418
  });
400
419
  },
401
420
  },
@@ -406,21 +425,25 @@ export default {
406
425
  },
407
426
  },
408
427
  watch: {
409
- "shareLink" : {
428
+ shareLink: {
410
429
  handler: function (newLink) {
411
430
  this.settingsStore.updateShareLink(newLink);
412
431
  },
413
432
  immediate: true,
414
433
  },
415
434
  },
416
- beforeMount: function() {
435
+ beforeMount: function () {
417
436
  if (this.options) {
418
437
  // Split options prop up to commit to the store
419
438
  this.options.sparcApi ? this.settingsStore.updateSparcAPI(this.options.sparcApi) : null;
420
- this.options.algoliaIndex ? this.settingsStore.updateAlgoliaIndex(this.options.algoliaIndex) : null;
439
+ this.options.algoliaIndex
440
+ ? this.settingsStore.updateAlgoliaIndex(this.options.algoliaIndex)
441
+ : null;
421
442
  this.options.algoliaKey ? this.settingsStore.updateAlgoliaKey(this.options.algoliaKey) : null;
422
443
  this.options.algoliaId ? this.settingsStore.updateAlgoliaId(this.options.algoliaId) : null;
423
- this.options.pennsieveApi ? this.settingsStore.updatePennsieveApi(this.options.pennsieveApi) : null;
444
+ this.options.pennsieveApi
445
+ ? this.settingsStore.updatePennsieveApi(this.options.pennsieveApi)
446
+ : null;
424
447
  this.options.flatmapAPI ? this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI) : null;
425
448
  this.options.rootUrl ? this.settingsStore.updateRootUrl(this.options.rootUrl) : null;
426
449
  }
@@ -428,12 +451,12 @@ export default {
428
451
  this.splitFlowStore?.reset();
429
452
  this.splitFlowStore?.getAvailableTerms(this.settingsStore.sparcApi);
430
453
  },
431
- mounted: async function() {
432
- EventBus.on("updateShareLinkRequested", (data) => {
454
+ mounted: async function () {
455
+ EventBus.on('updateShareLinkRequested', (data) => {
433
456
  /**
434
457
  * This event emits when the share link is requested.
435
458
  */
436
- this.$emit("updateShareLinkRequested", data);
459
+ this.$emit('updateShareLinkRequested', data);
437
460
  });
438
461
  EventBus.on('trackEvent', (taggingData) => {
439
462
  /**
@@ -444,30 +467,34 @@ export default {
444
467
  if (!this.state) {
445
468
  this.initialState = await initialState(this.startingMap, this.options.sparcApi);
446
469
  }
447
- EventBus.on("mapLoaded", (map) => {
470
+ EventBus.on('mapLoaded', (map) => {
448
471
  // Check if there is a search term to display
449
472
  if (this.displaySearchFromQuery) {
450
473
  setTimeout(() => {
451
- this.$refs.flow.onDisplaySearch({term: this.displaySearchFromQuery});
474
+ this.$refs.flow.onDisplaySearch({ term: this.displaySearchFromQuery });
452
475
  this.displaySearchFromQuery = ''; // Clear after using it from first load
453
476
  });
454
477
  }
455
478
  /**
456
479
  * This event emit when the map is loaded.
457
480
  */
458
- this.$emit("mapLoaded", map);
481
+ this.$emit('mapLoaded', map);
482
+ });
483
+ // Allow other components to request opening a map via setCurrentEntry
484
+ EventBus.on('SetCurrentEntry', (entry) => {
485
+ if (entry) {
486
+ this.setCurrentEntry(entry);
487
+ }
459
488
  });
460
489
  this.isReady = true;
461
490
  this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog);
462
491
  this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar);
463
492
  this.settingsStore.updateAnnotationSidebar(this.annotationSidebar);
464
- }
465
- }
466
-
493
+ },
494
+ };
467
495
  </script>
468
496
 
469
497
  <style scoped lang="scss">
470
-
471
498
  :deep(.el-loading-spinner) {
472
499
  .path {
473
500
  stroke: $app-primary-color;
@@ -486,19 +513,16 @@ export default {
486
513
 
487
514
  .mapcontent {
488
515
  height: 100%;
489
- width:100%;
490
- z-index:1;
516
+ width: 100%;
517
+ z-index: 1;
491
518
  }
492
-
493
519
  </style>
494
520
 
495
521
  <style lang="scss">
496
-
497
522
  .mapcontent {
498
- --el-color-primary: #8300BF;
523
+ --el-color-primary: #8300bf;
499
524
  --el-color-primary-light-7: #dab3ec;
500
525
  --el-color-primary-light-8: #e6ccf2;
501
526
  --el-color-primary-light-9: #f3e6f9;
502
527
  }
503
-
504
528
  </style>
@@ -1,24 +1,20 @@
1
1
  <template>
2
- <div
3
- style="height: 100%; width: 100%; position:absolute"
4
- ref="display"
5
- />
2
+ <div style="height: 100%; width: 100%; position: absolute" ref="display" />
6
3
  </template>
7
4
 
8
5
  <script>
9
- /* eslint-disable no-alert, no-console */
10
- import ResizeSensor from "css-element-queries/src/ResizeSensor";
6
+ import ResizeSensor from 'css-element-queries/src/ResizeSensor';
11
7
 
12
8
  export default {
13
- name: "ResizeSensor",
9
+ name: 'ResizeSensor',
14
10
  methods: {
15
- activate: function() {
11
+ activate: function () {
16
12
  if (!this._sensor) {
17
13
  this._sensor = new ResizeSensor(this.$refs.display, this.displayResize);
18
14
  this.displayResize();
19
15
  }
20
16
  },
21
- deactivate: function() {
17
+ deactivate: function () {
22
18
  if (this._sensor) {
23
19
  this._sensor.detach(this.$refs.display, this.displayResize);
24
20
  delete this._sensor;
@@ -26,8 +22,8 @@ export default {
26
22
  this.displayResize();
27
23
  }
28
24
  },
29
- displayResize: function() {
30
- this.$emit("resize");
25
+ displayResize: function () {
26
+ this.$emit('resize');
31
27
  },
32
28
  },
33
29
  unmounted() {
@@ -41,7 +37,6 @@ export default {
41
37
  },
42
38
  mounted: function () {
43
39
  this.activate();
44
- }
40
+ },
45
41
  };
46
42
  </script>
47
-