ruflet_core 0.0.21 → 0.0.23

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ruflet/version.rb +1 -1
  3. data/lib/ruflet_ui/ruflet/dsl.rb +76 -0
  4. data/lib/ruflet_ui/ruflet/event.rb +3 -2
  5. data/lib/ruflet_ui/ruflet/events/gesture_events.rb +2 -1
  6. data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +46 -26
  7. data/lib/ruflet_ui/ruflet/icons/material/material_icons.rb +61 -26
  8. data/lib/ruflet_ui/ruflet/page.rb +242 -4
  9. data/lib/ruflet_ui/ruflet/ui/control_factory.rb +2 -0
  10. data/lib/ruflet_ui/ruflet/ui/control_methods.rb +4 -0
  11. data/lib/ruflet_ui/ruflet/ui/control_registry.rb +20 -1
  12. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +1 -1
  13. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +1 -1
  14. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +1 -1
  15. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +1 -1
  16. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoappbar_control.rb +1 -1
  17. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobottomsheet_control.rb +1 -1
  18. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +1 -1
  19. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +1 -1
  20. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +1 -1
  21. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +1 -1
  22. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +1 -1
  23. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +1 -1
  24. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +1 -1
  25. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +1 -1
  26. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +1 -1
  27. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +1 -1
  28. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +1 -1
  29. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +1 -1
  30. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +1 -1
  31. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +1 -1
  32. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +1 -1
  33. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +1 -1
  34. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +1 -1
  35. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +1 -1
  36. data/lib/ruflet_ui/ruflet/ui/controls/materials/ad_controls.rb +45 -0
  37. data/lib/ruflet_ui/ruflet/ui/controls/materials/animation_extension_controls.rb +29 -0
  38. data/lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb +56 -279
  39. data/lib/ruflet_ui/ruflet/ui/controls/materials/code_editor_control.rb +42 -0
  40. data/lib/ruflet_ui/ruflet/ui/controls/materials/color_picker_controls.rb +34 -0
  41. data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable2_controls.rb +41 -0
  42. data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownm2_control.rb +1 -1
  43. data/lib/ruflet_ui/ruflet/ui/controls/materials/map_control.rb +80 -0
  44. data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +62 -0
  45. data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +1 -2
  46. data/lib/ruflet_ui/ruflet/ui/controls/materials/webview_control.rb +5 -30
  47. data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +60 -0
  48. data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +17 -0
  49. data/lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_app_control.rb +3 -3
  50. data/lib/ruflet_ui/ruflet/ui/controls/shared/serviceregistry_control.rb +5 -1
  51. data/lib/ruflet_ui/ruflet/ui/cupertino_control_methods.rb +2 -0
  52. data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +110 -6
  53. data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +23 -8
  54. data/lib/ruflet_ui/ruflet/ui/platform_control_contracts.rb +392 -0
  55. data/lib/ruflet_ui/ruflet/ui/platform_control_methods.rb +35 -0
  56. data/lib/ruflet_ui/ruflet/ui/services/current_service_methods.rb +220 -0
  57. data/lib/ruflet_ui/ruflet/ui/services/ruflet/camera_control.rb +88 -0
  58. data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +4 -0
  59. data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +75 -0
  60. data/lib/ruflet_ui.rb +6 -9
  61. metadata +9 -1
@@ -0,0 +1,220 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Services
6
+ module CurrentServiceMethods
7
+ private
8
+
9
+ def invoke_service_method(method_name, args: nil, timeout: 10, on_result: nil)
10
+ runtime_page&.invoke(self, method_name, args: args, timeout: timeout, on_result: on_result)
11
+ end
12
+
13
+ def service_args(values)
14
+ values.each_with_object({}) do |(key, value), result|
15
+ result[key.to_s] = service_value(value, key.to_s) unless value.nil?
16
+ end
17
+ end
18
+
19
+ def service_value(value, parent_key = nil)
20
+ if parent_key == "data" && byte_array?(value)
21
+ return value.pack("C*").b
22
+ end
23
+
24
+ case value
25
+ when Array
26
+ value.map { |item| service_value(item) }
27
+ when Hash
28
+ value.each_with_object({}) do |(key, item), result|
29
+ result[key.to_s] = service_value(item, key.to_s) unless item.nil?
30
+ end
31
+ when Symbol
32
+ value.to_s
33
+ else
34
+ value.respond_to?(:to_h) ? service_value(value.to_h) : value
35
+ end
36
+ end
37
+
38
+ def byte_array?(value)
39
+ value.is_a?(Array) && value.all? { |item| item.is_a?(Integer) && item.between?(0, 255) }
40
+ end
41
+ end
42
+
43
+ module NoArgumentServiceMethods
44
+ def define_no_argument_service_methods(*method_names)
45
+ method_names.each do |method_name|
46
+ define_method(method_name) do |timeout: 10, on_result: nil|
47
+ invoke_service_method(method_name, timeout: timeout, on_result: on_result)
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ components = RufletServicesComponents
54
+
55
+ [
56
+ [components::BatteryControl, %w[get_battery_level get_battery_state is_in_battery_save_mode]],
57
+ [components::ConnectivityControl, %w[get_connectivity]],
58
+ [components::FlashlightControl, %w[on off is_available]],
59
+ [components::HapticFeedbackControl, %w[heavy_impact light_impact medium_impact vibrate selection_click]],
60
+ [components::StoragePathsControl, %w[
61
+ get_application_cache_directory get_application_documents_directory
62
+ get_application_support_directory get_downloads_directory
63
+ get_external_cache_directories get_external_storage_directories
64
+ get_library_directory get_external_storage_directory
65
+ get_temporary_directory get_console_log_filename
66
+ ]],
67
+ [components::WakelockControl, %w[enable disable is_enabled]]
68
+ ].each do |klass, method_names|
69
+ klass.include(CurrentServiceMethods)
70
+ klass.extend(NoArgumentServiceMethods)
71
+ klass.define_no_argument_service_methods(*method_names)
72
+ end
73
+
74
+ class RufletServicesComponents::FilePickerControl
75
+ include CurrentServiceMethods
76
+
77
+ def upload(files, timeout: 10, on_result: nil)
78
+ invoke_service_method("upload", args: { "files" => service_value(files) }, timeout: timeout, on_result: on_result)
79
+ end
80
+
81
+ def get_directory_path(dialog_title: nil, initial_directory: nil, timeout: 10, on_result: nil)
82
+ invoke_service_method("get_directory_path", args: service_args(dialog_title: dialog_title, initial_directory: initial_directory), timeout: timeout, on_result: on_result)
83
+ end
84
+
85
+ def save_file(dialog_title: nil, file_name: nil, initial_directory: nil, file_type: :any,
86
+ allowed_extensions: nil, src_bytes: nil, timeout: 10, on_result: nil)
87
+ args = service_args(
88
+ dialog_title: dialog_title,
89
+ file_name: file_name,
90
+ initial_directory: initial_directory,
91
+ file_type: file_type,
92
+ allowed_extensions: allowed_extensions
93
+ )
94
+ args["src_bytes"] = src_bytes.pack("C*").b if byte_array?(src_bytes)
95
+ args["src_bytes"] = src_bytes unless src_bytes.nil? || byte_array?(src_bytes)
96
+ invoke_service_method("save_file", args: args, timeout: timeout, on_result: on_result)
97
+ end
98
+
99
+ def pick_files(dialog_title: nil, initial_directory: nil, file_type: :any,
100
+ allowed_extensions: nil, allow_multiple: false, with_data: false,
101
+ timeout: 10, on_result: nil)
102
+ invoke_service_method(
103
+ "pick_files",
104
+ args: service_args(
105
+ dialog_title: dialog_title,
106
+ initial_directory: initial_directory,
107
+ file_type: file_type,
108
+ allowed_extensions: allowed_extensions,
109
+ allow_multiple: allow_multiple,
110
+ with_data: with_data
111
+ ),
112
+ timeout: timeout,
113
+ on_result: on_result
114
+ )
115
+ end
116
+ end
117
+
118
+ class RufletServicesComponents::ScreenBrightnessControl
119
+ include CurrentServiceMethods
120
+
121
+ %w[
122
+ get_system_screen_brightness can_change_system_screen_brightness
123
+ get_application_screen_brightness reset_application_screen_brightness
124
+ is_animate is_auto_reset
125
+ ].each do |method_name|
126
+ define_method(method_name) do |timeout: 10, on_result: nil|
127
+ invoke_service_method(method_name, timeout: timeout, on_result: on_result)
128
+ end
129
+ end
130
+
131
+ def set_system_screen_brightness(brightness, timeout: 10, on_result: nil)
132
+ invoke_service_method("set_system_screen_brightness", args: { "brightness" => brightness }, timeout: timeout, on_result: on_result)
133
+ end
134
+
135
+ def set_application_screen_brightness(brightness, timeout: 10, on_result: nil)
136
+ invoke_service_method("set_application_screen_brightness", args: { "brightness" => brightness }, timeout: timeout, on_result: on_result)
137
+ end
138
+
139
+ def set_animate(animate, timeout: 10, on_result: nil)
140
+ invoke_service_method("set_animate", args: { "animate" => animate }, timeout: timeout, on_result: on_result)
141
+ end
142
+
143
+ def set_auto_reset(auto_reset, timeout: 10, on_result: nil)
144
+ invoke_service_method("set_auto_reset", args: { "auto_reset" => auto_reset }, timeout: timeout, on_result: on_result)
145
+ end
146
+ end
147
+
148
+ class RufletServicesComponents::ShareControl
149
+ include CurrentServiceMethods
150
+
151
+ def share_text(text, title: nil, subject: nil, preview_thumbnail: nil,
152
+ share_position_origin: nil, download_fallback_enabled: true,
153
+ mail_to_fallback_enabled: true, excluded_cupertino_activities: nil,
154
+ timeout: 10, on_result: nil)
155
+ invoke_service_method(
156
+ "share_text",
157
+ args: service_args(
158
+ text: text, title: title, subject: subject, preview_thumbnail: preview_thumbnail,
159
+ share_position_origin: share_position_origin,
160
+ download_fallback_enabled: download_fallback_enabled,
161
+ mail_to_fallback_enabled: mail_to_fallback_enabled,
162
+ excluded_cupertino_activities: excluded_cupertino_activities
163
+ ),
164
+ timeout: timeout,
165
+ on_result: on_result
166
+ )
167
+ end
168
+
169
+ def share_uri(uri, share_position_origin: nil, excluded_cupertino_activities: nil, timeout: 10, on_result: nil)
170
+ invoke_service_method("share_uri", args: service_args(uri: uri, share_position_origin: share_position_origin, excluded_cupertino_activities: excluded_cupertino_activities), timeout: timeout, on_result: on_result)
171
+ end
172
+
173
+ def share_files(files, title: nil, text: nil, subject: nil, preview_thumbnail: nil,
174
+ share_position_origin: nil, download_fallback_enabled: true,
175
+ mail_to_fallback_enabled: true, excluded_cupertino_activities: nil,
176
+ timeout: 10, on_result: nil)
177
+ invoke_service_method(
178
+ "share_files",
179
+ args: service_args(
180
+ files: files, title: title, text: text, subject: subject,
181
+ preview_thumbnail: preview_thumbnail, share_position_origin: share_position_origin,
182
+ download_fallback_enabled: download_fallback_enabled,
183
+ mail_to_fallback_enabled: mail_to_fallback_enabled,
184
+ excluded_cupertino_activities: excluded_cupertino_activities
185
+ ),
186
+ timeout: timeout,
187
+ on_result: on_result
188
+ )
189
+ end
190
+ end
191
+
192
+ class RufletServicesComponents::SharedPreferencesControl
193
+ include CurrentServiceMethods
194
+
195
+ def set(key, value, timeout: 10, on_result: nil) = invoke_service_method("set", args: { "key" => key, "value" => service_value(value) }, timeout: timeout, on_result: on_result)
196
+ def get(key, timeout: 10, on_result: nil) = invoke_service_method("get", args: { "key" => key }, timeout: timeout, on_result: on_result)
197
+ def contains_key(key, timeout: 10, on_result: nil) = invoke_service_method("contains_key", args: { "key" => key }, timeout: timeout, on_result: on_result)
198
+ def remove(key, timeout: 10, on_result: nil) = invoke_service_method("remove", args: { "key" => key }, timeout: timeout, on_result: on_result)
199
+ def get_keys(key_prefix, timeout: 10, on_result: nil) = invoke_service_method("get_keys", args: { "key_prefix" => key_prefix }, timeout: timeout, on_result: on_result)
200
+ def clear(timeout: 10, on_result: nil) = invoke_service_method("clear", timeout: timeout, on_result: on_result)
201
+ end
202
+
203
+ class RufletServicesComponents::UrlLauncherControl
204
+ include CurrentServiceMethods
205
+
206
+ def launch_url(url, mode: :platform_default, web_view_configuration: nil,
207
+ browser_configuration: nil, web_only_window_name: nil,
208
+ timeout: 10, on_result: nil)
209
+ invoke_service_method("launch_url", args: service_args(url: url, mode: mode, web_view_configuration: web_view_configuration, browser_configuration: browser_configuration, web_only_window_name: web_only_window_name), timeout: timeout, on_result: on_result)
210
+ end
211
+
212
+ def can_launch_url(url, timeout: 10, on_result: nil) = invoke_service_method("can_launch_url", args: { "url" => url.to_s }, timeout: timeout, on_result: on_result)
213
+ def close_in_app_web_view(timeout: 10, on_result: nil) = invoke_service_method("close_in_app_web_view", timeout: timeout, on_result: on_result)
214
+ def open_window(url, title: nil, width: nil, height: nil, timeout: 10, on_result: nil) = invoke_service_method("open_window", args: service_args(url: url, title: title, width: width, height: height), timeout: timeout, on_result: on_result)
215
+ def supports_launch_mode(mode, timeout: 10, on_result: nil) = invoke_service_method("supports_launch_mode", args: { "mode" => service_value(mode) }, timeout: timeout, on_result: on_result)
216
+ def supports_close_for_launch_mode(mode, timeout: 10, on_result: nil) = invoke_service_method("supports_close_for_launch_mode", args: { "mode" => service_value(mode) }, timeout: timeout, on_result: on_result)
217
+ end
218
+ end
219
+ end
220
+ end
@@ -18,6 +18,94 @@ module Ruflet
18
18
  end
19
19
  super(type: TYPE, id: id, **compact)
20
20
  end
21
+
22
+ %w[
23
+ get_available_cameras get_exposure_offset_step_size get_max_exposure_offset
24
+ get_max_zoom_level get_min_exposure_offset get_min_zoom_level
25
+ unlock_capture_orientation pause_preview resume_preview take_picture
26
+ prepare_for_video_recording start_video_recording pause_video_recording
27
+ resume_video_recording stop_video_recording supports_image_streaming
28
+ start_image_stream stop_image_stream
29
+ ].each do |method_name|
30
+ define_method(method_name) do |timeout: 10, on_result: nil|
31
+ invoke_camera(method_name, timeout: timeout, on_result: on_result)
32
+ end
33
+ end
34
+
35
+ # Ruby reserves #initialize for object construction, so the Flet
36
+ # Camera.initialize() operation is exposed as #initialize_camera.
37
+ def initialize_camera(description, resolution_preset, enable_audio: true, fps: nil,
38
+ video_bitrate: nil, audio_bitrate: nil,
39
+ image_format_group: nil, timeout: 10, on_result: nil)
40
+ invoke_camera(
41
+ "initialize",
42
+ args: compact_args(
43
+ description: description,
44
+ resolution_preset: resolution_preset,
45
+ enable_audio: enable_audio,
46
+ fps: fps,
47
+ video_bitrate: video_bitrate,
48
+ audio_bitrate: audio_bitrate,
49
+ image_format_group: image_format_group
50
+ ),
51
+ timeout: timeout,
52
+ on_result: on_result
53
+ )
54
+ end
55
+
56
+ def lock_capture_orientation(orientation = nil, timeout: 10, on_result: nil)
57
+ invoke_camera(
58
+ "lock_capture_orientation",
59
+ args: { "orientation" => normalize_value(orientation) },
60
+ timeout: timeout,
61
+ on_result: on_result
62
+ )
63
+ end
64
+
65
+ {
66
+ set_description: :description,
67
+ set_exposure_mode: :mode,
68
+ set_exposure_offset: :offset,
69
+ set_exposure_point: :point,
70
+ set_flash_mode: :mode,
71
+ set_focus_mode: :mode,
72
+ set_focus_point: :point,
73
+ set_zoom_level: :zoom
74
+ }.each do |method_name, argument_name|
75
+ define_method(method_name) do |value, timeout: 10, on_result: nil|
76
+ invoke_camera(
77
+ method_name.to_s,
78
+ args: { argument_name.to_s => normalize_value(value) },
79
+ timeout: timeout,
80
+ on_result: on_result
81
+ )
82
+ end
83
+ end
84
+
85
+ private
86
+
87
+ def invoke_camera(method_name, args: nil, timeout:, on_result:)
88
+ runtime_page&.invoke(self, method_name, args: args, timeout: timeout, on_result: on_result)
89
+ end
90
+
91
+ def compact_args(values)
92
+ values.each_with_object({}) do |(key, value), result|
93
+ result[key.to_s] = normalize_value(value) unless value.nil?
94
+ end
95
+ end
96
+
97
+ def normalize_value(value)
98
+ case value
99
+ when Array
100
+ value.map { |item| normalize_value(item) }
101
+ when Hash
102
+ value.each_with_object({}) { |(key, item), result| result[key.to_s] = normalize_value(item) }
103
+ when Symbol
104
+ value.to_s
105
+ else
106
+ value.respond_to?(:to_h) ? normalize_value(value.to_h) : value
107
+ end
108
+ end
21
109
  end
