plutonium 0.15.4 → 0.15.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/plutonium.css +1 -1
  3. data/app/assets/plutonium.ico +0 -0
  4. data/app/assets/plutonium.png +0 -0
  5. data/app/views/components/table_search_input/table_search_input_component.html.erb +3 -3
  6. data/app/views/resource/_resource_table.html.erb +0 -321
  7. data/docs/.vitepress/config.ts +61 -0
  8. data/docs/.vitepress/theme/custom.css +61 -0
  9. data/docs/.vitepress/theme/index.ts +4 -0
  10. data/docs/api-examples.md +49 -0
  11. data/docs/guide/getting-started/authorization.md +296 -0
  12. data/docs/guide/getting-started/core-concepts.md +432 -0
  13. data/docs/guide/getting-started/index.md +18 -0
  14. data/docs/guide/getting-started/installation.md +269 -0
  15. data/docs/guide/getting-started/resources.md +254 -0
  16. data/docs/guide/what-is-plutonium.md +211 -0
  17. data/docs/index.md +43 -0
  18. data/docs/markdown-examples.md +85 -0
  19. data/docs/public/android-chrome-192x192.png +0 -0
  20. data/docs/public/android-chrome-512x512.png +0 -0
  21. data/docs/public/apple-touch-icon.png +0 -0
  22. data/docs/public/favicon-16x16.png +0 -0
  23. data/docs/public/favicon-32x32.png +0 -0
  24. data/docs/public/favicon.ico +0 -0
  25. data/docs/public/plutonium.png +0 -0
  26. data/docs/public/site.webmanifest +1 -0
  27. data/docs/public/templates/plutonium.rb +21 -0
  28. data/lib/generators/pu/core/assets/assets_generator.rb +2 -3
  29. data/lib/generators/pu/core/assets/templates/tailwind.config.js +2 -2
  30. data/lib/generators/pu/core/install/install_generator.rb +9 -1
  31. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +0 -1
  32. data/lib/plutonium/core/controllers/authorizable.rb +1 -1
  33. data/lib/plutonium/definition/base.rb +8 -0
  34. data/lib/plutonium/definition/defineable_props.rb +1 -1
  35. data/lib/plutonium/definition/presentable.rb +71 -0
  36. data/lib/plutonium/interaction/README.md +1 -1
  37. data/lib/plutonium/interaction/base.rb +6 -6
  38. data/lib/plutonium/lib/deep_freezer.rb +31 -0
  39. data/lib/plutonium/query/adhoc_block.rb +19 -0
  40. data/lib/plutonium/query/base.rb +29 -0
  41. data/lib/plutonium/query/filter.rb +12 -0
  42. data/lib/plutonium/query/filters/text.rb +77 -0
  43. data/lib/plutonium/query/model_scope.rb +19 -0
  44. data/lib/plutonium/railtie.rb +0 -10
  45. data/lib/plutonium/resource/controller.rb +0 -3
  46. data/lib/plutonium/resource/controllers/crud_actions/index_action.rb +26 -0
  47. data/lib/plutonium/resource/controllers/crud_actions.rb +3 -6
  48. data/lib/plutonium/resource/controllers/defineable.rb +0 -2
  49. data/lib/plutonium/resource/controllers/queryable.rb +36 -20
  50. data/lib/plutonium/resource/policy.rb +5 -6
  51. data/lib/plutonium/resource/query_object.rb +61 -147
  52. data/lib/plutonium/resource/register.rb +3 -0
  53. data/lib/plutonium/{refinements/parameter_refinements.rb → support/parameters.rb} +5 -7
  54. data/lib/plutonium/ui/action_button.rb +34 -19
  55. data/lib/plutonium/ui/component/methods.rb +1 -1
  56. data/lib/plutonium/ui/display/resource.rb +19 -15
  57. data/lib/plutonium/ui/form/query.rb +171 -0
  58. data/lib/plutonium/ui/form/resource.rb +22 -17
  59. data/lib/plutonium/ui/table/components/scopes_bar.rb +1 -1
  60. data/lib/plutonium/ui/table/components/search_bar.rb +6 -139
  61. data/lib/plutonium/ui/table/resource.rb +10 -9
  62. data/lib/plutonium/version.rb +1 -1
  63. data/package-lock.json +5769 -1853
  64. data/package.json +11 -5
  65. data/src/js/core.js +0 -1
  66. data/tailwind.options.js +89 -11
  67. metadata +37 -13
  68. data/app/assets/plutonium-original.png +0 -0
  69. data/app/assets/plutonium-white.png +0 -0
  70. data/lib/plutonium/interaction/concerns/presentable.rb +0 -73
  71. data/public/plutonium-assets/fonts/bootstrap-icons.woff +0 -0
  72. data/public/plutonium-assets/fonts/bootstrap-icons.woff2 +0 -0
  73. /data/{templates → docs/public/templates}/base.rb +0 -0
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radioactive-labs/plutonium",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Core assets for the Plutonium gem",
5
5
  "type": "module",
