view_component 2.34.0 → 2.38.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of view_component might be problematic. Click here for more details.

Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/vendor/prism.css +196 -0
  4. data/app/assets/vendor/prism.min.js +12 -0
  5. data/app/controllers/view_components_controller.rb +1 -1
  6. data/app/helpers/preview_helper.rb +19 -0
  7. data/app/views/view_components/_preview_source.html.erb +17 -0
  8. data/app/views/view_components/preview.html.erb +6 -2
  9. data/{CHANGELOG.md → docs/CHANGELOG.md} +145 -2
  10. data/lib/rails/generators/abstract_generator.rb +46 -0
  11. data/lib/rails/generators/component/component_generator.rb +9 -5
  12. data/lib/rails/generators/component/templates/component.rb.tt +1 -1
  13. data/lib/rails/generators/erb/component_generator.rb +12 -12
  14. data/lib/rails/generators/erb/templates/component.html.erb.tt +1 -1
  15. data/lib/rails/generators/haml/component_generator.rb +6 -16
  16. data/lib/rails/generators/slim/component_generator.rb +6 -16
  17. data/lib/rails/generators/stimulus/component_generator.rb +26 -0
  18. data/lib/rails/generators/stimulus/templates/component_controller.js.tt +7 -0
  19. data/lib/view_component.rb +1 -0
  20. data/lib/view_component/base.rb +144 -84
  21. data/lib/view_component/collection.rb +6 -2
  22. data/lib/view_component/compile_cache.rb +1 -0
  23. data/lib/view_component/compiler.rb +87 -53
  24. data/lib/view_component/content_areas.rb +57 -0
  25. data/lib/view_component/engine.rb +19 -2
  26. data/lib/view_component/instrumentation.rb +5 -1
  27. data/lib/view_component/preview.rb +19 -8
  28. data/lib/view_component/previewable.rb +16 -18
  29. data/lib/view_component/slot_v2.rb +34 -27
  30. data/lib/view_component/slotable.rb +2 -1
  31. data/lib/view_component/slotable_v2.rb +58 -24
  32. data/lib/view_component/test_helpers.rb +7 -1
  33. data/lib/view_component/translatable.rb +6 -5
  34. data/lib/view_component/version.rb +1 -1
  35. data/lib/view_component/with_content_helper.rb +5 -2
  36. data/lib/yard/mattr_accessor_handler.rb +19 -0
  37. metadata +76 -39
@@ -6,7 +6,7 @@ module ViewComponent
6
6
  class SlotV2
7
7
  include ViewComponent::WithContentHelper
8
8
 
9
- attr_writer :_component_instance, :_content_block, :_content
9
+ attr_writer :__vc_component_instance, :__vc_content_block, :__vc_content
10
10
 
11
11
  def initialize(parent)
12
12
  @parent = parent
@@ -21,7 +21,7 @@ module ViewComponent
21
21
  # component instance, returning the string.
22
22
  #
23
23
  # If the slot renderable is a function and returns a string, it is
24
- # set as `@_content` and is returned directly.
24
+ # set as `@__vc_content` and is returned directly.
25
25
  #
26
26
  # If there is no slot renderable, we evaluate the block passed to
27
27
  # the slot and return it.
@@ -30,32 +30,39 @@ module ViewComponent
30
30
 
31
31
  view_context = @parent.send(:view_context)
32
32
 
33
- raise ArgumentError.new("Block provided after calling `with_content`. Use one or the other.") if defined?(@_content_block) && defined?(@_content_set_by_with_content)
33
+ if defined?(@__vc_content_block) && defined?(@__vc_content_set_by_with_content)
34
+ raise ArgumentError.new(
35
+ "It looks like a block was provided after calling `with_content` on #{self.class.name}, " \
36
+ "which means that ViewComponent doesn't know which content to use.\n\n" \
37
+ "To fix this issue, use either `with_content` or a block."
38
+ )
39
+ end
34
40
 
