alchemy_cms 7.1.7 → 7.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +148 -0
  3. data/Gemfile +2 -4
  4. data/LICENSE +1 -1
  5. data/README.md +5 -6
  6. data/SECURITY.md +1 -1
  7. data/alchemy_cms.gemspec +3 -4
  8. data/app/assets/config/alchemy_manifest.js +0 -1
  9. data/app/assets/javascripts/alchemy/admin.js +0 -9
  10. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +5 -15
  11. data/app/assets/javascripts/alchemy/alchemy.image_overlay.coffee +5 -4
  12. data/app/assets/javascripts/alchemy/templates/index.js +0 -1
  13. data/app/assets/javascripts/alchemy/templates/node_folder.hbs +1 -1
  14. data/app/assets/javascripts/alchemy/templates/page_folder.hbs +1 -1
  15. data/app/assets/javascripts/tinymce/plugins/alchemy_link/plugin.min.js +20 -7
  16. data/app/assets/stylesheets/alchemy/_custom-properties.scss +12 -0
  17. data/app/assets/stylesheets/alchemy/_mixins.scss +10 -6
  18. data/app/assets/stylesheets/alchemy/_variables.scss +3 -0
  19. data/app/assets/stylesheets/alchemy/admin.scss +2 -2
  20. data/app/assets/stylesheets/alchemy/archive.scss +4 -3
  21. data/app/assets/stylesheets/alchemy/attachment-select.scss +19 -0
  22. data/app/assets/stylesheets/alchemy/base.scss +31 -18
  23. data/app/assets/stylesheets/alchemy/buttons.scss +3 -4
  24. data/app/assets/stylesheets/alchemy/dashboard.scss +1 -1
  25. data/app/assets/stylesheets/alchemy/dialogs.scss +2 -5
  26. data/app/assets/stylesheets/alchemy/elements.scss +72 -46
  27. data/app/assets/stylesheets/alchemy/flash.scss +20 -70
  28. data/app/assets/stylesheets/alchemy/forms.scss +41 -36
  29. data/app/assets/stylesheets/alchemy/frame.scss +12 -3
  30. data/app/assets/stylesheets/alchemy/icons.scss +34 -2
  31. data/app/assets/stylesheets/alchemy/image_library.scss +18 -9
  32. data/app/assets/stylesheets/alchemy/{filter_field.scss → list_filter.scss} +8 -7
  33. data/app/assets/stylesheets/alchemy/lists.scss +1 -1
  34. data/app/assets/stylesheets/alchemy/navigation.scss +9 -12
  35. data/app/assets/stylesheets/alchemy/node-select.scss +10 -2
  36. data/app/assets/stylesheets/alchemy/nodes.scss +15 -13
  37. data/app/assets/stylesheets/alchemy/notices.scss +56 -39
  38. data/app/assets/stylesheets/alchemy/page-select.scss +1 -4
  39. data/app/assets/stylesheets/alchemy/pagination.scss +11 -1
  40. data/app/assets/stylesheets/alchemy/preview_window.scss +8 -4
  41. data/app/assets/stylesheets/alchemy/search.scss +4 -4
  42. data/app/assets/stylesheets/alchemy/selects.scss +13 -7
  43. data/app/assets/stylesheets/alchemy/shoelace.scss +33 -2
  44. data/app/assets/stylesheets/alchemy/sitemap.scss +155 -159
  45. data/app/assets/stylesheets/alchemy/tables.scss +49 -12
  46. data/app/assets/stylesheets/alchemy/tags.scss +17 -11
  47. data/app/assets/stylesheets/alchemy/toolbar.scss +2 -2
  48. data/app/assets/stylesheets/alchemy/typography.scss +41 -22
  49. data/app/assets/stylesheets/alchemy/upload.scss +5 -4
  50. data/app/components/alchemy/admin/attachment_select.rb +39 -0
  51. data/app/components/alchemy/admin/icon.rb +72 -0
  52. data/app/components/alchemy/admin/link_dialog/anchor_tab.rb +41 -0
  53. data/app/components/alchemy/admin/link_dialog/base_tab.rb +75 -0
  54. data/app/components/alchemy/admin/link_dialog/external_tab.rb +42 -0
  55. data/app/components/alchemy/admin/link_dialog/file_tab.rb +45 -0
  56. data/app/components/alchemy/admin/link_dialog/internal_tab.rb +84 -0
  57. data/app/components/alchemy/admin/link_dialog/tabs.rb +33 -0
  58. data/app/components/alchemy/admin/list_filter.rb +42 -0
  59. data/app/components/alchemy/admin/message.rb +19 -0
  60. data/app/components/alchemy/admin/tags_autocomplete.rb +25 -0
  61. data/app/components/alchemy/admin/toolbar_button.rb +111 -0
  62. data/app/components/alchemy/ingredients/link_view.rb +1 -7
  63. data/app/components/alchemy/ingredients/picture_view.rb +2 -2
  64. data/app/components/alchemy/ingredients/text_view.rb +1 -2
  65. data/app/controllers/alchemy/admin/base_controller.rb +1 -1
  66. data/app/controllers/alchemy/admin/elements_controller.rb +4 -2
  67. data/app/controllers/alchemy/admin/ingredients_controller.rb +2 -0
  68. data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
  69. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +12 -4
  70. data/app/controllers/alchemy/admin/nodes_controller.rb +26 -0
  71. data/app/controllers/alchemy/admin/pages_controller.rb +11 -78
  72. data/app/controllers/alchemy/admin/picture_descriptions_controller.rb +15 -0
  73. data/app/controllers/alchemy/admin/pictures_controller.rb +18 -1
  74. data/app/controllers/alchemy/admin/resources_controller.rb +15 -10
  75. data/app/controllers/alchemy/api/attachments_controller.rb +44 -0
  76. data/app/controllers/alchemy/api/nodes_controller.rb +1 -1
  77. data/app/controllers/alchemy/api/pages_controller.rb +10 -6
  78. data/app/controllers/alchemy/base_controller.rb +2 -2
  79. data/app/controllers/alchemy/messages_controller.rb +2 -2
  80. data/app/controllers/alchemy/pages_controller.rb +8 -6
  81. data/app/controllers/concerns/alchemy/admin/current_language.rb +1 -1
  82. data/app/controllers/concerns/alchemy/legacy_page_redirects.rb +1 -1
  83. data/app/decorators/alchemy/element_editor.rb +2 -2
  84. data/app/helpers/alchemy/admin/base_helper.rb +8 -60
  85. data/app/helpers/alchemy/admin/elements_helper.rb +1 -1
  86. data/app/helpers/alchemy/admin/ingredients_helper.rb +1 -1
  87. data/app/helpers/alchemy/base_helper.rb +9 -91
  88. data/app/helpers/alchemy/elements_helper.rb +3 -3
  89. data/app/helpers/alchemy/pages_helper.rb +16 -9
  90. data/app/javascript/alchemy_admin/components/action.js +41 -0
  91. data/app/javascript/alchemy_admin/components/attachment_select.js +24 -0
  92. data/app/javascript/alchemy_admin/components/button.js +3 -0
  93. data/app/javascript/alchemy_admin/components/clipboard_button.js +3 -2
  94. data/app/javascript/alchemy_admin/components/dialog_link.js +10 -7
  95. data/app/javascript/alchemy_admin/components/dom_id_select.js +69 -0
  96. data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +42 -0
  97. data/app/javascript/alchemy_admin/components/element_editor/publish_element_button.js +4 -2
  98. data/app/javascript/alchemy_admin/components/element_editor.js +21 -13
  99. data/app/javascript/alchemy_admin/components/elements_window.js +87 -0
  100. data/app/javascript/alchemy_admin/components/growl.js +13 -0
  101. data/app/javascript/alchemy_admin/components/icon.js +51 -0
  102. data/app/javascript/alchemy_admin/components/index.js +25 -0
  103. data/app/javascript/alchemy_admin/components/ingredient_group.js +6 -0
  104. data/app/javascript/alchemy_admin/components/link_buttons/link_button.js +21 -11
  105. data/app/javascript/alchemy_admin/components/link_buttons/unlink_button.js +2 -1
  106. data/app/javascript/alchemy_admin/components/link_buttons.js +1 -0
  107. data/app/javascript/alchemy_admin/components/list_filter.js +68 -0
  108. data/app/javascript/alchemy_admin/components/message.js +69 -0
  109. data/app/javascript/alchemy_admin/components/node_select.js +4 -2
  110. data/app/javascript/alchemy_admin/components/overlay.js +6 -6
  111. data/app/javascript/alchemy_admin/components/page_select.js +3 -7
  112. data/app/javascript/alchemy_admin/components/preview_window.js +121 -0
  113. data/app/javascript/alchemy_admin/components/remote_select.js +4 -1
  114. data/app/javascript/alchemy_admin/components/select.js +37 -1
  115. data/app/javascript/alchemy_admin/components/tags_autocomplete.js +57 -0
  116. data/app/javascript/alchemy_admin/components/uploader/file_upload.js +4 -3
  117. data/app/javascript/alchemy_admin/components/uploader/progress.js +1 -1
  118. data/app/javascript/alchemy_admin/confirm_dialog.js +133 -0
  119. data/app/javascript/alchemy_admin/dirty.js +19 -14
  120. data/app/javascript/alchemy_admin/fixed_elements.js +24 -0
  121. data/app/javascript/alchemy_admin/growler.js +15 -0
  122. data/app/javascript/alchemy_admin/gui.js +2 -4
  123. data/app/javascript/alchemy_admin/hotkeys.js +60 -0
  124. data/app/javascript/alchemy_admin/image_loader.js +2 -2
  125. data/app/javascript/alchemy_admin/ingredient_anchor_link.js +2 -3
  126. data/app/javascript/alchemy_admin/initializer.js +1 -8
  127. data/app/javascript/alchemy_admin/link_dialog.js +131 -0
  128. data/app/javascript/alchemy_admin/locales/en.js +3 -0
  129. data/app/javascript/alchemy_admin/node_tree.js +4 -3
  130. data/app/javascript/alchemy_admin/page_sorter.js +23 -14
  131. data/app/javascript/alchemy_admin/picture_editors.js +3 -2
  132. data/app/javascript/alchemy_admin/shoelace_theme.js +60 -0
  133. data/app/javascript/alchemy_admin/sitemap.js +9 -3
  134. data/app/javascript/alchemy_admin/sortable_elements.js +4 -6
  135. data/app/javascript/alchemy_admin.js +18 -44
  136. data/app/models/alchemy/current.rb +26 -0
  137. data/app/models/alchemy/element.rb +1 -1
  138. data/app/models/alchemy/ingredients/headline.rb +8 -1
  139. data/app/models/alchemy/ingredients/picture.rb +6 -0
  140. data/app/models/alchemy/language.rb +8 -6
  141. data/app/models/alchemy/node.rb +2 -2
  142. data/app/models/alchemy/page/page_elements.rb +8 -8
  143. data/app/models/alchemy/page/page_layouts.rb +3 -3
  144. data/app/models/alchemy/page/page_natures.rb +13 -9
  145. data/app/models/alchemy/page/page_scopes.rb +2 -2
  146. data/app/models/alchemy/page/publisher.rb +1 -0
  147. data/app/models/alchemy/page.rb +13 -28
  148. data/app/models/alchemy/picture.rb +8 -0
  149. data/app/models/alchemy/picture_description.rb +8 -0
  150. data/app/models/alchemy/picture_variant.rb +1 -1
  151. data/app/models/alchemy/site.rb +10 -7
  152. data/app/serializers/alchemy/attachment_serializer.rb +8 -0
  153. data/app/serializers/alchemy/page_node_serializer.rb +9 -0
  154. data/app/views/alchemy/_menubar.html.erb +127 -14
  155. data/app/views/alchemy/_preview_mode_code.html.erb +1 -1
  156. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +2 -2
  157. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -1
  158. data/app/views/alchemy/admin/attachments/edit.html.erb +3 -4
  159. data/app/views/alchemy/admin/clipboard/clear.js.erb +1 -1
  160. data/app/views/alchemy/admin/clipboard/index.html.erb +1 -1
  161. data/app/views/alchemy/admin/clipboard/insert.js.erb +1 -1
  162. data/app/views/alchemy/admin/clipboard/remove.js.erb +1 -1
  163. data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
  164. data/app/views/alchemy/admin/dashboard/_sites.html.erb +1 -1
  165. data/app/views/alchemy/admin/dashboard/help.html.erb +48 -12
  166. data/app/views/alchemy/admin/dashboard/index.html.erb +1 -1
  167. data/app/views/alchemy/admin/dashboard/info.html.erb +5 -8
  168. data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +1 -1
  169. data/app/views/alchemy/admin/elements/_element.html.erb +5 -5
  170. data/app/views/alchemy/admin/elements/_footer.html.erb +1 -1
  171. data/app/views/alchemy/admin/elements/_header.html.erb +6 -2
  172. data/app/views/alchemy/admin/elements/_toolbar.html.erb +8 -6
  173. data/app/views/alchemy/admin/elements/create.js.erb +0 -5
  174. data/app/views/alchemy/admin/elements/index.html.erb +70 -34
  175. data/app/views/alchemy/admin/ingredients/_file_fields.html.erb +2 -2
  176. data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +4 -5
  177. data/app/views/alchemy/admin/ingredients/update.turbo_stream.erb +5 -0
  178. data/app/views/alchemy/admin/languages/_language.html.erb +1 -1
  179. data/app/views/alchemy/admin/languages/index.html.erb +2 -2
  180. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +18 -18
  181. data/app/views/alchemy/admin/layoutpages/edit.html.erb +3 -4
  182. data/app/views/alchemy/admin/layoutpages/index.html.erb +2 -2
  183. data/app/views/alchemy/admin/legacy_page_urls/_legacy_page_url.html.erb +10 -11
  184. data/app/views/alchemy/admin/legacy_page_urls/_new.html.erb +15 -17
  185. data/app/views/alchemy/admin/legacy_page_urls/_table.html.erb +16 -0
  186. data/app/views/alchemy/admin/legacy_page_urls/_update.turbo_stream.erb +12 -0
  187. data/app/views/alchemy/admin/legacy_page_urls/create.turbo_stream.erb +8 -0
  188. data/app/views/alchemy/admin/legacy_page_urls/destroy.turbo_stream.erb +1 -0
  189. data/app/views/alchemy/admin/legacy_page_urls/edit.html.erb +27 -0
  190. data/app/views/alchemy/admin/legacy_page_urls/show.html.erb +1 -0
  191. data/app/views/alchemy/admin/legacy_page_urls/update.turbo_stream.erb +1 -0
  192. data/app/views/alchemy/admin/nodes/_form.html.erb +12 -11
  193. data/app/views/alchemy/admin/nodes/_label.html.erb +1 -0
  194. data/app/views/alchemy/admin/nodes/_node.html.erb +19 -19
  195. data/app/views/alchemy/admin/nodes/_page_nodes.html.erb +49 -0
  196. data/app/views/alchemy/admin/nodes/_update.turbo_stream.erb +9 -0
  197. data/app/views/alchemy/admin/nodes/create.turbo_stream.erb +1 -0
  198. data/app/views/alchemy/admin/nodes/destroy.turbo_stream.erb +1 -0
  199. data/app/views/alchemy/admin/nodes/index.html.erb +3 -3
  200. data/app/views/alchemy/admin/pages/_form.html.erb +3 -4
  201. data/app/views/alchemy/admin/pages/_legacy_urls.html.erb +4 -15
  202. data/app/views/alchemy/admin/pages/_page.html.erb +39 -39
  203. data/app/views/alchemy/admin/pages/_table_row.html.erb +3 -3
  204. data/app/views/alchemy/admin/pages/_toolbar.html.erb +2 -2
  205. data/app/views/alchemy/admin/pages/configure.html.erb +6 -0
  206. data/app/views/alchemy/admin/pages/edit.html.erb +15 -62
  207. data/app/views/alchemy/admin/pages/unlock.js.erb +2 -2
  208. data/app/views/alchemy/admin/partials/_autocomplete_tag_list.html.erb +3 -1
  209. data/app/views/alchemy/admin/partials/_flash_notices.html.erb +4 -2
  210. data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +1 -1
  211. data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +5 -2
  212. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
  213. data/app/views/alchemy/admin/partials/_search_form.html.erb +2 -2
  214. data/app/views/alchemy/admin/partials/_site_select.html.erb +1 -1
  215. data/app/views/alchemy/admin/picture_descriptions/_form.html.erb +11 -0
  216. data/app/views/alchemy/admin/picture_descriptions/edit.html.erb +6 -0
  217. data/app/views/alchemy/admin/pictures/_form.html.erb +4 -3
  218. data/app/views/alchemy/admin/pictures/_infos.html.erb +1 -1
  219. data/app/views/alchemy/admin/pictures/_picture_description_field.html.erb +29 -0
  220. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +2 -2
  221. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -2
  222. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +3 -3
  223. data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
  224. data/app/views/alchemy/admin/resources/_form.html.erb +3 -4
  225. data/app/views/alchemy/admin/resources/_tag_list.html.erb +2 -2
  226. data/app/views/alchemy/admin/resources/index.html.erb +2 -2
  227. data/app/views/alchemy/admin/sites/index.html.erb +1 -1
  228. data/app/views/alchemy/admin/styleguide/index.html.erb +29 -24
  229. data/app/views/alchemy/admin/tags/_tag.html.erb +1 -1
  230. data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
  231. data/app/views/alchemy/admin/tags/index.html.erb +1 -1
  232. data/app/views/alchemy/base/500.html.erb +7 -18
  233. data/app/views/alchemy/base/error_notice.html.erb +3 -1
  234. data/app/views/alchemy/ingredients/_boolean_editor.html.erb +1 -1
  235. data/app/views/alchemy/ingredients/_datetime_editor.html.erb +1 -1
  236. data/app/views/alchemy/ingredients/_headline_editor.html.erb +13 -8
  237. data/app/views/alchemy/ingredients/_picture_editor.html.erb +1 -1
  238. data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +1 -1
  239. data/app/views/alchemy/language_links/_language.html.erb +1 -1
  240. data/app/views/kaminari/alchemy/_first_page.html.erb +2 -2
  241. data/app/views/kaminari/alchemy/_gap.html.erb +1 -1
  242. data/app/views/kaminari/alchemy/_last_page.html.erb +2 -2
  243. data/app/views/kaminari/alchemy/_next_page.html.erb +2 -2
  244. data/app/views/kaminari/alchemy/_prev_page.html.erb +2 -2
  245. data/app/views/layouts/alchemy/admin.html.erb +4 -5
  246. data/bundles/shoelace.js +3 -1
  247. data/config/locales/alchemy.en.yml +16 -3
  248. data/config/routes.rb +3 -1
  249. data/db/migrate/20240314105244_create_alchemy_picture_descriptions.rb +11 -0
  250. data/lib/alchemy/configuration_methods.rb +1 -1
  251. data/lib/alchemy/controller_actions.rb +3 -3
  252. data/lib/alchemy/element_definition.rb +10 -6
  253. data/lib/alchemy/engine.rb +29 -7
  254. data/lib/alchemy/page_layout.rb +10 -6
  255. data/lib/alchemy/permissions.rb +3 -2
  256. data/lib/alchemy/seeder.rb +2 -2
  257. data/lib/alchemy/test_support/capybara_helpers.rb +4 -0
  258. data/lib/alchemy/test_support/factories/language_factory.rb +1 -1
  259. data/lib/alchemy/test_support/shared_contexts.rb +8 -0
  260. data/lib/alchemy/test_support/shared_link_tab_examples.rb +57 -0
  261. data/lib/alchemy/tinymce.rb +2 -1
  262. data/lib/alchemy/version.rb +1 -1
  263. data/lib/alchemy.rb +72 -0
  264. data/lib/alchemy_cms.rb +0 -1
  265. data/lib/generators/alchemy/menus/templates/node.html.erb +2 -2
  266. data/lib/generators/alchemy/menus/templates/node.html.haml +2 -2
  267. data/lib/generators/alchemy/menus/templates/node.html.slim +2 -2
  268. data/lib/generators/alchemy/menus/templates/wrapper.html.erb +1 -1
  269. data/lib/generators/alchemy/menus/templates/wrapper.html.haml +1 -1
  270. data/lib/generators/alchemy/menus/templates/wrapper.html.slim +1 -1
  271. data/lib/tasks/alchemy/sitemap.rake +97 -0
  272. data/package.json +8 -8
  273. data/vendor/assets/fonts/remixicon.symbol.svg +11 -0
  274. data/vendor/javascript/shoelace.min.js +333 -118
  275. data/vendor/javascript/sortable.min.js +1 -1
  276. data/vendor/javascript/tinymce.min.js +1 -1
  277. data/vendor/javascript/ungap-custom-elements.min.js +1 -1
  278. metadata +64 -57
  279. data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +0 -85
  280. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +0 -107
  281. data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +0 -66
  282. data/app/assets/javascripts/alchemy/alchemy.fixed_elements.js +0 -45
  283. data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +0 -24
  284. data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +0 -49
  285. data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +0 -0
  286. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +0 -230
  287. data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +0 -49
  288. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +0 -82
  289. data/app/assets/javascripts/alchemy/alchemy.string_extension.js.coffee +0 -11
  290. data/app/assets/javascripts/alchemy/templates/page.hbs +0 -19
  291. data/app/assets/stylesheets/alchemy/menubar.scss +0 -81
  292. data/app/javascript/alchemy_admin/tags_autocomplete.js +0 -46
  293. data/app/javascript/menubar.js +0 -10
  294. data/app/models/alchemy/tree_node.rb +0 -7
  295. data/app/views/alchemy/admin/elements/destroy.js.erb +0 -8
  296. data/app/views/alchemy/admin/ingredients/update.js.erb +0 -7
  297. data/app/views/alchemy/admin/legacy_page_urls/_form.html.erb +0 -5
  298. data/app/views/alchemy/admin/legacy_page_urls/create.js.erb +0 -9
  299. data/app/views/alchemy/admin/legacy_page_urls/destroy.js.erb +0 -6
  300. data/app/views/alchemy/admin/legacy_page_urls/update.js.erb +0 -2
  301. data/app/views/alchemy/admin/pages/_anchor_link.html.erb +0 -22
  302. data/app/views/alchemy/admin/pages/_external_link.html.erb +0 -31
  303. data/app/views/alchemy/admin/pages/_file_link.html.erb +0 -31
  304. data/app/views/alchemy/admin/pages/_internal_link.html.erb +0 -35
  305. data/app/views/alchemy/admin/pages/link.html.erb +0 -26
  306. data/app/views/alchemy/admin/partials/_flash.html.erb +0 -4
  307. data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +0 -29
  308. data/vendor/assets/fonts/remixicon.eot +0 -0
  309. data/vendor/assets/fonts/remixicon.svg +0 -7816
  310. data/vendor/assets/fonts/remixicon.ttf +0 -0
  311. data/vendor/assets/fonts/remixicon.woff +0 -0
  312. data/vendor/assets/fonts/remixicon.woff2 +0 -0
  313. data/vendor/assets/stylesheets/remixicon.scss +0 -10480
