@abi-software/gallery 0.3.1 → 0.3.2
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/.eslintrc.js +18 -20
- package/babel.config.js +6 -6
- package/dist/gallery.common.js +4160 -2880
- package/dist/gallery.common.js.map +1 -1
- package/dist/gallery.css +1 -1
- package/dist/gallery.umd.js +4160 -2880
- package/dist/gallery.umd.js.map +1 -1
- package/dist/gallery.umd.min.js +1 -1
- package/dist/gallery.umd.min.js.map +1 -1
- package/package.json +4 -3
- package/src/App.vue +29 -15
- package/src/components/Card.vue +10 -4
- package/src/components/Gallery.vue +1 -1
- package/src/main-bundle.js +2 -0
- package/src/main.js +8 -2
- package/src/mixins/GalleryHelpers.js +8 -1
- package/vue.config.js +5 -9
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/gallery",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "https://github.com/
|
|
6
|
+
"url": "https://github.com/ABI-Software/mapcore-gallery.git"
|
|
7
7
|
},
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
9
|
"private": false,
|
|
10
10
|
"scripts": {
|
|
11
|
+
"serve-no-lint": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint",
|
|
11
12
|
"serve": "vue-cli-service serve",
|
|
12
13
|
"build": "vue-cli-service build",
|
|
13
14
|
"test:unit": "vue-cli-service test:unit",
|
|
14
|
-
"build-bundle": "vue-cli-service build --target lib --name gallery src/main.js",
|
|
15
|
+
"build-bundle": "vue-cli-service build --target lib --name gallery src/main-bundle.js --skip-plugins @vue/cli-plugin-eslint",
|
|
15
16
|
"lint": "vue-cli-service lint"
|
|
16
17
|
},
|
|
17
18
|
"main": "dist/gallery.common.js",
|
package/src/App.vue
CHANGED
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app">
|
|
3
3
|
<img alt="Vue logo" src="./assets/logo.png" />
|
|
4
|
-
<
|
|
4
|
+
<gallery :items="dataInput" @card-clicked="cardClicked" />
|
|
5
5
|
</div>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script>
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import Gallery from './components/Gallery'
|
|
11
10
|
export default {
|
|
12
11
|
name: 'App',
|
|
13
12
|
components: {
|
|
14
|
-
|
|
13
|
+
Gallery,
|
|
14
|
+
},
|
|
15
|
+
data: function () {
|
|
16
|
+
return {
|
|
17
|
+
dataInput: [
|
|
18
|
+
{
|
|
19
|
+
title: 'test1',
|
|
20
|
+
type: 'data',
|
|
21
|
+
link: 'https://sparc.science/',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: 'test2',
|
|
25
|
+
type: 'data',
|
|
26
|
+
link: 'https://sparc.science/',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: 'test3',
|
|
30
|
+
type: 'data',
|
|
31
|
+
link: 'https://sparc.science/',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
cardClicked: function (data) {
|
|
38
|
+
console.log('card-clicked', data)
|
|
39
|
+
},
|
|
15
40
|
},
|
|
16
41
|
}
|
|
17
42
|
</script>
|
|
18
|
-
|
|
19
|
-
<style scoped>
|
|
20
|
-
#app {
|
|
21
|
-
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
22
|
-
-webkit-font-smoothing: antialiased;
|
|
23
|
-
-moz-osx-font-smoothing: grayscale;
|
|
24
|
-
text-align: center;
|
|
25
|
-
color: #2c3e50;
|
|
26
|
-
margin-top: 60px;
|
|
27
|
-
}
|
|
28
|
-
</style>
|
package/src/components/Card.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-card :shadow="shadow" :body-style="bodyStyle" :style="{ padding: '0px', maxWidth: width + 'rem' }" class="card">
|
|
3
3
|
<div v-loading="!isReady">
|
|
4
|
-
<div :style="imageContainerStyle">
|
|
4
|
+
<div class="cursor-pointer" :style="imageContainerStyle" @click.prevent="cardClicked">
|
|
5
5
|
<img v-if="useDefaultImg" src="../assets/logo-sparc-wave-primary.svg" svg-inline :style="imageStyle" />
|
|
6
6
|
<img v-else :src="thumbnail" alt="thumbnail loading ..." :style="imageStyle" />
|
|
7
7
|
</div>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
popper-class="gallery-popper"
|
|
34
34
|
/>
|
|
35
35
|
<!--use v-show here to make sure el popover always have a starting location -->
|
|
36
|
-
<p v-show="!data.hideTitle" ref="titleText" class="title"
|
|
36
|
+
<p v-show="!data.hideTitle" ref="titleText" v-popover:galleryPopover class="title">
|
|
37
37
|
{{ data.title }}
|
|
38
38
|
</p>
|
|
39
39
|
<p v-show="data.hideTitle" class="title text-placeholder" />
|
|
@@ -46,11 +46,13 @@
|
|
|
46
46
|
<script>
|
|
47
47
|
// import { SvgIcon } from '@abi-software/svg-sprite'
|
|
48
48
|
import Vue from 'vue'
|
|
49
|
-
import { Button, Card, Popover } from 'element-ui'
|
|
49
|
+
import { Button, Card, Popover, Tooltip, Loading } from 'element-ui'
|
|
50
50
|
import GalleryHelper from '../mixins/GalleryHelpers'
|
|
51
51
|
Vue.use(Button)
|
|
52
52
|
Vue.use(Card)
|
|
53
53
|
Vue.use(Popover)
|
|
54
|
+
Vue.use(Tooltip)
|
|
55
|
+
Vue.use(Loading)
|
|
54
56
|
|
|
55
57
|
function isValidHttpUrl(string) {
|
|
56
58
|
let url = undefined
|
|
@@ -185,7 +187,7 @@ export default {
|
|
|
185
187
|
this.getRequest(url, {}, 11000).then(
|
|
186
188
|
(response) => {
|
|
187
189
|
let data = response.data
|
|
188
|
-
if (data.startsWith('data:')) {
|
|
190
|
+
if (typeof data === 'string' && data.startsWith('data:')) {
|
|
189
191
|
this.thumbnail = response.data
|
|
190
192
|
} else {
|
|
191
193
|
if (this.data.mimetype) {
|
|
@@ -267,6 +269,10 @@ export default {
|
|
|
267
269
|
text-align: left;
|
|
268
270
|
}
|
|
269
271
|
|
|
272
|
+
.cursor-pointer {
|
|
273
|
+
cursor: pointer;
|
|
274
|
+
}
|
|
275
|
+
|
|
270
276
|
.text-placeholder {
|
|
271
277
|
height: 1rem;
|
|
272
278
|
}
|
package/src/main.js
CHANGED
|
@@ -67,13 +67,20 @@ export default {
|
|
|
67
67
|
return undefined
|
|
68
68
|
},
|
|
69
69
|
getImageURLFromS3(apiEndpoint, info) {
|
|
70
|
-
|
|
70
|
+
let url = `${apiEndpoint}/s3-resource/${info.datasetId}/${info.datasetVersion}/files/${info.file_path}?encodeBase64=true`
|
|
71
|
+
if (info.s3Bucket) {
|
|
72
|
+
url = url + `&s3BucketName=${info.s3Bucket}`
|
|
73
|
+
}
|
|
74
|
+
return url
|
|
71
75
|
},
|
|
72
76
|
getSegmentationThumbnailURL(apiEndpoint, info) {
|
|
73
77
|
let endpoint = `${apiEndpoint}/thumbnail/neurolucida`
|
|
74
78
|
endpoint = endpoint + `?datasetId=${info.datasetId}`
|
|
75
79
|
endpoint = endpoint + `&version=${info.datasetVersion}`
|
|
76
80
|
endpoint = endpoint + `&path=files/${info.segmentationFilePath}`
|
|
81
|
+
if (info.s3Bucket) {
|
|
82
|
+
endpoint = endpoint + `&s3BucketName=${info.s3Bucket}`
|
|
83
|
+
}
|
|
77
84
|
return endpoint
|
|
78
85
|
},
|
|
79
86
|
getThumbnailURLFromBiolucida(apiEndpoint, info) {
|
package/vue.config.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
// vue.config.js
|
|
2
2
|
module.exports = {
|
|
3
|
-
chainWebpack: config => {
|
|
3
|
+
chainWebpack: (config) => {
|
|
4
4
|
// vue svg inline loader for default svg
|
|
5
|
-
config.module
|
|
6
|
-
.rule('vue')
|
|
7
|
-
.use('vue-svg-inline-loader')
|
|
8
|
-
.loader('vue-svg-inline-loader')
|
|
9
|
-
.end()
|
|
5
|
+
config.module.rule('vue').use('vue-svg-inline-loader').loader('vue-svg-inline-loader').end()
|
|
10
6
|
const fontsRule = config.module.rule('fonts')
|
|
11
7
|
fontsRule.uses.clear()
|
|
12
8
|
config.module
|
|
@@ -14,10 +10,10 @@ module.exports = {
|
|
|
14
10
|
.test(/\.(ttf|otf|eot|woff|woff2)$/)
|
|
15
11
|
.use('base64-inline-loader')
|
|
16
12
|
.loader('base64-inline-loader')
|
|
17
|
-
.tap(options => {
|
|
18
|
-
// modify the options...
|
|
13
|
+
.tap((options) => {
|
|
14
|
+
// modify the options...
|
|
19
15
|
return options
|
|
20
16
|
})
|
|
21
17
|
.end()
|
|
22
|
-
}
|
|
18
|
+
},
|
|
23
19
|
}
|