pageflow 16.1.0 → 16.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +70 -194
  3. data/README.md +6 -5
  4. data/app/assets/images/pageflow/admin/icons/published_with_noindex.svg +4 -0
  5. data/app/assets/javascripts/pageflow/dist/ui.js +1 -0
  6. data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +1 -1
  7. data/app/assets/stylesheets/pageflow/admin/entries.scss +4 -0
  8. data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +4 -0
  9. data/app/assets/stylesheets/pageflow/editor/base.scss +0 -1
  10. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +55 -6
  11. data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +12 -1
  12. data/app/assets/stylesheets/pageflow/ui/forms.scss +3 -3
  13. data/app/assets/stylesheets/pageflow/{editor/wysihtml5.scss → ui/input/text_area_input.scss} +13 -1
  14. data/app/assets/stylesheets/pageflow/ui.scss +1 -0
  15. data/app/controllers/pageflow/editor/entry_publications_controller.rb +5 -1
  16. data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
  17. data/app/controllers/pageflow/entries_controller.rb +2 -2
  18. data/app/helpers/pageflow/entries_helper.rb +2 -0
  19. data/app/helpers/pageflow/meta_tags_helper.rb +2 -1
  20. data/app/helpers/pageflow/page_types_helper.rb +4 -4
  21. data/app/helpers/pageflow/revision_file_helper.rb +3 -3
  22. data/app/helpers/pageflow/social_share_helper.rb +2 -2
  23. data/app/models/concerns/pageflow/entry_publication_states.rb +9 -0
  24. data/app/models/concerns/pageflow/uploadable_file.rb +5 -0
  25. data/app/models/pageflow/account.rb +2 -2
  26. data/app/models/pageflow/entry.rb +7 -5
  27. data/app/models/pageflow/entry_at_revision.rb +2 -0
  28. data/app/models/pageflow/image_file.rb +20 -5
  29. data/app/models/pageflow/image_file_url_templates.rb +7 -1
  30. data/app/models/pageflow/revision.rb +6 -4
  31. data/app/models/pageflow/site.rb +2 -2
  32. data/app/models/pageflow/sitemaps.rb +1 -0
  33. data/app/models/pageflow/used_file.rb +8 -0
  34. data/app/views/components/pageflow/admin/extensible_attributes_table.rb +1 -7
  35. data/app/views/components/pageflow/admin/revisions_tab.rb +8 -0
  36. data/app/views/pageflow/editor/config/_seeds.json.jbuilder +1 -0
  37. data/app/views/pageflow/editor/entries/_entry.json.jbuilder +1 -0
  38. data/app/views/pageflow/editor/entry_publications/check.json.jbuilder +1 -0
  39. data/app/views/pageflow/image_files/_image_file.json.jbuilder +1 -0
  40. data/app/views/pageflow/meta_tags/_entry.html.erb +1 -0
  41. data/config/initializers/features.rb +2 -0
  42. data/config/initializers/paperclip.rb +4 -0
  43. data/config/locales/de.yml +50 -0
  44. data/config/locales/en.yml +49 -0
  45. data/db/migrate/20231024062501_add_output_presences_to_image_files.rb +5 -0
  46. data/db/migrate/20231128124523_add_noindex_to_revisions.rb +5 -0
  47. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +266 -151
  48. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +8 -2
  49. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +1 -1
  50. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +1 -1
  51. data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +1 -1
  52. data/entry_types/paged/lib/pageflow_paged/engine.rb +7 -11
  53. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +9 -3
  54. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +6 -6
  55. data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +21 -37
  56. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +1 -3
  57. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -6
  58. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +17 -17
  59. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +4 -0
  60. data/entry_types/scrolled/config/locales/de.yml +47 -11
  61. data/entry_types/scrolled/config/locales/en.yml +42 -10
  62. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +22 -89
  63. data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +2 -1
  64. data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +8 -12
  65. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +6 -0
  66. data/entry_types/scrolled/lib/pageflow_scrolled/web_app_manifest.rb +1 -1
  67. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +1 -1
  68. data/entry_types/scrolled/package/config/webpack.js +26 -0
  69. data/entry_types/scrolled/package/contentElements-editor.js +36 -23
  70. data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
  71. data/entry_types/scrolled/package/contentElements-frontend.js +250 -94
  72. data/entry_types/scrolled/package/editor.js +331 -147
  73. data/entry_types/scrolled/package/frontend/{EditableInlineText.module-fa9e3aff.js → EditableInlineText.module-6ee0e024.js} +463 -275
  74. data/entry_types/scrolled/package/frontend/{PhonePlatformContext-10a1d600.js → PhonePlatformContext-b28d991a.js} +1 -1
  75. data/entry_types/scrolled/package/frontend/{ToggleFullscreenCornerButton-727cce0d.js → ToggleFullscreenCornerButton-8242f213.js} +1 -1
  76. data/entry_types/scrolled/package/frontend/{Viewer-169e14ca.js → Viewer-32cd1ac1.js} +4 -4
  77. data/entry_types/scrolled/package/frontend/{Viewer-ee1aa590.js → Viewer-6e4d14ed.js} +4 -4
  78. data/entry_types/scrolled/package/frontend/{arrowRight-92a34ccc.js → arrowRight-e42e6011.js} +2 -2
  79. data/entry_types/scrolled/package/frontend/{components-4a09bfa3.js → components-24363f97.js} +7 -6
  80. data/entry_types/scrolled/package/frontend/{i18n-ddd92820.js → i18n-71c39823.js} +84 -46
  81. data/entry_types/scrolled/package/frontend/{index-02378634.js → index-fc4b13e6.js} +3 -3
  82. data/entry_types/scrolled/package/frontend/index.css +1 -1
  83. data/entry_types/scrolled/package/frontend/index.js +90 -66
  84. data/entry_types/scrolled/package/frontend/{useContentElementEditorState-63045393.js → useContentElementEditorState-245f1986.js} +1 -1
  85. data/entry_types/scrolled/package/package.json +4 -3
  86. data/entry_types/scrolled/package/testHelpers.js +4 -2
  87. data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
  88. data/entry_types/scrolled/package/widgets/defaultNavigation.js +39 -4
  89. data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -0
  90. data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +49 -0
  91. data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -0
  92. data/entry_types/scrolled/package/widgets/textInlineFileRights.js +37 -0
  93. data/lib/generators/pageflow/resque/templates/resque.rake +1 -1
  94. data/lib/generators/pageflow/resque/templates/resque.rb +1 -1
  95. data/lib/generators/pageflow/routes/routes_generator.rb +1 -1
  96. data/lib/pageflow/configuration.rb +8 -1
  97. data/lib/pageflow/engine.rb +15 -58
  98. data/lib/pageflow/page_type.rb +1 -1
  99. data/lib/pageflow/paperclip_processors/webp.rb +63 -0
  100. data/lib/pageflow/rails_version.rb +2 -2
  101. data/lib/pageflow/user_mixin.rb +1 -1
  102. data/lib/pageflow/version.rb +1 -1
  103. data/package/config/jest/index.js +3 -1
  104. data/package/editor.js +272 -154
  105. data/package/frontend.js +8 -2
  106. data/package/ui.js +1 -0
  107. data/spec/factories/entries.rb +17 -0
  108. metadata +78 -56
