alchemy_cms 7.1.12 → 7.2.0.b

Sign up to get free protection for your applications and to get access to all the features.
Files changed (314) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +132 -29
  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/javascripts/alchemy/admin.js +0 -9
  9. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +5 -15
  10. data/app/assets/javascripts/alchemy/alchemy.image_overlay.coffee +5 -4
  11. data/app/assets/javascripts/alchemy/templates/index.js +0 -1
  12. data/app/assets/javascripts/alchemy/templates/node_folder.hbs +1 -1
  13. data/app/assets/javascripts/alchemy/templates/page_folder.hbs +1 -1
  14. data/app/assets/javascripts/tinymce/plugins/alchemy_link/plugin.min.js +20 -7
  15. data/app/assets/stylesheets/alchemy/_custom-properties.scss +12 -0
  16. data/app/assets/stylesheets/alchemy/_mixins.scss +10 -6
  17. data/app/assets/stylesheets/alchemy/_variables.scss +3 -0
  18. data/app/assets/stylesheets/alchemy/admin.scss +2 -2
  19. data/app/assets/stylesheets/alchemy/archive.scss +4 -3
  20. data/app/assets/stylesheets/alchemy/attachment-select.scss +19 -0
  21. data/app/assets/stylesheets/alchemy/base.scss +31 -18
  22. data/app/assets/stylesheets/alchemy/buttons.scss +3 -4
  23. data/app/assets/stylesheets/alchemy/dashboard.scss +1 -1
  24. data/app/assets/stylesheets/alchemy/dialogs.scss +2 -5
  25. data/app/assets/stylesheets/alchemy/elements.scss +73 -41
  26. data/app/assets/stylesheets/alchemy/flash.scss +20 -70
  27. data/app/assets/stylesheets/alchemy/forms.scss +41 -36
  28. data/app/assets/stylesheets/alchemy/frame.scss +12 -3
  29. data/app/assets/stylesheets/alchemy/icons.scss +34 -2
  30. data/app/assets/stylesheets/alchemy/image_library.scss +18 -9
  31. data/app/assets/stylesheets/alchemy/{filter_field.scss → list_filter.scss} +8 -7
  32. data/app/assets/stylesheets/alchemy/lists.scss +1 -1
  33. data/app/assets/stylesheets/alchemy/navigation.scss +9 -12
  34. data/app/assets/stylesheets/alchemy/node-select.scss +1 -1
  35. data/app/assets/stylesheets/alchemy/nodes.scss +15 -13
  36. data/app/assets/stylesheets/alchemy/notices.scss +56 -39
  37. data/app/assets/stylesheets/alchemy/page-select.scss +1 -4
  38. data/app/assets/stylesheets/alchemy/pagination.scss +11 -1
  39. data/app/assets/stylesheets/alchemy/preview_window.scss +3 -3
  40. data/app/assets/stylesheets/alchemy/search.scss +4 -4
  41. data/app/assets/stylesheets/alchemy/selects.scss +13 -7
  42. data/app/assets/stylesheets/alchemy/shoelace.scss +33 -2
  43. data/app/assets/stylesheets/alchemy/sitemap.scss +155 -159
  44. data/app/assets/stylesheets/alchemy/tables.scss +49 -12
  45. data/app/assets/stylesheets/alchemy/tags.scss +17 -11
  46. data/app/assets/stylesheets/alchemy/toolbar.scss +2 -2
  47. data/app/assets/stylesheets/alchemy/typography.scss +41 -22
  48. data/app/assets/stylesheets/alchemy/upload.scss +5 -4
  49. data/app/components/alchemy/admin/attachment_select.rb +39 -0
  50. data/app/components/alchemy/admin/icon.rb +72 -0
  51. data/app/components/alchemy/admin/link_dialog/anchor_tab.rb +41 -0
  52. data/app/components/alchemy/admin/link_dialog/base_tab.rb +75 -0
  53. data/app/components/alchemy/admin/link_dialog/external_tab.rb +42 -0
  54. data/app/components/alchemy/admin/link_dialog/file_tab.rb +45 -0
  55. data/app/components/alchemy/admin/link_dialog/internal_tab.rb +66 -0
  56. data/app/components/alchemy/admin/link_dialog/tabs.rb +33 -0
  57. data/app/components/alchemy/admin/list_filter.rb +42 -0
  58. data/app/components/alchemy/admin/message.rb +19 -0
  59. data/app/components/alchemy/admin/tags_autocomplete.rb +25 -0
  60. data/app/components/alchemy/admin/toolbar_button.rb +111 -0
  61. data/app/components/alchemy/ingredients/datetime_view.rb +2 -3
  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/layoutpages_controller.rb +0 -19
  70. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +12 -4
  71. data/app/controllers/alchemy/admin/nodes_controller.rb +26 -0
  72. data/app/controllers/alchemy/admin/pages_controller.rb +11 -78
  73. data/app/controllers/alchemy/admin/picture_descriptions_controller.rb +15 -0
  74. data/app/controllers/alchemy/admin/pictures_controller.rb +18 -1
  75. data/app/controllers/alchemy/admin/resources_controller.rb +15 -10
  76. data/app/controllers/alchemy/api/attachments_controller.rb +44 -0
  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 +3 -3
  80. data/app/controllers/alchemy/pages_controller.rb +8 -6
  81. data/app/controllers/concerns/alchemy/admin/current_language.rb +1 -11
  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/attachment_select.js +24 -0
  91. data/app/javascript/alchemy_admin/components/button.js +3 -0
  92. data/app/javascript/alchemy_admin/components/clipboard_button.js +3 -2
  93. data/app/javascript/alchemy_admin/components/dialog_link.js +10 -7
  94. data/app/javascript/alchemy_admin/components/dom_id_select.js +69 -0
  95. data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +42 -0
  96. data/app/javascript/alchemy_admin/components/element_editor/publish_element_button.js +4 -2
  97. data/app/javascript/alchemy_admin/components/element_editor.js +21 -13
  98. data/app/javascript/alchemy_admin/components/elements_window.js +87 -0
  99. data/app/javascript/alchemy_admin/components/growl.js +13 -0
  100. data/app/javascript/alchemy_admin/components/icon.js +51 -0
  101. data/app/javascript/alchemy_admin/components/index.js +24 -0
  102. data/app/javascript/alchemy_admin/components/ingredient_group.js +6 -0
  103. data/app/javascript/alchemy_admin/components/link_buttons/link_button.js +21 -11
  104. data/app/javascript/alchemy_admin/components/link_buttons/unlink_button.js +2 -1
  105. data/app/javascript/alchemy_admin/components/link_buttons.js +1 -0
  106. data/app/javascript/alchemy_admin/components/list_filter.js +68 -0
  107. data/app/javascript/alchemy_admin/components/message.js +69 -0
  108. data/app/javascript/alchemy_admin/components/node_select.js +1 -1
  109. data/app/javascript/alchemy_admin/components/overlay.js +6 -6
  110. data/app/javascript/alchemy_admin/components/page_select.js +3 -7
  111. data/app/javascript/alchemy_admin/components/preview_window.js +121 -0
  112. data/app/javascript/alchemy_admin/components/remote_select.js +4 -1
  113. data/app/javascript/alchemy_admin/components/select.js +37 -1
  114. data/app/javascript/alchemy_admin/components/tags_autocomplete.js +57 -0
  115. data/app/javascript/alchemy_admin/components/uploader/file_upload.js +4 -3
  116. data/app/javascript/alchemy_admin/components/uploader/progress.js +1 -1
  117. data/app/javascript/alchemy_admin/confirm_dialog.js +133 -0
  118. data/app/javascript/alchemy_admin/dirty.js +19 -14
  119. data/app/javascript/alchemy_admin/fixed_elements.js +24 -0
  120. data/app/javascript/alchemy_admin/growler.js +15 -0
  121. data/app/javascript/alchemy_admin/gui.js +2 -4
  122. data/app/javascript/alchemy_admin/hotkeys.js +60 -0
  123. data/app/javascript/alchemy_admin/image_loader.js +2 -2
  124. data/app/javascript/alchemy_admin/ingredient_anchor_link.js +2 -3
  125. data/app/javascript/alchemy_admin/initializer.js +1 -8
  126. data/app/javascript/alchemy_admin/link_dialog.js +131 -0
  127. data/app/javascript/alchemy_admin/locales/en.js +3 -0
  128. data/app/javascript/alchemy_admin/node_tree.js +4 -3
  129. data/app/javascript/alchemy_admin/page_sorter.js +23 -14
  130. data/app/javascript/alchemy_admin/picture_editors.js +6 -5
  131. data/app/javascript/alchemy_admin/shoelace_theme.js +60 -0
  132. data/app/javascript/alchemy_admin/sitemap.js +9 -3
  133. data/app/javascript/alchemy_admin/sortable_elements.js +4 -6
  134. data/app/javascript/alchemy_admin.js +18 -42
  135. data/app/models/alchemy/current.rb +26 -0
  136. data/app/models/alchemy/element.rb +1 -1
  137. data/app/models/alchemy/ingredients/audio.rb +0 -11
  138. data/app/models/alchemy/ingredients/datetime.rb +1 -1
  139. data/app/models/alchemy/ingredients/headline.rb +8 -1
  140. data/app/models/alchemy/ingredients/picture.rb +6 -0
  141. data/app/models/alchemy/ingredients/video.rb +0 -12
  142. data/app/models/alchemy/language.rb +8 -6
  143. data/app/models/alchemy/node.rb +2 -2
  144. data/app/models/alchemy/page/page_elements.rb +8 -8
  145. data/app/models/alchemy/page/page_layouts.rb +3 -3
  146. data/app/models/alchemy/page/page_natures.rb +13 -9
  147. data/app/models/alchemy/page/page_scopes.rb +2 -2
  148. data/app/models/alchemy/page/publisher.rb +1 -0
  149. data/app/models/alchemy/page.rb +13 -28
  150. data/app/models/alchemy/picture.rb +8 -0
  151. data/app/models/alchemy/picture_description.rb +8 -0
  152. data/app/models/alchemy/picture_variant.rb +1 -1
  153. data/app/models/alchemy/site.rb +10 -7
  154. data/app/serializers/alchemy/attachment_serializer.rb +8 -0
  155. data/app/serializers/alchemy/page_node_serializer.rb +9 -0
  156. data/app/views/alchemy/_menubar.html.erb +1 -1
  157. data/app/views/alchemy/_preview_mode_code.html.erb +1 -1
  158. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +2 -2
  159. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -1
  160. data/app/views/alchemy/admin/attachments/edit.html.erb +3 -4
  161. data/app/views/alchemy/admin/clipboard/clear.js.erb +1 -1
  162. data/app/views/alchemy/admin/clipboard/index.html.erb +1 -1
  163. data/app/views/alchemy/admin/clipboard/insert.js.erb +1 -1
  164. data/app/views/alchemy/admin/clipboard/remove.js.erb +1 -1
  165. data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
  166. data/app/views/alchemy/admin/dashboard/_sites.html.erb +1 -1
  167. data/app/views/alchemy/admin/dashboard/help.html.erb +48 -12
  168. data/app/views/alchemy/admin/dashboard/index.html.erb +1 -1
  169. data/app/views/alchemy/admin/dashboard/info.html.erb +5 -8
  170. data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +1 -1
  171. data/app/views/alchemy/admin/elements/_element.html.erb +5 -5
  172. data/app/views/alchemy/admin/elements/_footer.html.erb +1 -1
  173. data/app/views/alchemy/admin/elements/_header.html.erb +6 -2
  174. data/app/views/alchemy/admin/elements/_toolbar.html.erb +8 -6
  175. data/app/views/alchemy/admin/elements/create.js.erb +0 -5
  176. data/app/views/alchemy/admin/elements/index.html.erb +70 -34
  177. data/app/views/alchemy/admin/ingredients/_file_fields.html.erb +1 -2
  178. data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +3 -5
  179. data/app/views/alchemy/admin/languages/_language.html.erb +1 -1
  180. data/app/views/alchemy/admin/languages/index.html.erb +2 -2
  181. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +18 -18
  182. data/app/views/alchemy/admin/layoutpages/edit.html.erb +4 -5
  183. data/app/views/alchemy/admin/layoutpages/index.html.erb +2 -2
  184. data/app/views/alchemy/admin/legacy_page_urls/_legacy_page_url.html.erb +10 -11
  185. data/app/views/alchemy/admin/legacy_page_urls/_new.html.erb +15 -17
  186. data/app/views/alchemy/admin/legacy_page_urls/_table.html.erb +16 -0
  187. data/app/views/alchemy/admin/legacy_page_urls/_update.turbo_stream.erb +12 -0
  188. data/app/views/alchemy/admin/legacy_page_urls/create.turbo_stream.erb +8 -0
  189. data/app/views/alchemy/admin/legacy_page_urls/destroy.turbo_stream.erb +1 -0
  190. data/app/views/alchemy/admin/legacy_page_urls/edit.html.erb +27 -0
  191. data/app/views/alchemy/admin/legacy_page_urls/show.html.erb +1 -0
  192. data/app/views/alchemy/admin/legacy_page_urls/update.turbo_stream.erb +1 -0
  193. data/app/views/alchemy/admin/nodes/_form.html.erb +12 -11
  194. data/app/views/alchemy/admin/nodes/_label.html.erb +1 -0
  195. data/app/views/alchemy/admin/nodes/_node.html.erb +19 -19
  196. data/app/views/alchemy/admin/nodes/_page_nodes.html.erb +48 -0
  197. data/app/views/alchemy/admin/nodes/_update.turbo_stream.erb +9 -0
  198. data/app/views/alchemy/admin/nodes/create.turbo_stream.erb +1 -0
  199. data/app/views/alchemy/admin/nodes/destroy.turbo_stream.erb +1 -0
  200. data/app/views/alchemy/admin/nodes/index.html.erb +3 -3
  201. data/app/views/alchemy/admin/pages/_form.html.erb +3 -4
  202. data/app/views/alchemy/admin/pages/_legacy_urls.html.erb +4 -15
  203. data/app/views/alchemy/admin/pages/_page.html.erb +39 -39
  204. data/app/views/alchemy/admin/pages/_table_row.html.erb +3 -3
  205. data/app/views/alchemy/admin/pages/_toolbar.html.erb +2 -2
  206. data/app/views/alchemy/admin/pages/configure.html.erb +6 -0
  207. data/app/views/alchemy/admin/pages/edit.html.erb +15 -62
  208. data/app/views/alchemy/admin/pages/unlock.js.erb +3 -3
  209. data/app/views/alchemy/admin/partials/_autocomplete_tag_list.html.erb +3 -1
  210. data/app/views/alchemy/admin/partials/_flash_notices.html.erb +4 -2
  211. data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +1 -1
  212. data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +5 -2
  213. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
  214. data/app/views/alchemy/admin/partials/_search_form.html.erb +2 -2
  215. data/app/views/alchemy/admin/partials/_site_select.html.erb +1 -1
  216. data/app/views/alchemy/admin/picture_descriptions/_form.html.erb +11 -0
  217. data/app/views/alchemy/admin/picture_descriptions/edit.html.erb +6 -0
  218. data/app/views/alchemy/admin/pictures/_form.html.erb +4 -3
  219. data/app/views/alchemy/admin/pictures/_infos.html.erb +1 -1
  220. data/app/views/alchemy/admin/pictures/_picture_description_field.html.erb +29 -0
  221. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +2 -2
  222. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -2
  223. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +3 -3
  224. data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
  225. data/app/views/alchemy/admin/resources/_form.html.erb +3 -4
  226. data/app/views/alchemy/admin/resources/_per_page_select.html.erb +1 -1
  227. data/app/views/alchemy/admin/resources/_tag_list.html.erb +2 -2
  228. data/app/views/alchemy/admin/resources/index.html.erb +2 -2
  229. data/app/views/alchemy/admin/sites/index.html.erb +1 -1
  230. data/app/views/alchemy/admin/styleguide/index.html.erb +29 -24
  231. data/app/views/alchemy/admin/tags/_tag.html.erb +1 -1
  232. data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
  233. data/app/views/alchemy/admin/tags/index.html.erb +1 -1
  234. data/app/views/alchemy/base/500.html.erb +7 -18
  235. data/app/views/alchemy/base/error_notice.html.erb +3 -1
  236. data/app/views/alchemy/ingredients/_boolean_editor.html.erb +1 -1
  237. data/app/views/alchemy/ingredients/_datetime_editor.html.erb +2 -3
  238. data/app/views/alchemy/ingredients/_headline_editor.html.erb +13 -8
  239. data/app/views/alchemy/ingredients/_picture_editor.html.erb +1 -1
  240. data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +1 -1
  241. data/app/views/alchemy/language_links/_language.html.erb +1 -1
  242. data/app/views/kaminari/alchemy/_first_page.html.erb +2 -2
  243. data/app/views/kaminari/alchemy/_gap.html.erb +1 -1
  244. data/app/views/kaminari/alchemy/_last_page.html.erb +2 -2
  245. data/app/views/kaminari/alchemy/_next_page.html.erb +2 -2
  246. data/app/views/kaminari/alchemy/_prev_page.html.erb +2 -2
  247. data/app/views/layouts/alchemy/admin.html.erb +2 -1
  248. data/bundles/shoelace.js +3 -1
  249. data/config/locales/alchemy.en.yml +16 -3
  250. data/config/routes.rb +4 -2
  251. data/db/migrate/20240314105244_create_alchemy_picture_descriptions.rb +11 -0
  252. data/lib/alchemy/configuration_methods.rb +1 -1
  253. data/lib/alchemy/controller_actions.rb +3 -3
  254. data/lib/alchemy/element_definition.rb +10 -6
  255. data/lib/alchemy/engine.rb +19 -2
  256. data/lib/alchemy/page_layout.rb +10 -6
  257. data/lib/alchemy/permissions.rb +4 -3
  258. data/lib/alchemy/routing_constraints.rb +1 -1
  259. data/lib/alchemy/seeder.rb +2 -2
  260. data/lib/alchemy/test_support/capybara_helpers.rb +4 -0
  261. data/lib/alchemy/test_support/factories/language_factory.rb +1 -1
  262. data/lib/alchemy/test_support/shared_contexts.rb +8 -0
  263. data/lib/alchemy/tinymce.rb +2 -1
  264. data/lib/alchemy/version.rb +1 -1
  265. data/lib/alchemy.rb +36 -0
  266. data/lib/alchemy_cms.rb +0 -1
  267. data/lib/generators/alchemy/menus/templates/node.html.erb +2 -2
  268. data/lib/generators/alchemy/menus/templates/node.html.haml +2 -2
  269. data/lib/generators/alchemy/menus/templates/node.html.slim +2 -2
  270. data/lib/generators/alchemy/menus/templates/wrapper.html.erb +1 -1
  271. data/lib/generators/alchemy/menus/templates/wrapper.html.haml +1 -1
  272. data/lib/generators/alchemy/menus/templates/wrapper.html.slim +1 -1
  273. data/lib/tasks/alchemy/sitemap.rake +97 -0
  274. data/lib/tasks/alchemy/tidy.rake +1 -0
  275. data/package.json +8 -8
  276. data/vendor/assets/fonts/remixicon.symbol.svg +11 -0
  277. data/vendor/javascript/shoelace.min.js +333 -118
  278. data/vendor/javascript/sortable.min.js +1 -1
  279. data/vendor/javascript/tinymce.min.js +1 -1
  280. data/vendor/javascript/ungap-custom-elements.min.js +1 -1
  281. metadata +61 -55
  282. data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +0 -85
  283. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +0 -107
  284. data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +0 -66
  285. data/app/assets/javascripts/alchemy/alchemy.fixed_elements.js +0 -45
  286. data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +0 -24
  287. data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +0 -49
  288. data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +0 -0
  289. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +0 -230
  290. data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +0 -49
  291. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +0 -82
  292. data/app/assets/javascripts/alchemy/alchemy.string_extension.js.coffee +0 -11
  293. data/app/assets/javascripts/alchemy/templates/page.hbs +0 -19
  294. data/app/javascript/alchemy_admin/tags_autocomplete.js +0 -46
  295. data/app/models/alchemy/tree_node.rb +0 -7
  296. data/app/views/alchemy/admin/elements/destroy.js.erb +0 -8
  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/lib/alchemy/test_support/current_language_shared_examples.rb +0 -33
  309. data/vendor/assets/fonts/remixicon.eot +0 -0
  310. data/vendor/assets/fonts/remixicon.svg +0 -7816
  311. data/vendor/assets/fonts/remixicon.ttf +0 -0
  312. data/vendor/assets/fonts/remixicon.woff +0 -0
  313. data/vendor/assets/fonts/remixicon.woff2 +0 -0
  314. data/vendor/assets/stylesheets/remixicon.scss +0 -10480
