alchemy_cms 7.4.10 → 8.0.0.b

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.

Potentially problematic release.


This version of alchemy_cms might be problematic. Click here for more details.

Files changed (425) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -5
  3. data/app/assets/builds/alchemy/admin/page-select.css +1 -1
  4. data/app/assets/builds/alchemy/admin/print.css +1 -1
  5. data/app/assets/builds/alchemy/admin.css +2 -2
  6. data/app/assets/builds/alchemy/dark-theme.css +1 -0
  7. data/app/assets/builds/alchemy/light-theme.css +1 -0
  8. data/app/assets/builds/alchemy/theme.css +1 -0
  9. data/app/assets/builds/alchemy/welcome.css +1 -1
  10. data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css +1 -1
  11. data/app/assets/builds/tinymce/skins/content/alchemy-dark/content.min.css +1 -0
  12. data/app/assets/builds/tinymce/skins/ui/alchemy/content.min.css +1 -0
  13. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css +1 -1
  14. data/app/assets/builds/tinymce/skins/ui/alchemy-dark/content.min.css +1 -0
  15. data/app/assets/builds/tinymce/skins/ui/alchemy-dark/skin.min.css +1 -0
  16. data/app/assets/config/alchemy_manifest.js +0 -2
  17. data/app/assets/images/alchemy/element_icons/default.svg +1 -0
  18. data/app/assets/images/alchemy/icons-sprite.svg +1 -0
  19. data/app/components/alchemy/admin/element_select.rb +39 -0
  20. data/app/components/alchemy/admin/resource/applied_filter.rb +29 -0
  21. data/app/components/alchemy/admin/resource/checkbox_filter.rb +36 -0
  22. data/app/components/alchemy/admin/resource/datepicker_filter.rb +42 -0
  23. data/app/components/alchemy/admin/resource/select_filter.rb +43 -0
  24. data/app/components/alchemy/admin/toolbar_button.rb +5 -2
  25. data/app/components/alchemy/ingredients/number_view.rb +18 -0
  26. data/app/controllers/alchemy/admin/attachments_controller.rb +10 -15
  27. data/app/controllers/alchemy/admin/clipboard_controller.rb +2 -6
  28. data/app/controllers/alchemy/admin/elements_controller.rb +3 -1
  29. data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
  30. data/app/controllers/alchemy/admin/pages_controller.rb +15 -15
  31. data/app/controllers/alchemy/admin/pictures_controller.rb +27 -37
  32. data/app/controllers/alchemy/admin/resources_controller.rb +16 -106
  33. data/app/controllers/alchemy/attachments_controller.rb +43 -14
  34. data/app/controllers/alchemy/messages_controller.rb +1 -1
  35. data/app/controllers/alchemy/pages_controller.rb +26 -4
  36. data/app/controllers/concerns/alchemy/admin/resource_filter.rb +93 -0
  37. data/app/decorators/alchemy/element_editor.rb +5 -48
  38. data/app/decorators/alchemy/ingredient_editor.rb +3 -53
  39. data/app/helpers/alchemy/admin/attachments_helper.rb +5 -5
  40. data/app/helpers/alchemy/admin/base_helper.rb +14 -84
  41. data/app/helpers/alchemy/admin/pages_helper.rb +1 -1
  42. data/app/helpers/alchemy/base_helper.rb +0 -30
  43. data/app/helpers/alchemy/elements_block_helper.rb +0 -14
  44. data/app/helpers/alchemy/pages_helper.rb +1 -1
  45. data/{lib → app/helpers}/alchemy/resources_helper.rb +5 -45
  46. data/app/javascript/alchemy_admin/components/action.js +2 -0
  47. data/app/javascript/alchemy_admin/components/alchemy_html_element.js +3 -3
  48. data/app/javascript/alchemy_admin/components/auto_submit.js +20 -0
  49. data/app/javascript/alchemy_admin/components/datepicker.js +18 -7
  50. data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +8 -7
  51. data/app/javascript/alchemy_admin/components/element_editor.js +25 -15
  52. data/app/javascript/alchemy_admin/components/element_select.js +43 -0
  53. data/app/javascript/alchemy_admin/components/index.js +3 -0
  54. data/app/javascript/alchemy_admin/components/link_buttons.js +6 -2
  55. data/app/javascript/alchemy_admin/components/remote_select.js +9 -2
  56. data/app/javascript/alchemy_admin/components/tags_autocomplete.js +5 -1
  57. data/app/javascript/alchemy_admin/components/tinymce.js +93 -14
  58. data/app/javascript/alchemy_admin/components/update_check.js +42 -0
  59. data/app/javascript/alchemy_admin/components/uploader/file_upload.js +15 -8
  60. data/app/javascript/alchemy_admin/components/uploader/progress.js +12 -6
  61. data/app/javascript/alchemy_admin/components/uploader.js +4 -2
  62. data/app/javascript/alchemy_admin/confirm_dialog.js +27 -57
  63. data/app/javascript/alchemy_admin/dialog.js +1 -1
  64. data/app/javascript/alchemy_admin/dirty.js +3 -2
  65. data/app/javascript/alchemy_admin/file_editors.js +1 -1
  66. data/app/javascript/alchemy_admin/i18n.js +15 -16
  67. data/app/javascript/alchemy_admin/image_loader.js +4 -2
  68. data/app/javascript/alchemy_admin/initializer.js +1 -49
  69. data/app/javascript/alchemy_admin/picture_editors.js +7 -4
  70. data/app/javascript/alchemy_admin/picture_selector.js +4 -4
  71. data/app/javascript/alchemy_admin/utils/ajax.js +51 -44
  72. data/app/javascript/alchemy_admin.js +3 -8
  73. data/app/jobs/alchemy/delete_picture_job.rb +12 -0
  74. data/app/models/alchemy/admin/filters/base.rb +38 -0
  75. data/app/models/alchemy/admin/filters/checkbox.rb +24 -0
  76. data/app/models/alchemy/admin/filters/datepicker.rb +53 -0
  77. data/app/models/alchemy/admin/filters/select.rb +70 -0
  78. data/app/models/alchemy/admin/resource_name.rb +27 -0
  79. data/app/models/alchemy/attachment.rb +49 -44
  80. data/app/models/alchemy/base_record.rb +2 -0
  81. data/app/models/alchemy/element/definitions.rb +1 -1
  82. data/app/models/alchemy/element/element_ingredients.rb +6 -6
  83. data/app/models/alchemy/element/presenters.rb +3 -12
  84. data/app/models/alchemy/element.rb +10 -27
  85. data/app/models/alchemy/element_definition.rb +190 -0
  86. data/app/models/alchemy/ingredient.rb +10 -43
  87. data/app/models/alchemy/ingredient_definition.rb +134 -0
  88. data/app/models/alchemy/ingredient_validator.rb +7 -3
  89. data/app/models/alchemy/ingredients/number.rb +19 -0
  90. data/app/models/alchemy/language.rb +2 -21
  91. data/app/models/alchemy/message.rb +3 -7
  92. data/app/models/alchemy/node.rb +1 -1
  93. data/app/models/alchemy/page/{page_layouts.rb → definitions.rb} +12 -19
  94. data/app/models/alchemy/page/fixed_attributes.rb +1 -1
  95. data/app/models/alchemy/page/page_elements.rb +13 -14
  96. data/app/models/alchemy/page/page_naming.rb +3 -11
  97. data/app/models/alchemy/page/page_natures.rb +20 -15
  98. data/app/models/alchemy/page/page_scopes.rb +1 -1
  99. data/app/models/alchemy/page.rb +12 -39
  100. data/app/models/alchemy/page_definition.rb +115 -0
  101. data/app/models/alchemy/picture.rb +71 -99
  102. data/app/models/alchemy/picture_variant.rb +115 -5
  103. data/{lib → app/models}/alchemy/resource.rb +4 -18
  104. data/{lib → app/models}/alchemy/searchable_resource.rb +15 -0
  105. data/app/models/alchemy/site/layout.rb +5 -5
  106. data/app/models/alchemy/site.rb +1 -21
  107. data/app/models/alchemy/storage_adapter/active_storage/attachment_url.rb +41 -0
  108. data/app/models/alchemy/storage_adapter/active_storage/picture_url.rb +55 -0
  109. data/app/models/alchemy/storage_adapter/active_storage/preprocessor.rb +40 -0
  110. data/app/models/alchemy/storage_adapter/active_storage.rb +173 -0
  111. data/app/models/alchemy/{attachment/url.rb → storage_adapter/dragonfly/attachment_url.rb} +12 -12
  112. data/app/models/alchemy/storage_adapter/dragonfly/picture_url.rb +75 -0
  113. data/app/models/alchemy/{picture → storage_adapter/dragonfly}/preprocessor.rb +4 -4
  114. data/app/models/alchemy/storage_adapter/dragonfly.rb +205 -0
  115. data/app/models/alchemy/storage_adapter.rb +74 -0
  116. data/app/models/concerns/alchemy/picture_thumbnails.rb +19 -6
  117. data/app/models/concerns/alchemy/relatable_resource.rb +28 -0
  118. data/app/serializers/alchemy/element_serializer.rb +0 -1
  119. data/app/services/alchemy/dragonfly_to_image_processing.rb +100 -0
  120. data/app/stylesheets/alchemy/_custom-properties.scss +162 -0
  121. data/app/stylesheets/alchemy/_defaults.scss +3 -0
  122. data/app/stylesheets/alchemy/_extends.scss +69 -0
  123. data/app/{assets/stylesheets → stylesheets}/alchemy/_mixins.scss +40 -68
  124. data/app/stylesheets/alchemy/_themes.scss +540 -0
  125. data/app/stylesheets/alchemy/_variables.scss +5 -0
  126. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/archive.scss +45 -42
  127. data/app/stylesheets/alchemy/admin/attachments.scss +17 -0
  128. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/base.scss +20 -15
  129. data/app/stylesheets/alchemy/admin/buttons.scss +135 -0
  130. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/clipboard.scss +2 -2
  131. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/dashboard.scss +13 -16
  132. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/dialogs.scss +33 -16
  133. data/app/stylesheets/alchemy/admin/element-select.scss +11 -0
  134. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/elements.scss +239 -133
  135. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/errors.scss +5 -5
  136. data/app/stylesheets/alchemy/admin/filters.scss +57 -0
  137. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/flatpickr.scss +54 -76
  138. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/form_fields.scss +10 -11
  139. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/forms.scss +28 -21
  140. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/frame.scss +20 -18
  141. data/app/stylesheets/alchemy/admin/hints.scss +5 -0
  142. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/icons.scss +1 -1
  143. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/image_library.scss +21 -61
  144. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/images.scss +1 -1
  145. data/app/stylesheets/alchemy/admin/labels.scss +5 -0
  146. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/lists.scss +3 -3
  147. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/navigation.scss +55 -59
  148. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/node-select.scss +1 -10
  149. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/nodes.scss +21 -18
  150. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/notices.scss +20 -19
  151. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/page-select.scss +18 -2
  152. data/app/stylesheets/alchemy/admin/pagination.scss +137 -0
  153. data/app/stylesheets/alchemy/admin/preview_window.scss +46 -0
  154. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/print.scss +1 -1
  155. data/app/stylesheets/alchemy/admin/resource_info.scss +148 -0
  156. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/search.scss +10 -7
  157. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/selects.scss +85 -46
  158. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/shoelace.scss +37 -68
  159. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/sitemap.scss +39 -34
  160. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/tables.scss +9 -7
  161. data/app/stylesheets/alchemy/admin/tags.scss +143 -0
  162. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/toolbar.scss +6 -6
  163. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/typography.scss +3 -6
  164. data/app/{assets/stylesheets → stylesheets}/alchemy/admin/upload.scss +7 -5
  165. data/app/stylesheets/alchemy/admin.scss +44 -0
  166. data/app/stylesheets/alchemy/dark-theme.scss +5 -0
  167. data/app/stylesheets/alchemy/light-theme.scss +6 -0
  168. data/app/stylesheets/alchemy/theme.scss +13 -0
  169. data/app/stylesheets/alchemy/welcome.scss +75 -0
  170. data/app/stylesheets/tinymce/skins/content/alchemy/content.scss +69 -0
  171. data/app/{assets/stylesheets/tinymce/skins/content/alchemy → stylesheets/tinymce/skins/content/alchemy-dark}/content.scss +12 -12
  172. data/app/stylesheets/tinymce/skins/ui/alchemy/content.scss +1 -0
  173. data/app/{assets/stylesheets → stylesheets}/tinymce/skins/ui/alchemy/skin.scss +158 -176
  174. data/app/stylesheets/tinymce/skins/ui/alchemy-dark/content.scss +1 -0
  175. data/app/stylesheets/tinymce/skins/ui/alchemy-dark/skin.scss +3784 -0
  176. data/app/views/alchemy/admin/attachments/_files_list.html.erb +22 -12
  177. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +1 -1
  178. data/app/views/alchemy/admin/attachments/assign.js.erb +4 -3
  179. data/app/views/alchemy/admin/attachments/show.html.erb +55 -43
  180. data/app/views/alchemy/admin/{elements/_clipboard_button.html.erb → clipboard/_button.html.erb} +3 -5
  181. data/app/views/alchemy/admin/clipboard/_update_nested_element_button.turbo_stream.erb +11 -0
  182. data/app/views/alchemy/admin/clipboard/clear.turbo_stream.erb +4 -0
  183. data/app/views/alchemy/admin/clipboard/index.html.erb +15 -13
  184. data/app/views/alchemy/admin/clipboard/insert.turbo_stream.erb +18 -0
  185. data/app/views/alchemy/admin/clipboard/remove.turbo_stream.erb +9 -0
  186. data/app/views/alchemy/admin/crop.html.erb +1 -1
  187. data/app/views/alchemy/admin/dashboard/info.html.erb +17 -31
  188. data/app/views/alchemy/admin/elements/_element.html.erb +4 -8
  189. data/app/views/alchemy/admin/elements/_form.html.erb +9 -9
  190. data/app/views/alchemy/admin/elements/_header.html.erb +5 -1
  191. data/app/views/alchemy/admin/elements/_toolbar.html.erb +4 -6
  192. data/app/views/alchemy/admin/elements/create.turbo_stream.erb +2 -1
  193. data/app/views/alchemy/admin/elements/index.html.erb +2 -2
  194. data/app/views/alchemy/admin/ingredients/_file_fields.html.erb +3 -16
  195. data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +0 -9
  196. data/app/views/alchemy/admin/languages/_form.html.erb +1 -1
  197. data/app/views/alchemy/admin/languages/_table.html.erb +1 -1
  198. data/app/views/alchemy/admin/languages/index.html.erb +5 -2
  199. data/app/views/alchemy/admin/layoutpages/index.html.erb +1 -12
  200. data/app/views/alchemy/admin/pages/_form.html.erb +2 -2
  201. data/app/views/alchemy/admin/pages/_page.html.erb +2 -3
  202. data/app/views/alchemy/admin/pages/_toolbar.html.erb +1 -15
  203. data/app/views/alchemy/admin/pages/index.html.erb +1 -1
  204. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +9 -12
  205. data/app/views/alchemy/admin/partials/_search_form.html.erb +4 -9
  206. data/app/views/alchemy/admin/pictures/_archive.html.erb +16 -29
  207. data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +3 -7
  208. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +1 -1
  209. data/app/views/alchemy/admin/pictures/_form.html.erb +1 -1
  210. data/app/views/alchemy/admin/pictures/_infos.html.erb +21 -52
  211. data/app/views/alchemy/admin/pictures/_library_sidebar.html.erb +7 -0
  212. data/app/views/alchemy/admin/pictures/_picture.html.erb +14 -20
  213. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +20 -16
  214. data/app/views/alchemy/admin/pictures/_sorting_select.html.erb +13 -0
  215. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +1 -1
  216. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +1 -6
  217. data/app/views/alchemy/admin/pictures/index.html.erb +5 -19
  218. data/app/views/alchemy/admin/pictures/show.html.erb +10 -5
  219. data/app/views/alchemy/admin/resources/_applied_filters.html.erb +8 -0
  220. data/app/views/alchemy/admin/resources/_filter_bar.html.erb +5 -25
  221. data/app/views/alchemy/admin/resources/_pagination.html.erb +6 -0
  222. data/app/views/alchemy/admin/resources/_per_page_select.html.erb +4 -2
  223. data/app/views/alchemy/admin/resources/_resource_table.html.erb +1 -1
  224. data/app/views/alchemy/admin/resources/_resource_usage_info.html.erb +36 -0
  225. data/app/views/alchemy/admin/resources/_table_header.html.erb +1 -15
  226. data/app/views/alchemy/admin/sites/index.html.erb +5 -1
  227. data/app/views/alchemy/admin/styleguide/index.html.erb +118 -58
  228. data/app/views/alchemy/admin/tags/index.html.erb +1 -1
  229. data/app/views/alchemy/admin/tinymce/_setup.html.erb +7 -7
  230. data/app/{javascript/alchemy_admin/locales/en.js → views/alchemy/admin/translations/_en.js} +5 -2
  231. data/app/views/alchemy/admin/uploader/_button.html.erb +1 -1
  232. data/app/views/alchemy/admin/uploader/_setup.html.erb +4 -4
  233. data/app/views/alchemy/base/error_notice.html.erb +1 -1
  234. data/app/views/alchemy/ingredients/_number_editor.html.erb +24 -0
  235. data/app/views/alchemy/no_index.html.erb +31 -0
  236. data/app/views/alchemy/welcome.html.erb +12 -10
  237. data/app/views/kaminari/alchemy/_first_page.html.erb +5 -3
  238. data/app/views/kaminari/alchemy/_last_page.html.erb +5 -3
  239. data/app/views/kaminari/alchemy/_next_page.html.erb +5 -3
  240. data/app/views/kaminari/alchemy/_paginator.html.erb +18 -13
  241. data/app/views/kaminari/alchemy/_prev_page.html.erb +5 -3
  242. data/app/views/layouts/alchemy/admin.html.erb +25 -24
  243. data/config/alchemy/config.yml +3 -2
  244. data/config/initializers/dragonfly.rb +0 -1
  245. data/config/initializers/mime_types.rb +1 -0
  246. data/config/locales/alchemy.en.yml +57 -21
  247. data/config/routes.rb +0 -2
  248. data/db/migrate/20250905140323_add_created_at_index_to_pictures_and_attachments.rb +14 -0
  249. data/lib/alchemy/admin/preview_url.rb +4 -5
  250. data/lib/alchemy/cache_digests/template_tracker.rb +6 -9
  251. data/lib/alchemy/config_missing.rb +14 -0
  252. data/lib/alchemy/configuration/base_option.rb +24 -0
  253. data/lib/alchemy/configuration/boolean_option.rb +16 -0
  254. data/lib/alchemy/configuration/class_option.rb +15 -0
  255. data/lib/alchemy/configuration/class_set_option.rb +46 -0
  256. data/lib/alchemy/configuration/integer_list_option.rb +13 -0
  257. data/lib/alchemy/configuration/integer_option.rb +12 -0
  258. data/lib/alchemy/configuration/list_option.rb +22 -0
  259. data/lib/alchemy/configuration/regexp_option.rb +11 -0
  260. data/lib/alchemy/configuration/string_list_option.rb +13 -0
  261. data/lib/alchemy/configuration/string_option.rb +11 -0
  262. data/lib/alchemy/configuration.rb +115 -0
  263. data/lib/alchemy/configuration_methods.rb +3 -1
  264. data/lib/alchemy/configurations/default_language.rb +12 -0
  265. data/lib/alchemy/configurations/default_site.rb +10 -0
  266. data/lib/alchemy/configurations/format_matchers.rb +11 -0
  267. data/lib/alchemy/configurations/mailer.rb +16 -0
  268. data/lib/alchemy/configurations/main.rb +223 -0
  269. data/lib/alchemy/configurations/page_cache.rb +19 -0
  270. data/lib/alchemy/configurations/preview.rb +32 -0
  271. data/lib/alchemy/configurations/sitemap.rb +10 -0
  272. data/lib/alchemy/configurations/uploader.rb +34 -0
  273. data/lib/alchemy/engine.rb +81 -24
  274. data/lib/alchemy/hints.rb +3 -7
  275. data/lib/alchemy/install/tasks.rb +0 -12
  276. data/lib/alchemy/on_page_layout.rb +2 -2
  277. data/lib/alchemy/propshaft/tinymce_asset.rb +15 -0
  278. data/lib/alchemy/seeder.rb +2 -2
  279. data/lib/alchemy/tasks/tidy.rb +18 -0
  280. data/lib/alchemy/tasks/usage.rb +4 -4
  281. data/lib/alchemy/test_support/config_stubbing.rb +1 -7
  282. data/lib/alchemy/test_support/factories/attachment_factory.rb +13 -2
  283. data/lib/alchemy/test_support/factories/language_factory.rb +1 -1
  284. data/lib/alchemy/test_support/factories/page_factory.rb +2 -3
  285. data/lib/alchemy/test_support/factories/picture_factory.rb +31 -2
  286. data/lib/alchemy/test_support/factories/site_factory.rb +2 -2
  287. data/lib/alchemy/test_support/having_crop_action_examples.rb +2 -2
  288. data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +80 -26
  289. data/lib/alchemy/test_support/relatable_resource_examples.rb +58 -0
  290. data/lib/alchemy/test_support/shared_ingredient_examples.rb +5 -5
  291. data/lib/alchemy/tinymce.rb +0 -1
  292. data/lib/alchemy/upgrader/eight_zero.rb +14 -0
  293. data/lib/alchemy/upgrader.rb +33 -20
  294. data/lib/alchemy/version.rb +1 -1
  295. data/lib/alchemy.rb +185 -172
  296. data/lib/alchemy_cms.rb +1 -7
  297. data/lib/generators/alchemy/ingredient/ingredient_generator.rb +0 -3
  298. data/lib/generators/alchemy/install/files/_article.html.erb +6 -4
  299. data/lib/generators/alchemy/install/files/alchemy.en.yml +22 -3
  300. data/lib/generators/alchemy/install/files/application.html.erb +5 -0
  301. data/lib/generators/alchemy/install/install_generator.rb +25 -23
  302. data/lib/generators/alchemy/install/templates/alchemy.rb.tt +200 -0
  303. data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +0 -1
  304. data/lib/generators/alchemy/install/templates/elements.yml.tt +3 -1
  305. data/lib/generators/alchemy/install/templates/menus.yml.tt +1 -1
  306. data/lib/generators/alchemy/install/templates/page_layouts.yml.tt +2 -2
  307. data/lib/generators/alchemy/page_layouts/page_layouts_generator.rb +2 -2
  308. data/lib/tasks/alchemy/assets.rake +14 -0
  309. data/lib/tasks/alchemy/tidy.rake +6 -0
  310. data/lib/tasks/alchemy/upgrade.rake +12 -47
  311. data/vendor/assets/stylesheets/tinymce/skins/content/dark/content.min.css +1 -0
  312. data/vendor/assets/stylesheets/tinymce/skins/content/default/content.min.css +1 -0
  313. data/vendor/assets/stylesheets/tinymce/skins/ui/oxide/skin.min.css +1 -0
  314. data/vendor/assets/stylesheets/tinymce/skins/ui/oxide-dark/content.min.css +1 -0
  315. data/vendor/assets/stylesheets/tinymce/skins/ui/oxide-dark/skin.min.css +1 -0
  316. data/vendor/javascript/clipboard.min.js +1 -1
  317. data/vendor/javascript/cropperjs.min.js +1 -1
  318. data/vendor/javascript/handlebars.min.js +3 -3
  319. data/vendor/javascript/jquery.min.js +1 -1
  320. data/vendor/javascript/select2.min.js +3 -3
  321. data/vendor/javascript/shoelace.min.js +92 -76
  322. data/vendor/javascript/sortable.min.js +2 -2
  323. data/vendor/javascript/tinymce.min.js +1 -1
  324. data/vendor/javascript/ungap-custom-elements.min.js +2 -2
  325. metadata +223 -208
  326. data/CHANGELOG.md +0 -2041
  327. data/CODE_OF_CONDUCT.md +0 -13
  328. data/CONTRIBUTING.md +0 -73
  329. data/Gemfile +0 -71
  330. data/Rakefile +0 -102
  331. data/SECURITY.md +0 -13
  332. data/alchemy_cms.gemspec +0 -88
  333. data/app/assets/builds/alchemy/admin/page-select.css.map +0 -1
  334. data/app/assets/builds/alchemy/admin/print.css.map +0 -1
  335. data/app/assets/builds/alchemy/admin.css.map +0 -1
  336. data/app/assets/builds/alchemy/custom-properties.css +0 -1
  337. data/app/assets/builds/alchemy/custom-properties.css.map +0 -1
  338. data/app/assets/builds/alchemy/welcome.css.map +0 -1
  339. data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css.map +0 -1
  340. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css.map +0 -1
  341. data/app/assets/javascripts/alchemy/admin.js +0 -10
  342. data/app/assets/stylesheets/alchemy/_defaults.scss +0 -3
  343. data/app/assets/stylesheets/alchemy/_deprecated_variables.scss +0 -45
  344. data/app/assets/stylesheets/alchemy/_deprecation.scss +0 -17
  345. data/app/assets/stylesheets/alchemy/_extends.scss +0 -62
  346. data/app/assets/stylesheets/alchemy/_variables.scss +0 -201
  347. data/app/assets/stylesheets/alchemy/admin/attachments.scss +0 -40
  348. data/app/assets/stylesheets/alchemy/admin/buttons.scss +0 -123
  349. data/app/assets/stylesheets/alchemy/admin/hints.scss +0 -5
  350. data/app/assets/stylesheets/alchemy/admin/labels.scss +0 -3
  351. data/app/assets/stylesheets/alchemy/admin/pagination.scss +0 -92
  352. data/app/assets/stylesheets/alchemy/admin/preview_window.scss +0 -33
  353. data/app/assets/stylesheets/alchemy/admin/resource_info.scss +0 -42
  354. data/app/assets/stylesheets/alchemy/admin/tags.scss +0 -158
  355. data/app/assets/stylesheets/alchemy/admin.scss +0 -42
  356. data/app/assets/stylesheets/alchemy/custom-properties.css +0 -98
  357. data/app/assets/stylesheets/alchemy/welcome.scss +0 -57
  358. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.css +0 -711
  359. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.css +0 -705
  360. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.min.css +0 -7
  361. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.min.css +0 -7
  362. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.css +0 -29
  363. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.min.css +0 -7
  364. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.css +0 -677
  365. data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.min.css +0 -7
  366. data/app/controllers/alchemy/elements_controller.rb +0 -32
  367. data/app/helpers/alchemy/admin/elements_helper.rb +0 -25
  368. data/app/models/alchemy/element/dom_id.rb +0 -31
  369. data/app/models/alchemy/picture/calculations.rb +0 -49
  370. data/app/models/alchemy/picture/transformations.rb +0 -115
  371. data/app/models/alchemy/picture/url.rb +0 -54
  372. data/app/views/alchemy/admin/attachments/destroy.js.erb +0 -1
  373. data/app/views/alchemy/admin/clipboard/clear.js.erb +0 -3
  374. data/app/views/alchemy/admin/clipboard/insert.js.erb +0 -29
  375. data/app/views/alchemy/admin/clipboard/remove.js.erb +0 -10
  376. data/app/views/alchemy/admin/resources/_filter.html.erb +0 -12
  377. data/app/views/alchemy/admin/resources/_resource.html.erb +0 -34
  378. data/app/views/alchemy/admin/resources/_table.html.erb +0 -29
  379. data/app/views/alchemy/elements/show.html.erb +0 -1
  380. data/app/views/alchemy/elements/show.js.erb +0 -1
  381. data/app/views/alchemy/ingredients/_audio_view.html.erb +0 -1
  382. data/app/views/alchemy/ingredients/_boolean_view.html.erb +0 -1
  383. data/app/views/alchemy/ingredients/_datetime_view.html.erb +0 -3
  384. data/app/views/alchemy/ingredients/_file_view.html.erb +0 -4
  385. data/app/views/alchemy/ingredients/_headline_view.html.erb +0 -4
  386. data/app/views/alchemy/ingredients/_html_view.html.erb +0 -1
  387. data/app/views/alchemy/ingredients/_link_view.html.erb +0 -4
  388. data/app/views/alchemy/ingredients/_node_view.html.erb +0 -1
  389. data/app/views/alchemy/ingredients/_page_view.html.erb +0 -1
  390. data/app/views/alchemy/ingredients/_picture_view.html.erb +0 -4
  391. data/app/views/alchemy/ingredients/_richtext_view.html.erb +0 -3
  392. data/app/views/alchemy/ingredients/_select_view.html.erb +0 -1
  393. data/app/views/alchemy/ingredients/_text_view.html.erb +0 -4
  394. data/app/views/alchemy/ingredients/_video_view.html.erb +0 -3
  395. data/babel.config.js +0 -12
  396. data/bin/importmap +0 -4
  397. data/bin/rails +0 -9
  398. data/bin/rspec +0 -3
  399. data/bin/setup +0 -30
  400. data/bin/start +0 -17
  401. data/bun.lockb +0 -0
  402. data/bundles/shoelace.js +0 -12
  403. data/bundles/tinymce.js +0 -22
  404. data/config/initializers/assets.rb +0 -4
  405. data/eslint.config.js +0 -17
  406. data/lib/alchemy/config.rb +0 -114
  407. data/lib/alchemy/element_definition.rb +0 -73
  408. data/lib/alchemy/page_layout.rb +0 -73
  409. data/lib/alchemy/resource_filter.rb +0 -40
  410. data/lib/alchemy/upgrader/seven_point_four.rb +0 -26
  411. data/lib/alchemy/upgrader/seven_point_three.rb +0 -52
  412. data/lib/alchemy/upgrader/tasks/.keep +0 -0
  413. data/lib/generators/alchemy/ingredient/templates/view.html.erb +0 -1
  414. data/lib/generators/alchemy/install/files/alchemy_admin.js +0 -1
  415. data/lib/generators/alchemy/install/files/all.js +0 -11
  416. data/lib/generators/alchemy/install/files/article.css +0 -25
  417. data/rollup.config.mjs +0 -108
  418. data/vendor/assets/images/remixicon.symbol.svg +0 -11
  419. /data/app/{assets/stylesheets → stylesheets}/alchemy/_fonts.scss +0 -0
  420. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/attachment-select.scss +0 -0
  421. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/flash.scss +0 -0
  422. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/list_filter.scss +0 -0
  423. /data/app/{assets/stylesheets → stylesheets}/alchemy/admin/spinner.scss +0 -0
  424. /data/app/{assets/stylesheets → stylesheets}/tinymce/skins/skintool.json +0 -0
  425. /data/app/{assets/stylesheets → stylesheets}/tinymce/skins/ui/alchemy/fonts/tinymce-mobile.woff +0 -0
