@mapomodule/uikit 1.0.0-alpha.34 → 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 CHANGED
@@ -3,6 +3,28 @@
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
+
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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * fix mime type filtering for new media manager ([bbd1a9b](https://github.com/lotrekagency/mapo/commit/bbd1a9ba6ef6f17980c9bf534060b3add658fefe))
23
+
24
+
25
+
26
+
27
+
6
28
  # [1.0.0-alpha.34](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.33...v1.0.0-alpha.34) (2022-11-11)
7
29
 
8
30
 
@@ -126,7 +126,6 @@ export default {
126
126
  removeItem(media) {
127
127
  this.model = this.model.filter(({ id }) => id != media.id);
128
128
  },
129
- editItem(media) {},
130
129
  },
131
130
  watch: {
132
131
  value(val) {
@@ -10,12 +10,18 @@
10
10
  class="elevation-4 media-gallery--selection-item"
11
11
  />
12
12
  </div>
13
-
14
- <div class="media-gallery--empty" v-if="!medias.length">
13
+ <div class="media-gallery--loading" v-if="loading">
14
+ <v-progress-circular
15
+ size="60"
16
+ color="primary"
17
+ indeterminate
18
+ ></v-progress-circular>
19
+ </div>
20
+ <div class="media-gallery--empty" v-else-if="!medias.length">
15
21
  <v-icon size="60"> mdi-image-off-outline </v-icon>
16
22
  <p>{{ $t("mapo.mediaGallery.noMediaFound") }}</p>
17
23
  </div>
18
- <div class="media-gallery--masonry" v-if="medias.length">
24
+ <div class="media-gallery--masonry" v-else>
19
25
  <div
20
26
  v-for="media in medias"
21
27
  :key="media.file"
@@ -112,6 +118,14 @@ $wcol: calc(100% / 6 - 12px);
112
118
  justify-content: center;
113
119
  text-align: center;
114
120
  }
121
+ .media-gallery--loading{
122
+ height: 100%;
123
+ display: flex;
124
+ flex-direction: column;
125
+ align-items: center;
126
+ justify-content: center;
127
+ text-align: center;
128
+ }
115
129
 
116
130
  .media-gallery--selection {
117
131
  min-height: 60px;
@@ -158,7 +172,7 @@ import { mapGetters, mapActions } from "vuex"
158
172
  export default {
159
173
  name: "MediaGallery",
160
174
  computed: {
161
- ...mapGetters("mapo/media", ["page", "pages", "medias", "selection", "selectMode"]),
175
+ ...mapGetters("mapo/media", ["page", "pages", "medias", "selection", "selectMode", "loading"]),
162
176
  currentPage: {
163
177
  get() {
164
178
  return this.page;
@@ -140,6 +140,7 @@ export default {
140
140
  }, 500),
141
141
  },
142
142
  async fetch() {
143
+ this.$store.commit("mapo/media/SET_MIME_TYPE", this.mime || null);
143
144
  await this.getRoot();
144
145
  },
145
146
  destroyed(){
@@ -4,7 +4,7 @@
4
4
  <v-dialog v-model="dialog" max-width="100%" width="800" scrollable>
5
5
  <media-manager
6
6
  v-if="dialog"
7
- v-bind="{ noFolders }"
7
+ v-bind="{ noFolders, mime }"
8
8
  elevation="0"
9
9
  fill-backgroud
10
10
  >
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-img
3
- :src="(media.is_image && media.file) || null"
4
- :lazy-src="(media.is_image && media.thumbnail) || null"
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="media.is_image"
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
- isVideo() {
139
- return this.media.mime_type && this.media.mime_type.startsWith("video/");
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
- return this.media.mime_type && this.media.mime_type.startsWith("audio/");
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.34",
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": "48d74634c57ecbdf8c0b65a11833050c068fa9ef"
18
+ "gitHead": "63749b697721e9912fe8c18ff224b5058b0833bd"
19
19
  }