@fluentui-react-native/framework-base 0.1.4 → 0.2.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 (76) hide show
  1. package/CHANGELOG.json +31 -1
  2. package/CHANGELOG.md +18 -2
  3. package/README.md +10 -11
  4. package/babel.config.js +1 -1
  5. package/lib/component-patterns/render.d.ts +8 -0
  6. package/lib/component-patterns/render.d.ts.map +1 -0
  7. package/lib/component-patterns/render.js +42 -0
  8. package/lib/component-patterns/render.js.map +1 -0
  9. package/lib/component-patterns/render.types.d.ts +98 -0
  10. package/lib/component-patterns/render.types.d.ts.map +1 -0
  11. package/lib/component-patterns/render.types.js +2 -0
  12. package/lib/component-patterns/render.types.js.map +1 -0
  13. package/lib/component-patterns/stagedComponent.d.ts +7 -31
  14. package/lib/component-patterns/stagedComponent.d.ts.map +1 -1
  15. package/lib/component-patterns/stagedComponent.js +18 -0
  16. package/lib/component-patterns/stagedComponent.js.map +1 -1
  17. package/lib/component-patterns/withSlots.d.ts +2 -2
  18. package/lib/component-patterns/withSlots.d.ts.map +1 -1
  19. package/lib/component-patterns/withSlots.js +2 -2
  20. package/lib/component-patterns/withSlots.js.map +1 -1
  21. package/lib/index.d.ts +4 -4
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +3 -2
  24. package/lib/index.js.map +1 -1
  25. package/lib/jsx-runtime.d.ts +4 -0
  26. package/lib/jsx-runtime.d.ts.map +1 -0
  27. package/lib/jsx-runtime.js +9 -0
  28. package/lib/jsx-runtime.js.map +1 -0
  29. package/lib/merge-props/mergeStyles.test.js.map +1 -1
  30. package/lib-commonjs/component-patterns/render.d.ts +8 -0
  31. package/lib-commonjs/component-patterns/render.d.ts.map +1 -0
  32. package/lib-commonjs/component-patterns/render.js +73 -0
  33. package/lib-commonjs/component-patterns/render.js.map +1 -0
  34. package/lib-commonjs/component-patterns/render.types.d.ts +98 -0
  35. package/lib-commonjs/component-patterns/render.types.d.ts.map +1 -0
  36. package/lib-commonjs/component-patterns/render.types.js +3 -0
  37. package/lib-commonjs/component-patterns/render.types.js.map +1 -0
  38. package/lib-commonjs/component-patterns/stagedComponent.d.ts +7 -31
  39. package/lib-commonjs/component-patterns/stagedComponent.d.ts.map +1 -1
  40. package/lib-commonjs/component-patterns/stagedComponent.js +44 -3
  41. package/lib-commonjs/component-patterns/stagedComponent.js.map +1 -1
  42. package/lib-commonjs/component-patterns/withSlots.d.ts +2 -2
  43. package/lib-commonjs/component-patterns/withSlots.d.ts.map +1 -1
  44. package/lib-commonjs/component-patterns/withSlots.js +2 -2
  45. package/lib-commonjs/component-patterns/withSlots.js.map +1 -1
  46. package/lib-commonjs/index.d.ts +4 -4
  47. package/lib-commonjs/index.d.ts.map +1 -1
  48. package/lib-commonjs/index.js +9 -3
  49. package/lib-commonjs/index.js.map +1 -1
  50. package/lib-commonjs/jsx-runtime.d.ts +4 -0
  51. package/lib-commonjs/jsx-runtime.d.ts.map +1 -0
  52. package/lib-commonjs/jsx-runtime.js +37 -0
  53. package/lib-commonjs/jsx-runtime.js.map +1 -0
  54. package/lib-commonjs/merge-props/mergeStyles.test.js.map +1 -1
  55. package/package.json +12 -1
  56. package/src/component-patterns/README.md +39 -0
  57. package/src/component-patterns/render.ts +54 -0
  58. package/src/component-patterns/render.types.ts +114 -0
  59. package/src/component-patterns/stagedComponent.tsx +45 -0
  60. package/src/component-patterns/withSlots.tsx +4 -8
  61. package/src/immutable-merge/README.md +185 -0
  62. package/src/index.ts +17 -4
  63. package/src/jsx-runtime.ts +11 -0
  64. package/src/memo-cache/README.md +141 -0
  65. package/src/merge-props/README.md +43 -0
  66. package/src/merge-props/mergeStyles.test.ts +3 -2
  67. package/lib/component-patterns/renderSlot.d.ts +0 -21
  68. package/lib/component-patterns/renderSlot.d.ts.map +0 -1
  69. package/lib/component-patterns/renderSlot.js +0 -14
  70. package/lib/component-patterns/renderSlot.js.map +0 -1
  71. package/lib-commonjs/component-patterns/renderSlot.d.ts +0 -21
  72. package/lib-commonjs/component-patterns/renderSlot.d.ts.map +0 -1
  73. package/lib-commonjs/component-patterns/renderSlot.js +0 -19
  74. package/lib-commonjs/component-patterns/renderSlot.js.map +0 -1
  75. package/src/component-patterns/renderSlot.ts +0 -27
  76. package/src/component-patterns/stagedComponent.ts +0 -53
