pageflow 17.1.0 → 17.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +319 -345
- data/README.md +3 -4
- data/admins/pageflow/accounts.rb +6 -6
- data/admins/pageflow/entry.rb +10 -8
- data/admins/pageflow/membership.rb +11 -11
- data/admins/pageflow/translations.rb +5 -5
- data/app/assets/images/pageflow/admin/icons/comment.svg +1 -0
- data/app/assets/javascripts/pageflow/dist/ui.js +1350 -630
- data/app/assets/javascripts/pageflow/editor/vendor.js +0 -1
- data/app/assets/javascripts/pageflow/ui.js +0 -1
- data/app/assets/stylesheets/pageflow/admin/entry_comments_indicator.scss +45 -0
- data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +8 -1
- data/app/assets/stylesheets/pageflow/admin.scss +1 -0
- data/app/assets/stylesheets/pageflow/animations/spin.scss +9 -0
- data/app/assets/stylesheets/pageflow/animations.scss +1 -0
- data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +21 -5
- data/app/assets/stylesheets/pageflow/editor/base.scss +9 -1
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +13 -1
- data/app/assets/stylesheets/pageflow/editor/edit_configuration_view.scss +5 -0
- data/app/assets/stylesheets/pageflow/editor/file_folders.scss +127 -0
- data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +0 -1
- data/app/assets/stylesheets/pageflow/editor/file_meta_data_overlay.scss +45 -0
- data/app/assets/stylesheets/pageflow/editor/file_preview.scss +138 -0
- data/app/assets/stylesheets/pageflow/editor/file_references.scss +68 -0
- data/app/assets/stylesheets/pageflow/editor/file_settings_dialog.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/file_stage_icons.scss +17 -0
- data/app/assets/stylesheets/pageflow/editor/file_stages.scss +25 -32
- data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +31 -48
- data/app/assets/stylesheets/pageflow/editor/file_type_pills.scss +73 -0
- data/app/assets/stylesheets/pageflow/editor/files.scss +230 -50
- data/app/assets/stylesheets/pageflow/editor/filtered_files.scss +142 -14
- data/app/assets/stylesheets/pageflow/editor/folder_breadcrumb.scss +40 -0
- data/app/assets/stylesheets/pageflow/editor/info_box.scss +12 -0
- data/app/assets/stylesheets/pageflow/editor/inputs/edit_defaults_button.scss +15 -0
- data/app/assets/stylesheets/pageflow/editor/inputs.scss +1 -0
- data/app/assets/stylesheets/pageflow/editor/list.scss +88 -38
- data/app/assets/stylesheets/pageflow/editor/manage_files.scss +9 -0
- data/app/assets/stylesheets/pageflow/editor/menu.scss +14 -0
- data/app/assets/stylesheets/pageflow/editor/move_to_folder_dialog.scss +83 -0
- data/app/assets/stylesheets/pageflow/mixins/pageflow.scss +9 -5
- data/app/assets/stylesheets/pageflow/ui/color_picker.scss +230 -0
- data/app/assets/stylesheets/pageflow/ui/forms.scss +34 -4
- data/app/assets/stylesheets/pageflow/ui/functions.scss +12 -2
- data/app/assets/stylesheets/pageflow/ui/input/color_input.scss +9 -16
- data/app/assets/stylesheets/pageflow/ui/input/text_area_input.scss +15 -0
- data/app/assets/stylesheets/pageflow/ui/overrides.scss +8 -0
- data/app/assets/stylesheets/pageflow/ui/properties.scss +29 -0
- data/app/assets/stylesheets/pageflow/ui/tabs_view.scss +8 -3
- data/app/assets/stylesheets/pageflow/ui.scss +4 -2
- data/app/controllers/pageflow/editor/entries_controller.rb +1 -0
- data/app/controllers/pageflow/editor/file_folders_controller.rb +80 -0
- data/app/controllers/pageflow/editor/file_import_controller.rb +1 -0
- data/app/controllers/pageflow/editor/files_controller.rb +15 -6
- data/app/controllers/pageflow/editor/oembeds_controller.rb +21 -0
- data/app/controllers/pageflow/entries_controller.rb +17 -13
- data/app/controllers/pageflow/review/comment_thread_reads_controller.rb +30 -0
- data/app/controllers/pageflow/review/comment_threads_controller.rb +60 -0
- data/app/controllers/pageflow/review/comments_controller.rb +53 -0
- data/app/controllers/pageflow/revisions_controller.rb +4 -1
- data/app/helpers/pageflow/admin/entries_helper.rb +40 -0
- data/app/helpers/pageflow/admin/widgets_helper.rb +2 -2
- data/app/helpers/pageflow/common_entry_seed_helper.rb +5 -3
- data/app/helpers/pageflow/editor/config_helper.rb +3 -1
- data/app/helpers/pageflow/entries_helper.rb +24 -42
- data/app/helpers/pageflow/entry_json_seed_helper.rb +4 -4
- data/app/helpers/pageflow/public_i18n_helper.rb +9 -8
- data/app/helpers/pageflow/structured_data_helper.rb +4 -1
- data/app/helpers/pageflow/themes_helper.rb +1 -3
- data/app/helpers/pageflow/widgets_helper.rb +2 -1
- data/app/inputs/pageflow_permalink_input.rb +6 -2
- data/app/models/concerns/pageflow/auto_generated_perma_id.rb +11 -4
- data/app/models/concerns/pageflow/reusable_file.rb +1 -1
- data/app/models/concerns/pageflow/serialization_blacklist.rb +2 -4
- data/app/models/concerns/pageflow/translated_attributes.rb +101 -0
- data/app/models/concerns/pageflow/uploadable_file.rb +1 -1
- data/app/models/pageflow/comment.rb +30 -0
- data/app/models/pageflow/comment_thread.rb +65 -0
- data/app/models/pageflow/comment_thread_read.rb +22 -0
- data/app/models/pageflow/customized_theme.rb +3 -2
- data/app/models/pageflow/draft_entry.rb +20 -8
- data/app/models/pageflow/entry.rb +2 -0
- data/app/models/pageflow/entry_at_revision.rb +9 -1
- data/app/models/pageflow/entry_comment_summary.rb +114 -0
- data/app/models/pageflow/file_folder.rb +74 -0
- data/app/models/pageflow/file_reuse.rb +3 -2
- data/app/models/pageflow/file_usage.rb +8 -0
- data/app/models/pageflow/image_file.rb +24 -20
- data/app/models/pageflow/image_file_url_templates.rb +3 -3
- data/app/models/pageflow/legal_info.rb +38 -0
- data/app/models/pageflow/nested_revision_component_copy.rb +1 -1
- data/app/models/pageflow/permalink.rb +1 -0
- data/app/models/pageflow/revision.rb +6 -2
- data/app/models/pageflow/site.rb +10 -0
- data/app/models/pageflow/used_file.rb +8 -2
- data/app/models/pageflow/widget.rb +2 -2
- data/app/views/pageflow/audio_files/_audio_file.json.jbuilder +0 -1
- data/app/views/pageflow/editor/config/_seeds.json.jbuilder +4 -2
- data/app/views/pageflow/editor/entries/_entry.json.jbuilder +2 -1
- data/app/views/pageflow/editor/entries/seed.json.erb +1 -0
- data/app/views/pageflow/editor/file_folders/_file_folder.json.jbuilder +5 -0
- data/app/views/pageflow/editor/file_folders/create.json.jbuilder +1 -0
- data/app/views/pageflow/editor/file_folders/index.json.jbuilder +3 -0
- data/app/views/pageflow/editor/files/_file.json.jbuilder +2 -1
- data/app/views/pageflow/editor/image_files/_image_file.json.jbuilder +3 -0
- data/app/views/pageflow/editor/video_files/_video_file.json.jbuilder +3 -0
- data/app/views/pageflow/files/_file.json.jbuilder +2 -0
- data/app/views/pageflow/image_files/_image_file.json.jbuilder +0 -1
- data/app/views/pageflow/review/comment_threads/_comment_thread.json.jbuilder +20 -0
- data/app/views/pageflow/review/comment_threads/create.json.jbuilder +2 -0
- data/app/views/pageflow/review/comment_threads/index.json.jbuilder +13 -0
- data/app/views/pageflow/review/comments/_comment.json.jbuilder +13 -0
- data/app/views/pageflow/review/comments/create.json.jbuilder +1 -0
- data/app/views/pageflow/structured_data/_entry.json.jbuilder +2 -3
- data/app/views/pageflow/video_files/_video_file.json.jbuilder +0 -1
- data/config/locales/de.yml +152 -14
- data/config/locales/en.yml +150 -14
- data/config/routes.rb +14 -0
- data/db/migrate/20140418225525_setup_schema.rb +2 -2
- data/db/migrate/20251015000000_add_structured_data_type_name_to_revisions.rb +5 -0
- data/db/migrate/20251029142849_convert_legacy_social_embeds_to_unified_social_embed.rb +38 -0
- data/db/migrate/20251119083347_fix_main_storyline_positions.rb +16 -0
- data/db/migrate/20251119083348_ensure_scrolled_entries_have_excursion_storyline.rb +15 -0
- data/db/migrate/20260303000000_add_layout_version_to_revisions.rb +6 -0
- data/db/migrate/20260323000000_create_comment_threads_and_comments.rb +30 -0
- data/db/migrate/20260414000000_add_subject_range_to_comment_threads.rb +5 -0
- data/db/migrate/20260415000000_add_section_perma_id_to_comment_threads.rb +5 -0
- data/db/migrate/20260727000000_add_quote_to_comments.rb +5 -0
- data/db/migrate/20260728000000_create_file_folders.rb +17 -0
- data/db/migrate/20260805000000_add_attribute_translations_to_sites.rb +5 -0
- data/db/migrate/20260806000000_add_edited_at_to_comments.rb +5 -0
- data/db/migrate/20260810000000_create_pageflow_scrolled_lottie_files.rb +24 -0
- data/db/migrate/20260817000000_create_comment_thread_reads.rb +16 -0
- data/db/migrate/20260819000000_add_unread_comments_since_at_to_users.rb +18 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +8665 -3890
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +979 -3571
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +20199 -28120
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +18652 -26584
- data/entry_types/scrolled/app/assets/stylesheets/pageflow_scrolled/ui.scss +2 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +33 -3
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +2 -3
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +21 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/cache_helper.rb +3 -3
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/entry_json_seed_helper.rb +7 -5
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +5 -2
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +13 -5
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/i18n_helper.rb +28 -13
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +26 -11
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +2 -2
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/sprockets_helper.rb +16 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +174 -3
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +49 -7
- data/entry_types/scrolled/app/models/pageflow_scrolled/lottie_file.rb +6 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/lottie_file_url_templates.rb +16 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb +1 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +13 -12
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +30 -10
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +9 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/favicons/_entry.html.erb +1 -1
- data/entry_types/scrolled/config/configuration_schemas/pageflow-scrolled.json +414 -0
- data/entry_types/scrolled/config/locales/de.yml +512 -65
- data/entry_types/scrolled/config/locales/en.yml +518 -52
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +2 -2
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +51 -6
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration_schemas.rb +91 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +2 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/entry_file_reference_locations.rb +71 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/entry_structured_data_types/faq_page.rb +58 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/file_reference_locations.rb +69 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +205 -22
- data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +2 -4
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +56 -36
- data/entry_types/scrolled/lib/pageflow_scrolled/theme_options_default_scale.rb +35 -0
- data/entry_types/scrolled/lib/pageflow_scrolled.rb +13 -0
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +19 -1
- data/entry_types/scrolled/package/config/configurationSchemas.js +70 -0
- data/entry_types/scrolled/package/config/rollup/configurationSchemas.js +19 -0
- data/entry_types/scrolled/package/config/webpack.js +72 -0
- data/entry_types/scrolled/package/contentElements/hotspots-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements/hotspots-frontend.js +1181 -915
- data/entry_types/scrolled/package/contentElements/inlineBeforeAfter-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements/inlineBeforeAfter-frontend.js +219 -0
- data/entry_types/scrolled/package/contentElements/lottieAnimation-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements/lottieAnimation-frontend.js +244 -0
- data/entry_types/scrolled/package/contentElements/socialEmbed-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements/socialEmbed-frontend.js +823 -0
- data/entry_types/scrolled/package/contentElements/tikTokEmbed-frontend.js +71 -21
- data/entry_types/scrolled/package/contentElements/twitterEmbed-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements/twitterEmbed-frontend.js +277 -0
- data/entry_types/scrolled/package/contentElements/videoEmbed-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements/videoEmbed-frontend.js +244 -0
- data/entry_types/scrolled/package/contentElements-editor.js +1915 -1097
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +3093 -1679
- data/entry_types/scrolled/package/editor.css +1 -0
- data/entry_types/scrolled/package/editor.js +8667 -4077
- data/entry_types/scrolled/package/entryState.js +1600 -0
- data/entry_types/scrolled/package/frontend/FloatingPortalRootProvider-20c600de.js +1979 -0
- data/entry_types/scrolled/package/frontend/FloatingPortalRootProvider-58189220.js +2538 -0
- data/entry_types/scrolled/package/frontend/{PhonePlatformContext-9f76033e.js → PhonePlatformContext-035a99fa.js} +7 -12
- data/entry_types/scrolled/package/frontend/PhonePlatformContext-9da43797.js +33 -0
- data/entry_types/scrolled/package/frontend/Placeholder.module-bf0966b4.js +5267 -0
- data/entry_types/scrolled/package/frontend/Placeholder.module-d22a9335.js +4180 -0
- data/entry_types/scrolled/package/frontend/ThemeIcon-ab834849.js +754 -0
- data/entry_types/scrolled/package/frontend/ThemeIcon-f6cb3a8f.js +773 -0
- data/entry_types/scrolled/package/frontend/{ToggleFullscreenCornerButton-788e9cdb.js → ToggleFullscreenCornerButton-30fd1124.js} +6 -6
- data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-61c25224.js +72 -0
- data/entry_types/scrolled/package/frontend/Viewer-1074fd59.js +147 -0
- data/entry_types/scrolled/package/frontend/Viewer-1482ca34.js +480 -0
- data/entry_types/scrolled/package/frontend/Viewer-70504231.js +210 -0
- data/entry_types/scrolled/package/frontend/{Viewer-0345ce57.js → Viewer-cc8d4072.js} +84 -92
- data/entry_types/scrolled/package/frontend/Wavesurfer-656e3c36.js +302 -0
- data/entry_types/scrolled/package/frontend/Wavesurfer-b753b838.js +385 -0
- data/entry_types/scrolled/package/frontend/commenting.css +1 -0
- data/entry_types/scrolled/package/frontend/extensions-167ae143.js +1455 -0
- data/entry_types/scrolled/package/frontend/extensions-2318f92b.js +5918 -0
- data/entry_types/scrolled/package/frontend/extensions-a461fd13.js +4890 -0
- data/entry_types/scrolled/package/frontend/extensions-c98269fd.js +1982 -0
- data/entry_types/scrolled/package/frontend/i18n-493cd2a6.js +93 -0
- data/entry_types/scrolled/package/frontend/i18n-e06cac14.js +100 -0
- data/entry_types/scrolled/package/frontend/{index-eb670c2f.js → index-2e5546f7.js} +36 -44
- data/entry_types/scrolled/package/frontend/index-de2b418d.js +130 -0
- data/entry_types/scrolled/package/frontend/index.css +1 -1
- data/entry_types/scrolled/package/frontend/index.js +1870 -875
- data/entry_types/scrolled/package/frontend/inlineEditing.css +1 -0
- data/entry_types/scrolled/package/frontend/useContentElementEditorState-a084912e.js +25 -0
- data/entry_types/scrolled/package/frontend/useDelayedBoolean-a387d85b.js +24 -0
- data/entry_types/scrolled/package/frontend/{usePhonePlatform-c2ba875d.js → usePhonePlatform-4ecb96d4.js} +1 -1
- data/entry_types/scrolled/package/frontend/usePhonePlatform-ce9ff08d.js +8 -0
- data/entry_types/scrolled/package/frontend-server.js +20 -209
- data/entry_types/scrolled/package/package.json +5 -3
- data/entry_types/scrolled/package/review.css +1 -0
- data/entry_types/scrolled/package/review.js +3306 -0
- data/entry_types/scrolled/package/testHelpers.js +836 -359
- data/entry_types/scrolled/package/widgets/consentBar.css +1 -1
- data/entry_types/scrolled/package/widgets/consentBar.js +269 -290
- data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
- data/entry_types/scrolled/package/widgets/defaultNavigation.js +911 -352
- data/entry_types/scrolled/package/widgets/excursionSheet.css +1 -1
- data/entry_types/scrolled/package/widgets/excursionSheet.js +87 -124
- data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -1
- data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +62 -29
- data/entry_types/scrolled/package/widgets/iconScrollIndicator.js +32 -13
- data/entry_types/scrolled/package/widgets/mainStorylineSheet.css +1 -1
- data/entry_types/scrolled/package/widgets/mainStorylineSheet.js +56 -100
- data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -1
- data/entry_types/scrolled/package/widgets/textInlineFileRights.js +33 -28
- data/entry_types/scrolled/package/widgets-server.js +1 -0
- data/entry_types/scrolled/spec/factories/lottie_files.rb +29 -0
- data/entry_types/scrolled/spec/fixtures/animation.lottie +0 -0
- data/entry_types/scrolled/spec/fixtures/font.woff +0 -0
- data/entry_types/scrolled/spec/fixtures/font.woff2 +0 -0
- data/lib/generators/pageflow/resque/resque_generator.rb +0 -2
- data/lib/pageflow/configuration.rb +49 -7
- data/lib/pageflow/deprecation.rb +19 -0
- data/lib/pageflow/engine.rb +1 -1
- data/lib/pageflow/entries_controller_env_helper.rb +32 -2
- data/lib/pageflow/entry_export_import/entry_serialization.rb +4 -4
- data/lib/pageflow/entry_export_import/page_type_versions.rb +2 -2
- data/lib/pageflow/entry_export_import/revision_serialization/import.rb +10 -0
- data/lib/pageflow/entry_export_import/revision_serialization.rb +3 -0
- data/lib/pageflow/entry_structured_data_types.rb +43 -0
- data/lib/pageflow/entry_type_configuration.rb +1 -0
- data/lib/pageflow/file_type.rb +2 -2
- data/lib/pageflow/file_types.rb +1 -1
- data/lib/pageflow/oembed_providers.rb +42 -0
- data/lib/pageflow/primary_domain_entry_redirect.rb +6 -0
- data/lib/pageflow/rails_version.rb +13 -2
- data/lib/pageflow/themes.rb +41 -0
- data/lib/pageflow/user_mixin.rb +12 -0
- data/lib/pageflow/version.rb +1 -1
- data/lib/pageflow.rb +1 -0
- data/package/config/eslint-rules/documented-in-toc.js +125 -0
- data/package/config/jest/index.js +0 -1
- data/package/config/webpack.js +0 -1
- data/package/config/webpack5.js +0 -1
- data/package/editor.js +4378 -1897
- data/package/frontend.js +647 -886
- data/package/package.json +2 -1
- data/package/review.js +384 -0
- data/package/testHelpers.js +248 -188
- data/package/ui.js +1346 -630
- data/package/vendor/stubs/wysihtml5.js +2 -0
- data/spec/factories/comment_thread_reads.rb +10 -0
- data/spec/factories/comment_threads.rb +10 -0
- data/spec/factories/comments.rb +9 -0
- data/spec/factories/file_folders.rb +8 -0
- data/spec/factories/published_entries.rb +2 -0
- metadata +188 -67
- data/app/assets/stylesheets/pageflow/editor/select_button.scss +0 -51
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/generated_media_queries_helper.rb +0 -55
- data/entry_types/scrolled/package/frontend/FloatingPortalRootProvider-51914be7.js +0 -5439
- data/entry_types/scrolled/package/frontend/ThemeIcon-81f2f066.js +0 -1932
- data/entry_types/scrolled/package/frontend/Viewer-cdc549cc.js +0 -147
- data/entry_types/scrolled/package/frontend/Wavesurfer-1cdc3925.js +0 -313
- data/entry_types/scrolled/package/frontend/components-96660ffd.js +0 -3803
- data/entry_types/scrolled/package/frontend/inherits-539844a6.js +0 -99
- data/entry_types/scrolled/package/frontend/useContentElementEditorState-77fe6c79.js +0 -51
- data/entry_types/scrolled/package/widgets/excursionDialog.css +0 -1
- data/entry_types/scrolled/package/widgets/excursionDialog.js +0 -109
- data/lib/generators/pageflow/resque/templates/resque_enqueue_after_commit_patch.rb +0 -25
- data/package/vendor/jquery.minicolors.js +0 -1108
|
@@ -1,146 +1,143 @@
|
|
|
1
|
-
import { useI18n, ThemeIcon, paletteColor, useContentElementLifecycle, useFile, Image, useContentElementConfigurationUpdate, useContentElementEditorState, useDarkBackground, useFileWithInlineRights, useFloatingPortalRoot, utils, InlineFileRights, Text, EditableInlineText, EditableText, LinkButton, usePortraitOrientation, usePhonePlatform, useContentElementEditorCommandSubscription, useIsomorphicLayoutEffect, FullscreenViewer, contentElementWidths, ContentElementBox, ContentElementFigure, FitViewport, ToggleFullscreenCornerButton, frontend } from 'pageflow-scrolled/frontend';
|
|
1
|
+
import { useI18n, ThemeIcon, useTheme, paletteColor, useContentElementLifecycle, useFile, Image, useContentElementConfigurationUpdate, useContentElementEditorState, useStorylineActivity, useDelayedBoolean, useDarkBackground, useFileWithInlineRights, useFloatingPortalRoot, utils, InlineFileRights, Text, EditableInlineText, EditableText, LinkButton, usePortraitOrientation, usePhonePlatform, useContentElementEditorCommandSubscription, useIsomorphicLayoutEffect, FullscreenViewer, contentElementWidths, ContentElementBox, ContentElementFigure, FitViewport, FilePlaceholder, ToggleFullscreenCornerButton, frontend } from 'pageflow-scrolled/frontend';
|
|
2
2
|
import React, { useRef, useMemo, useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import { FloatingPortal, useTransitionStyles, useFloating, offset, shift, flip, arrow, autoUpdate, useRole, useDismiss, useInteractions, CompositeItem, FloatingFocusManager, FloatingArrow, Composite } from '@floating-ui/react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
|
|
6
|
-
function _arrayWithHoles(arr) {
|
|
7
|
-
if (Array.isArray(arr)) return arr;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function _iterableToArrayLimit(arr, i) {
|
|
11
|
-
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
|
12
|
-
var _arr = [];
|
|
13
|
-
var _n = true;
|
|
14
|
-
var _d = false;
|
|
15
|
-
var _e = undefined;
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
19
|
-
_arr.push(_s.value);
|
|
20
|
-
|
|
21
|
-
if (i && _arr.length === i) break;
|
|
22
|
-
}
|
|
23
|
-
} catch (err) {
|
|
24
|
-
_d = true;
|
|
25
|
-
_e = err;
|
|
26
|
-
} finally {
|
|
27
|
-
try {
|
|
28
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
29
|
-
} finally {
|
|
30
|
-
if (_d) throw _e;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return _arr;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function _arrayLikeToArray(arr, len) {
|
|
38
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
39
|
-
|
|
40
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
41
|
-
arr2[i] = arr[i];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return arr2;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
48
|
-
if (!o) return;
|
|
49
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
50
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
51
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
52
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
53
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _nonIterableRest() {
|
|
57
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _slicedToArray(arr, i) {
|
|
61
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _defineProperty(obj, key, value) {
|
|
65
|
-
if (key in obj) {
|
|
66
|
-
Object.defineProperty(obj, key, {
|
|
67
|
-
value: value,
|
|
68
|
-
enumerable: true,
|
|
69
|
-
configurable: true,
|
|
70
|
-
writable: true
|
|
71
|
-
});
|
|
72
|
-
} else {
|
|
73
|
-
obj[key] = value;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return obj;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
6
|
var styles = {"button":"PagerButton-module_button__1WPOu","icon":"PagerButton-module_icon__346kq","disabled":"PagerButton-module_disabled__1SbjV","visuallyHidden":"PagerButton-module_visuallyHidden__1Hrir"};
|
|
80
7
|
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
8
|
+
var _jsxFileName = "/home/tfischbach/code/pageflow/entry_types/scrolled/package/src/contentElements/hotspots/PagerButton.js";
|
|
9
|
+
const size = 40;
|
|
10
|
+
function PagerButton({
|
|
11
|
+
direction,
|
|
12
|
+
disabled,
|
|
13
|
+
onClick
|
|
14
|
+
}) {
|
|
15
|
+
const {
|
|
16
|
+
t
|
|
17
|
+
} = useI18n();
|
|
88
18
|
return /*#__PURE__*/React.createElement("button", {
|
|
89
|
-
className: classNames(styles.button,
|
|
19
|
+
className: classNames(styles.button, {
|
|
20
|
+
[styles.disabled]: disabled
|
|
21
|
+
}),
|
|
90
22
|
tabIndex: "-1",
|
|
91
|
-
onClick: onClick
|
|
23
|
+
onClick: onClick,
|
|
24
|
+
__self: this,
|
|
25
|
+
__source: {
|
|
26
|
+
fileName: _jsxFileName,
|
|
27
|
+
lineNumber: 13,
|
|
28
|
+
columnNumber: 5
|
|
29
|
+
}
|
|
92
30
|
}, /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
className: styles.icon
|
|
31
|
+
className: styles.icon,
|
|
32
|
+
__self: this,
|
|
33
|
+
__source: {
|
|
34
|
+
fileName: _jsxFileName,
|
|
35
|
+
lineNumber: 17,
|
|
36
|
+
columnNumber: 7
|
|
37
|
+
}
|
|
94
38
|
}, /*#__PURE__*/React.createElement(ThemeIcon, {
|
|
95
39
|
name: direction === 'left' ? 'arrowLeft' : 'arrowRight',
|
|
96
40
|
width: size,
|
|
97
|
-
height: size
|
|
41
|
+
height: size,
|
|
42
|
+
__self: this,
|
|
43
|
+
__source: {
|
|
44
|
+
fileName: _jsxFileName,
|
|
45
|
+
lineNumber: 18,
|
|
46
|
+
columnNumber: 9
|
|
47
|
+
}
|
|
98
48
|
}), /*#__PURE__*/React.createElement("span", {
|
|
99
|
-
className: styles.visuallyHidden
|
|
49
|
+
className: styles.visuallyHidden,
|
|
50
|
+
__self: this,
|
|
51
|
+
__source: {
|
|
52
|
+
fileName: _jsxFileName,
|
|
53
|
+
lineNumber: 21,
|
|
54
|
+
columnNumber: 9
|
|
55
|
+
}
|
|
100
56
|
}, t(direction === 'left' ? 'pageflow_scrolled.public.previous' : 'pageflow_scrolled.public.next'))));
|
|
101
57
|
}
|
|
102
58
|
function insidePagerButton(element) {
|
|
103
|
-
return !!element.closest(
|
|
59
|
+
return !!element.closest(`.${styles.button}`);
|
|
104
60
|
}
|
|
105
61
|
|
|
106
62
|
var styles$1 = {"outer":"Pager-module_outer__2CrMo","customMargin":"Pager-module_customMargin__1qTs3","left":"Pager-module_left__2UmsW","right":"Pager-module_right__2Qn5W","center":"Pager-module_center__1nzq4"};
|
|
107
63
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
64
|
+
var _jsxFileName$1 = "/home/tfischbach/code/pageflow/entry_types/scrolled/package/src/contentElements/hotspots/Pager.js";
|
|
65
|
+
function Pager({
|
|
66
|
+
areas,
|
|
67
|
+
customMargin,
|
|
68
|
+
panZoomEnabled,
|
|
69
|
+
hideButtons,
|
|
70
|
+
activeIndex,
|
|
71
|
+
activateArea,
|
|
72
|
+
children
|
|
73
|
+
}) {
|
|
74
|
+
const theme = useTheme();
|
|
116
75
|
return /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className: classNames(styles$1.outer,
|
|
76
|
+
className: classNames(styles$1.outer, {
|
|
77
|
+
[styles$1.customMargin]: customMargin
|
|
78
|
+
}),
|
|
79
|
+
__self: this,
|
|
80
|
+
__source: {
|
|
81
|
+
fileName: _jsxFileName$1,
|
|
82
|
+
lineNumber: 17,
|
|
83
|
+
columnNumber: 5
|
|
84
|
+
}
|
|
118
85
|
}, renderScrollButtons(), /*#__PURE__*/React.createElement("div", {
|
|
119
|
-
className: styles$1.center
|
|
86
|
+
className: styles$1.center,
|
|
87
|
+
__self: this,
|
|
88
|
+
__source: {
|
|
89
|
+
fileName: _jsxFileName$1,
|
|
90
|
+
lineNumber: 19,
|
|
91
|
+
columnNumber: 7
|
|
92
|
+
}
|
|
120
93
|
}, children));
|
|
121
94
|
function renderScrollButtons() {
|
|
122
|
-
if (!panZoomEnabled) {
|
|
95
|
+
if (!panZoomEnabled || theme.options.hotspotsPagerButtonsHidden) {
|
|
123
96
|
return null;
|
|
124
97
|
}
|
|
125
98
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
126
|
-
className: styles$1.left
|
|
99
|
+
className: styles$1.left,
|
|
100
|
+
__self: this,
|
|
101
|
+
__source: {
|
|
102
|
+
fileName: _jsxFileName$1,
|
|
103
|
+
lineNumber: 32,
|
|
104
|
+
columnNumber: 9
|
|
105
|
+
}
|
|
127
106
|
}, /*#__PURE__*/React.createElement(PagerButton, {
|
|
128
107
|
direction: "left",
|
|
129
108
|
disabled: activeIndex === -1 || hideButtons,
|
|
130
|
-
onClick:
|
|
109
|
+
onClick: () => {
|
|
131
110
|
if (activeIndex >= 0) {
|
|
132
111
|
activateArea(activeIndex - 1);
|
|
133
112
|
}
|
|
113
|
+
},
|
|
114
|
+
__self: this,
|
|
115
|
+
__source: {
|
|
116
|
+
fileName: _jsxFileName$1,
|
|
117
|
+
lineNumber: 33,
|
|
118
|
+
columnNumber: 11
|
|
134
119
|
}
|
|
135
120
|
})), /*#__PURE__*/React.createElement("div", {
|
|
136
|
-
className: styles$1.right
|
|
121
|
+
className: styles$1.right,
|
|
122
|
+
__self: this,
|
|
123
|
+
__source: {
|
|
124
|
+
fileName: _jsxFileName$1,
|
|
125
|
+
lineNumber: 41,
|
|
126
|
+
columnNumber: 9
|
|
127
|
+
}
|
|
137
128
|
}, /*#__PURE__*/React.createElement(PagerButton, {
|
|
138
129
|
direction: "right",
|
|
139
130
|
disabled: activeIndex >= areas.length || hideButtons,
|
|
140
|
-
onClick:
|
|
131
|
+
onClick: () => {
|
|
141
132
|
if (activeIndex < areas.length) {
|
|
142
133
|
activateArea(activeIndex + 1);
|
|
143
134
|
}
|
|
135
|
+
},
|
|
136
|
+
__self: this,
|
|
137
|
+
__source: {
|
|
138
|
+
fileName: _jsxFileName$1,
|
|
139
|
+
lineNumber: 42,
|
|
140
|
+
columnNumber: 11
|
|
144
141
|
}
|
|
145
142
|
})));
|
|
146
143
|
}
|
|
@@ -148,47 +145,82 @@ function Pager(_ref) {
|
|
|
148
145
|
|
|
149
146
|
var styles$2 = {"scroller":"Scroller-module_scroller__b_jkV","sticky":"Scroller-module_sticky__1nSEO","inner":"Scroller-module_inner__XTNms","step":"Scroller-module_step__1ar7Q"};
|
|
150
147
|
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
var _jsxFileName$2 = "/home/tfischbach/code/pageflow/entry_types/scrolled/package/src/contentElements/hotspots/Scroller.js";
|
|
149
|
+
const Scroller = React.forwardRef(function Scroller({
|
|
150
|
+
areas,
|
|
151
|
+
disabled,
|
|
152
|
+
setStepRef,
|
|
153
|
+
children
|
|
154
|
+
}, ref) {
|
|
156
155
|
if (disabled) {
|
|
157
156
|
return children;
|
|
158
157
|
}
|
|
159
158
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
160
159
|
ref: ref,
|
|
161
|
-
className: styles$2.scroller
|
|
160
|
+
className: styles$2.scroller,
|
|
161
|
+
__self: this,
|
|
162
|
+
__source: {
|
|
163
|
+
fileName: _jsxFileName$2,
|
|
164
|
+
lineNumber: 14,
|
|
165
|
+
columnNumber: 7
|
|
166
|
+
}
|
|
162
167
|
}, Array.from({
|
|
163
168
|
length: areas.length + 2
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
}, (_, index) => /*#__PURE__*/React.createElement("div", {
|
|
170
|
+
key: index,
|
|
171
|
+
ref: setStepRef(index),
|
|
172
|
+
className: styles$2.step,
|
|
173
|
+
__self: this,
|
|
174
|
+
__source: {
|
|
175
|
+
fileName: _jsxFileName$2,
|
|
176
|
+
lineNumber: 17,
|
|
177
|
+
columnNumber: 11
|
|
178
|
+
}
|
|
179
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
180
|
+
className: styles$2.sticky,
|
|
181
|
+
__self: this,
|
|
182
|
+
__source: {
|
|
183
|
+
fileName: _jsxFileName$2,
|
|
184
|
+
lineNumber: 21,
|
|
185
|
+
columnNumber: 9
|
|
186
|
+
}
|
|
172
187
|
}, /*#__PURE__*/React.createElement("div", {
|
|
173
|
-
className: styles$2.inner
|
|
188
|
+
className: styles$2.inner,
|
|
189
|
+
__self: this,
|
|
190
|
+
__source: {
|
|
191
|
+
fileName: _jsxFileName$2,
|
|
192
|
+
lineNumber: 22,
|
|
193
|
+
columnNumber: 11
|
|
194
|
+
}
|
|
174
195
|
}, children))));
|
|
175
196
|
});
|
|
176
197
|
|
|
177
198
|
var styles$3 = {"area":"Area-module_area__2uQD0","clip":"Area-module_clip__TgtiP","outline":"Area-module_outline__bRQqm","noPointerEvents":"Area-module_noPointerEvents__kLM1Z","hidden":"Area-module_hidden__2SAnU","highlighted":"Area-module_highlighted__2hdr1"};
|
|
178
199
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
200
|
+
var _jsxFileName$3 = "/home/tfischbach/code/pageflow/entry_types/scrolled/package/src/contentElements/hotspots/Area.js";
|
|
201
|
+
function Area({
|
|
202
|
+
area,
|
|
203
|
+
noPointerEvents,
|
|
204
|
+
highlighted,
|
|
205
|
+
outlined,
|
|
206
|
+
outlineHidden,
|
|
207
|
+
className,
|
|
208
|
+
children,
|
|
209
|
+
onMouseEnter,
|
|
210
|
+
onMouseLeave,
|
|
211
|
+
onClick
|
|
212
|
+
}) {
|
|
190
213
|
return /*#__PURE__*/React.createElement("div", {
|
|
191
|
-
className: classNames(styles$3.area, className,
|
|
214
|
+
className: classNames(styles$3.area, className, {
|
|
215
|
+
[styles$3.highlighted]: highlighted,
|
|
216
|
+
[styles$3.noPointerEvents]: noPointerEvents
|
|
217
|
+
}),
|
|
218
|
+
__self: this,
|
|
219
|
+
__source: {
|
|
220
|
+
fileName: _jsxFileName$3,
|
|
221
|
+
lineNumber: 15,
|
|
222
|
+
columnNumber: 5
|
|
223
|
+
}
|
|
192
224
|
}, /*#__PURE__*/React.createElement("div", {
|
|
193
225
|
className: styles$3.clip,
|
|
194
226
|
style: {
|
|
@@ -197,193 +229,156 @@ function Area(_ref) {
|
|
|
197
229
|
tabIndex: "-1",
|
|
198
230
|
onClick: onClick,
|
|
199
231
|
onMouseEnter: onMouseEnter,
|
|
200
|
-
onMouseLeave: onMouseLeave
|
|
232
|
+
onMouseLeave: onMouseLeave,
|
|
233
|
+
__self: this,
|
|
234
|
+
__source: {
|
|
235
|
+
fileName: _jsxFileName$3,
|
|
236
|
+
lineNumber: 19,
|
|
237
|
+
columnNumber: 7
|
|
238
|
+
}
|
|
201
239
|
}), children, outlined && /*#__PURE__*/React.createElement(Outline, {
|
|
202
240
|
points: area.outline,
|
|
203
241
|
color: areaColor(area),
|
|
204
|
-
hidden: outlineHidden
|
|
242
|
+
hidden: outlineHidden,
|
|
243
|
+
__self: this,
|
|
244
|
+
__source: {
|
|
245
|
+
fileName: _jsxFileName$3,
|
|
246
|
+
lineNumber: 26,
|
|
247
|
+
columnNumber: 20
|
|
248
|
+
}
|
|
205
249
|
}));
|
|
206
250
|
}
|
|
207
251
|
function areaColor(area) {
|
|
208
252
|
return paletteColor(area.color);
|
|
209
253
|
}
|
|
210
|
-
function Outline(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
254
|
+
function Outline({
|
|
255
|
+
points,
|
|
256
|
+
color,
|
|
257
|
+
hidden
|
|
258
|
+
}) {
|
|
214
259
|
return /*#__PURE__*/React.createElement("svg", {
|
|
215
|
-
className: classNames(styles$3.outline,
|
|
260
|
+
className: classNames(styles$3.outline, {
|
|
261
|
+
[styles$3.hidden]: hidden
|
|
262
|
+
}),
|
|
216
263
|
xmlns: "http://www.w3.org/2000/svg",
|
|
217
264
|
viewBox: "0 0 100 100",
|
|
218
|
-
preserveAspectRatio: "none"
|
|
265
|
+
preserveAspectRatio: "none",
|
|
266
|
+
__self: this,
|
|
267
|
+
__source: {
|
|
268
|
+
fileName: _jsxFileName$3,
|
|
269
|
+
lineNumber: 39,
|
|
270
|
+
columnNumber: 5
|
|
271
|
+
}
|
|
219
272
|
}, /*#__PURE__*/React.createElement("polygon", {
|
|
220
|
-
points: points.map(
|
|
221
|
-
return coords.map(function (coord) {
|
|
222
|
-
return coord;
|
|
223
|
-
}).join(',');
|
|
224
|
-
}).join(' '),
|
|
273
|
+
points: points.map(coords => coords.map(coord => coord).join(',')).join(' '),
|
|
225
274
|
style: {
|
|
226
275
|
stroke: color
|
|
276
|
+
},
|
|
277
|
+
__self: this,
|
|
278
|
+
__source: {
|
|
279
|
+
fileName: _jsxFileName$3,
|
|
280
|
+
lineNumber: 44,
|
|
281
|
+
columnNumber: 7
|
|
227
282
|
}
|
|
228
283
|
}));
|
|
229
284
|
}
|
|
230
285
|
function polygon(points) {
|
|
231
|
-
return
|
|
232
|
-
return coords.map(function (coord) {
|
|
233
|
-
return "".concat(coord, "%");
|
|
234
|
-
}).join(' ');
|
|
235
|
-
}).join(', '), ")");
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
239
|
-
if (source == null) return {};
|
|
240
|
-
var target = {};
|
|
241
|
-
var sourceKeys = Object.keys(source);
|
|
242
|
-
var key, i;
|
|
243
|
-
|
|
244
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
245
|
-
key = sourceKeys[i];
|
|
246
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
247
|
-
target[key] = source[key];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return target;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function _objectWithoutProperties(source, excluded) {
|
|
254
|
-
if (source == null) return {};
|
|
255
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
256
|
-
var key, i;
|
|
257
|
-
|
|
258
|
-
if (Object.getOwnPropertySymbols) {
|
|
259
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
260
|
-
|
|
261
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
262
|
-
key = sourceSymbolKeys[i];
|
|
263
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
264
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
265
|
-
target[key] = source[key];
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
return target;
|
|
286
|
+
return `polygon(${points.map(coords => coords.map(coord => `${coord}%`).join(' ')).join(', ')})`;
|
|
270
287
|
}
|
|
271
288
|
|
|
272
289
|
var styles$4 = {"area":"ImageArea-module_area__3rqgC","activeImageVisible":"ImageArea-module_activeImageVisible__oYKOK"};
|
|
273
290
|
|
|
274
|
-
var
|
|
275
|
-
function ImageArea(
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
291
|
+
var _jsxFileName$4 = "/home/tfischbach/code/pageflow/entry_types/scrolled/package/src/contentElements/hotspots/ImageArea.js";
|
|
292
|
+
function ImageArea({
|
|
293
|
+
panZoomEnabled,
|
|
294
|
+
activeImageVisible,
|
|
295
|
+
...props
|
|
296
|
+
}) {
|
|
297
|
+
const {
|
|
298
|
+
shouldLoad
|
|
299
|
+
} = useContentElementLifecycle();
|
|
300
|
+
const activeImageFile = useFile({
|
|
282
301
|
collectionName: 'imageFiles',
|
|
283
302
|
permaId: props.area.activeImage
|
|
284
303
|
});
|
|
285
|
-
|
|
304
|
+
const fallbackActiveImageFile = useFile({
|
|
286
305
|
collectionName: 'imageFiles',
|
|
287
306
|
permaId: props.area.fallbackActiveImage
|
|
288
307
|
});
|
|
289
308
|
return /*#__PURE__*/React.createElement(Area, Object.assign({}, props, {
|
|
290
|
-
className: classNames(styles$4.area,
|
|
309
|
+
className: classNames(styles$4.area, {
|
|
310
|
+
[styles$4.activeImageVisible]: activeImageVisible
|
|
311
|
+
}),
|
|
312
|
+
__self: this,
|
|
313
|
+
__source: {
|
|
314
|
+
fileName: _jsxFileName$4,
|
|
315
|
+
lineNumber: 29,
|
|
316
|
+
columnNumber: 5
|
|
317
|
+
}
|
|
291
318
|
}), /*#__PURE__*/React.createElement(Image, {
|
|
292
319
|
imageFile: activeImageFile || fallbackActiveImageFile,
|
|
293
320
|
load: shouldLoad,
|
|
294
321
|
variant: panZoomEnabled ? 'ultra' : 'large',
|
|
295
|
-
preferSvg: true
|
|
322
|
+
preferSvg: true,
|
|
323
|
+
__self: this,
|
|
324
|
+
__source: {
|
|
325
|
+
fileName: _jsxFileName$4,
|
|
326
|
+
lineNumber: 32,
|
|
327
|
+
columnNumber: 7
|
|
328
|
+
}
|
|
296
329
|
}));
|
|
297
330
|
}
|
|
298
331
|
|
|
299
332
|
var styles$5 = {"wrapper":"Indicator-module_wrapper__2b1Mj","indicator":"Indicator-module_indicator__2A3-l","inner":"Indicator-module_inner__2BgbL","hidden":"Indicator-module_hidden__3j1Re","outer":"Indicator-module_outer__36JWr"};
|
|
300
333
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
334
|
+
var _jsxFileName$5 = "/home/tfischbach/code/pageflow/entry_types/scrolled/package/src/contentElements/hotspots/Indicator.js";
|
|
335
|
+
function Indicator({
|
|
336
|
+
area,
|
|
337
|
+
hidden,
|
|
338
|
+
panZoomTransform,
|
|
339
|
+
outerRef
|
|
340
|
+
}) {
|
|
306
341
|
return /*#__PURE__*/React.createElement("div", {
|
|
307
342
|
className: styles$5.wrapper,
|
|
308
343
|
ref: outerRef,
|
|
309
344
|
style: {
|
|
310
345
|
transform: panZoomTransform
|
|
346
|
+
},
|
|
347
|
+
__self: this,
|
|
348
|
+
__source: {
|
|
349
|
+
fileName: _jsxFileName$5,
|
|
350
|
+
lineNumber: 10,
|
|
351
|
+
columnNumber: 5
|
|
311
352
|
}
|
|
312
353
|
}, /*#__PURE__*/React.createElement("div", {
|
|
313
|
-
className: classNames(styles$5.indicator,
|
|
354
|
+
className: classNames(styles$5.indicator, {
|
|
355
|
+
[styles$5.hidden]: hidden
|
|
356
|
+
}),
|
|
314
357
|
style: {
|
|
315
358
|
'--color': areaColor(area),
|
|
316
|
-
left:
|
|
317
|
-
top:
|
|
359
|
+
left: `${area.indicatorPosition[0]}%`,
|
|
360
|
+
top: `${area.indicatorPosition[1]}%`
|
|
361
|
+
},
|
|
362
|
+
__self: this,
|
|
363
|
+
__source: {
|
|
364
|
+
fileName: _jsxFileName$5,
|
|
365
|
+
lineNumber: 11,
|
|
366
|
+
columnNumber: 7
|
|
318
367
|
}
|
|
319
368
|
}));
|
|
320
369
|
}
|
|
321
370
|
|
|
322
|
-
|
|
323
|
-
var keys = Object.keys(object);
|
|
371
|
+
const TooltipPortal = FloatingPortal;
|
|
324
372
|
|
|
325
|
-
|
|
326
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
327
|
-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
328
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
329
|
-
});
|
|
330
|
-
keys.push.apply(keys, symbols);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
return keys;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function _objectSpread2(target) {
|
|
337
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
338
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
339
|
-
|
|
340
|
-
if (i % 2) {
|
|
341
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
342
|
-
_defineProperty(target, key, source[key]);
|
|
343
|
-
});
|
|
344
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
345
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
346
|
-
} else {
|
|
347
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
348
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
return target;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
var TooltipPortal = FloatingPortal;
|
|
357
|
-
|
|
358
|
-
var useTooltipTransitionStyles = useTransitionStyles;
|
|
359
|
-
|
|
360
|
-
function _arrayWithoutHoles(arr) {
|
|
361
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
function _iterableToArray(iter) {
|
|
365
|
-
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
function _nonIterableSpread() {
|
|
369
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
function _toConsumableArray(arr) {
|
|
373
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
374
|
-
}
|
|
373
|
+
const useTooltipTransitionStyles = useTransitionStyles;
|
|
375
374
|
|
|
376
375
|
function getBoundingRect(area) {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
var minX = Math.min.apply(Math, _toConsumableArray(xCoords));
|
|
384
|
-
var maxX = Math.max.apply(Math, _toConsumableArray(xCoords));
|
|
385
|
-
var minY = Math.min.apply(Math, _toConsumableArray(yCoords));
|
|
386
|
-
var maxY = Math.max.apply(Math, _toConsumableArray(yCoords));
|
|
376
|
+
const xCoords = area.map(point => point[0]);
|
|
377
|
+
const yCoords = area.map(point => point[1]);
|
|
378
|
+
const minX = Math.min(...xCoords);
|
|
379
|
+
const maxX = Math.max(...xCoords);
|
|
380
|
+
const minY = Math.min(...yCoords);
|
|
381
|
+
const maxY = Math.max(...yCoords);
|
|
387
382
|
return {
|
|
388
383
|
left: minX,
|
|
389
384
|
top: minY,
|
|
@@ -392,29 +387,31 @@ function getBoundingRect(area) {
|
|
|
392
387
|
};
|
|
393
388
|
}
|
|
394
389
|
|
|
395
|
-
function getTooltipInlineStyles(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
390
|
+
function getTooltipInlineStyles({
|
|
391
|
+
area,
|
|
392
|
+
panZoomTransform
|
|
393
|
+
}) {
|
|
394
|
+
const referencePositionInPercent = getReferencePositionInPercent({
|
|
395
|
+
area
|
|
400
396
|
});
|
|
401
397
|
return {
|
|
402
398
|
reference: {
|
|
403
|
-
left:
|
|
404
|
-
top:
|
|
405
|
-
height:
|
|
399
|
+
left: `${referencePositionInPercent.left}%`,
|
|
400
|
+
top: `${referencePositionInPercent.top}%`,
|
|
401
|
+
height: `${referencePositionInPercent.height}%`
|
|
406
402
|
},
|
|
407
403
|
wrapper: {
|
|
408
404
|
transform: panZoomTransform
|
|
409
405
|
}
|
|
410
406
|
};
|
|
411
407
|
}
|
|
412
|
-
function getReferencePositionInPercent(
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
408
|
+
function getReferencePositionInPercent({
|
|
409
|
+
area
|
|
410
|
+
}) {
|
|
411
|
+
const referenceType = area.tooltipReference;
|
|
412
|
+
const indicatorRect = getIndicatorRect(area.indicatorPosition);
|
|
416
413
|
if (referenceType === 'area') {
|
|
417
|
-
|
|
414
|
+
const boundingRect = getBoundingRect(area.outline);
|
|
418
415
|
return {
|
|
419
416
|
top: boundingRect.top,
|
|
420
417
|
height: boundingRect.height,
|
|
@@ -432,114 +429,144 @@ function getIndicatorRect(indicatorPosition) {
|
|
|
432
429
|
};
|
|
433
430
|
}
|
|
434
431
|
|
|
435
|
-
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)","darkContentLinkColor":"var(--theme-dark-content-link-color, var(--theme-content-link-color, currentColor))","lightContentLinkColor":"var(--theme-light-content-link-color, var(--theme-content-link-color, currentColor))","compositeItem":"Tooltip-module_compositeItem__3QnpM","wrapper":"Tooltip-module_wrapper__3J6qG","reference":"Tooltip-module_reference__1qjnL","box":"Tooltip-module_box__2MGMl","paddingForScrollButtons":"Tooltip-module_paddingForScrollButtons__3wFKp","light":"Tooltip-module_light__3H6Ii scope-darkContent","dark":"Tooltip-module_dark__2nDMy scope-lightContent","maxWidth-wide":"Tooltip-module_maxWidth-wide__3Vik_","maxWidth-narrow":"Tooltip-module_maxWidth-narrow__foMG0","maxWidth-veryNarrow":"Tooltip-module_maxWidth-veryNarrow__1yS6L","align-center":"Tooltip-module_align-center__jRtdN","align-right":"Tooltip-module_align-right__2ezWZ","minWidth":"Tooltip-module_minWidth__2iAip","imageWrapper":"Tooltip-module_imageWrapper__1BCEJ","
|
|
432
|
+
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)","darkContentLinkColor":"var(--theme-dark-content-link-color, var(--theme-content-link-color, currentColor))","lightContentLinkColor":"var(--theme-light-content-link-color, var(--theme-content-link-color, currentColor))","compositeItem":"Tooltip-module_compositeItem__3QnpM","wrapper":"Tooltip-module_wrapper__3J6qG","reference":"Tooltip-module_reference__1qjnL","box":"Tooltip-module_box__2MGMl","paddingForScrollButtons":"Tooltip-module_paddingForScrollButtons__3wFKp","light":"Tooltip-module_light__3H6Ii scope-darkContent","dark":"Tooltip-module_dark__2nDMy scope-lightContent","maxWidth-wide":"Tooltip-module_maxWidth-wide__3Vik_","maxWidth-narrow":"Tooltip-module_maxWidth-narrow__foMG0","maxWidth-veryNarrow":"Tooltip-module_maxWidth-veryNarrow__1yS6L","align-center":"Tooltip-module_align-center__jRtdN","align-right":"Tooltip-module_align-right__2ezWZ","minWidth":"Tooltip-module_minWidth__2iAip","imageWrapper":"Tooltip-module_imageWrapper__1BCEJ","link":"Tooltip-module_link__1xE5O","textWrapper":"Tooltip-module_textWrapper__Hc0qY"};
|
|
436
433
|
|
|
437
|
-
var
|
|
438
|
-
|
|
434
|
+
var _jsxFileName$6 = "/home/tfischbach/code/pageflow/entry_types/scrolled/package/src/contentElements/hotspots/Tooltip.js";
|
|
435
|
+
const arrowKeys = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];
|
|
436
|
+
function Tooltip({
|
|
437
|
+
area,
|
|
438
|
+
panZoomTransform,
|
|
439
|
+
contentElementId,
|
|
440
|
+
configuration,
|
|
441
|
+
visible,
|
|
442
|
+
active,
|
|
443
|
+
imageFile,
|
|
444
|
+
containerRect,
|
|
445
|
+
keepInViewport,
|
|
446
|
+
floatingStrategy,
|
|
447
|
+
aboveNavigationWidgets,
|
|
448
|
+
wrapperRef,
|
|
449
|
+
onMouseEnter,
|
|
450
|
+
onMouseLeave,
|
|
451
|
+
onClick,
|
|
452
|
+
onDismiss,
|
|
453
|
+
onLinkClick
|
|
454
|
+
}) {
|
|
439
455
|
var _tooltipTexts$area$id6, _tooltipTexts$area$id7, _tooltipLinks$area$id, _tooltipLinks$area$id2, _tooltipTexts$area$id8;
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
locale: 'ui'
|
|
460
|
-
}),
|
|
461
|
-
t = _useI18n2.t;
|
|
462
|
-
var updateConfiguration = useContentElementConfigurationUpdate();
|
|
463
|
-
var _useContentElementEdi = useContentElementEditorState(),
|
|
464
|
-
isEditable = _useContentElementEdi.isEditable;
|
|
465
|
-
var darkBackground = useDarkBackground();
|
|
466
|
-
var light = configuration.invertTooltips ? !darkBackground : darkBackground;
|
|
467
|
-
var tooltipImageFile = useFileWithInlineRights({
|
|
456
|
+
const {
|
|
457
|
+
t: translateWithEntryLocale
|
|
458
|
+
} = useI18n();
|
|
459
|
+
const {
|
|
460
|
+
t
|
|
461
|
+
} = useI18n({
|
|
462
|
+
locale: 'ui'
|
|
463
|
+
});
|
|
464
|
+
const updateConfiguration = useContentElementConfigurationUpdate();
|
|
465
|
+
const {
|
|
466
|
+
isEditable
|
|
467
|
+
} = useContentElementEditorState();
|
|
468
|
+
const storylineMode = useStorylineActivity();
|
|
469
|
+
const inBackground = useDelayedBoolean(storylineMode !== 'active', {
|
|
470
|
+
fromTrueToFalse: 200
|
|
471
|
+
});
|
|
472
|
+
const darkBackground = useDarkBackground();
|
|
473
|
+
const light = configuration.invertTooltips ? !darkBackground : darkBackground;
|
|
474
|
+
const tooltipImageFile = useFileWithInlineRights({
|
|
468
475
|
configuration: area,
|
|
469
476
|
collectionName: 'imageFiles',
|
|
470
477
|
propertyName: 'tooltipImage'
|
|
471
478
|
});
|
|
472
|
-
|
|
473
|
-
area
|
|
474
|
-
panZoomTransform
|
|
479
|
+
const inlineStyles = getTooltipInlineStyles({
|
|
480
|
+
area,
|
|
481
|
+
panZoomTransform
|
|
475
482
|
});
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
483
|
+
const tooltipTexts = configuration.tooltipTexts || {};
|
|
484
|
+
const tooltipLinks = configuration.tooltipLinks || {};
|
|
485
|
+
const referenceType = area.tooltipReference;
|
|
486
|
+
const position = area.tooltipPosition;
|
|
487
|
+
const maxWidth = area.tooltipMaxWidth;
|
|
488
|
+
const arrowRef = useRef();
|
|
489
|
+
const {
|
|
490
|
+
refs,
|
|
491
|
+
floatingStyles,
|
|
492
|
+
context
|
|
493
|
+
} = useFloating({
|
|
494
|
+
open: containerRect.width > 0 && visible && !inBackground,
|
|
495
|
+
onOpenChange: open => !open && onDismiss(),
|
|
496
|
+
strategy: floatingStrategy || 'absolute',
|
|
497
|
+
placement: position === 'above' ? 'top' : 'bottom',
|
|
498
|
+
middleware: [offset(referenceType === 'area' ? 7 : 20), shift(keepInViewport ? {
|
|
499
|
+
crossAxis: true,
|
|
500
|
+
padding: {
|
|
501
|
+
left: 40,
|
|
502
|
+
right: 40
|
|
503
|
+
}
|
|
504
|
+
} : {
|
|
505
|
+
padding: {
|
|
506
|
+
left: -5,
|
|
507
|
+
right: -5
|
|
486
508
|
},
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
} : {
|
|
496
|
-
padding: {
|
|
497
|
-
left: -5,
|
|
498
|
-
right: -5
|
|
499
|
-
},
|
|
500
|
-
boundary: wrapperRef.current
|
|
501
|
-
}), keepInViewport && flip(), arrow({
|
|
502
|
-
element: arrowRef,
|
|
503
|
-
padding: 5
|
|
504
|
-
})],
|
|
505
|
-
whileElementsMounted: autoUpdate
|
|
506
|
-
}),
|
|
507
|
-
refs = _useFloating.refs,
|
|
508
|
-
floatingStyles = _useFloating.floatingStyles,
|
|
509
|
-
context = _useFloating.context;
|
|
510
|
-
var role = useRole(context, {
|
|
509
|
+
boundary: wrapperRef.current
|
|
510
|
+
}), keepInViewport && flip(), arrow({
|
|
511
|
+
element: arrowRef,
|
|
512
|
+
padding: 5
|
|
513
|
+
})],
|
|
514
|
+
whileElementsMounted: autoUpdate
|
|
515
|
+
});
|
|
516
|
+
const role = useRole(context, {
|
|
511
517
|
role: 'label'
|
|
512
518
|
});
|
|
513
|
-
|
|
519
|
+
const dismiss = useDismiss(context, {
|
|
514
520
|
outsidePressEvent: 'mousedown',
|
|
515
|
-
outsidePress:
|
|
516
|
-
|
|
521
|
+
outsidePress: event => !insidePagerButton(event.target),
|
|
522
|
+
capture: {
|
|
523
|
+
outsidePress: false
|
|
517
524
|
}
|
|
518
525
|
});
|
|
519
|
-
|
|
520
|
-
getReferenceProps
|
|
521
|
-
getFloatingProps
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
+
const {
|
|
527
|
+
getReferenceProps,
|
|
528
|
+
getFloatingProps
|
|
529
|
+
} = useInteractions([role, dismiss]);
|
|
530
|
+
const {
|
|
531
|
+
isMounted,
|
|
532
|
+
styles: transitionStyles
|
|
533
|
+
} = useTooltipTransitionStyles(context);
|
|
534
|
+
const floatingPortalRoot = useFloatingPortalRoot();
|
|
526
535
|
function handleTextChange(propertyName, value) {
|
|
527
536
|
updateConfiguration({
|
|
528
|
-
tooltipTexts:
|
|
537
|
+
tooltipTexts: {
|
|
538
|
+
...tooltipTexts,
|
|
539
|
+
[area.id]: {
|
|
540
|
+
...tooltipTexts[area.id],
|
|
541
|
+
[propertyName]: value
|
|
542
|
+
}
|
|
543
|
+
}
|
|
529
544
|
});
|
|
530
545
|
}
|
|
531
546
|
function handleLinkChange(value) {
|
|
532
|
-
|
|
533
|
-
|
|
547
|
+
if (value) {
|
|
548
|
+
var _tooltipTexts$area$id;
|
|
549
|
+
if (utils.isBlankEditableTextValue((_tooltipTexts$area$id = tooltipTexts[area.id]) === null || _tooltipTexts$area$id === void 0 ? void 0 : _tooltipTexts$area$id.link)) {
|
|
550
|
+
handleTextChange('link', [{
|
|
551
|
+
type: 'heading',
|
|
552
|
+
children: [{
|
|
553
|
+
text: translateWithEntryLocale('pageflow_scrolled.public.more')
|
|
554
|
+
}]
|
|
555
|
+
}]);
|
|
556
|
+
}
|
|
557
|
+
} else {
|
|
534
558
|
handleTextChange('link', [{
|
|
535
559
|
type: 'heading',
|
|
536
560
|
children: [{
|
|
537
|
-
text:
|
|
561
|
+
text: ''
|
|
538
562
|
}]
|
|
539
563
|
}]);
|
|
540
564
|
}
|
|
541
565
|
updateConfiguration({
|
|
542
|
-
tooltipLinks:
|
|
566
|
+
tooltipLinks: {
|
|
567
|
+
...tooltipLinks,
|
|
568
|
+
[area.id]: value
|
|
569
|
+
}
|
|
543
570
|
});
|
|
544
571
|
}
|
|
545
572
|
function handleKeyDown(event) {
|
|
@@ -554,119 +581,233 @@ function Tooltip(_ref) {
|
|
|
554
581
|
}
|
|
555
582
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CompositeItem, {
|
|
556
583
|
render: /*#__PURE__*/React.createElement("div", {
|
|
557
|
-
className: styles$6.compositeItem
|
|
558
|
-
|
|
584
|
+
className: styles$6.compositeItem,
|
|
585
|
+
__self: this,
|
|
586
|
+
__source: {
|
|
587
|
+
fileName: _jsxFileName$6,
|
|
588
|
+
lineNumber: 181,
|
|
589
|
+
columnNumber: 30
|
|
590
|
+
}
|
|
591
|
+
}),
|
|
592
|
+
__self: this,
|
|
593
|
+
__source: {
|
|
594
|
+
fileName: _jsxFileName$6,
|
|
595
|
+
lineNumber: 181,
|
|
596
|
+
columnNumber: 7
|
|
597
|
+
}
|
|
559
598
|
}, /*#__PURE__*/React.createElement("div", {
|
|
560
599
|
className: styles$6.wrapper,
|
|
561
|
-
style: inlineStyles.wrapper
|
|
600
|
+
style: inlineStyles.wrapper,
|
|
601
|
+
__self: this,
|
|
602
|
+
__source: {
|
|
603
|
+
fileName: _jsxFileName$6,
|
|
604
|
+
lineNumber: 182,
|
|
605
|
+
columnNumber: 9
|
|
606
|
+
}
|
|
562
607
|
}, /*#__PURE__*/React.createElement("div", Object.assign({
|
|
563
608
|
ref: refs.setReference,
|
|
564
609
|
className: styles$6.reference,
|
|
565
610
|
style: inlineStyles.reference
|
|
566
|
-
}, getReferenceProps()
|
|
611
|
+
}, getReferenceProps(), {
|
|
612
|
+
__self: this,
|
|
613
|
+
__source: {
|
|
614
|
+
fileName: _jsxFileName$6,
|
|
615
|
+
lineNumber: 183,
|
|
616
|
+
columnNumber: 11
|
|
617
|
+
}
|
|
618
|
+
})))), isMounted && /*#__PURE__*/React.createElement(TooltipPortal, {
|
|
567
619
|
id: aboveNavigationWidgets && 'floating-ui-above-navigation-widgets',
|
|
568
|
-
root: floatingPortalRoot
|
|
620
|
+
root: floatingPortalRoot,
|
|
621
|
+
__self: this,
|
|
622
|
+
__source: {
|
|
623
|
+
fileName: _jsxFileName$6,
|
|
624
|
+
lineNumber: 190,
|
|
625
|
+
columnNumber: 8
|
|
626
|
+
}
|
|
569
627
|
}, /*#__PURE__*/React.createElement(FloatingFocusManager, {
|
|
570
628
|
context: context,
|
|
571
629
|
modal: false,
|
|
572
630
|
initialFocus: -1,
|
|
573
|
-
returnFocus: false
|
|
631
|
+
returnFocus: false,
|
|
632
|
+
__self: this,
|
|
633
|
+
__source: {
|
|
634
|
+
fileName: _jsxFileName$6,
|
|
635
|
+
lineNumber: 192,
|
|
636
|
+
columnNumber: 10
|
|
637
|
+
}
|
|
574
638
|
}, /*#__PURE__*/React.createElement("div", {
|
|
575
|
-
style: transitionStyles
|
|
639
|
+
style: transitionStyles,
|
|
640
|
+
__self: this,
|
|
641
|
+
__source: {
|
|
642
|
+
fileName: _jsxFileName$6,
|
|
643
|
+
lineNumber: 193,
|
|
644
|
+
columnNumber: 12
|
|
645
|
+
}
|
|
576
646
|
}, /*#__PURE__*/React.createElement("div", Object.assign({
|
|
577
647
|
ref: refs.setFloating,
|
|
578
648
|
style: floatingStyles,
|
|
579
|
-
className: classNames(styles$6.box, styles$6[
|
|
580
|
-
|
|
649
|
+
className: classNames(styles$6.box, styles$6[`maxWidth-${maxWidth}`], styles$6[`align-${area.tooltipTextAlign}`], configuration.linkButtonVariant && `scope-linkButton-${configuration.linkButtonVariant}`, light ? styles$6.light : styles$6.dark, {
|
|
650
|
+
[styles$6.paddingForScrollButtons]: keepInViewport,
|
|
651
|
+
[styles$6.minWidth]: presentOrEditing('link')
|
|
652
|
+
}),
|
|
653
|
+
onMouseEnter: () => storylineMode === 'active' && onMouseEnter(),
|
|
581
654
|
onMouseLeave: onMouseLeave,
|
|
582
655
|
onClick: onClick
|
|
583
|
-
}, getFloatingProps()
|
|
656
|
+
}, getFloatingProps(), {
|
|
657
|
+
__self: this,
|
|
658
|
+
__source: {
|
|
659
|
+
fileName: _jsxFileName$6,
|
|
660
|
+
lineNumber: 194,
|
|
661
|
+
columnNumber: 14
|
|
662
|
+
}
|
|
663
|
+
}), /*#__PURE__*/React.createElement(FloatingArrow, {
|
|
584
664
|
ref: arrowRef,
|
|
585
665
|
context: context,
|
|
586
|
-
strokeWidth: 1
|
|
666
|
+
strokeWidth: 1,
|
|
667
|
+
__self: this,
|
|
668
|
+
__source: {
|
|
669
|
+
fileName: _jsxFileName$6,
|
|
670
|
+
lineNumber: 208,
|
|
671
|
+
columnNumber: 16
|
|
672
|
+
}
|
|
587
673
|
}), tooltipImageFile && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
588
|
-
className: styles$6.imageWrapper
|
|
674
|
+
className: styles$6.imageWrapper,
|
|
675
|
+
__self: this,
|
|
676
|
+
__source: {
|
|
677
|
+
fileName: _jsxFileName$6,
|
|
678
|
+
lineNumber: 211,
|
|
679
|
+
columnNumber: 19
|
|
680
|
+
}
|
|
589
681
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
590
682
|
imageFile: tooltipImageFile,
|
|
591
683
|
variant: 'medium',
|
|
592
684
|
fill: false,
|
|
593
685
|
width: tooltipImageFile.width,
|
|
594
686
|
height: tooltipImageFile.height,
|
|
595
|
-
preferSvg: true
|
|
687
|
+
preferSvg: true,
|
|
688
|
+
__self: this,
|
|
689
|
+
__source: {
|
|
690
|
+
fileName: _jsxFileName$6,
|
|
691
|
+
lineNumber: 212,
|
|
692
|
+
columnNumber: 21
|
|
693
|
+
}
|
|
596
694
|
}), /*#__PURE__*/React.createElement(InlineFileRights, {
|
|
597
695
|
context: "insideElement",
|
|
598
696
|
items: [{
|
|
599
697
|
file: tooltipImageFile,
|
|
600
698
|
label: 'image'
|
|
601
|
-
}]
|
|
699
|
+
}],
|
|
700
|
+
__self: this,
|
|
701
|
+
__source: {
|
|
702
|
+
fileName: _jsxFileName$6,
|
|
703
|
+
lineNumber: 218,
|
|
704
|
+
columnNumber: 21
|
|
705
|
+
}
|
|
602
706
|
}), /*#__PURE__*/React.createElement(InlineFileRights, {
|
|
603
707
|
context: "afterElement",
|
|
604
708
|
items: [{
|
|
605
709
|
file: tooltipImageFile,
|
|
606
710
|
label: 'image'
|
|
607
|
-
}]
|
|
711
|
+
}],
|
|
712
|
+
__self: this,
|
|
713
|
+
__source: {
|
|
714
|
+
fileName: _jsxFileName$6,
|
|
715
|
+
lineNumber: 219,
|
|
716
|
+
columnNumber: 21
|
|
717
|
+
}
|
|
608
718
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
609
719
|
className: styles$6.textWrapper,
|
|
610
|
-
onKeyDown: handleKeyDown
|
|
720
|
+
onKeyDown: handleKeyDown,
|
|
721
|
+
__self: this,
|
|
722
|
+
__source: {
|
|
723
|
+
fileName: _jsxFileName$6,
|
|
724
|
+
lineNumber: 222,
|
|
725
|
+
columnNumber: 16
|
|
726
|
+
}
|
|
611
727
|
}, presentOrEditing('title') && /*#__PURE__*/React.createElement("h3", {
|
|
612
|
-
id:
|
|
728
|
+
id: `hotspots-tooltip-title-${contentElementId}-${area.id}`,
|
|
729
|
+
__self: this,
|
|
730
|
+
__source: {
|
|
731
|
+
fileName: _jsxFileName$6,
|
|
732
|
+
lineNumber: 225,
|
|
733
|
+
columnNumber: 19
|
|
734
|
+
}
|
|
613
735
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
614
736
|
inline: true,
|
|
615
|
-
scaleCategory: "hotspotsTooltipTitle"
|
|
737
|
+
scaleCategory: "hotspotsTooltipTitle",
|
|
738
|
+
__self: this,
|
|
739
|
+
__source: {
|
|
740
|
+
fileName: _jsxFileName$6,
|
|
741
|
+
lineNumber: 226,
|
|
742
|
+
columnNumber: 21
|
|
743
|
+
}
|
|
616
744
|
}, /*#__PURE__*/React.createElement(EditableInlineText, {
|
|
617
745
|
value: (_tooltipTexts$area$id6 = tooltipTexts[area.id]) === null || _tooltipTexts$area$id6 === void 0 ? void 0 : _tooltipTexts$area$id6.title,
|
|
618
|
-
onChange:
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
746
|
+
onChange: value => handleTextChange('title', value),
|
|
747
|
+
placeholder: t('pageflow_scrolled.inline_editing.type_heading'),
|
|
748
|
+
__self: this,
|
|
749
|
+
__source: {
|
|
750
|
+
fileName: _jsxFileName$6,
|
|
751
|
+
lineNumber: 227,
|
|
752
|
+
columnNumber: 23
|
|
753
|
+
}
|
|
622
754
|
}))), presentOrEditing('description') && /*#__PURE__*/React.createElement(EditableText, {
|
|
623
755
|
value: (_tooltipTexts$area$id7 = tooltipTexts[area.id]) === null || _tooltipTexts$area$id7 === void 0 ? void 0 : _tooltipTexts$area$id7.description,
|
|
624
|
-
onChange:
|
|
625
|
-
return handleTextChange('description', value);
|
|
626
|
-
},
|
|
756
|
+
onChange: value => handleTextChange('description', value),
|
|
627
757
|
scaleCategory: "hotspotsTooltipDescription",
|
|
628
|
-
placeholder: t('pageflow_scrolled.inline_editing.type_text')
|
|
758
|
+
placeholder: t('pageflow_scrolled.inline_editing.type_text'),
|
|
759
|
+
__self: this,
|
|
760
|
+
__source: {
|
|
761
|
+
fileName: _jsxFileName$6,
|
|
762
|
+
lineNumber: 233,
|
|
763
|
+
columnNumber: 19
|
|
764
|
+
}
|
|
629
765
|
}), presentOrEditing('link') && /*#__PURE__*/React.createElement(LinkButton, {
|
|
630
766
|
className: styles$6.link,
|
|
631
767
|
scaleCategory: "hotspotsTooltipLink",
|
|
632
768
|
href: (_tooltipLinks$area$id = tooltipLinks[area.id]) === null || _tooltipLinks$area$id === void 0 ? void 0 : _tooltipLinks$area$id.href,
|
|
633
769
|
openInNewTab: (_tooltipLinks$area$id2 = tooltipLinks[area.id]) === null || _tooltipLinks$area$id2 === void 0 ? void 0 : _tooltipLinks$area$id2.openInNewTab,
|
|
634
770
|
value: (_tooltipTexts$area$id8 = tooltipTexts[area.id]) === null || _tooltipTexts$area$id8 === void 0 ? void 0 : _tooltipTexts$area$id8.link,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
771
|
+
allowRemove: true,
|
|
772
|
+
onTextChange: value => handleTextChange('link', value),
|
|
773
|
+
onLinkChange: value => handleLinkChange(value),
|
|
774
|
+
onClick: onLinkClick,
|
|
775
|
+
__self: this,
|
|
776
|
+
__source: {
|
|
777
|
+
fileName: _jsxFileName$6,
|
|
778
|
+
lineNumber: 238,
|
|
779
|
+
columnNumber: 19
|
|
640
780
|
}
|
|
641
781
|
})))))));
|
|
642
782
|
}
|
|
643
783
|
|
|
644
784
|
function useHotspotsConfiguration(configuration) {
|
|
645
|
-
|
|
646
|
-
configuration
|
|
785
|
+
const defaultImageFile = useFileWithInlineRights({
|
|
786
|
+
configuration,
|
|
647
787
|
collectionName: 'imageFiles',
|
|
648
788
|
propertyName: 'image'
|
|
649
789
|
});
|
|
650
|
-
|
|
651
|
-
configuration
|
|
790
|
+
const portraitImageFile = useFileWithInlineRights({
|
|
791
|
+
configuration,
|
|
652
792
|
collectionName: 'imageFiles',
|
|
653
793
|
propertyName: 'portraitImage'
|
|
654
794
|
});
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
795
|
+
const portraitOrientation = usePortraitOrientation();
|
|
796
|
+
const portraitMode = !!(portraitOrientation && portraitImageFile);
|
|
797
|
+
const imageFile = portraitMode ? portraitImageFile : defaultImageFile;
|
|
658
798
|
return {
|
|
659
799
|
panZoomEnabled: usePanZoomEnabled(configuration),
|
|
660
800
|
areas: useAreas(configuration, portraitMode),
|
|
661
|
-
imageFile
|
|
662
|
-
portraitMode
|
|
801
|
+
imageFile,
|
|
802
|
+
portraitMode
|
|
663
803
|
};
|
|
664
804
|
}
|
|
665
805
|
function useAreas(configuration, portraitMode) {
|
|
666
|
-
return useMemo(
|
|
667
|
-
return (configuration.areas || []).map(
|
|
806
|
+
return useMemo(() => {
|
|
807
|
+
return (configuration.areas || []).map(area => {
|
|
668
808
|
if (portraitMode) {
|
|
669
|
-
return applyAreaDefaults(
|
|
809
|
+
return applyAreaDefaults({
|
|
810
|
+
...area,
|
|
670
811
|
outline: area.portraitOutline,
|
|
671
812
|
zoom: area.portraitZoom,
|
|
672
813
|
activeImage: area.portraitActiveImage,
|
|
@@ -676,7 +817,7 @@ function useAreas(configuration, portraitMode) {
|
|
|
676
817
|
tooltipReference: area.portraitTooltipReference,
|
|
677
818
|
tooltipPosition: area.portraitTooltipPosition,
|
|
678
819
|
tooltipMaxWidth: area.portraitTooltipMaxWidth
|
|
679
|
-
})
|
|
820
|
+
});
|
|
680
821
|
} else {
|
|
681
822
|
return applyAreaDefaults(area);
|
|
682
823
|
}
|
|
@@ -685,21 +826,23 @@ function useAreas(configuration, portraitMode) {
|
|
|
685
826
|
}
|
|
686
827
|
function applyAreaDefaults(area) {
|
|
687
828
|
var _area$outline;
|
|
688
|
-
return
|
|
829
|
+
return {
|
|
830
|
+
...area,
|
|
689
831
|
outline: ((_area$outline = area.outline) === null || _area$outline === void 0 ? void 0 : _area$outline.length) ? area.outline : [[50, 50]],
|
|
690
832
|
zoom: area.zoom || 0,
|
|
691
833
|
indicatorPosition: area.indicatorPosition || [50, 50]
|
|
692
|
-
}
|
|
834
|
+
};
|
|
693
835
|
}
|
|
694
836
|
function usePanZoomEnabled(configuration) {
|
|
695
|
-
|
|
837
|
+
const isPhonePlatform = usePhonePlatform();
|
|
696
838
|
return configuration.enablePanZoom === 'always' || configuration.enablePanZoom === 'phonePlatform' && isPhonePlatform;
|
|
697
839
|
}
|
|
698
840
|
|
|
699
|
-
function useHotspotsEditorCommandSubscriptions(
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
841
|
+
function useHotspotsEditorCommandSubscriptions({
|
|
842
|
+
setHighlightedIndex,
|
|
843
|
+
activateArea
|
|
844
|
+
}) {
|
|
845
|
+
useContentElementEditorCommandSubscription(command => {
|
|
703
846
|
if (command.type === 'HIGHLIGHT_AREA') {
|
|
704
847
|
setHighlightedIndex(command.index);
|
|
705
848
|
} else if (command.type === 'RESET_AREA_HIGHLIGHT') {
|
|
@@ -710,31 +853,24 @@ function useHotspotsEditorCommandSubscriptions(_ref) {
|
|
|
710
853
|
});
|
|
711
854
|
}
|
|
712
855
|
|
|
713
|
-
function useHotspotsState(
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
hoveredIndex = _useState4[0],
|
|
727
|
-
setHoveredIndex = _useState4[1];
|
|
728
|
-
var _useState5 = useState(-1),
|
|
729
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
730
|
-
highlightedIndex = _useState6[0],
|
|
731
|
-
setHighlightedIndex = _useState6[1];
|
|
732
|
-
var setActiveIndex = useCallback(function (index) {
|
|
856
|
+
function useHotspotsState({
|
|
857
|
+
areas,
|
|
858
|
+
initialActiveArea
|
|
859
|
+
}) {
|
|
860
|
+
const {
|
|
861
|
+
setTransientState,
|
|
862
|
+
select,
|
|
863
|
+
isSelected
|
|
864
|
+
} = useContentElementEditorState();
|
|
865
|
+
const [activeIndex, setActiveIndexState] = useState(typeof initialActiveArea === 'undefined' ? -1 : initialActiveArea);
|
|
866
|
+
const [hoveredIndex, setHoveredIndex] = useState(-1);
|
|
867
|
+
const [highlightedIndex, setHighlightedIndex] = useState(-1);
|
|
868
|
+
const setActiveIndex = useCallback(index => {
|
|
733
869
|
var _areas$index;
|
|
734
870
|
setTransientState({
|
|
735
871
|
activeAreaId: (_areas$index = areas[index]) === null || _areas$index === void 0 ? void 0 : _areas$index.id
|
|
736
872
|
});
|
|
737
|
-
setActiveIndexState(
|
|
873
|
+
setActiveIndexState(activeIndex => {
|
|
738
874
|
if (activeIndex !== index && index >= 0 && isSelected) {
|
|
739
875
|
select();
|
|
740
876
|
}
|
|
@@ -742,247 +878,235 @@ function useHotspotsState(_ref) {
|
|
|
742
878
|
});
|
|
743
879
|
}, [setActiveIndexState, setTransientState, areas, select, isSelected]);
|
|
744
880
|
return {
|
|
745
|
-
activeIndex
|
|
746
|
-
hoveredIndex
|
|
747
|
-
highlightedIndex
|
|
748
|
-
setActiveIndex
|
|
749
|
-
setHoveredIndex
|
|
750
|
-
setHighlightedIndex
|
|
881
|
+
activeIndex,
|
|
882
|
+
hoveredIndex,
|
|
883
|
+
highlightedIndex,
|
|
884
|
+
setActiveIndex,
|
|
885
|
+
setHoveredIndex,
|
|
886
|
+
setHighlightedIndex
|
|
751
887
|
};
|
|
752
888
|
}
|
|
753
889
|
|
|
754
|
-
function useContentRect(
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
var ref = useRef();
|
|
764
|
-
useEffect(function () {
|
|
890
|
+
function useContentRect({
|
|
891
|
+
enabled
|
|
892
|
+
}) {
|
|
893
|
+
const [contentRect, setContentRect] = useState({
|
|
894
|
+
width: 0,
|
|
895
|
+
height: 0
|
|
896
|
+
});
|
|
897
|
+
const ref = useRef();
|
|
898
|
+
useEffect(() => {
|
|
765
899
|
if (!enabled) {
|
|
766
900
|
return;
|
|
767
901
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
requestAnimationFrame(
|
|
902
|
+
const current = ref.current;
|
|
903
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
904
|
+
requestAnimationFrame(() => {
|
|
771
905
|
setContentRect(entries[entries.length - 1].contentRect);
|
|
772
906
|
});
|
|
773
907
|
});
|
|
774
908
|
resizeObserver.observe(current);
|
|
775
|
-
return
|
|
909
|
+
return () => {
|
|
776
910
|
resizeObserver.unobserve(current);
|
|
777
911
|
};
|
|
778
912
|
}, [enabled]);
|
|
779
913
|
return [contentRect, ref];
|
|
780
914
|
}
|
|
781
915
|
|
|
782
|
-
|
|
916
|
+
const fullRect = {
|
|
783
917
|
left: 0,
|
|
784
918
|
top: 0,
|
|
785
919
|
width: 100,
|
|
786
920
|
height: 100
|
|
787
921
|
};
|
|
788
|
-
function getInitialTransform(
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
containerHeight: containerHeight,
|
|
922
|
+
function getInitialTransform({
|
|
923
|
+
containerWidth,
|
|
924
|
+
containerHeight,
|
|
925
|
+
imageFileWidth,
|
|
926
|
+
imageFileHeight,
|
|
927
|
+
areasBoundingRect,
|
|
928
|
+
indicatorPositions = [],
|
|
929
|
+
containerSafeAreaMargin = 0
|
|
930
|
+
}) {
|
|
931
|
+
const baseImageWidth = imageFileWidth * containerHeight / imageFileHeight;
|
|
932
|
+
const baseImageHeight = containerHeight;
|
|
933
|
+
const scaleCover = getScaleToCoverContainerWithRect({
|
|
934
|
+
baseImageWidth,
|
|
935
|
+
baseImageHeight,
|
|
936
|
+
containerWidth,
|
|
937
|
+
containerHeight,
|
|
805
938
|
rect: fullRect
|
|
806
939
|
});
|
|
807
|
-
|
|
808
|
-
baseImageWidth
|
|
809
|
-
baseImageHeight
|
|
940
|
+
const scaleContainMotif = getScaleToContainRectInContainer({
|
|
941
|
+
baseImageWidth,
|
|
942
|
+
baseImageHeight,
|
|
810
943
|
containerWidth: containerWidth * (1 - 2 * containerSafeAreaMargin / 100),
|
|
811
|
-
containerHeight
|
|
944
|
+
containerHeight,
|
|
945
|
+
rect: areasBoundingRect
|
|
946
|
+
});
|
|
947
|
+
const scale = Math.min(scaleCover, scaleContainMotif);
|
|
948
|
+
const [translateX, translateY] = center({
|
|
949
|
+
baseImageWidth,
|
|
950
|
+
baseImageHeight,
|
|
951
|
+
containerWidth,
|
|
952
|
+
containerHeight,
|
|
953
|
+
scale,
|
|
954
|
+
unbounded: scaleContainMotif < scaleCover,
|
|
812
955
|
rect: areasBoundingRect
|
|
813
956
|
});
|
|
814
|
-
var scale = Math.min(scaleCover, scaleContainMotif);
|
|
815
|
-
var _center = center({
|
|
816
|
-
baseImageWidth: baseImageWidth,
|
|
817
|
-
baseImageHeight: baseImageHeight,
|
|
818
|
-
containerWidth: containerWidth,
|
|
819
|
-
containerHeight: containerHeight,
|
|
820
|
-
scale: scale,
|
|
821
|
-
unbounded: scaleContainMotif < scaleCover,
|
|
822
|
-
rect: areasBoundingRect
|
|
823
|
-
}),
|
|
824
|
-
_center2 = _slicedToArray(_center, 2),
|
|
825
|
-
translateX = _center2[0],
|
|
826
|
-
translateY = _center2[1];
|
|
827
957
|
return {
|
|
828
958
|
wrapper: {
|
|
829
959
|
x: translateX,
|
|
830
960
|
y: translateY,
|
|
831
|
-
scale
|
|
961
|
+
scale
|
|
832
962
|
},
|
|
833
963
|
indicators: transformIndicators({
|
|
834
|
-
indicatorPositions
|
|
835
|
-
baseImageWidth
|
|
836
|
-
baseImageHeight
|
|
837
|
-
translateX
|
|
838
|
-
translateY
|
|
839
|
-
scale
|
|
964
|
+
indicatorPositions,
|
|
965
|
+
baseImageWidth,
|
|
966
|
+
baseImageHeight,
|
|
967
|
+
translateX,
|
|
968
|
+
translateY,
|
|
969
|
+
scale
|
|
840
970
|
})
|
|
841
971
|
};
|
|
842
972
|
}
|
|
843
|
-
function getPanZoomStepTransform(
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
baseImageWidth
|
|
858
|
-
baseImageHeight
|
|
859
|
-
containerWidth
|
|
860
|
-
containerHeight
|
|
861
|
-
areaRect
|
|
862
|
-
areaZoom
|
|
863
|
-
initialScale
|
|
973
|
+
function getPanZoomStepTransform({
|
|
974
|
+
containerWidth,
|
|
975
|
+
containerHeight,
|
|
976
|
+
imageFileWidth,
|
|
977
|
+
imageFileHeight,
|
|
978
|
+
areaOutline,
|
|
979
|
+
areaZoom,
|
|
980
|
+
indicatorPositions = [],
|
|
981
|
+
initialScale
|
|
982
|
+
}) {
|
|
983
|
+
const areaRect = getBoundingRect(areaOutline);
|
|
984
|
+
const baseImageWidth = imageFileWidth * containerHeight / imageFileHeight;
|
|
985
|
+
const baseImageHeight = containerHeight;
|
|
986
|
+
const scale = getAreaScale({
|
|
987
|
+
baseImageWidth,
|
|
988
|
+
baseImageHeight,
|
|
989
|
+
containerWidth,
|
|
990
|
+
containerHeight,
|
|
991
|
+
areaRect,
|
|
992
|
+
areaZoom,
|
|
993
|
+
initialScale
|
|
994
|
+
});
|
|
995
|
+
const [translateX, translateY] = center({
|
|
996
|
+
baseImageWidth,
|
|
997
|
+
baseImageHeight,
|
|
998
|
+
containerWidth,
|
|
999
|
+
containerHeight,
|
|
1000
|
+
rect: areaRect,
|
|
1001
|
+
scale
|
|
864
1002
|
});
|
|
865
|
-
var _center3 = center({
|
|
866
|
-
baseImageWidth: baseImageWidth,
|
|
867
|
-
baseImageHeight: baseImageHeight,
|
|
868
|
-
containerWidth: containerWidth,
|
|
869
|
-
containerHeight: containerHeight,
|
|
870
|
-
rect: areaRect,
|
|
871
|
-
scale: scale
|
|
872
|
-
}),
|
|
873
|
-
_center4 = _slicedToArray(_center3, 2),
|
|
874
|
-
translateX = _center4[0],
|
|
875
|
-
translateY = _center4[1];
|
|
876
1003
|
return {
|
|
877
1004
|
wrapper: {
|
|
878
1005
|
x: translateX,
|
|
879
1006
|
y: translateY,
|
|
880
|
-
scale
|
|
1007
|
+
scale
|
|
881
1008
|
},
|
|
882
1009
|
indicators: transformIndicators({
|
|
883
|
-
indicatorPositions
|
|
884
|
-
baseImageWidth
|
|
885
|
-
baseImageHeight
|
|
886
|
-
translateX
|
|
887
|
-
translateY
|
|
888
|
-
scale
|
|
1010
|
+
indicatorPositions,
|
|
1011
|
+
baseImageWidth,
|
|
1012
|
+
baseImageHeight,
|
|
1013
|
+
translateX,
|
|
1014
|
+
translateY,
|
|
1015
|
+
scale
|
|
889
1016
|
})
|
|
890
1017
|
};
|
|
891
1018
|
}
|
|
892
|
-
function transformIndicators(
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
});
|
|
1019
|
+
function transformIndicators({
|
|
1020
|
+
indicatorPositions,
|
|
1021
|
+
baseImageWidth,
|
|
1022
|
+
baseImageHeight,
|
|
1023
|
+
translateX,
|
|
1024
|
+
translateY,
|
|
1025
|
+
scale
|
|
1026
|
+
}) {
|
|
1027
|
+
return indicatorPositions.map(indicatorPosition => ({
|
|
1028
|
+
x: translateX + baseImageWidth * indicatorPosition[0] / 100 * (scale - 1),
|
|
1029
|
+
y: translateY + baseImageHeight * indicatorPosition[1] / 100 * (scale - 1)
|
|
1030
|
+
}));
|
|
905
1031
|
}
|
|
906
|
-
function getAreaScale(
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
containerWidth
|
|
917
|
-
containerHeight
|
|
918
|
-
baseImageWidth
|
|
919
|
-
baseImageHeight
|
|
1032
|
+
function getAreaScale({
|
|
1033
|
+
containerWidth,
|
|
1034
|
+
containerHeight,
|
|
1035
|
+
baseImageWidth,
|
|
1036
|
+
baseImageHeight,
|
|
1037
|
+
areaRect,
|
|
1038
|
+
areaZoom,
|
|
1039
|
+
initialScale = 1
|
|
1040
|
+
}) {
|
|
1041
|
+
const scale = getScaleToContainRectInContainer({
|
|
1042
|
+
containerWidth,
|
|
1043
|
+
containerHeight,
|
|
1044
|
+
baseImageWidth,
|
|
1045
|
+
baseImageHeight,
|
|
920
1046
|
rect: areaRect
|
|
921
1047
|
});
|
|
922
1048
|
return (100 - areaZoom) / 100 * initialScale + areaZoom / 100 * scale;
|
|
923
1049
|
}
|
|
924
|
-
function getScaleToCoverContainerWithRect(
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
scaleX = _getScalesToFit2[0],
|
|
939
|
-
scaleY = _getScalesToFit2[1];
|
|
1050
|
+
function getScaleToCoverContainerWithRect({
|
|
1051
|
+
containerWidth,
|
|
1052
|
+
containerHeight,
|
|
1053
|
+
baseImageWidth,
|
|
1054
|
+
baseImageHeight,
|
|
1055
|
+
rect
|
|
1056
|
+
}) {
|
|
1057
|
+
const [scaleX, scaleY] = getScalesToFit({
|
|
1058
|
+
containerWidth,
|
|
1059
|
+
containerHeight,
|
|
1060
|
+
baseImageWidth,
|
|
1061
|
+
baseImageHeight,
|
|
1062
|
+
rect
|
|
1063
|
+
});
|
|
940
1064
|
return Math.max(scaleX, scaleY);
|
|
941
1065
|
}
|
|
942
|
-
function getScaleToContainRectInContainer(
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
scaleX = _getScalesToFit4[0],
|
|
957
|
-
scaleY = _getScalesToFit4[1];
|
|
1066
|
+
function getScaleToContainRectInContainer({
|
|
1067
|
+
containerWidth,
|
|
1068
|
+
containerHeight,
|
|
1069
|
+
baseImageWidth,
|
|
1070
|
+
baseImageHeight,
|
|
1071
|
+
rect
|
|
1072
|
+
}) {
|
|
1073
|
+
const [scaleX, scaleY] = getScalesToFit({
|
|
1074
|
+
containerWidth,
|
|
1075
|
+
containerHeight,
|
|
1076
|
+
baseImageWidth,
|
|
1077
|
+
baseImageHeight,
|
|
1078
|
+
rect
|
|
1079
|
+
});
|
|
958
1080
|
return Math.min(scaleX, scaleY);
|
|
959
1081
|
}
|
|
960
|
-
function getScalesToFit(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1082
|
+
function getScalesToFit({
|
|
1083
|
+
containerWidth,
|
|
1084
|
+
containerHeight,
|
|
1085
|
+
baseImageWidth,
|
|
1086
|
+
baseImageHeight,
|
|
1087
|
+
rect
|
|
1088
|
+
}) {
|
|
1089
|
+
const baseRectWidth = rect.width / 100 * baseImageWidth;
|
|
1090
|
+
const baseRectHeight = rect.height / 100 * baseImageHeight;
|
|
968
1091
|
return [containerWidth / baseRectWidth, containerHeight / baseRectHeight];
|
|
969
1092
|
}
|
|
970
|
-
function center(
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1093
|
+
function center({
|
|
1094
|
+
baseImageWidth,
|
|
1095
|
+
baseImageHeight,
|
|
1096
|
+
containerWidth,
|
|
1097
|
+
containerHeight,
|
|
1098
|
+
unbounded,
|
|
1099
|
+
rect,
|
|
1100
|
+
scale
|
|
1101
|
+
}) {
|
|
1102
|
+
const displayImageWidth = baseImageWidth * scale;
|
|
1103
|
+
const displayImageHeight = baseImageHeight * scale;
|
|
1104
|
+
const displayRectWidth = rect.width / 100 * displayImageWidth;
|
|
1105
|
+
const displayRectLeft = rect.left / 100 * displayImageWidth;
|
|
1106
|
+
const displayRectHeight = rect.height / 100 * displayImageHeight;
|
|
1107
|
+
const displayRectTop = rect.top / 100 * displayImageHeight;
|
|
1108
|
+
let translateX;
|
|
1109
|
+
let translateY;
|
|
986
1110
|
if (displayImageWidth < containerWidth) {
|
|
987
1111
|
translateX = (containerWidth - displayImageWidth) / 2;
|
|
988
1112
|
} else {
|
|
@@ -1002,55 +1126,52 @@ function center(_ref8) {
|
|
|
1002
1126
|
return [translateX, translateY];
|
|
1003
1127
|
}
|
|
1004
1128
|
|
|
1005
|
-
function usePanZoomTransforms(
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1129
|
+
function usePanZoomTransforms({
|
|
1130
|
+
containerRect,
|
|
1131
|
+
imageFile,
|
|
1132
|
+
areas,
|
|
1133
|
+
initialTransformEnabled,
|
|
1134
|
+
panZoomEnabled
|
|
1135
|
+
}) {
|
|
1136
|
+
const imageFileWidth = imageFile === null || imageFile === void 0 ? void 0 : imageFile.width;
|
|
1137
|
+
const imageFileHeight = imageFile === null || imageFile === void 0 ? void 0 : imageFile.height;
|
|
1138
|
+
const containerWidth = containerRect.width;
|
|
1139
|
+
const containerHeight = containerRect.height;
|
|
1140
|
+
return useMemo(() => {
|
|
1016
1141
|
if (!panZoomEnabled && !initialTransformEnabled || !containerWidth || !containerHeight || !imageFileWidth || !imageFileHeight) {
|
|
1017
1142
|
return nullTransforms;
|
|
1018
1143
|
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
imageFileHeight: imageFileHeight,
|
|
1029
|
-
containerWidth: containerWidth,
|
|
1030
|
-
containerHeight: containerHeight,
|
|
1031
|
-
indicatorPositions: indicatorPositions,
|
|
1144
|
+
const indicatorPositions = areas.map(area => area.indicatorPosition);
|
|
1145
|
+
const areasBoundingRect = getBoundingRect(areas.flatMap(area => area.outline));
|
|
1146
|
+
const initialTransform = initialTransformEnabled ? getInitialTransform({
|
|
1147
|
+
areasBoundingRect,
|
|
1148
|
+
imageFileWidth,
|
|
1149
|
+
imageFileHeight,
|
|
1150
|
+
containerWidth,
|
|
1151
|
+
containerHeight,
|
|
1152
|
+
indicatorPositions,
|
|
1032
1153
|
containerSafeAreaMargin: getContainerSafeAreaMargin({
|
|
1033
|
-
panZoomEnabled
|
|
1034
|
-
areasBoundingRect
|
|
1154
|
+
panZoomEnabled,
|
|
1155
|
+
areasBoundingRect
|
|
1035
1156
|
})
|
|
1036
1157
|
}) : nullTransform;
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
areas.forEach(
|
|
1158
|
+
const initialTransformString = toString(initialTransform.wrapper);
|
|
1159
|
+
const areaTransformStrings = [];
|
|
1160
|
+
const tooltipTransformStrings = [];
|
|
1161
|
+
areas.forEach((area, index) => {
|
|
1041
1162
|
if (panZoomEnabled) {
|
|
1042
1163
|
var _initialTransform$wra;
|
|
1043
|
-
|
|
1164
|
+
const transform = getPanZoomStepTransform({
|
|
1044
1165
|
areaOutline: area.outline,
|
|
1045
1166
|
areaZoom: area.zoom,
|
|
1046
1167
|
initialScale: ((_initialTransform$wra = initialTransform.wrapper) === null || _initialTransform$wra === void 0 ? void 0 : _initialTransform$wra.scale) || 1,
|
|
1047
|
-
imageFileWidth
|
|
1048
|
-
imageFileHeight
|
|
1049
|
-
containerWidth
|
|
1050
|
-
containerHeight
|
|
1051
|
-
indicatorPositions
|
|
1168
|
+
imageFileWidth,
|
|
1169
|
+
imageFileHeight,
|
|
1170
|
+
containerWidth,
|
|
1171
|
+
containerHeight,
|
|
1172
|
+
indicatorPositions
|
|
1052
1173
|
});
|
|
1053
|
-
|
|
1174
|
+
const transformString = toString(transform.wrapper);
|
|
1054
1175
|
areaTransformStrings.push({
|
|
1055
1176
|
wrapper: transformString,
|
|
1056
1177
|
indicators: transform.indicators.map(toString)
|
|
@@ -1070,50 +1191,50 @@ function usePanZoomTransforms(_ref) {
|
|
|
1070
1191
|
};
|
|
1071
1192
|
}, [panZoomEnabled, initialTransformEnabled, containerWidth, containerHeight, imageFileWidth, imageFileHeight, areas]);
|
|
1072
1193
|
}
|
|
1073
|
-
|
|
1074
|
-
function getContainerSafeAreaMargin(
|
|
1075
|
-
|
|
1076
|
-
|
|
1194
|
+
const pagerButtonsMargin = 8;
|
|
1195
|
+
function getContainerSafeAreaMargin({
|
|
1196
|
+
panZoomEnabled,
|
|
1197
|
+
areasBoundingRect
|
|
1198
|
+
}) {
|
|
1077
1199
|
return panZoomEnabled && insideSafeArea(areasBoundingRect) ? pagerButtonsMargin : 0;
|
|
1078
1200
|
}
|
|
1079
1201
|
function insideSafeArea(rect) {
|
|
1080
1202
|
return rect.left >= pagerButtonsMargin && rect.left + rect.width <= 100 - pagerButtonsMargin;
|
|
1081
1203
|
}
|
|
1082
1204
|
function toString(transform) {
|
|
1083
|
-
return transform &&
|
|
1205
|
+
return transform && `translate(${transform.x}px, ${transform.y}px) scale(${transform.scale || 1})`;
|
|
1084
1206
|
}
|
|
1085
|
-
|
|
1207
|
+
const nullTransforms = {
|
|
1086
1208
|
initial: {
|
|
1087
1209
|
indicators: [],
|
|
1088
1210
|
tooltips: []
|
|
1089
1211
|
},
|
|
1090
1212
|
areas: []
|
|
1091
1213
|
};
|
|
1092
|
-
|
|
1214
|
+
const nullTransform = {
|
|
1093
1215
|
indicators: []
|
|
1094
1216
|
};
|
|
1095
1217
|
|
|
1096
|
-
function useIntersectionObserver(
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1218
|
+
function useIntersectionObserver({
|
|
1219
|
+
threshold,
|
|
1220
|
+
onVisibleIndexChange,
|
|
1221
|
+
enabled
|
|
1222
|
+
}) {
|
|
1223
|
+
const containerRef = useRef();
|
|
1224
|
+
const childRefs = useRef([]);
|
|
1225
|
+
const observerRef = useRef();
|
|
1226
|
+
useEffect(() => {
|
|
1104
1227
|
if (!enabled) {
|
|
1105
1228
|
return;
|
|
1106
1229
|
}
|
|
1107
|
-
|
|
1108
|
-
|
|
1230
|
+
const observer = observerRef.current = new IntersectionObserver(entries => {
|
|
1231
|
+
const containerElement = containerRef.current;
|
|
1109
1232
|
if (!containerElement) {
|
|
1110
1233
|
return;
|
|
1111
1234
|
}
|
|
1112
|
-
|
|
1113
|
-
entries.forEach(
|
|
1114
|
-
|
|
1115
|
-
return child === entry.target;
|
|
1116
|
-
});
|
|
1235
|
+
let found = false;
|
|
1236
|
+
entries.forEach(entry => {
|
|
1237
|
+
const entryIndex = Array.from(containerElement.children).findIndex(child => child === entry.target);
|
|
1117
1238
|
if (entry.isIntersecting && entry.intersectionRatio >= threshold) {
|
|
1118
1239
|
found = true;
|
|
1119
1240
|
onVisibleIndexChange(entryIndex);
|
|
@@ -1124,59 +1245,53 @@ function useIntersectionObserver(_ref) {
|
|
|
1124
1245
|
}
|
|
1125
1246
|
}, {
|
|
1126
1247
|
root: containerRef.current,
|
|
1127
|
-
threshold
|
|
1248
|
+
threshold
|
|
1128
1249
|
});
|
|
1129
|
-
childRefs.current.forEach(
|
|
1250
|
+
childRefs.current.forEach(child => {
|
|
1130
1251
|
if (child) {
|
|
1131
1252
|
observer.observe(child);
|
|
1132
1253
|
}
|
|
1133
1254
|
});
|
|
1134
|
-
return
|
|
1255
|
+
return () => {
|
|
1135
1256
|
observer.disconnect();
|
|
1136
1257
|
};
|
|
1137
1258
|
}, [enabled, threshold, onVisibleIndexChange]);
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
if (
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
observerRef.current.unobserve(childRefs.current[index]);
|
|
1145
|
-
}
|
|
1259
|
+
const setChildRef = index => ref => {
|
|
1260
|
+
if (observerRef.current) {
|
|
1261
|
+
if (ref) {
|
|
1262
|
+
observerRef.current.observe(ref);
|
|
1263
|
+
} else {
|
|
1264
|
+
observerRef.current.unobserve(childRefs.current[index]);
|
|
1146
1265
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1266
|
+
}
|
|
1267
|
+
childRefs.current[index] = ref;
|
|
1149
1268
|
};
|
|
1150
1269
|
return [containerRef, setChildRef];
|
|
1151
1270
|
}
|
|
1152
1271
|
|
|
1153
|
-
function useScrollPanZoom(
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
_useIntersectionObser2 = _slicedToArray(_useIntersectionObser, 2),
|
|
1169
|
-
scrollerRef = _useIntersectionObser2[0],
|
|
1170
|
-
setStepRef = _useIntersectionObser2[1];
|
|
1171
|
-
var steps = useMemo(function () {
|
|
1272
|
+
function useScrollPanZoom({
|
|
1273
|
+
panZoomTransforms,
|
|
1274
|
+
enabled,
|
|
1275
|
+
onChange
|
|
1276
|
+
}) {
|
|
1277
|
+
const wrapperRef = useRef();
|
|
1278
|
+
const scrollerAreasRef = useRef();
|
|
1279
|
+
const indicatorRefs = useRef([]);
|
|
1280
|
+
const onVisibleIndexChange = useCallback(index => onChange(index - 1), [onChange]);
|
|
1281
|
+
const [scrollerRef, setStepRef] = useIntersectionObserver({
|
|
1282
|
+
enabled,
|
|
1283
|
+
threshold: 0.7,
|
|
1284
|
+
onVisibleIndexChange
|
|
1285
|
+
});
|
|
1286
|
+
const steps = useMemo(() => {
|
|
1172
1287
|
if (!enabled || !panZoomTransforms.areas.length) {
|
|
1173
1288
|
return;
|
|
1174
1289
|
}
|
|
1175
|
-
return [panZoomTransforms.initial
|
|
1290
|
+
return [panZoomTransforms.initial, ...panZoomTransforms.areas, panZoomTransforms.initial];
|
|
1176
1291
|
}, [panZoomTransforms, enabled]);
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1292
|
+
const scrollFromToArea = useCallback((from, to) => {
|
|
1293
|
+
const scroller = scrollerRef.current;
|
|
1294
|
+
const step = scroller.children[to + 1];
|
|
1180
1295
|
scroller.scrollTo(Math.abs(scroller.offsetLeft - step.offsetLeft), 0);
|
|
1181
1296
|
if (!steps) {
|
|
1182
1297
|
return;
|
|
@@ -1184,47 +1299,35 @@ function useScrollPanZoom(_ref) {
|
|
|
1184
1299
|
wrapperRef.current.animate([keyframe(steps[from + 1].wrapper), keyframe(steps[to + 1].wrapper)], {
|
|
1185
1300
|
duration: 200
|
|
1186
1301
|
});
|
|
1187
|
-
panZoomTransforms.areas.forEach(
|
|
1302
|
+
panZoomTransforms.areas.forEach((_, index) => {
|
|
1188
1303
|
indicatorRefs.current[index].animate([keyframe(steps[from + 1].indicators[index]), keyframe(steps[to + 1].indicators[index])], {
|
|
1189
1304
|
duration: 200
|
|
1190
1305
|
});
|
|
1191
1306
|
});
|
|
1192
1307
|
}, [scrollerRef, steps, panZoomTransforms]);
|
|
1193
|
-
useIsomorphicLayoutEffect(
|
|
1308
|
+
useIsomorphicLayoutEffect(() => {
|
|
1194
1309
|
if (!steps) {
|
|
1195
1310
|
return;
|
|
1196
1311
|
}
|
|
1197
|
-
|
|
1312
|
+
const scrollTimeline = new window.ScrollTimeline({
|
|
1198
1313
|
source: scrollerRef.current,
|
|
1199
1314
|
axis: 'inline'
|
|
1200
1315
|
});
|
|
1201
|
-
|
|
1202
|
-
[wrapperRef.current, scrollerAreasRef.current].forEach(
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
}));
|
|
1209
|
-
});
|
|
1210
|
-
panZoomTransforms.areas.forEach(function (_, index) {
|
|
1211
|
-
animations.push(indicatorRefs.current[index].animate(steps.map(function (step) {
|
|
1212
|
-
return keyframe(step.indicators[index]);
|
|
1213
|
-
}), {
|
|
1316
|
+
const animations = [];
|
|
1317
|
+
[wrapperRef.current, scrollerAreasRef.current].forEach(element => animations.push(element.animate(steps.map(step => keyframe(step.wrapper)), {
|
|
1318
|
+
fill: 'both',
|
|
1319
|
+
timeline: scrollTimeline
|
|
1320
|
+
})));
|
|
1321
|
+
panZoomTransforms.areas.forEach((_, index) => {
|
|
1322
|
+
animations.push(indicatorRefs.current[index].animate(steps.map(step => keyframe(step.indicators[index])), {
|
|
1214
1323
|
fill: 'both',
|
|
1215
1324
|
timeline: scrollTimeline
|
|
1216
1325
|
}));
|
|
1217
1326
|
});
|
|
1218
|
-
return
|
|
1219
|
-
return animations.forEach(function (animation) {
|
|
1220
|
-
return animation.cancel();
|
|
1221
|
-
});
|
|
1222
|
-
};
|
|
1327
|
+
return () => animations.forEach(animation => animation.cancel());
|
|
1223
1328
|
}, [panZoomTransforms, steps]);
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
indicatorRefs.current[index] = ref;
|
|
1227
|
-
};
|
|
1329
|
+
const setIndicatorRef = index => ref => {
|
|
1330
|
+
indicatorRefs.current[index] = ref;
|
|
1228
1331
|
};
|
|
1229
1332
|
return {
|
|
1230
1333
|
panZoomRefs: {
|
|
@@ -1234,7 +1337,7 @@ function useScrollPanZoom(_ref) {
|
|
|
1234
1337
|
setStep: setStepRef,
|
|
1235
1338
|
setIndicator: setIndicatorRef
|
|
1236
1339
|
},
|
|
1237
|
-
scrollFromToArea
|
|
1340
|
+
scrollFromToArea
|
|
1238
1341
|
};
|
|
1239
1342
|
}
|
|
1240
1343
|
function keyframe(transform) {
|
|
@@ -1246,184 +1349,227 @@ function keyframe(transform) {
|
|
|
1246
1349
|
|
|
1247
1350
|
var styles$7 = {"tooltipsWrapper":"Hotspots-module_tooltipsWrapper__3EEZA","clip":"Hotspots-module_clip__2wfxm","stack":"Hotspots-module_stack__3Vpw6","letterboxBackground":"Hotspots-module_letterboxBackground__3GNSI","wrapper":"Hotspots-module_wrapper__1TvVX","compositeItem":"Hotspots-module_compositeItem__BZtU-"};
|
|
1248
1351
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1352
|
+
var _jsxFileName$7 = "/home/tfischbach/code/pageflow/entry_types/scrolled/package/src/contentElements/hotspots/Hotspots.js";
|
|
1353
|
+
function Hotspots({
|
|
1354
|
+
contentElementId,
|
|
1355
|
+
contentElementWidth,
|
|
1356
|
+
customMargin,
|
|
1357
|
+
configuration,
|
|
1358
|
+
sectionProps = {}
|
|
1359
|
+
}) {
|
|
1256
1360
|
return /*#__PURE__*/React.createElement(FullscreenViewer, {
|
|
1257
1361
|
contentElementId: contentElementId,
|
|
1258
|
-
renderChildren:
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1362
|
+
renderChildren: ({
|
|
1363
|
+
enterFullscreen
|
|
1364
|
+
}) => /*#__PURE__*/React.createElement(HotspotsImage, {
|
|
1365
|
+
contentElementId: contentElementId,
|
|
1366
|
+
contentElementWidth: contentElementWidth,
|
|
1367
|
+
customMargin: customMargin,
|
|
1368
|
+
configuration: configuration,
|
|
1369
|
+
isIntersecting: sectionProps.isIntersecting,
|
|
1370
|
+
displayFullscreenToggle: contentElementWidth !== contentElementWidths.full && configuration.enableFullscreen,
|
|
1371
|
+
keepTooltipsInViewport: configuration.position === 'backdrop',
|
|
1372
|
+
onFullscreenEnter: enterFullscreen,
|
|
1373
|
+
floatingStrategy: configuration.position === 'standAlone' || configuration.position === 'backdrop' ? 'fixed' : 'absolute',
|
|
1374
|
+
__self: this,
|
|
1375
|
+
__source: {
|
|
1376
|
+
fileName: _jsxFileName$7,
|
|
1377
|
+
lineNumber: 41,
|
|
1378
|
+
columnNumber: 9
|
|
1379
|
+
}
|
|
1380
|
+
}, children => /*#__PURE__*/React.createElement(ContentElementBox, {
|
|
1381
|
+
configuration: configuration,
|
|
1382
|
+
__self: this,
|
|
1383
|
+
__source: {
|
|
1384
|
+
fileName: _jsxFileName$7,
|
|
1385
|
+
lineNumber: 54,
|
|
1386
|
+
columnNumber: 13
|
|
1387
|
+
}
|
|
1388
|
+
}, /*#__PURE__*/React.createElement(ContentElementFigure, {
|
|
1389
|
+
configuration: configuration,
|
|
1390
|
+
__self: this,
|
|
1391
|
+
__source: {
|
|
1392
|
+
fileName: _jsxFileName$7,
|
|
1393
|
+
lineNumber: 55,
|
|
1394
|
+
columnNumber: 15
|
|
1395
|
+
}
|
|
1396
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1397
|
+
className: styles$7.clip,
|
|
1398
|
+
__self: this,
|
|
1399
|
+
__source: {
|
|
1400
|
+
fileName: _jsxFileName$7,
|
|
1401
|
+
lineNumber: 56,
|
|
1402
|
+
columnNumber: 17
|
|
1403
|
+
}
|
|
1404
|
+
}, children)))),
|
|
1405
|
+
renderFullscreenChildren: () => /*#__PURE__*/React.createElement(HotspotsImage, {
|
|
1406
|
+
contentElementId: contentElementId,
|
|
1407
|
+
contentElementWidth: contentElementWidth,
|
|
1408
|
+
configuration: configuration,
|
|
1409
|
+
displayFullscreenToggle: false,
|
|
1410
|
+
keepTooltipsInViewport: true,
|
|
1411
|
+
tooltipsAboveNavigationWidgets: true,
|
|
1412
|
+
__self: this,
|
|
1413
|
+
__source: {
|
|
1414
|
+
fileName: _jsxFileName$7,
|
|
1415
|
+
lineNumber: 65,
|
|
1416
|
+
columnNumber: 9
|
|
1417
|
+
}
|
|
1418
|
+
}),
|
|
1419
|
+
__self: this,
|
|
1420
|
+
__source: {
|
|
1421
|
+
fileName: _jsxFileName$7,
|
|
1422
|
+
lineNumber: 38,
|
|
1423
|
+
columnNumber: 5
|
|
1287
1424
|
}
|
|
1288
1425
|
});
|
|
1289
1426
|
}
|
|
1290
|
-
function HotspotsImage(
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
shouldLoad
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
areas: areas,
|
|
1427
|
+
function HotspotsImage({
|
|
1428
|
+
contentElementId,
|
|
1429
|
+
contentElementWidth,
|
|
1430
|
+
customMargin,
|
|
1431
|
+
configuration,
|
|
1432
|
+
keepTooltipsInViewport,
|
|
1433
|
+
floatingStrategy,
|
|
1434
|
+
tooltipsAboveNavigationWidgets,
|
|
1435
|
+
isIntersecting,
|
|
1436
|
+
displayFullscreenToggle,
|
|
1437
|
+
onFullscreenEnter,
|
|
1438
|
+
children = children => children
|
|
1439
|
+
}) {
|
|
1440
|
+
const {
|
|
1441
|
+
imageFile,
|
|
1442
|
+
areas,
|
|
1443
|
+
panZoomEnabled
|
|
1444
|
+
} = useHotspotsConfiguration(configuration);
|
|
1445
|
+
const {
|
|
1446
|
+
activeIndex,
|
|
1447
|
+
hoveredIndex,
|
|
1448
|
+
highlightedIndex,
|
|
1449
|
+
setActiveIndex,
|
|
1450
|
+
setHoveredIndex,
|
|
1451
|
+
setHighlightedIndex
|
|
1452
|
+
} = useHotspotsState({
|
|
1453
|
+
areas,
|
|
1454
|
+
initialActiveArea: configuration.initialActiveArea
|
|
1455
|
+
});
|
|
1456
|
+
const {
|
|
1457
|
+
shouldLoad
|
|
1458
|
+
} = useContentElementLifecycle();
|
|
1459
|
+
const {
|
|
1460
|
+
isEditable,
|
|
1461
|
+
isSelected
|
|
1462
|
+
} = useContentElementEditorState();
|
|
1463
|
+
const aspectRatio = imageFile ? `${imageFile.width} / ${imageFile.height}` : '4 / 3';
|
|
1464
|
+
const [containerRect, containerRef] = useContentRect({
|
|
1465
|
+
enabled: shouldLoad
|
|
1466
|
+
});
|
|
1467
|
+
const panZoomTransforms = usePanZoomTransforms({
|
|
1468
|
+
containerRect,
|
|
1469
|
+
imageFile,
|
|
1470
|
+
areas,
|
|
1335
1471
|
initialTransformEnabled: configuration.position === 'backdrop',
|
|
1336
|
-
panZoomEnabled
|
|
1472
|
+
panZoomEnabled
|
|
1337
1473
|
});
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1474
|
+
const {
|
|
1475
|
+
panZoomRefs,
|
|
1476
|
+
scrollFromToArea
|
|
1477
|
+
} = useScrollPanZoom({
|
|
1478
|
+
panZoomTransforms,
|
|
1479
|
+
enabled: shouldLoad,
|
|
1480
|
+
onChange: setActiveIndex
|
|
1481
|
+
});
|
|
1482
|
+
const scrollToArea = useCallback(index => {
|
|
1346
1483
|
scrollFromToArea(activeIndex, index);
|
|
1347
1484
|
}, [scrollFromToArea, activeIndex]);
|
|
1348
|
-
|
|
1485
|
+
const activateArea = panZoomEnabled ? scrollToArea : setActiveIndex;
|
|
1349
1486
|
useHotspotsEditorCommandSubscriptions({
|
|
1350
|
-
setHighlightedIndex
|
|
1351
|
-
activateArea
|
|
1487
|
+
setHighlightedIndex,
|
|
1488
|
+
activateArea
|
|
1352
1489
|
});
|
|
1353
1490
|
function renderVisibleAreas() {
|
|
1354
|
-
return areas.map(
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1491
|
+
return areas.map((area, index) => /*#__PURE__*/React.createElement(ImageArea, {
|
|
1492
|
+
key: index,
|
|
1493
|
+
area: area,
|
|
1494
|
+
panZoomEnabled: panZoomEnabled,
|
|
1495
|
+
activeImageVisible: activeIndex === index || !panZoomEnabled && activeIndex < 0 && hoveredIndex === index,
|
|
1496
|
+
outlined: isEditable && isSelected,
|
|
1497
|
+
outlineHidden: isIntersecting,
|
|
1498
|
+
highlighted: hoveredIndex === index || highlightedIndex === index || activeIndex === index,
|
|
1499
|
+
__self: this,
|
|
1500
|
+
__source: {
|
|
1501
|
+
fileName: _jsxFileName$7,
|
|
1502
|
+
lineNumber: 131,
|
|
1503
|
+
columnNumber: 7
|
|
1504
|
+
}
|
|
1505
|
+
}));
|
|
1365
1506
|
}
|
|
1366
1507
|
function renderClickableAreas() {
|
|
1367
|
-
return areas.map(
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
return setHoveredIndex(-1);
|
|
1377
|
-
},
|
|
1378
|
-
onClick: function onClick() {
|
|
1379
|
-
if (!isEditable || isSelected) {
|
|
1380
|
-
activateArea(index);
|
|
1381
|
-
}
|
|
1508
|
+
return areas.map((area, index) => /*#__PURE__*/React.createElement(Area, {
|
|
1509
|
+
key: index,
|
|
1510
|
+
area: area,
|
|
1511
|
+
noPointerEvents: panZoomEnabled && activeIndex >= 0 && activeIndex < areas.length,
|
|
1512
|
+
onMouseEnter: () => setHoveredIndex(index),
|
|
1513
|
+
onMouseLeave: () => setHoveredIndex(-1),
|
|
1514
|
+
onClick: () => {
|
|
1515
|
+
if (!isEditable || isSelected) {
|
|
1516
|
+
activateArea(index);
|
|
1382
1517
|
}
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1518
|
+
},
|
|
1519
|
+
__self: this,
|
|
1520
|
+
__source: {
|
|
1521
|
+
fileName: _jsxFileName$7,
|
|
1522
|
+
lineNumber: 148,
|
|
1523
|
+
columnNumber: 7
|
|
1524
|
+
}
|
|
1525
|
+
}));
|
|
1385
1526
|
}
|
|
1386
1527
|
function renderIndicators() {
|
|
1387
|
-
return areas.map(
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1528
|
+
return areas.map((area, index) => /*#__PURE__*/React.createElement(Indicator, {
|
|
1529
|
+
key: index,
|
|
1530
|
+
area: area,
|
|
1531
|
+
hidden: isIntersecting || panZoomEnabled && activeIndex >= 0 && activeIndex < areas.length && activeIndex !== index,
|
|
1532
|
+
panZoomTransform: panZoomTransforms.initial.indicators[index],
|
|
1533
|
+
outerRef: panZoomRefs.setIndicator(index),
|
|
1534
|
+
__self: this,
|
|
1535
|
+
__source: {
|
|
1536
|
+
fileName: _jsxFileName$7,
|
|
1537
|
+
lineNumber: 165,
|
|
1538
|
+
columnNumber: 7
|
|
1539
|
+
}
|
|
1540
|
+
}));
|
|
1396
1541
|
}
|
|
1397
1542
|
function renderTooltips() {
|
|
1398
|
-
return areas.map(
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1543
|
+
return areas.map((area, index) => /*#__PURE__*/React.createElement(Tooltip, {
|
|
1544
|
+
key: index,
|
|
1545
|
+
area: area,
|
|
1546
|
+
contentElementId: contentElementId,
|
|
1547
|
+
containerRect: containerRect,
|
|
1548
|
+
imageFile: imageFile,
|
|
1549
|
+
panZoomTransform: panZoomTransforms.initial.tooltips[index],
|
|
1550
|
+
configuration: configuration,
|
|
1551
|
+
visible: !isIntersecting && (activeIndex === index || !panZoomEnabled && activeIndex < 0 && hoveredIndex === index),
|
|
1552
|
+
active: activeIndex === index,
|
|
1553
|
+
keepInViewport: keepTooltipsInViewport,
|
|
1554
|
+
aboveNavigationWidgets: tooltipsAboveNavigationWidgets,
|
|
1555
|
+
wrapperRef: containerRef,
|
|
1556
|
+
floatingStrategy: floatingStrategy,
|
|
1557
|
+
onMouseEnter: () => setHoveredIndex(index),
|
|
1558
|
+
onMouseLeave: () => setHoveredIndex(-1),
|
|
1559
|
+
onClick: () => setActiveIndex(index),
|
|
1560
|
+
onLinkClick: event => {
|
|
1561
|
+
activateArea(-1);
|
|
1562
|
+
setHoveredIndex(-1);
|
|
1563
|
+
event.stopPropagation();
|
|
1564
|
+
},
|
|
1565
|
+
onDismiss: () => activateArea(-1),
|
|
1566
|
+
__self: this,
|
|
1567
|
+
__source: {
|
|
1568
|
+
fileName: _jsxFileName$7,
|
|
1569
|
+
lineNumber: 179,
|
|
1570
|
+
columnNumber: 7
|
|
1571
|
+
}
|
|
1572
|
+
}));
|
|
1427
1573
|
}
|
|
1428
1574
|
function renderFullscreenToggle() {
|
|
1429
1575
|
if (!displayFullscreenToggle) {
|
|
@@ -1431,7 +1577,13 @@ function HotspotsImage(_ref3) {
|
|
|
1431
1577
|
}
|
|
1432
1578
|
return /*#__PURE__*/React.createElement(ToggleFullscreenCornerButton, {
|
|
1433
1579
|
isFullscreen: false,
|
|
1434
|
-
onEnter: onFullscreenEnter
|
|
1580
|
+
onEnter: onFullscreenEnter,
|
|
1581
|
+
__self: this,
|
|
1582
|
+
__source: {
|
|
1583
|
+
fileName: _jsxFileName$7,
|
|
1584
|
+
lineNumber: 212,
|
|
1585
|
+
columnNumber: 7
|
|
1586
|
+
}
|
|
1435
1587
|
});
|
|
1436
1588
|
}
|
|
1437
1589
|
function renderLetterboxBackground() {
|
|
@@ -1439,11 +1591,23 @@ function HotspotsImage(_ref3) {
|
|
|
1439
1591
|
return null;
|
|
1440
1592
|
}
|
|
1441
1593
|
return /*#__PURE__*/React.createElement("div", {
|
|
1442
|
-
className: styles$7.letterboxBackground
|
|
1594
|
+
className: styles$7.letterboxBackground,
|
|
1595
|
+
__self: this,
|
|
1596
|
+
__source: {
|
|
1597
|
+
fileName: _jsxFileName$7,
|
|
1598
|
+
lineNumber: 223,
|
|
1599
|
+
columnNumber: 7
|
|
1600
|
+
}
|
|
1443
1601
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
1444
1602
|
imageFile: imageFile,
|
|
1445
1603
|
load: shouldLoad,
|
|
1446
|
-
variant: 'medium'
|
|
1604
|
+
variant: 'medium',
|
|
1605
|
+
__self: this,
|
|
1606
|
+
__source: {
|
|
1607
|
+
fileName: _jsxFileName$7,
|
|
1608
|
+
lineNumber: 224,
|
|
1609
|
+
columnNumber: 9
|
|
1610
|
+
}
|
|
1447
1611
|
}));
|
|
1448
1612
|
}
|
|
1449
1613
|
return /*#__PURE__*/React.createElement(Pager, {
|
|
@@ -1452,32 +1616,80 @@ function HotspotsImage(_ref3) {
|
|
|
1452
1616
|
panZoomEnabled: panZoomEnabled,
|
|
1453
1617
|
hideButtons: isIntersecting,
|
|
1454
1618
|
activeIndex: activeIndex,
|
|
1455
|
-
activateArea: activateArea
|
|
1619
|
+
activateArea: activateArea,
|
|
1620
|
+
__self: this,
|
|
1621
|
+
__source: {
|
|
1622
|
+
fileName: _jsxFileName$7,
|
|
1623
|
+
lineNumber: 232,
|
|
1624
|
+
columnNumber: 5
|
|
1625
|
+
}
|
|
1456
1626
|
}, /*#__PURE__*/React.createElement(FitViewport, {
|
|
1457
1627
|
file: imageFile,
|
|
1458
|
-
|
|
1628
|
+
fallbackAspectRatio: 0.75,
|
|
1459
1629
|
fill: configuration.position === 'backdrop',
|
|
1460
|
-
|
|
1630
|
+
__self: this,
|
|
1631
|
+
__source: {
|
|
1632
|
+
fileName: _jsxFileName$7,
|
|
1633
|
+
lineNumber: 238,
|
|
1634
|
+
columnNumber: 7
|
|
1635
|
+
}
|
|
1461
1636
|
}, /*#__PURE__*/React.createElement(Composite, {
|
|
1462
1637
|
activeIndex: activeIndex + 1,
|
|
1463
1638
|
loop: false,
|
|
1464
|
-
onNavigate:
|
|
1465
|
-
|
|
1639
|
+
onNavigate: index => activateArea(index - 1),
|
|
1640
|
+
__self: this,
|
|
1641
|
+
__source: {
|
|
1642
|
+
fileName: _jsxFileName$7,
|
|
1643
|
+
lineNumber: 241,
|
|
1644
|
+
columnNumber: 9
|
|
1466
1645
|
}
|
|
1467
1646
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1468
1647
|
className: styles$7.tooltipsWrapper,
|
|
1469
1648
|
style: {
|
|
1470
1649
|
'--hotspots-image-aspect-ratio': aspectRatio,
|
|
1471
|
-
'--hotspots-container-height':
|
|
1650
|
+
'--hotspots-container-height': `${containerRect.height}px`
|
|
1651
|
+
},
|
|
1652
|
+
__self: this,
|
|
1653
|
+
__source: {
|
|
1654
|
+
fileName: _jsxFileName$7,
|
|
1655
|
+
lineNumber: 244,
|
|
1656
|
+
columnNumber: 11
|
|
1657
|
+
}
|
|
1658
|
+
}, children( /*#__PURE__*/React.createElement(FitViewport.Content, {
|
|
1659
|
+
__self: this,
|
|
1660
|
+
__source: {
|
|
1661
|
+
fileName: _jsxFileName$7,
|
|
1662
|
+
lineNumber: 248,
|
|
1663
|
+
columnNumber: 15
|
|
1472
1664
|
}
|
|
1473
|
-
},
|
|
1665
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1474
1666
|
className: styles$7.stack,
|
|
1475
|
-
ref: containerRef
|
|
1476
|
-
|
|
1667
|
+
ref: containerRef,
|
|
1668
|
+
__self: this,
|
|
1669
|
+
__source: {
|
|
1670
|
+
fileName: _jsxFileName$7,
|
|
1671
|
+
lineNumber: 249,
|
|
1672
|
+
columnNumber: 17
|
|
1673
|
+
}
|
|
1674
|
+
}, /*#__PURE__*/React.createElement(FilePlaceholder, {
|
|
1675
|
+
file: imageFile,
|
|
1676
|
+
__self: this,
|
|
1677
|
+
__source: {
|
|
1678
|
+
fileName: _jsxFileName$7,
|
|
1679
|
+
lineNumber: 251,
|
|
1680
|
+
columnNumber: 19
|
|
1681
|
+
}
|
|
1682
|
+
}), renderLetterboxBackground(), /*#__PURE__*/React.createElement("div", {
|
|
1477
1683
|
className: styles$7.wrapper,
|
|
1478
1684
|
ref: panZoomRefs.wrapper,
|
|
1479
1685
|
style: {
|
|
1480
1686
|
transform: panZoomTransforms.initial.wrapper
|
|
1687
|
+
},
|
|
1688
|
+
__self: this,
|
|
1689
|
+
__source: {
|
|
1690
|
+
fileName: _jsxFileName$7,
|
|
1691
|
+
lineNumber: 253,
|
|
1692
|
+
columnNumber: 19
|
|
1481
1693
|
}
|
|
1482
1694
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
1483
1695
|
imageFile: imageFile,
|
|
@@ -1485,17 +1697,35 @@ function HotspotsImage(_ref3) {
|
|
|
1485
1697
|
fill: false,
|
|
1486
1698
|
structuredData: true,
|
|
1487
1699
|
variant: panZoomEnabled ? 'ultra' : 'large',
|
|
1488
|
-
preferSvg: true
|
|
1700
|
+
preferSvg: true,
|
|
1701
|
+
__self: this,
|
|
1702
|
+
__source: {
|
|
1703
|
+
fileName: _jsxFileName$7,
|
|
1704
|
+
lineNumber: 256,
|
|
1705
|
+
columnNumber: 21
|
|
1706
|
+
}
|
|
1489
1707
|
}), renderVisibleAreas()), /*#__PURE__*/React.createElement(Scroller, {
|
|
1490
1708
|
disabled: !panZoomEnabled,
|
|
1491
1709
|
areas: areas,
|
|
1492
1710
|
ref: panZoomRefs.scroller,
|
|
1493
|
-
setStepRef: panZoomRefs.setStep
|
|
1711
|
+
setStepRef: panZoomRefs.setStep,
|
|
1712
|
+
__self: this,
|
|
1713
|
+
__source: {
|
|
1714
|
+
fileName: _jsxFileName$7,
|
|
1715
|
+
lineNumber: 264,
|
|
1716
|
+
columnNumber: 19
|
|
1717
|
+
}
|
|
1494
1718
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1495
1719
|
className: styles$7.wrapper,
|
|
1496
1720
|
ref: panZoomRefs.scrollerAreas,
|
|
1497
1721
|
style: {
|
|
1498
1722
|
transform: panZoomTransforms.initial.wrapper
|
|
1723
|
+
},
|
|
1724
|
+
__self: this,
|
|
1725
|
+
__source: {
|
|
1726
|
+
fileName: _jsxFileName$7,
|
|
1727
|
+
lineNumber: 268,
|
|
1728
|
+
columnNumber: 21
|
|
1499
1729
|
}
|
|
1500
1730
|
}, renderClickableAreas())), renderIndicators()), renderFullscreenToggle(), /*#__PURE__*/React.createElement(InlineFileRights, {
|
|
1501
1731
|
configuration: configuration,
|
|
@@ -1503,22 +1733,58 @@ function HotspotsImage(_ref3) {
|
|
|
1503
1733
|
items: [{
|
|
1504
1734
|
file: imageFile,
|
|
1505
1735
|
label: 'image'
|
|
1506
|
-
}]
|
|
1736
|
+
}],
|
|
1737
|
+
__self: this,
|
|
1738
|
+
__source: {
|
|
1739
|
+
fileName: _jsxFileName$7,
|
|
1740
|
+
lineNumber: 277,
|
|
1741
|
+
columnNumber: 17
|
|
1742
|
+
}
|
|
1507
1743
|
}))), /*#__PURE__*/React.createElement(CompositeItem, {
|
|
1508
1744
|
render: /*#__PURE__*/React.createElement("div", {
|
|
1509
|
-
className: styles$7.compositeItem
|
|
1510
|
-
|
|
1745
|
+
className: styles$7.compositeItem,
|
|
1746
|
+
__self: this,
|
|
1747
|
+
__source: {
|
|
1748
|
+
fileName: _jsxFileName$7,
|
|
1749
|
+
lineNumber: 282,
|
|
1750
|
+
columnNumber: 36
|
|
1751
|
+
}
|
|
1752
|
+
}),
|
|
1753
|
+
__self: this,
|
|
1754
|
+
__source: {
|
|
1755
|
+
fileName: _jsxFileName$7,
|
|
1756
|
+
lineNumber: 282,
|
|
1757
|
+
columnNumber: 13
|
|
1758
|
+
}
|
|
1511
1759
|
}), renderTooltips(), /*#__PURE__*/React.createElement(CompositeItem, {
|
|
1512
1760
|
render: /*#__PURE__*/React.createElement("div", {
|
|
1513
|
-
className: styles$7.compositeItem
|
|
1514
|
-
|
|
1761
|
+
className: styles$7.compositeItem,
|
|
1762
|
+
__self: this,
|
|
1763
|
+
__source: {
|
|
1764
|
+
fileName: _jsxFileName$7,
|
|
1765
|
+
lineNumber: 284,
|
|
1766
|
+
columnNumber: 36
|
|
1767
|
+
}
|
|
1768
|
+
}),
|
|
1769
|
+
__self: this,
|
|
1770
|
+
__source: {
|
|
1771
|
+
fileName: _jsxFileName$7,
|
|
1772
|
+
lineNumber: 284,
|
|
1773
|
+
columnNumber: 13
|
|
1774
|
+
}
|
|
1515
1775
|
}))), /*#__PURE__*/React.createElement(InlineFileRights, {
|
|
1516
1776
|
configuration: configuration,
|
|
1517
1777
|
context: "afterElement",
|
|
1518
1778
|
items: [{
|
|
1519
1779
|
file: imageFile,
|
|
1520
1780
|
label: 'image'
|
|
1521
|
-
}]
|
|
1781
|
+
}],
|
|
1782
|
+
__self: this,
|
|
1783
|
+
__source: {
|
|
1784
|
+
fileName: _jsxFileName$7,
|
|
1785
|
+
lineNumber: 287,
|
|
1786
|
+
columnNumber: 9
|
|
1787
|
+
}
|
|
1522
1788
|
})));
|
|
1523
1789
|
}
|
|
1524
1790
|
|