@@ -1,5 +1,5 @@
1
- import { useContentElementConfigurationUpdate, useI18n, useDarkBackground, contentElementWidths, withShadowClassName, paletteColor, Text, EditableInlineText, frontend, useFile, useContentElementEditorState, FitViewport, ContentElementBox, ContentElementFigure, useContentElementLifecycle, usePortraitOrientation, ExpandableImage, Image, usePlayerState, MediaInteractionTracking, useAudioFocus, VideoPlayerControls, PlayerEventContextDataProvider, VideoPlayer, AudioPlayerControls, AudioPlayer, useMediaMuted, useTheme, EditableText, ThirdPartyOptOutInfo, ThirdPartyOptIn, useAtmo, textColorForBackgroundColor, Panorama, utils, ThemeIcon, useLocale, Figure, usePhonePlatform, FullscreenViewer, ToggleFullscreenCornerButton } from 'pageflow-scrolled/frontend';
2
- import React, { useState, useEffect, useMemo, useRef, useCallback, forwardRef } from 'react';
1
+ import { useContentElementConfigurationUpdate, useI18n, useDarkBackground, useContentElementEditorState, useIsStaticPreview, useContentElementLifecycle, utils, contentElementWidths, withShadowClassName, paletteColor, Text, EditableInlineText, frontend, useFileWithInlineRights, FitViewport, ContentElementBox, ContentElementFigure, InlineFileRights, usePortraitOrientation, ExpandableImage, Image, usePlayerState, MediaInteractionTracking, useAudioFocus, VideoPlayerControls, PlayerEventContextDataProvider, VideoPlayer, AudioPlayerControls, AudioPlayer, useMediaMuted, useTheme, EditableText, ThirdPartyOptOutInfo, useFile, ThirdPartyOptIn, useAtmo, textColorForBackgroundColor, Panorama, ThemeIcon, useLocale, Figure, usePhonePlatform, FullscreenViewer, ToggleFullscreenCornerButton } from 'pageflow-scrolled/frontend';
2
+ import React, { useState, useRef, useEffect, useMemo, useCallback, forwardRef } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import ReactCompareImage from 'react-compare-image';
5
5
  import Measure from 'react-measure';