@@ -1,20 +1,133 @@
1
- <% if !@preview_mode && @page && can?(:edit_content, @page) %>
1
+ <% if !Alchemy::Current.preview_page? && @page && can?(:edit_content, @page) %>
2
2
  <alchemy-menubar>
3
3
  <template>
4
- <%= stylesheet_link_tag("alchemy/menubar") %>
5
- <div id="alchemy_menubar" data-turbo="false">
6
- <ul>
7
- <li><%= link_to Alchemy.t(:to_alchemy), alchemy.admin_dashboard_url %></li>
8
- <li><%= link_to Alchemy.t(:edit_page), alchemy.edit_admin_page_url(@page) %></li>
9
- <li>
10
- <%= form_tag Alchemy.logout_path, method: Alchemy.logout_method do %>
11
- <%= button_tag Alchemy.t(:logout) %>
12
- <% end %>
13
- </li>
14
- </ul>
4
+ <style>
5
+ .menubar {
6
+ --icon-size: 24px;
7
+ --panel-width: 525px;
8
+ --border-radius: 3px;
9
+ --left-offset: 0px;
10
+ display: flex;
11
+ position: fixed;
12
+ top: 0;
13
+ left: calc(-1 * (var(--panel-width) - var(--left-offset)));
14
+ z-index: 10000;
15
+ background: #214166;
16
+ transition: left 0.25s cubic-bezier(0.23, 1, 0.32, 1);
17
+ box-shadow: 0 0 0 1px #fff;
18
+ box-sizing: border-box;
19
+ border-bottom-right-radius: var(--border-radius);
20
+ padding: 12px 16px 12px;
21
+ gap: 12px;
22
+ justify-content: space-between;
23
+ align-items: center;
24
+ flex-wrap: nowrap;
25
+ overflow: hidden;
26
+ font-family: "Open Sans", "Lucida Grande", "Lucida Sans Unicode",
27
+ "Lucida Sans", Verdana, Tahoma, sans-serif;
28
+ font-size: 13px;
29
+ }
30
+
31
+ .menubar * {
32
+ box-sizing: border-box;
33
+ margin: 0;
34
+ padding: 0;
35
+ }
36
+
37
+ .menubar:hover,
38
+ .menubar:focus-within {
39
+ left: 0;
40
+ }
41
+
42
+ .menubar > svg {
43
+ width: var(--icon-size);
44
+ height: var(--icon-size);
45
+ flex-shrink: 0;
46
+ margin-left: 4px;
47
+ }
48
+
49
+ .menubar .button {
50
+ display: inline-flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ gap: 8px;
54
+ font-size: inherit;
55
+ font-weight: 700;
56
+ cursor: pointer;
57
+ border-radius: var(--border-radius);
58
+ background-color: transparent;
59
+ border: 1px solid rgba(255, 255, 255, 0.5);
60
+ color: #fff;
61
+ margin: 0;
62
+ padding: 0.75em 1.5em;
63
+ appearance: none;
64
+ transition: all 250ms;
65
+ -webkit-font-smoothing: antialiased;
66
+ -moz-osx-font-smoothing: grayscale;
67
+ text-decoration: none;
68
+ white-space: nowrap;
69
+ }
70
+
71
+ .menubar .button:hover {
72
+ text-decoration: none;
73
+ background-color: rgba(0, 0, 0, 0.25);
74
+ border-color: rgba(255, 255, 255, 0.75)
75
+ }
76
+
77
+ .menubar .button:active {
78
+ box-shadow: inset 0px 1px 1px -1px #333;
79
+ }
80
+
81
+ .menubar .button:focus {
82
+ outline: solid 2px #eca96e;
83
+ outline-offset: 2px;
84
+ }
85
+ </style>
86
+
87
+ <div class="menubar" data-turbo="false">
88
+ <%= link_to alchemy.admin_dashboard_url, class: "button" do %>
89
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
90
+ <path d="M7.82843 10.9999H20V12.9999H7.82843L13.1924 18.3638L11.7782 19.778L4 11.9999L11.7782 4.22168L13.1924 5.63589L7.82843 10.9999Z"></path>
91
+ </svg>
92
+ <%= Alchemy.t(:to_alchemy) %>
93
+ <% end %>
94
+ <%= link_to alchemy.edit_admin_page_url(@page), class: "button" do %>
95
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
96
+ <path d="M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z"></path>
97
+ </svg>
98
+ <%= Alchemy.t(:edit_page) %>
99
+ <% end %>
100
+ <%= form_tag Alchemy.logout_path, method: Alchemy.logout_method do %>
101
+ <%= button_tag class: "button" do %>
102
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
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>
104
+ </svg>
105
+ <%= Alchemy.t(:logout) %>
106
+ <% end %>
107
+ <% end %>
108
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
109
+ <path fill="#fff" d="M15.7 7.9L9.9 2.2 2.1 4.3 0 12.1l5.7 5.8 7.8-2.1 2.2-7.9zm-5.3 10.3l-1.2 4.4 3.2 3.2 4.4-1.2 1.2-4.4-3.2-3.2-4.4 1.2zM23.5 7.3L17.2 9l-1.7 6.2 4.5 4.6 6.2-1.7 1.7-6.2-4.4-4.6z"/>
110
+ </svg>
15
111
  </div>
