charming 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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/charming/application.rb +48 -0
  4. data/lib/charming/controller/key_dispatch.rb +113 -0
  5. data/lib/charming/controller/session_state.rb +11 -0
  6. data/lib/charming/controller/terminal.rb +33 -0
  7. data/lib/charming/controller.rb +12 -39
  8. data/lib/charming/escape.rb +81 -0
  9. data/lib/charming/events/mouse_event.rb +22 -9
  10. data/lib/charming/generators/app_generator.rb +3 -2
  11. data/lib/charming/generators/templates/app/Gemfile.template +6 -0
  12. data/lib/charming/generators/templates/app/dot_rspec.template +2 -0
  13. data/lib/charming/image/protocol/kitty.rb +126 -0
  14. data/lib/charming/image/protocol.rb +18 -0
  15. data/lib/charming/image/source.rb +85 -0
  16. data/lib/charming/image/terminal.rb +52 -0
  17. data/lib/charming/image/transmit.rb +11 -0
  18. data/lib/charming/image.rb +21 -0
  19. data/lib/charming/internal/event_loop.rb +155 -0
  20. data/lib/charming/internal/terminal/adapter.rb +14 -0
  21. data/lib/charming/internal/terminal/key_normalizer.rb +20 -0
  22. data/lib/charming/internal/terminal/memory_backend.rb +21 -3
  23. data/lib/charming/internal/terminal/modified_key_parser.rb +63 -0
  24. data/lib/charming/internal/terminal/mouse_parser.rb +32 -27
  25. data/lib/charming/internal/terminal/tty_backend.rb +79 -2
  26. data/lib/charming/presentation/components/activity_indicator.rb +2 -19
  27. data/lib/charming/presentation/components/chart.rb +80 -0
  28. data/lib/charming/presentation/components/error_screen.rb +1 -1
  29. data/lib/charming/presentation/components/filepicker.rb +101 -0
  30. data/lib/charming/presentation/components/form/builder.rb +5 -0
  31. data/lib/charming/presentation/components/form/multiselect.rb +105 -0
  32. data/lib/charming/presentation/components/image.rb +38 -0
  33. data/lib/charming/presentation/components/list.rb +22 -4
  34. data/lib/charming/presentation/components/paginator.rb +54 -0
  35. data/lib/charming/presentation/components/progressbar.rb +26 -4
  36. data/lib/charming/presentation/components/sparkline.rb +38 -0
  37. data/lib/charming/presentation/components/spinner.rb +22 -3
  38. data/lib/charming/presentation/components/stopwatch.rb +55 -0
  39. data/lib/charming/presentation/components/table.rb +42 -1
  40. data/lib/charming/presentation/components/text_area.rb +1 -2
  41. data/lib/charming/presentation/components/text_input.rb +9 -4
  42. data/lib/charming/presentation/components/time_display.rb +20 -0
  43. data/lib/charming/presentation/components/timer.rb +43 -0
  44. data/lib/charming/presentation/components/viewport/content_lines.rb +1 -1
  45. data/lib/charming/presentation/components/viewport/line_window.rb +1 -1
  46. data/lib/charming/presentation/markdown/renderer.rb +1 -1
  47. data/lib/charming/presentation/markdown/style_config.rb +1 -0
  48. data/lib/charming/presentation/markdown/table_renderer.rb +2 -3
  49. data/lib/charming/presentation/ui/adaptive_color.rb +20 -0
  50. data/lib/charming/presentation/ui/ansi_codes.rb +5 -2
  51. data/lib/charming/presentation/ui/background.rb +58 -0
  52. data/lib/charming/presentation/ui/border.rb +14 -1
  53. data/lib/charming/presentation/ui/border_painter.rb +23 -11
  54. data/lib/charming/presentation/ui/braille_canvas.rb +80 -0
  55. data/lib/charming/presentation/ui/canvas.rb +1 -0
  56. data/lib/charming/presentation/ui/gradient.rb +47 -0
  57. data/lib/charming/presentation/ui/style.rb +119 -19
  58. data/lib/charming/presentation/{markdown → ui}/text_wrapper.rb +4 -4
  59. data/lib/charming/presentation/ui/truncate.rb +29 -0
  60. data/lib/charming/presentation/ui/width.rb +11 -0
  61. data/lib/charming/presentation/ui.rb +52 -11
  62. data/lib/charming/presentation/view.rb +8 -6
  63. data/lib/charming/response.rb +11 -6
  64. data/lib/charming/runtime.rb +154 -88
  65. data/lib/charming/version.rb +1 -1
  66. metadata +29 -3