35
- @content = if defined?(@_component_instance)
36
- if defined?(@_content_set_by_with_content)
37
- @_component_instance.with_content(@_content_set_by_with_content)
41
+ @content =
42
+ if defined?(@__vc_component_instance)
43
+ if defined?(@__vc_content_set_by_with_content)
44
+ @__vc_component_instance.with_content(@__vc_content_set_by_with_content)
38
45
 
39
- view_context.capture do
40
- @_component_instance.render_in(view_context)
41
- end
42
- elsif defined?(@_content_block)
43
- view_context.capture do
44
- # render_in is faster than `parent.render`
45
- @_component_instance.render_in(view_context, &@_content_block)
46
+ view_context.capture do
47
+ @__vc_component_instance.render_in(view_context)
48
+ end
49
+ elsif defined?(@__vc_content_block)
50
+ view_context.capture do
51
+ # render_in is faster than `parent.render`
52
+ @__vc_component_instance.render_in(view_context, &@__vc_content_block)
53
+ end
54
+ else
55
+ view_context.capture do
56
+ @__vc_component_instance.render_in(view_context)
57
+ end
46
58
  end
47
- else
48
- view_context.capture do
49
- @_component_instance.render_in(view_context)
50
- end
51
- end
52
- elsif defined?(@_content)
53
- @_content
54
- elsif defined?(@_content_block)
55
- view_context.capture(&@_content_block)
56
- elsif defined?(@_content_set_by_with_content)
57
- @_content_set_by_with_content
58
- end
59
+ elsif defined?(@__vc_content)
60
+ @__vc_content
61
+ elsif defined?(@__vc_content_block)
62
+ view_context.capture(&@__vc_content_block)
63
+ elsif defined?(@__vc_content_set_by_with_content)
64
+ @__vc_content_set_by_with_content
65
+ end
59
66
 
60
67
  @content
61
68
  end
@@ -80,7 +87,7 @@ module ViewComponent
80
87
  # end
81
88
  #
82
89
  def method_missing(symbol, *args, &block)
83
- @_component_instance.public_send(symbol, *args, &block)
90
+ @__vc_component_instance.public_send(symbol, *args, &block)
84
91
  end
85
92
 
86
93
  def html_safe?
@@ -88,7 +95,7 @@ module ViewComponent
88
95
  end
89
96
 
90
97
  def respond_to_missing?(symbol, include_all = false)
91
- defined?(@_component_instance) && @_component_instance.respond_to?(symbol, include_all)
98
+ defined?(@__vc_component_instance) && @__vc_component_instance.respond_to?(symbol, include_all)
92
99
  end
93
100
  end
94
101
  end
@@ -123,6 +123,7 @@ module ViewComponent
123
123
  slot_instance = args.present? ? slot_class.new(**args) : slot_class.new
124
124
 
125
125
  # Capture block and assign to slot_instance#content
126
+ # rubocop:disable Rails/OutputSafety
126
127
  slot_instance.content = view_context.capture(&block).to_s.strip.html_safe if block_given?
127
128
 
128
129
  if slot[:collection]
@@ -135,7 +136,7 @@ module ViewComponent
135
136
  # Append Slot instance to collection accessor Array
136
137
  instance_variable_get(slot[:instance_variable_name]) << slot_instance
137
138
  else
138
- # Assign the Slot instance to the slot accessor
139
+ # Assign the Slot instance to the slot accessor
139
140
  instance_variable_set(slot[:instance_variable_name], slot_instance)
140
141
  end
141
142
 
@@ -65,7 +65,7 @@ module ViewComponent
65
65
  # <% end %>
66
66
  # <% end %>
67
67
  def renders_one(slot_name, callable = nil)
68
- validate_slot_name(slot_name)
68
+ validate_singular_slot_name(slot_name)
69
69
 
70
70
  define_method slot_name do |*args, **kwargs, &block|
71
71
  if args.empty? && kwargs.empty? && block.nil?
@@ -116,7 +116,7 @@ module ViewComponent
116
116
  # <% end %>