data/lib/alchemy.rb CHANGED
@@ -2,190 +2,203 @@
2
2
 
3
3
  require "alchemy/admin/preview_url"
4
4
  require "importmap-rails"
5
+ require "alchemy/configurations/main"
6
+ require "alchemy/config_missing"
5
7
 
6
8
  module Alchemy
9
+ include Alchemy::ConfigMissing
10
+ extend Alchemy::ConfigMissing
11
+
7
12
  YAML_PERMITTED_CLASSES = %w[Symbol Date Regexp]
8
13
 
9
- # Define page preview sources
10
- #
11
- # A preview source is a Ruby class returning an URL
12
- # that is used as source for the preview frame in the
13
- # admin UI.
14
- #
15
- # == Example
16
- #
17
- # # lib/acme/preview_source.rb
18
- # class Acme::PreviewSource < Alchemy::Admin::PreviewUrl
19
- # def url_for(page)
20
- # if page.site.name == "Next"
21
- # "https://user:#{ENV['PREVIEW_HTTP_PASS']}@next.acme.com"
22
- # else
23
- # "https://www.acme.com"
24
- # end
25
- # end
26
- # end
27
- #
28
- # # config/initializers/alchemy.rb
29
- # require "acme/preview_source"
30
- # Alchemy.preview_sources << Acme::PreviewSource
31
- #
32
- # # config/locales/de.yml
33
- # de:
34
- # activemodel:
35
- # models:
36
- # acme/preview_source: Acme Vorschau
37
- #
38
- def self.preview_sources
39
- @_preview_sources ||= Set.new << Alchemy::Admin::PreviewUrl
40
- end
14
+ # JS Importmap instance
15
+ singleton_class.attr_accessor :importmap
16
+ self.importmap = Importmap::Map.new
41
17
 
