lookbook 2.3.4 → 2.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (468) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/components/lookbook/base_component.rb +1 -0
  4. data/app/components/lookbook/button/component.html.erb +11 -12
  5. data/app/components/lookbook/button/component.js +19 -24
  6. data/app/components/lookbook/button/component.rb +4 -0
  7. data/app/components/lookbook/button_group/component.html.erb +1 -1
  8. data/app/components/lookbook/code/component.html.erb +1 -1
  9. data/app/components/lookbook/copy_button/component.html.erb +1 -1
  10. data/app/components/lookbook/debug_menu/component.html.erb +1 -1
  11. data/app/components/lookbook/dimensions_display/component.html.erb +2 -2
  12. data/app/components/lookbook/display_options/editor/component.html.erb +1 -1
  13. data/app/components/lookbook/display_options/field/component.html.erb +1 -1
  14. data/app/components/lookbook/embed/component.html.erb +1 -1
  15. data/app/components/lookbook/file_source/component.html.erb +1 -1
  16. data/app/components/lookbook/filter/component.html.erb +2 -2
  17. data/app/components/lookbook/icon_button/component.html.erb +2 -2
  18. data/app/components/lookbook/inspector_panel/component.html.erb +1 -1
  19. data/app/components/lookbook/logo/component.html.erb +1 -1
  20. data/app/components/lookbook/message/component.html.erb +1 -1
  21. data/app/components/lookbook/nav/component.html.erb +1 -1
  22. data/app/components/lookbook/nav/directory/component.html.erb +1 -1
  23. data/app/components/lookbook/nav/entity/component.html.erb +1 -1
  24. data/app/components/lookbook/page_tabs/component.html.erb +1 -1
  25. data/app/components/lookbook/params/editor/component.html.erb +1 -1
  26. data/app/components/lookbook/params/editor/component.rb +1 -1
  27. data/app/components/lookbook/params/field/component.rb +1 -1
  28. data/app/components/lookbook/prose/component.html.erb +1 -1
  29. data/app/components/lookbook/split_layout/component.html.erb +1 -1
  30. data/app/components/lookbook/tab_panels/component.html.erb +1 -1
  31. data/app/components/lookbook/tab_panels/component.rb +1 -1
  32. data/app/components/lookbook/tab_panels/panel/component.html.erb +1 -1
  33. data/app/components/lookbook/tabs/component.html.erb +1 -1
  34. data/app/components/lookbook/tabs/dropdown_tab/component.html.erb +1 -1
  35. data/app/components/lookbook/tabs/tab/component.html.erb +1 -1
  36. data/app/components/lookbook/text_button/component.html.erb +2 -2
  37. data/app/components/lookbook/toolbar/component.html.erb +1 -1
  38. data/app/controllers/lookbook/application_controller.rb +17 -0
  39. data/app/controllers/lookbook/previews_controller.rb +11 -7
  40. data/app/views/layouts/lookbook/application.html.erb +3 -3
  41. data/app/views/layouts/lookbook/embed.html.erb +1 -1
  42. data/app/views/layouts/lookbook/skeleton.html.erb +2 -0
  43. data/app/views/lookbook/embeds/show.html.erb +1 -1
  44. data/app/views/lookbook/errors/default.html.erb +1 -1
  45. data/app/views/lookbook/errors/not_found.html.erb +1 -1
  46. data/app/views/lookbook/index.html.erb +1 -1
  47. data/app/views/lookbook/inspector/inputs/_color.html.erb +1 -1
  48. data/app/views/lookbook/inspector/inputs/_range.html.erb +1 -1
  49. data/app/views/lookbook/inspector/inputs/_select.html.erb +1 -1
  50. data/app/views/lookbook/inspector/inputs/_text.html.erb +1 -1
  51. data/app/views/lookbook/inspector/inputs/_text_two_step.html.erb +1 -1
  52. data/app/views/lookbook/inspector/inputs/_textarea.html.erb +1 -1
  53. data/app/views/lookbook/inspector/panels/_notes.html.erb +2 -2
  54. data/app/views/lookbook/inspector/panels/_output.html.erb +1 -1
  55. data/app/views/lookbook/inspector/panels/_preview.html.erb +1 -1
  56. data/app/views/lookbook/inspector/panels/_source.html.erb +1 -1
  57. data/app/views/lookbook/inspector/show.html.erb +4 -4
  58. data/app/views/lookbook/pages/show.html.erb +1 -1
  59. data/app/views/lookbook/partials/_iframe_content_scripts.html.erb +1 -1
  60. data/app/views/lookbook/partials/_user_styles.html.erb +1 -1
  61. data/app/views/lookbook/previews/group.html.erb +1 -1
  62. data/app/views/lookbook/previews/preview.html.erb +5 -1
  63. data/app/views/lookbook/previews/show.html.erb +1 -1
  64. data/config/app.yml +1 -1
  65. data/lib/lookbook/engine.rb +42 -18
  66. data/lib/lookbook/preview_controller_actions.rb +7 -2
  67. data/lib/lookbook/preview_parser.rb +2 -4
  68. data/lib/lookbook/services/markdown_renderer.rb +12 -4
  69. data/lib/lookbook/stores/config_store.rb +4 -0
  70. data/lib/lookbook/support/errors/config_error.rb +1 -1
  71. data/lib/lookbook/support/errors/parser_error.rb +1 -1
  72. data/lib/lookbook/support/errors/preview_template_error.rb +1 -1
  73. data/lib/lookbook/support/errors/template_error.rb +1 -1
  74. data/lib/lookbook/support/store.rb +1 -1
  75. data/lib/lookbook/support/utils/utils.rb +1 -1
  76. data/lib/lookbook/tags/param_tag.rb +4 -1
  77. data/lib/lookbook/tags/yard_tag.rb +1 -1
  78. data/lib/lookbook/version.rb +1 -1
  79. data/public/lookbook-assets/css/lookbook.css +131 -136
  80. data/public/lookbook-assets/css/lookbook.css.map +1 -1
  81. data/public/lookbook-assets/css/themes/blue.css +0 -1
  82. data/public/lookbook-assets/css/themes/green.css +0 -1
  83. data/public/lookbook-assets/css/themes/indigo.css +0 -1
  84. data/public/lookbook-assets/css/themes/rose.css +0 -1
  85. data/public/lookbook-assets/css/themes/zinc.css +0 -1
  86. data/public/lookbook-assets/js/iframe.js +205 -196
  87. data/public/lookbook-assets/js/iframe.js.map +1 -1
  88. data/public/lookbook-assets/js/index.js +1171 -1025
  89. data/public/lookbook-assets/js/index.js.map +1 -1
  90. data/public/lookbook-assets/js/lookbook-core.js +0 -37
  91. data/public/lookbook-assets/js/lookbook.js +277 -296
  92. metadata +4 -385
  93. data/assets/icons/activity-square.svg +0 -1
  94. data/assets/icons/ampersand.svg +0 -1
  95. data/assets/icons/ampersands.svg +0 -1
  96. data/assets/icons/antenna.svg +0 -1
  97. data/assets/icons/app-window.svg +0 -1
  98. data/assets/icons/archive-x.svg +0 -1
  99. data/assets/icons/area-chart.svg +0 -1
  100. data/assets/icons/arrow-big-down-dash.svg +0 -1
  101. data/assets/icons/arrow-big-left-dash.svg +0 -1
  102. data/assets/icons/arrow-big-right-dash.svg +0 -1
  103. data/assets/icons/arrow-big-up-dash.svg +0 -1
  104. data/assets/icons/arrow-down-0-1.svg +0 -1
  105. data/assets/icons/arrow-down-1-0.svg +0 -1
  106. data/assets/icons/arrow-down-a-z.svg +0 -1
  107. data/assets/icons/arrow-down-from-line.svg +0 -1
  108. data/assets/icons/arrow-down-left-from-circle.svg +0 -1
  109. data/assets/icons/arrow-down-left-square.svg +0 -1
  110. data/assets/icons/arrow-down-narrow-wide.svg +0 -1
  111. data/assets/icons/arrow-down-right-from-circle.svg +0 -1
  112. data/assets/icons/arrow-down-right-square.svg +0 -1
  113. data/assets/icons/arrow-down-square.svg +0 -1
  114. data/assets/icons/arrow-down-to-dot.svg +0 -1
  115. data/assets/icons/arrow-down-to-line.svg +0 -1
  116. data/assets/icons/arrow-down-up.svg +0 -1
  117. data/assets/icons/arrow-down-wide-narrow.svg +0 -1
  118. data/assets/icons/arrow-down-z-a.svg +0 -1
  119. data/assets/icons/arrow-left-from-line.svg +0 -1
  120. data/assets/icons/arrow-left-square.svg +0 -1
  121. data/assets/icons/arrow-left-to-line.svg +0 -1
  122. data/assets/icons/arrow-right-from-line.svg +0 -1
  123. data/assets/icons/arrow-right-left.svg +0 -1
  124. data/assets/icons/arrow-right-square.svg +0 -1
  125. data/assets/icons/arrow-right-to-line.svg +0 -1
  126. data/assets/icons/arrow-up-0-1.svg +0 -1
  127. data/assets/icons/arrow-up-1-0.svg +0 -1
  128. data/assets/icons/arrow-up-a-z.svg +0 -1
  129. data/assets/icons/arrow-up-from-dot.svg +0 -1
  130. data/assets/icons/arrow-up-from-line.svg +0 -1
  131. data/assets/icons/arrow-up-left-from-circle.svg +0 -1
  132. data/assets/icons/arrow-up-left-square.svg +0 -1
  133. data/assets/icons/arrow-up-narrow-wide.svg +0 -1
  134. data/assets/icons/arrow-up-right-from-circle.svg +0 -1
  135. data/assets/icons/arrow-up-right-square.svg +0 -1
  136. data/assets/icons/arrow-up-square.svg +0 -1
  137. data/assets/icons/arrow-up-to-line.svg +0 -1
  138. data/assets/icons/arrow-up-wide-narrow.svg +0 -1
  139. data/assets/icons/arrow-up-z-a.svg +0 -1
  140. data/assets/icons/arrows-up-from-line.svg +0 -1
  141. data/assets/icons/atom.svg +0 -1
  142. data/assets/icons/badge-alert.svg +0 -1
  143. data/assets/icons/badge-cent.svg +0 -1
  144. data/assets/icons/badge-check.svg +0 -1
  145. data/assets/icons/badge-dollar-sign.svg +0 -1
  146. data/assets/icons/badge-euro.svg +0 -1
  147. data/assets/icons/badge-help.svg +0 -1
  148. data/assets/icons/badge-indian-rupee.svg +0 -1
  149. data/assets/icons/badge-info.svg +0 -1
  150. data/assets/icons/badge-japanese-yen.svg +0 -1
  151. data/assets/icons/badge-minus.svg +0 -1
  152. data/assets/icons/badge-percent.svg +0 -1
  153. data/assets/icons/badge-plus.svg +0 -1
  154. data/assets/icons/badge-pound-sterling.svg +0 -1
  155. data/assets/icons/badge-russian-ruble.svg +0 -1
  156. data/assets/icons/badge-swiss-franc.svg +0 -1
  157. data/assets/icons/badge-x.svg +0 -1
  158. data/assets/icons/badge.svg +0 -1
  159. data/assets/icons/ban.svg +0 -1
  160. data/assets/icons/bar-chart-big.svg +0 -1
  161. data/assets/icons/bar-chart-horizontal-big.svg +0 -1
  162. data/assets/icons/bell-dot.svg +0 -1
  163. data/assets/icons/biohazard.svg +0 -1
  164. data/assets/icons/blocks.svg +0 -1
  165. data/assets/icons/book-copy.svg +0 -1
  166. data/assets/icons/book-down.svg +0 -1
  167. data/assets/icons/book-key.svg +0 -1
  168. data/assets/icons/book-lock.svg +0 -1
  169. data/assets/icons/book-marked.svg +0 -1
  170. data/assets/icons/book-minus.svg +0 -1
  171. data/assets/icons/book-plus.svg +0 -1
  172. data/assets/icons/book-template.svg +0 -1
  173. data/assets/icons/book-up-2.svg +0 -1
  174. data/assets/icons/book-up.svg +0 -1
  175. data/assets/icons/book-x.svg +0 -1
  176. data/assets/icons/bookmark-check.svg +0 -1
  177. data/assets/icons/bookmark-x.svg +0 -1
  178. data/assets/icons/boom-box.svg +0 -1
  179. data/assets/icons/braces.svg +0 -1
  180. data/assets/icons/brackets.svg +0 -1
  181. data/assets/icons/brain-circuit.svg +0 -1
  182. data/assets/icons/brain-cog.svg +0 -1
  183. data/assets/icons/brain.svg +0 -1
  184. data/assets/icons/bring-to-front.svg +0 -1
  185. data/assets/icons/bug-off.svg +0 -1
  186. data/assets/icons/bug-play.svg +0 -1
  187. data/assets/icons/bus-front.svg +0 -1
  188. data/assets/icons/cable-car.svg +0 -1
  189. data/assets/icons/cable.svg +0 -1
  190. data/assets/icons/cake-slice.svg +0 -1
  191. data/assets/icons/candlestick-chart.svg +0 -1
  192. data/assets/icons/candy-cane.svg +0 -1
  193. data/assets/icons/car-front.svg +0 -1
  194. data/assets/icons/car-taxi-front.svg +0 -1
  195. data/assets/icons/case-lower.svg +0 -1
  196. data/assets/icons/case-sensitive.svg +0 -1
  197. data/assets/icons/case-upper.svg +0 -1
  198. data/assets/icons/cassette-tape.svg +0 -1
  199. data/assets/icons/castle.svg +0 -1
  200. data/assets/icons/chevron-down-circle.svg +0 -1
  201. data/assets/icons/chevron-down-square.svg +0 -1
  202. data/assets/icons/chevron-left-circle.svg +0 -1
  203. data/assets/icons/chevron-left-square.svg +0 -1
  204. data/assets/icons/chevron-right-circle.svg +0 -1
  205. data/assets/icons/chevron-right-square.svg +0 -1
  206. data/assets/icons/chevron-up-circle.svg +0 -1
  207. data/assets/icons/chevron-up-square.svg +0 -1
  208. data/assets/icons/church.svg +0 -1
  209. data/assets/icons/circle-dashed.svg +0 -1
  210. data/assets/icons/circle-dollar-sign.svg +0 -1
  211. data/assets/icons/circle-dot-dashed.svg +0 -1
  212. data/assets/icons/circle-equal.svg +0 -1
  213. data/assets/icons/circle-off.svg +0 -1
  214. data/assets/icons/circle-slash-2.svg +0 -1
  215. data/assets/icons/circle-slash.svg +0 -1
  216. data/assets/icons/circuit-board.svg +0 -1
  217. data/assets/icons/clipboard-paste.svg +0 -1
  218. data/assets/icons/club.svg +0 -1
  219. data/assets/icons/combine.svg +0 -1
  220. data/assets/icons/computer.svg +0 -1
  221. data/assets/icons/contact-2.svg +0 -1
  222. data/assets/icons/container.svg +0 -1
  223. data/assets/icons/copy-check.svg +0 -1
  224. data/assets/icons/copy-minus.svg +0 -1
  225. data/assets/icons/copy-plus.svg +0 -1
  226. data/assets/icons/copy-slash.svg +0 -1
  227. data/assets/icons/copy-x.svg +0 -1
  228. data/assets/icons/database-zap.svg +0 -1
  229. data/assets/icons/dessert.svg +0 -1
  230. data/assets/icons/disc-2.svg +0 -1
  231. data/assets/icons/disc-3.svg +0 -1
  232. data/assets/icons/donut.svg +0 -1
  233. data/assets/icons/door-closed.svg +0 -1
  234. data/assets/icons/door-open.svg +0 -1
  235. data/assets/icons/dot.svg +0 -1
  236. data/assets/icons/drama.svg +0 -1
  237. data/assets/icons/ferris-wheel.svg +0 -1
  238. data/assets/icons/file-code-2.svg +0 -1
  239. data/assets/icons/file-stack.svg +0 -1
  240. data/assets/icons/fish-symbol.svg +0 -1
  241. data/assets/icons/fold-horizontal.svg +0 -1
  242. data/assets/icons/fold-vertical.svg +0 -1
  243. data/assets/icons/folder-dot.svg +0 -1
  244. data/assets/icons/folder-git-2.svg +0 -1
  245. data/assets/icons/folder-git.svg +0 -1
  246. data/assets/icons/folder-kanban.svg +0 -1
  247. data/assets/icons/folder-open-dot.svg +0 -1
  248. data/assets/icons/folder-root.svg +0 -1
  249. data/assets/icons/folder-sync.svg +0 -1
  250. data/assets/icons/gallery-horizontal-end.svg +0 -1
  251. data/assets/icons/gallery-horizontal.svg +0 -1
  252. data/assets/icons/gallery-thumbnails.svg +0 -1
  253. data/assets/icons/gallery-vertical-end.svg +0 -1
  254. data/assets/icons/gallery-vertical.svg +0 -1
  255. data/assets/icons/gantt-chart-square.svg +0 -1
  256. data/assets/icons/gantt-chart.svg +0 -1
  257. data/assets/icons/gauge-circle.svg +0 -1
  258. data/assets/icons/goal.svg +0 -1
  259. data/assets/icons/grid-2x2.svg +0 -1
  260. data/assets/icons/grid-3x3.svg +0 -1
  261. data/assets/icons/group.svg +0 -1
  262. data/assets/icons/hard-drive-download.svg +0 -1
  263. data/assets/icons/hard-drive-upload.svg +0 -1
  264. data/assets/icons/hdmi-port.svg +0 -1
  265. data/assets/icons/hotel.svg +0 -1
  266. data/assets/icons/iteration-ccw.svg +0 -1
  267. data/assets/icons/iteration-cw.svg +0 -1
  268. data/assets/icons/kanban-square-dashed.svg +0 -1
  269. data/assets/icons/kanban-square.svg +0 -1
  270. data/assets/icons/kanban.svg +0 -1
  271. data/assets/icons/key-round.svg +0 -1
  272. data/assets/icons/key-square.svg +0 -1
  273. data/assets/icons/layout-panel-left.svg +0 -1
  274. data/assets/icons/layout-panel-top.svg +0 -1
  275. data/assets/icons/leafy-green.svg +0 -1
  276. data/assets/icons/ligature.svg +0 -1
  277. data/assets/icons/list-filter.svg +0 -1
  278. data/assets/icons/list-restart.svg +0 -1
  279. data/assets/icons/list-todo.svg +0 -1
  280. data/assets/icons/list-tree.svg +0 -1
  281. data/assets/icons/lollipop.svg +0 -1
  282. data/assets/icons/m-square.svg +0 -1
  283. data/assets/icons/mailbox.svg +0 -1
  284. data/assets/icons/memory-stick.svg +0 -1
  285. data/assets/icons/menu-square.svg +0 -1
  286. data/assets/icons/merge.svg +0 -1
  287. data/assets/icons/message-square-dashed.svg +0 -1
  288. data/assets/icons/message-square-plus.svg +0 -1
  289. data/assets/icons/messages-square.svg +0 -1
  290. data/assets/icons/monitor-check.svg +0 -1
  291. data/assets/icons/monitor-dot.svg +0 -1
  292. data/assets/icons/monitor-down.svg +0 -1
  293. data/assets/icons/monitor-pause.svg +0 -1
  294. data/assets/icons/monitor-play.svg +0 -1
  295. data/assets/icons/monitor-stop.svg +0 -1
  296. data/assets/icons/monitor-up.svg +0 -1
  297. data/assets/icons/monitor-x.svg +0 -1
  298. data/assets/icons/moon-star.svg +0 -1
  299. data/assets/icons/mouse-pointer-square-dashed.svg +0 -1
  300. data/assets/icons/mouse-pointer-square.svg +0 -1
  301. data/assets/icons/move-down-left.svg +0 -1
  302. data/assets/icons/move-down-right.svg +0 -1
  303. data/assets/icons/move-down.svg +0 -1
  304. data/assets/icons/move-left.svg +0 -1
  305. data/assets/icons/move-right.svg +0 -1
  306. data/assets/icons/move-up-left.svg +0 -1
  307. data/assets/icons/move-up-right.svg +0 -1
  308. data/assets/icons/move-up.svg +0 -1
  309. data/assets/icons/orbit.svg +0 -1
  310. data/assets/icons/panel-bottom-close.svg +0 -1
  311. data/assets/icons/panel-bottom-inactive.svg +0 -1
  312. data/assets/icons/panel-bottom-open.svg +0 -1
  313. data/assets/icons/panel-bottom.svg +0 -1
  314. data/assets/icons/panel-left-close.svg +0 -1
  315. data/assets/icons/panel-left-inactive.svg +0 -1
  316. data/assets/icons/panel-left-open.svg +0 -1
  317. data/assets/icons/panel-left.svg +0 -1
  318. data/assets/icons/panel-right-close.svg +0 -1
  319. data/assets/icons/panel-right-inactive.svg +0 -1
  320. data/assets/icons/panel-right-open.svg +0 -1
  321. data/assets/icons/panel-right.svg +0 -1
  322. data/assets/icons/panel-top-close.svg +0 -1
  323. data/assets/icons/panel-top-inactive.svg +0 -1
  324. data/assets/icons/panel-top-open.svg +0 -1
  325. data/assets/icons/panel-top.svg +0 -1
  326. data/assets/icons/parentheses.svg +0 -1
  327. data/assets/icons/parking-circle-off.svg +0 -1
  328. data/assets/icons/parking-circle.svg +0 -1
  329. data/assets/icons/parking-meter.svg +0 -1
  330. data/assets/icons/parking-square-off.svg +0 -1
  331. data/assets/icons/parking-square.svg +0 -1
  332. data/assets/icons/paw-print.svg +0 -1
  333. data/assets/icons/pc-case.svg +0 -1
  334. data/assets/icons/pen-line.svg +0 -1
  335. data/assets/icons/pen-square.svg +0 -1
  336. data/assets/icons/pen.svg +0 -1
  337. data/assets/icons/pencil-line.svg +0 -1
  338. data/assets/icons/pencil-ruler.svg +0 -1
  339. data/assets/icons/percent-circle.svg +0 -1
  340. data/assets/icons/percent-diamond.svg +0 -1
  341. data/assets/icons/percent-square.svg +0 -1
  342. data/assets/icons/pi-square.svg +0 -1
  343. data/assets/icons/pi.svg +0 -1
  344. data/assets/icons/pilcrow-square.svg +0 -1
  345. data/assets/icons/plane-landing.svg +0 -1
  346. data/assets/icons/plane-takeoff.svg +0 -1
  347. data/assets/icons/play-square.svg +0 -1
  348. data/assets/icons/plug-zap-2.svg +0 -1
  349. data/assets/icons/pocket-knife.svg +0 -1
  350. data/assets/icons/popcorn.svg +0 -1
  351. data/assets/icons/popsicle.svg +0 -1
  352. data/assets/icons/presentation.svg +0 -1
  353. data/assets/icons/projector.svg +0 -1
  354. data/assets/icons/rabbit.svg +0 -1
  355. data/assets/icons/radar.svg +0 -1
  356. data/assets/icons/radiation.svg +0 -1
  357. data/assets/icons/radio-tower.svg +0 -1
  358. data/assets/icons/rail-symbol.svg +0 -1
  359. data/assets/icons/rainbow.svg +0 -1
  360. data/assets/icons/rat.svg +0 -1
  361. data/assets/icons/ratio.svg +0 -1
  362. data/assets/icons/receipt.svg +0 -1
  363. data/assets/icons/redo-dot.svg +0 -1
  364. data/assets/icons/refresh-ccw-dot.svg +0 -1
  365. data/assets/icons/refresh-cw-off.svg +0 -1
  366. data/assets/icons/repeat-2.svg +0 -1
  367. data/assets/icons/replace-all.svg +0 -1
  368. data/assets/icons/replace.svg +0 -1
  369. data/assets/icons/roller-coaster.svg +0 -1
  370. data/assets/icons/rows.svg +0 -1
  371. data/assets/icons/satellite-dish.svg +0 -1
  372. data/assets/icons/satellite.svg +0 -1
  373. data/assets/icons/save-all.svg +0 -1
  374. data/assets/icons/scatter-chart.svg +0 -1
  375. data/assets/icons/school-2.svg +0 -1
  376. data/assets/icons/school.svg +0 -1
  377. data/assets/icons/scissors-line-dashed.svg +0 -1
  378. data/assets/icons/scissors-square-dashed-bottom.svg +0 -1
  379. data/assets/icons/scissors-square.svg +0 -1
  380. data/assets/icons/scroll-text.svg +0 -1
  381. data/assets/icons/search-check.svg +0 -1
  382. data/assets/icons/search-code.svg +0 -1
  383. data/assets/icons/search-slash.svg +0 -1
  384. data/assets/icons/search-x.svg +0 -1
  385. data/assets/icons/send-horizontal.svg +0 -1
  386. data/assets/icons/send-to-back.svg +0 -1
  387. data/assets/icons/shapes.svg +0 -1
  388. data/assets/icons/shell.svg +0 -1
  389. data/assets/icons/shield-ban.svg +0 -1
  390. data/assets/icons/shield-ellipsis.svg +0 -1
  391. data/assets/icons/shield-half.svg +0 -1
  392. data/assets/icons/shield-minus.svg +0 -1
  393. data/assets/icons/shield-plus.svg +0 -1
  394. data/assets/icons/shield-question.svg +0 -1
  395. data/assets/icons/shield-x.svg +0 -1
  396. data/assets/icons/ship-wheel.svg +0 -1
  397. data/assets/icons/shopping-basket.svg +0 -1
  398. data/assets/icons/sigma-square.svg +0 -1
  399. data/assets/icons/snail.svg +0 -1
  400. data/assets/icons/space.svg +0 -1
  401. data/assets/icons/spade.svg +0 -1
  402. data/assets/icons/sparkle.svg +0 -1
  403. data/assets/icons/sparkles.svg +0 -1
  404. data/assets/icons/speech.svg +0 -1
  405. data/assets/icons/spell-check-2.svg +0 -1
  406. data/assets/icons/spell-check.svg +0 -1
  407. data/assets/icons/split.svg +0 -1
  408. data/assets/icons/spray-can.svg +0 -1
  409. data/assets/icons/square-asterisk.svg +0 -1
  410. data/assets/icons/square-code.svg +0 -1
  411. data/assets/icons/square-dashed-bottom-code.svg +0 -1
  412. data/assets/icons/square-dashed-bottom.svg +0 -1
  413. data/assets/icons/square-dot.svg +0 -1
  414. data/assets/icons/square-equal.svg +0 -1
  415. data/assets/icons/square-slash.svg +0 -1
  416. data/assets/icons/square-stack.svg +0 -1
  417. data/assets/icons/squirrel.svg +0 -1
  418. data/assets/icons/step-back.svg +0 -1
  419. data/assets/icons/step-forward.svg +0 -1
  420. data/assets/icons/store.svg +0 -1
  421. data/assets/icons/table-properties.svg +0 -1
  422. data/assets/icons/tablet-smartphone.svg +0 -1
  423. data/assets/icons/tally-1.svg +0 -1
  424. data/assets/icons/tally-2.svg +0 -1
  425. data/assets/icons/tally-3.svg +0 -1
  426. data/assets/icons/tally-4.svg +0 -1
  427. data/assets/icons/tally-5.svg +0 -1
  428. data/assets/icons/test-tube-2.svg +0 -1
  429. data/assets/icons/test-tube.svg +0 -1
  430. data/assets/icons/test-tubes.svg +0 -1
  431. data/assets/icons/text-quote.svg +0 -1
  432. data/assets/icons/text-select.svg +0 -1
  433. data/assets/icons/text.svg +0 -1
  434. data/assets/icons/theater.svg +0 -1
  435. data/assets/icons/touchpad-off.svg +0 -1
  436. data/assets/icons/touchpad.svg +0 -1
  437. data/assets/icons/tractor.svg +0 -1
  438. data/assets/icons/traffic-cone.svg +0 -1
  439. data/assets/icons/train-front-tunnel.svg +0 -1
  440. data/assets/icons/train-front.svg +0 -1
  441. data/assets/icons/train-track.svg +0 -1
  442. data/assets/icons/tram-front.svg +0 -1
  443. data/assets/icons/triangle-right.svg +0 -1
  444. data/assets/icons/turtle.svg +0 -1
  445. data/assets/icons/undo-dot.svg +0 -1
  446. data/assets/icons/unfold-horizontal.svg +0 -1
  447. data/assets/icons/unfold-vertical.svg +0 -1
  448. data/assets/icons/ungroup.svg +0 -1
  449. data/assets/icons/unplug.svg +0 -1
  450. data/assets/icons/user-2.svg +0 -1
  451. data/assets/icons/user-check-2.svg +0 -1
  452. data/assets/icons/user-circle-2.svg +0 -1
  453. data/assets/icons/user-circle.svg +0 -1
  454. data/assets/icons/user-cog-2.svg +0 -1
  455. data/assets/icons/user-minus-2.svg +0 -1
  456. data/assets/icons/user-plus-2.svg +0 -1
  457. data/assets/icons/user-square-2.svg +0 -1
  458. data/assets/icons/user-square.svg +0 -1
  459. data/assets/icons/user-x-2.svg +0 -1
  460. data/assets/icons/users-2.svg +0 -1
  461. data/assets/icons/variable.svg +0 -1
  462. data/assets/icons/videotape.svg +0 -1
  463. data/assets/icons/wallet-2.svg +0 -1
  464. data/assets/icons/wallet-cards.svg +0 -1
  465. data/assets/icons/wallpaper.svg +0 -1
  466. data/assets/icons/warehouse.svg +0 -1
  467. data/assets/icons/whole-word.svg +0 -1
  468. data/assets/icons/workflow.svg +0 -1
