view_component 3.12.0 → 3.12.1

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: c9624272c360c4807dd67cd51f1ac1c1ffa9eab79cfb77994768ef32c8cb6af0
4
- data.tar.gz: f393224b193af373eef5333a35fc20ac8ca8d5501716d0c3a58aeea0ad56de61
3
+ metadata.gz: 875f47469a83b3b70de2e4271cc4af72542d88c6e12c373c8f6912d3c8c6d13e
4
+ data.tar.gz: 161671b627c087f227706c10e6ca7f900dcdd3d2ea49232024543bf78a3be14b
5
5
  SHA512:
6
- metadata.gz: dfa57ba053fac0733672492bee096d2b009dea6e5931e38ecb300d7eabe4d90a73966d81373dc7bbc1f61bcf074fc2e803611eb6602554b649b9f54a9a4ea471
7
- data.tar.gz: c8bf7fbbc161ce4030e7529bd7c5c7053d3c16f6c7f92a2816abce0727ceeacbce12d6b757faa107b3e24b92f6c423875afce3c50008d049aca45716c5be2dff
6
+ metadata.gz: aaa215e2aba616eca2ea0e1bd1e4ab76df2f6f4f34d1f3f225a5802a943b8e6c8e920b3821fda06353e52979345a8d941c2d3d2eaa24b71a6928502846224acc
7
+ data.tar.gz: f7da13dfa835866ac685d567f41549857ca40682e6f2beee269bf07b4b9bfaf942af62d03dbcc019cb72ef349ed8c601be24c1598efd0cb38e26397decb4e09a
data/docs/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@ nav_order: 5
10
10
 
11
11
  ## main
12
12
 
13
+ ## 3.12.1
14
+
15
+ * Ensure content is rendered correctly for forwarded slots.
16
+
17
+ *Cameron Dutro*
18
+
13
19
  ## 3.12.0
14
20
 
15
21
  * Remove offline links from resources.
@@ -57,7 +57,17 @@ module ViewComponent
57
57
 
58
58
  if defined?(@__vc_content_block)
59
59
  # render_in is faster than `parent.render`
60
- @__vc_component_instance.render_in(view_context, &@__vc_content_block)
60
+ @__vc_component_instance.render_in(view_context) do |*args|
61
+ return @__vc_content_block.call(*args) if @__vc_content_block&.source_location.nil?
62
+
63
+ block_context = @__vc_content_block.binding.receiver
64
+
65
+ if block_context.class < ActionView::Base
66
+ block_context.capture(*args, &@__vc_content_block)
67
+ else
68
+ @__vc_content_block.call(*args)
69
+ end
70
+ end
61
71
  else
62
72
  @__vc_component_instance.render_in(view_context)
63
73
  end
@@ -4,7 +4,7 @@ module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 3
6
6
  MINOR = 12
7
- PATCH = 0
7
+ PATCH = 1
8
8
  PRE = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
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: 3.12.0
4
+ version: 3.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ViewComponent Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-12 00:00:00.000000000 Z
11
+ date: 2024-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport