ruflet_core 0.0.21 → 0.0.22

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 (58) 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/page.rb +242 -4
  7. data/lib/ruflet_ui/ruflet/ui/control_factory.rb +2 -0
  8. data/lib/ruflet_ui/ruflet/ui/control_methods.rb +4 -0
  9. data/lib/ruflet_ui/ruflet/ui/control_registry.rb +20 -1
  10. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +1 -1
  11. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +1 -1
  12. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +1 -1
  13. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +1 -1
  14. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoappbar_control.rb +1 -1
  15. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobottomsheet_control.rb +1 -1
  16. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +1 -1
  17. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +1 -1
  18. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +1 -1
  19. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +1 -1
  20. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +1 -1
  21. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +1 -1
  22. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +1 -1
  23. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +1 -1
  24. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +1 -1
  25. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +1 -1
  26. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +1 -1
  27. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +1 -1
  28. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +1 -1
  29. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +1 -1
  30. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +1 -1
  31. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +1 -1
  32. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +1 -1
  33. data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +1 -1
  34. data/lib/ruflet_ui/ruflet/ui/controls/materials/ad_controls.rb +45 -0
  35. data/lib/ruflet_ui/ruflet/ui/controls/materials/animation_extension_controls.rb +29 -0
  36. data/lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb +56 -279
  37. data/lib/ruflet_ui/ruflet/ui/controls/materials/code_editor_control.rb +42 -0
  38. data/lib/ruflet_ui/ruflet/ui/controls/materials/color_picker_controls.rb +34 -0
  39. data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable2_controls.rb +41 -0
  40. data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownm2_control.rb +1 -1
  41. data/lib/ruflet_ui/ruflet/ui/controls/materials/map_control.rb +80 -0
  42. data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +62 -0
  43. data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +1 -2
  44. data/lib/ruflet_ui/ruflet/ui/controls/materials/webview_control.rb +5 -30
  45. data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +60 -0
  46. data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +17 -0
  47. data/lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_app_control.rb +3 -3
  48. data/lib/ruflet_ui/ruflet/ui/controls/shared/serviceregistry_control.rb +5 -1
  49. data/lib/ruflet_ui/ruflet/ui/cupertino_control_methods.rb +2 -0
  50. data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +110 -6
  51. data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +23 -8
  52. data/lib/ruflet_ui/ruflet/ui/platform_control_contracts.rb +392 -0
  53. data/lib/ruflet_ui/ruflet/ui/platform_control_methods.rb +35 -0
  54. data/lib/ruflet_ui/ruflet/ui/services/current_service_methods.rb +220 -0
  55. data/lib/ruflet_ui/ruflet/ui/services/ruflet/camera_control.rb +88 -0
  56. data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +4 -0
  57. data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +75 -0
  58. metadata +9 -1
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "alertdialog_control"
4
+ require_relative "ad_controls"
5
+ require_relative "animation_extension_controls"
4
6
  require_relative "audio_control"
5
7
  require_relative "appbar_control"
6
8
  require_relative "autocomplete_control"
@@ -15,12 +17,15 @@ require_relative "card_control"
15
17
  require_relative "checkbox_control"
16
18
  require_relative "chip_control"
17
19
  require_relative "circleavatar_control"
20
+ require_relative "code_editor_control"
21
+ require_relative "color_picker_controls"
18
22
  require_relative "container_control"
19
23
  require_relative "contextmenu_control"
20
24
  require_relative "datacell_control"
21
25
  require_relative "datacolumn_control"
22
26
  require_relative "datarow_control"
23
27
  require_relative "datatable_control"
28
+ require_relative "datatable2_controls"
24
29
  require_relative "datepicker_control"
25
30
  require_relative "daterangepicker_control"
26
31
  require_relative "divider_control"
@@ -37,6 +42,7 @@ require_relative "filledtonaliconbutton_control"
37
42
  require_relative "floatingactionbutton_control"
38
43
  require_relative "iconbutton_control"
39
44
  require_relative "listtile_control"
45
+ require_relative "map_control"
40
46
  require_relative "menubar_control"
41
47
  require_relative "menuitembutton_control"
42
48
  require_relative "navigationbar_control"
@@ -84,6 +90,8 @@ module Ruflet
84
90
  module_function
85
91
 
