plutonium 0.15.5 → 0.15.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) 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.js +25 -11
  5. data/app/assets/plutonium.js.map +2 -2
  6. data/app/assets/plutonium.min.js +4 -4
  7. data/app/assets/plutonium.min.js.map +3 -3
  8. data/app/assets/plutonium.png +0 -0
  9. data/app/views/layouts/rodauth.html.erb +2 -2
  10. data/docs/.vitepress/config.ts +61 -0
  11. data/docs/.vitepress/theme/custom.css +61 -0
  12. data/docs/.vitepress/theme/index.ts +4 -0
  13. data/docs/api-examples.md +49 -0
  14. data/docs/guide/getting-started/authorization.md +296 -0
  15. data/docs/guide/getting-started/core-concepts.md +432 -0
  16. data/docs/guide/getting-started/index.md +18 -0
  17. data/docs/guide/getting-started/installation.md +270 -0
  18. data/docs/guide/getting-started/resources.md +250 -0
  19. data/docs/guide/what-is-plutonium.md +211 -0
  20. data/docs/index.md +43 -0
  21. data/docs/markdown-examples.md +85 -0
  22. data/docs/public/android-chrome-192x192.png +0 -0
  23. data/docs/public/android-chrome-512x512.png +0 -0
  24. data/docs/public/apple-touch-icon.png +0 -0
  25. data/docs/public/favicon-16x16.png +0 -0
  26. data/docs/public/favicon-32x32.png +0 -0
  27. data/docs/public/favicon.ico +0 -0
  28. data/docs/public/plutonium.png +0 -0
  29. data/docs/public/site.webmanifest +1 -0
  30. data/docs/public/templates/plutonium.rb +29 -0
  31. data/lib/generators/pu/core/assets/assets_generator.rb +2 -3
  32. data/lib/generators/pu/core/assets/templates/tailwind.config.js +2 -2
  33. data/lib/generators/pu/core/install/install_generator.rb +9 -1
  34. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +0 -1
  35. data/lib/generators/pu/eject/layout/layout_generator.rb +3 -3
  36. data/lib/generators/pu/eject/shell/shell_generator.rb +3 -3
  37. data/lib/generators/pu/gem/dotenv/dotenv_generator.rb +1 -1
  38. data/lib/generators/pu/gem/letter_opener/letter_opener_generator.rb +21 -0
  39. data/lib/generators/pu/gem/redis/redis_generator.rb +0 -2
  40. data/lib/generators/pu/gem/standard/standard_generator.rb +19 -0
  41. data/lib/generators/pu/lib/plutonium_generators/generator.rb +1 -1
  42. data/lib/generators/pu/res/conn/conn_generator.rb +1 -1
  43. data/lib/plutonium/core/controllers/authorizable.rb +1 -1
  44. data/lib/plutonium/definition/actions.rb +6 -2
  45. data/lib/plutonium/definition/base.rb +1 -0
  46. data/lib/plutonium/definition/nested_inputs.rb +19 -0
  47. data/lib/plutonium/railtie.rb +0 -10
  48. data/lib/plutonium/resource/controller.rb +1 -1
  49. data/lib/plutonium/resource/controllers/crud_actions.rb +1 -1
  50. data/lib/plutonium/resource/controllers/interactive_actions.rb +1 -1
  51. data/lib/plutonium/resource/controllers/presentable.rb +1 -5
  52. data/lib/plutonium/resource/policy.rb +4 -5
  53. data/lib/plutonium/resource/register.rb +3 -0
  54. data/lib/plutonium/ui/action_button.rb +34 -19
  55. data/lib/plutonium/ui/block.rb +13 -0
  56. data/lib/plutonium/ui/component/kit.rb +10 -0
  57. data/lib/plutonium/ui/display/resource.rb +29 -11
  58. data/lib/plutonium/ui/display/theme.rb +1 -1
  59. data/lib/plutonium/ui/dyna_frame/content.rb +2 -2
  60. data/lib/plutonium/ui/dyna_frame/host.rb +20 -0
  61. data/lib/plutonium/ui/form/concerns/renders_nested_resource_fields.rb +282 -0
  62. data/lib/plutonium/ui/form/resource.rb +40 -29
  63. data/lib/plutonium/ui/form/theme.rb +1 -1
  64. data/lib/plutonium/ui/frame_navigator_panel.rb +53 -0
  65. data/lib/plutonium/ui/panel.rb +63 -0
  66. data/lib/plutonium/ui/skeleton_table.rb +29 -0
  67. data/lib/plutonium/ui/table/components/search_bar.rb +1 -1
  68. data/lib/plutonium/ui/table/resource.rb +1 -1
  69. data/lib/plutonium/version.rb +1 -1
  70. data/package-lock.json +5767 -1851
  71. data/package.json +10 -4
  72. data/src/js/controllers/frame_navigator_controller.js +25 -8
  73. data/src/js/controllers/nested_resource_form_fields_controller.js +2 -2
  74. data/src/js/core.js +0 -1
  75. data/tailwind.options.js +89 -11
  76. metadata +36 -12
  77. data/app/assets/plutonium-original.png +0 -0
  78. data/app/assets/plutonium-white.png +0 -0
  79. data/lib/generators/pu/gem/redis/templates/.keep +0 -0
  80. data/public/plutonium-assets/fonts/bootstrap-icons.woff +0 -0
  81. data/public/plutonium-assets/fonts/bootstrap-icons.woff2 +0 -0
  82. /data/{templates → docs/public/templates}/base.rb +0 -0
