@abi-software/mapintegratedvuer 1.3.4 → 1.3.5-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/mapintegratedvuer",
3
- "version": "1.3.4",
3
+ "version": "1.3.5-beta.1",
4
4
  "license": "Apache-2.0",
5
5
  "scripts": {
6
6
  "serve": "vite --host --force",
@@ -18,7 +18,7 @@
18
18
  "release:beta": "npm version prerelease --force --preid=beta; npm publish --access public --tag beta",
19
19
  "release:minor": "npm version minor --force; npm publish --access public",
20
20
  "release:patch": "npm version patch --force; npm publish --access public",
21
- "version": "npm run changelog; git add CHANGELOG.md",
21
+ "version": "npm run build-bundle; npm run changelog; git add CHANGELOG.md",
22
22
  "vuese-gen": "node vuese-generator.js",
23
23
  "vuese-watch": "node vuese-generator.js watch",
24
24
  "docs:dev": "vitepress dev docs",
@@ -51,8 +51,8 @@
51
51
  ],
52
52
  "dependencies": {
53
53
  "@abi-software/flatmapvuer": "^1.3.2",
54
- "@abi-software/map-side-bar": "^2.3.1",
55
- "@abi-software/map-utilities": "^1.0.0",
54
+ "@abi-software/map-side-bar": "^2.3.2-beta.5",
55
+ "@abi-software/map-utilities": "^1.0.1-beta.3",
56
56
  "@abi-software/plotvuer": "1.0.0",
57
57
  "@abi-software/scaffoldvuer": "^1.3.3",
58
58
  "@abi-software/simulationvuer": "1.0.0",
@@ -365,7 +365,7 @@ export default {
365
365
 
366
366
  :deep(.context-card-popover.el-popover.el-popper) {
367
367
  max-width: calc(100vw - 100px);
368
- padding-right: 0px;
368
+ padding: 0px;
369
369
  width: unset!important;
370
370
  background: #fff!important;
371
371
  }
@@ -6,17 +6,20 @@
6
6
  <img :src="banner" class="context-image">
7
7
  </div>
8
8
  <div class="card-right scrollbar">
9
- <div style="margin-right: 8px;">
9
+ <div>
10
10
  <div class="title">{{contextData.heading}}</div>
11
11
  <div v-html="parseMarkdown(contextData.description)"/>
12
- <br/>
13
-
12
+ <!-- <br/> -->
13
+ </div>
14
+ </div>
15
+ <div class="card-bottom">
16
+ <div>
14
17
  <!-- Show sampeles and views seperately if they do not match -->
15
18
  <template v-if="!samplesUnderViews">
16
19
  <div v-if="contextData.views && contextData.views.length > 0" class="subtitle">Scaffold Views</div>
17
20
  <template v-for="(view, i) in contextData.views" :key="i+'_1'">
18
21
  <div @click="openViewFile(view)" class="context-card-view">
19
- <img class="view-image" :src="getFileFromPath(view.thumbnail)">
22
+ <img class="view-image" :src="getFileFromPath(view.thumbnail)">
20
23
  <div class="view-description">{{view.description}}</div>
21
24
  </div>
22
25
  <div class="padding"/>
@@ -43,7 +46,7 @@
43
46
  <div v-if="contextData.views && contextData.views.length > 0" class="subtitle">Scaffold Views</div>
44
47
  <template v-for="(view, i) in contextData.views" :key="i+'_1'">
45
48
  <span @click="viewClicked(view, i)" class="context-card-view">
46
- <img class="view-image" :src="getFileFromPath(view.thumbnail)"/>
49
+ <img class="view-image" :src="getFileFromPath(view.thumbnail)"/>
47
50
  <div class="view-description">{{view.description}}<i class="el-icon-warning-outline info"></i> </div>
48
51
  </span>
49
52
  <div v-if="sampleDetails[i]" v-html="samplesMatching(view.id).description"/>
@@ -57,6 +60,11 @@
57
60
  </div>
58
61
  </div>
59
62
  </div>
63
+
64
+ <!-- Copy to clipboard button container -->
65
+ <div class="float-button-container">
66
+ <CopyToClipboard :content="updatedCopyContent" theme="light" />
67
+ </div>
60
68
  </div>
61
69
  </div>
62
70
  </template>
@@ -64,6 +72,8 @@
64
72
 
65
73
  <script>
66
74
  /* eslint-disable no-alert, no-console */
75
+ import { CopyToClipboard } from "@abi-software/map-utilities";
76
+ import '@abi-software/map-utilities/dist/style.css';
67
77
 
68
78
  //provide the s3Bucket related methods and data.
69
79
  import S3Bucket from "../mixins/S3Bucket.vue";
@@ -94,6 +104,9 @@ const convertBackslashToForwardSlash = function(path){
94
104
 
95
105
  export default {
96
106
  name: "contextCard",
107
+ components: {
108
+ CopyToClipboard,
109
+ },
97
110
  mixins: [S3Bucket],
98
111
  props: {
99
112
  /**
@@ -109,7 +122,7 @@ export default {
109
122
  showDetails: true,
110
123
  showContextCard: true,
111
124
  sampleDetails: {},
112
- loading: false
125
+ loading: false,
113
126
  };
114
127
  },
115
128
  watch: {
@@ -142,8 +155,8 @@ export default {
142
155
  if (this.contextData.samplesUnderViews){
143
156
  return true
144
157
  } else {
145
- let viewId = this.contextData.views.map(v=>v.id)
146
- let samplesView = this.contextData.samples.map(s=>s.view)
158
+ let viewId = this.contextData.views?.map(v=>v.id) || [];
159
+ let samplesView = this.contextData.samples?.map(s=>s.view) || [];
147
160
 
148
161
  // get matching values
149
162
  let matching = viewId.filter(v=>samplesView.includes(v))
@@ -152,21 +165,90 @@ export default {
152
165
  if ( viewId.length === matching.length && matching.length === samplesView.length){
153
166
  return true
154
167
  }
155
- return false
156
168
  }
157
169
  }
158
- else return false
170
+ return false;
159
171
  },
160
172
  banner: function(){
161
173
  if (this.contextData.banner){
162
- return this.getFileFromPath(this.contextData.banner)
174
+ return this.getFileFromPath(this.contextData.banner)
163
175
  } else if (this.contextData && this.contextData.views && this.contextData.views.length > 0) {
164
176
  if(this.contextData.views[0].thumbnail){
165
177
  return this.getFileFromPath(this.contextData.views[0].thumbnail)
166
178
  }
167
- }
179
+ }
168
180
  return this.entry.banner
169
- }
181
+ },
182
+ updatedCopyContent: function () {
183
+ const contentArray = [];
184
+
185
+ // Use <div> instead of <h1>..<h6> or <p>
186
+ // to avoid default formatting on font size and margin
187
+
188
+ if (this.contextData.heading) {
189
+ contentArray.push(`<div><strong>${this.contextData.heading}</strong></div>`);
190
+ }
191
+
192
+ if (this.contextData.description) {
193
+ contentArray.push(`<div>${this.contextData.description}</div>`);
194
+ }
195
+
196
+ if (this.contextData.views?.length) {
197
+ let scaffoldViews = '<div><strong>Scaffold Views</strong></div>';
198
+ const views = [];
199
+
200
+ this.contextData.views.forEach((view, i) => {
201
+ const viewContents = [];
202
+ const viewPath = this.getFileFromPath(view.path);
203
+ let viewContent = `<div>${view.description}</div>`;
204
+ viewContent += `\n`;
205
+ viewContent += `<div><a href="${viewPath}">${viewPath}</a></div>`;
206
+ viewContents.push(viewContent);
207
+
208
+ if (this.samplesUnderViews) {
209
+ const description = this.samplesMatching(view.id).description;
210
+ let sampleContent = `<div>${description}</div>`;
211
+
212
+ if (this.samplesMatching(view.id).path) {
213
+ sampleContent += `\n`;
214
+ const url = this.generateFileLink(this.samplesMatching(view.id));
215
+ sampleContent += `<div><a href="${url}">${url}</a></div>`;
216
+ }
217
+ viewContents.push(sampleContent);
218
+ }
219
+ const viewContentStr = viewContents.join('\n');
220
+ views.push(`<li>${viewContentStr}</li>`);
221
+ });
222
+ scaffoldViews += '\n\n';
223
+ scaffoldViews += `<ul>${views.join('\n')}</ul>`;
224
+ contentArray.push(scaffoldViews);
225
+ }
226
+
227
+ if (!this.samplesUnderViews) {
228
+ if (this.contextData.samples?.length) {
229
+ let sampleViews = '<div><strong>Samples on Scaffold</strong></div>';
230
+ const samples = [];
231
+
232
+ this.contextData.samples.forEach((sample, i) => {
233
+ let sampleContents = '';
234
+ sampleContents += `<div>${sample.heading}</div>`;
235
+ sampleContents += `\n`;
236
+ sampleContents += `<div>${sample.description}</div>`;
237
+ if (sample.path) {
238
+ const url = this.generateFileLink(sample);
239
+ sampleContents += `\n`;
240
+ sampleContents += `<div><a href="${url}">${url}</a></div>`;
241
+ }
242
+ samples.push(`<li>${sampleContents}</li>`);
243
+ });
244
+ sampleViews += '\n\n';
245
+ sampleViews += `<ul>${samples.join('\n')}</ul>`;
246
+ contentArray.push(sampleViews);
247
+ }
248
+ }
249
+
250
+ return contentArray.join('\n\n<br>');
251
+ },
170
252
  },
171
253
  methods: {
172
254
  samplesMatching: function(viewId){
@@ -176,7 +258,7 @@ export default {
176
258
  else return []
177
259
  },
178
260
  viewClicked: function(view, i){
179
- this.openViewFile(view)
261
+ this.openViewFile(view)
180
262
  this.toggleSampleDetails(i)
181
263
  },
182
264
  getContextFile: function (contextFileUrl) {
@@ -192,7 +274,7 @@ export default {
192
274
  .then((data) => {
193
275
  this.contextData = data
194
276
  this.loading = false
195
- this.addDiscoverIdsToContextData()
277
+ this.addDiscoverIdsToContextData()
196
278
  })
197
279
  .catch((err) => {
198
280
  //set defaults if we hit an error
@@ -285,28 +367,38 @@ export default {
285
367
  display: flex;
286
368
  justify-content: center;
287
369
  align-items: center;
370
+ // text-align: initial; // default is justify
371
+ word-break: initial;
288
372
  }
289
373
 
290
374
  .context-card{
291
375
  background-color: white;
292
- max-height: 10 50px;
293
376
  font-size: 14px;
294
377
  position: relative;
295
378
  display: flex;
379
+ flex-wrap: wrap;
380
+ gap: 10px;
296
381
  width: 100%;
297
382
  max-height: 258px;
383
+ overflow-y: auto;
384
+ scrollbar-width: thin;
385
+ box-sizing: border-box;
386
+
387
+ &:not(.context-card-container) {
388
+ padding: 10px;
389
+ }
298
390
  }
299
391
 
300
392
  .context-card-view{
301
393
  cursor: pointer;
302
394
  margin-bottom: 8px;
303
395
  display: flex;
396
+ gap: 8px;
304
397
  }
305
398
 
306
399
  .view-image {
307
400
  width: 34px;
308
- height: 34px;
309
- flex: 1;
401
+ height: auto;
310
402
  }
311
403
 
312
404
  .view-descriptions {
@@ -339,8 +431,15 @@ export default {
339
431
  .card-right {
340
432
  flex: 1.5;
341
433
  word-break: normal !important;
342
- overflow-y: scroll;
343
- scrollbar-width: thin;
434
+
435
+ :deep(p:last-child) {
436
+ margin-bottom: 0;
437
+ }
438
+ }
439
+
440
+ .card-bottom {
441
+ flex: 0 0 100%;
442
+ max-width: 100%;
344
443
  }
345
444
 
346
445
  .cursor-pointer {
@@ -363,6 +462,7 @@ export default {
363
462
 
364
463
  .subtitle{
365
464
  font-weight: bold;
465
+ margin-bottom: 8px;
366
466
  }
367
467
 
368
468
  .scrollbar::-webkit-scrollbar-track {
@@ -382,4 +482,16 @@ export default {
382
482
  background-color: #979797;
383
483
  }
384
484
 
485
+ .float-button-container {
486
+ position: absolute;
487
+ bottom: 6px;
488
+ right: 12px;
489
+ opacity: 0;
490
+ visibility: hidden;
491
+
492
+ .context-card-container:hover & {
493
+ opacity: 1;
494
+ visibility: visible;
495
+ }
496
+ }
385
497
  </style>
@@ -10,6 +10,11 @@
10
10
  View publication <a :href="flatmapSource" target="_blank">here</a>
11
11
  <br/>
12
12
  </div>
13
+
14
+ <!-- Copy to clipboard button container -->
15
+ <div class="float-button-container">
16
+ <CopyToClipboard :content="copyContent" theme="light" />
17
+ </div>
13
18
  </div>
14
19
  </template>
15
20
 
@@ -19,11 +24,14 @@
19
24
  import {
20
25
  ElLoading as Loading
21
26
  } from "element-plus";
27
+ import { CopyToClipboard } from "@abi-software/map-utilities";
28
+ import '@abi-software/map-utilities/dist/style.css';
22
29
 
23
30
  export default {
24
31
  name: "FlatmapContextCard",
25
32
  components: {
26
33
  Loading,
34
+ CopyToClipboard,
27
35
  },
28
36
  props: {
29
37
  /**
@@ -38,7 +46,8 @@ export default {
38
46
  showDetails: true,
39
47
  showContextCard: true,
40
48
  sampleDetails: {},
41
- loading: false
49
+ loading: false,
50
+ copyContent: '',
42
51
  };
43
52
  },
44
53
  computed: {
@@ -51,7 +60,7 @@ export default {
51
60
  year: 'numeric',
52
61
  })
53
62
  }
54
- return flatmapPublished
63
+ return flatmapPublished
55
64
  },
56
65
  sckanReleaseDisplay: function() {
57
66
  let sckanRelease = "Unknown"
@@ -70,7 +79,7 @@ export default {
70
79
  sckanRelease = "Unknown";
71
80
  }
72
81
  }
73
- return sckanRelease
82
+ return sckanRelease
74
83
  },
75
84
  sckanReleaseLink: function() {
76
85
  let sckanLink = "Unknown"
@@ -93,6 +102,36 @@ export default {
93
102
  return flatmapSource
94
103
  },
95
104
  },
105
+ mounted: function () {
106
+ this.updateCopyContent();
107
+ },
108
+ methods: {
109
+ updateCopyContent: function () {
110
+ const contentArray = [];
111
+
112
+ // Use <div> instead of <h1>..<h6> or <p>
113
+ // to avoid default formatting on font size and margin
114
+
115
+ contentArray.push(`<div><strong>Flatmap Provenance</strong></div>`);
116
+
117
+ let versionContent = `<div>SCKAN version:</div>`;
118
+ versionContent += `\n`;
119
+ versionContent += `<div><a href="${this.sckanReleaseLink}">${this.sckanReleaseLink}</a></div>`;
120
+ contentArray.push(versionContent);
121
+
122
+ let publishedContent = `<div>Published on:</div>`;
123
+ publishedContent += `\n`;
124
+ publishedContent += `<div>${this.flatmapPublishedDisplay}</div>`;
125
+ contentArray.push(publishedContent);
126
+
127
+ let publicationContent = `<div>View publication:</div>`;
128
+ publicationContent += `\n`;
129
+ publicationContent += `<div><a href="${this.flatmapSource}">${this.flatmapSource}</a></div>`;
130
+ contentArray.push(publicationContent);
131
+
132
+ this.copyContent = contentArray.join('\n\n<br>');
133
+ },
134
+ }
96
135
  };
97
136
  </script>
98
137
 
@@ -102,19 +141,16 @@ export default {
102
141
 
103
142
  .flatmap-context-card{
104
143
  background-color: white;
105
- max-height: 10 50px;
106
144
  font-size: 12px;
107
145
  position: relative;
108
146
  display: flex;
109
147
  width: 100%;
110
148
  max-height: 258px;
149
+ padding: 10px;
111
150
  }
112
151
 
113
152
  .card-right {
114
- flex: 1.3;
115
- padding-left: 6px;
116
- // overflow-y: scroll;
117
- scrollbar-width: thin;
153
+ flex: 1;
118
154
  }
119
155
 
120
156
  .cursor-pointer {
@@ -143,4 +179,16 @@ export default {
143
179
  background-color: #979797;
144
180
  }
145
181
 
182
+ .float-button-container {
183
+ position: absolute;
184
+ bottom: 6px;
185
+ right: 12px;
186
+ opacity: 0;
187
+ visibility: hidden;
188
+
189
+ .flatmap-context-card:hover & {
190
+ opacity: 1;
191
+ visibility: visible;
192
+ }
193
+ }
146
194
  </style>
@@ -478,7 +478,7 @@ export default {
478
478
  z-index: 1;
479
479
  div {
480
480
  scale: 0.5;
481
- transform: translate(45px, -7px);
481
+ width: 0;
482
482
  }
483
483
  }
484
484
  }