16
112
  </template>
17
- </alchemy-menubar>
18
113
 
19
- <%= javascript_include_tag('menubar', type: "module") %>
114
+ <script type="module">
115
+ class Menubar extends HTMLElement {
116
+ constructor() {
117
+ super()
118
+ const template = this.querySelector("template")
119
+ const attachedShadowRoot = this.attachShadow({ mode: "open" })
120
+ attachedShadowRoot.appendChild(template.content.cloneNode(true))
121
+ }
122
+
123
+ connectedCallback() {
124
+ const bar = this.shadowRoot.querySelector(".menubar")
125
+ const width = bar.offsetWidth
126
+ bar.style = `--panel-width: ${width}px; --left-offset: calc(var(--icon-size) + 32px);`
127
+ }
128
+ }
129
+
130
+ customElements.define("alchemy-menubar", Menubar)
131
+ </script>
132
+ </alchemy-menubar>
20
133
  <% end %>
@@ -1,4 +1,4 @@
1
- <% if @preview_mode %>
1
+ <% if Alchemy::Current.preview_page? %>
2
2
  <script type="text/javascript">
3
3
  Alchemy = { locale: "<%= session[:alchemy_locale] %>" };
4
4
  </script>
@@ -1,12 +1,12 @@
1
1
  <% if Alchemy::Attachment.tag_counts.any? %>