42
- def self.preview_sources=(sources)
43
- @_preview_sources = Array(sources)
44
- end
18
+ mattr_accessor :storage_adapter
45
19
 
46
- # Additional JS modules to be imported in the Alchemy admin UI
47
- #
48
- # Be sure to also pin the modules with +Alchemy.importmap+.
49
- #
50
- # == Example
51
- #
52
- # Alchemy.importmap.pin "flatpickr/de",
53
- # to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/de.js"
54
- #
55
- # Alchemy.admin_js_imports << "flatpickr/de"
56
- #
57
- def self.admin_js_imports
58
- @_admin_js_imports ||= Set.new
59
- end
20
+ class << self
21
+ def config
22
+ @_config ||= Alchemy::Configurations::Main.new
23
+ end
60
24
 
61
- def self.admin_js_imports=(sources)
62
- @_admin_js_imports = Set[sources]
63
- end
25
+ def configure(&blk)
26
+ yield config
27
+ end
64
28
 
65
- # Additional importmaps to be included in the Alchemy admin UI
66
- #
67
- # Be sure to also pin modules with +Alchemy.importmap+.
68
- #
69
- # == Example
70
- #
71
- # # config/alchemy/importmap.rb
72
- # Alchemy.importmap.pin "alchemy_solidus", to: "alchemy_solidus.js", preload: true
73
- # Alchemy.importmap.pin_all_from Alchemy::Solidus::Engine.root.join("app/javascript/alchemy_solidus"),
74
- # under: "alchemy_solidus",
75
- # preload: true
76
- #
77
- # # lib/alchemy/solidus/engine.rb
78
- # initializer "alchemy_solidus.assets", before: "alchemy.importmap" do |app|
79
- # Alchemy.admin_importmaps.add({
80
- # importmap_path: root.join("config/importmap.rb"),
81
- # source_paths: [
82
- # root.join("app/javascript")
83
- # ],
84
- # name: "alchemy_solidus"
85
- # })
86
- # app.config.assets.precompile << "alchemy_solidus/manifest.js"
87
- # end
88
- #
89
- # @return [Set<Hash>]
90
- def self.admin_importmaps
91
- @_admin_importmaps ||= Set.new([{
92
- importmap_path: Engine.root.join("config/importmap.rb"),
93
- source_paths: [
94
- Engine.root.join("app/javascript"),
95
- Engine.root.join("vendor/javascript")
96
- ],
97
- name: "alchemy_admin"
98
- }])
99
- end
29
+ enable_searchable_deprecation_msg = "Use `Alchemy.config.show_page_searchable_checkbox` instead."
30
+ def enable_searchable = config.show_page_searchable_checkbox
31
+ deprecate :enable_searchable= => enable_searchable_deprecation_msg, :deprecator => Alchemy::Deprecation
100
32
 
