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.
- checksums.yaml +4 -4
- data/README.md +53 -13
- data/Rakefile +0 -4
- data/app/assets/builds/maglev/tailwind.css +14393 -0
- data/app/assets/config/maglev_manifest.js +7 -0
- data/app/assets/javascripts/maglev/client/dom-operations.js +282 -0
- data/app/{frontend/live-preview-client → assets/javascripts/maglev/client}/iframe-decorator.js +81 -15
- data/app/{frontend/live-preview-client/message.js → assets/javascripts/maglev/client/incoming-messages.js} +14 -12
- data/app/assets/javascripts/maglev/client/index.js +26 -0
- data/app/{frontend/live-preview-client → assets/javascripts/maglev/client}/utils.js +4 -0
- data/app/assets/javascripts/maglev/editor/controllers/app/forms/section_form_controller.js +46 -0
- data/app/assets/javascripts/maglev/editor/controllers/app/forms/style_form_controller.js +19 -0
- data/app/assets/javascripts/maglev/editor/controllers/app/index.js +15 -0
- data/app/assets/javascripts/maglev/editor/controllers/app/page_preview_controller.js +163 -0
- data/app/assets/javascripts/maglev/editor/controllers/app/preview_notification_center_controller.js +151 -0
- data/app/assets/javascripts/maglev/editor/controllers/app/setting_controller.js +42 -0
- data/app/assets/javascripts/maglev/editor/controllers/application.js +9 -0
- data/app/assets/javascripts/maglev/editor/controllers/index.js +3 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/auto_save_controller.js +16 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/broken_image_controller.js +16 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/copy_to_clipboard_controller.js +36 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/disappearance_controller.js +21 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/dispatcher_controller.js +12 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/form_refresh_controller.js +15 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/index.js +27 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/max_length_controller.js +30 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/prevent_same_path.js +20 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/reload_page_controller.js +7 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/sortable_controller.js +64 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/submit_button_controller.js +45 -0
- data/app/assets/javascripts/maglev/editor/controllers/shared/transition_controller.js +14 -0
- data/app/assets/javascripts/maglev/editor/controllers/uikit.js +39 -0
- data/app/assets/javascripts/maglev/editor/controllers/utils.js +10 -0
- data/app/assets/javascripts/maglev/editor/index.js +66 -0
- data/app/assets/stylesheets/maglev/application.css +88 -0
- data/app/{frontend/editor/design/components/rich-text-editor.scss → assets/stylesheets/maglev/tailwind.css.erb} +30 -15
- data/app/components/maglev/editor/setting_registry.rb +59 -0
- data/app/components/maglev/editor/settings/base_component.rb +55 -0
- data/app/components/maglev/editor/settings/checkbox/checkbox_component.html.erb +16 -0
- data/app/components/maglev/editor/settings/checkbox/checkbox_component.rb +12 -0
- data/app/components/maglev/editor/settings/collection_item/collection_item_component.html.erb +25 -0
- data/app/components/maglev/editor/settings/collection_item/collection_item_component.rb +19 -0
- data/app/components/maglev/editor/settings/color/color_component.html.erb +17 -0
- data/app/components/maglev/editor/settings/color/color_component.rb +12 -0
- data/app/components/maglev/editor/settings/divider/divider_component.html.erb +12 -0
- data/app/components/maglev/editor/settings/divider/divider_component.rb +15 -0
- data/app/components/maglev/editor/settings/hint/hint_component.html.erb +3 -0
- data/app/components/maglev/editor/settings/hint/hint_component.rb +12 -0
- data/app/components/maglev/editor/settings/icon/icon_component.html.erb +21 -0
- data/app/components/maglev/editor/settings/icon/icon_component.rb +15 -0
- data/app/components/maglev/editor/settings/image/image_component.html.erb +26 -0
- data/app/components/maglev/editor/settings/image/image_component.rb +23 -0
- data/app/components/maglev/editor/settings/link/link_component.html.erb +22 -0
- data/app/components/maglev/editor/settings/link/link_component.rb +19 -0
- data/app/components/maglev/editor/settings/select/select_component.html.erb +20 -0
- data/app/components/maglev/editor/settings/select/select_component.rb +27 -0
- data/app/components/maglev/editor/settings/text/richtext_component.html.erb +22 -0
- data/app/components/maglev/editor/settings/text/richtext_component.rb +12 -0
- data/app/components/maglev/editor/settings/text/text_component.html.erb +18 -0
- data/app/components/maglev/editor/settings/text/text_component.rb +12 -0
- data/app/components/maglev/editor/settings/text/textarea_component.html.erb +21 -0
- data/app/components/maglev/editor/settings/text/textarea_component.rb +12 -0
- data/app/components/maglev/editor/settings_group_component.html.erb +5 -0
- data/app/components/maglev/editor/settings_group_component.rb +30 -0
- data/app/components/maglev/section_component.rb +10 -7
- data/app/components/maglev/uikit/app_layout/layout_component.html.erb +15 -0
- data/app/components/maglev/uikit/app_layout/layout_component.rb +19 -0
- data/app/components/maglev/uikit/app_layout/sidebar/link_component.html.erb +5 -0
- data/app/components/maglev/uikit/app_layout/sidebar/link_component.rb +40 -0
- data/app/components/maglev/uikit/app_layout/sidebar_component.html.erb +19 -0
- data/app/components/maglev/uikit/app_layout/sidebar_component.rb +11 -0
- data/app/components/maglev/uikit/app_layout/topbar/logo_component.html.erb +3 -0
- data/app/components/maglev/uikit/app_layout/topbar/logo_component.rb +18 -0
- data/app/components/maglev/uikit/app_layout/topbar/page_info_component.html.erb +26 -0
- data/app/components/maglev/uikit/app_layout/topbar/page_info_component.rb +28 -0
- data/app/components/maglev/uikit/app_layout/topbar_component.html.erb +15 -0
- data/app/components/maglev/uikit/app_layout/topbar_component.rb +21 -0
- data/app/components/maglev/uikit/badge_component.rb +40 -0
- data/app/components/maglev/uikit/base_component.rb +15 -0
- data/app/components/maglev/uikit/breadcrumbs/breadcrumbs_component.html.erb +10 -0
- data/app/components/maglev/uikit/breadcrumbs/breadcrumbs_component.rb +11 -0
- data/app/components/maglev/uikit/breadcrumbs/link_component.html.erb +12 -0
- data/app/components/maglev/uikit/breadcrumbs/link_component.rb +25 -0
- data/app/components/maglev/uikit/collapsible/collapsible_component.html.erb +5 -0
- data/app/components/maglev/uikit/collapsible/collapsible_component.rb +11 -0
- data/app/components/maglev/uikit/collapsible/collapsible_controller.js +9 -0
- data/app/components/maglev/uikit/collapsible/item_component.html.erb +17 -0
- data/app/components/maglev/uikit/collapsible/item_component.rb +11 -0
- data/app/components/maglev/uikit/device_toggler_component/device_toggler_component.html.erb +16 -0
- data/app/components/maglev/uikit/device_toggler_component/device_toggler_controller.js +25 -0
- data/app/components/maglev/uikit/device_toggler_component.rb +28 -0
- data/app/components/maglev/uikit/dropdown_component/dropdown_component.html.erb +18 -0
- data/app/components/maglev/uikit/dropdown_component/dropdown_controller.js +69 -0
- data/app/components/maglev/uikit/dropdown_component.rb +15 -0
- data/app/components/maglev/uikit/form/checkbox_component.html.erb +17 -0
- data/app/components/maglev/uikit/form/checkbox_component.rb +26 -0
- data/app/components/maglev/uikit/form/checkbox_controller.js +7 -0
- data/app/components/maglev/uikit/form/color_field_component.html.erb +76 -0
- data/app/components/maglev/uikit/form/color_field_component.rb +57 -0
- data/app/components/maglev/uikit/form/color_field_controller.js +25 -0
- data/app/components/maglev/uikit/form/combobox/list_component.html.erb +14 -0
- data/app/components/maglev/uikit/form/combobox/list_component.rb +13 -0
- data/app/components/maglev/uikit/form/combobox/option_component.html.erb +16 -0
- data/app/components/maglev/uikit/form/combobox/option_component.rb +22 -0
- data/app/components/maglev/uikit/form/combobox_component.html.erb +75 -0
- data/app/components/maglev/uikit/form/combobox_component.rb +64 -0
- data/app/components/maglev/uikit/form/combobox_controller.js +385 -0
- data/app/components/maglev/uikit/form/icon_field_component.html.erb +76 -0
- data/app/components/maglev/uikit/form/icon_field_component.rb +35 -0
- data/app/components/maglev/uikit/form/icon_field_controller.js +38 -0
- data/app/components/maglev/uikit/form/image_field_component.html.erb +101 -0
- data/app/components/maglev/uikit/form/image_field_component.rb +52 -0
- data/app/components/maglev/uikit/form/image_field_controller.js +74 -0
- data/app/components/maglev/uikit/form/link/base_component.rb +19 -0
- data/app/components/maglev/uikit/form/link/email_link_component.html.erb +16 -0
- data/app/components/maglev/uikit/form/link/email_link_component.rb +12 -0
- data/app/components/maglev/uikit/form/link/page_link_component.html.erb +17 -0
- data/app/components/maglev/uikit/form/link/page_link_component.rb +12 -0
- data/app/components/maglev/uikit/form/link/static_page_link_component.html.erb +16 -0
- data/app/components/maglev/uikit/form/link/static_page_link_component.rb +12 -0
- data/app/components/maglev/uikit/form/link/url_link_component.html.erb +16 -0
- data/app/components/maglev/uikit/form/link/url_link_component.rb +19 -0
- data/app/components/maglev/uikit/form/link_component.html.erb +55 -0
- data/app/components/maglev/uikit/form/link_component.rb +80 -0
- data/app/components/maglev/uikit/form/link_controller.js +36 -0
- data/app/components/maglev/uikit/form/richtext/block_button_component.html.erb +38 -0
- data/app/components/maglev/uikit/form/richtext/block_button_component.rb +22 -0
- data/app/components/maglev/uikit/form/richtext/button_component.html.erb +16 -0
- data/app/components/maglev/uikit/form/richtext/button_component.rb +19 -0
- data/app/components/maglev/uikit/form/richtext/button_group_component.html.erb +7 -0
- data/app/components/maglev/uikit/form/richtext/button_group_component.rb +13 -0
- data/app/components/maglev/uikit/form/richtext/toolbar_component.html.erb +23 -0
- data/app/components/maglev/uikit/form/richtext/toolbar_component.rb +19 -0
- data/app/components/maglev/uikit/form/richtext_component.html.erb +28 -0
- data/app/components/maglev/uikit/form/richtext_component.rb +54 -0
- data/app/components/maglev/uikit/form/richtext_controller.js +248 -0
- data/app/components/maglev/uikit/form/search_form_component.html.erb +24 -0
- data/app/components/maglev/uikit/form/search_form_component.rb +42 -0
- data/app/components/maglev/uikit/form/search_form_controller.js +31 -0
- data/app/components/maglev/uikit/form/select_component.html.erb +19 -0
- data/app/components/maglev/uikit/form/select_component.rb +52 -0
- data/app/components/maglev/uikit/form/select_controller.js +7 -0
- data/app/components/maglev/uikit/form/text_field_component.html.erb +26 -0
- data/app/components/maglev/uikit/form/text_field_component.rb +42 -0
- data/app/components/maglev/uikit/form/text_field_controller.js +18 -0
- data/app/components/maglev/uikit/form/textarea_component.html.erb +43 -0
- data/app/components/maglev/uikit/form/textarea_component.rb +53 -0
- data/app/components/maglev/uikit/icon_button_component/icon_button_component.html.erb +3 -0
- data/app/components/maglev/uikit/icon_button_component.rb +18 -0
- data/app/components/maglev/uikit/icon_component.rb +140 -0
- data/app/components/maglev/uikit/image_library/card_component.html.erb +41 -0
- data/app/components/maglev/uikit/image_library/card_component.rb +52 -0
- data/app/components/maglev/uikit/image_library/list_component.html.erb +7 -0
- data/app/components/maglev/uikit/image_library/list_component.rb +11 -0
- data/app/components/maglev/uikit/image_library/uploader_component.html.erb +30 -0
- data/app/components/maglev/uikit/image_library/uploader_component.rb +29 -0
- data/app/components/maglev/uikit/image_library/uploader_controller.js +74 -0
- data/app/components/maglev/uikit/list/insert_button_component.html.erb +7 -0
- data/app/components/maglev/uikit/list/insert_button_component.rb +40 -0
- data/app/components/maglev/uikit/list/list_component.html.erb +17 -0
- data/app/components/maglev/uikit/list/list_component.rb +34 -0
- data/app/components/maglev/uikit/list/list_item_component.html.erb +47 -0
- data/app/components/maglev/uikit/list/list_item_component.rb +85 -0
- data/app/components/maglev/uikit/locale_switcher_component/locale_switcher_component.html.erb +22 -0
- data/app/components/maglev/uikit/locale_switcher_component.rb +18 -0
- data/app/components/maglev/uikit/menu_dropdown_component/menu_dropdown_component.html.erb +15 -0
- data/app/components/maglev/uikit/menu_dropdown_component.rb +32 -0
- data/app/components/maglev/uikit/modal_component/modal_component.html.erb +63 -0
- data/app/components/maglev/uikit/modal_component/modal_controller.js +47 -0
- data/app/components/maglev/uikit/modal_component.rb +33 -0
- data/app/components/maglev/uikit/page_actions_dropdown_component/page_actions_dropdown_component.html.erb +56 -0
- data/app/components/maglev/uikit/page_actions_dropdown_component.rb +24 -0
- data/app/components/maglev/uikit/page_layout_component/back_link_component.html.erb +4 -0
- data/app/components/maglev/uikit/page_layout_component/page_layout_component.html.erb +58 -0
- data/app/components/maglev/uikit/page_layout_component/page_layout_controller.js +34 -0
- data/app/components/maglev/uikit/page_layout_component.rb +42 -0
- data/app/components/maglev/uikit/pagination_component/pagination_component.html.erb +70 -0
- data/app/components/maglev/uikit/pagination_component.rb +25 -0
- data/app/components/maglev/uikit/section_toolbar/bottom_component.html.erb +13 -0
- data/app/components/maglev/uikit/section_toolbar/bottom_component.rb +27 -0
- data/app/components/maglev/uikit/section_toolbar/section_toolbar_component.html.erb +17 -0
- data/app/components/maglev/uikit/section_toolbar/section_toolbar_component.rb +18 -0
- data/app/components/maglev/uikit/section_toolbar/section_toolbar_controller.js +90 -0
- data/app/components/maglev/uikit/section_toolbar/top_left_corner_component.html.erb +16 -0
- data/app/components/maglev/uikit/section_toolbar/top_left_corner_component.rb +15 -0
- data/app/components/maglev/uikit/section_toolbar/top_right_corner_component.html.erb +28 -0
- data/app/components/maglev/uikit/section_toolbar/top_right_corner_component.rb +28 -0
- data/app/components/maglev/uikit/tabs_component/tabs_component.html.erb +35 -0
- data/app/components/maglev/uikit/tabs_component/tabs_controller.js +57 -0
- data/app/components/maglev/uikit/tabs_component.rb +71 -0
- data/app/controllers/concerns/maglev/content_locale_concern.rb +5 -1
- data/app/controllers/concerns/maglev/editor/errors_concern.rb +45 -0
- data/app/controllers/concerns/maglev/fetchers_concern.rb +3 -6
- data/app/controllers/concerns/maglev/flash_i18n_concern.rb +11 -0
- data/app/controllers/maglev/application_controller.rb +1 -7
- data/app/controllers/maglev/editor/assets_controller.rb +59 -0
- data/app/controllers/maglev/editor/base_controller.rb +111 -0
- data/app/controllers/maglev/editor/combobox/collection_items_controller.rb +17 -0
- data/app/controllers/maglev/editor/combobox/pages_controller.rb +20 -0
- data/app/controllers/maglev/editor/home_controller.rb +25 -0
- data/app/controllers/maglev/editor/icons_controller.rb +24 -0
- data/app/controllers/maglev/editor/links_controller.rb +52 -0
- data/app/controllers/maglev/editor/page_clone_controller.rb +20 -0
- data/app/controllers/maglev/editor/pages_controller.rb +77 -0
- data/app/controllers/maglev/editor/publication_controller.rb +14 -0
- data/app/controllers/maglev/editor/section_blocks_controller.rb +101 -0
- data/app/controllers/maglev/editor/sections_controller.rb +96 -0
- data/app/controllers/maglev/editor/style_controller.rb +31 -0
- data/app/controllers/maglev/page_preview_controller.rb +1 -5
- data/app/controllers/maglev/published_page_preview_controller.rb +50 -0
- data/app/controllers/maglev/sitemap_controller.rb +1 -1
- data/app/helpers/maglev/application_helper.rb +148 -18
- data/app/helpers/maglev/editor/pages_helper.rb +23 -0
- data/app/helpers/maglev/editor/section_blocks_helper.rb +124 -0
- data/app/helpers/maglev/editor/settings_helper.rb +52 -0
- data/app/helpers/maglev/page_preview_helper.rb +1 -1
- data/app/lib/maglev/form/form_builder.rb +38 -0
- data/app/lib/maglev/form/inputs/check_box.rb +20 -0
- data/app/lib/maglev/form/inputs/combobox.rb +33 -0
- data/app/lib/maglev/form/inputs/image_field.rb +39 -0
- data/app/lib/maglev/form/inputs/richtext.rb +34 -0
- data/app/lib/maglev/form/inputs/select.rb +34 -0
- data/app/lib/maglev/form/inputs/text_field.rb +32 -0
- data/app/lib/maglev/form/inputs/textarea.rb +30 -0
- data/app/lib/maglev/turbo/streams/tag_builder.rb +17 -0
- data/app/models/concerns/maglev/content/enhanced_value_concern.rb +40 -0
- data/app/models/concerns/maglev/sections_concern.rb +30 -1
- data/app/models/concerns/maglev/translatable.rb +1 -2
- data/app/models/maglev/asset.rb +1 -3
- data/app/models/maglev/content/block_content.rb +96 -0
- data/app/models/maglev/content/editor_link.rb +49 -0
- data/app/models/maglev/content/section_content.rb +85 -0
- data/app/models/maglev/content/setting_content.rb +33 -0
- data/app/models/maglev/page/path_concern.rb +7 -0
- data/app/models/maglev/page/search_concern.rb +23 -4
- data/app/models/maglev/page.rb +3 -0
- data/app/models/maglev/section/block.rb +43 -6
- data/app/models/maglev/section/content_concern.rb +15 -1
- data/app/models/maglev/section/setting.rb +12 -0
- data/app/models/maglev/section.rb +52 -4
- data/app/models/maglev/sections_content_store.rb +36 -0
- data/app/models/maglev/setting_types/base.rb +8 -0
- data/app/models/maglev/setting_types/collection_item.rb +5 -1
- data/app/models/maglev/setting_types/image.rb +4 -0
- data/app/models/maglev/setting_types/link.rb +4 -0
- data/app/models/maglev/setting_types/text.rb +5 -0
- data/app/models/maglev/site/locales_concern.rb +4 -0
- data/app/models/maglev/site/style_value.rb +19 -13
- data/app/models/maglev/site.rb +4 -0
- data/app/models/maglev/theme/section_category.rb +6 -1
- data/app/models/maglev/theme/style_setting.rb +1 -1
- data/app/models/maglev/theme.rb +13 -0
- data/app/services/concerns/maglev/content/helpers_concern.rb +100 -0
- data/app/services/concerns/maglev/get_page_sections/transform_section_concern.rb +97 -0
- data/app/services/maglev/app_container.rb +27 -2
- data/app/services/maglev/content/add_section_block_service.rb +53 -0
- data/app/services/maglev/content/add_section_service.rb +99 -0
- data/app/services/maglev/content/delete_section_block_service.rb +45 -0
- data/app/services/maglev/content/delete_section_service.rb +34 -0
- data/app/services/maglev/content/sort_section_blocks_service.rb +47 -0
- data/app/services/maglev/content/update_section_block_service.rb +52 -0
- data/app/services/maglev/content/update_section_service.rb +50 -0
- data/app/services/maglev/create_page_service.rb +39 -0
- data/app/services/maglev/fetch_style.rb +22 -12
- data/app/services/maglev/get_base_url.rb +3 -1
- data/app/services/maglev/get_page_section_names.rb +1 -1
- data/app/services/maglev/get_page_sections.rb +11 -82
- data/app/services/maglev/get_published_page_sections_service.rb +48 -0
- data/app/services/maglev/persist_section_screenshot.rb +1 -1
- data/app/services/maglev/persist_style_service.rb +36 -0
- data/app/services/maglev/publish_service.rb +30 -0
- data/app/services/maglev/search_pages.rb +6 -2
- data/app/services/maglev/setup_pages.rb +44 -33
- data/app/views/layouts/maglev/editor/_head.html.erb +0 -0
- data/app/views/layouts/maglev/editor/_sidebar.html.erb +39 -0
- data/app/views/layouts/maglev/editor/_topbar.html.erb +45 -0
- data/app/views/layouts/maglev/editor/application.html.erb +67 -0
- data/app/views/maglev/editor/assets/_list.html.erb +33 -0
- data/app/views/maglev/editor/assets/index.html.erb +29 -0
- data/app/views/maglev/editor/combobox/collection_items/index.turbo_stream.erb +18 -0
- data/app/views/maglev/editor/combobox/pages/index.turbo_stream.erb +7 -0
- data/app/views/maglev/editor/home/index.html.erb +1 -0
- data/app/views/maglev/editor/icons/_list.html.erb +27 -0
- data/app/views/maglev/editor/icons/index.html.erb +23 -0
- data/app/views/maglev/editor/links/edit/_email.html.erb +5 -0
- data/app/views/maglev/editor/links/edit/_page.html.erb +29 -0
- data/app/views/maglev/editor/links/edit/_tabs.html.erb +11 -0
- data/app/views/maglev/editor/links/edit/_url.html.erb +7 -0
- data/app/views/maglev/editor/links/edit.html.erb +31 -0
- data/app/views/maglev/editor/links/update.turbo_stream.erb +9 -0
- data/app/views/maglev/editor/pages/_list.html.erb +28 -0
- data/app/views/maglev/editor/pages/_preview.html.erb +35 -0
- data/app/views/maglev/editor/pages/_preview_empty_message.html.erb +14 -0
- data/app/views/maglev/editor/pages/edit.html.erb +32 -0
- data/app/views/maglev/editor/pages/form/_main.html.erb +7 -0
- data/app/views/maglev/editor/pages/form/_seo.html.erb +11 -0
- data/app/views/maglev/editor/pages/form/_tabs.html.erb +8 -0
- data/app/views/maglev/editor/pages/index.html.erb +23 -0
- data/app/views/maglev/editor/pages/new.html.erb +28 -0
- data/app/views/maglev/editor/publication/create.turbo_stream.erb +1 -0
- data/app/views/maglev/editor/section_blocks/_form.html.erb +15 -0
- data/app/views/maglev/editor/section_blocks/_new.html.erb +21 -0
- data/app/views/maglev/editor/section_blocks/edit.html.erb +28 -0
- data/app/views/maglev/editor/section_blocks/index/_list.html.erb +41 -0
- data/app/views/maglev/editor/section_blocks/index/_tree.html.erb +56 -0
- data/app/views/maglev/editor/section_blocks/index.html.erb +20 -0
- data/app/views/maglev/editor/section_blocks/update.turbo_stream.erb +5 -0
- data/app/views/maglev/editor/sections/_form.html.erb +21 -0
- data/app/views/maglev/editor/sections/_list.html.erb +50 -0
- data/app/views/maglev/editor/sections/_theme_list.html.erb +32 -0
- data/app/views/maglev/editor/sections/_toolbar_list.html.erb +17 -0
- data/app/views/maglev/editor/sections/edit.html.erb +24 -0
- data/app/views/maglev/editor/sections/index.html.erb +11 -0
- data/app/views/maglev/editor/sections/new.html.erb +20 -0
- data/app/views/maglev/editor/sections/update.turbo_stream.erb +5 -0
- data/app/views/maglev/editor/shared/_button_label.html.erb +18 -0
- data/app/views/maglev/editor/shared/errors/not_authorized_error.turbo_stream.erb +17 -0
- data/app/views/maglev/editor/shared/errors/stale_object_error.turbo_stream.erb +21 -0
- data/app/views/maglev/editor/shared/errors/standard_error.turbo_stream.erb +17 -0
- data/app/views/maglev/editor/style/edit.html.erb +24 -0
- data/app/views/maglev/sitemap/index.xml.builder +1 -1
- data/config/client_importmap.rb +4 -0
- data/config/editor_importmap.rb +26 -0
- data/config/initializers/pagy.rb +3 -0
- data/config/locales/activerecord.ar.yml +20 -2
- data/config/locales/activerecord.en.yml +20 -2
- data/config/locales/activerecord.es.yml +15 -14
- data/config/locales/activerecord.fr.yml +15 -14
- data/config/locales/activerecord.pt-BR.yml +22 -4
- data/config/locales/editor.ar.yml +268 -0
- data/config/locales/editor.en.yml +268 -0
- data/config/locales/editor.es.yml +268 -0
- data/config/locales/editor.fr.yml +268 -0
- data/config/locales/editor.pt-BR.yml +268 -0
- data/config/locales/uikit.ar.yml +14 -0
- data/config/locales/uikit.en.yml +14 -0
- data/config/locales/uikit.es.yml +14 -0
- data/config/locales/uikit.fr.yml +14 -0
- data/config/locales/uikit.pt-BR.yml +14 -0
- data/config/routes.rb +34 -35
- data/db/migrate/20250929203214_create_maglev_sections_content_stores.rb +21 -0
- data/exe/tailwind-cli +29 -0
- data/lib/commands/maglev/publish_site_command.rb +46 -0
- data/lib/generators/maglev/install_generator.rb +1 -6
- data/lib/generators/maglev/templates/install/config/initializers/maglev.rb +6 -2
- data/lib/generators/maglev/templates/theme/app/views/theme/layout.html.erb.tt +2 -2
- data/lib/maglev/config.rb +2 -1
- data/lib/maglev/engine.rb +34 -42
- data/lib/maglev/errors.rb +3 -0
- data/lib/maglev/version.rb +1 -1
- data/lib/maglev.rb +3 -1
- data/lib/tasks/maglev/tailwindcss.rake +38 -0
- data/lib/tasks/maglev_tasks.rake +4 -23
- data/vendor/javascript/@floating-ui--core.js +4 -0
- data/vendor/javascript/@floating-ui--dom.js +12 -0
- data/vendor/javascript/@floating-ui--utils--dom.js +4 -0
- data/vendor/javascript/@floating-ui--utils.js +4 -0
- data/vendor/javascript/@hotwired--stimulus.js +4 -0
- data/vendor/javascript/@hotwired--turbo-rails.js +4 -0
- data/vendor/javascript/@hotwired--turbo.js +458 -0
- data/vendor/javascript/@rails--actioncable--src.js +4 -0
- data/vendor/javascript/@rails--request.js.js +4 -0
- data/vendor/javascript/@shopify--draggable.js +4 -0
- data/vendor/javascript/el-transition.js +4 -0
- data/vendor/javascript/stimulus-use.js +4 -0
- data/vendor/javascript/tiptap.bundle.js +1 -0
- metadata +363 -342
- data/.babelrc +0 -9
- data/.yarn/install-state.gz +0 -0
- data/.yarn/releases/yarn-4.4.0.cjs +0 -925
- data/.yarnrc.yml +0 -3
- data/app/controllers/maglev/admin/base_controller.rb +0 -20
- data/app/controllers/maglev/admin/dashboard_controller.rb +0 -11
- data/app/controllers/maglev/admin/sections/previews_controller.rb +0 -52
- data/app/controllers/maglev/admin/sections/screenshots_controller.rb +0 -17
- data/app/controllers/maglev/admin/themes_controller.rb +0 -19
- data/app/controllers/maglev/api/assets_controller.rb +0 -44
- data/app/controllers/maglev/api/collection_items_controller.rb +0 -21
- data/app/controllers/maglev/api/page_clones_controller.rb +0 -21
- data/app/controllers/maglev/api/pages_controller.rb +0 -65
- data/app/controllers/maglev/api/publications_controller.rb +0 -15
- data/app/controllers/maglev/api/sites_controller.rb +0 -21
- data/app/controllers/maglev/api_controller.rb +0 -61
- data/app/controllers/maglev/editor_controller.rb +0 -59
- data/app/frontend/admin/controllers/dropdown_controller.js +0 -9
- data/app/frontend/admin/controllers/iframe_controller.js +0 -16
- data/app/frontend/admin/controllers/screenshot_controller.js +0 -69
- data/app/frontend/admin/index.js +0 -10
- data/app/frontend/admin/utils/axios.js +0 -16
- data/app/frontend/editor/App.vue +0 -43
- data/app/frontend/editor/assets/remixicons/add-box-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/arrow-down-s-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/arrow-drop-left.svg +0 -1
- data/app/frontend/editor/assets/remixicons/arrow-drop-right.svg +0 -1
- data/app/frontend/editor/assets/remixicons/arrow-up-s-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/camera-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/clipboard-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/close-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/computer-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/delete-bin-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/file-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-blockquote.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-bold.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-code.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-heading-2.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-heading-3.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-heading-4.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-italic.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-link-unlink.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-link.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-list-ordered.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-list-unordered.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-paragraph.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-strikethrough.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-superscript.svg +0 -1
- data/app/frontend/editor/assets/remixicons/format-underline.svg +0 -1
- data/app/frontend/editor/assets/remixicons/home-4-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/image-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/logout-box-r-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-add-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-alert-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-book-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-bug-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-check-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-close-circle-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-close-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-delete-column.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-delete-row.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-draggable.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-drop-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-external-link-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-eye-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-eye-off-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-file-copy-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-file-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-folders-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-global-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-insert-column-left.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-insert-column-right.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-insert-row-bottom.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-insert-row-top.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-loader-4-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-mail-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-more-2-fill.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-more-fill.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-palette-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-pencil-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-play-list-add-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-settings-5-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-shadow-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-stack-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-table-2.svg +0 -1
- data/app/frontend/editor/assets/remixicons/ri-table-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/search-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/settings-4-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/smartphone-line.svg +0 -1
- data/app/frontend/editor/assets/remixicons/tablet-line.svg +0 -1
- data/app/frontend/editor/components/dynamic-form/dynamic-input.vue +0 -142
- data/app/frontend/editor/components/dynamic-form/index.vue +0 -36
- data/app/frontend/editor/components/errors/forbidden.vue +0 -24
- data/app/frontend/editor/components/errors/stale-record.vue +0 -24
- data/app/frontend/editor/components/header-nav/device-toggler.vue +0 -40
- data/app/frontend/editor/components/header-nav/index.vue +0 -77
- data/app/frontend/editor/components/header-nav/locale-toggler/index.vue +0 -51
- data/app/frontend/editor/components/header-nav/locale-toggler/locale-link.vue +0 -32
- data/app/frontend/editor/components/header-nav/page-info.vue +0 -41
- data/app/frontend/editor/components/header-nav/preview-button.vue +0 -20
- data/app/frontend/editor/components/header-nav/preview-toggler.vue +0 -40
- data/app/frontend/editor/components/header-nav/publish-button.vue +0 -77
- data/app/frontend/editor/components/header-nav/save-button.vue +0 -33
- data/app/frontend/editor/components/header-nav/separator.vue +0 -11
- data/app/frontend/editor/components/icon-library/index.vue +0 -39
- data/app/frontend/editor/components/image-library/index.vue +0 -107
- data/app/frontend/editor/components/image-library/list-item.vue +0 -93
- data/app/frontend/editor/components/image-library/list.vue +0 -26
- data/app/frontend/editor/components/image-library/uploader.vue +0 -76
- data/app/frontend/editor/components/kit/accordion.vue +0 -68
- data/app/frontend/editor/components/kit/checkbox-input.vue +0 -59
- data/app/frontend/editor/components/kit/collection-item-input.vue +0 -79
- data/app/frontend/editor/components/kit/color-input/core-input.vue +0 -92
- data/app/frontend/editor/components/kit/color-input/preset-button.vue +0 -61
- data/app/frontend/editor/components/kit/color-input/preset-dropdown.vue +0 -47
- data/app/frontend/editor/components/kit/color-input.vue +0 -41
- data/app/frontend/editor/components/kit/confirmation-button.vue +0 -65
- data/app/frontend/editor/components/kit/copy-paste-button.vue +0 -26
- data/app/frontend/editor/components/kit/divider.vue +0 -22
- data/app/frontend/editor/components/kit/dropdown.vue +0 -66
- data/app/frontend/editor/components/kit/hint.vue +0 -12
- data/app/frontend/editor/components/kit/icon-button.vue +0 -24
- data/app/frontend/editor/components/kit/icon-input.vue +0 -96
- data/app/frontend/editor/components/kit/icon.vue +0 -36
- data/app/frontend/editor/components/kit/image-input.vue +0 -124
- data/app/frontend/editor/components/kit/index.js +0 -56
- data/app/frontend/editor/components/kit/link-input.vue +0 -121
- data/app/frontend/editor/components/kit/modal-root.vue +0 -85
- data/app/frontend/editor/components/kit/modal.vue +0 -39
- data/app/frontend/editor/components/kit/page-icon.vue +0 -21
- data/app/frontend/editor/components/kit/pagination/button.vue +0 -35
- data/app/frontend/editor/components/kit/pagination/index.vue +0 -116
- data/app/frontend/editor/components/kit/rich-text-input/block-button.vue +0 -75
- data/app/frontend/editor/components/kit/rich-text-input/extensions/Doc.js +0 -12
- data/app/frontend/editor/components/kit/rich-text-input/extensions/LineBreak.js +0 -38
- data/app/frontend/editor/components/kit/rich-text-input/extensions/marks/Link.js +0 -57
- data/app/frontend/editor/components/kit/rich-text-input/extensions/marks/Superscript.js +0 -43
- data/app/frontend/editor/components/kit/rich-text-input/format-buttons.vue +0 -47
- data/app/frontend/editor/components/kit/rich-text-input/link-buttons.vue +0 -91
- data/app/frontend/editor/components/kit/rich-text-input/list-buttons.vue +0 -29
- data/app/frontend/editor/components/kit/rich-text-input/menu-button.vue +0 -22
- data/app/frontend/editor/components/kit/rich-text-input/table-button.vue +0 -112
- data/app/frontend/editor/components/kit/rich-text-input.vue +0 -187
- data/app/frontend/editor/components/kit/search-input.vue +0 -54
- data/app/frontend/editor/components/kit/select-input.vue +0 -200
- data/app/frontend/editor/components/kit/simple-select.vue +0 -63
- data/app/frontend/editor/components/kit/submit-button.vue +0 -117
- data/app/frontend/editor/components/kit/tabs.vue +0 -99
- data/app/frontend/editor/components/kit/text-input.vue +0 -63
- data/app/frontend/editor/components/kit/textarea-input.vue +0 -61
- data/app/frontend/editor/components/link-picker/actions.vue +0 -32
- data/app/frontend/editor/components/link-picker/email.vue +0 -32
- data/app/frontend/editor/components/link-picker/index.vue +0 -97
- data/app/frontend/editor/components/link-picker/page.vue +0 -126
- data/app/frontend/editor/components/link-picker/url.vue +0 -43
- data/app/frontend/editor/components/page/edit.vue +0 -99
- data/app/frontend/editor/components/page/form/main.vue +0 -64
- data/app/frontend/editor/components/page/form/seo.vue +0 -94
- data/app/frontend/editor/components/page/list/actions-button.vue +0 -159
- data/app/frontend/editor/components/page/list/index.vue +0 -58
- data/app/frontend/editor/components/page/list/list-item.vue +0 -96
- data/app/frontend/editor/components/page/new.vue +0 -79
- data/app/frontend/editor/components/section-block-pane/index.vue +0 -69
- data/app/frontend/editor/components/section-block-pane/setting-list.vue +0 -53
- data/app/frontend/editor/components/section-highlighter/bottom-actions.vue +0 -60
- data/app/frontend/editor/components/section-highlighter/index.vue +0 -125
- data/app/frontend/editor/components/section-highlighter/top-left-actions.vue +0 -78
- data/app/frontend/editor/components/section-highlighter/top-right-actions.vue +0 -130
- data/app/frontend/editor/components/section-list/add-button.vue +0 -39
- data/app/frontend/editor/components/section-list/index.vue +0 -79
- data/app/frontend/editor/components/section-list/list-item.vue +0 -60
- data/app/frontend/editor/components/section-pane/block-list/index.vue +0 -68
- data/app/frontend/editor/components/section-pane/block-list/list-item.vue +0 -74
- data/app/frontend/editor/components/section-pane/block-list/new-block-button.vue +0 -80
- data/app/frontend/editor/components/section-pane/block-tree/index.vue +0 -63
- data/app/frontend/editor/components/section-pane/block-tree/new-nested-block-button.vue +0 -73
- data/app/frontend/editor/components/section-pane/block-tree/tree-node.vue +0 -109
- data/app/frontend/editor/components/section-pane/index.vue +0 -94
- data/app/frontend/editor/components/section-pane/setting-list.vue +0 -50
- data/app/frontend/editor/components/sidebar-nav/index.vue +0 -102
- data/app/frontend/editor/components/sidebar-nav/link.vue +0 -60
- data/app/frontend/editor/components/style-pane/index.vue +0 -48
- data/app/frontend/editor/components/theme-section-list/category.vue +0 -47
- data/app/frontend/editor/components/theme-section-list/index.vue +0 -27
- data/app/frontend/editor/components/theme-section-list/list-item.vue +0 -95
- data/app/frontend/editor/design/application.scss +0 -17
- data/app/frontend/editor/design/components/buttons.scss +0 -25
- data/app/frontend/editor/design/components/modal.scss +0 -49
- data/app/frontend/editor/design/components/tooltip.scss +0 -123
- data/app/frontend/editor/design/components/tree.scss +0 -6
- data/app/frontend/editor/design/helpers.scss +0 -9
- data/app/frontend/editor/design/transitions.scss +0 -121
- data/app/frontend/editor/layouts/app.vue +0 -42
- data/app/frontend/editor/layouts/default.vue +0 -57
- data/app/frontend/editor/layouts/slide-pane.vue +0 -87
- data/app/frontend/editor/locales/editor.ar.json +0 -265
- data/app/frontend/editor/locales/editor.en.json +0 -265
- data/app/frontend/editor/locales/editor.es.json +0 -265
- data/app/frontend/editor/locales/editor.fr.json +0 -265
- data/app/frontend/editor/locales/editor.pt-BR.json +0 -265
- data/app/frontend/editor/locales/index.js +0 -23
- data/app/frontend/editor/main.js +0 -21
- data/app/frontend/editor/misc/__tests__/utils.spec.js +0 -43
- data/app/frontend/editor/misc/utils.js +0 -177
- data/app/frontend/editor/mixins/error-modal.js +0 -28
- data/app/frontend/editor/mixins/focused-input.js +0 -20
- data/app/frontend/editor/mixins/global.js +0 -140
- data/app/frontend/editor/mixins/grouped-dropdowns.js +0 -17
- data/app/frontend/editor/mixins/index.js +0 -1
- data/app/frontend/editor/mixins/preview-transformation.js +0 -59
- data/app/frontend/editor/plugins/event-bus.js +0 -3
- data/app/frontend/editor/plugins/filters.js +0 -7
- data/app/frontend/editor/plugins/i18n.js +0 -13
- data/app/frontend/editor/plugins/index.js +0 -3
- data/app/frontend/editor/plugins/tooltip.js +0 -4
- data/app/frontend/editor/router/index.js +0 -41
- data/app/frontend/editor/router/routes/base.js +0 -59
- data/app/frontend/editor/router/routes/index.js +0 -3
- data/app/frontend/editor/router/routes/page.js +0 -30
- data/app/frontend/editor/router/routes/section-block.js +0 -29
- data/app/frontend/editor/router/routes/section.js +0 -67
- data/app/frontend/editor/router/routes/style.js +0 -17
- data/app/frontend/editor/services/__tests__/page.spec.js +0 -38
- data/app/frontend/editor/services/__tests__/section.spec.js +0 -39
- data/app/frontend/editor/services/api.js +0 -40
- data/app/frontend/editor/services/block.js +0 -26
- data/app/frontend/editor/services/collection-item.js +0 -20
- data/app/frontend/editor/services/image.js +0 -26
- data/app/frontend/editor/services/index.js +0 -21
- data/app/frontend/editor/services/live-preview.js +0 -131
- data/app/frontend/editor/services/page.js +0 -107
- data/app/frontend/editor/services/section.js +0 -214
- data/app/frontend/editor/services/site.js +0 -21
- data/app/frontend/editor/services/theme.js +0 -9
- data/app/frontend/editor/spec/__mocks__/page.js +0 -434
- data/app/frontend/editor/spec/__mocks__/section.js +0 -232
- data/app/frontend/editor/spec/__mocks__/services.js +0 -84
- data/app/frontend/editor/spec/__mocks__/site.js +0 -95
- data/app/frontend/editor/spec/__mocks__/theme.js +0 -518
- data/app/frontend/editor/store/__tests__/getters.spec.js +0 -158
- data/app/frontend/editor/store/actions/__tests__/page.spec.js +0 -97
- data/app/frontend/editor/store/actions/__tests__/section-block.spec.js +0 -105
- data/app/frontend/editor/store/actions/__tests__/section.spec.js +0 -62
- data/app/frontend/editor/store/actions/index.js +0 -35
- data/app/frontend/editor/store/actions/page.js +0 -66
- data/app/frontend/editor/store/actions/section-block.js +0 -57
- data/app/frontend/editor/store/actions/section.js +0 -75
- data/app/frontend/editor/store/actions/site.js +0 -32
- data/app/frontend/editor/store/default-state.js +0 -27
- data/app/frontend/editor/store/getters.js +0 -113
- data/app/frontend/editor/store/index.js +0 -29
- data/app/frontend/editor/store/mutations.js +0 -187
- data/app/frontend/editor/views/content-pane.vue +0 -109
- data/app/frontend/editor/views/page-preview.vue +0 -160
- data/app/frontend/editor/views/pages/edit.vue +0 -26
- data/app/frontend/editor/views/pages/index.vue +0 -65
- data/app/frontend/editor/views/sections/add-pane.vue +0 -23
- data/app/frontend/editor/views/sections/list-pane.vue +0 -20
- data/app/frontend/editor/views/slide-pane.vue +0 -14
- data/app/frontend/editor/views/slide-pane2.vue +0 -14
- data/app/frontend/editor/views/style/edit-pane.vue +0 -22
- data/app/frontend/entrypoints/admin.js +0 -3
- data/app/frontend/entrypoints/admin.scss +0 -5
- data/app/frontend/entrypoints/editor.js +0 -8
- data/app/frontend/entrypoints/live-preview-client.js +0 -6
- data/app/frontend/entrypoints/live-preview-rails-client.js +0 -9
- data/app/frontend/live-preview-client/index.js +0 -11
- data/app/frontend/live-preview-client/rails.js +0 -217
- data/app/helpers/maglev/editor_helper.rb +0 -95
- data/app/services/maglev/persist_page.rb +0 -97
- data/app/views/layouts/maglev/admin/_header_actions.html.erb +0 -5
- data/app/views/layouts/maglev/admin/application.html.erb +0 -26
- data/app/views/maglev/admin/sections/previews/show.html.erb +0 -47
- data/app/views/maglev/admin/themes/_empty.html.erb +0 -20
- data/app/views/maglev/admin/themes/_section_categories.html.erb +0 -9
- data/app/views/maglev/admin/themes/_sections.html.erb +0 -54
- data/app/views/maglev/admin/themes/show.html.erb +0 -21
- data/app/views/maglev/api/_pagination.json.jbuilder +0 -6
- data/app/views/maglev/api/assets/_show.json.jbuilder +0 -8
- data/app/views/maglev/api/assets/index.json.jbuilder +0 -9
- data/app/views/maglev/api/assets/show.json.jbuilder +0 -3
- data/app/views/maglev/api/collection_items/_show.json.jbuilder +0 -5
- data/app/views/maglev/api/collection_items/index.json.jbuilder +0 -5
- data/app/views/maglev/api/collection_items/show.json.jbuilder +0 -7
- data/app/views/maglev/api/page_clones/create.json.jbuilder +0 -3
- data/app/views/maglev/api/pages/_show.json.jbuilder +0 -23
- data/app/views/maglev/api/pages/index.json.jbuilder +0 -18
- data/app/views/maglev/api/pages/show.json.jbuilder +0 -3
- data/app/views/maglev/api/sites/_show.json.jbuilder +0 -15
- data/app/views/maglev/api/sites/show.json.jbuilder +0 -3
- data/app/views/maglev/api/themes/_show.json.jbuilder +0 -17
- data/app/views/maglev/editor/_header.html.erb +0 -1
- data/app/views/maglev/editor/show.html.erb +0 -41
- data/app/views/maglev/settings/index.html.erb +0 -11
- data/bin/vite +0 -29
- data/config/initializers/kaminari.rb +0 -16
- data/config/vite.json +0 -17
- data/lib/tasks/maglev/vite.rake +0 -70
- data/package.json +0 -58
- data/postcss.config.cjs +0 -6
- data/tailwind.config.js +0 -68
- data/vite.config.ts +0 -18
- data/yarn.lock +0 -4749
- /data/app/{frontend/images → assets/images/maglev}/favicon.svg +0 -0
- /data/app/{frontend/images → assets/images/maglev}/logo.svg +0 -0
- /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
|
-
|
|
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>
|