plutonium 0.15.5 → 0.15.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/plutonium.css +1 -1
- data/app/assets/plutonium.ico +0 -0
- data/app/assets/plutonium.js +25 -11
- data/app/assets/plutonium.js.map +2 -2
- data/app/assets/plutonium.min.js +4 -4
- data/app/assets/plutonium.min.js.map +3 -3
- data/app/assets/plutonium.png +0 -0
- data/app/views/layouts/rodauth.html.erb +2 -2
- data/docs/.vitepress/config.ts +61 -0
- data/docs/.vitepress/theme/custom.css +61 -0
- data/docs/.vitepress/theme/index.ts +4 -0
- data/docs/api-examples.md +49 -0
- data/docs/guide/getting-started/authorization.md +296 -0
- data/docs/guide/getting-started/core-concepts.md +432 -0
- data/docs/guide/getting-started/index.md +18 -0
- data/docs/guide/getting-started/installation.md +270 -0
- data/docs/guide/getting-started/resources.md +250 -0
- data/docs/guide/what-is-plutonium.md +211 -0
- data/docs/index.md +43 -0
- data/docs/markdown-examples.md +85 -0
- data/docs/public/android-chrome-192x192.png +0 -0
- data/docs/public/android-chrome-512x512.png +0 -0
- data/docs/public/apple-touch-icon.png +0 -0
- data/docs/public/favicon-16x16.png +0 -0
- data/docs/public/favicon-32x32.png +0 -0
- data/docs/public/favicon.ico +0 -0
- data/docs/public/plutonium.png +0 -0
- data/docs/public/site.webmanifest +1 -0
- data/docs/public/templates/plutonium.rb +29 -0
- data/lib/generators/pu/core/assets/assets_generator.rb +2 -3
- data/lib/generators/pu/core/assets/templates/tailwind.config.js +2 -2
- data/lib/generators/pu/core/install/install_generator.rb +9 -1
- data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +0 -1
- data/lib/generators/pu/eject/layout/layout_generator.rb +3 -3
- data/lib/generators/pu/eject/shell/shell_generator.rb +3 -3
- data/lib/generators/pu/gem/dotenv/dotenv_generator.rb +1 -1
- data/lib/generators/pu/gem/letter_opener/letter_opener_generator.rb +21 -0
- data/lib/generators/pu/gem/redis/redis_generator.rb +0 -2
- data/lib/generators/pu/gem/standard/standard_generator.rb +19 -0
- data/lib/generators/pu/lib/plutonium_generators/generator.rb +1 -1
- data/lib/generators/pu/res/conn/conn_generator.rb +1 -1
- data/lib/plutonium/core/controllers/authorizable.rb +1 -1
- data/lib/plutonium/definition/actions.rb +6 -2
- data/lib/plutonium/definition/base.rb +1 -0
- data/lib/plutonium/definition/nested_inputs.rb +19 -0
- data/lib/plutonium/railtie.rb +0 -10
- data/lib/plutonium/resource/controller.rb +1 -1
- data/lib/plutonium/resource/controllers/crud_actions.rb +1 -1
- data/lib/plutonium/resource/controllers/interactive_actions.rb +1 -1
- data/lib/plutonium/resource/controllers/presentable.rb +1 -5
- data/lib/plutonium/resource/policy.rb +4 -5
- data/lib/plutonium/resource/register.rb +3 -0
- data/lib/plutonium/ui/action_button.rb +34 -19
- data/lib/plutonium/ui/block.rb +13 -0
- data/lib/plutonium/ui/component/kit.rb +10 -0
- data/lib/plutonium/ui/display/resource.rb +29 -11
- data/lib/plutonium/ui/display/theme.rb +1 -1
- data/lib/plutonium/ui/dyna_frame/content.rb +2 -2
- data/lib/plutonium/ui/dyna_frame/host.rb +20 -0
- data/lib/plutonium/ui/form/concerns/renders_nested_resource_fields.rb +282 -0
- data/lib/plutonium/ui/form/resource.rb +40 -29
- data/lib/plutonium/ui/form/theme.rb +1 -1
- data/lib/plutonium/ui/frame_navigator_panel.rb +53 -0
- data/lib/plutonium/ui/panel.rb +63 -0
- data/lib/plutonium/ui/skeleton_table.rb +29 -0
- data/lib/plutonium/ui/table/components/search_bar.rb +1 -1
- data/lib/plutonium/ui/table/resource.rb +1 -1
- data/lib/plutonium/version.rb +1 -1
- data/package-lock.json +5767 -1851
- data/package.json +10 -4
- data/src/js/controllers/frame_navigator_controller.js +25 -8
- data/src/js/controllers/nested_resource_form_fields_controller.js +2 -2
- data/src/js/core.js +0 -1
- data/tailwind.options.js +89 -11
- metadata +36 -12
- data/app/assets/plutonium-original.png +0 -0
- data/app/assets/plutonium-white.png +0 -0
- data/lib/generators/pu/gem/redis/templates/.keep +0 -0
- data/public/plutonium-assets/fonts/bootstrap-icons.woff +0 -0
- data/public/plutonium-assets/fonts/bootstrap-icons.woff2 +0 -0
- /data/{templates → docs/public/templates}/base.rb +0 -0
@@ -15,7 +15,7 @@ module Pu
|
|
15
15
|
class_option :rodauth, type: :boolean
|
16
16
|
|
17
17
|
def start
|
18
|
-
destination_dir = (
|
18
|
+
destination_dir = (destination_portal == "main_app") ? "app/views/" : "packages/#{destination_portal}/app/views/"
|
19
19
|
[
|
20
20
|
"layouts/resource.html.erb"
|
21
21
|
].each do |file|
|
@@ -27,8 +27,8 @@ module Pu
|
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
def
|
31
|
-
@
|
30
|
+
def destination_portal
|
31
|
+
@destination_portal || select_portal(options[:dest], msg: "Select destination portal")
|
32
32
|
end
|
33
33
|
|
34
34
|
def copy_file(source_path, destination_path)
|
@@ -14,7 +14,7 @@ module Pu
|
|
14
14
|
class_option :dest, type: :string
|
15
15
|
|
16
16
|
def start
|
17
|
-
destination_dir = (
|
17
|
+
destination_dir = (destination_portal == "main_app") ? "app/views/" : "packages/#{destination_portal}/app/views"
|
18
18
|
[
|
19
19
|
"plutonium/_resource_header.html.erb",
|
20
20
|
"plutonium/_resource_sidebar.html.erb"
|
@@ -27,8 +27,8 @@ module Pu
|
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
def
|
31
|
-
@
|
30
|
+
def destination_portal
|
31
|
+
@destination_portal || select_portal(options[:dest], msg: "Select destination portal")
|
32
32
|
end
|
33
33
|
|
34
34
|
def copy_file(source_path, destination_path)
|
@@ -21,7 +21,7 @@ module Pu
|
|
21
21
|
|
22
22
|
gitignore "!/.env.template", "!/.env.local.template", "!/.env"
|
23
23
|
|
24
|
-
insert_into_file "Gemfile", "\ngem \"dotenv\", :
|
24
|
+
insert_into_file "Gemfile", "\ngem \"dotenv\", groups: %i[development test]\n", after: /^gem ["']rails["'].*\n/
|
25
25
|
bundle!
|
26
26
|
end
|
27
27
|
rescue => e
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../lib/plutonium_generators"
|
4
|
+
|
5
|
+
module Pu
|
6
|
+
module Gem
|
7
|
+
class LetterOpenerGenerator < Rails::Generators::Base
|
8
|
+
include PlutoniumGenerators::Generator
|
9
|
+
|
10
|
+
desc "Set up letter_opener"
|
11
|
+
|
12
|
+
def start
|
13
|
+
bundle "letter_opener", group: :development
|
14
|
+
environment "config.action_mailer.delivery_method = :letter_opener", env: :development
|
15
|
+
environment "config.action_mailer.perform_deliveries = true", env: :development
|
16
|
+
rescue => e
|
17
|
+
exception "#{self.class} failed:", e
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../lib/plutonium_generators"
|
4
|
+
|
5
|
+
module Pu
|
6
|
+
module Gem
|
7
|
+
class StandardGenerator < Rails::Generators::Base
|
8
|
+
include PlutoniumGenerators::Generator
|
9
|
+
|
10
|
+
desc "Set up standardrb"
|
11
|
+
|
12
|
+
def start
|
13
|
+
bundle "standardrb"
|
14
|
+
rescue => e
|
15
|
+
exception "#{self.class} failed:", e
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -22,7 +22,7 @@ module Pu
|
|
22
22
|
error "No resources found" if available_resources.blank?
|
23
23
|
selected_resources = prompt.multi_select("Select resources", available_resources)
|
24
24
|
|
25
|
-
@app_namespace =
|
25
|
+
@app_namespace = select_portal.camelize
|
26
26
|
|
27
27
|
selected_resources.each do |resource|
|
28
28
|
@resource_class = resource
|
@@ -9,7 +9,7 @@ module Plutonium
|
|
9
9
|
|
10
10
|
included do
|
11
11
|
authorize :user, through: :current_user
|
12
|
-
authorize :
|
12
|
+
authorize :entity_scope, through: :entity_scope_for_authorize
|
13
13
|
|
14
14
|
helper_method :policy_for, :authorized_resource_scope
|
15
15
|
end
|
@@ -14,8 +14,12 @@ module Plutonium
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
def action(name, **)
|
18
|
-
instance_defined_actions[name] =
|
17
|
+
def action(name, interaction: nil, **)
|
18
|
+
instance_defined_actions[name] = if interaction
|
19
|
+
Plutonium::Action::Interactive::Factory.create(name, interaction:, **)
|
20
|
+
else
|
21
|
+
Plutonium::Action::Simple.new(name, **)
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
def defined_actions
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Plutonium
|
2
|
+
module Definition
|
3
|
+
module NestedInputs
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
defineable_prop :nested_input
|
8
|
+
|
9
|
+
# def self.nested_input(name, with: nil, **)
|
10
|
+
# defined_nested_inputs[name] = {}
|
11
|
+
# end
|
12
|
+
|
13
|
+
# def nested_input(name, with: nil, **)
|
14
|
+
# instance_defined_nested_inputs[name] = {}
|
15
|
+
# end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/plutonium/railtie.rb
CHANGED
@@ -53,10 +53,6 @@ module Plutonium
|
|
53
53
|
extend_action_dispatch
|
54
54
|
end
|
55
55
|
|
56
|
-
initializer "plutonium.active_record_extensions" do
|
57
|
-
extend_active_record
|
58
|
-
end
|
59
|
-
|
60
56
|
initializer "plutonium.phlexi_themes" do
|
61
57
|
setup_phlexi_themes
|
62
58
|
end
|
@@ -114,11 +110,5 @@ module Plutonium
|
|
114
110
|
ActionDispatch::Routing::RouteSet.prepend Plutonium::Routing::RouteSetExtensions
|
115
111
|
Rails::Engine.include Plutonium::Routing::ResourceRegistration
|
116
112
|
end
|
117
|
-
|
118
|
-
def extend_active_record
|
119
|
-
ActiveSupport.on_load(:active_record) do
|
120
|
-
include Plutonium::Resource::Record
|
121
|
-
end
|
122
|
-
end
|
123
113
|
end
|
124
114
|
end
|
@@ -59,7 +59,7 @@ module Plutonium
|
|
59
59
|
# Returns the submitted resource parameters
|
60
60
|
# @return [Hash] The submitted resource parameters
|
61
61
|
def submitted_resource_params
|
62
|
-
@submitted_resource_params ||= build_form(resource_class.new).extract_input(params)[resource_param_key.to_sym]
|
62
|
+
@submitted_resource_params ||= build_form(resource_class.new).extract_input(params, view_context:)[resource_param_key.to_sym]
|
63
63
|
end
|
64
64
|
|
65
65
|
# Returns the resource parameters, including scoped and parent parameters
|
@@ -232,7 +232,7 @@ module Plutonium
|
|
232
232
|
@submitted_interaction_params ||= current_interactive_action
|
233
233
|
.interaction
|
234
234
|
.build_form(nil)
|
235
|
-
.extract_input(params)[:interaction]
|
235
|
+
.extract_input(params, view_context:)[:interaction]
|
236
236
|
end
|
237
237
|
|
238
238
|
def redirect_url_after_action_on(resource_record_or_resource_class)
|
@@ -5,7 +5,7 @@ module Plutonium
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
helper_method :presentable_attributes
|
8
|
+
helper_method :presentable_attributes
|
9
9
|
helper_method :build_form, :build_detail, :build_collection
|
10
10
|
end
|
11
11
|
|
@@ -31,10 +31,6 @@ module Plutonium
|
|
31
31
|
def build_form(record = resource_record)
|
32
32
|
current_definition.form_class.new(record, resource_fields: presentable_attributes, resource_definition: current_definition)
|
33
33
|
end
|
34
|
-
|
35
|
-
def present_associations?
|
36
|
-
current_parent.nil?
|
37
|
-
end
|
38
34
|
end
|
39
35
|
end
|
40
36
|
end
|
@@ -7,13 +7,12 @@ module Plutonium
|
|
7
7
|
# and to retrieve permitted attributes for these actions.
|
8
8
|
class Policy < ActionPolicy::Base
|
9
9
|
authorize :user, allow_nil: false
|
10
|
-
authorize :
|
10
|
+
authorize :entity_scope, allow_nil: true
|
11
11
|
|
12
12
|
relation_scope do |relation|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
relation
|
13
|
+
next relation unless entity_scope
|
14
|
+
|
15
|
+
relation.associated_with(entity_scope)
|
17
16
|
end
|
18
17
|
|
19
18
|
# Sends a method and raises an error if the method is not implemented.
|
@@ -21,6 +21,9 @@ module Plutonium
|
|
21
21
|
# @return [void]
|
22
22
|
def register(resource)
|
23
23
|
raise FrozenRegisterError, "Cannot modify frozen resource register" if @frozen
|
24
|
+
unless resource.include?(Plutonium::Resource::Record)
|
25
|
+
raise ArgumentError, "#{resource} must include Plutonium::Resource::Record before being registered"
|
26
|
+
end
|
24
27
|
|
25
28
|
@resources.add(resource.to_s)
|
26
29
|
end
|
@@ -80,7 +80,7 @@ module Plutonium
|
|
80
80
|
if @variant == :table
|
81
81
|
"h-4 w-4 mr-1"
|
82
82
|
else
|
83
|
-
"h-3.5 w-3.5
|
83
|
+
"h-3.5 w-3.5 -ml-1"
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -91,35 +91,50 @@ module Plutonium
|
|
91
91
|
def color_classes
|
92
92
|
case @action.color || @action.category.to_sym
|
93
93
|
when :primary
|
94
|
-
|
95
|
-
"bg-primary-
|
96
|
-
"bg-primary-
|
94
|
+
variant_class(
|
95
|
+
"bg-primary-700 text-white hover:bg-primary-800 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",
|
96
|
+
table: "bg-primary-100 text-primary-700 hover:bg-primary-200 focus:ring-primary-300 dark:bg-primary-700 dark:text-primary-100 dark:hover:bg-primary-600 dark:focus:ring-primary-600"
|
97
|
+
)
|
98
|
+
when :success
|
99
|
+
variant_class(
|
100
|
+
"bg-success-700 text-white hover:bg-success-800 focus:ring-success-300 dark:bg-success-600 dark:hover:bg-success-700 dark:focus:ring-success-800",
|
101
|
+
table: "bg-success-100 text-success-700 hover:bg-success-200 focus:ring-success-300 dark:bg-success-700 dark:text-success-100 dark:hover:bg-success-600 dark:focus:ring-success-600"
|
102
|
+
)
|
103
|
+
when :info
|
104
|
+
variant_class(
|
105
|
+
"bg-info-700 text-white hover:bg-info-800 focus:ring-info-300 dark:bg-info-600 dark:hover:bg-info-700 dark:focus:ring-info-800",
|
106
|
+
table: "bg-info-100 text-info-700 hover:bg-info-200 focus:ring-info-300 dark:bg-info-700 dark:text-info-100 dark:hover:bg-info-600 dark:focus:ring-info-600"
|
97
107
|
)
|
98
108
|
when :warning
|
99
|
-
|
100
|
-
"bg-
|
101
|
-
"bg-
|
109
|
+
variant_class(
|
110
|
+
"bg-warning-700 text-white hover:bg-warning-800 focus:ring-warning-300 dark:bg-warning-600 dark:hover:bg-warning-700 dark:focus:ring-warning-800",
|
111
|
+
table: "bg-warning-100 text-warning-700 hover:bg-warning-200 focus:ring-warning-300 dark:bg-warning-700 dark:text-warning-100 dark:hover:bg-warning-600 dark:focus:ring-warning-600"
|
102
112
|
)
|
103
113
|
when :danger
|
104
|
-
|
105
|
-
"bg-
|
106
|
-
"bg-
|
114
|
+
variant_class(
|
115
|
+
"bg-danger-700 text-white hover:bg-danger-800 focus:ring-danger-300 dark:bg-danger-600 dark:hover:bg-danger-700 dark:focus:ring-danger-800",
|
116
|
+
table: "bg-danger-100 text-danger-700 hover:bg-danger-200 focus:ring-danger-300 dark:bg-danger-700 dark:text-danger-100 dark:hover:bg-danger-600 dark:focus:ring-danger-600"
|
107
117
|
)
|
108
|
-
when :
|
109
|
-
|
110
|
-
"bg-
|
111
|
-
"bg-
|
118
|
+
when :accent
|
119
|
+
variant_class(
|
120
|
+
"bg-accent-700 text-white hover:bg-accent-800 focus:ring-accent-300 dark:bg-accent-600 dark:hover:bg-accent-700 dark:focus:ring-accent-800",
|
121
|
+
table: "bg-accent-100 text-accent-700 hover:bg-accent-200 focus:ring-accent-300 dark:bg-accent-700 dark:text-accent-100 dark:hover:bg-accent-600 dark:focus:ring-accent-600"
|
112
122
|
)
|
113
123
|
else
|
114
|
-
|
115
|
-
"bg-
|
116
|
-
"
|
124
|
+
variant_class(
|
125
|
+
"bg-secondary-700 text-white hover:bg-secondary-800 focus:ring-secondary-300 dark:bg-secondary-600 dark:hover:bg-secondary-700 dark:focus:ring-secondary-800",
|
126
|
+
table: "bg-secondary-100 text-secondary-700 hover:bg-secondary-200 focus:ring-secondary-300 dark:bg-secondary-700 dark:text-secondary-100 dark:hover:bg-secondary-600 dark:focus:ring-secondary-600"
|
117
127
|
)
|
118
128
|
end
|
119
129
|
end
|
120
130
|
|
121
|
-
def
|
122
|
-
|
131
|
+
def variant_class(default, table:)
|
132
|
+
case @variant
|
133
|
+
when :table
|
134
|
+
table
|
135
|
+
else
|
136
|
+
default
|
137
|
+
end
|
123
138
|
end
|
124
139
|
end
|
125
140
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Plutonium
|
2
|
+
module UI
|
3
|
+
class Block < Plutonium::UI::Component::Base
|
4
|
+
def view_template(&)
|
5
|
+
raise ArgumentError, "Block requires a content block" unless block_given?
|
6
|
+
|
7
|
+
div class: "relative bg-white dark:bg-gray-800 shadow-md sm:rounded-lg my-3" do
|
8
|
+
yield
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -10,6 +10,16 @@ module Plutonium
|
|
10
10
|
|
11
11
|
def Breadcrumbs(...) = render Plutonium::UI::Breadcrumbs.new(...)
|
12
12
|
|
13
|
+
def SkeletonTable(...) = render Plutonium::UI::SkeletonTable.new(...)
|
14
|
+
|
15
|
+
def Block(...) = render Plutonium::UI::Block.new(...)
|
16
|
+
|
17
|
+
def Panel(...) = render Plutonium::UI::Panel.new(...)
|
18
|
+
|
19
|
+
def FrameNavigatorPanel(...) = render Plutonium::UI::FrameNavigatorPanel.new(...)
|
20
|
+
|
21
|
+
def DynaFrameHost(...) = render Plutonium::UI::DynaFrame::Host.new(...)
|
22
|
+
|
13
23
|
def DynaFrameContent(...) = render Plutonium::UI::DynaFrame::Content.new(...)
|
14
24
|
|
15
25
|
def PageHeader(...) = render Plutonium::UI::PageHeader.new(...)
|
@@ -21,19 +21,37 @@ module Plutonium
|
|
21
21
|
private
|
22
22
|
|
23
23
|
def render_fields
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
Block do
|
25
|
+
fields_wrapper do
|
26
|
+
resource_fields.each do |name|
|
27
|
+
render_resource_field name
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
29
31
|
end
|
30
32
|
|
31
33
|
def render_associations
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
resource_associations.each do |name|
|
35
|
+
reflection = object.class.reflect_on_association name
|
36
|
+
|
37
|
+
if !reflection
|
38
|
+
raise ArgumentError,
|
39
|
+
"unknown association #{object.class}##{name} defined in #permitted_associations"
|
40
|
+
elsif !registered_resources.include?(reflection.klass)
|
41
|
+
raise ArgumentError,
|
42
|
+
"#{object.class}##{name} defined in #permitted_associations, but #{reflection.klass} is not a registered resource"
|
43
|
+
end
|
44
|
+
|
45
|
+
title = object.class.human_attribute_name(name)
|
46
|
+
src = case reflection.macro
|
47
|
+
when :belongs_to
|
48
|
+
associated = object.public_send name
|
49
|
+
resource_url_for(associated, parent: nil) if associated
|
50
|
+
when :has_many
|
51
|
+
resource_url_for(reflection.klass, parent: object)
|
52
|
+
end
|
53
|
+
FrameNavigatorPanel(title:, src:) if src
|
54
|
+
end
|
37
55
|
end
|
38
56
|
|
39
57
|
def render_resource_field(name)
|
@@ -73,7 +91,7 @@ module Plutonium
|
|
73
91
|
end
|
74
92
|
|
75
93
|
def present_associations?
|
76
|
-
|
94
|
+
current_turbo_frame.nil?
|
77
95
|
end
|
78
96
|
end
|
79
97
|
end
|
@@ -6,7 +6,7 @@ module Plutonium
|
|
6
6
|
class Theme < Phlexi::Display::Theme
|
7
7
|
def self.theme
|
8
8
|
super.merge({
|
9
|
-
base: "
|
9
|
+
base: "",
|
10
10
|
value_wrapper: "max-h-[300px] overflow-y-auto",
|
11
11
|
fields_wrapper: "p-6 grid grid-cols-1 md:grid-cols-2 2xl:grid-cols-4 gap-6 gap-y-10 grid-flow-row-dense",
|
12
12
|
label: "text-base font-bold text-gray-500 dark:text-gray-400 mb-1",
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Plutonium
|
2
|
+
module UI
|
3
|
+
module DynaFrame
|
4
|
+
class Host < Plutonium::UI::Component::Base
|
5
|
+
include Phlex::Rails::Helpers::TurboFrameTag
|
6
|
+
|
7
|
+
def initialize(src:, loading:, id: SecureRandom.hex, **attributes)
|
8
|
+
@id = id
|
9
|
+
@src = src
|
10
|
+
@loading = loading
|
11
|
+
@attributes = attributes
|
12
|
+
end
|
13
|
+
|
14
|
+
def view_template(&)
|
15
|
+
turbo_frame_tag(@id, src: @src, loading: @loading, **@attributes, &)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|