@enact/ui 4.5.0 → 4.5.1

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 CHANGED
@@ -2,6 +2,13 @@
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.5.1] - 2022-08-03
6
+
7
+ ### Fixed
8
+
9
+ - `ui/Marquee.MarqueeDecorator` to have proper spacing for bidirectional text
10
+ - `ui/Marquee.MarqueeDecorator` to restart animation properly with React 18
11
+
5
12
  ## [4.5.0] - 2022-07-19
6
13
 
7
14
  No significant changes.
@@ -19,7 +19,7 @@ var _MarqueeModule = _interopRequireDefault(require("./Marquee.module.css"));
19
19
 
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
- var _excluded = ["applyOffset", "children", "clientClassName", "clientRef", "clientStyle", "css", "duplicate", "onMarqueeComplete"];
22
+ var _excluded = ["applyOffset", "children", "clientClassName", "clientRef", "clientStyle", "css", "duplicate", "onMarqueeComplete", "rtl"];
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
25
 
@@ -286,6 +286,7 @@ var MarqueeBase = (0, _kind["default"])({
286
286
  css = _ref6.css,
287
287
  duplicate = _ref6.duplicate,
288
288
  onMarqueeComplete = _ref6.onMarqueeComplete,
289
+ rtl = _ref6.rtl,
289
290
  rest = _objectWithoutProperties(_ref6, _excluded);
290
291
 
291
292
  delete rest.alignment;
@@ -293,7 +294,6 @@ var MarqueeBase = (0, _kind["default"])({
293
294
  delete rest.distance;
294
295
  delete rest.onMarqueeComplete;
295
296
  delete rest.overflow;
296
- delete rest.rtl;
297
297
  delete rest.spacing;
298
298
  delete rest.speed;
299
299
  delete rest.willAnimate;
@@ -307,7 +307,10 @@ var MarqueeBase = (0, _kind["default"])({
307
307
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
308
308
  className: css.spacing,
309
309
  ref: applyOffset
310
- }), children]
310
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
311
+ dir: rtl ? "rtl" : "ltr",
312
+ children: children
313
+ })]
311
314
  }) : null]
312
315
  })
313
316
  }));
@@ -23,6 +23,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
23
23
 
24
24
  var _react = require("react");
25
25
 
26
+ var _reactDom = require("react-dom");
27
+
26
28
  var _warning = _interopRequireDefault(require("warning"));
27
29
 
28
30
  var _resolution = require("../resolution");
@@ -356,11 +358,12 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
356
358
  };
357
359
 
358
360
  _this.restartAnimation = function (delay) {
359
- _this.setState({
360
- animating: false
361
+ (0, _reactDom.flushSync)(function () {
362
+ _this.setState({
363
+ animating: false
364
+ });
361
365
  }); // synchronized Marquees defer to the controller to restart them
362
366
 
363
-
364
367
  if (_this.sync) {
365
368
  _this.context.complete(_assertThisInitialized(_this));
366
369
  } else if (!_this.state.animating) {
@@ -324,14 +324,15 @@ describe('MarqueeBase', function () {
324
324
  });
325
325
  test('should duplicate from content when promoted and a non-zero distance', function () {
326
326
  (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
327
+ "data-testid": "marquee",
327
328
  distance: 100,
328
329
  willAnimate: true,
329
330
  children: "Text"
330
331
  }));
331
332
 
332
- var marquee = _react.screen.getByText('TextText');
333
+ var marquee = _react.screen.getByTestId('marquee');
333
334
 
334
- expect(marquee).toBeInTheDocument();
335
+ expect(marquee).toHaveTextContent('TextText');
335
336
  });
336
337
  test('should not duplicate from content when promoted and a zero distance', function () {
337
338
  (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/ui",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "description": "A collection of simplified unstyled cross-platform UI components for Enact",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,15 +25,15 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@enact/core": "^4.5.0",
28
+ "@enact/core": "^4.5.1",
29
29
  "classnames": "^2.3.1",
30
30
  "direction": "^1.0.4",
31
31
  "invariant": "^2.2.4",
32
32
  "prop-types": "^15.8.1",
33
33
  "ramda": "^0.28.0",
34
- "react": "^18.0.0",
35
- "react-dom": "^18.0.0",
36
- "react-is": "^18.0.0",
34
+ "react": "^18.2.0",
35
+ "react-dom": "^18.2.0",
36
+ "react-is": "^18.2.0",
37
37
  "warning": "^4.0.3"
38
38
  }
39
39
  }