spina 2.20.0 → 2.21.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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -2
  3. data/app/assets/builds/spina/tailwind.css +3338 -3725
  4. data/app/assets/javascripts/spina/controllers/confirm_controller.js +2 -2
  5. data/app/assets/javascripts/spina/controllers/navigation_controller.js +4 -4
  6. data/app/assets/stylesheets/spina/application.tailwind.css +105 -62
  7. data/app/components/spina/forms/switch_component.html.erb +2 -2
  8. data/app/components/spina/forms/trix_toolbar_component.html.erb +16 -33
  9. data/app/components/spina/media_picker/modal_component.html.erb +1 -1
  10. data/app/components/spina/media_picker/modal_component.rb +2 -2
  11. data/app/components/spina/pages/actions_component.html.erb +4 -4
  12. data/app/components/spina/pages/location_component.html.erb +2 -2
  13. data/app/components/spina/pages/new_page_button_component.html.erb +2 -2
  14. data/app/components/spina/pages/page_component.html.erb +1 -1
  15. data/app/components/spina/pages/page_component.rb +2 -2
  16. data/app/components/spina/pages/translations_component.html.erb +3 -3
  17. data/app/components/spina/pages/translations_component.rb +1 -1
  18. data/app/components/spina/user_interface/modal_component.html.erb +2 -2
  19. data/app/components/spina/user_interface/tab_link_component.rb +1 -1
  20. data/app/components/spina/user_interface/translations_component.html.erb +2 -2
  21. data/app/components/spina/user_interface/translations_component.rb +1 -1
  22. data/app/controllers/concerns/spina/current_spina_account.rb +1 -1
  23. data/app/controllers/spina/admin/page_select_options_controller.rb +1 -1
  24. data/app/controllers/spina/admin/resource_select_options_controller.rb +1 -1
  25. data/app/controllers/spina/application_controller.rb +1 -1
  26. data/app/jobs/spina/replace_signed_id_job.rb +12 -9
  27. data/app/models/concerns/spina/attachable.rb +1 -1
  28. data/app/models/concerns/spina/translated_content.rb +1 -1
  29. data/app/models/spina/account.rb +2 -2
  30. data/app/models/spina/resource.rb +3 -1
  31. data/app/models/spina/setting.rb +2 -0
  32. data/app/presenters/spina/menu_presenter.rb +7 -12
  33. data/app/views/spina/admin/embeds/new.html.erb +4 -4
  34. data/app/views/spina/admin/images/_image.html.erb +1 -1
  35. data/app/views/spina/admin/layout/edit.html.erb +2 -2
  36. data/app/views/spina/admin/move_pages/new.html.erb +2 -2
  37. data/app/views/spina/admin/navigation_items/_navigation_item.html.erb +5 -5
  38. data/app/views/spina/admin/pages/_form.html.erb +1 -1
  39. data/app/views/spina/admin/pages/_form_advanced.html.erb +1 -1
  40. data/app/views/spina/admin/pages/edit_template.html.erb +2 -2
  41. data/app/views/spina/admin/pages/index.html.erb +1 -1
  42. data/app/views/spina/admin/parts/image_collections/_fields.html.erb +1 -1
  43. data/app/views/spina/admin/parts/images/_form.html.erb +1 -1
  44. data/app/views/spina/admin/parts/page_links/_form.html.erb +2 -2
  45. data/app/views/spina/admin/parts/repeaters/_form.html.erb +1 -1
  46. data/app/views/spina/admin/parts/resource_links/_form.html.erb +1 -1
  47. data/app/views/spina/admin/parts/texts/_form.html.erb +2 -2
  48. data/app/views/spina/admin/settings/_wysiwyg_field.html.erb +3 -3
  49. data/app/views/spina/admin/shared/_navigation.html.erb +1 -1
  50. data/app/views/spina/admin/users/index.html.erb +2 -2
  51. data/app/views/spina/sitemaps/show.xml.builder +1 -1
  52. data/config/routes.rb +2 -2
  53. data/db/migrate/13_add_json_attributes_to_spina_accounts.rb +1 -1
  54. data/db/migrate/14_add_json_attributes_to_spina_pages.rb +1 -1
  55. data/db/migrate/15_add_slug_to_spina_resources.rb +1 -1
  56. data/db/migrate/18_change_default_spina_resources_slug.rb +2 -2
  57. data/db/migrate/7_create_spina_settings.rb +1 -1
  58. data/lib/generators/spina/tailwind_config_generator.rb +1 -1
  59. data/lib/generators/spina/templates/app/assets/stylesheets/spina/application.tailwind.css.tt +232 -0
  60. data/lib/generators/spina/templates/app/views/demo/shared/_languages.html.erb +2 -2
  61. data/lib/spina/engine.rb +1 -1
  62. data/lib/spina/version.rb +1 -1
  63. data/lib/spina.rb +63 -83
  64. data/lib/tasks/install.rake +1 -1
  65. data/lib/tasks/tailwind.rake +2 -3
  66. metadata +8 -24
  67. data/lib/generators/spina/templates/app/assets/config/spina/tailwind.config.js.tt +0 -23
