@enact/ui 4.5.0-rc.2 → 4.5.2

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,23 @@
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.2] - 2022-08-17
6
+
7
+ ### Fixed
8
+
9
+ - `ui/Marquee` to stop at the starting point after one cycle when scaled
10
+
11
+ ## [4.5.1] - 2022-08-03
12
+
13
+ ### Fixed
14
+
15
+ - `ui/Marquee.MarqueeDecorator` to have proper spacing for bidirectional text
16
+ - `ui/Marquee.MarqueeDecorator` to restart animation properly with React 18
17
+
18
+ ## [4.5.0] - 2022-07-19
19
+
20
+ No significant changes.
21
+
5
22
  ## [4.5.0-rc.2] - 2022-07-06
6
23
 
7
24
  ### Fixed
@@ -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
 
@@ -207,7 +207,8 @@ var MarqueeBase = (0, _kind["default"])({
207
207
  var _entries$0$rootBounds = entries[0].rootBounds,
208
208
  rootLeft = _entries$0$rootBounds.left,
209
209
  rootRight = _entries$0$rootBounds.right;
210
- var textWidth = rtl ? rootRight - right : left - rootLeft;
210
+ var scale = root.getBoundingClientRect().width / root.offsetWidth || 1;
211
+ var textWidth = (rtl ? rootRight - right : left - rootLeft) / scale;
211
212
  var offset = distance - (textWidth + spacing);
212
213
  node.style.setProperty('--ui-marquee-offset', offset);
213
214
  observer.disconnect();
@@ -286,6 +287,7 @@ var MarqueeBase = (0, _kind["default"])({
286
287
  css = _ref6.css,
287
288
  duplicate = _ref6.duplicate,
288
289
  onMarqueeComplete = _ref6.onMarqueeComplete,
290
+ rtl = _ref6.rtl,
289
291
  rest = _objectWithoutProperties(_ref6, _excluded);
290
292
 
291
293
  delete rest.alignment;
@@ -293,7 +295,6 @@ var MarqueeBase = (0, _kind["default"])({
293
295
  delete rest.distance;
294
296
  delete rest.onMarqueeComplete;
295
297
  delete rest.overflow;
296
- delete rest.rtl;
297
298
  delete rest.spacing;
298
299
  delete rest.speed;
299
300
  delete rest.willAnimate;
@@ -307,7 +308,10 @@ var MarqueeBase = (0, _kind["default"])({
307
308
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
308
309
  className: css.spacing,
309
310
  ref: applyOffset
310
- }), children]
311
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
312
+ dir: rtl ? "rtl" : "ltr",
313
+ children: children
314
+ })]
311
315
  }) : null]
312
316
  })
313
317
  }));
@@ -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-rc.2",
3
+ "version": "4.5.2",
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-rc.2",
28
+ "@enact/core": "^4.5.2",
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
  }