@fluentui/react-jsx-runtime 0.0.0-nightly-20230815-0415.1 → 0.0.0-nightly-20230817-0413.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.
Files changed (53) hide show
  1. package/CHANGELOG.json +39 -9
  2. package/CHANGELOG.md +25 -7
  3. package/README.md +46 -2
  4. package/dist/index.d.ts +1 -1
  5. package/lib/createElement.js +4 -20
  6. package/lib/createElement.js.map +1 -1
  7. package/lib/jsx/createElementFromSlotComponent.js +15 -0
  8. package/lib/jsx/createElementFromSlotComponent.js.map +1 -0
  9. package/lib/jsx/jsxDEVFromSlotComponent.js +16 -0
  10. package/lib/jsx/jsxDEVFromSlotComponent.js.map +1 -0
  11. package/lib/jsx/jsxDynamicFromSlotComponent.js +18 -0
  12. package/lib/jsx/jsxDynamicFromSlotComponent.js.map +1 -0
  13. package/lib/jsx/jsxStaticFromSlotComponent.js +18 -0
  14. package/lib/jsx/jsxStaticFromSlotComponent.js.map +1 -0
  15. package/lib/jsx-dev-runtime.js +17 -0
  16. package/lib/jsx-dev-runtime.js.map +1 -0
  17. package/lib/jsx-runtime.js +30 -0
  18. package/lib/jsx-runtime.js.map +1 -0
  19. package/lib/utils/DevRuntime.js +2 -0
  20. package/lib/utils/DevRuntime.js.map +1 -0
  21. package/lib/utils/Runtime.js +2 -0
  22. package/lib/utils/Runtime.js.map +1 -0
  23. package/lib/utils/createCompatSlotComponent.js +11 -0
  24. package/lib/utils/createCompatSlotComponent.js.map +1 -0
  25. package/lib/utils/getMetadataFromSlotComponent.js +16 -0
  26. package/lib/utils/getMetadataFromSlotComponent.js.map +1 -0
  27. package/lib/utils/types.js +1 -0
  28. package/lib/utils/types.js.map +1 -0
  29. package/lib-commonjs/createElement.js +4 -20
  30. package/lib-commonjs/createElement.js.map +1 -1
  31. package/lib-commonjs/jsx/createElementFromSlotComponent.js +21 -0
  32. package/lib-commonjs/jsx/createElementFromSlotComponent.js.map +1 -0
  33. package/lib-commonjs/jsx/jsxDEVFromSlotComponent.js +25 -0
  34. package/lib-commonjs/jsx/jsxDEVFromSlotComponent.js.map +1 -0
  35. package/lib-commonjs/jsx/jsxDynamicFromSlotComponent.js +25 -0
  36. package/lib-commonjs/jsx/jsxDynamicFromSlotComponent.js.map +1 -0
  37. package/lib-commonjs/jsx/jsxStaticFromSlotComponent.js +25 -0
  38. package/lib-commonjs/jsx/jsxStaticFromSlotComponent.js.map +1 -0
  39. package/lib-commonjs/jsx-dev-runtime.js +31 -0
  40. package/lib-commonjs/jsx-dev-runtime.js.map +1 -0
  41. package/lib-commonjs/jsx-runtime.js +45 -0
  42. package/lib-commonjs/jsx-runtime.js.map +1 -0
  43. package/lib-commonjs/utils/DevRuntime.js +11 -0
  44. package/lib-commonjs/utils/DevRuntime.js.map +1 -0
  45. package/lib-commonjs/utils/Runtime.js +11 -0
  46. package/lib-commonjs/utils/Runtime.js.map +1 -0
  47. package/lib-commonjs/utils/createCompatSlotComponent.js +17 -0
  48. package/lib-commonjs/utils/createCompatSlotComponent.js.map +1 -0
  49. package/lib-commonjs/utils/getMetadataFromSlotComponent.js +22 -0
  50. package/lib-commonjs/utils/getMetadataFromSlotComponent.js.map +1 -0
  51. package/lib-commonjs/utils/types.js +4 -0
  52. package/lib-commonjs/utils/types.js.map +1 -0
  53. package/package.json +17 -5
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-jsx-runtime",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 15 Aug 2023 04:21:33 GMT",
6
- "tag": "@fluentui/react-jsx-runtime_v0.0.0-nightly-20230815-0415.1",
7
- "version": "0.0.0-nightly-20230815-0415.1",
5
+ "date": "Thu, 17 Aug 2023 04:19:53 GMT",
6
+ "tag": "@fluentui/react-jsx-runtime_v0.0.0-nightly-20230817-0413.1",
7
+ "version": "0.0.0-nightly-20230817-0413.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,20 +16,50 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-jsx-runtime",
19
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230815-0415.1",
20
- "commit": "35864121426b47a4396e6d533e0b6a1185aaf2d8"
19
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230817-0413.1",
20
+ "commit": "ab6eb074e07edda9536971cfe2b219d8653af736"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-jsx-runtime",
25
- "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20230815-0415.1",
26
- "commit": "35864121426b47a4396e6d533e0b6a1185aaf2d8"
25
+ "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20230817-0413.1",
26
+ "commit": "ab6eb074e07edda9536971cfe2b219d8653af736"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-jsx-runtime",
31
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230815-0415.1",
32
- "commit": "35864121426b47a4396e6d533e0b6a1185aaf2d8"
31
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230817-0413.1",
32
+ "commit": "ab6eb074e07edda9536971cfe2b219d8653af736"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Wed, 16 Aug 2023 17:41:07 GMT",
39
+ "tag": "@fluentui/react-jsx-runtime_v9.0.0",
40
+ "version": "9.0.0",
41
+ "comments": {
42
+ "patch": [
43
+ {
44
+ "author": "bernardo.sunderhus@gmail.com",
45
+ "package": "@fluentui/react-jsx-runtime",
46
+ "commit": "7e2ba9c3e9e9e426e18bc5861fd84211400780ac",
47
+ "comment": "chore: release stable version"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Wed, 16 Aug 2023 11:38:33 GMT",
54
+ "tag": "@fluentui/react-jsx-runtime_v9.0.0-alpha.16",
55
+ "version": "9.0.0-alpha.16",
56
+ "comments": {
57
+ "prerelease": [
58
+ {
59
+ "author": "bernardo.sunderhus@gmail.com",
60
+ "package": "@fluentui/react-jsx-runtime",
61
+ "commit": "d40ea6e1d43cd21d1404d9c71018d822958c6644",
62
+ "comment": "feat: supports new automatic JSX runtime"
33
63
  }
34
64
  ]
35
65
  }
package/CHANGELOG.md CHANGED
@@ -1,20 +1,38 @@
1
1
  # Change Log - @fluentui/react-jsx-runtime
2
2
 
3
- This log was last generated on Tue, 15 Aug 2023 04:21:33 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Aug 2023 04:19:53 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230815-0415.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v0.0.0-nightly-20230815-0415.1)
7
+ ## [0.0.0-nightly-20230817-0413.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v0.0.0-nightly-20230817-0413.1)
8
8
 
9
- Tue, 15 Aug 2023 04:21:33 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.15..@fluentui/react-jsx-runtime_v0.0.0-nightly-20230815-0415.1)
9
+ Thu, 17 Aug 2023 04:19:53 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0..@fluentui/react-jsx-runtime_v0.0.0-nightly-20230817-0413.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20230815-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/35864121426b47a4396e6d533e0b6a1185aaf2d8) by beachball)
16
- - Bump @fluentui/react-conformance to v0.0.0-nightly-20230815-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/35864121426b47a4396e6d533e0b6a1185aaf2d8) by beachball)
17
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230815-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/35864121426b47a4396e6d533e0b6a1185aaf2d8) by beachball)
15
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20230817-0413.1 ([commit](https://github.com/microsoft/fluentui/commit/ab6eb074e07edda9536971cfe2b219d8653af736) by beachball)
16
+ - Bump @fluentui/react-conformance to v0.0.0-nightly-20230817-0413.1 ([commit](https://github.com/microsoft/fluentui/commit/ab6eb074e07edda9536971cfe2b219d8653af736) by beachball)
17
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230817-0413.1 ([commit](https://github.com/microsoft/fluentui/commit/ab6eb074e07edda9536971cfe2b219d8653af736) by beachball)
18
+
19
+ ## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0)
20
+
21
+ Wed, 16 Aug 2023 17:41:07 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-jsx-runtime_v9.0.0-alpha.16..@fluentui/react-jsx-runtime_v9.0.0)
23
+
24
+ ### Patches
25
+
26
+ - chore: release stable version ([PR #28880](https://github.com/microsoft/fluentui/pull/28880) by bernardo.sunderhus@gmail.com)
27
+
28
+ ## [9.0.0-alpha.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.16)
29
+
30
+ Wed, 16 Aug 2023 11:38:33 GMT
31
+ [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)
32
+
33
+ ### Changes
34
+
35
+ - feat: supports new automatic JSX runtime ([PR #28810](https://github.com/microsoft/fluentui/pull/28810) by bernardo.sunderhus@gmail.com)
18
36
 
19
37
  ## [9.0.0-alpha.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-jsx-runtime_v9.0.0-alpha.15)
20
38
 
package/README.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @fluentui/react-jsx-runtime
2
2
 
3
- **React Jsx Runtime components for [Fluent UI React](https://react.fluentui.dev/)**
3
+ **React JSX runtime for [Fluent UI React](https://react.fluentui.dev/)**
4
4
 
5
- These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
5
+ [Fluent UI React](https://react.fluentui.dev/) requires the usage of a custom JSX runtime to support the [slots API](https://react.fluentui.dev/?path=/docs/concepts-developer-customizing-components-with-slots--page)
6
+
7
+ ## Usage
8
+
9
+ This library should only be used in the case where you are trying to use the internal slot API of Fluent UI React. If you are not using the internal slot API, you should not need to use this library.
10
+
11
+ In case you want to re-compose a component and redeclare its render method then this API will be necessary, here's our documentation on [Rendering a component with slots](https://react.fluentui.dev/?path=/docs/concepts-developer-customizing-components-with-slots--page#rendering-components-with-slots)
12
+
13
+ To properly render a component with slots the `createElement` method of `@fluentui/react-jsx-runtime` can be used as a replacement for `React.createElement`:
14
+
15
+ ```tsx
16
+ /** @jsxRuntime classic */
17
+ /** @jsx createElement */
18
+
19
+ // createElement custom JSX pragma is required to support slot creation
20
+ import { createElement } from '@fluentui/react-jsx-runtime';
21
+ import { assertSlots } from '@fluentui/react-utilities';
22
+
23
+ const renderButton_unstable = (state: ButtonState) => {
24
+ const { iconOnly, iconPosition } = state;
25
+
26
+ assertSlots<ButtonSlots>(state);
27
+
28
+ return (
29
+ <state.root>
30
+ {iconPosition !== 'after' && state.icon && <state.icon />}
31
+ {!iconOnly && state.root.children}
32
+ {iconPosition === 'after' && state.icon && <state.icon />}
33
+ </state.root>
34
+ );
35
+ };
36
+ ```
37
+
38
+ In case you're using typescript or any modern javascript transpiler, you can use [JSX import source](https://www.typescriptlang.org/tsconfig#jsxImportSource) feature instead of depending on declaring the runtime on every file
39
+
40
+ In TSC case you can simply add this do `tsconfig.json` file:
41
+
42
+ ```json
43
+ {
44
+ "compilerOptions": {
45
+ "jsx": "react-jsx",
46
+ "jsxImportSource": "@fluentui/react-jsx-runtime"
47
+ }
48
+ }
49
+ ```
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> | null;
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
 
@@ -1,32 +1,16 @@
1
1
  import * as React from 'react';
2
- import { isSlot, SLOT_ELEMENT_TYPE_SYMBOL, SLOT_RENDER_FUNCTION_SYMBOL } from '@fluentui/react-utilities';
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
- }
@@ -1 +1 @@
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"}
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,2 @@
1
+ import * as ReactDevRuntime from 'react/jsx-dev-runtime';
2
+ export const DevRuntime = ReactDevRuntime;
@@ -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,2 @@
1
+ import * as ReactRuntime from 'react/jsx-runtime';
2
+ export const Runtime = ReactRuntime;
@@ -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, 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"}
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,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fluentui/react-jsx-runtime",
3
- "version": "0.0.0-nightly-20230815-0415.1",
4
- "description": "React components for building web experiences",
3
+ "version": "0.0.0-nightly-20230817-0413.1",
4
+ "description": "Custom JSX runtime for @fluentui/react-components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
7
  "typings": "./dist/index.d.ts",
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@fluentui/eslint-plugin": "*",
27
- "@fluentui/react-conformance": "0.0.0-nightly-20230815-0415.1",
28
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230815-0415.1",
27
+ "@fluentui/react-conformance": "0.0.0-nightly-20230817-0413.1",
28
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230817-0413.1",
29
29
  "@fluentui/scripts-api-extractor": "*",
30
30
  "@fluentui/scripts-tasks": "*"
31
31
  },
32
32
  "dependencies": {
33
- "@fluentui/react-utilities": "0.0.0-nightly-20230815-0415.1",
33
+ "@fluentui/react-utilities": "0.0.0-nightly-20230817-0413.1",
34
34
  "@swc/helpers": "^0.4.14"
35
35
  },
36
36
  "peerDependencies": {
@@ -45,6 +45,18 @@
45
45
  "import": "./lib/index.js",
46
46
  "require": "./lib-commonjs/index.js"
47
47
  },
48
+ "./jsx-dev-runtime": {
49
+ "types": "./dist/jsx-dev-runtime.d.ts",
50
+ "node": "./lib-commonjs/jsx-dev-runtime.js",
51
+ "import": "./lib/jsx-dev-runtime.js",
52
+ "require": "./lib-commonjs/jsx-dev-runtime.js"
53
+ },
54
+ "./jsx-runtime": {
55
+ "types": "./dist/jsx-runtime.d.ts",
56
+ "node": "./lib-commonjs/jsx-runtime.js",
57
+ "import": "./lib/jsx-runtime.js",
58
+ "require": "./lib-commonjs/jsx-runtime.js"
59
+ },
48
60
  "./package.json": "./package.json"
49
61
  }
50
62
  }