@@ -0,0 +1,87 @@
1
+ import SortableElements from "alchemy_admin/sortable_elements"
2
+
3
+ class ElementsWindow extends HTMLElement {
4
+ #visible = true
5
+
6
+ constructor() {
7
+ super()
8
+ this.#attachEvents()
9
+ }
10
+
11
+ connectedCallback() {
12
+ this.toggleButton?.addEventListener("click", (evt) => {
13
+ evt.preventDefault()
14
+ this.toggle()
15
+ })
16
+ if (window.location.hash) {
17
+ document
18
+ .querySelector(window.location.hash)
19
+ ?.trigger("FocusElementEditor.Alchemy")
20
+ }
21
+ SortableElements()
22
+ }
23
+
24
+ collapseAllElements() {
25
+ this.querySelectorAll(
26
+ "alchemy-element-editor:not([compact]):not([fixed])"
27
+ ).forEach((editor) => editor.collapse())
28
+ }
29
+
30
+ toggle() {
31
+ this.#visible ? this.hide() : this.show()
32
+ }
33
+
34
+ show() {
35
+ document.body.classList.add("elements-window-visible")
36
+ this.#visible = true
37
+ this.toggleButton.closest("sl-tooltip").content = Alchemy.t("Hide elements")
38
+ this.toggleButton
39
+ .querySelector("alchemy-icon")
40
+ .setAttribute("name", "menu-unfold")
41
+ }
42
+
43
+ hide() {
44
+ document.body.classList.remove("elements-window-visible")
45
+ this.#visible = false
46
+ this.toggleButton.closest("sl-tooltip").content = Alchemy.t("Show elements")
47
+ this.toggleButton
48
+ .querySelector("alchemy-icon")
49
+ .setAttribute("name", "menu-fold")
50
+ }
51
+
52
+ get collapseButton() {
53
+ return this.querySelector("#collapse-all-elements-button")
54
+ }
55
+
56
+ get toggleButton() {
57
+ return document.querySelector("#element_window_button")
58
+ }
59
+
60
+ get previewWindow() {
61
+ return document.getElementById("alchemy_preview_window")
62
+ }
63
+
64
+ #attachEvents() {
65
+ this.collapseButton?.addEventListener("click", () => {
66
+ this.collapseAllElements()
67
+ })
68
+ window.addEventListener("message", (event) => {
69
+ const data = event.data
70
+ if (data?.message == "Alchemy.focusElementEditor") {
71
+ const element = document.getElementById(`element_${data.element_id}`)
72
+ this.show()
73
+ element?.focusElement()
74
+ }
75
+ })
76
+ document.body.addEventListener("click", (evt) => {
77
+ if (!evt.target.closest("alchemy-element-editor")) {
78
+ this.querySelectorAll("alchemy-element-editor").forEach((editor) => {
79
+ editor.classList.remove("selected")
80
+ })
81
+ this.previewWindow?.postMessage({ message: "Alchemy.blurElements" })
82
+ }
83
+ })
84
+ }
85
+ }
86
+
87
+ customElements.define("alchemy-elements-window", ElementsWindow)
@@ -0,0 +1,13 @@
1
+ import { growl } from "alchemy_admin/growler"
2
+
3
+ class Growl extends HTMLElement {
4
+ connectedCallback() {
5
+ growl(this.message, this.getAttribute("type") || "notice")
6
+ }
7
+
8
+ get message() {
9
+ return this.getAttribute("message") || this.innerHTML
10
+ }
11
+ }
12
+
13
+ customElements.define("alchemy-growl", Growl)
@@ -0,0 +1,51 @@
1
+ class Icon extends HTMLElement {
2
+ static get observedAttributes() {
3
+ return ["name", "size", "icon-style"]
4
+ }
5
+
6
+ constructor() {
7
+ super()
8
+ this.spriteUrl = document
9
+ .querySelector('meta[name="alchemy-icon-sprite"]')
10
+ .getAttribute("content")
11
+ }
12
+
13
+ connectedCallback() {
14
+ this.render()
15
+ }
16
+
17
+ attributeChangedCallback() {
18
+ this.render()
19
+ }
20
+
21
+ render() {
22
+ const sizeClass = this.size ? ` icon--${this.size}` : ""
23
+ this.innerHTML = `<svg class="icon${sizeClass}"><use href="${this.spriteUrl}#ri-${this.iconName}${this.style}" /></svg>`
24
+ }
25
+
26
+ set name(value) {
27
+ this.setAttribute("name", value)
28
+ }
29
+
30
+ get iconName() {
31
+ return this.getAttribute("name")
32
+ }
33
+
34
+ get size() {
35
+ return this.getAttribute("size")
36
+ }
37
+
38
+ get style() {
39
+ const value = this.getAttribute("icon-style")
40
+ switch (value) {
41
+ case "none":
42
+ return ""
43
+ case null:
44
+ return "-line"
45
+ default:
46
+ return `-${value}`
47
+ }
48
+ }
49
+ }
50
+
51
+ customElements.define("alchemy-icon", Icon)
@@ -0,0 +1,24 @@
1
+ import "alchemy_admin/components/attachment_select"
2
+ import "alchemy_admin/components/button"
3
+ import "alchemy_admin/components/char_counter"
4
+ import "alchemy_admin/components/clipboard_button"
5
+ import "alchemy_admin/components/datepicker"
6
+ import "alchemy_admin/components/dialog_link"
7
+ import "alchemy_admin/components/dom_id_select"
8
+ import "alchemy_admin/components/element_editor"
9
+ import "alchemy_admin/components/elements_window"
10
+ import "alchemy_admin/components/list_filter"
11
+ import "alchemy_admin/components/message"
12
+ import "alchemy_admin/components/growl"
13
+ import "alchemy_admin/components/icon"
14
+ import "alchemy_admin/components/ingredient_group"
15
+ import "alchemy_admin/components/link_buttons"
16
+ import "alchemy_admin/components/node_select"
17
+ import "alchemy_admin/components/uploader"
18
+ import "alchemy_admin/components/overlay"
19
+ import "alchemy_admin/components/page_select"
20
+ import "alchemy_admin/components/preview_window"
21
+ import "alchemy_admin/components/select"
22
+ import "alchemy_admin/components/spinner"
23
+ import "alchemy_admin/components/tags_autocomplete"
24
+ import "alchemy_admin/components/tinymce"
@@ -18,8 +18,10 @@ export class IngredientGroup extends HTMLDetailsElement {
18
18
  let expanded_ingredient_groups = this.localStorageItem
19
19
 
20
20
  if (this.open) {
21
+ this.toggleIcon.name = "arrow-down-s"
21
22
  if (!this.isInLocalStorage) expanded_ingredient_groups.push(this.id)
22
23
  } else {
24
+ this.toggleIcon.name = "arrow-left-s"
23
25
  expanded_ingredient_groups = expanded_ingredient_groups.filter(
24
26
  (value) => value !== this.id
25
27
  )
@@ -47,6 +49,10 @@ export class IngredientGroup extends HTMLDetailsElement {
47
49
  return []
48
50
  }
49
51
  }
52
+
53
+ get toggleIcon() {
54
+ return this.querySelector("alchemy-icon")
55
+ }
50
56
  }
