alchemy_cms 7.2.7 → 7.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +97 -14
  3. data/Gemfile +4 -3
  4. data/Rakefile +1 -0
  5. data/alchemy_cms.gemspec +7 -7
  6. data/app/assets/builds/alchemy/admin/print.css +1 -0
  7. data/app/assets/builds/alchemy/admin/print.css.map +1 -0
  8. data/app/assets/builds/alchemy/admin.css +1 -0
  9. data/app/assets/builds/alchemy/admin.css.map +1 -0
  10. data/app/assets/builds/alchemy/welcome.css +1 -0
  11. data/app/assets/builds/alchemy/welcome.css.map +1 -0
  12. data/app/assets/builds/tinymce/skins/content/alchemy/content.css +1 -0
  13. data/app/assets/builds/tinymce/skins/content/alchemy/content.css.map +1 -0
  14. data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css +1 -0
  15. data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css.map +1 -0
  16. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.css +1 -0
  17. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.css.map +1 -0
  18. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css +1 -0
  19. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css.map +1 -0
  20. data/app/assets/config/alchemy_manifest.js +1 -5
  21. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +4 -0
  22. data/app/assets/stylesheets/alchemy/{_custom-properties.scss → _custom-properties.css} +28 -25
  23. data/app/assets/stylesheets/alchemy/_deprecated_variables.scss +41 -0
  24. data/app/assets/stylesheets/alchemy/_deprecation.scss +17 -0
  25. data/app/assets/stylesheets/alchemy/_extends.scss +1 -1
  26. data/app/assets/stylesheets/alchemy/_mixins.scss +20 -23
  27. data/app/assets/stylesheets/alchemy/_variables.scss +98 -94
  28. data/app/assets/stylesheets/alchemy/{archive.scss → admin/archive.scss} +23 -23
  29. data/app/assets/stylesheets/alchemy/{attachment-select.scss → admin/attachment-select.scss} +2 -2
  30. data/app/assets/stylesheets/alchemy/{attachments.scss → admin/attachments.scss} +4 -4
  31. data/app/assets/stylesheets/alchemy/{base.scss → admin/base.scss} +9 -9
  32. data/app/assets/stylesheets/alchemy/{buttons.scss → admin/buttons.scss} +3 -3
  33. data/app/assets/stylesheets/alchemy/{clipboard.scss → admin/clipboard.scss} +9 -6
  34. data/app/assets/stylesheets/alchemy/{dashboard.scss → admin/dashboard.scss} +8 -8
  35. data/app/assets/stylesheets/alchemy/{dialogs.scss → admin/dialogs.scss} +20 -20
  36. data/app/assets/stylesheets/alchemy/{elements.scss → admin/elements.scss} +128 -88
  37. data/app/assets/stylesheets/alchemy/{errors.scss → admin/errors.scss} +22 -6
  38. data/app/assets/stylesheets/alchemy/{flash.scss → admin/flash.scss} +3 -3
  39. data/app/assets/stylesheets/alchemy/{flatpickr.scss → admin/flatpickr.scss} +55 -35
  40. data/app/assets/stylesheets/alchemy/{form_fields.scss → admin/form_fields.scss} +8 -6
  41. data/app/assets/stylesheets/alchemy/{forms.scss → admin/forms.scss} +20 -16
  42. data/app/assets/stylesheets/alchemy/{frame.scss → admin/frame.scss} +9 -9
  43. data/app/assets/stylesheets/alchemy/{image_library.scss → admin/image_library.scss} +34 -33
  44. data/app/assets/stylesheets/alchemy/admin/labels.scss +3 -0
  45. data/app/assets/stylesheets/alchemy/{list_filter.scss → admin/list_filter.scss} +4 -4
  46. data/app/assets/stylesheets/alchemy/{lists.scss → admin/lists.scss} +9 -7
  47. data/app/assets/stylesheets/alchemy/{navigation.scss → admin/navigation.scss} +17 -17
  48. data/app/assets/stylesheets/alchemy/{node-select.scss → admin/node-select.scss} +5 -5
  49. data/app/assets/stylesheets/alchemy/{nodes.scss → admin/nodes.scss} +11 -11
  50. data/app/assets/stylesheets/alchemy/{notices.scss → admin/notices.scss} +11 -7
  51. data/app/assets/stylesheets/alchemy/{page-select.scss → admin/page-select.scss} +10 -10
  52. data/app/assets/stylesheets/alchemy/{pagination.scss → admin/pagination.scss} +10 -10
  53. data/app/assets/stylesheets/alchemy/{print.scss → admin/print.scss} +2 -6
  54. data/app/assets/stylesheets/alchemy/{resource_info.scss → admin/resource_info.scss} +6 -7
  55. data/app/assets/stylesheets/alchemy/{search.scss → admin/search.scss} +6 -6
  56. data/app/assets/stylesheets/alchemy/{selects.scss → admin/selects.scss} +46 -39
  57. data/app/assets/stylesheets/alchemy/{shoelace.scss → admin/shoelace.scss} +10 -10
  58. data/app/assets/stylesheets/alchemy/{sitemap.scss → admin/sitemap.scss} +18 -19
  59. data/app/assets/stylesheets/alchemy/{tables.scss → admin/tables.scss} +26 -22
  60. data/app/assets/stylesheets/alchemy/admin/tags.scss +158 -0
  61. data/app/assets/stylesheets/alchemy/{toolbar.scss → admin/toolbar.scss} +10 -10
  62. data/app/assets/stylesheets/alchemy/{typography.scss → admin/typography.scss} +3 -3
  63. data/app/assets/stylesheets/alchemy/{upload.scss → admin/upload.scss} +1 -1
  64. data/app/assets/stylesheets/alchemy/admin.scss +40 -45
  65. data/app/assets/stylesheets/alchemy/welcome.scss +57 -0
  66. data/app/assets/stylesheets/tinymce/skins/content/alchemy/{content.min.scss → content.scss} +5 -4
  67. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/{skin.min.scss → skin.scss} +40 -40
  68. data/app/components/alchemy/admin/resource/action.rb +46 -0
  69. data/app/components/alchemy/admin/resource/cell.rb +34 -0
  70. data/app/components/alchemy/admin/resource/header.rb +46 -0
  71. data/app/components/alchemy/admin/resource/table.rb +153 -0
  72. data/app/components/alchemy/ingredients/datetime_view.rb +2 -2
  73. data/app/controllers/alchemy/admin/base_controller.rb +2 -1
  74. data/app/controllers/alchemy/admin/elements_controller.rb +7 -3
  75. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +1 -1
  76. data/app/controllers/alchemy/admin/pages_controller.rb +1 -1
  77. data/app/controllers/alchemy/admin/pictures_controller.rb +2 -2
  78. data/app/controllers/alchemy/admin/resources_controller.rb +2 -2
  79. data/app/controllers/alchemy/base_controller.rb +2 -0
  80. data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +2 -11
  81. data/app/decorators/alchemy/ingredient_editor.rb +17 -0
  82. data/app/helpers/alchemy/admin/pages_helper.rb +6 -10
  83. data/app/helpers/alchemy/base_helper.rb +2 -2
  84. data/app/helpers/alchemy/elements_block_helper.rb +13 -1
  85. data/app/helpers/alchemy/pages_helper.rb +2 -2
  86. data/app/javascript/alchemy_admin/components/element_editor.js +23 -31
  87. data/app/javascript/alchemy_admin/components/preview_window.js +2 -3
  88. data/app/javascript/alchemy_admin/picture_selector.js +38 -10
  89. data/app/models/alchemy/attachment.rb +0 -8
  90. data/app/models/alchemy/element/dom_id.rb +1 -0
  91. data/app/models/alchemy/element/element_ingredients.rb +0 -73
  92. data/app/models/alchemy/element/presenters.rb +4 -1
  93. data/app/models/alchemy/element.rb +6 -0
  94. data/app/models/alchemy/elements_repository.rb +2 -2
  95. data/app/models/alchemy/ingredient_validator.rb +10 -0
  96. data/app/models/alchemy/page/page_scopes.rb +1 -1
  97. data/app/models/alchemy/picture.rb +0 -10
  98. data/app/views/alchemy/admin/attachments/_files_list.html.erb +74 -16
  99. data/app/views/alchemy/admin/clipboard/index.html.erb +38 -33
  100. data/app/views/alchemy/admin/dashboard/_dashboard.html.erb +3 -0
  101. data/app/views/alchemy/admin/dashboard/_left_column.html.erb +4 -0
  102. data/app/views/alchemy/admin/dashboard/_right_column.html.erb +9 -0
  103. data/app/views/alchemy/admin/dashboard/_top.html.erb +12 -0
  104. data/app/views/alchemy/admin/dashboard/index.html.erb +1 -25
  105. data/app/views/alchemy/admin/elements/_element.html.erb +1 -2
  106. data/app/views/alchemy/admin/elements/_form.html.erb +1 -1
  107. data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +10 -3
  108. data/app/views/alchemy/admin/ingredients/update.turbo_stream.erb +7 -0
  109. data/app/views/alchemy/admin/languages/_table.html.erb +16 -42
  110. data/app/views/alchemy/admin/nodes/_form.html.erb +1 -1
  111. data/app/views/alchemy/admin/pages/_table.html.erb +92 -27
  112. data/app/views/alchemy/admin/pages/edit.html.erb +6 -8
  113. data/app/views/alchemy/admin/pages/index.html.erb +0 -4
  114. data/app/views/alchemy/admin/pictures/_form.html.erb +14 -12
  115. data/app/views/alchemy/admin/pictures/index.html.erb +1 -11
  116. data/app/views/alchemy/admin/pictures/update.turbo_stream.erb +6 -0
  117. data/app/views/alchemy/admin/resources/_resource_table.html.erb +3 -0
  118. data/app/views/alchemy/admin/resources/_table.html.erb +2 -0
  119. data/app/views/alchemy/admin/resources/index.html.erb +1 -1
  120. data/app/views/alchemy/admin/sites/index.html.erb +1 -1
  121. data/app/views/alchemy/admin/styleguide/index.html.erb +0 -4
  122. data/app/views/alchemy/admin/tags/index.html.erb +15 -14
  123. data/app/views/alchemy/base/403.html.erb +6 -0
  124. data/app/views/alchemy/base/500.html.erb +14 -12
  125. data/app/views/alchemy/ingredients/_datetime_editor.html.erb +13 -11
  126. data/app/views/alchemy/ingredients/_headline_editor.html.erb +29 -22
  127. data/app/views/alchemy/ingredients/_link_editor.html.erb +17 -11
  128. data/app/views/alchemy/ingredients/_page_editor.html.erb +1 -0
  129. data/app/views/alchemy/ingredients/_picture_editor.html.erb +3 -4
  130. data/app/views/alchemy/ingredients/_richtext_editor.html.erb +5 -1
  131. data/app/views/alchemy/ingredients/_select_editor.html.erb +2 -1
  132. data/app/views/alchemy/ingredients/_text_editor.html.erb +20 -14
  133. data/app/views/alchemy/ingredients/shared/_picture_css_class.html.erb +6 -0
  134. data/app/views/layouts/alchemy/admin.html.erb +4 -2
  135. data/bin/setup +2 -0
  136. data/bin/start +1 -1
  137. data/bun.lockb +0 -0
  138. data/config/alchemy/config.yml +9 -0
  139. data/config/locales/alchemy.en.yml +8 -29
  140. data/config/routes.rb +22 -22
  141. data/lib/alchemy/config.rb +3 -3
  142. data/lib/alchemy/install/tasks.rb +5 -2
  143. data/lib/alchemy/resources_helper.rb +3 -1
  144. data/lib/alchemy/test_support/capybara_helpers.rb +8 -5
  145. data/lib/alchemy/test_support/shared_uploader_examples.rb +0 -1
  146. data/lib/alchemy/upgrader/seven_point_three.rb +52 -0
  147. data/lib/alchemy/version.rb +1 -1
  148. data/lib/alchemy_cms.rb +1 -1
  149. data/lib/generators/alchemy/install/files/article.css +25 -0
  150. data/lib/generators/alchemy/install/files/custom.css +4 -0
  151. data/lib/generators/alchemy/install/install_generator.rb +6 -6
  152. data/lib/tasks/alchemy/upgrade.rake +29 -1
  153. data/vendor/assets/stylesheets/alchemy_admin/select2.css +1 -0
  154. data/vendor/assets/stylesheets/jquery.Jcrop.min.css +2 -0
  155. data/vendor/javascript/shoelace.min.js +62 -63
  156. data/vendor/javascript/tinymce.min.js +1 -1
  157. metadata +132 -105
  158. data/app/assets/images/alchemy/lupe.cur +0 -0
  159. data/app/assets/stylesheets/alchemy/labels.scss +0 -3
  160. data/app/assets/stylesheets/alchemy/tags.scss +0 -155
  161. data/app/assets/stylesheets/alchemy/welcome.sass +0 -49
  162. data/app/views/alchemy/admin/attachments/_attachment.html.erb +0 -81
  163. data/app/views/alchemy/admin/languages/_language.html.erb +0 -50
  164. data/app/views/alchemy/admin/pages/_table_row.html.erb +0 -111
  165. data/app/views/alchemy/admin/pages/list/_table.html.erb +0 -31
  166. data/app/views/alchemy/admin/pictures/update.js.erb +0 -6
  167. data/app/views/alchemy/admin/tags/_tag.html.erb +0 -32
  168. data/app/views/alchemy/base/update.js.erb +0 -5
  169. data/lib/generators/alchemy/install/files/all.css +0 -11
  170. data/lib/generators/alchemy/install/files/article.scss +0 -30
  171. data/package.json +0 -52
  172. data/vendor/assets/stylesheets/alchemy_admin/select2.scss +0 -741
  173. data/vendor/assets/stylesheets/jquery.Jcrop.min.scss +0 -2
  174. /data/app/assets/stylesheets/alchemy/{fonts.scss → _fonts.scss} +0 -0
  175. /data/app/assets/stylesheets/alchemy/{hints.scss → admin/hints.scss} +0 -0
  176. /data/app/assets/stylesheets/alchemy/{icons.scss → admin/icons.scss} +0 -0
  177. /data/app/assets/stylesheets/alchemy/{images.scss → admin/images.scss} +0 -0
  178. /data/app/assets/stylesheets/alchemy/{preview_window.scss → admin/preview_window.scss} +0 -0
  179. /data/app/assets/stylesheets/alchemy/{spinner.scss → admin/spinner.scss} +0 -0
  180. /data/app/views/alchemy/admin/dashboard/{_locked_pages.html.erb → widgets/_locked_pages.html.erb} +0 -0
  181. /data/app/views/alchemy/admin/dashboard/{_recent_pages.html.erb → widgets/_recent_pages.html.erb} +0 -0
  182. /data/app/views/alchemy/admin/dashboard/{_sites.html.erb → widgets/_sites.html.erb} +0 -0
  183. /data/app/views/alchemy/admin/dashboard/{_users.html.erb → widgets/_users.html.erb} +0 -0