@@ -21,66 +21,6 @@ function _defineProperty(obj, key, value) {
21
21
  return obj;
22
22
  }
23
23
 
24
- var styles = {"darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","root":"Heading-module_root__33TFw","right":"Heading-module_right__1TJKF","light":"Heading-module_light__1TQE8","dark":"Heading-module_dark__18iWa","centerRagged":"Heading-module_centerRagged__388sq","center":"Heading-module_center__38lDY","forcePaddingTop":"Heading-module_forcePaddingTop__30Juh"};
25
-
26
- function Heading(_ref) {
27
- var configuration = _ref.configuration,
28
- sectionProps = _ref.sectionProps,
29
- contentElementWidth = _ref.contentElementWidth;
30
- var level = configuration.level || sectionProps.sectionIndex;
31
- var firstSectionInEntry = level === 0;
32
- var updateConfiguration = useContentElementConfigurationUpdate();
33
-
34
- var _useI18n = useI18n({
35
- locale: 'ui'
36
- }),
37
- t = _useI18n.t;
38
-
39
- var darkBackground = useDarkBackground();
40
- var legacyValue = configuration.children;
41
- var Tag = firstSectionInEntry ? 'h1' : 'h2';
42
- var forcePaddingTop = firstSectionInEntry && !('marginTop' in configuration);
43
- return /*#__PURE__*/React.createElement(Tag, {
44
- className: classNames(styles.root, 'scope-headings', configuration.typographyVariant && "typography-heading-".concat(configuration.typographyVariant), darkBackground ? styles.light : styles.dark, _defineProperty({}, styles.forcePaddingTop, forcePaddingTop), _defineProperty({}, styles[sectionProps.layout], contentElementWidth > contentElementWidths.md || sectionProps.layout === 'centerRagged'), _defineProperty({}, withShadowClassName, !sectionProps.invert)),
45
- style: {
46
- color: paletteColor(configuration.color)
47
- }
48
- }, /*#__PURE__*/React.createElement(Text, {
49
- scaleCategory: getScaleCategory(configuration, firstSectionInEntry),
50
- inline: true
51
- }, /*#__PURE__*/React.createElement(EditableInlineText, {
52
- value: configuration.value,
53
- defaultValue: legacyValue,
54
- hyphens: configuration.hyphens,
55
- placeholder: firstSectionInEntry ? t('pageflow_scrolled.inline_editing.type_title') : t('pageflow_scrolled.inline_editing.type_heading'),
56
- onChange: function onChange(value) {
57
- return updateConfiguration({
58
- value: value
59
- });
60
- }
61
- })));
62
- }
63
-
64
- function getScaleCategory(configuration, firstSectionInEntry) {
65
- switch (configuration.textSize) {
66
- case 'large':
67
- return 'heading-lg';
68
-
69
- case 'medium':
70
- return 'heading-md';
71
-
72
- case 'small':
73
- return 'heading-sm';
74
-
75
- default:
76
- return firstSectionInEntry ? 'heading-lg' : 'heading-sm';
77
- }
78
- }
79
-
80
- frontend.contentElementTypes.register('heading', {
81
- component: Heading
82
- });
83
-
84
24
  function _arrayWithHoles(arr) {
85
25
  if (Array.isArray(arr)) return arr;
86
26
  }
@@ -139,6 +79,139 @@ function _slicedToArray(arr, i) {
139
79
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
140
80
  }
141
81
 
