ratatui_ruby 0.10.1 → 0.10.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 +4 -4
- data/.builds/ruby-3.2.yml +1 -1
- data/.builds/ruby-3.3.yml +1 -1
- data/.builds/ruby-3.4.yml +1 -1
- data/.builds/ruby-4.0.0.yml +1 -1
- data/CHANGELOG.md +24 -0
- data/doc/concepts/application_architecture.md +2 -2
- data/doc/concepts/application_testing.md +1 -1
- data/doc/concepts/custom_widgets.md +2 -2
- data/doc/contributors/todo/align/api_completeness_audit-finished.md +375 -0
- data/doc/contributors/todo/align/api_completeness_audit-unfinished.md +206 -0
- data/doc/contributors/todo/align/terminal.md +647 -0
- data/doc/getting_started/quickstart.md +41 -41
- data/doc/images/app_cli_rich_moments.gif +0 -0
- data/examples/app_cli_rich_moments/README.md +81 -0
- data/examples/app_cli_rich_moments/app.rb +189 -0
- data/ext/ratatui_ruby/Cargo.lock +1 -1
- data/ext/ratatui_ruby/Cargo.toml +1 -1
- data/ext/ratatui_ruby/src/frame.rs +17 -4
- data/ext/ratatui_ruby/src/lib.rs +17 -3
- data/ext/ratatui_ruby/src/lib.rs.bak +286 -0
- data/ext/ratatui_ruby/src/rendering.rs +38 -25
- data/ext/ratatui_ruby/src/rendering.rs.bak +152 -0
- data/ext/ratatui_ruby/src/terminal.rs +245 -33
- data/ext/ratatui_ruby/src/terminal.rs.bak +381 -0
- data/ext/ratatui_ruby/src/terminal.rs.orig +409 -0
- data/ext/ratatui_ruby/src/widgets/barchart.rs +4 -3
- data/ext/ratatui_ruby/src/widgets/block.rs +4 -4
- data/ext/ratatui_ruby/src/widgets/calendar.rs +4 -3
- data/ext/ratatui_ruby/src/widgets/canvas.rs +7 -4
- data/ext/ratatui_ruby/src/widgets/center.rs +3 -3
- data/ext/ratatui_ruby/src/widgets/chart.rs +4 -4
- data/ext/ratatui_ruby/src/widgets/clear.rs +6 -6
- data/ext/ratatui_ruby/src/widgets/cursor.rs +10 -7
- data/ext/ratatui_ruby/src/widgets/gauge.rs +4 -3
- data/ext/ratatui_ruby/src/widgets/layout.rs +3 -3
- data/ext/ratatui_ruby/src/widgets/line_gauge.rs +4 -3
- data/ext/ratatui_ruby/src/widgets/list.rs +6 -9
- data/ext/ratatui_ruby/src/widgets/overlay.rs +3 -3
- data/ext/ratatui_ruby/src/widgets/paragraph.rs +5 -6
- data/ext/ratatui_ruby/src/widgets/ratatui_logo.rs +4 -4
- data/ext/ratatui_ruby/src/widgets/ratatui_mascot.rs +8 -4
- data/ext/ratatui_ruby/src/widgets/scrollbar.rs +10 -10
- data/ext/ratatui_ruby/src/widgets/sparkline.rs +4 -3
- data/ext/ratatui_ruby/src/widgets/table.rs +6 -6
- data/ext/ratatui_ruby/src/widgets/tabs.rs +4 -3
- data/lib/ratatui_ruby/labs/a11y.rb +173 -0
- data/lib/ratatui_ruby/labs/frame_a11y_capture.rb +50 -0
- data/lib/ratatui_ruby/labs.rb +47 -0
- data/lib/ratatui_ruby/layout/position.rb +26 -0
- data/lib/ratatui_ruby/terminal/viewport.rb +80 -0
- data/lib/ratatui_ruby/terminal_lifecycle.rb +164 -6
- data/lib/ratatui_ruby/terminal_lifecycle.rb.bak +197 -0
- data/lib/ratatui_ruby/test_helper/terminal.rb +8 -1
- data/lib/ratatui_ruby/tui/core.rb +16 -0
- data/lib/ratatui_ruby/version.rb +1 -1
- data/lib/ratatui_ruby.rb +82 -3
- data/migrate_to_buffer.rb +145 -0
- data/sig/examples/app_cli_rich_moments/app.rbs +12 -0
- data/sig/ratatui_ruby/labs.rbs +87 -0
- data/sig/ratatui_ruby/ratatui_ruby.rbs +12 -4
- data/sig/ratatui_ruby/terminal/viewport.rbs +19 -0
- data/sig/ratatui_ruby/terminal_lifecycle.rbs +13 -5
- data/sig/ratatui_ruby/tui/core.rbs +3 -0
- metadata +21 -2
- /data/doc/contributors/{future_work.md → todo/future_work.md} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
#--
|
|
4
|
+
# SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
|
|
5
|
+
#
|
|
6
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
7
|
+
#++
|
|
8
|
+
|
|
9
|
+
# !/usr/bin/env ruby
|
|
10
|
+
|
|
11
|
+
# Migration script to refactor widget renderers from Frame to Buffer
|
|
12
|
+
|
|
13
|
+
require "fileutils"
|
|
14
|
+
|
|
15
|
+
WIDGETS_DIR = "/Users/kerrick/Developer/ratatui_ruby/ext/ratatui_ruby/src/widgets"
|
|
16
|
+
|
|
17
|
+
# Files to update (excluding block.rs which is already done)
|
|
18
|
+
WIDGET_FILES = %w[
|
|
19
|
+
barchart.rs
|
|
20
|
+
calendar.rs
|
|
21
|
+
canvas.rs
|
|
22
|
+
center.rs
|
|
23
|
+
chart.rs
|
|
24
|
+
clear.rs
|
|
25
|
+
cursor.rs
|
|
26
|
+
gauge.rs
|
|
27
|
+
layout.rs
|
|
28
|
+
line_gauge.rs
|
|
29
|
+
list.rs
|
|
30
|
+
overlay.rs
|
|
31
|
+
paragraph.rs
|
|
32
|
+
ratatui_logo.rs
|
|
33
|
+
ratatui_mascot.rs
|
|
34
|
+
scrollbar.rs
|
|
35
|
+
sparkline.rs
|
|
36
|
+
table.rs
|
|
37
|
+
tabs.rs
|
|
38
|
+
].freeze
|
|
39
|
+
|
|
40
|
+
def migrate_file(filepath)
|
|
41
|
+
puts "Migrating #{File.basename(filepath)}..."
|
|
42
|
+
|
|
43
|
+
content = File.read(filepath)
|
|
44
|
+
original_content = content.dup
|
|
45
|
+
|
|
46
|
+
# 1. Update function signature
|
|
47
|
+
content.gsub!("pub fn render(frame: &mut Frame,", "pub fn render(buffer: &mut Buffer,")
|
|
48
|
+
content.gsub!("pub fn render_ratatui_mascot(frame: &mut Frame,", "pub fn render_ratatui_mascot(buffer: &mut Buffer,")
|
|
49
|
+
|
|
50
|
+
# 2. Update imports - Add Buffer, remove Frame
|
|
51
|
+
# Handle various import patterns
|
|
52
|
+
content.gsub!(/use ratatui::\{([^}]*),\s*Frame\s*\};/, 'use ratatui::{\1};')
|
|
53
|
+
content.gsub!(/use ratatui::\{Frame,\s*([^}]*)\};/, 'use ratatui::{\1};')
|
|
54
|
+
content.gsub!("use ratatui::Frame;", "")
|
|
55
|
+
|
|
56
|
+
# Add Buffer import if not present
|
|
57
|
+
unless content.match?(/use ratatui::(?:\{[^}]*)?buffer::Buffer/)
|
|
58
|
+
# Find the ratatui use statement and add buffer::Buffer
|
|
59
|
+
content.gsub!("use ratatui::{", "use ratatui::{buffer::Buffer, ")
|
|
60
|
+
content.gsub!("use ratatui::layout::Rect;", "use ratatui::{buffer::Buffer, layout::Rect};")
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# 3. Update widget.render calls
|
|
64
|
+
# frame.render_widget(widget, area) → widget.render(area, buffer)
|
|
65
|
+
content.gsub!(/frame\.render_widget\(([^,]+),\s*([^)]+)\)/, '\1.render(\2, buffer)')
|
|
66
|
+
|
|
67
|
+
# 4. Update direct buffer access
|
|
68
|
+
content.gsub!("frame.buffer_mut()", "buffer")
|
|
69
|
+
|
|
70
|
+
# 5. Update recursive render_node calls
|
|
71
|
+
content.gsub!("render_node(frame,", "render_node(buffer,")
|
|
72
|
+
|
|
73
|
+
# 5.5. Update stateful widget rendering
|
|
74
|
+
# frame.render_stateful_widget(widget, area, state) → StatefulWidget::render(widget, area, buffer, state)
|
|
75
|
+
content.gsub!(/frame\.render_stateful_widget\(([^,]+),\s*([^,]+),\s*([^)]+)\)/, 'StatefulWidget::render(\1, \2, buffer, \3)')
|
|
76
|
+
|
|
77
|
+
# Add StatefulWidget import if stateful widgets are used
|
|
78
|
+
if content.match?(/StatefulWidget::render/) && !content.match?(/use ratatui::widgets::StatefulWidget/) && content.match?(/use ratatui::/)
|
|
79
|
+
content.sub!("use ratatui::{", "use ratatui::{widgets::StatefulWidget, ")
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# 6. Clean up any double-added Buffer imports and duplicate Widget imports
|
|
83
|
+
content.gsub!(/buffer::Buffer,\s*buffer::Buffer,/, "buffer::Buffer,")
|
|
84
|
+
content.gsub!(/widgets::Widget,\s*widgets::Widget/, "widgets::Widget")
|
|
85
|
+
content.gsub!(/(use ratatui::\{[^}]*widgets::Widget[^}]*),\s*widgets::Widget/, '\1')
|
|
86
|
+
|
|
87
|
+
# 7. Fix Widget trait usage - make sure Widget is imported where .render is called
|
|
88
|
+
# Add Widget to imports if calling .render on widgets
|
|
89
|
+
if content.match?(/\.render\(area,\s*buffer\)/) && !content.match?(/use ratatui::widgets::Widget/) && content.match?(/use ratatui::\{/) && !content.match?(/widgets::Widget/)
|
|
90
|
+
content.sub!("use ratatui::{", "use ratatui::{widgets::Widget, ")
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# 8. For files that don't have proper Buffer imports yet, add them
|
|
94
|
+
if !content.match?(/use ratatui::\{[^}]*buffer::Buffer/) && content.match?(/use ratatui::/)
|
|
95
|
+
# Try to add to first ratatui import
|
|
96
|
+
content.sub!("use ratatui::", "use ratatui::{buffer::Buffer};\nuse ratatui::")
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# 9. Special case: cursor.rs uses frame.set_cursor_position which doesn't exist on Buffer
|
|
100
|
+
# Cursor widget needs special handling - it can't work with just Buffer
|
|
101
|
+
if File.basename(filepath) == "cursor.rs"
|
|
102
|
+
puts " ⚠ cursor.rs requires special handling - skipping set_cursor_position"
|
|
103
|
+
# This widget can't be fully migrated as set_cursor_position is Frame-only
|
|
104
|
+
# Will need manual fix or different approach
|
|
105
|
+
end
|
|
106
|
+
# Only write if content changed
|
|
107
|
+
if content != original_content
|
|
108
|
+
File.write(filepath, content)
|
|
109
|
+
puts " ✓ Updated #{File.basename(filepath)}"
|
|
110
|
+
true
|
|
111
|
+
else
|
|
112
|
+
puts " - No changes needed for #{File.basename(filepath)}"
|
|
113
|
+
false
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def main
|
|
118
|
+
puts "Starting widget renderer migration..."
|
|
119
|
+
puts "=" * 60
|
|
120
|
+
|
|
121
|
+
updated_count = 0
|
|
122
|
+
|
|
123
|
+
WIDGET_FILES.each do |filename|
|
|
124
|
+
filepath = File.join(WIDGETS_DIR, filename)
|
|
125
|
+
|
|
126
|
+
unless File.exist?(filepath)
|
|
127
|
+
puts " ⚠ File not found: #{filename}"
|
|
128
|
+
next
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Create backup
|
|
132
|
+
backup_path = "#{filepath}.premigration"
|
|
133
|
+
FileUtils.cp(filepath, backup_path) unless File.exist?(backup_path)
|
|
134
|
+
|
|
135
|
+
updated_count += 1 if migrate_file(filepath)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
puts "=" * 60
|
|
139
|
+
puts "Migration complete!"
|
|
140
|
+
puts " Files updated: #{updated_count}/#{WIDGET_FILES.length}"
|
|
141
|
+
puts "\nBackups saved with .premigration extension"
|
|
142
|
+
puts "Run 'bundle exec rake compile' to verify the changes"
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
main if __FILE__ == $PROGRAM_NAME
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
#--
|
|
4
|
+
# SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
|
|
5
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
6
|
+
#++
|
|
7
|
+
|
|
8
|
+
# RBS type definitions for RatatuiRuby::Labs module
|
|
9
|
+
|
|
10
|
+
# Dir.tmpdir is from stdlib tmpdir extension
|
|
11
|
+
class Dir
|
|
12
|
+
def self.tmpdir: () -> String
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Interface for Data.define objects (widgets/nodes with to_h/members)
|
|
16
|
+
interface _DataLike
|
|
17
|
+
def to_h: () -> Hash[Symbol, Object]
|
|
18
|
+
def members: () -> Array[Symbol]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Minimal REXML stubs (no official RBS types available)
|
|
22
|
+
module REXML
|
|
23
|
+
class Document
|
|
24
|
+
def self.new: (?untyped?) -> Document
|
|
25
|
+
def add: (untyped) -> void
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class Element
|
|
29
|
+
def self.new: (String) -> Element
|
|
30
|
+
def add: (untyped) -> void
|
|
31
|
+
def add_attribute: (String, String) -> void
|
|
32
|
+
attr_accessor text: String?
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class XMLDecl
|
|
36
|
+
def self.new: (String, String) -> XMLDecl
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
module Formatters
|
|
40
|
+
class Pretty
|
|
41
|
+
def self.new: (Integer) -> Pretty
|
|
42
|
+
attr_accessor compact: bool
|
|
43
|
+
def write: (untyped, untyped) -> void
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
module RatatuiRuby
|
|
49
|
+
module Labs
|
|
50
|
+
@enabled_lab: Symbol?
|
|
51
|
+
@warned: bool
|
|
52
|
+
|
|
53
|
+
def self.enabled?: (Symbol lab) -> bool
|
|
54
|
+
def self.enable!: (Symbol | String lab) -> void
|
|
55
|
+
def self.reset!: () -> void
|
|
56
|
+
def self.warn_once!: (String feature_name) -> void
|
|
57
|
+
|
|
58
|
+
module A11y
|
|
59
|
+
OUTPUT_PATH: String
|
|
60
|
+
|
|
61
|
+
def self.dump_widget_tree: ((_CustomWidget | widget) widget, ?Layout::Rect? area) -> void
|
|
62
|
+
def self.dump_widgets: (Array[[(_CustomWidget | widget), Layout::Rect]] widgets_with_areas) -> void
|
|
63
|
+
def self.startup_message: () -> String
|
|
64
|
+
|
|
65
|
+
# Private class methods (called via class << self)
|
|
66
|
+
# Duck-typed serialization accepts any widget/value that may have to_h/members
|
|
67
|
+
def self.write_document: (REXML::Document doc) -> void
|
|
68
|
+
def self.build_element_with_area: ((_CustomWidget | widget) widget, Layout::Rect area) -> REXML::Element
|
|
69
|
+
def self.build_element: (untyped node) -> REXML::Element
|
|
70
|
+
def self.add_members: (REXML::Element element, untyped node, ?parent_id: String?) -> void
|
|
71
|
+
def self.scalar?: (untyped value) -> bool
|
|
72
|
+
def self.build_child_element: (Symbol key, untyped value, ?is_wrapper: bool, ?parent_id: String?) -> REXML::Element
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
class Frame
|
|
77
|
+
prepend A11yCapture
|
|
78
|
+
|
|
79
|
+
module A11yCapture
|
|
80
|
+
@a11y_widgets: Array[[(_CustomWidget | widget), Layout::Rect]]?
|
|
81
|
+
|
|
82
|
+
def render_widget: ((_CustomWidget | widget) widget, Layout::Rect area) -> void
|
|
83
|
+
def render_stateful_widget: (widget widget, Layout::Rect area, Object state) -> void
|
|
84
|
+
def flush_a11y_capture: () -> void
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -32,17 +32,19 @@ module RatatuiRuby
|
|
|
32
32
|
end
|
|
33
33
|
class Invariant < Error
|
|
34
34
|
end
|
|
35
|
+
class Internal < Error
|
|
36
|
+
end
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
# NullIO for headless mode
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
# Core module methods
|
|
41
|
-
def self.init_terminal: (?focus_events: bool, ?bracketed_paste: bool) -> void
|
|
42
|
-
def self.init_test_terminal: (Integer width, Integer height) -> void
|
|
43
|
+
def self.init_terminal: (?focus_events: bool, ?bracketed_paste: bool, ?viewport: (Terminal::Viewport | :fullscreen | :inline)?, ?height: Integer?) -> void
|
|
44
|
+
def self.init_test_terminal: (Integer width, Integer height, ?String viewport_type, ?Integer? viewport_height) -> void
|
|
43
45
|
def self.restore_terminal: () -> void
|
|
44
46
|
def self.terminal_active?: () -> bool
|
|
45
|
-
def self.run: (?focus_events: bool, ?bracketed_paste: bool) { (TUI) -> void } -> void
|
|
47
|
+
def self.run: (?focus_events: bool, ?bracketed_paste: bool, ?viewport: (Terminal::Viewport | :fullscreen | :inline)?, ?height: Integer?) { (TUI) -> void } -> void
|
|
46
48
|
def self.draw: (?widget? tree) -> void
|
|
47
49
|
| () { (Frame) -> void } -> void
|
|
48
50
|
# untyped: FFI boundary - Rust returns dynamic event hash with varying keys per event type
|
|
@@ -92,8 +94,14 @@ module RatatuiRuby
|
|
|
92
94
|
def self.headless!: () -> void
|
|
93
95
|
def self.headless?: () -> bool
|
|
94
96
|
|
|
95
|
-
# Terminal area accessor (internal, returns Hash with String keys from Rust FFI)
|
|
96
97
|
def self._get_terminal_area: () -> Hash[String, Integer]
|
|
98
|
+
def self.get_viewport_area: () -> RatatuiRuby::Layout::Rect
|
|
99
|
+
def self.terminal_area: () -> RatatuiRuby::Layout::Rect
|
|
100
|
+
def self.viewport_area: () -> RatatuiRuby::Layout::Rect
|
|
101
|
+
def self.get_terminal_size: () -> RatatuiRuby::Layout::Rect
|
|
102
|
+
def self._get_terminal_size: () -> Hash[String, Integer]
|
|
103
|
+
def self._get_viewport_type: () -> String
|
|
104
|
+
def self.insert_before: (Integer height, ?widget? widget) ?{ () -> widget } -> void
|
|
97
105
|
|
|
98
106
|
# Color conversion (internal, Rust FFI)
|
|
99
107
|
def self._color_from_u32: (Integer) -> String
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
|
|
2
|
+
# SPDX-License-Identifier: LGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
module RatatuiRuby
|
|
5
|
+
module Terminal
|
|
6
|
+
class Viewport < Data
|
|
7
|
+
attr_reader type: Symbol
|
|
8
|
+
attr_reader height: Integer?
|
|
9
|
+
|
|
10
|
+
def self.fullscreen: () -> Viewport
|
|
11
|
+
def self.inline: (Integer height) -> Viewport
|
|
12
|
+
|
|
13
|
+
def initialize: (type: Symbol, ?height: Integer?) -> void
|
|
14
|
+
|
|
15
|
+
def fullscreen?: () -> bool
|
|
16
|
+
def inline?: () -> bool
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -14,16 +14,24 @@ module RatatuiRuby
|
|
|
14
14
|
@tui_session_active: bool?
|
|
15
15
|
@headless_mode: bool?
|
|
16
16
|
|
|
17
|
-
def init_terminal: (?focus_events: bool, ?bracketed_paste: bool) -> void
|
|
17
|
+
def init_terminal: (?focus_events: bool, ?bracketed_paste: bool, ?viewport: (Terminal::Viewport | :fullscreen | :inline)?, ?height: Integer?) -> void
|
|
18
18
|
def restore_terminal: () -> void
|
|
19
19
|
def terminal_active?: () -> (bool | nil)
|
|
20
|
-
def init_test_terminal: (Integer width, Integer height) -> void
|
|
21
|
-
def run: (?focus_events: bool, ?bracketed_paste: bool) { (TUI) -> void } -> void
|
|
20
|
+
def init_test_terminal: (Integer width, Integer height, ?String viewport_type, ?Integer? viewport_height) -> void
|
|
21
|
+
def run: (?focus_events: bool, ?bracketed_paste: bool, ?viewport: (Terminal::Viewport | :fullscreen | :inline)?, ?height: Integer?) { (TUI) -> void } -> void
|
|
22
|
+
def insert_before: (Integer height, ?widget? widget) ?{ () -> widget } -> void
|
|
23
|
+
def cursor_position=: (Layout::Position | [Integer, Integer] position) -> void
|
|
24
|
+
def cursor_position: () -> Layout::Position
|
|
25
|
+
def set_cursor_position: (Integer x, Integer y) -> void
|
|
26
|
+
def get_cursor_position: () -> [Integer, Integer]
|
|
22
27
|
|
|
23
28
|
# Private native methods
|
|
24
|
-
def _init_terminal: (bool focus_events, bool bracketed_paste) -> void
|
|
25
|
-
def _init_test_terminal: (Integer width, Integer height) -> void
|
|
29
|
+
def _init_terminal: (bool focus_events, bool bracketed_paste, String viewport_type, Integer? viewport_height) -> void
|
|
30
|
+
def _init_test_terminal: (Integer width, Integer height, String viewport_type, Integer? viewport_height) -> void
|
|
26
31
|
def _restore_terminal: () -> void
|
|
32
|
+
def _get_viewport_type: () -> String
|
|
33
|
+
def _insert_before: (Integer height, widget? content) -> void
|
|
34
|
+
def resolve_viewport: ((Terminal::Viewport | :fullscreen | :inline)? viewport, Integer? height) -> Terminal::Viewport
|
|
27
35
|
def flush_warnings: () -> void
|
|
28
36
|
def flush_panic_info: () -> void
|
|
29
37
|
end
|
|
@@ -15,6 +15,9 @@ module RatatuiRuby
|
|
|
15
15
|
def poll_event: (?timeout: Float) -> Event
|
|
16
16
|
def get_cell_at: (Integer x, Integer y) -> Buffer::Cell
|
|
17
17
|
def draw_cell: (Integer x, Integer y, Buffer::Cell cell) -> Draw::CellCmd
|
|
18
|
+
def insert_before: (Integer height, ?widget? widget) ?{ () -> widget } -> void
|
|
19
|
+
def terminal_area: () -> RatatuiRuby::Layout::Rect
|
|
20
|
+
def viewport_area: () -> RatatuiRuby::Layout::Rect
|
|
18
21
|
end
|
|
19
22
|
end
|
|
20
23
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ratatui_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kerrick Long
|
|
@@ -135,14 +135,18 @@ files:
|
|
|
135
135
|
- doc/contributors/design/rust_backend.md
|
|
136
136
|
- doc/contributors/developing_examples.md
|
|
137
137
|
- doc/contributors/documentation_style.md
|
|
138
|
-
- doc/contributors/future_work.md
|
|
139
138
|
- doc/contributors/index.md
|
|
139
|
+
- doc/contributors/todo/align/api_completeness_audit-finished.md
|
|
140
|
+
- doc/contributors/todo/align/api_completeness_audit-unfinished.md
|
|
141
|
+
- doc/contributors/todo/align/terminal.md
|
|
142
|
+
- doc/contributors/todo/future_work.md
|
|
140
143
|
- doc/contributors/upstream_requests/tab_rects.md
|
|
141
144
|
- doc/contributors/upstream_requests/title_rects.md
|
|
142
145
|
- doc/custom.css
|
|
143
146
|
- doc/getting_started/quickstart.md
|
|
144
147
|
- doc/getting_started/why.md
|
|
145
148
|
- doc/images/app_all_events.png
|
|
149
|
+
- doc/images/app_cli_rich_moments.gif
|
|
146
150
|
- doc/images/app_color_picker.png
|
|
147
151
|
- doc/images/app_debugging_showcase.gif
|
|
148
152
|
- doc/images/app_debugging_showcase.png
|
|
@@ -197,6 +201,8 @@ files:
|
|
|
197
201
|
- examples/app_all_events/view/counts_view.rb
|
|
198
202
|
- examples/app_all_events/view/live_view.rb
|
|
199
203
|
- examples/app_all_events/view/log_view.rb
|
|
204
|
+
- examples/app_cli_rich_moments/README.md
|
|
205
|
+
- examples/app_cli_rich_moments/app.rb
|
|
200
206
|
- examples/app_color_picker/README.md
|
|
201
207
|
- examples/app_color_picker/app.rb
|
|
202
208
|
- examples/app_color_picker/clipboard.rb
|
|
@@ -290,10 +296,14 @@ files:
|
|
|
290
296
|
- ext/ratatui_ruby/src/events.rs
|
|
291
297
|
- ext/ratatui_ruby/src/frame.rs
|
|
292
298
|
- ext/ratatui_ruby/src/lib.rs
|
|
299
|
+
- ext/ratatui_ruby/src/lib.rs.bak
|
|
293
300
|
- ext/ratatui_ruby/src/rendering.rs
|
|
301
|
+
- ext/ratatui_ruby/src/rendering.rs.bak
|
|
294
302
|
- ext/ratatui_ruby/src/string_width.rs
|
|
295
303
|
- ext/ratatui_ruby/src/style.rs
|
|
296
304
|
- ext/ratatui_ruby/src/terminal.rs
|
|
305
|
+
- ext/ratatui_ruby/src/terminal.rs.bak
|
|
306
|
+
- ext/ratatui_ruby/src/terminal.rs.orig
|
|
297
307
|
- ext/ratatui_ruby/src/text.rs
|
|
298
308
|
- ext/ratatui_ruby/src/widgets/barchart.rs
|
|
299
309
|
- ext/ratatui_ruby/src/widgets/block.rs
|
|
@@ -340,6 +350,9 @@ files:
|
|
|
340
350
|
- lib/ratatui_ruby/event/resize.rb
|
|
341
351
|
- lib/ratatui_ruby/event/sync.rb
|
|
342
352
|
- lib/ratatui_ruby/frame.rb
|
|
353
|
+
- lib/ratatui_ruby/labs.rb
|
|
354
|
+
- lib/ratatui_ruby/labs/a11y.rb
|
|
355
|
+
- lib/ratatui_ruby/labs/frame_a11y_capture.rb
|
|
343
356
|
- lib/ratatui_ruby/layout.rb
|
|
344
357
|
- lib/ratatui_ruby/layout/constraint.rb
|
|
345
358
|
- lib/ratatui_ruby/layout/layout.rb
|
|
@@ -355,7 +368,9 @@ files:
|
|
|
355
368
|
- lib/ratatui_ruby/symbols.rb
|
|
356
369
|
- lib/ratatui_ruby/synthetic_events.rb
|
|
357
370
|
- lib/ratatui_ruby/table_state.rb
|
|
371
|
+
- lib/ratatui_ruby/terminal/viewport.rb
|
|
358
372
|
- lib/ratatui_ruby/terminal_lifecycle.rb
|
|
373
|
+
- lib/ratatui_ruby/terminal_lifecycle.rb.bak
|
|
359
374
|
- lib/ratatui_ruby/test_helper.rb
|
|
360
375
|
- lib/ratatui_ruby/test_helper/event_injection.rb
|
|
361
376
|
- lib/ratatui_ruby/test_helper/snapshot.rb
|
|
@@ -423,6 +438,7 @@ files:
|
|
|
423
438
|
- lib/ratatui_ruby/widgets/sparkline.rb
|
|
424
439
|
- lib/ratatui_ruby/widgets/table.rb
|
|
425
440
|
- lib/ratatui_ruby/widgets/tabs.rb
|
|
441
|
+
- migrate_to_buffer.rb
|
|
426
442
|
- mise.toml
|
|
427
443
|
- sig/examples/app_all_events/app.rbs
|
|
428
444
|
- sig/examples/app_all_events/model/app_model.rbs
|
|
@@ -434,6 +450,7 @@ files:
|
|
|
434
450
|
- sig/examples/app_all_events/view/counts_view.rbs
|
|
435
451
|
- sig/examples/app_all_events/view/live_view.rbs
|
|
436
452
|
- sig/examples/app_all_events/view/log_view.rbs
|
|
453
|
+
- sig/examples/app_cli_rich_moments/app.rbs
|
|
437
454
|
- sig/examples/app_color_picker/app.rbs
|
|
438
455
|
- sig/examples/app_login_form/app.rbs
|
|
439
456
|
- sig/examples/app_stateful_interaction/app.rbs
|
|
@@ -475,6 +492,7 @@ files:
|
|
|
475
492
|
- sig/ratatui_ruby/event.rbs
|
|
476
493
|
- sig/ratatui_ruby/frame.rbs
|
|
477
494
|
- sig/ratatui_ruby/interfaces.rbs
|
|
495
|
+
- sig/ratatui_ruby/labs.rbs
|
|
478
496
|
- sig/ratatui_ruby/layout/constraint.rbs
|
|
479
497
|
- sig/ratatui_ruby/layout/layout.rbs
|
|
480
498
|
- sig/ratatui_ruby/layout/position.rbs
|
|
@@ -491,6 +509,7 @@ files:
|
|
|
491
509
|
- sig/ratatui_ruby/symbols.rbs
|
|
492
510
|
- sig/ratatui_ruby/synthetic_events.rbs
|
|
493
511
|
- sig/ratatui_ruby/table_state.rbs
|
|
512
|
+
- sig/ratatui_ruby/terminal/viewport.rbs
|
|
494
513
|
- sig/ratatui_ruby/terminal_lifecycle.rbs
|
|
495
514
|
- sig/ratatui_ruby/test_helper.rbs
|
|
496
515
|
- sig/ratatui_ruby/test_helper/event_injection.rbs
|
|
File without changes
|