pageflow 16.0.0 → 16.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +86 -33
- data/README.md +6 -6
- data/Rakefile +1 -1
- data/admins/pageflow/entry.rb +0 -1
- data/admins/pageflow/sites.rb +3 -0
- data/app/assets/images/pageflow/admin/icons/published_with_noindex.svg +4 -0
- data/app/assets/javascripts/pageflow/dist/ui.js +299 -72
- data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +1 -1
- data/app/assets/stylesheets/pageflow/admin/entries.scss +4 -0
- data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +10 -0
- data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +4 -0
- data/app/assets/stylesheets/pageflow/editor/base.scss +0 -1
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +61 -7
- data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +12 -1
- data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +4 -0
- data/app/assets/stylesheets/pageflow/editor/help.scss +3 -3
- data/app/assets/stylesheets/pageflow/editor/info_box.scss +7 -0
- data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +0 -5
- data/app/assets/stylesheets/pageflow/ui/forms.scss +4 -4
- data/app/assets/stylesheets/pageflow/{editor/wysihtml5.scss → ui/input/text_area_input.scss} +13 -1
- data/app/assets/stylesheets/pageflow/ui.scss +1 -0
- data/app/controllers/pageflow/chapters_controller.rb +2 -2
- data/app/controllers/pageflow/editor/entry_publications_controller.rb +5 -1
- data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
- data/app/controllers/pageflow/editor/files_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +12 -2
- data/app/controllers/pageflow/feeds_controller.rb +18 -0
- data/app/controllers/pageflow/pages_controller.rb +2 -2
- data/app/controllers/pageflow/sitemaps_controller.rb +15 -0
- data/app/controllers/pageflow/storylines_controller.rb +2 -2
- data/app/helpers/pageflow/entries_helper.rb +4 -1
- data/app/helpers/pageflow/feeds_helper.rb +66 -0
- data/app/helpers/pageflow/meta_tags_helper.rb +2 -1
- data/app/helpers/pageflow/page_types_helper.rb +10 -10
- data/app/helpers/pageflow/revision_file_helper.rb +3 -3
- data/app/helpers/pageflow/social_share_helper.rb +2 -2
- data/app/inputs/pageflow_permalink_input.rb +15 -3
- data/app/models/concerns/pageflow/entry_publication_states.rb +9 -0
- data/app/models/concerns/pageflow/reusable_file.rb +3 -3
- data/app/models/concerns/pageflow/uploadable_file.rb +5 -0
- data/app/models/pageflow/account.rb +8 -0
- data/app/models/pageflow/audio_file_url_templates.rb +2 -1
- data/app/models/pageflow/draft_entry.rb +1 -1
- data/app/models/pageflow/entries_feed.rb +32 -0
- data/app/models/pageflow/entry.rb +7 -5
- data/app/models/pageflow/entry_at_revision.rb +2 -0
- data/app/models/pageflow/image_file.rb +34 -8
- data/app/models/pageflow/image_file_url_templates.rb +7 -1
- data/app/models/pageflow/membership.rb +3 -2
- data/app/models/pageflow/other_file.rb +5 -0
- data/app/models/pageflow/other_file_url_templates.rb +16 -0
- data/app/models/pageflow/published_entry.rb +6 -0
- data/app/models/pageflow/revision.rb +6 -0
- data/app/models/pageflow/site.rb +8 -0
- data/app/models/pageflow/sitemaps.rb +14 -0
- data/app/models/pageflow/used_file.rb +10 -2
- data/app/models/pageflow/video_file_url_templates.rb +3 -1
- data/app/models/pageflow/widget.rb +9 -1
- data/app/views/admin/entries/_permalink_inputs.html.erb +1 -2
- data/app/views/admin/sites/_attributes_table.html.arb +3 -0
- data/app/views/admin/sites/_fields.html.erb +6 -0
- data/app/views/components/pageflow/admin/extensible_attributes_table.rb +2 -2
- data/app/views/components/pageflow/admin/revisions_tab.rb +8 -0
- data/app/views/components/pageflow/admin/sites_tab.rb +3 -0
- data/app/views/pageflow/editor/config/_seeds.json.jbuilder +2 -0
- data/app/views/pageflow/editor/entries/_entry.json.jbuilder +1 -0
- data/app/views/pageflow/editor/entry_publications/check.json.jbuilder +1 -0
- data/app/views/pageflow/feeds/index.atom.builder +20 -0
- data/app/views/pageflow/image_files/_image_file.json.jbuilder +1 -0
- data/app/views/pageflow/meta_tags/_entry.html.erb +1 -0
- data/app/views/pageflow/sitemaps/index.xml.builder +9 -0
- data/config/initializers/features.rb +3 -0
- data/config/initializers/paperclip.rb +8 -0
- data/config/locales/de.yml +77 -6
- data/config/locales/en.yml +79 -4
- data/config/routes.rb +3 -0
- data/config/spring.rb +1 -1
- data/db/migrate/20230120092923_create_other_files.rb +23 -0
- data/db/migrate/20230323115745_add_feeds_enabled_to_sites.rb +5 -0
- data/db/migrate/20230323154323_add_sitemap_enabled_to_sites.rb +5 -0
- data/db/migrate/20230331103823_add_title_to_sites.rb +5 -0
- data/db/migrate/20230405103612_add_custom_feed_url_to_sites.rb +5 -0
- data/db/migrate/20231024062501_add_output_presences_to_image_files.rb +5 -0
- data/db/migrate/20231128124523_add_noindex_to_revisions.rb +5 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +710 -259
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +34 -5
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +1 -1
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +1 -1
- data/entry_types/paged/app/controllers/pageflow_paged/editor/entries_controller.rb +0 -2
- data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +2 -1
- data/entry_types/paged/app/views/pageflow_paged/entries/show.html.erb +1 -0
- data/entry_types/paged/config/initializers/features.rb +0 -1
- data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -1
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +3 -4
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +13 -6
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +11 -3
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/cache_helper.rb +11 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/entry_json_seed_helper.rb +42 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +8 -5
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +17 -12
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +9 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +1 -1
- data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +23 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -5
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/sections/_section_with_content_elements.json.jbuilder +10 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +44 -41
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_consent_vendors.json.jbuilder +16 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +7 -0
- data/entry_types/scrolled/config/initializers/features.rb +5 -0
- data/entry_types/scrolled/config/locales/consent_widget.de.yml +4 -0
- data/entry_types/scrolled/config/locales/consent_widget.en.yml +4 -0
- data/entry_types/scrolled/config/locales/de.yml +225 -8
- data/entry_types/scrolled/config/locales/en.yml +239 -2
- data/entry_types/scrolled/config/routes.rb +4 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +69 -44
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +2 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +1 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +96 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/content_element_consent_vendors.rb +38 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +13 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +30 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +6 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/web_app_manifest.rb +1 -1
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +1 -1
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +1 -2
- data/entry_types/scrolled/package/config/webpack.js +26 -0
- data/entry_types/scrolled/package/contentElements-editor.js +330 -32
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +920 -145
- data/entry_types/scrolled/package/editor.js +819 -239
- data/entry_types/scrolled/package/frontend/{EditableInlineText.module-14c7b097.js → EditableInlineText.module-6ee0e024.js} +1975 -1792
- data/entry_types/scrolled/package/frontend/PhonePlatformContext-b28d991a.js +32 -0
- data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-8242f213.js +107 -0
- data/entry_types/scrolled/package/frontend/Viewer-32cd1ac1.js +154 -0
- data/entry_types/scrolled/package/frontend/{Viewer-b6becc57.js → Viewer-6e4d14ed.js} +32 -161
- data/entry_types/scrolled/package/frontend/arrowRight-e42e6011.js +77 -0
- data/entry_types/scrolled/package/frontend/{components-b3160dd7.js → components-24363f97.js} +188 -47
- data/entry_types/scrolled/package/frontend/{PhonePlatformContext-f6093cc6.js → i18n-71c39823.js} +191 -111
- data/entry_types/scrolled/package/frontend/index-fc4b13e6.js +118 -0
- data/entry_types/scrolled/package/frontend/index.css +1 -1
- data/entry_types/scrolled/package/frontend/index.js +252 -76
- data/entry_types/scrolled/package/frontend/useContentElementEditorState-245f1986.js +52 -0
- data/entry_types/scrolled/package/package.json +6 -4
- data/entry_types/scrolled/package/testHelpers.js +11 -2
- data/entry_types/scrolled/package/values/colors.module.css +15 -0
- data/entry_types/scrolled/package/widgets/consentBar.css +1 -0
- data/entry_types/scrolled/package/widgets/consentBar.js +426 -0
- data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
- data/entry_types/scrolled/package/widgets/defaultNavigation.js +39 -4
- data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -0
- data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +49 -0
- data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -0
- data/entry_types/scrolled/package/widgets/textInlineFileRights.js +37 -0
- data/lib/generators/pageflow/resque/resque_generator.rb +1 -1
- data/lib/generators/pageflow/resque/templates/resque.rake +1 -1
- data/lib/generators/pageflow/resque/templates/resque.rb +1 -1
- data/lib/generators/pageflow/routes/routes_generator.rb +1 -1
- data/lib/pageflow/ability_mixin.rb +5 -5
- data/lib/pageflow/active_admin_can_can_fix.rb +2 -2
- data/lib/pageflow/built_in_file_type.rb +7 -0
- data/lib/pageflow/configuration.rb +29 -1
- data/lib/pageflow/engine.rb +18 -40
- data/lib/pageflow/entry_export_import/revision_serialization.rb +1 -1
- data/lib/pageflow/file_type.rb +2 -2
- data/lib/pageflow/global_config_api.rb +2 -2
- data/lib/pageflow/nested_revision_component.rb +23 -5
- data/lib/pageflow/page_type.rb +1 -1
- data/lib/pageflow/paperclip_processors/webp.rb +63 -0
- data/lib/pageflow/rails_version.rb +19 -0
- data/lib/pageflow/seeds.rb +10 -7
- data/lib/pageflow/user_mixin.rb +1 -1
- data/lib/pageflow/version.rb +1 -1
- data/lib/pageflow/widget_types.rb +4 -0
- data/package/config/jest/index.js +3 -1
- data/package/config/webpack5.js +14 -0
- data/package/editor.js +410 -181
- data/package/frontend.js +34 -4
- data/package/testHelpers.js +1 -1
- data/package/ui.js +297 -71
- data/spec/factories/entries.rb +34 -3
- data/spec/factories/sites.rb +3 -0
- data/vendor/assets/javascripts/iscroll.js +4 -7
- metadata +118 -80
- data/app/helpers/pageflow/admin/permalinks_helper.rb +0 -15
- data/entry_types/scrolled/package/frontend/arrowRight-78a7cee4.js +0 -42
@@ -0,0 +1,38 @@
|
|
1
|
+
module PageflowScrolled
|
2
|
+
# Register consent vendors based on content element configuration
|
3
|
+
# data.
|
4
|
+
class ContentElementConsentVendors
|
5
|
+
# @api private
|
6
|
+
def initialize
|
7
|
+
@callables = {}
|
8
|
+
end
|
9
|
+
|
10
|
+
# Register callable to determine consent vendor from configuration
|
11
|
+
# attributes for a content element type.
|
12
|
+
#
|
13
|
+
# @param callable [#call]
|
14
|
+
# Receives configuration keyword argument and returns
|
15
|
+
# @param content_element_type_name [String]
|
16
|
+
def register(callable, content_element_type_name:)
|
17
|
+
@callables[content_element_type_name] = callable
|
18
|
+
end
|
19
|
+
|
20
|
+
# @api private
|
21
|
+
def by_content_element_id(entry)
|
22
|
+
content_elements_with_consent_vendor(entry).each_with_object({}) { |content_element, result|
|
23
|
+
next unless @callables[content_element.type_name]
|
24
|
+
|
25
|
+
result[content_element.id] = @callables[content_element.type_name].call(
|
26
|
+
entry: entry,
|
27
|
+
configuration: content_element.configuration
|
28
|
+
)
|
29
|
+
}.compact
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def content_elements_with_consent_vendor(entry)
|
35
|
+
ContentElement.all_for_revision(entry.revision).where(type_name: @callables.keys)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -1,11 +1,23 @@
|
|
1
1
|
require 'rails'
|
2
|
+
require 'pageflow/rails_version'
|
2
3
|
|
3
4
|
module PageflowScrolled
|
4
5
|
# Rails integration
|
5
6
|
class Engine < ::Rails::Engine
|
6
7
|
isolate_namespace PageflowScrolled
|
7
8
|
|
8
|
-
|
9
|
+
lib = root.join('lib')
|
10
|
+
|
11
|
+
config.autoload_paths << lib
|
12
|
+
config.eager_load_paths << lib
|
13
|
+
|
14
|
+
initializer 'pageflow_scrolled.autoloading' do
|
15
|
+
Rails.autoloaders.main.ignore(
|
16
|
+
lib.join('generators'),
|
17
|
+
lib.join('tasks')
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
9
21
|
config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s]
|
10
22
|
|
11
23
|
initializer 'pageflow_scrolled.assets.precompile' do |app|
|
@@ -10,25 +10,55 @@ module PageflowScrolled
|
|
10
10
|
c.file_types.register(Pageflow::BuiltInFileType.image)
|
11
11
|
c.file_types.register(Pageflow::BuiltInFileType.video)
|
12
12
|
c.file_types.register(Pageflow::BuiltInFileType.audio)
|
13
|
+
c.file_types.register(Pageflow::BuiltInFileType.other)
|
13
14
|
|
14
15
|
c.revision_components.register(Storyline)
|
15
16
|
|
16
17
|
c.widget_types.register(ReactWidgetType.new(name: 'defaultNavigation',
|
17
18
|
role: 'header'),
|
18
19
|
default: true)
|
20
|
+
c.widget_types.register(ReactWidgetType.new(name: 'consentBar',
|
21
|
+
role: 'consent'),
|
22
|
+
default: true)
|
23
|
+
|
24
|
+
c.widget_types.register(ReactWidgetType.new(name: 'iconInlineFileRights',
|
25
|
+
role: 'inlineFileRights'),
|
26
|
+
default: true)
|
27
|
+
c.widget_types.register(ReactWidgetType.new(name: 'textInlineFileRights',
|
28
|
+
role: 'inlineFileRights'))
|
19
29
|
|
20
30
|
c.features.register('datawrapper_chart_embed_opt_in')
|
21
31
|
c.features.enable_by_default('datawrapper_chart_embed_opt_in')
|
22
32
|
c.features.register('iframe_embed_content_element')
|
33
|
+
c.features.register('image_gallery_content_element')
|
23
34
|
c.features.register('frontend_v2')
|
35
|
+
c.features.register('scrolled_entry_fragment_caching')
|
24
36
|
|
25
37
|
c.additional_frontend_seed_data.register(
|
26
38
|
'frontendVersion',
|
27
39
|
FRONTEND_VERSION_SEED_DATA
|
28
40
|
)
|
41
|
+
|
42
|
+
c.content_element_consent_vendors.register(
|
43
|
+
IFRAME_EMBED_CONSENT_VENDOR,
|
44
|
+
content_element_type_name: 'iframeEmbed'
|
45
|
+
)
|
29
46
|
end
|
30
47
|
end
|
31
48
|
|
49
|
+
IFRAME_EMBED_CONSENT_VENDOR = lambda do |configuration:, entry:, **|
|
50
|
+
return unless configuration['requireConsent']
|
51
|
+
|
52
|
+
uri = URI.parse(configuration['source'])
|
53
|
+
host_matchers = Pageflow.config_for(entry).consent_vendor_host_matchers
|
54
|
+
|
55
|
+
host_matchers.detect do |matcher, _|
|
56
|
+
uri.host =~ matcher
|
57
|
+
end&.last
|
58
|
+
rescue URI::InvalidURIError
|
59
|
+
nil
|
60
|
+
end
|
61
|
+
|
32
62
|
FRONTEND_VERSION_SEED_DATA = lambda do |request:, entry:, **|
|
33
63
|
if request.params[:frontend] == 'v2' || entry.feature_state('frontend_v2')
|
34
64
|
2
|
@@ -8,9 +8,10 @@ module PageflowScrolled
|
|
8
8
|
#
|
9
9
|
# @since 15.7
|
10
10
|
class ReactWidgetType < Pageflow::WidgetType
|
11
|
-
def initialize(role:, name:)
|
11
|
+
def initialize(role:, name:, enabled_in_editor: true)
|
12
12
|
@role = role
|
13
13
|
@name = name
|
14
|
+
@enabled_in_editor = enabled_in_editor
|
14
15
|
end
|
15
16
|
|
16
17
|
attr_reader :name
|
@@ -23,6 +24,10 @@ module PageflowScrolled
|
|
23
24
|
[@role]
|
24
25
|
end
|
25
26
|
|
27
|
+
def enabled_in_editor?
|
28
|
+
@enabled_in_editor
|
29
|
+
end
|
30
|
+
|
26
31
|
def render(*)
|
27
32
|
''
|
28
33
|
end
|
@@ -33,8 +33,7 @@ namespace :pageflow_scrolled do
|
|
33
33
|
|
34
34
|
account = seeds.account(name: 'storybook-seed') do |account_in_progress|
|
35
35
|
account_in_progress.features_configuration =
|
36
|
-
account_in_progress.features_configuration.merge('scrolled_entry_type' => true
|
37
|
-
'frontend_v2' => true)
|
36
|
+
account_in_progress.features_configuration.merge('scrolled_entry_type' => true)
|
38
37
|
end
|
39
38
|
|
40
39
|
seeds.sample_scrolled_entry(
|
@@ -7,5 +7,31 @@ module.exports = {
|
|
7
7
|
// supported by the browser.
|
8
8
|
'video.js$': 'video.js/core.es.js'
|
9
9
|
},
|
10
|
+
},
|
11
|
+
entry: {
|
12
|
+
'pageflow-scrolled/widgets/defaultNavigation': {
|
13
|
+
import: [
|
14
|
+
'pageflow-scrolled/widgets/defaultNavigation',
|
15
|
+
'pageflow-scrolled/widgets/defaultNavigation.css'
|
16
|
+
]
|
17
|
+
},
|
18
|
+
'pageflow-scrolled/widgets/consentBar': {
|
19
|
+
import: [
|
20
|
+
'pageflow-scrolled/widgets/consentBar',
|
21
|
+
'pageflow-scrolled/widgets/consentBar.css'
|
22
|
+
]
|
23
|
+
},
|
24
|
+
'pageflow-scrolled/widgets/iconInlineFileRights': {
|
25
|
+
import: [
|
26
|
+
'pageflow-scrolled/widgets/iconInlineFileRights',
|
27
|
+
'pageflow-scrolled/widgets/iconInlineFileRights.css'
|
28
|
+
]
|
29
|
+
},
|
30
|
+
'pageflow-scrolled/widgets/textInlineFileRights': {
|
31
|
+
import: [
|
32
|
+
'pageflow-scrolled/widgets/textInlineFileRights',
|
33
|
+
'pageflow-scrolled/widgets/textInlineFileRights.css'
|
34
|
+
]
|
35
|
+
}
|
10
36
|
}
|
11
37
|
};
|