101
- # Additional stylesheets to be included in the Alchemy admin UI
102
- #
103
- # == Example
104
- #
105
- # # lib/alchemy/devise/engine.rb
106
- # initializer "alchemy.devise.stylesheets", before: "alchemy.admin_stylesheets" do
107
- # Alchemy.admin_stylesheets << "alchemy/devise/admin.css"
108
- # end
109
- #
110
- # @return [Set<String>]
111
- def self.admin_stylesheets
112
- @_admin_stylesheets ||= Set.new(["alchemy/admin/custom.css"])
113
- end
33
+ def enable_searchable=(other)
34
+ config.show_page_searchable_checkbox = other
35
+ end
36
+ deprecate enable_searchable: enable_searchable_deprecation_msg, deprecator: Alchemy::Deprecation
114
37
 
115
- # Define page publish targets
116
- #
117
- # A publish target is a ActiveJob that gets performed
118
- # whenever a user clicks the publish page button.
119
- #
120
- # Use this to trigger deployment hooks of external
121
- # services in an asychronous way.
122
- #
123
- # == Example
124
- #
125
- # # app/jobs/publish_job.rb
126
- # class PublishJob < ApplicationJob
127
- # def perform(page)
128
- # RestClient.post(ENV['BUILD_HOOK_URL'])
129
- # end
130
- # end
131
- #
132
- # # config/initializers/alchemy.rb
133
- # Alchemy.publish_targets << PublishJob
134
- #
135
- def self.publish_targets
136
- @_publish_targets ||= Set.new
137
- end
38
+ # Define page preview sources
39
+ #
40
+ # A preview source is a Ruby class returning an URL
41
+ # that is used as source for the preview frame in the
42
+ # admin UI.
43
+ #
44
+ # == Example
45
+ #
46
+ # # lib/acme/preview_source.rb
47
+ # class Acme::PreviewSource < Alchemy::Admin::PreviewUrl
48
+ # def url_for(page)
49
+ # if page.site.name == "Next"
50
+ # "https://user:#{ENV['PREVIEW_HTTP_PASS']}@next.acme.com"
51
+ # else
52
+ # "https://www.acme.com"
53
+ # end
54
+ # end
55
+ # end
56
+ #
57
+ # # config/initializers/alchemy.rb
58
+ # require "acme/preview_source"
59
+ # Alchemy.preview_sources << Acme::PreviewSource
60
+ #
61
+ # # config/locales/de.yml
62
+ # de:
63
+ # activemodel:
64
+ # models:
65
+ # acme/preview_source: Acme Vorschau
66
+ #
67
+ def preview_sources
68
+ @_preview_sources ||= Set.new << Alchemy::Admin::PreviewUrl
69
+ end
138
70
 
