@enact/ui 4.9.0-beta.1 → 4.9.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,19 @@
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.9.1] - 2024-09-09
6
+
7
+ ### Fixed
8
+
9
+ - `ui/Scroller` and `ui/VirtualList` to have default prop when `undefined` prop is passed
10
+
11
+ ## [4.9.0] - 2024-07-17
12
+
13
+ ### Fixed
14
+
15
+ - `ui/Marquee.MarqueeDecorator` to start animation properly when synchronized by `ui/Marquee.MarqueeController` and text changed
16
+ - `ui/Placeholder.PlaceholderControllerDecorator` to not remount its children when it rerenders
17
+
5
18
  ## [4.9.0-beta.1] - 2024-06-17
6
19
 
7
20
  No significant changes.
@@ -5,7 +5,6 @@
5
5
  font-style: normal;
6
6
  text-align: center;
7
7
  position: relative;
8
- -webkit-font-kerning: none;
9
8
  font-kerning: none;
10
9
  }
11
10
  .icon[disabled] {
@@ -1,6 +1,5 @@
1
1
  .iconButton {
2
2
  box-sizing: border-box;
3
- -moz-box-sizing: border-box;
4
3
  background-position: center 0;
5
4
  }
6
5
  .iconButton .icon {
@@ -284,6 +284,14 @@ var MarqueeDecorator = exports.MarqueeDecorator = (0, _hoc["default"])(defaultCo
284
284
  }
285
285
  _this.demote();
286
286
  };
287
+ /*
288
+ * Restarts the animation
289
+ *
290
+ * @returns {undefined}
291
+ */
292
+ _this.restart = function () {
293
+ _this.restartAnimation();
294
+ };
287
295
  /*
288
296
  * Starts marquee animation with synchronization, if not already animating and a timer is
289
297
  * not already active to start.
@@ -324,7 +332,8 @@ var MarqueeDecorator = exports.MarqueeDecorator = (0, _hoc["default"])(defaultCo
324
332
  *
325
333
  * @returns {undefined}
326
334
  */
327
- _this.restartAnimation = function (delay) {
335
+ _this.restartAnimation = function () {
336
+ var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MINIMUM_MARQUEE_RESET_DELAY;
328
337
  (0, _reactDom.flushSync)(function () {
329
338
  _this.setState({
330
339
  animating: false
@@ -371,8 +380,9 @@ var MarqueeDecorator = exports.MarqueeDecorator = (0, _hoc["default"])(defaultCo
371
380
  * @returns {undefined}
372
381
  */
373
382
  _this.cancelAnimation = function () {
383
+ var retryStartingAnimation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
374
384
  if (_this.sync) {
375
- _this.context.cancel(_assertThisInitialized(_this));
385
+ _this.context.cancel(retryStartingAnimation);
376
386
  return;
377
387
  }
378
388
  _this.stop();
@@ -454,6 +464,7 @@ var MarqueeDecorator = exports.MarqueeDecorator = (0, _hoc["default"])(defaultCo
454
464
  if (this.context && this.context.register) {
455
465
  this.sync = true;
456
466
  this.context.register(this, {
467
+ restart: this.restart,
457
468
  start: this.start,
458
469
  stop: this.stop
459
470
  });
@@ -488,7 +499,7 @@ var MarqueeDecorator = exports.MarqueeDecorator = (0, _hoc["default"])(defaultCo
488
499
  // restart marqueeOn="render" marquees or synced marquees that were animating
489
500
  forceRestartMarquee = marqueeOn === 'render' || this.sync && (this.state.animating || this.timerState > TimerState.CLEAR);
490
501
  this.invalidateMetrics();
491
- this.cancelAnimation();
502
+ this.cancelAnimation(forceRestartMarquee);
492
503
  if (forceRestartMarquee && marqueeOn === 'focus') {
493
504
  this.resetAnimation();
494
505
  }
@@ -34,7 +34,7 @@ var useMarqueeController = exports.useMarqueeController = function useMarqueeCon
34
34
  * Invokes the `action` handler for each synchronized component except the invoking
35
35
  * `component`.
36
36
  *
37
- * @param {String} action `'start'` or `'stop'`
37
+ * @param {String} action `'start'`, `'stop'`, or `'restart'`
38
38
  * @param {Object} component A previously registered component
39
39
  *
40
40
  * @returns {undefined}
@@ -112,25 +112,29 @@ var useMarqueeController = exports.useMarqueeController = function useMarqueeCon
112
112
  return res || component.state === STATE.active;
113
113
  }, false);
114
114
  }, []);
115
- var doCancel = (0, _react.useCallback)(function () {
115
+ var doCancel = (0, _react.useCallback)(function (retryStartingAnimation) {
116
116
  if (mutableRef.current.isHovered || mutableRef.current.isFocused) {
117
117
  return;
118
118
  }
119
119
  markAll(STATE.inactive);
120
120
  dispatch('stop');
121
+ if (retryStartingAnimation) {
122
+ dispatch('restart');
123
+ }
121
124
  }, [dispatch, markAll]);
122
125
  var cancelJob = (0, _react.useMemo)(function () {
123
126
  return new _util.Job(function () {
124
- return doCancel();
127
+ var retryStartingAnimation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
128
+ return doCancel(retryStartingAnimation);
125
129
  }, 30);
126
130
  }, [doCancel]);
127
131
 
128
132
  /*
129
- * Registers `component` with a set of handlers for `start` and `stop`.
133
+ * Registers `component` with a set of handlers for `start`, `stop`, and `restart`.
130
134
  *
131
135
  * @param {Object} component A component, typically a React component instance, on
132
136
  * which handlers will be dispatched.
133
- * @param {Object} handlers An object containing `start` and `stop` functions
137
+ * @param {Object} handlers An object containing `start`, `stop`, and `restart` functions
134
138
  *
135
139
  * @returns {undefined}
136
140
  */
@@ -171,7 +175,7 @@ var useMarqueeController = exports.useMarqueeController = function useMarqueeCon
171
175
  *
172
176
  * @param {Object} component A previously registered component
173
177
  *
174
- * @returns {undefined}f
178
+ * @returns {undefined}
175
179
  */
176
180
  var handleStart = (0, _react.useCallback)(function (component) {
177
181
  cancelJob.stop();
@@ -184,13 +188,13 @@ var useMarqueeController = exports.useMarqueeController = function useMarqueeCon
184
188
  /*
185
189
  * Handler for the `cancel` context function
186
190
  *
187
- * @param {Object} component A previously registered component
191
+ * @param {Boolean} retryStartingAnimation If true, `restart` called after `cancelJob` completes
188
192
  *
189
193
  * @returns {undefined}
190
194
  */
191
- var handleCancel = (0, _react.useCallback)(function () {
195
+ var handleCancel = (0, _react.useCallback)(function (retryStartingAnimation) {
192
196
  if (anyRunning()) {
193
- cancelJob.start();
197
+ cancelJob.start(retryStartingAnimation);
194
198
  }
195
199
  }, [anyRunning, cancelJob]);
196
200
 
@@ -82,6 +82,7 @@ var PlaceholderControllerDecorator = exports.PlaceholderControllerDecorator = (0
82
82
  var bounds = config.bounds,
83
83
  notify = config.notify,
84
84
  thresholdFactor = config.thresholdFactor;
85
+ var WrappedWithRef = (0, _WithRef.WithRef)(Wrapped);
85
86
  return _class = /*#__PURE__*/function (_Component) {
86
87
  _inherits(_class, _Component);
87
88
  var _super = _createSuper(_class);
@@ -163,7 +164,6 @@ var PlaceholderControllerDecorator = exports.PlaceholderControllerDecorator = (0
163
164
  key: "render",
164
165
  value: function render() {
165
166
  var props = Object.assign({}, this.props);
166
- var WrappedWithRef = (0, _WithRef.WithRef)(Wrapped);
167
167
  if (notify) props[notify] = this.handleNotify;
168
168
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(PlaceholderContext.Provider, {
169
169
  value: this.registry.register,
@@ -10,7 +10,6 @@
10
10
  margin: auto;
11
11
  opacity: 0;
12
12
  flex: auto;
13
- -webkit-transition: opacity 100ms linear;
14
13
  transition: opacity 100ms linear;
15
14
  will-change: transform, top, left, right;
16
15
  }
@@ -34,6 +34,3 @@
34
34
  overflow: hidden;
35
35
  flex: 1 1 100%;
36
36
  }
37
- .scrollable .contentNative {
38
- -webkit-overflow-scrolling: touch;
39
- }
@@ -991,7 +991,7 @@ var ScrollableBaseNative = exports.ScrollableBaseNative = /*#__PURE__*/function
991
991
  isHorizontalScrollbarVisible = _this$state3.isHorizontalScrollbarVisible,
992
992
  isVerticalScrollbarVisible = _this$state3.isVerticalScrollbarVisible,
993
993
  scrollableClasses = (0, _classnames["default"])(_ScrollableModule["default"].scrollable, className),
994
- contentClasses = (0, _classnames["default"])(_ScrollableModule["default"].content, _ScrollableModule["default"].contentNative),
994
+ contentClasses = (0, _classnames["default"])(_ScrollableModule["default"].content),
995
995
  childWrapper = noScrollByDrag ? 'div' : TouchableDiv,
996
996
  childWrapperProps = _objectSpread({
997
997
  className: contentClasses
@@ -6,10 +6,7 @@
6
6
  opacity: 1;
7
7
  flex: none;
8
8
  transform: translateZ(0);
9
- -webkit-transform: translateZ(0);
10
9
  transition: opacity 0.1s linear;
11
- -moz-transition: opacity 0.1s linear;
12
- -webkit-transition: opacity 0.1s linear;
13
10
  /* ScrollThumb */
14
11
  }
15
12
  .scrollbar.vertical {
@@ -20,7 +17,7 @@
20
17
  transform: scaleX(-1);
21
18
  }
22
19
  .scrollbar.corner {
23
- -webkit-padding-end: 0.125rem;
20
+ padding-inline-end: 0.125rem;
24
21
  }
25
22
  .scrollbar .thumbShown {
26
23
  opacity: 1;
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "ScrollerBasic", {
17
17
  }
18
18
  });
19
19
  exports["default"] = void 0;
20
+ var _util = require("@enact/core/util");
20
21
  var _propTypes = _interopRequireDefault(require("prop-types"));
21
22
  var _Resizable = require("../Resizable");
22
23
  var _useScroll2 = _interopRequireDefault(require("../useScroll"));
@@ -73,7 +74,7 @@ var scrollerDefaultProps = {
73
74
  var Scroller = exports.Scroller = function Scroller(props) {
74
75
  // Hooks
75
76
 
76
- var scrollerProps = Object.assign({}, scrollerDefaultProps, props);
77
+ var scrollerProps = (0, _util.setDefaultProps)(props, scrollerDefaultProps);
77
78
  var _useScroll = (0, _useScroll2["default"])(scrollerProps),
78
79
  scrollContentHandle = _useScroll.scrollContentHandle,
79
80
  ScrollContentWrapper = _useScroll.scrollContentWrapper,
@@ -35,6 +35,7 @@ Object.defineProperty(exports, "itemSizesShape", {
35
35
  return _VirtualListBasic.itemSizesShape;
36
36
  }
37
37
  });
38
+ var _util = require("@enact/core/util");
38
39
  var _propTypes = _interopRequireDefault(require("prop-types"));
39
40
  var _Resizable = require("../Resizable");
40
41
  var _useScroll3 = _interopRequireDefault(require("../useScroll"));
@@ -90,7 +91,7 @@ var virtualListDefaultProps = {
90
91
  var VirtualList = exports.VirtualList = function VirtualList(props) {
91
92
  // Hooks
92
93
 
93
- var virtualListProps = Object.assign({}, virtualListDefaultProps, props);
94
+ var virtualListProps = (0, _util.setDefaultProps)(props, virtualListDefaultProps);
94
95
  var _useScroll = (0, _useScroll3["default"])(virtualListProps),
95
96
  scrollContentHandle = _useScroll.scrollContentHandle,
96
97
  ScrollContentWrapper = _useScroll.scrollContentWrapper,
@@ -343,7 +344,7 @@ var virtualGridListDefaultProps = {
343
344
  * @public
344
345
  */
345
346
  var VirtualGridList = exports.VirtualGridList = function VirtualGridList(props) {
346
- var virtualGridListProps = Object.assign({}, virtualGridListDefaultProps, props);
347
+ var virtualGridListProps = (0, _util.setDefaultProps)(props, virtualGridListDefaultProps);
347
348
  var _useScroll2 = (0, _useScroll3["default"])(virtualGridListProps),
348
349
  scrollContentHandle = _useScroll2.scrollContentHandle,
349
350
  ScrollContentWrapper = _useScroll2.scrollContentWrapper,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enact/ui",
3
- "version": "4.9.0-beta.1",
3
+ "version": "4.9.1",
4
4
  "description": "A collection of simplified unstyled cross-platform UI components for Enact",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,12 +32,12 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@enact/core": "^4.9.0-beta.1",
35
+ "@enact/core": "^4.9.1",
36
36
  "classnames": "^2.5.1",
37
37
  "direction": "^1.0.4",
38
38
  "invariant": "^2.2.4",
39
39
  "prop-types": "^15.8.1",
40
- "ramda": "^0.29.1",
40
+ "ramda": "^0.30.1",
41
41
  "react": "^18.3.1",
42
42
  "react-dom": "^18.3.1",
43
43
  "react-is": "^18.3.1",
package/styles/core.less CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
  // Touch interaction
27
27
  .enact-no-touch-action {
28
- -ms-touch-action: none;
28
+ touch-action: none;
29
29
  }
30
30
 
31
31
  .enact-untouchable {
@@ -39,17 +39,13 @@
39
39
  // Selection
40
40
  .enact-unselectable {
41
41
  cursor: default;
42
- -ms-user-select: none;
43
42
  -webkit-user-select: none;
44
- -moz-user-select: -moz-none;
45
43
  user-select: none;
46
44
  }
47
45
 
48
46
  .enact-selectable {
49
47
  cursor: auto;
50
- -ms-user-select: element;
51
48
  -webkit-user-select: text;
52
- -moz-user-select: text;
53
49
  user-select: text;
54
50
  }
55
51
 
@@ -14,9 +14,6 @@
14
14
  }
15
15
 
16
16
  .enact-composite() {
17
- -webkit-transform: translateZ(0);
18
- -ms-transform: translateZ(0);
19
- -o-transform: translateZ(0);
20
17
  transform: translateZ(0);
21
18
  will-change: transform;
22
19
  }
@@ -103,11 +100,11 @@
103
100
  // */
104
101
  .remove-margin-on-edge-children() {
105
102
  > :first-child {
106
- -webkit-margin-start: 0;
103
+ margin-inline-start: 0;
107
104
  }
108
105
 
109
106
  > :last-child {
110
- -webkit-margin-end: 0;
107
+ margin-inline-end: 0;
111
108
  }
112
109
  }
113
110
 
@@ -117,11 +114,11 @@
117
114
  // */
118
115
  .remove-padding-on-edge-children() {
119
116
  > :first-child {
120
- -webkit-padding-start: 0;
117
+ padding-inline-start: 0;
121
118
  }
122
119
 
123
120
  > :last-child {
124
- -webkit-padding-end: 0;
121
+ padding-inline-end: 0;
125
122
  }
126
123
  }
127
124
 
@@ -142,26 +139,17 @@
142
139
  }
143
140
 
144
141
  .input-placeholder(@rule) {
145
- &::-webkit-input-placeholder {
146
- @rule();
147
- }
148
- &::-moz-placeholder {
142
+ &::placeholder {
149
143
  @rule();
150
144
  }
151
145
  }
152
146
 
153
147
  // Assign font-kerning rules in a non-proprietary way. Default value being "normal", to enable kerning.
154
148
  .font-kerning(@val: normal) {
155
- -webkit-font-kerning: @val;
156
149
  font-kerning: @val;
157
150
  }
158
151
 
159
- // Provide a set of rules to assign to each vendor-prefixed pseudo selector
160
152
  .vendor-fullscreen(@rule) {
161
- &:-webkit-full-screen { @rule(); }
162
- &:-moz-full-screen { @rule(); }
163
- &:-ms-fullscreen { @rule(); }
164
- &:-o-full-screen { @rule(); }
165
153
  &:fullscreen { @rule(); }
166
154
  }
167
155
 
@@ -211,7 +199,6 @@
211
199
 
212
200
  .border-box() {
213
201
  box-sizing: border-box;
214
- -moz-box-sizing: border-box;
215
202
  }
216
203
 
217
204
  // Helpful debugging way to understand how LESS variables are being interpreted
@@ -6,10 +6,7 @@
6
6
  opacity: 1;
7
7
  flex: none;
8
8
  transform: translateZ(0);
9
- -webkit-transform: translateZ(0);
10
9
  transition: opacity 0.1s linear;
11
- -moz-transition: opacity 0.1s linear;
12
- -webkit-transition: opacity 0.1s linear;
13
10
  /* ScrollbarTrack */
14
11
  }
15
12
  .scrollbar.vertical {
@@ -20,7 +17,7 @@
20
17
  transform: scaleX(-1);
21
18
  }
22
19
  .scrollbar.corner {
23
- -webkit-padding-end: 0.125rem;
20
+ padding-inline-end: 0.125rem;
24
21
  }
25
22
  .scrollbar .scrollbarTrackShown {
26
23
  opacity: 1;
@@ -10,7 +10,6 @@
10
10
  margin: auto;
11
11
  opacity: 0;
12
12
  flex: auto;
13
- -webkit-transition: opacity 100ms linear;
14
13
  transition: opacity 100ms linear;
15
14
  will-change: transform, top, left, right;
16
15
  }
@@ -1450,7 +1450,7 @@ var useScrollBase = exports.useScrollBase = function useScrollBase(props) {
1450
1450
  className: [_useScrollModule["default"].scrollInnerContainer]
1451
1451
  });
1452
1452
  assignProperties('scrollContentWrapperProps', _objectSpread({
1453
- className: scrollMode === 'translate' ? [_useScrollModule["default"].scrollContentWrapper] : [_useScrollModule["default"].scrollContentWrapper, _useScrollModule["default"].scrollContentWrapperNative]
1453
+ className: [_useScrollModule["default"].scrollContentWrapper]
1454
1454
  }, !noScrollByDrag && {
1455
1455
  flickConfig: flickConfig,
1456
1456
  onDrag: onDrag,
@@ -33,6 +33,3 @@
33
33
  overflow: hidden;
34
34
  flex: 1 1 100%;
35
35
  }
36
- .scroll .scrollContentWrapperNative {
37
- -webkit-overflow-scrolling: touch;
38
- }