keystone_ui-blocks 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/lib/keystone_ui/blocks/version.rb +1 -1
- data/lib/keystone_ui/blocks.rb +1 -0
- data/lib/ks_blocks/layout.rb +6 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d59b8a0c5f539a77e8898c7cae833ac90b20a49e19465a972f5f5daa536d843c
|
|
4
|
+
data.tar.gz: 7fddc94bf20d6985f259591aa9cd5a3301b716f04076c8f3ae68054aaabb93b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa819a898b57c348f6b3af503f3db5a6e12a706d491fd8b8c3e66ef42a56ca700d5c4776e0b64e7e478b78f1b0e719325249724b35b975e597219b093d37345d
|
|
7
|
+
data.tar.gz: d1d0eb0ee184851d8b2e593305d9f49b68bc936f6262ff11fe751585ec12dcdbc784d293fe4830a64c0da4e0f5802d436b5bb09be4ee4ed8edc65961f9c881eb
|
data/lib/keystone_ui/blocks.rb
CHANGED
data/lib/ks_blocks/layout.rb
CHANGED
|
@@ -15,7 +15,7 @@ module KsBlocks
|
|
|
15
15
|
define_method(:place_blocks) do |positions, version: nil|
|
|
16
16
|
raise InvalidLayout, "This layout changed since it was last drawn" if version && version != KsBlocks.version_of(public_send(column))
|
|
17
17
|
|
|
18
|
-
update!(column => Grid.place(public_send(column), positions, columns: columns, types:
|
|
18
|
+
update!(column => Grid.place(public_send(column), positions, columns: columns, types: block_layout_types))
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
define_method(:fill_block) do |id, content|
|
|
@@ -23,13 +23,15 @@ module KsBlocks
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
define_method(:remove_block) do |id|
|
|
26
|
-
update!(column => Grid.remove(public_send(column), id, types:
|
|
26
|
+
update!(column => Grid.remove(public_send(column), id, types: block_layout_types))
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
define_method(:block_layout_kind) { kind }
|
|
29
|
+
define_method(:block_layout_kind) { kind.respond_to?(:call) ? kind.call(self) : kind }
|
|
30
|
+
|
|
31
|
+
define_method(:block_layout_types) { KsBlocks.registry.block_types(kind: block_layout_kind) }
|
|
30
32
|
|
|
31
33
|
define_method(:layout_data) do
|
|
32
|
-
KsBlocks.layout_data(public_send(column), kind:
|
|
34
|
+
KsBlocks.layout_data(public_send(column), kind: block_layout_kind, grid: { columns: columns, row_height: row_height, gap: gap })
|
|
33
35
|
end
|
|
34
36
|
end
|
|
35
37
|
end
|