139
- # Enable full text search configuration
140
- #
141
- # It enables a searchable checkbox in the page form to toggle
142
- # the searchable field. These information can used in a search
143
- # plugin (e.g. https://github.com/AlchemyCMS/alchemy-pg_search).
144
- #
145
- # == Example
146
- #
147
- # # config/initializers/alchemy.rb
148
- # Alchemy.enable_searchable = true
149
- #
150
- mattr_accessor :enable_searchable, default: false
71
+ def preview_sources=(sources)
72
+ @_preview_sources = Array(sources)
73
+ end
151
74
 
152
- # JS Importmap instance
153
- singleton_class.attr_accessor :importmap
154
- self.importmap = Importmap::Map.new
75
+ # Additional JS modules to be imported in the Alchemy admin UI
76
+ #
77
+ # Be sure to also pin the modules with +Alchemy.importmap+.
78
+ #
79
+ # == Example
80
+ #
81
+ # Alchemy.importmap.pin "flatpickr/de",
82
+ # to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/de.js"
83
+ #
84
+ # Alchemy.admin_js_imports << "flatpickr/de"
85
+ #
86
+ def admin_js_imports
87
+ @_admin_js_imports ||= Set.new
88
+ end
89
+
90
+ def admin_js_imports=(sources)
91
+ @_admin_js_imports = Set[sources]
92
+ end
93
+
94
+ # Additional importmaps to be included in the Alchemy admin UI
95
+ #
96
+ # Be sure to also pin modules with +Alchemy.importmap+.
97
+ #
98
+ # == Example
99
+ #
100
+ # # config/alchemy/importmap.rb
101
+ # Alchemy.importmap.pin "alchemy_solidus", to: "alchemy_solidus.js", preload: true
102
+ # Alchemy.importmap.pin_all_from Alchemy::Solidus::Engine.root.join("app/javascript/alchemy_solidus"),
103
+ # under: "alchemy_solidus",
104
+ # preload: true
105
+ #
106
+ # # lib/alchemy/solidus/engine.rb
107
+ # initializer "alchemy_solidus.assets", before: "alchemy.importmap" do |app|
108
+ # Alchemy.admin_importmaps.add({
109
+ # importmap_path: root.join("config/importmap.rb"),
110
+ # source_paths: [
111
+ # root.join("app/javascript")
112
+ # ],
113
+ # name: "alchemy_solidus"
114
+ # })
115
+ # app.config.assets.precompile << "alchemy_solidus/manifest.js"
116
+ # end
117
+ #
118
+ # @return [Set<Hash>]
119
+ def admin_importmaps
120
+ @_admin_importmaps ||= Set.new([{
121
+ importmap_path: Engine.root.join("config/importmap.rb"),
122
+ source_paths: [
123
+ Engine.root.join("app/javascript"),
124
+ Engine.root.join("vendor/javascript")
125
+ ],
126
+ name: "alchemy_admin"
127
+ }])
128
+ end
129
+
130
+ # Additional stylesheets to be included in the Alchemy admin UI
131
+ #
132
+ # == Example
133
+ #
134
+ # # lib/alchemy/devise/engine.rb
135
+ # initializer "alchemy.devise.stylesheets", before: "alchemy.admin_stylesheets" do
136
+ # Alchemy.admin_stylesheets << "alchemy/devise/admin.css"
137
+ # end
138
+ #
139
+ # @return [Set<String>]
140
+ def admin_stylesheets
141
+ @_admin_stylesheets ||= Set.new(["alchemy/admin/custom.css"])
142
+ end
143
+
144
+ # Define page publish targets
145
+ #
146
+ # A publish target is a ActiveJob that gets performed
147
+ # whenever a user clicks the publish page button.
148
+ #
149
+ # Use this to trigger deployment hooks of external
150
+ # services in an asychronous way.
151
+ #
152
+ # == Example
153
+ #
154
+ # # app/jobs/publish_job.rb
155
+ # class PublishJob < ApplicationJob
156
+ # def perform(page)
157
+ # RestClient.post(ENV['BUILD_HOOK_URL'])
158
+ # end
159
+ # end
160
+ #
161
+ # # config/initializers/alchemy.rb
162
+ # Alchemy.publish_targets << PublishJob
163
+ #
164
+ def publish_targets
165
+ @_publish_targets ||= Set.new
166
+ end
155
167
 
