@micromag/screen-timeline 0.3.531 → 0.3.547
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +4 -6
- package/package.json +14 -15
- package/lib/index.js +0 -750
package/es/index.js
CHANGED
|
@@ -355,15 +355,13 @@ var Timeline = function Timeline(_ref) {
|
|
|
355
355
|
};
|
|
356
356
|
Timeline.propTypes = propTypes;
|
|
357
357
|
Timeline.defaultProps = defaultProps;
|
|
358
|
-
var TimelineScreen = Timeline;
|
|
359
358
|
|
|
360
359
|
var TimelineIllustratedScreen = function TimelineIllustratedScreen(_ref) {
|
|
361
360
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
362
|
-
return /*#__PURE__*/React.createElement(
|
|
361
|
+
return /*#__PURE__*/React.createElement(Timeline, Object.assign({}, props, {
|
|
363
362
|
illustrated: true
|
|
364
363
|
}));
|
|
365
364
|
};
|
|
366
|
-
var TimelineIllustratedScreen$1 = TimelineIllustratedScreen;
|
|
367
365
|
|
|
368
366
|
var definition = [{
|
|
369
367
|
id: 'timeline',
|
|
@@ -385,7 +383,7 @@ var definition = [{
|
|
|
385
383
|
"value": "Timeline"
|
|
386
384
|
}]
|
|
387
385
|
}),
|
|
388
|
-
component:
|
|
386
|
+
component: Timeline,
|
|
389
387
|
layouts: ['normal'],
|
|
390
388
|
// transforms,
|
|
391
389
|
fields: [{
|
|
@@ -567,7 +565,7 @@ var definition = [{
|
|
|
567
565
|
"value": "Timeline with images"
|
|
568
566
|
}]
|
|
569
567
|
}),
|
|
570
|
-
component: TimelineIllustratedScreen
|
|
568
|
+
component: TimelineIllustratedScreen,
|
|
571
569
|
layouts: ['title-image-description', 'title-description-image', 'image-title-description'],
|
|
572
570
|
fields: [{
|
|
573
571
|
name: 'title',
|
|
@@ -741,4 +739,4 @@ var definition = [{
|
|
|
741
739
|
}]
|
|
742
740
|
}];
|
|
743
741
|
|
|
744
|
-
export { TimelineIllustratedScreen
|
|
742
|
+
export { TimelineIllustratedScreen, Timeline as TimelineScreen, definition as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-timeline",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.547",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,12 +30,11 @@
|
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"license": "ISC",
|
|
33
|
-
"
|
|
33
|
+
"type": "module",
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"style": "assets/css/styles.css",
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
|
-
"require": "./lib/index.js",
|
|
39
38
|
"import": "./es/index.js"
|
|
40
39
|
},
|
|
41
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -61,17 +60,17 @@
|
|
|
61
60
|
},
|
|
62
61
|
"dependencies": {
|
|
63
62
|
"@babel/runtime": "^7.13.10",
|
|
64
|
-
"@micromag/core": "^0.3.
|
|
65
|
-
"@micromag/element-background": "^0.3.
|
|
66
|
-
"@micromag/element-container": "^0.3.
|
|
67
|
-
"@micromag/element-footer": "^0.3.
|
|
68
|
-
"@micromag/element-header": "^0.3.
|
|
69
|
-
"@micromag/element-heading": "^0.3.
|
|
70
|
-
"@micromag/element-layout": "^0.3.
|
|
71
|
-
"@micromag/element-scroll": "^0.3.
|
|
72
|
-
"@micromag/element-text": "^0.3.
|
|
73
|
-
"@micromag/element-visual": "^0.3.
|
|
74
|
-
"@micromag/transforms": "^0.3.
|
|
63
|
+
"@micromag/core": "^0.3.547",
|
|
64
|
+
"@micromag/element-background": "^0.3.547",
|
|
65
|
+
"@micromag/element-container": "^0.3.547",
|
|
66
|
+
"@micromag/element-footer": "^0.3.547",
|
|
67
|
+
"@micromag/element-header": "^0.3.547",
|
|
68
|
+
"@micromag/element-heading": "^0.3.547",
|
|
69
|
+
"@micromag/element-layout": "^0.3.547",
|
|
70
|
+
"@micromag/element-scroll": "^0.3.547",
|
|
71
|
+
"@micromag/element-text": "^0.3.547",
|
|
72
|
+
"@micromag/element-visual": "^0.3.547",
|
|
73
|
+
"@micromag/transforms": "^0.3.547",
|
|
75
74
|
"classnames": "^2.2.6",
|
|
76
75
|
"lodash": "^4.17.21",
|
|
77
76
|
"prop-types": "^15.7.2",
|
|
@@ -82,5 +81,5 @@
|
|
|
82
81
|
"access": "public",
|
|
83
82
|
"registry": "https://registry.npmjs.org/"
|
|
84
83
|
},
|
|
85
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "3c2f5904ce61fcfa61f673c38c2a5ec56e9e2b07"
|
|
86
85
|
}
|
package/lib/index.js
DELETED
|
@@ -1,750 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var reactIntl = require('react-intl');
|
|
6
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
8
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
10
|
-
var classNames = require('classnames');
|
|
11
|
-
var PropTypes = require('prop-types');
|
|
12
|
-
var React = require('react');
|
|
13
|
-
var core = require('@micromag/core');
|
|
14
|
-
var components = require('@micromag/core/components');
|
|
15
|
-
var contexts = require('@micromag/core/contexts');
|
|
16
|
-
var hooks = require('@micromag/core/hooks');
|
|
17
|
-
var utils = require('@micromag/core/utils');
|
|
18
|
-
var Background = require('@micromag/element-background');
|
|
19
|
-
var Container = require('@micromag/element-container');
|
|
20
|
-
var Footer = require('@micromag/element-footer');
|
|
21
|
-
var Header = require('@micromag/element-header');
|
|
22
|
-
var Heading = require('@micromag/element-heading');
|
|
23
|
-
var Layout = require('@micromag/element-layout');
|
|
24
|
-
var Scroll = require('@micromag/element-scroll');
|
|
25
|
-
var Text = require('@micromag/element-text');
|
|
26
|
-
var Visual = require('@micromag/element-visual');
|
|
27
|
-
var _objectDestructuringEmpty = require('@babel/runtime/helpers/objectDestructuringEmpty');
|
|
28
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
29
|
-
|
|
30
|
-
var styles = {"container":"micromag-screen-timeline-container","background":"micromag-screen-timeline-background","empty":"micromag-screen-timeline-empty","content":"micromag-screen-timeline-content","emptyTitle":"micromag-screen-timeline-emptyTitle","item":"micromag-screen-timeline-item","element":"micromag-screen-timeline-element","hidden":"micromag-screen-timeline-hidden","body":"micromag-screen-timeline-body","timeline":"micromag-screen-timeline-timeline","line":"micromag-screen-timeline-line","bullet":"micromag-screen-timeline-bullet","last":"micromag-screen-timeline-last","title":"micromag-screen-timeline-title","description":"micromag-screen-timeline-description","imageContainer":"micromag-screen-timeline-imageContainer","image":"micromag-screen-timeline-image","video":"micromag-screen-timeline-video","callToAction":"micromag-screen-timeline-callToAction","disabled":"micromag-screen-timeline-disabled","isPlaceholder":"micromag-screen-timeline-isPlaceholder","scroll":"micromag-screen-timeline-scroll","circleBulletShape":"micromag-screen-timeline-circleBulletShape","withoutLines":"micromag-screen-timeline-withoutLines"};
|
|
31
|
-
|
|
32
|
-
var propTypes = {
|
|
33
|
-
layout: PropTypes.oneOf(['normal', 'title-description-image', 'title-image-description', 'image-title-description']),
|
|
34
|
-
title: core.PropTypes.headingElement,
|
|
35
|
-
items: PropTypes.arrayOf(core.PropTypes.textElement),
|
|
36
|
-
withoutLine: PropTypes.bool,
|
|
37
|
-
bulletColor: core.PropTypes.color,
|
|
38
|
-
lineColor: core.PropTypes.color,
|
|
39
|
-
bulletShape: PropTypes.oneOf(['circle', 'square']),
|
|
40
|
-
bulletFilled: PropTypes.bool,
|
|
41
|
-
illustrated: PropTypes.bool,
|
|
42
|
-
spacing: PropTypes.number,
|
|
43
|
-
header: core.PropTypes.header,
|
|
44
|
-
footer: core.PropTypes.footer,
|
|
45
|
-
background: core.PropTypes.backgroundElement,
|
|
46
|
-
current: PropTypes.bool,
|
|
47
|
-
active: PropTypes.bool,
|
|
48
|
-
type: PropTypes.string,
|
|
49
|
-
className: PropTypes.string
|
|
50
|
-
};
|
|
51
|
-
var defaultProps = {
|
|
52
|
-
layout: 'normal',
|
|
53
|
-
title: null,
|
|
54
|
-
items: [null],
|
|
55
|
-
withoutLine: false,
|
|
56
|
-
bulletColor: null,
|
|
57
|
-
lineColor: null,
|
|
58
|
-
bulletShape: 'circle',
|
|
59
|
-
bulletFilled: true,
|
|
60
|
-
illustrated: false,
|
|
61
|
-
spacing: 20,
|
|
62
|
-
header: null,
|
|
63
|
-
footer: null,
|
|
64
|
-
background: null,
|
|
65
|
-
current: true,
|
|
66
|
-
active: true,
|
|
67
|
-
type: null,
|
|
68
|
-
className: null
|
|
69
|
-
};
|
|
70
|
-
var Timeline = function Timeline(_ref) {
|
|
71
|
-
var layout = _ref.layout,
|
|
72
|
-
title = _ref.title,
|
|
73
|
-
items = _ref.items,
|
|
74
|
-
withoutLine = _ref.withoutLine,
|
|
75
|
-
bulletColor = _ref.bulletColor,
|
|
76
|
-
lineColor = _ref.lineColor,
|
|
77
|
-
bulletShape = _ref.bulletShape,
|
|
78
|
-
bulletFilled = _ref.bulletFilled,
|
|
79
|
-
illustrated = _ref.illustrated,
|
|
80
|
-
spacing = _ref.spacing,
|
|
81
|
-
header = _ref.header,
|
|
82
|
-
footer = _ref.footer,
|
|
83
|
-
background = _ref.background,
|
|
84
|
-
current = _ref.current,
|
|
85
|
-
active = _ref.active,
|
|
86
|
-
type = _ref.type,
|
|
87
|
-
className = _ref.className;
|
|
88
|
-
var trackScreenEvent = hooks.useTrackScreenEvent(type);
|
|
89
|
-
var _useScreenSize = contexts.useScreenSize(),
|
|
90
|
-
width = _useScreenSize.width,
|
|
91
|
-
height = _useScreenSize.height,
|
|
92
|
-
resolution = _useScreenSize.resolution;
|
|
93
|
-
var _useViewerContext = contexts.useViewerContext(),
|
|
94
|
-
viewerTopHeight = _useViewerContext.topHeight,
|
|
95
|
-
viewerBottomHeight = _useViewerContext.bottomHeight,
|
|
96
|
-
viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
|
|
97
|
-
var _useViewerWebView = contexts.useViewerWebView(),
|
|
98
|
-
openWebView = _useViewerWebView.open;
|
|
99
|
-
var _usePlaybackContext = contexts.usePlaybackContext(),
|
|
100
|
-
muted = _usePlaybackContext.muted;
|
|
101
|
-
var mediaRef = contexts.usePlaybackMediaRef(current);
|
|
102
|
-
var _useScreenRenderConte = contexts.useScreenRenderContext(),
|
|
103
|
-
isView = _useScreenRenderConte.isView,
|
|
104
|
-
isPreview = _useScreenRenderConte.isPreview,
|
|
105
|
-
isPlaceholder = _useScreenRenderConte.isPlaceholder,
|
|
106
|
-
isEdit = _useScreenRenderConte.isEdit,
|
|
107
|
-
isStatic = _useScreenRenderConte.isStatic,
|
|
108
|
-
isCapture = _useScreenRenderConte.isCapture;
|
|
109
|
-
var finalItems = React.useMemo(function () {
|
|
110
|
-
return isPlaceholder ? _toConsumableArray(new Array(5)).map(function () {
|
|
111
|
-
return {};
|
|
112
|
-
}) : items || [null];
|
|
113
|
-
}, [isPlaceholder, items]);
|
|
114
|
-
var hasTitle = utils.isTextFilled(title);
|
|
115
|
-
var itemsCount = finalItems !== null ? finalItems.length : 0;
|
|
116
|
-
var hasItems = finalItems !== null && itemsCount;
|
|
117
|
-
var imagesCount = hasItems ? finalItems.reduce(function (acc, curr) {
|
|
118
|
-
var _ref2 = curr || {},
|
|
119
|
-
_ref2$image = _ref2.image,
|
|
120
|
-
image = _ref2$image === void 0 ? null : _ref2$image;
|
|
121
|
-
return acc + (image !== null ? 1 : 0);
|
|
122
|
-
}, 0) : 0;
|
|
123
|
-
var _useState = React.useState(0),
|
|
124
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
125
|
-
imagesLoaded = _useState2[0],
|
|
126
|
-
setImagesLoaded = _useState2[1];
|
|
127
|
-
var ready = imagesLoaded >= imagesCount;
|
|
128
|
-
// const transitionsPlaying = current && ready;
|
|
129
|
-
var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
|
|
130
|
-
var scrollingDisabled = !isEdit && transitionDisabled || !current;
|
|
131
|
-
var backgroundPlaying = current && (isView || isEdit);
|
|
132
|
-
var mediaShouldLoad = current || active;
|
|
133
|
-
var onImageLoaded = React.useCallback(function () {
|
|
134
|
-
setImagesLoaded(function (count) {
|
|
135
|
-
return count + 1;
|
|
136
|
-
});
|
|
137
|
-
}, [setImagesLoaded]);
|
|
138
|
-
var firstLineRef = React.useRef(null);
|
|
139
|
-
var firstContentRef = React.useRef(null);
|
|
140
|
-
var _useState3 = React.useState(0),
|
|
141
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
142
|
-
imageWidth = _useState4[0],
|
|
143
|
-
setImageWidth = _useState4[1];
|
|
144
|
-
React.useEffect(function () {
|
|
145
|
-
if (firstLineRef.current !== null) {
|
|
146
|
-
setImageWidth(firstContentRef.current.offsetWidth - firstLineRef.current.offsetWidth);
|
|
147
|
-
} else {
|
|
148
|
-
setImageWidth(firstContentRef.current.offsetWidth);
|
|
149
|
-
}
|
|
150
|
-
}, [width, height]);
|
|
151
|
-
var timelineElements = (finalItems || []).map(function (item, itemI) {
|
|
152
|
-
var _ref3 = item || {},
|
|
153
|
-
_ref3$title = _ref3.title,
|
|
154
|
-
itemTitle = _ref3$title === void 0 ? null : _ref3$title,
|
|
155
|
-
_ref3$description = _ref3.description,
|
|
156
|
-
description = _ref3$description === void 0 ? null : _ref3$description,
|
|
157
|
-
_ref3$image = _ref3.image,
|
|
158
|
-
image = _ref3$image === void 0 ? null : _ref3$image;
|
|
159
|
-
var hasItemTitle = utils.isTextFilled(itemTitle);
|
|
160
|
-
var hasDescription = utils.isTextFilled(description);
|
|
161
|
-
var hasImage = image !== null;
|
|
162
|
-
var elementsTypes = (layout === 'normal' ? 'title-description-image' : layout).split('-');
|
|
163
|
-
var titleIndex = elementsTypes.indexOf('title');
|
|
164
|
-
var imageIndex = elementsTypes.indexOf('image');
|
|
165
|
-
if (!illustrated) {
|
|
166
|
-
elementsTypes.splice(imageIndex, 1);
|
|
167
|
-
}
|
|
168
|
-
var typesCount = elementsTypes.length;
|
|
169
|
-
var _ref4 = description || {},
|
|
170
|
-
descriptionTextStyle = _ref4.textStyle;
|
|
171
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
172
|
-
className: styles.item,
|
|
173
|
-
key: "item-".concat(itemI)
|
|
174
|
-
}, elementsTypes.map(function (elementType, typeI) {
|
|
175
|
-
var elementContent = null;
|
|
176
|
-
var hasElement = false;
|
|
177
|
-
switch (elementType) {
|
|
178
|
-
case 'title':
|
|
179
|
-
hasElement = hasItemTitle;
|
|
180
|
-
elementContent = /*#__PURE__*/React.createElement("div", {
|
|
181
|
-
className: styles.title
|
|
182
|
-
}, /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
183
|
-
placeholder: "title",
|
|
184
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
185
|
-
id: "bmO4Ss",
|
|
186
|
-
defaultMessage: [{
|
|
187
|
-
"type": 0,
|
|
188
|
-
"value": "Entry Title"
|
|
189
|
-
}]
|
|
190
|
-
}),
|
|
191
|
-
emptyClassName: styles.empty,
|
|
192
|
-
isEmpty: !hasItemTitle
|
|
193
|
-
}, hasItemTitle ? /*#__PURE__*/React.createElement(Heading, itemTitle) : null));
|
|
194
|
-
break;
|
|
195
|
-
case 'image':
|
|
196
|
-
hasElement = hasImage;
|
|
197
|
-
elementContent = /*#__PURE__*/React.createElement("div", {
|
|
198
|
-
className: styles.imageContainer
|
|
199
|
-
}, /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
200
|
-
placeholder: "image",
|
|
201
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
202
|
-
id: "ebsPd4",
|
|
203
|
-
defaultMessage: [{
|
|
204
|
-
"type": 0,
|
|
205
|
-
"value": "Image"
|
|
206
|
-
}]
|
|
207
|
-
}),
|
|
208
|
-
emptyClassName: styles.empty,
|
|
209
|
-
isEmpty: !hasImage
|
|
210
|
-
}, hasImage ? /*#__PURE__*/React.createElement(Visual, {
|
|
211
|
-
className: styles.image,
|
|
212
|
-
videoClassName: styles.video,
|
|
213
|
-
media: image,
|
|
214
|
-
width: imageWidth,
|
|
215
|
-
resolution: resolution,
|
|
216
|
-
playing: backgroundPlaying,
|
|
217
|
-
active: active,
|
|
218
|
-
shouldLoad: mediaShouldLoad,
|
|
219
|
-
withoutVideo: isPreview,
|
|
220
|
-
onLoaded: onImageLoaded
|
|
221
|
-
}) : null));
|
|
222
|
-
break;
|
|
223
|
-
case 'description':
|
|
224
|
-
hasElement = hasDescription;
|
|
225
|
-
elementContent = /*#__PURE__*/React.createElement("div", {
|
|
226
|
-
className: styles.description
|
|
227
|
-
}, /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
228
|
-
placeholder: "text",
|
|
229
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
230
|
-
id: "507VAi",
|
|
231
|
-
defaultMessage: [{
|
|
232
|
-
"type": 0,
|
|
233
|
-
"value": "Description"
|
|
234
|
-
}]
|
|
235
|
-
}),
|
|
236
|
-
emptyClassName: styles.empty,
|
|
237
|
-
isEmpty: !hasDescription
|
|
238
|
-
}, hasDescription ? /*#__PURE__*/React.createElement(Text, Object.assign({}, description, {
|
|
239
|
-
textStyle: _objectSpread({}, descriptionTextStyle)
|
|
240
|
-
})) : null));
|
|
241
|
-
break;
|
|
242
|
-
default:
|
|
243
|
-
elementContent = null;
|
|
244
|
-
hasElement = false;
|
|
245
|
-
}
|
|
246
|
-
var firstItem = itemI === 0;
|
|
247
|
-
var lastItem = itemI === itemsCount - 1;
|
|
248
|
-
var lastType = typeI === typesCount - 1;
|
|
249
|
-
var topLineHidden = firstItem && typeI <= titleIndex || lastItem && typeI > titleIndex;
|
|
250
|
-
var bottomLineHidden = firstItem && typeI < titleIndex || lastItem && typeI >= titleIndex;
|
|
251
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
252
|
-
key: "element-".concat(elementType),
|
|
253
|
-
className: classNames([styles.element, styles["element-".concat(elementType)], _defineProperty({}, styles.hidden, (isView || isStatic) && !hasElement)]),
|
|
254
|
-
ref: itemI === 0 ? firstContentRef : null
|
|
255
|
-
}, !withoutLine ? /*#__PURE__*/React.createElement("div", {
|
|
256
|
-
className: styles.timeline,
|
|
257
|
-
ref: itemI === 0 ? firstLineRef : null
|
|
258
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
259
|
-
className: classNames([styles.line, _defineProperty({}, styles.hidden, topLineHidden)]),
|
|
260
|
-
style: _objectSpread({}, !topLineHidden ? utils.getStyleFromColor(lineColor, 'backgroundColor') : null)
|
|
261
|
-
}), elementType === 'title' ? /*#__PURE__*/React.createElement("div", {
|
|
262
|
-
className: styles.bullet,
|
|
263
|
-
style: _objectSpread(_objectSpread({}, utils.getStyleFromColor(bulletColor, 'borderColor')), bulletFilled ? utils.getStyleFromColor(bulletColor, 'backgroundColor') : null)
|
|
264
|
-
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
265
|
-
className: classNames([styles.line, _defineProperty({}, styles.hidden, bottomLineHidden)]),
|
|
266
|
-
style: _objectSpread({}, !bottomLineHidden ? utils.getStyleFromColor(lineColor, 'backgroundColor') : null)
|
|
267
|
-
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
268
|
-
className: classNames([styles.body, _defineProperty({}, styles.last, lastType && !lastItem)])
|
|
269
|
-
}, elementContent));
|
|
270
|
-
}));
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
// Call to Action
|
|
274
|
-
var hasHeader = utils.isHeaderFilled(header);
|
|
275
|
-
var hasFooter = utils.isFooterFilled(footer);
|
|
276
|
-
var footerProps = utils.getFooterProps(footer, {
|
|
277
|
-
isView: isView,
|
|
278
|
-
current: current,
|
|
279
|
-
openWebView: openWebView,
|
|
280
|
-
isPreview: isPreview
|
|
281
|
-
});
|
|
282
|
-
var _useState5 = React.useState(false),
|
|
283
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
284
|
-
scrolledBottom = _useState6[0],
|
|
285
|
-
setScrolledBottom = _useState6[1];
|
|
286
|
-
var _useDimensionObserver = hooks.useDimensionObserver(),
|
|
287
|
-
footerRef = _useDimensionObserver.ref,
|
|
288
|
-
_useDimensionObserver2 = _useDimensionObserver.height,
|
|
289
|
-
footerHeight = _useDimensionObserver2 === void 0 ? 0 : _useDimensionObserver2;
|
|
290
|
-
var onScrolledBottom = React.useCallback(function (_ref9) {
|
|
291
|
-
var initial = _ref9.initial;
|
|
292
|
-
if (initial) {
|
|
293
|
-
trackScreenEvent('scroll', 'Screen');
|
|
294
|
-
}
|
|
295
|
-
setScrolledBottom(true);
|
|
296
|
-
}, [trackScreenEvent]);
|
|
297
|
-
var onScrolledNotBottom = React.useCallback(function () {
|
|
298
|
-
setScrolledBottom(false);
|
|
299
|
-
}, [setScrolledBottom]);
|
|
300
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
301
|
-
className: classNames([styles.container, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, className, className !== null), styles.isPlaceholder, isPlaceholder), styles["".concat(bulletShape, "BulletShape")], bulletShape !== null), styles.withoutLines, itemsCount < 2)]),
|
|
302
|
-
"data-screen-ready": ready
|
|
303
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
304
|
-
width: width,
|
|
305
|
-
height: height,
|
|
306
|
-
className: styles.content
|
|
307
|
-
}, /*#__PURE__*/React.createElement(Scroll, {
|
|
308
|
-
className: styles.scroll,
|
|
309
|
-
verticalAlign: "middle",
|
|
310
|
-
disabled: scrollingDisabled,
|
|
311
|
-
onScrolledBottom: onScrolledBottom,
|
|
312
|
-
onScrolledNotBottom: onScrolledNotBottom,
|
|
313
|
-
withShadow: true
|
|
314
|
-
}, /*#__PURE__*/React.createElement(Layout, {
|
|
315
|
-
style: !isPlaceholder ? {
|
|
316
|
-
padding: spacing,
|
|
317
|
-
paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing),
|
|
318
|
-
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (footerHeight || spacing)
|
|
319
|
-
} : null
|
|
320
|
-
}, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
|
|
321
|
-
style: {
|
|
322
|
-
paddingBottom: spacing
|
|
323
|
-
}
|
|
324
|
-
}, /*#__PURE__*/React.createElement(Header, header)) : null, /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
325
|
-
placeholder: "Title",
|
|
326
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
327
|
-
id: "BSTWf8",
|
|
328
|
-
defaultMessage: [{
|
|
329
|
-
"type": 0,
|
|
330
|
-
"value": "Title"
|
|
331
|
-
}]
|
|
332
|
-
}),
|
|
333
|
-
emptyClassName: classNames([styles.empty, styles.emptyTitle]),
|
|
334
|
-
isEmpty: !hasTitle
|
|
335
|
-
}, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({
|
|
336
|
-
className: styles.title
|
|
337
|
-
}, title)) : null), timelineElements)), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
338
|
-
ref: footerRef,
|
|
339
|
-
className: classNames([styles.callToAction, _defineProperty({}, styles.disabled, !scrolledBottom)]),
|
|
340
|
-
style: {
|
|
341
|
-
transform: current && !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null,
|
|
342
|
-
paddingLeft: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
343
|
-
paddingRight: Math.max(spacing / 2, viewerBottomSidesWidth),
|
|
344
|
-
paddingTop: spacing / 2,
|
|
345
|
-
paddingBottom: spacing / 2
|
|
346
|
-
}
|
|
347
|
-
}, /*#__PURE__*/React.createElement(Footer, footerProps)) : null), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
348
|
-
background: background,
|
|
349
|
-
width: width,
|
|
350
|
-
height: height,
|
|
351
|
-
resolution: resolution,
|
|
352
|
-
playing: backgroundPlaying,
|
|
353
|
-
muted: muted,
|
|
354
|
-
shouldLoad: mediaShouldLoad,
|
|
355
|
-
mediaRef: mediaRef,
|
|
356
|
-
withoutVideo: isPreview,
|
|
357
|
-
className: styles.background
|
|
358
|
-
}) : null);
|
|
359
|
-
};
|
|
360
|
-
Timeline.propTypes = propTypes;
|
|
361
|
-
Timeline.defaultProps = defaultProps;
|
|
362
|
-
var TimelineScreen = Timeline;
|
|
363
|
-
|
|
364
|
-
var TimelineIllustratedScreen = function TimelineIllustratedScreen(_ref) {
|
|
365
|
-
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
366
|
-
return /*#__PURE__*/React.createElement(TimelineScreen, Object.assign({}, props, {
|
|
367
|
-
illustrated: true
|
|
368
|
-
}));
|
|
369
|
-
};
|
|
370
|
-
var TimelineIllustratedScreen$1 = TimelineIllustratedScreen;
|
|
371
|
-
|
|
372
|
-
var definition = [{
|
|
373
|
-
id: 'timeline',
|
|
374
|
-
type: 'screen',
|
|
375
|
-
group: {
|
|
376
|
-
label: reactIntl.defineMessage({
|
|
377
|
-
id: "cGItoy",
|
|
378
|
-
defaultMessage: [{
|
|
379
|
-
"type": 0,
|
|
380
|
-
"value": "List"
|
|
381
|
-
}]
|
|
382
|
-
}),
|
|
383
|
-
order: 8
|
|
384
|
-
},
|
|
385
|
-
title: reactIntl.defineMessage({
|
|
386
|
-
id: "GzoKNb",
|
|
387
|
-
defaultMessage: [{
|
|
388
|
-
"type": 0,
|
|
389
|
-
"value": "Timeline"
|
|
390
|
-
}]
|
|
391
|
-
}),
|
|
392
|
-
component: TimelineScreen,
|
|
393
|
-
layouts: ['normal'],
|
|
394
|
-
// transforms,
|
|
395
|
-
fields: [{
|
|
396
|
-
name: 'title',
|
|
397
|
-
type: 'heading-element',
|
|
398
|
-
// inline: true,
|
|
399
|
-
theme: {
|
|
400
|
-
textStyle: 'heading1'
|
|
401
|
-
},
|
|
402
|
-
label: reactIntl.defineMessage({
|
|
403
|
-
id: "N25iDO",
|
|
404
|
-
defaultMessage: [{
|
|
405
|
-
"type": 0,
|
|
406
|
-
"value": "Title"
|
|
407
|
-
}]
|
|
408
|
-
})
|
|
409
|
-
}, {
|
|
410
|
-
name: 'items',
|
|
411
|
-
type: 'entries',
|
|
412
|
-
theme: {
|
|
413
|
-
title: {
|
|
414
|
-
textStyle: 'heading2'
|
|
415
|
-
},
|
|
416
|
-
description: {
|
|
417
|
-
textStyle: 'text'
|
|
418
|
-
}
|
|
419
|
-
},
|
|
420
|
-
label: reactIntl.defineMessage({
|
|
421
|
-
id: "3ifj0j",
|
|
422
|
-
defaultMessage: [{
|
|
423
|
-
"type": 0,
|
|
424
|
-
"value": "Entries"
|
|
425
|
-
}]
|
|
426
|
-
})
|
|
427
|
-
}, {
|
|
428
|
-
name: 'bulletShape',
|
|
429
|
-
type: 'radios',
|
|
430
|
-
defaultValue: 'circle',
|
|
431
|
-
options: [{
|
|
432
|
-
value: 'circle',
|
|
433
|
-
label: reactIntl.defineMessage({
|
|
434
|
-
id: "+uInZz",
|
|
435
|
-
defaultMessage: [{
|
|
436
|
-
"type": 0,
|
|
437
|
-
"value": "Circle"
|
|
438
|
-
}]
|
|
439
|
-
})
|
|
440
|
-
}, {
|
|
441
|
-
value: 'square',
|
|
442
|
-
label: reactIntl.defineMessage({
|
|
443
|
-
id: "fusnxf",
|
|
444
|
-
defaultMessage: [{
|
|
445
|
-
"type": 0,
|
|
446
|
-
"value": "Square"
|
|
447
|
-
}]
|
|
448
|
-
})
|
|
449
|
-
}],
|
|
450
|
-
label: reactIntl.defineMessage({
|
|
451
|
-
id: "twTaAZ",
|
|
452
|
-
defaultMessage: [{
|
|
453
|
-
"type": 0,
|
|
454
|
-
"value": "Bullet shape"
|
|
455
|
-
}]
|
|
456
|
-
})
|
|
457
|
-
}, {
|
|
458
|
-
name: 'withoutLine',
|
|
459
|
-
type: 'toggle',
|
|
460
|
-
defaultValue: false,
|
|
461
|
-
label: reactIntl.defineMessage({
|
|
462
|
-
id: "N4lZhy",
|
|
463
|
-
defaultMessage: [{
|
|
464
|
-
"type": 0,
|
|
465
|
-
"value": "Without line"
|
|
466
|
-
}]
|
|
467
|
-
})
|
|
468
|
-
}, {
|
|
469
|
-
name: 'bulletFilled',
|
|
470
|
-
type: 'toggle',
|
|
471
|
-
defaultValue: false,
|
|
472
|
-
label: reactIntl.defineMessage({
|
|
473
|
-
id: "YWcp4v",
|
|
474
|
-
defaultMessage: [{
|
|
475
|
-
"type": 0,
|
|
476
|
-
"value": "Bullet filled"
|
|
477
|
-
}]
|
|
478
|
-
})
|
|
479
|
-
}, {
|
|
480
|
-
name: 'bulletColor',
|
|
481
|
-
type: 'color',
|
|
482
|
-
defaultValue: {
|
|
483
|
-
alpha: 1,
|
|
484
|
-
color: '#FFFFFF'
|
|
485
|
-
},
|
|
486
|
-
label: reactIntl.defineMessage({
|
|
487
|
-
id: "uNpHnA",
|
|
488
|
-
defaultMessage: [{
|
|
489
|
-
"type": 0,
|
|
490
|
-
"value": "Bullet color"
|
|
491
|
-
}]
|
|
492
|
-
})
|
|
493
|
-
}, {
|
|
494
|
-
name: 'lineColor',
|
|
495
|
-
type: 'color',
|
|
496
|
-
defaultValue: {
|
|
497
|
-
alpha: 1,
|
|
498
|
-
color: '#FFFFFF'
|
|
499
|
-
},
|
|
500
|
-
label: reactIntl.defineMessage({
|
|
501
|
-
id: "RHMS2f",
|
|
502
|
-
defaultMessage: [{
|
|
503
|
-
"type": 0,
|
|
504
|
-
"value": "Line color"
|
|
505
|
-
}]
|
|
506
|
-
})
|
|
507
|
-
}, {
|
|
508
|
-
name: 'background',
|
|
509
|
-
type: 'background',
|
|
510
|
-
label: reactIntl.defineMessage({
|
|
511
|
-
id: "+MPZRu",
|
|
512
|
-
defaultMessage: [{
|
|
513
|
-
"type": 0,
|
|
514
|
-
"value": "Background"
|
|
515
|
-
}]
|
|
516
|
-
})
|
|
517
|
-
}, {
|
|
518
|
-
name: 'header',
|
|
519
|
-
type: 'header',
|
|
520
|
-
label: reactIntl.defineMessage({
|
|
521
|
-
id: "rhuDxI",
|
|
522
|
-
defaultMessage: [{
|
|
523
|
-
"type": 0,
|
|
524
|
-
"value": "Header"
|
|
525
|
-
}]
|
|
526
|
-
}),
|
|
527
|
-
theme: {
|
|
528
|
-
badge: {
|
|
529
|
-
label: {
|
|
530
|
-
textStyle: 'badge'
|
|
531
|
-
},
|
|
532
|
-
boxStyle: 'badge'
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
}, {
|
|
536
|
-
name: 'footer',
|
|
537
|
-
type: 'footer',
|
|
538
|
-
label: reactIntl.defineMessage({
|
|
539
|
-
id: "g4nybp",
|
|
540
|
-
defaultMessage: [{
|
|
541
|
-
"type": 0,
|
|
542
|
-
"value": "Footer"
|
|
543
|
-
}]
|
|
544
|
-
}),
|
|
545
|
-
theme: {
|
|
546
|
-
callToAction: {
|
|
547
|
-
label: {
|
|
548
|
-
textStyle: 'cta'
|
|
549
|
-
},
|
|
550
|
-
boxStyle: 'cta'
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}]
|
|
554
|
-
}, {
|
|
555
|
-
id: 'timeline-illustrated',
|
|
556
|
-
type: 'screen',
|
|
557
|
-
group: {
|
|
558
|
-
label: reactIntl.defineMessage({
|
|
559
|
-
id: "cGItoy",
|
|
560
|
-
defaultMessage: [{
|
|
561
|
-
"type": 0,
|
|
562
|
-
"value": "List"
|
|
563
|
-
}]
|
|
564
|
-
}),
|
|
565
|
-
order: 8
|
|
566
|
-
},
|
|
567
|
-
title: reactIntl.defineMessage({
|
|
568
|
-
id: "33UbSd",
|
|
569
|
-
defaultMessage: [{
|
|
570
|
-
"type": 0,
|
|
571
|
-
"value": "Timeline with images"
|
|
572
|
-
}]
|
|
573
|
-
}),
|
|
574
|
-
component: TimelineIllustratedScreen$1,
|
|
575
|
-
layouts: ['title-image-description', 'title-description-image', 'image-title-description'],
|
|
576
|
-
fields: [{
|
|
577
|
-
name: 'title',
|
|
578
|
-
type: 'heading-element',
|
|
579
|
-
// inline: true,
|
|
580
|
-
theme: {
|
|
581
|
-
textStyle: 'heading1'
|
|
582
|
-
},
|
|
583
|
-
label: reactIntl.defineMessage({
|
|
584
|
-
id: "N25iDO",
|
|
585
|
-
defaultMessage: [{
|
|
586
|
-
"type": 0,
|
|
587
|
-
"value": "Title"
|
|
588
|
-
}]
|
|
589
|
-
})
|
|
590
|
-
}, {
|
|
591
|
-
name: 'layout',
|
|
592
|
-
type: 'screen-layout',
|
|
593
|
-
defaultValue: 'title-image-description',
|
|
594
|
-
label: reactIntl.defineMessage({
|
|
595
|
-
id: "4iBXj2",
|
|
596
|
-
defaultMessage: [{
|
|
597
|
-
"type": 0,
|
|
598
|
-
"value": "Layout"
|
|
599
|
-
}]
|
|
600
|
-
})
|
|
601
|
-
}, {
|
|
602
|
-
name: 'items',
|
|
603
|
-
type: 'entries-with-visual',
|
|
604
|
-
theme: {
|
|
605
|
-
title: {
|
|
606
|
-
textStyle: 'heading2'
|
|
607
|
-
},
|
|
608
|
-
description: {
|
|
609
|
-
textStyle: 'text'
|
|
610
|
-
}
|
|
611
|
-
},
|
|
612
|
-
label: reactIntl.defineMessage({
|
|
613
|
-
id: "3ifj0j",
|
|
614
|
-
defaultMessage: [{
|
|
615
|
-
"type": 0,
|
|
616
|
-
"value": "Entries"
|
|
617
|
-
}]
|
|
618
|
-
})
|
|
619
|
-
}, {
|
|
620
|
-
name: 'withoutLine',
|
|
621
|
-
type: 'toggle',
|
|
622
|
-
defaultValue: false,
|
|
623
|
-
label: reactIntl.defineMessage({
|
|
624
|
-
id: "N4lZhy",
|
|
625
|
-
defaultMessage: [{
|
|
626
|
-
"type": 0,
|
|
627
|
-
"value": "Without line"
|
|
628
|
-
}]
|
|
629
|
-
})
|
|
630
|
-
}, {
|
|
631
|
-
name: 'bulletShape',
|
|
632
|
-
type: 'radios',
|
|
633
|
-
defaultValue: 'circle',
|
|
634
|
-
options: [{
|
|
635
|
-
value: 'circle',
|
|
636
|
-
label: reactIntl.defineMessage({
|
|
637
|
-
id: "+uInZz",
|
|
638
|
-
defaultMessage: [{
|
|
639
|
-
"type": 0,
|
|
640
|
-
"value": "Circle"
|
|
641
|
-
}]
|
|
642
|
-
})
|
|
643
|
-
}, {
|
|
644
|
-
value: 'square',
|
|
645
|
-
label: reactIntl.defineMessage({
|
|
646
|
-
id: "fusnxf",
|
|
647
|
-
defaultMessage: [{
|
|
648
|
-
"type": 0,
|
|
649
|
-
"value": "Square"
|
|
650
|
-
}]
|
|
651
|
-
})
|
|
652
|
-
}],
|
|
653
|
-
label: reactIntl.defineMessage({
|
|
654
|
-
id: "twTaAZ",
|
|
655
|
-
defaultMessage: [{
|
|
656
|
-
"type": 0,
|
|
657
|
-
"value": "Bullet shape"
|
|
658
|
-
}]
|
|
659
|
-
})
|
|
660
|
-
}, {
|
|
661
|
-
name: 'bulletFilled',
|
|
662
|
-
type: 'toggle',
|
|
663
|
-
defaultValue: false,
|
|
664
|
-
label: reactIntl.defineMessage({
|
|
665
|
-
id: "YWcp4v",
|
|
666
|
-
defaultMessage: [{
|
|
667
|
-
"type": 0,
|
|
668
|
-
"value": "Bullet filled"
|
|
669
|
-
}]
|
|
670
|
-
})
|
|
671
|
-
}, {
|
|
672
|
-
name: 'bulletColor',
|
|
673
|
-
type: 'color',
|
|
674
|
-
defaultValue: {
|
|
675
|
-
alpha: 1,
|
|
676
|
-
color: '#FFFFFF'
|
|
677
|
-
},
|
|
678
|
-
label: reactIntl.defineMessage({
|
|
679
|
-
id: "uNpHnA",
|
|
680
|
-
defaultMessage: [{
|
|
681
|
-
"type": 0,
|
|
682
|
-
"value": "Bullet color"
|
|
683
|
-
}]
|
|
684
|
-
})
|
|
685
|
-
}, {
|
|
686
|
-
name: 'lineColor',
|
|
687
|
-
type: 'color',
|
|
688
|
-
defaultValue: {
|
|
689
|
-
alpha: 1,
|
|
690
|
-
color: '#FFFFFF'
|
|
691
|
-
},
|
|
692
|
-
label: reactIntl.defineMessage({
|
|
693
|
-
id: "RHMS2f",
|
|
694
|
-
defaultMessage: [{
|
|
695
|
-
"type": 0,
|
|
696
|
-
"value": "Line color"
|
|
697
|
-
}]
|
|
698
|
-
})
|
|
699
|
-
}, {
|
|
700
|
-
name: 'background',
|
|
701
|
-
type: 'background',
|
|
702
|
-
label: reactIntl.defineMessage({
|
|
703
|
-
id: "+MPZRu",
|
|
704
|
-
defaultMessage: [{
|
|
705
|
-
"type": 0,
|
|
706
|
-
"value": "Background"
|
|
707
|
-
}]
|
|
708
|
-
})
|
|
709
|
-
}, {
|
|
710
|
-
name: 'header',
|
|
711
|
-
type: 'header',
|
|
712
|
-
label: reactIntl.defineMessage({
|
|
713
|
-
id: "rhuDxI",
|
|
714
|
-
defaultMessage: [{
|
|
715
|
-
"type": 0,
|
|
716
|
-
"value": "Header"
|
|
717
|
-
}]
|
|
718
|
-
}),
|
|
719
|
-
theme: {
|
|
720
|
-
badge: {
|
|
721
|
-
label: {
|
|
722
|
-
textStyle: 'badge'
|
|
723
|
-
},
|
|
724
|
-
boxStyle: 'badge'
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}, {
|
|
728
|
-
name: 'footer',
|
|
729
|
-
type: 'footer',
|
|
730
|
-
label: reactIntl.defineMessage({
|
|
731
|
-
id: "g4nybp",
|
|
732
|
-
defaultMessage: [{
|
|
733
|
-
"type": 0,
|
|
734
|
-
"value": "Footer"
|
|
735
|
-
}]
|
|
736
|
-
}),
|
|
737
|
-
theme: {
|
|
738
|
-
callToAction: {
|
|
739
|
-
label: {
|
|
740
|
-
textStyle: 'cta'
|
|
741
|
-
},
|
|
742
|
-
boxStyle: 'cta'
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
}]
|
|
746
|
-
}];
|
|
747
|
-
|
|
748
|
-
exports.TimelineIllustratedScreen = TimelineIllustratedScreen$1;
|
|
749
|
-
exports.TimelineScreen = TimelineScreen;
|
|
750
|
-
exports.default = definition;
|