22
110
  end
23
111
  end
@@ -4,6 +4,7 @@ require_relative "ruflet/accelerometer_control"
4
4
  require_relative "ruflet/audio_recorder_control"
5
5
  require_relative "ruflet/barometer_control"
6
6
  require_relative "ruflet/battery_control"
7
+ require_relative "../controls/shared/browsercontextmenu_control"
7
8
  require_relative "ruflet/camera_control"
8
9
  require_relative "ruflet/clipboard_control"
9
10
  require_relative "ruflet/connectivity_control"
@@ -24,6 +25,7 @@ require_relative "ruflet/storagepaths_control"
24
25
  require_relative "ruflet/urllauncher_control"
25
26
  require_relative "ruflet/useraccelerometer_control"
26
27
  require_relative "ruflet/wakelock_control"
28
+ require_relative "current_service_methods"
27
29
 
28
30
  module Ruflet
29
31
  module UI
@@ -37,6 +39,8 @@ module Ruflet
37
39
  "audiorecorder" => RufletServicesComponents::AudioRecorderControl,
38
40
  "barometer" => RufletServicesComponents::BarometerControl,
39
41
  "battery" => RufletServicesComponents::BatteryControl,
42
+ "browser_context_menu" => Ruflet::UI::Controls::RufletComponents::BrowserContextMenuControl,
43
+ "browsercontextmenu" => Ruflet::UI::Controls::RufletComponents::BrowserContextMenuControl,
40
44
  "camera" => RufletServicesComponents::CameraControl,
