pageflow 15.6.1 → 15.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +253 -11
  3. data/README.md +1 -2
  4. data/admins/pageflow/entry.rb +28 -57
  5. data/admins/pageflow/membership.rb +5 -1
  6. data/admins/pageflow/user.rb +1 -3
  7. data/app/assets/images/pageflow/admin/icons/buttons/editor.svg +2 -0
  8. data/app/assets/images/pageflow/admin/icons/buttons/preview.svg +2 -0
  9. data/app/assets/images/pageflow/admin/icons/buttons/show_public.svg +2 -0
  10. data/app/assets/images/pageflow/admin/icons/delete.svg +9 -0
  11. data/app/assets/images/pageflow/admin/icons/done.svg +6 -0
  12. data/app/assets/images/pageflow/admin/icons/edit.svg +7 -0
  13. data/app/assets/images/pageflow/admin/icons/editor.svg +2 -0
  14. data/app/assets/images/pageflow/admin/icons/folder.svg +8 -0
  15. data/app/assets/images/pageflow/admin/icons/folder_active.svg +8 -0
  16. data/app/assets/images/pageflow/admin/icons/info.svg +3 -0
  17. data/app/assets/images/pageflow/admin/icons/new.svg +5 -0
  18. data/app/assets/images/pageflow/admin/icons/preview.svg +2 -0
  19. data/app/assets/images/pageflow/admin/icons/published.svg +2 -0
  20. data/app/assets/images/pageflow/admin/icons/published_with_password.svg +2 -0
  21. data/app/assets/images/pageflow/admin/icons/show_public.svg +2 -0
  22. data/app/assets/images/pageflow/editor/blank_entry/logo.png +0 -0
  23. data/app/assets/images/pageflow/themes/default/embed_opt_in.svg +3 -0
  24. data/app/assets/images/pageflow/themes/default/embed_opt_out_info.svg +16 -0
  25. data/app/assets/javascripts/pageflow/admin/entries.js +9 -57
  26. data/app/assets/javascripts/pageflow/dist/editor.js +11890 -0
  27. data/app/assets/javascripts/pageflow/dist/frontend.js +5800 -0
  28. data/app/assets/javascripts/pageflow/dist/react-client.js +22 -0
  29. data/app/assets/javascripts/pageflow/dist/react-server.js +19 -0
  30. data/app/assets/javascripts/pageflow/dist/ui.js +127 -10
  31. data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +18 -16
  32. data/app/assets/stylesheets/pageflow/admin/badge_list.scss +25 -35
  33. data/app/assets/stylesheets/pageflow/admin/columns.scss +13 -11
  34. data/app/assets/stylesheets/pageflow/admin/embed_code.scss +1 -4
  35. data/app/assets/stylesheets/pageflow/admin/entries/folders.scss +44 -19
  36. data/app/assets/stylesheets/pageflow/admin/entries.scss +15 -31
  37. data/app/assets/stylesheets/pageflow/admin/features.scss +3 -1
  38. data/app/assets/stylesheets/pageflow/admin/forms.scss +14 -12
  39. data/app/assets/stylesheets/pageflow/admin/hint.scss +8 -14
  40. data/app/assets/stylesheets/pageflow/admin/icon_button.scss +25 -14
  41. data/app/assets/stylesheets/pageflow/admin/icon_link.scss +31 -15
  42. data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +14 -7
  43. data/app/assets/stylesheets/pageflow/admin/status_tags.scss +5 -4
  44. data/app/assets/stylesheets/pageflow/admin/tabs_view.scss +36 -34
  45. data/app/assets/stylesheets/pageflow/admin/tooltip_bubble.scss +15 -11
  46. data/app/assets/stylesheets/pageflow/admin.scss +12 -0
  47. data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +15 -61
  48. data/app/assets/stylesheets/pageflow/editor/base.scss +28 -13
  49. data/app/assets/stylesheets/pageflow/editor/blank_entry.scss +6 -6
  50. data/app/assets/stylesheets/pageflow/editor/change_theme.scss +28 -71
  51. data/app/assets/stylesheets/pageflow/editor/composables.scss +2 -2
  52. data/app/assets/stylesheets/pageflow/editor/confirm_encoding.scss +18 -36
  53. data/app/assets/stylesheets/pageflow/editor/confirm_upload.scss +12 -39
  54. data/app/assets/stylesheets/pageflow/editor/dialogs.scss +39 -12
  55. data/app/assets/stylesheets/pageflow/editor/disabled_atmo_indicator.scss +3 -3
  56. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +7 -10
  57. data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +3 -8
  58. data/app/assets/stylesheets/pageflow/editor/failures.scss +3 -3
  59. data/app/assets/stylesheets/pageflow/editor/file_import.scss +22 -38
  60. data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +3 -7
  61. data/app/assets/stylesheets/pageflow/editor/file_settings_dialog.scss +4 -24
  62. data/app/assets/stylesheets/pageflow/editor/file_stages.scss +10 -11
  63. data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +4 -8
  64. data/app/assets/stylesheets/pageflow/editor/files.scss +7 -6
  65. data/app/assets/stylesheets/pageflow/editor/files_explorer.scss +13 -30
  66. data/app/assets/stylesheets/pageflow/editor/files_gallery.scss +15 -11
  67. data/app/assets/stylesheets/pageflow/editor/filtered_files.scss +6 -7
  68. data/app/assets/stylesheets/pageflow/editor/help.scss +19 -14
  69. data/app/assets/stylesheets/pageflow/editor/help_image.scss +1 -1
  70. data/app/assets/stylesheets/pageflow/editor/info_box.scss +19 -0
  71. data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +7 -11
  72. data/app/assets/stylesheets/pageflow/editor/inputs/file_processing_state_display.scss +0 -2
  73. data/app/assets/stylesheets/pageflow/editor/inputs/reference.scss +7 -11
  74. data/app/assets/stylesheets/pageflow/editor/list.scss +13 -10
  75. data/app/assets/stylesheets/pageflow/editor/loading.scss +1 -1
  76. data/app/assets/stylesheets/pageflow/editor/locked.scss +9 -5
  77. data/app/assets/stylesheets/pageflow/editor/menu.scss +5 -5
  78. data/app/assets/stylesheets/pageflow/editor/notifications.scss +15 -14
  79. data/app/assets/stylesheets/pageflow/editor/other_entry_item.scss +7 -3
  80. data/app/assets/stylesheets/pageflow/editor/outline.scss +57 -19
  81. data/app/assets/stylesheets/pageflow/editor/page_links.scss +10 -8
  82. data/app/assets/stylesheets/pageflow/editor/page_selection.scss +2 -29
  83. data/app/assets/stylesheets/pageflow/editor/publish_entry.scss +5 -6
  84. data/app/assets/stylesheets/pageflow/editor/quotas.scss +2 -3
  85. data/app/assets/stylesheets/pageflow/editor/select_button.scss +12 -6
  86. data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +1 -5
  87. data/app/assets/stylesheets/pageflow/editor/storyline_picker.scss +6 -2
  88. data/app/assets/stylesheets/pageflow/editor/text_tracks.scss +6 -22
  89. data/app/assets/stylesheets/pageflow/editor/widgets.scss +2 -2
  90. data/app/assets/stylesheets/pageflow/editor/wysihtml5.scss +35 -29
  91. data/app/assets/stylesheets/pageflow/mixins/background_icons.scss +3 -3
  92. data/app/assets/stylesheets/pageflow/mixins/buttons.scss +50 -68
  93. data/app/assets/stylesheets/pageflow/themes/default/base.scss +2 -0
  94. data/app/assets/stylesheets/pageflow/themes/default/consent/bar.scss +156 -0
  95. data/app/assets/stylesheets/pageflow/themes/default/consent/vendor_list.scss +62 -0
  96. data/app/assets/stylesheets/pageflow/themes/default/consent.scss +2 -0
  97. data/app/assets/stylesheets/pageflow/themes/default/logo/alignment.scss +7 -0
  98. data/app/assets/stylesheets/pageflow/themes/default/page/shadow.scss +44 -0
  99. data/app/assets/stylesheets/pageflow/themes/default/third_party_embed_consent.scss +103 -0
  100. data/app/assets/stylesheets/pageflow/ui/forms.scss +79 -84
  101. data/app/assets/stylesheets/pageflow/ui/functions.scss +56 -0
  102. data/app/assets/stylesheets/pageflow/ui/input/check_box_group_input.scss +2 -3
  103. data/app/assets/stylesheets/pageflow/ui/input/color_input.scss +6 -6
  104. data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.scss +63 -50
  105. data/app/assets/stylesheets/pageflow/ui/normalize/forms.scss +153 -0
  106. data/app/assets/stylesheets/pageflow/ui/normalize.scss +278 -0
  107. data/app/assets/stylesheets/pageflow/ui/properties.scss +44 -0
  108. data/app/assets/stylesheets/pageflow/ui/table_cells/delete_row_table_cell.scss +1 -1
  109. data/app/assets/stylesheets/pageflow/ui/table_view.scss +14 -18
  110. data/app/assets/stylesheets/pageflow/ui/tabs_view.scss +8 -11
  111. data/app/assets/stylesheets/pageflow/ui/tooltip.scss +6 -8
  112. data/app/assets/stylesheets/pageflow/ui/validation_error_messages.scss +6 -0
  113. data/app/assets/stylesheets/pageflow/ui.scss +4 -0
  114. data/app/controllers/pageflow/edit_locks_controller.rb +3 -1
  115. data/app/helpers/pageflow/admin/entries_helper.rb +2 -12
  116. data/app/helpers/pageflow/embed_code_helper.rb +1 -1
  117. data/app/helpers/pageflow/entries_helper.rb +41 -2
  118. data/app/helpers/pageflow/file_background_images_helper.rb +1 -1
  119. data/app/helpers/pageflow/page_types_helper.rb +1 -1
  120. data/app/helpers/pageflow/themes_helper.rb +1 -1
  121. data/app/jobs/pageflow/poll_meta_data_from_zencoder_job.rb +1 -1
  122. data/app/jobs/pageflow/poll_zencoder_job.rb +1 -9
  123. data/app/models/pageflow/audio_file.rb +17 -0
  124. data/app/models/pageflow/audio_file_url_templates.rb +4 -1
  125. data/app/models/pageflow/customized_theme.rb +37 -0
  126. data/app/models/pageflow/draft_entry.rb +6 -59
  127. data/app/models/pageflow/entry.rb +8 -0
  128. data/app/models/pageflow/entry_at_revision.rb +68 -0
  129. data/app/models/pageflow/entry_role_query.rb +44 -24
  130. data/app/models/pageflow/image_file_css_background_image_urls.rb +8 -2
  131. data/app/models/pageflow/published_entry.rb +9 -56
  132. data/app/models/pageflow/theme_customization.rb +46 -0
  133. data/app/models/pageflow/theme_customization_file.rb +58 -0
  134. data/app/models/pageflow/video_file.rb +11 -1
  135. data/app/models/pageflow/video_file_url_templates.rb +1 -0
  136. data/app/policies/pageflow/entry_policy.rb +4 -0
  137. data/app/state_machines/pageflow/media_encoding_state_machine.rb +23 -4
  138. data/app/views/admin/entries/_form.html.erb +50 -0
  139. data/app/views/admin/entries/entry_type_name_input.html.erb +5 -0
  140. data/app/views/admin/features/_form.html.erb +1 -1
  141. data/app/views/admin/memberships/_form.html.erb +2 -3
  142. data/app/views/admin/users/_form.html.erb +1 -1
  143. data/app/views/admin/users/invitation.html.erb +2 -2
  144. data/app/views/components/pageflow/admin/entry_user_badge_list.rb +10 -9
  145. data/app/views/components/pageflow/admin/members_tab.rb +5 -1
  146. data/app/views/components/pageflow/admin/revisions_tab.rb +13 -3
  147. data/app/views/components/pageflow/admin/timestamp.rb +20 -0
  148. data/app/views/components/pageflow/admin/user_account_badge_list.rb +5 -6
  149. data/app/views/pageflow/admin/entries/_cannot_add_user.html.erb +9 -5
  150. data/app/views/pageflow/admin/entries/_entry_type_name_input.html.erb +7 -0
  151. data/app/views/pageflow/audio_files/_audio_file.json.jbuilder +13 -0
  152. data/app/views/pageflow/editor/encoding_confirmations/_intro.html.erb +0 -0
  153. data/app/views/pageflow/editor/encoding_confirmations/check.json.jbuilder +14 -2
  154. data/config/initializers/paperclip.rb +16 -1
  155. data/config/locales/de.yml +24 -28
  156. data/config/locales/en.yml +19 -10
  157. data/db/migrate/20210528073122_create_pageflow_theme_customizations.rb +11 -0
  158. data/db/migrate/20210531090654_create_pageflow_theme_customization_files.rb +15 -0
  159. data/db/migrate/20210531102228_add_selected_file_ids_to_theme_customizations.rb +5 -0
  160. data/db/migrate/20211020085902_add_canonical_entry_url_prefix_to_themings.rb +5 -0
  161. data/db/migrate/20220503150010_add_peak_data_to_audio_files.rb +5 -0
  162. data/db/migrate/20220705084830_add_trailing_slash_in_canonical_urls_to_themings.rb +5 -0
  163. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +256 -124
  164. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +566 -167
  165. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +5 -5
  166. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +4 -4
  167. data/entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb +38 -0
  168. data/entry_types/paged/app/views/pageflow_paged/third_party_embed_consent/_opt_in.html.erb +12 -0
  169. data/entry_types/paged/app/views/pageflow_paged/third_party_embed_consent/_opt_out_info.html.erb +10 -0
  170. data/entry_types/paged/config/initializers/features.rb +2 -0
  171. data/entry_types/paged/config/locales/new/video_contain.de.yml +7 -0
  172. data/entry_types/paged/config/locales/new/video_contain.en.yml +7 -0
  173. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +3 -0
  174. data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +1 -0
  175. data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +58 -0
  176. data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +37 -3
  177. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +92 -6
  178. data/entry_types/scrolled/app/helpers/pageflow_scrolled/webpack_public_path_helper.rb +20 -0
  179. data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +7 -0
  180. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +5 -2
  181. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +5 -1
  182. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +5 -4
  183. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +16 -0
  184. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +13 -2
  185. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_widget.json.jbuilder +2 -0
  186. data/entry_types/scrolled/config/locales/de.yml +1 -8
  187. data/entry_types/scrolled/config/locales/en.yml +1 -9
  188. data/entry_types/scrolled/config/locales/new/before_after_slider.de.yml +8 -0
  189. data/entry_types/scrolled/config/locales/new/before_after_slider.en.yml +8 -0
  190. data/entry_types/scrolled/config/locales/new/center_ragged.de.yml +8 -0
  191. data/entry_types/scrolled/config/locales/new/center_ragged.en.yml +9 -0
  192. data/entry_types/scrolled/config/locales/new/consent.de.yml +25 -0
  193. data/entry_types/scrolled/config/locales/new/consent.en.yml +24 -0
  194. data/entry_types/scrolled/config/locales/new/content_element_categories.de.yml +39 -0
  195. data/entry_types/scrolled/config/locales/new/content_element_categories.en.yml +39 -0
  196. data/entry_types/scrolled/config/locales/new/default_transition.de.yml +14 -0
  197. data/entry_types/scrolled/config/locales/new/default_transition.en.yml +14 -0
  198. data/entry_types/scrolled/config/locales/new/header_line_breaks.de.yml +28 -0
  199. data/entry_types/scrolled/config/locales/new/header_line_breaks.en.yml +27 -0
  200. data/entry_types/scrolled/config/locales/new/header_size.de.yml +17 -0
  201. data/entry_types/scrolled/config/locales/new/header_size.en.yml +17 -0
  202. data/entry_types/scrolled/config/locales/new/iframe_embed.de.yml +39 -0
  203. data/entry_types/scrolled/config/locales/new/iframe_embed.en.yml +39 -0
  204. data/entry_types/scrolled/config/locales/new/inline_loops.de.yml +26 -0
  205. data/entry_types/scrolled/config/locales/new/inline_loops.en.yml +26 -0
  206. data/entry_types/scrolled/config/locales/new/portrait_inline_image.de.yml +9 -0
  207. data/entry_types/scrolled/config/locales/new/portrait_inline_image.en.yml +9 -0
  208. data/entry_types/scrolled/config/locales/new/section_width.de.yml +10 -0
  209. data/entry_types/scrolled/config/locales/new/section_width.en.yml +10 -0
  210. data/entry_types/scrolled/config/locales/new/typography_variants.de.yml +7 -0
  211. data/entry_types/scrolled/config/locales/new/typography_variants.en.yml +7 -0
  212. data/entry_types/scrolled/config/locales/new/video_embed_poster.de.yml +8 -0
  213. data/entry_types/scrolled/config/locales/new/video_embed_poster.en.yml +8 -0
  214. data/entry_types/scrolled/config/locales/new/waveform_styles.de.yml +11 -0
  215. data/entry_types/scrolled/config/locales/new/waveform_styles.en.yml +12 -0
  216. data/entry_types/scrolled/config/locales/new/widgets.de.yml +6 -0
  217. data/entry_types/scrolled/config/locales/new/widgets.en.yml +6 -0
  218. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +29 -5
  219. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt +8 -6
  220. data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +37 -0
  221. data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +57 -0
  222. data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +49 -0
  223. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +8 -0
  224. data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +42 -0
  225. data/entry_types/scrolled/lib/pageflow_scrolled.rb +17 -1
  226. data/entry_types/scrolled/package/contentElements-editor.js +323 -89
  227. data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
  228. data/entry_types/scrolled/package/contentElements-frontend.js +719 -529
  229. data/entry_types/scrolled/package/editor.js +459 -261
  230. data/entry_types/scrolled/package/frontend/{EditableText-7093fd0e.js → EditableInlineText.module-b9923660.js} +284 -362
  231. data/entry_types/scrolled/package/frontend/{i18n-4dc6c377.js → PhonePlatformContext-9fb97827.js} +199 -106
  232. data/entry_types/scrolled/package/frontend/{Viewer-e49e7807.js → Viewer-e2290ea0.js} +196 -79
  233. data/entry_types/scrolled/package/frontend/{Wavesurfer-0adf5667.js → Wavesurfer-7d9cf1b7.js} +16 -58
  234. data/entry_types/scrolled/package/frontend/{components-6a6793ca.js → components-6ab26015.js} +664 -671
  235. data/entry_types/scrolled/package/frontend/{getPrototypeOf-63c7c8e8.js → createSuper-d0f30da3.js} +34 -5
  236. data/entry_types/scrolled/package/frontend/index.css +1 -9
  237. data/entry_types/scrolled/package/frontend/index.js +1919 -2386
  238. data/entry_types/scrolled/package/frontend/{useBrowserFeature-91a4c29d.js → usePhonePlatform-2857c22b.js} +9 -8
  239. data/entry_types/scrolled/package/frontend-server.js +3 -6
  240. data/entry_types/scrolled/package/package.json +16 -8
  241. data/entry_types/scrolled/package/testHelpers.js +456 -0
  242. data/entry_types/scrolled/package/values/breakpoints.module.css +9 -0
  243. data/entry_types/scrolled/package/values/colors.module.css +5 -0
  244. data/entry_types/scrolled/package/widgets/defaultNavigation.css +9 -0
  245. data/entry_types/scrolled/package/widgets/defaultNavigation.js +612 -0
  246. data/entry_types/scrolled/spec/fixtures/image.svg +1 -0
  247. data/lib/pageflow/ability_mixin.rb +4 -0
  248. data/lib/pageflow/built_in_widget_type.rb +4 -0
  249. data/lib/pageflow/built_in_widget_types_plugin.rb +7 -0
  250. data/lib/pageflow/configuration.rb +34 -1
  251. data/lib/pageflow/entry_type.rb +11 -2
  252. data/lib/pageflow/entry_type_configuration.rb +2 -0
  253. data/lib/pageflow/file_type.rb +24 -0
  254. data/lib/pageflow/paperclip_processors/audio_waveform.rb +42 -0
  255. data/lib/pageflow/paperclip_processors/noop.rb +10 -0
  256. data/lib/pageflow/theme_customizations.rb +61 -0
  257. data/lib/pageflow/user_mixin.rb +6 -0
  258. data/lib/pageflow/version.rb +1 -1
  259. data/lib/pageflow.rb +9 -0
  260. data/package/config/jest/index.js +2 -1
  261. data/package/config/postcss/scaleFunctions.js +71 -0
  262. data/package/editor.js +95 -85
  263. data/package/frontend.js +521 -161
  264. data/package/package.json +5 -3
  265. data/package/testHelpers.js +26 -5
  266. data/package/ui.js +124 -11
  267. data/spec/factories/draft_entries.rb +19 -1
  268. data/spec/factories/entries.rb +4 -0
  269. data/spec/factories/published_entries.rb +6 -0
  270. data/spec/fixtures/audio.ogg +0 -0
  271. metadata +123 -15
  272. data/app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder +0 -2
  273. data/app/views/admin/entries/entry_types.json.jbuilder +0 -4
  274. data/package/config/jest/transformers/upwardBabel.js +0 -5
