pageflow 15.2.0 → 15.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f634bdc5700407153c1e555eb991eac53f2572d
4
- data.tar.gz: 47766062e1a5fedffcce3c969fae1fa52ba10ed3
3
+ metadata.gz: b169ee9cc88c35d211b95622dff89fd05f45bb63
4
+ data.tar.gz: ae672e0fa5c1ea4ec5b294616eba14fc3d08e85e
5
5
  SHA512:
6
- metadata.gz: 8a87e52617931eeff9d0bce5bf8b09ef2673e4543173d9cd00edd88d2e2fab165222a6216785560fb099635e2a8fc7e7df9f1c69d3c8c79d94cde602aedcf5a2
7
- data.tar.gz: ebcb2edecf5aca9a2dbbd2037a4e07120cdf3fcc3c578de36ba5a19d08507298a493e3ef15b21714829061dd0a43d777e4d882a2303a3beed8f0942506e2adf5
6
+ metadata.gz: 6725c2802c161ef7edd6fb3b67d714090592e31d587902e792d7a275006d284029136ae9815f6e70db8a6838caed27823c9d236a33a910a021ac8995dd6daf04
7
+ data.tar.gz: 661df44b0a39b41eede0d0b49b65a1bee5695a9b165953e406a3bf9ee3ba840bd984d370a77c41ebb5ceff5c29ad1e69e26c1bb986ba1f2793aa9a989ec624ce
@@ -1,5 +1,16 @@
1
1
  # CHANGELOG
2
2
 
