pageflow 15.2.0 → 15.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +89 -83
- data/README.md +2 -3
- data/admins/pageflow/accounts.rb +1 -98
- data/admins/pageflow/entry.rb +21 -1
- data/admins/pageflow/entry_templates.rb +140 -0
- data/admins/pageflow/membership.rb +12 -0
- data/admins/pageflow/user.rb +5 -5
- data/app/assets/javascripts/pageflow/admin/accounts.js +1 -1
- data/app/assets/javascripts/pageflow/admin/entries.js +65 -0
- data/app/assets/javascripts/pageflow/admin/users.js +1 -1
- data/app/assets/javascripts/pageflow/asset_urls.js.erb +1 -0
- data/app/assets/javascripts/pageflow/base.js +0 -12
- data/app/assets/javascripts/pageflow/components.js +2 -6
- data/app/assets/javascripts/pageflow/dist/ui.js +178 -55
- data/app/assets/javascripts/pageflow/editor/vendor.js +1 -0
- data/app/assets/javascripts/pageflow/vendor.js +12 -10
- data/app/assets/stylesheets/pageflow/base.scss +0 -7
- data/app/assets/stylesheets/pageflow/editor/base.scss +5 -2
- data/app/assets/stylesheets/pageflow/editor/composables.scss +5 -1
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +44 -55
- data/app/assets/stylesheets/pageflow/editor/help.scss +2 -2
- data/app/assets/stylesheets/pageflow/editor/select_button.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +1 -1
- data/app/assets/stylesheets/pageflow/entries.scss +1 -1
- data/app/assets/stylesheets/pageflow/loading_spinner.scss +4 -1
- data/app/assets/stylesheets/pageflow/navigation_mobile.scss +4 -4
- data/app/assets/stylesheets/pageflow/themes/default/anchors.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/page.scss +7 -0
- data/app/assets/stylesheets/pageflow/themes/default/page/anchors.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/control_bar.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/info_box.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/shared/menu_bar.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/control_bar.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/info_box.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/quality_menu.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/waveform/wave.scss +1 -1
- data/app/assets/stylesheets/pageflow/ui/forms.scss +9 -2
- data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.scss +2 -2
- data/app/assets/stylesheets/pageflow/ui/tooltip.scss +17 -3
- data/app/helpers/pageflow/admin/entries_helper.rb +16 -0
- data/app/helpers/pageflow/structured_data_helper.rb +0 -2
- data/app/models/pageflow/account.rb +21 -1
- data/app/models/pageflow/account_role_query.rb +1 -1
- data/app/models/pageflow/chapter.rb +3 -9
- data/app/models/pageflow/entry.rb +9 -2
- data/app/models/pageflow/entry_duplicate.rb +1 -0
- data/app/models/pageflow/entry_template.rb +16 -2
- data/app/models/pageflow/managed_user_query.rb +1 -1
- data/app/models/pageflow/page.rb +1 -4
- data/app/models/pageflow/revision.rb +0 -4
- data/app/models/pageflow/storyline.rb +2 -9
- data/app/policies/pageflow/account_policy.rb +10 -0
- data/app/policies/pageflow/entry_template_policy.rb +5 -1
- data/app/policies/pageflow/folder_policy.rb +2 -2
- data/app/policies/pageflow/membership_policy.rb +2 -2
- data/app/policies/pageflow/theming_policy.rb +2 -2
- data/app/policies/pageflow/user_policy.rb +1 -1
- data/app/views/admin/accounts/_entry_template_details.html.arb +7 -5
- data/app/views/admin/accounts/_form.html.erb +3 -49
- data/app/views/admin/entries/_attributes_table.html.arb +5 -0
- data/app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder +2 -0
- data/app/views/admin/entries/entry_types.json.jbuilder +4 -0
- data/app/views/admin/entry_templates/_form.html.erb +58 -0
- data/app/views/admin/users/_not_allowed_to_see_user_quota.html.erb +3 -0
- data/app/views/components/pageflow/admin/entry_templates_tab.rb +48 -0
- data/app/views/pageflow/admin/initial_passwords/edit.html.erb +2 -1
- data/app/views/pageflow/admin/users/_quota_exhausted.html.erb +1 -1
- data/app/views/pageflow/themes/_theme.json.jbuilder +1 -1
- data/app/views/pageflow/video_files/_video_file.json.jbuilder +8 -1
- data/config/initializers/admin_resource_tabs.rb +5 -0
- data/config/initializers/help_entries.rb +1 -5
- data/config/initializers/revision_components.rb +5 -0
- data/config/locales/de.yml +88 -155
- data/config/locales/en.yml +79 -143
- data/db/migrate/20200515112500_add_constraints_to_entry_templates.rb +21 -0
- data/db/migrate/20200807135200_rename_pageflow_entry_template_entry_type_to_entry_type_name.rb +7 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/components.js +7 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +1528 -1349
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +9258 -0
- data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-client.js +1 -1
- data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-server.js +3 -3
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/frontend.js +6 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/server_rendering.js +9 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/vendor.js +9 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/videojs.js +6 -0
- data/entry_types/paged/app/controllers/pageflow_paged/application_controller.rb +2 -2
- data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/page_background_asset_helper.rb +4 -3
- data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/react_server_side_rendering_helper.rb +23 -2
- data/entry_types/paged/app/views/layouts/pageflow_paged/_loading_spinner_inline_script.html.erb +1 -0
- data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +3 -3
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +4 -2
- data/entry_types/paged/app/views/pageflow_paged/entries/_entry.html.erb +1 -1
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/page_background_asset/_element.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/_widget.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/page.html.erb +0 -0
- data/entry_types/paged/config/initializers/features.rb +1 -1
- data/entry_types/paged/config/initializers/help_entries.rb +17 -0
- data/entry_types/paged/config/locales/new/help.de.yml +162 -0
- data/entry_types/paged/config/locales/new/help.en.yml +153 -0
- data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -0
- data/entry_types/paged/lib/pageflow_paged/plugin.rb +5 -1
- data/entry_types/paged/lib/pageflow_paged/react.rb +12 -0
- data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/page_type.rb +2 -2
- data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/widget_type.rb +2 -2
- data/entry_types/paged/lib/tasks/pageflow_paged_tasks.rake +7 -0
- data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react-server.js +20613 -0
- data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react.js +21495 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/dash.all.min.js +0 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs-dash.js +0 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs.js +0 -0
- data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react-server.js +24 -0
- data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react.js +24 -0
- data/entry_types/scrolled/app/assets/javascripts/pageflow_scrolled/legacy.js +0 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +14 -4
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +10 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +7 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/favicon_helper.rb +21 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +40 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +36 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +3 -9
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +37 -2
- data/entry_types/scrolled/app/models/pageflow_scrolled/section.rb +3 -9
- data/entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb +1 -9
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/content_elements/batch.json.jbuilder +2 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -7
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/_global_notices.html.erb +10 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +28 -11
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +3 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +8 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/favicons/_entry.html.erb +10 -0
- data/entry_types/scrolled/config/initializers/help_entries.rb +16 -0
- data/entry_types/scrolled/config/locales/de.yml +669 -0
- data/entry_types/scrolled/config/locales/en.yml +488 -0
- data/entry_types/scrolled/config/routes.rb +1 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +76 -6
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-192x192.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-512x512.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/apple-touch-icon.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/browserconfig.xml +9 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-16x16.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-32x32.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon.ico +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/mstile-150x150.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/safari-pinned-tab.svg +46 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/site.webmanifest +19 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDesktop.svg +56 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoMobile.svg +22 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/unmute.mp3 +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt +26 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +4 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +3 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +90 -30
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/create_bundle_symlinks_for_yarn.rake +32 -0
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +8 -0
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +173 -0
- data/entry_types/scrolled/package/contentElements-editor.js +541 -0
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements-frontend.js +1169 -0
- data/entry_types/scrolled/package/editor.js +2930 -371
- data/entry_types/scrolled/package/frontend-server.js +228 -0
- data/entry_types/scrolled/package/frontend/EditableText-7093fd0e.js +1071 -0
- data/entry_types/scrolled/package/frontend/Viewer-e49e7807.js +387 -0
- data/entry_types/scrolled/package/frontend/Wavesurfer-0adf5667.js +375 -0
- data/entry_types/scrolled/package/frontend/components-6a6793ca.js +2534 -0
- data/entry_types/scrolled/package/frontend/getPrototypeOf-63c7c8e8.js +86 -0
- data/entry_types/scrolled/package/frontend/i18n-4dc6c377.js +1092 -0
- data/entry_types/scrolled/package/frontend/index.css +9 -0
- data/entry_types/scrolled/package/frontend/index.js +5686 -0
- data/entry_types/scrolled/package/frontend/useBrowserFeature-91a4c29d.js +33 -0
- data/entry_types/scrolled/package/package.json +30 -9
- data/entry_types/scrolled/spec/fixtures/audio.m4a +0 -0
- data/entry_types/scrolled/spec/fixtures/video.mp4 +0 -0
- data/lib/generators/pageflow/initializer/templates/pageflow.rb +14 -9
- data/lib/pageflow/ability_mixin.rb +14 -2
- data/lib/pageflow/configuration.rb +6 -5
- data/lib/pageflow/entry_export_import/revision_serialization.rb +15 -13
- data/lib/pageflow/entry_export_import/revision_serialization/import.rb +18 -26
- data/lib/pageflow/entry_type_configuration.rb +2 -0
- data/lib/pageflow/global_config_api.rb +5 -4
- data/lib/pageflow/nested_revision_component.rb +49 -0
- data/lib/pageflow/react.rb +4 -2
- data/lib/pageflow/revision_component.rb +6 -2
- data/lib/pageflow/themes.rb +4 -0
- data/lib/pageflow/user_mixin.rb +2 -1
- data/lib/pageflow/version.rb +1 -1
- data/{packages/pageflow → package}/config/jest/index.js +8 -2
- data/{packages/pageflow → package}/config/jest/transformers/jst.js +0 -0
- data/{packages/pageflow → package}/config/jest/transformers/upwardBabel.js +0 -0
- data/{packages/pageflow → package}/config/webpack.js +7 -0
- data/{packages/pageflow → package}/editor.js +482 -1130
- data/package/frontend.js +2553 -0
- data/{packages/pageflow → package}/package.json +3 -0
- data/{packages/pageflow → package}/testHelpers.js +114 -13
- data/{packages/pageflow → package}/ui.js +178 -55
- data/spec/factories/accounts.rb +3 -1
- data/spec/factories/entry_templates.rb +1 -0
- data/spec/factories/published_entries.rb +6 -1
- data/spec/factories/test_revision_components.rb +4 -0
- metadata +96 -37
- data/app/assets/javascripts/pageflow/dist/editor.js +0 -11890
- data/app/assets/javascripts/pageflow/dist/frontend.js +0 -5800
- data/app/assets/javascripts/pageflow/videojs.js +0 -6
- data/config/initializers/entry_types.rb +0 -4
- data/entry_types/scrolled/config/locales/new/de.yml +0 -269
- data/entry_types/scrolled/config/locales/new/en.yml +0 -264
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +0 -96
- data/entry_types/scrolled/package/frontend.js +0 -2879
- data/packages/pageflow/config/jest/transformers/cssModules.js +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
.Heading-module_root__33TFw{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;word-wrap:break-word;margin-top:.2em;margin-bottom:0;padding-top:.3em}@media (min-width:951px){.Heading-module_right__1TJKF{text-align:right}}.Heading-module_center__38lDY{text-align:center}@media (orientation:landscape){.Heading-module_first__1PMJX{padding-top:25%}}.BeforeAfter-module_sliderStart__2C5cN{background-color:#fff;position:absolute;z-index:1}.BeforeAfter-module_container__2Lm06{height:100%;--frame1pos:-8;--frame2pos:16;--frame3pos:-32;--frame4pos:32;--frame1px:calc(var(--frame1pos)*1px);--frame2px:calc(var(--frame2pos)*1px);--frame3px:calc(var(--frame3pos)*1px);--frame4px:calc(var(--frame4pos)*1px)}.BeforeAfter-module_container__2Lm06>div{height:100%!important}.BeforeAfter-module_container__2Lm06.BeforeAfter-module_wiggle__3nVSe>div>div:nth-child(3){-webkit-animation:BeforeAfter-module_SliderLeftRightShake__2mcn5 1.5s cubic-bezier(.36,.07,.19,.97);animation:BeforeAfter-module_SliderLeftRightShake__2mcn5 1.5s cubic-bezier(.36,.07,.19,.97)}.BeforeAfter-module_container__2Lm06.BeforeAfter-module_wiggle__3nVSe div img:nth-child(2){-webkit-animation:BeforeAfter-module_BeforeImageLeftRightShake__38m9V 1.5s cubic-bezier(.36,.07,.19,.97);animation:BeforeAfter-module_BeforeImageLeftRightShake__38m9V 1.5s cubic-bezier(.36,.07,.19,.97)}.BeforeAfter-module_container__2Lm06 div div:nth-child(4) div{transition:opacity .1s ease-out .3s!important}.BeforeAfter-module_container__2Lm06.BeforeAfter-module_wiggle__3nVSe div img:first-child{-webkit-animation:BeforeAfter-module_AfterImageLeftRightShake__3WMf1 1.5s cubic-bezier(.36,.07,.19,.97);animation:BeforeAfter-module_AfterImageLeftRightShake__3WMf1 1.5s cubic-bezier(.36,.07,.19,.97)}.BeforeAfter-module_container__2Lm06 div div:nth-child(5) div{transition:opacity .1s ease-out .3s!important}@-webkit-keyframes BeforeAfter-module_BeforeImageLeftRightShake__38m9V{0%,to{clip:rect(auto,var(--initial-rect-width),auto,auto)}10%,90%{clip:rect(auto,calc(var(--initial-rect-width) + var(--frame1px)),auto,auto)}20%,80%{clip:rect(auto,calc(var(--initial-rect-width) + var(--frame2px)),auto,auto)}30%,50%,70%{clip:rect(auto,calc(var(--initial-rect-width) + var(--frame3px)),auto,auto)}40%,60%{clip:rect(auto,calc(var(--initial-rect-width) + var(--frame4px)),auto,auto)}}@keyframes BeforeAfter-module_BeforeImageLeftRightShake__38m9V{0%,to{clip:rect(auto,var(--initial-rect-width),auto,auto)}10%,90%{clip:rect(auto,calc(var(--initial-rect-width) + var(--frame1px)),auto,auto)}20%,80%{clip:rect(auto,calc(var(--initial-rect-width) + var(--frame2px)),auto,auto)}30%,50%,70%{clip:rect(auto,calc(var(--initial-rect-width) + var(--frame3px)),auto,auto)}40%,60%{clip:rect(auto,calc(var(--initial-rect-width) + var(--frame4px)),auto,auto)}}@-webkit-keyframes BeforeAfter-module_AfterImageLeftRightShake__3WMf1{0%,to{clip:rect(auto,auto,auto,var(--initial-rect-width))}10%,90%{clip:rect(auto,auto,auto,calc(var(--initial-rect-width) + var(--frame1px)))}20%,80%{clip:rect(auto,auto,auto,calc(var(--initial-rect-width) + var(--frame2px)))}30%,50%,70%{clip:rect(auto,auto,auto,calc(var(--initial-rect-width) + var(--frame3px)))}40%,60%{clip:rect(auto,auto,auto,calc(var(--initial-rect-width) + var(--frame4px)))}}@keyframes BeforeAfter-module_AfterImageLeftRightShake__3WMf1{0%,to{clip:rect(auto,auto,auto,var(--initial-rect-width))}10%,90%{clip:rect(auto,auto,auto,calc(var(--initial-rect-width) + var(--frame1px)))}20%,80%{clip:rect(auto,auto,auto,calc(var(--initial-rect-width) + var(--frame2px)))}30%,50%,70%{clip:rect(auto,auto,auto,calc(var(--initial-rect-width) + var(--frame3px)))}40%,60%{clip:rect(auto,auto,auto,calc(var(--initial-rect-width) + var(--frame4px)))}}@-webkit-keyframes BeforeAfter-module_SliderLeftRightShake__2mcn5{0%,to{margin-left:0}10%,90%{margin-left:var(--frame1px)}20%,80%{margin-left:var(--frame2px)}30%,50%,70%{margin-left:var(--frame3px)}40%,60%{margin-left:var(--frame4px)}}@keyframes BeforeAfter-module_SliderLeftRightShake__2mcn5{0%,to{margin-left:0}10%,90%{margin-left:var(--frame1px)}20%,80%{margin-left:var(--frame2px)}30%,50%,70%{margin-left:var(--frame3px)}40%,60%{margin-left:var(--frame4px)}}.SoundDisclaimer-module_soundDisclaimer__31hWh{display:grid;border:1px solid;border-radius:4px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.SoundDisclaimer-module_unmute__1V4Ab,.SoundDisclaimer-module_unmuted__22CJ5{grid-column:1;grid-row:1;display:flex;align-items:center;transition-property:opacity,visibility;transition-duration:.09s;transition-timing-function:ease-out;opacity:0;visibility:hidden;padding:0 15px}.SoundDisclaimer-module_unmute__1V4Ab{position:relative;border:0;background-color:transparent;font:inherit;color:currentColor;text-align:initial;width:100%;z-index:1;cursor:pointer}.SoundDisclaimer-module_active__11_kc{opacity:1;visibility:visible;transition-delay:.09s;transition-duration:.21s;transition-timing-function:ease-in}.SoundDisclaimer-module_soundDisclaimer__31hWh svg{flex:0 0 25px;fill:currentColor;margin-right:15px}.TextBlock-module_text__21Hk4 h2,.TextBlock-module_text__21Hk4 li,.TextBlock-module_text__21Hk4 p{margin:1em 0 0}.TextBlock-module_text__21Hk4 h2{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;word-wrap:break-word}.TextBlock-module_text__21Hk4 a{color:currentColor;word-wrap:break-word}.TextBlock-module_text__21Hk4 ol,.TextBlock-module_text__21Hk4 ul{margin:0;padding-left:20px;clear:both}.TextBlock-module_text__21Hk4 blockquote{padding:.5em 1em .5em 2em;margin:1em 0 0 .5em;position:relative;overflow:hidden}.TextBlock-module_text__21Hk4 blockquote:before{content:"\201C";font-size:3em;font-weight:700;color:#aaa;position:absolute;top:0;left:0;line-height:1em}.VideoEmbed-module_VideoEmbed__3BUjc{background-color:#000;color:#fff}.VideoEmbed-module_embedPlayer__54NKG{position:absolute;top:0;left:0;bottom:0;right:0}.ExternalLink-module_hidden__3jer0{display:none}.ExternalLink-module_link_item__Blypv{width:45%;vertical-align:top;margin:2% auto;background-color:#fff;color:#000;text-decoration:none;transition:transform .3s}.ExternalLink-module_link_item__Blypv.ExternalLink-module_invert__1zrgN{background-color:#222;color:#fff}.ExternalLink-module_link_item__Blypv.ExternalLink-module_layout_center__3NRpQ{width:29%}.ExternalLink-module_link_item__Blypv:hover{transform:scale(1.05)}.ExternalLink-module_link_item__Blypv:hover .ExternalLink-module_link_title__FZJ-0{text-decoration:underline}.ExternalLink-module_link_thumbnail__2_BHq{width:auto;background-repeat:no-repeat;background-size:cover;padding-top:56.25%;position:relative}.ExternalLink-module_link_details__lRhKU{margin:20px}.ExternalLink-module_link_details__lRhKU>.ExternalLink-module_link_title__FZJ-0{font-size:1.2em;font-weight:700;margin-bottom:20px}.ExternalLink-module_link_details__lRhKU>p{width:100%;white-space:normal;line-height:1.3em}.ExternalLink-module_tooltip__18MpC{position:absolute;left:50%;top:80px;width:180px;padding:5px;margin-left:-95px;background-color:#444;color:#fff;border:1px solid #fff;opacity:.9;font-size:13px;text-align:center;white-space:normal}.ExternalLink-module_tooltip__18MpC>span{display:block;color:#fff;text-decoration:underline}@media only screen and (max-width:600px){.ExternalLink-module_link_item__Blypv.ExternalLink-module_layout_center__3NRpQ{width:45%}}@media only screen and (max-width:350px){.ExternalLink-module_link_item__Blypv,.ExternalLink-module_link_item__Blypv.ExternalLink-module_layout_center__3NRpQ{width:85%}}.ExternalLinkList-module_ext_links_container__16IIo{display:flex;flex-wrap:wrap;border-collapse:separate;border-spacing:10px;min-height:240px;width:auto;height:auto;pointer-events:auto;position:relative;transition:opacity .5s;transition-timing-function:cubic-bezier(.1,.57,.1,1);transition-duration:0ms}.DataWrapperChart-module_container__2eZ15{min-height:200px;padding:20px 5%}.DataWrapperChart-module_container__2eZ15>iframe{width:100%;height:100%;position:relative;top:0;border:0}
|
@@ -0,0 +1,1169 @@
|
|
1
|
+
import { useContentElementConfigurationUpdate, useI18n, withShadowClassName, Text, EditableInlineText, frontend, useFile, useContentElementEditorState, ViewportDependentPillarBoxes, useContentElementLifecycle, Figure, Image, usePlayerState, useAudioFocus, MediaInteractionTracking, VideoPlayerControls, VideoPlayer, AudioPlayerControls, AudioPlayer, useMediaMuted, EditableText, ThirdPartyOptOutInfo, ThirdPartyOptIn, useDarkBackground, textColorForBackgroundColor, Panorama } from 'pageflow-scrolled/frontend';
|
2
|
+
import React, { useState, useEffect, useRef } from 'react';
|
3
|
+
import classNames from 'classnames';
|
4
|
+
import ReactCompareImage from 'react-compare-image';
|
5
|
+
import Measure from 'react-measure';
|
6
|
+
import { media } from 'pageflow/frontend';
|
7
|
+
import ReactPlayer from 'react-player';
|
8
|
+
|
9
|
+
function _defineProperty(obj, key, value) {
|
10
|
+
if (key in obj) {
|
11
|
+
Object.defineProperty(obj, key, {
|
12
|
+
value: value,
|
13
|
+
enumerable: true,
|
14
|
+
configurable: true,
|
15
|
+
writable: true
|
16
|
+
});
|
17
|
+
} else {
|
18
|
+
obj[key] = value;
|
19
|
+
}
|
20
|
+
|
21
|
+
return obj;
|
22
|
+
}
|
23
|
+
|
24
|
+
var styles = {"root":"Heading-module_root__33TFw","right":"Heading-module_right__1TJKF","center":"Heading-module_center__38lDY","first":"Heading-module_first__1PMJX"};
|
25
|
+
|
26
|
+
function Heading(_ref) {
|
27
|
+
var configuration = _ref.configuration,
|
28
|
+
sectionProps = _ref.sectionProps;
|
29
|
+
var level = configuration.level || sectionProps.sectionIndex;
|
30
|
+
var firstSectionInEntry = level === 0;
|
31
|
+
var updateConfiguration = useContentElementConfigurationUpdate();
|
32
|
+
|
33
|
+
var _useI18n = useI18n({
|
34
|
+
locale: 'ui'
|
35
|
+
}),
|
36
|
+
t = _useI18n.t;
|
37
|
+
|
38
|
+
var legacyValue = configuration.children;
|
39
|
+
return (
|
40
|
+
/*#__PURE__*/
|
41
|
+
React.createElement("h1", {
|
42
|
+
className: classNames(styles.root, _defineProperty({}, styles.first, firstSectionInEntry), _defineProperty({}, styles[sectionProps.layout], configuration.position === 'wide'), _defineProperty({}, withShadowClassName, !sectionProps.invert))
|
43
|
+
},
|
44
|
+
/*#__PURE__*/
|
45
|
+
React.createElement(Text, {
|
46
|
+
scaleCategory: firstSectionInEntry ? 'h1' : 'h2',
|
47
|
+
inline: true
|
48
|
+
},
|
49
|
+
/*#__PURE__*/
|
50
|
+
React.createElement(EditableInlineText, {
|
51
|
+
value: configuration.value,
|
52
|
+
defaultValue: legacyValue,
|
53
|
+
placeholder: firstSectionInEntry ? t('pageflow_scrolled.inline_editing.type_title') : t('pageflow_scrolled.inline_editing.type_heading'),
|
54
|
+
onChange: function onChange(value) {
|
55
|
+
return updateConfiguration({
|
56
|
+
value: value
|
57
|
+
});
|
58
|
+
}
|
59
|
+
})))
|
60
|
+
);
|
61
|
+
}
|
62
|
+
|
63
|
+
frontend.contentElementTypes.register('heading', {
|
64
|
+
component: Heading
|
65
|
+
});
|
66
|
+
|
67
|
+
function ownKeys(object, enumerableOnly) {
|
68
|
+
var keys = Object.keys(object);
|
69
|
+
|
70
|
+
if (Object.getOwnPropertySymbols) {
|
71
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
72
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
73
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
74
|
+
});
|
75
|
+
keys.push.apply(keys, symbols);
|
76
|
+
}
|
77
|
+
|
78
|
+
return keys;
|
79
|
+
}
|
80
|
+
|
81
|
+
function _objectSpread2(target) {
|
82
|
+
for (var i = 1; i < arguments.length; i++) {
|
83
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
84
|
+
|
85
|
+
if (i % 2) {
|
86
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
87
|
+
_defineProperty(target, key, source[key]);
|
88
|
+
});
|
89
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
90
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
91
|
+
} else {
|
92
|
+
ownKeys(Object(source)).forEach(function (key) {
|
93
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
94
|
+
});
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
return target;
|
99
|
+
}
|
100
|
+
|
101
|
+
function _arrayWithHoles(arr) {
|
102
|
+
if (Array.isArray(arr)) return arr;
|
103
|
+
}
|
104
|
+
|
105
|
+
function _iterableToArrayLimit(arr, i) {
|
106
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
107
|
+
var _arr = [];
|
108
|
+
var _n = true;
|
109
|
+
var _d = false;
|
110
|
+
var _e = undefined;
|
111
|
+
|
112
|
+
try {
|
113
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
114
|
+
_arr.push(_s.value);
|
115
|
+
|
116
|
+
if (i && _arr.length === i) break;
|
117
|
+
}
|
118
|
+
} catch (err) {
|
119
|
+
_d = true;
|
120
|
+
_e = err;
|
121
|
+
} finally {
|
122
|
+
try {
|
123
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
124
|
+
} finally {
|
125
|
+
if (_d) throw _e;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
return _arr;
|
130
|
+
}
|
131
|
+
|
132
|
+
function _arrayLikeToArray(arr, len) {
|
133
|
+
if (len == null || len > arr.length) len = arr.length;
|
134
|
+
|
135
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
136
|
+
arr2[i] = arr[i];
|
137
|
+
}
|
138
|
+
|
139
|
+
return arr2;
|
140
|
+
}
|
141
|
+
|
142
|
+
function _unsupportedIterableToArray(o, minLen) {
|
143
|
+
if (!o) return;
|
144
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
145
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
146
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
147
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
148
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
149
|
+
}
|
150
|
+
|
151
|
+
function _nonIterableRest() {
|
152
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
153
|
+
}
|
154
|
+
|
155
|
+
function _slicedToArray(arr, i) {
|
156
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
157
|
+
}
|
158
|
+
|
159
|
+
var styles$1 = {"sliderStart":"BeforeAfter-module_sliderStart__2C5cN","container":"BeforeAfter-module_container__2Lm06","wiggle":"BeforeAfter-module_wiggle__3nVSe","SliderLeftRightShake":"BeforeAfter-module_SliderLeftRightShake__2mcn5","BeforeImageLeftRightShake":"BeforeAfter-module_BeforeImageLeftRightShake__38m9V","AfterImageLeftRightShake":"BeforeAfter-module_AfterImageLeftRightShake__3WMf1"};
|
160
|
+
|
161
|
+
var placeholderForBeforeImage = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQwIiBoZWlnaHQ9IjQwMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDwhLS0gQ3JlYXRlZCB3aXRoIE1ldGhvZCBEcmF3IC0gaHR0cDovL2dpdGh1Yi5jb20vZHVvcGl4ZWwvTWV0aG9kLURyYXcvIC0tPgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9IiMzZDVhODAiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSI0MDUiIHdpZHRoPSI2NDIiIHk9Ii0xIiB4PSItMSIvPgogIDxnIGRpc3BsYXk9Im5vbmUiIG92ZXJmbG93PSJ2aXNpYmxlIiB5PSIwIiB4PSIwIiBoZWlnaHQ9IjEwMCUiIHdpZHRoPSIxMDAlIiBpZD0iY2FudmFzR3JpZCI+CiAgIDxyZWN0IGZpbGw9InVybCgjZ3JpZHBhdHRlcm4pIiBzdHJva2Utd2lkdGg9IjAiIHk9IjAiIHg9IjAiIGhlaWdodD0iMTAwJSIgd2lkdGg9IjEwMCUiLz4KICA8L2c+CiA8L2c+CiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiA8L2c+Cjwvc3ZnPg==';
|
162
|
+
var placeholderForAfterImage = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQwIiBoZWlnaHQ9IjQwMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDwhLS0gQ3JlYXRlZCB3aXRoIE1ldGhvZCBEcmF3IC0gaHR0cDovL2dpdGh1Yi5jb20vZHVvcGl4ZWwvTWV0aG9kLURyYXcvIC0tPgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9IiM5OGMxZDkiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSI0MDUiIHdpZHRoPSI2NDIiIHk9Ii0xIiB4PSItMSIvPgogIDxnIGRpc3BsYXk9Im5vbmUiIG92ZXJmbG93PSJ2aXNpYmxlIiB5PSIwIiB4PSIwIiBoZWlnaHQ9IjEwMCUiIHdpZHRoPSIxMDAlIiBpZD0iY2FudmFzR3JpZCI+CiAgIDxyZWN0IGZpbGw9InVybCgjZ3JpZHBhdHRlcm4pIiBzdHJva2Utd2lkdGg9IjAiIHk9IjAiIHg9IjAiIGhlaWdodD0iMTAwJSIgd2lkdGg9IjEwMCUiLz4KICA8L2c+CiA8L2c+CiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiA8L2c+Cjwvc3ZnPg==';
|
163
|
+
var placeholderFile = {
|
164
|
+
width: 640,
|
165
|
+
height: 403
|
166
|
+
};
|
167
|
+
function BeforeAfter(_ref) {
|
168
|
+
var isActive = _ref.isActive,
|
169
|
+
load = _ref.load,
|
170
|
+
position = _ref.position,
|
171
|
+
before_id = _ref.before_id,
|
172
|
+
before_label = _ref.before_label,
|
173
|
+
after_id = _ref.after_id,
|
174
|
+
after_label = _ref.after_label,
|
175
|
+
initial_slider_position = _ref.initial_slider_position,
|
176
|
+
slider = _ref.slider,
|
177
|
+
slider_color = _ref.slider_color,
|
178
|
+
slider_handle = _ref.slider_handle;
|
179
|
+
|
180
|
+
var _useState = useState(false),
|
181
|
+
_useState2 = _slicedToArray(_useState, 2),
|
182
|
+
wiggle = _useState2[0],
|
183
|
+
setWiggle = _useState2[1];
|
184
|
+
|
185
|
+
var _useState3 = useState(false),
|
186
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
187
|
+
moved = _useState4[0],
|
188
|
+
setMoved = _useState4[1];
|
189
|
+
|
190
|
+
useEffect(function () {
|
191
|
+
// Only wiggle once per element, when it is active for the first
|
192
|
+
// time
|
193
|
+
setWiggle(function (wiggle) {
|
194
|
+
return wiggle || isActive;
|
195
|
+
});
|
196
|
+
}, [isActive]);
|
197
|
+
var beforeImage = useFile({
|
198
|
+
collectionName: 'imageFiles',
|
199
|
+
permaId: before_id
|
200
|
+
});
|
201
|
+
var afterImage = useFile({
|
202
|
+
collectionName: 'imageFiles',
|
203
|
+
permaId: after_id
|
204
|
+
});
|
205
|
+
|
206
|
+
var _useContentElementEdi = useContentElementEditorState(),
|
207
|
+
isSelected = _useContentElementEdi.isSelected;
|
208
|
+
|
209
|
+
var beforeImageUrl = beforeImage && beforeImage.urls.large;
|
210
|
+
var beforeImageAlt = beforeImage && beforeImage.configuration.alt;
|
211
|
+
var afterImageUrl = afterImage && afterImage.urls.large;
|
212
|
+
var afterImageAlt = afterImage && afterImage.configuration.alt;
|
213
|
+
var initialSliderPos = initial_slider_position / 100;
|
214
|
+
var opts = {}; // Transform slider-related props into the format that
|
215
|
+
// react-compare-image needs
|
216
|
+
|
217
|
+
if (!slider) {
|
218
|
+
opts = _objectSpread2(_objectSpread2({}, opts), {}, {
|
219
|
+
sliderLineWidth: 0,
|
220
|
+
handle:
|
221
|
+
/*#__PURE__*/
|
222
|
+
React.createElement(React.Fragment, null)
|
223
|
+
});
|
224
|
+
}
|
225
|
+
|
226
|
+
if (slider) {
|
227
|
+
if (!slider_handle) {
|
228
|
+
opts = _objectSpread2(_objectSpread2({}, opts), {}, {
|
229
|
+
handle:
|
230
|
+
/*#__PURE__*/
|
231
|
+
React.createElement(React.Fragment, null)
|
232
|
+
});
|
233
|
+
}
|
234
|
+
|
235
|
+
if (slider_color) {
|
236
|
+
opts = _objectSpread2(_objectSpread2({}, opts), {}, {
|
237
|
+
sliderLineColor: slider_color
|
238
|
+
});
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
return (
|
243
|
+
/*#__PURE__*/
|
244
|
+
React.createElement(ViewportDependentPillarBoxes, {
|
245
|
+
file: beforeImage || afterImage || placeholderFile,
|
246
|
+
position: position
|
247
|
+
},
|
248
|
+
/*#__PURE__*/
|
249
|
+
React.createElement(Measure, {
|
250
|
+
bounds: true
|
251
|
+
}, function (_ref2) {
|
252
|
+
var _cx;
|
253
|
+
|
254
|
+
var measureRef = _ref2.measureRef,
|
255
|
+
contentRect = _ref2.contentRect;
|
256
|
+
return (
|
257
|
+
/*#__PURE__*/
|
258
|
+
React.createElement("div", {
|
259
|
+
ref: measureRef,
|
260
|
+
style: {
|
261
|
+
'--initial-rect-width': contentRect.bounds.width * initialSliderPos + 'px'
|
262
|
+
},
|
263
|
+
className: classNames((_cx = {}, _defineProperty(_cx, styles$1.selected, isSelected), _defineProperty(_cx, styles$1.wiggle, wiggle && !moved), _cx), styles$1.container)
|
264
|
+
},
|
265
|
+
/*#__PURE__*/
|
266
|
+
React.createElement(InitialSliderPositionIndicator, {
|
267
|
+
parentSelected: isSelected,
|
268
|
+
position: initial_slider_position
|
269
|
+
}), renderCompareImage())
|
270
|
+
);
|
271
|
+
}))
|
272
|
+
);
|
273
|
+
|
274
|
+
function renderCompareImage() {
|
275
|
+
if (!load) {
|
276
|
+
return null;
|
277
|
+
}
|
278
|
+
|
279
|
+
return (
|
280
|
+
/*#__PURE__*/
|
281
|
+
React.createElement(ReactCompareImage, Object.assign({
|
282
|
+
leftImage: beforeImage ? beforeImageUrl : placeholderForBeforeImage,
|
283
|
+
rightImage: afterImage ? afterImageUrl : placeholderForAfterImage,
|
284
|
+
leftImageLabel: before_label,
|
285
|
+
rightImageLabel: after_label,
|
286
|
+
leftImageAlt: beforeImageAlt,
|
287
|
+
rightImageAlt: afterImageAlt,
|
288
|
+
sliderPositionPercentage: initialSliderPos,
|
289
|
+
onSliderPositionChange: function onSliderPositionChange() {
|
290
|
+
return setMoved(true);
|
291
|
+
}
|
292
|
+
}, opts))
|
293
|
+
);
|
294
|
+
}
|
295
|
+
}
|
296
|
+
|
297
|
+
function InitialSliderPositionIndicator(_ref3) {
|
298
|
+
var parentSelected = _ref3.parentSelected,
|
299
|
+
position = _ref3.position;
|
300
|
+
var indicatorWidth = '2px';
|
301
|
+
var indicatorStyles = {
|
302
|
+
left: "calc(".concat(position, "% - ").concat(indicatorWidth, "/2)"),
|
303
|
+
width: "".concat(indicatorWidth),
|
304
|
+
height: '100%',
|
305
|
+
borderLeft: '1px solid black',
|
306
|
+
borderRight: '1px solid black'
|
307
|
+
}; // In case this element is selected, and its initial slider position
|
308
|
+
// is not in the middle, we show InitialSliderPositionIndicator
|
309
|
+
|
310
|
+
return parentSelected && position !== 50 ?
|
311
|
+
/*#__PURE__*/
|
312
|
+
React.createElement("div", {
|
313
|
+
className: styles$1.sliderStart,
|
314
|
+
style: indicatorStyles
|
315
|
+
}) : '';
|
316
|
+
}
|
317
|
+
|
318
|
+
function InlineBeforeAfter(props) {
|
319
|
+
var _useContentElementLif = useContentElementLifecycle(),
|
320
|
+
isActive = _useContentElementLif.isActive,
|
321
|
+
shouldLoad = _useContentElementLif.shouldLoad;
|
322
|
+
|
323
|
+
return (
|
324
|
+
/*#__PURE__*/
|
325
|
+
React.createElement(BeforeAfter, Object.assign({}, props.configuration, {
|
326
|
+
load: shouldLoad,
|
327
|
+
isActive: isActive
|
328
|
+
}))
|
329
|
+
);
|
330
|
+
}
|
331
|
+
|
332
|
+
frontend.contentElementTypes.register('inlineBeforeAfter', {
|
333
|
+
component: InlineBeforeAfter,
|
334
|
+
lifecycle: true
|
335
|
+
});
|
336
|
+
|
337
|
+
function InlineImage(_ref) {
|
338
|
+
var configuration = _ref.configuration;
|
339
|
+
|
340
|
+
var _useContentElementLif = useContentElementLifecycle(),
|
341
|
+
shouldLoad = _useContentElementLif.shouldLoad;
|
342
|
+
|
343
|
+
var imageFile = useFile({
|
344
|
+
collectionName: 'imageFiles',
|
345
|
+
permaId: configuration.id
|
346
|
+
});
|
347
|
+
return (
|
348
|
+
/*#__PURE__*/
|
349
|
+
React.createElement(Figure, {
|
350
|
+
caption: configuration.caption
|
351
|
+
},
|
352
|
+
/*#__PURE__*/
|
353
|
+
React.createElement(ViewportDependentPillarBoxes, {
|
354
|
+
file: imageFile,
|
355
|
+
aspectRatio: imageFile ? undefined : 0.75,
|
356
|
+
position: configuration.position,
|
357
|
+
opaque: !!configuration.caption
|
358
|
+
},
|
359
|
+
/*#__PURE__*/
|
360
|
+
React.createElement(Image, {
|
361
|
+
imageFile: imageFile,
|
362
|
+
load: shouldLoad,
|
363
|
+
structuredData: true,
|
364
|
+
variant: configuration.position === 'full' ? 'large' : 'medium'
|
365
|
+
})))
|
366
|
+
);
|
367
|
+
}
|
368
|
+
|
369
|
+
frontend.contentElementTypes.register('inlineImage', {
|
370
|
+
component: InlineImage,
|
371
|
+
lifecycle: true
|
372
|
+
});
|
373
|
+
|
374
|
+
function InlineVideo(_ref) {
|
375
|
+
var contentElementId = _ref.contentElementId,
|
376
|
+
sectionProps = _ref.sectionProps,
|
377
|
+
configuration = _ref.configuration;
|
378
|
+
var videoFile = useFile({
|
379
|
+
collectionName: 'videoFiles',
|
380
|
+
permaId: configuration.id
|
381
|
+
});
|
382
|
+
var posterImageFile = useFile({
|
383
|
+
collectionName: 'imageFiles',
|
384
|
+
permaId: configuration.posterId
|
385
|
+
});
|
386
|
+
|
387
|
+
var _usePlayerState = usePlayerState(),
|
388
|
+
_usePlayerState2 = _slicedToArray(_usePlayerState, 2),
|
389
|
+
playerState = _usePlayerState2[0],
|
390
|
+
playerActions = _usePlayerState2[1];
|
391
|
+
|
392
|
+
var _useContentElementEdi = useContentElementEditorState(),
|
393
|
+
isEditable = _useContentElementEdi.isEditable,
|
394
|
+
isSelected = _useContentElementEdi.isSelected;
|
395
|
+
|
396
|
+
var _useContentElementLif = useContentElementLifecycle({
|
397
|
+
onActivate: function onActivate() {
|
398
|
+
if (configuration.autoplay) {
|
399
|
+
playerActions.play();
|
400
|
+
}
|
401
|
+
},
|
402
|
+
onDeactivate: function onDeactivate() {
|
403
|
+
playerActions.fadeOutAndPause(400);
|
404
|
+
}
|
405
|
+
}),
|
406
|
+
shouldLoad = _useContentElementLif.shouldLoad,
|
407
|
+
shouldPrepare = _useContentElementLif.shouldPrepare;
|
408
|
+
|
409
|
+
useAudioFocus({
|
410
|
+
key: contentElementId,
|
411
|
+
request: playerState.shouldPlay,
|
412
|
+
onLost: function onLost() {
|
413
|
+
playerActions.fadeOutAndPause(400);
|
414
|
+
}
|
415
|
+
});
|
416
|
+
|
417
|
+
var onPlayerClick = function onPlayerClick() {
|
418
|
+
if (isEditable && !isSelected) {
|
419
|
+
return;
|
420
|
+
}
|
421
|
+
|
422
|
+
if (!playerState.shouldPlay || media.muted) {
|
423
|
+
playerActions.playBlessed();
|
424
|
+
} else {
|
425
|
+
playerActions.pause();
|
426
|
+
}
|
427
|
+
};
|
428
|
+
|
429
|
+
return (
|
430
|
+
/*#__PURE__*/
|
431
|
+
React.createElement(Figure, {
|
432
|
+
caption: configuration.caption
|
433
|
+
},
|
434
|
+
/*#__PURE__*/
|
435
|
+
React.createElement(MediaInteractionTracking, {
|
436
|
+
playerState: playerState,
|
437
|
+
playerActions: playerActions
|
438
|
+
},
|
439
|
+
/*#__PURE__*/
|
440
|
+
React.createElement(VideoPlayerControls, {
|
441
|
+
videoFile: videoFile,
|
442
|
+
defaultTextTrackFilePermaId: configuration.defaultTextTrackFileId,
|
443
|
+
playerState: playerState,
|
444
|
+
playerActions: playerActions,
|
445
|
+
configuration: configuration,
|
446
|
+
sectionProps: sectionProps,
|
447
|
+
onPlayerClick: onPlayerClick
|
448
|
+
},
|
449
|
+
/*#__PURE__*/
|
450
|
+
React.createElement(VideoPlayer, {
|
451
|
+
load: shouldPrepare ? 'auto' : shouldLoad ? 'poster' : 'none',
|
452
|
+
position: configuration.position,
|
453
|
+
controls: configuration.controls,
|
454
|
+
playerState: playerState,
|
455
|
+
playerActions: playerActions,
|
456
|
+
videoFile: videoFile,
|
457
|
+
posterImageFile: posterImageFile,
|
458
|
+
defaultTextTrackFilePermaId: configuration.defaultTextTrackFileId,
|
459
|
+
quality: 'high',
|
460
|
+
playsInline: true,
|
461
|
+
atmoDuringPlayback: configuration.atmoDuringPlayback
|
462
|
+
}))))
|
463
|
+
);
|
464
|
+
}
|
465
|
+
|
466
|
+
frontend.contentElementTypes.register('inlineVideo', {
|
467
|
+
component: InlineVideo,
|
468
|
+
lifecycle: true
|
469
|
+
});
|
470
|
+
|
471
|
+
function InlineAudio(_ref) {
|
472
|
+
var contentElementId = _ref.contentElementId,
|
473
|
+
sectionProps = _ref.sectionProps,
|
474
|
+
configuration = _ref.configuration;
|
475
|
+
var audioFile = useFile({
|
476
|
+
collectionName: 'audioFiles',
|
477
|
+
permaId: configuration.id
|
478
|
+
});
|
479
|
+
var posterImageFile = useFile({
|
480
|
+
collectionName: 'imageFiles',
|
481
|
+
permaId: configuration.posterId
|
482
|
+
});
|
483
|
+
|
484
|
+
var _usePlayerState = usePlayerState(),
|
485
|
+
_usePlayerState2 = _slicedToArray(_usePlayerState, 2),
|
486
|
+
playerState = _usePlayerState2[0],
|
487
|
+
playerActions = _usePlayerState2[1];
|
488
|
+
|
489
|
+
var _useContentElementEdi = useContentElementEditorState(),
|
490
|
+
isEditable = _useContentElementEdi.isEditable,
|
491
|
+
isSelected = _useContentElementEdi.isSelected;
|
492
|
+
|
493
|
+
var _useContentElementLif = useContentElementLifecycle({
|
494
|
+
onActivate: function onActivate() {
|
495
|
+
if (configuration.autoplay && !media.muted) {
|
496
|
+
playerActions.play();
|
497
|
+
}
|
498
|
+
},
|
499
|
+
onDeactivate: function onDeactivate() {
|
500
|
+
playerActions.fadeOutAndPause(400);
|
501
|
+
}
|
502
|
+
}),
|
503
|
+
shouldLoad = _useContentElementLif.shouldLoad,
|
504
|
+
shouldPrepare = _useContentElementLif.shouldPrepare;
|
505
|
+
|
506
|
+
useAudioFocus({
|
507
|
+
key: contentElementId,
|
508
|
+
request: playerState.shouldPlay,
|
509
|
+
onLost: function onLost() {
|
510
|
+
playerActions.fadeOutAndPause(400);
|
511
|
+
}
|
512
|
+
});
|
513
|
+
|
514
|
+
var onPlayerClick = function onPlayerClick() {
|
515
|
+
if (isEditable && !isSelected) {
|
516
|
+
return;
|
517
|
+
}
|
518
|
+
|
519
|
+
if (playerState.shouldPlay) {
|
520
|
+
playerActions.pause();
|
521
|
+
} else {
|
522
|
+
playerActions.playBlessed();
|
523
|
+
}
|
524
|
+
};
|
525
|
+
|
526
|
+
return (
|
527
|
+
/*#__PURE__*/
|
528
|
+
React.createElement(Figure, {
|
529
|
+
caption: configuration.caption
|
530
|
+
},
|
531
|
+
/*#__PURE__*/
|
532
|
+
React.createElement(AudioPlayerControls, {
|
533
|
+
audioFile: audioFile,
|
534
|
+
defaultTextTrackFilePermaId: configuration.defaultTextTrackFileId,
|
535
|
+
playerState: playerState,
|
536
|
+
playerActions: playerActions,
|
537
|
+
standAlone: !posterImageFile,
|
538
|
+
configuration: configuration,
|
539
|
+
sectionProps: sectionProps,
|
540
|
+
onPlayerClick: onPlayerClick
|
541
|
+
},
|
542
|
+
/*#__PURE__*/
|
543
|
+
React.createElement(AudioPlayer, {
|
544
|
+
load: shouldPrepare ? 'auto' : shouldLoad ? 'poster' : 'none',
|
545
|
+
position: configuration.position,
|
546
|
+
controls: configuration.controls,
|
547
|
+
playerState: playerState,
|
548
|
+
playerActions: playerActions,
|
549
|
+
audioFile: audioFile,
|
550
|
+
posterImageFile: posterImageFile,
|
551
|
+
defaultTextTrackFilePermaId: configuration.defaultTextTrackFileId,
|
552
|
+
quality: 'high',
|
553
|
+
playsInline: true,
|
554
|
+
atmoDuringPlayback: configuration.atmoDuringPlayback
|
555
|
+
})))
|
556
|
+
);
|
557
|
+
}
|
558
|
+
|
559
|
+
frontend.contentElementTypes.register('inlineAudio', {
|
560
|
+
component: InlineAudio,
|
561
|
+
lifecycle: true
|
562
|
+
});
|
563
|
+
|
564
|
+
var styles$2 = {"soundDisclaimer":"SoundDisclaimer-module_soundDisclaimer__31hWh","unmute":"SoundDisclaimer-module_unmute__1V4Ab","unmuted":"SoundDisclaimer-module_unmuted__22CJ5","active":"SoundDisclaimer-module_active__11_kc"};
|
565
|
+
|
566
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
567
|
+
if (source == null) return {};
|
568
|
+
var target = {};
|
569
|
+
var sourceKeys = Object.keys(source);
|
570
|
+
var key, i;
|
571
|
+
|
572
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
573
|
+
key = sourceKeys[i];
|
574
|
+
if (excluded.indexOf(key) >= 0) continue;
|
575
|
+
target[key] = source[key];
|
576
|
+
}
|
577
|
+
|
578
|
+
return target;
|
579
|
+
}
|
580
|
+
|
581
|
+
function _objectWithoutProperties(source, excluded) {
|
582
|
+
if (source == null) return {};
|
583
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
584
|
+
var key, i;
|
585
|
+
|
586
|
+
if (Object.getOwnPropertySymbols) {
|
587
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
588
|
+
|
589
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
590
|
+
key = sourceSymbolKeys[i];
|
591
|
+
if (excluded.indexOf(key) >= 0) continue;
|
592
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
593
|
+
target[key] = source[key];
|
594
|
+
}
|
595
|
+
}
|
596
|
+
|
597
|
+
return target;
|
598
|
+
}
|
599
|
+
|
600
|
+
function _extends() {
|
601
|
+
_extends = Object.assign || function (target) {
|
602
|
+
for (var i = 1; i < arguments.length; i++) {
|
603
|
+
var source = arguments[i];
|
604
|
+
|
605
|
+
for (var key in source) {
|
606
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
607
|
+
target[key] = source[key];
|
608
|
+
}
|
609
|
+
}
|
610
|
+
}
|
611
|
+
|
612
|
+
return target;
|
613
|
+
};
|
614
|
+
|
615
|
+
return _extends.apply(this, arguments);
|
616
|
+
}
|
617
|
+
var MutedIcon = (function (_ref) {
|
618
|
+
var _ref$styles = _ref.styles,
|
619
|
+
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
620
|
+
props = _objectWithoutProperties(_ref, ["styles"]);
|
621
|
+
|
622
|
+
return React.createElement("svg", _extends({
|
623
|
+
"aria-hidden": "true",
|
624
|
+
"data-prefix": "fas",
|
625
|
+
"data-icon": "volume-mute",
|
626
|
+
className: (styles["svg-inline--fa"] || "svg-inline--fa") + " " + (styles["fa-volume-mute"] || "fa-volume-mute") + " " + (styles["fa-w-16"] || "fa-w-16"),
|
627
|
+
xmlns: "http://www.w3.org/2000/svg",
|
628
|
+
viewBox: "0 0 512 512"
|
629
|
+
}, props), React.createElement("path", {
|
630
|
+
d: "M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"
|
631
|
+
}));
|
632
|
+
});
|
633
|
+
|
634
|
+
function _extends$1() {
|
635
|
+
_extends$1 = Object.assign || function (target) {
|
636
|
+
for (var i = 1; i < arguments.length; i++) {
|
637
|
+
var source = arguments[i];
|
638
|
+
|
639
|
+
for (var key in source) {
|
640
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
641
|
+
target[key] = source[key];
|
642
|
+
}
|
643
|
+
}
|
644
|
+
}
|
645
|
+
|
646
|
+
return target;
|
647
|
+
};
|
648
|
+
|
649
|
+
return _extends$1.apply(this, arguments);
|
650
|
+
}
|
651
|
+
var UnmutedIcon = (function (_ref) {
|
652
|
+
var _ref$styles = _ref.styles,
|
653
|
+
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
654
|
+
props = _objectWithoutProperties(_ref, ["styles"]);
|
655
|
+
|
656
|
+
return React.createElement("svg", _extends$1({
|
657
|
+
"aria-hidden": "true",
|
658
|
+
"data-prefix": "fas",
|
659
|
+
"data-icon": "volume-mute",
|
660
|
+
className: (styles["svg-inline--fa"] || "svg-inline--fa") + " " + (styles["fa-volume-mute"] || "fa-volume-mute") + " " + (styles["fa-w-16"] || "fa-w-16"),
|
661
|
+
xmlns: "http://www.w3.org/2000/svg",
|
662
|
+
viewBox: "0 0 512 512"
|
663
|
+
}, props), React.createElement("path", {
|
664
|
+
d: "M232.36 64.01a24.007 24.007 0 00-1.176.002c-5.703.15-11.464 2.348-16.155 7.039L126.061 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-14.293-11.514-23.733-23.64-24.01zm149.5 31.994c-8.107-.16-16.098 3.814-20.75 11.217-7.09 11.28-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256c0-63.53-32.06-121.94-85.77-156.24a23.808 23.808 0 00-12.37-3.756zm-55.032 80.174c-8.51-.046-16.795 4.42-21.209 12.402-6.39 11.61-2.159 26.2 9.451 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88 0-31.88-17.54-61.32-45.78-76.86a23.987 23.987 0 00-11.402-2.952z"
|
665
|
+
}));
|
666
|
+
});
|
667
|
+
|
668
|
+
function SoundDisclaimer() {
|
669
|
+
var _useContentElementEdi = useContentElementEditorState(),
|
670
|
+
isEditable = _useContentElementEdi.isEditable,
|
671
|
+
isSelected = _useContentElementEdi.isSelected;
|
672
|
+
|
673
|
+
var _useI18n = useI18n(),
|
674
|
+
t = _useI18n.t;
|
675
|
+
|
676
|
+
var muted = useMediaMuted();
|
677
|
+
return (
|
678
|
+
/*#__PURE__*/
|
679
|
+
React.createElement("div", {
|
680
|
+
className: classNames(styles$2.soundDisclaimer),
|
681
|
+
style: {
|
682
|
+
pointerEvents: isEditable && !isSelected ? 'none' : undefined
|
683
|
+
}
|
684
|
+
},
|
685
|
+
/*#__PURE__*/
|
686
|
+
React.createElement("button", {
|
687
|
+
className: classNames(styles$2.unmute, _defineProperty({}, styles$2.active, muted)),
|
688
|
+
onClick: function onClick() {
|
689
|
+
return media.mute(false);
|
690
|
+
}
|
691
|
+
},
|
692
|
+
/*#__PURE__*/
|
693
|
+
React.createElement(MutedIcon, null),
|
694
|
+
/*#__PURE__*/
|
695
|
+
React.createElement("p", {
|
696
|
+
dangerouslySetInnerHTML: {
|
697
|
+
__html: t('pageflow_scrolled.public.sound_disclaimer.help_muted')
|
698
|
+
}
|
699
|
+
})),
|
700
|
+
/*#__PURE__*/
|
701
|
+
React.createElement("div", {
|
702
|
+
className: classNames(styles$2.unmuted, _defineProperty({}, styles$2.active, !muted))
|
703
|
+
},
|
704
|
+
/*#__PURE__*/
|
705
|
+
React.createElement(UnmutedIcon, null),
|
706
|
+
/*#__PURE__*/
|
707
|
+
React.createElement("p", {
|
708
|
+
dangerouslySetInnerHTML: {
|
709
|
+
__html: t('pageflow_scrolled.public.sound_disclaimer.help_unmuted')
|
710
|
+
}
|
711
|
+
})))
|
712
|
+
);
|
713
|
+
}
|
714
|
+
|
715
|
+
frontend.contentElementTypes.register('soundDisclaimer', {
|
716
|
+
component: SoundDisclaimer
|
717
|
+
});
|
718
|
+
|
719
|
+
var styles$3 = {"text":"TextBlock-module_text__21Hk4"};
|
720
|
+
|
721
|
+
function TextBlock(props) {
|
722
|
+
var updateConfiguration = useContentElementConfigurationUpdate();
|
723
|
+
|
724
|
+
var _useI18n = useI18n({
|
725
|
+
locale: 'ui'
|
726
|
+
}),
|
727
|
+
t = _useI18n.t;
|
728
|
+
|
729
|
+
return (
|
730
|
+
/*#__PURE__*/
|
731
|
+
React.createElement("div", {
|
732
|
+
className: styles$3.text
|
733
|
+
},
|
734
|
+
/*#__PURE__*/
|
735
|
+
React.createElement(EditableText, {
|
736
|
+
value: props.configuration.value,
|
737
|
+
contentElementId: props.contentElementId,
|
738
|
+
placeholder: t('pageflow_scrolled.inline_editing.type_text'),
|
739
|
+
onChange: function onChange(value) {
|
740
|
+
return updateConfiguration({
|
741
|
+
value: value
|
742
|
+
});
|
743
|
+
}
|
744
|
+
}))
|
745
|
+
);
|
746
|
+
}
|
747
|
+
|
748
|
+
frontend.contentElementTypes.register('textBlock', {
|
749
|
+
component: TextBlock,
|
750
|
+
customSelectionRect: true,
|
751
|
+
supportsWrappingAroundFloats: true
|
752
|
+
});
|
753
|
+
|
754
|
+
var styles$4 = {"VideoEmbed":"VideoEmbed-module_VideoEmbed__3BUjc","embedPlayer":"VideoEmbed-module_embedPlayer__54NKG"};
|
755
|
+
|
756
|
+
var aspectRatios = {
|
757
|
+
wide: 0.5625,
|
758
|
+
narrow: 0.75,
|
759
|
+
square: 1,
|
760
|
+
portrait: 1.7777
|
761
|
+
};
|
762
|
+
function VideoEmbed(_ref) {
|
763
|
+
var contentElementId = _ref.contentElementId,
|
764
|
+
configuration = _ref.configuration;
|
765
|
+
|
766
|
+
var _useContentElementEdi = useContentElementEditorState(),
|
767
|
+
isEditable = _useContentElementEdi.isEditable,
|
768
|
+
isSelected = _useContentElementEdi.isSelected;
|
769
|
+
|
770
|
+
var _useContentElementLif = useContentElementLifecycle(),
|
771
|
+
shouldLoad = _useContentElementLif.shouldLoad;
|
772
|
+
|
773
|
+
var _useState = useState('unplayed'),
|
774
|
+
_useState2 = _slicedToArray(_useState, 2),
|
775
|
+
playerState = _useState2[0],
|
776
|
+
setPlayerState = _useState2[1];
|
777
|
+
|
778
|
+
return (
|
779
|
+
/*#__PURE__*/
|
780
|
+
React.createElement("div", {
|
781
|
+
className: styles$4.VideoEmbed,
|
782
|
+
style: {
|
783
|
+
pointerEvents: isEditable && !isSelected ? 'none' : undefined
|
784
|
+
}
|
785
|
+
},
|
786
|
+
/*#__PURE__*/
|
787
|
+
React.createElement(Figure, {
|
788
|
+
caption: configuration.caption
|
789
|
+
},
|
790
|
+
/*#__PURE__*/
|
791
|
+
React.createElement(ViewportDependentPillarBoxes, {
|
792
|
+
aspectRatio: aspectRatios[configuration.aspectRatio || 'wide'],
|
793
|
+
position: configuration.position,
|
794
|
+
opaque: !!configuration.caption
|
795
|
+
}, shouldLoad &&
|
796
|
+
/*#__PURE__*/
|
797
|
+
React.createElement(PreparedPlayer, {
|
798
|
+
playerState: playerState,
|
799
|
+
setPlayerState: setPlayerState,
|
800
|
+
contentElementId: contentElementId,
|
801
|
+
configuration: configuration
|
802
|
+
})),
|
803
|
+
/*#__PURE__*/
|
804
|
+
React.createElement(ThirdPartyOptOutInfo, {
|
805
|
+
providerName: "video",
|
806
|
+
hide: playerState === 'playing',
|
807
|
+
contentElementPosition: configuration.position
|
808
|
+
})))
|
809
|
+
);
|
810
|
+
}
|
811
|
+
|
812
|
+
function PreparedPlayer(_ref2) {
|
813
|
+
var contentElementId = _ref2.contentElementId,
|
814
|
+
configuration = _ref2.configuration,
|
815
|
+
playerState = _ref2.playerState,
|
816
|
+
setPlayerState = _ref2.setPlayerState;
|
817
|
+
useAudioFocus({
|
818
|
+
key: contentElementId,
|
819
|
+
request: playerState === 'playing',
|
820
|
+
onLost: function onLost() {
|
821
|
+
setPlayerState('paused');
|
822
|
+
}
|
823
|
+
}); // React player does not re-create player when controls or config
|
824
|
+
// prop changes. Ensure key changes to force React to re-mount
|
825
|
+
// component.
|
826
|
+
|
827
|
+
function keyFromConfiguration(config) {
|
828
|
+
return [config.hideControls, config.hideInfo].join('');
|
829
|
+
}
|
830
|
+
|
831
|
+
return (
|
832
|
+
/*#__PURE__*/
|
833
|
+
React.createElement(ThirdPartyOptIn, {
|
834
|
+
providerName: "video"
|
835
|
+
}, function (_ref3) {
|
836
|
+
var consentedHere = _ref3.consentedHere;
|
837
|
+
return (
|
838
|
+
/*#__PURE__*/
|
839
|
+
React.createElement(ReactPlayer, {
|
840
|
+
className: styles$4.embedPlayer,
|
841
|
+
key: keyFromConfiguration(configuration),
|
842
|
+
url: configuration.videoSource,
|
843
|
+
playing: playerState !== 'paused',
|
844
|
+
onPlay: function onPlay() {
|
845
|
+
return setPlayerState('playing');
|
846
|
+
},
|
847
|
+
onPause: function onPause() {
|
848
|
+
return setPlayerState('paused');
|
849
|
+
},
|
850
|
+
onEnded: function onEnded() {
|
851
|
+
return setPlayerState('paused');
|
852
|
+
},
|
853
|
+
light: !consentedHere && playerState === 'unplayed',
|
854
|
+
width: "100%",
|
855
|
+
height: "100%",
|
856
|
+
controls: !configuration.hideControls,
|
857
|
+
config: {
|
858
|
+
youtube: {
|
859
|
+
playerVars: {
|
860
|
+
showinfo: !configuration.hideInfo
|
861
|
+
}
|
862
|
+
},
|
863
|
+
vimeo: {
|
864
|
+
playerOptions: {
|
865
|
+
byline: !configuration.hideInfo
|
866
|
+
}
|
867
|
+
}
|
868
|
+
}
|
869
|
+
})
|
870
|
+
);
|
871
|
+
})
|
872
|
+
);
|
873
|
+
}
|
874
|
+
|
875
|
+
frontend.contentElementTypes.register('videoEmbed', {
|
876
|
+
component: VideoEmbed,
|
877
|
+
lifecycle: true
|
878
|
+
});
|
879
|
+
|
880
|
+
var styles$5 = {"hidden":"ExternalLink-module_hidden__3jer0","link_item":"ExternalLink-module_link_item__Blypv","invert":"ExternalLink-module_invert__1zrgN","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","link_desc":"ExternalLink-module_link_desc__3fSe1","tooltip":"ExternalLink-module_tooltip__18MpC"};
|
881
|
+
|
882
|
+
function ExternalLink(props) {
|
883
|
+
var _classNames2;
|
884
|
+
|
885
|
+
var _useState = useState(true),
|
886
|
+
_useState2 = _slicedToArray(_useState, 2),
|
887
|
+
hideTooltip = _useState2[0],
|
888
|
+
setHideTooltip = _useState2[1];
|
889
|
+
|
890
|
+
var layout = props.sectionProps.layout;
|
891
|
+
|
892
|
+
var _useI18n = useI18n({
|
893
|
+
locale: 'ui'
|
894
|
+
}),
|
895
|
+
t = _useI18n.t;
|
896
|
+
|
897
|
+
var _useContentElementEdi = useContentElementEditorState(),
|
898
|
+
isEditable = _useContentElementEdi.isEditable,
|
899
|
+
isSelected = _useContentElementEdi.isSelected;
|
900
|
+
|
901
|
+
var thumbnailImageFile = useFile({
|
902
|
+
collectionName: 'imageFiles',
|
903
|
+
permaId: props.thumbnail
|
904
|
+
});
|
905
|
+
|
906
|
+
var onClick = function onClick(event) {
|
907
|
+
if (isEditable) {
|
908
|
+
if (!props.open_in_new_tab || !isSelected) {
|
909
|
+
event.preventDefault();
|
910
|
+
}
|
911
|
+
|
912
|
+
if (!props.open_in_new_tab && isSelected) {
|
913
|
+
setHideTooltip(false);
|
914
|
+
}
|
915
|
+
}
|
916
|
+
};
|
917
|
+
|
918
|
+
var onMouseLeave = function onMouseLeave() {
|
919
|
+
setHideTooltip(true);
|
920
|
+
};
|
921
|
+
|
922
|
+
function renderNewTabTooltip() {
|
923
|
+
if (isEditable) {
|
924
|
+
var onTooltipClick = function onTooltipClick() {
|
925
|
+
window.open(props.url, '_blank');
|
926
|
+
setHideTooltip(true);
|
927
|
+
};
|
928
|
+
|
929
|
+
return (
|
930
|
+
/*#__PURE__*/
|
931
|
+
React.createElement("div", {
|
932
|
+
className: classNames(_defineProperty({}, styles$5.hidden, hideTooltip), styles$5.tooltip),
|
933
|
+
onClick: onTooltipClick
|
934
|
+
}, t('pageflow_scrolled.inline_editing.external_links.open_in_new_tab_message'),
|
935
|
+
/*#__PURE__*/
|
936
|
+
React.createElement("span", null, t('pageflow_scrolled.inline_editing.external_links.open_in_new_tab')))
|
937
|
+
);
|
938
|
+
}
|
939
|
+
}
|
940
|
+
|
941
|
+
return (
|
942
|
+
/*#__PURE__*/
|
943
|
+
React.createElement("a", {
|
944
|
+
className: classNames(styles$5.link_item, (_classNames2 = {}, _defineProperty(_classNames2, styles$5.invert, props.invert), _defineProperty(_classNames2, styles$5.layout_center, layout === 'center'), _classNames2)),
|
945
|
+
href: props.url || 'about:blank',
|
946
|
+
onClick: onClick,
|
947
|
+
onMouseLeave: onMouseLeave,
|
948
|
+
target: props.open_in_new_tab ? '_blank' : '_self',
|
949
|
+
rel: props.open_in_new_tab ? 'noopen noreferrer' : undefined
|
950
|
+
},
|
951
|
+
/*#__PURE__*/
|
952
|
+
React.createElement("div", {
|
953
|
+
className: styles$5.link_thumbnail
|
954
|
+
},
|
955
|
+
/*#__PURE__*/
|
956
|
+
React.createElement(Image, {
|
957
|
+
imageFile: thumbnailImageFile,
|
958
|
+
load: props.loadImages,
|
959
|
+
variant: "linkThumbnailLarge"
|
960
|
+
})),
|
961
|
+
/*#__PURE__*/
|
962
|
+
React.createElement("div", {
|
963
|
+
className: styles$5.link_details
|
964
|
+
},
|
965
|
+
/*#__PURE__*/
|
966
|
+
React.createElement("p", {
|
967
|
+
className: styles$5.link_title
|
968
|
+
}, props.title),
|
969
|
+
/*#__PURE__*/
|
970
|
+
React.createElement("p", {
|
971
|
+
className: styles$5.link_desc
|
972
|
+
}, props.description)), renderNewTabTooltip())
|
973
|
+
);
|
974
|
+
}
|
975
|
+
|
976
|
+
var styles$6 = {"ext_links_container":"ExternalLinkList-module_ext_links_container__16IIo"};
|
977
|
+
|
978
|
+
function ExternalLinkList(props) {
|
979
|
+
var linkList = props.configuration.links || [];
|
980
|
+
|
981
|
+
var _useContentElementLif = useContentElementLifecycle(),
|
982
|
+
shouldLoad = _useContentElementLif.shouldLoad;
|
983
|
+
|
984
|
+
var darkBackground = useDarkBackground();
|
985
|
+
return (
|
986
|
+
/*#__PURE__*/
|
987
|
+
React.createElement("div", {
|
988
|
+
className: styles$6.ext_links_container
|
989
|
+
}, linkList.map(function (link, index) {
|
990
|
+
return (
|
991
|
+
/*#__PURE__*/
|
992
|
+
React.createElement(ExternalLink, Object.assign({}, link, {
|
993
|
+
key: link.id,
|
994
|
+
invert: !darkBackground,
|
995
|
+
sectionProps: props.sectionProps,
|
996
|
+
loadImages: shouldLoad
|
997
|
+
}))
|
998
|
+
);
|
999
|
+
}))
|
1000
|
+
);
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
frontend.contentElementTypes.register('externalLinkList', {
|
1004
|
+
component: ExternalLinkList,
|
1005
|
+
lifecycle: true
|
1006
|
+
});
|
1007
|
+
|
1008
|
+
function useIframeHeight(url) {
|
1009
|
+
var _useState = useState('400px'),
|
1010
|
+
_useState2 = _slicedToArray(_useState, 2),
|
1011
|
+
height = _useState2[0],
|
1012
|
+
setHeight = _useState2[1];
|
1013
|
+
|
1014
|
+
useEffect(function () {
|
1015
|
+
window.addEventListener('message', receive);
|
1016
|
+
|
1017
|
+
function receive(event) {
|
1018
|
+
if (typeof event.data['datawrapper-height'] !== 'undefined') {
|
1019
|
+
for (var chartId in event.data['datawrapper-height']) {
|
1020
|
+
if ((url === null || url === void 0 ? void 0 : url.indexOf(chartId)) > -1) {
|
1021
|
+
setHeight(event.data['datawrapper-height'][chartId] + 'px');
|
1022
|
+
}
|
1023
|
+
}
|
1024
|
+
}
|
1025
|
+
}
|
1026
|
+
|
1027
|
+
return function () {
|
1028
|
+
return window.removeEventListener('message', receive);
|
1029
|
+
};
|
1030
|
+
}, [url]);
|
1031
|
+
return height;
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
var styles$7 = {"container":"DataWrapperChart-module_container__2eZ15"};
|
1035
|
+
|
1036
|
+
function DataWrapperChart(_ref) {
|
1037
|
+
var configuration = _ref.configuration;
|
1038
|
+
|
1039
|
+
var _useI18n = useI18n(),
|
1040
|
+
t = _useI18n.t;
|
1041
|
+
|
1042
|
+
var _useContentElementLif = useContentElementLifecycle(),
|
1043
|
+
shouldLoad = _useContentElementLif.shouldLoad;
|
1044
|
+
|
1045
|
+
var _useContentElementEdi = useContentElementEditorState(),
|
1046
|
+
isEditable = _useContentElementEdi.isEditable,
|
1047
|
+
isSelected = _useContentElementEdi.isSelected;
|
1048
|
+
|
1049
|
+
var height = useIframeHeight(configuration.url); // remove url protocol, so that it is selected by the browser itself
|
1050
|
+
|
1051
|
+
var srcURL = '';
|
1052
|
+
|
1053
|
+
if (configuration.url) {
|
1054
|
+
srcURL = configuration.url.replace(/http(s|):/, '');
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
var backgroundColor = configuration.backgroundColor || '#323d4d';
|
1058
|
+
return (
|
1059
|
+
/*#__PURE__*/
|
1060
|
+
React.createElement(Figure, {
|
1061
|
+
caption: configuration.caption
|
1062
|
+
},
|
1063
|
+
/*#__PURE__*/
|
1064
|
+
React.createElement("div", {
|
1065
|
+
className: styles$7.container,
|
1066
|
+
style: {
|
1067
|
+
pointerEvents: isEditable && !isSelected ? 'none' : undefined,
|
1068
|
+
backgroundColor: backgroundColor,
|
1069
|
+
color: textColorForBackgroundColor(backgroundColor),
|
1070
|
+
height: height
|
1071
|
+
},
|
1072
|
+
"data-percy": "hide"
|
1073
|
+
},
|
1074
|
+
/*#__PURE__*/
|
1075
|
+
React.createElement(ThirdPartyOptIn, {
|
1076
|
+
providerName: "datawrapper"
|
1077
|
+
}, shouldLoad && renderIframe(srcURL, configuration.title || t('pageflow_scrolled.public.chart.default_title')),
|
1078
|
+
/*#__PURE__*/
|
1079
|
+
React.createElement(ThirdPartyOptOutInfo, {
|
1080
|
+
providerName: "datawrapper",
|
1081
|
+
contentElementPosition: configuration.position
|
1082
|
+
}))))
|
1083
|
+
);
|
1084
|
+
}
|
1085
|
+
|
1086
|
+
function renderIframe(url, title) {
|
1087
|
+
if (!url) {
|
1088
|
+
return null;
|
1089
|
+
}
|
1090
|
+
|
1091
|
+
return (
|
1092
|
+
/*#__PURE__*/
|
1093
|
+
React.createElement("iframe", {
|
1094
|
+
src: url,
|
1095
|
+
title: title,
|
1096
|
+
scrolling: "no",
|
1097
|
+
allowFullScreen: true,
|
1098
|
+
mozallowfullscreen: "true",
|
1099
|
+
webkitallowfullscreen: "true"
|
1100
|
+
})
|
1101
|
+
);
|
1102
|
+
}
|
1103
|
+
|
1104
|
+
frontend.contentElementTypes.register('dataWrapperChart', {
|
1105
|
+
component: DataWrapperChart,
|
1106
|
+
lifecycle: true
|
1107
|
+
});
|
1108
|
+
|
1109
|
+
function VrImage(_ref) {
|
1110
|
+
var configuration = _ref.configuration;
|
1111
|
+
|
1112
|
+
var _useContentElementLif = useContentElementLifecycle({
|
1113
|
+
onActivate: function onActivate() {
|
1114
|
+
if (viewerRef.current) {
|
1115
|
+
viewerRef.current.lookAt({
|
1116
|
+
yaw: viewerRef.current.getYaw() + 20
|
1117
|
+
}, 1000);
|
1118
|
+
}
|
1119
|
+
}
|
1120
|
+
}),
|
1121
|
+
shouldLoad = _useContentElementLif.shouldLoad;
|
1122
|
+
|
1123
|
+
var _useContentElementEdi = useContentElementEditorState(),
|
1124
|
+
isEditable = _useContentElementEdi.isEditable,
|
1125
|
+
isSelected = _useContentElementEdi.isSelected;
|
1126
|
+
|
1127
|
+
var viewerRef = useRef();
|
1128
|
+
var imageFile = useFile({
|
1129
|
+
collectionName: 'imageFiles',
|
1130
|
+
permaId: configuration.image
|
1131
|
+
});
|
1132
|
+
return (
|
1133
|
+
/*#__PURE__*/
|
1134
|
+
React.createElement("div", {
|
1135
|
+
style: {
|
1136
|
+
pointerEvents: isEditable && !isSelected ? 'none' : undefined
|
1137
|
+
}
|
1138
|
+
},
|
1139
|
+
/*#__PURE__*/
|
1140
|
+
React.createElement(Figure, {
|
1141
|
+
caption: configuration.caption
|
1142
|
+
},
|
1143
|
+
/*#__PURE__*/
|
1144
|
+
React.createElement(ViewportDependentPillarBoxes, {
|
1145
|
+
aspectRatio: configuration.position === 'full' ? 0.5 : 0.75,
|
1146
|
+
position: configuration.position,
|
1147
|
+
opaque: !!configuration.caption
|
1148
|
+
}, renderLazyPanorama(configuration, imageFile, shouldLoad, viewerRef))))
|
1149
|
+
);
|
1150
|
+
}
|
1151
|
+
|
1152
|
+
function renderLazyPanorama(configuration, imageFile, shouldLoad, viewerRef) {
|
1153
|
+
if (shouldLoad && imageFile && imageFile.isReady) {
|
1154
|
+
return (
|
1155
|
+
/*#__PURE__*/
|
1156
|
+
React.createElement(Panorama, {
|
1157
|
+
imageFile: imageFile,
|
1158
|
+
initialYaw: configuration.initialYaw,
|
1159
|
+
initialPitch: configuration.initialPitch,
|
1160
|
+
viewerRef: viewerRef
|
1161
|
+
})
|
1162
|
+
);
|
1163
|
+
}
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
frontend.contentElementTypes.register('vrImage', {
|
1167
|
+
component: VrImage,
|
1168
|
+
lifecycle: true
|
1169
|
+
});
|