pageflow 17.0.5 → 17.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +362 -35
- data/README.md +0 -1
- data/admins/pageflow/accounts.rb +16 -14
- data/admins/pageflow/entry.rb +68 -20
- data/admins/pageflow/entry_templates.rb +10 -9
- data/admins/pageflow/folder.rb +1 -1
- data/admins/pageflow/membership.rb +4 -4
- data/admins/pageflow/revisions.rb +5 -5
- data/admins/pageflow/site_root_entry.rb +64 -0
- data/admins/pageflow/sites.rb +12 -3
- data/admins/pageflow/translations.rb +75 -0
- data/admins/pageflow/user.rb +21 -35
- data/app/assets/javascripts/pageflow/admin/entries.js +30 -5
- data/app/assets/javascripts/pageflow/dist/ui.js +2865 -257
- data/app/assets/stylesheets/pageflow/admin/entries/index_table.scss +2 -1
- data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +2 -1
- data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +6 -0
- data/app/assets/stylesheets/pageflow/editor/base.scss +2 -0
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +7 -1
- data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +5 -1
- data/app/assets/stylesheets/pageflow/editor/files.scss +28 -16
- data/app/assets/stylesheets/pageflow/editor/filtered_files.scss +24 -0
- data/app/assets/stylesheets/pageflow/editor/info_box.scss +11 -3
- data/app/assets/stylesheets/pageflow/editor/list.scss +6 -4
- data/app/assets/stylesheets/pageflow/editor/list_search_field.scss +52 -0
- data/app/assets/stylesheets/pageflow/editor/outline.scss +0 -13
- data/app/assets/stylesheets/pageflow/editor/select_button.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/sortable.scss +12 -0
- data/app/assets/stylesheets/pageflow/mixins/buttons.scss +4 -4
- data/app/assets/stylesheets/pageflow/ui/forms.scss +4 -0
- data/app/assets/stylesheets/pageflow/ui/input/color_input.scss +8 -0
- data/app/assets/stylesheets/pageflow/ui/input/file_name_input.scss +37 -0
- data/app/assets/stylesheets/pageflow/ui/properties.scss +5 -0
- data/app/assets/stylesheets/pageflow/ui.scss +1 -0
- data/app/controllers/concerns/pageflow/controller_delegation.rb +1 -1
- data/app/controllers/concerns/pageflow/edit_locking.rb +17 -10
- data/app/controllers/concerns/pageflow/entry_password_protection.rb +1 -0
- data/app/controllers/concerns/pageflow/public_https_mode.rb +2 -1
- data/app/controllers/concerns/pageflow/quota_verification.rb +5 -4
- data/app/controllers/pageflow/admin/initial_passwords_controller.rb +1 -0
- data/app/controllers/pageflow/application_controller.rb +19 -19
- data/app/controllers/pageflow/chapters_controller.rb +3 -2
- data/app/controllers/pageflow/edit_locks_controller.rb +3 -2
- data/app/controllers/pageflow/editor/encoding_confirmations_controller.rb +1 -0
- data/app/controllers/pageflow/editor/entries_controller.rb +2 -1
- data/app/controllers/pageflow/editor/entry_publications_controller.rb +1 -0
- data/app/controllers/pageflow/editor/file_import_controller.rb +3 -3
- data/app/controllers/pageflow/editor/files_controller.rb +7 -6
- data/app/controllers/pageflow/editor/widgets_controller.rb +1 -0
- data/app/controllers/pageflow/entries_controller.rb +77 -17
- data/app/controllers/pageflow/feeds_controller.rb +1 -1
- data/app/controllers/pageflow/files_controller.rb +1 -0
- data/app/controllers/pageflow/pages_controller.rb +4 -2
- data/app/controllers/pageflow/revisions_controller.rb +2 -1
- data/app/controllers/pageflow/sitemaps_controller.rb +1 -1
- data/app/controllers/pageflow/storylines_controller.rb +1 -0
- data/app/helpers/pageflow/admin/cutoff_modes_helper.rb +12 -0
- data/app/helpers/pageflow/admin/entries_helper.rb +1 -1
- data/app/helpers/pageflow/admin/entry_translations_helper.rb +18 -0
- data/app/helpers/pageflow/admin/features_helper.rb +1 -1
- data/app/helpers/pageflow/admin/form_helper.rb +3 -3
- data/app/helpers/pageflow/admin/locales_helper.rb +10 -2
- data/app/helpers/pageflow/admin/memberships_helper.rb +32 -32
- data/app/helpers/pageflow/admin/revisions_helper.rb +1 -1
- data/app/helpers/pageflow/admin/sites_helper.rb +22 -0
- data/app/helpers/pageflow/admin/users_helper.rb +7 -5
- data/app/helpers/pageflow/admin/widgets_helper.rb +3 -3
- data/app/helpers/pageflow/asset_urls_helper.rb +1 -1
- data/app/helpers/pageflow/audio_files_helper.rb +5 -2
- data/app/helpers/pageflow/background_image_helper.rb +7 -6
- data/app/helpers/pageflow/common_entry_seed_helper.rb +2 -4
- data/app/helpers/pageflow/editor/config_helper.rb +1 -1
- data/app/helpers/pageflow/editor/files_helper.rb +1 -1
- data/app/helpers/pageflow/embed_code_helper.rb +3 -3
- data/app/helpers/pageflow/entries_helper.rb +58 -34
- data/app/helpers/pageflow/entry_json_seed_helper.rb +3 -2
- data/app/helpers/pageflow/feeds_helper.rb +2 -2
- data/app/helpers/pageflow/file_background_images_helper.rb +2 -2
- data/app/helpers/pageflow/file_thumbnails_helper.rb +4 -3
- data/app/helpers/pageflow/files_helper.rb +5 -4
- data/app/helpers/pageflow/folders_helper.rb +8 -5
- data/app/helpers/pageflow/help_entries_helper.rb +2 -2
- data/app/helpers/pageflow/hreflang_links_helper.rb +37 -0
- data/app/helpers/pageflow/info_box_helper.rb +7 -11
- data/app/helpers/pageflow/media_query_helper.rb +3 -3
- data/app/helpers/pageflow/navigation_bar_helper.rb +1 -1
- data/app/helpers/pageflow/overview_helper.rb +1 -1
- data/app/helpers/pageflow/page_types_helper.rb +5 -5
- data/app/helpers/pageflow/pages_helper.rb +29 -15
- data/app/helpers/pageflow/public_i18n_helper.rb +1 -1
- data/app/helpers/pageflow/quota_helper.rb +4 -4
- data/app/helpers/pageflow/render_json_helper.rb +6 -3
- data/app/helpers/pageflow/revision_file_helper.rb +2 -1
- data/app/helpers/pageflow/sites_helper.rb +3 -3
- data/app/helpers/pageflow/social_share_helper.rb +24 -10
- data/app/helpers/pageflow/social_share_links_helper.rb +12 -9
- data/app/helpers/pageflow/structured_data_helper.rb +1 -1
- data/app/helpers/pageflow/stub_page_configuration.rb +7 -3
- data/app/helpers/pageflow/text_direction_helper.rb +1 -1
- data/app/helpers/pageflow/themes_helper.rb +1 -1
- data/app/helpers/pageflow/video_files_helper.rb +29 -13
- data/app/helpers/pageflow/widgets_helper.rb +7 -6
- data/app/inputs/pageflow_permalink_input.rb +3 -2
- data/app/jobs/pageflow/application_job.rb +1 -0
- data/app/jobs/pageflow/entry_export_import/upload_and_publish_file_job.rb +1 -1
- data/app/jobs/pageflow/poll_meta_data_from_zencoder_job.rb +1 -0
- data/app/jobs/pageflow/poll_zencoder_job.rb +3 -2
- data/app/jobs/pageflow/process_image_or_text_track_job.rb +1 -0
- data/app/jobs/pageflow/prune_auto_snapshots_job.rb +1 -0
- data/app/jobs/pageflow/request_meta_data_from_zencoder_job.rb +1 -0
- data/app/jobs/pageflow/submit_file_to_zencoder_job.rb +1 -0
- data/app/mailers/pageflow/user_mailer.rb +1 -0
- data/app/models/concerns/pageflow/auto_generated_perma_id.rb +13 -1
- data/app/models/concerns/pageflow/entry_publication_states.rb +7 -3
- data/app/models/concerns/pageflow/feature_target.rb +8 -4
- data/app/models/concerns/pageflow/output_source.rb +3 -3
- data/app/models/concerns/pageflow/permalinkable.rb +2 -1
- data/app/models/concerns/pageflow/reusable_file.rb +23 -23
- data/app/models/concerns/pageflow/serialization_blacklist.rb +1 -1
- data/app/models/concerns/pageflow/suspendable.rb +5 -3
- data/app/models/concerns/pageflow/theme_referencer.rb +1 -1
- data/app/models/concerns/pageflow/translatable.rb +62 -0
- data/app/models/concerns/pageflow/uploadable_file.rb +6 -6
- data/app/models/pageflow/account.rb +6 -5
- data/app/models/pageflow/account_member_query.rb +1 -1
- data/app/models/pageflow/account_role_query.rb +1 -1
- data/app/models/pageflow/application_query.rb +1 -1
- data/app/models/pageflow/application_record.rb +1 -1
- data/app/models/pageflow/audio_file.rb +4 -4
- data/app/models/pageflow/audio_file_url_templates.rb +1 -1
- data/app/models/pageflow/authentication_token.rb +2 -2
- data/app/models/pageflow/chapter.rb +6 -1
- data/app/models/pageflow/chapter_scaffold.rb +2 -4
- data/app/models/pageflow/cname_site_request_scope.rb +1 -1
- data/app/models/pageflow/customized_theme.rb +6 -6
- data/app/models/pageflow/draft_entry.rb +37 -9
- data/app/models/pageflow/edit_lock.rb +19 -21
- data/app/models/pageflow/encoding_confirmation.rb +2 -2
- data/app/models/pageflow/entries_feed.rb +2 -2
- data/app/models/pageflow/entry.rb +44 -30
- data/app/models/pageflow/entry_at_revision.rb +5 -1
- data/app/models/pageflow/entry_duplicate.rb +8 -5
- data/app/models/pageflow/entry_publication.rb +2 -2
- data/app/models/pageflow/entry_role_query.rb +4 -4
- data/app/models/pageflow/entry_template.rb +4 -4
- data/app/models/pageflow/entry_title_or_account_name_query.rb +2 -2
- data/app/models/pageflow/entry_translation_group.rb +42 -0
- data/app/models/pageflow/file_reuse.rb +2 -2
- data/app/models/pageflow/file_usage.rb +10 -3
- data/app/models/pageflow/folder.rb +2 -2
- data/app/models/pageflow/home_button.rb +7 -7
- data/app/models/pageflow/image_file.rb +20 -5
- data/app/models/pageflow/image_file_url_templates.rb +1 -1
- data/app/models/pageflow/invitation_form.rb +2 -1
- data/app/models/pageflow/managed_user_query.rb +1 -1
- data/app/models/pageflow/membership.rb +5 -5
- data/app/models/pageflow/nested_revision_component_copy.rb +263 -0
- data/app/models/pageflow/null_user.rb +1 -1
- data/app/models/pageflow/overview_button.rb +1 -1
- data/app/models/pageflow/page.rb +7 -3
- data/app/models/pageflow/permalink.rb +23 -2
- data/app/models/pageflow/permalink_directory.rb +7 -0
- data/app/models/pageflow/permalink_redirect.rb +7 -0
- data/app/models/pageflow/positioned_file.rb +5 -5
- data/app/models/pageflow/potential_entry_translations.rb +55 -0
- data/app/models/pageflow/potential_memberships.rb +5 -4
- data/app/models/pageflow/published_entry.rb +62 -11
- data/app/models/pageflow/revision.rb +24 -15
- data/app/models/pageflow/roles.rb +14 -18
- data/app/models/pageflow/site.rb +36 -3
- data/app/models/pageflow/site_root_entry_form.rb +27 -0
- data/app/models/pageflow/sitemaps.rb +10 -1
- data/app/models/pageflow/storyline.rb +5 -2
- data/app/models/pageflow/storyline_scaffold.rb +1 -1
- data/app/models/pageflow/text_track_file.rb +1 -1
- data/app/models/pageflow/text_track_file_url_templates.rb +1 -1
- data/app/models/pageflow/theme_customization_file.rb +3 -2
- data/app/models/pageflow/thumbnail_file_resolver.rb +1 -1
- data/app/models/pageflow/url_template.rb +1 -1
- data/app/models/pageflow/used_file.rb +7 -3
- data/app/models/pageflow/user_name_query.rb +2 -2
- data/app/models/pageflow/video_file.rb +22 -15
- data/app/models/pageflow/video_file_url_templates.rb +6 -4
- data/app/models/pageflow/widget.rb +4 -3
- data/app/models/pageflow/with_file_usage_extension.rb +1 -1
- data/app/models/pageflow/zencoder_attachment.rb +8 -8
- data/app/policies/pageflow/account_policy.rb +3 -1
- data/app/policies/pageflow/admin/admin_only_tab_policy.rb +1 -0
- data/app/policies/pageflow/admin/entry_tab_policy.rb +1 -0
- data/app/policies/pageflow/application_policy.rb +2 -0
- data/app/policies/pageflow/entry_policy.rb +7 -1
- data/app/policies/pageflow/entry_template_policy.rb +2 -1
- data/app/policies/pageflow/file_policy.rb +4 -7
- data/app/policies/pageflow/folder_policy.rb +18 -8
- data/app/policies/pageflow/membership_policy.rb +6 -4
- data/app/policies/pageflow/site_policy.rb +10 -3
- data/app/policies/pageflow/user_policy.rb +6 -4
- data/app/state_machines/pageflow/image_and_text_track_processing_state_machine.rb +3 -2
- data/app/state_machines/pageflow/media_encoding_state_machine.rb +5 -4
- data/app/views/admin/accounts/_entry_template_details.html.arb +2 -2
- data/app/views/admin/entries/_attributes_table.html.arb +6 -5
- data/app/views/admin/entries/_form.html.erb +2 -1
- data/app/views/admin/entries/_permalink_inputs.html.erb +9 -2
- data/app/views/admin/entry_templates/_form.html.erb +1 -3
- data/app/views/admin/site_root_entry/choose.html.erb +19 -0
- data/app/views/admin/sites/_fields.html.erb +14 -1
- data/app/views/admin/translations/_form.html.erb +31 -0
- data/app/views/admin/users/_attributes_table.html.arb +13 -0
- data/app/views/components/pageflow/admin/add_membership_button.rb +13 -12
- data/app/views/components/pageflow/admin/custom_scopes_renderer.rb +1 -0
- data/app/views/components/pageflow/admin/embed_code_field.rb +1 -0
- data/app/views/components/pageflow/admin/embedded_index_table.rb +9 -10
- data/app/views/components/pageflow/admin/entries_tab.rb +1 -0
- data/app/views/components/pageflow/admin/entry_publication_state_indicator.rb +6 -5
- data/app/views/components/pageflow/admin/entry_templates_tab.rb +2 -1
- data/app/views/components/pageflow/admin/entry_translations_tab.rb +102 -0
- data/app/views/components/pageflow/admin/entry_user_badge_list.rb +1 -0
- data/app/views/components/pageflow/admin/extensible_attributes_table.rb +9 -8
- data/app/views/components/pageflow/admin/features_tab.rb +1 -0
- data/app/views/components/pageflow/admin/grouped_folder_list.rb +1 -0
- data/app/views/components/pageflow/admin/icon_link_to.rb +1 -0
- data/app/views/components/pageflow/admin/members_tab.rb +4 -3
- data/app/views/components/pageflow/admin/membership_role_with_tooltip.rb +3 -2
- data/app/views/components/pageflow/admin/revisions_tab.rb +14 -10
- data/app/views/components/pageflow/admin/sites_tab.rb +1 -0
- data/app/views/components/pageflow/admin/tabs_view.rb +1 -0
- data/app/views/components/pageflow/admin/timestamp.rb +6 -5
- data/app/views/components/pageflow/admin/user_account_badge_list.rb +2 -3
- data/app/views/components/pageflow/admin/user_accounts_tab.rb +1 -0
- data/app/views/components/pageflow/admin/user_entries_tab.rb +1 -0
- data/app/views/components/pageflow/admin/users_tab.rb +1 -0
- data/app/views/pageflow/editor/config/_seeds.json.jbuilder +1 -1
- data/app/views/pageflow/editor/entries/index.json.jbuilder +1 -1
- data/app/views/pageflow/editor/entries/show.json.jbuilder +1 -1
- data/app/views/pageflow/editor/entry_publications/check.json.jbuilder +2 -2
- data/app/views/pageflow/editor/files/_file.json.jbuilder +5 -13
- data/app/views/pageflow/editor/files/create.json.jbuilder +1 -1
- data/app/views/pageflow/editor/files/index.json.jbuilder +1 -1
- data/app/views/pageflow/editor/sites/_site.json.jbuilder +1 -0
- data/app/views/pageflow/editor/video_files/_video_file.json.jbuilder +1 -3
- data/app/views/pageflow/entries/share_menu/_bluesky_link.html.erb +8 -0
- data/app/views/pageflow/entries/share_menu/_threads_link.html.erb +8 -0
- data/app/views/pageflow/files/_file.json.jbuilder +3 -3
- data/app/views/pageflow/sitemaps/index.xml.builder +9 -1
- data/app/views/pageflow/social_share/_entry_meta_tags.html.erb +1 -1
- data/app/views/pageflow/social_share/_page_meta_tags.html.erb +1 -1
- data/config/initializers/active_admin_patches.rb +3 -6
- data/config/initializers/admin_resource_tabs.rb +3 -0
- data/config/initializers/paperclip.rb +1 -0
- data/config/initializers/symmetric_encryption.rb +1 -1
- data/config/initializers/zencoder.rb +24 -13
- data/config/locales/de.yml +110 -4
- data/config/locales/en.yml +109 -7
- data/config/routes.rb +15 -13
- data/config/spring.rb +2 -1
- data/db/migrate/20140418225525_setup_schema.rb +2 -2
- data/db/migrate/20190306161431_copy_file_attributes_of_failed_uploads.rb +2 -2
- data/db/migrate/20190820152900_drop_accounts_themes.rb +2 -1
- data/db/migrate/20191202145757_create_pageflow_scrolled_sections.rb +11 -11
- data/db/migrate/20191202150657_create_pageflow_scrolled_chapters.rb +1 -1
- data/db/migrate/20191202154723_create_pageflow_scrolled_content_elements.rb +9 -9
- data/db/migrate/20191219143450_add_position_to_content_elements.rb +2 -1
- data/db/migrate/20200117133200_change_revision_appearance_option_default_and_null.rb +2 -1
- data/db/migrate/20200122115400_create_pageflow_entry_templates.rb +25 -25
- data/db/migrate/20200206134400_convert_legacy_scrolled_content_element_types.rb +3 -3
- data/db/migrate/20221215120856_associate_entry_templates_with_sites.rb +2 -2
- data/db/migrate/20230120092923_create_other_files.rb +2 -1
- data/db/migrate/20230419083307_create_pageflow_entry_translation_group.rb +9 -0
- data/db/migrate/20240612110434_add_cutoff_mode_name_to_sites.rb +5 -0
- data/db/migrate/20240918084059_create_pageflow_permalink_redirects.rb +14 -0
- data/db/migrate/20250508172234_ensure_scrolled_entries_have_main_storyline.rb +14 -0
- data/db/migrate/20250617090048_add_custom404_entry_to_sites.rb +5 -0
- data/db/migrate/20250617100000_add_perma_id_counter_to_entries.rb +28 -0
- data/db/migrate/20250722174123_add_perma_id_to_chapters.rb +10 -0
- data/db/migrate/20250725080603_add_perma_id_indexes_to_revision_components.rb +13 -0
- data/db/migrate/20250726000000_add_display_name_to_file_usages.rb +5 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +3912 -1486
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +468 -1161
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +28125 -22
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +26589 -19
- data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +1 -0
- data/entry_types/paged/app/helpers/pageflow_paged/page_background_asset_helper.rb +1 -1
- data/entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb +7 -7
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_seed.json.jbuilder +1 -0
- data/entry_types/paged/app/views/pageflow_paged/entries/show.html.erb +1 -0
- data/entry_types/paged/lib/pageflow_paged/plugin.rb +4 -0
- data/entry_types/paged/lib/pageflow_paged/react/page_type.rb +1 -1
- data/entry_types/paged/lib/pageflow_paged/react/widget_type.rb +3 -3
- data/entry_types/paged/lib/pageflow_paged.rb +1 -1
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +5 -3
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +2 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/cache_helper.rb +2 -2
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/entry_json_seed_helper.rb +1 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +2 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +60 -6
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +16 -2
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +21 -23
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +16 -1
- data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +15 -14
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +12 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/section.rb +12 -1
- data/entry_types/scrolled/app/models/pageflow_scrolled/storyline.rb +19 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/sections/_section_with_content_elements.json.jbuilder +2 -2
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +2 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +17 -9
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry_translations.json.jbuilder +14 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +25 -5
- data/entry_types/scrolled/app/views/pageflow_scrolled/storylines/_storyline.json.jbuilder +7 -0
- data/entry_types/scrolled/config/locales/de.yml +614 -45
- data/entry_types/scrolled/config/locales/en.yml +586 -47
- data/entry_types/scrolled/config/routes.rb +18 -8
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +11 -11
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDarkVariantDesktop.svg +56 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDarkVariantMobile.svg +22 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt +26 -11
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +27 -8
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +1 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_theme_assets.rb +27 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +16 -4
- data/entry_types/scrolled/lib/pageflow_scrolled/content_element_consent_vendors.rb +1 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +24 -4
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +24 -22
- data/entry_types/scrolled/lib/pageflow_scrolled.rb +1 -1
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +6 -5
- data/entry_types/scrolled/package/config/webpack.js +22 -0
- data/entry_types/scrolled/package/contentElements/hotspots-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements/hotspots-frontend.js +1529 -0
- data/entry_types/scrolled/package/contentElements/tikTokEmbed-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements/tikTokEmbed-frontend.js +59 -0
- data/entry_types/scrolled/package/contentElements-editor.js +2075 -321
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +1019 -643
- data/entry_types/scrolled/package/editor.js +2086 -1091
- data/entry_types/scrolled/package/frontend/{EditableInlineText.module-ebd22921.js → FloatingPortalRootProvider-51914be7.js} +1200 -1258
- data/entry_types/scrolled/package/frontend/{PhonePlatformContext-4ec6b2de.js → PhonePlatformContext-9f76033e.js} +7 -8
- data/entry_types/scrolled/package/frontend/ThemeIcon-81f2f066.js +1932 -0
- data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-788e9cdb.js +39 -0
- data/entry_types/scrolled/package/frontend/{Viewer-1bb5597c.js → Viewer-0345ce57.js} +36 -63
- data/entry_types/scrolled/package/frontend/{Viewer-1ecf3375.js → Viewer-cdc549cc.js} +15 -22
- data/entry_types/scrolled/package/frontend/{Wavesurfer-7d9cf1b7.js → Wavesurfer-1cdc3925.js} +54 -74
- data/entry_types/scrolled/package/frontend/{components-024a9893.js → components-96660ffd.js} +1791 -841
- data/entry_types/scrolled/package/frontend/{index-11f32f10.js → index-eb670c2f.js} +11 -18
- data/entry_types/scrolled/package/frontend/index.css +1 -1
- data/entry_types/scrolled/package/frontend/index.js +517 -903
- data/entry_types/scrolled/package/frontend/{createSuper-d0f30da3.js → inherits-539844a6.js} +40 -56
- data/entry_types/scrolled/package/frontend/{useContentElementEditorState-4f4c3cf6.js → useContentElementEditorState-77fe6c79.js} +7 -8
- data/entry_types/scrolled/package/frontend/usePhonePlatform-c2ba875d.js +8 -0
- data/entry_types/scrolled/package/frontend-server.js +0 -1
- data/entry_types/scrolled/package/package.json +18 -10
- data/entry_types/scrolled/package/testHelpers.js +306 -70
- data/entry_types/scrolled/package/values/widgets.module.css +18 -0
- data/entry_types/scrolled/package/widgets/consentBar.css +1 -1
- data/entry_types/scrolled/package/widgets/consentBar.js +47 -66
- data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
- data/entry_types/scrolled/package/widgets/defaultNavigation.js +177 -207
- data/entry_types/scrolled/package/widgets/excursionDialog.css +1 -0
- data/entry_types/scrolled/package/widgets/excursionDialog.js +109 -0
- data/entry_types/scrolled/package/widgets/excursionSheet.css +1 -0
- data/entry_types/scrolled/package/widgets/excursionSheet.js +262 -0
- data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -1
- data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +6 -9
- data/entry_types/scrolled/package/widgets/iconScrollIndicator.css +1 -0
- data/entry_types/scrolled/package/widgets/iconScrollIndicator.js +48 -0
- data/entry_types/scrolled/package/widgets/mainStorylineSheet.css +1 -0
- data/entry_types/scrolled/package/widgets/mainStorylineSheet.js +144 -0
- data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -1
- data/entry_types/scrolled/package/widgets/textInlineFileRights.js +26 -9
- data/entry_types/scrolled/package/widgets-server.js +1 -0
- data/entry_types/scrolled/spec/factories/chapters.rb +14 -1
- data/entry_types/scrolled/spec/factories/content_elements.rb +1 -1
- data/lib/generators/pageflow/active_admin_initializer/active_admin_initializer_generator.rb +5 -3
- data/lib/generators/pageflow/assets/assets_generator.rb +7 -5
- data/lib/generators/pageflow/cancan/cancan_generator.rb +2 -1
- data/lib/generators/pageflow/cancan/templates/ability.rb +1 -1
- data/lib/generators/pageflow/error_pages/error_pages_generator.rb +2 -1
- data/lib/generators/pageflow/initializer/initializer_generator.rb +3 -2
- data/lib/generators/pageflow/install/install_generator.rb +2 -2
- data/lib/generators/pageflow/procfile/procfile_generator.rb +2 -1
- data/lib/generators/pageflow/resque/resque_generator.rb +6 -4
- data/lib/generators/pageflow/resque/templates/resque.rake +1 -1
- data/lib/generators/pageflow/routes/routes_generator.rb +4 -2
- data/lib/generators/pageflow/seeds/seeds_generator.rb +3 -2
- data/lib/generators/pageflow/seeds/templates/seeds.rb +6 -6
- data/lib/generators/pageflow/theme/theme_generator.rb +2 -1
- data/lib/generators/pageflow/user/user_generator.rb +2 -1
- data/lib/pageflow/ability_mixin.rb +25 -15
- data/lib/pageflow/active_admin_patches/views/attributes_table.rb +1 -0
- data/lib/pageflow/active_admin_patches/views/pages/base.rb +3 -2
- data/lib/pageflow/active_admin_patches/views/table_for.rb +1 -0
- data/lib/pageflow/additional_headers.rb +27 -0
- data/lib/pageflow/admin/attributes_table_rows.rb +3 -3
- data/lib/pageflow/admin/tabs.rb +1 -1
- data/lib/pageflow/built_in_file_type.rb +1 -1
- data/lib/pageflow/built_in_page_types_plugin.rb +1 -1
- data/lib/pageflow/built_in_widget_type.rb +2 -2
- data/lib/pageflow/built_in_widget_types_plugin.rb +2 -1
- data/lib/pageflow/configuration.rb +141 -18
- data/lib/pageflow/cutoff_modes.rb +39 -0
- data/lib/pageflow/editor_controller.rb +6 -10
- data/lib/pageflow/engine.rb +4 -5
- data/lib/pageflow/entry_export_import/attachment_files.rb +1 -1
- data/lib/pageflow/entry_export_import/entry_serialization.rb +5 -4
- data/lib/pageflow/entry_export_import/file_mappings.rb +1 -0
- data/lib/pageflow/entry_export_import/revision_serialization/import.rb +1 -1
- data/lib/pageflow/entry_export_import.rb +3 -3
- data/lib/pageflow/entry_types.rb +2 -2
- data/lib/pageflow/feature.rb +1 -1
- data/lib/pageflow/features.rb +4 -6
- data/lib/pageflow/file_importers.rb +4 -4
- data/lib/pageflow/file_type.rb +3 -3
- data/lib/pageflow/file_types.rb +3 -3
- data/lib/pageflow/global_config_api.rb +5 -6
- data/lib/pageflow/help_entries.rb +7 -7
- data/lib/pageflow/help_entry.rb +1 -1
- data/lib/pageflow/hooks.rb +1 -1
- data/lib/pageflow/nested_revision_component.rb +9 -27
- data/lib/pageflow/news_item_api.rb +1 -1
- data/lib/pageflow/page_type.rb +2 -3
- data/lib/pageflow/page_types.rb +3 -3
- data/lib/pageflow/paperclip_interpolations/support.rb +1 -1
- data/lib/pageflow/paperclip_processors/vtt.rb +1 -0
- data/lib/pageflow/paperclip_processors/webp.rb +2 -2
- data/lib/pageflow/partial_editor_fragment_renderer.rb +2 -2
- data/lib/pageflow/plugin.rb +1 -2
- data/lib/pageflow/quota.rb +9 -5
- data/lib/pageflow/quotas.rb +1 -1
- data/lib/pageflow/rails_version.rb +1 -0
- data/lib/pageflow/react.rb +1 -1
- data/lib/pageflow/revision_component.rb +8 -40
- data/lib/pageflow/revision_components.rb +16 -6
- data/lib/pageflow/seeds.rb +12 -16
- data/lib/pageflow/theme.rb +1 -1
- data/lib/pageflow/theme_customizations.rb +10 -10
- data/lib/pageflow/themes.rb +3 -3
- data/lib/pageflow/user_mixin.rb +6 -6
- data/lib/pageflow/version.rb +1 -1
- data/lib/pageflow/widget_type.rb +4 -4
- data/lib/pageflow/widget_types.rb +9 -9
- data/lib/pageflow/zencoder_api.rb +32 -42
- data/lib/pageflow/zencoder_audio_output_definition.rb +14 -13
- data/lib/pageflow/zencoder_meta_data_output_definition.rb +3 -2
- data/lib/pageflow/zencoder_output_definition.rb +16 -14
- data/lib/pageflow/zencoder_video_output_definition.rb +140 -88
- data/lib/pageflow.rb +7 -2
- data/lib/tasks/pageflow_tasks.rake +1 -1
- data/package/editor.js +954 -868
- data/package/frontend.js +113 -387
- data/package/package.json +2 -1
- data/package/testHelpers.js +10 -56
- data/package/ui.js +209 -251
- data/spec/factories/accounts.rb +37 -22
- data/spec/factories/audio_files.rb +2 -2
- data/spec/factories/authentication_tokens.rb +4 -4
- data/spec/factories/chapters.rb +4 -4
- data/spec/factories/draft_entries.rb +14 -6
- data/spec/factories/edit_locks.rb +1 -1
- data/spec/factories/entries.rb +28 -19
- data/spec/factories/entry_translation_groups.rb +6 -0
- data/spec/factories/file_usages.rb +2 -1
- data/spec/factories/folders.rb +1 -1
- data/spec/factories/image_files.rb +2 -2
- data/spec/factories/pages.rb +3 -3
- data/spec/factories/published_entries.rb +26 -8
- data/spec/factories/revisions.rb +1 -1
- data/spec/factories/sites.rb +6 -0
- data/spec/factories/test_multi_attachment_files.rb +1 -1
- data/spec/factories/text_track_files.rb +1 -1
- data/spec/factories/uploadable_files.rb +1 -1
- data/spec/factories/users.rb +6 -6
- data/spec/factories/video_files.rb +2 -2
- data/spec/factories/widgets.rb +1 -1
- data/spec/fixtures/7x15_rotated.jpg +0 -0
- data/vendor/assets/javascripts/wysihtml-toolbar.js +19288 -0
- metadata +98 -45
- data/config/initializers/revision_components.rb +0 -5
- data/config/locales/twitter_to_x.de.yml +0 -6
- data/config/locales/twitter_to_x.en.yml +0 -6
- data/entry_types/scrolled/config/locales/twitter_to_x.de.yml +0 -12
- data/entry_types/scrolled/config/locales/twitter_to_x.en.yml +0 -12
- data/entry_types/scrolled/config/locales/vr_image_projection.de.yml +0 -24
- data/entry_types/scrolled/config/locales/vr_image_projection.en.yml +0 -24
- data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-b79159cc.js +0 -107
- data/entry_types/scrolled/package/frontend/arrowRight-62998af9.js +0 -77
- data/entry_types/scrolled/package/frontend/i18n-ce13a8bf.js +0 -1129
@@ -1,11 +1,15 @@
|
|
1
1
|
import I18n from 'i18n-js';
|
2
|
-
import { editor, InlineFileRightsMenuItem,
|
3
|
-
import { contentElementWidths, utils } from 'pageflow-scrolled/frontend';
|
4
|
-
import { SelectInputView, SeparatorView, LabelOnlyView, ColorInputView, UrlInputView,
|
5
|
-
import { InfoBoxView, FileInputView, CheckBoxInputView, ColorInputView as ColorInputView$1, editor as editor$1, transientReferences, ListView,
|
6
|
-
import Marionette from 'backbone.marionette';
|
2
|
+
import { editor, InlineFileRightsMenuItem, ImageModifierListInputView, EditMotifAreaDialogView, buttonStyles, dialogViewStyles, dialogView } from 'pageflow-scrolled/editor';
|
3
|
+
import { contentElementWidths, utils, paletteColor } from 'pageflow-scrolled/frontend';
|
4
|
+
import { SelectInputView, SeparatorView, CheckBoxInputView, LabelOnlyView, ColorInputView, UrlInputView, TextInputView, SliderInputView, ConfigurationEditorView, cssModulesUtils, TabsView, inputView, NumberInputView } from 'pageflow/ui';
|
5
|
+
import { InfoBoxView, FileInputView, CheckBoxInputView as CheckBoxInputView$1, ColorInputView as ColorInputView$1, editor as editor$1, transientReferences, ListView, cssModulesUtils as cssModulesUtils$1, app, SelectInputView as SelectInputView$1, SeparatorView as SeparatorView$1, SliderInputView as SliderInputView$1, EnumTableCellView } from 'pageflow/editor';
|
7
6
|
import Backbone from 'backbone';
|
7
|
+
import Marionette from 'backbone.marionette';
|
8
8
|
import _ from 'underscore';
|
9
|
+
import React, { useReducer, useEffect, useRef } from 'react';
|
10
|
+
import ReactDOM from 'react-dom';
|
11
|
+
import classNames from 'classnames';
|
12
|
+
import { DraggableCore } from 'react-draggable';
|
9
13
|
|
10
14
|
function _defineProperty(obj, key, value) {
|
11
15
|
if (key in obj) {
|
@@ -74,9 +78,6 @@ editor.contentElementTypes.register('heading', {
|
|
74
78
|
paletteColorPropertyName: 'color'
|
75
79
|
});
|
76
80
|
this.tab('general', function () {
|
77
|
-
this.input('textSize', SelectInputView, {
|
78
|
-
values: ['auto', 'large', 'medium', 'small']
|
79
|
-
});
|
80
81
|
this.group('ContentElementTypographyVariant', {
|
81
82
|
entry: entry,
|
82
83
|
model: modelDelegator,
|
@@ -87,6 +88,9 @@ editor.contentElementTypes.register('heading', {
|
|
87
88
|
});
|
88
89
|
}
|
89
90
|
});
|
91
|
+
this.input('textSize', SelectInputView, {
|
92
|
+
values: ['auto', 'large', 'medium', 'small']
|
93
|
+
});
|
90
94
|
this.group('PaletteColor', {
|
91
95
|
entry: entry,
|
92
96
|
model: modelDelegator,
|
@@ -98,15 +102,15 @@ editor.contentElementTypes.register('heading', {
|
|
98
102
|
this.input('hyphens', SelectInputView, {
|
99
103
|
values: ['auto', 'manual']
|
100
104
|
});
|
101
|
-
|
102
105
|
if (this.model.get('hyphens') === 'manual') {
|
103
106
|
this.view(InfoBoxView, {
|
104
107
|
text: I18n.t('pageflow_scrolled.editor.content_elements.heading.help_texts.shortcuts')
|
105
108
|
});
|
106
109
|
}
|
107
|
-
|
108
110
|
this.view(SeparatorView);
|
109
|
-
this.group('ContentElementPosition'
|
111
|
+
this.group('ContentElementPosition', {
|
112
|
+
entry: entry
|
113
|
+
});
|
110
114
|
});
|
111
115
|
}
|
112
116
|
});
|
@@ -118,11 +122,27 @@ editor.contentElementTypes.register('textBlock', {
|
|
118
122
|
supportedPositions: ['inline'],
|
119
123
|
configurationEditor: function configurationEditor(_ref) {
|
120
124
|
var _this = this;
|
121
|
-
|
122
125
|
var entry = _ref.entry,
|
123
|
-
|
126
|
+
contentElement = _ref.contentElement;
|
127
|
+
var pendingRefresh;
|
124
128
|
this.listenTo(contentElement.transientState, 'change:exampleNode', function () {
|
125
|
-
|
129
|
+
// This is a terrible hack to prevent closing the minicolors
|
130
|
+
// dropdown while adjusting colors. Calling refresh is needed
|
131
|
+
// to update typography drop downs. Delay until color picker
|
132
|
+
// is closed.
|
133
|
+
if (document.activeElement && document.activeElement.tagName === 'INPUT' && document.activeElement.className === 'minicolors-input') {
|
134
|
+
if (!pendingRefresh) {
|
135
|
+
document.activeElement.addEventListener('blur', function () {
|
136
|
+
pendingRefresh = false;
|
137
|
+
_this.refresh();
|
138
|
+
}, {
|
139
|
+
once: true
|
140
|
+
});
|
141
|
+
pendingRefresh = true;
|
142
|
+
}
|
143
|
+
return;
|
144
|
+
}
|
145
|
+
_this.refresh();
|
126
146
|
});
|
127
147
|
this.tab('general', function () {
|
128
148
|
var exampleNode = ensureTextContent(contentElement.transientState.get('exampleNode'));
|
@@ -130,28 +150,45 @@ editor.contentElementTypes.register('textBlock', {
|
|
130
150
|
model: contentElement.transientState,
|
131
151
|
paletteColorPropertyName: 'color'
|
132
152
|
});
|
153
|
+
var _getPreviewConfiguration = function getPreviewConfiguration(configuration, properties) {
|
154
|
+
return exampleNode ? _objectSpread2(_objectSpread2({}, configuration), {}, {
|
155
|
+
value: [_objectSpread2(_objectSpread2({}, exampleNode), {}, {
|
156
|
+
// Ensure size in preview is not overridden by legacy variant
|
157
|
+
variant: modelDelegator.get('typographyVariant')
|
158
|
+
}, properties),
|
159
|
+
// Ensure content spans whole preview viewport if
|
160
|
+
// section uses "cards" appearance.
|
161
|
+
{
|
162
|
+
type: 'paragraph',
|
163
|
+
children: [{
|
164
|
+
text: ''
|
165
|
+
}]
|
166
|
+
}, {
|
167
|
+
type: 'paragraph',
|
168
|
+
children: [{
|
169
|
+
text: ''
|
170
|
+
}]
|
171
|
+
}]
|
172
|
+
}) : configuration;
|
173
|
+
};
|
133
174
|
this.group('ContentElementTypographyVariant', {
|
134
175
|
entry: entry,
|
135
176
|
model: modelDelegator,
|
136
177
|
prefix: exampleNode ? utils.camelize(exampleNode.type) : 'none',
|
137
178
|
getPreviewConfiguration: function getPreviewConfiguration(configuration, variant) {
|
138
|
-
return
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
text: ''
|
152
|
-
}]
|
153
|
-
}]
|
154
|
-
}) : configuration;
|
179
|
+
return _getPreviewConfiguration(configuration, {
|
180
|
+
variant: variant
|
181
|
+
});
|
182
|
+
}
|
183
|
+
});
|
184
|
+
this.group('ContentElementTypographySize', {
|
185
|
+
entry: entry,
|
186
|
+
model: modelDelegator,
|
187
|
+
prefix: exampleNode ? utils.camelize(exampleNode.type) : 'none',
|
188
|
+
getPreviewConfiguration: function getPreviewConfiguration(configuration, size) {
|
189
|
+
return _getPreviewConfiguration(configuration, {
|
190
|
+
size: size
|
191
|
+
});
|
155
192
|
}
|
156
193
|
});
|
157
194
|
this.group('PaletteColor', {
|
@@ -159,6 +196,10 @@ editor.contentElementTypes.register('textBlock', {
|
|
159
196
|
model: modelDelegator,
|
160
197
|
propertyName: 'color'
|
161
198
|
});
|
199
|
+
this.input('textAlign', SelectInputView, {
|
200
|
+
model: contentElement.transientState,
|
201
|
+
values: ['ragged', 'justify']
|
202
|
+
});
|
162
203
|
this.view(SeparatorView);
|
163
204
|
this.view(InfoBoxView, {
|
164
205
|
text: I18n.t('pageflow_scrolled.editor.content_elements.textBlock.help_texts.shortcuts')
|
@@ -184,7 +225,6 @@ editor.contentElementTypes.register('textBlock', {
|
|
184
225
|
},
|
185
226
|
handleDestroy: function handleDestroy(contentElement) {
|
186
227
|
var transientState = contentElement.get('transientState') || {};
|
187
|
-
|
188
228
|
if (!transientState.editableTextIsSingleBlock) {
|
189
229
|
contentElement.postCommand({
|
190
230
|
type: 'REMOVE'
|
@@ -193,7 +233,6 @@ editor.contentElementTypes.register('textBlock', {
|
|
193
233
|
}
|
194
234
|
}
|
195
235
|
});
|
196
|
-
|
197
236
|
function getValue(configuration) {
|
198
237
|
// Value might still be empty if text block has not been edited
|
199
238
|
return configuration.value || [{
|
@@ -203,7 +242,6 @@ function getValue(configuration) {
|
|
203
242
|
}]
|
204
243
|
}];
|
205
244
|
}
|
206
|
-
|
207
245
|
function ensureTextContent(node) {
|
208
246
|
if (node && node.children.length === 1 && node.children[0].text === '') {
|
209
247
|
return _objectSpread2(_objectSpread2({}, node), {}, {
|
@@ -221,21 +259,57 @@ var img$2 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBo
|
|
221
259
|
editor.contentElementTypes.register('inlineImage', {
|
222
260
|
pictogram: img$2,
|
223
261
|
category: 'media',
|
224
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
262
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
225
263
|
supportedWidthRange: ['xxs', 'full'],
|
226
264
|
configurationEditor: function configurationEditor(_ref) {
|
227
|
-
var
|
265
|
+
var entry = _ref.entry,
|
266
|
+
contentElement = _ref.contentElement;
|
228
267
|
this.tab('general', function () {
|
268
|
+
var _this = this;
|
229
269
|
this.input('id', FileInputView, {
|
230
270
|
collection: 'image_files',
|
231
271
|
fileSelectionHandler: 'contentElementConfiguration',
|
232
|
-
positioning:
|
272
|
+
positioning: function positioning(imageModifiers) {
|
273
|
+
return imageModifiers === null || imageModifiers === void 0 ? void 0 : imageModifiers.length;
|
274
|
+
},
|
275
|
+
positioningBinding: 'imageModifiers',
|
276
|
+
positioningOptions: function positioningOptions() {
|
277
|
+
var _this$model$get, _this$model$get$;
|
278
|
+
var aspectRatio = entry.getAspectRatio((_this$model$get = _this.model.get('imageModifiers')) === null || _this$model$get === void 0 ? void 0 : (_this$model$get$ = _this$model$get[0]) === null || _this$model$get$ === void 0 ? void 0 : _this$model$get$.value);
|
279
|
+
return {
|
280
|
+
preview: aspectRatio && 1 / aspectRatio
|
281
|
+
};
|
282
|
+
},
|
233
283
|
dropDownMenuItems: [InlineFileRightsMenuItem]
|
234
284
|
});
|
285
|
+
this.input('imageModifiers', ImageModifierListInputView, {
|
286
|
+
entry: entry,
|
287
|
+
visibleBinding: 'id',
|
288
|
+
visible: function visible() {
|
289
|
+
return _this.model.getReference('id', 'image_files');
|
290
|
+
}
|
291
|
+
});
|
235
292
|
this.input('portraitId', FileInputView, {
|
236
293
|
collection: 'image_files',
|
237
294
|
fileSelectionHandler: 'contentElementConfiguration',
|
238
|
-
positioning:
|
295
|
+
positioning: function positioning(imageModifiers) {
|
296
|
+
return imageModifiers === null || imageModifiers === void 0 ? void 0 : imageModifiers.length;
|
297
|
+
},
|
298
|
+
positioningBinding: 'portraitImageModifiers',
|
299
|
+
positioningOptions: function positioningOptions() {
|
300
|
+
var _this$model$get2, _this$model$get2$;
|
301
|
+
var aspectRatio = entry.getAspectRatio((_this$model$get2 = _this.model.get('portraitImageModifiers')) === null || _this$model$get2 === void 0 ? void 0 : (_this$model$get2$ = _this$model$get2[0]) === null || _this$model$get2$ === void 0 ? void 0 : _this$model$get2$.value);
|
302
|
+
return {
|
303
|
+
preview: aspectRatio && 1 / aspectRatio
|
304
|
+
};
|
305
|
+
}
|
306
|
+
});
|
307
|
+
this.input('portraitImageModifiers', ImageModifierListInputView, {
|
308
|
+
entry: entry,
|
309
|
+
visibleBinding: 'portraitId',
|
310
|
+
visible: function visible() {
|
311
|
+
return _this.model.getReference('portraitId', 'image_files');
|
312
|
+
}
|
239
313
|
});
|
240
314
|
this.input('enableFullscreen', CheckBoxInputView, {
|
241
315
|
disabledBinding: ['position', 'width'],
|
@@ -244,7 +318,14 @@ editor.contentElementTypes.register('inlineImage', {
|
|
244
318
|
},
|
245
319
|
displayUncheckedIfDisabled: true
|
246
320
|
});
|
247
|
-
this.group('ContentElementPosition'
|
321
|
+
this.group('ContentElementPosition', {
|
322
|
+
entry: entry
|
323
|
+
});
|
324
|
+
this.view(SeparatorView);
|
325
|
+
this.group('ContentElementCaption', {
|
326
|
+
entry: entry
|
327
|
+
});
|
328
|
+
this.group('ContentElementInlineFileRightsSettings');
|
248
329
|
});
|
249
330
|
}
|
250
331
|
});
|
@@ -309,22 +390,46 @@ function _slicedToArray(arr, i) {
|
|
309
390
|
|
310
391
|
var img$3 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3e%3c!--! Font Awesome Pro 6.1.1 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons%2c Inc. --%3e%3cpath fill='white' d='M463.1 32h-416C21.49 32-.0001 53.49-.0001 80v352c0 26.51 21.49 48 47.1 48h416c26.51 0 48-21.49 48-48v-352C511.1 53.49 490.5 32 463.1 32zM111.1 408c0 4.418-3.582 8-8 8H55.1c-4.418 0-8-3.582-8-8v-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8L111.1 408zM111.1 280c0 4.418-3.582 8-8 8H55.1c-4.418 0-8-3.582-8-8v-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8V280zM111.1 152c0 4.418-3.582 8-8 8H55.1c-4.418 0-8-3.582-8-8v-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8L111.1 152zM351.1 400c0 8.836-7.164 16-16 16H175.1c-8.836 0-16-7.164-16-16v-96c0-8.838 7.164-16 16-16h160c8.836 0 16 7.162 16 16V400zM351.1 208c0 8.836-7.164 16-16 16H175.1c-8.836 0-16-7.164-16-16v-96c0-8.838 7.164-16 16-16h160c8.836 0 16 7.162 16 16V208zM463.1 408c0 4.418-3.582 8-8 8h-47.1c-4.418 0-7.1-3.582-7.1-8l0-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8V408zM463.1 280c0 4.418-3.582 8-8 8h-47.1c-4.418 0-8-3.582-8-8v-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8V280zM463.1 152c0 4.418-3.582 8-8 8h-47.1c-4.418 0-8-3.582-8-8l0-48c0-4.418 3.582-8 7.1-8h47.1c4.418 0 8 3.582 8 8V152z'/%3e%3c/svg%3e";
|
311
392
|
|
393
|
+
var EditMotifAreaMenuItem = Backbone.Model.extend({
|
394
|
+
defaults: {
|
395
|
+
name: 'editMotifArea'
|
396
|
+
},
|
397
|
+
initialize: function initialize(attributes, _ref) {
|
398
|
+
var _this = this;
|
399
|
+
var inputModel = _ref.inputModel,
|
400
|
+
propertyName = _ref.propertyName,
|
401
|
+
file = _ref.file;
|
402
|
+
this.set('label', I18n.t('pageflow_scrolled.editor.edit_motif_area_menu_item'));
|
403
|
+
var update = function update() {
|
404
|
+
_this.set('hidden', inputModel.get('position') !== 'backdrop');
|
405
|
+
};
|
406
|
+
this.listenTo(inputModel, "change:position", update);
|
407
|
+
update();
|
408
|
+
this.selected = function () {
|
409
|
+
EditMotifAreaDialogView.show({
|
410
|
+
model: inputModel,
|
411
|
+
propertyName: propertyName,
|
412
|
+
file: file
|
413
|
+
});
|
414
|
+
};
|
415
|
+
}
|
416
|
+
});
|
312
417
|
editor.contentElementTypes.register('inlineVideo', {
|
313
418
|
pictogram: img$3,
|
314
419
|
category: 'media',
|
315
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
420
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right', 'backdrop'],
|
316
421
|
supportedWidthRange: ['xxs', 'full'],
|
317
|
-
configurationEditor: function configurationEditor() {
|
422
|
+
configurationEditor: function configurationEditor(_ref2) {
|
423
|
+
var entry = _ref2.entry;
|
318
424
|
migrateLegacyAutoplay(this.model);
|
319
425
|
this.tab('general', function () {
|
320
|
-
var
|
321
|
-
|
426
|
+
var _this2 = this;
|
322
427
|
this.input('id', FileInputView, {
|
323
428
|
collection: 'video_files',
|
324
429
|
fileSelectionHandler: 'contentElementConfiguration',
|
325
430
|
positioning: false,
|
326
431
|
defaultTextTrackFilePropertyName: 'defaultTextTrackFileId',
|
327
|
-
dropDownMenuItems: [InlineFileRightsMenuItem]
|
432
|
+
dropDownMenuItems: [EditMotifAreaMenuItem, InlineFileRightsMenuItem]
|
328
433
|
});
|
329
434
|
this.input('posterId', FileInputView, {
|
330
435
|
collection: 'image_files',
|
@@ -337,7 +442,7 @@ editor.contentElementTypes.register('inlineVideo', {
|
|
337
442
|
fileSelectionHandler: 'contentElementConfiguration',
|
338
443
|
positioning: false,
|
339
444
|
defaultTextTrackFilePropertyName: 'defaultTextTrackFileId',
|
340
|
-
dropDownMenuItems: [InlineFileRightsMenuItem]
|
445
|
+
dropDownMenuItems: [EditMotifAreaMenuItem, InlineFileRightsMenuItem]
|
341
446
|
});
|
342
447
|
this.input('portraitPosterId', FileInputView, {
|
343
448
|
collection: 'image_files',
|
@@ -345,7 +450,7 @@ editor.contentElementTypes.register('inlineVideo', {
|
|
345
450
|
positioning: false,
|
346
451
|
visibleBinding: 'portraitId',
|
347
452
|
visible: function visible() {
|
348
|
-
return
|
453
|
+
return _this2.model.getReference('portraitId', 'video_files');
|
349
454
|
},
|
350
455
|
dropDownMenuItems: [InlineFileRightsMenuItem]
|
351
456
|
});
|
@@ -353,7 +458,7 @@ editor.contentElementTypes.register('inlineVideo', {
|
|
353
458
|
this.input('playbackMode', SelectInputView, {
|
354
459
|
values: ['manual', 'autoplay', 'loop']
|
355
460
|
});
|
356
|
-
this.input('hideControlBar', CheckBoxInputView, {
|
461
|
+
this.input('hideControlBar', CheckBoxInputView$1, {
|
357
462
|
disabledBinding: 'playbackMode',
|
358
463
|
disabled: function disabled(playbackMode) {
|
359
464
|
return playbackMode === 'loop';
|
@@ -361,16 +466,15 @@ editor.contentElementTypes.register('inlineVideo', {
|
|
361
466
|
displayCheckedIfDisabled: true
|
362
467
|
});
|
363
468
|
this.input('unmuteLabel', LabelOnlyView);
|
364
|
-
this.input('unmute', CheckBoxInputView, {
|
469
|
+
this.input('unmute', CheckBoxInputView$1, {
|
365
470
|
storeInverted: 'keepMuted'
|
366
471
|
});
|
367
|
-
this.input('rewindOnUnmute', CheckBoxInputView, {
|
472
|
+
this.input('rewindOnUnmute', CheckBoxInputView$1, {
|
368
473
|
disabledBinding: ['playbackMode', 'keepMuted'],
|
369
|
-
disabled: function disabled(
|
370
|
-
var
|
371
|
-
|
372
|
-
|
373
|
-
|
474
|
+
disabled: function disabled(_ref3) {
|
475
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
476
|
+
playbackMode = _ref4[0],
|
477
|
+
keepMuted = _ref4[1];
|
374
478
|
return playbackMode !== 'autoplay' || keepMuted;
|
375
479
|
},
|
376
480
|
displayUncheckedIfDisabled: true
|
@@ -380,11 +484,17 @@ editor.contentElementTypes.register('inlineVideo', {
|
|
380
484
|
values: ['play', 'mute', 'turnDown']
|
381
485
|
});
|
382
486
|
this.view(SeparatorView);
|
383
|
-
this.group('ContentElementPosition'
|
487
|
+
this.group('ContentElementPosition', {
|
488
|
+
entry: entry
|
489
|
+
});
|
490
|
+
this.view(SeparatorView);
|
491
|
+
this.group('ContentElementCaption', {
|
492
|
+
entry: entry
|
493
|
+
});
|
494
|
+
this.group('ContentElementInlineFileRightsSettings');
|
384
495
|
});
|
385
496
|
}
|
386
497
|
});
|
387
|
-
|
388
498
|
function migrateLegacyAutoplay(model) {
|
389
499
|
if (!model.has('playbackMode') && model.get('autoplay')) {
|
390
500
|
model.set('playbackMode', 'autoplay', {
|
@@ -398,14 +508,16 @@ var img$4 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBo
|
|
398
508
|
editor.contentElementTypes.register('inlineAudio', {
|
399
509
|
pictogram: img$4,
|
400
510
|
category: 'media',
|
401
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
511
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
402
512
|
supportedWidthRange: ['xxs', 'full'],
|
403
513
|
defaultConfig: {
|
404
514
|
playerControlVariant: 'waveformBars'
|
405
515
|
},
|
406
516
|
configurationEditor: function configurationEditor(_ref) {
|
407
517
|
var entry = _ref.entry;
|
518
|
+
var themeOptions = entry.getTheme().get('options');
|
408
519
|
this.tab('general', function () {
|
520
|
+
var _themeOptions$propert, _themeOptions$propert2, _themeOptions$colors;
|
409
521
|
this.input('id', FileInputView, {
|
410
522
|
collection: 'audio_files',
|
411
523
|
fileSelectionHandler: 'contentElementConfiguration',
|
@@ -420,7 +532,7 @@ editor.contentElementTypes.register('inlineAudio', {
|
|
420
532
|
dropDownMenuItems: [InlineFileRightsMenuItem]
|
421
533
|
});
|
422
534
|
this.view(SeparatorView);
|
423
|
-
this.input('autoplay', CheckBoxInputView);
|
535
|
+
this.input('autoplay', CheckBoxInputView$1);
|
424
536
|
this.input('atmoDuringPlayback', SelectInputView, {
|
425
537
|
values: ['play', 'mute', 'turnDown']
|
426
538
|
});
|
@@ -434,10 +546,17 @@ editor.contentElementTypes.register('inlineAudio', {
|
|
434
546
|
visible: function visible(variant) {
|
435
547
|
return variant === null || variant === void 0 ? void 0 : variant.startsWith('waveform');
|
436
548
|
},
|
437
|
-
defaultValue:
|
549
|
+
defaultValue: ((_themeOptions$propert = themeOptions.properties) === null || _themeOptions$propert === void 0 ? void 0 : (_themeOptions$propert2 = _themeOptions$propert.root) === null || _themeOptions$propert2 === void 0 ? void 0 : _themeOptions$propert2.accent_color) || ((_themeOptions$colors = themeOptions.colors) === null || _themeOptions$colors === void 0 ? void 0 : _themeOptions$colors.accent)
|
438
550
|
});
|
439
551
|
this.view(SeparatorView);
|
440
|
-
this.group('ContentElementPosition'
|
552
|
+
this.group('ContentElementPosition', {
|
553
|
+
entry: entry
|
554
|
+
});
|
555
|
+
this.view(SeparatorView);
|
556
|
+
this.group('ContentElementCaption', {
|
557
|
+
entry: entry
|
558
|
+
});
|
559
|
+
this.group('ContentElementInlineFileRightsSettings');
|
441
560
|
});
|
442
561
|
}
|
443
562
|
});
|
@@ -447,9 +566,10 @@ var img$5 = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3
|
|
447
566
|
editor.contentElementTypes.register('videoEmbed', {
|
448
567
|
pictogram: img$5,
|
449
568
|
category: 'media',
|
450
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
569
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
451
570
|
supportedWidthRange: ['xxs', 'full'],
|
452
|
-
configurationEditor: function configurationEditor() {
|
571
|
+
configurationEditor: function configurationEditor(_ref) {
|
572
|
+
var entry = _ref.entry;
|
453
573
|
this.tab('general', function () {
|
454
574
|
this.input('videoSource', UrlInputView, {
|
455
575
|
supportedHosts: ['http://youtu.be', 'https://youtu.be', 'http://www.youtube.com', 'https://www.youtube.com', 'http://vimeo.com', 'https://vimeo.com', 'http://www.facebook.com', 'https://www.facebook.com'],
|
@@ -462,8 +582,8 @@ editor.contentElementTypes.register('videoEmbed', {
|
|
462
582
|
fileSelectionHandler: 'contentElementConfiguration',
|
463
583
|
positioning: false
|
464
584
|
});
|
465
|
-
this.input('hideInfo', CheckBoxInputView
|
466
|
-
this.input('hideControls', CheckBoxInputView
|
585
|
+
this.input('hideInfo', CheckBoxInputView);
|
586
|
+
this.input('hideControls', CheckBoxInputView);
|
467
587
|
this.input('aspectRatio', SelectInputView, {
|
468
588
|
values: ['wide', 'narrow', 'square', 'portrait']
|
469
589
|
});
|
@@ -472,7 +592,13 @@ editor.contentElementTypes.register('videoEmbed', {
|
|
472
592
|
values: ['play', 'mute', 'turnDown']
|
473
593
|
});
|
474
594
|
this.view(SeparatorView);
|
475
|
-
this.group('ContentElementPosition'
|
595
|
+
this.group('ContentElementPosition', {
|
596
|
+
entry: entry
|
597
|
+
});
|
598
|
+
this.view(SeparatorView);
|
599
|
+
this.group('ContentElementCaption', {
|
600
|
+
entry: entry
|
601
|
+
});
|
476
602
|
});
|
477
603
|
}
|
478
604
|
});
|
@@ -483,16 +609,26 @@ editor.contentElementTypes.register('soundDisclaimer', {
|
|
483
609
|
pictogram: img$6,
|
484
610
|
category: 'media',
|
485
611
|
supportedPositions: ['inline'],
|
486
|
-
configurationEditor: function configurationEditor() {
|
612
|
+
configurationEditor: function configurationEditor(_ref) {
|
613
|
+
var entry = _ref.entry;
|
487
614
|
this.tab('general', function () {
|
488
|
-
this.
|
615
|
+
this.input('mutedText', TextInputView, {
|
616
|
+
placeholder: I18n.t('pageflow_scrolled.public.sound_disclaimer.help_muted', {
|
617
|
+
locale: entry.metadata.get('locale')
|
618
|
+
})
|
619
|
+
});
|
620
|
+
this.input('unmutedText', TextInputView, {
|
621
|
+
placeholder: I18n.t('pageflow_scrolled.public.sound_disclaimer.help_unmuted', {
|
622
|
+
locale: entry.metadata.get('locale')
|
623
|
+
})
|
624
|
+
});
|
489
625
|
});
|
490
626
|
}
|
491
627
|
});
|
492
628
|
|
493
629
|
var DatawrapperAdView = Marionette.ItemView.extend({
|
494
630
|
template: function template(data) {
|
495
|
-
return "\n <form action=\"https://datawrapper.de/chart
|
631
|
+
return "\n <form action=\"https://app.datawrapper.de/create/chart\" method=\"GET\" target=\"_blank\">\n <input type=\"hidden\" name=\"theme\" value=\"pageflow\" />\n <input type=\"submit\" value=\"".concat(I18n.t('pageflow_scrolled.editor.content_elements.dataWrapperChart.attributes.create_chart.label'), "\" />\n </form>\n ");
|
496
632
|
},
|
497
633
|
className: 'datawrapper_ad'
|
498
634
|
});
|
@@ -502,9 +638,10 @@ var img$7 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBo
|
|
502
638
|
editor.contentElementTypes.register('dataWrapperChart', {
|
503
639
|
category: 'data',
|
504
640
|
pictogram: img$7,
|
505
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
641
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
506
642
|
supportedWidthRange: ['xxs', 'full'],
|
507
|
-
configurationEditor: function configurationEditor() {
|
643
|
+
configurationEditor: function configurationEditor(_ref) {
|
644
|
+
var entry = _ref.entry;
|
508
645
|
this.tab('general', function () {
|
509
646
|
this.input('url', UrlInputView, {
|
510
647
|
supportedHosts: ['cf.datawrapper.de', 'charts.datawrapper.de', 'datawrapper.dwcdn.de', 'datawrapper.dwcdn.net'],
|
@@ -519,7 +656,13 @@ editor.contentElementTypes.register('dataWrapperChart', {
|
|
519
656
|
this.input('backgroundColor', ColorInputView, {
|
520
657
|
defaultValue: '#323d4d'
|
521
658
|
});
|
522
|
-
this.group('ContentElementPosition'
|
659
|
+
this.group('ContentElementPosition', {
|
660
|
+
entry: entry
|
661
|
+
});
|
662
|
+
this.view(SeparatorView);
|
663
|
+
this.group('ContentElementCaption', {
|
664
|
+
entry: entry
|
665
|
+
});
|
523
666
|
});
|
524
667
|
}
|
525
668
|
});
|
@@ -529,9 +672,10 @@ var img$8 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBo
|
|
529
672
|
editor.contentElementTypes.register('inlineBeforeAfter', {
|
530
673
|
pictogram: img$8,
|
531
674
|
category: 'interactive',
|
532
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
675
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right', 'backdrop'],
|
533
676
|
supportedWidthRange: ['xxs', 'full'],
|
534
|
-
configurationEditor: function configurationEditor() {
|
677
|
+
configurationEditor: function configurationEditor(_ref) {
|
678
|
+
var entry = _ref.entry;
|
535
679
|
this.tab('general', function () {
|
536
680
|
this.input('before_id', FileInputView, {
|
537
681
|
collection: 'image_files',
|
@@ -549,7 +693,14 @@ editor.contentElementTypes.register('inlineBeforeAfter', {
|
|
549
693
|
this.input('after_label', TextInputView);
|
550
694
|
this.input('initial_slider_position', SliderInputView);
|
551
695
|
this.input('slider_color', ColorInputView$1);
|
552
|
-
this.group('ContentElementPosition'
|
696
|
+
this.group('ContentElementPosition', {
|
697
|
+
entry: entry
|
698
|
+
});
|
699
|
+
this.view(SeparatorView);
|
700
|
+
this.group('ContentElementCaption', {
|
701
|
+
entry: entry
|
702
|
+
});
|
703
|
+
this.group('ContentElementInlineFileRightsSettings');
|
553
704
|
});
|
554
705
|
},
|
555
706
|
defaultConfig: {
|
@@ -583,33 +734,41 @@ var SidebarEditLinkView = Marionette.Layout.extend({
|
|
583
734
|
tabTranslationKeyPrefix: 'pageflow_scrolled.editor.content_elements.externalLinkList.tabs'
|
584
735
|
});
|
585
736
|
var self = this;
|
737
|
+
var thumbnailAspectRatio = this.options.contentElement.configuration.get('thumbnailAspectRatio');
|
738
|
+
var previewAspectRatio = this.options.entry.getAspectRatio(thumbnailAspectRatio);
|
739
|
+
var thumbnailFit = this.options.contentElement.configuration.get('thumbnailFit');
|
586
740
|
configurationEditor.tab('edit_link', function () {
|
587
|
-
this.input('url', TextInputView, {
|
588
|
-
required: true
|
589
|
-
});
|
590
|
-
this.input('open_in_new_tab', CheckBoxInputView$1);
|
591
741
|
this.input('thumbnail', FileInputView, {
|
592
742
|
collection: 'image_files',
|
593
743
|
fileSelectionHandler: 'contentElement.externalLinks.link',
|
594
744
|
fileSelectionHandlerOptions: {
|
595
745
|
contentElementId: self.options.contentElement.get('id')
|
596
746
|
},
|
597
|
-
positioning:
|
747
|
+
positioning: previewAspectRatio && thumbnailFit !== 'contain',
|
748
|
+
positioningOptions: {
|
749
|
+
preview: previewAspectRatio && 1 / previewAspectRatio
|
750
|
+
},
|
751
|
+
dropDownMenuItems: [InlineFileRightsMenuItem]
|
598
752
|
});
|
599
|
-
this.input('
|
600
|
-
|
753
|
+
this.input('thumbnailBackgroundColor', ColorInputView);
|
754
|
+
this.view(SeparatorView);
|
755
|
+
this.view(InfoBoxView, {
|
756
|
+
text: I18n.t('pageflow_scrolled.editor.content_elements.textBlock.help_texts.shortcuts')
|
601
757
|
});
|
602
|
-
this.input('description', TextInputView);
|
603
758
|
});
|
604
759
|
this.formContainer.show(configurationEditor);
|
605
760
|
},
|
606
761
|
goBack: function goBack() {
|
762
|
+
this.options.contentElement.postCommand({
|
763
|
+
type: 'SET_SELECTED_ITEM',
|
764
|
+
index: -1
|
765
|
+
});
|
607
766
|
editor$1.navigate("/scrolled/content_elements/".concat(this.options.contentElement.get('id')), {
|
608
767
|
trigger: true
|
609
768
|
});
|
610
769
|
},
|
611
770
|
destroyLink: function destroyLink() {
|
612
|
-
if (window.confirm(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.
|
771
|
+
if (window.confirm(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.confirm_delete_item'))) {
|
613
772
|
this.options.collection.remove(this.model);
|
614
773
|
this.goBack();
|
615
774
|
}
|
@@ -637,11 +796,46 @@ var ExternalLinkModel = Backbone.Model.extend({
|
|
637
796
|
i18nKey: 'external_link',
|
638
797
|
mixins: [transientReferences],
|
639
798
|
thumbnailUrl: function thumbnailUrl() {
|
640
|
-
var
|
641
|
-
return
|
799
|
+
var _this$thumbnail;
|
800
|
+
return ((_this$thumbnail = this.thumbnail()) === null || _this$thumbnail === void 0 ? void 0 : _this$thumbnail.get('thumbnail_url')) || '';
|
801
|
+
},
|
802
|
+
thumbnail: function thumbnail() {
|
803
|
+
return this.collection.entry.getFileCollection('image_files').getByPermaId(this.get('thumbnail'));
|
642
804
|
},
|
643
805
|
title: function title() {
|
644
|
-
|
806
|
+
var configuration = this.collection.contentElement.configuration;
|
807
|
+
if (configuration.get('textPosition') === 'none') {
|
808
|
+
var _this$thumbnail2;
|
809
|
+
return (_this$thumbnail2 = this.thumbnail()) === null || _this$thumbnail2 === void 0 ? void 0 : _this$thumbnail2.configuration.get('alt');
|
810
|
+
} else {
|
811
|
+
var _itemTexts$this$id, _itemTexts$this$id2, _itemTexts$this$id2$t, _itemTexts$this$id2$t2, _itemTexts$this$id2$t3;
|
812
|
+
var itemTexts = configuration.get('itemTexts');
|
813
|
+
return (itemTexts === null || itemTexts === void 0 ? void 0 : (_itemTexts$this$id = itemTexts[this.id]) === null || _itemTexts$this$id === void 0 ? void 0 : _itemTexts$this$id.title) ? itemTexts === null || itemTexts === void 0 ? void 0 : (_itemTexts$this$id2 = itemTexts[this.id]) === null || _itemTexts$this$id2 === void 0 ? void 0 : (_itemTexts$this$id2$t = _itemTexts$this$id2.title[0]) === null || _itemTexts$this$id2$t === void 0 ? void 0 : (_itemTexts$this$id2$t2 = _itemTexts$this$id2$t.children) === null || _itemTexts$this$id2$t2 === void 0 ? void 0 : (_itemTexts$this$id2$t3 = _itemTexts$this$id2$t2[0]) === null || _itemTexts$this$id2$t3 === void 0 ? void 0 : _itemTexts$this$id2$t3.text : this.get('title');
|
814
|
+
}
|
815
|
+
},
|
816
|
+
getFilePosition: function getFilePosition(attribute, coord) {
|
817
|
+
var cropPosition = this.get('thumbnailCropPosition');
|
818
|
+
return cropPosition ? cropPosition[coord] : 50;
|
819
|
+
},
|
820
|
+
setFilePosition: function setFilePosition(attribute, coord, value) {
|
821
|
+
this.set('thumbnailCropPosition', _objectSpread2(_objectSpread2({}, this.get('thumbnailCropPosition')), {}, _defineProperty({}, coord, value)));
|
822
|
+
},
|
823
|
+
setFilePositions: function setFilePositions(attribute, x, y) {
|
824
|
+
this.set('thumbnailCropPosition', {
|
825
|
+
x: x,
|
826
|
+
y: y
|
827
|
+
});
|
828
|
+
},
|
829
|
+
highlight: function highlight() {
|
830
|
+
this.collection.contentElement.postCommand({
|
831
|
+
type: 'HIGHLIGHT_ITEM',
|
832
|
+
index: this.collection.indexOf(this)
|
833
|
+
});
|
834
|
+
},
|
835
|
+
resetHighlight: function resetHighlight() {
|
836
|
+
this.collection.contentElement.postCommand({
|
837
|
+
type: 'RESET_ITEM_HIGHLIGHT'
|
838
|
+
});
|
645
839
|
}
|
646
840
|
});
|
647
841
|
|
@@ -649,35 +843,45 @@ var ExternalLinkCollection = Backbone.Collection.extend({
|
|
649
843
|
model: ExternalLinkModel,
|
650
844
|
comparator: 'position',
|
651
845
|
initialize: function initialize(models, options) {
|
846
|
+
var _this = this;
|
652
847
|
this.entry = options.entry;
|
653
|
-
this.
|
654
|
-
this.listenTo(this, 'add
|
848
|
+
this.contentElement = options.contentElement;
|
849
|
+
this.listenTo(this, 'add sort change', this.updateConfiguration);
|
850
|
+
this.listenTo(this, 'remove', function () {
|
851
|
+
return _this.updateConfiguration({
|
852
|
+
prune: true
|
853
|
+
});
|
854
|
+
});
|
655
855
|
},
|
656
856
|
modelId: function modelId(attrs) {
|
657
857
|
return attrs.id;
|
658
858
|
},
|
659
|
-
updateConfiguration: function updateConfiguration() {
|
660
|
-
|
859
|
+
updateConfiguration: function updateConfiguration(_ref) {
|
860
|
+
var prune = _ref.prune;
|
861
|
+
var updatedAttributes = {
|
862
|
+
links: this.toJSON()
|
863
|
+
};
|
864
|
+
if (prune) {
|
865
|
+
updatedAttributes = _objectSpread2(_objectSpread2(_objectSpread2({}, updatedAttributes), this.getPrunedProperty('itemTexts')), this.getPrunedProperty('itemLinks'));
|
866
|
+
}
|
867
|
+
this.contentElement.configuration.set(updatedAttributes);
|
868
|
+
},
|
869
|
+
getPrunedProperty: function getPrunedProperty(propertyName) {
|
870
|
+
return _defineProperty({}, propertyName, _.pick.apply(_, [this.contentElement.configuration.get(propertyName) || {}].concat(_toConsumableArray(this.pluck('id')))));
|
661
871
|
},
|
662
872
|
addNewLink: function addNewLink() {
|
663
873
|
var id = this.length ? Math.max.apply(Math, _toConsumableArray(this.pluck('id'))) + 1 : 1;
|
664
874
|
this.add({
|
665
|
-
id: id
|
666
|
-
title: '',
|
667
|
-
url: '',
|
668
|
-
thumbnail: '',
|
669
|
-
description: '',
|
670
|
-
open_in_new_tab: 1
|
875
|
+
id: id
|
671
876
|
});
|
672
877
|
return this.get(id);
|
673
878
|
},
|
674
879
|
saveOrder: function saveOrder() {}
|
675
880
|
});
|
676
|
-
|
677
881
|
ExternalLinkCollection.forContentElement = function (contentElement, entry) {
|
678
882
|
return new ExternalLinkCollection(contentElement.configuration.get('links') || [], {
|
679
883
|
entry: entry,
|
680
|
-
|
884
|
+
contentElement: contentElement
|
681
885
|
});
|
682
886
|
};
|
683
887
|
|
@@ -692,6 +896,7 @@ var SidebarController = Marionette.Controller.extend({
|
|
692
896
|
this.region.show(new SidebarEditLinkView({
|
693
897
|
model: linksCollection.get(linkId),
|
694
898
|
collection: linksCollection,
|
899
|
+
entry: this.entry,
|
695
900
|
contentElement: contentElement
|
696
901
|
}));
|
697
902
|
}
|
@@ -730,181 +935,1742 @@ styleInject(css);
|
|
730
935
|
|
731
936
|
var SidebarListView = Marionette.Layout.extend({
|
732
937
|
template: function template(data) {
|
733
|
-
return "\n <label>
|
938
|
+
return "\n <label>".concat(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.items'), "</label>\n <div class='").concat(styles.linksContainer, "'></div>\n <button class=\"").concat(buttonStyles.addButton, "\">\n ").concat(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.add'), "\n </button>\n ");
|
734
939
|
},
|
735
940
|
regions: cssModulesUtils.ui(styles, 'linksContainer'),
|
736
941
|
events: cssModulesUtils.events(buttonStyles, {
|
737
942
|
'click addButton': 'addElement'
|
738
943
|
}),
|
739
944
|
onRender: function onRender() {
|
945
|
+
this.listenTo(this.options.contentElement.configuration, 'change:textPosition', this.renderListView);
|
946
|
+
this.renderListView();
|
947
|
+
},
|
948
|
+
renderListView: function renderListView() {
|
740
949
|
this.linksContainer.show(new ListView({
|
741
950
|
collection: this.collection,
|
742
951
|
sortable: true,
|
952
|
+
highlight: true,
|
743
953
|
onEdit: _.bind(this.onEdit, this),
|
744
954
|
onRemove: _.bind(this.onRemove, this)
|
745
955
|
}));
|
746
956
|
},
|
747
957
|
addElement: function addElement() {
|
748
|
-
|
749
|
-
this.onEdit(newModel);
|
958
|
+
this.collection.addNewLink();
|
750
959
|
},
|
751
960
|
onEdit: function onEdit(linkModel) {
|
961
|
+
this.options.contentElement.postCommand({
|
962
|
+
type: 'SET_SELECTED_ITEM',
|
963
|
+
index: this.collection.indexOf(linkModel)
|
964
|
+
});
|
752
965
|
editor.navigate("/scrolled/external_links/".concat(this.options.contentElement.id, "/").concat(linkModel.id), {
|
753
966
|
trigger: true
|
754
967
|
});
|
755
968
|
},
|
756
969
|
onRemove: function onRemove(linkModel) {
|
757
|
-
if (window.confirm(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.
|
970
|
+
if (window.confirm(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.confirm_delete_item'))) {
|
758
971
|
this.collection.remove(linkModel);
|
759
972
|
}
|
760
973
|
}
|
761
974
|
});
|
762
975
|
|
976
|
+
var linkWidths = {
|
977
|
+
xs: -2,
|
978
|
+
sm: -1,
|
979
|
+
md: 0,
|
980
|
+
lg: 1,
|
981
|
+
xl: 2,
|
982
|
+
xxl: 3
|
983
|
+
};
|
984
|
+
function maxLinkWidth(_ref) {
|
985
|
+
var layout = _ref.layout,
|
986
|
+
textPosition = _ref.textPosition,
|
987
|
+
width = _ref.width;
|
988
|
+
if (layout === 'center' || layout === 'centerRagged') {
|
989
|
+
if (textPosition === 'right') {
|
990
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, contentElementWidths.md, linkWidths.md), contentElementWidths.lg, linkWidths.lg), contentElementWidths.xl, linkWidths.xl), contentElementWidths.full, linkWidths.xl)[width];
|
991
|
+
} else {
|
992
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, contentElementWidths.md, linkWidths.lg), contentElementWidths.lg, linkWidths.xl), contentElementWidths.xl, linkWidths.xxl), contentElementWidths.full, linkWidths.xxl)[width];
|
993
|
+
}
|
994
|
+
} else {
|
995
|
+
if (textPosition === 'right') {
|
996
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, contentElementWidths.md, linkWidths.sm), contentElementWidths.lg, linkWidths.md), contentElementWidths.xl, linkWidths.xl), contentElementWidths.full, linkWidths.xl)[width];
|
997
|
+
} else {
|
998
|
+
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, contentElementWidths.md, linkWidths.lg), contentElementWidths.lg, linkWidths.lg), contentElementWidths.xl, linkWidths.xxl), contentElementWidths.full, linkWidths.xxl)[width];
|
999
|
+
}
|
1000
|
+
}
|
1001
|
+
}
|
1002
|
+
|
763
1003
|
var img$9 = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3e%3c!--! Font Awesome Pro 6.1.1 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons%2c Inc. --%3e%3cpath fill='white' d='M384 32H64C28.65 32 0 60.66 0 96v320c0 35.34 28.65 64 64 64h320c35.35 0 64-28.66 64-64V96C448 60.66 419.3 32 384 32zM344 312c0 17.69-14.31 32-32 32s-32-14.31-32-32V245.3l-121.4 121.4C152.4 372.9 144.2 376 136 376s-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L234.8 200H168c-17.69 0-32-14.31-32-32s14.31-32 32-32h144c17.69 0 32 14.31 32 32V312z'/%3e%3c/svg%3e";
|
764
1004
|
|
1005
|
+
//register sidebar router to handle multiple sidebar views of this content element
|
765
1006
|
//router defines the URL hash path mapping and controller provides functions for the paths
|
766
|
-
|
767
1007
|
editor.registerSideBarRouting({
|
768
1008
|
router: SidebarRouter,
|
769
1009
|
controller: SidebarController
|
770
|
-
});
|
1010
|
+
});
|
771
1011
|
|
1012
|
+
// register external link list content element configuration editor for sidebar
|
772
1013
|
editor.contentElementTypes.register('externalLinkList', {
|
773
1014
|
pictogram: img$9,
|
774
|
-
category: '
|
775
|
-
supportedPositions: ['inline'],
|
1015
|
+
category: 'tilesAndLinks',
|
1016
|
+
supportedPositions: ['inline', 'standAlone'],
|
1017
|
+
supportedWidthRange: ['m', 'full'],
|
1018
|
+
defaultConfig: {
|
1019
|
+
thumbnailAspectRatio: 'square'
|
1020
|
+
},
|
1021
|
+
editorPath: function editorPath(contentElement) {
|
1022
|
+
var selectedItemId = contentElement.transientState.get('selectedItemId');
|
1023
|
+
if (selectedItemId) {
|
1024
|
+
return "/scrolled/external_links/".concat(contentElement.id, "/").concat(selectedItemId);
|
1025
|
+
}
|
1026
|
+
},
|
776
1027
|
configurationEditor: function configurationEditor(_ref) {
|
777
|
-
var entry = _ref.entry
|
1028
|
+
var entry = _ref.entry,
|
1029
|
+
contentElement = _ref.contentElement;
|
778
1030
|
this.tab('general', function () {
|
779
|
-
|
780
|
-
entry: entry
|
781
|
-
});
|
1031
|
+
var layout = contentElement.section.configuration.get('layout');
|
782
1032
|
this.view(SidebarListView, {
|
783
1033
|
contentElement: this.model.parent,
|
784
1034
|
collection: ExternalLinkCollection.forContentElement(this.model.parent, entry)
|
785
1035
|
});
|
1036
|
+
this.input('textPosition', SelectInputView, {
|
1037
|
+
values: ['below', 'right', 'overlay', 'none']
|
1038
|
+
});
|
1039
|
+
this.group('ContentElementVariant', {
|
1040
|
+
entry: entry
|
1041
|
+
});
|
1042
|
+
this.input('overlayOpacity', SliderInputView, {
|
1043
|
+
defaultValue: 70,
|
1044
|
+
visibleBinding: 'textPosition',
|
1045
|
+
visibleBindingValue: 'overlay'
|
1046
|
+
});
|
1047
|
+
this.view(SeparatorView);
|
1048
|
+
this.group('ContentElementPosition', {
|
1049
|
+
entry: entry
|
1050
|
+
});
|
1051
|
+
this.view(SeparatorView);
|
1052
|
+
this.input('enableScroller', SelectInputView, {
|
1053
|
+
values: ['never', 'always']
|
1054
|
+
});
|
1055
|
+
this.input('linkWidth', SliderInputView, {
|
1056
|
+
displayText: function displayText(value) {
|
1057
|
+
return ['XS', 'S', 'M', 'L', 'XL', 'XXL'][value + 2];
|
1058
|
+
},
|
1059
|
+
saveOnSlide: true,
|
1060
|
+
minValue: -2,
|
1061
|
+
maxValueBinding: ['width', 'textPosition'],
|
1062
|
+
maxValue: function maxValue(_ref2) {
|
1063
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
1064
|
+
width = _ref3[0],
|
1065
|
+
textPosition = _ref3[1];
|
1066
|
+
return maxLinkWidth({
|
1067
|
+
width: width,
|
1068
|
+
layout: layout,
|
1069
|
+
textPosition: textPosition
|
1070
|
+
});
|
1071
|
+
},
|
1072
|
+
defaultValue: -1
|
1073
|
+
});
|
1074
|
+
this.input('linkAlignment', SelectInputView, {
|
1075
|
+
values: ['spaceEvenly', 'left', 'right', 'center'],
|
1076
|
+
visibleBinding: ['textPosition', 'enableScroller'],
|
1077
|
+
visible: function visible(_ref4) {
|
1078
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
1079
|
+
textPosition = _ref5[0],
|
1080
|
+
enableScroller = _ref5[1];
|
1081
|
+
return textPosition !== 'right' && enableScroller !== 'always';
|
1082
|
+
}
|
1083
|
+
});
|
1084
|
+
this.input('linkAlignment', SelectInputView, {
|
1085
|
+
values: ['left'],
|
1086
|
+
disabled: true,
|
1087
|
+
visibleBinding: ['textPosition', 'enableScroller'],
|
1088
|
+
visible: function visible(_ref6) {
|
1089
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
1090
|
+
textPosition = _ref7[0],
|
1091
|
+
enableScroller = _ref7[1];
|
1092
|
+
return textPosition !== 'right' && enableScroller === 'always';
|
1093
|
+
}
|
1094
|
+
});
|
1095
|
+
this.input('thumbnailSize', SelectInputView, {
|
1096
|
+
values: ['small', 'medium', 'large'],
|
1097
|
+
visibleBinding: 'textPosition',
|
1098
|
+
visibleBindingValue: 'right'
|
1099
|
+
});
|
1100
|
+
var _entry$getAspectRatio = entry.getAspectRatios({
|
1101
|
+
includeOriginal: true
|
1102
|
+
}),
|
1103
|
+
_entry$getAspectRatio2 = _slicedToArray(_entry$getAspectRatio, 2),
|
1104
|
+
aspectRatios = _entry$getAspectRatio2[0],
|
1105
|
+
aspectRatiosTexts = _entry$getAspectRatio2[1];
|
1106
|
+
this.input('thumbnailAspectRatio', SelectInputView, {
|
1107
|
+
values: aspectRatios,
|
1108
|
+
texts: aspectRatiosTexts
|
1109
|
+
});
|
1110
|
+
this.input('thumbnailFit', SelectInputView, {
|
1111
|
+
values: ['cover', 'contain']
|
1112
|
+
});
|
1113
|
+
this.input('textSize', SelectInputView, {
|
1114
|
+
values: ['small', 'medium', 'large']
|
1115
|
+
});
|
1116
|
+
this.input('textAlign', SelectInputView, {
|
1117
|
+
values: ['left', 'right', 'center']
|
1118
|
+
});
|
1119
|
+
this.input('displayButtons', CheckBoxInputView);
|
1120
|
+
this.group('ContentElementInlineFileRightsSettings');
|
786
1121
|
});
|
787
1122
|
}
|
788
|
-
});
|
1123
|
+
});
|
789
1124
|
|
1125
|
+
// register file handler for thumbnail of external link
|
790
1126
|
editor.registerFileSelectionHandler('contentElement.externalLinks.link', function (options) {
|
791
1127
|
var contentElement = options.entry.contentElements.get(options.contentElementId);
|
792
1128
|
var links = ExternalLinkCollection.forContentElement(contentElement, options.entry);
|
793
|
-
|
794
1129
|
this.call = function (file) {
|
795
1130
|
var link = links.get(options.id);
|
796
1131
|
link.setReference('thumbnail', file);
|
797
1132
|
};
|
798
|
-
|
799
1133
|
this.getReferer = function () {
|
800
1134
|
return '/scrolled/external_links/' + contentElement.id + '/' + options.id;
|
801
1135
|
};
|
802
1136
|
});
|
803
1137
|
|
804
|
-
var
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
1138
|
+
var SET_MODE = 'SET_MODE';
|
1139
|
+
var DRAG = 'DRAG';
|
1140
|
+
var CLICK_HANDLE = 'CLICK_HANDLE';
|
1141
|
+
var DRAG_HANDLE = 'DRAG_HANDLE';
|
1142
|
+
var DRAG_HANDLE_STOP = 'DRAG_HANDLE_STOP';
|
1143
|
+
var DOUBLE_CLICK_HANDLE = 'DOUBLE_CLICK_HANDLE';
|
1144
|
+
var MOUSE_MOVE = 'MOUSE_MOVE';
|
1145
|
+
var DRAG_POTENTIAL_POINT = 'DRAG_POTENTIAL_POINT';
|
1146
|
+
var DRAG_POTENTIAL_POINT_STOP = 'DRAG_POTENTIAL_POINT_STOP';
|
1147
|
+
var CLICK_INDICATOR = 'CLICK_INDICATOR';
|
1148
|
+
var DRAG_INDICATOR = 'DRAG_INDICATOR';
|
1149
|
+
var CENTER_INDICATOR = 'CENTER_INDICATOR';
|
1150
|
+
var UPDATE_SELECTION_POSITION = 'UPDATE_SELECTION_POSITION';
|
1151
|
+
var BLUR_SELECTION_POSITION = 'BLUR_SELECTION_POSITION';
|
1152
|
+
function reducer(state, action) {
|
1153
|
+
var _state$selection, _state$selection2, _state$selection3;
|
1154
|
+
switch (action.type) {
|
1155
|
+
case SET_MODE:
|
1156
|
+
if (action.value === state.mode) {
|
1157
|
+
return state;
|
1158
|
+
} else if (action.value === 'rect') {
|
1159
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1160
|
+
mode: 'rect',
|
1161
|
+
previousPolygonPoints: state.points,
|
1162
|
+
points: getBoundingBox(state.points),
|
1163
|
+
selection: null
|
1164
|
+
});
|
1165
|
+
} else {
|
1166
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1167
|
+
mode: 'polygon',
|
1168
|
+
points: state.previousPolygonPoints || state.points,
|
1169
|
+
selection: null
|
1170
|
+
});
|
1171
|
+
}
|
1172
|
+
case DRAG:
|
1173
|
+
var _action$delta = _slicedToArray(action.delta, 2),
|
1174
|
+
deltaX = _action$delta[0],
|
1175
|
+
deltaY = _action$delta[1];
|
1176
|
+
state.points.forEach(function (point) {
|
1177
|
+
if (point[0] + deltaX > 100) {
|
1178
|
+
deltaX = 100 - point[0];
|
1179
|
+
}
|
1180
|
+
if (point[0] + deltaX < 0) {
|
1181
|
+
deltaX = -point[0];
|
1182
|
+
}
|
1183
|
+
if (point[1] + deltaY > 100) {
|
1184
|
+
deltaY = 100 - point[1];
|
1185
|
+
}
|
1186
|
+
if (point[1] + deltaY < 0) {
|
1187
|
+
deltaY = -point[1];
|
1188
|
+
}
|
819
1189
|
});
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
1190
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1191
|
+
points: state.points.map(function (point) {
|
1192
|
+
return [point[0] + deltaX, point[1] + deltaY];
|
1193
|
+
}),
|
1194
|
+
indicatorPosition: [state.indicatorPosition[0] + deltaX, state.indicatorPosition[1] + deltaY]
|
1195
|
+
});
|
1196
|
+
case CLICK_HANDLE:
|
1197
|
+
if (state.mode === 'polygon') {
|
1198
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1199
|
+
selection: {
|
1200
|
+
type: 'handle',
|
1201
|
+
index: action.index,
|
1202
|
+
position: round(state.points[action.index])
|
1203
|
+
}
|
1204
|
+
});
|
1205
|
+
} else {
|
1206
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1207
|
+
selection: rectHandleSelection(action.index, state.points)
|
1208
|
+
});
|
1209
|
+
}
|
1210
|
+
case DRAG_HANDLE:
|
1211
|
+
state = updatePoints(state, action.index, action.cursor);
|
1212
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1213
|
+
indicatorPosition: ensureInPolygon(state.points, state.indicatorPosition)
|
1214
|
+
});
|
1215
|
+
case DRAG_HANDLE_STOP:
|
1216
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1217
|
+
startPoints: null
|
1218
|
+
});
|
1219
|
+
case DOUBLE_CLICK_HANDLE:
|
1220
|
+
if (state.mode !== 'polygon' || state.points.length <= 3) {
|
1221
|
+
return state;
|
1222
|
+
}
|
1223
|
+
var points = [].concat(_toConsumableArray(state.points.slice(0, action.index)), _toConsumableArray(state.points.slice(action.index + 1)));
|
1224
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1225
|
+
points: points,
|
1226
|
+
potentialPoint: null,
|
1227
|
+
indicatorPosition: ensureInPolygon(points, state.indicatorPosition),
|
1228
|
+
selection: null
|
1229
|
+
});
|
1230
|
+
case MOUSE_MOVE:
|
1231
|
+
if (state.mode !== 'polygon' || state.draggingPotentialPoint) {
|
1232
|
+
return state;
|
1233
|
+
}
|
1234
|
+
var _closestPointOnPolygo = closestPointOnPolygon(state.points, action.cursor),
|
1235
|
+
_closestPointOnPolygo2 = _slicedToArray(_closestPointOnPolygo, 2),
|
1236
|
+
index = _closestPointOnPolygo2[0],
|
1237
|
+
potentialPoint = _closestPointOnPolygo2[1];
|
1238
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1239
|
+
potentialPointInsertIndex: index,
|
1240
|
+
potentialPoint: potentialPoint
|
1241
|
+
});
|
1242
|
+
case DRAG_POTENTIAL_POINT:
|
1243
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1244
|
+
draggingPotentialPoint: true,
|
1245
|
+
potentialPoint: action.cursor,
|
1246
|
+
selection: {
|
1247
|
+
type: 'potentialPoint',
|
1248
|
+
position: round(action.cursor)
|
1249
|
+
}
|
824
1250
|
});
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
1251
|
+
case DRAG_POTENTIAL_POINT_STOP:
|
1252
|
+
var newPoints = withPotentialPoint(state);
|
1253
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1254
|
+
points: newPoints,
|
1255
|
+
draggingPotentialPoint: false,
|
1256
|
+
potentialPoint: null,
|
1257
|
+
selection: {
|
1258
|
+
type: 'handle',
|
1259
|
+
index: state.potentialPointInsertIndex,
|
1260
|
+
position: round(newPoints[state.potentialPointInsertIndex])
|
1261
|
+
}
|
1262
|
+
});
|
1263
|
+
case CLICK_INDICATOR:
|
1264
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1265
|
+
selection: {
|
1266
|
+
type: 'indicator',
|
1267
|
+
position: round(state.indicatorPosition)
|
1268
|
+
}
|
1269
|
+
});
|
1270
|
+
case DRAG_INDICATOR:
|
1271
|
+
var indicatorPosition = ensureInPolygon(state.points, action.cursor);
|
1272
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1273
|
+
indicatorPosition: indicatorPosition,
|
1274
|
+
selection: {
|
1275
|
+
type: 'indicator',
|
1276
|
+
position: round(indicatorPosition)
|
1277
|
+
}
|
829
1278
|
});
|
830
|
-
|
1279
|
+
case CENTER_INDICATOR:
|
1280
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1281
|
+
indicatorPosition: polygonCentroid(state.points)
|
1282
|
+
});
|
1283
|
+
case UPDATE_SELECTION_POSITION:
|
1284
|
+
if (((_state$selection = state.selection) === null || _state$selection === void 0 ? void 0 : _state$selection.type) === 'indicator') {
|
1285
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1286
|
+
indicatorPosition: ensureInPolygon(state.points, action.position),
|
1287
|
+
selection: _objectSpread2(_objectSpread2({}, state.selection), {}, {
|
1288
|
+
position: action.position
|
1289
|
+
})
|
1290
|
+
});
|
1291
|
+
} else if (((_state$selection2 = state.selection) === null || _state$selection2 === void 0 ? void 0 : _state$selection2.type) === 'handle') {
|
1292
|
+
return updatePoints(state, state.selection.index, ensureInBounds(action.position), action.position);
|
1293
|
+
} else {
|
1294
|
+
return state;
|
1295
|
+
}
|
1296
|
+
case BLUR_SELECTION_POSITION:
|
1297
|
+
if (((_state$selection3 = state.selection) === null || _state$selection3 === void 0 ? void 0 : _state$selection3.type) === 'indicator') {
|
1298
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1299
|
+
selection: _objectSpread2(_objectSpread2({}, state.selection), {}, {
|
1300
|
+
position: state.indicatorPosition
|
1301
|
+
})
|
1302
|
+
});
|
1303
|
+
} else if (state.selection) {
|
1304
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1305
|
+
startPoints: null,
|
1306
|
+
selection: _objectSpread2(_objectSpread2({}, state.selection), {}, {
|
1307
|
+
position: handles(state)[state.selection.index].point
|
1308
|
+
}),
|
1309
|
+
indicatorPosition: ensureInPolygon(state.points, state.indicatorPosition)
|
1310
|
+
});
|
1311
|
+
} else {
|
1312
|
+
return state;
|
1313
|
+
}
|
1314
|
+
default:
|
1315
|
+
throw new Error("Unknown action ".concat(action.type, "."));
|
1316
|
+
}
|
1317
|
+
}
|
1318
|
+
function drawnOutlinePoints(state) {
|
1319
|
+
if (state.draggingPotentialPoint) {
|
1320
|
+
return withPotentialPoint(state);
|
1321
|
+
} else {
|
1322
|
+
return state.points;
|
1323
|
+
}
|
1324
|
+
}
|
1325
|
+
var rectCursors = ['nwse-resize', 'ns-resize', 'nesw-resize', 'ew-resize'];
|
1326
|
+
function handles(state) {
|
1327
|
+
if (state.mode === 'rect') {
|
1328
|
+
return state.points.flatMap(function (point, index) {
|
1329
|
+
return [point, midpoint(point, state.points[(index + 1) % state.points.length])];
|
1330
|
+
}).map(function (point, index) {
|
1331
|
+
return {
|
1332
|
+
point: point,
|
1333
|
+
axis: index % 4 === 1 ? 'y' : index % 4 === 3 ? 'x' : null,
|
1334
|
+
cursor: rectCursors[index % 4],
|
1335
|
+
deletable: false
|
1336
|
+
};
|
1337
|
+
});
|
1338
|
+
} else {
|
1339
|
+
return state.points.map(function (point) {
|
1340
|
+
return {
|
1341
|
+
point: point,
|
1342
|
+
circle: true,
|
1343
|
+
cursor: 'move',
|
1344
|
+
deletable: state.points.length > 3
|
1345
|
+
};
|
831
1346
|
});
|
832
1347
|
}
|
833
|
-
}
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
values: values
|
1348
|
+
}
|
1349
|
+
function updatePoints(state, index, position, selectionPosition) {
|
1350
|
+
if (state.mode === 'polygon') {
|
1351
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1352
|
+
points: [].concat(_toConsumableArray(state.points.slice(0, index)), [position], _toConsumableArray(state.points.slice(index + 1))),
|
1353
|
+
selection: {
|
1354
|
+
type: 'handle',
|
1355
|
+
index: index,
|
1356
|
+
position: selectionPosition || round(position)
|
843
1357
|
}
|
844
|
-
}
|
845
|
-
}
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
}
|
855
|
-
}
|
856
|
-
}
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
1358
|
+
});
|
1359
|
+
} else {
|
1360
|
+
var startPoints = state.startPoints || (rectHandleAxis(index) === 'both' ? [state.points[(index / 2 + 2) % 4]] : [state.points[(index + 3) / 2 % 4], state.points[(index + 5) / 2 % 4]]);
|
1361
|
+
position = constrainToAxis(index, position, state.points);
|
1362
|
+
var points = getBoundingBox([position].concat(_toConsumableArray(startPoints)));
|
1363
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
1364
|
+
startPoints: startPoints,
|
1365
|
+
previousPolygonPoints: null,
|
1366
|
+
points: points,
|
1367
|
+
selection: rectHandleSelection(mapIndexOfRectHandleCrossingOver(index, position, startPoints), points, selectionPosition)
|
1368
|
+
});
|
1369
|
+
}
|
1370
|
+
}
|
1371
|
+
function rectHandleSelection(index, points, selectionPosition) {
|
1372
|
+
return {
|
1373
|
+
type: 'handle',
|
1374
|
+
index: index,
|
1375
|
+
axis: rectHandleAxis(index),
|
1376
|
+
position: selectionPosition || round(index % 2 === 0 ? points[index / 2] : midpoint(points[(index - 1) / 2], points[(index + 1) / 2 % 4]))
|
1377
|
+
};
|
1378
|
+
}
|
1379
|
+
function constrainToAxis(index, cursor, points) {
|
1380
|
+
var axis = rectHandleAxis(index);
|
1381
|
+
if (axis === 'x') {
|
1382
|
+
return [cursor[0], points[(index - 1) / 2][1]];
|
1383
|
+
} else if (axis === 'y') {
|
1384
|
+
return [points[(index - 1) / 2][0], cursor[1]];
|
1385
|
+
} else {
|
1386
|
+
return cursor;
|
1387
|
+
}
|
1388
|
+
}
|
1389
|
+
function rectHandleAxis(index) {
|
1390
|
+
return index % 2 === 0 ? 'both' : (index - 1) / 2 % 2 === 0 ? 'y' : 'x';
|
1391
|
+
}
|
1392
|
+
function mapIndexOfRectHandleCrossingOver(index, position, startPoints) {
|
1393
|
+
if (index >= 0 && index <= 3 && position[1] > startPoints[0][1] || index >= 4 && index <= 6 && position[1] < startPoints[0][1]) {
|
1394
|
+
index = 6 - index;
|
1395
|
+
}
|
1396
|
+
if ((index === 0 || index >= 6) && position[0] > startPoints[0][0] || index >= 2 && index <= 4 && position[0] < startPoints[0][0]) {
|
1397
|
+
index = (10 - index) % 8;
|
1398
|
+
}
|
1399
|
+
return index;
|
1400
|
+
}
|
1401
|
+
function withPotentialPoint(state) {
|
1402
|
+
return [].concat(_toConsumableArray(state.points.slice(0, state.potentialPointInsertIndex)), [state.potentialPoint], _toConsumableArray(state.points.slice(state.potentialPointInsertIndex)));
|
1403
|
+
}
|
1404
|
+
function midpoint(p1, p2) {
|
1405
|
+
return [(p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2];
|
1406
|
+
}
|
1407
|
+
function getBoundingBox(polygon) {
|
1408
|
+
if (polygon.length === 0) {
|
1409
|
+
return null;
|
1410
|
+
}
|
1411
|
+
var minX = polygon[0][0];
|
1412
|
+
var minY = polygon[0][1];
|
1413
|
+
var maxX = polygon[0][0];
|
1414
|
+
var maxY = polygon[0][1];
|
1415
|
+
for (var i = 1; i < polygon.length; i++) {
|
1416
|
+
var _polygon$i = _slicedToArray(polygon[i], 2),
|
1417
|
+
x = _polygon$i[0],
|
1418
|
+
y = _polygon$i[1];
|
1419
|
+
if (x < minX) minX = x;
|
1420
|
+
if (x > maxX) maxX = x;
|
1421
|
+
if (y < minY) minY = y;
|
1422
|
+
if (y > maxY) maxY = y;
|
1423
|
+
}
|
1424
|
+
return [[minX, minY], [maxX, minY], [maxX, maxY], [minX, maxY]];
|
1425
|
+
}
|
1426
|
+
function ensureInBounds(point) {
|
1427
|
+
return point.map(function (coord) {
|
1428
|
+
return Math.min(100, Math.max(0, coord));
|
1429
|
+
});
|
1430
|
+
}
|
1431
|
+
function ensureInPolygon(polygon, point) {
|
1432
|
+
return isPointInPolygon(polygon, point) ? point : closestPointOnPolygon(polygon, point)[1];
|
1433
|
+
}
|
1434
|
+
function isPointInPolygon(polygon, point) {
|
1435
|
+
var x = point[0],
|
1436
|
+
y = point[1];
|
1437
|
+
var inside = false;
|
1438
|
+
for (var i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
1439
|
+
var xi = polygon[i][0],
|
1440
|
+
yi = polygon[i][1];
|
1441
|
+
var xj = polygon[j][0],
|
1442
|
+
yj = polygon[j][1];
|
1443
|
+
var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
1444
|
+
if (intersect) inside = !inside;
|
1445
|
+
}
|
1446
|
+
return inside;
|
1447
|
+
}
|
1448
|
+
function closestPointOnPolygon(polygon, c) {
|
1449
|
+
function distance(p1, p2) {
|
1450
|
+
return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2));
|
1451
|
+
}
|
1452
|
+
function closestPoint(A, B, C) {
|
1453
|
+
var AB = [B[0] - A[0], B[1] - A[1]];
|
1454
|
+
var AC = [C[0] - A[0], C[1] - A[1]];
|
1455
|
+
var abLength = AB[0] * AB[0] + AB[1] * AB[1]; // Dot product of AB with itself
|
1456
|
+
|
1457
|
+
if (abLength === 0) return A; // A and B are the same points
|
1458
|
+
|
1459
|
+
var proj = (AC[0] * AB[0] + AC[1] * AB[1]) / abLength; // Projection ratio of AC on AB
|
1460
|
+
|
1461
|
+
if (proj < 0) return A; // Closer to A
|
1462
|
+
else if (proj > 1) return B; // Closer to B
|
1463
|
+
else return [A[0] + proj * AB[0], A[1] + proj * AB[1]]; // Point on the segment
|
1464
|
+
}
|
1465
|
+
var closest = null;
|
1466
|
+
var minDistance = Infinity;
|
1467
|
+
for (var i = 0; i < polygon.length; i++) {
|
1468
|
+
var A = polygon[i];
|
1469
|
+
var B = polygon[(i + 1) % polygon.length];
|
1470
|
+
var point = closestPoint(A, B, c);
|
1471
|
+
var dist = distance(c, point);
|
1472
|
+
if (dist < minDistance) {
|
1473
|
+
minDistance = dist;
|
1474
|
+
closest = [i + 1, point];
|
1475
|
+
}
|
1476
|
+
}
|
1477
|
+
return closest;
|
1478
|
+
}
|
1479
|
+
function polygonCentroid(points) {
|
1480
|
+
var centroidX = 0;
|
1481
|
+
var centroidY = 0;
|
1482
|
+
var signedArea = 0;
|
1483
|
+
var x0 = 0;
|
1484
|
+
var y0 = 0;
|
1485
|
+
var x1 = 0;
|
1486
|
+
var y1 = 0;
|
1487
|
+
var a = 0;
|
1488
|
+
for (var i = 0; i < points.length - 1; i++) {
|
1489
|
+
x0 = points[i][0];
|
1490
|
+
y0 = points[i][1];
|
1491
|
+
x1 = points[i + 1][0];
|
1492
|
+
y1 = points[i + 1][1];
|
1493
|
+
a = x0 * y1 - x1 * y0;
|
1494
|
+
signedArea += a;
|
1495
|
+
centroidX += (x0 + x1) * a;
|
1496
|
+
centroidY += (y0 + y1) * a;
|
1497
|
+
}
|
1498
|
+
x0 = points[points.length - 1][0];
|
1499
|
+
y0 = points[points.length - 1][1];
|
1500
|
+
x1 = points[0][0];
|
1501
|
+
y1 = points[0][1];
|
1502
|
+
a = x0 * y1 - x1 * y0;
|
1503
|
+
signedArea += a;
|
1504
|
+
centroidX += (x0 + x1) * a;
|
1505
|
+
centroidY += (y0 + y1) * a;
|
1506
|
+
signedArea *= 0.5;
|
1507
|
+
centroidX /= 6 * signedArea;
|
1508
|
+
centroidY /= 6 * signedArea;
|
1509
|
+
return [centroidX, centroidY];
|
1510
|
+
}
|
1511
|
+
function round(point) {
|
1512
|
+
return point.map(function (coord) {
|
1513
|
+
return Math.round(coord * 10) / 10;
|
1514
|
+
});
|
1515
|
+
}
|
1516
|
+
|
1517
|
+
var css$1 = ".DraggableEditorView-module_wrapper__J8JLO {\n position: relative;\n display: inline-block;\n overflow: hidden;\n\n background-image:\n linear-gradient(45deg, var(--ui-on-surface-color-lighter) 25%, transparent 25%),\n linear-gradient(135deg, var(--ui-on-surface-color-lighter) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--ui-on-surface-color-lighter) 75%),\n linear-gradient(135deg, transparent 75%, var(--ui-on-surface-color-lighter) 75%);\n background-size: 16px 16px;\n background-position:0 0, 8px 0, 8px -8px, 0px 8px;\n}\n\n.DraggableEditorView-module_buttons__1Xob0 {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 10px 0;\n gap: 15px;\n}\n\n.DraggableEditorView-module_buttons__1Xob0 button {\n white-space: nowrap;\n}\n\n.DraggableEditorView-module_coordinates__3dVEt,\n.DraggableEditorView-module_coordinates__3dVEt label {\n display: flex;\n align-items: center;\n margin: 0;\n}\n\n.DraggableEditorView-module_coordinates__3dVEt {\n flex-wrap: wrap;\n justify-content: flex-end;\n}\n\n.DraggableEditorView-module_coordinates__3dVEt {\n gap: 10px;\n}\n\n.DraggableEditorView-module_coordinates__3dVEt label {\n gap: 5px;\n}\n\n.DraggableEditorView-module_coordinates__3dVEt input[disabled] {\n background-color: var(--ui-on-surface-color-lightest);\n}\n\n.DraggableEditorView-module_modeButtons__4wZBu {\n flex: 1;\n white-space: nowrap;\n}\n\n.DraggableEditorView-module_modeButtons__4wZBu button:first-child {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.DraggableEditorView-module_modeButtons__4wZBu button:last-child {\n margin-left: -1px;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.DraggableEditorView-module_modeButtons__4wZBu button[aria-pressed=true] {\n background-color: var(--ui-selection-color-light);\n}\n\n.DraggableEditorView-module_buttons__1Xob0 img {\n vertical-align: middle;\n margin-right: 6px;\n}\n\n.DraggableEditorView-module_placeholderImage__JyyId {\n aspect-ratio: 16 / 9;\n background-color: #000;\n}\n\n.DraggableEditorView-module_image__1Ockp {\n display: block;\n height: calc(100vh - 250px);\n max-height: 600px;\n min-height: 200px;\n}\n\n.DraggableEditorView-module_portraitImage__2lYIE {\n max-height: 1200px;\n}\n\n.DraggableEditorView-module_overlay__3QLpM {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n.DraggableEditorView-module_overlay__3QLpM svg {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.DraggableEditorView-module_overlay__3QLpM polygon {\n vector-effect: non-scaling-stroke;\n stroke-width: 1px;\n stroke-linejoin: round;\n stroke: #fff;\n fill: transparent;\n opacity: 0.9;\n cursor: move;\n}\n\n.DraggableEditorView-module_handle__9LHSy {\n position: absolute;\n width: 10px;\n height: 10px;\n background-color: #fff;\n transform: translate(-50%, -50%);\n border: solid 1px var(--ui-primary-color);\n border-radius: 2px;\n opacity: 0.9;\n z-index: 2;\n}\n\n.DraggableEditorView-module_handle__9LHSy::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 30px;\n height: 30px;\n margin: -10px 0 0 -10px;\n border-radius: 100%;\n z-index: 1;\n}\n\n.DraggableEditorView-module_circle__35Pba {\n border-radius: 100%;\n cursor: move;\n}\n\n.DraggableEditorView-module_potential__vxrma {\n opacity: 0;\n z-index: 1;\n cursor: default;\n}\n\n.DraggableEditorView-module_handle__9LHSy:hover {\n opacity: 1;\n}\n\n.DraggableEditorView-module_indicator__23yQO {\n --size: 15px;\n position: absolute;\n left: var(--center-x);\n top: var(--center-y);\n margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);\n border-radius: 50%;\n width: var(--size);\n height: var(--size);\n background-color: var(--color, #fff);\n transition: transform 0.2s ease;\n cursor: move;\n z-index: 3;\n}\n\n.DraggableEditorView-module_indicator__23yQO:hover {\n transform: scale(1.2);\n}\n\n.DraggableEditorView-module_indicator__23yQO::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: var(--size);\n height: var(--size);\n border-radius: 50%;\n background-color: #fff;\n animation: DraggableEditorView-module_blink__1SdQI 1s infinite;\n opacity: 0.3;\n z-index: -1;\n}\n\n.DraggableEditorView-module_selected__2bQtv {\n box-shadow: 0 0 0 3px var(--ui-selection-color),\n 0 0 0 4px var(--ui-primary-color-light);\n}\n\n@keyframes DraggableEditorView-module_blink__1SdQI {\n 0% {\n transform: scale(1.7);\n }\n\n 50% {\n transform: scale(2);\n }\n\n 100% {\n transform: scale(1.7);\n }\n}\n";
|
1518
|
+
var styles$1 = {"wrapper":"DraggableEditorView-module_wrapper__J8JLO","buttons":"DraggableEditorView-module_buttons__1Xob0","coordinates":"DraggableEditorView-module_coordinates__3dVEt","modeButtons":"DraggableEditorView-module_modeButtons__4wZBu","placeholderImage":"DraggableEditorView-module_placeholderImage__JyyId","image":"DraggableEditorView-module_image__1Ockp","portraitImage":"DraggableEditorView-module_portraitImage__2lYIE","overlay":"DraggableEditorView-module_overlay__3QLpM","handle":"DraggableEditorView-module_handle__9LHSy","circle":"DraggableEditorView-module_circle__35Pba","potential":"DraggableEditorView-module_potential__vxrma","indicator":"DraggableEditorView-module_indicator__23yQO","blink":"DraggableEditorView-module_blink__1SdQI","selected":"DraggableEditorView-module_selected__2bQtv"};
|
1519
|
+
styleInject(css$1);
|
1520
|
+
|
1521
|
+
var img$a = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e%3csvg xmlns='http://www.w3.org/2000/svg' id='svg4' version='1.1' viewBox='0 0 448 512'%3e %3cpath d='M 61.345703 63.888672 C 44.725703 63.888672 31.345703 77.268672 31.345703 93.888672 L 31.345703 417.57031 C 31.345703 434.19031 44.725703 447.57031 61.345703 447.57031 L 385.02734 447.57031 C 401.64734 447.57031 415.02734 434.19031 415.02734 417.57031 L 415.02734 93.888672 C 415.02734 77.268672 401.64734 63.888672 385.02734 63.888672 L 61.345703 63.888672 z M 106 127.80078 L 341.13867 127.80078 C 346.67867 127.80078 351.13867 132.26078 351.13867 137.80078 L 351.13867 372.93945 C 351.13867 378.47945 346.67867 382.93945 341.13867 382.93945 L 106 382.93945 C 100.46 382.93945 96 378.47945 96 372.93945 L 96 137.80078 C 96 132.26078 100.46 127.80078 106 127.80078 z ' fill='hsla(197%2c 26%25%2c 23%25%2c 0.8)' /%3e%3c/svg%3e";
|
1522
|
+
|
1523
|
+
var img$b = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3e%3c!--!Font Awesome Free 6.5.2 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons%2c Inc.--%3e%3cpath d='M96 151.4V360.6c9.7 5.6 17.8 13.7 23.4 23.4H328.6c0-.1 .1-.2 .1-.3l-4.5-7.9-32-56 0 0c-1.4 .1-2.8 .1-4.2 .1c-35.3 0-64-28.7-64-64s28.7-64 64-64c1.4 0 2.8 0 4.2 .1l0 0 32-56 4.5-7.9-.1-.3H119.4c-5.6 9.7-13.7 17.8-23.4 23.4zM384.3 352c35.2 .2 63.7 28.7 63.7 64c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H119.4c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V151.4C12.9 140.4 0 119.7 0 96C0 60.7 28.7 32 64 32c23.7 0 44.4 12.9 55.4 32H328.6c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 35.3-28.5 63.8-63.7 64l-4.5 7.9-32 56-2.3 4c4.2 8.5 6.5 18 6.5 28.1s-2.3 19.6-6.5 28.1l2.3 4 32 56 4.5 7.9z' fill='hsla(197%2c 26%25%2c 23%25%2c 0.8)' /%3e%3c/svg%3e";
|
1524
|
+
|
1525
|
+
var img$c = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' version='1.1'%3e %3cpath d='m 243%2c25.5 c -3%2c3.6 -6%2c8.5 -6%2c14 V 129 l -8%2c-7 c -7%2c-8 -20%2c-8 -28%2c0 -7%2c7 -7%2c19 0%2c26 l 42%2c42 v 0 c 2%2c2 4%2c3 6%2c4 3%2c1 5%2c1 8%2c2 v 0 c 5%2c-1 10%2c-2 14%2c-6 l 41%2c-42 c 7%2c-7 7%2c-19 0%2c-26 -8%2c-8 -20%2c-8 -28%2c0 l -8%2c7 V 38.9 C 276%2c28.5 268%2c20 257%2c20 c -6%2c0 -11%2c2.4 -14%2c5.5 z' style='stroke-width:0.608' /%3e %3cpath d='m 486%2c243 c -4%2c-3 -8%2c-6 -14%2c-6 h -89 l 7%2c-8 c 8%2c-7 8%2c-21 0%2c-29 -7%2c-7 -19%2c-7 -26%2c0 l -42%2c43 v 0 c -2%2c2 -3%2c4 -4%2c6 -1%2c3 -1%2c5 -2%2c8 v 0 c 1%2c5 2%2c10 6%2c14 l 42%2c41 c 7%2c7 19%2c7 26%2c0 8%2c-8 8%2c-20 0%2c-28 l -7%2c-8 h 90 c 10%2c0 19%2c-8 19%2c-19 0%2c-6 -3%2c-11 -6%2c-14 z' style='stroke-width:0.608' /%3e %3cpath d='m 269%2c486 c 3%2c-4 6%2c-8 6%2c-14 v -89 l 8%2c7 c 7%2c8 21%2c8 29%2c0 7%2c-7 7%2c-19 0%2c-26 l -43%2c-42 v 0 c -2%2c-2 -4%2c-3 -6%2c-4 -3%2c-1 -5%2c-1 -8%2c-2 v 0 c -5%2c1 -10%2c2 -14%2c6 l -41%2c42 c -7%2c7 -7%2c19 0%2c26 8%2c8 20%2c8 28%2c0 l 8%2c-7 v 90 c 0%2c10 8%2c19 19%2c19 6%2c0 11%2c-3 14%2c-6 z' style='stroke-width:0.608' /%3e %3cpath d='m 26%2c269 c 4%2c3 8%2c6 14%2c6 h 89 l -7%2c8 c -8%2c7 -8%2c21 0%2c29 7%2c7 19%2c7 26%2c0 l 42%2c-43 v 0 c 2%2c-2 3%2c-4 4%2c-6 1%2c-3 1%2c-5 2%2c-8 v 0 c -1%2c-5 -2%2c-10 -6%2c-14 l -42%2c-41 c -7%2c-7 -19%2c-7 -26%2c0 -8%2c8 -8%2c20 0%2c28 l 7%2c8 H 39 c -10%2c0 -19%2c8 -19%2c19 0%2c6 3%2c11 6%2c14 z' style='stroke-width:0.608' /%3e%3c/svg%3e";
|
1526
|
+
|
1527
|
+
var i18nPrefix = 'pageflow_scrolled.editor.content_elements.hotspots.edit_area_dialog';
|
1528
|
+
var DraggableEditorView = Marionette.View.extend({
|
1529
|
+
render: function render() {
|
1530
|
+
var _this$options$file,
|
1531
|
+
_this = this;
|
1532
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(DraggableEditor, {
|
1533
|
+
imageSrc: (_this$options$file = this.options.file) === null || _this$options$file === void 0 ? void 0 : _this$options$file.getBackgroundPositioningImageUrl(),
|
1534
|
+
portrait: this.options.file && this.options.file.get('width') < this.options.file.get('height'),
|
1535
|
+
indicatorColor: paletteColor(this.model.get(this.getPropertyName('color')) || this.model.get('color')),
|
1536
|
+
initialMode: this.model.get(this.getPropertyName('mode')),
|
1537
|
+
initialPoints: this.model.get(this.getPropertyName('outline')),
|
1538
|
+
initialIndicatorPosition: this.model.get(this.getPropertyName('indicatorPosition')),
|
1539
|
+
onModeChange: function onModeChange(mode) {
|
1540
|
+
return _this.mode = mode;
|
1541
|
+
},
|
1542
|
+
onPointsChange: function onPointsChange(points) {
|
1543
|
+
return _this.points = points;
|
1544
|
+
},
|
1545
|
+
onIndicatorPositionChange: function onIndicatorPositionChange(indicatorPosition) {
|
1546
|
+
return _this.indicatorPosition = indicatorPosition;
|
1547
|
+
}
|
1548
|
+
}), this.el);
|
1549
|
+
return this;
|
1550
|
+
},
|
1551
|
+
save: function save() {
|
1552
|
+
if (this.mode) {
|
1553
|
+
this.model.set(this.getPropertyName('mode'), this.mode);
|
1554
|
+
}
|
1555
|
+
if (this.points) {
|
1556
|
+
this.model.set(this.getPropertyName('outline'), this.points);
|
1557
|
+
}
|
1558
|
+
if (this.indicatorPosition) {
|
1559
|
+
this.model.set(this.getPropertyName('indicatorPosition'), this.indicatorPosition);
|
1560
|
+
}
|
1561
|
+
},
|
1562
|
+
getPropertyName: function getPropertyName(suffix) {
|
1563
|
+
return this.options.portrait ? "portrait".concat(utils.capitalize(suffix)) : suffix;
|
1564
|
+
}
|
1565
|
+
});
|
1566
|
+
function DraggableEditor(_ref) {
|
1567
|
+
var _state$selection2, _state$selection3;
|
1568
|
+
var imageSrc = _ref.imageSrc,
|
1569
|
+
portrait = _ref.portrait,
|
1570
|
+
indicatorColor = _ref.indicatorColor,
|
1571
|
+
initialMode = _ref.initialMode,
|
1572
|
+
initialPoints = _ref.initialPoints,
|
1573
|
+
initialIndicatorPosition = _ref.initialIndicatorPosition,
|
1574
|
+
onModeChange = _ref.onModeChange,
|
1575
|
+
onPointsChange = _ref.onPointsChange,
|
1576
|
+
onIndicatorPositionChange = _ref.onIndicatorPositionChange;
|
1577
|
+
var _useReducer = useReducer(reducer, {
|
1578
|
+
mode: initialMode || 'rect',
|
1579
|
+
points: initialPoints || [[40, 40], [60, 40], [60, 60], [40, 60]],
|
1580
|
+
indicatorPosition: initialIndicatorPosition || [50, 50]
|
1581
|
+
}),
|
1582
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
1583
|
+
state = _useReducer2[0],
|
1584
|
+
dispatch = _useReducer2[1];
|
1585
|
+
var mode = state.mode,
|
1586
|
+
points = state.points,
|
1587
|
+
potentialPoint = state.potentialPoint,
|
1588
|
+
indicatorPosition = state.indicatorPosition,
|
1589
|
+
selection = state.selection;
|
1590
|
+
useEffect(function () {
|
1591
|
+
onModeChange(mode);
|
1592
|
+
}, [onModeChange, mode]);
|
1593
|
+
useEffect(function () {
|
1594
|
+
onPointsChange(points);
|
1595
|
+
}, [onPointsChange, points]);
|
1596
|
+
useEffect(function () {
|
1597
|
+
onIndicatorPositionChange(indicatorPosition);
|
1598
|
+
}, [onIndicatorPositionChange, indicatorPosition]);
|
1599
|
+
var ref = useRef();
|
1600
|
+
function clientToPercent(event) {
|
1601
|
+
var rect = ref.current.getBoundingClientRect();
|
1602
|
+
return [Math.max(0, Math.min(100, (event.clientX - rect.left) / rect.width * 100)), Math.max(0, Math.min(100, (event.clientY - rect.top) / rect.height * 100))];
|
1603
|
+
}
|
1604
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
1605
|
+
className: styles$1.buttons
|
1606
|
+
}, /*#__PURE__*/React.createElement(ModeButtons, {
|
1607
|
+
mode: mode,
|
1608
|
+
dispatch: dispatch
|
1609
|
+
}), /*#__PURE__*/React.createElement(Coordinates, {
|
1610
|
+
selection: selection,
|
1611
|
+
onChange: function onChange(position) {
|
1612
|
+
return dispatch({
|
1613
|
+
type: UPDATE_SELECTION_POSITION,
|
1614
|
+
position: position
|
1615
|
+
});
|
1616
|
+
},
|
1617
|
+
onBlur: function onBlur() {
|
1618
|
+
return dispatch({
|
1619
|
+
type: BLUR_SELECTION_POSITION
|
1620
|
+
});
|
1621
|
+
}
|
1622
|
+
}), /*#__PURE__*/React.createElement(CenterIndicatorButton, {
|
1623
|
+
onClick: function onClick() {
|
1624
|
+
return dispatch({
|
1625
|
+
type: CENTER_INDICATOR
|
1626
|
+
});
|
1627
|
+
}
|
1628
|
+
})), /*#__PURE__*/React.createElement("div", {
|
1629
|
+
className: styles$1.wrapper
|
1630
|
+
}, imageSrc ? /*#__PURE__*/React.createElement("img", {
|
1631
|
+
className: classNames(styles$1.image, _defineProperty({}, styles$1.portraitImage, portrait)),
|
1632
|
+
src: imageSrc,
|
1633
|
+
alt: I18n.t("".concat(i18nPrefix, ".hotspots_image"))
|
1634
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
1635
|
+
className: classNames(styles$1.image, styles$1.placeholderImage)
|
1636
|
+
}), /*#__PURE__*/React.createElement("div", {
|
1637
|
+
ref: ref,
|
1638
|
+
className: styles$1.overlay,
|
1639
|
+
onMouseMove: function onMouseMove(event) {
|
1640
|
+
return dispatch({
|
1641
|
+
type: MOUSE_MOVE,
|
1642
|
+
cursor: clientToPercent(event)
|
1643
|
+
});
|
1644
|
+
}
|
1645
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
1646
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1647
|
+
viewBox: "0 0 100 100",
|
1648
|
+
preserveAspectRatio: "none"
|
1649
|
+
}, /*#__PURE__*/React.createElement(DraggableCore, {
|
1650
|
+
onDrag: function onDrag(event, dragEvent) {
|
1651
|
+
var rect = ref.current.getBoundingClientRect();
|
1652
|
+
dispatch({
|
1653
|
+
type: DRAG,
|
1654
|
+
delta: [dragEvent.deltaX / rect.width * 100, dragEvent.deltaY / rect.height * 100]
|
1655
|
+
});
|
1656
|
+
}
|
1657
|
+
}, /*#__PURE__*/React.createElement("polygon", {
|
1658
|
+
points: drawnOutlinePoints(state).map(function (coords) {
|
1659
|
+
return coords.map(function (coord) {
|
1660
|
+
return coord;
|
1661
|
+
}).join(',');
|
1662
|
+
}).join(' ')
|
1663
|
+
}))), handles(state).map(function (handle, index) {
|
1664
|
+
var _state$selection;
|
1665
|
+
return /*#__PURE__*/React.createElement(Handle, {
|
1666
|
+
key: index,
|
1667
|
+
point: handle.point,
|
1668
|
+
selected: ((_state$selection = state.selection) === null || _state$selection === void 0 ? void 0 : _state$selection.index) === index,
|
1669
|
+
axis: handle.axis,
|
1670
|
+
cursor: handle.cursor,
|
1671
|
+
circle: handle.circle,
|
1672
|
+
title: handle.deletable ? I18n.t("".concat(i18nPrefix, ".double_click_to_delete")) : null,
|
1673
|
+
onClick: function onClick(event) {
|
1674
|
+
return dispatch({
|
1675
|
+
type: CLICK_HANDLE,
|
1676
|
+
index: index
|
1677
|
+
});
|
1678
|
+
},
|
1679
|
+
onDoubleClick: function onDoubleClick(event) {
|
1680
|
+
return dispatch({
|
1681
|
+
type: DOUBLE_CLICK_HANDLE,
|
1682
|
+
index: index
|
1683
|
+
});
|
1684
|
+
},
|
1685
|
+
onDrag: function onDrag(event) {
|
1686
|
+
return dispatch({
|
1687
|
+
type: DRAG_HANDLE,
|
1688
|
+
index: index,
|
1689
|
+
cursor: clientToPercent(event)
|
1690
|
+
});
|
1691
|
+
},
|
1692
|
+
onDragStop: function onDragStop(event) {
|
1693
|
+
return dispatch({
|
1694
|
+
type: DRAG_HANDLE_STOP
|
1695
|
+
});
|
1696
|
+
}
|
1697
|
+
});
|
1698
|
+
}), potentialPoint && /*#__PURE__*/React.createElement(Handle, {
|
1699
|
+
point: potentialPoint,
|
1700
|
+
circle: true,
|
1701
|
+
potential: true,
|
1702
|
+
selected: ((_state$selection2 = state.selection) === null || _state$selection2 === void 0 ? void 0 : _state$selection2.type) === 'potentialPoint',
|
1703
|
+
onDrag: function onDrag(event) {
|
1704
|
+
return dispatch({
|
1705
|
+
type: DRAG_POTENTIAL_POINT,
|
1706
|
+
cursor: clientToPercent(event)
|
1707
|
+
});
|
1708
|
+
},
|
1709
|
+
onDragStop: function onDragStop(event) {
|
1710
|
+
return dispatch({
|
1711
|
+
type: DRAG_POTENTIAL_POINT_STOP
|
1712
|
+
});
|
1713
|
+
}
|
1714
|
+
}), /*#__PURE__*/React.createElement(Indicator, {
|
1715
|
+
position: indicatorPosition,
|
1716
|
+
selected: ((_state$selection3 = state.selection) === null || _state$selection3 === void 0 ? void 0 : _state$selection3.type) === 'indicator',
|
1717
|
+
color: indicatorColor,
|
1718
|
+
onClick: function onClick(event) {
|
1719
|
+
return dispatch({
|
1720
|
+
type: CLICK_INDICATOR
|
1721
|
+
});
|
1722
|
+
},
|
1723
|
+
onDrag: function onDrag(event) {
|
1724
|
+
return dispatch({
|
1725
|
+
type: DRAG_INDICATOR,
|
1726
|
+
cursor: clientToPercent(event)
|
1727
|
+
});
|
1728
|
+
}
|
1729
|
+
}))));
|
1730
|
+
}
|
1731
|
+
var modeIcons = {
|
1732
|
+
rect: img$a,
|
1733
|
+
polygon: img$b
|
1734
|
+
};
|
1735
|
+
function ModeButtons(_ref2) {
|
1736
|
+
var mode = _ref2.mode,
|
1737
|
+
dispatch = _ref2.dispatch;
|
1738
|
+
return /*#__PURE__*/React.createElement("div", {
|
1739
|
+
className: styles$1.modeButtons
|
1740
|
+
}, ['rect', 'polygon'].map(function (availableMode) {
|
1741
|
+
return /*#__PURE__*/React.createElement("button", {
|
1742
|
+
key: availableMode,
|
1743
|
+
type: "button",
|
1744
|
+
className: buttonStyles.secondaryIconButton,
|
1745
|
+
"aria-pressed": mode === availableMode,
|
1746
|
+
onClick: function onClick() {
|
1747
|
+
return dispatch({
|
1748
|
+
type: SET_MODE,
|
1749
|
+
value: availableMode
|
1750
|
+
});
|
1751
|
+
}
|
1752
|
+
}, /*#__PURE__*/React.createElement("img", {
|
1753
|
+
src: modeIcons[availableMode],
|
1754
|
+
alt: "",
|
1755
|
+
width: "20",
|
1756
|
+
height: "20"
|
1757
|
+
}), I18n.t(availableMode, {
|
1758
|
+
scope: "".concat(i18nPrefix, ".modes")
|
1759
|
+
}));
|
1760
|
+
}));
|
1761
|
+
}
|
1762
|
+
function Handle(_ref3) {
|
1763
|
+
var point = _ref3.point,
|
1764
|
+
selected = _ref3.selected,
|
1765
|
+
circle = _ref3.circle,
|
1766
|
+
potential = _ref3.potential,
|
1767
|
+
title = _ref3.title,
|
1768
|
+
cursor = _ref3.cursor,
|
1769
|
+
onDrag = _ref3.onDrag,
|
1770
|
+
onDragStop = _ref3.onDragStop,
|
1771
|
+
onClick = _ref3.onClick,
|
1772
|
+
onDoubleClick = _ref3.onDoubleClick;
|
1773
|
+
return /*#__PURE__*/React.createElement(DraggableCore, {
|
1774
|
+
onDrag: onDrag,
|
1775
|
+
onStop: onDragStop
|
1776
|
+
}, /*#__PURE__*/React.createElement("div", {
|
1777
|
+
className: classNames(styles$1.handle, _defineProperty(_defineProperty(_defineProperty({}, styles$1.circle, circle), styles$1.selected, selected), styles$1.potential, potential)),
|
1778
|
+
tabIndex: "0",
|
1779
|
+
onClick: onClick,
|
1780
|
+
onDoubleClick: onDoubleClick,
|
1781
|
+
title: title,
|
1782
|
+
style: {
|
1783
|
+
left: "".concat(point[0], "%"),
|
1784
|
+
top: "".concat(point[1], "%"),
|
1785
|
+
cursor: cursor
|
1786
|
+
}
|
1787
|
+
}));
|
1788
|
+
}
|
1789
|
+
function Indicator(_ref4) {
|
1790
|
+
var position = _ref4.position,
|
1791
|
+
selected = _ref4.selected,
|
1792
|
+
color = _ref4.color,
|
1793
|
+
onClick = _ref4.onClick,
|
1794
|
+
onDrag = _ref4.onDrag;
|
1795
|
+
return /*#__PURE__*/React.createElement(DraggableCore, {
|
1796
|
+
onDrag: onDrag
|
1797
|
+
}, /*#__PURE__*/React.createElement("div", {
|
1798
|
+
className: classNames(styles$1.indicator, _defineProperty({}, styles$1.selected, selected)),
|
1799
|
+
onClick: onClick,
|
1800
|
+
style: {
|
1801
|
+
left: "".concat(position[0], "%"),
|
1802
|
+
top: "".concat(position[1], "%"),
|
1803
|
+
'--color': color
|
1804
|
+
},
|
1805
|
+
title: I18n.t("".concat(i18nPrefix, ".indicator_title"))
|
1806
|
+
}));
|
1807
|
+
}
|
1808
|
+
function CenterIndicatorButton(_ref5) {
|
1809
|
+
var onClick = _ref5.onClick;
|
1810
|
+
return /*#__PURE__*/React.createElement("button", {
|
1811
|
+
type: "button",
|
1812
|
+
className: buttonStyles.secondaryIconButton,
|
1813
|
+
onClick: onClick
|
1814
|
+
}, /*#__PURE__*/React.createElement("img", {
|
1815
|
+
src: img$c,
|
1816
|
+
alt: "",
|
1817
|
+
width: "20",
|
1818
|
+
height: "20"
|
1819
|
+
}), I18n.t("".concat(i18nPrefix, ".centerIndicator")));
|
1820
|
+
}
|
1821
|
+
function Coordinates(_ref6) {
|
1822
|
+
var selection = _ref6.selection,
|
1823
|
+
_onChange = _ref6.onChange,
|
1824
|
+
onBlur = _ref6.onBlur;
|
1825
|
+
if (!selection) {
|
1826
|
+
return null;
|
1827
|
+
}
|
1828
|
+
var position = selection.position;
|
1829
|
+
return /*#__PURE__*/React.createElement("div", {
|
1830
|
+
className: styles$1.coordinates
|
1831
|
+
}, /*#__PURE__*/React.createElement(CoordinateInput, {
|
1832
|
+
label: "X",
|
1833
|
+
disabled: selection.axis === 'y',
|
1834
|
+
value: position[0],
|
1835
|
+
onChange: function onChange(event) {
|
1836
|
+
return _onChange([parseFloat(event.target.value || 0), position[1]]);
|
1837
|
+
},
|
1838
|
+
onBlur: onBlur
|
1839
|
+
}), /*#__PURE__*/React.createElement(CoordinateInput, {
|
1840
|
+
label: "Y",
|
1841
|
+
disabled: selection.axis === 'x',
|
1842
|
+
value: position[1],
|
1843
|
+
onChange: function onChange(event) {
|
1844
|
+
return _onChange([position[0], parseFloat(event.target.value || 0)]);
|
1845
|
+
},
|
1846
|
+
onBlur: onBlur
|
1847
|
+
}));
|
1848
|
+
}
|
1849
|
+
function CoordinateInput(_ref7) {
|
1850
|
+
var disabled = _ref7.disabled,
|
1851
|
+
label = _ref7.label,
|
1852
|
+
value = _ref7.value,
|
1853
|
+
onChange = _ref7.onChange,
|
1854
|
+
onBlur = _ref7.onBlur;
|
1855
|
+
return /*#__PURE__*/React.createElement("div", {
|
1856
|
+
className: classNames({
|
1857
|
+
'input-disabled': disabled
|
1858
|
+
})
|
1859
|
+
}, /*#__PURE__*/React.createElement("label", null, label, ":", /*#__PURE__*/React.createElement("input", {
|
1860
|
+
type: "number",
|
1861
|
+
min: "0",
|
1862
|
+
max: "100",
|
1863
|
+
disabled: disabled,
|
1864
|
+
value: value,
|
1865
|
+
onClick: function onClick(event) {
|
1866
|
+
return event.target.focus();
|
1867
|
+
},
|
1868
|
+
onChange: onChange,
|
1869
|
+
onBlur: onBlur
|
1870
|
+
}), "%"));
|
1871
|
+
}
|
1872
|
+
|
1873
|
+
var css$2 = ".EditAreaDialogView-module_box__1IOYj {\n width: -moz-min-content;\n width: min-content;\n min-height: 310px;\n min-width: 400px;\n}\n\n.EditAreaDialogView-module_wrapper__F28hP {}\n\n.EditAreaDialogView-module_save__1o3Qg {}\n";
|
1874
|
+
var styles$2 = {"box":"EditAreaDialogView-module_box__1IOYj","wrapper":"EditAreaDialogView-module_wrapper__F28hP","save":"EditAreaDialogView-module_save__1o3Qg"};
|
1875
|
+
styleInject(css$2);
|
1876
|
+
|
1877
|
+
var i18nPrefix$1 = 'pageflow_scrolled.editor.content_elements.hotspots.edit_area_dialog';
|
1878
|
+
var EditAreaDialogView = Marionette.ItemView.extend({
|
1879
|
+
template: function template() {
|
1880
|
+
return "\n <div class=\"".concat(dialogViewStyles.backdrop, "\">\n <div class=\"editor ").concat(dialogViewStyles.box, " ").concat(styles$2.box, "\">\n <h1 class=\"").concat(dialogViewStyles.header, "\">\n ").concat(I18n.t("".concat(i18nPrefix$1, ".header")), "\n </h1>\n\n <div class=\"").concat(styles$2.wrapper, "\">\n </div>\n\n <div class=\"").concat(dialogViewStyles.footer, "\">\n <button class=\"").concat(styles$2.save, " ").concat(buttonStyles.saveButton, "\">\n ").concat(I18n.t("".concat(i18nPrefix$1, ".save")), "\n </button>\n <button class=\"").concat(dialogViewStyles.close, "\">\n ").concat(I18n.t("".concat(i18nPrefix$1, ".cancel")), "\n </button>\n </div>\n </div>\n </div>\n ");
|
1881
|
+
},
|
1882
|
+
mixins: [dialogView],
|
1883
|
+
ui: cssModulesUtils$1.ui(styles$2, 'wrapper'),
|
1884
|
+
events: cssModulesUtils$1.events(styles$2, {
|
1885
|
+
'click save': function clickSave() {
|
1886
|
+
this.save();
|
1887
|
+
this.close();
|
1888
|
+
if (this.options.onSave) {
|
1889
|
+
this.options.onSave();
|
1890
|
+
}
|
1891
|
+
}
|
1892
|
+
}),
|
1893
|
+
onRender: function onRender() {
|
1894
|
+
var _this = this;
|
1895
|
+
if (this.options.portraitFile) {
|
1896
|
+
var tabsView = new TabsView({
|
1897
|
+
translationKeyPrefixes: ["".concat(i18nPrefix$1, ".tabs")],
|
1898
|
+
defaultTab: this.options.defaultTab
|
1899
|
+
});
|
1900
|
+
this.editorViews = [new DraggableEditorView({
|
1901
|
+
model: this.model,
|
1902
|
+
file: this.options.file
|
1903
|
+
}), new DraggableEditorView({
|
1904
|
+
model: this.model,
|
1905
|
+
file: this.options.portraitFile,
|
1906
|
+
portrait: true
|
1907
|
+
})];
|
1908
|
+
tabsView.tab('default', function () {
|
1909
|
+
return _this.editorViews[0];
|
1910
|
+
});
|
1911
|
+
tabsView.tab('portrait', function () {
|
1912
|
+
return _this.editorViews[1];
|
1913
|
+
});
|
1914
|
+
this.appendSubview(tabsView.render(), {
|
1915
|
+
to: this.ui.wrapper
|
1916
|
+
});
|
1917
|
+
} else {
|
1918
|
+
this.editorViews = [new DraggableEditorView({
|
1919
|
+
model: this.model,
|
1920
|
+
file: this.options.file
|
1921
|
+
})];
|
1922
|
+
this.appendSubview(this.editorViews[0].render(), {
|
1923
|
+
to: this.ui.wrapper
|
1924
|
+
});
|
1925
|
+
}
|
1926
|
+
},
|
1927
|
+
save: function save() {
|
1928
|
+
this.editorViews.forEach(function (view) {
|
1929
|
+
return view.save();
|
1930
|
+
});
|
1931
|
+
}
|
1932
|
+
});
|
1933
|
+
EditAreaDialogView.show = function (options) {
|
1934
|
+
app.dialogRegion.show(new EditAreaDialogView(options));
|
1935
|
+
};
|
1936
|
+
|
1937
|
+
var Area = Backbone.Model.extend({
|
1938
|
+
mixins: [transientReferences],
|
1939
|
+
thumbnailFile: function thumbnailFile() {
|
1940
|
+
var _this$imageFile;
|
1941
|
+
return (_this$imageFile = this.imageFile()) === null || _this$imageFile === void 0 ? void 0 : _this$imageFile.thumbnailFile();
|
1942
|
+
},
|
1943
|
+
title: function title() {
|
1944
|
+
var _tooltipTexts$this$id, _tooltipTexts$this$id2, _tooltipTexts$this$id3, _tooltipTexts$this$id4, _tooltipTexts$this$id5;
|
1945
|
+
var tooltipTexts = this.collection.contentElement.configuration.get('tooltipTexts');
|
1946
|
+
return tooltipTexts === null || tooltipTexts === void 0 ? void 0 : (_tooltipTexts$this$id = tooltipTexts[this.id]) === null || _tooltipTexts$this$id === void 0 ? void 0 : (_tooltipTexts$this$id2 = _tooltipTexts$this$id.title) === null || _tooltipTexts$this$id2 === void 0 ? void 0 : (_tooltipTexts$this$id3 = _tooltipTexts$this$id2[0]) === null || _tooltipTexts$this$id3 === void 0 ? void 0 : (_tooltipTexts$this$id4 = _tooltipTexts$this$id3.children) === null || _tooltipTexts$this$id4 === void 0 ? void 0 : (_tooltipTexts$this$id5 = _tooltipTexts$this$id4[0]) === null || _tooltipTexts$this$id5 === void 0 ? void 0 : _tooltipTexts$this$id5.text;
|
1947
|
+
},
|
1948
|
+
imageFile: function imageFile() {
|
1949
|
+
return this.collection.entry.imageFiles.getByPermaId(this.get('activeImage'));
|
1950
|
+
},
|
1951
|
+
highlight: function highlight() {
|
1952
|
+
this.collection.contentElement.postCommand({
|
1953
|
+
type: 'HIGHLIGHT_AREA',
|
1954
|
+
index: this.collection.indexOf(this)
|
1955
|
+
});
|
1956
|
+
},
|
1957
|
+
resetHighlight: function resetHighlight() {
|
1958
|
+
this.collection.contentElement.postCommand({
|
1959
|
+
type: 'RESET_AREA_HIGHLIGHT'
|
1960
|
+
});
|
1961
|
+
}
|
1962
|
+
});
|
1963
|
+
|
1964
|
+
var css$3 = ".AreasListView-module_listContainer__1vyoU {}\n";
|
1965
|
+
var styles$3 = {"listContainer":"AreasListView-module_listContainer__1vyoU"};
|
1966
|
+
styleInject(css$3);
|
1967
|
+
|
1968
|
+
var AreasListView = Marionette.Layout.extend({
|
1969
|
+
template: function template(data) {
|
1970
|
+
return "\n <div class='".concat(styles$3.listContainer, "'></div>\n <button class=\"").concat(buttonStyles.addButton, "\">\n ").concat(I18n.t('pageflow_scrolled.editor.content_elements.hotspots.areas.add'), "\n </button>\n ");
|
1971
|
+
},
|
1972
|
+
regions: cssModulesUtils.ui(styles$3, 'listContainer'),
|
1973
|
+
events: cssModulesUtils.events(buttonStyles, {
|
1974
|
+
'click addButton': function clickAddButton() {
|
1975
|
+
var _this = this;
|
1976
|
+
var model = new Area();
|
1977
|
+
EditAreaDialogView.show({
|
1978
|
+
model: model,
|
1979
|
+
file: this.model.getImageFile('image'),
|
1980
|
+
portraitFile: this.model.getImageFile('portraitImage'),
|
1981
|
+
onSave: function onSave() {
|
1982
|
+
return _this.collection.addWithId(model);
|
1983
|
+
}
|
1984
|
+
});
|
1985
|
+
}
|
1986
|
+
}),
|
1987
|
+
onRender: function onRender() {
|
1988
|
+
var _this2 = this;
|
1989
|
+
this.listContainer.show(new ListView({
|
1990
|
+
label: I18n.t('pageflow_scrolled.editor.content_elements.hotspots.areas.label'),
|
1991
|
+
collection: this.collection,
|
1992
|
+
sortable: true,
|
1993
|
+
highlight: true,
|
1994
|
+
onEdit: function onEdit(model) {
|
1995
|
+
_this2.options.contentElement.postCommand({
|
1996
|
+
type: 'SET_ACTIVE_AREA',
|
1997
|
+
index: _this2.collection.indexOf(model)
|
1998
|
+
});
|
1999
|
+
editor.navigate("/scrolled/hotspots/".concat(_this2.options.contentElement.id, "/").concat(model.id), {
|
2000
|
+
trigger: true
|
2001
|
+
});
|
2002
|
+
},
|
2003
|
+
onRemove: function onRemove(model) {
|
2004
|
+
if (window.confirm(I18n.t('pageflow_scrolled.editor.content_elements.hotspots.areas.confirm_delete'))) {
|
2005
|
+
_this2.collection.remove(model);
|
2006
|
+
}
|
2007
|
+
}
|
2008
|
+
}));
|
2009
|
+
}
|
2010
|
+
});
|
2011
|
+
|
2012
|
+
var AreasCollection = Backbone.Collection.extend({
|
2013
|
+
model: Area,
|
2014
|
+
comparator: 'position',
|
2015
|
+
initialize: function initialize(models, options) {
|
2016
|
+
var _this = this;
|
2017
|
+
this.entry = options.entry;
|
2018
|
+
this.contentElement = options.contentElement;
|
2019
|
+
this.listenTo(this, 'add change sort', this.updateConfiguration);
|
2020
|
+
this.listenTo(this, 'remove', function () {
|
2021
|
+
return _this.updateConfiguration({
|
2022
|
+
pruneTooltips: true
|
2023
|
+
});
|
2024
|
+
});
|
2025
|
+
},
|
2026
|
+
updateConfiguration: function updateConfiguration(_ref) {
|
2027
|
+
var pruneTooltips = _ref.pruneTooltips;
|
2028
|
+
var updatedAttributes = {
|
2029
|
+
areas: this.toJSON()
|
2030
|
+
};
|
2031
|
+
if (pruneTooltips) {
|
2032
|
+
updatedAttributes = _objectSpread2(_objectSpread2(_objectSpread2({}, updatedAttributes), this.getPrunedProperty('tooltipTexts')), this.getPrunedProperty('tooltipLinks'));
|
2033
|
+
}
|
2034
|
+
this.contentElement.configuration.set(updatedAttributes);
|
2035
|
+
},
|
2036
|
+
getPrunedProperty: function getPrunedProperty(propertyName) {
|
2037
|
+
return _defineProperty({}, propertyName, _.pick.apply(_, [this.contentElement.configuration.get(propertyName) || {}].concat(_toConsumableArray(this.pluck('id')))));
|
2038
|
+
},
|
2039
|
+
addWithId: function addWithId(model) {
|
2040
|
+
model.set('id', this.length ? Math.max.apply(Math, _toConsumableArray(this.pluck('id'))) + 1 : 1);
|
2041
|
+
this.add(model);
|
2042
|
+
},
|
2043
|
+
saveOrder: function saveOrder() {}
|
2044
|
+
});
|
2045
|
+
AreasCollection.forContentElement = function (contentElement, entry) {
|
2046
|
+
return new AreasCollection(contentElement.configuration.get('areas') || [], {
|
2047
|
+
entry: entry,
|
2048
|
+
contentElement: contentElement
|
2049
|
+
});
|
2050
|
+
};
|
2051
|
+
|
2052
|
+
var SidebarRouter$1 = Marionette.AppRouter.extend({
|
2053
|
+
appRoutes: {
|
2054
|
+
'scrolled/hotspots/:id/:area_id': 'area',
|
2055
|
+
'scrolled/hotspots/:id/:area_id/:tab': 'area'
|
2056
|
+
}
|
2057
|
+
});
|
2058
|
+
|
2059
|
+
var css$4 = ".AreaInputView-module_button__3LSo- {\n width: 100%;\n}\n";
|
2060
|
+
var styles$4 = {"button":"AreaInputView-module_button__3LSo-"};
|
2061
|
+
styleInject(css$4);
|
2062
|
+
|
2063
|
+
var AreaInputView = Marionette.Layout.extend({
|
2064
|
+
template: function template(data) {
|
2065
|
+
return "\n <label>\n <span class=\"name\"></span>\n <span class=\"inline_help\"></span>\n </label>\n <button class=\"".concat(buttonStyles.targetButton, " ").concat(styles$4.button, "\">\n ").concat(I18n.t('pageflow_scrolled.editor.content_elements.hotspots.area_input.edit'), "\n </button>\n ");
|
2066
|
+
},
|
2067
|
+
mixins: [inputView],
|
2068
|
+
events: cssModulesUtils.events(buttonStyles, {
|
2069
|
+
'click targetButton': function clickTargetButton() {
|
2070
|
+
EditAreaDialogView.show({
|
2071
|
+
model: this.model,
|
2072
|
+
file: this.options.file,
|
2073
|
+
portraitFile: this.options.portraitFile,
|
2074
|
+
defaultTab: this.options.defaultTab
|
2075
|
+
});
|
2076
|
+
}
|
2077
|
+
})
|
2078
|
+
});
|
2079
|
+
|
2080
|
+
var css$5 = ".SidebarEditAreaView-module_view__2AVKF .tabs_view-headers li:nth-child(2) {\n margin-left: 5px;\n}\n\n.SidebarEditAreaView-module_view__2AVKF .tabs_view-headers li:nth-child(2)::before {\n content: \"\\203A\";\n margin-left: -15px;\n margin-right: 10px;\n font-weight: normal;\n}\n";
|
2081
|
+
var styles$5 = {"view":"SidebarEditAreaView-module_view__2AVKF"};
|
2082
|
+
styleInject(css$5);
|
2083
|
+
|
2084
|
+
var SidebarEditAreaView = Marionette.Layout.extend({
|
2085
|
+
template: function template(data) {
|
2086
|
+
return "\n <a class=\"back\">".concat(I18n.t('pageflow_scrolled.editor.content_elements.hotspots.edit_area.back'), "</a>\n <a class=\"destroy\">").concat(I18n.t('pageflow_scrolled.editor.content_elements.hotspots.edit_area.destroy'), "</a>\n\n <div class='form_container'></div>\n ");
|
2087
|
+
},
|
2088
|
+
className: styles$5.view,
|
2089
|
+
regions: {
|
2090
|
+
formContainer: '.form_container'
|
2091
|
+
},
|
2092
|
+
events: {
|
2093
|
+
'click a.back': 'goBack',
|
2094
|
+
'click a.destroy': 'destroyLink'
|
2095
|
+
},
|
2096
|
+
onRender: function onRender() {
|
2097
|
+
var _this = this;
|
2098
|
+
var options = this.options;
|
2099
|
+
var configurationEditor = new ConfigurationEditorView({
|
2100
|
+
model: this.model,
|
2101
|
+
attributeTranslationKeyPrefixes: ['pageflow_scrolled.editor.content_elements.hotspots.edit_area.attributes'],
|
2102
|
+
tabTranslationKeyPrefix: 'pageflow_scrolled.editor.content_elements.hotspots.edit_area.tabs',
|
2103
|
+
tab: options.tab || (options.entry.get('emulation_mode') === 'phone' ? 'portrait' : 'area')
|
2104
|
+
});
|
2105
|
+
var file = options.contentElement.configuration.getImageFile('image');
|
2106
|
+
var portraitFile = options.contentElement.configuration.getImageFile('portraitImage');
|
2107
|
+
var panZoomEnabled = options.contentElement.configuration.get('enablePanZoom') !== 'never';
|
2108
|
+
var preserveActiveArea = function preserveActiveArea() {
|
2109
|
+
return setTimeout(function () {
|
2110
|
+
return options.contentElement.postCommand({
|
2111
|
+
type: 'SET_ACTIVE_AREA',
|
2112
|
+
index: options.collection.indexOf(_this.model)
|
2113
|
+
});
|
2114
|
+
}, 200);
|
2115
|
+
};
|
2116
|
+
if (file && portraitFile) {
|
2117
|
+
this.previousEmulationMode = options.entry.get('emulation_mode') || 'desktop';
|
2118
|
+
}
|
2119
|
+
configurationEditor.tab('area', function () {
|
2120
|
+
if (file && portraitFile && options.entry.has('emulation_mode')) {
|
2121
|
+
options.entry.unset('emulation_mode');
|
2122
|
+
preserveActiveArea();
|
2123
|
+
}
|
2124
|
+
this.input('area', AreaInputView, {
|
2125
|
+
file: file,
|
2126
|
+
portraitFile: portraitFile
|
2127
|
+
});
|
2128
|
+
this.input('activeImage', FileInputView, {
|
2129
|
+
collection: 'image_files',
|
2130
|
+
fileSelectionHandler: 'hotspotsArea',
|
2131
|
+
fileSelectionHandlerOptions: {
|
2132
|
+
contentElementId: options.contentElement.get('id'),
|
2133
|
+
tab: 'area'
|
2134
|
+
},
|
2135
|
+
positioning: false
|
2136
|
+
});
|
2137
|
+
if (panZoomEnabled) {
|
2138
|
+
this.input('zoom', SliderInputView);
|
2139
|
+
}
|
2140
|
+
this.group('PaletteColor', {
|
2141
|
+
propertyName: 'color',
|
2142
|
+
entry: options.entry
|
2143
|
+
});
|
2144
|
+
this.input('tooltipReference', SelectInputView, {
|
2145
|
+
values: ['indicator', 'area']
|
2146
|
+
});
|
2147
|
+
this.input('tooltipPosition', SelectInputView, {
|
2148
|
+
values: ['below', 'above']
|
2149
|
+
});
|
2150
|
+
this.input('tooltipMaxWidth', SelectInputView, {
|
2151
|
+
defaultValue: 'medium',
|
2152
|
+
values: ['wide', 'medium', 'narrow', 'veryNarrow']
|
2153
|
+
});
|
2154
|
+
this.view(SeparatorView);
|
2155
|
+
this.input('tooltipImage', FileInputView, {
|
2156
|
+
collection: 'image_files',
|
2157
|
+
fileSelectionHandler: 'hotspotsArea',
|
2158
|
+
fileSelectionHandlerOptions: {
|
2159
|
+
contentElementId: options.contentElement.get('id'),
|
2160
|
+
tab: 'area'
|
2161
|
+
},
|
2162
|
+
positioning: false
|
2163
|
+
});
|
2164
|
+
this.input('tooltipTextAlign', SelectInputView, {
|
2165
|
+
values: ['left', 'right', 'center']
|
2166
|
+
});
|
2167
|
+
});
|
2168
|
+
if (portraitFile) {
|
2169
|
+
configurationEditor.tab('portrait', function () {
|
2170
|
+
if (file && portraitFile && !options.entry.has('emulation_mode')) {
|
2171
|
+
options.entry.set('emulation_mode', 'phone');
|
2172
|
+
preserveActiveArea();
|
2173
|
+
}
|
2174
|
+
this.input('portraitArea', AreaInputView, {
|
2175
|
+
file: file,
|
2176
|
+
portraitFile: portraitFile,
|
2177
|
+
defaultTab: 'portrait'
|
2178
|
+
});
|
2179
|
+
this.input('portraitActiveImage', FileInputView, {
|
2180
|
+
collection: 'image_files',
|
2181
|
+
fileSelectionHandler: 'hotspotsArea',
|
2182
|
+
fileSelectionHandlerOptions: {
|
2183
|
+
contentElementId: options.contentElement.get('id'),
|
2184
|
+
tab: 'portrait'
|
2185
|
+
},
|
2186
|
+
positioning: false
|
2187
|
+
});
|
2188
|
+
if (panZoomEnabled) {
|
2189
|
+
this.input('portraitZoom', SliderInputView);
|
2190
|
+
}
|
2191
|
+
this.group('PaletteColor', {
|
2192
|
+
propertyName: 'portraitColor',
|
2193
|
+
entry: options.entry
|
2194
|
+
});
|
2195
|
+
this.input('portraitTooltipReference', SelectInputView, {
|
2196
|
+
values: ['indicator', 'area']
|
2197
|
+
});
|
2198
|
+
this.input('portraitTooltipPosition', SelectInputView, {
|
2199
|
+
values: ['below', 'above']
|
2200
|
+
});
|
2201
|
+
this.input('portraitTooltipMaxWidth', SelectInputView, {
|
2202
|
+
defaultValue: 'medium',
|
2203
|
+
values: ['wide', 'medium', 'narrow', 'veryNarrow']
|
2204
|
+
});
|
2205
|
+
});
|
2206
|
+
}
|
2207
|
+
this.formContainer.show(configurationEditor);
|
2208
|
+
},
|
2209
|
+
goBack: function goBack() {
|
2210
|
+
editor$1.navigate("/scrolled/content_elements/".concat(this.options.contentElement.get('id')), {
|
2211
|
+
trigger: true
|
2212
|
+
});
|
2213
|
+
},
|
2214
|
+
destroyLink: function destroyLink() {
|
2215
|
+
if (window.confirm(I18n.t('pageflow_scrolled.editor.content_elements.hotspots.edit_area.confirm_delete_link'))) {
|
2216
|
+
this.options.collection.remove(this.model);
|
2217
|
+
this.goBack();
|
2218
|
+
}
|
2219
|
+
}
|
2220
|
+
});
|
2221
|
+
|
2222
|
+
var SidebarController$1 = Marionette.Controller.extend({
|
2223
|
+
initialize: function initialize(options) {
|
2224
|
+
this.entry = options.entry;
|
2225
|
+
this.region = options.region;
|
2226
|
+
},
|
2227
|
+
area: function area(id, areaId, tab) {
|
2228
|
+
var contentElement = this.entry.contentElements.get(id);
|
2229
|
+
var areasCollection = AreasCollection.forContentElement(contentElement, this.entry);
|
2230
|
+
this.region.show(new SidebarEditAreaView({
|
2231
|
+
model: areasCollection.get(areaId),
|
2232
|
+
collection: areasCollection,
|
2233
|
+
entry: this.entry,
|
2234
|
+
contentElement: contentElement,
|
2235
|
+
tab: tab
|
2236
|
+
}));
|
2237
|
+
}
|
2238
|
+
});
|
2239
|
+
|
2240
|
+
var img$d = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' version='1.1'%3e %3cpath d='M 63.099609 32 C 28.639609 32 -0.009765625 60.65 -0.009765625 96 L -0.009765625 416 C -0.009765625 451.35 28.641797 480 63.091797 480 L 447.0918 480 C 482.4418 480 511.0918 451.35 511.0918 416 L 511.0918 96 C 511.1009 60.65 483.29961 32 447.09961 32 L 63.099609 32 z M 147.62305 91.271484 C 194.82656 91.271484 233.12305 127.19517 233.12305 171.47461 C 233.12305 207.98427 181.0205 272.98443 158.17578 299.80273 C 152.69839 306.19401 142.54575 306.19401 137.06836 299.80273 C 114.22363 272.98443 62.121094 207.98427 62.121094 171.47461 C 62.121094 127.19517 100.41953 91.271484 147.62305 91.271484 z M 147.62305 133.9043 A 38.686943 36.290436 0 0 0 108.93555 170.19336 A 38.686943 36.290436 0 0 0 147.62305 206.48438 A 38.686943 36.290436 0 0 0 186.30859 170.19336 A 38.686943 36.290436 0 0 0 147.62305 133.9043 z M 364.37695 207.4043 C 411.58047 207.4043 449.87891 243.32993 449.87891 287.60938 C 449.87891 324.11903 397.77637 389.11725 374.93164 415.93555 C 369.45425 422.32683 359.30162 422.32683 353.82422 415.93555 C 330.9795 389.11725 278.87695 324.11903 278.87695 287.60938 C 278.87695 243.32992 317.17343 207.4043 364.37695 207.4043 z M 364.37695 250.03711 A 38.686943 36.290436 0 0 0 325.69141 286.32617 A 38.686943 36.290436 0 0 0 364.37695 322.61719 A 38.686943 36.290436 0 0 0 403.06445 286.32617 A 38.686943 36.290436 0 0 0 364.37695 250.03711 z ' style='fill:white' /%3e%3c/svg%3e";
|
2241
|
+
|
2242
|
+
editor.registerSideBarRouting({
|
2243
|
+
router: SidebarRouter$1,
|
2244
|
+
controller: SidebarController$1
|
2245
|
+
});
|
2246
|
+
editor.contentElementTypes.register('hotspots', {
|
2247
|
+
pictogram: img$d,
|
2248
|
+
category: 'interactive',
|
2249
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right', 'backdrop'],
|
2250
|
+
supportedWidthRange: ['xxs', 'full'],
|
2251
|
+
editorPath: function editorPath(contentElement) {
|
2252
|
+
var activeAreaId = contentElement.transientState.get('activeAreaId');
|
2253
|
+
if (activeAreaId) {
|
2254
|
+
return "/scrolled/hotspots/".concat(contentElement.id, "/").concat(activeAreaId);
|
2255
|
+
}
|
2256
|
+
},
|
2257
|
+
configurationEditor: function configurationEditor(_ref) {
|
2258
|
+
var entry = _ref.entry,
|
2259
|
+
contentElement = _ref.contentElement;
|
2260
|
+
this.tab('general', function () {
|
2261
|
+
this.input('image', FileInputView, {
|
2262
|
+
collection: 'image_files',
|
2263
|
+
fileSelectionHandler: 'contentElementConfiguration',
|
2264
|
+
positioning: false,
|
2265
|
+
dropDownMenuItems: [InlineFileRightsMenuItem]
|
2266
|
+
});
|
2267
|
+
this.input('portraitImage', FileInputView, {
|
2268
|
+
collection: 'image_files',
|
2269
|
+
fileSelectionHandler: 'contentElementConfiguration',
|
2270
|
+
positioning: false
|
2271
|
+
});
|
2272
|
+
this.view(AreasListView, {
|
2273
|
+
configuration: this.model,
|
2274
|
+
contentElement: contentElement,
|
2275
|
+
collection: AreasCollection.forContentElement(contentElement, entry)
|
2276
|
+
});
|
2277
|
+
this.input('invertTooltips', CheckBoxInputView$1);
|
2278
|
+
this.input('enablePanZoom', SelectInputView$1, {
|
2279
|
+
values: ['never', 'phonePlatform', 'always']
|
2280
|
+
});
|
2281
|
+
this.view(SeparatorView$1);
|
2282
|
+
this.input('enableFullscreen', CheckBoxInputView$1, {
|
2283
|
+
disabledBinding: ['position', 'width'],
|
2284
|
+
disabled: function disabled() {
|
2285
|
+
return contentElement.getWidth() === contentElementWidths.full || contentElement.getPosition() === 'backdrop';
|
2286
|
+
},
|
2287
|
+
displayUncheckedIfDisabled: true
|
2288
|
+
});
|
2289
|
+
this.group('ContentElementPosition', {
|
2290
|
+
entry: entry
|
2291
|
+
});
|
2292
|
+
this.view(SeparatorView$1);
|
2293
|
+
this.group('ContentElementCaption', {
|
2294
|
+
entry: entry
|
2295
|
+
});
|
2296
|
+
this.group('ContentElementInlineFileRightsSettings');
|
2297
|
+
});
|
2298
|
+
}
|
2299
|
+
});
|
2300
|
+
editor.registerFileSelectionHandler('hotspotsArea', function (options) {
|
2301
|
+
var contentElement = options.entry.contentElements.get(options.contentElementId);
|
2302
|
+
var areas = AreasCollection.forContentElement(contentElement, options.entry);
|
2303
|
+
this.call = function (file) {
|
2304
|
+
areas.get(options.id).setReference(options.attributeName, file);
|
2305
|
+
};
|
2306
|
+
this.getReferer = function () {
|
2307
|
+
return '/scrolled/hotspots/' + contentElement.id + '/' + options.id + '/' + options.tab;
|
2308
|
+
};
|
2309
|
+
});
|
2310
|
+
|
2311
|
+
var img$e = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3e%3c!--! Font Awesome Pro 6.1.1 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons%2c Inc. --%3e%3cpath fill='white' d='M578.2 66.06C409.8 116.6 230.2 116.6 61.8 66.06C31 56.82 0 79.88 0 112v319.9c0 32.15 30.1 55.21 61.79 45.97c168.4-50.53 347.1-50.53 516.4-.002C608.1 487.2 640 464.1 640 431.1V112C640 79.88 609 56.82 578.2 66.06zM128 224C110.3 224 96 209.7 96 192s14.33-32 32-32c17.68 0 32 14.33 32 32S145.7 224 128 224zM474.3 388.6C423.4 380.3 371.8 376 320 376c-50.45 0-100.7 4.043-150.3 11.93c-14.14 2.246-24.11-13.19-15.78-24.84l49.18-68.56C206.1 290.4 210.9 288 216 288s9.916 2.441 12.93 6.574l32.46 44.51l93.3-139.1C357.7 194.7 362.7 192 368 192s10.35 2.672 13.31 7.125l109.1 165.1C498.1 375.9 488.1 390.8 474.3 388.6z'/%3e%3c/svg%3e";
|
2312
|
+
|
2313
|
+
var aspectRatios = ['wide', 'narrow', 'square', 'portrait'];
|
2314
|
+
editor.contentElementTypes.register('vrImage', {
|
2315
|
+
pictogram: img$e,
|
2316
|
+
category: 'interactive',
|
2317
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right', 'backdrop'],
|
2318
|
+
supportedWidthRange: ['xxs', 'full'],
|
2319
|
+
configurationEditor: function configurationEditor(_ref) {
|
2320
|
+
var entry = _ref.entry;
|
2321
|
+
this.tab('general', function () {
|
2322
|
+
this.input('image', FileInputView, {
|
2323
|
+
collection: 'image_files',
|
2324
|
+
fileSelectionHandler: 'contentElementConfiguration',
|
2325
|
+
filter: 'with_projection',
|
2326
|
+
positioning: false,
|
2327
|
+
dropDownMenuItems: [InlineFileRightsMenuItem]
|
2328
|
+
});
|
2329
|
+
this.input('initialYaw', SliderInputView$1, {
|
2330
|
+
unit: '°',
|
2331
|
+
minValue: -180,
|
2332
|
+
maxValue: 180
|
2333
|
+
});
|
2334
|
+
this.input('initialPitch', SliderInputView$1, {
|
2335
|
+
unit: '°',
|
2336
|
+
minValue: -60,
|
2337
|
+
maxValue: 60
|
2338
|
+
});
|
2339
|
+
this.input('aspectRatio', SelectInputView$1, {
|
2340
|
+
includeBlank: true,
|
2341
|
+
blankTranslationKey: 'pageflow_scrolled.editor.' + 'content_elements.vrImage.' + 'attributes.aspectRatio.blank',
|
2342
|
+
values: aspectRatios
|
2343
|
+
});
|
2344
|
+
this.input('portraitAspectRatio', SelectInputView$1, {
|
2345
|
+
includeBlank: true,
|
2346
|
+
blankTranslationKey: 'pageflow_scrolled.editor.' + 'content_elements.vrImage.' + 'attributes.portraitAspectRatio.blank',
|
2347
|
+
values: aspectRatios
|
2348
|
+
});
|
2349
|
+
this.view(SeparatorView$1);
|
2350
|
+
this.group('ContentElementPosition', {
|
2351
|
+
entry: entry
|
2352
|
+
});
|
2353
|
+
this.view(SeparatorView$1);
|
2354
|
+
this.group('ContentElementCaption', {
|
2355
|
+
entry: entry
|
2356
|
+
});
|
2357
|
+
this.group('ContentElementInlineFileRightsSettings');
|
2358
|
+
});
|
2359
|
+
}
|
2360
|
+
});
|
2361
|
+
editor.fileTypes.modify('image_files', {
|
2362
|
+
configurationEditorInputs: function configurationEditorInputs(model) {
|
2363
|
+
var values = ['equirectangular_mono', 'equirectangular_stereo'];
|
2364
|
+
return [{
|
2365
|
+
name: 'projection',
|
2366
|
+
inputView: SelectInputView$1,
|
2367
|
+
inputViewOptions: {
|
2368
|
+
includeBlank: true,
|
2369
|
+
values: values
|
2370
|
+
}
|
2371
|
+
}];
|
2372
|
+
},
|
2373
|
+
confirmUploadTableColumns: [{
|
2374
|
+
name: 'projection',
|
2375
|
+
cellView: EnumTableCellView
|
2376
|
+
}],
|
2377
|
+
filters: [{
|
2378
|
+
name: 'with_projection',
|
2379
|
+
matches: function matches(file) {
|
2380
|
+
return !!file.configuration.get('projection');
|
2381
|
+
}
|
2382
|
+
}]
|
2383
|
+
});
|
2384
|
+
|
2385
|
+
var img$f = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3e%3c!--! Font Awesome Pro 6.1.1 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons%2c Inc. --%3e%3cpath fill='white' d='M414.8 40.79L286.8 488.8C281.9 505.8 264.2 515.6 247.2 510.8C230.2 505.9 220.4 488.2 225.2 471.2L353.2 23.21C358.1 6.216 375.8-3.624 392.8 1.232C409.8 6.087 419.6 23.8 414.8 40.79H414.8zM518.6 121.4L630.6 233.4C643.1 245.9 643.1 266.1 630.6 278.6L518.6 390.6C506.1 403.1 485.9 403.1 473.4 390.6C460.9 378.1 460.9 357.9 473.4 345.4L562.7 256L473.4 166.6C460.9 154.1 460.9 133.9 473.4 121.4C485.9 108.9 506.1 108.9 518.6 121.4V121.4zM166.6 166.6L77.25 256L166.6 345.4C179.1 357.9 179.1 378.1 166.6 390.6C154.1 403.1 133.9 403.1 121.4 390.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4L121.4 121.4C133.9 108.9 154.1 108.9 166.6 121.4C179.1 133.9 179.1 154.1 166.6 166.6V166.6z'/%3e%3c/svg%3e";
|
2386
|
+
|
2387
|
+
var aspectRatios$1 = ['wide', 'narrow', 'square', 'portrait'];
|
2388
|
+
editor.contentElementTypes.register('iframeEmbed', {
|
2389
|
+
pictogram: img$f,
|
863
2390
|
category: 'interactive',
|
864
2391
|
featureName: 'iframe_embed_content_element',
|
865
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
2392
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
2393
|
+
supportedWidthRange: ['xxs', 'full'],
|
2394
|
+
configurationEditor: function configurationEditor(_ref) {
|
2395
|
+
var entry = _ref.entry;
|
2396
|
+
this.tab('general', function () {
|
2397
|
+
this.input('source', TextInputView);
|
2398
|
+
this.input('requireConsent', CheckBoxInputView);
|
2399
|
+
this.view(InfoBoxView, {
|
2400
|
+
level: 'error',
|
2401
|
+
text: I18n.t('pageflow_scrolled.editor.content_elements.iframeEmbed.help_texts.missingConsentVendor'),
|
2402
|
+
visibleBinding: ['source', 'requireConsent'],
|
2403
|
+
visible: function visible(_ref2) {
|
2404
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
2405
|
+
source = _ref3[0],
|
2406
|
+
requireConsent = _ref3[1];
|
2407
|
+
return source && requireConsent && !entry.consentVendors.fromUrl(source);
|
2408
|
+
}
|
2409
|
+
});
|
2410
|
+
this.input('title', TextInputView);
|
2411
|
+
this.input('aspectRatio', SelectInputView, {
|
2412
|
+
values: aspectRatios$1,
|
2413
|
+
disabledBinding: 'autoResize'
|
2414
|
+
});
|
2415
|
+
this.input('portraitAspectRatio', SelectInputView, {
|
2416
|
+
includeBlank: true,
|
2417
|
+
blankTranslationKey: 'pageflow_scrolled.editor.' + 'content_elements.iframeEmbed.' + 'attributes.portraitAspectRatio.blank',
|
2418
|
+
values: aspectRatios$1,
|
2419
|
+
disabledBinding: 'autoResize'
|
2420
|
+
});
|
2421
|
+
this.input('autoResize', CheckBoxInputView);
|
2422
|
+
this.view(InfoBoxView, {
|
2423
|
+
level: 'info',
|
2424
|
+
text: I18n.t('pageflow_scrolled.editor.content_elements.iframeEmbed.help_texts.autoResize'),
|
2425
|
+
visibleBinding: 'autoResize'
|
2426
|
+
});
|
2427
|
+
this.input('scale', SelectInputView, {
|
2428
|
+
values: ['p100', 'p75', 'p50', 'p33']
|
2429
|
+
});
|
2430
|
+
this.group('ContentElementPosition', {
|
2431
|
+
entry: entry
|
2432
|
+
});
|
2433
|
+
this.view(SeparatorView);
|
2434
|
+
this.group('ContentElementCaption', {
|
2435
|
+
entry: entry
|
2436
|
+
});
|
2437
|
+
});
|
2438
|
+
}
|
2439
|
+
});
|
2440
|
+
|
2441
|
+
var css$6 = ".ItemsListView-module_listContainer__2XDCy {\n}\n";
|
2442
|
+
var styles$6 = {"listContainer":"ItemsListView-module_listContainer__2XDCy"};
|
2443
|
+
styleInject(css$6);
|
2444
|
+
|
2445
|
+
var ItemsListView = Marionette.Layout.extend({
|
2446
|
+
template: function template(data) {
|
2447
|
+
return "\n <div class='".concat(styles$6.listContainer, "'></div>\n <button class=\"").concat(buttonStyles.addButton, "\">\n ").concat(I18n.t('pageflow_scrolled.editor.content_elements.imageGallery.items.add'), "\n </button>\n ");
|
2448
|
+
},
|
2449
|
+
regions: cssModulesUtils.ui(styles$6, 'listContainer'),
|
2450
|
+
events: cssModulesUtils.events(buttonStyles, {
|
2451
|
+
'click addButton': function clickAddButton() {
|
2452
|
+
this.collection.selectImage();
|
2453
|
+
}
|
2454
|
+
}),
|
2455
|
+
onRender: function onRender() {
|
2456
|
+
var _this = this;
|
2457
|
+
this.listContainer.show(new ListView({
|
2458
|
+
label: I18n.t('pageflow_scrolled.editor.content_elements.imageGallery.items.label'),
|
2459
|
+
collection: this.collection,
|
2460
|
+
sortable: true,
|
2461
|
+
onEdit: function onEdit(model) {
|
2462
|
+
editor.navigate("/scrolled/imageGalleries/".concat(_this.options.contentElement.id, "/").concat(model.id), {
|
2463
|
+
trigger: true
|
2464
|
+
});
|
2465
|
+
},
|
2466
|
+
onRemove: function onRemove(model) {
|
2467
|
+
return _this.collection.remove(model);
|
2468
|
+
}
|
2469
|
+
}));
|
2470
|
+
}
|
2471
|
+
});
|
2472
|
+
|
2473
|
+
var Item = Backbone.Model.extend({
|
2474
|
+
mixins: [transientReferences],
|
2475
|
+
thumbnailFile: function thumbnailFile() {
|
2476
|
+
var _this$imageFile;
|
2477
|
+
return (_this$imageFile = this.imageFile()) === null || _this$imageFile === void 0 ? void 0 : _this$imageFile.thumbnailFile();
|
2478
|
+
},
|
2479
|
+
title: function title() {
|
2480
|
+
var _this$imageFile2;
|
2481
|
+
return (_this$imageFile2 = this.imageFile()) === null || _this$imageFile2 === void 0 ? void 0 : _this$imageFile2.title();
|
2482
|
+
},
|
2483
|
+
imageFile: function imageFile() {
|
2484
|
+
return this.collection.entry.imageFiles.getByPermaId(this.get('image'));
|
2485
|
+
}
|
2486
|
+
});
|
2487
|
+
|
2488
|
+
var ItemsCollection = Backbone.Collection.extend({
|
2489
|
+
model: Item,
|
2490
|
+
comparator: 'position',
|
2491
|
+
initialize: function initialize(models, options) {
|
2492
|
+
this.entry = options.entry;
|
2493
|
+
this.contentElement = options.contentElement;
|
2494
|
+
this.listenTo(this, 'add change remove sort', this.updateConfiguration);
|
2495
|
+
this.listenTo(this, 'remove', this.pruneCaptions);
|
2496
|
+
},
|
2497
|
+
updateConfiguration: function updateConfiguration() {
|
2498
|
+
this.contentElement.configuration.set('items', this.toJSON());
|
2499
|
+
},
|
2500
|
+
pruneCaptions: function pruneCaptions() {
|
2501
|
+
this.contentElement.configuration.set('captions', _.pick.apply(_, [this.contentElement.configuration.get('captions') || {}].concat(_toConsumableArray(this.pluck('id')))));
|
2502
|
+
},
|
2503
|
+
selectImage: function selectImage() {
|
2504
|
+
editor$1.selectFile('image_files', 'newImageGalleryItem', {
|
2505
|
+
id: this.contentElement.id
|
2506
|
+
});
|
2507
|
+
},
|
2508
|
+
addWithId: function addWithId(imageFile) {
|
2509
|
+
this.add({
|
2510
|
+
id: this.length ? Math.max.apply(Math, _toConsumableArray(this.pluck('id'))) + 1 : 1,
|
2511
|
+
image: imageFile.get('perma_id')
|
2512
|
+
});
|
2513
|
+
},
|
2514
|
+
saveOrder: function saveOrder() {}
|
2515
|
+
});
|
2516
|
+
ItemsCollection.forContentElement = function (contentElement, entry) {
|
2517
|
+
return new ItemsCollection(contentElement.configuration.get('items') || [], {
|
2518
|
+
entry: entry,
|
2519
|
+
contentElement: contentElement
|
2520
|
+
});
|
2521
|
+
};
|
2522
|
+
var FileSelectionHandler = function FileSelectionHandler(options) {
|
2523
|
+
var contentElement = options.entry.contentElements.get(options.id);
|
2524
|
+
this.call = function (file) {
|
2525
|
+
ItemsCollection.forContentElement(contentElement).addWithId(file);
|
2526
|
+
};
|
2527
|
+
this.getReferer = function () {
|
2528
|
+
return '/scrolled/content_elements/' + contentElement.id;
|
2529
|
+
};
|
2530
|
+
};
|
2531
|
+
editor$1.registerFileSelectionHandler('newImageGalleryItem', FileSelectionHandler);
|
2532
|
+
|
2533
|
+
var SidebarRouter$2 = Marionette.AppRouter.extend({
|
2534
|
+
appRoutes: {
|
2535
|
+
'scrolled/imageGalleries/:id/:item_id': 'item'
|
2536
|
+
}
|
2537
|
+
});
|
2538
|
+
|
2539
|
+
var SidebarEditItemView = Marionette.Layout.extend({
|
2540
|
+
template: function template(data) {
|
2541
|
+
return "\n <a class=\"back\">".concat(I18n.t('pageflow_scrolled.editor.content_elements.imageGallery.edit_item.back'), "</a>\n <a class=\"destroy\">").concat(I18n.t('pageflow_scrolled.editor.content_elements.imageGallery.edit_item.destroy'), "</a>\n\n <div class='form_container'></div>\n ");
|
2542
|
+
},
|
2543
|
+
regions: {
|
2544
|
+
formContainer: '.form_container'
|
2545
|
+
},
|
2546
|
+
events: {
|
2547
|
+
'click a.back': 'goBack',
|
2548
|
+
'click a.destroy': 'destroyLink'
|
2549
|
+
},
|
2550
|
+
onRender: function onRender() {
|
2551
|
+
var options = this.options;
|
2552
|
+
var configurationEditor = new ConfigurationEditorView({
|
2553
|
+
model: this.model,
|
2554
|
+
attributeTranslationKeyPrefixes: ['pageflow_scrolled.editor.content_elements.imageGallery.edit_item.attributes'],
|
2555
|
+
tabTranslationKeyPrefix: 'pageflow_scrolled.editor.content_elements.imageGallery.edit_item.tabs'
|
2556
|
+
});
|
2557
|
+
configurationEditor.tab('item', function () {
|
2558
|
+
this.input('image', FileInputView, {
|
2559
|
+
collection: 'image_files',
|
2560
|
+
fileSelectionHandler: 'imageGalleryItem',
|
2561
|
+
fileSelectionHandlerOptions: {
|
2562
|
+
contentElementId: options.contentElement.get('id')
|
2563
|
+
},
|
2564
|
+
positioning: false
|
2565
|
+
});
|
2566
|
+
this.input('portraitImage', FileInputView, {
|
2567
|
+
collection: 'image_files',
|
2568
|
+
fileSelectionHandler: 'imageGalleryItem',
|
2569
|
+
fileSelectionHandlerOptions: {
|
2570
|
+
contentElementId: options.contentElement.get('id')
|
2571
|
+
},
|
2572
|
+
positioning: false
|
2573
|
+
});
|
2574
|
+
});
|
2575
|
+
this.formContainer.show(configurationEditor);
|
2576
|
+
},
|
2577
|
+
goBack: function goBack() {
|
2578
|
+
editor$1.navigate("/scrolled/content_elements/".concat(this.options.contentElement.get('id')), {
|
2579
|
+
trigger: true
|
2580
|
+
});
|
2581
|
+
},
|
2582
|
+
destroyLink: function destroyLink() {
|
2583
|
+
if (window.confirm(I18n.t('pageflow_scrolled.editor.content_elements.imageGallery.edit_item.confirm_delete_link'))) {
|
2584
|
+
this.options.collection.remove(this.model);
|
2585
|
+
this.goBack();
|
2586
|
+
}
|
2587
|
+
}
|
2588
|
+
});
|
2589
|
+
|
2590
|
+
var SidebarController$2 = Marionette.Controller.extend({
|
2591
|
+
initialize: function initialize(options) {
|
2592
|
+
this.entry = options.entry;
|
2593
|
+
this.region = options.region;
|
2594
|
+
},
|
2595
|
+
item: function item(id, itemId) {
|
2596
|
+
var contentElement = this.entry.contentElements.get(id);
|
2597
|
+
var itemsCollection = ItemsCollection.forContentElement(contentElement, this.entry);
|
2598
|
+
this.region.show(new SidebarEditItemView({
|
2599
|
+
model: itemsCollection.get(itemId),
|
2600
|
+
collection: itemsCollection,
|
2601
|
+
entry: this.entry,
|
2602
|
+
contentElement: contentElement
|
2603
|
+
}));
|
2604
|
+
}
|
2605
|
+
});
|
2606
|
+
|
2607
|
+
var img$g = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3e%3c!--! Font Awesome Pro 6.4.0 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons%2c Inc. --%3e%3cpath fill='white' d='M160 32c-35.3 0-64 28.7-64 64V320c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H160zM396 138.7l96 144c4.9 7.4 5.4 16.8 1.2 24.6S480.9 320 472 320H328 280 200c-9.2 0-17.6-5.3-21.6-13.6s-2.9-18.2 2.9-25.4l64-80c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l17.3 21.6 56-84C360.5 132 368 128 376 128s15.5 4 20 10.7zM192 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120V344c0 75.1 60.9 136 136 136H456c13.3 0 24-10.7 24-24s-10.7-24-24-24H136c-48.6 0-88-39.4-88-88V120z'/%3e%3c/svg%3e";
|
2608
|
+
|
2609
|
+
editor.registerSideBarRouting({
|
2610
|
+
router: SidebarRouter$2,
|
2611
|
+
controller: SidebarController$2
|
2612
|
+
});
|
2613
|
+
editor.contentElementTypes.register('imageGallery', {
|
2614
|
+
pictogram: img$g,
|
2615
|
+
category: 'media',
|
2616
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
866
2617
|
supportedWidthRange: ['xxs', 'full'],
|
867
2618
|
configurationEditor: function configurationEditor(_ref) {
|
868
|
-
var entry = _ref.entry
|
2619
|
+
var entry = _ref.entry,
|
2620
|
+
contentElement = _ref.contentElement;
|
869
2621
|
this.tab('general', function () {
|
870
|
-
this.
|
871
|
-
|
872
|
-
|
873
|
-
level: 'error',
|
874
|
-
text: I18n.t('pageflow_scrolled.editor.content_elements.iframeEmbed.help_texts.missingConsentVendor'),
|
875
|
-
visibleBinding: ['source', 'requireConsent'],
|
876
|
-
visible: function visible(_ref2) {
|
877
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
878
|
-
source = _ref3[0],
|
879
|
-
requireConsent = _ref3[1];
|
880
|
-
|
881
|
-
return source && requireConsent && !entry.consentVendors.fromUrl(source);
|
882
|
-
}
|
2622
|
+
this.view(ItemsListView, {
|
2623
|
+
contentElement: contentElement,
|
2624
|
+
collection: ItemsCollection.forContentElement(this.model.parent, entry)
|
883
2625
|
});
|
884
|
-
this.input('
|
885
|
-
|
886
|
-
values: aspectRatios
|
2626
|
+
this.input('displayPeeks', CheckBoxInputView$1, {
|
2627
|
+
storeInverted: 'hidePeeks'
|
887
2628
|
});
|
888
|
-
this.input('
|
889
|
-
|
890
|
-
|
891
|
-
|
2629
|
+
this.input('displayPaginationIndicator', CheckBoxInputView$1);
|
2630
|
+
this.input('enableFullscreenOnDesktop', CheckBoxInputView$1, {
|
2631
|
+
disabledBinding: ['position', 'width'],
|
2632
|
+
disabled: function disabled() {
|
2633
|
+
return contentElement.getWidth() === contentElementWidths.full;
|
2634
|
+
},
|
2635
|
+
displayUncheckedIfDisabled: true
|
892
2636
|
});
|
893
|
-
this.
|
894
|
-
|
2637
|
+
this.group('ContentElementPosition', {
|
2638
|
+
entry: entry
|
2639
|
+
});
|
2640
|
+
this.view(SeparatorView$1);
|
2641
|
+
this.group('ContentElementCaption', {
|
2642
|
+
entry: entry,
|
2643
|
+
disableWhenNoCaption: false
|
2644
|
+
});
|
2645
|
+
this.group('ContentElementInlineFileRightsSettings', {
|
2646
|
+
entry: entry,
|
2647
|
+
disableWhenNoFileRights: false
|
895
2648
|
});
|
896
|
-
this.group('ContentElementPosition');
|
897
2649
|
});
|
2650
|
+
},
|
2651
|
+
defaultConfig: {
|
2652
|
+
displayPaginationIndicator: true
|
898
2653
|
}
|
899
2654
|
});
|
2655
|
+
editor.registerFileSelectionHandler('imageGalleryItem', function (options) {
|
2656
|
+
var contentElement = options.entry.contentElements.get(options.contentElementId);
|
2657
|
+
var items = ItemsCollection.forContentElement(contentElement, options.entry);
|
2658
|
+
this.call = function (file) {
|
2659
|
+
items.get(options.id).setReference(options.attributeName, file);
|
2660
|
+
};
|
2661
|
+
this.getReferer = function () {
|
2662
|
+
return '/scrolled/imageGalleries/' + contentElement.id + '/' + options.id;
|
2663
|
+
};
|
2664
|
+
});
|
900
2665
|
|
901
|
-
var img$
|
2666
|
+
var img$h = "data:image/svg+xml,%3csvg version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3e %3cpath fill='white' d='M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z'/%3e%3c/svg%3e";
|
902
2667
|
|
903
2668
|
editor.contentElementTypes.register('twitterEmbed', {
|
904
|
-
pictogram: img$
|
2669
|
+
pictogram: img$h,
|
905
2670
|
category: 'media',
|
906
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
907
|
-
configurationEditor: function configurationEditor() {
|
2671
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
2672
|
+
configurationEditor: function configurationEditor(_ref) {
|
2673
|
+
var entry = _ref.entry;
|
908
2674
|
this.tab('general', function () {
|
909
2675
|
this.input('url', UrlInputView, {
|
910
2676
|
supportedHosts: ['http://twitter.com', 'https://twitter.com', 'http://x.com', 'https://x.com'],
|
@@ -912,9 +2678,11 @@ editor.contentElementTypes.register('twitterEmbed', {
|
|
912
2678
|
required: true,
|
913
2679
|
permitHttps: true
|
914
2680
|
});
|
915
|
-
this.group('ContentElementPosition'
|
916
|
-
|
917
|
-
|
2681
|
+
this.group('ContentElementPosition', {
|
2682
|
+
entry: entry
|
2683
|
+
});
|
2684
|
+
this.input('hideConversation', CheckBoxInputView);
|
2685
|
+
this.input('hideMedia', CheckBoxInputView);
|
918
2686
|
});
|
919
2687
|
},
|
920
2688
|
defaultConfig: {
|
@@ -922,26 +2690,84 @@ editor.contentElementTypes.register('twitterEmbed', {
|
|
922
2690
|
}
|
923
2691
|
});
|
924
2692
|
|
925
|
-
var img$
|
2693
|
+
var img$i = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3e%3c!--!Font Awesome Free 6.5.2 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons%2c Inc.--%3e%3cpath fill='white' d='M448 209.9a210.1 210.1 0 0 1 -122.8-39.3V349.4A162.6 162.6 0 1 1 185 188.3V278.2a74.6 74.6 0 1 0 52.2 71.2V0l88 0a121.2 121.2 0 0 0 1.9 22.2h0A122.2 122.2 0 0 0 381 102.4a121.4 121.4 0 0 0 67 20.1z'/%3e%3c/svg%3e";
|
2694
|
+
|
2695
|
+
editor.contentElementTypes.register('tikTokEmbed', {
|
2696
|
+
pictogram: img$i,
|
2697
|
+
category: 'media',
|
2698
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
2699
|
+
supportedWidthRange: ['md', 'full'],
|
2700
|
+
configurationEditor: function configurationEditor(_ref) {
|
2701
|
+
var entry = _ref.entry;
|
2702
|
+
this.tab('general', function () {
|
2703
|
+
this.input('url', UrlInputView, {
|
2704
|
+
supportedHosts: ['https://www.tiktok.com'],
|
2705
|
+
displayPropertyName: 'displayUrl',
|
2706
|
+
required: true,
|
2707
|
+
permitHttps: true
|
2708
|
+
});
|
2709
|
+
this.group('ContentElementPosition', {
|
2710
|
+
entry: entry
|
2711
|
+
});
|
2712
|
+
});
|
2713
|
+
},
|
2714
|
+
defaultConfig: {}
|
2715
|
+
});
|
2716
|
+
|
2717
|
+
var img$j = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e%3csvg xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512' version='1.1'%3e %3cpath style='fill:white%3bstroke-width:1.0715934' d='M 154.45629%2c72.962988 C 141.76916%2c73.980674 134.17753%2c85.77696 126.39089%2c94.31369 115.08265%2c105.89861 104.03984%2c117.73757 92.93941%2c129.52047 75.031239%2c111.21828 59.122369%2c90.77981 39.104383%2c74.658023 24.482281%2c67.834512 6.4140221%2c83.81238 10.775786%2c99.1746 c 2.708951%2c12.98866 15.286417%2c19.97415 22.964661%2c29.74046 17.657732%2c17.41285 32.403074%2c38.12856 52.621136%2c52.73529 10.829773%2c3.83939 22.062597%2c-3.51996 28.134937%2c-12.18527 19.44195%2c-22.50249 42.21653%2c-42.18327 59.90279%2c-66.14032 5.6424%2c-13.25737 -5.31055%2c-30.615753 -19.94302%2c-30.361772 z' /%3e %3cpath style='fill:white' d='M 256%2c428 H 31.999999 C 14.329999%2c428 -9.5000001e-7%2c442.33 -9.5000001e-7%2c460 -9.5000001e-7%2c477.67 14.329999%2c492 31.999999%2c492 H 256 c 17.7%2c0 32%2c-14.33 32%2c-32 0%2c-17.67 -14.3%2c-32 -32%2c-32 z M -9.5000001e-7%2c332 C -9.5000001e-7%2c349.7 14.329999%2c364 31.999999%2c364 H 416 c 17.7%2c0 32%2c-14.3 32%2c-32 0%2c-17.7 -14.3%2c-32 -32%2c-32 H 31.999999 C 14.329999%2c300 -9.5000001e-7%2c314.3 -9.5000001e-7%2c332 Z' /%3e %3cpath style='fill:white%3bstroke:white%3bstroke-width:0' d='m 356.05605%2c1.671899 c -22.75276%2c2.300391 -47.49513%2c-4.661754 -68.50543%2c6.450454 -16.00534%2c8.484395 -29.74636%2c27.036262 -24.98608%2c45.803882 5.50667%2c15.699356 29.05588%2c21.427535 39.82967%2c7.900392 4.46727%2c-4.523763 5.45002%2c-13.464333 13.29935%2c-12.285569 15.47565%2c-0.207336 30.89377%2c0.32159 46.37678%2c-0.223975 7.3323%2c-0.346315 15.23462%2c5.874856 12.62272%2c13.740223 -2.68086%2c9.147994 -13.45058%2c10.823444 -20.24491%2c15.836144 -11.40111%2c6.6584 -24.83231%2c11.40873 -32.94777%2c22.30075 -5.41404%2c11.18313 -4.76974%2c25.17905 -0.0141%2c36.40876 8.15241%2c13.79679 31.57231%2c15.50575 40.17388%2c0.85347 4.19853%2c-4.46787 1.87713%2c-12.57946 8.75385%2c-14.22118 18.79687%2c-10.20424 40.72904%2c-20.78924 48.43263%2c-42.36648 C 431.32621%2c52.120851 413.71956%2c13.332394 382.01823%2c4.732093 373.62266%2c2.216616 364.78493%2c1.519639 356.05609%2c1.671899 Z M 341.22896%2c172.48634 c -21.90876%2c-0.63629 -38.00737%2c26.58485 -26.67177%2c45.4856 9.43025%2c18.07827 37.60246%2c22.17393 50.69123%2c5.8469 12.093%2c-13.5735 9.43272%2c-37.5803 -6.86539%2c-46.64791 -5.10378%2c-3.1728 -11.1363%2c-4.88155 -17.15407%2c-4.68459 z' /%3e%3c/svg%3e";
|
926
2718
|
|
927
2719
|
editor.contentElementTypes.register('question', {
|
928
|
-
pictogram: img$
|
2720
|
+
pictogram: img$j,
|
929
2721
|
supportedPositions: ['inline'],
|
930
2722
|
configurationEditor: function configurationEditor(_ref) {
|
931
2723
|
var entry = _ref.entry,
|
932
|
-
|
2724
|
+
contentElement = _ref.contentElement;
|
933
2725
|
this.tab('general', function () {
|
934
|
-
|
2726
|
+
var modelDelegator = entry.createLegacyTypographyVariantDelegator({
|
2727
|
+
model: this.model,
|
2728
|
+
paletteColorPropertyName: 'color'
|
2729
|
+
});
|
2730
|
+
this.group('ContentElementTypographyVariant', {
|
2731
|
+
entry: entry,
|
2732
|
+
model: modelDelegator,
|
2733
|
+
getPreviewConfiguration: function getPreviewConfiguration(configuration, typographyVariant) {
|
2734
|
+
return _objectSpread2(_objectSpread2({}, configuration), {}, {
|
2735
|
+
expandByDefault: true,
|
2736
|
+
typographyVariant: typographyVariant
|
2737
|
+
});
|
2738
|
+
}
|
2739
|
+
});
|
2740
|
+
this.group('ContentElementTypographySize', {
|
2741
|
+
entry: entry,
|
2742
|
+
model: modelDelegator,
|
2743
|
+
getPreviewConfiguration: function getPreviewConfiguration(configuration, typographySize) {
|
2744
|
+
return _objectSpread2(_objectSpread2({}, configuration), {}, {
|
2745
|
+
expandByDefault: true,
|
2746
|
+
// Ensure size in preview is not overridden by legacy variant
|
2747
|
+
typographyVariant: modelDelegator.get('typographyVariant'),
|
2748
|
+
typographySize: typographySize
|
2749
|
+
});
|
2750
|
+
}
|
2751
|
+
});
|
2752
|
+
this.group('PaletteColor', {
|
2753
|
+
entry: entry,
|
2754
|
+
propertyName: 'color'
|
2755
|
+
});
|
2756
|
+
this.group('PaletteColor', {
|
2757
|
+
entry: entry,
|
2758
|
+
propertyName: 'answerColor'
|
2759
|
+
});
|
2760
|
+
this.input('expandByDefault', CheckBoxInputView);
|
935
2761
|
});
|
936
2762
|
}
|
937
2763
|
});
|
938
2764
|
|
939
|
-
var img$
|
2765
|
+
var img$k = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3e%3cpath fill='white' d='M181.3 32.4c17.4 2.9 29.2 19.4 26.3 36.8L197.8 128h95.1l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3s29.2 19.4 26.3 36.8L357.8 128H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H347.1L325.8 320H384c17.7 0 32 14.3 32 32s-14.3 32-32 32H315.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l9.8-58.7H155.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8L90.2 384H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l21.3-128H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3zM187.1 192L165.8 320h95.1l21.3-128H187.1z'/%3e%3c/svg%3e";
|
940
2766
|
|
941
2767
|
editor.contentElementTypes.register('counter', {
|
942
2768
|
category: 'data',
|
943
|
-
pictogram: img$
|
944
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
2769
|
+
pictogram: img$k,
|
2770
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
945
2771
|
supportedWidthRange: ['xxs', 'full'],
|
946
2772
|
defaultConfig: {
|
947
2773
|
targetValue: 100,
|
@@ -963,6 +2789,9 @@ editor.contentElementTypes.register('counter', {
|
|
963
2789
|
});
|
964
2790
|
})
|
965
2791
|
});
|
2792
|
+
this.input('thousandsSeparators', CheckBoxInputView, {
|
2793
|
+
storeInverted: 'hideThousandsSeparators'
|
2794
|
+
});
|
966
2795
|
this.input('unit', TextInputView);
|
967
2796
|
this.input('unitPlacement', SelectInputView, {
|
968
2797
|
values: ['trailing', 'leading']
|
@@ -1001,16 +2830,18 @@ editor.contentElementTypes.register('counter', {
|
|
1001
2830
|
propertyName: 'numberColor',
|
1002
2831
|
entry: entry
|
1003
2832
|
});
|
1004
|
-
this.group('ContentElementPosition'
|
2833
|
+
this.group('ContentElementPosition', {
|
2834
|
+
entry: entry
|
2835
|
+
});
|
1005
2836
|
});
|
1006
2837
|
}
|
1007
2838
|
});
|
1008
2839
|
|
1009
|
-
var img$
|
2840
|
+
var img$l = "data:image/svg+xml,%3csvg aria-hidden='true' focusable='false' data-prefix='fas' data-icon='quote-right' class='svg-inline--fa fa-quote-right fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 612 612'%3e%3cpath fill='white' d='M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z'%3e%3c/path%3e%3c/svg%3e";
|
1010
2841
|
|
1011
2842
|
editor.contentElementTypes.register('quote', {
|
1012
|
-
pictogram: img$
|
1013
|
-
supportedPositions: ['inline', 'sticky', 'standAlone', 'left', 'right'],
|
2843
|
+
pictogram: img$l,
|
2844
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
1014
2845
|
supportedWidthRange: ['xs', 'xl'],
|
1015
2846
|
defaultConfig: {
|
1016
2847
|
textSize: 'medium'
|
@@ -1024,7 +2855,9 @@ editor.contentElementTypes.register('quote', {
|
|
1024
2855
|
this.input('textSize', SelectInputView, {
|
1025
2856
|
values: ['large', 'medium', 'small', 'verySmall']
|
1026
2857
|
});
|
1027
|
-
this.group('ContentElementPosition'
|
2858
|
+
this.group('ContentElementPosition', {
|
2859
|
+
entry: entry
|
2860
|
+
});
|
1028
2861
|
this.group('PaletteColor', {
|
1029
2862
|
propertyName: 'color',
|
1030
2863
|
entry: entry
|
@@ -1037,123 +2870,44 @@ editor.contentElementTypes.register('quote', {
|
|
1037
2870
|
}
|
1038
2871
|
});
|
1039
2872
|
|
1040
|
-
var
|
1041
|
-
var styles$1 = {"listContainer":"ItemsListView-module_listContainer__2XDCy"};
|
1042
|
-
styleInject(css$1);
|
1043
|
-
|
1044
|
-
var ItemsListView = Marionette.Layout.extend({
|
1045
|
-
template: function template(data) {
|
1046
|
-
return "\n <div class='".concat(styles$1.listContainer, "'></div>\n <button class=\"").concat(buttonStyles.addButton, "\">\n ").concat(I18n.t('pageflow_scrolled.editor.content_elements.imageGallery.items.add'), "\n </button>\n ");
|
1047
|
-
},
|
1048
|
-
regions: cssModulesUtils.ui(styles$1, 'listContainer'),
|
1049
|
-
events: cssModulesUtils.events(buttonStyles, {
|
1050
|
-
'click addButton': function clickAddButton() {
|
1051
|
-
this.collection.selectImage();
|
1052
|
-
}
|
1053
|
-
}),
|
1054
|
-
onRender: function onRender() {
|
1055
|
-
var _this = this;
|
1056
|
-
|
1057
|
-
this.listContainer.show(new ListView({
|
1058
|
-
label: I18n.t('pageflow_scrolled.editor.content_elements.imageGallery.items.label'),
|
1059
|
-
collection: this.collection,
|
1060
|
-
sortable: true,
|
1061
|
-
onRemove: function onRemove(model) {
|
1062
|
-
return _this.collection.remove(model);
|
1063
|
-
}
|
1064
|
-
}));
|
1065
|
-
}
|
1066
|
-
});
|
1067
|
-
|
1068
|
-
var Item = Backbone.Model.extend({
|
1069
|
-
mixins: [transientReferences],
|
1070
|
-
thumbnailFile: function thumbnailFile() {
|
1071
|
-
var _this$imageFile;
|
1072
|
-
|
1073
|
-
return (_this$imageFile = this.imageFile()) === null || _this$imageFile === void 0 ? void 0 : _this$imageFile.thumbnailFile();
|
1074
|
-
},
|
1075
|
-
title: function title() {
|
1076
|
-
var _this$imageFile2;
|
1077
|
-
|
1078
|
-
return (_this$imageFile2 = this.imageFile()) === null || _this$imageFile2 === void 0 ? void 0 : _this$imageFile2.title();
|
1079
|
-
},
|
1080
|
-
imageFile: function imageFile() {
|
1081
|
-
return this.collection.entry.imageFiles.getByPermaId(this.get('image'));
|
1082
|
-
}
|
1083
|
-
});
|
1084
|
-
|
1085
|
-
var ItemsCollection = Backbone.Collection.extend({
|
1086
|
-
model: Item,
|
1087
|
-
comparator: 'position',
|
1088
|
-
initialize: function initialize(models, options) {
|
1089
|
-
this.entry = options.entry;
|
1090
|
-
this.contentElement = options.contentElement;
|
1091
|
-
this.listenTo(this, 'add remove sort', this.updateConfiguration);
|
1092
|
-
this.listenTo(this, 'remove', this.pruneCaptions);
|
1093
|
-
},
|
1094
|
-
updateConfiguration: function updateConfiguration() {
|
1095
|
-
this.contentElement.configuration.set('items', this.toJSON());
|
1096
|
-
},
|
1097
|
-
pruneCaptions: function pruneCaptions() {
|
1098
|
-
this.contentElement.configuration.set('captions', _.pick.apply(_, [this.contentElement.configuration.get('captions') || {}].concat(_toConsumableArray(this.pluck('id')))));
|
1099
|
-
},
|
1100
|
-
selectImage: function selectImage() {
|
1101
|
-
editor$1.selectFile('image_files', 'newImageGalleryItem', {
|
1102
|
-
id: this.contentElement.id
|
1103
|
-
});
|
1104
|
-
},
|
1105
|
-
addWithId: function addWithId(imageFile) {
|
1106
|
-
this.add({
|
1107
|
-
id: this.length ? Math.max.apply(Math, _toConsumableArray(this.pluck('id'))) + 1 : 1,
|
1108
|
-
image: imageFile.get('perma_id')
|
1109
|
-
});
|
1110
|
-
},
|
1111
|
-
saveOrder: function saveOrder() {}
|
1112
|
-
});
|
1113
|
-
|
1114
|
-
ItemsCollection.forContentElement = function (contentElement, entry) {
|
1115
|
-
return new ItemsCollection(contentElement.configuration.get('items') || [], {
|
1116
|
-
entry: entry,
|
1117
|
-
contentElement: contentElement
|
1118
|
-
});
|
1119
|
-
};
|
1120
|
-
|
1121
|
-
var FileSelectionHandler = function FileSelectionHandler(options) {
|
1122
|
-
var contentElement = options.entry.contentElements.get(options.id);
|
1123
|
-
|
1124
|
-
this.call = function (file) {
|
1125
|
-
ItemsCollection.forContentElement(contentElement).addWithId(file);
|
1126
|
-
};
|
1127
|
-
|
1128
|
-
this.getReferer = function () {
|
1129
|
-
return '/scrolled/content_elements/' + contentElement.id;
|
1130
|
-
};
|
1131
|
-
};
|
1132
|
-
|
1133
|
-
editor$1.registerFileSelectionHandler('newImageGalleryItem', FileSelectionHandler);
|
1134
|
-
|
1135
|
-
var img$g = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3e%3c!--! Font Awesome Pro 6.4.0 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons%2c Inc. --%3e%3cpath fill='white' d='M160 32c-35.3 0-64 28.7-64 64V320c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H160zM396 138.7l96 144c4.9 7.4 5.4 16.8 1.2 24.6S480.9 320 472 320H328 280 200c-9.2 0-17.6-5.3-21.6-13.6s-2.9-18.2 2.9-25.4l64-80c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l17.3 21.6 56-84C360.5 132 368 128 376 128s15.5 4 20 10.7zM192 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120V344c0 75.1 60.9 136 136 136H456c13.3 0 24-10.7 24-24s-10.7-24-24-24H136c-48.6 0-88-39.4-88-88V120z'/%3e%3c/svg%3e";
|
2873
|
+
var img$m = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3e%3c!--!Font Awesome Free 6.7.1 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons%2c Inc.--%3e%3cpath fill='white' d='M 446%2c37.9 C 341%2c38.2 236%2c37.8 132%2c38 106%2c38.4 80.7%2c37.3 55.3%2c38.5 26.6%2c42.6 3.13%2c70.8 6.21%2c100 5.84%2c203 5.94%2c305 6.15%2c408 c -0.18%2c12 0.3%2c26 7.25%2c36 11.2%2c20 34.2%2c33 57%2c30 128.6%2c0 256.6%2c0 384.6%2c0 30%2c-4 55%2c-34 51%2c-64 0%2c-107 0%2c-215 0%2c-322.2 C 501%2c59.7 475%2c36.7 446%2c37.9 Z M 60%2c90 c 24.7%2c0 49%2c0 74%2c0 0%2c25 0%2c51 0%2c76 -25%2c0 -50.7%2c0 -76%2c0 0%2c-25 0%2c-51 0%2c-76 h 1 z m 128%2c0 c 89%2c0 177%2c0 266%2c0 0%2c25 0%2c51 0%2c76 -89%2c0 -179%2c0 -268%2c0 0%2c-25 0%2c-51 0%2c-76 h 1 z M 60%2c218 c 24.7%2c0 49%2c0 74%2c0 0%2c25 0%2c51 0%2c76 -25%2c0 -50.7%2c0 -76%2c0 0%2c-25 0%2c-51 0%2c-76 h 1 z m 128%2c0 c 89%2c0 177%2c0 266%2c0 0%2c25 0%2c51 0%2c76 -89%2c0 -179%2c0 -268%2c0 0%2c-25 0%2c-51 0%2c-76 h 1 z M 60%2c346 c 24.7%2c0 49%2c0 74%2c0 0%2c25 0%2c51 0%2c76 -25%2c0 -50.7%2c0 -76%2c0 0%2c-25 0%2c-51 0%2c-76 h 1 z m 128%2c0 c 89%2c0 177%2c0 266%2c0 0%2c25 0%2c51 0%2c76 -89%2c0 -179%2c0 -268%2c0 0%2c-25 0%2c-51 0%2c-76 h 1 z' /%3e%3c/svg%3e";
|
1136
2874
|
|
1137
|
-
editor.contentElementTypes.register('
|
1138
|
-
pictogram: img$
|
1139
|
-
|
1140
|
-
|
1141
|
-
supportedWidthRange: ['xxs', 'full'],
|
2875
|
+
editor.contentElementTypes.register('infoTable', {
|
2876
|
+
pictogram: img$m,
|
2877
|
+
supportedPositions: ['inline', 'side', 'sticky', 'standAlone', 'left', 'right'],
|
2878
|
+
supportedWidthRange: ['s', 'xl'],
|
1142
2879
|
configurationEditor: function configurationEditor(_ref) {
|
1143
2880
|
var entry = _ref.entry,
|
1144
|
-
|
2881
|
+
contentElement = _ref.contentElement;
|
1145
2882
|
this.tab('general', function () {
|
1146
|
-
this.
|
1147
|
-
|
2883
|
+
this.input('labelColumnAlign', SelectInputView, {
|
2884
|
+
values: ['auto', 'left', 'center', 'right']
|
1148
2885
|
});
|
1149
|
-
this.input('
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
2886
|
+
this.input('valueColumnAlign', SelectInputView, {
|
2887
|
+
values: ['auto', 'left', 'center', 'right']
|
2888
|
+
});
|
2889
|
+
this.input('singleColumnInPhoneLayout', CheckBoxInputView);
|
2890
|
+
this.input('singleColumnAlign', SelectInputView, {
|
2891
|
+
values: ['auto', 'left', 'center', 'right'],
|
2892
|
+
visibleBinding: 'singleColumnInPhoneLayout'
|
2893
|
+
});
|
2894
|
+
this.view(SeparatorView);
|
2895
|
+
this.group('PaletteColor', {
|
2896
|
+
propertyName: 'labelColor',
|
2897
|
+
entry: entry
|
2898
|
+
});
|
2899
|
+
this.group('PaletteColor', {
|
2900
|
+
propertyName: 'valueColor',
|
2901
|
+
entry: entry
|
2902
|
+
});
|
2903
|
+
this.view(SeparatorView);
|
2904
|
+
this.group('ContentElementPosition', {
|
2905
|
+
entry: entry
|
2906
|
+
});
|
2907
|
+
this.view(SeparatorView);
|
2908
|
+
this.view(InfoBoxView, {
|
2909
|
+
text: I18n.t('pageflow_scrolled.editor.content_elements.infoTable.help_texts.shortcuts')
|
1155
2910
|
});
|
1156
|
-
this.group('ContentElementPosition');
|
1157
2911
|
});
|
1158
2912
|
}
|
1159
2913
|
});
|