156
- # Configure tabs in the link dialog
157
- #
158
- # With this configuration that tabs in the link dialog can be extended
159
- # without overwriting or defacing the Admin Interface.
160
- #
161
- # == Example
162
- #
163
- # # components/acme/link_tab.rb
164
- # module Acme
165
- # class LinkTab < ::Alchemy::Admin::LinkDialog::BaseTab
166
- # def title
167
- # "Awesome Tab Title"
168
- # end
169
- #
170
- # def name
171
- # :unique_name
172
- # end
173
- #
174
- # def fields
175
- # [ title_input, target_select ]
176
- # end
177
- # end
178
- # end
179
- #
180
- # # config/initializers/alchemy.rb
181
- # Alchemy.link_dialog_tabs << Acme::LinkTab
182
- #
183
- def self.link_dialog_tabs
184
- @_link_dialog_tabs ||= Set.new([
185
- Alchemy::Admin::LinkDialog::InternalTab,
186
- Alchemy::Admin::LinkDialog::AnchorTab,
187
- Alchemy::Admin::LinkDialog::ExternalTab,
188
- Alchemy::Admin::LinkDialog::FileTab
189
- ])
168
+ # Configure tabs in the link dialog
169
+ #
170
+ # With this configuration that tabs in the link dialog can be extended
171
+ # without overwriting or defacing the Admin Interface.
172
+ #
173
+ # == Example
174
+ #
175
+ # # components/acme/link_tab.rb
176
+ # module Acme
177
+ # class LinkTab < ::Alchemy::Admin::LinkDialog::BaseTab
178
+ # def title
179
+ # "Awesome Tab Title"
180
+ # end
181
+ #
182
+ # def name
183
+ # :unique_name
184
+ # end
185
+ #
186
+ # def fields
187
+ # [ title_input, target_select ]
188
+ # end
189
+ # end
190
+ # end
191
+ #
192
+ # # config/initializers/alchemy.rb
193
+ # Alchemy.link_dialog_tabs << Acme::LinkTab
194
+ #
195
+ def link_dialog_tabs
196
+ @_link_dialog_tabs ||= Set.new([
197
+ Alchemy::Admin::LinkDialog::InternalTab,
198
+ Alchemy::Admin::LinkDialog::AnchorTab,
199
+ Alchemy::Admin::LinkDialog::ExternalTab,
200
+ Alchemy::Admin::LinkDialog::FileTab
201
+ ])
202
+ end
190
203
  end
