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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4af6da6de74f550d80a93db8eb953ec17a7ad9acb51ad2295ca021e069ee32e9
4
- data.tar.gz: 1d3505f97f4fdb09138c362d7d7cf6f5ab16f14b2eafd2ae510b239b3307022e
3
+ metadata.gz: d59b8a0c5f539a77e8898c7cae833ac90b20a49e19465a972f5f5daa536d843c
4
+ data.tar.gz: 7fddc94bf20d6985f259591aa9cd5a3301b716f04076c8f3ae68054aaabb93b8
5
5
  SHA512:
6
- metadata.gz: 2421f1a2c7252cffe36b8321c3e6d2771ff10f5b90c70fa40bc237cb9f5dbfffc9a108853a887c58a17e5466431cf4bddadd09c68b9c08d4cf88860e53edb835
7
- data.tar.gz: 32929b3c447da54908478c183c505dea8e48ea3944793faf318888ee780a5b102d73d33cee8cba2212eb311c06d6f68f1c7fdcecab28a6a629541d9702d536eb
6
+ metadata.gz: fa819a898b57c348f6b3af503f3db5a6e12a706d491fd8b8c3e66ef42a56ca700d5c4776e0b64e7e478b78f1b0e719325249724b35b975e597219b093d37345d
7
+ data.tar.gz: d1d0eb0ee184851d8b2e593305d9f49b68bc936f6262ff11fe751585ec12dcdbc784d293fe4830a64c0da4e0f5802d436b5bb09be4ee4ed8edc65961f9c881eb
@@ -2,6 +2,6 @@
2
2
 
3
3
  module KeystoneUi
4
4
  module Blocks
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "keystone_ui-react"
3
4
  require "keystone_ui/blocks/version"
4
5
  require "keystone_ui/blocks/engine"
5
6
  require "ks_blocks"
@@ -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: KsBlocks.registry.block_types(kind: kind)))
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: KsBlocks.registry.block_types(kind: kind)))
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: kind, grid: { columns: columns, row_height: row_height, gap: gap })
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keystone_ui-blocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Schneider