plutonium 0.9.0 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/Rakefile +9 -0
- data/app/assets/build/plutonium.js +5122 -0
- data/app/assets/javascripts/controllers/index.js +34 -0
- data/app/assets/javascripts/plutonium-app.js +7 -0
- data/app/assets/javascripts/plutonium.js +1 -0
- data/css.manifest +3 -0
- data/esbuild.config.js +44 -0
- data/lib/generators/pu/gen/component/component_generator.rb +13 -4
- data/lib/generators/pu/lib/plutonium_generators/concerns/actions.rb +86 -72
- data/lib/generators/pu/lib/plutonium_generators/model_generator.rb +1 -1
- data/lib/generators/pu/rodauth/install_generator.rb +1 -2
- data/lib/plutonium/core/fields/renderers/factory.rb +0 -1
- data/lib/plutonium/pkg/base.rb +0 -4
- data/lib/plutonium/railtie.rb +10 -2
- data/lib/plutonium/version.rb +1 -1
- data/lib/plutonium.rb +17 -14
- data/package-lock.json +0 -7
- data/package.json +5 -5
- data/postcss.config.js +1 -1
- data/public/plutonium-assets/plutonium-app-36KN5FVJ.js +6 -0
- data/public/plutonium-assets/plutonium-app-36KN5FVJ.js.map +7 -0
- data/public/plutonium-assets/plutonium.50232e35b5495f5ad90d.css +3415 -0
- data/tailwind.config.js +11 -12
- data/templates/base.rb +1 -1
- metadata +19 -22
- data/app/assets/js/controllers/application.js +0 -7
- data/app/assets/js/controllers/index.js +0 -30
- data/app/assets/js/plutonium.js +0 -2
- data/build.js +0 -12
- data/lib/generators/pu/gem/pagy/pagy_generator.rb +0 -25
- data/lib/generators/pu/gem/pagy/templates/config/initializers/pagy.rb +0 -4
- data/lib/generators/pu/gem/rabl/rabl_generator.rb +0 -25
- data/lib/generators/pu/gem/rabl/templates/.keep +0 -0
- data/lib/generators/pu/gem/rabl/templates/config/initializers/rabl.rb +0 -60
- data/lib/generators/pu/gem/simple_form/simple_form_generator.rb +0 -25
- data/lib/generators/pu/gem/simple_form/templates/.keep +0 -0
- data/lib/plutonium/core/fields/renderers/map_renderer.rb +0 -19
- /data/{lib/generators/pu/gem/pagy/templates → app/assets/build}/.keep +0 -0
- /data/app/assets/{js → javascripts}/controllers/resource_dismiss_controller.js +0 -0
- /data/app/assets/{js → javascripts}/controllers/resource_drop_down_controller.js +0 -0
- /data/app/assets/{js → javascripts}/turbo/index.js +0 -0
- /data/app/assets/{js → javascripts}/turbo/turbo_actions.js +0 -0
- /data/app/assets/{js → javascripts}/turbo/turbo_debug.js +0 -0
- /data/app/assets/{js → javascripts}/turbo/turbo_frame_monkey_patch.js +0 -0
- /data/app/assets/{css → stylesheets}/plutonium.css +0 -0
data/tailwind.config.js
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
2
1
|
|
3
|
-
|
2
|
+
/** @type {import('tailwindcss').Config} */
|
4
3
|
|
5
4
|
let safelist = [];
|
6
|
-
Object.keys(colors).forEach((color) => {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
});
|
5
|
+
// Object.keys(colors).forEach((color) => {
|
6
|
+
// if (typeof colors[color] === 'object') {
|
7
|
+
// Object.keys(colors[color]).forEach((shade) => {
|
8
|
+
// safelist.push(`bg-${color}-${shade}`);
|
9
|
+
// safelist.push(`text-${color}-${shade}`);
|
10
|
+
// // Add other utilities as needed
|
11
|
+
// });
|
12
|
+
// }
|
13
|
+
// });
|
15
14
|
|
16
15
|
module.exports = {
|
17
16
|
content: [
|
@@ -22,7 +21,7 @@ module.exports = {
|
|
22
21
|
`${__dirname}/config/initializers/simple_form.rb`,
|
23
22
|
// TODO: temporary workaround for buttons flex basis hack.
|
24
23
|
// To be removed after moving buttons_helper to components.
|
25
|
-
`${__dirname}/lib/plutonium/**/*.{rb,erb}`
|
24
|
+
// `${__dirname}/lib/plutonium/**/*.{rb,erb}`
|
26
25
|
],
|
27
26
|
darkMode: "selector",
|
28
27
|
plugins: [
|
data/templates/base.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plutonium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Froelich
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -220,7 +220,8 @@ files:
|
|
220
220
|
- README copy.md
|
221
221
|
- README.md
|
222
222
|
- Rakefile
|
223
|
-
- app/assets/
|
223
|
+
- app/assets/build/.keep
|
224
|
+
- app/assets/build/plutonium.js
|
224
225
|
- app/assets/icons/flags/ghana.svg
|
225
226
|
- app/assets/icons/outline/address-book.svg
|
226
227
|
- app/assets/icons/outline/adjustments-horizontal.svg
|
@@ -708,15 +709,16 @@ files:
|
|
708
709
|
- app/assets/icons/solid/youtube.svg
|
709
710
|
- app/assets/icons/solid/zoom-in.svg
|
710
711
|
- app/assets/icons/solid/zoom-out.svg
|
711
|
-
- app/assets/
|
712
|
-
- app/assets/
|
713
|
-
- app/assets/
|
714
|
-
- app/assets/
|
715
|
-
- app/assets/
|
716
|
-
- app/assets/
|
717
|
-
- app/assets/
|
718
|
-
- app/assets/
|
719
|
-
- app/assets/
|
712
|
+
- app/assets/javascripts/controllers/index.js
|
713
|
+
- app/assets/javascripts/controllers/resource_dismiss_controller.js
|
714
|
+
- app/assets/javascripts/controllers/resource_drop_down_controller.js
|
715
|
+
- app/assets/javascripts/plutonium-app.js
|
716
|
+
- app/assets/javascripts/plutonium.js
|
717
|
+
- app/assets/javascripts/turbo/index.js
|
718
|
+
- app/assets/javascripts/turbo/turbo_actions.js
|
719
|
+
- app/assets/javascripts/turbo/turbo_debug.js
|
720
|
+
- app/assets/javascripts/turbo/turbo_frame_monkey_patch.js
|
721
|
+
- app/assets/stylesheets/plutonium.css
|
720
722
|
- app/views/application/_color_modes.html.erb
|
721
723
|
- app/views/application/_flash.html.erb
|
722
724
|
- app/views/application/_flash_alerts.html.erb
|
@@ -838,11 +840,12 @@ files:
|
|
838
840
|
- app/views/rodauth/webauthn_remove.html.erb
|
839
841
|
- app/views/rodauth/webauthn_setup.html.erb
|
840
842
|
- brakeman.ignore
|
841
|
-
- build.js
|
842
843
|
- config/initializers/hotwire_turbo_monkey_patches.rb
|
843
844
|
- config/initializers/pagy.rb
|
844
845
|
- config/initializers/rabl.rb
|
845
846
|
- config/initializers/simple_form.rb
|
847
|
+
- css.manifest
|
848
|
+
- esbuild.config.js
|
846
849
|
- exe/pug
|
847
850
|
- lib/active_model/validations/array_validator.rb
|
848
851
|
- lib/active_model/validations/attached_validator.rb
|
@@ -857,14 +860,6 @@ files:
|
|
857
860
|
- lib/generators/pu/core/install/templates/app/query_objects/resource_query_object.rb.tt
|
858
861
|
- lib/generators/pu/core/install/templates/config/initializers/plutonium.rb
|
859
862
|
- lib/generators/pu/core/install/templates/config/packages.rb
|
860
|
-
- lib/generators/pu/gem/pagy/pagy_generator.rb
|
861
|
-
- lib/generators/pu/gem/pagy/templates/.keep
|
862
|
-
- lib/generators/pu/gem/pagy/templates/config/initializers/pagy.rb
|
863
|
-
- lib/generators/pu/gem/rabl/rabl_generator.rb
|
864
|
-
- lib/generators/pu/gem/rabl/templates/.keep
|
865
|
-
- lib/generators/pu/gem/rabl/templates/config/initializers/rabl.rb
|
866
|
-
- lib/generators/pu/gem/simple_form/simple_form_generator.rb
|
867
|
-
- lib/generators/pu/gem/simple_form/templates/.keep
|
868
863
|
- lib/generators/pu/gen/component/component_generator.rb
|
869
864
|
- lib/generators/pu/gen/component/templates/component.html.erb.tt
|
870
865
|
- lib/generators/pu/gen/component/templates/component.rb.tt
|
@@ -1029,7 +1024,6 @@ files:
|
|
1029
1024
|
- lib/plutonium/core/fields/renderers/attachment_renderer.rb
|
1030
1025
|
- lib/plutonium/core/fields/renderers/basic_renderer.rb
|
1031
1026
|
- lib/plutonium/core/fields/renderers/factory.rb
|
1032
|
-
- lib/plutonium/core/fields/renderers/map_renderer.rb
|
1033
1027
|
- lib/plutonium/core/ui/collection.rb
|
1034
1028
|
- lib/plutonium/core/ui/detail.rb
|
1035
1029
|
- lib/plutonium/core/ui/form.rb
|
@@ -1078,6 +1072,9 @@ files:
|
|
1078
1072
|
- public/plutonium-assets/fonts/bootstrap-icons.woff
|
1079
1073
|
- public/plutonium-assets/fonts/bootstrap-icons.woff2
|
1080
1074
|
- public/plutonium-assets/logo.png
|
1075
|
+
- public/plutonium-assets/plutonium-app-36KN5FVJ.js
|
1076
|
+
- public/plutonium-assets/plutonium-app-36KN5FVJ.js.map
|
1077
|
+
- public/plutonium-assets/plutonium.50232e35b5495f5ad90d.css
|
1081
1078
|
- sig/plutonium.rbs
|
1082
1079
|
- tailwind.config.js
|
1083
1080
|
- templates/base.rb
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { application } from "./application"
|
2
|
-
|
3
|
-
// Register controllers here
|
4
|
-
|
5
|
-
import NestedResourceFormFieldsController from "../../../../app/views/components/nested_resource_form_fields/nested_resource_form_fields_controller.js"
|
6
|
-
application.register("nested-resource-form-fields", NestedResourceFormFieldsController)
|
7
|
-
|
8
|
-
import TabBarController from "../../../../app/views/components/tab_bar/tab_bar_controller.js"
|
9
|
-
application.register("tab-bar", TabBarController)
|
10
|
-
|
11
|
-
import ToolbarController from "../../../../app/views/components/toolbar/toolbar_controller.js"
|
12
|
-
application.register("toolbar", ToolbarController)
|
13
|
-
|
14
|
-
import TableSearchInputController from "../../../../app/views/components/table_search_input/table_search_input_controller.js"
|
15
|
-
application.register("table-search-input", TableSearchInputController)
|
16
|
-
|
17
|
-
import TableToolbarController from "../../../../app/views/components/table_toolbar/table_toolbar_controller.js"
|
18
|
-
application.register("table-toolbar", TableToolbarController)
|
19
|
-
|
20
|
-
import TableController from "../../../../app/views/components/table/table_controller.js"
|
21
|
-
application.register("table", TableController)
|
22
|
-
|
23
|
-
import FormController from "../../../../app/views/components/form/form_controller.js"
|
24
|
-
application.register("form", FormController)
|
25
|
-
|
26
|
-
import ResourceDropDownController from "./resource_drop_down_controller.js"
|
27
|
-
application.register("resource-drop-down", ResourceDropDownController)
|
28
|
-
|
29
|
-
import ResourceDismissController from "./resource_dismiss_controller.js"
|
30
|
-
application.register("resource-dismiss", ResourceDismissController)
|
data/app/assets/js/plutonium.js
DELETED
data/build.js
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
const esbuild = require('esbuild');
|
2
|
-
const manifestPlugin = require('esbuild-plugin-manifest')
|
3
|
-
|
4
|
-
esbuild.context({
|
5
|
-
entryPoints: ["app/assets/js/plutonium.js"],
|
6
|
-
bundle: true,
|
7
|
-
outdir: "public/plutonium-assets/build/",
|
8
|
-
plugins: [manifestPlugin({
|
9
|
-
filename: `${__dirname}/js.manifest`,
|
10
|
-
shortNames: true,
|
11
|
-
})],
|
12
|
-
}).then((context) => context.watch().catch((e) => console.error(e.message)))
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "../../lib/plutonium_generators"
|
4
|
-
|
5
|
-
module Pu
|
6
|
-
module Gem
|
7
|
-
class PagyGenerator < Rails::Generators::Base
|
8
|
-
include PlutoniumGenerators::Generator
|
9
|
-
|
10
|
-
source_root File.expand_path("templates", __dir__)
|
11
|
-
|
12
|
-
desc "Install Pagy"
|
13
|
-
|
14
|
-
def start
|
15
|
-
Bundler.with_unbundled_env do
|
16
|
-
run "bundle add pagy"
|
17
|
-
end
|
18
|
-
|
19
|
-
directory "config"
|
20
|
-
rescue => e
|
21
|
-
exception "#{self.class} failed:", e
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "../../lib/plutonium_generators"
|
4
|
-
|
5
|
-
module Pu
|
6
|
-
module Gem
|
7
|
-
class RablGenerator < Rails::Generators::Base
|
8
|
-
include PlutoniumGenerators::Generator
|
9
|
-
|
10
|
-
source_root File.expand_path("templates", __dir__)
|
11
|
-
|
12
|
-
desc "Install Rabl"
|
13
|
-
|
14
|
-
def start
|
15
|
-
Bundler.with_unbundled_env do
|
16
|
-
run "bundle add rabl"
|
17
|
-
end
|
18
|
-
|
19
|
-
directory "config"
|
20
|
-
rescue => e
|
21
|
-
exception "#{self.class} failed:", e
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
File without changes
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# https://github.com/nesquena/rabl#configuration
|
4
|
-
|
5
|
-
Rabl.configure do |config|
|
6
|
-
config.cache_sources = !Rails.env.development? # Defaults to false
|
7
|
-
config.raise_on_missing_attribute = !Rails.env.production? # Defaults to false
|
8
|
-
|
9
|
-
# config.cache_all_output = false
|
10
|
-
# config.cache_engine = Rabl::CacheEngine.new # Defaults to Rails cache
|
11
|
-
# config.perform_caching = false
|
12
|
-
# config.escape_all_output = false
|
13
|
-
# config.json_engine = nil # Class with #dump class method (defaults JSON)
|
14
|
-
# config.msgpack_engine = nil # Defaults to ::MessagePack
|
15
|
-
# config.bson_engine = nil # Defaults to ::BSON
|
16
|
-
# config.plist_engine = nil # Defaults to ::Plist::Emit
|
17
|
-
# config.include_json_root = true
|
18
|
-
# config.include_msgpack_root = true
|
19
|
-
# config.include_bson_root = true
|
20
|
-
# config.include_plist_root = true
|
21
|
-
# config.include_xml_root = false
|
22
|
-
# config.include_child_root = true
|
23
|
-
# config.enable_json_callbacks = false
|
24
|
-
# config.xml_options = { :dasherize => true, :skip_types => false }
|
25
|
-
# config.view_paths = []
|
26
|
-
# config.replace_nil_values_with_empty_strings = true # Defaults to false
|
27
|
-
# config.replace_empty_string_values_with_nil_values = true # Defaults to false
|
28
|
-
# config.exclude_nil_values = true # Defaults to false
|
29
|
-
# config.exclude_empty_values_in_collections = true # Defaults to false
|
30
|
-
# config.camelize_keys = :upper # Defaults to false
|
31
|
-
end
|
32
|
-
|
33
|
-
# Monkey Patch Rabl source lookup to make it compatible with Rails view lookup
|
34
|
-
module Rabl
|
35
|
-
module Sources
|
36
|
-
private
|
37
|
-
|
38
|
-
# Returns the rabl template path for Rails
|
39
|
-
def fetch_rails_source(file, _options = {})
|
40
|
-
# use Rails template resolution mechanism if possible (find_template)
|
41
|
-
source_format = request_format if defined?(request_format)
|
42
|
-
|
43
|
-
lookup_proc = lambda do |partial|
|
44
|
-
context_scope.lookup_context.find(file, context_scope.lookup_context.prefixes, partial, [],
|
45
|
-
{formats: [source_format]})
|
46
|
-
end
|
47
|
-
template = begin
|
48
|
-
lookup_proc.call(false)
|
49
|
-
rescue
|
50
|
-
nil
|
51
|
-
end
|
52
|
-
template ||= begin
|
53
|
-
lookup_proc.call(true)
|
54
|
-
rescue
|
55
|
-
nil
|
56
|
-
end
|
57
|
-
template&.identifier
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "../../lib/plutonium_generators"
|
4
|
-
|
5
|
-
module Pu
|
6
|
-
module Gem
|
7
|
-
class SimpleFormGenerator < Rails::Generators::Base
|
8
|
-
include PlutoniumGenerators::Generator
|
9
|
-
|
10
|
-
source_root File.expand_path("templates", __dir__)
|
11
|
-
|
12
|
-
desc "Install SimpleForm"
|
13
|
-
|
14
|
-
def start
|
15
|
-
Bundler.with_unbundled_env do
|
16
|
-
run "bundle add simple_form"
|
17
|
-
end
|
18
|
-
|
19
|
-
directory "config"
|
20
|
-
rescue => e
|
21
|
-
exception "#{self.class} failed:", e
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
File without changes
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Renderers
|
5
|
-
class MapRenderer < BasicRenderer
|
6
|
-
# def initialize(name, reflection:, **user_options)
|
7
|
-
# @reflection = reflection
|
8
|
-
# super(name, **user_options)
|
9
|
-
# end
|
10
|
-
|
11
|
-
def render(view_context, record)
|
12
|
-
# view_context.display_field value:, **options
|
13
|
-
view_context.js_map [{latitude: record.lat, longitude: record.lng}]
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|