@fluentui/react-jsx-runtime 9.0.0-alpha.1 → 9.0.0-alpha.10
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.json +199 -1
- package/CHANGELOG.md +87 -2
- package/lib/createElement.js +9 -23
- package/lib/createElement.js.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/createElement.js +10 -21
- package/lib-commonjs/createElement.js.map +1 -1
- package/lib-commonjs/index.js +0 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +5 -4
- package/.swcrc +0 -30
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,205 @@
|
|
|
2
2
|
"name": "@fluentui/react-jsx-runtime",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Mon,
|
|
5
|
+
"date": "Mon, 03 Jul 2023 11:54:01 GMT",
|
|
6
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.10",
|
|
7
|
+
"version": "9.0.0-alpha.10",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
13
|
+
"comment": "Bump @fluentui/react-utilities to v9.10.1",
|
|
14
|
+
"commit": "e7a838bfd1ce4b077d265295fcbef8dc2177e724"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Wed, 28 Jun 2023 11:12:27 GMT",
|
|
21
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.9",
|
|
22
|
+
"version": "9.0.0-alpha.9",
|
|
23
|
+
"comments": {
|
|
24
|
+
"none": [
|
|
25
|
+
{
|
|
26
|
+
"author": "martinhochel@microsoft.com",
|
|
27
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
28
|
+
"commit": "fbe878e9c9785588197481f172c42c2c0a230292",
|
|
29
|
+
"comment": "fix: update .npmignore to unify v8 packages and exclude project.json"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"prerelease": [
|
|
33
|
+
{
|
|
34
|
+
"author": "beachball",
|
|
35
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
36
|
+
"comment": "Bump @fluentui/react-utilities to v9.10.0",
|
|
37
|
+
"commit": "08de131d5f3346e001dcd8d2f0f3809c698f16d7"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"date": "Mon, 26 Jun 2023 09:53:55 GMT",
|
|
44
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.8",
|
|
45
|
+
"version": "9.0.0-alpha.8",
|
|
46
|
+
"comments": {
|
|
47
|
+
"prerelease": [
|
|
48
|
+
{
|
|
49
|
+
"author": "beachball",
|
|
50
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
51
|
+
"comment": "Bump @fluentui/react-utilities to v9.9.4",
|
|
52
|
+
"commit": "3e47257676ace0598b9ed336a54befd4d063c332"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"date": "Tue, 20 Jun 2023 12:39:07 GMT",
|
|
59
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.7",
|
|
60
|
+
"version": "9.0.0-alpha.7",
|
|
61
|
+
"comments": {
|
|
62
|
+
"prerelease": [
|
|
63
|
+
{
|
|
64
|
+
"author": "beachball",
|
|
65
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
66
|
+
"comment": "Bump @fluentui/react-utilities to v9.9.3",
|
|
67
|
+
"commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"author": "beachball",
|
|
71
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
72
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.23",
|
|
73
|
+
"commit": "81c9b35e0830297b2aca2cece2ae67b3899c4647"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"date": "Wed, 31 May 2023 06:46:23 GMT",
|
|
80
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.6",
|
|
81
|
+
"version": "9.0.0-alpha.6",
|
|
82
|
+
"comments": {
|
|
83
|
+
"prerelease": [
|
|
84
|
+
{
|
|
85
|
+
"author": "beachball",
|
|
86
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
87
|
+
"comment": "Bump @fluentui/react-utilities to v9.9.2",
|
|
88
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"author": "beachball",
|
|
92
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
93
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22",
|
|
94
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"date": "Thu, 25 May 2023 10:00:48 GMT",
|
|
101
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.5",
|
|
102
|
+
"version": "9.0.0-alpha.5",
|
|
103
|
+
"comments": {
|
|
104
|
+
"prerelease": [
|
|
105
|
+
{
|
|
106
|
+
"author": "beachball",
|
|
107
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
108
|
+
"comment": "Bump @fluentui/react-utilities to v9.9.1",
|
|
109
|
+
"commit": "8f7c1b7591b3e665ae39e1b22ab0f0b28fb795c4"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"date": "Wed, 24 May 2023 20:45:28 GMT",
|
|
116
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.4",
|
|
117
|
+
"version": "9.0.0-alpha.4",
|
|
118
|
+
"comments": {
|
|
119
|
+
"none": [
|
|
120
|
+
{
|
|
121
|
+
"author": "olfedias@microsoft.com",
|
|
122
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
123
|
+
"commit": "69e0617a93cb44ef42f3bd19284b7dc5fe27fed3",
|
|
124
|
+
"comment": "chore: update test-ssr script"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"date": "Thu, 18 May 2023 00:39:08 GMT",
|
|
131
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.4",
|
|
132
|
+
"version": "9.0.0-alpha.4",
|
|
133
|
+
"comments": {
|
|
134
|
+
"none": [
|
|
135
|
+
{
|
|
136
|
+
"author": "olfedias@microsoft.com",
|
|
137
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
138
|
+
"commit": "06cd515eda59a3078bfe32f9cc7c1f281cd20208",
|
|
139
|
+
"comment": "chore: add test-ssr script to v9 packages"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"prerelease": [
|
|
143
|
+
{
|
|
144
|
+
"author": "beachball",
|
|
145
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
146
|
+
"comment": "Bump @fluentui/react-utilities to v9.9.0",
|
|
147
|
+
"commit": "c496a1cf1ec82c08753df72c9061e84b77b7daeb"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"date": "Fri, 12 May 2023 20:27:23 GMT",
|
|
154
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.3",
|
|
155
|
+
"version": "9.0.0-alpha.3",
|
|
156
|
+
"comments": {
|
|
157
|
+
"prerelease": [
|
|
158
|
+
{
|
|
159
|
+
"author": "olfedias@microsoft.com",
|
|
160
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
161
|
+
"commit": "c28decb23d191a0daaaf6d5d1832429715102129",
|
|
162
|
+
"comment": "chore: exclude .swcrc from being published"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"author": "beachball",
|
|
166
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
167
|
+
"comment": "Bump @fluentui/react-utilities to v9.8.1",
|
|
168
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"author": "beachball",
|
|
172
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
173
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.21",
|
|
174
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"none": [
|
|
178
|
+
{
|
|
179
|
+
"author": "martinhochel@microsoft.com",
|
|
180
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
181
|
+
"commit": "dbda7fa69e3000aaf8dd4a061e254ebd35198b8e",
|
|
182
|
+
"comment": "fix: update npmignore files to fix npm8/node16 regression how npm publish works"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"date": "Mon, 24 Apr 2023 08:12:37 GMT",
|
|
189
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.2",
|
|
190
|
+
"version": "9.0.0-alpha.2",
|
|
191
|
+
"comments": {
|
|
192
|
+
"prerelease": [
|
|
193
|
+
{
|
|
194
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
195
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
196
|
+
"commit": "391878bf4d8a8210a8279a6ced8bf9a64daf4c64",
|
|
197
|
+
"comment": "chore: simplify createElement method"
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"date": "Mon, 17 Apr 2023 17:53:51 GMT",
|
|
6
204
|
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.1",
|
|
7
205
|
"version": "9.0.0-alpha.1",
|
|
8
206
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,97 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-jsx-runtime
|
|
2
2
|
|
|
3
|
-
This log was last generated on Mon,
|
|
3
|
+
This log was last generated on Mon, 03 Jul 2023 11:54:01 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-alpha.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.10)
|
|
8
|
+
|
|
9
|
+
Mon, 03 Jul 2023 11:54:01 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.9..@fluentui/react-jsx-runtime_v9.0.0-alpha.10)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-utilities to v9.10.1 ([PR #28399](https://github.com/microsoft/fluentui/pull/28399) by beachball)
|
|
15
|
+
|
|
16
|
+
## [9.0.0-alpha.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.9)
|
|
17
|
+
|
|
18
|
+
Wed, 28 Jun 2023 11:12:27 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.8..@fluentui/react-jsx-runtime_v9.0.0-alpha.9)
|
|
20
|
+
|
|
21
|
+
### Changes
|
|
22
|
+
|
|
23
|
+
- Bump @fluentui/react-utilities to v9.10.0 ([PR #28320](https://github.com/microsoft/fluentui/pull/28320) by beachball)
|
|
24
|
+
|
|
25
|
+
## [9.0.0-alpha.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.8)
|
|
26
|
+
|
|
27
|
+
Mon, 26 Jun 2023 09:53:55 GMT
|
|
28
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.7..@fluentui/react-jsx-runtime_v9.0.0-alpha.8)
|
|
29
|
+
|
|
30
|
+
### Changes
|
|
31
|
+
|
|
32
|
+
- Bump @fluentui/react-utilities to v9.9.4 ([PR #28296](https://github.com/microsoft/fluentui/pull/28296) by beachball)
|
|
33
|
+
|
|
34
|
+
## [9.0.0-alpha.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.7)
|
|
35
|
+
|
|
36
|
+
Tue, 20 Jun 2023 12:39:07 GMT
|
|
37
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.6..@fluentui/react-jsx-runtime_v9.0.0-alpha.7)
|
|
38
|
+
|
|
39
|
+
### Changes
|
|
40
|
+
|
|
41
|
+
- Bump @fluentui/react-utilities to v9.9.3 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
|
|
42
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.23 ([PR #28229](https://github.com/microsoft/fluentui/pull/28229) by beachball)
|
|
43
|
+
|
|
44
|
+
## [9.0.0-alpha.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.6)
|
|
45
|
+
|
|
46
|
+
Wed, 31 May 2023 06:46:23 GMT
|
|
47
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.5..@fluentui/react-jsx-runtime_v9.0.0-alpha.6)
|
|
48
|
+
|
|
49
|
+
### Changes
|
|
50
|
+
|
|
51
|
+
- Bump @fluentui/react-utilities to v9.9.2 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
|
52
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
|
53
|
+
|
|
54
|
+
## [9.0.0-alpha.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.5)
|
|
55
|
+
|
|
56
|
+
Thu, 25 May 2023 10:00:48 GMT
|
|
57
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.4..@fluentui/react-jsx-runtime_v9.0.0-alpha.5)
|
|
58
|
+
|
|
59
|
+
### Changes
|
|
60
|
+
|
|
61
|
+
- Bump @fluentui/react-utilities to v9.9.1 ([PR #27988](https://github.com/microsoft/fluentui/pull/27988) by beachball)
|
|
62
|
+
|
|
63
|
+
## [9.0.0-alpha.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.4)
|
|
64
|
+
|
|
65
|
+
Thu, 18 May 2023 00:39:08 GMT
|
|
66
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.3..@fluentui/react-jsx-runtime_v9.0.0-alpha.4)
|
|
67
|
+
|
|
68
|
+
### Changes
|
|
69
|
+
|
|
70
|
+
- Bump @fluentui/react-utilities to v9.9.0 ([PR #27834](https://github.com/microsoft/fluentui/pull/27834) by beachball)
|
|
71
|
+
|
|
72
|
+
## [9.0.0-alpha.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.3)
|
|
73
|
+
|
|
74
|
+
Fri, 12 May 2023 20:27:23 GMT
|
|
75
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.2..@fluentui/react-jsx-runtime_v9.0.0-alpha.3)
|
|
76
|
+
|
|
77
|
+
### Changes
|
|
78
|
+
|
|
79
|
+
- chore: exclude .swcrc from being published ([PR #27740](https://github.com/microsoft/fluentui/pull/27740) by olfedias@microsoft.com)
|
|
80
|
+
- Bump @fluentui/react-utilities to v9.8.1 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
81
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.21 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
|
82
|
+
|
|
83
|
+
## [9.0.0-alpha.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.2)
|
|
84
|
+
|
|
85
|
+
Mon, 24 Apr 2023 08:12:37 GMT
|
|
86
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.1..@fluentui/react-jsx-runtime_v9.0.0-alpha.2)
|
|
87
|
+
|
|
88
|
+
### Changes
|
|
89
|
+
|
|
90
|
+
- chore: simplify createElement method ([PR #27573](https://github.com/microsoft/fluentui/pull/27573) by bernardo.sunderhus@gmail.com)
|
|
91
|
+
|
|
7
92
|
## [9.0.0-alpha.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.1)
|
|
8
93
|
|
|
9
|
-
Mon, 17 Apr 2023 17:
|
|
94
|
+
Mon, 17 Apr 2023 17:53:51 GMT
|
|
10
95
|
|
|
11
96
|
### Changes
|
|
12
97
|
|
package/lib/createElement.js
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';
|
|
3
3
|
export function createElement(type, props, ...children) {
|
|
4
|
-
|
|
5
|
-
return /*#__PURE__*/React.createElement(type, props, ...children);
|
|
6
|
-
}
|
|
7
|
-
const result = normalizeRenderFunction(props, children);
|
|
8
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {}, result.renderFunction(type, {
|
|
9
|
-
...result.props,
|
|
10
|
-
children: result.children
|
|
11
|
-
}));
|
|
4
|
+
return hasRenderFunction(props) ? createElementFromRenderFunction(type, props, children) : React.createElement(type, props, ...children);
|
|
12
5
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const children = Array.isArray(overrideChildren) && overrideChildren.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, {}, ...overrideChildren) : externalChildren;
|
|
20
|
-
return {
|
|
21
|
-
children,
|
|
22
|
-
renderFunction,
|
|
23
|
-
props: props
|
|
24
|
-
};
|
|
6
|
+
function createElementFromRenderFunction(type, props, overrideChildren) {
|
|
7
|
+
const { [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...renderProps } = props;
|
|
8
|
+
if (overrideChildren.length > 0) {
|
|
9
|
+
renderProps.children = React.createElement(React.Fragment, {}, ...overrideChildren);
|
|
10
|
+
}
|
|
11
|
+
return React.createElement(React.Fragment, {}, renderFunction(type, renderProps));
|
|
25
12
|
}
|
|
26
|
-
export function
|
|
27
|
-
|
|
13
|
+
export function hasRenderFunction(props) {
|
|
14
|
+
return Boolean(props === null || props === void 0 ? void 0 : props.hasOwnProperty(SLOT_RENDER_FUNCTION_SYMBOL));
|
|
28
15
|
}
|
|
29
|
-
//# sourceMappingURL=createElement.js.map
|
package/lib/createElement.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["createElement.ts"],"sourcesContent":["import * as React from 'react';\nimport { SlotRenderFunction, UnknownSlotProps, SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';\n\ntype WithMetadata<Props extends {}> = Props & {\n [SLOT_RENDER_FUNCTION_SYMBOL]: SlotRenderFunction<Props>;\n};\n\nexport function createElement<P extends {}>(\n type: React.ElementType<P>,\n props?: P | null,\n ...children: React.ReactNode[]\n): React.ReactElement<P> | null {\n return hasRenderFunction(props)\n ? createElementFromRenderFunction(type, props, children)\n : React.createElement(type, props, ...children);\n}\n\nfunction createElementFromRenderFunction<P extends UnknownSlotProps>(\n type: React.ElementType<P>,\n props: WithMetadata<P>,\n overrideChildren: React.ReactNode[],\n): React.ReactElement<P> | null {\n const { [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction, ...renderProps } = props;\n\n if (overrideChildren.length > 0) {\n renderProps.children = React.createElement(React.Fragment, {}, ...overrideChildren);\n }\n\n return React.createElement(\n React.Fragment,\n {},\n renderFunction(type, renderProps as UnknownSlotProps as P),\n ) as React.ReactElement<P>;\n}\n\nexport function hasRenderFunction<Props extends {}>(props?: Props | null): props is WithMetadata<Props> {\n return Boolean(props?.hasOwnProperty(SLOT_RENDER_FUNCTION_SYMBOL));\n}\n"],"names":["React","SLOT_RENDER_FUNCTION_SYMBOL","createElement","type","props","children","hasRenderFunction","createElementFromRenderFunction","overrideChildren","renderFunction","renderProps","length","Fragment","Boolean","hasOwnProperty"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAA+CC,2BAA2B,QAAQ,4BAA4B;AAM9G,OAAO,SAASC,cACdC,IAA0B,EAC1BC,KAAgB,EAChB,GAAGC,QAA2B,EACA;IAC9B,OAAOC,kBAAkBF,SACrBG,gCAAgCJ,MAAMC,OAAOC,YAC7CL,MAAME,aAAa,CAACC,MAAMC,UAAUC,SAAS;AACnD,CAAC;AAED,SAASE,gCACPJ,IAA0B,EAC1BC,KAAsB,EACtBI,gBAAmC,EACL;IAC9B,MAAM,EAAE,CAACP,4BAA4B,EAAEQ,eAAc,EAAE,GAAGC,aAAa,GAAGN;IAE1E,IAAII,iBAAiBG,MAAM,GAAG,GAAG;QAC/BD,YAAYL,QAAQ,GAAGL,MAAME,aAAa,CAACF,MAAMY,QAAQ,EAAE,CAAC,MAAMJ;IACpE,CAAC;IAED,OAAOR,MAAME,aAAa,CACxBF,MAAMY,QAAQ,EACd,CAAC,GACDH,eAAeN,MAAMO;AAEzB;AAEA,OAAO,SAASJ,kBAAoCF,KAAoB,EAAgC;IACtG,OAAOS,QAAQT,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOU,cAAc,CAACb;AACvC,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { createElement } from './createElement';\nexport { Fragment } from 'react';\n"],"names":["createElement","Fragment"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAChD,SAASC,QAAQ,QAAQ,QAAQ"}
|
|
@@ -10,32 +10,21 @@ function _export(target, all) {
|
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
12
|
createElement: ()=>createElement,
|
|
13
|
-
|
|
13
|
+
hasRenderFunction: ()=>hasRenderFunction
|
|
14
14
|
});
|
|
15
15
|
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
16
16
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
17
17
|
const _reactUtilities = require("@fluentui/react-utilities");
|
|
18
18
|
function createElement(type, props, ...children) {
|
|
19
|
-
|
|
20
|
-
return /*#__PURE__*/ _react.createElement(type, props, ...children);
|
|
21
|
-
}
|
|
22
|
-
const result = normalizeRenderFunction(props, children);
|
|
23
|
-
return /*#__PURE__*/ _react.createElement(_react.Fragment, {}, result.renderFunction(type, {
|
|
24
|
-
...result.props,
|
|
25
|
-
children: result.children
|
|
26
|
-
}));
|
|
19
|
+
return hasRenderFunction(props) ? createElementFromRenderFunction(type, props, children) : /*#__PURE__*/ _react.createElement(type, props, ...children);
|
|
27
20
|
}
|
|
28
|
-
function
|
|
29
|
-
const { [_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction ,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
props: props
|
|
35
|
-
};
|
|
21
|
+
function createElementFromRenderFunction(type, props, overrideChildren) {
|
|
22
|
+
const { [_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...renderProps } = props;
|
|
23
|
+
if (overrideChildren.length > 0) {
|
|
24
|
+
renderProps.children = /*#__PURE__*/ _react.createElement(_react.Fragment, {}, ...overrideChildren);
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/ _react.createElement(_react.Fragment, {}, renderFunction(type, renderProps));
|
|
36
27
|
}
|
|
37
|
-
function
|
|
28
|
+
function hasRenderFunction(props) {
|
|
38
29
|
return Boolean(props === null || props === void 0 ? void 0 : props.hasOwnProperty(_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=createElement.js.map
|
|
30
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["createElement.js"],"sourcesContent":["import * as React from 'react';\nimport { SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';\nexport function createElement(type, props, ...children) {\n return hasRenderFunction(props) ? createElementFromRenderFunction(type, props, children) : React.createElement(type, props, ...children);\n}\nfunction createElementFromRenderFunction(type, props, overrideChildren) {\n const { [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...renderProps } = props;\n if (overrideChildren.length > 0) {\n renderProps.children = React.createElement(React.Fragment, {}, ...overrideChildren);\n }\n return React.createElement(React.Fragment, {}, renderFunction(type, renderProps));\n}\nexport function hasRenderFunction(props) {\n return Boolean(props === null || props === void 0 ? void 0 : props.hasOwnProperty(SLOT_RENDER_FUNCTION_SYMBOL));\n}\n"],"names":["createElement","hasRenderFunction","type","props","children","createElementFromRenderFunction","React","overrideChildren","SLOT_RENDER_FUNCTION_SYMBOL","renderFunction","renderProps","length","Fragment","Boolean","hasOwnProperty"],"mappings":";;;;;;;;;;;IAEgBA,aAAa,MAAbA;IAUAC,iBAAiB,MAAjBA;;;6DAZO;gCACqB;AACrC,SAASD,cAAcE,IAAI,EAAEC,KAAK,EAAE,GAAGC,QAAQ,EAAE;IACpD,OAAOH,kBAAkBE,SAASE,gCAAgCH,MAAMC,OAAOC,0BAAYE,OAAMN,aAAa,CAACE,MAAMC,UAAUC,SAAS;AAC5I;AACA,SAASC,gCAAgCH,IAAI,EAAEC,KAAK,EAAEI,gBAAgB,EAAE;IACpE,MAAM,EAAE,CAACC,2CAA2B,CAAC,EAAEC,eAAc,EAAG,GAAGC,aAAa,GAAGP;IAC3E,IAAII,iBAAiBI,MAAM,GAAG,GAAG;QAC7BD,YAAYN,QAAQ,iBAAGE,OAAMN,aAAa,CAACM,OAAMM,QAAQ,EAAE,CAAC,MAAML;IACtE,CAAC;IACD,qBAAOD,OAAMN,aAAa,CAACM,OAAMM,QAAQ,EAAE,CAAC,GAAGH,eAAeP,MAAMQ;AACxE;AACO,SAAST,kBAAkBE,KAAK,EAAE;IACrC,OAAOU,QAAQV,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMW,cAAc,CAACN,2CAA2B,CAAC;AAClH"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { createElement } from './createElement';\nexport { Fragment } from 'react';\n"],"names":["createElement","Fragment"],"mappings":";;;;;;;;;;;IAASA,aAAa,MAAbA,4BAAa;IACbC,QAAQ,MAARA,eAAQ;;+BADa;uBACL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-jsx-runtime",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.10",
|
|
4
4
|
"description": "React components for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -19,17 +19,18 @@
|
|
|
19
19
|
"lint": "just-scripts lint",
|
|
20
20
|
"test": "jest --passWithNoTests",
|
|
21
21
|
"type-check": "tsc -b tsconfig.json",
|
|
22
|
-
"generate-api": "just-scripts generate-api"
|
|
22
|
+
"generate-api": "just-scripts generate-api",
|
|
23
|
+
"test-ssr": "test-ssr \"./stories/**/*.stories.tsx\""
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@fluentui/eslint-plugin": "*",
|
|
26
27
|
"@fluentui/react-conformance": "*",
|
|
27
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
28
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.23",
|
|
28
29
|
"@fluentui/scripts-api-extractor": "*",
|
|
29
30
|
"@fluentui/scripts-tasks": "*"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@fluentui/react-utilities": "^9.
|
|
33
|
+
"@fluentui/react-utilities": "^9.10.1",
|
|
33
34
|
"@swc/helpers": "^0.4.14"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
package/.swcrc
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/swcrc",
|
|
3
|
-
"exclude": [
|
|
4
|
-
"/testing",
|
|
5
|
-
"/**/*.cy.ts",
|
|
6
|
-
"/**/*.cy.tsx",
|
|
7
|
-
"/**/*.spec.ts",
|
|
8
|
-
"/**/*.spec.tsx",
|
|
9
|
-
"/**/*.test.ts",
|
|
10
|
-
"/**/*.test.tsx"
|
|
11
|
-
],
|
|
12
|
-
"jsc": {
|
|
13
|
-
"parser": {
|
|
14
|
-
"syntax": "typescript",
|
|
15
|
-
"tsx": true,
|
|
16
|
-
"decorators": false,
|
|
17
|
-
"dynamicImport": false
|
|
18
|
-
},
|
|
19
|
-
"externalHelpers": true,
|
|
20
|
-
"transform": {
|
|
21
|
-
"react": {
|
|
22
|
-
"runtime": "classic",
|
|
23
|
-
"useSpread": true
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"target": "es2019"
|
|
27
|
-
},
|
|
28
|
-
"minify": false,
|
|
29
|
-
"sourceMaps": true
|
|
30
|
-
}
|