pageflow 15.1.2 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +77 -185
- data/README.md +1 -2
- data/admins/pageflow/accounts.rb +94 -19
- data/app/assets/javascripts/pageflow/admin/accounts.js +2 -2
- data/app/assets/javascripts/pageflow/dist/frontend.js +2 -0
- data/app/assets/javascripts/pageflow/dist/ui.js +9 -0
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/background_image.scss +4 -0
- data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +5 -0
- data/app/controllers/pageflow/editor/widgets_controller.rb +1 -1
- data/app/helpers/pageflow/pages_helper.rb +1 -0
- data/app/models/pageflow/account.rb +6 -0
- data/app/models/pageflow/entry.rb +8 -1
- data/app/models/pageflow/entry_template.rb +55 -0
- data/app/models/pageflow/revision.rb +1 -1
- data/app/models/pageflow/theming.rb +8 -47
- data/app/policies/pageflow/entry_template_policy.rb +18 -0
- data/app/policies/pageflow/theming_policy.rb +0 -4
- data/app/views/admin/accounts/_configuration_label.html.erb +5 -0
- data/app/views/admin/accounts/_entry_template_details.html.arb +17 -0
- data/app/views/admin/accounts/_form.html.erb +43 -23
- data/app/views/admin/accounts/_share_providers_label.html.erb +5 -0
- data/app/views/admin/accounts/_theming_details.html.arb +0 -12
- data/app/views/pageflow/themes/_theme.json.jbuilder +1 -0
- data/config/locales/de.yml +12 -7
- data/config/locales/en.yml +12 -7
- data/db/migrate/20200122115400_create_pageflow_entry_templates.rb +75 -0
- data/db/migrate/20200206134400_convert_legacy_scrolled_content_element_types.rb +48 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +32 -3
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +1 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +4 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/i18n_helper.rb +35 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +14 -2
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +10 -1
- data/entry_types/scrolled/config/locales/new/de.yml +231 -8
- data/entry_types/scrolled/config/locales/new/en.yml +228 -10
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +3 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +9 -4
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +96 -0
- data/entry_types/scrolled/package/editor.js +498 -2561
- data/entry_types/scrolled/package/frontend.js +713 -1238
- data/entry_types/scrolled/package/package.json +12 -2
- data/lib/pageflow/ability_mixin.rb +3 -2
- data/lib/pageflow/seeds.rb +0 -2
- data/lib/pageflow/theme.rb +4 -0
- data/lib/pageflow/themes.rb +5 -1
- data/lib/pageflow/version.rb +1 -1
- data/packages/pageflow/config/jest/index.js +0 -1
- data/packages/pageflow/config/jest/transformers/jst.js +1 -1
- data/packages/pageflow/config/webpack.js +0 -1
- data/packages/pageflow/editor.js +23 -3
- data/packages/pageflow/package.json +2 -1
- data/packages/pageflow/testHelpers.js +367 -4
- data/packages/pageflow/ui.js +9 -0
- data/spec/factories/accounts.rb +6 -0
- data/spec/factories/entry_templates.rb +8 -0
- data/spec/factories/published_entries.rb +3 -1
- data/spec/factories/themings.rb +0 -1
- metadata +11 -1
@@ -21,12 +21,15 @@ module PageflowScrolled
|
|
21
21
|
def editor_pack
|
22
22
|
create_file 'app/javascript/packs/pageflow-scrolled-editor.js', <<-JS
|
23
23
|
import 'pageflow-scrolled/editor';
|
24
|
+
import 'pageflow-scrolled/contentElements-editor';
|
25
|
+
import 'pageflow-scrolled/contentElements-frontend';
|
24
26
|
JS
|
25
27
|
end
|
26
28
|
|
27
29
|
def frontend_pack
|
28
30
|
create_file 'app/javascript/packs/pageflow-scrolled-frontend.js', <<-JS
|
29
31
|
import 'pageflow-scrolled/frontend';
|
32
|
+
import 'pageflow-scrolled/contentElements-frontend';
|
30
33
|
JS
|
31
34
|
end
|
32
35
|
end
|
@@ -102,8 +102,14 @@ module PageflowScrolled
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def create_content_element(section, content_element_config, position, image_files_by_name)
|
105
|
-
if %w[stickyImage inlineImage].include?(
|
106
|
-
|
105
|
+
if %w[stickyImage inlineImage inlineBeforeAfter].include?(
|
106
|
+
content_element_config['type']
|
107
|
+
)
|
108
|
+
rewrite_file_references!(
|
109
|
+
content_element_config['props'],
|
110
|
+
['id', 'before_id', 'after_id'],
|
111
|
+
image_files_by_name
|
112
|
+
)
|
107
113
|
end
|
108
114
|
|
109
115
|
section.content_elements.create!(
|
@@ -126,8 +132,7 @@ module PageflowScrolled
|
|
126
132
|
|
127
133
|
def non_image_reference?(value)
|
128
134
|
value.starts_with?('#') ||
|
129
|
-
value.starts_with?('video')
|
130
|
-
value.starts_with?('beforeAfter')
|
135
|
+
value.starts_with?('video')
|
131
136
|
end
|
132
137
|
end
|
133
138
|
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
namespace :pageflow_scrolled do
|
2
|
+
desc 'Generate dummy app for current Rails version.'
|
3
|
+
task :dummy do
|
4
|
+
require 'pageflow/support'
|
5
|
+
Pageflow::Dummy.setup
|
6
|
+
end
|
7
|
+
|
8
|
+
namespace :storybook do
|
9
|
+
namespace :seed do
|
10
|
+
task :setup, [:output] => [:destroy_entry, :create_entry, :generate_json]
|
11
|
+
|
12
|
+
desc 'Destroy entry to generate Storybook entry JSON seed from'
|
13
|
+
task destroy_entry: :environment do
|
14
|
+
entry = Pageflow::Entry.find_by_title('Storybook seed')
|
15
|
+
|
16
|
+
if entry
|
17
|
+
puts "Destroying entry 'Storybook seed'"
|
18
|
+
entry.destroy
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Create entry to generate Storybook entry JSON seed from'
|
23
|
+
task create_entry: :environment do
|
24
|
+
seeds = Module.new do
|
25
|
+
extend Pageflow::Seeds
|
26
|
+
extend PageflowScrolled::Seeds
|
27
|
+
end
|
28
|
+
|
29
|
+
if ENV['PAGEFLOW_PAPERCLIP_S3_ROOT']
|
30
|
+
Pageflow.config.paperclip_s3_root = ENV['PAGEFLOW_PAPERCLIP_S3_ROOT']
|
31
|
+
end
|
32
|
+
|
33
|
+
if ENV['PAGEFLOW_SCROLLED_DB_SEED_SKIP_FILES'] == 'true'
|
34
|
+
puts 'Skipping file uploads to S3.'
|
35
|
+
Paperclip::Storage::S3.class_eval { def flush_writes; end }
|
36
|
+
end
|
37
|
+
|
38
|
+
account = seeds.account(name: 'Storybook seed')
|
39
|
+
seeds.sample_scrolled_entry(title: 'Storybook seed',
|
40
|
+
account: account,
|
41
|
+
chapters: [],
|
42
|
+
image_files: {
|
43
|
+
turtle: {
|
44
|
+
url: 'https://s3-eu-west-1.amazonaws.com/de.codevise.pageflow.development/pageflow-next/seed-assets/images/04_turtle.jpg',
|
45
|
+
configuration: {
|
46
|
+
focusX: 24,
|
47
|
+
focusY: 40,
|
48
|
+
testReferenceName: 'turtle'
|
49
|
+
}
|
50
|
+
}.stringify_keys,
|
51
|
+
churchAfter: {
|
52
|
+
url: 'https://s3-eu-west-1.amazonaws.com/de.codevise.pageflow.development/pageflow-next/seed-assets/images/17_haldern_church_after.jpg',
|
53
|
+
configuration: {
|
54
|
+
testReferenceName: 'churchAfter'
|
55
|
+
}
|
56
|
+
}.stringify_keys,
|
57
|
+
churchBefore: {
|
58
|
+
url: 'https://s3-eu-west-1.amazonaws.com/de.codevise.pageflow.development/pageflow-next/seed-assets/images/16_haldern_church_before.jpg',
|
59
|
+
configuration: {
|
60
|
+
testReferenceName: 'churchBefore'
|
61
|
+
}
|
62
|
+
}.stringify_keys
|
63
|
+
})
|
64
|
+
end
|
65
|
+
|
66
|
+
desc 'Generate Storybook entry JSON seed'
|
67
|
+
task :generate_json, [:output] => :environment do |_t, args|
|
68
|
+
entry = Pageflow::Entry.find_by_title('Storybook seed')
|
69
|
+
|
70
|
+
unless entry
|
71
|
+
puts 'Seed entry does not exist. Run pageflow_scrolled:storybook:seed:create_entry first.'
|
72
|
+
exit 1
|
73
|
+
end
|
74
|
+
|
75
|
+
draft_entry = Pageflow::DraftEntry.new(entry)
|
76
|
+
|
77
|
+
seed =
|
78
|
+
I18n.with_locale(draft_entry.locale) do
|
79
|
+
PageflowScrolled::EntriesController
|
80
|
+
.render(inline: 'scrolled_entry_json_seed(json, entry)',
|
81
|
+
type: :jbuilder,
|
82
|
+
locals: {entry: draft_entry})
|
83
|
+
end
|
84
|
+
|
85
|
+
if args[:output].blank?
|
86
|
+
puts 'Missing argument: Pass output path via '\
|
87
|
+
'`rake pageflow_scrolled:storybook:seed:setup[some/path/seed.json]`'
|
88
|
+
exit 1
|
89
|
+
end
|
90
|
+
|
91
|
+
File.write(args[:output], seed)
|
92
|
+
puts "Wrote #{args[:output]}"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import * as globalInterop from 'pageflow/editor';
|
2
|
-
import { configurationContainer, delayedDestroying, entryTypeEditorControllerUrls, failureTracking, ForeignKeySubsetCollection, orderedCollection, Configuration, editor, Entry, modelLifecycleTrackingView, EditConfigurationView, FileInputView, ColorInputView } from 'pageflow/editor';
|
2
|
+
import { configurationContainer, delayedDestroying, entryTypeEditorControllerUrls, failureTracking, ForeignKeySubsetCollection, orderedCollection, Configuration, editor as editor$1, Entry, modelLifecycleTrackingView, EditConfigurationView, FileInputView, ColorInputView, CollectionView, BackButtonDecoratorView } from 'pageflow/editor';
|
3
3
|
import Backbone$1 from 'backbone';
|
4
4
|
import Marionette from 'backbone.marionette';
|
5
5
|
import I18n from 'i18n-js';
|
6
|
-
import { cssModulesUtils, SortableCollectionView, TextInputView, TextAreaInputView,
|
7
|
-
import React
|
6
|
+
import { cssModulesUtils, SortableCollectionView, ConfigurationEditorTabView, SelectInputView, TextInputView, TextAreaInputView, CheckBoxInputView } from 'pageflow/ui';
|
7
|
+
import React from 'react';
|
8
8
|
import ReactDOM from 'react-dom';
|
9
|
+
import { SectionThumbnail } from 'pageflow-scrolled/frontend';
|
9
10
|
import $ from 'jquery';
|
11
|
+
import { editor as editor$2 } from 'pageflow-scrolled/editor';
|
10
12
|
|
11
13
|
function _defineProperty(obj, key, value) {
|
12
14
|
if (key in obj) {
|
@@ -40,12 +42,23 @@ var Chapter = Backbone$1.Model.extend({
|
|
40
42
|
foreignKeyAttribute: 'chapterId',
|
41
43
|
parentReferenceAttribute: 'chapter'
|
42
44
|
});
|
45
|
+
this.entry = options.entry;
|
43
46
|
},
|
44
47
|
addSection: function addSection(attributes) {
|
45
|
-
this.sections.create(_objectSpread({
|
48
|
+
var section = this.sections.create(_objectSpread({
|
46
49
|
position: this.sections.length,
|
47
50
|
chapterId: this.id
|
48
|
-
}, attributes)
|
51
|
+
}, attributes), {
|
52
|
+
contentElements: this.entry.contentElements
|
53
|
+
});
|
54
|
+
section.once('sync', function () {
|
55
|
+
section.contentElements.create({
|
56
|
+
typeName: 'heading',
|
57
|
+
configuration: {
|
58
|
+
children: 'Neuer Abschnitt'
|
59
|
+
}
|
60
|
+
});
|
61
|
+
});
|
49
62
|
}
|
50
63
|
});
|
51
64
|
|
@@ -98,7 +111,7 @@ var FileSelectionHandler = function FileSelectionHandler(options) {
|
|
98
111
|
return '/scrolled/sections/' + contentElement.id;
|
99
112
|
};
|
100
113
|
};
|
101
|
-
editor.registerFileSelectionHandler('sectionConfiguration', FileSelectionHandler);
|
114
|
+
editor$1.registerFileSelectionHandler('sectionConfiguration', FileSelectionHandler);
|
102
115
|
|
103
116
|
var Section = Backbone$1.Model.extend({
|
104
117
|
mixins: [configurationContainer({
|
@@ -108,6 +121,14 @@ var Section = Backbone$1.Model.extend({
|
|
108
121
|
}), delayedDestroying, entryTypeEditorControllerUrls.forModel({
|
109
122
|
resources: 'sections'
|
110
123
|
}), failureTracking],
|
124
|
+
initialize: function initialize(attributes, options) {
|
125
|
+
this.contentElements = new ForeignKeySubsetCollection({
|
126
|
+
parent: options.contentElements,
|
127
|
+
parentModel: this,
|
128
|
+
foreignKeyAttribute: 'sectionId',
|
129
|
+
parentReferenceAttribute: 'section'
|
130
|
+
});
|
131
|
+
},
|
111
132
|
chapterPosition: function chapterPosition() {
|
112
133
|
return this.chapter && this.chapter.has('position') ? this.chapter.get('position') : -1;
|
113
134
|
}
|
@@ -134,16 +155,21 @@ var SectionsCollection = Backbone$1.Collection.extend({
|
|
134
155
|
});
|
135
156
|
|
136
157
|
var ContentElement = Backbone$1.Model.extend({
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
158
|
+
paramRoot: 'content_element',
|
159
|
+
mixins: [configurationContainer({
|
160
|
+
autoSave: true,
|
161
|
+
includeAttributesInJSON: ['position', 'typeName']
|
162
|
+
}), delayedDestroying, entryTypeEditorControllerUrls.forModel({
|
163
|
+
resources: 'content_elements'
|
164
|
+
}), failureTracking]
|
143
165
|
});
|
144
166
|
|
145
167
|
var ContentElementsCollection = Backbone$1.Collection.extend({
|
146
|
-
model: ContentElement
|
168
|
+
model: ContentElement,
|
169
|
+
mixins: [entryTypeEditorControllerUrls.forCollection({
|
170
|
+
resources: 'content_elements'
|
171
|
+
})],
|
172
|
+
comparator: 'position'
|
147
173
|
});
|
148
174
|
|
149
175
|
function ownKeys$1(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; }
|
@@ -152,144 +178,85 @@ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) {
|
|
152
178
|
var ScrolledEntry = Entry.extend({
|
153
179
|
setupFromEntryTypeSeed: function setupFromEntryTypeSeed(seed) {
|
154
180
|
this.contentElements = new ContentElementsCollection(seed.collections.contentElements);
|
155
|
-
this.sections = new SectionsCollection(seed.collections.sections
|
181
|
+
this.sections = new SectionsCollection(seed.collections.sections, {
|
182
|
+
contentElements: this.contentElements
|
183
|
+
});
|
156
184
|
this.chapters = new ChaptersCollection(seed.collections.chapters, {
|
157
|
-
sections: this.sections
|
185
|
+
sections: this.sections,
|
186
|
+
entry: this
|
158
187
|
});
|
159
188
|
this.chapters.parentModel = this;
|
160
189
|
this.sections.sort();
|
161
|
-
editor.failures.watch(this.contentElements);
|
162
|
-
editor.failures.watch(this.sections);
|
163
|
-
editor.failures.watch(this.chapters);
|
164
|
-
editor.savingRecords.watch(this.contentElements);
|
165
|
-
editor.savingRecords.watch(this.sections);
|
166
|
-
editor.savingRecords.watch(this.chapters);
|
190
|
+
editor$1.failures.watch(this.contentElements);
|
191
|
+
editor$1.failures.watch(this.sections);
|
192
|
+
editor$1.failures.watch(this.chapters);
|
193
|
+
editor$1.savingRecords.watch(this.contentElements);
|
194
|
+
editor$1.savingRecords.watch(this.sections);
|
195
|
+
editor$1.savingRecords.watch(this.chapters);
|
167
196
|
this.scrolledSeed = seed;
|
168
197
|
},
|
169
198
|
addChapter: function addChapter(attributes) {
|
170
199
|
this.chapters.create(_objectSpread$1({
|
171
200
|
position: this.chapters.length
|
172
201
|
}, attributes), {
|
202
|
+
entry: this,
|
173
203
|
sections: this.sections
|
174
204
|
});
|
175
|
-
}
|
176
|
-
|
177
|
-
|
178
|
-
function _arrayWithHoles(arr) {
|
179
|
-
if (Array.isArray(arr)) return arr;
|
180
|
-
}
|
205
|
+
},
|
206
|
+
insertContentElement: function insertContentElement(attributes, _ref, defaultConfig) {
|
207
|
+
var _this = this;
|
181
208
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
209
|
+
var position = _ref.position,
|
210
|
+
id = _ref.id;
|
211
|
+
var sibling = this.contentElements.get(id);
|
212
|
+
var section = sibling.section;
|
213
|
+
defaultConfig = defaultConfig || {};
|
214
|
+
var delta = 0;
|
215
|
+
section.contentElements.each(function (contentElement, index) {
|
216
|
+
if (contentElement === sibling && position === 'before') {
|
217
|
+
delta = 1;
|
218
|
+
}
|
186
219
|
|
187
|
-
|
188
|
-
var _n = true;
|
189
|
-
var _d = false;
|
190
|
-
var _e = undefined;
|
220
|
+
contentElement.set('position', index + delta);
|
191
221
|
|
192
|
-
|
193
|
-
|
194
|
-
|
222
|
+
if (contentElement === sibling && position === 'after') {
|
223
|
+
delta = 1;
|
224
|
+
}
|
225
|
+
});
|
226
|
+
var newContentElement = section.contentElements.create(_objectSpread$1({
|
227
|
+
position: sibling.get('position') + (position === 'before' ? -1 : 1)
|
228
|
+
}, attributes, {
|
229
|
+
configuration: _objectSpread$1({}, defaultConfig, {
|
230
|
+
position: sibling.configuration.get('position')
|
231
|
+
})
|
232
|
+
}));
|
233
|
+
section.contentElements.sort();
|
234
|
+
newContentElement.once('sync', function () {
|
235
|
+
section.contentElements.saveOrder();
|
195
236
|
|
196
|
-
|
197
|
-
}
|
198
|
-
} catch (err) {
|
199
|
-
_d = true;
|
200
|
-
_e = err;
|
201
|
-
} finally {
|
202
|
-
try {
|
203
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
204
|
-
} finally {
|
205
|
-
if (_d) throw _e;
|
206
|
-
}
|
237
|
+
_this.trigger('selectContentElement', newContentElement);
|
238
|
+
});
|
207
239
|
}
|
240
|
+
});
|
208
241
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
function _nonIterableRest() {
|
213
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
214
|
-
}
|
242
|
+
var ContentElementFileSelectionHandler = function ContentElementFileSelectionHandler(options) {
|
243
|
+
var contentElement = options.entry.contentElements.get(options.id);
|
215
244
|
|
216
|
-
function
|
217
|
-
|
218
|
-
}
|
245
|
+
this.call = function (file) {
|
246
|
+
contentElement.configuration.setReference(options.attributeName, file);
|
247
|
+
};
|
219
248
|
|
220
|
-
|
249
|
+
this.getReferer = function () {
|
250
|
+
return '/scrolled/content_elements/' + contentElement.id;
|
251
|
+
};
|
252
|
+
};
|
221
253
|
|
222
|
-
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
223
254
|
var PREFIX = 'PAGEFLOW_SCROLLED_COLLECTION';
|
224
255
|
var RESET = "".concat(PREFIX, "_RESET");
|
225
256
|
var ADD = "".concat(PREFIX, "_ADD");
|
226
257
|
var CHANGE = "".concat(PREFIX, "_CHANGE");
|
227
258
|
var REMOVE = "".concat(PREFIX, "_REMOVE");
|
228
259
|
var SORT = "".concat(PREFIX, "_SORT");
|
229
|
-
function useCollections() {
|
230
|
-
var seed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
231
|
-
|
232
|
-
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
233
|
-
keyAttribute = _ref.keyAttribute;
|
234
|
-
|
235
|
-
return useReducer(reducer, Object.keys(seed).reduce(function (result, key) {
|
236
|
-
result[key] = init(seed[key], keyAttribute);
|
237
|
-
return result;
|
238
|
-
}, {}));
|
239
|
-
}
|
240
|
-
|
241
|
-
function reducer(state, action) {
|
242
|
-
var collectionName = action.payload.collectionName;
|
243
|
-
var keyAttribute = action.payload.keyAttribute;
|
244
|
-
|
245
|
-
switch (action.type) {
|
246
|
-
case RESET:
|
247
|
-
return _objectSpread$2({}, state, _defineProperty({}, collectionName, init(action.payload.items, keyAttribute)));
|
248
|
-
|
249
|
-
case ADD:
|
250
|
-
return _objectSpread$2({}, state, _defineProperty({}, collectionName, {
|
251
|
-
order: action.payload.order,
|
252
|
-
items: _objectSpread$2({}, state[collectionName].items, _defineProperty({}, action.payload.attributes[keyAttribute], action.payload.attributes))
|
253
|
-
}));
|
254
|
-
|
255
|
-
case CHANGE:
|
256
|
-
return _objectSpread$2({}, state, _defineProperty({}, collectionName, {
|
257
|
-
order: state[collectionName].order,
|
258
|
-
items: _objectSpread$2({}, state[collectionName].items, _defineProperty({}, action.payload.attributes[keyAttribute], action.payload.attributes))
|
259
|
-
}));
|
260
|
-
|
261
|
-
case REMOVE:
|
262
|
-
var clonedItems = _objectSpread$2({}, state[collectionName].items);
|
263
|
-
|
264
|
-
delete clonedItems[action.payload.key];
|
265
|
-
return _objectSpread$2({}, state, _defineProperty({}, collectionName, {
|
266
|
-
order: action.payload.order,
|
267
|
-
items: clonedItems
|
268
|
-
}));
|
269
|
-
|
270
|
-
case SORT:
|
271
|
-
return _objectSpread$2({}, state, _defineProperty({}, collectionName, {
|
272
|
-
order: action.payload.order,
|
273
|
-
items: state[collectionName].items
|
274
|
-
}));
|
275
|
-
|
276
|
-
default:
|
277
|
-
return state;
|
278
|
-
}
|
279
|
-
}
|
280
|
-
|
281
|
-
function init(items) {
|
282
|
-
var keyAttribute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
|
283
|
-
return {
|
284
|
-
order: items.map(function (item) {
|
285
|
-
return item[keyAttribute];
|
286
|
-
}),
|
287
|
-
items: items.reduce(function (result, item) {
|
288
|
-
result[item[keyAttribute]] = item;
|
289
|
-
return result;
|
290
|
-
}, {})
|
291
|
-
};
|
292
|
-
}
|
293
260
|
|
294
261
|
function watchCollection(collection, _ref2) {
|
295
262
|
var name = _ref2.name,
|
@@ -298,10 +265,12 @@ function watchCollection(collection, _ref2) {
|
|
298
265
|
includeConfiguration = _ref2.includeConfiguration,
|
299
266
|
_ref2$keyAttribute = _ref2.keyAttribute,
|
300
267
|
keyAttribute = _ref2$keyAttribute === void 0 ? 'id' : _ref2$keyAttribute;
|
268
|
+
var handle = {};
|
301
269
|
var options = {
|
302
270
|
attributeNames: attributes,
|
303
271
|
includeConfiguration: includeConfiguration
|
304
272
|
};
|
273
|
+
var tearingDown = false;
|
305
274
|
var watchedAttributeNames = getWatchedAttributeNames(attributes);
|
306
275
|
dispatch({
|
307
276
|
type: RESET,
|
@@ -325,7 +294,7 @@ function watchCollection(collection, _ref2) {
|
|
325
294
|
}
|
326
295
|
});
|
327
296
|
}
|
328
|
-
});
|
297
|
+
}, handle);
|
329
298
|
collection.on('change', function (model) {
|
330
299
|
if (hasChangedAttributes(model, watchedAttributeNames)) {
|
331
300
|
dispatch({
|
@@ -337,7 +306,7 @@ function watchCollection(collection, _ref2) {
|
|
337
306
|
}
|
338
307
|
});
|
339
308
|
}
|
340
|
-
});
|
309
|
+
}, handle);
|
341
310
|
|
342
311
|
if (includeConfiguration) {
|
343
312
|
collection.on('change:configuration', function (model) {
|
@@ -349,19 +318,21 @@ function watchCollection(collection, _ref2) {
|
|
349
318
|
attributes: getAttributes(model, options)
|
350
319
|
}
|
351
320
|
});
|
352
|
-
});
|
321
|
+
}, handle);
|
353
322
|
}
|
354
323
|
|
355
324
|
collection.on('remove', function (model) {
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
325
|
+
if (!tearingDown) {
|
326
|
+
dispatch({
|
327
|
+
type: REMOVE,
|
328
|
+
payload: {
|
329
|
+
collectionName: name,
|
330
|
+
order: collection.pluck(keyAttribute),
|
331
|
+
key: model.attributes[keyAttribute]
|
332
|
+
}
|
333
|
+
});
|
334
|
+
}
|
335
|
+
}, handle);
|
365
336
|
collection.on('sort', function (model) {
|
366
337
|
return dispatch({
|
367
338
|
type: SORT,
|
@@ -370,7 +341,11 @@ function watchCollection(collection, _ref2) {
|
|
370
341
|
order: collection.pluck(keyAttribute).filter(Boolean)
|
371
342
|
}
|
372
343
|
});
|
373
|
-
});
|
344
|
+
}, handle);
|
345
|
+
return function () {
|
346
|
+
tearingDown = true;
|
347
|
+
collection.off(null, null, handle);
|
348
|
+
};
|
374
349
|
}
|
375
350
|
|
376
351
|
function hasChangedAttributes(model, attributeNames) {
|
@@ -396,7 +371,12 @@ function getAttributes(model, _ref3) {
|
|
396
371
|
if (typeof attributeName == 'object') {
|
397
372
|
var key = Object.keys(attributeName)[0];
|
398
373
|
var value = attributeName[key];
|
399
|
-
|
374
|
+
|
375
|
+
if (typeof value == 'function') {
|
376
|
+
result[key] = value();
|
377
|
+
} else {
|
378
|
+
result[key] = model.get(value);
|
379
|
+
}
|
400
380
|
} else {
|
401
381
|
result[attributeName] = model.get(attributeName);
|
402
382
|
}
|
@@ -410,225 +390,7 @@ function getAttributes(model, _ref3) {
|
|
410
390
|
return result;
|
411
391
|
}
|
412
392
|
|
413
|
-
function getItems(state, collectionName) {
|
414
|
-
if (state[collectionName]) {
|
415
|
-
var items = state[collectionName].items;
|
416
|
-
return state[collectionName].order.map(function (key) {
|
417
|
-
return items[key];
|
418
|
-
});
|
419
|
-
} else {
|
420
|
-
return [];
|
421
|
-
}
|
422
|
-
}
|
423
|
-
function getItem(state, collectionName, key) {
|
424
|
-
if (state[collectionName]) {
|
425
|
-
return state[collectionName].items[key];
|
426
|
-
}
|
427
|
-
}
|
428
|
-
|
429
393
|
var Context = React.createContext();
|
430
|
-
function EntryStateProvider(_ref) {
|
431
|
-
var seed = _ref.seed,
|
432
|
-
children = _ref.children;
|
433
|
-
|
434
|
-
var _useCollections = useCollections(seed.collections, {
|
435
|
-
keyAttribute: 'permaId'
|
436
|
-
}),
|
437
|
-
_useCollections2 = _slicedToArray(_useCollections, 2),
|
438
|
-
collections = _useCollections2[0],
|
439
|
-
dispatch = _useCollections2[1];
|
440
|
-
|
441
|
-
var value = useMemo(function () {
|
442
|
-
return {
|
443
|
-
entryState: {
|
444
|
-
collections: collections,
|
445
|
-
config: seed.config
|
446
|
-
},
|
447
|
-
dispatch: dispatch
|
448
|
-
};
|
449
|
-
}, [collections, dispatch, seed]);
|
450
|
-
return React.createElement(Context.Provider, {
|
451
|
-
value: value
|
452
|
-
}, children);
|
453
|
-
}
|
454
|
-
function useEntryState() {
|
455
|
-
var value = useContext(Context);
|
456
|
-
return value.entryState;
|
457
|
-
}
|
458
|
-
function useEntryStateDispatch() {
|
459
|
-
var value = useContext(Context);
|
460
|
-
return value.dispatch;
|
461
|
-
}
|
462
|
-
|
463
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
464
|
-
if (source == null) return {};
|
465
|
-
var target = {};
|
466
|
-
var sourceKeys = Object.keys(source);
|
467
|
-
var key, i;
|
468
|
-
|
469
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
470
|
-
key = sourceKeys[i];
|
471
|
-
if (excluded.indexOf(key) >= 0) continue;
|
472
|
-
target[key] = source[key];
|
473
|
-
}
|
474
|
-
|
475
|
-
return target;
|
476
|
-
}
|
477
|
-
|
478
|
-
function _objectWithoutProperties(source, excluded) {
|
479
|
-
if (source == null) return {};
|
480
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
481
|
-
var key, i;
|
482
|
-
|
483
|
-
if (Object.getOwnPropertySymbols) {
|
484
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
485
|
-
|
486
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
487
|
-
key = sourceSymbolKeys[i];
|
488
|
-
if (excluded.indexOf(key) >= 0) continue;
|
489
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
490
|
-
target[key] = source[key];
|
491
|
-
}
|
492
|
-
}
|
493
|
-
|
494
|
-
return target;
|
495
|
-
}
|
496
|
-
|
497
|
-
function ownKeys$3(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; }
|
498
|
-
|
499
|
-
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
500
|
-
/**
|
501
|
-
* Returns a nested data structure representing the content elements
|
502
|
-
* of section.
|
503
|
-
*
|
504
|
-
* @param {Object} options
|
505
|
-
* @param {number} options.sectionPermaId
|
506
|
-
*
|
507
|
-
* @example
|
508
|
-
*
|
509
|
-
* const section = useSectionStructure({sectionPermaId: 4});
|
510
|
-
* section // =>
|
511
|
-
* {
|
512
|
-
* permaId: 4,
|
513
|
-
* transition: 'scroll',
|
514
|
-
* foreground: [
|
515
|
-
* {
|
516
|
-
* type: 'heading',
|
517
|
-
* props: {
|
518
|
-
* children: 'Heading'
|
519
|
-
* }
|
520
|
-
* },
|
521
|
-
* {
|
522
|
-
* type: 'textBlock',
|
523
|
-
* props: {
|
524
|
-
* children: 'Some text'
|
525
|
-
* }
|
526
|
-
* }
|
527
|
-
* ]
|
528
|
-
* }
|
529
|
-
*/
|
530
|
-
|
531
|
-
function useSectionStructure(_ref) {
|
532
|
-
var sectionPermaId = _ref.sectionPermaId;
|
533
|
-
var entryState = useEntryState();
|
534
|
-
var section = getItem(entryState.collections, 'sections', sectionPermaId);
|
535
|
-
return sectionStructure(entryState.collections, section);
|
536
|
-
}
|
537
|
-
|
538
|
-
function sectionStructure(collections, section) {
|
539
|
-
return section && _objectSpread$3({
|
540
|
-
permaId: section.permaId
|
541
|
-
}, section.configuration, {
|
542
|
-
foreground: getItems(collections, 'contentElements').filter(function (item) {
|
543
|
-
return item.sectionId === section.id;
|
544
|
-
}).map(function (item) {
|
545
|
-
return {
|
546
|
-
type: item.typeName,
|
547
|
-
position: item.configuration.position,
|
548
|
-
props: item.configuration
|
549
|
-
};
|
550
|
-
})
|
551
|
-
});
|
552
|
-
}
|
553
|
-
|
554
|
-
function ownKeys$4(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; }
|
555
|
-
|
556
|
-
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
557
|
-
|
558
|
-
function expandUrls(collectionName, file, urlTemplates) {
|
559
|
-
if (!file) {
|
560
|
-
return null;
|
561
|
-
}
|
562
|
-
|
563
|
-
if (!urlTemplates[collectionName]) {
|
564
|
-
throw new Error("No file url templates found for ".concat(collectionName));
|
565
|
-
}
|
566
|
-
|
567
|
-
var variants = file.variants || Object.keys(urlTemplates[collectionName]);
|
568
|
-
var urls = variants.reduce(function (result, variant) {
|
569
|
-
var url = getFileUrl(collectionName, file, variant, urlTemplates);
|
570
|
-
|
571
|
-
if (url) {
|
572
|
-
result[variant] = url;
|
573
|
-
}
|
574
|
-
|
575
|
-
return result;
|
576
|
-
}, {});
|
577
|
-
return _objectSpread$4({
|
578
|
-
urls: urls
|
579
|
-
}, file);
|
580
|
-
}
|
581
|
-
|
582
|
-
function getFileUrl(collectionName, file, quality, urlTemplates) {
|
583
|
-
var templates = urlTemplates[collectionName];
|
584
|
-
var template = templates[quality];
|
585
|
-
|
586
|
-
if (template) {
|
587
|
-
return template.replace(':id_partition', idPartition(file.id)).replace(':basename', file.basename);
|
588
|
-
}
|
589
|
-
}
|
590
|
-
|
591
|
-
function idPartition(id) {
|
592
|
-
return partition(pad(id, 9));
|
593
|
-
}
|
594
|
-
|
595
|
-
function partition(string, separator) {
|
596
|
-
return string.replace(/./g, function (c, i, a) {
|
597
|
-
return i && (a.length - i) % 3 === 0 ? '/' + c : c;
|
598
|
-
});
|
599
|
-
}
|
600
|
-
|
601
|
-
function pad(string, size) {
|
602
|
-
return (Array(size).fill(0).join('') + string).slice(-size);
|
603
|
-
}
|
604
|
-
|
605
|
-
/**
|
606
|
-
* Look up a file by its collection and perma id.
|
607
|
-
*
|
608
|
-
* @param {Object} options
|
609
|
-
* @param {String} options.collectionName - Collection name of file type to look for (in camel case).
|
610
|
-
* @param {String} options.permaId - Perma id of file look up
|
611
|
-
*
|
612
|
-
* @example
|
613
|
-
* const imageFile = useFile({collectionName: 'imageFiles', permaId: 5});
|
614
|
-
* imageFile // =>
|
615
|
-
* {
|
616
|
-
* id: 102,
|
617
|
-
* permaId: 5,
|
618
|
-
* width: 1000,
|
619
|
-
* height: 500,
|
620
|
-
* urls: {
|
621
|
-
* large: 'https://...'
|
622
|
-
* },
|
623
|
-
* }
|
624
|
-
*/
|
625
|
-
|
626
|
-
function useFile(_ref) {
|
627
|
-
var collectionName = _ref.collectionName,
|
628
|
-
permaId = _ref.permaId;
|
629
|
-
var entryState = useEntryState();
|
630
|
-
return expandUrls(collectionName, getItem(entryState.collections, collectionName, permaId), entryState.config.fileUrlTemplates);
|
631
|
-
}
|
632
394
|
|
633
395
|
function watchCollections(entry, _ref) {
|
634
396
|
var dispatch = _ref.dispatch;
|
@@ -636,38 +398,45 @@ function watchCollections(entry, _ref) {
|
|
636
398
|
sections = entry.sections,
|
637
399
|
contentElements = entry.contentElements,
|
638
400
|
files = entry.files;
|
639
|
-
|
401
|
+
var teardownFns = [];
|
402
|
+
teardownFns.push(watchCollection(new Backbone.Collection([entry.metadata]), {
|
640
403
|
name: 'entries',
|
641
|
-
attributes: ['
|
404
|
+
attributes: ['locale', {
|
405
|
+
permaId: function permaId() {
|
406
|
+
return entry.id;
|
407
|
+
}
|
408
|
+
}, // Make sure key attribute is present
|
409
|
+
{
|
642
410
|
shareProviders: 'share_providers'
|
643
411
|
}, {
|
644
412
|
shareUrl: 'share_url'
|
645
413
|
}, 'credits'],
|
414
|
+
keyAttribute: 'permaId',
|
646
415
|
dispatch: dispatch
|
647
|
-
});
|
648
|
-
watchCollection(chapters, {
|
416
|
+
}));
|
417
|
+
teardownFns.push(watchCollection(chapters, {
|
649
418
|
name: 'chapters',
|
650
419
|
attributes: ['id', 'permaId'],
|
651
420
|
keyAttribute: 'permaId',
|
652
421
|
includeConfiguration: true,
|
653
422
|
dispatch: dispatch
|
654
|
-
});
|
655
|
-
watchCollection(sections, {
|
423
|
+
}));
|
424
|
+
teardownFns.push(watchCollection(sections, {
|
656
425
|
name: 'sections',
|
657
426
|
attributes: ['id', 'permaId', 'chapterId'],
|
658
427
|
keyAttribute: 'permaId',
|
659
428
|
includeConfiguration: true,
|
660
429
|
dispatch: dispatch
|
661
|
-
});
|
662
|
-
watchCollection(contentElements, {
|
430
|
+
}));
|
431
|
+
teardownFns.push(watchCollection(contentElements, {
|
663
432
|
name: 'contentElements',
|
664
433
|
attributes: ['id', 'permaId', 'typeName', 'sectionId'],
|
665
434
|
keyAttribute: 'permaId',
|
666
435
|
includeConfiguration: true,
|
667
436
|
dispatch: dispatch
|
668
|
-
});
|
437
|
+
}));
|
669
438
|
Object.keys(files).forEach(function (collectionName) {
|
670
|
-
watchCollection(files[collectionName], {
|
439
|
+
teardownFns.push(watchCollection(files[collectionName], {
|
671
440
|
name: camelize(collectionName),
|
672
441
|
attributes: ['id', {
|
673
442
|
permaId: 'perma_id'
|
@@ -675,8 +444,13 @@ function watchCollections(entry, _ref) {
|
|
675
444
|
keyAttribute: 'permaId',
|
676
445
|
includeConfiguration: true,
|
677
446
|
dispatch: dispatch
|
678
|
-
});
|
447
|
+
}));
|
679
448
|
});
|
449
|
+
return function () {
|
450
|
+
teardownFns.forEach(function (fn) {
|
451
|
+
return fn();
|
452
|
+
});
|
453
|
+
};
|
680
454
|
}
|
681
455
|
|
682
456
|
function camelize(snakeCase) {
|
@@ -685,96 +459,6 @@ function camelize(snakeCase) {
|
|
685
459
|
});
|
686
460
|
}
|
687
461
|
|
688
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
689
|
-
|
690
|
-
function createCommonjsModule(fn, module) {
|
691
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
692
|
-
}
|
693
|
-
|
694
|
-
var classnames = createCommonjsModule(function (module) {
|
695
|
-
/*!
|
696
|
-
Copyright (c) 2017 Jed Watson.
|
697
|
-
Licensed under the MIT License (MIT), see
|
698
|
-
http://jedwatson.github.io/classnames
|
699
|
-
*/
|
700
|
-
/* global define */
|
701
|
-
|
702
|
-
(function () {
|
703
|
-
|
704
|
-
var hasOwn = {}.hasOwnProperty;
|
705
|
-
|
706
|
-
function classNames () {
|
707
|
-
var classes = [];
|
708
|
-
|
709
|
-
for (var i = 0; i < arguments.length; i++) {
|
710
|
-
var arg = arguments[i];
|
711
|
-
if (!arg) continue;
|
712
|
-
|
713
|
-
var argType = typeof arg;
|
714
|
-
|
715
|
-
if (argType === 'string' || argType === 'number') {
|
716
|
-
classes.push(arg);
|
717
|
-
} else if (Array.isArray(arg) && arg.length) {
|
718
|
-
var inner = classNames.apply(null, arg);
|
719
|
-
if (inner) {
|
720
|
-
classes.push(inner);
|
721
|
-
}
|
722
|
-
} else if (argType === 'object') {
|
723
|
-
for (var key in arg) {
|
724
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
725
|
-
classes.push(key);
|
726
|
-
}
|
727
|
-
}
|
728
|
-
}
|
729
|
-
}
|
730
|
-
|
731
|
-
return classes.join(' ');
|
732
|
-
}
|
733
|
-
|
734
|
-
if ( module.exports) {
|
735
|
-
classNames.default = classNames;
|
736
|
-
module.exports = classNames;
|
737
|
-
} else {
|
738
|
-
window.classNames = classNames;
|
739
|
-
}
|
740
|
-
}());
|
741
|
-
});
|
742
|
-
|
743
|
-
function useOnScreen(ref) {
|
744
|
-
var rootMargin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0px';
|
745
|
-
var cb = arguments.length > 2 ? arguments[2] : undefined;
|
746
|
-
|
747
|
-
var _useState = useState(false),
|
748
|
-
_useState2 = _slicedToArray(_useState, 2),
|
749
|
-
isIntersecting = _useState2[0],
|
750
|
-
setIntersecting = _useState2[1];
|
751
|
-
|
752
|
-
useEffect(function () {
|
753
|
-
var current = ref.current;
|
754
|
-
var observer = new IntersectionObserver(function (_ref) {
|
755
|
-
var _ref2 = _slicedToArray(_ref, 1),
|
756
|
-
entry = _ref2[0];
|
757
|
-
|
758
|
-
setIntersecting(entry.isIntersecting);
|
759
|
-
|
760
|
-
if (entry.isIntersecting && cb) {
|
761
|
-
cb();
|
762
|
-
}
|
763
|
-
}, {
|
764
|
-
rootMargin: rootMargin
|
765
|
-
});
|
766
|
-
|
767
|
-
if (ref.current) {
|
768
|
-
observer.observe(current);
|
769
|
-
}
|
770
|
-
|
771
|
-
return function () {
|
772
|
-
observer.unobserve(current);
|
773
|
-
};
|
774
|
-
}, [ref, rootMargin, cb]);
|
775
|
-
return isIntersecting;
|
776
|
-
}
|
777
|
-
|
778
462
|
function styleInject(css, ref) {
|
779
463
|
if ( ref === void 0 ) ref = {};
|
780
464
|
var insertAt = ref.insertAt;
|
@@ -802,2106 +486,120 @@ function styleInject(css, ref) {
|
|
802
486
|
}
|
803
487
|
}
|
804
488
|
|
805
|
-
var css = ".
|
806
|
-
var styles = {"root":"
|
489
|
+
var css = ".icons-module_icon__16IVx::before {\n font-family: \"entypo\";\n}.icons-module_arrowsCcw__3_nrJ,\n.icons-module_attention__1sssG,\n.icons-module_plusCircled__20FlJ,\n.icons-module_rightOpen__9vsOG,\n.icons-module_trash__DH1EH {\n}.icons-module_arrowsCcw__3_nrJ::before {\n content: \"\\1F504\";\n}.icons-module_attention__1sssG::before {\n content: \"\\26A0\";\n}.icons-module_plusCircled__20FlJ::before {\n content: \"\\2795\";\n}.icons-module_rightOpen__9vsOG::before {\n content: \"\\E75E\"\n}.icons-module_trash__DH1EH::before {\n content: \"\\E729\";\n}@keyframes animations-module_blink__32C5j {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.3;\n }\n 100% {\n opacity: 1;\n }\n}.animations-module_blink__32C5j {\n animation: animations-module_blink__32C5j 1.5s ease infinite;\n}.outline-module_indicator__2dw_X {\n display: none;\n position: absolute;\n right: 14px;\n top: 7px;\n width: 30px;\n height: 30px;\n font-size: 19px;\n color: #888;\n}.outline-module_creatingIndicator__3O7Rw {\n}.outline-module_destroyingIndicator__2-mKh {\n}.outline-module_failedIndicator__2QK1F {\n color: #d00;\n}\n\n.SectionItemView-module_root__1Pp0d {\n position: relative;\n border: solid 3px transparent;\n padding: 3px 3px 0 3px;\n margin-bottom: 4px;\n max-width: 270px;\n text-align: right;\n background-color: #eee;\n}\n\n.SectionItemView-module_active__1tLN5 {\n border: solid 3px #1c86fe;\n}\n\n.SectionItemView-module_thumbnailContainer__1Xe7C {\n position: relative;\n}\n\n.SectionItemView-module_thumbnail__1ecBT {\n border: solid 1px #888;\n padding-top: 50%;\n position: relative;\n text-align: initial;\n}\n\n.SectionItemView-module_clickMask__2JYEH {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n cursor: pointer;\n}\n\n.SectionItemView-module_editLink__2mHqk {\n display: inline-block;\n position: relative;\n width: 30px;\n height: 25px;\n}\n\n.SectionItemView-module_editLink__2mHqk::before {\n font-family: 'entypo';\n content: \"\\270E\";\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n color: #555;\n font-size: 15px;\n}\n\n.SectionItemView-module_creating__3Pjx9 .SectionItemView-module_creatingIndicator__1GnKq { display: block; }\n.SectionItemView-module_destroying__1m53s .SectionItemView-module_destroyingIndicator__HtKWF { display: block; }\n.SectionItemView-module_failed__1CR2R .SectionItemView-module_failedIndicator__1HVHn { display: block; }\n\n.SectionItemView-module_creatingIndicator__1GnKq { }\n.SectionItemView-module_destroyingIndicator__HtKWF { }\n.SectionItemView-module_failedIndicator__1HVHn { }\n";
|
490
|
+
var styles = {"selectionColor":"#1c86fe","selectionWidth":"3px","root":"SectionItemView-module_root__1Pp0d","active":"SectionItemView-module_active__1tLN5","thumbnailContainer":"SectionItemView-module_thumbnailContainer__1Xe7C","thumbnail":"SectionItemView-module_thumbnail__1ecBT","clickMask":"SectionItemView-module_clickMask__2JYEH","editLink":"SectionItemView-module_editLink__2mHqk","creating":"SectionItemView-module_creating__3Pjx9","creatingIndicator":"SectionItemView-module_creatingIndicator__1GnKq outline-module_creatingIndicator__3O7Rw outline-module_indicator__2dw_X icons-module_arrowsCcw__3_nrJ icons-module_icon__16IVx animations-module_blink__32C5j","destroying":"SectionItemView-module_destroying__1m53s","destroyingIndicator":"SectionItemView-module_destroyingIndicator__HtKWF outline-module_destroyingIndicator__2-mKh outline-module_indicator__2dw_X icons-module_trash__DH1EH icons-module_icon__16IVx animations-module_blink__32C5j","failed":"SectionItemView-module_failed__1CR2R","failedIndicator":"SectionItemView-module_failedIndicator__1HVHn outline-module_failedIndicator__2QK1F outline-module_indicator__2dw_X icons-module_attention__1sssG icons-module_icon__16IVx"};
|
807
491
|
styleInject(css);
|
808
492
|
|
809
|
-
var
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
493
|
+
var _events;
|
494
|
+
var SectionItemView = Marionette.ItemView.extend({
|
495
|
+
tagName: 'li',
|
496
|
+
className: styles.root,
|
497
|
+
mixins: [modelLifecycleTrackingView({
|
498
|
+
classNames: styles
|
499
|
+
})],
|
500
|
+
template: function template(data) {
|
501
|
+
return "\n <div class=\"".concat(styles.thumbnailContainer, "\">\n <div class=\"").concat(styles.thumbnail, "\"></div>\n <div class=\"").concat(styles.clickMask, "\"></div>\n </div>\n <span class=\"").concat(styles.creatingIndicator, "\" />\n <span class=\"").concat(styles.destroyingIndicator, "\" />\n <span class=\"").concat(styles.failedIndicator, "\"\n title=\"").concat(I18n.t('pageflow_scrolled.editor.section_item.save_error'), "\" />\n <a href=\"\" class=\"").concat(styles.editLink, "\" title=\"").concat(I18n.t('pageflow_scrolled.editor.section_item.edit'), "\"></a>\n ");
|
502
|
+
},
|
503
|
+
ui: cssModulesUtils.ui(styles, 'thumbnail'),
|
504
|
+
events: (_events = {}, _defineProperty(_events, "click .".concat(styles.clickMask), function click() {
|
505
|
+
this.options.entry.trigger('scrollToSection', this.model);
|
506
|
+
}), _defineProperty(_events, "click .".concat(styles.editLink), function click() {
|
507
|
+
if (!this.model.isNew() && !this.model.isDestroying()) {
|
508
|
+
this.options.entry.trigger('scrollToSection', this.model);
|
509
|
+
editor$1.navigate("/scrolled/sections/".concat(this.model.id), {
|
510
|
+
trigger: true
|
511
|
+
});
|
512
|
+
}
|
815
513
|
|
816
|
-
|
817
|
-
|
818
|
-
|
514
|
+
return false;
|
515
|
+
}), _events),
|
516
|
+
modelEvents: {
|
517
|
+
'change:id': 'renderThumbnail'
|
518
|
+
},
|
519
|
+
initialize: function initialize() {
|
520
|
+
var _this = this;
|
819
521
|
|
820
|
-
|
821
|
-
|
822
|
-
*
|
823
|
-
* @param {Object} props
|
824
|
-
* @param {number} props.id - Perma id of the image file.
|
825
|
-
*/
|
522
|
+
this.listenTo(this.options.entry, 'change:currentSectionIndex', function () {
|
523
|
+
var active = _this.options.entry.sections.indexOf(_this.model) === _this.options.entry.get('currentSectionIndex');
|
826
524
|
|
827
|
-
|
828
|
-
var image = useFile({
|
829
|
-
collectionName: 'imageFiles',
|
830
|
-
permaId: props.id
|
831
|
-
});
|
525
|
+
_this.$el.toggleClass(styles.active, active);
|
832
526
|
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
role: "img",
|
839
|
-
style: {
|
840
|
-
backgroundImage: "url(".concat(image.urls.large, ")"),
|
841
|
-
backgroundPosition: "".concat(focusX, "% ").concat(focusY, "%")
|
527
|
+
if (active) {
|
528
|
+
_this.$el[0].scrollIntoView({
|
529
|
+
block: 'nearest',
|
530
|
+
behavior: 'smooth'
|
531
|
+
});
|
842
532
|
}
|
843
533
|
});
|
844
|
-
}
|
845
|
-
|
846
|
-
|
847
|
-
}
|
848
|
-
|
849
|
-
var ScrollToSectionContext = React.createContext(function () {});
|
534
|
+
},
|
535
|
+
onRender: function onRender() {
|
536
|
+
var _this2 = this;
|
850
537
|
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
538
|
+
this.timeout = setTimeout(function () {
|
539
|
+
_this2.renderThumbnail();
|
540
|
+
}, 100);
|
541
|
+
},
|
542
|
+
onClose: function onClose() {
|
543
|
+
clearTimeout(this.timeout);
|
544
|
+
ReactDOM.unmountComponentAtNode(this.ui.thumbnail[0]);
|
545
|
+
},
|
546
|
+
renderThumbnail: function renderThumbnail() {
|
547
|
+
var _this3 = this;
|
548
|
+
|
549
|
+
if (!this.model.isNew()) {
|
550
|
+
ReactDOM.render(React.createElement(SectionThumbnail, {
|
551
|
+
sectionPermaId: this.model.get('permaId'),
|
552
|
+
seed: this.options.entry.scrolledSeed,
|
553
|
+
subscribe: function subscribe(dispatch) {
|
554
|
+
return watchCollections(_this3.options.entry, {
|
555
|
+
dispatch: dispatch
|
556
|
+
});
|
557
|
+
}
|
558
|
+
}), this.ui.thumbnail[0]);
|
559
|
+
}
|
560
|
+
}
|
855
561
|
});
|
856
562
|
|
857
|
-
var css$
|
858
|
-
var styles$
|
859
|
-
styleInject(css$
|
563
|
+
var css$1 = ".icons-module_icon__16IVx::before {\n font-family: \"entypo\";\n}.icons-module_arrowsCcw__3_nrJ,\n.icons-module_attention__1sssG,\n.icons-module_plusCircled__20FlJ,\n.icons-module_rightOpen__9vsOG,\n.icons-module_trash__DH1EH {\n}.icons-module_arrowsCcw__3_nrJ::before {\n content: \"\\1F504\";\n}.icons-module_attention__1sssG::before {\n content: \"\\26A0\";\n}.icons-module_plusCircled__20FlJ::before {\n content: \"\\2795\";\n}.icons-module_rightOpen__9vsOG::before {\n content: \"\\E75E\"\n}.icons-module_trash__DH1EH::before {\n content: \"\\E729\";\n}@keyframes animations-module_blink__32C5j {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.3;\n }\n 100% {\n opacity: 1;\n }\n}.animations-module_blink__32C5j {\n animation: animations-module_blink__32C5j 1.5s ease infinite;\n}.outline-module_indicator__2dw_X {\n display: none;\n position: absolute;\n right: 14px;\n top: 7px;\n width: 30px;\n height: 30px;\n font-size: 19px;\n color: #888;\n}.outline-module_creatingIndicator__3O7Rw {\n}.outline-module_destroyingIndicator__2-mKh {\n}.outline-module_failedIndicator__2QK1F {\n color: #d00;\n}.buttons-module_iconButton__3ZSFV {\n /* see app/assets/stylesheets/pageflow/editor/composable.scss */\n}.buttons-module_addButton__2pN-g {\n}\n\n.ChapterItemView-module_root__19GIF {\n background-color: #fff;\n margin-bottom: 10px;\n padding: 0 10px 10px 10px;\n}\n\n.ChapterItemView-module_link__2dj_z {\n display: block;\n position: relative;\n margin: 0 -10px 0 -10px;\n padding: 10px 10px 10px 30px;\n background-color: #efefef;\n}\n\n.ChapterItemView-module_link__2dj_z::before {\n position: absolute;\n right: 7px;\n top: 7px;\n font-size: 19px;\n color: #888;\n}\n\n.ChapterItemView-module_number__1GjyC {\n font-weight: bold;\n}\n\n.ChapterItemView-module_title__3jVXE {}\n\n.ChapterItemView-module_sections__3zg2a {\n margin: 10px 0 10px 0;\n min-height: 20px;\n}\n\n.ChapterItemView-module_creating__c1q2b .ChapterItemView-module_creatingIndicator__2zOEN { display: block; }\n.ChapterItemView-module_destroying__2PP1l .ChapterItemView-module_destroyingIndicator__2YZaB { display: block; }\n.ChapterItemView-module_failed__2MtQW .ChapterItemView-module_failedIndicator__2s6Xk { display: block; }\n\n\n.ChapterItemView-module_creatingIndicator__2zOEN { }\n.ChapterItemView-module_destroyingIndicator__2YZaB { }\n.ChapterItemView-module_failedIndicator__2s6Xk { }\n\n.ChapterItemView-module_addSection__3XQvI {\n}\n";
|
564
|
+
var styles$1 = {"indicatorIconColor":"#888","root":"ChapterItemView-module_root__19GIF","link":"ChapterItemView-module_link__2dj_z icons-module_rightOpen__9vsOG icons-module_icon__16IVx","number":"ChapterItemView-module_number__1GjyC","title":"ChapterItemView-module_title__3jVXE","sections":"ChapterItemView-module_sections__3zg2a","creating":"ChapterItemView-module_creating__c1q2b","creatingIndicator":"ChapterItemView-module_creatingIndicator__2zOEN outline-module_creatingIndicator__3O7Rw outline-module_indicator__2dw_X icons-module_arrowsCcw__3_nrJ icons-module_icon__16IVx animations-module_blink__32C5j","destroying":"ChapterItemView-module_destroying__2PP1l","destroyingIndicator":"ChapterItemView-module_destroyingIndicator__2YZaB outline-module_destroyingIndicator__2-mKh outline-module_indicator__2dw_X icons-module_trash__DH1EH icons-module_icon__16IVx animations-module_blink__32C5j","failed":"ChapterItemView-module_failed__2MtQW","failedIndicator":"ChapterItemView-module_failedIndicator__2s6Xk outline-module_failedIndicator__2QK1F outline-module_indicator__2dw_X icons-module_attention__1sssG icons-module_icon__16IVx","addSection":"ChapterItemView-module_addSection__3XQvI buttons-module_addButton__2pN-g buttons-module_iconButton__3ZSFV icon_button icons-module_plusCircled__20FlJ icons-module_icon__16IVx"};
|
565
|
+
styleInject(css$1);
|
860
566
|
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
videoKaterchen: videoKaterchen,
|
881
|
-
videoGarzweilerLoop1: videoGarzweilerLoop1,
|
882
|
-
videoGarzweilerLoop2: videoGarzweilerLoop2,
|
883
|
-
videoGarzweilerDrohne: videoGarzweilerDrohne,
|
884
|
-
videoInselInterviewToni: videoInselInterviewToni
|
885
|
-
}[props.id];
|
886
|
-
var posterUrl = {
|
887
|
-
poster_videoBoatSunset: poster_videoBoatSunset,
|
888
|
-
poster_videoBoatDark: poster_videoBoatDark,
|
889
|
-
poster_videoKaterchen: poster_videoKaterchen,
|
890
|
-
poster_videoGarzweilerLoop1: poster_videoGarzweilerLoop1,
|
891
|
-
poster_videoGarzweilerLoop2: poster_videoGarzweilerLoop2,
|
892
|
-
poster_videoGarzweilerDrohne: poster_videoGarzweilerDrohne,
|
893
|
-
poster_videoInselInterviewToni: poster_videoInselInterviewToni
|
894
|
-
}['poster_' + props.id];
|
895
|
-
var videoRef = useRef();
|
896
|
-
var state = props.state;
|
897
|
-
var mutedSettings = useContext(MutedContext);
|
898
|
-
var mediaOff = mutedSettings.mediaOff;
|
899
|
-
useEffect(function () {
|
900
|
-
var video = videoRef.current;
|
901
|
-
|
902
|
-
if (video && !mediaOff) {
|
903
|
-
if (state === 'active') {
|
904
|
-
if (video.readyState > 0) {
|
905
|
-
video.play();
|
906
|
-
} else {
|
907
|
-
video.addEventListener('loadedmetadata', play);
|
908
|
-
return function () {
|
909
|
-
return video.removeEventListener('loadedmetadata', play);
|
910
|
-
};
|
911
|
-
}
|
912
|
-
} else {
|
913
|
-
video.pause();
|
567
|
+
var ChapterItemView = Marionette.Layout.extend({
|
568
|
+
tagName: 'li',
|
569
|
+
className: styles$1.root,
|
570
|
+
mixins: [modelLifecycleTrackingView({
|
571
|
+
classNames: styles$1
|
572
|
+
})],
|
573
|
+
template: function template() {
|
574
|
+
return "\n <a class=\"".concat(styles$1.link, "\" href=\"\">\n <span class=\"").concat(styles$1.number, "\"></span>\n <span class=\"").concat(styles$1.title, "\"></span>\n <span class=\"").concat(styles$1.creatingIndicator, "\" />\n <span class=\"").concat(styles$1.destroyingIndicator, "\" />\n <span class=\"").concat(styles$1.failedIndicator, "\"\n title=\"").concat(I18n.t('pageflow_scrolled.editor.chapter_item.save_error'), "\" />\n </a>\n\n <ul class=\"").concat(styles$1.sections, "\"></ul>\n\n <a href=\"\" class=\"").concat(styles$1.addSection, "\">").concat(I18n.t('pageflow_scrolled.editor.chapter_item.add_section'), "</a>\n ");
|
575
|
+
},
|
576
|
+
ui: cssModulesUtils.ui(styles$1, 'title', 'number', 'sections'),
|
577
|
+
events: cssModulesUtils.events(styles$1, {
|
578
|
+
'click addSection': function clickAddSection() {
|
579
|
+
this.model.addSection();
|
580
|
+
},
|
581
|
+
'click link': function clickLink() {
|
582
|
+
if (!this.model.isNew() && !this.model.isDestroying()) {
|
583
|
+
editor$1.navigate('/scrolled/chapters/' + this.model.get('id'), {
|
584
|
+
trigger: true
|
585
|
+
});
|
914
586
|
}
|
915
|
-
}
|
916
587
|
|
917
|
-
|
918
|
-
video.play();
|
588
|
+
return false;
|
919
589
|
}
|
920
|
-
},
|
921
|
-
|
922
|
-
|
923
|
-
},
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
return props.nextSectionOnEnd && scrollToSection('next');
|
590
|
+
}),
|
591
|
+
modelEvents: {
|
592
|
+
change: 'update'
|
593
|
+
},
|
594
|
+
onRender: function onRender() {
|
595
|
+
this.subview(new SortableCollectionView({
|
596
|
+
el: this.ui.sections,
|
597
|
+
collection: this.model.sections,
|
598
|
+
itemViewConstructor: SectionItemView,
|
599
|
+
itemViewOptions: {
|
600
|
+
entry: this.options.entry
|
932
601
|
},
|
933
|
-
|
934
|
-
muted: mutedSettings.muted,
|
935
|
-
poster: posterUrl
|
936
|
-
});
|
937
|
-
}));
|
938
|
-
}
|
939
|
-
Video.defaultProps = {
|
940
|
-
interactive: false,
|
941
|
-
controls: false
|
942
|
-
};
|
943
|
-
|
944
|
-
var css$3 = ".FillColor-module_FillColor__S1uEG {\n width: 100%;\n height: 100vh;\n}\n";
|
945
|
-
var styles$3 = {"FillColor":"FillColor-module_FillColor__S1uEG"};
|
946
|
-
styleInject(css$3);
|
947
|
-
|
948
|
-
function FillColor(props) {
|
949
|
-
return React.createElement("div", {
|
950
|
-
className: styles$3.FillColor,
|
951
|
-
style: {
|
952
|
-
backgroundColor: props.color
|
953
|
-
}
|
954
|
-
});
|
955
|
-
}
|
956
|
-
|
957
|
-
var css$4 = ".MotifArea-module_root__1_ACd {\n position: absolute;\n background: hsla(0, 0%, 100%, 0.2);\n z-index: 2;\n opacity: 0;\n transition: opacity 0.2s ease;\n}\n\n.MotifArea-module_active__1q4z2 {\n opacity: 1;\n}\n\n.MotifArea-module_corner__3hB5t {\n position: absolute;\n width: 10px;\n height: 10px;\n}\n\n.MotifArea-module_topLeft__3vHHi {\n border-top: solid 2px #fff;\n border-left: solid 2px #fff;\n}\n\n.MotifArea-module_topRight__2gNmC {\n right: 0;\n border-top: solid 2px #fff;\n border-right: solid 2px #fff;\n}\n\n.MotifArea-module_bottomLeft__2qEqb {\n bottom: 0;\n border-bottom: solid 2px #fff;\n border-left: solid 2px #fff;\n}\n\n.MotifArea-module_bottomRight__3OjTb {\n right: 0;\n bottom: 0;\n border-bottom: solid 2px #fff;\n border-right: solid 2px #fff;\n}\n";
|
958
|
-
var styles$4 = {"root":"MotifArea-module_root__1_ACd","active":"MotifArea-module_active__1q4z2","corner":"MotifArea-module_corner__3hB5t","topLeft":"MotifArea-module_topLeft__3vHHi MotifArea-module_corner__3hB5t","topRight":"MotifArea-module_topRight__2gNmC MotifArea-module_corner__3hB5t","bottomLeft":"MotifArea-module_bottomLeft__2qEqb MotifArea-module_corner__3hB5t","bottomRight":"MotifArea-module_bottomRight__3OjTb MotifArea-module_corner__3hB5t"};
|
959
|
-
styleInject(css$4);
|
960
|
-
|
961
|
-
var MotifArea = React.forwardRef(function MotifArea(props, ref) {
|
962
|
-
var image = useFile({
|
963
|
-
collectionName: 'imageFiles',
|
964
|
-
permaId: props.imageId
|
965
|
-
});
|
966
|
-
|
967
|
-
if (!image) {
|
968
|
-
return null;
|
969
|
-
}
|
970
|
-
|
971
|
-
return React.createElement("div", {
|
972
|
-
ref: ref,
|
973
|
-
className: classnames(styles$4.root, _defineProperty({}, styles$4.active, props.active)),
|
974
|
-
style: position(props, image),
|
975
|
-
onMouseEnter: props.onMouseEnter,
|
976
|
-
onMouseLeave: props.onMouseLeave
|
977
|
-
}, React.createElement("div", {
|
978
|
-
className: styles$4.topLeft
|
979
|
-
}), React.createElement("div", {
|
980
|
-
className: styles$4.topRight
|
981
|
-
}), React.createElement("div", {
|
982
|
-
className: styles$4.bottomLeft
|
983
|
-
}), React.createElement("div", {
|
984
|
-
className: styles$4.bottomRight
|
985
|
-
}));
|
986
|
-
});
|
987
|
-
|
988
|
-
function position(props, image) {
|
989
|
-
var originalRatio = image.width / image.height;
|
990
|
-
var containerRatio = props.containerWidth / props.containerHeight;
|
991
|
-
var scale = containerRatio > originalRatio ? props.containerWidth / image.width : props.containerHeight / image.height;
|
992
|
-
var contentWidth = image.width * scale;
|
993
|
-
var contentHeight = image.height * scale;
|
994
|
-
var focusX = image.configuration.focusX === undefined ? 50 : image.configuration.focusX;
|
995
|
-
var focusY = image.configuration.focusY === undefined ? 50 : image.configuration.focusY;
|
996
|
-
var cropLeft = (contentWidth - props.containerWidth) * focusX / 100;
|
997
|
-
var cropTop = (contentHeight - props.containerHeight) * focusY / 100;
|
998
|
-
var motifArea = image.configuration.motifArea || {
|
999
|
-
top: 0,
|
1000
|
-
left: 0,
|
1001
|
-
width: 0,
|
1002
|
-
height: 0
|
1003
|
-
};
|
1004
|
-
return {
|
1005
|
-
top: contentHeight * motifArea.top / 100 - cropTop,
|
1006
|
-
left: contentWidth * motifArea.left / 100 - cropLeft,
|
1007
|
-
width: contentWidth * motifArea.width / 100,
|
1008
|
-
height: contentHeight * motifArea.height / 100
|
1009
|
-
};
|
1010
|
-
}
|
1011
|
-
|
1012
|
-
function getSize(el) {
|
1013
|
-
if (!el) {
|
1014
|
-
return {
|
1015
|
-
left: 0,
|
1016
|
-
top: 0,
|
1017
|
-
width: 0,
|
1018
|
-
height: 0
|
1019
|
-
};
|
1020
|
-
}
|
1021
|
-
|
1022
|
-
return {
|
1023
|
-
left: el.offsetLeft,
|
1024
|
-
top: el.offsetTop,
|
1025
|
-
width: el.offsetWidth,
|
1026
|
-
height: el.offsetHeight
|
1027
|
-
};
|
1028
|
-
}
|
1029
|
-
|
1030
|
-
function useDimension() {
|
1031
|
-
var _useState = useState(getSize(null)),
|
1032
|
-
_useState2 = _slicedToArray(_useState, 2),
|
1033
|
-
componentSize = _useState2[0],
|
1034
|
-
setComponentSize = _useState2[1];
|
1035
|
-
|
1036
|
-
var _useState3 = useState(null),
|
1037
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
1038
|
-
currentNode = _useState4[0],
|
1039
|
-
setCurrentNode = _useState4[1];
|
1040
|
-
|
1041
|
-
var measuredRef = useCallback(function (node) {
|
1042
|
-
setCurrentNode(node);
|
1043
|
-
setComponentSize(getSize(node));
|
1044
|
-
}, []);
|
1045
|
-
useEffect(function () {
|
1046
|
-
function handleResize() {
|
1047
|
-
setComponentSize(getSize(currentNode));
|
1048
|
-
}
|
1049
|
-
|
1050
|
-
if (!currentNode) {
|
1051
|
-
return;
|
1052
|
-
}
|
1053
|
-
|
1054
|
-
handleResize();
|
1055
|
-
window.addEventListener('resize', handleResize);
|
1056
|
-
return function () {
|
1057
|
-
window.removeEventListener('resize', handleResize);
|
1058
|
-
};
|
1059
|
-
}, [currentNode]);
|
1060
|
-
return [componentSize, measuredRef];
|
1061
|
-
}
|
1062
|
-
|
1063
|
-
var videos = {
|
1064
|
-
videoBoatSunset: {
|
1065
|
-
id: "videoBoatSunset",
|
1066
|
-
width: 960,
|
1067
|
-
height: 406,
|
1068
|
-
motiveArea: {
|
1069
|
-
top: 0,
|
1070
|
-
left: 0,
|
1071
|
-
width: 0,
|
1072
|
-
height: 0
|
1073
|
-
},
|
1074
|
-
focusX: 50,
|
1075
|
-
focusY: 50
|
1076
|
-
},
|
1077
|
-
videoBoatDark: {
|
1078
|
-
id: "videoBoatDark",
|
1079
|
-
width: 960,
|
1080
|
-
height: 406,
|
1081
|
-
motiveArea: {
|
1082
|
-
top: 0,
|
1083
|
-
left: 0,
|
1084
|
-
width: 0,
|
1085
|
-
height: 0
|
1086
|
-
},
|
1087
|
-
focusX: 50,
|
1088
|
-
focusY: 50
|
1089
|
-
},
|
1090
|
-
videoKaterchen: {
|
1091
|
-
id: "videoKaterchen",
|
1092
|
-
width: 1920,
|
1093
|
-
height: 1080,
|
1094
|
-
motiveArea: {
|
1095
|
-
top: 0,
|
1096
|
-
left: 0,
|
1097
|
-
width: 0,
|
1098
|
-
height: 0
|
1099
|
-
},
|
1100
|
-
focusX: 50,
|
1101
|
-
focusY: 50
|
1102
|
-
},
|
1103
|
-
videoGarzweilerLoop1: {
|
1104
|
-
id: "videoGarzweilerLoop1",
|
1105
|
-
width: 3840,
|
1106
|
-
height: 2160,
|
1107
|
-
motiveArea: {
|
1108
|
-
top: 0,
|
1109
|
-
left: 0,
|
1110
|
-
width: 1,
|
1111
|
-
height: 1
|
1112
|
-
},
|
1113
|
-
focusX: 50,
|
1114
|
-
focusY: 50
|
1115
|
-
},
|
1116
|
-
videoGarzweilerLoop2: {
|
1117
|
-
id: "videoGarzweilerLoop2",
|
1118
|
-
width: 1920,
|
1119
|
-
height: 1080,
|
1120
|
-
motiveArea: {
|
1121
|
-
top: 0,
|
1122
|
-
left: 0,
|
1123
|
-
width: 1,
|
1124
|
-
height: 1
|
1125
|
-
},
|
1126
|
-
focusX: 15,
|
1127
|
-
focusY: 20
|
1128
|
-
},
|
1129
|
-
videoGarzweilerDrohne: {
|
1130
|
-
id: "videoGarzweilerDrohne",
|
1131
|
-
width: 1920,
|
1132
|
-
height: 1080,
|
1133
|
-
motiveArea: {
|
1134
|
-
top: 0,
|
1135
|
-
left: 0,
|
1136
|
-
width: 0,
|
1137
|
-
height: 0
|
1138
|
-
}
|
1139
|
-
},
|
1140
|
-
videoInselInterviewToni: {
|
1141
|
-
id: "videoInselInterviewToni",
|
1142
|
-
width: 1920,
|
1143
|
-
height: 1080,
|
1144
|
-
motiveArea: {
|
1145
|
-
top: 0,
|
1146
|
-
left: 0,
|
1147
|
-
width: 0,
|
1148
|
-
height: 0
|
1149
|
-
}
|
1150
|
-
}
|
1151
|
-
};
|
1152
|
-
|
1153
|
-
var ResizeSensor = createCommonjsModule(function (module, exports) {
|
1154
|
-
// Copyright (c) 2013 Marc J. Schmidt
|
1155
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
1156
|
-
// of this software and associated documentation files (the "Software"), to deal
|
1157
|
-
// in the Software without restriction, including without limitation the rights
|
1158
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
1159
|
-
// copies of the Software, and to permit persons to whom the Software is
|
1160
|
-
// furnished to do so, subject to the following conditions:
|
1161
|
-
// The above copyright notice and this permission notice shall be included in
|
1162
|
-
// all copies or substantial portions of the Software.
|
1163
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
1164
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1165
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1166
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
1167
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
1168
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
1169
|
-
// THE SOFTWARE.
|
1170
|
-
// Originally based on version 1.2.1,
|
1171
|
-
// https://github.com/marcj/css-element-queries/tree/1.2.1
|
1172
|
-
// Some lines removed for compatibility.
|
1173
|
-
(function (root, factory) {
|
1174
|
-
{
|
1175
|
-
module.exports = factory();
|
1176
|
-
}
|
1177
|
-
})(typeof window !== 'undefined' ? window : commonjsGlobal, function () {
|
1178
|
-
// Make sure it does not throw in a SSR (Server Side Rendering) situation
|
1179
|
-
if (typeof window === "undefined") {
|
1180
|
-
return null;
|
1181
|
-
} // https://github.com/Semantic-Org/Semantic-UI/issues/3855
|
1182
|
-
// https://github.com/marcj/css-element-queries/issues/257
|
1183
|
-
|
1184
|
-
|
1185
|
-
var globalWindow = window; // Only used for the dirty checking, so the event callback count is limited to max 1 call per fps per sensor.
|
1186
|
-
// In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and
|
1187
|
-
// would generate too many unnecessary events.
|
1188
|
-
|
1189
|
-
var requestAnimationFrame = globalWindow.requestAnimationFrame || globalWindow.mozRequestAnimationFrame || globalWindow.webkitRequestAnimationFrame || function (fn) {
|
1190
|
-
return globalWindow.setTimeout(fn, 20);
|
1191
|
-
};
|
1192
|
-
|
1193
|
-
function forEachElement(elements, callback) {
|
1194
|
-
var elementsType = Object.prototype.toString.call(elements);
|
1195
|
-
var isCollectionTyped = '[object Array]' === elementsType || '[object NodeList]' === elementsType || '[object HTMLCollection]' === elementsType || '[object Object]' === elementsType;
|
1196
|
-
var i = 0,
|
1197
|
-
j = elements.length;
|
1198
|
-
|
1199
|
-
if (isCollectionTyped) {
|
1200
|
-
for (; i < j; i++) {
|
1201
|
-
callback(elements[i]);
|
1202
|
-
}
|
1203
|
-
} else {
|
1204
|
-
callback(elements);
|
1205
|
-
}
|
1206
|
-
}
|
1207
|
-
|
1208
|
-
function getElementSize(element) {
|
1209
|
-
if (!element.getBoundingClientRect) {
|
1210
|
-
return {
|
1211
|
-
width: element.offsetWidth,
|
1212
|
-
height: element.offsetHeight
|
1213
|
-
};
|
1214
|
-
}
|
1215
|
-
|
1216
|
-
var rect = element.getBoundingClientRect();
|
1217
|
-
return {
|
1218
|
-
width: Math.round(rect.width),
|
1219
|
-
height: Math.round(rect.height)
|
1220
|
-
};
|
1221
|
-
}
|
1222
|
-
|
1223
|
-
function setStyle(element, style) {
|
1224
|
-
Object.keys(style).forEach(function (key) {
|
1225
|
-
element.style[key] = style[key];
|
1226
|
-
});
|
1227
|
-
}
|
1228
|
-
|
1229
|
-
var ResizeSensor = function ResizeSensor(element, callback) {
|
1230
|
-
function EventQueue() {
|
1231
|
-
var q = [];
|
1232
|
-
|
1233
|
-
this.add = function (ev) {
|
1234
|
-
q.push(ev);
|
1235
|
-
};
|
1236
|
-
|
1237
|
-
var i, j;
|
1238
|
-
|
1239
|
-
this.call = function (sizeInfo) {
|
1240
|
-
for (i = 0, j = q.length; i < j; i++) {
|
1241
|
-
q[i].call(this, sizeInfo);
|
1242
|
-
}
|
1243
|
-
};
|
1244
|
-
|
1245
|
-
this.remove = function (ev) {
|
1246
|
-
var newQueue = [];
|
1247
|
-
|
1248
|
-
for (i = 0, j = q.length; i < j; i++) {
|
1249
|
-
if (q[i] !== ev) newQueue.push(q[i]);
|
1250
|
-
}
|
1251
|
-
|
1252
|
-
q = newQueue;
|
1253
|
-
};
|
1254
|
-
|
1255
|
-
this.length = function () {
|
1256
|
-
return q.length;
|
1257
|
-
};
|
1258
|
-
}
|
1259
|
-
|
1260
|
-
function attachResizeEvent(element, resized) {
|
1261
|
-
if (!element) return;
|
1262
|
-
|
1263
|
-
if (element.resizedAttached) {
|
1264
|
-
element.resizedAttached.add(resized);
|
1265
|
-
return;
|
1266
|
-
}
|
1267
|
-
|
1268
|
-
element.resizedAttached = new EventQueue();
|
1269
|
-
element.resizedAttached.add(resized);
|
1270
|
-
element.resizeSensor = document.createElement('div');
|
1271
|
-
element.resizeSensor.dir = 'ltr';
|
1272
|
-
element.resizeSensor.className = 'resize-sensor';
|
1273
|
-
var style = {
|
1274
|
-
pointerEvents: 'none',
|
1275
|
-
position: 'absolute',
|
1276
|
-
left: '0px',
|
1277
|
-
top: '0px',
|
1278
|
-
right: '0px',
|
1279
|
-
bottom: '0px',
|
1280
|
-
overflow: 'hidden',
|
1281
|
-
zIndex: '-1',
|
1282
|
-
visibility: 'hidden',
|
1283
|
-
maxWidth: '100%'
|
1284
|
-
};
|
1285
|
-
var styleChild = {
|
1286
|
-
position: 'absolute',
|
1287
|
-
left: '0px',
|
1288
|
-
top: '0px',
|
1289
|
-
transition: '0s'
|
1290
|
-
};
|
1291
|
-
setStyle(element.resizeSensor, style);
|
1292
|
-
var expand = document.createElement('div');
|
1293
|
-
expand.className = 'resize-sensor-expand';
|
1294
|
-
setStyle(expand, style);
|
1295
|
-
var expandChild = document.createElement('div');
|
1296
|
-
setStyle(expandChild, styleChild);
|
1297
|
-
expand.appendChild(expandChild);
|
1298
|
-
var shrink = document.createElement('div');
|
1299
|
-
shrink.className = 'resize-sensor-shrink';
|
1300
|
-
setStyle(shrink, style);
|
1301
|
-
var shrinkChild = document.createElement('div');
|
1302
|
-
setStyle(shrinkChild, styleChild);
|
1303
|
-
setStyle(shrinkChild, {
|
1304
|
-
width: '200%',
|
1305
|
-
height: '200%'
|
1306
|
-
});
|
1307
|
-
shrink.appendChild(shrinkChild);
|
1308
|
-
element.resizeSensor.appendChild(expand);
|
1309
|
-
element.resizeSensor.appendChild(shrink);
|
1310
|
-
element.appendChild(element.resizeSensor);
|
1311
|
-
var computedStyle = window.getComputedStyle(element);
|
1312
|
-
var position = computedStyle ? computedStyle.getPropertyValue('position') : null;
|
1313
|
-
|
1314
|
-
if ('absolute' !== position && 'relative' !== position && 'fixed' !== position) {
|
1315
|
-
element.style.position = 'relative';
|
1316
|
-
}
|
1317
|
-
|
1318
|
-
var dirty, rafId;
|
1319
|
-
var size = getElementSize(element);
|
1320
|
-
var lastWidth = 0;
|
1321
|
-
var lastHeight = 0;
|
1322
|
-
var initialHiddenCheck = true;
|
1323
|
-
var lastAnimationFrame = 0;
|
1324
|
-
|
1325
|
-
var resetExpandShrink = function resetExpandShrink() {
|
1326
|
-
var width = element.offsetWidth;
|
1327
|
-
var height = element.offsetHeight;
|
1328
|
-
expandChild.style.width = width + 10 + 'px';
|
1329
|
-
expandChild.style.height = height + 10 + 'px';
|
1330
|
-
expand.scrollLeft = width + 10;
|
1331
|
-
expand.scrollTop = height + 10;
|
1332
|
-
shrink.scrollLeft = width + 10;
|
1333
|
-
shrink.scrollTop = height + 10;
|
1334
|
-
};
|
1335
|
-
|
1336
|
-
var reset = function reset() {
|
1337
|
-
// Check if element is hidden
|
1338
|
-
if (initialHiddenCheck) {
|
1339
|
-
var invisible = element.offsetWidth === 0 && element.offsetHeight === 0;
|
1340
|
-
|
1341
|
-
if (invisible) {
|
1342
|
-
// Check in next frame
|
1343
|
-
if (!lastAnimationFrame) {
|
1344
|
-
lastAnimationFrame = requestAnimationFrame(function () {
|
1345
|
-
lastAnimationFrame = 0;
|
1346
|
-
reset();
|
1347
|
-
});
|
1348
|
-
}
|
1349
|
-
|
1350
|
-
return;
|
1351
|
-
} else {
|
1352
|
-
// Stop checking
|
1353
|
-
initialHiddenCheck = false;
|
1354
|
-
}
|
1355
|
-
}
|
1356
|
-
|
1357
|
-
resetExpandShrink();
|
1358
|
-
};
|
1359
|
-
|
1360
|
-
element.resizeSensor.resetSensor = reset;
|
1361
|
-
|
1362
|
-
var onResized = function onResized() {
|
1363
|
-
rafId = 0;
|
1364
|
-
if (!dirty) return;
|
1365
|
-
lastWidth = size.width;
|
1366
|
-
lastHeight = size.height;
|
1367
|
-
|
1368
|
-
if (element.resizedAttached) {
|
1369
|
-
element.resizedAttached.call(size);
|
1370
|
-
}
|
1371
|
-
};
|
1372
|
-
|
1373
|
-
var onScroll = function onScroll() {
|
1374
|
-
size = getElementSize(element);
|
1375
|
-
dirty = size.width !== lastWidth || size.height !== lastHeight;
|
1376
|
-
|
1377
|
-
if (dirty && !rafId) {
|
1378
|
-
rafId = requestAnimationFrame(onResized);
|
1379
|
-
}
|
1380
|
-
|
1381
|
-
reset();
|
1382
|
-
};
|
1383
|
-
|
1384
|
-
var addEvent = function addEvent(el, name, cb) {
|
1385
|
-
if (el.attachEvent) {
|
1386
|
-
el.attachEvent('on' + name, cb);
|
1387
|
-
} else {
|
1388
|
-
el.addEventListener(name, cb);
|
1389
|
-
}
|
1390
|
-
};
|
1391
|
-
|
1392
|
-
addEvent(expand, 'scroll', onScroll);
|
1393
|
-
addEvent(shrink, 'scroll', onScroll); // Fix for custom Elements
|
1394
|
-
|
1395
|
-
requestAnimationFrame(reset);
|
1396
|
-
}
|
1397
|
-
|
1398
|
-
forEachElement(element, function (elem) {
|
1399
|
-
attachResizeEvent(elem, callback);
|
1400
|
-
});
|
1401
|
-
|
1402
|
-
this.detach = function (ev) {
|
1403
|
-
ResizeSensor.detach(element, ev);
|
1404
|
-
};
|
1405
|
-
|
1406
|
-
this.reset = function () {
|
1407
|
-
element.resizeSensor.resetSensor();
|
1408
|
-
};
|
1409
|
-
};
|
1410
|
-
|
1411
|
-
ResizeSensor.reset = function (element) {
|
1412
|
-
forEachElement(element, function (elem) {
|
1413
|
-
elem.resizeSensor.resetSensor();
|
1414
|
-
});
|
1415
|
-
};
|
1416
|
-
|
1417
|
-
ResizeSensor.detach = function (element, ev) {
|
1418
|
-
forEachElement(element, function (elem) {
|
1419
|
-
if (!elem) return;
|
1420
|
-
|
1421
|
-
if (elem.resizedAttached && typeof ev === "function") {
|
1422
|
-
elem.resizedAttached.remove(ev);
|
1423
|
-
if (elem.resizedAttached.length()) return;
|
1424
|
-
}
|
1425
|
-
|
1426
|
-
if (elem.resizeSensor) {
|
1427
|
-
if (elem.contains(elem.resizeSensor)) {
|
1428
|
-
elem.removeChild(elem.resizeSensor);
|
1429
|
-
}
|
1430
|
-
|
1431
|
-
delete elem.resizeSensor;
|
1432
|
-
delete elem.resizedAttached;
|
1433
|
-
}
|
1434
|
-
});
|
1435
|
-
};
|
1436
|
-
|
1437
|
-
if (typeof MutationObserver !== "undefined") {
|
1438
|
-
var observer = new MutationObserver(function (mutations) {
|
1439
|
-
for (var i in mutations) {
|
1440
|
-
if (mutations.hasOwnProperty(i)) {
|
1441
|
-
var items = mutations[i].addedNodes;
|
1442
|
-
|
1443
|
-
for (var j = 0; j < items.length; j++) {
|
1444
|
-
if (items[j].resizeSensor) {
|
1445
|
-
ResizeSensor.reset(items[j]);
|
1446
|
-
}
|
1447
|
-
}
|
1448
|
-
}
|
1449
|
-
}
|
1450
|
-
});
|
1451
|
-
document.addEventListener("DOMContentLoaded", function (event) {
|
1452
|
-
observer.observe(document.body, {
|
1453
|
-
childList: true,
|
1454
|
-
subtree: true
|
1455
|
-
});
|
1456
|
-
});
|
1457
|
-
}
|
1458
|
-
|
1459
|
-
return ResizeSensor;
|
1460
|
-
});
|
1461
|
-
});
|
1462
|
-
|
1463
|
-
var cssElementQueries = {
|
1464
|
-
ResizeSensor: ResizeSensor
|
1465
|
-
};
|
1466
|
-
var cssElementQueries_1 = cssElementQueries.ResizeSensor;
|
1467
|
-
|
1468
|
-
function ownKeys$5(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; }
|
1469
|
-
|
1470
|
-
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
1471
|
-
var defaultProps = {
|
1472
|
-
handleSize: 40,
|
1473
|
-
handle: null,
|
1474
|
-
hover: false,
|
1475
|
-
leftImageAlt: '',
|
1476
|
-
leftImageCss: {},
|
1477
|
-
leftImageLabel: null,
|
1478
|
-
onSliderPositionChange: function onSliderPositionChange() {},
|
1479
|
-
rightImageAlt: '',
|
1480
|
-
rightImageCss: {},
|
1481
|
-
rightImageLabel: null,
|
1482
|
-
skeleton: null,
|
1483
|
-
sliderLineColor: '#ffffff',
|
1484
|
-
sliderLineWidth: 2,
|
1485
|
-
sliderPositionPercentage: 0.5
|
1486
|
-
};
|
1487
|
-
|
1488
|
-
function ReactCompareImage(props) {
|
1489
|
-
var handleSize = props.handleSize,
|
1490
|
-
handle = props.handle,
|
1491
|
-
hover = props.hover,
|
1492
|
-
leftImage = props.leftImage,
|
1493
|
-
leftImageAlt = props.leftImageAlt,
|
1494
|
-
leftImageCss = props.leftImageCss,
|
1495
|
-
leftImageLabel = props.leftImageLabel,
|
1496
|
-
onSliderPositionChange = props.onSliderPositionChange,
|
1497
|
-
rightImage = props.rightImage,
|
1498
|
-
rightImageAlt = props.rightImageAlt,
|
1499
|
-
rightImageCss = props.rightImageCss,
|
1500
|
-
rightImageLabel = props.rightImageLabel,
|
1501
|
-
skeleton = props.skeleton,
|
1502
|
-
sliderLineColor = props.sliderLineColor,
|
1503
|
-
sliderLineWidth = props.sliderLineWidth,
|
1504
|
-
sliderPositionPercentage = props.sliderPositionPercentage,
|
1505
|
-
sliderPosition = props.sliderPosition,
|
1506
|
-
setSliderPosition = props.setSliderPosition,
|
1507
|
-
isSliding = props.isSliding,
|
1508
|
-
setIsSliding = props.setIsSliding,
|
1509
|
-
classicMode = props.classicMode,
|
1510
|
-
wiggle = props.wiggle;
|
1511
|
-
|
1512
|
-
var _useState = useState(0),
|
1513
|
-
_useState2 = _slicedToArray(_useState, 2),
|
1514
|
-
containerWidth = _useState2[0],
|
1515
|
-
setContainerWidth = _useState2[1];
|
1516
|
-
|
1517
|
-
var _useState3 = useState(false),
|
1518
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
1519
|
-
leftImgLoaded = _useState4[0],
|
1520
|
-
setLeftImgLoaded = _useState4[1];
|
1521
|
-
|
1522
|
-
var _useState5 = useState(false),
|
1523
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
1524
|
-
rightImgLoaded = _useState6[0],
|
1525
|
-
setRightImgLoaded = _useState6[1];
|
1526
|
-
|
1527
|
-
var containerRef = useRef();
|
1528
|
-
var rightImageRef = useRef();
|
1529
|
-
var leftImageRef = useRef(); // keep track container's width in local state
|
1530
|
-
|
1531
|
-
useEffect(function () {
|
1532
|
-
var updateContainerWidth = function updateContainerWidth() {
|
1533
|
-
var currentContainerWidth = containerRef.current.getBoundingClientRect().width;
|
1534
|
-
setContainerWidth(currentContainerWidth);
|
1535
|
-
}; // initial execution must be done manually
|
1536
|
-
|
1537
|
-
|
1538
|
-
updateContainerWidth(); // update local state if container size is changed
|
1539
|
-
|
1540
|
-
var containerElement = containerRef.current;
|
1541
|
-
var resizeSensor = new cssElementQueries_1(containerElement, function () {
|
1542
|
-
updateContainerWidth();
|
1543
|
-
});
|
1544
|
-
return function () {
|
1545
|
-
resizeSensor.detach(containerElement);
|
1546
|
-
};
|
1547
|
-
}, []);
|
1548
|
-
useEffect(function () {
|
1549
|
-
// consider the case where loading image is completed immediately
|
1550
|
-
// due to the cache etc.
|
1551
|
-
var alreadyDone = leftImageRef.current.complete;
|
1552
|
-
alreadyDone && setLeftImgLoaded(true);
|
1553
|
-
return function () {
|
1554
|
-
// when the left image source is changed
|
1555
|
-
setLeftImgLoaded(false);
|
1556
|
-
};
|
1557
|
-
}, [leftImage]);
|
1558
|
-
useEffect(function () {
|
1559
|
-
// consider the case where loading image is completed immediately
|
1560
|
-
// due to the cache etc.
|
1561
|
-
var alreadyDone = rightImageRef.current.complete;
|
1562
|
-
alreadyDone && setRightImgLoaded(true);
|
1563
|
-
return function () {
|
1564
|
-
// when the right image source is changed
|
1565
|
-
setRightImgLoaded(false);
|
1566
|
-
};
|
1567
|
-
}, [rightImage]);
|
1568
|
-
var allImagesLoaded = rightImgLoaded && leftImgLoaded;
|
1569
|
-
useEffect(function () {
|
1570
|
-
var handleSliding = function handleSliding(event) {
|
1571
|
-
var e = event || window.event; // Calc Cursor Position from the left edge of the viewport
|
1572
|
-
|
1573
|
-
var cursorXfromViewport = e.touches ? e.touches[0].pageX : e.pageX; // Calc Cursor Position from the left edge of the window (consider any page scrolling)
|
1574
|
-
|
1575
|
-
var cursorXfromWindow = cursorXfromViewport - window.pageXOffset; // Calc Cursor Position from the left edge of the image
|
1576
|
-
|
1577
|
-
var imagePosition = rightImageRef.current.getBoundingClientRect();
|
1578
|
-
var pos = cursorXfromWindow - imagePosition.left; // Set minimum and maximum values to prevent the slider from overflowing
|
1579
|
-
|
1580
|
-
var minPos = 0 + sliderLineWidth / 2;
|
1581
|
-
var maxPos = containerWidth - sliderLineWidth / 2;
|
1582
|
-
if (pos < minPos) pos = minPos;
|
1583
|
-
if (pos > maxPos) pos = maxPos;
|
1584
|
-
setSliderPosition(pos / containerWidth); // If there's a callback function, invoke it everytime the slider changes
|
1585
|
-
|
1586
|
-
if (onSliderPositionChange) {
|
1587
|
-
onSliderPositionChange(pos / containerWidth);
|
1588
|
-
}
|
1589
|
-
};
|
1590
|
-
|
1591
|
-
var startSliding = function startSliding(e) {
|
1592
|
-
setIsSliding(true); // Prevent default behavior other than mobile scrolling
|
1593
|
-
|
1594
|
-
if (!('touches' in e)) {
|
1595
|
-
e.preventDefault();
|
1596
|
-
} // Slide the image even if you just click or tap (not drag)
|
1597
|
-
|
1598
|
-
|
1599
|
-
handleSliding(e);
|
1600
|
-
window.addEventListener('mousemove', handleSliding); // 07
|
1601
|
-
|
1602
|
-
window.addEventListener('touchmove', handleSliding); // 08
|
1603
|
-
};
|
1604
|
-
|
1605
|
-
var finishSliding = function finishSliding() {
|
1606
|
-
setIsSliding(false);
|
1607
|
-
window.removeEventListener('mousemove', handleSliding);
|
1608
|
-
window.removeEventListener('touchmove', handleSliding);
|
1609
|
-
};
|
1610
|
-
|
1611
|
-
var containerElement = containerRef.current;
|
1612
|
-
|
1613
|
-
if (allImagesLoaded) {
|
1614
|
-
if (classicMode) {
|
1615
|
-
// it's necessary to reset event handlers each time the canvasWidth changes
|
1616
|
-
// for mobile
|
1617
|
-
containerElement.addEventListener('touchstart', startSliding); // 01
|
1618
|
-
|
1619
|
-
window.addEventListener('touchend', finishSliding); // 02
|
1620
|
-
// for desktop
|
1621
|
-
|
1622
|
-
if (hover) {
|
1623
|
-
containerElement.addEventListener('mousemove', handleSliding); // 03
|
1624
|
-
|
1625
|
-
containerElement.addEventListener('mouseleave', finishSliding); // 04
|
1626
|
-
} else {
|
1627
|
-
containerElement.addEventListener('mousedown', startSliding); // 05
|
1628
|
-
|
1629
|
-
window.addEventListener('mouseup', finishSliding); // 06
|
1630
|
-
}
|
1631
|
-
}
|
1632
|
-
}
|
1633
|
-
|
1634
|
-
return function () {
|
1635
|
-
if (classicMode) {
|
1636
|
-
// cleanup all event resteners
|
1637
|
-
containerElement.removeEventListener('touchstart', startSliding); // 01
|
1638
|
-
|
1639
|
-
window.removeEventListener('touchend', finishSliding); // 02
|
1640
|
-
|
1641
|
-
containerElement.removeEventListener('mousemove', handleSliding); // 03
|
1642
|
-
|
1643
|
-
containerElement.removeEventListener('mouseleave', finishSliding); // 04
|
1644
|
-
|
1645
|
-
containerElement.removeEventListener('mousedown', startSliding); // 05
|
1646
|
-
|
1647
|
-
window.removeEventListener('mouseup', finishSliding); // 06
|
1648
|
-
|
1649
|
-
window.removeEventListener('mousemove', handleSliding); // 07
|
1650
|
-
|
1651
|
-
window.removeEventListener('touchmove', handleSliding); // 08
|
1652
|
-
}
|
1653
|
-
};
|
1654
|
-
}, [allImagesLoaded, containerWidth, hover, sliderLineWidth]); // eslint-disable-line
|
1655
|
-
// Image size set as follows.
|
1656
|
-
//
|
1657
|
-
// 1. right(under) image:
|
1658
|
-
// width = 100% of container width
|
1659
|
-
// height = auto
|
1660
|
-
//
|
1661
|
-
// 2. left(over) imaze:
|
1662
|
-
// width = 100% of container width
|
1663
|
-
// height = right image's height
|
1664
|
-
// (protrudes is hidden by css 'object-fit: hidden')
|
1665
|
-
|
1666
|
-
var styles = {
|
1667
|
-
container: {
|
1668
|
-
boxSizing: 'border-box',
|
1669
|
-
position: 'relative',
|
1670
|
-
width: '100%',
|
1671
|
-
overflow: 'hidden'
|
1672
|
-
},
|
1673
|
-
rightImage: _objectSpread$5({
|
1674
|
-
display: 'block',
|
1675
|
-
height: 'auto',
|
1676
|
-
// Respect the aspect ratio
|
1677
|
-
width: '100%'
|
1678
|
-
}, rightImageCss),
|
1679
|
-
leftImage: _objectSpread$5({
|
1680
|
-
clip: "rect(auto, ".concat(containerWidth * sliderPosition, "px, auto, auto)"),
|
1681
|
-
display: 'block',
|
1682
|
-
height: '100%',
|
1683
|
-
// fit to the height of right(under) image
|
1684
|
-
objectFit: 'cover',
|
1685
|
-
// protrudes is hidden
|
1686
|
-
position: 'absolute',
|
1687
|
-
top: 0,
|
1688
|
-
width: '100%'
|
1689
|
-
}, leftImageCss),
|
1690
|
-
slider: {
|
1691
|
-
alignItems: 'center',
|
1692
|
-
cursor: !hover && 'ew-resize',
|
1693
|
-
display: 'flex',
|
1694
|
-
flexDirection: 'column',
|
1695
|
-
height: '100%',
|
1696
|
-
justifyContent: 'center',
|
1697
|
-
left: "".concat(containerWidth * sliderPosition - handleSize / 2, "px"),
|
1698
|
-
position: 'absolute',
|
1699
|
-
top: 0,
|
1700
|
-
width: "".concat(handleSize, "px")
|
1701
|
-
},
|
1702
|
-
line: {
|
1703
|
-
background: sliderLineColor,
|
1704
|
-
boxShadow: '0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)',
|
1705
|
-
flex: '0 1 auto',
|
1706
|
-
height: '100%',
|
1707
|
-
width: "".concat(sliderLineWidth, "px")
|
1708
|
-
},
|
1709
|
-
handleCustom: {
|
1710
|
-
alignItems: 'center',
|
1711
|
-
boxSizing: 'border-box',
|
1712
|
-
display: 'flex',
|
1713
|
-
flex: '1 0 auto',
|
1714
|
-
height: 'auto',
|
1715
|
-
justifyContent: 'center',
|
1716
|
-
width: 'auto'
|
1717
|
-
},
|
1718
|
-
handleDefault: {
|
1719
|
-
alignItems: 'center',
|
1720
|
-
border: "".concat(sliderLineWidth, "px solid ").concat(sliderLineColor),
|
1721
|
-
borderRadius: '100%',
|
1722
|
-
boxShadow: '0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)',
|
1723
|
-
boxSizing: 'border-box',
|
1724
|
-
display: 'flex',
|
1725
|
-
flex: '1 0 auto',
|
1726
|
-
height: "".concat(handleSize, "px"),
|
1727
|
-
justifyContent: 'center',
|
1728
|
-
width: "".concat(handleSize, "px")
|
1729
|
-
},
|
1730
|
-
leftArrow: {
|
1731
|
-
border: "inset ".concat(handleSize * 0.15, "px rgba(0,0,0,0)"),
|
1732
|
-
borderRight: "".concat(handleSize * 0.15, "px solid ").concat(sliderLineColor),
|
1733
|
-
height: '0px',
|
1734
|
-
marginLeft: "-".concat(handleSize * 0.25, "px"),
|
1735
|
-
// for IE11
|
1736
|
-
marginRight: "".concat(handleSize * 0.25, "px"),
|
1737
|
-
width: '0px'
|
1738
|
-
},
|
1739
|
-
rightArrow: {
|
1740
|
-
border: "inset ".concat(handleSize * 0.15, "px rgba(0,0,0,0)"),
|
1741
|
-
borderLeft: "".concat(handleSize * 0.15, "px solid ").concat(sliderLineColor),
|
1742
|
-
height: '0px',
|
1743
|
-
marginRight: "-".concat(handleSize * 0.25, "px"),
|
1744
|
-
// for IE11
|
1745
|
-
width: '0px'
|
1746
|
-
},
|
1747
|
-
leftLabel: {
|
1748
|
-
background: 'rgba(0, 0, 0, 0.5)',
|
1749
|
-
color: 'white',
|
1750
|
-
left: '5%',
|
1751
|
-
opacity: isSliding ? 0 : 1,
|
1752
|
-
padding: '10px 20px',
|
1753
|
-
position: 'absolute',
|
1754
|
-
top: '50%',
|
1755
|
-
transform: 'translate(0,-50%)',
|
1756
|
-
transition: 'opacity 0.1s ease-out 0.5s',
|
1757
|
-
maxWidth: '30%',
|
1758
|
-
WebkitUserSelect: 'none',
|
1759
|
-
WebkitTouchCallout: 'none'
|
1760
|
-
},
|
1761
|
-
rightLabel: {
|
1762
|
-
background: 'rgba(0, 0, 0, 0.5)',
|
1763
|
-
color: 'white',
|
1764
|
-
opacity: isSliding ? 0 : 1,
|
1765
|
-
padding: '10px 20px',
|
1766
|
-
position: 'absolute',
|
1767
|
-
right: '5%',
|
1768
|
-
top: '50%',
|
1769
|
-
transform: 'translate(0,-50%)',
|
1770
|
-
transition: 'opacity 0.1s ease-out 0.5s',
|
1771
|
-
maxWidth: '30%',
|
1772
|
-
WebkitUserSelect: 'none',
|
1773
|
-
WebkitTouchCallout: 'none'
|
1774
|
-
}
|
1775
|
-
};
|
1776
|
-
return React.createElement(React.Fragment, null, skeleton && !allImagesLoaded && React.createElement("div", {
|
1777
|
-
style: _objectSpread$5({}, styles.container)
|
1778
|
-
}, skeleton), React.createElement("div", {
|
1779
|
-
style: _objectSpread$5({}, styles.container, {
|
1780
|
-
display: allImagesLoaded ? 'block' : 'none'
|
1781
|
-
}),
|
1782
|
-
ref: containerRef,
|
1783
|
-
"data-testid": "container"
|
1784
|
-
}, React.createElement("img", {
|
1785
|
-
onLoad: function onLoad() {
|
1786
|
-
return setRightImgLoaded(true);
|
1787
|
-
},
|
1788
|
-
alt: rightImageAlt,
|
1789
|
-
"data-testid": "right-image",
|
1790
|
-
ref: rightImageRef,
|
1791
|
-
src: rightImage,
|
1792
|
-
style: styles.rightImage
|
1793
|
-
}), React.createElement("img", {
|
1794
|
-
onLoad: function onLoad() {
|
1795
|
-
return setLeftImgLoaded(true);
|
1796
|
-
},
|
1797
|
-
alt: leftImageAlt,
|
1798
|
-
"data-testid": "left-image",
|
1799
|
-
ref: leftImageRef,
|
1800
|
-
src: leftImage,
|
1801
|
-
style: styles.leftImage
|
1802
|
-
}), React.createElement("div", {
|
1803
|
-
style: styles.slider,
|
1804
|
-
className: classnames(_defineProperty({}, 'wiggle', wiggle))
|
1805
|
-
}, React.createElement("div", {
|
1806
|
-
style: styles.line
|
1807
|
-
}), handle ? React.createElement("div", {
|
1808
|
-
style: styles.handleCustom
|
1809
|
-
}, handle) : React.createElement("div", {
|
1810
|
-
style: styles.handleDefault
|
1811
|
-
}, React.createElement("div", {
|
1812
|
-
style: styles.leftArrow
|
1813
|
-
}), React.createElement("div", {
|
1814
|
-
style: styles.rightArrow
|
1815
|
-
})), React.createElement("div", {
|
1816
|
-
style: styles.line
|
1817
|
-
})), leftImageLabel && React.createElement("div", {
|
1818
|
-
style: styles.leftLabel
|
1819
|
-
}, leftImageLabel), rightImageLabel && React.createElement("div", {
|
1820
|
-
style: styles.rightLabel
|
1821
|
-
}, rightImageLabel)));
|
1822
|
-
}
|
1823
|
-
|
1824
|
-
ReactCompareImage.defaultProps = defaultProps;
|
1825
|
-
|
1826
|
-
var css$5 = ".BeforeAfter-module_container__38Dru {\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n.wiggle {\n animation: BeforeAfter-module_shake__3iLe8 1.5s cubic-bezier(.36,.07,.19,.97) both;\n}\n\n@keyframes BeforeAfter-module_shake__3iLe8 {\n 10%, 90% {\n transform: translate3d(-20%, 0, 0);\n }\n\n 20%, 80% {\n transform: translate3d(40%, 0, 0);\n }\n\n 30%, 50%, 70% {\n transform: translate3d(-80%, 0, 0);\n }\n\n 40%, 60% {\n transform: translate3d(80%, 0, 0);\n }\n}";
|
1827
|
-
var styles$5 = {"container":"BeforeAfter-module_container__38Dru","shake":"BeforeAfter-module_shake__3iLe8"};
|
1828
|
-
styleInject(css$5);
|
1829
|
-
|
1830
|
-
var BeforeAfter = (function (_ref) {
|
1831
|
-
var state = _ref.state,
|
1832
|
-
leftImageLabel = _ref.leftImageLabel,
|
1833
|
-
rightImageLabel = _ref.rightImageLabel,
|
1834
|
-
_ref$startPos = _ref.startPos,
|
1835
|
-
startPos = _ref$startPos === void 0 ? 0 : _ref$startPos,
|
1836
|
-
_ref$slideMode = _ref.slideMode,
|
1837
|
-
slideMode = _ref$slideMode === void 0 ? 'both' : _ref$slideMode;
|
1838
|
-
|
1839
|
-
var _useState = useState({
|
1840
|
-
pos: window.pageYOffset || document.documentElement.scrollTop,
|
1841
|
-
dir: 'unknown'
|
1842
|
-
}),
|
1843
|
-
_useState2 = _slicedToArray(_useState, 2),
|
1844
|
-
scrollPos = _useState2[0],
|
1845
|
-
setScrollPos = _useState2[1];
|
1846
|
-
|
1847
|
-
var _useState3 = useState(false),
|
1848
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
1849
|
-
isSliding = _useState4[0],
|
1850
|
-
setIsSliding = _useState4[1];
|
1851
|
-
|
1852
|
-
var _useState5 = useState(startPos),
|
1853
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
1854
|
-
beforeAfterPos = _useState6[0],
|
1855
|
-
setBeforeAfterPos = _useState6[1];
|
1856
|
-
|
1857
|
-
var beforeAfterRef = useRef();
|
1858
|
-
var slideOnScroll = slideMode === 'both' || slideMode === 'scroll';
|
1859
|
-
var slideClassic = slideMode === 'both' || slideMode === 'classic';
|
1860
|
-
var current = beforeAfterRef.current;
|
1861
|
-
|
1862
|
-
var _useState7 = useState(false),
|
1863
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
1864
|
-
wiggle = _useState8[0],
|
1865
|
-
setWiggle = _useState8[1];
|
1866
|
-
|
1867
|
-
useEffect(function () {
|
1868
|
-
var node = current;
|
1869
|
-
|
1870
|
-
if (node) {
|
1871
|
-
setWiggle(state === 'active');
|
1872
|
-
}
|
1873
|
-
}, [state, current]);
|
1874
|
-
useEffect(function () {
|
1875
|
-
var node = current;
|
1876
|
-
|
1877
|
-
function handler() {
|
1878
|
-
if (node) {
|
1879
|
-
setScrollPos(function (prevPos) {
|
1880
|
-
var currPos = window.pageYOffset || document.documentElement.scrollTop;
|
1881
|
-
|
1882
|
-
if (currPos > prevPos['pos']) {
|
1883
|
-
return {
|
1884
|
-
pos: currPos,
|
1885
|
-
dir: 'down'
|
1886
|
-
};
|
1887
|
-
}
|
1888
|
-
|
1889
|
-
if (currPos < prevPos['pos']) {
|
1890
|
-
return {
|
1891
|
-
pos: currPos,
|
1892
|
-
dir: 'up'
|
1893
|
-
};
|
1894
|
-
}
|
1895
|
-
|
1896
|
-
return prevPos;
|
1897
|
-
});
|
1898
|
-
|
1899
|
-
if (slideOnScroll) {
|
1900
|
-
if (scrollPos['dir'] === 'down' && beforeAfterPos < 1) {
|
1901
|
-
setBeforeAfterPos(function (prev) {
|
1902
|
-
return prev + 0.025;
|
1903
|
-
});
|
1904
|
-
setIsSliding(true);
|
1905
|
-
setTimeout(function () {
|
1906
|
-
return setIsSliding(false);
|
1907
|
-
}, 200);
|
1908
|
-
} else if (scrollPos['dir'] === 'up' && beforeAfterPos > 0) {
|
1909
|
-
setBeforeAfterPos(function (prev) {
|
1910
|
-
return prev - 0.025;
|
1911
|
-
});
|
1912
|
-
setIsSliding(true);
|
1913
|
-
setTimeout(function () {
|
1914
|
-
return setIsSliding(false);
|
1915
|
-
}, 250);
|
1916
|
-
} else {
|
1917
|
-
setIsSliding(false);
|
1918
|
-
}
|
1919
|
-
}
|
1920
|
-
}
|
1921
|
-
}
|
1922
|
-
|
1923
|
-
if (!node) {
|
1924
|
-
return;
|
1925
|
-
}
|
1926
|
-
|
1927
|
-
setTimeout(handler, 0);
|
1928
|
-
|
1929
|
-
if (state === 'active') {
|
1930
|
-
window.addEventListener('scroll', handler);
|
1931
|
-
return function () {
|
1932
|
-
window.removeEventListener('scroll', handler);
|
1933
|
-
};
|
1934
|
-
}
|
1935
|
-
}, [current, setBeforeAfterPos, scrollPos, state, setIsSliding]);
|
1936
|
-
var awsBucket = '//s3-eu-west-1.amazonaws.com/de.codevise.pageflow.development/pageflow-next/presentation-images/';
|
1937
|
-
var beforeImage = awsBucket + 'before_after/haldern_church1.jpg';
|
1938
|
-
var afterImage = awsBucket + 'before_after/haldern_church2.jpg';
|
1939
|
-
return React.createElement("div", {
|
1940
|
-
ref: beforeAfterRef,
|
1941
|
-
className: styles$5.container
|
1942
|
-
}, React.createElement(ReactCompareImage, {
|
1943
|
-
leftImage: beforeImage,
|
1944
|
-
rightImage: afterImage,
|
1945
|
-
sliderPosition: beforeAfterPos,
|
1946
|
-
setSliderPosition: setBeforeAfterPos,
|
1947
|
-
isSliding: isSliding,
|
1948
|
-
setIsSliding: setIsSliding,
|
1949
|
-
leftImageLabel: leftImageLabel,
|
1950
|
-
rightImageLabel: rightImageLabel,
|
1951
|
-
classicMode: slideClassic,
|
1952
|
-
wiggle: wiggle
|
1953
|
-
}));
|
1954
|
-
});
|
1955
|
-
|
1956
|
-
var css$6 = ".Backdrop-module_Backdrop__1w4UZ {\n width: 100%;\n z-index: 2;\n}\n\n.Backdrop-module_offScreen__2_FYZ {\n}\n";
|
1957
|
-
var styles$6 = {"Backdrop":"Backdrop-module_Backdrop__1w4UZ","offScreen":"Backdrop-module_offScreen__2_FYZ"};
|
1958
|
-
styleInject(css$6);
|
1959
|
-
|
1960
|
-
function Backdrop(props) {
|
1961
|
-
var _useDimension = useDimension(),
|
1962
|
-
_useDimension2 = _slicedToArray(_useDimension, 2),
|
1963
|
-
containerDimension = _useDimension2[0],
|
1964
|
-
setContainerRef = _useDimension2[1];
|
1965
|
-
|
1966
|
-
return React.createElement("div", {
|
1967
|
-
className: classnames(styles$6.Backdrop, props.transitionStyles.backdrop, props.transitionStyles["backdrop-".concat(props.state)], _defineProperty({}, styles$6.offScreen, props.offScreen))
|
1968
|
-
}, React.createElement("div", {
|
1969
|
-
className: props.transitionStyles.backdropInner
|
1970
|
-
}, React.createElement("div", {
|
1971
|
-
className: props.transitionStyles.backdropInner2
|
1972
|
-
}, props.children(renderContent(props, containerDimension, setContainerRef)))));
|
1973
|
-
}
|
1974
|
-
Backdrop.defaultProps = {
|
1975
|
-
transitionStyles: {}
|
1976
|
-
};
|
1977
|
-
|
1978
|
-
function renderContent(props, containerDimension, setContainerRef) {
|
1979
|
-
if (props.image.toString().startsWith('#')) {
|
1980
|
-
return React.createElement(FillColor, {
|
1981
|
-
color: props.image
|
1982
|
-
});
|
1983
|
-
} else if (props.image.toString().startsWith('video')) {
|
1984
|
-
var video = videos[props.image];
|
1985
|
-
return React.createElement(Fullscreen, {
|
1986
|
-
ref: setContainerRef
|
1987
|
-
}, React.createElement(Video, {
|
1988
|
-
state: props.onScreen ? 'active' : 'inactive',
|
1989
|
-
id: props.image,
|
1990
|
-
offset: props.offset,
|
1991
|
-
interactive: props.interactive,
|
1992
|
-
nextSectionOnEnd: props.nextSectionOnEnd
|
1993
|
-
}), React.createElement(MotifArea, {
|
1994
|
-
ref: props.motifAreaRef,
|
1995
|
-
image: video,
|
1996
|
-
containerWidth: containerDimension.width,
|
1997
|
-
containerHeight: containerDimension.height
|
1998
|
-
}));
|
1999
|
-
} else if (props.image.toString().startsWith('beforeAfter')) {
|
2000
|
-
return React.createElement(Fullscreen, {
|
2001
|
-
ref: setContainerRef
|
2002
|
-
}, React.createElement(BeforeAfter, {
|
2003
|
-
state: props.state,
|
2004
|
-
leftImageLabel: props.leftImageLabel,
|
2005
|
-
rightImageLabel: props.rightImageLabel,
|
2006
|
-
startPos: props.startPos,
|
2007
|
-
slideMode: props.slideMode
|
2008
|
-
}));
|
2009
|
-
} else {
|
2010
|
-
return React.createElement(Fullscreen, {
|
2011
|
-
ref: setContainerRef
|
2012
|
-
}, React.createElement(Image, {
|
2013
|
-
id: props.image
|
2014
|
-
}), React.createElement(Image, {
|
2015
|
-
id: props.imageMobile,
|
2016
|
-
mobile: true
|
2017
|
-
}), React.createElement(MotifArea, {
|
2018
|
-
ref: props.motifAreaRef,
|
2019
|
-
imageId: props.image,
|
2020
|
-
containerWidth: containerDimension.width,
|
2021
|
-
containerHeight: containerDimension.height
|
2022
|
-
}));
|
2023
|
-
}
|
2024
|
-
}
|
2025
|
-
|
2026
|
-
var css$7 = ".Foreground-module_Foreground__13ODU {\n position: relative;\n z-index: 3;\n\n box-sizing: border-box;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n.Foreground-module_fullFadeHeight__2p9dx {\n min-height: 51vh;\n}\n\n.Foreground-module_fullHeight__1vMXb {\n min-height: 100vh;\n}\n\n.Foreground-module_fullFadeHeight__2p9dx.Foreground-module_enlarge__14Plm,\n.Foreground-module_fullHeight__1vMXb.Foreground-module_enlarge__14Plm {\n min-height: 130vh;\n}\n\n.Foreground-module_hidden__2dmAx {\n visibility: hidden;\n}\n";
|
2027
|
-
var styles$7 = {"Foreground":"Foreground-module_Foreground__13ODU","fullFadeHeight":"Foreground-module_fullFadeHeight__2p9dx","fullHeight":"Foreground-module_fullHeight__1vMXb","enlarge":"Foreground-module_enlarge__14Plm","hidden":"Foreground-module_hidden__2dmAx"};
|
2028
|
-
styleInject(css$7);
|
2029
|
-
|
2030
|
-
function Foreground(props) {
|
2031
|
-
return React.createElement("div", {
|
2032
|
-
className: className(props)
|
2033
|
-
}, props.children);
|
2034
|
-
}
|
2035
|
-
|
2036
|
-
function className(props) {
|
2037
|
-
var _classNames;
|
2038
|
-
|
2039
|
-
return classnames(styles$7.Foreground, props.transitionStyles.foreground, props.transitionStyles["foreground-".concat(props.state)], styles$7["".concat(props.heightMode, "Height")], (_classNames = {}, _defineProperty(_classNames, styles$7.hidden, props.hidden), _defineProperty(_classNames, styles$7.enlarge, props.hidden && !props.disableEnlarge), _classNames));
|
2040
|
-
}
|
2041
|
-
|
2042
|
-
function _arrayWithoutHoles(arr) {
|
2043
|
-
if (Array.isArray(arr)) {
|
2044
|
-
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
2045
|
-
arr2[i] = arr[i];
|
2046
|
-
}
|
2047
|
-
|
2048
|
-
return arr2;
|
2049
|
-
}
|
2050
|
-
}
|
2051
|
-
|
2052
|
-
function _iterableToArray(iter) {
|
2053
|
-
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
2054
|
-
}
|
2055
|
-
|
2056
|
-
function _nonIterableSpread() {
|
2057
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
2058
|
-
}
|
2059
|
-
|
2060
|
-
function _toConsumableArray(arr) {
|
2061
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
2062
|
-
}
|
2063
|
-
|
2064
|
-
var css$8 = "\n\n.Heading-module_Heading__1YSiy {\n font-size: 66px;\n font-weight: 700;\n margin-top: 0;\n margin-bottom: 0.5em;\n padding-top: 0.5em;\n}\n\n.Heading-module_first__1yPxD {\n font-size: 110px;\n line-height: 1;\n}\n\n@media (orientation: landscape) {\n .Heading-module_first__1yPxD {\n padding-top: 25%;\n }\n}\n\n@media (max-width: 600px) {\n .Heading-module_Heading__1YSiy {\n font-size: 40px;\n }\n\n .Heading-module_first__1yPxD {\n font-size: 66px;\n }\n}\n";
|
2065
|
-
var styles$8 = {"text-l":"40px","text-xl":"66px","text-2xl":"110px","Heading":"Heading-module_Heading__1YSiy","first":"Heading-module_first__1yPxD"};
|
2066
|
-
styleInject(css$8);
|
2067
|
-
|
2068
|
-
function Heading(props) {
|
2069
|
-
return React.createElement("h1", {
|
2070
|
-
className: classnames(styles$8.Heading, _defineProperty({}, styles$8.first, props.first)),
|
2071
|
-
style: props.style
|
2072
|
-
}, props.children);
|
2073
|
-
}
|
2074
|
-
|
2075
|
-
var css$9 = "\n\n.TextBlock-module_TextBlock__5Zpj7 {\n font-size: 22px;\n line-height: 1.4;\n\n padding: 1em 0;\n margin-top: 0;\n margin-bottom: 0;\n text-shadow: none;\n}\n\n.TextBlock-module_dummy__3W5ls {\n opacity: 0.7;\n}\n\n.TextBlock-module_TextBlock__5Zpj7 a {\n color: #fff;\n word-wrap: break-word;\n}\n\n.TextBlock-module_TextBlock__5Zpj7 ol,\n.TextBlock-module_TextBlock__5Zpj7 ul {\n padding-left: 20px;\n}\n";
|
2076
|
-
var styles$9 = {"text-base":"22px","TextBlock":"TextBlock-module_TextBlock__5Zpj7","dummy":"TextBlock-module_dummy__3W5ls"};
|
2077
|
-
styleInject(css$9);
|
2078
|
-
|
2079
|
-
function TextBlock(props) {
|
2080
|
-
return React.createElement("div", {
|
2081
|
-
className: classnames(styles$9.TextBlock, _defineProperty({}, styles$9.dummy, props.dummy)),
|
2082
|
-
style: props.style,
|
2083
|
-
dangerouslySetInnerHTML: {
|
2084
|
-
__html: props.children
|
2085
|
-
}
|
2086
|
-
});
|
2087
|
-
}
|
2088
|
-
|
2089
|
-
var css$a = ".InlineCaption-module_root__1R8Ib {\n padding: 3px 10px 5px;\n background-color: #fff;\n color: #222;\n font-size: text-s;\n line-height: 1.4;\n text-shadow: none;\n}\n";
|
2090
|
-
var styles$a = {"text-base":"22px","root":"InlineCaption-module_root__1R8Ib"};
|
2091
|
-
styleInject(css$a);
|
2092
|
-
|
2093
|
-
function InlineCaption(props) {
|
2094
|
-
if (props.text) {
|
2095
|
-
return React.createElement("div", {
|
2096
|
-
className: styles$a.root
|
2097
|
-
}, props.text);
|
2098
|
-
} else {
|
2099
|
-
return null;
|
2100
|
-
}
|
2101
|
-
}
|
2102
|
-
|
2103
|
-
var css$b = ".InlineImage-module_root__1DvUb {\n position: relative;\n margin-top: 1em;\n}\n\n.InlineImage-module_container__Pui7E {\n position: relative;\n margin-top: 1em;\n}\n\n.InlineImage-module_spacer__2rMkE {\n padding-top: 75%;\n}\n\n.InlineImage-module_inner__2AMK- {\n border: solid 2px #fff;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n}\n";
|
2104
|
-
var styles$b = {"root":"InlineImage-module_root__1DvUb","container":"InlineImage-module_container__Pui7E","spacer":"InlineImage-module_spacer__2rMkE","inner":"InlineImage-module_inner__2AMK-"};
|
2105
|
-
styleInject(css$b);
|
2106
|
-
|
2107
|
-
function InlineImage(props) {
|
2108
|
-
return React.createElement("div", {
|
2109
|
-
className: classnames(styles$b.root)
|
2110
|
-
}, React.createElement("div", {
|
2111
|
-
className: styles$b.container
|
2112
|
-
}, React.createElement("div", {
|
2113
|
-
className: styles$b.spacer
|
2114
|
-
}, React.createElement("div", {
|
2115
|
-
className: styles$b.inner
|
2116
|
-
}, React.createElement(Image, props)))), React.createElement(InlineCaption, {
|
2117
|
-
text: props.caption
|
2118
|
-
}));
|
2119
|
-
}
|
2120
|
-
|
2121
|
-
var css$c = ".InlineVideo-module_root__2UD3D {\n position: relative;\n max-height: 98vh;\n}\n\n.InlineVideo-module_inner__H81_g {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n}\n";
|
2122
|
-
var styles$c = {"root":"InlineVideo-module_root__2UD3D","inner":"InlineVideo-module_inner__H81_g"};
|
2123
|
-
styleInject(css$c);
|
2124
|
-
|
2125
|
-
function InlineVideo(props) {
|
2126
|
-
var ref = useRef();
|
2127
|
-
var onScreen = useOnScreen(ref, '-50% 0px -50% 0px');
|
2128
|
-
return React.createElement("div", {
|
2129
|
-
ref: ref,
|
2130
|
-
className: classnames(styles$c.root)
|
2131
|
-
}, React.createElement("div", {
|
2132
|
-
style: {
|
2133
|
-
paddingTop: props.wideFormat ? '41.15%' : '56.25%'
|
2134
|
-
}
|
2135
|
-
}, React.createElement("div", {
|
2136
|
-
className: styles$c.inner
|
2137
|
-
}, React.createElement(Video, Object.assign({}, props, {
|
2138
|
-
state: onScreen ? 'active' : 'inactive',
|
2139
|
-
interactive: true
|
2140
|
-
})))));
|
2141
|
-
}
|
2142
|
-
|
2143
|
-
var css$d = ".InlineBeforeAfter-module_root__2O9F8 {\n position: relative;\n margin: 0 auto;\n}\n";
|
2144
|
-
var styles$d = {"root":"InlineBeforeAfter-module_root__2O9F8"};
|
2145
|
-
styleInject(css$d);
|
2146
|
-
|
2147
|
-
function InlineBeforeAfter(props) {
|
2148
|
-
var ref = useRef();
|
2149
|
-
var onScreen = useOnScreen(ref, '-50% 0px -50% 0px');
|
2150
|
-
return React.createElement("div", {
|
2151
|
-
ref: ref,
|
2152
|
-
className: styles$d.root
|
2153
|
-
}, React.createElement(BeforeAfter, Object.assign({}, props, {
|
2154
|
-
state: onScreen ? 'active' : 'inactive'
|
2155
|
-
})));
|
2156
|
-
}
|
2157
|
-
|
2158
|
-
var css$e = ".SoundDisclaimer-module_soundDisclaimer__1sAiH {\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__1sAiH:hover {\n background: rgba(255, 255, 255, 0.25);\n}";
|
2159
|
-
var styles$e = {"soundDisclaimer":"SoundDisclaimer-module_soundDisclaimer__1sAiH"};
|
2160
|
-
styleInject(css$e);
|
2161
|
-
|
2162
|
-
function UnmuteButton() {
|
2163
|
-
return React.createElement(MutedContext.Consumer, null, function (mutedSettings) {
|
2164
|
-
return React.createElement("div", {
|
2165
|
-
className: classnames(styles$e.soundDisclaimer),
|
2166
|
-
onClick: function onClick() {
|
2167
|
-
return mutedSettings.setMuted(false);
|
2168
|
-
}
|
2169
|
-
}, React.createElement("p", null, "Dieser Artikel wirkt am besten mit eingeschaltetem Ton.", React.createElement("br", null), "Klicken Sie einmal in dieses Feld, um den Ton f\xFCr die gesamte Geschichte zu aktivieren."));
|
2170
|
-
});
|
2171
|
-
}
|
2172
|
-
|
2173
|
-
var loremIpsum1 = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. ';
|
2174
|
-
var loremIpsum2 = 'At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.';
|
2175
|
-
var loremIpsum3 = 'Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.';
|
2176
|
-
|
2177
|
-
var templates = {
|
2178
|
-
heading: {
|
2179
|
-
name: 'Überschrift',
|
2180
|
-
component: Heading
|
2181
|
-
},
|
2182
|
-
textBlock: {
|
2183
|
-
name: 'Text Block',
|
2184
|
-
component: TextBlock
|
2185
|
-
},
|
2186
|
-
soundDisclaimer: {
|
2187
|
-
name: 'Sound Disclaimer',
|
2188
|
-
component: UnmuteButton
|
2189
|
-
},
|
2190
|
-
loremIpsum1: {
|
2191
|
-
name: 'Blindtext 1',
|
2192
|
-
component: TextBlock,
|
2193
|
-
props: {
|
2194
|
-
children: loremIpsum1
|
2195
|
-
}
|
2196
|
-
},
|
2197
|
-
loremIpsum2: {
|
2198
|
-
name: 'Blindtext 2',
|
2199
|
-
component: TextBlock,
|
2200
|
-
props: {
|
2201
|
-
children: loremIpsum2
|
2202
|
-
}
|
2203
|
-
},
|
2204
|
-
loremIpsum3: {
|
2205
|
-
name: 'Blindtext 3',
|
2206
|
-
component: TextBlock,
|
2207
|
-
props: {
|
2208
|
-
children: loremIpsum3
|
2209
|
-
}
|
2210
|
-
},
|
2211
|
-
inlineImage: {
|
2212
|
-
name: 'Inline Bild',
|
2213
|
-
component: InlineImage,
|
2214
|
-
inlinePositioning: true
|
2215
|
-
},
|
2216
|
-
inlineVideo: {
|
2217
|
-
name: 'Inline Video',
|
2218
|
-
component: InlineVideo,
|
2219
|
-
inlinePositioning: true
|
2220
|
-
},
|
2221
|
-
inlineBeforeAfter: {
|
2222
|
-
name: 'Inline Before/After',
|
2223
|
-
component: InlineBeforeAfter,
|
2224
|
-
inlinePositioning: true
|
2225
|
-
},
|
2226
|
-
stickyImage: {
|
2227
|
-
name: 'Sticky Bild',
|
2228
|
-
component: InlineImage,
|
2229
|
-
inlinePositioning: true
|
2230
|
-
}
|
2231
|
-
};
|
2232
|
-
|
2233
|
-
function ForegroundItem(props) {
|
2234
|
-
var template = templates[props.type];
|
2235
|
-
var Component = template.component;
|
2236
|
-
return React.createElement(Component, Object.assign({}, template.props, props.itemProps));
|
2237
|
-
}
|
2238
|
-
|
2239
|
-
function ForegroundItems(props) {
|
2240
|
-
return React.createElement(React.Fragment, null, props.items.map(function (item, index) {
|
2241
|
-
return props.children(item, React.createElement(ForegroundItem, {
|
2242
|
-
key: index,
|
2243
|
-
type: item.type,
|
2244
|
-
position: item.position,
|
2245
|
-
itemProps: item.props
|
2246
|
-
}));
|
2247
|
-
}));
|
2248
|
-
}
|
2249
|
-
ForegroundItems.defaultProps = {
|
2250
|
-
children: function children(item, child) {
|
2251
|
-
return child;
|
2252
|
-
}
|
2253
|
-
};
|
2254
|
-
|
2255
|
-
var css$f = ".TwoColumn-module_root__37EqL {\n}\n\n.TwoColumn-module_group__3Hg2y {\n clear: right;\n margin-left: 8%;\n margin-right: 8%;\n}\n\n.TwoColumn-module_group-full__2OT4o {\n margin-left: 0;\n margin-right: 0;\n}\n\n.TwoColumn-module_sticky__4LCDO,\n.TwoColumn-module_inline__1fPfM {\n max-width: 500px;\n}\n\n.TwoColumn-module_right__Fr52a .TwoColumn-module_inline__1fPfM {\n margin-left: auto;\n}\n\n@media (max-width: 949px) {\n .TwoColumn-module_right__Fr52a .TwoColumn-module_sticky__4LCDO {\n margin-left: auto;\n }\n}\n\n@media (min-width: 950px) {\n .TwoColumn-module_sticky__4LCDO {\n position: sticky;\n float: right;\n top: 33%;\n width: 30%;\n max-width: 600px;\n }\n\n .TwoColumn-module_right__Fr52a .TwoColumn-module_sticky__4LCDO {\n float: left;\n }\n}\n";
|
2256
|
-
var styles$f = {"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"};
|
2257
|
-
styleInject(css$f);
|
2258
|
-
|
2259
|
-
var availablePositions = ['inline', 'sticky', 'full'];
|
2260
|
-
function TwoColumn(props) {
|
2261
|
-
return React.createElement("div", {
|
2262
|
-
className: classnames(styles$f.root, styles$f[props.align])
|
2263
|
-
}, React.createElement("div", {
|
2264
|
-
className: styles$f.inline,
|
2265
|
-
ref: props.contentAreaRef
|
2266
|
-
}), renderItems(props));
|
2267
|
-
}
|
2268
|
-
TwoColumn.defaultProps = {
|
2269
|
-
align: 'left'
|
2270
|
-
};
|
2271
|
-
|
2272
|
-
function renderItems(props) {
|
2273
|
-
return groupItemsByPosition(props.items).map(function (group, index) {
|
2274
|
-
return React.createElement("div", {
|
2275
|
-
key: index,
|
2276
|
-
className: classnames(styles$f.group, styles$f["group-".concat(group.position)])
|
2277
|
-
}, renderItemGroup(props, group, 'sticky'), renderItemGroup(props, group, 'inline'), renderItemGroup(props, group, 'full'));
|
2278
|
-
});
|
2279
|
-
}
|
2280
|
-
|
2281
|
-
function renderItemGroup(props, group, position) {
|
2282
|
-
if (group[position].length) {
|
2283
|
-
return React.createElement("div", {
|
2284
|
-
className: styles$f[position]
|
2285
|
-
}, props.children(React.createElement(ForegroundItems, {
|
2286
|
-
items: group[position]
|
2287
|
-
})));
|
2288
|
-
}
|
2289
|
-
}
|
2290
|
-
|
2291
|
-
function groupItemsByPosition(items) {
|
2292
|
-
var groups = [];
|
2293
|
-
var currentGroup;
|
2294
|
-
items.reduce(function (previousItemPosition, item, index) {
|
2295
|
-
var position = availablePositions.indexOf(item.position) >= 0 ? item.position : 'inline';
|
2296
|
-
|
2297
|
-
if (!previousItemPosition || previousItemPosition !== position && (previousItemPosition !== 'sticky' || position !== 'inline')) {
|
2298
|
-
currentGroup = {
|
2299
|
-
position: position,
|
2300
|
-
sticky: [],
|
2301
|
-
inline: [],
|
2302
|
-
full: []
|
2303
|
-
};
|
2304
|
-
groups = [].concat(_toConsumableArray(groups), [currentGroup]);
|
2305
|
-
}
|
2306
|
-
|
2307
|
-
currentGroup[position].push(item);
|
2308
|
-
return position;
|
2309
|
-
}, null);
|
2310
|
-
return groups;
|
2311
|
-
}
|
2312
|
-
|
2313
|
-
var css$g = ".Center-module_outer__3Rr0H {\n margin-left: 8%;\n margin-right: 8%;\n}\n\n.Center-module_outer-full__3dknO {\n margin-left: 0;\n margin-right: 0;\n}\n\n.Center-module_item__1KSs3 {\n margin-left: auto;\n margin-right: auto;\n max-width: 700px;\n}\n\n.Center-module_item-full__1cEuv {\n margin-left: 0;\n margin-right: 0;\n max-width: none;\n}\n\n@media (min-width: 950px) {\n .Center-module_inner-left__2z9Ea {\n float: left;\n width: 60%;\n margin-left: -10%;\n margin-right: 1em;\n margin-bottom: 1em;\n }\n\n .Center-module_inner-right__KBkVt {\n float: right;\n width: 60%;\n margin-right: -10%;\n margin-left: 1em;\n margin-bottom: 1em;\n }\n}\n";
|
2314
|
-
var styles$g = {"outer":"Center-module_outer__3Rr0H","outer-full":"Center-module_outer-full__3dknO","item":"Center-module_item__1KSs3","item-full":"Center-module_item-full__1cEuv","inner-left":"Center-module_inner-left__2z9Ea","inner-right":"Center-module_inner-right__KBkVt"};
|
2315
|
-
styleInject(css$g);
|
2316
|
-
|
2317
|
-
function Center(props) {
|
2318
|
-
return React.createElement("div", {
|
2319
|
-
className: classnames(styles$g.root)
|
2320
|
-
}, React.createElement("div", {
|
2321
|
-
ref: props.contentAreaRef
|
2322
|
-
}), React.createElement(ForegroundItems, {
|
2323
|
-
items: props.items
|
2324
|
-
}, function (item, child) {
|
2325
|
-
return React.createElement("div", {
|
2326
|
-
key: item.index,
|
2327
|
-
className: classnames(styles$g.outer, styles$g["outer-".concat(item.position)])
|
2328
|
-
}, React.createElement("div", {
|
2329
|
-
className: classnames(styles$g.item, styles$g["item-".concat(item.position)])
|
2330
|
-
}, props.children(React.createElement("div", {
|
2331
|
-
className: styles$g["inner-".concat(item.position)]
|
2332
|
-
}, child))));
|
2333
|
-
}));
|
2334
|
-
}
|
2335
|
-
|
2336
|
-
function Layout(props) {
|
2337
|
-
if (props.layout === 'center') {
|
2338
|
-
return React.createElement(Center, props);
|
2339
|
-
} else if (props.layout === 'right') {
|
2340
|
-
return React.createElement(TwoColumn, Object.assign({
|
2341
|
-
align: "right"
|
2342
|
-
}, props));
|
2343
|
-
} else {
|
2344
|
-
return React.createElement(TwoColumn, props);
|
2345
|
-
}
|
2346
|
-
}
|
2347
|
-
Layout.defaultProps = {
|
2348
|
-
layout: 'left'
|
2349
|
-
};
|
2350
|
-
|
2351
|
-
function isIntersectingX(rectA, rectB) {
|
2352
|
-
return rectA.left < rectB.right && rectA.right > rectB.left || rectB.left < rectA.right && rectB.right > rectA.left;
|
2353
|
-
}
|
2354
|
-
|
2355
|
-
function getBoundingClientRect(el) {
|
2356
|
-
if (!el) {
|
2357
|
-
return {
|
2358
|
-
left: 0,
|
2359
|
-
right: 0,
|
2360
|
-
top: 0,
|
2361
|
-
bottom: 0,
|
2362
|
-
width: 0,
|
2363
|
-
height: 0
|
2364
|
-
};
|
2365
|
-
}
|
2366
|
-
|
2367
|
-
return el.getBoundingClientRect();
|
2368
|
-
}
|
2369
|
-
|
2370
|
-
function useBoundingClientRect() {
|
2371
|
-
var _useState = useState(getBoundingClientRect(null)),
|
2372
|
-
_useState2 = _slicedToArray(_useState, 2),
|
2373
|
-
boundingClientRect = _useState2[0],
|
2374
|
-
setBoundingClientRect = _useState2[1];
|
2375
|
-
|
2376
|
-
var _useState3 = useState(null),
|
2377
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
2378
|
-
currentNode = _useState4[0],
|
2379
|
-
setCurrentNode = _useState4[1];
|
2380
|
-
|
2381
|
-
var measureRef = useCallback(function (node) {
|
2382
|
-
setCurrentNode(node);
|
2383
|
-
setBoundingClientRect(getBoundingClientRect(node));
|
2384
|
-
}, []);
|
2385
|
-
useEffect(function () {
|
2386
|
-
function handler() {
|
2387
|
-
setBoundingClientRect(getBoundingClientRect(currentNode));
|
2388
|
-
}
|
2389
|
-
|
2390
|
-
if (!currentNode) {
|
2391
|
-
return;
|
2392
|
-
}
|
2393
|
-
|
2394
|
-
window.addEventListener('resize', handler);
|
2395
|
-
window.addEventListener('scroll', handler);
|
2396
|
-
return function () {
|
2397
|
-
window.removeEventListener('resize', handler);
|
2398
|
-
window.removeEventListener('scroll', handler);
|
2399
|
-
};
|
2400
|
-
}, [currentNode]);
|
2401
|
-
return [boundingClientRect, measureRef];
|
2402
|
-
}
|
2403
|
-
|
2404
|
-
function useScrollTarget(ref, isScrollTarget) {
|
2405
|
-
useEffect(function () {
|
2406
|
-
if (ref.current && isScrollTarget) {
|
2407
|
-
window.scrollTo({
|
2408
|
-
top: ref.current.getBoundingClientRect().top + window.scrollY - window.innerHeight * 0.25,
|
2409
|
-
behavior: 'smooth'
|
2410
|
-
});
|
2411
|
-
}
|
2412
|
-
}, [ref, isScrollTarget]);
|
2413
|
-
}
|
2414
|
-
|
2415
|
-
var css$h = ".Section-module_Section__Yo58b {\n position: relative;\n}\n\n.Section-module_invert__3_p7F {\n color: #222;\n}\n\n.Section-module_activityProbe__Fsklh {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 2px;\n width: 1px;\n}\n";
|
2416
|
-
var styles$h = {"Section":"Section-module_Section__Yo58b","invert":"Section-module_invert__3_p7F","activityProbe":"Section-module_activityProbe__Fsklh"};
|
2417
|
-
styleInject(css$h);
|
2418
|
-
|
2419
|
-
var css$i = "\n\n.fadeInBgConceal-module_backdrop__11JGO {\n position: absolute;\n height: 100%;\n}\n\n.fadeInBgConceal-module_backdropInner__1IAYD {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n}\n\n.fadeInBgConceal-module_backdrop__11JGO {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.fadeInBgConceal-module_backdrop-below__3E6Uk {\n opacity: 0;\n visibility: hidden;\n}\n";
|
2420
|
-
var fadeInBgConceal = {"fade-duration":"0.5s","backdrop":"fadeInBgConceal-module_backdrop__11JGO","backdropInner":"fadeInBgConceal-module_backdropInner__1IAYD","backdrop-below":"fadeInBgConceal-module_backdrop-below__3E6Uk"};
|
2421
|
-
styleInject(css$i);
|
2422
|
-
|
2423
|
-
var css$j = "\n\n.fadeInBgFadeOut-module_backdrop__r0YXp {\n position: absolute;\n height: 100%;\n}\n\n.fadeInBgFadeOut-module_backdropInner__IQp87 {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n}\n\n.fadeInBgFadeOut-module_backdrop__r0YXp .fadeInBgFadeOut-module_backdropInner__IQp87,\n.fadeInBgFadeOut-module_foreground__Q2vkT {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.fadeInBgFadeOut-module_foreground-above__3pmz9,\n.fadeInBgFadeOut-module_backdrop-below__2G-Ic .fadeInBgFadeOut-module_backdropInner__IQp87 {\n opacity: 0;\n visibility: hidden;\n}\n\n.fadeInBgFadeOut-module_bbackdrop__1thge::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n background-color: #000;\n}\n\n.fadeInBgFadeOut-module_bbackdrop-below__yaeMc::before {\n visibility: hidden;\n}\n";
|
2424
|
-
var fadeInBgFadeOut = {"fade-duration":"0.5s","backdrop":"fadeInBgFadeOut-module_backdrop__r0YXp","backdropInner":"fadeInBgFadeOut-module_backdropInner__IQp87","foreground":"fadeInBgFadeOut-module_foreground__Q2vkT","foreground-above":"fadeInBgFadeOut-module_foreground-above__3pmz9","backdrop-below":"fadeInBgFadeOut-module_backdrop-below__2G-Ic","bbackdrop":"fadeInBgFadeOut-module_bbackdrop__1thge","bbackdrop-below":"fadeInBgFadeOut-module_bbackdrop-below__yaeMc"};
|
2425
|
-
styleInject(css$j);
|
2426
|
-
|
2427
|
-
var css$k = "\n\n.fadeInBgFadeOutBg-module_backdrop__15ocl {\n position: absolute;\n height: 100%;\n}\n\n.fadeInBgFadeOutBg-module_backdropInner__sAnz6 {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n}\n\n.fadeInBgFadeOutBg-module_boxShadow__xUKyj,\n.fadeInBgFadeOutBg-module_backdrop__15ocl .fadeInBgFadeOutBg-module_backdropInner__sAnz6 {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.fadeInBgFadeOutBg-module_boxShadow-above__2bY0E,\n.fadeInBgFadeOutBg-module_backdrop-below__1rDT6 .fadeInBgFadeOutBg-module_backdropInner__sAnz6 {\n opacity: 0;\n visibility: hidden;\n}\n\n.fadeInBgFadeOutBg-module_bbackdrop__25Ux-::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n background-color: #000;\n}\n\n.fadeInBgFadeOutBg-module_bbackdrop-below__2MPgj::before {\n visibility: hidden;\n}\n";
|
2428
|
-
var fadeInBgFadeOutBg = {"fade-duration":"0.5s","backdrop":"fadeInBgFadeOutBg-module_backdrop__15ocl","backdropInner":"fadeInBgFadeOutBg-module_backdropInner__sAnz6","boxShadow":"fadeInBgFadeOutBg-module_boxShadow__xUKyj","boxShadow-above":"fadeInBgFadeOutBg-module_boxShadow-above__2bY0E","backdrop-below":"fadeInBgFadeOutBg-module_backdrop-below__1rDT6","bbackdrop":"fadeInBgFadeOutBg-module_bbackdrop__25Ux-","bbackdrop-below":"fadeInBgFadeOutBg-module_bbackdrop-below__2MPgj"};
|
2429
|
-
styleInject(css$k);
|
2430
|
-
|
2431
|
-
var css$l = "\n\n.fadeInBgScrollOut-module_backdrop__1bSsb {\n position: absolute;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n}\n\n.fadeInBgScrollOut-module_backdropInner__3JZBG {\n position: sticky;\n bottom: 0;\n width: 100%;\n}\n\n.fadeInBgScrollOut-module_backdropInner2__q-00L {\n position: absolute;\n bottom: 0;\n width: 100%;\n}\n\n.fadeInBgScrollOut-module_foreground__1ODH9 {\n min-height: 100vh;\n}\n\n.fadeInBgScrollOut-module_backdrop__1bSsb {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.fadeInBgScrollOut-module_backdrop-below__2Dbkr {\n opacity: 0;\n visibility: hidden;\n}\n";
|
2432
|
-
var fadeInBgScrollOut = {"fade-duration":"0.5s","backdrop":"fadeInBgScrollOut-module_backdrop__1bSsb","backdropInner":"fadeInBgScrollOut-module_backdropInner__3JZBG","backdropInner2":"fadeInBgScrollOut-module_backdropInner2__q-00L","foreground":"fadeInBgScrollOut-module_foreground__1ODH9","backdrop-below":"fadeInBgScrollOut-module_backdrop-below__2Dbkr"};
|
2433
|
-
styleInject(css$l);
|
2434
|
-
|
2435
|
-
var css$m = "\n\n.fadeInConceal-module_backdrop__1zaRO {\n position: absolute;\n height: 100%;\n}\n\n.fadeInConceal-module_backdropInner__1AIvq {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n}\n\n.fadeInConceal-module_backdrop__1zaRO,\n.fadeInConceal-module_foreground__3giM9 {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.fadeInConceal-module_backdrop-below__AWyQe,\n.fadeInConceal-module_foreground-below__2z5Op {\n opacity: 0;\n visibility: hidden;\n}\n";
|
2436
|
-
var fadeInConceal = {"fade-duration":"0.5s","backdrop":"fadeInConceal-module_backdrop__1zaRO","backdropInner":"fadeInConceal-module_backdropInner__1AIvq","foreground":"fadeInConceal-module_foreground__3giM9","backdrop-below":"fadeInConceal-module_backdrop-below__AWyQe","foreground-below":"fadeInConceal-module_foreground-below__2z5Op"};
|
2437
|
-
styleInject(css$m);
|
2438
|
-
|
2439
|
-
var css$n = "\n\n.fadeInFadeOut-module_backdrop__Y4xOA {\n position: absolute;\n height: 100%;\n}\n\n.fadeInFadeOut-module_backdropInner__1oRfP {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n}\n\n.fadeInFadeOut-module_backdrop__Y4xOA .fadeInFadeOut-module_backdropInner__1oRfP,\n.fadeInFadeOut-module_foreground__1eleZ {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.fadeInFadeOut-module_foreground-above__249wa,\n.fadeInFadeOut-module_backdrop-below__1h2I4 .fadeInFadeOut-module_backdropInner__1oRfP,\n.fadeInFadeOut-module_foreground-below__3mE6f {\n opacity: 0;\n visibility: hidden;\n}\n\n.fadeInFadeOut-module_bbackdrop__WJjFl::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n background-color: #000;\n}\n\n.fadeInFadeOut-module_bbackdrop-below__1Htkz::before {\n visibility: hidden;\n}\n";
|
2440
|
-
var fadeInFadeOut = {"fade-duration":"0.5s","backdrop":"fadeInFadeOut-module_backdrop__Y4xOA","backdropInner":"fadeInFadeOut-module_backdropInner__1oRfP","foreground":"fadeInFadeOut-module_foreground__1eleZ","foreground-above":"fadeInFadeOut-module_foreground-above__249wa","backdrop-below":"fadeInFadeOut-module_backdrop-below__1h2I4","foreground-below":"fadeInFadeOut-module_foreground-below__3mE6f","bbackdrop":"fadeInFadeOut-module_bbackdrop__WJjFl","bbackdrop-below":"fadeInFadeOut-module_bbackdrop-below__1Htkz"};
|
2441
|
-
styleInject(css$n);
|
2442
|
-
|
2443
|
-
var css$o = "\n\n.fadeInFadeOutBg-module_backdrop__2-IF3 {\n position: absolute;\n height: 100%;\n}\n\n.fadeInFadeOutBg-module_backdropInner__3r_bo {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n}\n\n.fadeInFadeOutBg-module_backdrop__2-IF3 .fadeInFadeOutBg-module_backdropInner__3r_bo,\n.fadeInFadeOutBg-module_boxShadow__3x7Ki,\n.fadeInFadeOutBg-module_foreground__24f_M {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.fadeInFadeOutBg-module_backdrop-below__4Ys_2 .fadeInFadeOutBg-module_backdropInner__3r_bo,\n.fadeInFadeOutBg-module_boxShadow-above__3T2K5,\n.fadeInFadeOutBg-module_foreground-below__3pTRc {\n opacity: 0;\n visibility: hidden;\n}\n\n.fadeInFadeOutBg-module_bbackdrop__MVdvw::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n background-color: #000;\n}\n\n.fadeInFadeOutBg-module_bbackdrop-below__30mpF::before {\n visibility: hidden;\n}\n";
|
2444
|
-
var fadeInFadeOutBg = {"fade-duration":"0.5s","backdrop":"fadeInFadeOutBg-module_backdrop__2-IF3","backdropInner":"fadeInFadeOutBg-module_backdropInner__3r_bo","boxShadow":"fadeInFadeOutBg-module_boxShadow__3x7Ki","foreground":"fadeInFadeOutBg-module_foreground__24f_M","backdrop-below":"fadeInFadeOutBg-module_backdrop-below__4Ys_2","boxShadow-above":"fadeInFadeOutBg-module_boxShadow-above__3T2K5","foreground-below":"fadeInFadeOutBg-module_foreground-below__3pTRc","bbackdrop":"fadeInFadeOutBg-module_bbackdrop__MVdvw","bbackdrop-below":"fadeInFadeOutBg-module_bbackdrop-below__30mpF"};
|
2445
|
-
styleInject(css$o);
|
2446
|
-
|
2447
|
-
var css$p = "\n\n.fadeInScrollOut-module_backdrop__2FhBb {\n position: absolute;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n}\n\n.fadeInScrollOut-module_backdropInner__1OfNZ {\n position: sticky;\n bottom: 0;\n width: 100%;\n}\n\n.fadeInScrollOut-module_backdropInner2__5bNPT {\n position: absolute;\n bottom: 0;\n width: 100%;\n}\n\n.fadeInScrollOut-module_foreground__3h0EX {\n min-height: 100vh;\n}\n\n.fadeInScrollOut-module_backdrop__2FhBb,\n.fadeInScrollOut-module_foreground__3h0EX {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.fadeInScrollOut-module_backdrop-below__3cRLH,\n.fadeInScrollOut-module_foreground-below__1Jcql {\n opacity: 0;\n visibility: hidden;\n}\n";
|
2448
|
-
var fadeInScrollOut = {"fade-duration":"0.5s","backdrop":"fadeInScrollOut-module_backdrop__2FhBb","backdropInner":"fadeInScrollOut-module_backdropInner__1OfNZ","backdropInner2":"fadeInScrollOut-module_backdropInner2__5bNPT","foreground":"fadeInScrollOut-module_foreground__3h0EX","backdrop-below":"fadeInScrollOut-module_backdrop-below__3cRLH","foreground-below":"fadeInScrollOut-module_foreground-below__1Jcql"};
|
2449
|
-
styleInject(css$p);
|
2450
|
-
|
2451
|
-
var css$q = ".revealConceal-module_backdrop__dLUhU {\n position: absolute;\n clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);\n height: 100%;\n}\n\n.revealConceal-module_backdropInner__2k1Z- {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n\n transform: translateZ(0);\n backface-visibility: hidden;\n}\n";
|
2452
|
-
var revealConceal = {"backdrop":"revealConceal-module_backdrop__dLUhU","backdropInner":"revealConceal-module_backdropInner__2k1Z-"};
|
2453
|
-
styleInject(css$q);
|
2454
|
-
|
2455
|
-
var css$r = "\n\n.revealFadeOut-module_backdrop___Q1QF {\n position: absolute;\n clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);\n height: 200%;\n}\n\n.revealFadeOut-module_backdropInner__17qRn {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n\n transform: translateZ(0);\n backface-visibility: hidden;\n}\n\n.revealFadeOut-module_foreground__1GzBs {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.revealFadeOut-module_foreground-above__3GxOf {\n opacity: 0;\n visibility: hidden;\n}\n";
|
2456
|
-
var revealFadeOut = {"fade-duration":"0.5s","backdrop":"revealFadeOut-module_backdrop___Q1QF","backdropInner":"revealFadeOut-module_backdropInner__17qRn","foreground":"revealFadeOut-module_foreground__1GzBs","foreground-above":"revealFadeOut-module_foreground-above__3GxOf"};
|
2457
|
-
styleInject(css$r);
|
2458
|
-
|
2459
|
-
var css$s = "\n\n.revealFadeOutBg-module_backdrop__30OCF {\n position: absolute;\n clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);\n height: 200%;\n}\n\n.revealFadeOutBg-module_backdropInner__3v3tM {\n position: fixed;\n top: 0;\n height: 100vh;\n width: 100%;\n\n transform: translateZ(0);\n backface-visibility: hidden;\n}\n\n.revealFadeOutBg-module_boxShadow__1NZRz {\n transition: opacity 1s ease, visibility 1s;\n}\n\n.revealFadeOutBg-module_boxShadow-above__2r4ov {\n opacity: 0;\n visibility: hidden;\n}\n";
|
2460
|
-
var revealFadeOutBg = {"fade-duration":"0.5s","backdrop":"revealFadeOutBg-module_backdrop__30OCF","backdropInner":"revealFadeOutBg-module_backdropInner__3v3tM","boxShadow":"revealFadeOutBg-module_boxShadow__1NZRz","boxShadow-above":"revealFadeOutBg-module_boxShadow-above__2r4ov"};
|
2461
|
-
styleInject(css$s);
|
2462
|
-
|
2463
|
-
var css$t = ".revealScrollOut-module_backdrop__2yOXd {\n position: absolute;\n clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n}\n\n.revealScrollOut-module_backdropInner__211p3 {\n position: sticky;\n bottom: 0;\n width: 100%;\n\n transform: translateZ(0);\n backface-visibility: hidden;\n}\n\n.revealScrollOut-module_backdropInner2__v6WqM {\n position: absolute;\n bottom: 0;\n width: 100%;\n}\n\n.revealScrollOut-module_foreground__3z-hw {\n}\n";
|
2464
|
-
var revealScrollOut = {"backdrop":"revealScrollOut-module_backdrop__2yOXd","backdropInner":"revealScrollOut-module_backdropInner__211p3","backdropInner2":"revealScrollOut-module_backdropInner2__v6WqM","foreground":"revealScrollOut-module_foreground__3z-hw"};
|
2465
|
-
styleInject(css$t);
|
2466
|
-
|
2467
|
-
var css$u = ".scrollInConceal-module_backdrop__2OJJC {\n position: sticky;\n top: 0;\n height: 0;\n}\n";
|
2468
|
-
var scrollInConceal = {"backdrop":"scrollInConceal-module_backdrop__2OJJC"};
|
2469
|
-
styleInject(css$u);
|
2470
|
-
|
2471
|
-
var css$v = "\n\n.scrollInFadeOut-module_backdrop__1vXJd {\n position: sticky;\n top: 0;\n height: 0;\n}\n\n.scrollInFadeOut-module_foreground__3Ikxb {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.scrollInFadeOut-module_foreground-above__6ipm- {\n opacity: 0;\n visibility: hidden;\n}\n\n.scrollInFadeOut-module_bbackdrop__2C-bf::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n background-color: #000;\n}\n\n.scrollInFadeOut-module_bbackdrop-below__3tq0M::before {\n visibility: hidden;\n}\n";
|
2472
|
-
var scrollInFadeOut = {"fade-duration":"0.5s","backdrop":"scrollInFadeOut-module_backdrop__1vXJd","foreground":"scrollInFadeOut-module_foreground__3Ikxb","foreground-above":"scrollInFadeOut-module_foreground-above__6ipm-","bbackdrop":"scrollInFadeOut-module_bbackdrop__2C-bf","bbackdrop-below":"scrollInFadeOut-module_bbackdrop-below__3tq0M"};
|
2473
|
-
styleInject(css$v);
|
2474
|
-
|
2475
|
-
var css$w = "\n\n.scrollInFadeOutBg-module_backdrop__zw95c {\n position: sticky;\n top: 0;\n height: 0;\n}\n\n.scrollInFadeOutBg-module_boxShadow__3UxCQ {\n transition: opacity 0.5s ease, visibility 0.5s;\n}\n\n.scrollInFadeOutBg-module_boxShadow-above__3kfau {\n opacity: 0;\n visibility: hidden;\n}\n\n.scrollInFadeOutBg-module_bbackdrop__2pO9o::before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n background-color: #000;\n}\n\n.scrollInFadeOutBg-module_bbackdrop-below__1Ky2w::before {\n visibility: hidden;\n}\n";
|
2476
|
-
var scrollInFadeOutBg = {"fade-duration":"0.5s","backdrop":"scrollInFadeOutBg-module_backdrop__zw95c","boxShadow":"scrollInFadeOutBg-module_boxShadow__3UxCQ","boxShadow-above":"scrollInFadeOutBg-module_boxShadow-above__3kfau","bbackdrop":"scrollInFadeOutBg-module_bbackdrop__2pO9o","bbackdrop-below":"scrollInFadeOutBg-module_bbackdrop-below__1Ky2w"};
|
2477
|
-
styleInject(css$w);
|
2478
|
-
|
2479
|
-
var css$x = ".scrollInScrollOut-module_backdrop__XzCge {\n position: sticky;\n top: 0;\n height: 100vh;\n}\n\n.scrollInScrollOut-module_foreground__1yyY8 {\n margin-top: -100vh;\n}\n";
|
2480
|
-
var scrollInScrollOut = {"backdrop":"scrollInScrollOut-module_backdrop__XzCge","foreground":"scrollInScrollOut-module_foreground__1yyY8"};
|
2481
|
-
styleInject(css$x);
|
2482
|
-
|
2483
|
-
var css$y = ".previewScrollOut-module_scene__W9bDl {\n height: 100%;\n}\n\n.previewScrollOut-module_backdrop__2-Bl_ {\n position: absolute;\n top: 0;\n}\n";
|
2484
|
-
var previewScrollOut = {"scene":"previewScrollOut-module_scene__W9bDl","backdrop":"previewScrollOut-module_backdrop__2-Bl_"};
|
2485
|
-
styleInject(css$y);
|
2486
|
-
|
2487
|
-
var styles$i = {
|
2488
|
-
fadeInBgConceal: fadeInBgConceal,
|
2489
|
-
fadeInBgFadeOut: fadeInBgFadeOut,
|
2490
|
-
fadeInBgFadeOutBg: fadeInBgFadeOutBg,
|
2491
|
-
fadeInBgScrollOut: fadeInBgScrollOut,
|
2492
|
-
fadeInConceal: fadeInConceal,
|
2493
|
-
fadeInFadeOut: fadeInFadeOut,
|
2494
|
-
fadeInFadeOutBg: fadeInFadeOutBg,
|
2495
|
-
fadeInScrollOut: fadeInScrollOut,
|
2496
|
-
revealConceal: revealConceal,
|
2497
|
-
revealFadeOut: revealFadeOut,
|
2498
|
-
revealFadeOutBg: revealFadeOutBg,
|
2499
|
-
revealScrollOut: revealScrollOut,
|
2500
|
-
scrollInConceal: scrollInConceal,
|
2501
|
-
scrollInFadeOut: scrollInFadeOut,
|
2502
|
-
scrollInFadeOutBg: scrollInFadeOutBg,
|
2503
|
-
scrollInScrollOut: scrollInScrollOut,
|
2504
|
-
previewScrollOut: previewScrollOut
|
2505
|
-
};
|
2506
|
-
var enterTransitions = {
|
2507
|
-
fade: 'fadeIn',
|
2508
|
-
fadeBg: 'fadeInBg',
|
2509
|
-
scroll: 'scrollIn',
|
2510
|
-
scrollOver: 'scrollIn',
|
2511
|
-
reveal: 'reveal',
|
2512
|
-
beforeAfter: 'reveal',
|
2513
|
-
preview: 'preview'
|
2514
|
-
};
|
2515
|
-
var exitTransitions = {
|
2516
|
-
fade: 'fadeOut',
|
2517
|
-
fadeBg: 'fadeOutBg',
|
2518
|
-
scroll: 'scrollOut',
|
2519
|
-
scrollOver: 'conceal',
|
2520
|
-
reveal: 'scrollOut',
|
2521
|
-
beforeAfter: 'conceal'
|
2522
|
-
};
|
2523
|
-
function getTransitionStyles(section, previousSection, nextSection) {
|
2524
|
-
var enterTransition = enterTransitions[section.transition];
|
2525
|
-
var exitTransition = exitTransitions[nextSection ? nextSection.transition : 'scroll'];
|
2526
|
-
var name = "".concat(enterTransition).concat(capitalize(exitTransition));
|
2527
|
-
|
2528
|
-
if (!styles$i[name]) {
|
2529
|
-
throw new Error("Unknown transition ".concat(name));
|
2530
|
-
}
|
2531
|
-
|
2532
|
-
return styles$i[name];
|
2533
|
-
}
|
2534
|
-
|
2535
|
-
function capitalize(string) {
|
2536
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
2537
|
-
}
|
2538
|
-
|
2539
|
-
function NoOpShadow(props) {
|
2540
|
-
return React.createElement("div", null, props.children);
|
2541
|
-
}
|
2542
|
-
|
2543
|
-
var css$z = ".GradientShadow-module_shadow__2UiDH {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100vh;\n z-index: 1;\n transition: opacity 1s ease;\n}\n\n.GradientShadow-module_align-right__3iXZs .GradientShadow-module_shadow__2UiDH,\n.GradientShadow-module_align-left__3qcNM .GradientShadow-module_shadow__2UiDH {\n background: linear-gradient(to right, #000 0%,rgba(0, 0, 0, 0) 100%);\n}\n\n@media (min-width: 950px) {\n .GradientShadow-module_align-right__3iXZs .GradientShadow-module_shadow__2UiDH {\n background: linear-gradient(to left, #000 0%,rgba(0, 0, 0, 0) 100%);\n }\n}\n\n.GradientShadow-module_intersecting__h6vpz .GradientShadow-module_shadow__2UiDH,\n.GradientShadow-module_align-center__2C7cl .GradientShadow-module_shadow__2UiDH {\n background: #000;\n}\n";
|
2544
|
-
var styles$j = {"shadow":"GradientShadow-module_shadow__2UiDH","align-right":"GradientShadow-module_align-right__3iXZs","align-left":"GradientShadow-module_align-left__3qcNM","intersecting":"GradientShadow-module_intersecting__h6vpz","align-center":"GradientShadow-module_align-center__2C7cl"};
|
2545
|
-
styleInject(css$z);
|
2546
|
-
|
2547
|
-
function GradientShadow(props) {
|
2548
|
-
var maxOpacityOverlap = props.motifAreaRect.height / 2;
|
2549
|
-
var motifAreaOverlap = Math.min(maxOpacityOverlap, props.motifAreaRect.bottom - props.contentAreaRect.top);
|
2550
|
-
var opacityFactor = props.intersecting && props.motifAreaRect.height > 0 ? motifAreaOverlap / maxOpacityOverlap : 1;
|
2551
|
-
return React.createElement("div", {
|
2552
|
-
className: classnames(styles$j.root, styles$j["align-".concat(props.align)], _defineProperty({}, styles$j.intersecting, props.intersecting))
|
2553
|
-
}, React.createElement("div", {
|
2554
|
-
className: styles$j.shadow,
|
2555
|
-
style: {
|
2556
|
-
opacity: props.opacity * Math.round(opacityFactor * 10) / 10
|
2557
|
-
}
|
2558
|
-
}), props.children);
|
2559
|
-
}
|
2560
|
-
GradientShadow.defaultProps = {
|
2561
|
-
opacity: 0.7,
|
2562
|
-
align: 'left'
|
2563
|
-
};
|
2564
|
-
|
2565
|
-
function NoOpBoxWrapper(props) {
|
2566
|
-
return React.createElement("div", null, props.children);
|
2567
|
-
}
|
2568
|
-
|
2569
|
-
var css$A = ".GradientBox-module_wrapper__1Jj7N {\n padding-bottom: 50px;\n}\n\n.GradientBox-module_shadow__2XilX {\n --background: rgba(0, 0, 0, 0.7);\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n pointer-events: none;\n}\n\n.GradientBox-module_long__10s6v .GradientBox-module_shadow__2XilX {\n bottom: -100vh;\n}\n\n.GradientBox-module_gradient__31tJ- {\n text-shadow: 0px 1px 5px black;\n}\n\n.GradientBox-module_gradient__31tJ- .GradientBox-module_shadow__2XilX {\n background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0px,rgba(0, 0, 0, 0.3) 100px,rgba(0, 0, 0, 0.3) 100%);\n}\n\n.GradientBox-module_content__96lDk {\n position: relative;\n}\n";
|
2570
|
-
var styles$k = {"wrapper":"GradientBox-module_wrapper__1Jj7N","shadow":"GradientBox-module_shadow__2XilX","long":"GradientBox-module_long__10s6v","gradient":"GradientBox-module_gradient__31tJ-","content":"GradientBox-module_content__96lDk"};
|
2571
|
-
styleInject(css$A);
|
2572
|
-
|
2573
|
-
function GradientBox(props) {
|
2574
|
-
var _classNames;
|
2575
|
-
|
2576
|
-
var padding = props.active ? props.padding : 0;
|
2577
|
-
return React.createElement("div", {
|
2578
|
-
className: classnames(styles$k.root, (_classNames = {}, _defineProperty(_classNames, styles$k.gradient, padding > 0), _defineProperty(_classNames, styles$k["long"], props.coverInvisibleNextSection), _classNames)),
|
2579
|
-
style: {
|
2580
|
-
paddingTop: padding
|
2581
|
-
}
|
2582
|
-
}, React.createElement("div", {
|
2583
|
-
className: styles$k.wrapper
|
2584
|
-
}, React.createElement("div", {
|
2585
|
-
className: classnames(styles$k.shadow, props.transitionStyles.boxShadow, props.transitionStyles["boxShadow-".concat(props.state)]),
|
2586
|
-
style: {
|
2587
|
-
top: padding,
|
2588
|
-
opacity: props.opacity
|
2589
|
-
}
|
2590
|
-
}), React.createElement("div", {
|
2591
|
-
className: styles$k.content
|
2592
|
-
}, props.children)));
|
2593
|
-
}
|
2594
|
-
GradientBox.defaultProps = {
|
2595
|
-
opacity: 1
|
2596
|
-
};
|
2597
|
-
|
2598
|
-
var css$B = ".CardBox-module_wrapper__3vnaH {\n}\n\n.CardBox-module_content__36v7J {\n position: relative;\n}\n";
|
2599
|
-
var styles$l = {"wrapper":"CardBox-module_wrapper__3vnaH","content":"CardBox-module_content__36v7J"};
|
2600
|
-
styleInject(css$B);
|
2601
|
-
|
2602
|
-
function CardBox(props) {
|
2603
|
-
var padding = props.active ? props.padding : 0;
|
2604
|
-
return React.createElement("div", {
|
2605
|
-
style: {
|
2606
|
-
paddingTop: padding
|
2607
|
-
}
|
2608
|
-
}, React.createElement("div", {
|
2609
|
-
className: styles$l.wrapper
|
2610
|
-
}, React.createElement("div", {
|
2611
|
-
style: {
|
2612
|
-
top: padding
|
2613
|
-
}
|
2614
|
-
}), React.createElement("div", {
|
2615
|
-
className: styles$l.content
|
2616
|
-
}, props.children)));
|
2617
|
-
}
|
2618
|
-
|
2619
|
-
var css$C = ".CardBoxWrapper-module_cardBg__154o2 {\n background: white;\n color: black;\n padding: 4%;\n margin: 0 -4% 50px 0;\n border-radius: 15px;\n opacity: 1;\n}\n";
|
2620
|
-
var styles$m = {"cardBg":"CardBoxWrapper-module_cardBg__154o2"};
|
2621
|
-
styleInject(css$C);
|
2622
|
-
|
2623
|
-
function CardBoxWrapper(props) {
|
2624
|
-
return React.createElement("div", {
|
2625
|
-
className: styles$m.cardBg
|
2626
|
-
}, props.children);
|
2627
|
-
}
|
2628
|
-
|
2629
|
-
function ownKeys$6(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; }
|
2630
|
-
|
2631
|
-
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$6(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
2632
|
-
var OnScreenContext = React.createContext({
|
2633
|
-
center: false,
|
2634
|
-
top: false,
|
2635
|
-
bottom: false
|
2636
|
-
});
|
2637
|
-
function Section$1(props) {
|
2638
|
-
var activityProbeRef = useRef();
|
2639
|
-
useOnScreen(activityProbeRef, '-50% 0px -50% 0px', props.onActivate);
|
2640
|
-
var ref = useRef();
|
2641
|
-
var onScreen = useOnScreen(ref, '0px 0px 0px 0px');
|
2642
|
-
useScrollTarget(ref, props.isScrollTarget);
|
2643
|
-
|
2644
|
-
var _useBoundingClientRec = useBoundingClientRect(),
|
2645
|
-
_useBoundingClientRec2 = _slicedToArray(_useBoundingClientRec, 2),
|
2646
|
-
motifAreaRect = _useBoundingClientRec2[0],
|
2647
|
-
setMotifAreaRectRect = _useBoundingClientRec2[1];
|
2648
|
-
|
2649
|
-
var _useDimension = useDimension(),
|
2650
|
-
_useDimension2 = _slicedToArray(_useDimension, 2),
|
2651
|
-
motifAreaDimension = _useDimension2[0],
|
2652
|
-
setMotifAreaDimensionRef = _useDimension2[1];
|
2653
|
-
|
2654
|
-
var setMotifAreaRefs = useCallback(function (node) {
|
2655
|
-
setMotifAreaRectRect(node);
|
2656
|
-
setMotifAreaDimensionRef(node);
|
2657
|
-
}, [setMotifAreaRectRect, setMotifAreaDimensionRef]);
|
2658
|
-
|
2659
|
-
var _useBoundingClientRec3 = useBoundingClientRect(props.layout),
|
2660
|
-
_useBoundingClientRec4 = _slicedToArray(_useBoundingClientRec3, 2),
|
2661
|
-
contentAreaRect = _useBoundingClientRec4[0],
|
2662
|
-
setContentAreaRef = _useBoundingClientRec4[1];
|
2663
|
-
|
2664
|
-
var intersecting = isIntersectingX(motifAreaRect, contentAreaRect);
|
2665
|
-
var heightOffset = 0; //(props.backdrop.first || props.transition === 'scrollOver') ? 0 : (window.innerHeight / 3);
|
2666
|
-
|
2667
|
-
var transitionStyles = getTransitionStyles(props, props.previousSection, props.nextSection);
|
2668
|
-
var appearance = {
|
2669
|
-
shadow: {
|
2670
|
-
background: GradientShadow,
|
2671
|
-
foreground: GradientBox,
|
2672
|
-
foregroundWrapper: NoOpBoxWrapper
|
2673
|
-
},
|
2674
|
-
transparent: {
|
2675
|
-
background: NoOpShadow,
|
2676
|
-
foreground: CardBox,
|
2677
|
-
foregroundWrapper: NoOpBoxWrapper
|
2678
|
-
},
|
2679
|
-
cards: {
|
2680
|
-
background: NoOpShadow,
|
2681
|
-
foreground: CardBox,
|
2682
|
-
foregroundWrapper: CardBoxWrapper
|
2683
|
-
}
|
2684
|
-
}[props.appearance || 'shadow'];
|
2685
|
-
var Shadow = appearance.background;
|
2686
|
-
var Box = appearance.foreground;
|
2687
|
-
var BoxWrapper = appearance.foregroundWrapper;
|
2688
|
-
return React.createElement("section", {
|
2689
|
-
id: "section-".concat(props.permaId),
|
2690
|
-
ref: ref,
|
2691
|
-
className: classnames(styles$h.Section, transitionStyles.section, _defineProperty({}, styles$h.invert, props.invert))
|
2692
|
-
}, React.createElement("div", {
|
2693
|
-
ref: activityProbeRef,
|
2694
|
-
className: styles$h.activityProbe
|
2695
|
-
}), React.createElement(Backdrop, Object.assign({}, props.backdrop, {
|
2696
|
-
motifAreaRef: setMotifAreaRefs,
|
2697
|
-
onScreen: onScreen,
|
2698
|
-
offset: Math.max(0, Math.max(1, -contentAreaRect.top / 200)),
|
2699
|
-
state: props.state,
|
2700
|
-
transitionStyles: transitionStyles,
|
2701
|
-
nextSectionOnEnd: props.nextSectionOnEnd,
|
2702
|
-
interactive: props.interactiveBackdrop
|
2703
|
-
}), function (children) {
|
2704
|
-
return props.interactiveBackdrop ? children : React.createElement(Shadow, {
|
2705
|
-
align: props.layout,
|
2706
|
-
intersecting: intersecting,
|
2707
|
-
opacity: props.shadowOpacity >= 0 ? props.shadowOpacity / 100 : 0.7,
|
2708
|
-
motifAreaRect: motifAreaRect,
|
2709
|
-
contentAreaRect: contentAreaRect
|
2710
|
-
}, children);
|
2711
|
-
}), React.createElement(Foreground, {
|
2712
|
-
transitionStyles: transitionStyles,
|
2713
|
-
hidden: props.interactiveBackdrop,
|
2714
|
-
disableEnlarge: props.disableEnlarge,
|
2715
|
-
state: props.state,
|
2716
|
-
heightMode: heightMode(props)
|
2717
|
-
}, React.createElement(Box, {
|
2718
|
-
active: intersecting,
|
2719
|
-
coverInvisibleNextSection: props.nextSection && props.nextSection.transition.startsWith('fade'),
|
2720
|
-
transitionStyles: transitionStyles,
|
2721
|
-
state: props.state,
|
2722
|
-
padding: Math.max(0, motifAreaDimension.top + motifAreaDimension.height - heightOffset),
|
2723
|
-
opacity: props.shadowOpacity
|
2724
|
-
}, React.createElement(Layout, {
|
2725
|
-
items: indexItems(props.foreground),
|
2726
|
-
appearance: props.appearance,
|
2727
|
-
contentAreaRef: setContentAreaRef,
|
2728
|
-
layout: props.layout
|
2729
|
-
}, function (children) {
|
2730
|
-
return React.createElement(BoxWrapper, null, children);
|
2731
|
-
}))));
|
2732
|
-
}
|
2733
|
-
|
2734
|
-
function indexItems(items) {
|
2735
|
-
return items.map(function (item, index) {
|
2736
|
-
return _objectSpread$6({}, item, {
|
2737
|
-
index: index
|
2738
|
-
});
|
2739
|
-
});
|
2740
|
-
}
|
2741
|
-
|
2742
|
-
function heightMode(props) {
|
2743
|
-
if (props.fullHeight) {
|
2744
|
-
if (props.transition.startsWith('fade') || props.nextSection && props.nextSection.transition.startsWith('fade')) {
|
2745
|
-
return 'fullFade';
|
2746
|
-
} else {
|
2747
|
-
return 'full';
|
2748
|
-
}
|
2749
|
-
}
|
2750
|
-
|
2751
|
-
return 'dynamic';
|
2752
|
-
}
|
2753
|
-
|
2754
|
-
var css$D = "\n\n.Entry-module_Entry__1nDGh {\n font-family: 'Source Sans Pro', sans-serif;\n background-color: #000;\n color: #fff;\n}\n\n.Entry-module_exampleSelect__1uAJs {\n position: absolute;\n top: 5px;\n left: 50%;\n z-index: 10;\n transform: translateX(-50%);\n}\n";
|
2755
|
-
var entryStyles = {"font-sans":"'Source Sans Pro', sans-serif","Entry":"Entry-module_Entry__1nDGh","exampleSelect":"Entry-module_exampleSelect__1uAJs"};
|
2756
|
-
styleInject(css$D);
|
2757
|
-
|
2758
|
-
var css$E = ".SectionThumbnail-module_root__16zjY {\n padding-top: 50%;\n position: relative;\n border: solid 1px #888;\n}\n\n.SectionThumbnail-module_crop__Q1nZj {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.SectionThumbnail-module_scale__2tKDG {\n transform: scale(0.2);\n transform-origin: 0 0;\n width: 500%;\n}\n";
|
2759
|
-
var styles$n = {"root":"SectionThumbnail-module_root__16zjY","crop":"SectionThumbnail-module_crop__Q1nZj","scale":"SectionThumbnail-module_scale__2tKDG"};
|
2760
|
-
styleInject(css$E);
|
2761
|
-
|
2762
|
-
function SectionThumbnail(_ref) {
|
2763
|
-
var seed = _ref.seed,
|
2764
|
-
props = _objectWithoutProperties(_ref, ["seed"]);
|
2765
|
-
|
2766
|
-
return React.createElement(EntryStateProvider, {
|
2767
|
-
seed: seed
|
2768
|
-
}, React.createElement(Inner, props));
|
2769
|
-
}
|
2770
|
-
|
2771
|
-
function Inner(_ref2) {
|
2772
|
-
var sectionPermaId = _ref2.sectionPermaId,
|
2773
|
-
subscribe = _ref2.subscribe;
|
2774
|
-
var dispatch = useEntryStateDispatch();
|
2775
|
-
useEffect(function () {
|
2776
|
-
return subscribe(dispatch);
|
2777
|
-
}, [subscribe, dispatch]);
|
2778
|
-
var section = useSectionStructure({
|
2779
|
-
sectionPermaId: sectionPermaId
|
2780
|
-
});
|
2781
|
-
|
2782
|
-
if (section) {
|
2783
|
-
return React.createElement("div", {
|
2784
|
-
className: styles$n.root
|
2785
|
-
}, React.createElement("div", {
|
2786
|
-
className: styles$n.crop
|
2787
|
-
}, React.createElement("div", {
|
2788
|
-
className: styles$n.scale
|
2789
|
-
}, React.createElement("div", {
|
2790
|
-
className: entryStyles.Entry
|
2791
|
-
}, React.createElement(Section$1, Object.assign({
|
2792
|
-
state: "active"
|
2793
|
-
}, section, {
|
2794
|
-
transition: "preview"
|
2795
|
-
}))))));
|
2796
|
-
} else {
|
2797
|
-
return React.createElement("div", {
|
2798
|
-
className: styles$n.root
|
2799
|
-
}, "Not found.");
|
2800
|
-
}
|
2801
|
-
}
|
2802
|
-
|
2803
|
-
Inner.defaultProps = {
|
2804
|
-
subscribe: function subscribe() {}
|
2805
|
-
};
|
2806
|
-
|
2807
|
-
var css$F = ".icons-module_icon__16IVx::before {\n font-family: \"entypo\";\n}.icons-module_arrowsCcw__3_nrJ,\n.icons-module_attention__1sssG,\n.icons-module_plusCircled__20FlJ,\n.icons-module_rightOpen__9vsOG,\n.icons-module_trash__DH1EH {\n}.icons-module_arrowsCcw__3_nrJ::before {\n content: \"\\1F504\";\n}.icons-module_attention__1sssG::before {\n content: \"\\26A0\";\n}.icons-module_plusCircled__20FlJ::before {\n content: \"\\2795\";\n}.icons-module_rightOpen__9vsOG::before {\n content: \"\\E75E\"\n}.icons-module_trash__DH1EH::before {\n content: \"\\E729\";\n}@keyframes animations-module_blink__32C5j {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.3;\n }\n 100% {\n opacity: 1;\n }\n}.animations-module_blink__32C5j {\n animation: animations-module_blink__32C5j 1.5s ease infinite;\n}.outline-module_indicator__2dw_X {\n display: none;\n position: absolute;\n right: 14px;\n top: 7px;\n width: 30px;\n height: 30px;\n font-size: 19px;\n color: #888;\n}.outline-module_creatingIndicator__3O7Rw {\n}.outline-module_destroyingIndicator__2-mKh {\n}.outline-module_failedIndicator__2QK1F {\n color: #d00;\n}\n\n.SectionItemView-module_root__1Pp0d {\n position: relative;\n border: solid 3px transparent;\n padding: 3px 3px 0 3px;\n margin-bottom: 4px;\n max-width: 270px;\n text-align: right;\n background-color: #eee;\n}\n\n.SectionItemView-module_active__1tLN5 {\n border: solid 3px #1c86fe;\n}\n\n.SectionItemView-module_thumbnailContainer__1Xe7C {\n position: relative;\n}\n\n.SectionItemView-module_thumbnail__1ecBT {}\n\n.SectionItemView-module_clickMask__2JYEH {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n cursor: pointer;\n}\n\n.SectionItemView-module_editLink__2mHqk {\n display: inline-block;\n position: relative;\n width: 30px;\n height: 25px;\n}\n\n.SectionItemView-module_editLink__2mHqk::before {\n font-family: 'entypo';\n content: \"\\270E\";\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n color: #555;\n font-size: 15px;\n}\n\n.SectionItemView-module_creating__3Pjx9 .SectionItemView-module_creatingIndicator__1GnKq { display: block; }\n.SectionItemView-module_destroying__1m53s .SectionItemView-module_destroyingIndicator__HtKWF { display: block; }\n.SectionItemView-module_failed__1CR2R .SectionItemView-module_failedIndicator__1HVHn { display: block; }\n\n.SectionItemView-module_creatingIndicator__1GnKq { }\n.SectionItemView-module_destroyingIndicator__HtKWF { }\n.SectionItemView-module_failedIndicator__1HVHn { }\n";
|
2808
|
-
var styles$o = {"selectionColor":"#1c86fe","selectionWidth":"3px","root":"SectionItemView-module_root__1Pp0d","active":"SectionItemView-module_active__1tLN5","thumbnailContainer":"SectionItemView-module_thumbnailContainer__1Xe7C","thumbnail":"SectionItemView-module_thumbnail__1ecBT","clickMask":"SectionItemView-module_clickMask__2JYEH","editLink":"SectionItemView-module_editLink__2mHqk","creating":"SectionItemView-module_creating__3Pjx9","creatingIndicator":"SectionItemView-module_creatingIndicator__1GnKq outline-module_creatingIndicator__3O7Rw outline-module_indicator__2dw_X icons-module_arrowsCcw__3_nrJ icons-module_icon__16IVx animations-module_blink__32C5j","destroying":"SectionItemView-module_destroying__1m53s","destroyingIndicator":"SectionItemView-module_destroyingIndicator__HtKWF outline-module_destroyingIndicator__2-mKh outline-module_indicator__2dw_X icons-module_trash__DH1EH icons-module_icon__16IVx animations-module_blink__32C5j","failed":"SectionItemView-module_failed__1CR2R","failedIndicator":"SectionItemView-module_failedIndicator__1HVHn outline-module_failedIndicator__2QK1F outline-module_indicator__2dw_X icons-module_attention__1sssG icons-module_icon__16IVx"};
|
2809
|
-
styleInject(css$F);
|
2810
|
-
|
2811
|
-
var _events;
|
2812
|
-
var SectionItemView = Marionette.ItemView.extend({
|
2813
|
-
tagName: 'li',
|
2814
|
-
className: styles$o.root,
|
2815
|
-
mixins: [modelLifecycleTrackingView({
|
2816
|
-
classNames: styles$o
|
2817
|
-
})],
|
2818
|
-
template: function template(data) {
|
2819
|
-
return "\n <div class=\"".concat(styles$o.thumbnailContainer, "\">\n <div class=\"").concat(styles$o.thumbnail, "\"></div>\n <div class=\"").concat(styles$o.clickMask, "\"></div>\n </div>\n <span class=\"").concat(styles$o.creatingIndicator, "\" />\n <span class=\"").concat(styles$o.destroyingIndicator, "\" />\n <span class=\"").concat(styles$o.failedIndicator, "\"\n title=\"").concat(I18n.t('pageflow_scrolled.editor.section_item.save_error'), "\" />\n <a href=\"\" class=\"").concat(styles$o.editLink, "\" title=\"").concat(I18n.t('pageflow_scrolled.editor.section_item.edit'), "\"></a>\n ");
|
2820
|
-
},
|
2821
|
-
ui: cssModulesUtils.ui(styles$o, 'thumbnail'),
|
2822
|
-
events: (_events = {}, _defineProperty(_events, "click .".concat(styles$o.clickMask), function click() {
|
2823
|
-
this.options.entry.trigger('scrollToSection', this.model);
|
2824
|
-
}), _defineProperty(_events, "click .".concat(styles$o.editLink), function click() {
|
2825
|
-
if (!this.model.isNew() && !this.model.isDestroying()) {
|
2826
|
-
this.options.entry.trigger('scrollToSection', this.model);
|
2827
|
-
editor.navigate("/scrolled/sections/".concat(this.model.id), {
|
2828
|
-
trigger: true
|
2829
|
-
});
|
2830
|
-
}
|
2831
|
-
|
2832
|
-
return false;
|
2833
|
-
}), _events),
|
2834
|
-
initialize: function initialize() {
|
2835
|
-
var _this = this;
|
2836
|
-
|
2837
|
-
this.listenTo(this.options.entry, 'change:currentSectionIndex', function () {
|
2838
|
-
var active = _this.options.entry.sections.indexOf(_this.model) === _this.options.entry.get('currentSectionIndex');
|
2839
|
-
|
2840
|
-
_this.$el.toggleClass(styles$o.active, active);
|
2841
|
-
|
2842
|
-
if (active) {
|
2843
|
-
_this.$el[0].scrollIntoView({
|
2844
|
-
block: 'nearest',
|
2845
|
-
behavior: 'smooth'
|
2846
|
-
});
|
2847
|
-
}
|
2848
|
-
});
|
2849
|
-
},
|
2850
|
-
onRender: function onRender() {
|
2851
|
-
var _this2 = this;
|
2852
|
-
|
2853
|
-
ReactDOM.render(React.createElement(SectionThumbnail, {
|
2854
|
-
sectionPermaId: this.model.get('permaId'),
|
2855
|
-
seed: this.options.entry.scrolledSeed,
|
2856
|
-
subscribe: function subscribe(dispatch) {
|
2857
|
-
return watchCollections(_this2.options.entry, {
|
2858
|
-
dispatch: dispatch
|
2859
|
-
});
|
2860
|
-
}
|
2861
|
-
}), this.ui.thumbnail[0]);
|
2862
|
-
}
|
2863
|
-
});
|
2864
|
-
|
2865
|
-
var css$G = ".icons-module_icon__16IVx::before {\n font-family: \"entypo\";\n}.icons-module_arrowsCcw__3_nrJ,\n.icons-module_attention__1sssG,\n.icons-module_plusCircled__20FlJ,\n.icons-module_rightOpen__9vsOG,\n.icons-module_trash__DH1EH {\n}.icons-module_arrowsCcw__3_nrJ::before {\n content: \"\\1F504\";\n}.icons-module_attention__1sssG::before {\n content: \"\\26A0\";\n}.icons-module_plusCircled__20FlJ::before {\n content: \"\\2795\";\n}.icons-module_rightOpen__9vsOG::before {\n content: \"\\E75E\"\n}.icons-module_trash__DH1EH::before {\n content: \"\\E729\";\n}@keyframes animations-module_blink__32C5j {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.3;\n }\n 100% {\n opacity: 1;\n }\n}.animations-module_blink__32C5j {\n animation: animations-module_blink__32C5j 1.5s ease infinite;\n}.outline-module_indicator__2dw_X {\n display: none;\n position: absolute;\n right: 14px;\n top: 7px;\n width: 30px;\n height: 30px;\n font-size: 19px;\n color: #888;\n}.outline-module_creatingIndicator__3O7Rw {\n}.outline-module_destroyingIndicator__2-mKh {\n}.outline-module_failedIndicator__2QK1F {\n color: #d00;\n}.buttons-module_iconButton__3ZSFV {\n /* see app/assets/stylesheets/pageflow/editor/composable.scss */\n}.buttons-module_addButton__2pN-g {\n}\n\n.ChapterItemView-module_root__19GIF {\n background-color: #fff;\n margin-bottom: 10px;\n padding: 0 10px 10px 10px;\n}\n\n.ChapterItemView-module_link__2dj_z {\n display: block;\n position: relative;\n margin: 0 -10px 0 -10px;\n padding: 10px 10px 10px 30px;\n background-color: #efefef;\n}\n\n.ChapterItemView-module_link__2dj_z::before {\n position: absolute;\n right: 7px;\n top: 7px;\n font-size: 19px;\n color: #888;\n}\n\n.ChapterItemView-module_number__1GjyC {\n font-weight: bold;\n}\n\n.ChapterItemView-module_title__3jVXE {}\n\n.ChapterItemView-module_sections__3zg2a {\n margin: 10px 0 10px 0;\n min-height: 20px;\n}\n\n.ChapterItemView-module_creating__c1q2b .ChapterItemView-module_creatingIndicator__2zOEN { display: block; }\n.ChapterItemView-module_destroying__2PP1l .ChapterItemView-module_destroyingIndicator__2YZaB { display: block; }\n.ChapterItemView-module_failed__2MtQW .ChapterItemView-module_failedIndicator__2s6Xk { display: block; }\n\n\n.ChapterItemView-module_creatingIndicator__2zOEN { }\n.ChapterItemView-module_destroyingIndicator__2YZaB { }\n.ChapterItemView-module_failedIndicator__2s6Xk { }\n\n.ChapterItemView-module_addSection__3XQvI {\n}\n";
|
2866
|
-
var styles$p = {"indicatorIconColor":"#888","root":"ChapterItemView-module_root__19GIF","link":"ChapterItemView-module_link__2dj_z icons-module_rightOpen__9vsOG icons-module_icon__16IVx","number":"ChapterItemView-module_number__1GjyC","title":"ChapterItemView-module_title__3jVXE","sections":"ChapterItemView-module_sections__3zg2a","creating":"ChapterItemView-module_creating__c1q2b","creatingIndicator":"ChapterItemView-module_creatingIndicator__2zOEN outline-module_creatingIndicator__3O7Rw outline-module_indicator__2dw_X icons-module_arrowsCcw__3_nrJ icons-module_icon__16IVx animations-module_blink__32C5j","destroying":"ChapterItemView-module_destroying__2PP1l","destroyingIndicator":"ChapterItemView-module_destroyingIndicator__2YZaB outline-module_destroyingIndicator__2-mKh outline-module_indicator__2dw_X icons-module_trash__DH1EH icons-module_icon__16IVx animations-module_blink__32C5j","failed":"ChapterItemView-module_failed__2MtQW","failedIndicator":"ChapterItemView-module_failedIndicator__2s6Xk outline-module_failedIndicator__2QK1F outline-module_indicator__2dw_X icons-module_attention__1sssG icons-module_icon__16IVx","addSection":"ChapterItemView-module_addSection__3XQvI buttons-module_addButton__2pN-g buttons-module_iconButton__3ZSFV icon_button icons-module_plusCircled__20FlJ icons-module_icon__16IVx"};
|
2867
|
-
styleInject(css$G);
|
2868
|
-
|
2869
|
-
var ChapterItemView = Marionette.Layout.extend({
|
2870
|
-
tagName: 'li',
|
2871
|
-
className: styles$p.root,
|
2872
|
-
mixins: [modelLifecycleTrackingView({
|
2873
|
-
classNames: styles$p
|
2874
|
-
})],
|
2875
|
-
template: function template() {
|
2876
|
-
return "\n <a class=\"".concat(styles$p.link, "\" href=\"\">\n <span class=\"").concat(styles$p.number, "\"></span>\n <span class=\"").concat(styles$p.title, "\"></span>\n <span class=\"").concat(styles$p.creatingIndicator, "\" />\n <span class=\"").concat(styles$p.destroyingIndicator, "\" />\n <span class=\"").concat(styles$p.failedIndicator, "\"\n title=\"").concat(I18n.t('pageflow_scrolled.editor.chapter_item.save_error'), "\" />\n </a>\n\n <ul class=\"").concat(styles$p.sections, "\"></ul>\n\n <a href=\"\" class=\"").concat(styles$p.addSection, "\">").concat(I18n.t('pageflow_scrolled.editor.chapter_item.add_section'), "</a>\n ");
|
2877
|
-
},
|
2878
|
-
ui: cssModulesUtils.ui(styles$p, 'title', 'number', 'sections'),
|
2879
|
-
events: cssModulesUtils.events(styles$p, {
|
2880
|
-
'click addSection': function clickAddSection() {
|
2881
|
-
this.model.addSection();
|
2882
|
-
},
|
2883
|
-
'click link': function clickLink() {
|
2884
|
-
if (!this.model.isNew() && !this.model.isDestroying()) {
|
2885
|
-
editor.navigate('/scrolled/chapters/' + this.model.get('id'), {
|
2886
|
-
trigger: true
|
2887
|
-
});
|
2888
|
-
}
|
2889
|
-
|
2890
|
-
return false;
|
2891
|
-
}
|
2892
|
-
}),
|
2893
|
-
modelEvents: {
|
2894
|
-
change: 'update'
|
2895
|
-
},
|
2896
|
-
onRender: function onRender() {
|
2897
|
-
this.subview(new SortableCollectionView({
|
2898
|
-
el: this.ui.sections,
|
2899
|
-
collection: this.model.sections,
|
2900
|
-
itemViewConstructor: SectionItemView,
|
2901
|
-
itemViewOptions: {
|
2902
|
-
entry: this.options.entry
|
2903
|
-
},
|
2904
|
-
connectWith: cssModulesUtils.selector(styles$p, 'sections')
|
602
|
+
connectWith: cssModulesUtils.selector(styles$1, 'sections')
|
2905
603
|
}));
|
2906
604
|
this.update();
|
2907
605
|
},
|
@@ -2911,18 +609,18 @@ var ChapterItemView = Marionette.Layout.extend({
|
|
2911
609
|
}
|
2912
610
|
});
|
2913
611
|
|
2914
|
-
var css$
|
2915
|
-
var styles$
|
2916
|
-
styleInject(css$
|
612
|
+
var css$2 = ".icons-module_icon__16IVx::before {\n font-family: \"entypo\";\n}.icons-module_arrowsCcw__3_nrJ,\n.icons-module_attention__1sssG,\n.icons-module_plusCircled__20FlJ,\n.icons-module_rightOpen__9vsOG,\n.icons-module_trash__DH1EH {\n}.icons-module_arrowsCcw__3_nrJ::before {\n content: \"\\1F504\";\n}.icons-module_attention__1sssG::before {\n content: \"\\26A0\";\n}.icons-module_plusCircled__20FlJ::before {\n content: \"\\2795\";\n}.icons-module_rightOpen__9vsOG::before {\n content: \"\\E75E\"\n}.icons-module_trash__DH1EH::before {\n content: \"\\E729\";\n}.buttons-module_iconButton__3ZSFV {\n /* see app/assets/stylesheets/pageflow/editor/composable.scss */\n}.buttons-module_addButton__2pN-g {\n}\n\n.EntryOutlineView-module_root__3NBUB {}\n\n.EntryOutlineView-module_chapters__3Gr1l {}\n\n.EntryOutlineView-module_addChapter__3_M-b {\n}\n";
|
613
|
+
var styles$2 = {"root":"EntryOutlineView-module_root__3NBUB","chapters":"EntryOutlineView-module_chapters__3Gr1l","addChapter":"EntryOutlineView-module_addChapter__3_M-b buttons-module_addButton__2pN-g buttons-module_iconButton__3ZSFV icon_button icons-module_plusCircled__20FlJ icons-module_icon__16IVx"};
|
614
|
+
styleInject(css$2);
|
2917
615
|
|
2918
616
|
var EntryOutlineView = Marionette.Layout.extend({
|
2919
617
|
tagName: 'nav',
|
2920
|
-
className: styles$
|
618
|
+
className: styles$2.root,
|
2921
619
|
template: function template() {
|
2922
|
-
return "\n <h2>".concat(I18n.t('pageflow_scrolled.editor.entry_outline.header'), "</h2>\n <ul class=\"").concat(styles$
|
620
|
+
return "\n <h2>".concat(I18n.t('pageflow_scrolled.editor.entry_outline.header'), "</h2>\n <ul class=\"").concat(styles$2.chapters, "\"></ul>\n\n <a class=\"").concat(styles$2.addChapter, "\" href=\"\">\n ").concat(I18n.t('pageflow_scrolled.editor.entry_outline.add_chapter'), "\n </a>\n ");
|
2923
621
|
},
|
2924
|
-
ui: cssModulesUtils.ui(styles$
|
2925
|
-
events: cssModulesUtils.events(styles$
|
622
|
+
ui: cssModulesUtils.ui(styles$2, 'chapters'),
|
623
|
+
events: cssModulesUtils.events(styles$2, {
|
2926
624
|
'click addChapter': function clickAddChapter() {
|
2927
625
|
this.options.entry.addChapter();
|
2928
626
|
}
|
@@ -2939,16 +637,16 @@ var EntryOutlineView = Marionette.Layout.extend({
|
|
2939
637
|
}
|
2940
638
|
});
|
2941
639
|
|
2942
|
-
var css$
|
2943
|
-
var styles$
|
2944
|
-
styleInject(css$
|
640
|
+
var css$3 = ".EntryPreviewView-module_root__1Nb6e {\n height: 100%;\n}\n\n.EntryPreviewView-module_iframe__1leJC {\n border: none;\n width: 100%;\n height: 100%;\n}\n";
|
641
|
+
var styles$3 = {"root":"EntryPreviewView-module_root__1Nb6e","iframe":"EntryPreviewView-module_iframe__1leJC"};
|
642
|
+
styleInject(css$3);
|
2945
643
|
|
2946
644
|
var EntryPreviewView = Marionette.ItemView.extend({
|
2947
645
|
template: function template() {
|
2948
|
-
return "\n <iframe class=\"".concat(styles$
|
646
|
+
return "\n <iframe class=\"".concat(styles$3.iframe, "\" />\n ");
|
2949
647
|
},
|
2950
|
-
className: styles$
|
2951
|
-
ui: cssModulesUtils.ui(styles$
|
648
|
+
className: styles$3.root,
|
649
|
+
ui: cssModulesUtils.ui(styles$3, 'iframe'),
|
2952
650
|
initialize: function initialize() {
|
2953
651
|
this.messageListener = this.onMessage.bind(this);
|
2954
652
|
},
|
@@ -2984,8 +682,42 @@ var EntryPreviewView = Marionette.ItemView.extend({
|
|
2984
682
|
}
|
2985
683
|
});
|
2986
684
|
});
|
685
|
+
this.listenTo(this.model, 'selectContentElement', function (contentElement) {
|
686
|
+
return postMessage({
|
687
|
+
type: 'SELECT',
|
688
|
+
payload: {
|
689
|
+
id: contentElement.id,
|
690
|
+
type: 'contentElement'
|
691
|
+
}
|
692
|
+
});
|
693
|
+
});
|
694
|
+
this.listenTo(this.model, 'resetSelection', function (contentElement) {
|
695
|
+
return postMessage({
|
696
|
+
type: 'SELECT',
|
697
|
+
payload: null
|
698
|
+
});
|
699
|
+
});
|
2987
700
|
} else if (message.data.type === 'CHANGE_SECTION') {
|
2988
701
|
this.model.set('currentSectionIndex', message.data.payload.index);
|
702
|
+
} else if (message.data.type === 'SELECTED') {
|
703
|
+
var _message$data$payload = message.data.payload,
|
704
|
+
id = _message$data$payload.id,
|
705
|
+
type = _message$data$payload.type;
|
706
|
+
var editor = this.options.editor;
|
707
|
+
|
708
|
+
if (type === 'contentElement') {
|
709
|
+
editor.navigate("/scrolled/content_elements/".concat(id), {
|
710
|
+
trigger: true
|
711
|
+
});
|
712
|
+
} else if (type === 'before' || type === 'after') {
|
713
|
+
editor.navigate("/scrolled/content_elements/insert?position=".concat(type, "&id=").concat(id), {
|
714
|
+
trigger: true
|
715
|
+
});
|
716
|
+
} else {
|
717
|
+
editor.navigate('/', {
|
718
|
+
trigger: true
|
719
|
+
});
|
720
|
+
}
|
2989
721
|
}
|
2990
722
|
}
|
2991
723
|
}
|
@@ -3002,10 +734,24 @@ function unescape(text) {
|
|
3002
734
|
return text.replace(/<\\\//g, '</');
|
3003
735
|
}
|
3004
736
|
|
737
|
+
ConfigurationEditorTabView.groups.define('ContentElementPosition', function () {
|
738
|
+
this.input('position', SelectInputView, {
|
739
|
+
attributeTranslationKeyPrefixes: ['pageflow_scrolled.editor.common_content_element_attributes'],
|
740
|
+
values: ['inline', 'sticky', 'full']
|
741
|
+
});
|
742
|
+
});
|
743
|
+
ConfigurationEditorTabView.groups.define('ContentElementCaption', function () {
|
744
|
+
this.input('caption', TextInputView, {
|
745
|
+
attributeTranslationKeyPrefixes: ['pageflow_scrolled.editor.common_content_element_attributes']
|
746
|
+
});
|
747
|
+
});
|
748
|
+
|
3005
749
|
var SideBarRouter = Marionette.AppRouter.extend({
|
3006
750
|
appRoutes: {
|
3007
751
|
'scrolled/chapters/:id': 'chapter',
|
3008
|
-
'scrolled/sections/:id': 'section'
|
752
|
+
'scrolled/sections/:id': 'section',
|
753
|
+
'scrolled/content_elements/insert?position=:position&id=:id': 'insertContentElement',
|
754
|
+
'scrolled/content_elements/:id': 'contentElement'
|
3009
755
|
}
|
3010
756
|
});
|
3011
757
|
|
@@ -3025,9 +771,15 @@ var EditSectionView = EditConfigurationView.extend({
|
|
3025
771
|
translationKeyPrefix: 'pageflow_scrolled.editor.edit_section',
|
3026
772
|
configure: function configure(configurationEditor) {
|
3027
773
|
configurationEditor.tab('section', function () {
|
774
|
+
this.input('transition', SelectInputView, {
|
775
|
+
values: ['beforeAfter', 'fade', 'fadeBg', 'reveal', 'scroll', 'scrollOver']
|
776
|
+
});
|
3028
777
|
this.input('layout', SelectInputView, {
|
3029
778
|
values: ['left', 'right', 'center']
|
3030
779
|
});
|
780
|
+
this.input('appearance', SelectInputView, {
|
781
|
+
values: ['shadow', 'cards', 'transparent']
|
782
|
+
});
|
3031
783
|
this.input('backdropType', SelectInputView, {
|
3032
784
|
values: ['image', 'color'],
|
3033
785
|
texts: ['Bild', 'Farbe']
|
@@ -3042,11 +794,69 @@ var EditSectionView = EditConfigurationView.extend({
|
|
3042
794
|
visibleBinding: 'backdropType',
|
3043
795
|
visibleBindingValue: 'color'
|
3044
796
|
});
|
797
|
+
this.input('fullHeight', CheckBoxInputView);
|
3045
798
|
this.input('invert', CheckBoxInputView);
|
3046
799
|
});
|
3047
800
|
}
|
3048
801
|
});
|
3049
802
|
|
803
|
+
var EditContentElementView = EditConfigurationView.extend({
|
804
|
+
translationKeyPrefix: function translationKeyPrefix() {
|
805
|
+
return "pageflow_scrolled.editor.content_elements.".concat(this.model.get('typeName'));
|
806
|
+
},
|
807
|
+
configure: function configure(configurationEditor) {
|
808
|
+
this.options.editor.contentElementTypes.setupConfigurationEditor(this.model.get('typeName'), configurationEditor);
|
809
|
+
}
|
810
|
+
});
|
811
|
+
|
812
|
+
var css$4 = ".InsertContentElementView-module_item__1EIxA a {\n display: block;\n padding: 10px;\n margin-bottom: 2px;\n background-color: #efefef;\n}\n";
|
813
|
+
var styles$4 = {"item":"InsertContentElementView-module_item__1EIxA"};
|
814
|
+
styleInject(css$4);
|
815
|
+
|
816
|
+
var InsertContentElementView = Marionette.ItemView.extend({
|
817
|
+
template: function template() {
|
818
|
+
return "\n <h2>".concat(I18n.t('pageflow_scrolled.editor.insert_content_element.header'), "</h2>\n <ul></ul>\n ");
|
819
|
+
},
|
820
|
+
ui: {
|
821
|
+
items: 'ul'
|
822
|
+
},
|
823
|
+
onRender: function onRender() {
|
824
|
+
this.subview(new CollectionView({
|
825
|
+
el: this.ui.items,
|
826
|
+
collection: new Backbone$1.Collection(this.options.editor.contentElementTypes.toArray()),
|
827
|
+
itemViewConstructor: ItemView,
|
828
|
+
itemViewOptions: {
|
829
|
+
entry: this.options.entry,
|
830
|
+
insertOptions: this.options.insertOptions
|
831
|
+
}
|
832
|
+
}));
|
833
|
+
},
|
834
|
+
onGoBack: function onGoBack() {
|
835
|
+
this.options.entry.trigger('resetSelection');
|
836
|
+
}
|
837
|
+
});
|
838
|
+
var ItemView = Marionette.ItemView.extend({
|
839
|
+
tagName: 'li',
|
840
|
+
className: styles$4.item,
|
841
|
+
template: function template(_ref) {
|
842
|
+
var displayName = _ref.displayName;
|
843
|
+
return "\n <a href=\"\">".concat(displayName, "</a>\n ");
|
844
|
+
},
|
845
|
+
events: {
|
846
|
+
'click a': function clickA() {
|
847
|
+
this.options.entry.insertContentElement({
|
848
|
+
typeName: this.model.get('typeName')
|
849
|
+
}, this.options.insertOptions, this.model.get('defaultConfig'));
|
850
|
+
}
|
851
|
+
}
|
852
|
+
});
|
853
|
+
|
854
|
+
InsertContentElementView.create = function (options) {
|
855
|
+
return new BackButtonDecoratorView({
|
856
|
+
view: new InsertContentElementView(options)
|
857
|
+
});
|
858
|
+
};
|
859
|
+
|
3050
860
|
var SideBarController = Marionette.Controller.extend({
|
3051
861
|
initialize: function initialize(options) {
|
3052
862
|
this.region = options.region;
|
@@ -3056,26 +866,153 @@ var SideBarController = Marionette.Controller.extend({
|
|
3056
866
|
this.region.show(new EditChapterView({
|
3057
867
|
entry: this.entry,
|
3058
868
|
model: this.entry.chapters.get(id),
|
3059
|
-
|
869
|
+
editor: editor$2
|
3060
870
|
}));
|
3061
871
|
},
|
3062
872
|
section: function section(id, tab) {
|
3063
873
|
this.region.show(new EditSectionView({
|
3064
874
|
entry: this.entry,
|
3065
875
|
model: this.entry.sections.get(id),
|
3066
|
-
|
876
|
+
editor: editor$2
|
877
|
+
}));
|
878
|
+
},
|
879
|
+
contentElement: function contentElement(id, tab) {
|
880
|
+
this.region.show(new EditContentElementView({
|
881
|
+
entry: this.entry,
|
882
|
+
model: this.entry.contentElements.get(id),
|
883
|
+
editor: editor$2
|
884
|
+
}));
|
885
|
+
},
|
886
|
+
insertContentElement: function insertContentElement(position, id) {
|
887
|
+
this.region.show(InsertContentElementView.create({
|
888
|
+
entry: this.entry,
|
889
|
+
insertOptions: {
|
890
|
+
position: position,
|
891
|
+
id: id
|
892
|
+
},
|
893
|
+
editor: editor$2
|
3067
894
|
}));
|
3068
895
|
}
|
3069
896
|
});
|
3070
897
|
|
3071
|
-
|
898
|
+
function _classCallCheck(instance, Constructor) {
|
899
|
+
if (!(instance instanceof Constructor)) {
|
900
|
+
throw new TypeError("Cannot call a class as a function");
|
901
|
+
}
|
902
|
+
}
|
903
|
+
|
904
|
+
function _defineProperties(target, props) {
|
905
|
+
for (var i = 0; i < props.length; i++) {
|
906
|
+
var descriptor = props[i];
|
907
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
908
|
+
descriptor.configurable = true;
|
909
|
+
if ("value" in descriptor) descriptor.writable = true;
|
910
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
911
|
+
}
|
912
|
+
}
|
913
|
+
|
914
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
915
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
916
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
917
|
+
return Constructor;
|
918
|
+
}
|
919
|
+
|
920
|
+
/**
|
921
|
+
* Integrate new content types into the editor.
|
922
|
+
* @name editor_contentElementTypes
|
923
|
+
*/
|
924
|
+
|
925
|
+
var ContentElementTypeRegistry =
|
926
|
+
/*#__PURE__*/
|
927
|
+
function () {
|
928
|
+
function ContentElementTypeRegistry() {
|
929
|
+
_classCallCheck(this, ContentElementTypeRegistry);
|
930
|
+
|
931
|
+
this.contentElementTypes = {};
|
932
|
+
}
|
933
|
+
/**
|
934
|
+
* Register a new type of content element in the editor.
|
935
|
+
*
|
936
|
+
* @param {string} typeName - Name of the content element type.
|
937
|
+
* @param {Object} options
|
938
|
+
* @param {Function} options.configurationEditor -
|
939
|
+
* Function that is evaluated in the context of a
|
940
|
+
* `ConfigurationEditorView` (see `pageflow/ui`) which will
|
941
|
+
* be used to edit the configuration of content elements of
|
942
|
+
* this type.
|
943
|
+
* @param {Object} options.defaultConfig -
|
944
|
+
* Object that is set as initial config for the content element.
|
945
|
+
* @memberof editor_contentElementTypes
|
946
|
+
*
|
947
|
+
* @example
|
948
|
+
*
|
949
|
+
* // editor.js
|
950
|
+
* editor.contentElementTypes.register('inlineImage', {
|
951
|
+
* configurationEditor() {
|
952
|
+
* this.tab('general', function() {
|
953
|
+
* this.input('caption', TextInputView);
|
954
|
+
* });
|
955
|
+
* }
|
956
|
+
* });
|
957
|
+
*/
|
958
|
+
|
959
|
+
|
960
|
+
_createClass(ContentElementTypeRegistry, [{
|
961
|
+
key: "register",
|
962
|
+
value: function register(typeName, options) {
|
963
|
+
this.contentElementTypes[typeName] = options;
|
964
|
+
}
|
965
|
+
}, {
|
966
|
+
key: "setupConfigurationEditor",
|
967
|
+
value: function setupConfigurationEditor(name, configurationEditorView, options) {
|
968
|
+
if (!this.contentElementTypes[name]) {
|
969
|
+
throw new Error("Unknown content element type ".concat(name));
|
970
|
+
}
|
971
|
+
|
972
|
+
return this.contentElementTypes[name].configurationEditor.call(configurationEditorView, options);
|
973
|
+
}
|
974
|
+
}, {
|
975
|
+
key: "toArray",
|
976
|
+
value: function toArray() {
|
977
|
+
var _this = this;
|
978
|
+
|
979
|
+
return Object.keys(this.contentElementTypes).map(function (typeName) {
|
980
|
+
return {
|
981
|
+
typeName: typeName,
|
982
|
+
displayName: I18n.t("pageflow_scrolled.editor.content_elements.".concat(typeName, ".name")),
|
983
|
+
defaultConfig: _this.contentElementTypes[typeName].defaultConfig
|
984
|
+
};
|
985
|
+
});
|
986
|
+
}
|
987
|
+
}]);
|
988
|
+
|
989
|
+
return ContentElementTypeRegistry;
|
990
|
+
}();
|
991
|
+
|
992
|
+
function extend(api) {
|
993
|
+
return Object.assign(api, {
|
994
|
+
contentElementTypes: new ContentElementTypeRegistry()
|
995
|
+
});
|
996
|
+
}
|
997
|
+
var editor = extend(editor$1);
|
998
|
+
|
999
|
+
function ownKeys$2(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; }
|
1000
|
+
|
1001
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
3072
1002
|
Object.assign(pageflow, globalInterop);
|
3073
|
-
|
1003
|
+
editor.registerEntryType('scrolled', {
|
3074
1004
|
entryModel: ScrolledEntry,
|
3075
|
-
previewView:
|
1005
|
+
previewView: function previewView(options) {
|
1006
|
+
return new EntryPreviewView(_objectSpread$2({}, options, {
|
1007
|
+
editor: editor
|
1008
|
+
}));
|
1009
|
+
},
|
3076
1010
|
outlineView: EntryOutlineView
|
3077
1011
|
});
|
3078
|
-
|
1012
|
+
editor.registerSideBarRouting({
|
3079
1013
|
router: SideBarRouter,
|
3080
1014
|
controller: SideBarController
|
3081
1015
|
});
|
1016
|
+
editor.registerFileSelectionHandler('contentElementConfiguration', ContentElementFileSelectionHandler);
|
1017
|
+
|
1018
|
+
export { editor };
|