191
204
  end
data/lib/alchemy_cms.rb CHANGED
@@ -7,16 +7,15 @@ require "alchemy"
7
7
  require "acts_as_list"
8
8
  require "action_view/dependency_tracker"
9
9
  require "active_model_serializers"
10
+ require "active_storage/engine"
10
11
  require "awesome_nested_set"
11
12
  require "cancan"
12
13
  require "dragonfly"
13
14
  require "gutentag"
14
15
  require "importmap-rails"
15
16
  require "kaminari"
16
- require "non_stupid_digest_assets"
17
17
  require "ransack"
18
18
  require "simple_form"
19
- require "sprockets/rails"
20
19
  require "turbo-rails"
21
20
  require "userstamp"
22
21
  require "view_component"
@@ -27,11 +26,9 @@ require_relative "alchemy/admin/locale"
27
26
  require_relative "alchemy/admin/preview_url"
28
27
  require_relative "alchemy/auth_accessors"
29
28
  require_relative "alchemy/cache_digests/template_tracker"
30
- require_relative "alchemy/config"
31
29
  require_relative "alchemy/configuration_methods"
32
30
  require_relative "alchemy/controller_actions"
33
31
  require_relative "alchemy/deprecation"
34
- require_relative "alchemy/element_definition"
35
32
  require_relative "alchemy/elements_finder"
36
33
  require_relative "alchemy/error_tracking"
37
34
  require_relative "alchemy/errors"
@@ -44,11 +41,8 @@ require_relative "alchemy/modules"
44
41
  require_relative "alchemy/name_conversions"
45
42
  require_relative "alchemy/on_page_layout"
46
43
  require_relative "alchemy/on_page_layout/callbacks_runner"
47
- require_relative "alchemy/page_layout"
48
44
  require_relative "alchemy/paths"
49
45
  require_relative "alchemy/permissions"
50
- require_relative "alchemy/resource"
51
- require_relative "alchemy/searchable_resource"
52
46
  require_relative "alchemy/tinymce"
53
47
  require_relative "alchemy/taggable"
54
48
  require_relative "alchemy/version"
@@ -24,9 +24,6 @@ module Alchemy
24
24
 
25
25
  def copy_templates
26
26
  @ingredient_editor_local = "#{file_name}_editor"
27
- @ingredient_view_local = "#{file_name}_view"
28
- @ingredient_view_component_class = "#{@class_name}View"
29
- template "view.html.erb", "#{@ingredients_view_path}/_#{file_name}_view.html.erb"
30
27
  template "editor.html.erb", "#{@ingredients_view_path}/_#{file_name}_editor.html.erb"
31
28
  end
32
29
 
@@ -1,7 +1,9 @@
1
1
  <%- cache(article) do -%>
2
- <%= element_view_for(article, tag: 'article') do |el| -%>
3
- <h2><%= el.render :headline %></h2>
4
- <%= el.render :picture, size: '1200x600' %>
5
- <%= el.render :text %>
2
+ <%= element_view_for(article, tag: "article", class: "w-full max-w-xl mx-auto bg-slate-100 shadow my-8 px-8 py-4 rounded") do |el| -%>
3
+ <%= el.render :headline, {}, class: "text-2xl font-bold my-4" %>
4
+ <%= el.render :picture %>
5
+ <div class="[&>p]:my-2 [&>h2]:font-bold [&>h2]:text-xl [&>h2]:my-4 [&>h3]:font-bold [&>h3]:my-2 [&>ul]:list-disc [&>ul]:ml-4 [&>p>a]:underline [&>p>code]:text-sm [&>p>code]:bg-gray-50 [&>p>code]:p-1 [&>p>code]:whitespace-nowrap">
6
+ <%= el.render :text %>
7
+ </div>
6
8
  <%- end -%>
7
9
  <%- end -%>
@@ -17,14 +17,33 @@ en:
17
17
  # Default texts for new ingredients created
18
18
  default_ingredient_texts:
19
19
  article_headline: "Welcome to your first Alchemy CMS page"
