maglevcms 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (695) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +27 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/config/maglev_manifest.js +1 -0
  6. data/app/assets/images/maglev/favicon.png +0 -0
  7. data/app/assets/images/maglev/logo.png +0 -0
  8. data/app/assets/stylesheets/maglev/application.css +15 -0
  9. data/app/components/maglev/base_component.rb +54 -0
  10. data/app/components/maglev/block_component.rb +46 -0
  11. data/app/components/maglev/content/base.rb +52 -0
  12. data/app/components/maglev/content/builder.rb +28 -0
  13. data/app/components/maglev/content/checkbox.rb +19 -0
  14. data/app/components/maglev/content/collection_item.rb +29 -0
  15. data/app/components/maglev/content/color.rb +20 -0
  16. data/app/components/maglev/content/icon.rb +26 -0
  17. data/app/components/maglev/content/image.rb +55 -0
  18. data/app/components/maglev/content/link.rb +61 -0
  19. data/app/components/maglev/content/select.rb +8 -0
  20. data/app/components/maglev/content/text.rb +25 -0
  21. data/app/components/maglev/page_component.rb +44 -0
  22. data/app/components/maglev/section_component.rb +96 -0
  23. data/app/components/maglev/tag_helper.rb +43 -0
  24. data/app/controllers/concerns/maglev/authentication_concern.rb +31 -0
  25. data/app/controllers/concerns/maglev/back_action_concern.rb +30 -0
  26. data/app/controllers/concerns/maglev/content_locale_concern.rb +26 -0
  27. data/app/controllers/concerns/maglev/fetchers_concern.rb +108 -0
  28. data/app/controllers/concerns/maglev/json_concern.rb +21 -0
  29. data/app/controllers/concerns/maglev/rendering_concern.rb +40 -0
  30. data/app/controllers/concerns/maglev/services_concern.rb +39 -0
  31. data/app/controllers/concerns/maglev/standalone_sections_concern.rb +28 -0
  32. data/app/controllers/concerns/maglev/ui_locale_concern.rb +32 -0
  33. data/app/controllers/maglev/admin/base_controller.rb +21 -0
  34. data/app/controllers/maglev/admin/dashboard_controller.rb +11 -0
  35. data/app/controllers/maglev/admin/sections/previews_controller.rb +52 -0
  36. data/app/controllers/maglev/admin/sections/screenshots_controller.rb +17 -0
  37. data/app/controllers/maglev/admin/themes_controller.rb +19 -0
  38. data/app/controllers/maglev/api/assets_controller.rb +44 -0
  39. data/app/controllers/maglev/api/collection_items_controller.rb +14 -0
  40. data/app/controllers/maglev/api/page_clones_controller.rb +22 -0
  41. data/app/controllers/maglev/api/pages_controller.rb +65 -0
  42. data/app/controllers/maglev/api/publications_controller.rb +15 -0
  43. data/app/controllers/maglev/api/sites_controller.rb +21 -0
  44. data/app/controllers/maglev/api.rb +15 -0
  45. data/app/controllers/maglev/api_controller.rb +61 -0
  46. data/app/controllers/maglev/application_controller.rb +17 -0
  47. data/app/controllers/maglev/assets_controller.rb +10 -0
  48. data/app/controllers/maglev/editor_controller.rb +46 -0
  49. data/app/controllers/maglev/page_preview_controller.rb +53 -0
  50. data/app/helpers/maglev/admin/sections/previews_helper.rb +21 -0
  51. data/app/helpers/maglev/admin/themes_helper.rb +27 -0
  52. data/app/helpers/maglev/application_helper.rb +13 -0
  53. data/app/helpers/maglev/editor_helper.rb +78 -0
  54. data/app/helpers/maglev/page_preview_helper.rb +57 -0
  55. data/app/javascript/controllers/dropdown_controller.js +9 -0
  56. data/app/javascript/controllers/iframe_controller.js +14 -0
  57. data/app/javascript/controllers/index.js +11 -0
  58. data/app/javascript/controllers/screenshot_controller.js +37 -0
  59. data/app/javascript/editor/App.vue +43 -0
  60. data/app/javascript/editor/assets/remixicons/add-box-line.svg +1 -0
  61. data/app/javascript/editor/assets/remixicons/arrow-down-s-line.svg +1 -0
  62. data/app/javascript/editor/assets/remixicons/arrow-drop-left.svg +1 -0
  63. data/app/javascript/editor/assets/remixicons/arrow-drop-right.svg +1 -0
  64. data/app/javascript/editor/assets/remixicons/arrow-up-s-line.svg +1 -0
  65. data/app/javascript/editor/assets/remixicons/camera-line.svg +1 -0
  66. data/app/javascript/editor/assets/remixicons/check-line.svg +1 -0
  67. data/app/javascript/editor/assets/remixicons/close-line.svg +1 -0
  68. data/app/javascript/editor/assets/remixicons/computer-line.svg +1 -0
  69. data/app/javascript/editor/assets/remixicons/delete-bin-line.svg +1 -0
  70. data/app/javascript/editor/assets/remixicons/file-line.svg +1 -0
  71. data/app/javascript/editor/assets/remixicons/format-blockquote.svg +1 -0
  72. data/app/javascript/editor/assets/remixicons/format-bold.svg +1 -0
  73. data/app/javascript/editor/assets/remixicons/format-code.svg +1 -0
  74. data/app/javascript/editor/assets/remixicons/format-heading-2.svg +1 -0
  75. data/app/javascript/editor/assets/remixicons/format-heading-3.svg +1 -0
  76. data/app/javascript/editor/assets/remixicons/format-heading-4.svg +1 -0
  77. data/app/javascript/editor/assets/remixicons/format-italic.svg +1 -0
  78. data/app/javascript/editor/assets/remixicons/format-link-unlink.svg +1 -0
  79. data/app/javascript/editor/assets/remixicons/format-link.svg +1 -0
  80. data/app/javascript/editor/assets/remixicons/format-list-ordered.svg +1 -0
  81. data/app/javascript/editor/assets/remixicons/format-list-unordered.svg +1 -0
  82. data/app/javascript/editor/assets/remixicons/format-paragraph.svg +1 -0
  83. data/app/javascript/editor/assets/remixicons/format-strikethrough.svg +1 -0
  84. data/app/javascript/editor/assets/remixicons/format-underline.svg +1 -0
  85. data/app/javascript/editor/assets/remixicons/home-4-line.svg +1 -0
  86. data/app/javascript/editor/assets/remixicons/image-line.svg +1 -0
  87. data/app/javascript/editor/assets/remixicons/logout-box-r-line.svg +1 -0
  88. data/app/javascript/editor/assets/remixicons/ri-add-line.svg +1 -0
  89. data/app/javascript/editor/assets/remixicons/ri-alert-line.svg +1 -0
  90. data/app/javascript/editor/assets/remixicons/ri-book-line.svg +1 -0
  91. data/app/javascript/editor/assets/remixicons/ri-bug-line.svg +1 -0
  92. data/app/javascript/editor/assets/remixicons/ri-close-circle-line.svg +1 -0
  93. data/app/javascript/editor/assets/remixicons/ri-close-line.svg +1 -0
  94. data/app/javascript/editor/assets/remixicons/ri-delete-column.svg +1 -0
  95. data/app/javascript/editor/assets/remixicons/ri-delete-row.svg +1 -0
  96. data/app/javascript/editor/assets/remixicons/ri-drop-line.svg +1 -0
  97. data/app/javascript/editor/assets/remixicons/ri-external-link-line.svg +1 -0
  98. data/app/javascript/editor/assets/remixicons/ri-eye-line.svg +1 -0
  99. data/app/javascript/editor/assets/remixicons/ri-eye-off-line.svg +1 -0
  100. data/app/javascript/editor/assets/remixicons/ri-file-copy-line.svg +1 -0
  101. data/app/javascript/editor/assets/remixicons/ri-file-line.svg +1 -0
  102. data/app/javascript/editor/assets/remixicons/ri-global-line.svg +1 -0
  103. data/app/javascript/editor/assets/remixicons/ri-insert-column-left.svg +1 -0
  104. data/app/javascript/editor/assets/remixicons/ri-insert-column-right.svg +1 -0
  105. data/app/javascript/editor/assets/remixicons/ri-insert-row-bottom.svg +1 -0
  106. data/app/javascript/editor/assets/remixicons/ri-insert-row-top.svg +1 -0
  107. data/app/javascript/editor/assets/remixicons/ri-loader-4-line.svg +1 -0
  108. data/app/javascript/editor/assets/remixicons/ri-mail-line.svg +1 -0
  109. data/app/javascript/editor/assets/remixicons/ri-more-2-fill.svg +1 -0
  110. data/app/javascript/editor/assets/remixicons/ri-pencil-line.svg +1 -0
  111. data/app/javascript/editor/assets/remixicons/ri-play-list-add-line.svg +1 -0
  112. data/app/javascript/editor/assets/remixicons/ri-settings-5-line.svg +1 -0
  113. data/app/javascript/editor/assets/remixicons/ri-stack-line.svg +1 -0
  114. data/app/javascript/editor/assets/remixicons/ri-table-2.svg +1 -0
  115. data/app/javascript/editor/assets/remixicons/ri-table-line.svg +1 -0
  116. data/app/javascript/editor/assets/remixicons/search-line.svg +1 -0
  117. data/app/javascript/editor/assets/remixicons/settings-4-line.svg +1 -0
  118. data/app/javascript/editor/assets/remixicons/smartphone-line.svg +1 -0
  119. data/app/javascript/editor/assets/remixicons/tablet-line.svg +1 -0
  120. data/app/javascript/editor/assets/zondicons/add-outline.svg +1 -0
  121. data/app/javascript/editor/assets/zondicons/add-solid.svg +1 -0
  122. data/app/javascript/editor/assets/zondicons/adjust.svg +1 -0
  123. data/app/javascript/editor/assets/zondicons/airplane.svg +1 -0
  124. data/app/javascript/editor/assets/zondicons/album.svg +1 -0
  125. data/app/javascript/editor/assets/zondicons/align-center.svg +1 -0
  126. data/app/javascript/editor/assets/zondicons/align-justified.svg +1 -0
  127. data/app/javascript/editor/assets/zondicons/align-left.svg +1 -0
  128. data/app/javascript/editor/assets/zondicons/align-right.svg +1 -0
  129. data/app/javascript/editor/assets/zondicons/anchor.svg +1 -0
  130. data/app/javascript/editor/assets/zondicons/announcement.svg +1 -0
  131. data/app/javascript/editor/assets/zondicons/apparel.svg +1 -0
  132. data/app/javascript/editor/assets/zondicons/arrow-down.svg +1 -0
  133. data/app/javascript/editor/assets/zondicons/arrow-left.svg +1 -0
  134. data/app/javascript/editor/assets/zondicons/arrow-outline-down.svg +1 -0
  135. data/app/javascript/editor/assets/zondicons/arrow-outline-left.svg +1 -0
  136. data/app/javascript/editor/assets/zondicons/arrow-outline-right.svg +1 -0
  137. data/app/javascript/editor/assets/zondicons/arrow-outline-up.svg +1 -0
  138. data/app/javascript/editor/assets/zondicons/arrow-right.svg +1 -0
  139. data/app/javascript/editor/assets/zondicons/arrow-thick-down.svg +1 -0
  140. data/app/javascript/editor/assets/zondicons/arrow-thick-left.svg +1 -0
  141. data/app/javascript/editor/assets/zondicons/arrow-thick-right.svg +1 -0
  142. data/app/javascript/editor/assets/zondicons/arrow-thick-up.svg +1 -0
  143. data/app/javascript/editor/assets/zondicons/arrow-thin-down.svg +1 -0
  144. data/app/javascript/editor/assets/zondicons/arrow-thin-left.svg +1 -0
  145. data/app/javascript/editor/assets/zondicons/arrow-thin-right.svg +1 -0
  146. data/app/javascript/editor/assets/zondicons/arrow-thin-up.svg +1 -0
  147. data/app/javascript/editor/assets/zondicons/arrow-up.svg +1 -0
  148. data/app/javascript/editor/assets/zondicons/artist.svg +1 -0
  149. data/app/javascript/editor/assets/zondicons/at-symbol.svg +1 -0
  150. data/app/javascript/editor/assets/zondicons/attachment.svg +1 -0
  151. data/app/javascript/editor/assets/zondicons/backspace.svg +1 -0
  152. data/app/javascript/editor/assets/zondicons/backward-step.svg +1 -0
  153. data/app/javascript/editor/assets/zondicons/backward.svg +1 -0
  154. data/app/javascript/editor/assets/zondicons/badge.svg +1 -0
  155. data/app/javascript/editor/assets/zondicons/battery-full.svg +1 -0
  156. data/app/javascript/editor/assets/zondicons/battery-half.svg +1 -0
  157. data/app/javascript/editor/assets/zondicons/battery-low.svg +1 -0
  158. data/app/javascript/editor/assets/zondicons/beverage.svg +1 -0
  159. data/app/javascript/editor/assets/zondicons/block.svg +1 -0
  160. data/app/javascript/editor/assets/zondicons/bluetooth.svg +1 -0
  161. data/app/javascript/editor/assets/zondicons/bolt.svg +1 -0
  162. data/app/javascript/editor/assets/zondicons/book-reference.svg +1 -0
  163. data/app/javascript/editor/assets/zondicons/bookmark copy 2.svg +1 -0
  164. data/app/javascript/editor/assets/zondicons/bookmark copy 3.svg +1 -0
  165. data/app/javascript/editor/assets/zondicons/bookmark-outline-add.svg +1 -0
  166. data/app/javascript/editor/assets/zondicons/bookmark-outline.svg +1 -0
  167. data/app/javascript/editor/assets/zondicons/bookmark.svg +1 -0
  168. data/app/javascript/editor/assets/zondicons/border-all.svg +1 -0
  169. data/app/javascript/editor/assets/zondicons/border-bottom.svg +1 -0
  170. data/app/javascript/editor/assets/zondicons/border-horizontal.svg +1 -0
  171. data/app/javascript/editor/assets/zondicons/border-inner.svg +1 -0
  172. data/app/javascript/editor/assets/zondicons/border-left.svg +1 -0
  173. data/app/javascript/editor/assets/zondicons/border-none.svg +1 -0
  174. data/app/javascript/editor/assets/zondicons/border-outer.svg +1 -0
  175. data/app/javascript/editor/assets/zondicons/border-right.svg +1 -0
  176. data/app/javascript/editor/assets/zondicons/border-top.svg +1 -0
  177. data/app/javascript/editor/assets/zondicons/border-vertical.svg +1 -0
  178. data/app/javascript/editor/assets/zondicons/box.svg +1 -0
  179. data/app/javascript/editor/assets/zondicons/brightness-down.svg +1 -0
  180. data/app/javascript/editor/assets/zondicons/brightness-up.svg +1 -0
  181. data/app/javascript/editor/assets/zondicons/browser-window-new.svg +1 -0
  182. data/app/javascript/editor/assets/zondicons/browser-window-open.svg +1 -0
  183. data/app/javascript/editor/assets/zondicons/browser-window.svg +1 -0
  184. data/app/javascript/editor/assets/zondicons/bug.svg +1 -0
  185. data/app/javascript/editor/assets/zondicons/buoy.svg +1 -0
  186. data/app/javascript/editor/assets/zondicons/calculator.svg +1 -0
  187. data/app/javascript/editor/assets/zondicons/calendar.svg +1 -0
  188. data/app/javascript/editor/assets/zondicons/camera.svg +1 -0
  189. data/app/javascript/editor/assets/zondicons/chart-bar.svg +1 -0
  190. data/app/javascript/editor/assets/zondicons/chart-pie.svg +1 -0
  191. data/app/javascript/editor/assets/zondicons/chart.svg +1 -0
  192. data/app/javascript/editor/assets/zondicons/chat-bubble-dots.svg +1 -0
  193. data/app/javascript/editor/assets/zondicons/checkmark-outline.svg +1 -0
  194. data/app/javascript/editor/assets/zondicons/checkmark.svg +1 -0
  195. data/app/javascript/editor/assets/zondicons/cheveron-down.svg +1 -0
  196. data/app/javascript/editor/assets/zondicons/cheveron-left.svg +1 -0
  197. data/app/javascript/editor/assets/zondicons/cheveron-outline-down.svg +1 -0
  198. data/app/javascript/editor/assets/zondicons/cheveron-outline-left.svg +1 -0
  199. data/app/javascript/editor/assets/zondicons/cheveron-outline-right.svg +1 -0
  200. data/app/javascript/editor/assets/zondicons/cheveron-outline-up.svg +1 -0
  201. data/app/javascript/editor/assets/zondicons/cheveron-right.svg +1 -0
  202. data/app/javascript/editor/assets/zondicons/cheveron-up.svg +1 -0
  203. data/app/javascript/editor/assets/zondicons/clipboard.svg +1 -0
  204. data/app/javascript/editor/assets/zondicons/close-outline.svg +1 -0
  205. data/app/javascript/editor/assets/zondicons/close-solid.svg +1 -0
  206. data/app/javascript/editor/assets/zondicons/close.svg +1 -0
  207. data/app/javascript/editor/assets/zondicons/cloud-upload.svg +1 -0
  208. data/app/javascript/editor/assets/zondicons/cloud.svg +1 -0
  209. data/app/javascript/editor/assets/zondicons/code.svg +1 -0
  210. data/app/javascript/editor/assets/zondicons/coffee.svg +1 -0
  211. data/app/javascript/editor/assets/zondicons/cog.svg +1 -0
  212. data/app/javascript/editor/assets/zondicons/color-palette.svg +1 -0
  213. data/app/javascript/editor/assets/zondicons/compose.svg +1 -0
  214. data/app/javascript/editor/assets/zondicons/computer-desktop.svg +1 -0
  215. data/app/javascript/editor/assets/zondicons/computer-laptop.svg +1 -0
  216. data/app/javascript/editor/assets/zondicons/conversation.svg +1 -0
  217. data/app/javascript/editor/assets/zondicons/copy.svg +1 -0
  218. data/app/javascript/editor/assets/zondicons/credit-card.svg +1 -0
  219. data/app/javascript/editor/assets/zondicons/currency-dollar.svg +1 -0
  220. data/app/javascript/editor/assets/zondicons/dashboard.svg +1 -0
  221. data/app/javascript/editor/assets/zondicons/date-add.svg +1 -0
  222. data/app/javascript/editor/assets/zondicons/dial-pad.svg +1 -0
  223. data/app/javascript/editor/assets/zondicons/directions.svg +1 -0
  224. data/app/javascript/editor/assets/zondicons/document-add.svg +1 -0
  225. data/app/javascript/editor/assets/zondicons/document.svg +1 -0
  226. data/app/javascript/editor/assets/zondicons/dots-horizontal-double.svg +1 -0
  227. data/app/javascript/editor/assets/zondicons/dots-horizontal-triple.svg +1 -0
  228. data/app/javascript/editor/assets/zondicons/download.svg +1 -0
  229. data/app/javascript/editor/assets/zondicons/duplicate.svg +1 -0
  230. data/app/javascript/editor/assets/zondicons/edit-copy.svg +1 -0
  231. data/app/javascript/editor/assets/zondicons/edit-crop.svg +1 -0
  232. data/app/javascript/editor/assets/zondicons/edit-cut.svg +1 -0
  233. data/app/javascript/editor/assets/zondicons/edit-pencil.svg +1 -0
  234. data/app/javascript/editor/assets/zondicons/education.svg +1 -0
  235. data/app/javascript/editor/assets/zondicons/envelope.svg +1 -0
  236. data/app/javascript/editor/assets/zondicons/exclamation-outline.svg +1 -0
  237. data/app/javascript/editor/assets/zondicons/exclamation-solid.svg +1 -0
  238. data/app/javascript/editor/assets/zondicons/explore.svg +1 -0
  239. data/app/javascript/editor/assets/zondicons/factory.svg +1 -0
  240. data/app/javascript/editor/assets/zondicons/fast-forward.svg +1 -0
  241. data/app/javascript/editor/assets/zondicons/fast-rewind.svg +1 -0
  242. data/app/javascript/editor/assets/zondicons/film.svg +1 -0
  243. data/app/javascript/editor/assets/zondicons/filter.svg +1 -0
  244. data/app/javascript/editor/assets/zondicons/flag.svg +1 -0
  245. data/app/javascript/editor/assets/zondicons/flashlight.svg +1 -0
  246. data/app/javascript/editor/assets/zondicons/folder-outline-add.svg +1 -0
  247. data/app/javascript/editor/assets/zondicons/folder-outline.svg +1 -0
  248. data/app/javascript/editor/assets/zondicons/folder.svg +1 -0
  249. data/app/javascript/editor/assets/zondicons/format-bold.svg +1 -0
  250. data/app/javascript/editor/assets/zondicons/format-font-size.svg +1 -0
  251. data/app/javascript/editor/assets/zondicons/format-italic.svg +1 -0
  252. data/app/javascript/editor/assets/zondicons/format-text-size.svg +1 -0
  253. data/app/javascript/editor/assets/zondicons/format-underline.svg +1 -0
  254. data/app/javascript/editor/assets/zondicons/forward-step.svg +1 -0
  255. data/app/javascript/editor/assets/zondicons/forward.svg +1 -0
  256. data/app/javascript/editor/assets/zondicons/gift.svg +1 -0
  257. data/app/javascript/editor/assets/zondicons/globe.svg +1 -0
  258. data/app/javascript/editor/assets/zondicons/hand-stop.svg +1 -0
  259. data/app/javascript/editor/assets/zondicons/hard-drive.svg +1 -0
  260. data/app/javascript/editor/assets/zondicons/headphones.svg +1 -0
  261. data/app/javascript/editor/assets/zondicons/heart.svg +1 -0
  262. data/app/javascript/editor/assets/zondicons/home.svg +1 -0
  263. data/app/javascript/editor/assets/zondicons/hot.svg +1 -0
  264. data/app/javascript/editor/assets/zondicons/hour-glass.svg +1 -0
  265. data/app/javascript/editor/assets/zondicons/inbox-check.svg +1 -0
  266. data/app/javascript/editor/assets/zondicons/inbox-download.svg +1 -0
  267. data/app/javascript/editor/assets/zondicons/inbox-full.svg +1 -0
  268. data/app/javascript/editor/assets/zondicons/inbox.svg +1 -0
  269. data/app/javascript/editor/assets/zondicons/indent-decrease.svg +1 -0
  270. data/app/javascript/editor/assets/zondicons/indent-increase.svg +1 -0
  271. data/app/javascript/editor/assets/zondicons/information-outline.svg +1 -0
  272. data/app/javascript/editor/assets/zondicons/information-solid.svg +1 -0
  273. data/app/javascript/editor/assets/zondicons/key.svg +1 -0
  274. data/app/javascript/editor/assets/zondicons/keyboard.svg +1 -0
  275. data/app/javascript/editor/assets/zondicons/layers.svg +1 -0
  276. data/app/javascript/editor/assets/zondicons/library.svg +1 -0
  277. data/app/javascript/editor/assets/zondicons/light-bulb.svg +1 -0
  278. data/app/javascript/editor/assets/zondicons/link.svg +1 -0
  279. data/app/javascript/editor/assets/zondicons/list-add.svg +1 -0
  280. data/app/javascript/editor/assets/zondicons/list-bullet.svg +1 -0
  281. data/app/javascript/editor/assets/zondicons/list.svg +1 -0
  282. data/app/javascript/editor/assets/zondicons/load-balancer.svg +1 -0
  283. data/app/javascript/editor/assets/zondicons/location-current.svg +1 -0
  284. data/app/javascript/editor/assets/zondicons/location-food.svg +1 -0
  285. data/app/javascript/editor/assets/zondicons/location-gas-station.svg +1 -0
  286. data/app/javascript/editor/assets/zondicons/location-hotel.svg +1 -0
  287. data/app/javascript/editor/assets/zondicons/location-marina.svg +1 -0
  288. data/app/javascript/editor/assets/zondicons/location-park.svg +1 -0
  289. data/app/javascript/editor/assets/zondicons/location-restroom.svg +1 -0
  290. data/app/javascript/editor/assets/zondicons/location-shopping.svg +1 -0
  291. data/app/javascript/editor/assets/zondicons/location.svg +1 -0
  292. data/app/javascript/editor/assets/zondicons/lock-closed.svg +1 -0
  293. data/app/javascript/editor/assets/zondicons/lock-open.svg +1 -0
  294. data/app/javascript/editor/assets/zondicons/map.svg +1 -0
  295. data/app/javascript/editor/assets/zondicons/menu.svg +1 -0
  296. data/app/javascript/editor/assets/zondicons/mic.svg +1 -0
  297. data/app/javascript/editor/assets/zondicons/minus-outline.svg +1 -0
  298. data/app/javascript/editor/assets/zondicons/minus-solid.svg +1 -0
  299. data/app/javascript/editor/assets/zondicons/mobile-devices.svg +1 -0
  300. data/app/javascript/editor/assets/zondicons/mood-happy-outline.svg +1 -0
  301. data/app/javascript/editor/assets/zondicons/mood-happy-solid.svg +1 -0
  302. data/app/javascript/editor/assets/zondicons/mood-neutral-outline.svg +1 -0
  303. data/app/javascript/editor/assets/zondicons/mood-neutral-solid.svg +1 -0
  304. data/app/javascript/editor/assets/zondicons/mood-sad-outline.svg +1 -0
  305. data/app/javascript/editor/assets/zondicons/mood-sad-solid.svg +1 -0
  306. data/app/javascript/editor/assets/zondicons/mouse.svg +1 -0
  307. data/app/javascript/editor/assets/zondicons/music-album.svg +1 -0
  308. data/app/javascript/editor/assets/zondicons/music-artist.svg +1 -0
  309. data/app/javascript/editor/assets/zondicons/music-notes.svg +1 -0
  310. data/app/javascript/editor/assets/zondicons/music-playlist.svg +1 -0
  311. data/app/javascript/editor/assets/zondicons/navigation-more.svg +1 -0
  312. data/app/javascript/editor/assets/zondicons/network.svg +1 -0
  313. data/app/javascript/editor/assets/zondicons/news-paper.svg +1 -0
  314. data/app/javascript/editor/assets/zondicons/notification.svg +1 -0
  315. data/app/javascript/editor/assets/zondicons/notifications-outline.svg +1 -0
  316. data/app/javascript/editor/assets/zondicons/notifications.svg +1 -0
  317. data/app/javascript/editor/assets/zondicons/paste.svg +1 -0
  318. data/app/javascript/editor/assets/zondicons/pause-outline.svg +1 -0
  319. data/app/javascript/editor/assets/zondicons/pause-solid.svg +1 -0
  320. data/app/javascript/editor/assets/zondicons/pause.svg +1 -0
  321. data/app/javascript/editor/assets/zondicons/pen-tool.svg +1 -0
  322. data/app/javascript/editor/assets/zondicons/phone.svg +1 -0
  323. data/app/javascript/editor/assets/zondicons/photo.svg +1 -0
  324. data/app/javascript/editor/assets/zondicons/php-elephant.svg +1 -0
  325. data/app/javascript/editor/assets/zondicons/pin.svg +1 -0
  326. data/app/javascript/editor/assets/zondicons/play-outline.svg +1 -0
  327. data/app/javascript/editor/assets/zondicons/play.svg +1 -0
  328. data/app/javascript/editor/assets/zondicons/playlist.svg +1 -0
  329. data/app/javascript/editor/assets/zondicons/plugin.svg +1 -0
  330. data/app/javascript/editor/assets/zondicons/portfolio.svg +1 -0
  331. data/app/javascript/editor/assets/zondicons/printer.svg +1 -0
  332. data/app/javascript/editor/assets/zondicons/pylon.svg +1 -0
  333. data/app/javascript/editor/assets/zondicons/question.svg +1 -0
  334. data/app/javascript/editor/assets/zondicons/queue.svg +1 -0
  335. data/app/javascript/editor/assets/zondicons/radar copy 2.svg +1 -0
  336. data/app/javascript/editor/assets/zondicons/radar.svg +1 -0
  337. data/app/javascript/editor/assets/zondicons/radio.svg +1 -0
  338. data/app/javascript/editor/assets/zondicons/refresh.svg +1 -0
  339. data/app/javascript/editor/assets/zondicons/reload.svg +1 -0
  340. data/app/javascript/editor/assets/zondicons/reply-all.svg +1 -0
  341. data/app/javascript/editor/assets/zondicons/reply.svg +1 -0
  342. data/app/javascript/editor/assets/zondicons/repost.svg +1 -0
  343. data/app/javascript/editor/assets/zondicons/save-disk.svg +1 -0
  344. data/app/javascript/editor/assets/zondicons/screen-full.svg +1 -0
  345. data/app/javascript/editor/assets/zondicons/search.svg +1 -0
  346. data/app/javascript/editor/assets/zondicons/send.svg +1 -0
  347. data/app/javascript/editor/assets/zondicons/servers.svg +1 -0
  348. data/app/javascript/editor/assets/zondicons/share-01.svg +1 -0
  349. data/app/javascript/editor/assets/zondicons/share-alt.svg +1 -0
  350. data/app/javascript/editor/assets/zondicons/share.svg +1 -0
  351. data/app/javascript/editor/assets/zondicons/shield.svg +1 -0
  352. data/app/javascript/editor/assets/zondicons/shopping-cart.svg +1 -0
  353. data/app/javascript/editor/assets/zondicons/show-sidebar.svg +1 -0
  354. data/app/javascript/editor/assets/zondicons/shuffle.svg +1 -0
  355. data/app/javascript/editor/assets/zondicons/stand-by.svg +1 -0
  356. data/app/javascript/editor/assets/zondicons/star-full.svg +1 -0
  357. data/app/javascript/editor/assets/zondicons/station.svg +1 -0
  358. data/app/javascript/editor/assets/zondicons/step-backward.svg +1 -0
  359. data/app/javascript/editor/assets/zondicons/step-forward.svg +1 -0
  360. data/app/javascript/editor/assets/zondicons/stethoscope.svg +1 -0
  361. data/app/javascript/editor/assets/zondicons/store-front.svg +1 -0
  362. data/app/javascript/editor/assets/zondicons/stroke-width.svg +1 -0
  363. data/app/javascript/editor/assets/zondicons/subdirectory-left.svg +1 -0
  364. data/app/javascript/editor/assets/zondicons/subdirectory-right.svg +1 -0
  365. data/app/javascript/editor/assets/zondicons/swap.svg +1 -0
  366. data/app/javascript/editor/assets/zondicons/tablet.svg +1 -0
  367. data/app/javascript/editor/assets/zondicons/tag.svg +1 -0
  368. data/app/javascript/editor/assets/zondicons/target.svg +1 -0
  369. data/app/javascript/editor/assets/zondicons/text-box.svg +1 -0
  370. data/app/javascript/editor/assets/zondicons/text-decoration.svg +1 -0
  371. data/app/javascript/editor/assets/zondicons/thermometer.svg +1 -0
  372. data/app/javascript/editor/assets/zondicons/thumbs-down.svg +1 -0
  373. data/app/javascript/editor/assets/zondicons/thumbs-up.svg +1 -0
  374. data/app/javascript/editor/assets/zondicons/ticket.svg +1 -0
  375. data/app/javascript/editor/assets/zondicons/time.svg +1 -0
  376. data/app/javascript/editor/assets/zondicons/timer.svg +1 -0
  377. data/app/javascript/editor/assets/zondicons/tools copy.svg +1 -0
  378. data/app/javascript/editor/assets/zondicons/translate.svg +1 -0
  379. data/app/javascript/editor/assets/zondicons/trash.svg +1 -0
  380. data/app/javascript/editor/assets/zondicons/travel-bus.svg +1 -0
  381. data/app/javascript/editor/assets/zondicons/travel-car.svg +1 -0
  382. data/app/javascript/editor/assets/zondicons/travel-case.svg +1 -0
  383. data/app/javascript/editor/assets/zondicons/travel-taxi-cab.svg +1 -0
  384. data/app/javascript/editor/assets/zondicons/travel-train.svg +1 -0
  385. data/app/javascript/editor/assets/zondicons/travel-walk.svg +1 -0
  386. data/app/javascript/editor/assets/zondicons/travel.svg +1 -0
  387. data/app/javascript/editor/assets/zondicons/trophy.svg +1 -0
  388. data/app/javascript/editor/assets/zondicons/tuning.svg +1 -0
  389. data/app/javascript/editor/assets/zondicons/upload.svg +1 -0
  390. data/app/javascript/editor/assets/zondicons/usb.svg +1 -0
  391. data/app/javascript/editor/assets/zondicons/user-add.svg +1 -0
  392. data/app/javascript/editor/assets/zondicons/user-group.svg +1 -0
  393. data/app/javascript/editor/assets/zondicons/user-solid-circle.svg +1 -0
  394. data/app/javascript/editor/assets/zondicons/user-solid-square.svg +1 -0
  395. data/app/javascript/editor/assets/zondicons/user.svg +1 -0
  396. data/app/javascript/editor/assets/zondicons/vector.svg +1 -0
  397. data/app/javascript/editor/assets/zondicons/video-camera.svg +1 -0
  398. data/app/javascript/editor/assets/zondicons/view-carousel.svg +1 -0
  399. data/app/javascript/editor/assets/zondicons/view-column.svg +1 -0
  400. data/app/javascript/editor/assets/zondicons/view-hide.svg +1 -0
  401. data/app/javascript/editor/assets/zondicons/view-list.svg +1 -0
  402. data/app/javascript/editor/assets/zondicons/view-show.svg +1 -0
  403. data/app/javascript/editor/assets/zondicons/view-tile.svg +1 -0
  404. data/app/javascript/editor/assets/zondicons/volume-down.svg +1 -0
  405. data/app/javascript/editor/assets/zondicons/volume-mute.svg +1 -0
  406. data/app/javascript/editor/assets/zondicons/volume-off.svg +1 -0
  407. data/app/javascript/editor/assets/zondicons/volume-up.svg +1 -0
  408. data/app/javascript/editor/assets/zondicons/wallet.svg +1 -0
  409. data/app/javascript/editor/assets/zondicons/watch.svg +1 -0
  410. data/app/javascript/editor/assets/zondicons/window-new.svg +1 -0
  411. data/app/javascript/editor/assets/zondicons/window-open.svg +1 -0
  412. data/app/javascript/editor/assets/zondicons/window.svg +1 -0
  413. data/app/javascript/editor/assets/zondicons/wrench.svg +1 -0
  414. data/app/javascript/editor/assets/zondicons/yin-yang.svg +1 -0
  415. data/app/javascript/editor/assets/zondicons/zoom-in.svg +1 -0
  416. data/app/javascript/editor/assets/zondicons/zoom-out.svg +1 -0
  417. data/app/javascript/editor/components/dynamic-form/dynamic-input.vue +121 -0
  418. data/app/javascript/editor/components/dynamic-form/index.vue +34 -0
  419. data/app/javascript/editor/components/errors/stale-record.vue +24 -0
  420. data/app/javascript/editor/components/header-nav/device-toggler.vue +37 -0
  421. data/app/javascript/editor/components/header-nav/index.vue +103 -0
  422. data/app/javascript/editor/components/header-nav/locale-toggler/index.vue +51 -0
  423. data/app/javascript/editor/components/header-nav/locale-toggler/locale-link.vue +32 -0
  424. data/app/javascript/editor/components/header-nav/preview-button.vue +15 -0
  425. data/app/javascript/editor/components/header-nav/preview-toggler.vue +40 -0
  426. data/app/javascript/editor/components/header-nav/publish-button.vue +87 -0
  427. data/app/javascript/editor/components/header-nav/save-button.vue +42 -0
  428. data/app/javascript/editor/components/header-nav/separator.vue +11 -0
  429. data/app/javascript/editor/components/icon-library/index.vue +39 -0
  430. data/app/javascript/editor/components/image-library/index.vue +110 -0
  431. data/app/javascript/editor/components/image-library/list-item.vue +93 -0
  432. data/app/javascript/editor/components/image-library/list.vue +26 -0
  433. data/app/javascript/editor/components/image-library/uploader.vue +78 -0
  434. data/app/javascript/editor/components/kit/accordion.vue +63 -0
  435. data/app/javascript/editor/components/kit/checkbox-input.vue +59 -0
  436. data/app/javascript/editor/components/kit/collection-item-input.vue +64 -0
  437. data/app/javascript/editor/components/kit/color-picker.vue +81 -0
  438. data/app/javascript/editor/components/kit/confirmation-button.vue +65 -0
  439. data/app/javascript/editor/components/kit/dropdown.vue +60 -0
  440. data/app/javascript/editor/components/kit/icon-input.vue +96 -0
  441. data/app/javascript/editor/components/kit/icon.vue +35 -0
  442. data/app/javascript/editor/components/kit/image-input.vue +124 -0
  443. data/app/javascript/editor/components/kit/index.js +50 -0
  444. data/app/javascript/editor/components/kit/link-input.vue +117 -0
  445. data/app/javascript/editor/components/kit/list-item-button.vue +16 -0
  446. data/app/javascript/editor/components/kit/modal-root.vue +81 -0
  447. data/app/javascript/editor/components/kit/modal.vue +39 -0
  448. data/app/javascript/editor/components/kit/page-icon.vue +21 -0
  449. data/app/javascript/editor/components/kit/pagination/button.vue +35 -0
  450. data/app/javascript/editor/components/kit/pagination/index.vue +116 -0
  451. data/app/javascript/editor/components/kit/rich-text-input/block-button.vue +75 -0
  452. data/app/javascript/editor/components/kit/rich-text-input/extensions/Doc.js +12 -0
  453. data/app/javascript/editor/components/kit/rich-text-input/extensions/LineBreak.js +38 -0
  454. data/app/javascript/editor/components/kit/rich-text-input/extensions/marks/Link.js +57 -0
  455. data/app/javascript/editor/components/kit/rich-text-input/format-buttons.vue +39 -0
  456. data/app/javascript/editor/components/kit/rich-text-input/link-buttons.vue +91 -0
  457. data/app/javascript/editor/components/kit/rich-text-input/list-buttons.vue +29 -0
  458. data/app/javascript/editor/components/kit/rich-text-input/menu-button.vue +22 -0
  459. data/app/javascript/editor/components/kit/rich-text-input/table-button.vue +106 -0
  460. data/app/javascript/editor/components/kit/rich-text-input.vue +181 -0
  461. data/app/javascript/editor/components/kit/search-input.vue +53 -0
  462. data/app/javascript/editor/components/kit/select-input.vue +188 -0
  463. data/app/javascript/editor/components/kit/simple-select.vue +44 -0
  464. data/app/javascript/editor/components/kit/submit-button.vue +117 -0
  465. data/app/javascript/editor/components/kit/tabs.vue +88 -0
  466. data/app/javascript/editor/components/kit/text-input.vue +62 -0
  467. data/app/javascript/editor/components/kit/textarea-input.vue +59 -0
  468. data/app/javascript/editor/components/link-picker/actions.vue +32 -0
  469. data/app/javascript/editor/components/link-picker/email.vue +32 -0
  470. data/app/javascript/editor/components/link-picker/index.vue +97 -0
  471. data/app/javascript/editor/components/link-picker/page.vue +124 -0
  472. data/app/javascript/editor/components/link-picker/url.vue +43 -0
  473. data/app/javascript/editor/components/page/edit.vue +98 -0
  474. data/app/javascript/editor/components/page/form/main.vue +64 -0
  475. data/app/javascript/editor/components/page/form/seo.vue +94 -0
  476. data/app/javascript/editor/components/page/list/index.vue +67 -0
  477. data/app/javascript/editor/components/page/list/list-item.vue +147 -0
  478. data/app/javascript/editor/components/page/new.vue +78 -0
  479. data/app/javascript/editor/components/section-block-pane/index.vue +69 -0
  480. data/app/javascript/editor/components/section-block-pane/setting-list.vue +49 -0
  481. data/app/javascript/editor/components/section-highlighter/bottom-actions.vue +60 -0
  482. data/app/javascript/editor/components/section-highlighter/index.vue +133 -0
  483. data/app/javascript/editor/components/section-highlighter/top-left-actions.vue +68 -0
  484. data/app/javascript/editor/components/section-highlighter/top-right-actions.vue +127 -0
  485. data/app/javascript/editor/components/section-list/index.vue +64 -0
  486. data/app/javascript/editor/components/section-list/list-item.vue +33 -0
  487. data/app/javascript/editor/components/section-pane/block-list/index.vue +67 -0
  488. data/app/javascript/editor/components/section-pane/block-list/list-item.vue +71 -0
  489. data/app/javascript/editor/components/section-pane/block-list/new-block-button.vue +74 -0
  490. data/app/javascript/editor/components/section-pane/block-tree/index.vue +63 -0
  491. data/app/javascript/editor/components/section-pane/block-tree/new-nested-block-button.vue +67 -0
  492. data/app/javascript/editor/components/section-pane/block-tree/tree-node.vue +109 -0
  493. data/app/javascript/editor/components/section-pane/index.vue +92 -0
  494. data/app/javascript/editor/components/section-pane/setting-list.vue +46 -0
  495. data/app/javascript/editor/components/sidebar-nav.vue +125 -0
  496. data/app/javascript/editor/components/style-pane/index.vue +44 -0
  497. data/app/javascript/editor/components/theme-section-list/index.vue +51 -0
  498. data/app/javascript/editor/components/theme-section-list/list-item.vue +88 -0
  499. data/app/javascript/editor/design/application.scss +17 -0
  500. data/app/javascript/editor/design/components/buttons.scss +25 -0
  501. data/app/javascript/editor/design/components/modal.scss +49 -0
  502. data/app/javascript/editor/design/components/rich-text-editor.scss +180 -0
  503. data/app/javascript/editor/design/components/tooltip.scss +117 -0
  504. data/app/javascript/editor/design/components/tree.scss +6 -0
  505. data/app/javascript/editor/design/helpers.scss +30 -0
  506. data/app/javascript/editor/design/transitions.scss +121 -0
  507. data/app/javascript/editor/layouts/app.vue +30 -0
  508. data/app/javascript/editor/layouts/default.vue +42 -0
  509. data/app/javascript/editor/layouts/slide-pane.vue +87 -0
  510. data/app/javascript/editor/locales/editor.en.json +257 -0
  511. data/app/javascript/editor/locales/editor.fr.json +244 -0
  512. data/app/javascript/editor/locales/index.js +11 -0
  513. data/app/javascript/editor/main.js +19 -0
  514. data/app/javascript/editor/mixins/error-modal.js +23 -0
  515. data/app/javascript/editor/mixins/focused-input.js +20 -0
  516. data/app/javascript/editor/mixins/global.js +125 -0
  517. data/app/javascript/editor/mixins/grouped-dropdowns.js +17 -0
  518. data/app/javascript/editor/mixins/index.js +1 -0
  519. data/app/javascript/editor/mixins/preview-transformation.js +60 -0
  520. data/app/javascript/editor/plugins/event-bus.js +3 -0
  521. data/app/javascript/editor/plugins/filters.js +7 -0
  522. data/app/javascript/editor/plugins/i18n.js +28 -0
  523. data/app/javascript/editor/plugins/index.js +3 -0
  524. data/app/javascript/editor/plugins/tooltip.js +4 -0
  525. data/app/javascript/editor/router/index.js +20 -0
  526. data/app/javascript/editor/router/routes/base.js +53 -0
  527. data/app/javascript/editor/router/routes/index.js +3 -0
  528. data/app/javascript/editor/router/routes/page.js +30 -0
  529. data/app/javascript/editor/router/routes/section-block.js +29 -0
  530. data/app/javascript/editor/router/routes/section.js +67 -0
  531. data/app/javascript/editor/router/routes/style.js +17 -0
  532. data/app/javascript/editor/services/__tests__/page.spec.js +38 -0
  533. data/app/javascript/editor/services/__tests__/section.spec.js +32 -0
  534. data/app/javascript/editor/services/api.js +40 -0
  535. data/app/javascript/editor/services/block.js +26 -0
  536. data/app/javascript/editor/services/collection-item.js +12 -0
  537. data/app/javascript/editor/services/image.js +23 -0
  538. data/app/javascript/editor/services/index.js +21 -0
  539. data/app/javascript/editor/services/inline-editing.js +403 -0
  540. data/app/javascript/editor/services/page.js +107 -0
  541. data/app/javascript/editor/services/section.js +180 -0
  542. data/app/javascript/editor/services/site.js +21 -0
  543. data/app/javascript/editor/services/theme.js +8 -0
  544. data/app/javascript/editor/spec/__mocks__/page.js +432 -0
  545. data/app/javascript/editor/spec/__mocks__/section.js +232 -0
  546. data/app/javascript/editor/spec/__mocks__/services.js +77 -0
  547. data/app/javascript/editor/spec/__mocks__/site.js +95 -0
  548. data/app/javascript/editor/spec/__mocks__/theme.js +518 -0
  549. data/app/javascript/editor/store/__tests__/getters.spec.js +102 -0
  550. data/app/javascript/editor/store/actions/__tests__/page.spec.js +93 -0
  551. data/app/javascript/editor/store/actions/__tests__/section-block.spec.js +104 -0
  552. data/app/javascript/editor/store/actions/__tests__/section.spec.js +61 -0
  553. data/app/javascript/editor/store/actions/index.js +37 -0
  554. data/app/javascript/editor/store/actions/page.js +52 -0
  555. data/app/javascript/editor/store/actions/section-block.js +74 -0
  556. data/app/javascript/editor/store/actions/section.js +86 -0
  557. data/app/javascript/editor/store/actions/site.js +32 -0
  558. data/app/javascript/editor/store/default-state.js +28 -0
  559. data/app/javascript/editor/store/getters.js +91 -0
  560. data/app/javascript/editor/store/index.js +28 -0
  561. data/app/javascript/editor/store/mutations.js +183 -0
  562. data/app/javascript/editor/utils.js +127 -0
  563. data/app/javascript/editor/views/content-pane.vue +105 -0
  564. data/app/javascript/editor/views/page-preview.vue +183 -0
  565. data/app/javascript/editor/views/pages/edit.vue +26 -0
  566. data/app/javascript/editor/views/pages/index.vue +65 -0
  567. data/app/javascript/editor/views/sections/add-pane.vue +23 -0
  568. data/app/javascript/editor/views/sections/list-pane.vue +20 -0
  569. data/app/javascript/editor/views/slide-pane.vue +14 -0
  570. data/app/javascript/editor/views/slide-pane2.vue +14 -0
  571. data/app/javascript/editor/views/style/edit-pane.vue +22 -0
  572. data/app/javascript/packs/application.js +8 -0
  573. data/app/javascript/packs/editor.js +2 -0
  574. data/app/javascript/style/application/_changes.scss +1 -0
  575. data/app/javascript/style/application/_variables.scss +0 -0
  576. data/app/javascript/style/application.scss +5 -0
  577. data/app/javascript/utils/axios.js +16 -0
  578. data/app/jobs/maglev/application_job.rb +6 -0
  579. data/app/mailers/maglev/application_mailer.rb +8 -0
  580. data/app/models/concerns/maglev/sections_concern.rb +45 -0
  581. data/app/models/concerns/maglev/translatable.rb +44 -0
  582. data/app/models/maglev/application_record.rb +7 -0
  583. data/app/models/maglev/asset.rb +28 -0
  584. data/app/models/maglev/page/path_concern.rb +70 -0
  585. data/app/models/maglev/page/search_concern.rb +40 -0
  586. data/app/models/maglev/page.rb +38 -0
  587. data/app/models/maglev/page_path.rb +46 -0
  588. data/app/models/maglev/section/block.rb +41 -0
  589. data/app/models/maglev/section/content_concern.rb +83 -0
  590. data/app/models/maglev/section/setting.rb +53 -0
  591. data/app/models/maglev/section.rb +85 -0
  592. data/app/models/maglev/site/locale.rb +19 -0
  593. data/app/models/maglev/site/locales_concern.rb +37 -0
  594. data/app/models/maglev/site/style_value.rb +43 -0
  595. data/app/models/maglev/site.rb +25 -0
  596. data/app/models/maglev/static_page.rb +40 -0
  597. data/app/models/maglev/theme/section_category.rb +23 -0
  598. data/app/models/maglev/theme/style_setting.rb +43 -0
  599. data/app/models/maglev/theme.rb +16 -0
  600. data/app/services/concerns/maglev/get_page_sections/transform_collection_item_concern.rb +18 -0
  601. data/app/services/concerns/maglev/get_page_sections/transform_link_concern.rb +35 -0
  602. data/app/services/concerns/maglev/get_page_sections/transform_text_concern.rb +38 -0
  603. data/app/services/maglev/app_container.rb +48 -0
  604. data/app/services/maglev/change_site_locales.rb +37 -0
  605. data/app/services/maglev/clone_page.rb +62 -0
  606. data/app/services/maglev/extract_locale.rb +36 -0
  607. data/app/services/maglev/fetch_collection_items.rb +97 -0
  608. data/app/services/maglev/fetch_page.rb +26 -0
  609. data/app/services/maglev/fetch_section_screenshot_path.rb +17 -0
  610. data/app/services/maglev/fetch_section_screenshot_url.rb +14 -0
  611. data/app/services/maglev/fetch_sections_path.rb +13 -0
  612. data/app/services/maglev/fetch_site.rb +20 -0
  613. data/app/services/maglev/fetch_static_pages.rb +56 -0
  614. data/app/services/maglev/fetch_style.rb +38 -0
  615. data/app/services/maglev/fetch_theme.rb +12 -0
  616. data/app/services/maglev/fetch_theme_layout.rb +14 -0
  617. data/app/services/maglev/generate_site.rb +26 -0
  618. data/app/services/maglev/get_base_url.rb +32 -0
  619. data/app/services/maglev/get_page_fullpath.rb +65 -0
  620. data/app/services/maglev/get_page_section_names.rb +25 -0
  621. data/app/services/maglev/get_page_sections.rb +103 -0
  622. data/app/services/maglev/persist_page.rb +74 -0
  623. data/app/services/maglev/persist_section_screenshot.rb +58 -0
  624. data/app/services/maglev/search_pages.rb +60 -0
  625. data/app/services/maglev/setup_pages.rb +45 -0
  626. data/app/validators/maglev/collection_validator.rb +24 -0
  627. data/app/validators/maglev/presence_validator.rb +16 -0
  628. data/app/views/layouts/maglev/admin/_header_actions.html.erb +5 -0
  629. data/app/views/layouts/maglev/admin/application.html.erb +25 -0
  630. data/app/views/maglev/admin/sections/previews/show.html.erb +32 -0
  631. data/app/views/maglev/admin/themes/_empty.html.erb +20 -0
  632. data/app/views/maglev/admin/themes/_section_categories.html.erb +9 -0
  633. data/app/views/maglev/admin/themes/_sections.html.erb +54 -0
  634. data/app/views/maglev/admin/themes/show.html.erb +21 -0
  635. data/app/views/maglev/api/_pagination.json.jbuilder +6 -0
  636. data/app/views/maglev/api/assets/_show.json.jbuilder +8 -0
  637. data/app/views/maglev/api/assets/index.json.jbuilder +9 -0
  638. data/app/views/maglev/api/assets/show.json.jbuilder +3 -0
  639. data/app/views/maglev/api/collection_items/_show.json.jbuilder +5 -0
  640. data/app/views/maglev/api/collection_items/index.json.jbuilder +5 -0
  641. data/app/views/maglev/api/pages/index.json.jbuilder +18 -0
  642. data/app/views/maglev/api/pages/show.json.jbuilder +24 -0
  643. data/app/views/maglev/api/sites/_show.json.jbuilder +15 -0
  644. data/app/views/maglev/api/sites/show.json.jbuilder +3 -0
  645. data/app/views/maglev/api/themes/_show.json.jbuilder +17 -0
  646. data/app/views/maglev/editor/_header.html.erb +1 -0
  647. data/app/views/maglev/editor/show.html.erb +39 -0
  648. data/config/initializers/assets.rb +24 -0
  649. data/config/initializers/filter_parameters_logging.rb +6 -0
  650. data/config/initializers/kaminari.rb +16 -0
  651. data/config/locales/activerecord.en.yml +7 -0
  652. data/config/locales/activerecord.fr.yml +26 -0
  653. data/config/routes.rb +46 -0
  654. data/config/webpack/development.js +5 -0
  655. data/config/webpack/environment.js +38 -0
  656. data/config/webpack/loaders/optional_chaining.js +10 -0
  657. data/config/webpack/loaders/vue.js +6 -0
  658. data/config/webpack/production.js +5 -0
  659. data/config/webpack/test.js +5 -0
  660. data/config/webpacker.yml +95 -0
  661. data/db/migrate/20200824085207_create_maglev_sites.rb +8 -0
  662. data/db/migrate/20200824104648_create_maglev_pages.rb +17 -0
  663. data/db/migrate/20200831101942_create_maglev_section_content.rb +11 -0
  664. data/db/migrate/20201206172020_create_maglev_assets.rb +13 -0
  665. data/db/migrate/20210819092740_switch_to_localized_page_fields.rb +17 -0
  666. data/db/migrate/20210830085101_create_maglev_page_paths.rb +13 -0
  667. data/db/migrate/20210906102712_add_canonical_to_pages.rb +6 -0
  668. data/db/migrate/20211008064437_add_locales_to_sites.rb +5 -0
  669. data/db/migrate/20211013210954_translate_section_content.rb +8 -0
  670. data/db/migrate/20211101205001_add_lock_version_to_maglev_pages.rb +6 -0
  671. data/db/migrate/20211116161121_better_page_path_canonical_indices.rb +8 -0
  672. data/db/migrate/20211124101005_fix_page_path_indices.rb +6 -0
  673. data/db/migrate/20211203224112_add_open_graph_tags_to_pages.rb +9 -0
  674. data/db/migrate/20220612092235_add_style_to_sites.rb +7 -0
  675. data/lib/generators/maglev/install_generator.rb +50 -0
  676. data/lib/generators/maglev/section_generator.rb +128 -0
  677. data/lib/generators/maglev/templates/install/config/initializers/maglev.rb +77 -0
  678. data/lib/generators/maglev/templates/install/public/theme/image-placeholder.jpg +0 -0
  679. data/lib/generators/maglev/templates/section/app/theme/sections/%category%/%file_name%.yml.tt +102 -0
  680. data/lib/generators/maglev/templates/section/app/views/theme/sections/%category%/%file_name%.html.erb.tt +55 -0
  681. data/lib/generators/maglev/templates/theme/app/theme/theme.yml.tt +22 -0
  682. data/lib/generators/maglev/templates/theme/app/views/theme/layout.html.erb.tt +21 -0
  683. data/lib/generators/maglev/theme_generator.rb +12 -0
  684. data/lib/maglev/active_storage.rb +36 -0
  685. data/lib/maglev/config.rb +9 -0
  686. data/lib/maglev/engine.rb +65 -0
  687. data/lib/maglev/errors.rb +8 -0
  688. data/lib/maglev/i18n.rb +46 -0
  689. data/lib/maglev/preview_constraint.rb +25 -0
  690. data/lib/maglev/theme_filesystem_loader.rb +55 -0
  691. data/lib/maglev/version.rb +5 -0
  692. data/lib/maglev.rb +70 -0
  693. data/lib/maglevcms.rb +4 -0
  694. data/lib/tasks/maglev_tasks.rake +108 -0
  695. metadata +827 -0
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ json.key_format! camelize: :lower
4
+ json.deep_format_keys!
5
+ json.call(theme, :id, :name, :description)
6
+ json.sections theme.sections do |section|
7
+ json.call(section, :id, :name, :category, :site_scoped, :singleton, :viewport_fixed_position,
8
+ :insert_button, :insert_at, :max_width_pane,
9
+ :blocks_label, :blocks_presentation, :sample)
10
+ json.settings section.settings.as_json
11
+ json.blocks section.blocks.as_json
12
+ json.theme_id theme.id
13
+ json.screenshot_path services.fetch_section_screenshot_url.call(section: section)
14
+ end
15
+ json.section_categories theme.section_categories.as_json
16
+ json.icons theme.icons || []
17
+ json.style_settings theme.style_settings.as_json
@@ -0,0 +1 @@
1
+ <!-- custom EDITOR headers -->
@@ -0,0 +1,39 @@
1
+ <!DOCTYPE html>
2
+ <html class="h-full" lang="<%= editor_ui_locale %>">
3
+ <head>
4
+ <title><%= editor_window_title %></title>
5
+
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <script>
10
+ window.locale = <%= h content_locale.to_json.html_safe %>;
11
+ window.baseUrl = <%= h site_base_editor_path.to_json.html_safe %>;
12
+ window.leaveUrl = <%= site_leave_editor_path.to_json.html_safe %>;
13
+ window.apiBaseUrl = <%= h api_base_path.to_json.html_safe %>;
14
+ window.site = <%= h render(partial: 'maglev/api/sites/show', formats: :json, locals: { site: maglev_site, home_page_id: maglev_home_page_id }).html_safe %>;
15
+ window.theme = <%= h render(partial: 'maglev/api/themes/show', formats: :json, locals: { theme: maglev_theme }).html_safe %>;
16
+ window.logoUrl = <%= editor_logo_url.to_json.html_safe %>;
17
+ window.primaryColor = <%= editor_primary_hex_color.to_json.html_safe %>;
18
+ window.sitePublishable = <%= editor_site_publishable.to_json %>;
19
+ window.customTranslations = <%= h editor_custom_translations.to_json.html_safe %>
20
+ </script>
21
+
22
+ <%= javascript_pack_tag 'editor' %>
23
+ <%= stylesheet_pack_tag 'editor' %>
24
+
25
+ <%= favicon_link_tag editor_favicon_url %>
26
+
27
+ <style>
28
+ :root {
29
+ --editor-color-primary: <%= editor_primary_hex_color %>;
30
+ --editor-color-primary-non-hex: <%= editor_primary_rgb_color.join(', ') %>;
31
+ }
32
+ </style>
33
+
34
+ <%= render 'header' %>
35
+ </head>
36
+ <body class="h-full overflow-y-hidden font-nunito">
37
+ <div id="maglev-app"></div>
38
+ </body>
39
+ </html>
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'webpacker'
4
+ require 'webpacker/helper'
5
+
6
+ module Webpacker
7
+ module DynamicTag
8
+ def javascript_pack_tag(*names, **options)
9
+ return super unless options[:webpacker]
10
+
11
+ new_helper = dup
12
+ new_helper.define_singleton_method(:current_webpacker_instance) do
13
+ if options[:webpacker] == :root
14
+ ::Webpacker.instance
15
+ else
16
+ options[:webpacker].constantize.webpacker
17
+ end
18
+ end
19
+ new_helper.javascript_pack_tag(*names, **options.except(:webpacker))
20
+ end
21
+ end
22
+ end
23
+
24
+ Webpacker::Helper.prepend Webpacker::DynamicTag
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Configure sensitive parameters which will be filtered from the log file.
6
+ Rails.application.config.filter_parameters += %i[base64_image]
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'kaminari'
4
+
5
+ Kaminari.configure do |config|
6
+ config.default_per_page = 25
7
+ config.max_per_page = 25
8
+ # config.window = 4
9
+ # config.outer_window = 0
10
+ # config.left = 0
11
+ # config.right = 0
12
+ # config.page_method_name = :page
13
+ # config.param_name = :page
14
+ # config.max_pages = nil
15
+ # config.params_on_first_page = false
16
+ end
@@ -0,0 +1,7 @@
1
+ en:
2
+ activerecord:
3
+ attributes:
4
+ 'maglev/page':
5
+ cloned_title: "%{title} COPY"
6
+ 'maglev/page/paths':
7
+ value: Path
@@ -0,0 +1,26 @@
1
+ fr:
2
+ activerecord:
3
+ models:
4
+ 'maglev/page': Page
5
+
6
+ attributes:
7
+ 'maglev/page':
8
+ title: Titre
9
+ cloned_title: "%{title} COPIE"
10
+ seo_title: Titre SEO
11
+ meta_description: Meta description
12
+ og_title: "og:title"
13
+ og_description: "og:description"
14
+ og_image_url: "og:image"
15
+ 'maglev/page/paths':
16
+ value: Chemin
17
+
18
+ errors:
19
+ models:
20
+ maglev/page:
21
+ attributes:
22
+ title:
23
+ blank: doît être rempli
24
+ path:
25
+ taken: est déjà utilisé par une autre page
26
+ exclusion: est déjà utilisé par une autre page
data/config/routes.rb ADDED
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ # rubocop:disable Metrics/BlockLength
4
+ Maglev::Engine.routes.draw do
5
+ # API
6
+ constraints format: :json do
7
+ namespace 'api' do
8
+ resource :site, only: :show
9
+ resources :pages do
10
+ resources :clones, controller: :page_clones, only: :create
11
+ end
12
+ resources :assets
13
+ resource :publication, only: %i[show create]
14
+ scope 'collections/:collection_id' do
15
+ get '/', to: 'collection_items#index', as: :collection_items
16
+ end
17
+ end
18
+ end
19
+
20
+ root to: redirect { Maglev::Engine.routes.url_helpers.admin_root_path }
21
+
22
+ # Admin
23
+ namespace :admin do
24
+ root to: 'dashboard#index'
25
+ resource :theme, only: %i[index show]
26
+ namespace :sections, path: 'sections/:id' do
27
+ get :preview, to: 'previews#show'
28
+ get :preview_in_frame, to: 'previews#iframe_show'
29
+ resources :screenshots, only: [:create]
30
+ end
31
+ end
32
+
33
+ # Editor + Preview
34
+ get 'editor', to: 'editor#show', as: :base_editor
35
+ get 'editor/:locale/(*something)', to: 'editor#show', as: :editor
36
+ get 'leave_editor', to: 'editor#destroy', as: :leave_editor
37
+ get 'preview/(*path)', to: 'page_preview#index',
38
+ defaults: { path: 'index', rendering_mode: :editor },
39
+ constraints: Maglev::PreviewConstraint.new,
40
+ as: :site_preview
41
+ post 'preview/(*path)', to: 'page_preview#create', defaults: { path: 'index', rendering_mode: :editor }
42
+
43
+ # Public Assets
44
+ get 'assets/:id(/:filename)', to: 'assets#show', as: :public_asset
45
+ end
46
+ # rubocop:enable Metrics/BlockLength
@@ -0,0 +1,5 @@
1
+ process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
+
3
+ const environment = require('./environment')
4
+
5
+ module.exports = environment.toWebpackConfig()
@@ -0,0 +1,38 @@
1
+ const path = require('path')
2
+ const { environment } = require('@rails/webpacker')
3
+
4
+ // VueJS
5
+ const { VueLoaderPlugin } = require('vue-loader')
6
+ const vue = require('./loaders/vue')
7
+ environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin())
8
+ environment.loaders.prepend('vue', vue)
9
+
10
+ // OptionalChaining
11
+ const babelLoader = environment.loaders.get('babel')
12
+ babelLoader.use[0].options.plugins = ['@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-class-properties'];
13
+
14
+ const customConfig = {
15
+ resolve: {
16
+ alias: {
17
+ '@': path.resolve(__dirname, '..', '..', 'app/javascript/editor')
18
+ }
19
+ },
20
+ module: {
21
+ rules: [
22
+ {
23
+ test: /\.svg$/,
24
+ use: ['vue-loader', 'vue-svg-loader'],
25
+ },
26
+ {
27
+ enforce: 'pre',
28
+ test: /\.(js|vue)$/,
29
+ loader: 'eslint-loader',
30
+ exclude: /node_modules/
31
+ }
32
+ ],
33
+ },
34
+ }
35
+
36
+ environment.config.merge(customConfig)
37
+
38
+ module.exports = environment
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ test: /\.vue(\.erb)?$/,
3
+ exclude: /node_modules/,
4
+ loader: 'babel-loader',
5
+ options: {
6
+ plugins: [
7
+ require('@babel/plugin-proposal-optional-chaining'),
8
+ ],
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ test: /\.vue(\.erb)?$/,
3
+ use: [{
4
+ loader: 'vue-loader'
5
+ }],
6
+ }
@@ -0,0 +1,5 @@
1
+ process.env.NODE_ENV = process.env.NODE_ENV || 'production'
2
+
3
+ const environment = require('./environment')
4
+
5
+ module.exports = environment.toWebpackConfig()
@@ -0,0 +1,5 @@
1
+ process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
+
3
+ const environment = require('./environment')
4
+
5
+ module.exports = environment.toWebpackConfig()
@@ -0,0 +1,95 @@
1
+ # Note: You must restart bin/webpack-dev-server for changes to take effect
2
+
3
+ default: &default
4
+ source_path: app/javascript
5
+ source_entry_path: packs
6
+ public_root_path: public
7
+ public_output_path: maglev-packs
8
+ cache_path: tmp/cache/webpacker
9
+ check_yarn_integrity: false
10
+ webpack_compile_output: true
11
+
12
+ # Additional paths webpack should lookup modules
13
+ # ['app/assets', 'engine/foo/app/assets']
14
+ resolved_paths: []
15
+
16
+ # Reload manifest.json on all requests so we reload latest compiled packs
17
+ cache_manifest: false
18
+
19
+ # Extract and emit a css file
20
+ extract_css: false
21
+
22
+ static_assets_extensions:
23
+ - .jpg
24
+ - .jpeg
25
+ - .png
26
+ - .gif
27
+ - .tiff
28
+ - .ico
29
+ - .eot
30
+ - .otf
31
+ - .ttf
32
+ - .woff
33
+ - .woff2
34
+
35
+ extensions:
36
+ - .vue
37
+ - .mjs
38
+ - .js
39
+ - .sass
40
+ - .scss
41
+ - .css
42
+ - .module.sass
43
+ - .module.scss
44
+ - .module.css
45
+ - .png
46
+ - .gif
47
+ - .jpeg
48
+ - .jpg
49
+
50
+ development:
51
+ <<: *default
52
+ compile: true
53
+
54
+ # Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
55
+ check_yarn_integrity: false # NOTE: bug in Rails?
56
+
57
+ # Reference: https://webpack.js.org/configuration/dev-server/
58
+ dev_server:
59
+ https: false
60
+ host: localhost
61
+ port: 3036
62
+ public: localhost:3036
63
+ hmr: false
64
+ # Inline should be set to true if using HMR
65
+ inline: true
66
+ overlay: true
67
+ compress: true
68
+ disable_host_check: true
69
+ use_local_ip: false
70
+ quiet: false
71
+ pretty: false
72
+ headers:
73
+ 'Access-Control-Allow-Origin': '*'
74
+ watch_options:
75
+ ignored: '**/node_modules/**'
76
+
77
+
78
+ test:
79
+ <<: *default
80
+ compile: true
81
+
82
+ # Compile test packs to a separate directory
83
+ public_output_path: packs-test
84
+
85
+ production:
86
+ <<: *default
87
+
88
+ # Production depends on precompilation of packs prior to booting for performance.
89
+ compile: false
90
+
91
+ # Extract and emit a css file
92
+ extract_css: true
93
+
94
+ # Cache manifest.json for performance
95
+ cache_manifest: true
@@ -0,0 +1,8 @@
1
+ class CreateMaglevSites < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :maglev_sites do |t|
4
+ t.string :name
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,17 @@
1
+ class CreateMaglevPages < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :maglev_pages do |t|
4
+ t.string :title
5
+ t.string :path
6
+ t.string :seo_title
7
+ t.string :meta_description
8
+ t.boolean :visible, default: true
9
+
10
+ t.timestamps
11
+ end
12
+
13
+ up_only do
14
+ add_index :maglev_pages, :path, unique: true
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ class CreateMaglevSectionContent < ActiveRecord::Migration[6.0]
2
+ def change
3
+ change_table :maglev_sites do |t|
4
+ t.jsonb :sections, default: []
5
+ end
6
+
7
+ change_table :maglev_pages do |t|
8
+ t.jsonb :sections, default: []
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ class CreateMaglevAssets < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :maglev_assets do |t|
4
+ t.string :filename
5
+ t.string :content_type
6
+ t.integer :width
7
+ t.integer :height
8
+ t.integer :byte_size
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ class SwitchToLocalizedPageFields < ActiveRecord::Migration[6.1]
2
+ def up
3
+ remove_columns :maglev_pages, :title, :seo_title, :meta_description
4
+ add_column :maglev_pages, :title_translations, :jsonb, default: {}
5
+ add_column :maglev_pages, :seo_title_translations, :jsonb, default: {}
6
+ add_column :maglev_pages, :meta_description_translations, :jsonb, default: {}
7
+ end
8
+
9
+ def down
10
+ add_column :maglev_pages, :title, :string
11
+ add_column :maglev_pages, :seo_title, :string
12
+ add_column :maglev_pages, :meta_description, :string
13
+ remove_column :maglev_pages, :title_translations
14
+ remove_column :maglev_pages, :seo_title_translations
15
+ remove_column :maglev_pages, :meta_description_translations
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ class CreateMaglevPagePaths < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :maglev_page_paths do |t|
4
+ t.references :maglev_page
5
+ t.string :locale, null: false
6
+ t.string :value, null: false
7
+ end
8
+
9
+ add_index :maglev_page_paths, [:value, :locale], unique: true
10
+
11
+ remove_column :maglev_pages, :path, :string
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ class AddCanonicalToPages < ActiveRecord::Migration[6.1]
2
+ def change
3
+ add_column :maglev_page_paths, :canonical, :boolean, null: true, default: true
4
+ add_index :maglev_page_paths, %i[canonical maglev_page_id locale], unique: true, name: 'canonical_uniqueness'
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddLocalesToSites < ActiveRecord::Migration[6.1]
2
+ def change
3
+ add_column :maglev_sites, :locales, :jsonb, default: []
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ class TranslateSectionContent < ActiveRecord::Migration[6.1]
2
+ def change
3
+ remove_column :maglev_sites, :sections, :jsonb, default: []
4
+ add_column :maglev_sites, :sections_translations, :jsonb, default: {}
5
+ remove_column :maglev_pages, :sections, :jsonb, default: []
6
+ add_column :maglev_pages, :sections_translations, :jsonb, default: {}
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ class AddLockVersionToMaglevPages < ActiveRecord::Migration[6.1]
2
+ def change
3
+ add_column :maglev_sites, :lock_version, :integer
4
+ add_column :maglev_pages, :lock_version, :integer
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ class BetterPagePathCanonicalIndices < ActiveRecord::Migration[6.1]
2
+ def change
3
+ remove_index :maglev_page_paths, [:value, :locale], unique: true
4
+ remove_index :maglev_page_paths, %i[canonical maglev_page_id locale], unique: true, name: 'canonical_uniqueness'
5
+ add_index :maglev_page_paths, %i[canonical locale value], name: 'canonical_speed'
6
+ add_index :maglev_page_paths, %i[canonical maglev_page_id locale value], unique: true, name: 'canonical_uniqueness'
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ class FixPagePathIndices < ActiveRecord::Migration[6.1]
2
+ def change
3
+ remove_index :maglev_page_paths, %i[canonical maglev_page_id locale value], unique: true, name: 'canonical_uniqueness'
4
+ add_index :maglev_page_paths, %i[canonical maglev_page_id locale], name: 'scoped_canonical_speed'
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ class AddOpenGraphTagsToPages < ActiveRecord::Migration[6.1]
2
+ def change
3
+ change_table :maglev_pages do |t|
4
+ t.jsonb :og_title_translations, default: {}
5
+ t.jsonb :og_description_translations, default: {}
6
+ t.jsonb :og_image_url_translations, default: {}
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ class AddStyleToSites < ActiveRecord::Migration[6.1]
2
+ def change
3
+ change_table :maglev_sites do |t|
4
+ t.jsonb :style, default: []
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Maglev
4
+ class InstallGenerator < Rails::Generators::Base
5
+ desc 'Install Maglev engine'
6
+ source_root File.expand_path('templates/install', __dir__)
7
+ hook_for :maglev_install
8
+
9
+ def compile_editor_assets
10
+ rake 'maglev:webpacker:compile'
11
+ end
12
+
13
+ def migrations
14
+ rake 'maglev:install:migrations'
15
+ rake 'db:migrate'
16
+ end
17
+
18
+ def create_initializer
19
+ directory 'config'
20
+ directory 'public'
21
+ end
22
+
23
+ def generate_blank_theme
24
+ generate 'maglev:theme'
25
+ end
26
+
27
+ def mount_engine
28
+ inject_into_file 'config/routes.rb', before: /^end/ do
29
+ <<-CODE
30
+ mount Maglev::Engine => '/maglev'
31
+ get '(*path)', to: 'maglev/page_preview#index', defaults: { path: 'index' }, constraints: Maglev::PreviewConstraint.new
32
+ CODE
33
+ end
34
+ end
35
+
36
+ def instructions
37
+ $stdout.puts <<~INFO
38
+ Done! 🎉
39
+
40
+ You can now tweak /config/initializers/maglev.rb.
41
+ You can also modify your theme (in /app/theme and /app/views/theme)
42
+ and generate new sections with rails g maglev:section.
43
+
44
+ 👉 The next step is to create a site using `rails maglev:create_site`.
45
+
46
+ 🚨 Don't forget to do it in production as well!
47
+ INFO
48
+ end
49
+ end
50
+ end