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
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoCheckboxControl < Ruflet::Control
8
8
  TYPE = "cupertinocheckbox".freeze
9
- WIRE = "CupertinoCheckbox".freeze
9
+ WIRE = "Checkbox".freeze
10
10
 
11
11
  KEYWORDS = [:active_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :border_side, :bottom, :check_color, :col, :data, :disabled, :expand, :expand_loose, :fill_color, :focus_color, :height, :key, :label, :label_position, :left, :margin, :mouse_cursor, :offset, :opacity, :right, :rotate, :rtl, :scale, :semantics_label, :shape, :size_change_interval, :spacing, :tooltip, :top, :tristate, :value, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_focus, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoContextMenuControl < Ruflet::Control
8
8
  TYPE = "cupertinocontextmenu".freeze
9
- WIRE = "CupertinoContextMenu".freeze
9
+ WIRE = "ContextMenu".freeze
10
10
 
11
11
  def initialize(id: nil, actions: nil, adaptive: nil, badge: nil, col: nil, content: nil, data: nil, disabled: nil, enable_haptic_feedback: nil, expand: nil, expand_loose: nil, key: nil, opacity: nil, rtl: nil, tooltip: nil, visible: nil)
12
12
  enable_haptic_feedback = true if enable_haptic_feedback.nil?
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoContextMenuActionControl < Ruflet::Control
8
8
  TYPE = "cupertinocontextmenuaction".freeze
9
- WIRE = "CupertinoContextMenuAction".freeze
9
+ WIRE = "ContextMenuAction".freeze
10
10
 
11
11
  def initialize(id: nil, adaptive: nil, badge: nil, col: nil, content: nil, data: nil, default: nil, destructive: nil, disabled: nil, expand: nil, expand_loose: nil, key: nil, opacity: nil, rtl: nil, tooltip: nil, trailing_icon: nil, visible: nil, on_click: nil)
12
12
  raise ArgumentError, "cupertino_context_menu_action requires content" if content.nil?
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoDatePickerControl < Ruflet::Control
8
8
  TYPE = "cupertinodatepicker".freeze
9
- WIRE = "CupertinoDatePicker".freeze
9
+ WIRE = "DatePicker".freeze
10
10
 
11
11
  KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bottom, :col, :data, :date_order, :date_picker_mode, :disabled, :expand, :expand_loose, :first_date, :height, :item_extent, :key, :last_date, :left, :locale, :margin, :maximum_year, :minimum_year, :minute_interval, :offset, :opacity, :right, :rotate, :rtl, :scale, :show_day_of_week, :size_change_interval, :tooltip, :top, :use_24h_format, :value, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoDialogActionControl < Ruflet::Control
8
8
  TYPE = "cupertinodialogaction".freeze
9
- WIRE = "CupertinoDialogAction".freeze
9
+ WIRE = "Button".freeze
10
10
 
11
11
  def initialize(id: nil, badge: nil, col: nil, content: nil, data: nil, default: nil, destructive: nil, disabled: nil, expand: nil, expand_loose: nil, key: nil, opacity: nil, rtl: nil, text_style: nil, tooltip: nil, visible: nil, on_click: nil)
12
12
  raise ArgumentError, "cupertino_dialog_action requires content" if content.nil?
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoFilledButtonControl < Ruflet::Control
8
8
  TYPE = "cupertinofilledbutton".freeze
9
- WIRE = "CupertinoFilledButton".freeze
9
+ WIRE = "FilledButton".freeze
10
10
 
11
11
  KEYWORDS = [:align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bgcolor, :border_radius, :bottom, :col, :color, :content, :data, :disabled, :disabled_bgcolor, :expand, :expand_loose, :focus_color, :height, :icon, :icon_color, :key, :left, :margin, :min_size, :mouse_cursor, :offset, :opacity, :opacity_on_click, :padding, :right, :rotate, :rtl, :scale, :size, :size_change_interval, :tooltip, :top, :url, :visible, :width, :on_animation_end, :on_blur, :on_click, :on_focus, :on_long_press, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoListTileControl < Ruflet::Control
8
8
  TYPE = "cupertinolisttile".freeze
9
- WIRE = "CupertinoListTile".freeze
9
+ WIRE = "ListTile".freeze
10
10
 
11
11
  KEYWORDS = [:additional_info, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bgcolor_activated, :bottom, :col, :data, :disabled, :expand, :expand_loose, :height, :key, :leading, :leading_size, :leading_to_title, :left, :margin, :notched, :offset, :opacity, :padding, :right, :rotate, :rtl, :scale, :size_change_interval, :subtitle, :title, :toggle_inputs, :tooltip, :top, :trailing, :url, :visible, :width, :on_animation_end, :on_click, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoNavigationBarControl < Ruflet::Control
8
8
  TYPE = "cupertinonavigationbar".freeze
9
- WIRE = "CupertinoNavigationBar".freeze
9
+ WIRE = "NavigationBar".freeze
10
10
 
11
11
  KEYWORDS = [:active_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :border, :bottom, :col, :data, :destinations, :disabled, :expand, :expand_loose, :height, :icon_size, :inactive_color, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :selected_index, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoPickerControl < Ruflet::Control
8
8
  TYPE = "cupertinopicker".freeze
9
- WIRE = "CupertinoPicker".freeze
9
+ WIRE = "Picker".freeze
10
10
 
11
11
  KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bottom, :col, :controls, :data, :default_selection_overlay_bgcolor, :diameter_ratio, :disabled, :expand, :expand_loose, :height, :item_extent, :key, :left, :looping, :magnification, :margin, :off_axis_fraction, :offset, :opacity, :right, :rotate, :rtl, :scale, :selected_index, :selection_overlay, :size_change_interval, :squeeze, :tooltip, :top, :use_magnifier, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoRadioControl < Ruflet::Control
8
8
  TYPE = "cupertinoradio".freeze
9
- WIRE = "CupertinoRadio".freeze
9
+ WIRE = "Radio".freeze
10
10
 
11
11
  KEYWORDS = [:active_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bottom, :col, :data, :disabled, :expand, :expand_loose, :fill_color, :focus_color, :height, :inactive_color, :key, :label, :label_position, :left, :margin, :mouse_cursor, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :toggleable, :tooltip, :top, :use_checkmark_style, :value, :visible, :width, :on_animation_end, :on_blur, :on_focus, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoSegmentedButtonControl < Ruflet::Control
8
8
  TYPE = "cupertinosegmentedbutton".freeze
9
- WIRE = "CupertinoSegmentedButton".freeze
9
+ WIRE = "SegmentedButton".freeze
10
10
 
11
11
  KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :border_color, :bottom, :click_color, :col, :controls, :data, :disabled, :disabled_color, :disabled_text_color, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :padding, :right, :rotate, :rtl, :scale, :selected_color, :selected_index, :size_change_interval, :tooltip, :top, :unselected_color, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoSliderControl < Ruflet::Control
8
8
  TYPE = "cupertinoslider".freeze
9
- WIRE = "CupertinoSlider".freeze
9
+ WIRE = "Slider".freeze
10
10
 
11
11
  KEYWORDS = [:active_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :col, :data, :disabled, :divisions, :expand, :expand_loose, :height, :key, :left, :margin, :max, :min, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :thumb_color, :tooltip, :top, :value, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_change_end, :on_change_start, :on_focus, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoSlidingSegmentedButtonControl < Ruflet::Control
8
8
  TYPE = "cupertinoslidingsegmentedbutton".freeze
9
- WIRE = "CupertinoSlidingSegmentedButton".freeze
9
+ WIRE = "SegmentedButton".freeze
10
10
 
11
11
  KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bottom, :col, :controls, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :padding, :proportional_width, :right, :rotate, :rtl, :scale, :selected_index, :size_change_interval, :thumb_color, :tooltip, :top, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoSwitchControl < Ruflet::Control
8
8
  TYPE = "cupertinoswitch".freeze
9
- WIRE = "CupertinoSwitch".freeze
9
+ WIRE = "Switch".freeze
10
10
 
11
11
  KEYWORDS = [:active_thumb_image, :active_thumb_image_src, :active_track_color, :align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bottom, :col, :data, :disabled, :expand, :expand_loose, :focus_color, :height, :inactive_thumb_color, :inactive_thumb_image, :inactive_thumb_image_src, :inactive_track_color, :key, :label, :label_position, :left, :margin, :off_label_color, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :thumb_color, :thumb_icon, :tooltip, :top, :track_outline_color, :track_outline_width, :value, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_focus, :on_image_error, :on_label_color, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoTextFieldControl < Ruflet::Control
8
8
  TYPE = "cupertinotextfield".freeze
9
- WIRE = "CupertinoTextField".freeze
9
+ WIRE = "TextField".freeze
10
10
 
11
11
  KEYWORDS = [:adaptive, :align, :align_label_with_hint, :always_call_on_tap, :animate_align, :animate_cursor_opacity, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autocorrect, :autofill_hints, :autofocus, :badge, :bgcolor, :blend_mode, :border, :border_color, :border_radius, :border_width, :bottom, :can_request_focus, :can_reveal_password, :capitalization, :clear_button_semantics_label, :clear_button_visibility_mode, :clip_behavior, :col, :collapsed, :color, :content_padding, :counter, :counter_style, :cursor_color, :cursor_error_color, :cursor_height, :cursor_radius, :cursor_width, :data, :dense, :disabled, :enable_ime_personalized_learning, :enable_interactive_selection, :enable_stylus_handwriting, :enable_suggestions, :error, :error_max_lines, :error_style, :expand, :expand_loose, :fill_color, :filled, :fit_parent_size, :focus_color, :focused_bgcolor, :focused_border_color, :focused_border_width, :focused_color, :gradient, :height, :helper, :helper_max_lines, :helper_style, :hint_fade_duration, :hint_max_lines, :hint_style, :hint_text, :hover_color, :icon, :ignore_pointers, :ignore_up_down_keys, :image, :input_filter, :key, :keyboard_brightness, :keyboard_type, :label, :label_style, :left, :margin, :max_length, :max_lines, :min_lines, :mouse_cursor, :multiline, :obscuring_character, :offset, :opacity, :padding, :password, :placeholder_style, :placeholder_text, :prefix, :prefix_icon, :prefix_icon_size_constraints, :prefix_style, :prefix_visibility_mode, :read_only, :right, :rotate, :rtl, :scale, :scroll_padding, :selection, :selection_color, :shadows, :shift_enter, :show_cursor, :size_change_interval, :size_constraints, :smart_dashes_type, :smart_quotes_type, :strut_style, :suffix, :suffix_icon, :suffix_icon_size_constraints, :suffix_style, :suffix_visibility_mode, :text_align, :text_size, :text_style, :text_vertical_align, :tooltip, :top, :value, :visible, :width, :on_animation_end, :on_blur, :on_change, :on_click, :on_focus, :on_selection_change, :on_size_change, :on_submit, :on_tap_outside].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoTimerPickerControl < Ruflet::Control
8
8
  TYPE = "cupertinotimerpicker".freeze
9
- WIRE = "CupertinoTimerPicker".freeze
9
+ WIRE = "TimerPicker".freeze
10
10
 
11
11
  KEYWORDS = [:align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bgcolor, :bottom, :col, :data, :disabled, :expand, :expand_loose, :height, :item_extent, :key, :left, :margin, :minute_interval, :mode, :offset, :opacity, :right, :rotate, :rtl, :scale, :second_interval, :size_change_interval, :tooltip, :top, :value, :visible, :width, :on_animation_end, :on_change, :on_size_change].freeze
12
12
 
@@ -6,7 +6,7 @@ module Ruflet
6
6
  module RufletComponents
7
7
  class CupertinoTintedButtonControl < Ruflet::Control
8
8
  TYPE = "cupertinotintedbutton".freeze
9
- WIRE = "CupertinoTintedButton".freeze
9
+ WIRE = "FilledTonalButton".freeze
10
10
 
11
11
  KEYWORDS = [:align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bgcolor, :border_radius, :bottom, :col, :color, :content, :data, :disabled, :disabled_bgcolor, :expand, :expand_loose, :focus_color, :height, :icon, :icon_color, :key, :left, :margin, :min_size, :mouse_cursor, :offset, :opacity, :opacity_on_click, :padding, :right, :rotate, :rtl, :scale, :size, :size_change_interval, :tooltip, :top, :url, :visible, :width, :on_animation_end, :on_blur, :on_click, :on_focus, :on_long_press, :on_size_change].freeze
12
12
 
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ module RufletComponents
7
+ class AdControl < Ruflet::Control
8
+ def initialize(type:, id: nil, **props)
9
+ compact = {}
10
+ props.each { |key, value| compact[key] = value unless value.nil? }
11
+ super(type: type, id: id, **compact)
12
+ end
13
+ end
14
+
15
+ class BannerAdControl < AdControl
16
+ WIRE = "BannerAd".freeze
17
+
18
+ def initialize(id: nil, **props)
19
+ super(type: "banner_ad", id: id, **props)
20
+ end
21
+ end
22
+
23
+ class InterstitialAdControl < AdControl
24
+ WIRE = "InterstitialAd".freeze
25
+
26
+ def initialize(id: nil, **props)
27
+ super(type: "interstitial_ad", id: id, **props)
28
+ end
29
+
30
+ def show(timeout: 10, on_result: nil)
31
+ runtime_page&.invoke(self, "show", timeout: timeout, on_result: on_result)
32
+ end
33
+ end
34
+
35
+ class NativeAdControl < AdControl
36
+ WIRE = "NativeAd".freeze
37
+
38
+ def initialize(id: nil, **props)
39
+ super(type: "native_ad", id: id, **props)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruflet
4
+ module UI
5
+ module Controls
6
+ module RufletComponents
7
+ class AnimationExtensionControl < Ruflet::Control
8
+ KEYWORDS = [].freeze
9
+
10
+ def initialize(type:, id: nil, **props)
11
+ compact = {}
12
+ props.each { |key, value| compact[key] = value unless value.nil? }
13
+ super(type: type, id: id, **compact)
14
+ end
15
+ end
16
+
17
+ class LottieControl < AnimationExtensionControl
18
+ WIRE = "Lottie".freeze
19
+ def initialize(id: nil, **props) = super(type: "lottie", id: id, **props)
20
+ end
21
+
22
+ class RiveControl < AnimationExtensionControl
23
+ WIRE = "Rive".freeze
24
+ def initialize(id: nil, **props) = super(type: "rive", id: id, **props)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end