package/CHANGELOG.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@fluentui-react-native/framework-base",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 25 Jul 2025 21:32:26 GMT",
5
+ "date": "Tue, 05 Aug 2025 18:46:08 GMT",
6
+ "version": "0.2.1",
7
+ "tag": "@fluentui-react-native/framework-base_v0.2.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "jasonmo@microsoft.com",
12
+ "package": "@fluentui-react-native/framework-base",
13
+ "commit": "1ed213f1b48036479e39ace7f25f9a31f46042bf",
14
+ "comment": "move repo to pnpm, create babel and jest config packages, fix dependencies"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 29 Jul 2025 06:35:19 GMT",
21
+ "version": "0.2.0",
22
+ "tag": "@fluentui-react-native/framework-base_v0.2.0",
23
+ "comments": {
24
+ "minor": [
25
+ {
26
+ "author": "jasonmo@microsoft.com",
27
+ "package": "@fluentui-react-native/framework-base",
28
+ "commit": "78329a2222622ac8d90345d3aa908355e70f5d1a",
29
+ "comment": "implement both new and old render patterns for classic and jsx-runtimes"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Fri, 25 Jul 2025 21:36:33 GMT",
6
36
  "version": "0.1.4",
7
37
  "tag": "@fluentui-react-native/framework-base_v0.1.4",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @fluentui-react-native/framework-base
2
2
 
3
- <!-- This log was last generated on Fri, 25 Jul 2025 21:32:26 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Tue, 05 Aug 2025 18:46:08 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.2.1
8
+
9
+ Tue, 05 Aug 2025 18:46:08 GMT
10
+
11
+ ### Patches
12
+
13
+ - move repo to pnpm, create babel and jest config packages, fix dependencies (jasonmo@microsoft.com)
14
+
15
+ ## 0.2.0
16
+
17
+ Tue, 29 Jul 2025 06:35:19 GMT
18
+
19
+ ### Minor changes
20
+
21
+ - implement both new and old render patterns for classic and jsx-runtimes (jasonmo@microsoft.com)
22
+
7
23
  ## 0.1.4
8
24
 
9
- Fri, 25 Jul 2025 21:32:26 GMT
25
+ Fri, 25 Jul 2025 21:36:33 GMT
10
26
 
11
27
  ### Patches
12
28
 
package/README.md CHANGED
@@ -1,20 +1,19 @@
1
- # Framework Base package
1
+ # `@fluentui-react-native/framework-base`
2
2
 
3
- This package provides core types and helpers used by both the old and new versions of the framework.
3
+ This package provides core implementations and types to support both the legacy and current frameworks.
4
4
 
5
5
  Several previously standalone packages have had their implementations moved into this package. This allows them to share certain typings and helpers without having to work around circular dependency issues. The moved packages are:
6
6
 
7
- - `@fluentui-react-native/immutable-merge`
8
- - `@fluentui-react-native/memo-cache`
9
- - `@fluentui-react-native/merge-props`
7
+ - [`@fluentui-react-native/immutable-merge`](./src/immutable-merge/README.md)
8
+ - [`@fluentui-react-native/memo-cache`](./src/memo-cache/README.md)
9
+ - [`@fluentui-react-native/merge-props`](./src/merge-props/README.md)
10
10
 
11
- The functionality in these packages can be imported either by the base entry point for the package, or by using dedicated exports. The previous packages will continue to exist for the time being but are now just references to their individual exports. Note that export maps require special handling for metro bundling (with the exception of the jsx-runtime export) so the export maps are primarily for use
12
- in JS/web projects.
11
+ The functionality in these packages is now exposed as part of this package.
13
12
 
14
- ## Type Helpers
13
+ ## Component Patterns
15
14
 
16
- - TODO: There are a number of issues with the way types are handled in the larger fluentui-react-native project, helpers and core types will be added here to help solve inference issues, avoid hard typecasts, and help the project eventually move to typescript 5.x.
15
+ The shared patterns for rendering components, as well as the JSX handlers have been centralized in this package. More information can be found [here](./src/component-patterns/README.md).
17
16
 
18
- ## JSX Helpers
17
+ ## Type Helpers
19
18
 
20
- - TODO: Both classic and the new jsx-runtime helpers will eventually come out of this package and be shared between old and new frameworks. This will be necessary to improve typing across the board.
19
+ - TODO: There are a number of issues with the way types are handled in the larger fluentui-react-native project, helpers and core types will be added here to help solve inference issues, avoid hard typecasts, and help the project eventually move to typescript 5.x.
package/babel.config.js CHANGED
@@ -1 +1 @@
1
- module.exports = require('@fluentui-react-native/scripts/configs/babel.config');
1
+ module.exports = require('@fluentui-react-native/babel-config/babel.react.config.js');
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import * as ReactJSX from 'react/jsx-runtime';
3
+ import type { RenderType, RenderResult } from './render.types';
4
+ export type CustomRender = () => RenderResult;
5
+ export declare function renderForJsxRuntime<TProps>(type: React.ElementType, props: React.PropsWithChildren<TProps>, key?: React.Key, jsxFn?: typeof ReactJSX.jsx): RenderResult;
6
+ export declare function renderForClassicRuntime<TProps>(type: RenderType, props: TProps, ...children: React.ReactNode[]): RenderResult;
7
+ export declare const renderSlot: typeof renderForClassicRuntime;
8
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/component-patterns/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAA0C,MAAM,gBAAgB,CAAC;AAEvG,MAAM,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC;AAgB9C,wBAAgB,mBAAmB,CAAC,MAAM,EACxC,IAAI,EAAE,KAAK,CAAC,WAAW,EACvB,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,EACtC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,EACf,KAAK,GAAE,OAAO,QAAQ,CAAC,GAAkB,GACxC,YAAY,CAad;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,YAAY,CAW7H;AAED,eAAO,MAAM,UAAU,gCAA0B,CAAC"}
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import * as ReactJSX from 'react/jsx-runtime';
3
+ function asDirectComponent(type) {
4
+ if (typeof type === 'function' && type._callDirect) {
5
+ return type;
6
+ }
7
+ return undefined;
8
+ }
9
+ function asLegacyDirectComponent(type) {
10
+ if (typeof type === 'function' && type._canCompose) {
11
+ return type;
12
+ }
13
+ return undefined;
14
+ }
15
+ export function renderForJsxRuntime(type, props, key, jsxFn = ReactJSX.jsx) {
16
+ const legacyDirect = asLegacyDirectComponent(type);
17
+ if (legacyDirect) {
18
+ const { children, ...rest } = props;
19
+ const newProps = { ...rest, key };
20
+ return legacyDirect(newProps, ...React.Children.toArray(children));
21
+ }
22
+ const directComponent = asDirectComponent(type);
23
+ if (directComponent) {
24
+ const newProps = { ...props, key };
25
+ return directComponent(newProps);
26
+ }
27
+ return jsxFn(type, props, key);
28
+ }
29
+ export function renderForClassicRuntime(type, props, ...children) {
30
+ const legacyDirect = asLegacyDirectComponent(type);
31
+ if (legacyDirect) {
32
+ return legacyDirect(props, ...children);
33
+ }
34
+ const directComponent = asDirectComponent(type);
35
+ if (directComponent) {
36
+ const newProps = { ...props, children };
37
+ return directComponent(newProps);
38
+ }
39
+ return React.createElement(type, props, ...children);
40
+ }
41
+ export const renderSlot = renderForClassicRuntime;
42
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/component-patterns/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAK9C,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iB,CAAC;KACzD;IACD,MAAM,eAAe,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,eAAe,EAAE;QACnB,MAAM,QAAQ,GAAG,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC;QACxC,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;KAClC;IACD,OAAO,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,98 @@
1
+ import type React from 'react';
2
+ import type ReactJSX from 'react/jsx-runtime';
3
+ /**
4
+ * Base types for rendering components in a react application, extracted from react types
5
+ */
6
+ export type RenderResult = ReturnType<typeof ReactJSX.jsx>;
7
+ export type RenderType = Parameters<typeof ReactJSX.jsx>[0] | string;
8
+ /**
9
+ * The standard element type inputs for react and react-native. This might be View or Button, or it might be 'div' in web. Effectively
10
+ * it is what react accepts for React.createElement
11
+ */
12
+ export type NativeReactType = RenderType;
13
+ /**
14
+ * DIRECT RENDERING
15
+ *
16
+ * This is a pattern where a function can by called directly to render a component, bypassing creating additional layers of the
17
+ * rendering tree. This is useful for higher order components that mainly need to do simple prop manipulation but want to
18
+ * compartmentalize the logic.
19
+ *
20
+ * Note that for this to be safe, hooks cannot be used in the function. This is the reason why function component is redefined,
21
+ * to help linting tools catch bad usage.
22
+ *
23
+ * The newer DirectComponent type should be used, as it will handle children consistently.
24
+ */
25
+ /**
26
+ * type of the render function, not a FunctionComponent to help prevent hook usage
27
+ */
28
+ export type DirectComponentFunction<TProps> = (props: TProps) => RenderResult;
29
+ /**
30
+ * The full component definition that has the attached properties to allow the jsx handlers to render it directly.
31
+ */
32
+ export type DirectComponent<TProps> = DirectComponentFunction<TProps> & {
33
+ displayName?: string;
34
+ _callDirect?: boolean;
35
+ };
36
+ /**
37
+ * Legacy slot function type, this allows the rendering handlers to bypass the normal JSX rendering and call the function
38
+ * directly. This expects the function to have children as the last argument of the call which isn't consistent with standard
39
+ * react usage, where children are passed as a prop. If writing new components use the DirectComponent type instead.
40
+ * @deprecated use DirectComponent instead
41
+ */
42
+ export type LegacyDirectComponent<TProps> = React.FunctionComponent<TProps> & {
43
+ _canCompose?: boolean;
44
+ };
45
+ /**
46
+ * Legacy type name used for consistency with old rendering patterns.
47
+ */
48
+ export type SlotFn<TProps> = LegacyDirectComponent<TProps>;
49
+ /**
50
+ * MULTI-STAGE RENDERING
51
+ *
52
+ * The above direct rendering pattern is useful for simple components, but it does not allow for hooks or complex logic. The staged render pattern allows
53
+ * for a component to be rendered in two stages, allowing for hooks to be used in the first stage and then the second stage to be a simple render function that can
54
+ * be called directly.
55
+ *
56
+ * In code that respects the pattern the first stage will be called with props (though children will not be present) and will return a function that will be called
57
+ * with additional props, this time with children present. This allows for the first stage to handle all the logic and hooks, while the second stage can be a simple render function
58
+ * that can leverage direct rendering if supported.
59
+ *
60
+ * The component itself will be a FunctionComponent, but it will have an attached property that is the staged render function. This allows the component to be used in two
61
+ * parts via the useSlot hook, or to be used directly in JSX/TSX as a normal component.
62
+ */
63
+ /**
64
+ * This is an updated version of the staged render that handles children and types more consistently. Generally children
65
+ * will be passed as part of the props for component rendering, it is inconsistent to have them as a variable argument.
66
+ *
67
+ * The `children` prop will be automatically inferred and typed correctly by the prop type. Hooks are still expected
68
+ */
69
+ export type TwoStageRender<TProps> = (props: TProps) => React.ComponentType<React.PropsWithChildren<TProps>>;
70
+ /**
71
+ * Component type for a component that can be rendered in two stages, with the attached render function.
72
+ */
73
+ export type StagedComponent<TProps> = React.FunctionComponent<TProps> & {
74
+ _twoStageRender?: TwoStageRender<TProps>;
75
+ };
76
+ /**
77
+ * The final rendering of the props in a staged render. This is the function component signature that matches that of
78
+ * React.createElement, children (if present) will be part of the variable args at the end.
79
+ */
80
+ export type FinalRender<TProps> = (props: TProps, ...children: React.ReactNode[]) => JSX.Element | null;
81
+ /**
82
+ * Signature for a staged render function.
83
+ * @deprecated Use TwoStageRender instead
84
+ */
85
+ export type StagedRender<TProps> = (props: TProps, ...args: any[]) => FinalRender<TProps>;
86
+ /**
87
+ * Signature for a component that uses the staged render pattern.
88
+ * @deprecated Use TwoStageRender instead
89
+ */
90
+ export type ComposableFunction<TProps> = React.FunctionComponent<TProps> & {
91
+ _staged?: StagedRender<TProps>;
92
+ };
93
+ /**
94
+ * A type aggregating all the custom types that can be used in the render process.
95
+ * @internal only used in this package, should not be exported
96
+ */
97
+ export type AnyCustomType<TProps> = React.FunctionComponent<TProps> | DirectComponent<TProps> | StagedComponent<TProps> | ComposableFunction<TProps> | LegacyDirectComponent<TProps>;
98
+ //# sourceMappingURL=render.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.types.d.ts","sourceRoot":"","sources":["../../src/component-patterns/render.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC3D,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC;AAEzC;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,MAAM,uBAAuB,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,YAAY,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,MAAM,IAAI,uBAAuB,CAAC,MAAM,CAAC,GAAG;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB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,CAAC,GAC1B,qBAAqB,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=render.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.types.js","sourceRoot":"","sources":["../../src/component-patterns/render.types.ts"],"names":[],"mappings":""}
@@ -1,34 +1,4 @@
1
- import * as React from 'react';
2
- /**
3
- * The final rendering of the props in a staged render. This is the function component signature that matches that of
4
- * React.createElement, children (if present) will be part of the variable args at the end.
5
- */
6
- export type FinalRender<TProps> = (props: TProps, ...children: React.ReactNode[]) => JSX.Element | null;
7
- /**
8
- * This is a pattern of rendering where a functional component can be executed in two stages rather than in a single pass.
9
- *
10
- * The pattern looks like:
11
- * (props) => {
12
- * // handle props
13
- * // call hooks, remember these can't be conditional
14
- * // build styles and props to pass to child components
15
- *
16
- * return (additionalProps, ...children) => {
17
- * // return the actual element tree, this includes conditional branching or rendering
18
- * // mixin additional props, props which require logic should be required in phase 1.
19
- *
20
- * // NOTE: This is where children will show up
21
- * };
22
- * }
23
- */
24
- export type StagedRender<TProps> = (props: TProps, ...args: any[]) => FinalRender<TProps>;
25
- /**
26
- * A composable function may have a two stage render function as an attached property. This allows the function to work
27
- * in all the standard react flows, but allows for pulling out the staged render when components understand it.
28
- */
29
- export type ComposableFunction<TProps> = React.FunctionComponent<TProps> & {
30
- _staged?: StagedRender<TProps>;
31
- };
1
+ import type { StagedComponent, TwoStageRender, StagedRender, ComposableFunction } from './render.types';
32
2
  /**
33
3
  * Take a staged render function and make a real component out of it
34
4
  *
@@ -36,4 +6,10 @@ export type ComposableFunction<TProps> = React.FunctionComponent<TProps> & {
36
6
  * @param memo - optional flag to enable wrapping the created component in a React.memo HOC
37
7
  */
38
8
  export declare function stagedComponent<TProps>(staged: StagedRender<TProps>, memo?: boolean): ComposableFunction<TProps>;
9
+ /**
10
+ * Take a two stage render function and make a real component out of it, attaching the staged render function
11
+ * so it can be split if used in that manner.
12
+ * @param staged - two stage render function to wrap into a staged component
13
+ */
14
+ export declare function twoStageComponent<TProps>(staged: TwoStageRender<TProps>): StagedComponent<TProps>;
39
15
  //# sourceMappingURL=stagedComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stagedComponent.d.ts","sourceRoot":"","sources":["../../src/component-patterns/stagedComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;AAExG;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,MAAM,YAAY,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC;AAE1F;;;GAGG;AACH,MAAM,MAAM,kBAAkB,CAAC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAM9G;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAQhH"}
1
+ {"version":3,"file":"stagedComponent.d.ts","sourceRoot":"","sources":["../../src/component-patterns/stagedComponent.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMxG;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAQhH;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CAUjG"}
@@ -1,4 +1,9 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx withSlots
4
+ */
1
5
  import * as React from 'react';
6
+ import { withSlots } from './withSlots';
2
7
  function asArray(val) {
3
8
  return Array.isArray(val) ? val : [val];
4
9
  }
@@ -17,4 +22,17 @@ export function stagedComponent(staged, memo) {
17
22
  Object.assign(stagedComponent, { _staged: staged });
18
23
  return stagedComponent;
19
24
  }
25
+ /**
26
+ * Take a two stage render function and make a real component out of it, attaching the staged render function
27
+ * so it can be split if used in that manner.
28
+ * @param staged - two stage render function to wrap into a staged component
29
+ */
30
+ export function twoStageComponent(staged) {
31
+ return Object.assign((props) => {
32
+ const { children, ...outerProps } = props;
33
+ const innerProps = { children };
34
+ const Inner = staged(outerProps);
35
+ return withSlots(Inner, { ...innerProps });
36
+ }, { _twoStageRender: staged });
37
+ }
20
38
  //# sourceMappingURL=stagedComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stagedComponent.js","sourceRoot":"","sources":["../../src/component-patterns/stagedComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkC/B,SAAS,OAAO,CAAI,GAAY;IAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAS,MAA4B,EAAE,IAAc;IAClF,MAAM,SAAS,GAAG,CAAC,KAAsC,EAAE,EAAE;QAC3D,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACpC,OAAO,MAAM,CAA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U,iBAAiB,CAAS,MAA8B;IACtE,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,KAAsC,EAAE,EAAE;QACzC,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;QAC1C,MAAM,UAAU,GAAG,EAAE,QAAQ,EAAqC,CAAC;QACnE,MAAM,KAAK,GAAG,MAAM,CAAC,UAAoB,CAAC,CAAC;QAC3C,OAAO,UAAC,KAAK,OAAK,UAAU,GAAI,CAAC;IACnC,CAAC,EACD,EAAE,eAAe,EAAE,MAAM,EAAE,CAC5B,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { NativeReactType } from './renderSlot';
1
+ import type React from 'react';
2
2
  /**
3
3
  * This function is required for any module that uses slots.
4
4
  *
@@ -11,5 +11,5 @@ import type { NativeReactType } from './renderSlot';
11
11
  *
12
12
  * See React.createElement
13
13
  */
14
- export declare function withSlots<P>(reactType: NativeReactType, props?: (React.Attributes & P) | null, ...children: React.ReactNode[]): ReturnType<React.FunctionComponent<P>>;
14
+ export declare function withSlots(reactType: Parameters<typeof React.createElement>[0], props?: unknown, ...children: React.ReactNode[]): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
15
15
  //# sourceMappingURL=withSlots.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withSlots.d.ts","sourceRoot":"","sources":["../../src/component-patterns/withSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD;;;;;;;;;;;GAWG;AAGH,wBAAgB,SAAS,CAAC,CAAC,EACzB,SAAS,EAAE,eAAe,EAC1B,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,IAAI,EACrC,GAAG,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,GAC7B,UAAU,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAGxC"}
1
+ {"version":3,"file":"withSlots.d.ts","sourceRoot":"","sources":["../../src/component-patterns/withSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;;;;;;;;GAWG;AAGH,wBAAgB,SAAS,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,sEAG9H"}
@@ -1,4 +1,4 @@
1
- import { renderSlot } from './renderSlot';
1
+ import { renderForClassicRuntime } from './render';
2
2
  /**
3
3
  * This function is required for any module that uses slots.
4
4
  *
@@ -14,6 +14,6 @@ import { renderSlot } from './renderSlot';
14
14
  // Can't use typeof on React.createElement since it's overloaded. Approximate createElement's signature for now and widen as needed.
15
15
  export function withSlots(reactType, props, ...children) {
16
16
  // if it is a non-string type with _canCompose set just call the function directly, otherwise call createElement as normal
17
- return renderSlot(reactType, props, ...children);
17
+ return renderForClassicRuntime(reactType, props, ...children);
18
18
  }
19
19
  //# sourceMappingURL=withSlots.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withSlots.js","sourceRoot":"","sources":["../../src/component-patterns/withSlots.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;GAWG;AAEH,oIAAoI;AACpI,MAAM,UAAU,SAAS,CACvB,SAA0B,EAC1B,KAAqC,EACrC,GAAG,QAA2B;IAE9B,0HAA0H;IAC1H,OAAO,UAAU,CAAI,SAAS,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,CAAC;AACtD,CAAC"}
1
+ {"version":3,"file":"withSlots.js","sourceRoot":"","sources":["../../src/component-patterns/withSlots.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;;;;;;;;GAWG;AAEH,oIAAoI;AACpI,MAAM,UAAU,SAAS,CAAC,SAAoD,EAAE,KAAe,EAAE,GAAG,QAA2B;IAC7H,0HAA0H;IAC1H,OAAO,uBAAuB,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,CAAC;AAChE,CAAC"}
package/lib/index.d.ts CHANGED
@@ -6,9 +6,9 @@ export { memoize } from './memo-cache/memoize';
6
6
  export type { StyleProp } from './merge-props/mergeStyles.types';
7
7
  export { mergeStyles } from './merge-props/mergeStyles';
8
8
  export { mergeProps } from './merge-props/mergeProps';
9
- export { renderSlot } from './component-patterns/renderSlot';
10
- export type { SlotFn, NativeReactType } from './component-patterns/renderSlot';
9
+ export { renderForClassicRuntime, renderForJsxRuntime, renderSlot } from './component-patterns/render';
10
+ export type { DirectComponent, DirectComponentFunction, LegacyDirectComponent, StagedComponent, StagedRender, TwoStageRender, RenderType, RenderResult, ComposableFunction, FinalRender, SlotFn, NativeReactType, } from './component-patterns/render.types';
11
11
  export { withSlots } from './component-patterns/withSlots';
12
- export { stagedComponent } from './component-patterns/stagedComponent';
13
- export type { FinalRender, StagedRender, ComposableFunction } from './component-patterns/stagedComponent';
12
+ export { stagedComponent, twoStageComponent } from './component-patterns/stagedComponent';
13
+ export { jsx, jsxs } from './jsx-runtime';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAChH,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAA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B,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,MAAM,EACN,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC"}
package/lib/index.js CHANGED
@@ -5,7 +5,8 @@ export { memoize } from './memo-cache/memoize';
5
5
  export { mergeStyles } from './merge-props/mergeStyles';
6
6
  export { mergeProps } from './merge-props/mergeProps';
7
7
  // component pattern exports
8
- export { renderSlot } from './component-patterns/renderSlot';
8
+ export { renderForClassicRuntime, renderForJsxRuntime, renderSlot } from './component-patterns/render';
9
9
  export { withSlots } from './component-patterns/withSlots';
10
- export { stagedComponent } from './component-patterns/stagedComponent';
10
+ export { stagedComponent, twoStageComponent } from './component-patterns/stagedComponent';
11
+ export { jsx, jsxs } from './jsx-runtime';
11
12
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAYhH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,4BAA4B;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAYhH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,4BAA4B;AAC5B,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAevG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type React from 'react';
2
+ export declare function jsx(type: React.ElementType, props: React.PropsWithChildren<unknown>, key?: React.Key): React.ReactElement;
3
+ export declare function jsxs(type: React.ElementType, props: React.PropsWithChildren<unknown>, key?: React.Key): React.ReactElement;
4
+ //# sourceMappingURL=jsx-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,wBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,YAAY,CAEzH;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,YAAY,CAE1H"}
@@ -0,0 +1,9 @@
1
+ import * as ReactJSX from 'react/jsx-runtime';
2
+ import { renderForJsxRuntime } from './component-patterns/render';
3
+ export function jsx(type, props, key) {
4
+ return renderForJsxRuntime(type, props, key, ReactJSX.jsx);
5
+ }
6
+ export function jsxs(type, props, key) {
7
+ return renderForJsxRuntime(type, props, key, ReactJSX.jsxs);
8
+ }
9
+ //# sourceMappingURL=jsx-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,UAAU,GAAG,CAAC,IAAuB,EAAE,KAAuC,EAAE,GAAe;IACnG,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,IAAuB,EAAE,KAAuC,EAAE,GAAe;IACpG,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"mergeStyles.test.js","sourceRoot":"","sources":["../../src/merge-props/mergeStyles.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAajF,MAAM,EAAE,GAAmB;IACzB,E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CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import * as ReactJSX from 'react/jsx-runtime';
3
+ import type { RenderType, RenderResult } from './render.types';
4
+ export type CustomRender = () => RenderResult;
5
+ export declare function renderForJsxRuntime<TProps>(type: React.ElementType, props: React.PropsWithChildren<TProps>, key?: React.Key, jsxFn?: typeof ReactJSX.jsx): RenderResult;
6
+ export declare function renderForClassicRuntime<TProps>(type: RenderType, props: TProps, ...children: React.ReactNode[]): RenderResult;
7
+ export declare const renderSlot: typeof renderForClassicRuntime;
8
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/component-patterns/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAA0C,MAAM,gBAAgB,CAAC;AAEvG,MAAM,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC;AAgB9C,wBAAgB,mBAAmB,CAAC,MAAM,EACxC,IAAI,EAAE,KAAK,CAAC,WAAW,EACvB,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,EACtC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,EACf,KAAK,GAAE,OAAO,QAAQ,CAAC,GAAkB,GACxC,YAAY,CAad;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,YAAY,CAW7H;AAED,eAAO,MAAM,UAAU,gCAA0B,CAAC"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.renderSlot = exports.renderForClassicRuntime = exports.renderForJsxRuntime = void 0;
30
+ const react_1 = __importDefault(require("react"));
31
+ const ReactJSX = __importStar(require("react/jsx-runtime"));
32
+ function asDirectComponent(type) {
33
+ if (typeof type === 'function' && type._callDirect) {
34
+ return type;
35
+ }
36
+ return undefined;
37
+ }
38
+ function asLegacyDirectComponent(type) {
39
+ if (typeof type === 'function' && type._canCompose) {
40
+ return type;
41
+ }
42
+ return undefined;
43
+ }
44
+ function renderForJsxRuntime(type, props, key, jsxFn = ReactJSX.jsx) {
45
+ const legacyDirect = asLegacyDirectComponent(type);
46
+ if (legacyDirect) {
47
+ const { children, ...rest } = props;
48
+ const newProps = { ...rest, key };
49
+ return legacyDirect(newProps, ...react_1.default.Children.toArray(children));
50
+ }
51
+ const directComponent = asDirectComponent(type);
52
+ if (directComponent) {
53
+ const newProps = { ...props, key };
54
+ return directComponent(newProps);
55
+ }
56
+ return jsxFn(type, props, key);
57
+ }
58
+ exports.renderForJsxRuntime = renderForJsxRuntime;
59
+ function renderForClassicRuntime(type, props, ...children) {
60
+ const legacyDirect = asLegacyDirectComponent(type);
61
+ if (legacyDirect) {
62
+ return legacyDirect(props, ...children);
63
+ }
64
+ const directComponent = asDirectComponent(type);
65
+ if (directComponent) {
66
+ const newProps = { ...props, children };
67
+ return directComponent(newProps);
68
+ }
69
+ return react_1.default.createElement(type, props, ...children);
70
+ }
71
+ exports.renderForClassicRuntime = renderForClassicRuntime;
72
+ exports.renderSlot = renderForClassicRuntime;
73
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/component-patterns/render.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,4DAA8C;AAK9C,SAAS,iBAAiB,CAAS,IAAgB;IACjD,IAAI,OAAO,IAAI,KAAK,UAAU,IAAK,IAAgC,CAAC,WAAW,EAAE;QAC/E,OAAO,IAA+B,CAAC;KACxC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,uBAAuB,CAAS,IAAgB;IACvD,IAAI,OAAO,IAAI,KAAK,UAAU,IAAK,IAAsC,CAAC,WAAW,EAAE;QACrF,OAAO,IAAqC,CAAC;KAC9C;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,mBAAmB,CACjC,IAAuB,EACvB,KAAsC,EACtC,GAAe,EACf,QAA6B,QAAQ,CAAC,GAAG;IAEzC,MAAM,YAAY,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,YAAY,EAAE;QAChB,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACpC,MAAM,QAAQ,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC,QA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