lookbook 2.3.0 → 2.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -11
  3. data/app/components/lookbook/button/component.html.erb +1 -1
  4. data/app/components/lookbook/button/component.js +10 -3
  5. data/app/components/lookbook/display_options/editor/component.html.erb +1 -1
  6. data/app/components/lookbook/filter/component.html.erb +2 -2
  7. data/app/components/lookbook/header/component.html.erb +1 -1
  8. data/app/components/lookbook/icon/component.html.erb +4 -2
  9. data/app/components/lookbook/icon/component.rb +0 -16
  10. data/app/components/lookbook/nav/entity/component.html.erb +3 -0
  11. data/app/components/lookbook/nav/item/component.js +8 -10
  12. data/app/components/lookbook/params/editor/component.rb +1 -1
  13. data/app/components/lookbook/params/field/component.rb +1 -1
  14. data/app/components/lookbook/tab_panels/component.rb +1 -1
  15. data/app/controllers/lookbook/previews_controller.rb +11 -7
  16. data/app/helpers/lookbook/application_helper.rb +10 -0
  17. data/app/views/layouts/lookbook/application.html.erb +98 -87
  18. data/app/views/layouts/lookbook/embed.html.erb +29 -17
  19. data/app/views/layouts/lookbook/skeleton.html.erb +2 -0
  20. data/app/views/lookbook/inspector/panels/_notes.html.erb +1 -1
  21. data/app/views/lookbook/previews/preview.html.erb +5 -1
  22. data/assets/js/app.js +7 -4
  23. data/assets/js/helpers/request.js +2 -2
  24. data/config/app.yml +3 -1
  25. data/lib/lookbook/engine.rb +32 -6
  26. data/lib/lookbook/preview_controller_actions.rb +7 -2
  27. data/lib/lookbook/reloaders.rb +6 -2
  28. data/lib/lookbook/stores/config_store.rb +4 -0
  29. data/lib/lookbook/support/errors/config_error.rb +1 -1
  30. data/lib/lookbook/support/errors/parser_error.rb +1 -1
  31. data/lib/lookbook/support/errors/preview_template_error.rb +1 -1
  32. data/lib/lookbook/support/errors/template_error.rb +1 -1
  33. data/lib/lookbook/support/store.rb +1 -1
  34. data/lib/lookbook/support/utils/utils.rb +1 -1
  35. data/lib/lookbook/tags/yard_tag.rb +1 -1
  36. data/lib/lookbook/version.rb +1 -1
  37. data/public/lookbook-assets/css/lookbook.css +52 -42
  38. data/public/lookbook-assets/css/lookbook.css.map +1 -1
  39. data/public/lookbook-assets/css/themes/blue.css +0 -1
  40. data/public/lookbook-assets/css/themes/green.css +0 -1
  41. data/public/lookbook-assets/css/themes/indigo.css +0 -1
  42. data/public/lookbook-assets/css/themes/rose.css +0 -1
  43. data/public/lookbook-assets/css/themes/zinc.css +0 -1
  44. data/public/lookbook-assets/img/lucide-sprite.svg +1 -1
  45. data/public/lookbook-assets/js/iframe.js +193 -193
  46. data/public/lookbook-assets/js/index.js +680 -670
  47. data/public/lookbook-assets/js/index.js.map +1 -1
  48. data/public/lookbook-assets/js/lookbook-core.js +0 -37
  49. data/public/lookbook-assets/js/lookbook.js +252 -289
  50. metadata +5 -386
  51. data/assets/icons/activity-square.svg +0 -1
  52. data/assets/icons/ampersand.svg +0 -1
  53. data/assets/icons/ampersands.svg +0 -1
  54. data/assets/icons/antenna.svg +0 -1
  55. data/assets/icons/app-window.svg +0 -1
  56. data/assets/icons/archive-x.svg +0 -1
  57. data/assets/icons/area-chart.svg +0 -1
  58. data/assets/icons/arrow-big-down-dash.svg +0 -1
  59. data/assets/icons/arrow-big-left-dash.svg +0 -1
  60. data/assets/icons/arrow-big-right-dash.svg +0 -1
  61. data/assets/icons/arrow-big-up-dash.svg +0 -1
  62. data/assets/icons/arrow-down-0-1.svg +0 -1
  63. data/assets/icons/arrow-down-1-0.svg +0 -1
  64. data/assets/icons/arrow-down-a-z.svg +0 -1
  65. data/assets/icons/arrow-down-from-line.svg +0 -1
  66. data/assets/icons/arrow-down-left-from-circle.svg +0 -1
  67. data/assets/icons/arrow-down-left-square.svg +0 -1
  68. data/assets/icons/arrow-down-narrow-wide.svg +0 -1
  69. data/assets/icons/arrow-down-right-from-circle.svg +0 -1
  70. data/assets/icons/arrow-down-right-square.svg +0 -1
  71. data/assets/icons/arrow-down-square.svg +0 -1
  72. data/assets/icons/arrow-down-to-dot.svg +0 -1
  73. data/assets/icons/arrow-down-to-line.svg +0 -1
  74. data/assets/icons/arrow-down-up.svg +0 -1
  75. data/assets/icons/arrow-down-wide-narrow.svg +0 -1
  76. data/assets/icons/arrow-down-z-a.svg +0 -1
  77. data/assets/icons/arrow-left-from-line.svg +0 -1
  78. data/assets/icons/arrow-left-square.svg +0 -1
  79. data/assets/icons/arrow-left-to-line.svg +0 -1
  80. data/assets/icons/arrow-right-from-line.svg +0 -1
  81. data/assets/icons/arrow-right-left.svg +0 -1
  82. data/assets/icons/arrow-right-square.svg +0 -1
  83. data/assets/icons/arrow-right-to-line.svg +0 -1
  84. data/assets/icons/arrow-up-0-1.svg +0 -1
  85. data/assets/icons/arrow-up-1-0.svg +0 -1
  86. data/assets/icons/arrow-up-a-z.svg +0 -1
  87. data/assets/icons/arrow-up-from-dot.svg +0 -1
  88. data/assets/icons/arrow-up-from-line.svg +0 -1
  89. data/assets/icons/arrow-up-left-from-circle.svg +0 -1
  90. data/assets/icons/arrow-up-left-square.svg +0 -1
  91. data/assets/icons/arrow-up-narrow-wide.svg +0 -1
  92. data/assets/icons/arrow-up-right-from-circle.svg +0 -1
  93. data/assets/icons/arrow-up-right-square.svg +0 -1
  94. data/assets/icons/arrow-up-square.svg +0 -1
  95. data/assets/icons/arrow-up-to-line.svg +0 -1
  96. data/assets/icons/arrow-up-wide-narrow.svg +0 -1
  97. data/assets/icons/arrow-up-z-a.svg +0 -1
  98. data/assets/icons/arrows-up-from-line.svg +0 -1
  99. data/assets/icons/atom.svg +0 -1
  100. data/assets/icons/badge-alert.svg +0 -1
  101. data/assets/icons/badge-cent.svg +0 -1
  102. data/assets/icons/badge-check.svg +0 -1
  103. data/assets/icons/badge-dollar-sign.svg +0 -1
  104. data/assets/icons/badge-euro.svg +0 -1
  105. data/assets/icons/badge-help.svg +0 -1
  106. data/assets/icons/badge-indian-rupee.svg +0 -1
  107. data/assets/icons/badge-info.svg +0 -1
  108. data/assets/icons/badge-japanese-yen.svg +0 -1
  109. data/assets/icons/badge-minus.svg +0 -1
  110. data/assets/icons/badge-percent.svg +0 -1
  111. data/assets/icons/badge-plus.svg +0 -1
  112. data/assets/icons/badge-pound-sterling.svg +0 -1
  113. data/assets/icons/badge-russian-ruble.svg +0 -1
  114. data/assets/icons/badge-swiss-franc.svg +0 -1
  115. data/assets/icons/badge-x.svg +0 -1
  116. data/assets/icons/badge.svg +0 -1
  117. data/assets/icons/ban.svg +0 -1
  118. data/assets/icons/bar-chart-big.svg +0 -1
  119. data/assets/icons/bar-chart-horizontal-big.svg +0 -1
  120. data/assets/icons/bell-dot.svg +0 -1
  121. data/assets/icons/biohazard.svg +0 -1
  122. data/assets/icons/blocks.svg +0 -1
  123. data/assets/icons/book-copy.svg +0 -1
  124. data/assets/icons/book-down.svg +0 -1
  125. data/assets/icons/book-key.svg +0 -1
  126. data/assets/icons/book-lock.svg +0 -1
  127. data/assets/icons/book-marked.svg +0 -1
  128. data/assets/icons/book-minus.svg +0 -1
  129. data/assets/icons/book-plus.svg +0 -1
  130. data/assets/icons/book-template.svg +0 -1
  131. data/assets/icons/book-up-2.svg +0 -1
  132. data/assets/icons/book-up.svg +0 -1
  133. data/assets/icons/book-x.svg +0 -1
  134. data/assets/icons/bookmark-check.svg +0 -1
  135. data/assets/icons/bookmark-x.svg +0 -1
  136. data/assets/icons/boom-box.svg +0 -1
  137. data/assets/icons/braces.svg +0 -1
  138. data/assets/icons/brackets.svg +0 -1
  139. data/assets/icons/brain-circuit.svg +0 -1
  140. data/assets/icons/brain-cog.svg +0 -1
  141. data/assets/icons/brain.svg +0 -1
  142. data/assets/icons/bring-to-front.svg +0 -1
  143. data/assets/icons/bug-off.svg +0 -1
  144. data/assets/icons/bug-play.svg +0 -1
  145. data/assets/icons/bus-front.svg +0 -1
  146. data/assets/icons/cable-car.svg +0 -1
  147. data/assets/icons/cable.svg +0 -1
  148. data/assets/icons/cake-slice.svg +0 -1
  149. data/assets/icons/candlestick-chart.svg +0 -1
  150. data/assets/icons/candy-cane.svg +0 -1
  151. data/assets/icons/car-front.svg +0 -1
  152. data/assets/icons/car-taxi-front.svg +0 -1
  153. data/assets/icons/case-lower.svg +0 -1
  154. data/assets/icons/case-sensitive.svg +0 -1
  155. data/assets/icons/case-upper.svg +0 -1
  156. data/assets/icons/cassette-tape.svg +0 -1
  157. data/assets/icons/castle.svg +0 -1
  158. data/assets/icons/chevron-down-circle.svg +0 -1
  159. data/assets/icons/chevron-down-square.svg +0 -1
  160. data/assets/icons/chevron-left-circle.svg +0 -1
  161. data/assets/icons/chevron-left-square.svg +0 -1
  162. data/assets/icons/chevron-right-circle.svg +0 -1
  163. data/assets/icons/chevron-right-square.svg +0 -1
  164. data/assets/icons/chevron-up-circle.svg +0 -1
  165. data/assets/icons/chevron-up-square.svg +0 -1
  166. data/assets/icons/church.svg +0 -1
  167. data/assets/icons/circle-dashed.svg +0 -1
  168. data/assets/icons/circle-dollar-sign.svg +0 -1
  169. data/assets/icons/circle-dot-dashed.svg +0 -1
  170. data/assets/icons/circle-equal.svg +0 -1
  171. data/assets/icons/circle-off.svg +0 -1
  172. data/assets/icons/circle-slash-2.svg +0 -1
  173. data/assets/icons/circle-slash.svg +0 -1
  174. data/assets/icons/circuit-board.svg +0 -1
  175. data/assets/icons/clipboard-paste.svg +0 -1
  176. data/assets/icons/club.svg +0 -1
  177. data/assets/icons/combine.svg +0 -1
  178. data/assets/icons/computer.svg +0 -1
  179. data/assets/icons/contact-2.svg +0 -1
  180. data/assets/icons/container.svg +0 -1
  181. data/assets/icons/copy-check.svg +0 -1
  182. data/assets/icons/copy-minus.svg +0 -1
  183. data/assets/icons/copy-plus.svg +0 -1
  184. data/assets/icons/copy-slash.svg +0 -1
  185. data/assets/icons/copy-x.svg +0 -1
  186. data/assets/icons/database-zap.svg +0 -1
  187. data/assets/icons/dessert.svg +0 -1
  188. data/assets/icons/disc-2.svg +0 -1
  189. data/assets/icons/disc-3.svg +0 -1
  190. data/assets/icons/donut.svg +0 -1
  191. data/assets/icons/door-closed.svg +0 -1
  192. data/assets/icons/door-open.svg +0 -1
  193. data/assets/icons/dot.svg +0 -1
  194. data/assets/icons/drama.svg +0 -1
  195. data/assets/icons/ferris-wheel.svg +0 -1
  196. data/assets/icons/file-code-2.svg +0 -1
  197. data/assets/icons/file-stack.svg +0 -1
  198. data/assets/icons/fish-symbol.svg +0 -1
  199. data/assets/icons/fold-horizontal.svg +0 -1
  200. data/assets/icons/fold-vertical.svg +0 -1
  201. data/assets/icons/folder-dot.svg +0 -1
  202. data/assets/icons/folder-git-2.svg +0 -1
  203. data/assets/icons/folder-git.svg +0 -1
  204. data/assets/icons/folder-kanban.svg +0 -1
  205. data/assets/icons/folder-open-dot.svg +0 -1
  206. data/assets/icons/folder-root.svg +0 -1
  207. data/assets/icons/folder-sync.svg +0 -1
  208. data/assets/icons/gallery-horizontal-end.svg +0 -1
  209. data/assets/icons/gallery-horizontal.svg +0 -1
  210. data/assets/icons/gallery-thumbnails.svg +0 -1
  211. data/assets/icons/gallery-vertical-end.svg +0 -1
  212. data/assets/icons/gallery-vertical.svg +0 -1
  213. data/assets/icons/gantt-chart-square.svg +0 -1
  214. data/assets/icons/gantt-chart.svg +0 -1
  215. data/assets/icons/gauge-circle.svg +0 -1
  216. data/assets/icons/goal.svg +0 -1
  217. data/assets/icons/grid-2x2.svg +0 -1
  218. data/assets/icons/grid-3x3.svg +0 -1
  219. data/assets/icons/group.svg +0 -1
  220. data/assets/icons/hard-drive-download.svg +0 -1
  221. data/assets/icons/hard-drive-upload.svg +0 -1
  222. data/assets/icons/hdmi-port.svg +0 -1
  223. data/assets/icons/hotel.svg +0 -1
  224. data/assets/icons/iteration-ccw.svg +0 -1
  225. data/assets/icons/iteration-cw.svg +0 -1
  226. data/assets/icons/kanban-square-dashed.svg +0 -1
  227. data/assets/icons/kanban-square.svg +0 -1
  228. data/assets/icons/kanban.svg +0 -1
  229. data/assets/icons/key-round.svg +0 -1
  230. data/assets/icons/key-square.svg +0 -1
  231. data/assets/icons/layout-panel-left.svg +0 -1
  232. data/assets/icons/layout-panel-top.svg +0 -1
  233. data/assets/icons/leafy-green.svg +0 -1
  234. data/assets/icons/ligature.svg +0 -1
  235. data/assets/icons/list-filter.svg +0 -1
  236. data/assets/icons/list-restart.svg +0 -1
  237. data/assets/icons/list-todo.svg +0 -1
  238. data/assets/icons/list-tree.svg +0 -1
  239. data/assets/icons/lollipop.svg +0 -1
  240. data/assets/icons/m-square.svg +0 -1
  241. data/assets/icons/mailbox.svg +0 -1
  242. data/assets/icons/memory-stick.svg +0 -1
  243. data/assets/icons/menu-square.svg +0 -1
  244. data/assets/icons/merge.svg +0 -1
  245. data/assets/icons/message-square-dashed.svg +0 -1
  246. data/assets/icons/message-square-plus.svg +0 -1
  247. data/assets/icons/messages-square.svg +0 -1
  248. data/assets/icons/monitor-check.svg +0 -1
  249. data/assets/icons/monitor-dot.svg +0 -1
  250. data/assets/icons/monitor-down.svg +0 -1
  251. data/assets/icons/monitor-pause.svg +0 -1
  252. data/assets/icons/monitor-play.svg +0 -1
  253. data/assets/icons/monitor-stop.svg +0 -1
  254. data/assets/icons/monitor-up.svg +0 -1
  255. data/assets/icons/monitor-x.svg +0 -1
  256. data/assets/icons/moon-star.svg +0 -1
  257. data/assets/icons/mouse-pointer-square-dashed.svg +0 -1
  258. data/assets/icons/mouse-pointer-square.svg +0 -1
  259. data/assets/icons/move-down-left.svg +0 -1
  260. data/assets/icons/move-down-right.svg +0 -1
  261. data/assets/icons/move-down.svg +0 -1
  262. data/assets/icons/move-left.svg +0 -1
  263. data/assets/icons/move-right.svg +0 -1
  264. data/assets/icons/move-up-left.svg +0 -1
  265. data/assets/icons/move-up-right.svg +0 -1
  266. data/assets/icons/move-up.svg +0 -1
  267. data/assets/icons/orbit.svg +0 -1
  268. data/assets/icons/panel-bottom-close.svg +0 -1
  269. data/assets/icons/panel-bottom-inactive.svg +0 -1
  270. data/assets/icons/panel-bottom-open.svg +0 -1
  271. data/assets/icons/panel-bottom.svg +0 -1
  272. data/assets/icons/panel-left-close.svg +0 -1
  273. data/assets/icons/panel-left-inactive.svg +0 -1
  274. data/assets/icons/panel-left-open.svg +0 -1
  275. data/assets/icons/panel-left.svg +0 -1
  276. data/assets/icons/panel-right-close.svg +0 -1
  277. data/assets/icons/panel-right-inactive.svg +0 -1
  278. data/assets/icons/panel-right-open.svg +0 -1
  279. data/assets/icons/panel-right.svg +0 -1
  280. data/assets/icons/panel-top-close.svg +0 -1
  281. data/assets/icons/panel-top-inactive.svg +0 -1
  282. data/assets/icons/panel-top-open.svg +0 -1
  283. data/assets/icons/panel-top.svg +0 -1
  284. data/assets/icons/parentheses.svg +0 -1
  285. data/assets/icons/parking-circle-off.svg +0 -1
  286. data/assets/icons/parking-circle.svg +0 -1
  287. data/assets/icons/parking-meter.svg +0 -1
  288. data/assets/icons/parking-square-off.svg +0 -1
  289. data/assets/icons/parking-square.svg +0 -1
  290. data/assets/icons/paw-print.svg +0 -1
  291. data/assets/icons/pc-case.svg +0 -1
  292. data/assets/icons/pen-line.svg +0 -1
  293. data/assets/icons/pen-square.svg +0 -1
  294. data/assets/icons/pen.svg +0 -1
  295. data/assets/icons/pencil-line.svg +0 -1
  296. data/assets/icons/pencil-ruler.svg +0 -1
  297. data/assets/icons/percent-circle.svg +0 -1
  298. data/assets/icons/percent-diamond.svg +0 -1
  299. data/assets/icons/percent-square.svg +0 -1
  300. data/assets/icons/pi-square.svg +0 -1
  301. data/assets/icons/pi.svg +0 -1
  302. data/assets/icons/pilcrow-square.svg +0 -1
  303. data/assets/icons/plane-landing.svg +0 -1
  304. data/assets/icons/plane-takeoff.svg +0 -1
  305. data/assets/icons/play-square.svg +0 -1
  306. data/assets/icons/plug-zap-2.svg +0 -1
  307. data/assets/icons/pocket-knife.svg +0 -1
  308. data/assets/icons/popcorn.svg +0 -1
  309. data/assets/icons/popsicle.svg +0 -1
  310. data/assets/icons/presentation.svg +0 -1
  311. data/assets/icons/projector.svg +0 -1
  312. data/assets/icons/rabbit.svg +0 -1
  313. data/assets/icons/radar.svg +0 -1
  314. data/assets/icons/radiation.svg +0 -1
  315. data/assets/icons/radio-tower.svg +0 -1
  316. data/assets/icons/rail-symbol.svg +0 -1
  317. data/assets/icons/rainbow.svg +0 -1
  318. data/assets/icons/rat.svg +0 -1
  319. data/assets/icons/ratio.svg +0 -1
  320. data/assets/icons/receipt.svg +0 -1
  321. data/assets/icons/redo-dot.svg +0 -1
  322. data/assets/icons/refresh-ccw-dot.svg +0 -1
  323. data/assets/icons/refresh-cw-off.svg +0 -1
  324. data/assets/icons/repeat-2.svg +0 -1
  325. data/assets/icons/replace-all.svg +0 -1
  326. data/assets/icons/replace.svg +0 -1
  327. data/assets/icons/roller-coaster.svg +0 -1
  328. data/assets/icons/rows.svg +0 -1
  329. data/assets/icons/satellite-dish.svg +0 -1
  330. data/assets/icons/satellite.svg +0 -1
  331. data/assets/icons/save-all.svg +0 -1
  332. data/assets/icons/scatter-chart.svg +0 -1
  333. data/assets/icons/school-2.svg +0 -1
  334. data/assets/icons/school.svg +0 -1
  335. data/assets/icons/scissors-line-dashed.svg +0 -1
  336. data/assets/icons/scissors-square-dashed-bottom.svg +0 -1
  337. data/assets/icons/scissors-square.svg +0 -1
  338. data/assets/icons/scroll-text.svg +0 -1
  339. data/assets/icons/search-check.svg +0 -1
  340. data/assets/icons/search-code.svg +0 -1
  341. data/assets/icons/search-slash.svg +0 -1
  342. data/assets/icons/search-x.svg +0 -1
  343. data/assets/icons/send-horizontal.svg +0 -1
  344. data/assets/icons/send-to-back.svg +0 -1
  345. data/assets/icons/shapes.svg +0 -1
  346. data/assets/icons/shell.svg +0 -1
  347. data/assets/icons/shield-ban.svg +0 -1
  348. data/assets/icons/shield-ellipsis.svg +0 -1
  349. data/assets/icons/shield-half.svg +0 -1
  350. data/assets/icons/shield-minus.svg +0 -1
  351. data/assets/icons/shield-plus.svg +0 -1
  352. data/assets/icons/shield-question.svg +0 -1
  353. data/assets/icons/shield-x.svg +0 -1
  354. data/assets/icons/ship-wheel.svg +0 -1
  355. data/assets/icons/shopping-basket.svg +0 -1
  356. data/assets/icons/sigma-square.svg +0 -1
  357. data/assets/icons/snail.svg +0 -1
  358. data/assets/icons/space.svg +0 -1
  359. data/assets/icons/spade.svg +0 -1
  360. data/assets/icons/sparkle.svg +0 -1
  361. data/assets/icons/sparkles.svg +0 -1
  362. data/assets/icons/speech.svg +0 -1
  363. data/assets/icons/spell-check-2.svg +0 -1
  364. data/assets/icons/spell-check.svg +0 -1
  365. data/assets/icons/split.svg +0 -1
  366. data/assets/icons/spray-can.svg +0 -1
  367. data/assets/icons/square-asterisk.svg +0 -1
  368. data/assets/icons/square-code.svg +0 -1
  369. data/assets/icons/square-dashed-bottom-code.svg +0 -1
  370. data/assets/icons/square-dashed-bottom.svg +0 -1
  371. data/assets/icons/square-dot.svg +0 -1
  372. data/assets/icons/square-equal.svg +0 -1
  373. data/assets/icons/square-slash.svg +0 -1
  374. data/assets/icons/square-stack.svg +0 -1
  375. data/assets/icons/squirrel.svg +0 -1
  376. data/assets/icons/step-back.svg +0 -1
  377. data/assets/icons/step-forward.svg +0 -1
  378. data/assets/icons/store.svg +0 -1
  379. data/assets/icons/table-properties.svg +0 -1
  380. data/assets/icons/tablet-smartphone.svg +0 -1
  381. data/assets/icons/tally-1.svg +0 -1
  382. data/assets/icons/tally-2.svg +0 -1
  383. data/assets/icons/tally-3.svg +0 -1
  384. data/assets/icons/tally-4.svg +0 -1
  385. data/assets/icons/tally-5.svg +0 -1
  386. data/assets/icons/test-tube-2.svg +0 -1
  387. data/assets/icons/test-tube.svg +0 -1
  388. data/assets/icons/test-tubes.svg +0 -1
  389. data/assets/icons/text-quote.svg +0 -1
  390. data/assets/icons/text-select.svg +0 -1
  391. data/assets/icons/text.svg +0 -1
  392. data/assets/icons/theater.svg +0 -1
  393. data/assets/icons/touchpad-off.svg +0 -1
  394. data/assets/icons/touchpad.svg +0 -1
  395. data/assets/icons/tractor.svg +0 -1
  396. data/assets/icons/traffic-cone.svg +0 -1
  397. data/assets/icons/train-front-tunnel.svg +0 -1
  398. data/assets/icons/train-front.svg +0 -1
  399. data/assets/icons/train-track.svg +0 -1
  400. data/assets/icons/tram-front.svg +0 -1
  401. data/assets/icons/triangle-right.svg +0 -1
  402. data/assets/icons/turtle.svg +0 -1
  403. data/assets/icons/undo-dot.svg +0 -1
  404. data/assets/icons/unfold-horizontal.svg +0 -1
  405. data/assets/icons/unfold-vertical.svg +0 -1
  406. data/assets/icons/ungroup.svg +0 -1
  407. data/assets/icons/unplug.svg +0 -1
  408. data/assets/icons/user-2.svg +0 -1
  409. data/assets/icons/user-check-2.svg +0 -1
  410. data/assets/icons/user-circle-2.svg +0 -1
  411. data/assets/icons/user-circle.svg +0 -1
  412. data/assets/icons/user-cog-2.svg +0 -1
  413. data/assets/icons/user-minus-2.svg +0 -1
  414. data/assets/icons/user-plus-2.svg +0 -1
  415. data/assets/icons/user-square-2.svg +0 -1
  416. data/assets/icons/user-square.svg +0 -1
  417. data/assets/icons/user-x-2.svg +0 -1
  418. data/assets/icons/users-2.svg +0 -1
  419. data/assets/icons/variable.svg +0 -1
  420. data/assets/icons/videotape.svg +0 -1
  421. data/assets/icons/wallet-2.svg +0 -1
  422. data/assets/icons/wallet-cards.svg +0 -1
  423. data/assets/icons/wallpaper.svg +0 -1
  424. data/assets/icons/warehouse.svg +0 -1
  425. data/assets/icons/whole-word.svg +0 -1
  426. data/assets/icons/workflow.svg +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0277029efee9bfc07832f5bc2ea7d1a57063a81e2e2986978c93abca8750fbe2'