@@ -1,137 +1,29 @@
1
1
  (() => {
2
-
3
- var $parcel$global = globalThis;
4
-
5
- var $parcel$modules = {};
6
- var $parcel$inits = {};
7
-
8
- var parcelRequire = $parcel$global["parcelRequirea49c"];
9
-
10
- if (parcelRequire == null) {
11
- parcelRequire = function(id) {
12
- if (id in $parcel$modules) {
13
- return $parcel$modules[id].exports;
14
- }
15
- if (id in $parcel$inits) {
16
- var init = $parcel$inits[id];
17
- delete $parcel$inits[id];
18
- var module = {id: id, exports: {}};
19
- $parcel$modules[id] = module;
20
- init.call(module.exports, module, module.exports);
21
- return module.exports;
22
- }
23
- var err = new Error("Cannot find module '" + id + "'");
24
- err.code = 'MODULE_NOT_FOUND';
25
- throw err;
26
- };
27
-
28
- parcelRequire.register = function register(id, init) {
29
- $parcel$inits[id] = init;
30
- };
31
-
32
- $parcel$global["parcelRequirea49c"] = parcelRequire;
33
- }
34
-
35
- var parcelRegister = parcelRequire.register;
36
- parcelRegister("6RQZy", function(module, exports) {
37
- window.Lookbook = window.Lookbook || {};
38
- window.Lookbook.initEmbeds = $5000cc5d1e9e824a$var$initEmbeds;
39
- const $5000cc5d1e9e824a$var$embedUrlPrefix = "embed";
40
- const $5000cc5d1e9e824a$var$whiteListedAttributes = [
41
- "preview",
42
- "scenario",
43
- "panels",
44
- "actions",
45
- "param-*"
46
- ];
47
- function $5000cc5d1e9e824a$var$initEmbeds(root = document) {
48
- if (typeof window.iFrameResize !== "function") {
49
- console.error("Lookbook embeds require the 'iframe-resizer' library to be available. Skipping embed instantiation.");
50
- return;
51
- }
52
- if (typeof root === "string") root = document.querySelector(root);
53
- if (!root) return console.error("Could not initialize Lookbook embeds. Root node not found.");
54
- const embeds = Array.from(root.querySelectorAll("lookbook-embed"));
55
- embeds.forEach((embed)=>{
56
- const attrs = Array.from(embed.attributes);
57
- const wrapper = $5000cc5d1e9e824a$var$createWrapper();
58
- const iframe = $5000cc5d1e9e824a$var$createIframe(attrs);
59
- wrapper.appendChild(iframe);
60
- embed.replaceWith(wrapper);
61
- });
62
- window.iFrameResize({
63
- checkOrigin: false
64
- }, "[data-lookbook-embed-iframe]");
65
- }
66
- function $5000cc5d1e9e824a$var$createWrapper() {
67
- const wrapper = document.createElement("div");
68
- wrapper.setAttribute("data-lookbook-embed", "");
69
- wrapper.classList.add("lookbook-embed");
70
- return wrapper;
71
- }
72
- function $5000cc5d1e9e824a$var$createIframe(attrs) {
73
- const src = $5000cc5d1e9e824a$var$buildSrc(attrs);
74
- const id = $5000cc5d1e9e824a$var$attrValue(attrs, "id");
75
- const styles = $5000cc5d1e9e824a$var$attrValue(attrs, "style");
76
- const classes = $5000cc5d1e9e824a$var$attrValue(attrs, "class", "").split(" ").map((c)=>c.trim()).filter((c)=>c.length);
77
- const iframe = document.createElement("iframe");
78
- iframe.src = src;
79
- if (id) iframe.id = id;
80
- iframe.setAttribute("frameborder", 0);
81
- iframe.setAttribute("data-lookbook-embed-iframe", "");
82
- if (classes.length) iframe.classList.add(...classes);
83
- if (styles) iframe.style.cssText = styles;
84
- iframe.style.width = "100%";
85
- iframe.style.transition = "height 0.3s";
86
- return iframe;
87
- }
88
- function $5000cc5d1e9e824a$var$buildSrc(attrs) {
89
- const appPath = $5000cc5d1e9e824a$var$attrValue(attrs, "app") || $5000cc5d1e9e824a$var$guessBasePath();
90
- const props = {};
91
- $5000cc5d1e9e824a$var$permittedAttrs(attrs).forEach(({ name: name, value: value })=>{
92
- name = name.replace("-", "_").toLowerCase();
93
- props[name] = value;
94
- });
95
- return encodeURI([
96
- appPath,
97
- $5000cc5d1e9e824a$var$embedUrlPrefix
98
- ].join("/") + `?props=${JSON.stringify(props)}`);
99
- }
100
- function $5000cc5d1e9e824a$var$attrValue(attrs, name, fallback = null) {
101
- const attr = attrs.find((attr)=>attr.name === name);
102
- return attr ? attr.value : fallback;
103
- }
104
- function $5000cc5d1e9e824a$var$permittedAttrs(attrs) {
105
- return attrs.filter((attr)=>{
106
- return $5000cc5d1e9e824a$var$whiteListedAttributes.find((key)=>{
107
- const name = attr.name;
108
- return key === name || key.includes("*") && name.startsWith(key.replace("*", ""));
109
- });
110
- });
111
- }
112
- function $5000cc5d1e9e824a$var$guessBasePath() {
113
- const script = document.currentScript || document.querySelector('script[src*="lookbook.js"]');
114
- const scriptSrc = script.src;
115
- if (scriptSrc && scriptSrc.includes("lookbook-assets")) return scriptSrc.split("?")[0].replace("lookbook-assets/js/lookbook.js", "lookbook");
116
- return `//${location.host}/lookbook`;
117
- }
118
- document.addEventListener("DOMContentLoaded", ()=>$5000cc5d1e9e824a$var$initEmbeds());
119
-
120
- });
121
-
122
2
  var $5180433265c858be$exports = {};
123
3
  /*
124
4
  * File: iframeResizer.js
125
5
  * Desc: Force iframes to size to content.
126
6
  * Requires: iframeResizer.contentWindow.js to be loaded into the target frame.
127
- * Doc: https://github.com/davidjbradshaw/iframe-resizer
128
- * Author: David J. Bradshaw - dave@bradshaw.net
129
- * Contributor: Jure Mav - jure.mav@gmail.com
130
- * Contributor: Reed Dadoune - reed@dadoune.com
131
- */ // eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names
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
+ `);
132
23
  (function(undefined) {
133
- if (typeof window === "undefined") return; // don't run for server side render
134
- var count = 0, logEnabled = false, hiddenCheckEnabled = false, msgHeader = "message", msgHeaderLen = msgHeader.length, msgId = "[iFrameSizer]", msgIdLen = msgId.length, pagePosition = null, requestAnimationFrame = window.requestAnimationFrame, resetRequiredMethods = Object.freeze({
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({
135
27
  max: 1,
136
28
  scroll: 1,
137
29
  bodyScroll: 1,
@@ -145,29 +37,30 @@ var $5180433265c858be$exports = {};
145
37
  checkOrigin: true,
146
38
  inPageLinks: false,
147
39
  enablePublicMethods: true,
148
- heightCalculationMethod: "bodyOffset",
149
- id: "iFrameResizer",
40
+ heightCalculationMethod: 'bodyOffset',
41
+ id: 'iFrameResizer',
150
42
  interval: 32,
43
+ license: '1jqr0si6pnt',
151
44
  log: false,
152
45
  maxHeight: Infinity,
153
46
  maxWidth: Infinity,
154
47
  minHeight: 0,
155
48
  minWidth: 0,
156
49
  mouseEvents: true,
157
- resizeFrom: "parent",
50
+ resizeFrom: 'parent',
158
51
  scrolling: false,
159
52
  sizeHeight: true,
160
53
  sizeWidth: false,
161
54
  warningTimeout: 5000,
162
55
  tolerance: 0,
163
- widthCalculationMethod: "scroll",
56
+ widthCalculationMethod: 'scroll',
164
57
  onClose: function() {
165
58
  return true;
166
59
  },
167
60
  onClosed: function() {},
168
61
  onInit: function() {},
169
62
  onMessage: function() {
170
- warn("onMessage function not defined");
63
+ warn('onMessage function not defined');
171
64
  },
172
65
  onMouseEnter: function() {},
173
66
  onMouseLeave: function() {},
@@ -187,42 +80,42 @@ var $5180433265c858be$exports = {};
187
80
  }
188
81
  function setupRequestAnimationFrame() {
189
82
  var vendors = [
190
- "moz",
191
- "webkit",
192
- "o",
193
- "ms"
83
+ 'moz',
84
+ 'webkit',
85
+ 'o',
86
+ 'ms'
194
87
  ];
195
88
  var x;
196
89
  // Remove vendor prefixing if prefixed and break early if not
197
- for(x = 0; x < vendors.length && !requestAnimationFrame; x += 1)requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"];
90
+ for(x = 0; x < vendors.length && !requestAnimationFrame; x += 1)requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
198
91
  if (requestAnimationFrame) // Firefox extension content-scripts have a globalThis object that is not the same as window.
199
92
  // Binding `requestAnimationFrame` to window allows the function to work and prevents errors
200
93
  // being thrown when run in that context, and should be a no-op in every other context.
201
94
  requestAnimationFrame = requestAnimationFrame.bind(window);
202
- else log("setup", "RequestAnimationFrame not supported");
95
+ else log('setup', 'RequestAnimationFrame not supported');
203
96
  }
204
97
  function getMyID(iframeId) {
205
- var retStr = "Host page: " + iframeId;
206
- if (window.top !== window.self) retStr = window.parentIFrame && window.parentIFrame.getId ? window.parentIFrame.getId() + ": " + iframeId : "Nested host page: " + 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;
207
100
  return retStr;
208
101
  }
209
102
  function formatLogHeader(iframeId) {
210
- return msgId + "[" + getMyID(iframeId) + "]";
103
+ return msgId + '[' + getMyID(iframeId) + ']';
211
104
  }
212
105
  function isLogEnabled(iframeId) {
213
106
  return settings[iframeId] ? settings[iframeId].log : logEnabled;
214
107
  }
215
108
  function log(iframeId, msg) {
216
- output("log", iframeId, msg, isLogEnabled(iframeId));
109
+ output('log', iframeId, msg, isLogEnabled(iframeId));
217
110
  }
218
111
  function info(iframeId, msg) {
219
- output("info", iframeId, msg, isLogEnabled(iframeId));
112
+ output('info', iframeId, msg, isLogEnabled(iframeId));
220
113
  }
221
114
  function warn(iframeId, msg) {
222
- output("warn", iframeId, msg, true);
115
+ output('warn', iframeId, msg, true);
223
116
  }
224
117
  function output(type, iframeId, msg, enabled) {
225
- if (true === enabled && "object" === typeof window.console) // eslint-disable-next-line no-console
118
+ if (true === enabled && 'object' === typeof window.console) // eslint-disable-next-line no-console
226
119
  console[type](formatLogHeader(iframeId), msg);
227
120
  }
228
121
  function iFrameListener(event) {
@@ -230,14 +123,14 @@ var $5180433265c858be$exports = {};
230
123
  function resize() {
231
124
  setSize(messageData);
232
125
  setPagePosition(iframeId);
233
- on("onResized", messageData);
126
+ on('onResized', messageData);
234
127
  }
235
- ensureInRange("Height");
236
- ensureInRange("Width");
237
- syncResize(resize, messageData, "init");
128
+ ensureInRange('Height');
129
+ ensureInRange('Width');
130
+ syncResize(resize, messageData, 'init');
238
131
  }
239
132
  function processMsg() {
240
- var data = msg.slice(msgIdLen).split(":");
133
+ var data = msg.slice(msgIdLen).split(':');
241
134
  var height = data[1] ? parseInt(data[1], 10) : 0;
242
135
  var iframe = settings[data[0]] && settings[data[0]].iframe;
243
136
  var compStyle = getComputedStyle(iframe);
@@ -250,35 +143,35 @@ var $5180433265c858be$exports = {};
250
143
  };
251
144
  }
252
145
  function getPaddingEnds(compStyle) {
253
- if (compStyle.boxSizing !== "border-box") return 0;
146
+ if (compStyle.boxSizing !== 'border-box') return 0;
254
147
  var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
255
148
  var bot = compStyle.paddingBottom ? parseInt(compStyle.paddingBottom, 10) : 0;
256
149
  return top + bot;
257
150
  }
258
151
  function getBorderEnds(compStyle) {
259
- if (compStyle.boxSizing !== "border-box") return 0;
152
+ if (compStyle.boxSizing !== 'border-box') return 0;
260
153
  var top = compStyle.borderTopWidth ? parseInt(compStyle.borderTopWidth, 10) : 0;
261
154
  var bot = compStyle.borderBottomWidth ? parseInt(compStyle.borderBottomWidth, 10) : 0;
262
155
  return top + bot;
263
156
  }
264
157
  function ensureInRange(Dimension) {
265
- var max = Number(settings[iframeId]["max" + Dimension]), min = Number(settings[iframeId]["min" + Dimension]), dimension = Dimension.toLowerCase(), size = Number(messageData[dimension]);
266
- log(iframeId, "Checking " + dimension + " is in range " + min + "-" + max);
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);
267
160
  if (size < min) {
268
161
  size = min;
269
- log(iframeId, "Set " + dimension + " to min value");
162
+ log(iframeId, 'Set ' + dimension + ' to min value');
270
163
  }
271
164
  if (size > max) {
272
165
  size = max;
273
- log(iframeId, "Set " + dimension + " to max value");
166
+ log(iframeId, 'Set ' + dimension + ' to max value');
274
167
  }
275
- messageData[dimension] = "" + size;
168
+ messageData[dimension] = '' + size;
276
169
  }
277
170
  function isMessageFromIFrame() {
278
171
  function checkAllowedOrigin() {
279
172
  function checkList() {
280
173
  var i = 0, retCode = false;
281
- log(iframeId, "Checking connection is from allowed list of origins: " + checkOrigin);
174
+ log(iframeId, 'Checking connection is from allowed list of origins: ' + checkOrigin);
282
175
  for(; i < checkOrigin.length; i++)if (checkOrigin[i] === origin) {
283
176
  retCode = true;
284
177
  break;
@@ -287,17 +180,17 @@ var $5180433265c858be$exports = {};
287
180
  }
288
181
  function checkSingle() {
289
182
  var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
290
- log(iframeId, "Checking connection is from: " + remoteHost);
183
+ log(iframeId, 'Checking connection is from: ' + remoteHost);
291
184
  return origin === remoteHost;
292
185
  }
293
186
  return checkOrigin.constructor === Array ? checkList() : checkSingle();
294
187
  }
295
188
  var origin = event.origin, checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
296
- 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.");
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.');
297
190
  return true;
298
191
  }
299
192
  function isMessageForUs() {
300
- return msgId === ("" + msg).slice(0, msgIdLen) && msg.slice(msgIdLen).split(":")[0] in settings // ''+Protects against non-string msg
193
+ return msgId === ('' + msg).slice(0, msgIdLen) && msg.slice(msgIdLen).split(':')[0] in settings // ''+Protects against non-string msg
301
194
  ;
302
195
  }
303
196
  function isMessageFromMetaParent() {
@@ -308,19 +201,19 @@ var $5180433265c858be$exports = {};
308
201
  false: 1,
309
202
  undefined: 1
310
203
  };
311
- if (retCode) log(iframeId, "Ignoring init message from meta parent page");
204
+ if (retCode) log(iframeId, 'Ignoring init message from meta parent page');
312
205
  return retCode;
313
206
  }
314
207
  function getMsgBody(offset) {
315
- return msg.slice(msg.indexOf(":") + msgHeaderLen + offset);
208
+ return msg.slice(msg.indexOf(':') + msgHeaderLen + offset);
316
209
  }
317
210
  function forwardMsgFromIFrame(msgBody) {
318
- log(iframeId, "onMessage passed: {iframe: " + messageData.iframe.id + ", message: " + msgBody + "}");
319
- on("onMessage", {
211
+ log(iframeId, 'onMessage passed: {iframe: ' + messageData.iframe.id + ', message: ' + msgBody + '}');
212
+ on('onMessage', {
320
213
  iframe: messageData.iframe,
321
214
  message: JSON.parse(msgBody)
322
215
  });
323
- log(iframeId, "--");
216
+ log(iframeId, '--');
324
217
  }
325
218
  function getPageInfo() {
326
219
  var bodyPosition = document.body.getBoundingClientRect(), iFramePosition = messageData.iframe.getBoundingClientRect();
@@ -341,7 +234,7 @@ var $5180433265c858be$exports = {};
341
234
  }
342
235
  function sendPageInfoToIframe(iframe, iframeId) {
343
236
  function debouncedTrigger() {
344
- trigger("Send Page Info", "pageInfo:" + getPageInfo(), iframe, iframeId);
237
+ trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
345
238
  }
346
239
  debounceFrameEvents(debouncedTrigger, 32, iframeId);
347
240
  }
@@ -352,18 +245,18 @@ var $5180433265c858be$exports = {};
352
245
  else stop();
353
246
  }
354
247
  [
355
- "scroll",
356
- "resize"
248
+ 'scroll',
249
+ 'resize'
357
250
  ].forEach(function(evt) {
358
- log(id, type + evt + " listener for sendPageInfo");
251
+ log(id, type + evt + ' listener for sendPageInfo');
359
252
  func(window, evt, sendPageInfo);
360
253
  });
361
254
  }
362
255
  function stop() {
363
- setListener("Remove ", removeEventListener);
256
+ setListener('Remove ', removeEventListener);
364
257
  }
365
258
  function start() {
366
- setListener("Add ", addEventListener);
259
+ setListener('Add ', addEventListener);
367
260
  }
368
261
  var id = iframeId // Create locally scoped copy of iFrame ID
369
262
  ;
@@ -379,7 +272,7 @@ var $5180433265c858be$exports = {};
379
272
  function checkIFrameExists() {
380
273
  var retBool = true;
381
274
  if (null === messageData.iframe) {
382
- warn(iframeId, "IFrame (" + messageData.id + ") not found");
275
+ warn(iframeId, 'IFrame (' + messageData.id + ') not found');
383
276
  retBool = false;
384
277
  }
385
278
  return retBool;
@@ -397,7 +290,7 @@ var $5180433265c858be$exports = {};
397
290
  function reposition() {
398
291
  pagePosition = newPosition;
399
292
  scrollTo();
400
- log(iframeId, "--");
293
+ log(iframeId, '--');
401
294
  }
402
295
  function calcOffset() {
403
296
  return {
@@ -406,45 +299,45 @@ var $5180433265c858be$exports = {};
406
299
  };
407
300
  }
408
301
  function scrollParent() {
409
- if (window.parentIFrame) window.parentIFrame["scrollTo" + (addOffset ? "Offset" : "")](newPosition.x, newPosition.y);
410
- else warn(iframeId, "Unable to scroll to requested position, window.parentIFrame not found");
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');
411
304
  }
412
305
  var offset = addOffset ? getElementPosition(messageData.iframe) : {
413
306
  x: 0,
414
307
  y: 0
415
308
  }, newPosition = calcOffset();
416
- log(iframeId, "Reposition requested from iFrame (offset x:" + offset.x + " y:" + offset.y + ")");
309
+ log(iframeId, 'Reposition requested from iFrame (offset x:' + offset.x + ' y:' + offset.y + ')');
417
310
  if (window.top === window.self) reposition();
418
311
  else scrollParent();
419
312
  }
420
313
  function scrollTo() {
421
- if (false === on("onScroll", pagePosition)) unsetPagePosition();
314
+ if (false === on('onScroll', pagePosition)) unsetPagePosition();
422
315
  else setPagePosition(iframeId);
423
316
  }
424
317
  function findTarget(location) {
425
318
  function jumpToTarget() {
426
319
  var jumpPosition = getElementPosition(target);
427
- log(iframeId, "Moving to in page link (#" + hash + ") at x: " + jumpPosition.x + " y: " + jumpPosition.y);
320
+ log(iframeId, 'Moving to in page link (#' + hash + ') at x: ' + jumpPosition.x + ' y: ' + jumpPosition.y);
428
321
  pagePosition = {
429
322
  x: jumpPosition.x,
430
323
  y: jumpPosition.y
431
324
  };
432
325
  scrollTo();
433
- log(iframeId, "--");
326
+ log(iframeId, '--');
434
327
  }
435
328
  function jumpToParent() {
436
329
  if (window.parentIFrame) window.parentIFrame.moveToAnchor(hash);
437
- else log(iframeId, "In page link #" + hash + " not found and window.parentIFrame not found");
330
+ else log(iframeId, 'In page link #' + hash + ' not found and window.parentIFrame not found');
438
331
  }
439
- var hash = location.split("#")[1] || "", hashData = decodeURIComponent(hash), target = document.getElementById(hashData) || document.getElementsByName(hashData)[0];
332
+ var hash = location.split('#')[1] || '', hashData = decodeURIComponent(hash), target = document.getElementById(hashData) || document.getElementsByName(hashData)[0];
440
333
  if (target) jumpToTarget();
441
- else if (window.top === window.self) log(iframeId, "In page link #" + hash + " not found");
334
+ else if (window.top === window.self) log(iframeId, 'In page link #' + hash + ' not found');
442
335
  else jumpToParent();
443
336
  }
444
337
  function onMouse(event) {
445
338
  var mousePos = {};
446
339
  if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
447
- var data = getMsgBody(9).split(":");
340
+ var data = getMsgBody(9).split(':');
448
341
  mousePos = {
449
342
  x: data[1],
450
343
  y: data[0]
@@ -466,46 +359,46 @@ var $5180433265c858be$exports = {};
466
359
  function actionMsg() {
467
360
  if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
468
361
  switch(messageData.type){
469
- case "close":
362
+ case 'close':
470
363
  closeIFrame(messageData.iframe);
471
364
  break;
472
- case "message":
365
+ case 'message':
473
366
  forwardMsgFromIFrame(getMsgBody(6));
474
367
  break;
475
- case "mouseenter":
476
- onMouse("onMouseEnter");
368
+ case 'mouseenter':
369
+ onMouse('onMouseEnter');
477
370
  break;
478
- case "mouseleave":
479
- onMouse("onMouseLeave");
371
+ case 'mouseleave':
372
+ onMouse('onMouseLeave');
480
373
  break;
481
- case "autoResize":
374
+ case 'autoResize':
482
375
  settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
483
376
  break;
484
- case "scrollTo":
377
+ case 'scrollTo':
485
378
  scrollRequestFromChild(false);
486
379
  break;
487
- case "scrollToOffset":
380
+ case 'scrollToOffset':
488
381
  scrollRequestFromChild(true);
489
382
  break;
490
- case "pageInfo":
383
+ case 'pageInfo':
491
384
  sendPageInfoToIframe(settings[iframeId] && settings[iframeId].iframe, iframeId);
492
385
  startPageInfoMonitor();
493
386
  break;
494
- case "pageInfoStop":
387
+ case 'pageInfoStop':
495
388
  stopPageInfoMonitor();
496
389
  break;
497
- case "inPageLink":
390
+ case 'inPageLink':
498
391
  findTarget(getMsgBody(9));
499
392
  break;
500
- case "reset":
393
+ case 'reset':
501
394
  resetIFrame(messageData);
502
395
  break;
503
- case "init":
396
+ case 'init':
504
397
  resizeIFrame();
505
- on("onInit", messageData.iframe);
398
+ on('onInit', messageData.iframe);
506
399
  break;
507
400
  default:
508
- 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");
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');
509
402
  else resizeIFrame();
510
403
  }
511
404
  }
@@ -513,35 +406,35 @@ var $5180433265c858be$exports = {};
513
406
  var retBool = true;
514
407
  if (!settings[iframeId]) {
515
408
  retBool = false;
516
- warn(messageData.type + " No settings for " + iframeId + ". Message was: " + msg);
409
+ warn(messageData.type + ' No settings for ' + iframeId + '. Message was: ' + msg);
517
410
  }
518
411
  return retBool;
519
412
  }
520
413
  function iFrameReadyMsgReceived() {
521
414
  // eslint-disable-next-line no-restricted-syntax, guard-for-in
522
- for(var iframeId in settings)trigger("iFrame requested init", createOutgoingMsg(iframeId), settings[iframeId].iframe, iframeId);
415
+ for(var iframeId in settings)trigger('iFrame requested init', createOutgoingMsg(iframeId), settings[iframeId].iframe, iframeId);
523
416
  }
524
417
  function firstRun() {
525
418
  if (settings[iframeId]) settings[iframeId].firstRun = false;
526
419
  }
527
420
  var msg = event.data, messageData = {}, iframeId = null;
528
- if ("[iFrameResizerChild]Ready" === msg) iFrameReadyMsgReceived();
421
+ if ('[iFrameResizerChild]Ready' === msg) iFrameReadyMsgReceived();
529
422
  else if (isMessageForUs()) {
530
423
  messageData = processMsg();
531
424
  iframeId = messageData.id;
532
425
  if (settings[iframeId]) settings[iframeId].loaded = true;
533
426
  if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
534
- log(iframeId, "Received: " + msg);
427
+ log(iframeId, 'Received: ' + msg);
535
428
  if (checkIFrameExists() && isMessageFromIFrame()) actionMsg();
536
429
  }
537
- } else info(iframeId, "Ignored: " + msg);
430
+ } else info(iframeId, 'Ignored: ' + msg);
538
431
  }
539
432
  function chkEvent(iframeId, funcName, val) {
540
433
  var func = null, retVal = null;
541
434
  if (settings[iframeId]) {
542
435
  func = settings[iframeId][funcName];
543
- if ("function" === typeof func) retVal = func(val);
544
- else throw new TypeError(funcName + " on iFrame[" + iframeId + "] is not a function");
436
+ if ('function' === typeof func) retVal = func(val);
437
+ else throw new TypeError(funcName + ' on iFrame[' + iframeId + '] is not a function');
545
438
  }
546
439
  return retVal;
547
440
  }
@@ -551,20 +444,24 @@ var $5180433265c858be$exports = {};
551
444
  }
552
445
  function closeIFrame(iframe) {
553
446
  var iframeId = iframe.id;
554
- if (chkEvent(iframeId, "onClose", iframeId) === false) {
555
- log(iframeId, "Close iframe cancelled by onClose event");
447
+ if (chkEvent(iframeId, 'onClose', iframeId) === false) {
448
+ log(iframeId, 'Close iframe cancelled by onClose event');
556
449
  return;
557
450
  }
558
- log(iframeId, "Removing iFrame: " + iframeId);
451
+ log(iframeId, 'Removing iFrame: ' + iframeId);
559
452
  try {
560
453
  // Catch race condition error with React
561
454
  if (iframe.parentNode) iframe.parentNode.removeChild(iframe);
562
455
  } catch (error) {
563
456
  warn(error);
564
457
  }
565
- chkEvent(iframeId, "onClosed", iframeId);
566
- log(iframeId, "--");
458
+ chkEvent(iframeId, 'onClosed', iframeId);
459
+ log(iframeId, '--');
567
460
  removeIframeListeners(iframe);
461
+ if (destroyObserver) {
462
+ destroyObserver.disconnect();
463
+ destroyObserver = null;
464
+ }
568
465
  }
569
466
  function getPagePosition(iframeId) {
570
467
  if (null === pagePosition) {
@@ -572,13 +469,13 @@ var $5180433265c858be$exports = {};
572
469
  x: window.pageXOffset === undefined ? document.documentElement.scrollLeft : window.pageXOffset,
573
470
  y: window.pageYOffset === undefined ? document.documentElement.scrollTop : window.pageYOffset
574
471
  };
575
- log(iframeId, "Get page position: " + pagePosition.x + "," + pagePosition.y);
472
+ log(iframeId, 'Get page position: ' + pagePosition.x + ',' + pagePosition.y);
576
473
  }
577
474
  }
578
475
  function setPagePosition(iframeId) {
579
476
  if (null !== pagePosition) {
580
477
  window.scrollTo(pagePosition.x, pagePosition.y);
581
- log(iframeId, "Set page position: " + pagePosition.x + "," + pagePosition.y);
478
+ log(iframeId, 'Set page position: ' + pagePosition.x + ',' + pagePosition.y);
582
479
  unsetPagePosition();
583
480
  }
584
481
  }
@@ -588,29 +485,29 @@ var $5180433265c858be$exports = {};
588
485
  function resetIFrame(messageData) {
589
486
  function reset() {
590
487
  setSize(messageData);
591
- trigger("reset", "reset", messageData.iframe, messageData.id);
488
+ trigger('reset', 'reset', messageData.iframe, messageData.id);
592
489
  }
593
- log(messageData.id, "Size reset requested by " + ("init" === messageData.type ? "host page" : "iFrame"));
490
+ log(messageData.id, 'Size reset requested by ' + ('init' === messageData.type ? 'host page' : 'iFrame'));
594
491
  getPagePosition(messageData.id);
595
- syncResize(reset, messageData, "reset");
492
+ syncResize(reset, messageData, 'reset');
596
493
  }
597
494
  function setSize(messageData) {
598
495
  function setDimension(dimension) {
599
496
  if (!messageData.id) {
600
- log("undefined", "messageData id not set");
497
+ log('undefined', 'messageData id not set');
601
498
  return;
602
499
  }
603
- messageData.iframe.style[dimension] = messageData[dimension] + "px";
604
- log(messageData.id, "IFrame (" + iframeId + ") " + dimension + " set to " + messageData[dimension] + "px");
500
+ messageData.iframe.style[dimension] = messageData[dimension] + 'px';
501
+ log(messageData.id, 'IFrame (' + iframeId + ') ' + dimension + ' set to ' + messageData[dimension] + 'px');
605
502
  }
606
503
  function chkZero(dimension) {
607
504
  // FireFox sets dimension of hidden iFrames to zero.
608
505
  // So if we detect that set up an event to check for
609
506
  // when iFrame becomes visible.
610
507
  /* istanbul ignore next */ // Not testable in PhantomJS
611
- if (!hiddenCheckEnabled && "0" === messageData[dimension]) {
508
+ if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
612
509
  hiddenCheckEnabled = true;
613
- log(iframeId, "Hidden iFrame detected, creating visibility listener");
510
+ log(iframeId, 'Hidden iFrame detected, creating visibility listener');
614
511
  fixHiddenIFrames();
615
512
  }
616
513
  }
@@ -620,29 +517,29 @@ var $5180433265c858be$exports = {};
620
517
  }
621
518
  var iframeId = messageData.iframe.id;
622
519
  if (settings[iframeId]) {
623
- if (settings[iframeId].sizeHeight) processDimension("height");
624
- if (settings[iframeId].sizeWidth) processDimension("width");
520
+ if (settings[iframeId].sizeHeight) processDimension('height');
521
+ if (settings[iframeId].sizeWidth) processDimension('width');
625
522
  }
626
523
  }
627
524
  function syncResize(func, messageData, doNotSync) {
628
525
  /* istanbul ignore if */ // Not testable in PhantomJS
629
526
  if (doNotSync !== messageData.type && requestAnimationFrame && // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
630
527
  !window.jasmine) {
631
- log(messageData.id, "Requesting animation frame");
528
+ log(messageData.id, 'Requesting animation frame');
632
529
  requestAnimationFrame(func);
633
530
  } else func();
634
531
  }
635
532
  function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
636
533
  function postMessageToIFrame() {
637
534
  var target = settings[id] && settings[id].targetOrigin;
638
- log(id, "[" + calleeMsg + "] Sending msg to iframe[" + id + "] (" + msg + ") targetOrigin: " + target);
535
+ log(id, '[' + calleeMsg + '] Sending msg to iframe[' + id + '] (' + msg + ') targetOrigin: ' + target);
639
536
  iframe.contentWindow.postMessage(msgId + msg, target);
640
537
  }
641
538
  function iFrameNotFound() {
642
- warn(id, "[" + calleeMsg + "] IFrame(" + id + ") not found");
539
+ warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
643
540
  }
644
541
  function chkAndSend() {
645
- if (iframe && "contentWindow" in iframe && null !== iframe.contentWindow) // Null test for PhantomJS
542
+ if (iframe && 'contentWindow' in iframe && null !== iframe.contentWindow) // Null test for PhantomJS
646
543
  postMessageToIFrame();
647
544
  else iFrameNotFound();
648
545
  }
@@ -650,7 +547,7 @@ var $5180433265c858be$exports = {};
650
547
  function warning() {
651
548
  if (settings[id] && !settings[id].loaded && !errorShown) {
652
549
  errorShown = true;
653
- 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.");
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.');
654
551
  }
655
552
  }
656
553
  if (!!noResponseWarning && settings[id] && !!settings[id].warningTimeout) settings[id].msgTimeout = setTimeout(warning, settings[id].warningTimeout);
@@ -663,29 +560,29 @@ var $5180433265c858be$exports = {};
663
560
  }
664
561
  }
665
562
  function createOutgoingMsg(iframeId) {
666
- 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;
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;
667
564
  }
668
565
  function isNumber(value) {
669
- return typeof value === "number";
566
+ return typeof value === 'number';
670
567
  }
671
568
  function setupIFrame(iframe, options) {
672
569
  function setLimits() {
673
570
  function addStyle(style) {
674
571
  var styleValue = settings[iframeId][style];
675
572
  if (Infinity !== styleValue && 0 !== styleValue) {
676
- iframe.style[style] = isNumber(styleValue) ? styleValue + "px" : styleValue;
677
- log(iframeId, "Set " + style + " = " + iframe.style[style]);
573
+ iframe.style[style] = isNumber(styleValue) ? styleValue + 'px' : styleValue;
574
+ log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
678
575
  }
679
576
  }
680
577
  function chkMinMax(dimension) {
681
- if (settings[iframeId]["min" + dimension] > settings[iframeId]["max" + dimension]) throw new Error("Value for min" + dimension + " can not be greater than max" + 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);
682
579
  }
683
- chkMinMax("Height");
684
- chkMinMax("Width");
685
- addStyle("maxHeight");
686
- addStyle("minHeight");
687
- addStyle("maxWidth");
688
- addStyle("minWidth");
580
+ chkMinMax('Height');
581
+ chkMinMax('Width');
582
+ addStyle('maxHeight');
583
+ addStyle('minHeight');
584
+ addStyle('maxWidth');
585
+ addStyle('minWidth');
689
586
  }
690
587
  function newId() {
691
588
  var id = options && options.id || defaults.id + count++;
@@ -693,38 +590,38 @@ var $5180433265c858be$exports = {};
693
590
  return id;
694
591
  }
695
592
  function ensureHasId(iframeId) {
696
- if (typeof iframeId !== "string") throw new TypeError("Invaild id for iFrame. Expected String");
697
- if ("" === iframeId) {
593
+ if (typeof iframeId !== 'string') throw new TypeError('Invaild id for iFrame. Expected String');
594
+ if ('' === iframeId) {
698
595
  // eslint-disable-next-line no-multi-assign
699
596
  iframe.id = iframeId = newId();
700
597
  logEnabled = (options || {}).log;
701
- log(iframeId, "Added missing iframe ID: " + iframeId + " (" + iframe.src + ")");
598
+ log(iframeId, 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')');
702
599
  }
703
600
  return iframeId;
704
601
  }
705
602
  function setScrolling() {
706
- log(iframeId, "IFrame scrolling " + (settings[iframeId] && settings[iframeId].scrolling ? "enabled" : "disabled") + " for " + iframeId);
707
- iframe.style.overflow = false === (settings[iframeId] && settings[iframeId].scrolling) ? "hidden" : "auto";
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';
708
605
  switch(settings[iframeId] && settings[iframeId].scrolling){
709
- case "omit":
606
+ case 'omit':
710
607
  break;
711
608
  case true:
712
- iframe.scrolling = "yes";
609
+ iframe.scrolling = 'yes';
713
610
  break;
714
611
  case false:
715
- iframe.scrolling = "no";
612
+ iframe.scrolling = 'no';
716
613
  break;
717
614
  default:
718
- iframe.scrolling = settings[iframeId] ? settings[iframeId].scrolling : "no";
615
+ iframe.scrolling = settings[iframeId] ? settings[iframeId].scrolling : 'no';
719
616
  }
720
617
  }
721
618
  // The V1 iFrame script expects an int, where as in V2 expects a CSS
722
619
  // string value such as '1px 3em', so if we have an int for V2, set V1=V2
723
620
  // and then convert V2 to a string PX value.
724
621
  function setupBodyMarginValues() {
725
- if ("number" === typeof (settings[iframeId] && settings[iframeId].bodyMargin) || "0" === (settings[iframeId] && settings[iframeId].bodyMargin)) {
622
+ if ('number' === typeof (settings[iframeId] && settings[iframeId].bodyMargin) || '0' === (settings[iframeId] && settings[iframeId].bodyMargin)) {
726
623
  settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
727
- settings[iframeId].bodyMargin = "" + settings[iframeId].bodyMargin + "px";
624
+ settings[iframeId].bodyMargin = '' + settings[iframeId].bodyMargin + 'px';
728
625
  }
729
626
  }
730
627
  function checkReset() {
@@ -736,20 +633,20 @@ var $5180433265c858be$exports = {};
736
633
  iframe: iframe,
737
634
  height: 0,
738
635
  width: 0,
739
- type: "init"
636
+ type: 'init'
740
637
  });
741
638
  }
742
639
  function setupIFrameObject() {
743
640
  if (settings[iframeId]) settings[iframeId].iframe.iFrameResizer = {
744
641
  close: closeIFrame.bind(null, settings[iframeId].iframe),
745
642
  removeListeners: removeIframeListeners.bind(null, settings[iframeId].iframe),
746
- resize: trigger.bind(null, "Window resize", "resize", settings[iframeId].iframe),
643
+ resize: trigger.bind(null, 'Window resize', 'resize', settings[iframeId].iframe),
747
644
  moveToAnchor: function(anchor) {
748
- trigger("Move to anchor", "moveToAnchor:" + anchor, settings[iframeId].iframe, iframeId);
645
+ trigger('Move to anchor', 'moveToAnchor:' + anchor, settings[iframeId].iframe, iframeId);
749
646
  },
750
647
  sendMessage: function(message) {
751
648
  message = JSON.stringify(message);
752
- trigger("Send Message", "message:" + message, settings[iframeId].iframe, iframeId);
649
+ trigger('Send Message', 'message:' + message, settings[iframeId].iframe, iframeId);
753
650
  }
754
651
  };
755
652
  }
@@ -758,11 +655,11 @@ var $5180433265c858be$exports = {};
758
655
  // event listener also catches the page changing in the iFrame.
759
656
  function init(msg) {
760
657
  function iFrameLoaded() {
761
- trigger("iFrame.onload", msg, iframe, undefined, true);
658
+ trigger('iFrame.onload', msg, iframe, undefined, true);
762
659
  checkReset();
763
660
  }
764
661
  function createDestroyObserver(MutationObserver) {
765
- if (!iframe.parentNode) return;
662
+ if (!iframe.parentNode) return null;
766
663
  var destroyObserver = new MutationObserver(function(mutations) {
767
664
  mutations.forEach(function(mutation) {
768
665
  var removedNodes = Array.prototype.slice.call(mutation.removedNodes) // Transform NodeList into an Array
@@ -775,26 +672,27 @@ var $5180433265c858be$exports = {};
775
672
  destroyObserver.observe(iframe.parentNode, {
776
673
  childList: true
777
674
  });
675
+ return destroyObserver;
778
676
  }
779
677
  var MutationObserver = getMutationObserver();
780
- if (MutationObserver) createDestroyObserver(MutationObserver);
781
- addEventListener(iframe, "load", iFrameLoaded);
782
- trigger("init", msg, iframe, undefined, true);
678
+ if (MutationObserver) destroyObserver = createDestroyObserver(MutationObserver);
679
+ addEventListener(iframe, 'load', iFrameLoaded);
680
+ trigger('init', msg, iframe, undefined, true);
783
681
  }
784
682
  function checkOptions(options) {
785
- if ("object" !== typeof options) throw new TypeError("Options is not an object");
683
+ if ('object' !== typeof options) throw new TypeError('Options is not an object');
786
684
  }
787
685
  function copyOptions(options) {
788
686
  // eslint-disable-next-line no-restricted-syntax
789
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];
790
688
  }
791
689
  function getTargetOrigin(remoteHost) {
792
- return "" === remoteHost || null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/) ? "*" : remoteHost;
690
+ return '' === remoteHost || null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/) ? '*' : remoteHost;
793
691
  }
794
692
  function depricate(key) {
795
- var splitName = key.split("Callback");
693
+ var splitName = key.split('Callback');
796
694
  if (splitName.length === 2) {
797
- var name = "on" + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
695
+ var name = 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
798
696
  this[name] = this[key];
799
697
  delete this[key];
800
698
  warn(iframeId, "Deprecated: '" + key + "' has been renamed '" + name + "'. The old method will be removed in the next major version.");
@@ -806,17 +704,17 @@ var $5180433265c858be$exports = {};
806
704
  ;
807
705
  settings[iframeId].iframe = iframe;
808
706
  settings[iframeId].firstRun = true;
809
- settings[iframeId].remoteHost = iframe.src && iframe.src.split("/").slice(0, 3).join("/");
707
+ settings[iframeId].remoteHost = iframe.src && iframe.src.split('/').slice(0, 3).join('/');
810
708
  checkOptions(options);
811
709
  Object.keys(options).forEach(depricate, options);
812
710
  copyOptions(options);
813
- if (settings[iframeId]) settings[iframeId].targetOrigin = true === settings[iframeId].checkOrigin ? getTargetOrigin(settings[iframeId].remoteHost) : "*";
711
+ if (settings[iframeId]) settings[iframeId].targetOrigin = true === settings[iframeId].checkOrigin ? getTargetOrigin(settings[iframeId].remoteHost) : '*';
814
712
  }
815
713
  function beenHere() {
816
- return iframeId in settings && "iFrameResizer" in iframe;
714
+ return iframeId in settings && 'iFrameResizer' in iframe;
817
715
  }
818
716
  var iframeId = ensureHasId(iframe.id);
819
- if (beenHere()) warn(iframeId, "Ignored iFrame, already setup.");
717
+ if (beenHere()) warn(iframeId, 'Ignored iFrame, already setup.');
820
718
  else {
821
719
  processOptions(options);
822
720
  setScrolling();
@@ -844,23 +742,23 @@ var $5180433265c858be$exports = {};
844
742
  function checkIFrames() {
845
743
  function checkIFrame(settingId) {
846
744
  function chkDimension(dimension) {
847
- return "0px" === (settings[settingId] && settings[settingId].iframe.style[dimension]);
745
+ return '0px' === (settings[settingId] && settings[settingId].iframe.style[dimension]);
848
746
  }
849
747
  function isVisible(el) {
850
748
  return null !== el.offsetParent;
851
749
  }
852
- if (settings[settingId] && isVisible(settings[settingId].iframe) && (chkDimension("height") || chkDimension("width"))) trigger("Visibility change", "resize", settings[settingId].iframe, settingId);
750
+ if (settings[settingId] && isVisible(settings[settingId].iframe) && (chkDimension('height') || chkDimension('width'))) trigger('Visibility change', 'resize', settings[settingId].iframe, settingId);
853
751
  }
854
752
  Object.keys(settings).forEach(function(key) {
855
753
  checkIFrame(key);
856
754
  });
857
755
  }
858
756
  function mutationObserved(mutations) {
859
- log("window", "Mutation observed: " + mutations[0].target + " " + mutations[0].type);
757
+ log('window', 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type);
860
758
  debouce(checkIFrames, 16);
861
759
  }
862
760
  function createMutationObserver() {
863
- var target = document.querySelector("body"), config = {
761
+ var target = document.querySelector('body'), config = {
864
762
  attributes: true,
865
763
  attributeOldValue: false,
866
764
  characterData: true,
@@ -875,42 +773,42 @@ var $5180433265c858be$exports = {};
875
773
  }
876
774
  function resizeIFrames(event) {
877
775
  function resize() {
878
- sendTriggerMsg("Window " + event, "resize");
776
+ sendTriggerMsg('Window ' + event, 'resize');
879
777
  }
880
- log("window", "Trigger event: " + event);
778
+ log('window', 'Trigger event: ' + event);
881
779
  debouce(resize, 16);
882
780
  }
883
781
  // Not testable in PhantomJS
884
782
  /* istanbul ignore next */ function tabVisible() {
885
783
  function resize() {
886
- sendTriggerMsg("Tab Visible", "resize");
784
+ sendTriggerMsg('Tab Visible', 'resize');
887
785
  }
888
- if ("hidden" !== document.visibilityState) {
889
- log("document", "Trigger event: Visibility change");
786
+ if ('hidden' !== document.visibilityState) {
787
+ log('document', 'Trigger event: Visibility change');
890
788
  debouce(resize, 16);
891
789
  }
892
790
  }
893
791
  function sendTriggerMsg(eventName, event) {
894
792
  function isIFrameResizeEnabled(iframeId) {
895
- return settings[iframeId] && "parent" === settings[iframeId].resizeFrom && settings[iframeId].autoResize && !settings[iframeId].firstRun;
793
+ return settings[iframeId] && 'parent' === settings[iframeId].resizeFrom && settings[iframeId].autoResize && !settings[iframeId].firstRun;
896
794
  }
897
795
  Object.keys(settings).forEach(function(iframeId) {
898
796
  if (isIFrameResizeEnabled(iframeId)) trigger(eventName, event, settings[iframeId].iframe, iframeId);
899
797
  });
900
798
  }
901
799
  function setupEventListeners() {
902
- addEventListener(window, "message", iFrameListener);
903
- addEventListener(window, "resize", function() {
904
- resizeIFrames("resize");
800
+ addEventListener(window, 'message', iFrameListener);
801
+ addEventListener(window, 'resize', function() {
802
+ resizeIFrames('resize');
905
803
  });
906
- addEventListener(document, "visibilitychange", tabVisible);
907
- addEventListener(document, "-webkit-visibilitychange", tabVisible);
804
+ addEventListener(document, 'visibilitychange', tabVisible);
805
+ addEventListener(document, '-webkit-visibilitychange', tabVisible);
908
806
  }
909
807
  function factory() {
910
808
  function init(options, element) {
911
809
  function chkType() {
912
- if (!element.tagName) throw new TypeError("Object is not a valid DOM element");
913
- else if ("IFRAME" !== element.tagName.toUpperCase()) throw new TypeError("Expected <IFRAME> tag, found <" + element.tagName + ">");
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 + '>');
914
812
  }
915
813
  if (element) {
916
814
  chkType();
@@ -919,7 +817,7 @@ var $5180433265c858be$exports = {};
919
817
  }
920
818
  }
921
819
  function warnDeprecatedOptions(options) {
922
- if (options && options.enablePublicMethods) warn("enablePublicMethods option has been removed, public methods are now always available in the iFrame");
820
+ if (options && options.enablePublicMethods) warn('enablePublicMethods option has been removed, public methods are now always available in the iFrame');
923
821
  }
924
822
  var iFrames;
925
823
  setupRequestAnimationFrame();
@@ -929,36 +827,119 @@ var $5180433265c858be$exports = {};
929
827
  ;
930
828
  warnDeprecatedOptions(options);
931
829
  switch(typeof target){
932
- case "undefined":
933
- case "string":
934
- Array.prototype.forEach.call(document.querySelectorAll(target || "iframe"), init.bind(undefined, options));
830
+ case 'undefined':
831
+ case 'string':
832
+ Array.prototype.forEach.call(document.querySelectorAll(target || 'iframe'), init.bind(undefined, options));
935
833
  break;
936
- case "object":
834
+ case 'object':
937
835
  init(options, target);
938
836
  break;
939
837
  default:
940
- throw new TypeError("Unexpected data type (" + typeof target + ")");
838
+ throw new TypeError('Unexpected data type (' + typeof target + ')');
941
839
  }
942
840
  return iFrames;
943
841
  };
944
842
  }
945
843
  function createJQueryPublicMethod($) {
946
- if (!$.fn) info("", "Unable to bind to jQuery, it is not fully loaded.");
844
+ if (!$.fn) info('', 'Unable to bind to jQuery, it is not fully loaded.');
947
845
  else if (!$.fn.iFrameResize) $.fn.iFrameResize = function $iFrameResizeF(options) {
948
846
  function init(index, element) {
949
847
  setupIFrame(element, options);
950
848
  }
951
- return this.filter("iframe").each(init).end();
849
+ return this.filter('iframe').each(init).end();
952
850
  };
953
851
  }
954
852
  if (window.jQuery !== undefined) createJQueryPublicMethod(window.jQuery);
955
- if (typeof define === "function" && define.amd) define([], factory);
956
- else if (typeof $5180433265c858be$exports === "object") // Node for browserfy
853
+ if (typeof define === 'function' && define.amd) define([], factory);
854
+ else if (typeof $5180433265c858be$exports === 'object') // Node for browserfy
957
855
  $5180433265c858be$exports = factory();
958
856
  window.iFrameResize = window.iFrameResize || factory();
959
857
  })();
960
858
 
961
859
 
962
- parcelRequire("6RQZy");
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
+
963
944
 
964
945
  })();