117
117
  # <% end %>
118
118
  def renders_many(slot_name, callable = nil)
119
- validate_slot_name(slot_name)
119
+ validate_plural_slot_name(slot_name)
120
120
 
121
121
  singular_name = ActiveSupport::Inflector.singularize(slot_name)
122
122
 
@@ -133,7 +133,7 @@ module ViewComponent
133
133
  if collection_args.nil? && block.nil?
134
134
  get_slot(slot_name)
135
135
  else
136
- collection_args.each do |args|
136
+ collection_args.map do |args|
137
137
  set_slot(slot_name, **args, &block)
138
138
  end
139
139
  end
@@ -142,6 +142,17 @@ module ViewComponent
142
142
  register_slot(slot_name, collection: true, callable: callable)
143
143
  end
144
144
 
145
+ def slot_type(slot_name)
146
+ registered_slot = registered_slots[slot_name]
147
+ if registered_slot
148
+ registered_slot[:collection] ? :collection : :single
149
+ else
150
+ plural_slot_name = ActiveSupport::Inflector.pluralize(slot_name).to_sym
151
+ plural_registered_slot = registered_slots[plural_slot_name]
152
+ plural_registered_slot&.fetch(:collection) ? :collection_item : nil
153
+ end
154
+ end
155
+
145
156
  # Clone slot configuration into child class
146
157
  # see #test_slots_pollution
147
158
  def inherited(child)
@@ -174,14 +185,35 @@ module ViewComponent
174
185
  self.registered_slots[slot_name] = slot
175
186
  end
176
187
 
177
- def validate_slot_name(slot_name)
188
+ def validate_plural_slot_name(slot_name)
189
+ if slot_name.to_sym == :contents
190
+ raise ArgumentError.new(
191
+ "#{self} declares a slot named #{slot_name}, which is a reserved word in the ViewComponent framework.\n\n" \
192
+ "To fix this issue, choose a different name."
193
+ )
194
+ end
195
+
196
+ raise_if_slot_registered(slot_name)
197
+ end
198
+
199
+ def validate_singular_slot_name(slot_name)
178
200
  if slot_name.to_sym == :content
179
- raise ArgumentError.new("#{slot_name} is not a valid slot name.")
201
+ raise ArgumentError.new(
202
+ "#{self} declares a slot named #{slot_name}, which is a reserved word in the ViewComponent framework.\n\n" \
203
+ "To fix this issue, choose a different name."
204
+ )
180
205
  end
181
206
 
207
+ raise_if_slot_registered(slot_name)
208
+ end
209
+
210
+ def raise_if_slot_registered(slot_name)
182
211
  if self.registered_slots.key?(slot_name)
183
212
  # TODO remove? This breaks overriding slots when slots are inherited
184
- raise ArgumentError.new("#{slot_name} slot declared multiple times")
213
+ raise ArgumentError.new(
214
+ "#{self} declares the #{slot_name} slot multiple times.\n\n" \
215
+ "To fix this issue, choose a different slot name."
216
+ )
185
217
  end
186
218
  end
187
219
  end
@@ -190,10 +222,10 @@ module ViewComponent
190
222
  content unless content_evaluated? # ensure content is loaded so slots will be defined
191
223
 
192
224
  slot = self.class.registered_slots[slot_name]
193
- @_set_slots ||= {}
225
+ @__vc_set_slots ||= {}
194
226
 
195
- if @_set_slots[slot_name]
196
- return @_set_slots[slot_name]
227
+ if @__vc_set_slots[slot_name]
228
+ return @__vc_set_slots[slot_name]
197
229
  end
198
230
 
199
231
  if slot[:collection]
@@ -217,42 +249,44 @@ module ViewComponent
217
249
  # 2. Since we have to pass block content to components when calling
218
250
  # `render`, evaluating the block here would require us to call
219
251
  # `view_context.capture` twice, which is slower
220
- slot._content_block = block if block_given?
252
+ slot.__vc_content_block = block if block_given?
221
253
 
