@fluentui/react-jsx-runtime 9.0.0-alpha.15 → 9.0.0-alpha.16
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 +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/index.d.ts +1 -1
- package/lib/createElement.js +4 -20
- package/lib/createElement.js.map +1 -1
- package/lib/jsx/createElementFromSlotComponent.js +15 -0
- package/lib/jsx/createElementFromSlotComponent.js.map +1 -0
- package/lib/jsx/jsxDEVFromSlotComponent.js +16 -0
- package/lib/jsx/jsxDEVFromSlotComponent.js.map +1 -0
- package/lib/jsx/jsxDynamicFromSlotComponent.js +18 -0
- package/lib/jsx/jsxDynamicFromSlotComponent.js.map +1 -0
- package/lib/jsx/jsxStaticFromSlotComponent.js +18 -0
- package/lib/jsx/jsxStaticFromSlotComponent.js.map +1 -0
- package/lib/jsx-dev-runtime.js +17 -0
- package/lib/jsx-dev-runtime.js.map +1 -0
- package/lib/jsx-runtime.js +30 -0
- package/lib/jsx-runtime.js.map +1 -0
- package/lib/utils/DevRuntime.js +2 -0
- package/lib/utils/DevRuntime.js.map +1 -0
- package/lib/utils/Runtime.js +2 -0
- package/lib/utils/Runtime.js.map +1 -0
- package/lib/utils/createCompatSlotComponent.js +11 -0
- package/lib/utils/createCompatSlotComponent.js.map +1 -0
- package/lib/utils/getMetadataFromSlotComponent.js +16 -0
- package/lib/utils/getMetadataFromSlotComponent.js.map +1 -0
- package/lib/utils/types.js +1 -0
- package/lib/utils/types.js.map +1 -0
- package/lib-commonjs/createElement.js +4 -20
- package/lib-commonjs/createElement.js.map +1 -1
- package/lib-commonjs/jsx/createElementFromSlotComponent.js +21 -0
- package/lib-commonjs/jsx/createElementFromSlotComponent.js.map +1 -0
- package/lib-commonjs/jsx/jsxDEVFromSlotComponent.js +25 -0
- package/lib-commonjs/jsx/jsxDEVFromSlotComponent.js.map +1 -0
- package/lib-commonjs/jsx/jsxDynamicFromSlotComponent.js +25 -0
- package/lib-commonjs/jsx/jsxDynamicFromSlotComponent.js.map +1 -0
- package/lib-commonjs/jsx/jsxStaticFromSlotComponent.js +25 -0
- package/lib-commonjs/jsx/jsxStaticFromSlotComponent.js.map +1 -0
- package/lib-commonjs/jsx-dev-runtime.js +31 -0
- package/lib-commonjs/jsx-dev-runtime.js.map +1 -0
- package/lib-commonjs/jsx-runtime.js +45 -0
- package/lib-commonjs/jsx-runtime.js.map +1 -0
- package/lib-commonjs/utils/DevRuntime.js +11 -0
- package/lib-commonjs/utils/DevRuntime.js.map +1 -0
- package/lib-commonjs/utils/Runtime.js +11 -0
- package/lib-commonjs/utils/Runtime.js.map +1 -0
- package/lib-commonjs/utils/createCompatSlotComponent.js +17 -0
- package/lib-commonjs/utils/createCompatSlotComponent.js.map +1 -0
- package/lib-commonjs/utils/getMetadataFromSlotComponent.js +22 -0
- package/lib-commonjs/utils/getMetadataFromSlotComponent.js.map +1 -0
- package/lib-commonjs/utils/types.js +4 -0
- package/lib-commonjs/utils/types.js.map +1 -0
- package/package.json +13 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@fluentui/react-jsx-runtime",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 16 Aug 2023 11:35:24 GMT",
|
|
6
|
+
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.16",
|
|
7
|
+
"version": "9.0.0-alpha.16",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
12
|
+
"package": "@fluentui/react-jsx-runtime",
|
|
13
|
+
"commit": "d40ea6e1d43cd21d1404d9c71018d822958c6644",
|
|
14
|
+
"comment": "feat: supports new automatic JSX runtime"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 11 Aug 2023 12:14:26 GMT",
|
|
6
21
|
"tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.15",
|
|
7
22
|
"version": "9.0.0-alpha.15",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-jsx-runtime
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 16 Aug 2023 11:35:24 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-alpha.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.16)
|
|
8
|
+
|
|
9
|
+
Wed, 16 Aug 2023 11:35:24 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.15..@fluentui/react-jsx-runtime_v9.0.0-alpha.16)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- feat: supports new automatic JSX runtime ([PR #28810](https://github.com/microsoft/fluentui/pull/28810) by bernardo.sunderhus@gmail.com)
|
|
15
|
+
|
|
7
16
|
## [9.0.0-alpha.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.15)
|
|
8
17
|
|
|
9
|
-
Fri, 11 Aug 2023 12:
|
|
18
|
+
Fri, 11 Aug 2023 12:14:26 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.13..@fluentui/react-jsx-runtime_v9.0.0-alpha.15)
|
|
11
20
|
|
|
12
21
|
### Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import * as React_2 from 'react';
|
|
3
3
|
|
|
4
|
-
export declare function createElement<P extends {}>(type: React_2.ElementType<P>, props?: P | null, ...children: React_2.ReactNode[]): React_2.ReactElement<P
|
|
4
|
+
export declare function createElement<P extends {}>(type: React_2.ElementType<P>, props?: P | null, ...children: React_2.ReactNode[]): React_2.ReactElement<P>;
|
|
5
5
|
|
|
6
6
|
export { Fragment }
|
|
7
7
|
|
package/lib/createElement.js
CHANGED
|
@@ -1,32 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { isSlot
|
|
2
|
+
import { isSlot } from '@fluentui/react-utilities';
|
|
3
|
+
import { createElementFromSlotComponent } from './jsx/createElementFromSlotComponent';
|
|
4
|
+
import { createCompatSlotComponent } from './utils/createCompatSlotComponent';
|
|
3
5
|
export function createElement(type, props, ...children) {
|
|
4
6
|
// TODO:
|
|
5
7
|
// this is for backwards compatibility with getSlotsNext
|
|
6
8
|
// it should be removed once getSlotsNext is obsolete
|
|
7
9
|
if (isSlot(props)) {
|
|
8
|
-
return createElementFromSlotComponent(
|
|
9
|
-
...props,
|
|
10
|
-
[SLOT_ELEMENT_TYPE_SYMBOL]: type
|
|
11
|
-
}, children);
|
|
10
|
+
return createElementFromSlotComponent(createCompatSlotComponent(type, props), children);
|
|
12
11
|
}
|
|
13
12
|
if (isSlot(type)) {
|
|
14
13
|
return createElementFromSlotComponent(type, children);
|
|
15
14
|
}
|
|
16
15
|
return React.createElement(type, props, ...children);
|
|
17
16
|
}
|
|
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);
|
|
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 { isSlot } from '@fluentui/react-utilities';\nimport { createElementFromSlotComponent } from './jsx/createElementFromSlotComponent';\nimport { createCompatSlotComponent } from './utils/createCompatSlotComponent';\n\nexport function createElement<P extends {}>(\n type: React.ElementType<P>,\n props?: P | null,\n ...children: React.ReactNode[]\n): React.ReactElement<P> {\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(createCompatSlotComponent(type, props), children);\n }\n if (isSlot<P>(type)) {\n return createElementFromSlotComponent(type, children);\n }\n return React.createElement(type, props, ...children);\n}\n"],"names":["React","isSlot","createElementFromSlotComponent","createCompatSlotComponent","createElement","type","props","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,8BAA8B,QAAQ,uCAAuC;AACtF,SAASC,yBAAyB,QAAQ,oCAAoC;AAE9E,OAAO,SAASC,cACdC,IAA0B,EAC1BC,KAAgB,EAChB,GAAGC,QAA2B,EACP;IACvB,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIN,OAAUK,QAAQ;QACpB,OAAOJ,+BAA+BC,0BAA0BE,MAAMC,QAAQC;IAChF,CAAC;IACD,IAAIN,OAAUI,OAAO;QACnB,OAAOH,+BAA+BG,MAAME;IAC9C,CAAC;IACD,OAAOP,MAAMI,aAAa,CAACC,MAAMC,UAAUC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* creates a ReactElement from a slot declaration
|
|
6
|
+
*/ export function createElementFromSlotComponent(type, overrideChildren) {
|
|
7
|
+
const { elementType , renderFunction , props } = getMetadataFromSlotComponent(type);
|
|
8
|
+
if (renderFunction) {
|
|
9
|
+
if (overrideChildren.length > 0) {
|
|
10
|
+
props.children = React.createElement(React.Fragment, {}, ...overrideChildren);
|
|
11
|
+
}
|
|
12
|
+
return React.createElement(React.Fragment, {}, renderFunction(elementType, props));
|
|
13
|
+
}
|
|
14
|
+
return React.createElement(elementType, props, ...overrideChildren);
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createElementFromSlotComponent.ts"],"sourcesContent":["import * as React from 'react';\nimport type { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\n\n/**\n * @internal\n * creates a ReactElement from a slot declaration\n */\nexport function createElementFromSlotComponent<Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideChildren: React.ReactNode[],\n): React.ReactElement<Props> {\n const { elementType, renderFunction, props } = getMetadataFromSlotComponent(type);\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","getMetadataFromSlotComponent","createElementFromSlotComponent","type","overrideChildren","elementType","renderFunction","props","length","children","createElement","Fragment"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AAErF;;;CAGC,GACD,OAAO,SAASC,+BACdC,IAA8B,EAC9BC,gBAAmC,EACR;IAC3B,MAAM,EAAEC,YAAW,EAAEC,eAAc,EAAEC,MAAK,EAAE,GAAGN,6BAA6BE;IAE5E,IAAIG,gBAAgB;QAClB,IAAIF,iBAAiBI,MAAM,GAAG,GAAG;YAC/BD,MAAME,QAAQ,GAAGT,MAAMU,aAAa,CAACV,MAAMW,QAAQ,EAAE,CAAC,MAAMP;QAC9D,CAAC;QAED,OAAOJ,MAAMU,aAAa,CACxBV,MAAMW,QAAQ,EACd,CAAC,GACDL,eAAeD,aAAyCE;IAE5D,CAAC;IAED,OAAOP,MAAMU,aAAa,CAACL,aAAaE,UAAUH;AACpD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
|
|
3
|
+
import { DevRuntime } from '../utils/DevRuntime';
|
|
4
|
+
export function jsxDEVFromSlotComponent(type, overrideProps, key, source, self) {
|
|
5
|
+
const { elementType , renderFunction , props: slotProps } = getMetadataFromSlotComponent(type);
|
|
6
|
+
const props = {
|
|
7
|
+
...slotProps,
|
|
8
|
+
...overrideProps
|
|
9
|
+
};
|
|
10
|
+
if (renderFunction) {
|
|
11
|
+
return DevRuntime.jsxDEV(React.Fragment, {
|
|
12
|
+
children: renderFunction(elementType, props)
|
|
13
|
+
}, key, source, self);
|
|
14
|
+
}
|
|
15
|
+
return DevRuntime.jsxDEV(elementType, props, key, source, self);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsxDEVFromSlotComponent.ts"],"sourcesContent":["import * as React from 'react';\nimport type { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { DevRuntime } from '../utils/DevRuntime';\n\nexport function jsxDEVFromSlotComponent<Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n source?: unknown,\n self?: unknown,\n): React.ReactElement<Props> {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n return DevRuntime.jsxDEV(\n React.Fragment,\n {\n children: renderFunction(elementType, props),\n },\n key,\n source,\n self,\n ) as React.ReactElement<Props>;\n }\n\n return DevRuntime.jsxDEV(elementType, props, key, source, self);\n}\n"],"names":["React","getMetadataFromSlotComponent","DevRuntime","jsxDEVFromSlotComponent","type","overrideProps","key","source","self","elementType","renderFunction","props","slotProps","jsxDEV","Fragment","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,UAAU,QAAQ,sBAAsB;AAEjD,OAAO,SAASC,wBACdC,IAA8B,EAC9BC,aAA2B,EAC3BC,GAAe,EACfC,MAAgB,EAChBC,IAAc,EACa;IAC3B,MAAM,EAAEC,YAAW,EAAEC,eAAc,EAAEC,OAAOC,UAAS,EAAE,GAAGX,6BAA6BG;IAEvF,MAAMO,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGP,aAAa;IAAC;IAEtD,IAAIK,gBAAgB;QAClB,OAAOR,WAAWW,MAAM,CACtBb,MAAMc,QAAQ,EACd;YACEC,UAAUL,eAAeD,aAAaE;QACxC,GACAL,KACAC,QACAC;IAEJ,CAAC;IAED,OAAON,WAAWW,MAAM,CAACJ,aAAaE,OAAOL,KAAKC,QAAQC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
|
|
3
|
+
import { Runtime } from '../utils/Runtime';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/ export function jsxDynamicFromSlotComponent(type, overrideProps, key) {
|
|
7
|
+
const { elementType , renderFunction , props: slotProps } = getMetadataFromSlotComponent(type);
|
|
8
|
+
const props = {
|
|
9
|
+
...slotProps,
|
|
10
|
+
...overrideProps
|
|
11
|
+
};
|
|
12
|
+
if (renderFunction) {
|
|
13
|
+
return Runtime.jsx(React.Fragment, {
|
|
14
|
+
children: renderFunction(elementType, props)
|
|
15
|
+
}, key);
|
|
16
|
+
}
|
|
17
|
+
return Runtime.jsx(elementType, props, key);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsxDynamicFromSlotComponent.ts"],"sourcesContent":["import * as React from 'react';\nimport type { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { Runtime } from '../utils/Runtime';\n\n/**\n * @internal\n */\nexport function jsxDynamicFromSlotComponent<Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n): React.ReactElement<Props> {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n return Runtime.jsx(\n React.Fragment,\n {\n children: renderFunction(elementType, props),\n },\n key,\n ) as React.ReactElement<Props>;\n }\n\n return Runtime.jsx(elementType, props, key);\n}\n"],"names":["React","getMetadataFromSlotComponent","Runtime","jsxDynamicFromSlotComponent","type","overrideProps","key","elementType","renderFunction","props","slotProps","jsx","Fragment","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,OAAO,QAAQ,mBAAmB;AAE3C;;CAEC,GACD,OAAO,SAASC,4BACdC,IAA8B,EAC9BC,aAA2B,EAC3BC,GAAe,EACY;IAC3B,MAAM,EAAEC,YAAW,EAAEC,eAAc,EAAEC,OAAOC,UAAS,EAAE,GAAGT,6BAA6BG;IAEvF,MAAMK,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGL,aAAa;IAAC;IAEtD,IAAIG,gBAAgB;QAClB,OAAON,QAAQS,GAAG,CAChBX,MAAMY,QAAQ,EACd;YACEC,UAAUL,eAAeD,aAAaE;QACxC,GACAH;IAEJ,CAAC;IAED,OAAOJ,QAAQS,GAAG,CAACJ,aAAaE,OAAOH;AACzC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';
|
|
3
|
+
import { Runtime } from '../utils/Runtime';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/ export function jsxStaticFromSlotComponent(type, overrideProps, key) {
|
|
7
|
+
const { elementType , renderFunction , props: slotProps } = getMetadataFromSlotComponent(type);
|
|
8
|
+
const props = {
|
|
9
|
+
...slotProps,
|
|
10
|
+
...overrideProps
|
|
11
|
+
};
|
|
12
|
+
if (renderFunction) {
|
|
13
|
+
return Runtime.jsxs(React.Fragment, {
|
|
14
|
+
children: renderFunction(elementType, props)
|
|
15
|
+
}, key);
|
|
16
|
+
}
|
|
17
|
+
return Runtime.jsxs(elementType, props, key);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsxStaticFromSlotComponent.ts"],"sourcesContent":["import * as React from 'react';\nimport type { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { Runtime } from '../utils/Runtime';\n\n/**\n * @internal\n */\nexport function jsxStaticFromSlotComponent<Props extends UnknownSlotProps>(\n type: SlotComponentType<Props>,\n overrideProps: Props | null,\n key?: React.Key,\n): React.ReactElement<Props> {\n const { elementType, renderFunction, props: slotProps } = getMetadataFromSlotComponent(type);\n\n const props: Props = { ...slotProps, ...overrideProps };\n\n if (renderFunction) {\n return Runtime.jsxs(\n React.Fragment,\n {\n children: renderFunction(elementType, props),\n },\n key,\n ) as React.ReactElement<Props>;\n }\n\n return Runtime.jsxs(elementType, props, key);\n}\n"],"names":["React","getMetadataFromSlotComponent","Runtime","jsxStaticFromSlotComponent","type","overrideProps","key","elementType","renderFunction","props","slotProps","jsxs","Fragment","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,4BAA4B,QAAQ,wCAAwC;AACrF,SAASC,OAAO,QAAQ,mBAAmB;AAE3C;;CAEC,GACD,OAAO,SAASC,2BACdC,IAA8B,EAC9BC,aAA2B,EAC3BC,GAAe,EACY;IAC3B,MAAM,EAAEC,YAAW,EAAEC,eAAc,EAAEC,OAAOC,UAAS,EAAE,GAAGT,6BAA6BG;IAEvF,MAAMK,QAAe;QAAE,GAAGC,SAAS;QAAE,GAAGL,aAAa;IAAC;IAEtD,IAAIG,gBAAgB;QAClB,OAAON,QAAQS,IAAI,CACjBX,MAAMY,QAAQ,EACd;YACEC,UAAUL,eAAeD,aAAaE;QACxC,GACAH;IAEJ,CAAC;IAED,OAAOJ,QAAQS,IAAI,CAACJ,aAAaE,OAAOH;AAC1C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isSlot } from '@fluentui/react-utilities';
|
|
2
|
+
import { jsxDEVFromSlotComponent } from './jsx/jsxDEVFromSlotComponent';
|
|
3
|
+
import { createCompatSlotComponent } from './utils/createCompatSlotComponent';
|
|
4
|
+
import { DevRuntime } from './utils/DevRuntime';
|
|
5
|
+
export { Fragment } from 'react';
|
|
6
|
+
export function jsxDEV(type, props, key, source, self) {
|
|
7
|
+
// TODO:
|
|
8
|
+
// this is for backwards compatibility with getSlotsNext
|
|
9
|
+
// it should be removed once getSlotsNext is obsolete
|
|
10
|
+
if (isSlot(props)) {
|
|
11
|
+
return jsxDEVFromSlotComponent(createCompatSlotComponent(type, props), null, key, source, self);
|
|
12
|
+
}
|
|
13
|
+
if (isSlot(type)) {
|
|
14
|
+
return jsxDEVFromSlotComponent(type, props, key, source, self);
|
|
15
|
+
}
|
|
16
|
+
return DevRuntime.jsxDEV(type, props, key, source, self);
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsx-dev-runtime.ts"],"sourcesContent":["import type * as React from 'react';\nimport { isSlot } from '@fluentui/react-utilities';\nimport { jsxDEVFromSlotComponent } from './jsx/jsxDEVFromSlotComponent';\nimport { createCompatSlotComponent } from './utils/createCompatSlotComponent';\nimport { DevRuntime } from './utils/DevRuntime';\n\nexport { Fragment } from 'react';\n\nexport function jsxDEV<P extends {}>(\n type: React.ElementType<P>,\n props: P,\n key?: React.Key,\n source?: boolean,\n self?: unknown,\n): React.ReactElement<P> {\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 jsxDEVFromSlotComponent(createCompatSlotComponent(type, props), null, key, source, self);\n }\n if (isSlot<P>(type)) {\n return jsxDEVFromSlotComponent(type, props, key, source, self);\n }\n return DevRuntime.jsxDEV(type, props, key, source, self);\n}\n"],"names":["isSlot","jsxDEVFromSlotComponent","createCompatSlotComponent","DevRuntime","Fragment","jsxDEV","type","props","key","source","self"],"mappings":"AACA,SAASA,MAAM,QAAQ,4BAA4B;AACnD,SAASC,uBAAuB,QAAQ,gCAAgC;AACxE,SAASC,yBAAyB,QAAQ,oCAAoC;AAC9E,SAASC,UAAU,QAAQ,qBAAqB;AAEhD,SAASC,QAAQ,QAAQ,QAAQ;AAEjC,OAAO,SAASC,OACdC,IAA0B,EAC1BC,KAAQ,EACRC,GAAe,EACfC,MAAgB,EAChBC,IAAc,EACS;IACvB,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIV,OAAUO,QAAQ;QACpB,OAAON,wBAAwBC,0BAA0BI,MAAMC,QAAQ,IAAI,EAAEC,KAAKC,QAAQC;IAC5F,CAAC;IACD,IAAIV,OAAUM,OAAO;QACnB,OAAOL,wBAAwBK,MAAMC,OAAOC,KAAKC,QAAQC;IAC3D,CAAC;IACD,OAAOP,WAAWE,MAAM,CAACC,MAAMC,OAAOC,KAAKC,QAAQC;AACrD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isSlot } from '@fluentui/react-utilities';
|
|
2
|
+
import { jsxDynamicFromSlotComponent } from './jsx/jsxDynamicFromSlotComponent';
|
|
3
|
+
import { jsxStaticFromSlotComponent } from './jsx/jsxStaticFromSlotComponent';
|
|
4
|
+
import { createCompatSlotComponent } from './utils/createCompatSlotComponent';
|
|
5
|
+
import { Runtime } from './utils/Runtime';
|
|
6
|
+
export { Fragment } from 'react';
|
|
7
|
+
export function jsx(type, props, key) {
|
|
8
|
+
// TODO:
|
|
9
|
+
// this is for backwards compatibility with getSlotsNext
|
|
10
|
+
// it should be removed once getSlotsNext is obsolete
|
|
11
|
+
if (isSlot(props)) {
|
|
12
|
+
return jsxDynamicFromSlotComponent(createCompatSlotComponent(type, props), null, key);
|
|
13
|
+
}
|
|
14
|
+
if (isSlot(type)) {
|
|
15
|
+
return jsxDynamicFromSlotComponent(type, props, key);
|
|
16
|
+
}
|
|
17
|
+
return Runtime.jsx(type, props, key);
|
|
18
|
+
}
|
|
19
|
+
export function jsxs(type, props, key) {
|
|
20
|
+
// TODO:
|
|
21
|
+
// this is for backwards compatibility with getSlotsNext
|
|
22
|
+
// it should be removed once getSlotsNext is obsolete
|
|
23
|
+
if (isSlot(props)) {
|
|
24
|
+
return jsxStaticFromSlotComponent(createCompatSlotComponent(type, props), null, key);
|
|
25
|
+
}
|
|
26
|
+
if (isSlot(type)) {
|
|
27
|
+
return jsxStaticFromSlotComponent(type, props, key);
|
|
28
|
+
}
|
|
29
|
+
return Runtime.jsxs(type, props, key);
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsx-runtime.ts"],"sourcesContent":["import type * as React from 'react';\nimport { isSlot } from '@fluentui/react-utilities';\nimport { jsxDynamicFromSlotComponent } from './jsx/jsxDynamicFromSlotComponent';\nimport { jsxStaticFromSlotComponent } from './jsx/jsxStaticFromSlotComponent';\nimport { createCompatSlotComponent } from './utils/createCompatSlotComponent';\nimport { Runtime } from './utils/Runtime';\n\nexport { Fragment } from 'react';\n\nexport function jsx<P extends {}>(type: React.ElementType<P>, props: P, key?: React.Key): React.ReactElement<P> {\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 jsxDynamicFromSlotComponent(createCompatSlotComponent(type, props), null, key);\n }\n if (isSlot<P>(type)) {\n return jsxDynamicFromSlotComponent(type, props, key);\n }\n return Runtime.jsx(type, props, key);\n}\n\nexport function jsxs<P extends {}>(type: React.ElementType<P>, props: P, key?: React.Key): React.ReactElement<P> {\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 jsxStaticFromSlotComponent(createCompatSlotComponent(type, props), null, key);\n }\n if (isSlot<P>(type)) {\n return jsxStaticFromSlotComponent(type, props, key);\n }\n return Runtime.jsxs(type, props, key);\n}\n"],"names":["isSlot","jsxDynamicFromSlotComponent","jsxStaticFromSlotComponent","createCompatSlotComponent","Runtime","Fragment","jsx","type","props","key","jsxs"],"mappings":"AACA,SAASA,MAAM,QAAQ,4BAA4B;AACnD,SAASC,2BAA2B,QAAQ,oCAAoC;AAChF,SAASC,0BAA0B,QAAQ,mCAAmC;AAC9E,SAASC,yBAAyB,QAAQ,oCAAoC;AAC9E,SAASC,OAAO,QAAQ,kBAAkB;AAE1C,SAASC,QAAQ,QAAQ,QAAQ;AAEjC,OAAO,SAASC,IAAkBC,IAA0B,EAAEC,KAAQ,EAAEC,GAAe,EAAyB;IAC9G,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIT,OAAUQ,QAAQ;QACpB,OAAOP,4BAA4BE,0BAA0BI,MAAMC,QAAQ,IAAI,EAAEC;IACnF,CAAC;IACD,IAAIT,OAAUO,OAAO;QACnB,OAAON,4BAA4BM,MAAMC,OAAOC;IAClD,CAAC;IACD,OAAOL,QAAQE,GAAG,CAACC,MAAMC,OAAOC;AAClC,CAAC;AAED,OAAO,SAASC,KAAmBH,IAA0B,EAAEC,KAAQ,EAAEC,GAAe,EAAyB;IAC/G,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIT,OAAUQ,QAAQ;QACpB,OAAON,2BAA2BC,0BAA0BI,MAAMC,QAAQ,IAAI,EAAEC;IAClF,CAAC;IACD,IAAIT,OAAUO,OAAO;QACnB,OAAOL,2BAA2BK,MAAMC,OAAOC;IACjD,CAAC;IACD,OAAOL,QAAQM,IAAI,CAACH,MAAMC,OAAOC;AACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["DevRuntime.ts"],"sourcesContent":["import * as ReactDevRuntime from 'react/jsx-dev-runtime';\nimport type { JSXRuntime } from './types';\n\nexport const DevRuntime = ReactDevRuntime as {\n jsxDEV: JSXRuntime;\n};\n"],"names":["ReactDevRuntime","DevRuntime"],"mappings":"AAAA,YAAYA,qBAAqB,wBAAwB;AAGzD,OAAO,MAAMC,aAAaD,gBAExB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Runtime.ts"],"sourcesContent":["import * as ReactRuntime from 'react/jsx-runtime';\nimport type { JSXRuntime } from './types';\n\nexport const Runtime = ReactRuntime as {\n jsx: JSXRuntime;\n jsxs: JSXRuntime;\n};\n"],"names":["ReactRuntime","Runtime"],"mappings":"AAAA,YAAYA,kBAAkB,oBAAoB;AAGlD,OAAO,MAAMC,UAAUD,aAGrB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SLOT_ELEMENT_TYPE_SYMBOL } from '@fluentui/react-utilities';
|
|
3
|
+
// TODO:
|
|
4
|
+
// this is for backwards compatibility with getSlotsNext
|
|
5
|
+
// it should be removed once getSlotsNext is obsolete
|
|
6
|
+
export function createCompatSlotComponent(type, props) {
|
|
7
|
+
return {
|
|
8
|
+
...props,
|
|
9
|
+
[SLOT_ELEMENT_TYPE_SYMBOL]: type
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createCompatSlotComponent.ts"],"sourcesContent":["import * as React from 'react';\nimport { SLOT_ELEMENT_TYPE_SYMBOL } from '@fluentui/react-utilities';\nimport type { SlotComponentType } from '@fluentui/react-utilities';\n\n// TODO:\n// this is for backwards compatibility with getSlotsNext\n// it should be removed once getSlotsNext is obsolete\nexport function createCompatSlotComponent<P extends {}>(type: React.ElementType<P>, props: P): SlotComponentType<P> {\n return {\n ...props,\n [SLOT_ELEMENT_TYPE_SYMBOL]: type,\n } as SlotComponentType<P>;\n}\n"],"names":["React","SLOT_ELEMENT_TYPE_SYMBOL","createCompatSlotComponent","type","props"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,4BAA4B;AAGrE,QAAQ;AACR,wDAAwD;AACxD,qDAAqD;AACrD,OAAO,SAASC,0BAAwCC,IAA0B,EAAEC,KAAQ,EAAwB;IAClH,OAAO;QACL,GAAGA,KAAK;QACR,CAACH,yBAAyB,EAAEE;IAC9B;AACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/ export function getMetadataFromSlotComponent(type) {
|
|
5
|
+
const { as , [SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType , [SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...propsWithoutMetadata } = type;
|
|
6
|
+
const props = propsWithoutMetadata;
|
|
7
|
+
const elementType = typeof baseElementType === 'string' ? as !== null && as !== void 0 ? as : baseElementType : baseElementType;
|
|
8
|
+
if (typeof elementType !== 'string' && as) {
|
|
9
|
+
props.as = as;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
elementType,
|
|
13
|
+
props,
|
|
14
|
+
renderFunction
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["getMetadataFromSlotComponent.ts"],"sourcesContent":["import type * as React from 'react';\nimport { SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';\nimport type { SlotComponentType, UnknownSlotProps } from '@fluentui/react-utilities';\n\n/**\n * @internal\n */\nexport function getMetadataFromSlotComponent<Props extends UnknownSlotProps>(type: SlotComponentType<Props>) {\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 = (\n typeof baseElementType === 'string' ? as ?? baseElementType : baseElementType\n ) as React.ElementType<Props>;\n\n if (typeof elementType !== 'string' && as) {\n props.as = as;\n }\n return { elementType, props, renderFunction };\n}\n"],"names":["SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","getMetadataFromSlotComponent","type","as","baseElementType","renderFunction","propsWithoutMetadata","props","elementType"],"mappings":"AACA,SAASA,wBAAwB,EAAEC,2BAA2B,QAAQ,4BAA4B;AAGlG;;CAEC,GACD,OAAO,SAASC,6BAA6DC,IAA8B,EAAE;IAC3G,MAAM,EACJC,GAAE,EACF,CAACJ,yBAAyB,EAAEK,gBAAe,EAC3C,CAACJ,4BAA4B,EAAEK,eAAc,EAC7C,GAAGC,sBACJ,GAAGJ;IACJ,MAAMK,QAAQD;IAEd,MAAME,cACJ,OAAOJ,oBAAoB,WAAWD,eAAAA,gBAAAA,KAAMC,eAAe,GAAGA,eAAe;IAG/E,IAAI,OAAOI,gBAAgB,YAAYL,IAAI;QACzCI,MAAMJ,EAAE,GAAGA;IACb,CAAC;IACD,OAAO;QAAEK;QAAaD;QAAOF;IAAe;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["types.ts"],"sourcesContent":["import type * as React from 'react';\n\nexport type JSXRuntime = <P extends {}>(\n type: React.ElementType<P>,\n props: P | null,\n key?: React.Key,\n source?: unknown,\n self?: unknown,\n) => React.ReactElement<P>;\n"],"names":[],"mappings":"AAAA,WAQ2B"}
|
|
@@ -9,33 +9,17 @@ Object.defineProperty(exports, "createElement", {
|
|
|
9
9
|
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
10
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
11
|
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _createElementFromSlotComponent = require("./jsx/createElementFromSlotComponent");
|
|
13
|
+
const _createCompatSlotComponent = require("./utils/createCompatSlotComponent");
|
|
12
14
|
function createElement(type, props, ...children) {
|
|
13
15
|
// TODO:
|
|
14
16
|
// this is for backwards compatibility with getSlotsNext
|
|
15
17
|
// it should be removed once getSlotsNext is obsolete
|
|
16
18
|
if ((0, _reactUtilities.isSlot)(props)) {
|
|
17
|
-
return createElementFromSlotComponent(
|
|
18
|
-
...props,
|
|
19
|
-
[_reactUtilities.SLOT_ELEMENT_TYPE_SYMBOL]: type
|
|
20
|
-
}, children);
|
|
19
|
+
return (0, _createElementFromSlotComponent.createElementFromSlotComponent)((0, _createCompatSlotComponent.createCompatSlotComponent)(type, props), children);
|
|
21
20
|
}
|
|
22
21
|
if ((0, _reactUtilities.isSlot)(type)) {
|
|
23
|
-
return createElementFromSlotComponent(type, children);
|
|
22
|
+
return (0, _createElementFromSlotComponent.createElementFromSlotComponent)(type, children);
|
|
24
23
|
}
|
|
25
24
|
return /*#__PURE__*/ _react.createElement(type, props, ...children);
|
|
26
25
|
}
|
|
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);
|
|
41
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["createElement.js"],"sourcesContent":["import * as React from 'react';\nimport { isSlot
|
|
1
|
+
{"version":3,"sources":["createElement.js"],"sourcesContent":["import * as React from 'react';\nimport { isSlot } from '@fluentui/react-utilities';\nimport { createElementFromSlotComponent } from './jsx/createElementFromSlotComponent';\nimport { createCompatSlotComponent } from './utils/createCompatSlotComponent';\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(createCompatSlotComponent(type, props), children);\n }\n if (isSlot(type)) {\n return createElementFromSlotComponent(type, children);\n }\n return React.createElement(type, props, ...children);\n}\n"],"names":["createElement","type","props","children","isSlot","createElementFromSlotComponent","createCompatSlotComponent","React"],"mappings":";;;;+BAIgBA;;aAAAA;;;6DAJO;gCACA;gDACwB;2CACL;AACnC,SAASA,cAAcC,IAAI,EAAEC,KAAK,EAAE,GAAGC,QAAQ,EAAE;IACpD,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIC,IAAAA,sBAAM,EAACF,QAAQ;QACf,OAAOG,IAAAA,8DAA8B,EAACC,IAAAA,oDAAyB,EAACL,MAAMC,QAAQC;IAClF,CAAC;IACD,IAAIC,IAAAA,sBAAM,EAACH,OAAO;QACd,OAAOI,IAAAA,8DAA8B,EAACJ,MAAME;IAChD,CAAC;IACD,qBAAOI,OAAMP,aAAa,CAACC,MAAMC,UAAUC;AAC/C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "createElementFromSlotComponent", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>createElementFromSlotComponent
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _getMetadataFromSlotComponent = require("../utils/getMetadataFromSlotComponent");
|
|
12
|
+
function createElementFromSlotComponent(type, overrideChildren) {
|
|
13
|
+
const { elementType , renderFunction , props } = (0, _getMetadataFromSlotComponent.getMetadataFromSlotComponent)(type);
|
|
14
|
+
if (renderFunction) {
|
|
15
|
+
if (overrideChildren.length > 0) {
|
|
16
|
+
props.children = /*#__PURE__*/ _react.createElement(_react.Fragment, {}, ...overrideChildren);
|
|
17
|
+
}
|
|
18
|
+
return /*#__PURE__*/ _react.createElement(_react.Fragment, {}, renderFunction(elementType, props));
|
|
19
|
+
}
|
|
20
|
+
return /*#__PURE__*/ _react.createElement(elementType, props, ...overrideChildren);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createElementFromSlotComponent.js"],"sourcesContent":["import * as React from 'react';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\n/**\n * @internal\n * creates a ReactElement from a slot declaration\n */ export function createElementFromSlotComponent(type, overrideChildren) {\n const { elementType , renderFunction , props } = getMetadataFromSlotComponent(type);\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":["createElementFromSlotComponent","type","overrideChildren","elementType","renderFunction","props","getMetadataFromSlotComponent","length","children","React","createElement","Fragment"],"mappings":";;;;+BAKoBA;;aAAAA;;;6DALG;8CACsB;AAIlC,SAASA,+BAA+BC,IAAI,EAAEC,gBAAgB,EAAE;IACvE,MAAM,EAAEC,YAAW,EAAGC,eAAc,EAAGC,MAAK,EAAG,GAAGC,IAAAA,0DAA4B,EAACL;IAC/E,IAAIG,gBAAgB;QAChB,IAAIF,iBAAiBK,MAAM,GAAG,GAAG;YAC7BF,MAAMG,QAAQ,iBAAGC,OAAMC,aAAa,CAACD,OAAME,QAAQ,EAAE,CAAC,MAAMT;QAChE,CAAC;QACD,qBAAOO,OAAMC,aAAa,CAACD,OAAME,QAAQ,EAAE,CAAC,GAAGP,eAAeD,aAAaE;IAC/E,CAAC;IACD,qBAAOI,OAAMC,aAAa,CAACP,aAAaE,UAAUH;AACtD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "jsxDEVFromSlotComponent", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>jsxDEVFromSlotComponent
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _getMetadataFromSlotComponent = require("../utils/getMetadataFromSlotComponent");
|
|
12
|
+
const _devRuntime = require("../utils/DevRuntime");
|
|
13
|
+
function jsxDEVFromSlotComponent(type, overrideProps, key, source, self) {
|
|
14
|
+
const { elementType , renderFunction , props: slotProps } = (0, _getMetadataFromSlotComponent.getMetadataFromSlotComponent)(type);
|
|
15
|
+
const props = {
|
|
16
|
+
...slotProps,
|
|
17
|
+
...overrideProps
|
|
18
|
+
};
|
|
19
|
+
if (renderFunction) {
|
|
20
|
+
return _devRuntime.DevRuntime.jsxDEV(_react.Fragment, {
|
|
21
|
+
children: renderFunction(elementType, props)
|
|
22
|
+
}, key, source, self);
|
|
23
|
+
}
|
|
24
|
+
return _devRuntime.DevRuntime.jsxDEV(elementType, props, key, source, self);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsxDEVFromSlotComponent.js"],"sourcesContent":["import * as React from 'react';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { DevRuntime } from '../utils/DevRuntime';\nexport function jsxDEVFromSlotComponent(type, overrideProps, key, source, self) {\n const { elementType , renderFunction , props: slotProps } = getMetadataFromSlotComponent(type);\n const props = {\n ...slotProps,\n ...overrideProps\n };\n if (renderFunction) {\n return DevRuntime.jsxDEV(React.Fragment, {\n children: renderFunction(elementType, props)\n }, key, source, self);\n }\n return DevRuntime.jsxDEV(elementType, props, key, source, self);\n}\n"],"names":["jsxDEVFromSlotComponent","type","overrideProps","key","source","self","elementType","renderFunction","props","slotProps","getMetadataFromSlotComponent","DevRuntime","jsxDEV","React","Fragment","children"],"mappings":";;;;+BAGgBA;;aAAAA;;;6DAHO;8CACsB;4BAClB;AACpB,SAASA,wBAAwBC,IAAI,EAAEC,aAAa,EAAEC,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAE;IAC5E,MAAM,EAAEC,YAAW,EAAGC,eAAc,EAAGC,OAAOC,UAAS,EAAG,GAAGC,IAAAA,0DAA4B,EAACT;IAC1F,MAAMO,QAAQ;QACV,GAAGC,SAAS;QACZ,GAAGP,aAAa;IACpB;IACA,IAAIK,gBAAgB;QAChB,OAAOI,sBAAU,CAACC,MAAM,CAACC,OAAMC,QAAQ,EAAE;YACrCC,UAAUR,eAAeD,aAAaE;QAC1C,GAAGL,KAAKC,QAAQC;IACpB,CAAC;IACD,OAAOM,sBAAU,CAACC,MAAM,CAACN,aAAaE,OAAOL,KAAKC,QAAQC;AAC9D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "jsxDynamicFromSlotComponent", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>jsxDynamicFromSlotComponent
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _getMetadataFromSlotComponent = require("../utils/getMetadataFromSlotComponent");
|
|
12
|
+
const _runtime = require("../utils/Runtime");
|
|
13
|
+
function jsxDynamicFromSlotComponent(type, overrideProps, key) {
|
|
14
|
+
const { elementType , renderFunction , props: slotProps } = (0, _getMetadataFromSlotComponent.getMetadataFromSlotComponent)(type);
|
|
15
|
+
const props = {
|
|
16
|
+
...slotProps,
|
|
17
|
+
...overrideProps
|
|
18
|
+
};
|
|
19
|
+
if (renderFunction) {
|
|
20
|
+
return _runtime.Runtime.jsx(_react.Fragment, {
|
|
21
|
+
children: renderFunction(elementType, props)
|
|
22
|
+
}, key);
|
|
23
|
+
}
|
|
24
|
+
return _runtime.Runtime.jsx(elementType, props, key);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsxDynamicFromSlotComponent.js"],"sourcesContent":["import * as React from 'react';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { Runtime } from '../utils/Runtime';\n/**\n * @internal\n */ export function jsxDynamicFromSlotComponent(type, overrideProps, key) {\n const { elementType , renderFunction , props: slotProps } = getMetadataFromSlotComponent(type);\n const props = {\n ...slotProps,\n ...overrideProps\n };\n if (renderFunction) {\n return Runtime.jsx(React.Fragment, {\n children: renderFunction(elementType, props)\n }, key);\n }\n return Runtime.jsx(elementType, props, key);\n}\n"],"names":["jsxDynamicFromSlotComponent","type","overrideProps","key","elementType","renderFunction","props","slotProps","getMetadataFromSlotComponent","Runtime","jsx","React","Fragment","children"],"mappings":";;;;+BAKoBA;;aAAAA;;;6DALG;8CACsB;yBACrB;AAGb,SAASA,4BAA4BC,IAAI,EAAEC,aAAa,EAAEC,GAAG,EAAE;IACtE,MAAM,EAAEC,YAAW,EAAGC,eAAc,EAAGC,OAAOC,UAAS,EAAG,GAAGC,IAAAA,0DAA4B,EAACP;IAC1F,MAAMK,QAAQ;QACV,GAAGC,SAAS;QACZ,GAAGL,aAAa;IACpB;IACA,IAAIG,gBAAgB;QAChB,OAAOI,gBAAO,CAACC,GAAG,CAACC,OAAMC,QAAQ,EAAE;YAC/BC,UAAUR,eAAeD,aAAaE;QAC1C,GAAGH;IACP,CAAC;IACD,OAAOM,gBAAO,CAACC,GAAG,CAACN,aAAaE,OAAOH;AAC3C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "jsxStaticFromSlotComponent", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>jsxStaticFromSlotComponent
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _getMetadataFromSlotComponent = require("../utils/getMetadataFromSlotComponent");
|
|
12
|
+
const _runtime = require("../utils/Runtime");
|
|
13
|
+
function jsxStaticFromSlotComponent(type, overrideProps, key) {
|
|
14
|
+
const { elementType , renderFunction , props: slotProps } = (0, _getMetadataFromSlotComponent.getMetadataFromSlotComponent)(type);
|
|
15
|
+
const props = {
|
|
16
|
+
...slotProps,
|
|
17
|
+
...overrideProps
|
|
18
|
+
};
|
|
19
|
+
if (renderFunction) {
|
|
20
|
+
return _runtime.Runtime.jsxs(_react.Fragment, {
|
|
21
|
+
children: renderFunction(elementType, props)
|
|
22
|
+
}, key);
|
|
23
|
+
}
|
|
24
|
+
return _runtime.Runtime.jsxs(elementType, props, key);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsxStaticFromSlotComponent.js"],"sourcesContent":["import * as React from 'react';\nimport { getMetadataFromSlotComponent } from '../utils/getMetadataFromSlotComponent';\nimport { Runtime } from '../utils/Runtime';\n/**\n * @internal\n */ export function jsxStaticFromSlotComponent(type, overrideProps, key) {\n const { elementType , renderFunction , props: slotProps } = getMetadataFromSlotComponent(type);\n const props = {\n ...slotProps,\n ...overrideProps\n };\n if (renderFunction) {\n return Runtime.jsxs(React.Fragment, {\n children: renderFunction(elementType, props)\n }, key);\n }\n return Runtime.jsxs(elementType, props, key);\n}\n"],"names":["jsxStaticFromSlotComponent","type","overrideProps","key","elementType","renderFunction","props","slotProps","getMetadataFromSlotComponent","Runtime","jsxs","React","Fragment","children"],"mappings":";;;;+BAKoBA;;aAAAA;;;6DALG;8CACsB;yBACrB;AAGb,SAASA,2BAA2BC,IAAI,EAAEC,aAAa,EAAEC,GAAG,EAAE;IACrE,MAAM,EAAEC,YAAW,EAAGC,eAAc,EAAGC,OAAOC,UAAS,EAAG,GAAGC,IAAAA,0DAA4B,EAACP;IAC1F,MAAMK,QAAQ;QACV,GAAGC,SAAS;QACZ,GAAGL,aAAa;IACpB;IACA,IAAIG,gBAAgB;QAChB,OAAOI,gBAAO,CAACC,IAAI,CAACC,OAAMC,QAAQ,EAAE;YAChCC,UAAUR,eAAeD,aAAaE;QAC1C,GAAGH;IACP,CAAC;IACD,OAAOM,gBAAO,CAACC,IAAI,CAACN,aAAaE,OAAOH;AAC5C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
Fragment: ()=>_react.Fragment,
|
|
13
|
+
jsxDEV: ()=>jsxDEV
|
|
14
|
+
});
|
|
15
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
16
|
+
const _jsxDEVFromSlotComponent = require("./jsx/jsxDEVFromSlotComponent");
|
|
17
|
+
const _createCompatSlotComponent = require("./utils/createCompatSlotComponent");
|
|
18
|
+
const _devRuntime = require("./utils/DevRuntime");
|
|
19
|
+
const _react = require("react");
|
|
20
|
+
function jsxDEV(type, props, key, source, self) {
|
|
21
|
+
// TODO:
|
|
22
|
+
// this is for backwards compatibility with getSlotsNext
|
|
23
|
+
// it should be removed once getSlotsNext is obsolete
|
|
24
|
+
if ((0, _reactUtilities.isSlot)(props)) {
|
|
25
|
+
return (0, _jsxDEVFromSlotComponent.jsxDEVFromSlotComponent)((0, _createCompatSlotComponent.createCompatSlotComponent)(type, props), null, key, source, self);
|
|
26
|
+
}
|
|
27
|
+
if ((0, _reactUtilities.isSlot)(type)) {
|
|
28
|
+
return (0, _jsxDEVFromSlotComponent.jsxDEVFromSlotComponent)(type, props, key, source, self);
|
|
29
|
+
}
|
|
30
|
+
return _devRuntime.DevRuntime.jsxDEV(type, props, key, source, self);
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsx-dev-runtime.js"],"sourcesContent":["import { isSlot } from '@fluentui/react-utilities';\nimport { jsxDEVFromSlotComponent } from './jsx/jsxDEVFromSlotComponent';\nimport { createCompatSlotComponent } from './utils/createCompatSlotComponent';\nimport { DevRuntime } from './utils/DevRuntime';\nexport { Fragment } from 'react';\nexport function jsxDEV(type, props, key, source, self) {\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 jsxDEVFromSlotComponent(createCompatSlotComponent(type, props), null, key, source, self);\n }\n if (isSlot(type)) {\n return jsxDEVFromSlotComponent(type, props, key, source, self);\n }\n return DevRuntime.jsxDEV(type, props, key, source, self);\n}\n"],"names":["Fragment","jsxDEV","type","props","key","source","self","isSlot","jsxDEVFromSlotComponent","createCompatSlotComponent","DevRuntime"],"mappings":";;;;;;;;;;;IAISA,QAAQ,MAARA,eAAQ;IACDC,MAAM,MAANA;;gCALO;yCACiB;2CACE;4BACf;uBACF;AAClB,SAASA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAE;IACnD,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIC,IAAAA,sBAAM,EAACJ,QAAQ;QACf,OAAOK,IAAAA,gDAAuB,EAACC,IAAAA,oDAAyB,EAACP,MAAMC,QAAQ,IAAI,EAAEC,KAAKC,QAAQC;IAC9F,CAAC;IACD,IAAIC,IAAAA,sBAAM,EAACL,OAAO;QACd,OAAOM,IAAAA,gDAAuB,EAACN,MAAMC,OAAOC,KAAKC,QAAQC;IAC7D,CAAC;IACD,OAAOI,sBAAU,CAACT,MAAM,CAACC,MAAMC,OAAOC,KAAKC,QAAQC;AACvD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
Fragment: ()=>_react.Fragment,
|
|
13
|
+
jsx: ()=>jsx,
|
|
14
|
+
jsxs: ()=>jsxs
|
|
15
|
+
});
|
|
16
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
17
|
+
const _jsxDynamicFromSlotComponent = require("./jsx/jsxDynamicFromSlotComponent");
|
|
18
|
+
const _jsxStaticFromSlotComponent = require("./jsx/jsxStaticFromSlotComponent");
|
|
19
|
+
const _createCompatSlotComponent = require("./utils/createCompatSlotComponent");
|
|
20
|
+
const _runtime = require("./utils/Runtime");
|
|
21
|
+
const _react = require("react");
|
|
22
|
+
function jsx(type, props, key) {
|
|
23
|
+
// TODO:
|
|
24
|
+
// this is for backwards compatibility with getSlotsNext
|
|
25
|
+
// it should be removed once getSlotsNext is obsolete
|
|
26
|
+
if ((0, _reactUtilities.isSlot)(props)) {
|
|
27
|
+
return (0, _jsxDynamicFromSlotComponent.jsxDynamicFromSlotComponent)((0, _createCompatSlotComponent.createCompatSlotComponent)(type, props), null, key);
|
|
28
|
+
}
|
|
29
|
+
if ((0, _reactUtilities.isSlot)(type)) {
|
|
30
|
+
return (0, _jsxDynamicFromSlotComponent.jsxDynamicFromSlotComponent)(type, props, key);
|
|
31
|
+
}
|
|
32
|
+
return _runtime.Runtime.jsx(type, props, key);
|
|
33
|
+
}
|
|
34
|
+
function jsxs(type, props, key) {
|
|
35
|
+
// TODO:
|
|
36
|
+
// this is for backwards compatibility with getSlotsNext
|
|
37
|
+
// it should be removed once getSlotsNext is obsolete
|
|
38
|
+
if ((0, _reactUtilities.isSlot)(props)) {
|
|
39
|
+
return (0, _jsxStaticFromSlotComponent.jsxStaticFromSlotComponent)((0, _createCompatSlotComponent.createCompatSlotComponent)(type, props), null, key);
|
|
40
|
+
}
|
|
41
|
+
if ((0, _reactUtilities.isSlot)(type)) {
|
|
42
|
+
return (0, _jsxStaticFromSlotComponent.jsxStaticFromSlotComponent)(type, props, key);
|
|
43
|
+
}
|
|
44
|
+
return _runtime.Runtime.jsxs(type, props, key);
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["jsx-runtime.js"],"sourcesContent":["import { isSlot } from '@fluentui/react-utilities';\nimport { jsxDynamicFromSlotComponent } from './jsx/jsxDynamicFromSlotComponent';\nimport { jsxStaticFromSlotComponent } from './jsx/jsxStaticFromSlotComponent';\nimport { createCompatSlotComponent } from './utils/createCompatSlotComponent';\nimport { Runtime } from './utils/Runtime';\nexport { Fragment } from 'react';\nexport function jsx(type, props, key) {\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 jsxDynamicFromSlotComponent(createCompatSlotComponent(type, props), null, key);\n }\n if (isSlot(type)) {\n return jsxDynamicFromSlotComponent(type, props, key);\n }\n return Runtime.jsx(type, props, key);\n}\nexport function jsxs(type, props, key) {\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 jsxStaticFromSlotComponent(createCompatSlotComponent(type, props), null, key);\n }\n if (isSlot(type)) {\n return jsxStaticFromSlotComponent(type, props, key);\n }\n return Runtime.jsxs(type, props, key);\n}\n"],"names":["Fragment","jsx","jsxs","type","props","key","isSlot","jsxDynamicFromSlotComponent","createCompatSlotComponent","Runtime","jsxStaticFromSlotComponent"],"mappings":";;;;;;;;;;;IAKSA,QAAQ,MAARA,eAAQ;IACDC,GAAG,MAAHA;IAYAC,IAAI,MAAJA;;gCAlBO;6CACqB;4CACD;2CACD;yBAClB;uBACC;AAClB,SAASD,IAAIE,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAE;IAClC,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIC,IAAAA,sBAAM,EAACF,QAAQ;QACf,OAAOG,IAAAA,wDAA2B,EAACC,IAAAA,oDAAyB,EAACL,MAAMC,QAAQ,IAAI,EAAEC;IACrF,CAAC;IACD,IAAIC,IAAAA,sBAAM,EAACH,OAAO;QACd,OAAOI,IAAAA,wDAA2B,EAACJ,MAAMC,OAAOC;IACpD,CAAC;IACD,OAAOI,gBAAO,CAACR,GAAG,CAACE,MAAMC,OAAOC;AACpC;AACO,SAASH,KAAKC,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAE;IACnC,QAAQ;IACR,wDAAwD;IACxD,qDAAqD;IACrD,IAAIC,IAAAA,sBAAM,EAACF,QAAQ;QACf,OAAOM,IAAAA,sDAA0B,EAACF,IAAAA,oDAAyB,EAACL,MAAMC,QAAQ,IAAI,EAAEC;IACpF,CAAC;IACD,IAAIC,IAAAA,sBAAM,EAACH,OAAO;QACd,OAAOO,IAAAA,sDAA0B,EAACP,MAAMC,OAAOC;IACnD,CAAC;IACD,OAAOI,gBAAO,CAACP,IAAI,CAACC,MAAMC,OAAOC;AACrC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "DevRuntime", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>DevRuntime
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _jsxDevRuntime = /*#__PURE__*/ _interopRequireWildcard(require("react/jsx-dev-runtime"));
|
|
11
|
+
const DevRuntime = _jsxDevRuntime;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["DevRuntime.js"],"sourcesContent":["import * as ReactDevRuntime from 'react/jsx-dev-runtime';\nexport const DevRuntime = ReactDevRuntime;\n"],"names":["DevRuntime","ReactDevRuntime"],"mappings":";;;;+BACaA;;aAAAA;;;qEADoB;AAC1B,MAAMA,aAAaC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Runtime", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Runtime
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _jsxRuntime = /*#__PURE__*/ _interopRequireWildcard(require("react/jsx-runtime"));
|
|
11
|
+
const Runtime = _jsxRuntime;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Runtime.js"],"sourcesContent":["import * as ReactRuntime from 'react/jsx-runtime';\nexport const Runtime = ReactRuntime;\n"],"names":["Runtime","ReactRuntime"],"mappings":";;;;+BACaA;;aAAAA;;;kEADiB;AACvB,MAAMA,UAAUC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "createCompatSlotComponent", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>createCompatSlotComponent
|
|
8
|
+
});
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
function createCompatSlotComponent(type, props) {
|
|
13
|
+
return {
|
|
14
|
+
...props,
|
|
15
|
+
[_reactUtilities.SLOT_ELEMENT_TYPE_SYMBOL]: type
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createCompatSlotComponent.js"],"sourcesContent":["import * as React from 'react';\nimport { SLOT_ELEMENT_TYPE_SYMBOL } from '@fluentui/react-utilities';\n// TODO:\n// this is for backwards compatibility with getSlotsNext\n// it should be removed once getSlotsNext is obsolete\nexport function createCompatSlotComponent(type, props) {\n return {\n ...props,\n [SLOT_ELEMENT_TYPE_SYMBOL]: type\n };\n}\n"],"names":["createCompatSlotComponent","type","props","SLOT_ELEMENT_TYPE_SYMBOL"],"mappings":";;;;+BAKgBA;;aAAAA;;;6DALO;gCACkB;AAIlC,SAASA,0BAA0BC,IAAI,EAAEC,KAAK,EAAE;IACnD,OAAO;QACH,GAAGA,KAAK;QACR,CAACC,wCAAwB,CAAC,EAAEF;IAChC;AACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getMetadataFromSlotComponent", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>getMetadataFromSlotComponent
|
|
8
|
+
});
|
|
9
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
10
|
+
function getMetadataFromSlotComponent(type) {
|
|
11
|
+
const { as , [_reactUtilities.SLOT_ELEMENT_TYPE_SYMBOL]: baseElementType , [_reactUtilities.SLOT_RENDER_FUNCTION_SYMBOL]: renderFunction , ...propsWithoutMetadata } = type;
|
|
12
|
+
const props = propsWithoutMetadata;
|
|
13
|
+
const elementType = typeof baseElementType === 'string' ? as !== null && as !== void 0 ? as : baseElementType : baseElementType;
|
|
14
|
+
if (typeof elementType !== 'string' && as) {
|
|
15
|
+
props.as = as;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
elementType,
|
|
19
|
+
props,
|
|
20
|
+
renderFunction
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["getMetadataFromSlotComponent.js"],"sourcesContent":["import { SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';\n/**\n * @internal\n */ export function getMetadataFromSlotComponent(type) {\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 return {\n elementType,\n props,\n renderFunction\n };\n}\n"],"names":["getMetadataFromSlotComponent","type","as","SLOT_ELEMENT_TYPE_SYMBOL","baseElementType","SLOT_RENDER_FUNCTION_SYMBOL","renderFunction","propsWithoutMetadata","props","elementType"],"mappings":";;;;+BAGoBA;;aAAAA;;gCAHkD;AAG3D,SAASA,6BAA6BC,IAAI,EAAE;IACnD,MAAM,EAAEC,GAAE,EAAG,CAACC,wCAAwB,CAAC,EAAEC,gBAAe,EAAG,CAACC,2CAA2B,CAAC,EAAEC,eAAc,EAAG,GAAGC,sBAAsB,GAAGN;IACvI,MAAMO,QAAQD;IACd,MAAME,cAAc,OAAOL,oBAAoB,WAAWF,OAAO,IAAI,IAAIA,OAAO,KAAK,IAAIA,KAAKE,eAAe,GAAGA,eAAe;IAC/H,IAAI,OAAOK,gBAAgB,YAAYP,IAAI;QACvCM,MAAMN,EAAE,GAAGA;IACf,CAAC;IACD,OAAO;QACHO;QACAD;QACAF;IACJ;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
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.16",
|
|
4
4
|
"description": "React components for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -51,6 +51,18 @@
|
|
|
51
51
|
"import": "./lib/index.js",
|
|
52
52
|
"require": "./lib-commonjs/index.js"
|
|
53
53
|
},
|
|
54
|
+
"./jsx-dev-runtime": {
|
|
55
|
+
"types": "./dist/jsx-dev-runtime.d.ts",
|
|
56
|
+
"node": "./lib-commonjs/jsx-dev-runtime.js",
|
|
57
|
+
"import": "./lib/jsx-dev-runtime.js",
|
|
58
|
+
"require": "./lib-commonjs/jsx-dev-runtime.js"
|
|
59
|
+
},
|
|
60
|
+
"./jsx-runtime": {
|
|
61
|
+
"types": "./dist/jsx-runtime.d.ts",
|
|
62
|
+
"node": "./lib-commonjs/jsx-runtime.js",
|
|
63
|
+
"import": "./lib/jsx-runtime.js",
|
|
64
|
+
"require": "./lib-commonjs/jsx-runtime.js"
|
|
65
|
+
},
|
|
54
66
|
"./package.json": "./package.json"
|
|
55
67
|
}
|
|
56
68
|
}
|