@micromag/screen-timeline 0.3.595 → 0.3.598

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 +78 -6
  2. package/package.json +2 -2
package/es/index.js CHANGED
@@ -29,6 +29,8 @@ var propTypes = {
29
29
  layout: PropTypes.oneOf(['normal', 'title-description-image', 'title-image-description', 'image-title-description']),
30
30
  title: PropTypes$1.headingElement,
31
31
  items: PropTypes.arrayOf(PropTypes$1.textElement),
32
+ itemTitleStyle: PropTypes$1.textStyle,
33
+ itemDescriptionStyle: PropTypes$1.textStyle,
32
34
  withoutLine: PropTypes.bool,
33
35
  bulletColor: PropTypes$1.color,
34
36
  lineColor: PropTypes$1.color,
@@ -49,6 +51,8 @@ var defaultProps = {
49
51
  layout: 'normal',
50
52
  title: null,
51
53
  items: [null],
54
+ itemTitleStyle: null,
55
+ itemDescriptionStyle: null,
52
56
  withoutLine: false,
53
57
  bulletColor: null,
54
58
  lineColor: null,
@@ -69,6 +73,8 @@ var Timeline = function Timeline(_ref) {
69
73
  var layout = _ref.layout,
70
74
  title = _ref.title,
71
75
  items = _ref.items,
76
+ itemTitleStyle = _ref.itemTitleStyle,
77
+ itemDescriptionStyle = _ref.itemDescriptionStyle,
72
78
  withoutLine = _ref.withoutLine,
73
79
  bulletColor = _ref.bulletColor,
74
80
  lineColor = _ref.lineColor,
@@ -168,8 +174,10 @@ var Timeline = function Timeline(_ref) {
168
174
  elementsTypes.splice(imageIndex, 1);
169
175
  }
170
176
  var typesCount = elementsTypes.length;
171
- var _ref4 = description || {},
172
- descriptionTextStyle = _ref4.textStyle;
177
+ var _ref4 = itemTitle || {},
178
+ titleTextStyle = _ref4.textStyle;
179
+ var _ref5 = description || {},
180
+ descriptionTextStyle = _ref5.textStyle;
173
181
  return /*#__PURE__*/React.createElement("div", {
174
182
  className: styles.item,
175
183
  key: "item-".concat(itemI)
@@ -192,7 +200,9 @@ var Timeline = function Timeline(_ref) {
192
200
  }),
193
201
  emptyClassName: styles.empty,
194
202
  isEmpty: !hasItemTitle
195
- }, hasItemTitle ? /*#__PURE__*/React.createElement(Heading, itemTitle) : null));
203
+ }, hasItemTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({}, itemTitle, {
204
+ textStyle: _objectSpread(_objectSpread({}, itemTitleStyle || null), titleTextStyle)
205
+ })) : null));
196
206
  break;
197
207
  case 'image':
198
208
  hasElement = hasImage;
@@ -238,7 +248,7 @@ var Timeline = function Timeline(_ref) {
238
248
  emptyClassName: styles.empty,
239
249
  isEmpty: !hasDescription
240
250
  }, hasDescription ? /*#__PURE__*/React.createElement(Text, Object.assign({}, description, {
241
- textStyle: _objectSpread({}, descriptionTextStyle)
251
+ textStyle: _objectSpread(_objectSpread({}, itemDescriptionStyle || null), descriptionTextStyle)
242
252
  })) : null));
243
253
  break;
244
254
  default:
@@ -289,8 +299,8 @@ var Timeline = function Timeline(_ref) {
289
299
  footerRef = _useDimensionObserver.ref,
290
300
  _useDimensionObserver2 = _useDimensionObserver.height,
291
301
  footerHeight = _useDimensionObserver2 === void 0 ? 0 : _useDimensionObserver2;
292
- var onScrolledBottom = useCallback(function (_ref9) {
293
- var initial = _ref9.initial;
302
+ var onScrolledBottom = useCallback(function (_ref10) {
303
+ var initial = _ref10.initial;
294
304
  if (initial) {
295
305
  trackScreenEvent('scroll', 'Screen');
296
306
  }
@@ -424,6 +434,37 @@ var definition = [{
424
434
  "value": "Entries"
425
435
  }]
426
436
  })
437
+ }, {
438
+ type: 'fields',
439
+ label: defineMessage({
440
+ id: "xac4z/",
441
+ defaultMessage: [{
442
+ "type": 0,
443
+ "value": "Entry styles"
444
+ }]
445
+ }),
446
+ isList: true,
447
+ fields: [{
448
+ name: 'itemTitleStyle',
449
+ type: 'text-style-form',
450
+ label: defineMessage({
451
+ id: "+AEVbJ",
452
+ defaultMessage: [{
453
+ "type": 0,
454
+ "value": "Title"
455
+ }]
456
+ })
457
+ }, {
458
+ name: 'itemDescriptionStyle',
459
+ type: 'text-style-form',
460
+ label: defineMessage({
461
+ id: "ZCe0r4",
462
+ defaultMessage: [{
463
+ "type": 0,
464
+ "value": "Description"
465
+ }]
466
+ })
467
+ }]
427
468
  }, {
428
469
  name: 'bulletShape',
429
470
  type: 'radios',
@@ -616,6 +657,37 @@ var definition = [{
616
657
  "value": "Entries"
617
658
  }]
618
659
  })
660
+ }, {
661
+ type: 'fields',
662
+ label: defineMessage({
663
+ id: "xac4z/",
664
+ defaultMessage: [{
665
+ "type": 0,
666
+ "value": "Entry styles"
667
+ }]
668
+ }),
669
+ isList: true,
670
+ fields: [{
671
+ name: 'itemTitleStyle',
672
+ type: 'text-style-form',
673
+ label: defineMessage({
674
+ id: "+AEVbJ",
675
+ defaultMessage: [{
676
+ "type": 0,
677
+ "value": "Title"
678
+ }]
679
+ })
680
+ }, {
681
+ name: 'itemDescriptionStyle',
682
+ type: 'text-style-form',
683
+ label: defineMessage({
684
+ id: "ZCe0r4",
685
+ defaultMessage: [{
686
+ "type": 0,
687
+ "value": "Description"
688
+ }]
689
+ })
690
+ }]
619
691
  }, {
620
692
  name: 'withoutLine',
621
693
  type: 'toggle',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-timeline",
3
- "version": "0.3.595",
3
+ "version": "0.3.598",
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": "372bf20cd6b87388c729d8b824b5fe48618ccb2c"
85
85
  }