20
- article_text: '<p><strong>How to get started.</strong></p><p>First of all you should read about Alchemy and its architecture in the <a class="external" href="http://guides.alchemy-cms.com/alchemy_approach.html" target="_blank" data-link-target="blank">guidelines</a>.</p><p>The most important things to know about Alchemy are elements and page layouts.</p><p><span style="text-decoration: underline;"><strong>Elements:</strong></span></p><p>With Alchemy you can split pages into content parts, elements. These elements can be defined out of several base content types: ingredients. The ingredients are:</p><ul><li>Text - <em>A single line of text</em></li><li>Richtext - <em>A TinyMCE powered formatted text block</em></li><li>Picture - <em>A reference to an image</em></li><li>Html - <em>HTML embed code</em></li><li>Select - <em>A selection of values</em></li><li>Boolean - <em>A checkbox</em></li></ul><p>Elements get defined in a YAML file <strong>config/alchemy/elements.yml</strong></p><p><a class="external" href="http://guides.alchemy-cms.com/elements.html" target="_blank" data-link-target="blank">Read more about elements and how to define them in the guidelines.</a></p><p><span style="text-decoration: underline;"><strong>Page types:</strong></span></p><p>You can define several types of pages, called page layouts. You can assign elements to page layouts and control how elements and the page of a certain layout behave.</p><p>Page layouts get defined in a YAML file <strong>config/alchemy/page_layouts.yml</strong></p><p><a class="external" href="http://guides.alchemy-cms.com/page_layouts.html" target="_blank" data-link-target="blank">Read more about defining page layouts in the guidelines.</a></p>'
20
+ article_text: |
21
+ <h2>How to get started.</h2>
22
+ <p>First of all you should read about Alchemy and it's architecture <a class="external" href="https://guides.alchemy-cms.com/alchemy_approach.html" target="_blank" rel="noopener" data-link-target="blank">in the guidelines</a>.</p>
23
+ <p>The most important things to know about Alchemy are elements and page layouts.</p>
24
+ <h3>Elements:</h3>
25
+ <p>With Alchemy you can split pages into content parts, elements. These elements can be defined out of several base content types: ingredients. The ingredients are:</p>
26
+ <ul>
27
+ <li>Text - <em>A single line of text</em></li>
28
+ <li>Richtext - <em>A TinyMCE powered formatted text block</em></li>
29
+ <li>Picture - <em>A reference to an image</em></li>
30
+ <li>Html - <em>HTML embed code</em></li>
31
+ <li>Select - <em>A selection of values</em></li>
32
+ <li>Boolean - <em>A checkbox</em></li>
33
+ </ul>
34
+ <p>Elements get defined in <code>config/alchemy/elements.yml</code>.</p>
35
+ <p>Read more about elements and how to define them <a class="external" href="https://guides.alchemy-cms.com/elements.html" target="_blank" rel="noopener" data-link-target="blank">in the guidelines</a>.</p>
36
+ <h3>Page types:</h3>
37
+ <p>You can define several types of pages, called page layouts. You can assign elements to page layouts and control how elements and the page of a certain layout behave.</p>
38
+ <p>Page layouts get defined in <code>config/alchemy/page_layouts.yml</code>.</p>
39
+ <p>Read more about defining page layouts <a class="external" href="https://guides.alchemy-cms.com/page_layouts.html" target="_blank" rel="noopener" data-link-target="blank">in the guidelines</a>.</p>
21
40
 
22
41
  # Hint texts for elements
23
42
  element_hints:
24
- article: "This is a hint text for the article element. You can change this text in `config/locales/alchemy.en.yml`. Feel free to change it as you like, it's yours."
43
+ article: "This is a hint text for the article element. You can change this text in <code>config/locales/alchemy.en.yml</code>. Feel free to change it as you like, it's yours."
25
44
 
26
45
  # Hint texts for ingredients
27
46
  ingredient_hints:
28
47
  headline: "This is a single line of unformatable Text"
29
48
  picture: "Pictures are stored in the library. You can assign a picture multiple times throughout your site. Alchemy has an image cropper build right in."
30
- text: "This is a rich text block powered by TinyMCE editor. You can change the configuration of the editor. See http://guides.alchemy-cms.com/customize_tinymce.html"
49
+ text: "This is a rich text block powered by TinyMCE editor. You can change the configuration of the editor. See https://guides.alchemy-cms.com/customize_tinymce.html"
@@ -7,6 +7,11 @@
7
7
 
8
8
  <%= stylesheet_link_tag 'application', media: 'all', 'data-turbo-track': 'reload' %>
9
9
  <%= javascript_include_tag 'application', 'data-turbo-track': 'reload' %>
10
+ <!--
11
+ Inserted by Alchemy demo file installer.
12
+ You probably want to remove this and use your custom css.
13
+ -->
14
+ <script src="https://cdn.tailwindcss.com"></script>
10
15
  </head>
11
16
 
12
17
  <body>
@@ -53,18 +53,28 @@ module Alchemy
53
53
  install_tasks.inject_routes(options[:auto_accept])
54
54
  end
55
55
 
56
- def copy_config
57
- copy_file "#{gem_config_path}/config.yml", app_config_path.join("alchemy", "config.yml")
58
- end
59
-
60
56
  def copy_yml_files
61
57
  %w[elements page_layouts menus].each do |file|
62
58
  template "#{__dir__}/templates/#{file}.yml.tt", app_config_path.join("alchemy", "#{file}.yml")
63
59
  end
64
60
  end
65
61
 
62
+ def copy_config_rb
63
+ @default_language = get_primary_language(
64
+ code: options[:default_language_code],
65
+ name: options[:default_language_name],
66
+ auto_accept: options[:auto_accept]
67
+ )
68
+ @default_config = Alchemy::Configurations::Main.new(
69
+ default_language: {
70
+ name: @default_language[:name],
71
+ code: @default_language[:code]
72
+ }
73
+ )
74
+ template "#{__dir__}/templates/alchemy.rb.tt", app_config_path.join("initializers", "alchemy.rb")
75
+ end
76
+
66
77
  def install_assets
67
- copy_file "all.js", app_vendor_assets_path.join("javascripts", "alchemy", "admin", "all.js")
68
78
  copy_file "custom.css", app_assets_path.join("stylesheets/alchemy/admin/custom.css")
69
79
  end
70
80
 
@@ -72,15 +82,6 @@ module Alchemy
72
82
  return if options[:skip_demo_files]
73
83
 
74
84
  copy_file "application.html.erb", app_views_path.join("layouts", "application.html.erb")
75
- copy_file "article.css", app_assets_path.join("stylesheets", "alchemy", "elements", "_article.css")
76
-
77
- stylesheet_require = %(@import "alchemy/elements/article";\n)
78
- if File.exist?(app_assets_path.join("stylesheets", "application.css"))
79
- prepend_file app_assets_path.join("stylesheets", "application.css"), stylesheet_require
80
- else
81
- create_file app_assets_path.join("stylesheets", "application.css"), stylesheet_require
82
- end
83
-
84
85
  copy_file "_article.html.erb", app_views_path.join("alchemy", "elements", "_article.html.erb")
85
86
  copy_file "_standard.html.erb", app_views_path.join("alchemy", "page_layouts", "_standard.html.erb")
86
87
  copy_file "alchemy.en.yml", app_config_path.join("locales", "alchemy.en.yml")
@@ -98,15 +99,6 @@ module Alchemy
98
99
  rake "gutentag:install:migrations"
99
100
  end
100
101
 
101
- def set_primary_language
102
- header
103
- install_tasks.set_primary_language(
104
- code: options[:default_language_code],
105
- name: options[:default_language_name],
106
- auto_accept: options[:auto_accept]
107
- )
108
- end
109
-
110
102
  def setup_database
111
103
  rake("db:create", abort_on_failure: true) unless options[:skip_db_create]
112
104
  # We can't invoke this rake task, because Rails will use wrong engine names otherwise
@@ -127,6 +119,16 @@ module Alchemy
127
119
 
128
120
  private
129
121
 
122
+ def get_primary_language(code: "en", name: "English", auto_accept: false)
123
+ unless options[:auto_accept]
124
+ code = ask("- What is the language code of your site's primary language?", default: code)
125
+ end
126
+ unless options[:auto_accept]
127
+ name = ask("- What is the name of your site's primary language?", default: name)
128
+ end
129
+ {code:, name:}
130
+ end
131
+
130
132
  def header
131
133
  return if options[:auto_accept]
132
134