@enact/core 5.0.0-alpha.3 → 5.0.0-alpha.4
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 +10 -0
- package/dispatcher/dispatcher.js +4 -4
- package/handle/tests/handle-specs.js +2 -2
- package/hoc/tests/hoc-specs.js +7 -7
- package/internal/ApiDecorator/tests/ApiDecorator-specs.js +6 -6
- package/internal/Registry/tests/Registry-specs.js +5 -5
- package/internal/WithRef/tests/WithRef-specs.js +2 -2
- package/internal/prop-types/tests/prop-types-specs.js +20 -20
- package/kind/tests/kind-specs.js +8 -8
- package/package.json +4 -4
- package/platform/platform.js +4 -4
- package/useChainRefs/tests/useChainRefs-specs.js +3 -3
- package/useClass/tests/useClass-specs.js +3 -3
- package/useHandlers/tests/useHandlers-specs.js +9 -9
- package/util/Job.js +3 -3
- package/util/tests/util-specs.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
The following is a curated list of changes in the Enact core module, newest changes on the top.
|
|
4
4
|
|
|
5
|
+
## [5.0.0-alpha.4] - 2025-01-21
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- `core/platform` to support `safari` 16.4, `chrome` 119, and `firefox` 128 or later
|
|
10
|
+
|
|
11
|
+
## [4.9.5] - 2024-12-11
|
|
12
|
+
|
|
13
|
+
No significant changes.
|
|
14
|
+
|
|
5
15
|
## [5.0.0-alpha.3] - 2024-12-02
|
|
6
16
|
|
|
7
17
|
No significant changes.
|
package/dispatcher/dispatcher.js
CHANGED
|
@@ -153,10 +153,10 @@ var off = exports.off = function off(name, fn) {
|
|
|
153
153
|
* @public
|
|
154
154
|
*/
|
|
155
155
|
var once = exports.once = function once(name, fn, target) {
|
|
156
|
-
var
|
|
156
|
+
var _onceFn = function onceFn(ev) {
|
|
157
157
|
fn(ev);
|
|
158
|
-
off(name,
|
|
158
|
+
off(name, _onceFn, target);
|
|
159
159
|
};
|
|
160
|
-
on(name,
|
|
161
|
-
return
|
|
160
|
+
on(name, _onceFn, target);
|
|
161
|
+
return _onceFn;
|
|
162
162
|
};
|
|
@@ -534,7 +534,7 @@ describe('handle', function () {
|
|
|
534
534
|
TestComponent.propTypes = {
|
|
535
535
|
onCustomEvent: _propTypes["default"].func
|
|
536
536
|
};
|
|
537
|
-
(0, _react2.render)(
|
|
537
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
538
538
|
onCustomEvent: handler
|
|
539
539
|
}));
|
|
540
540
|
var actual = handler.mock.calls[0][0];
|
|
@@ -695,7 +695,7 @@ describe('handle', function () {
|
|
|
695
695
|
TestComponent.propTypes = {
|
|
696
696
|
onCustomEvent: _propTypes["default"].func
|
|
697
697
|
};
|
|
698
|
-
(0, _react2.render)(
|
|
698
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
699
699
|
onCustomEvent: handler
|
|
700
700
|
}));
|
|
701
701
|
var actual = handler.mock.calls[0][0];
|
package/hoc/tests/hoc-specs.js
CHANGED
|
@@ -40,7 +40,7 @@ describe('hoc', function () {
|
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
42
|
var Component = ImplicitNullHoC('span');
|
|
43
|
-
(0, _react.render)(
|
|
43
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
44
44
|
var component = _react.screen.getByTestId(testID);
|
|
45
45
|
var expected = 'SPAN';
|
|
46
46
|
var actual = component.nodeName;
|
|
@@ -48,7 +48,7 @@ describe('hoc', function () {
|
|
|
48
48
|
});
|
|
49
49
|
test('should support DOM node name as first argument to HoC', function () {
|
|
50
50
|
var Component = HoC('span');
|
|
51
|
-
(0, _react.render)(
|
|
51
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
52
52
|
var component = _react.screen.getByTestId(testID);
|
|
53
53
|
var expected = 'SPAN';
|
|
54
54
|
var actual = component.nodeName;
|
|
@@ -61,7 +61,7 @@ describe('hoc', function () {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
var Component = HoC(Thing);
|
|
64
|
-
(0, _react.render)(
|
|
64
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
65
65
|
var component = _react.screen.getByTestId(testID);
|
|
66
66
|
var expected = 'DIV';
|
|
67
67
|
var actual = component.nodeName;
|
|
@@ -71,7 +71,7 @@ describe('hoc', function () {
|
|
|
71
71
|
});
|
|
72
72
|
test('should use default config when instance config is omitted', function () {
|
|
73
73
|
var Component = HoC('span');
|
|
74
|
-
(0, _react.render)(
|
|
74
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
75
75
|
var component = _react.screen.getByTestId(testID);
|
|
76
76
|
var expectedAttribute = 'color';
|
|
77
77
|
var expectedValue = defaultConfig.color;
|
|
@@ -82,7 +82,7 @@ describe('hoc', function () {
|
|
|
82
82
|
color: 'green'
|
|
83
83
|
};
|
|
84
84
|
var Component = HoC(instanceConfig, 'div');
|
|
85
|
-
(0, _react.render)(
|
|
85
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
86
86
|
var component = _react.screen.getByTestId(testID);
|
|
87
87
|
var expectedAttribute = 'color';
|
|
88
88
|
var expectedValue = instanceConfig.color;
|
|
@@ -90,7 +90,7 @@ describe('hoc', function () {
|
|
|
90
90
|
});
|
|
91
91
|
test('should allow construction without default or instance configs', function () {
|
|
92
92
|
var Component = NullHoC('input');
|
|
93
|
-
(0, _react.render)(
|
|
93
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
94
94
|
var component = _react.screen.getByTestId(testID);
|
|
95
95
|
var expected = 'INPUT';
|
|
96
96
|
var actual = component.nodeName;
|
|
@@ -102,7 +102,7 @@ describe('hoc', function () {
|
|
|
102
102
|
color: 'green'
|
|
103
103
|
};
|
|
104
104
|
var Component = NullHoC(instanceConfig, 'div');
|
|
105
|
-
(0, _react.render)(
|
|
105
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
106
106
|
var component = _react.screen.getByTestId(testID);
|
|
107
107
|
var expectedAttribute = 'color';
|
|
108
108
|
var expectedValue = instanceConfig.color;
|
|
@@ -65,7 +65,7 @@ describe('ApiDecorator', function () {
|
|
|
65
65
|
var Component = (0, _ApiDecorator["default"])({
|
|
66
66
|
api: ['arrowFunction']
|
|
67
67
|
}, ApiProvider);
|
|
68
|
-
(0, _react.render)(
|
|
68
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
69
69
|
ref: ref
|
|
70
70
|
}));
|
|
71
71
|
var expected = 'arrow';
|
|
@@ -77,7 +77,7 @@ describe('ApiDecorator', function () {
|
|
|
77
77
|
var Component = (0, _ApiDecorator["default"])({
|
|
78
78
|
api: ['instanceFunction']
|
|
79
79
|
}, ApiProvider);
|
|
80
|
-
(0, _react.render)(
|
|
80
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
81
81
|
ref: ref
|
|
82
82
|
}));
|
|
83
83
|
var expected = 'instance';
|
|
@@ -89,7 +89,7 @@ describe('ApiDecorator', function () {
|
|
|
89
89
|
var Component = (0, _ApiDecorator["default"])({
|
|
90
90
|
api: ['instanceProperty']
|
|
91
91
|
}, ApiProvider);
|
|
92
|
-
(0, _react.render)(
|
|
92
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
93
93
|
ref: ref
|
|
94
94
|
}));
|
|
95
95
|
var expected = 'property';
|
|
@@ -101,7 +101,7 @@ describe('ApiDecorator', function () {
|
|
|
101
101
|
var Component = (0, _ApiDecorator["default"])({
|
|
102
102
|
api: ['instanceProperty']
|
|
103
103
|
}, ApiProvider);
|
|
104
|
-
(0, _react.render)(
|
|
104
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
105
105
|
ref: ref
|
|
106
106
|
}));
|
|
107
107
|
ref.current.instanceProperty = 'updated';
|
|
@@ -114,7 +114,7 @@ describe('ApiDecorator', function () {
|
|
|
114
114
|
var Component = (0, _ApiDecorator["default"])({
|
|
115
115
|
api: ['instanceProperty']
|
|
116
116
|
}, WrongApiProvider);
|
|
117
|
-
(0, _react.render)(
|
|
117
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
118
118
|
ref: ref
|
|
119
119
|
}));
|
|
120
120
|
|
|
@@ -128,7 +128,7 @@ describe('ApiDecorator', function () {
|
|
|
128
128
|
var Component = (0, _ApiDecorator["default"])({
|
|
129
129
|
api: ['instanceProperty']
|
|
130
130
|
}, WrongApiProvider);
|
|
131
|
-
(0, _react.render)(
|
|
131
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
132
132
|
ref: ref
|
|
133
133
|
}));
|
|
134
134
|
ref.current.instanceProperty = 'updated';
|
|
@@ -116,7 +116,7 @@ describe('Registry', function () {
|
|
|
116
116
|
HandlesNotification.contextType = SomeContext;
|
|
117
117
|
test('should increment child on click', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
118
118
|
var user = _userEvent["default"].setup();
|
|
119
|
-
(0, _react2.render)(
|
|
119
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(NotifiesTree, {
|
|
120
120
|
"data-testid": "a-btn",
|
|
121
121
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HandlesNotification, {
|
|
122
122
|
"data-testid": "a"
|
|
@@ -129,7 +129,7 @@ describe('Registry', function () {
|
|
|
129
129
|
}));
|
|
130
130
|
test('should increment both children on top click', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
131
131
|
var user = _userEvent["default"].setup();
|
|
132
|
-
(0, _react2.render)(
|
|
132
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(NotifiesTree, {
|
|
133
133
|
"data-testid": "a-btn",
|
|
134
134
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(HandlesNotification, {
|
|
135
135
|
"data-testid": "a"
|
|
@@ -149,7 +149,7 @@ describe('Registry', function () {
|
|
|
149
149
|
}));
|
|
150
150
|
test('should increment the deepest child when we click child button', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
151
151
|
var user = _userEvent["default"].setup();
|
|
152
|
-
(0, _react2.render)(
|
|
152
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(NotifiesTree, {
|
|
153
153
|
"data-testid": "a-btn",
|
|
154
154
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(HandlesNotification, {
|
|
155
155
|
"data-testid": "a"
|
|
@@ -170,7 +170,7 @@ describe('Registry', function () {
|
|
|
170
170
|
}));
|
|
171
171
|
test('should support removing children without error', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
172
172
|
var user = _userEvent["default"].setup();
|
|
173
|
-
var _render = (0, _react2.render)(
|
|
173
|
+
var _render = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(NotifiesTree, {
|
|
174
174
|
"data-testid": "a-btn",
|
|
175
175
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(HandlesNotification, {
|
|
176
176
|
"data-testid": "a"
|
|
@@ -182,7 +182,7 @@ describe('Registry', function () {
|
|
|
182
182
|
yield user.click(_react2.screen.getByTestId('a-btn'));
|
|
183
183
|
|
|
184
184
|
// changing children should be safe and not throw errors when notifying instances
|
|
185
|
-
rerender(
|
|
185
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(NotifiesTree, {
|
|
186
186
|
"data-testid": "a-btn",
|
|
187
187
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HandlesNotification, {
|
|
188
188
|
"data-testid": "c"
|
|
@@ -40,7 +40,7 @@ describe('WithRef', function () {
|
|
|
40
40
|
var ComponentWithRef = (0, _WithRef.WithRef)(DummyComponent);
|
|
41
41
|
var id = 'test-wrapped';
|
|
42
42
|
var divRef = /*#__PURE__*/(0, _react.createRef)();
|
|
43
|
-
(0, _react2.render)(
|
|
43
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(ComponentWithRef, {
|
|
44
44
|
outermostRef: divRef,
|
|
45
45
|
"data-testid": id
|
|
46
46
|
}));
|
|
@@ -51,7 +51,7 @@ describe('WithRef', function () {
|
|
|
51
51
|
var ComponentWithRef = (0, _WithRef.WithRef)('div');
|
|
52
52
|
var id = 'test-wrapped';
|
|
53
53
|
var divRef = /*#__PURE__*/(0, _react.createRef)();
|
|
54
|
-
(0, _react2.render)(
|
|
54
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(ComponentWithRef, {
|
|
55
55
|
ref: divRef,
|
|
56
56
|
"data-testid": id
|
|
57
57
|
}));
|
|
@@ -18,7 +18,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
18
18
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
-
describe('prop-types', function () {
|
|
21
|
+
describe.skip('prop-types', function () {
|
|
22
22
|
var DummyElement = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
|
|
23
23
|
var DummyRenderable = function DummyRenderable() {
|
|
24
24
|
return DummyElement;
|
|
@@ -66,25 +66,25 @@ describe('prop-types', function () {
|
|
|
66
66
|
});
|
|
67
67
|
describe('no prop', function () {
|
|
68
68
|
test('should not call console.error when no prop is given', function () {
|
|
69
|
-
(0, _react.render)(
|
|
69
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {}));
|
|
70
70
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
describe('component', function () {
|
|
74
74
|
test('should not call console.error for EnactPropTypes.component if renderable value is given', function () {
|
|
75
|
-
(0, _react.render)(
|
|
75
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
76
76
|
typeComponent: DummyRenderable
|
|
77
77
|
}));
|
|
78
78
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
79
79
|
});
|
|
80
80
|
test('should call console.error for EnactPropTypes.component if string value is given', function () {
|
|
81
|
-
(0, _react.render)(
|
|
81
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
82
82
|
typeComponent: dummyString
|
|
83
83
|
}));
|
|
84
84
|
expect(consoleErrorMock).toHaveBeenCalled();
|
|
85
85
|
});
|
|
86
86
|
test('should call console.error for EnactPropTypes.component if element value is given', function () {
|
|
87
|
-
(0, _react.render)(
|
|
87
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
88
88
|
typeComponent: DummyElement
|
|
89
89
|
}));
|
|
90
90
|
expect(consoleErrorMock).toHaveBeenCalled();
|
|
@@ -92,19 +92,19 @@ describe('prop-types', function () {
|
|
|
92
92
|
});
|
|
93
93
|
describe('componentOverride', function () {
|
|
94
94
|
test('should not call console.error for EnactPropTypes.componentOverride if renderable value is given', function () {
|
|
95
|
-
(0, _react.render)(
|
|
95
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
96
96
|
typeComponentOverride: DummyRenderable
|
|
97
97
|
}));
|
|
98
98
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
99
99
|
});
|
|
100
100
|
test('should call console.error for EnactPropTypes.componentOverride if string value is given', function () {
|
|
101
|
-
(0, _react.render)(
|
|
101
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
102
102
|
typeComponentOverride: dummyString
|
|
103
103
|
}));
|
|
104
104
|
expect(consoleErrorMock).toHaveBeenCalled();
|
|
105
105
|
});
|
|
106
106
|
test('should not call console.error for EnactPropTypes.componentOverride if element value is given', function () {
|
|
107
|
-
(0, _react.render)(
|
|
107
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
108
108
|
typeComponentOverride: DummyElement
|
|
109
109
|
}));
|
|
110
110
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
@@ -113,13 +113,13 @@ describe('prop-types', function () {
|
|
|
113
113
|
describe('ref', function () {
|
|
114
114
|
test('should not call console.error for EnactPropTypes.ref if ref value is given', function () {
|
|
115
115
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
116
|
-
(0, _react.render)(
|
|
116
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
117
117
|
typeRef: ref
|
|
118
118
|
}));
|
|
119
119
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
120
120
|
});
|
|
121
121
|
test('should call console.error for EnactPropTypes.ref if non-ref value is given', function () {
|
|
122
|
-
(0, _react.render)(
|
|
122
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
123
123
|
typeRef: dummyString
|
|
124
124
|
}));
|
|
125
125
|
expect(consoleErrorMock).toHaveBeenCalled();
|
|
@@ -127,19 +127,19 @@ describe('prop-types', function () {
|
|
|
127
127
|
});
|
|
128
128
|
describe('renderable', function () {
|
|
129
129
|
test('should not call console.error for EnactPropTypes.renderable if renderable value is given', function () {
|
|
130
|
-
(0, _react.render)(
|
|
130
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
131
131
|
typeRenderable: DummyRenderable
|
|
132
132
|
}));
|
|
133
133
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
134
134
|
});
|
|
135
135
|
test('should not call console.error for EnactPropTypes.renderable if string value is given', function () {
|
|
136
|
-
(0, _react.render)(
|
|
136
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
137
137
|
typeRenderable: dummyString
|
|
138
138
|
}));
|
|
139
139
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
140
140
|
});
|
|
141
141
|
test('should call console.error for EnactPropTypes.renderable if element value is given', function () {
|
|
142
|
-
(0, _react.render)(
|
|
142
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
143
143
|
typeRenderable: DummyElement
|
|
144
144
|
}));
|
|
145
145
|
expect(consoleErrorMock).toHaveBeenCalled();
|
|
@@ -147,19 +147,19 @@ describe('prop-types', function () {
|
|
|
147
147
|
});
|
|
148
148
|
describe('renderableOverride', function () {
|
|
149
149
|
test('should not call console.error for EnactPropTypes.renderableOverride if renderable value is given', function () {
|
|
150
|
-
(0, _react.render)(
|
|
150
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
151
151
|
typeRenderableOverride: DummyRenderable
|
|
152
152
|
}));
|
|
153
153
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
154
154
|
});
|
|
155
155
|
test('should not call console.error for EnactPropTypes.renderableOverride if string value is given', function () {
|
|
156
|
-
(0, _react.render)(
|
|
156
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
157
157
|
typeRenderableOverride: dummyString
|
|
158
158
|
}));
|
|
159
159
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
160
160
|
});
|
|
161
161
|
test('should not call console.error for EnactPropTypes.renderableOverride if element value is given', function () {
|
|
162
|
-
(0, _react.render)(
|
|
162
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {
|
|
163
163
|
typeRenderableOverride: DummyElement
|
|
164
164
|
}));
|
|
165
165
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
@@ -189,13 +189,13 @@ describe('prop-types', function () {
|
|
|
189
189
|
typeRequired: _propTypes["default"].renderable.isRequired
|
|
190
190
|
};
|
|
191
191
|
test('should not call console.error when required prop value is given', function () {
|
|
192
|
-
(0, _react.render)(
|
|
192
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(RequiredComponent, {
|
|
193
193
|
typeRequired: DummyRenderable
|
|
194
194
|
}));
|
|
195
195
|
expect(consoleErrorMock).not.toHaveBeenCalled();
|
|
196
196
|
});
|
|
197
197
|
test('should call console.error when prop value is missing for isRequired', function () {
|
|
198
|
-
(0, _react.render)(
|
|
198
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(RequiredComponent, {}));
|
|
199
199
|
expect(consoleErrorMock).toHaveBeenCalled();
|
|
200
200
|
});
|
|
201
201
|
});
|
|
@@ -224,7 +224,7 @@ describe('prop-types', function () {
|
|
|
224
224
|
DeprecatedComponent.propTypes = {
|
|
225
225
|
typeDeprecated: _propTypes["default"].deprecated(_propTypes["default"].ref)
|
|
226
226
|
};
|
|
227
|
-
(0, _react.render)(
|
|
227
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(DeprecatedComponent, {
|
|
228
228
|
typeDeprecated: ref
|
|
229
229
|
}));
|
|
230
230
|
expect(consoleWarnMock).toHaveBeenCalled();
|
|
@@ -252,7 +252,7 @@ describe('prop-types', function () {
|
|
|
252
252
|
DeprecatedComponent.propTypes = {
|
|
253
253
|
typeDeprecated: _propTypes["default"].deprecated(_propTypes["default"].ref)
|
|
254
254
|
};
|
|
255
|
-
(0, _react.render)(
|
|
255
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(DeprecatedComponent, {}));
|
|
256
256
|
expect(consoleWarnMock).toHaveBeenCalled();
|
|
257
257
|
});
|
|
258
258
|
});
|
package/kind/tests/kind-specs.js
CHANGED
|
@@ -82,11 +82,11 @@ describe('kind', function () {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
(0, _react.render)(
|
|
85
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Minimal, {}));
|
|
86
86
|
var minimalDiv = _react.screen.queryByTestId('minimal');
|
|
87
87
|
expect(minimalDiv).toBeInTheDocument();
|
|
88
88
|
});
|
|
89
|
-
test('should default {label} property', function () {
|
|
89
|
+
test.skip('should default {label} property', function () {
|
|
90
90
|
var subject = /*#__PURE__*/(0, _jsxRuntime.jsx)(Kind, {
|
|
91
91
|
prop: 1
|
|
92
92
|
});
|
|
@@ -94,7 +94,7 @@ describe('kind', function () {
|
|
|
94
94
|
var actual = subject.props.label;
|
|
95
95
|
expect(actual).toBe(expected);
|
|
96
96
|
});
|
|
97
|
-
test('should default {label} property when explicitly undefined', function () {
|
|
97
|
+
test.skip('should default {label} property when explicitly undefined', function () {
|
|
98
98
|
// Explicitly testing for undefined
|
|
99
99
|
// eslint-disable-next-line no-undefined
|
|
100
100
|
var subject = /*#__PURE__*/(0, _jsxRuntime.jsx)(Kind, {
|
|
@@ -106,7 +106,7 @@ describe('kind', function () {
|
|
|
106
106
|
expect(actual).toBe(expected);
|
|
107
107
|
});
|
|
108
108
|
test('should add className defined in styles', function () {
|
|
109
|
-
(0, _react.render)(
|
|
109
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Kind, {
|
|
110
110
|
prop: 1
|
|
111
111
|
}));
|
|
112
112
|
var expected = 'kind';
|
|
@@ -114,7 +114,7 @@ describe('kind', function () {
|
|
|
114
114
|
expect(kindDiv).toHaveClass(expected);
|
|
115
115
|
});
|
|
116
116
|
test('should compute {value} property', function () {
|
|
117
|
-
(0, _react.render)(
|
|
117
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Kind, {
|
|
118
118
|
prop: 1
|
|
119
119
|
}));
|
|
120
120
|
var expected = '2';
|
|
@@ -124,7 +124,7 @@ describe('kind', function () {
|
|
|
124
124
|
test('should support contextType in handlers', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
125
125
|
var onClick = jest.fn();
|
|
126
126
|
var user = _userEvent["default"].setup();
|
|
127
|
-
(0, _react.render)(
|
|
127
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Kind, {
|
|
128
128
|
onClick: onClick,
|
|
129
129
|
prop: 1
|
|
130
130
|
}));
|
|
@@ -135,7 +135,7 @@ describe('kind', function () {
|
|
|
135
135
|
expect(actual).toBe(expected);
|
|
136
136
|
}));
|
|
137
137
|
test('should support contextType in computed', function () {
|
|
138
|
-
(0, _react.render)(
|
|
138
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Kind, {
|
|
139
139
|
prop: 1
|
|
140
140
|
}));
|
|
141
141
|
var expected = 'contextinitial';
|
|
@@ -162,7 +162,7 @@ describe('kind', function () {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
(0, _react.render)(
|
|
165
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {}));
|
|
166
166
|
var button = _react.screen.getByTestId('button');
|
|
167
167
|
yield user.click(button);
|
|
168
168
|
var expected = '1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.4",
|
|
4
4
|
"description": "Enact is an open source JavaScript framework containing everything you need to create a fast, scalable mobile or web application.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"invariant": "^2.2.4",
|
|
37
37
|
"prop-types": "^15.8.1",
|
|
38
38
|
"ramda": "^0.30.1",
|
|
39
|
-
"react": "^
|
|
40
|
-
"react-dom": "^
|
|
41
|
-
"react-is": "^
|
|
39
|
+
"react": "^19.0.0",
|
|
40
|
+
"react-dom": "^19.0.0",
|
|
41
|
+
"react-is": "^19.0.0",
|
|
42
42
|
"warning": "^4.0.3"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/platform/platform.js
CHANGED
|
@@ -31,7 +31,7 @@ var deviceTouchScreen = function deviceTouchScreen() {
|
|
|
31
31
|
var _globalThis$navigator, _globalThis$matchMedi;
|
|
32
32
|
return browserEnvironment() && (
|
|
33
33
|
// check if maxTouchPoints is greater than 0 first
|
|
34
|
-
((_globalThis$navigator = globalThis.navigator) === null || _globalThis$navigator === void 0 ? void 0 : _globalThis$navigator.maxTouchPoints) > 0 || (
|
|
34
|
+
((_globalThis$navigator = globalThis.navigator) === null || _globalThis$navigator === void 0 ? void 0 : _globalThis$navigator.maxTouchPoints) > 0 || (// check for any-pointer: coarse which mostly means touchscreen
|
|
35
35
|
(_globalThis$matchMedi = globalThis.matchMedia) === null || _globalThis$matchMedi === void 0 || (_globalThis$matchMedi = _globalThis$matchMedi.call(globalThis, "(any-pointer: coarse)")) === null || _globalThis$matchMedi === void 0 ? void 0 : _globalThis$matchMedi.matches));
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -56,9 +56,9 @@ var userAgentPatterns = [
|
|
|
56
56
|
|
|
57
57
|
// The base supported versions: Used in DEPRECATED warning
|
|
58
58
|
var supportedVersions = {
|
|
59
|
-
safari:
|
|
60
|
-
chrome:
|
|
61
|
-
firefox:
|
|
59
|
+
safari: 16.4,
|
|
60
|
+
chrome: 119,
|
|
61
|
+
firefox: 128
|
|
62
62
|
};
|
|
63
63
|
var parseUserAgent = exports.parseUserAgent = function parseUserAgent(userAgent) {
|
|
64
64
|
var detectedInfo = {
|
|
@@ -21,14 +21,14 @@ describe('useChainRefs', function () {
|
|
|
21
21
|
}
|
|
22
22
|
test('should call a single functional ref', function () {
|
|
23
23
|
var ref = jest.fn();
|
|
24
|
-
(0, _react.render)(
|
|
24
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
25
25
|
refs: [ref]
|
|
26
26
|
}));
|
|
27
27
|
expect(ref).toHaveBeenCalledTimes(1);
|
|
28
28
|
});
|
|
29
29
|
test('should call a single object ref', function () {
|
|
30
30
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
31
|
-
(0, _react.render)(
|
|
31
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
32
32
|
refs: [ref]
|
|
33
33
|
}));
|
|
34
34
|
var expected = 'DIV';
|
|
@@ -38,7 +38,7 @@ describe('useChainRefs', function () {
|
|
|
38
38
|
test('should ignore invalid refs', function () {
|
|
39
39
|
var invalid = {};
|
|
40
40
|
var ref = jest.fn();
|
|
41
|
-
(0, _react.render)(
|
|
41
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
42
42
|
refs: [invalid, ref]
|
|
43
43
|
}));
|
|
44
44
|
expect(ref).toHaveBeenCalledTimes(1);
|
|
@@ -25,7 +25,7 @@ describe('useClass', function () {
|
|
|
25
25
|
}
|
|
26
26
|
test('should pass arg to Class', function () {
|
|
27
27
|
var arg = 'arg';
|
|
28
|
-
(0, _react.render)(
|
|
28
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
29
29
|
arg: arg
|
|
30
30
|
}));
|
|
31
31
|
var div = _react.screen.getByTestId('div');
|
|
@@ -33,13 +33,13 @@ describe('useClass', function () {
|
|
|
33
33
|
});
|
|
34
34
|
test('should use the same instance of Class across renders', function () {
|
|
35
35
|
var arg = 'arg';
|
|
36
|
-
var _render = (0, _react.render)(
|
|
36
|
+
var _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
37
37
|
arg: arg
|
|
38
38
|
})),
|
|
39
39
|
rerender = _render.rerender;
|
|
40
40
|
var div = _react.screen.getByTestId('div');
|
|
41
41
|
expect(div).toHaveAttribute('data-fromprops', arg);
|
|
42
|
-
rerender(
|
|
42
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
43
43
|
arg: "changed"
|
|
44
44
|
}));
|
|
45
45
|
|
|
@@ -31,23 +31,23 @@ describe('useHandlers', function () {
|
|
|
31
31
|
|
|
32
32
|
// Sanity test for Component moreso than useHandlers test
|
|
33
33
|
test('should include handlers in props', function () {
|
|
34
|
-
(0, _react.render)(
|
|
34
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
35
35
|
var actual = data.handlers.testEvent;
|
|
36
36
|
expect(actual).toBeDefined();
|
|
37
37
|
});
|
|
38
38
|
test('should have the same reference across renders', function () {
|
|
39
|
-
var _render = (0, _react.render)(
|
|
39
|
+
var _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {})),
|
|
40
40
|
rerender = _render.rerender;
|
|
41
41
|
var expected = data.handlers.testEvent;
|
|
42
|
-
rerender(
|
|
42
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
43
43
|
var actual = data.handlers.testEvent;
|
|
44
44
|
expect(actual).toBe(expected);
|
|
45
45
|
});
|
|
46
46
|
test('should receive the event', function () {
|
|
47
47
|
var spy = jest.fn();
|
|
48
|
-
var _render2 = (0, _react.render)(
|
|
48
|
+
var _render2 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {})),
|
|
49
49
|
rerender = _render2.rerender;
|
|
50
|
-
rerender(
|
|
50
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
51
51
|
children: 'updated'
|
|
52
52
|
}));
|
|
53
53
|
data.handlers.testEvent(spy);
|
|
@@ -55,9 +55,9 @@ describe('useHandlers', function () {
|
|
|
55
55
|
});
|
|
56
56
|
test('should reflect the latest props', function () {
|
|
57
57
|
var spy = jest.fn();
|
|
58
|
-
var _render3 = (0, _react.render)(
|
|
58
|
+
var _render3 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {})),
|
|
59
59
|
rerender = _render3.rerender;
|
|
60
|
-
rerender(
|
|
60
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
61
61
|
children: 'updated'
|
|
62
62
|
}));
|
|
63
63
|
data.handlers.testEvent(spy);
|
|
@@ -69,7 +69,7 @@ describe('useHandlers', function () {
|
|
|
69
69
|
});
|
|
70
70
|
test('should support component-driven context', function () {
|
|
71
71
|
var spy = jest.fn();
|
|
72
|
-
(0, _react.render)(
|
|
72
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
73
73
|
data.handlers.testEvent(spy);
|
|
74
74
|
|
|
75
75
|
// defined a "global" context to ease testability but this isn't representative of the
|
|
@@ -82,7 +82,7 @@ describe('useHandlers', function () {
|
|
|
82
82
|
var spy = jest.fn().mockImplementation(function () {
|
|
83
83
|
return 'ok';
|
|
84
84
|
});
|
|
85
|
-
(0, _react.render)(
|
|
85
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
86
86
|
var returnValue = data.handlers.testEvent(spy);
|
|
87
87
|
|
|
88
88
|
// defined a "global" context to ease testability but this isn't representative of the
|
package/util/Job.js
CHANGED
|
@@ -212,12 +212,12 @@ var Job = exports.Job = /*#__PURE__*/function () {
|
|
|
212
212
|
_this.type = 'raf';
|
|
213
213
|
if (typeof window !== 'undefined') {
|
|
214
214
|
var time = null;
|
|
215
|
-
var
|
|
215
|
+
var _callback = function callback(timestamp) {
|
|
216
216
|
if (time === null) {
|
|
217
217
|
time = timestamp;
|
|
218
218
|
}
|
|
219
219
|
if (timeout && timestamp - time < timeout) {
|
|
220
|
-
_this.id = window.requestAnimationFrame(
|
|
220
|
+
_this.id = window.requestAnimationFrame(_callback);
|
|
221
221
|
} else {
|
|
222
222
|
time = null;
|
|
223
223
|
_this.run(args);
|
|
@@ -225,7 +225,7 @@ var Job = exports.Job = /*#__PURE__*/function () {
|
|
|
225
225
|
_this.id = null;
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
|
-
_this.id = window.requestAnimationFrame(
|
|
228
|
+
_this.id = window.requestAnimationFrame(_callback);
|
|
229
229
|
} else {
|
|
230
230
|
// If requestAnimationFrame is not supported just run the function immediately
|
|
231
231
|
_this.run(args);
|
package/util/tests/util-specs.js
CHANGED
|
@@ -66,17 +66,17 @@ describe('util', function () {
|
|
|
66
66
|
});
|
|
67
67
|
test('should return {true} for React.forwardRef', function () {
|
|
68
68
|
var expected = true;
|
|
69
|
-
var view = (0, _util.isRenderable)(
|
|
69
|
+
var view = (0, _util.isRenderable)(/*#__PURE__*/(0, _react.forwardRef)(function () {}));
|
|
70
70
|
expect(view).toEqual(expected);
|
|
71
71
|
});
|
|
72
72
|
test('should return {true} for React.memo', function () {
|
|
73
73
|
var expected = true;
|
|
74
|
-
var view = (0, _util.isRenderable)(
|
|
74
|
+
var view = (0, _util.isRenderable)(/*#__PURE__*/(0, _react.memo)(function () {}));
|
|
75
75
|
expect(view).toEqual(expected);
|
|
76
76
|
});
|
|
77
77
|
test('should return {true} for React.lazy', function () {
|
|
78
78
|
var expected = true;
|
|
79
|
-
var view = (0, _util.isRenderable)(
|
|
79
|
+
var view = (0, _util.isRenderable)(/*#__PURE__*/(0, _react.lazy)(function () {}));
|
|
80
80
|
expect(view).toEqual(expected);
|
|
81
81
|
});
|
|
82
82
|
});
|