maglevcms 2.1.0 → 3.0.0.beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (673) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -13
  3. data/Rakefile +0 -4
  4. data/app/assets/builds/maglev/tailwind.css +14393 -0
  5. data/app/assets/config/maglev_manifest.js +7 -0
  6. data/app/assets/javascripts/maglev/client/dom-operations.js +282 -0
  7. data/app/{frontend/live-preview-client → assets/javascripts/maglev/client}/iframe-decorator.js +81 -15
  8. data/app/{frontend/live-preview-client/message.js → assets/javascripts/maglev/client/incoming-messages.js} +14 -12
  9. data/app/assets/javascripts/maglev/client/index.js +26 -0
  10. data/app/{frontend/live-preview-client → assets/javascripts/maglev/client}/utils.js +4 -0
  11. data/app/assets/javascripts/maglev/editor/controllers/app/forms/section_form_controller.js +46 -0
  12. data/app/assets/javascripts/maglev/editor/controllers/app/forms/style_form_controller.js +19 -0
  13. data/app/assets/javascripts/maglev/editor/controllers/app/index.js +15 -0
  14. data/app/assets/javascripts/maglev/editor/controllers/app/page_preview_controller.js +163 -0
  15. data/app/assets/javascripts/maglev/editor/controllers/app/preview_notification_center_controller.js +151 -0
  16. data/app/assets/javascripts/maglev/editor/controllers/app/setting_controller.js +42 -0
  17. data/app/assets/javascripts/maglev/editor/controllers/application.js +9 -0
  18. data/app/assets/javascripts/maglev/editor/controllers/index.js +3 -0
  19. data/app/assets/javascripts/maglev/editor/controllers/shared/auto_save_controller.js +16 -0
  20. data/app/assets/javascripts/maglev/editor/controllers/shared/broken_image_controller.js +16 -0
  21. data/app/assets/javascripts/maglev/editor/controllers/shared/copy_to_clipboard_controller.js +36 -0
  22. data/app/assets/javascripts/maglev/editor/controllers/shared/disappearance_controller.js +21 -0
  23. data/app/assets/javascripts/maglev/editor/controllers/shared/dispatcher_controller.js +12 -0
  24. data/app/assets/javascripts/maglev/editor/controllers/shared/form_refresh_controller.js +15 -0
  25. data/app/assets/javascripts/maglev/editor/controllers/shared/index.js +27 -0
  26. data/app/assets/javascripts/maglev/editor/controllers/shared/max_length_controller.js +30 -0
  27. data/app/assets/javascripts/maglev/editor/controllers/shared/prevent_same_path.js +20 -0
  28. data/app/assets/javascripts/maglev/editor/controllers/shared/reload_page_controller.js +7 -0
  29. data/app/assets/javascripts/maglev/editor/controllers/shared/sortable_controller.js +64 -0
  30. data/app/assets/javascripts/maglev/editor/controllers/shared/submit_button_controller.js +45 -0
  31. data/app/assets/javascripts/maglev/editor/controllers/shared/transition_controller.js +14 -0
  32. data/app/assets/javascripts/maglev/editor/controllers/uikit.js +39 -0
  33. data/app/assets/javascripts/maglev/editor/controllers/utils.js +10 -0
  34. data/app/assets/javascripts/maglev/editor/index.js +66 -0
  35. data/app/assets/stylesheets/maglev/application.css +88 -0
  36. data/app/{frontend/editor/design/components/rich-text-editor.scss → assets/stylesheets/maglev/tailwind.css.erb} +30 -15
  37. data/app/components/maglev/editor/setting_registry.rb +59 -0
  38. data/app/components/maglev/editor/settings/base_component.rb +55 -0
  39. data/app/components/maglev/editor/settings/checkbox/checkbox_component.html.erb +16 -0
  40. data/app/components/maglev/editor/settings/checkbox/checkbox_component.rb +12 -0
  41. data/app/components/maglev/editor/settings/collection_item/collection_item_component.html.erb +25 -0
  42. data/app/components/maglev/editor/settings/collection_item/collection_item_component.rb +19 -0
  43. data/app/components/maglev/editor/settings/color/color_component.html.erb +17 -0
  44. data/app/components/maglev/editor/settings/color/color_component.rb +12 -0
  45. data/app/components/maglev/editor/settings/divider/divider_component.html.erb +12 -0
  46. data/app/components/maglev/editor/settings/divider/divider_component.rb +15 -0
  47. data/app/components/maglev/editor/settings/hint/hint_component.html.erb +3 -0
  48. data/app/components/maglev/editor/settings/hint/hint_component.rb +12 -0
  49. data/app/components/maglev/editor/settings/icon/icon_component.html.erb +21 -0
  50. data/app/components/maglev/editor/settings/icon/icon_component.rb +15 -0
  51. data/app/components/maglev/editor/settings/image/image_component.html.erb +26 -0
  52. data/app/components/maglev/editor/settings/image/image_component.rb +23 -0
  53. data/app/components/maglev/editor/settings/link/link_component.html.erb +22 -0
  54. data/app/components/maglev/editor/settings/link/link_component.rb +19 -0
  55. data/app/components/maglev/editor/settings/select/select_component.html.erb +20 -0
  56. data/app/components/maglev/editor/settings/select/select_component.rb +27 -0
  57. data/app/components/maglev/editor/settings/text/richtext_component.html.erb +22 -0
  58. data/app/components/maglev/editor/settings/text/richtext_component.rb +12 -0
  59. data/app/components/maglev/editor/settings/text/text_component.html.erb +18 -0
  60. data/app/components/maglev/editor/settings/text/text_component.rb +12 -0
  61. data/app/components/maglev/editor/settings/text/textarea_component.html.erb +21 -0
  62. data/app/components/maglev/editor/settings/text/textarea_component.rb +12 -0
  63. data/app/components/maglev/editor/settings_group_component.html.erb +5 -0
  64. data/app/components/maglev/editor/settings_group_component.rb +30 -0
  65. data/app/components/maglev/section_component.rb +10 -7
  66. data/app/components/maglev/uikit/app_layout/layout_component.html.erb +15 -0
  67. data/app/components/maglev/uikit/app_layout/layout_component.rb +19 -0
  68. data/app/components/maglev/uikit/app_layout/sidebar/link_component.html.erb +5 -0
  69. data/app/components/maglev/uikit/app_layout/sidebar/link_component.rb +40 -0
  70. data/app/components/maglev/uikit/app_layout/sidebar_component.html.erb +19 -0
  71. data/app/components/maglev/uikit/app_layout/sidebar_component.rb +11 -0
  72. data/app/components/maglev/uikit/app_layout/topbar/logo_component.html.erb +3 -0
  73. data/app/components/maglev/uikit/app_layout/topbar/logo_component.rb +18 -0
  74. data/app/components/maglev/uikit/app_layout/topbar/page_info_component.html.erb +26 -0
  75. data/app/components/maglev/uikit/app_layout/topbar/page_info_component.rb +28 -0
  76. data/app/components/maglev/uikit/app_layout/topbar_component.html.erb +15 -0
  77. data/app/components/maglev/uikit/app_layout/topbar_component.rb +21 -0
  78. data/app/components/maglev/uikit/badge_component.rb +40 -0
  79. data/app/components/maglev/uikit/base_component.rb +15 -0
  80. data/app/components/maglev/uikit/breadcrumbs/breadcrumbs_component.html.erb +10 -0
  81. data/app/components/maglev/uikit/breadcrumbs/breadcrumbs_component.rb +11 -0
  82. data/app/components/maglev/uikit/breadcrumbs/link_component.html.erb +12 -0
  83. data/app/components/maglev/uikit/breadcrumbs/link_component.rb +25 -0
  84. data/app/components/maglev/uikit/collapsible/collapsible_component.html.erb +5 -0
  85. data/app/components/maglev/uikit/collapsible/collapsible_component.rb +11 -0
  86. data/app/components/maglev/uikit/collapsible/collapsible_controller.js +9 -0
  87. data/app/components/maglev/uikit/collapsible/item_component.html.erb +17 -0
  88. data/app/components/maglev/uikit/collapsible/item_component.rb +11 -0
  89. data/app/components/maglev/uikit/device_toggler_component/device_toggler_component.html.erb +16 -0
  90. data/app/components/maglev/uikit/device_toggler_component/device_toggler_controller.js +25 -0
  91. data/app/components/maglev/uikit/device_toggler_component.rb +28 -0
  92. data/app/components/maglev/uikit/dropdown_component/dropdown_component.html.erb +18 -0
  93. data/app/components/maglev/uikit/dropdown_component/dropdown_controller.js +69 -0
  94. data/app/components/maglev/uikit/dropdown_component.rb +15 -0
  95. data/app/components/maglev/uikit/form/checkbox_component.html.erb +17 -0
  96. data/app/components/maglev/uikit/form/checkbox_component.rb +26 -0
  97. data/app/components/maglev/uikit/form/checkbox_controller.js +7 -0
  98. data/app/components/maglev/uikit/form/color_field_component.html.erb +76 -0
  99. data/app/components/maglev/uikit/form/color_field_component.rb +57 -0
  100. data/app/components/maglev/uikit/form/color_field_controller.js +25 -0
  101. data/app/components/maglev/uikit/form/combobox/list_component.html.erb +14 -0
  102. data/app/components/maglev/uikit/form/combobox/list_component.rb +13 -0
  103. data/app/components/maglev/uikit/form/combobox/option_component.html.erb +16 -0
  104. data/app/components/maglev/uikit/form/combobox/option_component.rb +22 -0
  105. data/app/components/maglev/uikit/form/combobox_component.html.erb +75 -0
  106. data/app/components/maglev/uikit/form/combobox_component.rb +64 -0
  107. data/app/components/maglev/uikit/form/combobox_controller.js +385 -0
  108. data/app/components/maglev/uikit/form/icon_field_component.html.erb +76 -0
  109. data/app/components/maglev/uikit/form/icon_field_component.rb +35 -0
  110. data/app/components/maglev/uikit/form/icon_field_controller.js +38 -0
  111. data/app/components/maglev/uikit/form/image_field_component.html.erb +101 -0
  112. data/app/components/maglev/uikit/form/image_field_component.rb +52 -0
  113. data/app/components/maglev/uikit/form/image_field_controller.js +74 -0
  114. data/app/components/maglev/uikit/form/link/base_component.rb +19 -0
  115. data/app/components/maglev/uikit/form/link/email_link_component.html.erb +16 -0
  116. data/app/components/maglev/uikit/form/link/email_link_component.rb +12 -0
  117. data/app/components/maglev/uikit/form/link/page_link_component.html.erb +17 -0
  118. data/app/components/maglev/uikit/form/link/page_link_component.rb +12 -0
  119. data/app/components/maglev/uikit/form/link/static_page_link_component.html.erb +16 -0
  120. data/app/components/maglev/uikit/form/link/static_page_link_component.rb +12 -0
  121. data/app/components/maglev/uikit/form/link/url_link_component.html.erb +16 -0
  122. data/app/components/maglev/uikit/form/link/url_link_component.rb +19 -0
  123. data/app/components/maglev/uikit/form/link_component.html.erb +55 -0
  124. data/app/components/maglev/uikit/form/link_component.rb +80 -0
  125. data/app/components/maglev/uikit/form/link_controller.js +36 -0
  126. data/app/components/maglev/uikit/form/richtext/block_button_component.html.erb +38 -0
  127. data/app/components/maglev/uikit/form/richtext/block_button_component.rb +22 -0
  128. data/app/components/maglev/uikit/form/richtext/button_component.html.erb +16 -0
  129. data/app/components/maglev/uikit/form/richtext/button_component.rb +19 -0
  130. data/app/components/maglev/uikit/form/richtext/button_group_component.html.erb +7 -0
  131. data/app/components/maglev/uikit/form/richtext/button_group_component.rb +13 -0
  132. data/app/components/maglev/uikit/form/richtext/toolbar_component.html.erb +23 -0
  133. data/app/components/maglev/uikit/form/richtext/toolbar_component.rb +19 -0
  134. data/app/components/maglev/uikit/form/richtext_component.html.erb +28 -0
  135. data/app/components/maglev/uikit/form/richtext_component.rb +54 -0
  136. data/app/components/maglev/uikit/form/richtext_controller.js +248 -0
  137. data/app/components/maglev/uikit/form/search_form_component.html.erb +24 -0
  138. data/app/components/maglev/uikit/form/search_form_component.rb +42 -0
  139. data/app/components/maglev/uikit/form/search_form_controller.js +31 -0
  140. data/app/components/maglev/uikit/form/select_component.html.erb +19 -0
  141. data/app/components/maglev/uikit/form/select_component.rb +52 -0
  142. data/app/components/maglev/uikit/form/select_controller.js +7 -0
  143. data/app/components/maglev/uikit/form/text_field_component.html.erb +26 -0
  144. data/app/components/maglev/uikit/form/text_field_component.rb +42 -0
  145. data/app/components/maglev/uikit/form/text_field_controller.js +18 -0
  146. data/app/components/maglev/uikit/form/textarea_component.html.erb +43 -0
  147. data/app/components/maglev/uikit/form/textarea_component.rb +53 -0
  148. data/app/components/maglev/uikit/icon_button_component/icon_button_component.html.erb +3 -0
  149. data/app/components/maglev/uikit/icon_button_component.rb +18 -0
  150. data/app/components/maglev/uikit/icon_component.rb +140 -0
  151. data/app/components/maglev/uikit/image_library/card_component.html.erb +41 -0
  152. data/app/components/maglev/uikit/image_library/card_component.rb +52 -0
  153. data/app/components/maglev/uikit/image_library/list_component.html.erb +7 -0
  154. data/app/components/maglev/uikit/image_library/list_component.rb +11 -0
  155. data/app/components/maglev/uikit/image_library/uploader_component.html.erb +30 -0
  156. data/app/components/maglev/uikit/image_library/uploader_component.rb +29 -0
  157. data/app/components/maglev/uikit/image_library/uploader_controller.js +74 -0
  158. data/app/components/maglev/uikit/list/insert_button_component.html.erb +7 -0
  159. data/app/components/maglev/uikit/list/insert_button_component.rb +40 -0
  160. data/app/components/maglev/uikit/list/list_component.html.erb +17 -0
  161. data/app/components/maglev/uikit/list/list_component.rb +34 -0
  162. data/app/components/maglev/uikit/list/list_item_component.html.erb +47 -0
  163. data/app/components/maglev/uikit/list/list_item_component.rb +85 -0
  164. data/app/components/maglev/uikit/locale_switcher_component/locale_switcher_component.html.erb +22 -0
  165. data/app/components/maglev/uikit/locale_switcher_component.rb +18 -0
  166. data/app/components/maglev/uikit/menu_dropdown_component/menu_dropdown_component.html.erb +15 -0
  167. data/app/components/maglev/uikit/menu_dropdown_component.rb +32 -0
  168. data/app/components/maglev/uikit/modal_component/modal_component.html.erb +63 -0
  169. data/app/components/maglev/uikit/modal_component/modal_controller.js +47 -0
  170. data/app/components/maglev/uikit/modal_component.rb +33 -0
  171. data/app/components/maglev/uikit/page_actions_dropdown_component/page_actions_dropdown_component.html.erb +56 -0
  172. data/app/components/maglev/uikit/page_actions_dropdown_component.rb +24 -0
  173. data/app/components/maglev/uikit/page_layout_component/back_link_component.html.erb +4 -0
  174. data/app/components/maglev/uikit/page_layout_component/page_layout_component.html.erb +58 -0
  175. data/app/components/maglev/uikit/page_layout_component/page_layout_controller.js +34 -0
  176. data/app/components/maglev/uikit/page_layout_component.rb +42 -0
  177. data/app/components/maglev/uikit/pagination_component/pagination_component.html.erb +70 -0
  178. data/app/components/maglev/uikit/pagination_component.rb +25 -0
  179. data/app/components/maglev/uikit/section_toolbar/bottom_component.html.erb +13 -0
  180. data/app/components/maglev/uikit/section_toolbar/bottom_component.rb +27 -0
  181. data/app/components/maglev/uikit/section_toolbar/section_toolbar_component.html.erb +17 -0
  182. data/app/components/maglev/uikit/section_toolbar/section_toolbar_component.rb +18 -0
  183. data/app/components/maglev/uikit/section_toolbar/section_toolbar_controller.js +90 -0
  184. data/app/components/maglev/uikit/section_toolbar/top_left_corner_component.html.erb +16 -0
  185. data/app/components/maglev/uikit/section_toolbar/top_left_corner_component.rb +15 -0
  186. data/app/components/maglev/uikit/section_toolbar/top_right_corner_component.html.erb +28 -0
  187. data/app/components/maglev/uikit/section_toolbar/top_right_corner_component.rb +28 -0
  188. data/app/components/maglev/uikit/tabs_component/tabs_component.html.erb +35 -0
  189. data/app/components/maglev/uikit/tabs_component/tabs_controller.js +57 -0
  190. data/app/components/maglev/uikit/tabs_component.rb +71 -0
  191. data/app/controllers/concerns/maglev/content_locale_concern.rb +5 -1
  192. data/app/controllers/concerns/maglev/editor/errors_concern.rb +45 -0
  193. data/app/controllers/concerns/maglev/fetchers_concern.rb +3 -6
  194. data/app/controllers/concerns/maglev/flash_i18n_concern.rb +11 -0
  195. data/app/controllers/maglev/application_controller.rb +1 -7
  196. data/app/controllers/maglev/editor/assets_controller.rb +59 -0
  197. data/app/controllers/maglev/editor/base_controller.rb +111 -0
  198. data/app/controllers/maglev/editor/combobox/collection_items_controller.rb +17 -0
  199. data/app/controllers/maglev/editor/combobox/pages_controller.rb +20 -0
  200. data/app/controllers/maglev/editor/home_controller.rb +25 -0
  201. data/app/controllers/maglev/editor/icons_controller.rb +24 -0
  202. data/app/controllers/maglev/editor/links_controller.rb +52 -0
  203. data/app/controllers/maglev/editor/page_clone_controller.rb +20 -0
  204. data/app/controllers/maglev/editor/pages_controller.rb +77 -0
  205. data/app/controllers/maglev/editor/publication_controller.rb +14 -0
  206. data/app/controllers/maglev/editor/section_blocks_controller.rb +101 -0
  207. data/app/controllers/maglev/editor/sections_controller.rb +96 -0
  208. data/app/controllers/maglev/editor/style_controller.rb +31 -0
  209. data/app/controllers/maglev/page_preview_controller.rb +1 -5
  210. data/app/controllers/maglev/published_page_preview_controller.rb +50 -0
  211. data/app/controllers/maglev/sitemap_controller.rb +1 -1
  212. data/app/helpers/maglev/application_helper.rb +148 -18
  213. data/app/helpers/maglev/editor/pages_helper.rb +23 -0
  214. data/app/helpers/maglev/editor/section_blocks_helper.rb +124 -0
  215. data/app/helpers/maglev/editor/settings_helper.rb +52 -0
  216. data/app/helpers/maglev/page_preview_helper.rb +1 -1
  217. data/app/lib/maglev/form/form_builder.rb +38 -0
  218. data/app/lib/maglev/form/inputs/check_box.rb +20 -0
  219. data/app/lib/maglev/form/inputs/combobox.rb +33 -0
  220. data/app/lib/maglev/form/inputs/image_field.rb +39 -0
  221. data/app/lib/maglev/form/inputs/richtext.rb +34 -0
  222. data/app/lib/maglev/form/inputs/select.rb +34 -0
  223. data/app/lib/maglev/form/inputs/text_field.rb +32 -0
  224. data/app/lib/maglev/form/inputs/textarea.rb +30 -0
  225. data/app/lib/maglev/turbo/streams/tag_builder.rb +17 -0
  226. data/app/models/concerns/maglev/content/enhanced_value_concern.rb +40 -0
  227. data/app/models/concerns/maglev/sections_concern.rb +30 -1
  228. data/app/models/concerns/maglev/translatable.rb +1 -2
  229. data/app/models/maglev/asset.rb +1 -3
  230. data/app/models/maglev/content/block_content.rb +96 -0
  231. data/app/models/maglev/content/editor_link.rb +49 -0
  232. data/app/models/maglev/content/section_content.rb +85 -0
  233. data/app/models/maglev/content/setting_content.rb +33 -0
  234. data/app/models/maglev/page/path_concern.rb +7 -0
  235. data/app/models/maglev/page/search_concern.rb +23 -4
  236. data/app/models/maglev/page.rb +3 -0
  237. data/app/models/maglev/section/block.rb +43 -6
  238. data/app/models/maglev/section/content_concern.rb +15 -1
  239. data/app/models/maglev/section/setting.rb +12 -0
  240. data/app/models/maglev/section.rb +52 -4
  241. data/app/models/maglev/sections_content_store.rb +36 -0
  242. data/app/models/maglev/setting_types/base.rb +8 -0
  243. data/app/models/maglev/setting_types/collection_item.rb +5 -1
  244. data/app/models/maglev/setting_types/image.rb +4 -0
  245. data/app/models/maglev/setting_types/link.rb +4 -0
  246. data/app/models/maglev/setting_types/text.rb +5 -0
  247. data/app/models/maglev/site/locales_concern.rb +4 -0
  248. data/app/models/maglev/site/style_value.rb +19 -13
  249. data/app/models/maglev/site.rb +4 -0
  250. data/app/models/maglev/theme/section_category.rb +6 -1
  251. data/app/models/maglev/theme/style_setting.rb +1 -1
  252. data/app/models/maglev/theme.rb +13 -0
  253. data/app/services/concerns/maglev/content/helpers_concern.rb +100 -0
  254. data/app/services/concerns/maglev/get_page_sections/transform_section_concern.rb +97 -0
  255. data/app/services/maglev/app_container.rb +27 -2
  256. data/app/services/maglev/content/add_section_block_service.rb +53 -0
  257. data/app/services/maglev/content/add_section_service.rb +99 -0
  258. data/app/services/maglev/content/delete_section_block_service.rb +45 -0
  259. data/app/services/maglev/content/delete_section_service.rb +34 -0
  260. data/app/services/maglev/content/sort_section_blocks_service.rb +47 -0
  261. data/app/services/maglev/content/update_section_block_service.rb +52 -0
  262. data/app/services/maglev/content/update_section_service.rb +50 -0
  263. data/app/services/maglev/create_page_service.rb +39 -0
  264. data/app/services/maglev/fetch_style.rb +22 -12
  265. data/app/services/maglev/get_base_url.rb +3 -1
  266. data/app/services/maglev/get_page_section_names.rb +1 -1
  267. data/app/services/maglev/get_page_sections.rb +11 -82
  268. data/app/services/maglev/get_published_page_sections_service.rb +48 -0
  269. data/app/services/maglev/persist_section_screenshot.rb +1 -1
  270. data/app/services/maglev/persist_style_service.rb +36 -0
  271. data/app/services/maglev/publish_service.rb +30 -0
  272. data/app/services/maglev/search_pages.rb +6 -2
  273. data/app/services/maglev/setup_pages.rb +44 -33
  274. data/app/views/layouts/maglev/editor/_head.html.erb +0 -0
  275. data/app/views/layouts/maglev/editor/_sidebar.html.erb +39 -0
  276. data/app/views/layouts/maglev/editor/_topbar.html.erb +45 -0
  277. data/app/views/layouts/maglev/editor/application.html.erb +67 -0
  278. data/app/views/maglev/editor/assets/_list.html.erb +33 -0
  279. data/app/views/maglev/editor/assets/index.html.erb +29 -0
  280. data/app/views/maglev/editor/combobox/collection_items/index.turbo_stream.erb +18 -0
  281. data/app/views/maglev/editor/combobox/pages/index.turbo_stream.erb +7 -0
  282. data/app/views/maglev/editor/home/index.html.erb +1 -0
  283. data/app/views/maglev/editor/icons/_list.html.erb +27 -0
  284. data/app/views/maglev/editor/icons/index.html.erb +23 -0
  285. data/app/views/maglev/editor/links/edit/_email.html.erb +5 -0
  286. data/app/views/maglev/editor/links/edit/_page.html.erb +29 -0
  287. data/app/views/maglev/editor/links/edit/_tabs.html.erb +11 -0
  288. data/app/views/maglev/editor/links/edit/_url.html.erb +7 -0
  289. data/app/views/maglev/editor/links/edit.html.erb +31 -0
  290. data/app/views/maglev/editor/links/update.turbo_stream.erb +9 -0
  291. data/app/views/maglev/editor/pages/_list.html.erb +28 -0
  292. data/app/views/maglev/editor/pages/_preview.html.erb +35 -0
  293. data/app/views/maglev/editor/pages/_preview_empty_message.html.erb +14 -0
  294. data/app/views/maglev/editor/pages/edit.html.erb +32 -0
  295. data/app/views/maglev/editor/pages/form/_main.html.erb +7 -0
  296. data/app/views/maglev/editor/pages/form/_seo.html.erb +11 -0
  297. data/app/views/maglev/editor/pages/form/_tabs.html.erb +8 -0
  298. data/app/views/maglev/editor/pages/index.html.erb +23 -0
  299. data/app/views/maglev/editor/pages/new.html.erb +28 -0
  300. data/app/views/maglev/editor/publication/create.turbo_stream.erb +1 -0
  301. data/app/views/maglev/editor/section_blocks/_form.html.erb +15 -0
  302. data/app/views/maglev/editor/section_blocks/_new.html.erb +21 -0
  303. data/app/views/maglev/editor/section_blocks/edit.html.erb +28 -0
  304. data/app/views/maglev/editor/section_blocks/index/_list.html.erb +41 -0
  305. data/app/views/maglev/editor/section_blocks/index/_tree.html.erb +56 -0
  306. data/app/views/maglev/editor/section_blocks/index.html.erb +20 -0
  307. data/app/views/maglev/editor/section_blocks/update.turbo_stream.erb +5 -0
  308. data/app/views/maglev/editor/sections/_form.html.erb +21 -0
  309. data/app/views/maglev/editor/sections/_list.html.erb +50 -0
  310. data/app/views/maglev/editor/sections/_theme_list.html.erb +32 -0
  311. data/app/views/maglev/editor/sections/_toolbar_list.html.erb +17 -0
  312. data/app/views/maglev/editor/sections/edit.html.erb +24 -0
  313. data/app/views/maglev/editor/sections/index.html.erb +11 -0
  314. data/app/views/maglev/editor/sections/new.html.erb +20 -0
  315. data/app/views/maglev/editor/sections/update.turbo_stream.erb +5 -0
  316. data/app/views/maglev/editor/shared/_button_label.html.erb +18 -0
  317. data/app/views/maglev/editor/shared/errors/not_authorized_error.turbo_stream.erb +17 -0
  318. data/app/views/maglev/editor/shared/errors/stale_object_error.turbo_stream.erb +21 -0
  319. data/app/views/maglev/editor/shared/errors/standard_error.turbo_stream.erb +17 -0
  320. data/app/views/maglev/editor/style/edit.html.erb +24 -0
  321. data/app/views/maglev/sitemap/index.xml.builder +1 -1
  322. data/config/client_importmap.rb +4 -0
  323. data/config/editor_importmap.rb +26 -0
  324. data/config/initializers/pagy.rb +3 -0
  325. data/config/locales/activerecord.ar.yml +20 -2
  326. data/config/locales/activerecord.en.yml +20 -2
  327. data/config/locales/activerecord.es.yml +15 -14
  328. data/config/locales/activerecord.fr.yml +15 -14
  329. data/config/locales/activerecord.pt-BR.yml +22 -4
  330. data/config/locales/editor.ar.yml +268 -0
  331. data/config/locales/editor.en.yml +268 -0
  332. data/config/locales/editor.es.yml +268 -0
  333. data/config/locales/editor.fr.yml +268 -0
  334. data/config/locales/editor.pt-BR.yml +268 -0
  335. data/config/locales/uikit.ar.yml +14 -0
  336. data/config/locales/uikit.en.yml +14 -0
  337. data/config/locales/uikit.es.yml +14 -0
  338. data/config/locales/uikit.fr.yml +14 -0
  339. data/config/locales/uikit.pt-BR.yml +14 -0
  340. data/config/routes.rb +34 -35
  341. data/db/migrate/20250929203214_create_maglev_sections_content_stores.rb +21 -0
  342. data/exe/tailwind-cli +29 -0
  343. data/lib/commands/maglev/publish_site_command.rb +46 -0
  344. data/lib/generators/maglev/install_generator.rb +1 -6
  345. data/lib/generators/maglev/templates/install/config/initializers/maglev.rb +6 -2
  346. data/lib/generators/maglev/templates/theme/app/views/theme/layout.html.erb.tt +2 -2
  347. data/lib/maglev/config.rb +2 -1
  348. data/lib/maglev/engine.rb +34 -42
  349. data/lib/maglev/errors.rb +3 -0
  350. data/lib/maglev/version.rb +1 -1
  351. data/lib/maglev.rb +3 -1
  352. data/lib/tasks/maglev/tailwindcss.rake +38 -0
  353. data/lib/tasks/maglev_tasks.rake +4 -23
  354. data/vendor/javascript/@floating-ui--core.js +4 -0
  355. data/vendor/javascript/@floating-ui--dom.js +12 -0
  356. data/vendor/javascript/@floating-ui--utils--dom.js +4 -0
  357. data/vendor/javascript/@floating-ui--utils.js +4 -0
  358. data/vendor/javascript/@hotwired--stimulus.js +4 -0
  359. data/vendor/javascript/@hotwired--turbo-rails.js +4 -0
  360. data/vendor/javascript/@hotwired--turbo.js +458 -0
  361. data/vendor/javascript/@rails--actioncable--src.js +4 -0
  362. data/vendor/javascript/@rails--request.js.js +4 -0
  363. data/vendor/javascript/@shopify--draggable.js +4 -0
  364. data/vendor/javascript/el-transition.js +4 -0
  365. data/vendor/javascript/stimulus-use.js +4 -0
  366. data/vendor/javascript/tiptap.bundle.js +1 -0
  367. metadata +363 -342
  368. data/.babelrc +0 -9
  369. data/.yarn/install-state.gz +0 -0
  370. data/.yarn/releases/yarn-4.4.0.cjs +0 -925
  371. data/.yarnrc.yml +0 -3
  372. data/app/controllers/maglev/admin/base_controller.rb +0 -20
  373. data/app/controllers/maglev/admin/dashboard_controller.rb +0 -11
  374. data/app/controllers/maglev/admin/sections/previews_controller.rb +0 -52
  375. data/app/controllers/maglev/admin/sections/screenshots_controller.rb +0 -17
  376. data/app/controllers/maglev/admin/themes_controller.rb +0 -19
  377. data/app/controllers/maglev/api/assets_controller.rb +0 -44
  378. data/app/controllers/maglev/api/collection_items_controller.rb +0 -21
  379. data/app/controllers/maglev/api/page_clones_controller.rb +0 -21
  380. data/app/controllers/maglev/api/pages_controller.rb +0 -65
  381. data/app/controllers/maglev/api/publications_controller.rb +0 -15
  382. data/app/controllers/maglev/api/sites_controller.rb +0 -21
  383. data/app/controllers/maglev/api_controller.rb +0 -61
  384. data/app/controllers/maglev/editor_controller.rb +0 -59
  385. data/app/frontend/admin/controllers/dropdown_controller.js +0 -9
  386. data/app/frontend/admin/controllers/iframe_controller.js +0 -16
  387. data/app/frontend/admin/controllers/screenshot_controller.js +0 -69
  388. data/app/frontend/admin/index.js +0 -10
  389. data/app/frontend/admin/utils/axios.js +0 -16
  390. data/app/frontend/editor/App.vue +0 -43
  391. data/app/frontend/editor/assets/remixicons/add-box-line.svg +0 -1
  392. data/app/frontend/editor/assets/remixicons/arrow-down-s-line.svg +0 -1
  393. data/app/frontend/editor/assets/remixicons/arrow-drop-left.svg +0 -1
  394. data/app/frontend/editor/assets/remixicons/arrow-drop-right.svg +0 -1
  395. data/app/frontend/editor/assets/remixicons/arrow-up-s-line.svg +0 -1
  396. data/app/frontend/editor/assets/remixicons/camera-line.svg +0 -1
  397. data/app/frontend/editor/assets/remixicons/clipboard-line.svg +0 -1
  398. data/app/frontend/editor/assets/remixicons/close-line.svg +0 -1
  399. data/app/frontend/editor/assets/remixicons/computer-line.svg +0 -1
  400. data/app/frontend/editor/assets/remixicons/delete-bin-line.svg +0 -1
  401. data/app/frontend/editor/assets/remixicons/file-line.svg +0 -1
  402. data/app/frontend/editor/assets/remixicons/format-blockquote.svg +0 -1
  403. data/app/frontend/editor/assets/remixicons/format-bold.svg +0 -1
  404. data/app/frontend/editor/assets/remixicons/format-code.svg +0 -1
  405. data/app/frontend/editor/assets/remixicons/format-heading-2.svg +0 -1
  406. data/app/frontend/editor/assets/remixicons/format-heading-3.svg +0 -1
  407. data/app/frontend/editor/assets/remixicons/format-heading-4.svg +0 -1
  408. data/app/frontend/editor/assets/remixicons/format-italic.svg +0 -1
  409. data/app/frontend/editor/assets/remixicons/format-link-unlink.svg +0 -1
  410. data/app/frontend/editor/assets/remixicons/format-link.svg +0 -1
  411. data/app/frontend/editor/assets/remixicons/format-list-ordered.svg +0 -1
  412. data/app/frontend/editor/assets/remixicons/format-list-unordered.svg +0 -1
  413. data/app/frontend/editor/assets/remixicons/format-paragraph.svg +0 -1
  414. data/app/frontend/editor/assets/remixicons/format-strikethrough.svg +0 -1
  415. data/app/frontend/editor/assets/remixicons/format-superscript.svg +0 -1
  416. data/app/frontend/editor/assets/remixicons/format-underline.svg +0 -1
  417. data/app/frontend/editor/assets/remixicons/home-4-line.svg +0 -1
  418. data/app/frontend/editor/assets/remixicons/image-line.svg +0 -1
  419. data/app/frontend/editor/assets/remixicons/logout-box-r-line.svg +0 -1
  420. data/app/frontend/editor/assets/remixicons/ri-add-line.svg +0 -1
  421. data/app/frontend/editor/assets/remixicons/ri-alert-line.svg +0 -1
  422. data/app/frontend/editor/assets/remixicons/ri-book-line.svg +0 -1
  423. data/app/frontend/editor/assets/remixicons/ri-bug-line.svg +0 -1
  424. data/app/frontend/editor/assets/remixicons/ri-check-line.svg +0 -1
  425. data/app/frontend/editor/assets/remixicons/ri-close-circle-line.svg +0 -1
  426. data/app/frontend/editor/assets/remixicons/ri-close-line.svg +0 -1
  427. data/app/frontend/editor/assets/remixicons/ri-delete-column.svg +0 -1
  428. data/app/frontend/editor/assets/remixicons/ri-delete-row.svg +0 -1
  429. data/app/frontend/editor/assets/remixicons/ri-draggable.svg +0 -1
  430. data/app/frontend/editor/assets/remixicons/ri-drop-line.svg +0 -1
  431. data/app/frontend/editor/assets/remixicons/ri-external-link-line.svg +0 -1
  432. data/app/frontend/editor/assets/remixicons/ri-eye-line.svg +0 -1
  433. data/app/frontend/editor/assets/remixicons/ri-eye-off-line.svg +0 -1
  434. data/app/frontend/editor/assets/remixicons/ri-file-copy-line.svg +0 -1
  435. data/app/frontend/editor/assets/remixicons/ri-file-line.svg +0 -1
  436. data/app/frontend/editor/assets/remixicons/ri-folders-line.svg +0 -1
  437. data/app/frontend/editor/assets/remixicons/ri-global-line.svg +0 -1
  438. data/app/frontend/editor/assets/remixicons/ri-insert-column-left.svg +0 -1
  439. data/app/frontend/editor/assets/remixicons/ri-insert-column-right.svg +0 -1
  440. data/app/frontend/editor/assets/remixicons/ri-insert-row-bottom.svg +0 -1
  441. data/app/frontend/editor/assets/remixicons/ri-insert-row-top.svg +0 -1
  442. data/app/frontend/editor/assets/remixicons/ri-loader-4-line.svg +0 -1
  443. data/app/frontend/editor/assets/remixicons/ri-mail-line.svg +0 -1
  444. data/app/frontend/editor/assets/remixicons/ri-more-2-fill.svg +0 -1
  445. data/app/frontend/editor/assets/remixicons/ri-more-fill.svg +0 -1
  446. data/app/frontend/editor/assets/remixicons/ri-palette-line.svg +0 -1
  447. data/app/frontend/editor/assets/remixicons/ri-pencil-line.svg +0 -1
  448. data/app/frontend/editor/assets/remixicons/ri-play-list-add-line.svg +0 -1
  449. data/app/frontend/editor/assets/remixicons/ri-settings-5-line.svg +0 -1
  450. data/app/frontend/editor/assets/remixicons/ri-shadow-line.svg +0 -1
  451. data/app/frontend/editor/assets/remixicons/ri-stack-line.svg +0 -1
  452. data/app/frontend/editor/assets/remixicons/ri-table-2.svg +0 -1
  453. data/app/frontend/editor/assets/remixicons/ri-table-line.svg +0 -1
  454. data/app/frontend/editor/assets/remixicons/search-line.svg +0 -1
  455. data/app/frontend/editor/assets/remixicons/settings-4-line.svg +0 -1
  456. data/app/frontend/editor/assets/remixicons/smartphone-line.svg +0 -1
  457. data/app/frontend/editor/assets/remixicons/tablet-line.svg +0 -1
  458. data/app/frontend/editor/components/dynamic-form/dynamic-input.vue +0 -142
  459. data/app/frontend/editor/components/dynamic-form/index.vue +0 -36
  460. data/app/frontend/editor/components/errors/forbidden.vue +0 -24
  461. data/app/frontend/editor/components/errors/stale-record.vue +0 -24
  462. data/app/frontend/editor/components/header-nav/device-toggler.vue +0 -40
  463. data/app/frontend/editor/components/header-nav/index.vue +0 -77
  464. data/app/frontend/editor/components/header-nav/locale-toggler/index.vue +0 -51
  465. data/app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue +0 -32
  466. data/app/frontend/editor/components/header-nav/page-info.vue +0 -41
  467. data/app/frontend/editor/components/header-nav/preview-button.vue +0 -20
  468. data/app/frontend/editor/components/header-nav/preview-toggler.vue +0 -40
  469. data/app/frontend/editor/components/header-nav/publish-button.vue +0 -77
  470. data/app/frontend/editor/components/header-nav/save-button.vue +0 -33
  471. data/app/frontend/editor/components/header-nav/separator.vue +0 -11
  472. data/app/frontend/editor/components/icon-library/index.vue +0 -39
  473. data/app/frontend/editor/components/image-library/index.vue +0 -107
  474. data/app/frontend/editor/components/image-library/list-item.vue +0 -93
  475. data/app/frontend/editor/components/image-library/list.vue +0 -26
  476. data/app/frontend/editor/components/image-library/uploader.vue +0 -76
  477. data/app/frontend/editor/components/kit/accordion.vue +0 -68
  478. data/app/frontend/editor/components/kit/checkbox-input.vue +0 -59
  479. data/app/frontend/editor/components/kit/collection-item-input.vue +0 -79
  480. data/app/frontend/editor/components/kit/color-input/core-input.vue +0 -92
  481. data/app/frontend/editor/components/kit/color-input/preset-button.vue +0 -61
  482. data/app/frontend/editor/components/kit/color-input/preset-dropdown.vue +0 -47
  483. data/app/frontend/editor/components/kit/color-input.vue +0 -41
  484. data/app/frontend/editor/components/kit/confirmation-button.vue +0 -65
  485. data/app/frontend/editor/components/kit/copy-paste-button.vue +0 -26
  486. data/app/frontend/editor/components/kit/divider.vue +0 -22
  487. data/app/frontend/editor/components/kit/dropdown.vue +0 -66
  488. data/app/frontend/editor/components/kit/hint.vue +0 -12
  489. data/app/frontend/editor/components/kit/icon-button.vue +0 -24
  490. data/app/frontend/editor/components/kit/icon-input.vue +0 -96
  491. data/app/frontend/editor/components/kit/icon.vue +0 -36
  492. data/app/frontend/editor/components/kit/image-input.vue +0 -124
  493. data/app/frontend/editor/components/kit/index.js +0 -56
  494. data/app/frontend/editor/components/kit/link-input.vue +0 -121
  495. data/app/frontend/editor/components/kit/modal-root.vue +0 -85
  496. data/app/frontend/editor/components/kit/modal.vue +0 -39
  497. data/app/frontend/editor/components/kit/page-icon.vue +0 -21
  498. data/app/frontend/editor/components/kit/pagination/button.vue +0 -35
  499. data/app/frontend/editor/components/kit/pagination/index.vue +0 -116
  500. data/app/frontend/editor/components/kit/rich-text-input/block-button.vue +0 -75
  501. data/app/frontend/editor/components/kit/rich-text-input/extensions/Doc.js +0 -12
  502. data/app/frontend/editor/components/kit/rich-text-input/extensions/LineBreak.js +0 -38
  503. data/app/frontend/editor/components/kit/rich-text-input/extensions/marks/Link.js +0 -57
  504. data/app/frontend/editor/components/kit/rich-text-input/extensions/marks/Superscript.js +0 -43
  505. data/app/frontend/editor/components/kit/rich-text-input/format-buttons.vue +0 -47
  506. data/app/frontend/editor/components/kit/rich-text-input/link-buttons.vue +0 -91
  507. data/app/frontend/editor/components/kit/rich-text-input/list-buttons.vue +0 -29
  508. data/app/frontend/editor/components/kit/rich-text-input/menu-button.vue +0 -22
  509. data/app/frontend/editor/components/kit/rich-text-input/table-button.vue +0 -112
  510. data/app/frontend/editor/components/kit/rich-text-input.vue +0 -187
  511. data/app/frontend/editor/components/kit/search-input.vue +0 -54
  512. data/app/frontend/editor/components/kit/select-input.vue +0 -200
  513. data/app/frontend/editor/components/kit/simple-select.vue +0 -63
  514. data/app/frontend/editor/components/kit/submit-button.vue +0 -117
  515. data/app/frontend/editor/components/kit/tabs.vue +0 -99
  516. data/app/frontend/editor/components/kit/text-input.vue +0 -63
  517. data/app/frontend/editor/components/kit/textarea-input.vue +0 -61
  518. data/app/frontend/editor/components/link-picker/actions.vue +0 -32
  519. data/app/frontend/editor/components/link-picker/email.vue +0 -32
  520. data/app/frontend/editor/components/link-picker/index.vue +0 -97
  521. data/app/frontend/editor/components/link-picker/page.vue +0 -126
  522. data/app/frontend/editor/components/link-picker/url.vue +0 -43
  523. data/app/frontend/editor/components/page/edit.vue +0 -99
  524. data/app/frontend/editor/components/page/form/main.vue +0 -64
  525. data/app/frontend/editor/components/page/form/seo.vue +0 -94
  526. data/app/frontend/editor/components/page/list/actions-button.vue +0 -159
  527. data/app/frontend/editor/components/page/list/index.vue +0 -58
  528. data/app/frontend/editor/components/page/list/list-item.vue +0 -96
  529. data/app/frontend/editor/components/page/new.vue +0 -79
  530. data/app/frontend/editor/components/section-block-pane/index.vue +0 -69
  531. data/app/frontend/editor/components/section-block-pane/setting-list.vue +0 -53
  532. data/app/frontend/editor/components/section-highlighter/bottom-actions.vue +0 -60
  533. data/app/frontend/editor/components/section-highlighter/index.vue +0 -125
  534. data/app/frontend/editor/components/section-highlighter/top-left-actions.vue +0 -78
  535. data/app/frontend/editor/components/section-highlighter/top-right-actions.vue +0 -130
  536. data/app/frontend/editor/components/section-list/add-button.vue +0 -39
  537. data/app/frontend/editor/components/section-list/index.vue +0 -79
  538. data/app/frontend/editor/components/section-list/list-item.vue +0 -60
  539. data/app/frontend/editor/components/section-pane/block-list/index.vue +0 -68
  540. data/app/frontend/editor/components/section-pane/block-list/list-item.vue +0 -74
  541. data/app/frontend/editor/components/section-pane/block-list/new-block-button.vue +0 -80
  542. data/app/frontend/editor/components/section-pane/block-tree/index.vue +0 -63
  543. data/app/frontend/editor/components/section-pane/block-tree/new-nested-block-button.vue +0 -73
  544. data/app/frontend/editor/components/section-pane/block-tree/tree-node.vue +0 -109
  545. data/app/frontend/editor/components/section-pane/index.vue +0 -94
  546. data/app/frontend/editor/components/section-pane/setting-list.vue +0 -50
  547. data/app/frontend/editor/components/sidebar-nav/index.vue +0 -102
  548. data/app/frontend/editor/components/sidebar-nav/link.vue +0 -60
  549. data/app/frontend/editor/components/style-pane/index.vue +0 -48
  550. data/app/frontend/editor/components/theme-section-list/category.vue +0 -47
  551. data/app/frontend/editor/components/theme-section-list/index.vue +0 -27
  552. data/app/frontend/editor/components/theme-section-list/list-item.vue +0 -95
  553. data/app/frontend/editor/design/application.scss +0 -17
  554. data/app/frontend/editor/design/components/buttons.scss +0 -25
  555. data/app/frontend/editor/design/components/modal.scss +0 -49
  556. data/app/frontend/editor/design/components/tooltip.scss +0 -123
  557. data/app/frontend/editor/design/components/tree.scss +0 -6
  558. data/app/frontend/editor/design/helpers.scss +0 -9
  559. data/app/frontend/editor/design/transitions.scss +0 -121
  560. data/app/frontend/editor/layouts/app.vue +0 -42
  561. data/app/frontend/editor/layouts/default.vue +0 -57
  562. data/app/frontend/editor/layouts/slide-pane.vue +0 -87
  563. data/app/frontend/editor/locales/editor.ar.json +0 -265
  564. data/app/frontend/editor/locales/editor.en.json +0 -265
  565. data/app/frontend/editor/locales/editor.es.json +0 -265
  566. data/app/frontend/editor/locales/editor.fr.json +0 -265
  567. data/app/frontend/editor/locales/editor.pt-BR.json +0 -265
  568. data/app/frontend/editor/locales/index.js +0 -23
  569. data/app/frontend/editor/main.js +0 -21
  570. data/app/frontend/editor/misc/__tests__/utils.spec.js +0 -43
  571. data/app/frontend/editor/misc/utils.js +0 -177
  572. data/app/frontend/editor/mixins/error-modal.js +0 -28
  573. data/app/frontend/editor/mixins/focused-input.js +0 -20
  574. data/app/frontend/editor/mixins/global.js +0 -140
  575. data/app/frontend/editor/mixins/grouped-dropdowns.js +0 -17
  576. data/app/frontend/editor/mixins/index.js +0 -1
  577. data/app/frontend/editor/mixins/preview-transformation.js +0 -59
  578. data/app/frontend/editor/plugins/event-bus.js +0 -3
  579. data/app/frontend/editor/plugins/filters.js +0 -7
  580. data/app/frontend/editor/plugins/i18n.js +0 -13
  581. data/app/frontend/editor/plugins/index.js +0 -3
  582. data/app/frontend/editor/plugins/tooltip.js +0 -4
  583. data/app/frontend/editor/router/index.js +0 -41
  584. data/app/frontend/editor/router/routes/base.js +0 -59
  585. data/app/frontend/editor/router/routes/index.js +0 -3
  586. data/app/frontend/editor/router/routes/page.js +0 -30
  587. data/app/frontend/editor/router/routes/section-block.js +0 -29
  588. data/app/frontend/editor/router/routes/section.js +0 -67
  589. data/app/frontend/editor/router/routes/style.js +0 -17
  590. data/app/frontend/editor/services/__tests__/page.spec.js +0 -38
  591. data/app/frontend/editor/services/__tests__/section.spec.js +0 -39
  592. data/app/frontend/editor/services/api.js +0 -40
  593. data/app/frontend/editor/services/block.js +0 -26
  594. data/app/frontend/editor/services/collection-item.js +0 -20
  595. data/app/frontend/editor/services/image.js +0 -26
  596. data/app/frontend/editor/services/index.js +0 -21
  597. data/app/frontend/editor/services/live-preview.js +0 -131
  598. data/app/frontend/editor/services/page.js +0 -107
  599. data/app/frontend/editor/services/section.js +0 -214
  600. data/app/frontend/editor/services/site.js +0 -21
  601. data/app/frontend/editor/services/theme.js +0 -9
  602. data/app/frontend/editor/spec/__mocks__/page.js +0 -434
  603. data/app/frontend/editor/spec/__mocks__/section.js +0 -232
  604. data/app/frontend/editor/spec/__mocks__/services.js +0 -84
  605. data/app/frontend/editor/spec/__mocks__/site.js +0 -95
  606. data/app/frontend/editor/spec/__mocks__/theme.js +0 -518
  607. data/app/frontend/editor/store/__tests__/getters.spec.js +0 -158
  608. data/app/frontend/editor/store/actions/__tests__/page.spec.js +0 -97
  609. data/app/frontend/editor/store/actions/__tests__/section-block.spec.js +0 -105
  610. data/app/frontend/editor/store/actions/__tests__/section.spec.js +0 -62
  611. data/app/frontend/editor/store/actions/index.js +0 -35
  612. data/app/frontend/editor/store/actions/page.js +0 -66
  613. data/app/frontend/editor/store/actions/section-block.js +0 -57
  614. data/app/frontend/editor/store/actions/section.js +0 -75
  615. data/app/frontend/editor/store/actions/site.js +0 -32
  616. data/app/frontend/editor/store/default-state.js +0 -27
  617. data/app/frontend/editor/store/getters.js +0 -113
  618. data/app/frontend/editor/store/index.js +0 -29
  619. data/app/frontend/editor/store/mutations.js +0 -187
  620. data/app/frontend/editor/views/content-pane.vue +0 -109
  621. data/app/frontend/editor/views/page-preview.vue +0 -160
  622. data/app/frontend/editor/views/pages/edit.vue +0 -26
  623. data/app/frontend/editor/views/pages/index.vue +0 -65
  624. data/app/frontend/editor/views/sections/add-pane.vue +0 -23
  625. data/app/frontend/editor/views/sections/list-pane.vue +0 -20
  626. data/app/frontend/editor/views/slide-pane.vue +0 -14
  627. data/app/frontend/editor/views/slide-pane2.vue +0 -14
  628. data/app/frontend/editor/views/style/edit-pane.vue +0 -22
  629. data/app/frontend/entrypoints/admin.js +0 -3
  630. data/app/frontend/entrypoints/admin.scss +0 -5
  631. data/app/frontend/entrypoints/editor.js +0 -8
  632. data/app/frontend/entrypoints/live-preview-client.js +0 -6
  633. data/app/frontend/entrypoints/live-preview-rails-client.js +0 -9
  634. data/app/frontend/live-preview-client/index.js +0 -11
  635. data/app/frontend/live-preview-client/rails.js +0 -217
  636. data/app/helpers/maglev/editor_helper.rb +0 -95
  637. data/app/services/maglev/persist_page.rb +0 -97
  638. data/app/views/layouts/maglev/admin/_header_actions.html.erb +0 -5
  639. data/app/views/layouts/maglev/admin/application.html.erb +0 -26
  640. data/app/views/maglev/admin/sections/previews/show.html.erb +0 -47
  641. data/app/views/maglev/admin/themes/_empty.html.erb +0 -20
  642. data/app/views/maglev/admin/themes/_section_categories.html.erb +0 -9
  643. data/app/views/maglev/admin/themes/_sections.html.erb +0 -54
  644. data/app/views/maglev/admin/themes/show.html.erb +0 -21
  645. data/app/views/maglev/api/_pagination.json.jbuilder +0 -6
  646. data/app/views/maglev/api/assets/_show.json.jbuilder +0 -8
  647. data/app/views/maglev/api/assets/index.json.jbuilder +0 -9
  648. data/app/views/maglev/api/assets/show.json.jbuilder +0 -3
  649. data/app/views/maglev/api/collection_items/_show.json.jbuilder +0 -5
  650. data/app/views/maglev/api/collection_items/index.json.jbuilder +0 -5
  651. data/app/views/maglev/api/collection_items/show.json.jbuilder +0 -7
  652. data/app/views/maglev/api/page_clones/create.json.jbuilder +0 -3
  653. data/app/views/maglev/api/pages/_show.json.jbuilder +0 -23
  654. data/app/views/maglev/api/pages/index.json.jbuilder +0 -18
  655. data/app/views/maglev/api/pages/show.json.jbuilder +0 -3
  656. data/app/views/maglev/api/sites/_show.json.jbuilder +0 -15
  657. data/app/views/maglev/api/sites/show.json.jbuilder +0 -3
  658. data/app/views/maglev/api/themes/_show.json.jbuilder +0 -17
  659. data/app/views/maglev/editor/_header.html.erb +0 -1
  660. data/app/views/maglev/editor/show.html.erb +0 -41
  661. data/app/views/maglev/settings/index.html.erb +0 -11
  662. data/bin/vite +0 -29
  663. data/config/initializers/kaminari.rb +0 -16
  664. data/config/vite.json +0 -17
  665. data/lib/tasks/maglev/vite.rake +0 -70
  666. data/package.json +0 -58
  667. data/postcss.config.cjs +0 -6
  668. data/tailwind.config.js +0 -68
  669. data/vite.config.ts +0 -18
  670. data/yarn.lock +0 -4749
  671. /data/app/{frontend/images → assets/images/maglev}/favicon.svg +0 -0
  672. /data/app/{frontend/images → assets/images/maglev}/logo.svg +0 -0
  673. /data/app/{frontend/live-preview-client → assets/javascripts/maglev/client}/run-scripts.js +0 -0