@@ -6,7 +6,7 @@ module Charming
6
6
  # reads keyboard, mouse, timer, and task events, dispatching them to
7
7
  # controllers, rendering responses, and tearing down cleanly on exit.
8
8
  class Runtime
9
- DEFAULT_READ_TIMEOUT = 0.05
9
+ DEFAULT_READ_TIMEOUT = Internal::EventLoop::DEFAULT_READ_TIMEOUT
10
10
 
11
11
  def initialize(application, backend: nil, renderer: nil, clock: nil, task_executor: nil)
12
12
  @application = application
@@ -18,7 +18,8 @@ module Charming
18
18
  @application.task_executor = @task_executor
19
19
  @route = @application.routes.resolve("/")
20
20
  @screen = backend_screen
21
- @timers = build_timers
21
+ @coalesce_input = @application.respond_to?(:coalesce_input?) && @application.coalesce_input?
22
+ @event_loop = build_event_loop
22
23
  end
23
24
 
24
25
  # Runs the event loop: enters alt-screen, dispatches incoming events
@@ -27,59 +28,87 @@ module Charming
27
28
  # actions render an ErrorScreen instead of crashing the terminal.
28
29
  def run
29
30
  setup_terminal
30
- install_interrupt_handler
31
+ install_signal_handlers
32
+ install_exit_hook
31
33
  with_raw_input do
32
34
  render(initial_response)
33
- loop do
34
- break if @interrupted
35
-
36
- event = next_task_event || next_timer_event || @backend.read_event(timeout: read_timeout)
37
- unless event
38
- break if backend_exhausted?
39
- next
40
- end
41
- break if process(event) == :quit
42
- end
35
+ @event_loop.run { |event, more_ready| process(event, flush: !more_ready) }
36
+ ensure
37
+ restore_signal_handlers
38
+ @task_executor&.shutdown(timeout: 2.0)
39
+ @application.save_session if @application.respond_to?(:save_session)
40
+ restore_terminal
43
41
  end
44
- ensure
45
- restore_interrupt_handler
46
- @task_executor&.shutdown(timeout: 2.0)
47
- @application.save_session if @application.respond_to?(:save_session)
48
- restore_terminal
49
42
  end
50
43
 
51
44
  private
52
45
 
53
46
  attr_reader :screen
54
47
 
55
- # The first frame's response the root route's action, with errors caught.
48
+ # Builds the event pump, wiring in the current controller's timer bindings and
49
+ # an interrupt check backed by the SIGINT flag set in install_interrupt_handler.
50
+ def build_event_loop
51
+ Internal::EventLoop.new(
52
+ backend: @backend,
53
+ clock: @clock,
54
+ task_queue: @task_queue,
55
+ timer_bindings: @route.controller_class.timer_bindings.values,
56
+ coalesce_input: @coalesce_input,
57
+ interrupted: -> { @interrupted }
58
+ )
59
+ end
60
+
61
+ # The first frame's response — the root route's action, with errors caught. Out-of-band escape
62
+ # sequences registered while rendering are collected and attached to the response.
56
63
  def initial_response
57
- resolve_response(dispatch(@route.action))
64
+ response = nil
65
+ escapes = Escape.collecting { response = resolve_response(dispatch(@route.action)) }
66
+ attach_escapes(response, escapes)
58
67
  rescue => e
59
68
  error_response(e)
60
69
  end
61
70
 
62
71
  # Handles a single event. Returns :quit to stop the loop, nil otherwise.
63
72
  # While an error screen is showing, only key events are honored: q quits,