41
45
  "clipboard" => RufletServicesComponents::ClipboardControl,
42
46
  "connectivity" => RufletServicesComponents::ConnectivityControl,
@@ -6,6 +6,15 @@ module Ruflet
6
6
  def control(type, **props, &block) = control_delegate.control(type, **props, &block)
7
7
  def widget(type, **props, &block) = control_delegate.widget(type, **props, &block)
8
8
  def service(type, **props, &block) = control_delegate.service(type, **props, &block)
9
+ def base_page(**props, &block) = control_delegate.base_page(**props, &block)
10
+ def basepage(**props, &block) = control_delegate.basepage(**props, &block)
11
+ def dialogs(controls = nil, **props) = control_delegate.dialogs(controls, **props)
12
+ def pagelet(content = nil, **props, &block) = control_delegate.pagelet(content, **props, &block)
13
+ def ruflet_app(**props) = control_delegate.ruflet_app(**props)
14
+ def rufletapp(**props) = control_delegate.rufletapp(**props)
15
+ def service_registry(services = nil, **props) = control_delegate.service_registry(services, **props)
16
+ def serviceregistry(services = nil, **props) = control_delegate.serviceregistry(services, **props)
17
+ def window(**props) = control_delegate.window(**props)
9
18
  def view(children = nil, **props, &block)
10
19
  mapped = props.dup
11
20
  mapped[:controls] = children unless children.nil?
@@ -22,7 +31,31 @@ module Ruflet
22
31
  def animatedswitcher(content = nil, **props) = control_delegate.animatedswitcher(content, **props)
23
32
  def animation(duration = nil, **props) = control_delegate.animation(duration, **props)
24
33
  def animation_style(**props) = control_delegate.animation_style(**props)
34
+ def accelerometer(**props) = control_delegate.accelerometer(**props)
25
35
  def audio(**props) = control_delegate.audio(**props)
