atomic_view 0.2.1 → 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: 2cfa124ea9d90829cb7c8879e99d63b4c0e5587f4ee294ca19557f9dc0b92699
4
- data.tar.gz: 972a88497711cd0d4c1f9e323346886b9eed136c350120ab0e6adfbb62764f25
3
+ metadata.gz: cd4eda901113f75bade919c83f2f6e45bc8e01727ca22aed9b6c4ab85ef55693
4
+ data.tar.gz: 566969e9ac8ba89e384e85b427f836a15226bf27834524caae0355efef80b39f
5
5
  SHA512:
6
- metadata.gz: 3696f874e0d5e627a572be114d091a18d451427f9e980e79b8b9304a3965b0d5a11060d44b0f7a7711364553199127778dc86ffc8d86d45851a65184250861fb
7
- data.tar.gz: db66b0814f6c2b03969d1d4f0b422f1494768d24699d308e522deefcd5a629e77bf4382263a573765188ead91c986e0618b52700c8ff897852852ae823578049
6
+ metadata.gz: 76933653def4779402ce08951a2dc75642d4e1e5a6e350127944f2a598216b1d09ef929021e204780f2a3957ed7394cdeae40a09819be4c9ddf464c6de9f9711
7
+ data.tar.gz: e05db9862990d64563fe7310828681d194f08c3ed6c33b9cb5b365c8fd944e121b76e001adeed404b54783b51ae85a4b2ac59f348571df5f039b8aca8bc598f6
@@ -16,16 +16,23 @@ module AtomicView
16
16
  # (aging into a full date over time) client-side once the host app
17
17
  # loads local_time's JS -- see `config/importmap.rb`'s "local-time"
18
18
  # pin comment for that setup.
19
+ #
20
+ # Any other keyword argument (`id:`, `data:`, `class:`, ...) passes
21
+ # through to the row's outer wrapper `<div>` in
22
+ # `TimelineComponent`'s template, so a caller can address a whole
23
+ # row -- marker, meta line, and content -- for e.g. a Turbo Stream
24
+ # `remove`/`replace`, or wire up a Stimulus target on the row itself.
19
25
  class ItemComponent < AtomicView::Component
20
- attr_reader :icon_name, :avatar, :actor, :description, :time
26
+ attr_reader :icon_name, :avatar, :actor, :description, :time, :html_options
21
27
 
22
- def initialize(description:, icon: nil, avatar: nil, actor: nil, time: nil)
28
+ def initialize(description:, icon: nil, avatar: nil, actor: nil, time: nil, **html_options)
23
29
  super()
24
30
  @icon_name = icon
25
31
  @avatar = avatar
26
32
  @actor = actor
27
33
  @description = description
28
34
  @time = time
35
+ @html_options = html_options
29
36
  end
30
37
 
31
38
  def marker
@@ -1,10 +1,10 @@
1
1
  <%= tag.div(**@options.except(:class), class: container_class) do %>
2
2
  <% items.each_with_index do |item, index| %>
3
- <div class="<%= item_wrapper_class(index) %>">
3
+ <%= tag.div(**item.html_options.except(:class), class: item_wrapper_class(index, item)) do %>
4
4
  <% if render_line?(index) %>
5
5
  <div class="absolute left-[13px] top-7 -bottom-6 w-px bg-border"></div>
6
6
  <% end %>
7
7
  <%= item %>
8
- </div>
8
+ <% end %>
9
9
  <% end %>
10
10
  <% end %>
@@ -47,8 +47,8 @@ module AtomicView
47
47
  # `continues:` says this render is one page of a longer feed -- the connector
48
48
  # keeps going past the last item, into whatever the next turbo frame appends
49
49
  # or the stream prepends above.
50
- def item_wrapper_class(index)
51
- class_names("relative flex gap-3.5", "pb-6" => !last?(index) || @continues)
50
+ def item_wrapper_class(index, item)
51
+ class_names("relative flex gap-3.5", {"pb-6" => !last?(index) || @continues}, item.html_options[:class])
52
52
  end
53
53
 
54
54
  def render_line?(index)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AtomicView
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atomic_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Warrington
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-12 00:00:00.000000000 Z
11
+ date: 2026-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk