@mapomodule/uikit 1.0.0-alpha.35 → 1.0.0-alpha.36
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/CHANGELOG.md +11 -0
- package/components/MediaManager/MediaPreview.vue +22 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.36](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2022-11-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fix media preview type checks ([580515f](https://github.com/lotrekagency/mapo/commit/580515f9bba9786056159d9fc11af1ce90aecbdb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.0.0-alpha.35](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) (2022-11-11)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-img
|
|
3
|
-
:src="(
|
|
4
|
-
:lazy-src="(
|
|
3
|
+
:src="(isImage && media.file) || null"
|
|
4
|
+
:lazy-src="(isImage && media.thumbnail) || null"
|
|
5
5
|
aspect-ratio="1"
|
|
6
6
|
class="grey lighten-2"
|
|
7
7
|
:class="{
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<template v-slot:placeholder>
|
|
16
16
|
<v-row class="fill-height ma-0" align="center" justify="center">
|
|
17
17
|
<v-progress-circular
|
|
18
|
-
v-if="
|
|
18
|
+
v-if="isImage"
|
|
19
19
|
indeterminate
|
|
20
20
|
color="grey lighten-5"
|
|
21
21
|
></v-progress-circular>
|
|
@@ -93,6 +93,13 @@
|
|
|
93
93
|
</style>
|
|
94
94
|
|
|
95
95
|
<script>
|
|
96
|
+
|
|
97
|
+
const extensions = {
|
|
98
|
+
image: ["png", "jpg", "jpeg", "avif", "webp"],
|
|
99
|
+
audio: ["mp3", "ogg", "flac"],
|
|
100
|
+
video: ["mp4", "webm", "avi", "mov", "wmv"]
|
|
101
|
+
}
|
|
102
|
+
|
|
96
103
|
export default {
|
|
97
104
|
data() {
|
|
98
105
|
return {
|
|
@@ -135,11 +142,20 @@ export default {
|
|
|
135
142
|
"70px"
|
|
136
143
|
);
|
|
137
144
|
},
|
|
138
|
-
|
|
139
|
-
|
|
145
|
+
isImage() {
|
|
146
|
+
if (this.media?.mime_type)
|
|
147
|
+
return this.media.mime_type.startsWith("image/");
|
|
148
|
+
return extensions.image.includes(this.media?.file?.split(".").pop()?.toLowerCase())
|
|
140
149
|
},
|
|
150
|
+
isVideo() {
|
|
151
|
+
if (this.media?.mime_type)
|
|
152
|
+
return this.media.mime_type.startsWith("video/");
|
|
153
|
+
return extensions.video.includes(this.media?.file?.split(".").pop()?.toLowerCase())
|
|
154
|
+
},
|
|
141
155
|
isAudio() {
|
|
142
|
-
|
|
156
|
+
if (this.media?.mime_type)
|
|
157
|
+
return this.media.mime_type.startsWith("audio/");
|
|
158
|
+
return extensions.audio.includes(this.media?.file?.split(".").pop()?.toLowerCase())
|
|
143
159
|
},
|
|
144
160
|
videoListeners() {
|
|
145
161
|
if (this.isVideo && this.videoPreview) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapomodule/uikit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.36",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "This is part of Mapo nuxt module. Injects Mapo ui components in the nuxt component discovery system.",
|
|
6
6
|
"author": "bnznamco <gabriele.baldi.01@gmail.com>",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "63749b697721e9912fe8c18ff224b5058b0833bd"
|
|
19
19
|
}
|