pageflow 15.2.2 → 15.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pageflow might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +338 -85
- data/admins/pageflow/accounts.rb +1 -98
- data/admins/pageflow/entry.rb +21 -1
- data/admins/pageflow/entry_templates.rb +140 -0
- data/admins/pageflow/membership.rb +12 -0
- data/admins/pageflow/user.rb +5 -3
- data/app/assets/javascripts/pageflow/admin/entries.js +65 -0
- data/app/assets/javascripts/pageflow/admin/users.js +1 -1
- data/app/assets/javascripts/pageflow/asset_urls.js.erb +1 -0
- data/app/assets/javascripts/pageflow/base.js +0 -12
- data/app/assets/javascripts/pageflow/components.js +2 -6
- data/app/assets/javascripts/pageflow/dist/ui.js +47 -14
- data/app/assets/javascripts/pageflow/vendor.js +13 -10
- data/app/assets/stylesheets/pageflow/base.scss +0 -7
- data/app/assets/stylesheets/pageflow/editor/base.scss +2 -0
- data/app/assets/stylesheets/pageflow/editor/composables.scss +5 -1
- data/app/assets/stylesheets/pageflow/editor/emulation_mode_button.scss +44 -55
- data/app/assets/stylesheets/pageflow/editor/help.scss +2 -2
- data/app/assets/stylesheets/pageflow/ui/tooltip.scss +17 -3
- data/app/helpers/pageflow/admin/entries_helper.rb +16 -0
- data/app/helpers/pageflow/structured_data_helper.rb +0 -2
- data/app/models/pageflow/account.rb +21 -1
- data/app/models/pageflow/entry.rb +9 -2
- data/app/models/pageflow/entry_duplicate.rb +1 -0
- data/app/models/pageflow/entry_template.rb +16 -2
- data/app/policies/pageflow/account_policy.rb +10 -0
- data/app/policies/pageflow/entry_template_policy.rb +5 -1
- data/app/views/admin/accounts/_entry_template_details.html.arb +7 -5
- data/app/views/admin/accounts/_form.html.erb +3 -49
- data/app/views/admin/entries/_attributes_table.html.arb +5 -0
- data/app/views/admin/entries/_not_allowed_to_see_entry_types.json.jbuilder +2 -0
- data/app/views/admin/entries/entry_types.json.jbuilder +4 -0
- data/app/views/admin/entry_templates/_form.html.erb +58 -0
- data/app/views/admin/users/_not_allowed_to_see_user_quota.html.erb +3 -0
- data/app/views/components/pageflow/admin/entry_templates_tab.rb +48 -0
- data/app/views/pageflow/admin/users/_quota_exhausted.html.erb +1 -1
- data/config/initializers/admin_resource_tabs.rb +5 -0
- data/config/initializers/help_entries.rb +1 -5
- data/config/locales/de.yml +88 -155
- data/config/locales/en.yml +79 -143
- data/db/migrate/20200515112500_add_constraints_to_entry_templates.rb +21 -0
- data/db/migrate/20200807135200_rename_pageflow_entry_template_entry_type_to_entry_type_name.rb +7 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/components.js +7 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +1479 -1391
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +9218 -0
- data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-client.js +1 -1
- data/{app/assets/javascripts/pageflow → entry_types/paged/app/assets/javascripts/pageflow_paged}/dist/react-server.js +3 -3
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/frontend.js +6 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/server_rendering.js +9 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/vendor.js +8 -0
- data/entry_types/paged/app/controllers/pageflow_paged/application_controller.rb +2 -2
- data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/page_background_asset_helper.rb +4 -3
- data/{app/helpers/pageflow → entry_types/paged/app/helpers/pageflow_paged}/react_server_side_rendering_helper.rb +23 -2
- data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +2 -2
- data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +2 -2
- data/entry_types/paged/app/views/pageflow_paged/entries/_entry.html.erb +1 -1
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/page_background_asset/_element.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/_widget.html.erb +0 -0
- data/{app/views/pageflow → entry_types/paged/app/views/pageflow_paged}/react/page.html.erb +0 -0
- data/entry_types/paged/config/initializers/features.rb +1 -1
- data/entry_types/paged/config/initializers/help_entries.rb +17 -0
- data/entry_types/paged/config/locales/new/help.de.yml +162 -0
- data/entry_types/paged/config/locales/new/help.en.yml +153 -0
- data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -0
- data/entry_types/paged/lib/pageflow_paged/plugin.rb +5 -1
- data/entry_types/paged/lib/pageflow_paged/react.rb +12 -0
- data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/page_type.rb +2 -2
- data/{lib/pageflow → entry_types/paged/lib/pageflow_paged}/react/widget_type.rb +2 -2
- data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react-server.js +20613 -0
- data/entry_types/paged/vendor/assets/javascripts/development/pageflow_paged/vendor/react.js +21495 -0
- data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react-server.js +24 -0
- data/entry_types/paged/vendor/assets/javascripts/production/pageflow_paged/vendor/react.js +24 -0
- data/entry_types/scrolled/app/assets/javascripts/pageflow_scrolled/legacy.js +0 -0
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +14 -4
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +8 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +6 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/entry_json_seed_helper.rb +2 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +33 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +8 -0
- data/entry_types/scrolled/app/models/pageflow_scrolled/content_element.rb +38 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/content_elements/batch.json.jbuilder +2 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -7
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +19 -3
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +3 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +7 -0
- data/entry_types/scrolled/config/initializers/help_entries.rb +16 -0
- data/entry_types/scrolled/config/locales/new/de.yml +345 -13
- data/entry_types/scrolled/config/locales/new/en.yml +257 -14
- data/entry_types/scrolled/config/routes.rb +1 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +28 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoDesktop.svg +56 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/logoMobile.svg +22 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +4 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +3 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/seeds.rb +90 -30
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +64 -27
- data/entry_types/scrolled/package/contentElements-editor.js +242 -183
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -0
- data/entry_types/scrolled/package/contentElements-frontend.js +624 -279
- data/entry_types/scrolled/package/editor.js +2561 -363
- data/entry_types/scrolled/package/frontend-server.js +228 -0
- data/entry_types/scrolled/package/frontend/EditableText-4264c349.js +1993 -0
- data/entry_types/scrolled/package/frontend/Wavesurfer-c3c45324.js +378 -0
- data/entry_types/scrolled/package/frontend/components-cfe6a479.js +2115 -0
- data/entry_types/scrolled/package/frontend/getPrototypeOf-63c7c8e8.js +86 -0
- data/entry_types/scrolled/package/frontend/index.css +9 -0
- data/entry_types/scrolled/package/frontend/index.js +4425 -0
- data/entry_types/scrolled/package/package.json +17 -6
- data/entry_types/scrolled/spec/fixtures/audio.m4a +0 -0
- data/entry_types/scrolled/spec/fixtures/video.mp4 +0 -0
- data/lib/generators/pageflow/initializer/templates/pageflow.rb +20 -9
- data/lib/pageflow/ability_mixin.rb +14 -2
- data/lib/pageflow/configuration.rb +6 -5
- data/lib/pageflow/engine.rb +1 -0
- data/lib/pageflow/entry_type_configuration.rb +1 -0
- data/lib/pageflow/global_config_api.rb +5 -4
- data/lib/pageflow/react.rb +4 -2
- data/lib/pageflow/version.rb +1 -1
- data/{packages/pageflow → package}/config/jest/index.js +2 -1
- data/{packages/pageflow → package}/config/jest/transformers/jst.js +0 -0
- data/{packages/pageflow → package}/config/jest/transformers/upwardBabel.js +0 -0
- data/package/config/webpack.js +22 -0
- data/{packages/pageflow → package}/editor.js +480 -1129
- data/package/frontend.js +2525 -0
- data/{packages/pageflow → package}/package.json +3 -0
- data/{packages/pageflow → package}/testHelpers.js +114 -13
- data/{packages/pageflow → package}/ui.js +47 -14
- data/spec/factories/accounts.rb +3 -1
- data/spec/factories/entry_templates.rb +1 -0
- data/spec/factories/published_entries.rb +6 -1
- metadata +62 -26
- data/app/assets/javascripts/pageflow/dist/frontend.js +0 -5800
- data/config/initializers/entry_types.rb +0 -4
- data/entry_types/scrolled/package/frontend.js +0 -2879
- data/packages/pageflow/config/jest/transformers/cssModules.js +0 -1
- data/packages/pageflow/config/webpack.js +0 -14
@@ -1,2879 +0,0 @@
|
|
1
|
-
import React, { useRef, useLayoutEffect, useEffect, useReducer, useMemo, useContext, useState, useCallback } from 'react';
|
2
|
-
import ReactDOM from 'react-dom';
|
3
|
-
import classNames from 'classnames';
|
4
|
-
import ReactTooltip from 'react-tooltip';
|
5
|
-
import I18n from 'i18n-js';
|
6
|
-
|
7
|
-
function _defineProperty(obj, key, value) {
|
8
|
-
if (key in obj) {
|
9
|
-
Object.defineProperty(obj, key, {
|
10
|
-
value: value,
|
11
|
-
enumerable: true,
|
12
|
-
configurable: true,
|
13
|
-
writable: true
|
14
|
-
});
|
15
|
-
} else {
|
16
|
-
obj[key] = value;
|
17
|
-
}
|
18
|
-
|
19
|
-
return obj;
|
20
|
-
}
|
21
|
-
|
22
|
-
function _arrayWithHoles(arr) {
|
23
|
-
if (Array.isArray(arr)) return arr;
|
24
|
-
}
|
25
|
-
|
26
|
-
function _iterableToArrayLimit(arr, i) {
|
27
|
-
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
|
28
|
-
return;
|
29
|
-
}
|
30
|
-
|
31
|
-
var _arr = [];
|
32
|
-
var _n = true;
|
33
|
-
var _d = false;
|
34
|
-
var _e = undefined;
|
35
|
-
|
36
|
-
try {
|
37
|
-
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
38
|
-
_arr.push(_s.value);
|
39
|
-
|
40
|
-
if (i && _arr.length === i) break;
|
41
|
-
}
|
42
|
-
} catch (err) {
|
43
|
-
_d = true;
|
44
|
-
_e = err;
|
45
|
-
} finally {
|
46
|
-
try {
|
47
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
48
|
-
} finally {
|
49
|
-
if (_d) throw _e;
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
return _arr;
|
54
|
-
}
|
55
|
-
|
56
|
-
function _nonIterableRest() {
|
57
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
58
|
-
}
|
59
|
-
|
60
|
-
function _slicedToArray(arr, i) {
|
61
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
62
|
-
}
|
63
|
-
|
64
|
-
// from https://github.com/n8tb1t/use-scroll-position
|
65
|
-
var isBrowser = typeof window !== "undefined";
|
66
|
-
|
67
|
-
function getScrollPosition(_ref) {
|
68
|
-
var element = _ref.element,
|
69
|
-
useWindow = _ref.useWindow;
|
70
|
-
if (!isBrowser) return {
|
71
|
-
x: 0,
|
72
|
-
y: 0
|
73
|
-
};
|
74
|
-
var target = element ? element.current : document.body;
|
75
|
-
var position = target.getBoundingClientRect();
|
76
|
-
return useWindow ? {
|
77
|
-
x: window.scrollX,
|
78
|
-
y: window.scrollY
|
79
|
-
} : {
|
80
|
-
x: position.left,
|
81
|
-
y: position.top
|
82
|
-
};
|
83
|
-
}
|
84
|
-
|
85
|
-
function useScrollPosition(effect, deps, element, useWindow, wait) {
|
86
|
-
var position = useRef(getScrollPosition({
|
87
|
-
useWindow: useWindow
|
88
|
-
}));
|
89
|
-
var throttleTimeout = null;
|
90
|
-
|
91
|
-
var callBack = function callBack() {
|
92
|
-
var currPos = getScrollPosition({
|
93
|
-
element: element,
|
94
|
-
useWindow: useWindow
|
95
|
-
});
|
96
|
-
effect({
|
97
|
-
prevPos: position.current,
|
98
|
-
currPos: currPos
|
99
|
-
});
|
100
|
-
position.current = currPos;
|
101
|
-
throttleTimeout = null;
|
102
|
-
};
|
103
|
-
|
104
|
-
useLayoutEffect(function () {
|
105
|
-
if (!isBrowser) {
|
106
|
-
return;
|
107
|
-
}
|
108
|
-
|
109
|
-
var handleScroll = function handleScroll() {
|
110
|
-
if (wait) {
|
111
|
-
if (throttleTimeout === null) {
|
112
|
-
// Todo: store in useRef hook?
|
113
|
-
throttleTimeout = setTimeout(callBack, wait);
|
114
|
-
}
|
115
|
-
} else {
|
116
|
-
callBack();
|
117
|
-
}
|
118
|
-
};
|
119
|
-
|
120
|
-
window.addEventListener('scroll', handleScroll);
|
121
|
-
return function () {
|
122
|
-
return window.removeEventListener('scroll', handleScroll);
|
123
|
-
};
|
124
|
-
}, deps);
|
125
|
-
}
|
126
|
-
useScrollPosition.defaultProps = {
|
127
|
-
deps: [],
|
128
|
-
element: false,
|
129
|
-
useWindow: false,
|
130
|
-
wait: null
|
131
|
-
};
|
132
|
-
|
133
|
-
function useNativeScrollPrevention(ref) {
|
134
|
-
useEffect(function () {
|
135
|
-
function preventNativeScroll(e) {
|
136
|
-
e.preventDefault();
|
137
|
-
}
|
138
|
-
|
139
|
-
var current = ref.current;
|
140
|
-
|
141
|
-
if (current) {
|
142
|
-
current.addEventListener('touchmove', preventNativeScroll);
|
143
|
-
current.addEventListener('mousewheel', preventNativeScroll);
|
144
|
-
}
|
145
|
-
|
146
|
-
return function () {
|
147
|
-
if (current) {
|
148
|
-
current.removeEventListener('touchmove', preventNativeScroll);
|
149
|
-
current.removeEventListener('mousewheel', preventNativeScroll);
|
150
|
-
}
|
151
|
-
};
|
152
|
-
}, [ref]);
|
153
|
-
}
|
154
|
-
|
155
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
156
|
-
|
157
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
158
|
-
var PREFIX = 'PAGEFLOW_SCROLLED_COLLECTION';
|
159
|
-
var RESET = "".concat(PREFIX, "_RESET");
|
160
|
-
var ADD = "".concat(PREFIX, "_ADD");
|
161
|
-
var CHANGE = "".concat(PREFIX, "_CHANGE");
|
162
|
-
var REMOVE = "".concat(PREFIX, "_REMOVE");
|
163
|
-
var SORT = "".concat(PREFIX, "_SORT");
|
164
|
-
function useCollections() {
|
165
|
-
var seed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
166
|
-
|
167
|
-
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
168
|
-
keyAttribute = _ref.keyAttribute;
|
169
|
-
|
170
|
-
return useReducer(reducer, Object.keys(seed).reduce(function (result, key) {
|
171
|
-
result[key] = init(seed[key], keyAttribute);
|
172
|
-
return result;
|
173
|
-
}, {}));
|
174
|
-
}
|
175
|
-
|
176
|
-
function reducer(state, action) {
|
177
|
-
var collectionName = action.payload.collectionName;
|
178
|
-
var keyAttribute = action.payload.keyAttribute;
|
179
|
-
|
180
|
-
switch (action.type) {
|
181
|
-
case RESET:
|
182
|
-
return _objectSpread({}, state, _defineProperty({}, collectionName, init(action.payload.items, keyAttribute)));
|
183
|
-
|
184
|
-
case ADD:
|
185
|
-
return _objectSpread({}, state, _defineProperty({}, collectionName, {
|
186
|
-
order: action.payload.order,
|
187
|
-
items: _objectSpread({}, state[collectionName].items, _defineProperty({}, action.payload.attributes[keyAttribute], action.payload.attributes))
|
188
|
-
}));
|
189
|
-
|
190
|
-
case CHANGE:
|
191
|
-
return _objectSpread({}, state, _defineProperty({}, collectionName, {
|
192
|
-
order: state[collectionName].order,
|
193
|
-
items: _objectSpread({}, state[collectionName].items, _defineProperty({}, action.payload.attributes[keyAttribute], action.payload.attributes))
|
194
|
-
}));
|
195
|
-
|
196
|
-
case REMOVE:
|
197
|
-
var clonedItems = _objectSpread({}, state[collectionName].items);
|
198
|
-
|
199
|
-
delete clonedItems[action.payload.key];
|
200
|
-
return _objectSpread({}, state, _defineProperty({}, collectionName, {
|
201
|
-
order: action.payload.order,
|
202
|
-
items: clonedItems
|
203
|
-
}));
|
204
|
-
|
205
|
-
case SORT:
|
206
|
-
return _objectSpread({}, state, _defineProperty({}, collectionName, {
|
207
|
-
order: action.payload.order,
|
208
|
-
items: state[collectionName].items
|
209
|
-
}));
|
210
|
-
|
211
|
-
default:
|
212
|
-
return state;
|
213
|
-
}
|
214
|
-
}
|
215
|
-
|
216
|
-
function init(items) {
|
217
|
-
var keyAttribute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
|
218
|
-
items = items.filter(function (item) {
|
219
|
-
return item[keyAttribute];
|
220
|
-
});
|
221
|
-
return {
|
222
|
-
order: items.map(function (item) {
|
223
|
-
return item[keyAttribute];
|
224
|
-
}),
|
225
|
-
items: items.reduce(function (result, item) {
|
226
|
-
result[item[keyAttribute]] = item;
|
227
|
-
return result;
|
228
|
-
}, {})
|
229
|
-
};
|
230
|
-
}
|
231
|
-
|
232
|
-
function getItems(state, collectionName) {
|
233
|
-
if (state[collectionName]) {
|
234
|
-
var items = state[collectionName].items;
|
235
|
-
return state[collectionName].order.map(function (key) {
|
236
|
-
return items[key];
|
237
|
-
});
|
238
|
-
} else {
|
239
|
-
return [];
|
240
|
-
}
|
241
|
-
}
|
242
|
-
function getItem(state, collectionName, key) {
|
243
|
-
if (state[collectionName]) {
|
244
|
-
return state[collectionName].items[key];
|
245
|
-
}
|
246
|
-
}
|
247
|
-
|
248
|
-
var Context = React.createContext();
|
249
|
-
function EntryStateProvider(_ref) {
|
250
|
-
var seed = _ref.seed,
|
251
|
-
children = _ref.children;
|
252
|
-
|
253
|
-
var _useCollections = useCollections(seed.collections, {
|
254
|
-
keyAttribute: 'permaId'
|
255
|
-
}),
|
256
|
-
_useCollections2 = _slicedToArray(_useCollections, 2),
|
257
|
-
collections = _useCollections2[0],
|
258
|
-
dispatch = _useCollections2[1];
|
259
|
-
|
260
|
-
var value = useMemo(function () {
|
261
|
-
return {
|
262
|
-
entryState: {
|
263
|
-
collections: collections,
|
264
|
-
config: seed.config
|
265
|
-
},
|
266
|
-
dispatch: dispatch
|
267
|
-
};
|
268
|
-
}, [collections, dispatch, seed]);
|
269
|
-
return React.createElement(Context.Provider, {
|
270
|
-
value: value
|
271
|
-
}, children);
|
272
|
-
}
|
273
|
-
function useEntryState() {
|
274
|
-
var value = useContext(Context);
|
275
|
-
return value.entryState;
|
276
|
-
}
|
277
|
-
function useEntryStateDispatch() {
|
278
|
-
var value = useContext(Context);
|
279
|
-
return value.dispatch;
|
280
|
-
}
|
281
|
-
|
282
|
-
/**
|
283
|
-
* Returns a nested data structure representing the metadata of the entry.
|
284
|
-
*
|
285
|
-
* @example
|
286
|
-
*
|
287
|
-
* const metaData = useEntryMetadata();
|
288
|
-
* metaData // =>
|
289
|
-
* {
|
290
|
-
* id: 5,
|
291
|
-
* locale: 'en',
|
292
|
-
* shareProviders: {email: false, facebook: true},
|
293
|
-
* share_url: 'http://test.host/test',
|
294
|
-
* credits: 'Credits: Pageflow'
|
295
|
-
* }
|
296
|
-
*/
|
297
|
-
|
298
|
-
function useEntryMetadata() {
|
299
|
-
var entryState = useEntryState();
|
300
|
-
return useMemo(function () {
|
301
|
-
return getItems(entryState.collections, 'entries')[0];
|
302
|
-
}, [entryState]);
|
303
|
-
}
|
304
|
-
|
305
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
306
|
-
if (source == null) return {};
|
307
|
-
var target = {};
|
308
|
-
var sourceKeys = Object.keys(source);
|
309
|
-
var key, i;
|
310
|
-
|
311
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
312
|
-
key = sourceKeys[i];
|
313
|
-
if (excluded.indexOf(key) >= 0) continue;
|
314
|
-
target[key] = source[key];
|
315
|
-
}
|
316
|
-
|
317
|
-
return target;
|
318
|
-
}
|
319
|
-
|
320
|
-
function _objectWithoutProperties(source, excluded) {
|
321
|
-
if (source == null) return {};
|
322
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
323
|
-
var key, i;
|
324
|
-
|
325
|
-
if (Object.getOwnPropertySymbols) {
|
326
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
327
|
-
|
328
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
329
|
-
key = sourceSymbolKeys[i];
|
330
|
-
if (excluded.indexOf(key) >= 0) continue;
|
331
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
332
|
-
target[key] = source[key];
|
333
|
-
}
|
334
|
-
}
|
335
|
-
|
336
|
-
return target;
|
337
|
-
}
|
338
|
-
|
339
|
-
function _extends() {
|
340
|
-
_extends = Object.assign || function (target) {
|
341
|
-
for (var i = 1; i < arguments.length; i++) {
|
342
|
-
var source = arguments[i];
|
343
|
-
|
344
|
-
for (var key in source) {
|
345
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
346
|
-
target[key] = source[key];
|
347
|
-
}
|
348
|
-
}
|
349
|
-
}
|
350
|
-
|
351
|
-
return target;
|
352
|
-
};
|
353
|
-
|
354
|
-
return _extends.apply(this, arguments);
|
355
|
-
}
|
356
|
-
var EmailIcon = (function (_ref) {
|
357
|
-
var _ref$styles = _ref.styles,
|
358
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
359
|
-
|
360
|
-
return React.createElement("svg", _extends({
|
361
|
-
xmlns: "http://www.w3.org/2000/svg",
|
362
|
-
viewBox: "0 0 612 612"
|
363
|
-
}, props), React.createElement("path", {
|
364
|
-
d: "M573.75 57.375H38.25C17.136 57.375 0 74.511 0 95.625v420.75c0 21.133 17.136 38.25 38.25 38.25h535.5c21.133 0 38.25-17.117 38.25-38.25V95.625c0-21.114-17.117-38.25-38.25-38.25zM554.625 497.25H57.375V204.657l224.03 187.999c7.134 5.967 15.874 8.97 24.595 8.97 8.74 0 17.461-3.003 24.595-8.97l224.03-187.999V497.25zm0-367.487L306 338.379 57.375 129.763V114.75h497.25v15.013z"
|
365
|
-
}));
|
366
|
-
});
|
367
|
-
|
368
|
-
function _extends$1() {
|
369
|
-
_extends$1 = Object.assign || function (target) {
|
370
|
-
for (var i = 1; i < arguments.length; i++) {
|
371
|
-
var source = arguments[i];
|
372
|
-
|
373
|
-
for (var key in source) {
|
374
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
375
|
-
target[key] = source[key];
|
376
|
-
}
|
377
|
-
}
|
378
|
-
}
|
379
|
-
|
380
|
-
return target;
|
381
|
-
};
|
382
|
-
|
383
|
-
return _extends$1.apply(this, arguments);
|
384
|
-
}
|
385
|
-
var FacebookIcon = (function (_ref) {
|
386
|
-
var _ref$styles = _ref.styles,
|
387
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
388
|
-
|
389
|
-
return React.createElement("svg", _extends$1({
|
390
|
-
xmlns: "http://www.w3.org/2000/svg",
|
391
|
-
viewBox: "0 0 430.113 430.114"
|
392
|
-
}, props), React.createElement("path", {
|
393
|
-
d: "M158.081 83.3v59.218h-43.385v72.412h43.385v215.183h89.122V214.936h59.805s5.601-34.721 8.316-72.685H247.54V92.74c0-7.4 9.717-17.354 19.321-17.354h48.557V.001h-66.021C155.878-.004 158.081 72.48 158.081 83.3z"
|
394
|
-
}));
|
395
|
-
});
|
396
|
-
|
397
|
-
function _extends$2() {
|
398
|
-
_extends$2 = Object.assign || function (target) {
|
399
|
-
for (var i = 1; i < arguments.length; i++) {
|
400
|
-
var source = arguments[i];
|
401
|
-
|
402
|
-
for (var key in source) {
|
403
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
404
|
-
target[key] = source[key];
|
405
|
-
}
|
406
|
-
}
|
407
|
-
}
|
408
|
-
|
409
|
-
return target;
|
410
|
-
};
|
411
|
-
|
412
|
-
return _extends$2.apply(this, arguments);
|
413
|
-
}
|
414
|
-
var LinkedInIcon = (function (_ref) {
|
415
|
-
var _ref$styles = _ref.styles,
|
416
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
417
|
-
|
418
|
-
return React.createElement("svg", _extends$2({
|
419
|
-
xmlns: "http://www.w3.org/2000/svg",
|
420
|
-
viewBox: "0 0 430.117 430.117"
|
421
|
-
}, props), React.createElement("path", {
|
422
|
-
d: "M430.117 261.543V420.56h-92.188V272.193c0-37.271-13.334-62.707-46.703-62.707-25.473 0-40.632 17.142-47.301 33.724-2.432 5.928-3.058 14.179-3.058 22.477V420.56h-92.219s1.242-251.285 0-277.32h92.21v39.309c-.187.294-.43.611-.606.896h.606v-.896c12.251-18.869 34.13-45.824 83.102-45.824 60.673-.001 106.157 39.636 106.157 124.818zM52.183 9.558C20.635 9.558 0 30.251 0 57.463c0 26.619 20.038 47.94 50.959 47.94h.616c32.159 0 52.159-21.317 52.159-47.94-.606-27.212-20-47.905-51.551-47.905zM5.477 420.56h92.184V143.24H5.477v277.32z"
|
423
|
-
}));
|
424
|
-
});
|
425
|
-
|
426
|
-
function _extends$3() {
|
427
|
-
_extends$3 = Object.assign || function (target) {
|
428
|
-
for (var i = 1; i < arguments.length; i++) {
|
429
|
-
var source = arguments[i];
|
430
|
-
|
431
|
-
for (var key in source) {
|
432
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
433
|
-
target[key] = source[key];
|
434
|
-
}
|
435
|
-
}
|
436
|
-
}
|
437
|
-
|
438
|
-
return target;
|
439
|
-
};
|
440
|
-
|
441
|
-
return _extends$3.apply(this, arguments);
|
442
|
-
}
|
443
|
-
var TelegramIcon = (function (_ref) {
|
444
|
-
var _ref$styles = _ref.styles,
|
445
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
446
|
-
|
447
|
-
return React.createElement("svg", _extends$3({
|
448
|
-
xmlns: "http://www.w3.org/2000/svg",
|
449
|
-
viewBox: "0 0 512.004 512.004"
|
450
|
-
}, props), React.createElement("path", {
|
451
|
-
d: "M508.194 20.517c-4.43-4.96-11.42-6.29-17.21-3.76l-482 211a15.01 15.01 0 00-8.98 13.41 15.005 15.005 0 008.38 13.79l115.09 56.6 28.68 172.06c.93 6.53 6.06 11.78 12.74 12.73 4.8.69 9.57-1 12.87-4.4l90.86-90.86 129.66 92.62a15.02 15.02 0 0014.24 1.74 15.01 15.01 0 009.19-11.01l90-451c.89-4.47-.26-9.26-3.52-12.92zm-372.84 263.45l-84.75-41.68 334.82-146.57-250.07 188.25zm46.94 44.59l-13.95 69.75-15.05-90.3 183.97-138.49-150.88 151.39c-2.12 2.12-3.53 4.88-4.09 7.65zm9.13 107.3l15.74-78.67 36.71 26.22-52.45 52.45zm205.41 19.94l-176.73-126.23 252.47-253.31-75.74 379.54z"
|
452
|
-
}));
|
453
|
-
});
|
454
|
-
|
455
|
-
function _extends$4() {
|
456
|
-
_extends$4 = Object.assign || function (target) {
|
457
|
-
for (var i = 1; i < arguments.length; i++) {
|
458
|
-
var source = arguments[i];
|
459
|
-
|
460
|
-
for (var key in source) {
|
461
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
462
|
-
target[key] = source[key];
|
463
|
-
}
|
464
|
-
}
|
465
|
-
}
|
466
|
-
|
467
|
-
return target;
|
468
|
-
};
|
469
|
-
|
470
|
-
return _extends$4.apply(this, arguments);
|
471
|
-
}
|
472
|
-
var TwitterIcon = (function (_ref) {
|
473
|
-
var _ref$styles = _ref.styles,
|
474
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
475
|
-
|
476
|
-
return React.createElement("svg", _extends$4({
|
477
|
-
xmlns: "http://www.w3.org/2000/svg",
|
478
|
-
viewBox: "0 0 612 612"
|
479
|
-
}, props), React.createElement("path", {
|
480
|
-
d: "M612 116.258a250.714 250.714 0 01-72.088 19.772c25.929-15.527 45.777-40.155 55.184-69.411-24.322 14.379-51.169 24.82-79.775 30.48-22.907-24.437-55.49-39.658-91.63-39.658-69.334 0-125.551 56.217-125.551 125.513 0 9.828 1.109 19.427 3.251 28.606-104.326-5.24-196.835-55.223-258.75-131.174-10.823 18.51-16.98 40.078-16.98 63.101 0 43.559 22.181 81.993 55.835 104.479a125.556 125.556 0 01-56.867-15.756v1.568c0 60.806 43.291 111.554 100.693 123.104-10.517 2.83-21.607 4.398-33.08 4.398-8.107 0-15.947-.803-23.634-2.333 15.985 49.907 62.336 86.199 117.253 87.194-42.947 33.654-97.099 53.655-155.916 53.655-10.134 0-20.116-.612-29.944-1.721 55.567 35.681 121.536 56.485 192.438 56.485 230.948 0 357.188-191.291 357.188-357.188l-.421-16.253c24.666-17.593 46.005-39.697 62.794-64.861z"
|
481
|
-
}));
|
482
|
-
});
|
483
|
-
|
484
|
-
function _extends$5() {
|
485
|
-
_extends$5 = Object.assign || function (target) {
|
486
|
-
for (var i = 1; i < arguments.length; i++) {
|
487
|
-
var source = arguments[i];
|
488
|
-
|
489
|
-
for (var key in source) {
|
490
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
491
|
-
target[key] = source[key];
|
492
|
-
}
|
493
|
-
}
|
494
|
-
}
|
495
|
-
|
496
|
-
return target;
|
497
|
-
};
|
498
|
-
|
499
|
-
return _extends$5.apply(this, arguments);
|
500
|
-
}
|
501
|
-
var WhatsAppIcon = (function (_ref) {
|
502
|
-
var _ref$styles = _ref.styles,
|
503
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
504
|
-
|
505
|
-
return React.createElement("svg", _extends$5({
|
506
|
-
xmlns: "http://www.w3.org/2000/svg",
|
507
|
-
viewBox: "0 0 90 90"
|
508
|
-
}, props), React.createElement("path", {
|
509
|
-
d: "M90 43.841c0 24.213-19.779 43.841-44.182 43.841a44.256 44.256 0 01-21.357-5.455L0 90l7.975-23.522a43.38 43.38 0 01-6.34-22.637C1.635 19.628 21.416 0 45.818 0 70.223 0 90 19.628 90 43.841zM45.818 6.982c-20.484 0-37.146 16.535-37.146 36.859 0 8.065 2.629 15.534 7.076 21.61L11.107 79.14l14.275-4.537A37.122 37.122 0 0045.819 80.7c20.481 0 37.146-16.533 37.146-36.857S66.301 6.982 45.818 6.982zm22.311 46.956c-.273-.447-.994-.717-2.076-1.254-1.084-.537-6.41-3.138-7.4-3.495-.993-.358-1.717-.538-2.438.537-.721 1.076-2.797 3.495-3.43 4.212-.632.719-1.263.809-2.347.271-1.082-.537-4.571-1.673-8.708-5.333-3.219-2.848-5.393-6.364-6.025-7.441-.631-1.075-.066-1.656.475-2.191.488-.482 1.084-1.255 1.625-1.882.543-.628.723-1.075 1.082-1.793.363-.717.182-1.344-.09-1.883-.27-.537-2.438-5.825-3.34-7.977-.902-2.15-1.803-1.792-2.436-1.792-.631 0-1.354-.09-2.076-.09s-1.896.269-2.889 1.344c-.992 1.076-3.789 3.676-3.789 8.963 0 5.288 3.879 10.397 4.422 11.113.541.716 7.49 11.92 18.5 16.223C58.2 65.771 58.2 64.336 60.186 64.156c1.984-.179 6.406-2.599 7.312-5.107.9-2.512.9-4.663.631-5.111z"
|
510
|
-
}));
|
511
|
-
});
|
512
|
-
|
513
|
-
/**
|
514
|
-
* Returns a list of attributes (icon, name and url) of all configured share providers of the entry.
|
515
|
-
* The url provides a %{url} placeholder where the link can be inserted.
|
516
|
-
*
|
517
|
-
* @example
|
518
|
-
*
|
519
|
-
* const shareProviders = useShareProviders();
|
520
|
-
* shareProviders // =>
|
521
|
-
* [
|
522
|
-
* {
|
523
|
-
* icon: <FacebookSVGIcon />,
|
524
|
-
* name: 'Facebook',
|
525
|
-
* url: http://www.facebook.com/sharer/sharer.php?u=%{url}
|
526
|
-
* },
|
527
|
-
* {
|
528
|
-
* icon: <TwitterSVGIcon />,
|
529
|
-
* name: 'Twitter',
|
530
|
-
* url: https://twitter.com/intent/tweet?url=%{url}
|
531
|
-
* }
|
532
|
-
* ]
|
533
|
-
*/
|
534
|
-
|
535
|
-
function useShareProviders() {
|
536
|
-
var entryState = useEntryState();
|
537
|
-
var entryMetadata = useEntryMetadata();
|
538
|
-
var shareProviders = entryMetadata ? entryMetadata.shareProviders : {};
|
539
|
-
var urlTemplates = entryState.config.shareUrlTemplates;
|
540
|
-
var sharing = {
|
541
|
-
email: {
|
542
|
-
icon: EmailIcon,
|
543
|
-
name: 'Email',
|
544
|
-
url: urlTemplates.email
|
545
|
-
},
|
546
|
-
facebook: {
|
547
|
-
icon: FacebookIcon,
|
548
|
-
name: 'Facebook',
|
549
|
-
url: urlTemplates.facebook
|
550
|
-
},
|
551
|
-
linked_in: {
|
552
|
-
icon: LinkedInIcon,
|
553
|
-
name: 'LinkedIn',
|
554
|
-
url: urlTemplates.linked_in
|
555
|
-
},
|
556
|
-
telegram: {
|
557
|
-
icon: TelegramIcon,
|
558
|
-
name: 'Telegram',
|
559
|
-
url: urlTemplates.telegram
|
560
|
-
},
|
561
|
-
twitter: {
|
562
|
-
icon: TwitterIcon,
|
563
|
-
name: 'Twitter',
|
564
|
-
url: urlTemplates.twitter
|
565
|
-
},
|
566
|
-
whats_app: {
|
567
|
-
icon: WhatsAppIcon,
|
568
|
-
name: 'WhatsApp',
|
569
|
-
url: urlTemplates.whats_app
|
570
|
-
}
|
571
|
-
};
|
572
|
-
return useMemo(function () {
|
573
|
-
return activeShareProviders(shareProviders).map(function (provider) {
|
574
|
-
var config = sharing[provider];
|
575
|
-
return {
|
576
|
-
name: config.name,
|
577
|
-
icon: config.icon,
|
578
|
-
url: config.url
|
579
|
-
};
|
580
|
-
});
|
581
|
-
}, [shareProviders]);
|
582
|
-
}
|
583
|
-
|
584
|
-
function activeShareProviders(shareProvidersConfig) {
|
585
|
-
return Object.keys(shareProvidersConfig).filter(function (provider) {
|
586
|
-
return shareProvidersConfig[provider] !== false;
|
587
|
-
});
|
588
|
-
}
|
589
|
-
/**
|
590
|
-
* Returns the share url of the entry.
|
591
|
-
*
|
592
|
-
* @example
|
593
|
-
*
|
594
|
-
* const shareUrl = useShareUrl();
|
595
|
-
* shareUrl // => "http://test.host/test"
|
596
|
-
*/
|
597
|
-
|
598
|
-
|
599
|
-
function useShareUrl() {
|
600
|
-
var entryMetadata = useEntryMetadata();
|
601
|
-
var entryState = useEntryState();
|
602
|
-
|
603
|
-
if (entryMetadata) {
|
604
|
-
return entryMetadata.shareUrl ? entryMetadata.shareUrl : entryState.config.prettyUrl;
|
605
|
-
} else {
|
606
|
-
return entryState.config.shareUrl;
|
607
|
-
}
|
608
|
-
}
|
609
|
-
|
610
|
-
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; }
|
611
|
-
|
612
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
613
|
-
/**
|
614
|
-
* Returns a nested data structure representing the chapters, sections
|
615
|
-
* and content elements of the entry.
|
616
|
-
*
|
617
|
-
* @example
|
618
|
-
*
|
619
|
-
* const structure = useEntryStructure();
|
620
|
-
* structure // =>
|
621
|
-
* [
|
622
|
-
* {
|
623
|
-
* permaId: 5,
|
624
|
-
* title: 'Chapter 1',
|
625
|
-
* summary: 'An introductory chapter',
|
626
|
-
* sections: [
|
627
|
-
* {
|
628
|
-
* permaId: 101,
|
629
|
-
* sectionIndex: 0,
|
630
|
-
* transition: 'scroll',
|
631
|
-
*
|
632
|
-
* // references to adjacent section objects
|
633
|
-
* previousSection: { ... },
|
634
|
-
* nextSection: { ... },
|
635
|
-
*
|
636
|
-
* foreground: [
|
637
|
-
* {
|
638
|
-
* type: 'heading',
|
639
|
-
* props: {
|
640
|
-
* children: 'Heading'
|
641
|
-
* }
|
642
|
-
* },
|
643
|
-
* {
|
644
|
-
* type: 'textBlock',
|
645
|
-
* props: {
|
646
|
-
* children: 'Some text'
|
647
|
-
* }
|
648
|
-
* }
|
649
|
-
* ]
|
650
|
-
* }
|
651
|
-
* ],
|
652
|
-
* }
|
653
|
-
* ]
|
654
|
-
*/
|
655
|
-
|
656
|
-
function useEntryStructure() {
|
657
|
-
var entryState = useEntryState();
|
658
|
-
return useMemo(function () {
|
659
|
-
var sections = [];
|
660
|
-
var chapters = getItems(entryState.collections, 'chapters').map(function (chapter) {
|
661
|
-
return _objectSpread$1({
|
662
|
-
permaId: chapter.permaId
|
663
|
-
}, chapter.configuration, {
|
664
|
-
sections: getItems(entryState.collections, 'sections').filter(function (item) {
|
665
|
-
return item.chapterId === chapter.id;
|
666
|
-
}).map(function (section) {
|
667
|
-
var result = sectionStructure(entryState.collections, section);
|
668
|
-
sections.push(result);
|
669
|
-
return result;
|
670
|
-
})
|
671
|
-
});
|
672
|
-
});
|
673
|
-
sections.forEach(function (section, index) {
|
674
|
-
section.sectionIndex = index;
|
675
|
-
section.previousSection = sections[index - 1];
|
676
|
-
section.nextSection = sections[index + 1];
|
677
|
-
});
|
678
|
-
return chapters;
|
679
|
-
}, [entryState]);
|
680
|
-
}
|
681
|
-
/**
|
682
|
-
* Returns a nested data structure representing the content elements
|
683
|
-
* of section.
|
684
|
-
*
|
685
|
-
* @param {Object} options
|
686
|
-
* @param {number} options.sectionPermaId
|
687
|
-
*
|
688
|
-
* @example
|
689
|
-
*
|
690
|
-
* const section = useSectionStructure({sectionPermaId: 4});
|
691
|
-
* section // =>
|
692
|
-
* {
|
693
|
-
* permaId: 4,
|
694
|
-
* transition: 'scroll',
|
695
|
-
* foreground: [
|
696
|
-
* {
|
697
|
-
* type: 'heading',
|
698
|
-
* props: {
|
699
|
-
* children: 'Heading'
|
700
|
-
* }
|
701
|
-
* },
|
702
|
-
* {
|
703
|
-
* type: 'textBlock',
|
704
|
-
* props: {
|
705
|
-
* children: 'Some text'
|
706
|
-
* }
|
707
|
-
* }
|
708
|
-
* ]
|
709
|
-
* }
|
710
|
-
*/
|
711
|
-
|
712
|
-
function useSectionStructure(_ref) {
|
713
|
-
var sectionPermaId = _ref.sectionPermaId;
|
714
|
-
var entryState = useEntryState();
|
715
|
-
var section = getItem(entryState.collections, 'sections', sectionPermaId);
|
716
|
-
return sectionStructure(entryState.collections, section);
|
717
|
-
}
|
718
|
-
|
719
|
-
function sectionStructure(collections, section) {
|
720
|
-
return section && _objectSpread$1({
|
721
|
-
permaId: section.permaId
|
722
|
-
}, section.configuration, {
|
723
|
-
foreground: getItems(collections, 'contentElements').filter(function (item) {
|
724
|
-
return item.sectionId === section.id;
|
725
|
-
}).map(function (item) {
|
726
|
-
return {
|
727
|
-
id: item.id,
|
728
|
-
type: item.typeName,
|
729
|
-
position: item.configuration.position,
|
730
|
-
props: item.configuration
|
731
|
-
};
|
732
|
-
})
|
733
|
-
});
|
734
|
-
}
|
735
|
-
|
736
|
-
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; }
|
737
|
-
|
738
|
-
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; }
|
739
|
-
|
740
|
-
function expandUrls(collectionName, file, urlTemplates) {
|
741
|
-
if (!file) {
|
742
|
-
return null;
|
743
|
-
}
|
744
|
-
|
745
|
-
if (!urlTemplates[collectionName]) {
|
746
|
-
throw new Error("No file url templates found for ".concat(collectionName));
|
747
|
-
}
|
748
|
-
|
749
|
-
var variants = file.variants || Object.keys(urlTemplates[collectionName]);
|
750
|
-
var urls = variants.reduce(function (result, variant) {
|
751
|
-
var url = getFileUrl(collectionName, file, variant, urlTemplates);
|
752
|
-
|
753
|
-
if (url) {
|
754
|
-
result[variant] = url;
|
755
|
-
}
|
756
|
-
|
757
|
-
return result;
|
758
|
-
}, {});
|
759
|
-
return _objectSpread$2({
|
760
|
-
urls: urls
|
761
|
-
}, file);
|
762
|
-
}
|
763
|
-
|
764
|
-
function getFileUrl(collectionName, file, quality, urlTemplates) {
|
765
|
-
var templates = urlTemplates[collectionName];
|
766
|
-
var template = templates[quality];
|
767
|
-
|
768
|
-
if (template) {
|
769
|
-
return template.replace(':id_partition', idPartition(file.id)).replace(':basename', file.basename);
|
770
|
-
}
|
771
|
-
}
|
772
|
-
|
773
|
-
function idPartition(id) {
|
774
|
-
return partition(pad(id, 9));
|
775
|
-
}
|
776
|
-
|
777
|
-
function partition(string, separator) {
|
778
|
-
return string.replace(/./g, function (c, i, a) {
|
779
|
-
return i && (a.length - i) % 3 === 0 ? '/' + c : c;
|
780
|
-
});
|
781
|
-
}
|
782
|
-
|
783
|
-
function pad(string, size) {
|
784
|
-
return (Array(size).fill(0).join('') + string).slice(-size);
|
785
|
-
}
|
786
|
-
|
787
|
-
/**
|
788
|
-
* Look up a file by its collection and perma id.
|
789
|
-
*
|
790
|
-
* @param {Object} options
|
791
|
-
* @param {String} options.collectionName - Collection name of file type to look for (in camel case).
|
792
|
-
* @param {String} options.permaId - Perma id of file look up
|
793
|
-
*
|
794
|
-
* @example
|
795
|
-
* const imageFile = useFile({collectionName: 'imageFiles', permaId: 5});
|
796
|
-
* imageFile // =>
|
797
|
-
* {
|
798
|
-
* id: 102,
|
799
|
-
* permaId: 5,
|
800
|
-
* width: 1000,
|
801
|
-
* height: 500,
|
802
|
-
* urls: {
|
803
|
-
* large: 'https://...'
|
804
|
-
* },
|
805
|
-
* configuration: {
|
806
|
-
* alt: '...'
|
807
|
-
* }
|
808
|
-
* }
|
809
|
-
*/
|
810
|
-
|
811
|
-
function useFile(_ref) {
|
812
|
-
var collectionName = _ref.collectionName,
|
813
|
-
permaId = _ref.permaId;
|
814
|
-
var entryState = useEntryState();
|
815
|
-
return expandUrls(collectionName, getItem(entryState.collections, collectionName, permaId), entryState.config.fileUrlTemplates);
|
816
|
-
}
|
817
|
-
|
818
|
-
/**
|
819
|
-
* Returns a string (comma-separated list) of copyrights of
|
820
|
-
* all images used in the entry.
|
821
|
-
* If none of the images has a rights attribute configured,
|
822
|
-
* it falls back to the default file rights of the entry's account,
|
823
|
-
* otherwise returns an empty string
|
824
|
-
*
|
825
|
-
* @example
|
826
|
-
*
|
827
|
-
* const fileRights = useFileRights();
|
828
|
-
* fileRights // => "author of image 1, author of image 2"
|
829
|
-
*/
|
830
|
-
|
831
|
-
function useFileRights() {
|
832
|
-
var entryState = useEntryState();
|
833
|
-
var defaultFileRights = entryState.config.defaultFileRights;
|
834
|
-
var imageFiles = getItems(entryState.collections, 'imageFiles');
|
835
|
-
var imageFileRights = imageFiles.reduce(function (result, imageConfig) {
|
836
|
-
if (imageConfig && imageConfig.rights) {
|
837
|
-
result.push(imageConfig.rights.trim());
|
838
|
-
}
|
839
|
-
|
840
|
-
return result;
|
841
|
-
}, []).filter(Boolean).join(', ');
|
842
|
-
var fileRights = !!imageFileRights ? imageFileRights : defaultFileRights.trim();
|
843
|
-
var fileRightsString = !!fileRights ? 'Bildrechte: ' + fileRights : '';
|
844
|
-
return fileRightsString;
|
845
|
-
}
|
846
|
-
/**
|
847
|
-
* Returns a nested data structure representing the legal info of the entry.
|
848
|
-
* Each legal info is separated into label and url to use in links.
|
849
|
-
* Both label and url can be blank, depending on the configuration.
|
850
|
-
*
|
851
|
-
* @example
|
852
|
-
*
|
853
|
-
* const legalInfo = useLegalInfo();
|
854
|
-
* legalInfo // =>
|
855
|
-
* {
|
856
|
-
* imprint: {
|
857
|
-
* label: '',
|
858
|
-
* url: ''
|
859
|
-
* },
|
860
|
-
* copyright: {
|
861
|
-
* label: '',
|
862
|
-
* url: ''
|
863
|
-
* },
|
864
|
-
* privacy: {
|
865
|
-
* label: '',
|
866
|
-
* url: ''
|
867
|
-
* }
|
868
|
-
* }
|
869
|
-
*/
|
870
|
-
|
871
|
-
function useLegalInfo() {
|
872
|
-
var entryState = useEntryState();
|
873
|
-
return entryState.config.legalInfo;
|
874
|
-
}
|
875
|
-
/**
|
876
|
-
* Returns the credits string (rich text) of the entry.
|
877
|
-
*
|
878
|
-
* @example
|
879
|
-
*
|
880
|
-
* const credits = useCredits();
|
881
|
-
* credits // => "Credits: <a href="http://pageflow.com">pageflow.com</a>"
|
882
|
-
*/
|
883
|
-
|
884
|
-
function useCredits() {
|
885
|
-
var entryMetadata = useEntryMetadata();
|
886
|
-
var credits = '';
|
887
|
-
|
888
|
-
if (entryMetadata) {
|
889
|
-
credits = entryMetadata.credits;
|
890
|
-
}
|
891
|
-
|
892
|
-
return credits;
|
893
|
-
}
|
894
|
-
|
895
|
-
function styleInject(css, ref) {
|
896
|
-
if ( ref === void 0 ) ref = {};
|
897
|
-
var insertAt = ref.insertAt;
|
898
|
-
|
899
|
-
if (!css || typeof document === 'undefined') { return; }
|
900
|
-
|
901
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
902
|
-
var style = document.createElement('style');
|
903
|
-
style.type = 'text/css';
|
904
|
-
|
905
|
-
if (insertAt === 'top') {
|
906
|
-
if (head.firstChild) {
|
907
|
-
head.insertBefore(style, head.firstChild);
|
908
|
-
} else {
|
909
|
-
head.appendChild(style);
|
910
|
-
}
|
911
|
-
} else {
|
912
|
-
head.appendChild(style);
|
913
|
-
}
|
914
|
-
|
915
|
-
if (style.styleSheet) {
|
916
|
-
style.styleSheet.cssText = css;
|
917
|
-
} else {
|
918
|
-
style.appendChild(document.createTextNode(css));
|
919
|
-
}
|
920
|
-
}
|
921
|
-
|
922
|
-
var css = "header svg {\n fill: #c2c2c2;\n cursor: pointer;\n}\n\nheader svg:hover {\n fill: rgb(0, 55, 90);;\n}\n\n.AppHeader-module_navigationBar__2EFHw {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n position: sticky;\n top: -50px;\n transition: top .15s;\n z-index: 10000;\n width: 100%;\n text-align: center;\n}\n\n.AppHeader-module_navigationBarExpanded__18nbf {\n top: 0;\n}\n\n.AppHeader-module_navigationBarContentWrapper__2Sf8y {\n position: relative;\n z-index: 2;\n background-color: #fff;\n height: 50px;\n}\n\n.AppHeader-module_menuIcon__5JKuj {\n position: absolute;\n}\n\n.AppHeader-module_contextIcons__23I_3 {\n position: absolute;\n top: 0px;\n right: 0px;\n width: 80px;\n height: 50px;\n padding: 0px 12px;\n}\n\n.AppHeader-module_contextIcon__157kW {\n float: right;\n width: 40px;\n height: 50px;\n}\n\n.AppHeader-module_wdrLogo__3XGNI {\n top: 12px;\n left: 15px;\n width: 80px;\n}\n\n.AppHeader-module_chapterList__2lMMD {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.AppHeader-module_chapterListItem__28zrc {\n position: relative;\n display: inline-block;\n padding: 0 15px;\n border-right: 1px solid #e9e9e9;\n}\n\n.AppHeader-module_chapterListItem__28zrc:last-of-type {\n border-right: none;\n}\n\n.AppHeader-module_navigationTooltip__1EvCy {\n opacity: 1 !important;\n box-shadow: 0 0 0.3125rem rgba(0,0,0,.2);\n}\n\n.AppHeader-module_progressBar__17IVu {\n background-color: rgba(194,194,194,0.8);\n height: 8px;\n width: 100%;\n}\n\n.AppHeader-module_progressIndicator__3SlYz {\n position: absolute;\n top: 0;\n left: 0;\n width: 0vw;\n height: 100%;\n background-color: #e10028;\n}\n\n/* mobile view */\n@media (max-width: 780px) {\n .AppHeader-module_wdrLogo__3XGNI {\n position: inherit;\n }\n\n .AppHeader-module_navigationChapters__1dzyV {\n touch-action: none;\n display: block;\n position: fixed;\n top: 60px;\n left: 0px;\n background: rgba(255, 255, 255, 0.95);\n width: 100vw;\n height: 100vh;\n }\n\n .AppHeader-module_navigationChaptersHidden__8AEPA {\n display: none;\n }\n\n .AppHeader-module_chapterList__2lMMD {\n margin-top: 50px;\n }\n\n .AppHeader-module_chapterListItem__28zrc {\n display: list-item;\n width: 80vw;\n padding: 25px 10vw;\n border-right: none;\n }\n\n .AppHeader-module_chapterListItem__28zrc::before,\n .AppHeader-module_chapterListItem__28zrc::after {\n display: table;\n content: \" \";\n border-top: 1px solid rgb(100, 100, 100);\n width: 14%;\n margin: 0 43%;\n transition: width .15s, margin .15s;\n }\n\n .AppHeader-module_chapterListItem__28zrc:hover::before,\n .AppHeader-module_chapterListItem__28zrc:hover::after {\n border-top: 1px solid rgb(0, 55, 90);\n width: 80%;\n margin: 0 10%;\n }\n\n .AppHeader-module_chapterListItem__28zrc p {\n margin-top: 0;\n }\n\n .AppHeader-module_progressBar__17IVu {\n height: 10px;\n }\n}\n";
|
923
|
-
var styles = {"navigationBar":"AppHeader-module_navigationBar__2EFHw","navigationBarExpanded":"AppHeader-module_navigationBarExpanded__18nbf","navigationBarContentWrapper":"AppHeader-module_navigationBarContentWrapper__2Sf8y","menuIcon":"AppHeader-module_menuIcon__5JKuj","contextIcons":"AppHeader-module_contextIcons__23I_3","contextIcon":"AppHeader-module_contextIcon__157kW","wdrLogo":"AppHeader-module_wdrLogo__3XGNI","chapterList":"AppHeader-module_chapterList__2lMMD","chapterListItem":"AppHeader-module_chapterListItem__28zrc","navigationTooltip":"AppHeader-module_navigationTooltip__1EvCy","progressBar":"AppHeader-module_progressBar__17IVu","progressIndicator":"AppHeader-module_progressIndicator__3SlYz","navigationChapters":"AppHeader-module_navigationChapters__1dzyV","navigationChaptersHidden":"AppHeader-module_navigationChaptersHidden__8AEPA"};
|
924
|
-
styleInject(css);
|
925
|
-
|
926
|
-
var css$1 = ".HamburgerIcon-module_burgerMenuIconContainer__26RY4 {\n display: none;\n}\n\n.HamburgerIcon-module_burgerMenuIcon__24t-5 {\n top: 12px;\n left: 12px;\n outline: none;\n}\n\n/* mobile view */\n@media (max-width: 780px) {\n .HamburgerIcon-module_burgerMenuIconContainer__26RY4 {\n display: block;\n }\n}\n";
|
927
|
-
var styles$1 = {"burgerMenuIconContainer":"HamburgerIcon-module_burgerMenuIconContainer__26RY4","burgerMenuIcon":"HamburgerIcon-module_burgerMenuIcon__24t-5"};
|
928
|
-
styleInject(css$1);
|
929
|
-
|
930
|
-
var css$2 = "/*!\n * Hamburgers\n * @description Tasty CSS-animated hamburgers\n * @author Jonathan Suh @jonsuh\n * @site https://jonsuh.com/hamburgers\n * @link https://github.com/jonsuh/hamburgers\n */\n.HamburgerIcons-module_hamburger__NnCze {\n display: inline-block;\n cursor: pointer;\n transition-property: opacity, filter;\n transition-duration: 0.15s;\n transition-timing-function: linear;\n font: inherit;\n color: inherit;\n text-transform: none;\n background-color: transparent;\n border: 0;\n margin: 0;\n overflow: visible;\n}\n\n.HamburgerIcons-module_hamburger__NnCze.HamburgerIcons-module_is-active__10qoY .HamburgerIcons-module_hamburger-inner__187lg,\n.HamburgerIcons-module_hamburger__NnCze.HamburgerIcons-module_is-active__10qoY .HamburgerIcons-module_hamburger-inner__187lg::before,\n.HamburgerIcons-module_hamburger__NnCze.HamburgerIcons-module_is-active__10qoY .HamburgerIcons-module_hamburger-inner__187lg::after {\n background-color: #e10028;\n}\n\n.HamburgerIcons-module_hamburger-box__34rgF {\n width: 40px;\n height: 24px;\n display: inline-block;\n position: relative;\n}\n\n.HamburgerIcons-module_hamburger-inner__187lg {\n display: block;\n top: 50%;\n margin-top: -2px;\n}\n\n.HamburgerIcons-module_hamburger-inner__187lg, .HamburgerIcons-module_hamburger-inner__187lg::before, .HamburgerIcons-module_hamburger-inner__187lg::after {\n width: 30px;\n height: 4px;\n background-color: rgb(0, 55, 90);\n border-radius: 4px;\n position: absolute;\n transition-property: transform;\n transition-duration: 0.15s;\n transition-timing-function: ease;\n}\n\n.HamburgerIcons-module_hamburger-inner__187lg::before, .HamburgerIcons-module_hamburger-inner__187lg::after {\n content: \"\";\n display: block;\n}\n\n.HamburgerIcons-module_hamburger-inner__187lg::before {\n top: -10px;\n}\n\n.HamburgerIcons-module_hamburger-inner__187lg::after {\n bottom: -10px;\n}\n\n/*\n * Collapse\n */\n.HamburgerIcons-module_hamburger--collapse__gRQFa .HamburgerIcons-module_hamburger-inner__187lg {\n top: auto;\n bottom: 0;\n transition-duration: 0.13s;\n transition-delay: 0.13s;\n transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);\n}\n\n.HamburgerIcons-module_hamburger--collapse__gRQFa .HamburgerIcons-module_hamburger-inner__187lg::after {\n top: -20px;\n transition: top 0.2s 0.2s cubic-bezier(0.33333, 0.66667, 0.66667, 1), opacity 0.1s linear;\n}\n\n.HamburgerIcons-module_hamburger--collapse__gRQFa .HamburgerIcons-module_hamburger-inner__187lg::before {\n transition: top 0.12s 0.2s cubic-bezier(0.33333, 0.66667, 0.66667, 1), transform 0.13s cubic-bezier(0.55, 0.055, 0.675, 0.19);\n}\n\n.HamburgerIcons-module_hamburger--collapse__gRQFa.HamburgerIcons-module_is-active__10qoY .HamburgerIcons-module_hamburger-inner__187lg {\n transform: translate3d(0, -10px, 0) rotate(-45deg);\n transition-delay: 0.22s;\n transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n}\n\n.HamburgerIcons-module_hamburger--collapse__gRQFa.HamburgerIcons-module_is-active__10qoY .HamburgerIcons-module_hamburger-inner__187lg::after {\n top: 0;\n opacity: 0;\n transition: top 0.2s cubic-bezier(0.33333, 0, 0.66667, 0.33333), opacity 0.1s 0.22s linear;\n}\n\n.HamburgerIcons-module_hamburger--collapse__gRQFa.HamburgerIcons-module_is-active__10qoY .HamburgerIcons-module_hamburger-inner__187lg::before {\n top: 0;\n transform: rotate(-90deg);\n transition: top 0.1s 0.16s cubic-bezier(0.33333, 0, 0.66667, 0.33333), transform 0.13s 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);\n}\n";
|
931
|
-
var hamburgerIconStyles = {"hamburger":"HamburgerIcons-module_hamburger__NnCze","is-active":"HamburgerIcons-module_is-active__10qoY","hamburger-inner":"HamburgerIcons-module_hamburger-inner__187lg","hamburger-box":"HamburgerIcons-module_hamburger-box__34rgF","hamburger--collapse":"HamburgerIcons-module_hamburger--collapse__gRQFa"};
|
932
|
-
styleInject(css$2);
|
933
|
-
|
934
|
-
function HamburgerIcon(props) {
|
935
|
-
return React.createElement("div", {
|
936
|
-
className: styles$1.burgerMenuIconContainer
|
937
|
-
}, React.createElement("button", {
|
938
|
-
className: classNames(styles.menuIcon, styles$1.burgerMenuIcon, hamburgerIconStyles.hamburger, hamburgerIconStyles['hamburger--collapse'], _defineProperty({}, hamburgerIconStyles['is-active'], !props.mobileNavHidden)),
|
939
|
-
type: "button",
|
940
|
-
onClick: props.onClick
|
941
|
-
}, React.createElement("span", {
|
942
|
-
className: hamburgerIconStyles['hamburger-box']
|
943
|
-
}, React.createElement("span", {
|
944
|
-
className: hamburgerIconStyles['hamburger-inner']
|
945
|
-
}))));
|
946
|
-
}
|
947
|
-
|
948
|
-
var css$3 = ".ChapterLink-module_chapterLink__v5VRl {\n line-height: 3rem;\n color: rgb(0, 55, 90);\n text-decoration: none;\n position: relative;\n display: block;\n font-family: inherit;\n font-weight: 700;\n font-size: 1rem;\n height: 50px;\n}\n\n.ChapterLink-module_chapterLink__v5VRl:hover,\n.ChapterLink-module_chapterLinkActive__jl4h5 {\n color: #e10028;\n}\n\n.ChapterLink-module_summary__17aoW {\n display: none;\n}\n\n/* mobile view */\n@media (max-width: 780px) {\n .ChapterLink-module_summary__17aoW {\n display: block;\n }\n}";
|
949
|
-
var styles$2 = {"chapterLink":"ChapterLink-module_chapterLink__v5VRl","chapterLinkActive":"ChapterLink-module_chapterLinkActive__jl4h5","summary":"ChapterLink-module_summary__17aoW"};
|
950
|
-
styleInject(css$3);
|
951
|
-
|
952
|
-
var css$4 = ".ChapterLinkTooltip-module_chapterLinkTooltip__cCfsw {\n border-bottom: 3px solid #e10028;\n width: 200px;\n}\n\n.ChapterLinkTooltip-module_tooltipHeadline__reew_ {\n margin: 5px 0 0px;\n color: #e10028;\n}\n\n@media (max-width: 780px) {\n .ChapterLinkTooltip-module_chapterLinkTooltip__cCfsw {\n display: none !important;\n }\n}\n";
|
953
|
-
var styles$3 = {"chapterLinkTooltip":"ChapterLinkTooltip-module_chapterLinkTooltip__cCfsw","tooltipHeadline":"ChapterLinkTooltip-module_tooltipHeadline__reew_"};
|
954
|
-
styleInject(css$4);
|
955
|
-
|
956
|
-
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; }
|
957
|
-
|
958
|
-
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; }
|
959
|
-
function setupI18n(_ref) {
|
960
|
-
var defaultLocale = _ref.defaultLocale,
|
961
|
-
locale = _ref.locale,
|
962
|
-
translations = _ref.translations;
|
963
|
-
I18n.defaultLocale = defaultLocale;
|
964
|
-
I18n.locale = locale;
|
965
|
-
I18n.translations = translations;
|
966
|
-
}
|
967
|
-
/**
|
968
|
-
* Use translations in frontend elements. Uses the configured locale
|
969
|
-
* of the current entry by default. Note that only translation keys
|
970
|
-
* from the `pageflow_scrolled.public` scope are universally
|
971
|
-
* available.
|
972
|
-
*
|
973
|
-
* to render translations for inline editing controls in the editor
|
974
|
-
* preview, you can pass `"ui"` as `locale` option and use
|
975
|
-
* translations from the `pageflow_scrolled.inline_editing` scope.
|
976
|
-
*
|
977
|
-
* @param {Object} [options]
|
978
|
-
* @param {string} [locale="entry"] -
|
979
|
-
* Pass `"ui"` to use the locale of the editor interface instead.
|
980
|
-
*
|
981
|
-
* @example
|
982
|
-
* const {t} = useI18n();
|
983
|
-
* t('pageflow_scrolled.public.some.key')
|
984
|
-
*
|
985
|
-
* const {t} = useI18n({locale: 'ui'});
|
986
|
-
* t('pageflow_scrolled.inline_editing.some.key')
|
987
|
-
*/
|
988
|
-
|
989
|
-
function useI18n() {
|
990
|
-
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
991
|
-
scope = _ref2.locale;
|
992
|
-
|
993
|
-
var _useEntryMetadata = useEntryMetadata(),
|
994
|
-
locale = _useEntryMetadata.locale;
|
995
|
-
|
996
|
-
return {
|
997
|
-
t: function t(key, options) {
|
998
|
-
return I18n.t(key, _objectSpread$3({}, options, {
|
999
|
-
locale: scope !== 'ui' && locale
|
1000
|
-
}));
|
1001
|
-
}
|
1002
|
-
};
|
1003
|
-
}
|
1004
|
-
|
1005
|
-
function ChapterLinkTooltip(props) {
|
1006
|
-
var _useI18n = useI18n(),
|
1007
|
-
t = _useI18n.t;
|
1008
|
-
|
1009
|
-
return React.createElement(ReactTooltip, {
|
1010
|
-
id: props.chapterLinkId,
|
1011
|
-
type: "light",
|
1012
|
-
place: "bottom",
|
1013
|
-
effect: "solid",
|
1014
|
-
className: classNames(styles.navigationTooltip, styles$3.chapterLinkTooltip)
|
1015
|
-
}, React.createElement("div", null, React.createElement("h3", {
|
1016
|
-
className: styles$3.tooltipHeadline
|
1017
|
-
}, t('pageflow_scrolled.public.navigation.chapter'), " ", props.chapterIndex), React.createElement("p", {
|
1018
|
-
dangerouslySetInnerHTML: {
|
1019
|
-
__html: props.summary
|
1020
|
-
}
|
1021
|
-
})));
|
1022
|
-
}
|
1023
|
-
|
1024
|
-
function ChapterLink(props) {
|
1025
|
-
return React.createElement("div", null, React.createElement("a", {
|
1026
|
-
className: classNames(styles$2.chapterLink, _defineProperty({}, styles$2.chapterLinkActive, props.active)),
|
1027
|
-
href: "#chapter-".concat(props.permaId),
|
1028
|
-
onClick: function onClick() {
|
1029
|
-
return props.handleMenuClick(props.chapterLinkId);
|
1030
|
-
},
|
1031
|
-
"data-tip": true,
|
1032
|
-
"data-for": props.chapterLinkId
|
1033
|
-
}, props.title), React.createElement("p", {
|
1034
|
-
className: styles$2.summary,
|
1035
|
-
dangerouslySetInnerHTML: {
|
1036
|
-
__html: props.summary
|
1037
|
-
}
|
1038
|
-
}), React.createElement(ChapterLinkTooltip, Object.assign({
|
1039
|
-
chapterIndex: props.chapterIndex,
|
1040
|
-
chapterLinkId: props.chapterLinkId
|
1041
|
-
}, props)));
|
1042
|
-
}
|
1043
|
-
|
1044
|
-
var css$5 = ".LegalInfoMenu-module_infoIcon__1kTnt svg {\n width: 26px;\n height: 26px;\n margin: 12px 0px;\n}\n\n";
|
1045
|
-
var styles$4 = {"infoIcon":"LegalInfoMenu-module_infoIcon__1kTnt"};
|
1046
|
-
styleInject(css$5);
|
1047
|
-
|
1048
|
-
function _extends$6() {
|
1049
|
-
_extends$6 = Object.assign || function (target) {
|
1050
|
-
for (var i = 1; i < arguments.length; i++) {
|
1051
|
-
var source = arguments[i];
|
1052
|
-
|
1053
|
-
for (var key in source) {
|
1054
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1055
|
-
target[key] = source[key];
|
1056
|
-
}
|
1057
|
-
}
|
1058
|
-
}
|
1059
|
-
|
1060
|
-
return target;
|
1061
|
-
};
|
1062
|
-
|
1063
|
-
return _extends$6.apply(this, arguments);
|
1064
|
-
}
|
1065
|
-
var InfoIcon = (function (_ref) {
|
1066
|
-
var _ref$styles = _ref.styles,
|
1067
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
1068
|
-
|
1069
|
-
return React.createElement("svg", _extends$6({
|
1070
|
-
xmlns: "http://www.w3.org/2000/svg",
|
1071
|
-
viewBox: "0 0 330 330"
|
1072
|
-
}, props), React.createElement("path", {
|
1073
|
-
d: "M165 0C74.019 0 0 74.02 0 165.001 0 255.982 74.019 330 165 330s165-74.018 165-164.999S255.981 0 165 0zm0 300c-74.44 0-135-60.56-135-134.999S90.56 30 165 30s135 60.562 135 135.001C300 239.44 239.439 300 165 300z"
|
1074
|
-
}), React.createElement("path", {
|
1075
|
-
d: "M164.998 70c-11.026 0-19.996 8.976-19.996 20.009 0 11.023 8.97 19.991 19.996 19.991 11.026 0 19.996-8.968 19.996-19.991 0-11.033-8.97-20.009-19.996-20.009zm.002 70c-8.284 0-15 6.716-15 15v90c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15v-90c0-8.284-6.716-15-15-15z"
|
1076
|
-
}));
|
1077
|
-
});
|
1078
|
-
|
1079
|
-
var css$6 = ".LegalInfoTooltip-module_legalInfoTooltip__ChzOS {\n width: 200px;\n max-width: 200px;\n text-align: left;\n}\n\n.LegalInfoTooltip-module_legalInfoTooltip__ChzOS:after {\n left: 90% !important;\n}\n\n.LegalInfoTooltip-module_legalInfoTooltip__ChzOS p {\n margin: 0 0 0.5em;\n}\n\n.LegalInfoTooltip-module_legalInfoTooltip__ChzOS a {\n color: #e10028;\n}\n";
|
1080
|
-
var styles$5 = {"legalInfoTooltip":"LegalInfoTooltip-module_legalInfoTooltip__ChzOS"};
|
1081
|
-
styleInject(css$6);
|
1082
|
-
|
1083
|
-
function LegalInfoLink(props) {
|
1084
|
-
return React.createElement("div", null, props.label && props.url && React.createElement("a", {
|
1085
|
-
target: "_blank",
|
1086
|
-
href: props.url,
|
1087
|
-
dangerouslySetInnerHTML: {
|
1088
|
-
__html: props.label
|
1089
|
-
}
|
1090
|
-
}));
|
1091
|
-
}
|
1092
|
-
|
1093
|
-
function LegalInfoTooltip() {
|
1094
|
-
var fileRights = useFileRights();
|
1095
|
-
var legalInfo = useLegalInfo();
|
1096
|
-
var credits = useCredits();
|
1097
|
-
return React.createElement(ReactTooltip, {
|
1098
|
-
id: 'legalInfoTooltip',
|
1099
|
-
type: 'light',
|
1100
|
-
place: 'bottom',
|
1101
|
-
effect: 'solid',
|
1102
|
-
event: 'click',
|
1103
|
-
globalEventOff: 'click',
|
1104
|
-
clickable: true,
|
1105
|
-
offset: {
|
1106
|
-
right: -97
|
1107
|
-
},
|
1108
|
-
className: classNames(styles.navigationTooltip, styles$5.legalInfoTooltip)
|
1109
|
-
}, React.createElement("div", {
|
1110
|
-
onMouseLeave: function onMouseLeave() {
|
1111
|
-
ReactTooltip.hide();
|
1112
|
-
}
|
1113
|
-
}, credits && React.createElement("p", {
|
1114
|
-
dangerouslySetInnerHTML: {
|
1115
|
-
__html: credits
|
1116
|
-
}
|
1117
|
-
}), fileRights && React.createElement("p", null, fileRights), React.createElement(LegalInfoLink, legalInfo.imprint), React.createElement(LegalInfoLink, legalInfo.copyright), React.createElement(LegalInfoLink, legalInfo.privacy)));
|
1118
|
-
}
|
1119
|
-
|
1120
|
-
function LegalInfoMenu(props) {
|
1121
|
-
return React.createElement("div", null, React.createElement("a", {
|
1122
|
-
className: classNames(styles.contextIcon, styles$4.infoIcon),
|
1123
|
-
"data-tip": true,
|
1124
|
-
"data-for": 'legalInfoTooltip',
|
1125
|
-
onMouseEnter: function onMouseEnter() {
|
1126
|
-
ReactTooltip.hide();
|
1127
|
-
}
|
1128
|
-
}, React.createElement(InfoIcon, null)), React.createElement(LegalInfoTooltip, null));
|
1129
|
-
}
|
1130
|
-
|
1131
|
-
var css$7 = ".SharingMenu-module_shareIcon__1AlDL svg {\n width: 40px;\n height: 40px;\n margin: 5px 0px;\n}";
|
1132
|
-
var styles$6 = {"shareIcon":"SharingMenu-module_shareIcon__1AlDL"};
|
1133
|
-
styleInject(css$7);
|
1134
|
-
|
1135
|
-
function _extends$7() {
|
1136
|
-
_extends$7 = Object.assign || function (target) {
|
1137
|
-
for (var i = 1; i < arguments.length; i++) {
|
1138
|
-
var source = arguments[i];
|
1139
|
-
|
1140
|
-
for (var key in source) {
|
1141
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1142
|
-
target[key] = source[key];
|
1143
|
-
}
|
1144
|
-
}
|
1145
|
-
}
|
1146
|
-
|
1147
|
-
return target;
|
1148
|
-
};
|
1149
|
-
|
1150
|
-
return _extends$7.apply(this, arguments);
|
1151
|
-
}
|
1152
|
-
var ShareIcon = (function (_ref) {
|
1153
|
-
var _ref$styles = _ref.styles,
|
1154
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
1155
|
-
|
1156
|
-
return React.createElement("svg", _extends$7({
|
1157
|
-
xmlns: "http://www.w3.org/2000/svg",
|
1158
|
-
viewBox: "0 0 96 96"
|
1159
|
-
}, props), React.createElement("path", {
|
1160
|
-
d: "M67.5 18c-5.1 0-9.3 4.2-9.3 9.3 0 .5.1 1.1.2 1.6l-23 12.9c-1.7-1.8-4.1-3-6.8-3-5.1 0-9.3 4.1-9.3 9.3 0 5.1 4.1 9.3 9.3 9.3 2.7 0 5.2-1.2 6.9-3.1l22.8 13.4c0 .4-.1.7-.1 1.1 0 5.1 4.1 9.3 9.3 9.3 5.1 0 9.3-4.1 9.3-9.3 0-5.1-4.1-9.3-9.3-9.3-2.8 0-5.4 1.3-7.1 3.3L37.7 49.4c.1-.4.1-.9.1-1.3 0-.5 0-1-.1-1.5l23.1-13c1.7 1.8 4.1 3 6.8 3 5.1 0 9.3-4.1 9.3-9.3-.1-5.1-4.3-9.3-9.4-9.3z"
|
1161
|
-
}));
|
1162
|
-
});
|
1163
|
-
|
1164
|
-
var css$8 = "header .share svg {\n fill: rgb(0, 55, 90);\n}\n\nheader .share:hover svg {\n fill: #e10028;\n}\n\n.SharingTooltip-module_sharingTooltip__1cljv {\n width: 160px;\n padding: 0 !important;\n}\n\n.SharingTooltip-module_sharingTooltip__1cljv:after {\n left: 90% !important;\n}\n\n.SharingTooltip-module_shareLinkContainer__2MnKN {\n display: inline-block;\n width: 80px;\n height: 60px;\n cursor: pointer;\n color: transparent;\n text-align: center;\n}\n\n.SharingTooltip-module_shareLink__2ySSX {\n position: relative;\n color: rgb(0, 55, 90);\n text-decoration: none;\n}\n\n.SharingTooltip-module_shareLink__2ySSX:hover {\n color: #e10028;\n}\n\n.SharingTooltip-module_shareIcon__3igrs {\n width: 80px;\n height: 25px;\n margin-top: 5px;\n margin-bottom: 3px;\n}\n";
|
1165
|
-
var styles$7 = {"sharingTooltip":"SharingTooltip-module_sharingTooltip__1cljv","shareLinkContainer":"SharingTooltip-module_shareLinkContainer__2MnKN","shareLink":"SharingTooltip-module_shareLink__2ySSX","shareIcon":"SharingTooltip-module_shareIcon__3igrs"};
|
1166
|
-
styleInject(css$8);
|
1167
|
-
|
1168
|
-
function SharingTooltip() {
|
1169
|
-
var shareUrl = useShareUrl();
|
1170
|
-
var shareProviders = useShareProviders();
|
1171
|
-
|
1172
|
-
function renderShareLinks(shareProviders) {
|
1173
|
-
return shareProviders.map(function (shareProvider) {
|
1174
|
-
var Icon = shareProvider.icon;
|
1175
|
-
return React.createElement("div", {
|
1176
|
-
key: shareProvider.name,
|
1177
|
-
className: styles$7.shareLinkContainer
|
1178
|
-
}, React.createElement("a", {
|
1179
|
-
className: classNames('share', styles$7.shareLink),
|
1180
|
-
href: shareProvider.url.replace('%{url}', shareUrl),
|
1181
|
-
target: '_blank'
|
1182
|
-
}, React.createElement(Icon, {
|
1183
|
-
className: styles$7.shareIcon
|
1184
|
-
}), shareProvider.name));
|
1185
|
-
});
|
1186
|
-
}
|
1187
|
-
return React.createElement(ReactTooltip, {
|
1188
|
-
id: 'sharingTooltip',
|
1189
|
-
type: 'light',
|
1190
|
-
place: 'bottom',
|
1191
|
-
effect: 'solid',
|
1192
|
-
event: 'click',
|
1193
|
-
globalEventOff: 'click',
|
1194
|
-
clickable: true,
|
1195
|
-
offset: {
|
1196
|
-
right: -64
|
1197
|
-
},
|
1198
|
-
className: classNames(styles.navigationTooltip, styles$7.sharingTooltip)
|
1199
|
-
}, React.createElement("div", {
|
1200
|
-
onMouseLeave: function onMouseLeave() {
|
1201
|
-
ReactTooltip.hide();
|
1202
|
-
}
|
1203
|
-
}, renderShareLinks(shareProviders)));
|
1204
|
-
}
|
1205
|
-
|
1206
|
-
function SharingMenu() {
|
1207
|
-
var shareProviders = useShareProviders();
|
1208
|
-
|
1209
|
-
if (shareProviders.length > 0) {
|
1210
|
-
return React.createElement("div", null, React.createElement("a", {
|
1211
|
-
className: classNames(styles.contextIcon, styles$6.shareIcon),
|
1212
|
-
"data-tip": true,
|
1213
|
-
"data-for": 'sharingTooltip',
|
1214
|
-
onMouseEnter: function onMouseEnter() {
|
1215
|
-
ReactTooltip.hide();
|
1216
|
-
}
|
1217
|
-
}, React.createElement(ShareIcon, null)), React.createElement(SharingTooltip, null));
|
1218
|
-
} else {
|
1219
|
-
return null;
|
1220
|
-
}
|
1221
|
-
}
|
1222
|
-
|
1223
|
-
function _extends$8() {
|
1224
|
-
_extends$8 = Object.assign || function (target) {
|
1225
|
-
for (var i = 1; i < arguments.length; i++) {
|
1226
|
-
var source = arguments[i];
|
1227
|
-
|
1228
|
-
for (var key in source) {
|
1229
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1230
|
-
target[key] = source[key];
|
1231
|
-
}
|
1232
|
-
}
|
1233
|
-
}
|
1234
|
-
|
1235
|
-
return target;
|
1236
|
-
};
|
1237
|
-
|
1238
|
-
return _extends$8.apply(this, arguments);
|
1239
|
-
}
|
1240
|
-
var WDRlogo = (function (_ref) {
|
1241
|
-
var _ref$styles = _ref.styles,
|
1242
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
1243
|
-
|
1244
|
-
return React.createElement("svg", _extends$8({
|
1245
|
-
viewBox: "-0.445 -0.445 51.921 15.721"
|
1246
|
-
}, props), React.createElement("path", {
|
1247
|
-
d: "M31.189 14.83h3.731v-4.772h.285c.425 0 1.496-.023 2.079.919l2.292 3.854h4.015l-2.088-3.509c-.69-1.176-1.258-1.806-1.704-2.13v-.039c1.259-.446 2.636-1.522 2.636-3.715 0-2.716-1.946-4.116-5.394-4.116H31.19v4.689h-.038c-.708-2.829-3.095-4.689-7.453-4.689h-8.253l-1.257 5.516a42.42 42.42 0 00-.488 2.578h-.04s-.284-1.603-.547-2.74l-1.077-5.354h-4.53L6.43 6.676c-.264 1.137-.547 2.74-.547 2.74H5.84s-.222-1.442-.486-2.578L4.097 1.322H0L3.61 14.83h4.121L9.78 6.169h.041l2.048 8.662h4.056L18.93 3.614h.04v11.217h4.606c4.42 0 6.86-2.028 7.577-4.927h.036v4.927zm-7.309-3.062h-1.135V4.384h1.034c2.475 0 3.59 1.095 3.59 3.612 0 2.473-1.115 3.772-3.489 3.772m13.08-4.565h-2.04V4.182h1.918c1.278 0 1.806.506 1.806 1.52 0 .934-.548 1.501-1.684 1.501m12.003-2.317V1.404L45.48 2.66v.865l1.153-.418v2.616l2.33-.838zM47.573 0a3.469 3.469 0 013.459 3.478 3.468 3.468 0 01-3.46 3.477 3.468 3.468 0 01-3.458-3.478A3.469 3.469 0 0147.573 0m0 .51a2.96 2.96 0 00-2.951 2.967 2.96 2.96 0 002.95 2.968 2.96 2.96 0 002.953-2.967A2.96 2.96 0 0047.573.51",
|
1248
|
-
fill: "#00375a"
|
1249
|
-
}));
|
1250
|
-
});
|
1251
|
-
|
1252
|
-
function AppHeader(props) {
|
1253
|
-
var _useState = useState(true),
|
1254
|
-
_useState2 = _slicedToArray(_useState, 2),
|
1255
|
-
navExpanded = _useState2[0],
|
1256
|
-
setNavExpanded = _useState2[1];
|
1257
|
-
|
1258
|
-
var _useState3 = useState(true),
|
1259
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
1260
|
-
mobileNavHidden = _useState4[0],
|
1261
|
-
setMobileNavHidden = _useState4[1];
|
1262
|
-
|
1263
|
-
var _useState5 = useState(0),
|
1264
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
1265
|
-
readingProgress = _useState6[0],
|
1266
|
-
setReadingProgress = _useState6[1];
|
1267
|
-
|
1268
|
-
var _useState7 = useState('chapterLink1'),
|
1269
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
1270
|
-
activeChapterLink = _useState8[0],
|
1271
|
-
setActiveChapterLink = _useState8[1];
|
1272
|
-
|
1273
|
-
var entryStructure = useEntryStructure();
|
1274
|
-
var ref = useRef();
|
1275
|
-
useNativeScrollPrevention(ref);
|
1276
|
-
var chapters = entryStructure.map(function (chapter) {
|
1277
|
-
return {
|
1278
|
-
permaId: chapter.permaId,
|
1279
|
-
title: chapter.title,
|
1280
|
-
summary: chapter.summary
|
1281
|
-
};
|
1282
|
-
});
|
1283
|
-
useScrollPosition(function (_ref) {
|
1284
|
-
var prevPos = _ref.prevPos,
|
1285
|
-
currPos = _ref.currPos;
|
1286
|
-
var expand = currPos.y > prevPos.y;
|
1287
|
-
if (expand !== navExpanded) setNavExpanded(expand);
|
1288
|
-
}, [navExpanded]);
|
1289
|
-
useScrollPosition(function (_ref2) {
|
1290
|
-
var prevPos = _ref2.prevPos,
|
1291
|
-
currPos = _ref2.currPos;
|
1292
|
-
var current = currPos.y * -1; // Todo: Memoize and update on window resize
|
1293
|
-
|
1294
|
-
var total = document.body.clientHeight - window.innerHeight;
|
1295
|
-
var progress = Math.abs(current / total) * 100;
|
1296
|
-
setReadingProgress(progress);
|
1297
|
-
}, [readingProgress], null, false, 1);
|
1298
|
-
|
1299
|
-
function handleProgressBarMouseEnter() {
|
1300
|
-
setNavExpanded(true);
|
1301
|
-
}
|
1302
|
-
|
1303
|
-
function handleBurgerMenuClick() {
|
1304
|
-
setMobileNavHidden(!mobileNavHidden);
|
1305
|
-
}
|
1306
|
-
|
1307
|
-
function handleMenuClick(chapterLinkId) {
|
1308
|
-
setActiveChapterLink(chapterLinkId);
|
1309
|
-
setMobileNavHidden(true);
|
1310
|
-
}
|
1311
|
-
|
1312
|
-
function renderChapterLinks(chapters) {
|
1313
|
-
return chapters.filter(function (chapterConfiguration) {
|
1314
|
-
return chapterConfiguration.title && chapterConfiguration.summary;
|
1315
|
-
}).map(function (chapter, index) {
|
1316
|
-
var chapterIndex = index + 1;
|
1317
|
-
var chapterLinkId = "chapterLink".concat(chapterIndex);
|
1318
|
-
return React.createElement("li", {
|
1319
|
-
key: index,
|
1320
|
-
className: styles.chapterListItem
|
1321
|
-
}, React.createElement(ChapterLink, Object.assign({}, chapter, {
|
1322
|
-
chapterIndex: chapterIndex,
|
1323
|
-
chapterLinkId: chapterLinkId,
|
1324
|
-
active: activeChapterLink === chapterLinkId,
|
1325
|
-
handleMenuClick: handleMenuClick
|
1326
|
-
})));
|
1327
|
-
});
|
1328
|
-
}
|
1329
|
-
return React.createElement("header", {
|
1330
|
-
className: classNames(styles.navigationBar, _defineProperty({}, styles.navigationBarExpanded, navExpanded))
|
1331
|
-
}, React.createElement("div", {
|
1332
|
-
className: styles.navigationBarContentWrapper
|
1333
|
-
}, React.createElement(HamburgerIcon, {
|
1334
|
-
onClick: handleBurgerMenuClick,
|
1335
|
-
mobileNavHidden: mobileNavHidden
|
1336
|
-
}), React.createElement(WDRlogo, {
|
1337
|
-
className: classNames(styles.menuIcon, styles.wdrLogo)
|
1338
|
-
}), React.createElement("nav", {
|
1339
|
-
className: classNames(styles.navigationChapters, _defineProperty({}, styles.navigationChaptersHidden, mobileNavHidden)),
|
1340
|
-
role: "navigation",
|
1341
|
-
ref: ref
|
1342
|
-
}, React.createElement("ul", {
|
1343
|
-
className: styles.chapterList
|
1344
|
-
}, renderChapterLinks(chapters))), React.createElement("div", {
|
1345
|
-
className: classNames(styles.contextIcons)
|
1346
|
-
}, React.createElement(SharingMenu, null), React.createElement(LegalInfoMenu, null))), React.createElement("div", {
|
1347
|
-
className: styles.progressBar,
|
1348
|
-
onMouseEnter: handleProgressBarMouseEnter
|
1349
|
-
}, React.createElement("span", {
|
1350
|
-
className: styles.progressIndicator,
|
1351
|
-
style: {
|
1352
|
-
width: readingProgress + '%'
|
1353
|
-
}
|
1354
|
-
})));
|
1355
|
-
}
|
1356
|
-
|
1357
|
-
function useOnScreen(ref) {
|
1358
|
-
var rootMargin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0px';
|
1359
|
-
var cb = arguments.length > 2 ? arguments[2] : undefined;
|
1360
|
-
|
1361
|
-
var _useState = useState(false),
|
1362
|
-
_useState2 = _slicedToArray(_useState, 2),
|
1363
|
-
isIntersecting = _useState2[0],
|
1364
|
-
setIntersecting = _useState2[1];
|
1365
|
-
|
1366
|
-
useEffect(function () {
|
1367
|
-
var current = ref.current;
|
1368
|
-
var observer = new IntersectionObserver(function (_ref) {
|
1369
|
-
var _ref2 = _slicedToArray(_ref, 1),
|
1370
|
-
entry = _ref2[0];
|
1371
|
-
|
1372
|
-
setIntersecting(entry.isIntersecting);
|
1373
|
-
|
1374
|
-
if (entry.isIntersecting && cb) {
|
1375
|
-
cb();
|
1376
|
-
}
|
1377
|
-
}, {
|
1378
|
-
rootMargin: rootMargin
|
1379
|
-
});
|
1380
|
-
|
1381
|
-
if (ref.current) {
|
1382
|
-
observer.observe(current);
|
1383
|
-
}
|
1384
|
-
|
1385
|
-
return function () {
|
1386
|
-
observer.unobserve(current);
|
1387
|
-
};
|
1388
|
-
}, [ref, rootMargin, cb]);
|
1389
|
-
return isIntersecting;
|
1390
|
-
}
|
1391
|
-
|
1392
|
-
var css$9 = ".Fullscreen-module_root__1N3CI {\n width: 100%;\n height: 100vh;\n position: relative;\n overflow: hidden;\n}\n";
|
1393
|
-
var styles$8 = {"root":"Fullscreen-module_root__1N3CI"};
|
1394
|
-
styleInject(css$9);
|
1395
|
-
|
1396
|
-
var Fullscreen = React.forwardRef(function Fullscreen(props, ref) {
|
1397
|
-
return React.createElement("div", {
|
1398
|
-
ref: ref,
|
1399
|
-
className: styles$8.root
|
1400
|
-
}, props.children);
|
1401
|
-
});
|
1402
|
-
|
1403
|
-
var css$a = ".Image-module_root__1ef3j {\n background-size: cover;\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n}\n\n@media (orientation: landscape) {\n .Image-module_portrait__1mRha {\n display: none;\n }\n}\n\n@media (orientation: portrait) {\n .Image-module_portrait__1mRha {\n display: block;\n }\n}";
|
1404
|
-
var styles$9 = {"root":"Image-module_root__1ef3j","portrait":"Image-module_portrait__1mRha"};
|
1405
|
-
styleInject(css$a);
|
1406
|
-
|
1407
|
-
/**
|
1408
|
-
* Render an image file.
|
1409
|
-
*
|
1410
|
-
* @param {Object} props
|
1411
|
-
* @param {number} props.id - Perma id of the image file.
|
1412
|
-
*/
|
1413
|
-
|
1414
|
-
function Image(props) {
|
1415
|
-
var image = useFile({
|
1416
|
-
collectionName: 'imageFiles',
|
1417
|
-
permaId: props.id
|
1418
|
-
});
|
1419
|
-
|
1420
|
-
if (image) {
|
1421
|
-
var focusX = typeof image.configuration.focusX === 'undefined' ? 50 : image.configuration.focusX;
|
1422
|
-
var focusY = typeof image.configuration.focusY === 'undefined' ? 50 : image.configuration.focusY;
|
1423
|
-
return React.createElement("div", {
|
1424
|
-
className: classNames(styles$9.root, _defineProperty({}, styles$9.portrait, props.mobile)),
|
1425
|
-
role: "img",
|
1426
|
-
style: {
|
1427
|
-
backgroundImage: "url(".concat(image.urls.large, ")"),
|
1428
|
-
backgroundPosition: "".concat(focusX, "% ").concat(focusY, "%")
|
1429
|
-
}
|
1430
|
-
});
|
1431
|
-
}
|
1432
|
-
|
1433
|
-
return null;
|
1434
|
-
}
|
1435
|
-
|
1436
|
-
var ScrollToSectionContext = React.createContext(function () {});
|
1437
|
-
|
1438
|
-
var MutedContext = React.createContext({
|
1439
|
-
muted: true,
|
1440
|
-
setMuted: function setMuted() {},
|
1441
|
-
mediaOff: true
|
1442
|
-
});
|
1443
|
-
|
1444
|
-
var css$b = ".Video-module_root__30u0y {\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n}\n\n.Video-module_video__3FJvj {\n width: 100%;\n height: 100%;\n transition: transform ease 0.2s;\n outline: none;\n}\n\n.Video-module_video__3FJvj:focus {\n outline: none;\n}\n\n.Video-module_backdrop__1R7f4 {\n object-fit: cover;\n}\n";
|
1445
|
-
var styles$a = {"root":"Video-module_root__30u0y","video":"Video-module_video__3FJvj","backdrop":"Video-module_backdrop__1R7f4"};
|
1446
|
-
styleInject(css$b);
|
1447
|
-
|
1448
|
-
function Video(props) {
|
1449
|
-
var awsBucket = '//s3-eu-west-1.amazonaws.com/de.codevise.pageflow.development/pageflow-next/presentation-videos/';
|
1450
|
-
var videoBoatSunset = awsBucket + 'floodplain-clean.mp4';
|
1451
|
-
var poster_videoBoatSunset = awsBucket + 'posterframes/poster_katerchen.jpeg';
|
1452
|
-
var videoBoatDark = awsBucket + 'floodplain-dirty.mp4';
|
1453
|
-
var poster_videoBoatDark = awsBucket + 'posterframes/poster_katerchen.jpeg';
|
1454
|
-
var videoKaterchen = awsBucket + 'katerchen.mp4';
|
1455
|
-
var poster_videoKaterchen = awsBucket + 'posterframes/poster_katerchen.jpeg';
|
1456
|
-
var videoGarzweilerLoop1 = awsBucket + 'braunkohle_loop1.mp4';
|
1457
|
-
var poster_videoGarzweilerLoop1 = awsBucket + 'posterframes/poster_braunkohle_loop1.jpeg';
|
1458
|
-
var videoGarzweilerLoop2 = awsBucket + 'braunkohle_loop2.mp4';
|
1459
|
-
var poster_videoGarzweilerLoop2 = awsBucket + 'posterframes/poster_braunkohle_loop2.jpeg';
|
1460
|
-
var videoGarzweilerDrohne = awsBucket + 'braunkohle_drone.mp4';
|
1461
|
-
var poster_videoGarzweilerDrohne = awsBucket + 'posterframes/poster_braunkohle_drone.jpeg';
|
1462
|
-
var videoInselInterviewToni = awsBucket + 'pageflow_insel_interview_toni02.mp4';
|
1463
|
-
var poster_videoInselInterviewToni = awsBucket + 'posterframes/poster_pageflow_insel_interview_toni02.jpg';
|
1464
|
-
var videoUrl = {
|
1465
|
-
videoBoatSunset: videoBoatSunset,
|
1466
|
-
videoBoatDark: videoBoatDark,
|
1467
|
-
videoKaterchen: videoKaterchen,
|
1468
|
-
videoGarzweilerLoop1: videoGarzweilerLoop1,
|
1469
|
-
videoGarzweilerLoop2: videoGarzweilerLoop2,
|
1470
|
-
videoGarzweilerDrohne: videoGarzweilerDrohne,
|
1471
|
-
videoInselInterviewToni: videoInselInterviewToni
|
1472
|
-
}[props.id];
|
1473
|
-
var posterUrl = {
|
1474
|
-
poster_videoBoatSunset: poster_videoBoatSunset,
|
1475
|
-
poster_videoBoatDark: poster_videoBoatDark,
|
1476
|
-
poster_videoKaterchen: poster_videoKaterchen,
|
1477
|
-
poster_videoGarzweilerLoop1: poster_videoGarzweilerLoop1,
|
1478
|
-
poster_videoGarzweilerLoop2: poster_videoGarzweilerLoop2,
|
1479
|
-
poster_videoGarzweilerDrohne: poster_videoGarzweilerDrohne,
|
1480
|
-
poster_videoInselInterviewToni: poster_videoInselInterviewToni
|
1481
|
-
}['poster_' + props.id];
|
1482
|
-
var videoRef = useRef();
|
1483
|
-
var state = props.state;
|
1484
|
-
var mutedSettings = useContext(MutedContext);
|
1485
|
-
useEffect(function () {
|
1486
|
-
var video = videoRef.current;
|
1487
|
-
|
1488
|
-
if (!video) {
|
1489
|
-
return;
|
1490
|
-
}
|
1491
|
-
|
1492
|
-
video.muted = mutedSettings.muted;
|
1493
|
-
|
1494
|
-
if (!mutedSettings.mediaOff && props.autoplay !== false) {
|
1495
|
-
if (state === 'active') {
|
1496
|
-
if (video.readyState > 0) {
|
1497
|
-
video.play();
|
1498
|
-
} else {
|
1499
|
-
video.addEventListener('loadedmetadata', play);
|
1500
|
-
return function () {
|
1501
|
-
return video.removeEventListener('loadedmetadata', play);
|
1502
|
-
};
|
1503
|
-
}
|
1504
|
-
} else {
|
1505
|
-
video.pause();
|
1506
|
-
}
|
1507
|
-
}
|
1508
|
-
|
1509
|
-
function play() {
|
1510
|
-
video.play();
|
1511
|
-
}
|
1512
|
-
}, [state, mutedSettings.mediaOff, mutedSettings.muted, props.autoplay]);
|
1513
|
-
return React.createElement("div", {
|
1514
|
-
className: styles$a.root
|
1515
|
-
}, React.createElement(ScrollToSectionContext.Consumer, null, function (scrollToSection) {
|
1516
|
-
return React.createElement("video", {
|
1517
|
-
role: "img",
|
1518
|
-
src: videoUrl,
|
1519
|
-
ref: videoRef,
|
1520
|
-
className: classNames(styles$a.video, _defineProperty({}, styles$a.backdrop, !props.interactive)),
|
1521
|
-
controls: props.controls,
|
1522
|
-
playsInline: true,
|
1523
|
-
onEnded: function onEnded() {
|
1524
|
-
return props.nextSectionOnEnd && scrollToSection('next');
|
1525
|
-
},
|
1526
|
-
loop: !props.interactive,
|
1527
|
-
poster: posterUrl
|
1528
|
-
});
|
1529
|
-
}));
|
1530
|
-
}
|
1531
|
-
Video.defaultProps = {
|
1532
|
-
interactive: false,
|
1533
|
-
controls: false
|
1534
|
-
};
|
1535
|
-
|
1536
|
-
var css$c = ".FillColor-module_FillColor__S1uEG {\n width: 100%;\n height: 100vh;\n}\n";
|
1537
|
-
var styles$b = {"FillColor":"FillColor-module_FillColor__S1uEG"};
|
1538
|
-
styleInject(css$c);
|
1539
|
-
|
1540
|
-
function FillColor(props) {
|
1541
|
-
return React.createElement("div", {
|
1542
|
-
className: styles$b.FillColor,
|
1543
|
-
style: {
|
1544
|
-
backgroundColor: props.color
|
1545
|
-
}
|
1546
|
-
});
|
1547
|
-
}
|
1548
|
-
|
1549
|
-
var css$d = ".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";
|
1550
|
-
var styles$c = {"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"};
|
1551
|
-
styleInject(css$d);
|
1552
|
-
|
1553
|
-
var MotifArea = React.forwardRef(function MotifArea(props, ref) {
|
1554
|
-
var image = useFile({
|
1555
|
-
collectionName: 'imageFiles',
|
1556
|
-
permaId: props.imageId
|
1557
|
-
});
|
1558
|
-
|
1559
|
-
if (!image) {
|
1560
|
-
return null;
|
1561
|
-
}
|
1562
|
-
|
1563
|
-
return React.createElement("div", {
|
1564
|
-
ref: ref,
|
1565
|
-
className: classNames(styles$c.root, _defineProperty({}, styles$c.active, props.active)),
|
1566
|
-
style: position(props, image),
|
1567
|
-
onMouseEnter: props.onMouseEnter,
|
1568
|
-
onMouseLeave: props.onMouseLeave
|
1569
|
-
}, React.createElement("div", {
|
1570
|
-
className: styles$c.topLeft
|
1571
|
-
}), React.createElement("div", {
|
1572
|
-
className: styles$c.topRight
|
1573
|
-
}), React.createElement("div", {
|
1574
|
-
className: styles$c.bottomLeft
|
1575
|
-
}), React.createElement("div", {
|
1576
|
-
className: styles$c.bottomRight
|
1577
|
-
}));
|
1578
|
-
});
|
1579
|
-
|
1580
|
-
function position(props, image) {
|
1581
|
-
var originalRatio = image.width / image.height;
|
1582
|
-
var containerRatio = props.containerWidth / props.containerHeight;
|
1583
|
-
var scale = containerRatio > originalRatio ? props.containerWidth / image.width : props.containerHeight / image.height;
|
1584
|
-
var contentWidth = image.width * scale;
|
1585
|
-
var contentHeight = image.height * scale;
|
1586
|
-
var focusX = image.configuration.focusX === undefined ? 50 : image.configuration.focusX;
|
1587
|
-
var focusY = image.configuration.focusY === undefined ? 50 : image.configuration.focusY;
|
1588
|
-
var cropLeft = (contentWidth - props.containerWidth) * focusX / 100;
|
1589
|
-
var cropTop = (contentHeight - props.containerHeight) * focusY / 100;
|
1590
|
-
var motifArea = image.configuration.motifArea || {
|
1591
|
-
top: 0,
|
1592
|
-
left: 0,
|
1593
|
-
width: 0,
|
1594
|
-
height: 0
|
1595
|
-
};
|
1596
|
-
return {
|
1597
|
-
top: contentHeight * motifArea.top / 100 - cropTop,
|
1598
|
-
left: contentWidth * motifArea.left / 100 - cropLeft,
|
1599
|
-
width: contentWidth * motifArea.width / 100,
|
1600
|
-
height: contentHeight * motifArea.height / 100
|
1601
|
-
};
|
1602
|
-
}
|
1603
|
-
|
1604
|
-
function getSize(el) {
|
1605
|
-
if (!el) {
|
1606
|
-
return {
|
1607
|
-
left: 0,
|
1608
|
-
top: 0,
|
1609
|
-
width: 0,
|
1610
|
-
height: 0
|
1611
|
-
};
|
1612
|
-
}
|
1613
|
-
|
1614
|
-
return {
|
1615
|
-
left: el.offsetLeft,
|
1616
|
-
top: el.offsetTop,
|
1617
|
-
width: el.offsetWidth,
|
1618
|
-
height: el.offsetHeight
|
1619
|
-
};
|
1620
|
-
}
|
1621
|
-
|
1622
|
-
function useDimension() {
|
1623
|
-
var _useState = useState(getSize(null)),
|
1624
|
-
_useState2 = _slicedToArray(_useState, 2),
|
1625
|
-
componentSize = _useState2[0],
|
1626
|
-
setComponentSize = _useState2[1];
|
1627
|
-
|
1628
|
-
var _useState3 = useState(null),
|
1629
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
1630
|
-
currentNode = _useState4[0],
|
1631
|
-
setCurrentNode = _useState4[1];
|
1632
|
-
|
1633
|
-
var measuredRef = useCallback(function (node) {
|
1634
|
-
setCurrentNode(node);
|
1635
|
-
setComponentSize(getSize(node));
|
1636
|
-
}, []);
|
1637
|
-
useEffect(function () {
|
1638
|
-
function handleResize() {
|
1639
|
-
setComponentSize(getSize(currentNode));
|
1640
|
-
}
|
1641
|
-
|
1642
|
-
if (!currentNode) {
|
1643
|
-
return;
|
1644
|
-
}
|
1645
|
-
|
1646
|
-
handleResize();
|
1647
|
-
window.addEventListener('resize', handleResize);
|
1648
|
-
return function () {
|
1649
|
-
window.removeEventListener('resize', handleResize);
|
1650
|
-
};
|
1651
|
-
}, [currentNode]);
|
1652
|
-
return [componentSize, measuredRef];
|
1653
|
-
}
|
1654
|
-
|
1655
|
-
var videos = {
|
1656
|
-
videoBoatSunset: {
|
1657
|
-
id: "videoBoatSunset",
|
1658
|
-
width: 960,
|
1659
|
-
height: 406,
|
1660
|
-
motiveArea: {
|
1661
|
-
top: 0,
|
1662
|
-
left: 0,
|
1663
|
-
width: 0,
|
1664
|
-
height: 0
|
1665
|
-
},
|
1666
|
-
focusX: 50,
|
1667
|
-
focusY: 50
|
1668
|
-
},
|
1669
|
-
videoBoatDark: {
|
1670
|
-
id: "videoBoatDark",
|
1671
|
-
width: 960,
|
1672
|
-
height: 406,
|
1673
|
-
motiveArea: {
|
1674
|
-
top: 0,
|
1675
|
-
left: 0,
|
1676
|
-
width: 0,
|
1677
|
-
height: 0
|
1678
|
-
},
|
1679
|
-
focusX: 50,
|
1680
|
-
focusY: 50
|
1681
|
-
},
|
1682
|
-
videoKaterchen: {
|
1683
|
-
id: "videoKaterchen",
|
1684
|
-
width: 1920,
|
1685
|
-
height: 1080,
|
1686
|
-
motiveArea: {
|
1687
|
-
top: 0,
|
1688
|
-
left: 0,
|
1689
|
-
width: 0,
|
1690
|
-
height: 0
|
1691
|
-
},
|
1692
|
-
focusX: 50,
|
1693
|
-
focusY: 50
|
1694
|
-
},
|
1695
|
-
videoGarzweilerLoop1: {
|
1696
|
-
id: "videoGarzweilerLoop1",
|
1697
|
-
width: 3840,
|
1698
|
-
height: 2160,
|
1699
|
-
motiveArea: {
|
1700
|
-
top: 0,
|
1701
|
-
left: 0,
|
1702
|
-
width: 1,
|
1703
|
-
height: 1
|
1704
|
-
},
|
1705
|
-
focusX: 50,
|
1706
|
-
focusY: 50
|
1707
|
-
},
|
1708
|
-
videoGarzweilerLoop2: {
|
1709
|
-
id: "videoGarzweilerLoop2",
|
1710
|
-
width: 1920,
|
1711
|
-
height: 1080,
|
1712
|
-
motiveArea: {
|
1713
|
-
top: 0,
|
1714
|
-
left: 0,
|
1715
|
-
width: 1,
|
1716
|
-
height: 1
|
1717
|
-
},
|
1718
|
-
focusX: 15,
|
1719
|
-
focusY: 20
|
1720
|
-
},
|
1721
|
-
videoGarzweilerDrohne: {
|
1722
|
-
id: "videoGarzweilerDrohne",
|
1723
|
-
width: 1920,
|
1724
|
-
height: 1080,
|
1725
|
-
motiveArea: {
|
1726
|
-
top: 0,
|
1727
|
-
left: 0,
|
1728
|
-
width: 0,
|
1729
|
-
height: 0
|
1730
|
-
}
|
1731
|
-
},
|
1732
|
-
videoInselInterviewToni: {
|
1733
|
-
id: "videoInselInterviewToni",
|
1734
|
-
width: 1920,
|
1735
|
-
height: 1080,
|
1736
|
-
motiveArea: {
|
1737
|
-
top: 0,
|
1738
|
-
left: 0,
|
1739
|
-
width: 0,
|
1740
|
-
height: 0
|
1741
|
-
}
|
1742
|
-
}
|
1743
|
-
};
|
1744
|
-
|
1745
|
-
var css$e = ".Backdrop-module_Backdrop__1w4UZ {\n width: 100%;\n z-index: 2;\n}\n\n.Backdrop-module_offScreen__2_FYZ {\n}\n";
|
1746
|
-
var styles$d = {"Backdrop":"Backdrop-module_Backdrop__1w4UZ","offScreen":"Backdrop-module_offScreen__2_FYZ"};
|
1747
|
-
styleInject(css$e);
|
1748
|
-
|
1749
|
-
function Backdrop(props) {
|
1750
|
-
var _useDimension = useDimension(),
|
1751
|
-
_useDimension2 = _slicedToArray(_useDimension, 2),
|
1752
|
-
containerDimension = _useDimension2[0],
|
1753
|
-
setContainerRef = _useDimension2[1];
|
1754
|
-
|
1755
|
-
return React.createElement("div", {
|
1756
|
-
className: classNames(styles$d.Backdrop, props.transitionStyles.backdrop, props.transitionStyles["backdrop-".concat(props.state)], _defineProperty({}, styles$d.offScreen, props.offScreen))
|
1757
|
-
}, React.createElement("div", {
|
1758
|
-
className: props.transitionStyles.backdropInner
|
1759
|
-
}, React.createElement("div", {
|
1760
|
-
className: props.transitionStyles.backdropInner2
|
1761
|
-
}, props.children(renderContent(props, containerDimension, setContainerRef)))));
|
1762
|
-
}
|
1763
|
-
Backdrop.defaultProps = {
|
1764
|
-
transitionStyles: {}
|
1765
|
-
};
|
1766
|
-
|
1767
|
-
function renderContent(props, containerDimension, setContainerRef) {
|
1768
|
-
if (props.image.toString().startsWith('#')) {
|
1769
|
-
return React.createElement(FillColor, {
|
1770
|
-
color: props.image
|
1771
|
-
});
|
1772
|
-
} else if (props.image.toString().startsWith('video')) {
|
1773
|
-
var video = videos[props.image];
|
1774
|
-
return React.createElement(Fullscreen, {
|
1775
|
-
ref: setContainerRef
|
1776
|
-
}, React.createElement(Video, {
|
1777
|
-
state: props.onScreen ? 'active' : 'inactive',
|
1778
|
-
id: props.image,
|
1779
|
-
offset: props.offset,
|
1780
|
-
interactive: props.interactive,
|
1781
|
-
nextSectionOnEnd: props.nextSectionOnEnd
|
1782
|
-
}), React.createElement(MotifArea, {
|
1783
|
-
ref: props.motifAreaRef,
|
1784
|
-
image: video,
|
1785
|
-
containerWidth: containerDimension.width,
|
1786
|
-
containerHeight: containerDimension.height
|
1787
|
-
}));
|
1788
|
-
} else {
|
1789
|
-
return React.createElement(Fullscreen, {
|
1790
|
-
ref: setContainerRef
|
1791
|
-
}, React.createElement(Image, {
|
1792
|
-
id: props.image
|
1793
|
-
}), React.createElement(Image, {
|
1794
|
-
id: props.imageMobile,
|
1795
|
-
mobile: true
|
1796
|
-
}), React.createElement(MotifArea, {
|
1797
|
-
ref: props.motifAreaRef,
|
1798
|
-
imageId: props.image,
|
1799
|
-
containerWidth: containerDimension.width,
|
1800
|
-
containerHeight: containerDimension.height
|
1801
|
-
}));
|
1802
|
-
}
|
1803
|
-
}
|
1804
|
-
|
1805
|
-
var Context$1 = React.createContext({});
|
1806
|
-
function EditorStateProvider(props) {
|
1807
|
-
var _useState = useState(null),
|
1808
|
-
_useState2 = _slicedToArray(_useState, 2),
|
1809
|
-
selection = _useState2[0],
|
1810
|
-
setSelectionState = _useState2[1];
|
1811
|
-
|
1812
|
-
var setSelection = useCallback(function (selection) {
|
1813
|
-
if (window.parent !== window) {
|
1814
|
-
window.parent.postMessage({
|
1815
|
-
type: 'SELECTED',
|
1816
|
-
payload: selection || {}
|
1817
|
-
}, window.location.origin);
|
1818
|
-
}
|
1819
|
-
|
1820
|
-
setSelectionState(selection);
|
1821
|
-
}, []);
|
1822
|
-
var value = useMemo(function () {
|
1823
|
-
return props.active ? {
|
1824
|
-
selection: selection,
|
1825
|
-
setSelection: setSelection
|
1826
|
-
} : {};
|
1827
|
-
}, [props.active, setSelection, selection]);
|
1828
|
-
return React.createElement(Context$1.Provider, {
|
1829
|
-
value: value
|
1830
|
-
}, props.children);
|
1831
|
-
}
|
1832
|
-
function useEditorSelection(options) {
|
1833
|
-
var _useContext = useContext(Context$1),
|
1834
|
-
selection = _useContext.selection,
|
1835
|
-
setSelection = _useContext.setSelection;
|
1836
|
-
|
1837
|
-
var resetSelection = useCallback(function () {
|
1838
|
-
setSelection(null);
|
1839
|
-
}, [setSelection]);
|
1840
|
-
var select = useCallback(function (selection) {
|
1841
|
-
setSelection(selection || options);
|
1842
|
-
}, [setSelection, options]);
|
1843
|
-
return useMemo(function () {
|
1844
|
-
return setSelection ? {
|
1845
|
-
isSelected: selection && options && selection.id === options.id && selection.type === options.type,
|
1846
|
-
isSelectable: !selection || selection.type === 'contentElement',
|
1847
|
-
select: select,
|
1848
|
-
resetSelection: resetSelection
|
1849
|
-
} : {};
|
1850
|
-
}, [options, selection, setSelection, select, resetSelection]);
|
1851
|
-
}
|
1852
|
-
|
1853
|
-
var css$f = ".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";
|
1854
|
-
var styles$e = {"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"};
|
1855
|
-
styleInject(css$f);
|
1856
|
-
|
1857
|
-
function Foreground(props) {
|
1858
|
-
var _useEditorSelection = useEditorSelection(),
|
1859
|
-
resetSelection = _useEditorSelection.resetSelection;
|
1860
|
-
|
1861
|
-
return React.createElement("div", {
|
1862
|
-
className: className(props),
|
1863
|
-
onClick: resetSelection
|
1864
|
-
}, props.children);
|
1865
|
-
}
|
1866
|
-
|
1867
|
-
function className(props) {
|
1868
|
-
var _classNames;
|
1869
|
-
|
1870
|
-
return classNames(styles$e.Foreground, props.transitionStyles.foreground, props.transitionStyles["foreground-".concat(props.state)], styles$e["".concat(props.heightMode, "Height")], (_classNames = {}, _defineProperty(_classNames, styles$e.hidden, props.hidden), _defineProperty(_classNames, styles$e.enlarge, props.hidden && !props.disableEnlarge), _classNames));
|
1871
|
-
}
|
1872
|
-
|
1873
|
-
function _arrayWithoutHoles(arr) {
|
1874
|
-
if (Array.isArray(arr)) {
|
1875
|
-
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
|
1876
|
-
arr2[i] = arr[i];
|
1877
|
-
}
|
1878
|
-
|
1879
|
-
return arr2;
|
1880
|
-
}
|
1881
|
-
}
|
1882
|
-
|
1883
|
-
function _iterableToArray(iter) {
|
1884
|
-
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
1885
|
-
}
|
1886
|
-
|
1887
|
-
function _nonIterableSpread() {
|
1888
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
1889
|
-
}
|
1890
|
-
|
1891
|
-
function _toConsumableArray(arr) {
|
1892
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
1893
|
-
}
|
1894
|
-
|
1895
|
-
function _classCallCheck(instance, Constructor) {
|
1896
|
-
if (!(instance instanceof Constructor)) {
|
1897
|
-
throw new TypeError("Cannot call a class as a function");
|
1898
|
-
}
|
1899
|
-
}
|
1900
|
-
|
1901
|
-
function _defineProperties(target, props) {
|
1902
|
-
for (var i = 0; i < props.length; i++) {
|
1903
|
-
var descriptor = props[i];
|
1904
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
1905
|
-
descriptor.configurable = true;
|
1906
|
-
if ("value" in descriptor) descriptor.writable = true;
|
1907
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
1908
|
-
}
|
1909
|
-
}
|
1910
|
-
|
1911
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
1912
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1913
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
1914
|
-
return Constructor;
|
1915
|
-
}
|
1916
|
-
|
1917
|
-
/**
|
1918
|
-
* Register new types of content elements.
|
1919
|
-
* @name frontend_contentElementTypes
|
1920
|
-
*/
|
1921
|
-
var ContentElementTypeRegistry =
|
1922
|
-
/*#__PURE__*/
|
1923
|
-
function () {
|
1924
|
-
function ContentElementTypeRegistry() {
|
1925
|
-
_classCallCheck(this, ContentElementTypeRegistry);
|
1926
|
-
|
1927
|
-
this.types = {};
|
1928
|
-
}
|
1929
|
-
/**
|
1930
|
-
* Register a new type of content element.
|
1931
|
-
*
|
1932
|
-
* @param {string} typeName - Name of the content element type.
|
1933
|
-
* @param {Object} options
|
1934
|
-
* @param {React.Component} options.component
|
1935
|
-
* @memberof frontend_contentElementTypes
|
1936
|
-
*
|
1937
|
-
* @example
|
1938
|
-
*
|
1939
|
-
* // frontend.js
|
1940
|
-
*
|
1941
|
-
* import {frontend} from 'pageflow-scrolled/frontend';
|
1942
|
-
* import {InlineImage} from './InlineImage';
|
1943
|
-
*
|
1944
|
-
* frontend.contentElementTypes.register('inlineImage', {
|
1945
|
-
* component: InlineImage
|
1946
|
-
* });
|
1947
|
-
*/
|
1948
|
-
|
1949
|
-
|
1950
|
-
_createClass(ContentElementTypeRegistry, [{
|
1951
|
-
key: "register",
|
1952
|
-
value: function register(typeName, options) {
|
1953
|
-
this.types[typeName] = options;
|
1954
|
-
}
|
1955
|
-
}, {
|
1956
|
-
key: "getComponent",
|
1957
|
-
value: function getComponent(typeName) {
|
1958
|
-
if (!this.types[typeName]) {
|
1959
|
-
throw new Error("Unknown content element type name \"".concat(typeName, "\""));
|
1960
|
-
}
|
1961
|
-
|
1962
|
-
return this.types[typeName].component;
|
1963
|
-
}
|
1964
|
-
}]);
|
1965
|
-
|
1966
|
-
return ContentElementTypeRegistry;
|
1967
|
-
}();
|
1968
|
-
|
1969
|
-
var api = {
|
1970
|
-
contentElementTypes: new ContentElementTypeRegistry()
|
1971
|
-
};
|
1972
|
-
|
1973
|
-
var css$g = ".ContentElement-module_outer__3ZsNV {\n position: relative;\n}\n\n.ContentElement-module_selectable__2oRzN {\n position: relative;\n}\n\n.ContentElement-module_selectable__2oRzN:after {\n content: '';\n position: absolute;\n top: -5px;\n left: -5px;\n right: -5px;\n bottom: -5px;\n}\n\n.ContentElement-module_bl__2w5xM,\n.ContentElement-module_br__3v-_l,\n.ContentElement-module_tr__l_gbk,\n.ContentElement-module_tl__NrB8G {\n width: 10px;\n height: 10px;\n position: absolute;\n opacity: 0;\n}\n\n.ContentElement-module_selected__1uFZP .ContentElement-module_bl__2w5xM,\n.ContentElement-module_selected__1uFZP .ContentElement-module_br__3v-_l,\n.ContentElement-module_selected__1uFZP .ContentElement-module_tr__l_gbk,\n.ContentElement-module_selected__1uFZP .ContentElement-module_tl__NrB8G {\n border-width: 3px\n}\n\n.ContentElement-module_selected__1uFZP .ContentElement-module_bl__2w5xM,\n.ContentElement-module_selected__1uFZP .ContentElement-module_br__3v-_l,\n.ContentElement-module_selected__1uFZP .ContentElement-module_tr__l_gbk,\n.ContentElement-module_selected__1uFZP .ContentElement-module_tl__NrB8G,\n.ContentElement-module_selectable__2oRzN:hover .ContentElement-module_bl__2w5xM,\n.ContentElement-module_selectable__2oRzN:hover .ContentElement-module_br__3v-_l,\n.ContentElement-module_selectable__2oRzN:hover .ContentElement-module_tr__l_gbk,\n.ContentElement-module_selectable__2oRzN:hover .ContentElement-module_tl__NrB8G {\n opacity: 0.8;\n}\n\n.ContentElement-module_bl__2w5xM {\n bottom: -6px;\n left: -6px;\n border-bottom: solid 1px currentColor;\n border-left: solid 1px currentColor;\n}\n\n.ContentElement-module_br__3v-_l {\n bottom: -6px;\n right: -6px;\n border-bottom: solid 1px currentColor;\n border-right: solid 1px currentColor;\n}\n\n.ContentElement-module_tr__l_gbk {\n top: -6px;\n right: -6px;\n border-top: solid 1px currentColor;\n border-right: solid 1px currentColor;\n}\n\n.ContentElement-module_tl__NrB8G {\n top: -6px;\n left: -6px;\n border-top: solid 1px currentColor;\n border-left: solid 1px currentColor;\n}\n\n.ContentElement-module_selected__1uFZP:hover:after,\n.ContentElement-module_selected__1uFZP:after {\n border: solid 1px currentColor;\n opacity: 0.8;\n pointer-events: none;\n}\n";
|
1974
|
-
var styles$f = {"selectionWidth":"1px","selectionPadding":"-6px","selectionPadding2":"-5px","outer":"ContentElement-module_outer__3ZsNV","selectable":"ContentElement-module_selectable__2oRzN","bl":"ContentElement-module_bl__2w5xM","br":"ContentElement-module_br__3v-_l","tr":"ContentElement-module_tr__l_gbk","tl":"ContentElement-module_tl__NrB8G","selected":"ContentElement-module_selected__1uFZP"};
|
1975
|
-
styleInject(css$g);
|
1976
|
-
|
1977
|
-
var css$h = "\n\n.InsertContentElementIndicator-module_root__2KRRn {\n position: absolute;\n left: 0;\n width: 100%;\n text-align: center;\n cursor: pointer;\n opacity: 0;\n}\n\n.InsertContentElementIndicator-module_before__1EEFz {\n bottom: 100%;\n}\n\n.InsertContentElementIndicator-module_after__2YmaD {\n top: 100%;\n}\n\n.InsertContentElementIndicator-module_root__2KRRn:hover {\n opacity: 1;\n}\n\n.InsertContentElementIndicator-module_box__3EIMv svg {\n vertical-align: middle;\n oopacity: 0.8;\n}\n\n.InsertContentElementIndicator-module_bar__c-Ifz {\n background-color: currentColor;\n position: absolute;\n top: 50%;\n height: 1px;\n oopacity: 0.5;\n width: calc(50% - 15px);\n}\n\n.InsertContentElementIndicator-module_left__13U3P {\n left: -6px;\n}\n\n.InsertContentElementIndicator-module_right__lSfoH {\n right: -6px;\n}\n\n.InsertContentElementIndicator-module_selected__3sk0q.InsertContentElementIndicator-module_root__2KRRn {\n opacity: 0.8;\n}\n\n.InsertContentElementIndicator-module_selected__3sk0q .InsertContentElementIndicator-module_right__lSfoH,\n.InsertContentElementIndicator-module_selected__3sk0q .InsertContentElementIndicator-module_left__13U3P {\n width: 13px;\n background-color: currentColor;\n oopacity: 0.8;\n height: 5px;\n top: calc(50% - 2px);\n}\n\n.InsertContentElementIndicator-module_selected__3sk0q .InsertContentElementIndicator-module_right__lSfoH {\n right: -6px;\n}\n\n.InsertContentElementIndicator-module_selected__3sk0q .InsertContentElementIndicator-module_left__13U3P {\n left: -6px;\n}\n\n.InsertContentElementIndicator-module_middle__2TTQX {\n opacity: 0;\n width: 100%;\n left: 0;\n top: 50%;\n height: 1px;\n}\n\n.InsertContentElementIndicator-module_selected__3sk0q .InsertContentElementIndicator-module_middle__2TTQX {\n opacity: 1;\n}\n\n.InsertContentElementIndicator-module_selected__3sk0q .InsertContentElementIndicator-module_box__3EIMv {\n opacity: 0;\n}\n";
|
1978
|
-
var styles$g = {"selectionColor":"#1c86fe","backgroundColor":"rgba(0, 0, 0, 0.8)","borderColor":"rgba(255, 255, 255, 0.2)","root":"InsertContentElementIndicator-module_root__2KRRn","before":"InsertContentElementIndicator-module_before__1EEFz","after":"InsertContentElementIndicator-module_after__2YmaD","box":"InsertContentElementIndicator-module_box__3EIMv","bar":"InsertContentElementIndicator-module_bar__c-Ifz","left":"InsertContentElementIndicator-module_left__13U3P InsertContentElementIndicator-module_bar__c-Ifz","right":"InsertContentElementIndicator-module_right__lSfoH InsertContentElementIndicator-module_bar__c-Ifz","selected":"InsertContentElementIndicator-module_selected__3sk0q","middle":"InsertContentElementIndicator-module_middle__2TTQX InsertContentElementIndicator-module_bar__c-Ifz"};
|
1979
|
-
styleInject(css$h);
|
1980
|
-
|
1981
|
-
function _extends$9() {
|
1982
|
-
_extends$9 = Object.assign || function (target) {
|
1983
|
-
for (var i = 1; i < arguments.length; i++) {
|
1984
|
-
var source = arguments[i];
|
1985
|
-
|
1986
|
-
for (var key in source) {
|
1987
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1988
|
-
target[key] = source[key];
|
1989
|
-
}
|
1990
|
-
}
|
1991
|
-
}
|
1992
|
-
|
1993
|
-
return target;
|
1994
|
-
};
|
1995
|
-
|
1996
|
-
return _extends$9.apply(this, arguments);
|
1997
|
-
}
|
1998
|
-
var PlusIcon = (function (_ref) {
|
1999
|
-
var _ref$styles = _ref.styles,
|
2000
|
-
props = _objectWithoutProperties(_ref, ["styles"]);
|
2001
|
-
|
2002
|
-
return React.createElement("svg", _extends$9({
|
2003
|
-
xmlns: "http://www.w3.org/2000/svg",
|
2004
|
-
viewBox: "0 0 512 512"
|
2005
|
-
}, props), React.createElement("path", {
|
2006
|
-
d: "M256 0C114.844 0 0 114.839 0 256s114.844 256 256 256 256-114.839 256-256S397.156 0 256 0zm133.594 272.699H272.699v116.895c0 9.225-7.48 16.699-16.699 16.699-9.219 0-16.699-7.475-16.699-16.699V272.699H122.406c-9.219 0-16.699-7.475-16.699-16.699 0-9.225 7.48-16.699 16.699-16.699h116.895V122.406c0-9.225 7.48-16.699 16.699-16.699 9.219 0 16.699 7.475 16.699 16.699v116.895h116.895c9.219 0 16.699 7.475 16.699 16.699.001 9.225-7.48 16.699-16.699 16.699z"
|
2007
|
-
}));
|
2008
|
-
});
|
2009
|
-
|
2010
|
-
function InsertContentElementIndicator(_ref) {
|
2011
|
-
var contentElementId = _ref.contentElementId,
|
2012
|
-
selected = _ref.selected,
|
2013
|
-
position = _ref.position;
|
2014
|
-
|
2015
|
-
var _useEditorSelection = useEditorSelection({
|
2016
|
-
id: contentElementId,
|
2017
|
-
type: position
|
2018
|
-
}),
|
2019
|
-
isSelected = _useEditorSelection.isSelected,
|
2020
|
-
select = _useEditorSelection.select;
|
2021
|
-
|
2022
|
-
var _useI18n = useI18n({
|
2023
|
-
locale: 'ui'
|
2024
|
-
}),
|
2025
|
-
t = _useI18n.t;
|
2026
|
-
|
2027
|
-
function handleClick(event) {
|
2028
|
-
event.stopPropagation();
|
2029
|
-
select();
|
2030
|
-
}
|
2031
|
-
|
2032
|
-
return React.createElement("div", {
|
2033
|
-
className: classNames(styles$g.root, styles$g[position], _defineProperty({}, styles$g.selected, isSelected)),
|
2034
|
-
title: t('pageflow_scrolled.inline_editing.insert_content_element'),
|
2035
|
-
onClick: handleClick
|
2036
|
-
}, React.createElement("div", {
|
2037
|
-
className: styles$g.box
|
2038
|
-
}, React.createElement(PlusIcon, {
|
2039
|
-
width: 20,
|
2040
|
-
height: 20,
|
2041
|
-
fill: "currentColor"
|
2042
|
-
})), React.createElement("div", {
|
2043
|
-
className: styles$g.left
|
2044
|
-
}), React.createElement("div", {
|
2045
|
-
className: styles$g.right
|
2046
|
-
}), React.createElement("div", {
|
2047
|
-
className: styles$g.middle
|
2048
|
-
}));
|
2049
|
-
}
|
2050
|
-
|
2051
|
-
function ContentElement(props) {
|
2052
|
-
var Component = api.contentElementTypes.getComponent(props.type);
|
2053
|
-
|
2054
|
-
var _useEditorSelection = useEditorSelection({
|
2055
|
-
id: props.id,
|
2056
|
-
type: 'contentElement'
|
2057
|
-
}),
|
2058
|
-
isSelected = _useEditorSelection.isSelected,
|
2059
|
-
isSelectable = _useEditorSelection.isSelectable,
|
2060
|
-
select = _useEditorSelection.select,
|
2061
|
-
resetSelection = _useEditorSelection.resetSelection;
|
2062
|
-
|
2063
|
-
if (select) {
|
2064
|
-
var _classNames;
|
2065
|
-
|
2066
|
-
return React.createElement("div", {
|
2067
|
-
className: classNames(styles$f.outer)
|
2068
|
-
}, props.first && React.createElement(InsertContentElementIndicator, {
|
2069
|
-
position: "before",
|
2070
|
-
contentElementId: props.id
|
2071
|
-
}), React.createElement("div", {
|
2072
|
-
className: classNames((_classNames = {}, _defineProperty(_classNames, styles$f.selected, isSelected), _defineProperty(_classNames, styles$f.selectable, isSelectable), _classNames)),
|
2073
|
-
onClick: function onClick(e) {
|
2074
|
-
e.stopPropagation();
|
2075
|
-
isSelectable ? select() : resetSelection();
|
2076
|
-
}
|
2077
|
-
}, React.createElement(Component, {
|
2078
|
-
sectionProps: props.sectionProps,
|
2079
|
-
configuration: props.itemProps,
|
2080
|
-
contentElementId: props.id
|
2081
|
-
}), React.createElement("div", {
|
2082
|
-
className: styles$f.tl
|
2083
|
-
}), React.createElement("div", {
|
2084
|
-
className: styles$f.bl
|
2085
|
-
}), React.createElement("div", {
|
2086
|
-
className: styles$f.tr
|
2087
|
-
}), React.createElement("div", {
|
2088
|
-
className: styles$f.br
|
2089
|
-
})), React.createElement(InsertContentElementIndicator, {
|
2090
|
-
position: "after",
|
2091
|
-
contentElementId: props.id
|
2092
|
-
}));
|
2093
|
-
} else {
|
2094
|
-
return React.createElement(Component, {
|
2095
|
-
sectionProps: props.sectionProps,
|
2096
|
-
configuration: props.itemProps
|
2097
|
-
});
|
2098
|
-
}
|
2099
|
-
}
|
2100
|
-
|
2101
|
-
function ContentElements(props) {
|
2102
|
-
return React.createElement(React.Fragment, null, props.items.map(function (item, index) {
|
2103
|
-
return props.children(item, React.createElement(ContentElement, {
|
2104
|
-
key: item.id,
|
2105
|
-
id: item.id,
|
2106
|
-
type: item.type,
|
2107
|
-
first: index === 0,
|
2108
|
-
position: item.position,
|
2109
|
-
itemProps: item.props,
|
2110
|
-
sectionProps: props.sectionProps
|
2111
|
-
}));
|
2112
|
-
}));
|
2113
|
-
}
|
2114
|
-
ContentElements.defaultProps = {
|
2115
|
-
children: function children(item, child) {
|
2116
|
-
return child;
|
2117
|
-
}
|
2118
|
-
};
|
2119
|
-
|
2120
|
-
var css$i = ".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";
|
2121
|
-
var styles$h = {"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"};
|
2122
|
-
styleInject(css$i);
|
2123
|
-
|
2124
|
-
var availablePositions = ['inline', 'sticky', 'full'];
|
2125
|
-
function TwoColumn(props) {
|
2126
|
-
return React.createElement("div", {
|
2127
|
-
className: classNames(styles$h.root, styles$h[props.align])
|
2128
|
-
}, React.createElement("div", {
|
2129
|
-
className: styles$h.inline,
|
2130
|
-
ref: props.contentAreaRef
|
2131
|
-
}), renderItems(props));
|
2132
|
-
}
|
2133
|
-
TwoColumn.defaultProps = {
|
2134
|
-
align: 'left'
|
2135
|
-
};
|
2136
|
-
|
2137
|
-
function renderItems(props) {
|
2138
|
-
return groupItemsByPosition(props.items).map(function (group, index) {
|
2139
|
-
return React.createElement("div", {
|
2140
|
-
key: index,
|
2141
|
-
className: classNames(styles$h.group, styles$h["group-".concat(group.position)])
|
2142
|
-
}, renderItemGroup(props, group, 'sticky'), renderItemGroup(props, group, 'inline'), renderItemGroup(props, group, 'full'));
|
2143
|
-
});
|
2144
|
-
}
|
2145
|
-
|
2146
|
-
function renderItemGroup(props, group, position) {
|
2147
|
-
if (group[position].length) {
|
2148
|
-
return React.createElement("div", {
|
2149
|
-
className: styles$h[position]
|
2150
|
-
}, props.children(React.createElement(ContentElements, {
|
2151
|
-
sectionProps: props.sectionProps,
|
2152
|
-
items: group[position]
|
2153
|
-
})));
|
2154
|
-
}
|
2155
|
-
}
|
2156
|
-
|
2157
|
-
function groupItemsByPosition(items) {
|
2158
|
-
var groups = [];
|
2159
|
-
var currentGroup;
|
2160
|
-
items.reduce(function (previousItemPosition, item, index) {
|
2161
|
-
var position = availablePositions.indexOf(item.position) >= 0 ? item.position : 'inline';
|
2162
|
-
|
2163
|
-
if (!previousItemPosition || previousItemPosition !== position && (previousItemPosition !== 'sticky' || position !== 'inline')) {
|
2164
|
-
currentGroup = {
|
2165
|
-
position: position,
|
2166
|
-
sticky: [],
|
2167
|
-
inline: [],
|
2168
|
-
full: []
|
2169
|
-
};
|
2170
|
-
groups = [].concat(_toConsumableArray(groups), [currentGroup]);
|
2171
|
-
}
|
2172
|
-
|
2173
|
-
currentGroup[position].push(item);
|
2174
|
-
return position;
|
2175
|
-
}, null);
|
2176
|
-
return groups;
|
2177
|
-
}
|
2178
|
-
|
2179
|
-
var css$j = ".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";
|
2180
|
-
var styles$i = {"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"};
|
2181
|
-
styleInject(css$j);
|
2182
|
-
|
2183
|
-
function Center(props) {
|
2184
|
-
return React.createElement("div", {
|
2185
|
-
className: classNames(styles$i.root)
|
2186
|
-
}, React.createElement("div", {
|
2187
|
-
ref: props.contentAreaRef
|
2188
|
-
}), React.createElement(ContentElements, {
|
2189
|
-
sectionProps: props.sectionProps,
|
2190
|
-
items: props.items
|
2191
|
-
}, function (item, child) {
|
2192
|
-
return React.createElement("div", {
|
2193
|
-
key: item.index,
|
2194
|
-
className: classNames(styles$i.outer, styles$i["outer-".concat(item.position)])
|
2195
|
-
}, React.createElement("div", {
|
2196
|
-
className: classNames(styles$i.item, styles$i["item-".concat(item.position)])
|
2197
|
-
}, props.children(React.createElement("div", {
|
2198
|
-
className: styles$i["inner-".concat(item.position)]
|
2199
|
-
}, child))));
|
2200
|
-
}));
|
2201
|
-
}
|
2202
|
-
|
2203
|
-
function Layout(props) {
|
2204
|
-
if (props.sectionProps.layout === 'center') {
|
2205
|
-
return React.createElement(Center, props);
|
2206
|
-
} else if (props.sectionProps.layout === 'right') {
|
2207
|
-
return React.createElement(TwoColumn, Object.assign({
|
2208
|
-
align: "right"
|
2209
|
-
}, props));
|
2210
|
-
} else {
|
2211
|
-
return React.createElement(TwoColumn, props);
|
2212
|
-
}
|
2213
|
-
}
|
2214
|
-
Layout.defaultProps = {
|
2215
|
-
layout: 'left'
|
2216
|
-
};
|
2217
|
-
|
2218
|
-
function isIntersectingX(rectA, rectB) {
|
2219
|
-
return rectA.left < rectB.right && rectA.right > rectB.left || rectB.left < rectA.right && rectB.right > rectA.left;
|
2220
|
-
}
|
2221
|
-
|
2222
|
-
function getBoundingClientRect(el) {
|
2223
|
-
if (!el) {
|
2224
|
-
return {
|
2225
|
-
left: 0,
|
2226
|
-
right: 0,
|
2227
|
-
top: 0,
|
2228
|
-
bottom: 0,
|
2229
|
-
width: 0,
|
2230
|
-
height: 0
|
2231
|
-
};
|
2232
|
-
}
|
2233
|
-
|
2234
|
-
return el.getBoundingClientRect();
|
2235
|
-
}
|
2236
|
-
|
2237
|
-
function useBoundingClientRect() {
|
2238
|
-
var _useState = useState(getBoundingClientRect(null)),
|
2239
|
-
_useState2 = _slicedToArray(_useState, 2),
|
2240
|
-
boundingClientRect = _useState2[0],
|
2241
|
-
setBoundingClientRect = _useState2[1];
|
2242
|
-
|
2243
|
-
var _useState3 = useState(null),
|
2244
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
2245
|
-
currentNode = _useState4[0],
|
2246
|
-
setCurrentNode = _useState4[1];
|
2247
|
-
|
2248
|
-
var measureRef = useCallback(function (node) {
|
2249
|
-
setCurrentNode(node);
|
2250
|
-
setBoundingClientRect(getBoundingClientRect(node));
|
2251
|
-
}, []);
|
2252
|
-
useEffect(function () {
|
2253
|
-
function handler() {
|
2254
|
-
setBoundingClientRect(getBoundingClientRect(currentNode));
|
2255
|
-
}
|
2256
|
-
|
2257
|
-
if (!currentNode) {
|
2258
|
-
return;
|
2259
|
-
}
|
2260
|
-
|
2261
|
-
window.addEventListener('resize', handler);
|
2262
|
-
window.addEventListener('scroll', handler);
|
2263
|
-
return function () {
|
2264
|
-
window.removeEventListener('resize', handler);
|
2265
|
-
window.removeEventListener('scroll', handler);
|
2266
|
-
};
|
2267
|
-
}, [currentNode]);
|
2268
|
-
return [boundingClientRect, measureRef];
|
2269
|
-
}
|
2270
|
-
|
2271
|
-
function useScrollTarget(ref, isScrollTarget) {
|
2272
|
-
useEffect(function () {
|
2273
|
-
if (ref.current && isScrollTarget) {
|
2274
|
-
window.scrollTo({
|
2275
|
-
top: ref.current.getBoundingClientRect().top + window.scrollY - window.innerHeight * 0.25,
|
2276
|
-
behavior: 'smooth'
|
2277
|
-
});
|
2278
|
-
}
|
2279
|
-
}, [ref, isScrollTarget]);
|
2280
|
-
}
|
2281
|
-
|
2282
|
-
var css$k = ".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";
|
2283
|
-
var styles$j = {"Section":"Section-module_Section__Yo58b","invert":"Section-module_invert__3_p7F","activityProbe":"Section-module_activityProbe__Fsklh"};
|
2284
|
-
styleInject(css$k);
|
2285
|
-
|
2286
|
-
var css$l = "\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";
|
2287
|
-
var fadeInBgConceal = {"fade-duration":"0.5s","backdrop":"fadeInBgConceal-module_backdrop__11JGO","backdropInner":"fadeInBgConceal-module_backdropInner__1IAYD","backdrop-below":"fadeInBgConceal-module_backdrop-below__3E6Uk"};
|
2288
|
-
styleInject(css$l);
|
2289
|
-
|
2290
|
-
var css$m = "\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";
|
2291
|
-
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"};
|
2292
|
-
styleInject(css$m);
|
2293
|
-
|
2294
|
-
var css$n = "\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";
|
2295
|
-
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"};
|
2296
|
-
styleInject(css$n);
|
2297
|
-
|
2298
|
-
var css$o = "\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";
|
2299
|
-
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"};
|
2300
|
-
styleInject(css$o);
|
2301
|
-
|
2302
|
-
var css$p = "\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";
|
2303
|
-
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"};
|
2304
|
-
styleInject(css$p);
|
2305
|
-
|
2306
|
-
var css$q = "\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";
|
2307
|
-
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"};
|
2308
|
-
styleInject(css$q);
|
2309
|
-
|
2310
|
-
var css$r = "\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";
|
2311
|
-
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"};
|
2312
|
-
styleInject(css$r);
|
2313
|
-
|
2314
|
-
var css$s = "\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";
|
2315
|
-
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"};
|
2316
|
-
styleInject(css$s);
|
2317
|
-
|
2318
|
-
var css$t = ".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";
|
2319
|
-
var revealConceal = {"backdrop":"revealConceal-module_backdrop__dLUhU","backdropInner":"revealConceal-module_backdropInner__2k1Z-"};
|
2320
|
-
styleInject(css$t);
|
2321
|
-
|
2322
|
-
var css$u = "\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";
|
2323
|
-
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"};
|
2324
|
-
styleInject(css$u);
|
2325
|
-
|
2326
|
-
var css$v = "\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";
|
2327
|
-
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"};
|
2328
|
-
styleInject(css$v);
|
2329
|
-
|
2330
|
-
var css$w = ".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";
|
2331
|
-
var revealScrollOut = {"backdrop":"revealScrollOut-module_backdrop__2yOXd","backdropInner":"revealScrollOut-module_backdropInner__211p3","backdropInner2":"revealScrollOut-module_backdropInner2__v6WqM","foreground":"revealScrollOut-module_foreground__3z-hw"};
|
2332
|
-
styleInject(css$w);
|
2333
|
-
|
2334
|
-
var css$x = ".scrollInConceal-module_backdrop__2OJJC {\n position: sticky;\n top: 0;\n height: 0;\n}\n";
|
2335
|
-
var scrollInConceal = {"backdrop":"scrollInConceal-module_backdrop__2OJJC"};
|
2336
|
-
styleInject(css$x);
|
2337
|
-
|
2338
|
-
var css$y = "\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";
|
2339
|
-
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"};
|
2340
|
-
styleInject(css$y);
|
2341
|
-
|
2342
|
-
var css$z = "\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";
|
2343
|
-
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"};
|
2344
|
-
styleInject(css$z);
|
2345
|
-
|
2346
|
-
var css$A = ".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";
|
2347
|
-
var scrollInScrollOut = {"backdrop":"scrollInScrollOut-module_backdrop__XzCge","foreground":"scrollInScrollOut-module_foreground__1yyY8"};
|
2348
|
-
styleInject(css$A);
|
2349
|
-
|
2350
|
-
var css$B = ".previewScrollOut-module_scene__W9bDl {\n height: 100%;\n}\n\n.previewScrollOut-module_backdrop__2-Bl_ {\n position: absolute;\n top: 0;\n}\n";
|
2351
|
-
var previewScrollOut = {"scene":"previewScrollOut-module_scene__W9bDl","backdrop":"previewScrollOut-module_backdrop__2-Bl_"};
|
2352
|
-
styleInject(css$B);
|
2353
|
-
|
2354
|
-
var styles$k = {
|
2355
|
-
fadeInBgConceal: fadeInBgConceal,
|
2356
|
-
fadeInBgFadeOut: fadeInBgFadeOut,
|
2357
|
-
fadeInBgFadeOutBg: fadeInBgFadeOutBg,
|
2358
|
-
fadeInBgScrollOut: fadeInBgScrollOut,
|
2359
|
-
fadeInConceal: fadeInConceal,
|
2360
|
-
fadeInFadeOut: fadeInFadeOut,
|
2361
|
-
fadeInFadeOutBg: fadeInFadeOutBg,
|
2362
|
-
fadeInScrollOut: fadeInScrollOut,
|
2363
|
-
revealConceal: revealConceal,
|
2364
|
-
revealFadeOut: revealFadeOut,
|
2365
|
-
revealFadeOutBg: revealFadeOutBg,
|
2366
|
-
revealScrollOut: revealScrollOut,
|
2367
|
-
scrollInConceal: scrollInConceal,
|
2368
|
-
scrollInFadeOut: scrollInFadeOut,
|
2369
|
-
scrollInFadeOutBg: scrollInFadeOutBg,
|
2370
|
-
scrollInScrollOut: scrollInScrollOut,
|
2371
|
-
previewScrollOut: previewScrollOut
|
2372
|
-
};
|
2373
|
-
var enterTransitions = {
|
2374
|
-
fade: 'fadeIn',
|
2375
|
-
fadeBg: 'fadeInBg',
|
2376
|
-
scroll: 'scrollIn',
|
2377
|
-
scrollOver: 'scrollIn',
|
2378
|
-
reveal: 'reveal',
|
2379
|
-
beforeAfter: 'reveal',
|
2380
|
-
preview: 'preview'
|
2381
|
-
};
|
2382
|
-
var exitTransitions = {
|
2383
|
-
fade: 'fadeOut',
|
2384
|
-
fadeBg: 'fadeOutBg',
|
2385
|
-
scroll: 'scrollOut',
|
2386
|
-
scrollOver: 'conceal',
|
2387
|
-
reveal: 'scrollOut',
|
2388
|
-
beforeAfter: 'conceal'
|
2389
|
-
};
|
2390
|
-
function getTransitionStyles(section, previousSection, nextSection) {
|
2391
|
-
var enterTransition = enterTransitions[section.transition];
|
2392
|
-
var exitTransition = exitTransitions[nextSection ? nextSection.transition : 'scroll'];
|
2393
|
-
var name = "".concat(enterTransition).concat(capitalize(exitTransition));
|
2394
|
-
|
2395
|
-
if (!styles$k[name]) {
|
2396
|
-
throw new Error("Unknown transition ".concat(name));
|
2397
|
-
}
|
2398
|
-
|
2399
|
-
return styles$k[name];
|
2400
|
-
}
|
2401
|
-
|
2402
|
-
function capitalize(string) {
|
2403
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
2404
|
-
}
|
2405
|
-
|
2406
|
-
function NoOpShadow(props) {
|
2407
|
-
return React.createElement("div", null, props.children);
|
2408
|
-
}
|
2409
|
-
|
2410
|
-
var css$C = ".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";
|
2411
|
-
var styles$l = {"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"};
|
2412
|
-
styleInject(css$C);
|
2413
|
-
|
2414
|
-
function GradientShadow(props) {
|
2415
|
-
var maxOpacityOverlap = props.motifAreaRect.height / 2;
|
2416
|
-
var motifAreaOverlap = Math.min(maxOpacityOverlap, props.motifAreaRect.bottom - props.contentAreaRect.top);
|
2417
|
-
var opacityFactor = props.intersecting && props.motifAreaRect.height > 0 ? motifAreaOverlap / maxOpacityOverlap : 1;
|
2418
|
-
return React.createElement("div", {
|
2419
|
-
className: classNames(styles$l.root, styles$l["align-".concat(props.align)], _defineProperty({}, styles$l.intersecting, props.intersecting))
|
2420
|
-
}, React.createElement("div", {
|
2421
|
-
className: styles$l.shadow,
|
2422
|
-
style: {
|
2423
|
-
opacity: props.opacity * Math.round(opacityFactor * 10) / 10
|
2424
|
-
}
|
2425
|
-
}), props.children);
|
2426
|
-
}
|
2427
|
-
GradientShadow.defaultProps = {
|
2428
|
-
opacity: 0.7,
|
2429
|
-
align: 'left'
|
2430
|
-
};
|
2431
|
-
|
2432
|
-
function NoOpBoxWrapper(props) {
|
2433
|
-
return React.createElement("div", null, props.children);
|
2434
|
-
}
|
2435
|
-
|
2436
|
-
var css$D = ".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";
|
2437
|
-
var styles$m = {"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"};
|
2438
|
-
styleInject(css$D);
|
2439
|
-
|
2440
|
-
function GradientBox(props) {
|
2441
|
-
var _classNames;
|
2442
|
-
|
2443
|
-
var padding = props.active ? props.padding : 0;
|
2444
|
-
return React.createElement("div", {
|
2445
|
-
className: classNames(styles$m.root, (_classNames = {}, _defineProperty(_classNames, styles$m.gradient, padding > 0), _defineProperty(_classNames, styles$m["long"], props.coverInvisibleNextSection), _classNames)),
|
2446
|
-
style: {
|
2447
|
-
paddingTop: padding
|
2448
|
-
}
|
2449
|
-
}, React.createElement("div", {
|
2450
|
-
className: styles$m.wrapper
|
2451
|
-
}, React.createElement("div", {
|
2452
|
-
className: classNames(styles$m.shadow, props.transitionStyles.boxShadow, props.transitionStyles["boxShadow-".concat(props.state)]),
|
2453
|
-
style: {
|
2454
|
-
top: padding,
|
2455
|
-
opacity: props.opacity
|
2456
|
-
}
|
2457
|
-
}), React.createElement("div", {
|
2458
|
-
className: styles$m.content
|
2459
|
-
}, props.children)));
|
2460
|
-
}
|
2461
|
-
GradientBox.defaultProps = {
|
2462
|
-
opacity: 1
|
2463
|
-
};
|
2464
|
-
|
2465
|
-
var css$E = ".CardBox-module_wrapper__3vnaH {\n}\n\n.CardBox-module_content__36v7J {\n position: relative;\n}\n";
|
2466
|
-
var styles$n = {"wrapper":"CardBox-module_wrapper__3vnaH","content":"CardBox-module_content__36v7J"};
|
2467
|
-
styleInject(css$E);
|
2468
|
-
|
2469
|
-
function CardBox(props) {
|
2470
|
-
var padding = props.active ? props.padding : 0;
|
2471
|
-
return React.createElement("div", {
|
2472
|
-
style: {
|
2473
|
-
paddingTop: padding
|
2474
|
-
}
|
2475
|
-
}, React.createElement("div", {
|
2476
|
-
className: styles$n.wrapper
|
2477
|
-
}, React.createElement("div", {
|
2478
|
-
style: {
|
2479
|
-
top: padding
|
2480
|
-
}
|
2481
|
-
}), React.createElement("div", {
|
2482
|
-
className: styles$n.content
|
2483
|
-
}, props.children)));
|
2484
|
-
}
|
2485
|
-
|
2486
|
-
var css$F = ".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";
|
2487
|
-
var styles$o = {"cardBg":"CardBoxWrapper-module_cardBg__154o2"};
|
2488
|
-
styleInject(css$F);
|
2489
|
-
|
2490
|
-
function CardBoxWrapper(props) {
|
2491
|
-
return React.createElement("div", {
|
2492
|
-
className: styles$o.cardBg
|
2493
|
-
}, props.children);
|
2494
|
-
}
|
2495
|
-
|
2496
|
-
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; }
|
2497
|
-
|
2498
|
-
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; }
|
2499
|
-
var OnScreenContext = React.createContext({
|
2500
|
-
center: false,
|
2501
|
-
top: false,
|
2502
|
-
bottom: false
|
2503
|
-
});
|
2504
|
-
function Section(props) {
|
2505
|
-
var activityProbeRef = useRef();
|
2506
|
-
useOnScreen(activityProbeRef, '-50% 0px -50% 0px', props.onActivate);
|
2507
|
-
var ref = useRef();
|
2508
|
-
var onScreen = useOnScreen(ref, '0px 0px 0px 0px');
|
2509
|
-
useScrollTarget(ref, props.isScrollTarget);
|
2510
|
-
var sectionProperties = {
|
2511
|
-
layout: props.layout,
|
2512
|
-
invert: props.invert
|
2513
|
-
};
|
2514
|
-
|
2515
|
-
var _useBoundingClientRec = useBoundingClientRect(),
|
2516
|
-
_useBoundingClientRec2 = _slicedToArray(_useBoundingClientRec, 2),
|
2517
|
-
motifAreaRect = _useBoundingClientRec2[0],
|
2518
|
-
setMotifAreaRectRect = _useBoundingClientRec2[1];
|
2519
|
-
|
2520
|
-
var _useDimension = useDimension(),
|
2521
|
-
_useDimension2 = _slicedToArray(_useDimension, 2),
|
2522
|
-
motifAreaDimension = _useDimension2[0],
|
2523
|
-
setMotifAreaDimensionRef = _useDimension2[1];
|
2524
|
-
|
2525
|
-
var setMotifAreaRefs = useCallback(function (node) {
|
2526
|
-
setMotifAreaRectRect(node);
|
2527
|
-
setMotifAreaDimensionRef(node);
|
2528
|
-
}, [setMotifAreaRectRect, setMotifAreaDimensionRef]);
|
2529
|
-
|
2530
|
-
var _useBoundingClientRec3 = useBoundingClientRect(props.layout),
|
2531
|
-
_useBoundingClientRec4 = _slicedToArray(_useBoundingClientRec3, 2),
|
2532
|
-
contentAreaRect = _useBoundingClientRec4[0],
|
2533
|
-
setContentAreaRef = _useBoundingClientRec4[1];
|
2534
|
-
|
2535
|
-
var intersecting = isIntersectingX(motifAreaRect, contentAreaRect);
|
2536
|
-
var heightOffset = 0; //(props.backdrop.first || props.transition === 'scrollOver') ? 0 : (window.innerHeight / 3);
|
2537
|
-
|
2538
|
-
var transitionStyles = getTransitionStyles(props, props.previousSection, props.nextSection);
|
2539
|
-
var appearance = {
|
2540
|
-
shadow: {
|
2541
|
-
background: GradientShadow,
|
2542
|
-
foreground: GradientBox,
|
2543
|
-
foregroundWrapper: NoOpBoxWrapper
|
2544
|
-
},
|
2545
|
-
transparent: {
|
2546
|
-
background: NoOpShadow,
|
2547
|
-
foreground: CardBox,
|
2548
|
-
foregroundWrapper: NoOpBoxWrapper
|
2549
|
-
},
|
2550
|
-
cards: {
|
2551
|
-
background: NoOpShadow,
|
2552
|
-
foreground: CardBox,
|
2553
|
-
foregroundWrapper: CardBoxWrapper
|
2554
|
-
}
|
2555
|
-
}[props.appearance || 'shadow'];
|
2556
|
-
var Shadow = appearance.background;
|
2557
|
-
var Box = appearance.foreground;
|
2558
|
-
var BoxWrapper = appearance.foregroundWrapper;
|
2559
|
-
return React.createElement("section", {
|
2560
|
-
id: "section-".concat(props.permaId),
|
2561
|
-
ref: ref,
|
2562
|
-
className: classNames(styles$j.Section, transitionStyles.section, _defineProperty({}, styles$j.invert, props.invert))
|
2563
|
-
}, React.createElement("div", {
|
2564
|
-
ref: activityProbeRef,
|
2565
|
-
className: styles$j.activityProbe
|
2566
|
-
}), React.createElement(Backdrop, Object.assign({}, props.backdrop, {
|
2567
|
-
motifAreaRef: setMotifAreaRefs,
|
2568
|
-
onScreen: onScreen,
|
2569
|
-
offset: Math.max(0, Math.max(1, -contentAreaRect.top / 200)),
|
2570
|
-
state: props.state,
|
2571
|
-
transitionStyles: transitionStyles,
|
2572
|
-
nextSectionOnEnd: props.nextSectionOnEnd,
|
2573
|
-
interactive: props.interactiveBackdrop
|
2574
|
-
}), function (children) {
|
2575
|
-
return props.interactiveBackdrop ? children : React.createElement(Shadow, {
|
2576
|
-
align: props.layout,
|
2577
|
-
intersecting: intersecting,
|
2578
|
-
opacity: props.shadowOpacity >= 0 ? props.shadowOpacity / 100 : 0.7,
|
2579
|
-
motifAreaRect: motifAreaRect,
|
2580
|
-
contentAreaRect: contentAreaRect
|
2581
|
-
}, children);
|
2582
|
-
}), React.createElement(Foreground, {
|
2583
|
-
transitionStyles: transitionStyles,
|
2584
|
-
hidden: props.interactiveBackdrop,
|
2585
|
-
disableEnlarge: props.disableEnlarge,
|
2586
|
-
state: props.state,
|
2587
|
-
heightMode: heightMode(props)
|
2588
|
-
}, React.createElement(Box, {
|
2589
|
-
active: intersecting,
|
2590
|
-
coverInvisibleNextSection: props.nextSection && props.nextSection.transition.startsWith('fade'),
|
2591
|
-
transitionStyles: transitionStyles,
|
2592
|
-
state: props.state,
|
2593
|
-
padding: Math.max(0, motifAreaDimension.top + motifAreaDimension.height - heightOffset),
|
2594
|
-
opacity: props.shadowOpacity
|
2595
|
-
}, React.createElement(Layout, {
|
2596
|
-
items: indexItems(props.foreground),
|
2597
|
-
appearance: props.appearance,
|
2598
|
-
contentAreaRef: setContentAreaRef,
|
2599
|
-
sectionProps: sectionProperties
|
2600
|
-
}, function (children) {
|
2601
|
-
return React.createElement(BoxWrapper, null, children);
|
2602
|
-
}))));
|
2603
|
-
}
|
2604
|
-
|
2605
|
-
function indexItems(items) {
|
2606
|
-
return items.map(function (item, index) {
|
2607
|
-
return _objectSpread$4({}, item, {
|
2608
|
-
index: index
|
2609
|
-
});
|
2610
|
-
});
|
2611
|
-
}
|
2612
|
-
|
2613
|
-
function heightMode(props) {
|
2614
|
-
if (props.fullHeight) {
|
2615
|
-
if (props.transition.startsWith('fade') || props.nextSection && props.nextSection.transition.startsWith('fade')) {
|
2616
|
-
return 'fullFade';
|
2617
|
-
} else {
|
2618
|
-
return 'full';
|
2619
|
-
}
|
2620
|
-
}
|
2621
|
-
|
2622
|
-
return 'dynamic';
|
2623
|
-
}
|
2624
|
-
|
2625
|
-
function Chapter(props) {
|
2626
|
-
return React.createElement("div", {
|
2627
|
-
id: "chapter-".concat(props.permaId)
|
2628
|
-
}, renderSections(props.sections, props.currentSectionIndex, props.setCurrentSectionIndex, props.scrollTargetSectionIndex, props.setScrollTargetSectionIndex));
|
2629
|
-
}
|
2630
|
-
|
2631
|
-
function renderSections(sections, currentSectionIndex, setCurrentSectionIndex, scrollTargetSectionIndex, setScrollTargetSectionIndex) {
|
2632
|
-
function _onActivate(sectionIndex) {
|
2633
|
-
setCurrentSectionIndex(sectionIndex);
|
2634
|
-
setScrollTargetSectionIndex(null);
|
2635
|
-
}
|
2636
|
-
|
2637
|
-
return sections.map(function (section) {
|
2638
|
-
return React.createElement(Section, Object.assign({
|
2639
|
-
key: section.permaId,
|
2640
|
-
state: section.sectionIndex > currentSectionIndex ? 'below' : section.sectionIndex < currentSectionIndex ? 'above' : 'active',
|
2641
|
-
isScrollTarget: section.sectionIndex === scrollTargetSectionIndex,
|
2642
|
-
onActivate: function onActivate() {
|
2643
|
-
return _onActivate(section.sectionIndex);
|
2644
|
-
}
|
2645
|
-
}, section));
|
2646
|
-
});
|
2647
|
-
}
|
2648
|
-
|
2649
|
-
var css$G = ".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";
|
2650
|
-
var entryStyles = {"font-sans":"'Source Sans Pro', sans-serif","Entry":"Entry-module_Entry__1nDGh","exampleSelect":"Entry-module_exampleSelect__1uAJs"};
|
2651
|
-
styleInject(css$G);
|
2652
|
-
|
2653
|
-
function Entry(props) {
|
2654
|
-
var _useState = useState(0),
|
2655
|
-
_useState2 = _slicedToArray(_useState, 2),
|
2656
|
-
currentSectionIndex = _useState2[0],
|
2657
|
-
setCurrentSectionIndexState = _useState2[1];
|
2658
|
-
|
2659
|
-
var _useState3 = useState(null),
|
2660
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
2661
|
-
scrollTargetSectionIndex = _useState4[0],
|
2662
|
-
setScrollTargetSectionIndex = _useState4[1];
|
2663
|
-
|
2664
|
-
var _useEditorSelection = useEditorSelection(),
|
2665
|
-
select = _useEditorSelection.select;
|
2666
|
-
|
2667
|
-
var _useState5 = useState(true),
|
2668
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
2669
|
-
muted = _useState6[0],
|
2670
|
-
setMuted = _useState6[1];
|
2671
|
-
|
2672
|
-
var dispatch = useEntryStateDispatch();
|
2673
|
-
var entryStructure = useEntryStructure();
|
2674
|
-
var setCurrentSectionIndex = useCallback(function (index) {
|
2675
|
-
if (window.parent) {
|
2676
|
-
window.parent.postMessage({
|
2677
|
-
type: 'CHANGE_SECTION',
|
2678
|
-
payload: {
|
2679
|
-
index: index
|
2680
|
-
}
|
2681
|
-
}, window.location.origin);
|
2682
|
-
}
|
2683
|
-
|
2684
|
-
setCurrentSectionIndexState(index);
|
2685
|
-
}, [setCurrentSectionIndexState]);
|
2686
|
-
useEffect(function () {
|
2687
|
-
if (window.parent !== window) {
|
2688
|
-
window.addEventListener('message', receive);
|
2689
|
-
window.parent.postMessage({
|
2690
|
-
type: 'READY'
|
2691
|
-
}, window.location.origin);
|
2692
|
-
}
|
2693
|
-
|
2694
|
-
return function () {
|
2695
|
-
return window.removeEventListener('message', receive);
|
2696
|
-
};
|
2697
|
-
|
2698
|
-
function receive(message) {
|
2699
|
-
if (window.location.href.indexOf(message.origin) === 0) {
|
2700
|
-
if (message.data.type === 'ACTION') {
|
2701
|
-
dispatch(message.data.payload);
|
2702
|
-
} else if (message.data.type === 'SCROLL_TO_SECTION') {
|
2703
|
-
setScrollTargetSectionIndex(message.data.payload.index);
|
2704
|
-
} else if (message.data.type === 'SELECT') {
|
2705
|
-
select(message.data.payload);
|
2706
|
-
}
|
2707
|
-
}
|
2708
|
-
}
|
2709
|
-
}, [dispatch, select]);
|
2710
|
-
|
2711
|
-
function scrollToSection(index) {
|
2712
|
-
if (index === 'next') {
|
2713
|
-
index = currentSectionIndex + 1;
|
2714
|
-
}
|
2715
|
-
|
2716
|
-
setScrollTargetSectionIndex(index);
|
2717
|
-
}
|
2718
|
-
|
2719
|
-
return React.createElement("div", {
|
2720
|
-
className: entryStyles.Entry
|
2721
|
-
}, React.createElement(MutedContext.Provider, {
|
2722
|
-
value: {
|
2723
|
-
muted: muted,
|
2724
|
-
setMuted: setMuted
|
2725
|
-
}
|
2726
|
-
}, React.createElement(ScrollToSectionContext.Provider, {
|
2727
|
-
value: scrollToSection
|
2728
|
-
}, renderChapters(entryStructure, currentSectionIndex, setCurrentSectionIndex, scrollTargetSectionIndex, setScrollTargetSectionIndex))));
|
2729
|
-
}
|
2730
|
-
|
2731
|
-
function renderChapters(entryStructure, currentSectionIndex, setCurrentSectionIndex, scrollTargetSectionIndex, setScrollTargetSectionIndex) {
|
2732
|
-
return entryStructure.map(function (chapter, index) {
|
2733
|
-
return React.createElement(Chapter, {
|
2734
|
-
key: index,
|
2735
|
-
permaId: chapter.permaId,
|
2736
|
-
sections: chapter.sections,
|
2737
|
-
currentSectionIndex: currentSectionIndex,
|
2738
|
-
setCurrentSectionIndex: setCurrentSectionIndex,
|
2739
|
-
scrollTargetSectionIndex: scrollTargetSectionIndex,
|
2740
|
-
setScrollTargetSectionIndex: setScrollTargetSectionIndex
|
2741
|
-
});
|
2742
|
-
});
|
2743
|
-
}
|
2744
|
-
|
2745
|
-
var css$H = "body {\n margin: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n";
|
2746
|
-
styleInject(css$H);
|
2747
|
-
|
2748
|
-
var css$I = ".Text-module_h2__34chJ {\n font-size: 66px;\n font-weight: 700;\n}\n\n.Text-module_h1__2_5kX {\n font-size: 110px;\n line-height: 1;\n}\n\n.Text-module_body__4oWD- {\n font-size: 22px;\n line-height: 1.4;\n}\n\n.Text-module_caption__3_6Au {\n font-size: 20px;\n line-height: 1.4;\n}\n\n@media (max-width: 600px) {\n .Text-module_h2__34chJ {\n font-size: 40px;\n }\n\n .Text-module_h1__2_5kX {\n font-size: 66px;\n }\n}\n";
|
2749
|
-
var styles$p = {"text-s":"20px","text-base":"22px","text-l":"40px","text-xl":"66px","text-2xl":"110px","h2":"Text-module_h2__34chJ","h1":"Text-module_h1__2_5kX","body":"Text-module_body__4oWD-","caption":"Text-module_caption__3_6Au"};
|
2750
|
-
styleInject(css$I);
|
2751
|
-
|
2752
|
-
/**
|
2753
|
-
* Render some text using the default typography scale.
|
2754
|
-
*
|
2755
|
-
* @param {Object} props
|
2756
|
-
* @param {string} props.scaleCategory - One of the styles `'h1'`, `'h2'`, `'body'`, `'caption'`.
|
2757
|
-
* @param {string} [props.inline] - Render a span instread of a div.
|
2758
|
-
* @param {string} props.children - Nodes to render with specified typography.
|
2759
|
-
*/
|
2760
|
-
|
2761
|
-
function Text(_ref) {
|
2762
|
-
var inline = _ref.inline,
|
2763
|
-
scaleCategory = _ref.scaleCategory,
|
2764
|
-
children = _ref.children;
|
2765
|
-
return React.createElement(inline ? 'span' : 'div', {
|
2766
|
-
className: styles$p[scaleCategory]
|
2767
|
-
}, children);
|
2768
|
-
}
|
2769
|
-
|
2770
|
-
var css$J = ".InlineCaption-module_root__1R8Ib {\n padding: 3px 10px 5px;\n background-color: #fff;\n color: #222;\n text-shadow: none;\n}\n";
|
2771
|
-
var styles$q = {"root":"InlineCaption-module_root__1R8Ib"};
|
2772
|
-
styleInject(css$J);
|
2773
|
-
|
2774
|
-
/**
|
2775
|
-
* Render a caption text attached to a content element.
|
2776
|
-
*
|
2777
|
-
* @param {Object} props
|
2778
|
-
* @param {string} props.text - The text to be displayed.
|
2779
|
-
*/
|
2780
|
-
|
2781
|
-
function InlineCaption(_ref) {
|
2782
|
-
var text = _ref.text;
|
2783
|
-
|
2784
|
-
if (text) {
|
2785
|
-
return React.createElement("div", {
|
2786
|
-
className: styles$q.root,
|
2787
|
-
role: "caption"
|
2788
|
-
}, React.createElement(Text, {
|
2789
|
-
scaleCategory: "caption"
|
2790
|
-
}, text));
|
2791
|
-
} else {
|
2792
|
-
return null;
|
2793
|
-
}
|
2794
|
-
}
|
2795
|
-
|
2796
|
-
/**
|
2797
|
-
* Read and change media settings of the entry.
|
2798
|
-
*
|
2799
|
-
* @example
|
2800
|
-
* const mediaSettings = useMediaSettings();
|
2801
|
-
* mediaSettings // =>
|
2802
|
-
* {
|
2803
|
-
* muted: true, // All media elements should be played without sound.
|
2804
|
-
* setMuted: muted => {}, // Enable sound for all media elements.
|
2805
|
-
* mediaOff: false // Playing media is not allowed. Will be true when
|
2806
|
-
* // rendering section thumbnails in the editor.
|
2807
|
-
* }
|
2808
|
-
*/
|
2809
|
-
|
2810
|
-
function useMediaSettings() {
|
2811
|
-
return useContext(MutedContext);
|
2812
|
-
}
|
2813
|
-
|
2814
|
-
var css$K = ".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";
|
2815
|
-
var styles$r = {"crop":"SectionThumbnail-module_crop__Q1nZj","scale":"SectionThumbnail-module_scale__2tKDG"};
|
2816
|
-
styleInject(css$K);
|
2817
|
-
|
2818
|
-
function SectionThumbnail(_ref) {
|
2819
|
-
var seed = _ref.seed,
|
2820
|
-
props = _objectWithoutProperties(_ref, ["seed"]);
|
2821
|
-
|
2822
|
-
return React.createElement(EntryStateProvider, {
|
2823
|
-
seed: seed
|
2824
|
-
}, React.createElement(Inner, props));
|
2825
|
-
}
|
2826
|
-
|
2827
|
-
function Inner(_ref2) {
|
2828
|
-
var sectionPermaId = _ref2.sectionPermaId,
|
2829
|
-
subscribe = _ref2.subscribe;
|
2830
|
-
var dispatch = useEntryStateDispatch();
|
2831
|
-
useEffect(function () {
|
2832
|
-
return subscribe(dispatch);
|
2833
|
-
}, [subscribe, dispatch]);
|
2834
|
-
var section = useSectionStructure({
|
2835
|
-
sectionPermaId: sectionPermaId
|
2836
|
-
});
|
2837
|
-
|
2838
|
-
if (section) {
|
2839
|
-
return React.createElement("div", {
|
2840
|
-
className: styles$r.crop
|
2841
|
-
}, React.createElement("div", {
|
2842
|
-
className: styles$r.scale
|
2843
|
-
}, React.createElement("div", {
|
2844
|
-
className: entryStyles.Entry
|
2845
|
-
}, React.createElement(Section, Object.assign({
|
2846
|
-
state: "active"
|
2847
|
-
}, section, {
|
2848
|
-
transition: "preview"
|
2849
|
-
})))));
|
2850
|
-
} else {
|
2851
|
-
return React.createElement("div", {
|
2852
|
-
className: styles$r.root
|
2853
|
-
}, "Not found.");
|
2854
|
-
}
|
2855
|
-
}
|
2856
|
-
|
2857
|
-
Inner.defaultProps = {
|
2858
|
-
subscribe: function subscribe() {}
|
2859
|
-
};
|
2860
|
-
|
2861
|
-
var editMode = window.location.pathname.indexOf('/editor/entries') === 0;
|
2862
|
-
|
2863
|
-
window.pageflowScrolledRender = function (seed) {
|
2864
|
-
setupI18n(seed.i18n);
|
2865
|
-
ReactDOM.render(React.createElement(Root, {
|
2866
|
-
seed: seed
|
2867
|
-
}), document.getElementById('root'));
|
2868
|
-
};
|
2869
|
-
|
2870
|
-
function Root(_ref) {
|
2871
|
-
var seed = _ref.seed;
|
2872
|
-
return React.createElement(React.Fragment, null, React.createElement(EditorStateProvider, {
|
2873
|
-
active: editMode
|
2874
|
-
}, React.createElement(EntryStateProvider, {
|
2875
|
-
seed: seed
|
2876
|
-
}, React.createElement(AppHeader, null), React.createElement(Entry, null))));
|
2877
|
-
}
|
2878
|
-
|
2879
|
-
export { Entry, EntryStateProvider, Image, InlineCaption, SectionThumbnail, Text, Video, api as frontend, setupI18n, useEditorSelection, useFile, useI18n, useMediaSettings, useOnScreen };
|