2
2
  <h3><%= Alchemy.t("Filter by tag") %></h3>
3
- <%= js_filter_field '.tag-list li' %>
3
+ <%= render Alchemy::Admin::ListFilter.new(".tag-list li") %>
4
4
  <ul>
5
5
  <%= render_tag_list('Alchemy::Attachment') %>
6
6
  </ul>
7
7
  <% if search_filter_params[:tagged_with].present? %>
8
8
  <%= link_to(
9
- render_icon(:times, size: 'xs') + Alchemy.t('Remove tag filter'),
9
+ render_icon(:times, size: '1x') + Alchemy.t('Remove tag filter'),
10
10
  url_for(search_filter_params.except(:tagged_with)),
11
11
  remote: request.xhr?,
12
12
  class: 'secondary button small with_icon'
@@ -1,5 +1,4 @@
1
1
  (function() {
2
2
  var dialog = Alchemy.currentDialog();
3
3
  dialog.dialog_body.html('<%= j render("archive_overlay") %>');
4
- Alchemy.ListFilter(dialog.dialog_body);
5
4
  })();
@@ -2,9 +2,8 @@
2
2
  url: {action: :update, q: search_filter_params[:q], page: params[:page]}) do |f| -%>
3
3
  <%= f.input :name, input_html: {autofocus: true} %>
