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.
- checksums.yaml +4 -4
- data/README.md +11 -11
- data/app/components/lookbook/base_component.rb +1 -0
- data/app/components/lookbook/button/component.html.erb +1 -1
- data/app/components/lookbook/button/component.js +10 -3
- data/app/components/lookbook/display_options/editor/component.html.erb +1 -1
- data/app/components/lookbook/filter/component.html.erb +2 -2
- data/app/components/lookbook/header/component.html.erb +1 -1
- data/app/components/lookbook/icon/component.html.erb +4 -2
- data/app/components/lookbook/icon/component.rb +0 -16
- data/app/components/lookbook/nav/entity/component.html.erb +3 -0
- data/app/components/lookbook/nav/item/component.js +8 -10
- data/app/components/lookbook/params/editor/component.rb +1 -1
- data/app/components/lookbook/params/field/component.rb +1 -1
- data/app/components/lookbook/tab_panels/component.rb +1 -1
- data/app/controllers/lookbook/previews_controller.rb +11 -7
- data/app/helpers/lookbook/application_helper.rb +10 -0
- data/app/views/layouts/lookbook/application.html.erb +98 -87
- data/app/views/layouts/lookbook/embed.html.erb +29 -17
- data/app/views/layouts/lookbook/skeleton.html.erb +2 -0
- data/app/views/lookbook/inspector/panels/_notes.html.erb +1 -1
- data/app/views/lookbook/previews/preview.html.erb +5 -1
- data/assets/js/app.js +7 -4
- data/assets/js/helpers/request.js +2 -2
- data/config/app.yml +3 -1
- data/lib/lookbook/engine.rb +72 -22
- data/lib/lookbook/preview_controller_actions.rb +7 -2
- data/lib/lookbook/preview_parser.rb +2 -4
- data/lib/lookbook/reloaders.rb +6 -2
- data/lib/lookbook/stores/config_store.rb +4 -0
- data/lib/lookbook/support/errors/config_error.rb +1 -1
- data/lib/lookbook/support/errors/parser_error.rb +1 -1
- data/lib/lookbook/support/errors/preview_template_error.rb +1 -1
- data/lib/lookbook/support/errors/template_error.rb +1 -1
- data/lib/lookbook/support/store.rb +1 -1
- data/lib/lookbook/support/utils/utils.rb +1 -1
- data/lib/lookbook/tags/param_tag.rb +4 -1
- data/lib/lookbook/tags/yard_tag.rb +1 -1
- data/lib/lookbook/version.rb +1 -1
- data/public/lookbook-assets/css/lookbook.css +70 -42
- data/public/lookbook-assets/css/lookbook.css.map +1 -1
- data/public/lookbook-assets/css/themes/blue.css +0 -1
- data/public/lookbook-assets/css/themes/green.css +0 -1
- data/public/lookbook-assets/css/themes/indigo.css +0 -1
- data/public/lookbook-assets/css/themes/rose.css +0 -1
- data/public/lookbook-assets/css/themes/zinc.css +0 -1
- data/public/lookbook-assets/img/lucide-sprite.svg +1 -1
- data/public/lookbook-assets/js/iframe.js +193 -193
- data/public/lookbook-assets/js/index.js +823 -813
- data/public/lookbook-assets/js/index.js.map +1 -1
- data/public/lookbook-assets/js/lookbook-core.js +0 -37
- data/public/lookbook-assets/js/lookbook.js +252 -289
- metadata +5 -386
- data/assets/icons/activity-square.svg +0 -1
- data/assets/icons/ampersand.svg +0 -1
- data/assets/icons/ampersands.svg +0 -1
- data/assets/icons/antenna.svg +0 -1
- data/assets/icons/app-window.svg +0 -1
- data/assets/icons/archive-x.svg +0 -1
- data/assets/icons/area-chart.svg +0 -1
- data/assets/icons/arrow-big-down-dash.svg +0 -1
- data/assets/icons/arrow-big-left-dash.svg +0 -1
- data/assets/icons/arrow-big-right-dash.svg +0 -1
- data/assets/icons/arrow-big-up-dash.svg +0 -1
- data/assets/icons/arrow-down-0-1.svg +0 -1
- data/assets/icons/arrow-down-1-0.svg +0 -1
- data/assets/icons/arrow-down-a-z.svg +0 -1
- data/assets/icons/arrow-down-from-line.svg +0 -1
- data/assets/icons/arrow-down-left-from-circle.svg +0 -1
- data/assets/icons/arrow-down-left-square.svg +0 -1
- data/assets/icons/arrow-down-narrow-wide.svg +0 -1
- data/assets/icons/arrow-down-right-from-circle.svg +0 -1
- data/assets/icons/arrow-down-right-square.svg +0 -1
- data/assets/icons/arrow-down-square.svg +0 -1
- data/assets/icons/arrow-down-to-dot.svg +0 -1
- data/assets/icons/arrow-down-to-line.svg +0 -1
- data/assets/icons/arrow-down-up.svg +0 -1
- data/assets/icons/arrow-down-wide-narrow.svg +0 -1
- data/assets/icons/arrow-down-z-a.svg +0 -1
- data/assets/icons/arrow-left-from-line.svg +0 -1
- data/assets/icons/arrow-left-square.svg +0 -1
- data/assets/icons/arrow-left-to-line.svg +0 -1
- data/assets/icons/arrow-right-from-line.svg +0 -1
- data/assets/icons/arrow-right-left.svg +0 -1
- data/assets/icons/arrow-right-square.svg +0 -1
- data/assets/icons/arrow-right-to-line.svg +0 -1
- data/assets/icons/arrow-up-0-1.svg +0 -1
- data/assets/icons/arrow-up-1-0.svg +0 -1
- data/assets/icons/arrow-up-a-z.svg +0 -1
- data/assets/icons/arrow-up-from-dot.svg +0 -1
- data/assets/icons/arrow-up-from-line.svg +0 -1
- data/assets/icons/arrow-up-left-from-circle.svg +0 -1
- data/assets/icons/arrow-up-left-square.svg +0 -1
- data/assets/icons/arrow-up-narrow-wide.svg +0 -1
- data/assets/icons/arrow-up-right-from-circle.svg +0 -1
- data/assets/icons/arrow-up-right-square.svg +0 -1
- data/assets/icons/arrow-up-square.svg +0 -1
- data/assets/icons/arrow-up-to-line.svg +0 -1
- data/assets/icons/arrow-up-wide-narrow.svg +0 -1
- data/assets/icons/arrow-up-z-a.svg +0 -1
- data/assets/icons/arrows-up-from-line.svg +0 -1
- data/assets/icons/atom.svg +0 -1
- data/assets/icons/badge-alert.svg +0 -1
- data/assets/icons/badge-cent.svg +0 -1
- data/assets/icons/badge-check.svg +0 -1
- data/assets/icons/badge-dollar-sign.svg +0 -1
- data/assets/icons/badge-euro.svg +0 -1
- data/assets/icons/badge-help.svg +0 -1
- data/assets/icons/badge-indian-rupee.svg +0 -1
- data/assets/icons/badge-info.svg +0 -1
- data/assets/icons/badge-japanese-yen.svg +0 -1
- data/assets/icons/badge-minus.svg +0 -1
- data/assets/icons/badge-percent.svg +0 -1
- data/assets/icons/badge-plus.svg +0 -1
- data/assets/icons/badge-pound-sterling.svg +0 -1
- data/assets/icons/badge-russian-ruble.svg +0 -1
- data/assets/icons/badge-swiss-franc.svg +0 -1
- data/assets/icons/badge-x.svg +0 -1
- data/assets/icons/badge.svg +0 -1
- data/assets/icons/ban.svg +0 -1
- data/assets/icons/bar-chart-big.svg +0 -1
- data/assets/icons/bar-chart-horizontal-big.svg +0 -1
- data/assets/icons/bell-dot.svg +0 -1
- data/assets/icons/biohazard.svg +0 -1
- data/assets/icons/blocks.svg +0 -1
- data/assets/icons/book-copy.svg +0 -1
- data/assets/icons/book-down.svg +0 -1
- data/assets/icons/book-key.svg +0 -1
- data/assets/icons/book-lock.svg +0 -1
- data/assets/icons/book-marked.svg +0 -1
- data/assets/icons/book-minus.svg +0 -1
- data/assets/icons/book-plus.svg +0 -1
- data/assets/icons/book-template.svg +0 -1
- data/assets/icons/book-up-2.svg +0 -1
- data/assets/icons/book-up.svg +0 -1
- data/assets/icons/book-x.svg +0 -1
- data/assets/icons/bookmark-check.svg +0 -1
- data/assets/icons/bookmark-x.svg +0 -1
- data/assets/icons/boom-box.svg +0 -1
- data/assets/icons/braces.svg +0 -1
- data/assets/icons/brackets.svg +0 -1
- data/assets/icons/brain-circuit.svg +0 -1
- data/assets/icons/brain-cog.svg +0 -1
- data/assets/icons/brain.svg +0 -1
- data/assets/icons/bring-to-front.svg +0 -1
- data/assets/icons/bug-off.svg +0 -1
- data/assets/icons/bug-play.svg +0 -1
- data/assets/icons/bus-front.svg +0 -1
- data/assets/icons/cable-car.svg +0 -1
- data/assets/icons/cable.svg +0 -1
- data/assets/icons/cake-slice.svg +0 -1
- data/assets/icons/candlestick-chart.svg +0 -1
- data/assets/icons/candy-cane.svg +0 -1
- data/assets/icons/car-front.svg +0 -1
- data/assets/icons/car-taxi-front.svg +0 -1
- data/assets/icons/case-lower.svg +0 -1
- data/assets/icons/case-sensitive.svg +0 -1
- data/assets/icons/case-upper.svg +0 -1
- data/assets/icons/cassette-tape.svg +0 -1
- data/assets/icons/castle.svg +0 -1
- data/assets/icons/chevron-down-circle.svg +0 -1
- data/assets/icons/chevron-down-square.svg +0 -1
- data/assets/icons/chevron-left-circle.svg +0 -1
- data/assets/icons/chevron-left-square.svg +0 -1
- data/assets/icons/chevron-right-circle.svg +0 -1
- data/assets/icons/chevron-right-square.svg +0 -1
- data/assets/icons/chevron-up-circle.svg +0 -1
- data/assets/icons/chevron-up-square.svg +0 -1
- data/assets/icons/church.svg +0 -1
- data/assets/icons/circle-dashed.svg +0 -1
- data/assets/icons/circle-dollar-sign.svg +0 -1
- data/assets/icons/circle-dot-dashed.svg +0 -1
- data/assets/icons/circle-equal.svg +0 -1
- data/assets/icons/circle-off.svg +0 -1
- data/assets/icons/circle-slash-2.svg +0 -1
- data/assets/icons/circle-slash.svg +0 -1
- data/assets/icons/circuit-board.svg +0 -1
- data/assets/icons/clipboard-paste.svg +0 -1
- data/assets/icons/club.svg +0 -1
- data/assets/icons/combine.svg +0 -1
- data/assets/icons/computer.svg +0 -1
- data/assets/icons/contact-2.svg +0 -1
- data/assets/icons/container.svg +0 -1
- data/assets/icons/copy-check.svg +0 -1
- data/assets/icons/copy-minus.svg +0 -1
- data/assets/icons/copy-plus.svg +0 -1
- data/assets/icons/copy-slash.svg +0 -1
- data/assets/icons/copy-x.svg +0 -1
- data/assets/icons/database-zap.svg +0 -1
- data/assets/icons/dessert.svg +0 -1
- data/assets/icons/disc-2.svg +0 -1
- data/assets/icons/disc-3.svg +0 -1
- data/assets/icons/donut.svg +0 -1
- data/assets/icons/door-closed.svg +0 -1
- data/assets/icons/door-open.svg +0 -1
- data/assets/icons/dot.svg +0 -1
- data/assets/icons/drama.svg +0 -1
- data/assets/icons/ferris-wheel.svg +0 -1
- data/assets/icons/file-code-2.svg +0 -1
- data/assets/icons/file-stack.svg +0 -1
- data/assets/icons/fish-symbol.svg +0 -1
- data/assets/icons/fold-horizontal.svg +0 -1
- data/assets/icons/fold-vertical.svg +0 -1
- data/assets/icons/folder-dot.svg +0 -1
- data/assets/icons/folder-git-2.svg +0 -1
- data/assets/icons/folder-git.svg +0 -1
- data/assets/icons/folder-kanban.svg +0 -1
- data/assets/icons/folder-open-dot.svg +0 -1
- data/assets/icons/folder-root.svg +0 -1
- data/assets/icons/folder-sync.svg +0 -1
- data/assets/icons/gallery-horizontal-end.svg +0 -1
- data/assets/icons/gallery-horizontal.svg +0 -1
- data/assets/icons/gallery-thumbnails.svg +0 -1
- data/assets/icons/gallery-vertical-end.svg +0 -1
- data/assets/icons/gallery-vertical.svg +0 -1
- data/assets/icons/gantt-chart-square.svg +0 -1
- data/assets/icons/gantt-chart.svg +0 -1
- data/assets/icons/gauge-circle.svg +0 -1
- data/assets/icons/goal.svg +0 -1
- data/assets/icons/grid-2x2.svg +0 -1
- data/assets/icons/grid-3x3.svg +0 -1
- data/assets/icons/group.svg +0 -1
- data/assets/icons/hard-drive-download.svg +0 -1
- data/assets/icons/hard-drive-upload.svg +0 -1
- data/assets/icons/hdmi-port.svg +0 -1
- data/assets/icons/hotel.svg +0 -1
- data/assets/icons/iteration-ccw.svg +0 -1
- data/assets/icons/iteration-cw.svg +0 -1
- data/assets/icons/kanban-square-dashed.svg +0 -1
- data/assets/icons/kanban-square.svg +0 -1
- data/assets/icons/kanban.svg +0 -1
- data/assets/icons/key-round.svg +0 -1
- data/assets/icons/key-square.svg +0 -1
- data/assets/icons/layout-panel-left.svg +0 -1
- data/assets/icons/layout-panel-top.svg +0 -1
- data/assets/icons/leafy-green.svg +0 -1
- data/assets/icons/ligature.svg +0 -1
- data/assets/icons/list-filter.svg +0 -1
- data/assets/icons/list-restart.svg +0 -1
- data/assets/icons/list-todo.svg +0 -1
- data/assets/icons/list-tree.svg +0 -1
- data/assets/icons/lollipop.svg +0 -1
- data/assets/icons/m-square.svg +0 -1
- data/assets/icons/mailbox.svg +0 -1
- data/assets/icons/memory-stick.svg +0 -1
- data/assets/icons/menu-square.svg +0 -1
- data/assets/icons/merge.svg +0 -1
- data/assets/icons/message-square-dashed.svg +0 -1
- data/assets/icons/message-square-plus.svg +0 -1
- data/assets/icons/messages-square.svg +0 -1
- data/assets/icons/monitor-check.svg +0 -1
- data/assets/icons/monitor-dot.svg +0 -1
- data/assets/icons/monitor-down.svg +0 -1
- data/assets/icons/monitor-pause.svg +0 -1
- data/assets/icons/monitor-play.svg +0 -1
- data/assets/icons/monitor-stop.svg +0 -1
- data/assets/icons/monitor-up.svg +0 -1
- data/assets/icons/monitor-x.svg +0 -1
- data/assets/icons/moon-star.svg +0 -1
- data/assets/icons/mouse-pointer-square-dashed.svg +0 -1
- data/assets/icons/mouse-pointer-square.svg +0 -1
- data/assets/icons/move-down-left.svg +0 -1
- data/assets/icons/move-down-right.svg +0 -1
- data/assets/icons/move-down.svg +0 -1
- data/assets/icons/move-left.svg +0 -1
- data/assets/icons/move-right.svg +0 -1
- data/assets/icons/move-up-left.svg +0 -1
- data/assets/icons/move-up-right.svg +0 -1
- data/assets/icons/move-up.svg +0 -1
- data/assets/icons/orbit.svg +0 -1
- data/assets/icons/panel-bottom-close.svg +0 -1
- data/assets/icons/panel-bottom-inactive.svg +0 -1
- data/assets/icons/panel-bottom-open.svg +0 -1
- data/assets/icons/panel-bottom.svg +0 -1
- data/assets/icons/panel-left-close.svg +0 -1
- data/assets/icons/panel-left-inactive.svg +0 -1
- data/assets/icons/panel-left-open.svg +0 -1
- data/assets/icons/panel-left.svg +0 -1
- data/assets/icons/panel-right-close.svg +0 -1
- data/assets/icons/panel-right-inactive.svg +0 -1
- data/assets/icons/panel-right-open.svg +0 -1
- data/assets/icons/panel-right.svg +0 -1
- data/assets/icons/panel-top-close.svg +0 -1
- data/assets/icons/panel-top-inactive.svg +0 -1
- data/assets/icons/panel-top-open.svg +0 -1
- data/assets/icons/panel-top.svg +0 -1
- data/assets/icons/parentheses.svg +0 -1
- data/assets/icons/parking-circle-off.svg +0 -1
- data/assets/icons/parking-circle.svg +0 -1
- data/assets/icons/parking-meter.svg +0 -1
- data/assets/icons/parking-square-off.svg +0 -1
- data/assets/icons/parking-square.svg +0 -1
- data/assets/icons/paw-print.svg +0 -1
- data/assets/icons/pc-case.svg +0 -1
- data/assets/icons/pen-line.svg +0 -1
- data/assets/icons/pen-square.svg +0 -1
- data/assets/icons/pen.svg +0 -1
- data/assets/icons/pencil-line.svg +0 -1
- data/assets/icons/pencil-ruler.svg +0 -1
- data/assets/icons/percent-circle.svg +0 -1
- data/assets/icons/percent-diamond.svg +0 -1
- data/assets/icons/percent-square.svg +0 -1
- data/assets/icons/pi-square.svg +0 -1
- data/assets/icons/pi.svg +0 -1
- data/assets/icons/pilcrow-square.svg +0 -1
- data/assets/icons/plane-landing.svg +0 -1
- data/assets/icons/plane-takeoff.svg +0 -1
- data/assets/icons/play-square.svg +0 -1
- data/assets/icons/plug-zap-2.svg +0 -1
- data/assets/icons/pocket-knife.svg +0 -1
- data/assets/icons/popcorn.svg +0 -1
- data/assets/icons/popsicle.svg +0 -1
- data/assets/icons/presentation.svg +0 -1
- data/assets/icons/projector.svg +0 -1
- data/assets/icons/rabbit.svg +0 -1
- data/assets/icons/radar.svg +0 -1
- data/assets/icons/radiation.svg +0 -1
- data/assets/icons/radio-tower.svg +0 -1
- data/assets/icons/rail-symbol.svg +0 -1
- data/assets/icons/rainbow.svg +0 -1
- data/assets/icons/rat.svg +0 -1
- data/assets/icons/ratio.svg +0 -1
- data/assets/icons/receipt.svg +0 -1
- data/assets/icons/redo-dot.svg +0 -1
- data/assets/icons/refresh-ccw-dot.svg +0 -1
- data/assets/icons/refresh-cw-off.svg +0 -1
- data/assets/icons/repeat-2.svg +0 -1
- data/assets/icons/replace-all.svg +0 -1
- data/assets/icons/replace.svg +0 -1
- data/assets/icons/roller-coaster.svg +0 -1
- data/assets/icons/rows.svg +0 -1
- data/assets/icons/satellite-dish.svg +0 -1
- data/assets/icons/satellite.svg +0 -1
- data/assets/icons/save-all.svg +0 -1
- data/assets/icons/scatter-chart.svg +0 -1
- data/assets/icons/school-2.svg +0 -1
- data/assets/icons/school.svg +0 -1
- data/assets/icons/scissors-line-dashed.svg +0 -1
- data/assets/icons/scissors-square-dashed-bottom.svg +0 -1
- data/assets/icons/scissors-square.svg +0 -1
- data/assets/icons/scroll-text.svg +0 -1
- data/assets/icons/search-check.svg +0 -1
- data/assets/icons/search-code.svg +0 -1
- data/assets/icons/search-slash.svg +0 -1
- data/assets/icons/search-x.svg +0 -1
- data/assets/icons/send-horizontal.svg +0 -1
- data/assets/icons/send-to-back.svg +0 -1
- data/assets/icons/shapes.svg +0 -1
- data/assets/icons/shell.svg +0 -1
- data/assets/icons/shield-ban.svg +0 -1
- data/assets/icons/shield-ellipsis.svg +0 -1
- data/assets/icons/shield-half.svg +0 -1
- data/assets/icons/shield-minus.svg +0 -1
- data/assets/icons/shield-plus.svg +0 -1
- data/assets/icons/shield-question.svg +0 -1
- data/assets/icons/shield-x.svg +0 -1
- data/assets/icons/ship-wheel.svg +0 -1
- data/assets/icons/shopping-basket.svg +0 -1
- data/assets/icons/sigma-square.svg +0 -1
- data/assets/icons/snail.svg +0 -1
- data/assets/icons/space.svg +0 -1
- data/assets/icons/spade.svg +0 -1
- data/assets/icons/sparkle.svg +0 -1
- data/assets/icons/sparkles.svg +0 -1
- data/assets/icons/speech.svg +0 -1
- data/assets/icons/spell-check-2.svg +0 -1
- data/assets/icons/spell-check.svg +0 -1
- data/assets/icons/split.svg +0 -1
- data/assets/icons/spray-can.svg +0 -1
- data/assets/icons/square-asterisk.svg +0 -1
- data/assets/icons/square-code.svg +0 -1
- data/assets/icons/square-dashed-bottom-code.svg +0 -1
- data/assets/icons/square-dashed-bottom.svg +0 -1
- data/assets/icons/square-dot.svg +0 -1
- data/assets/icons/square-equal.svg +0 -1
- data/assets/icons/square-slash.svg +0 -1
- data/assets/icons/square-stack.svg +0 -1
- data/assets/icons/squirrel.svg +0 -1
- data/assets/icons/step-back.svg +0 -1
- data/assets/icons/step-forward.svg +0 -1
- data/assets/icons/store.svg +0 -1
- data/assets/icons/table-properties.svg +0 -1
- data/assets/icons/tablet-smartphone.svg +0 -1
- data/assets/icons/tally-1.svg +0 -1
- data/assets/icons/tally-2.svg +0 -1
- data/assets/icons/tally-3.svg +0 -1
- data/assets/icons/tally-4.svg +0 -1
- data/assets/icons/tally-5.svg +0 -1
- data/assets/icons/test-tube-2.svg +0 -1
- data/assets/icons/test-tube.svg +0 -1
- data/assets/icons/test-tubes.svg +0 -1
- data/assets/icons/text-quote.svg +0 -1
- data/assets/icons/text-select.svg +0 -1
- data/assets/icons/text.svg +0 -1
- data/assets/icons/theater.svg +0 -1
- data/assets/icons/touchpad-off.svg +0 -1
- data/assets/icons/touchpad.svg +0 -1
- data/assets/icons/tractor.svg +0 -1
- data/assets/icons/traffic-cone.svg +0 -1
- data/assets/icons/train-front-tunnel.svg +0 -1
- data/assets/icons/train-front.svg +0 -1
- data/assets/icons/train-track.svg +0 -1
- data/assets/icons/tram-front.svg +0 -1
- data/assets/icons/triangle-right.svg +0 -1
- data/assets/icons/turtle.svg +0 -1
- data/assets/icons/undo-dot.svg +0 -1
- data/assets/icons/unfold-horizontal.svg +0 -1
- data/assets/icons/unfold-vertical.svg +0 -1
- data/assets/icons/ungroup.svg +0 -1
- data/assets/icons/unplug.svg +0 -1
- data/assets/icons/user-2.svg +0 -1
- data/assets/icons/user-check-2.svg +0 -1
- data/assets/icons/user-circle-2.svg +0 -1
- data/assets/icons/user-circle.svg +0 -1
- data/assets/icons/user-cog-2.svg +0 -1
- data/assets/icons/user-minus-2.svg +0 -1
- data/assets/icons/user-plus-2.svg +0 -1
- data/assets/icons/user-square-2.svg +0 -1
- data/assets/icons/user-square.svg +0 -1
- data/assets/icons/user-x-2.svg +0 -1
- data/assets/icons/users-2.svg +0 -1
- data/assets/icons/variable.svg +0 -1
- data/assets/icons/videotape.svg +0 -1
- data/assets/icons/wallet-2.svg +0 -1
- data/assets/icons/wallet-cards.svg +0 -1
- data/assets/icons/wallpaper.svg +0 -1
- data/assets/icons/warehouse.svg +0 -1
- data/assets/icons/whole-word.svg +0 -1
- 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
|
-
|
77
|
+
rootSelector,
|
78
|
+
options
|
76
79
|
);
|
77
|
-
morph(
|
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/
|
72
|
+
repo: https://github.com/lookbook-hq/lookbook/tree/v2
|
71
73
|
|
72
74
|
development:
|
73
75
|
debug_menu: true
|
data/lib/lookbook/engine.rb
CHANGED
@@ -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 -
|
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
|
-
|
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
|
-
|
40
|
+
if vc_config.key?(:previews)
|
41
|
+
# New config style (ViewComponent >= 4.0)
|
42
|
+
opts.preview_paths += vc_config.previews.paths
|
41
43
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
57
|
+
vc_config.previews.enabled = true
|
57
58
|
|
58
|
-
|
59
|
-
|
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
|
-
|
77
|
-
|
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
|
-
|
20
|
-
opts
|
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 =
|
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
|
-
|
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)
|
data/lib/lookbook/reloaders.rb
CHANGED
@@ -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
|
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)
|
@@ -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
|
-
|
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
|
data/lib/lookbook/version.rb
CHANGED