lookbook 2.1.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (412) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -10
  3. data/app/components/lookbook/header/component.html.erb +1 -1
  4. data/app/components/lookbook/icon/component.html.erb +4 -2
  5. data/app/components/lookbook/icon/component.rb +0 -16
  6. data/app/components/lookbook/nav/entity/component.html.erb +3 -0
  7. data/app/components/lookbook/nav/item/component.js +8 -10
  8. data/app/controllers/lookbook/application_controller.rb +11 -1
  9. data/app/controllers/lookbook/embeds_controller.rb +1 -1
  10. data/app/controllers/lookbook/page_controller.rb +1 -1
  11. data/app/controllers/lookbook/previews_controller.rb +1 -1
  12. data/app/helpers/lookbook/application_helper.rb +10 -0
  13. data/app/views/layouts/lookbook/application.html.erb +102 -82
  14. data/app/views/layouts/lookbook/embed.html.erb +29 -17
  15. data/app/views/lookbook/index.html.erb +21 -11
  16. data/assets/icons/activity-square.svg +1 -0
  17. data/assets/icons/ampersand.svg +1 -0
  18. data/assets/icons/ampersands.svg +1 -0
  19. data/assets/icons/antenna.svg +1 -0
  20. data/assets/icons/app-window.svg +1 -0
  21. data/assets/icons/archive-x.svg +1 -0
  22. data/assets/icons/area-chart.svg +1 -0
  23. data/assets/icons/arrow-big-down-dash.svg +1 -0
  24. data/assets/icons/arrow-big-left-dash.svg +1 -0
  25. data/assets/icons/arrow-big-right-dash.svg +1 -0
  26. data/assets/icons/arrow-big-up-dash.svg +1 -0
  27. data/assets/icons/arrow-down-0-1.svg +1 -0
  28. data/assets/icons/arrow-down-1-0.svg +1 -0
  29. data/assets/icons/arrow-down-a-z.svg +1 -0
  30. data/assets/icons/arrow-down-from-line.svg +1 -0
  31. data/assets/icons/arrow-down-left-from-circle.svg +1 -0
  32. data/assets/icons/arrow-down-left-square.svg +1 -0
  33. data/assets/icons/arrow-down-narrow-wide.svg +1 -0
  34. data/assets/icons/arrow-down-right-from-circle.svg +1 -0
  35. data/assets/icons/arrow-down-right-square.svg +1 -0
  36. data/assets/icons/arrow-down-square.svg +1 -0
  37. data/assets/icons/arrow-down-to-dot.svg +1 -0
  38. data/assets/icons/arrow-down-to-line.svg +1 -0
  39. data/assets/icons/arrow-down-up.svg +1 -0
  40. data/assets/icons/arrow-down-wide-narrow.svg +1 -0
  41. data/assets/icons/arrow-down-z-a.svg +1 -0
  42. data/assets/icons/arrow-left-from-line.svg +1 -0
  43. data/assets/icons/arrow-left-square.svg +1 -0
  44. data/assets/icons/arrow-left-to-line.svg +1 -0
  45. data/assets/icons/arrow-right-from-line.svg +1 -0
  46. data/assets/icons/arrow-right-left.svg +1 -0
  47. data/assets/icons/arrow-right-square.svg +1 -0
  48. data/assets/icons/arrow-right-to-line.svg +1 -0
  49. data/assets/icons/arrow-up-0-1.svg +1 -0
  50. data/assets/icons/arrow-up-1-0.svg +1 -0
  51. data/assets/icons/arrow-up-a-z.svg +1 -0
  52. data/assets/icons/arrow-up-from-dot.svg +1 -0
  53. data/assets/icons/arrow-up-from-line.svg +1 -0
  54. data/assets/icons/arrow-up-left-from-circle.svg +1 -0
  55. data/assets/icons/arrow-up-left-square.svg +1 -0
  56. data/assets/icons/arrow-up-narrow-wide.svg +1 -0
  57. data/assets/icons/arrow-up-right-from-circle.svg +1 -0
  58. data/assets/icons/arrow-up-right-square.svg +1 -0
  59. data/assets/icons/arrow-up-square.svg +1 -0
  60. data/assets/icons/arrow-up-to-line.svg +1 -0
  61. data/assets/icons/arrow-up-wide-narrow.svg +1 -0
  62. data/assets/icons/arrow-up-z-a.svg +1 -0
  63. data/assets/icons/arrows-up-from-line.svg +1 -0
  64. data/assets/icons/atom.svg +1 -0
  65. data/assets/icons/badge-alert.svg +1 -0
  66. data/assets/icons/badge-cent.svg +1 -0
  67. data/assets/icons/badge-check.svg +1 -0
  68. data/assets/icons/badge-dollar-sign.svg +1 -0
  69. data/assets/icons/badge-euro.svg +1 -0
  70. data/assets/icons/badge-help.svg +1 -0
  71. data/assets/icons/badge-indian-rupee.svg +1 -0
  72. data/assets/icons/badge-info.svg +1 -0
  73. data/assets/icons/badge-japanese-yen.svg +1 -0
  74. data/assets/icons/badge-minus.svg +1 -0
  75. data/assets/icons/badge-percent.svg +1 -0
  76. data/assets/icons/badge-plus.svg +1 -0
  77. data/assets/icons/badge-pound-sterling.svg +1 -0
  78. data/assets/icons/badge-russian-ruble.svg +1 -0
  79. data/assets/icons/badge-swiss-franc.svg +1 -0
  80. data/assets/icons/badge-x.svg +1 -0
  81. data/assets/icons/badge.svg +1 -0
  82. data/assets/icons/ban.svg +1 -0
  83. data/assets/icons/bar-chart-big.svg +1 -0
  84. data/assets/icons/bar-chart-horizontal-big.svg +1 -0
  85. data/assets/icons/bell-dot.svg +1 -0
  86. data/assets/icons/biohazard.svg +1 -0
  87. data/assets/icons/blocks.svg +1 -0
  88. data/assets/icons/book-copy.svg +1 -0
  89. data/assets/icons/book-down.svg +1 -0
  90. data/assets/icons/book-key.svg +1 -0
  91. data/assets/icons/book-lock.svg +1 -0
  92. data/assets/icons/book-marked.svg +1 -0
  93. data/assets/icons/book-minus.svg +1 -0
  94. data/assets/icons/book-plus.svg +1 -0
  95. data/assets/icons/book-template.svg +1 -0
  96. data/assets/icons/book-up-2.svg +1 -0
  97. data/assets/icons/book-up.svg +1 -0
  98. data/assets/icons/book-x.svg +1 -0
  99. data/assets/icons/bookmark-check.svg +1 -0
  100. data/assets/icons/bookmark-x.svg +1 -0
  101. data/assets/icons/boom-box.svg +1 -0
  102. data/assets/icons/braces.svg +1 -0
  103. data/assets/icons/brackets.svg +1 -0
  104. data/assets/icons/brain-circuit.svg +1 -0
  105. data/assets/icons/brain-cog.svg +1 -0
  106. data/assets/icons/brain.svg +1 -0
  107. data/assets/icons/bring-to-front.svg +1 -0
  108. data/assets/icons/bug-off.svg +1 -0
  109. data/assets/icons/bug-play.svg +1 -0
  110. data/assets/icons/bus-front.svg +1 -0
  111. data/assets/icons/cable-car.svg +1 -0
  112. data/assets/icons/cable.svg +1 -0
  113. data/assets/icons/cake-slice.svg +1 -0
  114. data/assets/icons/candlestick-chart.svg +1 -0
  115. data/assets/icons/candy-cane.svg +1 -0
  116. data/assets/icons/car-front.svg +1 -0
  117. data/assets/icons/car-taxi-front.svg +1 -0
  118. data/assets/icons/case-lower.svg +1 -0
  119. data/assets/icons/case-sensitive.svg +1 -0
  120. data/assets/icons/case-upper.svg +1 -0
  121. data/assets/icons/cassette-tape.svg +1 -0
  122. data/assets/icons/castle.svg +1 -0
  123. data/assets/icons/chevron-down-circle.svg +1 -0
  124. data/assets/icons/chevron-down-square.svg +1 -0
  125. data/assets/icons/chevron-left-circle.svg +1 -0
  126. data/assets/icons/chevron-left-square.svg +1 -0
  127. data/assets/icons/chevron-right-circle.svg +1 -0
  128. data/assets/icons/chevron-right-square.svg +1 -0
  129. data/assets/icons/chevron-up-circle.svg +1 -0
  130. data/assets/icons/chevron-up-square.svg +1 -0
  131. data/assets/icons/church.svg +1 -0
  132. data/assets/icons/circle-dashed.svg +1 -0
  133. data/assets/icons/circle-dollar-sign.svg +1 -0
  134. data/assets/icons/circle-dot-dashed.svg +1 -0
  135. data/assets/icons/circle-equal.svg +1 -0
  136. data/assets/icons/circle-off.svg +1 -0
  137. data/assets/icons/circle-slash-2.svg +1 -0
  138. data/assets/icons/circle-slash.svg +1 -0
  139. data/assets/icons/circuit-board.svg +1 -0
  140. data/assets/icons/clipboard-paste.svg +1 -0
  141. data/assets/icons/club.svg +1 -0
  142. data/assets/icons/combine.svg +1 -0
  143. data/assets/icons/computer.svg +1 -0
  144. data/assets/icons/contact-2.svg +1 -0
  145. data/assets/icons/container.svg +1 -0
  146. data/assets/icons/copy-check.svg +1 -0
  147. data/assets/icons/copy-minus.svg +1 -0
  148. data/assets/icons/copy-plus.svg +1 -0
  149. data/assets/icons/copy-slash.svg +1 -0
  150. data/assets/icons/copy-x.svg +1 -0
  151. data/assets/icons/database-zap.svg +1 -0
  152. data/assets/icons/dessert.svg +1 -0
  153. data/assets/icons/disc-2.svg +1 -0
  154. data/assets/icons/disc-3.svg +1 -0
  155. data/assets/icons/donut.svg +1 -0
  156. data/assets/icons/door-closed.svg +1 -0
  157. data/assets/icons/door-open.svg +1 -0
  158. data/assets/icons/dot.svg +1 -0
  159. data/assets/icons/drama.svg +1 -0
  160. data/assets/icons/ferris-wheel.svg +1 -0
  161. data/assets/icons/file-code-2.svg +1 -0
  162. data/assets/icons/file-stack.svg +1 -0
  163. data/assets/icons/fish-symbol.svg +1 -0
  164. data/assets/icons/fold-horizontal.svg +1 -0
  165. data/assets/icons/fold-vertical.svg +1 -0
  166. data/assets/icons/folder-dot.svg +1 -0
  167. data/assets/icons/folder-git-2.svg +1 -0
  168. data/assets/icons/folder-git.svg +1 -0
  169. data/assets/icons/folder-kanban.svg +1 -0
  170. data/assets/icons/folder-open-dot.svg +1 -0
  171. data/assets/icons/folder-root.svg +1 -0
  172. data/assets/icons/folder-sync.svg +1 -0
  173. data/assets/icons/gallery-horizontal-end.svg +1 -0
  174. data/assets/icons/gallery-horizontal.svg +1 -0
  175. data/assets/icons/gallery-thumbnails.svg +1 -0
  176. data/assets/icons/gallery-vertical-end.svg +1 -0
  177. data/assets/icons/gallery-vertical.svg +1 -0
  178. data/assets/icons/gantt-chart-square.svg +1 -0
  179. data/assets/icons/gantt-chart.svg +1 -0
  180. data/assets/icons/gauge-circle.svg +1 -0
  181. data/assets/icons/goal.svg +1 -0
  182. data/assets/icons/grid-2x2.svg +1 -0
  183. data/assets/icons/grid-3x3.svg +1 -0
  184. data/assets/icons/group.svg +1 -0
  185. data/assets/icons/hard-drive-download.svg +1 -0
  186. data/assets/icons/hard-drive-upload.svg +1 -0
  187. data/assets/icons/hdmi-port.svg +1 -0
  188. data/assets/icons/hotel.svg +1 -0
  189. data/assets/icons/iteration-ccw.svg +1 -0
  190. data/assets/icons/iteration-cw.svg +1 -0
  191. data/assets/icons/kanban-square-dashed.svg +1 -0
  192. data/assets/icons/kanban-square.svg +1 -0
  193. data/assets/icons/kanban.svg +1 -0
  194. data/assets/icons/key-round.svg +1 -0
  195. data/assets/icons/key-square.svg +1 -0
  196. data/assets/icons/layout-panel-left.svg +1 -0
  197. data/assets/icons/layout-panel-top.svg +1 -0
  198. data/assets/icons/leafy-green.svg +1 -0
  199. data/assets/icons/ligature.svg +1 -0
  200. data/assets/icons/list-filter.svg +1 -0
  201. data/assets/icons/list-restart.svg +1 -0
  202. data/assets/icons/list-todo.svg +1 -0
  203. data/assets/icons/list-tree.svg +1 -0
  204. data/assets/icons/lollipop.svg +1 -0
  205. data/assets/icons/m-square.svg +1 -0
  206. data/assets/icons/mailbox.svg +1 -0
  207. data/assets/icons/memory-stick.svg +1 -0
  208. data/assets/icons/menu-square.svg +1 -0
  209. data/assets/icons/merge.svg +1 -0
  210. data/assets/icons/message-square-dashed.svg +1 -0
  211. data/assets/icons/message-square-plus.svg +1 -0
  212. data/assets/icons/messages-square.svg +1 -0
  213. data/assets/icons/monitor-check.svg +1 -0
  214. data/assets/icons/monitor-dot.svg +1 -0
  215. data/assets/icons/monitor-down.svg +1 -0
  216. data/assets/icons/monitor-pause.svg +1 -0
  217. data/assets/icons/monitor-play.svg +1 -0
  218. data/assets/icons/monitor-stop.svg +1 -0
  219. data/assets/icons/monitor-up.svg +1 -0
  220. data/assets/icons/monitor-x.svg +1 -0
  221. data/assets/icons/moon-star.svg +1 -0
  222. data/assets/icons/mouse-pointer-square-dashed.svg +1 -0
  223. data/assets/icons/mouse-pointer-square.svg +1 -0
  224. data/assets/icons/move-down-left.svg +1 -0
  225. data/assets/icons/move-down-right.svg +1 -0
  226. data/assets/icons/move-down.svg +1 -0
  227. data/assets/icons/move-left.svg +1 -0
  228. data/assets/icons/move-right.svg +1 -0
  229. data/assets/icons/move-up-left.svg +1 -0
  230. data/assets/icons/move-up-right.svg +1 -0
  231. data/assets/icons/move-up.svg +1 -0
  232. data/assets/icons/orbit.svg +1 -0
  233. data/assets/icons/panel-bottom-close.svg +1 -0
  234. data/assets/icons/panel-bottom-inactive.svg +1 -0
  235. data/assets/icons/panel-bottom-open.svg +1 -0
  236. data/assets/icons/panel-bottom.svg +1 -0
  237. data/assets/icons/panel-left-close.svg +1 -0
  238. data/assets/icons/panel-left-inactive.svg +1 -0
  239. data/assets/icons/panel-left-open.svg +1 -0
  240. data/assets/icons/panel-left.svg +1 -0
  241. data/assets/icons/panel-right-close.svg +1 -0
  242. data/assets/icons/panel-right-inactive.svg +1 -0
  243. data/assets/icons/panel-right-open.svg +1 -0
  244. data/assets/icons/panel-right.svg +1 -0
  245. data/assets/icons/panel-top-close.svg +1 -0
  246. data/assets/icons/panel-top-inactive.svg +1 -0
  247. data/assets/icons/panel-top-open.svg +1 -0
  248. data/assets/icons/panel-top.svg +1 -0
  249. data/assets/icons/parentheses.svg +1 -0
  250. data/assets/icons/parking-circle-off.svg +1 -0
  251. data/assets/icons/parking-circle.svg +1 -0
  252. data/assets/icons/parking-meter.svg +1 -0
  253. data/assets/icons/parking-square-off.svg +1 -0
  254. data/assets/icons/parking-square.svg +1 -0
  255. data/assets/icons/paw-print.svg +1 -0
  256. data/assets/icons/pc-case.svg +1 -0
  257. data/assets/icons/pen-line.svg +1 -0
  258. data/assets/icons/pen-square.svg +1 -0
  259. data/assets/icons/pen.svg +1 -0
  260. data/assets/icons/pencil-line.svg +1 -0
  261. data/assets/icons/pencil-ruler.svg +1 -0
  262. data/assets/icons/percent-circle.svg +1 -0
  263. data/assets/icons/percent-diamond.svg +1 -0
  264. data/assets/icons/percent-square.svg +1 -0
  265. data/assets/icons/pi-square.svg +1 -0
  266. data/assets/icons/pi.svg +1 -0
  267. data/assets/icons/pilcrow-square.svg +1 -0
  268. data/assets/icons/plane-landing.svg +1 -0
  269. data/assets/icons/plane-takeoff.svg +1 -0
  270. data/assets/icons/play-square.svg +1 -0
  271. data/assets/icons/plug-zap-2.svg +1 -0
  272. data/assets/icons/pocket-knife.svg +1 -0
  273. data/assets/icons/popcorn.svg +1 -0
  274. data/assets/icons/popsicle.svg +1 -0
  275. data/assets/icons/presentation.svg +1 -0
  276. data/assets/icons/projector.svg +1 -0
  277. data/assets/icons/rabbit.svg +1 -0
  278. data/assets/icons/radar.svg +1 -0
  279. data/assets/icons/radiation.svg +1 -0
  280. data/assets/icons/radio-tower.svg +1 -0
  281. data/assets/icons/rail-symbol.svg +1 -0
  282. data/assets/icons/rainbow.svg +1 -0
  283. data/assets/icons/rat.svg +1 -0
  284. data/assets/icons/ratio.svg +1 -0
  285. data/assets/icons/receipt.svg +1 -0
  286. data/assets/icons/redo-dot.svg +1 -0
  287. data/assets/icons/refresh-ccw-dot.svg +1 -0
  288. data/assets/icons/refresh-cw-off.svg +1 -0
  289. data/assets/icons/repeat-2.svg +1 -0
  290. data/assets/icons/replace-all.svg +1 -0
  291. data/assets/icons/replace.svg +1 -0
  292. data/assets/icons/roller-coaster.svg +1 -0
  293. data/assets/icons/rows.svg +1 -0
  294. data/assets/icons/satellite-dish.svg +1 -0
  295. data/assets/icons/satellite.svg +1 -0
  296. data/assets/icons/save-all.svg +1 -0
  297. data/assets/icons/scatter-chart.svg +1 -0
  298. data/assets/icons/school-2.svg +1 -0
  299. data/assets/icons/school.svg +1 -0
  300. data/assets/icons/scissors-line-dashed.svg +1 -0
  301. data/assets/icons/scissors-square-dashed-bottom.svg +1 -0
  302. data/assets/icons/scissors-square.svg +1 -0
  303. data/assets/icons/scroll-text.svg +1 -0
  304. data/assets/icons/search-check.svg +1 -0
  305. data/assets/icons/search-code.svg +1 -0
  306. data/assets/icons/search-slash.svg +1 -0
  307. data/assets/icons/search-x.svg +1 -0
  308. data/assets/icons/send-horizontal.svg +1 -0
  309. data/assets/icons/send-to-back.svg +1 -0
  310. data/assets/icons/shapes.svg +1 -0
  311. data/assets/icons/shell.svg +1 -0
  312. data/assets/icons/shield-ban.svg +1 -0
  313. data/assets/icons/shield-ellipsis.svg +1 -0
  314. data/assets/icons/shield-half.svg +1 -0
  315. data/assets/icons/shield-minus.svg +1 -0
  316. data/assets/icons/shield-plus.svg +1 -0
  317. data/assets/icons/shield-question.svg +1 -0
  318. data/assets/icons/shield-x.svg +1 -0
  319. data/assets/icons/ship-wheel.svg +1 -0
  320. data/assets/icons/shopping-basket.svg +1 -0
  321. data/assets/icons/sigma-square.svg +1 -0
  322. data/assets/icons/snail.svg +1 -0
  323. data/assets/icons/space.svg +1 -0
  324. data/assets/icons/spade.svg +1 -0
  325. data/assets/icons/sparkle.svg +1 -0
  326. data/assets/icons/sparkles.svg +1 -0
  327. data/assets/icons/speech.svg +1 -0
  328. data/assets/icons/spell-check-2.svg +1 -0
  329. data/assets/icons/spell-check.svg +1 -0
  330. data/assets/icons/split.svg +1 -0
  331. data/assets/icons/spray-can.svg +1 -0
  332. data/assets/icons/square-asterisk.svg +1 -0
  333. data/assets/icons/square-code.svg +1 -0
  334. data/assets/icons/square-dashed-bottom-code.svg +1 -0
  335. data/assets/icons/square-dashed-bottom.svg +1 -0
  336. data/assets/icons/square-dot.svg +1 -0
  337. data/assets/icons/square-equal.svg +1 -0
  338. data/assets/icons/square-slash.svg +1 -0
  339. data/assets/icons/square-stack.svg +1 -0
  340. data/assets/icons/squirrel.svg +1 -0
  341. data/assets/icons/step-back.svg +1 -0
  342. data/assets/icons/step-forward.svg +1 -0
  343. data/assets/icons/store.svg +1 -0
  344. data/assets/icons/table-properties.svg +1 -0
  345. data/assets/icons/tablet-smartphone.svg +1 -0
  346. data/assets/icons/tally-1.svg +1 -0
  347. data/assets/icons/tally-2.svg +1 -0
  348. data/assets/icons/tally-3.svg +1 -0
  349. data/assets/icons/tally-4.svg +1 -0
  350. data/assets/icons/tally-5.svg +1 -0
  351. data/assets/icons/test-tube-2.svg +1 -0
  352. data/assets/icons/test-tube.svg +1 -0
  353. data/assets/icons/test-tubes.svg +1 -0
  354. data/assets/icons/text-quote.svg +1 -0
  355. data/assets/icons/text-select.svg +1 -0
  356. data/assets/icons/text.svg +1 -0
  357. data/assets/icons/theater.svg +1 -0
  358. data/assets/icons/touchpad-off.svg +1 -0
  359. data/assets/icons/touchpad.svg +1 -0
  360. data/assets/icons/tractor.svg +1 -0
  361. data/assets/icons/traffic-cone.svg +1 -0
  362. data/assets/icons/train-front-tunnel.svg +1 -0
  363. data/assets/icons/train-front.svg +1 -0
  364. data/assets/icons/train-track.svg +1 -0
  365. data/assets/icons/tram-front.svg +1 -0
  366. data/assets/icons/triangle-right.svg +1 -0
  367. data/assets/icons/turtle.svg +1 -0
  368. data/assets/icons/undo-dot.svg +1 -0
  369. data/assets/icons/unfold-horizontal.svg +1 -0
  370. data/assets/icons/unfold-vertical.svg +1 -0
  371. data/assets/icons/ungroup.svg +1 -0
  372. data/assets/icons/unplug.svg +1 -0
  373. data/assets/icons/user-2.svg +1 -0
  374. data/assets/icons/user-check-2.svg +1 -0
  375. data/assets/icons/user-circle-2.svg +1 -0
  376. data/assets/icons/user-circle.svg +1 -0
  377. data/assets/icons/user-cog-2.svg +1 -0
  378. data/assets/icons/user-minus-2.svg +1 -0
  379. data/assets/icons/user-plus-2.svg +1 -0
  380. data/assets/icons/user-square-2.svg +1 -0
  381. data/assets/icons/user-square.svg +1 -0
  382. data/assets/icons/user-x-2.svg +1 -0
  383. data/assets/icons/users-2.svg +1 -0
  384. data/assets/icons/variable.svg +1 -0
  385. data/assets/icons/videotape.svg +1 -0
  386. data/assets/icons/wallet-2.svg +1 -0
  387. data/assets/icons/wallet-cards.svg +1 -0
  388. data/assets/icons/wallpaper.svg +1 -0
  389. data/assets/icons/warehouse.svg +1 -0
  390. data/assets/icons/whole-word.svg +1 -0
  391. data/assets/icons/workflow.svg +1 -0
  392. data/assets/js/app.js +7 -4
  393. data/assets/js/helpers/request.js +2 -2
  394. data/config/app.yml +6 -1
  395. data/lib/lookbook/entities/page_entity.rb +1 -1
  396. data/lib/lookbook/preview.rb +1 -0
  397. data/lib/lookbook/preview_controller_actions.rb +18 -15
  398. data/lib/lookbook/services/data/resolvers/data_resolver.rb +1 -1
  399. data/lib/lookbook/services/templates/action_view_config_handler.rb +50 -0
  400. data/lib/lookbook/stores/config_store.rb +4 -0
  401. data/lib/lookbook/theme.rb +2 -6
  402. data/lib/lookbook/version.rb +1 -1
  403. data/public/lookbook-assets/css/lookbook.css +538 -395
  404. data/public/lookbook-assets/css/lookbook.css.map +1 -1
  405. data/public/lookbook-assets/img/lucide-sprite.svg +1 -1
  406. data/public/lookbook-assets/js/iframe.js.map +1 -1
  407. data/public/lookbook-assets/js/index.js +979 -827
  408. data/public/lookbook-assets/js/index.js.map +1 -1
  409. data/public/lookbook-assets/js/lookbook-core.js +38 -1
  410. data/public/lookbook-assets/js/lookbook.js +121 -84
  411. metadata +383 -7
  412. data/lib/lookbook/services/templates/action_view_annotations_handler.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7cfb74e7c724774d2d70e8fc27186c2238143576585b1ed8246ac323c648fcf