@@ -14,7 +14,7 @@ export default class extends Controller {
14
14
 
15
15
  get modalHTML() {
16
16
  return `<div class="modal" data-controller="modal shortcuts" data-action="keyup@document->shortcuts#confirmClick keyup@document->modal#escClose">
17
- <button type="button" class="cursor-default w-full h-full fixed inset-0 bg-gray-700 bg-opacity-25 animate__animated animate__fadeIn animate__faster" tabindex="-1" data-action="modal#close"></button>
17
+ <button type="button" class="cursor-default w-full h-full fixed inset-0 bg-gray-700/25 animate__animated animate__fadeIn animate__faster" tabindex="-1" data-action="modal#close"></button>
18
18
  <div class="modal-window animate__animated animate__zoomIn animate__fadeIn animate__faster p-5 max-w-xs">
19
19
  <div class="text-center">
20
20
  ${this.message}
@@ -59,4 +59,4 @@ export default class extends Controller {
59
59
  return document.querySelector('turbo-frame[id="modal"]')
60
60
  }
61
61
 
62
- }
62
+ }
@@ -14,14 +14,14 @@ export default class extends Controller {
14
14
  toggleNavigation(navigation) {
15
15
  let ul = navigation.querySelector("ul")
16
16
  if (ul.classList.contains("translate-x-full")) {
17
- this.primaryTarget.classList.add("md:bg-opacity-50")
17
+ this.primaryTarget.classList.add("md:bg-black/50")
18
18
  this.labelTargets.forEach(function(label) {
19
19
  label.classList.add("-translate-x-2")
20
20
  this.switchClass(label, 'opacity-100', 'opacity-0')
21
21
  }.bind(this))
22
22
  this.switchClass(navigation.querySelector("ul"), "translate-x-full", "md:translate-x-20")
23
23
  } else {
24
- this.primaryTarget.classList.remove("md:bg-opacity-50")
24
+ this.primaryTarget.classList.remove("md:bg-black/50")
25
25
  this.labelTargets.forEach(function(label) {
26
26
  label.classList.remove("-translate-x-2")
27
27
  this.switchClass(label, 'opacity-0', 'opacity-100')
@@ -54,7 +54,7 @@ export default class extends Controller {
54
54
  this.navigationTargets.forEach(function(navigation) {
55
55
  this.switchClass(navigation.querySelector("ul"), "md:translate-x-20", "translate-x-full")
56
56
  }.bind(this))
57
- this.primaryTarget.classList.remove("md:bg-opacity-50")
57
+ this.primaryTarget.classList.remove("md:bg-black/50")
58
58
  this.labelTargets.forEach(function(label) {
59
59
  label.classList.remove("-translate-x-2")
60
60
  this.switchClass(label, 'opacity-0', 'opacity-100')
@@ -74,4 +74,4 @@ export default class extends Controller {
74
74
  return this.activeItem.closest(`[data-navigation-target*="navigation"]`)
75
75
  }
76
76
 
77
- }
77
+ }
@@ -1,25 +1,42 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
1
+ @import "tailwindcss";
2
+
3
+ /* Source paths */
4
+ @source "/Users/bram/apps/spina/app/views/**/*.*";
5
+ @source "/Users/bram/apps/spina/app/components/**/*.*";
6
+ @source "/Users/bram/apps/spina/app/helpers/**/*.*";
7
+ @source "/Users/bram/apps/spina/app/assets/javascripts/**/*.js";
8
+ @source "/Users/bram/apps/spina/app/**/application.tailwind.css";
9
+
10
+ /* Plugins */
11
+ @plugin "@tailwindcss/forms";
12
+ @plugin "@tailwindcss/aspect-ratio";
13
+ @plugin "@tailwindcss/typography";
14
+
15
+ @theme {
16
+ --font-body: "Metropolis";
17
+
18
+ --color-spina: #6865b4;
19
+ --color-spina-light: #797ab8;
20
+ --color-spina-dark: #3a3a70;
21
+
22
+ --animate-duration: 600ms;
23
+ }
4
24
 
5
25
  /* Configuration */
6
26
  @layer base {
7
- :root {
8
- --animate-duration: 600ms;
9
- }
10
-
11
27
  html {
12
28
  @apply font-body;
13
29
  }
14
-
30
+
15
31
  body {
16
- background: #F5F5FA; /* Ever so slightly indigo bg */
32
+ background: #f5f5fa; /* Ever so slightly indigo bg */
17
33
  @apply antialiased;
18
34
  }
19
-
35
+
20
36
  /* Disable tap highlight on iOS */
21
- a, button {
22
- -webkit-tap-highlight-color: rgba(0,0,0,0);
37
+ a,
38
+ button {
39
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
23
40
  }
24
41
  }
25
42
 
@@ -33,126 +50,144 @@
33
50
  @apply transition-colors duration-200;
34
51
  @apply cursor-pointer;
35
52
  }
36
-
53
+
37
54
  .btn-default {
38
- @apply text-gray-700 bg-white shadow-sm border-gray-300;
55
+ @apply text-gray-700 bg-white shadow-xs border-gray-300;
39
56
  }
40
-
57
+
41
58
  .btn-default:hover {
42
59
  @apply bg-gray-50;
43
60
  }
44
-
61
+
45
62
  .btn-default:active {
46
63
  @apply shadow-inner bg-gray-100;
47
64
  }
48
-
65
+
49
66
  .btn-primary {
50
67
  @apply bg-spina border-spina-dark text-white;
51
68
  }
52
-
69
+
53
70
  .btn-primary:hover {
54
71
  @apply bg-spina-dark;
55
72
  }
56
-
73
+
57
74
  .btn-red {
58
75
  @apply bg-red-500 border-red-500;
59
76
  @apply text-white;
60
77
  }
61
-
78
+
62
79
  .btn.btn-red:hover {
63
80
  @apply bg-red-600 border-red-600;
64
81
  }
65
-
82
+
66
83
  .btn.btn-red:active {
67
84
  @apply bg-red-600 border-red-600 shadow-inner;
68
85
  }
69
-
86
+
70
87
  .btn-gray {
71
88
  @apply border-gray-300;
72
89
  @apply text-gray-800;
73
90
  @apply bg-gray-300;
74
91
  }
75
-
92
+
76
93
  .btn-gray:hover {
77
- @apply bg-gray-400 border-gray-400 bg-opacity-75;
94
+ @apply bg-gray-400/75 border-gray-400;
78
95
  }
79
-
96
+
80
97
  .btn-gray:active {
81
- @apply bg-gray-400 border-gray-400 bg-opacity-75 shadow-inner;
98
+ @apply bg-gray-400/75 border-gray-400 shadow-inner;
82
99
  }
83
-
100
+
84
101
  .btn-green {
85
102
  @apply bg-emerald-500;
86
103
  }
87
-
104
+
88
105
  /* Forms */
89
- .form-input, .form-select {
106
+ .form-input,
107
+ .form-select {
90
108
  /* @apply py-3 px-4; */
91
109
  @apply text-gray-700;
92
- @apply shadow-sm;
110
+ @apply shadow-xs;
93
111
  @apply transition duration-150 ease-in-out;
94
112
  @apply border-gray-300;
95
113
  @apply rounded-md;
96
114
  }
97
-
115
+
98
116
  .form-input::placeholder {
99
117
  @apply text-gray-400;
100
118
  }
101
-
119
+
102
120
  .form-select {
103
121
  @apply text-sm font-medium;
104
122
  @apply pr-12;
105
123
  }
106
-
124
+
107
125
  .form-select:focus {
108
126
  @apply border-spina-light;
109
127
  @apply ring-spina-light;
110
128
  }
111
-
129
+
112
130
  .form-textarea {
113
131
  @apply bg-white;
114
132
  @apply text-gray-700;
115
- @apply shadow-sm;
133
+ @apply shadow-xs;
116
134
  @apply transition duration-150 ease-in-out;
117
135
  @apply border border-gray-300;
118
136
  @apply rounded-md;
119
137
  }
120
-
138
+
121
139
  .form-input:focus {
122
140
  @apply border-spina-light;
123
- @apply ring-spina-light
141
+ @apply ring-spina-light;
124
142
  }
125
-
143
+
126
144
  /* Modals */
127
-
145
+
128
146
  .modal {
129
147
  @apply flex items-center justify-center;
130
148
  @apply fixed z-40 inset-0 h-full p-6;
131
149
  }
132
-
150
+
133
151
  .modal-window {
134
152
  -webkit-backdrop-filter: blur(10px);
135
153
  backdrop-filter: blur(10px);
136
154
  @apply w-full max-w-lg overflow-hidden relative;
137
- @apply bg-white bg-opacity-75 shadow-lg rounded-xl;
155
+ @apply bg-white/75 shadow-lg rounded-xl;
138
156
  @apply border border-gray-400;
139
157
  }
140
158
 
141
- /* Trix */
142
- .trix-toolbar button[data-trix-active] {
159
+ /* Trix */
160
+ trix-toolbar button[data-trix-active] {
143
161
  @apply text-white bg-spina;
144
162
  }
145
-
146
- .trix-toolbar button[disabled] {
163
+
164
+ trix-toolbar [data-trix-dialog] {
165
+ @apply hidden;
166
+ }
167
+
168
+ trix-toolbar .trix-dialog {
169
+ @apply absolute;
170
+ @apply top-0;
171
+ @apply left-0;
172
+ @apply z-50;
173
+ @apply bg-white;
174
+ @apply rounded-lg;
175
+ @apply shadow-lg;
176
+ }
177
+ trix-toolbar [data-trix-dialog][data-trix-active] {
178
+ @apply block;
179
+ }
180
+
181
+ trix-toolbar button[disabled] {
147
182
  @apply bg-gray-100 text-gray-400;
148
183
  }
149
-
184
+
150
185
  trix-editor [data-trix-mutable]:not(.attachment__captain-editor) {
151
- @apply select-none
186
+ @apply select-none;
152
187
  }
153
-
188
+
154
189
  trix-editor figure.attachment {
155
- @apply m-0 inline-block
190
+ @apply m-0 inline-block;
156
191
  }
157
192
 
158
193
  trix-editor figure.attachment[data-trix-content-type="Spina::Image"] {
@@ -163,33 +198,41 @@
163
198
  trix-editor figure.attachment[data-trix-content-type="Spina::Image"] img {
164
199
  @apply m-0 rounded-md object-contain;
165
200
  }
166
-
167
- trix-editor figure.attachment[data-trix-content-type="Spina::Image"] [data-label]:after {
201
+
202
+ trix-editor
203
+ figure.attachment[data-trix-content-type="Spina::Image"]
204
+ [data-label]:after {
168
205
  content: attr(data-label);
169
206
  @apply italic text-gray-500 h-8 flex items-center px-2 mt-1 text-sm;
170
207
  }
171
208
 
172
209
  trix-editor figure[data-trix-mutable].attachment[data-trix-content-type="Spina::Image"] img {
173
- @apply shadow-lg ring ring-spina-light
210
+ @apply shadow-lg ring-3 ring-spina-light
174
211
  }
175
-
176
- trix-editor figure[data-trix-mutable][data-trix-content-type="application/vnd+spina.embed+html"].attachment > spina-embed {
212
+
213
+ trix-editor
214
+ figure[data-trix-mutable][data-trix-content-type="application/vnd+spina.embed+html"].attachment
215
+ > spina-embed {
177
216
  @apply block;
178
- @apply shadow-lg ring ring-spina-light rounded-md;
217
+ @apply shadow-lg ring-3 ring-spina-light rounded-md;
179
218
  }
180
219
 
181
220
  trix-editor figure .attachment__caption {
182
- @apply hidden
221
+ @apply hidden;
183
222
  }
184
223
 
185
224
  trix-editor figure .attachment__toolbar {
186
- @apply hidden
225
+ @apply hidden;
187
226
  }
188
-
227
+
189
228
  trix-editor [data-trix-mutable]::-moz-selection,
190
- trix-editor [data-trix-cursor-target]::-moz-selection, trix-editor [data-trix-mutable] ::-moz-selection {
191
- background: none; }
229
+ trix-editor [data-trix-cursor-target]::-moz-selection,
230
+ trix-editor [data-trix-mutable] ::-moz-selection {
231
+ background: none;
232
+ }
192
233
  trix-editor [data-trix-mutable]::selection,
193
- trix-editor [data-trix-cursor-target]::selection, trix-editor [data-trix-mutable] ::selection {
194
- background: none; }
234
+ trix-editor [data-trix-cursor-target]::selection,
235
+ trix-editor [data-trix-mutable] ::selection {
236
+ background: none;
237
+ }
195
238
  }
@@ -2,6 +2,6 @@
2
2
  <%= f.check_box method, hidden: true, class: "hidden", data: {switch_target: "checkbox"} %>
3
3
 
4
4
  <div data-switch-target="container" class="w-14 h-8 bg-gray-200 rounded-full flex items-center p-1 cursor-pointer transition transition-colors duration-200">
5
- <div data-switch-target="knob" class="h-6 w-6 rounded-full bg-white shadow-sm transform transition transition-transform duration-200"></div>
5
+ <div data-switch-target="knob" class="h-6 w-6 rounded-full bg-white shadow-xs transform transition transition-transform duration-200"></div>
6
6
  </div>
7
- </button>
7
+ </button>
@@ -1,5 +1,5 @@
1
- <div class="relative sticky z-10 top-0 pt-4 bg-white trix-toolbar" id="<%= @trix_id %>">
2
- <div class="flex items-center flex-wrap" data-controller="reveal">
1
+ <trix-toolbar class="sticky z-10 top-0 pt-4 bg-white trix-toolbar" id="<%= @trix_id %>">
2
+ <div class="flex items-center flex-wrap trix-button-row">
3
3
  <div class="flex items-center bg-gray-200 rounded overflow-hidden mb-3 mr-3" data-trix-button-group="text-tools">
4
4
  <button type="button" class="hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center" data-trix-attribute="bold" data-trix-key="b" title="${Trix.config.lang.bold}" tabindex="-1">
5
5
  <svg class="w-4 h-4" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z"/></svg>
@@ -7,11 +7,10 @@
7
7
  <button type="button" class="hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center" data-trix-attribute="italic" data-trix-key="i" title="${Trix.config.lang.italic}" tabindex="-1">
8
8
  <svg class="w-4 h-4" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z"/></svg>
9
9
  </button>
10
- <button type="button" class="hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center" data-trix-attribute="href" data-trix-action="link" data-trix-key="k" title="<%=t 'spina.wysiwyg.link' %>" tabindex="-1" data-action="reveal#toggle">
10
+ <button type="button" class="hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center" data-trix-attribute="href" data-trix-action="link" data-trix-key="k" title="<%=t 'spina.wysiwyg.link' %>" tabindex="-1">
11
11
  <svg class="w-4 h-4" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg>
12
12
  </button>
13
13
  </div>
14
-
15
14
  <div class="flex items-center bg-gray-200 rounded overflow-hidden mr-3 mb-3" data-trix-button-group="block-tools">
16
15
  <button type="button" class="hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center" data-trix-attribute="heading1" title="${Trix.config.lang.heading1}" tabindex="-1">
17
16
  <svg class="w-4 h-4" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M304 96h-98.94A13.06 13.06 0 0 0 192 109.06v21.88A13.06 13.06 0 0 0 205.06 144H232v88H88v-88h26.94A13.06 13.06 0 0 0 128 130.94V112a16 16 0 0 0-16-16H16a16 16 0 0 0-16 16v18.94A13.06 13.06 0 0 0 13.06 144H40v224H13.06A13.06 13.06 0 0 0 0 381.06V400a16 16 0 0 0 16 16h98.94A13.06 13.06 0 0 0 128 402.94v-21.88A13.06 13.06 0 0 0 114.94 368H88v-88h144v88h-26.94A13.06 13.06 0 0 0 192 381.06V400a16 16 0 0 0 16 16h96a16 16 0 0 0 16-16v-18.94A13.06 13.06 0 0 0 306.94 368H280V144h26.94A13.06 13.06 0 0 0 320 130.94V112a16 16 0 0 0-16-16zm256 272h-56V120a24 24 0 0 0-24-24h-24a24 24 0 0 0-21.44 13.26l-24 48A24 24 0 0 0 432 192h24v176h-56a16 16 0 0 0-16 16v16a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16z"/></svg>
@@ -26,15 +25,12 @@
26
25
  <svg class="w-4 h-4" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M304 96h-98.94A13.06 13.06 0 0 0 192 109.06v21.88A13.06 13.06 0 0 0 205.06 144H232v88H88v-88h26.94A13.06 13.06 0 0 0 128 130.94V112a16 16 0 0 0-16-16H16a16 16 0 0 0-16 16v18.94A13.06 13.06 0 0 0 13.06 144H40v224H13.06A13.06 13.06 0 0 0 0 381.06V400a16 16 0 0 0 16 16h98.94A13.06 13.06 0 0 0 128 402.94v-21.88A13.06 13.06 0 0 0 114.94 368H88v-88h144v88h-26.94A13.06 13.06 0 0 0 192 381.06V400a16 16 0 0 0 16 16h96a16 16 0 0 0 16-16v-18.94A13.06 13.06 0 0 0 306.94 368H280V144h26.94A13.06 13.06 0 0 0 320 130.94V112a16 16 0 0 0-16-16zm256 136h-16V112a16 16 0 0 0-16-16h-16a16 16 0 0 0-16 16v120h-96V112a16 16 0 0 0-16-16h-16a16 16 0 0 0-16 16v136a32 32 0 0 0 32 32h112v120a16 16 0 0 0 16 16h16a16 16 0 0 0 16-16V280h16a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16z"/></svg>
27
26
  </button>
28
27
  </div>
29
-
30
28
  <div class="flex items-center bg-gray-200 rounded overflow-hidden mr-3 mb-3" data-trix-button-group="file-tools">
31
-
32
29
  <%= link_to helpers.spina.admin_media_picker_path(target: "insert_#{@trix_id}"), class: "hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center", data: {turbo_frame: "modal"} do %>
33
30
  <svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
34
31
  <path fill-rule="evenodd" d="M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z" clip-rule="evenodd" />
35
32
  </svg>
36
33
  <% end %>
37
-
38
34
  <% if helpers.current_theme.embeds.any? %>
39
35
  <%= link_to helpers.spina.new_admin_embed_path(target: "insert_#{@trix_id}"), class: "hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center", data: {turbo_frame: "modal"} do %>
40
36
  <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
@@ -43,7 +39,6 @@
43
39
  <% end %>
44
40
  <% end %>
45
41
  </div>
46
-
47
42
  <div class="flex items-center bg-gray-200 rounded overflow-hidden mr-3 mb-3">
48
43
  <button type="button" class="hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center" data-trix-attribute="quote" title="${Trix.config.lang.quote}" tabindex="-1">
49
44
  <svg class="w-4 h-4" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"/></svg>
@@ -66,35 +61,23 @@
66
61
  <svg class="w-4 h-4" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M432 424H16a16 16 0 0 0-16 16v16a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-16a16 16 0 0 0-16-16zM27.31 363.3l96-96a16 16 0 0 0 0-22.62l-96-96C17.27 138.66 0 145.78 0 160v192c0 14.31 17.33 21.3 27.31 11.3zM435.17 168H204.83A12.82 12.82 0 0 0 192 180.83v22.34A12.82 12.82 0 0 0 204.83 216h230.34A12.82 12.82 0 0 0 448 203.17v-22.34A12.82 12.82 0 0 0 435.17 168zM432 48H16A16 16 0 0 0 0 64v16a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm3.17 248H204.83A12.82 12.82 0 0 0 192 308.83v22.34A12.82 12.82 0 0 0 204.83 344h230.34A12.82 12.82 0 0 0 448 331.17v-22.34A12.82 12.82 0 0 0 435.17 296z"/></svg>
67
62
  </button>
68
63
  </div>
69
-
70
- <div hidden data-reveal data-trix-dialogs>
71
- <div class="trix-dialog" data-trix-dialog="href" data-trix-dialog-attribute="href">
72
- <div class="fixed inset-0 flex justify-center items-center bg-gray-700 bg-opacity-25 z-50">
73
- <div class="bg-white rounded-lg shadow-lg overflow-hidden w-full max-w-lg">
74
- <div class="px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
75
- <div class="sm:flex sm:items-start">
76
- <div class="mt-3 text-center sm:mt-0 sm:text-left w-full">
77
- <input type="text" name="href" class="form-input block w-full sm:text-sm sm:leading-5" placeholder="<%=t 'spina.wysiwyg.url_placeholder' %>" aria-label="<%=t 'spina.wysiwyg.url' %>" data-trix-input>
78
- </div>
79
- </div>
80
- </div>
81
-
82
- <div class="bg-gray-100 px-4 py-3 sm:px-6 sm:flex space-x-3 justify-end">
83
- <button type="button" class="inline-flex cursor-pointer justify-center rounded-md border border-gray-300 px-4 py-2 bg-white text-base leading-6 font-medium text-gray-700 shadow-sm hover:text-gray-500 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue transition ease-in-out duration-150 sm:text-sm sm:leading-5" data-trix-method="removeAttribute" data-action="reveal#hide">
84
- <%=t 'spina.wysiwyg.unlink' %>
85
- </button>
86
-
87
- <button type="button" class="inline-flex cursor-pointer justify-center rounded-md border border-transparent px-4 py-2 bg-spina text-base leading-6 font-medium text-white shadow-sm hover:bg-spina-dark focus:outline-none focus:border-red-700 focus:shadow-outline-red transition ease-in-out duration-150 sm:text-sm sm:leading-5" data-trix-method="setAttribute" data-action="reveal#hide">
88
- <%=t 'spina.wysiwyg.link' %>
89
- </button>
90
- </div>
91
- </div>
64
+ </div>
65
+ <div class="trix-dialogs relative" data-trix-dialogs>
66
+ <div class="trix-dialog right-0 trix-dialog--link max-w-[600px] px-4 py-4 border border-gray-200" data-trix-dialog="href" data-trix-dialog-attribute="href">
67
+ <div class="trix-dialog__link-fields flex items-baseline">
68
+ <input type="text" name="href" class="form-input block w-full sm:text-sm sm:leading-5" placeholder="<%=t 'spina.wysiwyg.url_placeholder' %>" aria-label="<%=t 'spina.wysiwyg.url' %>" data-trix-input>
69
+ <div class="trix-button-group flex grow-0 shrink-0 ml-2">
70
+ <button type="button" class="inline-flex cursor-pointer justify-center rounded-l-md border border-transparent px-4 py-2 bg-spina text-base leading-6 font-medium text-white shadow-sm hover:bg-spina-dark focus:outline-hidden focus:border-red-700 focus:shadow-outline-red transition ease-in-out duration-150 sm:text-sm sm:leading-5" data-trix-method="setAttribute">
71
+ <%=t 'spina.wysiwyg.link' %>
72
+ </button>
73
+ <button type="button" class="inline-flex cursor-pointer justify-center rounded-r-md border border-gray-300 px-4 py-2 bg-white text-base leading-6 font-medium text-gray-700 shadow-sm hover:text-gray-500 focus:outline-hidden focus:border-blue-300 focus:shadow-outline-blue transition ease-in-out duration-150 sm:text-sm sm:leading-5" data-trix-method="removeAttribute">
74
+ <%=t 'spina.wysiwyg.unlink' %>
75
+ </button>
92
76
  </div>
93
77
  </div>
94
78
  </div>
95
-
96
79
  </div>
97
- </div>
80
+ </trix-toolbar>
98
81
  <div class="absolute hidden w-full" data-trix-target="imageFields">
99
82
  <input type="text" class="h-8 px-2 mt-1 border-0 ring-0 focus:ring-0 w-full text-sm italic" placeholder="Alt text" data-trix-target="altField" data-action="keyup->trix#setAltText keydown->trix#preventSubmission" />
100
83
  </div>
@@ -25,7 +25,7 @@
25
25
  </div>
26
26
  </div>
27
27
 
28
- <div class="md:w-72 p-4 border-t rounded-b-lg md:rounded-none md:border-t-0 border-gray-200 flex flex-col justify-between bg-gray-100 md:bg-opacity-50 md:rounded-l-lg">
28
+ <div class="md:w-72 p-4 border-t rounded-b-lg md:rounded-none md:border-t-0 border-gray-200 flex flex-col justify-between bg-gray-100 md:bg-gray-100/50 md:rounded-l-lg">
29
29
  <div class="mb-4">
30
30
  <%= form_with method: :get, url: helpers.spina.admin_media_picker_path, data: {controller: "form", turbo_frame: "images"} do |f| %>
31
31
  <%= f.hidden_field :media_folder_id, value: @media_folder&.id %>
@@ -17,9 +17,9 @@ module Spina
17
17
 
18
18
  def media_folder_classes(media_folder)
19
19
  if media_folder == @media_folder
20
- "text-gray-900 bg-spina-dark bg-opacity-20"
20
+ "text-gray-900 bg-spina-dark/20"
21
21
  else
22
- "text-gray-600 hover:bg-gray-200 bg-opacity-100 hover:bg-gray-200"
22
+ "text-gray-600 hover:bg-gray-200 hover:bg-gray-200"
23
23
  end
24
24
  end
25
25
  end
@@ -26,21 +26,21 @@
26
26
  <div class="py-1">
27
27
 
28
28
  <% unless @page.homepage? %>
29
- <%= link_to t('spina.pages.move_page') + "...", helpers.spina.new_admin_page_move_path(@page), class: "block px-4 py-2 text-sm font-medium leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900", data: {turbo_frame: "modal", action: "reveal#hide"} %>
29
+ <%= link_to t('spina.pages.move_page') + "...", helpers.spina.new_admin_page_move_path(@page), class: "block px-4 py-2 text-sm font-medium leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-hidden focus:bg-gray-100 focus:text-gray-900", data: {turbo_frame: "modal", action: "reveal#hide"} %>
30
30
  <% end %>
31
31
 
32
32
  <% if !@page.custom_page? %>
33
- <%= link_to t('spina.pages.change_view_template') + "...", helpers.spina.edit_template_admin_page_path(@page), class: "block px-4 py-2 text-sm font-medium leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900", data: {turbo_frame: "modal", action: "reveal#hide"} %>
33
+ <%= link_to t('spina.pages.change_view_template') + "...", helpers.spina.edit_template_admin_page_path(@page), class: "block px-4 py-2 text-sm font-medium leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-hidden focus:bg-gray-100 focus:text-gray-900", data: {turbo_frame: "modal", action: "reveal#hide"} %>
34
34
  <% end %>
35
35
 
36
36
  <% if @locale.to_sym != I18n.locale.to_sym %>
37
37
  <% @page.translations.where(locale: @locale).each do |translation| %>
38
- <%= button_to t("spina.page_translations.delete", translation: @locale.upcase), helpers.spina.admin_page_translation_path(translation), method: :delete, class: "block w-full text-left px-4 py-2 text-sm leading-5 font-medium text-red-500 cursor-pointer bg-white hover:bg-red-100 hover:bg-opacity-50 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-gray-900", form: {data: {controller: "confirm", confirm_message: t('spina.page_translations.delete_confirmation', subject: @locale.upcase)}} %>
38
+ <%= button_to t("spina.page_translations.delete", translation: @locale.upcase), helpers.spina.admin_page_translation_path(translation), method: :delete, class: "block w-full text-left px-4 py-2 text-sm leading-5 font-medium text-red-500 cursor-pointer bg-white hover:bg-red-100/50 hover:text-red-500 focus:outline-hidden focus:bg-gray-100 focus:text-gray-900", form: {data: {controller: "confirm", confirm_message: t('spina.page_translations.delete_confirmation', subject: @locale.upcase)}} %>
39
39
  <% end %>
40
40
  <% end %>
41
41
 
42
42
  <% if @page.deletable? %>
43
- <%= button_to t('spina.pages.delete'), helpers.spina.admin_page_path(@page), method: :delete, class: "block w-full text-left px-4 py-2 text-sm leading-5 font-medium text-red-500 cursor-pointer bg-white hover:bg-red-100 hover:bg-opacity-50 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-gray-900", form: {data: {controller: "confirm", confirm_message: t('spina.pages.delete_confirmation', subject: sanitize(@page.title))}} %>
43
+ <%= button_to t('spina.pages.delete'), helpers.spina.admin_page_path(@page), method: :delete, class: "block w-full text-left px-4 py-2 text-sm leading-5 font-medium text-red-500 cursor-pointer bg-white hover:bg-red-100/50 hover:text-red-500 focus:outline-hidden focus:bg-gray-100 focus:text-gray-900", form: {data: {controller: "confirm", confirm_message: t('spina.pages.delete_confirmation', subject: sanitize(@page.title))}} %>
44
44
  <% else %>
45
45
  <span class="block px-4 py-2 text-sm leading-5 text-gray-400"><%=t 'spina.pages.cannot_be_deleted' %></span>
46
46
  <% end %>
@@ -1,4 +1,4 @@
1
- <div class="flex items-center border border-gray-300 rounded-md bg-white p-1 relative shadow-sm" data-controller="parent-pages">
1
+ <div class="flex items-center border border-gray-300 rounded-md bg-white p-1 relative shadow-xs" data-controller="parent-pages">
2
2
  <% if resources.many? %>
3
3
  <%= helpers.heroicon("collection", style: :solid, class: 'w-5 h-5 ml-2 text-gray-400 absolute') %>
4
4
 
@@ -8,4 +8,4 @@
8
8
  <% end %>
9
9
 
10
10
  <%= helpers.turbo_frame_tag "parent_pages", src: default_parent_pages_path, class: 'flex-auto', data: {parent_pages_target: "frame"} %>
11
- </div>
11
+ </div>
@@ -8,7 +8,7 @@
8
8
 
9
9
  <% dropdown.with_menu do %>
10
10
  <% view_templates.each do |template| %>
11
- <%= link_to helpers.spina.new_admin_page_path(view_template: template.name, resource_id: @resource&.id), class: "block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900", data: {turbo_frame: "modal", action: "reveal#hide"} do %>
11
+ <%= link_to helpers.spina.new_admin_page_path(view_template: template.name, resource_id: @resource&.id), class: "block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-hidden focus:bg-gray-100 focus:text-gray-900", data: {turbo_frame: "modal", action: "reveal#hide"} do %>
12
12
  <div class="font-medium text-gray-700">
13
13
  <%= template.title %>
14
14
 
@@ -29,4 +29,4 @@
29
29
  <%=t 'spina.pages.new' %>
30
30
  <% end %>
31
31
 
32
- <% end %>
32
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <turbo-frame id="page_<%= page.id %>" data-id="<%= page.id %>" data-controller="<%= 'page-collapse' if has_children? %>">
2
- <div class="flex items-center border-gray-200 border-b <%= css_class %> bg-opacity-50">
2
+ <div class="flex items-center border-gray-200 border-b <%= css_class %>">
3
3
  <% if sortable? %>
4
4
  <% if draggable? %>
5
5
  <div data-sortable-handle class="p-4 text-gray-300 hover:text-gray-600 cursor-move">
@@ -38,9 +38,9 @@ module Spina
38
38
  def css_class
39
39
  case depth
40
40
  when 1
41
- "pl-5 bg-gray-100"
41
+ "pl-5 bg-gray-100/50"
42
42
  when 2
43
- "pl-10 bg-gray-200"
43
+ "pl-10 bg-gray-200/50"
44
44
  end
45
45
  end
46
46
 
@@ -19,7 +19,7 @@
19
19
  <div class="py-1">
20
20
  <% if missing_locales.any? %>
21
21
  <% missing_locales.each do |locale| %>
22
- <%= link_to helpers.spina.edit_admin_page_path(@page, locale: locale), class: "block px-3 py-2 text-sm leading-4 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 font-medium", data: {turbo_frame: "_top"} do %>
22
+ <%= link_to helpers.spina.edit_admin_page_path(@page, locale: locale), class: "block px-3 py-2 text-sm leading-4 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-hidden focus:bg-gray-100 focus:text-gray-900 font-medium", data: {turbo_frame: "_top"} do %>
23
23
  <div class="text-yellow-500">
24
24
  <%=t('spina.pages.add_translation', language: '<span class="font-semibold">' + t("spina.languages.#{locale}") + '</span>').html_safe %>
25
25
  </div>
@@ -29,7 +29,7 @@
29
29
  <% end %>
30
30
 
31
31
  <% existing_locales.each do |locale| %>
32
- <%= link_to helpers.spina.edit_admin_page_path(@page, locale: locale), class: "block px-3 py-2 text-sm leading-4 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 font-medium", data: {turbo_frame: "_top"} do %>
32
+ <%= link_to helpers.spina.edit_admin_page_path(@page, locale: locale), class: "block px-3 py-2 text-sm leading-4 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-hidden focus:bg-gray-100 focus:text-gray-900 font-medium", data: {turbo_frame: "_top"} do %>
33
33
  <div class="text-gray-700">
34
34
  <%=t('spina.pages.edit_translation', language: '<span class="font-semibold">' + t("spina.languages.#{locale}") + '</span>').html_safe %>
35
35
  </div>
@@ -38,4 +38,4 @@
38
38
  </div>
39
39
  </div>
40
40
  </div>
41
- </div>
41
+ </div>
@@ -23,7 +23,7 @@ module Spina
23
23
  private
24
24
 
25
25
  def spina_locales
26
- Spina.locales.map(&:to_sym)
26
+ Spina.config.locales.map(&:to_sym)
27
27
  end
28
28
  end
29
29
  end
@@ -1,6 +1,6 @@
1
1
  <turbo-frame id="modal">
2
2
  <div class="modal max-h-screen py-6" data-controller="modal" data-action="keyup@document->modal#escClose">
3
- <button type="button" class="cursor-default w-full h-full fixed inset-0 bg-gray-700 bg-opacity-25 animate__animated animate__fadeIn animate__faster" tabindex="-1" data-action="modal#close"></button>
3
+ <button type="button" class="cursor-default w-full h-full fixed inset-0 bg-gray-700/25 animate__animated animate__fadeIn animate__faster" tabindex="-1" data-action="modal#close"></button>
4
4
 
5
5
  <div class="modal-window <%= @size %> animate__animated animate__fadeInDown animate__faster">
6
6
 
@@ -8,4 +8,4 @@
8
8
 
9
9
  </div>
10
10
  </div>
11
- </turbo-frame>
11
+ </turbo-frame>
@@ -10,7 +10,7 @@ module Spina
10
10
 
11
11
  def css_classes
12
12
  if @active
13
- "cursor-default text-gray-900 bg-spina-dark bg-opacity-10"
13
+ "cursor-default text-gray-900 bg-spina-dark/10"
14
14
  else
15
15
  ""
16
16
  end
@@ -9,7 +9,7 @@
9
9
  <div class="rounded-md bg-white shadow-xs">
10
10
  <div class="py-1">
11
11
  <% locales.each do |locale| %>
12
- <%= link_to "?locale=#{locale}", class: "block px-3 py-2 text-sm leading-4 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 font-medium" do %>
12
+ <%= link_to "?locale=#{locale}", class: "block px-3 py-2 text-sm leading-4 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-hidden focus:bg-gray-100 focus:text-gray-900 font-medium" do %>
13
13
  <div class="text-gray-700">
14
14
  <%=t('spina.pages.edit_translation', language: '<span class="font-semibold">' + t("spina.languages.#{locale}") + '</span>').html_safe %>
15
15
  </div>
@@ -18,4 +18,4 @@
18
18
  </div>
19
19
  </div>
20
20
  </div>
21
- </div>
21
+ </div>
@@ -17,7 +17,7 @@ module Spina
17
17
  private
18
18
 
19
19
  def spina_locales
20
- Spina.locales.map(&:to_sym)
20
+ Spina.config.locales.map(&:to_sym)
21
21
  end
22
22
  end
23
23
  end