alchemy_cms 8.0.12 → 8.1.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 (286) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -10
  3. data/app/assets/builds/alchemy/admin.css +1 -1
  4. data/app/assets/builds/alchemy/dark-theme.css +1 -1
  5. data/app/assets/builds/alchemy/light-theme.css +1 -1
  6. data/app/assets/builds/alchemy/preview.min.js +1 -1
  7. data/app/assets/builds/alchemy/theme.css +1 -1
  8. data/app/{views/alchemy/admin/elements/_element.html.erb → components/alchemy/admin/element_editor.html.erb} +34 -29
  9. data/app/components/alchemy/admin/element_editor.rb +115 -0
  10. data/app/components/alchemy/admin/element_select.rb +12 -9
  11. data/app/components/alchemy/admin/ingredient_editor.rb +54 -0
  12. data/app/components/alchemy/admin/list_filter.rb +16 -5
  13. data/app/components/alchemy/admin/page_node.html.erb +214 -0
  14. data/app/components/alchemy/admin/page_node.rb +70 -0
  15. data/app/components/alchemy/admin/picture_thumbnail.rb +36 -0
  16. data/app/components/alchemy/admin/publish_page_button.html.erb +15 -0
  17. data/app/components/alchemy/admin/publish_page_button.rb +54 -0
  18. data/app/{helpers/alchemy/admin/tags_helper.rb → components/alchemy/admin/tags_list.rb} +19 -11
  19. data/app/components/alchemy/admin/toolbar_button.rb +17 -13
  20. data/app/components/alchemy/ingredients/audio_editor.rb +8 -0
  21. data/app/components/alchemy/ingredients/base_editor.rb +222 -0
  22. data/app/components/alchemy/ingredients/boolean_editor.rb +21 -0
  23. data/app/components/alchemy/ingredients/color_editor.rb +80 -0
  24. data/app/components/alchemy/ingredients/color_view.rb +13 -0
  25. data/app/components/alchemy/ingredients/datetime_editor.rb +28 -0
  26. data/app/components/alchemy/ingredients/file_editor.rb +69 -0
  27. data/app/components/alchemy/ingredients/headline_editor.rb +88 -0
  28. data/app/components/alchemy/ingredients/html_editor.rb +11 -0
  29. data/app/components/alchemy/ingredients/link_editor.rb +29 -0
  30. data/app/components/alchemy/ingredients/node_editor.rb +23 -0
  31. data/app/components/alchemy/ingredients/number_editor.rb +28 -0
  32. data/app/components/alchemy/ingredients/page_editor.rb +19 -0
  33. data/app/components/alchemy/ingredients/picture_editor.rb +81 -0
  34. data/app/components/alchemy/ingredients/richtext_editor.rb +31 -0
  35. data/app/components/alchemy/ingredients/select_editor.rb +37 -0
  36. data/app/components/alchemy/ingredients/select_view.rb +7 -0
  37. data/app/components/alchemy/ingredients/text_editor.rb +41 -0
  38. data/app/components/alchemy/ingredients/video_editor.rb +8 -0
  39. data/app/controllers/alchemy/admin/attachments_controller.rb +8 -15
  40. data/app/controllers/alchemy/admin/base_controller.rb +7 -18
  41. data/app/controllers/alchemy/admin/clipboard_controller.rb +15 -11
  42. data/app/controllers/alchemy/admin/dashboard_controller.rb +2 -2
  43. data/app/controllers/alchemy/admin/elements_controller.rb +34 -32
  44. data/app/controllers/alchemy/admin/ingredients_controller.rb +1 -0
  45. data/app/controllers/alchemy/admin/languages_controller.rb +0 -3
  46. data/app/controllers/alchemy/admin/layoutpages_controller.rb +2 -1
  47. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +1 -1
  48. data/app/controllers/alchemy/admin/nodes_controller.rb +24 -1
  49. data/app/controllers/alchemy/admin/pages_controller.rb +36 -42
  50. data/app/controllers/alchemy/admin/pictures_controller.rb +4 -28
  51. data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
  52. data/app/controllers/alchemy/api/ingredients_controller.rb +1 -1
  53. data/app/controllers/alchemy/api/pages_controller.rb +5 -3
  54. data/app/controllers/alchemy/base_controller.rb +6 -6
  55. data/app/controllers/alchemy/pages_controller.rb +12 -6
  56. data/app/controllers/concerns/alchemy/admin/archive_overlay.rb +0 -1
  57. data/app/controllers/concerns/alchemy/admin/clipboard.rb +57 -0
  58. data/app/controllers/concerns/alchemy/admin/uploader_responses.rb +2 -2
  59. data/app/controllers/concerns/alchemy/site_redirects.rb +1 -1
  60. data/app/decorators/alchemy/ingredient_editor.rb +37 -4
  61. data/app/helpers/alchemy/admin/base_helper.rb +10 -6
  62. data/app/helpers/alchemy/admin/ingredients_helper.rb +6 -3
  63. data/app/helpers/alchemy/base_helper.rb +1 -1
  64. data/app/helpers/alchemy/pages_helper.rb +1 -1
  65. data/app/javascript/alchemy_admin/components/action.js +5 -1
  66. data/app/javascript/alchemy_admin/components/color_select.js +73 -0
  67. data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +11 -3
  68. data/app/javascript/alchemy_admin/components/element_editor/publish_element_button.js +7 -2
  69. data/app/javascript/alchemy_admin/components/element_editor.js +11 -12
  70. data/app/javascript/alchemy_admin/components/element_select.js +39 -17
  71. data/app/javascript/alchemy_admin/components/elements_window.js +0 -2
  72. data/app/javascript/alchemy_admin/components/file_editor.js +26 -0
  73. data/app/javascript/alchemy_admin/components/index.js +9 -0
  74. data/app/javascript/alchemy_admin/components/list_filter.js +57 -8
  75. data/app/javascript/alchemy_admin/components/message.js +9 -3
  76. data/app/javascript/alchemy_admin/components/page_node.js +119 -0
  77. data/app/javascript/alchemy_admin/{page_publication_fields.js → components/page_publication_fields.js} +9 -8
  78. data/app/javascript/alchemy_admin/{picture_editors.js → components/picture_editor.js} +30 -45
  79. data/app/javascript/alchemy_admin/components/picture_thumbnail.js +107 -0
  80. data/app/javascript/alchemy_admin/components/publish_page_button.js +41 -0
  81. data/app/javascript/alchemy_admin/components/select.js +3 -1
  82. data/app/javascript/alchemy_admin/components/sitemap.js +210 -0
  83. data/app/javascript/alchemy_admin/{sortable_elements.js → components/sortable_elements.js} +22 -25
  84. data/app/javascript/alchemy_admin/components/tinymce.js +10 -5
  85. data/app/javascript/alchemy_admin/components/uploader.js +30 -0
  86. data/app/javascript/alchemy_admin/image_overlay.js +0 -2
  87. data/app/javascript/alchemy_admin/initializer.js +0 -3
  88. data/app/javascript/alchemy_admin/link_dialog.js +1 -6
  89. data/app/javascript/alchemy_admin/templates/compiled.js +1 -1
  90. data/app/javascript/alchemy_admin/utils/ajax.js +15 -3
  91. data/app/javascript/alchemy_admin.js +0 -6
  92. data/app/models/alchemy/attachment.rb +4 -44
  93. data/app/models/alchemy/element/definitions.rb +1 -2
  94. data/app/models/alchemy/element/element_ingredients.rb +6 -2
  95. data/app/models/alchemy/element.rb +54 -13
  96. data/app/models/alchemy/element_definition.rb +4 -1
  97. data/app/models/alchemy/elements_repository.rb +6 -0
  98. data/app/models/alchemy/folded_page.rb +2 -2
  99. data/app/models/alchemy/ingredient.rb +38 -1
  100. data/app/models/alchemy/ingredient_definition.rb +4 -1
  101. data/app/models/alchemy/ingredient_validator.rb +6 -2
  102. data/app/models/alchemy/ingredients/color.rb +10 -0
  103. data/app/models/alchemy/ingredients/headline.rb +2 -17
  104. data/app/models/alchemy/ingredients/picture.rb +4 -4
  105. data/app/models/alchemy/ingredients/select.rb +19 -0
  106. data/app/models/alchemy/language/code.rb +0 -1
  107. data/app/models/alchemy/node.rb +28 -1
  108. data/app/models/alchemy/page/page_naming.rb +0 -7
  109. data/app/models/alchemy/page/page_natures.rb +7 -3
  110. data/app/models/alchemy/page/page_scopes.rb +13 -1
  111. data/app/models/alchemy/page/publisher.rb +14 -2
  112. data/app/models/alchemy/page.rb +102 -23
  113. data/app/models/alchemy/page_definition.rb +4 -1
  114. data/app/models/alchemy/page_version.rb +22 -6
  115. data/app/models/alchemy/picture.rb +10 -11
  116. data/app/models/alchemy/picture_variant.rb +1 -3
  117. data/app/models/alchemy/resource.rb +1 -1
  118. data/app/models/alchemy/storage_adapter/active_storage.rb +14 -2
  119. data/app/models/alchemy/storage_adapter/dragonfly.rb +12 -0
  120. data/app/models/alchemy/storage_adapter.rb +2 -0
  121. data/app/models/concerns/alchemy/picture_thumbnails.rb +4 -4
  122. data/app/models/concerns/alchemy/publishable.rb +54 -0
  123. data/app/models/concerns/alchemy/relatable_resource.rb +4 -14
  124. data/app/serializers/alchemy/page_tree_serializer.rb +11 -31
  125. data/app/services/alchemy/copy_page.rb +17 -0
  126. data/app/services/alchemy/duplicate_element.rb +1 -1
  127. data/app/services/alchemy/page_tree_preloader.rb +105 -0
  128. data/app/stylesheets/alchemy/_extends.scss +3 -9
  129. data/app/stylesheets/alchemy/_mixins.scss +3 -1
  130. data/app/stylesheets/alchemy/_themes.scss +19 -10
  131. data/app/stylesheets/alchemy/admin/archive.scss +1 -0
  132. data/app/stylesheets/alchemy/admin/base.scss +5 -2
  133. data/app/stylesheets/alchemy/admin/buttons.scss +3 -3
  134. data/app/stylesheets/alchemy/admin/element-select.scss +18 -0
  135. data/app/stylesheets/alchemy/admin/elements.scss +123 -23
  136. data/app/stylesheets/alchemy/admin/errors.scss +1 -1
  137. data/app/stylesheets/alchemy/admin/flash.scss +6 -4
  138. data/app/stylesheets/alchemy/admin/images.scss +9 -5
  139. data/app/stylesheets/alchemy/admin/list_filter.scss +4 -4
  140. data/app/stylesheets/alchemy/admin/navigation.scss +1 -1
  141. data/app/stylesheets/alchemy/admin/notices.scss +1 -2
  142. data/app/stylesheets/alchemy/admin/selects.scss +36 -21
  143. data/app/stylesheets/alchemy/admin/shoelace.scss +14 -1
  144. data/app/stylesheets/alchemy/admin/sitemap.scss +11 -3
  145. data/app/stylesheets/alchemy/admin/tags.scss +3 -1
  146. data/app/stylesheets/alchemy/admin/toolbar.scss +1 -1
  147. data/app/views/alchemy/_edit_mode.html.erb +1 -1
  148. data/app/views/alchemy/_menubar.html.erb +1 -1
  149. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +35 -31
  150. data/app/views/alchemy/admin/attachments/_files_list.html.erb +1 -1
  151. data/app/views/alchemy/admin/attachments/_library_sidebar.html.erb +6 -0
  152. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +1 -1
  153. data/app/views/alchemy/admin/attachments/_replace_button.html.erb +1 -8
  154. data/app/views/alchemy/admin/attachments/_sorting_select.html.erb +13 -0
  155. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +2 -3
  156. data/app/views/alchemy/admin/attachments/index.html.erb +5 -11
  157. data/app/views/alchemy/admin/attachments/show.html.erb +1 -1
  158. data/app/views/alchemy/admin/clipboard/_button.html.erb +1 -0
  159. data/app/views/alchemy/admin/clipboard/index.html.erb +4 -5
  160. data/app/views/alchemy/admin/clipboard/insert.turbo_stream.erb +1 -1
  161. data/app/views/alchemy/admin/crop.html.erb +5 -7
  162. data/app/views/alchemy/admin/dashboard/widgets/_locked_pages.html.erb +1 -1
  163. data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +6 -6
  164. data/app/views/alchemy/admin/elements/_fixed_element.html.erb +1 -1
  165. data/app/views/alchemy/admin/elements/_footer.html.erb +7 -1
  166. data/app/views/alchemy/admin/elements/_header.html.erb +5 -5
  167. data/app/views/alchemy/admin/elements/_toolbar.html.erb +33 -8
  168. data/app/views/alchemy/admin/elements/create.turbo_stream.erb +10 -10
  169. data/app/views/alchemy/admin/elements/index.html.erb +29 -16
  170. data/app/views/alchemy/admin/elements/new.html.erb +2 -2
  171. data/app/views/alchemy/admin/ingredients/update.turbo_stream.erb +3 -5
  172. data/app/views/alchemy/admin/leave.html.erb +1 -1
  173. data/app/views/alchemy/admin/nodes/_node.html.erb +19 -0
  174. data/app/views/alchemy/admin/nodes/edit.html.erb +1 -1
  175. data/app/views/alchemy/admin/nodes/index.html.erb +3 -1
  176. data/app/views/alchemy/admin/nodes/new.html.erb +14 -1
  177. data/app/views/alchemy/admin/pages/_current_page.html.erb +3 -1
  178. data/app/views/alchemy/admin/pages/_form.html.erb +21 -9
  179. data/app/views/alchemy/admin/pages/_page_status.html.erb +1 -1
  180. data/app/views/alchemy/admin/pages/_publication_fields.html.erb +28 -26
  181. data/app/views/alchemy/admin/pages/_table.html.erb +0 -7
  182. data/app/views/alchemy/admin/pages/_toolbar.html.erb +3 -6
  183. data/app/views/alchemy/admin/pages/edit.html.erb +5 -11
  184. data/app/views/alchemy/admin/pages/flush.turbo_stream.erb +2 -0
  185. data/app/views/alchemy/admin/pages/fold.turbo_stream.erb +5 -0
  186. data/app/views/alchemy/admin/pages/index.html.erb +5 -3
  187. data/app/views/alchemy/admin/pages/new.html.erb +2 -12
  188. data/app/views/alchemy/admin/pages/publish.turbo_stream.erb +12 -0
  189. data/app/views/alchemy/admin/pages/tree.html.erb +13 -0
  190. data/app/views/alchemy/admin/pages/update.turbo_stream.erb +5 -16
  191. data/app/views/alchemy/admin/partials/_flash_notices.html.erb +1 -1
  192. data/app/views/alchemy/admin/partials/{_remote_search_form.html.erb → _overlay_search_form.html.erb} +1 -2
  193. data/app/views/alchemy/admin/partials/_paste_from_clipboard_form.html.erb +12 -0
  194. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +24 -21
  195. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +18 -26
  196. data/app/views/alchemy/admin/pictures/_picture.html.erb +12 -16
  197. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +3 -6
  198. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +2 -3
  199. data/app/views/alchemy/admin/pictures/index.html.erb +0 -1
  200. data/app/views/alchemy/admin/pictures/update.turbo_stream.erb +1 -1
  201. data/app/views/alchemy/admin/resources/_resource_usage_info.html.erb +1 -1
  202. data/app/views/alchemy/admin/resources/_tag_list.html.erb +2 -3
  203. data/app/views/alchemy/admin/styleguide/index.html.erb +25 -20
  204. data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
  205. data/app/views/alchemy/admin/tinymce/_setup.html.erb +2 -2
  206. data/app/views/alchemy/admin/uploader/_button.html.erb +1 -15
  207. data/app/views/alchemy/attachments/show.html.erb +1 -1
  208. data/app/views/alchemy/base/permission_denied.js.erb +1 -1
  209. data/app/views/alchemy/ingredients/shared/_anchor.html.erb +9 -7
  210. data/app/views/alchemy/ingredients/shared/_link_tools.html.erb +12 -5
  211. data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +10 -11
  212. data/app/views/alchemy/language_links/_spacer.html.erb +1 -1
  213. data/app/views/alchemy/messages_mailer/new.html.erb +1 -1
  214. data/app/views/alchemy/welcome.html.erb +1 -1
  215. data/config/locales/alchemy.en.yml +12 -3
  216. data/config/routes.rb +2 -2
  217. data/db/migrate/20230123112425_add_searchable_to_alchemy_pages.rb +1 -1
  218. data/db/migrate/20230505132743_add_indexes_to_alchemy_pictures.rb +1 -1
  219. data/db/migrate/20231113104432_create_page_mutexes.rb +1 -1
  220. data/db/migrate/20240314105244_create_alchemy_picture_descriptions.rb +1 -1
  221. data/db/migrate/20250626160259_add_unique_index_to_picture_descriptions.rb +1 -1
  222. data/db/migrate/20250905140323_add_created_at_index_to_pictures_and_attachments.rb +1 -1
  223. data/db/migrate/20251106150010_convert_select_value_for_multiple.rb +11 -0
  224. data/db/migrate/20260102121232_add_metadata_to_page_versions.rb +9 -0
  225. data/db/migrate/20260115164704_add_publication_timestamps_to_alchemy_elements.rb +30 -0
  226. data/db/migrate/20260115164705_add_index_to_element_publication_timestamps.rb +13 -0
  227. data/lib/alchemy/ability_helper.rb +1 -3
  228. data/lib/alchemy/auth_accessors.rb +51 -117
  229. data/lib/alchemy/configuration.rb +1 -2
  230. data/lib/alchemy/configurations/main.rb +63 -0
  231. data/lib/alchemy/controller_actions.rb +2 -3
  232. data/lib/alchemy/engine.rb +9 -12
  233. data/lib/alchemy/error_tracking/error_logger.rb +1 -1
  234. data/lib/alchemy/errors.rb +1 -1
  235. data/lib/alchemy/logger.rb +34 -4
  236. data/lib/alchemy/name_conversions.rb +0 -6
  237. data/lib/alchemy/seeder.rb +2 -2
  238. data/lib/alchemy/tasks/usage.rb +4 -4
  239. data/lib/alchemy/test_support/factories/page_version_factory.rb +3 -0
  240. data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +30 -0
  241. data/lib/alchemy/test_support/shared_ingredient_editor_examples.rb +26 -6
  242. data/lib/alchemy/test_support/shared_publishable_examples.rb +114 -0
  243. data/lib/alchemy/upgrader/eight_one.rb +56 -0
  244. data/lib/alchemy/upgrader.rb +9 -1
  245. data/lib/alchemy/version.rb +1 -1
  246. data/lib/alchemy.rb +1 -4
  247. data/lib/alchemy_cms.rb +0 -1
  248. data/lib/generators/alchemy/elements/templates/view.html.erb +3 -3
  249. data/lib/generators/alchemy/ingredient/ingredient_generator.rb +6 -8
  250. data/lib/generators/alchemy/ingredient/templates/editor_component.rb.tt +22 -0
  251. data/lib/generators/alchemy/page_layouts/templates/layout.html.erb +1 -1
  252. data/lib/generators/alchemy/site_layouts/templates/layout.html.erb +1 -1
  253. data/lib/tasks/alchemy/upgrade.rake +21 -7
  254. data/vendor/javascript/shoelace.min.js +713 -31
  255. data/vendor/javascript/tinymce.min.js +1 -1
  256. metadata +104 -84
  257. data/app/decorators/alchemy/element_editor.rb +0 -90
  258. data/app/helpers/alchemy/admin/pictures_helper.rb +0 -14
  259. data/app/javascript/alchemy_admin/file_editors.js +0 -28
  260. data/app/javascript/alchemy_admin/image_loader.js +0 -54
  261. data/app/javascript/alchemy_admin/page_sorter.js +0 -71
  262. data/app/javascript/alchemy_admin/sitemap.js +0 -154
  263. data/app/javascript/alchemy_admin/templates/page_folder.hbs +0 -3
  264. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -4
  265. data/app/views/alchemy/admin/pages/_page.html.erb +0 -163
  266. data/app/views/alchemy/admin/pages/_sitemap.html.erb +0 -30
  267. data/app/views/alchemy/admin/pages/flush.js.erb +0 -2
  268. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -5
  269. data/app/views/alchemy/admin/pictures/index.js.erb +0 -2
  270. data/app/views/alchemy/ingredients/_audio_editor.html.erb +0 -5
  271. data/app/views/alchemy/ingredients/_boolean_editor.html.erb +0 -11
  272. data/app/views/alchemy/ingredients/_datetime_editor.html.erb +0 -20
  273. data/app/views/alchemy/ingredients/_file_editor.html.erb +0 -52
  274. data/app/views/alchemy/ingredients/_headline_editor.html.erb +0 -44
  275. data/app/views/alchemy/ingredients/_html_editor.html.erb +0 -8
  276. data/app/views/alchemy/ingredients/_link_editor.html.erb +0 -30
  277. data/app/views/alchemy/ingredients/_node_editor.html.erb +0 -13
  278. data/app/views/alchemy/ingredients/_number_editor.html.erb +0 -24
  279. data/app/views/alchemy/ingredients/_page_editor.html.erb +0 -13
  280. data/app/views/alchemy/ingredients/_picture_editor.html.erb +0 -59
  281. data/app/views/alchemy/ingredients/_richtext_editor.html.erb +0 -15
  282. data/app/views/alchemy/ingredients/_select_editor.html.erb +0 -31
  283. data/app/views/alchemy/ingredients/_text_editor.html.erb +0 -29
  284. data/app/views/alchemy/ingredients/_video_editor.html.erb +0 -5
  285. data/lib/generators/alchemy/ingredient/templates/editor.html.erb +0 -14
  286. /data/{lib → app/models}/alchemy/permissions.rb +0 -0