@@ -1,7 +1,7 @@
1
1
  #toolbar {
2
2
  display: flex;
3
3
  align-items: center;
4
- gap: 2 * $default-padding;
4
+ gap: var(--spacing-2);
5
5
  z-index: 10;
6
6
  @extend %gradiated-toolbar;
7
7
  margin-right: 0px;
@@ -18,7 +18,7 @@
18
18
 
19
19
  div p {
20
20
  float: right;
21
- margin: 3px $default-margin 0 0;
21
+ margin: 3px var(--spacing-1) 0 0;
22
22
  padding: 0;
23
23
  }
24
24
  }
@@ -37,11 +37,11 @@
37
37
 
38
38
  &.right {
39
39
  flex-grow: 0;
40
- padding: 8px 0;
40
+ padding: var(--spacing-2) 0;
41
41
 
42
42
  .toolbar_button {
43
43
  &:last-child {
44
- margin-right: $default-margin;
44
+ margin-right: var(--spacing-1);
45
45
  }
46
46
  }
47
47
  }
@@ -54,14 +54,14 @@
54
54
  }
55
55
 
56
56
  .toolbar_button {
57
- margin: 0 2 * $default-margin;
57
+ margin: 0 var(--spacing-2);
58
58
 
59
59
  &:first-child {
60
- margin-left: $default-margin;
60
+ margin-left: var(--spacing-1);
61
61
 
62
62
  select,
63
63
  .alchemy_selectbox {
64
- margin-left: 2 * $default-margin;
64
+ margin-left: var(--spacing-2);
65
65
  }
66
66
  }
67
67
  }