4
4
  <%= f.input :file_name, input_html: {autofocus: true}, hint: Alchemy.t(:attachment_filename_notice) %>
5
- <div class="input string autocomplete_tag_list">
6
- <%= f.label :tag_list %>
7
- <%= render 'alchemy/admin/partials/autocomplete_tag_list', f: f %>
8
- </div>
5
+ <%= render Alchemy::Admin::TagsAutocomplete.new do %>
6
+ <%= f.input :tag_list, input_html: { value: f.object.tag_list.join(",") } %>
7
+ <% end %>
9
8
  <%= f.submit Alchemy.t(:save) %>
10
9
  <% end %>
@@ -1,3 +1,3 @@
1
1
  $("#clipboard_items").replaceWith("<%= j render_message { Alchemy.t('No items in your clipboard') } -%>");
2
- $('#clipboard_button .icon').removeClass('ri-clipboard-fill').addClass('ri-clipboard-line');
2
+ $('#clipboard_button alchemy-icon').attr('icon-style', 'line');
3
3
  Alchemy.pleaseWaitOverlay(false);
@@ -12,7 +12,7 @@
12
12
  <%= render_icon(:file) %>
13
13
  <%= truncate(item.name, length: 50) %>
14
14
  <% else %>
15
- <%= render_icon(:draggable, style: nil) %>
15
+ <%= render_icon(:draggable, style: false) %>
16
16
  <%= truncate(item.display_name_with_preview_text(50), length: 50) %>
17
17
  <% end %>
18
18
  <span class="float_right">
@@ -13,7 +13,7 @@
13
13
  <% else -%>
14
14
  Alchemy.growl('<%= j Alchemy.t("item copied to clipboard", name: @item.class.name == "Alchemy::Element" ? @item.display_name_with_preview_text : @item.name) %>')
15
15
  <% end -%>
16
- $('#clipboard_button .icon').removeClass('ri-clipboard-line').addClass('ri-clipboard-fill');
16
+ $('#clipboard_button alchemy-icon').attr('icon-style', 'fill');
17
17
 
18
18
  <%# Update add nested element forms for any elements that accept ONLY this as a nested element %>
19
19
  <% if @item.class == Alchemy::Element %>
@@ -3,7 +3,7 @@
3
3
  $("#clipboard_item_<%= @item.id -%>").remove();
4
4
  Alchemy.growl('<%= Alchemy.t("item removed from clipboard", :name => @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name) -%>');
5
5
  <%- if @clipboard.blank? -%>
6
- $('#clipboard_button .icon').removeClass('fa-paste').addClass('fa-clipboard');
6
+ $('#clipboard_button alchemy-icon').attr('icon-style', 'line');
7
7
  $("#clipboard_items").replaceWith("<%= j render_message { Alchemy.t('No items in your clipboard') } %>");
8
8
  <%- end -%>
9
9
 
@@ -36,7 +36,7 @@
36
36
  <% end %>
37
37
  </td>
38
38
  <td>
39
- <% if (current_alchemy_user.id == page.locked_by) || can?(:manage, Alchemy::Site.current) %>
39
+ <% if (current_alchemy_user.id == page.locked_by) || can?(:manage, Alchemy::Current.site) %>
40
40
  <%= form_tag(alchemy.unlock_admin_page_path(page, :redirect_to => alchemy.admin_dashboard_url)) do %>