64
- # any other key dismisses and re-renders the current route.
65
- def process(event)
73
+ # any other key dismisses and re-renders the current route. When *flush* is
74
+ # false (more events are already due), the response is held so a burst of
75
+ # task/timer events paints once with the final state; held escapes are
76
+ # carried forward in order so none are lost.
77
+ def process(event, flush: true)
66
78
  return process_error_event(event) if @error
67
79
  return :quit if unbound_interrupt?(event)
68
80
 
69
- response = dispatch_event(event)
70
- return unless response
71
- return :quit if response.quit?
72
-
73
- response = resolve_response(response)
81
+ response = nil
82
+ escapes = Escape.collecting do
83
+ response = dispatch_event(event)
84
+ response = resolve_response(response) if response
85
+ end
86
+ return flush_pending if response.nil?
74
87
  return :quit if response.quit?
75
88
 
76
- render(response)
77
- nil
89
+ hold_response(response, escapes)
90
+ flush ? flush_pending : nil
78
91
  rescue => e
92
+ @pending_response = nil
79
93
  render(error_response(e))
80
94
  nil
81
95
  end
82
96
 
97
+ # Replaces the held response with *response*, prepending any escapes held
98
+ # from earlier events in the burst so they still flush in order.
99
+ def hold_response(response, escapes)
100
+ held = @pending_response&.escapes || []
101
+ @pending_response = response.with(escapes: held + response.escapes + escapes)
102
+ end
103
+
104
+ # Renders the held response, if any. Always returns nil (the loop's "keep going").
105
+ def flush_pending
106
+ response = @pending_response
107
+ @pending_response = nil
108
+ render(response) if response
109
+ nil
110
+ end
111
+
83
112
  # Error-mode event handling: q quits, any other key dismisses the error
84
113
  # and re-dispatches the current route's action. Timer/task events are ignored.
85
114
  def process_error_event(event)
@@ -91,13 +120,6 @@ module Charming
91
120
  nil
92
121
  end
93
122
 
94
- # True when the backend reports it has no more events to deliver (test backends
95
- # only — the TTY backend never exhausts). Prevents the loop from spinning forever
96
- # in tests that forget a trailing quit event.
97
- def backend_exhausted?
98
- @backend.respond_to?(:exhausted?) && @backend.exhausted?
99
- end
100
-
101
123
  # True for a Ctrl+C key press that the current controller has no binding for —
102
124
  # the runtime treats it as quit so apps always have an escape hatch. Controllers
103
125
  # can take over by binding "ctrl+c" themselves.
@@ -108,20 +130,66 @@ module Charming
108
130
  @route.controller_class.key_bindings[:"ctrl+c"].nil?
109
131
  end
110
132
 
111
- # Traps SIGINT so Ctrl+C (when delivered as a signal rather than a key) exits the
112
- # loop cleanly through the ensure block instead of crashing mid-frame.
113
- def install_interrupt_handler
133
+ # Signals that should exit the loop cleanly through the ensure block (restoring
134
+ # the terminal) instead of killing the process mid-frame.
135
+ QUIT_SIGNALS = %w[INT TERM HUP].freeze
136
+
137
+ # Traps quit signals to set the interrupt flag the event loop checks, and —
138
+ # when the backend supports it — SIGTSTP/SIGCONT for shell suspend/resume.
139
+ def install_signal_handlers
114
140
  @interrupted = false
115
- @previous_int_handler = Signal.trap("INT") { @interrupted = true }
116
- rescue ArgumentError
117
- @previous_int_handler = nil
141
+ @previous_handlers = {}
142
+ QUIT_SIGNALS.each { |signal| trap_signal(signal) { @interrupted = true } }
143
+ install_suspend_handlers if @backend.respond_to?(:suspend)
118
144
  end
119
145
 