51
57
 
52
58
  customElements.define("alchemy-ingredient-group", IngredientGroup, {
@@ -5,23 +5,33 @@ class LinkButton extends HTMLButtonElement {
5
5
  this.classList.add("icon_button")
6
6
  // Prevent accidental form submits if this component is wrapped inside a form
7
7
  this.setAttribute("type", "button")
8
- this.innerHTML = '<i class="icon ri-link-m ri-fw"></i>'
8
+ this.innerHTML = '<alchemy-icon name="link" icon-style="m"></alchemy-icon>'
9
9
  }
10
10
 
11
11
  handleEvent(event) {
12
- const dialog = new Alchemy.LinkDialog(this)
13
- dialog.open()
12
+ const dialog = new Alchemy.LinkDialog({
13
+ url: this.linkUrl,
14
+ title: this.linkTitle,
15
+ target: this.linkTarget,
16
+ type: this.linkClass
17
+ })
18
+ dialog.open().then((link) => this.setLink(link))
14
19
  event.preventDefault()
15
20
  }
16
21
 
17
- setLink(url, title, target, type) {
18
- this.classList.add("linked")
19
- this.dispatchEvent(
20
- new CustomEvent("alchemy:link", {
21
- bubbles: true,
22
- detail: { url, title, target, type }
23
- })
24
- )
22
+ setLink(link) {
23
+ if (link.url === "") {
24
+ this.classList.remove("linked")
25
+ this.dispatchEvent(new CustomEvent("alchemy:unlink", { bubbles: true }))
26
+ } else {
27
+ this.classList.add("linked")
28
+ this.dispatchEvent(
29
+ new CustomEvent("alchemy:link", {
30
+ bubbles: true,
31
+ detail: link
32
+ })
33
+ )
34
+ }
25
35
  }
26
36
 
27
37
  get linkUrl() {
@@ -6,7 +6,8 @@ class UnlinkButton extends HTMLButtonElement {
6
6
  // Prevent accidental form submits if this component is wrapped inside a form
7
7
  this.setAttribute("type", "button")
8
8
  this.linked = this.linked
9
- this.innerHTML = '<i class="icon ri-link-unlink-m ri-fw"></i>'
9
+ this.innerHTML =
10
+ '<alchemy-icon name="link-unlink" icon-style="m"></alchemy-icon>'
10
11
  }
11
12
 
12
13
  handleEvent(event) {
@@ -38,6 +38,7 @@ class LinkButtons extends HTMLElement {
38
38
  this.linkTargetField.value = ""
39
39
 
40
40
  this.linkButton.classList.remove("linked")
41
+ this.unlinkButton.linked = false
41
42
 
42
43
  this.elementEditor.setDirty()
43
44
  }
@@ -0,0 +1,68 @@
1
+ class ListFilter extends HTMLElement {
2
+ constructor() {
3
+ super()
4
+ this.#attachEvents()
5
+ }
6
+
7
+ #attachEvents() {
8
+ this.filterField.addEventListener("keyup", () => {
9
+ const term = this.filterField.value
10
+ this.clearButton.style.visibility = "visible"
11
+ this.filter(term)
12
+ })
13
+ this.clearButton.addEventListener("click", (e) => {
14
+ e.preventDefault()
15
+ this.clear()
16
+ })
17
+ this.filterField.addEventListener("focus", () =>
18
+ key.setScope("list_filter")
19
+ )
20
+ key("esc", "list_filter", () => {
21
+ this.clear()
22
+ this.filterField.blur()
23
+ })
24
+ }
25
+
26
+ filter(term) {
27
+ if (term === "") {
28
+ this.clearButton.style.visibility = "hidden"
29
+ }
30
+
31
+ this.items.forEach((item) => {
32
+ const name = item.getAttribute(this.nameAttribute)?.toLowerCase()
33
+ // indexOf is much faster then match()
34
+ if (name.indexOf(term.toLowerCase()) !== -1) {
35
+ item.classList.remove("hidden")
36
+ } else {
37
+ item.classList.add("hidden")
38
+ }
39
+ })
40
+ }
41
+
42
+ clear() {
43
+ this.filterField.value = ""
44
+ this.filter("")
45
+ }
46
+
47
+ get nameAttribute() {
48
+ return this.getAttribute("name-attribute") || "name"
49
+ }
50
+
51
+ get clearButton() {
52
+ return this.querySelector('button[type="button"]')
53
+ }
54
+
55
+ get filterField() {
56
+ return this.querySelector('input[type="text"]')
57
+ }
58
+
59
+ get items() {
60
+ return document.querySelectorAll(this.itemsSelector)
61
+ }
62
+
63
+ get itemsSelector() {
64
+ return this.getAttribute("items-selector")
65
+ }
66
+ }
67
+
68
+ customElements.define("alchemy-list-filter", ListFilter)
@@ -0,0 +1,69 @@
1
+ const DISMISS_DELAY = 5000
2
+
3
+ class Message extends HTMLElement {
4
+ #message
5
+
6
+ constructor() {
7
+ super()
8
+ this.#message = this.innerHTML
9
+ if (this.dismissable || this.type === "error") {
10
+ this.addEventListener("click", this)
11
+ }
12
+ }
13
+
14
+ handleEvent(event) {
15
+ if (event.type === "click") {
16
+ this.dismiss()
17
+ }
18
+ }
19
+
20
+ connectedCallback() {
21
+ this.innerHTML = `
22
+ <alchemy-icon name="${this.iconName}"></alchemy-icon>
23
+ ${this.dismissable && this.type === "error" ? '<alchemy-icon name="close"></alchemy-icon>' : ""}
24
+ ${this.#message}
25
+ `
26
+ if (this.dismissable && this.type !== "error") {
27
+ setTimeout(() => {
28
+ this.dismiss()
29
+ }, this.delay)
30
+ }
31
+ }
32
+
33
+ dismiss() {
34
+ this.addEventListener("transitionend", () => this.remove())
35
+ this.classList.add("dismissed")
36
+ }
37
+
38
+ get dismissable() {
39
+ return this.hasAttribute("dismissable")
40
+ }
41
+
42
+ get type() {
43
+ return this.getAttribute("type") || "notice"
44
+ }
45
+
46
+ get delay() {
47
+ return parseInt(this.getAttribute("delay") || DISMISS_DELAY)
48
+ }
49
+
50
+ get iconName() {
51
+ switch (this.type) {
52
+ case "warning":
53
+ case "warn":
54
+ case "alert":
55
+ return "alert"
56
+ case "notice":
57
+ return "check"
58
+ case "info":
59
+ case "hint":
60
+ return "information"
61
+ case "error":
62
+ return "bug"
63
+ default:
64
+ return this.type
65
+ }
66
+ }
67
+ }
68
+
69
+ customElements.define("alchemy-message", Message)
@@ -25,7 +25,7 @@ class NodeSelect extends RemoteSelect {
25
25
  const ancestors = node.ancestors.map((a) => a.name)
26
26
  return `
27
27
  <div class="node-select--node">
28
- <i class="icon ri-menu-2-line"></i>
28
+ <alchemy-icon name="menu-2"></alchemy-icon>
29
29
  <div class="node-select--node-display_name">
30
30
  <span class="node-select--node-ancestors">
31
31
  ${ancestors.join(" /&nbsp;")}
@@ -3,15 +3,15 @@ import { AlchemyHTMLElement } from "alchemy_admin/components/alchemy_html_elemen
3
3
  class Overlay extends AlchemyHTMLElement {
4
4
  render() {
5
5
  return `
6
- <alchemy-spinner></alchemy-spinner>
7
- <div id="overlay_text_box">
8
- <span id="overlay_text">${this.getAttribute("text")}</span>
9
- </div>
10
- `
6
+ <alchemy-spinner></alchemy-spinner>
7
+ <div id="overlay_text_box">
8
+ <span id="overlay_text">${this.getAttribute("text")}</span>
9
+ </div>
10
+ `
11
11
  }
12
12
 
13
13
  set show(value) {
14
- this.style.setProperty("display", value ? "block" : "none")
14
+ this.classList.toggle("visible", value)
15
15
  }
16
16
  }
17
17
 
@@ -1,12 +1,8 @@
1
1
  import { RemoteSelect } from "alchemy_admin/components/remote_select"
2
2
 
3
3
  class PageSelect extends RemoteSelect {
4
- onChange(event) {
5
- if (event.added) {
6
- this.dispatchCustomEvent("PageSelect.ItemAdded", event.added)
7
- } else {
8
- this.dispatchCustomEvent("PageSelect.ItemRemoved")
9
- }
4
+ get pageId() {
5
+ return this.selection ? JSON.parse(this.selection)["id"] : undefined
10
6
  }
11
7
 
12
8
  _searchQuery(term, page) {
@@ -47,7 +43,7 @@ class PageSelect extends RemoteSelect {
47
43
  return `
48
44
  <div class="page-select--page">
49
45
  <div class="page-select--top">
50
- <i class="icon ri-file-3-line"></i>
46
+ <alchemy-icon name="file-3"></alchemy-icon>
51
47
  <span class="page-select--page-name">${page.name}</span>
52
48
  <span class="page-select--page-urlname">${page.url_path}</span>
53
49
  </div>
@@ -0,0 +1,121 @@
1
+ const MIN_WIDTH = 240
2
+
3
+ class PreviewWindow extends HTMLIFrameElement {
4
+ #afterLoad
5
+ #reloadIcon
6
+
7
+ constructor() {
8
+ super()
9
+ this.addEventListener("load", this)
10
+ }
11
+
12
+ handleEvent(evt) {
13
+ if (evt.type === "load") {
14
+ this.#stopSpinner()
15
+ this.#afterLoad?.call(this, evt)
16
+ }
17
+ }
18
+
19
+ connectedCallback() {
20
+ let url = this.url
21
+
22
+ this.#attachEvents()
23
+
24
+ if (window.localStorage.getItem("alchemy-preview-url")) {
25
+ url = window.localStorage.getItem("alchemy-preview-url")
26
+ this.previewUrlSelect.value = url
27
+ }
28
+
29
+ this.refresh(url)
30
+ }
31
+
32
+ disconnectedCallback() {
33
+ key.unbind("alt+r")
34
+ }
35
+
36
+ postMessage(data) {
37
+ this.contentWindow.postMessage(data, "*")
38
+ }
39
+
40
+ resize(width) {
41
+ if (width < MIN_WIDTH) {
42
+ width = MIN_WIDTH
43
+ }
44
+ this.style.width = `${width}px`
45
+ }
46
+
47
+ refresh(url) {
48
+ this.#startSpinner()
49
+
50
+ if (url) {
51
+ this.src = url
52
+ } else {
53
+ this.src = this.url
54
+ }
55
+
56
+ return new Promise((resolve) => {
57
+ this.#afterLoad = resolve
58
+ })
59
+ }
60
+
61
+ #attachEvents() {
62
+ this.reloadButton?.addEventListener("click", (evt) => {
63
+ evt.preventDefault()
64
+ this.refresh()
65
+ })
66
+
67
+ key("alt+r", () => this.refresh())
68
+
69
+ // Need to listen with jQuery here because select2 does not emit native events.
70
+ $(this.sizeSelect).on("change", (evt) => {
71
+ const select = evt.target
72
+ const width = select.value
73
+
74
+ if (width === "auto") {
75
+ this.style.width = null
76
+ } else {
77
+ this.resize(width)
78
+ }
79
+ })
80
+
81
+ this.previewUrlSelect?.addEventListener("change", (evt) => {
82
+ const url = evt.target.value
83
+ window.localStorage.setItem("alchemy-preview-url", url)
84
+ this.refresh(url)
85
+ })
86
+ }
87
+
88
+ #startSpinner() {
89
+ this.#reloadIcon = this.reloadButton.innerHTML
90
+ this.reloadButton.innerHTML = `<alchemy-spinner size="small"></alchemy-spinner>`
91
+ }
92
+
93
+ #stopSpinner() {
94
+ this.reloadButton.innerHTML = this.#reloadIcon
95
+ }
96
+
97
+ get url() {
98
+ return this.getAttribute("url")
99
+ }
100
+
101
+ get sizeSelect() {
102
+ return document.querySelector("select#preview_size")
103
+ }
104
+
105
+ get previewUrlSelect() {
106
+ return document.querySelector("select#preview_url")
107
+ }
108
+
109
+ get reloadButton() {
110
+ return document.querySelector("#reload_preview_button")
111
+ }
112
+ }
113
+
114
+ customElements.define("alchemy-preview-window", PreviewWindow, {
115
+ extends: "iframe"
116
+ })
117
+
118
+ export function reloadPreview() {
119
+ const previewWindow = document.getElementById("alchemy_preview_window")
120
+ previewWindow.refresh()
121
+ }
@@ -27,7 +27,10 @@ export class RemoteSelect extends AlchemyHTMLElement {
27
27
  * @param {Event} event
28
28
  */
29
29
  onChange(event) {
30
- // Left empty for sub classes to define this as needed.
30
+ this.dispatchCustomEvent("RemoteSelect.Change", {
31
+ removed: event.removed,
32
+ added: event.added
33
+ })
31
34
  }
32
35
 
33
36
  /**
@@ -1,12 +1,48 @@
1
1
  class Select extends HTMLSelectElement {
2
+ #select2Element
3
+
2
4
  connectedCallback() {
3
5
  this.classList.add("alchemy_selectbox")
4
6
 
5
- $(this).select2({
7
+ this.#select2Element = $(this).select2({
6
8
  minimumResultsForSearch: 5,
7
9
  dropdownAutoWidth: true
8
10
  })
9
11
  }
12
+
13
+ enable() {
14
+ this.removeAttribute("disabled")
15
+ this.#updateSelect2()
16
+ }
17
+
18
+ disable() {
19
+ this.setAttribute("disabled", "disabled")
20
+ this.#updateSelect2()
21
+ }
22
+
23
+ setOptions(data, prompt = undefined) {
24
+ let selectedValue = this.value
25
+
26
+ // reset the old options and insert the placeholder(s) first
27
+ this.innerHTML = ""
28
+ if (prompt) {
29
+ this.add(new Option(prompt, ""))
30
+ }
31
+
32
+ // add the new options to the select
33
+ data.forEach((item) => {
34
+ this.add(new Option(item.text, item.id, false, item.id === selectedValue))
35
+ })
36
+
37
+ this.#updateSelect2()
38
+ }
39
+
40
+ /**
41
+ * inform Select2 to update
42
+ */
43
+ #updateSelect2() {
44
+ this.#select2Element.trigger("change")
45
+ }
10
46
  }
11
47
 
12
48
  customElements.define("alchemy-select", Select, { extends: "select" })