@micromag/screen-timeline 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.
- package/es/index.js +79 -6
- package/package.json +3 -3
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,11 @@ var Timeline = function Timeline(_ref) {
|
|
|
168
174
|
elementsTypes.splice(imageIndex, 1);
|
|
169
175
|
}
|
|
170
176
|
var typesCount = elementsTypes.length;
|
|
171
|
-
var _ref4 =
|
|
172
|
-
|
|
177
|
+
var _ref4 = itemTitle || {},
|
|
178
|
+
titleTextStyle = _ref4.textStyle;
|
|
179
|
+
var _ref5 = description || {},
|
|
180
|
+
descriptionTextStyle = _ref5.textStyle;
|
|
181
|
+
console.log('itemDescriptionStyle', itemDescriptionStyle);
|
|
173
182
|
return /*#__PURE__*/React.createElement("div", {
|
|
174
183
|
className: styles.item,
|
|
175
184
|
key: "item-".concat(itemI)
|
|
@@ -192,7 +201,9 @@ var Timeline = function Timeline(_ref) {
|
|
|
192
201
|
}),
|
|
193
202
|
emptyClassName: styles.empty,
|
|
194
203
|
isEmpty: !hasItemTitle
|
|
195
|
-
}, hasItemTitle ? /*#__PURE__*/React.createElement(Heading, itemTitle
|
|
204
|
+
}, hasItemTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({}, itemTitle, {
|
|
205
|
+
textStyle: _objectSpread(_objectSpread({}, itemTitleStyle || null), titleTextStyle)
|
|
206
|
+
})) : null));
|
|
196
207
|
break;
|
|
197
208
|
case 'image':
|
|
198
209
|
hasElement = hasImage;
|
|
@@ -238,7 +249,7 @@ var Timeline = function Timeline(_ref) {
|
|
|
238
249
|
emptyClassName: styles.empty,
|
|
239
250
|
isEmpty: !hasDescription
|
|
240
251
|
}, hasDescription ? /*#__PURE__*/React.createElement(Text, Object.assign({}, description, {
|
|
241
|
-
textStyle: _objectSpread({}, descriptionTextStyle)
|
|
252
|
+
textStyle: _objectSpread(_objectSpread({}, itemDescriptionStyle || null), descriptionTextStyle)
|
|
242
253
|
})) : null));
|
|
243
254
|
break;
|
|
244
255
|
default:
|
|
@@ -289,8 +300,8 @@ var Timeline = function Timeline(_ref) {
|
|
|
289
300
|
footerRef = _useDimensionObserver.ref,
|
|
290
301
|
_useDimensionObserver2 = _useDimensionObserver.height,
|
|
291
302
|
footerHeight = _useDimensionObserver2 === void 0 ? 0 : _useDimensionObserver2;
|
|
292
|
-
var onScrolledBottom = useCallback(function (
|
|
293
|
-
var initial =
|
|
303
|
+
var onScrolledBottom = useCallback(function (_ref10) {
|
|
304
|
+
var initial = _ref10.initial;
|
|
294
305
|
if (initial) {
|
|
295
306
|
trackScreenEvent('scroll', 'Screen');
|
|
296
307
|
}
|
|
@@ -424,6 +435,37 @@ var definition = [{
|
|
|
424
435
|
"value": "Entries"
|
|
425
436
|
}]
|
|
426
437
|
})
|
|
438
|
+
}, {
|
|
439
|
+
type: 'fields',
|
|
440
|
+
label: defineMessage({
|
|
441
|
+
id: "xac4z/",
|
|
442
|
+
defaultMessage: [{
|
|
443
|
+
"type": 0,
|
|
444
|
+
"value": "Entry styles"
|
|
445
|
+
}]
|
|
446
|
+
}),
|
|
447
|
+
isList: true,
|
|
448
|
+
fields: [{
|
|
449
|
+
name: 'itemTitleStyle',
|
|
450
|
+
type: 'text-style-form',
|
|
451
|
+
label: defineMessage({
|
|
452
|
+
id: "+AEVbJ",
|
|
453
|
+
defaultMessage: [{
|
|
454
|
+
"type": 0,
|
|
455
|
+
"value": "Title"
|
|
456
|
+
}]
|
|
457
|
+
})
|
|
458
|
+
}, {
|
|
459
|
+
name: 'itemDescriptionStyle',
|
|
460
|
+
type: 'text-style-form',
|
|
461
|
+
label: defineMessage({
|
|
462
|
+
id: "ZCe0r4",
|
|
463
|
+
defaultMessage: [{
|
|
464
|
+
"type": 0,
|
|
465
|
+
"value": "Description"
|
|
466
|
+
}]
|
|
467
|
+
})
|
|
468
|
+
}]
|
|
427
469
|
}, {
|
|
428
470
|
name: 'bulletShape',
|
|
429
471
|
type: 'radios',
|
|
@@ -616,6 +658,37 @@ var definition = [{
|
|
|
616
658
|
"value": "Entries"
|
|
617
659
|
}]
|
|
618
660
|
})
|
|
661
|
+
}, {
|
|
662
|
+
type: 'fields',
|
|
663
|
+
label: defineMessage({
|
|
664
|
+
id: "xac4z/",
|
|
665
|
+
defaultMessage: [{
|
|
666
|
+
"type": 0,
|
|
667
|
+
"value": "Entry styles"
|
|
668
|
+
}]
|
|
669
|
+
}),
|
|
670
|
+
isList: true,
|
|
671
|
+
fields: [{
|
|
672
|
+
name: 'itemTitleStyle',
|
|
673
|
+
type: 'text-style-form',
|
|
674
|
+
label: defineMessage({
|
|
675
|
+
id: "+AEVbJ",
|
|
676
|
+
defaultMessage: [{
|
|
677
|
+
"type": 0,
|
|
678
|
+
"value": "Title"
|
|
679
|
+
}]
|
|
680
|
+
})
|
|
681
|
+
}, {
|
|
682
|
+
name: 'itemDescriptionStyle',
|
|
683
|
+
type: 'text-style-form',
|
|
684
|
+
label: defineMessage({
|
|
685
|
+
id: "ZCe0r4",
|
|
686
|
+
defaultMessage: [{
|
|
687
|
+
"type": 0,
|
|
688
|
+
"value": "Description"
|
|
689
|
+
}]
|
|
690
|
+
})
|
|
691
|
+
}]
|
|
619
692
|
}, {
|
|
620
693
|
name: 'withoutLine',
|
|
621
694
|
type: 'toggle',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-timeline",
|
|
3
|
-
"version": "0.3.
|
|
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.
|
|
66
|
+
"@micromag/element-footer": "^0.3.595",
|
|
67
67
|
"@micromag/element-header": "^0.3.590",
|
|
68
68
|
"@micromag/element-heading": "^0.3.590",
|
|
69
69
|
"@micromag/element-layout": "^0.3.590",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"access": "public",
|
|
82
82
|
"registry": "https://registry.npmjs.org/"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "69970fa5ea5e5ef1a62454dbfda70a9a97b3aa55"
|
|
85
85
|
}
|