@enact/ui 4.5.0-rc.1 → 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,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.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
+
12
+ ## [4.5.0] - 2022-07-19
13
+
14
+ No significant changes.
15
+
16
+ ## [4.5.0-rc.2] - 2022-07-06
17
+
18
+ ### Fixed
19
+
20
+ - `ui/Scroller` and `ui/VirtualList` to rerender property when `clientSize` is changed
21
+
5
22
  ## [4.5.0-rc.1] - 2022-06-23
6
23
 
7
24
  No significant changes.
@@ -253,7 +253,8 @@ FloatingLayerBase.propTypes =
253
253
  floatLayerId: _propTypes["default"].string,
254
254
 
255
255
  /**
256
- * Prevents FloatingLayer from hiding when the user presses `ESC` key.
256
+ * Prevents FloatingLayer from hiding when the user presses cancel/back (e.g. `ESC`) key or
257
+ * clicks outside the floating layer.
257
258
  *
258
259
  * @type {Boolean}
259
260
  * @default false
@@ -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-rc.1",
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-rc.1",
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
  }
@@ -20,8 +20,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
20
20
 
21
21
  var _react = require("react");
22
22
 
23
- var _reactDom = _interopRequireDefault(require("react-dom"));
24
-
25
23
  var _resolution = _interopRequireDefault(require("../resolution"));
26
24
 
27
25
  var _ScrollbarTrack = _interopRequireDefault(require("./ScrollbarTrack"));
@@ -47,20 +45,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
47
45
  var scrollbarTrackHidingDelay = 900; // 900ms + 100ms(fade out duration) = 1000ms.
48
46
 
49
47
  var addClass = function addClass(element, className) {
50
- var node = _reactDom["default"].findDOMNode(element); // eslint-disable-line react/no-find-dom-node
51
-
52
-
53
- if (node) {
54
- node.classList.add(className);
48
+ if (element) {
49
+ element.classList.add(className);
55
50
  }
56
51
  };
57
52
 
58
53
  var removeClass = function removeClass(element, className) {
59
- var node = _reactDom["default"].findDOMNode(element); // eslint-disable-line react/no-find-dom-node
60
-
61
-
62
- if (node) {
63
- node.classList.remove(className);
54
+ if (element) {
55
+ element.classList.remove(className);
64
56
  }
65
57
  };
66
58
  /*
@@ -74,8 +66,7 @@ var removeClass = function removeClass(element, className) {
74
66
 
75
67
 
76
68
  var setCSSVariable = function setCSSVariable(element, variable, value) {
77
- _reactDom["default"].findDOMNode(element).style.setProperty(variable, value); // eslint-disable-line react/no-find-dom-node
78
-
69
+ element.style.setProperty(variable, value);
79
70
  };
80
71
  /**
81
72
  * A custom hook that passes scrollbar behavior information as its render prop.
@@ -485,7 +485,7 @@ var useScrollBase = function useScrollBase(props) {
485
485
  };
486
486
  }, [direction, isHorizontalScrollbarVisible, isVerticalScrollbarVisible, rtl, scrollMode, spotlightContainerDisabled]); // eslint-disable-line react-hooks/exhaustive-deps
487
487
 
488
- (0, _react.useEffect)(function () {
488
+ (0, _react.useLayoutEffect)(function () {
489
489
  var hasDataSizeChanged = scrollContentHandle.current.hasDataSizeChanged,
490
490
  _mutableRef$current2 = mutableRef.current,
491
491
  prevState = _mutableRef$current2.prevState,