pageflow 15.3.0 → 15.4.0
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 +158 -353
- data/README.md +2 -3
- data/app/assets/javascripts/pageflow/dist/ui.js +99 -32
- data/app/assets/javascripts/pageflow/vendor.js +0 -1
- data/app/assets/stylesheets/pageflow/editor/base.scss +3 -2
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/select_button.scss +1 -1
- data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +1 -1
- data/app/assets/stylesheets/pageflow/entries.scss +1 -1
- data/app/assets/stylesheets/pageflow/loading_spinner.scss +4 -1
- data/app/assets/stylesheets/pageflow/navigation_mobile.scss +4 -4
- data/app/assets/stylesheets/pageflow/themes/default/anchors.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/page/anchors.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/control_bar.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/info_box.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/shared/menu_bar.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/control_bar.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/info_box.scss +1 -1
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/quality_menu.scss +2 -2
- data/app/assets/stylesheets/pageflow/themes/default/player_controls/waveform/wave.scss +1 -1
- data/app/assets/stylesheets/pageflow/ui/forms.scss +9 -2
- data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.scss +2 -2
- data/app/models/pageflow/account_role_query.rb +1 -1
- data/app/models/pageflow/managed_user_query.rb +1 -1
- data/app/policies/pageflow/folder_policy.rb +2 -2
- data/app/policies/pageflow/membership_policy.rb +2 -2
- data/app/policies/pageflow/theming_policy.rb +2 -2
- data/app/policies/pageflow/user_policy.rb +1 -1
- data/app/views/pageflow/video_files/_video_file.json.jbuilder +8 -1
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +103 -36
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +42 -15
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/vendor.js +1 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/videojs.js +6 -0
- data/entry_types/paged/app/views/layouts/pageflow_paged/_loading_spinner_inline_script.html.erb +1 -0
- data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +1 -1
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +2 -0
- data/entry_types/paged/lib/tasks/pageflow_paged_tasks.rake +7 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/dash.all.min.js +0 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs-dash.js +0 -0
- data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs.js +0 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +2 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +1 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/favicon_helper.rb +21 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +12 -5
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +5 -7
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +1 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/favicons/_entry.html.erb +10 -0
- data/entry_types/scrolled/config/locales/de.yml +655 -0
- data/entry_types/scrolled/config/locales/en.yml +522 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +5 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-192x192.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-512x512.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/apple-touch-icon.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/browserconfig.xml +9 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-16x16.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-32x32.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon.ico +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/mstile-150x150.png +0 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/safari-pinned-tab.svg +46 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/site.webmanifest +19 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/unmute.mp3 +0 -0
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +1 -0
- data/entry_types/scrolled/package/contentElements-editor.js +14 -1
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +338 -104
- data/entry_types/scrolled/package/editor.js +594 -242
- data/entry_types/scrolled/package/frontend/{EditableText-4264c349.js → EditableText-43c50894.js} +331 -163
- data/entry_types/scrolled/package/frontend/{Wavesurfer-c3c45324.js → Wavesurfer-b88b02e0.js} +0 -3
- data/entry_types/scrolled/package/frontend/{components-cfe6a479.js → components-3ead1b4a.js} +509 -91
- data/entry_types/scrolled/package/frontend/index.css +2 -2
- data/entry_types/scrolled/package/frontend/index.js +2107 -1025
- data/entry_types/scrolled/package/package.json +15 -3
- data/lib/generators/pageflow/initializer/templates/pageflow.rb +2 -1
- data/lib/pageflow/engine.rb +0 -1
- data/lib/pageflow/themes.rb +4 -0
- data/lib/pageflow/version.rb +1 -1
- data/package/config/jest/index.js +7 -2
- data/package/config/webpack.js +1 -2
- data/package/editor.js +4 -4
- data/package/frontend.js +30 -13
- data/package/ui.js +99 -32
- metadata +25 -11
- data/app/assets/javascripts/pageflow/videojs.js +0 -6
- data/entry_types/scrolled/config/locales/new/de.yml +0 -601
- data/entry_types/scrolled/config/locales/new/en.yml +0 -507
data/entry_types/scrolled/package/frontend/{EditableText-4264c349.js → EditableText-43c50894.js}
RENAMED
@@ -1,6 +1,9 @@
|
|
1
|
-
import React, { useReducer, useMemo,
|
1
|
+
import React, { useReducer, useMemo, useCallback, createContext as createContext$1, useContext, useState, useEffect, useRef } from 'react';
|
2
2
|
import classNames from 'classnames';
|
3
|
+
import { createContext, useContextSelector } from 'use-context-selector';
|
4
|
+
import { createSelectorCreator, defaultMemoize, createSelector } from 'reselect';
|
3
5
|
import I18n from 'i18n-js';
|
6
|
+
import slugify from 'slugify';
|
4
7
|
import { _ as _createClass, a as _classCallCheck, b as _inherits, c as _getPrototypeOf, d as _possibleConstructorReturn } from './getPrototypeOf-63c7c8e8.js';
|
5
8
|
|
6
9
|
function _defineProperty(obj, key, value) {
|
@@ -208,24 +211,43 @@ function updateConfiguration(_ref2) {
|
|
208
211
|
}
|
209
212
|
});
|
210
213
|
}
|
211
|
-
|
212
|
-
function getItems(state, collectionName) {
|
213
|
-
if (state[collectionName]) {
|
214
|
-
var items = state[collectionName].items;
|
215
|
-
return state[collectionName].order.map(function (key) {
|
216
|
-
return items[key];
|
217
|
-
});
|
218
|
-
} else {
|
219
|
-
return [];
|
220
|
-
}
|
221
|
-
}
|
222
214
|
function getItem(state, collectionName, key) {
|
223
215
|
if (state[collectionName]) {
|
224
216
|
return state[collectionName].items[key];
|
225
217
|
}
|
226
218
|
}
|
219
|
+
function createItemsSelector(collectionName, filter) {
|
220
|
+
if (filter) {
|
221
|
+
var itemsSelector = createItemsSelector(collectionName);
|
222
|
+
return createShallowEqualArraysSelector(function (collections) {
|
223
|
+
return itemsSelector(collections).filter(filter);
|
224
|
+
}, function (items) {
|
225
|
+
return items;
|
226
|
+
});
|
227
|
+
}
|
228
|
+
|
229
|
+
return createSelector(function (collections) {
|
230
|
+
return collections[collectionName];
|
231
|
+
}, function (collection) {
|
232
|
+
if (collection) {
|
233
|
+
var items = collection.items;
|
234
|
+
return collection.order.map(function (key) {
|
235
|
+
return items[key];
|
236
|
+
});
|
237
|
+
} else {
|
238
|
+
return [];
|
239
|
+
}
|
240
|
+
});
|
241
|
+
}
|
242
|
+
var createShallowEqualArraysSelector = createSelectorCreator(defaultMemoize, shallowEqualArrays);
|
243
|
+
|
244
|
+
function shallowEqualArrays(a, b) {
|
245
|
+
return a.length === b.length && a.every(function (item, index) {
|
246
|
+
return item === b[index];
|
247
|
+
});
|
248
|
+
}
|
227
249
|
|
228
|
-
var Context =
|
250
|
+
var Context = createContext();
|
229
251
|
function EntryStateProvider(_ref) {
|
230
252
|
var seed = _ref.seed,
|
231
253
|
children = _ref.children;
|
@@ -253,13 +275,38 @@ function EntryStateProvider(_ref) {
|
|
253
275
|
}, children)
|
254
276
|
);
|
255
277
|
}
|
278
|
+
|
256
279
|
function useEntryState() {
|
257
|
-
var
|
258
|
-
|
280
|
+
var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (entryState) {
|
281
|
+
return entryState;
|
282
|
+
};
|
283
|
+
return useContextSelector(Context, function (value) {
|
284
|
+
return selector(value.entryState);
|
285
|
+
});
|
259
286
|
}
|
287
|
+
|
260
288
|
function useEntryStateDispatch() {
|
261
|
-
|
262
|
-
|
289
|
+
return useContextSelector(Context, function (value) {
|
290
|
+
return value.dispatch;
|
291
|
+
});
|
292
|
+
}
|
293
|
+
function useEntryStateConfig() {
|
294
|
+
return useEntryState(function (entryState) {
|
295
|
+
return entryState.config;
|
296
|
+
});
|
297
|
+
}
|
298
|
+
function useEntryStateCollectionItem(collectionName, key) {
|
299
|
+
return useEntryState(function (entryState) {
|
300
|
+
return getItem(entryState.collections, collectionName, key);
|
301
|
+
});
|
302
|
+
}
|
303
|
+
function useEntryStateCollectionItems(collectionName, filter) {
|
304
|
+
var itemsSelector = useMemo(function () {
|
305
|
+
return createItemsSelector(collectionName, filter);
|
306
|
+
}, [collectionName, filter]);
|
307
|
+
return useEntryState(function (entryState) {
|
308
|
+
return itemsSelector(entryState.collections);
|
309
|
+
});
|
263
310
|
}
|
264
311
|
|
265
312
|
/**
|
@@ -279,10 +326,10 @@ function useEntryStateDispatch() {
|
|
279
326
|
*/
|
280
327
|
|
281
328
|
function useEntryMetadata() {
|
282
|
-
var
|
329
|
+
var entries = useEntryStateCollectionItems('entries');
|
283
330
|
return useMemo(function () {
|
284
|
-
return
|
285
|
-
}, [
|
331
|
+
return entries[0];
|
332
|
+
}, [entries]);
|
286
333
|
}
|
287
334
|
|
288
335
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
@@ -517,14 +564,14 @@ var WhatsAppIcon = (function (_ref) {
|
|
517
564
|
|
518
565
|
function useShareProviders(_ref) {
|
519
566
|
var isPhonePlatform = _ref.isPhonePlatform;
|
520
|
-
var
|
567
|
+
var config = useEntryStateConfig();
|
521
568
|
var entryMetadata = useEntryMetadata();
|
522
569
|
var shareProviders = entryMetadata ? entryMetadata.shareProviders : {};
|
523
|
-
var urlTemplates =
|
570
|
+
var urlTemplates = config.shareUrlTemplates;
|
524
571
|
var sharing = {
|
525
572
|
email: {
|
526
573
|
icon: EmailIcon,
|
527
|
-
name: '
|
574
|
+
name: 'Mail',
|
528
575
|
url: urlTemplates.email
|
529
576
|
},
|
530
577
|
facebook: {
|
@@ -593,12 +640,12 @@ function filterShareProviders(shareProvidersConfig, isPhonePlatform) {
|
|
593
640
|
|
594
641
|
function useShareUrl() {
|
595
642
|
var entryMetadata = useEntryMetadata();
|
596
|
-
var
|
643
|
+
var config = useEntryStateConfig();
|
597
644
|
|
598
645
|
if (entryMetadata) {
|
599
|
-
return entryMetadata.shareUrl ? entryMetadata.shareUrl :
|
646
|
+
return entryMetadata.shareUrl ? entryMetadata.shareUrl : config.prettyUrl;
|
600
647
|
} else {
|
601
|
-
return
|
648
|
+
return config.shareUrl;
|
602
649
|
}
|
603
650
|
}
|
604
651
|
|
@@ -606,6 +653,8 @@ function useShareUrl() {
|
|
606
653
|
* Returns a nested data structure representing the chapters, sections
|
607
654
|
* and content elements of the entry.
|
608
655
|
*
|
656
|
+
* @private
|
657
|
+
*
|
609
658
|
* @example
|
610
659
|
*
|
611
660
|
* const structure = useEntryStructure();
|
@@ -617,28 +666,15 @@ function useShareUrl() {
|
|
617
666
|
* summary: 'An introductory chapter',
|
618
667
|
* sections: [
|
619
668
|
* {
|
669
|
+
* id: 1,
|
620
670
|
* permaId: 101,
|
671
|
+
* chapterId: 3,
|
621
672
|
* sectionIndex: 0,
|
622
673
|
* transition: 'scroll',
|
623
674
|
*
|
624
675
|
* // references to adjacent section objects
|
625
676
|
* previousSection: { ... },
|
626
677
|
* nextSection: { ... },
|
627
|
-
*
|
628
|
-
* foreground: [
|
629
|
-
* {
|
630
|
-
* type: 'heading',
|
631
|
-
* props: {
|
632
|
-
* children: 'Heading'
|
633
|
-
* }
|
634
|
-
* },
|
635
|
-
* {
|
636
|
-
* type: 'textBlock',
|
637
|
-
* props: {
|
638
|
-
* children: 'Some text'
|
639
|
-
* }
|
640
|
-
* }
|
641
|
-
* ]
|
642
678
|
* }
|
643
679
|
* ],
|
644
680
|
* }
|
@@ -646,29 +682,25 @@ function useShareUrl() {
|
|
646
682
|
*/
|
647
683
|
|
648
684
|
function useEntryStructure() {
|
649
|
-
var
|
685
|
+
var chapters = useChapters();
|
686
|
+
var sections = useEntryStateCollectionItems('sections');
|
650
687
|
return useMemo(function () {
|
651
|
-
var
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
688
|
+
var linkedSections = sections.map(function (section) {
|
689
|
+
return sectionData(section);
|
690
|
+
});
|
691
|
+
linkedSections.forEach(function (section, index) {
|
692
|
+
section.sectionIndex = index;
|
693
|
+
section.previousSection = linkedSections[index - 1];
|
694
|
+
section.nextSection = linkedSections[index + 1];
|
695
|
+
});
|
696
|
+
return chapters.map(function (chapter) {
|
697
|
+
return _objectSpread2(_objectSpread2({}, chapter), {}, {
|
698
|
+
sections: linkedSections.filter(function (item) {
|
657
699
|
return item.chapterId === chapter.id;
|
658
|
-
}).map(function (section) {
|
659
|
-
var result = sectionStructure(entryState.collections, section);
|
660
|
-
sections.push(result);
|
661
|
-
return result;
|
662
700
|
})
|
663
701
|
});
|
664
702
|
});
|
665
|
-
|
666
|
-
section.sectionIndex = index;
|
667
|
-
section.previousSection = sections[index - 1];
|
668
|
-
section.nextSection = sections[index + 1];
|
669
|
-
});
|
670
|
-
return chapters;
|
671
|
-
}, [entryState]);
|
703
|
+
}, [chapters, sections]);
|
672
704
|
}
|
673
705
|
/**
|
674
706
|
* Returns a nested data structure representing the content elements
|
@@ -677,58 +709,84 @@ function useEntryStructure() {
|
|
677
709
|
* @param {Object} options
|
678
710
|
* @param {number} options.sectionPermaId
|
679
711
|
*
|
712
|
+
* @private
|
713
|
+
*
|
680
714
|
* @example
|
681
715
|
*
|
682
|
-
* const section =
|
716
|
+
* const section = useSection({sectionPermaId: 4});
|
683
717
|
* section // =>
|
684
718
|
* {
|
719
|
+
* id: 100,
|
685
720
|
* permaId: 4,
|
686
|
-
*
|
687
|
-
*
|
688
|
-
* {
|
689
|
-
* type: 'heading',
|
690
|
-
* props: {
|
691
|
-
* children: 'Heading'
|
692
|
-
* }
|
693
|
-
* },
|
694
|
-
* {
|
695
|
-
* type: 'textBlock',
|
696
|
-
* props: {
|
697
|
-
* children: 'Some text'
|
698
|
-
* }
|
699
|
-
* }
|
700
|
-
* ]
|
721
|
+
* chapterId: 1,
|
722
|
+
* transition: 'scroll'
|
701
723
|
* }
|
702
724
|
*/
|
703
725
|
|
704
|
-
function
|
726
|
+
function useSection(_ref) {
|
705
727
|
var sectionPermaId = _ref.sectionPermaId;
|
706
|
-
var
|
707
|
-
|
708
|
-
return sectionStructure(entryState.collections, section);
|
728
|
+
var section = useEntryStateCollectionItem('sections', sectionPermaId);
|
729
|
+
return sectionData(section);
|
709
730
|
}
|
710
731
|
|
711
|
-
function
|
712
|
-
return section && _objectSpread2(
|
732
|
+
function sectionData(section) {
|
733
|
+
return section && _objectSpread2({
|
713
734
|
permaId: section.permaId,
|
714
|
-
id: section.id
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
735
|
+
id: section.id,
|
736
|
+
chapterId: section.chapterId
|
737
|
+
}, section.configuration);
|
738
|
+
}
|
739
|
+
|
740
|
+
function useSectionContentElements(_ref2) {
|
741
|
+
var sectionId = _ref2.sectionId;
|
742
|
+
var filterBySectionId = useCallback(function (contentElement) {
|
743
|
+
return contentElement.sectionId === sectionId;
|
744
|
+
}, [sectionId]);
|
745
|
+
var contentElements = useEntryStateCollectionItems('contentElements', filterBySectionId);
|
746
|
+
return contentElements.map(function (item) {
|
747
|
+
return {
|
748
|
+
id: item.id,
|
749
|
+
permaId: item.permaId,
|
750
|
+
type: item.typeName,
|
751
|
+
position: item.configuration.position,
|
752
|
+
props: item.configuration
|
753
|
+
};
|
727
754
|
});
|
728
755
|
}
|
756
|
+
function useChapters() {
|
757
|
+
var chapters = useEntryStateCollectionItems('chapters');
|
758
|
+
var chapterSlugs = {};
|
759
|
+
return chapters.map(function (chapter) {
|
760
|
+
var chapterSlug = chapter.configuration.title;
|
761
|
+
|
762
|
+
if (chapterSlug) {
|
763
|
+
chapterSlug = slugify(chapterSlug, {
|
764
|
+
lower: true,
|
765
|
+
locale: 'de',
|
766
|
+
strict: true
|
767
|
+
});
|
768
|
+
|
769
|
+
if (chapterSlugs[chapterSlug]) {
|
770
|
+
chapterSlug = chapterSlug + '-' + chapter.permaId; //append permaId if chapter reference is not unique
|
771
|
+
}
|
729
772
|
|
730
|
-
|
731
|
-
|
773
|
+
chapterSlugs[chapterSlug] = chapter;
|
774
|
+
} else {
|
775
|
+
chapterSlug = 'chapter-' + chapter.permaId;
|
776
|
+
}
|
777
|
+
|
778
|
+
return {
|
779
|
+
id: chapter.id,
|
780
|
+
permaId: chapter.permaId,
|
781
|
+
title: chapter.configuration.title,
|
782
|
+
summary: chapter.configuration.summary,
|
783
|
+
chapterSlug: chapterSlug
|
784
|
+
};
|
785
|
+
});
|
786
|
+
}
|
787
|
+
|
788
|
+
function extendFile(collectionName, file, config) {
|
789
|
+
return addModelType(collectionName, expandUrls(collectionName, file, config.fileUrlTemplates), config.fileModelTypes);
|
732
790
|
}
|
733
791
|
|
734
792
|
function addModelType(collectionName, file, modelTypes) {
|
@@ -819,23 +877,19 @@ function pad(string, size) {
|
|
819
877
|
function useFile(_ref) {
|
820
878
|
var collectionName = _ref.collectionName,
|
821
879
|
permaId = _ref.permaId;
|
822
|
-
var
|
823
|
-
return extendFile(collectionName,
|
880
|
+
var file = useEntryStateCollectionItem(collectionName, permaId);
|
881
|
+
return extendFile(collectionName, file, useEntryStateConfig());
|
824
882
|
}
|
825
883
|
|
826
884
|
function useNestedFiles(_ref) {
|
827
885
|
var collectionName = _ref.collectionName,
|
828
886
|
parent = _ref.parent;
|
829
|
-
var
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
return getItems(entryState.collections, collectionName).filter(function (file) {
|
836
|
-
return file.parentFileId === parent.id && file.parentFileModelType === parent.modelType;
|
837
|
-
}).map(function (file) {
|
838
|
-
return extendFile(collectionName, file, entryState);
|
887
|
+
var config = useEntryStateConfig();
|
888
|
+
var files = useEntryStateCollectionItems(collectionName, function (file) {
|
889
|
+
return parent && file.parentFileId === parent.id && file.parentFileModelType === parent.modelType;
|
890
|
+
});
|
891
|
+
return files.map(function (file) {
|
892
|
+
return extendFile(collectionName, file, config);
|
839
893
|
});
|
840
894
|
}
|
841
895
|
|
@@ -853,9 +907,9 @@ function useNestedFiles(_ref) {
|
|
853
907
|
*/
|
854
908
|
|
855
909
|
function useFileRights() {
|
856
|
-
var
|
857
|
-
var
|
858
|
-
var
|
910
|
+
var config = useEntryStateConfig();
|
911
|
+
var imageFiles = useEntryStateCollectionItems('imageFiles');
|
912
|
+
var defaultFileRights = config.defaultFileRights;
|
859
913
|
var imageFileRights = imageFiles.reduce(function (result, imageConfig) {
|
860
914
|
if (imageConfig && imageConfig.rights) {
|
861
915
|
result.push(imageConfig.rights.trim());
|
@@ -893,8 +947,8 @@ function useFileRights() {
|
|
893
947
|
*/
|
894
948
|
|
895
949
|
function useLegalInfo() {
|
896
|
-
var
|
897
|
-
return
|
950
|
+
var config = useEntryStateConfig();
|
951
|
+
return config.legalInfo;
|
898
952
|
}
|
899
953
|
/**
|
900
954
|
* Returns the credits string (rich text) of the entry.
|
@@ -963,8 +1017,8 @@ function useAvailableQualities(file) {
|
|
963
1017
|
*/
|
964
1018
|
|
965
1019
|
function useTheme() {
|
966
|
-
var
|
967
|
-
return
|
1020
|
+
var config = useEntryStateConfig();
|
1021
|
+
return config.theme;
|
968
1022
|
}
|
969
1023
|
|
970
1024
|
function updateContentElementConfiguration(_ref) {
|
@@ -979,7 +1033,7 @@ function updateContentElementConfiguration(_ref) {
|
|
979
1033
|
});
|
980
1034
|
}
|
981
1035
|
|
982
|
-
var LocaleContext = createContext('en');
|
1036
|
+
var LocaleContext = createContext$1('en');
|
983
1037
|
function setupI18n(_ref) {
|
984
1038
|
var defaultLocale = _ref.defaultLocale,
|
985
1039
|
locale = _ref.locale,
|
@@ -1055,10 +1109,16 @@ function useOnScreen(ref) {
|
|
1055
1109
|
|
1056
1110
|
useEffect(function () {
|
1057
1111
|
var current = ref.current;
|
1058
|
-
var observer = createIntersectionObserver(function (
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1112
|
+
var observer = createIntersectionObserver(function (entries) {
|
1113
|
+
// Even when observing only a single element, multiple entries
|
1114
|
+
// may have queued up. In Chrome this can be observed when
|
1115
|
+
// moving an observed element in the DOM: The callback is
|
1116
|
+
// invoked once with two entries for the same target, one
|
1117
|
+
// claiming the element no longer intersects and one - with a
|
1118
|
+
// later timestamp - saying that is does intersect. Assuming
|
1119
|
+
// entries are ordered according to time, we only consider the
|
1120
|
+
// last entry.
|
1121
|
+
var entry = entries[entries.length - 1];
|
1062
1122
|
setIntersecting(entry.isIntersecting);
|
1063
1123
|
|
1064
1124
|
if (entry.isIntersecting && onIntersecting) {
|
@@ -1114,7 +1174,7 @@ function createIntersectionObserver(callback, options, skipIframeFix) {
|
|
1114
1174
|
|
1115
1175
|
var styles = {"wrapper":"useScrollPositionLifecycle-module_wrapper__1a6Kr","isActiveProbe":"useScrollPositionLifecycle-module_isActiveProbe__3VKB5"};
|
1116
1176
|
|
1117
|
-
var StaticPreviewContext = createContext(false);
|
1177
|
+
var StaticPreviewContext = createContext$1(false);
|
1118
1178
|
function StaticPreview(_ref) {
|
1119
1179
|
var children = _ref.children;
|
1120
1180
|
return (
|
@@ -1124,6 +1184,18 @@ function StaticPreview(_ref) {
|
|
1124
1184
|
}, children)
|
1125
1185
|
);
|
1126
1186
|
}
|
1187
|
+
/**
|
1188
|
+
* Use inside a content element component to determine whether the
|
1189
|
+
* component is being rendered in a static preview, e.g. editor
|
1190
|
+
* thumbnails.
|
1191
|
+
*
|
1192
|
+
* @example
|
1193
|
+
* const isStaticPreview = useIsStaticPreview();
|
1194
|
+
*/
|
1195
|
+
|
1196
|
+
function useIsStaticPreview() {
|
1197
|
+
return useContext(StaticPreviewContext);
|
1198
|
+
}
|
1127
1199
|
function createScrollPositionLifecycleProvider(Context) {
|
1128
1200
|
return function ScrollPositionLifecycleProvider(_ref2) {
|
1129
1201
|
var children = _ref2.children,
|
@@ -1131,9 +1203,12 @@ function createScrollPositionLifecycleProvider(Context) {
|
|
1131
1203
|
var ref = useRef();
|
1132
1204
|
var isActiveProbeRef = useRef();
|
1133
1205
|
var isStaticPreview = useContext(StaticPreviewContext);
|
1134
|
-
var
|
1135
|
-
rootMargin: '
|
1206
|
+
var shouldLoad = useOnScreen(ref, {
|
1207
|
+
rootMargin: '200% 0px 200% 0px'
|
1136
1208
|
});
|
1209
|
+
var shouldPrepare = useOnScreen(ref, {
|
1210
|
+
rootMargin: '25% 0px 25% 0px'
|
1211
|
+
}) && !isStaticPreview;
|
1137
1212
|
var isVisible = useOnScreen(ref) && !isStaticPreview;
|
1138
1213
|
var isActive = useOnScreen(isActiveProbeRef, {
|
1139
1214
|
rootMargin: '-50% 0px -50% 0px',
|
@@ -1141,11 +1216,12 @@ function createScrollPositionLifecycleProvider(Context) {
|
|
1141
1216
|
}) && !isStaticPreview;
|
1142
1217
|
var value = useMemo(function () {
|
1143
1218
|
return {
|
1144
|
-
|
1219
|
+
shouldLoad: shouldLoad,
|
1220
|
+
shouldPrepare: shouldPrepare,
|
1145
1221
|
isVisible: isVisible,
|
1146
1222
|
isActive: isActive
|
1147
1223
|
};
|
1148
|
-
}, [
|
1224
|
+
}, [shouldLoad, shouldPrepare, isVisible, isActive]);
|
1149
1225
|
return (
|
1150
1226
|
/*#__PURE__*/
|
1151
1227
|
React.createElement("div", {
|
@@ -1202,6 +1278,67 @@ function createScrollPositionLifecycleHook(Context) {
|
|
1202
1278
|
};
|
1203
1279
|
}
|
1204
1280
|
|
1281
|
+
var styles$1 = {"root":"MotifArea-module_root__1_ACd","visible":"MotifArea-module_visible__18Kln"};
|
1282
|
+
|
1283
|
+
var VisibilityContext = React.createContext(false);
|
1284
|
+
function MotifAreaVisibilityProvider(_ref) {
|
1285
|
+
var visible = _ref.visible,
|
1286
|
+
children = _ref.children;
|
1287
|
+
return (
|
1288
|
+
/*#__PURE__*/
|
1289
|
+
React.createElement(VisibilityContext.Provider, {
|
1290
|
+
value: visible
|
1291
|
+
}, children)
|
1292
|
+
);
|
1293
|
+
}
|
1294
|
+
var MotifArea = function MotifArea(props) {
|
1295
|
+
var _props$file;
|
1296
|
+
|
1297
|
+
var lastPosition = useRef();
|
1298
|
+
var position = ((_props$file = props.file) === null || _props$file === void 0 ? void 0 : _props$file.isReady) && getPosition(props);
|
1299
|
+
var visible = useContext(VisibilityContext);
|
1300
|
+
var elementRef = useRef();
|
1301
|
+
var onUpdate = props.onUpdate;
|
1302
|
+
var setElementRef = useCallback(function (element) {
|
1303
|
+
elementRef.current = element;
|
1304
|
+
onUpdate(element);
|
1305
|
+
}, [elementRef, onUpdate]);
|
1306
|
+
useEffect(function () {
|
1307
|
+
if (lastPosition.current && position && (lastPosition.current.top !== position.top || lastPosition.current.left !== position.left || lastPosition.current.width !== position.width || lastPosition.current.height !== position.height)) {
|
1308
|
+
onUpdate(elementRef.current);
|
1309
|
+
}
|
1310
|
+
|
1311
|
+
lastPosition.current = position;
|
1312
|
+
});
|
1313
|
+
|
1314
|
+
if (!position) {
|
1315
|
+
return null;
|
1316
|
+
}
|
1317
|
+
|
1318
|
+
return (
|
1319
|
+
/*#__PURE__*/
|
1320
|
+
React.createElement("div", {
|
1321
|
+
ref: setElementRef,
|
1322
|
+
className: classNames(styles$1.root, _defineProperty({}, styles$1.visible, visible)),
|
1323
|
+
style: position,
|
1324
|
+
onMouseEnter: props.onMouseEnter,
|
1325
|
+
onMouseLeave: props.onMouseLeave
|
1326
|
+
})
|
1327
|
+
);
|
1328
|
+
};
|
1329
|
+
MotifArea.defaultProps = {
|
1330
|
+
onUpdate: function onUpdate() {}
|
1331
|
+
};
|
1332
|
+
|
1333
|
+
function getPosition(props) {
|
1334
|
+
return props.file.motifAreaOffsetRect || {
|
1335
|
+
top: 0,
|
1336
|
+
left: 0,
|
1337
|
+
width: 0,
|
1338
|
+
height: 0
|
1339
|
+
};
|
1340
|
+
}
|
1341
|
+
|
1205
1342
|
function useMediaQuery(query) {
|
1206
1343
|
var _useState = useState(false),
|
1207
1344
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -1235,21 +1372,24 @@ function useMediaQuery(query) {
|
|
1235
1372
|
return doesMatch;
|
1236
1373
|
}
|
1237
1374
|
|
1238
|
-
var styles$
|
1375
|
+
var styles$2 = {"Foreground":"Foreground-module_Foreground__13ODU","fullFadeHeight":"Foreground-module_fullFadeHeight__2p9dx","fullHeight":"Foreground-module_fullHeight__1vMXb","inFirstSection":"Foreground-module_inFirstSection__1r-_i","paddingBottom":"Foreground-module_paddingBottom__3OtY4"};
|
1239
1376
|
|
1240
|
-
var ForcePaddingContext = createContext(false);
|
1377
|
+
var ForcePaddingContext = createContext$1(false);
|
1241
1378
|
function Foreground(props) {
|
1242
1379
|
var forcePadding = useContext(ForcePaddingContext);
|
1243
1380
|
return (
|
1244
1381
|
/*#__PURE__*/
|
1245
1382
|
React.createElement("div", {
|
1246
|
-
className: className(props, forcePadding)
|
1383
|
+
className: className(props, forcePadding),
|
1384
|
+
style: {
|
1385
|
+
minHeight: props.minHeight
|
1386
|
+
}
|
1247
1387
|
}, props.children)
|
1248
1388
|
);
|
1249
1389
|
}
|
1250
1390
|
|
1251
1391
|
function className(props, forcePadding) {
|
1252
|
-
return classNames(styles$
|
1392
|
+
return classNames(styles$2.Foreground, props.transitionStyles.foreground, props.transitionStyles["foreground-".concat(props.state)], _defineProperty({}, styles$2.paddingBottom, props.paddingBottom || forcePadding), _defineProperty({}, styles$2.inFirstSection, props.inFirstSection), styles$2["".concat(props.heightMode, "Height")]);
|
1253
1393
|
}
|
1254
1394
|
|
1255
1395
|
/**
|
@@ -1270,6 +1410,13 @@ function () {
|
|
1270
1410
|
* @param {string} typeName - Name of the content element type.
|
1271
1411
|
* @param {Object} options
|
1272
1412
|
* @param {React.Component} options.component
|
1413
|
+
* @param {boolean} [options.supportsWrappingAroundFloats] -
|
1414
|
+
* In sections with centered layout, content elements can be
|
1415
|
+
* floated to the left or right. By default all content
|
1416
|
+
* elements are cleared to position them below floating
|
1417
|
+
* elements. If a content element renders mainly text that
|
1418
|
+
* can wrap around floating elements, clearing can be
|
1419
|
+
* disabled via this option.
|
1273
1420
|
* @memberof frontend_contentElementTypes
|
1274
1421
|
*
|
1275
1422
|
* @example
|
@@ -1317,7 +1464,7 @@ var api = {
|
|
1317
1464
|
// file with an empty one, but found out that extracting the import
|
1318
1465
|
// to a separate file apparently is enough.
|
1319
1466
|
function importComponents() {
|
1320
|
-
return import('./components-
|
1467
|
+
return import('./components-3ead1b4a.js');
|
1321
1468
|
}
|
1322
1469
|
|
1323
1470
|
var components = {};
|
@@ -1363,7 +1510,7 @@ function withInlineEditingAlternative(name, Component) {
|
|
1363
1510
|
};
|
1364
1511
|
}
|
1365
1512
|
|
1366
|
-
var ContentElementAttributesContext = createContext({});
|
1513
|
+
var ContentElementAttributesContext = createContext$1({});
|
1367
1514
|
function ContentElementAttributesProvider(_ref) {
|
1368
1515
|
var id = _ref.id,
|
1369
1516
|
children = _ref.children;
|
@@ -1383,7 +1530,7 @@ function useContentElementAttributes() {
|
|
1383
1530
|
return useContext(ContentElementAttributesContext);
|
1384
1531
|
}
|
1385
1532
|
|
1386
|
-
var ContentElementLifecycleContext = createContext();
|
1533
|
+
var ContentElementLifecycleContext = createContext$1();
|
1387
1534
|
var LifecycleProvider = createScrollPositionLifecycleProvider(ContentElementLifecycleContext);
|
1388
1535
|
var useLifecycle = createScrollPositionLifecycleHook(ContentElementLifecycleContext);
|
1389
1536
|
function ContentElementLifecycleProvider(_ref) {
|
@@ -1408,7 +1555,11 @@ function ContentElementLifecycleProvider(_ref) {
|
|
1408
1555
|
* option to be set to true in the `frontend.contentElements.register`
|
1409
1556
|
* call for the content element's type.
|
1410
1557
|
*
|
1411
|
-
* * `
|
1558
|
+
* * `shouldLoad` is true if the content element should start lazy
|
1559
|
+
* load. Becomes true before `shouldPrepare`.
|
1560
|
+
*
|
1561
|
+
* * `shouldPrepare` is true if the content element is about to enter
|
1562
|
+
* the viewport.
|
1412
1563
|
*
|
1413
1564
|
* * `isActive` is true if the content element is completely in the
|
1414
1565
|
* viewport.
|
@@ -1421,7 +1572,7 @@ function ContentElementLifecycleProvider(_ref) {
|
|
1421
1572
|
*
|
1422
1573
|
* @example
|
1423
1574
|
*
|
1424
|
-
* const {isActive,
|
1575
|
+
* const {isActive, shouldPrepare} = useContentElementLifecycle();
|
1425
1576
|
*/
|
1426
1577
|
|
1427
1578
|
function useContentElementLifecycle(options) {
|
@@ -1434,7 +1585,7 @@ function useContentElementLifecycle(options) {
|
|
1434
1585
|
return result;
|
1435
1586
|
}
|
1436
1587
|
|
1437
|
-
var styles$
|
1588
|
+
var styles$3 = {"wrapper":"ContentElementMargin-module_wrapper__20kIk"};
|
1438
1589
|
|
1439
1590
|
function ContentElementMargin(_ref) {
|
1440
1591
|
var position = _ref.position,
|
@@ -1447,12 +1598,12 @@ function ContentElementMargin(_ref) {
|
|
1447
1598
|
return (
|
1448
1599
|
/*#__PURE__*/
|
1449
1600
|
React.createElement("div", {
|
1450
|
-
className: styles$
|
1601
|
+
className: styles$3.wrapper
|
1451
1602
|
}, children)
|
1452
1603
|
);
|
1453
1604
|
}
|
1454
1605
|
|
1455
|
-
var styles$
|
1606
|
+
var styles$4 = {"missing":"ContentElement-module_missing__2_1j9"};
|
1456
1607
|
|
1457
1608
|
function _createSuper(Derived) {
|
1458
1609
|
function isNativeReflectConstruct() {
|
@@ -1509,7 +1660,7 @@ function (_React$Component) {
|
|
1509
1660
|
return (
|
1510
1661
|
/*#__PURE__*/
|
1511
1662
|
React.createElement("div", {
|
1512
|
-
className: styles$
|
1663
|
+
className: styles$4.missing
|
1513
1664
|
}, "Error rendering element of type \"", this.props.type, "\"")
|
1514
1665
|
);
|
1515
1666
|
}
|
@@ -1560,7 +1711,7 @@ var ContentElement = withInlineEditingDecorator('ContentElementDecorator', funct
|
|
1560
1711
|
return (
|
1561
1712
|
/*#__PURE__*/
|
1562
1713
|
React.createElement("div", {
|
1563
|
-
className: styles$
|
1714
|
+
className: styles$4.missing
|
1564
1715
|
}, "Element of unknown type \"", props.type, "\"")
|
1565
1716
|
);
|
1566
1717
|
}
|
@@ -1575,7 +1726,7 @@ function ContentElements(props) {
|
|
1575
1726
|
React.createElement(React.Fragment, null, props.items.map(function (item, index) {
|
1576
1727
|
return props.children(item,
|
1577
1728
|
/*#__PURE__*/
|
1578
|
-
React.createElement(
|
1729
|
+
React.createElement(MemoizedContentElement, {
|
1579
1730
|
key: item.id,
|
1580
1731
|
id: item.id,
|
1581
1732
|
permaId: item.permaId,
|
@@ -1588,6 +1739,9 @@ function ContentElements(props) {
|
|
1588
1739
|
}))
|
1589
1740
|
);
|
1590
1741
|
}
|
1742
|
+
var MemoizedContentElement = React.memo(ContentElement, function (prevProps, nextProps) {
|
1743
|
+
return prevProps.id === nextProps.id && prevProps.permaId === nextProps.permaId && prevProps.type === nextProps.type && prevProps.position === nextProps.position && prevProps.itemProps === nextProps.itemProps && prevProps.sectionProps === nextProps.sectionProps;
|
1744
|
+
});
|
1591
1745
|
ContentElements.defaultProps = {
|
1592
1746
|
children: function children(item, child) {
|
1593
1747
|
return child;
|
@@ -1598,7 +1752,7 @@ function useNarrowViewport() {
|
|
1598
1752
|
return useMediaQuery('(max-width: 950px)');
|
1599
1753
|
}
|
1600
1754
|
|
1601
|
-
var styles$
|
1755
|
+
var styles$5 = {"root":"TwoColumn-module_root__37EqL","group":"TwoColumn-module_group__3Hg2y","group-full":"TwoColumn-module_group-full__2OT4o","sticky":"TwoColumn-module_sticky__4LCDO","inline":"TwoColumn-module_inline__1fPfM","right":"TwoColumn-module_right__Fr52a","narrow":"TwoColumn-module_narrow__qAgnL","wide":"TwoColumn-module_wide__xdF_t"};
|
1602
1756
|
|
1603
1757
|
function availablePositions(narrow) {
|
1604
1758
|
if (narrow) {
|
@@ -1613,13 +1767,18 @@ function TwoColumn(props) {
|
|
1613
1767
|
return (
|
1614
1768
|
/*#__PURE__*/
|
1615
1769
|
React.createElement("div", {
|
1616
|
-
className: classNames(styles$
|
1770
|
+
className: classNames(styles$5.root, styles$5[props.align], narrow ? styles$5.narrow : styles$5.wide)
|
1617
1771
|
},
|
1618
1772
|
/*#__PURE__*/
|
1619
1773
|
React.createElement("div", {
|
1620
|
-
className: styles$
|
1774
|
+
className: classNames(styles$5.group),
|
1775
|
+
key: props.align
|
1776
|
+
},
|
1777
|
+
/*#__PURE__*/
|
1778
|
+
React.createElement("div", {
|
1779
|
+
className: styles$5.inline,
|
1621
1780
|
ref: props.contentAreaRef
|
1622
|
-
}), renderItems(props, narrow), renderPlaceholder(props.placeholder))
|
1781
|
+
})), renderItems(props, narrow), renderPlaceholder(props.placeholder))
|
1623
1782
|
);
|
1624
1783
|
}
|
1625
1784
|
TwoColumn.defaultProps = {
|
@@ -1632,7 +1791,7 @@ function renderItems(props, narrow) {
|
|
1632
1791
|
/*#__PURE__*/
|
1633
1792
|
React.createElement("div", {
|
1634
1793
|
key: index,
|
1635
|
-
className: classNames(styles$
|
1794
|
+
className: classNames(styles$5.group, styles$5["group-".concat(group.position)])
|
1636
1795
|
}, renderItemGroup(props, group, 'sticky'), renderItemGroup(props, group, 'inline'), renderItemGroup(props, group, 'full'))
|
1637
1796
|
);
|
1638
1797
|
});
|
@@ -1643,7 +1802,7 @@ function renderItemGroup(props, group, position) {
|
|
1643
1802
|
return (
|
1644
1803
|
/*#__PURE__*/
|
1645
1804
|
React.createElement("div", {
|
1646
|
-
className: styles$
|
1805
|
+
className: styles$5[position]
|
1647
1806
|
}, props.children(
|
1648
1807
|
/*#__PURE__*/
|
1649
1808
|
React.createElement(ContentElements, {
|
@@ -1694,22 +1853,22 @@ function renderPlaceholder(placeholder) {
|
|
1694
1853
|
return (
|
1695
1854
|
/*#__PURE__*/
|
1696
1855
|
React.createElement("div", {
|
1697
|
-
className: classNames(styles$
|
1856
|
+
className: classNames(styles$5.group)
|
1698
1857
|
},
|
1699
1858
|
/*#__PURE__*/
|
1700
1859
|
React.createElement("div", {
|
1701
|
-
className: styles$
|
1860
|
+
className: styles$5.inline
|
1702
1861
|
}, placeholder))
|
1703
1862
|
);
|
1704
1863
|
}
|
1705
1864
|
|
1706
|
-
var styles$
|
1865
|
+
var styles$6 = {"outer":"Center-module_outer__3Rr0H","outer-full":"Center-module_outer-full__3dknO","item":"Center-module_item__1KSs3","item-full":"Center-module_item-full__1cEuv","clear":"Center-module_clear__jJEap","inner-left":"Center-module_inner-left__2z9Ea","inner-right":"Center-module_inner-right__KBkVt"};
|
1707
1866
|
|
1708
1867
|
function Center(props) {
|
1709
1868
|
return (
|
1710
1869
|
/*#__PURE__*/
|
1711
1870
|
React.createElement("div", {
|
1712
|
-
className: classNames(styles$
|
1871
|
+
className: classNames(styles$6.root)
|
1713
1872
|
},
|
1714
1873
|
/*#__PURE__*/
|
1715
1874
|
React.createElement("div", {
|
@@ -1724,21 +1883,28 @@ function Center(props) {
|
|
1724
1883
|
/*#__PURE__*/
|
1725
1884
|
React.createElement("div", {
|
1726
1885
|
key: item.id,
|
1727
|
-
className:
|
1886
|
+
className: outerClassName(item)
|
1728
1887
|
},
|
1729
1888
|
/*#__PURE__*/
|
1730
1889
|
React.createElement("div", {
|
1731
|
-
className: classNames(styles$
|
1890
|
+
className: classNames(styles$6.item, styles$6["item-".concat(item.position)])
|
1732
1891
|
}, props.children(
|
1733
1892
|
/*#__PURE__*/
|
1734
1893
|
React.createElement("div", {
|
1735
|
-
className: styles$
|
1894
|
+
className: styles$6["inner-".concat(item.position)]
|
1736
1895
|
}, child), boxProps(props.items, item, index))))
|
1737
1896
|
);
|
1738
1897
|
}), renderPlaceholder$1(props.placeholder))
|
1739
1898
|
);
|
1740
1899
|
}
|
1741
1900
|
|
1901
|
+
function outerClassName(item) {
|
1902
|
+
var _api$contentElementTy = api.contentElementTypes.getOptions(item.type),
|
1903
|
+
supportsWrappingAroundFloats = _api$contentElementTy.supportsWrappingAroundFloats;
|
1904
|
+
|
1905
|
+
return classNames(styles$6.outer, styles$6["outer-".concat(item.position)], _defineProperty({}, styles$6.clear, !supportsWrappingAroundFloats));
|
1906
|
+
}
|
1907
|
+
|
1742
1908
|
function boxProps(items, item, index) {
|
1743
1909
|
var previous = items[index - 1];
|
1744
1910
|
var next = items[index + 1];
|
@@ -1757,16 +1923,18 @@ function renderPlaceholder$1(placeholder) {
|
|
1757
1923
|
return (
|
1758
1924
|
/*#__PURE__*/
|
1759
1925
|
React.createElement("div", {
|
1760
|
-
className: classNames(styles$
|
1926
|
+
className: classNames(styles$6.outer)
|
1761
1927
|
},
|
1762
1928
|
/*#__PURE__*/
|
1763
1929
|
React.createElement("div", {
|
1764
|
-
className: classNames(styles$
|
1930
|
+
className: classNames(styles$6.item)
|
1765
1931
|
}, placeholder))
|
1766
1932
|
);
|
1767
1933
|
}
|
1768
1934
|
|
1769
|
-
var Layout = withInlineEditingAlternative('LayoutWithPlaceholder', LayoutWithoutInlineEditing)
|
1935
|
+
var Layout = React.memo(withInlineEditingAlternative('LayoutWithPlaceholder', LayoutWithoutInlineEditing), function (prevProps, nextProps) {
|
1936
|
+
return prevProps.sectionId === nextProps.sectionId && prevProps.items === nextProps.items && prevProps.appearance === nextProps.appearance && prevProps.contentAreaRef === nextProps.contentAreaRef && prevProps.sectionProps === nextProps.sectionProps;
|
1937
|
+
});
|
1770
1938
|
function LayoutWithoutInlineEditing(props) {
|
1771
1939
|
if (props.sectionProps.layout === 'center') {
|
1772
1940
|
return (
|
@@ -1809,7 +1977,7 @@ function usePostMessageListener(receiveData) {
|
|
1809
1977
|
}, [receiveData]);
|
1810
1978
|
}
|
1811
1979
|
|
1812
|
-
var styles$
|
1980
|
+
var styles$7 = {"text-s":"20px","text-base":"22px","text-l":"40px","text-xl":"66px","text-2xl":"110px","h2":"Text-module_h2__34chJ","h1":"Text-module_h1__2_5kX","body":"Text-module_body__4oWD-","caption":"Text-module_caption__3_6Au"};
|
1813
1981
|
|
1814
1982
|
/**
|
1815
1983
|
* Render some text using the default typography scale.
|
@@ -1825,7 +1993,7 @@ function Text(_ref) {
|
|
1825
1993
|
scaleCategory = _ref.scaleCategory,
|
1826
1994
|
children = _ref.children;
|
1827
1995
|
return React.createElement(inline ? 'span' : 'div', {
|
1828
|
-
className: styles$
|
1996
|
+
className: styles$7[scaleCategory]
|
1829
1997
|
}, children);
|
1830
1998
|
}
|
1831
1999
|
|
@@ -1834,7 +2002,7 @@ function useContentElementConfigurationUpdate() {
|
|
1834
2002
|
return useContext(ContentElementConfigurationUpdateContext);
|
1835
2003
|
}
|
1836
2004
|
|
1837
|
-
var ContentElementEditorCommandEmitterContext = createContext({
|
2005
|
+
var ContentElementEditorCommandEmitterContext = createContext$1({
|
1838
2006
|
on: function on() {},
|
1839
2007
|
off: function off() {}
|
1840
2008
|
});
|
@@ -1851,15 +2019,15 @@ function useContentElementEditorCommandSubscription(callback) {
|
|
1851
2019
|
}, [emitter, callback, contentElementId]);
|
1852
2020
|
}
|
1853
2021
|
|
1854
|
-
var ContentElementEditorStateContext = createContext({
|
2022
|
+
var ContentElementEditorStateContext = createContext$1({
|
1855
2023
|
isSelected: false,
|
1856
2024
|
isEditable: false,
|
1857
2025
|
setTransientState: function setTransientState() {}
|
1858
2026
|
});
|
1859
2027
|
/**
|
1860
2028
|
* Use inside a content element component to determine whether the
|
1861
|
-
* component is being rendered inside the editor and whether
|
1862
|
-
* content element is currently selected. This can be used to
|
2029
|
+
* component is being rendered inside the editor iframe, and whether
|
2030
|
+
* the content element is currently selected. This can be used to
|
1863
2031
|
* implement simple inline editing capabilities like displaying extra
|
1864
2032
|
* information when the content element is selected.
|
1865
2033
|
*
|
@@ -1990,4 +2158,4 @@ function renderLeaf(_ref3) {
|
|
1990
2158
|
);
|
1991
2159
|
}
|
1992
2160
|
|
1993
|
-
export {
|
2161
|
+
export { renderElement as $, useEntryStateDispatch as A, useSection as B, loadInlineEditingComponents as C, setupI18n as D, EntryStateProvider as E, Foreground as F, api as G, useContentElementConfigurationUpdate as H, useContentElementEditorCommandSubscription as I, useContentElementEditorState as J, useContentElementLifecycle as K, Layout as L, MotifArea as M, EditableText as N, useOnScreen as O, PhonePlatformContext as P, useLocale as Q, ContentElementEditorCommandEmitterContext as R, StaticPreview as S, Text as T, MotifAreaVisibilityProvider as U, ForcePaddingContext as V, updateContentElementConfiguration as W, ContentElementConfigurationUpdateContext as X, ContentElementEditorStateContext as Y, LayoutWithoutInlineEditing as Z, _slicedToArray as _, _defineProperty as a, renderLeaf as a0, _objectWithoutProperties as b, useFileRights as c, useLegalInfo as d, useCredits as e, useShareProviders as f, useShareUrl as g, useTheme as h, useChapters as i, createScrollPositionLifecycleProvider as j, createScrollPositionLifecycleHook as k, useEntryStructure as l, _objectSpread2 as m, useIsStaticPreview as n, useEntryMetadata as o, useNestedFiles as p, useFile as q, useMediaQuery as r, useSectionContentElements as s, usePostMessageListener as t, useI18n as u, withInlineEditingAlternative as v, withInlineEditingDecorator as w, LocaleProvider as x, _toConsumableArray as y, useAvailableQualities as z };
|