@@ -1,13 +1,13 @@
1
1
  import 'pageflow/frontend';
2
2
  import React, { useMemo, useEffect, useRef, useState } from 'react';
3
3
  import ReactDOM from 'react-dom';
4
- import { b as _objectWithoutProperties, u as useI18n, _ as _slicedToArray, a as _defineProperty } from './i18n-4dc6c377.js';
5
- import classNames from 'classnames';
4
+ import { _ as _objectWithoutProperties, u as useI18n, b as _defineProperty, c as _slicedToArray } from './PhonePlatformContext-9fb97827.js';
5
+ import 'i18n-js';
6
6
  import 'use-context-selector';
7
7
  import 'reselect';
8
- import 'i18n-js';
9
8
  import 'slugify';
10
- import { u as useBrowserFeature } from './useBrowserFeature-91a4c29d.js';
9
+ import classNames from 'classnames';
10
+ import { u as useBrowserFeature, a as usePhonePlatform } from './usePhonePlatform-2857c22b.js';
11
11
  import { PanoViewer } from '@egjs/view360';
12
12
  import screenfull from 'screenfull';
13
13
 
@@ -33,14 +33,14 @@ var EnterFullscreenIcon = (function (_ref) {
33
33
  styles = _ref$styles === void 0 ? {} : _ref$styles,
34
34
  props = _objectWithoutProperties(_ref, ["styles"]);
35
35
 
36
- return React.createElement("svg", _extends({
36
+ return /*#__PURE__*/React.createElement("svg", _extends({
37
37
  "aria-hidden": "true",
38
38
  "data-prefix": "fas",
39
39
  "data-icon": "expand",
40
40
  className: (styles["svg-inline--fa"] || "svg-inline--fa") + " " + (styles["fa-expand"] || "fa-expand") + " " + (styles["fa-w-14"] || "fa-w-14"),
41
41
  xmlns: "http://www.w3.org/2000/svg",
42
42
  viewBox: "0 0 448 512"
43
- }, props), React.createElement("path", {
43
+ }, props), /*#__PURE__*/React.createElement("path", {
44
44
  fill: "currentColor",
45
45
  d: "M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"
46
46
  }));
@@ -68,14 +68,14 @@ var ExitFullscreenIcon = (function (_ref) {
68
68
  styles = _ref$styles === void 0 ? {} : _ref$styles,
69
69
  props = _objectWithoutProperties(_ref, ["styles"]);
70
70
 
71
- return React.createElement("svg", _extends$1({
71
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
72
72
  "aria-hidden": "true",
73
73
  "data-prefix": "fas",
74
74
  "data-icon": "compress",
75
75
  className: (styles["svg-inline--fa"] || "svg-inline--fa") + " " + (styles["fa-compress"] || "fa-compress") + " " + (styles["fa-w-14"] || "fa-w-14"),
76
76
  xmlns: "http://www.w3.org/2000/svg",
77
77
  viewBox: "0 0 448 512"
78
- }, props), React.createElement("path", {
78
+ }, props), /*#__PURE__*/React.createElement("path", {
79
79
  fill: "currentColor",
80
80
  d: "M436 192H312c-13.3 0-24-10.7-24-24V44c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v84h84c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-276-24V44c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v84H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24zm0 300V344c0-13.3-10.7-24-24-24H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-84h84c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12H312c-13.3 0-24 10.7-24 24v124c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12z"
81
81
  }));
@@ -87,31 +87,22 @@ function ToggleFullscreenButton(props) {
87
87
  var _useI18n = useI18n(),
88
88
  t = _useI18n.t;
89
89
 
90
- return (
91
- /*#__PURE__*/
92
- React.createElement("button", {
93
- className: styles.button,
94
- title: t(props.isFullscreen ? 'exit_fullscreen' : 'enter_fullscreen', {
95
- scope: 'pageflow_scrolled.public'
96
- }),
97
- onClick: function onClick() {
98
- return props.isFullscreen ? props.onExit() : props.onEnter();
99
- }
100
- }, icon(props))
101
- );
90
+ return /*#__PURE__*/React.createElement("button", {
91
+ className: styles.button,
92
+ title: t(props.isFullscreen ? 'exit_fullscreen' : 'enter_fullscreen', {
93
+ scope: 'pageflow_scrolled.public'
94
+ }),
95
+ onClick: function onClick() {
96
+ return props.isFullscreen ? props.onExit() : props.onEnter();
97
+ }
98
+ }, icon(props));
102
99
  }
103
100
 
104
101
  function icon(props) {
105
102
  if (props.isFullscreen) {
106
- return (
107
- /*#__PURE__*/
108
- React.createElement(ExitFullscreenIcon, null)
109
- );
103
+ return /*#__PURE__*/React.createElement(ExitFullscreenIcon, null);
110
104
  } else {
111
- return (
112
- /*#__PURE__*/
113
- React.createElement(EnterFullscreenIcon, null)
114
- );
105
+ return /*#__PURE__*/React.createElement(EnterFullscreenIcon, null);
115
106
  }
116
107
  }
117
108
 
@@ -132,9 +123,7 @@ function Fullscreen(_ref) {
132
123
  }, [isFullscreen]);
133
124
 
134
125
  if (isFullscreen) {
135
- return ReactDOM.createPortal(
136
- /*#__PURE__*/
137
- React.createElement("div", {
126
+ return ReactDOM.createPortal( /*#__PURE__*/React.createElement("div", {
138
127
  className: styles$1.wrapper
139
128
  }, children), root);
140
129
  } else {
@@ -142,8 +131,6 @@ function Fullscreen(_ref) {
142
131
  }
143
132
  }
144
133
 
145
- var styles$2 = {"full":"Viewer-module_full__1q18y","container":"Viewer-module_container__3eJ34 Viewer-module_full__1q18y","controls":"Viewer-module_controls__3BTof","spinner":"Viewer-module_spinner__2oRve","spin":"Viewer-module_spin__3jBR2","isLoading":"Viewer-module_isLoading__sQuGw"};
146
-
147
134
  function _extends$2() {
148
135
  _extends$2 = Object.assign || function (target) {
149
136
  for (var i = 1; i < arguments.length; i++) {
@@ -161,22 +148,149 @@ function _extends$2() {
161
148
 
162
149
  return _extends$2.apply(this, arguments);
163
150
  }
151
+ var ArrowLeftIcon = (function (_ref) {
152
+ var _ref$styles = _ref.styles,
153
+ styles = _ref$styles === void 0 ? {} : _ref$styles,
154
+ props = _objectWithoutProperties(_ref, ["styles"]);
155
+
156
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
157
+ xmlns: "http://www.w3.org/2000/svg",
158
+ className: (styles["h-5"] || "h-5") + " " + (styles["w-5"] || "w-5"),
159
+ viewBox: "0 0 20 20",
160
+ fill: "currentColor"
161
+ }, props), /*#__PURE__*/React.createElement("path", {
162
+ fillRule: "evenodd",
163
+ d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",
164
+ clipRule: "evenodd"
165
+ }));
166
+ });
167
+
168
+ function _extends$3() {
169
+ _extends$3 = Object.assign || function (target) {
170
+ for (var i = 1; i < arguments.length; i++) {
171
+ var source = arguments[i];
172
+
173
+ for (var key in source) {
174
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
175
+ target[key] = source[key];
176
+ }
177
+ }
178
+ }
179
+
180
+ return target;
181
+ };
182
+
183
+ return _extends$3.apply(this, arguments);
184
+ }
185
+ var ArrowRightIcon = (function (_ref) {
186
+ var _ref$styles = _ref.styles,
187
+ styles = _ref$styles === void 0 ? {} : _ref$styles,
188
+ props = _objectWithoutProperties(_ref, ["styles"]);
189
+
190
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
191
+ xmlns: "http://www.w3.org/2000/svg",
192
+ className: (styles["h-5"] || "h-5") + " " + (styles["w-5"] || "w-5"),
193
+ viewBox: "0 0 20 20",
194
+ fill: "currentColor"
195
+ }, props), /*#__PURE__*/React.createElement("path", {
196
+ fillRule: "evenodd",
197
+ d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
198
+ clipRule: "evenodd"
199
+ }));
200
+ });
201
+
202
+ var styles$2 = {"indicator":"PanoramaIndicator-module_indicator__3A90v","visible":"PanoramaIndicator-module_visible__3LOgm","arrow":"PanoramaIndicator-module_arrow__QV1Pd","arrowLeft":"PanoramaIndicator-module_arrowLeft__Jh7GC PanoramaIndicator-module_arrow__QV1Pd","arrowRight":"PanoramaIndicator-module_arrowRight__ZZBtO PanoramaIndicator-module_arrow__QV1Pd","nudgeLeft":"PanoramaIndicator-module_nudgeLeft__IU_Iy","nudgeRight":"PanoramaIndicator-module_nudgeRight__3XzNu","text":"PanoramaIndicator-module_text__2FzUy"};
203
+
204
+ function PanoramaIndicator(_ref) {
205
+ var visible = _ref.visible;
206
+ var size = 40;
207
+ return /*#__PURE__*/React.createElement("div", {
208
+ className: classNames(styles$2.indicator, _defineProperty({}, styles$2.visible, visible))
209
+ }, /*#__PURE__*/React.createElement("div", {
210
+ className: styles$2.arrowLeft
211
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ArrowLeftIcon, {
212
+ width: size,
213
+ height: size
214
+ }))), /*#__PURE__*/React.createElement("div", {
215
+ className: styles$2.arrowRight
216
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ArrowRightIcon, {
217
+ width: size,
218
+ height: size
219
+ }))), /*#__PURE__*/React.createElement("div", {
220
+ className: styles$2.text
221
+ }, "360\xB0"));
222
+ }
223
+
224
+ var styles$3 = {"indicator":"FullscreenIndicator-module_indicator__2Jl_-","visible":"FullscreenIndicator-module_visible__2ywsZ","icon":"FullscreenIndicator-module_icon__2Ddof","icons":"FullscreenIndicator-module_icons__3-Xm6","text":"FullscreenIndicator-module_text__3wCW3","pulse":"FullscreenIndicator-module_pulse__1qujU","iconTopLeft":"FullscreenIndicator-module_iconTopLeft__2u7-j FullscreenIndicator-module_icon__2Ddof","iconTopRight":"FullscreenIndicator-module_iconTopRight__14nUk FullscreenIndicator-module_icon__2Ddof","iconBottomRight":"FullscreenIndicator-module_iconBottomRight__lEtN6 FullscreenIndicator-module_icon__2Ddof","iconBottomLeft":"FullscreenIndicator-module_iconBottomLeft__voLm_ FullscreenIndicator-module_icon__2Ddof"};
225
+
226
+ function FullscreenIndicator(_ref) {
227
+ var visible = _ref.visible,
228
+ onClick = _ref.onClick;
229
+ var size = 50;
230
+ return /*#__PURE__*/React.createElement("div", {
231
+ className: classNames(styles$3.indicator, _defineProperty({}, styles$3.visible, visible))
232
+ }, /*#__PURE__*/React.createElement("div", {
233
+ className: styles$3.icons
234
+ }, /*#__PURE__*/React.createElement("div", {
235
+ className: styles$3.iconTopLeft
236
+ }, /*#__PURE__*/React.createElement(ArrowLeftIcon, {
237
+ width: size,
238
+ height: size
239
+ })), /*#__PURE__*/React.createElement("div", {
240
+ className: styles$3.iconTopRight
241
+ }, /*#__PURE__*/React.createElement(ArrowLeftIcon, {
242
+ width: size,
243
+ height: size
244
+ })), /*#__PURE__*/React.createElement("div", {
245
+ className: styles$3.iconBottomRight
246
+ }, /*#__PURE__*/React.createElement(ArrowLeftIcon, {
247
+ width: size,
248
+ height: size
249
+ })), /*#__PURE__*/React.createElement("div", {
250
+ className: styles$3.iconBottomLeft
251
+ }, /*#__PURE__*/React.createElement(ArrowLeftIcon, {
252
+ width: size,
253
+ height: size
254
+ }))), /*#__PURE__*/React.createElement("div", {
255
+ className: styles$3.text
256
+ }, "360\xB0"));
257
+ }
258
+
259
+ var styles$4 = {"full":"Viewer-module_full__1q18y","container":"Viewer-module_container__3eJ34 Viewer-module_full__1q18y","controls":"Viewer-module_controls__3BTof","spinner":"Viewer-module_spinner__2oRve","spin":"Viewer-module_spin__3jBR2","isLoading":"Viewer-module_isLoading__sQuGw"};
260
+
261
+ function _extends$4() {
262
+ _extends$4 = Object.assign || function (target) {
263
+ for (var i = 1; i < arguments.length; i++) {
264
+ var source = arguments[i];
265
+
266
+ for (var key in source) {
267
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
268
+ target[key] = source[key];
269
+ }
270
+ }
271
+ }
272
+
273
+ return target;
274
+ };
275
+
276
+ return _extends$4.apply(this, arguments);
277
+ }
164
278
  var SpinnerIcon = (function (_ref) {
165
279
  var _ref$styles = _ref.styles,
166
280
  props = _objectWithoutProperties(_ref, ["styles"]);
167
281
 
168
- return React.createElement("svg", _extends$2({
282
+ return /*#__PURE__*/React.createElement("svg", _extends$4({
169
283
  xmlns: "http://www.w3.org/2000/svg",
170
284
  fill: "none",
171
285
  viewBox: "0 0 24 24"
172
- }, props), React.createElement("circle", {
286
+ }, props), /*#__PURE__*/React.createElement("circle", {
173
287
  cx: "12",
174
288
  cy: "12",
175
289
  r: "10",
176
290
  stroke: "currentColor",
177
291
  strokeWidth: "4",
178
292
  opacity: ".23"
179
- }), React.createElement("path", {
293
+ }), /*#__PURE__*/React.createElement("path", {
180
294
  fill: "currentColor",
181
295
  d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",
182
296
  opacity: ".75"
@@ -187,7 +301,10 @@ function Viewer(_ref) {
187
301
  var imageFile = _ref.imageFile,
188
302
  viewerRef = _ref.viewerRef,
189
303
  initialYaw = _ref.initialYaw,
190
- initialPitch = _ref.initialPitch;
304
+ initialPitch = _ref.initialPitch,
305
+ hidePanoramaIndicator = _ref.hidePanoramaIndicator,
306
+ onReady = _ref.onReady,
307
+ onFullscreen = _ref.onFullscreen;
191
308
  var elRef = useRef();
192
309
  var initialYawRef = useRef(initialYaw);
193
310
  var initialPitchRef = useRef(initialPitch);
@@ -201,7 +318,9 @@ function Viewer(_ref) {
201
318
  var _useState3 = useState(false),
202
319
  _useState4 = _slicedToArray(_useState3, 2),
203
320
  isFullscreen = _useState4[0],
204
- setIsFullscreen = _useState4[1]; // When toggling to fullscreen mode, this component renders to a
321
+ setIsFullscreen = _useState4[1];
322
+
323
+ var isPhonePlatform = usePhonePlatform(); // When toggling to fullscreen mode, this component renders to a
205
324
  // portal div in the body of the document. We do not want to recreate
206
325
  // the PanoViewer instead to keep its current state (pitch, yaw etc.).
207
326
  // We therefore initialize the PanoViewer on a detached DOM element
@@ -211,11 +330,10 @@ function Viewer(_ref) {
211
330
  // - the parent Viewer component is mounted
212
331
  // - Fullscreen component switches between using the portal or not
213
332
 
214
-
215
333
  function appendViewerTo(parentNode) {
216
334
  if (!elRef.current) {
217
335
  elRef.current = document.createElement('div');
218
- elRef.current.className = styles$2.full;
336
+ elRef.current.className = styles$4.full;
219
337
  viewerRef.current = new PanoViewer(elRef.current, {
220
338
  image: imageFile.urls.ultra,
221
339
  projectionType: imageFile.configuration.projection === 'equirectangular_stereo' ? PanoViewer.PROJECTION_TYPE.STEREOSCOPIC_EQUI : PanoViewer.PROJECTION_TYPE.EQUIRECTANGULAR,
@@ -227,6 +345,10 @@ function Viewer(_ref) {
227
345
  viewerRef.current.on(PanoViewer.EVENTS.READY, function () {
228
346
  viewerRef.current.updateViewportDimensions();
229
347
  setIsLoading(false);
348
+
349
+ if (onReady) {
350
+ onReady();
351
+ }
230
352
  });
231
353
  }
232
354
 
@@ -313,6 +435,10 @@ function Viewer(_ref) {
313
435
  }
314
436
 
315
437
  function enterFullscreen() {
438
+ if (onFullscreen) {
439
+ onFullscreen();
440
+ }
441
+
316
442
  if (screenfull.isEnabled) {
317
443
  screenfull.request();
318
444
  }
@@ -329,38 +455,32 @@ function Viewer(_ref) {
329
455
  setIsFullscreen(false);
330
456
  }
331
457
 
332
- return (
333
- /*#__PURE__*/
334
- React.createElement(Fullscreen, {
335
- isFullscreen: isFullscreen
336
- },
337
- /*#__PURE__*/
338
- React.createElement("div", {
339
- className: styles$2.container,
340
- onKeyDown: preventDefaultForArrowUpDown
341
- },
342
- /*#__PURE__*/
343
- React.createElement(DOMNodeContainer, {
344
- className: styles$2.full,
345
- onUpdate: function onUpdate(el) {
346
- return appendViewerTo(el);
347
- }
348
- })),
349
- /*#__PURE__*/
350
- React.createElement(SpinnerIcon, {
351
- className: classNames(styles$2.spinner, _defineProperty({}, styles$2.isLoading, isLoading))
352
- }),
353
- /*#__PURE__*/
354
- React.createElement("div", {
355
- className: styles$2.controls
356
- },
357
- /*#__PURE__*/
358
- React.createElement(ToggleFullscreenButton, {
359
- isFullscreen: isFullscreen,
360
- onEnter: enterFullscreen,
361
- onExit: exitFullscreen
362
- })))
363
- );
458
+ return /*#__PURE__*/React.createElement(Fullscreen, {
459
+ isFullscreen: isFullscreen
460
+ }, /*#__PURE__*/React.createElement("div", {
461
+ className: styles$4.container,
462
+ onKeyDown: preventDefaultForArrowUpDown,
463
+ onClick: function onClick() {
464
+ isPhonePlatform && enterFullscreen();
465
+ }
466
+ }, /*#__PURE__*/React.createElement(DOMNodeContainer, {
467
+ className: styles$4.full,
468
+ onUpdate: function onUpdate(el) {
469
+ return appendViewerTo(el);
470
+ }
471
+ })), /*#__PURE__*/React.createElement(SpinnerIcon, {
472
+ className: classNames(styles$4.spinner, _defineProperty({}, styles$4.isLoading, isLoading))
473
+ }), (!isPhonePlatform || isFullscreen) && /*#__PURE__*/React.createElement("div", {
474
+ className: styles$4.controls
475
+ }, /*#__PURE__*/React.createElement(ToggleFullscreenButton, {
476
+ isFullscreen: isFullscreen,
477
+ onEnter: enterFullscreen,
478
+ onExit: exitFullscreen
479
+ })), /*#__PURE__*/React.createElement(PanoramaIndicator, {
480
+ visible: !isLoading && !isPhonePlatform && !isFullscreen && !hidePanoramaIndicator
481
+ }), /*#__PURE__*/React.createElement(FullscreenIndicator, {
482
+ visible: !isLoading && isPhonePlatform && !isFullscreen
483
+ }));
364
484
  }
365
485
  var DOMNodeContainer = React.memo(function (_ref2) {
366
486
  var className = _ref2.className,
@@ -373,13 +493,10 @@ var DOMNodeContainer = React.memo(function (_ref2) {
373
493
  current.removeChild(current.firstChild);
374
494
  };
375
495
  });
376
- return (
377
- /*#__PURE__*/
378
- React.createElement("div", {
379
- ref: ref,
380
- className: className
381
- })
382
- );
496
+ return /*#__PURE__*/React.createElement("div", {
497
+ ref: ref,
498
+ className: className
499
+ });
383
500
  }, function () {
384
501
  return true;
385
502
  });
@@ -1,38 +1,9 @@
1
1
  import React, { Component } from 'react';
2
+ import { b as _inherits, a as _classCallCheck, d as _assertThisInitialized, _ as _createClass, c as _createSuper } from './createSuper-d0f30da3.js';
2
3
  import Measure from 'react-measure';
3
- import { b as _inherits, a as _classCallCheck, e as _assertThisInitialized, _ as _createClass, c as _getPrototypeOf, d as _possibleConstructorReturn } from './getPrototypeOf-63c7c8e8.js';
4
4
  import assign from 'deep-assign';
5
5
  import WaveSurfer from 'wavesurfer.js';
6
6
 
7
- function _createSuper(Derived) {
8
- function isNativeReflectConstruct() {
9
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
10
- if (Reflect.construct.sham) return false;
11
- if (typeof Proxy === "function") return true;
12
-
13
- try {
14
- Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
15
- return true;
16
- } catch (e) {
17
- return false;
18
- }
19
- }
20
-
21
- return function () {
22
- var Super = _getPrototypeOf(Derived),
23
- result;
24
-
25
- if (isNativeReflectConstruct()) {
26
- var NewTarget = _getPrototypeOf(this).constructor;
27
-
28
- result = Reflect.construct(Super, arguments, NewTarget);
29
- } else {
30
- result = Super.apply(this, arguments);
31
- }
32
-
33
- return _possibleConstructorReturn(this, result);
34
- };
35
- }
36
7
  var EVENTS = ['audioprocess', 'error', 'finish', 'loading', 'mouseup', 'pause', 'play', 'ready', 'scroll', 'seek', 'zoom'];
37
8
 
38
9
  function capitaliseFirstLetter(string) {
@@ -41,9 +12,7 @@ function capitaliseFirstLetter(string) {
41
12
  }).join('');
42
13
  }
43
14
 
44
- var Wavesurfer =
45
- /*#__PURE__*/
46
- function (_Component) {
15
+ var Wavesurfer = /*#__PURE__*/function (_Component) {
47
16
  _inherits(Wavesurfer, _Component);
48
17
 
49
18
  var _super = _createSuper(Wavesurfer);
@@ -62,14 +31,14 @@ function (_Component) {
62
31
  throw new Error('WaveSurfer is undefined!');
63
32
  }
64
33
 
65
- _this._wavesurfer = Object.create(WaveSurfer);
66
34
  _this._loadMediaElt = _this._loadMediaElt.bind(_assertThisInitialized(_this));
67
35
  _this._loadAudio = _this._loadAudio.bind(_assertThisInitialized(_this));
68
36
  _this._seekTo = _this._seekTo.bind(_assertThisInitialized(_this));
69
37
 
70
38
  _this._handleResize = function () {
71
39
  if (_this.state.isReady) {
72
- _this._wavesurfer.refresh();
40
+ // Force redraw
41
+ _this._wavesurfer.zoom(false);
73
42
  }
74
43
  };
75
44
 
@@ -89,8 +58,7 @@ function (_Component) {
89
58
  options.backend = 'MediaElement';
90
59
  }
91
60
 
92
- this._wavesurfer.init(options); // file was loaded, wave was drawn
93
-
61
+ this._wavesurfer = WaveSurfer.create(options); // file was loaded, wave was drawn
94
62
 
95
63
  this._wavesurfer.on('ready', function () {
96
64
  _this2.setState({
@@ -110,7 +78,7 @@ function (_Component) {
110
78
 
111
79
 
112
80
  if (_this2.props.playing) {
113
- _this2.wavesurfer.play();
81
+ _this2._wavesurfer.play();
114
82
  } // set initial zoom
115
83
 
116
84
 
@@ -319,21 +287,15 @@ function (_Component) {
319
287
  key: "_measureIfResponsive",
320
288
  value: function _measureIfResponsive(children) {
321
289
  if (this.props.responsive) {
322
- return (
323
- /*#__PURE__*/
324
- React.createElement(Measure, {
325
- client: true,
326
- onResize: this._handleResize
327
- }, function (_ref) {
328
- var measureRef = _ref.measureRef;
329
- return (
330
- /*#__PURE__*/
331
- React.createElement("div", {
332
- ref: measureRef
333
- }, children)
334
- );
335
- })
336
- );
290
+ return /*#__PURE__*/React.createElement(Measure, {
291
+ client: true,
292
+ onResize: this._handleResize
293
+ }, function (_ref) {
294
+ var measureRef = _ref.measureRef;
295
+ return /*#__PURE__*/React.createElement("div", {
296
+ ref: measureRef
297
+ }, children);
298
+ });
337
299
  }
338
300
 
339
301
  return children;
@@ -349,11 +311,7 @@ function (_Component) {
349
311
  isReady: _this4.state.isReady
350
312
  });
351
313
  }) : false;
352
- return this._measureIfResponsive(
353
- /*#__PURE__*/
354
- React.createElement("div", null,
355
- /*#__PURE__*/
356
- React.createElement("div", {
314
+ return this._measureIfResponsive( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
357
315
  ref: function ref(c) {
358
316
  _this4.wavesurferEl = c;
359
317
  }