@micromag/screen-gallery 0.3.541 → 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 +3 -4
- package/package.json +13 -14
- package/lib/index.js +0 -669
package/es/index.js
CHANGED
|
@@ -440,11 +440,10 @@ var GalleryScreen = function GalleryScreen(_ref) {
|
|
|
440
440
|
};
|
|
441
441
|
GalleryScreen.propTypes = propTypes;
|
|
442
442
|
GalleryScreen.defaultProps = defaultProps;
|
|
443
|
-
var GalleryScreen$1 = GalleryScreen;
|
|
444
443
|
|
|
445
444
|
function GalleryCaptionsScreen(_ref) {
|
|
446
445
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
447
|
-
return /*#__PURE__*/React.createElement(GalleryScreen
|
|
446
|
+
return /*#__PURE__*/React.createElement(GalleryScreen, Object.assign({}, props, {
|
|
448
447
|
withCaptions: true
|
|
449
448
|
}));
|
|
450
449
|
}
|
|
@@ -471,7 +470,7 @@ var definition = [{
|
|
|
471
470
|
"value": "Gallery"
|
|
472
471
|
}]
|
|
473
472
|
}),
|
|
474
|
-
component: GalleryScreen
|
|
473
|
+
component: GalleryScreen,
|
|
475
474
|
layouts: [
|
|
476
475
|
// 2
|
|
477
476
|
'two-vertical-equal', 'two-vertical-top', 'two-vertical-bottom',
|
|
@@ -660,4 +659,4 @@ var definition = [{
|
|
|
660
659
|
}]
|
|
661
660
|
}];
|
|
662
661
|
|
|
663
|
-
export { GalleryCaptionsScreen, GalleryScreen
|
|
662
|
+
export { GalleryCaptionsScreen, GalleryScreen, definition as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-gallery",
|
|
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,16 +60,16 @@
|
|
|
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-grid": "^0.3.
|
|
69
|
-
"@micromag/element-header": "^0.3.
|
|
70
|
-
"@micromag/element-layout": "^0.3.
|
|
71
|
-
"@micromag/element-text": "^0.3.
|
|
72
|
-
"@micromag/element-visual": "^0.3.
|
|
73
|
-
"@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-grid": "^0.3.547",
|
|
68
|
+
"@micromag/element-header": "^0.3.547",
|
|
69
|
+
"@micromag/element-layout": "^0.3.547",
|
|
70
|
+
"@micromag/element-text": "^0.3.547",
|
|
71
|
+
"@micromag/element-visual": "^0.3.547",
|
|
72
|
+
"@micromag/transforms": "^0.3.547",
|
|
74
73
|
"classnames": "^2.2.6",
|
|
75
74
|
"lodash": "^4.17.21",
|
|
76
75
|
"prop-types": "^15.7.2",
|
|
@@ -81,5 +80,5 @@
|
|
|
81
80
|
"access": "public",
|
|
82
81
|
"registry": "https://registry.npmjs.org/"
|
|
83
82
|
},
|
|
84
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "3c2f5904ce61fcfa61f673c38c2a5ec56e9e2b07"
|
|
85
84
|
}
|
package/lib/index.js
DELETED
|
@@ -1,669 +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 _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
8
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
-
var classNames = require('classnames');
|
|
10
|
-
var isPlainObject = require('lodash/isPlainObject');
|
|
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 Grid = require('@micromag/element-grid');
|
|
22
|
-
var Header = require('@micromag/element-header');
|
|
23
|
-
var Text = require('@micromag/element-text');
|
|
24
|
-
var Visual = require('@micromag/element-visual');
|
|
25
|
-
var _objectDestructuringEmpty = require('@babel/runtime/helpers/objectDestructuringEmpty');
|
|
26
|
-
var _extends = require('@babel/runtime/helpers/extends');
|
|
27
|
-
|
|
28
|
-
var layoutProps = {
|
|
29
|
-
// 2
|
|
30
|
-
'two-vertical-equal': {
|
|
31
|
-
vertical: true,
|
|
32
|
-
layout: [{
|
|
33
|
-
columns: 1,
|
|
34
|
-
rows: [1, 1]
|
|
35
|
-
}]
|
|
36
|
-
},
|
|
37
|
-
'two-vertical-top': {
|
|
38
|
-
vertical: true,
|
|
39
|
-
layout: [{
|
|
40
|
-
columns: 1,
|
|
41
|
-
rows: [2, 1]
|
|
42
|
-
}]
|
|
43
|
-
},
|
|
44
|
-
'two-vertical-bottom': {
|
|
45
|
-
vertical: true,
|
|
46
|
-
layout: [{
|
|
47
|
-
columns: 1,
|
|
48
|
-
rows: [1, 2]
|
|
49
|
-
}]
|
|
50
|
-
},
|
|
51
|
-
// 3
|
|
52
|
-
'three-vertical': {
|
|
53
|
-
vertical: true,
|
|
54
|
-
layout: [{
|
|
55
|
-
columns: 1,
|
|
56
|
-
rows: [1, 1, 1]
|
|
57
|
-
}]
|
|
58
|
-
},
|
|
59
|
-
'one-two': {
|
|
60
|
-
layout: [{
|
|
61
|
-
rows: 2,
|
|
62
|
-
columns: [1]
|
|
63
|
-
}, {
|
|
64
|
-
rows: 1,
|
|
65
|
-
columns: [1, 1]
|
|
66
|
-
}]
|
|
67
|
-
},
|
|
68
|
-
'two-one': {
|
|
69
|
-
layout: [{
|
|
70
|
-
rows: 1,
|
|
71
|
-
columns: [1, 1]
|
|
72
|
-
}, {
|
|
73
|
-
rows: 2,
|
|
74
|
-
columns: [1]
|
|
75
|
-
}]
|
|
76
|
-
},
|
|
77
|
-
// 4
|
|
78
|
-
'two-by-two': {
|
|
79
|
-
layout: [{
|
|
80
|
-
rows: 1,
|
|
81
|
-
columns: [1, 1]
|
|
82
|
-
}, {
|
|
83
|
-
rows: 1,
|
|
84
|
-
columns: [1, 1]
|
|
85
|
-
}]
|
|
86
|
-
},
|
|
87
|
-
'four-vertical': {
|
|
88
|
-
vertical: true,
|
|
89
|
-
layout: [{
|
|
90
|
-
columns: 1,
|
|
91
|
-
rows: [1, 1, 1, 1]
|
|
92
|
-
}]
|
|
93
|
-
},
|
|
94
|
-
'one-two-one': {
|
|
95
|
-
layout: [{
|
|
96
|
-
rows: 3,
|
|
97
|
-
columns: [1]
|
|
98
|
-
}, {
|
|
99
|
-
rows: 2,
|
|
100
|
-
columns: [1, 1]
|
|
101
|
-
}, {
|
|
102
|
-
rows: 3,
|
|
103
|
-
columns: [1]
|
|
104
|
-
}]
|
|
105
|
-
},
|
|
106
|
-
'four-mosaic': {
|
|
107
|
-
vertical: true,
|
|
108
|
-
layout: [{
|
|
109
|
-
columns: 1,
|
|
110
|
-
rows: [2, 1]
|
|
111
|
-
}, {
|
|
112
|
-
columns: 1,
|
|
113
|
-
rows: [1, 2]
|
|
114
|
-
}]
|
|
115
|
-
},
|
|
116
|
-
// 5
|
|
117
|
-
'two-one-two': {
|
|
118
|
-
layout: [{
|
|
119
|
-
rows: 2,
|
|
120
|
-
columns: [1, 1]
|
|
121
|
-
}, {
|
|
122
|
-
rows: 3,
|
|
123
|
-
columns: [1]
|
|
124
|
-
}, {
|
|
125
|
-
rows: 2,
|
|
126
|
-
columns: [1, 1]
|
|
127
|
-
}]
|
|
128
|
-
},
|
|
129
|
-
'one-two-two': {
|
|
130
|
-
layout: [{
|
|
131
|
-
rows: 3,
|
|
132
|
-
columns: [1]
|
|
133
|
-
}, {
|
|
134
|
-
rows: 2,
|
|
135
|
-
columns: [1, 1]
|
|
136
|
-
}, {
|
|
137
|
-
rows: 2,
|
|
138
|
-
columns: [1, 1]
|
|
139
|
-
}]
|
|
140
|
-
},
|
|
141
|
-
'two-two-one': {
|
|
142
|
-
layout: [{
|
|
143
|
-
rows: 2,
|
|
144
|
-
columns: [1, 1]
|
|
145
|
-
}, {
|
|
146
|
-
rows: 2,
|
|
147
|
-
columns: [1, 1]
|
|
148
|
-
}, {
|
|
149
|
-
rows: 3,
|
|
150
|
-
columns: [1]
|
|
151
|
-
}]
|
|
152
|
-
},
|
|
153
|
-
// 6
|
|
154
|
-
'two-by-three': {
|
|
155
|
-
layout: [{
|
|
156
|
-
rows: 1,
|
|
157
|
-
columns: [1, 1]
|
|
158
|
-
}, {
|
|
159
|
-
rows: 1,
|
|
160
|
-
columns: [1, 1]
|
|
161
|
-
}, {
|
|
162
|
-
rows: 1,
|
|
163
|
-
columns: [1, 1]
|
|
164
|
-
}]
|
|
165
|
-
},
|
|
166
|
-
'one-one-two-two': {
|
|
167
|
-
layout: [{
|
|
168
|
-
rows: 1,
|
|
169
|
-
columns: [1]
|
|
170
|
-
}, {
|
|
171
|
-
rows: 1,
|
|
172
|
-
columns: [1]
|
|
173
|
-
}, {
|
|
174
|
-
rows: 1,
|
|
175
|
-
columns: [1, 1]
|
|
176
|
-
}, {
|
|
177
|
-
rows: 1,
|
|
178
|
-
columns: [1, 1]
|
|
179
|
-
}]
|
|
180
|
-
},
|
|
181
|
-
'two-two-one-one': {
|
|
182
|
-
layout: [{
|
|
183
|
-
rows: 1,
|
|
184
|
-
columns: [1, 1]
|
|
185
|
-
}, {
|
|
186
|
-
rows: 1,
|
|
187
|
-
columns: [1, 1]
|
|
188
|
-
}, {
|
|
189
|
-
rows: 1,
|
|
190
|
-
columns: [1]
|
|
191
|
-
}, {
|
|
192
|
-
rows: 1,
|
|
193
|
-
columns: [1]
|
|
194
|
-
}]
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
var styles = {"container":"micromag-screen-gallery-container","image":"micromag-screen-gallery-image","inner":"micromag-screen-gallery-inner","background":"micromag-screen-gallery-background","disabled":"micromag-screen-gallery-disabled","hidden":"micromag-screen-gallery-hidden","placeholder":"micromag-screen-gallery-placeholder","content":"micromag-screen-gallery-content","emptyImage":"micromag-screen-gallery-emptyImage","emptyCaption":"micromag-screen-gallery-emptyCaption","grid":"micromag-screen-gallery-grid","gridItem":"micromag-screen-gallery-gridItem","imageContainer":"micromag-screen-gallery-imageContainer","header":"micromag-screen-gallery-header","footer":"micromag-screen-gallery-footer","caption":"micromag-screen-gallery-caption"};
|
|
199
|
-
|
|
200
|
-
var propTypes = {
|
|
201
|
-
layout: PropTypes.oneOf([
|
|
202
|
-
// 2
|
|
203
|
-
'two-vertical-equal', 'two-vertical-top', 'two-vertical-bottom',
|
|
204
|
-
// 3
|
|
205
|
-
'three-vertical', 'one-two', 'two-one',
|
|
206
|
-
// 4
|
|
207
|
-
'two-by-two', 'four-vertical', 'one-two-one', 'four-mosaic',
|
|
208
|
-
// 5
|
|
209
|
-
'two-one-two', 'one-two-two', 'two-two-one',
|
|
210
|
-
// 6
|
|
211
|
-
'two-by-three', 'one-one-two-two', 'two-two-one-one']),
|
|
212
|
-
images: PropTypes.oneOfType([core.PropTypes.imageMedias, core.PropTypes.imageElements]),
|
|
213
|
-
withCaptions: PropTypes.bool,
|
|
214
|
-
spacing: PropTypes.number,
|
|
215
|
-
captionMaxLines: PropTypes.number,
|
|
216
|
-
background: core.PropTypes.backgroundElement,
|
|
217
|
-
header: core.PropTypes.header,
|
|
218
|
-
footer: core.PropTypes.footer,
|
|
219
|
-
current: PropTypes.bool,
|
|
220
|
-
active: PropTypes.bool,
|
|
221
|
-
className: PropTypes.string
|
|
222
|
-
};
|
|
223
|
-
var defaultProps = {
|
|
224
|
-
layout: 'four-mosaic',
|
|
225
|
-
withCaptions: false,
|
|
226
|
-
images: [],
|
|
227
|
-
spacing: 20,
|
|
228
|
-
captionMaxLines: 2,
|
|
229
|
-
background: null,
|
|
230
|
-
header: null,
|
|
231
|
-
footer: null,
|
|
232
|
-
current: true,
|
|
233
|
-
active: true,
|
|
234
|
-
className: null
|
|
235
|
-
};
|
|
236
|
-
var GalleryScreen = function GalleryScreen(_ref) {
|
|
237
|
-
var layout = _ref.layout,
|
|
238
|
-
images = _ref.images,
|
|
239
|
-
withCaptions = _ref.withCaptions,
|
|
240
|
-
background = _ref.background,
|
|
241
|
-
header = _ref.header,
|
|
242
|
-
footer = _ref.footer,
|
|
243
|
-
current = _ref.current,
|
|
244
|
-
active = _ref.active,
|
|
245
|
-
spacing = _ref.spacing,
|
|
246
|
-
captionMaxLines = _ref.captionMaxLines,
|
|
247
|
-
className = _ref.className;
|
|
248
|
-
var _useScreenSize = contexts.useScreenSize(),
|
|
249
|
-
width = _useScreenSize.width,
|
|
250
|
-
height = _useScreenSize.height,
|
|
251
|
-
resolution = _useScreenSize.resolution;
|
|
252
|
-
var _useViewerContext = contexts.useViewerContext(),
|
|
253
|
-
viewerTopHeight = _useViewerContext.topHeight,
|
|
254
|
-
viewerBottomHeight = _useViewerContext.bottomHeight,
|
|
255
|
-
viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
|
|
256
|
-
var _useViewerWebView = contexts.useViewerWebView(),
|
|
257
|
-
openWebView = _useViewerWebView.open;
|
|
258
|
-
var _usePlaybackContext = contexts.usePlaybackContext(),
|
|
259
|
-
muted = _usePlaybackContext.muted;
|
|
260
|
-
var mediaRef = contexts.usePlaybackMediaRef(current);
|
|
261
|
-
var _useScreenRenderConte = contexts.useScreenRenderContext(),
|
|
262
|
-
isView = _useScreenRenderConte.isView,
|
|
263
|
-
isPreview = _useScreenRenderConte.isPreview,
|
|
264
|
-
isPlaceholder = _useScreenRenderConte.isPlaceholder,
|
|
265
|
-
isEdit = _useScreenRenderConte.isEdit;
|
|
266
|
-
var backgroundPlaying = current && (isView || isEdit);
|
|
267
|
-
var mediaShouldLoad = current || active;
|
|
268
|
-
var finalSpacing = isPlaceholder ? 5 : spacing;
|
|
269
|
-
var grid = isPlainObject(layoutProps[layout]) ? layoutProps[layout] : {};
|
|
270
|
-
var _grid$layout = grid.layout,
|
|
271
|
-
gridLayout = _grid$layout === void 0 ? [] : _grid$layout,
|
|
272
|
-
_grid$vertical = grid.vertical,
|
|
273
|
-
vertical = _grid$vertical === void 0 ? false : _grid$vertical;
|
|
274
|
-
var gridSpaces = gridLayout.reduce(function (acc, _ref2) {
|
|
275
|
-
var rows = _ref2.rows,
|
|
276
|
-
columns = _ref2.columns;
|
|
277
|
-
return acc + (vertical ? rows : columns).length;
|
|
278
|
-
}, 0);
|
|
279
|
-
var _useState = React.useState(0),
|
|
280
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
281
|
-
imagesLoaded = _useState2[0],
|
|
282
|
-
setImagesLoaded = _useState2[1];
|
|
283
|
-
var imagesCount = images !== null ? Math.min(gridSpaces, images.length) : 0;
|
|
284
|
-
var ready = imagesLoaded >= imagesCount;
|
|
285
|
-
var onImageLoaded = React.useCallback(function () {
|
|
286
|
-
setImagesLoaded(function (count) {
|
|
287
|
-
return count + 1;
|
|
288
|
-
});
|
|
289
|
-
}, [setImagesLoaded]);
|
|
290
|
-
var imagesEl = React.useRef([]);
|
|
291
|
-
var _useState3 = React.useState([]),
|
|
292
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
293
|
-
imagesSizes = _useState4[0],
|
|
294
|
-
setImagesSizes = _useState4[1];
|
|
295
|
-
var _useDimensionObserver = hooks.useDimensionObserver(),
|
|
296
|
-
contentRef = _useDimensionObserver.ref,
|
|
297
|
-
_useDimensionObserver2 = _useDimensionObserver.width,
|
|
298
|
-
contentWidth = _useDimensionObserver2 === void 0 ? null : _useDimensionObserver2,
|
|
299
|
-
_useDimensionObserver3 = _useDimensionObserver.height,
|
|
300
|
-
contentHeight = _useDimensionObserver3 === void 0 ? null : _useDimensionObserver3;
|
|
301
|
-
React.useEffect(function () {
|
|
302
|
-
if (imagesEl.current.length) {
|
|
303
|
-
setImagesSizes(imagesEl.current.map(function (imageEl) {
|
|
304
|
-
return imageEl !== null ? {
|
|
305
|
-
width: imageEl.offsetWidth,
|
|
306
|
-
height: imageEl.offsetHeight
|
|
307
|
-
} : {};
|
|
308
|
-
}));
|
|
309
|
-
}
|
|
310
|
-
}, [contentWidth, contentHeight, layout, setImagesSizes]);
|
|
311
|
-
|
|
312
|
-
// header + footer
|
|
313
|
-
var hasHeader = utils.isHeaderFilled(header);
|
|
314
|
-
var hasFooter = utils.isFooterFilled(footer);
|
|
315
|
-
var footerProps = utils.getFooterProps(footer, {
|
|
316
|
-
isView: isView,
|
|
317
|
-
current: current,
|
|
318
|
-
openWebView: openWebView,
|
|
319
|
-
isPreview: isPreview
|
|
320
|
-
});
|
|
321
|
-
var _useDimensionObserver4 = hooks.useDimensionObserver(),
|
|
322
|
-
headerRef = _useDimensionObserver4.ref,
|
|
323
|
-
_useDimensionObserver5 = _useDimensionObserver4.height,
|
|
324
|
-
headerHeight = _useDimensionObserver5 === void 0 ? 0 : _useDimensionObserver5;
|
|
325
|
-
var _useDimensionObserver6 = hooks.useDimensionObserver(),
|
|
326
|
-
footerRef = _useDimensionObserver6.ref,
|
|
327
|
-
_useDimensionObserver7 = _useDimensionObserver6.height,
|
|
328
|
-
footerHeight = _useDimensionObserver7 === void 0 ? 0 : _useDimensionObserver7;
|
|
329
|
-
|
|
330
|
-
// items
|
|
331
|
-
var items = _toConsumableArray(Array(gridSpaces)).map(function (item, itemI) {
|
|
332
|
-
var image = images !== null ? images[itemI] : null;
|
|
333
|
-
var imageSize = imagesSizes[itemI] || {};
|
|
334
|
-
var finalImage = withCaptions ? image : {
|
|
335
|
-
media: image
|
|
336
|
-
};
|
|
337
|
-
var _ref3 = finalImage || {},
|
|
338
|
-
_ref3$caption = _ref3.caption,
|
|
339
|
-
caption = _ref3$caption === void 0 ? null : _ref3$caption;
|
|
340
|
-
var hasImage = utils.isImageFilled(finalImage);
|
|
341
|
-
var hasCaption = utils.isTextFilled(caption);
|
|
342
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
343
|
-
key: "item-".concat(itemI),
|
|
344
|
-
className: styles.gridItem
|
|
345
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
346
|
-
className: styles.imageContainer,
|
|
347
|
-
ref: function ref(el) {
|
|
348
|
-
imagesEl.current[itemI] = el;
|
|
349
|
-
}
|
|
350
|
-
}, /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
351
|
-
placeholder: "image",
|
|
352
|
-
placeholderProps: {
|
|
353
|
-
className: styles.placeholder,
|
|
354
|
-
height: '100%'
|
|
355
|
-
},
|
|
356
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
357
|
-
id: "ebsPd4",
|
|
358
|
-
defaultMessage: [{
|
|
359
|
-
"type": 0,
|
|
360
|
-
"value": "Image"
|
|
361
|
-
}]
|
|
362
|
-
}),
|
|
363
|
-
emptyClassName: styles.emptyImage,
|
|
364
|
-
isEmpty: !hasImage
|
|
365
|
-
}, active || current ? /*#__PURE__*/React.createElement(Visual, Object.assign({
|
|
366
|
-
className: styles.image
|
|
367
|
-
}, finalImage, imageSize, {
|
|
368
|
-
resolution: resolution,
|
|
369
|
-
objectFit: {
|
|
370
|
-
fit: 'cover'
|
|
371
|
-
},
|
|
372
|
-
playing: backgroundPlaying,
|
|
373
|
-
active: active,
|
|
374
|
-
shouldLoad: mediaShouldLoad,
|
|
375
|
-
withoutVideo: isPreview,
|
|
376
|
-
onLoaded: onImageLoaded
|
|
377
|
-
})) : null)), withCaptions ? /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
378
|
-
placeholder: "line",
|
|
379
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
380
|
-
id: "6tIigB",
|
|
381
|
-
defaultMessage: [{
|
|
382
|
-
"type": 0,
|
|
383
|
-
"value": "Caption"
|
|
384
|
-
}]
|
|
385
|
-
}),
|
|
386
|
-
emptyClassName: styles.emptyCaption,
|
|
387
|
-
isEmpty: !hasCaption
|
|
388
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
389
|
-
className: styles.caption
|
|
390
|
-
}, /*#__PURE__*/React.createElement(Text, Object.assign({}, caption, {
|
|
391
|
-
className: styles.captionText,
|
|
392
|
-
lineClamp: captionMaxLines
|
|
393
|
-
})))) : null);
|
|
394
|
-
});
|
|
395
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
396
|
-
className: classNames([styles.container, _defineProperty(_defineProperty({}, className, className !== null), styles.isPlaceholder, isPlaceholder)]),
|
|
397
|
-
"data-screen-ready": ready
|
|
398
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
399
|
-
width: width,
|
|
400
|
-
height: height,
|
|
401
|
-
className: styles.content
|
|
402
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
403
|
-
className: styles.inner,
|
|
404
|
-
style: {
|
|
405
|
-
paddingTop: (hasHeader ? headerHeight : 0) + (!isPreview ? viewerTopHeight : 0),
|
|
406
|
-
paddingBottom: (hasFooter ? footerHeight : 0) + (current && !isPreview ? viewerBottomHeight : 0)
|
|
407
|
-
},
|
|
408
|
-
ref: contentRef
|
|
409
|
-
}, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
|
|
410
|
-
className: styles.header,
|
|
411
|
-
ref: headerRef,
|
|
412
|
-
style: {
|
|
413
|
-
paddingTop: hasHeader ? finalSpacing / 2 : spacing,
|
|
414
|
-
paddingLeft: spacing,
|
|
415
|
-
paddingRight: spacing,
|
|
416
|
-
transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
|
|
417
|
-
}
|
|
418
|
-
}, /*#__PURE__*/React.createElement(Header, header)) : null, /*#__PURE__*/React.createElement(Grid, Object.assign({
|
|
419
|
-
className: styles.grid,
|
|
420
|
-
spacing: finalSpacing,
|
|
421
|
-
items: items
|
|
422
|
-
}, grid)), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
423
|
-
className: styles.footer,
|
|
424
|
-
ref: footerRef,
|
|
425
|
-
style: {
|
|
426
|
-
paddingLeft: Math.max(finalSpacing / 2, viewerBottomSidesWidth),
|
|
427
|
-
paddingRight: Math.max(finalSpacing / 2, viewerBottomSidesWidth),
|
|
428
|
-
// paddingTop: finalSpacing / 2,
|
|
429
|
-
paddingBottom: finalSpacing / 2,
|
|
430
|
-
transform: !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null
|
|
431
|
-
}
|
|
432
|
-
}, /*#__PURE__*/React.createElement(Footer, footerProps)) : null)), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
433
|
-
background: background,
|
|
434
|
-
width: width,
|
|
435
|
-
height: height,
|
|
436
|
-
resolution: resolution,
|
|
437
|
-
playing: backgroundPlaying,
|
|
438
|
-
muted: muted,
|
|
439
|
-
shouldLoad: mediaShouldLoad,
|
|
440
|
-
mediaRef: mediaRef,
|
|
441
|
-
withoutVideo: isPreview,
|
|
442
|
-
className: styles.background
|
|
443
|
-
}) : null);
|
|
444
|
-
};
|
|
445
|
-
GalleryScreen.propTypes = propTypes;
|
|
446
|
-
GalleryScreen.defaultProps = defaultProps;
|
|
447
|
-
var GalleryScreen$1 = GalleryScreen;
|
|
448
|
-
|
|
449
|
-
function GalleryCaptionsScreen(_ref) {
|
|
450
|
-
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
451
|
-
return /*#__PURE__*/React.createElement(GalleryScreen$1, Object.assign({}, props, {
|
|
452
|
-
withCaptions: true
|
|
453
|
-
}));
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
// import * as transforms from './transforms/index';
|
|
457
|
-
|
|
458
|
-
var definition = [{
|
|
459
|
-
id: 'gallery',
|
|
460
|
-
type: 'screen',
|
|
461
|
-
group: {
|
|
462
|
-
label: reactIntl.defineMessage({
|
|
463
|
-
id: "6mX2ya",
|
|
464
|
-
defaultMessage: [{
|
|
465
|
-
"type": 0,
|
|
466
|
-
"value": "Images"
|
|
467
|
-
}]
|
|
468
|
-
}),
|
|
469
|
-
order: 4
|
|
470
|
-
},
|
|
471
|
-
title: reactIntl.defineMessage({
|
|
472
|
-
id: "jaFXki",
|
|
473
|
-
defaultMessage: [{
|
|
474
|
-
"type": 0,
|
|
475
|
-
"value": "Gallery"
|
|
476
|
-
}]
|
|
477
|
-
}),
|
|
478
|
-
component: GalleryScreen$1,
|
|
479
|
-
layouts: [
|
|
480
|
-
// 2
|
|
481
|
-
'two-vertical-equal', 'two-vertical-top', 'two-vertical-bottom',
|
|
482
|
-
// 3
|
|
483
|
-
'three-vertical', 'one-two', 'two-one',
|
|
484
|
-
// 4
|
|
485
|
-
'two-by-two', 'four-vertical', 'one-two-one', 'four-mosaic',
|
|
486
|
-
// 5
|
|
487
|
-
'two-one-two', 'one-two-two', 'two-two-one',
|
|
488
|
-
// 6
|
|
489
|
-
'two-by-three', 'one-one-two-two', 'two-two-one-one'],
|
|
490
|
-
// transforms,
|
|
491
|
-
fields: [{
|
|
492
|
-
name: 'layout',
|
|
493
|
-
type: 'screen-layout',
|
|
494
|
-
defaultValue: 'two-vertical-equal',
|
|
495
|
-
label: reactIntl.defineMessage({
|
|
496
|
-
id: "4iBXj2",
|
|
497
|
-
defaultMessage: [{
|
|
498
|
-
"type": 0,
|
|
499
|
-
"value": "Layout"
|
|
500
|
-
}]
|
|
501
|
-
})
|
|
502
|
-
}, {
|
|
503
|
-
name: 'images',
|
|
504
|
-
type: 'visuals',
|
|
505
|
-
label: reactIntl.defineMessage({
|
|
506
|
-
id: "muYwrB",
|
|
507
|
-
defaultMessage: [{
|
|
508
|
-
"type": 0,
|
|
509
|
-
"value": "Images"
|
|
510
|
-
}]
|
|
511
|
-
})
|
|
512
|
-
}, {
|
|
513
|
-
name: 'background',
|
|
514
|
-
type: 'background',
|
|
515
|
-
label: reactIntl.defineMessage({
|
|
516
|
-
id: "+MPZRu",
|
|
517
|
-
defaultMessage: [{
|
|
518
|
-
"type": 0,
|
|
519
|
-
"value": "Background"
|
|
520
|
-
}]
|
|
521
|
-
})
|
|
522
|
-
}, {
|
|
523
|
-
name: 'header',
|
|
524
|
-
type: 'header',
|
|
525
|
-
label: reactIntl.defineMessage({
|
|
526
|
-
id: "rhuDxI",
|
|
527
|
-
defaultMessage: [{
|
|
528
|
-
"type": 0,
|
|
529
|
-
"value": "Header"
|
|
530
|
-
}]
|
|
531
|
-
}),
|
|
532
|
-
theme: {
|
|
533
|
-
badge: {
|
|
534
|
-
label: {
|
|
535
|
-
textStyle: 'badge'
|
|
536
|
-
},
|
|
537
|
-
boxStyle: 'badge'
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}, {
|
|
541
|
-
name: 'footer',
|
|
542
|
-
type: 'footer',
|
|
543
|
-
label: reactIntl.defineMessage({
|
|
544
|
-
id: "g4nybp",
|
|
545
|
-
defaultMessage: [{
|
|
546
|
-
"type": 0,
|
|
547
|
-
"value": "Footer"
|
|
548
|
-
}]
|
|
549
|
-
}),
|
|
550
|
-
theme: {
|
|
551
|
-
callToAction: {
|
|
552
|
-
label: {
|
|
553
|
-
textStyle: 'cta'
|
|
554
|
-
},
|
|
555
|
-
boxStyle: 'cta'
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}]
|
|
559
|
-
}, {
|
|
560
|
-
id: 'gallery-captions',
|
|
561
|
-
type: 'screen',
|
|
562
|
-
group: {
|
|
563
|
-
label: reactIntl.defineMessage({
|
|
564
|
-
id: "6mX2ya",
|
|
565
|
-
defaultMessage: [{
|
|
566
|
-
"type": 0,
|
|
567
|
-
"value": "Images"
|
|
568
|
-
}]
|
|
569
|
-
}),
|
|
570
|
-
order: 4
|
|
571
|
-
},
|
|
572
|
-
title: reactIntl.defineMessage({
|
|
573
|
-
id: "MmJQ7o",
|
|
574
|
-
defaultMessage: [{
|
|
575
|
-
"type": 0,
|
|
576
|
-
"value": "Gallery with captions"
|
|
577
|
-
}]
|
|
578
|
-
}),
|
|
579
|
-
component: GalleryCaptionsScreen,
|
|
580
|
-
layouts: [
|
|
581
|
-
// 2
|
|
582
|
-
'two-vertical-equal', 'two-vertical-top', 'two-vertical-bottom',
|
|
583
|
-
// 3
|
|
584
|
-
'three-vertical', 'one-two', 'two-one',
|
|
585
|
-
// 4
|
|
586
|
-
'two-by-two', 'four-vertical', 'one-two-one', 'four-mosaic',
|
|
587
|
-
// 5
|
|
588
|
-
'two-one-two', 'one-two-two', 'two-two-one',
|
|
589
|
-
// 6
|
|
590
|
-
'two-by-three', 'one-one-two-two', 'two-two-one-one'],
|
|
591
|
-
// transforms,
|
|
592
|
-
fields: [{
|
|
593
|
-
name: 'layout',
|
|
594
|
-
type: 'screen-layout',
|
|
595
|
-
defaultValue: 'two-vertical-equal',
|
|
596
|
-
label: reactIntl.defineMessage({
|
|
597
|
-
id: "4iBXj2",
|
|
598
|
-
defaultMessage: [{
|
|
599
|
-
"type": 0,
|
|
600
|
-
"value": "Layout"
|
|
601
|
-
}]
|
|
602
|
-
})
|
|
603
|
-
}, {
|
|
604
|
-
name: 'images',
|
|
605
|
-
type: 'visuals-with-caption',
|
|
606
|
-
theme: {
|
|
607
|
-
caption: {
|
|
608
|
-
textStyle: 'text'
|
|
609
|
-
}
|
|
610
|
-
},
|
|
611
|
-
label: reactIntl.defineMessage({
|
|
612
|
-
id: "59f2bg",
|
|
613
|
-
defaultMessage: [{
|
|
614
|
-
"type": 0,
|
|
615
|
-
"value": "Images"
|
|
616
|
-
}]
|
|
617
|
-
})
|
|
618
|
-
}, {
|
|
619
|
-
name: 'background',
|
|
620
|
-
type: 'background',
|
|
621
|
-
label: reactIntl.defineMessage({
|
|
622
|
-
id: "+MPZRu",
|
|
623
|
-
defaultMessage: [{
|
|
624
|
-
"type": 0,
|
|
625
|
-
"value": "Background"
|
|
626
|
-
}]
|
|
627
|
-
})
|
|
628
|
-
}, {
|
|
629
|
-
name: 'header',
|
|
630
|
-
type: 'header',
|
|
631
|
-
label: reactIntl.defineMessage({
|
|
632
|
-
id: "rhuDxI",
|
|
633
|
-
defaultMessage: [{
|
|
634
|
-
"type": 0,
|
|
635
|
-
"value": "Header"
|
|
636
|
-
}]
|
|
637
|
-
}),
|
|
638
|
-
theme: {
|
|
639
|
-
badge: {
|
|
640
|
-
label: {
|
|
641
|
-
textStyle: 'badge'
|
|
642
|
-
},
|
|
643
|
-
boxStyle: 'badge'
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}, {
|
|
647
|
-
name: 'footer',
|
|
648
|
-
type: 'footer',
|
|
649
|
-
label: reactIntl.defineMessage({
|
|
650
|
-
id: "g4nybp",
|
|
651
|
-
defaultMessage: [{
|
|
652
|
-
"type": 0,
|
|
653
|
-
"value": "Footer"
|
|
654
|
-
}]
|
|
655
|
-
}),
|
|
656
|
-
theme: {
|
|
657
|
-
callToAction: {
|
|
658
|
-
label: {
|
|
659
|
-
textStyle: 'cta'
|
|
660
|
-
},
|
|
661
|
-
boxStyle: 'cta'
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
}]
|
|
665
|
-
}];
|
|
666
|
-
|
|
667
|
-
exports.GalleryCaptionsScreen = GalleryCaptionsScreen;
|
|
668
|
-
exports.GalleryScreen = GalleryScreen$1;
|
|
669
|
-
exports.default = definition;
|