@micromag/screen-gallery 0.3.592 → 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 +19 -1
  2. package/package.json +3 -3
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';
@@ -207,6 +208,7 @@ var propTypes = {
207
208
  'two-by-three', 'one-one-two-two', 'two-two-one-one']),
208
209
  images: PropTypes.oneOfType([PropTypes$1.imageMedias, PropTypes$1.imageElements]),
209
210
  withCaptions: PropTypes.bool,
211
+ imageCaptionStyle: PropTypes$1.textStyle,
210
212
  spacing: PropTypes.number,
211
213
  captionMaxLines: PropTypes.number,
212
214
  background: PropTypes$1.backgroundElement,
@@ -220,6 +222,7 @@ var propTypes = {
220
222
  var defaultProps = {
221
223
  layout: 'four-mosaic',
222
224
  withCaptions: false,
225
+ imageCaptionStyle: null,
223
226
  images: [],
224
227
  spacing: 20,
225
228
  captionMaxLines: 2,
@@ -235,6 +238,7 @@ var GalleryScreen = function GalleryScreen(_ref) {
235
238
  var layout = _ref.layout,
236
239
  images = _ref.images,
237
240
  withCaptions = _ref.withCaptions,
241
+ imageCaptionStyle = _ref.imageCaptionStyle,
238
242
  background = _ref.background,
239
243
  header = _ref.header,
240
244
  footer = _ref.footer,
@@ -338,6 +342,9 @@ var GalleryScreen = function GalleryScreen(_ref) {
338
342
  caption = _ref3$caption === void 0 ? null : _ref3$caption;
339
343
  var hasImage = isImageFilled(finalImage);
340
344
  var hasCaption = isTextFilled(caption);
345
+ var _ref4 = caption || {},
346
+ _ref4$textStyle = _ref4.textStyle,
347
+ textStyle = _ref4$textStyle === void 0 ? null : _ref4$textStyle;
341
348
  return /*#__PURE__*/React.createElement("div", {
342
349
  key: "item-".concat(itemI),
343
350
  className: styles.gridItem
@@ -388,7 +395,8 @@ var GalleryScreen = function GalleryScreen(_ref) {
388
395
  className: styles.caption
389
396
  }, /*#__PURE__*/React.createElement(Text, Object.assign({}, caption, {
390
397
  className: styles.captionText,
391
- lineClamp: captionMaxLines
398
+ lineClamp: captionMaxLines,
399
+ textStyle: _objectSpread(_objectSpread({}, imageCaptionStyle || null), textStyle)
392
400
  })))) : null);
393
401
  });
394
402
  return /*#__PURE__*/React.createElement("div", {
@@ -613,6 +621,16 @@ var definition = [{
613
621
  "value": "Images"
614
622
  }]
615
623
  })
624
+ }, {
625
+ name: 'imageCaptionStyle',
626
+ type: 'text-style-form',
627
+ label: defineMessage({
628
+ id: "Qz7nUz",
629
+ defaultMessage: [{
630
+ "type": 0,
631
+ "value": "Caption style"
632
+ }]
633
+ })
616
634
  }, {
617
635
  name: 'background',
618
636
  type: 'background',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-gallery",
3
- "version": "0.3.592",
3
+ "version": "0.3.596",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -63,7 +63,7 @@
63
63
  "@micromag/core": "^0.3.590",
64
64
  "@micromag/element-background": "^0.3.592",
65
65
  "@micromag/element-container": "^0.3.590",
66
- "@micromag/element-footer": "^0.3.590",
66
+ "@micromag/element-footer": "^0.3.595",
67
67
  "@micromag/element-grid": "^0.3.590",
68
68
  "@micromag/element-header": "^0.3.590",
69
69
  "@micromag/element-layout": "^0.3.590",
@@ -80,5 +80,5 @@
80
80
  "access": "public",
81
81
  "registry": "https://registry.npmjs.org/"
82
82
  },
83
- "gitHead": "f8571e100614efa926df27062058faee906df21e"
83
+ "gitHead": "69970fa5ea5e5ef1a62454dbfda70a9a97b3aa55"
84
84
  }