222
254
  # If class
223
255
  if slot_definition[:renderable]
224
- slot._component_instance = slot_definition[:renderable].new(*args, **kwargs)
256
+ slot.__vc_component_instance = slot_definition[:renderable].new(*args, **kwargs)
225
257
  # If class name as a string
226
258
  elsif slot_definition[:renderable_class_name]
227
- slot._component_instance = self.class.const_get(slot_definition[:renderable_class_name]).new(*args, **kwargs)
259
+ slot.__vc_component_instance =
260
+ self.class.const_get(slot_definition[:renderable_class_name]).new(*args, **kwargs)
228
261
  # If passed a lambda
229
262
  elsif slot_definition[:renderable_function]
230
263
  # Use `bind(self)` to ensure lambda is executed in the context of the
231
264
  # current component. This is necessary to allow the lambda to access helper
232
265
  # methods like `content_tag` as well as parent component state.
233
- renderable_value = if block_given?
234
- slot_definition[:renderable_function].bind(self).call(*args, **kwargs) do |*args, **kwargs|
235
- view_context.capture(*args, **kwargs, &block)
266
+ renderable_value =
267
+ if block_given?
268
+ slot_definition[:renderable_function].bind(self).call(*args, **kwargs) do |*args, **kwargs|
269
+ view_context.capture(*args, **kwargs, &block)
270
+ end
271
+ else
272
+ slot_definition[:renderable_function].bind(self).call(*args, **kwargs)
236
273
  end
237
- else
238
- slot_definition[:renderable_function].bind(self).call(*args, **kwargs)
239
- end
240
274
 
241
275
  # Function calls can return components, so if it's a component handle it specially
242
276
  if renderable_value.respond_to?(:render_in)
243
- slot._component_instance = renderable_value
277
+ slot.__vc_component_instance = renderable_value
244
278
  else
245
- slot._content = renderable_value
279
+ slot.__vc_content = renderable_value
246
280
  end
247
281
  end
248
282
 
249
- @_set_slots ||= {}
283
+ @__vc_set_slots ||= {}
250
284
 
251
285
  if slot_definition[:collection]
252
- @_set_slots[slot_name] ||= []
253
- @_set_slots[slot_name].push(slot)
286
+ @__vc_set_slots[slot_name] ||= []
287
+ @__vc_set_slots[slot_name].push(slot)
254
288
  else
255
- @_set_slots[slot_name] = slot
289
+ @__vc_set_slots[slot_name] = slot
256
290
  end
257
291
 
258
292
  slot
@@ -17,7 +17,13 @@ module ViewComponent
17
17
  # We don't have a test case for running an application without capybara installed.
18
18
  # It's probably fine to leave this without coverage.
19
19
  # :nocov:
20
- warn "WARNING in `ViewComponent::TestHelpers`: You must add `capybara` to your Gemfile to use Capybara assertions." if ENV["DEBUG"]
20
+ if ENV["DEBUG"]
21
+ warn(
22
+ "WARNING in `ViewComponent::TestHelpers`: You must add `capybara` " \
23
+ "to your Gemfile to use Capybara assertions."
24
+ )
25
+ end
26
+
21
27
  # :nocov:
22
28
  end
23
29
 
@@ -52,7 +52,7 @@ module ViewComponent
52
52
 
53
53
  def scope_data(data)
54
54
  @i18n_scope.reverse_each do |part|
55
- data = { part => data}
55
+ data = { part => data }
56
56
  end
57
57
  data
58
58
  end
@@ -70,9 +70,10 @@ module ViewComponent
70
70
  key = key&.to_s unless key.is_a?(String)
71
71
  key = "#{i18n_scope}#{key}" if key.start_with?(".")
72
72
 
73
- translated = catch(:exception) do
74
- i18n_backend.translate(locale, key, options)
75
- end
73
+ translated =
74
+ catch(:exception) do
75
+ i18n_backend.translate(locale, key, options)
76
+ end
76
77
 