120
- # Restores the previous SIGINT handler installed before the runtime started.
121
- def restore_interrupt_handler
122
- Signal.trap("INT", @previous_int_handler || "DEFAULT")
146
+ # Ctrl+Z: return the terminal to its normal state, stop the process, and on
147
+ # SIGCONT re-enter the TUI and force a repaint via the backend's resize path.
148
+ def install_suspend_handlers
149
+ trap_signal("TSTP") { suspend }
150
+ trap_signal("CONT") { resume }
151
+ end
152
+
153
+ # Traps *signal*, remembering the previous handler for teardown. Platforms
154
+ # without the signal (or restricted environments) are silently skipped.
155
+ def trap_signal(signal, &block)
156
+ @previous_handlers[signal] = Signal.trap(signal, &block)
123
157
  rescue ArgumentError
124
- nil
158
+ @previous_handlers.delete(signal)
159
+ end
160
+
161
+ # Restores every signal handler that was replaced when the runtime started.
162
+ def restore_signal_handlers
163
+ (@previous_handlers || {}).each do |signal, previous|
164
+ Signal.trap(signal, previous || "DEFAULT")
165
+ rescue ArgumentError
166
+ nil
167
+ end
168
+ end
169
+
170
+ # Restores the terminal for the shell and stops the process (the untrappable
171
+ # SIGSTOP), so Ctrl+Z behaves like it does in any well-behaved TUI.
172
+ def suspend
173
+ @backend.suspend
174
+ Process.kill("STOP", Process.pid)
175
+ end
176
+
177
+ # Re-enters the TUI after a foreground `fg`: raw mode and alt screen come back,
178
+ # the renderer cache is dropped, and the backend's resize path triggers a repaint.
179
+ def resume
180
+ @backend.resume
181
+ @renderer.invalidate if @renderer.respond_to?(:invalidate)
182
+ @backend.notify_resize if @backend.respond_to?(:notify_resize)
183
+ end
184
+
185
+ # Registers a process-exit fallback so an unexpected death (an exception that
186
+ # skips run's ensure, or an exit from within a handler) still restores the
187
+ # terminal. restore_terminal is idempotent, so the normal path stays cheap.
188
+ def install_exit_hook
189
+ return if @exit_hook_installed
190
+
191
+ @exit_hook_installed = true
192
+ at_exit { restore_terminal }
125
193
  end
126
194
 
127
195
  # Records *error*, logs its backtrace, and builds a centered ErrorScreen response.
@@ -208,12 +276,13 @@ module Charming
208
276
  end
209
277
 
210
278
  # Follows navigation responses: resolves the new route from the router,
211
- # resets timers for the new route, and dispatches that route's action.
279
+ # reschedules the event loop's timers for the new controller, and
280
+ # dispatches that route's action.
212
281
  def resolve_response(response)
213
282
  return response unless response.navigate?
214
283
 
215
284
  @route = @application.routes.resolve(response.path)
216
- @timers = build_timers
285
+ @event_loop.reset_timers(@route.controller_class.timer_bindings.values)
217
286
  dispatch(@route.action)
218
287
  end
219
288
 
@@ -223,51 +292,27 @@ module Charming
223
292
  Screen.new(width: width, height: height)
224
293
  end
225
294
 
226
- # Renders the body portion of a response through the renderer.
295
+ # Renders a response: first flushes any out-of-band escape sequences (image transmissions,
296
+ # clipboard writes, notifications, title changes) straight to the backend — ahead of the frame so
297
+ # image data is registered before its placeholder cells reference it — then renders the body.
227
298
  def render(response)
299
+ flush_escapes(response)
228
300
  @renderer.render(response.body)
229
301
  end
230
302
 
231
- # Builds the initial set of timer states from controller bindings and the current clock time.
232
- def build_timers
233
- now = clock_now
234
- @route.controller_class.timer_bindings.values.map do |binding|
235
- {binding: binding, next_at: now + binding.interval}
236
- end
237
- end
238
-
239
- # Returns a TimerEvent for the first due timer and advances its next fire time.
240
- # Returns nil if no timers are ready or registered.
241
- def next_timer_event
242
- timer = due_timer
243
- return unless timer
244
-
245
- now = clock_now
246
- timer[:next_at] = now + timer.fetch(:binding).interval
247
- Events::TimerEvent.new(name: timer.fetch(:binding).name, now: now)
248
- end
249
-
250
- # Pops a task event from the thread-safe queue if one is available.
251
- # Non-blocking — returns nil immediately when the queue is empty.
252
- def next_task_event
253
- @task_queue.pop(true)
254
- rescue ThreadError
255
- nil
256
- end
303
+ # Writes a response's out-of-band escape sequences to the backend, ahead of the frame. No-op for
304
+ # backends that don't support them or responses that carry none.
305
+ def flush_escapes(response)
306
+ return unless @backend.respond_to?(:write_escape)
257
307
 
