json_flit 0.0.4 → 0.0.6

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: b21165a86ac304a46f2d41ba367f3dbc9f7d454f81582cce7fdd197ede5e02c7
4
- data.tar.gz: 852c6cf5e1de9b920e4bf8172ef1f09227aa9bb3f4031963ab91771949646b7a
3
+ metadata.gz: 3e0f59b86eaa2735a65d4ea7658e4ffc0a2ee08e1372c14f5f57587e8a0ff825
4
+ data.tar.gz: c2b866224561143ff7832a0afdfcb2bcbb939cdef1a8b6f6e722b05b68d8b354
5
5
  SHA512:
6
- metadata.gz: 69484a418ac02f47cff1002ee3ef2dd6aad8a0c39e99acb8444a989aece834d40ac3012ef328513429847bb781a544fbfb1aab0a12ec15aaf34fe9f52519d8e7
7
- data.tar.gz: 3749a94c61893a936bcebb7bf65c1dbb5f57571697432a795cd50f74bb91971b3fe83becb47f89c9c9263d96722c08945eea724be86c214ee43be4992125ba4b
6
+ metadata.gz: 14913ce9ac796e7f21c9c0f4746cc0aa55e96d42db0cd53b14d5145e6663e7751c15335ab87e4ec5be7f65327b817a0321f75766ba9fcad7125e16ebdf7d4dee
7
+ data.tar.gz: f18f1e24b650d8cdc944162a6260ea440cdaa40fd3b8549bd4c482c9a2bc70cc642ba6e468d473c773cd94e60f73f1e915e4543ac1da238ead1886ffe7514f9a
data/Gemfile.lock CHANGED
@@ -1,21 +1,21 @@
1
1
  GIT
2
2
  remote: https://github.com/afstanton/flit_view_components.git
3
- revision: 739dbf1c71fcf3cd31681628be1baf2b20f68e91
3
+ revision: 59fbf8012421e595c94c75b322c588681753d7da
4
4
  branch: main
5
5
  specs:
6
- flit_view_components (0.0.2)
7
- view_component (~> 3.0.0rc3)
6
+ flit_view_components (0.0.6)
7
+ view_component (~> 3.0.0rc5)
8
8
 
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- json_flit (0.0.4)
12
+ json_flit (0.0.6)
13
13
  flit_view_components
14
14
 
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activesupport (7.0.4.2)
18
+ activesupport (7.0.4.3)
19
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
20
  i18n (>= 1.6, < 2)
21
21
  minitest (>= 5.1)
@@ -64,7 +64,7 @@ GEM
64
64
  tzinfo (2.0.6)
65
65
  concurrent-ruby (~> 1.0)
66
66
  unicode-display_width (2.4.2)
67
- view_component (3.0.0.rc4)
67
+ view_component (3.0.0.rc5)
68
68
  activesupport (>= 5.2.0, < 8.0)
69
69
  concurrent-ruby (~> 1.0)
70
70
  method_source (~> 1.0)
@@ -80,4 +80,4 @@ DEPENDENCIES
80
80
  rubocop (~> 1.21)
81
81
 
82
82
  BUNDLED WITH
83
- 2.4.7
83
+ 2.4.8
data/demo/Gemfile CHANGED
@@ -52,6 +52,9 @@ gem "bootsnap", require: false
52
52
  gem 'json_flit', path: '../'
53
53
  gem 'flit_view_components', github: 'afstanton/flit_view_components', branch: 'main'
54
54
 
55
+ # By default, Flutter uses Material Design.
56
+ gem 'material_flit'
57
+
55
58
  # For JSON
56
59
  gem 'multi_json'
57
60
  gem 'oj'
data/demo/Gemfile.lock CHANGED
@@ -1,15 +1,15 @@
1
1
  GIT
2
2
  remote: https://github.com/afstanton/flit_view_components.git
3
- revision: 739dbf1c71fcf3cd31681628be1baf2b20f68e91
3
+ revision: 59fbf8012421e595c94c75b322c588681753d7da
4
4
  branch: main
5
5
  specs:
6
- flit_view_components (0.0.2)
7
- view_component (~> 3.0.0rc3)
6
+ flit_view_components (0.0.6)
7
+ view_component (~> 3.0.0rc5)
8
8
 
9
9
  PATH
10
10
  remote: ..
11
11
  specs:
12
- json_flit (0.0.3)
12
+ json_flit (0.0.5)
13
13
  flit_view_components
14
14
 
15
15
  GEM
@@ -108,6 +108,8 @@ GEM
108
108
  net-pop
109
109
  net-smtp
110
110
  marcel (1.0.2)
111
+ material_flit (0.0.3)
112
+ flit_view_components
111
113
  method_source (1.0.0)
112
114
  mini_mime (1.1.2)
113
115
  minitest (5.18.0)
@@ -178,7 +180,7 @@ GEM
178
180
  railties (>= 6.0.0)
179
181
  tzinfo (2.0.6)