41
41
  <button class="icon_button small" title="<%= Alchemy.t(:explain_unlocking) %>">
42
42
  <%= render_icon(:close, size: '1x') %>
@@ -7,7 +7,7 @@
7
7
  <tr class="<%= cycle('even', 'odd', name: 'sites') %>">
8
8
  <td>
9
9
  <% if alchemy.respond_to?(:login_url) %>
10
- <%= link_to_unless site == Alchemy::Site.current,
10
+ <%= link_to_unless site == Alchemy::Current.site,
11
11
  site.name,
12
12
  alchemy.login_url(
13
13
  protocol: 'http://',
@@ -1,21 +1,57 @@
1
1
  <h2><%= Alchemy.t('Global shortcuts') %></h2>
2
2
  <ul class="shortcuts">
3
- <li><kbd>?</kbd><%= Alchemy.t('Open help window', scope: 'help.shortcuts') %></li>
4
- <li><kbd>esc</kbd><%= Alchemy.t('Close current dialog', scope: 'help.shortcuts') %></li>
5
- <li><kbd>alt</kbd><kbd>q</kbd><%= Alchemy.t('Open logout dialog', scope: 'help.shortcuts') %></li>
6
- <li><kbd>alt</kbd><kbd>f</kbd><%= Alchemy.t('Focus search field', scope: 'help.shortcuts') %></li>
7
- <li><kbd>alt</kbd><kbd>n</kbd><%= Alchemy.t('Create a new record', scope: 'help.shortcuts') %></li>
3
+ <li>
4
+ <kbd>?</kbd>
5
+ <%= Alchemy.t('Open help window', scope: 'help.shortcuts') %>
6
+ </li>
7
+ <li>
8
+ <kbd>esc</kbd>
9
+ <%= Alchemy.t('Close current dialog', scope: 'help.shortcuts') %>
10
+ </li>
11
+ <li>
12
+ <kbd>alt</kbd><kbd>q</kbd>
13
+ <%= Alchemy.t('Open logout dialog', scope: 'help.shortcuts') %>
14
+ </li>
15
+ <li>
16
+ <kbd>alt</kbd><kbd>f</kbd>
17
+ <%= Alchemy.t('Focus search field', scope: 'help.shortcuts') %>
18
+ </li>
19
+ <li>
20
+ <kbd>alt</kbd><kbd>n</kbd>
21
+ <%= Alchemy.t('Create a new record', scope: 'help.shortcuts') %>
22
+ </li>
8
23
  </ul>
9
24
  <h2><%= Alchemy.t('Page edit shortcuts') %></h2>
10
25
  <ul class="shortcuts">
11
- <li><kbd>alt</kbd><kbd>i</kbd><%= Alchemy.t('Show page infos', scope: 'help.shortcuts') %></li>
12
- <li><kbd>alt</kbd><kbd>n</kbd><%= Alchemy.t('Create new element', scope: 'help.shortcuts') %></li>
13
- <li><kbd>alt</kbd><kbd>e</kbd><%= Alchemy.t('Edit page properties', scope: 'help.shortcuts') %></li>
14
- <li><kbd>alt</kbd><kbd>r</kbd><%= Alchemy.t('Reload the preview', scope: 'help.shortcuts') %></li>
15
- <li><kbd>alt</kbd><kbd>x</kbd><%= Alchemy.t('Leave the page', scope: 'help.shortcuts') %></li>
26
+ <li>
27
+ <kbd>alt</kbd><kbd>i</kbd>
28
+ <%= Alchemy.t('Show page infos', scope: 'help.shortcuts') %>
29
+ </li>
30
+ <li>
31
+ <kbd>alt</kbd><kbd>n</kbd>
32
+ <%= Alchemy.t('Create new element', scope: 'help.shortcuts') %>
33
+ </li>
34
+ <li>
35
+ <kbd>alt</kbd><kbd>e</kbd>
36
+ <%= Alchemy.t('Edit page properties', scope: 'help.shortcuts') %>
37
+ </li>
38
+ <li>
39
+ <kbd>alt</kbd><kbd>r</kbd>
40
+ <%= Alchemy.t('Reload the preview', scope: 'help.shortcuts') %>
41
+ </li>
42
+ <li>
43
+ <kbd>alt</kbd><kbd>x</kbd>
44
+ <%= Alchemy.t('Leave the page', scope: 'help.shortcuts') %>
45
+ </li>
16
46
  </ul>
17
47
  <h2><%= Alchemy.t('Library shortcuts') %></h2>
18
48
  <ul class="shortcuts">
19
- <li><kbd>alt</kbd><kbd>n</kbd><%= Alchemy.t('Open upload form', scope: 'help.shortcuts') %></li>
20
- <li><kbd>alt</kbd><kbd>a</kbd><%= Alchemy.t('Select all pictures', scope: 'help.shortcuts') %></li>
49
+ <li>
50
+ <kbd>alt</kbd><kbd>n</kbd>
51
+ <%= Alchemy.t('Open upload form', scope: 'help.shortcuts') %>
52
+ </li>
53
+ <li>
54
+ <kbd>alt</kbd><kbd>a</kbd>
55
+ <%= Alchemy.t('Select all pictures', scope: 'help.shortcuts') %>
56
+ </li>
21
57
  </ul>
@@ -1,6 +1,6 @@
1
1
  <%= content_for :toolbar do %>
2
2
  <div class="toolbar_buttons">
3
- <%= toolbar_button(
3
+ <%= render Alchemy::Admin::ToolbarButton.new(
4
4
  icon: 'information',
5
5
  label: Alchemy.t(:info),
6
6
  url: alchemy.dashboard_info_path,
@@ -43,22 +43,19 @@
43
43
  <p><%= Alchemy.t('Alchemy is open software and itself uses open software and free resources:') %></p>
44
44
  <ul>
45
45
  <li>
46
- <a href="http://rubyonrails.org" target="_blank">RubyOnRails</a>
46
+ <a href="https://rubyonrails.org" target="_blank">Ruby on Rails</a>
47
47
  </li>
48
48
  <li>
49
- <a href="http://jquery.com" target="_blank">jQuery Javascript Library</a>
49
+ <a href="https://jquery.com" target="_blank">jQuery Javascript Library</a>
50
50
  </li>
51
51
  <li>
52
- <a href="http://jqueryui.com" target="_blank">jQuery UI Javascript GUI Library</a>
52
+ <a href="https://shoelace.style" target="_blank">Shoelace Web Components Library</a>
53
53
  </li>
54
54
  <li>
55
- <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE - Javascript WYSIWYG Editor</a>
55
+ <a href="https://www.tiny.cloud" target="_blank">TinyMCE - Javascript WYSIWYG Editor</a>
56
56
  </li>
57
57
  <li>
58
- <a href="http://blueimp.github.io/jQuery-File-Upload/" target="_blank">jQuery File Upload</a>
59
- </li>
60
- <li>
61
- <a href="https://remixicon.com" target="_blank">Remix Icon</a>
58
+ <a href="https://remixicon.com" target="_blank">Remix Icons</a>
62
59
  </li>
63
60
  </ul>
64
61
  <% end %>
@@ -8,7 +8,7 @@
8
8
  <%= f.hidden_field :name %>
9
9
  <%= f.hidden_field :page_version_id, value: element.page_version_id %>
10
10
  <%= f.hidden_field :parent_element_id, value: element.id %>
11
- <button class="add-nestable-element-button" is="alchemy-button">
11
+ <button class="add-nestable-element-button" is="alchemy-button" data-turbo="false">
12
12
  <%= Alchemy.t(:add_nested_element, name: Alchemy.t(nestable_element.to_sym, scope: 'element_names')) %>
13
13
  </button>
14
14
  <% end %>
@@ -2,7 +2,7 @@
2
2
  id="element_<%= element.id %>"
3
3
  data-element-id="<%= element.id %>"
4
4
  data-element-name="<%= element.name %>"
5
- class="<%= element.css_classes %>"
5
+ class="<%= element.css_classes.join(" ") %>"
6
6
  <%= element.compact? ? "compact" : nil %>
7
7
  <%= element.fixed? ? "fixed" : nil %>
8
8
  >
@@ -44,7 +44,7 @@
44
44
  <%= content_tag :details, class: "ingredient-group", id: "element_#{element.id}_ingredient_group_#{group.parameterize.underscore}", is: "alchemy-ingredient-group" do %>
45
45
  <summary>
46
46
  <%= element.translated_group group %>
47
- <i class="ingredient-group-expand icon ri-fw ri-arrow-left-s-line"></i>
47
+ <%= render_icon "arrow-left-s" %>
48
48
  </summary>
49
49
  <%= render ingredients, element_form: f %>
50
50
  <% end %>
@@ -53,10 +53,10 @@
53
53
  <% end %>
54
54
 
55
55
  <% if element.taggable? %>
56
- <div class="autocomplete_tag_list">
56
+ <%= render Alchemy::Admin::TagsAutocomplete.new do %>
57
57
  <%= f.label :tag_list %>
58
- <%= render 'alchemy/admin/partials/autocomplete_tag_list', f: f %>
59
- </div>
58
+ <%= f.text_field :tag_list, value: f.object.tag_list.join(",") %>
59
+ <% end %>
60
60
  <% end %>
61
61
  <% end %>
62
62
 
@@ -5,7 +5,7 @@
5
5
  </p>
6
6
  <% end %>
7
7
 
8
- <button type="submit" form="element_<%= element.id %>_form" is="alchemy-button">
8
+ <button type="submit" form="element_<%= element.id %>_form" is="alchemy-button" data-turbo="false">
9
9
  <%= Alchemy.t(:save) %>
10
10
  </button>
11
11
  </div>
@@ -5,7 +5,7 @@
5
5
  <% elsif element.deprecated? %>
6
6
  <%= hint_with_tooltip element.deprecation_notice %>
7
7
  <% else %>
8
- <%= render_icon('draggable', style: nil, class: 'element', fixed_width: false) %>
8
+ <%= render_icon('draggable', style: false, class: 'element', fixed_width: false) %>
9
9
  <% end %>
10
10
  </span>
11
11
  <span class="element-title">
@@ -24,6 +24,10 @@
24
24
  title: Alchemy.t(element.folded? ? :show_element_content : :hide_element_content),
25
25
  class: "element-toggle"
26
26
  }) do %>
27
- <%= render_icon element.folded? ? 'arrow-left-s' : 'arrow-down-s' %>
27
+ <% if element.compact? %>
28
+ <%= render_icon "more-2" %>
29
+ <% else %>
30
+ <%= render_icon element.folded? ? "arrow-left-s" : "arrow-down-s" %>
31
+ <% end %>
28
32
  <% end %>
29
33
  </div>
@@ -19,12 +19,14 @@
19
19
  ) %>