36
+ def audio_recorder(**props) = control_delegate.audio_recorder(**props)
37
+ def barometer(**props) = control_delegate.barometer(**props)
38
+ def battery(**props) = control_delegate.battery(**props)
39
+ def browser_context_menu(**props) = control_delegate.browser_context_menu(**props)
40
+ def camera(**props) = control_delegate.camera(**props)
41
+ def connectivity(**props) = control_delegate.connectivity(**props)
42
+ def file_picker(**props) = control_delegate.file_picker(**props)
43
+ def flashlight(**props) = control_delegate.flashlight(**props)
44
+ def geolocator(**props) = control_delegate.geolocator(**props)
45
+ def gyroscope(**props) = control_delegate.gyroscope(**props)
46
+ def haptic_feedback(**props) = control_delegate.haptic_feedback(**props)
47
+ def magnetometer(**props) = control_delegate.magnetometer(**props)
48
+ def permission_handler(**props) = control_delegate.permission_handler(**props)
49
+ def screen_brightness(**props) = control_delegate.screen_brightness(**props)
50
+ def secure_storage(**props) = control_delegate.secure_storage(**props)
51
+ def semantics_service(**props) = control_delegate.semantics_service(**props)
52
+ def shake_detector(**props) = control_delegate.shake_detector(**props)
53
+ def share(**props) = control_delegate.share(**props)
54
+ def shared_preferences(**props) = control_delegate.shared_preferences(**props)
55
+ def storage_paths(**props) = control_delegate.storage_paths(**props)
56
+ def url_launcher(**props) = control_delegate.url_launcher(**props)
57
+ def user_accelerometer(**props) = control_delegate.user_accelerometer(**props)
58
+ def wakelock(**props) = control_delegate.wakelock(**props)
26
59
  def auto_complete(suggestions = nil, **props) = control_delegate.auto_complete(suggestions, **props)
27
60
  def autocomplete(suggestions = nil, **props) = control_delegate.autocomplete(suggestions, **props)
28
61
  def auto_complete_suggestion(key = nil, **props) = control_delegate.auto_complete_suggestion(key, **props)
@@ -30,6 +63,8 @@ module Ruflet
30
63
  def autocompletesuggestion(key = nil, **props) = control_delegate.autocompletesuggestion(key, **props)
31
64
  def context_menu(content = nil, **props) = control_delegate.context_menu(content, **props)
32
65
  def contextmenu(content = nil, **props) = control_delegate.contextmenu(content, **props)
66
+ def context_menu_action(content = nil, **props) = control_delegate.context_menu_action(content, **props)
67
+ def contextmenuaction(content = nil, **props) = control_delegate.contextmenuaction(content, **props)
33
68
  def autofill_group(content = nil, **props) = control_delegate.autofill_group(content, **props)
34
69
  def autofillgroup(content = nil, **props) = control_delegate.autofillgroup(content, **props)
35
70
  def hero(content = nil, **props) = control_delegate.hero(content, **props)
@@ -93,6 +128,14 @@ module Ruflet
93
128
  def polygonmarker(**props) = control_delegate.polygonmarker(**props)
94
129
  def simple_attribution(**props) = control_delegate.simple_attribution(**props)
95
130
  def simpleattribution(**props) = control_delegate.simpleattribution(**props)
131
+ def map_layer(**props) = control_delegate.map_layer(**props)
132
+ def maplayer(**props) = control_delegate.maplayer(**props)
133
+ def rich_attribution(attributions = nil, **props) = control_delegate.rich_attribution(attributions, **props)
134
+ def richattribution(attributions = nil, **props) = control_delegate.richattribution(attributions, **props)
135
+ def image_source_attribution(image = nil, **props) = control_delegate.image_source_attribution(image, **props)
136
+ def imagesourceattribution(image = nil, **props) = control_delegate.imagesourceattribution(image, **props)
137
+ def text_source_attribution(text = nil, **props) = control_delegate.text_source_attribution(text, **props)
138
+ def textsourceattribution(text = nil, **props) = control_delegate.textsourceattribution(text, **props)
96
139
  def list_view(children = nil, **props) = control_delegate.list_view(children, **props)
97
140
  def listview(children = nil, **props) = control_delegate.listview(children, **props)
98
141
  def menu_bar(children = nil, **props) = control_delegate.menu_bar(children, **props)
@@ -120,6 +163,13 @@ module Ruflet
120
163
  def datarow(cells = nil, **props) = control_delegate.datarow(cells, **props)
121
164
  def data_cell(content = nil, **props) = control_delegate.data_cell(content, **props)
122
165
  def datacell(content = nil, **props) = control_delegate.datacell(content, **props)