180
182
  concurrent-ruby (~> 1.0)
181
- view_component (3.0.0.rc4)
183
+ view_component (3.0.0.rc5)
182
184
  activesupport (>= 5.2.0, < 8.0)
183
185
  concurrent-ruby (~> 1.0)
184
186
  method_source (~> 1.0)
@@ -202,6 +204,7 @@ DEPENDENCIES
202
204
  importmap-rails
203
205
  jbuilder
204
206
  json_flit!
207
+ material_flit
205
208
  multi_json
206
209
  oj
207
210
  propshaft
@@ -219,4 +222,4 @@ RUBY VERSION
219
222
  ruby 3.2.1p31
220
223
 
221
224
  BUNDLED WITH
222
- 2.4.7
225
+ 2.4.8
@@ -20,7 +20,7 @@ class WelcomeController < ApplicationController
20
20
 
21
21
  registry = JsonFlit::Registry.new
22
22
  builder = JsonFlit::Builder.new(registry: registry, layout: @layout, data: @data)
23
- @component = builder.build
24
23
 
24
+ @component = builder.build
25
25
  end
26
26
  end
@@ -0,0 +1,3 @@
1
+ FlitViewComponents.configure do |config|
2
+ config.theme = "MaterialFlit::Theme"
3
+ end
@@ -6,21 +6,11 @@ module JsonFlit
6
6
  @data = data
7
7
  end
8
8
 
9
- def build(layout: @layout)
10
- builder = @registry.component(layout['type'])
11
- component = builder.new(data: @data).build
12
- if layout['children']
13
- layout['children'].each do |child|
14
- component.children << build(layout: child)
15
- end
16
- end
17
-
18
- if layout['child']
19
- component.child = build(layout: layout['child'])
20
- end
9
+ def build
10
+ builder = @registry.component(@layout['type'])
11
+ component = builder.new(registry: @registry, layout: @layout, data: @data).build
21
12
 
22
13
  component
23
14
  end
24
-
25
15
  end
26
16
  end
@@ -1,7 +1,13 @@
1
1
  module JsonFlit
2
2
  module Factory
3
3
  class Align
4
+ def initialize(registry:, layout:, data:)
4
5
 
6
+ end
7
+
8
+ def build
9
+ Flit::AlignComponent.new
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -1,7 +1,13 @@
1
1
  module JsonFlit
2
2
  module Factory
3
3
  class AppBar
4
+ def initialize(registry:, layout:, data:)
4
5
 
6
+ end
7
+
8
+ def build
9
+ Flit::AppBarComponent.new
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -1,12 +1,18 @@
1
1
  module JsonFlit
2
2
  module Factory
3
3
  class Scaffold
4
- def initialize(data:)
5
- @data = data
4
+ def initialize(registry:, layout:, data:)
5
+ args = layout['args']
6
+
7
+ @app_bar = JsonFlit::Builder.new(registry: registry, layout: args['appBar'], data: data)
8
+ @body = JsonFlit::Builder.new(registry: registry, layout: args['body'], data: data)
6
9
  end
7
10
 
8
11
  def build
9
- Flit::ScaffoldComponent.new(@data)
12
+ Flit::ScaffoldComponent.new(
13
+ app_bar: @app_bar.build,
14
+ body: @body.build
15
+ )
10
16
  end
11
17
  end
12
18
  end
@@ -1,6 +1,12 @@
1
1
  module JsonFlit
2
2
  module Factory
3
3
  class Stack
4
+ def initialize(registry:, layout:, data:)
5
+ end
6
+
7
+ def build
8
+ Flit::StackComponent.new
9
+ end
4
10
 
5
11
  end
6
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonFlit
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.6"
5
5
  end
data/lib/json_flit.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require_relative "json_flit/version"
4
4
  require_relative "json_flit/registry"
5
5
  require_relative "json_flit/builder"
6
+ require_relative "json_flit/factory/base"
6
7
  Dir["#{File.dirname(__FILE__)}/json_flit/factory/**/*.rb"].each { |f| require f }
7
8
 
8
9
  module JsonFlit
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_flit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron F Stanton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-12 00:00:00.000000000 Z
11
+ date: 2023-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flit_view_components
@@ -181,6 +181,7 @@ files:
181
181
  - demo/config/initializers/assets.rb
182
182
  - demo/config/initializers/content_security_policy.rb
183
183
  - demo/config/initializers/filter_parameter_logging.rb
184
+ - demo/config/initializers/flit.rb
184
185
  - demo/config/initializers/inflections.rb
185
186
  - demo/config/initializers/permissions_policy.rb
186
187
  - demo/config/locales/en.yml
@@ -332,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
333
  - !ruby/object:Gem::Version
333
334
  version: '0'
334
335
  requirements: []
335
- rubygems_version: 3.4.7
336
+ rubygems_version: 3.4.8
336
337
  signing_key:
337
338
  specification_version: 4
338
339
  summary: Rails implementation of json_dynamic_widget