@kubb/react-fabric 0.0.0-canary-20251020201500

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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -0
  3. package/dist/devtools.cjs +10817 -0
  4. package/dist/devtools.cjs.map +1 -0
  5. package/dist/devtools.d.cts +1 -0
  6. package/dist/devtools.d.ts +1 -0
  7. package/dist/devtools.js +10817 -0
  8. package/dist/devtools.js.map +1 -0
  9. package/dist/globals-8sJ940pg.cjs +0 -0
  10. package/dist/globals-C6rGETh5.d.ts +166 -0
  11. package/dist/globals-CnATk-Sl.d.cts +166 -0
  12. package/dist/globals-Df5klKjG.js +1 -0
  13. package/dist/globals.cjs +1 -0
  14. package/dist/globals.d.cts +2 -0
  15. package/dist/globals.d.ts +2 -0
  16. package/dist/globals.js +3 -0
  17. package/dist/index.cjs +15924 -0
  18. package/dist/index.cjs.map +1 -0
  19. package/dist/index.d.cts +331 -0
  20. package/dist/index.d.ts +331 -0
  21. package/dist/index.js +15899 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/jsx-dev-runtime.cjs +9 -0
  24. package/dist/jsx-dev-runtime.d.cts +13 -0
  25. package/dist/jsx-dev-runtime.d.ts +13 -0
  26. package/dist/jsx-dev-runtime.js +6 -0
  27. package/dist/jsx-runtime-B3MMb3PL.cjs +233 -0
  28. package/dist/jsx-runtime-B3MMb3PL.cjs.map +1 -0
  29. package/dist/jsx-runtime-BPQkRAg2.js +228 -0
  30. package/dist/jsx-runtime-BPQkRAg2.js.map +1 -0
  31. package/dist/jsx-runtime-DmD5u6a-.js +13 -0
  32. package/dist/jsx-runtime-DmD5u6a-.js.map +1 -0
  33. package/dist/jsx-runtime-zKfRQHQD.cjs +36 -0
  34. package/dist/jsx-runtime-zKfRQHQD.cjs.map +1 -0
  35. package/dist/jsx-runtime.cjs +9 -0
  36. package/dist/jsx-runtime.js +6 -0
  37. package/dist/react-BBkwFtZV.js +1138 -0
  38. package/dist/react-BBkwFtZV.js.map +1 -0
  39. package/dist/react-Bq0UOw6S.cjs +1156 -0
  40. package/dist/react-Bq0UOw6S.cjs.map +1 -0
  41. package/dist/types-C3p0Ljxf.d.cts +85 -0
  42. package/dist/types-DEroxUW0.d.ts +85 -0
  43. package/dist/types.cjs +0 -0
  44. package/dist/types.d.cts +2 -0
  45. package/dist/types.d.ts +2 -0
  46. package/dist/types.js +1 -0
  47. package/package.json +115 -0
  48. package/src/ReactTemplate.tsx +229 -0
  49. package/src/components/App.tsx +27 -0
  50. package/src/components/Const.tsx +53 -0
  51. package/src/components/File.tsx +100 -0
  52. package/src/components/Function.tsx +139 -0
  53. package/src/components/Indent.tsx +53 -0
  54. package/src/components/Root.tsx +75 -0
  55. package/src/components/Type.tsx +40 -0
  56. package/src/createApp.ts +23 -0
  57. package/src/devtools.ts +118 -0
  58. package/src/dom.ts +75 -0
  59. package/src/globals.ts +52 -0
  60. package/src/hooks/useApp.ts +15 -0
  61. package/src/hooks/useFile.ts +14 -0
  62. package/src/hooks/useLifecycle.tsx +18 -0
  63. package/src/index.ts +24 -0
  64. package/src/jsx-runtime.ts +8 -0
  65. package/src/kubbRenderer.ts +175 -0
  66. package/src/types.ts +53 -0
  67. package/src/utils/createJSDoc.ts +9 -0
  68. package/src/utils/getFunctionParams.ts +236 -0
  69. package/src/utils/processFiles.ts +44 -0
  70. package/src/utils/squashExportNodes.ts +23 -0
  71. package/src/utils/squashImportNodes.ts +23 -0
  72. package/src/utils/squashSourceNodes.ts +40 -0
  73. package/src/utils/squashTextNodes.ts +82 -0
