svelte-on-rails 9.1.5 → 9.2.0
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.
- checksums.yaml +4 -4
- data/lib/svelte_on_rails/view_helpers.rb +0 -52
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29336b36bac6fdb46a03d1f4806e3fb9d9ea92eb91aec0b78abbb6810262b76d
|
|
4
|
+
data.tar.gz: 7cbd43c3707681f0282c34141447b33f3da1466e40ab10cd5a479c4a9ea614f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d4b1d6084a23a47553727180bb9b837295b4b2782dd9918b7929589515948e3a435f048512199deee38aaaea58794426663dfdc3636c0edeaeeca80a5003563
|
|
7
|
+
data.tar.gz: 8ffec7a7924fb19d2411dd09a3741fe050669806121e5340d0e34aa86f447c69364ad54baaad5e057bc04c26635912a3cf12b76cc2fbfb8d448d969e4caeb5f2
|
|
@@ -2,30 +2,6 @@
|
|
|
2
2
|
module SvelteOnRails
|
|
3
3
|
module ViewHelpers
|
|
4
4
|
|
|
5
|
-
def svelte_component_ruby2(path, *args)
|
|
6
|
-
|
|
7
|
-
props, html, options = validate_ruby2_props(args)
|
|
8
|
-
|
|
9
|
-
support = SvelteOnRails::Lib::ViewHelperSupport.new(path, props, html, options, request, false)
|
|
10
|
-
|
|
11
|
-
support.render(self) do
|
|
12
|
-
render_component(support)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def cached_svelte_component_ruby2(path, *args)
|
|
18
|
-
|
|
19
|
-
props, html, options = validate_ruby2_props(args)
|
|
20
|
-
|
|
21
|
-
support = SvelteOnRails::Lib::ViewHelperSupport.new(path, props, html, options, request, true)
|
|
22
|
-
|
|
23
|
-
support.render_cached(self) do
|
|
24
|
-
render_component(support)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
|
|
29
5
|
def svelte_component(path, props = {}, html: {}, options: {})
|
|
30
6
|
|
|
31
7
|
support = SvelteOnRails::Lib::ViewHelperSupport.new(path, props, html, options, request, false)
|
|
@@ -65,33 +41,5 @@ module SvelteOnRails
|
|
|
65
41
|
end
|
|
66
42
|
end
|
|
67
43
|
|
|
68
|
-
def validate_ruby2_props(args)
|
|
69
|
-
last_is_kwargs = false
|
|
70
|
-
kw_err = false
|
|
71
|
-
|
|
72
|
-
if args.length > 2
|
|
73
|
-
kw_err = true
|
|
74
|
-
elsif args.length >= 1
|
|
75
|
-
if (args.last.keys & [:html, :options]).present?
|
|
76
|
-
last_is_kwargs = true
|
|
77
|
-
if (args.last.keys - [:html, :options]).present?
|
|
78
|
-
kw_err = true
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
if kw_err
|
|
84
|
-
raise "Invalid arguments: First argument can be a hash as svelte-properties, second and third arguments are keyword arguments: :html and/or :options"
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
first_is_props = args.length == 1 && !last_is_kwargs || args.length == 2
|
|
88
|
-
|
|
89
|
-
[
|
|
90
|
-
(first_is_props ? args.first : nil),
|
|
91
|
-
(last_is_kwargs ? args[1][:html] || {} : {}),
|
|
92
|
-
(last_is_kwargs ? args[1][:options] : {}),
|
|
93
|
-
]
|
|
94
|
-
end
|
|
95
|
-
|
|
96
44
|
end
|
|
97
45
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: svelte-on-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 9.
|
|
4
|
+
version: 9.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christian Sedlmair
|
|
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
111
111
|
requirements:
|
|
112
112
|
- - ">="
|
|
113
113
|
- !ruby/object:Gem::Version
|
|
114
|
-
version: '
|
|
114
|
+
version: '3.0'
|
|
115
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
requirements:
|
|
117
117
|
- - ">="
|
|
@@ -121,5 +121,5 @@ requirements: []
|
|
|
121
121
|
rubygems_version: 3.6.7
|
|
122
122
|
specification_version: 4
|
|
123
123
|
summary: Seamless integration of Svelte components in Rails. With server-side rendering
|
|
124
|
-
and caching, built on top of
|
|
124
|
+
and caching, built on top of vite_rails.
|
|
125
125
|
test_files: []
|