258
- # Returns timer values due at or before `now`, sorted by next fire time.
259
- def due_timer
260
- now = clock_now
261
- @timers.select { |timer| timer.fetch(:next_at) <= now }.min_by { |timer| timer.fetch(:next_at) }
308
+ response.escapes&.each { |sequence| @backend.write_escape(sequence) }
262
309
  end
263
310
 
264
- # Computes how long to block waiting for input based on when the next timer is due,
265
- # clamped between 0 and DEFAULT_READ_TIMEOUT (0.05s). Returns DEFAULT when no timers exist.
266
- def read_timeout
267
- next_at = @timers.map { |timer| timer.fetch(:next_at) }.min
268
- return DEFAULT_READ_TIMEOUT unless next_at
311
+ # Returns *response* with *escapes* appended, or unchanged when none were collected.
312
+ def attach_escapes(response, escapes)
313
+ return response if escapes.nil? || escapes.empty?
269
314
 
270
- (next_at - clock_now).clamp(0, DEFAULT_READ_TIMEOUT)
315
+ response.with(escapes: response.escapes + escapes)
271
316
  end
272
317
 
273
318
  # Constructs a task executor: supports explicit instances, callable factories, or the default Threaded executor.
@@ -285,16 +330,33 @@ module Charming
285
330
  end
286
331
 
287
332
  # Enters an alternative screen buffer, hides the cursor, and installs
288
- # a terminal resize signal handler if supported by the backend.
333
+ # a terminal resize signal handler if supported by the backend. Also asks
334
+ # the terminal for its background color so adaptive colors resolve correctly.
289
335
  def setup_terminal
336
+ detect_background
290
337
  @backend.enter_alt_screen
291
338
  @backend.hide_cursor
292
- @backend.enable_mouse_tracking if @backend.respond_to?(:enable_mouse_tracking)
339
+ @backend.enable_mouse_tracking(motion: mouse_motion) if @backend.respond_to?(:enable_mouse_tracking)
293
340
  @backend.enable_bracketed_paste if @backend.respond_to?(:enable_bracketed_paste)
294
341
  @backend.enable_focus_reporting if @backend.respond_to?(:enable_focus_reporting)
295
342
  @backend.install_resize_handler if @backend.respond_to?(:install_resize_handler)
296
343
  end
297
344
 
345
+ # The app's configured mouse motion mode (:drag unless the app opts into :all hover).
346
+ def mouse_motion
347
+ @application.respond_to?(:mouse_motion) ? @application.mouse_motion : :drag
348
+ end
349
+
350
+ # Feeds the terminal's OSC 11 background reply (when the backend can obtain
351
+ # one) into UI::Background so adaptive colors resolve against reality rather
352
+ # than the dark-background default.
353
+ def detect_background
354
+ return unless @backend.respond_to?(:query_background_color)
355
+
356
+ background = @backend.query_background_color
357
+ UI::Background.assume = background if background
358
+ end
359
+
298
360
  # Keeps input raw/no-echo across rendering and dispatch, not just during reads.
299
361
  def with_raw_input(&block)
300
362
  return yield unless @backend.respond_to?(:with_raw_input)
@@ -303,8 +365,12 @@ module Charming
303
365
  end
304
366
 
305
367
  # Restores terminal state: reinstalls any previous resize handler, shows
306
- # the cursor, and leaves the alternative screen buffer.
368
+ # the cursor, and leaves the alternative screen buffer. Idempotent — runs
369
+ # once whether reached from run's ensure or the at_exit fallback.
307
370
  def restore_terminal