82
+ var styles = {"darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","root":"Heading-module_root__33TFw","animation-fadeIn":"Heading-module_animation-fadeIn__3jlOG","animation-fadeInFast":"Heading-module_animation-fadeInFast__b41KH Heading-module_animation-fadeIn__3jlOG","animation-fadeInSlow":"Heading-module_animation-fadeInSlow__1G1o5 Heading-module_animation-fadeIn__3jlOG","main":"Heading-module_main__35wWK","tagline":"Heading-module_tagline__pvHO5","subtitle":"Heading-module_subtitle__19eD8","animating":"Heading-module_animating__1ziJR","hasTagline":"Heading-module_hasTagline__Pgn8c","right":"Heading-module_right__1TJKF","light":"Heading-module_light__1TQE8","dark":"Heading-module_dark__18iWa","centerRagged":"Heading-module_centerRagged__388sq","center":"Heading-module_center__38lDY","forcePaddingTop":"Heading-module_forcePaddingTop__30Juh"};
83
+
84
+ function Heading(_ref) {
85
+ var configuration = _ref.configuration,
86
+ sectionProps = _ref.sectionProps,
87
+ contentElementWidth = _ref.contentElementWidth;
88
+ var level = configuration.level || sectionProps.sectionIndex;
89
+ var firstSectionInEntry = level === 0;
90
+ var updateConfiguration = useContentElementConfigurationUpdate();
91
+
92
+ var _useI18n = useI18n({
93
+ locale: 'ui'
94
+ }),
95
+ t = _useI18n.t;
96
+
97
+ var darkBackground = useDarkBackground();
98
+
99
+ var _useContentElementEdi = useContentElementEditorState(),
100
+ isSelected = _useContentElementEdi.isSelected,
101
+ isEditable = _useContentElementEdi.isEditable;
102
+
103
+ var legacyValue = configuration.children;
104
+ var Tag = firstSectionInEntry ? 'h1' : 'h2';
105
+ var forcePaddingTop = firstSectionInEntry && !('marginTop' in configuration);
106
+ var entranceAnimation = !useIsStaticPreview() && configuration.entranceAnimation || 'none';
107
+
108
+ var _useState = useState(false),
109
+ _useState2 = _slicedToArray(_useState, 2),
110
+ animating = _useState2[0],
111
+ setAnimating = _useState2[1];
112
+
113
+ useContentElementLifecycle({
114
+ onActivate: function onActivate() {
115
+ setAnimating(entranceAnimation !== 'none');
116
+ },
117
+ onInvisible: function onInvisible() {
118
+ if (isEditable) {
119
+ setAnimating(false);
120
+ }
121
+ }
122
+ });
123
+ var previousAnimation = useRef(entranceAnimation);
124
+ var previouslySelected = useRef(isSelected);
125
+ useEffect(function () {
126
+ if (isEditable && previousAnimation.current !== entranceAnimation) {
127
+ previousAnimation.current = entranceAnimation;
128
+ setAnimating(false);
129
+ setTimeout(function () {
130
+ return setAnimating(true);
131
+ }, 100);
132
+ }
133
+ }, [entranceAnimation, isEditable]);
134
+ useEffect(function () {
135
+ if (!previouslySelected.current && isSelected) {
136
+ setAnimating(true);
137
+ }
138
+
139
+ previouslySelected.current = isSelected;
140
+ }, [isSelected]);
141
+
142
+ function renderSubtitle(name) {
143
+ var value = configuration[name];
144
+
145
+ if (!isSelected && utils.isBlankEditableTextValue(value)) {
146
+ return null;
147
+ }
148
+
149
+ return /*#__PURE__*/React.createElement(Text, {
150
+ scaleCategory: getScaleCategory(configuration, firstSectionInEntry, name)
151
+ }, /*#__PURE__*/React.createElement("div", {
152
+ className: styles[name],
153
+ role: "doc-subtitle"
154
+ }, /*#__PURE__*/React.createElement(EditableInlineText, {
155
+ value: value,
156
+ hyphens: configuration.hyphens,
157
+ placeholder: t("pageflow_scrolled.inline_editing.type_".concat(name)),
158
+ onChange: function onChange(value) {
159
+ return updateConfiguration(_defineProperty({}, name, value));
160
+ }
161
+ })));
162
+ }
163
+
164
+ return /*#__PURE__*/React.createElement("header", {
165
+ className: classNames(styles.root, styles["animation-".concat(entranceAnimation)], _defineProperty({}, styles.animating, animating), _defineProperty({}, styles.hasTagline, !utils.isBlankEditableTextValue(configuration.tagline) || isSelected), _defineProperty({}, styles.forcePaddingTop, forcePaddingTop), _defineProperty({}, styles[sectionProps.layout], contentElementWidth > contentElementWidths.md || sectionProps.layout === 'centerRagged'), _defineProperty({}, withShadowClassName, !sectionProps.invert))
166
+ }, renderSubtitle('tagline'), /*#__PURE__*/React.createElement(Tag, {
167
+ className: classNames(styles.main, 'scope-headings', configuration.typographyVariant && "typography-heading-".concat(configuration.typographyVariant), darkBackground ? styles.light : styles.dark),
168
+ style: {
169
+ color: paletteColor(configuration.color)
170
+ }
171
+ }, /*#__PURE__*/React.createElement(Text, {
172
+ scaleCategory: getScaleCategory(configuration, firstSectionInEntry),
173
+ inline: true
174
+ }, /*#__PURE__*/React.createElement(EditableInlineText, {
175
+ value: configuration.value,
176
+ defaultValue: legacyValue,
177
+ hyphens: configuration.hyphens,
178
+ placeholder: firstSectionInEntry ? t('pageflow_scrolled.inline_editing.type_title') : t('pageflow_scrolled.inline_editing.type_heading'),
179
+ onChange: function onChange(value) {
180
+ return updateConfiguration({
181
+ value: value
182
+ });
183
+ }
184
+ }))), renderSubtitle('subtitle'));
185
+ }
186
+
187
+ function getScaleCategory(configuration, firstSectionInEntry) {
188
+ var suffix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
189
+ var base = "heading".concat(capitalize(suffix));
190
+
191
+ switch (configuration.textSize) {
192
+ case 'large':
193
+ return "".concat(base, "-lg");
194
+
195
+ case 'medium':
196
+ return "".concat(base, "-md");
197
+
198
+ case 'small':
199
+ return "".concat(base, "-sm");
200
+
201
+ default:
202
+ return firstSectionInEntry ? "".concat(base, "-lg") : "".concat(base, "-sm");
203
+ }
204
+ }
205
+
206
+ function capitalize(string) {
207
+ return string.charAt(0).toUpperCase() + string.slice(1);
208
+ }
209
+
210
+ frontend.contentElementTypes.register('heading', {
211
+ component: Heading,
212
+ lifecycle: true
213
+ });
214
+
142
215
  var styles$1 = {"sliderStart":"BeforeAfter-module_sliderStart__2C5cN","container":"BeforeAfter-module_container__2Lm06","wiggle":"BeforeAfter-module_wiggle__3nVSe","SliderLeftRightShake":"BeforeAfter-module_SliderLeftRightShake__2mcn5","BeforeImageLeftRightShake":"BeforeAfter-module_BeforeImageLeftRightShake__38m9V","AfterImageLeftRightShake":"BeforeAfter-module_AfterImageLeftRightShake__3WMf1"};
