@micromag/screen-gallery-feed 0.3.595 → 0.3.596

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.
Files changed (2) hide show
  1. package/es/index.js +20 -2
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { FormattedMessage, defineMessage } from 'react-intl';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
+ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
4
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
4
5
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
6
  import classNames from 'classnames';
@@ -27,6 +28,7 @@ var propTypes = {
27
28
  layout: PropTypes.oneOf(['normal', 'reverse']),
28
29
  images: PropTypes.oneOfType([PropTypes$1.imageElementsWithCaption, PropTypes$1.imageMedias]),
29
30
  withCaptions: PropTypes.bool,
31
+ imageCaptionStyle: PropTypes$1.textStyle,
30
32
  spacing: PropTypes.number,
31
33
  background: PropTypes$1.backgroundElement,
32
34
  header: PropTypes$1.header,
@@ -41,6 +43,7 @@ var defaultProps = {
41
43
  layout: 'normal',
42
44
  images: null,
43
45
  withCaptions: false,
46
+ imageCaptionStyle: null,
44
47
  spacing: 20,
45
48
  background: null,
46
49
  header: null,
@@ -55,6 +58,7 @@ var GalleryFeedScreen = function GalleryFeedScreen(_ref) {
55
58
  var layout = _ref.layout,
56
59
  images = _ref.images,
57
60
  withCaptions = _ref.withCaptions,
61
+ imageCaptionStyle = _ref.imageCaptionStyle,
58
62
  spacing = _ref.spacing,
59
63
  background = _ref.background,
60
64
  header = _ref.header,
@@ -115,6 +119,9 @@ var GalleryFeedScreen = function GalleryFeedScreen(_ref) {
115
119
  caption = _ref2$caption === void 0 ? null : _ref2$caption;
116
120
  var hasImage = isImageFilled(finalImage);
117
121
  var hasCaption = isTextFilled(caption);
122
+ var _ref3 = caption || {},
123
+ _ref3$textStyle = _ref3.textStyle,
124
+ textStyle = _ref3$textStyle === void 0 ? null : _ref3$textStyle;
118
125
  var imageElement = /*#__PURE__*/React.createElement(ScreenElement, {
119
126
  key: "image-".concat(index),
120
127
  placeholder: "image",
@@ -167,6 +174,7 @@ var GalleryFeedScreen = function GalleryFeedScreen(_ref) {
167
174
  marginBottom: marginBottom
168
175
  }
169
176
  }, /*#__PURE__*/React.createElement(Text, Object.assign({}, caption, {
177
+ textStyle: _objectSpread(_objectSpread({}, imageCaptionStyle || null), textStyle),
170
178
  className: styles.captionText
171
179
  }))) : null);
172
180
  }
@@ -202,8 +210,8 @@ var GalleryFeedScreen = function GalleryFeedScreen(_ref) {
202
210
  _useState4 = _slicedToArray(_useState3, 2),
203
211
  scrolledBottom = _useState4[0],
204
212
  setScrolledBottom = _useState4[1];
205
- var onScrolledBottom = useCallback(function (_ref3) {
206
- var initial = _ref3.initial;
213
+ var onScrolledBottom = useCallback(function (_ref4) {
214
+ var initial = _ref4.initial;
207
215
  if (initial) {
208
216
  trackScreenEvent('scroll', 'Screen');
209
217
  }
@@ -395,6 +403,16 @@ var definition = [{
395
403
  "value": "Images"
396
404
  }]
397
405
  })
406
+ }, {
407
+ name: 'imageCaptionStyle',
408
+ type: 'text-style-form',
409
+ label: defineMessage({
410
+ id: "Qz7nUz",
411
+ defaultMessage: [{
412
+ "type": 0,
413
+ "value": "Caption style"
414
+ }]
415
+ })
398
416
  }, {
399
417
  name: 'background',
400
418
  type: 'background',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-gallery-feed",
3
- "version": "0.3.595",
3
+ "version": "0.3.596",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -81,5 +81,5 @@
81
81
  "access": "public",
82
82
  "registry": "https://registry.npmjs.org/"
83
83
  },
84
- "gitHead": "0d2da374482260110907b2d6ecd8fd9d192fe9f0"
84
+ "gitHead": "69970fa5ea5e5ef1a62454dbfda70a9a97b3aa55"
85
85
  }