4
- data.tar.gz: 6d950c9dfee26a0dc25c39a79da81db44657047db9db3dbe6c3e893da0cbdaa2
3
+ metadata.gz: 405d72080cde8a24acd7efe2bf64d80d9593165c6049a925034765409f201d42
4
+ data.tar.gz: 20000a294067bd90090d8aad03a9f2a90fc7dedc0c40887637abec9ee61af6a9
5
5
  SHA512:
6
- metadata.gz: a6e2362b4cd5bfee6d80784cb1dcf01c12f954fe3573986f19b1a66538694d0613999418f19fc9235c0530d57adf9be5f0e5b47e9eaf6fcf3f3004cee65ca8c9
7
- data.tar.gz: 6bec74bc2d847359c19454b42c25cefd0ee928a8274062dcfba5c871527a887fe67e72d527adfbba5ec2131cf4d5fdcfa91f11a325685685b394840a71680725
6
+ metadata.gz: 96edf5d365de28f60a82db23c201103d469ced0e137794410ad63445b64d6420a3dd25a923b5a4f7b4b5af674c8271fe698a15a4ba6c4aeeb22bf5ca3023df18
7
+ data.tar.gz: bd14f9e41744e8a0af85acff86d1c325a4f85553bac89f01955eae7d80b6cb378ada7c763591e5ec057eb4b903a2998c5eaf9af839a855845f3b125bb198aa73
data/README.md CHANGED
@@ -7,17 +7,21 @@
7
7
  <p><strong><a href="https://lookbook.build">Documentation</a> &nbsp;|&nbsp; <a href="http://demo.lookbook.build/lookbook">Demo site</a></strong></p>