@@ -1,27 +0,0 @@
1
- export default {
2
- device: 'desktop',
3
- previewReady: false,
4
- site: null,
5
- style: null,
6
- locale: null,
7
- theme: null,
8
- page: null,
9
- section: null,
10
- sectionDefinition: null,
11
- hoveredSection: null,
12
- sectionBlock: null,
13
- sectionBlockDefinition: null,
14
- sections: {},
15
- sectionBlocks: {},
16
- editorSettings: {},
17
- touchedSections: [],
18
- ui: {
19
- saveButtonState: 'default',
20
- publishButtonState: {
21
- status: null,
22
- label: null,
23
- },
24
- openErrorModal: false,
25
- errorModalType: null,
26
- },
27
- }
@@ -1,113 +0,0 @@
1
- import { isBlank } from '@/misc/utils'
2
-
3
- export default (services) => ({
4
- currentPagePath: ({ page }) => {
5
- const nakedPath = page.liveUrl.startsWith('http') ? new URL(page.liveUrl).pathname : page.liveUrl
6
- return page.path === 'index' ? `${nakedPath}/index`.replace('//', '/') : nakedPath
7
- },
8
- currentPageUrl: ({ page }) => {
9
- if (page.liveUrl.startsWith('http')) return page.liveUrl
10
- return new URL(page.liveUrl, location.origin).toString()
11
- },
12
- sectionList: (
13
- { page, sections, sectionBlocks },
14
- { sectionDefinition: getSectiondefinition },
15
- ) => {
16
- const pageContent = services.page.denormalize(page, {
17
- sections,
18
- blocks: sectionBlocks,
19
- })
20
- if (!pageContent?.sections) return []
21
- return pageContent.sections.map((sectionContent) => {
22
- const sectionDefinition = getSectiondefinition(sectionContent)
23
- return {
24
- id: sectionContent.id,
25
- type: sectionContent['type'],
26
- name: sectionDefinition.name,
27
- label: services.section.getSectionLabel(sectionContent, sectionDefinition),
28
- viewportFixedPosition: !!sectionDefinition.viewportFixedPosition,
29
- }
30
- })
31
- },
32
- stickySectionList: (_, { sectionList }) => {
33
- return sectionList.filter((section) => section.viewportFixedPosition)
34
- },
35
- defaultPageAttributes: ({ page }) => {
36
- if (page.translated) return {}
37
- return { title: page.title, path: page.path }
38
- },
39
- content: (
40
- { page, sections, sectionBlocks, touchedSections },
41
- { sectionDefinition: getSectiondefinition },
42
- ) => {
43
- const pageContent = services.page.denormalize(page, {
44
- sections,
45
- blocks: sectionBlocks,
46
- })
47
-
48
- const siteSections = pageContent.sections.filter(
49
- (sectionContent) => getSectiondefinition(sectionContent).siteScoped,
50
- )
51
- const hasModifiedSiteScopedSections = siteSections.some(
52
- (sectionContent) => touchedSections.indexOf(sectionContent.id) !== -1,
53
- )
54
- return {
55
- pageSections: pageContent.sections,
56
- siteSections: hasModifiedSiteScopedSections ? siteSections : [],
57
- }
58
- },
59
- denormalizedSection: ({ page, sections, sectionBlocks, section }) => {
60
- const pageContent = services.page.denormalize(page, {
61
- sections,
62
- blocks: sectionBlocks,
63
- })
64
- return pageContent.sections.find((s) => s.id == section.id)
65
- },
66
- sectionContent: ({ section }) => {
67
- return section ? [...section.settings] : null
68
- },
69
- sectionDefinition:
70
- ({ theme }) =>
71
- (sectionContent) => {
72
- return theme.sections.find(
73
- (definition) => definition['id'] === sectionContent['type']
74
- )
75
- },
76
- sectionSettings:
77
- ({ sectionDefinition }) =>
78
- (advanced) => {
79
- return services.section.getSettings(sectionDefinition, advanced)
80
- },
81
- sectionBlocks: ({ sectionBlocks, section, sectionDefinition }) => {
82
- if (!section) return []
83
- return section.blocks
84
- .map((id) => {
85
- const sectionBlock = sectionBlocks[id]
86
- const definition = sectionDefinition.blocks.find(
87
- (def) => def.type === sectionBlock.type,
88
- )
89
- return definition ? sectionBlock : null
90
- })
91
- .filter((b) => b)
92
- },
93
- sectionBlockLabel:
94
- ({ sectionDefinition }) =>
95
- (sectionBlock, index) => {
96
- const definition = sectionDefinition.blocks.find(
97
- (def) => def.type === sectionBlock.type,
98
- )
99
- return services.section.getBlockLabel(sectionBlock, definition, index)
100
- },
101
- sectionBlockIndex: ({ section, sectionBlock }) => {
102
- // console.log(section.blocks, sectionBlock)
103
- return sectionBlock ? section.blocks.indexOf(sectionBlock.id) + 1 : null
104
- },
105
- sectionBlockContent: ({ sectionBlock }) => {
106
- return sectionBlock ? [...sectionBlock.settings] : null
107
- },
108
- sectionBlockSettings:
109
- ({ sectionBlockDefinition }) =>
110
- (advanced) => {
111
- return services.section.getSettings(sectionBlockDefinition, advanced)
112
- },
113
- })
@@ -1,29 +0,0 @@
1
- import Vue from 'vue'
2
- import Vuex from 'vuex'
3
- import defaultState from './default-state'
4
- import buildActions from './actions'
5
- import buildMutations from './mutations'
6
- import buildGetters from './getters'
7
- import services from '@/services'
8
-
9
- Vue.use(Vuex)
10
-
11
- const store = new Vuex.Store({
12
- strict: process.env.NODE_ENV !== 'production',
13
- state: { ...defaultState },
14
- mutations: buildMutations(services),
15
- actions: buildActions(services),
16
- getters: buildGetters(services),
17
- modules: {},
18
- })
19
-
20
- store.dispatch('fetchEditorSettings')
21
- store.dispatch('fetchSite', true)
22
- store.dispatch('setTheme', window.theme)
23
- store.dispatch('setPage', window.page)
24
- store.dispatch('setLocale', window.locale)
25
-
26
- if (store.state.editorSettings.sitePublishable)
27
- store.dispatch('pollLastPublication')
28
-
29
- export default store
@@ -1,187 +0,0 @@
1
- import { arraymove, pick, omitEmpty } from '@/misc/utils'
2
- import { SETTING_ATTRIBUTES as PAGE_SETTING_ATTRIBUTES } from '@/services/page'
3
-
4
- export default (services) => ({
5
- SET_DEVICE(state, value) {
6
- state.device = value
7
- },
8
- MARK_PREVIEW_AS_READY(state) {
9
- state.hoveredSection = null
10
- state.section = null
11
- state.previewReady = true
12
- },
13
- RESET_PREVIEW(state) {
14
- state.hoveredSection = null
15
- state.section = null
16
- state.previewReady = false
17
- },
18
- SET_EDITOR_SETTINGS(state, editorSettings) {
19
- state.editorSettings = editorSettings
20
- },
21
- SET_SITE(state, site) {
22
- state.site = site
23
- },
24
- SET_STYLE(state, style) {
25
- state.style = style
26
- },
27
- SET_LOCALE(state, locale) {
28
- state.locale = locale
29
- },
30
- SET_THEME(state, theme) {
31
- state.theme = theme
32
- },
33
- SET_PAGE(state, page) {
34
- const { entities } = services.page.normalize(page)
35
- state.page = entities.page[page.id]
36
- state.sections = { ...state.sections, ...entities.sections }
37
- state.sectionBlocks = { ...state.sectionBlocks, ...entities.blocks }
38
- state.hoveredSection = null
39
- },
40
- SET_PAGE_SETTINGS(state, page) {
41
- const attributes = pick(page, ...PAGE_SETTING_ATTRIBUTES)
42
- omitEmpty(attributes)
43
- state.page = { ...state.page, ...attributes }
44
- },
45
- SET_SECTION(state, section) {
46
- if (section) {
47
- const sectionDefinition = state.theme.sections.find(
48
- (definition) => definition['id'] === section['type'],
49
- )
50
- state.section = { ...section }
51
- state.sectionDefinition = { ...sectionDefinition }
52
- } else state.section = state.sectionDefinition = null
53
- },
54
- SET_HOVERED_SECTION(state, hoveredSection) {
55
- if (!hoveredSection) {
56
- state.hoveredSection = null
57
- } else {
58
- const section = state.sections[hoveredSection.sectionId]
59
- const definition = state.theme.sections.find(
60
- (definition) => definition['id'] === section['type'],
61
- )
62
- state.hoveredSection = {
63
- ...hoveredSection,
64
- name: definition.name,
65
- definition,
66
- }
67
- }
68
- },
69
- UPDATE_SECTION_CONTENT(state, change) {
70
- let updatedSection = { ...state.section }
71
- let newContent = { id: change.settingId, value: change.value }
72
- let contentIndex = updatedSection.settings.findIndex(
73
- (content) => content.id === newContent.id,
74
- )
75
-
76
- if (contentIndex === -1) updatedSection.settings.push(newContent)
77
- else updatedSection.settings[contentIndex] = newContent
78
-
79
- state.sections[state.section.id] = updatedSection
80
- state.section = updatedSection
81
- },
82
- ADD_SECTION(state, { section, insertAt }) {
83
- const {
84
- entities: { sections, blocks },
85
- } = services.section.normalize(section)
86
- state.sections = { ...state.sections, [section.id]: sections[section.id] }
87
- state.sectionBlocks = { ...state.sectionBlocks, ...blocks } // hmmm???
88
- const updatedPage = { ...state.page }
89
-
90
- switch (insertAt) {
91
- case 'top':
92
- updatedPage.sections.unshift(section.id)
93
- break
94
- case 'bottom':
95
- case undefined:
96
- case null:
97
- case '':
98
- updatedPage.sections.push(section.id)
99
- break
100
- default:
101
- updatedPage.sections.splice(
102
- updatedPage.sections.indexOf(insertAt) + 1,
103
- 0,
104
- section.id,
105
- )
106
- }
107
-
108
- state.page = updatedPage
109
- },
110
- REMOVE_SECTION(state, sectionId) {
111
- state.page.sections.splice(state.page.sections.indexOf(sectionId), 1)
112
- },
113
- MOVE_HOVERED_SECTION(state, { fromIndex, toIndex }) {
114
- state.page.sections = arraymove(state.page.sections, fromIndex, toIndex)
115
- },
116
- SET_SECTION_BLOCK(state, sectionBlock) {
117
- state.sectionBlock = sectionBlock
118
- state.sectionBlockDefinition = state.sectionDefinition.blocks.find(
119
- (definition) => definition.type === sectionBlock.type,
120
- )
121
- },
122
- ADD_SECTION_BLOCK(state, sectionBlock) {
123
- state.sectionBlocks = {
124
- ...state.sectionBlocks,
125
- [sectionBlock.id]: sectionBlock,
126
- }
127
- const updatedSection = { ...state.sections[state.section.id] }
128
- updatedSection.blocks.push(sectionBlock.id)
129
- state.sections = { ...state.sections, [updatedSection.id]: updatedSection }
130
- state.section = updatedSection
131
- },
132
- REMOVE_SECTION_BLOCK(state, sectionBlockId) {
133
- const updatedSection = { ...state.sections[state.section.id] }
134
- const index = updatedSection.blocks.indexOf(sectionBlockId)
135
- updatedSection.blocks.splice(index, 1)
136
- state.sections = { ...state.sections, [updatedSection.id]: updatedSection }
137
- state.section = updatedSection
138
- },
139
- SORT_SECTION_BLOCKS(state, list) {
140
- const sections = { ...state.sections }
141
- sections[state.section.id].blocks = list.map((block) => block.id)
142
- // in case we deal with a tree structure, update the parentId attribute only
143
- list.forEach(
144
- (block) => (state.sectionBlocks[block.id].parentId = block.parentId),
145
- )
146
- state.section = { ...sections[state.section.id] }
147
- state.sections = sections
148
- },
149
- UPDATE_SECTION_BLOCK_CONTENT(state, change) {
150
- let updatedBlock = { ...state.sectionBlocks[state.sectionBlock.id] }
151
- let newContent = { id: change.settingId, value: change.value }
152
- let contentIndex = updatedBlock.settings.findIndex(
153
- (content) => content.id === newContent.id,
154
- )
155
-
156
- if (contentIndex === -1) updatedBlock.settings.push(newContent)
157
- else updatedBlock.settings[contentIndex] = newContent
158
-
159
- state.sectionBlocks[state.sectionBlock.id] = updatedBlock
160
- state.sectionBlock = updatedBlock
161
- },
162
- TOUCH_SECTION(state, sectionId) {
163
- if (state.touchedSections.indexOf(sectionId) === -1) {
164
- const newArray = [...state.touchedSections]
165
- newArray.push(sectionId)
166
- state.touchedSections = newArray
167
- }
168
- },
169
- RESET_TOUCHED_SECTIONS(state) {
170
- state.touchedSections = []
171
- },
172
- // === UI ===
173
- SET_PUBLISH_BUTTON_STATE(state, newButton) {
174
- state.ui.publishButtonState = newButton
175
- },
176
- SET_SAVE_BUTTON_STATE(state, buttonState) {
177
- state.ui.saveButtonState = buttonState
178
- },
179
- OPEN_ERROR_MODAL(state, errorType) {
180
- state.ui.openErrorModal = true
181
- state.ui.errorModalType = errorType
182
- },
183
- CLEAR_ERROR_MODAL(state) {
184
- state.ui.openErrorModal = false
185
- state.ui.errorModalType = null
186
- },
187
- })
@@ -1,109 +0,0 @@
1
- <template>
2
- <layout
3
- :title="title"
4
- :overflowY="false"
5
- :max-width-pane="isMaxWidthPane"
6
- :with-pre-title="isSectionBlockVersion"
7
- >
8
- <template v-slot:pre-title v-if="isSectionBlockReady">
9
- <p class="text-gray-600 hover:text-gray-900">
10
- <router-link
11
- :to="{
12
- name: 'editSection',
13
- params: { sectionId: currentSection.id },
14
- hash: '#blocks',
15
- }"
16
- class="flex items-center"
17
- >
18
- <uikit-icon name="arrow-drop-left" />
19
- <span class="text-xs">{{ sectionTitle }}</span>
20
- </router-link>
21
- </p>
22
- </template>
23
-
24
- <section-pane :settingId="settingId" v-if="isSectionReady" />
25
- <section-block-pane :settingId="settingId" v-if="isSectionBlockReady" />
26
-
27
- <div
28
- class="mt-4 mx-4 text-lg rounded h-64 bg-gray-200 animate-pulse"
29
- v-if="!isSectionReady && !isSectionBlockReady"
30
- >
31
- &nbsp;
32
- </div>
33
- </layout>
34
- </template>
35
-
36
- <script>
37
- import Layout from '@/layouts/slide-pane.vue'
38
- import SectionPane from '@/components/section-pane/index.vue'
39
- import SectionBlockPane from '@/components/section-block-pane/index.vue'
40
-
41
- export default {
42
- name: 'ContentPane',
43
- components: { Layout, SectionPane, SectionBlockPane },
44
- props: {
45
- sectionId: { type: String, default: undefined },
46
- sectionBlockId: { type: String, default: undefined },
47
- settingId: { type: String, default: undefined },
48
- },
49
- computed: {
50
- title() {
51
- if (this.isSectionReady) return this.sectionTitle
52
- else if (this.isSectionBlockReady) return this.sectionBlockTitle
53
- else return null
54
- },
55
- sectionTitle() {
56
- return (
57
- this.$st(`${this.currentSectionI18nScope}.name`) ||
58
- this.currentSectionDefinition?.name
59
- )
60
- },
61
- sectionBlockTitle() {
62
- return (
63
- this.$st(`${this.currentSectionI18nScope}.blocks.label`) ||
64
- this.currentSectionBlockDefinition?.name +
65
- ' ' +
66
- `#${this.currentSectionBlockIndex}`
67
- )
68
- },
69
- isSectionReady() {
70
- return this.sectionId && this.currentSection
71
- },
72
- isSectionBlockVersion() {
73
- return !!this.sectionBlockId
74
- },
75
- isSectionBlockReady() {
76
- return this.isSectionBlockVersion && this.currentSectionBlock
77
- },
78
- isMaxWidthPane() {
79
- return !!this.currentSectionDefinition?.maxWidthPane
80
- },
81
- reactiveKey() {
82
- return [!!this.currentPage, !!this.previewReady, this.$route.path].join(
83
- '-',
84
- )
85
- },
86
- },
87
- destroyed() {
88
- this.fetchSection(null)
89
- },
90
- methods: {
91
- async fetch() {
92
- if (this.sectionBlockId) await this.fetchSectionBlock(this.sectionBlockId)
93
- else if (this.sectionId) await this.fetchSection(this.sectionId)
94
-
95
- if (!this.currentSection && !this.currentSectionBlock)
96
- this.$router.push({ name: 'editPage' })
97
- },
98
- },
99
- watch: {
100
- reactiveKey: {
101
- immediate: true,
102
- handler() {
103
- if (!this.currentPage || !this.previewReady) return // wait for the page to be loaded
104
- this.fetch()
105
- },
106
- },
107
- },
108
- }
109
- </script>
@@ -1,160 +0,0 @@
1
- <template>
2
- <div class="relative w-full h-full overflow-y-hidden">
3
- <div
4
- class="relative w-full h-full origin-top-left transition-all duration-100"
5
- :style="dynamicStyle"
6
- >
7
- <div
8
- class="flex h-full w-full justify-center items-center"
9
- :style="{ 'padding-left': `${loadingPaddingLeft}` }"
10
- v-if="!previewReady"
11
- >
12
- <p class="animate-bounce duration-200">
13
- {{ $t('pagePreview.loading') }}
14
- </p>
15
- </div>
16
-
17
- <div
18
- class="absolute inset-0 flex justify-center items-center"
19
- v-if="currentPage"
20
- >
21
- <div
22
- id="iframe-wrapper"
23
- class="transition-all duration-100 ease-in-out"
24
- :class="{ [deviceClass]: true, hidden: isPageEmpty }"
25
- :style="{ opacity: previewReady ? 1 : 0 }"
26
- >
27
- <iframe
28
- class="w-full h-full"
29
- :src="currentPage.previewUrl"
30
- @load="onIframeLoaded"
31
- ref="iframe"
32
- >
33
- </iframe>
34
- </div>
35
-
36
- <div
37
- class="transition-all duration-100 ease-in-out"
38
- :style="{ opacity: previewReady ? 1 : 0 }"
39
- v-if="isPageEmpty && previewReady"
40
- >
41
- <h2
42
- class="text-center text-4xl font-bold"
43
- v-if="numberOfLocales === 1"
44
- >
45
- {{ $t('pagePreview.empty.title.withoutLocale') }}
46
- </h2>
47
- <i18n
48
- path="pagePreview.empty.title.withLocale"
49
- tag="h2"
50
- class="text-center text-2xl font-bold"
51
- v-else
52
- >
53
- <template v-slot:localeName>
54
- <span
55
- class="capitalize-first bg-editor-primary bg-opacity-20 px-2"
56
- >{{ currentLocaleName }}</span
57
- >
58
- </template>
59
- </i18n>
60
-
61
- <i18n
62
- path="pagePreview.empty.message"
63
- tag="div"
64
- class="flex mt-4 text-gray-600"
65
- >
66
- <template v-slot:icon>
67
- <uikit-icon
68
- name="ri-stack-line"
69
- size="1.5rem"
70
- class="mx-1 text-black"
71
- />
72
- </template>
73
- </i18n>
74
- </div>
75
- </div>
76
- </div>
77
- <section-highlighter :hovered-section="hoveredSection" />
78
- </div>
79
- </template>
80
-
81
- <script>
82
- import { mapState } from 'vuex'
83
- import TransformationMixin from '@/mixins/preview-transformation'
84
- import SectionHighlighter from '@/components/section-highlighter/index.vue'
85
-
86
- export default {
87
- name: 'PagePreview',
88
- components: { SectionHighlighter },
89
- mixins: [TransformationMixin],
90
- props: {
91
- locale: { type: String, default: null },
92
- pageId: { type: String, default: null },
93
- },
94
- data() {
95
- return { loadingPaddingLeft: 0, previewScrollTop: 0 }
96
- },
97
- mounted() {
98
- this.loadingPaddingLeft = `${this.calculatePreviewLeftPadding()}px`
99
- },
100
- computed: {
101
- ...mapState(['hoveredSection']),
102
- isPageEmpty() {
103
- return this.currentSectionList.length === 0
104
- },
105
- numberOfLocales() {
106
- return this.currentSite.locales.length
107
- },
108
- currentLocaleName() {
109
- return this.currentSite.locales.find(
110
- (locale) => locale.prefix === this.currentLocale,
111
- ).label
112
- },
113
- deviceClass() {
114
- switch (this.device) {
115
- case 'mobile':
116
- return 'mobile'
117
- case 'tablet':
118
- return 'tablet'
119
- default:
120
- return 'desktop'
121
- }
122
- },
123
- dynamicStyle() {
124
- if (this.currentSection) {
125
- // not ideal to parse the DOM but we don't see any other methods for now
126
- let style = `transform: translateX(${this.previewLeftPadding}px) scale(${this.previewScaleRatio}); height: calc(100% * 1 / 1 / ${this.previewScaleRatio};`
127
-
128
- if (this.previewScaleRatio === 1)
129
- style += `width: ${this.previewPaneMaxWidth}px`
130
-
131
- return style
132
- } else return ''
133
- },
134
- },
135
- methods: {
136
- onIframeLoaded() {
137
- this.services.livePreview.start(this.$refs['iframe'])
138
- },
139
- },
140
- }
141
- </script>
142
-
143
- <style scoped>
144
- .mobile {
145
- width: 375px;
146
- height: 100%;
147
- /* max-height: 667px; */
148
- }
149
-
150
- .tablet {
151
- width: 1024px;
152
- height: 100%;
153
- /* max-height: 1366px; */
154
- }
155
-
156
- .desktop {
157
- width: 100%;
158
- height: 100%;
159
- }
160
- </style>
@@ -1,26 +0,0 @@
1
- <template>
2
- <layout :title="$t('page.edit.currentPage.title')" :overflowY="false">
3
- <div class="flex flex-col flex-1 pb-4 overflow-y-hidden">
4
- <edit-page
5
- :page="currentPage"
6
- v-if="currentPage"
7
- @on-update="updateCurrentPage"
8
- />
9
- </div>
10
- </layout>
11
- </template>
12
-
13
- <script>
14
- import Layout from '@/layouts/slide-pane.vue'
15
- import EditPage from '@/components/page/edit.vue'
16
-
17
- export default {
18
- name: 'EditPageView',
19
- components: { Layout, EditPage },
20
- methods: {
21
- updateCurrentPage(updatedPage) {
22
- this.setCurrentPageSettings(updatedPage)
23
- },
24
- },
25
- }
26
- </script>