plutonium 0.19.12 → 0.20.0

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.
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radioactive-labs/plutonium",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "Core assets for the Plutonium gem",
5
5
  "type": "module",
6
6
  "main": "src/js/core.js",
@@ -30,9 +30,9 @@
30
30
  "marked": "^15.0.3"
31
31
  },
32
32
  "devDependencies": {
33
- "@tailwindcss/forms": "^0.5.7",
34
- "@tailwindcss/typography": "^0.5.15",
35
- "autoprefixer": "^10.4.18",
33
+ "@tailwindcss/forms": "^0.5.10",
34
+ "@tailwindcss/postcss": "^4.0.9",
35
+ "@tailwindcss/typography": "^0.5.16",
36
36
  "concurrently": "^8.2.2",
37
37
  "cssnano": "^7.0.2",
38
38
  "esbuild": "^0.20.1",
@@ -42,7 +42,8 @@
42
42
  "postcss": "^8.4.35",
43
43
  "postcss-cli": "^11.0.0",
44
44
  "postcss-hash": "^3.0.0",
45
- "tailwindcss": "^3.4.1",
45
+ "postcss-import": "^16.1.0",
46
+ "tailwindcss": "^4.0.9",
46
47
  "vitepress": "^1.4.1",
47
48
  "vitepress-plugin-mermaid": "^2.0.17"
48
49
  },
@@ -50,9 +51,9 @@
50
51
  "dev": "concurrently \"npm run css:dev\" \"npm run js:dev\"",
51
52
  "build": "npm run js:prod && npm run css:prod",
52
53
  "prepare": "npm run build",
53
- "css:dev": "postcss src/css/plutonium.css -o src/build/plutonium.css --watch --dev",
54
+ "css:dev": "postcss src/css/plutonium.entry.css -o src/build/plutonium.css --watch --dev",
54
55
  "js:dev": "node esbuild.config.js --dev",
55
- "css:prod": "postcss src/css/plutonium.css -o app/assets/plutonium.css && postcss src/css/plutonium.css -o src/dist/css/plutonium.css",
56
+ "css:prod": "postcss src/css/plutonium.entry.css -o app/assets/plutonium.css && postcss src/css/plutonium.entry.css -o src/dist/css/plutonium.css",
56
57
  "js:prod": "node esbuild.config.js",
57
58
  "docs:dev": "vitepress dev docs",
58
59
  "docs:build": "vitepress build docs",
data/postcss.config.js CHANGED
@@ -1,8 +1,7 @@
1
1
  const config = {
2
2
  plugins: {
3
3
  'postcss-import': {},
4
- tailwindcss: {},
5
- autoprefixer: {}
4
+ '@tailwindcss/postcss': {}
6
5
  }
7
6
  }
8
7
 
data/src/css/easymde.css CHANGED
@@ -17,7 +17,7 @@
17
17
  }
18
18
 
19
19
  .CodeMirror-scroll {
20
- overflow: scroll !important;
20
+ overflow: scroll;
21
21
  margin-bottom: -50px;
22
22
  margin-right: -50px;
23
23
  padding-bottom: 50px;
@@ -92,7 +92,7 @@
92
92
 
93
93
  .cm-fat-cursor .CodeMirror-cursor {
94
94
  width: auto;
95
- border: 0 !important;
95
+ border: 0;
96
96
  background: #77ee77;
97
97
  }
98
98
 
@@ -149,8 +149,8 @@
149
149
  .CodeMirror-gutter-wrapper {
150
150
  position: absolute;
151
151
  z-index: 4;
152
- background: none !important;
153
- border: none !important;
152
+ background: none;
153
+ border: none;
154
154
  }
155
155
 
156
156
  /* EasyMDE Container */
@@ -287,10 +287,6 @@
287
287
  }
288
288
 
289
289
  /* Syntax Highlighting */
