pageflow 17.0.5 → 17.1.0

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 (488) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +362 -35
  3. data/README.md +0 -1
  4. data/admins/pageflow/accounts.rb +16 -14
  5. data/admins/pageflow/entry.rb +68 -20
  6. data/admins/pageflow/entry_templates.rb +10 -9
  7. data/admins/pageflow/folder.rb +1 -1
  8. data/admins/pageflow/membership.rb +4 -4
  9. data/admins/pageflow/revisions.rb +5 -5
  10. data/admins/pageflow/site_root_entry.rb +64 -0
  11. data/admins/pageflow/sites.rb +12 -3
  12. data/admins/pageflow/translations.rb +75 -0
  13. data/admins/pageflow/user.rb +21 -35
  14. data/app/assets/javascripts/pageflow/admin/entries.js +30 -5
  15. data/app/assets/javascripts/pageflow/dist/ui.js +2865 -257
  16. data/app/assets/stylesheets/pageflow/admin/entries/index_table.scss +2 -1
  17. data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +2 -1
  18. data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +6 -0
  19. data/app/assets/stylesheets/pageflow/editor/base.scss +2 -0
  20. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +7 -1
  21. data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +5 -1
  22. data/app/assets/stylesheets/pageflow/editor/files.scss +28 -16
  23. data/app/assets/stylesheets/pageflow/editor/filtered_files.scss +24 -0
  24. data/app/assets/stylesheets/pageflow/editor/info_box.scss +11 -3
  25. data/app/assets/stylesheets/pageflow/editor/list.scss +6 -4
  26. data/app/assets/stylesheets/pageflow/editor/list_search_field.scss +52 -0
  27. data/app/assets/stylesheets/pageflow/editor/outline.scss +0 -13
  28. data/app/assets/stylesheets/pageflow/editor/select_button.scss +1 -1
  29. data/app/assets/stylesheets/pageflow/editor/sortable.scss +12 -0
  30. data/app/assets/stylesheets/pageflow/mixins/buttons.scss +4 -4
  31. data/app/assets/stylesheets/pageflow/ui/forms.scss +4 -0
  32. data/app/assets/stylesheets/pageflow/ui/input/color_input.scss +8 -0
  33. data/app/assets/stylesheets/pageflow/ui/input/file_name_input.scss +37 -0
  34. data/app/assets/stylesheets/pageflow/ui/properties.scss +5 -0
  35. data/app/assets/stylesheets/pageflow/ui.scss +1 -0
  36. data/app/controllers/concerns/pageflow/controller_delegation.rb +1 -1
  37. data/app/controllers/concerns/pageflow/edit_locking.rb +17 -10
  38. data/app/controllers/concerns/pageflow/entry_password_protection.rb +1 -0
  39. data/app/controllers/concerns/pageflow/public_https_mode.rb +2 -1
  40. data/app/controllers/concerns/pageflow/quota_verification.rb +5 -4
  41. data/app/controllers/pageflow/admin/initial_passwords_controller.rb +1 -0
  42. data/app/controllers/pageflow/application_controller.rb +19 -19
  43. data/app/controllers/pageflow/chapters_controller.rb +3 -2
  44. data/app/controllers/pageflow/edit_locks_controller.rb +3 -2
  45. data/app/controllers/pageflow/editor/encoding_confirmations_controller.rb +1 -0
  46. data/app/controllers/pageflow/editor/entries_controller.rb +2 -1
  47. data/app/controllers/pageflow/editor/entry_publications_controller.rb +1 -0
  48. data/app/controllers/pageflow/editor/file_import_controller.rb +3 -3
  49. data/app/controllers/pageflow/editor/files_controller.rb +7 -6
  50. data/app/controllers/pageflow/editor/widgets_controller.rb +1 -0
  51. data/app/controllers/pageflow/entries_controller.rb +77 -17
  52. data/app/controllers/pageflow/feeds_controller.rb +1 -1
  53. data/app/controllers/pageflow/files_controller.rb +1 -0
  54. data/app/controllers/pageflow/pages_controller.rb +4 -2
  55. data/app/controllers/pageflow/revisions_controller.rb +2 -1
  56. data/app/controllers/pageflow/sitemaps_controller.rb +1 -1
  57. data/app/controllers/pageflow/storylines_controller.rb +1 -0
  58. data/app/helpers/pageflow/admin/cutoff_modes_helper.rb +12 -0
  59. data/app/helpers/pageflow/admin/entries_helper.rb +1 -1
  60. data/app/helpers/pageflow/admin/entry_translations_helper.rb +18 -0
  61. data/app/helpers/pageflow/admin/features_helper.rb +1 -1
  62. data/app/helpers/pageflow/admin/form_helper.rb +3 -3
  63. data/app/helpers/pageflow/admin/locales_helper.rb +10 -2
  64. data/app/helpers/pageflow/admin/memberships_helper.rb +32 -32
  65. data/app/helpers/pageflow/admin/revisions_helper.rb +1 -1
  66. data/app/helpers/pageflow/admin/sites_helper.rb +22 -0
  67. data/app/helpers/pageflow/admin/users_helper.rb +7 -5
  68. data/app/helpers/pageflow/admin/widgets_helper.rb +3 -3
  69. data/app/helpers/pageflow/asset_urls_helper.rb +1 -1
  70. data/app/helpers/pageflow/audio_files_helper.rb +5 -2
  71. data/app/helpers/pageflow/background_image_helper.rb +7 -6
  72. data/app/helpers/pageflow/common_entry_seed_helper.rb +2 -4
  73. data/app/helpers/pageflow/editor/config_helper.rb +1 -1
  74. data/app/helpers/pageflow/editor/files_helper.rb +1 -1
  75. data/app/helpers/pageflow/embed_code_helper.rb +3 -3
  76. data/app/helpers/pageflow/entries_helper.rb +58 -34
  77. data/app/helpers/pageflow/entry_json_seed_helper.rb +3 -2
  78. data/app/helpers/pageflow/feeds_helper.rb +2 -2
  79. data/app/helpers/pageflow/file_background_images_helper.rb +2 -2
  80. data/app/helpers/pageflow/file_thumbnails_helper.rb +4 -3
  81. data/app/helpers/pageflow/files_helper.rb +5 -4
  82. data/app/helpers/pageflow/folders_helper.rb +8 -5
  83. data/app/helpers/pageflow/help_entries_helper.rb +2 -2
  84. data/app/helpers/pageflow/hreflang_links_helper.rb +37 -0
  85. data/app/helpers/pageflow/info_box_helper.rb +7 -11
  86. data/app/helpers/pageflow/media_query_helper.rb +3 -3
  87. data/app/helpers/pageflow/navigation_bar_helper.rb +1 -1
  88. data/app/helpers/pageflow/overview_helper.rb +1 -1
  89. data/app/helpers/pageflow/page_types_helper.rb +5 -5
  90. data/app/helpers/pageflow/pages_helper.rb +29 -15
  91. data/app/helpers/pageflow/public_i18n_helper.rb +1 -1
  92. data/app/helpers/pageflow/quota_helper.rb +4 -4
  93. data/app/helpers/pageflow/render_json_helper.rb +6 -3
  94. data/app/helpers/pageflow/revision_file_helper.rb +2 -1
  95. data/app/helpers/pageflow/sites_helper.rb +3 -3
  96. data/app/helpers/pageflow/social_share_helper.rb +24 -10
  97. data/app/helpers/pageflow/social_share_links_helper.rb +12 -9
  98. data/app/helpers/pageflow/structured_data_helper.rb +1 -1
  99. data/app/helpers/pageflow/stub_page_configuration.rb +7 -3
  100. data/app/helpers/pageflow/text_direction_helper.rb +1 -1
  101. data/app/helpers/pageflow/themes_helper.rb +1 -1
  102. data/app/helpers/pageflow/video_files_helper.rb +29 -13
  103. data/app/helpers/pageflow/widgets_helper.rb +7 -6
  104. data/app/inputs/pageflow_permalink_input.rb +3 -2
  105. data/app/jobs/pageflow/application_job.rb +1 -0
  106. data/app/jobs/pageflow/entry_export_import/upload_and_publish_file_job.rb +1 -1
  107. data/app/jobs/pageflow/poll_meta_data_from_zencoder_job.rb +1 -0
  108. data/app/jobs/pageflow/poll_zencoder_job.rb +3 -2
  109. data/app/jobs/pageflow/process_image_or_text_track_job.rb +1 -0
  110. data/app/jobs/pageflow/prune_auto_snapshots_job.rb +1 -0
  111. data/app/jobs/pageflow/request_meta_data_from_zencoder_job.rb +1 -0
  112. data/app/jobs/pageflow/submit_file_to_zencoder_job.rb +1 -0
  113. data/app/mailers/pageflow/user_mailer.rb +1 -0
  114. data/app/models/concerns/pageflow/auto_generated_perma_id.rb +13 -1
  115. data/app/models/concerns/pageflow/entry_publication_states.rb +7 -3
  116. data/app/models/concerns/pageflow/feature_target.rb +8 -4
  117. data/app/models/concerns/pageflow/output_source.rb +3 -3
  118. data/app/models/concerns/pageflow/permalinkable.rb +2 -1
  119. data/app/models/concerns/pageflow/reusable_file.rb +23 -23
  120. data/app/models/concerns/pageflow/serialization_blacklist.rb +1 -1
  121. data/app/models/concerns/pageflow/suspendable.rb +5 -3
  122. data/app/models/concerns/pageflow/theme_referencer.rb +1 -1
  123. data/app/models/concerns/pageflow/translatable.rb +62 -0
  124. data/app/models/concerns/pageflow/uploadable_file.rb +6 -6
  125. data/app/models/pageflow/account.rb +6 -5
  126. data/app/models/pageflow/account_member_query.rb +1 -1
  127. data/app/models/pageflow/account_role_query.rb +1 -1
  128. data/app/models/pageflow/application_query.rb +1 -1
  129. data/app/models/pageflow/application_record.rb +1 -1
  130. data/app/models/pageflow/audio_file.rb +4 -4
  131. data/app/models/pageflow/audio_file_url_templates.rb +1 -1
  132. data/app/models/pageflow/authentication_token.rb +2 -2
  133. data/app/models/pageflow/chapter.rb +6 -1
  134. data/app/models/pageflow/chapter_scaffold.rb +2 -4
  135. data/app/models/pageflow/cname_site_request_scope.rb +1 -1
  136. data/app/models/pageflow/customized_theme.rb +6 -6
  137. data/app/models/pageflow/draft_entry.rb +37 -9
  138. data/app/models/pageflow/edit_lock.rb +19 -21
  139. data/app/models/pageflow/encoding_confirmation.rb +2 -2
  140. data/app/models/pageflow/entries_feed.rb +2 -2
  141. data/app/models/pageflow/entry.rb +44 -30
  142. data/app/models/pageflow/entry_at_revision.rb +5 -1
  143. data/app/models/pageflow/entry_duplicate.rb +8 -5
  144. data/app/models/pageflow/entry_publication.rb +2 -2
  145. data/app/models/pageflow/entry_role_query.rb +4 -4
  146. data/app/models/pageflow/entry_template.rb +4 -4
  147. data/app/models/pageflow/entry_title_or_account_name_query.rb +2 -2
  148. data/app/models/pageflow/entry_translation_group.rb +42 -0
  149. data/app/models/pageflow/file_reuse.rb +2 -2
  150. data/app/models/pageflow/file_usage.rb +10 -3
  151. data/app/models/pageflow/folder.rb +2 -2
  152. data/app/models/pageflow/home_button.rb +7 -7
  153. data/app/models/pageflow/image_file.rb +20 -5
  154. data/app/models/pageflow/image_file_url_templates.rb +1 -1
  155. data/app/models/pageflow/invitation_form.rb +2 -1
  156. data/app/models/pageflow/managed_user_query.rb +1 -1
  157. data/app/models/pageflow/membership.rb +5 -5
  158. data/app/models/pageflow/nested_revision_component_copy.rb +263 -0
  159. data/app/models/pageflow/null_user.rb +1 -1
  160. data/app/models/pageflow/overview_button.rb +1 -1
  161. data/app/models/pageflow/page.rb +7 -3
  162. data/app/models/pageflow/permalink.rb +23 -2
  163. data/app/models/pageflow/permalink_directory.rb +7 -0
  164. data/app/models/pageflow/permalink_redirect.rb +7 -0
  165. data/app/models/pageflow/positioned_file.rb +5 -5
  166. data/app/models/pageflow/potential_entry_translations.rb +55 -0
  167. data/app/models/pageflow/potential_memberships.rb +5 -4
  168. data/app/models/pageflow/published_entry.rb +62 -11
  169. data/app/models/pageflow/revision.rb +24 -15
  170. data/app/models/pageflow/roles.rb +14 -18
  171. data/app/models/pageflow/site.rb +36 -3
  172. data/app/models/pageflow/site_root_entry_form.rb +27 -0
  173. data/app/models/pageflow/sitemaps.rb +10 -1
  174. data/app/models/pageflow/storyline.rb +5 -2
  175. data/app/models/pageflow/storyline_scaffold.rb +1 -1
  176. data/app/models/pageflow/text_track_file.rb +1 -1
  177. data/app/models/pageflow/text_track_file_url_templates.rb +1 -1
  178. data/app/models/pageflow/theme_customization_file.rb +3 -2
  179. data/app/models/pageflow/thumbnail_file_resolver.rb +1 -1
  180. data/app/models/pageflow/url_template.rb +1 -1
  181. data/app/models/pageflow/used_file.rb +7 -3
  182. data/app/models/pageflow/user_name_query.rb +2 -2
  183. data/app/models/pageflow/video_file.rb +22 -15
  184. data/app/models/pageflow/video_file_url_templates.rb +6 -4
  185. data/app/models/pageflow/widget.rb +4 -3
  186. data/app/models/pageflow/with_file_usage_extension.rb +1 -1
  187. data/app/models/pageflow/zencoder_attachment.rb +8 -8
  188. data/app/policies/pageflow/account_policy.rb +3 -1
  189. data/app/policies/pageflow/admin/admin_only_tab_policy.rb +1 -0
  190. data/app/policies/pageflow/admin/entry_tab_policy.rb +1 -0
  191. data/app/policies/pageflow/application_policy.rb +2 -0
  192. data/app/policies/pageflow/entry_policy.rb +7 -1
  193. data/app/policies/pageflow/entry_template_policy.rb +2 -1
  194. data/app/policies/pageflow/file_policy.rb +4 -7
  195. data/app/policies/pageflow/folder_policy.rb +18 -8
  196. data/app/policies/pageflow/membership_policy.rb +6 -4
  197. data/app/policies/pageflow/site_policy.rb +10 -3
  198. data/app/policies/pageflow/user_policy.rb +6 -4
  199. data/app/state_machines/pageflow/image_and_text_track_processing_state_machine.rb +3 -2
  200. data/app/state_machines/pageflow/media_encoding_state_machine.rb +5 -4
  201. data/app/views/admin/accounts/_entry_template_details.html.arb +2 -2
  202. data/app/views/admin/entries/_attributes_table.html.arb +6 -5
  203. data/app/views/admin/entries/_form.html.erb +2 -1
  204. data/app/views/admin/entries/_permalink_inputs.html.erb +9 -2
  205. data/app/views/admin/entry_templates/_form.html.erb +1 -3
  206. data/app/views/admin/site_root_entry/choose.html.erb +19 -0
  207. data/app/views/admin/sites/_fields.html.erb +14 -1
  208. data/app/views/admin/translations/_form.html.erb +31 -0
  209. data/app/views/admin/users/_attributes_table.html.arb +13 -0
  210. data/app/views/components/pageflow/admin/add_membership_button.rb +13 -12
  211. data/app/views/components/pageflow/admin/custom_scopes_renderer.rb +1 -0
  212. data/app/views/components/pageflow/admin/embed_code_field.rb +1 -0
  213. data/app/views/components/pageflow/admin/embedded_index_table.rb +9 -10
  214. data/app/views/components/pageflow/admin/entries_tab.rb +1 -0
  215. data/app/views/components/pageflow/admin/entry_publication_state_indicator.rb +6 -5
  216. data/app/views/components/pageflow/admin/entry_templates_tab.rb +2 -1
  217. data/app/views/components/pageflow/admin/entry_translations_tab.rb +102 -0
  218. data/app/views/components/pageflow/admin/entry_user_badge_list.rb +1 -0
  219. data/app/views/components/pageflow/admin/extensible_attributes_table.rb +9 -8
  220. data/app/views/components/pageflow/admin/features_tab.rb +1 -0
  221. data/app/views/components/pageflow/admin/grouped_folder_list.rb +1 -0
  222. data/app/views/components/pageflow/admin/icon_link_to.rb +1 -0
  223. data/app/views/components/pageflow/admin/members_tab.rb +4 -3
  224. data/app/views/components/pageflow/admin/membership_role_with_tooltip.rb +3 -2
  225. data/app/views/components/pageflow/admin/revisions_tab.rb +14 -10
  226. data/app/views/components/pageflow/admin/sites_tab.rb +1 -0
  227. data/app/views/components/pageflow/admin/tabs_view.rb +1 -0
  228. data/app/views/components/pageflow/admin/timestamp.rb +6 -5
  229. data/app/views/components/pageflow/admin/user_account_badge_list.rb +2 -3
  230. data/app/views/components/pageflow/admin/user_accounts_tab.rb +1 -0
  231. data/app/views/components/pageflow/admin/user_entries_tab.rb +1 -0
  232. data/app/views/components/pageflow/admin/users_tab.rb +1 -0
  233. data/app/views/pageflow/editor/config/_seeds.json.jbuilder +1 -1
  234. data/app/views/pageflow/editor/entries/index.json.jbuilder +1 -1
  235. data/app/views/pageflow/editor/entries/show.json.jbuilder +1 -1
  236. data/app/views/pageflow/editor/entry_publications/check.json.jbuilder +2 -2
  237. data/app/views/pageflow/editor/files/_file.json.jbuilder +5 -13
  238. data/app/views/pageflow/editor/files/create.json.jbuilder +1 -1
  239. data/app/views/pageflow/editor/files/index.json.jbuilder +1 -1
  240. data/app/views/pageflow/editor/sites/_site.json.jbuilder +1 -0
  241. data/app/views/pageflow/editor/video_files/_video_file.json.jbuilder +1 -3
  242. data/app/views/pageflow/entries/share_menu/_bluesky_link.html.erb +8 -0
  243. data/app/views/pageflow/entries/share_menu/_threads_link.html.erb +8 -0
  244. data/app/views/pageflow/files/_file.json.jbuilder +3 -3
  245. data/app/views/pageflow/sitemaps/index.xml.builder +9 -1
  246. data/app/views/pageflow/social_share/_entry_meta_tags.html.erb +1 -1
  247. data/app/views/pageflow/social_share/_page_meta_tags.html.erb +1 -1
  248. data/config/initializers/active_admin_patches.rb +3 -6
  249. data/config/initializers/admin_resource_tabs.rb +3 -0
  250. data/config/initializers/paperclip.rb +1 -0
  251. data/config/initializers/symmetric_encryption.rb +1 -1
  252. data/config/initializers/zencoder.rb +24 -13
  253. data/config/locales/de.yml +110 -4
  254. data/config/locales/en.yml +109 -7
  255. data/config/routes.rb +15 -13
  256. data/config/spring.rb +2 -1
  257. data/db/migrate/20140418225525_setup_schema.rb +2 -2
  258. data/db/migrate/20190306161431_copy_file_attributes_of_failed_uploads.rb +2 -2
  259. data/db/migrate/20190820152900_drop_accounts_themes.rb +2 -1
  260. data/db/migrate/20191202145757_create_pageflow_scrolled_sections.rb +11 -11
  261. data/db/migrate/20191202150657_create_pageflow_scrolled_chapters.rb +1 -1
  262. data/db/migrate/20191202154723_create_pageflow_scrolled_content_elements.rb +9 -9
  263. data/db/migrate/20191219143450_add_position_to_content_elements.rb +2 -1
  264. data/db/migrate/20200117133200_change_revision_appearance_option_default_and_null.rb +2 -1
  265. data/db/migrate/20200122115400_create_pageflow_entry_templates.rb +25 -25
  266. data/db/migrate/20200206134400_convert_legacy_scrolled_content_element_types.rb +3 -3
  267. data/db/migrate/20221215120856_associate_entry_templates_with_sites.rb +2 -2
  268. data/db/migrate/20230120092923_create_other_files.rb +2 -1
  269. data/db/migrate/20230419083307_create_pageflow_entry_translation_group.rb +9 -0
  270. data/db/migrate/20240612110434_add_cutoff_mode_name_to_sites.rb +5 -0
  271. data/db/migrate/20240918084059_create_pageflow_permalink_redirects.rb +14 -0
  272. data/db/migrate/20250508172234_ensure_scrolled_entries_have_main_storyline.rb +14 -0
  273. data/db/migrate/20250617090048_add_custom404_entry_to_sites.rb +5 -0
  274. data/db/migrate/20250617100000_add_perma_id_counter_to_entries.rb +28 -0
  275. data/db/migrate/20250722174123_add_perma_id_to_chapters.rb +10 -0
  276. data/db/migrate/20250725080603_add_perma_id_indexes_to_revision_components.rb +13 -0
  277. data/db/migrate/20250726000000_add_display_name_to_file_usages.rb +5 -0
  278. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +3912 -1486
  279. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +468 -1161
  280. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +28125 -22
  281. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +26589 -19
  282. data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +1 -0
  283. data/entry_types/paged/app/helpers/pageflow_paged/page_background_asset_helper.rb +1 -1
  284. data/entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb +7 -7
  285. data/entry_types/paged/app/views/pageflow_paged/editor/entries/_seed.json.jbuilder +1 -0
  286. data/entry_types/paged/app/views/pageflow_paged/entries/show.html.erb +1 -0
  287. data/entry_types/paged/lib/pageflow_paged/plugin.rb +4 -0
  288. data/entry_types/paged/lib/pageflow_paged/react/page_type.rb +1 -1
  289. data/entry_types/paged/lib/pageflow_paged/react/widget_type.rb +3 -3
  290. data/entry_types/paged/lib/pageflow_paged.rb +1 -1
  291. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +5 -3
  292. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +2 -2
  293. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +2 -2
  294. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +2 -1
  295. data/entry_types/scrolled/app/helpers/pageflow_scrolled/cache_helper.rb +2 -2
  296. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/entry_json_seed_helper.rb +1 -0
  297. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +2 -1
  298. data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +60 -6
  299. data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +16 -2
  300. data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +21 -23
  301. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +16 -1
  302. data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +15 -14
  303. data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +12 -0
  304. data/entry_types/scrolled/app/models/pageflow_scrolled/section.rb +12 -1
  305. data/entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb +19 -1
  306. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -0
  307. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/sections/_section_with_content_elements.json.jbuilder +2 -2
  308. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +2 -0
  309. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +17 -9
  310. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry_translations.json.jbuilder +14 -0
  311. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +25 -5
  312. data/entry_types/scrolled/app/views/pageflow_scrolled/storylines/_storyline.json.jbuilder +7 -0
  313. data/entry_types/scrolled/config/locales/de.yml +614 -45
  314. data/entry_types/scrolled/config/locales/en.yml +586 -47
  315. data/entry_types/scrolled/config/routes.rb +18 -8
  316. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +11 -11
  317. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDarkVariantDesktop.svg +56 -0
  318. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDarkVariantMobile.svg +22 -0
  319. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt +26 -11
  320. data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +27 -8
  321. data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +1 -1
  322. data/entry_types/scrolled/lib/pageflow_scrolled/additional_theme_assets.rb +27 -0
  323. data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +16 -4
  324. data/entry_types/scrolled/lib/pageflow_scrolled/content_element_consent_vendors.rb +1 -1
  325. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +24 -4
  326. data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +24 -22
  327. data/entry_types/scrolled/lib/pageflow_scrolled.rb +1 -1
  328. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +6 -5
  329. data/entry_types/scrolled/package/config/webpack.js +22 -0
  330. data/entry_types/scrolled/package/contentElements/hotspots-frontend.css +1 -0
  331. data/entry_types/scrolled/package/contentElements/hotspots-frontend.js +1529 -0
  332. data/entry_types/scrolled/package/contentElements/tikTokEmbed-frontend.css +1 -0
  333. data/entry_types/scrolled/package/contentElements/tikTokEmbed-frontend.js +59 -0
  334. data/entry_types/scrolled/package/contentElements-editor.js +2075 -321
  335. data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
  336. data/entry_types/scrolled/package/contentElements-frontend.js +1019 -643
  337. data/entry_types/scrolled/package/editor.js +2086 -1091
  338. data/entry_types/scrolled/package/frontend/{EditableInlineText.module-ebd22921.js → FloatingPortalRootProvider-51914be7.js} +1200 -1258
  339. data/entry_types/scrolled/package/frontend/{PhonePlatformContext-4ec6b2de.js → PhonePlatformContext-9f76033e.js} +7 -8
  340. data/entry_types/scrolled/package/frontend/ThemeIcon-81f2f066.js +1932 -0
  341. data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-788e9cdb.js +39 -0
  342. data/entry_types/scrolled/package/frontend/{Viewer-1bb5597c.js → Viewer-0345ce57.js} +36 -63
  343. data/entry_types/scrolled/package/frontend/{Viewer-1ecf3375.js → Viewer-cdc549cc.js} +15 -22
  344. data/entry_types/scrolled/package/frontend/{Wavesurfer-7d9cf1b7.js → Wavesurfer-1cdc3925.js} +54 -74
  345. data/entry_types/scrolled/package/frontend/{components-024a9893.js → components-96660ffd.js} +1791 -841
  346. data/entry_types/scrolled/package/frontend/{index-11f32f10.js → index-eb670c2f.js} +11 -18
  347. data/entry_types/scrolled/package/frontend/index.css +1 -1
  348. data/entry_types/scrolled/package/frontend/index.js +517 -903
  349. data/entry_types/scrolled/package/frontend/{createSuper-d0f30da3.js → inherits-539844a6.js} +40 -56
  350. data/entry_types/scrolled/package/frontend/{useContentElementEditorState-4f4c3cf6.js → useContentElementEditorState-77fe6c79.js} +7 -8
  351. data/entry_types/scrolled/package/frontend/usePhonePlatform-c2ba875d.js +8 -0
  352. data/entry_types/scrolled/package/frontend-server.js +0 -1
  353. data/entry_types/scrolled/package/package.json +18 -10
  354. data/entry_types/scrolled/package/testHelpers.js +306 -70
  355. data/entry_types/scrolled/package/values/widgets.module.css +18 -0
  356. data/entry_types/scrolled/package/widgets/consentBar.css +1 -1
  357. data/entry_types/scrolled/package/widgets/consentBar.js +47 -66
  358. data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
  359. data/entry_types/scrolled/package/widgets/defaultNavigation.js +177 -207
  360. data/entry_types/scrolled/package/widgets/excursionDialog.css +1 -0
  361. data/entry_types/scrolled/package/widgets/excursionDialog.js +109 -0
  362. data/entry_types/scrolled/package/widgets/excursionSheet.css +1 -0
  363. data/entry_types/scrolled/package/widgets/excursionSheet.js +262 -0
  364. data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -1
  365. data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +6 -9
  366. data/entry_types/scrolled/package/widgets/iconScrollIndicator.css +1 -0
  367. data/entry_types/scrolled/package/widgets/iconScrollIndicator.js +48 -0
  368. data/entry_types/scrolled/package/widgets/mainStorylineSheet.css +1 -0
  369. data/entry_types/scrolled/package/widgets/mainStorylineSheet.js +144 -0
  370. data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -1
  371. data/entry_types/scrolled/package/widgets/textInlineFileRights.js +26 -9
  372. data/entry_types/scrolled/package/widgets-server.js +1 -0
  373. data/entry_types/scrolled/spec/factories/chapters.rb +14 -1
  374. data/entry_types/scrolled/spec/factories/content_elements.rb +1 -1
  375. data/lib/generators/pageflow/active_admin_initializer/active_admin_initializer_generator.rb +5 -3
  376. data/lib/generators/pageflow/assets/assets_generator.rb +7 -5
  377. data/lib/generators/pageflow/cancan/cancan_generator.rb +2 -1
  378. data/lib/generators/pageflow/cancan/templates/ability.rb +1 -1
  379. data/lib/generators/pageflow/error_pages/error_pages_generator.rb +2 -1
  380. data/lib/generators/pageflow/initializer/initializer_generator.rb +3 -2
  381. data/lib/generators/pageflow/install/install_generator.rb +2 -2
  382. data/lib/generators/pageflow/procfile/procfile_generator.rb +2 -1
  383. data/lib/generators/pageflow/resque/resque_generator.rb +6 -4
  384. data/lib/generators/pageflow/resque/templates/resque.rake +1 -1
  385. data/lib/generators/pageflow/routes/routes_generator.rb +4 -2
  386. data/lib/generators/pageflow/seeds/seeds_generator.rb +3 -2
  387. data/lib/generators/pageflow/seeds/templates/seeds.rb +6 -6
  388. data/lib/generators/pageflow/theme/theme_generator.rb +2 -1
  389. data/lib/generators/pageflow/user/user_generator.rb +2 -1
  390. data/lib/pageflow/ability_mixin.rb +25 -15
  391. data/lib/pageflow/active_admin_patches/views/attributes_table.rb +1 -0
  392. data/lib/pageflow/active_admin_patches/views/pages/base.rb +3 -2
  393. data/lib/pageflow/active_admin_patches/views/table_for.rb +1 -0
  394. data/lib/pageflow/additional_headers.rb +27 -0
  395. data/lib/pageflow/admin/attributes_table_rows.rb +3 -3
  396. data/lib/pageflow/admin/tabs.rb +1 -1
  397. data/lib/pageflow/built_in_file_type.rb +1 -1
  398. data/lib/pageflow/built_in_page_types_plugin.rb +1 -1
  399. data/lib/pageflow/built_in_widget_type.rb +2 -2
  400. data/lib/pageflow/built_in_widget_types_plugin.rb +2 -1
  401. data/lib/pageflow/configuration.rb +141 -18
  402. data/lib/pageflow/cutoff_modes.rb +39 -0
  403. data/lib/pageflow/editor_controller.rb +6 -10
  404. data/lib/pageflow/engine.rb +4 -5
  405. data/lib/pageflow/entry_export_import/attachment_files.rb +1 -1
  406. data/lib/pageflow/entry_export_import/entry_serialization.rb +5 -4
  407. data/lib/pageflow/entry_export_import/file_mappings.rb +1 -0
  408. data/lib/pageflow/entry_export_import/revision_serialization/import.rb +1 -1
  409. data/lib/pageflow/entry_export_import.rb +3 -3
  410. data/lib/pageflow/entry_types.rb +2 -2
  411. data/lib/pageflow/feature.rb +1 -1
  412. data/lib/pageflow/features.rb +4 -6
  413. data/lib/pageflow/file_importers.rb +4 -4
  414. data/lib/pageflow/file_type.rb +3 -3
  415. data/lib/pageflow/file_types.rb +3 -3
  416. data/lib/pageflow/global_config_api.rb +5 -6
  417. data/lib/pageflow/help_entries.rb +7 -7
  418. data/lib/pageflow/help_entry.rb +1 -1
  419. data/lib/pageflow/hooks.rb +1 -1
  420. data/lib/pageflow/nested_revision_component.rb +9 -27
  421. data/lib/pageflow/news_item_api.rb +1 -1
  422. data/lib/pageflow/page_type.rb +2 -3
  423. data/lib/pageflow/page_types.rb +3 -3
  424. data/lib/pageflow/paperclip_interpolations/support.rb +1 -1
  425. data/lib/pageflow/paperclip_processors/vtt.rb +1 -0
  426. data/lib/pageflow/paperclip_processors/webp.rb +2 -2
  427. data/lib/pageflow/partial_editor_fragment_renderer.rb +2 -2
  428. data/lib/pageflow/plugin.rb +1 -2
  429. data/lib/pageflow/quota.rb +9 -5
  430. data/lib/pageflow/quotas.rb +1 -1
  431. data/lib/pageflow/rails_version.rb +1 -0
  432. data/lib/pageflow/react.rb +1 -1
  433. data/lib/pageflow/revision_component.rb +8 -40
  434. data/lib/pageflow/revision_components.rb +16 -6
  435. data/lib/pageflow/seeds.rb +12 -16
  436. data/lib/pageflow/theme.rb +1 -1
  437. data/lib/pageflow/theme_customizations.rb +10 -10
  438. data/lib/pageflow/themes.rb +3 -3
  439. data/lib/pageflow/user_mixin.rb +6 -6
  440. data/lib/pageflow/version.rb +1 -1
  441. data/lib/pageflow/widget_type.rb +4 -4
  442. data/lib/pageflow/widget_types.rb +9 -9
  443. data/lib/pageflow/zencoder_api.rb +32 -42
  444. data/lib/pageflow/zencoder_audio_output_definition.rb +14 -13
  445. data/lib/pageflow/zencoder_meta_data_output_definition.rb +3 -2
  446. data/lib/pageflow/zencoder_output_definition.rb +16 -14
  447. data/lib/pageflow/zencoder_video_output_definition.rb +140 -88
  448. data/lib/pageflow.rb +7 -2
  449. data/lib/tasks/pageflow_tasks.rake +1 -1
  450. data/package/editor.js +954 -868
  451. data/package/frontend.js +113 -387
  452. data/package/package.json +2 -1
  453. data/package/testHelpers.js +10 -56
  454. data/package/ui.js +209 -251
  455. data/spec/factories/accounts.rb +37 -22
  456. data/spec/factories/audio_files.rb +2 -2
  457. data/spec/factories/authentication_tokens.rb +4 -4
  458. data/spec/factories/chapters.rb +4 -4
  459. data/spec/factories/draft_entries.rb +14 -6
  460. data/spec/factories/edit_locks.rb +1 -1
  461. data/spec/factories/entries.rb +28 -19
  462. data/spec/factories/entry_translation_groups.rb +6 -0
  463. data/spec/factories/file_usages.rb +2 -1
  464. data/spec/factories/folders.rb +1 -1
  465. data/spec/factories/image_files.rb +2 -2
  466. data/spec/factories/pages.rb +3 -3
  467. data/spec/factories/published_entries.rb +26 -8
  468. data/spec/factories/revisions.rb +1 -1
  469. data/spec/factories/sites.rb +6 -0
  470. data/spec/factories/test_multi_attachment_files.rb +1 -1
  471. data/spec/factories/text_track_files.rb +1 -1
  472. data/spec/factories/uploadable_files.rb +1 -1
  473. data/spec/factories/users.rb +6 -6
  474. data/spec/factories/video_files.rb +2 -2
  475. data/spec/factories/widgets.rb +1 -1
  476. data/spec/fixtures/7x15_rotated.jpg +0 -0
  477. data/vendor/assets/javascripts/wysihtml-toolbar.js +19288 -0
  478. metadata +98 -45
  479. data/config/initializers/revision_components.rb +0 -5
  480. data/config/locales/twitter_to_x.de.yml +0 -6
  481. data/config/locales/twitter_to_x.en.yml +0 -6
  482. data/entry_types/scrolled/config/locales/twitter_to_x.de.yml +0 -12
  483. data/entry_types/scrolled/config/locales/twitter_to_x.en.yml +0 -12
  484. data/entry_types/scrolled/config/locales/vr_image_projection.de.yml +0 -24
  485. data/entry_types/scrolled/config/locales/vr_image_projection.en.yml +0 -24
  486. data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-b79159cc.js +0 -107
  487. data/entry_types/scrolled/package/frontend/arrowRight-62998af9.js +0 -77
  488. data/entry_types/scrolled/package/frontend/i18n-ce13a8bf.js +0 -1129
