gitlab-lookbook 2.3.14
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 +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +98 -0
- data/app/components/lookbook/base_component.rb +52 -0
- data/app/components/lookbook/button/component.html.erb +17 -0
- data/app/components/lookbook/button/component.js +69 -0
- data/app/components/lookbook/button/component.rb +39 -0
- data/app/components/lookbook/button_group/component.html.erb +3 -0
- data/app/components/lookbook/button_group/component.rb +17 -0
- data/app/components/lookbook/code/component.css +57 -0
- data/app/components/lookbook/code/component.html.erb +11 -0
- data/app/components/lookbook/code/component.js +3 -0
- data/app/components/lookbook/code/component.rb +65 -0
- data/app/components/lookbook/code/highlight_github.css +405 -0
- data/app/components/lookbook/copy_button/component.html.erb +11 -0
- data/app/components/lookbook/copy_button/component.js +16 -0
- data/app/components/lookbook/copy_button/component.rb +26 -0
- data/app/components/lookbook/debug_menu/component.html.erb +52 -0
- data/app/components/lookbook/debug_menu/component.rb +29 -0
- data/app/components/lookbook/dimensions_display/component.html.erb +11 -0
- data/app/components/lookbook/dimensions_display/component.js +34 -0
- data/app/components/lookbook/dimensions_display/component.rb +15 -0
- data/app/components/lookbook/display_options/editor/component.html.erb +13 -0
- data/app/components/lookbook/display_options/editor/component.rb +7 -0
- data/app/components/lookbook/display_options/field/component.css +7 -0
- data/app/components/lookbook/display_options/field/component.html.erb +8 -0
- data/app/components/lookbook/display_options/field/component.js +30 -0
- data/app/components/lookbook/display_options/field/component.rb +28 -0
- data/app/components/lookbook/embed/component.html.erb +6 -0
- data/app/components/lookbook/embed/component.rb +31 -0
- data/app/components/lookbook/embed/inspector/component.html.erb +117 -0
- data/app/components/lookbook/embed/inspector/component.js +58 -0
- data/app/components/lookbook/embed/inspector/component.rb +64 -0
- data/app/components/lookbook/embed_code_dropdown/component.css +19 -0
- data/app/components/lookbook/embed_code_dropdown/component.html.erb +64 -0
- data/app/components/lookbook/embed_code_dropdown/component.js +3 -0
- data/app/components/lookbook/embed_code_dropdown/component.rb +51 -0
- data/app/components/lookbook/file_source/component.html.erb +9 -0
- data/app/components/lookbook/file_source/component.rb +73 -0
- data/app/components/lookbook/filter/component.html.erb +17 -0
- data/app/components/lookbook/filter/component.js +21 -0
- data/app/components/lookbook/filter/component.rb +15 -0
- data/app/components/lookbook/header/component.css +12 -0
- data/app/components/lookbook/header/component.html.erb +58 -0
- data/app/components/lookbook/header/component.rb +20 -0
- data/app/components/lookbook/icon/component.css +19 -0
- data/app/components/lookbook/icon/component.html.erb +5 -0
- data/app/components/lookbook/icon/component.rb +18 -0
- data/app/components/lookbook/icon_button/component.html.erb +20 -0
- data/app/components/lookbook/icon_button/component.rb +46 -0
- data/app/components/lookbook/inspector_panel/component.css +5 -0
- data/app/components/lookbook/inspector_panel/component.html.erb +8 -0
- data/app/components/lookbook/inspector_panel/component.rb +20 -0
- data/app/components/lookbook/logo/component.html.erb +6 -0
- data/app/components/lookbook/logo/component.rb +15 -0
- data/app/components/lookbook/message/component.css +34 -0
- data/app/components/lookbook/message/component.html.erb +26 -0
- data/app/components/lookbook/message/component.rb +13 -0
- data/app/components/lookbook/nav/component.html.erb +28 -0
- data/app/components/lookbook/nav/component.js +56 -0
- data/app/components/lookbook/nav/component.rb +27 -0
- data/app/components/lookbook/nav/directory/component.html.erb +28 -0
- data/app/components/lookbook/nav/directory/component.rb +4 -0
- data/app/components/lookbook/nav/entity/component.html.erb +32 -0
- data/app/components/lookbook/nav/entity/component.rb +49 -0
- data/app/components/lookbook/nav/item/component.css +15 -0
- data/app/components/lookbook/nav/item/component.js +68 -0
- data/app/components/lookbook/nav/item/component.rb +48 -0
- data/app/components/lookbook/page_tabs/component.html.erb +18 -0
- data/app/components/lookbook/page_tabs/component.rb +19 -0
- data/app/components/lookbook/params/editor/component.html.erb +21 -0
- data/app/components/lookbook/params/editor/component.js +12 -0
- data/app/components/lookbook/params/editor/component.rb +37 -0
- data/app/components/lookbook/params/field/component.css +76 -0
- data/app/components/lookbook/params/field/component.html.erb +27 -0
- data/app/components/lookbook/params/field/component.js +7 -0
- data/app/components/lookbook/params/field/component.rb +46 -0
- data/app/components/lookbook/prose/component.css +25 -0
- data/app/components/lookbook/prose/component.html.erb +8 -0
- data/app/components/lookbook/prose/component.rb +24 -0
- data/app/components/lookbook/split_layout/component.html.erb +13 -0
- data/app/components/lookbook/split_layout/component.js +151 -0
- data/app/components/lookbook/split_layout/component.rb +11 -0
- data/app/components/lookbook/tab_panels/component.html.erb +5 -0
- data/app/components/lookbook/tab_panels/component.js +25 -0
- data/app/components/lookbook/tab_panels/component.rb +20 -0
- data/app/components/lookbook/tab_panels/panel/component.html.erb +8 -0
- data/app/components/lookbook/tab_panels/panel/component.rb +8 -0
- data/app/components/lookbook/tabs/component.css +8 -0
- data/app/components/lookbook/tabs/component.html.erb +20 -0
- data/app/components/lookbook/tabs/component.js +119 -0
- data/app/components/lookbook/tabs/component.rb +28 -0
- data/app/components/lookbook/tabs/dropdown_tab/component.html.erb +21 -0
- data/app/components/lookbook/tabs/dropdown_tab/component.rb +17 -0
- data/app/components/lookbook/tabs/tab/component.html.erb +25 -0
- data/app/components/lookbook/tabs/tab/component.rb +17 -0
- data/app/components/lookbook/tag_component.rb +33 -0
- data/app/components/lookbook/text_button/component.html.erb +26 -0
- data/app/components/lookbook/text_button/component.rb +42 -0
- data/app/components/lookbook/toolbar/component.css +16 -0
- data/app/components/lookbook/toolbar/component.html.erb +5 -0
- data/app/components/lookbook/toolbar/component.rb +26 -0
- data/app/components/lookbook/viewport/component.css +11 -0
- data/app/components/lookbook/viewport/component.html.erb +69 -0
- data/app/components/lookbook/viewport/component.js +150 -0
- data/app/components/lookbook/viewport/component.rb +18 -0
- data/app/controllers/concerns/lookbook/targetable_concern.rb +123 -0
- data/app/controllers/concerns/lookbook/with_panels_concern.rb +30 -0
- data/app/controllers/concerns/lookbook/with_preview_controller_concern.rb +32 -0
- data/app/controllers/lookbook/application_controller.rb +110 -0
- data/app/controllers/lookbook/embeds_controller.rb +147 -0
- data/app/controllers/lookbook/inspector_controller.rb +18 -0
- data/app/controllers/lookbook/page_controller.rb +30 -0
- data/app/controllers/lookbook/pages_controller.rb +41 -0
- data/app/controllers/lookbook/preview_controller.rb +45 -0
- data/app/controllers/lookbook/previews_controller.rb +78 -0
- data/app/helpers/lookbook/application_helper.rb +27 -0
- data/app/views/layouts/lookbook/application.html.erb +126 -0
- data/app/views/layouts/lookbook/embed.html.erb +34 -0
- data/app/views/layouts/lookbook/skeleton.html.erb +47 -0
- data/app/views/lookbook/embeds/show.html.erb +12 -0
- data/app/views/lookbook/errors/default.html.erb +40 -0
- data/app/views/lookbook/errors/not_found.html.erb +10 -0
- data/app/views/lookbook/index.html.erb +40 -0
- data/app/views/lookbook/inspector/inputs/_color.html.erb +6 -0
- data/app/views/lookbook/inspector/inputs/_range.html.erb +15 -0
- data/app/views/lookbook/inspector/inputs/_select.html.erb +5 -0
- data/app/views/lookbook/inspector/inputs/_text.html.erb +5 -0
- data/app/views/lookbook/inspector/inputs/_text_two_step.html.erb +19 -0
- data/app/views/lookbook/inspector/inputs/_textarea.html.erb +5 -0
- data/app/views/lookbook/inspector/inputs/_toggle.html.erb +20 -0
- data/app/views/lookbook/inspector/panels/_content.html.erb +13 -0
- data/app/views/lookbook/inspector/panels/_notes.html.erb +19 -0
- data/app/views/lookbook/inspector/panels/_output.html.erb +7 -0
- data/app/views/lookbook/inspector/panels/_params.html.erb +15 -0
- data/app/views/lookbook/inspector/panels/_preview.html.erb +10 -0
- data/app/views/lookbook/inspector/panels/_source.html.erb +11 -0
- data/app/views/lookbook/inspector/show.html.erb +169 -0
- data/app/views/lookbook/pages/show.html.erb +98 -0
- data/app/views/lookbook/partials/_blank_slate.html.erb +7 -0
- data/app/views/lookbook/partials/_iframe_content_scripts.html.erb +1 -0
- data/app/views/lookbook/partials/_user_styles.html.erb +5 -0
- data/app/views/lookbook/previews/group.html.erb +15 -0
- data/app/views/lookbook/previews/preview.html.erb +13 -0
- data/app/views/lookbook/previews/show.html.erb +1 -0
- data/assets/css/fonts.css +33 -0
- data/assets/css/lookbook.css +149 -0
- data/assets/css/themes/blue.css +79 -0
- data/assets/css/themes/green.css +79 -0
- data/assets/css/themes/indigo.css +79 -0
- data/assets/css/themes/rose.css +79 -0
- data/assets/css/themes/zinc.css +79 -0
- data/assets/css/tooltip.css +53 -0
- data/assets/fonts/Inter-italic.var.woff2 +0 -0
- data/assets/fonts/Inter-roman.var.woff2 +0 -0
- data/assets/fonts/SourceCodeVariable-Italic.ttf.woff2 +0 -0
- data/assets/fonts/SourceCodeVariable-Roman.ttf.woff2 +0 -0
- data/assets/icons/accessibility.svg +1 -0
- data/assets/icons/activity.svg +1 -0
- data/assets/icons/air-vent.svg +1 -0
- data/assets/icons/airplay.svg +1 -0
- data/assets/icons/alarm-check.svg +1 -0
- data/assets/icons/alarm-clock-off.svg +1 -0
- data/assets/icons/alarm-clock.svg +1 -0
- data/assets/icons/alarm-minus.svg +1 -0
- data/assets/icons/alarm-plus.svg +1 -0
- data/assets/icons/album.svg +1 -0
- data/assets/icons/alert-circle.svg +1 -0
- data/assets/icons/alert-octagon.svg +1 -0
- data/assets/icons/alert-triangle.svg +1 -0
- data/assets/icons/align-center-horizontal.svg +1 -0
- data/assets/icons/align-center-vertical.svg +1 -0
- data/assets/icons/align-center.svg +1 -0
- data/assets/icons/align-end-horizontal.svg +1 -0
- data/assets/icons/align-end-vertical.svg +1 -0
- data/assets/icons/align-horizontal-distribute-center.svg +1 -0
- data/assets/icons/align-horizontal-distribute-end.svg +1 -0
- data/assets/icons/align-horizontal-distribute-start.svg +1 -0
- data/assets/icons/align-horizontal-justify-center.svg +1 -0
- data/assets/icons/align-horizontal-justify-end.svg +1 -0
- data/assets/icons/align-horizontal-justify-start.svg +1 -0
- data/assets/icons/align-horizontal-space-around.svg +1 -0
- data/assets/icons/align-horizontal-space-between.svg +1 -0
- data/assets/icons/align-justify.svg +1 -0
- data/assets/icons/align-left.svg +1 -0
- data/assets/icons/align-right.svg +1 -0
- data/assets/icons/align-start-horizontal.svg +1 -0
- data/assets/icons/align-start-vertical.svg +1 -0
- data/assets/icons/align-vertical-distribute-center.svg +1 -0
- data/assets/icons/align-vertical-distribute-end.svg +1 -0
- data/assets/icons/align-vertical-distribute-start.svg +1 -0
- data/assets/icons/align-vertical-justify-center.svg +1 -0
- data/assets/icons/align-vertical-justify-end.svg +1 -0
- data/assets/icons/align-vertical-justify-start.svg +1 -0
- data/assets/icons/align-vertical-space-around.svg +1 -0
- data/assets/icons/align-vertical-space-between.svg +1 -0
- data/assets/icons/anchor.svg +1 -0
- data/assets/icons/angry.svg +1 -0
- data/assets/icons/annoyed.svg +1 -0
- data/assets/icons/aperture.svg +1 -0
- data/assets/icons/apple.svg +1 -0
- data/assets/icons/archive-restore.svg +1 -0
- data/assets/icons/archive.svg +1 -0
- data/assets/icons/armchair.svg +1 -0
- data/assets/icons/arrow-big-down.svg +1 -0
- data/assets/icons/arrow-big-left.svg +1 -0
- data/assets/icons/arrow-big-right.svg +1 -0
- data/assets/icons/arrow-big-up.svg +1 -0
- data/assets/icons/arrow-down-circle.svg +1 -0
- data/assets/icons/arrow-down-left.svg +1 -0
- data/assets/icons/arrow-down-right.svg +1 -0
- data/assets/icons/arrow-down.svg +1 -0
- data/assets/icons/arrow-left-circle.svg +1 -0
- data/assets/icons/arrow-left-right.svg +1 -0
- data/assets/icons/arrow-left.svg +1 -0
- data/assets/icons/arrow-right-circle.svg +1 -0
- data/assets/icons/arrow-right.svg +1 -0
- data/assets/icons/arrow-up-circle.svg +1 -0
- data/assets/icons/arrow-up-down.svg +1 -0
- data/assets/icons/arrow-up-left.svg +1 -0
- data/assets/icons/arrow-up-right.svg +1 -0
- data/assets/icons/arrow-up.svg +1 -0
- data/assets/icons/asterisk.svg +1 -0
- data/assets/icons/at-sign.svg +1 -0
- data/assets/icons/award.svg +1 -0
- data/assets/icons/axe.svg +1 -0
- data/assets/icons/axis-3d.svg +1 -0
- data/assets/icons/baby.svg +1 -0
- data/assets/icons/backpack.svg +1 -0
- data/assets/icons/baggage-claim.svg +1 -0
- data/assets/icons/banana.svg +1 -0
- data/assets/icons/banknote.svg +1 -0
- data/assets/icons/bar-chart-2.svg +1 -0
- data/assets/icons/bar-chart-3.svg +1 -0
- data/assets/icons/bar-chart-4.svg +1 -0
- data/assets/icons/bar-chart-horizontal.svg +1 -0
- data/assets/icons/bar-chart.svg +1 -0
- data/assets/icons/baseline.svg +1 -0
- data/assets/icons/bath.svg +1 -0
- data/assets/icons/battery-charging.svg +1 -0
- data/assets/icons/battery-full.svg +1 -0
- data/assets/icons/battery-low.svg +1 -0
- data/assets/icons/battery-medium.svg +1 -0
- data/assets/icons/battery-warning.svg +1 -0
- data/assets/icons/battery.svg +1 -0
- data/assets/icons/beaker.svg +1 -0
- data/assets/icons/bean-off.svg +1 -0
- data/assets/icons/bean.svg +1 -0
- data/assets/icons/bed-double.svg +1 -0
- data/assets/icons/bed-single.svg +1 -0
- data/assets/icons/bed.svg +1 -0
- data/assets/icons/beef.svg +1 -0
- data/assets/icons/beer.svg +1 -0
- data/assets/icons/bell-minus.svg +1 -0
- data/assets/icons/bell-off.svg +1 -0
- data/assets/icons/bell-plus.svg +1 -0
- data/assets/icons/bell-ring.svg +1 -0
- data/assets/icons/bell.svg +1 -0
- data/assets/icons/bike.svg +1 -0
- data/assets/icons/binary.svg +1 -0
- data/assets/icons/bird.svg +1 -0
- data/assets/icons/bitcoin.svg +1 -0
- data/assets/icons/blinds.svg +1 -0
- data/assets/icons/bluetooth-connected.svg +1 -0
- data/assets/icons/bluetooth-off.svg +1 -0
- data/assets/icons/bluetooth-searching.svg +1 -0
- data/assets/icons/bluetooth.svg +1 -0
- data/assets/icons/bold.svg +1 -0
- data/assets/icons/bomb.svg +1 -0
- data/assets/icons/bone.svg +1 -0
- data/assets/icons/book-open-check.svg +1 -0
- data/assets/icons/book-open.svg +1 -0
- data/assets/icons/book.svg +1 -0
- data/assets/icons/bookmark-minus.svg +1 -0
- data/assets/icons/bookmark-plus.svg +1 -0
- data/assets/icons/bookmark.svg +1 -0
- data/assets/icons/bot.svg +1 -0
- data/assets/icons/box-select.svg +1 -0
- data/assets/icons/box.svg +1 -0
- data/assets/icons/boxes.svg +1 -0
- data/assets/icons/briefcase.svg +1 -0
- data/assets/icons/brush.svg +1 -0
- data/assets/icons/bug.svg +1 -0
- data/assets/icons/building-2.svg +1 -0
- data/assets/icons/building.svg +1 -0
- data/assets/icons/bus.svg +1 -0
- data/assets/icons/cake.svg +1 -0
- data/assets/icons/calculator.svg +1 -0
- data/assets/icons/calendar-check-2.svg +1 -0
- data/assets/icons/calendar-check.svg +1 -0
- data/assets/icons/calendar-clock.svg +1 -0
- data/assets/icons/calendar-days.svg +1 -0
- data/assets/icons/calendar-heart.svg +1 -0
- data/assets/icons/calendar-minus.svg +1 -0
- data/assets/icons/calendar-off.svg +1 -0
- data/assets/icons/calendar-plus.svg +1 -0
- data/assets/icons/calendar-range.svg +1 -0
- data/assets/icons/calendar-search.svg +1 -0
- data/assets/icons/calendar-x-2.svg +1 -0
- data/assets/icons/calendar-x.svg +1 -0
- data/assets/icons/calendar.svg +1 -0
- data/assets/icons/camera-off.svg +1 -0
- data/assets/icons/camera.svg +1 -0
- data/assets/icons/candy-off.svg +1 -0
- data/assets/icons/candy.svg +1 -0
- data/assets/icons/car.svg +1 -0
- data/assets/icons/carrot.svg +1 -0
- data/assets/icons/cast.svg +1 -0
- data/assets/icons/cat.svg +1 -0
- data/assets/icons/check-check.svg +1 -0
- data/assets/icons/check-circle-2.svg +1 -0
- data/assets/icons/check-circle.svg +1 -0
- data/assets/icons/check-square.svg +1 -0
- data/assets/icons/check.svg +1 -0
- data/assets/icons/chef-hat.svg +1 -0
- data/assets/icons/cherry.svg +1 -0
- data/assets/icons/chevron-down.svg +1 -0
- data/assets/icons/chevron-first.svg +1 -0
- data/assets/icons/chevron-last.svg +1 -0
- data/assets/icons/chevron-left.svg +1 -0
- data/assets/icons/chevron-right.svg +1 -0
- data/assets/icons/chevron-up.svg +1 -0
- data/assets/icons/chevrons-down-up.svg +1 -0
- data/assets/icons/chevrons-down.svg +1 -0
- data/assets/icons/chevrons-left-right.svg +1 -0
- data/assets/icons/chevrons-left.svg +1 -0
- data/assets/icons/chevrons-right-left.svg +1 -0
- data/assets/icons/chevrons-right.svg +1 -0
- data/assets/icons/chevrons-up-down.svg +1 -0
- data/assets/icons/chevrons-up.svg +1 -0
- data/assets/icons/chrome.svg +1 -0
- data/assets/icons/cigarette-off.svg +1 -0
- data/assets/icons/cigarette.svg +1 -0
- data/assets/icons/circle-dot.svg +1 -0
- data/assets/icons/circle-ellipsis.svg +1 -0
- data/assets/icons/circle-slashed.svg +1 -0
- data/assets/icons/circle.svg +1 -0
- data/assets/icons/citrus.svg +1 -0
- data/assets/icons/clapperboard.svg +1 -0
- data/assets/icons/clipboard-check.svg +1 -0
- data/assets/icons/clipboard-copy.svg +1 -0
- data/assets/icons/clipboard-edit.svg +1 -0
- data/assets/icons/clipboard-list.svg +1 -0
- data/assets/icons/clipboard-signature.svg +1 -0
- data/assets/icons/clipboard-type.svg +1 -0
- data/assets/icons/clipboard-x.svg +1 -0
- data/assets/icons/clipboard.svg +1 -0
- data/assets/icons/clock-1.svg +1 -0
- data/assets/icons/clock-10.svg +1 -0
- data/assets/icons/clock-11.svg +1 -0
- data/assets/icons/clock-12.svg +1 -0
- data/assets/icons/clock-2.svg +1 -0
- data/assets/icons/clock-3.svg +1 -0
- data/assets/icons/clock-4.svg +1 -0
- data/assets/icons/clock-5.svg +1 -0
- data/assets/icons/clock-6.svg +1 -0
- data/assets/icons/clock-7.svg +1 -0
- data/assets/icons/clock-8.svg +1 -0
- data/assets/icons/clock-9.svg +1 -0
- data/assets/icons/clock.svg +1 -0
- data/assets/icons/cloud-cog.svg +1 -0
- data/assets/icons/cloud-drizzle.svg +1 -0
- data/assets/icons/cloud-fog.svg +1 -0
- data/assets/icons/cloud-hail.svg +1 -0
- data/assets/icons/cloud-lightning.svg +1 -0
- data/assets/icons/cloud-moon-rain.svg +1 -0
- data/assets/icons/cloud-moon.svg +1 -0
- data/assets/icons/cloud-off.svg +1 -0
- data/assets/icons/cloud-rain-wind.svg +1 -0
- data/assets/icons/cloud-rain.svg +1 -0
- data/assets/icons/cloud-snow.svg +1 -0
- data/assets/icons/cloud-sun-rain.svg +1 -0
- data/assets/icons/cloud-sun.svg +1 -0
- data/assets/icons/cloud.svg +1 -0
- data/assets/icons/cloudy.svg +1 -0
- data/assets/icons/clover.svg +1 -0
- data/assets/icons/code-2.svg +1 -0
- data/assets/icons/code.svg +1 -0
- data/assets/icons/codepen.svg +1 -0
- data/assets/icons/codesandbox.svg +1 -0
- data/assets/icons/coffee.svg +1 -0
- data/assets/icons/cog.svg +1 -0
- data/assets/icons/coins.svg +1 -0
- data/assets/icons/columns.svg +1 -0
- data/assets/icons/command.svg +1 -0
- data/assets/icons/compass.svg +1 -0
- data/assets/icons/component.svg +1 -0
- data/assets/icons/concierge-bell.svg +1 -0
- data/assets/icons/construction.svg +1 -0
- data/assets/icons/contact.svg +1 -0
- data/assets/icons/contrast.svg +1 -0
- data/assets/icons/cookie.svg +1 -0
- data/assets/icons/copy.svg +1 -0
- data/assets/icons/copyleft.svg +1 -0
- data/assets/icons/copyright.svg +1 -0
- data/assets/icons/corner-down-left.svg +1 -0
- data/assets/icons/corner-down-right.svg +1 -0
- data/assets/icons/corner-left-down.svg +1 -0
- data/assets/icons/corner-left-up.svg +1 -0
- data/assets/icons/corner-right-down.svg +1 -0
- data/assets/icons/corner-right-up.svg +1 -0
- data/assets/icons/corner-up-left.svg +1 -0
- data/assets/icons/corner-up-right.svg +1 -0
- data/assets/icons/cpu.svg +1 -0
- data/assets/icons/creative-commons.svg +1 -0
- data/assets/icons/credit-card.svg +1 -0
- data/assets/icons/croissant.svg +1 -0
- data/assets/icons/crop.svg +1 -0
- data/assets/icons/cross.svg +1 -0
- data/assets/icons/crosshair.svg +1 -0
- data/assets/icons/crown.svg +1 -0
- data/assets/icons/cup-soda.svg +1 -0
- data/assets/icons/curly-braces.svg +1 -0
- data/assets/icons/currency.svg +1 -0
- data/assets/icons/database-backup.svg +1 -0
- data/assets/icons/database.svg +1 -0
- data/assets/icons/delete.svg +1 -0
- data/assets/icons/diamond.svg +1 -0
- data/assets/icons/dice-1.svg +1 -0
- data/assets/icons/dice-2.svg +1 -0
- data/assets/icons/dice-3.svg +1 -0
- data/assets/icons/dice-4.svg +1 -0
- data/assets/icons/dice-5.svg +1 -0
- data/assets/icons/dice-6.svg +1 -0
- data/assets/icons/dices.svg +1 -0
- data/assets/icons/diff.svg +1 -0
- data/assets/icons/disc.svg +1 -0
- data/assets/icons/divide-circle.svg +1 -0
- data/assets/icons/divide-square.svg +1 -0
- data/assets/icons/divide.svg +1 -0
- data/assets/icons/dna-off.svg +1 -0
- data/assets/icons/dna.svg +1 -0
- data/assets/icons/dog.svg +1 -0
- data/assets/icons/dollar-sign.svg +1 -0
- data/assets/icons/download-cloud.svg +1 -0
- data/assets/icons/download.svg +1 -0
- data/assets/icons/dribbble.svg +1 -0
- data/assets/icons/droplet.svg +1 -0
- data/assets/icons/droplets.svg +1 -0
- data/assets/icons/drumstick.svg +1 -0
- data/assets/icons/dumbbell.svg +1 -0
- data/assets/icons/ear-off.svg +1 -0
- data/assets/icons/ear.svg +1 -0
- data/assets/icons/edit-2.svg +1 -0
- data/assets/icons/edit-3.svg +1 -0
- data/assets/icons/edit.svg +1 -0
- data/assets/icons/egg-fried.svg +1 -0
- data/assets/icons/egg-off.svg +1 -0
- data/assets/icons/egg.svg +1 -0
- data/assets/icons/equal-not.svg +1 -0
- data/assets/icons/equal.svg +1 -0
- data/assets/icons/eraser.svg +1 -0
- data/assets/icons/euro.svg +1 -0
- data/assets/icons/expand.svg +1 -0
- data/assets/icons/external-link.svg +1 -0
- data/assets/icons/eye-off.svg +1 -0
- data/assets/icons/eye.svg +1 -0
- data/assets/icons/facebook.svg +1 -0
- data/assets/icons/factory.svg +1 -0
- data/assets/icons/fan.svg +1 -0
- data/assets/icons/fast-forward.svg +1 -0
- data/assets/icons/feather.svg +1 -0
- data/assets/icons/figma.svg +1 -0
- data/assets/icons/file-archive.svg +1 -0
- data/assets/icons/file-audio-2.svg +1 -0
- data/assets/icons/file-audio.svg +1 -0
- data/assets/icons/file-axis-3d.svg +1 -0
- data/assets/icons/file-badge-2.svg +1 -0
- data/assets/icons/file-badge.svg +1 -0
- data/assets/icons/file-bar-chart-2.svg +1 -0
- data/assets/icons/file-bar-chart.svg +1 -0
- data/assets/icons/file-box.svg +1 -0
- data/assets/icons/file-check-2.svg +1 -0
- data/assets/icons/file-check.svg +1 -0
- data/assets/icons/file-clock.svg +1 -0
- data/assets/icons/file-code.svg +1 -0
- data/assets/icons/file-cog-2.svg +1 -0
- data/assets/icons/file-cog.svg +1 -0
- data/assets/icons/file-diff.svg +1 -0
- data/assets/icons/file-digit.svg +1 -0
- data/assets/icons/file-down.svg +1 -0
- data/assets/icons/file-edit.svg +1 -0
- data/assets/icons/file-heart.svg +1 -0
- data/assets/icons/file-image.svg +1 -0
- data/assets/icons/file-input.svg +1 -0
- data/assets/icons/file-json-2.svg +1 -0
- data/assets/icons/file-json.svg +1 -0
- data/assets/icons/file-key-2.svg +1 -0
- data/assets/icons/file-key.svg +1 -0
- data/assets/icons/file-line-chart.svg +1 -0
- data/assets/icons/file-lock-2.svg +1 -0
- data/assets/icons/file-lock.svg +1 -0
- data/assets/icons/file-minus-2.svg +1 -0
- data/assets/icons/file-minus.svg +1 -0
- data/assets/icons/file-output.svg +1 -0
- data/assets/icons/file-pie-chart.svg +1 -0
- data/assets/icons/file-plus-2.svg +1 -0
- data/assets/icons/file-plus.svg +1 -0
- data/assets/icons/file-question.svg +1 -0
- data/assets/icons/file-scan.svg +1 -0
- data/assets/icons/file-search-2.svg +1 -0
- data/assets/icons/file-search.svg +1 -0
- data/assets/icons/file-signature.svg +1 -0
- data/assets/icons/file-spreadsheet.svg +1 -0
- data/assets/icons/file-symlink.svg +1 -0
- data/assets/icons/file-terminal.svg +1 -0
- data/assets/icons/file-text.svg +1 -0
- data/assets/icons/file-type-2.svg +1 -0
- data/assets/icons/file-type.svg +1 -0
- data/assets/icons/file-up.svg +1 -0
- data/assets/icons/file-video-2.svg +1 -0
- data/assets/icons/file-video.svg +1 -0
- data/assets/icons/file-volume-2.svg +1 -0
- data/assets/icons/file-volume.svg +1 -0
- data/assets/icons/file-warning.svg +1 -0
- data/assets/icons/file-x-2.svg +1 -0
- data/assets/icons/file-x.svg +1 -0
- data/assets/icons/file.svg +1 -0
- data/assets/icons/files.svg +1 -0
- data/assets/icons/film.svg +1 -0
- data/assets/icons/filter-x.svg +1 -0
- data/assets/icons/filter.svg +1 -0
- data/assets/icons/fingerprint.svg +1 -0
- data/assets/icons/fish-off.svg +1 -0
- data/assets/icons/fish.svg +1 -0
- data/assets/icons/flag-off.svg +1 -0
- data/assets/icons/flag-triangle-left.svg +1 -0
- data/assets/icons/flag-triangle-right.svg +1 -0
- data/assets/icons/flag.svg +1 -0
- data/assets/icons/flame.svg +1 -0
- data/assets/icons/flashlight-off.svg +1 -0
- data/assets/icons/flashlight.svg +1 -0
- data/assets/icons/flask-conical-off.svg +1 -0
- data/assets/icons/flask-conical.svg +1 -0
- data/assets/icons/flask-round.svg +1 -0
- data/assets/icons/flip-horizontal-2.svg +1 -0
- data/assets/icons/flip-horizontal.svg +1 -0
- data/assets/icons/flip-vertical-2.svg +1 -0
- data/assets/icons/flip-vertical.svg +1 -0
- data/assets/icons/flower-2.svg +1 -0
- data/assets/icons/flower.svg +1 -0
- data/assets/icons/focus.svg +1 -0
- data/assets/icons/folder-archive.svg +1 -0
- data/assets/icons/folder-check.svg +1 -0
- data/assets/icons/folder-clock.svg +1 -0
- data/assets/icons/folder-closed.svg +1 -0
- data/assets/icons/folder-cog-2.svg +1 -0
- data/assets/icons/folder-cog.svg +1 -0
- data/assets/icons/folder-down.svg +1 -0
- data/assets/icons/folder-edit.svg +1 -0
- data/assets/icons/folder-heart.svg +1 -0
- data/assets/icons/folder-input.svg +1 -0
- data/assets/icons/folder-key.svg +1 -0
- data/assets/icons/folder-lock.svg +1 -0
- data/assets/icons/folder-minus.svg +1 -0
- data/assets/icons/folder-open.svg +1 -0
- data/assets/icons/folder-output.svg +1 -0
- data/assets/icons/folder-plus.svg +1 -0
- data/assets/icons/folder-search-2.svg +1 -0
- data/assets/icons/folder-search.svg +1 -0
- data/assets/icons/folder-symlink.svg +1 -0
- data/assets/icons/folder-tree.svg +1 -0
- data/assets/icons/folder-up.svg +1 -0
- data/assets/icons/folder-x.svg +1 -0
- data/assets/icons/folder.svg +1 -0
- data/assets/icons/folders.svg +1 -0
- data/assets/icons/footprints.svg +1 -0
- data/assets/icons/forklift.svg +1 -0
- data/assets/icons/form-input.svg +1 -0
- data/assets/icons/forward.svg +1 -0
- data/assets/icons/frame.svg +1 -0
- data/assets/icons/framer.svg +1 -0
- data/assets/icons/frown.svg +1 -0
- data/assets/icons/fuel.svg +1 -0
- data/assets/icons/function-square.svg +1 -0
- data/assets/icons/gamepad-2.svg +1 -0
- data/assets/icons/gamepad.svg +1 -0
- data/assets/icons/gauge.svg +1 -0
- data/assets/icons/gavel.svg +1 -0
- data/assets/icons/gem.svg +1 -0
- data/assets/icons/ghost.svg +1 -0
- data/assets/icons/gift.svg +1 -0
- data/assets/icons/git-branch-plus.svg +1 -0
- data/assets/icons/git-branch.svg +1 -0
- data/assets/icons/git-commit.svg +1 -0
- data/assets/icons/git-compare.svg +1 -0
- data/assets/icons/git-fork.svg +1 -0
- data/assets/icons/git-merge.svg +1 -0
- data/assets/icons/git-pull-request-closed.svg +1 -0
- data/assets/icons/git-pull-request-draft.svg +1 -0
- data/assets/icons/git-pull-request.svg +1 -0
- data/assets/icons/github.svg +1 -0
- data/assets/icons/gitlab.svg +1 -0
- data/assets/icons/glass-water.svg +1 -0
- data/assets/icons/glasses.svg +1 -0
- data/assets/icons/globe-2.svg +1 -0
- data/assets/icons/globe.svg +1 -0
- data/assets/icons/grab.svg +1 -0
- data/assets/icons/graduation-cap.svg +1 -0
- data/assets/icons/grape.svg +1 -0
- data/assets/icons/grid.svg +1 -0
- data/assets/icons/grip-horizontal.svg +1 -0
- data/assets/icons/grip-vertical.svg +1 -0
- data/assets/icons/grip.svg +1 -0
- data/assets/icons/hammer.svg +1 -0
- data/assets/icons/hand-metal.svg +1 -0
- data/assets/icons/hand.svg +1 -0
- data/assets/icons/hard-drive.svg +1 -0
- data/assets/icons/hard-hat.svg +1 -0
- data/assets/icons/hash.svg +1 -0
- data/assets/icons/haze.svg +1 -0
- data/assets/icons/heading-1.svg +1 -0
- data/assets/icons/heading-2.svg +1 -0
- data/assets/icons/heading-3.svg +1 -0
- data/assets/icons/heading-4.svg +1 -0
- data/assets/icons/heading-5.svg +1 -0
- data/assets/icons/heading-6.svg +1 -0
- data/assets/icons/heading.svg +1 -0
- data/assets/icons/headphones.svg +1 -0
- data/assets/icons/heart-crack.svg +1 -0
- data/assets/icons/heart-handshake.svg +1 -0
- data/assets/icons/heart-off.svg +1 -0
- data/assets/icons/heart-pulse.svg +1 -0
- data/assets/icons/heart.svg +1 -0
- data/assets/icons/help-circle.svg +1 -0
- data/assets/icons/helping-hand.svg +1 -0
- data/assets/icons/hexagon.svg +1 -0
- data/assets/icons/highlighter.svg +1 -0
- data/assets/icons/history.svg +1 -0
- data/assets/icons/home.svg +1 -0
- data/assets/icons/hop-off.svg +1 -0
- data/assets/icons/hop.svg +1 -0
- data/assets/icons/hourglass.svg +1 -0
- data/assets/icons/ice-cream-2.svg +1 -0
- data/assets/icons/ice-cream.svg +1 -0
- data/assets/icons/image-minus.svg +1 -0
- data/assets/icons/image-off.svg +1 -0
- data/assets/icons/image-plus.svg +1 -0
- data/assets/icons/image.svg +1 -0
- data/assets/icons/import.svg +1 -0
- data/assets/icons/inbox.svg +1 -0
- data/assets/icons/indent.svg +1 -0
- data/assets/icons/indian-rupee.svg +1 -0
- data/assets/icons/infinity.svg +1 -0
- data/assets/icons/info.svg +1 -0
- data/assets/icons/inspect.svg +1 -0
- data/assets/icons/instagram.svg +1 -0
- data/assets/icons/italic.svg +1 -0
- data/assets/icons/japanese-yen.svg +1 -0
- data/assets/icons/joystick.svg +1 -0
- data/assets/icons/key.svg +1 -0
- data/assets/icons/keyboard.svg +1 -0
- data/assets/icons/lamp-ceiling.svg +1 -0
- data/assets/icons/lamp-desk.svg +1 -0
- data/assets/icons/lamp-floor.svg +1 -0
- data/assets/icons/lamp-wall-down.svg +1 -0
- data/assets/icons/lamp-wall-up.svg +1 -0
- data/assets/icons/lamp.svg +1 -0
- data/assets/icons/landmark.svg +1 -0
- data/assets/icons/languages.svg +1 -0
- data/assets/icons/laptop-2.svg +1 -0
- data/assets/icons/laptop.svg +1 -0
- data/assets/icons/lasso-select.svg +1 -0
- data/assets/icons/lasso.svg +1 -0
- data/assets/icons/laugh.svg +1 -0
- data/assets/icons/layers.svg +1 -0
- data/assets/icons/layout-dashboard.svg +1 -0
- data/assets/icons/layout-grid.svg +1 -0
- data/assets/icons/layout-list.svg +1 -0
- data/assets/icons/layout-template.svg +1 -0
- data/assets/icons/layout.svg +1 -0
- data/assets/icons/leaf.svg +1 -0
- data/assets/icons/library.svg +1 -0
- data/assets/icons/life-buoy.svg +1 -0
- data/assets/icons/lightbulb-off.svg +1 -0
- data/assets/icons/lightbulb.svg +1 -0
- data/assets/icons/line-chart.svg +1 -0
- data/assets/icons/link-2-off.svg +1 -0
- data/assets/icons/link-2.svg +1 -0
- data/assets/icons/link.svg +1 -0
- data/assets/icons/linkedin.svg +1 -0
- data/assets/icons/list-checks.svg +1 -0
- data/assets/icons/list-end.svg +1 -0
- data/assets/icons/list-minus.svg +1 -0
- data/assets/icons/list-music.svg +1 -0
- data/assets/icons/list-ordered.svg +1 -0
- data/assets/icons/list-plus.svg +1 -0
- data/assets/icons/list-start.svg +1 -0
- data/assets/icons/list-video.svg +1 -0
- data/assets/icons/list-x.svg +1 -0
- data/assets/icons/list.svg +1 -0
- data/assets/icons/loader-2.svg +1 -0
- data/assets/icons/loader.svg +1 -0
- data/assets/icons/locate-fixed.svg +1 -0
- data/assets/icons/locate-off.svg +1 -0
- data/assets/icons/locate.svg +1 -0
- data/assets/icons/lock.svg +1 -0
- data/assets/icons/log-in.svg +1 -0
- data/assets/icons/log-out.svg +1 -0
- data/assets/icons/luggage.svg +1 -0
- data/assets/icons/magnet.svg +1 -0
- data/assets/icons/mail-check.svg +1 -0
- data/assets/icons/mail-minus.svg +1 -0
- data/assets/icons/mail-open.svg +1 -0
- data/assets/icons/mail-plus.svg +1 -0
- data/assets/icons/mail-question.svg +1 -0
- data/assets/icons/mail-search.svg +1 -0
- data/assets/icons/mail-warning.svg +1 -0
- data/assets/icons/mail-x.svg +1 -0
- data/assets/icons/mail.svg +1 -0
- data/assets/icons/mails.svg +1 -0
- data/assets/icons/map-pin-off.svg +1 -0
- data/assets/icons/map-pin.svg +1 -0
- data/assets/icons/map.svg +1 -0
- data/assets/icons/martini.svg +1 -0
- data/assets/icons/maximize-2.svg +1 -0
- data/assets/icons/maximize.svg +1 -0
- data/assets/icons/medal.svg +1 -0
- data/assets/icons/megaphone-off.svg +1 -0
- data/assets/icons/megaphone.svg +1 -0
- data/assets/icons/meh.svg +1 -0
- data/assets/icons/menu.svg +1 -0
- data/assets/icons/message-circle.svg +1 -0
- data/assets/icons/message-square.svg +1 -0
- data/assets/icons/mic-2.svg +1 -0
- data/assets/icons/mic-off.svg +1 -0
- data/assets/icons/mic.svg +1 -0
- data/assets/icons/microscope.svg +1 -0
- data/assets/icons/microwave.svg +1 -0
- data/assets/icons/milestone.svg +1 -0
- data/assets/icons/milk-off.svg +1 -0
- data/assets/icons/milk.svg +1 -0
- data/assets/icons/minimize-2.svg +1 -0
- data/assets/icons/minimize.svg +1 -0
- data/assets/icons/minus-circle.svg +1 -0
- data/assets/icons/minus-square.svg +1 -0
- data/assets/icons/minus.svg +1 -0
- data/assets/icons/monitor-off.svg +1 -0
- data/assets/icons/monitor-smartphone.svg +1 -0
- data/assets/icons/monitor-speaker.svg +1 -0
- data/assets/icons/monitor.svg +1 -0
- data/assets/icons/moon.svg +1 -0
- data/assets/icons/more-horizontal.svg +1 -0
- data/assets/icons/more-vertical.svg +1 -0
- data/assets/icons/mountain-snow.svg +1 -0
- data/assets/icons/mountain.svg +1 -0
- data/assets/icons/mouse-pointer-2.svg +1 -0
- data/assets/icons/mouse-pointer-click.svg +1 -0
- data/assets/icons/mouse-pointer.svg +1 -0
- data/assets/icons/mouse.svg +1 -0
- data/assets/icons/move-3d.svg +1 -0
- data/assets/icons/move-diagonal-2.svg +1 -0
- data/assets/icons/move-diagonal.svg +1 -0
- data/assets/icons/move-horizontal.svg +1 -0
- data/assets/icons/move-vertical.svg +1 -0
- data/assets/icons/move.svg +1 -0
- data/assets/icons/music-2.svg +1 -0
- data/assets/icons/music-3.svg +1 -0
- data/assets/icons/music-4.svg +1 -0
- data/assets/icons/music.svg +1 -0
- data/assets/icons/navigation-2-off.svg +1 -0
- data/assets/icons/navigation-2.svg +1 -0
- data/assets/icons/navigation-off.svg +1 -0
- data/assets/icons/navigation.svg +1 -0
- data/assets/icons/network.svg +1 -0
- data/assets/icons/newspaper.svg +1 -0
- data/assets/icons/nfc.svg +1 -0
- data/assets/icons/nut-off.svg +1 -0
- data/assets/icons/nut.svg +1 -0
- data/assets/icons/octagon.svg +1 -0
- data/assets/icons/option.svg +1 -0
- data/assets/icons/outdent.svg +1 -0
- data/assets/icons/package-2.svg +1 -0
- data/assets/icons/package-check.svg +1 -0
- data/assets/icons/package-minus.svg +1 -0
- data/assets/icons/package-open.svg +1 -0
- data/assets/icons/package-plus.svg +1 -0
- data/assets/icons/package-search.svg +1 -0
- data/assets/icons/package-x.svg +1 -0
- data/assets/icons/package.svg +1 -0
- data/assets/icons/paint-bucket.svg +1 -0
- data/assets/icons/paintbrush-2.svg +1 -0
- data/assets/icons/paintbrush.svg +1 -0
- data/assets/icons/palette.svg +1 -0
- data/assets/icons/palmtree.svg +1 -0
- data/assets/icons/paperclip.svg +1 -0
- data/assets/icons/party-popper.svg +1 -0
- data/assets/icons/pause-circle.svg +1 -0
- data/assets/icons/pause-octagon.svg +1 -0
- data/assets/icons/pause.svg +1 -0
- data/assets/icons/pen-tool.svg +1 -0
- data/assets/icons/pencil.svg +1 -0
- data/assets/icons/percent.svg +1 -0
- data/assets/icons/person-standing.svg +1 -0
- data/assets/icons/phone-call.svg +1 -0
- data/assets/icons/phone-forwarded.svg +1 -0
- data/assets/icons/phone-incoming.svg +1 -0
- data/assets/icons/phone-missed.svg +1 -0
- data/assets/icons/phone-off.svg +1 -0
- data/assets/icons/phone-outgoing.svg +1 -0
- data/assets/icons/phone.svg +1 -0
- data/assets/icons/picture-in-picture-2.svg +1 -0
- data/assets/icons/picture-in-picture.svg +1 -0
- data/assets/icons/pie-chart.svg +1 -0
- data/assets/icons/piggy-bank.svg +1 -0
- data/assets/icons/pilcrow.svg +1 -0
- data/assets/icons/pill.svg +1 -0
- data/assets/icons/pin-off.svg +1 -0
- data/assets/icons/pin.svg +1 -0
- data/assets/icons/pipette.svg +1 -0
- data/assets/icons/pizza.svg +1 -0
- data/assets/icons/plane.svg +1 -0
- data/assets/icons/play-circle.svg +1 -0
- data/assets/icons/play.svg +1 -0
- data/assets/icons/plug-2.svg +1 -0
- data/assets/icons/plug-zap.svg +1 -0
- data/assets/icons/plug.svg +1 -0
- data/assets/icons/plus-circle.svg +1 -0
- data/assets/icons/plus-square.svg +1 -0
- data/assets/icons/plus.svg +1 -0
- data/assets/icons/pocket.svg +1 -0
- data/assets/icons/podcast.svg +1 -0
- data/assets/icons/pointer.svg +1 -0
- data/assets/icons/pound-sterling.svg +1 -0
- data/assets/icons/power-off.svg +1 -0
- data/assets/icons/power.svg +1 -0
- data/assets/icons/printer.svg +1 -0
- data/assets/icons/puzzle.svg +1 -0
- data/assets/icons/qr-code.svg +1 -0
- data/assets/icons/quote.svg +1 -0
- data/assets/icons/radio-receiver.svg +1 -0
- data/assets/icons/radio.svg +1 -0
- data/assets/icons/rectangle-horizontal.svg +1 -0
- data/assets/icons/rectangle-vertical.svg +1 -0
- data/assets/icons/recycle.svg +1 -0
- data/assets/icons/redo-2.svg +1 -0
- data/assets/icons/redo.svg +1 -0
- data/assets/icons/refresh-ccw.svg +1 -0
- data/assets/icons/refresh-cw.svg +1 -0
- data/assets/icons/refrigerator.svg +1 -0
- data/assets/icons/regex.svg +1 -0
- data/assets/icons/remove-formatting.svg +1 -0
- data/assets/icons/repeat-1.svg +1 -0
- data/assets/icons/repeat.svg +1 -0
- data/assets/icons/reply-all.svg +1 -0
- data/assets/icons/reply.svg +1 -0
- data/assets/icons/rewind.svg +1 -0
- data/assets/icons/rocket.svg +1 -0
- data/assets/icons/rocking-chair.svg +1 -0
- data/assets/icons/rotate-3d.svg +1 -0
- data/assets/icons/rotate-ccw.svg +1 -0
- data/assets/icons/rotate-cw.svg +1 -0
- data/assets/icons/router.svg +1 -0
- data/assets/icons/rss.svg +1 -0
- data/assets/icons/ruler.svg +1 -0
- data/assets/icons/russian-ruble.svg +1 -0
- data/assets/icons/sailboat.svg +1 -0
- data/assets/icons/salad.svg +1 -0
- data/assets/icons/sandwich.svg +1 -0
- data/assets/icons/save.svg +1 -0
- data/assets/icons/scale-3d.svg +1 -0
- data/assets/icons/scale.svg +1 -0
- data/assets/icons/scaling.svg +1 -0
- data/assets/icons/scan-face.svg +1 -0
- data/assets/icons/scan-line.svg +1 -0
- data/assets/icons/scan.svg +1 -0
- data/assets/icons/scissors.svg +1 -0
- data/assets/icons/screen-share-off.svg +1 -0
- data/assets/icons/screen-share.svg +1 -0
- data/assets/icons/scroll.svg +1 -0
- data/assets/icons/search.svg +1 -0
- data/assets/icons/send.svg +1 -0
- data/assets/icons/separator-horizontal.svg +1 -0
- data/assets/icons/separator-vertical.svg +1 -0
- data/assets/icons/server-cog.svg +1 -0
- data/assets/icons/server-crash.svg +1 -0
- data/assets/icons/server-off.svg +1 -0
- data/assets/icons/server.svg +1 -0
- data/assets/icons/settings-2.svg +1 -0
- data/assets/icons/settings.svg +1 -0
- data/assets/icons/share-2.svg +1 -0
- data/assets/icons/share.svg +1 -0
- data/assets/icons/sheet.svg +1 -0
- data/assets/icons/shield-alert.svg +1 -0
- data/assets/icons/shield-check.svg +1 -0
- data/assets/icons/shield-close.svg +1 -0
- data/assets/icons/shield-off.svg +1 -0
- data/assets/icons/shield.svg +1 -0
- data/assets/icons/ship.svg +1 -0
- data/assets/icons/shirt.svg +1 -0
- data/assets/icons/shopping-bag.svg +1 -0
- data/assets/icons/shopping-cart.svg +1 -0
- data/assets/icons/shovel.svg +1 -0
- data/assets/icons/shower-head.svg +1 -0
- data/assets/icons/shrink.svg +1 -0
- data/assets/icons/shrub.svg +1 -0
- data/assets/icons/shuffle.svg +1 -0
- data/assets/icons/sidebar-close.svg +1 -0
- data/assets/icons/sidebar-open.svg +1 -0
- data/assets/icons/sidebar.svg +1 -0
- data/assets/icons/sigma.svg +1 -0
- data/assets/icons/signal-high.svg +1 -0
- data/assets/icons/signal-low.svg +1 -0
- data/assets/icons/signal-medium.svg +1 -0
- data/assets/icons/signal-zero.svg +1 -0
- data/assets/icons/signal.svg +1 -0
- data/assets/icons/siren.svg +1 -0
- data/assets/icons/skip-back.svg +1 -0
- data/assets/icons/skip-forward.svg +1 -0
- data/assets/icons/skull.svg +1 -0
- data/assets/icons/slack.svg +1 -0
- data/assets/icons/slash.svg +1 -0
- data/assets/icons/slice.svg +1 -0
- data/assets/icons/sliders-horizontal.svg +1 -0
- data/assets/icons/sliders.svg +1 -0
- data/assets/icons/smartphone-charging.svg +1 -0
- data/assets/icons/smartphone-nfc.svg +1 -0
- data/assets/icons/smartphone.svg +1 -0
- data/assets/icons/smile-plus.svg +1 -0
- data/assets/icons/smile.svg +1 -0
- data/assets/icons/snowflake.svg +1 -0
- data/assets/icons/sofa.svg +1 -0
- data/assets/icons/sort-asc.svg +1 -0
- data/assets/icons/sort-desc.svg +1 -0
- data/assets/icons/soup.svg +1 -0
- data/assets/icons/speaker.svg +1 -0
- data/assets/icons/spline.svg +1 -0
- data/assets/icons/split-square-horizontal.svg +1 -0
- data/assets/icons/split-square-vertical.svg +1 -0
- data/assets/icons/sprout.svg +1 -0
- data/assets/icons/square.svg +1 -0
- data/assets/icons/stamp.svg +1 -0
- data/assets/icons/star-half.svg +1 -0
- data/assets/icons/star-off.svg +1 -0
- data/assets/icons/star.svg +1 -0
- data/assets/icons/stethoscope.svg +1 -0
- data/assets/icons/sticker.svg +1 -0
- data/assets/icons/sticky-note.svg +1 -0
- data/assets/icons/stop-circle.svg +1 -0
- data/assets/icons/stretch-horizontal.svg +1 -0
- data/assets/icons/stretch-vertical.svg +1 -0
- data/assets/icons/strikethrough.svg +1 -0
- data/assets/icons/subscript.svg +1 -0
- data/assets/icons/subtitles.svg +1 -0
- data/assets/icons/sun-dim.svg +1 -0
- data/assets/icons/sun-medium.svg +1 -0
- data/assets/icons/sun-moon.svg +1 -0
- data/assets/icons/sun-snow.svg +1 -0
- data/assets/icons/sun.svg +1 -0
- data/assets/icons/sunrise.svg +1 -0
- data/assets/icons/sunset.svg +1 -0
- data/assets/icons/superscript.svg +1 -0
- data/assets/icons/swiss-franc.svg +1 -0
- data/assets/icons/switch-camera.svg +1 -0
- data/assets/icons/sword.svg +1 -0
- data/assets/icons/swords.svg +1 -0
- data/assets/icons/syringe.svg +1 -0
- data/assets/icons/table-2.svg +1 -0
- data/assets/icons/table.svg +1 -0
- data/assets/icons/tablet.svg +1 -0
- data/assets/icons/tablets.svg +1 -0
- data/assets/icons/tag.svg +1 -0
- data/assets/icons/tags.svg +1 -0
- data/assets/icons/target.svg +1 -0
- data/assets/icons/tent.svg +1 -0
- data/assets/icons/terminal-square.svg +1 -0
- data/assets/icons/terminal.svg +1 -0
- data/assets/icons/text-cursor-input.svg +1 -0
- data/assets/icons/text-cursor.svg +1 -0
- data/assets/icons/thermometer-snowflake.svg +1 -0
- data/assets/icons/thermometer-sun.svg +1 -0
- data/assets/icons/thermometer.svg +1 -0
- data/assets/icons/thumbs-down.svg +1 -0
- data/assets/icons/thumbs-up.svg +1 -0
- data/assets/icons/ticket.svg +1 -0
- data/assets/icons/timer-off.svg +1 -0
- data/assets/icons/timer-reset.svg +1 -0
- data/assets/icons/timer.svg +1 -0
- data/assets/icons/toggle-left.svg +1 -0
- data/assets/icons/toggle-right.svg +1 -0
- data/assets/icons/tornado.svg +1 -0
- data/assets/icons/tower-control.svg +1 -0
- data/assets/icons/toy-brick.svg +1 -0
- data/assets/icons/train.svg +1 -0
- data/assets/icons/trash-2.svg +1 -0
- data/assets/icons/trash.svg +1 -0
- data/assets/icons/tree-deciduous.svg +1 -0
- data/assets/icons/tree-pine.svg +1 -0
- data/assets/icons/trees.svg +1 -0
- data/assets/icons/trello.svg +1 -0
- data/assets/icons/trending-down.svg +1 -0
- data/assets/icons/trending-up.svg +1 -0
- data/assets/icons/triangle.svg +1 -0
- data/assets/icons/trophy.svg +1 -0
- data/assets/icons/truck.svg +1 -0
- data/assets/icons/tv-2.svg +1 -0
- data/assets/icons/tv.svg +1 -0
- data/assets/icons/twitch.svg +1 -0
- data/assets/icons/twitter.svg +1 -0
- data/assets/icons/type.svg +1 -0
- data/assets/icons/umbrella.svg +1 -0
- data/assets/icons/underline.svg +1 -0
- data/assets/icons/undo-2.svg +1 -0
- data/assets/icons/undo.svg +1 -0
- data/assets/icons/unlink-2.svg +1 -0
- data/assets/icons/unlink.svg +1 -0
- data/assets/icons/unlock.svg +1 -0
- data/assets/icons/upload-cloud.svg +1 -0
- data/assets/icons/upload.svg +1 -0
- data/assets/icons/usb.svg +1 -0
- data/assets/icons/user-check.svg +1 -0
- data/assets/icons/user-cog.svg +1 -0
- data/assets/icons/user-minus.svg +1 -0
- data/assets/icons/user-plus.svg +1 -0
- data/assets/icons/user-x.svg +1 -0
- data/assets/icons/user.svg +1 -0
- data/assets/icons/users.svg +1 -0
- data/assets/icons/utensils-crossed.svg +1 -0
- data/assets/icons/utensils.svg +1 -0
- data/assets/icons/utility-pole.svg +1 -0
- data/assets/icons/vegan.svg +1 -0
- data/assets/icons/venetian-mask.svg +1 -0
- data/assets/icons/verified.svg +1 -0
- data/assets/icons/vibrate-off.svg +1 -0
- data/assets/icons/vibrate.svg +1 -0
- data/assets/icons/video-off.svg +1 -0
- data/assets/icons/video.svg +1 -0
- data/assets/icons/view.svg +1 -0
- data/assets/icons/voicemail.svg +1 -0
- data/assets/icons/volume-1.svg +1 -0
- data/assets/icons/volume-2.svg +1 -0
- data/assets/icons/volume-x.svg +1 -0
- data/assets/icons/volume.svg +1 -0
- data/assets/icons/vote.svg +1 -0
- data/assets/icons/wallet.svg +1 -0
- data/assets/icons/wand-2.svg +1 -0
- data/assets/icons/wand.svg +1 -0
- data/assets/icons/watch.svg +1 -0
- data/assets/icons/waves.svg +1 -0
- data/assets/icons/webcam.svg +1 -0
- data/assets/icons/webhook.svg +1 -0
- data/assets/icons/wheat-off.svg +1 -0
- data/assets/icons/wheat.svg +1 -0
- data/assets/icons/wifi-off.svg +1 -0
- data/assets/icons/wifi.svg +1 -0
- data/assets/icons/wind.svg +1 -0
- data/assets/icons/wine-off.svg +1 -0
- data/assets/icons/wine.svg +1 -0
- data/assets/icons/wrap-text.svg +1 -0
- data/assets/icons/wrench.svg +1 -0
- data/assets/icons/x-circle.svg +1 -0
- data/assets/icons/x-octagon.svg +1 -0
- data/assets/icons/x-square.svg +1 -0
- data/assets/icons/x.svg +1 -0
- data/assets/icons/youtube.svg +1 -0
- data/assets/icons/zap-off.svg +1 -0
- data/assets/icons/zap.svg +1 -0
- data/assets/icons/zoom-in.svg +1 -0
- data/assets/icons/zoom-out.svg +1 -0
- data/assets/img/favicon_dark.svg +1 -0
- data/assets/img/favicon_light.svg +1 -0
- data/assets/js/app.js +121 -0
- data/assets/js/components/clipboard.js +47 -0
- data/assets/js/components/params_input.js +23 -0
- data/assets/js/components/tooltip.js +30 -0
- data/assets/js/config.js +24 -0
- data/assets/js/helpers/build.js +22 -0
- data/assets/js/helpers/dom.js +42 -0
- data/assets/js/helpers/layout.js +21 -0
- data/assets/js/helpers/request.js +14 -0
- data/assets/js/helpers/string.js +26 -0
- data/assets/js/iframe.js +1 -0
- data/assets/js/index.js +61 -0
- data/assets/js/lib/lookbook.js +125 -0
- data/assets/js/lib/socket.js +28 -0
- data/assets/js/lib/tippy.js +9 -0
- data/assets/js/lookbook-core.js +1 -0
- data/assets/js/lookbook.js +2 -0
- data/assets/js/plugins/logger.js +39 -0
- data/assets/js/stores/filter.js +11 -0
- data/assets/js/stores/inspector.js +31 -0
- data/assets/js/stores/layout.js +111 -0
- data/assets/js/stores/nav.js +22 -0
- data/assets/js/stores/pages.js +7 -0
- data/assets/js/stores/settings.js +7 -0
- data/assets/js/stores/workbench.js +29 -0
- data/config/app.yml +79 -0
- data/config/inputs.yml +48 -0
- data/config/languages.yml +41 -0
- data/config/panels.yml +28 -0
- data/config/routes.rb +22 -0
- data/config/tags.yml +44 -0
- data/lib/gitlab-lookbook.rb +6 -0
- data/lib/lookbook/cable/cable.rb +53 -0
- data/lib/lookbook/cable/connection.rb +11 -0
- data/lib/lookbook/cable/reload_channel.rb +7 -0
- data/lib/lookbook/engine.rb +295 -0
- data/lib/lookbook/entities/collections/concerns/hierarchical_collection.rb +28 -0
- data/lib/lookbook/entities/collections/entity_collection.rb +66 -0
- data/lib/lookbook/entities/collections/page_collection.rb +57 -0
- data/lib/lookbook/entities/collections/preview_collection.rb +75 -0
- data/lib/lookbook/entities/collections/render_target_collection.rb +4 -0
- data/lib/lookbook/entities/collections/scenario_collection.rb +4 -0
- data/lib/lookbook/entities/concerns/annotatable_entity.rb +84 -0
- data/lib/lookbook/entities/concerns/inspectable_entity.rb +60 -0
- data/lib/lookbook/entities/concerns/locatable_entity.rb +116 -0
- data/lib/lookbook/entities/concerns/navigable_entity.rb +62 -0
- data/lib/lookbook/entities/entity.rb +84 -0
- data/lib/lookbook/entities/page_entity.rb +142 -0
- data/lib/lookbook/entities/page_section_entity.rb +47 -0
- data/lib/lookbook/entities/preview_entity.rb +214 -0
- data/lib/lookbook/entities/renderable_entity.rb +101 -0
- data/lib/lookbook/entities/rendered_scenario_entity.rb +69 -0
- data/lib/lookbook/entities/scenario_entity.rb +182 -0
- data/lib/lookbook/entities/scenario_group_entity.rb +135 -0
- data/lib/lookbook/file_watcher.rb +25 -0
- data/lib/lookbook/helpers/class_names_helper.rb +28 -0
- data/lib/lookbook/helpers/page_helper.rb +43 -0
- data/lib/lookbook/helpers/preview_helper.rb +14 -0
- data/lib/lookbook/helpers/ui_elements_helper.rb +91 -0
- data/lib/lookbook/lang.rb +24 -0
- data/lib/lookbook/param.rb +105 -0
- data/lib/lookbook/preview.rb +85 -0
- data/lib/lookbook/preview_after_render.rb +13 -0
- data/lib/lookbook/preview_controller_actions.rb +69 -0
- data/lib/lookbook/preview_parser.rb +53 -0
- data/lib/lookbook/reloaders.rb +75 -0
- data/lib/lookbook/runtime_context.rb +49 -0
- data/lib/lookbook/services/code/code_beautifier.rb +21 -0
- data/lib/lookbook/services/code/code_highlighter.rb +69 -0
- data/lib/lookbook/services/code/code_indenter.rb +14 -0
- data/lib/lookbook/services/config_loader.rb +20 -0
- data/lib/lookbook/services/data/parsers/data_parser.rb +22 -0
- data/lib/lookbook/services/data/parsers/json_parser.rb +7 -0
- data/lib/lookbook/services/data/parsers/yaml_parser.rb +7 -0
- data/lib/lookbook/services/data/resolvers/data_resolver.rb +68 -0
- data/lib/lookbook/services/data/resolvers/eval_resolver.rb +10 -0
- data/lib/lookbook/services/data/resolvers/file_resolver.rb +28 -0
- data/lib/lookbook/services/data/resolvers/method_resolver.rb +10 -0
- data/lib/lookbook/services/data/resolvers/yaml_resolver.rb +18 -0
- data/lib/lookbook/services/entities/page_tree_builder.rb +40 -0
- data/lib/lookbook/services/entities/preview_tree_builder.rb +34 -0
- data/lib/lookbook/services/list_resolver.rb +35 -0
- data/lib/lookbook/services/markdown_renderer.rb +41 -0
- data/lib/lookbook/services/priority_prefix_parser.rb +16 -0
- data/lib/lookbook/services/string_value_caster.rb +64 -0
- data/lib/lookbook/services/tags/key_value_tag_parser.rb +24 -0
- data/lib/lookbook/services/tags/tag_options_parser.rb +71 -0
- data/lib/lookbook/services/templates/action_view_annotations_stripper.rb +15 -0
- data/lib/lookbook/services/templates/action_view_config_handler.rb +50 -0
- data/lib/lookbook/services/templates/frontmatter_extractor.rb +28 -0
- data/lib/lookbook/services/templates/styles_extractor.rb +38 -0
- data/lib/lookbook/services/urls/data_uri_encoder.rb +14 -0
- data/lib/lookbook/services/urls/file_data_uri_encoder.rb +24 -0
- data/lib/lookbook/services/urls/search_param_encoder.rb +16 -0
- data/lib/lookbook/services/urls/search_param_parser.rb +16 -0
- data/lib/lookbook/stores/config_store.rb +124 -0
- data/lib/lookbook/stores/hook_store.rb +18 -0
- data/lib/lookbook/stores/input_store.rb +66 -0
- data/lib/lookbook/stores/panel_store.rb +122 -0
- data/lib/lookbook/stores/tag_store.rb +45 -0
- data/lib/lookbook/support/deprecation.rb +5 -0
- data/lib/lookbook/support/errors/config_error.rb +7 -0
- data/lib/lookbook/support/errors/error.rb +64 -0
- data/lib/lookbook/support/errors/parser_error.rb +7 -0
- data/lib/lookbook/support/errors/preview_template_error.rb +7 -0
- data/lib/lookbook/support/errors/routing_error.rb +7 -0
- data/lib/lookbook/support/errors/template_error.rb +7 -0
- data/lib/lookbook/support/evented_file_update_checker.rb +69 -0
- data/lib/lookbook/support/null_object.rb +10 -0
- data/lib/lookbook/support/null_websocket.rb +9 -0
- data/lib/lookbook/support/service.rb +7 -0
- data/lib/lookbook/support/store.rb +53 -0
- data/lib/lookbook/support/tree_node.rb +87 -0
- data/lib/lookbook/support/utils/path_utils.rb +52 -0
- data/lib/lookbook/support/utils/utils.rb +32 -0
- data/lib/lookbook/support/utils/where.rb +49 -0
- data/lib/lookbook/tags/after_render_tag.rb +7 -0
- data/lib/lookbook/tags/custom_tag.rb +61 -0
- data/lib/lookbook/tags/display_tag.rb +15 -0
- data/lib/lookbook/tags/hidden_tag.rb +13 -0
- data/lib/lookbook/tags/id_tag.rb +7 -0
- data/lib/lookbook/tags/label_tag.rb +4 -0
- data/lib/lookbook/tags/logical_path_tag.rb +7 -0
- data/lib/lookbook/tags/param_tag.rb +76 -0
- data/lib/lookbook/tags/priority_tag.rb +16 -0
- data/lib/lookbook/tags/renders_tag.rb +4 -0
- data/lib/lookbook/tags/source_tag.rb +7 -0
- data/lib/lookbook/tags/tag_provider.rb +21 -0
- data/lib/lookbook/tags/type_tag.rb +7 -0
- data/lib/lookbook/tags/yard_tag.rb +94 -0
- data/lib/lookbook/theme.rb +62 -0
- data/lib/lookbook/version.rb +3 -0
- data/lib/lookbook/websocket.rb +13 -0
- data/lib/lookbook.rb +244 -0
- data/public/lookbook-assets/Inter-italic.var.53a0de5f.woff2 +0 -0
- data/public/lookbook-assets/Inter-italic.var.69eb0fe1.woff2 +0 -0
- data/public/lookbook-assets/Inter-italic.var.736a7044.woff2 +0 -0
- data/public/lookbook-assets/Inter-roman.var.b695afbe.woff2 +0 -0
- data/public/lookbook-assets/Inter-roman.var.d4f9805a.woff2 +0 -0
- data/public/lookbook-assets/Inter-roman.var.fbdd51d0.woff2 +0 -0
- data/public/lookbook-assets/SourceCodeVariable-Italic.cad97b83.otf +0 -0
- data/public/lookbook-assets/SourceCodeVariable-Italic.ttf.09b4354a.woff2 +0 -0
- data/public/lookbook-assets/SourceCodeVariable-Italic.ttf.a93fa22f.woff2 +0 -0
- data/public/lookbook-assets/SourceCodeVariable-Italic.ttf.fcd7e9f4.woff2 +0 -0
- data/public/lookbook-assets/SourceCodeVariable-Roman.185ddb17.otf +0 -0
- data/public/lookbook-assets/SourceCodeVariable-Roman.ttf.118e9f22.woff2 +0 -0
- data/public/lookbook-assets/SourceCodeVariable-Roman.ttf.91043609.woff2 +0 -0
- data/public/lookbook-assets/SourceCodeVariable-Roman.ttf.f1c8fcce.woff2 +0 -0
- data/public/lookbook-assets/css/lookbook.css +4374 -0
- data/public/lookbook-assets/css/lookbook.css.map +1 -0
- data/public/lookbook-assets/css/themes/blue.css +80 -0
- data/public/lookbook-assets/css/themes/blue.css.map +1 -0
- data/public/lookbook-assets/css/themes/green.css +80 -0
- data/public/lookbook-assets/css/themes/green.css.map +1 -0
- data/public/lookbook-assets/css/themes/indigo.css +80 -0
- data/public/lookbook-assets/css/themes/indigo.css.map +1 -0
- data/public/lookbook-assets/css/themes/rose.css +80 -0
- data/public/lookbook-assets/css/themes/rose.css.map +1 -0
- data/public/lookbook-assets/css/themes/zinc.css +80 -0
- data/public/lookbook-assets/css/themes/zinc.css.map +1 -0
- data/public/lookbook-assets/img/lucide-sprite.svg +4960 -0
- data/public/lookbook-assets/js/iframe.js +916 -0
- data/public/lookbook-assets/js/iframe.js.map +1 -0
- data/public/lookbook-assets/js/index.js +13909 -0
- data/public/lookbook-assets/js/index.js.map +1 -0
- data/public/lookbook-assets/js/lookbook-core.js +87 -0
- data/public/lookbook-assets/js/lookbook.js +945 -0
- metadata +1434 -0
|
@@ -0,0 +1,945 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
var $5180433265c858be$exports = {};
|
|
3
|
+
/*
|
|
4
|
+
* File: iframeResizer.js
|
|
5
|
+
* Desc: Force iframes to size to content.
|
|
6
|
+
* Requires: iframeResizer.contentWindow.js to be loaded into the target frame.
|
|
7
|
+
* Doc: https://iframe-resizer.com
|
|
8
|
+
* Author: David J. Bradshaw - info@iframe-resizer.com
|
|
9
|
+
*/ console.info(`
|
|
10
|
+
IFRAME-RESIZER
|
|
11
|
+
|
|
12
|
+
Iframe-Resizer 5 is now available via the following two packages:
|
|
13
|
+
|
|
14
|
+
* @iframe-resizer/parent
|
|
15
|
+
* @iframe-resizer/child
|
|
16
|
+
|
|
17
|
+
Additionally their are also new versions of iframe-resizer for React, Vue, and jQuery.
|
|
18
|
+
|
|
19
|
+
Version 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.
|
|
20
|
+
|
|
21
|
+
Please see https://iframe-resizer.com/upgrade for more details.
|
|
22
|
+
`);
|
|
23
|
+
(function(undefined) {
|
|
24
|
+
if (typeof window === 'undefined') return; // don't run for server side render
|
|
25
|
+
// var VERSION = '4.3.11'
|
|
26
|
+
var count = 0, destroyObserver, logEnabled = false, hiddenCheckEnabled = false, msgHeader = 'message', msgHeaderLen = msgHeader.length, msgId = '[iFrameSizer]', msgIdLen = msgId.length, pagePosition = null, requestAnimationFrame = window.requestAnimationFrame, resetRequiredMethods = Object.freeze({
|
|
27
|
+
max: 1,
|
|
28
|
+
scroll: 1,
|
|
29
|
+
bodyScroll: 1,
|
|
30
|
+
documentElementScroll: 1
|
|
31
|
+
}), settings = {}, timer = null, defaults = Object.freeze({
|
|
32
|
+
autoResize: true,
|
|
33
|
+
bodyBackground: null,
|
|
34
|
+
bodyMargin: null,
|
|
35
|
+
bodyMarginV1: 8,
|
|
36
|
+
bodyPadding: null,
|
|
37
|
+
checkOrigin: true,
|
|
38
|
+
inPageLinks: false,
|
|
39
|
+
enablePublicMethods: true,
|
|
40
|
+
heightCalculationMethod: 'bodyOffset',
|
|
41
|
+
id: 'iFrameResizer',
|
|
42
|
+
interval: 32,
|
|
43
|
+
license: '1jqr0si6pnt',
|
|
44
|
+
log: false,
|
|
45
|
+
maxHeight: Infinity,
|
|
46
|
+
maxWidth: Infinity,
|
|
47
|
+
minHeight: 0,
|
|
48
|
+
minWidth: 0,
|
|
49
|
+
mouseEvents: true,
|
|
50
|
+
resizeFrom: 'parent',
|
|
51
|
+
scrolling: false,
|
|
52
|
+
sizeHeight: true,
|
|
53
|
+
sizeWidth: false,
|
|
54
|
+
warningTimeout: 5000,
|
|
55
|
+
tolerance: 0,
|
|
56
|
+
widthCalculationMethod: 'scroll',
|
|
57
|
+
onClose: function() {
|
|
58
|
+
return true;
|
|
59
|
+
},
|
|
60
|
+
onClosed: function() {},
|
|
61
|
+
onInit: function() {},
|
|
62
|
+
onMessage: function() {
|
|
63
|
+
warn('onMessage function not defined');
|
|
64
|
+
},
|
|
65
|
+
onMouseEnter: function() {},
|
|
66
|
+
onMouseLeave: function() {},
|
|
67
|
+
onResized: function() {},
|
|
68
|
+
onScroll: function() {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
function getMutationObserver() {
|
|
73
|
+
return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
|
|
74
|
+
}
|
|
75
|
+
function addEventListener(el, evt, func) {
|
|
76
|
+
el.addEventListener(evt, func, false);
|
|
77
|
+
}
|
|
78
|
+
function removeEventListener(el, evt, func) {
|
|
79
|
+
el.removeEventListener(evt, func, false);
|
|
80
|
+
}
|
|
81
|
+
function setupRequestAnimationFrame() {
|
|
82
|
+
var vendors = [
|
|
83
|
+
'moz',
|
|
84
|
+
'webkit',
|
|
85
|
+
'o',
|
|
86
|
+
'ms'
|
|
87
|
+
];
|
|
88
|
+
var x;
|
|
89
|
+
// Remove vendor prefixing if prefixed and break early if not
|
|
90
|
+
for(x = 0; x < vendors.length && !requestAnimationFrame; x += 1)requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
|
|
91
|
+
if (requestAnimationFrame) // Firefox extension content-scripts have a globalThis object that is not the same as window.
|
|
92
|
+
// Binding `requestAnimationFrame` to window allows the function to work and prevents errors
|
|
93
|
+
// being thrown when run in that context, and should be a no-op in every other context.
|
|
94
|
+
requestAnimationFrame = requestAnimationFrame.bind(window);
|
|
95
|
+
else log('setup', 'RequestAnimationFrame not supported');
|
|
96
|
+
}
|
|
97
|
+
function getMyID(iframeId) {
|
|
98
|
+
var retStr = 'Host page: ' + iframeId;
|
|
99
|
+
if (window.top !== window.self) retStr = window.parentIFrame && window.parentIFrame.getId ? window.parentIFrame.getId() + ': ' + iframeId : 'Nested host page: ' + iframeId;
|
|
100
|
+
return retStr;
|
|
101
|
+
}
|
|
102
|
+
function formatLogHeader(iframeId) {
|
|
103
|
+
return msgId + '[' + getMyID(iframeId) + ']';
|
|
104
|
+
}
|
|
105
|
+
function isLogEnabled(iframeId) {
|
|
106
|
+
return settings[iframeId] ? settings[iframeId].log : logEnabled;
|
|
107
|
+
}
|
|
108
|
+
function log(iframeId, msg) {
|
|
109
|
+
output('log', iframeId, msg, isLogEnabled(iframeId));
|
|
110
|
+
}
|
|
111
|
+
function info(iframeId, msg) {
|
|
112
|
+
output('info', iframeId, msg, isLogEnabled(iframeId));
|
|
113
|
+
}
|
|
114
|
+
function warn(iframeId, msg) {
|
|
115
|
+
output('warn', iframeId, msg, true);
|
|
116
|
+
}
|
|
117
|
+
function output(type, iframeId, msg, enabled) {
|
|
118
|
+
if (true === enabled && 'object' === typeof window.console) // eslint-disable-next-line no-console
|
|
119
|
+
console[type](formatLogHeader(iframeId), msg);
|
|
120
|
+
}
|
|
121
|
+
function iFrameListener(event) {
|
|
122
|
+
function resizeIFrame() {
|
|
123
|
+
function resize() {
|
|
124
|
+
setSize(messageData);
|
|
125
|
+
setPagePosition(iframeId);
|
|
126
|
+
on('onResized', messageData);
|
|
127
|
+
}
|
|
128
|
+
ensureInRange('Height');
|
|
129
|
+
ensureInRange('Width');
|
|
130
|
+
syncResize(resize, messageData, 'init');
|
|
131
|
+
}
|
|
132
|
+
function processMsg() {
|
|
133
|
+
var data = msg.slice(msgIdLen).split(':');
|
|
134
|
+
var height = data[1] ? parseInt(data[1], 10) : 0;
|
|
135
|
+
var iframe = settings[data[0]] && settings[data[0]].iframe;
|
|
136
|
+
var compStyle = getComputedStyle(iframe);
|
|
137
|
+
return {
|
|
138
|
+
iframe: iframe,
|
|
139
|
+
id: data[0],
|
|
140
|
+
height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),
|
|
141
|
+
width: data[2],
|
|
142
|
+
type: data[3]
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function getPaddingEnds(compStyle) {
|
|
146
|
+
if (compStyle.boxSizing !== 'border-box') return 0;
|
|
147
|
+
var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
|
|
148
|
+
var bot = compStyle.paddingBottom ? parseInt(compStyle.paddingBottom, 10) : 0;
|
|
149
|
+
return top + bot;
|
|
150
|
+
}
|
|
151
|
+
function getBorderEnds(compStyle) {
|
|
152
|
+
if (compStyle.boxSizing !== 'border-box') return 0;
|
|
153
|
+
var top = compStyle.borderTopWidth ? parseInt(compStyle.borderTopWidth, 10) : 0;
|
|
154
|
+
var bot = compStyle.borderBottomWidth ? parseInt(compStyle.borderBottomWidth, 10) : 0;
|
|
155
|
+
return top + bot;
|
|
156
|
+
}
|
|
157
|
+
function ensureInRange(Dimension) {
|
|
158
|
+
var max = Number(settings[iframeId]['max' + Dimension]), min = Number(settings[iframeId]['min' + Dimension]), dimension = Dimension.toLowerCase(), size = Number(messageData[dimension]);
|
|
159
|
+
log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max);
|
|
160
|
+
if (size < min) {
|
|
161
|
+
size = min;
|
|
162
|
+
log(iframeId, 'Set ' + dimension + ' to min value');
|
|
163
|
+
}
|
|
164
|
+
if (size > max) {
|
|
165
|
+
size = max;
|
|
166
|
+
log(iframeId, 'Set ' + dimension + ' to max value');
|
|
167
|
+
}
|
|
168
|
+
messageData[dimension] = '' + size;
|
|
169
|
+
}
|
|
170
|
+
function isMessageFromIFrame() {
|
|
171
|
+
function checkAllowedOrigin() {
|
|
172
|
+
function checkList() {
|
|
173
|
+
var i = 0, retCode = false;
|
|
174
|
+
log(iframeId, 'Checking connection is from allowed list of origins: ' + checkOrigin);
|
|
175
|
+
for(; i < checkOrigin.length; i++)if (checkOrigin[i] === origin) {
|
|
176
|
+
retCode = true;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
return retCode;
|
|
180
|
+
}
|
|
181
|
+
function checkSingle() {
|
|
182
|
+
var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
|
|
183
|
+
log(iframeId, 'Checking connection is from: ' + remoteHost);
|
|
184
|
+
return origin === remoteHost;
|
|
185
|
+
}
|
|
186
|
+
return checkOrigin.constructor === Array ? checkList() : checkSingle();
|
|
187
|
+
}
|
|
188
|
+
var origin = event.origin, checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
|
|
189
|
+
if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) throw new Error('Unexpected message received from: ' + origin + ' for ' + messageData.iframe.id + '. Message was: ' + event.data + '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.');
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
function isMessageForUs() {
|
|
193
|
+
return msgId === ('' + msg).slice(0, msgIdLen) && msg.slice(msgIdLen).split(':')[0] in settings // ''+Protects against non-string msg
|
|
194
|
+
;
|
|
195
|
+
}
|
|
196
|
+
function isMessageFromMetaParent() {
|
|
197
|
+
// Test if this message is from a parent above us. This is an ugly test, however, updating
|
|
198
|
+
// the message format would break backwards compatibility.
|
|
199
|
+
var retCode = messageData.type in {
|
|
200
|
+
true: 1,
|
|
201
|
+
false: 1,
|
|
202
|
+
undefined: 1
|
|
203
|
+
};
|
|
204
|
+
if (retCode) log(iframeId, 'Ignoring init message from meta parent page');
|
|
205
|
+
return retCode;
|
|
206
|
+
}
|
|
207
|
+
function getMsgBody(offset) {
|
|
208
|
+
return msg.slice(msg.indexOf(':') + msgHeaderLen + offset);
|
|
209
|
+
}
|
|
210
|
+
function forwardMsgFromIFrame(msgBody) {
|
|
211
|
+
log(iframeId, 'onMessage passed: {iframe: ' + messageData.iframe.id + ', message: ' + msgBody + '}');
|
|
212
|
+
on('onMessage', {
|
|
213
|
+
iframe: messageData.iframe,
|
|
214
|
+
message: JSON.parse(msgBody)
|
|
215
|
+
});
|
|
216
|
+
log(iframeId, '--');
|
|
217
|
+
}
|
|
218
|
+
function getPageInfo() {
|
|
219
|
+
var bodyPosition = document.body.getBoundingClientRect(), iFramePosition = messageData.iframe.getBoundingClientRect();
|
|
220
|
+
return JSON.stringify({
|
|
221
|
+
iframeHeight: iFramePosition.height,
|
|
222
|
+
iframeWidth: iFramePosition.width,
|
|
223
|
+
clientHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
|
|
224
|
+
clientWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
|
|
225
|
+
offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
|
|
226
|
+
offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
|
|
227
|
+
scrollTop: window.pageYOffset,
|
|
228
|
+
scrollLeft: window.pageXOffset,
|
|
229
|
+
documentHeight: document.documentElement.clientHeight,
|
|
230
|
+
documentWidth: document.documentElement.clientWidth,
|
|
231
|
+
windowHeight: window.innerHeight,
|
|
232
|
+
windowWidth: window.innerWidth
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function sendPageInfoToIframe(iframe, iframeId) {
|
|
236
|
+
function debouncedTrigger() {
|
|
237
|
+
trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
|
|
238
|
+
}
|
|
239
|
+
debounceFrameEvents(debouncedTrigger, 32, iframeId);
|
|
240
|
+
}
|
|
241
|
+
function startPageInfoMonitor() {
|
|
242
|
+
function setListener(type, func) {
|
|
243
|
+
function sendPageInfo() {
|
|
244
|
+
if (settings[id]) sendPageInfoToIframe(settings[id].iframe, id);
|
|
245
|
+
else stop();
|
|
246
|
+
}
|
|
247
|
+
[
|
|
248
|
+
'scroll',
|
|
249
|
+
'resize'
|
|
250
|
+
].forEach(function(evt) {
|
|
251
|
+
log(id, type + evt + ' listener for sendPageInfo');
|
|
252
|
+
func(window, evt, sendPageInfo);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function stop() {
|
|
256
|
+
setListener('Remove ', removeEventListener);
|
|
257
|
+
}
|
|
258
|
+
function start() {
|
|
259
|
+
setListener('Add ', addEventListener);
|
|
260
|
+
}
|
|
261
|
+
var id = iframeId // Create locally scoped copy of iFrame ID
|
|
262
|
+
;
|
|
263
|
+
start();
|
|
264
|
+
if (settings[id]) settings[id].stopPageInfo = stop;
|
|
265
|
+
}
|
|
266
|
+
function stopPageInfoMonitor() {
|
|
267
|
+
if (settings[iframeId] && settings[iframeId].stopPageInfo) {
|
|
268
|
+
settings[iframeId].stopPageInfo();
|
|
269
|
+
delete settings[iframeId].stopPageInfo;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function checkIFrameExists() {
|
|
273
|
+
var retBool = true;
|
|
274
|
+
if (null === messageData.iframe) {
|
|
275
|
+
warn(iframeId, 'IFrame (' + messageData.id + ') not found');
|
|
276
|
+
retBool = false;
|
|
277
|
+
}
|
|
278
|
+
return retBool;
|
|
279
|
+
}
|
|
280
|
+
function getElementPosition(target) {
|
|
281
|
+
var iFramePosition = target.getBoundingClientRect();
|
|
282
|
+
getPagePosition(iframeId);
|
|
283
|
+
return {
|
|
284
|
+
x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),
|
|
285
|
+
y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function scrollRequestFromChild(addOffset) {
|
|
289
|
+
/* istanbul ignore next */ // Not testable in Karma
|
|
290
|
+
function reposition() {
|
|
291
|
+
pagePosition = newPosition;
|
|
292
|
+
scrollTo();
|
|
293
|
+
log(iframeId, '--');
|
|
294
|
+
}
|
|
295
|
+
function calcOffset() {
|
|
296
|
+
return {
|
|
297
|
+
x: Number(messageData.width) + offset.x,
|
|
298
|
+
y: Number(messageData.height) + offset.y
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function scrollParent() {
|
|
302
|
+
if (window.parentIFrame) window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](newPosition.x, newPosition.y);
|
|
303
|
+
else warn(iframeId, 'Unable to scroll to requested position, window.parentIFrame not found');
|
|
304
|
+
}
|
|
305
|
+
var offset = addOffset ? getElementPosition(messageData.iframe) : {
|
|
306
|
+
x: 0,
|
|
307
|
+
y: 0
|
|
308
|
+
}, newPosition = calcOffset();
|
|
309
|
+
log(iframeId, 'Reposition requested from iFrame (offset x:' + offset.x + ' y:' + offset.y + ')');
|
|
310
|
+
if (window.top === window.self) reposition();
|
|
311
|
+
else scrollParent();
|
|
312
|
+
}
|
|
313
|
+
function scrollTo() {
|
|
314
|
+
if (false === on('onScroll', pagePosition)) unsetPagePosition();
|
|
315
|
+
else setPagePosition(iframeId);
|
|
316
|
+
}
|
|
317
|
+
function findTarget(location) {
|
|
318
|
+
function jumpToTarget() {
|
|
319
|
+
var jumpPosition = getElementPosition(target);
|
|
320
|
+
log(iframeId, 'Moving to in page link (#' + hash + ') at x: ' + jumpPosition.x + ' y: ' + jumpPosition.y);
|
|
321
|
+
pagePosition = {
|
|
322
|
+
x: jumpPosition.x,
|
|
323
|
+
y: jumpPosition.y
|
|
324
|
+
};
|
|
325
|
+
scrollTo();
|
|
326
|
+
log(iframeId, '--');
|
|
327
|
+
}
|
|
328
|
+
function jumpToParent() {
|
|
329
|
+
if (window.parentIFrame) window.parentIFrame.moveToAnchor(hash);
|
|
330
|
+
else log(iframeId, 'In page link #' + hash + ' not found and window.parentIFrame not found');
|
|
331
|
+
}
|
|
332
|
+
var hash = location.split('#')[1] || '', hashData = decodeURIComponent(hash), target = document.getElementById(hashData) || document.getElementsByName(hashData)[0];
|
|
333
|
+
if (target) jumpToTarget();
|
|
334
|
+
else if (window.top === window.self) log(iframeId, 'In page link #' + hash + ' not found');
|
|
335
|
+
else jumpToParent();
|
|
336
|
+
}
|
|
337
|
+
function onMouse(event) {
|
|
338
|
+
var mousePos = {};
|
|
339
|
+
if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
|
|
340
|
+
var data = getMsgBody(9).split(':');
|
|
341
|
+
mousePos = {
|
|
342
|
+
x: data[1],
|
|
343
|
+
y: data[0]
|
|
344
|
+
};
|
|
345
|
+
} else mousePos = {
|
|
346
|
+
x: messageData.width,
|
|
347
|
+
y: messageData.height
|
|
348
|
+
};
|
|
349
|
+
on(event, {
|
|
350
|
+
iframe: messageData.iframe,
|
|
351
|
+
screenX: Number(mousePos.x),
|
|
352
|
+
screenY: Number(mousePos.y),
|
|
353
|
+
type: messageData.type
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
function on(funcName, val) {
|
|
357
|
+
return chkEvent(iframeId, funcName, val);
|
|
358
|
+
}
|
|
359
|
+
function actionMsg() {
|
|
360
|
+
if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
|
|
361
|
+
switch(messageData.type){
|
|
362
|
+
case 'close':
|
|
363
|
+
closeIFrame(messageData.iframe);
|
|
364
|
+
break;
|
|
365
|
+
case 'message':
|
|
366
|
+
forwardMsgFromIFrame(getMsgBody(6));
|
|
367
|
+
break;
|
|
368
|
+
case 'mouseenter':
|
|
369
|
+
onMouse('onMouseEnter');
|
|
370
|
+
break;
|
|
371
|
+
case 'mouseleave':
|
|
372
|
+
onMouse('onMouseLeave');
|
|
373
|
+
break;
|
|
374
|
+
case 'autoResize':
|
|
375
|
+
settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
|
|
376
|
+
break;
|
|
377
|
+
case 'scrollTo':
|
|
378
|
+
scrollRequestFromChild(false);
|
|
379
|
+
break;
|
|
380
|
+
case 'scrollToOffset':
|
|
381
|
+
scrollRequestFromChild(true);
|
|
382
|
+
break;
|
|
383
|
+
case 'pageInfo':
|
|
384
|
+
sendPageInfoToIframe(settings[iframeId] && settings[iframeId].iframe, iframeId);
|
|
385
|
+
startPageInfoMonitor();
|
|
386
|
+
break;
|
|
387
|
+
case 'pageInfoStop':
|
|
388
|
+
stopPageInfoMonitor();
|
|
389
|
+
break;
|
|
390
|
+
case 'inPageLink':
|
|
391
|
+
findTarget(getMsgBody(9));
|
|
392
|
+
break;
|
|
393
|
+
case 'reset':
|
|
394
|
+
resetIFrame(messageData);
|
|
395
|
+
break;
|
|
396
|
+
case 'init':
|
|
397
|
+
resizeIFrame();
|
|
398
|
+
on('onInit', messageData.iframe);
|
|
399
|
+
break;
|
|
400
|
+
default:
|
|
401
|
+
if (Number(messageData.width) === 0 && Number(messageData.height) === 0) warn('Unsupported message received (' + messageData.type + '), this is likely due to the iframe containing a later ' + 'version of iframe-resizer than the parent page');
|
|
402
|
+
else resizeIFrame();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function hasSettings(iframeId) {
|
|
406
|
+
var retBool = true;
|
|
407
|
+
if (!settings[iframeId]) {
|
|
408
|
+
retBool = false;
|
|
409
|
+
warn(messageData.type + ' No settings for ' + iframeId + '. Message was: ' + msg);
|
|
410
|
+
}
|
|
411
|
+
return retBool;
|
|
412
|
+
}
|
|
413
|
+
function iFrameReadyMsgReceived() {
|
|
414
|
+
// eslint-disable-next-line no-restricted-syntax, guard-for-in
|
|
415
|
+
for(var iframeId in settings)trigger('iFrame requested init', createOutgoingMsg(iframeId), settings[iframeId].iframe, iframeId);
|
|
416
|
+
}
|
|
417
|
+
function firstRun() {
|
|
418
|
+
if (settings[iframeId]) settings[iframeId].firstRun = false;
|
|
419
|
+
}
|
|
420
|
+
var msg = event.data, messageData = {}, iframeId = null;
|
|
421
|
+
if ('[iFrameResizerChild]Ready' === msg) iFrameReadyMsgReceived();
|
|
422
|
+
else if (isMessageForUs()) {
|
|
423
|
+
messageData = processMsg();
|
|
424
|
+
iframeId = messageData.id;
|
|
425
|
+
if (settings[iframeId]) settings[iframeId].loaded = true;
|
|
426
|
+
if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
|
|
427
|
+
log(iframeId, 'Received: ' + msg);
|
|
428
|
+
if (checkIFrameExists() && isMessageFromIFrame()) actionMsg();
|
|
429
|
+
}
|
|
430
|
+
} else info(iframeId, 'Ignored: ' + msg);
|
|
431
|
+
}
|
|
432
|
+
function chkEvent(iframeId, funcName, val) {
|
|
433
|
+
var func = null, retVal = null;
|
|
434
|
+
if (settings[iframeId]) {
|
|
435
|
+
func = settings[iframeId][funcName];
|
|
436
|
+
if ('function' === typeof func) retVal = func(val);
|
|
437
|
+
else throw new TypeError(funcName + ' on iFrame[' + iframeId + '] is not a function');
|
|
438
|
+
}
|
|
439
|
+
return retVal;
|
|
440
|
+
}
|
|
441
|
+
function removeIframeListeners(iframe) {
|
|
442
|
+
var iframeId = iframe.id;
|
|
443
|
+
delete settings[iframeId];
|
|
444
|
+
}
|
|
445
|
+
function closeIFrame(iframe) {
|
|
446
|
+
var iframeId = iframe.id;
|
|
447
|
+
if (chkEvent(iframeId, 'onClose', iframeId) === false) {
|
|
448
|
+
log(iframeId, 'Close iframe cancelled by onClose event');
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
log(iframeId, 'Removing iFrame: ' + iframeId);
|
|
452
|
+
try {
|
|
453
|
+
// Catch race condition error with React
|
|
454
|
+
if (iframe.parentNode) iframe.parentNode.removeChild(iframe);
|
|
455
|
+
} catch (error) {
|
|
456
|
+
warn(error);
|
|
457
|
+
}
|
|
458
|
+
chkEvent(iframeId, 'onClosed', iframeId);
|
|
459
|
+
log(iframeId, '--');
|
|
460
|
+
removeIframeListeners(iframe);
|
|
461
|
+
if (destroyObserver) {
|
|
462
|
+
destroyObserver.disconnect();
|
|
463
|
+
destroyObserver = null;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
function getPagePosition(iframeId) {
|
|
467
|
+
if (null === pagePosition) {
|
|
468
|
+
pagePosition = {
|
|
469
|
+
x: window.pageXOffset === undefined ? document.documentElement.scrollLeft : window.pageXOffset,
|
|
470
|
+
y: window.pageYOffset === undefined ? document.documentElement.scrollTop : window.pageYOffset
|
|
471
|
+
};
|
|
472
|
+
log(iframeId, 'Get page position: ' + pagePosition.x + ',' + pagePosition.y);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
function setPagePosition(iframeId) {
|
|
476
|
+
if (null !== pagePosition) {
|
|
477
|
+
window.scrollTo(pagePosition.x, pagePosition.y);
|
|
478
|
+
log(iframeId, 'Set page position: ' + pagePosition.x + ',' + pagePosition.y);
|
|
479
|
+
unsetPagePosition();
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function unsetPagePosition() {
|
|
483
|
+
pagePosition = null;
|
|
484
|
+
}
|
|
485
|
+
function resetIFrame(messageData) {
|
|
486
|
+
function reset() {
|
|
487
|
+
setSize(messageData);
|
|
488
|
+
trigger('reset', 'reset', messageData.iframe, messageData.id);
|
|
489
|
+
}
|
|
490
|
+
log(messageData.id, 'Size reset requested by ' + ('init' === messageData.type ? 'host page' : 'iFrame'));
|
|
491
|
+
getPagePosition(messageData.id);
|
|
492
|
+
syncResize(reset, messageData, 'reset');
|
|
493
|
+
}
|
|
494
|
+
function setSize(messageData) {
|
|
495
|
+
function setDimension(dimension) {
|
|
496
|
+
if (!messageData.id) {
|
|
497
|
+
log('undefined', 'messageData id not set');
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
messageData.iframe.style[dimension] = messageData[dimension] + 'px';
|
|
501
|
+
log(messageData.id, 'IFrame (' + iframeId + ') ' + dimension + ' set to ' + messageData[dimension] + 'px');
|
|
502
|
+
}
|
|
503
|
+
function chkZero(dimension) {
|
|
504
|
+
// FireFox sets dimension of hidden iFrames to zero.
|
|
505
|
+
// So if we detect that set up an event to check for
|
|
506
|
+
// when iFrame becomes visible.
|
|
507
|
+
/* istanbul ignore next */ // Not testable in PhantomJS
|
|
508
|
+
if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
|
|
509
|
+
hiddenCheckEnabled = true;
|
|
510
|
+
log(iframeId, 'Hidden iFrame detected, creating visibility listener');
|
|
511
|
+
fixHiddenIFrames();
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function processDimension(dimension) {
|
|
515
|
+
setDimension(dimension);
|
|
516
|
+
chkZero(dimension);
|
|
517
|
+
}
|
|
518
|
+
var iframeId = messageData.iframe.id;
|
|
519
|
+
if (settings[iframeId]) {
|
|
520
|
+
if (settings[iframeId].sizeHeight) processDimension('height');
|
|
521
|
+
if (settings[iframeId].sizeWidth) processDimension('width');
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
function syncResize(func, messageData, doNotSync) {
|
|
525
|
+
/* istanbul ignore if */ // Not testable in PhantomJS
|
|
526
|
+
if (doNotSync !== messageData.type && requestAnimationFrame && // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
|
|
527
|
+
!window.jasmine) {
|
|
528
|
+
log(messageData.id, 'Requesting animation frame');
|
|
529
|
+
requestAnimationFrame(func);
|
|
530
|
+
} else func();
|
|
531
|
+
}
|
|
532
|
+
function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
|
|
533
|
+
function postMessageToIFrame() {
|
|
534
|
+
var target = settings[id] && settings[id].targetOrigin;
|
|
535
|
+
log(id, '[' + calleeMsg + '] Sending msg to iframe[' + id + '] (' + msg + ') targetOrigin: ' + target);
|
|
536
|
+
iframe.contentWindow.postMessage(msgId + msg, target);
|
|
537
|
+
}
|
|
538
|
+
function iFrameNotFound() {
|
|
539
|
+
warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
|
|
540
|
+
}
|
|
541
|
+
function chkAndSend() {
|
|
542
|
+
if (iframe && 'contentWindow' in iframe && null !== iframe.contentWindow) // Null test for PhantomJS
|
|
543
|
+
postMessageToIFrame();
|
|
544
|
+
else iFrameNotFound();
|
|
545
|
+
}
|
|
546
|
+
function warnOnNoResponse() {
|
|
547
|
+
function warning() {
|
|
548
|
+
if (settings[id] && !settings[id].loaded && !errorShown) {
|
|
549
|
+
errorShown = true;
|
|
550
|
+
warn(id, 'IFrame has not responded within ' + settings[id].warningTimeout / 1000 + ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.');
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
if (!!noResponseWarning && settings[id] && !!settings[id].warningTimeout) settings[id].msgTimeout = setTimeout(warning, settings[id].warningTimeout);
|
|
554
|
+
}
|
|
555
|
+
var errorShown = false;
|
|
556
|
+
id = id || iframe.id;
|
|
557
|
+
if (settings[id]) {
|
|
558
|
+
chkAndSend();
|
|
559
|
+
warnOnNoResponse();
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function createOutgoingMsg(iframeId) {
|
|
563
|
+
return iframeId + ':' + settings[iframeId].bodyMarginV1 + ':' + settings[iframeId].sizeWidth + ':' + settings[iframeId].log + ':' + settings[iframeId].interval + ':' + settings[iframeId].enablePublicMethods + ':' + settings[iframeId].autoResize + ':' + settings[iframeId].bodyMargin + ':' + settings[iframeId].heightCalculationMethod + ':' + settings[iframeId].bodyBackground + ':' + settings[iframeId].bodyPadding + ':' + settings[iframeId].tolerance + ':' + settings[iframeId].inPageLinks + ':' + settings[iframeId].resizeFrom + ':' + settings[iframeId].widthCalculationMethod + ':' + settings[iframeId].mouseEvents;
|
|
564
|
+
}
|
|
565
|
+
function isNumber(value) {
|
|
566
|
+
return typeof value === 'number';
|
|
567
|
+
}
|
|
568
|
+
function setupIFrame(iframe, options) {
|
|
569
|
+
function setLimits() {
|
|
570
|
+
function addStyle(style) {
|
|
571
|
+
var styleValue = settings[iframeId][style];
|
|
572
|
+
if (Infinity !== styleValue && 0 !== styleValue) {
|
|
573
|
+
iframe.style[style] = isNumber(styleValue) ? styleValue + 'px' : styleValue;
|
|
574
|
+
log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
function chkMinMax(dimension) {
|
|
578
|
+
if (settings[iframeId]['min' + dimension] > settings[iframeId]['max' + dimension]) throw new Error('Value for min' + dimension + ' can not be greater than max' + dimension);
|
|
579
|
+
}
|
|
580
|
+
chkMinMax('Height');
|
|
581
|
+
chkMinMax('Width');
|
|
582
|
+
addStyle('maxHeight');
|
|
583
|
+
addStyle('minHeight');
|
|
584
|
+
addStyle('maxWidth');
|
|
585
|
+
addStyle('minWidth');
|
|
586
|
+
}
|
|
587
|
+
function newId() {
|
|
588
|
+
var id = options && options.id || defaults.id + count++;
|
|
589
|
+
if (null !== document.getElementById(id)) id += count++;
|
|
590
|
+
return id;
|
|
591
|
+
}
|
|
592
|
+
function ensureHasId(iframeId) {
|
|
593
|
+
if (typeof iframeId !== 'string') throw new TypeError('Invaild id for iFrame. Expected String');
|
|
594
|
+
if ('' === iframeId) {
|
|
595
|
+
// eslint-disable-next-line no-multi-assign
|
|
596
|
+
iframe.id = iframeId = newId();
|
|
597
|
+
logEnabled = (options || {}).log;
|
|
598
|
+
log(iframeId, 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')');
|
|
599
|
+
}
|
|
600
|
+
return iframeId;
|
|
601
|
+
}
|
|
602
|
+
function setScrolling() {
|
|
603
|
+
log(iframeId, 'IFrame scrolling ' + (settings[iframeId] && settings[iframeId].scrolling ? 'enabled' : 'disabled') + ' for ' + iframeId);
|
|
604
|
+
iframe.style.overflow = false === (settings[iframeId] && settings[iframeId].scrolling) ? 'hidden' : 'auto';
|
|
605
|
+
switch(settings[iframeId] && settings[iframeId].scrolling){
|
|
606
|
+
case 'omit':
|
|
607
|
+
break;
|
|
608
|
+
case true:
|
|
609
|
+
iframe.scrolling = 'yes';
|
|
610
|
+
break;
|
|
611
|
+
case false:
|
|
612
|
+
iframe.scrolling = 'no';
|
|
613
|
+
break;
|
|
614
|
+
default:
|
|
615
|
+
iframe.scrolling = settings[iframeId] ? settings[iframeId].scrolling : 'no';
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
// The V1 iFrame script expects an int, where as in V2 expects a CSS
|
|
619
|
+
// string value such as '1px 3em', so if we have an int for V2, set V1=V2
|
|
620
|
+
// and then convert V2 to a string PX value.
|
|
621
|
+
function setupBodyMarginValues() {
|
|
622
|
+
if ('number' === typeof (settings[iframeId] && settings[iframeId].bodyMargin) || '0' === (settings[iframeId] && settings[iframeId].bodyMargin)) {
|
|
623
|
+
settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
|
|
624
|
+
settings[iframeId].bodyMargin = '' + settings[iframeId].bodyMargin + 'px';
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
function checkReset() {
|
|
628
|
+
// Reduce scope of firstRun to function, because IE8's JS execution
|
|
629
|
+
// context stack is borked and this value gets externally
|
|
630
|
+
// changed midway through running this function!!!
|
|
631
|
+
var firstRun = settings[iframeId] && settings[iframeId].firstRun, resetRequertMethod = settings[iframeId] && settings[iframeId].heightCalculationMethod in resetRequiredMethods;
|
|
632
|
+
if (!firstRun && resetRequertMethod) resetIFrame({
|
|
633
|
+
iframe: iframe,
|
|
634
|
+
height: 0,
|
|
635
|
+
width: 0,
|
|
636
|
+
type: 'init'
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
function setupIFrameObject() {
|
|
640
|
+
if (settings[iframeId]) settings[iframeId].iframe.iFrameResizer = {
|
|
641
|
+
close: closeIFrame.bind(null, settings[iframeId].iframe),
|
|
642
|
+
removeListeners: removeIframeListeners.bind(null, settings[iframeId].iframe),
|
|
643
|
+
resize: trigger.bind(null, 'Window resize', 'resize', settings[iframeId].iframe),
|
|
644
|
+
moveToAnchor: function(anchor) {
|
|
645
|
+
trigger('Move to anchor', 'moveToAnchor:' + anchor, settings[iframeId].iframe, iframeId);
|
|
646
|
+
},
|
|
647
|
+
sendMessage: function(message) {
|
|
648
|
+
message = JSON.stringify(message);
|
|
649
|
+
trigger('Send Message', 'message:' + message, settings[iframeId].iframe, iframeId);
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
// We have to call trigger twice, as we can not be sure if all
|
|
654
|
+
// iframes have completed loading when this code runs. The
|
|
655
|
+
// event listener also catches the page changing in the iFrame.
|
|
656
|
+
function init(msg) {
|
|
657
|
+
function iFrameLoaded() {
|
|
658
|
+
trigger('iFrame.onload', msg, iframe, undefined, true);
|
|
659
|
+
checkReset();
|
|
660
|
+
}
|
|
661
|
+
function createDestroyObserver(MutationObserver) {
|
|
662
|
+
if (!iframe.parentNode) return null;
|
|
663
|
+
var destroyObserver = new MutationObserver(function(mutations) {
|
|
664
|
+
mutations.forEach(function(mutation) {
|
|
665
|
+
var removedNodes = Array.prototype.slice.call(mutation.removedNodes) // Transform NodeList into an Array
|
|
666
|
+
;
|
|
667
|
+
removedNodes.forEach(function(removedNode) {
|
|
668
|
+
if (removedNode === iframe) closeIFrame(iframe);
|
|
669
|
+
});
|
|
670
|
+
});
|
|
671
|
+
});
|
|
672
|
+
destroyObserver.observe(iframe.parentNode, {
|
|
673
|
+
childList: true
|
|
674
|
+
});
|
|
675
|
+
return destroyObserver;
|
|
676
|
+
}
|
|
677
|
+
var MutationObserver = getMutationObserver();
|
|
678
|
+
if (MutationObserver) destroyObserver = createDestroyObserver(MutationObserver);
|
|
679
|
+
addEventListener(iframe, 'load', iFrameLoaded);
|
|
680
|
+
trigger('init', msg, iframe, undefined, true);
|
|
681
|
+
}
|
|
682
|
+
function checkOptions(options) {
|
|
683
|
+
if ('object' !== typeof options) throw new TypeError('Options is not an object');
|
|
684
|
+
}
|
|
685
|
+
function copyOptions(options) {
|
|
686
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
687
|
+
for(var option in defaults)if (Object.prototype.hasOwnProperty.call(defaults, option)) settings[iframeId][option] = Object.prototype.hasOwnProperty.call(options, option) ? options[option] : defaults[option];
|
|
688
|
+
}
|
|
689
|
+
function getTargetOrigin(remoteHost) {
|
|
690
|
+
return '' === remoteHost || null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/) ? '*' : remoteHost;
|
|
691
|
+
}
|
|
692
|
+
function depricate(key) {
|
|
693
|
+
var splitName = key.split('Callback');
|
|
694
|
+
if (splitName.length === 2) {
|
|
695
|
+
var name = 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
|
|
696
|
+
this[name] = this[key];
|
|
697
|
+
delete this[key];
|
|
698
|
+
warn(iframeId, "Deprecated: '" + key + "' has been renamed '" + name + "'. The old method will be removed in the next major version.");
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
function processOptions(options) {
|
|
702
|
+
options = options || {};
|
|
703
|
+
settings[iframeId] = Object.create(null) // Protect against prototype attacks
|
|
704
|
+
;
|
|
705
|
+
settings[iframeId].iframe = iframe;
|
|
706
|
+
settings[iframeId].firstRun = true;
|
|
707
|
+
settings[iframeId].remoteHost = iframe.src && iframe.src.split('/').slice(0, 3).join('/');
|
|
708
|
+
checkOptions(options);
|
|
709
|
+
Object.keys(options).forEach(depricate, options);
|
|
710
|
+
copyOptions(options);
|
|
711
|
+
if (settings[iframeId]) settings[iframeId].targetOrigin = true === settings[iframeId].checkOrigin ? getTargetOrigin(settings[iframeId].remoteHost) : '*';
|
|
712
|
+
}
|
|
713
|
+
function beenHere() {
|
|
714
|
+
return iframeId in settings && 'iFrameResizer' in iframe;
|
|
715
|
+
}
|
|
716
|
+
var iframeId = ensureHasId(iframe.id);
|
|
717
|
+
if (beenHere()) warn(iframeId, 'Ignored iFrame, already setup.');
|
|
718
|
+
else {
|
|
719
|
+
processOptions(options);
|
|
720
|
+
setScrolling();
|
|
721
|
+
setLimits();
|
|
722
|
+
setupBodyMarginValues();
|
|
723
|
+
init(createOutgoingMsg(iframeId));
|
|
724
|
+
setupIFrameObject();
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
function debouce(fn, time) {
|
|
728
|
+
if (null === timer) timer = setTimeout(function() {
|
|
729
|
+
timer = null;
|
|
730
|
+
fn();
|
|
731
|
+
}, time);
|
|
732
|
+
}
|
|
733
|
+
var frameTimer = {};
|
|
734
|
+
function debounceFrameEvents(fn, time, frameId) {
|
|
735
|
+
if (!frameTimer[frameId]) frameTimer[frameId] = setTimeout(function() {
|
|
736
|
+
frameTimer[frameId] = null;
|
|
737
|
+
fn();
|
|
738
|
+
}, time);
|
|
739
|
+
}
|
|
740
|
+
// Not testable in PhantomJS
|
|
741
|
+
/* istanbul ignore next */ function fixHiddenIFrames() {
|
|
742
|
+
function checkIFrames() {
|
|
743
|
+
function checkIFrame(settingId) {
|
|
744
|
+
function chkDimension(dimension) {
|
|
745
|
+
return '0px' === (settings[settingId] && settings[settingId].iframe.style[dimension]);
|
|
746
|
+
}
|
|
747
|
+
function isVisible(el) {
|
|
748
|
+
return null !== el.offsetParent;
|
|
749
|
+
}
|
|
750
|
+
if (settings[settingId] && isVisible(settings[settingId].iframe) && (chkDimension('height') || chkDimension('width'))) trigger('Visibility change', 'resize', settings[settingId].iframe, settingId);
|
|
751
|
+
}
|
|
752
|
+
Object.keys(settings).forEach(function(key) {
|
|
753
|
+
checkIFrame(key);
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
function mutationObserved(mutations) {
|
|
757
|
+
log('window', 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type);
|
|
758
|
+
debouce(checkIFrames, 16);
|
|
759
|
+
}
|
|
760
|
+
function createMutationObserver() {
|
|
761
|
+
var target = document.querySelector('body'), config = {
|
|
762
|
+
attributes: true,
|
|
763
|
+
attributeOldValue: false,
|
|
764
|
+
characterData: true,
|
|
765
|
+
characterDataOldValue: false,
|
|
766
|
+
childList: true,
|
|
767
|
+
subtree: true
|
|
768
|
+
}, observer = new MutationObserver(mutationObserved);
|
|
769
|
+
observer.observe(target, config);
|
|
770
|
+
}
|
|
771
|
+
var MutationObserver = getMutationObserver();
|
|
772
|
+
if (MutationObserver) createMutationObserver();
|
|
773
|
+
}
|
|
774
|
+
function resizeIFrames(event) {
|
|
775
|
+
function resize() {
|
|
776
|
+
sendTriggerMsg('Window ' + event, 'resize');
|
|
777
|
+
}
|
|
778
|
+
log('window', 'Trigger event: ' + event);
|
|
779
|
+
debouce(resize, 16);
|
|
780
|
+
}
|
|
781
|
+
// Not testable in PhantomJS
|
|
782
|
+
/* istanbul ignore next */ function tabVisible() {
|
|
783
|
+
function resize() {
|
|
784
|
+
sendTriggerMsg('Tab Visible', 'resize');
|
|
785
|
+
}
|
|
786
|
+
if ('hidden' !== document.visibilityState) {
|
|
787
|
+
log('document', 'Trigger event: Visibility change');
|
|
788
|
+
debouce(resize, 16);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
function sendTriggerMsg(eventName, event) {
|
|
792
|
+
function isIFrameResizeEnabled(iframeId) {
|
|
793
|
+
return settings[iframeId] && 'parent' === settings[iframeId].resizeFrom && settings[iframeId].autoResize && !settings[iframeId].firstRun;
|
|
794
|
+
}
|
|
795
|
+
Object.keys(settings).forEach(function(iframeId) {
|
|
796
|
+
if (isIFrameResizeEnabled(iframeId)) trigger(eventName, event, settings[iframeId].iframe, iframeId);
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
function setupEventListeners() {
|
|
800
|
+
addEventListener(window, 'message', iFrameListener);
|
|
801
|
+
addEventListener(window, 'resize', function() {
|
|
802
|
+
resizeIFrames('resize');
|
|
803
|
+
});
|
|
804
|
+
addEventListener(document, 'visibilitychange', tabVisible);
|
|
805
|
+
addEventListener(document, '-webkit-visibilitychange', tabVisible);
|
|
806
|
+
}
|
|
807
|
+
function factory() {
|
|
808
|
+
function init(options, element) {
|
|
809
|
+
function chkType() {
|
|
810
|
+
if (!element.tagName) throw new TypeError('Object is not a valid DOM element');
|
|
811
|
+
else if ('IFRAME' !== element.tagName.toUpperCase()) throw new TypeError('Expected <IFRAME> tag, found <' + element.tagName + '>');
|
|
812
|
+
}
|
|
813
|
+
if (element) {
|
|
814
|
+
chkType();
|
|
815
|
+
setupIFrame(element, options);
|
|
816
|
+
iFrames.push(element);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
function warnDeprecatedOptions(options) {
|
|
820
|
+
if (options && options.enablePublicMethods) warn('enablePublicMethods option has been removed, public methods are now always available in the iFrame');
|
|
821
|
+
}
|
|
822
|
+
var iFrames;
|
|
823
|
+
setupRequestAnimationFrame();
|
|
824
|
+
setupEventListeners();
|
|
825
|
+
return function iFrameResizeF(options, target) {
|
|
826
|
+
iFrames = [] // Only return iFrames past in on this call
|
|
827
|
+
;
|
|
828
|
+
warnDeprecatedOptions(options);
|
|
829
|
+
switch(typeof target){
|
|
830
|
+
case 'undefined':
|
|
831
|
+
case 'string':
|
|
832
|
+
Array.prototype.forEach.call(document.querySelectorAll(target || 'iframe'), init.bind(undefined, options));
|
|
833
|
+
break;
|
|
834
|
+
case 'object':
|
|
835
|
+
init(options, target);
|
|
836
|
+
break;
|
|
837
|
+
default:
|
|
838
|
+
throw new TypeError('Unexpected data type (' + typeof target + ')');
|
|
839
|
+
}
|
|
840
|
+
return iFrames;
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
function createJQueryPublicMethod($) {
|
|
844
|
+
if (!$.fn) info('', 'Unable to bind to jQuery, it is not fully loaded.');
|
|
845
|
+
else if (!$.fn.iFrameResize) $.fn.iFrameResize = function $iFrameResizeF(options) {
|
|
846
|
+
function init(index, element) {
|
|
847
|
+
setupIFrame(element, options);
|
|
848
|
+
}
|
|
849
|
+
return this.filter('iframe').each(init).end();
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
if (window.jQuery !== undefined) createJQueryPublicMethod(window.jQuery);
|
|
853
|
+
if (typeof define === 'function' && define.amd) define([], factory);
|
|
854
|
+
else if (typeof $5180433265c858be$exports === 'object') // Node for browserfy
|
|
855
|
+
$5180433265c858be$exports = factory();
|
|
856
|
+
window.iFrameResize = window.iFrameResize || factory();
|
|
857
|
+
})();
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
window.Lookbook = window.Lookbook || {};
|
|
861
|
+
window.Lookbook.initEmbeds = $5000cc5d1e9e824a$var$initEmbeds;
|
|
862
|
+
const $5000cc5d1e9e824a$var$embedUrlPrefix = "embed";
|
|
863
|
+
const $5000cc5d1e9e824a$var$whiteListedAttributes = [
|
|
864
|
+
"preview",
|
|
865
|
+
"scenario",
|
|
866
|
+
"panels",
|
|
867
|
+
"actions",
|
|
868
|
+
"param-*"
|
|
869
|
+
];
|
|
870
|
+
function $5000cc5d1e9e824a$var$initEmbeds(root = document) {
|
|
871
|
+
if (typeof window.iFrameResize !== "function") {
|
|
872
|
+
console.error("Lookbook embeds require the 'iframe-resizer' library to be available. Skipping embed instantiation.");
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
if (typeof root === "string") root = document.querySelector(root);
|
|
876
|
+
if (!root) return console.error("Could not initialize Lookbook embeds. Root node not found.");
|
|
877
|
+
const embeds = Array.from(root.querySelectorAll("lookbook-embed"));
|
|
878
|
+
embeds.forEach((embed)=>{
|
|
879
|
+
const attrs = Array.from(embed.attributes);
|
|
880
|
+
const wrapper = $5000cc5d1e9e824a$var$createWrapper();
|
|
881
|
+
const iframe = $5000cc5d1e9e824a$var$createIframe(attrs);
|
|
882
|
+
wrapper.appendChild(iframe);
|
|
883
|
+
embed.replaceWith(wrapper);
|
|
884
|
+
});
|
|
885
|
+
window.iFrameResize({
|
|
886
|
+
checkOrigin: false
|
|
887
|
+
}, "[data-lookbook-embed-iframe]");
|
|
888
|
+
}
|
|
889
|
+
function $5000cc5d1e9e824a$var$createWrapper() {
|
|
890
|
+
const wrapper = document.createElement("div");
|
|
891
|
+
wrapper.setAttribute("data-lookbook-embed", "");
|
|
892
|
+
wrapper.classList.add("lookbook-embed");
|
|
893
|
+
return wrapper;
|
|
894
|
+
}
|
|
895
|
+
function $5000cc5d1e9e824a$var$createIframe(attrs) {
|
|
896
|
+
const src = $5000cc5d1e9e824a$var$buildSrc(attrs);
|
|
897
|
+
const id = $5000cc5d1e9e824a$var$attrValue(attrs, "id");
|
|
898
|
+
const styles = $5000cc5d1e9e824a$var$attrValue(attrs, "style");
|
|
899
|
+
const classes = $5000cc5d1e9e824a$var$attrValue(attrs, "class", "").split(" ").map((c)=>c.trim()).filter((c)=>c.length);
|
|
900
|
+
const iframe = document.createElement("iframe");
|
|
901
|
+
iframe.src = src;
|
|
902
|
+
if (id) iframe.id = id;
|
|
903
|
+
iframe.setAttribute("frameborder", 0);
|
|
904
|
+
iframe.setAttribute("data-lookbook-embed-iframe", "");
|
|
905
|
+
if (classes.length) iframe.classList.add(...classes);
|
|
906
|
+
if (styles) iframe.style.cssText = styles;
|
|
907
|
+
iframe.style.width = "100%";
|
|
908
|
+
iframe.style.transition = "height 0.3s";
|
|
909
|
+
return iframe;
|
|
910
|
+
}
|
|
911
|
+
function $5000cc5d1e9e824a$var$buildSrc(attrs) {
|
|
912
|
+
const appPath = $5000cc5d1e9e824a$var$attrValue(attrs, "app") || $5000cc5d1e9e824a$var$guessBasePath();
|
|
913
|
+
const props = {};
|
|
914
|
+
$5000cc5d1e9e824a$var$permittedAttrs(attrs).forEach(({ name: name, value: value })=>{
|
|
915
|
+
name = name.replace("-", "_").toLowerCase();
|
|
916
|
+
props[name] = value;
|
|
917
|
+
});
|
|
918
|
+
return encodeURI([
|
|
919
|
+
appPath,
|
|
920
|
+
$5000cc5d1e9e824a$var$embedUrlPrefix
|
|
921
|
+
].join("/") + `?props=${JSON.stringify(props)}`);
|
|
922
|
+
}
|
|
923
|
+
function $5000cc5d1e9e824a$var$attrValue(attrs, name, fallback = null) {
|
|
924
|
+
const attr = attrs.find((attr)=>attr.name === name);
|
|
925
|
+
return attr ? attr.value : fallback;
|
|
926
|
+
}
|
|
927
|
+
function $5000cc5d1e9e824a$var$permittedAttrs(attrs) {
|
|
928
|
+
return attrs.filter((attr)=>{
|
|
929
|
+
return $5000cc5d1e9e824a$var$whiteListedAttributes.find((key)=>{
|
|
930
|
+
const name = attr.name;
|
|
931
|
+
return key === name || key.includes("*") && name.startsWith(key.replace("*", ""));
|
|
932
|
+
});
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
function $5000cc5d1e9e824a$var$guessBasePath() {
|
|
936
|
+
const script = document.currentScript || document.querySelector('script[src*="lookbook.js"]');
|
|
937
|
+
const scriptSrc = script.src;
|
|
938
|
+
if (scriptSrc && scriptSrc.includes("lookbook-assets")) return scriptSrc.split("?")[0].replace("lookbook-assets/js/lookbook.js", "lookbook");
|
|
939
|
+
return `//${location.host}/lookbook`;
|
|
940
|
+
}
|
|
941
|
+
document.addEventListener("DOMContentLoaded", ()=>$5000cc5d1e9e824a$var$initEmbeds());
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
})();
|