143
216
 
144
217
  var placeholderForBeforeImage = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQwIiBoZWlnaHQ9IjQwMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDwhLS0gQ3JlYXRlZCB3aXRoIE1ldGhvZCBEcmF3IC0gaHR0cDovL2dpdGh1Yi5jb20vZHVvcGl4ZWwvTWV0aG9kLURyYXcvIC0tPgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9IiMzZDVhODAiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSI0MDUiIHdpZHRoPSI2NDIiIHk9Ii0xIiB4PSItMSIvPgogIDxnIGRpc3BsYXk9Im5vbmUiIG92ZXJmbG93PSJ2aXNpYmxlIiB5PSIwIiB4PSIwIiBoZWlnaHQ9IjEwMCUiIHdpZHRoPSIxMDAlIiBpZD0iY2FudmFzR3JpZCI+CiAgIDxyZWN0IGZpbGw9InVybCgjZ3JpZHBhdHRlcm4pIiBzdHJva2Utd2lkdGg9IjAiIHk9IjAiIHg9IjAiIGhlaWdodD0iMTAwJSIgd2lkdGg9IjEwMCUiLz4KICA8L2c+CiA8L2c+CiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiA8L2c+Cjwvc3ZnPg==';
@@ -150,9 +223,7 @@ var placeholderFile = {
150
223
  function BeforeAfter(configuration) {
151
224
  var isActive = configuration.isActive,
152
225
  load = configuration.load,
153
- before_id = configuration.before_id,
154
226
  before_label = configuration.before_label,
155
- after_id = configuration.after_id,
156
227
  after_label = configuration.after_label,
157
228
  initial_slider_position = configuration.initial_slider_position,
158
229
  slider_color = configuration.slider_color;
@@ -174,13 +245,15 @@ function BeforeAfter(configuration) {
174
245
  return wiggle || isActive;
175
246
  });
176
247
  }, [isActive]);