77
78
  # Fallback to the global translations
78
79
  if translated.is_a? ::I18n::MissingTranslation
@@ -80,7 +81,7 @@ module ViewComponent
80
81
  end
81
82
 
82
83
  if HTML_SAFE_TRANSLATION_KEY.match?(key)
83
- translated = translated.html_safe
84
+ translated = translated.html_safe # rubocop:disable Rails/OutputSafety
84
85
  end
85
86
 
86
87
  translated
@@ -3,7 +3,7 @@
3
3
  module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 2
6
- MINOR = 34
6
+ MINOR = 38
7
7
  PATCH = 0
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].join(".")
@@ -4,9 +4,12 @@ module ViewComponent
4
4
  module WithContentHelper
5
5
  def with_content(value)
6
6
  if value.nil?
7
- raise ArgumentError.new("No content provided.")
7
+ raise ArgumentError.new(
8
+ "No content provided to `#with_content` for #{self}.\n\n" \
9
+ "To fix this issue, pass a value."
10
+ )
8
11
  else
9
- @_content_set_by_with_content = value
12
+ @__vc_content_set_by_with_content = value
10
13
  end
11
14
 
12
15
  self
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module YARD
4
+ # YARD Handler to parse `mattr_accessor` calls.
5
+ class MattrAccessorHandler < YARD::Handlers::Ruby::Base
6
+ handles method_call(:mattr_accessor)
7
+ namespace_only
8
+
9
+ process do
10
+ name = statement.parameters.first.jump(:tstring_content, :ident).source
11
+ object = YARD::CodeObjects::MethodObject.new(namespace, name)
12
+ register(object)
13
+ parse_block(statement.last, owner: object)
14
+
15
+ object.dynamic = true
16
+ object[:mattr_accessor] = true
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.34.0
4
+ version: 2.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-09 00:00:00.000000000 Z
11
+ date: 2021-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 5.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.0'
22
+ version: '8.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,21 @@ dependencies:
29
29
  version: 5.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.0'
32
+ version: '8.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: method_source
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.0'
33
47
  - !ruby/object:Gem::Dependency
34
48
  name: benchmark-ips
35
49
  requirement: !ruby/object:Gem::Requirement
@@ -45,47 +59,47 @@ dependencies:
45
59
  - !ruby/object:Gem::Version
46
60
  version: 2.8.2
47
61
  - !ruby/object:Gem::Dependency
48
- name: bundler
62
+ name: better_html
49
63
  requirement: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - "~>"
52
66
  - !ruby/object:Gem::Version
53
- version: '1.14'
67
+ version: '1'
54
68
  type: :development
55
69
  prerelease: false
56
70
  version_requirements: !ruby/object:Gem::Requirement
57
71
  requirements:
58
72
  - - "~>"
59
73
  - !ruby/object:Gem::Version
60
- version: '1.14'
74
+ version: '1'
61
75
  - !ruby/object:Gem::Dependency
62
- name: rake
76
+ name: bundler
63
77
  requirement: !ruby/object:Gem::Requirement
64
78
  requirements:
65
79
  - - "~>"
66
80
  - !ruby/object:Gem::Version
67
- version: '13.0'
81
+ version: '2.2'
68
82
  type: :development
69
83
  prerelease: false
70
84
  version_requirements: !ruby/object:Gem::Requirement
71
85
  requirements:
72
86
  - - "~>"
73
87
  - !ruby/object:Gem::Version
74
- version: '13.0'
88
+ version: '2.2'
75
89
  - !ruby/object:Gem::Dependency
76
- name: minitest
90
+ name: erb_lint
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
- - - '='
93
+ - - "~>"
80
94
  - !ruby/object:Gem::Version
81
- version: 5.6.0
95
+ version: 0.0.37
82
96
  type: :development
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
- - - '='
100
+ - - "~>"
87
101
  - !ruby/object:Gem::Version
88
- version: 5.6.0
102
+ version: 0.0.37
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: haml
91
105
  requirement: !ruby/object:Gem::Requirement