@@ -75,8 +75,8 @@
75
75
  border-right-style: solid;
76
76
  border-right-width: 1px;
77
77
  border-right-color: $default-border-color;
78
- margin-right: $default-margin;
79
- margin-left: $default-margin;
78
+ margin-right: var(--spacing-1);
79
+ margin-left: var(--spacing-1);
80
80
  }
81
81
 
82
82
  #overlay_toolbar {
@@ -88,7 +88,7 @@
88
88
  position: relative;
89
89
  display: inline-block;
90
90
  vertical-align: top;
91
- margin: 0 2 * $default-margin;
91
+ margin: 0 var(--spacing-2);
92
92
 
93
93
  &:hover label {
94
94
  display: block;
@@ -51,7 +51,7 @@ h5,
51
51
  }
52
52
 
53
53
  p {
54
- margin: 0 0 2 * $default-margin 0;
54
+ margin: 0 0 var(--spacing-2) 0;
55
55
  white-space: normal;
56
56
 
57
57
  a {
@@ -62,7 +62,7 @@ p {
62
62
  kbd,
63
63
  code {
64
64
  border: $default-border;
65
- border-radius: $default-border-radius;
65
+ border-radius: var(--border-radius_medium);
66
66
  font-family: Courier, monospaced;
67
67
  margin: 0 0.25ex;
68
68
  padding: 0.25em 0.5em;
@@ -70,5 +70,5 @@ code {
70
70
  }
71
71
 
72
72
  code {
73
- background: $medium-gray;
73
+ background: var(--color-grey_light);
74
74
  }
@@ -21,7 +21,7 @@
21
21
 
22
22
  &:after {
23
23
  align-items: center;
24
- background-color: rgba($dark-gray, 0.6);
24
+ background-color: hsla(0deg, 0%, 40%, 0.6);
25
25
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(255, 255, 255, 0.6)"><path d="M1 14.5C1 12.1716 2.22429 10.1291 4.06426 8.9812C4.56469 5.044 7.92686 2 12 2C16.0731 2 19.4353 5.044 19.9357 8.9812C21.7757 10.1291 23 12.1716 23 14.5C23 17.9216 20.3562 20.7257 17 20.9811L7 21C3.64378 20.7257 1 17.9216 1 14.5ZM16.8483 18.9868C19.1817 18.8093 21 16.8561 21 14.5C21 12.927 20.1884 11.4962 18.8771 10.6781L18.0714 10.1754L17.9517 9.23338C17.5735 6.25803 15.0288 4 12 4C8.97116 4 6.42647 6.25803 6.0483 9.23338L5.92856 10.1754L5.12288 10.6781C3.81156 11.4962 3 12.927 3 14.5C3 16.8561 4.81833 18.8093 7.1517 18.9868L7.325 19H16.675L16.8483 18.9868ZM13 13V17H11V13H8L12 8L16 13H13Z"></path></svg>');
26
26
  background-repeat: no-repeat;
27
27
  background-size: 80px 80px;
@@ -1,49 +1,44 @@
1
- /* Alchemy CMS Sprockets Manifest
2
- * -------------------------------
3
- *= require_self
4
- */
5
-
6
1
  @import "alchemy/custom-properties";
7
2
  @import "alchemy/defaults";
8
- @import "alchemy/archive";
9
- @import "alchemy/navigation";
10
- @import "alchemy/attachments";
11
- @import "alchemy/base";
12
- @import "alchemy/buttons";
13
- @import "alchemy/dialogs";
14
- @import "alchemy/toolbar";
15
- @import "alchemy/clipboard";
16
- @import "alchemy/dashboard";
17
- @import "alchemy/elements";
18
- @import "alchemy/errors";
19
- @import "alchemy/flash";
20
- @import "alchemy/flatpickr";
21
3
  @import "alchemy/fonts";
22
- @import "alchemy/forms";
23
- @import "alchemy/form_fields";
24
- @import "alchemy/frame";
25
- @import "alchemy/hints";
26
- @import "alchemy/icons";
27
- @import "alchemy/images";
28
- @import "alchemy/image_library";
29
- @import "alchemy/labels";
30
- @import "alchemy/list_filter";
31
- @import "alchemy/nodes";
32
- @import "alchemy/attachment-select";
33
- @import "alchemy/node-select";
34
- @import "alchemy/notices";
35
- @import "alchemy/page-select";
36
- @import "alchemy/pagination";
37
- @import "alchemy/preview_window";
38
- @import "alchemy/resource_info";
39
- @import "alchemy/search";
40
- @import "alchemy/selects";
41
- @import "alchemy/shoelace";
42
- @import "alchemy/sitemap";
43
- @import "alchemy/spinner";
44
- @import "alchemy/tables";
45
- @import "alchemy/tags";
46
- @import "alchemy/typography";
47
- @import "alchemy/lists";
48
- @import "alchemy/upload";
4
+ @import "alchemy/admin/archive";
5
+ @import "alchemy/admin/attachment-select";
6
+ @import "alchemy/admin/attachments";
7
+ @import "alchemy/admin/base";
8
+ @import "alchemy/admin/buttons";
9
+ @import "alchemy/admin/clipboard";
10
+ @import "alchemy/admin/dashboard";
11
+ @import "alchemy/admin/dialogs";
12
+ @import "alchemy/admin/elements";
13
+ @import "alchemy/admin/errors";
14
+ @import "alchemy/admin/flash";
15
+ @import "alchemy/admin/flatpickr";
16
+ @import "alchemy/admin/form_fields";
17
+ @import "alchemy/admin/forms";
18
+ @import "alchemy/admin/frame";
19
+ @import "alchemy/admin/hints";
20
+ @import "alchemy/admin/icons";
21
+ @import "alchemy/admin/image_library";
22
+ @import "alchemy/admin/images";
23
+ @import "alchemy/admin/labels";
24
+ @import "alchemy/admin/list_filter";
25
+ @import "alchemy/admin/lists";
26
+ @import "alchemy/admin/navigation";
27
+ @import "alchemy/admin/node-select";
28
+ @import "alchemy/admin/nodes";
29
+ @import "alchemy/admin/notices";
30
+ @import "alchemy/admin/page-select";
31
+ @import "alchemy/admin/pagination";
32
+ @import "alchemy/admin/preview_window";
33
+ @import "alchemy/admin/resource_info";
34
+ @import "alchemy/admin/search";
35
+ @import "alchemy/admin/selects";
36
+ @import "alchemy/admin/shoelace";
37
+ @import "alchemy/admin/sitemap";
38
+ @import "alchemy/admin/spinner";
39
+ @import "alchemy/admin/tables";
40
+ @import "alchemy/admin/tags";
41
+ @import "alchemy/admin/toolbar";
42
+ @import "alchemy/admin/typography";
43
+ @import "alchemy/admin/upload";
49
44
  @import "jquery.Jcrop.min";
@@ -0,0 +1,57 @@
1
+ @import "alchemy/custom-properties";
2
+ @import "alchemy/variables";
3
+ @import "alchemy/fonts";
4
+
5
+ body {
6
+ background-color: $main-menu-bg-color;
7
+ color: var(--color-white);
8
+ font-family: $default-font-family;
9
+ font-weight: normal;
10
+ font-size: 15px;
11
+ line-height: 22px;
12
+ }
13
+
14
+ h3 {
15
+ font-weight: bold;
16
+ font-size: 25px;
17
+ line-height: 1.2;
18
+ margin-bottom: 20px;
19
+ padding-top: 20px;
20
+ }
21
+
22
+ .container {
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 50%;
26
+ width: 600px;
27
+ margin-top: -50px;
28
+ transform: translateY(-50%) translateX(-300px);
29
+ }
30
+
31
+ ul {
32
+ line-height: 1.6;
33
+ margin-bottom: 17px;
34
+ padding: 0;
35
+ padding-left: 20px;
36
+ margin: 0px;
37
+ list-style-position: outside;
38
+
39
+ li {
40
+ color: var(--color-white);
41
+ margin-bottom: 12px;
42
+ background-color: none;
43
+ border-bottom: 0 none;
44
+ line-height: 22px;
45
+ }
46
+ }
47
+
48
+ a {
49
+ color: var(--color-white);
50
+ text-decoration: underline;
51
+ transition: all 0.1s ease-in-out;
52
+
53
+ &:hover {
54
+ color: var(--color-white);
55
+ text-decoration: none;
56
+ }
57
+ }
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  @import "alchemy/variables";
9
+ @import "alchemy/custom-properties";
9
10
 
10
11
  html {
11
12
  font-size: 13px;
@@ -15,11 +16,11 @@ body {
15
16
  font-family: $default-font-family;
16
17
  line-height: 1.4;
17
18
  margin: 1em;
18
- color: $text-color;
19
+ color: var(--color-text);
19
20
  }
20
21
 
21
22
  a {
22
- color: $dark-blue;
23
+ color: var(--color-blue_dark);
23
24
  }
24
25
 
25
26
  table {
@@ -38,7 +39,7 @@ figure {
38
39
  }
39
40
 
40
41
  figure figcaption {
41
- color: $dark-gray;
42
+ color: var(--color-grey_dark);
42
43
  display: block;
43
44
  margin-top: 0.25rem;
44
45
  text-align: center;
@@ -51,7 +52,7 @@ hr {
51
52
  }
52
53
 
53
54
  code {
54
- background-color: $light-gray;
55
+ background-color: var(--color-grey_very_light);
55
56
  border-radius: $default-border-radius;
56
57
  padding: 0.1rem 0.2rem;
57
58
  }
@@ -141,7 +141,7 @@ button::-moz-focus-inner {
141
141
  }
142
142
 
143
143
  .tox .accessibility-issue__repair {
144
- margin-top: 16px;
144
+ margin-top: var(--spacing-4);
145
145
  }
146
146
 
147
147
  .tox
@@ -734,12 +734,12 @@ button::-moz-focus-inner {
734
734
 
735
735
  .tox .tox-collection--list .tox-collection__item--enabled {
736
736
  background-color: rgba(175, 175, 175, 0.25);
737
- color: $text-color;
737
+ color: var(--color-text);
738
738
  }
739
739
 
740
740
  .tox .tox-collection--toolbar .tox-collection__item--enabled {
741
741
  background-color: rgba(175, 175, 175, 0.5);
742
- color: $text-color;
742
+ color: var(--color-text);
743
743
  }
744
744
 
745
745
  .tox .tox-collection--toolbar .tox-collection__item--active {
@@ -748,14 +748,14 @@ button::-moz-focus-inner {
748
748
 
749
749
  .tox .tox-collection--grid .tox-collection__item--enabled {
750
750
  background-color: rgba(175, 175, 175, 0.5);
751
- color: $text-color;
751
+ color: var(--color-text);
752
752
  }
753
753
 
754
754
  .tox
755
755
  .tox-collection--grid
756
756
  .tox-collection__item--active:not(.tox-collection__item--state-disabled) {
757
757
  background-color: rgba(175, 175, 175, 0.25);
758
- color: $text-color;
758
+ color: var(--color-text);
759
759
  outline: none;
760
760
  }
761
761
 
@@ -776,7 +776,7 @@ button::-moz-focus-inner {
776
776
  .tox
777
777
  .tox-collection--toolbar
778
778
  .tox-collection__item--active:not(.tox-collection__item--state-disabled) {
779
- color: $text-color;
779
+ color: var(--color-text);
780
780
  }
781
781
 
782
782
  .tox .tox-collection__item-checkmark,
@@ -893,7 +893,7 @@ button::-moz-focus-inner {
893
893
  .tox .tox-collection--horizontal .tox-collection__item {
894
894
  height: 34px;
895
895
  margin: 2px 0 3px 0;
896
- padding: 0 4px;
896
+ padding: 0 var(--spacing-1);
897
897
  }
898
898
 
899
899
  .tox .tox-collection--horizontal .tox-collection__item-label {
@@ -901,7 +901,7 @@ button::-moz-focus-inner {
901
901
  }
902
902
 
903
903
  .tox .tox-collection--horizontal .tox-collection__item-caret {
904
- margin-left: 4px;
904
+ margin-left: var(--spacing-1);
905
905
  }
906
906
 
907
907
  .tox .tox-collection__item-container {
@@ -1035,7 +1035,7 @@ button::-moz-focus-inner {
1035
1035
  }
1036
1036
 
1037
1037
  .tox[dir="rtl"] .tox-collection--horizontal .tox-collection__item-caret {
1038
- margin-right: 4px;
1038
+ margin-right: var(--spacing-1);
1039
1039
  }
1040
1040
 
1041
1041
  .tox .tox-color-picker-container {
@@ -1181,7 +1181,7 @@ button::-moz-focus-inner {
1181
1181
  .tox .tox-toolbar .tox-swatches,
1182
1182
  .tox .tox-toolbar__overflow .tox-swatches,
1183
1183
  .tox .tox-toolbar__primary .tox-swatches {
1184
- margin: 2px 0 3px 4px;
1184
+ margin: 2px 0 3px var(--spacing-1);
1185
1185
  }
1186
1186
 
1187
1187
  .tox .tox-collection--list .tox-collection__group .tox-swatches-menu {
@@ -1555,7 +1555,7 @@ button::-moz-focus-inner {
1555
1555
 
1556
1556
  .tox .tox-dialog__header .tox-button {
1557
1557
  z-index: 1;
1558
- color: $white;
1558
+ color: var(--color-white);
1559
1559
  background-image: none; // If used in Solidus we need to override the background image
1560
1560
  border: none; // If used in Solidus we need to override the border
1561
1561
  }
@@ -1619,7 +1619,7 @@ button::-moz-focus-inner {
1619
1619
  display: inline-block;
1620
1620
  font-size: $base-font-size;
1621
1621
  line-height: 1.3;
1622
- padding: 16px 15px;
1622
+ padding: var(--spacing-4) 15px;
1623
1623
  text-decoration: none;
1624
1624
  white-space: nowrap;
1625
1625
  border-bottom: 2px solid var(--tabs_track-color);
@@ -1703,7 +1703,7 @@ button::-moz-focus-inner {
1703
1703
  font-style: normal;
1704
1704
  font-weight: 700;
1705
1705
  letter-spacing: normal;
1706
- margin-bottom: 4 * $default-margin;
1706
+ margin-bottom: var(--spacing-4);
1707
1707
  margin-top: 2rem;
1708
1708
  text-transform: none;
1709
1709
  }
@@ -1714,13 +1714,13 @@ button::-moz-focus-inner {
1714
1714
  font-style: normal;
1715
1715
  font-weight: 700;
1716
1716
  letter-spacing: normal;
1717
- margin-bottom: 4 * $default-margin;
1717
+ margin-bottom: var(--spacing-4);
1718
1718
  margin-top: 2rem;
1719
1719
  text-transform: none;
1720
1720
  }
1721
1721
 
1722
1722
  .tox .tox-dialog__body-content .tox-form__group p {
1723
- margin-bottom: 4 * $default-margin;
1723
+ margin-bottom: var(--spacing-4);
1724
1724
  }
1725
1725
 
1726
1726
  .tox .tox-dialog__body-content .tox-form__group h1:first-child,
@@ -2087,7 +2087,7 @@ body.tox-dialog__disable-scroll {
2087
2087
  box-sizing: border-box;
2088
2088
  height: 23px;
2089
2089
  position: absolute;
2090
- top: 4px;
2090
+ top: var(--spacing-1);
2091
2091
  width: 24px;
2092
2092
  }
2093
2093
 
@@ -2133,7 +2133,7 @@ body.tox-dialog__disable-scroll {
2133
2133
  }
2134
2134
 
2135
2135
  .tox:not([dir="rtl"]) .tox-color-input span {
2136
- left: 4px;
2136
+ left: var(--spacing-1);
2137
2137
  }
2138
2138
 
2139
2139
  .tox[dir="rtl"] .tox-color-input .tox-textfield {
@@ -2141,7 +2141,7 @@ body.tox-dialog__disable-scroll {
2141
2141
  }
2142
2142
 
2143
2143
  .tox[dir="rtl"] .tox-color-input span {
2144
- right: 4px;
2144
+ right: var(--spacing-1);
2145
2145
  }
2146
2146
 
2147
2147
  .tox .tox-label,
@@ -2174,11 +2174,11 @@ body.tox-dialog__disable-scroll {
2174
2174
 
2175
2175
  .tox .tox-form__group {
2176
2176
  box-sizing: border-box;
2177
- margin-bottom: 4 * $default-margin;
2177
+ margin-bottom: var(--spacing-4);
2178
2178
  }
2179
2179
 
2180
2180
  .tox .tox-form__group .tox-label {
2181
- margin-bottom: $default-margin;
2181
+ margin-bottom: var(--spacing-1);
2182
2182
  }
2183
2183
 
2184
2184
  .tox .tox-form-group--maximize {
@@ -2357,7 +2357,7 @@ body.tox-dialog__disable-scroll {
2357
2357
  .tox .tox-listbox__select-label {
2358
2358
  cursor: default;
2359
2359
  flex: 1;
2360
- margin: 0 4px;
2360
+ margin: 0 var(--spacing-1);
2361
2361
  }
2362
2362
 
2363
2363
  .tox .tox-listbox__select-chevron {
@@ -2407,7 +2407,7 @@ body.tox-dialog__disable-scroll {
2407
2407
  margin: 0;
2408
2408
  min-height: 34px;
2409
2409
  outline: 0;
2410
- padding: 5px 4px;
2410
+ padding: 5px var(--spacing-1);
2411
2411
  resize: none;
2412
2412
  width: 100%;
2413
2413
  }
@@ -2689,13 +2689,13 @@ body.tox-dialog__disable-scroll {
2689
2689
 
2690
2690
  .tox .tox-menubar {
2691
2691
  background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='rgba%28175,%20175,%20175,%200.5%29'/%3E%3C/svg%3E")
2692
- left 0 top 0 $light-gray;
2693
- background-color: $light-gray;
2692
+ left 0 top 0 var(--color-grey_very_light);
2693
+ background-color: var(--color-grey_very_light);
2694
2694
  display: flex;
2695
2695
  flex: 0 0 auto;
2696
2696
  flex-shrink: 0;
2697
2697
  flex-wrap: wrap;
2698
- padding: 0 4px 0 4px;
2698
+ padding: 0 var(--spacing-1) 0 var(--spacing-1);
2699
2699
  }
2700
2700
 
2701
2701
  .tox.tox-tinymce:not(.tox-tinymce-inline)
@@ -2710,7 +2710,7 @@ body.tox-dialog__disable-scroll {
2710
2710
  border: 0;
2711
2711
  border-radius: $default-border-radius;
2712
2712
  box-shadow: none;
2713
- color: $icon-color;
2713
+ color: var(--color-icon);
2714
2714
  display: flex;
2715
2715
  flex: 0 0 auto;
2716
2716
  font-size: $base-font-size;
@@ -2721,7 +2721,7 @@ body.tox-dialog__disable-scroll {
2721
2721
  margin: 2px 0 3px 0;
2722
2722
  outline: 0;
2723
2723
  overflow: hidden;
2724
- padding: 0 4px;
2724
+ padding: 0 var(--spacing-1);
2725
2725
  text-transform: none;
2726
2726
  width: auto;
2727
2727
  }
@@ -2758,7 +2758,7 @@ body.tox-dialog__disable-scroll {
2758
2758
  .tox .tox-mbtn__select-label {
2759
2759
  cursor: default;
2760
2760
  font-weight: 400;
2761
- margin: 0 4px;
2761
+ margin: 0 var(--spacing-1);
2762
2762
  }
2763
2763
 
2764
2764
  .tox .tox-mbtn[disabled] .tox-mbtn__select-label {
@@ -3247,9 +3247,9 @@ body.tox-dialog__disable-scroll {
3247
3247
 
3248
3248
  .tox .tox-statusbar {
3249
3249
  align-items: center;
3250
- background-color: $light-gray;
3250
+ background-color: var(--color-grey_very_light);
3251
3251
  border-top: $default-border;
3252
- color: $muted-text-color;
3252
+ color: var(--color-text_muted);
3253
3253
  display: flex;
3254
3254
  flex: 0 0 auto;
3255
3255
  font-size: $small-font-size;
@@ -3289,7 +3289,7 @@ body.tox-dialog__disable-scroll {
3289
3289
  .tox .tox-statusbar a,
3290
3290
  .tox .tox-statusbar__path-item,
3291
3291
  .tox .tox-statusbar__wordcount {
3292
- color: $text-color;
3292
+ color: var(--color-text);
3293
3293
  text-decoration: none;
3294
3294
  }
3295
3295
 
@@ -3318,7 +3318,7 @@ body.tox-dialog__disable-scroll {
3318
3318
 
3319
3319
  .tox .tox-statusbar__resize-handle svg {
3320
3320
  display: block;
3321
- fill: $icon-color;
3321
+ fill: var(--color-icon);
3322
3322
  }
3323
3323
 
3324
3324
  .tox .tox-statusbar__resize-handle:focus svg {
@@ -3365,7 +3365,7 @@ body.tox-dialog__disable-scroll {
3365
3365
  border: 0;
3366
3366
  border-radius: $default-border-radius;
3367
3367
  box-shadow: none;
3368
- color: $icon-color;
3368
+ color: var(--color-icon);
3369
3369
  display: flex;
3370
3370
  flex: 0 0 auto;
3371
3371
  font-size: $base-font-size;
@@ -3373,7 +3373,7 @@ body.tox-dialog__disable-scroll {
3373
3373
  font-weight: 400;
3374
3374
  height: $icon-button-medium-height;
3375
3375
  justify-content: center;
3376
- margin: $default-margin 1px;
3376
+ margin: var(--spacing-1) 1px;
3377
3377
  outline: 0;
3378
3378
  overflow: hidden;
3379
3379
  padding: 0;
@@ -3383,7 +3383,7 @@ body.tox-dialog__disable-scroll {
3383
3383
 
3384
3384
  .tox .tox-tbtn svg {
3385
3385
  display: block;
3386
- fill: $icon-color;
3386
+ fill: var(--color-icon);
3387
3387
  }
3388
3388
 
3389
3389
  .tox .tox-tbtn.tox-tbtn-more {
@@ -3487,7 +3487,7 @@ body.tox-dialog__disable-scroll {
3487
3487
  }
3488
3488
 
3489
3489
  .tox .tox-tbtn--labeled {
3490
- padding: 0 4px;
3490
+ padding: 0 var(--spacing-1);
3491
3491
  width: unset;
3492
3492
  }
3493
3493
 
@@ -3502,14 +3502,14 @@ body.tox-dialog__disable-scroll {
3502
3502
 
3503
3503
  .tox .tox-tbtn--select {
3504
3504
  margin: 2px 0 3px 0;
3505
- padding: 0 4px;
3505
+ padding: 0 var(--spacing-1);
3506
3506
  width: auto;
3507
3507
  }
3508
3508
 
3509
3509
  .tox .tox-tbtn__select-label {
3510
3510
  cursor: default;
3511
3511
  font-weight: 400;
3512
- margin: 0 4px;
3512
+ margin: 0 var(--spacing-1);
3513
3513
  }
3514
3514
 
3515
3515
  .tox .tox-tbtn__select-chevron {
@@ -3583,14 +3583,14 @@ body.tox-dialog__disable-scroll {
3583
3583
  }
3584
3584
 
3585
3585
  .tox .tox-toolbar-overlord {
3586
- background-color: $light-gray;
3586
+ background-color: var(--color-grey_very_light);
3587
3587
  }
3588
3588
 
3589
3589
  .tox .tox-toolbar,
3590
3590
  .tox .tox-toolbar__overflow,
3591
3591
  .tox .tox-toolbar__primary {
3592
3592
  background: url("data:image/svg+xml;charset=utf8,%3Csvg height='34px' viewBox='0 0 40 39px' width='34px' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='33px' width='100' height='1' fill='rgba%28175,%20175,%20175,%200.5%29'/%3E%3C/svg%3E")
3593
- left 0 top 0 $light-gray;
3593
+ left 0 top 0 var(--color-grey_very_light);
3594
3594
  display: flex;
3595
3595
  flex: 0 0 auto;
3596
3596
  flex-shrink: 0;
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Admin
5
+ module Resource
6
+ # Renders a container for a button, which evaluate CanCanCan and shows a tooltip. This
7
+ # is an internal component for the resource table, to make easier to read.
8
+ #
9
+ # @param [String, Symbol, nil] :name
10
+ # name of an action to evaluate if the user can perform these action on the given object
11
+ # @param [String, nil] :tooltip
12
+ # show a tooltip around the button
13
+ # @param [Lambda] :block
14
+ # a block to include a button or a link
15
+ #
16
+ class Action < ViewComponent::Base
17
+ delegate :can?, to: :helpers
18
+
19
+ attr_reader :block, :name, :tooltip
20
+
21
+ erb_template <<~ERB
22
+ <% if name.nil? || can?(name, @resource) %>
23
+ <% if tooltip.present? %>
24
+ <sl-tooltip content="<%= tooltip %>">
25
+ <%= view_context.capture(@resource, &block) %>
26
+ </sl-tooltip>
27
+ <% else %>
28
+ <%= view_context.capture(@resource, &block) %>
29
+ <% end %>
30
+ <% end %>
31
+ ERB
32
+
33
+ def initialize(name = nil, tooltip = nil, &block)
34
+ @name = name
35
+ @tooltip = tooltip
36
+ @block = block
37
+ end
38
+
39
+ def with_resource(resource)
40
+ @resource = resource
41
+ self
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Alchemy
4
+ module Admin
5
+ module Resource
6
+ # Renders a table cell with the given css classes
7
+ #
8
+ # @param [String, nil] :css_classes
9
+ # css classes that are show at the table cell
10
+ # @param [Lambda] :block
11
+ # a block to include a button or a link
12
+ #
13
+ class Cell < ViewComponent::Base
14
+ attr_reader :block, :css_classes
15
+
16
+ erb_template <<~ERB
17
+ <td class="<%= css_classes %>">
18
+ <%= view_context.capture(@resource, &block) %>
19
+ </td>
20
+ ERB
21
+
22
+ def initialize(css_classes, &block)
23
+ @css_classes = css_classes
24
+ @block = block
25
+ end
26
+
27
+ def with_resource(resource)
28
+ @resource = resource
29
+ self
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end