@fluentui/react-jsx-runtime 9.0.0-alpha.11 → 9.0.0-alpha.13
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 +37 -1
- package/CHANGELOG.md +12 -2
- package/lib/createElement.js +27 -10
- package/lib/createElement.js.map +1 -1
- package/lib-commonjs/createElement.js +29 -18
- package/lib-commonjs/createElement.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@fluentui/react-jsx-runtime",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 04 Aug 2023 08:48:21 GMT",
|
|
6
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.13",
|
|
7
|
+
"version": "9.0.0-alpha.13",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
13
|
+
"commit": "6a8afe2b7becaf1b10cbc9ae98b39d352b8c7026",
|
|
14
|
+
"comment": "chore: update createElement to support new slot methods"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
19
|
+
"comment": "Bump @fluentui/react-utilities to v9.11.0",
|
|
20
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Thu, 13 Jul 2023 21:25:42 GMT",
|
|
27
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.11",
|
|
28
|
+
"version": "9.0.0-alpha.11",
|
|
29
|
+
"comments": {
|
|
30
|
+
"none": [
|
|
31
|
+
{
|
|
32
|
+
"author": "martinhochel@microsoft.com",
|
|
33
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
34
|
+
"commit": "8a9e1018f2abb2c7608c49d32acf44e93c43cba6",
|
|
35
|
+
"comment": "chore: update devDependencies to use * for inner workspace dependencies"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Tue, 11 Jul 2023 18:46:36 GMT",
|
|
6
42
|
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.11",
|
|
7
43
|
"version": "9.0.0-alpha.11",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-jsx-runtime
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 04 Aug 2023 08:48:21 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-alpha.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.13)
|
|
8
|
+
|
|
9
|
+
Fri, 04 Aug 2023 08:48:21 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.11..@fluentui/react-jsx-runtime_v9.0.0-alpha.13)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- chore: update createElement to support new slot methods ([PR #28373](https://github.com/microsoft/fluentui/pull/28373) by bernardo.sunderhus@gmail.com)
|
|
15
|
+
- Bump @fluentui/react-utilities to v9.11.0 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
|
16
|
+
|
|
7
17
|
## [9.0.0-alpha.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.11)
|
|
8
18
|
|
|
9
|
-
Tue, 11 Jul 2023 18:
|
|
19
|
+
Tue, 11 Jul 2023 18:46:36 GMT
|
|
10
20
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.10..@fluentui/react-jsx-runtime_v9.0.0-alpha.11)
|
|
11
21
|
|
|
12
22
|
### Changes
|
package/lib/createElement.js
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';
|
|
2
|
+
import { isSlot, SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';
|
|
3
3
|
export function createElement(type, props, ...children) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
// TODO:
|
|
5
|
+
// this is for backwards compatibility with getSlotsNext
|
|
6
|
+
// it should be removed once getSlotsNext is obsolete
|
|
7
|
+
if (isSlot(props)) {
|
|
8
|
+
return createElementFromSlotComponent({
|
|
9
|
+
...props,
|
|
10
|
+
[SLOT_ELEMENT_TYPE_SYMBOL]: type
|
|
11
|
+
}, children);
|
|
12
|
+
}
|
|
13
|
+
if (isSlot(type)) {
|
|
14
|
+
return createElementFromSlotComponent(type, children);
|
|
10
15
|
}
|
|
11
|
-
return React.createElement(
|
|
16
|
+
return React.createElement(type, props, ...children);
|
|
12
17
|
}
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
function createElementFromSlotComponent(type, overrideChildren) {
|
|
19
|
+
const { as , [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType , [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...propsWithoutMetadata } = type;
|
|
20
|
+
const props = propsWithoutMetadata;
|
|
21
|
+
const elementType = typeof baseElementType === 'string' ? as !== null && as !== void 0 ? as : baseElementType : baseElementType;
|
|
22
|
+
if (typeof elementType !== 'string' && as) {
|
|
23
|
+
props.as = as;
|
|
24
|
+
}
|
|
25
|
+
if (renderFunction) {
|
|
26
|
+
if (overrideChildren.length > 0) {
|
|
27
|
+
props.children = React.createElement(React.Fragment, {}, ...overrideChildren);
|
|
28
|
+
}
|
|
29
|
+
return React.createElement(React.Fragment, {}, renderFunction(elementType, props));
|
|
30
|
+
}
|
|
31
|
+
return React.createElement(elementType, props, ...overrideChildren);
|
|
15
32
|
}
|
package/lib/createElement.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["createElement.ts"],"sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["createElement.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n UnknownSlotProps,\n isSlot,\n SlotComponentType,\n SLOT_ELEMENT_TYPE_SYMBOL,\n SLOT_RENDER_FUNCTION_SYMBOL,\n} from '@fluentui/react-utilities';\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 // TODO:\n // this is for backwards compatibility with getSlotsNext\n // it should be removed once getSlotsNext is obsolete\n if (isSlot<P>(props)) {\n return createElementFromSlotComponent(\n { ...props, [SLOT_ELEMENT_TYPE_SYMBOL]: type } as SlotComponentType<P>,\n children,\n );\n }\n if (isSlot<P>(type)) {\n return createElementFromSlotComponent(type, children);\n }\n return React.createElement(type, props, ...children);\n}\n\nfunction createElementFromSlotComponent<Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideChildren: React.ReactNode[],\n): React.ReactElement<Props> | null {\n const {\n as,\n [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType,\n [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction,\n ...propsWithoutMetadata\n } = type;\n const props = propsWithoutMetadata as UnknownSlotProps as Props;\n\n const elementType = typeof baseElementType === 'string' ? as ?? baseElementType : baseElementType;\n\n if (typeof elementType !== 'string' && as) {\n props.as = as;\n }\n\n if (renderFunction) {\n if (overrideChildren.length > 0) {\n props.children = React.createElement(React.Fragment, {}, ...overrideChildren);\n }\n\n return React.createElement(\n React.Fragment,\n {},\n renderFunction(elementType as React.ElementType<Props>, props),\n ) as React.ReactElement<Props>;\n }\n\n return React.createElement(elementType, props, ...overrideChildren);\n}\n"],"names":["React","isSlot","SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","createElement","type","props","children","createElementFromSlotComponent","overrideChildren","as","baseElementType","renderFunction","propsWithoutMetadata","elementType","length","Fragment"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAEEC,MAAM,EAENC,wBAAwB,EACxBC,2BAA2B,QACtB,4BAA4B;AAEnC,OAAO,SAASC,cACdC,IAA0B,EAC1BC,KAAgB,EAChB,GAAGC,QAA2B,EACA;IAC9B,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIN,OAAUK,QAAQ;QACpB,OAAOE,+BACL;YAAE,GAAGF,KAAK;YAAE,CAACJ,yBAAyB,EAAEG;QAAK,GAC7CE;IAEJ,CAAC;IACD,IAAIN,OAAUI,OAAO;QACnB,OAAOG,+BAA+BH,MAAME;IAC9C,CAAC;IACD,OAAOP,MAAMI,aAAa,CAACC,MAAMC,UAAUC;AAC7C,CAAC;AAED,SAASC,+BACPH,IAA8B,EAC9BI,gBAAmC,EACD;IAClC,MAAM,EACJC,GAAE,EACF,CAACR,yBAAyB,EAAES,gBAAe,EAC3C,CAACR,4BAA4B,EAAES,eAAc,EAC7C,GAAGC,sBACJ,GAAGR;IACJ,MAAMC,QAAQO;IAEd,MAAMC,cAAc,OAAOH,oBAAoB,WAAWD,eAAAA,gBAAAA,KAAMC,eAAe,GAAGA,eAAe;IAEjG,IAAI,OAAOG,gBAAgB,YAAYJ,IAAI;QACzCJ,MAAMI,EAAE,GAAGA;IACb,CAAC;IAED,IAAIE,gBAAgB;QAClB,IAAIH,iBAAiBM,MAAM,GAAG,GAAG;YAC/BT,MAAMC,QAAQ,GAAGP,MAAMI,aAAa,CAACJ,MAAMgB,QAAQ,EAAE,CAAC,MAAMP;QAC9D,CAAC;QAED,OAAOT,MAAMI,aAAa,CACxBJ,MAAMgB,QAAQ,EACd,CAAC,GACDJ,eAAeE,aAAyCR;IAE5D,CAAC;IAED,OAAON,MAAMI,aAAa,CAACU,aAAaR,UAAUG;AACpD"}
|
|
@@ -2,29 +2,40 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
createElement: ()=>createElement,
|
|
13
|
-
hasRenderFunction: ()=>hasRenderFunction
|
|
5
|
+
Object.defineProperty(exports, "createElement", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>createElement
|
|
14
8
|
});
|
|
15
9
|
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
16
10
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
17
11
|
const _reactUtilities = require("@fluentui/react-utilities");
|
|
18
12
|
function createElement(type, props, ...children) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
// TODO:
|
|
14
|
+
// this is for backwards compatibility with getSlotsNext
|
|
15
|
+
// it should be removed once getSlotsNext is obsolete
|
|
16
|
+
if ((0, _reactUtilities.isSlot)(props)) {
|
|
17
|
+
return createElementFromSlotComponent({
|
|
18
|
+
...props,
|
|
19
|
+
[_reactUtilities.SLOT_ELEMENT_TYPE_SYMBOL]: type
|
|
20
|
+
}, children);
|
|
21
|
+
}
|
|
22
|
+
if ((0, _reactUtilities.isSlot)(type)) {
|
|
23
|
+
return createElementFromSlotComponent(type, children);
|
|
25
24
|
}
|
|
26
|
-
return /*#__PURE__*/ _react.createElement(
|
|
25
|
+
return /*#__PURE__*/ _react.createElement(type, props, ...children);
|
|
27
26
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
27
|
+
function createElementFromSlotComponent(type, overrideChildren) {
|
|
28
|
+
const { as , [_reactUtilities.SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType , [_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...propsWithoutMetadata } = type;
|
|
29
|
+
const props = propsWithoutMetadata;
|
|
30
|
+
const elementType = typeof baseElementType === 'string' ? as !== null && as !== void 0 ? as : baseElementType : baseElementType;
|
|
31
|
+
if (typeof elementType !== 'string' && as) {
|
|
32
|
+
props.as = as;
|
|
33
|
+
}
|
|
34
|
+
if (renderFunction) {
|
|
35
|
+
if (overrideChildren.length > 0) {
|
|
36
|
+
props.children = /*#__PURE__*/ _react.createElement(_react.Fragment, {}, ...overrideChildren);
|
|
37
|
+
}
|
|
38
|
+
return /*#__PURE__*/ _react.createElement(_react.Fragment, {}, renderFunction(elementType, props));
|
|
39
|
+
}
|
|
40
|
+
return /*#__PURE__*/ _react.createElement(elementType, props, ...overrideChildren);
|
|
30
41
|
}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
1
|
+
{"version":3,"sources":["createElement.js"],"sourcesContent":["import * as React from 'react';\nimport { isSlot, SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';\nexport function createElement(type, props, ...children) {\n // TODO:\n // this is for backwards compatibility with getSlotsNext\n // it should be removed once getSlotsNext is obsolete\n if (isSlot(props)) {\n return createElementFromSlotComponent({\n ...props,\n [SLOT_ELEMENT_TYPE_SYMBOL]: type\n }, children);\n }\n if (isSlot(type)) {\n return createElementFromSlotComponent(type, children);\n }\n return React.createElement(type, props, ...children);\n}\nfunction createElementFromSlotComponent(type, overrideChildren) {\n const { as , [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType , [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...propsWithoutMetadata } = type;\n const props = propsWithoutMetadata;\n const elementType = typeof baseElementType === 'string' ? as !== null && as !== void 0 ? as : baseElementType : baseElementType;\n if (typeof elementType !== 'string' && as) {\n props.as = as;\n }\n if (renderFunction) {\n if (overrideChildren.length > 0) {\n props.children = React.createElement(React.Fragment, {}, ...overrideChildren);\n }\n return React.createElement(React.Fragment, {}, renderFunction(elementType, props));\n }\n return React.createElement(elementType, props, ...overrideChildren);\n}\n"],"names":["createElement","type","props","children","isSlot","createElementFromSlotComponent","SLOT_ELEMENT_TYPE_SYMBOL","React","overrideChildren","as","baseElementType","SLOT_RENDER_FUNCTION_SYMBOL","renderFunction","propsWithoutMetadata","elementType","length","Fragment"],"mappings":";;;;+BAEgBA;;aAAAA;;;6DAFO;gCACuD;AACvE,SAASA,cAAcC,IAAI,EAAEC,KAAK,EAAE,GAAGC,QAAQ,EAAE;IACpD,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIC,IAAAA,sBAAM,EAACF,QAAQ;QACf,OAAOG,+BAA+B;YAClC,GAAGH,KAAK;YACR,CAACI,wCAAwB,CAAC,EAAEL;QAChC,GAAGE;IACP,CAAC;IACD,IAAIC,IAAAA,sBAAM,EAACH,OAAO;QACd,OAAOI,+BAA+BJ,MAAME;IAChD,CAAC;IACD,qBAAOI,OAAMP,aAAa,CAACC,MAAMC,UAAUC;AAC/C;AACA,SAASE,+BAA+BJ,IAAI,EAAEO,gBAAgB,EAAE;IAC5D,MAAM,EAAEC,GAAE,EAAG,CAACH,wCAAwB,CAAC,EAAEI,gBAAe,EAAG,CAACC,2CAA2B,CAAC,EAAEC,eAAc,EAAG,GAAGC,sBAAsB,GAAGZ;IACvI,MAAMC,QAAQW;IACd,MAAMC,cAAc,OAAOJ,oBAAoB,WAAWD,OAAO,IAAI,IAAIA,OAAO,KAAK,IAAIA,KAAKC,eAAe,GAAGA,eAAe;IAC/H,IAAI,OAAOI,gBAAgB,YAAYL,IAAI;QACvCP,MAAMO,EAAE,GAAGA;IACf,CAAC;IACD,IAAIG,gBAAgB;QAChB,IAAIJ,iBAAiBO,MAAM,GAAG,GAAG;YAC7Bb,MAAMC,QAAQ,iBAAGI,OAAMP,aAAa,CAACO,OAAMS,QAAQ,EAAE,CAAC,MAAMR;QAChE,CAAC;QACD,qBAAOD,OAAMP,aAAa,CAACO,OAAMS,QAAQ,EAAE,CAAC,GAAGJ,eAAeE,aAAaZ;IAC/E,CAAC;IACD,qBAAOK,OAAMP,aAAa,CAACc,aAAaZ,UAAUM;AACtD"}
|
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.13",
|
|
4
4
|
"description": "React components for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@fluentui/eslint-plugin": "*",
|
|
27
27
|
"@fluentui/react-conformance": "*",
|
|
28
|
-
"@fluentui/react-conformance-griffel": "
|
|
28
|
+
"@fluentui/react-conformance-griffel": "*",
|
|
29
29
|
"@fluentui/scripts-api-extractor": "*",
|
|
30
30
|
"@fluentui/scripts-tasks": "*"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@fluentui/react-utilities": "^9.
|
|
33
|
+
"@fluentui/react-utilities": "^9.11.0",
|
|
34
34
|
"@swc/helpers": "^0.4.14"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|