371
+ return if @restored
372
+
373
+ @restored = true
308
374
  @backend.restore_resize_handler if @backend.respond_to?(:restore_resize_handler)
309
375
  @backend.disable_focus_reporting if @backend.respond_to?(:disable_focus_reporting)
310
376
  @backend.disable_bracketed_paste if @backend.respond_to?(:disable_bracketed_paste)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Charming
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charming
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
  - pando
@@ -201,10 +201,13 @@ files:
201
201
  - lib/charming/controller/dispatching.rb
202
202
  - lib/charming/controller/focus.rb
203
203
  - lib/charming/controller/focus_management.rb
204
+ - lib/charming/controller/key_dispatch.rb
204
205
  - lib/charming/controller/rendering.rb
205
206
  - lib/charming/controller/session_state.rb
206
207
  - lib/charming/controller/sidebar_navigation.rb
208
+ - lib/charming/controller/terminal.rb
207
209
  - lib/charming/database/commands.rb
210
+ - lib/charming/escape.rb
208
211
  - lib/charming/events/focus_event.rb
209
212
  - lib/charming/events/key_event.rb
210
213
  - lib/charming/events/mouse_event.rb
@@ -233,6 +236,7 @@ files:
233
236
  - lib/charming/generators/templates/app/application_record.template
234
237
  - lib/charming/generators/templates/app/application_state.template
235
238
  - lib/charming/generators/templates/app/database_config.template
239
+ - lib/charming/generators/templates/app/dot_rspec.template
236
240
  - lib/charming/generators/templates/app/executable.template
237
241
  - lib/charming/generators/templates/app/gemspec.template
238
242
  - lib/charming/generators/templates/app/home_controller.template
@@ -261,11 +265,19 @@ files:
261
265
  - lib/charming/generators/templates/screen/view.rb.template
262
266
  - lib/charming/generators/templates/view/view.rb.template
263
267
  - lib/charming/generators/view_generator.rb
268
+ - lib/charming/image.rb
269
+ - lib/charming/image/protocol.rb
270
+ - lib/charming/image/protocol/kitty.rb
271
+ - lib/charming/image/source.rb
272
+ - lib/charming/image/terminal.rb
273
+ - lib/charming/image/transmit.rb
274
+ - lib/charming/internal/event_loop.rb
264
275
  - lib/charming/internal/renderer/differential.rb
265
276
  - lib/charming/internal/renderer/full_repaint.rb
266
277
  - lib/charming/internal/terminal/adapter.rb
267
278
  - lib/charming/internal/terminal/key_normalizer.rb
268
279
  - lib/charming/internal/terminal/memory_backend.rb
280
+ - lib/charming/internal/terminal/modified_key_parser.rb
269
281
  - lib/charming/internal/terminal/mouse_parser.rb
270
282
  - lib/charming/internal/terminal/tty_backend.rb
271
283
  - lib/charming/presentation/component.rb
@@ -274,32 +286,41 @@ files:
274
286
  - lib/charming/presentation/components/autocomplete.rb
275
287
  - lib/charming/presentation/components/badge.rb
276
288
  - lib/charming/presentation/components/breadcrumbs.rb
289
+ - lib/charming/presentation/components/chart.rb
277
290
  - lib/charming/presentation/components/command_palette.rb
278
291
  - lib/charming/presentation/components/command_palette_modal.rb
279
292
  - lib/charming/presentation/components/empty_state.rb
280
293
  - lib/charming/presentation/components/error_screen.rb
294
+ - lib/charming/presentation/components/filepicker.rb
281
295
  - lib/charming/presentation/components/form.rb
282
296
  - lib/charming/presentation/components/form/builder.rb
283
297
  - lib/charming/presentation/components/form/confirm.rb
284
298
  - lib/charming/presentation/components/form/field.rb
285
299
  - lib/charming/presentation/components/form/input.rb
300
+ - lib/charming/presentation/components/form/multiselect.rb
286
301
  - lib/charming/presentation/components/form/note.rb
287
302
  - lib/charming/presentation/components/form/select.rb
