@fluentui/react-jsx-runtime
Advanced tools
Comparing version 0.0.0-nightly-20230418-0418.1 to 0.0.0-nightly-20230419-0423.1
@@ -5,5 +5,5 @@ { | ||
{ | ||
"date": "Tue, 18 Apr 2023 04:24:26 GMT", | ||
"tag": "@fluentui/react-jsx-runtime_v0.0.0-nightly-20230418-0418.1", | ||
"version": "0.0.0-nightly-20230418-0418.1", | ||
"date": "Wed, 19 Apr 2023 04:31:11 GMT", | ||
"tag": "@fluentui/react-jsx-runtime_v0.0.0-nightly-20230419-0423.1", | ||
"version": "0.0.0-nightly-20230419-0423.1", | ||
"comments": { | ||
@@ -20,4 +20,4 @@ "prerelease": [ | ||
"package": "@fluentui/react-jsx-runtime", | ||
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230418-0418.1", | ||
"commit": "5be3c9e38f14cecd0db601709d48bf2eaacbcd16" | ||
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230419-0423.1", | ||
"commit": "6ddf2ae2968cadd0aa45d3d661b779093482f578" | ||
}, | ||
@@ -27,4 +27,4 @@ { | ||
"package": "@fluentui/react-jsx-runtime", | ||
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230418-0418.1", | ||
"commit": "5be3c9e38f14cecd0db601709d48bf2eaacbcd16" | ||
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230419-0423.1", | ||
"commit": "6ddf2ae2968cadd0aa45d3d661b779093482f578" | ||
} | ||
@@ -31,0 +31,0 @@ ] |
# Change Log - @fluentui/react-jsx-runtime | ||
This log was last generated on Tue, 18 Apr 2023 04:24:26 GMT and should not be manually modified. | ||
This log was last generated on Wed, 19 Apr 2023 04:31:11 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [0.0.0-nightly-20230418-0418.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v0.0.0-nightly-20230418-0418.1) | ||
## [0.0.0-nightly-20230419-0423.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v0.0.0-nightly-20230419-0423.1) | ||
Tue, 18 Apr 2023 04:24:26 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.1..@fluentui/react-jsx-runtime_v0.0.0-nightly-20230418-0418.1) | ||
Wed, 19 Apr 2023 04:31:11 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.1..@fluentui/react-jsx-runtime_v0.0.0-nightly-20230419-0423.1) | ||
@@ -15,4 +15,4 @@ ### Changes | ||
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com) | ||
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230418-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/5be3c9e38f14cecd0db601709d48bf2eaacbcd16) by beachball) | ||
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230418-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/5be3c9e38f14cecd0db601709d48bf2eaacbcd16) by beachball) | ||
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230419-0423.1 ([commit](https://github.com/microsoft/fluentui/commit/6ddf2ae2968cadd0aa45d3d661b779093482f578) by beachball) | ||
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230419-0423.1 ([commit](https://github.com/microsoft/fluentui/commit/6ddf2ae2968cadd0aa45d3d661b779093482f578) by beachball) | ||
@@ -19,0 +19,0 @@ ## [9.0.0-alpha.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.1) |
@@ -13,3 +13,3 @@ "use strict"; | ||
createElement: ()=>createElement, | ||
isSlotComponent: ()=>isSlotComponent | ||
hasRenderFunction: ()=>hasRenderFunction | ||
}); | ||
@@ -20,21 +20,12 @@ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default; | ||
function createElement(type, props, ...children) { | ||
if (!isSlotComponent(props)) { | ||
return /*#__PURE__*/ _react.createElement(type, props, ...children); | ||
return hasRenderFunction(props) ? createElementFromRenderFunction(type, props, children) : /*#__PURE__*/ _react.createElement(type, props, ...children); | ||
} | ||
function createElementFromRenderFunction(type, props, overrideChildren) { | ||
const { [_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...renderProps } = props; | ||
if (overrideChildren.length > 0) { | ||
renderProps.children = /*#__PURE__*/ _react.createElement(_react.Fragment, {}, ...overrideChildren); | ||
} | ||
const result = normalizeRenderFunction(props, children); | ||
return /*#__PURE__*/ _react.createElement(_react.Fragment, {}, result.renderFunction(type, { | ||
...result.props, | ||
children: result.children | ||
})); | ||
return /*#__PURE__*/ _react.createElement(_react.Fragment, {}, renderFunction(type, renderProps)); | ||
} | ||
function normalizeRenderFunction(propsWithMetadata, overrideChildren) { | ||
const { [_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , children: externalChildren , ...props } = propsWithMetadata; | ||
const children = Array.isArray(overrideChildren) && overrideChildren.length > 0 ? /*#__PURE__*/ _react.createElement(_react.Fragment, {}, ...overrideChildren) : externalChildren; | ||
return { | ||
children, | ||
renderFunction, | ||
props: props | ||
}; | ||
} | ||
function isSlotComponent(props) { | ||
function hasRenderFunction(props) { | ||
return Boolean(props === null || props === void 0 ? void 0 : props.hasOwnProperty(_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL)); | ||
@@ -41,0 +32,0 @@ } //# sourceMappingURL=createElement.js.map |
import * as React from 'react'; | ||
import { SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities'; | ||
export function createElement(type, props, ...children) { | ||
if (!isSlotComponent(props)) { | ||
return /*#__PURE__*/React.createElement(type, props, ...children); | ||
} | ||
const result = normalizeRenderFunction(props, children); | ||
return /*#__PURE__*/React.createElement(React.Fragment, {}, result.renderFunction(type, { | ||
...result.props, | ||
children: result.children | ||
})); | ||
return hasRenderFunction(props) ? createElementFromRenderFunction(type, props, children) : /*#__PURE__*/React.createElement(type, props, ...children); | ||
} | ||
function normalizeRenderFunction(propsWithMetadata, overrideChildren) { | ||
function createElementFromRenderFunction(type, props, overrideChildren) { | ||
const { | ||
[SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction, | ||
children: externalChildren, | ||
...props | ||
} = propsWithMetadata; | ||
const children = Array.isArray(overrideChildren) && overrideChildren.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, {}, ...overrideChildren) : externalChildren; | ||
return { | ||
children, | ||
renderFunction, | ||
props: props | ||
}; | ||
...renderProps | ||
} = props; | ||
if (overrideChildren.length > 0) { | ||
renderProps.children = /*#__PURE__*/React.createElement(React.Fragment, {}, ...overrideChildren); | ||
} | ||
return /*#__PURE__*/React.createElement(React.Fragment, {}, renderFunction(type, renderProps)); | ||
} | ||
export function isSlotComponent(props) { | ||
export function hasRenderFunction(props) { | ||
return Boolean(props === null || props === void 0 ? void 0 : props.hasOwnProperty(SLOT_RENDER_FUNCTION_SYMBOL)); | ||
} | ||
//# sourceMappingURL=createElement.js.map |
{ | ||
"name": "@fluentui/react-jsx-runtime", | ||
"version": "0.0.0-nightly-20230418-0418.1", | ||
"version": "0.0.0-nightly-20230419-0423.1", | ||
"description": "React components for building web experiences", | ||
@@ -27,3 +27,3 @@ "main": "lib-commonjs/index.js", | ||
"@fluentui/react-conformance": "*", | ||
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230418-0418.1", | ||
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230419-0423.1", | ||
"@fluentui/scripts-api-extractor": "*", | ||
@@ -33,3 +33,3 @@ "@fluentui/scripts-tasks": "*" | ||
"dependencies": { | ||
"@fluentui/react-utilities": "0.0.0-nightly-20230418-0418.1", | ||
"@fluentui/react-utilities": "0.0.0-nightly-20230419-0423.1", | ||
"@swc/helpers": "^0.4.14" | ||
@@ -36,0 +36,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15008
125
+ Added@fluentui/keyboard-keys@0.0.0-nightly-20230419-0423.1(transitive)
+ Added@fluentui/react-utilities@0.0.0-nightly-20230419-0423.1(transitive)
+ Added@types/react@18.3.6(transitive)
- Removed@fluentui/keyboard-keys@0.0.0-nightly-20230418-0418.1(transitive)
- Removed@fluentui/react-utilities@0.0.0-nightly-20230418-0418.1(transitive)
- Removed@types/react@18.3.8(transitive)
Updated@fluentui/react-utilities@0.0.0-nightly-20230419-0423.1