maglevcms 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cf8c513d0eabb28620a1840c317be54a8f7df53ffe0e80af5a376a64a00d517
4
- data.tar.gz: 01c55bf8aa7e8137e429a13aa4632f1214b2ba1e7e89dc8de962d4e344283678
3
+ metadata.gz: 248515cbe62cad407de20c6cffc54b333b764b997051916dcc25db54744536ae
4
+ data.tar.gz: 1d7b14f11bde0e7efb1eb88b8804dc5028b3d55da858e963e538c92640377b5c
5
5
  SHA512:
6
- metadata.gz: 3dc2dbdffdb84d20cc8d3553554b62e1b028a44e685eaf8e3e1048eb62471aec2d68fd590173ade2031279ad33e760d0b46943b594cc6c78e7cbd4d7930d6e35
7
- data.tar.gz: 1a9db5f6f77fecb91b374c15f51d514a324df6f1149f3b72ccac69f44ca1ad7cf178f9f2b84fb370ac4e735b9e0b0c4594f7c1956d90ddd666ea194804ead1a3
6
+ metadata.gz: b3409a4c7c5712a9e7bfa0541ca7d683e3ce17ace4a0113f9eaafeb2c3ad0d9a24a5bc07717f6ec2b5942a94539ebb9312a0cf18f3f9c9ec6bf1516e9b560dce
7
+ data.tar.gz: a72a1e948ef6d9ad0003c987a745959a2da567ad78d0db890e1b207f45c4a50d3c86629537bec27bd891d6f4e48f333a0cef22b9bfa3c72168ec64b9a3a5966e
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.828l-4.95 4.95-1.414-1.414L12 8l6.364 6.364-1.414 1.414z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.9997 10.8284L7.04996 15.7782L5.63574 14.364L11.9997 8L18.3637 14.364L16.9495 15.7782L11.9997 10.8284Z"></path></svg>
@@ -16,7 +16,7 @@
16
16
  v-model="selectedCollectionItem"
17
17
  >
18
18
  <template v-slot:value>
19
- <div class="flex items-center">
19
+ <div class="flex items-center flex-grow-0 overflow-x-hidden" :title="selectedCollectionItem.label">
20
20
  <div
21
21
  class="h-10 w-10 bg-gray-400 mr-3"
22
22
  v-if="selectedCollectionItem.imageUrl"
@@ -26,15 +26,15 @@
26
26
  :src="selectedCollectionItem.imageUrl"
27
27
  />
28
28
  </div>
29
- <span>{{ selectedCollectionItem.label }}</span>
29
+ <span class="truncate">{{ selectedCollectionItem.label }}</span>
30
30
  </div>
31
31
  </template>
32
32
  <template v-slot:item="{ item }">
33
- <div class="flex items-center">
33
+ <div class="flex items-center" :title="item.label">
34
34
  <div class="h-10 w-10 bg-gray-400 mr-3" v-if="item.imageUrl">
35
35
  <img class="object-cover w-full h-full" :src="item.imageUrl" />
36
36
  </div>
37
- <span class="font-bold">{{ item.label }}</span>
37
+ <span class="truncate font-bold">{{ item.label }}</span>
38
38
  </div>
39
39
  </template>
40
40
  </select-input>
@@ -18,24 +18,16 @@
18
18
  <span v-else>{{ placeholder }}</span>
19
19
  <button
20
20
  type="button"
21
- class="ml-auto"
21
+ class="ml-auto flex-shrink-0"
22
22
  @click.stop.prevent="clear"
23
23
  v-if="canClear"
24
24
  >
25
25
  <icon name="ri-close-line" />
26
26
  </button>
27
- <icon
28
- name="arrow-up-s-line"
29
- size="1.5rem"
30
- :class="{ 'ml-1': canClear, 'ml-auto': !canClear }"
31
- v-if="isOpen"
32
- />
33
- <icon
34
- name="arrow-down-s-line"
35
- size="1.5rem"
36
- :class="{ 'ml-1': canClear, 'ml-auto': !canClear }"
37
- v-else
38
- />
27
+ <div :class="{ 'flex-shrink-0': true, 'ml-1': canClear, 'ml-auto': !canClear }">
28
+ <icon name="arrow-up-s-line" size="1.5rem" :class="{ 'hidden': !isOpen }" />
29
+ <icon name="arrow-down-s-line" size="1.5rem" :class="{ 'hidden': isOpen }" />
30
+ </div>
39
31
  </div>
40
32
  </button>
41
33
  <div
@@ -172,6 +172,9 @@ export const getBlockLabel = (block, definition, index) => {
172
172
  label = value.text
173
173
  }
174
174
  break
175
+ case 'collection_item':
176
+ if (!label && !isBlank(value?.label)) label = value.label
177
+ if (!image && !isBlank(value?.imageUrl)) image = value.imageUrl
175
178
  default:
176
179
  break
177
180
  }
@@ -66,7 +66,7 @@ module Maglev
66
66
  end
67
67
 
68
68
  def item_label(item)
69
- item[label_field]
69
+ label_field && item.respond_to?(label_field) ? item.public_send(label_field) : nil
70
70
  end
71
71
 
72
72
  def item_image(item)
@@ -9,7 +9,7 @@ module Maglev
9
9
  end
10
10
 
11
11
  def call(path)
12
- theme = add(YAML.safe_load(File.read(path.join('theme.yml'))))
12
+ theme = add(YAML.safe_load(File.read(path.join('theme.yml')), aliases: true))
13
13
  sections = load_sections(theme, Pathname.new(path).join('sections/**/*.yml'))
14
14
  theme.sections = Maglev::Section::Store.new(sections)
15
15
  theme
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Maglev
4
- VERSION = '1.2.1'
4
+ VERSION = '1.2.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglevcms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-24 00:00:00.000000000 Z
11
+ date: 2023-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jbuilder