pageflow 15.1.0 → 15.2.2
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 +92 -161
- data/README.md +1 -2
- data/admins/pageflow/accounts.rb +94 -19
- data/app/assets/javascripts/pageflow/admin/accounts.js +3 -3
- data/app/assets/javascripts/pageflow/dist/frontend.js +2 -0
- data/app/assets/javascripts/pageflow/dist/ui.js +9 -0
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/background_image.scss +4 -0
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +5 -0
- data/app/controllers/pageflow/editor/widgets_controller.rb +1 -1
- data/app/helpers/pageflow/pages_helper.rb +1 -0
- data/app/models/pageflow/account.rb +6 -0
- data/app/models/pageflow/draft_entry.rb +13 -3
- data/app/models/pageflow/entry.rb +8 -1
- data/app/models/pageflow/entry_template.rb +55 -0
- data/app/models/pageflow/published_entry.rb +13 -3
- data/app/models/pageflow/revision.rb +1 -1
- data/app/models/pageflow/theming.rb +8 -47
- data/app/policies/pageflow/entry_template_policy.rb +18 -0
- data/app/policies/pageflow/theming_policy.rb +0 -4
- data/app/views/admin/accounts/_configuration_label.html.erb +5 -0
- data/app/views/admin/accounts/_entry_template_details.html.arb +17 -0
- data/app/views/admin/accounts/_form.html.erb +43 -23
- data/app/views/admin/accounts/_share_providers_label.html.erb +5 -0
- data/app/views/admin/accounts/_theming_details.html.arb +0 -12
- data/app/views/pageflow/themes/_theme.json.jbuilder +1 -0
- data/config/locales/de.yml +12 -7
- data/config/locales/en.yml +12 -7
- data/db/migrate/20200122115400_create_pageflow_entry_templates.rb +75 -0
- data/db/migrate/20200206134400_convert_legacy_scrolled_content_element_types.rb +48 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +42 -4
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +1 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +4 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/i18n_helper.rb +35 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +14 -2
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +10 -1
- data/entry_types/scrolled/config/locales/new/de.yml +231 -8
- data/entry_types/scrolled/config/locales/new/en.yml +228 -10
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +3 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +9 -4
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +96 -0
- data/entry_types/scrolled/package/contentElements-editor.js +410 -0
- data/entry_types/scrolled/package/contentElements-frontend.js +533 -0
- data/entry_types/scrolled/package/editor.js +498 -2561
- data/entry_types/scrolled/package/frontend.js +713 -1238
- data/entry_types/scrolled/package/package.json +12 -2
- data/lib/pageflow/ability_mixin.rb +3 -2
- data/lib/pageflow/seeds.rb +0 -2
- data/lib/pageflow/theme.rb +4 -0
- data/lib/pageflow/themes.rb +5 -1
- data/lib/pageflow/version.rb +1 -1
- data/packages/pageflow/config/jest/index.js +0 -1
- data/packages/pageflow/config/jest/transformers/jst.js +1 -1
- data/packages/pageflow/config/webpack.js +0 -1
- data/packages/pageflow/editor.js +33 -4
- data/packages/pageflow/package.json +2 -1
- data/packages/pageflow/testHelpers.js +367 -4
- data/packages/pageflow/ui.js +9 -0
- data/spec/factories/accounts.rb +6 -0
- data/spec/factories/entry_templates.rb +8 -0
- data/spec/factories/published_entries.rb +3 -1
- data/spec/factories/themings.rb +0 -1
- metadata +14 -4
- data/app/assets/javascripts/pageflow/dist/editor.js +0 -11881
- data/app/assets/javascripts/pageflow/dist/index.js +0 -3
@@ -0,0 +1,533 @@
|
|
1
|
+
import { Text, frontend, useFile, useEditorSelection, useOnScreen, Image, InlineCaption, Video, useMediaSettings, useI18n } from 'pageflow-scrolled/frontend';
|
2
|
+
import React, { useRef, useState, useEffect } from 'react';
|
3
|
+
import classNames from 'classnames';
|
4
|
+
import ReactCompareImage from 'react-compare-image';
|
5
|
+
import ReactPlayer from 'react-player';
|
6
|
+
|
7
|
+
function _defineProperty(obj, key, value) {
|
8
|
+
if (key in obj) {
|
9
|
+
Object.defineProperty(obj, key, {
|
10
|
+
value: value,
|
11
|
+
enumerable: true,
|
12
|
+
configurable: true,
|
13
|
+
writable: true
|
14
|
+
});
|
15
|
+
} else {
|
16
|
+
obj[key] = value;
|
17
|
+
}
|
18
|
+
|
19
|
+
return obj;
|
20
|
+
}
|
21
|
+
|
22
|
+
function styleInject(css, ref) {
|
23
|
+
if ( ref === void 0 ) ref = {};
|
24
|
+
var insertAt = ref.insertAt;
|
25
|
+
|
26
|
+
if (!css || typeof document === 'undefined') { return; }
|
27
|
+
|
28
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
29
|
+
var style = document.createElement('style');
|
30
|
+
style.type = 'text/css';
|
31
|
+
|
32
|
+
if (insertAt === 'top') {
|
33
|
+
if (head.firstChild) {
|
34
|
+
head.insertBefore(style, head.firstChild);
|
35
|
+
} else {
|
36
|
+
head.appendChild(style);
|
37
|
+
}
|
38
|
+
} else {
|
39
|
+
head.appendChild(style);
|
40
|
+
}
|
41
|
+
|
42
|
+
if (style.styleSheet) {
|
43
|
+
style.styleSheet.cssText = css;
|
44
|
+
} else {
|
45
|
+
style.appendChild(document.createTextNode(css));
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
var css = ".Heading-module_root__33TFw {\n margin-top: 0.2em;\n margin-bottom: 0.5em;\n padding-top: 0.3em;\n}\n\n@media (orientation: landscape) {\n .Heading-module_first__1PMJX {\n padding-top: 25%;\n }\n}\n";
|
50
|
+
var styles = {"root":"Heading-module_root__33TFw","first":"Heading-module_first__1PMJX"};
|
51
|
+
styleInject(css);
|
52
|
+
|
53
|
+
function Heading(_ref) {
|
54
|
+
var configuration = _ref.configuration;
|
55
|
+
return React.createElement("h1", {
|
56
|
+
className: classNames(styles.root, _defineProperty({}, styles.first, configuration.first))
|
57
|
+
}, React.createElement(Text, {
|
58
|
+
scaleCategory: configuration.first ? 'h1' : 'h2',
|
59
|
+
inline: true
|
60
|
+
}, configuration.children));
|
61
|
+
}
|
62
|
+
|
63
|
+
frontend.contentElementTypes.register('heading', {
|
64
|
+
component: Heading
|
65
|
+
});
|
66
|
+
|
67
|
+
function _arrayWithHoles(arr) {
|
68
|
+
if (Array.isArray(arr)) return arr;
|
69
|
+
}
|
70
|
+
|
71
|
+
function _iterableToArrayLimit(arr, i) {
|
72
|
+
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
|
76
|
+
var _arr = [];
|
77
|
+
var _n = true;
|
78
|
+
var _d = false;
|
79
|
+
var _e = undefined;
|
80
|
+
|
81
|
+
try {
|
82
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
83
|
+
_arr.push(_s.value);
|
84
|
+
|
85
|
+
if (i && _arr.length === i) break;
|
86
|
+
}
|
87
|
+
} catch (err) {
|
88
|
+
_d = true;
|
89
|
+
_e = err;
|
90
|
+
} finally {
|
91
|
+
try {
|
92
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
93
|
+
} finally {
|
94
|
+
if (_d) throw _e;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
return _arr;
|
99
|
+
}
|
100
|
+
|
101
|
+
function _nonIterableRest() {
|
102
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
103
|
+
}
|
104
|
+
|
105
|
+
function _slicedToArray(arr, i) {
|
106
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
107
|
+
}
|
108
|
+
|
109
|
+
var css$1 = ".BeforeAfter-module_sliderStart__2C5cN {\n background-color: white;\n position: absolute;\n z-index: 1;\n}\n\n.BeforeAfter-module_container__2Lm06 {\n /* slider default position: 50%, spacing around labels in\n react-compare-image: 5% each side, so default label max width\n should be 40%. This is only a fallback. We should receive widths\n from BeforeAfter.js */\n --default-label-max-width: 40%;\n /* label padding in react-compare-image is set to 20px left and right,\n so we need to subtract the sum from max width */\n --label-padding: 40px;\n --wiggle-animation: 1.5s cubic-bezier(.36,.07,.19,.97) both;\n --frame1pos: -8;\n --frame2pos: 16;\n --frame3pos: -32;\n --frame4pos: 32;\n --frame1px: calc(var(--frame1pos) * 1px);\n --frame2px: calc(var(--frame2pos) * 1px);\n --frame3px: calc(var(--frame3pos) * 1px);\n --frame4px: calc(var(--frame4pos) * 1px);\n --frame1percent: calc(var(--frame1pos) * 2.5%);\n --frame2percent: calc(var(--frame2pos) * 2.5%);\n --frame3percent: calc(var(--frame3pos) * 2.5%);\n --frame4percent: calc(var(--frame4pos) * 2.5%);\n /* in addition to the above variables, we receive --initial-rect-width\n from BeforeAfter.js, which has no sensible default value */\n}\n\n/* With react-compare-image 2.0.4 (commit 7410d14), this selects the\n slider */\n.BeforeAfter-module_container__2Lm06.BeforeAfter-module_wiggle__3nVSe div div:nth-child(3) {\n animation: BeforeAfter-module_SliderLeftRightShake__2mcn5 var(--wiggle-animation);\n}\n\n/* With react-compare-image 2.0.4 (commit 7410d14), this selects the\n before image */\n.BeforeAfter-module_container__2Lm06.BeforeAfter-module_wiggle__3nVSe div img:nth-child(2) {\n animation: BeforeAfter-module_BeforeImageLeftRightShake__38m9V var(--wiggle-animation);\n}\n\n/* With react-compare-image 2.0.4 (commit 7410d14), this selects the\n before label */\n.BeforeAfter-module_container__2Lm06 div div:nth-child(4) div {\n max-width: calc(var(--before-label-max-width, var(--default-label-max-width)) -\n var(--label-padding));\n}\n\n/* With react-compare-image 2.0.4 (commit 7410d14), this selects the\n after image */\n.BeforeAfter-module_container__2Lm06.BeforeAfter-module_wiggle__3nVSe div img:nth-child(1) {\n animation: BeforeAfter-module_AfterImageLeftRightShake__3WMf1 var(--wiggle-animation);\n}\n\n/* With react-compare-image 2.0.4 (commit 7410d14), this selects the\n after label */\n.BeforeAfter-module_container__2Lm06 div div:nth-child(5) div {\n max-width: calc(var(--after-label-max-width, var(--default-label-max-width)) -\n var(--label-padding));\n}\n\n@keyframes BeforeAfter-module_BeforeImageLeftRightShake__38m9V {\n 10%, 90% {\n clip: rect(auto, calc(var(--initial-rect-width) + var(--frame1px)), auto, auto);\n }\n\n 20%, 80% {\n clip: rect(auto, calc(var(--initial-rect-width) + var(--frame2px)), auto, auto);\n }\n\n 30%, 50%, 70% {\n clip: rect(auto, calc(var(--initial-rect-width) + var(--frame3px)), auto, auto);\n }\n\n 40%, 60% {\n clip: rect(auto, calc(var(--initial-rect-width) + var(--frame4px)), auto, auto);\n }\n}\n\n@keyframes BeforeAfter-module_AfterImageLeftRightShake__3WMf1 {\n 10%, 90% {\n clip: rect(auto, auto, auto, calc(var(--initial-rect-width) + var(--frame1px)));\n }\n\n 20%, 80% {\n clip: rect(auto, auto, auto, calc(var(--initial-rect-width) + var(--frame2px)));\n }\n\n 30%, 50%, 70% {\n clip: rect(auto, auto, auto, calc(var(--initial-rect-width) + var(--frame3px)));\n }\n\n 40%, 60% {\n clip: rect(auto, auto, auto, calc(var(--initial-rect-width) + var(--frame4px)));\n }\n}\n\n@keyframes BeforeAfter-module_SliderLeftRightShake__2mcn5 {\n 10%, 90% {\n transform: translate3d(var(--frame1percent), 0, 0);\n }\n\n 20%, 80% {\n transform: translate3d(var(--frame2percent), 0, 0);\n }\n\n 30%, 50%, 70% {\n transform: translate3d(var(--frame3percent), 0, 0);\n }\n\n 40%, 60% {\n transform: translate3d(var(--frame4percent), 0, 0);\n }\n}\n";
|
110
|
+
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"};
|
111
|
+
styleInject(css$1);
|
112
|
+
|
113
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
114
|
+
|
115
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
116
|
+
function BeforeAfter(_ref) {
|
117
|
+
var _cx;
|
118
|
+
|
119
|
+
var state = _ref.state,
|
120
|
+
before_id = _ref.before_id,
|
121
|
+
before_label = _ref.before_label,
|
122
|
+
after_id = _ref.after_id,
|
123
|
+
after_label = _ref.after_label,
|
124
|
+
initial_slider_position = _ref.initial_slider_position,
|
125
|
+
slider = _ref.slider,
|
126
|
+
slider_color = _ref.slider_color,
|
127
|
+
slider_handle = _ref.slider_handle,
|
128
|
+
contentElementId = _ref.contentElementId;
|
129
|
+
var beforeAfterRef = useRef();
|
130
|
+
var current = beforeAfterRef.current;
|
131
|
+
|
132
|
+
var _useState = useState(false),
|
133
|
+
_useState2 = _slicedToArray(_useState, 2),
|
134
|
+
wiggled = _useState2[0],
|
135
|
+
setWiggled = _useState2[1];
|
136
|
+
|
137
|
+
var _useState3 = useState(false),
|
138
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
139
|
+
wiggle = _useState4[0],
|
140
|
+
setWiggle = _useState4[1];
|
141
|
+
|
142
|
+
useEffect(function () {
|
143
|
+
var node = current;
|
144
|
+
|
145
|
+
if (node) {
|
146
|
+
// Only wiggle once per element, when it is active for the first
|
147
|
+
// time
|
148
|
+
var shouldWiggle = !wiggled && state === 'active';
|
149
|
+
setWiggle(shouldWiggle); // If wiggle was just set, mark this element as one that already
|
150
|
+
// wiggled
|
151
|
+
|
152
|
+
!wiggled && setWiggled(shouldWiggle);
|
153
|
+
}
|
154
|
+
}, [state, current]);
|
155
|
+
var beforeImage = useFile({
|
156
|
+
collectionName: 'imageFiles',
|
157
|
+
permaId: before_id
|
158
|
+
});
|
159
|
+
var afterImage = useFile({
|
160
|
+
collectionName: 'imageFiles',
|
161
|
+
permaId: after_id
|
162
|
+
});
|
163
|
+
|
164
|
+
var _useEditorSelection = useEditorSelection({
|
165
|
+
id: contentElementId,
|
166
|
+
type: 'contentElement'
|
167
|
+
}),
|
168
|
+
isSelected = _useEditorSelection.isSelected;
|
169
|
+
|
170
|
+
var beforeImageUrl = beforeImage && beforeImage.urls.large;
|
171
|
+
var beforeImageAlt = beforeImage && beforeImage.configuration.alt;
|
172
|
+
var afterImageUrl = afterImage && afterImage.urls.large;
|
173
|
+
var afterImageAlt = afterImage && afterImage.configuration.alt;
|
174
|
+
var initialSliderPos = initial_slider_position / 100;
|
175
|
+
var opts = {}; // Transform slider-related props into the format that
|
176
|
+
// react-compare-image needs
|
177
|
+
|
178
|
+
if (!slider) {
|
179
|
+
opts = _objectSpread({}, opts, {
|
180
|
+
sliderLineWidth: 0,
|
181
|
+
handle: React.createElement(React.Fragment, null)
|
182
|
+
});
|
183
|
+
}
|
184
|
+
|
185
|
+
if (slider) {
|
186
|
+
if (!slider_handle) {
|
187
|
+
opts = _objectSpread({}, opts, {
|
188
|
+
handle: React.createElement(React.Fragment, null)
|
189
|
+
});
|
190
|
+
}
|
191
|
+
|
192
|
+
if (slider_color) {
|
193
|
+
opts = _objectSpread({}, opts, {
|
194
|
+
sliderLineColor: slider_color
|
195
|
+
});
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
199
|
+
if (current) {
|
200
|
+
// Size labels according to initial slider position. Unit is %,
|
201
|
+
// left and right spacing is 5%, so we subtract 10. 90 = 100 - 10.
|
202
|
+
var beforeLabelWidth = initial_slider_position - 10;
|
203
|
+
var afterLabelWidth = 90 - initial_slider_position; // Compute initial slider coordinate and pass it as a CSS
|
204
|
+
// variable, so that before/after images can wiggle together with
|
205
|
+
// the slider
|
206
|
+
|
207
|
+
var containerWidth = current.getBoundingClientRect().width;
|
208
|
+
var initialRectWidth = initialSliderPos * containerWidth;
|
209
|
+
current.style.setProperty('--before-label-max-width', beforeLabelWidth + '%');
|
210
|
+
current.style.setProperty('--after-label-max-width', afterLabelWidth + '%');
|
211
|
+
current.style.setProperty('--initial-rect-width', initialRectWidth + 'px');
|
212
|
+
}
|
213
|
+
|
214
|
+
return React.createElement("div", {
|
215
|
+
ref: beforeAfterRef,
|
216
|
+
className: classNames((_cx = {}, _defineProperty(_cx, styles$1.selected, isSelected), _defineProperty(_cx, styles$1.wiggle, wiggle), _cx), styles$1.container)
|
217
|
+
}, React.createElement(InitialSliderPositionIndicator, {
|
218
|
+
parentSelected: isSelected,
|
219
|
+
position: initial_slider_position
|
220
|
+
}), React.createElement(ReactCompareImage, Object.assign({
|
221
|
+
leftImage: beforeImageUrl,
|
222
|
+
rightImage: afterImageUrl,
|
223
|
+
leftImageLabel: before_label,
|
224
|
+
rightImageLabel: after_label,
|
225
|
+
leftImageAlt: beforeImageAlt,
|
226
|
+
rightImageAlt: afterImageAlt,
|
227
|
+
sliderPositionPercentage: initialSliderPos,
|
228
|
+
onSliderPositionChange: function onSliderPositionChange() {
|
229
|
+
return setWiggle(false);
|
230
|
+
}
|
231
|
+
}, opts)));
|
232
|
+
}
|
233
|
+
|
234
|
+
function InitialSliderPositionIndicator(_ref2) {
|
235
|
+
var parentSelected = _ref2.parentSelected,
|
236
|
+
position = _ref2.position;
|
237
|
+
var indicatorWidth = '2px';
|
238
|
+
var indicatorStyles = {
|
239
|
+
left: "calc(".concat(position, "% - ").concat(indicatorWidth, "/2)"),
|
240
|
+
width: "".concat(indicatorWidth),
|
241
|
+
height: '100%',
|
242
|
+
borderLeft: '1px solid black',
|
243
|
+
borderRight: '1px solid black'
|
244
|
+
}; // In case this element is selected, and its initial slider position
|
245
|
+
// is not in the middle, we show InitialSliderPositionIndicator
|
246
|
+
|
247
|
+
return parentSelected && position !== 50 ? React.createElement("div", {
|
248
|
+
className: styles$1.sliderStart,
|
249
|
+
style: indicatorStyles
|
250
|
+
}) : '';
|
251
|
+
}
|
252
|
+
|
253
|
+
var css$2 = ".InlineBeforeAfter-module_root__1f5oG {\n position: relative;\n margin: 0 auto;\n}\n";
|
254
|
+
var styles$2 = {"root":"InlineBeforeAfter-module_root__1f5oG"};
|
255
|
+
styleInject(css$2);
|
256
|
+
|
257
|
+
function InlineBeforeAfter(props) {
|
258
|
+
var ref = useRef();
|
259
|
+
var onScreen = useOnScreen(ref, '-50% 0px -50% 0px');
|
260
|
+
return React.createElement("div", {
|
261
|
+
ref: ref,
|
262
|
+
className: styles$2.root
|
263
|
+
}, React.createElement(BeforeAfter, Object.assign({}, props.configuration, {
|
264
|
+
state: onScreen ? 'active' : 'inactive',
|
265
|
+
contentElementId: props.contentElementId
|
266
|
+
})));
|
267
|
+
}
|
268
|
+
|
269
|
+
frontend.contentElementTypes.register('inlineBeforeAfter', {
|
270
|
+
component: InlineBeforeAfter
|
271
|
+
});
|
272
|
+
|
273
|
+
var css$3 = ".InlineImage-module_root__3edeH {\n position: relative;\n margin-top: 1em;\n}\n\n.InlineImage-module_container__30JBC {\n position: relative;\n margin-top: 1em;\n}\n\n.InlineImage-module_spacer__2yTJT {\n padding-top: 75%;\n}\n\n.InlineImage-module_inner__3WcPa {\n border: solid 2px #fff;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n}\n";
|
274
|
+
var styles$3 = {"root":"InlineImage-module_root__3edeH","container":"InlineImage-module_container__30JBC","spacer":"InlineImage-module_spacer__2yTJT","inner":"InlineImage-module_inner__3WcPa"};
|
275
|
+
styleInject(css$3);
|
276
|
+
|
277
|
+
function InlineImage(_ref) {
|
278
|
+
var configuration = _ref.configuration;
|
279
|
+
return React.createElement("div", {
|
280
|
+
className: classNames(styles$3.root)
|
281
|
+
}, React.createElement("div", {
|
282
|
+
className: styles$3.container
|
283
|
+
}, React.createElement("div", {
|
284
|
+
className: styles$3.spacer
|
285
|
+
}, React.createElement("div", {
|
286
|
+
className: styles$3.inner
|
287
|
+
}, React.createElement(Image, configuration)))), React.createElement(InlineCaption, {
|
288
|
+
text: configuration.caption
|
289
|
+
}));
|
290
|
+
}
|
291
|
+
|
292
|
+
frontend.contentElementTypes.register('inlineImage', {
|
293
|
+
component: InlineImage
|
294
|
+
});
|
295
|
+
|
296
|
+
var css$4 = ".InlineVideo-module_root__26uiY {\n position: relative;\n max-height: 98vh;\n}\n\n.InlineVideo-module_inner__3n7y4 {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n}\n\n/* Timeline in native video controls is hidden in Storybook to prevent\n Percy from detecting different loading progress as visual\n change. See .storybook/preview-head.html file. */\n";
|
297
|
+
var styles$4 = {"root":"InlineVideo-module_root__26uiY","inner":"InlineVideo-module_inner__3n7y4"};
|
298
|
+
styleInject(css$4);
|
299
|
+
|
300
|
+
function InlineVideo(_ref) {
|
301
|
+
var configuration = _ref.configuration;
|
302
|
+
var ref = useRef();
|
303
|
+
var onScreen = useOnScreen(ref, '-50% 0px -50% 0px');
|
304
|
+
return React.createElement("div", {
|
305
|
+
ref: ref,
|
306
|
+
className: classNames(styles$4.root)
|
307
|
+
}, React.createElement("div", {
|
308
|
+
style: {
|
309
|
+
paddingTop: configuration.wideFormat ? '41.15%' : '56.25%'
|
310
|
+
}
|
311
|
+
}, React.createElement("div", {
|
312
|
+
className: styles$4.inner
|
313
|
+
}, React.createElement(Video, Object.assign({}, configuration, {
|
314
|
+
state: onScreen ? 'active' : 'inactive',
|
315
|
+
interactive: true
|
316
|
+
})))));
|
317
|
+
}
|
318
|
+
|
319
|
+
frontend.contentElementTypes.register('inlineVideo', {
|
320
|
+
component: InlineVideo
|
321
|
+
});
|
322
|
+
|
323
|
+
var css$5 = ".SoundDisclaimer-module_soundDisclaimer__31hWh {\n text-align: center;\n border: 1px solid white;\n border-radius: 4px;\n cursor: pointer;\n font-size: inherit;\n}\n\n.SoundDisclaimer-module_soundDisclaimer__31hWh:hover {\n background: rgba(255, 255, 255, 0.25);\n}";
|
324
|
+
var styles$5 = {"soundDisclaimer":"SoundDisclaimer-module_soundDisclaimer__31hWh"};
|
325
|
+
styleInject(css$5);
|
326
|
+
|
327
|
+
function SoundDisclaimer() {
|
328
|
+
var mediaSettings = useMediaSettings();
|
329
|
+
|
330
|
+
var _useI18n = useI18n(),
|
331
|
+
t = _useI18n.t;
|
332
|
+
|
333
|
+
return React.createElement("div", {
|
334
|
+
className: classNames(styles$5.soundDisclaimer),
|
335
|
+
onClick: function onClick() {
|
336
|
+
return mediaSettings.setMuted(false);
|
337
|
+
}
|
338
|
+
}, React.createElement("p", {
|
339
|
+
dangerouslySetInnerHTML: {
|
340
|
+
__html: t('pageflow_scrolled.public.sound_disclaimer.help_text')
|
341
|
+
}
|
342
|
+
}));
|
343
|
+
}
|
344
|
+
|
345
|
+
frontend.contentElementTypes.register('soundDisclaimer', {
|
346
|
+
component: SoundDisclaimer
|
347
|
+
});
|
348
|
+
|
349
|
+
var css$6 = ".TextBlock-module_text__21Hk4 {\n padding: 0;\n margin: 1em 0;\n text-shadow: none;\n}\n\n.TextBlock-module_dummy__2KicI {\n opacity: 0.7;\n}\n\n.TextBlock-module_text__21Hk4 a {\n color: #fff;\n word-wrap: break-word;\n}\n\n.TextBlock-module_text__21Hk4 ol,\n.TextBlock-module_text__21Hk4 ul {\n padding-left: 20px;\n}\n";
|
350
|
+
var styles$6 = {"text":"TextBlock-module_text__21Hk4","dummy":"TextBlock-module_dummy__2KicI"};
|
351
|
+
styleInject(css$6);
|
352
|
+
|
353
|
+
function TextBlock(_ref) {
|
354
|
+
var configuration = _ref.configuration;
|
355
|
+
return React.createElement(Text, {
|
356
|
+
scaleCategory: "body"
|
357
|
+
}, React.createElement("div", {
|
358
|
+
className: classNames(styles$6.text, _defineProperty({}, styles$6.dummy, configuration.dummy)),
|
359
|
+
dangerouslySetInnerHTML: {
|
360
|
+
__html: configuration.children
|
361
|
+
}
|
362
|
+
}));
|
363
|
+
}
|
364
|
+
|
365
|
+
frontend.contentElementTypes.register('textBlock', {
|
366
|
+
component: TextBlock
|
367
|
+
});
|
368
|
+
|
369
|
+
var css$7 = ".VideoEmbed-module_VideoEmbed__3BUjc {\n margin-bottom: 15px;\n}\n\n.VideoEmbed-module_embedWrapper__1kG8A {\n overflow:hidden;\n position:relative;\n background: black;\n padding-top: 56.25%;\n}\n\n.VideoEmbed-module_wide__1IwOr {\n padding-top: 56.25%;\n}\n\n.VideoEmbed-module_narrow__2jLxH {\n padding-top: 75%;\n}\n\n.VideoEmbed-module_square__2ljo8 {\n padding-top: 100%;\n}\n\n.VideoEmbed-module_portrait__1ttPj {\n padding-top: 177.77%;\n}\n\n.VideoEmbed-module_embedPlayer__54NKG {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n}\n";
|
370
|
+
var styles$7 = {"VideoEmbed":"VideoEmbed-module_VideoEmbed__3BUjc","embedWrapper":"VideoEmbed-module_embedWrapper__1kG8A","wide":"VideoEmbed-module_wide__1IwOr","narrow":"VideoEmbed-module_narrow__2jLxH","square":"VideoEmbed-module_square__2ljo8","portrait":"VideoEmbed-module_portrait__1ttPj","embedPlayer":"VideoEmbed-module_embedPlayer__54NKG"};
|
371
|
+
styleInject(css$7);
|
372
|
+
|
373
|
+
function VideoEmbed(_ref) {
|
374
|
+
var configuration = _ref.configuration;
|
375
|
+
|
376
|
+
// base64-encoded configuration
|
377
|
+
// => make component re-render on configuration changes
|
378
|
+
function keyFromConfiguration(config) {
|
379
|
+
return btoa(JSON.stringify(config));
|
380
|
+
}
|
381
|
+
|
382
|
+
return React.createElement("div", {
|
383
|
+
className: styles$7.VideoEmbed
|
384
|
+
}, React.createElement("div", {
|
385
|
+
className: classNames(styles$7.embedWrapper, styles$7[configuration.aspectRatio])
|
386
|
+
}, React.createElement(ReactPlayer, {
|
387
|
+
className: styles$7.embedPlayer,
|
388
|
+
key: keyFromConfiguration(configuration),
|
389
|
+
url: configuration.videoSource,
|
390
|
+
playing: true,
|
391
|
+
light: true,
|
392
|
+
width: "100%",
|
393
|
+
height: "100%",
|
394
|
+
controls: !configuration.hideControls,
|
395
|
+
config: {
|
396
|
+
youtube: {
|
397
|
+
playerVars: {
|
398
|
+
showinfo: !configuration.hideInfo
|
399
|
+
}
|
400
|
+
},
|
401
|
+
vimeo: {
|
402
|
+
playerOptions: {
|
403
|
+
byline: !configuration.hideInfo
|
404
|
+
}
|
405
|
+
}
|
406
|
+
}
|
407
|
+
})), React.createElement(InlineCaption, {
|
408
|
+
text: configuration.caption
|
409
|
+
}));
|
410
|
+
}
|
411
|
+
|
412
|
+
frontend.contentElementTypes.register('videoEmbed', {
|
413
|
+
component: VideoEmbed
|
414
|
+
});
|
415
|
+
|
416
|
+
var css$8 = "\n.ExternalLink-module_hidden__3jer0 {\n display: none;\n}\n\n.ExternalLink-module_link_item__Blypv {\n width: 45%;\n max-width: 45%;\n vertical-align: top;\n margin: 2% auto;\n background-color: #fff; \n color: rgba(20,20,20,0.8);\n text-decoration: none;\n transition: 0.3s;\n}\n\n\n.ExternalLink-module_link_item__Blypv.ExternalLink-module_invert__1zrgN {\n background-color: rgba(20,20,20,0.8);;\n color: #fff;\n}\n\n.ExternalLink-module_link_item__Blypv.ExternalLink-module_layout_center__3NRpQ {\n width: 29%;\n max-width: 29%;\n \n}\n\n.ExternalLink-module_link_item__Blypv:hover {\n background-color: #141414;\n color: #fff;\n -webkit-transform: scale(1.05);\n -moz-transform: scale(1.05);\n -ms-transform: scale(1.05);\n -o-transform: scale(1.05);\n transform: scale(1.05);\n}\n\n.ExternalLink-module_link_item__Blypv:hover .ExternalLink-module_link_title__FZJ-0 {\n text-decoration: underline;\n}\n\n.ExternalLink-module_link_thumbnail__2_BHq {\n width: auto;\n background-repeat: no-repeat;\n background-size: cover;\n padding-top: 56.25%;\n position: relative;\n\n}\n\n.ExternalLink-module_link_details__lRhKU {\n margin: 20px;\n}\n\n.ExternalLink-module_link_details__lRhKU > .ExternalLink-module_link_title__FZJ-0 {\n font-size: 1.2em;\n font-weight: bold;\n margin-bottom: 20px;\n}\n\n.ExternalLink-module_link_details__lRhKU > .ExternalLink-module_link_desc__3fSe1 {\n\n}\n\n.ExternalLink-module_link_details__lRhKU > p {\n width: 100%;\n white-space: normal;\n line-height: 1.3em;\n}\n\n.ExternalLink-module_tooltip__18MpC {\n position: absolute;\n left: 50%;\n top: 80px;\n width: 180px;\n padding: 5px;\n margin-left: -95px;\n background-color: #444;\n color: #fff;\n border: solid 1px #fff;\n opacity: 0.9;\n font-size: 13px;\n text-align: center;\n white-space: normal;\n}\n\n.ExternalLink-module_tooltip__18MpC > span {\n display: block;\n color: #fff;\n text-decoration: underline;\n}";
|
417
|
+
var styles$8 = {"hidden":"ExternalLink-module_hidden__3jer0","link_item":"ExternalLink-module_link_item__Blypv","invert":"ExternalLink-module_invert__1zrgN","layout_center":"ExternalLink-module_layout_center__3NRpQ","link_title":"ExternalLink-module_link_title__FZJ-0","link_thumbnail":"ExternalLink-module_link_thumbnail__2_BHq","link_details":"ExternalLink-module_link_details__lRhKU","link_desc":"ExternalLink-module_link_desc__3fSe1","tooltip":"ExternalLink-module_tooltip__18MpC"};
|
418
|
+
styleInject(css$8);
|
419
|
+
|
420
|
+
function ExternalLink(props) {
|
421
|
+
var _classNames;
|
422
|
+
|
423
|
+
var _useState = useState(true),
|
424
|
+
_useState2 = _slicedToArray(_useState, 2),
|
425
|
+
hideTooltip = _useState2[0],
|
426
|
+
setHideTooltip = _useState2[1];
|
427
|
+
|
428
|
+
var _props$sectionProps = props.sectionProps,
|
429
|
+
layout = _props$sectionProps.layout,
|
430
|
+
invert = _props$sectionProps.invert;
|
431
|
+
|
432
|
+
var _useI18n = useI18n(),
|
433
|
+
t = _useI18n.t;
|
434
|
+
|
435
|
+
var isInEditor = function isInEditor() {
|
436
|
+
return window.frameElement != undefined && window.location.pathname.includes('/editor/entries/');
|
437
|
+
};
|
438
|
+
|
439
|
+
var onTooltipClick = function onTooltipClick() {
|
440
|
+
window.open(props.url, '_blank');
|
441
|
+
setHideTooltip(true);
|
442
|
+
};
|
443
|
+
|
444
|
+
var onClick = function onClick(event) {
|
445
|
+
if (props.open_in_new_tab == false && isInEditor()) {
|
446
|
+
setHideTooltip(false);
|
447
|
+
event.preventDefault();
|
448
|
+
}
|
449
|
+
};
|
450
|
+
|
451
|
+
var onMouseLeave = function onMouseLeave() {
|
452
|
+
setHideTooltip(true);
|
453
|
+
};
|
454
|
+
|
455
|
+
return React.createElement("a", {
|
456
|
+
className: classNames(styles$8.link_item, (_classNames = {}, _defineProperty(_classNames, styles$8.invert, invert), _defineProperty(_classNames, styles$8.layout_center, layout == 'center'), _classNames)),
|
457
|
+
href: props.url || '',
|
458
|
+
onClick: onClick,
|
459
|
+
onMouseLeave: onMouseLeave,
|
460
|
+
target: props.open_in_new_tab == '1' ? '_blank' : '_self'
|
461
|
+
}, React.createElement("div", {
|
462
|
+
className: styles$8.link_thumbnail
|
463
|
+
}, React.createElement(Image, {
|
464
|
+
id: props.thumbnail
|
465
|
+
})), React.createElement("div", {
|
466
|
+
className: styles$8.link_details
|
467
|
+
}, React.createElement("p", {
|
468
|
+
className: styles$8.link_title
|
469
|
+
}, props.title), React.createElement("p", {
|
470
|
+
className: styles$8.link_desc,
|
471
|
+
dangerouslySetInnerHTML: {
|
472
|
+
__html: props.description
|
473
|
+
}
|
474
|
+
})), React.createElement("div", {
|
475
|
+
className: classNames(_defineProperty({}, styles$8.hidden, hideTooltip), styles$8.tooltip),
|
476
|
+
onClick: onTooltipClick
|
477
|
+
}, t('pageflow_scrolled.public.external_link.open_in_new_tab_message'), React.createElement("span", {
|
478
|
+
target: "_blank"
|
479
|
+
}, t('pageflow_scrolled.public.external_link.open_in_new_tab'))));
|
480
|
+
}
|
481
|
+
|
482
|
+
var css$9 = ".ExternalLinkList-module_ext_links_container__16IIo{\n display: flex;\n flex-wrap: wrap;\n border-collapse: separate;\n border-spacing: 10px;\n min-height: 240px;\n width: auto;\n height: auto;\n pointer-events: all;\n position: relative;\n -webkit-transition: opacity 0.5s;\n -moz-transition: opacity 0.5s;\n transition: opacity 0.5s;\n transition-timing-function: cubic-bezier(0.1, 0.57, 0.1, 1);\n transition-duration: 0ms;\n}\n";
|
483
|
+
var styles$9 = {"ext_links_container":"ExternalLinkList-module_ext_links_container__16IIo"};
|
484
|
+
styleInject(css$9);
|
485
|
+
|
486
|
+
function ExternalLinkList(props) {
|
487
|
+
var linkList = props.configuration.links || [];
|
488
|
+
return React.createElement("div", {
|
489
|
+
className: styles$9.ext_links_container
|
490
|
+
}, linkList.map(function (link, index) {
|
491
|
+
return React.createElement(ExternalLink, Object.assign({}, link, {
|
492
|
+
key: link.id,
|
493
|
+
sectionProps: props.sectionProps
|
494
|
+
}));
|
495
|
+
}));
|
496
|
+
}
|
497
|
+
|
498
|
+
frontend.contentElementTypes.register('externalLinkList', {
|
499
|
+
component: ExternalLinkList
|
500
|
+
});
|
501
|
+
|
502
|
+
var css$a = ".DataWrapperChart-module_container__2eZ15 {\n min-height: 200px;\n height: 400px;\n}\n\n.DataWrapperChart-module_container__2eZ15 > iframe {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n}";
|
503
|
+
var styles$a = {"container":"DataWrapperChart-module_container__2eZ15"};
|
504
|
+
styleInject(css$a);
|
505
|
+
|
506
|
+
function DataWrapperChart(_ref) {
|
507
|
+
var configuration = _ref.configuration;
|
508
|
+
var ref = useRef();
|
509
|
+
var onScreen = useOnScreen(ref, '25% 0px 25% 0px'); // remove url protocol, so that it is selected by the browser itself
|
510
|
+
|
511
|
+
var srcURL = '';
|
512
|
+
|
513
|
+
if (configuration.url && onScreen) {
|
514
|
+
srcURL = configuration.url.replace(/http(s|):/, '');
|
515
|
+
}
|
516
|
+
|
517
|
+
return React.createElement("div", {
|
518
|
+
ref: ref,
|
519
|
+
className: styles$a.container
|
520
|
+
}, React.createElement("iframe", {
|
521
|
+
src: srcURL,
|
522
|
+
scrolling: "auto",
|
523
|
+
frameBorder: "0",
|
524
|
+
align: "aus",
|
525
|
+
allowFullScreen: true,
|
526
|
+
mozallowfullscreen: "true",
|
527
|
+
webkitallowfullscreen: "true"
|
528
|
+
}));
|
529
|
+
}
|
530
|
+
|
531
|
+
frontend.contentElementTypes.register('dataWrapperChart', {
|
532
|
+
component: DataWrapperChart
|
533
|
+
});
|