maglevcms 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +27 -0
- data/Rakefile +34 -0
- data/app/assets/config/maglev_manifest.js +1 -0
- data/app/assets/images/maglev/favicon.png +0 -0
- data/app/assets/images/maglev/logo.png +0 -0
- data/app/assets/stylesheets/maglev/application.css +15 -0
- data/app/components/maglev/base_component.rb +54 -0
- data/app/components/maglev/block_component.rb +46 -0
- data/app/components/maglev/content/base.rb +52 -0
- data/app/components/maglev/content/builder.rb +28 -0
- data/app/components/maglev/content/checkbox.rb +19 -0
- data/app/components/maglev/content/collection_item.rb +29 -0
- data/app/components/maglev/content/color.rb +20 -0
- data/app/components/maglev/content/icon.rb +26 -0
- data/app/components/maglev/content/image.rb +55 -0
- data/app/components/maglev/content/link.rb +61 -0
- data/app/components/maglev/content/select.rb +8 -0
- data/app/components/maglev/content/text.rb +25 -0
- data/app/components/maglev/page_component.rb +44 -0
- data/app/components/maglev/section_component.rb +96 -0
- data/app/components/maglev/tag_helper.rb +43 -0
- data/app/controllers/concerns/maglev/authentication_concern.rb +31 -0
- data/app/controllers/concerns/maglev/back_action_concern.rb +30 -0
- data/app/controllers/concerns/maglev/content_locale_concern.rb +26 -0
- data/app/controllers/concerns/maglev/fetchers_concern.rb +108 -0
- data/app/controllers/concerns/maglev/json_concern.rb +21 -0
- data/app/controllers/concerns/maglev/rendering_concern.rb +40 -0
- data/app/controllers/concerns/maglev/services_concern.rb +39 -0
- data/app/controllers/concerns/maglev/standalone_sections_concern.rb +28 -0
- data/app/controllers/concerns/maglev/ui_locale_concern.rb +32 -0
- data/app/controllers/maglev/admin/base_controller.rb +21 -0
- data/app/controllers/maglev/admin/dashboard_controller.rb +11 -0
- data/app/controllers/maglev/admin/sections/previews_controller.rb +52 -0
- data/app/controllers/maglev/admin/sections/screenshots_controller.rb +17 -0
- data/app/controllers/maglev/admin/themes_controller.rb +19 -0
- data/app/controllers/maglev/api/assets_controller.rb +44 -0
- data/app/controllers/maglev/api/collection_items_controller.rb +14 -0
- data/app/controllers/maglev/api/page_clones_controller.rb +22 -0
- data/app/controllers/maglev/api/pages_controller.rb +65 -0
- data/app/controllers/maglev/api/publications_controller.rb +15 -0
- data/app/controllers/maglev/api/sites_controller.rb +21 -0
- data/app/controllers/maglev/api.rb +15 -0
- data/app/controllers/maglev/api_controller.rb +61 -0
- data/app/controllers/maglev/application_controller.rb +17 -0
- data/app/controllers/maglev/assets_controller.rb +10 -0
- data/app/controllers/maglev/editor_controller.rb +46 -0
- data/app/controllers/maglev/page_preview_controller.rb +53 -0
- data/app/helpers/maglev/admin/sections/previews_helper.rb +21 -0
- data/app/helpers/maglev/admin/themes_helper.rb +27 -0
- data/app/helpers/maglev/application_helper.rb +13 -0
- data/app/helpers/maglev/editor_helper.rb +78 -0
- data/app/helpers/maglev/page_preview_helper.rb +57 -0
- data/app/javascript/controllers/dropdown_controller.js +9 -0
- data/app/javascript/controllers/iframe_controller.js +14 -0
- data/app/javascript/controllers/index.js +11 -0
- data/app/javascript/controllers/screenshot_controller.js +37 -0
- data/app/javascript/editor/App.vue +43 -0
- data/app/javascript/editor/assets/remixicons/add-box-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/arrow-down-s-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/arrow-drop-left.svg +1 -0
- data/app/javascript/editor/assets/remixicons/arrow-drop-right.svg +1 -0
- data/app/javascript/editor/assets/remixicons/arrow-up-s-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/camera-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/check-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/close-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/computer-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/delete-bin-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/file-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-blockquote.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-bold.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-code.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-heading-2.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-heading-3.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-heading-4.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-italic.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-link-unlink.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-link.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-list-ordered.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-list-unordered.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-paragraph.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-strikethrough.svg +1 -0
- data/app/javascript/editor/assets/remixicons/format-underline.svg +1 -0
- data/app/javascript/editor/assets/remixicons/home-4-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/image-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/logout-box-r-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-add-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-alert-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-book-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-bug-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-close-circle-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-close-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-delete-column.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-delete-row.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-drop-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-external-link-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-eye-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-eye-off-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-file-copy-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-file-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-global-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-insert-column-left.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-insert-column-right.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-insert-row-bottom.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-insert-row-top.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-loader-4-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-mail-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-more-2-fill.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-pencil-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-play-list-add-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-settings-5-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-stack-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-table-2.svg +1 -0
- data/app/javascript/editor/assets/remixicons/ri-table-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/search-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/settings-4-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/smartphone-line.svg +1 -0
- data/app/javascript/editor/assets/remixicons/tablet-line.svg +1 -0
- data/app/javascript/editor/assets/zondicons/add-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/add-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/adjust.svg +1 -0
- data/app/javascript/editor/assets/zondicons/airplane.svg +1 -0
- data/app/javascript/editor/assets/zondicons/album.svg +1 -0
- data/app/javascript/editor/assets/zondicons/align-center.svg +1 -0
- data/app/javascript/editor/assets/zondicons/align-justified.svg +1 -0
- data/app/javascript/editor/assets/zondicons/align-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/align-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/anchor.svg +1 -0
- data/app/javascript/editor/assets/zondicons/announcement.svg +1 -0
- data/app/javascript/editor/assets/zondicons/apparel.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-outline-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-outline-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-outline-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-outline-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-thick-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-thick-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-thick-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-thick-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-thin-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-thin-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-thin-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-thin-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/arrow-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/artist.svg +1 -0
- data/app/javascript/editor/assets/zondicons/at-symbol.svg +1 -0
- data/app/javascript/editor/assets/zondicons/attachment.svg +1 -0
- data/app/javascript/editor/assets/zondicons/backspace.svg +1 -0
- data/app/javascript/editor/assets/zondicons/backward-step.svg +1 -0
- data/app/javascript/editor/assets/zondicons/backward.svg +1 -0
- data/app/javascript/editor/assets/zondicons/badge.svg +1 -0
- data/app/javascript/editor/assets/zondicons/battery-full.svg +1 -0
- data/app/javascript/editor/assets/zondicons/battery-half.svg +1 -0
- data/app/javascript/editor/assets/zondicons/battery-low.svg +1 -0
- data/app/javascript/editor/assets/zondicons/beverage.svg +1 -0
- data/app/javascript/editor/assets/zondicons/block.svg +1 -0
- data/app/javascript/editor/assets/zondicons/bluetooth.svg +1 -0
- data/app/javascript/editor/assets/zondicons/bolt.svg +1 -0
- data/app/javascript/editor/assets/zondicons/book-reference.svg +1 -0
- data/app/javascript/editor/assets/zondicons/bookmark copy 2.svg +1 -0
- data/app/javascript/editor/assets/zondicons/bookmark copy 3.svg +1 -0
- data/app/javascript/editor/assets/zondicons/bookmark-outline-add.svg +1 -0
- data/app/javascript/editor/assets/zondicons/bookmark-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/bookmark.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-all.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-bottom.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-horizontal.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-inner.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-none.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-outer.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-top.svg +1 -0
- data/app/javascript/editor/assets/zondicons/border-vertical.svg +1 -0
- data/app/javascript/editor/assets/zondicons/box.svg +1 -0
- data/app/javascript/editor/assets/zondicons/brightness-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/brightness-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/browser-window-new.svg +1 -0
- data/app/javascript/editor/assets/zondicons/browser-window-open.svg +1 -0
- data/app/javascript/editor/assets/zondicons/browser-window.svg +1 -0
- data/app/javascript/editor/assets/zondicons/bug.svg +1 -0
- data/app/javascript/editor/assets/zondicons/buoy.svg +1 -0
- data/app/javascript/editor/assets/zondicons/calculator.svg +1 -0
- data/app/javascript/editor/assets/zondicons/calendar.svg +1 -0
- data/app/javascript/editor/assets/zondicons/camera.svg +1 -0
- data/app/javascript/editor/assets/zondicons/chart-bar.svg +1 -0
- data/app/javascript/editor/assets/zondicons/chart-pie.svg +1 -0
- data/app/javascript/editor/assets/zondicons/chart.svg +1 -0
- data/app/javascript/editor/assets/zondicons/chat-bubble-dots.svg +1 -0
- data/app/javascript/editor/assets/zondicons/checkmark-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/checkmark.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cheveron-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cheveron-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cheveron-outline-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cheveron-outline-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cheveron-outline-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cheveron-outline-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cheveron-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cheveron-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/clipboard.svg +1 -0
- data/app/javascript/editor/assets/zondicons/close-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/close-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/close.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cloud-upload.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cloud.svg +1 -0
- data/app/javascript/editor/assets/zondicons/code.svg +1 -0
- data/app/javascript/editor/assets/zondicons/coffee.svg +1 -0
- data/app/javascript/editor/assets/zondicons/cog.svg +1 -0
- data/app/javascript/editor/assets/zondicons/color-palette.svg +1 -0
- data/app/javascript/editor/assets/zondicons/compose.svg +1 -0
- data/app/javascript/editor/assets/zondicons/computer-desktop.svg +1 -0
- data/app/javascript/editor/assets/zondicons/computer-laptop.svg +1 -0
- data/app/javascript/editor/assets/zondicons/conversation.svg +1 -0
- data/app/javascript/editor/assets/zondicons/copy.svg +1 -0
- data/app/javascript/editor/assets/zondicons/credit-card.svg +1 -0
- data/app/javascript/editor/assets/zondicons/currency-dollar.svg +1 -0
- data/app/javascript/editor/assets/zondicons/dashboard.svg +1 -0
- data/app/javascript/editor/assets/zondicons/date-add.svg +1 -0
- data/app/javascript/editor/assets/zondicons/dial-pad.svg +1 -0
- data/app/javascript/editor/assets/zondicons/directions.svg +1 -0
- data/app/javascript/editor/assets/zondicons/document-add.svg +1 -0
- data/app/javascript/editor/assets/zondicons/document.svg +1 -0
- data/app/javascript/editor/assets/zondicons/dots-horizontal-double.svg +1 -0
- data/app/javascript/editor/assets/zondicons/dots-horizontal-triple.svg +1 -0
- data/app/javascript/editor/assets/zondicons/download.svg +1 -0
- data/app/javascript/editor/assets/zondicons/duplicate.svg +1 -0
- data/app/javascript/editor/assets/zondicons/edit-copy.svg +1 -0
- data/app/javascript/editor/assets/zondicons/edit-crop.svg +1 -0
- data/app/javascript/editor/assets/zondicons/edit-cut.svg +1 -0
- data/app/javascript/editor/assets/zondicons/edit-pencil.svg +1 -0
- data/app/javascript/editor/assets/zondicons/education.svg +1 -0
- data/app/javascript/editor/assets/zondicons/envelope.svg +1 -0
- data/app/javascript/editor/assets/zondicons/exclamation-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/exclamation-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/explore.svg +1 -0
- data/app/javascript/editor/assets/zondicons/factory.svg +1 -0
- data/app/javascript/editor/assets/zondicons/fast-forward.svg +1 -0
- data/app/javascript/editor/assets/zondicons/fast-rewind.svg +1 -0
- data/app/javascript/editor/assets/zondicons/film.svg +1 -0
- data/app/javascript/editor/assets/zondicons/filter.svg +1 -0
- data/app/javascript/editor/assets/zondicons/flag.svg +1 -0
- data/app/javascript/editor/assets/zondicons/flashlight.svg +1 -0
- data/app/javascript/editor/assets/zondicons/folder-outline-add.svg +1 -0
- data/app/javascript/editor/assets/zondicons/folder-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/folder.svg +1 -0
- data/app/javascript/editor/assets/zondicons/format-bold.svg +1 -0
- data/app/javascript/editor/assets/zondicons/format-font-size.svg +1 -0
- data/app/javascript/editor/assets/zondicons/format-italic.svg +1 -0
- data/app/javascript/editor/assets/zondicons/format-text-size.svg +1 -0
- data/app/javascript/editor/assets/zondicons/format-underline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/forward-step.svg +1 -0
- data/app/javascript/editor/assets/zondicons/forward.svg +1 -0
- data/app/javascript/editor/assets/zondicons/gift.svg +1 -0
- data/app/javascript/editor/assets/zondicons/globe.svg +1 -0
- data/app/javascript/editor/assets/zondicons/hand-stop.svg +1 -0
- data/app/javascript/editor/assets/zondicons/hard-drive.svg +1 -0
- data/app/javascript/editor/assets/zondicons/headphones.svg +1 -0
- data/app/javascript/editor/assets/zondicons/heart.svg +1 -0
- data/app/javascript/editor/assets/zondicons/home.svg +1 -0
- data/app/javascript/editor/assets/zondicons/hot.svg +1 -0
- data/app/javascript/editor/assets/zondicons/hour-glass.svg +1 -0
- data/app/javascript/editor/assets/zondicons/inbox-check.svg +1 -0
- data/app/javascript/editor/assets/zondicons/inbox-download.svg +1 -0
- data/app/javascript/editor/assets/zondicons/inbox-full.svg +1 -0
- data/app/javascript/editor/assets/zondicons/inbox.svg +1 -0
- data/app/javascript/editor/assets/zondicons/indent-decrease.svg +1 -0
- data/app/javascript/editor/assets/zondicons/indent-increase.svg +1 -0
- data/app/javascript/editor/assets/zondicons/information-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/information-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/key.svg +1 -0
- data/app/javascript/editor/assets/zondicons/keyboard.svg +1 -0
- data/app/javascript/editor/assets/zondicons/layers.svg +1 -0
- data/app/javascript/editor/assets/zondicons/library.svg +1 -0
- data/app/javascript/editor/assets/zondicons/light-bulb.svg +1 -0
- data/app/javascript/editor/assets/zondicons/link.svg +1 -0
- data/app/javascript/editor/assets/zondicons/list-add.svg +1 -0
- data/app/javascript/editor/assets/zondicons/list-bullet.svg +1 -0
- data/app/javascript/editor/assets/zondicons/list.svg +1 -0
- data/app/javascript/editor/assets/zondicons/load-balancer.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location-current.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location-food.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location-gas-station.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location-hotel.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location-marina.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location-park.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location-restroom.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location-shopping.svg +1 -0
- data/app/javascript/editor/assets/zondicons/location.svg +1 -0
- data/app/javascript/editor/assets/zondicons/lock-closed.svg +1 -0
- data/app/javascript/editor/assets/zondicons/lock-open.svg +1 -0
- data/app/javascript/editor/assets/zondicons/map.svg +1 -0
- data/app/javascript/editor/assets/zondicons/menu.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mic.svg +1 -0
- data/app/javascript/editor/assets/zondicons/minus-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/minus-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mobile-devices.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mood-happy-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mood-happy-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mood-neutral-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mood-neutral-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mood-sad-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mood-sad-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/mouse.svg +1 -0
- data/app/javascript/editor/assets/zondicons/music-album.svg +1 -0
- data/app/javascript/editor/assets/zondicons/music-artist.svg +1 -0
- data/app/javascript/editor/assets/zondicons/music-notes.svg +1 -0
- data/app/javascript/editor/assets/zondicons/music-playlist.svg +1 -0
- data/app/javascript/editor/assets/zondicons/navigation-more.svg +1 -0
- data/app/javascript/editor/assets/zondicons/network.svg +1 -0
- data/app/javascript/editor/assets/zondicons/news-paper.svg +1 -0
- data/app/javascript/editor/assets/zondicons/notification.svg +1 -0
- data/app/javascript/editor/assets/zondicons/notifications-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/notifications.svg +1 -0
- data/app/javascript/editor/assets/zondicons/paste.svg +1 -0
- data/app/javascript/editor/assets/zondicons/pause-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/pause-solid.svg +1 -0
- data/app/javascript/editor/assets/zondicons/pause.svg +1 -0
- data/app/javascript/editor/assets/zondicons/pen-tool.svg +1 -0
- data/app/javascript/editor/assets/zondicons/phone.svg +1 -0
- data/app/javascript/editor/assets/zondicons/photo.svg +1 -0
- data/app/javascript/editor/assets/zondicons/php-elephant.svg +1 -0
- data/app/javascript/editor/assets/zondicons/pin.svg +1 -0
- data/app/javascript/editor/assets/zondicons/play-outline.svg +1 -0
- data/app/javascript/editor/assets/zondicons/play.svg +1 -0
- data/app/javascript/editor/assets/zondicons/playlist.svg +1 -0
- data/app/javascript/editor/assets/zondicons/plugin.svg +1 -0
- data/app/javascript/editor/assets/zondicons/portfolio.svg +1 -0
- data/app/javascript/editor/assets/zondicons/printer.svg +1 -0
- data/app/javascript/editor/assets/zondicons/pylon.svg +1 -0
- data/app/javascript/editor/assets/zondicons/question.svg +1 -0
- data/app/javascript/editor/assets/zondicons/queue.svg +1 -0
- data/app/javascript/editor/assets/zondicons/radar copy 2.svg +1 -0
- data/app/javascript/editor/assets/zondicons/radar.svg +1 -0
- data/app/javascript/editor/assets/zondicons/radio.svg +1 -0
- data/app/javascript/editor/assets/zondicons/refresh.svg +1 -0
- data/app/javascript/editor/assets/zondicons/reload.svg +1 -0
- data/app/javascript/editor/assets/zondicons/reply-all.svg +1 -0
- data/app/javascript/editor/assets/zondicons/reply.svg +1 -0
- data/app/javascript/editor/assets/zondicons/repost.svg +1 -0
- data/app/javascript/editor/assets/zondicons/save-disk.svg +1 -0
- data/app/javascript/editor/assets/zondicons/screen-full.svg +1 -0
- data/app/javascript/editor/assets/zondicons/search.svg +1 -0
- data/app/javascript/editor/assets/zondicons/send.svg +1 -0
- data/app/javascript/editor/assets/zondicons/servers.svg +1 -0
- data/app/javascript/editor/assets/zondicons/share-01.svg +1 -0
- data/app/javascript/editor/assets/zondicons/share-alt.svg +1 -0
- data/app/javascript/editor/assets/zondicons/share.svg +1 -0
- data/app/javascript/editor/assets/zondicons/shield.svg +1 -0
- data/app/javascript/editor/assets/zondicons/shopping-cart.svg +1 -0
- data/app/javascript/editor/assets/zondicons/show-sidebar.svg +1 -0
- data/app/javascript/editor/assets/zondicons/shuffle.svg +1 -0
- data/app/javascript/editor/assets/zondicons/stand-by.svg +1 -0
- data/app/javascript/editor/assets/zondicons/star-full.svg +1 -0
- data/app/javascript/editor/assets/zondicons/station.svg +1 -0
- data/app/javascript/editor/assets/zondicons/step-backward.svg +1 -0
- data/app/javascript/editor/assets/zondicons/step-forward.svg +1 -0
- data/app/javascript/editor/assets/zondicons/stethoscope.svg +1 -0
- data/app/javascript/editor/assets/zondicons/store-front.svg +1 -0
- data/app/javascript/editor/assets/zondicons/stroke-width.svg +1 -0
- data/app/javascript/editor/assets/zondicons/subdirectory-left.svg +1 -0
- data/app/javascript/editor/assets/zondicons/subdirectory-right.svg +1 -0
- data/app/javascript/editor/assets/zondicons/swap.svg +1 -0
- data/app/javascript/editor/assets/zondicons/tablet.svg +1 -0
- data/app/javascript/editor/assets/zondicons/tag.svg +1 -0
- data/app/javascript/editor/assets/zondicons/target.svg +1 -0
- data/app/javascript/editor/assets/zondicons/text-box.svg +1 -0
- data/app/javascript/editor/assets/zondicons/text-decoration.svg +1 -0
- data/app/javascript/editor/assets/zondicons/thermometer.svg +1 -0
- data/app/javascript/editor/assets/zondicons/thumbs-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/thumbs-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/ticket.svg +1 -0
- data/app/javascript/editor/assets/zondicons/time.svg +1 -0
- data/app/javascript/editor/assets/zondicons/timer.svg +1 -0
- data/app/javascript/editor/assets/zondicons/tools copy.svg +1 -0
- data/app/javascript/editor/assets/zondicons/translate.svg +1 -0
- data/app/javascript/editor/assets/zondicons/trash.svg +1 -0
- data/app/javascript/editor/assets/zondicons/travel-bus.svg +1 -0
- data/app/javascript/editor/assets/zondicons/travel-car.svg +1 -0
- data/app/javascript/editor/assets/zondicons/travel-case.svg +1 -0
- data/app/javascript/editor/assets/zondicons/travel-taxi-cab.svg +1 -0
- data/app/javascript/editor/assets/zondicons/travel-train.svg +1 -0
- data/app/javascript/editor/assets/zondicons/travel-walk.svg +1 -0
- data/app/javascript/editor/assets/zondicons/travel.svg +1 -0
- data/app/javascript/editor/assets/zondicons/trophy.svg +1 -0
- data/app/javascript/editor/assets/zondicons/tuning.svg +1 -0
- data/app/javascript/editor/assets/zondicons/upload.svg +1 -0
- data/app/javascript/editor/assets/zondicons/usb.svg +1 -0
- data/app/javascript/editor/assets/zondicons/user-add.svg +1 -0
- data/app/javascript/editor/assets/zondicons/user-group.svg +1 -0
- data/app/javascript/editor/assets/zondicons/user-solid-circle.svg +1 -0
- data/app/javascript/editor/assets/zondicons/user-solid-square.svg +1 -0
- data/app/javascript/editor/assets/zondicons/user.svg +1 -0
- data/app/javascript/editor/assets/zondicons/vector.svg +1 -0
- data/app/javascript/editor/assets/zondicons/video-camera.svg +1 -0
- data/app/javascript/editor/assets/zondicons/view-carousel.svg +1 -0
- data/app/javascript/editor/assets/zondicons/view-column.svg +1 -0
- data/app/javascript/editor/assets/zondicons/view-hide.svg +1 -0
- data/app/javascript/editor/assets/zondicons/view-list.svg +1 -0
- data/app/javascript/editor/assets/zondicons/view-show.svg +1 -0
- data/app/javascript/editor/assets/zondicons/view-tile.svg +1 -0
- data/app/javascript/editor/assets/zondicons/volume-down.svg +1 -0
- data/app/javascript/editor/assets/zondicons/volume-mute.svg +1 -0
- data/app/javascript/editor/assets/zondicons/volume-off.svg +1 -0
- data/app/javascript/editor/assets/zondicons/volume-up.svg +1 -0
- data/app/javascript/editor/assets/zondicons/wallet.svg +1 -0
- data/app/javascript/editor/assets/zondicons/watch.svg +1 -0
- data/app/javascript/editor/assets/zondicons/window-new.svg +1 -0
- data/app/javascript/editor/assets/zondicons/window-open.svg +1 -0
- data/app/javascript/editor/assets/zondicons/window.svg +1 -0
- data/app/javascript/editor/assets/zondicons/wrench.svg +1 -0
- data/app/javascript/editor/assets/zondicons/yin-yang.svg +1 -0
- data/app/javascript/editor/assets/zondicons/zoom-in.svg +1 -0
- data/app/javascript/editor/assets/zondicons/zoom-out.svg +1 -0
- data/app/javascript/editor/components/dynamic-form/dynamic-input.vue +121 -0
- data/app/javascript/editor/components/dynamic-form/index.vue +34 -0
- data/app/javascript/editor/components/errors/stale-record.vue +24 -0
- data/app/javascript/editor/components/header-nav/device-toggler.vue +37 -0
- data/app/javascript/editor/components/header-nav/index.vue +103 -0
- data/app/javascript/editor/components/header-nav/locale-toggler/index.vue +51 -0
- data/app/javascript/editor/components/header-nav/locale-toggler/locale-link.vue +32 -0
- data/app/javascript/editor/components/header-nav/preview-button.vue +15 -0
- data/app/javascript/editor/components/header-nav/preview-toggler.vue +40 -0
- data/app/javascript/editor/components/header-nav/publish-button.vue +87 -0
- data/app/javascript/editor/components/header-nav/save-button.vue +42 -0
- data/app/javascript/editor/components/header-nav/separator.vue +11 -0
- data/app/javascript/editor/components/icon-library/index.vue +39 -0
- data/app/javascript/editor/components/image-library/index.vue +110 -0
- data/app/javascript/editor/components/image-library/list-item.vue +93 -0
- data/app/javascript/editor/components/image-library/list.vue +26 -0
- data/app/javascript/editor/components/image-library/uploader.vue +78 -0
- data/app/javascript/editor/components/kit/accordion.vue +63 -0
- data/app/javascript/editor/components/kit/checkbox-input.vue +59 -0
- data/app/javascript/editor/components/kit/collection-item-input.vue +64 -0
- data/app/javascript/editor/components/kit/color-picker.vue +81 -0
- data/app/javascript/editor/components/kit/confirmation-button.vue +65 -0
- data/app/javascript/editor/components/kit/dropdown.vue +60 -0
- data/app/javascript/editor/components/kit/icon-input.vue +96 -0
- data/app/javascript/editor/components/kit/icon.vue +35 -0
- data/app/javascript/editor/components/kit/image-input.vue +124 -0
- data/app/javascript/editor/components/kit/index.js +50 -0
- data/app/javascript/editor/components/kit/link-input.vue +117 -0
- data/app/javascript/editor/components/kit/list-item-button.vue +16 -0
- data/app/javascript/editor/components/kit/modal-root.vue +81 -0
- data/app/javascript/editor/components/kit/modal.vue +39 -0
- data/app/javascript/editor/components/kit/page-icon.vue +21 -0
- data/app/javascript/editor/components/kit/pagination/button.vue +35 -0
- data/app/javascript/editor/components/kit/pagination/index.vue +116 -0
- data/app/javascript/editor/components/kit/rich-text-input/block-button.vue +75 -0
- data/app/javascript/editor/components/kit/rich-text-input/extensions/Doc.js +12 -0
- data/app/javascript/editor/components/kit/rich-text-input/extensions/LineBreak.js +38 -0
- data/app/javascript/editor/components/kit/rich-text-input/extensions/marks/Link.js +57 -0
- data/app/javascript/editor/components/kit/rich-text-input/format-buttons.vue +39 -0
- data/app/javascript/editor/components/kit/rich-text-input/link-buttons.vue +91 -0
- data/app/javascript/editor/components/kit/rich-text-input/list-buttons.vue +29 -0
- data/app/javascript/editor/components/kit/rich-text-input/menu-button.vue +22 -0
- data/app/javascript/editor/components/kit/rich-text-input/table-button.vue +106 -0
- data/app/javascript/editor/components/kit/rich-text-input.vue +181 -0
- data/app/javascript/editor/components/kit/search-input.vue +53 -0
- data/app/javascript/editor/components/kit/select-input.vue +188 -0
- data/app/javascript/editor/components/kit/simple-select.vue +44 -0
- data/app/javascript/editor/components/kit/submit-button.vue +117 -0
- data/app/javascript/editor/components/kit/tabs.vue +88 -0
- data/app/javascript/editor/components/kit/text-input.vue +62 -0
- data/app/javascript/editor/components/kit/textarea-input.vue +59 -0
- data/app/javascript/editor/components/link-picker/actions.vue +32 -0
- data/app/javascript/editor/components/link-picker/email.vue +32 -0
- data/app/javascript/editor/components/link-picker/index.vue +97 -0
- data/app/javascript/editor/components/link-picker/page.vue +124 -0
- data/app/javascript/editor/components/link-picker/url.vue +43 -0
- data/app/javascript/editor/components/page/edit.vue +98 -0
- data/app/javascript/editor/components/page/form/main.vue +64 -0
- data/app/javascript/editor/components/page/form/seo.vue +94 -0
- data/app/javascript/editor/components/page/list/index.vue +67 -0
- data/app/javascript/editor/components/page/list/list-item.vue +147 -0
- data/app/javascript/editor/components/page/new.vue +78 -0
- data/app/javascript/editor/components/section-block-pane/index.vue +69 -0
- data/app/javascript/editor/components/section-block-pane/setting-list.vue +49 -0
- data/app/javascript/editor/components/section-highlighter/bottom-actions.vue +60 -0
- data/app/javascript/editor/components/section-highlighter/index.vue +133 -0
- data/app/javascript/editor/components/section-highlighter/top-left-actions.vue +68 -0
- data/app/javascript/editor/components/section-highlighter/top-right-actions.vue +127 -0
- data/app/javascript/editor/components/section-list/index.vue +64 -0
- data/app/javascript/editor/components/section-list/list-item.vue +33 -0
- data/app/javascript/editor/components/section-pane/block-list/index.vue +67 -0
- data/app/javascript/editor/components/section-pane/block-list/list-item.vue +71 -0
- data/app/javascript/editor/components/section-pane/block-list/new-block-button.vue +74 -0
- data/app/javascript/editor/components/section-pane/block-tree/index.vue +63 -0
- data/app/javascript/editor/components/section-pane/block-tree/new-nested-block-button.vue +67 -0
- data/app/javascript/editor/components/section-pane/block-tree/tree-node.vue +109 -0
- data/app/javascript/editor/components/section-pane/index.vue +92 -0
- data/app/javascript/editor/components/section-pane/setting-list.vue +46 -0
- data/app/javascript/editor/components/sidebar-nav.vue +125 -0
- data/app/javascript/editor/components/style-pane/index.vue +44 -0
- data/app/javascript/editor/components/theme-section-list/index.vue +51 -0
- data/app/javascript/editor/components/theme-section-list/list-item.vue +88 -0
- data/app/javascript/editor/design/application.scss +17 -0
- data/app/javascript/editor/design/components/buttons.scss +25 -0
- data/app/javascript/editor/design/components/modal.scss +49 -0
- data/app/javascript/editor/design/components/rich-text-editor.scss +180 -0
- data/app/javascript/editor/design/components/tooltip.scss +117 -0
- data/app/javascript/editor/design/components/tree.scss +6 -0
- data/app/javascript/editor/design/helpers.scss +30 -0
- data/app/javascript/editor/design/transitions.scss +121 -0
- data/app/javascript/editor/layouts/app.vue +30 -0
- data/app/javascript/editor/layouts/default.vue +42 -0
- data/app/javascript/editor/layouts/slide-pane.vue +87 -0
- data/app/javascript/editor/locales/editor.en.json +257 -0
- data/app/javascript/editor/locales/editor.fr.json +244 -0
- data/app/javascript/editor/locales/index.js +11 -0
- data/app/javascript/editor/main.js +19 -0
- data/app/javascript/editor/mixins/error-modal.js +23 -0
- data/app/javascript/editor/mixins/focused-input.js +20 -0
- data/app/javascript/editor/mixins/global.js +125 -0
- data/app/javascript/editor/mixins/grouped-dropdowns.js +17 -0
- data/app/javascript/editor/mixins/index.js +1 -0
- data/app/javascript/editor/mixins/preview-transformation.js +60 -0
- data/app/javascript/editor/plugins/event-bus.js +3 -0
- data/app/javascript/editor/plugins/filters.js +7 -0
- data/app/javascript/editor/plugins/i18n.js +28 -0
- data/app/javascript/editor/plugins/index.js +3 -0
- data/app/javascript/editor/plugins/tooltip.js +4 -0
- data/app/javascript/editor/router/index.js +20 -0
- data/app/javascript/editor/router/routes/base.js +53 -0
- data/app/javascript/editor/router/routes/index.js +3 -0
- data/app/javascript/editor/router/routes/page.js +30 -0
- data/app/javascript/editor/router/routes/section-block.js +29 -0
- data/app/javascript/editor/router/routes/section.js +67 -0
- data/app/javascript/editor/router/routes/style.js +17 -0
- data/app/javascript/editor/services/__tests__/page.spec.js +38 -0
- data/app/javascript/editor/services/__tests__/section.spec.js +32 -0
- data/app/javascript/editor/services/api.js +40 -0
- data/app/javascript/editor/services/block.js +26 -0
- data/app/javascript/editor/services/collection-item.js +12 -0
- data/app/javascript/editor/services/image.js +23 -0
- data/app/javascript/editor/services/index.js +21 -0
- data/app/javascript/editor/services/inline-editing.js +403 -0
- data/app/javascript/editor/services/page.js +107 -0
- data/app/javascript/editor/services/section.js +180 -0
- data/app/javascript/editor/services/site.js +21 -0
- data/app/javascript/editor/services/theme.js +8 -0
- data/app/javascript/editor/spec/__mocks__/page.js +432 -0
- data/app/javascript/editor/spec/__mocks__/section.js +232 -0
- data/app/javascript/editor/spec/__mocks__/services.js +77 -0
- data/app/javascript/editor/spec/__mocks__/site.js +95 -0
- data/app/javascript/editor/spec/__mocks__/theme.js +518 -0
- data/app/javascript/editor/store/__tests__/getters.spec.js +102 -0
- data/app/javascript/editor/store/actions/__tests__/page.spec.js +93 -0
- data/app/javascript/editor/store/actions/__tests__/section-block.spec.js +104 -0
- data/app/javascript/editor/store/actions/__tests__/section.spec.js +61 -0
- data/app/javascript/editor/store/actions/index.js +37 -0
- data/app/javascript/editor/store/actions/page.js +52 -0
- data/app/javascript/editor/store/actions/section-block.js +74 -0
- data/app/javascript/editor/store/actions/section.js +86 -0
- data/app/javascript/editor/store/actions/site.js +32 -0
- data/app/javascript/editor/store/default-state.js +28 -0
- data/app/javascript/editor/store/getters.js +91 -0
- data/app/javascript/editor/store/index.js +28 -0
- data/app/javascript/editor/store/mutations.js +183 -0
- data/app/javascript/editor/utils.js +127 -0
- data/app/javascript/editor/views/content-pane.vue +105 -0
- data/app/javascript/editor/views/page-preview.vue +183 -0
- data/app/javascript/editor/views/pages/edit.vue +26 -0
- data/app/javascript/editor/views/pages/index.vue +65 -0
- data/app/javascript/editor/views/sections/add-pane.vue +23 -0
- data/app/javascript/editor/views/sections/list-pane.vue +20 -0
- data/app/javascript/editor/views/slide-pane.vue +14 -0
- data/app/javascript/editor/views/slide-pane2.vue +14 -0
- data/app/javascript/editor/views/style/edit-pane.vue +22 -0
- data/app/javascript/packs/application.js +8 -0
- data/app/javascript/packs/editor.js +2 -0
- data/app/javascript/style/application/_changes.scss +1 -0
- data/app/javascript/style/application/_variables.scss +0 -0
- data/app/javascript/style/application.scss +5 -0
- data/app/javascript/utils/axios.js +16 -0
- data/app/jobs/maglev/application_job.rb +6 -0
- data/app/mailers/maglev/application_mailer.rb +8 -0
- data/app/models/concerns/maglev/sections_concern.rb +45 -0
- data/app/models/concerns/maglev/translatable.rb +44 -0
- data/app/models/maglev/application_record.rb +7 -0
- data/app/models/maglev/asset.rb +28 -0
- data/app/models/maglev/page/path_concern.rb +70 -0
- data/app/models/maglev/page/search_concern.rb +40 -0
- data/app/models/maglev/page.rb +38 -0
- data/app/models/maglev/page_path.rb +46 -0
- data/app/models/maglev/section/block.rb +41 -0
- data/app/models/maglev/section/content_concern.rb +83 -0
- data/app/models/maglev/section/setting.rb +53 -0
- data/app/models/maglev/section.rb +85 -0
- data/app/models/maglev/site/locale.rb +19 -0
- data/app/models/maglev/site/locales_concern.rb +37 -0
- data/app/models/maglev/site/style_value.rb +43 -0
- data/app/models/maglev/site.rb +25 -0
- data/app/models/maglev/static_page.rb +40 -0
- data/app/models/maglev/theme/section_category.rb +23 -0
- data/app/models/maglev/theme/style_setting.rb +43 -0
- data/app/models/maglev/theme.rb +16 -0
- data/app/services/concerns/maglev/get_page_sections/transform_collection_item_concern.rb +18 -0
- data/app/services/concerns/maglev/get_page_sections/transform_link_concern.rb +35 -0
- data/app/services/concerns/maglev/get_page_sections/transform_text_concern.rb +38 -0
- data/app/services/maglev/app_container.rb +48 -0
- data/app/services/maglev/change_site_locales.rb +37 -0
- data/app/services/maglev/clone_page.rb +62 -0
- data/app/services/maglev/extract_locale.rb +36 -0
- data/app/services/maglev/fetch_collection_items.rb +97 -0
- data/app/services/maglev/fetch_page.rb +26 -0
- data/app/services/maglev/fetch_section_screenshot_path.rb +17 -0
- data/app/services/maglev/fetch_section_screenshot_url.rb +14 -0
- data/app/services/maglev/fetch_sections_path.rb +13 -0
- data/app/services/maglev/fetch_site.rb +20 -0
- data/app/services/maglev/fetch_static_pages.rb +56 -0
- data/app/services/maglev/fetch_style.rb +38 -0
- data/app/services/maglev/fetch_theme.rb +12 -0
- data/app/services/maglev/fetch_theme_layout.rb +14 -0
- data/app/services/maglev/generate_site.rb +26 -0
- data/app/services/maglev/get_base_url.rb +32 -0
- data/app/services/maglev/get_page_fullpath.rb +65 -0
- data/app/services/maglev/get_page_section_names.rb +25 -0
- data/app/services/maglev/get_page_sections.rb +103 -0
- data/app/services/maglev/persist_page.rb +74 -0
- data/app/services/maglev/persist_section_screenshot.rb +58 -0
- data/app/services/maglev/search_pages.rb +60 -0
- data/app/services/maglev/setup_pages.rb +45 -0
- data/app/validators/maglev/collection_validator.rb +24 -0
- data/app/validators/maglev/presence_validator.rb +16 -0
- data/app/views/layouts/maglev/admin/_header_actions.html.erb +5 -0
- data/app/views/layouts/maglev/admin/application.html.erb +25 -0
- data/app/views/maglev/admin/sections/previews/show.html.erb +32 -0
- data/app/views/maglev/admin/themes/_empty.html.erb +20 -0
- data/app/views/maglev/admin/themes/_section_categories.html.erb +9 -0
- data/app/views/maglev/admin/themes/_sections.html.erb +54 -0
- data/app/views/maglev/admin/themes/show.html.erb +21 -0
- data/app/views/maglev/api/_pagination.json.jbuilder +6 -0
- data/app/views/maglev/api/assets/_show.json.jbuilder +8 -0
- data/app/views/maglev/api/assets/index.json.jbuilder +9 -0
- data/app/views/maglev/api/assets/show.json.jbuilder +3 -0
- data/app/views/maglev/api/collection_items/_show.json.jbuilder +5 -0
- data/app/views/maglev/api/collection_items/index.json.jbuilder +5 -0
- data/app/views/maglev/api/pages/index.json.jbuilder +18 -0
- data/app/views/maglev/api/pages/show.json.jbuilder +24 -0
- data/app/views/maglev/api/sites/_show.json.jbuilder +15 -0
- data/app/views/maglev/api/sites/show.json.jbuilder +3 -0
- data/app/views/maglev/api/themes/_show.json.jbuilder +17 -0
- data/app/views/maglev/editor/_header.html.erb +1 -0
- data/app/views/maglev/editor/show.html.erb +39 -0
- data/config/initializers/assets.rb +24 -0
- data/config/initializers/filter_parameters_logging.rb +6 -0
- data/config/initializers/kaminari.rb +16 -0
- data/config/locales/activerecord.en.yml +7 -0
- data/config/locales/activerecord.fr.yml +26 -0
- data/config/routes.rb +46 -0
- data/config/webpack/development.js +5 -0
- data/config/webpack/environment.js +38 -0
- data/config/webpack/loaders/optional_chaining.js +10 -0
- data/config/webpack/loaders/vue.js +6 -0
- data/config/webpack/production.js +5 -0
- data/config/webpack/test.js +5 -0
- data/config/webpacker.yml +95 -0
- data/db/migrate/20200824085207_create_maglev_sites.rb +8 -0
- data/db/migrate/20200824104648_create_maglev_pages.rb +17 -0
- data/db/migrate/20200831101942_create_maglev_section_content.rb +11 -0
- data/db/migrate/20201206172020_create_maglev_assets.rb +13 -0
- data/db/migrate/20210819092740_switch_to_localized_page_fields.rb +17 -0
- data/db/migrate/20210830085101_create_maglev_page_paths.rb +13 -0
- data/db/migrate/20210906102712_add_canonical_to_pages.rb +6 -0
- data/db/migrate/20211008064437_add_locales_to_sites.rb +5 -0
- data/db/migrate/20211013210954_translate_section_content.rb +8 -0
- data/db/migrate/20211101205001_add_lock_version_to_maglev_pages.rb +6 -0
- data/db/migrate/20211116161121_better_page_path_canonical_indices.rb +8 -0
- data/db/migrate/20211124101005_fix_page_path_indices.rb +6 -0
- data/db/migrate/20211203224112_add_open_graph_tags_to_pages.rb +9 -0
- data/db/migrate/20220612092235_add_style_to_sites.rb +7 -0
- data/lib/generators/maglev/install_generator.rb +50 -0
- data/lib/generators/maglev/section_generator.rb +128 -0
- data/lib/generators/maglev/templates/install/config/initializers/maglev.rb +77 -0
- data/lib/generators/maglev/templates/install/public/theme/image-placeholder.jpg +0 -0
- data/lib/generators/maglev/templates/section/app/theme/sections/%category%/%file_name%.yml.tt +102 -0
- data/lib/generators/maglev/templates/section/app/views/theme/sections/%category%/%file_name%.html.erb.tt +55 -0
- data/lib/generators/maglev/templates/theme/app/theme/theme.yml.tt +22 -0
- data/lib/generators/maglev/templates/theme/app/views/theme/layout.html.erb.tt +21 -0
- data/lib/generators/maglev/theme_generator.rb +12 -0
- data/lib/maglev/active_storage.rb +36 -0
- data/lib/maglev/config.rb +9 -0
- data/lib/maglev/engine.rb +65 -0
- data/lib/maglev/errors.rb +8 -0
- data/lib/maglev/i18n.rb +46 -0
- data/lib/maglev/preview_constraint.rb +25 -0
- data/lib/maglev/theme_filesystem_loader.rb +55 -0
- data/lib/maglev/version.rb +5 -0
- data/lib/maglev.rb +70 -0
- data/lib/maglevcms.rb +4 -0
- data/lib/tasks/maglev_tasks.rake +108 -0
- metadata +827 -0
@@ -0,0 +1,91 @@
|
|
1
|
+
export default (services) => ({
|
2
|
+
sectionList: (
|
3
|
+
{ page, sections, sectionBlocks },
|
4
|
+
{ sectionDefinition: getSectiondefinition },
|
5
|
+
) => {
|
6
|
+
const pageContent = services.page.denormalize(page, {
|
7
|
+
sections,
|
8
|
+
blocks: sectionBlocks,
|
9
|
+
})
|
10
|
+
if (!pageContent?.sections) return []
|
11
|
+
return pageContent.sections.map((sectionContent) => {
|
12
|
+
const sectionDefinition = getSectiondefinition(sectionContent)
|
13
|
+
return {
|
14
|
+
id: sectionContent.id,
|
15
|
+
type: sectionContent['type'],
|
16
|
+
name: sectionDefinition.name,
|
17
|
+
viewportFixedPosition: !!sectionDefinition.viewportFixedPosition,
|
18
|
+
}
|
19
|
+
})
|
20
|
+
},
|
21
|
+
defaultPageAttributes: ({ page }) => {
|
22
|
+
if (page.translated) return {}
|
23
|
+
return { title: page.title, path: page.path }
|
24
|
+
},
|
25
|
+
content: (
|
26
|
+
{ page, sections, sectionBlocks, touchedSections },
|
27
|
+
{ sectionDefinition: getSectiondefinition },
|
28
|
+
) => {
|
29
|
+
const pageContent = services.page.denormalize(page, {
|
30
|
+
sections,
|
31
|
+
blocks: sectionBlocks,
|
32
|
+
})
|
33
|
+
const siteSections = pageContent.sections.filter(
|
34
|
+
(sectionContent) => getSectiondefinition(sectionContent).siteScoped,
|
35
|
+
)
|
36
|
+
const hasModifiedSiteScopedSections = siteSections.some(
|
37
|
+
(sectionContent) => touchedSections.indexOf(sectionContent.id) !== -1,
|
38
|
+
)
|
39
|
+
return {
|
40
|
+
pageSections: pageContent.sections,
|
41
|
+
siteSections: hasModifiedSiteScopedSections ? siteSections : [],
|
42
|
+
}
|
43
|
+
},
|
44
|
+
sectionContent: ({ section }) => {
|
45
|
+
return section ? [...section.settings] : null
|
46
|
+
},
|
47
|
+
sectionDefinition:
|
48
|
+
({ theme }) =>
|
49
|
+
(sectionContent) => {
|
50
|
+
return theme.sections.find(
|
51
|
+
(definition) => definition['id'] === sectionContent['type'],
|
52
|
+
)
|
53
|
+
},
|
54
|
+
sectionSettings:
|
55
|
+
({ sectionDefinition }) =>
|
56
|
+
(advanced) => {
|
57
|
+
return services.section.getSettings(sectionDefinition, advanced)
|
58
|
+
},
|
59
|
+
sectionBlocks: ({ sectionBlocks, section, sectionDefinition }) => {
|
60
|
+
if (!section) return []
|
61
|
+
return section.blocks
|
62
|
+
.map((id) => {
|
63
|
+
const sectionBlock = sectionBlocks[id]
|
64
|
+
const definition = sectionDefinition.blocks.find(
|
65
|
+
(def) => def.type === sectionBlock.type,
|
66
|
+
)
|
67
|
+
return definition ? sectionBlock : null
|
68
|
+
})
|
69
|
+
.filter((b) => b)
|
70
|
+
},
|
71
|
+
sectionBlockLabel:
|
72
|
+
({ sectionDefinition }) =>
|
73
|
+
(sectionBlock, index) => {
|
74
|
+
const definition = sectionDefinition.blocks.find(
|
75
|
+
(def) => def.type === sectionBlock.type,
|
76
|
+
)
|
77
|
+
return services.section.getBlockLabel(sectionBlock, definition, index)
|
78
|
+
},
|
79
|
+
sectionBlockIndex: ({ section, sectionBlock }) => {
|
80
|
+
// console.log(section.blocks, sectionBlock)
|
81
|
+
return sectionBlock ? section.blocks.indexOf(sectionBlock.id) + 1 : null
|
82
|
+
},
|
83
|
+
sectionBlockContent: ({ sectionBlock }) => {
|
84
|
+
return sectionBlock ? [...sectionBlock.settings] : null
|
85
|
+
},
|
86
|
+
sectionBlockSettings:
|
87
|
+
({ sectionBlockDefinition }) =>
|
88
|
+
(advanced) => {
|
89
|
+
return services.section.getSettings(sectionBlockDefinition, advanced)
|
90
|
+
},
|
91
|
+
})
|
@@ -0,0 +1,28 @@
|
|
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('setLocale', window.locale)
|
24
|
+
|
25
|
+
if (store.state.editorSettings.sitePublishable)
|
26
|
+
store.dispatch('pollLastPublication')
|
27
|
+
|
28
|
+
export default store
|
@@ -0,0 +1,183 @@
|
|
1
|
+
import { arraymove, pick, omitEmpty } from '@/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
|
+
SET_PREVIEW_DOCUMENT(state, previewDocument) {
|
9
|
+
state.hoveredSection = null
|
10
|
+
state.section = null
|
11
|
+
state.previewReady = !!previewDocument
|
12
|
+
state.previewDocument = previewDocument
|
13
|
+
},
|
14
|
+
SET_EDITOR_SETTINGS(state, editorSettings) {
|
15
|
+
state.editorSettings = editorSettings
|
16
|
+
},
|
17
|
+
SET_SITE(state, site) {
|
18
|
+
state.site = site
|
19
|
+
},
|
20
|
+
SET_STYLE(state, style) {
|
21
|
+
state.style = style
|
22
|
+
},
|
23
|
+
SET_LOCALE(state, locale) {
|
24
|
+
state.locale = locale
|
25
|
+
},
|
26
|
+
SET_THEME(state, theme) {
|
27
|
+
state.theme = theme
|
28
|
+
},
|
29
|
+
SET_PAGE(state, page) {
|
30
|
+
const { entities } = services.page.normalize(page)
|
31
|
+
state.page = entities.page[page.id]
|
32
|
+
state.sections = { ...state.sections, ...entities.sections }
|
33
|
+
state.sectionBlocks = { ...state.sectionBlocks, ...entities.blocks }
|
34
|
+
state.hoveredSection = null
|
35
|
+
},
|
36
|
+
SET_PAGE_SETTINGS(state, page) {
|
37
|
+
const attributes = pick(page, ...PAGE_SETTING_ATTRIBUTES)
|
38
|
+
omitEmpty(attributes)
|
39
|
+
state.page = { ...state.page, ...attributes }
|
40
|
+
},
|
41
|
+
SET_SECTION(state, section) {
|
42
|
+
if (section) {
|
43
|
+
const sectionDefinition = state.theme.sections.find(
|
44
|
+
(definition) => definition['id'] === section['type'],
|
45
|
+
)
|
46
|
+
state.section = { ...section }
|
47
|
+
state.sectionDefinition = { ...sectionDefinition }
|
48
|
+
} else state.section = state.sectionDefinition = null
|
49
|
+
},
|
50
|
+
SET_HOVERED_SECTION(state, hoveredSection) {
|
51
|
+
if (!hoveredSection) {
|
52
|
+
state.hoveredSection = null
|
53
|
+
} else {
|
54
|
+
const section = state.sections[hoveredSection.sectionId]
|
55
|
+
const definition = state.theme.sections.find(
|
56
|
+
(definition) => definition['id'] === section['type'],
|
57
|
+
)
|
58
|
+
state.hoveredSection = {
|
59
|
+
...hoveredSection,
|
60
|
+
name: definition.name,
|
61
|
+
definition,
|
62
|
+
}
|
63
|
+
}
|
64
|
+
},
|
65
|
+
UPDATE_SECTION_CONTENT(state, change) {
|
66
|
+
let updatedSection = { ...state.section }
|
67
|
+
let newContent = { id: change.settingId, value: change.value }
|
68
|
+
let contentIndex = updatedSection.settings.findIndex(
|
69
|
+
(content) => content.id === newContent.id,
|
70
|
+
)
|
71
|
+
|
72
|
+
if (contentIndex === -1) updatedSection.settings.push(newContent)
|
73
|
+
else updatedSection.settings[contentIndex] = newContent
|
74
|
+
|
75
|
+
state.sections[state.section.id] = updatedSection
|
76
|
+
state.section = updatedSection
|
77
|
+
},
|
78
|
+
ADD_SECTION(state, { section, insertAt }) {
|
79
|
+
const {
|
80
|
+
entities: { sections, blocks },
|
81
|
+
} = services.section.normalize(section)
|
82
|
+
state.sections = { ...state.sections, [section.id]: sections[section.id] }
|
83
|
+
state.sectionBlocks = { ...state.sectionBlocks, ...blocks } // hmmm???
|
84
|
+
const updatedPage = { ...state.page }
|
85
|
+
|
86
|
+
switch (insertAt) {
|
87
|
+
case 'top':
|
88
|
+
updatedPage.sections.unshift(section.id)
|
89
|
+
break
|
90
|
+
case 'bottom':
|
91
|
+
case undefined:
|
92
|
+
case null:
|
93
|
+
case '':
|
94
|
+
updatedPage.sections.push(section.id)
|
95
|
+
break
|
96
|
+
default:
|
97
|
+
updatedPage.sections.splice(
|
98
|
+
updatedPage.sections.indexOf(insertAt) + 1,
|
99
|
+
0,
|
100
|
+
section.id,
|
101
|
+
)
|
102
|
+
}
|
103
|
+
|
104
|
+
state.page = updatedPage
|
105
|
+
},
|
106
|
+
REMOVE_SECTION(state, sectionId) {
|
107
|
+
state.page.sections.splice(state.page.sections.indexOf(sectionId), 1)
|
108
|
+
},
|
109
|
+
MOVE_HOVERED_SECTION(state, { fromIndex, toIndex }) {
|
110
|
+
state.page.sections = arraymove(state.page.sections, fromIndex, toIndex)
|
111
|
+
},
|
112
|
+
SET_SECTION_BLOCK(state, sectionBlock) {
|
113
|
+
state.sectionBlock = sectionBlock
|
114
|
+
state.sectionBlockDefinition = state.sectionDefinition.blocks.find(
|
115
|
+
(definition) => definition.type === sectionBlock.type,
|
116
|
+
)
|
117
|
+
},
|
118
|
+
ADD_SECTION_BLOCK(state, sectionBlock) {
|
119
|
+
state.sectionBlocks = {
|
120
|
+
...state.sectionBlocks,
|
121
|
+
[sectionBlock.id]: sectionBlock,
|
122
|
+
}
|
123
|
+
const updatedSection = { ...state.sections[state.section.id] }
|
124
|
+
updatedSection.blocks.push(sectionBlock.id)
|
125
|
+
state.sections = { ...state.sections, [updatedSection.id]: updatedSection }
|
126
|
+
state.section = updatedSection
|
127
|
+
},
|
128
|
+
REMOVE_SECTION_BLOCK(state, sectionBlockId) {
|
129
|
+
const updatedSection = { ...state.sections[state.section.id] }
|
130
|
+
const index = updatedSection.blocks.indexOf(sectionBlockId)
|
131
|
+
updatedSection.blocks.splice(index, 1)
|
132
|
+
state.sections = { ...state.sections, [updatedSection.id]: updatedSection }
|
133
|
+
state.section = updatedSection
|
134
|
+
},
|
135
|
+
SORT_SECTION_BLOCKS(state, list) {
|
136
|
+
const sections = { ...state.sections }
|
137
|
+
sections[state.section.id].blocks = list.map((block) => block.id)
|
138
|
+
// in case we deal with a tree structure, update the parentId attribute only
|
139
|
+
list.forEach(
|
140
|
+
(block) => (state.sectionBlocks[block.id].parentId = block.parentId),
|
141
|
+
)
|
142
|
+
state.section = { ...sections[state.section.id] }
|
143
|
+
state.sections = sections
|
144
|
+
},
|
145
|
+
UPDATE_SECTION_BLOCK_CONTENT(state, change) {
|
146
|
+
let updatedBlock = { ...state.sectionBlocks[state.sectionBlock.id] }
|
147
|
+
let newContent = { id: change.settingId, value: change.value }
|
148
|
+
let contentIndex = updatedBlock.settings.findIndex(
|
149
|
+
(content) => content.id === newContent.id,
|
150
|
+
)
|
151
|
+
|
152
|
+
if (contentIndex === -1) updatedBlock.settings.push(newContent)
|
153
|
+
else updatedBlock.settings[contentIndex] = newContent
|
154
|
+
|
155
|
+
state.sectionBlocks[state.sectionBlock.id] = updatedBlock
|
156
|
+
state.sectionBlock = updatedBlock
|
157
|
+
},
|
158
|
+
TOUCH_SECTION(state, sectionId) {
|
159
|
+
if (state.touchedSections.indexOf(sectionId) === -1) {
|
160
|
+
const newArray = [...state.touchedSections]
|
161
|
+
newArray.push(sectionId)
|
162
|
+
state.touchedSections = newArray
|
163
|
+
}
|
164
|
+
},
|
165
|
+
RESET_TOUCHED_SECTIONS(state) {
|
166
|
+
state.touchedSections = []
|
167
|
+
},
|
168
|
+
// === UI ===
|
169
|
+
SET_PUBLISH_BUTTON_STATE(state, newButton) {
|
170
|
+
state.ui.publishButtonState = newButton
|
171
|
+
},
|
172
|
+
SET_SAVE_BUTTON_STATE(state, buttonState) {
|
173
|
+
state.ui.saveButtonState = buttonState
|
174
|
+
},
|
175
|
+
OPEN_ERROR_MODAL(state, errorType) {
|
176
|
+
state.ui.openErrorModal = true
|
177
|
+
state.ui.errorModalType = errorType
|
178
|
+
},
|
179
|
+
CLEAR_ERROR_MODAL(state) {
|
180
|
+
state.ui.openErrorModal = false
|
181
|
+
state.ui.errorModalType = null
|
182
|
+
},
|
183
|
+
})
|
@@ -0,0 +1,127 @@
|
|
1
|
+
export const isBlank = (object) => {
|
2
|
+
return (
|
3
|
+
object === undefined ||
|
4
|
+
object === null ||
|
5
|
+
(typeof object === 'string' && object.length === 0) ||
|
6
|
+
(typeof object === 'object' && object.length === 0)
|
7
|
+
)
|
8
|
+
}
|
9
|
+
|
10
|
+
export const camelize = (str) => {
|
11
|
+
return str
|
12
|
+
.toLowerCase()
|
13
|
+
.replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase())
|
14
|
+
}
|
15
|
+
|
16
|
+
export const numberToHumanSize = (size, i18n) => {
|
17
|
+
if (isBlank(size)) return null
|
18
|
+
|
19
|
+
let number, unit
|
20
|
+
if (size < 1024) (number = size), (unit = 'byte')
|
21
|
+
else if (size < 1024.0 * 1024.0)
|
22
|
+
(number = (size / 1024.0).toFixed(2).replace('.00', '')), (unit = 'kb')
|
23
|
+
else if (size < 1024.0 * 1024.0 * 1024.0)
|
24
|
+
(number = (size / 1024.0 / 1024.0).toFixed(2)), (unit = 'mb')
|
25
|
+
else (number = (size / 1024.0 / 1024.0 / 1024.0).toFixed(2)), (unit = 'gb')
|
26
|
+
|
27
|
+
let translatedUnit = i18n.tc(
|
28
|
+
`support.human.storageUnits.units.${unit}`,
|
29
|
+
number,
|
30
|
+
)
|
31
|
+
|
32
|
+
return i18n.t(`support.human.storageUnits.format`, {
|
33
|
+
number,
|
34
|
+
unit: translatedUnit,
|
35
|
+
})
|
36
|
+
}
|
37
|
+
|
38
|
+
export const debounce = (fn, time) => {
|
39
|
+
let timeoutId
|
40
|
+
function wrapper(...args) {
|
41
|
+
if (timeoutId) {
|
42
|
+
clearTimeout(timeoutId)
|
43
|
+
}
|
44
|
+
timeoutId = setTimeout(() => {
|
45
|
+
timeoutId = null
|
46
|
+
fn(...args)
|
47
|
+
}, time)
|
48
|
+
}
|
49
|
+
return wrapper
|
50
|
+
}
|
51
|
+
|
52
|
+
export const arraymove = (array, fromIndex, toIndex) => {
|
53
|
+
let newArray = [...array]
|
54
|
+
var element = array[fromIndex]
|
55
|
+
newArray.splice(fromIndex, 1)
|
56
|
+
newArray.splice(toIndex, 0, element)
|
57
|
+
return newArray
|
58
|
+
}
|
59
|
+
|
60
|
+
export const uuid = (length) => {
|
61
|
+
let charset =
|
62
|
+
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'
|
63
|
+
let i
|
64
|
+
let result = ''
|
65
|
+
if (window.crypto && window.crypto.getRandomValues) {
|
66
|
+
let values = new Uint32Array(length)
|
67
|
+
window.crypto.getRandomValues(values)
|
68
|
+
for (i = 0; i < length; i++) {
|
69
|
+
result += charset[values[i] % charset.length]
|
70
|
+
}
|
71
|
+
return result
|
72
|
+
} else
|
73
|
+
throw new Error(
|
74
|
+
"Your browser is too old and can't generate secure random numbers",
|
75
|
+
)
|
76
|
+
}
|
77
|
+
|
78
|
+
export const uuid8 = () => uuid(8)
|
79
|
+
|
80
|
+
export const truncate = (value, limit) => {
|
81
|
+
if (value.length > limit) {
|
82
|
+
value = value.substring(0, limit - 3) + '...'
|
83
|
+
}
|
84
|
+
return value
|
85
|
+
}
|
86
|
+
|
87
|
+
// Like pick of Lodash but without the Lodash dependency
|
88
|
+
export const pick = (obj, ...args) => ({
|
89
|
+
...args.reduce((res, key) => ({ ...res, [key]: obj[key] }), {}),
|
90
|
+
})
|
91
|
+
|
92
|
+
// Remove undefined values from an object
|
93
|
+
export const omitEmpty = (obj) =>
|
94
|
+
Object.keys(obj).forEach((key) => obj[key] === undefined && delete obj[key])
|
95
|
+
|
96
|
+
export const hexToRgb = (hex) => {
|
97
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex.trim())
|
98
|
+
return result
|
99
|
+
? {
|
100
|
+
r: parseInt(result[1], 16),
|
101
|
+
g: parseInt(result[2], 16),
|
102
|
+
b: parseInt(result[3], 16),
|
103
|
+
}
|
104
|
+
: null
|
105
|
+
}
|
106
|
+
|
107
|
+
// Static pages have absolute path ("/something") but regular pages have no leading slash
|
108
|
+
export const formatPath = (path) => {
|
109
|
+
return path[0] === '/' ? path : `/${path}`
|
110
|
+
}
|
111
|
+
|
112
|
+
// https://gist.github.com/ahtcx/0cd94e62691f539160b32ecda18af3d6
|
113
|
+
export const deepMerge = (target, source) => {
|
114
|
+
const result = { ...target, ...source }
|
115
|
+
const keys = Object.keys(result)
|
116
|
+
|
117
|
+
for (const key of keys) {
|
118
|
+
const tprop = target[key]
|
119
|
+
const sprop = source[key]
|
120
|
+
//if two objects are in conflict
|
121
|
+
if (typeof tprop == 'object' && typeof sprop == 'object') {
|
122
|
+
result[key] = deepMerge(tprop, sprop)
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
return result
|
127
|
+
}
|
@@ -0,0 +1,105 @@
|
|
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
|
+
<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'
|
38
|
+
import SectionPane from '@/components/section-pane'
|
39
|
+
import SectionBlockPane from '@/components/section-block-pane'
|
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 this.currentSectionDefinition?.name
|
57
|
+
},
|
58
|
+
sectionBlockTitle() {
|
59
|
+
return (
|
60
|
+
this.currentSectionBlockDefinition?.name +
|
61
|
+
' ' +
|
62
|
+
`#${this.currentSectionBlockIndex}`
|
63
|
+
)
|
64
|
+
},
|
65
|
+
isSectionReady() {
|
66
|
+
return this.sectionId && this.currentSection
|
67
|
+
},
|
68
|
+
isSectionBlockVersion() {
|
69
|
+
return !!this.sectionBlockId
|
70
|
+
},
|
71
|
+
isSectionBlockReady() {
|
72
|
+
return this.isSectionBlockVersion && this.currentSectionBlock
|
73
|
+
},
|
74
|
+
isMaxWidthPane() {
|
75
|
+
return !!this.currentSectionDefinition?.maxWidthPane
|
76
|
+
},
|
77
|
+
reactiveKey() {
|
78
|
+
return [!!this.currentPage, !!this.previewReady, this.$route.path].join(
|
79
|
+
'-',
|
80
|
+
)
|
81
|
+
},
|
82
|
+
},
|
83
|
+
destroyed() {
|
84
|
+
this.fetchSection(null)
|
85
|
+
},
|
86
|
+
methods: {
|
87
|
+
async fetch() {
|
88
|
+
if (this.sectionBlockId) await this.fetchSectionBlock(this.sectionBlockId)
|
89
|
+
else if (this.sectionId) await this.fetchSection(this.sectionId)
|
90
|
+
|
91
|
+
if (!this.currentSection && !this.currentSectionBlock)
|
92
|
+
this.$router.push({ name: 'editPage' })
|
93
|
+
},
|
94
|
+
},
|
95
|
+
watch: {
|
96
|
+
reactiveKey: {
|
97
|
+
immediate: true,
|
98
|
+
handler() {
|
99
|
+
if (!this.currentPage || !this.previewReady) return // wait for the page to be loaded
|
100
|
+
this.fetch()
|
101
|
+
},
|
102
|
+
},
|
103
|
+
},
|
104
|
+
}
|
105
|
+
</script>
|