4
- data.tar.gz: c03b8c178645b7dba6572d37711cb4664ea4175fa56430acd595a369069d54c9
3
+ metadata.gz: c1cd08282fd3abb0cb21cebd971a24d255839e0137abb7bea4e58770655b7329
4
+ data.tar.gz: 3c976d7cd1b69e72c667b7ffdd059b89a1c13cd6d69386650b88a3bb05d3d315
5
5
  SHA512:
6
- metadata.gz: c34fbd701d1f7818dea444b9ad899b7dce012968a0cc0038dd197bf0e70ea2af105c2d299e3ac21302f9276d0dde162b56cfebb8f45ba4e7eb9c1ab1455c4555
7
- data.tar.gz: 50613e6f04c758f5c93fa4ff659a0a0a4c1a903e80d167a3c1aead2f6e5af7278549b260255405c077fe1f35ba920fc050fdfdb0dab4d37ce7df18658f6ace47
6
+ metadata.gz: ff9c90f7415fc2ba4d2441e2d348bebe4ad2bb2395437cec315ad78af9687f00164d583ad1add293309bc04fe3b99e24da1ba727576ad58d334c16a457f190ee
7
+ data.tar.gz: 823fcbef26329719ada1600a8a0e15432edbf951232a1fde11f14f78d7bd758188e237159fb8192e8a4ff013a9dde4ced5d987de326fde06a0b98cd84dc705ab
data/README.md CHANGED
@@ -7,7 +7,7 @@
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
 