8
8
 
9
9
  <p><a href="https://rubygems.org/gems/lookbook"><img src="https://img.shields.io/gem/v/lookbook" alt="Gem version"></a>
10
- <a href="https://github.com/ViewComponent/lookbook/actions/workflows/ci.yml"><img src="https://github.com/ViewComponent/lookbook/actions/workflows/ci.yml/badge.svg" alt="CI status"></a></p>
10
+ <a href="https://github.com/lookbook-hq/lookbook/actions/workflows/ci.yml"><img src="https://github.com/lookbook-hq/lookbook/actions/workflows/ci.yml/badge.svg" alt="CI status"></a></p>
11
11
 
12
12
  </div>
13
13
 
14
14
  ---
15
15
 
16
16
  <div align="center">
17
- Lookbook combines a powerful <strong>component browser</strong> and <strong>preview system</strong> with an <strong>integrated documentation engine</strong> to help teams build robust, modular, maintainable user interfaces. <a href="https://lookbook.build"><strong>Learn more &rarr;</strong></a>
17
+ Lookbook combines a powerful <strong>component browser</strong> and <strong>preview system</strong> with an <strong>integrated documentation engine</strong> to help teams build robust, modular, maintainable user interfaces.<br><br>
18
+ It's compatible with <a href="https://viewcomponent.org/">ViewComponent</a>, <a href="https://www.phlex.fun/">Phlex</a>, ActionView partials and more.
19
+ <br><br>
20
+ <a href="https://lookbook.build"><strong>Read the docs &rarr;</strong></a>
18
21
 