177
- var beforeImage = useFile({
248
+ var beforeImage = useFileWithInlineRights({
249
+ configuration: configuration,
178
250
  collectionName: 'imageFiles',
179
- permaId: before_id
251
+ propertyName: 'before_id'
180
252
  });
181
- var afterImage = useFile({
253
+ var afterImage = useFileWithInlineRights({
254
+ configuration: configuration,
182
255
  collectionName: 'imageFiles',
183
- permaId: after_id
256
+ propertyName: 'after_id'
184
257
  });
185
258
 
186
259
  var _useContentElementEdi = useContentElementEditorState(),
@@ -191,6 +264,13 @@ function BeforeAfter(configuration) {
191
264
  var afterImageUrl = afterImage && afterImage.urls.large;
192
265
  var afterImageAlt = afterImage && afterImage.configuration.alt;
193
266
  var initialSliderPos = initial_slider_position / 100;
267
+ var inlineFileRightsItems = [{
268
+ file: beforeImage,
269
+ label: 'before'
270
+ }, {
271
+ file: afterImage,
272
+ label: 'after'
273
+ }];
194
274
  return /*#__PURE__*/React.createElement(FitViewport, {
195
275
  file: beforeImage || afterImage || placeholderFile
196
276
  }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
@@ -213,7 +293,13 @@ function BeforeAfter(configuration) {
213
293
  parentSelected: isSelected,
214
294
  position: initial_slider_position
215
295
  }), renderCompareImage());
216
- })))));
296
+ }), /*#__PURE__*/React.createElement(InlineFileRights, {
297
+ context: "insideElement",
298
+ items: inlineFileRightsItems
299
+ })))), /*#__PURE__*/React.createElement(InlineFileRights, {
300
+ context: "afterElement",
301
+ items: inlineFileRightsItems
302
+ }));
217
303
 
218
304
  function renderCompareImage() {
219
305
  if (!load) {
@@ -275,13 +361,15 @@ function InlineImage(_ref) {
275
361
  var contentElementId = _ref.contentElementId,
276
362
  contentElementWidth = _ref.contentElementWidth,
277
363
  configuration = _ref.configuration;
278
- var imageFile = useFile({
364
+ var imageFile = useFileWithInlineRights({
365
+ configuration: configuration,
279
366
  collectionName: 'imageFiles',
280
- permaId: configuration.id
367
+ propertyName: 'id'
281
368
  });
282
- var portraitImageFile = useFile({
369
+ var portraitImageFile = useFileWithInlineRights({
370
+ configuration: configuration,
283
371
  collectionName: 'imageFiles',
284
- permaId: configuration.portraitId
372
+ propertyName: 'portraitId'
285
373
  }); // Only render OrientationAwareInlineImage if a portrait image has
286
374
  // been selected. This prevents having the component rerender on
287
375
  // orientation changes even if it does not depend on orientation at
@@ -348,7 +436,19 @@ function ImageWithCaption(_ref3) {
348
436
  structuredData: true,
349
437
  variant: contentElementWidth === contentElementWidths.full ? 'large' : 'medium',
350
438
  preferSvg: true
351
- }))))));
439
+ })), /*#__PURE__*/React.createElement(InlineFileRights, {
440
+ context: "insideElement",
441
+ items: [{
442
+ file: imageFile,
443
+ label: 'image'
444
+ }]
445
+ })))), /*#__PURE__*/React.createElement(InlineFileRights, {
446
+ context: "afterElement",
447
+ items: [{
448
+ file: imageFile,
449
+ label: 'image'
450
+ }]
451
+ }));
352
452
  }
353
453
 
