@micromag/screen-slideshow 0.3.362 → 0.3.369
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/assets/css/styles.css +1 -1
- package/es/index.js +34 -24
- package/lib/index.js +34 -24
- package/package.json +11 -11
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.micromag-screen-slideshow-container .micromag-screen-slideshow-background,.micromag-screen-slideshow-container .micromag-screen-slideshow-inner{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-screen-slideshow-container{height:100%;overflow:hidden;position:relative;width:100%}.micromag-screen-slideshow-disabled.micromag-screen-slideshow-container{overflow:hidden;pointer-events:none}.micromag-screen-slideshow-hidden.micromag-screen-slideshow-container{display:none;visibility:hidden}.micromag-screen-slideshow-placeholder.micromag-screen-slideshow-container .micromag-screen-slideshow-content{padding:6px;position:relative}.micromag-screen-slideshow-container .micromag-screen-slideshow-background{z-index:0}.micromag-screen-slideshow-container .micromag-screen-slideshow-content{z-index:1}.micromag-screen-slideshow-container .micromag-screen-slideshow-header{left:0;position:absolute;top:0;width:100%;z-index:2}.micromag-screen-slideshow-container .micromag-screen-slideshow-footer{bottom:0;left:0;position:absolute;width:100%}
|
|
1
|
+
.micromag-screen-slideshow-container .micromag-screen-slideshow-background,.micromag-screen-slideshow-container .micromag-screen-slideshow-inner,.micromag-screen-slideshow-container .micromag-screen-slideshow-placeholder{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-screen-slideshow-container{height:100%;overflow:hidden;position:relative;width:100%}.micromag-screen-slideshow-disabled.micromag-screen-slideshow-container{overflow:hidden;pointer-events:none}.micromag-screen-slideshow-hidden.micromag-screen-slideshow-container{display:none;visibility:hidden}.micromag-screen-slideshow-placeholder.micromag-screen-slideshow-container .micromag-screen-slideshow-content{padding:6px;position:relative}.micromag-screen-slideshow-container .micromag-screen-slideshow-background{z-index:0}.micromag-screen-slideshow-container .micromag-screen-slideshow-content{z-index:1}.micromag-screen-slideshow-container .micromag-screen-slideshow-caption{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.micromag-screen-slideshow-container .micromag-screen-slideshow-header{left:0;position:absolute;top:0;width:100%;z-index:2}.micromag-screen-slideshow-container .micromag-screen-slideshow-footer{bottom:0;left:0;position:absolute;width:100%}
|
package/es/index.js
CHANGED
|
@@ -16,16 +16,14 @@ import Header from '@micromag/element-header';
|
|
|
16
16
|
import Text from '@micromag/element-text';
|
|
17
17
|
import Visual from '@micromag/element-visual';
|
|
18
18
|
|
|
19
|
-
var styles = {"container":"micromag-screen-slideshow-container","inner":"micromag-screen-slideshow-inner","background":"micromag-screen-slideshow-background","disabled":"micromag-screen-slideshow-disabled","hidden":"micromag-screen-slideshow-hidden","
|
|
20
|
-
|
|
21
|
-
// TODO: make this happen
|
|
19
|
+
var styles = {"container":"micromag-screen-slideshow-container","placeholder":"micromag-screen-slideshow-placeholder","inner":"micromag-screen-slideshow-inner","background":"micromag-screen-slideshow-background","disabled":"micromag-screen-slideshow-disabled","hidden":"micromag-screen-slideshow-hidden","content":"micromag-screen-slideshow-content","caption":"micromag-screen-slideshow-caption","header":"micromag-screen-slideshow-header","footer":"micromag-screen-slideshow-footer"};
|
|
22
20
|
|
|
23
21
|
var propTypes = {
|
|
24
|
-
// layout: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
25
22
|
slides: PropTypes.oneOfType([PropTypes$1.imageMedias, PropTypes$1.imageElements]),
|
|
26
23
|
withCaptions: PropTypes.bool,
|
|
27
24
|
spacing: PropTypes.number,
|
|
28
25
|
captionMaxLines: PropTypes.number,
|
|
26
|
+
transitionDelay: PropTypes.number,
|
|
29
27
|
background: PropTypes$1.backgroundElement,
|
|
30
28
|
header: PropTypes$1.header,
|
|
31
29
|
footer: PropTypes$1.footer,
|
|
@@ -35,11 +33,12 @@ var propTypes = {
|
|
|
35
33
|
className: PropTypes.string
|
|
36
34
|
};
|
|
37
35
|
var defaultProps = {
|
|
38
|
-
// layout: 'middle',
|
|
39
36
|
withCaptions: false,
|
|
40
37
|
slides: [],
|
|
41
38
|
spacing: 20,
|
|
42
39
|
captionMaxLines: 2,
|
|
40
|
+
transitionDelay: 1,
|
|
41
|
+
// in seconds
|
|
43
42
|
background: null,
|
|
44
43
|
header: null,
|
|
45
44
|
footer: null,
|
|
@@ -58,6 +57,7 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
58
57
|
current = _ref.current,
|
|
59
58
|
active = _ref.active,
|
|
60
59
|
spacing = _ref.spacing,
|
|
60
|
+
transitionDelay = _ref.transitionDelay,
|
|
61
61
|
captionMaxLines = _ref.captionMaxLines,
|
|
62
62
|
transitions = _ref.transitions,
|
|
63
63
|
className = _ref.className;
|
|
@@ -120,11 +120,9 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
120
120
|
width: width,
|
|
121
121
|
height: height
|
|
122
122
|
};
|
|
123
|
-
// console.log(imageSize);
|
|
124
|
-
// const { caption = null } = finalImage || {};
|
|
125
|
-
|
|
126
123
|
var hasImage = media !== null;
|
|
127
124
|
var hasCaption = isTextFilled(caption);
|
|
125
|
+
var finalTransitionDelay = itemI > 0 ? itemI * (transitionDelay * 1000) : 0;
|
|
128
126
|
return /*#__PURE__*/React.createElement("div", {
|
|
129
127
|
key: "item-".concat(itemI),
|
|
130
128
|
className: styles.gridItem
|
|
@@ -135,7 +133,7 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
135
133
|
}
|
|
136
134
|
}, /*#__PURE__*/React.createElement(Transitions, {
|
|
137
135
|
transitions: transitions,
|
|
138
|
-
delay:
|
|
136
|
+
delay: finalTransitionDelay,
|
|
139
137
|
playing: transitionPlaying,
|
|
140
138
|
disabled: transitionDisabled,
|
|
141
139
|
fullscreen: true
|
|
@@ -168,7 +166,7 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
168
166
|
onLoaded: onImageLoaded
|
|
169
167
|
})) : null))), withCaptions ? /*#__PURE__*/React.createElement(Transitions, {
|
|
170
168
|
transitions: transitions,
|
|
171
|
-
delay:
|
|
169
|
+
delay: finalTransitionDelay,
|
|
172
170
|
playing: transitionPlaying,
|
|
173
171
|
disabled: transitionDisabled
|
|
174
172
|
}, /*#__PURE__*/React.createElement(ScreenElement, {
|
|
@@ -182,12 +180,12 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
182
180
|
}),
|
|
183
181
|
emptyClassName: styles.emptyCaption,
|
|
184
182
|
isEmpty: !hasCaption
|
|
185
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
183
|
+
}, hasCaption ? /*#__PURE__*/React.createElement("div", {
|
|
186
184
|
className: styles.caption
|
|
187
185
|
}, /*#__PURE__*/React.createElement(Text, Object.assign({}, caption, {
|
|
188
186
|
className: styles.captionText,
|
|
189
187
|
lineClamp: captionMaxLines
|
|
190
|
-
}))))) : null);
|
|
188
|
+
}))) : null)) : null);
|
|
191
189
|
});
|
|
192
190
|
return /*#__PURE__*/React.createElement("div", {
|
|
193
191
|
className: classNames([styles.container, (_ref3 = {}, _defineProperty(_ref3, className, className !== null), _defineProperty(_ref3, styles.isPlaceholder, isPlaceholder), _ref3)]),
|
|
@@ -202,7 +200,20 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
202
200
|
paddingTop: !isPreview ? viewerTopHeight : null,
|
|
203
201
|
paddingBottom: (hasFooter ? footerHeight - finalSpacing : 0) + (current && !isPreview ? viewerBottomHeight : 0)
|
|
204
202
|
}
|
|
205
|
-
},
|
|
203
|
+
}, isPlaceholder ? /*#__PURE__*/React.createElement(ScreenElement, {
|
|
204
|
+
placeholder: "image",
|
|
205
|
+
placeholderProps: {
|
|
206
|
+
className: styles.placeholder,
|
|
207
|
+
height: '100%'
|
|
208
|
+
},
|
|
209
|
+
emptyLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
210
|
+
id: "ebsPd4",
|
|
211
|
+
defaultMessage: [{
|
|
212
|
+
"type": 0,
|
|
213
|
+
"value": "Image"
|
|
214
|
+
}]
|
|
215
|
+
})
|
|
216
|
+
}) : null, !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
|
|
206
217
|
className: styles.header,
|
|
207
218
|
ref: headerRef,
|
|
208
219
|
style: {
|
|
@@ -253,27 +264,26 @@ var definition = [{
|
|
|
253
264
|
}]
|
|
254
265
|
}),
|
|
255
266
|
component: SlideshowScreen$1,
|
|
256
|
-
layouts: ['top', 'middle', 'bottom'],
|
|
257
|
-
// transforms,
|
|
258
267
|
fields: [{
|
|
259
|
-
name: '
|
|
260
|
-
type: '
|
|
261
|
-
defaultValue: 'two-vertical-equal',
|
|
268
|
+
name: 'slides',
|
|
269
|
+
type: 'visuals-with-caption',
|
|
262
270
|
label: defineMessage({
|
|
263
|
-
id: "
|
|
271
|
+
id: "muYwrB",
|
|
264
272
|
defaultMessage: [{
|
|
265
273
|
"type": 0,
|
|
266
|
-
"value": "
|
|
274
|
+
"value": "Images"
|
|
267
275
|
}]
|
|
268
276
|
})
|
|
269
277
|
}, {
|
|
270
|
-
name: '
|
|
271
|
-
type: '
|
|
278
|
+
name: 'transitionDelay',
|
|
279
|
+
type: 'number',
|
|
280
|
+
min: 0,
|
|
281
|
+
"float": true,
|
|
272
282
|
label: defineMessage({
|
|
273
|
-
id: "
|
|
283
|
+
id: "/6zaOP",
|
|
274
284
|
defaultMessage: [{
|
|
275
285
|
"type": 0,
|
|
276
|
-
"value": "
|
|
286
|
+
"value": "Transition Delay (in seconds)"
|
|
277
287
|
}]
|
|
278
288
|
})
|
|
279
289
|
}, {
|
package/lib/index.js
CHANGED
|
@@ -34,16 +34,14 @@ var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header);
|
|
|
34
34
|
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
35
35
|
var Visual__default = /*#__PURE__*/_interopDefaultLegacy(Visual);
|
|
36
36
|
|
|
37
|
-
var styles = {"container":"micromag-screen-slideshow-container","inner":"micromag-screen-slideshow-inner","background":"micromag-screen-slideshow-background","disabled":"micromag-screen-slideshow-disabled","hidden":"micromag-screen-slideshow-hidden","
|
|
38
|
-
|
|
39
|
-
// TODO: make this happen
|
|
37
|
+
var styles = {"container":"micromag-screen-slideshow-container","placeholder":"micromag-screen-slideshow-placeholder","inner":"micromag-screen-slideshow-inner","background":"micromag-screen-slideshow-background","disabled":"micromag-screen-slideshow-disabled","hidden":"micromag-screen-slideshow-hidden","content":"micromag-screen-slideshow-content","caption":"micromag-screen-slideshow-caption","header":"micromag-screen-slideshow-header","footer":"micromag-screen-slideshow-footer"};
|
|
40
38
|
|
|
41
39
|
var propTypes = {
|
|
42
|
-
// layout: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
43
40
|
slides: PropTypes__default["default"].oneOfType([core.PropTypes.imageMedias, core.PropTypes.imageElements]),
|
|
44
41
|
withCaptions: PropTypes__default["default"].bool,
|
|
45
42
|
spacing: PropTypes__default["default"].number,
|
|
46
43
|
captionMaxLines: PropTypes__default["default"].number,
|
|
44
|
+
transitionDelay: PropTypes__default["default"].number,
|
|
47
45
|
background: core.PropTypes.backgroundElement,
|
|
48
46
|
header: core.PropTypes.header,
|
|
49
47
|
footer: core.PropTypes.footer,
|
|
@@ -53,11 +51,12 @@ var propTypes = {
|
|
|
53
51
|
className: PropTypes__default["default"].string
|
|
54
52
|
};
|
|
55
53
|
var defaultProps = {
|
|
56
|
-
// layout: 'middle',
|
|
57
54
|
withCaptions: false,
|
|
58
55
|
slides: [],
|
|
59
56
|
spacing: 20,
|
|
60
57
|
captionMaxLines: 2,
|
|
58
|
+
transitionDelay: 1,
|
|
59
|
+
// in seconds
|
|
61
60
|
background: null,
|
|
62
61
|
header: null,
|
|
63
62
|
footer: null,
|
|
@@ -76,6 +75,7 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
76
75
|
current = _ref.current,
|
|
77
76
|
active = _ref.active,
|
|
78
77
|
spacing = _ref.spacing,
|
|
78
|
+
transitionDelay = _ref.transitionDelay,
|
|
79
79
|
captionMaxLines = _ref.captionMaxLines,
|
|
80
80
|
transitions = _ref.transitions,
|
|
81
81
|
className = _ref.className;
|
|
@@ -138,11 +138,9 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
138
138
|
width: width,
|
|
139
139
|
height: height
|
|
140
140
|
};
|
|
141
|
-
// console.log(imageSize);
|
|
142
|
-
// const { caption = null } = finalImage || {};
|
|
143
|
-
|
|
144
141
|
var hasImage = media !== null;
|
|
145
142
|
var hasCaption = utils.isTextFilled(caption);
|
|
143
|
+
var finalTransitionDelay = itemI > 0 ? itemI * (transitionDelay * 1000) : 0;
|
|
146
144
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
147
145
|
key: "item-".concat(itemI),
|
|
148
146
|
className: styles.gridItem
|
|
@@ -153,7 +151,7 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
153
151
|
}
|
|
154
152
|
}, /*#__PURE__*/React__default["default"].createElement(components.Transitions, {
|
|
155
153
|
transitions: transitions,
|
|
156
|
-
delay:
|
|
154
|
+
delay: finalTransitionDelay,
|
|
157
155
|
playing: transitionPlaying,
|
|
158
156
|
disabled: transitionDisabled,
|
|
159
157
|
fullscreen: true
|
|
@@ -186,7 +184,7 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
186
184
|
onLoaded: onImageLoaded
|
|
187
185
|
})) : null))), withCaptions ? /*#__PURE__*/React__default["default"].createElement(components.Transitions, {
|
|
188
186
|
transitions: transitions,
|
|
189
|
-
delay:
|
|
187
|
+
delay: finalTransitionDelay,
|
|
190
188
|
playing: transitionPlaying,
|
|
191
189
|
disabled: transitionDisabled
|
|
192
190
|
}, /*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
|
|
@@ -200,12 +198,12 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
200
198
|
}),
|
|
201
199
|
emptyClassName: styles.emptyCaption,
|
|
202
200
|
isEmpty: !hasCaption
|
|
203
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
201
|
+
}, hasCaption ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
204
202
|
className: styles.caption
|
|
205
203
|
}, /*#__PURE__*/React__default["default"].createElement(Text__default["default"], Object.assign({}, caption, {
|
|
206
204
|
className: styles.captionText,
|
|
207
205
|
lineClamp: captionMaxLines
|
|
208
|
-
}))))) : null);
|
|
206
|
+
}))) : null)) : null);
|
|
209
207
|
});
|
|
210
208
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
211
209
|
className: classNames__default["default"]([styles.container, (_ref3 = {}, _defineProperty__default["default"](_ref3, className, className !== null), _defineProperty__default["default"](_ref3, styles.isPlaceholder, isPlaceholder), _ref3)]),
|
|
@@ -220,7 +218,20 @@ var SlideshowScreen = function SlideshowScreen(_ref) {
|
|
|
220
218
|
paddingTop: !isPreview ? viewerTopHeight : null,
|
|
221
219
|
paddingBottom: (hasFooter ? footerHeight - finalSpacing : 0) + (current && !isPreview ? viewerBottomHeight : 0)
|
|
222
220
|
}
|
|
223
|
-
},
|
|
221
|
+
}, isPlaceholder ? /*#__PURE__*/React__default["default"].createElement(components.ScreenElement, {
|
|
222
|
+
placeholder: "image",
|
|
223
|
+
placeholderProps: {
|
|
224
|
+
className: styles.placeholder,
|
|
225
|
+
height: '100%'
|
|
226
|
+
},
|
|
227
|
+
emptyLabel: /*#__PURE__*/React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
228
|
+
id: "ebsPd4",
|
|
229
|
+
defaultMessage: [{
|
|
230
|
+
"type": 0,
|
|
231
|
+
"value": "Image"
|
|
232
|
+
}]
|
|
233
|
+
})
|
|
234
|
+
}) : null, !isPlaceholder && hasHeader ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
224
235
|
className: styles.header,
|
|
225
236
|
ref: headerRef,
|
|
226
237
|
style: {
|
|
@@ -271,27 +282,26 @@ var definition = [{
|
|
|
271
282
|
}]
|
|
272
283
|
}),
|
|
273
284
|
component: SlideshowScreen$1,
|
|
274
|
-
layouts: ['top', 'middle', 'bottom'],
|
|
275
|
-
// transforms,
|
|
276
285
|
fields: [{
|
|
277
|
-
name: '
|
|
278
|
-
type: '
|
|
279
|
-
defaultValue: 'two-vertical-equal',
|
|
286
|
+
name: 'slides',
|
|
287
|
+
type: 'visuals-with-caption',
|
|
280
288
|
label: reactIntl.defineMessage({
|
|
281
|
-
id: "
|
|
289
|
+
id: "muYwrB",
|
|
282
290
|
defaultMessage: [{
|
|
283
291
|
"type": 0,
|
|
284
|
-
"value": "
|
|
292
|
+
"value": "Images"
|
|
285
293
|
}]
|
|
286
294
|
})
|
|
287
295
|
}, {
|
|
288
|
-
name: '
|
|
289
|
-
type: '
|
|
296
|
+
name: 'transitionDelay',
|
|
297
|
+
type: 'number',
|
|
298
|
+
min: 0,
|
|
299
|
+
"float": true,
|
|
290
300
|
label: reactIntl.defineMessage({
|
|
291
|
-
id: "
|
|
301
|
+
id: "/6zaOP",
|
|
292
302
|
defaultMessage: [{
|
|
293
303
|
"type": 0,
|
|
294
|
-
"value": "
|
|
304
|
+
"value": "Transition Delay (in seconds)"
|
|
295
305
|
}]
|
|
296
306
|
})
|
|
297
307
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-slideshow",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.369",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
53
|
-
"@micromag/element-background": "^0.3.
|
|
54
|
-
"@micromag/element-container": "^0.3.
|
|
55
|
-
"@micromag/element-footer": "^0.3.
|
|
56
|
-
"@micromag/element-header": "^0.3.
|
|
57
|
-
"@micromag/element-layout": "^0.3.
|
|
58
|
-
"@micromag/element-text": "^0.3.
|
|
59
|
-
"@micromag/element-visual": "^0.3.
|
|
60
|
-
"@micromag/transforms": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.369",
|
|
53
|
+
"@micromag/element-background": "^0.3.369",
|
|
54
|
+
"@micromag/element-container": "^0.3.369",
|
|
55
|
+
"@micromag/element-footer": "^0.3.369",
|
|
56
|
+
"@micromag/element-header": "^0.3.369",
|
|
57
|
+
"@micromag/element-layout": "^0.3.369",
|
|
58
|
+
"@micromag/element-text": "^0.3.369",
|
|
59
|
+
"@micromag/element-visual": "^0.3.369",
|
|
60
|
+
"@micromag/transforms": "^0.3.369",
|
|
61
61
|
"classnames": "^2.2.6",
|
|
62
62
|
"lodash": "^4.17.21",
|
|
63
63
|
"prop-types": "^15.7.2",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "55706624c2879ead4acff84015ad51df2b7d293b"
|
|
71
71
|
}
|