vime_view_components 0.1.0 → 5.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/vime/component.rb +3 -4
  4. data/lib/vime/core/embed.rb +1 -1
  5. data/lib/vime/core/player.rb +1 -1
  6. data/lib/vime/core/playground.rb +1 -1
  7. data/lib/vime/providers/audio.rb +1 -1
  8. data/lib/vime/providers/dailymotion.rb +1 -1
  9. data/lib/vime/providers/dash.rb +1 -1
  10. data/lib/vime/providers/file.rb +1 -1
  11. data/lib/vime/providers/hls.rb +1 -1
  12. data/lib/vime/providers/video.rb +1 -1
  13. data/lib/vime/providers/vimeo.rb +1 -1
  14. data/lib/vime/providers/youtube.rb +1 -1
  15. data/lib/vime/ui/captions.rb +1 -1
  16. data/lib/vime/ui/click_to_play.rb +1 -1
  17. data/lib/vime/ui/controls/caption_control.rb +3 -3
  18. data/lib/vime/ui/controls/control.rb +1 -1
  19. data/lib/vime/ui/controls/control_group.rb +1 -1
  20. data/lib/vime/ui/controls/control_spacer.rb +1 -1
  21. data/lib/vime/ui/controls/controls.rb +2 -2
  22. data/lib/vime/ui/controls/default_controls.rb +1 -1
  23. data/lib/vime/ui/controls/fullscreen_control.rb +3 -3
  24. data/lib/vime/ui/controls/mute_control.rb +4 -4
  25. data/lib/vime/ui/controls/pip_control.rb +3 -3
  26. data/lib/vime/ui/controls/playback_control.rb +3 -3
  27. data/lib/vime/ui/controls/scrubber_control.rb +1 -1
  28. data/lib/vime/ui/controls/settings_control.rb +2 -2
  29. data/lib/vime/ui/controls/volume_control.rb +4 -4
  30. data/lib/vime/ui/dbl_click_fullscreen.rb +1 -1
  31. data/lib/vime/ui/default_ui.rb +1 -1
  32. data/lib/vime/ui/icon.rb +3 -3
  33. data/lib/vime/ui/icon_library.rb +21 -0
  34. data/lib/vime/ui/live_indicator.rb +1 -1
  35. data/lib/vime/ui/poster.rb +1 -1
  36. data/lib/vime/ui/scrim.rb +1 -1
  37. data/lib/vime/ui/settings/default_settings.rb +2 -2
  38. data/lib/vime/ui/settings/menu.rb +1 -1
  39. data/lib/vime/ui/settings/menu_item.rb +2 -2
  40. data/lib/vime/ui/settings/menu_radio.rb +2 -2
  41. data/lib/vime/ui/settings/menu_radio_group.rb +1 -1
  42. data/lib/vime/ui/settings/settings.rb +2 -2
  43. data/lib/vime/ui/settings/submenu.rb +1 -1
  44. data/lib/vime/ui/skeleton.rb +1 -1
  45. data/lib/vime/ui/slider.rb +1 -1
  46. data/lib/vime/ui/spinner.rb +1 -1
  47. data/lib/vime/ui/time/current_time.rb +1 -1
  48. data/lib/vime/ui/time/end_time.rb +1 -1
  49. data/lib/vime/ui/time/time.rb +1 -1
  50. data/lib/vime/ui/time/time_progress.rb +1 -1
  51. data/lib/vime/ui/tooltip.rb +1 -1
  52. data/lib/vime/ui/ui.rb +1 -1
  53. data/lib/vime_view_components.rb +10 -57
  54. data/lib/vime_view_components/version.rb +1 -1
  55. metadata +21 -7
  56. data/lib/vime/ui/icons.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36f096f677d914a9ea6b94f10e0c343225fb420a89896e6fb8926e5cc7259cd9
4
- data.tar.gz: 1def0ea3af02fa441578e156daa8d47f1299c678cc212eea2f3d0691d566c0e2
3
+ metadata.gz: f26b57357d97fe7fbc0698784f869c42f3ebe7f223c5ee49cc7ec009283ad209
4
+ data.tar.gz: f0837ec99e71d1ad0f5ac89a39f75fe4a9490da62549b9ecba0ab4880ee309d5
5
5
  SHA512:
