@kubb/fabric-core 0.11.7 → 0.12.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/dist/{Fabric-BoTE1-WX.d.cts → Fabric-BbVC650D.d.cts} +86 -15
- package/dist/{Fabric-CWquRFa2.d.ts → Fabric-eh92yS1R.d.ts} +86 -15
- package/dist/Root-BT59jU0W.js +931 -0
- package/dist/Root-BT59jU0W.js.map +1 -0
- package/dist/Root-SC_lWG_q.cjs +1057 -0
- package/dist/Root-SC_lWG_q.cjs.map +1 -0
- package/dist/{defaultParser-CFIT3sEE.cjs → defaultParser-2ym3KiZd.cjs} +3 -4
- package/dist/{defaultParser-CFIT3sEE.cjs.map → defaultParser-2ym3KiZd.cjs.map} +1 -1
- package/dist/{defaultParser-DZ2kzujH.js → defaultParser-DDFR9BTS.js} +2 -2
- package/dist/{defaultParser-DZ2kzujH.js.map → defaultParser-DDFR9BTS.js.map} +1 -1
- package/dist/{getRelativePath-y7WcYR5C.js → getRelativePath-COUEoqbz.js} +11 -2
- package/dist/getRelativePath-COUEoqbz.js.map +1 -0
- package/dist/{getRelativePath-BllDunh0.cjs → getRelativePath-jYLCpluV.cjs} +16 -1
- package/dist/getRelativePath-jYLCpluV.cjs.map +1 -0
- package/dist/index.cjs +129 -448
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -90
- package/dist/index.d.ts +54 -90
- package/dist/index.js +92 -416
- package/dist/index.js.map +1 -1
- package/dist/parsers/typescript.cjs +7 -107
- package/dist/parsers/typescript.d.cts +1 -1
- package/dist/parsers/typescript.d.ts +1 -1
- package/dist/parsers/typescript.js +2 -101
- package/dist/parsers.cjs +7 -8
- package/dist/parsers.cjs.map +1 -1
- package/dist/parsers.d.cts +1 -1
- package/dist/parsers.d.ts +1 -1
- package/dist/parsers.js +3 -3
- package/dist/plugins.cjs +103 -9
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.d.cts +32 -9
- package/dist/plugins.d.ts +32 -9
- package/dist/plugins.js +96 -3
- package/dist/plugins.js.map +1 -1
- package/dist/types-BI7rICUP.d.cts +31 -0
- package/dist/types-DpITKjSb.d.ts +32 -0
- package/dist/types.cjs +6 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +4 -3
- package/dist/types.d.ts +4 -3
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typescriptParser-DyosyI_A.js +101 -0
- package/dist/typescriptParser-DyosyI_A.js.map +1 -0
- package/dist/typescriptParser-qjzb2pIh.cjs +137 -0
- package/dist/typescriptParser-qjzb2pIh.cjs.map +1 -0
- package/dist/{TreeNode-DomNP5og.d.cts → useNodeTree-CmXKaRqq.d.cts} +10 -3
- package/dist/{TreeNode-C1VnIF0o.d.ts → useNodeTree-DUdlgys5.d.ts} +10 -3
- package/package.json +3 -2
- package/src/Fabric.ts +13 -5
- package/src/KubbFile.ts +3 -11
- package/src/components/App.ts +6 -5
- package/src/components/Br.ts +11 -0
- package/src/components/Const.ts +6 -5
- package/src/components/Dedent.ts +10 -0
- package/src/components/File.ts +21 -16
- package/src/components/Function.ts +17 -13
- package/src/components/Indent.ts +7 -0
- package/src/components/Root.ts +6 -5
- package/src/components/Type.ts +6 -5
- package/src/components/__snapshots__/arrow_function_with_generics.ts +3 -3
- package/src/components/__snapshots__/async_arrow_function.ts +3 -3
- package/src/components/__snapshots__/async_function.ts +2 -2
- package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +2 -2
- package/src/components/__snapshots__/basic_arrow_function.ts +3 -3
- package/src/components/__snapshots__/basic_export.ts +1 -0
- package/src/components/__snapshots__/basic_function.ts +2 -2
- package/src/components/__snapshots__/basic_import.ts +1 -0
- package/src/components/__snapshots__/default_exported_arrow_function.ts +3 -3
- package/src/components/__snapshots__/default_exported_function.ts +2 -2
- package/src/components/__snapshots__/exported_arrow_function.ts +3 -3
- package/src/components/__snapshots__/exported_function.ts +2 -2
- package/src/components/__snapshots__/function_with_JSDoc.ts +2 -2
- package/src/components/__snapshots__/function_with_generics.ts +2 -2
- package/src/components/__snapshots__/function_with_parameters.ts +2 -2
- package/src/components/__snapshots__/function_with_return_type.ts +2 -2
- package/src/components/__snapshots__/matches_with_root_import.ts +1 -0
- package/src/components/__snapshots__/named_export.ts +1 -0
- package/src/components/__snapshots__/named_export_(object_advanced).ts +1 -0
- package/src/components/__snapshots__/named_import.ts +1 -0
- package/src/components/__snapshots__/named_import_(object).ts +1 -0
- package/src/components/__snapshots__/named_import_(object_advanced).ts +1 -0
- package/src/components/__snapshots__/named_typed_export.ts +1 -0
- package/src/components/__snapshots__/named_typed_import.ts +1 -0
- package/src/components/__snapshots__/typed_export.ts +1 -0
- package/src/components/__snapshots__/typed_import.ts +1 -0
- package/src/contexts/RenderContext.ts +13 -0
- package/src/createComponent.ts +34 -0
- package/src/index.ts +9 -9
- package/src/intrinsic.ts +143 -0
- package/src/plugins/fsxPlugin/Runtime.ts +96 -0
- package/src/plugins/fsxPlugin/fsxPlugin.ts +45 -0
- package/src/plugins/index.ts +1 -0
- package/src/types.ts +4 -1
- package/dist/TreeNode-CC3a0Bae.js +0 -447
- package/dist/TreeNode-CC3a0Bae.js.map +0 -1
- package/dist/TreeNode-CFchatCw.cjs +0 -494
- package/dist/TreeNode-CFchatCw.cjs.map +0 -1
- package/dist/defineParser-CVCxqqzB.cjs +0 -18
- package/dist/defineParser-CVCxqqzB.cjs.map +0 -1
- package/dist/defineParser-Lco7nlj0.js +0 -13
- package/dist/defineParser-Lco7nlj0.js.map +0 -1
- package/dist/getRelativePath-BllDunh0.cjs.map +0 -1
- package/dist/getRelativePath-y7WcYR5C.js.map +0 -1
- package/dist/parsers/typescript.cjs.map +0 -1
- package/dist/parsers/typescript.js.map +0 -1
- package/dist/types-DYepTJ6F.d.cts +0 -82
- package/dist/types-yNaQHNUB.d.ts +0 -83
- package/src/components/Text.ts +0 -27
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { c as FileManager, x as __name } from "./Fabric-BoTE1-WX.cjs";
|
|
2
|
-
import { t as TreeNode } from "./TreeNode-DomNP5og.cjs";
|
|
3
|
-
|
|
4
|
-
//#region src/composables/useNodeTree.d.ts
|
|
5
|
-
type ComponentNode = {
|
|
6
|
-
type: string;
|
|
7
|
-
props: Record<string, unknown>;
|
|
8
|
-
};
|
|
9
|
-
declare function useNodeTree(): TreeNode<ComponentNode> | null;
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/context.d.ts
|
|
12
|
-
/**
|
|
13
|
-
* Context type that carries type information about its value
|
|
14
|
-
* This is a branded symbol type that enables type-safe context usage
|
|
15
|
-
*/
|
|
16
|
-
type Context<T> = symbol & {
|
|
17
|
-
readonly __type: T;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Provides a value to descendant components (Vue 3 style)
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const ThemeKey = Symbol('theme')
|
|
25
|
-
* provide(ThemeKey, { color: 'blue' })
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
declare function provide<T>(key: symbol | Context<T>, value: T): void;
|
|
29
|
-
/**
|
|
30
|
-
* Injects a value provided by an ancestor component (Vue 3 style)
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* const theme = inject(ThemeKey, { color: 'default' })
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
declare function inject<T>(key: symbol | Context<T>, defaultValue?: T): T;
|
|
38
|
-
/**
|
|
39
|
-
* Unprovides a value (for cleanup)
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
declare function unprovide<T>(key: symbol | Context<T>): void;
|
|
43
|
-
/**
|
|
44
|
-
* Creates a context key with a default value (React-style compatibility)
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```ts
|
|
48
|
-
* const ThemeContext = createContext({ color: 'blue' })
|
|
49
|
-
* // ThemeContext is now typed as Context<{ color: string }>
|
|
50
|
-
* const theme = useContext(ThemeContext) // theme is { color: string }
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
declare function createContext<T>(defaultValue: T): Context<T>;
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/contexts/RootContext.d.ts
|
|
56
|
-
type RootContextProps = {
|
|
57
|
-
/**
|
|
58
|
-
* Exit (unmount) the whole app.
|
|
59
|
-
*/
|
|
60
|
-
exit: (error?: Error) => void;
|
|
61
|
-
/**
|
|
62
|
-
* TreeNode representing the tree structure of the app.
|
|
63
|
-
*/
|
|
64
|
-
treeNode: TreeNode<ComponentNode>;
|
|
65
|
-
/**
|
|
66
|
-
* FileManager instance for managing files within the app.
|
|
67
|
-
*/
|
|
68
|
-
fileManager: FileManager;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Context providing root-level functionalities such as exit hook, tree node structure, and file management.
|
|
72
|
-
* Define in the `render` helper of the runtime.
|
|
73
|
-
*/
|
|
74
|
-
declare const RootContext: Context<RootContextProps>;
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/types.d.ts
|
|
77
|
-
type JSDoc = {
|
|
78
|
-
comments: string[];
|
|
79
|
-
};
|
|
80
|
-
//#endregion
|
|
81
|
-
export { createContext as a, unprovide as c, Context as i, ComponentNode as l, RootContext as n, inject as o, RootContextProps as r, provide as s, JSDoc as t, useNodeTree as u };
|
|
82
|
-
//# sourceMappingURL=types-DYepTJ6F.d.cts.map
|
package/dist/types-yNaQHNUB.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { n as __name } from "./chunk-8X4u0d05.js";
|
|
2
|
-
import { c as FileManager } from "./Fabric-CWquRFa2.js";
|
|
3
|
-
import { t as TreeNode } from "./TreeNode-C1VnIF0o.js";
|
|
4
|
-
|
|
5
|
-
//#region src/composables/useNodeTree.d.ts
|
|
6
|
-
type ComponentNode = {
|
|
7
|
-
type: string;
|
|
8
|
-
props: Record<string, unknown>;
|
|
9
|
-
};
|
|
10
|
-
declare function useNodeTree(): TreeNode<ComponentNode> | null;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/context.d.ts
|
|
13
|
-
/**
|
|
14
|
-
* Context type that carries type information about its value
|
|
15
|
-
* This is a branded symbol type that enables type-safe context usage
|
|
16
|
-
*/
|
|
17
|
-
type Context<T> = symbol & {
|
|
18
|
-
readonly __type: T;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Provides a value to descendant components (Vue 3 style)
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const ThemeKey = Symbol('theme')
|
|
26
|
-
* provide(ThemeKey, { color: 'blue' })
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare function provide<T>(key: symbol | Context<T>, value: T): void;
|
|
30
|
-
/**
|
|
31
|
-
* Injects a value provided by an ancestor component (Vue 3 style)
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* const theme = inject(ThemeKey, { color: 'default' })
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
declare function inject<T>(key: symbol | Context<T>, defaultValue?: T): T;
|
|
39
|
-
/**
|
|
40
|
-
* Unprovides a value (for cleanup)
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
declare function unprovide<T>(key: symbol | Context<T>): void;
|
|
44
|
-
/**
|
|
45
|
-
* Creates a context key with a default value (React-style compatibility)
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* const ThemeContext = createContext({ color: 'blue' })
|
|
50
|
-
* // ThemeContext is now typed as Context<{ color: string }>
|
|
51
|
-
* const theme = useContext(ThemeContext) // theme is { color: string }
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
declare function createContext<T>(defaultValue: T): Context<T>;
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/contexts/RootContext.d.ts
|
|
57
|
-
type RootContextProps = {
|
|
58
|
-
/**
|
|
59
|
-
* Exit (unmount) the whole app.
|
|
60
|
-
*/
|
|
61
|
-
exit: (error?: Error) => void;
|
|
62
|
-
/**
|
|
63
|
-
* TreeNode representing the tree structure of the app.
|
|
64
|
-
*/
|
|
65
|
-
treeNode: TreeNode<ComponentNode>;
|
|
66
|
-
/**
|
|
67
|
-
* FileManager instance for managing files within the app.
|
|
68
|
-
*/
|
|
69
|
-
fileManager: FileManager;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Context providing root-level functionalities such as exit hook, tree node structure, and file management.
|
|
73
|
-
* Define in the `render` helper of the runtime.
|
|
74
|
-
*/
|
|
75
|
-
declare const RootContext: Context<RootContextProps>;
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/types.d.ts
|
|
78
|
-
type JSDoc = {
|
|
79
|
-
comments: string[];
|
|
80
|
-
};
|
|
81
|
-
//#endregion
|
|
82
|
-
export { createContext as a, unprovide as c, Context as i, ComponentNode as l, RootContext as n, inject as o, RootContextProps as r, provide as s, JSDoc as t, useNodeTree as u };
|
|
83
|
-
//# sourceMappingURL=types-yNaQHNUB.d.ts.map
|
package/src/components/Text.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
/**
|
|
3
|
-
* Children nodes.
|
|
4
|
-
*/
|
|
5
|
-
children?: string | (() => string | Array<string> | undefined)
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Generates a text node from string or function returning string/array of strings.
|
|
10
|
-
*/
|
|
11
|
-
export function Text({ children }: Props): string {
|
|
12
|
-
if (!children) {
|
|
13
|
-
return ''
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (typeof children === 'string') {
|
|
17
|
-
return children
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const value = children()
|
|
21
|
-
|
|
22
|
-
if (Array.isArray(value)) {
|
|
23
|
-
return value.join('\n')
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return value || ''
|
|
27
|
-
}
|