lookbook 2.3.0 → 2.3.12

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 (429) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -11
  3. data/app/components/lookbook/base_component.rb +1 -0
  4. data/app/components/lookbook/button/component.html.erb +1 -1
  5. data/app/components/lookbook/button/component.js +10 -3
  6. data/app/components/lookbook/display_options/editor/component.html.erb +1 -1
  7. data/app/components/lookbook/filter/component.html.erb +2 -2
  8. data/app/components/lookbook/header/component.html.erb +1 -1
  9. data/app/components/lookbook/icon/component.html.erb +4 -2
  10. data/app/components/lookbook/icon/component.rb +0 -16
  11. data/app/components/lookbook/nav/entity/component.html.erb +3 -0
  12. data/app/components/lookbook/nav/item/component.js +8 -10
  13. data/app/components/lookbook/params/editor/component.rb +1 -1
  14. data/app/components/lookbook/params/field/component.rb +1 -1
  15. data/app/components/lookbook/tab_panels/component.rb +1 -1
  16. data/app/controllers/lookbook/previews_controller.rb +11 -7
  17. data/app/helpers/lookbook/application_helper.rb +10 -0
  18. data/app/views/layouts/lookbook/application.html.erb +98 -87
  19. data/app/views/layouts/lookbook/embed.html.erb +29 -17
  20. data/app/views/layouts/lookbook/skeleton.html.erb +2 -0
  21. data/app/views/lookbook/inspector/panels/_notes.html.erb +1 -1
  22. data/app/views/lookbook/previews/preview.html.erb +5 -1
  23. data/assets/js/app.js +7 -4
  24. data/assets/js/helpers/request.js +2 -2
  25. data/config/app.yml +3 -1
  26. data/lib/lookbook/engine.rb +72 -22
  27. data/lib/lookbook/preview_controller_actions.rb +7 -2
  28. data/lib/lookbook/preview_parser.rb +2 -4
  29. data/lib/lookbook/reloaders.rb +6 -2
  30. data/lib/lookbook/stores/config_store.rb +4 -0
  31. data/lib/lookbook/support/errors/config_error.rb +1 -1
  32. data/lib/lookbook/support/errors/parser_error.rb +1 -1
  33. data/lib/lookbook/support/errors/preview_template_error.rb +1 -1
  34. data/lib/lookbook/support/errors/template_error.rb +1 -1
  35. data/lib/lookbook/support/store.rb +1 -1
  36. data/lib/lookbook/support/utils/utils.rb +1 -1
  37. data/lib/lookbook/tags/param_tag.rb +4 -1
  38. data/lib/lookbook/tags/yard_tag.rb +1 -1
  39. data/lib/lookbook/version.rb +1 -1
  40. data/public/lookbook-assets/css/lookbook.css +70 -42
  41. data/public/lookbook-assets/css/lookbook.css.map +1 -1
  42. data/public/lookbook-assets/css/themes/blue.css +0 -1
  43. data/public/lookbook-assets/css/themes/green.css +0 -1
  44. data/public/lookbook-assets/css/themes/indigo.css +0 -1
  45. data/public/lookbook-assets/css/themes/rose.css +0 -1
  46. data/public/lookbook-assets/css/themes/zinc.css +0 -1
  47. data/public/lookbook-assets/img/lucide-sprite.svg +1 -1
  48. data/public/lookbook-assets/js/iframe.js +193 -193
  49. data/public/lookbook-assets/js/index.js +823 -813
  50. data/public/lookbook-assets/js/index.js.map +1 -1
  51. data/public/lookbook-assets/js/lookbook-core.js +0 -37
  52. data/public/lookbook-assets/js/lookbook.js +252 -289
  53. metadata +5 -386
  54. data/assets/icons/activity-square.svg +0 -1
  55. data/assets/icons/ampersand.svg +0 -1
  56. data/assets/icons/ampersands.svg +0 -1
  57. data/assets/icons/antenna.svg +0 -1
  58. data/assets/icons/app-window.svg +0 -1
  59. data/assets/icons/archive-x.svg +0 -1
  60. data/assets/icons/area-chart.svg +0 -1
  61. data/assets/icons/arrow-big-down-dash.svg +0 -1
  62. data/assets/icons/arrow-big-left-dash.svg +0 -1
  63. data/assets/icons/arrow-big-right-dash.svg +0 -1
  64. data/assets/icons/arrow-big-up-dash.svg +0 -1
  65. data/assets/icons/arrow-down-0-1.svg +0 -1
  66. data/assets/icons/arrow-down-1-0.svg +0 -1
  67. data/assets/icons/arrow-down-a-z.svg +0 -1
  68. data/assets/icons/arrow-down-from-line.svg +0 -1
  69. data/assets/icons/arrow-down-left-from-circle.svg +0 -1
  70. data/assets/icons/arrow-down-left-square.svg +0 -1
  71. data/assets/icons/arrow-down-narrow-wide.svg +0 -1
  72. data/assets/icons/arrow-down-right-from-circle.svg +0 -1
  73. data/assets/icons/arrow-down-right-square.svg +0 -1
  74. data/assets/icons/arrow-down-square.svg +0 -1
  75. data/assets/icons/arrow-down-to-dot.svg +0 -1
  76. data/assets/icons/arrow-down-to-line.svg +0 -1
  77. data/assets/icons/arrow-down-up.svg +0 -1
  78. data/assets/icons/arrow-down-wide-narrow.svg +0 -1
  79. data/assets/icons/arrow-down-z-a.svg +0 -1
  80. data/assets/icons/arrow-left-from-line.svg +0 -1
  81. data/assets/icons/arrow-left-square.svg +0 -1
  82. data/assets/icons/arrow-left-to-line.svg +0 -1
  83. data/assets/icons/arrow-right-from-line.svg +0 -1
  84. data/assets/icons/arrow-right-left.svg +0 -1
  85. data/assets/icons/arrow-right-square.svg +0 -1
  86. data/assets/icons/arrow-right-to-line.svg +0 -1
  87. data/assets/icons/arrow-up-0-1.svg +0 -1
  88. data/assets/icons/arrow-up-1-0.svg +0 -1
  89. data/assets/icons/arrow-up-a-z.svg +0 -1
  90. data/assets/icons/arrow-up-from-dot.svg +0 -1
  91. data/assets/icons/arrow-up-from-line.svg +0 -1
  92. data/assets/icons/arrow-up-left-from-circle.svg +0 -1
  93. data/assets/icons/arrow-up-left-square.svg +0 -1
  94. data/assets/icons/arrow-up-narrow-wide.svg +0 -1
  95. data/assets/icons/arrow-up-right-from-circle.svg +0 -1
  96. data/assets/icons/arrow-up-right-square.svg +0 -1
  97. data/assets/icons/arrow-up-square.svg +0 -1
  98. data/assets/icons/arrow-up-to-line.svg +0 -1
  99. data/assets/icons/arrow-up-wide-narrow.svg +0 -1
  100. data/assets/icons/arrow-up-z-a.svg +0 -1
  101. data/assets/icons/arrows-up-from-line.svg +0 -1
  102. data/assets/icons/atom.svg +0 -1
  103. data/assets/icons/badge-alert.svg +0 -1
  104. data/assets/icons/badge-cent.svg +0 -1
  105. data/assets/icons/badge-check.svg +0 -1
  106. data/assets/icons/badge-dollar-sign.svg +0 -1
  107. data/assets/icons/badge-euro.svg +0 -1
  108. data/assets/icons/badge-help.svg +0 -1
  109. data/assets/icons/badge-indian-rupee.svg +0 -1
  110. data/assets/icons/badge-info.svg +0 -1
  111. data/assets/icons/badge-japanese-yen.svg +0 -1
  112. data/assets/icons/badge-minus.svg +0 -1
  113. data/assets/icons/badge-percent.svg +0 -1
  114. data/assets/icons/badge-plus.svg +0 -1
  115. data/assets/icons/badge-pound-sterling.svg +0 -1
  116. data/assets/icons/badge-russian-ruble.svg +0 -1
  117. data/assets/icons/badge-swiss-franc.svg +0 -1
  118. data/assets/icons/badge-x.svg +0 -1
  119. data/assets/icons/badge.svg +0 -1
  120. data/assets/icons/ban.svg +0 -1
  121. data/assets/icons/bar-chart-big.svg +0 -1
  122. data/assets/icons/bar-chart-horizontal-big.svg +0 -1
  123. data/assets/icons/bell-dot.svg +0 -1
  124. data/assets/icons/biohazard.svg +0 -1
  125. data/assets/icons/blocks.svg +0 -1
  126. data/assets/icons/book-copy.svg +0 -1
  127. data/assets/icons/book-down.svg +0 -1
  128. data/assets/icons/book-key.svg +0 -1
  129. data/assets/icons/book-lock.svg +0 -1
  130. data/assets/icons/book-marked.svg +0 -1
  131. data/assets/icons/book-minus.svg +0 -1
  132. data/assets/icons/book-plus.svg +0 -1
  133. data/assets/icons/book-template.svg +0 -1
  134. data/assets/icons/book-up-2.svg +0 -1
  135. data/assets/icons/book-up.svg +0 -1
  136. data/assets/icons/book-x.svg +0 -1
  137. data/assets/icons/bookmark-check.svg +0 -1
  138. data/assets/icons/bookmark-x.svg +0 -1
  139. data/assets/icons/boom-box.svg +0 -1
  140. data/assets/icons/braces.svg +0 -1
  141. data/assets/icons/brackets.svg +0 -1
  142. data/assets/icons/brain-circuit.svg +0 -1
  143. data/assets/icons/brain-cog.svg +0 -1
  144. data/assets/icons/brain.svg +0 -1
  145. data/assets/icons/bring-to-front.svg +0 -1
  146. data/assets/icons/bug-off.svg +0 -1
  147. data/assets/icons/bug-play.svg +0 -1
  148. data/assets/icons/bus-front.svg +0 -1
  149. data/assets/icons/cable-car.svg +0 -1
  150. data/assets/icons/cable.svg +0 -1
  151. data/assets/icons/cake-slice.svg +0 -1
  152. data/assets/icons/candlestick-chart.svg +0 -1
  153. data/assets/icons/candy-cane.svg +0 -1
  154. data/assets/icons/car-front.svg +0 -1
  155. data/assets/icons/car-taxi-front.svg +0 -1
  156. data/assets/icons/case-lower.svg +0 -1
  157. data/assets/icons/case-sensitive.svg +0 -1
  158. data/assets/icons/case-upper.svg +0 -1
  159. data/assets/icons/cassette-tape.svg +0 -1
  160. data/assets/icons/castle.svg +0 -1
  161. data/assets/icons/chevron-down-circle.svg +0 -1
  162. data/assets/icons/chevron-down-square.svg +0 -1
  163. data/assets/icons/chevron-left-circle.svg +0 -1
  164. data/assets/icons/chevron-left-square.svg +0 -1
  165. data/assets/icons/chevron-right-circle.svg +0 -1
  166. data/assets/icons/chevron-right-square.svg +0 -1
  167. data/assets/icons/chevron-up-circle.svg +0 -1
  168. data/assets/icons/chevron-up-square.svg +0 -1
  169. data/assets/icons/church.svg +0 -1
  170. data/assets/icons/circle-dashed.svg +0 -1
  171. data/assets/icons/circle-dollar-sign.svg +0 -1
  172. data/assets/icons/circle-dot-dashed.svg +0 -1
  173. data/assets/icons/circle-equal.svg +0 -1
  174. data/assets/icons/circle-off.svg +0 -1
  175. data/assets/icons/circle-slash-2.svg +0 -1
  176. data/assets/icons/circle-slash.svg +0 -1
  177. data/assets/icons/circuit-board.svg +0 -1
  178. data/assets/icons/clipboard-paste.svg +0 -1
  179. data/assets/icons/club.svg +0 -1
  180. data/assets/icons/combine.svg +0 -1
  181. data/assets/icons/computer.svg +0 -1
  182. data/assets/icons/contact-2.svg +0 -1
  183. data/assets/icons/container.svg +0 -1
  184. data/assets/icons/copy-check.svg +0 -1
  185. data/assets/icons/copy-minus.svg +0 -1
  186. data/assets/icons/copy-plus.svg +0 -1
  187. data/assets/icons/copy-slash.svg +0 -1
  188. data/assets/icons/copy-x.svg +0 -1
  189. data/assets/icons/database-zap.svg +0 -1
  190. data/assets/icons/dessert.svg +0 -1
  191. data/assets/icons/disc-2.svg +0 -1
  192. data/assets/icons/disc-3.svg +0 -1
  193. data/assets/icons/donut.svg +0 -1
  194. data/assets/icons/door-closed.svg +0 -1
  195. data/assets/icons/door-open.svg +0 -1
  196. data/assets/icons/dot.svg +0 -1
  197. data/assets/icons/drama.svg +0 -1
  198. data/assets/icons/ferris-wheel.svg +0 -1
  199. data/assets/icons/file-code-2.svg +0 -1
  200. data/assets/icons/file-stack.svg +0 -1
  201. data/assets/icons/fish-symbol.svg +0 -1
  202. data/assets/icons/fold-horizontal.svg +0 -1
  203. data/assets/icons/fold-vertical.svg +0 -1
  204. data/assets/icons/folder-dot.svg +0 -1
  205. data/assets/icons/folder-git-2.svg +0 -1
  206. data/assets/icons/folder-git.svg +0 -1
  207. data/assets/icons/folder-kanban.svg +0 -1
  208. data/assets/icons/folder-open-dot.svg +0 -1
  209. data/assets/icons/folder-root.svg +0 -1
  210. data/assets/icons/folder-sync.svg +0 -1
  211. data/assets/icons/gallery-horizontal-end.svg +0 -1
  212. data/assets/icons/gallery-horizontal.svg +0 -1
  213. data/assets/icons/gallery-thumbnails.svg +0 -1
  214. data/assets/icons/gallery-vertical-end.svg +0 -1
  215. data/assets/icons/gallery-vertical.svg +0 -1
  216. data/assets/icons/gantt-chart-square.svg +0 -1
  217. data/assets/icons/gantt-chart.svg +0 -1
  218. data/assets/icons/gauge-circle.svg +0 -1
  219. data/assets/icons/goal.svg +0 -1
  220. data/assets/icons/grid-2x2.svg +0 -1
  221. data/assets/icons/grid-3x3.svg +0 -1
  222. data/assets/icons/group.svg +0 -1
  223. data/assets/icons/hard-drive-download.svg +0 -1
  224. data/assets/icons/hard-drive-upload.svg +0 -1
  225. data/assets/icons/hdmi-port.svg +0 -1
  226. data/assets/icons/hotel.svg +0 -1
  227. data/assets/icons/iteration-ccw.svg +0 -1
  228. data/assets/icons/iteration-cw.svg +0 -1
  229. data/assets/icons/kanban-square-dashed.svg +0 -1
  230. data/assets/icons/kanban-square.svg +0 -1
  231. data/assets/icons/kanban.svg +0 -1
  232. data/assets/icons/key-round.svg +0 -1
  233. data/assets/icons/key-square.svg +0 -1
  234. data/assets/icons/layout-panel-left.svg +0 -1
  235. data/assets/icons/layout-panel-top.svg +0 -1
  236. data/assets/icons/leafy-green.svg +0 -1
  237. data/assets/icons/ligature.svg +0 -1
  238. data/assets/icons/list-filter.svg +0 -1
  239. data/assets/icons/list-restart.svg +0 -1
  240. data/assets/icons/list-todo.svg +0 -1
  241. data/assets/icons/list-tree.svg +0 -1
  242. data/assets/icons/lollipop.svg +0 -1
  243. data/assets/icons/m-square.svg +0 -1
  244. data/assets/icons/mailbox.svg +0 -1
  245. data/assets/icons/memory-stick.svg +0 -1
  246. data/assets/icons/menu-square.svg +0 -1
  247. data/assets/icons/merge.svg +0 -1
  248. data/assets/icons/message-square-dashed.svg +0 -1
  249. data/assets/icons/message-square-plus.svg +0 -1
  250. data/assets/icons/messages-square.svg +0 -1
  251. data/assets/icons/monitor-check.svg +0 -1
  252. data/assets/icons/monitor-dot.svg +0 -1
  253. data/assets/icons/monitor-down.svg +0 -1
  254. data/assets/icons/monitor-pause.svg +0 -1
  255. data/assets/icons/monitor-play.svg +0 -1
  256. data/assets/icons/monitor-stop.svg +0 -1
  257. data/assets/icons/monitor-up.svg +0 -1
  258. data/assets/icons/monitor-x.svg +0 -1
  259. data/assets/icons/moon-star.svg +0 -1
  260. data/assets/icons/mouse-pointer-square-dashed.svg +0 -1
  261. data/assets/icons/mouse-pointer-square.svg +0 -1
  262. data/assets/icons/move-down-left.svg +0 -1
  263. data/assets/icons/move-down-right.svg +0 -1
  264. data/assets/icons/move-down.svg +0 -1
  265. data/assets/icons/move-left.svg +0 -1
  266. data/assets/icons/move-right.svg +0 -1
  267. data/assets/icons/move-up-left.svg +0 -1
  268. data/assets/icons/move-up-right.svg +0 -1
  269. data/assets/icons/move-up.svg +0 -1
  270. data/assets/icons/orbit.svg +0 -1
  271. data/assets/icons/panel-bottom-close.svg +0 -1
  272. data/assets/icons/panel-bottom-inactive.svg +0 -1
  273. data/assets/icons/panel-bottom-open.svg +0 -1
  274. data/assets/icons/panel-bottom.svg +0 -1
  275. data/assets/icons/panel-left-close.svg +0 -1
  276. data/assets/icons/panel-left-inactive.svg +0 -1
  277. data/assets/icons/panel-left-open.svg +0 -1
  278. data/assets/icons/panel-left.svg +0 -1
  279. data/assets/icons/panel-right-close.svg +0 -1
  280. data/assets/icons/panel-right-inactive.svg +0 -1
  281. data/assets/icons/panel-right-open.svg +0 -1
  282. data/assets/icons/panel-right.svg +0 -1
  283. data/assets/icons/panel-top-close.svg +0 -1
  284. data/assets/icons/panel-top-inactive.svg +0 -1
  285. data/assets/icons/panel-top-open.svg +0 -1
  286. data/assets/icons/panel-top.svg +0 -1
  287. data/assets/icons/parentheses.svg +0 -1
  288. data/assets/icons/parking-circle-off.svg +0 -1
  289. data/assets/icons/parking-circle.svg +0 -1
  290. data/assets/icons/parking-meter.svg +0 -1
  291. data/assets/icons/parking-square-off.svg +0 -1
  292. data/assets/icons/parking-square.svg +0 -1
  293. data/assets/icons/paw-print.svg +0 -1
  294. data/assets/icons/pc-case.svg +0 -1
  295. data/assets/icons/pen-line.svg +0 -1
  296. data/assets/icons/pen-square.svg +0 -1
  297. data/assets/icons/pen.svg +0 -1
  298. data/assets/icons/pencil-line.svg +0 -1
  299. data/assets/icons/pencil-ruler.svg +0 -1
  300. data/assets/icons/percent-circle.svg +0 -1
  301. data/assets/icons/percent-diamond.svg +0 -1
  302. data/assets/icons/percent-square.svg +0 -1
  303. data/assets/icons/pi-square.svg +0 -1
  304. data/assets/icons/pi.svg +0 -1
  305. data/assets/icons/pilcrow-square.svg +0 -1
  306. data/assets/icons/plane-landing.svg +0 -1
  307. data/assets/icons/plane-takeoff.svg +0 -1
  308. data/assets/icons/play-square.svg +0 -1
  309. data/assets/icons/plug-zap-2.svg +0 -1
  310. data/assets/icons/pocket-knife.svg +0 -1
  311. data/assets/icons/popcorn.svg +0 -1
  312. data/assets/icons/popsicle.svg +0 -1
  313. data/assets/icons/presentation.svg +0 -1
  314. data/assets/icons/projector.svg +0 -1
  315. data/assets/icons/rabbit.svg +0 -1
  316. data/assets/icons/radar.svg +0 -1
  317. data/assets/icons/radiation.svg +0 -1
  318. data/assets/icons/radio-tower.svg +0 -1
  319. data/assets/icons/rail-symbol.svg +0 -1
  320. data/assets/icons/rainbow.svg +0 -1
  321. data/assets/icons/rat.svg +0 -1
  322. data/assets/icons/ratio.svg +0 -1
  323. data/assets/icons/receipt.svg +0 -1
  324. data/assets/icons/redo-dot.svg +0 -1
  325. data/assets/icons/refresh-ccw-dot.svg +0 -1
  326. data/assets/icons/refresh-cw-off.svg +0 -1
  327. data/assets/icons/repeat-2.svg +0 -1
  328. data/assets/icons/replace-all.svg +0 -1
  329. data/assets/icons/replace.svg +0 -1
  330. data/assets/icons/roller-coaster.svg +0 -1
  331. data/assets/icons/rows.svg +0 -1
  332. data/assets/icons/satellite-dish.svg +0 -1
  333. data/assets/icons/satellite.svg +0 -1
  334. data/assets/icons/save-all.svg +0 -1
  335. data/assets/icons/scatter-chart.svg +0 -1
  336. data/assets/icons/school-2.svg +0 -1
  337. data/assets/icons/school.svg +0 -1
  338. data/assets/icons/scissors-line-dashed.svg +0 -1
  339. data/assets/icons/scissors-square-dashed-bottom.svg +0 -1
  340. data/assets/icons/scissors-square.svg +0 -1
  341. data/assets/icons/scroll-text.svg +0 -1
  342. data/assets/icons/search-check.svg +0 -1
  343. data/assets/icons/search-code.svg +0 -1
  344. data/assets/icons/search-slash.svg +0 -1
  345. data/assets/icons/search-x.svg +0 -1
  346. data/assets/icons/send-horizontal.svg +0 -1
  347. data/assets/icons/send-to-back.svg +0 -1
  348. data/assets/icons/shapes.svg +0 -1
  349. data/assets/icons/shell.svg +0 -1
  350. data/assets/icons/shield-ban.svg +0 -1
  351. data/assets/icons/shield-ellipsis.svg +0 -1
  352. data/assets/icons/shield-half.svg +0 -1
  353. data/assets/icons/shield-minus.svg +0 -1
  354. data/assets/icons/shield-plus.svg +0 -1
  355. data/assets/icons/shield-question.svg +0 -1
  356. data/assets/icons/shield-x.svg +0 -1
  357. data/assets/icons/ship-wheel.svg +0 -1
  358. data/assets/icons/shopping-basket.svg +0 -1
  359. data/assets/icons/sigma-square.svg +0 -1
  360. data/assets/icons/snail.svg +0 -1
  361. data/assets/icons/space.svg +0 -1
  362. data/assets/icons/spade.svg +0 -1
  363. data/assets/icons/sparkle.svg +0 -1
  364. data/assets/icons/sparkles.svg +0 -1
  365. data/assets/icons/speech.svg +0 -1
  366. data/assets/icons/spell-check-2.svg +0 -1
  367. data/assets/icons/spell-check.svg +0 -1
  368. data/assets/icons/split.svg +0 -1
  369. data/assets/icons/spray-can.svg +0 -1
  370. data/assets/icons/square-asterisk.svg +0 -1
  371. data/assets/icons/square-code.svg +0 -1
  372. data/assets/icons/square-dashed-bottom-code.svg +0 -1
  373. data/assets/icons/square-dashed-bottom.svg +0 -1
  374. data/assets/icons/square-dot.svg +0 -1
  375. data/assets/icons/square-equal.svg +0 -1
  376. data/assets/icons/square-slash.svg +0 -1
  377. data/assets/icons/square-stack.svg +0 -1
  378. data/assets/icons/squirrel.svg +0 -1
  379. data/assets/icons/step-back.svg +0 -1
  380. data/assets/icons/step-forward.svg +0 -1
  381. data/assets/icons/store.svg +0 -1
  382. data/assets/icons/table-properties.svg +0 -1
  383. data/assets/icons/tablet-smartphone.svg +0 -1
  384. data/assets/icons/tally-1.svg +0 -1
  385. data/assets/icons/tally-2.svg +0 -1
  386. data/assets/icons/tally-3.svg +0 -1
  387. data/assets/icons/tally-4.svg +0 -1
  388. data/assets/icons/tally-5.svg +0 -1
  389. data/assets/icons/test-tube-2.svg +0 -1
  390. data/assets/icons/test-tube.svg +0 -1
  391. data/assets/icons/test-tubes.svg +0 -1
  392. data/assets/icons/text-quote.svg +0 -1
  393. data/assets/icons/text-select.svg +0 -1
  394. data/assets/icons/text.svg +0 -1
  395. data/assets/icons/theater.svg +0 -1
  396. data/assets/icons/touchpad-off.svg +0 -1
  397. data/assets/icons/touchpad.svg +0 -1
  398. data/assets/icons/tractor.svg +0 -1
  399. data/assets/icons/traffic-cone.svg +0 -1
  400. data/assets/icons/train-front-tunnel.svg +0 -1
  401. data/assets/icons/train-front.svg +0 -1
  402. data/assets/icons/train-track.svg +0 -1
  403. data/assets/icons/tram-front.svg +0 -1
  404. data/assets/icons/triangle-right.svg +0 -1
  405. data/assets/icons/turtle.svg +0 -1
  406. data/assets/icons/undo-dot.svg +0 -1
  407. data/assets/icons/unfold-horizontal.svg +0 -1
  408. data/assets/icons/unfold-vertical.svg +0 -1
  409. data/assets/icons/ungroup.svg +0 -1
  410. data/assets/icons/unplug.svg +0 -1
  411. data/assets/icons/user-2.svg +0 -1
  412. data/assets/icons/user-check-2.svg +0 -1
  413. data/assets/icons/user-circle-2.svg +0 -1
  414. data/assets/icons/user-circle.svg +0 -1
  415. data/assets/icons/user-cog-2.svg +0 -1
  416. data/assets/icons/user-minus-2.svg +0 -1
  417. data/assets/icons/user-plus-2.svg +0 -1
  418. data/assets/icons/user-square-2.svg +0 -1
  419. data/assets/icons/user-square.svg +0 -1
  420. data/assets/icons/user-x-2.svg +0 -1
  421. data/assets/icons/users-2.svg +0 -1
  422. data/assets/icons/variable.svg +0 -1
  423. data/assets/icons/videotape.svg +0 -1
  424. data/assets/icons/wallet-2.svg +0 -1
  425. data/assets/icons/wallet-cards.svg +0 -1
  426. data/assets/icons/wallpaper.svg +0 -1
  427. data/assets/icons/warehouse.svg +0 -1
  428. data/assets/icons/whole-word.svg +0 -1
  429. data/assets/icons/workflow.svg +0 -1
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");
@@ -1,5 +1,5 @@
1
- async function fetchHTML(url, selector) {
2
- const response = await fetch(url || window.document.location);
1
+ async function fetchHTML(url, selector, options = {}) {
2
+ const response = await fetch(url || window.document.location, options);
3
3
  const html = await response.text();
4
4
  const doc = new DOMParser().parseFromString(html, "text/html");
5
5
  return {
data/config/app.yml CHANGED
@@ -25,6 +25,7 @@ shared:
25
25
  preview_type_default: view_component
26
26
  preview_sort_scenarios: false
27
27
  preview_disable_error_handling: false
28
+ preview_single_pass_rendering: false
28
29
 
29
30
  page_collection_label: "Pages"
30
31
  page_nav_filter: false
@@ -50,6 +51,7 @@ shared:
50
51
  component_paths: [app/views, app/components]
51
52
 
52
53
  reload_on_change: ~
54
+ lazy_load_previews_and_pages: false
53
55
  live_updates: false
54
56
  listen_paths: []
55
57
  listen_extensions: [rb, html.*]
@@ -67,7 +69,7 @@ shared:
67
69
  links:
68
70
  docs: https://v2.lookbook.build
69
71
  demo: https://v2-demo.lookbook.build
70
- repo: https://github.com/ViewComponent/lookbook/tree/v2
72
+ repo: https://github.com/lookbook-hq/lookbook/tree/v2
71
73
 
72
74
  development:
73
75
  debug_menu: true
@@ -14,11 +14,11 @@ module Lookbook
14
14
  )
15
15
  end
16
16
 
17
- initializer "lookbook.set_autoload_paths" do
17
+ initializer "lookbook.set_autoload_paths", before: :set_autoload_paths do |app|
18
18
  if opts.autoload_previews && opts.preview_paths.any?
19
- paths_to_add = opts.preview_paths - ActiveSupport::Dependencies.autoload_paths
19
+ paths_to_add = opts.preview_paths - app.config.autoload_paths
20
20
  filtered_paths = paths_to_add.filter { |p| !Engine.component_paths.include?(p) }
21
- ActiveSupport::Dependencies.autoload_paths.concat(filtered_paths) if filtered_paths.any?
21
+ app.config.autoload_paths.concat(filtered_paths) if filtered_paths.any?
22
22
  end
23
23
  end
24
24
 
@@ -37,26 +37,50 @@ module Lookbook
37
37
  if opts.using_view_component
38
38
  vc_config = Engine.host_config.view_component
39
39
 
40
- opts.preview_paths += vc_config.preview_paths
40
+ if vc_config.key?(:previews)
41
+ # New config style (ViewComponent >= 4.0)
42
+ opts.preview_paths += vc_config.previews.paths
41
43
 
42
- # sync preview controller and layout setting between Lookbook and ViewComponent
43
- if opts.preview_controller == "Lookbook::PreviewController" ||
44
- vc_config.preview_controller != ViewComponent::Config.defaults.preview_controller
45
- opts.preview_controller = vc_config.preview_controller
46
- else
47
- vc_config.preview_controller = opts.preview_controller
48
- end
44
+ if opts.preview_controller == "Lookbook::PreviewController" ||
45
+ vc_config.previews.controller != "ViewComponentsController"
46
+ opts.preview_controller = vc_config.previews.controller
47
+ else
48
+ vc_config.previews.controller = opts.preview_controller
49
+ end
49
50
 
50
- if opts.preview_layout.nil? || vc_config.default_preview_layout.present?
51
- opts.preview_layout = vc_config.default_preview_layout
52
- else
53
- vc_config.default_preview_layout = opts.preview_layout
54
- end
51
+ if opts.preview_layout.nil? || vc_config.previews.default_layout.present?
52
+ opts.preview_layout = vc_config.previews.default_layout
53
+ else
54
+ vc_config.previews.default_layout = opts.preview_layout
55
+ end
55
56
 
56
- vc_config.show_previews = true
57
+ vc_config.previews.enabled = true
57
58
 
58
- if vc_config.view_component_path.present?
59
- opts.component_paths << vc_config.view_component_path
59
+ if vc_config.generate.path.present?
60
+ opts.component_paths << vc_config.generate.path
61
+ end
62
+ else
63
+ # Legacy config style (ViewComponent < 4.0)
64
+ opts.preview_paths += vc_config.preview_paths
65
+
66
+ if opts.preview_controller == "Lookbook::PreviewController" ||
67
+ vc_config.preview_controller != ViewComponent::Config.defaults.preview_controller
68
+ opts.preview_controller = vc_config.preview_controller
69
+ else
70
+ vc_config.preview_controller = opts.preview_controller
71
+ end
72
+
73
+ if opts.preview_layout.nil? || vc_config.default_preview_layout.present?
74
+ opts.preview_layout = vc_config.default_preview_layout
75
+ else
76
+ vc_config.default_preview_layout = opts.preview_layout
77
+ end
78
+
79
+ vc_config.show_previews = true
80
+
81
+ if vc_config.view_component_path.present?
82
+ opts.component_paths << vc_config.view_component_path
83
+ end
60
84
  end
61
85
 
62
86
  ViewComponent::Preview.extend(Lookbook::PreviewAfterRender)
@@ -71,10 +95,12 @@ module Lookbook
71
95
  if Engine.reloading?
72
96
  reloaders.add(:previews, Engine.preview_watch_paths, opts.listen_extensions, &Engine.method(:load_previews))
73
97
  reloaders.add(:pages, Engine.page_watch_paths, opts.page_extensions, &Engine.method(:load_pages))
74
- reloaders.execute
98
+ reloaders.execute unless opts.lazy_load_previews_and_pages
75
99
  else
76
- Engine.load_previews
77
- Engine.load_pages
100
+ unless opts.lazy_load_previews_and_pages
101
+ Engine.load_previews
102
+ Engine.load_pages
103
+ end
78
104
  end
79
105
 
80
106
  Engine.run_hooks(:after_initialize)
@@ -196,10 +222,34 @@ module Lookbook
196
222
 
197
223
  def pages
198
224
  @_pages ||= PageCollection.new
225
+
226
+ if opts.lazy_load_previews_and_pages && !@_loaded_pages
227
+ @_loaded_pages = true
228
+
229
+ if reloading?
230
+ reloaders.execute(:pages)
231
+ else
232
+ load_pages
233
+ end
234
+ end
235
+
236
+ @_pages
199
237
  end
200
238
 
201
239
  def previews
202
240
  @_previews ||= PreviewCollection.new
241
+
242
+ if opts.lazy_load_previews_and_pages && !@_loaded_previews
243
+ @_loaded_previews = true
244
+
245
+ if reloading?
246
+ reloaders.execute(:previews)
247
+ else
248
+ load_previews
249
+ end
250
+ end
251
+
252
+ @_previews
203
253
  end
204
254
 
205
255
  def preview_controller
@@ -16,8 +16,13 @@ module Lookbook
16
16
  @render_args = @preview.render_args(@scenario_name, params: params.permit!)
17
17
  template = @render_args[:template]
18
18
  locals = @render_args[:locals]
19
- opts = {}
20
- opts[:layout] = nil
19
+
20
+ opts = if Lookbook.config.preview_single_pass_rendering && !scenario.group.present?
21
+ determine_layout(preview.layout)
22
+ else
23
+ {layout: nil}
24
+ end
25
+
21
26
  opts[:assigns] = @render_args[:assigns] || {}
22
27
  opts[:locals] = locals if locals.present?
23
28
 
@@ -6,15 +6,14 @@ module Lookbook
6
6
  @paths = paths
7
7
  @after_parse_callbacks = []
8
8
  @after_parse_once_callbacks = []
9
- @parsing = false
9
+ @parsing = Mutex.new
10
10
 
11
11
  define_tags(tags)
12
12
  YARD::Parser::SourceParser.after_parse_list { run_callbacks }
13
13
  end
14
14
 
15
15
  def parse(files = nil, &block)
16
- unless @parsing
17
- @parsing = true
16
+ @parsing.synchronize do
18
17
  @after_parse_once_callbacks << block if block
19
18
  files_list = files ? files.select { |file| file.to_s.end_with?(".rb") } : paths
20
19
 
@@ -43,7 +42,6 @@ module Lookbook
43
42
  def run_callbacks
44
43
  callbacks.each { |cb| cb.call(YARD::Registry) }
45
44
  @after_parse_once_callbacks = []
46
- @parsing = false
47
45
  end
48
46
 
49
47
  def define_tags(tags = nil)
@@ -16,10 +16,14 @@ module Lookbook
16
16
  Rails.application.reloaders << reloader
17
17
  Rails.application.reloader.to_run { reloader.execute_if_updated }
18
18
  end
19
+
20
+ reloader
19
21
  end
20
22
 
21
- def execute
22
- reloaders.each { |reloader| reloader.execute }
23
+ def execute(name = nil)
24
+ reloaders.each do |reloader|
25
+ reloader.execute if name.nil? || name == reloader.name
26
+ end
23
27
  end
24
28
 
25
29
  def register_changes(changes)
@@ -63,6 +63,10 @@ module Lookbook
63
63
  store[:preview_disable_error_handling] = value
64
64
  end
65
65
 
66
+ def preview_single_pass_rendering=(value)
67
+ store[:preview_single_pass_rendering] = value
68
+ end
69
+
66
70
  def ui_theme=(name)
67
71
  name = name.to_s
68
72
  if Theme.valid_theme?(name)
@@ -1,7 +1,7 @@
1
1
  module Lookbook
2
2
  class ConfigError < Error
3
3
  def initialize(msg = nil, scope: "config", **kwargs)
4
- super(msg, scope: scope, **kwargs)
4
+ super
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Lookbook
2
2
  class ParserError < Error
3
3
  def initialize(msg = nil, scope: "parser", **kwargs)
4
- super(msg, scope: scope, **kwargs)
4
+ super
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Lookbook
2
2
  class PreviewTemplateError < Error
3
3
  def initialize(msg = nil, scope: "preview", **kwargs)
4
- super(msg, scope: scope, **kwargs)
4
+ super
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  module Lookbook
2
2
  class TemplateError < Error
3
3
  def initialize(msg = nil, scope: "template", **kwargs)
4
- super(msg, scope: scope, **kwargs)
4
+ super
5
5
  end
6
6
  end
7
7
  end
@@ -27,7 +27,7 @@ module Lookbook
27
27
  if name.to_s.end_with?("=")
28
28
  args[0] = normalize_value(args[0])
29
29
  end
30
- super(name, *args)
30
+ super
31
31
  end
32
32
 
33
33
  def respond_to_missing?(name, include_private)
@@ -12,7 +12,7 @@ module Lookbook
12
12
  end
13
13
 
14
14
  def name(str)
15
- str.to_s.parameterize.tr("-", "_")
15
+ str.to_s.dup.force_encoding("UTF-8").parameterize.tr("-", "_")
16
16
  end
17
17
 
18
18
  def symbolize_name(str)
@@ -28,7 +28,10 @@ module Lookbook
28
28
  def value_default
29
29
  default_value_parts = object.parameters.find { |parts| parts[0].chomp(":") == name }
30
30
  if default_value_parts
31
- host_class_instance.instance_eval(default_value_parts[1])
31
+ # fix issue with YARD argument parser not splitting args correctly (leaving a trailing comma or bracket)
32
+ # when one or more of the argument values is a negative number.
33
+ cleaned_value = default_value_parts[1].start_with?("-") ? default_value_parts[1].sub(/[,\)]$/, "") : default_value_parts[1]
34
+ host_class_instance.instance_eval(cleaned_value)
32
35
  else
33
36
  raise ParserError.new "Unknown method parameter '#{name}'"
34
37
  end
@@ -5,7 +5,7 @@ module Lookbook
5
5
  tag_name = self.class.name.demodulize.underscore.chomp("_tag")
6
6
  super(tag_name, args.first, nil, @name)
7
7
  else
8
- super(*args)
8
+ super
9
9
  end
10
10
  end
11
11
 
@@ -1,3 +1,3 @@
1
1
  module Lookbook
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.12"
3
3
  end