6
- metadata.gz: 694dc48794d951e1038ee3eedaae8d225a647165b8efed812e12c020ccbc506a0b2449057b38d915111c60b93dffc32cce7c5cabaf8534099717e83aa84150b7
7
- data.tar.gz: 472aa8cd079430dc1a0a28668bf331b75aa498797cbee63ea39c1c0b732635b8dfaf28db5d3e8b819b499cfe0ad8fbdb975ac81c31fe8ecd7f1f159d824fe745
6
+ metadata.gz: 50a8a9fba0c2157cb5ed2d047eba828d6ca09771b1db4ec4aa568e6c7819f0cf5ea32ffe834c04ba7babab8d463fcdd93915e4802d0c17de4a6cc3ebfd734429
7
+ data.tar.gz: 016a67c64fc7a70e3f1bbccadf1fce574e7b35a35a1c8e8a21b26dc3bda197ef048b31f65635836d83da633e7642ae475726ce688360f8a22a51b2115df8efba
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # vime_view_components
2
2
 
3
- ![Ruby](https://github.com/asgerb/vime_view_components/workflows/Ruby/badge.svg)
3
+ [![Gem Version](https://badge.fury.io/rb/vime_view_components.svg)](https://rubygems.org/gems/vime_view_components)
4
+ ![Tests](https://github.com/asgerb/vime_view_components/workflows/Tests/badge.svg)
4
5
 
5
6
  ViewComponents for vime.js
6
7
 
@@ -10,7 +10,6 @@ module Vime
10
10
  include Dry.Types()
11
11
 
12
12
  CrossOrigin = String.enum("", "anonymous", "use-credentials")
13
- Pin = String.enum("bottomLeft", "bottomRight", "topLeft", "topRight")
14
13
  Preload = String.enum("", "auto", "metadata", "none")
15
14
  TooltipDirection = String.enum("left", "right")
16
15
  TooltipPosition = String.enum("bottom", "top")
@@ -31,9 +30,9 @@ module Vime
31
30
  private
32
31
  def process_attrs(attrs)
33
32
  attrs
34
- .deep_transform_keys(&:to_s)
35
- .deep_transform_keys(&:dasherize)
36
- .reject { |_, v| v.nil? }
33
+ .deep_transform_keys(&:to_s)
34
+ .deep_transform_keys(&:dasherize)
35
+ .reject { |_, v| v.nil? || v == false }
37
36
  end
38
37
  end
39
38
  end
@@ -11,7 +11,7 @@ module Vime
11
11
  option :params, type: Types::String, optional: true
12
12
 
13
13
  def call
14
- content_tag "vime-embed", content, process_attrs(dom_attrs)
14
+ content_tag "vm-embed", content, process_attrs(dom_attrs)
15
15
  end
16
16
 
17
17
  def dom_attrs
@@ -24,7 +24,7 @@ module Vime
24
24
  option :volume, type: Types::Integer, default: -> { 50 }
25
25
 
26
26
  def call
27
- content_tag "vime-player", content, process_attrs(dom_attrs)
27
+ content_tag "vm-player", content, process_attrs(dom_attrs)
28
28
  end
29
29
 
30
30
  def dom_attrs
@@ -12,7 +12,7 @@ module Vime
12
12
  option :theme, type: Types::String.enum("", "dark", "light"), default: -> { "" }
13
13
 
14
14
  def call
15
- content_tag "vime-playground", content, process_attrs(dom_attrs)
15
+ content_tag "vm-playground", content, process_attrs(dom_attrs)
16
16
  end
17
17
 
18
18
  def dom_attrs
@@ -10,7 +10,7 @@ module Vime
10
10
  option :preload, type: Types::Preload, default: -> { "metadata" }
11
11
 
12
12
  def call
13
- content_tag "vime-audio", content, process_attrs(dom_attrs)
13
+ content_tag "vm-audio", content, process_attrs(dom_attrs)
14
14
  end
15
15
 
16
16
  def dom_attrs
@@ -16,7 +16,7 @@ module Vime
16
16
  option :video_id, type: Types::String
17
17
 
18
18
  def call
19
- tag "vime-dailymotion", process_attrs(dom_attrs)
19
+ content_tag "vm-dailymotion", nil, process_attrs(dom_attrs)
20
20
  end
21
21
 
22
22
  def dom_attrs
@@ -17,7 +17,7 @@ module Vime
17
17
  option :version, type: Types::String, default: -> { "latest" }
18
18
 
19
19
  def call
20
- content_tag "vime-dash", content, process_attrs(dom_attrs)
20
+ content_tag "vm-dash", content, process_attrs(dom_attrs)
21
21
  end
22
22
 
23
23
  def dom_attrs
@@ -16,7 +16,7 @@ module Vime
16
16
  option :view_type, type: Types::String, optional: true
17
17
 
18
18
  def call
19
- content_tag "vime-file", content, process_attrs(dom_attrs)
19
+ content_tag "vm-file", content, process_attrs(dom_attrs)
20
20
  end
21
21
 
22
22
  def dom_attrs
@@ -14,7 +14,7 @@ module Vime
14
14
  option :version, type: Types::String, default: -> { "latest" }
15
15
 
16
16
  def call
17
- content_tag "vime-hls", content, process_attrs(dom_attrs)
17
+ content_tag "vm-hls", content, process_attrs(dom_attrs)
18
18
  end
19
19
 
20
20
  def dom_attrs
@@ -12,7 +12,7 @@ module Vime
12
12
  option :preload, type: Types::Preload, default: -> { "metadata" }
13
13
 
14
14
  def call
15
- content_tag "vime-video", content, process_attrs(dom_attrs)
15
+ content_tag "vm-video", content, process_attrs(dom_attrs)
16
16
  end
17
17
 
18
18
  def dom_attrs
@@ -13,7 +13,7 @@ module Vime
13
13
  option :video_id, type: Types::String
14
14
 
15
15
  def call
16
- tag "vime-vimeo", process_attrs(dom_attrs)
16
+ content_tag "vm-vimeo", nil, process_attrs(dom_attrs)
17
17
  end
18
18
 
19
19
  def dom_attrs
@@ -11,7 +11,7 @@ module Vime
11
11
  option :video_id, type: Types::String
12
12
 
13
13
  def call
14
- tag "vime-youtube", process_attrs(dom_attrs)
14
+ content_tag "vm-youtube", nil, process_attrs(dom_attrs)
15
15
  end
16
16
 
17
17
  def dom_attrs
@@ -9,7 +9,7 @@ module Vime
9
9
  option :hidden, type: Types::Bool, default: -> { false }
10
10
 
11
11
  def call
12
- tag "vime-captions", process_attrs(dom_attrs)
12
+ content_tag "vm-captions", nil, process_attrs(dom_attrs)
13
13
  end
14
14
 
15
15
  def dom_attrs
@@ -8,7 +8,7 @@ module Vime
8
8
  option :use_on_mobile, type: Types::Bool, default: -> { false }
9
9
 
10
10
  def call
11
- tag "vime-click-to-play", process_attrs(dom_attrs)
11
+ content_tag "vm-click-to-play", nil, process_attrs(dom_attrs)
12
12
  end
13
13
 
14
14
  def dom_attrs
@@ -6,15 +6,15 @@ module Vime
6
6
  module Ui
7
7
  module Controls
8
8
  class CaptionControl < Component
9
- option :hide_icon, type: Types::String, default: -> { "#vime-captions-off" }
9
+ option :hide_icon, type: Types::String, default: -> { "captions-off" }
10
10
  option :hide_tooltip, type: Types::Bool, default: -> { false }
11
11
  option :keys, type: Types::String, default: -> { "c" }
12
- option :show_icon, type: Types::String, default: -> { "#vime-captions-on" }
12
+ option :show_icon, type: Types::String, default: -> { "captions-on" }
13
13
  option :tooltip_direction, type: Types::TooltipDirection, optional: true
14
14
  option :tooltip_position, type: Types::TooltipPosition, default: -> { "top" }
15
15
 
16
16
  def call
17
- tag "vime-caption-control", process_attrs(dom_attrs)
17
+ content_tag "vm-caption-control", nil, process_attrs(dom_attrs)
18
18
  end
19
19
 
20
20
  def dom_attrs
@@ -15,7 +15,7 @@ module Vime
15
15
  option :pressed, type: Types::Bool, optional: true
16
16
 
17
17
  def call
18
- content_tag "vime-control", content, process_attrs(dom_attrs)
18
+ content_tag "vm-control", content, process_attrs(dom_attrs)
19
19
  end
20
20
 
21
21
  def dom_attrs
@@ -9,7 +9,7 @@ module Vime
9
9
  option :space, type: Types::String.enum("both", "bottom", "none", "top"), default: -> { "none" }
10
10
 
11
11
  def call
12
- content_tag "vime-control-group", content, process_attrs(dom_attrs)
12
+ content_tag "vm-control-group", content, process_attrs(dom_attrs)
13
13
  end
14
14
 
15
15
  def dom_attrs
@@ -7,7 +7,7 @@ module Vime
7
7
  module Controls
8
8
  class ControlSpacer < Component
9
9
  def call
10
- tag "vime-control-spacer", process_attrs(dom_attrs)
10
+ content_tag "vm-control-spacer", nil, process_attrs(dom_attrs)
11
11
  end
12
12
  end
13
13
  end
@@ -15,11 +15,11 @@ module Vime
15
15
  option :hide_on_mouse_leave, type: Types::Bool, default: -> { false }
16
16
  option :hide_when_paused, type: Types::Bool, default: -> { false }
17
17
  option :justify, type: Types::String.enum("center", "end", "space-around", "space-between", "space-evenly", "start"), default: -> { "start" }
18
- option :pin, type: Types::Pin, default: -> { "bottomLeft" }
18
+ option :pin, type: Types::String.enum("bottomLeft", "bottomRight", "center", "topLeft", "topRight"), default: -> { "bottomLeft" }
19
19
  option :wait_for_playback_start, type: Types::Bool, default: -> { false }
20
20
 
21
21
  def call
22
- content_tag "vime-controls", content, process_attrs(dom_attrs)
22
+ content_tag "vm-controls", content, process_attrs(dom_attrs)
23
23
  end
24
24
 
25
25
  def dom_attrs
@@ -12,7 +12,7 @@ module Vime
12
12
  option :wait_for_playback_start, type: Types::Bool, default: -> { false }
13
13
 
14
14
  def call
15
- tag "vime-default-controls", process_attrs(dom_attrs)
15
+ content_tag "vm-default-controls", nil, process_attrs(dom_attrs)
16
16
  end
17
17
 
18
18
  def dom_attrs
@@ -6,15 +6,15 @@ module Vime
6
6
  module Ui
7
7
  module Controls
8
8
  class FullscreenControl < Component
9
- option :enter_icon, type: Types::String, default: -> { "#vime-enter-fullscreen" }
10
- option :exit_icon, type: Types::String, default: -> { "#vime-exit-fullscreen" }
9
+ option :enter_icon, type: Types::String, default: -> { "fullscreen-enter" }
10
+ option :exit_icon, type: Types::String, default: -> { "fullscreen-exit" }
11
11
  option :hide_tooltip, type: Types::Bool, default: -> { false }
12
12
  option :keys, type: Types::String, optional: true, default: -> { "f" }
13
13
  option :tooltip_direction, type: Types::TooltipDirection, optional: true
14
14
  option :tooltip_position, type: Types::TooltipPosition, default: -> { "top" }
15
15
 
16
16
  def call
17
- tag "vime-fullscreen-control", process_attrs(dom_attrs)
17
+ content_tag "vm-fullscreen-control", nil, process_attrs(dom_attrs)
18
18
  end
19
19
 
20
20
  def dom_attrs
@@ -7,15 +7,15 @@ module Vime
7
7
  module Controls
8
8
  class MuteControl < Component
9
9
  option :hide_tooltip, type: Types::Bool, default: -> { false }
10
- option :high_volume_icon, type: Types::String, default: -> { "#vime-volume-high" }
10
+ option :high_volume_icon, type: Types::String, default: -> { "volume-high" }
11
11
  option :keys, type: Types::String.optional, default: -> { "m" }
12
- option :low_volume_icon, type: Types::String, default: -> { "#vime-volume-low" }
13
- option :muted_icon, type: Types::String, default: -> { "#vime-volume-mute" }
12
+ option :low_volume_icon, type: Types::String, default: -> { "volume-low" }
13
+ option :muted_icon, type: Types::String, default: -> { "volume-mute" }
14
14
  option :tooltip_direction, type: Types::TooltipDirection, optional: true
15
15
  option :tooltip_position, type: Types::TooltipPosition, default: -> { "top" }
16
16
 
17
17
  def call
18
- tag "vime-mute-control", process_attrs(dom_attrs)
18
+ content_tag "vm-mute-control", nil, process_attrs(dom_attrs)
19
19
  end
20
20
 
21
21
  def dom_attrs
@@ -6,15 +6,15 @@ module Vime
6
6
  module Ui
7
7
  module Controls
8
8
  class PipControl < Component
9
- option :enter_icon, type: Types::String, default: -> { "#vime-enter-pip" }
10
- option :exit_icon, type: Types::String, default: -> { "#vime-exit-pip" }
9
+ option :enter_icon, type: Types::String, default: -> { "pip-enter" }
10
+ option :exit_icon, type: Types::String, default: -> { "pip-exit" }
11
11
  option :hide_tooltip, type: Types::Bool, default: -> { false }
12
12
  option :keys, type: Types::String, default: -> { "p" }
13
13
  option :tooltip_direction, type: Types::TooltipDirection, optional: true
14
14
  option :tooltip_position, type: Types::TooltipPosition, default: -> { "top" }
15
15
 
16
16
  def call
17
- tag "vime-pip-control", process_attrs(dom_attrs)
17
+ content_tag "vm-pip-control", nil, process_attrs(dom_attrs)
18
18
  end
19
19
 
20
20
  def dom_attrs
@@ -8,13 +8,13 @@ module Vime
8
8
  class PlaybackControl < Component
9
9
  option :hide_tooltip, type: Types::Bool, default: -> { false }
10
10
  option :keys, type: Types::String.optional, default: -> { "k" }
11
- option :play_icon, type: Types::String, default: -> { "#vime-play" }
12
- option :pause_icon, type: Types::String, default: -> { "#vime-pause" }
11
+ option :play_icon, type: Types::String, default: -> { "play" }
12
+ option :pause_icon, type: Types::String, default: -> { "pause" }
13
13
  option :tooltip_direction, type: Types::TooltipDirection, optional: true
14
14
  option :tooltip_position, type: Types::TooltipPosition, default: -> { "top" }
15
15
 
16
16
  def call
17
- tag "vime-playback-control", process_attrs(dom_attrs)
17
+ content_tag "vm-playback-control", nil, process_attrs(dom_attrs)
18
18
  end
19
19
 
20
20
  def dom_attrs
@@ -11,7 +11,7 @@ module Vime
11
11
  option :no_keyboard, type: Types::Bool, default: -> { false }
12
12
 
13
13
  def call
14
- tag "vime-scrubber-control", process_attrs(dom_attrs)
14
+ content_tag "vm-scrubber-control", nil, process_attrs(dom_attrs)
15
15
  end
16
16
 
17
17
  def dom_attrs
@@ -7,13 +7,13 @@ module Vime
7
7
  module Controls
8
8
  class SettingsControl < Component
9
9
  option :expanded, type: Types::Bool, default: -> { false }
10
- option :icon, type: Types::String, default: -> { "#vime-settings" }
10
+ option :icon, type: Types::String, default: -> { "settings" }
11
11
  option :menu, type: Types::String, optional: true
12
12
  option :tooltip_direction, type: Types::TooltipDirection, optional: true
13
13
  option :tooltip_position, type: Types::TooltipPosition, default: -> { "top" }
14
14
 
15
15
  def call
16
- tag "vime-settings-control", process_attrs(dom_attrs)
16
+ content_tag "vm-settings-control", nil, process_attrs(dom_attrs)
17
17
  end
18
18
 
19
19
  def dom_attrs
@@ -7,16 +7,16 @@ module Vime
7
7
  module Controls
8
8
  class VolumeControl < Component
9
9
  option :hide_tooltip, type: Types::Bool, default: -> { false }
10
- option :high_volume_icon, type: Types::String, default: -> { "#vime-volume-high" }
11
- option :low_volume_icon, type: Types::String, default: -> { "#vime-volume-low" }
10
+ option :high_volume_icon, type: Types::String, default: -> { "volume-high" }
11
+ option :low_volume_icon, type: Types::String, default: -> { "volume-low" }
12
12
  option :mute_keys, type: Types::String, default: -> { "m" }
13
- option :muted_icon, type: Types::String, default: -> { "#vime-volume-mute" }
13
+ option :muted_icon, type: Types::String, default: -> { "volume-mute" }
14
14
  option :no_keyboard, type: Types::Bool, default: -> { false }
15
15
  option :tooltip_direction, type: Types::TooltipDirection, optional: true
16
16
  option :tooltip_position, type: Types::TooltipPosition, default: -> { "top" }
17
17
 
18
18
  def call
19
- tag "vime-volume-control", process_attrs(dom_attrs)
19
+ content_tag "vm-volume-control", nil, process_attrs(dom_attrs)
20
20
  end
21
21
 
22
22
  def dom_attrs
@@ -8,7 +8,7 @@ module Vime
8
8
  option :use_on_mobile, type: Types::Bool, default: -> { false }
9
9
 
10
10
  def call
11
- tag "vime-dbl-click-fullscreen", process_attrs(dom_attrs)
11
+ content_tag "vm-dbl-click-fullscreen", nil, process_attrs(dom_attrs)
12
12
  end
13
13
 
14
14
  def dom_attrs
@@ -16,7 +16,7 @@ module Vime
16
16
  option :no_spinner, type: Types::Bool, default: -> { false }
17
17
 
18
18
  def call
19
- content_tag "vime-default-ui", content, process_attrs(dom_attrs)
19
+ content_tag "vm-default-ui", content, process_attrs(dom_attrs)
20
20
  end
21
21
 
22
22
  def dom_attrs
data/lib/vime/ui/icon.rb CHANGED
@@ -5,15 +5,15 @@
5
5
  module Vime
6
6
  module Ui
7
7
  class Icon < Component
8
- option :href, type: Types::String, optional: true
8
+ option :src, type: Types::String, optional: true
9
9
 
10
10
  def call
11
- content_tag "vime-icon", content, process_attrs(dom_attrs)
11
+ content_tag "vm-icon", content, process_attrs(dom_attrs)
12
12
  end
13
13
 
14
14
  def dom_attrs
15
15
  super.merge({
16
- href: href,
16
+ src: src,
17
17
  })
18
18
  end
19
19
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @see https://vimejs.com/components/ui/icon-library
4
+
5
+ module Vime
6
+ module Ui
7
+ class IconLibrary < Component
8
+ option :name, type: Types::String, optional: true
9
+
10
+ def call
11
+ content_tag "vm-icons", nil, process_attrs(dom_attrs)
12
+ end
13
+
14
+ def dom_attrs
15
+ super.merge({
16
+ name: name,
17
+ })
18
+ end
19
+ end
20
+ end
21
+ end
@@ -6,7 +6,7 @@ module Vime
6
6
  module Ui
7
7
  class LiveIndicator < Component
8
8
  def call
9
- tag "vime-live-indicator", process_attrs(dom_attrs)
9
+ content_tag "vm-live-indicator", nil, process_attrs(dom_attrs)
10
10
  end
11
11
  end
12
12
  end
@@ -8,7 +8,7 @@ module Vime
8
8
  option :fit, type: Types::String.enum("contain", "cover", "fill", "none", "scale-down"), default: -> { "cover" }
9
9
 
10
10
  def call
11
- tag "vime-poster", process_attrs(dom_attrs)
11
+ content_tag "vm-poster", nil, process_attrs(dom_attrs)
12
12
  end
13
13
 
14
14
  def dom_attrs
data/lib/vime/ui/scrim.rb CHANGED
@@ -8,7 +8,7 @@ module Vime
8
8
  option :gradient, type: Types::String.enum("down", "up").optional, optional: true
9
9
 
10
10
  def call
11
- content_tag "vime-scrim", content, process_attrs(dom_attrs)
11
+ content_tag "vm-scrim", content, process_attrs(dom_attrs)
12
12
  end
13
13
 
14
14
  def dom_attrs
@@ -6,10 +6,10 @@ module Vime
6
6
  module Ui
7
7
  module Settings
8
8
  class DefaultSettings < Component
9
- option :pin, type: Types::Pin, default: -> { "bottomRight" }
9
+ option :pin, type: Types::String.enum("bottomLeft", "bottomRight", "topLeft", "topRight"), default: -> { "bottomRight" }
10
10
 
11
11
  def call
12
- tag "vime-default-settings", process_attrs(dom_attrs)
12
+ content_tag "vm-default-settings", nil, process_attrs(dom_attrs)
13
13
  end
14
14
 
15
15
  def dom_attrs
@@ -11,7 +11,7 @@ module Vime
11
11
  option :identifier, type: Types::String
12
12
 
13
13
  def call
14
- content_tag "vime-menu", content, process_attrs(dom_attrs)
14
+ content_tag "vm-menu", content, process_attrs(dom_attrs)
15
15
  end
16
16
 
17
17
  def dom_attrs
@@ -8,7 +8,7 @@ module Vime
8
8
  class MenuItem < Component
9
9
  option :badge, type: Types::String, optional: true
10
10
  option :checked, type: Types::Bool, optional: true
11
- option :checked_icon, type: Types::String, default: -> { "#vime-checkmark" }
11
+ option :checked_icon, type: Types::String, default: -> { "checkmark" }
12
12
  option :expanded, type: Types::Bool, optional: true
13
13
  option :hidden, type: Types::Bool, default: -> { false }
14
14
  option :hint, type: Types::String, optional: true
@@ -17,7 +17,7 @@ module Vime
17
17
  option :menu, type: Types::String, optional: true
18
18
 
19
19
  def call
20
- tag "vime-menu-item", process_attrs(dom_attrs)
20
+ content_tag "vm-menu-item", nil, process_attrs(dom_attrs)
21
21
  end
22
22
 
23
23
  def dom_attrs
@@ -8,12 +8,12 @@ module Vime
8
8
  class MenuRadio < Component
9
9
  option :badge, type: Types::String, optional: true
10
10
  option :checked, type: Types::Bool, default: -> { false }
11
- option :checked_icon, type: Types::String, default: -> { "#vime-checkmark" }
11
+ option :checked_icon, type: Types::String, default: -> { "checkmark" }
12
12
  option :label, type: Types::String
13
13
  option :value, type: Types::String
14
14
 
15
15
  def call
16
- tag "vime-menu-radio", process_attrs(dom_attrs)
16
+ content_tag "vm-menu-radio", nil, process_attrs(dom_attrs)
17
17
  end
18
18
 
19
19
  def dom_attrs
@@ -9,7 +9,7 @@ module Vime
9
9
  option :value, type: Types::String, optional: true
10
10
 
11
11
  def call
12
- content_tag "vime-menu-radio-group", content, process_attrs(dom_attrs)
12
+ content_tag "vm-menu-radio-group", content, process_attrs(dom_attrs)
13
13
  end
14
14
 
15
15
  def dom_attrs
@@ -8,10 +8,10 @@ module Vime
8
8
  class Settings < Component
9
9
  option :active, type: Types::Bool, default: -> { false }
10
10
  option :controls_height, type: Types::Integer, default: -> { 0 }
11
- option :pin, type: Types::Pin, default: -> { "bottomRight" }
11
+ option :pin, type: Types::String.enum("bottomLeft", "bottomRight", "topLeft", "topRight"), default: -> { "bottomRight" }
12
12
 
13
13
  def call
14
- content_tag "vime-settings", content, process_attrs(dom_attrs)
14
+ content_tag "vm-settings", content, process_attrs(dom_attrs)
15
15
  end
16
16
 
17
17
  def dom_attrs
@@ -12,7 +12,7 @@ module Vime
12
12
  option :label, type: Types::String
13
13
 
14
14
  def call
15
- content_tag "vime-submenu", content, process_attrs(dom_attrs)
15
+ content_tag "vm-submenu", content, process_attrs(dom_attrs)
16
16
  end
17
17
 
18
18
  def dom_attrs
@@ -8,7 +8,7 @@ module Vime
8
8
  option :effect, type: Types::String.enum("none", "sheen"), default: -> { "sheen" }
9
9
 
10
10
  def call
11
- tag "vime-skeleton", process_attrs(dom_attrs)
11
+ content_tag "vm-skeleton", nil, process_attrs(dom_attrs)
12
12
  end
13
13
 
14
14
  def dom_attrs
@@ -13,7 +13,7 @@ module Vime
13
13
  option :value_text, type: Types::String, optional: true
14
14
 
15
15
  def call
16
- tag "vime-slider", process_attrs(dom_attrs)
16
+ content_tag "vm-slider", nil, process_attrs(dom_attrs)
17
17
  end
18
18
 
19
19
  def dom_attrs
@@ -6,7 +6,7 @@ module Vime
6
6
  module Ui
7
7
  class Spinner < Component
8
8
  def call
9
- tag "vime-spinner", process_attrs(dom_attrs)
9
+ content_tag "vm-spinner", nil, process_attrs(dom_attrs)
10
10
  end
11
11
  end
12
12
  end
@@ -9,7 +9,7 @@ module Vime
9
9
  option :always_show_hours, type: Types::Bool, default: -> { false }
10
10
 
11
11
  def call
12
- tag "vime-current-time", process_attrs(dom_attrs)
12
+ content_tag "vm-current-time", nil, process_attrs(dom_attrs)
13
13
  end
14
14
 
15
15
  def dom_attrs
@@ -9,7 +9,7 @@ module Vime
9
9
  option :always_show_hours, type: Types::Bool, default: -> { false }
10
10
 
11
11
  def call
12
- tag "vime-end-time", process_attrs(dom_attrs)
12
+ content_tag "vm-end-time", nil, process_attrs(dom_attrs)
13
13
  end
14
14
 
15
15
  def dom_attrs
@@ -11,7 +11,7 @@ module Vime
11
11
  option :seconds, type: Types::Integer, default: -> { 0 }
12
12
 
13
13
  def call
14
- tag "vime-time", process_attrs(dom_attrs)
14
+ content_tag "vm-time", nil, process_attrs(dom_attrs)
15
15
  end
16
16
 
17
17
  def dom_attrs
@@ -10,7 +10,7 @@ module Vime
10
10
  option :separator, type: Types::String, default: -> { "/" }
11
11
 
12
12
  def call
13
- tag "vime-time-progress", process_attrs(dom_attrs)
13
+ content_tag "vm-time-progress", nil, process_attrs(dom_attrs)
14
14
  end
15
15
 
16
16
  def dom_attrs
@@ -11,7 +11,7 @@ module Vime
11
11
  option :position, type: Types::String.enum("top", "bottom"), default: -> { "top" }
12
12
 
13
13
  def call
14
- content_tag "vime-tooltip", content, process_attrs(dom_attrs)
14
+ content_tag "vm-tooltip", content, process_attrs(dom_attrs)
15
15
  end
16
16
 
17
17
  def dom_attrs
data/lib/vime/ui/ui.rb CHANGED
@@ -6,7 +6,7 @@ module Vime
6
6
  module Ui
7
7
  class Ui < Component
8
8
  def call
9
- content_tag "vime-ui", content, process_attrs(dom_attrs)
9
+ content_tag "vm-ui", content, process_attrs(dom_attrs)
10
10
  end
11
11
  end
12
12
  end
@@ -4,65 +4,18 @@ require "dry-initializer"
4
4
  require "dry-types"
5
5
  require "rails"
6
6
  require "view_component"
7
-
8
- require "vime/component"
9
-
10
- require "vime/core/embed"
11
- require "vime/core/player"
12
- require "vime/core/playground"
13
-
14
- require "vime/providers/audio"
15
- require "vime/providers/dailymotion"
16
- require "vime/providers/dash"
17
- require "vime/providers/file"
18
- require "vime/providers/hls"
19
- require "vime/providers/video"
20
- require "vime/providers/vimeo"
21
- require "vime/providers/youtube"
22
-
23
- require "vime/ui/controls/caption_control"
24
- require "vime/ui/controls/control"
25
- require "vime/ui/controls/control_group"
26
- require "vime/ui/controls/control_spacer"
27
- require "vime/ui/controls/controls"
28
- require "vime/ui/controls/default_controls"
29
- require "vime/ui/controls/fullscreen_control"
30
- require "vime/ui/controls/mute_control"
31
- require "vime/ui/controls/pip_control"
32
- require "vime/ui/controls/playback_control"
33
- require "vime/ui/controls/scrubber_control"
34
- require "vime/ui/controls/settings_control"
35
- require "vime/ui/controls/volume_control"
36
-
37
- require "vime/ui/time/current_time"
38
- require "vime/ui/time/end_time"
39
- require "vime/ui/time/time"
40
- require "vime/ui/time/time_progress"
41
-
42
- require "vime/ui/settings/default_settings"
43
- require "vime/ui/settings/menu"
44
- require "vime/ui/settings/menu_item"
45
- require "vime/ui/settings/menu_radio"
46
- require "vime/ui/settings/menu_radio_group"
47
- require "vime/ui/settings/settings"
48
- require "vime/ui/settings/submenu"
49
-
50
- require "vime/ui/captions"
51
- require "vime/ui/click_to_play"
52
- require "vime/ui/dbl_click_fullscreen"
53
- require "vime/ui/default_ui"
54
- require "vime/ui/icon"
55
- require "vime/ui/icons"
56
- require "vime/ui/live_indicator"
57
- require "vime/ui/poster"
58
- require "vime/ui/scrim"
59
- require "vime/ui/skeleton"
60
- require "vime/ui/slider"
61
- require "vime/ui/spinner"
62
- require "vime/ui/tooltip"
63
- require "vime/ui/ui"
7
+ require "zeitwerk"
64
8
 
65
9
  require "vime_view_components/version"
66
10
 
67
11
  module VimeViewComponents
68
12
  end
13
+
14
+ module Vime
15
+ end
16
+
17
+ Zeitwerk::Loader.new.tap do |loader|
18
+ loader.push_dir("#{__dir__}/vime", namespace: Vime)
19
+ loader.setup
20
+ loader.eager_load
21
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VimeViewComponents
4
- VERSION = "0.1.0"
4
+ VERSION = "5.0.3"
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vime_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 5.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asger Behncke Jacobsen
8
8
  - Tomas Celizna
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-16 00:00:00.000000000 Z
12
+ date: 2021-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-initializer
@@ -59,6 +59,20 @@ dependencies:
59
59
  - - "<"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: zeitwerk
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.4'
69
+ type: :runtime
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.4'
62
76
  - !ruby/object:Gem::Dependency
63
77
  name: minitest
64
78
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +170,7 @@ files:
156
170
  - lib/vime/ui/dbl_click_fullscreen.rb
157
171
  - lib/vime/ui/default_ui.rb
158
172
  - lib/vime/ui/icon.rb
159
- - lib/vime/ui/icons.rb
173
+ - lib/vime/ui/icon_library.rb
160
174
  - lib/vime/ui/live_indicator.rb
161
175
  - lib/vime/ui/poster.rb
162
176
  - lib/vime/ui/scrim.rb
@@ -182,7 +196,7 @@ homepage: https://github.com/asgerb/vime_view_components
182
196
  licenses:
183
197
  - MIT
184
198
  metadata: {}
185
- post_install_message:
199
+ post_install_message:
186
200
  rdoc_options: []
187
201
  require_paths:
188
202
  - lib
@@ -197,8 +211,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
211
  - !ruby/object:Gem::Version
198
212
  version: '0'
199
213
  requirements: []
200
- rubygems_version: 3.0.3
201
- signing_key:
214
+ rubygems_version: 3.1.4
215
+ signing_key:
202
216
  specification_version: 4
203
217
  summary: ViewComponents for vime.js
204
218
  test_files: []
data/lib/vime/ui/icons.rb DELETED
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # @see https://vimejs.com/components/ui/icons
4
-
5
- module Vime
6
- module Ui
7
- class Icons < Component
8
- option :href, type: Types::String, optional: true
9
-
10
- def call
11
- tag "vime-icons", process_attrs(dom_attrs)
12
- end
13
-
14
- def dom_attrs
15
- super.merge({
16
- href: href,
17
- })
18
- end
19
- end
20
- end
21
- end