19
22
  </div>
20
23
 
24
+
21
25
  ---
22
26
 
23
27
  [![Lookbook UI](.github/assets/lookbook_ui.png)](http://lookbook.build/)
@@ -28,9 +32,9 @@ Lookbook is implemented as an isolated [Rails Engine](https://guides.rubyonrails
28
32
 
29
33
  This repository contains:
30
34
 
31
- * The Lookbook source code ([`/app`](https://github.com/ViewComponent/lookbook/tree/main/app), [`/lib`](https://github.com/ViewComponent/lookbook/tree/main/lib), [`/config`](https://github.com/ViewComponent/lookbook/tree/main/config), etc)
32
- * The Lookbook [documentation site](#docs-site) source code and content ([`/docs`](https://github.com/ViewComponent/lookbook/tree/main/docs)).
33
- * A [test suite](#testing) with a 'runable' dummy app ([`/spec`](https://github.com/ViewComponent/lookbook/tree/main/spec)).
35
+ * The Lookbook source code ([`/app`](https://github.com/lookbook-hq/lookbook/tree/main/app), [`/lib`](https://github.com/lookbook-hq/lookbook/tree/main/lib), [`/config`](https://github.com/lookbook-hq/lookbook/tree/main/config), etc)
36
+ * The Lookbook [documentation site](#docs-site) source code and content ([`/docs`](https://github.com/lookbook-hq/lookbook/tree/main/docs)).
37
+ * A [test suite](#testing) with a 'runable' dummy app ([`/spec`](https://github.com/lookbook-hq/lookbook/tree/main/spec)).
34
38
 
35
39
  ### Documentation site
36
40
 
@@ -57,22 +61,22 @@ Lookbook uses [Release It!](https://github.com/release-it/release-it) to automat
57
61
 
58
62
  Running `npm run release` will start the process of publishing a new release and walks though all the steps from picking a version number to publishing the updated gem.
59
63
 
60
- Publishing a release requires write permissions for this repository (ViewComponent/lookbook) and 2FA publish permissions for Lookbook on RubyGems.
64
+ Publishing a release requires write permissions for this repository (lookbook-hq/lookbook) and 2FA publish permissions for Lookbook on RubyGems.
61
65
 
62
66
  ## Contributing
63
67
 
64
68
  Lookbook is an un-funded open source project and contributions of all types and sizes are most welcome!
65
69
 
66
- Please take the time to read over the [Contributing](./CONTRIBUTING.md) guide before making your first contribution and if anything isn't clear then [start a discussion](https://github.com/ViewComponent/lookbook/discussions) and we will do our best to help you out.
70
+ Please take the time to read over the [Contributing](./CONTRIBUTING.md) guide before making your first contribution and if anything isn't clear then [start a discussion](https://github.com/lookbook-hq/lookbook/discussions) and we will do our best to help you out.
67
71
 
68
72
  ## Contributors
69
73
 
70
74
  Lookbook was created by [Mark Perkins](https://github.com/allmarkedup) and continues to grow
71
- &amp; improve thanks to the ideas, suggestions and hard work of all of [these excellent humans](https://github.com/ViewComponent/lookbook/graphs/contributors):
75
+ &amp; improve thanks to the ideas, suggestions and hard work of all of [these excellent humans](https://github.com/lookbook-hq/lookbook/graphs/contributors):
72
76
  <br>
73
77
  <br>
74
- <a href="https://github.com/ViewComponent/lookbook/graphs/contributors">
75
- <img src="https://contrib.rocks/image?repo=ViewComponent/lookbook&columns=14" width="800" />
78
+ <a href="https://github.com/lookbook-hq/lookbook/graphs/contributors">
79
+ <img src="https://contrib.rocks/image?repo=lookbook-hq/lookbook&columns=14" width="800" />
76
80
  </a>
77
81
 
78
82
  ## License
@@ -34,7 +34,7 @@
34
34
  <% menu = lookbook_render :debug_menu,
35
35
  version: Lookbook::VERSION,
36
36
  docs_url: "https://lookbook.build/guide",
37
- repo_url: "https://github.com/ViewComponent/lookbook" do %>
37
+ repo_url: "https://github.com/lookbook-hq/lookbook" do %>
38
38
  <%= debug_data %>
39
39
  <% end %>
40
40
  <% button.with_dropdown.with_content(menu) %>
@@ -1,3 +1,5 @@
1
1
  <%= render_component_tag :i, style: "height: #{size_rems}; width: #{size_rems}; #{@html_attrs[:style]}", class: "icon-stroke-#{stroke}" do %>
2
- <%= svg %>
3
- <% end %>
2
+ <svg>
3
+ <use href="/lookbook-assets/img/lucide-sprite.svg#<%= @icon_name %>"></use>
4
+ </svg>
5
+ <% end %>
@@ -14,21 +14,5 @@ module Lookbook
14
14
  def size_rems
15
15
  "#{@size * 0.25}rem"
16
16
  end
17
-
18
- def svg
19
- ICON_CACHE[@icon_name] ||= read_svg
20
- end
21
-
22
- def read_svg
23
- File.read(svg_path).html_safe
24
- rescue
25
- if Rails.env.development? || Rails.env.test?
26
- raise "`#{@icon_name}` is not a valid icon name"
27
- end
28
- end
29
-
30
- def svg_path
31
- Lookbook::Engine.root.join("assets/icons/#{@icon_name}.svg")
32
- end
33
17
  end
34
18
  end
@@ -2,7 +2,10 @@
2
2
  id: id,
3
3
  key: "#{id}-entity-#{type}",
4
4
  class: "list-none",
5
+ "x-init": "$nextTick(() => checkActive())",
5
6
  "x-show": "!filteredOut",
7
+ "@navigation:complete.window": "checkActive",
8
+ # "x-effect": "active = ($refs.link && (window.location.pathname === $refs.link.getAttribute('href')))",
6
9
  data: { "entity-type": type.to_s.tr("_","-") },
7
10
  cloak: true do %>
8
11
  <%= lookbook_tag href.present? ? :a : :button,
@@ -6,20 +6,12 @@ export default function navItemComponent({ id, matchers }) {
6
6
  return {
7
7
  filteredOut: false,
8
8
 
9
+ active: false,
10
+
9
11
  get open() {
10
12
  return this.isCollection && this.isOpen(id);
11
13
  },
12
14
 
13
- get active() {
14
- if (this.$refs.link) {
15
- return (
16
- this.location &&
17
- this.location.pathname === this.$refs.link.getAttribute("href")
18
- );
19
- }
20
- return false;
21
- },
22
-
23
15
  get children() {
24
16
  return this.$refs.items ? Array.from(this.$refs.items.children) : [];
25
17
  },
@@ -28,6 +20,12 @@ export default function navItemComponent({ id, matchers }) {
28
20
  return !this.$refs.link;
29
21
  },
30
22
 
23
+ checkActive() {
24
+ this.active =
25
+ this.$refs.link &&
26
+ window.location.pathname === this.$refs.link.getAttribute("href");
27
+ },
28
+
31
29
  toggle() {
32
30
  this.toggleOpen(id);
33
31
  },
@@ -48,7 +48,8 @@ module Lookbook
48
48
  @config = Lookbook.config
49
49
  @engine = Lookbook.engine
50
50
  @embed = !!params[:lookbook_embed]
51
- @blank_slate = Engine.pages.none? && Engine.previews.none?
51
+ @sidebar_panels = sidebar_panels
52
+ @blank_slate = @sidebar_panels.none?
52
53
  end
53
54
 
54
55
  def raise_not_found(message = "Page not found")
@@ -56,6 +57,8 @@ module Lookbook
56
57
  end
57
58
 
58
59
  def handle_error(err)
60
+ raise err if Lookbook.config.preview_disable_error_handling
61
+
59
62
  @error = err.is_a?(Lookbook::Error) ? err : Lookbook::Error.new(original: err)
60
63
  @status_code = get_status_code(err)
61
64
 
@@ -71,6 +74,13 @@ module Lookbook
71
74
 
72
75
  private
73
76
 
77
+ def sidebar_panels
78
+ panels_config = Lookbook.config.preview_inspector.sidebar_panels.map(&:to_sym)
79
+ panels_config.select do |panel|
80
+ (panel == :pages && Engine.pages.any?) || (panel == :previews && Engine.previews.any?)
81
+ end
82
+ end
83
+
74
84
  def get_status_code(err)
75
85
  if err.respond_to?(:status)
76
86
  err.status
@@ -21,7 +21,7 @@ module Lookbook
21
21
  if props.preview.present?
22
22
  preview = Engine.previews.find_by_preview_class(props.preview)
23
23
  if preview.present?
24
- props.scenarios ||= (props.scenario || "")
24
+ props.scenarios ||= props.scenario || ""
25
25
  scenario = preview.scenario(Array(props.scenarios).first)
26
26
 
27
27
  boolean_options = ["display_option_controls"]
@@ -15,7 +15,7 @@ module Lookbook
15
15
  @next_page = @pages.next(@page)
16
16
  @previous_page = @pages.previous(@page)
17
17
 
18
- content = ActionViewAnnotationsHandler.call(disable_annotations: true) do
18
+ content = ActionViewConfigHandler.call do
19
19
  render_to_string inline: @page.content, locals: {
20
20
  page: @page,
21
21
  next_page: @next_page,
@@ -68,7 +68,7 @@ module Lookbook
68
68
 
69
69
  def permit_framing
70
70
  headers["X-Frame-Options"] = Lookbook.config.preview_embeds.policy if embedded?
71
- headers["X-Frame-Options"] = "SAMEORIGIN" if headers["X-Frame-Options"] == "DENY"
71
+ headers["X-Frame-Options"] = "SAMEORIGIN" if headers["X-Frame-Options"]&.upcase == "DENY"
72
72
  end
73
73
  end
74
74
  end
@@ -13,5 +13,15 @@ module Lookbook
13
13
  lookbook_home_path
14
14
  end
15
15
  end
16
+
17
+ # Requests
18
+
19
+ def request_frame
20
+ request.headers["X-Lookbook-Frame"] || "root"
21
+ end
22
+
23
+ def frame_request?
24
+ request.headers["X-Lookbook-Frame"].present?
25
+ end
16
26
  end
17
27
  end
@@ -1,79 +1,90 @@
1
1
  <% content_for :body do %>
2
- <div
3
- id="app"
4
- x-data="app"
5
- x-cloak
6
- x-on:popstate.window="handleNavigation"
7
- x-on:click.document="hijax"
8
- x-on:navigation:start="closeMobileSidebar"
9
- x-on:dom:update-complete.window="Lookbook.initEmbeds()"
10
- class="w-screen h-screen grid grid-rows-[40px_1fr] relative">
2
+ <% if request_frame == "root" %>
3
+ <div
4
+ id="app"
5
+ x-data="app"
6
+ x-cloak
7
+ x-on:popstate.window="handleNavigation"
8
+ x-on:click.document="hijax"
9
+ x-on:navigation:start="closeMobileSidebar"
10
+ x-on:dom:update-complete.window="Lookbook.initEmbeds()"
11
+ class="w-screen h-screen grid grid-rows-[40px_1fr] relative">
11
12
 
12
- <%= render "lookbook/partials/user_styles" %>
13
+ <%= render "lookbook/partials/user_styles" %>
13
14
 
14
- <%= lookbook_render :header,
15
- id: "app-header",
16
- debug_menu: @config.debug_menu,
17
- project_name: @config.project_name,
18
- project_logo: @config.project_logo %>
15
+ <%= lookbook_render :header,
16
+ id: "app-header",
17
+ debug_menu: @config.debug_menu,
18
+ project_name: @config.project_name,
19
+ project_logo: @config.project_logo %>
19
20
 
20
- <% if @previews.any? || @pages.any? %>
21
-
22
- <%= lookbook_render :split_layout,
23
- alpine_data: "$store.layout.main",
24
- ":class": "$store.layout.mobile && '!block'" do |layout| %>
21
+ <% unless @blank_slate %>
22
+
23
+ <%= lookbook_render :split_layout,
24
+ alpine_data: "$store.layout.main",
25
+ ":class": "$store.layout.mobile && '!block'" do |layout| %>
25
26
 
26
- <% layout.with_pane id: "app-sidebar", class: "flex flex-col bg-lookbook-sidebar-bg relative translate-x-0",
27
- ":class": "{
28
- 'transition': $store.layout.mobile,
29
- 'translate-x-full': $store.layout.mobile && sidebarHidden,
30
- '!absolute right-0 bottom-0 top-[40px] h-[calc(100%_-_40px)] w-full max-w-[420px] z-[1001] border-l border-lookbook-divider': $store.layout.mobile
31
- }",
32
- "x-on:click.outside": "closeMobileSidebar",
33
- cloak: true do %>
27
+ <% layout.with_pane id: "app-sidebar", class: "flex flex-col bg-lookbook-sidebar-bg relative translate-x-0",
28
+ ":class": "{
29
+ 'transition': $store.layout.mobile,
30
+ 'translate-x-full': $store.layout.mobile && sidebarHidden,
31
+ '!absolute right-0 bottom-0 top-[40px] h-[calc(100%_-_40px)] w-full max-w-[420px] z-[1001] border-l border-lookbook-divider': $store.layout.mobile
32
+ }",
33
+ "x-on:click.outside": "closeMobileSidebar",
34
+ cloak: true do %>
34
35
 
35
- <%= lookbook_render :split_layout,
36
- alpine_data: "$store.layout.#{@pages.any? && @previews.any? ? "sidebar" : "singleSectionSidebar"}",
37
- style: "height: calc(100vh - 2.5rem);" do |layout| %>
36
+ <% if @sidebar_panels.any? %>
37
+ <%= lookbook_render :split_layout,
38
+ alpine_data: "$store.layout.#{@sidebar_panels.many? ? "sidebar" : "singleSectionSidebar"}",
39
+ style: "height: calc(100vh - 2.5rem);" do |layout| %>
38
40
 
39
- <% if @previews.any? %>
40
- <% layout.with_pane class: "overflow-hidden" do %>
41
- <%= lookbook_render :nav,
42
- id: "previews-nav",
43
- tree: @previews.to_tree,
44
- alpine_data: "$store.nav.previews" do |nav| %>
45
- <%= nav.with_toolbar do |toolbar| %>
46
- <% toolbar.with_section padded: true do %>
47
- <h4 class="pt-1"><%= @config.preview_collection_label %></h4>
48
- <% end %>
49
- <% toolbar.with_section align: :right, padded: false do %>
50
- <%= lookbook_render :button_group, size: :xs do |group| %>
51
- <% group.with_button icon: :minus_square,
52
- tooltip: "Collapse all",
53
- "x-on:click": "closeAll" %>
41
+ <% @sidebar_panels.each do |panel| %>
42
+ <% if panel == :previews && @previews.any? %>
43
+ <% layout.with_pane class: "overflow-hidden" do %>
44
+ <%= lookbook_render :nav,
45
+ id: "previews-nav",
46
+ tree: @previews.to_tree,
47
+ alpine_data: "$store.nav.previews" do |nav| %>
48
+ <%= nav.with_toolbar do |toolbar| %>
49
+ <% toolbar.with_section padded: true do %>
50
+ <h4 class="pt-1"><%= @config.preview_collection_label %></h4>
51
+ <% end %>
52
+ <% toolbar.with_section align: :right, padded: false do %>
53
+ <%= lookbook_render :button_group, size: :xs do |group| %>
54
+ <% group.with_button icon: :minus_square,
55
+ tooltip: "Collapse all",
56
+ "x-on:click": "closeAll" %>
57
+ <% end %>
58
+ <% end %>
59
+ <% end %>
60
+ <% if @config.preview_nav_filter %>
61
+ <% nav.with_filter store: "$store.nav.previews.filter", placeholder: "Filter previews by name&hellip;" %>
62
+ <% end %>
54
63
  <% end %>
55
64
  <% end %>
56
65
  <% end %>
57
- <% nav.with_filter store: "$store.nav.previews.filter", placeholder: "Filter previews by name&hellip;" %>
58
- <% end %>
59
- <% end %>
60
- <% end %>
61
66
 
62
- <% if @pages.any? %>
63
- <% layout.with_pane class: "overflow-hidden" do %>
64
- <%= lookbook_render :nav,
65
- id: "pages-nav",
66
- tree: @pages.to_tree,
67
- alpine_data: "$store.nav.pages" do |nav| %>
68
- <%= nav.with_toolbar do |toolbar| %>
69
- <% toolbar.with_section padded: true do %>
70
- <h4 class="pt-1"><%= @config.page_collection_label %></h4>
71
- <% end %>
72
- <% toolbar.with_section align: :right, padded: false do %>
73
- <%= lookbook_render :button_group, size: :xs do |group| %>
74
- <% group.with_button icon: :minus_square,
75
- tooltip: "Collapse all",
76
- "x-on:click": "closeAll" %>
67
+ <% if panel == :pages && @pages.any? %>
68
+ <% layout.with_pane class: "overflow-hidden" do %>
69
+ <%= lookbook_render :nav,
70
+ id: "pages-nav",
71
+ tree: @pages.to_tree,
72
+ alpine_data: "$store.nav.pages" do |nav| %>
73
+ <%= nav.with_toolbar do |toolbar| %>
74
+ <% toolbar.with_section padded: true do %>
75
+ <h4 class="pt-1"><%= @config.page_collection_label %></h4>
76
+ <% end %>
77
+ <% toolbar.with_section align: :right, padded: false do %>
78
+ <%= lookbook_render :button_group, size: :xs do |group| %>
79
+ <% group.with_button icon: :minus_square,
80
+ tooltip: "Collapse all",
81
+ "x-on:click": "closeAll" %>
82
+ <% end %>
83
+ <% end %>
84
+ <% end %>
85
+ <% if @config.page_nav_filter %>
86
+ <% nav.with_filter store: "$store.nav.pages.filter", placeholder: "Filter pages by name&hellip;" %>
87
+ <% end %>
77
88
  <% end %>
78
89
  <% end %>
79
90
  <% end %>
@@ -81,26 +92,35 @@
81
92
  <% end %>
82
93
  <% end %>
83
94
  <% end %>
84
- <% end %>
85
95
 
86
- <% layout.with_pane id: "app-main", class: "overflow-hidden h-full", ":class": "$store.layout.mobile && 'w-screen'" do %>
87
- <%= content_for?(:main) ? yield(:main) : yield %>
96
+ <% layout.with_pane id: "app-main", class: "overflow-hidden h-full", ":class": "$store.layout.mobile && 'w-screen'" do %>
97
+ <%= content_for?(:main) ? yield(:main) : yield %>
98
+ <% end %>
88
99
  <% end %>
100
+ <% else %>
101
+ <div id="app-main" class="w-screen h-full overflow-hidden">
102
+ <%= content_for?(:main) ? yield(:main) : yield %>
103
+ </div>
89
104
  <% end %>
90
- <% else %>
91
- <div id="app-main" class="w-screen h-full overflow-hidden">
92
- <%= content_for?(:main) ? yield(:main) : yield %>
93
- </div>
94
- <% end %>
95
-
96
- <div class="absolute opacity-0 bg-black inset-0 top-[39px] z-[-1] transition-opacity" x-bind:class="($store.layout.mobile && !sidebarHidden) && '!opacity-30 !z-[1000]'" data-cloak></div>
105
+
106
+ <div class="absolute opacity-0 bg-black inset-0 top-[39px] z-[-1] transition-opacity" x-bind:class="($store.layout.mobile && !sidebarHidden) && '!opacity-30 !z-[1000]'" data-cloak></div>
107
+
108
+ <% if content_for? :dropdowns %>
109
+ <div class="hidden">
110
+ <%= content_for :dropdowns -%>
111
+ </div>
112
+ <% end %>
113
+ </div>
114
+ <% elsif request_frame == "main" %>
115
+ <div id="app-main">
116
+ <%= content_for?(:main) ? yield(:main) : yield %>
117
+ </div>
118
+ <% end %>
119
+ <% end %>
97
120
 
98
- <% if content_for? :dropdowns %>
99
- <div class="hidden">
100
- <%= content_for :dropdowns -%>
101
- </div>
102
- <% end %>
103
- </div>
121
+ <% if frame_request? %>
122
+ <%= yield :body %>
123
+ <% else %>
124
+ <%= render template: "layouts/lookbook/skeleton" %>
104
125
  <% end %>
105
126
 
106
- <%= render template: "layouts/lookbook/skeleton" %>
@@ -1,22 +1,34 @@
1
1
  <% content_for :body do %>
2
- <div
3
- id="app"
4
- x-data="app"
5
- x-cloak
6
- x-on:popstate.window="handleNavigation"
7
- x-on:click.document="hijax"
8
- class="overflow-hidden">
9
-
10
- <%= render "lookbook/partials/user_styles" %>
2
+ <% if request_frame == "root" %>
3
+ <div
4
+ id="app"
5
+ x-data="app"
6
+ x-cloak
7
+ x-on:popstate.window="handleNavigation"
8
+ x-on:click.document="hijax"
9
+ class="overflow-hidden">
10
+
11
+ <%= render "lookbook/partials/user_styles" %>
11
12
 
12
- <%= content_for?(:main) ? yield(:main) : yield %>
13
- </div>
14
-
15
- <% if content_for? :dropdowns %>
16
- <div class="hidden">
17
- <%= content_for :dropdowns -%>
13
+ <div id="app-main" class="contents">
14
+ <%= content_for?(:main) ? yield(:main) : yield %>
15
+ </div>
18
16
  </div>
19
- <% end %>
17
+
18
+ <% if content_for? :dropdowns %>
19
+ <div class="hidden">
20
+ <%= content_for :dropdowns -%>
21
+ </div>
22
+ <% end %>
23
+ <% elsif request_frame == "main" %>
24
+ <div id="app-main">
25
+ <%= content_for?(:main) ? yield(:main) : yield %>
26
+ </div>
27
+ <% end %>
20
28
  <% end %>
21
29
 
22
- <%= render template: "layouts/lookbook/skeleton" %>
30
+ <% if frame_request? %>
31
+ <%= yield :body %>
32
+ <% else %>
33
+ <%= render template: "layouts/lookbook/skeleton" %>
34
+ <% end %>
@@ -1,3 +1,7 @@
1
+ <%
2
+ sidebar_panels_config = @config.preview_inspector.sidebar_panels.map(&:to_sym)
3
+ %>
4
+
1
5
  <%= render "lookbook/partials/blank_slate" do %>
2
6
  <% if @blank_slate %>
3
7
  <%= lookbook_render :message,
@@ -5,17 +9,23 @@
5
9
  title: "Welcome to your Lookbook!",
6
10
  icon: :logo do %>
7
11
  <p>
8
- There isn't much to see yet, but
9
- <%= link_to "component previews",
10
- "#{@config.links.docs}/guide/previews",
11
- target: "_blank"
12
- %>
13
- and
14
- <%= link_to "content pages",
15
- "#{@config.links.docs}/guide/pages",
16
- target: "_blank"
17
- %>
18
- will show up here as soon as they are added.
12
+ There isn't much to see yet<% if sidebar_panels_config.any? %>, but<% end %>
13
+ <% if sidebar_panels_config.include?(:previews) %>
14
+ <%= link_to "component previews",
15
+ "#{@config.links.docs}/guide/previews",
16
+ target: "_blank"
17
+ %>
18
+ <% end %>
19
+ <% if sidebar_panels_config.many? %>and<% end %>
20
+ <% if sidebar_panels_config.include?(:pages) %>
21
+ <%= link_to "content pages",
22
+ "#{@config.links.docs}/guide/pages",
23
+ target: "_blank"
24
+ %>
25
+ <% end %>
26
+ <% if sidebar_panels_config.any? %>
27
+ will show up here as soon as they are added.
28
+ <% end %>
19
29
  </p>
20
30
  <% end %>
21
31
  <% else %>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M17 12h-2l-2 5-2-10-2 5H7"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17.5 12c0 4.4-3.6 8-8 8A4.5 4.5 0 0 1 5 15.5c0-6 8-4 8-8.5a3 3 0 1 0-6 0c0 3 2.5 8.5 12 13"/><path d="M16 12h3"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 17c-5-3-7-7-7-9a2 2 0 0 1 4 0c0 2.5-5 2.5-5 6 0 1.7 1.3 3 3 3 2.8 0 5-2.2 5-5"/><path d="M22 17c-5-3-7-7-7-9a2 2 0 0 1 4 0c0 2.5-5 2.5-5 6 0 1.7 1.3 3 3 3 2.8 0 5-2.2 5-5"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M2 12 7 2"/><path d="m7 12 5-10"/><path d="m12 12 5-10"/><path d="m17 12 5-10"/><path d="M4.5 7h15"/><path d="M12 16v6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="M10 4v4"/><path d="M2 8h20"/><path d="M6 4v4"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect width="20" height="5" x="2" y="3" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="m9.5 17 5-5"/><path d="m9.5 12 5 5"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 3v18h18"/><path d="M7 12v5h12V8l-5 5-4-4Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15 5H9"/><path d="M15 9v3h4l-7 7-7-7h4V9h6z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 15V9"/><path d="M15 15h-3v4l-7-7 7-7v4h3v6z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M5 9v6"/><path d="M9 9h3V5l7 7-7 7v-4H9V9z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9 19h6"/><path d="M9 15v-3H5l7-7 7 7h-4v3H9z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><rect x="15" y="4" width="4" height="6" ry="2"/><path d="M17 20v-6h-2"/><path d="M15 20h4"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M17 10V4h-2"/><path d="M15 10h4"/><rect x="15" y="14" width="4" height="6" ry="2"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M20 8h-5"/><path d="M15 10V6.5a2.5 2.5 0 0 1 5 0V10"/><path d="M15 14h5l-5 6h5"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 3H5"/><path d="M12 21V7"/><path d="m6 15 6 6 6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M2 12a10 10 0 1 1 10 10"/><path d="m2 22 10-10"/><path d="M8 22H2v-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="m16 8-8 8"/><path d="M16 16H8V8"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M11 4h4"/><path d="M11 8h7"/><path d="M11 12h10"/></svg>