@fluentui/react-jsx-runtime 0.0.0-nightly-20230414-0420.1 → 9.0.0-alpha.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.json +8 -14
- package/CHANGELOG.md +5 -6
- package/dist/index.d.ts +8 -0
- package/lib/createElement.js +29 -0
- package/lib/createElement.js.map +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/createElement.js +41 -0
- package/lib-commonjs/createElement.js.map +1 -0
- package/lib-commonjs/index.js +19 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +10 -4
package/CHANGELOG.json
CHANGED
|
@@ -2,28 +2,22 @@
|
|
|
2
2
|
"name": "@fluentui/react-jsx-runtime",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"tag": "@fluentui/react-jsx-
|
|
7
|
-
"version": "
|
|
5
|
+
"date": "Mon, 17 Apr 2023 17:50:02 GMT",
|
|
6
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.1",
|
|
7
|
+
"version": "9.0.0-alpha.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
|
11
|
-
"author": "
|
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
12
12
|
"package": "@fluentui/react-jsx-runtime",
|
|
13
|
-
"commit": "
|
|
14
|
-
"comment": "
|
|
13
|
+
"commit": "97af91aa7684bbfe149ace1b21b75fb7c04128a2",
|
|
14
|
+
"comment": "feat: implements custom JSX pragma"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"author": "beachball",
|
|
18
18
|
"package": "@fluentui/react-jsx-runtime",
|
|
19
|
-
"comment": "Bump @fluentui/react-utilities to
|
|
20
|
-
"commit": "
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"author": "beachball",
|
|
24
|
-
"package": "@fluentui/react-jsx-runtime",
|
|
25
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230414-0420.1",
|
|
26
|
-
"commit": "da1b1c8ef16dfca0409738cf5450022879c89473"
|
|
19
|
+
"comment": "Bump @fluentui/react-utilities to v9.8.0",
|
|
20
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
|
27
21
|
}
|
|
28
22
|
]
|
|
29
23
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-jsx-runtime
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 17 Apr 2023 17:50:02 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [
|
|
7
|
+
## [9.0.0-alpha.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.1)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Mon, 17 Apr 2023 17:50:02 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
- Bump @fluentui/react-utilities to
|
|
15
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230414-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/da1b1c8ef16dfca0409738cf5450022879c89473) by beachball)
|
|
13
|
+
- feat: implements custom JSX pragma ([PR #27472](https://github.com/microsoft/fluentui/pull/27472) by bernardo.sunderhus@gmail.com)
|
|
14
|
+
- Bump @fluentui/react-utilities to v9.8.0 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import * as React_2 from 'react';
|
|
3
|
+
|
|
4
|
+
export declare function createElement<P extends {}>(type: React_2.ElementType<P>, props?: P | null, ...children: React_2.ReactNode[]): React_2.ReactElement<P> | null;
|
|
5
|
+
|
|
6
|
+
export { Fragment }
|
|
7
|
+
|
|
8
|
+
export { }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';
|
|
3
|
+
export function createElement(type, props, ...children) {
|
|
4
|
+
if (!isSlotComponent(props)) {
|
|
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
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
function normalizeRenderFunction(propsWithMetadata, overrideChildren) {
|
|
14
|
+
const {
|
|
15
|
+
[SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction,
|
|
16
|
+
children: externalChildren,
|
|
17
|
+
...props
|
|
18
|
+
} = propsWithMetadata;
|
|
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
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function isSlotComponent(props) {
|
|
27
|
+
return Boolean(props === null || props === void 0 ? void 0 : props.hasOwnProperty(SLOT_RENDER_FUNCTION_SYMBOL));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=createElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","SLOT_RENDER_FUNCTION_SYMBOL","createElement","type","props","children","isSlotComponent","result","normalizeRenderFunction","Fragment","renderFunction","propsWithMetadata","overrideChildren","externalChildren","Array","isArray","length","Boolean","hasOwnProperty"],"sources":["../src/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 if (!isSlotComponent(props)) {\n return React.createElement(type, props, ...children);\n }\n\n const result = normalizeRenderFunction(props, children);\n return React.createElement(\n React.Fragment,\n {},\n result.renderFunction(type, { ...result.props, children: result.children }),\n ) as React.ReactElement<P>;\n}\n\nfunction normalizeRenderFunction<Props extends UnknownSlotProps>(\n propsWithMetadata: WithMetadata<Props>,\n overrideChildren?: React.ReactNode[],\n): {\n props: Props;\n children: React.ReactNode;\n renderFunction: SlotRenderFunction<Props>;\n} {\n const { [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction, children: externalChildren, ...props } = propsWithMetadata;\n\n const children: React.ReactNode =\n Array.isArray(overrideChildren) && overrideChildren.length > 0\n ? React.createElement(React.Fragment, {}, ...overrideChildren)\n : externalChildren;\n\n return {\n children,\n renderFunction,\n props: props as UnknownSlotProps as Props,\n };\n}\n\nexport function isSlotComponent<Props extends {}>(props?: Props | null): props is WithMetadata<Props> {\n return Boolean(props?.hasOwnProperty(SLOT_RENDER_FUNCTION_SYMBOL));\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAA+CC,2BAA2B,QAAQ;AAMlF,OAAO,SAASC,cACdC,IAA0B,EAC1BC,KAAgB,EAChB,GAAGC,QAA2B,EACA;EAC9B,IAAI,CAACC,eAAA,CAAgBF,KAAA,GAAQ;IAC3B,oBAAOJ,KAAA,CAAME,aAAa,CAACC,IAAA,EAAMC,KAAA,KAAUC,QAAA;EAC7C;EAEA,MAAME,MAAA,GAASC,uBAAA,CAAwBJ,KAAA,EAAOC,QAAA;EAC9C,oBAAOL,KAAA,CAAME,aAAa,CACxBF,KAAA,CAAMS,QAAQ,EACd,CAAC,GACDF,MAAA,CAAOG,cAAc,CAACP,IAAA,EAAM;IAAE,GAAGI,MAAA,CAAOH,KAAK;IAAEC,QAAA,EAAUE,MAAA,CAAOF;EAAS;AAE7E;AAEA,SAASG,wBACPG,iBAAsC,EACtCC,gBAAoC,EAKpC;EACA,MAAM;IAAE,CAACX,2BAAA,GAA8BS,cAAA;IAAgBL,QAAA,EAAUQ,gBAAA;IAAkB,GAAGT;EAAA,CAAO,GAAGO,iBAAA;EAEhG,MAAMN,QAAA,GACJS,KAAA,CAAMC,OAAO,CAACH,gBAAA,KAAqBA,gBAAA,CAAiBI,MAAM,GAAG,iBACzDhB,KAAA,CAAME,aAAa,CAACF,KAAA,CAAMS,QAAQ,EAAE,CAAC,MAAMG,gBAAA,IAC3CC,gBAAgB;EAEtB,OAAO;IACLR,QAAA;IACAK,cAAA;IACAN,KAAA,EAAOA;EACT;AACF;AAEA,OAAO,SAASE,gBAAkCF,KAAoB,EAAgC;EACpG,OAAOa,OAAA,CAAQb,KAAA,aAAAA,KAAA,uBAAAA,KAAA,CAAOc,cAAc,CAACjB,2BAAA;AACvC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createElement","Fragment"],"sources":["../src/index.ts"],"sourcesContent":["export { createElement } from './createElement';\nexport { Fragment } from 'react';\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ;AAC9B,SAASC,QAAQ,QAAQ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
createElement: ()=>createElement,
|
|
13
|
+
isSlotComponent: ()=>isSlotComponent
|
|
14
|
+
});
|
|
15
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
16
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
17
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
18
|
+
function createElement(type, props, ...children) {
|
|
19
|
+
if (!isSlotComponent(props)) {
|
|
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
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
function normalizeRenderFunction(propsWithMetadata, overrideChildren) {
|
|
29
|
+
const { [_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , children: externalChildren , ...props } = propsWithMetadata;
|
|
30
|
+
const children = Array.isArray(overrideChildren) && overrideChildren.length > 0 ? /*#__PURE__*/ _react.createElement(_react.Fragment, {}, ...overrideChildren) : externalChildren;
|
|
31
|
+
return {
|
|
32
|
+
children,
|
|
33
|
+
renderFunction,
|
|
34
|
+
props: props
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function isSlotComponent(props) {
|
|
38
|
+
return Boolean(props === null || props === void 0 ? void 0 : props.hasOwnProperty(_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL));
|
|
39
|
+
} //# sourceMappingURL=createElement.js.map
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=createElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/createElement.js"],"sourcesContent":["import * as React from 'react';\nimport { SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';\nexport function createElement(type, props, ...children) {\n if (!isSlotComponent(props)) {\n return /*#__PURE__*/React.createElement(type, props, ...children);\n }\n const result = normalizeRenderFunction(props, children);\n return /*#__PURE__*/React.createElement(React.Fragment, {}, result.renderFunction(type, {\n ...result.props,\n children: result.children\n }));\n}\nfunction normalizeRenderFunction(propsWithMetadata, overrideChildren) {\n const {\n [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction,\n children: externalChildren,\n ...props\n } = propsWithMetadata;\n const children = Array.isArray(overrideChildren) && overrideChildren.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, {}, ...overrideChildren) : externalChildren;\n return {\n children,\n renderFunction,\n props: props\n };\n}\nexport function isSlotComponent(props) {\n return Boolean(props === null || props === void 0 ? void 0 : props.hasOwnProperty(SLOT_RENDER_FUNCTION_SYMBOL));\n}\n//# sourceMappingURL=createElement.js.map"],"names":["createElement","isSlotComponent","type","props","children","React","result","normalizeRenderFunction","Fragment","renderFunction","propsWithMetadata","overrideChildren","SLOT_RENDER_FUNCTION_SYMBOL","externalChildren","Array","isArray","length","Boolean","hasOwnProperty"],"mappings":";;;;;;;;;;;IAEgBA,aAAa,MAAbA;IAuBAC,eAAe,MAAfA;;;6DAzBO;gCACqB;AACrC,SAASD,cAAcE,IAAI,EAAEC,KAAK,EAAE,GAAGC,QAAQ,EAAE;IACtD,IAAI,CAACH,gBAAgBE,QAAQ;QAC3B,OAAO,WAAW,GAAEE,OAAML,aAAa,CAACE,MAAMC,UAAUC;IAC1D,CAAC;IACD,MAAME,SAASC,wBAAwBJ,OAAOC;IAC9C,OAAO,WAAW,GAAEC,OAAML,aAAa,CAACK,OAAMG,QAAQ,EAAE,CAAC,GAAGF,OAAOG,cAAc,CAACP,MAAM;QACtF,GAAGI,OAAOH,KAAK;QACfC,UAAUE,OAAOF,QAAQ;IAC3B;AACF;AACA,SAASG,wBAAwBG,iBAAiB,EAAEC,gBAAgB,EAAE;IACpE,MAAM,EACJ,CAACC,2CAA2B,CAAC,EAAEH,eAAc,EAC7CL,UAAUS,iBAAgB,EAC1B,GAAGV,OACJ,GAAGO;IACJ,MAAMN,WAAWU,MAAMC,OAAO,CAACJ,qBAAqBA,iBAAiBK,MAAM,GAAG,IAAI,WAAW,GAAEX,OAAML,aAAa,CAACK,OAAMG,QAAQ,EAAE,CAAC,MAAMG,oBAAoBE,gBAAgB;IAC9K,OAAO;QACLT;QACAK;QACAN,OAAOA;IACT;AACF;AACO,SAASF,gBAAgBE,KAAK,EAAE;IACrC,OAAOc,QAAQd,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMe,cAAc,CAACN,2CAA2B,CAAC;AAChH,EACA,yCAAyC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
createElement: ()=>_createElement.createElement,
|
|
13
|
+
Fragment: ()=>_react.Fragment
|
|
14
|
+
});
|
|
15
|
+
const _createElement = require("./createElement");
|
|
16
|
+
const _react = require("react");
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { createElement } from './createElement';\nexport { Fragment } from 'react';\n//# sourceMappingURL=index.js.map"],"names":["createElement","Fragment"],"mappings":";;;;;;;;;;;IAASA,aAAa,MAAbA,4BAAa;IACbC,QAAQ,MAARA,eAAQ;;+BADa;uBACL;CACzB,iCAAiC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-jsx-runtime",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-alpha.1",
|
|
4
4
|
"description": "React components for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -24,19 +24,25 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@fluentui/eslint-plugin": "*",
|
|
26
26
|
"@fluentui/react-conformance": "*",
|
|
27
|
-
"@fluentui/react-conformance-griffel": "
|
|
27
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.20",
|
|
28
28
|
"@fluentui/scripts-api-extractor": "*",
|
|
29
29
|
"@fluentui/scripts-tasks": "*"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@fluentui/react-utilities": "
|
|
32
|
+
"@fluentui/react-utilities": "^9.8.0",
|
|
33
33
|
"@swc/helpers": "^0.4.14"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@types/react": ">=16.8.0 <19.0.0",
|
|
37
37
|
"react": ">=16.8.0 <19.0.0"
|
|
38
38
|
},
|
|
39
|
-
"beachball": {
|
|
39
|
+
"beachball": {
|
|
40
|
+
"disallowedChangeTypes": [
|
|
41
|
+
"major",
|
|
42
|
+
"minor",
|
|
43
|
+
"patch"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
40
46
|
"exports": {
|
|
41
47
|
".": {
|
|
42
48
|
"types": "./dist/index.d.ts",
|