@@ -1,4 +1,4 @@
1
- import { useContentElementConfigurationUpdate, useI18n, useDarkBackground, useContentElementEditorState, useIsStaticPreview, useContentElementLifecycle, utils, contentElementWidths, withShadowClassName, paletteColor, Text, EditableInlineText, frontend, useFileWithInlineRights, FitViewport, ContentElementBox, ContentElementFigure, InlineFileRights, usePortraitOrientation, ExpandableImage, Image, usePlayerState, MediaInteractionTracking, useAudioFocus, VideoPlayerControls, PlayerEventContextDataProvider, VideoPlayer, AudioPlayerControls, AudioPlayer, useMediaMuted, useTheme, EditableText, ThirdPartyOptOutInfo, useFile, ThirdPartyOptIn, useAtmo, textColorForBackgroundColor, Panorama, ThemeIcon, useLocale, Figure, usePhonePlatform, FullscreenViewer, ToggleFullscreenCornerButton } from 'pageflow-scrolled/frontend';
1
+ import { useContentElementConfigurationUpdate, useI18n, useDarkBackground, useContentElementEditorState, useIsStaticPreview, useContentElementLifecycle, utils, contentElementWidths, withShadowClassName, paletteColor, Text, EditableInlineText, frontend, useFileWithInlineRights, FitViewport, ContentElementBox, ContentElementFigure, InlineFileRights, usePortraitOrientation, ExpandableImage, Image, usePlayerState, MediaInteractionTracking, useBackgroundFile, useAudioFocus, VideoPlayerControls, PlayerEventContextDataProvider, VideoPlayer, AudioPlayerControls, AudioPlayer, useMediaMuted, useTheme, EditableText, ThirdPartyOptOutInfo, useFile, ThirdPartyOptIn, useAtmo, LinkButton, EditableLink, ScrollButton as ScrollButton$1, useContentElementEditorCommandSubscription, LinkTooltipProvider, contentElementWidthName, textColorForBackgroundColor, Panorama, ThemeIcon, useLocale, usePhonePlatform, FullscreenViewer, ToggleFullscreenCornerButton, PaginationIndicator, Figure, EditableTable } from 'pageflow-scrolled/frontend';
2
2
  import React, { useState, useRef, useEffect, useMemo, useCallback, forwardRef } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import ReactCompareImage from 'react-compare-image';
@@ -83,33 +83,27 @@ var styles = {"darkContentTextColor":"var(--theme-dark-content-text-color, #222)
83
83
 
84
84
  function Heading(_ref) {
85
85
  var configuration = _ref.configuration,
86
- sectionProps = _ref.sectionProps,
87
- contentElementWidth = _ref.contentElementWidth;
86
+ sectionProps = _ref.sectionProps,
87
+ contentElementWidth = _ref.contentElementWidth;
88
88
  var level = configuration.level || sectionProps.sectionIndex;
89
89
  var firstSectionInEntry = level === 0;
90
90
  var updateConfiguration = useContentElementConfigurationUpdate();
91
-
92
91
  var _useI18n = useI18n({
93
- locale: 'ui'
94
- }),
95
- t = _useI18n.t;
96
-
92
+ locale: 'ui'
93
+ }),
94
+ t = _useI18n.t;
97
95
  var darkBackground = useDarkBackground();
98
-
99
96
  var _useContentElementEdi = useContentElementEditorState(),
100
- isSelected = _useContentElementEdi.isSelected,
101
- isEditable = _useContentElementEdi.isEditable;
102
-
97
+ isSelected = _useContentElementEdi.isSelected,
98
+ isEditable = _useContentElementEdi.isEditable;
103
99
  var legacyValue = configuration.children;
104
100
  var Tag = firstSectionInEntry ? 'h1' : 'h2';
105
101
  var forcePaddingTop = firstSectionInEntry && !('marginTop' in configuration);
106
102
  var entranceAnimation = !useIsStaticPreview() && configuration.entranceAnimation || 'none';
107
-
108
103
  var _useState = useState(false),
109
- _useState2 = _slicedToArray(_useState, 2),
110
- animating = _useState2[0],
111
- setAnimating = _useState2[1];
112
-
104
+ _useState2 = _slicedToArray(_useState, 2),
105
+ animating = _useState2[0],
106
+ setAnimating = _useState2[1];
113
107
  useContentElementLifecycle({
114
108
  onActivate: function onActivate() {
115
109
  setAnimating(entranceAnimation !== 'none');
@@ -135,19 +129,16 @@ function Heading(_ref) {
135
129
  if (!previouslySelected.current && isSelected) {
136
130
  setAnimating(true);
137
131
  }
138
-
139
132
  previouslySelected.current = isSelected;
140
133
  }, [isSelected]);
141
-
142
134
  function renderSubtitle(name) {
143
135
  var value = configuration[name];
144
-
145
136
  if (!isSelected && utils.isBlankEditableTextValue(value)) {
146
137
  return null;
147
138
  }
148
-
149
139
  return /*#__PURE__*/React.createElement(Text, {
150
- scaleCategory: getScaleCategory(configuration, firstSectionInEntry, name)
140
+ scaleCategory: getScaleCategory(configuration, firstSectionInEntry, name),
141
+ typographyVariant: configuration.typographyVariant
151
142
  }, /*#__PURE__*/React.createElement("div", {
152
143
  className: styles[name],
153
144
  role: "doc-subtitle"
@@ -160,7 +151,6 @@ function Heading(_ref) {
160
151
  }
161
152
  })));
162
153
  }
163
-
164
154
  return /*#__PURE__*/React.createElement("header", {
165
155
  className: classNames(styles.root, styles["animation-".concat(entranceAnimation)], _defineProperty({}, styles.animating, animating), _defineProperty({}, styles.hasTagline, !utils.isBlankEditableTextValue(configuration.tagline) || isSelected), _defineProperty({}, styles.forcePaddingTop, forcePaddingTop), _defineProperty({}, styles[sectionProps.layout], contentElementWidth > contentElementWidths.md || sectionProps.layout === 'centerRagged'), _defineProperty({}, withShadowClassName, !sectionProps.invert))
166
156
  }, renderSubtitle('tagline'), /*#__PURE__*/React.createElement(Tag, {
@@ -183,26 +173,20 @@ function Heading(_ref) {
183
173
  }
184
174
  }))), renderSubtitle('subtitle'));
185
175
  }
186
-
187
176
  function getScaleCategory(configuration, firstSectionInEntry) {
188
177
  var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
189
178
  var base = "heading".concat(capitalize(suffix));
190
-
191
179
  switch (configuration.textSize) {
192
180
  case 'large':
193
181
  return "".concat(base, "-lg");
194
-
195
182
  case 'medium':
196
183
  return "".concat(base, "-md");
197
-
198
184
  case 'small':
199
185
  return "".concat(base, "-sm");
200
-
201
186
  default:
202
187
  return firstSectionInEntry ? "".concat(base, "-lg") : "".concat(base, "-sm");
203
188
  }
204
189
  }
205
-
206
190
  function capitalize(string) {
207
191
  return string.charAt(0).toUpperCase() + string.slice(1);
208
192
  }
@@ -222,22 +206,19 @@ var placeholderFile = {
222
206
  };
223
207
  function BeforeAfter(configuration) {
224
208
  var isActive = configuration.isActive,
225
- load = configuration.load,
226
- before_label = configuration.before_label,
227
- after_label = configuration.after_label,
228
- initial_slider_position = configuration.initial_slider_position,
229
- slider_color = configuration.slider_color;
230
-
209
+ load = configuration.load,
210
+ before_label = configuration.before_label,
211
+ after_label = configuration.after_label,
212
+ initial_slider_position = configuration.initial_slider_position,
213
+ slider_color = configuration.slider_color;
231
214
  var _useState = useState(false),
232
- _useState2 = _slicedToArray(_useState, 2),
233
- wiggle = _useState2[0],
234
- setWiggle = _useState2[1];
235
-
215
+ _useState2 = _slicedToArray(_useState, 2),
216
+ wiggle = _useState2[0],
217
+ setWiggle = _useState2[1];
236
218
  var _useState3 = useState(false),
237
- _useState4 = _slicedToArray(_useState3, 2),
238
- moved = _useState4[0],
239
- setMoved = _useState4[1];
240
-
219
+ _useState4 = _slicedToArray(_useState3, 2),
220
+ moved = _useState4[0],
221
+ setMoved = _useState4[1];
241
222
  useEffect(function () {
242
223
  // Only wiggle once per element, when it is active for the first
243
224
  // time
@@ -255,10 +236,8 @@ function BeforeAfter(configuration) {
255
236
  collectionName: 'imageFiles',
256
237
  propertyName: 'after_id'
257
238
  });
258
-
259
239
  var _useContentElementEdi = useContentElementEditorState(),
260
- isSelected = _useContentElementEdi.isSelected;
261
-
240
+ isSelected = _useContentElementEdi.isSelected;
262
241
  var beforeImageUrl = beforeImage && beforeImage.urls.large;
263
242
  var beforeImageAlt = beforeImage && beforeImage.configuration.alt;
264
243
  var afterImageUrl = afterImage && afterImage.urls.large;
@@ -272,40 +251,39 @@ function BeforeAfter(configuration) {
272
251
  label: 'after'
273
252
  }];
274
253
  return /*#__PURE__*/React.createElement(FitViewport, {
275
- file: beforeImage || afterImage || placeholderFile
254
+ file: beforeImage || afterImage || placeholderFile,
255
+ fill: configuration.position === 'backdrop'
276
256
  }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
277
257
  configuration: configuration
278
258
  }, /*#__PURE__*/React.createElement(FitViewport.Content, null, /*#__PURE__*/React.createElement(Measure, {
279
259
  bounds: true
280
260
  }, function (_ref) {
281
- var _cx;
282
-
283
261
  var measureRef = _ref.measureRef,
284
- contentRect = _ref.contentRect;
262
+ contentRect = _ref.contentRect;
285
263
  var initialRectWidth = contentRect.bounds.width * initialSliderPos + 'px';
286
264
  return /*#__PURE__*/React.createElement("div", {
287
265
  ref: measureRef,
288
266
  style: {
289
267
  '--initial-rect-width': initialRectWidth
290
268
  },
291
- className: classNames((_cx = {}, _defineProperty(_cx, styles$1.selected, isSelected), _defineProperty(_cx, styles$1.wiggle, wiggle && !moved), _cx), styles$1.container)
269
+ className: classNames(_defineProperty(_defineProperty({}, styles$1.selected, isSelected), styles$1.wiggle, wiggle && !moved), styles$1.container)
292
270
  }, /*#__PURE__*/React.createElement(InitialSliderPositionIndicator, {
293
271
  parentSelected: isSelected,
294
272
  position: initial_slider_position
295
273
  }), renderCompareImage());
296
274
  }), /*#__PURE__*/React.createElement(InlineFileRights, {
275
+ configuration: configuration,
297
276
  context: "insideElement",
298
277
  items: inlineFileRightsItems
299
278
  })))), /*#__PURE__*/React.createElement(InlineFileRights, {
279
+ configuration: configuration,
300
280
  context: "afterElement",
301
281
  items: inlineFileRightsItems
302
282
  }));
303
-
304
283
  function renderCompareImage() {
305
284
  if (!load) {
306
285
  return null;
307
286
  }
308
-
309
287
  return /*#__PURE__*/React.createElement(ReactCompareImage, {
310
288
  leftImage: beforeImage ? beforeImageUrl : placeholderForBeforeImage,
311
289
  rightImage: afterImage ? afterImageUrl : placeholderForAfterImage,
@@ -321,10 +299,9 @@ function BeforeAfter(configuration) {
321
299
  });
322
300
  }
323
301
  }
