@enact/ui 4.0.5 → 4.1.0
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/CHANGELOG.md +20 -0
- package/Marquee/Marquee.module.css +1 -1
- package/Marquee/MarqueeDecorator.js +12 -15
- package/ViewManager/View.js +2 -0
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
The following is a curated list of changes in the Enact ui module, newest changes on the top.
|
|
4
4
|
|
|
5
|
+
## [4.1.0] - 2021-11-04
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `ui/MarqueeDecorator` to restart animation when text changed while focus retained
|
|
10
|
+
|
|
11
|
+
## [4.0.8] - 2021-10-21
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- `ui/MarqueeDecorator` style to render text properly when starting animation
|
|
16
|
+
|
|
17
|
+
## [4.0.7] - 2021-09-28
|
|
18
|
+
|
|
19
|
+
No significant changes.
|
|
20
|
+
|
|
21
|
+
## [4.0.6] - 2021-09-28
|
|
22
|
+
|
|
23
|
+
No significant changes.
|
|
24
|
+
|
|
5
25
|
## [4.0.5] - 2021-08-02
|
|
6
26
|
|
|
7
27
|
No significant changes.
|
|
@@ -21,8 +21,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
21
21
|
|
|
22
22
|
var _react = require("react");
|
|
23
23
|
|
|
24
|
-
var _shallowEqual = _interopRequireDefault(require("recompose/shallowEqual"));
|
|
25
|
-
|
|
26
24
|
var _warning = _interopRequireDefault(require("warning"));
|
|
27
25
|
|
|
28
26
|
var _resolution = require("../resolution");
|
|
@@ -229,8 +227,8 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
229
227
|
return rtl;
|
|
230
228
|
};
|
|
231
229
|
|
|
232
|
-
return _temp = _class = /*#__PURE__*/function (
|
|
233
|
-
_inherits(_class,
|
|
230
|
+
return _temp = _class = /*#__PURE__*/function (_PureComponent) {
|
|
231
|
+
_inherits(_class, _PureComponent);
|
|
234
232
|
|
|
235
233
|
var _super = _createSuper(_class);
|
|
236
234
|
|
|
@@ -241,7 +239,7 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
241
239
|
|
|
242
240
|
_this = _super.call(this, props);
|
|
243
241
|
_this.promoteJob = new _util.Job(function () {
|
|
244
|
-
if (
|
|
242
|
+
if (_this.contentFits === false) {
|
|
245
243
|
_this.setState(function (state) {
|
|
246
244
|
return state.promoted ? null : {
|
|
247
245
|
promoted: true
|
|
@@ -272,7 +270,7 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
272
270
|
_this.setTimeout(function () {
|
|
273
271
|
_this.calculateMetrics();
|
|
274
272
|
|
|
275
|
-
if (
|
|
273
|
+
if (_this.contentFits === false) {
|
|
276
274
|
_this.setState({
|
|
277
275
|
promoted: true,
|
|
278
276
|
animating: true
|
|
@@ -450,7 +448,7 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
450
448
|
_this.sync = false;
|
|
451
449
|
_this.timerState = TimerState.CLEAR;
|
|
452
450
|
_this.distance = null;
|
|
453
|
-
_this.contentFits =
|
|
451
|
+
_this.contentFits = null;
|
|
454
452
|
_this.resizeRegistry = null;
|
|
455
453
|
return _this;
|
|
456
454
|
}
|
|
@@ -474,11 +472,6 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
474
472
|
|
|
475
473
|
(0, _dispatcher.on)('keydown', this.handlePointerHide, document);
|
|
476
474
|
}
|
|
477
|
-
}, {
|
|
478
|
-
key: "shouldComponentUpdate",
|
|
479
|
-
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
480
|
-
return !(0, _shallowEqual["default"])(this.state, nextState) || !(0, _shallowEqual["default"])(this.props, nextProps);
|
|
481
|
-
}
|
|
482
475
|
}, {
|
|
483
476
|
key: "componentDidUpdate",
|
|
484
477
|
value: function componentDidUpdate(prevProps) {
|
|
@@ -494,11 +487,15 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
494
487
|
rtl = _this$props.rtl;
|
|
495
488
|
var forceRestartMarquee = false;
|
|
496
489
|
|
|
497
|
-
if (prevProps.locale !== locale || prevProps.rtl !== rtl || prevProps.marqueeSpacing !== marqueeSpacing || !(0,
|
|
490
|
+
if (prevProps.locale !== locale || prevProps.rtl !== rtl || prevProps.marqueeSpacing !== marqueeSpacing || !(0, _util.shallowEqual)(prevProps.children, children) || invalidateProps && didPropChange(invalidateProps, prevProps, this.props)) {
|
|
498
491
|
// restart marqueeOn="render" marquees or synced marquees that were animating
|
|
499
492
|
forceRestartMarquee = marqueeOn === 'render' || this.sync && (this.state.animating || this.timerState > TimerState.CLEAR);
|
|
500
493
|
this.invalidateMetrics();
|
|
501
494
|
this.cancelAnimation();
|
|
495
|
+
|
|
496
|
+
if (forceRestartMarquee && marqueeOn === 'focus') {
|
|
497
|
+
this.resetAnimation();
|
|
498
|
+
}
|
|
502
499
|
} else if (prevProps.marqueeOn !== marqueeOn || prevProps.marqueeDisabled !== marqueeDisabled || prevProps.marqueeSpeed !== marqueeSpeed || prevProps.forceDirection !== forceDirection) {
|
|
503
500
|
this.cancelAnimation();
|
|
504
501
|
} else if (disabled && this.isHovered && marqueeOn === 'focus' && this.sync) {
|
|
@@ -614,7 +611,7 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
614
611
|
|
|
615
612
|
this.distance = null; // Assume the marquee does not fit until calculations show otherwise
|
|
616
613
|
|
|
617
|
-
this.contentFits =
|
|
614
|
+
this.contentFits = null;
|
|
618
615
|
this.setState(function (state) {
|
|
619
616
|
if (state.overflow === 'ellipsis' && state.promoted === false) return null;
|
|
620
617
|
return {
|
|
@@ -885,7 +882,7 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
|
|
|
885
882
|
}]);
|
|
886
883
|
|
|
887
884
|
return _class;
|
|
888
|
-
}(_react.
|
|
885
|
+
}(_react.PureComponent), _class.displayName = 'ui:MarqueeDecorator', _class.propTypes =
|
|
889
886
|
/** @lends ui/Marquee.MarqueeDecorator.prototype */
|
|
890
887
|
{
|
|
891
888
|
/**
|
package/ViewManager/View.js
CHANGED
|
@@ -214,6 +214,8 @@ var View = /*#__PURE__*/function (_Component) {
|
|
|
214
214
|
// FIXME: `startRafAfter` is a temporary solution using rAF. We need a better way to handle
|
|
215
215
|
// transition cycle and component life cycle to be in sync. See ENYO-4835.
|
|
216
216
|
this.enteringJob.startRafAfter(enteringDelay);
|
|
217
|
+
} else {
|
|
218
|
+
this.enteringJob.start();
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
221
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/ui",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "A collection of simplified unstyled cross-platform UI components for Enact",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@enact/core": "^4.0
|
|
28
|
+
"@enact/core": "^4.1.0",
|
|
29
29
|
"classnames": "^2.2.5",
|
|
30
30
|
"direction": "^1.0.1",
|
|
31
31
|
"invariant": "^2.2.2",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"react": "^17.0.1",
|
|
35
35
|
"react-dom": "^17.0.1",
|
|
36
36
|
"react-is": "^17.0.1",
|
|
37
|
-
"recompose": "^0.30.0",
|
|
38
37
|
"warning": "^3.0.0"
|
|
39
38
|
}
|
|
40
39
|
}
|