data/package.json CHANGED
@@ -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
  }
@@ -6,6 +6,7 @@ export default class extends Controller {
6
6
 
7
7
  connect() {
8
8
  console.log(`frame-navigator connected: ${this.element}`)
9
+ this.#loadingStarted()
9
10
 
10
11
  this.srcHistory = []
11
12
  this.originalFrameSrc = this.frameTarget.src
@@ -32,6 +33,9 @@ export default class extends Controller {
32
33
  this.frameLoading = this.frameLoading.bind(this);
33
34
  this.frameTarget.addEventListener("turbo:click", this.frameLoading);
34
35
  this.frameTarget.addEventListener("turbo:submit-start", this.frameLoading);
36
+
37
+ this.frameFailed = this.frameFailed.bind(this);
38
+ this.frameTarget.addEventListener("turbo:fetch-request-error", this.frameFailed);
35
39
  }
36
40
 
37
41
  disconnect() {
@@ -42,16 +46,19 @@ export default class extends Controller {
42
46
  this.frameTarget.removeEventListener("turbo:frame-load", this.frameLoaded);
43
47
  this.frameTarget.removeEventListener("turbo:click", this.frameLoading);
44
48
  this.frameTarget.removeEventListener("turbo:submit-start", this.frameLoading);
49
+ this.frameTarget.removeEventListener("turbo:fetch-request-error", this.frameFailed);
45
50
  }
46
51
 
47
52
  frameLoading(event) {
48
- if (this.hasRefreshButtonTarget) this.refreshButtonTarget.classList.add("motion-safe:animate-spin")
49
- this.frameTarget.classList.add("motion-safe:animate-pulse")
53
+ this.#loadingStarted()
54
+ }
55
+
56
+ frameFailed(event) {
57
+ this.#loadingStopped()
50
58
  }
51
59
 
52
60
  frameLoaded(event) {
53
- if (this.hasRefreshButtonTarget) this.refreshButtonTarget.classList.remove("motion-safe:animate-spin")
54
- this.frameTarget.classList.remove("motion-safe:animate-pulse")
61
+ this.#loadingStopped()
55
62
 
56
63
  let src = event.target.src
57
64
  if (src == this.currentSrc) {
@@ -63,7 +70,7 @@ export default class extends Controller {
63
70
  else
64
71
  this.srcHistory.push(src)
65
72
 
66
- this.updateNavigationButtonsDisplay()
73
+ this.#updateNavigationButtonsDisplay()
67
74
  }
68
75
 
69
76
  refreshButtonClicked(event) {
@@ -87,13 +94,23 @@ export default class extends Controller {
87
94
 
88
95
  get currentSrc() { return this.srcHistory[this.srcHistory.length - 1] }
89
96
 
90
- updateNavigationButtonsDisplay() {
97
+ #loadingStarted() {
98
+ if (this.hasRefreshButtonTarget) this.refreshButtonTarget.classList.add("motion-safe:animate-spin")
99
+ this.frameTarget.classList.add("motion-safe:animate-pulse")
100
+ }
101
+
102
+ #loadingStopped() {
103
+ if (this.hasRefreshButtonTarget) this.refreshButtonTarget.classList.remove("motion-safe:animate-spin")
104
+ this.frameTarget.classList.remove("motion-safe:animate-pulse")
105
+ }
106
+
107
+ #updateNavigationButtonsDisplay() {
91
108
  if (this.hasHomeButtonTarget) {
92
- this.homeButtonTarget.style.display = this.srcHistory.length > 1 ? '' : 'none'
109
+ this.homeButtonTarget.style.display = this.srcHistory.length > 2 ? '' : 'none'
93
110
  }
94
111
 
95
112
  if (this.hasBackButtonTarget) {
96
- this.backButtonTarget.style.display = this.srcHistory.length > 2 ? '' : 'none'
113
+ this.backButtonTarget.style.display = this.srcHistory.length > 1 ? '' : 'none'
97
114
  }
98
115
  }
99
116
  }
@@ -33,11 +33,11 @@ export default class extends Controller {
33
33
  e.preventDefault()
34
34
 
35
35
  const wrapper = e.target.closest(this.wrapperSelectorValue)
36
-
37
- if (wrapper.dataset.newRecord === "true") {
36
+ if (wrapper.dataset.newRecord !== undefined) {
38
37
  wrapper.remove()
39
38
  } else {
40
39
  wrapper.style.display = "none"
40
+ wrapper.classList.remove(...wrapper.classList)
41
41
 
42
42
  const input = wrapper.querySelector("input[name*='_destroy']")
43
43
  input.value = "1"
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.5
4
+ version: 0.15.7
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-28 00:00:00.000000000 Z
11
+ date: 2024-11-05 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
@@ -1079,8 +1099,9 @@ files:
1079
1099
  - lib/generators/pu/gem/dotenv/templates/.env.template
1080
1100
  - lib/generators/pu/gem/dotenv/templates/.keep
1081
1101
  - lib/generators/pu/gem/dotenv/templates/config/initializers/001_ensure_required_env.rb
1102
+ - lib/generators/pu/gem/letter_opener/letter_opener_generator.rb
1082
1103
  - lib/generators/pu/gem/redis/redis_generator.rb
1083
- - lib/generators/pu/gem/redis/templates/.keep
1104
+ - lib/generators/pu/gem/standard/standard_generator.rb
1084
1105
  - lib/generators/pu/gen/component/component_generator.rb
1085
1106
  - lib/generators/pu/gen/component/templates/component.html.erb.tt
1086
1107
  - lib/generators/pu/gen/component/templates/component.rb.tt
@@ -1256,6 +1277,7 @@ files:
1256
1277
  - lib/plutonium/definition/base.rb
1257
1278
  - lib/plutonium/definition/config_attr.rb
1258
1279
  - lib/plutonium/definition/defineable_props.rb
1280
+ - lib/plutonium/definition/nested_inputs.rb
1259
1281
  - lib/plutonium/definition/presentable.rb
1260
1282
  - lib/plutonium/definition/search.rb
1261
1283
  - lib/plutonium/definition/sorting.rb
@@ -1328,6 +1350,7 @@ files:
1328
1350
  - lib/plutonium/support/parameters.rb
1329
1351
  - lib/plutonium/ui.rb
1330
1352
  - lib/plutonium/ui/action_button.rb
1353
+ - lib/plutonium/ui/block.rb
1331
1354
  - lib/plutonium/ui/breadcrumbs.rb
1332
1355
  - lib/plutonium/ui/component/base.rb
1333
1356
  - lib/plutonium/ui/component/behaviour.rb
@@ -1338,12 +1361,15 @@ files:
1338
1361
  - lib/plutonium/ui/display/resource.rb
1339
1362
  - lib/plutonium/ui/display/theme.rb
1340
1363
  - lib/plutonium/ui/dyna_frame/content.rb
1364
+ - lib/plutonium/ui/dyna_frame/host.rb
1341
1365
  - lib/plutonium/ui/empty_card.rb
1342
1366
  - lib/plutonium/ui/form/base.rb
1367
+ - lib/plutonium/ui/form/concerns/renders_nested_resource_fields.rb
1343
1368
  - lib/plutonium/ui/form/interaction.rb
1344
1369
  - lib/plutonium/ui/form/query.rb
1345
1370
  - lib/plutonium/ui/form/resource.rb
1346
1371
  - lib/plutonium/ui/form/theme.rb
1372
+ - lib/plutonium/ui/frame_navigator_panel.rb
1347
1373
  - lib/plutonium/ui/page/base.rb
1348
1374
  - lib/plutonium/ui/page/edit.rb
1349
1375
  - lib/plutonium/ui/page/index.rb
@@ -1351,6 +1377,8 @@ files:
1351
1377
  - lib/plutonium/ui/page/new.rb
1352
1378
  - lib/plutonium/ui/page/show.rb
1353
1379
  - lib/plutonium/ui/page_header.rb
1380
+ - lib/plutonium/ui/panel.rb
1381
+ - lib/plutonium/ui/skeleton_table.rb
1354
1382
  - lib/plutonium/ui/table/base.rb
1355
1383
  - lib/plutonium/ui/table/components/pagy_info.rb
1356
1384
  - lib/plutonium/ui/table/components/pagy_page_info.rb
@@ -1367,8 +1395,6 @@ files:
1367
1395
  - postcss.config.js
1368
1396
  - public/.keep
1369
1397
  - public/plutonium-assets/application.js
1370
- - public/plutonium-assets/fonts/bootstrap-icons.woff
1371
- - public/plutonium-assets/fonts/bootstrap-icons.woff2
1372
1398
  - public/plutonium-assets/plutonium-logo-original.png
1373
1399
  - public/plutonium-assets/plutonium-logo-white.png
1374
1400
  - public/plutonium-assets/plutonium-logo.png
@@ -1407,13 +1433,12 @@ files:
1407
1433
  - src/js/turbo/turbo_frame_monkey_patch.js
1408
1434
  - tailwind.config.js
1409
1435
  - tailwind.options.js
1410
- - templates/base.rb
1411
- homepage: https://github.com/radioactive-labs/plutonium-core
1436
+ homepage: https://radioactive-labs.github.io/plutonium-core/
1412
1437
  licenses:
1413
1438
  - MIT
1414
1439
  metadata:
1415
1440
  allowed_push_host: https://rubygems.org
1416
- homepage_uri: https://github.com/radioactive-labs/plutonium-core
1441
+ homepage_uri: https://radioactive-labs.github.io/plutonium-core/
1417
1442
  source_code_uri: https://github.com/radioactive-labs/plutonium-core
1418
1443
  post_install_message:
1419
1444
  rdoc_options: []
@@ -1433,6 +1458,5 @@ requirements: []
1433
1458
  rubygems_version: 3.4.10
1434
1459
  signing_key:
1435
1460
  specification_version: 4
1436
- summary: The ultimate Rapid Application Development Toolkit (RADKit) for Rails application
1437
- development
1461
+ summary: The Ultimate Rapid Application Development Toolkit (RADKit) for Rails
1438
1462
  test_files: []
Binary file
Binary file
File without changes
File without changes