pageflow 15.5.0 → 15.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +219 -87
- data/README.md +1 -2
- data/admins/pageflow/entry.rb +28 -57
- data/admins/pageflow/user.rb +1 -3
- data/app/assets/images/pageflow/admin/icons/buttons/editor.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/buttons/preview.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/buttons/show_public.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/delete.svg +9 -0
- data/app/assets/images/pageflow/admin/icons/done.svg +6 -0
- data/app/assets/images/pageflow/admin/icons/edit.svg +7 -0
- data/app/assets/images/pageflow/admin/icons/editor.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/folder.svg +8 -0
- data/app/assets/images/pageflow/admin/icons/folder_active.svg +8 -0
- data/app/assets/images/pageflow/admin/icons/info.svg +3 -0
- data/app/assets/images/pageflow/admin/icons/new.svg +5 -0
- data/app/assets/images/pageflow/admin/icons/preview.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/published.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/published_with_password.svg +2 -0
- data/app/assets/images/pageflow/admin/icons/show_public.svg +2 -0
- data/app/assets/images/pageflow/editor/blank_entry/logo.png +0 -0
- data/app/assets/images/pageflow/themes/default/embed_opt_in.svg +3 -0
- data/app/assets/images/pageflow/themes/default/embed_opt_out_info.svg +16 -0
- data/app/assets/javascripts/pageflow/admin/entries.js +9 -57
- data/app/assets/javascripts/pageflow/dist/ui.js +127 -10
- data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +18 -16
- data/app/assets/stylesheets/pageflow/admin/badge_list.scss +25 -35
- data/app/assets/stylesheets/pageflow/admin/columns.scss +13 -11
- data/app/assets/stylesheets/pageflow/admin/embed_code.scss +1 -4
- data/app/assets/stylesheets/pageflow/admin/entries/folders.scss +44 -19
- data/app/assets/stylesheets/pageflow/admin/entries.scss +15 -31
- data/app/assets/stylesheets/pageflow/admin/features.scss +3 -1
- data/app/assets/stylesheets/pageflow/admin/forms.scss +14 -12
- data/app/assets/stylesheets/pageflow/admin/hint.scss +8 -14
- data/app/assets/stylesheets/pageflow/admin/icon_button.scss +25 -14
- data/app/assets/stylesheets/pageflow/admin/icon_link.scss +31 -15
- data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +14 -7
- data/app/assets/stylesheets/pageflow/admin/status_tags.scss +5 -4
- data/app/assets/stylesheets/pageflow/admin/tabs_view.scss +36 -34
- data/app/assets/stylesheets/pageflow/admin/tooltip_bubble.scss +15 -11
- data/app/assets/stylesheets/pageflow/admin.scss +12 -0
- data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +15 -61
- data/app/assets/stylesheets/pageflow/editor/base.scss +28 -13
- data/app/assets/stylesheets/pageflow/editor/blank_entry.scss +6 -6
- data/app/assets/stylesheets/pageflow/editor/change_theme.scss +28 -71
- data/app/assets/stylesheets/pageflow/editor/composables.scss +2 -2
- data/app/assets/stylesheets/pageflow/editor/confirm_encoding.scss +18 -36
- data/app/assets/stylesheets/pageflow/editor/confirm_upload.scss +12 -39
- data/app/assets/stylesheets/pageflow/editor/dialogs.scss +39 -12
- data/app/assets/stylesheets/pageflow/editor/disabled_atmo_indicator.scss +3 -3
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +7 -10
- data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +3 -8
- data/app/assets/stylesheets/pageflow/editor/failures.scss +3 -3
- data/app/assets/stylesheets/pageflow/editor/file_import.scss +22 -38
- data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +3 -7
- data/app/assets/stylesheets/pageflow/editor/file_settings_dialog.scss +4 -24
- data/app/assets/stylesheets/pageflow/editor/file_stages.scss +10 -11
- data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +4 -8
- data/app/assets/stylesheets/pageflow/editor/files.scss +7 -6
- data/app/assets/stylesheets/pageflow/editor/files_explorer.scss +13 -30
- data/app/assets/stylesheets/pageflow/editor/files_gallery.scss +15 -11
- data/app/assets/stylesheets/pageflow/editor/filtered_files.scss +6 -7
- data/app/assets/stylesheets/pageflow/editor/help.scss +19 -14
- data/app/assets/stylesheets/pageflow/editor/help_image.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/info_box.scss +19 -0
- data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +7 -11
- data/app/assets/stylesheets/pageflow/editor/inputs/file_processing_state_display.scss +0 -2
- data/app/assets/stylesheets/pageflow/editor/inputs/reference.scss +7 -11
- data/app/assets/stylesheets/pageflow/editor/list.scss +13 -10
- data/app/assets/stylesheets/pageflow/editor/loading.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/locked.scss +9 -5
- data/app/assets/stylesheets/pageflow/editor/menu.scss +5 -5
- data/app/assets/stylesheets/pageflow/editor/notifications.scss +15 -14
- data/app/assets/stylesheets/pageflow/editor/other_entry_item.scss +7 -3
- data/app/assets/stylesheets/pageflow/editor/outline.scss +57 -19
- data/app/assets/stylesheets/pageflow/editor/page_links.scss +10 -8
- data/app/assets/stylesheets/pageflow/editor/page_selection.scss +2 -29
- data/app/assets/stylesheets/pageflow/editor/publish_entry.scss +5 -6
- data/app/assets/stylesheets/pageflow/editor/quotas.scss +2 -3
- data/app/assets/stylesheets/pageflow/editor/select_button.scss +12 -6
- data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +1 -5
- data/app/assets/stylesheets/pageflow/editor/storyline_picker.scss +6 -2
- data/app/assets/stylesheets/pageflow/editor/text_tracks.scss +6 -22
- data/app/assets/stylesheets/pageflow/editor/widgets.scss +2 -2
- data/app/assets/stylesheets/pageflow/editor/wysihtml5.scss +35 -29
- data/app/assets/stylesheets/pageflow/mixins/background_icons.scss +3 -3
- data/app/assets/stylesheets/pageflow/mixins/buttons.scss +50 -68
- data/app/assets/stylesheets/pageflow/themes/default/base.scss +2 -0
- data/app/assets/stylesheets/pageflow/themes/default/consent/bar.scss +156 -0
- data/app/assets/stylesheets/pageflow/themes/default/consent/vendor_list.scss +62 -0
- data/app/assets/stylesheets/pageflow/themes/default/consent.scss +2 -0
- data/app/assets/stylesheets/pageflow/themes/default/logo/alignment.scss +7 -0
- data/app/assets/stylesheets/pageflow/themes/default/page/shadow.scss +44 -0
- data/app/assets/stylesheets/pageflow/themes/default/third_party_embed_consent.scss +103 -0
- data/app/assets/stylesheets/pageflow/ui/forms.scss +79 -84
- data/app/assets/stylesheets/pageflow/ui/functions.scss +56 -0
- data/app/assets/stylesheets/pageflow/ui/input/check_box_group_input.scss +2 -3
- data/app/assets/stylesheets/pageflow/ui/input/color_input.scss +6 -6
- data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.scss +63 -50
- data/app/assets/stylesheets/pageflow/ui/normalize/forms.scss +153 -0
- data/app/assets/stylesheets/pageflow/ui/normalize.scss +278 -0
- data/app/assets/stylesheets/pageflow/ui/properties.scss +44 -0
- data/app/assets/stylesheets/pageflow/ui/table_cells/delete_row_table_cell.scss +1 -1
- data/app/assets/stylesheets/pageflow/ui/table_view.scss +14 -18
- data/app/assets/stylesheets/pageflow/ui/tabs_view.scss +8 -11
- data/app/assets/stylesheets/pageflow/ui/tooltip.scss +6 -8
- data/app/assets/stylesheets/pageflow/ui/validation_error_messages.scss +6 -0
- data/app/assets/stylesheets/pageflow/ui.scss +4 -0
- data/app/controllers/pageflow/edit_locks_controller.rb +3 -1
- data/app/helpers/pageflow/admin/entries_helper.rb +2 -12
- data/app/helpers/pageflow/embed_code_helper.rb +1 -1
- data/app/helpers/pageflow/entries_helper.rb +41 -2
- data/app/helpers/pageflow/file_background_images_helper.rb +1 -1
- data/app/helpers/pageflow/page_types_helper.rb +1 -1
- data/app/helpers/pageflow/themes_helper.rb +1 -1
- data/app/jobs/pageflow/poll_meta_data_from_zencoder_job.rb +1 -1
- data/app/jobs/pageflow/poll_zencoder_job.rb +1 -9
- data/app/models/pageflow/audio_file.rb +17 -0
- data/app/models/pageflow/audio_file_url_templates.rb +4 -1
- data/app/models/pageflow/customized_theme.rb +37 -0
- data/app/models/pageflow/draft_entry.rb +6 -59
- data/app/models/pageflow/entry_at_revision.rb +68 -0
- data/app/models/pageflow/entry_role_query.rb +44 -24
- data/app/models/pageflow/image_file_css_background_image_urls.rb +8 -2
- data/app/models/pageflow/published_entry.rb +9 -56
- data/app/models/pageflow/theme_customization.rb +46 -0
- data/app/models/pageflow/theme_customization_file.rb +58 -0
- data/app/models/pageflow/video_file.rb +11 -1
- data/app/models/pageflow/video_file_url_templates.rb +1 -0
- data/app/policies/pageflow/entry_policy.rb +4 -0
- data/app/state_machines/pageflow/media_encoding_state_machine.rb +23 -4
- data/app/views/admin/entries/_form.html.erb +50 -0
- data/app/views/admin/entries/entry_type_name_input.html.erb +5 -0
- data/app/views/admin/features/_form.html.erb +1 -1
- data/app/views/admin/memberships/_form.html.erb +2 -3
- data/app/views/admin/users/_form.html.erb +1 -1
- data/app/views/admin/users/invitation.html.erb +2 -2
- data/app/views/components/pageflow/admin/entry_user_badge_list.rb +10 -9
- data/app/views/components/pageflow/admin/members_tab.rb +5 -1
- data/app/views/components/pageflow/admin/revisions_tab.rb +13 -3
- data/app/views/components/pageflow/admin/timestamp.rb +20 -0
- data/app/views/components/pageflow/admin/user_account_badge_list.rb +5 -6
- data/app/views/pageflow/admin/entries/_cannot_add_user.html.erb +9 -5
- data/app/views/pageflow/admin/entries/_entry_type_name_input.html.erb +7 -0
- data/app/views/pageflow/audio_files/_audio_file.json.jbuilder +13 -0
- data/app/views/pageflow/editor/encoding_confirmations/_intro.html.erb +0 -0
- data/app/views/pageflow/editor/encoding_confirmations/check.json.jbuilder +14 -2
- data/config/initializers/paperclip.rb +16 -1
- data/config/locales/de.yml +24 -28
- data/config/locales/en.yml +19 -10
- data/db/migrate/20210528073122_create_pageflow_theme_customizations.rb +11 -0
- data/db/migrate/20210531090654_create_pageflow_theme_customization_files.rb +15 -0
- data/db/migrate/20210531102228_add_selected_file_ids_to_theme_customizations.rb +5 -0
- data/db/migrate/20211020085902_add_canonical_entry_url_prefix_to_themings.rb +5 -0
- data/db/migrate/20220503150010_add_peak_data_to_audio_files.rb +5 -0
- data/db/migrate/20220705084830_add_trailing_slash_in_canonical_urls_to_themings.rb +5 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +256 -124
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +566 -167
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +5 -5
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +4 -4
- data/entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb +38 -0
- data/entry_types/paged/app/views/pageflow_paged/third_party_embed_consent/_opt_in.html.erb +12 -0
- data/entry_types/paged/app/views/pageflow_paged/third_party_embed_consent/_opt_out_info.html.erb +10 -0
- data/entry_types/paged/config/initializers/features.rb +2 -0
- data/entry_types/paged/config/locales/new/video_contain.de.yml +7 -0
- data/entry_types/paged/config/locales/new/video_contain.en.yml +7 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +3 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +1 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +58 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +37 -3
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +92 -6
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/webpack_public_path_helper.rb +20 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +7 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +5 -2
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +5 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +5 -4
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +16 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +13 -2
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_widget.json.jbuilder +2 -0
- data/entry_types/scrolled/config/locales/de.yml +1 -8
- data/entry_types/scrolled/config/locales/en.yml +1 -9
- data/entry_types/scrolled/config/locales/new/before_after_slider.de.yml +8 -0
- data/entry_types/scrolled/config/locales/new/before_after_slider.en.yml +8 -0
- data/entry_types/scrolled/config/locales/new/center_ragged.de.yml +8 -0
- data/entry_types/scrolled/config/locales/new/center_ragged.en.yml +9 -0
- data/entry_types/scrolled/config/locales/new/consent.de.yml +25 -0
- data/entry_types/scrolled/config/locales/new/consent.en.yml +24 -0
- data/entry_types/scrolled/config/locales/new/content_element_categories.de.yml +39 -0
- data/entry_types/scrolled/config/locales/new/content_element_categories.en.yml +39 -0
- data/entry_types/scrolled/config/locales/new/default_transition.de.yml +14 -0
- data/entry_types/scrolled/config/locales/new/default_transition.en.yml +14 -0
- data/entry_types/scrolled/config/locales/new/header_line_breaks.de.yml +28 -0
- data/entry_types/scrolled/config/locales/new/header_line_breaks.en.yml +27 -0
- data/entry_types/scrolled/config/locales/new/header_size.de.yml +17 -0
- data/entry_types/scrolled/config/locales/new/header_size.en.yml +17 -0
- data/entry_types/scrolled/config/locales/new/iframe_embed.de.yml +39 -0
- data/entry_types/scrolled/config/locales/new/iframe_embed.en.yml +39 -0
- data/entry_types/scrolled/config/locales/new/inline_loops.de.yml +26 -0
- data/entry_types/scrolled/config/locales/new/inline_loops.en.yml +26 -0
- data/entry_types/scrolled/config/locales/new/portrait_inline_image.de.yml +9 -0
- data/entry_types/scrolled/config/locales/new/portrait_inline_image.en.yml +9 -0
- data/entry_types/scrolled/config/locales/new/section_width.de.yml +10 -0
- data/entry_types/scrolled/config/locales/new/section_width.en.yml +10 -0
- data/entry_types/scrolled/config/locales/new/typography_variants.de.yml +7 -0
- data/entry_types/scrolled/config/locales/new/typography_variants.en.yml +7 -0
- data/entry_types/scrolled/config/locales/new/video_embed_poster.de.yml +8 -0
- data/entry_types/scrolled/config/locales/new/video_embed_poster.en.yml +8 -0
- data/entry_types/scrolled/config/locales/new/waveform_styles.de.yml +11 -0
- data/entry_types/scrolled/config/locales/new/waveform_styles.en.yml +12 -0
- data/entry_types/scrolled/config/locales/new/widgets.de.yml +6 -0
- data/entry_types/scrolled/config/locales/new/widgets.en.yml +6 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +29 -5
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/themes_plugin.rb.tt +8 -6
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +37 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +57 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +49 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +2 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +8 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +42 -0
- data/entry_types/scrolled/lib/pageflow_scrolled.rb +17 -1
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/create_bundle_symlinks_for_yarn.rake +3 -2
- data/entry_types/scrolled/package/config/webpack.js +11 -0
- data/entry_types/scrolled/package/contentElements-editor.js +323 -89
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +719 -529
- data/entry_types/scrolled/package/editor.js +459 -261
- data/entry_types/scrolled/package/frontend/{EditableText-7093fd0e.js → EditableInlineText.module-b9923660.js} +284 -362
- data/entry_types/scrolled/package/frontend/{i18n-4dc6c377.js → PhonePlatformContext-9fb97827.js} +199 -106
- data/entry_types/scrolled/package/frontend/{Viewer-e49e7807.js → Viewer-e2290ea0.js} +196 -79
- data/entry_types/scrolled/package/frontend/{Wavesurfer-0adf5667.js → Wavesurfer-7d9cf1b7.js} +16 -58
- data/entry_types/scrolled/package/frontend/{components-6a6793ca.js → components-6ab26015.js} +664 -671
- data/entry_types/scrolled/package/frontend/{getPrototypeOf-63c7c8e8.js → createSuper-d0f30da3.js} +34 -5
- data/entry_types/scrolled/package/frontend/index.css +1 -9
- data/entry_types/scrolled/package/frontend/index.js +1919 -2386
- data/entry_types/scrolled/package/frontend/{useBrowserFeature-91a4c29d.js → usePhonePlatform-2857c22b.js} +9 -8
- data/entry_types/scrolled/package/frontend-server.js +3 -6
- data/entry_types/scrolled/package/package.json +16 -8
- data/entry_types/scrolled/package/testHelpers.js +456 -0
- data/entry_types/scrolled/package/values/breakpoints.module.css +9 -0
- data/entry_types/scrolled/package/values/colors.module.css +5 -0
- data/entry_types/scrolled/package/widgets/defaultNavigation.css +9 -0
- data/entry_types/scrolled/package/widgets/defaultNavigation.js +612 -0
- data/entry_types/scrolled/spec/fixtures/image.svg +1 -0
- data/lib/pageflow/ability_mixin.rb +4 -0
- data/lib/pageflow/built_in_widget_type.rb +4 -0
- data/lib/pageflow/built_in_widget_types_plugin.rb +7 -0
- data/lib/pageflow/configuration.rb +34 -1
- data/lib/pageflow/entry_type.rb +11 -2
- data/lib/pageflow/entry_type_configuration.rb +2 -0
- data/lib/pageflow/file_type.rb +24 -0
- data/lib/pageflow/paperclip_processors/audio_waveform.rb +42 -0
- data/lib/pageflow/paperclip_processors/noop.rb +10 -0
- data/lib/pageflow/theme_customizations.rb +61 -0
- data/lib/pageflow/version.rb +1 -1
- data/lib/pageflow.rb +9 -0
- data/package/config/jest/index.js +2 -1
- data/package/config/postcss/scaleFunctions.js +71 -0
- data/package/editor.js +95 -85
- data/package/frontend.js +521 -161
- data/package/package.json +5 -3
- data/package/testHelpers.js +26 -5
- data/package/ui.js +124 -11
- data/spec/factories/draft_entries.rb +19 -1
- data/spec/factories/entries.rb +4 -0
- data/spec/factories/published_entries.rb +6 -0
- data/spec/fixtures/audio.ogg +0 -0
- metadata +119 -14
- data/app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder +0 -2
- data/app/views/admin/entries/entry_types.json.jbuilder +0 -4
- data/package/config/jest/transformers/upwardBabel.js +0 -5
data/package/frontend.js
CHANGED
@@ -16,54 +16,216 @@ import 'classlist.js';
|
|
16
16
|
import BackboneEvents from 'backbone-events-standalone';
|
17
17
|
import VideoJS from 'video.js';
|
18
18
|
|
19
|
-
|
20
|
-
if (
|
21
|
-
|
19
|
+
function _defineProperty(obj, key, value) {
|
20
|
+
if (key in obj) {
|
21
|
+
Object.defineProperty(obj, key, {
|
22
|
+
value: value,
|
23
|
+
enumerable: true,
|
24
|
+
configurable: true,
|
25
|
+
writable: true
|
26
|
+
});
|
27
|
+
} else {
|
28
|
+
obj[key] = value;
|
22
29
|
}
|
23
|
-
};
|
24
|
-
var debugMode = function debugMode() {
|
25
|
-
return window.location.href.indexOf('debug=true') >= 0;
|
26
|
-
};
|
27
30
|
|
28
|
-
|
31
|
+
return obj;
|
32
|
+
}
|
29
33
|
|
30
|
-
|
34
|
+
function ownKeys(object, enumerableOnly) {
|
35
|
+
var keys = Object.keys(object);
|
31
36
|
|
32
|
-
|
33
|
-
var
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
if (Object.getOwnPropertySymbols) {
|
38
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
39
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
40
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
41
|
+
});
|
42
|
+
keys.push.apply(keys, symbols);
|
43
|
+
}
|
38
44
|
|
45
|
+
return keys;
|
46
|
+
}
|
39
47
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
if (
|
45
|
-
|
48
|
+
function _objectSpread2(target) {
|
49
|
+
for (var i = 1; i < arguments.length; i++) {
|
50
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
51
|
+
|
52
|
+
if (i % 2) {
|
53
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
54
|
+
_defineProperty(target, key, source[key]);
|
55
|
+
});
|
56
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
57
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
58
|
+
} else {
|
59
|
+
ownKeys(Object(source)).forEach(function (key) {
|
60
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
61
|
+
});
|
46
62
|
}
|
63
|
+
}
|
64
|
+
|
65
|
+
return target;
|
66
|
+
}
|
67
|
+
|
68
|
+
function _classCallCheck(instance, Constructor) {
|
69
|
+
if (!(instance instanceof Constructor)) {
|
70
|
+
throw new TypeError("Cannot call a class as a function");
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
function _defineProperties(target, props) {
|
75
|
+
for (var i = 0; i < props.length; i++) {
|
76
|
+
var descriptor = props[i];
|
77
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
78
|
+
descriptor.configurable = true;
|
79
|
+
if ("value" in descriptor) descriptor.writable = true;
|
80
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
85
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
86
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
87
|
+
return Constructor;
|
88
|
+
}
|
89
|
+
|
90
|
+
function _arrayWithHoles(arr) {
|
91
|
+
if (Array.isArray(arr)) return arr;
|
92
|
+
}
|
93
|
+
|
94
|
+
function _iterableToArrayLimit(arr, i) {
|
95
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
96
|
+
var _arr = [];
|
97
|
+
var _n = true;
|
98
|
+
var _d = false;
|
99
|
+
var _e = undefined;
|
100
|
+
|
101
|
+
try {
|
102
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
103
|
+
_arr.push(_s.value);
|
104
|
+
|
105
|
+
if (i && _arr.length === i) break;
|
106
|
+
}
|
107
|
+
} catch (err) {
|
108
|
+
_d = true;
|
109
|
+
_e = err;
|
110
|
+
} finally {
|
111
|
+
try {
|
112
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
113
|
+
} finally {
|
114
|
+
if (_d) throw _e;
|
115
|
+
}
|
116
|
+
}
|
47
117
|
|
48
|
-
|
118
|
+
return _arr;
|
119
|
+
}
|
120
|
+
|
121
|
+
function _arrayLikeToArray(arr, len) {
|
122
|
+
if (len == null || len > arr.length) len = arr.length;
|
123
|
+
|
124
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
125
|
+
arr2[i] = arr[i];
|
126
|
+
}
|
127
|
+
|
128
|
+
return arr2;
|
129
|
+
}
|
49
130
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
131
|
+
function _unsupportedIterableToArray(o, minLen) {
|
132
|
+
if (!o) return;
|
133
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
134
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
135
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
136
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
137
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
138
|
+
}
|
139
|
+
|
140
|
+
function _nonIterableRest() {
|
141
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
142
|
+
}
|
143
|
+
|
144
|
+
function _slicedToArray(arr, i) {
|
145
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
146
|
+
}
|
55
147
|
|
56
|
-
|
57
|
-
|
58
|
-
|
148
|
+
var Persistence = /*#__PURE__*/function () {
|
149
|
+
function Persistence(_ref) {
|
150
|
+
var cookies = _ref.cookies;
|
59
151
|
|
60
|
-
|
61
|
-
|
62
|
-
|
152
|
+
_classCallCheck(this, Persistence);
|
153
|
+
|
154
|
+
this.cookies = cookies;
|
155
|
+
}
|
156
|
+
|
157
|
+
_createClass(Persistence, [{
|
158
|
+
key: "store",
|
159
|
+
value: function store(vendors, signal) {
|
160
|
+
var _this = this;
|
161
|
+
|
162
|
+
var vendorsByCookieName = vendors.reduce(function (sorted, vendor) {
|
163
|
+
var cookieName = vendor.cookieName;
|
164
|
+
sorted[cookieName] = sorted[cookieName] || [];
|
165
|
+
sorted[cookieName].push(vendor);
|
166
|
+
return sorted;
|
167
|
+
}, {});
|
168
|
+
Object.entries(vendorsByCookieName).forEach(function (_ref2) {
|
169
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
170
|
+
cookieName = _ref3[0],
|
171
|
+
vendors = _ref3[1];
|
172
|
+
|
173
|
+
var cookieDomain = vendors[0].cookieDomain;
|
174
|
+
|
175
|
+
_this.setCookie(cookieName, JSON.stringify(vendors.reduce(function (result, vendor) {
|
176
|
+
result[vendor.cookieKey || vendor.name] = signal === 'accepted' ? true : signal === 'denied' ? false : signal[vendor.name];
|
177
|
+
return result;
|
178
|
+
}, {})), cookieDomain);
|
179
|
+
});
|
180
|
+
}
|
181
|
+
}, {
|
182
|
+
key: "update",
|
183
|
+
value: function update(vendor, signal) {
|
184
|
+
var content = this.cookies.getItem(vendor.cookieName);
|
185
|
+
var flags = content ? JSON.parse(content) : {};
|
186
|
+
this.setCookie(vendor.cookieName, JSON.stringify(_objectSpread2(_objectSpread2({}, flags), {}, _defineProperty({}, vendor.cookieKey || vendor.name, signal))), vendor.cookieDomain);
|
187
|
+
}
|
188
|
+
}, {
|
189
|
+
key: "read",
|
190
|
+
value: function read(vendor) {
|
191
|
+
var content = this.cookies.getItem(vendor.cookieName);
|
192
|
+
var flags = content ? JSON.parse(content) : {};
|
193
|
+
var flag = flags[vendor.cookieKey || vendor.name];
|
194
|
+
return flag === true ? 'accepted' : flag === false ? 'denied' : 'undecided';
|
195
|
+
}
|
196
|
+
}, {
|
197
|
+
key: "setCookie",
|
198
|
+
value: function setCookie(name, value, domain) {
|
199
|
+
if (domain && !window.location.hostname.match(new RegExp("".concat(domain, "$")))) {
|
200
|
+
domain = null;
|
63
201
|
}
|
202
|
+
|
203
|
+
this.cookies.setItem(name, value, {
|
204
|
+
path: '/',
|
205
|
+
domain: domain,
|
206
|
+
expires: Infinity,
|
207
|
+
// Ensure cookie can be read iframe embed
|
208
|
+
sameSite: 'None',
|
209
|
+
secure: true
|
210
|
+
});
|
64
211
|
}
|
212
|
+
}]);
|
213
|
+
|
214
|
+
return Persistence;
|
215
|
+
}();
|
216
|
+
|
217
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
|
218
|
+
var cookies = {
|
219
|
+
getItem: function getItem(sKey) {
|
220
|
+
if (!sKey) {
|
221
|
+
return null;
|
222
|
+
} // eslint-disable-next-line no-useless-escape
|
223
|
+
|
65
224
|
|
66
|
-
document.cookie
|
225
|
+
return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
|
226
|
+
},
|
227
|
+
setItem: function setItem() {
|
228
|
+
document.cookie = setItemCookieString.apply(void 0, arguments);
|
67
229
|
return true;
|
68
230
|
},
|
69
231
|
removeItem: function removeItem(sKey, sPath, sDomain) {
|
@@ -93,6 +255,309 @@ var cookies = {
|
|
93
255
|
return aKeys;
|
94
256
|
}
|
95
257
|
};
|
258
|
+
function setItemCookieString(key, value, expiresOrOptions, path, domain, secure) {
|
259
|
+
if (expiresOrOptions && typeof expiresOrOptions === 'object' && expiresOrOptions.constructor !== Date) {
|
260
|
+
return setItemCookieStringWithOptions(key, value, expiresOrOptions);
|
261
|
+
} else {
|
262
|
+
return setItemCookieStringWithOptions(key, value, {
|
263
|
+
expires: expiresOrOptions,
|
264
|
+
path: path,
|
265
|
+
domain: domain,
|
266
|
+
secure: secure
|
267
|
+
});
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
function setItemCookieStringWithOptions(key, value, _ref) {
|
272
|
+
var expires = _ref.expires,
|
273
|
+
path = _ref.path,
|
274
|
+
domain = _ref.domain,
|
275
|
+
secure = _ref.secure,
|
276
|
+
sameSite = _ref.sameSite;
|
277
|
+
var expiresPart = "";
|
278
|
+
|
279
|
+
if (expires) {
|
280
|
+
switch (expires.constructor) {
|
281
|
+
case Number:
|
282
|
+
expiresPart = expires === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + expires;
|
283
|
+
break;
|
284
|
+
|
285
|
+
case String:
|
286
|
+
expiresPart = "; expires=" + expires;
|
287
|
+
break;
|
288
|
+
|
289
|
+
case Date:
|
290
|
+
expiresPart = "; expires=" + expires.toUTCString();
|
291
|
+
break;
|
292
|
+
}
|
293
|
+
}
|
294
|
+
|
295
|
+
return encodeURIComponent(key) + "=" + encodeURIComponent(value) + expiresPart + (domain ? "; domain=" + domain : "") + (path ? "; path=" + path : "") + (sameSite ? "; SameSite=" + sameSite : "") + (secure ? "; Secure" : "");
|
296
|
+
}
|
297
|
+
|
298
|
+
var supportedParadigms = ['external opt-out', 'opt-in', 'lazy opt-in', 'skip'];
|
299
|
+
var Consent = /*#__PURE__*/function () {
|
300
|
+
function Consent(_ref) {
|
301
|
+
var _this = this;
|
302
|
+
|
303
|
+
var cookies = _ref.cookies,
|
304
|
+
inEditor = _ref.inEditor;
|
305
|
+
|
306
|
+
_classCallCheck(this, Consent);
|
307
|
+
|
308
|
+
this.requestedPromise = new Promise(function (resolve) {
|
309
|
+
_this.requestedPromiseResolve = resolve;
|
310
|
+
});
|
311
|
+
this.vendors = [];
|
312
|
+
this.persistence = new Persistence({
|
313
|
+
cookies: cookies
|
314
|
+
});
|
315
|
+
this.emitter = _objectSpread2({}, BackboneEvents);
|
316
|
+
this.inEditor = inEditor;
|
317
|
+
}
|
318
|
+
|
319
|
+
_createClass(Consent, [{
|
320
|
+
key: "registerVendor",
|
321
|
+
value: function registerVendor(name, _ref2) {
|
322
|
+
var displayName = _ref2.displayName,
|
323
|
+
description = _ref2.description,
|
324
|
+
paradigm = _ref2.paradigm,
|
325
|
+
cookieName = _ref2.cookieName,
|
326
|
+
cookieKey = _ref2.cookieKey,
|
327
|
+
cookieDomain = _ref2.cookieDomain;
|
328
|
+
|
329
|
+
if (this.vendorRegistrationClosed) {
|
330
|
+
throw new Error("Vendor ".concat(name, " has been registered after ") + 'registration has been closed.');
|
331
|
+
}
|
332
|
+
|
333
|
+
if (!name.match(/^[a-z0-9-_]+$/i)) {
|
334
|
+
throw new Error("Invalid vendor name '".concat(name, "'. ") + 'Only letters, numbers, hyphens and underscores are allowed.');
|
335
|
+
}
|
336
|
+
|
337
|
+
if (supportedParadigms.indexOf(paradigm) < 0) {
|
338
|
+
throw new Error("unknown paradigm ".concat(paradigm));
|
339
|
+
}
|
340
|
+
|
341
|
+
this.vendors.push({
|
342
|
+
displayName: displayName,
|
343
|
+
description: description,
|
344
|
+
name: name,
|
345
|
+
paradigm: paradigm,
|
346
|
+
cookieName: cookieName || 'pageflow_consent',
|
347
|
+
cookieKey: cookieKey,
|
348
|
+
cookieDomain: cookieDomain
|
349
|
+
});
|
350
|
+
}
|
351
|
+
}, {
|
352
|
+
key: "closeVendorRegistration",
|
353
|
+
value: function closeVendorRegistration() {
|
354
|
+
var _this2 = this;
|
355
|
+
|
356
|
+
this.vendorRegistrationClosed = true;
|
357
|
+
|
358
|
+
if (!this.getUndecidedOptInVendors().length) {
|
359
|
+
this.triggerDecisionEvents();
|
360
|
+
return;
|
361
|
+
}
|
362
|
+
|
363
|
+
var vendors = this.getRequestedVendors();
|
364
|
+
this.requestedPromiseResolve({
|
365
|
+
vendors: this.withState(vendors),
|
366
|
+
acceptAll: function acceptAll() {
|
367
|
+
_this2.persistence.store(vendors, 'accepted');
|
368
|
+
|
369
|
+
_this2.triggerDecisionEvents();
|
370
|
+
},
|
371
|
+
denyAll: function denyAll() {
|
372
|
+
_this2.persistence.store(vendors, 'denied');
|
373
|
+
|
374
|
+
_this2.triggerDecisionEvents();
|
375
|
+
},
|
376
|
+
save: function save(vendorConsent) {
|
377
|
+
_this2.persistence.store(vendors, vendorConsent);
|
378
|
+
|
379
|
+
_this2.triggerDecisionEvents();
|
380
|
+
}
|
381
|
+
});
|
382
|
+
}
|
383
|
+
}, {
|
384
|
+
key: "relevantVendors",
|
385
|
+
value: function relevantVendors() {
|
386
|
+
var _this3 = this;
|
387
|
+
|
388
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
389
|
+
additionalVendorNames = _ref3.include;
|
390
|
+
|
391
|
+
return this.withState(this.vendors.filter(function (vendor) {
|
392
|
+
return (additionalVendorNames === null || additionalVendorNames === void 0 ? void 0 : additionalVendorNames.includes(vendor.name)) || vendor.paradigm === 'opt-in' || vendor.paradigm === 'external opt-out' || vendor.paradigm === 'lazy opt-in' && _this3.persistence.read(vendor) !== 'undecided';
|
393
|
+
}));
|
394
|
+
}
|
395
|
+
}, {
|
396
|
+
key: "require",
|
397
|
+
value: function require(vendorName) {
|
398
|
+
var _this4 = this;
|
399
|
+
|
400
|
+
if (this.inEditor) {
|
401
|
+
return Promise.resolve('fulfilled');
|
402
|
+
}
|
403
|
+
|
404
|
+
var vendor = this.findVendor(vendorName, 'require consent for');
|
405
|
+
|
406
|
+
switch (vendor.paradigm) {
|
407
|
+
case 'opt-in':
|
408
|
+
case 'lazy opt-in':
|
409
|
+
if (this.getUndecidedOptInVendors().length) {
|
410
|
+
return new Promise(function (resolve) {
|
411
|
+
_this4.emitter.once("".concat(vendor.name, ":accepted"), function () {
|
412
|
+
return resolve('fulfilled');
|
413
|
+
});
|
414
|
+
|
415
|
+
_this4.emitter.once("".concat(vendor.name, ":denied"), function () {
|
416
|
+
return resolve('failed');
|
417
|
+
});
|
418
|
+
});
|
419
|
+
}
|
420
|
+
|
421
|
+
if (this.persistence.read(vendor) === 'accepted') {
|
422
|
+
return Promise.resolve('fulfilled');
|
423
|
+
} else {
|
424
|
+
return Promise.resolve('failed');
|
425
|
+
}
|
426
|
+
|
427
|
+
case 'external opt-out':
|
428
|
+
if (this.persistence.read(vendor) === 'denied') {
|
429
|
+
return Promise.resolve('failed');
|
430
|
+
}
|
431
|
+
|
432
|
+
return Promise.resolve('fulfilled');
|
433
|
+
|
434
|
+
case 'skip':
|
435
|
+
return Promise.resolve('fulfilled');
|
436
|
+
|
437
|
+
default:
|
438
|
+
// should not be used
|
439
|
+
return null;
|
440
|
+
}
|
441
|
+
}
|
442
|
+
}, {
|
443
|
+
key: "requireAccepted",
|
444
|
+
value: function requireAccepted(vendorName) {
|
445
|
+
var _this5 = this;
|
446
|
+
|
447
|
+
if (this.inEditor) {
|
448
|
+
return Promise.resolve('fulfilled');
|
449
|
+
}
|
450
|
+
|
451
|
+
var vendor = this.findVendor(vendorName, 'require consent for');
|
452
|
+
|
453
|
+
if (vendor.paradigm === 'opt-in' || vendor.paradigm === 'lazy opt-in') {
|
454
|
+
if (this.getUndecidedOptInVendors().length || this.persistence.read(vendor) !== 'accepted') {
|
455
|
+
return new Promise(function (resolve) {
|
456
|
+
_this5.emitter.once("".concat(vendor.name, ":accepted"), function () {
|
457
|
+
return resolve('fulfilled');
|
458
|
+
});
|
459
|
+
});
|
460
|
+
}
|
461
|
+
|
462
|
+
return Promise.resolve('fulfilled');
|
463
|
+
} else {
|
464
|
+
return this.require(vendorName);
|
465
|
+
}
|
466
|
+
}
|
467
|
+
}, {
|
468
|
+
key: "requested",
|
469
|
+
value: function requested() {
|
470
|
+
return this.requestedPromise;
|
471
|
+
}
|
472
|
+
}, {
|
473
|
+
key: "accept",
|
474
|
+
value: function accept(vendorName) {
|
475
|
+
var vendor = this.findVendor(vendorName, 'accept');
|
476
|
+
this.persistence.update(vendor, true);
|
477
|
+
this.emitter.trigger("".concat(vendor.name, ":accepted"));
|
478
|
+
}
|
479
|
+
}, {
|
480
|
+
key: "deny",
|
481
|
+
value: function deny(vendorName) {
|
482
|
+
var vendor = this.findVendor(vendorName, 'deny');
|
483
|
+
this.persistence.update(vendor, false);
|
484
|
+
}
|
485
|
+
}, {
|
486
|
+
key: "getRequestedVendors",
|
487
|
+
value: function getRequestedVendors() {
|
488
|
+
return this.vendors.filter(function (vendor) {
|
489
|
+
return vendor.paradigm !== 'skip';
|
490
|
+
});
|
491
|
+
}
|
492
|
+
}, {
|
493
|
+
key: "getUndecidedOptInVendors",
|
494
|
+
value: function getUndecidedOptInVendors() {
|
495
|
+
var _this6 = this;
|
496
|
+
|
497
|
+
return this.vendors.filter(function (vendor) {
|
498
|
+
return vendor.paradigm === 'opt-in' && _this6.persistence.read(vendor) === 'undecided';
|
499
|
+
});
|
500
|
+
}
|
501
|
+
}, {
|
502
|
+
key: "triggerDecisionEvents",
|
503
|
+
value: function triggerDecisionEvents() {
|
504
|
+
var _this7 = this;
|
505
|
+
|
506
|
+
this.vendors.filter(function (vendor) {
|
507
|
+
return vendor.paradigm !== 'skip';
|
508
|
+
}).forEach(function (vendor) {
|
509
|
+
_this7.emitter.trigger("".concat(vendor.name, ":").concat(_this7.persistence.read(vendor)));
|
510
|
+
});
|
511
|
+
}
|
512
|
+
}, {
|
513
|
+
key: "findVendor",
|
514
|
+
value: function findVendor(vendorName, actionForErrorMessage) {
|
515
|
+
var vendor = this.vendors.find(function (vendor) {
|
516
|
+
return vendor.name === vendorName;
|
517
|
+
});
|
518
|
+
|
519
|
+
if (!vendor) {
|
520
|
+
throw new Error("Cannot ".concat(actionForErrorMessage, " unknown vendor \"").concat(vendorName, "\". ") + 'Consider using consent.registerVendor.');
|
521
|
+
}
|
522
|
+
|
523
|
+
return vendor;
|
524
|
+
}
|
525
|
+
}, {
|
526
|
+
key: "withState",
|
527
|
+
value: function withState(vendors) {
|
528
|
+
var _this8 = this;
|
529
|
+
|
530
|
+
return vendors.map(function (vendor) {
|
531
|
+
return _objectSpread2(_objectSpread2({}, vendor), {}, {
|
532
|
+
state: _this8.persistence.read(vendor)
|
533
|
+
});
|
534
|
+
});
|
535
|
+
}
|
536
|
+
}]);
|
537
|
+
|
538
|
+
return Consent;
|
539
|
+
}();
|
540
|
+
|
541
|
+
Consent.create = function () {
|
542
|
+
var inEditor = typeof PAGEFLOW_EDITOR !== 'undefined' && PAGEFLOW_EDITOR;
|
543
|
+
return new Consent({
|
544
|
+
cookies: cookies,
|
545
|
+
inEditor: inEditor
|
546
|
+
});
|
547
|
+
};
|
548
|
+
|
549
|
+
var log = function log(text, options) {
|
550
|
+
if (window.console && (debugMode() || options && options.force)) {
|
551
|
+
window.console.log(text);
|
552
|
+
}
|
553
|
+
};
|
554
|
+
var debugMode = function debugMode() {
|
555
|
+
return window.location.href.indexOf('debug=true') >= 0;
|
556
|
+
};
|
557
|
+
|
558
|
+
var state = typeof window !== 'undefined' && window.pageflow || {};
|
559
|
+
|
560
|
+
var assetUrls = state.assetUrls || {};
|
96
561
|
|
97
562
|
var events = Object.assign({}, BackboneEvents);
|
98
563
|
|
@@ -149,6 +614,14 @@ var Agent = function Agent(userAgent) {
|
|
149
614
|
matchesiPadSafari13AndAbove();
|
150
615
|
},
|
151
616
|
|
617
|
+
/**
|
618
|
+
* Returns true on Android.
|
619
|
+
* @return {boolean}
|
620
|
+
*/
|
621
|
+
matchesAndroid: function matchesAndroid() {
|
622
|
+
return matches(/Android/i);
|
623
|
+
},
|
624
|
+
|
152
625
|
/**
|
153
626
|
* Returns true on iOS or Android.
|
154
627
|
* @return {boolean}
|
@@ -365,9 +838,7 @@ var browser = function () {
|
|
365
838
|
});
|
366
839
|
};
|
367
840
|
|
368
|
-
asyncHas.all = function ()
|
369
|
-
/* arguments */
|
370
|
-
{
|
841
|
+
asyncHas.all = function () {
|
371
842
|
return Promise.all(arguments).then(function (results) {
|
372
843
|
return results.every(function (result) {
|
373
844
|
return result;
|
@@ -486,9 +957,6 @@ browser.feature('mp4 support only', function (has) {
|
|
486
957
|
browser.feature('mse and native hls support', function (has) {
|
487
958
|
return agent.matchesSafari() && !agent.matchesMobilePlatform();
|
488
959
|
});
|
489
|
-
browser.feature('hls support', function (has) {
|
490
|
-
return agent.matchesSafari() || agent.matchesMobilePlatform();
|
491
|
-
});
|
492
960
|
browser.feature('native video player', function (has) {
|
493
961
|
return has('iphone platform');
|
494
962
|
});
|
@@ -503,28 +971,6 @@ browser.feature('audio context volume fading support', function () {
|
|
503
971
|
browser.agent = agent;
|
504
972
|
browser.Agent = Agent;
|
505
973
|
|
506
|
-
function _classCallCheck(instance, Constructor) {
|
507
|
-
if (!(instance instanceof Constructor)) {
|
508
|
-
throw new TypeError("Cannot call a class as a function");
|
509
|
-
}
|
510
|
-
}
|
511
|
-
|
512
|
-
function _defineProperties(target, props) {
|
513
|
-
for (var i = 0; i < props.length; i++) {
|
514
|
-
var descriptor = props[i];
|
515
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
516
|
-
descriptor.configurable = true;
|
517
|
-
if ("value" in descriptor) descriptor.writable = true;
|
518
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
519
|
-
}
|
520
|
-
}
|
521
|
-
|
522
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
523
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
524
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
525
|
-
return Constructor;
|
526
|
-
}
|
527
|
-
|
528
974
|
/**
|
529
975
|
* Let plugins register functions which extend the editor or
|
530
976
|
* slideshow with certain functionality when a named feature is
|
@@ -534,9 +980,7 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
534
980
|
* @since 0.9
|
535
981
|
*/
|
536
982
|
|
537
|
-
var Features =
|
538
|
-
/*#__PURE__*/
|
539
|
-
function () {
|
983
|
+
var Features = /*#__PURE__*/function () {
|
540
984
|
/** @lends pageflow.features */
|
541
985
|
|
542
986
|
/** @api private */
|
@@ -554,9 +998,7 @@ function () {
|
|
554
998
|
|
555
999
|
_createClass(Features, [{
|
556
1000
|
key: "has",
|
557
|
-
value: function has()
|
558
|
-
/* arguments */
|
559
|
-
{
|
1001
|
+
value: function has() {
|
560
1002
|
return browser.has.apply(browser, arguments);
|
561
1003
|
}
|
562
1004
|
/**
|
@@ -607,61 +1049,10 @@ function () {
|
|
607
1049
|
}();
|
608
1050
|
var features = new Features();
|
609
1051
|
|
610
|
-
function _defineProperty(obj, key, value) {
|
611
|
-
if (key in obj) {
|
612
|
-
Object.defineProperty(obj, key, {
|
613
|
-
value: value,
|
614
|
-
enumerable: true,
|
615
|
-
configurable: true,
|
616
|
-
writable: true
|
617
|
-
});
|
618
|
-
} else {
|
619
|
-
obj[key] = value;
|
620
|
-
}
|
621
|
-
|
622
|
-
return obj;
|
623
|
-
}
|
624
|
-
|
625
|
-
function ownKeys(object, enumerableOnly) {
|
626
|
-
var keys = Object.keys(object);
|
627
|
-
|
628
|
-
if (Object.getOwnPropertySymbols) {
|
629
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
630
|
-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
631
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
632
|
-
});
|
633
|
-
keys.push.apply(keys, symbols);
|
634
|
-
}
|
635
|
-
|
636
|
-
return keys;
|
637
|
-
}
|
638
|
-
|
639
|
-
function _objectSpread2(target) {
|
640
|
-
for (var i = 1; i < arguments.length; i++) {
|
641
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
642
|
-
|
643
|
-
if (i % 2) {
|
644
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
645
|
-
_defineProperty(target, key, source[key]);
|
646
|
-
});
|
647
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
648
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
649
|
-
} else {
|
650
|
-
ownKeys(Object(source)).forEach(function (key) {
|
651
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
652
|
-
});
|
653
|
-
}
|
654
|
-
}
|
655
|
-
|
656
|
-
return target;
|
657
|
-
}
|
658
|
-
|
659
1052
|
var handleFailedPlay = function handleFailedPlay(player, options) {
|
660
1053
|
var originalPlay = player.play;
|
661
1054
|
|
662
|
-
player.play = function ()
|
663
|
-
/* arguments */
|
664
|
-
{
|
1055
|
+
player.play = function () {
|
665
1056
|
var result = originalPlay.apply(player, arguments);
|
666
1057
|
|
667
1058
|
if (result && typeof result["catch"] !== 'undefined') {
|
@@ -693,16 +1084,12 @@ var asyncPlay = function asyncPlay(player) {
|
|
693
1084
|
var intendingToPlay = false;
|
694
1085
|
var intendingToPause = false;
|
695
1086
|
|
696
|
-
player.play = function ()
|
697
|
-
/* arguments */
|
698
|
-
{
|
1087
|
+
player.play = function () {
|
699
1088
|
player.intendToPlay();
|
700
1089
|
return originalPlay.apply(player, arguments);
|
701
1090
|
};
|
702
1091
|
|
703
|
-
player.pause = function ()
|
704
|
-
/* arguments */
|
705
|
-
{
|
1092
|
+
player.pause = function () {
|
706
1093
|
player.intendToPause();
|
707
1094
|
return originalPause.apply(player, arguments);
|
708
1095
|
};
|
@@ -751,9 +1138,7 @@ var hooks = function hooks(player, _hooks) {
|
|
751
1138
|
_hooks = newHooks;
|
752
1139
|
};
|
753
1140
|
|
754
|
-
player.play = function ()
|
755
|
-
/* args */
|
756
|
-
{
|
1141
|
+
player.play = function () {
|
757
1142
|
var args = arguments;
|
758
1143
|
player.trigger('beforeplay');
|
759
1144
|
player.intendToPlay();
|
@@ -1060,9 +1445,7 @@ var interval = function interval(player) {
|
|
1060
1445
|
|
1061
1446
|
player.one('dispose', cancelFadeVolume);
|
1062
1447
|
|
1063
|
-
function volume()
|
1064
|
-
/* arguments */
|
1065
|
-
{
|
1448
|
+
function volume() {
|
1066
1449
|
return originalVolume.apply(player, arguments);
|
1067
1450
|
}
|
1068
1451
|
|
@@ -1103,9 +1486,7 @@ volumeFading.webAudio = webAudio;
|
|
1103
1486
|
var loadWaiting = function loadWaiting(player) {
|
1104
1487
|
var originalFadeVolume = player.fadeVolume;
|
1105
1488
|
|
1106
|
-
player.fadeVolume = function ()
|
1107
|
-
/* args */
|
1108
|
-
{
|
1489
|
+
player.fadeVolume = function () {
|
1109
1490
|
var args = arguments;
|
1110
1491
|
return Promise.all([this.loadedPromise]).then(function () {
|
1111
1492
|
return originalFadeVolume.apply(player, args);
|
@@ -1113,9 +1494,7 @@ var loadWaiting = function loadWaiting(player) {
|
|
1113
1494
|
};
|
1114
1495
|
};
|
1115
1496
|
|
1116
|
-
var Settings =
|
1117
|
-
/*#__PURE__*/
|
1118
|
-
function () {
|
1497
|
+
var Settings = /*#__PURE__*/function () {
|
1119
1498
|
function Settings() {
|
1120
1499
|
_classCallCheck(this, Settings);
|
1121
1500
|
|
@@ -1508,16 +1887,6 @@ AudioPlayer.seekWithInvalidStateHandling = seekWithInvalidStateHandling;
|
|
1508
1887
|
AudioPlayer.rewindMethod = rewindMethod;
|
1509
1888
|
AudioPlayer.pauseInBackground = pauseInBackground;
|
1510
1889
|
|
1511
|
-
function _arrayLikeToArray(arr, len) {
|
1512
|
-
if (len == null || len > arr.length) len = arr.length;
|
1513
|
-
|
1514
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
1515
|
-
arr2[i] = arr[i];
|
1516
|
-
}
|
1517
|
-
|
1518
|
-
return arr2;
|
1519
|
-
}
|
1520
|
-
|
1521
1890
|
function _arrayWithoutHoles(arr) {
|
1522
1891
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
1523
1892
|
}
|
@@ -1526,15 +1895,6 @@ function _iterableToArray(iter) {
|
|
1526
1895
|
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
1527
1896
|
}
|
1528
1897
|
|
1529
|
-
function _unsupportedIterableToArray(o, minLen) {
|
1530
|
-
if (!o) return;
|
1531
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
1532
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
1533
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
1534
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
1535
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
1536
|
-
}
|
1537
|
-
|
1538
1898
|
function _nonIterableSpread() {
|
1539
1899
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1540
1900
|
}
|
@@ -1982,9 +2342,7 @@ var elId = 0;
|
|
1982
2342
|
* Media pool class handles the pool of Videojs media players
|
1983
2343
|
*/
|
1984
2344
|
|
1985
|
-
var MediaPool =
|
1986
|
-
/*#__PURE__*/
|
1987
|
-
function () {
|
2345
|
+
var MediaPool = /*#__PURE__*/function () {
|
1988
2346
|
function MediaPool() {
|
1989
2347
|
var _this$mediaFactory_;
|
1990
2348
|
|
@@ -2550,4 +2908,6 @@ function documentHiddenState(callback) {
|
|
2550
2908
|
};
|
2551
2909
|
}
|
2552
2910
|
|
2553
|
-
|
2911
|
+
var consent = Consent.create();
|
2912
|
+
|
2913
|
+
export { Audio, AudioPlayer, Consent, Features, MediaPool, MediaType, MultiPlayer, PlayerSourceIDMap, VideoPlayer, assetUrls, audioContext, blankSources, browser, consent, cookies, debugMode, documentHiddenState, events, features, log, media, mediaPlayer, setItemCookieString, settings };
|