86
92
  CLASS_MAP = {
93
+ "banner_ad" => RufletComponents::BannerAdControl,
94
+ "bannerad" => RufletComponents::BannerAdControl,
87
95
  "alert_dialog" => RufletComponents::AlertDialogControl,
88
96
  "alertdialog" => RufletComponents::AlertDialogControl,
89
97
  "audio" => RufletComponents::AudioControl,
@@ -121,6 +129,12 @@ module Ruflet
121
129
  "chip" => RufletComponents::ChipControl,
122
130
  "circle_avatar" => RufletComponents::CircleAvatarControl,
123
131
  "circleavatar" => RufletComponents::CircleAvatarControl,
132
+ "code_editor" => RufletComponents::CodeEditorControl,
133
+ "codeeditor" => RufletComponents::CodeEditorControl,
134
+ "block_picker" => RufletComponents::BlockPickerControl,
135
+ "blockpicker" => RufletComponents::BlockPickerControl,
136
+ "color_picker" => RufletComponents::ColorPickerControl,
137
+ "colorpicker" => RufletComponents::ColorPickerControl,
124
138
  "container" => RufletComponents::ContainerControl,
125
139
  "context_menu" => RufletComponents::ContextMenuControl,
126
140
  "contextmenu" => RufletComponents::ContextMenuControl,
@@ -128,6 +142,12 @@ module Ruflet
128
142
  "data_column" => RufletComponents::DataColumnControl,
129
143
  "data_row" => RufletComponents::DataRowControl,
130
144
  "data_table" => RufletComponents::DataTableControl,
145
+ "data_column2" => RufletComponents::DataColumn2Control,
146
+ "datacolumn2" => RufletComponents::DataColumn2Control,
147
+ "data_row2" => RufletComponents::DataRow2Control,
148
+ "datarow2" => RufletComponents::DataRow2Control,
149
+ "data_table2" => RufletComponents::DataTable2Control,
150
+ "datatable2" => RufletComponents::DataTable2Control,
131
151
  "datacell" => RufletComponents::DataCellControl,
132
152
  "datacolumn" => RufletComponents::DataColumnControl,
133
153
  "datarow" => RufletComponents::DataRowControl,
@@ -159,6 +179,11 @@ module Ruflet
159
179
  "floating_action_button" => RufletComponents::FloatingActionButtonControl,
160
180
  "floatingactionbutton" => RufletComponents::FloatingActionButtonControl,
161
181
  "icon_button" => RufletComponents::IconButtonControl,
182
+ "hue_ring_picker" => RufletComponents::HueRingPickerControl,
183
+ "hueringpicker" => RufletComponents::HueRingPickerControl,
184
+ "interstitial_ad" => RufletComponents::InterstitialAdControl,
185
+ "interstitialad" => RufletComponents::InterstitialAdControl,
186
+ "lottie" => RufletComponents::LottieControl,
162
187
  "iconbutton" => RufletComponents::IconButtonControl,
163
188
  "line_chart" => RufletComponents::LineChartControl,
164
189
  "line_chart_data" => RufletComponents::LineChartDataControl,
@@ -168,8 +193,40 @@ module Ruflet
168
193
  "linechartdatapoint" => RufletComponents::LineChartDataPointControl,
169
194
  "list_tile" => RufletComponents::ListTileControl,
170
195
  "listtile" => RufletComponents::ListTileControl,
196
+ "map" => RufletComponents::MapControl,
197
+ "map_layer" => RufletComponents::MapLayerControl,
198
+ "maplayer" => RufletComponents::MapLayerControl,
199
+ "tile_layer" => RufletComponents::TileLayerControl,
200
+ "tilelayer" => RufletComponents::TileLayerControl,
201
+ "marker" => RufletComponents::MarkerControl,
202
+ "marker_layer" => RufletComponents::MarkerLayerControl,
203
+ "markerlayer" => RufletComponents::MarkerLayerControl,
204
+ "circle_marker" => RufletComponents::CircleMarkerControl,
205
+ "circlemarker" => RufletComponents::CircleMarkerControl,
206
+ "circle_layer" => RufletComponents::CircleLayerControl,
207
+ "circlelayer" => RufletComponents::CircleLayerControl,
208
+ "polyline_marker" => RufletComponents::PolylineMarkerControl,
209
+ "polylinemarker" => RufletComponents::PolylineMarkerControl,
210
+ "polyline_layer" => RufletComponents::PolylineLayerControl,
211
+ "polylinelayer" => RufletComponents::PolylineLayerControl,
212
+ "polygon_marker" => RufletComponents::PolygonMarkerControl,
213
+ "polygonmarker" => RufletComponents::PolygonMarkerControl,
214
+ "polygon_layer" => RufletComponents::PolygonLayerControl,
215
+ "polygonlayer" => RufletComponents::PolygonLayerControl,
216
+ "simple_attribution" => RufletComponents::SimpleAttributionControl,
217
+ "simpleattribution" => RufletComponents::SimpleAttributionControl,
218
+ "rich_attribution" => RufletComponents::RichAttributionControl,
219
+ "richattribution" => RufletComponents::RichAttributionControl,
220
+ "image_source_attribution" => RufletComponents::ImageSourceAttributionControl,
221
+ "imagesourceattribution" => RufletComponents::ImageSourceAttributionControl,
222
+ "text_source_attribution" => RufletComponents::TextSourceAttributionControl,
223
+ "textsourceattribution" => RufletComponents::TextSourceAttributionControl,
171
224
  "menu_bar" => RufletComponents::MenuBarControl,
172
225
  "menu_item_button" => RufletComponents::MenuItemButtonControl,
226
+ "material_picker" => RufletComponents::MaterialPickerControl,
227
+ "materialpicker" => RufletComponents::MaterialPickerControl,
228
+ "multiple_choice_block_picker" => RufletComponents::MultipleChoiceBlockPickerControl,
229
+ "multiplechoiceblockpicker" => RufletComponents::MultipleChoiceBlockPickerControl,
173
230
  "menubar" => RufletComponents::MenuBarControl,
174
231
  "menuitembutton" => RufletComponents::MenuItemButtonControl,
175
232
  "navigation_bar" => RufletComponents::NavigationBarControl,
@@ -178,6 +235,8 @@ module Ruflet
178
235
  "navigation_drawer_destination" => RufletComponents::NavigationDrawerDestinationControl,
179
236
  "navigation_rail" => RufletComponents::NavigationRailControl,
180
237
  "navigation_rail_destination" => RufletComponents::NavigationRailDestinationControl,
238
+ "native_ad" => RufletComponents::NativeAdControl,
239
+ "nativead" => RufletComponents::NativeAdControl,
181
240
  "navigationbar" => RufletComponents::NavigationBarControl,
182
241
  "navigationbardestination" => RufletComponents::NavigationBarDestinationControl,
183
242
  "navigationdrawer" => RufletComponents::NavigationDrawerControl,
@@ -204,6 +263,7 @@ module Ruflet
204
263
  "spinkit" => RufletComponents::SpinkitControl,
205
264
  "radio" => RufletComponents::RadioControl,
206
265
  "radio_group" => RufletComponents::RadioGroupControl,
266
+ "rive" => RufletComponents::RiveControl,
207
267
  "radiogroup" => RufletComponents::RadioGroupControl,
208
268
  "radar_chart" => RufletComponents::RadarChartControl,
209
269
  "radar_chart_title" => RufletComponents::RadarChartTitleControl,
@@ -229,6 +289,8 @@ module Ruflet
229
289
  "scatterchart" => RufletComponents::ScatterChartControl,
230
290
  "scatterchartspot" => RufletComponents::ScatterChartSpotControl,
231
291
  "slider" => RufletComponents::SliderControl,
292
+ "slide_picker" => RufletComponents::SlidePickerControl,
293
+ "slidepicker" => RufletComponents::SlidePickerControl,
232
294
  "snack_bar" => RufletComponents::SnackBarControl,
233
295
  "snack_bar_action" => RufletComponents::SnackBarActionControl,
234
296
  "snackbaraction" => RufletComponents::SnackBarActionControl,
@@ -8,12 +8,11 @@ module Ruflet
8
8
  TYPE = "video".freeze
9
9
  WIRE = "Video".freeze
10
10
 
11
- KEYWORDS = [:alignment, :aspect_ratio, :autoplay, :configuration, :data, :fill_color, :filter_quality, :fit, :fullscreen, :height, :key, :muted, :opacity, :pause_upon_entering_background_mode, :pitch, :playlist, :playlist_mode, :playback_rate, :resume_upon_entering_foreground_mode, :rtl, :show_controls, :shuffle_playlist, :subtitle_configuration, :title, :tooltip, :visible, :volume, :wakelock, :width, :on_completed, :on_complete, :on_enter_fullscreen, :on_error, :on_exit_fullscreen, :on_load, :on_loaded, :on_state_change, :on_track_change, :on_track_changed].freeze
11
+ KEYWORDS = [].freeze
12
12
 
13
13
  def initialize(id: nil, **props)
14
14
  compact = {}
15
15
  props.each do |key, value|
16
- raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
17
16
  compact[key] = value unless value.nil?
18
17
  end
19
18
  super(type: TYPE, id: id, **compact)
@@ -23,37 +23,12 @@ module Ruflet
23
23
  class WebViewControl < Ruflet::Control
24
24
  TYPE = "WebView".freeze
25
25
  WIRE = "WebView".freeze
26
+ KEYWORDS = [].freeze
26
27
 
27
- def initialize(id: nil, bgcolor: nil, data: nil, enable_javascript: nil, expand: nil,
28
- height: nil, key: nil, method: nil, opacity: nil, prevent_links: nil,
29
- rtl: nil, tooltip: nil, url: nil, visible: nil, width: nil,
30
- on_page_ended: nil, on_page_started: nil, on_web_resource_error: nil,
31
- on_progress: nil, on_url_change: nil, on_scroll: nil,
32
- on_console_message: nil, on_javascript_alert_dialog: nil)
33
- props = {}
34
- props[:bgcolor] = bgcolor unless bgcolor.nil?
35
- props[:data] = data unless data.nil?
36
- props[:enable_javascript] = enable_javascript unless enable_javascript.nil?
37
- props[:expand] = expand unless expand.nil?
38
- props[:height] = height unless height.nil?
39
- props[:key] = key unless key.nil?
40
- props[:method] = method unless method.nil?
41
- props[:opacity] = opacity unless opacity.nil?
42
- props[:prevent_links] = prevent_links unless prevent_links.nil?
43
- props[:rtl] = rtl unless rtl.nil?
44
- props[:tooltip] = tooltip unless tooltip.nil?
45
- props[:url] = url unless url.nil?
46
- props[:visible] = visible unless visible.nil?
47
- props[:width] = width unless width.nil?
48
- props[:on_page_ended] = on_page_ended unless on_page_ended.nil?
49
- props[:on_page_started] = on_page_started unless on_page_started.nil?
50
- props[:on_web_resource_error] = on_web_resource_error unless on_web_resource_error.nil?
51
- props[:on_progress] = on_progress unless on_progress.nil?
52
- props[:on_url_change] = on_url_change unless on_url_change.nil?
53
- props[:on_scroll] = on_scroll unless on_scroll.nil?
54
- props[:on_console_message] = on_console_message unless on_console_message.nil?
55
- props[:on_javascript_alert_dialog] = on_javascript_alert_dialog unless on_javascript_alert_dialog.nil?
56
- super(type: TYPE, id: id, **props)
28
+ def initialize(id: nil, **props)
29
+ compact = {}
30
+ props.each { |key, value| compact[key] = value unless value.nil? }
31
+ super(type: TYPE, id: id, **compact)
57
32
  end
58
33
 
59
34
  # --- Navigation --------------------------------------------------
@@ -25,6 +25,8 @@ require_relative "cupertinos/cupertinotextfield_control"
25
25
  require_relative "cupertinos/cupertinotimerpicker_control"
26
26
  require_relative "cupertinos/cupertinotintedbutton_control"
27
27
  require_relative "materials/alertdialog_control"
28
+ require_relative "materials/ad_controls"
29
+ require_relative "materials/animation_extension_controls"
28
30
  require_relative "materials/audio_control"
29
31
  require_relative "materials/appbar_control"
30
32
  require_relative "materials/autocomplete_control"
@@ -39,12 +41,15 @@ require_relative "materials/card_control"
39
41
  require_relative "materials/checkbox_control"
40
42
  require_relative "materials/chip_control"
41
43
  require_relative "materials/circleavatar_control"
44
+ require_relative "materials/code_editor_control"
45
+ require_relative "materials/color_picker_controls"
42
46
  require_relative "materials/container_control"
43
47
  require_relative "materials/contextmenu_control"
44
48
  require_relative "materials/datacell_control"
45
49
  require_relative "materials/datacolumn_control"
46
50
  require_relative "materials/datarow_control"
47
51
  require_relative "materials/datatable_control"
52
+ require_relative "materials/datatable2_controls"
48
53
  require_relative "materials/datepicker_control"
49
54
  require_relative "materials/daterangepicker_control"
50
55
  require_relative "materials/divider_control"
@@ -162,6 +167,8 @@ module Ruflet
162
167
  module_function
163
168
 
164
169
  CLASS_MAP = {
170
+ "banner_ad" => RufletComponents::BannerAdControl,
171
+ "bannerad" => RufletComponents::BannerAdControl,
165
172
  "alert_dialog" => RufletComponents::AlertDialogControl,
166
173
  "alertdialog" => RufletComponents::AlertDialogControl,
167
174
  "audio" => RufletComponents::AudioControl,
@@ -210,6 +217,12 @@ module Ruflet
210
217
  "circle" => RufletComponents::CircleControl,
211
218
  "circle_avatar" => RufletComponents::CircleAvatarControl,
212
219
  "circleavatar" => RufletComponents::CircleAvatarControl,
220
+ "code_editor" => RufletComponents::CodeEditorControl,
221
+ "codeeditor" => RufletComponents::CodeEditorControl,
222
+ "block_picker" => RufletComponents::BlockPickerControl,
223
+ "blockpicker" => RufletComponents::BlockPickerControl,
224
+ "color_picker" => RufletComponents::ColorPickerControl,
225
+ "colorpicker" => RufletComponents::ColorPickerControl,
213
226
  "color" => RufletComponents::ColorControl,
214
227
  "column" => RufletComponents::ColumnControl,
215
228
  "container" => RufletComponents::ContainerControl,
@@ -267,6 +280,12 @@ module Ruflet
267
280
  "data_column" => RufletComponents::DataColumnControl,
268
281
  "data_row" => RufletComponents::DataRowControl,
269
282
  "data_table" => RufletComponents::DataTableControl,
283
+ "data_column2" => RufletComponents::DataColumn2Control,
284
+ "datacolumn2" => RufletComponents::DataColumn2Control,
285
+ "data_row2" => RufletComponents::DataRow2Control,
286
+ "datarow2" => RufletComponents::DataRow2Control,
287
+ "data_table2" => RufletComponents::DataTable2Control,
288
+ "datatable2" => RufletComponents::DataTable2Control,
270
289
  "datacell" => RufletComponents::DataCellControl,
271
290
  "datacolumn" => RufletComponents::DataColumnControl,
272
291
  "datarow" => RufletComponents::DataRowControl,
@@ -310,6 +329,11 @@ module Ruflet
310
329
  "hero" => RufletComponents::HeroControl,
311
330
  "icon" => RufletComponents::IconControl,
312
331
  "icon_button" => RufletComponents::IconButtonControl,
332
+ "hue_ring_picker" => RufletComponents::HueRingPickerControl,
333
+ "hueringpicker" => RufletComponents::HueRingPickerControl,
334
+ "interstitial_ad" => RufletComponents::InterstitialAdControl,
335
+ "interstitialad" => RufletComponents::InterstitialAdControl,
336
+ "lottie" => RufletComponents::LottieControl,
313
337
  "iconbutton" => RufletComponents::IconButtonControl,
314
338
  "image" => RufletComponents::ImageControl,
315
339
  "interactive_viewer" => RufletComponents::InteractiveViewerControl,
@@ -327,10 +351,41 @@ module Ruflet
327
351
  "list_view" => RufletComponents::ListViewControl,
328
352
  "listtile" => RufletComponents::ListTileControl,
329
353
  "map" => RufletComponents::MapControl,
354
+ "map_layer" => RufletComponents::MapLayerControl,
355
+ "maplayer" => RufletComponents::MapLayerControl,
356
+ "tile_layer" => RufletComponents::TileLayerControl,
357
+ "tilelayer" => RufletComponents::TileLayerControl,
358
+ "marker" => RufletComponents::MarkerControl,
359
+ "marker_layer" => RufletComponents::MarkerLayerControl,
360
+ "markerlayer" => RufletComponents::MarkerLayerControl,
361
+ "circle_marker" => RufletComponents::CircleMarkerControl,
362
+ "circlemarker" => RufletComponents::CircleMarkerControl,
363
+ "circle_layer" => RufletComponents::CircleLayerControl,
364
+ "circlelayer" => RufletComponents::CircleLayerControl,
365
+ "polyline_marker" => RufletComponents::PolylineMarkerControl,
366
+ "polylinemarker" => RufletComponents::PolylineMarkerControl,
367
+ "polyline_layer" => RufletComponents::PolylineLayerControl,
368
+ "polylinelayer" => RufletComponents::PolylineLayerControl,
369
+ "polygon_marker" => RufletComponents::PolygonMarkerControl,
370
+ "polygonmarker" => RufletComponents::PolygonMarkerControl,
371
+ "polygon_layer" => RufletComponents::PolygonLayerControl,
372
+ "polygonlayer" => RufletComponents::PolygonLayerControl,
373
+ "simple_attribution" => RufletComponents::SimpleAttributionControl,
374
+ "simpleattribution" => RufletComponents::SimpleAttributionControl,
375
+ "rich_attribution" => RufletComponents::RichAttributionControl,
376
+ "richattribution" => RufletComponents::RichAttributionControl,
377
+ "image_source_attribution" => RufletComponents::ImageSourceAttributionControl,
378
+ "imagesourceattribution" => RufletComponents::ImageSourceAttributionControl,
379
+ "text_source_attribution" => RufletComponents::TextSourceAttributionControl,
380
+ "textsourceattribution" => RufletComponents::TextSourceAttributionControl,
330
381
  "listview" => RufletComponents::ListViewControl,
331
382
  "markdown" => RufletComponents::MarkdownControl,
332
383
  "menu_bar" => RufletComponents::MenuBarControl,
333
384
  "menu_item_button" => RufletComponents::MenuItemButtonControl,
385
+ "material_picker" => RufletComponents::MaterialPickerControl,
386
+ "materialpicker" => RufletComponents::MaterialPickerControl,
387
+ "multiple_choice_block_picker" => RufletComponents::MultipleChoiceBlockPickerControl,
388
+ "multiplechoiceblockpicker" => RufletComponents::MultipleChoiceBlockPickerControl,
334
389
  "menubar" => RufletComponents::MenuBarControl,
335
390
  "menuitembutton" => RufletComponents::MenuItemButtonControl,
336
391
  "merge_semantics" => RufletComponents::MergeSemanticsControl,
@@ -341,6 +396,8 @@ module Ruflet
341
396
  "navigation_drawer_destination" => RufletComponents::NavigationDrawerDestinationControl,
342
397
  "navigation_rail" => RufletComponents::NavigationRailControl,
343
398
  "navigation_rail_destination" => RufletComponents::NavigationRailDestinationControl,
399
+ "native_ad" => RufletComponents::NativeAdControl,
400
+ "nativead" => RufletComponents::NativeAdControl,
344
401
  "navigationbar" => RufletComponents::NavigationBarControl,
345
402
  "navigationbardestination" => RufletComponents::NavigationBarDestinationControl,
346
403
  "navigationdrawer" => RufletComponents::NavigationDrawerControl,
@@ -376,6 +433,7 @@ module Ruflet
376
433
  "spinkit" => RufletComponents::SpinkitControl,
377
434
  "radio" => RufletComponents::RadioControl,
378
435
  "radio_group" => RufletComponents::RadioGroupControl,
436
+ "rive" => RufletComponents::RiveControl,
379
437
  "radiogroup" => RufletComponents::RadioGroupControl,
380
438
  "radar_chart" => RufletComponents::RadarChartControl,
381
439
  "radar_chart_title" => RufletComponents::RadarChartTitleControl,
@@ -421,6 +479,8 @@ module Ruflet
421
479
  "shadow" => RufletComponents::ShadowControl,
422
480
  "shimmer" => RufletComponents::ShimmerControl,
423
481
  "slider" => RufletComponents::SliderControl,
482
+ "slide_picker" => RufletComponents::SlidePickerControl,
483
+ "slidepicker" => RufletComponents::SlidePickerControl,
424
484
  "snack_bar" => RufletComponents::SnackBarControl,
425
485
  "snack_bar_action" => RufletComponents::SnackBarActionControl,
426
486
  "snackbaraction" => RufletComponents::SnackBarActionControl,
@@ -7,13 +7,30 @@ module Ruflet
7
7
  class BrowserContextMenuControl < Ruflet::Control
8
8
  TYPE = "browsercontextmenu".freeze
9
9
  WIRE = "BrowserContextMenu".freeze
10
+ KEYWORDS = [:data, :key].freeze
10
11
 
11
12
  def initialize(id: nil, data: nil, key: nil)
13
+ @disabled = false
12
14
  props = {}
13
15
  props[:data] = data unless data.nil?
14
16
  props[:key] = key unless key.nil?
15
17
  super(type: TYPE, id: id, **props)
16
18
  end
19
+
20
+ def enable(timeout: 10, on_result: nil)
21
+ result = runtime_page&.invoke(self, "enable_menu", timeout: timeout, on_result: on_result)
22
+ @disabled = false
23
+ result
24
+ end
25
+
26
+ def disable(timeout: 10, on_result: nil)
27
+ result = runtime_page&.invoke(self, "disable_menu", timeout: timeout, on_result: on_result)
28
+ @disabled = true
29
+ result
30
+ end
31
+
32
+ def disabled = @disabled
33
+ def disabled? = @disabled
17
34
  end
18
35
  end
19
36
  end
@@ -6,9 +6,9 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class RufletAppControl < Ruflet::Control
8
8
  TYPE = "ruflet_app".freeze
9
- # The client widget is still registered under its upstream name, so the
10
- # wire type stays FletApp while the Ruby API is ruflet_app.
11
- WIRE = "FletApp".freeze
9
+ # Ruflet owns its native renderer and protocol, so the public control
10
+ # keeps the Ruflet name all the way onto the wire.
11
+ WIRE = "RufletApp".freeze
12
12
 
13
13
  KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :app_error_message, :app_startup_screen_message, :args, :aspect_ratio, :badge, :bottom, :col, :data, :disabled, :expand, :expand_loose, :force_pyodide, :height, :key, :left, :margin, :offset, :opacity, :reconnect_interval_ms, :reconnect_timeout_ms, :right, :rotate, :rtl, :scale, :show_app_startup_screen, :size_change_interval, :tooltip, :top, :url, :visible, :width, :on_animation_end, :on_error, :on_size_change].freeze
14
14
 
@@ -8,8 +8,12 @@ module Ruflet
8
8
  TYPE = "serviceregistry".freeze
9
9
  WIRE = "ServiceRegistry".freeze
10
10
 
11
- def initialize(id: nil, data: nil, key: nil)
11
+ KEYWORDS = [:_services, :services, :data, :key].freeze
12
+
13
+ def initialize(id: nil, _services: nil, services: nil, data: nil, key: nil)
12
14
  props = {}
15
+ mounted_services = _services.nil? ? services : _services
16
+ props[:_services] = mounted_services unless mounted_services.nil?
13
17
  props[:data] = data unless data.nil?
14
18
  props[:key] = key unless key.nil?
15
19
  super(type: TYPE, id: id, **props)
@@ -3,6 +3,8 @@
3
3
  module Ruflet
4
4
  module UI
5
5
  module CupertinoControlMethods
6
+ # Deprecated compatibility spellings. Platform selection now happens in
7
+ # Flet and every method below forwards to a canonical control entrypoint.
6
8
  def cupertino_button(content = nil, **props)
7
9
  mapped = props.dup
8
10
  mapped[:content] = content unless content.nil?
@@ -19,6 +19,28 @@ module Ruflet
19
19
  Array(value).map { |coordinates| map_coordinates(coordinates) }
20
20
  end
21
21
 
22
+ def base_page(**props, &block) = build_widget(:base_page, **props, &block)
23
+ def basepage(**props, &block) = base_page(**props, &block)
24
+ def dialogs(controls = nil, **props)
25
+ mapped = props.dup
26
+ mapped[:controls] = controls unless controls.nil?
27
+ build_widget(:dialogs, **mapped)
28
+ end
29
+ def pagelet(content = nil, **props, &block)
30
+ mapped = props.dup
31
+ mapped[:content] = content unless content.nil?
32
+ build_widget(:pagelet, **mapped, &block)
33
+ end
34
+ def ruflet_app(**props) = build_widget(:ruflet_app, **props)
35
+ def rufletapp(**props) = ruflet_app(**props)
36
+ def service_registry(services = nil, **props)
37
+ mapped = props.dup
38
+ mapped[:services] = services unless services.nil?
39
+ build_widget(:service_registry, **mapped)
40
+ end
41
+ def serviceregistry(services = nil, **props) = service_registry(services, **props)
42
+ def window(**props) = build_widget(:window, **props)
43
+
22
44
  def view(children = nil, **props, &block)
23
45
  mapped = props.dup
24
46
  mapped[:controls] = children unless children.nil?
@@ -77,7 +99,31 @@ module Ruflet
77
99
  Ruflet::Animation.new(duration: duration, **props)
78
100
  end
79
101
  def animation_style(**props) = Ruflet::AnimationStyle.new(**props)
80
- def audio(**props) = build_widget(:audio, **props)
102
+ def accelerometer(**props) = build_service(:accelerometer, **props)
103
+ def audio(**props) = build_service(:audio, **props)
104
+ def audio_recorder(**props) = build_service(:audio_recorder, **props)
105
+ def barometer(**props) = build_service(:barometer, **props)
106
+ def battery(**props) = build_service(:battery, **props)
107
+ def browser_context_menu(**props) = build_service(:browser_context_menu, **props)
108
+ def camera(**props) = build_widget(:camera, **props)
109
+ def connectivity(**props) = build_service(:connectivity, **props)
110
+ def file_picker(**props) = build_service(:file_picker, **props)
111
+ def flashlight(**props) = build_service(:flashlight, **props)
112
+ def geolocator(**props) = build_service(:geolocator, **props)
113
+ def gyroscope(**props) = build_service(:gyroscope, **props)
114
+ def haptic_feedback(**props) = build_service(:haptic_feedback, **props)
115
+ def magnetometer(**props) = build_service(:magnetometer, **props)
116
+ def permission_handler(**props) = build_service(:permission_handler, **props)
117
+ def screen_brightness(**props) = build_service(:screen_brightness, **props)
118
+ def secure_storage(**props) = build_service(:secure_storage, **props)
119
+ def semantics_service(**props) = build_service(:semantics_service, **props)
120
+ def shake_detector(**props) = build_service(:shake_detector, **props)
121
+ def share(**props) = build_service(:share, **props)
122
+ def shared_preferences(**props) = build_service(:shared_preferences, **props)
123
+ def storage_paths(**props) = build_service(:storage_paths, **props)
124
+ def url_launcher(**props) = build_service(:url_launcher, **props)
125
+ def user_accelerometer(**props) = build_service(:user_accelerometer, **props)
126
+ def wakelock(**props) = build_service(:wakelock, **props)
81
127
  def auto_complete(suggestions = nil, **props)
82
128
  mapped = props.dup
83
129
  mapped[:suggestions] = suggestions unless suggestions.nil?
@@ -246,6 +292,26 @@ module Ruflet
246
292
  def polygonmarker(**props) = polygon_marker(**props)
247
293
  def simple_attribution(**props) = build_widget(:simpleattribution, **props)
248
294
  def simpleattribution(**props) = simple_attribution(**props)
295
+ def map_layer(**props) = build_widget(:maplayer, **props)
296
+ def maplayer(**props) = map_layer(**props)
297
+ def rich_attribution(attributions = nil, **props)
298
+ mapped = props.dup
299
+ mapped[:attributions] = attributions unless attributions.nil?
300
+ build_widget(:richattribution, **mapped)
301
+ end
302
+ def richattribution(attributions = nil, **props) = rich_attribution(attributions, **props)
303
+ def image_source_attribution(image = nil, **props)
304
+ mapped = props.dup
305
+ mapped[:image] = image unless image.nil?
306
+ build_widget(:imagesourceattribution, **mapped)
307
+ end
308
+ def imagesourceattribution(image = nil, **props) = image_source_attribution(image, **props)
309
+ def text_source_attribution(text = nil, **props)
310
+ mapped = props.dup
311
+ mapped[:text] = text unless text.nil?
312
+ build_widget(:textsourceattribution, **mapped)
313
+ end
314
+ def textsourceattribution(text = nil, **props) = text_source_attribution(text, **props)
249
315
  def list_view(children = nil, **props)
250
316
  mapped = props.dup
251
317
  mapped[:children] = children unless children.nil?
@@ -313,6 +379,29 @@ module Ruflet
313
379
  build_widget(:datacell, **mapped)
314
380
  end
315
381
  def datacell(content = nil, **props) = data_cell(content, **props)
382
+ def option(key = nil, **props)
383
+ mapped = props.dup
384
+ mapped[:key] = key unless key.nil?
385
+ build_widget(:option, **mapped)
386
+ end
387
+ def data_table2(columns = nil, **props)
388
+ mapped = props.dup
389
+ mapped[:columns] = columns unless columns.nil?
390
+ build_widget(:data_table2, **mapped)
391
+ end
392
+ def datatable2(columns = nil, **props) = data_table2(columns, **props)
393
+ def data_column2(label = nil, **props)
394
+ mapped = props.dup
395
+ mapped[:label] = label unless label.nil?
396
+ build_widget(:data_column2, **mapped)
397
+ end
398
+ def datacolumn2(label = nil, **props) = data_column2(label, **props)
399
+ def data_row2(cells = nil, **props)
400
+ mapped = props.dup
401
+ mapped[:cells] = cells unless cells.nil?
402
+ build_widget(:data_row2, **mapped)
403
+ end
404
+ def datarow2(cells = nil, **props) = data_row2(cells, **props)
316
405
  def expansion_tile(children = nil, **props)
317
406
  mapped = props.dup
318
407
  mapped[:children] = children unless children.nil?
@@ -339,9 +428,7 @@ module Ruflet
339
428
  end
340
429
  def dropdownoption(key = nil, **props) = dropdown_option(key, **props)
341
430
  def dropdown_m2(options = nil, **props)
342
- mapped = props.dup
343
- mapped[:options] = options unless options.nil?
344
- build_widget(:dropdownm2, **mapped)
431
+ dropdown(options, **props)
345
432
  end
346
433
  def dropdownm2(options = nil, **props) = dropdown_m2(options, **props)
347
434
  def progress_bar(**props) = build_widget(:progressbar, **props)
@@ -611,8 +698,7 @@ module Ruflet
611
698
 
612
699
  def app_bar(**props) = build_widget(:appbar, **props)
613
700
  def appbar(**props) = app_bar(**props)
614
- def url_launcher(**props) = build_widget(:url_launcher, **props)
615
- def clipboard(**props) = build_widget(:clipboard, **props)
701
+ def clipboard(**props) = build_service(:clipboard, **props)
616
702
  def floating_action_button(**props) = build_widget(:floatingactionbutton, **props)
617
703
  def floatingactionbutton(**props) = floating_action_button(**props)
618
704
  def tabs(content = nil, **props, &block)
@@ -696,6 +782,24 @@ module Ruflet
696
782
  def web_view(**props) = build_widget(:webview, **props)
697
783
  def webview(**props) = web_view(**props)
698
784
  def video(**props) = build_widget(:video, **props)
785
+ def block_picker(**props) = build_widget(:block_picker, **props)
786
+ def blockpicker(**props) = block_picker(**props)
787
+ def color_picker(**props) = build_widget(:color_picker, **props)
788
+ def colorpicker(**props) = color_picker(**props)
789
+ def hue_ring_picker(**props) = build_widget(:hue_ring_picker, **props)
790
+ def hueringpicker(**props) = hue_ring_picker(**props)
791
+ def material_picker(**props) = build_widget(:material_picker, **props)
792
+ def materialpicker(**props) = material_picker(**props)
793
+ def multiple_choice_block_picker(**props) = build_widget(:multiple_choice_block_picker, **props)
794
+ def multiplechoiceblockpicker(**props) = multiple_choice_block_picker(**props)
795
+ def slide_picker(**props) = build_widget(:slide_picker, **props)
796
+ def slidepicker(**props) = slide_picker(**props)
797
+ def banner_ad(**props) = build_widget(:banner_ad, **props)
798
+ def bannerad(**props) = banner_ad(**props)
799
+ def interstitial_ad(**props) = build_widget(:interstitial_ad, **props)
800
+ def interstitialad(**props) = interstitial_ad(**props)
801
+ def native_ad(**props) = build_widget(:native_ad, **props)
802
+ def nativead(**props) = native_ad(**props)
699
803
  def code_editor(value = nil, **props)
700
804
  mapped = props.dup
701
805
  mapped[:value] = value unless value.nil?
@@ -93,6 +93,12 @@ module Ruflet
93
93
  "url_launcher" => "UrlLauncher",
94
94
  "clipboard" => "Clipboard",
95
95
  "audio" => "Audio",
96
+ "bannerad" => "BannerAd",
97
+ "banner_ad" => "BannerAd",
98
+ "interstitialad" => "InterstitialAd",
99
+ "interstitial_ad" => "InterstitialAd",
100
+ "nativead" => "NativeAd",
101
+ "native_ad" => "NativeAd",
96
102
  "video" => "Video",
97
103
  "map" => "Map",
98
104
  "tilelayer" => "TileLayer",
@@ -114,19 +120,28 @@ module Ruflet
114
120
  "polygon_marker" => "PolygonMarker",
115
121
  "simpleattribution" => "SimpleAttribution",
116
122
  "simple_attribution" => "SimpleAttribution",
123
+ "maplayer" => "MapLayer",
124
+ "map_layer" => "MapLayer",
125
+ "richattribution" => "RichAttribution",
126
+ "rich_attribution" => "RichAttribution",
127
+ "imagesourceattribution" => "ImageSourceAttribution",
128
+ "image_source_attribution" => "ImageSourceAttribution",
129
+ "textsourceattribution" => "TextSourceAttribution",
130
+ "text_source_attribution" => "TextSourceAttribution",
117
131
  "codeeditor" => "CodeEditor",
118
132
  "code_editor" => "CodeEditor",
119
133
  "lottie" => "Lottie",
134
+ "rive" => "Rive",
120
135
  "flashlight" => "Flashlight",
121
136
  "barchart" => "BarChart",
122
- "barchartgroup" => "group",
123
- "barchartrod" => "rod",
124
- "barchartrodstackitem" => "stack_item",
137
+ "barchartgroup" => "BarChartGroup",
138
+ "barchartrod" => "BarChartRod",
139
+ "barchartrodstackitem" => "BarChartRodStackItem",
125
140
  "linechart" => "LineChart",
126
- "linechartdata" => "data",
127
- "linechartdatapoint" => "p",
141
+ "linechartdata" => "LineChartData",
142
+ "linechartdatapoint" => "LineChartDataPoint",
128
143
  "piechart" => "PieChart",
129
- "piechartsection" => "section",
144
+ "piechartsection" => "PieChartSection",
130
145
  "candlestickchart" => "CandlestickChart",
131
146
  "candlestickchartspot" => "CandlestickChartSpot",
132
147
  "radarchart" => "RadarChart",
@@ -135,8 +150,8 @@ module Ruflet
135
150
  "radardatasetentry" => "RadarDataSetEntry",
136
151
  "scatterchart" => "ScatterChart",
137
152
  "scatterchartspot" => "ScatterChartSpot",
138
- "chartaxis" => "axis",
139
- "chartaxislabel" => "l",
153
+ "chartaxis" => "ChartAxis",
154
+ "chartaxislabel" => "ChartAxisLabel",
140
155
  "datacell" => "c",
141
156
  "datacolumn" => "c",
142
157
  "datarow" => "r",