354
454
  frontend.contentElementTypes.register('inlineImage', {
@@ -461,21 +561,25 @@ function getPlayerClickHandler(_ref) {
461
561
  function InlineVideo(_ref) {
462
562
  var contentElementId = _ref.contentElementId,
463
563
  configuration = _ref.configuration;
464
- var videoFile = useFile({
564
+ var videoFile = useFileWithInlineRights({
565
+ configuration: configuration,
465
566
  collectionName: 'videoFiles',
466
- permaId: configuration.id
567
+ propertyName: 'id'
467
568
  });
468
- var posterImageFile = useFile({
569
+ var posterImageFile = useFileWithInlineRights({
570
+ configuration: configuration,
469
571
  collectionName: 'imageFiles',
470
- permaId: configuration.posterId
572
+ propertyName: 'posterId'
471
573
  });
472
- var portraitVideoFile = useFile({
574
+ var portraitVideoFile = useFileWithInlineRights({
575
+ configuration: configuration,
473
576
  collectionName: 'videoFiles',
474
- permaId: configuration.portraitId
577
+ propertyName: 'portraitId'
475
578
  });
476
- var portraitPosterImageFile = useFile({
579
+ var portraitPosterImageFile = useFileWithInlineRights({
580
+ configuration: configuration,
477
581
  collectionName: 'imageFiles',
478
- permaId: configuration.portraitPosterId
582
+ propertyName: 'portraitPosterId'
479
583
  }); // Only render OrientationAwareInlineImage if a portrait image has
480
584
  // been selected. This prevents having the component rerender on
481
585
  // orientation changes even if it does not depend on orientation at
@@ -530,6 +634,13 @@ function OrientationUnawareInlineVideo(_ref3) {
530
634
  playerState = _usePlayerState2[0],
531
635
  playerActions = _usePlayerState2[1];
532
636
 
637
+ var inlineFileRightsItems = [{
638
+ label: 'video',
639
+ file: videoFile
640
+ }, {
641
+ label: 'poster',
642
+ file: posterImageFile
643
+ }];
533
644
  return /*#__PURE__*/React.createElement(MediaInteractionTracking, {
534
645
  playerState: playerState,
535
646
  playerActions: playerActions
@@ -545,16 +656,21 @@ function OrientationUnawareInlineVideo(_ref3) {
545
656
  key: configuration.playbackMode === 'loop',
546
657
  videoFile: videoFile,
547
658
  posterImageFile: posterImageFile,
659
+ inlineFileRightsItems: inlineFileRightsItems,
548
660
  playerState: playerState,
549
661
  playerActions: playerActions,
550
662
  contentElementId: contentElementId,
551
663
  configuration: configuration
552
- }))))));
664
+ })))), /*#__PURE__*/React.createElement(InlineFileRights, {
665
+ context: "afterElement",
666
+ items: inlineFileRightsItems
667
+ })));
553
668
  }
554
669
 
555
670
  function Player(_ref4) {
556
671
  var videoFile = _ref4.videoFile,
557
672
  posterImageFile = _ref4.posterImageFile,
673
+ inlineFileRightsItems = _ref4.inlineFileRightsItems,
558
674
  playerState = _ref4.playerState,
559
675
  playerActions = _ref4.playerActions,
560
676
  contentElementId = _ref4.contentElementId,
@@ -609,6 +725,7 @@ function Player(_ref4) {
609
725
  playerActions: playerActions,
610
726
  hideControlBar: configuration.hideControlBar || configuration.playbackMode === 'loop',
611
727
  hideBigPlayButton: configuration.playbackMode === 'loop',
728
+ inlineFileRightsItems: inlineFileRightsItems,
612
729
  configuration: configuration,
613
730
  onPlayerClick: onPlayerClick
614
731
  }, /*#__PURE__*/React.createElement(PlayerEventContextDataProvider, {
@@ -638,13 +755,15 @@ frontend.contentElementTypes.register('inlineVideo', {
638
755
  function InlineAudio(_ref) {
639
756
  var contentElementId = _ref.contentElementId,
640
757
  configuration = _ref.configuration;
641
- var audioFile = useFile({
758
+ var audioFile = useFileWithInlineRights({
759
+ configuration: configuration,
642
760
  collectionName: 'audioFiles',
643
- permaId: configuration.id
761
+ propertyName: 'id'
644
762
  });
645
- var posterImageFile = useFile({
763
+ var posterImageFile = useFileWithInlineRights({
764
+ configuration: configuration,
646
765
  collectionName: 'imageFiles',
647
- permaId: configuration.posterId
766
+ propertyName: 'posterId'
648
767
  });
649
768
 
650
769
  var _usePlayerState = usePlayerState(),
@@ -689,6 +808,13 @@ function InlineAudio(_ref) {
689
808
  }
690
809
  };
691
810
 
811
+ var inlineFileRightsItems = [{
812
+ label: 'audio',
813
+ file: audioFile
814
+ }, {
815
+ label: 'image',
816
+ file: posterImageFile
817
+ }];
692
818
  return /*#__PURE__*/React.createElement(FitViewport, {
693
819
  file: posterImageFile
694
820
  }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
@@ -699,6 +825,7 @@ function InlineAudio(_ref) {
699
825
  playerState: playerState,
700
826
  playerActions: playerActions,
701
827
  standAlone: !posterImageFile,
828
+ inlineFileRightsItems: inlineFileRightsItems,
702
829
  configuration: configuration,
703
830
  onPlayerClick: onPlayerClick
704
831
  }, /*#__PURE__*/React.createElement(PlayerEventContextDataProvider, {
@@ -715,7 +842,10 @@ function InlineAudio(_ref) {
715
842
  quality: 'high',
716
843
  playsInline: true,
717
844
  atmoDuringPlayback: configuration.atmoDuringPlayback
718
- })))))));
845
+ })))))), /*#__PURE__*/React.createElement(InlineFileRights, {
846
+ context: "afterElement",
847
+ items: inlineFileRightsItems
848
+ }));
719
849
  }