20
20
  </sl-tooltip>
21
21
  <sl-tooltip content="<%= Alchemy.t("Delete element") %>">
22
- <%= link_to_confirm_dialog(
23
- render_icon('delete-bin-2'),
24
- Alchemy.t(:confirm_to_delete_element),
25
- alchemy.admin_element_path(element),
26
- class: "icon_button"
27
- ) -%>
22
+ <alchemy-delete-element-button
23
+ href="<%= alchemy.admin_element_path(element) %>"
24
+ message="<%= Alchemy.t(:confirm_to_delete_element) %>"
25
+ >
26
+ <button type="button" class="icon_button" data-turbo="false">
27
+ <%= render_icon('delete-bin-2') %>
28
+ </button>
29
+ </alchemy-delete-element-button>
28
30
  </sl-tooltip>
29
31
  <sl-tooltip content="<%= element.public? ? Alchemy.t(:hide_element) : Alchemy.t(:show_element) %>" placement="top-end">
30
32
  <alchemy-publish-element-button>
@@ -7,9 +7,6 @@
7
7
  <%- end -%>
8
8
 
9
9
  <% if @element.fixed? %>
10
- if ($('#fixed-elements').length == 0) {
11
- Alchemy.FixedElements.buildTabs('<%= Alchemy.t(:main_content) %>');
12
- }
13
10
  Alchemy.FixedElements.createTab('<%= @element.id %>', '<%= @element.display_name %>');
14
11
  $element_area = $('[name="fixed-element-<%= @element.id %>"]');
15
12
  <% elsif @element.parent_element %>
@@ -24,8 +21,6 @@
24
21
  $element_area.append(element_html);
25
22
  <%- end -%>
26
23
 
27
- Alchemy.SortableElements('[data-element-id="<%= @element.id %>"] .nested-elements');
28
-
29
24
  Alchemy.growl('<%= Alchemy.t(:successfully_added_element) %>');
30
25
  Alchemy.closeCurrentDialog();
31
26
  Alchemy.reloadPreview();