@@ -8,7 +8,6 @@
8
8
  position: fixed;
9
9
  right: 0;
10
10
  top: var(--top-menu-height);
11
- z-index: 20;
12
11
  display: block;
13
12
  width: var(--width);
14
13
  min-width: var(--elements-window-min-width);
@@ -74,16 +73,37 @@ alchemy-elements-window-handle {
74
73
  padding: var(--spacing-2);
75
74
 
76
75
  .right {
77
- display: inline-block;
76
+ display: inline-flex;
77
+ gap: var(--spacing-2);
78
78
  margin-left: auto;
79
79
  }
80
- }
81
80
 
82
- #element_area {
83
- .sortable-elements {
84
- min-height: 100%;
81
+ alchemy-list-filter {
82
+ width: 58px;
83
+ transition: var(--transition-duration);
84
+
85
+ &:focus-within,
86
+ &:has(input:not(:placeholder-shown)) {
87
+ width: 180px;
88
+
89
+ input {
90
+ background-color: var(--form-field-background-color);
91
+ }
92
+ }
93
+
94
+ input {
95
+ height: 100%;
96
+ background-color: var(--toolbar-bg-color);
97
+ }
85
98
  }
99
+ }
100
+
101
+ alchemy-sortable-elements {
102
+ display: block;
103
+ min-height: 100%;
104
+ }
86
105
 