6
6
  "main": "src/js/core.js",
@@ -16,7 +16,7 @@
16
16
  "type": "git",
17
17
  "url": "git+https://github.com/radioactive-labs/plutonium-core.git"
18
18
  },
19
- "homepage": "https://github.com/radioactive-labs/plutonium-core#readme",
19
+ "homepage": "https://radioactive-labs.github.io/plutonium-core/",
20
20
  "dependencies": {
21
21
  "@hotwired/stimulus": "^3.2.2",
22
22
  "@hotwired/turbo": "^8.0.4",
@@ -30,18 +30,24 @@
30
30
  "cssnano": "^7.0.2",
31
31
  "esbuild": "^0.20.1",
32
32
  "esbuild-plugin-manifest": "^1.0.3",
33
+ "mermaid": "^11.4.0",
33
34
  "postcss": "^8.4.35",
34
35
  "postcss-cli": "^11.0.0",
35
36
  "postcss-hash": "^3.0.0",
36
- "tailwindcss": "^3.4.1"
37
+ "tailwindcss": "^3.4.1",
38
+ "vitepress": "^1.4.1",
39
+ "vitepress-plugin-mermaid": "^2.0.17"
37
40
  },
38
41
  "scripts": {
39
- "build": "npm run js:prod && npm run css:prod",
40
42
  "dev": "concurrently \"npm run css:dev\" \"npm run js:dev\"",
43
+ "build": "npm run js:prod && npm run css:prod",
44
+ "prepare": "npm run build",
41
45
  "css:dev": "postcss src/css/plutonium.css -o src/build/plutonium.css --watch --dev",
42
46
  "js:dev": "node esbuild.config.js --dev",
43
47
  "css:prod": "postcss src/css/plutonium.css -o app/assets/plutonium.css && postcss src/css/plutonium.css -o src/dist/css/plutonium.css",
44
48
  "js:prod": "node esbuild.config.js",
45
- "prepare": "npm run build"
49
+ "docs:dev": "vitepress dev docs",
50
+ "docs:build": "vitepress build docs",
51
+ "docs:preview": "vitepress preview docs"
46
52
  }
47
53
  }
data/src/js/core.js CHANGED
@@ -1,4 +1,3 @@
1
1
  import registerControllers from "./controllers/register_controllers.js"
2
2
 
3
-
4
3
  export { registerControllers }