720
850
 
721
851
  frontend.contentElementTypes.register('inlineAudio', {
@@ -1373,9 +1503,10 @@ function VrImage(_ref) {
1373
1503
  isEditable = _useContentElementEdi.isEditable,
1374
1504
  isSelected = _useContentElementEdi.isSelected;
1375
1505
 
1376
- var imageFile = useFile({
1506
+ var imageFile = useFileWithInlineRights({
1507
+ configuration: configuration,
1377
1508
  collectionName: 'imageFiles',
1378
- permaId: configuration.image
1509
+ propertyName: 'image'
1379
1510
  });
1380
1511
  return /*#__PURE__*/React.createElement("div", {
1381
1512
  style: {
@@ -1385,7 +1516,19 @@ function VrImage(_ref) {
1385
1516
  aspectRatio: contentElementWidth === contentElementWidths.full ? 0.5 : 0.75
1386
1517
  }, /*#__PURE__*/React.createElement(ContentElementBox, null, /*#__PURE__*/React.createElement(ContentElementFigure, {
1387
1518
  configuration: configuration
1388
- }, /*#__PURE__*/React.createElement(FitViewport.Content, null, renderLazyPanorama(configuration, imageFile, shouldLoad))))));
1519
+ }, /*#__PURE__*/React.createElement(FitViewport.Content, null, renderLazyPanorama(configuration, imageFile, shouldLoad), /*#__PURE__*/React.createElement(InlineFileRights, {
1520
+ context: "insideElement",
1521
+ items: [{
1522
+ file: imageFile,
1523
+ label: 'image'
1524
+ }]
1525
+ })))), /*#__PURE__*/React.createElement(InlineFileRights, {
1526
+ context: "afterElement",
1527
+ items: [{
1528
+ file: imageFile,
1529
+ label: 'image'
1530
+ }]
1531
+ })));
1389
1532
  }
1390
1533
 
1391
1534
  function renderLazyPanorama(configuration, imageFile, shouldLoad) {
@@ -2231,9 +2374,10 @@ var Item = forwardRef(function (_ref5, ref) {
2231
2374
  shouldLoad = _useContentElementLif.shouldLoad;
2232
2375
 
2233
2376
  var caption = captions[item.id];
2234
- var imageFile = useFile({
2377
+ var imageFile = useFileWithInlineRights({
2378
+ configuration: item,
2235
2379
  collectionName: 'imageFiles',
2236
- permaId: item.image
2380
+ propertyName: 'image'
2237
2381
  });
2238
2382
 
2239
2383
  var handleCaptionChange = function handleCaptionChange(caption) {
@@ -2262,7 +2406,19 @@ var Item = forwardRef(function (_ref5, ref) {
2262
2406
  }, /*#__PURE__*/React.createElement(Image, {
2263
2407
  imageFile: imageFile,
2264
2408
  load: shouldLoad
2265
- })), children))))));
2409
+ })), children, /*#__PURE__*/React.createElement(InlineFileRights, {
2410
+ context: "insideElement",
2411
+ items: [{
2412
+ file: imageFile,
2413
+ label: 'image'
2414
+ }]
2415
+ })))), /*#__PURE__*/React.createElement(InlineFileRights, {
2416
+ context: "afterElement",
2417
+ items: [{
2418
+ file: imageFile,
2419
+ label: 'image'
2420
+ }]
2421
+ }))));
2266
2422
  });
2267
2423
 
2268
2424
  frontend.contentElementTypes.register('imageGallery', {