@@ -101,75 +115,75 @@ dependencies:
101
115
  - !ruby/object:Gem::Version
102
116
  version: '5'
103
117
  - !ruby/object:Gem::Dependency
104
- name: slim
118
+ name: jbuilder
105
119
  requirement: !ruby/object:Gem::Requirement
106
120
  requirements:
107
121
  - - "~>"
108
122
  - !ruby/object:Gem::Version
109
- version: '4.0'
123
+ version: '2'
110
124
  type: :development
111
125
  prerelease: false
112
126
  version_requirements: !ruby/object:Gem::Requirement
113
127
  requirements:
114
128
  - - "~>"
115
129
  - !ruby/object:Gem::Version
116
- version: '4.0'
130
+ version: '2'
117
131
  - !ruby/object:Gem::Dependency
118
- name: better_html
132
+ name: minitest
119
133
  requirement: !ruby/object:Gem::Requirement
120
134
  requirements:
121
- - - "~>"
135
+ - - '='
122
136
  - !ruby/object:Gem::Version
123
- version: '1'
137
+ version: 5.6.0
124
138
  type: :development
125
139
  prerelease: false
126
140
  version_requirements: !ruby/object:Gem::Requirement
127
141
  requirements:
128
- - - "~>"
142
+ - - '='
129
143
  - !ruby/object:Gem::Version
130
- version: '1'
144
+ version: 5.6.0
131
145
  - !ruby/object:Gem::Dependency
132
- name: jbuilder
146
+ name: pry
133
147
  requirement: !ruby/object:Gem::Requirement
134
148
  requirements:
135
149
  - - "~>"
136
150
  - !ruby/object:Gem::Version
137
- version: '2'
151
+ version: '0.13'
138
152
  type: :development
139
153
  prerelease: false
140
154
  version_requirements: !ruby/object:Gem::Requirement
141
155
  requirements:
142
156
  - - "~>"
143
157
  - !ruby/object:Gem::Version
144
- version: '2'
158
+ version: '0.13'
145
159
  - !ruby/object:Gem::Dependency
146
- name: rubocop
160
+ name: rake
147
161
  requirement: !ruby/object:Gem::Requirement
148
162
  requirements:
149
- - - '='
163
+ - - "~>"
150
164
  - !ruby/object:Gem::Version
151
- version: '0.74'
165
+ version: '13.0'
152
166
  type: :development
153
167
  prerelease: false
154
168
  version_requirements: !ruby/object:Gem::Requirement
155
169
  requirements:
156
- - - '='
170
+ - - "~>"
157
171
  - !ruby/object:Gem::Version
158
- version: '0.74'
172
+ version: '13.0'
159
173
  - !ruby/object:Gem::Dependency
160
174
  name: rubocop-github
161
175
  requirement: !ruby/object:Gem::Requirement
162
176
  requirements:
163
177
  - - "~>"
164
178
  - !ruby/object:Gem::Version
165
- version: 0.13.0
179
+ version: 0.16.1
166
180
  type: :development
167
181
  prerelease: false
168
182
  version_requirements: !ruby/object:Gem::Requirement
169
183
  requirements:
170
184
  - - "~>"
171
185
  - !ruby/object:Gem::Version
172
- version: 0.13.0
186
+ version: 0.16.1
173
187
  - !ruby/object:Gem::Dependency
174
188
  name: simplecov
175
189
  requirement: !ruby/object:Gem::Requirement
@@ -199,19 +213,19 @@ dependencies:
199
213
  - !ruby/object:Gem::Version
200
214
  version: 0.7.2
201
215
  - !ruby/object:Gem::Dependency
202
- name: pry
216
+ name: slim
203
217
  requirement: !ruby/object:Gem::Requirement
204
218
  requirements:
205
219
  - - "~>"
206
220
  - !ruby/object:Gem::Version
207
- version: '0.13'
221
+ version: '4.0'
208
222
  type: :development