290
- /* .cm-s-easymde .cm-header {
291
- @apply text-blue-600 dark:text-blue-400;
292
- } */
293
-
294
290
  .cm-s-easymde .cm-em {
295
291
  @apply italic text-secondary-600 dark:text-secondary-400;
296
292
  }
@@ -340,14 +336,13 @@
340
336
  }
341
337
 
342
338
  .cm-formatting.cm-formatting-link {
343
- @apply text-secondary-900 dark:text-secondary-400 !important;
339
+ @apply text-secondary-900 dark:text-secondary-400;
344
340
  }
345
341
 
346
342
  .cm-formatting.cm-formatting-link-string {
347
- @apply text-secondary-900 dark:text-secondary-400 !important;
343
+ @apply text-secondary-900 dark:text-secondary-400;
348
344
  }
349
345
 
350
-
351
346
  .cm-s-easymde .cm-string {
352
347
  @apply text-accent-600 dark:text-accent-400;
353
348
  }
@@ -356,10 +351,6 @@
356
351
  @apply text-accent-600 dark:text-accent-400;
357
352
  }
358
353
 
359
- /* .cm-s-easymde .cm-link {
360
- @apply text-accent-600 dark:text-accent-400;
361
- } */
362
-
363
354
  .cm-s-easymde .cm-url {
364
355
  @apply text-gray-900 dark:text-white;
365
356
  }
