@enact/core 3.4.9-experimental-3 → 3.4.9-experimental-7
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 +16 -0
- package/{build/dispatcher → dispatcher}/dispatcher.d.ts +0 -0
- package/dispatcher/dispatcher.js +76 -57
- package/dispatcher/listeners.js +31 -19
- package/dispatcher/tests/dispatcher-specs.js +75 -100
- package/{build/handle → handle}/handle.d.ts +0 -0
- package/handle/handle.js +260 -212
- package/handle/tests/handle-specs.js +476 -601
- package/{build/hoc → hoc}/hoc.d.ts +0 -0
- package/hoc/hoc.js +47 -33
- package/hoc/tests/hoc-specs.js +85 -126
- package/{build/index.d.ts → index.d.ts} +0 -0
- package/index.js +1 -0
- package/{build/internal → internal}/ApiDecorator/ApiDecorator.d.ts +0 -0
- package/internal/ApiDecorator/ApiDecorator.js +107 -61
- package/internal/ApiDecorator/tests/ApiDecorator-specs.js +106 -97
- package/{build/internal → internal}/Registry/Registry.d.ts +0 -0
- package/internal/Registry/Registry.js +68 -51
- package/internal/Registry/tests/Registry-specs.js +201 -143
- package/{build/internal → internal}/deprecate/deprecate.d.ts +0 -0
- package/internal/deprecate/deprecate.js +85 -60
- package/{build/internal → internal}/prop-types/prop-types.d.ts +0 -0
- package/internal/prop-types/prop-types.js +68 -61
- package/{build/keymap → keymap}/index.d.ts +0 -0
- package/keymap/index.js +27 -15
- package/keymap/keymap.js +67 -52
- package/keymap/tests/keymap-specs.js +75 -104
- package/kind/computed.js +29 -16
- package/{build/kind → kind}/kind.d.ts +0 -0
- package/kind/kind.js +150 -114
- package/kind/styles.js +62 -47
- package/kind/tests/computed-specs.js +87 -86
- package/kind/tests/kind-specs.js +216 -214
- package/kind/tests/styles-specs.js +170 -223
- package/kind/util.js +15 -7
- package/package.json +1 -1
- package/{build/platform → platform}/platform.d.ts +0 -0
- package/platform/platform.js +263 -169
- package/platform/tests/platform-specs.js +92 -90
- package/{build/snapshot → snapshot}/snapshot.d.ts +0 -0
- package/snapshot/snapshot.js +34 -27
- package/useChainRefs/tests/useChainRefs-specs.js +46 -30
- package/{build/useChainRefs → useChainRefs}/useChainRefs.d.ts +0 -0
- package/useChainRefs/useChainRefs.js +49 -29
- package/useClass/tests/useClass-specs.js +51 -46
- package/{build/useClass → useClass}/useClass.d.ts +0 -0
- package/useClass/useClass.js +27 -9
- package/useHandlers/Handlers.js +55 -30
- package/useHandlers/tests/useHandlers-specs.js +79 -95
- package/{build/useHandlers → useHandlers}/useHandlers.d.ts +0 -0
- package/useHandlers/useHandlers.js +18 -11
- package/util/Job.js +203 -241
- package/util/tests/Job-specs.js +216 -204
- package/util/tests/util-specs.js +123 -146
- package/{build/util → util}/util.d.ts +0 -0
- package/util/util.js +146 -103
- package/build/CHANGELOG.md +0 -699
- package/build/README.md +0 -33
- package/build/dispatcher/dispatcher.js +0 -160
- package/build/dispatcher/listeners.js +0 -37
- package/build/dispatcher/package.json +0 -3
- package/build/dispatcher/tests/dispatcher-specs.js +0 -75
- package/build/handle/handle.js +0 -846
- package/build/handle/package.json +0 -3
- package/build/handle/tests/handle-specs.js +0 -476
- package/build/hoc/hoc.js +0 -102
- package/build/hoc/package.json +0 -3
- package/build/hoc/tests/hoc-specs.js +0 -90
- package/build/index.js +0 -2
- package/build/internal/ApiDecorator/ApiDecorator.js +0 -143
- package/build/internal/ApiDecorator/package.json +0 -3
- package/build/internal/ApiDecorator/tests/ApiDecorator-specs.js +0 -106
- package/build/internal/Registry/Registry.js +0 -76
- package/build/internal/Registry/package.json +0 -3
- package/build/internal/Registry/tests/Registry-specs.js +0 -201
- package/build/internal/deprecate/deprecate.js +0 -116
- package/build/internal/deprecate/package.json +0 -3
- package/build/internal/prop-types/package.json +0 -3
- package/build/internal/prop-types/prop-types.js +0 -90
- package/build/keymap/index.js +0 -54
- package/build/keymap/keymap.js +0 -201
- package/build/keymap/package.json +0 -3
- package/build/keymap/tests/keymap-specs.js +0 -75
- package/build/kind/computed.js +0 -60
- package/build/kind/kind.js +0 -266
- package/build/kind/package.json +0 -3
- package/build/kind/styles.js +0 -105
- package/build/kind/tests/computed-specs.js +0 -87
- package/build/kind/tests/kind-specs.js +0 -216
- package/build/kind/tests/styles-specs.js +0 -170
- package/build/kind/util.js +0 -17
- package/build/package-lock.json +0 -206
- package/build/package.json +0 -38
- package/build/platform/package.json +0 -3
- package/build/platform/platform.js +0 -306
- package/build/platform/tests/platform-specs.js +0 -92
- package/build/snapshot/package.json +0 -3
- package/build/snapshot/snapshot.js +0 -89
- package/build/useChainRefs/package.json +0 -3
- package/build/useChainRefs/tests/useChainRefs-specs.js +0 -57
- package/build/useChainRefs/useChainRefs.js +0 -78
- package/build/useClass/package.json +0 -3
- package/build/useClass/tests/useClass-specs.js +0 -51
- package/build/useClass/useClass.js +0 -59
- package/build/useHandlers/Handlers.js +0 -55
- package/build/useHandlers/package.json +0 -3
- package/build/useHandlers/tests/useHandlers-specs.js +0 -84
- package/build/useHandlers/useHandlers.js +0 -36
- package/build/util/Job.js +0 -211
- package/build/util/package.json +0 -3
- package/build/util/tests/Job-specs.js +0 -216
- package/build/util/tests/util-specs.js +0 -123
- package/build/util/util.js +0 -322
|
@@ -1,223 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
expect(actual).toBe(expected);
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
test('should join classes together with a space', () => {
|
|
175
|
-
const updated = styles({}, {});
|
|
176
|
-
|
|
177
|
-
const expected = 'abc def';
|
|
178
|
-
const actual = updated.styler.join('abc', 'def');
|
|
179
|
-
|
|
180
|
-
expect(actual).toBe(expected);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
test('should resolve join classes to css map', () => {
|
|
184
|
-
const updated = styles({css}, {});
|
|
185
|
-
|
|
186
|
-
const expected = css.button + ' ' + css.client;
|
|
187
|
-
const actual = updated.styler.join('button', 'client');
|
|
188
|
-
|
|
189
|
-
expect(actual).toBe(expected);
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
test('should not resolve author classes to css map', () => {
|
|
193
|
-
const cfg = {
|
|
194
|
-
css,
|
|
195
|
-
className: 'button'
|
|
196
|
-
};
|
|
197
|
-
const props = {
|
|
198
|
-
className: 'button'
|
|
199
|
-
};
|
|
200
|
-
const updated = styles(cfg, props);
|
|
201
|
-
|
|
202
|
-
const expected = css.button + ' button';
|
|
203
|
-
const actual = updated.className;
|
|
204
|
-
|
|
205
|
-
expect(actual).toBe(expected);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
test('should append resolved class names to props.className', () => {
|
|
209
|
-
const cfg = {
|
|
210
|
-
css,
|
|
211
|
-
className: 'button'
|
|
212
|
-
};
|
|
213
|
-
const props = {
|
|
214
|
-
className: 'button'
|
|
215
|
-
};
|
|
216
|
-
const updated = styles(cfg, props);
|
|
217
|
-
|
|
218
|
-
const expected = css.button + ' button ' + css.client;
|
|
219
|
-
const actual = updated.styler.append('client');
|
|
220
|
-
|
|
221
|
-
expect(actual).toBe(expected);
|
|
222
|
-
});
|
|
223
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _styles = _interopRequireDefault(require("../styles"));
|
|
4
|
+
|
|
5
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
6
|
+
|
|
7
|
+
describe('styles', function () {
|
|
8
|
+
var css = {
|
|
9
|
+
button: 'unambiguous-button-class-name',
|
|
10
|
+
client: 'unambiguous-button-class-name-client'
|
|
11
|
+
}; // className tests
|
|
12
|
+
|
|
13
|
+
test('should add cfg.className to props', function () {
|
|
14
|
+
var cfg = {
|
|
15
|
+
className: 'button'
|
|
16
|
+
};
|
|
17
|
+
var updated = (0, _styles["default"])(cfg, {});
|
|
18
|
+
var expected = cfg.className;
|
|
19
|
+
var actual = updated.className;
|
|
20
|
+
expect(actual).toBe(expected);
|
|
21
|
+
});
|
|
22
|
+
test('should resolve cfg.className to the cfg.css map', function () {
|
|
23
|
+
var cfg = {
|
|
24
|
+
css: css,
|
|
25
|
+
className: 'button'
|
|
26
|
+
};
|
|
27
|
+
var updated = (0, _styles["default"])(cfg, {});
|
|
28
|
+
var expected = css.button;
|
|
29
|
+
var actual = updated.className;
|
|
30
|
+
expect(actual).toBe(expected);
|
|
31
|
+
});
|
|
32
|
+
test('should pass through props.className when cfg.className absent', function () {
|
|
33
|
+
var props = {
|
|
34
|
+
className: 'button'
|
|
35
|
+
};
|
|
36
|
+
var updated = (0, _styles["default"])({}, props);
|
|
37
|
+
var expected = props.className;
|
|
38
|
+
var actual = updated.className;
|
|
39
|
+
expect(actual).toBe(expected);
|
|
40
|
+
});
|
|
41
|
+
test('should append cfg.className with props.className', function () {
|
|
42
|
+
var props = {
|
|
43
|
+
className: 'custom-button'
|
|
44
|
+
};
|
|
45
|
+
var cfg = {
|
|
46
|
+
className: 'button'
|
|
47
|
+
};
|
|
48
|
+
var updated = (0, _styles["default"])(cfg, props);
|
|
49
|
+
var expected = props.className;
|
|
50
|
+
var actual = updated.className;
|
|
51
|
+
expect(actual).toBe(expected);
|
|
52
|
+
});
|
|
53
|
+
test('should resolve cfg.className and append with props.className', function () {
|
|
54
|
+
var props = {
|
|
55
|
+
className: 'custom-button'
|
|
56
|
+
};
|
|
57
|
+
var cfg = {
|
|
58
|
+
css: css,
|
|
59
|
+
className: 'button'
|
|
60
|
+
};
|
|
61
|
+
var updated = (0, _styles["default"])(cfg, props);
|
|
62
|
+
var expected = props.className;
|
|
63
|
+
var actual = updated.className;
|
|
64
|
+
expect(actual).toBe(expected);
|
|
65
|
+
}); // style tests
|
|
66
|
+
|
|
67
|
+
test('should add cfg.style to props', function () {
|
|
68
|
+
var cfg = {
|
|
69
|
+
style: {
|
|
70
|
+
color: 'green'
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var updated = (0, _styles["default"])(cfg, {});
|
|
74
|
+
var expected = cfg.style.color;
|
|
75
|
+
var actual = updated.style.color;
|
|
76
|
+
expect(actual).toBe(expected);
|
|
77
|
+
});
|
|
78
|
+
test('should pass through props.style when cfg.style absent', function () {
|
|
79
|
+
var props = {
|
|
80
|
+
style: {
|
|
81
|
+
color: 'green'
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
var updated = (0, _styles["default"])({}, props);
|
|
85
|
+
var expected = props.style.color;
|
|
86
|
+
var actual = updated.style.color;
|
|
87
|
+
expect(actual).toBe(expected);
|
|
88
|
+
});
|
|
89
|
+
test('should merge cfg.style and props.style', function () {
|
|
90
|
+
var props = {
|
|
91
|
+
style: {
|
|
92
|
+
color: 'green'
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var cfg = {
|
|
96
|
+
style: {
|
|
97
|
+
border: '1px solid black'
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var updated = (0, _styles["default"])(cfg, props);
|
|
101
|
+
var expected = 2;
|
|
102
|
+
var actual = Object.keys(updated.style).length;
|
|
103
|
+
expect(actual).toBe(expected);
|
|
104
|
+
}); // Doesn't support merging shorthand properties and individual properties
|
|
105
|
+
// e.g. borderWidth: 3px + border: 1px solid black = border: 3px solid black
|
|
106
|
+
|
|
107
|
+
test('should not merge shorthand properties', function () {
|
|
108
|
+
var props = {
|
|
109
|
+
style: {
|
|
110
|
+
borderWidth: '3px'
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
var cfg = {
|
|
114
|
+
style: {
|
|
115
|
+
border: '1px solid black'
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
var updated = (0, _styles["default"])(cfg, props);
|
|
119
|
+
var expected = 1;
|
|
120
|
+
var actual = Object.keys(updated.style).length;
|
|
121
|
+
expect(actual).not.toBe(expected);
|
|
122
|
+
}); // styler tests
|
|
123
|
+
|
|
124
|
+
test('should add styler.join() to props', function () {
|
|
125
|
+
var updated = (0, _styles["default"])({}, {});
|
|
126
|
+
var expected = 'function';
|
|
127
|
+
var actual = typeof updated.styler.join;
|
|
128
|
+
expect(actual).toBe(expected);
|
|
129
|
+
});
|
|
130
|
+
test('should join classes together with a space', function () {
|
|
131
|
+
var updated = (0, _styles["default"])({}, {});
|
|
132
|
+
var expected = 'abc def';
|
|
133
|
+
var actual = updated.styler.join('abc', 'def');
|
|
134
|
+
expect(actual).toBe(expected);
|
|
135
|
+
});
|
|
136
|
+
test('should resolve join classes to css map', function () {
|
|
137
|
+
var updated = (0, _styles["default"])({
|
|
138
|
+
css: css
|
|
139
|
+
}, {});
|
|
140
|
+
var expected = css.button + ' ' + css.client;
|
|
141
|
+
var actual = updated.styler.join('button', 'client');
|
|
142
|
+
expect(actual).toBe(expected);
|
|
143
|
+
});
|
|
144
|
+
test('should not resolve author classes to css map', function () {
|
|
145
|
+
var cfg = {
|
|
146
|
+
css: css,
|
|
147
|
+
className: 'button'
|
|
148
|
+
};
|
|
149
|
+
var props = {
|
|
150
|
+
className: 'button'
|
|
151
|
+
};
|
|
152
|
+
var updated = (0, _styles["default"])(cfg, props);
|
|
153
|
+
var expected = css.button + ' button';
|
|
154
|
+
var actual = updated.className;
|
|
155
|
+
expect(actual).toBe(expected);
|
|
156
|
+
});
|
|
157
|
+
test('should append resolved class names to props.className', function () {
|
|
158
|
+
var cfg = {
|
|
159
|
+
css: css,
|
|
160
|
+
className: 'button'
|
|
161
|
+
};
|
|
162
|
+
var props = {
|
|
163
|
+
className: 'button'
|
|
164
|
+
};
|
|
165
|
+
var updated = (0, _styles["default"])(cfg, props);
|
|
166
|
+
var expected = css.button + ' button ' + css.client;
|
|
167
|
+
var actual = updated.styler.append('client');
|
|
168
|
+
expect(actual).toBe(expected);
|
|
169
|
+
});
|
|
170
|
+
});
|
package/kind/util.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(props, name, {
|
|
3
|
-
value,
|
|
4
|
-
enumerable: false,
|
|
5
|
-
writable: true
|
|
6
|
-
});
|
|
1
|
+
"use strict";
|
|
7
2
|
|
|
8
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addInternalProp = void 0;
|
|
7
|
+
|
|
8
|
+
var addInternalProp = function addInternalProp(props, name, value) {
|
|
9
|
+
Object.defineProperty(props, name, {
|
|
10
|
+
value: value,
|
|
11
|
+
enumerable: false,
|
|
12
|
+
writable: true
|
|
13
|
+
});
|
|
14
|
+
return props;
|
|
9
15
|
};
|
|
16
|
+
|
|
17
|
+
exports.addInternalProp = addInternalProp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/core",
|
|
3
|
-
"version": "3.4.9-experimental-
|
|
3
|
+
"version": "3.4.9-experimental-7",
|
|
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
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
File without changes
|