3
+ ### Version 15.2.1
4
+
5
+ 2020-04-02
6
+
7
+ [Compare changes](https://github.com/codevise/pageflow/compare/v15.2.0...v15.2.1)
8
+
9
+ - Fix disabling home button input in account form based on theme (15.2 Backport)
10
+ ([#1376](https://github.com/codevise/pageflow/pull/1376))
11
+ - Include scrolled content element js files in gem (15.2 Backport)
12
+ ([#1374](https://github.com/codevise/pageflow/pull/1374))
13
+
3
14
  ### Version 15.2.0
4
15
 
5
16
  2020-04-01
@@ -1,6 +1,6 @@
1
1
  jQuery(function($) {
2
2
  $('.admin_accounts').filter('.new, .edit').find('form.pageflow_account').each(function() {
3
- var themeSelect = $('#account_default_theming_attributes_theme_name', this);
3
+ var themeSelect = $('#account_paged_entry_template_attributes_theme_name', this);
4
4
  var themeOptions = JSON.parse($('script#theme_options', this).text());
5
5
  var homeButtonCheckBox = $('#account_paged_entry_template_attributes_configuration_home_button_enabled', this);
6
6
 
@@ -0,0 +1,410 @@
1
+ import { editor as editor$1 } from 'pageflow-scrolled/editor';
2
+ import { TextInputView, TextAreaInputView, SliderInputView, CheckBoxInputView, UrlInputView, SelectInputView, cssModulesUtils, ConfigurationEditorView } from 'pageflow/ui';
3
+ import { FileInputView, ColorInputView, ListView, transientReferences } from 'pageflow/editor';
4
+ import Marionette from 'backbone.marionette';
5
+ import _ from 'underscore';
6
+ import Backbone from 'backbone';
7
+ import I18n$1 from 'i18n-js';
8
+
9
+ editor$1.contentElementTypes.register('heading', {
10
+ configurationEditor: function configurationEditor() {
11
+ this.tab('general', function () {
12
+ this.input('children', TextInputView);
13
+ });
14
+ }
15
+ });
16
+
17
+ editor$1.contentElementTypes.register('textBlock', {
18
+ configurationEditor: function configurationEditor() {
19
+ this.tab('general', function () {
20
+ this.input('children', TextAreaInputView);
21
+ });
22
+ }
23
+ });
24
+
25
+ editor$1.contentElementTypes.register('inlineImage', {
26
+ configurationEditor: function configurationEditor() {
27
+ this.tab('general', function () {
28
+ this.input('id', FileInputView, {
29
+ collection: 'image_files',
30
+ fileSelectionHandler: 'contentElementConfiguration'
31
+ });
32
+ this.group('ContentElementCaption');
33
+ this.group('ContentElementPosition');
34
+ });
35
+ }
36
+ });
37
+
38
+ editor$1.contentElementTypes.register('inlineVideo', {
39
+ configurationEditor: function configurationEditor() {
40
+ this.tab('general', function () {});
41
+ }
42
+ });
43
+
44
+ editor$1.contentElementTypes.register('inlineBeforeAfter', {
45
+ configurationEditor: function configurationEditor() {
46
+ this.tab('general', function () {
47
+ this.input('before_id', FileInputView, {
48
+ collection: 'image_files',
49
+ fileSelectionHandler: 'contentElementConfiguration',
50
+ positioning: false
51
+ });
52
+ this.input('before_label', TextInputView);
53
+ this.input('after_id', FileInputView, {
54
+ collection: 'image_files',
55
+ fileSelectionHandler: 'contentElementConfiguration',
56
+ positioning: false
57
+ });
58
+ this.input('after_label', TextInputView);
59
+ this.input('initial_slider_position', SliderInputView);
60
+ this.input('slider', CheckBoxInputView);
61
+ this.input('slider_handle', CheckBoxInputView, {
62
+ visibleBinding: 'slider'
63
+ });
64
+ this.input('slider_color', ColorInputView, {
65
+ visibleBinding: 'slider'
66
+ });
67
+ this.group('ContentElementPosition');
68
+ });
69
+ },
70
+ defaultConfig: {
71
+ slider: true,
72
+ slider_handle: true,
73
+ initial_slider_position: 50
74
+ }
75
+ });
76
+
77
+ editor$1.contentElementTypes.register('soundDisclaimer', {
78
+ configurationEditor: function configurationEditor() {
79
+ this.tab('general', function () {});
80
+ }
81
+ });
82
+
83
+ editor$1.contentElementTypes.register('videoEmbed', {
84
+ configurationEditor: function configurationEditor() {
85
+ this.tab('general', function () {
86
+ this.input('videoSource', UrlInputView, {
87
+ supportedHosts: ['http://youtu.be', 'https://youtu.be', 'http://www.youtube.com', 'https://www.youtube.com', 'http://vimeo.com', 'https://vimeo.com', 'http://www.facebook.com', 'https://www.facebook.com'],
88
+ displayPropertyName: 'videoSource',
89
+ required: true,
90
+ permitHttps: true
91
+ });
92
+ this.input('hideInfo', CheckBoxInputView);
93
+ this.input('hideControls', CheckBoxInputView);
94
+ this.input('aspectRatio', SelectInputView, {
95
+ values: ['wide', 'narrow', 'square', 'portrait']
96
+ });
97
+ this.group('ContentElementCaption');
98
+ this.group('ContentElementPosition');
99
+ });
100
+ }
101
+ });
102
+
103
+ var SidebarRouter = Marionette.AppRouter.extend({
104
+ appRoutes: {
105
+ 'scrolled/external_links/:id/': 'links',
106
+ 'scrolled/external_links/:id/:link_id': 'link'
107
+ }
108
+ });
109
+
110
+ function styleInject(css, ref) {
111
+ if ( ref === void 0 ) ref = {};
112
+ var insertAt = ref.insertAt;
113
+
114
+ if (!css || typeof document === 'undefined') { return; }
115
+
116
+ var head = document.head || document.getElementsByTagName('head')[0];
117
+ var style = document.createElement('style');
118
+ style.type = 'text/css';
119
+
120
+ if (insertAt === 'top') {
121
+ if (head.firstChild) {
122
+ head.insertBefore(style, head.firstChild);
123
+ } else {
124
+ head.appendChild(style);
125
+ }
126
+ } else {
127
+ head.appendChild(style);
128
+ }
129
+
130
+ if (style.styleSheet) {
131
+ style.styleSheet.cssText = css;
132
+ } else {
133
+ style.appendChild(document.createTextNode(css));
134
+ }
135
+ }
136
+
137
+ var css = ".SidebarListView-module_container__2j0sq {\n margin-top: 30px;\n}\n.SidebarListView-module_add__138Ey{\n border: 1px solid #1c86fe;\n border-radius: 3px;\n box-shadow: inset 0 1px 0 0 #b6d5f8;\n color: white !important;\n display: inline-block;\n font-size: 11px;\n font-weight: bold;\n background-color: #6aacf7;\n background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6aacf7), color-stop(100%, #2b8efe));\n background-image: -webkit-linear-gradient(#6aacf7, #2b8efe);\n background-image: linear-gradient(#6aacf7, #2b8efe) !important;\n padding: 7px 18px;\n text-decoration: none !important;\n text-shadow: 0 1px 0 #067bff;\n background-clip: padding-box;\n padding-top: 5px;\n padding-bottom: 4px;\n padding-left: 12px\n}\n\n.SidebarListView-module_add__138Ey::before{\n font-family: 'entypo';\n content: \"\\2795\"\n}\n\n.SidebarListView-module_add__138Ey:hover:not(:disabled):not(.SidebarListView-module_disabled__2s_kN) {\n box-shadow: inset 0 1px 0 0 #87baf4;\n cursor: pointer;\n background-color: #559ff2;\n background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #559ff2), color-stop(100%, #1d86fc));\n background-image: -webkit-linear-gradient(#559ff2, #1d86fc);\n background-image: linear-gradient(#559ff2, #1d86fc)\n}\n\n.SidebarListView-module_add__138Ey:active:not(:disabled):not(.SidebarListView-module_disabled__2s_kN) {\n border: 1px solid #1c86fe;\n box-shadow: inset 0 0 8px 4px #0f7efb, inset 0 0 8px 4px #0f7efb, 0 1px 1px 0 #eee\n}\n\n.SidebarListView-module_header__fxwPU{\n display: 'block';\n}\n\n\n.SidebarListView-module_links_container__XDAeC {\n margin-top: 10px;\n}";
138
+ var styles = {"container":"SidebarListView-module_container__2j0sq","add":"SidebarListView-module_add__138Ey","disabled":"SidebarListView-module_disabled__2s_kN","header":"SidebarListView-module_header__fxwPU","links_container":"SidebarListView-module_links_container__XDAeC"};
139
+ styleInject(css);
140
+
141
+ var SidebarListView = Marionette.Layout.extend({
142
+ template: function template(data) {
143
+ return "\n <a class=\"back\">".concat(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.outline'), "</a>\n <a class=\"destroy\">").concat(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.destroy'), "</a>\n <div class=\"").concat(styles.container, "\">\n <label class=\"").concat(styles.header, "\">\n <span class=\"name\">").concat(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.name'), "</span>\n </label>\n <div class='").concat(styles.links_container, "'></div>\n <a class=\"").concat(styles.add, "\" href=\"\">").concat(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.add'), "</a>\n </div>\n ");
144
+ },
145
+ className: 'manage_external_links',
146
+ regions: {
147
+ linksContainer: '.' + styles.links_container
148
+ },
149
+ ui: cssModulesUtils.ui(styles, 'add', 'header'),
150
+ events: function events() {
151
+ var eventObject = {
152
+ 'click a.back': 'goBack',
153
+ 'click a.destroy': 'destroyElement'
154
+ };
155
+ eventObject['click a.' + styles.add] = 'addElement';
156
+ return eventObject;
157
+ },
158
+ initialize: function initialize(options) {
159
+ this.listenTo(options.contentElement.configuration, 'change', function () {
160
+ this.render();
161
+ });
162
+ },
163
+ onRender: function onRender() {
164
+ this.linksContainer.show(new ListView({
165
+ collection: this.model,
166
+ onEdit: _.bind(this.onEdit, this),
167
+ onRemove: _.bind(this.onRemove, this),
168
+ contentElement: this.options.contentElement
169
+ }));
170
+ },
171
+ goBack: function goBack() {
172
+ editor$1.navigate('', {
173
+ trigger: true
174
+ });
175
+ },
176
+ destroyElement: function destroyElement() {
177
+ if (confirm(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.confirm_delete'))) {
178
+ this.options.contentElement.destroy();
179
+ this.goBack();
180
+ }
181
+ },
182
+ addElement: function addElement() {
183
+ var newModel = this.model.addNewLink();
184
+ this.onEdit(newModel);
185
+ },
186
+ onEdit: function onEdit(linkModel) {
187
+ editor$1.navigate("/scrolled/external_links/".concat(this.options.contentElement.get('id'), "/").concat(linkModel.get('id')), {
188
+ trigger: true
189
+ });
190
+ },
191
+ onRemove: function onRemove(linkModel) {
192
+ if (confirm(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.confirm_delete_link'))) {
193
+ this.model.remove(linkModel);
194
+ }
195
+ }
196
+ });
197
+
198
+ var SidebarEditLinkView = Marionette.Layout.extend({
199
+ template: function template(data) {
200
+ return "\n <a class=\"back\">".concat(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.back'), "</a>\n <a class=\"destroy\">").concat(I18n.t('pageflow_scrolled.editor.content_elements.externalLinkList.destroy'), "</a>\n\n <div class='form_container'></div>\n ");
201
+ },
202
+ className: 'edit_external_link',
203
+ regions: {
204
+ formContainer: '.form_container'
205
+ },
206
+ events: {
207
+ 'click a.back': 'goBack',
208
+ 'click a.destroy': 'destroyLink'
209
+ },
210
+ initialize: function initialize(options) {},
211
+ onRender: function onRender() {
212
+ var configurationEditor = new ConfigurationEditorView({
213
+ model: this.model,
214
+ attributeTranslationKeyPrefixes: ['pageflow_scrolled.editor.content_elements.externalLinkList.attributes'],
215
+ tabTranslationKeyPrefix: 'pageflow_scrolled.editor.content_elements.externalLinkList.tabs'
216
+ });
217
+ var self = this;
218
+ configurationEditor.tab('edit_link', function () {
219
+ this.input('url', TextInputView, {
220
+ required: true
221
+ });
222
+ this.input('open_in_new_tab', CheckBoxInputView);
223
+ this.input('thumbnail', FileInputView, {
224
+ collection: 'image_files',
225
+ fileSelectionHandler: 'contentElement.externalLinks.link',
226
+ fileSelectionHandlerOptions: {
227
+ contentElementId: self.options.contentElement.get('id')
228
+ },
229
+ positioning: false
230
+ });
231
+ this.input('title', TextInputView, {
232
+ required: true
233
+ });
234
+ this.input('description', TextAreaInputView, {
235
+ size: 'short',
236
+ disableLinks: true
237
+ });
238
+ });
239
+ this.formContainer.show(configurationEditor);
240
+ },
241
+ goBack: function goBack() {
242
+ editor.navigate("/scrolled/external_links/".concat(this.options.contentElement.get('id'), "/"), {
243
+ trigger: true
244
+ });
245
+ },
246
+ destroyLink: function destroyLink() {
247
+ if (confirm('pageflow_scrolled.editor.content_elements.externalLinkList.confirm_delete_link')) {
248
+ this.options.collection.remove(this.model);
249
+ this.goBack();
250
+ }
251
+ }
252
+ });
253
+
254
+ var ExternalLinkModel = Backbone.Model.extend({
255
+ modelName: 'ExternalLink',
256
+ i18nKey: 'external_link',
257
+ mixins: [transientReferences],
258
+ initialize: function initialize(options) {},
259
+ thumbnailUrl: function thumbnailUrl() {
260
+ var image = this.collection.entry.imageFiles.getByPermaId(this.get('thumbnail'));
261
+ return image ? image.get('thumbnail_url') : '';
262
+ },
263
+ title: function title() {
264
+ return this.get('title');
265
+ }
266
+ });
267
+
268
+ var ExternalLinkCollection = Backbone.Collection.extend({
269
+ model: ExternalLinkModel,
270
+ initialize: function initialize(models, options) {
271
+ this.entry = options.entry;
272
+ this.configuration = options.configuration;
273
+ this.bind('change', this.updateConfiguration);
274
+ this.bind('add', this.updateConfiguration);
275
+ this.bind('remove', this.updateConfiguration);
276
+ },
277
+ modelId: function modelId(attrs) {
278
+ return attrs.id;
279
+ },
280
+ updateConfiguration: function updateConfiguration() {
281
+ var _this = this;
282
+
283
+ this.configuration.set('links', this.toJSON(), {
284
+ silent: true
285
+ });
286
+ setTimeout(function () {
287
+ //triggering change event inside this timeout block because otherwise due to
288
+ //some unknown reason page navigates to window.location.origin+window.location.pathname
289
+ //ignoring the hash thus causing the page to refresh.
290
+ _this.configuration.trigger('change');
291
+ }, 0);
292
+ },
293
+ addNewLink: function addNewLink() {
294
+ var newLink = {
295
+ id: this.length + 1,
296
+ title: '',
297
+ url: '',
298
+ thumbnail: '',
299
+ description: '',
300
+ open_in_new_tab: 1
301
+ };
302
+ this.add(newLink);
303
+ return this.get(this.length);
304
+ }
305
+ });
306
+
307
+ var SidebarController = Marionette.Controller.extend({
308
+ initialize: function initialize(options) {
309
+ this.region = options.region;
310
+ },
311
+ links: function links(id) {
312
+ var _this = this;
313
+
314
+ this.setModel(id); //if not done without timeout another empty tab view is shown in the sidebar
315
+ //to me it seems to be the problem of some method call ordering which gets fixed with this
316
+ //hack but in future it should be fixed without having to use setTimeout
317
+
318
+ setTimeout(function () {
319
+ _this.region.show(new SidebarListView({
320
+ model: _this.linksCollection,
321
+ contentElement: _this.model,
322
+ entry: _this.options.entry
323
+ }));
324
+ }, 0);
325
+ },
326
+ link: function link(id, link_id) {
327
+ var _this2 = this;
328
+
329
+ this.setModel(id);
330
+ setTimeout(function () {
331
+ _this2.region.show(new SidebarEditLinkView({
332
+ model: _this2.linksCollection.get(link_id),
333
+ collection: _this2.linksCollection,
334
+ contentElement: _this2.model,
335
+ entry: _this2.options.entry
336
+ }));
337
+ }, 0);
338
+ },
339
+ setModel: function setModel(id) {
340
+ this.model = this.options.entry.contentElements.get(id);
341
+ var configuration = this.model.configuration;
342
+
343
+ if (!configuration.get('links')) {
344
+ configuration.set('links', []);
345
+ }
346
+
347
+ this.linksCollection = new ExternalLinkCollection(configuration.get('links'), {
348
+ entry: this.options.entry,
349
+ configuration: configuration
350
+ });
351
+ }
352
+ });
353
+
354
+ //router defines the URL hash path mapping and controller provides functions for the paths
355
+
356
+ editor$1.registerSideBarRouting({
357
+ router: SidebarRouter,
358
+ controller: SidebarController
359
+ }); // register external link list content element configuration editor for sidebar
360
+
361
+ editor$1.contentElementTypes.register('externalLinkList', {
362
+ configurationEditor: function configurationEditor() {
363
+ this.tab('general', function () {
364
+ var externalListModel = this.model.parent; //redirect to special hash path that is specific to external links only
365
+
366
+ editor$1.navigate("/scrolled/external_links/".concat(externalListModel.get('id'), "/"), {
367
+ trigger: true
368
+ });
369
+ });
370
+ }
371
+ }); // register file handler for thumbnail of external link
372
+
373
+ editor$1.registerFileSelectionHandler('contentElement.externalLinks.link', function (options) {
374
+ var contentElement = options.entry.contentElements.get(options.contentElementId);
375
+ var links = contentElement.configuration.get('links');
376
+
377
+ this.call = function (file) {
378
+ var link = links.find(function (link) {
379
+ return link.id == options.id;
380
+ });
381
+ link.thumbnail = file.get('perma_id');
382
+ contentElement.configuration.set('links', links);
383
+ contentElement.configuration.trigger('change', contentElement.configuration);
384
+ };
385
+
386
+ this.getReferer = function () {
387
+ return '/scrolled/external_links/' + contentElement.id + '/' + options.id;
388
+ };
389
+ });
390
+
391
+ var DatawrapperAdView = Marionette.ItemView.extend({
392
+ template: function template(data) {
393
+ return "\n <form action=\"https://datawrapper.de/chart/create\" method=\"POST\" target=\"_blank\">\n <input type=\"hidden\" name=\"theme\" value=\"pageflow\" />\n <input type=\"submit\" value=\"".concat(I18n$1.t('pageflow_scrolled.editor.content_elements.dataWrapperChart.attributes.create_chart.label'), "\" />\n </form>\n ");
394
+ },
395
+ className: 'datawrapper_ad'
396
+ });
397
+
398
+ editor$1.contentElementTypes.register('dataWrapperChart', {
399
+ configurationEditor: function configurationEditor() {
400
+ this.tab('general', function () {
401
+ this.input('url', UrlInputView, {
402
+ supportedHosts: ['http://cf.datawrapper.de', 'https://cf.datawrapper.de', 'http://datawrapper.dwcdn.de', 'https://datawrapper.dwcdn.de', 'http://datawrapper.dwcdn.net', 'https://datawrapper.dwcdn.net', 'http://charts.datawrapper.de', 'https://charts.datawrapper.de'],
403
+ displayPropertyName: 'url',
404
+ required: true,
405
+ permitHttps: true
406
+ });
407
+ this.view(DatawrapperAdView);
408
+ });
409
+ }
410
+ });
@@ -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
+ });
@@ -1,3 +1,3 @@
1
1
  module Pageflow
2
- VERSION = '15.2.0'.freeze
2
+ VERSION = '15.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pageflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.2.0
4
+ version: 15.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2020-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -1704,6 +1704,8 @@ files:
1704
1704
  - entry_types/scrolled/lib/pageflow_scrolled/plugin.rb
1705
1705
  - entry_types/scrolled/lib/pageflow_scrolled/seeds.rb
1706
1706
  - entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake
1707
+ - entry_types/scrolled/package/contentElements-editor.js
1708
+ - entry_types/scrolled/package/contentElements-frontend.js
1707
1709
  - entry_types/scrolled/package/editor.js
1708
1710
  - entry_types/scrolled/package/frontend.js
1709
1711
  - entry_types/scrolled/package/package.json