166
+ def option(key = nil, **props) = control_delegate.option(key, **props)
167
+ def data_table2(columns = nil, **props) = control_delegate.data_table2(columns, **props)
168
+ def datatable2(columns = nil, **props) = control_delegate.datatable2(columns, **props)
169
+ def data_column2(label = nil, **props) = control_delegate.data_column2(label, **props)
170
+ def datacolumn2(label = nil, **props) = control_delegate.datacolumn2(label, **props)
171
+ def data_row2(cells = nil, **props) = control_delegate.data_row2(cells, **props)
172
+ def datarow2(cells = nil, **props) = control_delegate.datarow2(cells, **props)
123
173
  def expansion_tile(children = nil, **props) = control_delegate.expansion_tile(children, **props)
124
174
  def expansiontile(children = nil, **props) = control_delegate.expansiontile(children, **props)
125
175
  def expansion_panel(**props) = control_delegate.expansion_panel(**props)
@@ -138,6 +188,9 @@ module Ruflet
138
188
  def pageview(children = nil, **props) = control_delegate.pageview(children, **props)
139
189
  def progress_ring(**props) = control_delegate.progress_ring(**props)
140
190
  def progressring(**props) = control_delegate.progressring(**props)
191
+ def picker(children = nil, **props) = control_delegate.picker(children, **props)
192
+ def timer_picker(**props) = control_delegate.timer_picker(**props)
193
+ def timerpicker(**props) = control_delegate.timerpicker(**props)
141
194
  def spinkit(**props) = control_delegate.spinkit(**props)
142
195
  def range_slider(**props) = control_delegate.range_slider(**props)
143
196
  def rangeslider(**props) = control_delegate.rangeslider(**props)
@@ -210,6 +263,10 @@ module Ruflet
210
263
  def snackbaraction(label = nil, **props) = control_delegate.snackbaraction(label, **props)
211
264
  def bottom_sheet(content = nil, **props) = control_delegate.bottom_sheet(content, **props)
212
265
  def bottomsheet(content = nil, **props) = control_delegate.bottomsheet(content, **props)
266
+ def action_sheet(**props) = control_delegate.action_sheet(**props)
267
+ def actionsheet(**props) = control_delegate.actionsheet(**props)
268
+ def action_sheet_action(content = nil, **props) = control_delegate.action_sheet_action(content, **props)
269
+ def actionsheetaction(content = nil, **props) = control_delegate.actionsheetaction(content, **props)
213
270
  def markdown(value = nil, **props) = control_delegate.markdown(value, **props)
214
271
  def icon(icon = nil, **props) = control_delegate.icon(icon, **props)
215
272
  def image(src = nil, **props) = control_delegate.image(src, **props)
@@ -280,6 +337,24 @@ module Ruflet
280
337
  def web_view(**props) = control_delegate.web_view(**props)
281
338
  def webview(**props) = control_delegate.webview(**props)
282
339
  def video(**props) = control_delegate.video(**props)
340
+ def block_picker(**props) = control_delegate.block_picker(**props)
341
+ def blockpicker(**props) = control_delegate.blockpicker(**props)
342
+ def color_picker(**props) = control_delegate.color_picker(**props)
343
+ def colorpicker(**props) = control_delegate.colorpicker(**props)
344
+ def hue_ring_picker(**props) = control_delegate.hue_ring_picker(**props)
345
+ def hueringpicker(**props) = control_delegate.hueringpicker(**props)
346
+ def material_picker(**props) = control_delegate.material_picker(**props)
347
+ def materialpicker(**props) = control_delegate.materialpicker(**props)
348
+ def multiple_choice_block_picker(**props) = control_delegate.multiple_choice_block_picker(**props)
349
+ def multiplechoiceblockpicker(**props) = control_delegate.multiplechoiceblockpicker(**props)
350
+ def slide_picker(**props) = control_delegate.slide_picker(**props)
351
+ def slidepicker(**props) = control_delegate.slidepicker(**props)
352
+ def banner_ad(**props) = control_delegate.banner_ad(**props)
353
+ def bannerad(**props) = control_delegate.bannerad(**props)
354
+ def interstitial_ad(**props) = control_delegate.interstitial_ad(**props)
355
+ def interstitialad(**props) = control_delegate.interstitialad(**props)
356
+ def native_ad(**props) = control_delegate.native_ad(**props)
357
+ def nativead(**props) = control_delegate.nativead(**props)
283
358
  def code_editor(value = nil, **props) = control_delegate.code_editor(value, **props)
284
359
  def codeeditor(value = nil, **props) = control_delegate.codeeditor(value, **props)