data/tailwind.options.js CHANGED
@@ -18,17 +18,95 @@ export const theme = {
18
18
  extend: {
19
19
  colors: {
20
20
  primary: {
21
- '50': '#f0f7fe',
22
- '100': '#ddecfc',
23
- '200': '#c3dffa',
24
- '300': '#99ccf7',
25
- '400': '#69b0f1',
26
- '500': '#4691eb',
27
- '600': '#3174df',
28
- '700': '#285fcc',
29
- '800': '#274ea6',
30
- '900': '#244484',
31
- '950': '#1b2b50',
21
+ 50: '#F0FDFD',
22
+ 100: '#E0FAFA',
23
+ 200: '#BAF3F5',
24
+ 300: '#7DE8EC',
25
+ 400: '#40D9DE',
26
+ 500: '#17B8BE', // Turquoise
27
+ 600: '#0E8F94',
28
+ 700: '#0B6D71',
29
+ 800: '#0A5558',
30
+ 900: '#084547',
31
+ 950: '#042F30',
32
+ },
33
+ secondary: {
34
+ 50: '#F2F5F8',
35
+ 100: '#E6ECF1',
36
+ 200: '#C7D5E1',
37
+ 300: '#9DB3C7',
38
+ 400: '#678CAB',
39
+ 500: '#1E3D59', // Navy
40
+ 600: '#1A3549',
41
+ 700: '#152C3D',
42
+ 800: '#102231',
43
+ 900: '#0C1B26',
44
+ 950: '#080F15',
45
+ },
46
+ success: {
47
+ 50: '#F0FDF4',
48
+ 100: '#DCFCE7',
49
+ 200: '#BBF7D0',
50
+ 300: '#86EFAC',
51
+ 400: '#4ADE80',
52
+ 500: '#22C55E', // Base color
53
+ 600: '#16A34A',
54
+ 700: '#15803D',
55
+ 800: '#166534',
56
+ 900: '#14532D',
57
+ 950: '#052E16',
58
+ },
59
+ info: {
60
+ 50: '#F0F9FF',
61
+ 100: '#E0F2FE',
62
+ 200: '#BAE6FD',
63
+ 300: '#7DD3FC',
64
+ 400: '#38BDF8',
65
+ 500: '#0EA5E9', // Base color
66
+ 600: '#0284C7',
67
+ 700: '#0369A1',
68
+ 800: '#075985',
69
+ 900: '#0C4A6E',
70
+ 950: '#082F49',
71
+ },
72
+ warning: {
73
+ 50: '#FFFBEB',
74
+ 100: '#FEF3C7',
75
+ 200: '#FDE68A',
76
+ 300: '#FCD34D',
77
+ 400: '#FBBF24',
78
+ 500: '#F59E0B', // Base color
79
+ 600: '#D97706',
80
+ 700: '#B45309',
81
+ 800: '#92400E',
82
+ 900: '#78350F',
83
+ 950: '#451A03',
84
+ },
85
+ danger: {
86
+ 50: '#FEF2F2',
87
+ 100: '#FEE2E2',
88
+ 200: '#FECACA',
89
+ 300: '#FCA5A5',
90
+ 400: '#F87171',
91
+ 500: '#EF4444', // Base color
92
+ 600: '#DC2626',
93
+ 700: '#B91C1C',
94
+ 800: '#991B1B',
95
+ 900: '#7F1D1D',
96
+ 950: '#450A0A',
97
+ },
98
+ accent: {
99
+ 50: '#FFF1F3',
100
+ 100: '#FFE4E7',
101
+ 200: '#FFCCD2',
102
+ 300: '#FFB1BA',
103
+ 400: '#FF9EAA',
104
+ 500: '#FF8394', // Coral Pink
105
+ 600: '#FF647A',
106
+ 700: '#E73D55',
107
+ 800: '#D12D44',
108
+ 900: '#B02438',
109
+ 950: '#8E1525',
32
110
  },
33
111
  },
34
112
  screens: {
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.15.4
4
+ version: 0.15.6
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-10-06 00:00:00.000000000 Z
11
+ date: 2024-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -892,8 +892,6 @@ files:
892
892
  - app/assets/icons/solid/youtube.svg
893
893
  - app/assets/icons/solid/zoom-in.svg
894
894
  - app/assets/icons/solid/zoom-out.svg
895
- - app/assets/plutonium-original.png
896
- - app/assets/plutonium-white.png
897
895
  - app/assets/plutonium.css
898
896
  - app/assets/plutonium.ico
899
897
  - app/assets/plutonium.js
@@ -1032,6 +1030,28 @@ files:
1032
1030
  - config/initializers/pagy.rb
1033
1031
  - config/initializers/rabl.rb
1034
1032
  - config/initializers/simple_form.rb
1033
+ - docs/.vitepress/config.ts
1034
+ - docs/.vitepress/theme/custom.css
1035
+ - docs/.vitepress/theme/index.ts
1036
+ - docs/api-examples.md
1037
+ - docs/guide/getting-started/authorization.md
1038
+ - docs/guide/getting-started/core-concepts.md
1039
+ - docs/guide/getting-started/index.md
1040
+ - docs/guide/getting-started/installation.md
1041
+ - docs/guide/getting-started/resources.md
1042
+ - docs/guide/what-is-plutonium.md
1043
+ - docs/index.md
1044
+ - docs/markdown-examples.md
1045
+ - docs/public/android-chrome-192x192.png
1046
+ - docs/public/android-chrome-512x512.png
1047
+ - docs/public/apple-touch-icon.png
1048
+ - docs/public/favicon-16x16.png
1049
+ - docs/public/favicon-32x32.png
1050
+ - docs/public/favicon.ico
1051
+ - docs/public/plutonium.png
1052
+ - docs/public/site.webmanifest
1053
+ - docs/public/templates/base.rb
1054
+ - docs/public/templates/plutonium.rb
1035
1055
  - esbuild.config.js
1036
1056
  - exe/pug
1037
1057
  - gemfiles/rails_7.gemfile
@@ -1256,6 +1276,7 @@ files:
1256
1276
  - lib/plutonium/definition/base.rb
1257
1277
  - lib/plutonium/definition/config_attr.rb
1258
1278
  - lib/plutonium/definition/defineable_props.rb
1279
+ - lib/plutonium/definition/presentable.rb
1259
1280
  - lib/plutonium/definition/search.rb
1260
1281
  - lib/plutonium/definition/sorting.rb
1261
1282
  - lib/plutonium/engine.rb
@@ -1275,7 +1296,6 @@ files:
1275
1296
  - lib/plutonium/icons.rb
1276
1297
  - lib/plutonium/interaction/README.md
1277
1298
  - lib/plutonium/interaction/base.rb
1278
- - lib/plutonium/interaction/concerns/presentable.rb
1279
1299
  - lib/plutonium/interaction/concerns/workflow_dsl.rb
1280
1300
  - lib/plutonium/interaction/outcome.rb
1281
1301
  - lib/plutonium/interaction/response/base.rb
@@ -1286,6 +1306,7 @@ files:
1286
1306
  - lib/plutonium/interaction/response/render.rb
1287
1307
  - lib/plutonium/lib/after_commit.rb
1288
1308
  - lib/plutonium/lib/bit_flags.rb
1309
+ - lib/plutonium/lib/deep_freezer.rb
1289
1310
  - lib/plutonium/lib/overlayed_hash.rb
1290
1311
  - lib/plutonium/lib/smart_cache.rb
1291
1312
  - lib/plutonium/models/has_cents.rb
@@ -1295,13 +1316,18 @@ files:
1295
1316
  - lib/plutonium/portal/engine.rb
1296
1317
  - lib/plutonium/preserved__/field.rb.bk
1297
1318
  - lib/plutonium/preserved__/input.rb.bk
1319
+ - lib/plutonium/query/adhoc_block.rb
1320
+ - lib/plutonium/query/base.rb
1321
+ - lib/plutonium/query/filter.rb
1322
+ - lib/plutonium/query/filters/text.rb
1323
+ - lib/plutonium/query/model_scope.rb
1298
1324
  - lib/plutonium/railtie.rb
1299
- - lib/plutonium/refinements/parameter_refinements.rb
1300
1325
  - lib/plutonium/reloader.rb
1301
1326
  - lib/plutonium/resource/context.rb
1302
1327
  - lib/plutonium/resource/controller.rb
1303
1328
  - lib/plutonium/resource/controllers/authorizable.rb
1304
1329
  - lib/plutonium/resource/controllers/crud_actions.rb
1330
+ - lib/plutonium/resource/controllers/crud_actions/index_action.rb
1305
1331
  - lib/plutonium/resource/controllers/defineable.rb
1306
1332
  - lib/plutonium/resource/controllers/interactive_actions.rb
1307
1333
  - lib/plutonium/resource/controllers/presentable.rb
@@ -1319,6 +1345,7 @@ files:
1319
1345
  - lib/plutonium/routing/route_set_extensions.rb
1320
1346
  - lib/plutonium/simple_form/attachment_component.rb
1321
1347
  - lib/plutonium/simple_form/input_group_component.rb
1348
+ - lib/plutonium/support/parameters.rb
1322
1349
  - lib/plutonium/ui.rb
1323
1350
  - lib/plutonium/ui/action_button.rb
1324
1351
  - lib/plutonium/ui/breadcrumbs.rb
@@ -1334,6 +1361,7 @@ files:
1334
1361
  - lib/plutonium/ui/empty_card.rb
1335
1362
  - lib/plutonium/ui/form/base.rb
1336
1363
  - lib/plutonium/ui/form/interaction.rb
1364
+ - lib/plutonium/ui/form/query.rb
1337
1365
  - lib/plutonium/ui/form/resource.rb
1338
1366
  - lib/plutonium/ui/form/theme.rb
1339
1367
  - lib/plutonium/ui/page/base.rb
@@ -1359,8 +1387,6 @@ files:
1359
1387
  - postcss.config.js
1360
1388
  - public/.keep
1361
1389
  - public/plutonium-assets/application.js
1362
- - public/plutonium-assets/fonts/bootstrap-icons.woff
1363
- - public/plutonium-assets/fonts/bootstrap-icons.woff2
1364
1390
  - public/plutonium-assets/plutonium-logo-original.png
1365
1391
  - public/plutonium-assets/plutonium-logo-white.png
1366
1392
  - public/plutonium-assets/plutonium-logo.png
@@ -1399,13 +1425,12 @@ files:
1399
1425
  - src/js/turbo/turbo_frame_monkey_patch.js
1400
1426
  - tailwind.config.js
1401
1427
  - tailwind.options.js
1402
- - templates/base.rb
1403
- homepage: https://github.com/radioactive-labs/plutonium-core
1428
+ homepage: https://radioactive-labs.github.io/plutonium-core/
1404
1429
  licenses:
1405
1430
  - MIT
1406
1431
  metadata:
1407
1432
  allowed_push_host: https://rubygems.org
1408
- homepage_uri: https://github.com/radioactive-labs/plutonium-core
1433
+ homepage_uri: https://radioactive-labs.github.io/plutonium-core/
1409
1434
  source_code_uri: https://github.com/radioactive-labs/plutonium-core
1410
1435
  post_install_message:
1411
1436
  rdoc_options: []
@@ -1425,6 +1450,5 @@ requirements: []
1425
1450
  rubygems_version: 3.4.10
1426
1451
  signing_key:
1427
1452
  specification_version: 4
1428
- summary: The ultimate Rapid Application Development Toolkit (RADKit) for Rails application
1429
- development
1453
+ summary: The Ultimate Rapid Application Development Toolkit (RADKit) for Rails
1430
1454
  test_files: []
Binary file
Binary file
@@ -1,73 +0,0 @@
1
- module Plutonium
2
- module Interaction
3
- module Concerns
4
- # Provides presentation-related functionality for interactions.
5
- #
6
- # This module allows interactions to define metadata such as labels, icons,
7
- # and descriptions, which can be used for UI generation or documentation.
8
- #
9
- # @example
10
- # class MyInteraction < Plutonium::Interaction::Base
11
- # include Plutonium::Interaction::Concerns::Presentable
12
- #
13
- # presents label: "My Interaction",
14
- # icon: "star",
15
- # description: "Does something awesome"
16
- #
17
- # # ... rest of the interaction
18
- # end
19
- module Presentable
20
- extend ActiveSupport::Concern
21
-
22
- included do
23
- class_attribute :presentation_metadata, default: {}
24
- end
25
-
26
- class_methods do
27
- # Defines presentation metadata for the interaction.
28
- #
29
- # @param options [Hash] The presentation options.
30
- # @option options [String] :label The label for the interaction.
31
- # @option options [String] :icon The icon for the interaction.
32
- # @option options [String] :description The description of the interaction.
33
- def presents(**options)
34
- self.presentation_metadata = options
35
- end
36
-
37
- # Returns the label for the interaction.
38
- #
39
- # @return [String] The label defined in the presentation metadata or a default generated from the class name.
40
- def label
41
- presentation_metadata[:label] || name.demodulize.titleize
42
- end
43
-
44
- # Returns the icon for the interaction.
45
- #
46
- # @return [String, nil] The icon defined in the presentation metadata.
47
- def icon
48
- presentation_metadata[:icon]
49
- end
50
-
51
- # Returns the description for the interaction.
52
- #
53
- # @return [String, nil] The description defined in the presentation metadata.
54
- def description
55
- presentation_metadata[:description]
56
- end
57
- end
58
-
59
- def label
60
- self.class.label
61
- end
62
-
63
- def icon
64
- self.class.icon
65
- end
66
-
67
- def description
68
- self.class.description
69
- end
70
- end
71
- end
72
- end
73
- end
File without changes