@@ -514,7 +505,7 @@
514
505
  .cm-fat-cursor .CodeMirror-cursor {
515
506
  @apply bg-[#7e7];
516
507
  width: auto;
517
- border: 0 !important;
508
+ border: 0;
518
509
  }
519
510
 
520
511
  .cm-fat-cursor div.CodeMirror-cursors {
@@ -723,4 +714,9 @@
723
714
  .editor-preview-full table th {
724
715
  @apply border border-gray-300 dark:border-gray-600 p-1.5;
725
716
  }
717
+
718
+ /* Hide elements that need to be hidden without !important */
719
+ .ss-content .ss-list .ss-optgroup.ss-close .ss-option {
720
+ display: none;
721
+ }
726
722
  }
@@ -2,6 +2,4 @@
2
2
  @import "easymde.css";
3
3
  @import "slim_select.css";
4
4
 
5
- @tailwind base;
6
- @tailwind components;
7
- @tailwind utilities;
5
+ @import 'tailwindcss';
@@ -0,0 +1,22 @@
1
+ @import "plutonium.css";
2
+
3
+ @config '../../tailwind.config.js';
4
+
5
+ /*
6
+ The default border color has changed to `currentColor` in Tailwind CSS v4,
7
+ so we've added these compatibility styles to make sure everything still
8
+ looks the same as it did with Tailwind CSS v3.
9
+
10
+ If we ever want to remove these styles, we need to add an explicit border
11
+ color utility to any element that depends on these defaults.
12
+ */
13
+ @layer base {
14
+
15
+ *,
16
+ ::after,
17
+ ::before,
18
+ ::backdrop,
19
+ ::file-selector-button {
20
+ border-color: var(--color-gray-200, currentColor);
21
+ }
22
+ }
@@ -33,26 +33,30 @@
33
33
 
34
34
  @keyframes ss-valueIn {
35
35
  0% {
36
- @apply scale-0 opacity-0;
36
+ transform: scale(0);
37
+ opacity: 0;
37
38
  }
38
39
 
39
40
  100% {
40
- @apply scale-100 opacity-100;
41
+ transform: scale(1);
42
+ opacity: 1;
41
43
  }
42
44
  }
43
45
 
44
46
  @keyframes ss-valueOut {
45
47
  0% {
46
- @apply scale-100 opacity-100;
48
+ transform: scale(1);
49
+ opacity: 1;
47
50
  }
48
51
 
49
52
  100% {
50
- @apply scale-0 opacity-0;
53
+ transform: scale(0);
54
+ opacity: 0;
51
55
  }
52
56
  }
53
57
 
54
58
  .ss-hide {
55
- @apply hidden !important;
59
+ display: none;
56
60
  }
57
61
 
58
62
  .ss-main {
@@ -146,7 +150,9 @@
146
150
  }
147
151
 
148
152
  .ss-content {
149
- @apply absolute flex h-auto flex-col w-auto max-h-[300px] box-border border rounded-b-md shadow-lg border-gray-300 bg-white dark:bg-gray-700 dark:border-gray-600 transition-all duration-200 opacity-0 scale-y-0 origin-top overflow-hidden z-[10000];
153
+ @apply absolute flex h-auto flex-col w-auto max-h-[300px] box-border border rounded-b-md shadow-lg border-gray-300 bg-white dark:bg-gray-700 dark:border-gray-600 transition-all duration-200 opacity-0 z-[10000];
154
+ transform: scaleY(0);
155
+ transform-origin: top;
150
156
  }
151
157
 
152
158
  .ss-content.ss-relative {
@@ -158,11 +164,15 @@
158
164
  }
159
165
 
160
166
  .ss-content.ss-open-above {
161
- @apply flex-col-reverse opacity-100 scale-y-100 origin-bottom rounded-t-md;
167
+ @apply flex-col-reverse opacity-100 rounded-t-md;
168
+ transform: scaleY(1);
169
+ transform-origin: bottom;
162
170
  }
163
171
 
164
172
  .ss-content.ss-open-below {
165
- @apply opacity-100 scale-y-100 origin-top rounded-b-md;
173
+ @apply opacity-100 rounded-b-md;
174
+ transform: scaleY(1);
175
+ transform-origin: top;
166
176
  }
167
177
 
168
178
  .ss-content .ss-search {
@@ -201,7 +211,7 @@
201
211
  }
202
212
 
203
213
  .ss-content .ss-list .ss-optgroup.ss-close .ss-option {
204
- @apply hidden !important;
214
+ display: none;
205
215
  }
206
216
 
207
217
  /* Update the specific no results style */
@@ -0,0 +1,17 @@
1
+ import { Controller } from "@hotwired/stimulus";
2
+
3
+ export default class extends Controller {
4
+ static targets = ["password", "checkbox"];
5
+
6
+ connect() {
7
+ this.checkboxTarget.checked = false // ensure password is hidden by default
8
+ }
9
+
10
+ toggle() {
11
+ if (this.passwordTarget.type == "password") {
12
+ this.passwordTargets.forEach((passwordTarget) => passwordTarget.type = "text")
13
+ } else {
14
+ this.passwordTargets.forEach((passwordTarget) => passwordTarget.type = "password")
15
+ }
16
+ }
17
+ }
@@ -17,9 +17,11 @@ import AttachmentInputController from "./attachment_input_controller.js"
17
17
  import AttachmentPreviewController from "./attachment_preview_controller.js"
18
18
  import AttachmentPreviewContainerController from "./attachment_preview_container_controller.js"
19
19
  import SidebarController from "./sidebar_controller.js"
20
+ import PasswordVisibilityController from "./password_visibility_controller.js"
20
21
 
21
22
  export default function (application) {
22
23
  // Register controllers here
24
+ application.register("password-visibility", PasswordVisibilityController)
23
25
  application.register("sidebar", SidebarController)
24
26
  application.register("resource-header", ResourceHeaderController)
25
27
  application.register("nested-resource-form-fields", NestedResourceFormFieldsController)
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.19.12
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-19 00:00:00.000000000 Z
11
+ date: 2025-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -459,6 +459,7 @@ files:
459
459
  - app/views/rodauth/_email_auth_request_form.html.erb
460
460
  - app/views/rodauth/_login_form.html.erb
461
461
  - app/views/rodauth/_login_form_footer.html.erb
462
+ - app/views/rodauth/_password_visibility.html.erb
462
463
  - app/views/rodauth/add_recovery_codes.html.erb
463
464
  - app/views/rodauth/change_login.html.erb
464
465
  - app/views/rodauth/change_password.html.erb
@@ -647,6 +648,7 @@ files:
647
648
  - lib/generators/pu/res/scaffold/templates/presenter.rb.tt
648
649
  - lib/generators/pu/res/scaffold/templates/query_object.rb.tt
649
650
  - lib/generators/pu/rodauth/account_generator.rb
651
+ - lib/generators/pu/rodauth/admin_generator.rb
650
652
  - lib/generators/pu/rodauth/concerns/account_selector.rb
651
653
  - lib/generators/pu/rodauth/concerns/configuration.rb
652
654
  - lib/generators/pu/rodauth/concerns/feature_selector.rb
@@ -681,6 +683,7 @@ files:
681
683
  - lib/generators/pu/rodauth/templates/app/rodauth/account_rodauth_plugin.rb.tt
682
684
  - lib/generators/pu/rodauth/templates/app/rodauth/rodauth_app.rb.tt
683
685
  - lib/generators/pu/rodauth/templates/app/rodauth/rodauth_plugin.rb.tt
686
+ - lib/generators/pu/rodauth/templates/app/views/_login_form_footer.html.erb.tt
684
687
  - lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/email_auth.text.erb
685
688
  - lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_disabled.text.erb
686
689
  - lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_locked_out.text.erb
@@ -698,6 +701,7 @@ files:
698
701
  - lib/generators/pu/rodauth/templates/config/initializers/rodauth.rb.tt
699
702
  - lib/generators/pu/rodauth/templates/db/migrate/create_rodauth.rb.tt
700
703
  - lib/generators/pu/rodauth/templates/db/migrate/install_rodauth.rb.tt
704
+ - lib/generators/pu/rodauth/templates/lib/tasks/rodauth_admin.rake.tt
701
705
  - lib/generators/pu/rodauth/views_generator.rb
702
706
  - lib/generators/pu/service/postgres/postgres_generator.rb
703
707
  - lib/generators/pu/service/postgres/templates/.keep
@@ -861,7 +865,7 @@ files:
861
865
  - lib/plutonium/version.rb
862
866
  - lib/rodauth/features/case_insensitive_login.rb
863
867
  - lib/rodauth/plugins.rb
864
- - lib/tasks/create_rodauth_admin.rake
868
+ - lib/tasks/.keep
865
869
  - package-lock.json
866
870
  - package.json
867
871
  - postcss-gem-import.js
@@ -877,6 +881,7 @@ files:
877
881
  - src/css/core.css
878
882
  - src/css/easymde.css
879
883
  - src/css/plutonium.css
884
+ - src/css/plutonium.entry.css
880
885
  - src/css/slim_select.css
881
886
  - src/js/controllers/attachment_input_controller.js
882
887
  - src/js/controllers/attachment_preview_container_controller.js
@@ -888,6 +893,7 @@ files:
888
893
  - src/js/controllers/frame_navigator_controller.js
889
894
  - src/js/controllers/intl_tel_input_controller.js
890
895
  - src/js/controllers/nested_resource_form_fields_controller.js
896
+ - src/js/controllers/password_visibility_controller.js
891
897
  - src/js/controllers/register_controllers.js
892
898
  - src/js/controllers/resource_collapse_controller.js
893
899
  - src/js/controllers/resource_dismiss_controller.js
@@ -1,16 +0,0 @@
1
- namespace :rodauth do
2
- desc "Create a Rodauth admin account"
3
- task admin: :environment do
4
- # require "rodauth"
5
- # require "active_record"
6
- require "tty-prompt"
7
-
8
- prompt = TTY::Prompt.new
9
- email = ENV["EMAIL"] || prompt.ask("email:", required: true)
10
- # password = SecureRandom.hex
11
- # password = ENV["PASSWORD"] || prompt.mask("password:", required: true)
12
- # password_confirm = ENV["PASSWORD"] || prompt.mask("password:", required: true)
13
-
14
- RodauthApp.rodauth(:admin).create_account(login: email)
15
- end
16
- end