plutonium 0.22.0 → 0.23.1
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/app/assets/plutonium.css +2 -2
- data/app/views/resource/interactive_resource_action.html.erb +1 -5
- data/app/views/rodauth/create_account.html.erb +1 -2
- data/config/initializers/sqlite_json_alias.rb +8 -0
- data/lib/active_model/validations/attached_validator.rb +1 -1
- data/lib/active_model/validations/url_validator.rb +1 -1
- data/lib/plutonium/resource/controllers/crud_actions/index_action.rb +1 -1
- data/lib/plutonium/ui/component/behaviour.rb +2 -0
- data/lib/plutonium/ui/component/tokens.rb +58 -0
- data/lib/plutonium/ui/dyna_frame/content.rb +1 -1
- data/lib/plutonium/ui/form/base.rb +1 -0
- data/lib/plutonium/ui/form/theme.rb +2 -1
- data/lib/plutonium/ui/layout/base.rb +1 -1
- data/lib/plutonium/ui/layout/resource_layout.rb +2 -2
- data/lib/plutonium/ui/page/edit.rb +1 -1
- data/lib/plutonium/ui/page/index.rb +1 -1
- data/lib/plutonium/ui/page/interactive_action.rb +1 -1
- data/lib/plutonium/ui/page/new.rb +1 -1
- data/lib/plutonium/ui/page/show.rb +1 -1
- data/lib/plutonium/ui/panel.rb +2 -6
- data/lib/plutonium/version.rb +1 -1
- data/src/css/core.css +13 -10
- data/src/css/easymde.css +1048 -572
- data/src/css/plutonium.entry.css +6 -15
- data/src/css/slim_select.css +227 -247
- data/tailwind.options.js +0 -1
- metadata +30 -45
- data/config/initializers/simple_form.rb +0 -74
- data/lib/plutonium/simple_form/attachment_component.rb +0 -85
- data/lib/plutonium/simple_form/input_group_component.rb +0 -17
@@ -1,5 +1 @@
|
|
1
|
-
<%=
|
2
|
-
|
3
|
-
<%= render_component :dyna_frame_content do %>
|
4
|
-
<%= render "interactive_action_form", interactive_action: current_interactive_action %>
|
5
|
-
<% end %>
|
1
|
+
<%= render current_definition.interactive_action_page_class.new %>
|
@@ -140,10 +140,9 @@
|
|
140
140
|
end %>
|
141
141
|
</div>
|
142
142
|
<% end %>
|
143
|
+
<%= render "password_visibility" %>
|
143
144
|
<% end %>
|
144
145
|
|
145
|
-
<%= render "password_visibility" %>
|
146
|
-
|
147
146
|
<%= form.submit rodauth.create_account_button,
|
148
147
|
class:
|
149
148
|
"w-full text-white bg-primary-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" %>
|
@@ -10,7 +10,7 @@ module ActiveModel
|
|
10
10
|
#
|
11
11
|
class AttachedValidator < EachValidator
|
12
12
|
def validate_each(record, attribute, value)
|
13
|
-
record.errors.add(attribute,
|
13
|
+
record.errors.add(attribute, options[:message] || "must be attached") unless value.attached?
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -43,7 +43,7 @@ module ActiveModel
|
|
43
43
|
return true unless options[:image].present?
|
44
44
|
return true unless FastImage.type(value).nil?
|
45
45
|
|
46
|
-
record.errors.add(attribute,
|
46
|
+
record.errors.add(attribute, options[:message] || "is not a valid image URL")
|
47
47
|
false
|
48
48
|
end
|
49
49
|
end
|
@@ -14,7 +14,7 @@ module Plutonium
|
|
14
14
|
def filtered_resource_collection
|
15
15
|
query_params = current_definition
|
16
16
|
.query_form.new(nil, query_object: current_query_object, page_size: nil)
|
17
|
-
.extract_input(params)[:q]
|
17
|
+
.extract_input(params, view_context:)[:q]
|
18
18
|
|
19
19
|
base_query = current_authorized_scope
|
20
20
|
current_query_object.apply(base_query, query_params)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Plutonium
|
4
|
+
module UI
|
5
|
+
module Component
|
6
|
+
module Tokens
|
7
|
+
def classes(*tokens, **conditional_tokens)
|
8
|
+
tokens = self.tokens(*tokens, **conditional_tokens)
|
9
|
+
|
10
|
+
if tokens.empty?
|
11
|
+
{}
|
12
|
+
else
|
13
|
+
{class: tokens}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def tokens(*tokens, **conditional_tokens)
|
18
|
+
conditional_tokens.each do |condition, token|
|
19
|
+
truthy = case condition
|
20
|
+
when Symbol then send(condition)
|
21
|
+
when Proc then condition.call
|
22
|
+
else raise ArgumentError, "The class condition must be a Symbol or a Proc."
|
23
|
+
end
|
24
|
+
|
25
|
+
if truthy
|
26
|
+
case token
|
27
|
+
when Hash then __append_token__(tokens, token[:then])
|
28
|
+
else __append_token__(tokens, token)
|
29
|
+
end
|
30
|
+
else
|
31
|
+
case token
|
32
|
+
when Hash then __append_token__(tokens, token[:else])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
tokens = tokens.select(&:itself).join(" ")
|
38
|
+
tokens.strip!
|
39
|
+
tokens.gsub!(/\s+/, " ")
|
40
|
+
tokens
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def __append_token__(tokens, token)
|
46
|
+
case token
|
47
|
+
when nil then nil
|
48
|
+
when String then tokens << token
|
49
|
+
when Symbol then tokens << token.name
|
50
|
+
when Array then tokens.concat(token)
|
51
|
+
else raise ArgumentError,
|
52
|
+
"Conditional classes must be Symbols, Strings, or Arrays of Symbols or Strings."
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -21,7 +21,7 @@ module Plutonium
|
|
21
21
|
valid_label: "text-green-700 dark:text-green-500",
|
22
22
|
neutral_label: "text-gray-500 dark:text-gray-400",
|
23
23
|
# input themes
|
24
|
-
input: "w-full p-2 border rounded-md shadow-sm font-medium text-sm dark:bg-gray-700",
|
24
|
+
input: "w-full p-2 border rounded-md shadow-sm font-medium text-sm dark:bg-gray-700 focus:ring-2",
|
25
25
|
invalid_input: "bg-red-50 border-red-500 dark:border-red-500 text-red-900 dark:text-red-500 placeholder-red-700 dark:placeholder-red-500 focus:ring-red-500 focus:border-red-500",
|
26
26
|
valid_input: "bg-green-50 border-green-500 dark:border-green-500 text-green-900 dark:text-green-400 placeholder-green-700 dark:placeholder-green-500 focus:ring-green-500 focus:border-green-500",
|
27
27
|
neutral_input: "border-gray-300 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white focus:ring-primary-500 focus:border-primary-500",
|
@@ -36,6 +36,7 @@ module Plutonium
|
|
36
36
|
neutral_color: nil,
|
37
37
|
# file
|
38
38
|
# file: "w-full border rounded-md shadow-sm font-medium text-sm dark:bg-gray-700 focus:outline-none",
|
39
|
+
file: "w-full border rounded-md shadow-sm font-medium text-sm dark:bg-gray-700 border-gray-300 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white focus:ring-primary-500 focus:border-primary-500 focus:outline-none focus:ring-2 [&::file-selector-button]:mr-3 [&::file-selector-button]:px-4 [&::file-selector-button]:py-2 [&::file-selector-button]:bg-gray-50 [&::file-selector-button]:border-0 [&::file-selector-button]:rounded-l-md [&::file-selector-button]:text-sm [&::file-selector-button]:font-medium [&::file-selector-button]:text-gray-700 [&::file-selector-button]:hover:bg-gray-100 [&::file-selector-button]:cursor-pointer dark:[&::file-selector-button]:bg-gray-600 dark:[&::file-selector-button]:text-gray-200 dark:[&::file-selector-button]:hover:bg-gray-500",
|
39
40
|
# hint themes
|
40
41
|
hint: "mt-2 text-sm text-gray-500 dark:text-gray-200 whitespace-pre",
|
41
42
|
# error themes
|
data/lib/plutonium/ui/panel.rb
CHANGED
data/lib/plutonium/version.rb
CHANGED
data/src/css/core.css
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
/**
|
2
|
+
* Color Input Styles for Tailwind v4
|
3
|
+
* Converted from @layer components to work with v4
|
4
|
+
*/
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
.pu-color-input::-webkit-color-swatch-wrapper {
|
7
|
+
@apply p-0;
|
8
|
+
}
|
9
|
+
|
10
|
+
.pu-color-input::-webkit-color-swatch {
|
11
|
+
@apply border-none rounded-lg;
|
12
|
+
}
|
9
13
|
|
10
|
-
|
11
|
-
|
12
|
-
}
|
14
|
+
.pu-color-input::-moz-color-swatch {
|
15
|
+
@apply border-none rounded-lg;
|
13
16
|
}
|