turbo_power 0.1.6 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +36 -113
- data/README.md +37 -24
- data/lib/turbo_power/attribute_transformations.rb +28 -0
- data/lib/turbo_power/stream_helper.rb +43 -23
- data/lib/turbo_power/version.rb +1 -1
- data/lib/turbo_power.rb +1 -1
- data/turbo_power.gemspec +0 -1
- metadata +4 -18
- data/turbo_power-0.1.5.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d0cf2328b31e22e539408a960588cbd9ce68297ed1ac36f74dce79c1be8d121
|
4
|
+
data.tar.gz: 314ea1dd8efaae21dde0b4b0e7a6e8654d744ec31e01920d87cb5fc862c4175a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1195a4d9057abdf92df80452176ad592b5966e35e567fe57e38ac135240c1c6053397c041788a7ead9478e39bc3eee9cc2c7373c9ed2851dbf886d34de6731e
|
7
|
+
data.tar.gz: 95a088485d9674e56a123f6c5a67da38b6d748e058ce8a0bb7c730568bb6c58001d8b385dc4f38fed8dba80ac62087f729aeb95777bbecfe0d7b7227aa119dd5
|
data/Gemfile.lock
CHANGED
@@ -1,146 +1,75 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
turbo_power (0.
|
4
|
+
turbo_power (0.2.0)
|
5
5
|
turbo-rails (~> 1.3.0)
|
6
|
-
turbo_ready
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
10
9
|
specs:
|
11
|
-
|
12
|
-
|
13
|
-
activesupport (= 7.0.4)
|
14
|
-
nio4r (~> 2.0)
|
15
|
-
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailbox (7.0.4)
|
17
|
-
actionpack (= 7.0.4)
|
18
|
-
activejob (= 7.0.4)
|
19
|
-
activerecord (= 7.0.4)
|
20
|
-
activestorage (= 7.0.4)
|
21
|
-
activesupport (= 7.0.4)
|
22
|
-
mail (>= 2.7.1)
|
23
|
-
net-imap
|
24
|
-
net-pop
|
25
|
-
net-smtp
|
26
|
-
actionmailer (7.0.4)
|
27
|
-
actionpack (= 7.0.4)
|
28
|
-
actionview (= 7.0.4)
|
29
|
-
activejob (= 7.0.4)
|
30
|
-
activesupport (= 7.0.4)
|
31
|
-
mail (~> 2.5, >= 2.5.4)
|
32
|
-
net-imap
|
33
|
-
net-pop
|
34
|
-
net-smtp
|
35
|
-
rails-dom-testing (~> 2.0)
|
36
|
-
actionpack (7.0.4)
|
37
|
-
actionview (= 7.0.4)
|
38
|
-
activesupport (= 7.0.4)
|
10
|
+
actionpack (7.0.4.2)
|
11
|
+
actionview (= 7.0.4.2)
|
12
|
+
activesupport (= 7.0.4.2)
|
39
13
|
rack (~> 2.0, >= 2.2.0)
|
40
14
|
rack-test (>= 0.6.3)
|
41
15
|
rails-dom-testing (~> 2.0)
|
42
16
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
43
|
-
|
44
|
-
|
45
|
-
activerecord (= 7.0.4)
|
46
|
-
activestorage (= 7.0.4)
|
47
|
-
activesupport (= 7.0.4)
|
48
|
-
globalid (>= 0.6.0)
|
49
|
-
nokogiri (>= 1.8.5)
|
50
|
-
actionview (7.0.4)
|
51
|
-
activesupport (= 7.0.4)
|
17
|
+
actionview (7.0.4.2)
|
18
|
+
activesupport (= 7.0.4.2)
|
52
19
|
builder (~> 3.1)
|
53
20
|
erubi (~> 1.4)
|
54
21
|
rails-dom-testing (~> 2.0)
|
55
22
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
56
|
-
activejob (7.0.4)
|
57
|
-
activesupport (= 7.0.4)
|
23
|
+
activejob (7.0.4.2)
|
24
|
+
activesupport (= 7.0.4.2)
|
58
25
|
globalid (>= 0.3.6)
|
59
|
-
|
60
|
-
activesupport (= 7.0.4)
|
61
|
-
activerecord (7.0.4)
|
62
|
-
activemodel (= 7.0.4)
|
63
|
-
activesupport (= 7.0.4)
|
64
|
-
activestorage (7.0.4)
|
65
|
-
actionpack (= 7.0.4)
|
66
|
-
activejob (= 7.0.4)
|
67
|
-
activerecord (= 7.0.4)
|
68
|
-
activesupport (= 7.0.4)
|
69
|
-
marcel (~> 1.0)
|
70
|
-
mini_mime (>= 1.1.0)
|
71
|
-
activesupport (7.0.4)
|
26
|
+
activesupport (7.0.4.2)
|
72
27
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
73
28
|
i18n (>= 1.6, < 2)
|
74
29
|
minitest (>= 5.1)
|
75
30
|
tzinfo (~> 2.0)
|
76
31
|
ast (2.4.2)
|
77
32
|
builder (3.2.4)
|
78
|
-
concurrent-ruby (1.
|
33
|
+
concurrent-ruby (1.2.0)
|
79
34
|
crass (1.0.6)
|
80
|
-
erubi (1.
|
81
|
-
globalid (1.
|
35
|
+
erubi (1.12.0)
|
36
|
+
globalid (1.1.0)
|
82
37
|
activesupport (>= 5.0)
|
83
38
|
i18n (1.12.0)
|
84
39
|
concurrent-ruby (~> 1.0)
|
85
|
-
json (2.6.
|
86
|
-
loofah (2.19.
|
40
|
+
json (2.6.3)
|
41
|
+
loofah (2.19.1)
|
87
42
|
crass (~> 1.0.2)
|
88
43
|
nokogiri (>= 1.5.9)
|
89
|
-
mail (2.7.1)
|
90
|
-
mini_mime (>= 0.1.1)
|
91
|
-
marcel (1.0.2)
|
92
44
|
method_source (1.0.0)
|
93
|
-
|
94
|
-
minitest (5.
|
95
|
-
|
96
|
-
net-protocol
|
97
|
-
net-pop (0.1.2)
|
98
|
-
net-protocol
|
99
|
-
net-protocol (0.1.3)
|
100
|
-
timeout
|
101
|
-
net-smtp (0.3.3)
|
102
|
-
net-protocol
|
103
|
-
nio4r (2.5.8)
|
104
|
-
nokogiri (1.13.9-x86_64-darwin)
|
45
|
+
mini_portile2 (2.8.1)
|
46
|
+
minitest (5.17.0)
|
47
|
+
nokogiri (1.14.1-x86_64-darwin)
|
105
48
|
racc (~> 1.4)
|
106
49
|
parallel (1.22.1)
|
107
|
-
parser (3.1.
|
50
|
+
parser (3.1.3.0)
|
108
51
|
ast (~> 2.4.1)
|
109
|
-
racc (1.6.
|
110
|
-
rack (2.2.
|
52
|
+
racc (1.6.2)
|
53
|
+
rack (2.2.6.2)
|
111
54
|
rack-test (2.0.2)
|
112
55
|
rack (>= 1.3)
|
113
|
-
rails (7.0.4)
|
114
|
-
actioncable (= 7.0.4)
|
115
|
-
actionmailbox (= 7.0.4)
|
116
|
-
actionmailer (= 7.0.4)
|
117
|
-
actionpack (= 7.0.4)
|
118
|
-
actiontext (= 7.0.4)
|
119
|
-
actionview (= 7.0.4)
|
120
|
-
activejob (= 7.0.4)
|
121
|
-
activemodel (= 7.0.4)
|
122
|
-
activerecord (= 7.0.4)
|
123
|
-
activestorage (= 7.0.4)
|
124
|
-
activesupport (= 7.0.4)
|
125
|
-
bundler (>= 1.15.0)
|
126
|
-
railties (= 7.0.4)
|
127
56
|
rails-dom-testing (2.0.3)
|
128
57
|
activesupport (>= 4.2.0)
|
129
58
|
nokogiri (>= 1.6)
|
130
|
-
rails-html-sanitizer (1.
|
131
|
-
loofah (~> 2.
|
132
|
-
railties (7.0.4)
|
133
|
-
actionpack (= 7.0.4)
|
134
|
-
activesupport (= 7.0.4)
|
59
|
+
rails-html-sanitizer (1.5.0)
|
60
|
+
loofah (~> 2.19, >= 2.19.1)
|
61
|
+
railties (7.0.4.2)
|
62
|
+
actionpack (= 7.0.4.2)
|
63
|
+
activesupport (= 7.0.4.2)
|
135
64
|
method_source
|
136
65
|
rake (>= 12.2)
|
137
66
|
thor (~> 1.0)
|
138
67
|
zeitwerk (~> 2.5)
|
139
68
|
rainbow (3.1.1)
|
140
69
|
rake (13.0.6)
|
141
|
-
regexp_parser (2.6.
|
70
|
+
regexp_parser (2.6.1)
|
142
71
|
rexml (3.2.5)
|
143
|
-
rubocop (1.
|
72
|
+
rubocop (1.41.1)
|
144
73
|
json (~> 2.3)
|
145
74
|
parallel (~> 1.10)
|
146
75
|
parser (>= 3.1.2.1)
|
@@ -150,33 +79,27 @@ GEM
|
|
150
79
|
rubocop-ast (>= 1.23.0, < 2.0)
|
151
80
|
ruby-progressbar (~> 1.7)
|
152
81
|
unicode-display_width (>= 1.4.0, < 3.0)
|
153
|
-
rubocop-ast (1.
|
82
|
+
rubocop-ast (1.24.0)
|
154
83
|
parser (>= 3.1.1.0)
|
155
84
|
ruby-progressbar (1.11.0)
|
156
|
-
sprockets (4.
|
85
|
+
sprockets (4.2.0)
|
157
86
|
concurrent-ruby (~> 1.0)
|
158
|
-
rack (
|
87
|
+
rack (>= 2.2.4, < 4)
|
159
88
|
sprockets-rails (3.4.2)
|
160
89
|
actionpack (>= 5.2)
|
161
90
|
activesupport (>= 5.2)
|
162
91
|
sprockets (>= 3.0.0)
|
163
|
-
sqlite3 (1.5.
|
92
|
+
sqlite3 (1.5.4)
|
93
|
+
mini_portile2 (~> 2.8.0)
|
164
94
|
thor (1.2.1)
|
165
|
-
|
166
|
-
turbo-rails (1.3.2)
|
95
|
+
turbo-rails (1.3.3)
|
167
96
|
actionpack (>= 6.0.0)
|
168
97
|
activejob (>= 6.0.0)
|
169
98
|
railties (>= 6.0.0)
|
170
|
-
|
171
|
-
rails (>= 6.1)
|
172
|
-
turbo-rails (>= 1.1)
|
173
|
-
tzinfo (2.0.5)
|
99
|
+
tzinfo (2.0.6)
|
174
100
|
concurrent-ruby (~> 1.0)
|
175
101
|
unicode-display_width (2.3.0)
|
176
|
-
|
177
|
-
websocket-extensions (>= 0.1.0)
|
178
|
-
websocket-extensions (0.1.5)
|
179
|
-
zeitwerk (2.6.6)
|
102
|
+
zeitwerk (2.6.7)
|
180
103
|
|
181
104
|
PLATFORMS
|
182
105
|
x86_64-darwin-19
|
@@ -189,4 +112,4 @@ DEPENDENCIES
|
|
189
112
|
turbo_power!
|
190
113
|
|
191
114
|
BUNDLED WITH
|
192
|
-
2.
|
115
|
+
2.4.1
|
data/README.md
CHANGED
@@ -68,9 +68,7 @@ pin "application", preload: true
|
|
68
68
|
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
|
69
69
|
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
|
70
70
|
- pin "@hotwired/turbo", to: "https://ga.jspm.io/npm:@hotwired/turbo@7.2.0/dist/turbo.es2017-esm.js"
|
71
|
-
pin "turbo_power", to: "https://ga.jspm.io/npm:turbo_power@0.1.
|
72
|
-
+ // or use the bundled script shipped with the `turbo_power` gem
|
73
|
-
+ pin "turbo_power", to: "turbo_power.js"
|
71
|
+
pin "turbo_power", to: "https://ga.jspm.io/npm:turbo_power@0.1.6/dist/index.js"
|
74
72
|
```
|
75
73
|
|
76
74
|
**app/javascript/application.js**
|
@@ -85,26 +83,18 @@ import 'controllers'
|
|
85
83
|
**Note:** These modifications will continue to work when upgrading Turbo via the [turbo-rails](https://github.com/hotwired/turbo-rails) gem. You can [read more](https://github.com/marcoroth/turbo_power-rails/issues/2) for the reasoning behind these adjustments.
|
86
84
|
|
87
85
|
|
88
|
-
##
|
89
|
-
|
90
|
-
### Actions from `turbo_ready`
|
91
|
-
|
92
|
-
* [`turbo_stream.invoke(method, *args, selector: nil, camelize: true, id: nil)`](https://github.com/hopsoft/turbo_ready)
|
93
|
-
|
94
|
-
### Actions from `turbo-morph`
|
95
|
-
|
96
|
-
* [`turbo_stream.morph(target, html = nil, **attributes, &block)`](https://github.com/marcoroth/turbo-morph)
|
86
|
+
## Custom Actions
|
97
87
|
|
98
88
|
### DOM Actions
|
99
89
|
|
100
90
|
* `turbo_stream.graft(target, parent, **attributes)`
|
91
|
+
* [`turbo_stream.morph(target, html = nil, **attributes, &block)`](https://github.com/marcoroth/turbo-morph)
|
101
92
|
* `turbo_stream.inner_html(target, html = nil, **attributes, &block)`
|
102
93
|
* `turbo_stream.insert_adjacent_html(target, html = nil, position: 'beforeend', **attributes, &block)`
|
103
94
|
* `turbo_stream.insert_adjacent_text(target, text, position: 'beforebegin', **attributes)`
|
104
|
-
* `turbo_stream.morph(target, html = nil, **attribtues, &block)`
|
105
95
|
* `turbo_stream.outer_html(target, html = nil, **attributes, &block)`
|
106
96
|
* `turbo_stream.text_content(target, text, **attributes)`
|
107
|
-
* `turbo_stream.set_meta(name, content
|
97
|
+
* `turbo_stream.set_meta(name, content)`
|
108
98
|
|
109
99
|
|
110
100
|
### Attribute Actions
|
@@ -125,6 +115,11 @@ import 'controllers'
|
|
125
115
|
* `turbo_stream.dispatch_event(target, name, detail: {}, **attributes)`
|
126
116
|
|
127
117
|
|
118
|
+
### Form Actions
|
119
|
+
|
120
|
+
* `turbo_stream.reset_form(target, **attributes)`
|
121
|
+
|
122
|
+
|
128
123
|
### Storage Actions
|
129
124
|
|
130
125
|
* `turbo_stream.clear_storage(type, **attributes)`
|
@@ -140,14 +135,16 @@ import 'controllers'
|
|
140
135
|
|
141
136
|
### Browser Actions
|
142
137
|
|
143
|
-
* `turbo_stream.redirect_to(url, action_name = nil, **attributes)`
|
144
138
|
* `turbo_stream.reload(**attributes)`
|
145
|
-
* `turbo_stream.scroll_into_view(target, inline = "nearest"
|
146
|
-
* `turbo_stream.set_cookie(cookie, **attributes)`
|
147
|
-
* `turbo_stream.set_cookie_item(key, value, **attributes)`
|
139
|
+
* `turbo_stream.scroll_into_view(target, inline = "nearest")`
|
148
140
|
* `turbo_stream.set_focus(target, **attributes)`
|
149
141
|
* `turbo_stream.set_title(title, **attributes)`
|
150
|
-
|
142
|
+
|
143
|
+
|
144
|
+
### Document Actions
|
145
|
+
|
146
|
+
* `turbo_stream.set_cookie(cookie, **attributes)`
|
147
|
+
* `turbo_stream.set_cookie_item(key, value, **attributes)`
|
151
148
|
|
152
149
|
|
153
150
|
### Browser History Actions
|
@@ -159,17 +156,33 @@ import 'controllers'
|
|
159
156
|
|
160
157
|
### Debug Actions
|
161
158
|
|
162
|
-
* `turbo_stream.console_log(message, level =
|
163
|
-
* `turbo_stream.console_table(data, columns
|
159
|
+
* `turbo_stream.console_log(message, level = :log)`
|
160
|
+
* `turbo_stream.console_table(data, columns)`
|
161
|
+
|
164
162
|
|
165
163
|
### Notification Actions
|
166
164
|
|
167
|
-
* `turbo_stream.notification(title, options
|
165
|
+
* `turbo_stream.notification(title, **options)`
|
166
|
+
|
167
|
+
|
168
|
+
### Turbo Actions
|
169
|
+
|
170
|
+
* `turbo_stream.redirect_to(url, turbo_action = nil, **attributes)`
|
171
|
+
* `turbo_stream.turbo_clear_cache()`
|
172
|
+
|
173
|
+
|
174
|
+
### Turbo Progress Bar Actions
|
175
|
+
|
176
|
+
* `turbo_stream.turbo_progress_bar_show()`
|
177
|
+
* `turbo_stream.turbo_progress_bar_hide()`
|
178
|
+
* `turbo_stream.turbo_progress_bar_set_value(value)`
|
179
|
+
|
168
180
|
|
169
181
|
### Turbo Frame Actions
|
170
182
|
|
171
|
-
* `turbo_stream.turbo_frame_reload(frame_id
|
172
|
-
* `turbo_stream.turbo_frame_set_src(frame_id, src
|
183
|
+
* `turbo_stream.turbo_frame_reload(frame_id)`
|
184
|
+
* `turbo_stream.turbo_frame_set_src(frame_id, src)`
|
185
|
+
|
173
186
|
|
174
187
|
## Development
|
175
188
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TurboPower
|
4
|
+
module AttributeTransformations
|
5
|
+
private
|
6
|
+
|
7
|
+
def transform_attributes(attributes)
|
8
|
+
attributes
|
9
|
+
.transform_keys { |key| transform_key(key) }
|
10
|
+
.transform_values { |value| transform_value(value) }
|
11
|
+
end
|
12
|
+
|
13
|
+
def transform_key(key)
|
14
|
+
key.to_s.underscore.dasherize.to_sym
|
15
|
+
end
|
16
|
+
|
17
|
+
def transform_value(value)
|
18
|
+
case value
|
19
|
+
when String
|
20
|
+
value
|
21
|
+
when NilClass
|
22
|
+
""
|
23
|
+
else
|
24
|
+
value.to_json
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -2,21 +2,19 @@
|
|
2
2
|
|
3
3
|
module TurboPower
|
4
4
|
module StreamHelper
|
5
|
+
include ::TurboPower::AttributeTransformations
|
6
|
+
|
5
7
|
# Custom Action Helpers
|
6
8
|
|
7
9
|
## Also see:
|
8
10
|
## => https://github.com/hotwired/turbo-rails/pull/374
|
9
11
|
|
10
|
-
def custom_action(name, target: nil, content: nil,
|
11
|
-
|
12
|
-
|
13
|
-
turbo_stream_action_tag name, target: target, template: template, **attributes
|
12
|
+
def custom_action(name, target: nil, content: nil, attributes: {})
|
13
|
+
turbo_stream_action_tag name, target: target, template: content, **transform_attributes(attributes)
|
14
14
|
end
|
15
15
|
|
16
|
-
def custom_action_all(name, targets: nil, content: nil,
|
17
|
-
|
18
|
-
|
19
|
-
turbo_stream_action_tag name, targets: targets, template: template, **attributes
|
16
|
+
def custom_action_all(name, targets: nil, content: nil, attributes: {})
|
17
|
+
turbo_stream_action_tag name, targets: targets, template: content, **transform_attributes(attributes)
|
20
18
|
end
|
21
19
|
|
22
20
|
# DOM Actions
|
@@ -75,8 +73,8 @@ module TurboPower
|
|
75
73
|
custom_action_all :set_dataset_attribute, targets: target, attributes: attributes.merge(attribute: attribute, value: value)
|
76
74
|
end
|
77
75
|
|
78
|
-
def set_property(target,
|
79
|
-
custom_action_all :set_property, targets: target, attributes: attributes.merge(
|
76
|
+
def set_property(target, name, value, **attributes)
|
77
|
+
custom_action_all :set_property, targets: target, attributes: attributes.merge(name: name, value: value)
|
80
78
|
end
|
81
79
|
|
82
80
|
def set_style(target, name, value, **attributes)
|
@@ -88,7 +86,7 @@ module TurboPower
|
|
88
86
|
end
|
89
87
|
|
90
88
|
def set_value(target, value, **attributes)
|
91
|
-
custom_action_all :set_value, targets: target,
|
89
|
+
custom_action_all :set_value, targets: target, attributes: attributes.merge(value: value)
|
92
90
|
end
|
93
91
|
|
94
92
|
# Event Actions
|
@@ -97,6 +95,12 @@ module TurboPower
|
|
97
95
|
custom_action_all :dispatch_event, targets: target, attributes: attributes.merge(name: name), content: detail.to_json
|
98
96
|
end
|
99
97
|
|
98
|
+
# Form Actions
|
99
|
+
|
100
|
+
def reset_form(target, **attributes)
|
101
|
+
custom_action_all :reset_form, targets: target, attributes: attributes
|
102
|
+
end
|
103
|
+
|
100
104
|
# Storage Actions
|
101
105
|
|
102
106
|
def clear_storage(type, **attributes)
|
@@ -137,10 +141,6 @@ module TurboPower
|
|
137
141
|
|
138
142
|
# Browser Actions
|
139
143
|
|
140
|
-
def redirect_to(url, action_name = nil, **attributes)
|
141
|
-
custom_action :redirect_to, attributes: attributes.merge(url: url, action: action_name)
|
142
|
-
end
|
143
|
-
|
144
144
|
def reload(**attributes)
|
145
145
|
custom_action :reload, attributes: attributes
|
146
146
|
end
|
@@ -153,8 +153,8 @@ module TurboPower
|
|
153
153
|
custom_action :set_cookie, attributes: attributes.merge(cookie: cookie)
|
154
154
|
end
|
155
155
|
|
156
|
-
def set_cookie_item(key, value, **attributes)
|
157
|
-
custom_action :set_cookie_item, attributes:
|
156
|
+
def set_cookie_item(key = nil, value = nil, **attributes)
|
157
|
+
custom_action :set_cookie_item, attributes: { key: key, value: value }.merge(attributes)
|
158
158
|
end
|
159
159
|
|
160
160
|
def set_focus(target, **attributes)
|
@@ -165,10 +165,6 @@ module TurboPower
|
|
165
165
|
custom_action :set_title, attributes: attributes.merge(title: title)
|
166
166
|
end
|
167
167
|
|
168
|
-
def turbo_clear_cache(**attributes)
|
169
|
-
custom_action :turbo_clear_cache, attributes: attributes
|
170
|
-
end
|
171
|
-
|
172
168
|
# Browser History Actions
|
173
169
|
|
174
170
|
def history_go(delta, **attributes)
|
@@ -195,8 +191,32 @@ module TurboPower
|
|
195
191
|
|
196
192
|
# Notification Actions
|
197
193
|
|
198
|
-
def notification(title
|
199
|
-
custom_action :notification, attributes:
|
194
|
+
def notification(title = nil, **attributes)
|
195
|
+
custom_action :notification, attributes: { title: title }.merge(attributes)
|
196
|
+
end
|
197
|
+
|
198
|
+
# Turbo Actions
|
199
|
+
|
200
|
+
def redirect_to(url = nil, turbo_action = "advance", **attributes)
|
201
|
+
custom_action :redirect_to, attributes: { url: url, turbo_action: turbo_action }.merge(attributes)
|
202
|
+
end
|
203
|
+
|
204
|
+
def turbo_clear_cache(**attributes)
|
205
|
+
custom_action :turbo_clear_cache, attributes: attributes
|
206
|
+
end
|
207
|
+
|
208
|
+
# Turbo Progress Bar Actions
|
209
|
+
|
210
|
+
def turbo_progress_bar_show(**attributes)
|
211
|
+
custom_action :turbo_progress_bar_show, attributes: attributes
|
212
|
+
end
|
213
|
+
|
214
|
+
def turbo_progress_bar_hide(**attributes)
|
215
|
+
custom_action :turbo_progress_bar_hide, attributes: attributes
|
216
|
+
end
|
217
|
+
|
218
|
+
def turbo_progress_bar_set_value(value, **attributes)
|
219
|
+
custom_action :turbo_progress_bar_set_value, attributes: attributes.merge(value: value)
|
200
220
|
end
|
201
221
|
|
202
222
|
# Turbo Frame Actions
|
data/lib/turbo_power/version.rb
CHANGED
data/lib/turbo_power.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "turbo-rails"
|
4
|
-
require "turbo_ready"
|
5
4
|
|
6
5
|
require_relative "turbo_power/version"
|
7
6
|
require_relative "turbo_power/engine"
|
7
|
+
require_relative "turbo_power/attribute_transformations"
|
8
8
|
require_relative "turbo_power/stream_helper"
|
9
9
|
|
10
10
|
module TurboPower
|
data/turbo_power.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbo_power
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Roth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: turbo-rails
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.3.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: turbo_ready
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
description: Power-pack for Turbo Streams
|
42
28
|
email:
|
43
29
|
- marco.roth@hey.com
|
@@ -55,10 +41,10 @@ files:
|
|
55
41
|
- bin/console
|
56
42
|
- bin/setup
|
57
43
|
- lib/turbo_power.rb
|
44
|
+
- lib/turbo_power/attribute_transformations.rb
|
58
45
|
- lib/turbo_power/engine.rb
|
59
46
|
- lib/turbo_power/stream_helper.rb
|
60
47
|
- lib/turbo_power/version.rb
|
61
|
-
- turbo_power-0.1.5.gem
|
62
48
|
- turbo_power.gemspec
|
63
49
|
homepage: https://github.com/marcoroth/turbo_power-rails
|
64
50
|
licenses:
|
@@ -83,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
69
|
- !ruby/object:Gem::Version
|
84
70
|
version: '0'
|
85
71
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
72
|
+
rubygems_version: 3.4.1
|
87
73
|
signing_key:
|
88
74
|
specification_version: 4
|
89
75
|
summary: Power-pack for Turbo Streams
|
data/turbo_power-0.1.5.gem
DELETED
Binary file
|