324
-
325
302
  function InitialSliderPositionIndicator(_ref2) {
326
303
  var parentSelected = _ref2.parentSelected,
327
- position = _ref2.position;
304
+ position = _ref2.position;
328
305
  var indicatorWidth = '2px';
329
306
  var indicatorStyles = {
330
307
  left: "calc(".concat(position, "% - ").concat(indicatorWidth, "/2)"),
@@ -332,9 +309,10 @@ function InitialSliderPositionIndicator(_ref2) {
332
309
  height: '100%',
333
310
  borderLeft: '1px solid black',
334
311
  borderRight: '1px solid black'
335
- }; // In case this element is selected, and its initial slider position
336
- // is not in the middle, we show InitialSliderPositionIndicator
312
+ };
337
313
 
314
+ // In case this element is selected, and its initial slider position
315
+ // is not in the middle, we show InitialSliderPositionIndicator
338
316
  return parentSelected && position !== 50 ? /*#__PURE__*/React.createElement("div", {
339
317
  className: styles$1.sliderStart,
340
318
  style: indicatorStyles
@@ -343,9 +321,8 @@ function InitialSliderPositionIndicator(_ref2) {
343
321
 
344
322
  function InlineBeforeAfter(props) {
345
323
  var _useContentElementLif = useContentElementLifecycle(),
346
- isActive = _useContentElementLif.isActive,
347
- shouldLoad = _useContentElementLif.shouldLoad;
348
-
324
+ isActive = _useContentElementLif.isActive,
325
+ shouldLoad = _useContentElementLif.shouldLoad;
349
326
  return /*#__PURE__*/React.createElement(BeforeAfter, Object.assign({}, props.configuration, {
350
327
  load: shouldLoad,
351
328
  isActive: isActive
@@ -357,28 +334,65 @@ frontend.contentElementTypes.register('inlineBeforeAfter', {
357
334
  lifecycle: true
358
335
  });
359
336
 
337
+ function ownKeys(object, enumerableOnly) {
338
+ var keys = Object.keys(object);
339
+
340
+ if (Object.getOwnPropertySymbols) {
341
+ var symbols = Object.getOwnPropertySymbols(object);
342
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
343
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
344
+ });
345
+ keys.push.apply(keys, symbols);
346
+ }
347
+
348
+ return keys;
349
+ }
350
+
351
+ function _objectSpread2(target) {
352
+ for (var i = 1; i < arguments.length; i++) {
353
+ var source = arguments[i] != null ? arguments[i] : {};
354
+
355
+ if (i % 2) {
356
+ ownKeys(Object(source), true).forEach(function (key) {
357
+ _defineProperty(target, key, source[key]);
358
+ });
359
+ } else if (Object.getOwnPropertyDescriptors) {
360
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
361
+ } else {
362
+ ownKeys(Object(source)).forEach(function (key) {
363
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
364
+ });
365
+ }
366
+ }
367
+
368
+ return target;
369
+ }
370
+
360
371
  function InlineImage(_ref) {
361
372
  var contentElementId = _ref.contentElementId,
362
- contentElementWidth = _ref.contentElementWidth,
363
- configuration = _ref.configuration;
364
- var imageFile = useFileWithInlineRights({
373
+ contentElementWidth = _ref.contentElementWidth,
374
+ configuration = _ref.configuration;
375
+ var imageFile = useFileWithCropPosition(useFileWithInlineRights({
365
376
  configuration: configuration,
366
377
  collectionName: 'imageFiles',
367
378
  propertyName: 'id'
368
- });
369
- var portraitImageFile = useFileWithInlineRights({
379
+ }), configuration.cropPosition);
380
+ var portraitImageFile = useFileWithCropPosition(useFileWithInlineRights({
370
381
  configuration: configuration,
371
382
  collectionName: 'imageFiles',
372
383
  propertyName: 'portraitId'
373
- }); // Only render OrientationAwareInlineImage if a portrait image has
384
+ }), configuration.portraitCropPosition);
385
+
386
+ // Only render OrientationAwareInlineImage if a portrait image has
374
387
  // been selected. This prevents having the component rerender on
375
388
  // orientation changes even if it does not depend on orientation at
376
389
  // all.
377
-
378
390
  if (portraitImageFile) {
379
391
  return /*#__PURE__*/React.createElement(OrientationAwareInlineImage, {
380
392
  landscapeImageFile: imageFile,
381
393
  portraitImageFile: portraitImageFile,
394
+ landscapeImageModifiers: configuration.imageModifiers,
395
+ portraitImageModifiers: configuration.portraitImageModifiers,
382
396
  contentElementId: contentElementId,
383
397
  contentElementWidth: contentElementWidth,
384
398
  configuration: configuration
@@ -386,47 +400,58 @@ function InlineImage(_ref) {
386
400
  } else {
387
401
  return /*#__PURE__*/React.createElement(ImageWithCaption, {
388
402
  imageFile: imageFile,
403
+ imageModifiers: configuration.imageModifiers,
389
404
  contentElementId: contentElementId,
390
405
  contentElementWidth: contentElementWidth,
391
406
  configuration: configuration
392
407
  });
393
408
  }
394
409
  }
395
-
396
410
  function OrientationAwareInlineImage(_ref2) {
397
411
  var landscapeImageFile = _ref2.landscapeImageFile,
398
- portraitImageFile = _ref2.portraitImageFile,
399
- contentElementId = _ref2.contentElementId,
400
- contentElementWidth = _ref2.contentElementWidth,
401
- configuration = _ref2.configuration;
412
+ portraitImageFile = _ref2.portraitImageFile,
413
+ landscapeImageModifiers = _ref2.landscapeImageModifiers,
414
+ portraitImageModifiers = _ref2.portraitImageModifiers,
415
+ contentElementId = _ref2.contentElementId,
416
+ contentElementWidth = _ref2.contentElementWidth,
417
+ configuration = _ref2.configuration;
402
418
  var portraitOrientation = usePortraitOrientation();
403
419
  var imageFile = portraitOrientation && portraitImageFile ? portraitImageFile : landscapeImageFile;
420
+ var imageModifiers = portraitOrientation && portraitImageFile ? portraitImageModifiers : landscapeImageModifiers;
404
421
  return /*#__PURE__*/React.createElement(ImageWithCaption, {
405
422
  imageFile: imageFile,
423
+ imageModifiers: imageModifiers,
406
424
  contentElementId: contentElementId,
407
425
  contentElementWidth: contentElementWidth,
408
426
  configuration: configuration
409
427
  });
410
428
  }
411
-
412
429
  function ImageWithCaption(_ref3) {
413
430
  var imageFile = _ref3.imageFile,
414
- contentElementId = _ref3.contentElementId,
415
- contentElementWidth = _ref3.contentElementWidth,
416
- configuration = _ref3.configuration;
417
-
431
+ imageModifiers = _ref3.imageModifiers,
432
+ contentElementId = _ref3.contentElementId,
433
+ contentElementWidth = _ref3.contentElementWidth,
434
+ configuration = _ref3.configuration;
418
435
  var _useContentElementLif = useContentElementLifecycle(),
419
- shouldLoad = _useContentElementLif.shouldLoad;
420
-
436
+ shouldLoad = _useContentElementLif.shouldLoad;
421
437
  var enableFullscreen = configuration.enableFullscreen;
422
438
  var supportFullscreen = enableFullscreen && contentElementWidth < contentElementWidths.full;
439
+ var _processImageModifier = processImageModifiers(imageModifiers),
440
+ aspectRatio = _processImageModifier.aspectRatio,
441
+ rounded = _processImageModifier.rounded;
442
+ var isCircleCrop = rounded === 'circle';
423
443
  return /*#__PURE__*/React.createElement(FitViewport, {
424
444
  file: imageFile,
425
- aspectRatio: imageFile ? undefined : 0.75,
445
+ aspectRatio: aspectRatio || (imageFile ? undefined : 0.75),
426
446
  opaque: !imageFile
427
- }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
447
+ }, /*#__PURE__*/React.createElement(ContentElementBox, {
448
+ borderRadius: isCircleCrop ? 'none' : rounded
449
+ }, /*#__PURE__*/React.createElement(ContentElementFigure, {
428
450
  configuration: configuration
429
- }, /*#__PURE__*/React.createElement(FitViewport.Content, null, /*#__PURE__*/React.createElement(ExpandableImage, {
451
+ }, /*#__PURE__*/React.createElement(FitViewport.Content, null, /*#__PURE__*/React.createElement(ContentElementBox, {
452
+ borderRadius: isCircleCrop ? 'circle' : 'none',
453
+ positioned: isCircleCrop
454
+ }, /*#__PURE__*/React.createElement(ExpandableImage, {
430
455
  enabled: supportFullscreen && shouldLoad,
431
456
  imageFile: imageFile,
432
457
  contentElementId: contentElementId
@@ -436,13 +461,15 @@ function ImageWithCaption(_ref3) {
436
461
  structuredData: true,
437
462
  variant: contentElementWidth === contentElementWidths.full ? 'large' : 'medium',
438
463
  preferSvg: true
439
- })), /*#__PURE__*/React.createElement(InlineFileRights, {
464
+ }))), /*#__PURE__*/React.createElement(InlineFileRights, {
465
+ configuration: configuration,
440
466
  context: "insideElement",
441
467
  items: [{
442
468
  file: imageFile,
443
469
  label: 'image'
444
470
  }]
445
471
  })))), /*#__PURE__*/React.createElement(InlineFileRights, {
472
+ configuration: configuration,
446
473
  context: "afterElement",
447
474
  items: [{
448
475
  file: imageFile,
@@ -450,12 +477,65 @@ function ImageWithCaption(_ref3) {
450
477
  }]
451
478
  }));
452
479
  }
480
+ function processImageModifiers(imageModifiers) {
481
+ var cropValue = getModiferValue(imageModifiers, 'crop');
482
+ var isCircleCrop = cropValue === 'circle';
483
+ return {
484
+ aspectRatio: isCircleCrop ? 1 : cropValue,
485
+ rounded: isCircleCrop ? 'circle' : getModiferValue(imageModifiers, 'rounded')
486
+ };
487
+ }
488
+ function getModiferValue(imageModifiers, name) {
489
+ var _find;
490
+ return (_find = (imageModifiers || []).find(function (imageModifier) {
491
+ return imageModifier.name === name;
492
+ })) === null || _find === void 0 ? void 0 : _find.value;
493
+ }
494
+ function useFileWithCropPosition(file, cropPosition) {
495
+ return file && _objectSpread2(_objectSpread2({}, file), {}, {
496
+ cropPosition: cropPosition
497
+ });
498
+ }
453
499
 
454
500
  frontend.contentElementTypes.register('inlineImage', {
455
501
  component: InlineImage,
456
502
  lifecycle: true
457
503
  });
458
504
 
505
+ function _objectWithoutPropertiesLoose(source, excluded) {
506
+ if (source == null) return {};
507
+ var target = {};
508
+ var sourceKeys = Object.keys(source);
509
+ var key, i;
510
+
511
+ for (i = 0; i < sourceKeys.length; i++) {
512
+ key = sourceKeys[i];
513
+ if (excluded.indexOf(key) >= 0) continue;
514
+ target[key] = source[key];
515
+ }
516
+
517
+ return target;
518
+ }
519
+
520
+ function _objectWithoutProperties(source, excluded) {
521
+ if (source == null) return {};
522
+ var target = _objectWithoutPropertiesLoose(source, excluded);
523
+ var key, i;
524
+
525
+ if (Object.getOwnPropertySymbols) {
526
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
527
+
528
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
529
+ key = sourceSymbolKeys[i];
530
+ if (excluded.indexOf(key) >= 0) continue;
531
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
532
+ target[key] = source[key];
533
+ }
534
+ }
535
+
536
+ return target;
537
+ }
538
+
459
539
  var styles$2 = {"wrapper":"MutedIndicator-module_wrapper__17JUY","visible":"MutedIndicator-module_visible__3qARn","eqBar":"MutedIndicator-module_eqBar__1cMDE","eqBar1":"MutedIndicator-module_eqBar1__2Ap_R MutedIndicator-module_eqBar__1cMDE","short-eq":"MutedIndicator-module_short-eq__1OYlk","eqBar2":"MutedIndicator-module_eqBar2__2QTgX MutedIndicator-module_eqBar__1cMDE","tall-eq":"MutedIndicator-module_tall-eq__6gm0B","eqBar3":"MutedIndicator-module_eqBar3__2S-y3 MutedIndicator-module_eqBar__1cMDE"};
460
540
 
461
541
  function MutedIndicator(_ref) {
@@ -516,13 +596,12 @@ function getLifecycleHandlers(configuration, playerActions) {
516
596
  }
517
597
  function getPlayerClickHandler(_ref) {
518
598
  var configuration = _ref.configuration,
519
- playerActions = _ref.playerActions,
520
- shouldPlay = _ref.shouldPlay,
521
- lastControlledVia = _ref.lastControlledVia,
522
- mediaMuted = _ref.mediaMuted,
523
- isEditable = _ref.isEditable,
524
- isSelected = _ref.isSelected;
525
-
599
+ playerActions = _ref.playerActions,
600
+ shouldPlay = _ref.shouldPlay,
601
+ lastControlledVia = _ref.lastControlledVia,
602
+ mediaMuted = _ref.mediaMuted,
603
+ isEditable = _ref.isEditable,
604
+ isSelected = _ref.isSelected;
526
605
  if (isEditable && !isSelected) {
527
606
  return null;
528
607
  } else if (configuration.playbackMode === 'loop') {
@@ -547,7 +626,6 @@ function getPlayerClickHandler(_ref) {
547
626
  if (configuration.rewindOnUnmute && lastControlledVia === 'autoplay') {
548
627
  playerActions.seekTo(0);
549
628
  }
550
-
551
629
  playerActions.playBlessed();
552
630
  } else if (shouldPlay) {
553
631
  playerActions.pause();
@@ -558,9 +636,11 @@ function getPlayerClickHandler(_ref) {
558
636
  }
559
637
  }
560
638
 
639
+ var _excluded = ["videoFile", "motifArea"];
561
640
  function InlineVideo(_ref) {
562
641
  var contentElementId = _ref.contentElementId,
563
- configuration = _ref.configuration;
642
+ configuration = _ref.configuration,
643
+ sectionProps = _ref.sectionProps;
564
644
  var videoFile = useFileWithInlineRights({
565
645
  configuration: configuration,
566
646
  collectionName: 'videoFiles',
@@ -580,60 +660,70 @@ function InlineVideo(_ref) {
580
660
  configuration: configuration,
581
661
  collectionName: 'imageFiles',
582
662
  propertyName: 'portraitPosterId'
583
- }); // Only render OrientationAwareInlineImage if a portrait image has
663
+ });
664
+
665
+ // Only render OrientationAwareInlineImage if a portrait image has
584
666
  // been selected. This prevents having the component rerender on
585
667
  // orientation changes even if it does not depend on orientation at
586
668
  // all.
587
-
588
669
  if (portraitVideoFile) {
589
670
  return /*#__PURE__*/React.createElement(OrientationAwareInlineVideo, {
590
671
  landscapeVideoFile: videoFile,
591
672
  portraitVideoFile: portraitVideoFile,
673
+ landscapeMotifArea: configuration.motifArea,
674
+ portraitMotifArea: configuration.portraitMotifArea,
592
675
  landscapePosterImageFile: posterImageFile,
593
676
  portraitPosterImageFile: portraitPosterImageFile,
594
677
  contentElementId: contentElementId,
678
+ sectionProps: sectionProps,
595
679
  configuration: configuration
596
680
  });
597
681
  } else {
598
682
  return /*#__PURE__*/React.createElement(OrientationUnawareInlineVideo, {
599
683
  videoFile: videoFile,
684
+ motifArea: configuration.motifArea,
600
685
  posterImageFile: posterImageFile,
601
686
  contentElementId: contentElementId,
687
+ sectionProps: sectionProps,
602
688
  configuration: configuration
603
689
  });
604
690
  }
605
691
  }
606
-
607
692
  function OrientationAwareInlineVideo(_ref2) {
608
693
  var landscapeVideoFile = _ref2.landscapeVideoFile,
609
- portraitVideoFile = _ref2.portraitVideoFile,
610
- landscapePosterImageFile = _ref2.landscapePosterImageFile,
611
- portraitPosterImageFile = _ref2.portraitPosterImageFile,
612
- contentElementId = _ref2.contentElementId,
613
- configuration = _ref2.configuration;
694
+ portraitVideoFile = _ref2.portraitVideoFile,
695
+ landscapePosterImageFile = _ref2.landscapePosterImageFile,
696
+ portraitPosterImageFile = _ref2.portraitPosterImageFile,
697
+ landscapeMotifArea = _ref2.landscapeMotifArea,
698
+ portraitMotifArea = _ref2.portraitMotifArea,
699
+ contentElementId = _ref2.contentElementId,
700
+ configuration = _ref2.configuration,
701
+ sectionProps = _ref2.sectionProps;
614
702
  var portraitOrientation = usePortraitOrientation();
615
703
  var videoFile = portraitOrientation && portraitVideoFile ? portraitVideoFile : landscapeVideoFile;
704
+ var motifArea = portraitOrientation && portraitVideoFile ? portraitMotifArea : landscapeMotifArea;
616
705
  var posterImageFile = portraitOrientation && portraitPosterImageFile ? portraitPosterImageFile : landscapePosterImageFile;
617
706
  return /*#__PURE__*/React.createElement(OrientationUnawareInlineVideo, {
618
707
  key: portraitOrientation,
619
708
  videoFile: videoFile,
709
+ motifArea: motifArea,
620
710
  posterImageFile: posterImageFile,
621
711
  contentElementId: contentElementId,
712
+ sectionProps: sectionProps,
622
713
  configuration: configuration
623
714
  });
624
715
  }
625
-
626
716
  function OrientationUnawareInlineVideo(_ref3) {
627
717
  var videoFile = _ref3.videoFile,
628
- posterImageFile = _ref3.posterImageFile,
629
- contentElementId = _ref3.contentElementId,
630
- configuration = _ref3.configuration;
631
-
718
+ posterImageFile = _ref3.posterImageFile,
719
+ contentElementId = _ref3.contentElementId,
720
+ configuration = _ref3.configuration,
721
+ sectionProps = _ref3.sectionProps,
722
+ motifArea = _ref3.motifArea;
632
723
  var _usePlayerState = usePlayerState(),
633
- _usePlayerState2 = _slicedToArray(_usePlayerState, 2),
634
- playerState = _usePlayerState2[0],
635
- playerActions = _usePlayerState2[1];
636
-
724
+ _usePlayerState2 = _slicedToArray(_usePlayerState, 2),
725
+ playerState = _usePlayerState2[0],
726
+ playerActions = _usePlayerState2[1];
637
727
  var inlineFileRightsItems = [{
638
728
  label: 'video',
639
729
  file: videoFile
@@ -641,12 +731,14 @@ function OrientationUnawareInlineVideo(_ref3) {
641
731
  label: 'poster',
642
732
  file: posterImageFile
643
733
  }];
734
+ var Player = (sectionProps === null || sectionProps === void 0 ? void 0 : sectionProps.containerDimension) && motifArea ? CropPositionComputingPlayer : PlayerWithControlBar;
644
735
  return /*#__PURE__*/React.createElement(MediaInteractionTracking, {
645
736
  playerState: playerState,
646
737
  playerActions: playerActions
647
738
  }, /*#__PURE__*/React.createElement(FitViewport, {
648
739
  file: videoFile,
649
740
  aspectRatio: videoFile ? undefined : fallbackAspectRatio,
741
+ fill: configuration.position === 'backdrop',
650
742
  opaque: !videoFile
651
743
  }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
652
744
  configuration: configuration
@@ -654,7 +746,9 @@ function OrientationUnawareInlineVideo(_ref3) {
654
746
  visible: media.muted && playerState.shouldPlay && !configuration.keepMuted
655
747
  }), /*#__PURE__*/React.createElement(Player, {
656
748
  key: configuration.playbackMode === 'loop',
749
+ sectionProps: sectionProps,
657
750
  videoFile: videoFile,
751
+ motifArea: motifArea,
658
752
  posterImageFile: posterImageFile,
659
753
  inlineFileRightsItems: inlineFileRightsItems,
660
754
  playerState: playerState,
@@ -662,28 +756,39 @@ function OrientationUnawareInlineVideo(_ref3) {
662
756
  contentElementId: contentElementId,
663
757
  configuration: configuration
664
758
  })))), /*#__PURE__*/React.createElement(InlineFileRights, {
759
+ configuration: configuration,
665
760
  context: "afterElement",
666
761
  items: inlineFileRightsItems
667
762
  })));
668
763
  }
669
-
670
- function Player(_ref4) {
764
+ function CropPositionComputingPlayer(_ref4) {
671
765
  var videoFile = _ref4.videoFile,
672
- posterImageFile = _ref4.posterImageFile,
673
- inlineFileRightsItems = _ref4.inlineFileRightsItems,
674
- playerState = _ref4.playerState,
675
- playerActions = _ref4.playerActions,
676
- contentElementId = _ref4.contentElementId,
677
- configuration = _ref4.configuration;
678
-
766
+ motifArea = _ref4.motifArea,
767
+ props = _objectWithoutProperties(_ref4, _excluded);
768
+ var videoFileWithMotifArea = useBackgroundFile({
769
+ file: videoFile,
770
+ motifArea: motifArea,
771
+ containerDimension: props.sectionProps.containerDimension
772
+ });
773
+ return /*#__PURE__*/React.createElement(PlayerWithControlBar, Object.assign({}, props, {
774
+ videoFile: videoFileWithMotifArea
775
+ }));
776
+ }
777
+ function PlayerWithControlBar(_ref5) {
778
+ var videoFile = _ref5.videoFile,
779
+ posterImageFile = _ref5.posterImageFile,
780
+ inlineFileRightsItems = _ref5.inlineFileRightsItems,
781
+ playerState = _ref5.playerState,
782
+ playerActions = _ref5.playerActions,
783
+ contentElementId = _ref5.contentElementId,
784
+ configuration = _ref5.configuration,
785
+ sectionProps = _ref5.sectionProps;
679
786
  var _useContentElementEdi = useContentElementEditorState(),
680
- isEditable = _useContentElementEdi.isEditable,
681
- isSelected = _useContentElementEdi.isSelected;
682
-
787
+ isEditable = _useContentElementEdi.isEditable,
788
+ isSelected = _useContentElementEdi.isSelected;
683
789
  var _useContentElementLif = useContentElementLifecycle(getLifecycleHandlers(configuration, playerActions)),
684
- shouldLoad = _useContentElementLif.shouldLoad,
685
- shouldPrepare = _useContentElementLif.shouldPrepare;
686
-
790
+ shouldLoad = _useContentElementLif.shouldLoad,
791
+ shouldPrepare = _useContentElementLif.shouldPrepare;
687
792
  useAudioFocus({
688
793
  key: contentElementId,
689
794
  request: playerState.shouldPlay,
@@ -706,7 +811,6 @@ function Player(_ref4) {
706
811
  if (configuration.playbackMode !== 'loop') {
707
812
  return;
708
813
  }
709
-
710
814
  var documentState = documentHiddenState(function (visibilityState) {
711
815
  if (visibilityState === 'hidden') {
712
816
  playerActions.fadeOutAndPause(400);
@@ -720,6 +824,8 @@ function Player(_ref4) {
720
824
  }, [playerActions, configuration.playbackMode]);
721
825
  return /*#__PURE__*/React.createElement(VideoPlayerControls, {
722
826
  videoFile: videoFile,
827
+ fadedOut: sectionProps.isIntersecting,
828
+ sticky: configuration.position === 'backdrop',
723
829
  defaultTextTrackFilePermaId: configuration.defaultTextTrackFileId,
724
830
  playerState: playerState,
725
831
  playerActions: playerActions,
@@ -734,6 +840,7 @@ function Player(_ref4) {
734
840
  }, /*#__PURE__*/React.createElement(VideoPlayer, {
735
841
  load: shouldPrepare ? 'auto' : shouldLoad ? 'poster' : 'none',
736
842
  loop: configuration.playbackMode === 'loop',
843
+ fit: configuration.position === 'backdrop' ? 'cover' : 'contain',
737
844
  playerState: playerState,
738
845
  playerActions: playerActions,
739
846
  videoFile: videoFile,
@@ -744,7 +851,6 @@ function Player(_ref4) {
744
851
  atmoDuringPlayback: configuration.atmoDuringPlayback
745
852
  })));
746
853
  }
747
-
748
854
  var fallbackAspectRatio = 0.5625;
749
855
 
750
856
  frontend.contentElementTypes.register('inlineVideo', {
@@ -754,7 +860,7 @@ frontend.contentElementTypes.register('inlineVideo', {
754
860
 
755
861
  function InlineAudio(_ref) {
756
862
  var contentElementId = _ref.contentElementId,
757
- configuration = _ref.configuration;
863
+ configuration = _ref.configuration;
758
864
  var audioFile = useFileWithInlineRights({
759
865
  configuration: configuration,
760
866
  collectionName: 'audioFiles',
@@ -765,29 +871,25 @@ function InlineAudio(_ref) {
765
871
  collectionName: 'imageFiles',
766
872
  propertyName: 'posterId'
767
873
  });
768
-
769
874
  var _usePlayerState = usePlayerState(),
770
- _usePlayerState2 = _slicedToArray(_usePlayerState, 2),
771
- playerState = _usePlayerState2[0],
772
- playerActions = _usePlayerState2[1];
773
-
875
+ _usePlayerState2 = _slicedToArray(_usePlayerState, 2),
876
+ playerState = _usePlayerState2[0],
877
+ playerActions = _usePlayerState2[1];
774
878
  var _useContentElementEdi = useContentElementEditorState(),
775
- isEditable = _useContentElementEdi.isEditable,
776
- isSelected = _useContentElementEdi.isSelected;
777
-
879
+ isEditable = _useContentElementEdi.isEditable,
880
+ isSelected = _useContentElementEdi.isSelected;
778
881
  var _useContentElementLif = useContentElementLifecycle({
779
- onActivate: function onActivate() {
780
- if (configuration.autoplay && !media.muted) {
781
- playerActions.play();
882
+ onActivate: function onActivate() {
883
+ if (configuration.autoplay && !media.muted) {
884
+ playerActions.play();
885
+ }
886
+ },
887
+ onDeactivate: function onDeactivate() {
888
+ playerActions.fadeOutAndPause(400);
782
889
  }
783
- },
784
- onDeactivate: function onDeactivate() {
785
- playerActions.fadeOutAndPause(400);
786
- }
787
- }),
788
- shouldLoad = _useContentElementLif.shouldLoad,
789
- shouldPrepare = _useContentElementLif.shouldPrepare;
790
-
890
+ }),
891
+ shouldLoad = _useContentElementLif.shouldLoad,
892
+ shouldPrepare = _useContentElementLif.shouldPrepare;
791
893
  useAudioFocus({
792
894
  key: contentElementId,
793
895
  request: playerState.shouldPlay,
@@ -795,19 +897,16 @@ function InlineAudio(_ref) {
795
897
  playerActions.fadeOutAndPause(400);
796
898
  }
797
899
  });
798
-
799
900
  var onPlayerClick = function onPlayerClick() {
800
901
  if (isEditable && !isSelected) {
801
902
  return;
802
903
  }
803
-
804
904
  if (playerState.shouldPlay) {
805
905
  playerActions.pause();
806
906
  } else {
807
907
  playerActions.playBlessed();
808
908
  }
809
909
  };
810
-
811
910
  var inlineFileRightsItems = [{
812
911
  label: 'audio',
813
912
  file: audioFile
@@ -843,6 +942,7 @@ function InlineAudio(_ref) {
843
942
  playsInline: true,
844
943
  atmoDuringPlayback: configuration.atmoDuringPlayback
845
944
  })))))), /*#__PURE__*/React.createElement(InlineFileRights, {
945
+ configuration: configuration,
846
946
  context: "afterElement",
847
947
  items: inlineFileRightsItems
848
948
  }));
@@ -855,62 +955,25 @@ frontend.contentElementTypes.register('inlineAudio', {
855
955
 
856
956
  var styles$3 = {"soundDisclaimer":"SoundDisclaimer-module_soundDisclaimer__31hWh","unmute":"SoundDisclaimer-module_unmute__1V4Ab","unmuted":"SoundDisclaimer-module_unmuted__22CJ5","active":"SoundDisclaimer-module_active__11_kc"};
857
957
 
858
- function _objectWithoutPropertiesLoose(source, excluded) {
859
- if (source == null) return {};
860
- var target = {};
861
- var sourceKeys = Object.keys(source);
862
- var key, i;
863
-
864
- for (i = 0; i < sourceKeys.length; i++) {
865
- key = sourceKeys[i];
866
- if (excluded.indexOf(key) >= 0) continue;
867
- target[key] = source[key];
868
- }
869
-
870
- return target;
871
- }
872
-
873
- function _objectWithoutProperties(source, excluded) {
874
- if (source == null) return {};
875
- var target = _objectWithoutPropertiesLoose(source, excluded);
876
- var key, i;
877
-
878
- if (Object.getOwnPropertySymbols) {
879
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
880
-
881
- for (i = 0; i < sourceSymbolKeys.length; i++) {
882
- key = sourceSymbolKeys[i];
883
- if (excluded.indexOf(key) >= 0) continue;
884
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
885
- target[key] = source[key];
886
- }
887
- }
888
-
889
- return target;
890
- }
891
-
958
+ var _excluded$1 = ["styles"];
892
959
  function _extends() {
893
- _extends = Object.assign || function (target) {
960
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
894
961
  for (var i = 1; i < arguments.length; i++) {
895
962
  var source = arguments[i];
896
-
897
963
  for (var key in source) {
898
964
  if (Object.prototype.hasOwnProperty.call(source, key)) {
899
965
  target[key] = source[key];
900
966
  }
901
967
  }
902
968
  }
903
-
904
969
  return target;
905
970
  };
906
-
907
971
  return _extends.apply(this, arguments);
908
972
  }
909
973
  var MutedIcon = (function (_ref) {
910
974
  var _ref$styles = _ref.styles,
911
- styles = _ref$styles === void 0 ? {} : _ref$styles,
912
- props = _objectWithoutProperties(_ref, ["styles"]);
913
-
975
+ styles = _ref$styles === void 0 ? {} : _ref$styles,
976
+ props = _objectWithoutProperties(_ref, _excluded$1);
914
977
  return /*#__PURE__*/React.createElement("svg", _extends({
915
978
  "aria-hidden": "true",
916
979
  "data-prefix": "fas",
@@ -923,28 +986,25 @@ var MutedIcon = (function (_ref) {
923
986
  }));
924
987
  });
925
988
 
989
+ var _excluded$2 = ["styles"];
926
990
  function _extends$1() {
927
- _extends$1 = Object.assign || function (target) {
991
+ _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
928
992
  for (var i = 1; i < arguments.length; i++) {
929
993
  var source = arguments[i];
930
-
931
994
  for (var key in source) {
932
995
  if (Object.prototype.hasOwnProperty.call(source, key)) {
933
996
  target[key] = source[key];
934
997
  }
935
998
  }
936
999
  }
937
-
938
1000
  return target;
939
1001
  };
940
-
941
1002
  return _extends$1.apply(this, arguments);
942
1003
  }
943
1004
  var UnmutedIcon = (function (_ref) {
944
1005
  var _ref$styles = _ref.styles,
945
- styles = _ref$styles === void 0 ? {} : _ref$styles,
946
- props = _objectWithoutProperties(_ref, ["styles"]);
947
-
1006
+ styles = _ref$styles === void 0 ? {} : _ref$styles,
1007
+ props = _objectWithoutProperties(_ref, _excluded$2);
948
1008
  return /*#__PURE__*/React.createElement("svg", _extends$1({
949
1009
  "aria-hidden": "true",
950
1010
  "data-prefix": "fas",
@@ -957,14 +1017,13 @@ var UnmutedIcon = (function (_ref) {
957
1017
  }));
958
1018
  });
959
1019
 
960
- function SoundDisclaimer() {
1020
+ function SoundDisclaimer(_ref) {
1021
+ var configuration = _ref.configuration;
961
1022
  var _useContentElementEdi = useContentElementEditorState(),
962
- isEditable = _useContentElementEdi.isEditable,
963
- isSelected = _useContentElementEdi.isSelected;
964
-
1023
+ isEditable = _useContentElementEdi.isEditable,
1024
+ isSelected = _useContentElementEdi.isSelected;
965
1025
  var _useI18n = useI18n(),
966
- t = _useI18n.t;
967
-
1026
+ t = _useI18n.t;
968
1027
  var muted = useMediaMuted();
969
1028
  return /*#__PURE__*/React.createElement("div", {
970
1029
  className: classNames(styles$3.soundDisclaimer),
@@ -976,33 +1035,23 @@ function SoundDisclaimer() {
976
1035
  onClick: function onClick() {
977
1036
  return media.mute(false);
978
1037
  }
979
- }, /*#__PURE__*/React.createElement(MutedIcon, null), /*#__PURE__*/React.createElement("p", {
980
- dangerouslySetInnerHTML: {
981
- __html: t('pageflow_scrolled.public.sound_disclaimer.help_muted')
982
- }
983
- })), /*#__PURE__*/React.createElement("div", {
1038
+ }, /*#__PURE__*/React.createElement(MutedIcon, null), /*#__PURE__*/React.createElement("p", null, configuration.mutedText || t('pageflow_scrolled.public.sound_disclaimer.help_muted'))), /*#__PURE__*/React.createElement("div", {
984
1039
  className: classNames(styles$3.unmuted, _defineProperty({}, styles$3.active, !muted))
985
- }, /*#__PURE__*/React.createElement(UnmutedIcon, null), /*#__PURE__*/React.createElement("p", {
986
- dangerouslySetInnerHTML: {
987
- __html: t('pageflow_scrolled.public.sound_disclaimer.help_unmuted')
988
- }
989
- })));
1040
+ }, /*#__PURE__*/React.createElement(UnmutedIcon, null), /*#__PURE__*/React.createElement("p", null, configuration.unmutedText || t('pageflow_scrolled.public.sound_disclaimer.help_unmuted'))));
990
1041
  }
991
1042
 
992
1043
  frontend.contentElementTypes.register('soundDisclaimer', {
993
1044
  component: SoundDisclaimer
994
1045
  });
995
1046
 
996
- var styles$4 = {"contentLinkColor":"var(--content-link-color)","breakpoint-sm":"(min-width: 640px)","text":"TextBlock-module_text__21Hk4","quoteDesign-hanging":"TextBlock-module_quoteDesign-hanging__1c9AW","quoteDesign-largeHanging":"TextBlock-module_quoteDesign-largeHanging__2VkIW","layout-centerRagged":"TextBlock-module_layout-centerRagged__1tjoI"};
1047
+ var styles$4 = {"breakpoint-sm":"(min-width: 640px)","text":"TextBlock-module_text__21Hk4","quoteDesign-hanging":"TextBlock-module_quoteDesign-hanging__1c9AW","quoteDesign-largeHanging":"TextBlock-module_quoteDesign-largeHanging__2VkIW","layout-centerRagged":"TextBlock-module_layout-centerRagged__1tjoI"};
997
1048
 
998
1049
  function TextBlock(props) {
999
1050
  var updateConfiguration = useContentElementConfigurationUpdate();
1000
-
1001
1051
  var _useI18n = useI18n({
1002
- locale: 'ui'
1003
- }),
1004
- t = _useI18n.t;
1005
-
1052
+ locale: 'ui'
1053
+ }),
1054
+ t = _useI18n.t;
1006
1055
  var theme = useTheme();
1007
1056
  var className = classNames(styles$4.text, styles$4["quoteDesign-".concat(theme.options.quoteDesign || 'largeHanging')], styles$4["layout-".concat(props.sectionProps.layout)]);
1008
1057
  return /*#__PURE__*/React.createElement(EditableText, {
@@ -1036,7 +1085,6 @@ function getProviderName(url) {
1036
1085
  } else if (facebookMatcher.test(url)) {
1037
1086
  return 'facebook';
1038
1087
  }
1039
-
1040
1088
  return null;
1041
1089
  }
1042
1090
 
@@ -1050,20 +1098,16 @@ var aspectRatios = {
1050
1098
  };
1051
1099
  function VideoEmbed(_ref) {
1052
1100
  var contentElementId = _ref.contentElementId,
1053
- configuration = _ref.configuration;
1054
-
1101
+ configuration = _ref.configuration;
1055
1102
  var _useContentElementEdi = useContentElementEditorState(),
1056
- isEditable = _useContentElementEdi.isEditable,
1057
- isSelected = _useContentElementEdi.isSelected;
1058
-
1103
+ isEditable = _useContentElementEdi.isEditable,
1104
+ isSelected = _useContentElementEdi.isSelected;
1059
1105
  var _useContentElementLif = useContentElementLifecycle(),
1060
- shouldLoad = _useContentElementLif.shouldLoad;
1061
-
1106
+ shouldLoad = _useContentElementLif.shouldLoad;
1062
1107
  var _useState = useState('unplayed'),
1063
- _useState2 = _slicedToArray(_useState, 2),
1064
- playerState = _useState2[0],
1065
- setPlayerState = _useState2[1];
1066
-
1108
+ _useState2 = _slicedToArray(_useState, 2),
1109
+ playerState = _useState2[0],
1110
+ setPlayerState = _useState2[1];
1067
1111
  var providerName = getProviderName(configuration.videoSource);
1068
1112
  return /*#__PURE__*/React.createElement("div", {
1069
1113
  style: {
@@ -1084,13 +1128,12 @@ function VideoEmbed(_ref) {
1084
1128
  hide: playerState === 'playing'
1085
1129
  })))));
1086
1130
  }
1087
-
1088
1131
  function PreparedPlayer(_ref2) {
1089
1132
  var contentElementId = _ref2.contentElementId,
1090
- configuration = _ref2.configuration,
1091
- playerState = _ref2.playerState,
1092
- setPlayerState = _ref2.setPlayerState,
1093
- providerName = _ref2.providerName;
1133
+ configuration = _ref2.configuration,
1134
+ playerState = _ref2.playerState,
1135
+ setPlayerState = _ref2.setPlayerState,
1136
+ providerName = _ref2.providerName;
1094
1137
  useAudioFocus({
1095
1138
  key: contentElementId,
1096
1139
  request: playerState === 'playing',
@@ -1107,26 +1150,23 @@ function PreparedPlayer(_ref2) {
1107
1150
  collectionName: 'imageFiles',
1108
1151
  permaId: configuration.posterId
1109
1152
  });
1110
- var posterUrl = (posterImageFile === null || posterImageFile === void 0 ? void 0 : posterImageFile.isReady) && posterImageFile.urls.large; // React player does not re-create player when controls or config
1153
+ var posterUrl = (posterImageFile === null || posterImageFile === void 0 ? void 0 : posterImageFile.isReady) && posterImageFile.urls.large;
1154
+
1155
+ // React player does not re-create player when controls or config
1111
1156
  // prop changes. Ensure key changes to force React to re-mount
1112
1157
  // component.
1113
-
1114
1158
  function keyFromConfiguration(config) {
1115
1159
  return [config.hideControls, config.hideInfo].join('');
1116
1160
  }
1117
-
1118
1161
  var atmoHooks = useAtmoHooks(configuration.atmoDuringPlayback);
1119
-
1120
1162
  function onPlay() {
1121
1163
  setPlayerState('playing');
1122
1164
  atmoHooks.before();
1123
1165
  }
1124
-
1125
1166
  function onPauseOrEnd() {
1126
1167
  setPlayerState('paused');
1127
1168
  atmoHooks.after();
1128
1169
  }
1129
-
1130
1170
  return /*#__PURE__*/React.createElement(ThirdPartyOptIn, {
1131
1171
  providerName: providerName
1132
1172
  }, function (_ref3) {
@@ -1164,17 +1204,15 @@ function PreparedPlayer(_ref2) {
1164
1204
  });
1165
1205
  });
1166
1206
  }
1167
-
1168
1207
  function useAtmoHooks(atmoDuringPlayback) {
1169
1208
  var atmo = useAtmo();
1170
1209
  return useMemo(function () {
1171
1210
  var _ref4 = atmo.createMediaPlayerHooks(atmoDuringPlayback) || {
1172
- before: function before() {},
1173
- after: function after() {}
1174
- },
1175
- _before = _ref4.before,
1176
- _after = _ref4.after;
1177
-
1211
+ before: function before() {},
1212
+ after: function after() {}
1213
+ },
1214
+ _before = _ref4.before,
1215
+ _after = _ref4.after;
1178
1216
  var timeout;
1179
1217
  return {
1180
1218
  before: function before() {
@@ -1190,7 +1228,6 @@ function useAtmoHooks(atmoDuringPlayback) {
1190
1228
  // fired. Prevent briefly fading the atmo back in.
1191
1229
  timeout = setTimeout(function () {
1192
1230
  _after();
1193
-
1194
1231
  timeout = null;
1195
1232
  }, 1000);
1196
1233
  }
@@ -1203,9 +1240,8 @@ frontend.contentElementTypes.register('videoEmbed', {
1203
1240
  lifecycle: true,
1204
1241
  consentVendors: function consentVendors(_ref) {
1205
1242
  var configuration = _ref.configuration,
1206
- t = _ref.t;
1243
+ t = _ref.t;
1207
1244
  var provider = getProviderName(configuration.videoSource);
1208
-
1209
1245
  if (provider) {
1210
1246
  var prefix = 'pageflow_scrolled.public.video_embed.consent';
1211
1247
  return [{
@@ -1215,136 +1251,421 @@ frontend.contentElementTypes.register('videoEmbed', {
1215
1251
  paradigm: 'lazy opt-in'
1216
1252
  }];
1217
1253
  }
1218
-
1219
1254
  return [];
1220
1255
  }
1221
1256
  });
1222
1257
 
1223
- var styles$6 = {"darkContentSurfaceColor":"var(--theme-dark-content-surface-color, #101010)","lightContentSurfaceColor":"var(--theme-light-content-surface-color, #fff)","darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","breakpoint-sm":"(min-width: 640px)","hidden":"ExternalLink-module_hidden__3jer0","link_item":"ExternalLink-module_link_item__Blypv","layout_center":"ExternalLink-module_layout_center__3NRpQ","link_title":"ExternalLink-module_link_title__FZJ-0","link_thumbnail":"ExternalLink-module_link_thumbnail__2_BHq","link_details":"ExternalLink-module_link_details__lRhKU","invert":"ExternalLink-module_invert__1zrgN","tooltip":"ExternalLink-module_tooltip__18MpC"};
1224
-
1225
- function ExternalLink(props) {
1226
- var _classNames2;
1227
-
1228
- var _useState = useState(true),
1229
- _useState2 = _slicedToArray(_useState, 2),
1230
- hideTooltip = _useState2[0],
1231
- setHideTooltip = _useState2[1];
1258
+ var styles$6 = {"darkContentSurfaceColor":"var(--theme-dark-content-surface-color, #101010)","lightContentSurfaceColor":"var(--theme-light-content-surface-color, #fff)","darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","breakpoint-sm":"(min-width: 640px)","item":"ExternalLink-module_item__pIdgb","outlined":"ExternalLink-module_outlined__2fwWe","highlighted":"ExternalLink-module_highlighted__3AbWZ","selected":"ExternalLink-module_selected__1GFC_","textPosition-below":"ExternalLink-module_textPosition-below__nxm4V","cardWrapper":"ExternalLink-module_cardWrapper__4IWTr","textPosition-right":"ExternalLink-module_textPosition-right__3IHdZ","card":"ExternalLink-module_card__ww6Pq","textPosition-overlay":"ExternalLink-module_textPosition-overlay__1Y3PX","textPosition-none":"ExternalLink-module_textPosition-none__3pjcu ExternalLink-module_textPosition-below__nxm4V","textPosition-title":"ExternalLink-module_textPosition-title__2pZoW ExternalLink-module_textPosition-none__3pjcu ExternalLink-module_textPosition-below__nxm4V","link":"ExternalLink-module_link__dvyzo","title":"ExternalLink-module_title__3sVh4","thumbnail":"ExternalLink-module_thumbnail__24QzG","thumbnailSize-medium":"ExternalLink-module_thumbnailSize-medium__R0eu7","thumbnailSize-large":"ExternalLink-module_thumbnailSize-large__2siDe","light":"ExternalLink-module_light__3vIh1 scope-darkContent","dark":"ExternalLink-module_dark__1bh5x scope-lightContent","background":"ExternalLink-module_background__3GS-M","details":"ExternalLink-module_details__ewX5o","button":"ExternalLink-module_button__2lYHG","align-center":"ExternalLink-module_align-center__2c7VT","align-right":"ExternalLink-module_align-right__2qpdE","inlineFileRightsAfterCard":"ExternalLink-module_inlineFileRightsAfterCard__2TLR0"};
1232
1259
 
1233
- var layout = props.sectionProps.layout;
1234
-
1235
- var _useI18n = useI18n({
1236
- locale: 'ui'
1237
- }),
1238
- t = _useI18n.t;
1239
-
1240
- var _useContentElementEdi = useContentElementEditorState(),
1241
- isEditable = _useContentElementEdi.isEditable,
1242
- isSelected = _useContentElementEdi.isSelected;
1260
+ var styles$7 = {"thumbnail":"Thumbnail-module_thumbnail__3t8ND","cover":"Thumbnail-module_cover__3OoBo"};
1243
1261
 
1244
- var thumbnailImageFile = useFile({
1245
- collectionName: 'imageFiles',
1246
- permaId: props.thumbnail
1262
+ function Thumbnail(_ref) {
1263
+ var imageFile = _ref.imageFile,
1264
+ aspectRatio = _ref.aspectRatio,
1265
+ cropPosition = _ref.cropPosition,
1266
+ fit = _ref.fit,
1267
+ load = _ref.load,
1268
+ children = _ref.children;
1269
+ imageFile = _objectSpread2(_objectSpread2({}, imageFile), {}, {
1270
+ cropPosition: cropPosition
1247
1271
  });
1248
- var url = ensureAbsolute(props.url);
1249
-
1250
- var onClick = function onClick(event) {
1251
- if (isEditable) {
1252
- if (!props.open_in_new_tab || !isSelected) {
1253
- event.preventDefault();
1254
- }
1255
-
1256
- if (!props.open_in_new_tab && isSelected) {
1257
- setHideTooltip(false);
1258
- }
1259
- }
1260
- };
1261
-
1262
- var onMouseLeave = function onMouseLeave() {
1263
- setHideTooltip(true);
1264
- };
1265
-
1266
- function renderNewTabTooltip() {
1267
- if (isEditable) {
1268
- var onTooltipClick = function onTooltipClick() {
1269
- window.open(url, '_blank');
1270
- setHideTooltip(true);
1271
- };
1272
-
1273
- return /*#__PURE__*/React.createElement("div", {
1274
- className: classNames(_defineProperty({}, styles$6.hidden, hideTooltip), styles$6.tooltip),
1275
- onClick: onTooltipClick
1276
- }, t('pageflow_scrolled.inline_editing.external_links.open_in_new_tab_message'), /*#__PURE__*/React.createElement("span", null, t('pageflow_scrolled.inline_editing.external_links.open_in_new_tab')));
1272
+ var aspectRatioPadding = getAspectRatioPadding(aspectRatio, imageFile);
1273
+ return /*#__PURE__*/React.createElement("div", {
1274
+ className: classNames(styles$7.thumbnail, _defineProperty({}, styles$7.cover, fit === 'cover')),
1275
+ style: {
1276
+ paddingTop: aspectRatioPadding
1277
1277
  }
1278
+ }, /*#__PURE__*/React.createElement(Image, {
1279
+ imageFile: imageFile,
1280
+ load: load,
1281
+ preferSvg: true,
1282
+ variant: aspectRatio && aspectRatio !== 'wide' || cropPosition || fit === 'contain' ? 'medium' : 'linkThumbnailLarge',
1283
+ fit: fit
1284
+ }), children);
1285
+ }
1286
+ function getAspectRatioPadding(aspectRatio, imageFile) {
1287
+ if (aspectRatio === 'original' && imageFile) {
1288
+ return "".concat(imageFile.height / imageFile.width * 100, "%");
1278
1289
  }
1290
+ }
1279
1291
 
1280
- return /*#__PURE__*/React.createElement("a", {
1281
- className: classNames(styles$6.link_item, (_classNames2 = {}, _defineProperty(_classNames2, styles$6.invert, props.invert), _defineProperty(_classNames2, styles$6.layout_center, layout === 'center' || layout === 'centerRagged'), _classNames2)),
1282
- href: url || 'about:blank',
1283
- onClick: onClick,
1284
- onMouseLeave: onMouseLeave,
1285
- target: props.open_in_new_tab ? '_blank' : '_self',
1286
- rel: props.open_in_new_tab ? 'noopen noreferrer' : undefined
1287
- }, /*#__PURE__*/React.createElement("div", {
1288
- className: styles$6.link_thumbnail
1289
- }, /*#__PURE__*/React.createElement(Image, {
1290
- imageFile: thumbnailImageFile,
1291
- load: props.loadImages,
1292
- variant: "linkThumbnailLarge"
1293
- })), /*#__PURE__*/React.createElement("div", {
1294
- className: styles$6.link_details
1295
- }, /*#__PURE__*/React.createElement("p", {
1296
- className: styles$6.link_title
1297
- }, props.title), /*#__PURE__*/React.createElement("p", {
1298
- className: styles$6.link_desc
1299
- }, props.description)), renderNewTabTooltip());
1300
- }
1301
- ExternalLink.defaultProps = {
1302
- sectionProps: {}
1292
+ var _excluded$3 = ["id", "configuration"],
1293
+ _excluded2 = ["isEnabled", "isEditable"];
1294
+ var scaleCategorySuffixes = {
1295
+ small: 'sm',
1296
+ medium: 'md',
1297
+ large: 'lg'
1303
1298
  };
1304
-
1299
+ function ExternalLink(_ref) {
1300
+ var _itemLinks$id, _itemLinks$id2, _itemTexts$id5, _itemTexts$id6, _itemTexts$id7, _itemTexts$id8;
1301
+ var id = _ref.id,
1302
+ configuration = _ref.configuration,
1303
+ props = _objectWithoutProperties(_ref, _excluded$3);
1304
+ var _useContentElementEdi = useContentElementEditorState(),
1305
+ isEditable = _useContentElementEdi.isEditable,
1306
+ isSelected = _useContentElementEdi.isSelected;
1307
+ var updateConfiguration = useContentElementConfigurationUpdate();
1308
+ var _useI18n = useI18n({
1309
+ locale: 'ui'
1310
+ }),
1311
+ t = _useI18n.t;
1312
+ var itemTexts = configuration.itemTexts || {};
1313
+ var itemLinks = configuration.itemLinks || {};
1314
+ var thumbnailImageFile = useFileWithInlineRights({
1315
+ configuration: props,
1316
+ collectionName: 'imageFiles',
1317
+ propertyName: 'thumbnail'
1318
+ });
1319
+ function handleTextChange(propertyName, value) {
1320
+ updateConfiguration({
1321
+ itemTexts: _objectSpread2(_objectSpread2({}, itemTexts), {}, _defineProperty({}, id, _objectSpread2(_objectSpread2({}, itemTexts[id]), {}, _defineProperty({}, propertyName, value))))
1322
+ });
1323
+ }
1324
+ function handleLinkChange(value) {
1325
+ updateConfiguration({
1326
+ itemLinks: _objectSpread2(_objectSpread2({}, itemLinks), {}, _defineProperty({}, id, value))
1327
+ });
1328
+ }
1329
+ var legacyTexts = useMemo(function () {
1330
+ return {
1331
+ title: [{
1332
+ type: 'heading',
1333
+ children: [{
1334
+ text: props.title || ''
1335
+ }]
1336
+ }],
1337
+ description: [{
1338
+ type: 'paragraph',
1339
+ children: [{
1340
+ text: props.description || ''
1341
+ }]
1342
+ }]
1343
+ };
1344
+ }, [props.title, props.description]);
1345
+ function presentOrEditing(propertyName) {
1346
+ var _itemTexts$id, _itemTexts$id2, _itemTexts$id3, _itemTexts$id4;
1347
+ return !utils.isBlankEditableTextValue(((_itemTexts$id = itemTexts[id]) === null || _itemTexts$id === void 0 ? void 0 : _itemTexts$id[propertyName]) || legacyTexts[propertyName]) || isEditable && props.selected || isEditable && utils.isBlankEditableTextValue((_itemTexts$id2 = itemTexts[id]) === null || _itemTexts$id2 === void 0 ? void 0 : _itemTexts$id2.tagline) && utils.isBlankEditableTextValue(((_itemTexts$id3 = itemTexts[id]) === null || _itemTexts$id3 === void 0 ? void 0 : _itemTexts$id3.title) || legacyTexts.title) && utils.isBlankEditableTextValue(((_itemTexts$id4 = itemTexts[id]) === null || _itemTexts$id4 === void 0 ? void 0 : _itemTexts$id4.description) || legacyTexts.description);
1348
+ }
1349
+ var href = itemLinks[id] ? (_itemLinks$id = itemLinks[id]) === null || _itemLinks$id === void 0 ? void 0 : _itemLinks$id.href : ensureAbsolute(props.url);
1350
+ var openInNewTab = itemLinks[id] ? (_itemLinks$id2 = itemLinks[id]) === null || _itemLinks$id2 === void 0 ? void 0 : _itemLinks$id2.openInNewTab : props.open_in_new_tab;
1351
+ var scaleCategorySuffix = scaleCategorySuffixes[props.textSize || 'small'];
1352
+ var inlineFileRightsAfterCard = props.textPosition === 'right' || props.textPosition === 'overlay' || props.textPosition === 'none';
1353
+ var inlineFileRightsItems = [{
1354
+ file: thumbnailImageFile,
1355
+ label: 'image'
1356
+ }];
1357
+ return /*#__PURE__*/React.createElement("li", {
1358
+ className: classNames(styles$6.item, styles$6["textPosition-".concat(props.textPosition)], _defineProperty({}, styles$6.link, !!href && !configuration.displayButtons), _defineProperty({}, styles$6.outlined, props.outlined), _defineProperty({}, styles$6.highlighted, props.highlighted), _defineProperty({}, styles$6.selected, props.selected)),
1359
+ onClick: props.onClick
1360
+ }, /*#__PURE__*/React.createElement(Link, {
1361
+ isEnabled: !configuration.displayButtons,
1362
+ isEditable: isEditable,
1363
+ actionButtonVisible: props.selected,
1364
+ actionButtonPortal: true,
1365
+ href: href,
1366
+ openInNewTab: openInNewTab,
1367
+ onChange: handleLinkChange
1368
+ }, /*#__PURE__*/React.createElement("div", {
1369
+ className: styles$6.cardWrapper
1370
+ }, /*#__PURE__*/React.createElement("div", {
1371
+ className: classNames(styles$6.card, styles$6["thumbnailSize-".concat(props.thumbnailSize)])
1372
+ }, /*#__PURE__*/React.createElement("div", {
1373
+ className: styles$6.thumbnail,
1374
+ style: {
1375
+ backgroundColor: props.thumbnailBackgroundColor
1376
+ }
1377
+ }, /*#__PURE__*/React.createElement(Thumbnail, {
1378
+ imageFile: thumbnailImageFile,
1379
+ aspectRatio: props.thumbnailAspectRatio,
1380
+ cropPosition: props.thumbnailCropPosition,
1381
+ fit: props.thumbnailFit,
1382
+ load: props.loadImages
1383
+ }, /*#__PURE__*/React.createElement(InlineFileRights, {
1384
+ configuration: configuration,
1385
+ context: "insideElement",
1386
+ position: props.textPosition === 'overlay' ? 'top' : 'bottom',
1387
+ items: inlineFileRightsItems
1388
+ }))), /*#__PURE__*/React.createElement("div", {
1389
+ className: classNames(styles$6.background, styles$6["align-".concat(configuration.textAlign)], props.darkBackground ? styles$6.light : styles$6.dark),
1390
+ style: {
1391
+ pointerEvents: !isEditable || isSelected ? undefined : 'none'
1392
+ }
1393
+ }, !inlineFileRightsAfterCard && /*#__PURE__*/React.createElement(InlineFileRights, {
1394
+ configuration: configuration,
1395
+ context: "afterElement",
1396
+ items: inlineFileRightsItems
1397
+ }), /*#__PURE__*/React.createElement("div", {
1398
+ className: styles$6.details
1399
+ }, presentOrEditing('tagline') && /*#__PURE__*/React.createElement(Text, {
1400
+ scaleCategory: "teaserTagline-".concat(scaleCategorySuffix)
1401
+ }, /*#__PURE__*/React.createElement(EditableInlineText, {
1402
+ value: (_itemTexts$id5 = itemTexts[id]) === null || _itemTexts$id5 === void 0 ? void 0 : _itemTexts$id5.tagline,
1403
+ placeholder: t('pageflow_scrolled.inline_editing.type_tagline'),
1404
+ onChange: function onChange(value) {
1405
+ return handleTextChange('tagline', value);
1406
+ }
1407
+ })), /*#__PURE__*/React.createElement(Text, {
1408
+ scaleCategory: "teaserTitle-".concat(scaleCategorySuffix)
1409
+ }, /*#__PURE__*/React.createElement(EditableInlineText, {
1410
+ value: ((_itemTexts$id6 = itemTexts[id]) === null || _itemTexts$id6 === void 0 ? void 0 : _itemTexts$id6.title) || legacyTexts.title,
1411
+ placeholder: t('pageflow_scrolled.inline_editing.type_heading'),
1412
+ onChange: function onChange(value) {
1413
+ return handleTextChange('title', value);
1414
+ }
1415
+ })), presentOrEditing('description') && /*#__PURE__*/React.createElement(EditableText, {
1416
+ value: ((_itemTexts$id7 = itemTexts[id]) === null || _itemTexts$id7 === void 0 ? void 0 : _itemTexts$id7.description) || legacyTexts.description,
1417
+ scaleCategory: "teaserDescription-".concat(scaleCategorySuffix),
1418
+ placeholder: t('pageflow_scrolled.inline_editing.type_text'),
1419
+ onChange: function onChange(value) {
1420
+ return handleTextChange('description', value);
1421
+ }
1422
+ }), configuration.displayButtons && presentOrEditing('link') && /*#__PURE__*/React.createElement("div", {
1423
+ className: styles$6.button
1424
+ }, /*#__PURE__*/React.createElement(LinkButton, {
1425
+ href: href,
1426
+ openInNewTab: openInNewTab,
1427
+ value: (_itemTexts$id8 = itemTexts[id]) === null || _itemTexts$id8 === void 0 ? void 0 : _itemTexts$id8.link,
1428
+ linkPreviewDisabled: true,
1429
+ actionButtonVisible: false,
1430
+ onTextChange: function onTextChange(value) {
1431
+ return handleTextChange('link', value);
1432
+ },
1433
+ onLinkChange: function onLinkChange(value) {
1434
+ return handleLinkChange(value);
1435
+ }
1436
+ }))))), inlineFileRightsAfterCard && /*#__PURE__*/React.createElement("div", {
1437
+ className: styles$6.inlineFileRightsAfterCard
1438
+ }, /*#__PURE__*/React.createElement(InlineFileRights, {
1439
+ configuration: configuration,
1440
+ context: "afterElement",
1441
+ items: inlineFileRightsItems
1442
+ })))));
1443
+ }
1444
+ function Link(_ref2) {
1445
+ var isEnabled = _ref2.isEnabled,
1446
+ isEditable = _ref2.isEditable,
1447
+ props = _objectWithoutProperties(_ref2, _excluded2);
1448
+ if (isEnabled && props.href || isEditable) {
1449
+ return /*#__PURE__*/React.createElement(EditableLink, Object.assign({}, props, {
1450
+ actionButtonVisible: props.actionButtonVisible,
1451
+ allowRemove: true
1452
+ }));
1453
+ } else {
1454
+ return props.children;
1455
+ }
1456
+ }
1305
1457
  function ensureAbsolute(url) {
1306
- if (url.match(/^(https?:)?\/\//)) {
1458
+ if (!url || url.match(/^(https?:)?\/\//)) {
1307
1459
  return url;
1308
1460
  } else {
1309
1461
  return "http://".concat(url);
1310
1462
  }
1311
1463
  }
1312
1464
 
1313
- var styles$7 = {"contentColorScope":"colors-module_contentColorScope__3zLO1","ext_links_container":"ExternalLinkList-module_ext_links_container__16IIo scope-externalLinks colors-module_contentColorScope__3zLO1"};
1465
+ function Scroller(_ref) {
1466
+ var enabled = _ref.enabled,
1467
+ measureKey = _ref.measureKey,
1468
+ children = _ref.children;
1469
+ var ref = useRef();
1470
+ if (!enabled) {
1471
+ return children({});
1472
+ }
1473
+ return /*#__PURE__*/React.createElement(Measure, {
1474
+ scroll: true,
1475
+ client: true,
1476
+ innerRef: ref
1477
+ }, function (_ref2) {
1478
+ var contentRect = _ref2.contentRect,
1479
+ measureRef = _ref2.measureRef,
1480
+ measure = _ref2.measure;
1481
+ var canScrollLeft = contentRect.scroll.left > 0;
1482
+ var canScrollRight = contentRect.scroll.width > contentRect.client.width && contentRect.scroll.left < contentRect.scroll.width - contentRect.client.width - 5;
1483
+ function scrollBy(x) {
1484
+ var list = ref.current;
1485
+ var listRect = list.getBoundingClientRect();
1486
+ if (x > 0) {
1487
+ for (var i = 0; i < list.children.length; i++) {
1488
+ var child = list.children[i];
1489
+ var rect = child.getBoundingClientRect();
1490
+ if (Math.floor(rect.right - listRect.left) > contentRect.client.width) {
1491
+ ref.current.scrollTo(child.offsetLeft - list.firstChild.offsetLeft, 0);
1492
+ break;
1493
+ }
1494
+ }
1495
+ } else {
1496
+ var lastPartiallyVisibleChildRect;
1497
+ for (var _i = list.children.length - 1; _i >= 0; _i--) {
1498
+ var _child = list.children[_i];
1499
+ var _rect = _child.getBoundingClientRect();
1500
+ if (_rect.left < listRect.left) {
1501
+ lastPartiallyVisibleChildRect = _rect;
1502
+ break;
1503
+ }
1504
+ }
1505
+ if (!lastPartiallyVisibleChildRect) {
1506
+ return;
1507
+ }
1508
+ for (var _i2 = 0; _i2 < list.children.length - 1; _i2++) {
1509
+ var _child2 = list.children[_i2];
1510
+ var _rect2 = _child2.getBoundingClientRect();
1511
+ if (Math.floor(lastPartiallyVisibleChildRect.right - _rect2.left) <= contentRect.client.width) {
1512
+ ref.current.scrollTo(_child2.offsetLeft - list.firstChild.offsetLeft, 0);
1513
+ break;
1514
+ }
1515
+ }
1516
+ }
1517
+ }
1518
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Watch, {
1519
+ value: measureKey,
1520
+ onChange: measure
1521
+ }), /*#__PURE__*/React.createElement(ScrollButton$1, {
1522
+ direction: "left",
1523
+ disabled: !canScrollLeft,
1524
+ onClick: function onClick() {
1525
+ return scrollBy(-1);
1526
+ }
1527
+ }), /*#__PURE__*/React.createElement(ScrollButton$1, {
1528
+ direction: "right",
1529
+ disabled: !canScrollRight,
1530
+ onClick: function onClick() {
1531
+ return scrollBy(1);
1532
+ }
1533
+ }), children({
1534
+ scrollerRef: measureRef,
1535
+ handleScroll: function handleScroll() {
1536
+ return measure();
1537
+ }
1538
+ }));
1539
+ });
1540
+ }
1541
+ function Watch(_ref3) {
1542
+ var value = _ref3.value,
1543
+ onChange = _ref3.onChange;
1544
+ useEffect(function () {
1545
+ return onChange();
1546
+ }, [value, onChange]);
1547
+ return null;
1548
+ }
1549
+
1550
+ var styles$8 = {"contentColorScope":"colors-module_contentColorScope__3zLO1","contentMargin":"ExternalLinkList-module_contentMargin__2NpqM","scrollButtons-below":"ExternalLinkList-module_scrollButtons-below__2yP5A","container":"ExternalLinkList-module_container__3fVf0","fullContainer":"ExternalLinkList-module_fullContainer__3M7uT","list":"ExternalLinkList-module_list__2w4qM scope-externalLinks colors-module_contentColorScope__3zLO1","full":"ExternalLinkList-module_full__2l4qw","textPosition-below":"ExternalLinkList-module_textPosition-below__2zC66","textPosition-overlay":"ExternalLinkList-module_textPosition-overlay__3h5MM","scroller":"ExternalLinkList-module_scroller__30plD","layout-center":"ExternalLinkList-module_layout-center__3qU6q"};
1551
+
1552
+ var textPositionBelowStyles = {"list":"below-module_list__19HmU","scroller":"below-module_scroller__1NsM2","linkAlignment-left":"below-module_linkAlignment-left__3jA80","linkAlignment-right":"below-module_linkAlignment-right__1Z8_U","linkAlignment-center":"below-module_linkAlignment-center__2YvPE","linkWidth-full-xs":"below-module_linkWidth-full-xs__3uist","linkWidth-full-s":"below-module_linkWidth-full-s__1_4ij","linkWidth-full-m":"below-module_linkWidth-full-m__1Oy7S","linkWidth-full-l":"below-module_linkWidth-full-l__3HSsg","linkWidth-full-xl":"below-module_linkWidth-full-xl__2ZPa4","linkWidth-full-xxl":"below-module_linkWidth-full-xxl__Ttr0e","width-lg":"below-module_width-lg__2z5Fx","layout-center":"below-module_layout-center__2Q6iw","linkWidth-l":"below-module_linkWidth-l__1YJZr","width-xl":"below-module_width-xl__Bgvca","linkWidth-xl":"below-module_linkWidth-xl__1sGf5","linkWidth-s":"below-module_linkWidth-s__24kC5","linkWidth-xs":"below-module_linkWidth-xs__2sJdn","linkWidth-m":"below-module_linkWidth-m__3Nxbl"};
1314
1553
 
1554
+ var textPositionRightStyles = {"list":"right-module_list__3z04e","scroller":"right-module_scroller__2FyXd","width-full":"right-module_width-full__22RJL","layout-center":"right-module_layout-center__3I_Ow","layout-right":"right-module_layout-right__1rFiS","linkWidth-full-xs":"right-module_linkWidth-full-xs__1d1Iy","linkWidth-full-s":"right-module_linkWidth-full-s__2-rCJ","linkWidth-full-m":"right-module_linkWidth-full-m__2VY87","linkWidth-full-l":"right-module_linkWidth-full-l__1Bql_","linkWidth-full-xl":"right-module_linkWidth-full-xl__iEoAg","linkWidth-full-xxl":"right-module_linkWidth-full-xxl__1a3HZ","linkWidth-xs":"right-module_linkWidth-xs__3kCk5","linkWidth-s":"right-module_linkWidth-s__1YNwt","linkWidth-l":"right-module_linkWidth-l__1OLzb","width-xl":"right-module_width-xl__2xDcy","layout-left":"right-module_layout-left__1P-tW","linkWidth-m":"right-module_linkWidth-m__18F2B"};
1555
+
1556
+ var linkWidths = function linkWidths(value) {
1557
+ return ['xs', 's', 'm', 'l', 'xl', 'xxl'][value + 2];
1558
+ };
1315
1559
  function ExternalLinkList(props) {
1316
1560
  var linkList = props.configuration.links || [];
1317
-
1318
1561
  var _useContentElementLif = useContentElementLifecycle(),
1319
- shouldLoad = _useContentElementLif.shouldLoad;
1320
-
1562
+ shouldLoad = _useContentElementLif.shouldLoad;
1321
1563
  var darkBackground = useDarkBackground();
1564
+ var theme = useTheme();
1565
+ var _useContentElementEdi = useContentElementEditorState(),
1566
+ setTransientState = _useContentElementEdi.setTransientState,
1567
+ isSelected = _useContentElementEdi.isSelected;
1568
+ var _useState = useState(),
1569
+ _useState2 = _slicedToArray(_useState, 2),
1570
+ selectedItemId = _useState2[0],
1571
+ setSelectedItemId = _useState2[1];
1572
+ var _useState3 = useState(-1),
1573
+ _useState4 = _slicedToArray(_useState3, 2),
1574
+ highlightedIndex = _useState4[0],
1575
+ setHighlightedIndex = _useState4[1];
1576
+ useContentElementEditorCommandSubscription(function (command) {
1577
+ if (command.type === 'HIGHLIGHT_ITEM') {
1578
+ setHighlightedIndex(command.index);
1579
+ } else if (command.type === 'RESET_ITEM_HIGHLIGHT') {
1580
+ setHighlightedIndex(-1);
1581
+ } else if (command.type === 'SET_SELECTED_ITEM') {
1582
+ var _linkList$command$ind;
1583
+ setSelectedItemId((_linkList$command$ind = linkList[command.index]) === null || _linkList$command$ind === void 0 ? void 0 : _linkList$command$ind.id);
1584
+ }
1585
+ });
1586
+ function handleItemClick(event, id) {
1587
+ if (isSelected) {
1588
+ setTransientState({
1589
+ selectedItemId: id
1590
+ });
1591
+ setSelectedItemId(id);
1592
+ event.preventDefault();
1593
+ }
1594
+ }
1595
+ function handleListClick(event) {
1596
+ if (!event.defaultPrevented) {
1597
+ setTransientState({
1598
+ selectedItemId: null
1599
+ });
1600
+ setSelectedItemId(null);
1601
+ }
1602
+ }
1603
+ var layout = props.sectionProps.layout === 'centerRagged' ? 'center' : props.sectionProps.layout;
1604
+ var linkWidth = linkWidths('linkWidth' in props.configuration ? props.configuration.linkWidth : -1);
1605
+ var textPosition = props.configuration.textPosition || 'below';
1606
+ var textPositionStyles = textPosition === 'right' ? textPositionRightStyles : textPositionBelowStyles;
1607
+ var scrollerEnabled = props.configuration.enableScroller === 'always';
1608
+ var fullWidth = props.contentElementWidth === contentElementWidths.full;
1609
+ var linkAlignment = scrollerEnabled ? 'left' : props.configuration.linkAlignment;
1322
1610
  return /*#__PURE__*/React.createElement("div", {
1323
- className: classNames(styles$7.ext_links_container, props.configuration.variant && "scope-externalLinkList-".concat(props.configuration.variant))
1324
- }, linkList.map(function (link, index) {
1325
- return /*#__PURE__*/React.createElement(ExternalLink, Object.assign({}, link, {
1326
- key: link.id,
1327
- invert: !darkBackground,
1328
- sectionProps: props.sectionProps,
1329
- loadImages: shouldLoad
1330
- }));
1611
+ className: classNames(_defineProperty({}, styles$8.contentMargin, props.customMargin || fullWidth), styles$8["scrollButtons-".concat(theme.options.teasersScrollButtons)]),
1612
+ onClick: handleListClick
1613
+ }, /*#__PURE__*/React.createElement(Scroller, {
1614
+ enabled: scrollerEnabled,
1615
+ measureKey: linkList.length
1616
+ }, function (_ref) {
1617
+ var scrollerRef = _ref.scrollerRef,
1618
+ handleScroll = _ref.handleScroll;
1619
+ return /*#__PURE__*/React.createElement("div", {
1620
+ className: classNames(styles$8.container, _defineProperty({}, styles$8.fullContainer, fullWidth))
1621
+ }, /*#__PURE__*/React.createElement(LinkTooltipProvider, {
1622
+ align: "center"
1623
+ }, /*#__PURE__*/React.createElement("ul", {
1624
+ ref: scrollerRef,
1625
+ className: classNames(styles$8.list, styles$8["textPosition-".concat(textPosition)], styles$8["layout-".concat(layout)], _defineProperty({}, styles$8.full, fullWidth), _defineProperty({}, styles$8.scroller, scrollerEnabled), props.configuration.variant && "scope-externalLinkList-".concat(props.configuration.variant), textPositionStyles.list, textPositionStyles["layout-".concat(layout)], textPositionStyles["width-".concat(contentElementWidthName(props.contentElementWidth))], textPositionStyles["linkWidth-".concat(fullWidth ? 'full-' : '').concat(linkWidth)], textPositionStyles["linkAlignment-".concat(linkAlignment)], textPositionStyles["textPosition-".concat(textPosition)], _defineProperty({}, textPositionStyles.scroller, scrollerEnabled)),
1626
+ style: {
1627
+ '--overlay-opacity': (props.configuration.overlayOpacity || 70) / 100,
1628
+ '--thumbnail-aspect-ratio': "var(--theme-aspect-ratio-".concat(props.configuration.thumbnailAspectRatio || 'wide', ")")
1629
+ },
1630
+ onScroll: handleScroll
1631
+ }, linkList.map(function (link, index) {
1632
+ return /*#__PURE__*/React.createElement(ExternalLink, Object.assign({}, link, {
1633
+ key: link.id,
1634
+ configuration: props.configuration,
1635
+ thumbnailAspectRatio: props.configuration.thumbnailAspectRatio,
1636
+ thumbnailSize: props.configuration.thumbnailSize || 'small',
1637
+ thumbnailFit: props.configuration.thumbnailFit || 'cover',
1638
+ textPosition: props.configuration.textPosition || 'below',
1639
+ textSize: props.configuration.textSize || 'small',
1640
+ darkBackground: darkBackground,
1641
+ loadImages: shouldLoad,
1642
+ outlined: isSelected,
1643
+ highlighted: highlightedIndex === index,
1644
+ selected: link.id === selectedItemId && isSelected,
1645
+ onClick: function onClick(event) {
1646
+ return handleItemClick(event, link.id);
1647
+ }
1648
+ }));
1649
+ }))));
1331
1650
  }));
1332
1651
  }
1333
1652
 
1334
1653
  frontend.contentElementTypes.register('externalLinkList', {
1335
1654
  component: ExternalLinkList,
1655
+ customMargin: function customMargin(_ref) {
1656
+ var configuration = _ref.configuration;
1657
+ return configuration.enableScroller === 'always';
1658
+ },
1336
1659
  lifecycle: true
1337
1660
  });
1338
1661
 
1339
1662
  function useIframeHeight(url) {
1340
1663
  var _useState = useState('400px'),
1341
- _useState2 = _slicedToArray(_useState, 2),
1342
- height = _useState2[0],
1343
- setHeight = _useState2[1];
1344
-
1664
+ _useState2 = _slicedToArray(_useState, 2),
1665
+ height = _useState2[0],
1666
+ setHeight = _useState2[1];
1345
1667
  useEffect(function () {
1346
1668
  window.addEventListener('message', receive);
1347
-
1348
1669
  function receive(event) {
1349
1670
  if (typeof event.data['datawrapper-height'] !== 'undefined') {
1350
1671
  for (var chartId in event.data['datawrapper-height']) {
@@ -1354,7 +1675,6 @@ function useIframeHeight(url) {
1354
1675
  }
1355
1676
  }
1356
1677
  }
1357
-
1358
1678
  return function () {
1359
1679
  return window.removeEventListener('message', receive);
1360
1680
  };
@@ -1362,34 +1682,29 @@ function useIframeHeight(url) {
1362
1682
  return height;
1363
1683
  }
1364
1684
 
1365
- var styles$8 = {"container":"DataWrapperChart-module_container__2eZ15"};
1685
+ var styles$9 = {"container":"DataWrapperChart-module_container__2eZ15"};
1366
1686
 
1367
1687
  function DataWrapperChart(_ref) {
1368
1688
  var configuration = _ref.configuration;
1369
-
1370
1689
  var _useI18n = useI18n(),
1371
- t = _useI18n.t;
1372
-
1690
+ t = _useI18n.t;
1373
1691
  var _useContentElementLif = useContentElementLifecycle(),
1374
- shouldLoad = _useContentElementLif.shouldLoad;
1375
-
1692
+ shouldLoad = _useContentElementLif.shouldLoad;
1376
1693
  var _useContentElementEdi = useContentElementEditorState(),
1377
- isEditable = _useContentElementEdi.isEditable,
1378
- isSelected = _useContentElementEdi.isSelected;
1379
-
1380
- var height = useIframeHeight(configuration.url); // remove url protocol, so that it is selected by the browser itself
1694
+ isEditable = _useContentElementEdi.isEditable,
1695
+ isSelected = _useContentElementEdi.isSelected;
1696
+ var height = useIframeHeight(configuration.url);
1381
1697
 
1698
+ // remove url protocol, so that it is selected by the browser itself
1382
1699
  var srcURL = '';
1383
-
1384
1700
  if (configuration.url) {
1385
1701
  srcURL = configuration.url.replace(/http(s|):/, '');
1386
1702
  }
1387
-
1388
1703
  var backgroundColor = configuration.backgroundColor || '#323d4d';
1389
1704
  return /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
1390
1705
  configuration: configuration
1391
1706
  }, /*#__PURE__*/React.createElement("div", {
1392
- className: styles$8.container,
1707
+ className: styles$9.container,
1393
1708
  style: {
1394
1709
  pointerEvents: isEditable && !isSelected ? 'none' : undefined,
1395
1710
  backgroundColor: backgroundColor,
@@ -1403,22 +1718,18 @@ function DataWrapperChart(_ref) {
1403
1718
  providerName: "datawrapper"
1404
1719
  }))));
1405
1720
  }
1406
-
1407
1721
  function DatawrapperOptOutInfo(props) {
1408
1722
  if (!features.isEnabled('datawrapper_chart_embed_opt_in')) {
1409
1723
  return null;
1410
1724
  }
1411
-
1412
1725
  return /*#__PURE__*/React.createElement(ThirdPartyOptOutInfo, Object.assign({
1413
1726
  providerName: "datawrapper"
1414
1727
  }, props));
1415
1728
  }
1416
-
1417
1729
  function renderIframe(url, title) {
1418
1730
  if (!url) {
1419
1731
  return null;
1420
1732
  }
1421
-
1422
1733
  return /*#__PURE__*/React.createElement("iframe", {
1423
1734
  src: url,
1424
1735
  title: title,
@@ -1434,7 +1745,7 @@ frontend.contentElementTypes.register('dataWrapperChart', {
1434
1745
  lifecycle: true,
1435
1746
  consentVendors: function consentVendors(_ref) {
1436
1747
  var configuration = _ref.configuration,
1437
- t = _ref.t;
1748
+ t = _ref.t;
1438
1749
  var prefix = 'pageflow_scrolled.public.chart';
1439
1750
  return [{
1440
1751
  name: 'datawrapper',
@@ -1447,7 +1758,7 @@ frontend.contentElementTypes.register('dataWrapperChart', {
1447
1758
 
1448
1759
  function useAutoCruising(_ref) {
1449
1760
  var viewerRef = _ref.viewerRef,
1450
- onCancel = _ref.onCancel;
1761
+ onCancel = _ref.onCancel;
1451
1762
  var autoCruisingRef = useRef(false);
1452
1763
  var rafIdRef = useRef();
1453
1764
  var lastYawRef = useRef(null);
@@ -1457,22 +1768,18 @@ function useAutoCruising(_ref) {
1457
1768
  var pitch = viewer.getPitch();
1458
1769
  var yaw = viewer.getYaw();
1459
1770
  var delta = 0;
1460
-
1461
1771
  if (!autoCruisingRef.current) {
1462
1772
  rafIdRef.current = window.requestAnimationFrame(tick);
1463
1773
  autoCruisingRef.current = true;
1464
1774
  }
1465
-
1466
1775
  function tick() {
1467
1776
  delta = new Date().getTime() - start;
1468
-
1469
1777
  if (autoCruisingRef.current && lastYawRef.current !== null && (Math.abs(pitch - viewer.getPitch()) > 0.1 || Math.abs(lastYawRef.current - viewer.getYaw()) > 0.1)) {
1470
1778
  autoCruisingRef.current = false;
1471
1779
  lastYawRef.current = null;
1472
1780
  onCancel();
1473
1781
  return;
1474
1782
  }
1475
-
1476
1783
  lastYawRef.current = yaw - delta / 1000 % 360;
1477
1784
  viewer.lookAt({
1478
1785
  yaw: lastYawRef.current,
@@ -1492,37 +1799,63 @@ function useAutoCruising(_ref) {
1492
1799
  return [start, stop];
1493
1800
  }
1494
1801
 
1495
- function VrImage(_ref) {
1802
+ var aspectRatios$1 = {
1803
+ wide: 0.5625,
1804
+ narrow: 0.75,
1805
+ square: 1,
1806
+ portrait: 1.7777
1807
+ };
1808
+ function getAspectRatio(_ref) {
1496
1809
  var configuration = _ref.configuration,
1497
- contentElementWidth = _ref.contentElementWidth;
1810
+ contentElementWidth = _ref.contentElementWidth,
1811
+ portraitOrientation = _ref.portraitOrientation;
1812
+ var effectiveAspectRatio = portraitOrientation && configuration.portraitAspectRatio ? configuration.portraitAspectRatio : configuration.aspectRatio;
1813
+ if (!effectiveAspectRatio) {
1814
+ return getAutoAspectRatio(contentElementWidth);
1815
+ }
1816
+ return aspectRatios$1[effectiveAspectRatio] || 0.75;
1817
+ }
1818
+ function getAutoAspectRatio(contentElementWidth) {
1819
+ return contentElementWidth === contentElementWidths.full ? 0.5 : 0.75;
1820
+ }
1498
1821
 
1822
+ function VrImage(_ref) {
1823
+ var configuration = _ref.configuration,
1824
+ contentElementWidth = _ref.contentElementWidth;
1499
1825
  var _useContentElementLif = useContentElementLifecycle(),
1500
- shouldLoad = _useContentElementLif.shouldLoad;
1501
-
1826
+ shouldLoad = _useContentElementLif.shouldLoad;
1502
1827
  var _useContentElementEdi = useContentElementEditorState(),
1503
- isEditable = _useContentElementEdi.isEditable,
1504
- isSelected = _useContentElementEdi.isSelected;
1505
-
1828
+ isEditable = _useContentElementEdi.isEditable,
1829
+ isSelected = _useContentElementEdi.isSelected;
1830
+ var portraitOrientation = usePortraitOrientation();
1506
1831
  var imageFile = useFileWithInlineRights({
1507
1832
  configuration: configuration,
1508
1833
  collectionName: 'imageFiles',
1509
1834
  propertyName: 'image'
1510
1835
  });
1836
+ var aspectRatio = getAspectRatio({
1837
+ configuration: configuration,
1838
+ contentElementWidth: contentElementWidth,
1839
+ portraitOrientation: portraitOrientation
1840
+ });
1511
1841
  return /*#__PURE__*/React.createElement("div", {
1512
1842
  style: {
1513
1843
  pointerEvents: isEditable && !isSelected ? 'none' : undefined
1514
1844
  }
1515
1845
  }, /*#__PURE__*/React.createElement(FitViewport, {
1516
- aspectRatio: contentElementWidth === contentElementWidths.full ? 0.5 : 0.75
1846
+ aspectRatio: aspectRatio,
1847
+ fill: configuration.position === 'backdrop'
1517
1848
  }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
1518
1849
  configuration: configuration
1519
- }, /*#__PURE__*/React.createElement(FitViewport.Content, null, renderLazyPanorama(configuration, imageFile, shouldLoad), /*#__PURE__*/React.createElement(InlineFileRights, {
1850
+ }, /*#__PURE__*/React.createElement(FitViewport.Content, null, renderLazyPanorama(configuration, imageFile, shouldLoad, aspectRatio), /*#__PURE__*/React.createElement(InlineFileRights, {
1851
+ configuration: configuration,
1520
1852
  context: "insideElement",
1521
1853
  items: [{
1522
1854
  file: imageFile,
1523
1855
  label: 'image'
1524
1856
  }]
1525
1857
  })))), /*#__PURE__*/React.createElement(InlineFileRights, {
1858
+ configuration: configuration,
1526
1859
  context: "afterElement",
1527
1860
  items: [{
1528
1861
  file: imageFile,
@@ -1530,38 +1863,34 @@ function VrImage(_ref) {
1530
1863
  }]
1531
1864
  })));
1532
1865
  }
1533
-
1534
- function renderLazyPanorama(configuration, imageFile, shouldLoad) {
1866
+ function renderLazyPanorama(configuration, imageFile, shouldLoad, aspectRatio) {
1535
1867
  if (shouldLoad && imageFile && imageFile.isReady) {
1536
1868
  return /*#__PURE__*/React.createElement(AutoCruisingPanorama, {
1537
1869
  imageFile: imageFile,
1870
+ key: aspectRatio,
1538
1871
  initialYaw: configuration.initialYaw,
1539
1872
  initialPitch: configuration.initialPitch
1540
1873
  });
1541
1874
  }
1542
1875
  }
1543
-
1544
1876
  function AutoCruisingPanorama(_ref2) {
1545
1877
  var imageFile = _ref2.imageFile,
1546
- initialYaw = _ref2.initialYaw,
1547
- initialPitch = _ref2.initialPitch;
1878
+ initialYaw = _ref2.initialYaw,
1879
+ initialPitch = _ref2.initialPitch;
1548
1880
  var viewerRef = useRef();
1549
-
1550
1881
  var _useState = useState(false),
1551
- _useState2 = _slicedToArray(_useState, 2),
1552
- hidePanoramaIndicator = _useState2[0],
1553
- setHidePanoramaIndicator = _useState2[1];
1554
-
1882
+ _useState2 = _slicedToArray(_useState, 2),
1883
+ hidePanoramaIndicator = _useState2[0],
1884
+ setHidePanoramaIndicator = _useState2[1];
1555
1885
  var _useAutoCruising = useAutoCruising({
1556
- viewerRef: viewerRef,
1557
- onCancel: function onCancel() {
1558
- return setHidePanoramaIndicator(true);
1559
- }
1560
- }),
1561
- _useAutoCruising2 = _slicedToArray(_useAutoCruising, 2),
1562
- startAutoCruising = _useAutoCruising2[0],
1563
- stopAutoCruising = _useAutoCruising2[1];
1564
-
1886
+ viewerRef: viewerRef,
1887
+ onCancel: function onCancel() {
1888
+ return setHidePanoramaIndicator(true);
1889
+ }
1890
+ }),
1891
+ _useAutoCruising2 = _slicedToArray(_useAutoCruising, 2),
1892
+ startAutoCruising = _useAutoCruising2[0],
1893
+ stopAutoCruising = _useAutoCruising2[1];
1565
1894
  useContentElementLifecycle({
1566
1895
  onActivate: function onActivate() {
1567
1896
  if (viewerRef.current) {
@@ -1585,9 +1914,41 @@ frontend.contentElementTypes.register('vrImage', {
1585
1914
  lifecycle: true
1586
1915
  });
1587
1916
 
1588
- var styles$9 = {"wrapper":"IframeEmbed-module_wrapper__3w_LN","iframe":"IframeEmbed-module_iframe__3QVCA","scale-p33":"IframeEmbed-module_scale-p33__MRjVy","scale-p50":"IframeEmbed-module_scale-p50__1EKxu","scale-p75":"IframeEmbed-module_scale-p75__1yT4D"};
1917
+ function useIframeHeight$1(_ref) {
1918
+ var src = _ref.src,
1919
+ active = _ref.active;
1920
+ var _useState = useState('400px'),
1921
+ _useState2 = _slicedToArray(_useState, 2),
1922
+ height = _useState2[0],
1923
+ setHeight = _useState2[1];
1924
+ useEffect(function () {
1925
+ if (!active) {
1926
+ return;
1927
+ }
1928
+ window.addEventListener('message', receive);
1929
+ function receive(event) {
1930
+ var data = parse(event.data);
1931
+ if (src && data.context === 'iframe.resize' && data.src === src) {
1932
+ setHeight(data.height + 'px');
1933
+ }
1934
+ }
1935
+ return function () {
1936
+ return window.removeEventListener('message', receive);
1937
+ };
1938
+ }, [active, src]);
1939
+ return height;
1940
+ }
1941
+ function parse(data) {
1942
+ try {
1943
+ return JSON.parse(data);
1944
+ } catch (e) {
1945
+ return {};
1946
+ }
1947
+ }
1589
1948
 
1590
- var aspectRatios$1 = {
1949
+ var styles$a = {"wrapper":"IframeEmbed-module_wrapper__3w_LN","iframe":"IframeEmbed-module_iframe__3QVCA","scale-p33":"IframeEmbed-module_scale-p33__MRjVy","scale-p50":"IframeEmbed-module_scale-p50__1EKxu","scale-p75":"IframeEmbed-module_scale-p75__1yT4D"};
1950
+
1951
+ var aspectRatios$2 = {
1591
1952
  wide: 0.5625,
1592
1953
  narrow: 0.75,
1593
1954
  square: 1,
@@ -1595,42 +1956,51 @@ var aspectRatios$1 = {
1595
1956
  };
1596
1957
  function IframeEmbed(_ref) {
1597
1958
  var configuration = _ref.configuration;
1598
-
1599
1959
  var _useContentElementLif = useContentElementLifecycle(),
1600
- shouldLoad = _useContentElementLif.shouldLoad;
1601
-
1960
+ shouldLoad = _useContentElementLif.shouldLoad;
1602
1961
  var _useContentElementEdi = useContentElementEditorState(),
1603
- isEditable = _useContentElementEdi.isEditable,
1604
- isSelected = _useContentElementEdi.isSelected;
1605
-
1962
+ isEditable = _useContentElementEdi.isEditable,
1963
+ isSelected = _useContentElementEdi.isSelected;
1606
1964
  var portraitOrientation = usePortraitOrientation();
1965
+ var height = useIframeHeight$1({
1966
+ src: configuration.source,
1967
+ active: configuration.autoResize
1968
+ });
1607
1969
  var aspectRatio = portraitOrientation && configuration.portraitAspectRatio ? configuration.portraitAspectRatio : configuration.aspectRatio;
1970
+ function renderSpanningWrapper(children) {
1971
+ if (configuration.autoResize) {
1972
+ return /*#__PURE__*/React.createElement("div", {
1973
+ style: {
1974
+ height: height
1975
+ }
1976
+ }, children);
1977
+ } else {
1978
+ return /*#__PURE__*/React.createElement(FitViewport.Content, null, children);
1979
+ }
1980
+ }
1608
1981
  return /*#__PURE__*/React.createElement("div", {
1609
- className: styles$9.wrapper,
1982
+ className: styles$a.wrapper,
1610
1983
  style: {
1611
1984
  pointerEvents: isEditable && !isSelected ? 'none' : undefined
1612
1985
  }
1613
1986
  }, /*#__PURE__*/React.createElement(FitViewport, {
1614
- aspectRatio: aspectRatios$1[aspectRatio || 'wide'],
1987
+ aspectRatio: aspectRatios$2[aspectRatio || 'wide'],
1615
1988
  opaque: utils.isBlank(configuration.source)
1616
1989
  }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
1617
1990
  configuration: configuration
1618
- }, /*#__PURE__*/React.createElement(FitViewport.Content, null, /*#__PURE__*/React.createElement(ThirdPartyOptIn, null, shouldLoad && /*#__PURE__*/React.createElement("iframe", {
1619
- className: classNames(styles$9.iframe, styles$9["scale-".concat(configuration.scale)]),
1991
+ }, renderSpanningWrapper( /*#__PURE__*/React.createElement(ThirdPartyOptIn, null, shouldLoad && /*#__PURE__*/React.createElement("iframe", {
1992
+ className: classNames(styles$a.iframe, styles$a["scale-".concat(configuration.scale)]),
1620
1993
  title: configuration.title,
1621
1994
  src: configuration.source
1622
1995
  }))), /*#__PURE__*/React.createElement(OptOutInfo, {
1623
1996
  configuration: configuration
1624
1997
  })))));
1625
1998
  }
1626
-
1627
1999
  function OptOutInfo(_ref2) {
1628
2000
  var configuration = _ref2.configuration;
1629
-
1630
2001
  if (!configuration.requireConsent) {
1631
2002
  return null;
1632
2003
  }
1633
-
1634
2004
  return /*#__PURE__*/React.createElement(ThirdPartyOptOutInfo, null);
1635
2005
  }
1636
2006
 
@@ -1639,29 +2009,26 @@ frontend.contentElementTypes.register('iframeEmbed', {
1639
2009
  lifecycle: true
1640
2010
  });
1641
2011
 
1642
- var styles$a = {"wrapper":"Placeholder-module_wrapper__jRFYE","row":"Placeholder-module_row__1SBRB","item":"Placeholder-module_item__RozmQ","load":"Placeholder-module_load__uFpxr","avatar":"Placeholder-module_avatar__2VeHz Placeholder-module_item__RozmQ","info":"Placeholder-module_info__37csK","name":"Placeholder-module_name__2T6as Placeholder-module_item__RozmQ","handle":"Placeholder-module_handle__2WwoF Placeholder-module_item__RozmQ","text":"Placeholder-module_text__DWLME Placeholder-module_item__RozmQ"};
2012
+ var styles$b = {"wrapper":"Placeholder-module_wrapper__jRFYE","row":"Placeholder-module_row__1SBRB","item":"Placeholder-module_item__RozmQ","load":"Placeholder-module_load__uFpxr","avatar":"Placeholder-module_avatar__2VeHz Placeholder-module_item__RozmQ","info":"Placeholder-module_info__37csK","name":"Placeholder-module_name__2T6as Placeholder-module_item__RozmQ","handle":"Placeholder-module_handle__2WwoF Placeholder-module_item__RozmQ","text":"Placeholder-module_text__DWLME Placeholder-module_item__RozmQ"};
1643
2013
 
2014
+ var _excluded$4 = ["styles"];
1644
2015
  function _extends$2() {
1645
- _extends$2 = Object.assign || function (target) {
2016
+ _extends$2 = Object.assign ? Object.assign.bind() : function (target) {
1646
2017
  for (var i = 1; i < arguments.length; i++) {
1647
2018
  var source = arguments[i];
1648
-
1649
2019
  for (var key in source) {
1650
2020
  if (Object.prototype.hasOwnProperty.call(source, key)) {
1651
2021
  target[key] = source[key];
1652
2022
  }
1653
2023
  }
1654
2024
  }
1655
-
1656
2025
  return target;
1657
2026
  };
1658
-
1659
2027
  return _extends$2.apply(this, arguments);
1660
2028
  }
1661
2029
  var Icon = (function (_ref) {
1662
2030
  var _ref$styles = _ref.styles,
1663
- props = _objectWithoutProperties(_ref, ["styles"]);
1664
-
2031
+ props = _objectWithoutProperties(_ref, _excluded$4);
1665
2032
  return /*#__PURE__*/React.createElement("svg", _extends$2({
1666
2033
  viewBox: "0 0 512 512",
1667
2034
  "aria-hidden": "true"
@@ -1672,50 +2039,46 @@ var Icon = (function (_ref) {
1672
2039
 
1673
2040
  function Placeholder(_ref) {
1674
2041
  var children = _ref.children,
1675
- minHeight = _ref.minHeight;
2042
+ minHeight = _ref.minHeight;
1676
2043
  return /*#__PURE__*/React.createElement("div", {
1677
- className: styles$a.wrapper,
2044
+ className: styles$b.wrapper,
1678
2045
  style: {
1679
2046
  minHeight: minHeight
1680
2047
  }
1681
2048
  }, /*#__PURE__*/React.createElement("div", {
1682
- className: styles$a.row
2049
+ className: styles$b.row
1683
2050
  }, /*#__PURE__*/React.createElement("div", {
1684
- className: styles$a.avatar
2051
+ className: styles$b.avatar
1685
2052
  }), /*#__PURE__*/React.createElement("div", {
1686
- className: styles$a.info
2053
+ className: styles$b.info
1687
2054
  }, /*#__PURE__*/React.createElement("div", {
1688
- className: styles$a.name
2055
+ className: styles$b.name
1689
2056
  }), /*#__PURE__*/React.createElement("div", {
1690
- className: styles$a.handle
2057
+ className: styles$b.handle
1691
2058
  })), /*#__PURE__*/React.createElement(Icon, {
1692
2059
  width: 24,
1693
2060
  height: 24
1694
2061
  })), children || /*#__PURE__*/React.createElement("div", {
1695
- className: styles$a.text
2062
+ className: styles$b.text
1696
2063
  }));
1697
2064
  }
1698
2065
 
1699
- var styles$b = {"loadingContainer":"TwitterEmbed-module_loadingContainer__3Ozs_","container":"TwitterEmbed-module_container__380cX"};
2066
+ var styles$c = {"loadingContainer":"TwitterEmbed-module_loadingContainer__3Ozs_","container":"TwitterEmbed-module_container__380cX"};
1700
2067
 
1701
2068
  function TwitterEmbed(_ref) {
1702
2069
  var configuration = _ref.configuration;
1703
2070
  var url = configuration.url,
1704
- hideConversation = configuration.hideConversation,
1705
- hideMedia = configuration.hideMedia;
1706
-
2071
+ hideConversation = configuration.hideConversation,
2072
+ hideMedia = configuration.hideMedia;
1707
2073
  var _useContentElementEdi = useContentElementEditorState(),
1708
- isEditable = _useContentElementEdi.isEditable,
1709
- isSelected = _useContentElementEdi.isSelected;
1710
-
2074
+ isEditable = _useContentElementEdi.isEditable,
2075
+ isSelected = _useContentElementEdi.isSelected;
1711
2076
  var _useContentElementLif = useContentElementLifecycle(),
1712
- shouldLoad = _useContentElementLif.shouldLoad;
1713
-
2077
+ shouldLoad = _useContentElementLif.shouldLoad;
1714
2078
  var _useState = useState({}),
1715
- _useState2 = _slicedToArray(_useState, 2),
1716
- minHeight = _useState2[0],
1717
- setMinHeight = _useState2[1];
1718
-
2079
+ _useState2 = _slicedToArray(_useState, 2),
2080
+ minHeight = _useState2[0],
2081
+ setMinHeight = _useState2[1];
1719
2082
  var key = [url, hideConversation, hideMedia].join('-');
1720
2083
  var onLoad = useCallback(function (_ref2) {
1721
2084
  var height = _ref2.height;
@@ -1744,7 +2107,6 @@ function TwitterEmbed(_ref) {
1744
2107
  providerName: "twitter"
1745
2108
  })));
1746
2109
  }
1747
-
1748
2110
  function scriptLoaded() {
1749
2111
  var promise = new Promise(function (resolve) {
1750
2112
  var script = document.createElement("script");
@@ -1754,21 +2116,18 @@ function scriptLoaded() {
1754
2116
  });
1755
2117
  return promise;
1756
2118
  }
1757
-
1758
2119
  function Tweet(_ref3) {
1759
2120
  var url = _ref3.url,
1760
- hideConversation = _ref3.hideConversation,
1761
- hideMedia = _ref3.hideMedia,
1762
- minHeight = _ref3.minHeight,
1763
- onLoad = _ref3.onLoad;
2121
+ hideConversation = _ref3.hideConversation,
2122
+ hideMedia = _ref3.hideMedia,
2123
+ minHeight = _ref3.minHeight,
2124
+ onLoad = _ref3.onLoad;
1764
2125
  var ref = useRef(null);
1765
2126
  var tweetId = url ? url.split('/')[5] : undefined;
1766
-
1767
2127
  var _useState3 = useState(false),
1768
- _useState4 = _slicedToArray(_useState3, 2),
1769
- loaded = _useState4[0],
1770
- setLoaded = _useState4[1];
1771
-
2128
+ _useState4 = _slicedToArray(_useState3, 2),
2129
+ loaded = _useState4[0],
2130
+ setLoaded = _useState4[1];
1772
2131
  useEffect(function () {
1773
2132
  var isComponentMounted = true;
1774
2133
  var options = {
@@ -1781,7 +2140,6 @@ function Tweet(_ref3) {
1781
2140
  if (window.twttr.widgets['createTweetEmbed']) {
1782
2141
  window.twttr.widgets.createTweet(tweetId, ref.current, options).then(function () {
1783
2142
  var _ref$current;
1784
-
1785
2143
  setLoaded(true);
1786
2144
  onLoad({
1787
2145
  height: (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientHeight
@@ -1799,7 +2157,7 @@ function Tweet(_ref3) {
1799
2157
  minHeight: minHeight
1800
2158
  }), /*#__PURE__*/React.createElement("div", {
1801
2159
  ref: ref,
1802
- className: classNames(styles$b.container, _defineProperty({}, styles$b.loadingContainer, !loaded))
2160
+ className: classNames(styles$c.container, _defineProperty({}, styles$c.loadingContainer, !loaded))
1803
2161
  }));
1804
2162
  }
1805
2163
 
@@ -1818,34 +2176,36 @@ frontend.contentElementTypes.register('twitterEmbed', {
1818
2176
  }
1819
2177
  });
1820
2178
 
1821
- var styles$c = {"contentLinkColor":"var(--content-link-color)","details":"Question-module_details__3FxH-","answer":"Question-module_answer__2jMt6","layout-centerRagged":"Question-module_layout-centerRagged__1hovs"};
2179
+ var styles$d = {"details":"Question-module_details__3FxH-","answer":"Question-module_answer__2jMt6","layout-centerRagged":"Question-module_layout-centerRagged__1hovs"};
1822
2180
 
1823
2181
  function Question(_ref) {
1824
2182
  var configuration = _ref.configuration,
1825
- contentElementId = _ref.contentElementId,
1826
- sectionProps = _ref.sectionProps;
2183
+ contentElementId = _ref.contentElementId,
2184
+ sectionProps = _ref.sectionProps;
1827
2185
  var updateConfiguration = useContentElementConfigurationUpdate();
1828
-
1829
2186
  var _useI18n = useI18n({
1830
- locale: 'ui'
1831
- }),
1832
- t = _useI18n.t;
1833
-
2187
+ locale: 'ui'
2188
+ }),
2189
+ t = _useI18n.t;
1834
2190
  var _useContentElementEdi = useContentElementEditorState(),
1835
- isEditable = _useContentElementEdi.isEditable,
1836
- isSelected = _useContentElementEdi.isSelected;
1837
-
2191
+ isEditable = _useContentElementEdi.isEditable,
2192
+ isSelected = _useContentElementEdi.isSelected;
1838
2193
  return /*#__PURE__*/React.createElement("details", {
1839
2194
  open: configuration.expandByDefault || isEditable && isSelected,
1840
- className: classNames(styles$c.details, styles$c["layout-".concat(sectionProps.layout)])
2195
+ className: classNames(styles$d.details, styles$d["layout-".concat(sectionProps.layout)])
1841
2196
  }, /*#__PURE__*/React.createElement("summary", {
1842
2197
  onClick: isEditable ? function (event) {
1843
2198
  return event.preventDefault();
1844
- } : undefined
2199
+ } : undefined,
2200
+ style: {
2201
+ color: paletteColor(configuration.color)
2202
+ }
1845
2203
  }, /*#__PURE__*/React.createElement(ThemeIcon, {
1846
2204
  name: "expand"
1847
2205
  }), /*#__PURE__*/React.createElement(Text, {
1848
- scaleCategory: "question"
2206
+ scaleCategory: "question",
2207
+ typographyVariant: configuration.typographyVariant,
2208
+ typographySize: configuration.typographySize
1849
2209
  }, /*#__PURE__*/React.createElement(EditableInlineText, {
1850
2210
  value: configuration.question,
1851
2211
  onChange: function onChange(question) {
@@ -1855,10 +2215,17 @@ function Question(_ref) {
1855
2215
  },
1856
2216
  hyphens: "none",
1857
2217
  placeholder: t('pageflow_scrolled.inline_editing.type_question')
1858
- }))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(EditableText, {
2218
+ }))), /*#__PURE__*/React.createElement("div", {
2219
+ style: {
2220
+ color: paletteColor(configuration.answerColor)
2221
+ }
2222
+ }, /*#__PURE__*/React.createElement(EditableText, {
1859
2223
  value: configuration.answer,
1860
2224
  contentElementId: contentElementId,
1861
- className: styles$c.answer,
2225
+ scaleCategory: "questionAnswer",
2226
+ typographyVariant: configuration.typographyVariant,
2227
+ typographySize: configuration.typographySize,
2228
+ className: styles$d.answer,
1862
2229
  onChange: function onChange(answer) {
1863
2230
  return updateConfiguration({
1864
2231
  answer: answer
@@ -1874,51 +2241,42 @@ frontend.contentElementTypes.register('question', {
1874
2241
  component: Question
1875
2242
  });
1876
2243
 
1877
- var styles$d = {"contentLinkColor":"var(--content-link-color)","wrapper":"Counter-module_wrapper__3XTil","number":"Counter-module_number__1Y4AV","centerRagged":"Counter-module_centerRagged__3Va0Y","center":"Counter-module_center__1SCJY","animation-fadeIn":"Counter-module_animation-fadeIn__3Hyky","animation-fadeIn-active":"Counter-module_animation-fadeIn-active__16DIk","animation-fadeInFromBelow":"Counter-module_animation-fadeInFromBelow__3l1qX","animation-fadeInFromAbove":"Counter-module_animation-fadeInFromAbove__3iGf-","animation-fadeInFromAbove-active":"Counter-module_animation-fadeInFromAbove-active__37UsW","animation-fadeInFromBelow-active":"Counter-module_animation-fadeInFromBelow-active__2CSjv","animation-fadeInScaleUp":"Counter-module_animation-fadeInScaleUp__1ngk5","animation-fadeInScaleDown":"Counter-module_animation-fadeInScaleDown__SpNGu","animation-fadeInScaleUp-active":"Counter-module_animation-fadeInScaleUp-active__1GEXn","animation-fadeInScaleDown-active":"Counter-module_animation-fadeInScaleDown-active__3gaYM"};
2244
+ var styles$e = {"wrapper":"Counter-module_wrapper__3XTil","number":"Counter-module_number__1Y4AV","centerRagged":"Counter-module_centerRagged__3Va0Y","center":"Counter-module_center__1SCJY","animation-fadeIn":"Counter-module_animation-fadeIn__3Hyky","animation-fadeIn-active":"Counter-module_animation-fadeIn-active__16DIk","animation-fadeInFromBelow":"Counter-module_animation-fadeInFromBelow__3l1qX","animation-fadeInFromAbove":"Counter-module_animation-fadeInFromAbove__3iGf-","animation-fadeInFromAbove-active":"Counter-module_animation-fadeInFromAbove-active__37UsW","animation-fadeInFromBelow-active":"Counter-module_animation-fadeInFromBelow-active__2CSjv","animation-fadeInScaleUp":"Counter-module_animation-fadeInScaleUp__1ngk5","animation-fadeInScaleDown":"Counter-module_animation-fadeInScaleDown__SpNGu","animation-fadeInScaleUp-active":"Counter-module_animation-fadeInScaleUp-active__1GEXn","animation-fadeInScaleDown-active":"Counter-module_animation-fadeInScaleDown-active__3gaYM"};
1878
2245
 
1879
2246
  function Counter(_ref) {
1880
2247
  var configuration = _ref.configuration,
1881
- contentElementId = _ref.contentElementId,
1882
- contentElementWidth = _ref.contentElementWidth,
1883
- sectionProps = _ref.sectionProps;
2248
+ contentElementId = _ref.contentElementId,
2249
+ contentElementWidth = _ref.contentElementWidth,
2250
+ sectionProps = _ref.sectionProps;
1884
2251
  var updateConfiguration = useContentElementConfigurationUpdate();
1885
2252
  var locale = useLocale();
1886
-
1887
2253
  var _useI18n = useI18n({
1888
- locale: 'ui'
1889
- }),
1890
- t = _useI18n.t;
1891
-
2254
+ locale: 'ui'
2255
+ }),
2256
+ t = _useI18n.t;
1892
2257
  var targetValue = configuration.targetValue || 0;
1893
2258
  var decimalPlaces = configuration.decimalPlaces || 0;
1894
2259
  var startValue = configuration.startValue || 0;
1895
2260
  var countingDuration = countingDurations[configuration.countingSpeed];
1896
-
1897
2261
  var _useState = useState(countingDuration > 0 ? startValue : targetValue),
1898
- _useState2 = _slicedToArray(_useState, 2),
1899
- currentValue = _useState2[0],
1900
- setCurrentValue = _useState2[1];
1901
-
2262
+ _useState2 = _slicedToArray(_useState, 2),
2263
+ currentValue = _useState2[0],
2264
+ setCurrentValue = _useState2[1];
1902
2265
  var _useState3 = useState(false),
1903
- _useState4 = _slicedToArray(_useState3, 2),
1904
- animated = _useState4[0],
1905
- setAnimated = _useState4[1];
1906
-
2266
+ _useState4 = _slicedToArray(_useState3, 2),
2267
+ animated = _useState4[0],
2268
+ setAnimated = _useState4[1];
1907
2269
  var intervalRef = useRef();
1908
2270
  var timeoutRef = useRef();
1909
-
1910
2271
  var _useContentElementEdi = useContentElementEditorState(),
1911
- isEditable = _useContentElementEdi.isEditable;
1912
-
2272
+ isEditable = _useContentElementEdi.isEditable;
1913
2273
  var animate = useCallback(function () {
1914
2274
  setAnimated(true);
1915
-
1916
2275
  if (!intervalRef.current && countingDuration > 0) {
1917
2276
  var startTime = new Date().getTime();
1918
2277
  var ease = configuration.entranceAnimation && configuration.entranceAnimation !== 'none' ? easeOut : easeInOut;
1919
2278
  intervalRef.current = setInterval(function () {
1920
2279
  var t = (new Date().getTime() - startTime) / countingDuration;
1921
-
1922
2280
  if (t < 1) {
1923
2281
  setCurrentValue(startValue + (targetValue - startValue) * ease(t));
1924
2282
  } else {
@@ -1951,24 +2309,23 @@ function Counter(_ref) {
1951
2309
  }
1952
2310
  }
1953
2311
  });
1954
-
1955
2312
  function format(value) {
1956
2313
  var localeString = value.toLocaleString(locale, {
2314
+ useGrouping: !configuration.hideThousandsSeparators,
1957
2315
  minimumFractionDigits: decimalPlaces,
1958
2316
  maximumFractionDigits: decimalPlaces
1959
2317
  });
1960
2318
  var unit = configuration.unit || '';
1961
2319
  return configuration.unitPlacement === 'leading' ? "".concat(unit).concat(localeString) : "".concat(localeString).concat(unit);
1962
2320
  }
1963
-
1964
2321
  return /*#__PURE__*/React.createElement("div", {
1965
- className: classNames(_defineProperty({}, styles$d.center, contentElementWidth > contentElementWidths.md))
2322
+ className: classNames(_defineProperty({}, styles$e.center, contentElementWidth > contentElementWidths.md))
1966
2323
  }, /*#__PURE__*/React.createElement("div", {
1967
- className: classNames(styles$d.wrapper, _defineProperty({}, styles$d.centerRagged, sectionProps.layout === 'centerRagged'))
2324
+ className: classNames(styles$e.wrapper, _defineProperty({}, styles$e.centerRagged, sectionProps.layout === 'centerRagged'))
1968
2325
  }, /*#__PURE__*/React.createElement(Text, {
1969
2326
  scaleCategory: numberScaleCategories[configuration.textSize || 'medium']
1970
2327
  }, /*#__PURE__*/React.createElement("div", {
1971
- className: classNames("typography-counter-".concat(configuration.typographyVariant), styles$d.number, styles$d["animation-".concat(configuration.entranceAnimation)], _defineProperty({}, styles$d["animation-".concat(configuration.entranceAnimation, "-active")], animated)),
2328
+ className: classNames("typography-counter-".concat(configuration.typographyVariant), styles$e.number, styles$e["animation-".concat(configuration.entranceAnimation)], _defineProperty({}, styles$e["animation-".concat(configuration.entranceAnimation, "-active")], animated)),
1972
2329
  style: {
1973
2330
  '--counting-duration': "".concat(countingDuration || 1000, "ms"),
1974
2331
  '--palette-color': paletteColor(configuration.numberColor)
@@ -1976,7 +2333,7 @@ function Counter(_ref) {
1976
2333
  }, format(currentValue))), /*#__PURE__*/React.createElement(EditableText, {
1977
2334
  value: configuration.description,
1978
2335
  contentElementId: contentElementId,
1979
- className: styles$d.description,
2336
+ className: styles$e.description,
1980
2337
  onChange: function onChange(description) {
1981
2338
  return updateConfiguration({
1982
2339
  description: description
@@ -1999,14 +2356,12 @@ var countingDurations = {
1999
2356
  medium: 2000,
2000
2357
  slow: 5000
2001
2358
  };
2002
-
2003
2359
  function easeInOut(t) {
2004
2360
  t = t * 2;
2005
2361
  if (t < 1) return Math.pow(t, 2) / 2;
2006
2362
  t = t - 1;
2007
2363
  return t - Math.pow(t, 2) / 2 + 1 / 2;
2008
2364
  }
2009
-
2010
2365
  function easeOut(t) {
2011
2366
  return (t - Math.pow(t, 2) / 2) * 2;
2012
2367
  }
@@ -2016,34 +2371,29 @@ frontend.contentElementTypes.register('counter', {
2016
2371
  lifecycle: true
2017
2372
  });
2018
2373
 
2019
- var styles$e = {"breakpoint-sm":"(min-width: 640px)","contentLinkColor":"var(--content-link-color)","figure":"Quote-module_figure__1Q3tJ","design-largeCentered":"Quote-module_design-largeCentered__2f6qW","text":"Quote-module_text__C0md2","design-largeHanging":"Quote-module_design-largeHanging__1TVQh","design-hanging":"Quote-module_design-hanging__4aDVU","centerRagged":"Quote-module_centerRagged__1CeFH","maskedMark":"Quote-module_maskedMark__2n08e","attribution":"Quote-module_attribution__3iXxu"};
2374
+ var styles$f = {"breakpoint-sm":"(min-width: 640px)","figure":"Quote-module_figure__1Q3tJ","design-largeCentered":"Quote-module_design-largeCentered__2f6qW","text":"Quote-module_text__C0md2","design-largeHanging":"Quote-module_design-largeHanging__1TVQh","design-hanging":"Quote-module_design-hanging__4aDVU","centerRagged":"Quote-module_centerRagged__1CeFH","maskedMark":"Quote-module_maskedMark__2n08e","attribution":"Quote-module_attribution__3iXxu"};
2020
2375
 
2021
2376
  function Quote(_ref) {
2022
2377
  var _theme$options$proper, _theme$options$proper2;
2023
-
2024
2378
  var configuration = _ref.configuration,
2025
- contentElementId = _ref.contentElementId,
2026
- sectionProps = _ref.sectionProps;
2379
+ contentElementId = _ref.contentElementId,
2380
+ sectionProps = _ref.sectionProps;
2027
2381
  var updateConfiguration = useContentElementConfigurationUpdate();
2028
-
2029
2382
  var _useContentElementEdi = useContentElementEditorState(),
2030
- isSelected = _useContentElementEdi.isSelected;
2031
-
2383
+ isSelected = _useContentElementEdi.isSelected;
2032
2384
  var theme = useTheme();
2033
-
2034
2385
  var _useI18n = useI18n({
2035
- locale: 'ui'
2036
- }),
2037
- t = _useI18n.t;
2038
-
2386
+ locale: 'ui'
2387
+ }),
2388
+ t = _useI18n.t;
2039
2389
  var design = configuration.variant ? configuration.variant.split('-')[0] : theme.options.quoteDesign;
2040
2390
  return /*#__PURE__*/React.createElement("figure", {
2041
- className: classNames(styles$e.figure, styles$e["design-".concat(design || 'largeHanging')], "scope-quote-".concat(configuration.variant), _defineProperty({}, styles$e.maskedMark, (_theme$options$proper = theme.options.properties) === null || _theme$options$proper === void 0 ? void 0 : (_theme$options$proper2 = _theme$options$proper.root) === null || _theme$options$proper2 === void 0 ? void 0 : _theme$options$proper2.quoteLeftMarkMaskImage), _defineProperty({}, styles$e.centerRagged, sectionProps.layout === 'centerRagged')),
2391
+ className: classNames(styles$f.figure, styles$f["design-".concat(design || 'largeHanging')], "scope-quote-".concat(configuration.variant), _defineProperty({}, styles$f.maskedMark, (_theme$options$proper = theme.options.properties) === null || _theme$options$proper === void 0 ? void 0 : (_theme$options$proper2 = _theme$options$proper.root) === null || _theme$options$proper2 === void 0 ? void 0 : _theme$options$proper2.quoteLeftMarkMaskImage), _defineProperty({}, styles$f.centerRagged, sectionProps.layout === 'centerRagged')),
2042
2392
  style: {
2043
2393
  '--palette-color': paletteColor(configuration.color)
2044
2394
  }
2045
2395
  }, /*#__PURE__*/React.createElement("blockquote", {
2046
- className: styles$e.text
2396
+ className: styles$f.text
2047
2397
  }, /*#__PURE__*/React.createElement(EditableText, {
2048
2398
  value: configuration.text,
2049
2399
  contentElementId: contentElementId,
@@ -2053,9 +2403,9 @@ function Quote(_ref) {
2053
2403
  });
2054
2404
  },
2055
2405
  onlyParagraphs: true,
2056
- scaleCategory: getTextScaleCategory(configuration)
2406
+ scaleCategory: getTextScaleCategory(configuration, 'Text')
2057
2407
  })), (isSelected || !utils.isBlankEditableTextValue(configuration.attribution || [])) && /*#__PURE__*/React.createElement("figcaption", {
2058
- className: styles$e.attribution
2408
+ className: styles$f.attribution
2059
2409
  }, /*#__PURE__*/React.createElement(EditableText, {
2060
2410
  value: configuration.attribution,
2061
2411
  contentElementId: contentElementId,
@@ -2065,24 +2415,21 @@ function Quote(_ref) {
2065
2415
  });
2066
2416
  },
2067
2417
  onlyParagraphs: true,
2068
- scaleCategory: "quoteAttribution",
2418
+ scaleCategory: getTextScaleCategory(configuration, 'Attribution'),
2069
2419
  placeholder: t('pageflow_scrolled.inline_editing.type_attribution')
2070
2420
  })));
2071
2421
  }
2072
-
2073
- function getTextScaleCategory(configuration) {
2422
+ function getTextScaleCategory(configuration, suffix) {
2423
+ var base = "quote".concat(suffix);
2074
2424
  switch (configuration.textSize) {
2075
2425
  case 'large':
2076
- return 'quoteText-lg';
2077
-
2426
+ return "".concat(base, "-lg");
2078
2427
  case 'small':
2079
- return 'quoteText-sm';
2080
-
2428
+ return "".concat(base, "-sm");
2081
2429
  case 'verySmall':
2082
- return 'quoteText-xs';
2083
-
2430
+ return "".concat(base, "-xs");
2084
2431
  default:
2085
- return 'quoteText-md';
2432
+ return "".concat(base, "-md");
2086
2433
  }
2087
2434
  }
2088
2435
 
@@ -2090,52 +2437,18 @@ frontend.contentElementTypes.register('quote', {
2090
2437
  component: Quote
2091
2438
  });
2092
2439
 
2093
- function ownKeys(object, enumerableOnly) {
2094
- var keys = Object.keys(object);
2095
-
2096
- if (Object.getOwnPropertySymbols) {
2097
- var symbols = Object.getOwnPropertySymbols(object);
2098
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
2099
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2100
- });
2101
- keys.push.apply(keys, symbols);
2102
- }
2103
-
2104
- return keys;
2105
- }
2106
-
2107
- function _objectSpread2(target) {
2108
- for (var i = 1; i < arguments.length; i++) {
2109
- var source = arguments[i] != null ? arguments[i] : {};
2110
-
2111
- if (i % 2) {
2112
- ownKeys(Object(source), true).forEach(function (key) {
2113
- _defineProperty(target, key, source[key]);
2114
- });
2115
- } else if (Object.getOwnPropertyDescriptors) {
2116
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2117
- } else {
2118
- ownKeys(Object(source)).forEach(function (key) {
2119
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2120
- });
2121
- }
2122
- }
2123
-
2124
- return target;
2125
- }
2126
-
2127
- var styles$f = {"button":"ScrollButton-module_button__3DeL7","left":"ScrollButton-module_left__3uACk","right":"ScrollButton-module_right__25CLO","disabled":"ScrollButton-module_disabled__3fQR1","icon":"ScrollButton-module_icon__35w1l"};
2440
+ var styles$g = {"button":"ScrollButton-module_button__3DeL7","left":"ScrollButton-module_left__3uACk","right":"ScrollButton-module_right__25CLO","disabled":"ScrollButton-module_disabled__3fQR1","icon":"ScrollButton-module_icon__35w1l"};
2128
2441
 
2129
2442
  var size = 40;
2130
2443
  function ScrollButton(_ref) {
2131
2444
  var direction = _ref.direction,
2132
- disabled = _ref.disabled,
2133
- onClick = _ref.onClick;
2445
+ disabled = _ref.disabled,
2446
+ onClick = _ref.onClick;
2134
2447
  return /*#__PURE__*/React.createElement("button", {
2135
- className: classNames(styles$f.button, styles$f[direction], _defineProperty({}, styles$f.disabled, disabled)),
2448
+ className: classNames(styles$g.button, styles$g[direction], _defineProperty({}, styles$g.disabled, disabled)),
2136
2449
  onClick: onClick
2137
2450
  }, /*#__PURE__*/React.createElement("div", {
2138
- className: styles$f.icon
2451
+ className: styles$g.icon
2139
2452
  }, /*#__PURE__*/React.createElement(ThemeIcon, {
2140
2453
  name: direction === 'left' ? 'arrowLeft' : 'arrowRight',
2141
2454
  width: size,
@@ -2145,7 +2458,7 @@ function ScrollButton(_ref) {
2145
2458
 
2146
2459
  function useIntersectionObserver(_ref) {
2147
2460
  var threshold = _ref.threshold,
2148
- onVisibleIndexChange = _ref.onVisibleIndexChange;
2461
+ onVisibleIndexChange = _ref.onVisibleIndexChange;
2149
2462
  var containerRef = useRef();
2150
2463
  var childRefs = useRef([]);
2151
2464
  var observerRef = useRef();
@@ -2156,8 +2469,7 @@ function useIntersectionObserver(_ref) {
2156
2469
  var entryIndex = Array.from(containerElement.children).findIndex(function (child) {
2157
2470
  return child === entry.target;
2158
2471
  });
2159
-
2160
- if (entry.isIntersecting) {
2472
+ if (entry.isIntersecting && entry.intersectionRatio >= threshold) {
2161
2473
  onVisibleIndexChange(entryIndex);
2162
2474
  }
2163
2475
  });
@@ -2174,7 +2486,6 @@ function useIntersectionObserver(_ref) {
2174
2486
  observer.disconnect();
2175
2487
  };
2176
2488
  }, [threshold, onVisibleIndexChange]);
2177
-
2178
2489
  var setChildRef = function setChildRef(index) {
2179
2490
  return function (ref) {
2180
2491
  if (observerRef.current) {
@@ -2184,37 +2495,34 @@ function useIntersectionObserver(_ref) {
2184
2495
  observerRef.current.unobserve(childRefs.current[index]);
2185
2496
  }
2186
2497
  }
2187
-
2188
2498
  childRefs.current[index] = ref;
2189
2499
  };
2190
2500
  };
2191
-
2192
2501
  return {
2193
2502
  containerRef: containerRef,
2194
2503
  setChildRef: setChildRef
2195
2504
  };
2196
2505
  }
2197
2506
 
2198
- var styles$g = {"lightContentTextColor":"var(--theme-light-content-text-color, #fff)","contentLinkColor":"var(--content-link-color)","wrapper":"ImageGallery-module_wrapper__2H9en","wide":"ImageGallery-module_wide__xGLuJ","customMargin":"ImageGallery-module_customMargin__1VxM6","button":"ImageGallery-module_button__35bDf","leftButton":"ImageGallery-module_leftButton__3V-J6 ImageGallery-module_button__35bDf","rightButton":"ImageGallery-module_rightButton__ba0q5 ImageGallery-module_button__35bDf","items":"ImageGallery-module_items__1q4QG","item":"ImageGallery-module_item__iqvfP","current":"ImageGallery-module_current__2Mm11","figure":"ImageGallery-module_figure__3zkJb","placeholder":"ImageGallery-module_placeholder__39Vq4"};
2507
+ var styles$h = {"lightContentTextColor":"var(--theme-light-content-text-color, #fff)","wrapper":"ImageGallery-module_wrapper__2H9en","wide":"ImageGallery-module_wide__xGLuJ","customMargin":"ImageGallery-module_customMargin__1VxM6","clip":"ImageGallery-module_clip__f_FU4","full":"ImageGallery-module_full__Qu2GB","button":"ImageGallery-module_button__35bDf","leftButton":"ImageGallery-module_leftButton__3V-J6 ImageGallery-module_button__35bDf","rightButton":"ImageGallery-module_rightButton__ba0q5 ImageGallery-module_button__35bDf","paginationIndicator":"ImageGallery-module_paginationIndicator__2F5Y0","items":"ImageGallery-module_items__1q4QG","item":"ImageGallery-module_item__iqvfP","current":"ImageGallery-module_current__2Mm11","figure":"ImageGallery-module_figure__3zkJb","placeholder":"ImageGallery-module_placeholder__39Vq4"};
2199
2508
 
2509
+ var _excluded$5 = ["imageFile", "portraitImageFile"];
2200
2510
  function ImageGallery(_ref) {
2201
2511
  var configuration = _ref.configuration,
2202
- contentElementId = _ref.contentElementId,
2203
- contentElementWidth = _ref.contentElementWidth,
2204
- customMargin = _ref.customMargin;
2205
-
2512
+ contentElementId = _ref.contentElementId,
2513
+ contentElementWidth = _ref.contentElementWidth,
2514
+ customMargin = _ref.customMargin;
2206
2515
  var _useState = useState(-1),
2207
- _useState2 = _slicedToArray(_useState, 2),
2208
- visibleIndex = _useState2[0],
2209
- setVisibleIndex = _useState2[1];
2210
-
2516
+ _useState2 = _slicedToArray(_useState, 2),
2517
+ visibleIndex = _useState2[0],
2518
+ setVisibleIndex = _useState2[1];
2211
2519
  var isPhonePlatform = usePhonePlatform();
2212
2520
  return /*#__PURE__*/React.createElement(FullscreenViewer, {
2213
2521
  contentElementId: contentElementId,
2214
2522
  renderChildren: function renderChildren(_ref2) {
2215
2523
  var enterFullscreen = _ref2.enterFullscreen,
2216
- isFullscreen = _ref2.isFullscreen;
2217
- return /*#__PURE__*/React.createElement(Scroller, {
2524
+ isFullscreen = _ref2.isFullscreen;
2525
+ return /*#__PURE__*/React.createElement(Scroller$1, {
2218
2526
  customMargin: customMargin,
2219
2527
  configuration: configuration,
2220
2528
  contentElementWidth: contentElementWidth,
@@ -2227,7 +2535,7 @@ function ImageGallery(_ref) {
2227
2535
  },
2228
2536
  renderFullscreenChildren: function renderFullscreenChildren(_ref3) {
2229
2537
  var exitFullscreen = _ref3.exitFullscreen;
2230
- return /*#__PURE__*/React.createElement(Scroller, {
2538
+ return /*#__PURE__*/React.createElement(Scroller$1, {
2231
2539
  configuration: configuration,
2232
2540
  contentElementWidth: contentElementWidth,
2233
2541
  visibleIndex: visibleIndex,
@@ -2239,47 +2547,40 @@ function ImageGallery(_ref) {
2239
2547
  }
2240
2548
  });
2241
2549
  }
2242
-
2243
- function Scroller(_ref4) {
2550
+ function Scroller$1(_ref4) {
2244
2551
  var visibleIndex = _ref4.visibleIndex,
2245
- setVisibleIndex = _ref4.setVisibleIndex,
2246
- displayFullscreenToggle = _ref4.displayFullscreenToggle,
2247
- customMargin = _ref4.customMargin,
2248
- onFullscreenEnter = _ref4.onFullscreenEnter,
2249
- onFullscreenExit = _ref4.onFullscreenExit,
2250
- onBump = _ref4.onBump,
2251
- configuration = _ref4.configuration,
2252
- contentElementWidth = _ref4.contentElementWidth,
2253
- controlled = _ref4.controlled;
2552
+ setVisibleIndex = _ref4.setVisibleIndex,
2553
+ displayFullscreenToggle = _ref4.displayFullscreenToggle,
2554
+ customMargin = _ref4.customMargin,
2555
+ onFullscreenEnter = _ref4.onFullscreenEnter,
2556
+ onFullscreenExit = _ref4.onFullscreenExit,
2557
+ onBump = _ref4.onBump,
2558
+ configuration = _ref4.configuration,
2559
+ contentElementWidth = _ref4.contentElementWidth,
2560
+ controlled = _ref4.controlled;
2254
2561
  var lastVisibleIndex = useRef(null);
2255
-
2256
2562
  var _useContentElementEdi = useContentElementEditorState(),
2257
- isSelected = _useContentElementEdi.isSelected,
2258
- isEditable = _useContentElementEdi.isEditable;
2259
-
2563
+ isSelected = _useContentElementEdi.isSelected,
2564
+ isEditable = _useContentElementEdi.isEditable;
2260
2565
  var items = configuration.items || [];
2261
-
2262
2566
  if (!items.length && isEditable) {
2263
2567
  items = [{
2264
2568
  id: 1,
2265
2569
  placeholder: true
2266
2570
  }];
2267
2571
  }
2268
-
2269
2572
  var onVisibleIndexChange = useCallback(function (index) {
2270
2573
  if (!controlled) {
2271
2574
  lastVisibleIndex.current = index;
2272
2575
  setVisibleIndex(index);
2273
2576
  }
2274
2577
  }, [controlled, setVisibleIndex]);
2275
-
2276
2578
  var _useIntersectionObser = useIntersectionObserver({
2277
- onVisibleIndexChange: onVisibleIndexChange,
2278
- threshold: 0.7
2279
- }),
2280
- scrollerRef = _useIntersectionObser.containerRef,
2281
- setChildRef = _useIntersectionObser.setChildRef;
2282
-
2579
+ onVisibleIndexChange: onVisibleIndexChange,
2580
+ threshold: 0.7
2581
+ }),
2582
+ scrollerRef = _useIntersectionObser.containerRef,
2583
+ setChildRef = _useIntersectionObser.setChildRef;
2283
2584
  useEffect(function () {
2284
2585
  if (lastVisibleIndex.current !== visibleIndex && visibleIndex >= 0 && (controlled || lastVisibleIndex.current === null)) {
2285
2586
  lastVisibleIndex.current = visibleIndex;
@@ -2290,23 +2591,21 @@ function Scroller(_ref4) {
2290
2591
  scroller.style.scrollBehavior = null;
2291
2592
  }
2292
2593
  }, [visibleIndex, scrollerRef, controlled]);
2293
-
2294
2594
  function scrollBy(delta) {
2595
+ scrollTo(visibleIndex + delta);
2596
+ }
2597
+ function scrollTo(index) {
2295
2598
  var scroller = scrollerRef.current;
2296
- var child = scroller.children[visibleIndex + delta];
2297
-
2599
+ var child = scroller.children[index];
2298
2600
  if (child) {
2299
2601
  scrollerRef.current.scrollTo(child.offsetLeft - scroller.offsetLeft, 0);
2300
2602
  }
2301
2603
  }
2302
-
2303
2604
  function handleClick(event) {
2304
2605
  if (isEditable && !isSelected) {
2305
2606
  return;
2306
2607
  }
2307
-
2308
2608
  var rect = scrollerRef.current.getBoundingClientRect();
2309
-
2310
2609
  if ((event.pageX - rect.x) / rect.width < 0.5) {
2311
2610
  if (visibleIndex > 0) {
2312
2611
  scrollBy(-1);
@@ -2321,11 +2620,10 @@ function Scroller(_ref4) {
2321
2620
  }
2322
2621
  }
2323
2622
  }
2324
-
2325
2623
  return /*#__PURE__*/React.createElement("div", {
2326
- className: classNames(styles$g.wrapper, _defineProperty({}, styles$g.wide, contentElementWidth === contentElementWidths.lg || contentElementWidth === contentElementWidths.xl), _defineProperty({}, styles$g.customMargin, customMargin))
2624
+ className: classNames(styles$h.wrapper, _defineProperty({}, styles$h.wide, contentElementWidth === contentElementWidths.lg || contentElementWidth === contentElementWidths.xl), _defineProperty({}, styles$h.full, contentElementWidth === contentElementWidths.full), _defineProperty({}, styles$h.clip, configuration.hidePeeks), _defineProperty({}, styles$h.customMargin, customMargin))
2327
2625
  }, /*#__PURE__*/React.createElement("div", {
2328
- className: styles$g.leftButton
2626
+ className: styles$h.leftButton
2329
2627
  }, /*#__PURE__*/React.createElement(ScrollButton, {
2330
2628
  direction: "left",
2331
2629
  disabled: visibleIndex <= 0,
@@ -2333,7 +2631,7 @@ function Scroller(_ref4) {
2333
2631
  return scrollBy(-1);
2334
2632
  }
2335
2633
  })), /*#__PURE__*/React.createElement("div", {
2336
- className: styles$g.rightButton
2634
+ className: styles$h.rightButton
2337
2635
  }, /*#__PURE__*/React.createElement(ScrollButton, {
2338
2636
  direction: "right",
2339
2637
  disabled: visibleIndex >= items.length - 1,
@@ -2341,7 +2639,7 @@ function Scroller(_ref4) {
2341
2639
  return scrollBy(1);
2342
2640
  }
2343
2641
  })), /*#__PURE__*/React.createElement("div", {
2344
- className: styles$g.items,
2642
+ className: styles$h.items,
2345
2643
  ref: scrollerRef
2346
2644
  }, items.map(function (item, index) {
2347
2645
  return /*#__PURE__*/React.createElement(Item, {
@@ -2349,53 +2647,92 @@ function Scroller(_ref4) {
2349
2647
  ref: setChildRef(index),
2350
2648
  item: item,
2351
2649
  current: index === visibleIndex,
2352
- captions: configuration.captions || {},
2650
+ configuration: configuration,
2353
2651
  onClick: handleClick
2354
2652
  }, displayFullscreenToggle && /*#__PURE__*/React.createElement(ToggleFullscreenCornerButton, {
2355
2653
  isFullscreen: false,
2356
2654
  onEnter: onFullscreenEnter
2357
2655
  }));
2656
+ })), configuration.displayPaginationIndicator && /*#__PURE__*/React.createElement("div", {
2657
+ className: styles$h.paginationIndicator
2658
+ }, /*#__PURE__*/React.createElement(PaginationIndicator, {
2659
+ itemCount: items.length,
2660
+ currentIndex: visibleIndex,
2661
+ scrollerRef: scrollerRef,
2662
+ navAriaLabelTranslationKey: "pageflow_scrolled.public.image_gallery_pagination",
2663
+ itemAriaLabelTranslationKey: "pageflow_scrolled.public.go_to_image_gallery_item",
2664
+ onItemClick: function onItemClick(index) {
2665
+ return scrollTo(index);
2666
+ }
2358
2667
  })));
2359
2668
  }
2360
-
2361
2669
  var Item = forwardRef(function (_ref5, ref) {
2362
- var _classNames3;
2363
-
2364
2670
  var item = _ref5.item,
2365
- captions = _ref5.captions,
2366
- current = _ref5.current,
2367
- onClick = _ref5.onClick,
2368
- children = _ref5.children;
2369
- var updateConfiguration = useContentElementConfigurationUpdate();
2370
-
2371
- var _useContentElementLif = useContentElementLifecycle(),
2372
- shouldLoad = _useContentElementLif.shouldLoad;
2373
-
2374
- var caption = captions[item.id];
2671
+ configuration = _ref5.configuration,
2672
+ current = _ref5.current,
2673
+ onClick = _ref5.onClick,
2674
+ children = _ref5.children;
2375
2675
  var imageFile = useFileWithInlineRights({
2376
2676
  configuration: item,
2377
2677
  collectionName: 'imageFiles',
2378
2678
  propertyName: 'image'
2379
2679
  });
2380
-
2680
+ var portraitImageFile = useFileWithInlineRights({
2681
+ configuration: item,
2682
+ collectionName: 'imageFiles',
2683
+ propertyName: 'portraitImage'
2684
+ });
2685
+ var ItemImageComponent = portraitImageFile ? OrientationAwareItemImage : ItemImageWithCaption;
2686
+ return /*#__PURE__*/React.createElement("div", {
2687
+ className: classNames(styles$h.item, _defineProperty(_defineProperty({}, styles$h.current, current), styles$h.placeholder, item.placeholder)),
2688
+ ref: ref
2689
+ }, /*#__PURE__*/React.createElement("div", {
2690
+ className: styles$h.figure
2691
+ }, /*#__PURE__*/React.createElement(ItemImageComponent, {
2692
+ item: item,
2693
+ imageFile: imageFile,
2694
+ portraitImageFile: portraitImageFile,
2695
+ configuration: configuration,
2696
+ current: current,
2697
+ onClick: onClick,
2698
+ children: children
2699
+ })));
2700
+ });
2701
+ function OrientationAwareItemImage(_ref6) {
2702
+ var imageFile = _ref6.imageFile,
2703
+ portraitImageFile = _ref6.portraitImageFile,
2704
+ props = _objectWithoutProperties(_ref6, _excluded$5);
2705
+ var portraitOrientation = usePortraitOrientation();
2706
+ imageFile = portraitOrientation && portraitImageFile ? portraitImageFile : imageFile;
2707
+ return /*#__PURE__*/React.createElement(ItemImageWithCaption, Object.assign({
2708
+ imageFile: imageFile
2709
+ }, props));
2710
+ }
2711
+ function ItemImageWithCaption(_ref7) {
2712
+ var item = _ref7.item,
2713
+ imageFile = _ref7.imageFile,
2714
+ configuration = _ref7.configuration,
2715
+ current = _ref7.current,
2716
+ onClick = _ref7.onClick,
2717
+ children = _ref7.children;
2718
+ var _useContentElementLif = useContentElementLifecycle(),
2719
+ shouldLoad = _useContentElementLif.shouldLoad;
2720
+ var updateConfiguration = useContentElementConfigurationUpdate();
2721
+ var captions = configuration.captions || {};
2722
+ var caption = captions[item.id];
2381
2723
  var handleCaptionChange = function handleCaptionChange(caption) {
2382
2724
  updateConfiguration({
2383
2725
  captions: _objectSpread2(_objectSpread2({}, captions), {}, _defineProperty({}, item.id, caption))
2384
2726
  });
2385
2727
  };
2386
-
2387
- return /*#__PURE__*/React.createElement("div", {
2388
- className: classNames(styles$g.item, (_classNames3 = {}, _defineProperty(_classNames3, styles$g.current, current), _defineProperty(_classNames3, styles$g.placeholder, item.placeholder), _classNames3)),
2389
- ref: ref
2390
- }, /*#__PURE__*/React.createElement("div", {
2391
- className: styles$g.figure
2392
- }, /*#__PURE__*/React.createElement(FitViewport, {
2728
+ return /*#__PURE__*/React.createElement(FitViewport, {
2393
2729
  file: imageFile,
2394
2730
  aspectRatio: imageFile ? undefined : 0.75,
2395
2731
  scale: 0.8,
2396
2732
  opaque: !imageFile
2397
2733
  }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(Figure, {
2398
2734
  caption: caption,
2735
+ variant: configuration.captionVariant,
2399
2736
  onCaptionChange: handleCaptionChange,
2400
2737
  addCaptionButtonVisible: current && !item.placeholder,
2401
2738
  addCaptionButtonPosition: "inside"
@@ -2405,22 +2742,61 @@ var Item = forwardRef(function (_ref5, ref) {
2405
2742
  imageFile: imageFile,
2406
2743
  load: shouldLoad
2407
2744
  })), children, /*#__PURE__*/React.createElement(InlineFileRights, {
2745
+ configuration: configuration,
2408
2746
  context: "insideElement",
2409
2747
  items: [{
2410
2748
  file: imageFile,
2411
2749
  label: 'image'
2412
2750
  }]
2413
2751
  })))), /*#__PURE__*/React.createElement(InlineFileRights, {
2752
+ configuration: configuration,
2414
2753
  context: "afterElement",
2415
2754
  items: [{
2416
2755
  file: imageFile,
2417
2756
  label: 'image'
2418
2757
  }]
2419
- }))));
2420
- });
2758
+ }));
2759
+ }
2421
2760
 
2422
2761
  frontend.contentElementTypes.register('imageGallery', {
2423
2762
  component: ImageGallery,
2424
2763
  lifecycle: true,
2425
2764
  customMargin: true
2426
2765
  });
2766
+
2767
+ var styles$i = {"breakpoint-md":"(min-width: 768px)","table":"InfoTable-module_table__3_afx","center":"InfoTable-module_center__2qGe6","labelColumnAlign-left":"InfoTable-module_labelColumnAlign-left__1k-J2","valueColumnAlign-left":"InfoTable-module_valueColumnAlign-left__3beY0","singleColumnAlign-left":"InfoTable-module_singleColumnAlign-left__27P3d","labelColumnAlign-center":"InfoTable-module_labelColumnAlign-center__3XIqd","valueColumnAlign-center":"InfoTable-module_valueColumnAlign-center__UUf8M","singleColumnAlign-center":"InfoTable-module_singleColumnAlign-center__3b_77","labelColumnAlign-right":"InfoTable-module_labelColumnAlign-right__3bm_l","valueColumnAlign-right":"InfoTable-module_valueColumnAlign-right__2PrQt","singleColumnAlign-right":"InfoTable-module_singleColumnAlign-right__194EU","selected":"InfoTable-module_selected__unFZr"};
2768
+
2769
+ function InfoTable(_ref) {
2770
+ var configuration = _ref.configuration,
2771
+ sectionProps = _ref.sectionProps;
2772
+ var _useContentElementEdi = useContentElementEditorState(),
2773
+ isSelected = _useContentElementEdi.isSelected;
2774
+ var updateConfiguration = useContentElementConfigurationUpdate();
2775
+ var _useI18n = useI18n({
2776
+ locale: 'ui'
2777
+ }),
2778
+ t = _useI18n.t;
2779
+ return /*#__PURE__*/React.createElement("div", {
2780
+ style: {
2781
+ '--label-color': paletteColor(configuration.labelColor),
2782
+ '--value-color': paletteColor(configuration.valueColor)
2783
+ }
2784
+ }, /*#__PURE__*/React.createElement(EditableTable, {
2785
+ className: classNames(styles$i.table, styles$i["labelColumnAlign-".concat(configuration.labelColumnAlign)], styles$i["valueColumnAlign-".concat(configuration.valueColumnAlign)], styles$i["singleColumnAlign-".concat(configuration.singleColumnAlign)], _defineProperty(_defineProperty({}, styles$i.selected, isSelected), styles$i.center, sectionProps.layout === 'centerRagged')),
2786
+ labelScaleCategory: "infoTableLabel",
2787
+ valueScaleCategory: "infoTableValue",
2788
+ labelPlaceholder: t('pageflow_scrolled.inline_editing.type_text'),
2789
+ valuePlaceholder: t('pageflow_scrolled.inline_editing.type_text'),
2790
+ value: configuration.value,
2791
+ stackedInPhoneLayout: configuration.singleColumnInPhoneLayout,
2792
+ onChange: function onChange(value) {
2793
+ return updateConfiguration({
2794
+ value: value
2795
+ });
2796
+ }
2797
+ }));
2798
+ }
2799
+
2800
+ frontend.contentElementTypes.register('infoTable', {
2801
+ component: InfoTable
2802
+ });