File without changes
@@ -0,0 +1,166 @@
1
+ import { s as KubbNode } from "./types-DEroxUW0.js";
2
+ import React from "react";
3
+
4
+ //#region ../fabric-core/src/types.d.ts
5
+ type BasePath<T extends string = string> = `${T}/`;
6
+ type Import = {
7
+ /**
8
+ * Import name to be used
9
+ * @example ["useState"]
10
+ * @example "React"
11
+ */
12
+ name: string | Array<string | {
13
+ propertyName: string;
14
+ name?: string;
15
+ }>;
16
+ /**
17
+ * Path for the import
18
+ * @example '@kubb/core'
19
+ */
20
+ path: string;
21
+ /**
22
+ * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
23
+ */
24
+ isTypeOnly?: boolean;
25
+ isNameSpace?: boolean;
26
+ /**
27
+ * When root is set it will get the path with relative getRelativePath(root, path).
28
+ */
29
+ root?: string;
30
+ };
31
+ type Source = {
32
+ name?: string;
33
+ value?: string;
34
+ isTypeOnly?: boolean;
35
+ /**
36
+ * Has const or type 'export'
37
+ * @default false
38
+ */
39
+ isExportable?: boolean;
40
+ /**
41
+ * When set, barrel generation will add this
42
+ * @default false
43
+ */
44
+ isIndexable?: boolean;
45
+ };
46
+ type Export = {
47
+ /**
48
+ * Export name to be used.
49
+ * @example ["useState"]
50
+ * @example "React"
51
+ */
52
+ name?: string | Array<string>;
53
+ /**
54
+ * Path for the import.
55
+ * @example '@kubb/core'
56
+ */
57
+ path: string;
58
+ /**
59
+ * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
60
+ */
61
+ isTypeOnly?: boolean;
62
+ /**
63
+ * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
64
+ */
65
+ asAlias?: boolean;
66
+ };
67
+ type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
68
+ /**
69
+ * Name to be used to dynamicly create the baseName(based on input.path)
70
+ * Based on UNIX basename
71
+ * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
72
+ */
73
+ type BaseName = `${string}.${string}`;
74
+ /**
75
+ * Path will be full qualified path to a specified file
76
+ */
77
+ type Path = string;
78
+ type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
79
+ type File<TMeta extends object = object> = {
80
+ /**
81
+ * Name to be used to create the path
82
+ * Based on UNIX basename, `${name}.extname`
83
+ * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
84
+ */
85
+ baseName: BaseName;
86
+ /**
87
+ * Path will be full qualified path to a specified file
88
+ */
89
+ path: AdvancedPath<BaseName> | Path;
90
+ sources: Array<Source>;
91
+ imports?: Array<Import>;
92
+ exports?: Array<Export>;
93
+ /**
94
+ * Use extra meta, this is getting used to generate the barrel/index files.
95
+ */
96
+ meta?: TMeta;
97
+ banner?: string;
98
+ footer?: string;
99
+ };
100
+ type ResolvedImport = Import;
101
+ type ResolvedExport = Export;
102
+ type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
103
+ /**
104
+ * @default hash
105
+ */
106
+ id: string;
107
+ /**
108
+ * Contains the first part of the baseName, generated based on baseName
109
+ * @link https://nodejs.org/api/path.html#pathformatpathobject
110
+ */
111
+ name: string;
112
+ extname: Extname;
113
+ imports: Array<ResolvedImport>;
114
+ exports: Array<ResolvedExport>;
115
+ };
116
+ //#endregion
117
+ //#region src/globals.d.ts
118
+ declare module 'react' {
119
+ namespace JSX {
120
+ interface IntrinsicElements {
121
+ 'kubb-text': {
122
+ children?: KubbNode;
123
+ };
124
+ 'kubb-file': {
125
+ id?: string;
126
+ children?: KubbNode;
127
+ baseName: string;
128
+ path: string;
129
+ override?: boolean;
130
+ meta?: File['meta'];
131
+ };
132
+ 'kubb-source': Source & {
133
+ children?: KubbNode;
134
+ };
135
+ 'kubb-import': Import;
136
+ 'kubb-export': Export;
137
+ br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
138
+ }
139
+ }
140
+ }
141
+ declare module '@kubb/react-fabric/jsx-runtime' {
142
+ namespace JSX {
143
+ interface IntrinsicElements {
144
+ 'kubb-text': {
145
+ children?: KubbNode;
146
+ };
147
+ 'kubb-file': {
148
+ id?: string;
149
+ children?: KubbNode;
150
+ baseName: string;
151
+ path: string;
152
+ override?: boolean;
153
+ meta?: File['meta'];
154
+ };
155
+ 'kubb-source': Source & {
156
+ children?: KubbNode;
157
+ };
158
+ 'kubb-import': Import;
159
+ 'kubb-export': Export;
160
+ br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
161
+ }
162
+ }
163
+ }
164
+ //#endregion
165
+ export { Import as a, Source as c, File as i, Export as n, Path as o, Extname as r, ResolvedFile as s, BaseName as t };
166
+ //# sourceMappingURL=globals-C6rGETh5.d.ts.map
@@ -0,0 +1,166 @@
1
+ import { s as KubbNode } from "./types-C3p0Ljxf.cjs";
2
+ import React from "react";
3
+
4
+ //#region ../fabric-core/src/types.d.ts
5
+ type BasePath<T extends string = string> = `${T}/`;
6
+ type Import = {
7
+ /**
8
+ * Import name to be used
9
+ * @example ["useState"]
10
+ * @example "React"
11
+ */
12
+ name: string | Array<string | {
13
+ propertyName: string;
14
+ name?: string;
15
+ }>;
16
+ /**
17
+ * Path for the import
18
+ * @example '@kubb/core'
19
+ */
20
+ path: string;
21
+ /**
22
+ * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
23
+ */
24
+ isTypeOnly?: boolean;
25
+ isNameSpace?: boolean;
26
+ /**
27
+ * When root is set it will get the path with relative getRelativePath(root, path).
28
+ */
29
+ root?: string;
30
+ };
31
+ type Source = {
32
+ name?: string;
33
+ value?: string;
34
+ isTypeOnly?: boolean;
35
+ /**
36
+ * Has const or type 'export'
37
+ * @default false
38
+ */
39
+ isExportable?: boolean;
40
+ /**
41
+ * When set, barrel generation will add this
42
+ * @default false
43
+ */
44
+ isIndexable?: boolean;
45
+ };
46
+ type Export = {
47
+ /**
48
+ * Export name to be used.
49
+ * @example ["useState"]
50
+ * @example "React"
51
+ */
52
+ name?: string | Array<string>;
53
+ /**
54
+ * Path for the import.
55
+ * @example '@kubb/core'
56
+ */
57
+ path: string;
58
+ /**
59
+ * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
60
+ */
61
+ isTypeOnly?: boolean;
62
+ /**
63
+ * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
64
+ */
65
+ asAlias?: boolean;
66
+ };
67
+ type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
68
+ /**
69
+ * Name to be used to dynamicly create the baseName(based on input.path)
70
+ * Based on UNIX basename
71
+ * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
72
+ */
73
+ type BaseName = `${string}.${string}`;
74
+ /**
75
+ * Path will be full qualified path to a specified file
76
+ */
77
+ type Path = string;
78
+ type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
79
+ type File<TMeta extends object = object> = {
80
+ /**
81
+ * Name to be used to create the path
82
+ * Based on UNIX basename, `${name}.extname`
83
+ * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
84
+ */
85
+ baseName: BaseName;
86
+ /**
87
+ * Path will be full qualified path to a specified file
88
+ */
89
+ path: AdvancedPath<BaseName> | Path;
90
+ sources: Array<Source>;
91
+ imports?: Array<Import>;
92
+ exports?: Array<Export>;
93
+ /**
94
+ * Use extra meta, this is getting used to generate the barrel/index files.
95
+ */
96
+ meta?: TMeta;
97
+ banner?: string;
98
+ footer?: string;
99
+ };
100
+ type ResolvedImport = Import;
101
+ type ResolvedExport = Export;
102
+ type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
103
+ /**
104
+ * @default hash
105
+ */
106
+ id: string;
107
+ /**
108
+ * Contains the first part of the baseName, generated based on baseName
109
+ * @link https://nodejs.org/api/path.html#pathformatpathobject
110
+ */
111
+ name: string;
112
+ extname: Extname;
113
+ imports: Array<ResolvedImport>;
114
+ exports: Array<ResolvedExport>;
115
+ };
116
+ //#endregion
117
+ //#region src/globals.d.ts
118
+ declare module 'react' {
119
+ namespace JSX {
120
+ interface IntrinsicElements {
121
+ 'kubb-text': {
122
+ children?: KubbNode;
123
+ };
124
+ 'kubb-file': {
125
+ id?: string;
126
+ children?: KubbNode;
127
+ baseName: string;
128
+ path: string;
129
+ override?: boolean;
130
+ meta?: File['meta'];
131
+ };
132
+ 'kubb-source': Source & {
133
+ children?: KubbNode;
134
+ };
135
+ 'kubb-import': Import;
136
+ 'kubb-export': Export;
137
+ br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
138
+ }
139
+ }
140
+ }
141
+ declare module '@kubb/react-fabric/jsx-runtime' {
142
+ namespace JSX {
143
+ interface IntrinsicElements {
144
+ 'kubb-text': {
145
+ children?: KubbNode;
146
+ };
147
+ 'kubb-file': {
148
+ id?: string;
149
+ children?: KubbNode;
150
+ baseName: string;
151
+ path: string;
152
+ override?: boolean;
153
+ meta?: File['meta'];
154
+ };
155
+ 'kubb-source': Source & {
156
+ children?: KubbNode;
157
+ };
158
+ 'kubb-import': Import;
159
+ 'kubb-export': Export;
160
+ br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
161
+ }
162
+ }
163
+ }
164
+ //#endregion
165
+ export { Import as a, Source as c, File as i, Export as n, Path as o, Extname as r, ResolvedFile as s, BaseName as t };
166
+ //# sourceMappingURL=globals-CnATk-Sl.d.cts.map
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ require('./globals-8sJ940pg.cjs');
@@ -0,0 +1,2 @@
1
+ import "./globals-CnATk-Sl.cjs";
2
+ import "./types-C3p0Ljxf.cjs";
@@ -0,0 +1,2 @@
1
+ import "./globals-C6rGETh5.js";
2
+ import "./types-DEroxUW0.js";
@@ -0,0 +1,3 @@
1
+ import "./globals-Df5klKjG.js";
2
+
3
+ export { };