285
360
  def lottie(src = nil, **props) = control_delegate.lottie(src, **props)
data/lib/ruflet_ui.rb CHANGED
@@ -90,9 +90,8 @@ module Ruflet
90
90
  end
91
91
 
92
92
  def const_missing(name)
93
- return @icon_module.const_get(name) if @icon_module.const_defined?(name, false)
94
-
95
- super
93
+ resolved = @icon_module.resolve_constant(name)
94
+ resolved.nil? ? super : resolved
96
95
  end
97
96
  end
98
97
 
@@ -106,13 +105,11 @@ module Ruflet
106
105
  end
107
106
 
108
107
  def const_missing(name)
109
- if Ruflet::MaterialIcons.const_defined?(name, false)
110
- return Ruflet::MaterialIcons.const_get(name)
111
- end
108
+ resolved = Ruflet::MaterialIcons.resolve_constant(name)
109
+ return resolved unless resolved.nil?
112
110
 
113
- if Ruflet::CupertinoIcons.const_defined?(name, false)
114
- return Ruflet::CupertinoIcons.const_get(name)
115
- end
111
+ resolved = Ruflet::CupertinoIcons.resolve_constant(name)
112
+ return resolved unless resolved.nil?
116
113
 
117
114
  super
118
115
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruflet_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - AdamMusa
@@ -70,7 +70,9 @@ files:
70
70
  - lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb
71
71
  - lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb
72
72
  - lib/ruflet_ui/ruflet/ui/controls/cupertinos/ruflet_controls.rb
73
+ - lib/ruflet_ui/ruflet/ui/controls/materials/ad_controls.rb
73
74
  - lib/ruflet_ui/ruflet/ui/controls/materials/alertdialog_control.rb
75
+ - lib/ruflet_ui/ruflet/ui/controls/materials/animation_extension_controls.rb
74
76
  - lib/ruflet_ui/ruflet/ui/controls/materials/appbar_control.rb
75
77
  - lib/ruflet_ui/ruflet/ui/controls/materials/audio_control.rb
76
78
  - lib/ruflet_ui/ruflet/ui/controls/materials/autocomplete_control.rb
@@ -85,11 +87,14 @@ files:
85
87
  - lib/ruflet_ui/ruflet/ui/controls/materials/checkbox_control.rb
86
88
  - lib/ruflet_ui/ruflet/ui/controls/materials/chip_control.rb
87
89
  - lib/ruflet_ui/ruflet/ui/controls/materials/circleavatar_control.rb
90
+ - lib/ruflet_ui/ruflet/ui/controls/materials/code_editor_control.rb
91
+ - lib/ruflet_ui/ruflet/ui/controls/materials/color_picker_controls.rb
88
92
  - lib/ruflet_ui/ruflet/ui/controls/materials/container_control.rb
89
93
  - lib/ruflet_ui/ruflet/ui/controls/materials/contextmenu_control.rb
90
94
  - lib/ruflet_ui/ruflet/ui/controls/materials/datacell_control.rb
91
95
  - lib/ruflet_ui/ruflet/ui/controls/materials/datacolumn_control.rb
92
96
  - lib/ruflet_ui/ruflet/ui/controls/materials/datarow_control.rb
97
+ - lib/ruflet_ui/ruflet/ui/controls/materials/datatable2_controls.rb
93
98
  - lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb
94
99
  - lib/ruflet_ui/ruflet/ui/controls/materials/datepicker_control.rb
95
100
  - lib/ruflet_ui/ruflet/ui/controls/materials/daterangepicker_control.rb
@@ -209,6 +214,9 @@ files:
209
214
  - lib/ruflet_ui/ruflet/ui/material_control_factory.rb
210
215
  - lib/ruflet_ui/ruflet/ui/material_control_methods.rb
211
216
  - lib/ruflet_ui/ruflet/ui/material_control_registry.rb
217
+ - lib/ruflet_ui/ruflet/ui/platform_control_contracts.rb
218
+ - lib/ruflet_ui/ruflet/ui/platform_control_methods.rb
219
+ - lib/ruflet_ui/ruflet/ui/services/current_service_methods.rb
212
220
  - lib/ruflet_ui/ruflet/ui/services/ruflet/accelerometer_control.rb
213
221
  - lib/ruflet_ui/ruflet/ui/services/ruflet/audio_recorder_control.rb
214
222
  - lib/ruflet_ui/ruflet/ui/services/ruflet/barometer_control.rb