288
303
  - lib/charming/presentation/components/form/textarea.rb
289
304
  - lib/charming/presentation/components/fuzzy_matcher.rb
290
305
  - lib/charming/presentation/components/help_overlay.rb
306
+ - lib/charming/presentation/components/image.rb
291
307
  - lib/charming/presentation/components/keyboard_handler.rb
292
308
  - lib/charming/presentation/components/list.rb
293
309
  - lib/charming/presentation/components/markdown.rb
294
310
  - lib/charming/presentation/components/modal.rb
295
311
  - lib/charming/presentation/components/multi_select_list.rb
312
+ - lib/charming/presentation/components/paginator.rb
296
313
  - lib/charming/presentation/components/progressbar.rb
314
+ - lib/charming/presentation/components/sparkline.rb
297
315
  - lib/charming/presentation/components/spinner.rb
298
316
  - lib/charming/presentation/components/status_bar.rb
317
+ - lib/charming/presentation/components/stopwatch.rb
299
318
  - lib/charming/presentation/components/tab_bar.rb
300
319
  - lib/charming/presentation/components/table.rb
301
320
  - lib/charming/presentation/components/text_area.rb
302
321
  - lib/charming/presentation/components/text_input.rb
322
+ - lib/charming/presentation/components/time_display.rb
323
+ - lib/charming/presentation/components/timer.rb
303
324
  - lib/charming/presentation/components/toast.rb
304
325
  - lib/charming/presentation/components/tree.rb
305
326
  - lib/charming/presentation/components/viewport.rb
@@ -322,19 +343,23 @@ files:
322
343
  - lib/charming/presentation/markdown/style_config.rb
323
344
  - lib/charming/presentation/markdown/syntax_highlighter.rb
324
345
  - lib/charming/presentation/markdown/table_renderer.rb
325
- - lib/charming/presentation/markdown/text_wrapper.rb
326
346
  - lib/charming/presentation/markdown/url_resolver.rb
327
347
  - lib/charming/presentation/template_view.rb
328
348
  - lib/charming/presentation/templates.rb
329
349
  - lib/charming/presentation/templates/erb_handler.rb
330
350
  - lib/charming/presentation/ui.rb
351
+ - lib/charming/presentation/ui/adaptive_color.rb
331
352
  - lib/charming/presentation/ui/ansi_codes.rb
332
353
  - lib/charming/presentation/ui/ansi_slicer.rb
354
+ - lib/charming/presentation/ui/background.rb
333
355
  - lib/charming/presentation/ui/border.rb
334
356
  - lib/charming/presentation/ui/border_painter.rb
357
+ - lib/charming/presentation/ui/braille_canvas.rb
335
358
  - lib/charming/presentation/ui/canvas.rb
336
359
  - lib/charming/presentation/ui/color_support.rb
360
+ - lib/charming/presentation/ui/gradient.rb
337
361
  - lib/charming/presentation/ui/style.rb
362
+ - lib/charming/presentation/ui/text_wrapper.rb
338
363
  - lib/charming/presentation/ui/theme.rb
339
364
  - lib/charming/presentation/ui/themes/catppuccin-latte.json
340
365
  - lib/charming/presentation/ui/themes/catppuccin-mocha.json
@@ -342,6 +367,7 @@ files:
342
367
  - lib/charming/presentation/ui/themes/nord.json
343
368
  - lib/charming/presentation/ui/themes/phosphor.json
344
369
  - lib/charming/presentation/ui/themes/tokyonight.json
370
+ - lib/charming/presentation/ui/truncate.rb
345
371
  - lib/charming/presentation/ui/width.rb
346
372
  - lib/charming/presentation/view.rb
347
373
  - lib/charming/response.rb
@@ -377,7 +403,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
377
403
  - !ruby/object:Gem::Version
378
404
  version: '0'
379
405
  requirements: []
380
- rubygems_version: 4.0.12
406
+ rubygems_version: 4.0.16
381
407
  specification_version: 4
382
408
  summary: A Rails-inspired TUI framework for Ruby.
383
409
  test_files: []