pageflow 16.1.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 +70 -194
- data/README.md +6 -5
- data/app/assets/images/pageflow/admin/icons/published_with_noindex.svg +4 -0
- data/app/assets/javascripts/pageflow/dist/ui.js +1 -0
- 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/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 +55 -6
- data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +12 -1
- data/app/assets/stylesheets/pageflow/ui/forms.scss +3 -3
- 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/editor/entry_publications_controller.rb +5 -1
- data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +2 -2
- data/app/helpers/pageflow/entries_helper.rb +2 -0
- data/app/helpers/pageflow/meta_tags_helper.rb +2 -1
- data/app/helpers/pageflow/page_types_helper.rb +4 -4
- data/app/helpers/pageflow/revision_file_helper.rb +3 -3
- data/app/helpers/pageflow/social_share_helper.rb +2 -2
- data/app/models/concerns/pageflow/entry_publication_states.rb +9 -0
- data/app/models/concerns/pageflow/uploadable_file.rb +5 -0
- data/app/models/pageflow/account.rb +2 -2
- 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 +20 -5
- data/app/models/pageflow/image_file_url_templates.rb +7 -1
- data/app/models/pageflow/revision.rb +6 -4
- data/app/models/pageflow/site.rb +2 -2
- data/app/models/pageflow/sitemaps.rb +1 -0
- data/app/models/pageflow/used_file.rb +8 -0
- data/app/views/components/pageflow/admin/extensible_attributes_table.rb +1 -7
- data/app/views/components/pageflow/admin/revisions_tab.rb +8 -0
- data/app/views/pageflow/editor/config/_seeds.json.jbuilder +1 -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/image_files/_image_file.json.jbuilder +1 -0
- data/app/views/pageflow/meta_tags/_entry.html.erb +1 -0
- data/config/initializers/features.rb +2 -0
- data/config/initializers/paperclip.rb +4 -0
- data/config/locales/de.yml +50 -0
- data/config/locales/en.yml +49 -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 +266 -151
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +8 -2
- 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/entries_controller.rb +1 -1
- data/entry_types/paged/lib/pageflow_paged/engine.rb +7 -11
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +9 -3
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +6 -6
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +21 -37
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +1 -3
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -6
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +17 -17
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +4 -0
- data/entry_types/scrolled/config/locales/de.yml +47 -11
- data/entry_types/scrolled/config/locales/en.yml +42 -10
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +22 -89
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +2 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +8 -12
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +6 -0
- 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/package/config/webpack.js +26 -0
- data/entry_types/scrolled/package/contentElements-editor.js +36 -23
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +250 -94
- data/entry_types/scrolled/package/editor.js +331 -147
- data/entry_types/scrolled/package/frontend/{EditableInlineText.module-fa9e3aff.js → EditableInlineText.module-6ee0e024.js} +463 -275
- data/entry_types/scrolled/package/frontend/{PhonePlatformContext-10a1d600.js → PhonePlatformContext-b28d991a.js} +1 -1
- data/entry_types/scrolled/package/frontend/{ToggleFullscreenCornerButton-727cce0d.js → ToggleFullscreenCornerButton-8242f213.js} +1 -1
- data/entry_types/scrolled/package/frontend/{Viewer-169e14ca.js → Viewer-32cd1ac1.js} +4 -4
- data/entry_types/scrolled/package/frontend/{Viewer-ee1aa590.js → Viewer-6e4d14ed.js} +4 -4
- data/entry_types/scrolled/package/frontend/{arrowRight-92a34ccc.js → arrowRight-e42e6011.js} +2 -2
- data/entry_types/scrolled/package/frontend/{components-4a09bfa3.js → components-24363f97.js} +7 -6
- data/entry_types/scrolled/package/frontend/{i18n-ddd92820.js → i18n-71c39823.js} +84 -46
- data/entry_types/scrolled/package/frontend/{index-02378634.js → index-fc4b13e6.js} +3 -3
- data/entry_types/scrolled/package/frontend/index.css +1 -1
- data/entry_types/scrolled/package/frontend/index.js +90 -66
- data/entry_types/scrolled/package/frontend/{useContentElementEditorState-63045393.js → useContentElementEditorState-245f1986.js} +1 -1
- data/entry_types/scrolled/package/package.json +4 -3
- data/entry_types/scrolled/package/testHelpers.js +4 -2
- 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/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/configuration.rb +8 -1
- data/lib/pageflow/engine.rb +15 -58
- data/lib/pageflow/page_type.rb +1 -1
- data/lib/pageflow/paperclip_processors/webp.rb +63 -0
- data/lib/pageflow/rails_version.rb +2 -2
- data/lib/pageflow/user_mixin.rb +1 -1
- data/lib/pageflow/version.rb +1 -1
- data/package/config/jest/index.js +3 -1
- data/package/editor.js +272 -154
- data/package/frontend.js +8 -2
- data/package/ui.js +1 -0
- data/spec/factories/entries.rb +17 -0
- metadata +78 -56
@@ -0,0 +1,49 @@
|
|
1
|
+
import { ThemeIcon, frontend } from 'pageflow-scrolled/frontend';
|
2
|
+
import React from 'react';
|
3
|
+
import classNames from 'classnames';
|
4
|
+
|
5
|
+
function _defineProperty(obj, key, value) {
|
6
|
+
if (key in obj) {
|
7
|
+
Object.defineProperty(obj, key, {
|
8
|
+
value: value,
|
9
|
+
enumerable: true,
|
10
|
+
configurable: true,
|
11
|
+
writable: true
|
12
|
+
});
|
13
|
+
} else {
|
14
|
+
obj[key] = value;
|
15
|
+
}
|
16
|
+
|
17
|
+
return obj;
|
18
|
+
}
|
19
|
+
|
20
|
+
var styles = {"standAlone":"IconInlineFileRights-module_standAlone__15788","button":"IconInlineFileRights-module_button__o5ZmR","tooltip":"IconInlineFileRights-module_tooltip__2e1u8","transparent":"IconInlineFileRights-module_transparent__2dVaA","wrapper":"IconInlineFileRights-module_wrapper__2kQK_","scroller":"IconInlineFileRights-module_scroller__1hT8t"};
|
21
|
+
|
22
|
+
function IconInlineFileRights(_ref) {
|
23
|
+
var _classNames;
|
24
|
+
|
25
|
+
var context = _ref.context,
|
26
|
+
playerControlsStandAlone = _ref.playerControlsStandAlone,
|
27
|
+
playerControlsTransparent = _ref.playerControlsTransparent,
|
28
|
+
children = _ref.children;
|
29
|
+
|
30
|
+
if (context === 'afterElement') {
|
31
|
+
return null;
|
32
|
+
}
|
33
|
+
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
35
|
+
className: classNames(styles.wrapper, (_classNames = {}, _defineProperty(_classNames, styles.transparent, context !== 'playerControls' || playerControlsTransparent), _defineProperty(_classNames, styles.standAlone, context !== 'playerControls'), _classNames))
|
36
|
+
}, /*#__PURE__*/React.createElement("button", {
|
37
|
+
className: styles.button
|
38
|
+
}, /*#__PURE__*/React.createElement(ThemeIcon, {
|
39
|
+
name: "copyright"
|
40
|
+
})), /*#__PURE__*/React.createElement("div", {
|
41
|
+
className: styles.tooltip
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
43
|
+
className: styles.scroller
|
44
|
+
}, children)));
|
45
|
+
}
|
46
|
+
|
47
|
+
frontend.widgetTypes.register('iconInlineFileRights', {
|
48
|
+
component: IconInlineFileRights
|
49
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
.TextInlineFileRights-module_text__1tT0W{font-size:14px;position:relative;z-index:1;color:var(--content-text-color)}.TextInlineFileRights-module_text__1tT0W li{text-align:right;padding-top:.2em}.TextInlineFileRights-module_forSection__22xHD{position:absolute;bottom:0;right:0}.TextInlineFileRights-module_forSection__22xHD li{padding:0 .4em .2em 0}.TextInlineFileRights-module_text__1tT0W a{color:inherit;-webkit-text-decoration-color:color-mix(in srgb,currentColor,transparent);text-decoration-color:color-mix(in srgb,currentColor,transparent)}.TextInlineFileRights-module_text__1tT0W span{opacity:.7}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { frontend } from 'pageflow-scrolled/frontend';
|
2
|
+
import React from 'react';
|
3
|
+
import classNames from 'classnames';
|
4
|
+
|
5
|
+
function _defineProperty(obj, key, value) {
|
6
|
+
if (key in obj) {
|
7
|
+
Object.defineProperty(obj, key, {
|
8
|
+
value: value,
|
9
|
+
enumerable: true,
|
10
|
+
configurable: true,
|
11
|
+
writable: true
|
12
|
+
});
|
13
|
+
} else {
|
14
|
+
obj[key] = value;
|
15
|
+
}
|
16
|
+
|
17
|
+
return obj;
|
18
|
+
}
|
19
|
+
|
20
|
+
var styles = {"text":"TextInlineFileRights-module_text__1tT0W","forSection":"TextInlineFileRights-module_forSection__22xHD"};
|
21
|
+
|
22
|
+
function TextInlineFileRights(_ref) {
|
23
|
+
var context = _ref.context,
|
24
|
+
children = _ref.children;
|
25
|
+
|
26
|
+
if (context === 'insideElement' || context === 'playerControls') {
|
27
|
+
return null;
|
28
|
+
}
|
29
|
+
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
31
|
+
className: classNames(styles.text, _defineProperty({}, styles.forSection, context === 'section'))
|
32
|
+
}, /*#__PURE__*/React.createElement("div", null, children));
|
33
|
+
}
|
34
|
+
|
35
|
+
frontend.widgetTypes.register('textInlineFileRights', {
|
36
|
+
component: TextInlineFileRights
|
37
|
+
});
|
@@ -18,7 +18,7 @@ module Pageflow
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def require_resque_server
|
21
|
-
prepend_to_file 'config/routes.rb', "require 'resque/server'\nrequire '
|
21
|
+
prepend_to_file 'config/routes.rb', "require 'resque/server'\nrequire 'resque/scheduler/server'\n\n"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -349,9 +349,12 @@ module Pageflow
|
|
349
349
|
# @since 0.11
|
350
350
|
attr_accessor :authorize_user_deletion
|
351
351
|
|
352
|
+
# Array of values that the `license` attribute on files can take.
|
353
|
+
attr_accessor :available_file_licenses
|
354
|
+
|
352
355
|
# Array of values that the `kind` attribute on text tracks can
|
353
356
|
# take. Defaults to `[:captions, :subtitles, :descriptions]`.
|
354
|
-
|
357
|
+
attr_accessor :available_text_track_kinds
|
355
358
|
|
356
359
|
# Allow one user to be member of multiple accounts. Defaults to
|
357
360
|
# true.
|
@@ -451,6 +454,10 @@ module Pageflow
|
|
451
454
|
|
452
455
|
@authorize_user_deletion = lambda { |_user| true }
|
453
456
|
|
457
|
+
@available_file_licenses = [
|
458
|
+
:cc_by_4, :cc_by_sa_4, :cc_by_nc_4, :cc_by_nc_sa_4, :cc_by_nd_4, :cc_by_nc_nd_4
|
459
|
+
]
|
460
|
+
|
454
461
|
@available_text_track_kinds = [:captions, :subtitles, :descriptions]
|
455
462
|
|
456
463
|
@allow_multiaccount_users = true
|
data/lib/pageflow/engine.rb
CHANGED
@@ -43,64 +43,21 @@ module Pageflow
|
|
43
43
|
class Engine < ::Rails::Engine
|
44
44
|
isolate_namespace Pageflow
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
)
|
62
|
-
end
|
63
|
-
else
|
64
|
-
config.paths.add('app/views/components', autoload: true)
|
65
|
-
config.paths.add('lib', autoload: true)
|
66
|
-
|
67
|
-
def eager_load!
|
68
|
-
# Manually eager load `lib/pageflow` as the least bad option:
|
69
|
-
#
|
70
|
-
# - Autoload paths are not eager loaded in production.
|
71
|
-
#
|
72
|
-
# - `lib` cannot be an eager load path since otherwise templates
|
73
|
-
# in `lib/generators` are also executed.
|
74
|
-
#
|
75
|
-
# - `lib/pageflow` cannot be an eager load path since eager load
|
76
|
-
# paths are automatically used as autoload paths. That way
|
77
|
-
# `lib/pageflow/admin/something.rb` could be autoloaded via
|
78
|
-
# `Admin::Something`.
|
79
|
-
#
|
80
|
-
# - Using `require` in `lib/pageflow.rb` disables code
|
81
|
-
# reloading.
|
82
|
-
#
|
83
|
-
# - Using `require_dependency` in `lib/pageflow.rb` does not
|
84
|
-
# activate code reloading either since it requires the
|
85
|
-
# autoload path to be set up correctly, which only happens
|
86
|
-
# during initialization.
|
87
|
-
super
|
88
|
-
|
89
|
-
lib_path = config.root.join('lib')
|
90
|
-
matcher = %r{\A#{Regexp.escape(lib_path.to_s)}/(.*)\.rb\Z}
|
91
|
-
|
92
|
-
already_required_files = [
|
93
|
-
'pageflow/engine',
|
94
|
-
'pageflow/global_config_api',
|
95
|
-
'pageflow/news_item_api',
|
96
|
-
'pageflow/version'
|
97
|
-
]
|
98
|
-
|
99
|
-
Dir.glob("#{lib_path}/pageflow/**/*.rb").sort.each do |file|
|
100
|
-
logical_path = file.sub(matcher, '\1')
|
101
|
-
require_dependency(logical_path) unless already_required_files.include?(logical_path)
|
102
|
-
end
|
103
|
-
end
|
46
|
+
config.autoload_paths << root.join('app/views/components')
|
47
|
+
config.eager_load_paths << root.join('app/views/components')
|
48
|
+
|
49
|
+
lib = root.join('lib')
|
50
|
+
|
51
|
+
config.autoload_paths << lib
|
52
|
+
config.eager_load_paths << lib
|
53
|
+
|
54
|
+
initializer 'pageflow.autoloading' do
|
55
|
+
Rails.autoloaders.main.ignore(
|
56
|
+
lib.join('generators'),
|
57
|
+
lib.join('tasks'),
|
58
|
+
lib.join('pageflow/paperclip_processors'),
|
59
|
+
lib.join('pageflow/version.rb')
|
60
|
+
)
|
104
61
|
end
|
105
62
|
|
106
63
|
config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s]
|
data/lib/pageflow/page_type.rb
CHANGED
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'vips'
|
2
|
+
|
3
|
+
module Pageflow
|
4
|
+
module PaperclipProcessors
|
5
|
+
# @api private
|
6
|
+
class Webp < Paperclip::Processor
|
7
|
+
ANIMATED_FORMATS = %w[.gif].freeze
|
8
|
+
|
9
|
+
def initialize(file, options = {}, attachment = nil)
|
10
|
+
super
|
11
|
+
|
12
|
+
geometry = options[:geometry].to_s
|
13
|
+
@should_crop = geometry[-1, 1] == '#'
|
14
|
+
|
15
|
+
@target_geometry = Paperclip::Geometry.parse(geometry)
|
16
|
+
@whiny = options.fetch(:whiny, true)
|
17
|
+
|
18
|
+
@current_format = File.extname(file.path)
|
19
|
+
@basename = File.basename(@file.path, @current_format)
|
20
|
+
end
|
21
|
+
|
22
|
+
def make
|
23
|
+
source = @file
|
24
|
+
filename = [@basename, '.webp'].join
|
25
|
+
destination = Paperclip::TempfileFactory.new.generate(filename)
|
26
|
+
|
27
|
+
begin
|
28
|
+
thumbnail = Vips::Image.thumbnail(
|
29
|
+
ANIMATED_FORMATS.include?(@current_format) ? "#{source.path}[n=-1]" : source.path,
|
30
|
+
width,
|
31
|
+
size: @should_crop ? :both : :down,
|
32
|
+
height: height,
|
33
|
+
crop: crop
|
34
|
+
)
|
35
|
+
thumbnail.webpsave(destination.path)
|
36
|
+
rescue Vips::Error => e
|
37
|
+
if @whiny
|
38
|
+
message = "There was an error processing the thumbnail for #{@basename}:\n" + e.message
|
39
|
+
raise Paperclip::Error, message
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
destination
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def crop
|
49
|
+
return unless @should_crop
|
50
|
+
|
51
|
+
@options[:crop] || :centre
|
52
|
+
end
|
53
|
+
|
54
|
+
def width
|
55
|
+
@target_geometry.width
|
56
|
+
end
|
57
|
+
|
58
|
+
def height
|
59
|
+
@target_geometry.height
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/lib/pageflow/user_mixin.rb
CHANGED
data/lib/pageflow/version.rb
CHANGED