209
223
  prerelease: false
210
224
  version_requirements: !ruby/object:Gem::Requirement
211
225
  requirements:
212
226
  - - "~>"
213
227
  - !ruby/object:Gem::Version
214
- version: '0.13'
228
+ version: '4.0'
215
229
  - !ruby/object:Gem::Dependency
216
230
  name: yard
217
231
  requirement: !ruby/object:Gem::Requirement
@@ -226,6 +240,20 @@ dependencies:
226
240
  - - "~>"
227
241
  - !ruby/object:Gem::Version
228
242
  version: 0.9.25
243
+ - !ruby/object:Gem::Dependency
244
+ name: yard-activesupport-concern
245
+ requirement: !ruby/object:Gem::Requirement
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ version: '0'
250
+ type: :development
251
+ prerelease: false
252
+ version_requirements: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - ">="
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
229
257
  description:
230
258
  email:
231
259
  - opensource+view_component@github.com
@@ -233,14 +261,19 @@ executables: []
233
261
  extensions: []
234
262
  extra_rdoc_files: []
235
263
  files:
236
- - CHANGELOG.md
237
264
  - LICENSE.txt
238
265
  - README.md
266
+ - app/assets/vendor/prism.css
267
+ - app/assets/vendor/prism.min.js
239
268
  - app/controllers/view_components_controller.rb
269
+ - app/helpers/preview_helper.rb
240
270
  - app/views/test_mailer/test_email.html.erb
271
+ - app/views/view_components/_preview_source.html.erb
241
272
  - app/views/view_components/index.html.erb
242
273
  - app/views/view_components/preview.html.erb
243
274
  - app/views/view_components/previews.html.erb
275
+ - docs/CHANGELOG.md
276
+ - lib/rails/generators/abstract_generator.rb
244
277
  - lib/rails/generators/component/USAGE
245
278
  - lib/rails/generators/component/component_generator.rb
246
279
  - lib/rails/generators/component/templates/component.rb.tt
@@ -254,6 +287,8 @@ files:
254
287
  - lib/rails/generators/rspec/templates/component_spec.rb.tt
255
288
  - lib/rails/generators/slim/component_generator.rb
256
289
  - lib/rails/generators/slim/templates/component.html.slim.tt
290
+ - lib/rails/generators/stimulus/component_generator.rb
291
+ - lib/rails/generators/stimulus/templates/component_controller.js.tt
257
292
  - lib/rails/generators/test_unit/component_generator.rb
258
293
  - lib/rails/generators/test_unit/templates/component_test.rb.tt
259
294
  - lib/view_component.rb
@@ -262,6 +297,7 @@ files:
262
297
  - lib/view_component/compile_cache.rb
263
298
  - lib/view_component/compiler.rb
264
299
  - lib/view_component/component_error.rb
300
+ - lib/view_component/content_areas.rb
265
301
  - lib/view_component/engine.rb
266
302
  - lib/view_component/instrumentation.rb
267
303
  - lib/view_component/preview.rb
@@ -283,6 +319,7 @@ files:
283
319
  - lib/view_component/translatable.rb
284
320
  - lib/view_component/version.rb
285
321
  - lib/view_component/with_content_helper.rb
322
+ - lib/yard/mattr_accessor_handler.rb
286
323
  homepage: https://github.com/github/view_component
287
324
  licenses:
288
325
  - MIT
@@ -296,14 +333,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
333
  requirements:
297
334
  - - ">="
298
335
  - !ruby/object:Gem::Version
299
- version: 2.3.0
336
+ version: 2.4.0
300
337
  required_rubygems_version: !ruby/object:Gem::Requirement
301
338
  requirements:
302
339
  - - ">="
303
340
  - !ruby/object:Gem::Version
304
341
  version: '0'
305
342
  requirements: []
306
- rubygems_version: 3.2.3
343
+ rubygems_version: 3.2.22
307
344
  signing_key:
308
345
  specification_version: 4
309
346
  summary: View components for Rails