106
+ #element_area {
87
107
  textarea {
88
108
  width: 100%;
89
109
  }
@@ -149,7 +169,10 @@ alchemy-elements-window {
149
169
  flex-shrink: 0;
150
170
  width: var(--spacing-4);
151
171
  height: var(--spacing-4);
152
- cursor: move;
172
+
173
+ &.draggable {
174
+ cursor: move;
175
+ }
153
176
  }
154
177
 
155
178
  button.element-toggle {
@@ -188,14 +211,10 @@ button.element-toggle {
188
211
  --element-editor-background-color,
189
212
  --dialog-background-color
190
213
  );
191
- margin: var(--spacing-2) 0;
214
+ margin-bottom: var(--spacing-2);
192
215
  transition: box-shadow var(--transition-duration);
193
216
  scroll-margin: var(--spacing-2);
194
217
 
195
- &:first-child {
196
- margin-top: 0;
197
- }
198
-
199
218
  &.element-hidden {
200
219
  border-style: dashed;
201
220
 
@@ -485,35 +504,35 @@ button.element-toggle {
485
504
  border-bottom-right-radius: 0;
486
505
  }
487
506
 
488
- .icon {
507
+ .element-icon {
489
508
  fill: currentColor;
490
509
  transition: fill var(--transition-duration);
491
510
  }
492
511
 
493
512
  > .element-handle {
494
- alchemy-icon,
495
- .icon {
513
+ .handle-icon,
514
+ .element-icon {
496
515
  position: absolute;
497
516
  width: var(--spacing-4);
498
517
  height: var(--spacing-4);
499
518
  transition: opacity var(--transition-duration);
500
519
  }
501
520
 
502
- alchemy-icon {
521
+ .handle-icon {
503
522
  opacity: 0;
504
523
  }
505
524
 
506
- .icon {
525
+ .element-icon {
507
526
  opacity: 1;
508
527
  }
509
528
  }
510
529
 
511
530
  &:hover {
512
- > .element-handle alchemy-icon {
531
+ > .element-handle .handle-icon {
513
532
  opacity: 1;
514
533
  }
515
534
 
516
- > .element-handle .icon.element {
535
+ > .element-handle .element-icon {
517
536
  opacity: 0;
518
537
  }
519
538
  }
@@ -604,6 +623,68 @@ alchemy-publish-element-button {
604
623
  min-height: 100px;
605
624
  }
606
625
 
626
+ alchemy-color-select {
627
+ display: flex;
628
+ justify-content: space-between;
629
+ align-items: center;
630
+
631
+ > input[type="text"],
632
+ > .select2-container {
633
+ width: 100%;
634
+ }
635
+
636
+ > input[type="color"] {
637
+ border-width: var(--form-field-border-width);
638
+ border-style: var(--form-field-border-style);
639
+ border-color: var(--form-field-border-color);
640
+ border-radius: var(--border-radius_medium);
641
+ height: var(--form-field-height);
642
+ background: var(--form-field-background-color);
643
+ padding: var(--spacing-1);
644
+ width: 100%;
645
+
646
+ &[disabled] {
647
+ display: none;
648
+ }
649
+ }
650
+
651
+ &:has(input[type="color"]:not([disabled])) {
652
+ input[type="text"],
653
+ .select2-container,
654
+ .select2-choice {
655
+ border-top-right-radius: 0;
656
+ border-bottom-right-radius: 0;
657
+ }
658
+ }
659
+
660
+ input[type="text"] + input[type="color"],
661
+ select + input[type="color"] {
662
+ width: calc(2 * var(--form-field-addon-width));
663
+ flex-shrink: 0;
664
+ border-top-left-radius: 0;
665
+ border-bottom-left-radius: 0;
666
+ border-left-width: 0;
667
+ }
668
+ }
669
+
670
+ // place the select color options outside, because Select2
671
+ // is opening the selection container outside the `alchemy-color-select`
672
+ // component
673
+ .select-color-option {
674
+ .color-indicator {
675
+ background: var(--color) 100% 100% no-repeat;
676
+ border: var(--border-default);
677
+ border-radius: var(--border-radius_medium);
678
+ display: inline-block;
679
+ height: var(--icon-size-md);
680
+ width: var(--icon-size-md);
681
+ }
682
+
683
+ display: flex;
684
+ align-items: center;
685
+ gap: var(--spacing-2);
686
+ }
687
+
607
688
  .ingredient_link_buttons {
608
689
  display: flex;
609
690
  position: absolute;
@@ -623,8 +704,8 @@ alchemy-publish-element-button {
623
704
  width: var(--form-field-addon-width);
624
705
  height: var(--form-field-height);
625
706
 
626
- &:hover {
627
- border-color: #c0c0c0;
707
+ &:hover:not([disabled]):not(.disabled) {
708
+ border-color: var(--button-hover-border-color);
628
709
  }
629
710
 
630
711
  &:focus {
@@ -688,6 +769,14 @@ alchemy-publish-element-button {
688
769
  }
689
770
  }
690
771
 
772
+ .ingredient-editor.boolean {
773
+ label {
774
+ display: inline-flex;
775
+ align-items: center;
776
+ gap: var(--spacing-0);
777
+ }
778
+ }
779
+
691
780
  .ingredient-editor.picture {
692
781
  position: relative;
693
782
  width: 50%;
@@ -765,6 +854,12 @@ alchemy-publish-element-button {
765
854
  }
766
855
  }
767
856
 
857
+ .ingredient-editor.richtext {
858
+ alchemy-tinymce {
859
+ margin: var(--spacing-2) 0;
860
+ }
861
+ }
862
+
768
863
  .ingredient-editor.headline {
769
864
  &.with-level-select {
770
865
  input[type="text"] {
@@ -1036,14 +1131,19 @@ select.long {
1036
1131
  text-indent: 1px;
1037
1132
  color: var(--form-field-label-color);
1038
1133
 
1134
+ > sl-tooltip {
1135
+ display: inline-flex;
1136
+ margin-left: var(--spacing-1);
1137
+ }
1138
+
1039
1139
  span.warning.icon {
1040
1140
  position: relative;
1041
1141
  top: 2px;
1042
1142
  }
1043
1143
 
1044
1144
  &.inline {
1045
- display: inline-block;
1046
- vertical-align: middle;
1145
+ display: inline-flex;
1146
+ align-items: center;
1047
1147
  min-width: 90px;
1048
1148
  margin-right: var(--spacing-1);
1049
1149
  }
@@ -8,7 +8,7 @@
8
8
  border-radius: var(--border-radius_medium);
9
9
 
10
10
  h2 {
11
- font-size: 1.2em;
11
+ font-size: var(--font-size_medium);
12
12
  }
13
13
 
14
14
  ul {
@@ -1,16 +1,18 @@
1
1
  div#flash_notices {
2
2
  position: fixed;
3
- right: 0;
3
+ right: 50%;
4
+ transform: translateX(50%);
4
5
  z-index: 400000;
5
6
  width: 400px;
6
- top: 0;
7
+ top: var(--spacing-1);
7
8
 
8
9
  alchemy-message {
9
10
  font-weight: bold;
10
- margin: var(--spacing-1) var(--spacing-1) var(--spacing-2);
11
+ margin: var(--spacing-4) 0;
11
12
  opacity: 0.95;
12
13
  transition-property: opacity, transform;
13
- transition-duration: 0.4s;
14
+ transition-duration: var(--transition-duration);
15
+ box-shadow: var(--dialog-box-shadow);
14
16
 
15
17
  &.dismissed {
16
18
  display: block;
@@ -1,8 +1,12 @@
1
- img {
2
- opacity: 1;
3
- transition: opacity var(--transition-duration);
1
+ alchemy-picture-thumbnail {
2
+ &[loading] {
3
+ img {
4
+ opacity: 0;
5
+ }
6
+ }
4
7
 
5
- &.loading {
6
- opacity: 0;
8
+ img {
9
+ opacity: 1;
10
+ transition: opacity var(--transition-duration);
7
11
  }
8
12
  }
@@ -1,8 +1,8 @@
1
1
  alchemy-list-filter {
2
- display: flex;
2
+ display: block;
3
3
  position: relative;
4
4
 
5
- > alchemy-icon {
5
+ > label alchemy-icon {
6
6
  position: absolute;
7
7
  left: var(--spacing-2);
8
8
  top: 50%;
@@ -12,7 +12,7 @@ alchemy-list-filter {
12
12
  .js_filter_field {
13
13
  width: 100%;
14
14
  padding-left: var(--spacing-7);
15
- padding-right: var(--spacing-6);
15
+ padding-right: var(--spacing-7);
16
16
  margin: 0;
17
17
 
18
18
  form .input & {
@@ -25,7 +25,7 @@ alchemy-list-filter {
25
25
  display: flex;
26
26
  visibility: hidden;
27
27
  position: absolute;
28
- right: var(--spacing-1);
28
+ right: var(--spacing-2);
29
29
  top: 50%;
30
30
  transform: translateY(-50%);
31
31
  width: 16px;
@@ -8,7 +8,7 @@
8
8
  margin-left: var(--main-menu-width);
9
9
  padding-right: var(--main-menu-width);
10
10
  z-index: 20;
11
- width: 100%;
11
+ width: 100vw;
12
12
  height: var(--top-menu-height);
13
13
  @extend .disable-user-select;
14
14
  }
@@ -64,8 +64,7 @@ alchemy-message {
64
64
  }
65
65
 
66
66
  h1 {
67
- font-size: 1.3rem;
68
- line-height: 1.1;
67
+ font-size: var(--font-size_medium);
69
68
  }
70
69
 
71
70
  h1,
@@ -94,13 +94,6 @@ select {
94
94
  }
95
95
  }
96
96
  }
97
-
98
- .select2-search-choice-close {
99
- position: static;
100
- display: inline-flex;
101
- align-items: center;
102
- justify-content: center;
103
- }
104
97
  }
105
98
 
106
99
  &.medium {
@@ -141,26 +134,17 @@ select {
141
134
  }
142
135
  }
143
136
 
144
- &.select2-container-multi,
145
137
  &.select2-allowclear {
146
138
  .select2-search-choice-close {
139
+ position: static;
140
+ display: inline-flex;
147
141
  left: auto;
148
142
  right: var(--spacing-1);
149
143
  top: 5px;
150
144
  background: none;
151
145
  text-decoration: none;
152
-
153
- &:before {
154
- content: "";
155
- display: inline-flex;
156
- width: 12px;
157
- height: 12px;
158
- background: var(--select-close-icon) no-repeat;
159
- }
160
-
161
- &:hover {
162
- color: var(--icon-color);
163
- }
146
+ align-items: center;
147
+ justify-content: center;
164
148
  }
165
149
  }
166
150
 
@@ -175,12 +159,30 @@ select {
175
159
  }
176
160
  }
177
161
 
162
+ &.select2-container-disabled {
163
+ .select2-choices {
164
+ background-color: var(--select-disabled-background-color);
165
+ border-color: var(--select-disabled-border-color);
166
+ cursor: not-allowed;
167
+ color: var(--select-disabled-text-color);
168
+ }
169
+ }
170
+
171
+ .select2-search-choice-close {
172
+ position: absolute;
173
+ left: initial;
174
+ right: var(--spacing-1);
175
+ }
176
+
178
177
  .select2-choices {
179
178
  @extend %default-input-style;
180
179
  padding: 0 var(--spacing-0);
181
180
  width: 100%;
182
181
 
183
182
  .select2-search-choice {
183
+ display: flex;
184
+ align-items: center;
185
+ gap: var(--spacing-0);
184
186
  margin: var(--spacing-1);
185
187
  padding: var(--spacing-1) var(--spacing-6) var(--spacing-1)
186
188
  var(--spacing-2);
@@ -211,6 +213,20 @@ select {
211
213
  .select2-default {
212
214
  color: var(--text-color-muted) !important;
213
215
  }
216
+
217
+ .select2-search-choice-close {
218
+ &:before {
219
+ content: "";
220
+ display: inline-flex;
221
+ width: 12px;
222
+ height: 12px;
223
+ background: var(--select-close-icon) no-repeat;
224
+ }
225
+
226
+ &:hover {
227
+ color: var(--icon-color);
228
+ }
229
+ }
214
230
  }
215
231
 
216
232
  .select2-drop {
@@ -326,7 +342,6 @@ select {
326
342
  only screen and (min-resolution: 2dppx) {
327
343
  #alchemy {
328
344
  .select2-search input,
329
- .select2-search-choice-close,
330
345
  .select2-container .select2-choice abbr,
331
346
  .select2-container .select2-choice .select2-arrow b {
332
347
  background-image: none !important;
@@ -89,7 +89,7 @@
89
89
 
90
90
  --sl-transition-x-slow: 1000ms;
91
91
  --sl-transition-slow: 500ms;
92
- --sl-transition-medium: 250ms;
92
+ --sl-transition-medium: var(--transition-duration);
93
93
  --sl-transition-fast: 150ms;
94
94
  --sl-transition-x-fast: 50ms;
95
95
 
@@ -309,6 +309,19 @@ sl-tooltip {
309
309
  }
310
310
  }
311
311
 
312
+ sl-button {
313
+ &::part(base),
314
+ &::part(prefix),
315
+ &::part(spinner),
316
+ &::part(label) {
317
+ transition-property: background-color, border-color, color, fill;
318
+ transition-duration: var(--sl-transition-medium);
319
+ }
320
+ &[disabled]::part(base) {
321
+ border-color: var(--button-disabled-border-color);
322
+ }
323
+ }
324
+
312
325
  sl-dialog {
313
326
  &::part(panel) {
314
327
  background-color: var(--dialog-background-color);
@@ -58,11 +58,18 @@
58
58
  }
59
59
  }
60
60
 
61
- #sitemap-wrapper {
61
+ alchemy-sitemap {
62
+ display: block;
62
63
  position: relative;
63
64
  min-height: calc(100vh - 148px);
64
65
  }
65
66
 
67
+ #alchemy_pages_tree {
68
+ display: block;
69
+ height: calc(100vh - var(--top-menu-height) - var(--spacing-3));
70
+ position: relative;
71
+ }
72
+
66
73
  #sitemap {
67
74
  padding: 0 0 104px 0;
68
75
 
@@ -221,10 +228,11 @@
221
228
  }
222
229
 
223
230
  .sitemap_tool {
231
+ display: inline-flex;
232
+ align-items: center;
233
+ justify-content: center;
224
234
  width: var(--spacing-8);
225
235
  height: var(--spacing-8);
226
- line-height: var(--sitemap-line-height);
227
- text-align: center;
228
236
  margin: 0;
229
237
 
230
238
  &.disabled .icon {
@@ -3,9 +3,10 @@
3
3
  .tag-list {
4
4
  display: flex;
5
5
  flex-direction: column;
6
+ margin-top: var(--spacing-3);
6
7
  margin-bottom: var(--spacing-2);
7
8
 
8
- label {
9
+ > label {
9
10
  display: block;
10
11
  font-weight: bold;
11
12
  font-size: var(--font-size_medium);
@@ -83,6 +84,7 @@
83
84
  #tags_tag_list {
84
85
  alchemy-list-filter {
85
86
  margin-top: 0;
87
+ margin-bottom: var(--spacing-0);
86
88
  }
87
89
 
88
90
  ul.tags {
@@ -75,7 +75,7 @@
75
75
  height: 29px;
76
76
  border-right-style: solid;
77
77
  border-right-width: 1px;
78
- border-right-color: var(--border-color);
78
+ border-right-color: var(--toolbar-spacer-color);
79
79
  margin-right: var(--spacing-1);
80
80
  margin-left: var(--spacing-1);
81
81
  }
@@ -1,2 +1,2 @@
1
1
  <%= render 'alchemy/menubar' %>
2
- <%= render "alchemy/preview_mode_code" %>
2
+ <%= render "alchemy/preview_mode_code" %>
@@ -97,7 +97,7 @@
97
97
  </svg>
98
98
  <%= Alchemy.t(:edit_page) %>
99
99
  <% end %>
100
- <%= form_tag Alchemy.logout_path, method: Alchemy.logout_method do %>
100
+ <%= form_tag Alchemy.config.logout_path, method: Alchemy.config.logout_method do %>
101
101
  <%= button_tag class: "button" do %>
102
102
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
103
103
  <path d="M5 22C4.44772 22 4 21.5523 4 21V3C4 2.44772 4.44772 2 5 2H19C19.5523 2 20 2.44772 20 3V6H18V4H6V20H18V18H20V21C20 21.5523 19.5523 22 19 22H5ZM18 16V13H11V11H18V8L23 12L18 16Z"></path>
@@ -1,35 +1,39 @@
1
- <div id="overlay_toolbar">
2
- <div class="toolbar_buttons">
3
- <% if can? :create, Alchemy::Attachment %>
4
- <div class="toolbar_button">
5
- <%= render 'alchemy/admin/uploader/button',
6
- object: Alchemy::Attachment.new,
7
- dropzone: '#assign_file_list',
8
- file_attribute: 'file',
9
- in_dialog: true,
10
- accept: Array(search_filter_params[:only]).map { |extension|
11
- Marcel::MimeType.for(extension:)
12
- }.join(",").presence,
13
- redirect_url: admin_attachments_path(
14
- form_field_id: @form_field_id
15
- ) %>
16
- </div>
17
- <% end %>
1
+ <%= turbo_frame_tag "archive_overlay" do %>
2
+ <div id="overlay_toolbar">
3
+ <div class="toolbar_buttons">
4
+ <% if can? :create, Alchemy::Attachment %>
5
+ <div class="toolbar_button">
6
+ <%= render 'alchemy/admin/uploader/button',
7
+ object: Alchemy::Attachment.new,
8
+ dropzone: '#assign_file_list',
9
+ file_attribute: 'file',
10
+ in_dialog: true,
11
+ accept: Array(search_filter_params[:only]).map { |extension|
12
+ Marcel::MimeType.for(extension:)
13
+ }.join(",").presence,
14
+ redirect_url: admin_attachments_path(
15
+ form_field_id: @form_field_id,
16
+ only: search_filter_params[:only],
17
+ except: search_filter_params[:except],
18
+ q: search_filter_params[:q].merge(
19
+ last_upload: true
20
+ )
21
+ ) %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+
26
+ <%= render 'alchemy/admin/partials/overlay_search_form' %>
18
27
  </div>
19
- <%= render 'alchemy/admin/partials/remote_search_form' %>
20
- </div>
21
28
 
22
- <div id="assign_file_list" class="with_padding<%= search_filter_params[:tagged_with].present? ? ' filtered' : '' %>">
23
- <div id="library_sidebar">
24
- <%= render 'filter_bar' if resource_has_filters %>
29
+ <div
30
+ id="assign_file_list"
31
+ class="with_padding<%= search_filter_params[:tagged_with].present? ? ' filtered' : '' %>"
32
+ >
33
+ <%= render 'library_sidebar' %>
25
34
 
26
- <% if Alchemy::Attachment.tag_counts.any? %>
27
- <div class="tag-list">
28
- <%= render 'tag_list' %>
29
- </div>
30
- <% end %>
31
- </div>
32
- <div id="overlay_file_list" class="with_tag_list">
33
- <%= render 'overlay_file_list' %>
35
+ <div id="overlay_file_list" class="with_tag_list">
36
+ <%= render 'overlay_file_list' %>
37
+ </div>
34
38
  </div>
35
- </div>
39
+ <% end %>
@@ -61,7 +61,7 @@
61
61
  file_attribute: 'file' %>
62
62
  <% end %>
63
63
  <% table.with_action(:destroy) do |attachment| %>
64
- <% if @deletable_attachment_ids.include?(attachment.id) %>
64
+ <% if attachment.deletable? %>
65
65
  <sl-tooltip content="<%= Alchemy.t(:delete_file) %>">
66
66
  <%= link_to_confirm_dialog render_icon(:minus),
67
67
  Alchemy.t(:confirm_to_delete_file),
@@ -0,0 +1,6 @@
1
+ <div id="library_sidebar">
2
+ <%= render "sorting_select" %>
3
+ <%= render "filter_bar" if resource_has_filters %>
4
+
5
+ <div class="tag-list"><%= render "tag_list" %></div>
6
+ </div>
@@ -18,5 +18,5 @@
18
18
  </li>
19
19
  <%= render partial: 'file_to_assign', collection: @attachments %>
20
20
  </ul>
21
- <%= render "alchemy/admin/resources/pagination", resources: @attachments, remote: true, hide_per_page_select: true %>
21
+ <%= render "alchemy/admin/resources/pagination", resources: @attachments, hide_per_page_select: true %>
22
22
  <% end %>
@@ -1,8 +1,7 @@
1
- <% file_upload_id = "file_upload_#{dom_id(object)}" %>
2
1
  <% file_types = Alchemy.config.uploader.allowed_filetypes[object.class.model_name.collection] || ['*'] %>
3
2
  <% accept ||= file_types.to_a == ["*"] ? nil : file_types.map {|type| ".#{type}"}.join(", ") %>
4
3
 
5
- <alchemy-uploader id="<%= file_upload_id %>">
4
+ <alchemy-uploader redirect-url="<%= redirect_url %>">
6
5
  <%= form_for [:admin, object], html: {multipart: true, class: 'upload-button'} do |f| %>
7
6
  <%= f.file_field file_attribute,
8
7
  class: 'fileupload--field', accept: accept,
@@ -13,9 +12,3 @@
13
12
  <% end %>
14
13
  <% end %>
15
14
  </alchemy-uploader>
16
-
17
- <script type="text/javascript">
18
- document.getElementById("<%= file_upload_id %>").addEventListener("Alchemy.upload.successful", (event) => {
19
- Turbo.visit('<%= redirect_url.html_safe %>');
20
- })
21
- </script>