@@ -1,36 +1,72 @@
1
- <% if @fixed_elements.any? %>
2
- <sl-tab-group id="fixed-elements">
3
- <sl-tab slot="nav" panel="main-content-elements">
4
- <%= Alchemy.t(:main_content) %>
5
- </sl-tab>
6
- <% @fixed_elements.each do |element| %>
7
- <sl-tab slot="nav" panel="fixed-element-<%= element.id %>">
8
- <%= element.display_name %>
9
- </sl-tab>
1
+ <%= turbo_frame_tag "alchemy_elements_window" do %>
2
+ <alchemy-elements-window>
3
+ <div class="elements-window-toolbar">
4
+ <%= render Alchemy::Admin::ToolbarButton.new(
5
+ url: alchemy.new_admin_element_path(page_version_id: @page_version.id),
6
+ icon: :add,
7
+ hotkey: "alt+n",
8
+ label: Alchemy.t("New Element"),
9
+ dialog_options: {
10
+ title: Alchemy.t("New Element"),
11
+ size: "320x125"
12
+ },
13
+ if_permitted_to: [:create, Alchemy::Element]
14
+ ) %>
15
+ <%= render Alchemy::Admin::ToolbarButton.new(
16
+ url: alchemy.admin_clipboard_path(remarkable_type: "elements"),
17
+ label: Alchemy.t("Show clipboard"),
18
+ icon: :clipboard,
19
+ icon_style: clipboard_empty?("elements") ? "line" : "fill",
20
+ dialog_options: {
21
+ title: Alchemy.t("Clipboard"),
22
+ size: "400x305"
23
+ },
24
+ link_options: {
25
+ id: "clipboard_button"
26
+ },
27
+ if_permitted_to: [:index, :alchemy_admin_clipboard]
28
+ ) %>
29
+ <sl-tooltip content="<%= Alchemy.t("Collapse all elements") %>" placement="top-end" class="right">
30
+ <button id="collapse-all-elements-button" class="icon_button">
31
+ <alchemy-icon name="contract-up-down"></alchemy-icon>
32
+ </button>
33
+ </sl-tooltip>
34
+ </div>
35
+ <% if @page.element_definitions.any? { |el| el["fixed"] } %>
36
+ <sl-tab-group id="fixed-elements">
37
+ <sl-tab slot="nav" panel="main-content-elements">
38
+ <%= Alchemy.t(:main_content) %>
39
+ </sl-tab>
40
+ <% @fixed_elements.each do |element| %>
41
+ <sl-tab slot="nav" panel="fixed-element-<%= element.id %>">
42
+ <%= element.display_name %>
43
+ </sl-tab>
44
+ <% end %>
45
+ <sl-tab-panel
46
+ name="main-content-elements"
47
+ class="sortable-elements scrollable-elements"
48
+ data-droppable-elements="<%= @page.element_definition_names.join(' ') %>"
49
+ data-element-name="main-content-elements"
50
+ id="main-content-elements"
51
+ style="--padding: 0"
52
+ >
53
+ <%= render @elements.map { |element| Alchemy::ElementEditor.new(element) } %>
54
+ </sl-tab-panel>
55
+ <% @fixed_elements.each do |element| %>
56
+ <sl-tab-panel name="fixed-element-<%= element.id %>" style="--padding: 0" class="scrollable-elements">
57
+ <%= render Alchemy::ElementEditor.new(element) %>
58
+ </sl-tab-panel>
59
+ <% end %>
60
+ </sl-tab-group>
61
+ <% else %>
62
+ <div
63
+ id="main-content-elements"
64
+ class="sortable-elements scrollable-elements"
65
+ data-droppable-elements="<%= @page.element_definition_names.join(' ') %>"
66
+ data-element-name="main-content-elements"
67
+ >
68
+ <%= render @elements.map { |element| Alchemy::ElementEditor.new(element) } %>
69
+ </div>
10
70
  <% end %>
11
- <sl-tab-panel
12
- name="main-content-elements"
13
- class="sortable-elements scrollable-elements"
14
- data-droppable-elements="<%= @page.element_definition_names.join(' ') %>"
15
- data-element-name="main-content-elements"
16
- id="main-content-elements"
17
- style="--padding: 0"
18
- >
19
- <%= render @elements.map { |element| Alchemy::ElementEditor.new(element) } %>
20
- </sl-tab-panel>
21
- <% @fixed_elements.each do |element| %>
22
- <sl-tab-panel name="fixed-element-<%= element.id %>" style="--padding: 0" class="scrollable-elements">
23
- <%= render Alchemy::ElementEditor.new(element) %>
24
- </sl-tab-panel>
25
- <% end %>
26
- </sl-tab-group>
27
- <% else %>
28
- <div
29
- id="main-content-elements"
30
- class="sortable-elements scrollable-elements"
31
- data-droppable-elements="<%= @page.element_definition_names.join(' ') %>"
32
- data-element-name="main-content-elements"
33
- >
34
- <%= render @elements.map { |element| Alchemy::ElementEditor.new(element) } %>
35
- </div>
71
+ </alchemy-elements-window>
36
72
  <% end %>
@@ -5,9 +5,9 @@
5
5
  <%- if css_classes.present? -%>
6
6
  <%= f.input :css_class,
7
7
  collection: css_classes,
8
- include_blank: Alchemy.t('None'),
9
- input_html: {is: 'alchemy-select'} %>
8
+ include_blank: Alchemy.t('None') %>
10
9
  <%- else -%>
10
+ <% Alchemy::Deprecation.warn %(Float positioning in File ingredients is deprecated. If you rely on them, please use `css_classes` in your "#{ingredient.role}" settings instead.) %>
11
11
  <%= f.input :css_class,
12
12
  label: Alchemy.t(:position_in_text),
13
13
  collection: [
@@ -1,20 +1,19 @@
1
1
  <%= f.input :caption, as: ingredient.settings[:caption_as_textarea] ? 'text' : 'string' %>
2
2
  <%= f.input :title %>
3
- <%= f.input :alt_tag %>
3
+ <%= f.input :alt_tag, as: :text, placeholder: ingredient.alt_text(language: @language) %>
4
4
  <%- if ingredient.settings[:sizes].present? && ingredient.settings[:srcset].blank? -%>
5
5
  <%= f.input :render_size,
6
6
  collection: [
7
7
  [Alchemy.t('Layout default'), ""]
8
8
  ] + ingredient.settings[:sizes].to_a,
9
- include_blank: false,
10
- input_html: {is: 'alchemy-select'} %>
9
+ include_blank: false %>
11
10
  <%- end -%>
12
11
  <%- if ingredient.settings[:css_classes].present? -%>
13
12
  <%= f.input :css_class,
14
13
  collection: ingredient.settings[:css_classes],
15
- include_blank: Alchemy.t('None'),
16
- input_html: {is: 'alchemy-select'} %>
14
+ include_blank: Alchemy.t('None') %>
17
15
  <%- else -%>
16
+ <% Alchemy::Deprecation.warn %(Float positioning in Picture ingredients is deprecated. If you rely on them, please use `css_classes` in your "#{ingredient.role}" settings instead.) %>
18
17
  <%= f.input :css_class,
19
18
  label: Alchemy.t(:position_in_text),
20
19
  collection: [
@@ -0,0 +1,5 @@
1
+ <alchemy-action name="closeCurrentDialog"></alchemy-action>
2
+ <alchemy-action name="reloadPreview"></alchemy-action>
3
+ <% if @ingredient.settings[:anchor] %>
4
+ <alchemy-action name="updateAnchorIcon" params="<%= [@ingredient.id, @ingredient.dom_id.present?].to_json %>"></alchemy-action>
5
+ <% end %>
@@ -1,6 +1,6 @@
1
1
  <tr class="<%= cycle('even', 'odd') %>">
2
2
  <td class="icon">
3
- <%= render_icon("translate-2", size: "xl", style: nil) %>
3
+ <%= render_icon("translate-2", size: "xl", style: false) %>
4
4
  </td>
5
5
  <td>
6
6
  <%= language.name %>