@abi-software/map-side-bar 1.3.27 → 1.3.28
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/map-side-bar.common.js +62 -36
- package/dist/map-side-bar.common.js.map +1 -1
- package/dist/map-side-bar.css +1 -1
- package/dist/map-side-bar.umd.js +62 -36
- package/dist/map-side-bar.umd.js.map +1 -1
- package/dist/map-side-bar.umd.min.js +1 -1
- package/dist/map-side-bar.umd.min.js.map +1 -1
- package/package-lock.json +347 -38
- package/package.json +3 -1
- package/src/components/ContextCard.vue +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/map-side-bar",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.28",
|
|
4
4
|
"main": "./dist/map-side-bar.common.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/*",
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"@abi-software/svg-sprite": "^0.1.14",
|
|
22
22
|
"algoliasearch": "^4.10.5",
|
|
23
23
|
"element-ui": "^2.13.0",
|
|
24
|
+
"isomorphic-dompurify": "^0.23.0",
|
|
25
|
+
"marked": "^4.1.1",
|
|
24
26
|
"vue": "^2.6.10"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="context-card-container" ref="container">
|
|
3
3
|
<div v-show="showContextCard">
|
|
4
|
-
<div v-show="showDetails" class="hide" @click="showDetails = !showDetails">Hide information
|
|
5
|
-
<div v-show="!showDetails" class="hide" @click="showDetails = !showDetails">Show information
|
|
4
|
+
<div v-show="showDetails" class="hide" @click="showDetails = !showDetails">Hide information<i class="el-icon-arrow-up"></i></div>
|
|
5
|
+
<div v-show="!showDetails" class="hide" @click="showDetails = !showDetails">Show information<i class="el-icon-arrow-down"></i></div>
|
|
6
6
|
<el-card v-if="showDetails && Object.keys(contextData).length !== 0" v-loading="loading" class="context-card" >
|
|
7
7
|
<div class="card-left">
|
|
8
8
|
<img :src="banner" class="context-image">
|
|
9
9
|
</div>
|
|
10
10
|
<div class="card-right scrollbar">
|
|
11
11
|
<div class="title">{{contextData.heading}}</div>
|
|
12
|
-
<div v-html="contextData.description"/>
|
|
12
|
+
<div v-html="parseMarkdown(contextData.description)"/>
|
|
13
13
|
<br/>
|
|
14
14
|
|
|
15
15
|
<!-- Show sampeles and views seperately if they do not match -->
|
|
@@ -71,6 +71,9 @@ import locale from "element-ui/lib/locale";
|
|
|
71
71
|
import EventBus from "./EventBus"
|
|
72
72
|
import hardcoded_info from './hardcoded-context-info'
|
|
73
73
|
|
|
74
|
+
import { marked } from 'marked'
|
|
75
|
+
import DOMPurify from 'isomorphic-dompurify';
|
|
76
|
+
|
|
74
77
|
locale.use(lang);
|
|
75
78
|
Vue.use(Link);
|
|
76
79
|
Vue.use(Icon);
|
|
@@ -160,8 +163,8 @@ export default {
|
|
|
160
163
|
},
|
|
161
164
|
banner: function(){
|
|
162
165
|
if (this.contextData.banner){
|
|
163
|
-
this.getFileFromPath(this.contextData.banner)
|
|
164
|
-
} else if (this.contextData && this.contextData.views) {
|
|
166
|
+
return this.getFileFromPath(this.contextData.banner)
|
|
167
|
+
} else if (this.contextData && this.contextData.views && this.contextData.views.length > 0) {
|
|
165
168
|
if(this.contextData.views[0].thumbnail){
|
|
166
169
|
return this.getFileFromPath(this.contextData.views[0].thumbnail)
|
|
167
170
|
}
|
|
@@ -255,6 +258,9 @@ export default {
|
|
|
255
258
|
return `${this.envVars.ROOT_URL}/file/${sample.discoverId}/${sample.version}?path=${this.processPathForUrl(sample.path)}`
|
|
256
259
|
|
|
257
260
|
},
|
|
261
|
+
parseMarkdown(markdown){
|
|
262
|
+
return DOMPurify.sanitize(marked.parse(markdown))
|
|
263
|
+
},
|
|
258
264
|
openViewFile: function(view){
|
|
259
265
|
// note that we assume that the view file is in the same directory as the scaffold (viewUrls take relative paths)
|
|
260
266
|
this.entry.viewUrl = `${this.envVars.API_LOCATION}s3-resource/${this.entry.discoverId}/${this.entry.version}/${view.path}`
|