@@ -32,9 +32,9 @@ Lookbook is implemented as an isolated [Rails Engine](https://guides.rubyonrails
32
32
 
33
33
  This repository contains:
34
34
 
35
- * 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)
36
- * The Lookbook [documentation site](#docs-site) source code and content ([`/docs`](https://github.com/ViewComponent/lookbook/tree/main/docs)).
37
- * 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)).
38
38
 
39
39
  ### Documentation site
40
40
 
@@ -49,9 +49,9 @@ To preview changes locally you can run a development version of the docs site:
49
49
 
50
50
  ### Testing
51
51
 
52
- Lookbook uses [RSpec](https://relishapp.com/rspec) for testing.
52
+ Lookbook uses [RSpec](https://relishapp.com/rspec). [Appraisal](https://github.com/thoughtbot/appraisal) is used to run tests against different Ruby and Rails versions.
53
53
 
54
- Tests can be run using the `rake spec` or `bundle exec rspec` commands.
54
+ Tests can be run using the `bundle exec appraisal rspec` command.
55
55
 
56
56
  The dummy app that the tests are being run against can be viewed by running the `bin/dummy` command and then browsing to http://localhost:9292/lookbook
57
57
 
@@ -61,22 +61,22 @@ Lookbook uses [Release It!](https://github.com/release-it/release-it) to automat
61
61
 
62
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.
63
63
 
64
- 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.
65
65
 
66
66
  ## Contributing
67
67
 
68
68
  Lookbook is an un-funded open source project and contributions of all types and sizes are most welcome!
69
69
 
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/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.
71
71
 
72
72
  ## Contributors
73
73
 
74
74
  Lookbook was created by [Mark Perkins](https://github.com/allmarkedup) and continues to grow
75
- &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):
76
76
  <br>
77
77
  <br>
78
- <a href="https://github.com/ViewComponent/lookbook/graphs/contributors">
79
- <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" />
80
80
  </a>
81
81
 
82
82
  ## License
@@ -2,7 +2,7 @@
2
2
  id: id,
3
3
  icon: icon,
4
4
  **button_attrs,
5
- "x-on:keydown.esc.stop": "hideDropdown",
5
+ "x-on:keydown.esc.stop.document": "hideDropdown",
6
6
  "x-on:navigation:complete.window": "updateDropdown") do %>
7
7
  <%= content %>
8
8
  <% end %>
@@ -6,7 +6,12 @@ export default function buttonComponent() {
6
6
  let dropdown = null;
7
7
 
8
8
  return {
9
+ updateAfterNavigate: true,
10
+
9
11
  init() {
12
+ this.updateAfterNavigate =
13
+ this.$el.dataset.updateAfterNavigate !== "false";
14
+
10
15
  if (this.$refs.tooltip) {
11
16
  tooltip = initTooltip(this, {
12
17
  target: this.$refs.icon,
@@ -51,9 +56,11 @@ export default function buttonComponent() {
51
56
  updateDropdown() {
52
57
  if (dropdown) {
53
58
  dropdown.hide();
54
- this.$nextTick(() => {
55
- dropdown.setContent(this.dropdownContent);
56
- });
59
+ if (this.updateAfterNavigate) {
60
+ this.$nextTick(() => {
61
+ dropdown.setContent(this.dropdownContent);
62
+ });
63
+ }
57
64
  }
58
65
  },
59
66
 
@@ -1,6 +1,6 @@
1
1
  <%= render_component_tag class: "px-2" do %>
2
2
  <% if fields.many? %>
3
- <%= lookbook_render :button, id: "display-options-dropdown-button", icon: :settings, tooltip: "Display options" do |button| %>
3
+ <%= lookbook_render :button, id: "display-options-dropdown-button", icon: :settings, tooltip: "Display options", data: {update_after_navigate: false} do |button| %>
4
4
  <% button.with_dropdown do %>
5
5
  <div class="p-3 space-y-3">
6
6
  <%= safe_join(fields) %>
@@ -11,7 +11,7 @@
11
11
  x-on:keydown.f.window="if (!($event.shiftKey || $event.metaKey || $event.ctrlKey || $event.altKey)) { focus(); $event.preventDefault(); $event.stopPropagation(); }"
12
12
  x-on:keydown.stop>
13
13
  <button class="text-lookbook-icon-button-stroke hover:text-lookbook-icon-button-stroke-hover focus:ring-0 focus:outline-none absolute top-1/2 right-3 -translate-y-1/2" x-on:click="clear" x-bind:class="{hidden: !active}">
14
- <%= icon :x, size: 3 %>
14
+ <%= icon :x, size: 4 %>
15
15
  </button>
16
16
  </div>
17
- <% end %>
17
+ <% end %>
@@ -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
  },
@@ -9,7 +9,7 @@ module Lookbook
9
9
  def initialize(**html_attrs)
10
10
  @field_count = -1
11
11
  @@input_styles = {}
12
- super(**html_attrs)
12
+ super
13
13
  end
14
14
 
15
15
  def before_render
@@ -14,7 +14,7 @@ module Lookbook
14
14
  styles, html = StylesExtractor.call(render_input)
15
15
  Editor::Component.add_styles(param.input, styles)
16
16
 
17
- escaped_value = json_escape(param.value.to_s).gsub("\n", '\n')
17
+ escaped_value = html_escape(json_escape(param.value.to_s).gsub("\n", '\n'))
18
18
  wrapper_attrs = {
19
19
  data: {"param-input": param.input},
20
20
  "x-data": "paramsInputComponent({name: \"#{param.name}\", value: \"#{escaped_value}\"})"
@@ -8,7 +8,7 @@ module Lookbook
8
8
 
9
9
  def initialize(**html_attrs)
10
10
  @panel_counter = 0
11
- super(**html_attrs)
11
+ super
12
12
  end
13
13
 
14
14
  protected
@@ -39,13 +39,17 @@ module Lookbook
39
39
  def show
40
40
  raise_not_found("Preview not found") unless @target
41
41
 
42
- @preview_html = preview_controller.process(
43
- :render_in_layout_to_string,
44
- "lookbook/previews/group",
45
- inspector_data,
46
- layout: @preview.layout,
47
- append_html: (iframe_content_scripts if embedded?)
48
- )
42
+ @preview_html = if Lookbook.config.preview_single_pass_rendering && !inspector_data.scenarios.many?
43
+ inspector_data.scenarios.first.output + (iframe_content_scripts if embedded?)
44
+ else
45
+ preview_controller.process(
46
+ :render_in_layout_to_string,
47
+ "lookbook/previews/group",
48
+ inspector_data,
49
+ layout: @preview.layout,
50
+ append_html: (iframe_content_scripts if embedded?)
51
+ )
52
+ end
49
53
  end
50
54
 
51
55
  private
@@ -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,88 +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
- <% unless @blank_slate %>
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
- <% if @sidebar_panels.any? %>
36
- <%= lookbook_render :split_layout,
37
- alpine_data: "$store.layout.#{@sidebar_panels.many? ? "sidebar" : "singleSectionSidebar"}",
38
- 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| %>
39
40
 
40
- <% @sidebar_panels.each do |panel| %>
41
- <% if panel == :previews && @previews.any? %>
42
- <% layout.with_pane class: "overflow-hidden" do %>
43
- <%= lookbook_render :nav,
44
- id: "previews-nav",
45
- tree: @previews.to_tree,
46
- alpine_data: "$store.nav.previews" do |nav| %>
47
- <%= nav.with_toolbar do |toolbar| %>
48
- <% toolbar.with_section padded: true do %>
49
- <h4 class="pt-1"><%= @config.preview_collection_label %></h4>
50
- <% end %>
51
- <% toolbar.with_section align: :right, padded: false do %>
52
- <%= lookbook_render :button_group, size: :xs do |group| %>
53
- <% group.with_button icon: :minus_square,
54
- tooltip: "Collapse all",
55
- "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 %>
56
58
  <% end %>
57
59
  <% end %>
58
- <% end %>
59
- <% if @config.preview_nav_filter %>
60
- <% nav.with_filter store: "$store.nav.previews.filter", placeholder: "Filter previews by name&hellip;" %>
60
+ <% if @config.preview_nav_filter %>
61
+ <% nav.with_filter store: "$store.nav.previews.filter", placeholder: "Filter previews by name&hellip;" %>
62
+ <% end %>
61
63
  <% end %>
62
64
  <% end %>
63
65
  <% end %>
64
- <% end %>
65
66
 
66
- <% if panel == :pages && @pages.any? %>
67
- <% layout.with_pane class: "overflow-hidden" do %>
68
- <%= lookbook_render :nav,
69
- id: "pages-nav",
70
- tree: @pages.to_tree,
71
- alpine_data: "$store.nav.pages" do |nav| %>
72
- <%= nav.with_toolbar do |toolbar| %>
73
- <% toolbar.with_section padded: true do %>
74
- <h4 class="pt-1"><%= @config.page_collection_label %></h4>
75
- <% end %>
76
- <% toolbar.with_section align: :right, padded: false do %>
77
- <%= lookbook_render :button_group, size: :xs do |group| %>
78
- <% group.with_button icon: :minus_square,
79
- tooltip: "Collapse all",
80
- "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 %>
81
83
  <% end %>
82
84
  <% end %>
83
- <% end %>
84
- <% if @config.page_nav_filter %>
85
- <% nav.with_filter store: "$store.nav.pages.filter", placeholder: "Filter pages by name&hellip;" %>
85
+ <% if @config.page_nav_filter %>
86
+ <% nav.with_filter store: "$store.nav.pages.filter", placeholder: "Filter pages by name&hellip;" %>
87
+ <% end %>
86
88
  <% end %>
87
89
  <% end %>
88
90
  <% end %>
@@ -90,26 +92,35 @@
90
92
  <% end %>
91
93
  <% end %>
92
94
  <% end %>
93
- <% end %>
94
95
 
95
- <% layout.with_pane id: "app-main", class: "overflow-hidden h-full", ":class": "$store.layout.mobile && 'w-screen'" do %>
96
- <%= 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 %>
97
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>
98
104
  <% end %>
99
- <% else %>
100
- <div id="app-main" class="w-screen h-full overflow-hidden">
101
- <%= content_for?(:main) ? yield(:main) : yield %>
102
- </div>
103
- <% end %>
104
-
105
- <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 %>
106
120
 
107
- <% if content_for? :dropdowns %>
108
- <div class="hidden">
109
- <%= content_for :dropdowns -%>
110
- </div>
111
- <% end %>
112
- </div>
121
+ <% if frame_request? %>
122
+ <%= yield :body %>
123
+ <% else %>
124
+ <%= render template: "layouts/lookbook/skeleton" %>
113
125
  <% end %>
114
126
 
115
- <%= 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 %>
@@ -5,6 +5,8 @@
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
7
7
 
8
+ <%= csrf_meta_tags %>
9
+
8
10
  <link href="<%= lookbook_asset_path("/css/lookbook.css") %>" rel="stylesheet">
9
11
  <link href="<%= lookbook_asset_path("/css/themes/#{@config.ui_theme}.css") %>" rel="stylesheet">
10
12
 
@@ -11,7 +11,7 @@
11
11
  <% end %>
12
12
  </div>
13
13
  <% else %>
14
- <div class="p-4 w-full h-full bg-lookbook-prose-bg">
14
+ <div class="p-4 w-full min-h-full h-max bg-lookbook-prose-bg">
15
15
  <%= lookbook_render :prose do %>
16
16
  <%== items.any? ? items.first.notes : "<em class='opacity-50'>No notes provided.</em>" %>
17
17
  <% end %>
@@ -1,6 +1,10 @@
1
1
  <% if @render_args[:component] %>
2
2
  <% if defined?(Phlex::SGML) && @render_args[:component].is_a?(Phlex::SGML) %>
3
- <%= raw(@render_args[:component].call(view_context: self, &@render_args[:block])) %>
3
+ <% if defined?(Phlex::VERSION) && Gem::Version.new(Phlex::VERSION) >= Gem::Version.new("2.0.0") %>
4
+ <%= raw(@render_args[:component].call(context: { rails_view_context: self }, &@render_args[:block])) %>
5
+ <% else %>
6
+ <%= raw(@render_args[:component].call(view_context: self, &@render_args[:block])) %>
7
+ <% end %>
4
8
  <% else %>
5
9
  <%= render(@render_args[:component], @render_args[:args], &@render_args[:block]) %>
6
10
  <% end %>
data/assets/js/app.js CHANGED
@@ -43,7 +43,9 @@ export default function app() {
43
43
  this.debug("Navigating to ", window.location.pathname);
44
44
  this.$dispatch("navigation:start");
45
45
  this.location = window.location;
46
- await this.updateDOM();
46
+ await this.updateDOM("#app-main", {
47
+ headers: { "X-Lookbook-Frame": "main" },
48
+ });
47
49
  this.$dispatch("navigation:complete");
48
50
  },
49
51
 
@@ -65,16 +67,17 @@ export default function app() {
65
67
  }
66
68
  },
67
69
 
68
- async updateDOM() {
70
+ async updateDOM(rootSelector = `#${this.$root.id}`, options = {}) {
69
71
  this.debug("Starting DOM update");
70
72
  this.$dispatch("dom:update-start");
71
73
  this.requestStart();
72
74
  try {
73
75
  const { fragment, title } = await fetchHTML(
74
76
  window.location,
75
- `#${this.$root.id}`
77
+ rootSelector,
78
+ options
76
79
  );
77
- morph(this.$root, fragment);
80
+ morph(document.querySelector(rootSelector), fragment);
78
81
  document.title = title;
79
82
  this.requestEnd();
80
83
  this.$dispatch("dom:update-complete");