@kubb/react-fabric 0.13.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{chunk-Cnw5r_-A.js → chunk-BGCRLu6H.js} +16 -21
- package/dist/globals.d.ts +2 -1
- package/dist/globals.js +1 -1
- package/dist/index.cjs +79 -89
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +27 -27
- package/dist/index.js +27 -35
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.cjs +6 -227
- package/dist/jsx-dev-runtime.cjs.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +5 -4
- package/dist/jsx-dev-runtime.js +6 -227
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/{jsx-namespace-CFK460kI.d.ts → jsx-namespace-C9N4PA8a.d.ts} +3 -2
- package/dist/{react-DorQ0Kea.cjs → jsx-runtime-Bl0DfUmV.js} +347 -75
- package/dist/jsx-runtime-Bl0DfUmV.js.map +1 -0
- package/dist/{react-D652OKii.js → jsx-runtime-Cua1md-Z.cjs} +402 -31
- package/dist/jsx-runtime-Cua1md-Z.cjs.map +1 -0
- package/dist/jsx-runtime.cjs +4 -6
- package/dist/jsx-runtime.cjs.map +1 -1
- package/dist/jsx-runtime.d.ts +3 -2
- package/dist/jsx-runtime.js +3 -5
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/parsers.cjs +7 -7
- package/dist/parsers.js +2 -3
- package/dist/plugins.cjs +10 -10
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +4 -7
- package/dist/{reactPlugin-CJEggKNs.d.ts → reactPlugin-CKiGUCKQ.d.ts} +11 -10
- package/dist/{reactPlugin-BGbgHJfV.cjs → reactPlugin-D74A1eG4.cjs} +1495 -377
- package/dist/{reactPlugin-BGbgHJfV.cjs.map → reactPlugin-D74A1eG4.cjs.map} +1 -1
- package/dist/{reactPlugin-tE73eBS_.js → reactPlugin-QQPrjNuQ.js} +1460 -342
- package/dist/{reactPlugin-tE73eBS_.js.map → reactPlugin-QQPrjNuQ.js.map} +1 -1
- package/dist/types-BJVZ7ita.d.ts +104 -0
- package/dist/types.cjs +7 -7
- package/dist/types.d.ts +2 -62
- package/dist/types.js +2 -3
- package/package.json +9 -3
- package/src/components/{App.tsx → Fabric.tsx} +6 -6
- package/src/composables/useFabric.ts +1 -0
- package/src/index.ts +2 -3
- package/src/jsx-dev-runtime.ts +2 -2
- package/src/plugins/reactPlugin.ts +8 -8
- package/dist/getFunctionParams-BJb7Kd-D.d.ts +0 -48
- package/dist/getFunctionParams-ClT1iMr_.d.ts +0 -47
- package/dist/jsx-namespace-BLQ6SvuD.d.ts +0 -33
- package/dist/jsx-runtime-7CEZevwV.cjs +0 -251
- package/dist/jsx-runtime-7CEZevwV.cjs.map +0 -1
- package/dist/jsx-runtime-Dm7PKVbc.js +0 -247
- package/dist/jsx-runtime-Dm7PKVbc.js.map +0 -1
- package/dist/react-D652OKii.js.map +0 -1
- package/dist/react-DorQ0Kea.cjs.map +0 -1
- package/dist/reactPlugin-DYARkyXy.d.ts +0 -462
- package/src/components/__snapshots__/arrow_function_with_generics.ts +0 -3
- package/src/components/__snapshots__/async_arrow_function.ts +0 -3
- package/src/components/__snapshots__/async_function.ts +0 -3
- package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +0 -3
- package/src/components/__snapshots__/basic_arrow_function.ts +0 -3
- package/src/components/__snapshots__/basic_const.ts +0 -1
- package/src/components/__snapshots__/basic_export.ts +0 -1
- package/src/components/__snapshots__/basic_function.ts +0 -3
- package/src/components/__snapshots__/basic_import.ts +0 -1
- package/src/components/__snapshots__/basic_type.ts +0 -1
- package/src/components/__snapshots__/const_with_JSDoc.ts +0 -4
- package/src/components/__snapshots__/const_with_as_const.ts +0 -1
- package/src/components/__snapshots__/const_with_type.ts +0 -1
- package/src/components/__snapshots__/default_exported_arrow_function.ts +0 -3
- package/src/components/__snapshots__/default_exported_function.ts +0 -3
- package/src/components/__snapshots__/exported_arrow_function.ts +0 -3
- package/src/components/__snapshots__/exported_async_arrow_function_with_generics.ts +0 -3
- package/src/components/__snapshots__/exported_async_function_with_generics.ts +0 -3
- package/src/components/__snapshots__/exported_const.ts +0 -1
- package/src/components/__snapshots__/exported_function.ts +0 -3
- package/src/components/__snapshots__/exported_type.ts +0 -1
- package/src/components/__snapshots__/function_with_JSDoc.ts +0 -6
- package/src/components/__snapshots__/function_with_generics.ts +0 -3
- package/src/components/__snapshots__/function_with_parameters.ts +0 -3
- package/src/components/__snapshots__/function_with_return_type.ts +0 -3
- package/src/components/__snapshots__/matches_with_root_import.ts +0 -1
- package/src/components/__snapshots__/named_export.ts +0 -1
- package/src/components/__snapshots__/named_export_(object_advanced).ts +0 -1
- package/src/components/__snapshots__/named_import.ts +0 -1
- package/src/components/__snapshots__/named_import_(object).ts +0 -1
- package/src/components/__snapshots__/named_import_(object_advanced).ts +0 -1
- package/src/components/__snapshots__/named_typed_export.ts +0 -1
- package/src/components/__snapshots__/named_typed_import.ts +0 -1
- package/src/components/__snapshots__/single_line_arrow_function.ts +0 -1
- package/src/components/__snapshots__/type_with_JSDoc.ts +0 -4
- package/src/components/__snapshots__/typed_export.ts +0 -1
- package/src/components/__snapshots__/typed_import.ts +0 -1
- package/src/composables/useApp.ts +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { i as __reExport, n as __exportAll, r as __name } from "./chunk-BGCRLu6H.js";
|
|
2
|
+
import { KubbFile } from "@kubb/fabric-core/types";
|
|
3
|
+
import React, { JSX, ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/getFunctionParams.d.ts
|
|
6
|
+
type Param = {
|
|
7
|
+
/**
|
|
8
|
+
* `object` will return the pathParams as an object.
|
|
9
|
+
*
|
|
10
|
+
* `inline` will return the pathParams as comma separated params.
|
|
11
|
+
* @default `'inline'`
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
mode?: 'object' | 'inline' | 'inlineSpread';
|
|
15
|
+
type?: 'string' | 'number' | (string & {});
|
|
16
|
+
optional?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @example test = "default"
|
|
19
|
+
*/
|
|
20
|
+
default?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Used for no TypeScript(with mode object)
|
|
23
|
+
* @example test: "default"
|
|
24
|
+
*/
|
|
25
|
+
value?: string;
|
|
26
|
+
children?: Params;
|
|
27
|
+
};
|
|
28
|
+
type Params = Record<string, Param | undefined>;
|
|
29
|
+
type Options = {
|
|
30
|
+
type: 'constructor' | 'call' | 'object' | 'objectValue';
|
|
31
|
+
transformName?: (name: string) => string;
|
|
32
|
+
transformType?: (type: string) => string;
|
|
33
|
+
};
|
|
34
|
+
declare function createFunctionParams(params: Params): Params;
|
|
35
|
+
declare class FunctionParams {
|
|
36
|
+
#private;
|
|
37
|
+
static factory(params: Params): FunctionParams;
|
|
38
|
+
constructor(params: Params);
|
|
39
|
+
get params(): Params;
|
|
40
|
+
get flatParams(): Params;
|
|
41
|
+
toCall({
|
|
42
|
+
transformName,
|
|
43
|
+
transformType
|
|
44
|
+
}?: Pick<Options, 'transformName' | 'transformType'>): string;
|
|
45
|
+
toObject(): string;
|
|
46
|
+
toObjectValue(): string;
|
|
47
|
+
toConstructor(): string;
|
|
48
|
+
}
|
|
49
|
+
declare namespace types_d_exports {
|
|
50
|
+
export { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, FabricExportProps, FabricFileProps, FabricImportProps, FabricReactElement, FabricReactNode, FabricSourceProps, FabricTextProps, Key, LineBreakProps, Param, Params, TextNode };
|
|
51
|
+
}
|
|
52
|
+
import * as import__kubb_fabric_core_types from "@kubb/fabric-core/types";
|
|
53
|
+
type Key = string | number | bigint;
|
|
54
|
+
type ElementNames = 'br' | 'div' | 'indent' | 'dedent' | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app';
|
|
55
|
+
type Node = {
|
|
56
|
+
parentNode: DOMElement | undefined;
|
|
57
|
+
internal_static?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type DOMNodeAttribute = boolean | string | number;
|
|
60
|
+
type TextName = '#text';
|
|
61
|
+
type TextNode = {
|
|
62
|
+
nodeName: TextName;
|
|
63
|
+
nodeValue: string;
|
|
64
|
+
} & Node;
|
|
65
|
+
type DOMNode<T = {
|
|
66
|
+
nodeName: NodeNames;
|
|
67
|
+
}> = T extends {
|
|
68
|
+
nodeName: infer U;
|
|
69
|
+
} ? U extends '#text' ? TextNode : DOMElement : never;
|
|
70
|
+
type OutputTransformer = (s: string, index: number) => string;
|
|
71
|
+
type DOMElement = {
|
|
72
|
+
nodeName: ElementNames;
|
|
73
|
+
attributes: Map<string, DOMNodeAttribute>;
|
|
74
|
+
childNodes: DOMNode[];
|
|
75
|
+
internal_transform?: OutputTransformer;
|
|
76
|
+
isStaticDirty?: boolean;
|
|
77
|
+
staticNode?: DOMElement;
|
|
78
|
+
onComputeLayout?: () => void;
|
|
79
|
+
onRender?: () => void;
|
|
80
|
+
onImmediateRender?: () => void;
|
|
81
|
+
} & Node;
|
|
82
|
+
type NodeNames = ElementNames | TextName;
|
|
83
|
+
type FabricReactNode = ReactNode;
|
|
84
|
+
type FabricReactElement = JSX.Element;
|
|
85
|
+
type FabricTextProps = {
|
|
86
|
+
children?: FabricReactNode;
|
|
87
|
+
};
|
|
88
|
+
type FabricFileProps = {
|
|
89
|
+
id?: string;
|
|
90
|
+
children?: FabricReactNode;
|
|
91
|
+
baseName: string;
|
|
92
|
+
path: string;
|
|
93
|
+
override?: boolean;
|
|
94
|
+
meta?: KubbFile.File['meta'];
|
|
95
|
+
};
|
|
96
|
+
type FabricSourceProps = KubbFile.Source & {
|
|
97
|
+
children?: FabricReactNode;
|
|
98
|
+
};
|
|
99
|
+
type FabricImportProps = KubbFile.Import;
|
|
100
|
+
type FabricExportProps = KubbFile.Export;
|
|
101
|
+
type LineBreakProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { Param as _, FabricExportProps as a, FabricReactElement as c, FabricTextProps as d, Key as f, FunctionParams as g, types_d_exports as h, ElementNames as i, FabricReactNode as l, TextNode as m, DOMNode as n, FabricFileProps as o, LineBreakProps as p, DOMNodeAttribute as r, FabricImportProps as s, DOMElement as t, FabricSourceProps as u, Params as v, createFunctionParams as y };
|
|
104
|
+
//# sourceMappingURL=types-BJVZ7ita.d.ts.map
|
package/dist/types.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
var _kubb_fabric_core_types = require("@kubb/fabric-core/types");
|
|
4
|
-
Object.keys(_kubb_fabric_core_types).forEach(function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.keys(_kubb_fabric_core_types).forEach(function(k) {
|
|
3
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _kubb_fabric_core_types[k];
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
9
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1,63 +1,3 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { n as Param, r as Params } from "./getFunctionParams-ClT1iMr_.js";
|
|
3
|
-
import { KubbFile } from "@kubb/fabric-core/types";
|
|
4
|
-
import React, { JSX, ReactNode } from "react";
|
|
1
|
+
import { _ as Param, a as FabricExportProps, c as FabricReactElement, d as FabricTextProps, f as Key, i as ElementNames, l as FabricReactNode, m as TextNode, n as DOMNode, o as FabricFileProps, p as LineBreakProps, r as DOMNodeAttribute, s as FabricImportProps, t as DOMElement, u as FabricSourceProps, v as Params } from "./types-BJVZ7ita.js";
|
|
5
2
|
export * from "@kubb/fabric-core/types";
|
|
6
|
-
|
|
7
|
-
//#region src/types.d.ts
|
|
8
|
-
declare namespace types_d_exports {
|
|
9
|
-
export { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, FabricExportProps, FabricFileProps, FabricImportProps, FabricReactElement, FabricReactNode, FabricSourceProps, FabricTextProps, Key, LineBreakProps, Param, Params, TextNode };
|
|
10
|
-
}
|
|
11
|
-
import * as import__kubb_fabric_core_types from "@kubb/fabric-core/types";
|
|
12
|
-
type Key = string | number | bigint;
|
|
13
|
-
type ElementNames = 'br' | 'div' | 'indent' | 'dedent' | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app';
|
|
14
|
-
type Node = {
|
|
15
|
-
parentNode: DOMElement | undefined;
|
|
16
|
-
internal_static?: boolean;
|
|
17
|
-
};
|
|
18
|
-
type DOMNodeAttribute = boolean | string | number;
|
|
19
|
-
type TextName = '#text';
|
|
20
|
-
type TextNode = {
|
|
21
|
-
nodeName: TextName;
|
|
22
|
-
nodeValue: string;
|
|
23
|
-
} & Node;
|
|
24
|
-
type DOMNode<T = {
|
|
25
|
-
nodeName: NodeNames;
|
|
26
|
-
}> = T extends {
|
|
27
|
-
nodeName: infer U;
|
|
28
|
-
} ? U extends '#text' ? TextNode : DOMElement : never;
|
|
29
|
-
type OutputTransformer = (s: string, index: number) => string;
|
|
30
|
-
type DOMElement = {
|
|
31
|
-
nodeName: ElementNames;
|
|
32
|
-
attributes: Map<string, DOMNodeAttribute>;
|
|
33
|
-
childNodes: DOMNode[];
|
|
34
|
-
internal_transform?: OutputTransformer;
|
|
35
|
-
isStaticDirty?: boolean;
|
|
36
|
-
staticNode?: DOMElement;
|
|
37
|
-
onComputeLayout?: () => void;
|
|
38
|
-
onRender?: () => void;
|
|
39
|
-
onImmediateRender?: () => void;
|
|
40
|
-
} & Node;
|
|
41
|
-
type NodeNames = ElementNames | TextName;
|
|
42
|
-
type FabricReactNode = ReactNode;
|
|
43
|
-
type FabricReactElement = JSX.Element;
|
|
44
|
-
type FabricTextProps = {
|
|
45
|
-
children?: FabricReactNode;
|
|
46
|
-
};
|
|
47
|
-
type FabricFileProps = {
|
|
48
|
-
id?: string;
|
|
49
|
-
children?: FabricReactNode;
|
|
50
|
-
baseName: string;
|
|
51
|
-
path: string;
|
|
52
|
-
override?: boolean;
|
|
53
|
-
meta?: KubbFile.File['meta'];
|
|
54
|
-
};
|
|
55
|
-
type FabricSourceProps = KubbFile.Source & {
|
|
56
|
-
children?: FabricReactNode;
|
|
57
|
-
};
|
|
58
|
-
type FabricImportProps = KubbFile.Import;
|
|
59
|
-
type FabricExportProps = KubbFile.Export;
|
|
60
|
-
type LineBreakProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
|
|
61
|
-
//#endregion
|
|
62
|
-
export { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, FabricExportProps, FabricFileProps, FabricImportProps, FabricReactElement, FabricReactNode, FabricSourceProps, FabricTextProps, Key, LineBreakProps, type Param, type Params, TextNode, types_d_exports as t };
|
|
63
|
-
//# sourceMappingURL=types.d.ts.map
|
|
3
|
+
export { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, FabricExportProps, FabricFileProps, FabricImportProps, FabricReactElement, FabricReactNode, FabricSourceProps, FabricTextProps, Key, LineBreakProps, Param, Params, TextNode };
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from "@kubb/fabric-core/types"
|
|
2
|
-
|
|
3
|
-
export { };
|
|
1
|
+
export * from "@kubb/fabric-core/types";
|
|
2
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/react-fabric",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "React integration for Kubb's fabric - JSX runtime and component-based code generation with React reconciler for building type-safe generators",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
"*.d.cts",
|
|
93
93
|
"!*.map",
|
|
94
94
|
"!/**/**.test.**",
|
|
95
|
-
"!/**/__tests__/**"
|
|
95
|
+
"!/**/__tests__/**",
|
|
96
|
+
"!/**/__snapshots__/**"
|
|
96
97
|
],
|
|
97
98
|
"size-limit": [
|
|
98
99
|
{
|
|
@@ -105,7 +106,7 @@
|
|
|
105
106
|
"react-devtools-core": "6.1.5",
|
|
106
107
|
"remeda": "^2.33.6",
|
|
107
108
|
"ws": "8.18.0",
|
|
108
|
-
"@kubb/fabric-core": "0.
|
|
109
|
+
"@kubb/fabric-core": "0.14.0"
|
|
109
110
|
},
|
|
110
111
|
"devDependencies": {
|
|
111
112
|
"@types/react": "^19.2.14",
|
|
@@ -121,6 +122,11 @@
|
|
|
121
122
|
"access": "public",
|
|
122
123
|
"registry": "https://registry.npmjs.org/"
|
|
123
124
|
},
|
|
125
|
+
"inlinedDependencies": {
|
|
126
|
+
"react": "19.2.3",
|
|
127
|
+
"react-reconciler": "0.33.0",
|
|
128
|
+
"scheduler": "0.27.0"
|
|
129
|
+
},
|
|
124
130
|
"scripts": {
|
|
125
131
|
"build": "tsdown && size-limit",
|
|
126
132
|
"clean": "node -e \"require('fs').rmSync('./dist', {recursive:true,force:true})\"",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FabricContext, NodeTreeContext, provide, RootContext, useContext, useNodeTree } from '@kubb/fabric-core'
|
|
2
2
|
import type { FabricReactElement, FabricReactNode } from '../types.ts'
|
|
3
3
|
|
|
4
|
-
export type
|
|
4
|
+
export type FabricProps<TMeta extends object = object> = {
|
|
5
5
|
/**
|
|
6
6
|
* Metadata associated with the App.
|
|
7
7
|
*/
|
|
@@ -13,9 +13,9 @@ export type AppProps<TMeta extends object = object> = {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Fabric container containing the FabricContext carrying `meta` and an `exit` hook.
|
|
17
17
|
*/
|
|
18
|
-
export function
|
|
18
|
+
export function Fabric<TMeta extends object = object>({ children, ...props }: FabricProps<TMeta>): FabricReactElement {
|
|
19
19
|
const { meta = {} } = props
|
|
20
20
|
|
|
21
21
|
const { exit } = useContext(RootContext)
|
|
@@ -28,9 +28,9 @@ export function App<TMeta extends object = object>({ children, ...props }: AppPr
|
|
|
28
28
|
provide(NodeTreeContext, childTree)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
provide(
|
|
31
|
+
provide(FabricContext, { exit, meta })
|
|
32
32
|
|
|
33
33
|
return <>{children}</>
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Fabric.displayName = 'Fabric'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFabric } from '@kubb/fabric-core'
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// import './globals.ts'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
export type { Fabric } from '@kubb/fabric-core'
|
|
5
4
|
// expose fabric core helpers
|
|
6
5
|
export { createContext, createFabric, createFile, FileManager, FileProcessor, TreeNode, useContext } from '@kubb/fabric-core'
|
|
7
6
|
|
|
@@ -11,8 +10,8 @@ export const useEffect = React.useEffect
|
|
|
11
10
|
export const useReducer = React.useReducer
|
|
12
11
|
export const useRef = React.useRef
|
|
13
12
|
|
|
14
|
-
export { App } from './components/App.tsx'
|
|
15
13
|
export { Const } from './components/Const.tsx'
|
|
14
|
+
export { Fabric } from './components/Fabric.tsx'
|
|
16
15
|
export { File } from './components/File.tsx'
|
|
17
16
|
export { Function } from './components/Function.tsx'
|
|
18
17
|
// components
|
|
@@ -20,7 +19,7 @@ export { Root } from './components/Root.tsx'
|
|
|
20
19
|
export { Type } from './components/Type.tsx'
|
|
21
20
|
|
|
22
21
|
// composables
|
|
23
|
-
export {
|
|
22
|
+
export { useFabric } from './composables/useFabric.ts'
|
|
24
23
|
export { useFile } from './composables/useFile.ts'
|
|
25
24
|
export { useLifecycle } from './composables/useLifecycle.tsx'
|
|
26
25
|
|
package/src/jsx-dev-runtime.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react/jsx-
|
|
1
|
+
import * as React from 'react/jsx-runtime'
|
|
2
2
|
import type { FabricReactElement, FabricReactNode } from './types.ts'
|
|
3
3
|
|
|
4
4
|
export const Fragment = React.Fragment
|
|
5
|
-
export const jsxDEV = React.
|
|
5
|
+
export const jsxDEV = React.jsx
|
|
6
6
|
|
|
7
7
|
export type * from './jsx-namespace.d.ts'
|
|
8
8
|
|
|
@@ -15,8 +15,8 @@ export type Options = {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
type ExtendOptions = {
|
|
18
|
-
render(
|
|
19
|
-
renderToString(
|
|
18
|
+
render(Fabric: FabricReactElement): Promise<void>
|
|
19
|
+
renderToString(Fabric: FabricReactElement): Promise<string>
|
|
20
20
|
waitUntilExit(): Promise<void>
|
|
21
21
|
unmount(error?: Error | number | null): void
|
|
22
22
|
}
|
|
@@ -24,8 +24,8 @@ type ExtendOptions = {
|
|
|
24
24
|
declare global {
|
|
25
25
|
namespace Kubb {
|
|
26
26
|
interface Fabric {
|
|
27
|
-
render(
|
|
28
|
-
renderToString(
|
|
27
|
+
render(Fabric: FabricReactElement): Promise<void>
|
|
28
|
+
renderToString(Fabric: FabricReactElement): Promise<string>
|
|
29
29
|
waitUntilExit(): Promise<void>
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -38,13 +38,13 @@ export const reactPlugin = definePlugin<Options, ExtendOptions>({
|
|
|
38
38
|
const runtime = new Runtime({ fileManager: ctx.fileManager, ...options })
|
|
39
39
|
|
|
40
40
|
return {
|
|
41
|
-
async render(
|
|
41
|
+
async render(Fabric) {
|
|
42
42
|
await ctx.emit('lifecycle:start')
|
|
43
|
-
await runtime.render(
|
|
43
|
+
await runtime.render(Fabric)
|
|
44
44
|
},
|
|
45
|
-
async renderToString(
|
|
45
|
+
async renderToString(Fabric) {
|
|
46
46
|
await ctx.emit('lifecycle:start')
|
|
47
|
-
return runtime.renderToString(
|
|
47
|
+
return runtime.renderToString(Fabric)
|
|
48
48
|
},
|
|
49
49
|
async waitUntilExit() {
|
|
50
50
|
await runtime.waitUntilExit()
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
//#endregion
|
|
2
|
-
//#region src/utils/getFunctionParams.d.ts
|
|
3
|
-
type Param = {
|
|
4
|
-
/**
|
|
5
|
-
* `object` will return the pathParams as an object.
|
|
6
|
-
*
|
|
7
|
-
* `inline` will return the pathParams as comma separated params.
|
|
8
|
-
* @default `'inline'`
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
mode?: 'object' | 'inline' | 'inlineSpread';
|
|
12
|
-
type?: 'string' | 'number' | (string & {});
|
|
13
|
-
optional?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* @example test = "default"
|
|
16
|
-
*/
|
|
17
|
-
default?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Used for no TypeScript(with mode object)
|
|
20
|
-
* @example test: "default"
|
|
21
|
-
*/
|
|
22
|
-
value?: string;
|
|
23
|
-
children?: Params;
|
|
24
|
-
};
|
|
25
|
-
type Params = Record<string, Param | undefined>;
|
|
26
|
-
type Options = {
|
|
27
|
-
type: 'constructor' | 'call' | 'object' | 'objectValue';
|
|
28
|
-
transformName?: (name: string) => string;
|
|
29
|
-
transformType?: (type: string) => string;
|
|
30
|
-
};
|
|
31
|
-
declare function createFunctionParams(params: Params): Params;
|
|
32
|
-
declare class FunctionParams {
|
|
33
|
-
#private;
|
|
34
|
-
static factory(params: Params): FunctionParams;
|
|
35
|
-
constructor(params: Params);
|
|
36
|
-
get params(): Params;
|
|
37
|
-
get flatParams(): Params;
|
|
38
|
-
toCall({
|
|
39
|
-
transformName,
|
|
40
|
-
transformType
|
|
41
|
-
}?: Pick<Options, 'transformName' | 'transformType'>): string;
|
|
42
|
-
toObject(): string;
|
|
43
|
-
toObjectValue(): string;
|
|
44
|
-
toConstructor(): string;
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { __exportAll as a, createFunctionParams as i, Param as n, __reExport as o, Params as r, FunctionParams as t };
|
|
48
|
-
//# sourceMappingURL=getFunctionParams-BJb7Kd-D.d.ts.map
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//#region src/utils/getFunctionParams.d.ts
|
|
2
|
-
type Param = {
|
|
3
|
-
/**
|
|
4
|
-
* `object` will return the pathParams as an object.
|
|
5
|
-
*
|
|
6
|
-
* `inline` will return the pathParams as comma separated params.
|
|
7
|
-
* @default `'inline'`
|
|
8
|
-
* @private
|
|
9
|
-
*/
|
|
10
|
-
mode?: 'object' | 'inline' | 'inlineSpread';
|
|
11
|
-
type?: 'string' | 'number' | (string & {});
|
|
12
|
-
optional?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* @example test = "default"
|
|
15
|
-
*/
|
|
16
|
-
default?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Used for no TypeScript(with mode object)
|
|
19
|
-
* @example test: "default"
|
|
20
|
-
*/
|
|
21
|
-
value?: string;
|
|
22
|
-
children?: Params;
|
|
23
|
-
};
|
|
24
|
-
type Params = Record<string, Param | undefined>;
|
|
25
|
-
type Options = {
|
|
26
|
-
type: 'constructor' | 'call' | 'object' | 'objectValue';
|
|
27
|
-
transformName?: (name: string) => string;
|
|
28
|
-
transformType?: (type: string) => string;
|
|
29
|
-
};
|
|
30
|
-
declare function createFunctionParams(params: Params): Params;
|
|
31
|
-
declare class FunctionParams {
|
|
32
|
-
#private;
|
|
33
|
-
static factory(params: Params): FunctionParams;
|
|
34
|
-
constructor(params: Params);
|
|
35
|
-
get params(): Params;
|
|
36
|
-
get flatParams(): Params;
|
|
37
|
-
toCall({
|
|
38
|
-
transformName,
|
|
39
|
-
transformType
|
|
40
|
-
}?: Pick<Options, 'transformName' | 'transformType'>): string;
|
|
41
|
-
toObject(): string;
|
|
42
|
-
toObjectValue(): string;
|
|
43
|
-
toConstructor(): string;
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
export { createFunctionParams as i, Param as n, Params as r, FunctionParams as t };
|
|
47
|
-
//# sourceMappingURL=getFunctionParams-ClT1iMr_.d.ts.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { FabricExportProps, FabricFileProps, FabricImportProps, FabricReactElement, FabricReactNode, FabricSourceProps, FabricTextProps, LineBreakProps } from "./types.js";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/jsx-namespace.d.ts
|
|
5
|
-
declare namespace JSX$1 {
|
|
6
|
-
type ElementType = React.JSX.ElementType;
|
|
7
|
-
type Element = FabricReactElement;
|
|
8
|
-
interface ElementClass extends React.JSX.ElementClass {
|
|
9
|
-
render(): FabricReactNode;
|
|
10
|
-
}
|
|
11
|
-
interface ElementAttributesProperty {
|
|
12
|
-
props: {};
|
|
13
|
-
}
|
|
14
|
-
interface ElementChildrenAttribute {
|
|
15
|
-
children: {};
|
|
16
|
-
}
|
|
17
|
-
interface IntrinsicElements extends React.JSX.IntrinsicElements {
|
|
18
|
-
'kubb-text': FabricTextProps;
|
|
19
|
-
'kubb-file': FabricFileProps;
|
|
20
|
-
'kubb-source': FabricSourceProps;
|
|
21
|
-
'kubb-import': FabricImportProps;
|
|
22
|
-
'kubb-export': FabricExportProps;
|
|
23
|
-
br: LineBreakProps;
|
|
24
|
-
indent: {};
|
|
25
|
-
dedent: {};
|
|
26
|
-
}
|
|
27
|
-
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
|
|
28
|
-
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
|
29
|
-
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { JSX$1 as t };
|
|
33
|
-
//# sourceMappingURL=jsx-namespace-BLQ6SvuD.d.ts.map
|