@kubb/react-fabric 0.12.0 → 0.12.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.
- package/dist/{chunk-DkQCb-7t.js → chunk-CrnDzoTS.js} +2 -1
- package/dist/globals.d.cts +1 -1
- package/dist/globals.d.ts +2 -2
- package/dist/index.cjs +14 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -14
- package/dist/index.d.ts +17 -15
- package/dist/index.js +17 -17
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +4 -4
- package/dist/jsx-dev-runtime.d.ts +5 -5
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/{jsx-namespace-Lr0pS1AG.d.ts → jsx-namespace-fB1bxOIg.d.ts} +2 -2
- package/dist/{jsx-namespace-BUHfo3FK.d.cts → jsx-namespace-r-JXq_rp.d.cts} +1 -1
- package/dist/{jsx-runtime-CT8FKS42.js → jsx-runtime-CpElaHq6.js} +2 -2
- package/dist/{jsx-runtime-CT8FKS42.js.map → jsx-runtime-CpElaHq6.js.map} +1 -1
- package/dist/jsx-runtime.d.cts +4 -4
- package/dist/jsx-runtime.d.ts +5 -5
- package/dist/jsx-runtime.js +2 -2
- package/dist/parsers.d.cts +1 -16
- package/dist/parsers.d.ts +1 -17
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.cts +3 -125
- package/dist/plugins.d.ts +4 -126
- package/dist/plugins.js +3 -3
- package/dist/{react-CDrFaZVO.js → react-Cfp4vMID.js} +1 -1
- package/dist/{react-CDrFaZVO.js.map → react-Cfp4vMID.js.map} +1 -1
- package/dist/{reactPlugin-CicgALtR.cjs → reactPlugin-BzHuVlbO.cjs} +1757 -1757
- package/dist/reactPlugin-BzHuVlbO.cjs.map +1 -0
- package/dist/{types-yKh-a1UP.d.cts → reactPlugin-CGrRYrTb.d.ts} +36 -198
- package/dist/{reactPlugin-BHxx8AjV.js → reactPlugin-CwuxUcyY.js} +1760 -1760
- package/dist/reactPlugin-CwuxUcyY.js.map +1 -0
- package/dist/{types-C-nm6Bqx.d.ts → reactPlugin-UKgy54VD.d.cts} +34 -198
- package/dist/types-J_S-h-Ae.d.cts +104 -0
- package/dist/types-XiObCuPy.d.ts +103 -0
- package/dist/types.d.cts +3 -2
- package/dist/types.d.ts +3 -2
- package/package.json +3 -2
- package/dist/reactPlugin-BHxx8AjV.js.map +0 -1
- package/dist/reactPlugin-CWHmkuUz.d.cts +0 -72
- package/dist/reactPlugin-CicgALtR.cjs.map +0 -1
- package/dist/reactPlugin-DseDoGSU.d.ts +0 -73
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { b as __name, h as types_d_exports, o as KubbElement } from "./types-J_S-h-Ae.cjs";
|
|
2
|
+
import { TreeNode } from "@kubb/fabric-core";
|
|
3
3
|
|
|
4
4
|
//#region ../fabric-core/src/KubbFile.d.ts
|
|
5
|
-
declare namespace KubbFile_d_exports {
|
|
6
|
-
export { BaseName, Export, Extname, File, Import, Mode, Path, ResolvedFile, Source };
|
|
7
|
-
}
|
|
8
5
|
type Import = {
|
|
9
6
|
/**
|
|
10
7
|
* Import name to be used
|
|
@@ -67,7 +64,6 @@ type Export = {
|
|
|
67
64
|
asAlias?: boolean;
|
|
68
65
|
};
|
|
69
66
|
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
|
|
70
|
-
type Mode = 'single' | 'split';
|
|
71
67
|
/**
|
|
72
68
|
* Name to be used to dynamicly create the baseName(based on input.path)
|
|
73
69
|
* Based on UNIX basename
|
|
@@ -131,7 +127,6 @@ type Parser<TOptions = unknown, TMeta extends object = any> = {
|
|
|
131
127
|
*/
|
|
132
128
|
parse(file: ResolvedFile<TMeta>, options: PrintOptions): Promise<string>;
|
|
133
129
|
};
|
|
134
|
-
type UserParser<TOptions = unknown, TMeta extends object = any> = Omit<Parser<TOptions, TMeta>, 'type'>;
|
|
135
130
|
//#endregion
|
|
136
131
|
//#region ../fabric-core/src/utils/AsyncEventEmitter.d.ts
|
|
137
132
|
type Options$3 = {
|
|
@@ -190,7 +185,7 @@ declare class FileProcessor {
|
|
|
190
185
|
type Options$1 = {
|
|
191
186
|
events?: AsyncEventEmitter<FabricEvents>;
|
|
192
187
|
};
|
|
193
|
-
declare class FileManager {
|
|
188
|
+
declare class FileManager$1 {
|
|
194
189
|
#private;
|
|
195
190
|
events: AsyncEventEmitter<FabricEvents>;
|
|
196
191
|
processor: FileProcessor;
|
|
@@ -207,48 +202,12 @@ declare class FileManager {
|
|
|
207
202
|
write(options: ProcessFilesProps): Promise<ResolvedFile[]>;
|
|
208
203
|
}
|
|
209
204
|
//#endregion
|
|
210
|
-
//#region ../fabric-core/src/contexts/RenderContext.d.ts
|
|
211
|
-
type RenderContextProps = {
|
|
212
|
-
indentLevel: number;
|
|
213
|
-
indentSize: number;
|
|
214
|
-
currentLineLength: number;
|
|
215
|
-
shouldBreak: boolean;
|
|
216
|
-
};
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region ../fabric-core/src/intrinsic.d.ts
|
|
219
|
-
type IntrinsicType = 'br' | 'indent' | 'dedent';
|
|
220
|
-
type Intrinsic = {
|
|
221
|
-
type: IntrinsicType;
|
|
222
|
-
__intrinsic: true;
|
|
223
|
-
};
|
|
224
|
-
//#endregion
|
|
225
|
-
//#region ../fabric-core/src/plugins/types.d.ts
|
|
226
|
-
type Plugin<TOptions = unknown, TAppExtension extends Record<string, any> = {}> = {
|
|
227
|
-
name: string;
|
|
228
|
-
type: 'plugin';
|
|
229
|
-
install: Install<TOptions>;
|
|
230
|
-
/**
|
|
231
|
-
* Runtime app overrides or extensions.
|
|
232
|
-
* Merged into the app instance after install.
|
|
233
|
-
* This cannot be async
|
|
234
|
-
*/
|
|
235
|
-
inject?: Inject<TOptions, TAppExtension>;
|
|
236
|
-
};
|
|
237
|
-
type UserPlugin<TOptions = unknown, TAppExtension extends Record<string, any> = {}> = Omit<Plugin<TOptions, TAppExtension>, 'type'>;
|
|
238
|
-
//#endregion
|
|
239
205
|
//#region ../fabric-core/src/Fabric.d.ts
|
|
240
206
|
declare global {
|
|
241
207
|
namespace Kubb {
|
|
242
208
|
interface Fabric {}
|
|
243
209
|
}
|
|
244
210
|
}
|
|
245
|
-
type FabricElement<TProps extends object = object> = {
|
|
246
|
-
(): FabricNode;
|
|
247
|
-
type: string;
|
|
248
|
-
component: (props: TProps) => FabricNode;
|
|
249
|
-
props: TProps;
|
|
250
|
-
};
|
|
251
|
-
type FabricNode = FabricElement<any> | string | number | boolean | null | undefined | Intrinsic | Array<FabricNode>;
|
|
252
211
|
/**
|
|
253
212
|
* Defines core runtime options for Fabric.
|
|
254
213
|
*/
|
|
@@ -378,7 +337,7 @@ interface FabricContext<T extends FabricOptions = FabricOptions> extends AsyncEv
|
|
|
378
337
|
/** The active Fabric configuration. */
|
|
379
338
|
config: FabricConfig<T>;
|
|
380
339
|
/** The internal file manager handling file creation, merging, and writing. */
|
|
381
|
-
fileManager: FileManager;
|
|
340
|
+
fileManager: FileManager$1;
|
|
382
341
|
/** List of files currently in memory. */
|
|
383
342
|
files: ResolvedFile[];
|
|
384
343
|
/** Add new files to the file manager. */
|
|
@@ -431,167 +390,44 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
|
|
|
431
390
|
upsertFile(...files: File[]): Promise<void>;
|
|
432
391
|
}
|
|
433
392
|
//#endregion
|
|
434
|
-
//#region ../fabric-core/src/
|
|
435
|
-
type
|
|
436
|
-
file?: File;
|
|
437
|
-
path: string;
|
|
393
|
+
//#region ../fabric-core/src/plugins/types.d.ts
|
|
394
|
+
type Plugin<TOptions = unknown, TAppExtension extends Record<string, any> = {}> = {
|
|
438
395
|
name: string;
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
nodes: Array<{
|
|
442
|
-
id: string;
|
|
443
|
-
label: string;
|
|
444
|
-
}>;
|
|
445
|
-
edges: Array<{
|
|
446
|
-
from: string;
|
|
447
|
-
to: string;
|
|
448
|
-
}>;
|
|
449
|
-
};
|
|
450
|
-
declare class TreeNode<TData = unknown> {
|
|
451
|
-
#private;
|
|
452
|
-
data: TData;
|
|
453
|
-
parent?: TreeNode<TData>;
|
|
454
|
-
children: Array<TreeNode<TData>>;
|
|
455
|
-
constructor(data: TData, parent?: TreeNode<TData>);
|
|
456
|
-
addChild(data: TData): TreeNode<TData>;
|
|
457
|
-
getChildByName(name: string): TreeNode<TData> | undefined;
|
|
458
|
-
get leaves(): Array<TreeNode<TData>>;
|
|
459
|
-
forEach(callback: (node: TreeNode<TData>) => void): this;
|
|
460
|
-
findDeep(predicate: (node: TreeNode<TData>) => boolean): TreeNode<TData> | undefined;
|
|
461
|
-
static toGraph(root: TreeNode<BarrelData>): Graph;
|
|
462
|
-
static fromFiles(files: Array<File>, rootFolder?: string): TreeNode<BarrelData> | null;
|
|
463
|
-
}
|
|
464
|
-
//#endregion
|
|
465
|
-
//#region ../fabric-core/src/composables/useNodeTree.d.ts
|
|
466
|
-
type ComponentNode = {
|
|
467
|
-
type: string;
|
|
468
|
-
props: Record<string, unknown>;
|
|
469
|
-
};
|
|
470
|
-
//#endregion
|
|
471
|
-
//#region ../fabric-core/src/context.d.ts
|
|
472
|
-
/**
|
|
473
|
-
* Context type that carries type information about its value
|
|
474
|
-
* This is a branded symbol type that enables type-safe context usage
|
|
475
|
-
*/
|
|
476
|
-
type Context<T> = symbol & {
|
|
477
|
-
readonly __type: T;
|
|
478
|
-
};
|
|
479
|
-
//#endregion
|
|
480
|
-
//#region ../fabric-core/src/contexts/RootContext.d.ts
|
|
481
|
-
type RootContextProps = {
|
|
482
|
-
/**
|
|
483
|
-
* Exit (unmount) the whole app.
|
|
484
|
-
*/
|
|
485
|
-
exit: (error?: Error) => void;
|
|
486
|
-
/**
|
|
487
|
-
* TreeNode representing the tree structure of the app.
|
|
488
|
-
*/
|
|
489
|
-
treeNode: TreeNode<ComponentNode>;
|
|
396
|
+
type: 'plugin';
|
|
397
|
+
install: Install<TOptions>;
|
|
490
398
|
/**
|
|
491
|
-
*
|
|
399
|
+
* Runtime app overrides or extensions.
|
|
400
|
+
* Merged into the app instance after install.
|
|
401
|
+
* This cannot be async
|
|
492
402
|
*/
|
|
493
|
-
|
|
494
|
-
};
|
|
495
|
-
//#endregion
|
|
496
|
-
//#region ../fabric-core/src/types.d.ts
|
|
497
|
-
type JSDoc = {
|
|
498
|
-
comments: string[];
|
|
403
|
+
inject?: Inject<TOptions, TAppExtension>;
|
|
499
404
|
};
|
|
500
405
|
//#endregion
|
|
501
|
-
//#region src/
|
|
502
|
-
type
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
* @default `'inline'`
|
|
508
|
-
* @private
|
|
509
|
-
*/
|
|
510
|
-
mode?: 'object' | 'inline' | 'inlineSpread';
|
|
511
|
-
type?: 'string' | 'number' | (string & {});
|
|
512
|
-
optional?: boolean;
|
|
513
|
-
/**
|
|
514
|
-
* @example test = "default"
|
|
515
|
-
*/
|
|
516
|
-
default?: string;
|
|
406
|
+
//#region src/plugins/reactPlugin.d.ts
|
|
407
|
+
type Options = {
|
|
408
|
+
stdout?: NodeJS.WriteStream;
|
|
409
|
+
stdin?: NodeJS.ReadStream;
|
|
410
|
+
stderr?: NodeJS.WriteStream;
|
|
411
|
+
treeNode?: TreeNode<types_d_exports.ComponentNode>;
|
|
517
412
|
/**
|
|
518
|
-
*
|
|
519
|
-
* @example test: "default"
|
|
413
|
+
* Set this to true to always see the result of the render in the console(line per render)
|
|
520
414
|
*/
|
|
521
|
-
|
|
522
|
-
children?: Params;
|
|
415
|
+
debug?: boolean;
|
|
523
416
|
};
|
|
524
|
-
type
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
transformType?: (type: string) => string;
|
|
417
|
+
type ExtendOptions = {
|
|
418
|
+
render(App: KubbElement): Promise<void>;
|
|
419
|
+
renderToString(App: KubbElement): Promise<string>;
|
|
420
|
+
waitUntilExit(): Promise<void>;
|
|
529
421
|
};
|
|
530
|
-
declare
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
transformName,
|
|
539
|
-
transformType
|
|
540
|
-
}?: Pick<Options, 'transformName' | 'transformType'>): string;
|
|
541
|
-
toObject(): string;
|
|
542
|
-
toObjectValue(): string;
|
|
543
|
-
toConstructor(): string;
|
|
422
|
+
declare global {
|
|
423
|
+
namespace Kubb {
|
|
424
|
+
interface Fabric {
|
|
425
|
+
render(App: KubbElement): Promise<void>;
|
|
426
|
+
renderToString(App: KubbElement): Promise<string>;
|
|
427
|
+
waitUntilExit(): Promise<void>;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
544
430
|
}
|
|
431
|
+
declare const reactPlugin: Plugin<Options, ExtendOptions>;
|
|
545
432
|
//#endregion
|
|
546
|
-
|
|
547
|
-
type ReactElementNames = 'br' | 'div' | 'indent' | 'dedent';
|
|
548
|
-
type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app';
|
|
549
|
-
type Node = {
|
|
550
|
-
parentNode: DOMElement | undefined;
|
|
551
|
-
internal_static?: boolean;
|
|
552
|
-
};
|
|
553
|
-
type DOMNodeAttribute = boolean | string | number;
|
|
554
|
-
type TextName = '#text';
|
|
555
|
-
type TextNode = {
|
|
556
|
-
nodeName: TextName;
|
|
557
|
-
nodeValue: string;
|
|
558
|
-
} & Node;
|
|
559
|
-
type DOMNode<T = {
|
|
560
|
-
nodeName: NodeNames;
|
|
561
|
-
}> = T extends {
|
|
562
|
-
nodeName: infer U;
|
|
563
|
-
} ? U extends '#text' ? TextNode : DOMElement : never;
|
|
564
|
-
type OutputTransformer = (s: string, index: number) => string;
|
|
565
|
-
type DOMElement = {
|
|
566
|
-
nodeName: ElementNames;
|
|
567
|
-
attributes: Map<string, DOMNodeAttribute>;
|
|
568
|
-
childNodes: DOMNode[];
|
|
569
|
-
internal_transform?: OutputTransformer;
|
|
570
|
-
isStaticDirty?: boolean;
|
|
571
|
-
staticNode?: DOMElement;
|
|
572
|
-
onComputeLayout?: () => void;
|
|
573
|
-
onRender?: () => void;
|
|
574
|
-
onImmediateRender?: () => void;
|
|
575
|
-
} & Node;
|
|
576
|
-
type NodeNames = ElementNames | TextName;
|
|
577
|
-
type KubbNode = ReactNode;
|
|
578
|
-
type KubbElement = JSX.Element;
|
|
579
|
-
type KubbTextProps = {
|
|
580
|
-
children?: KubbNode;
|
|
581
|
-
};
|
|
582
|
-
type KubbFileProps = {
|
|
583
|
-
id?: string;
|
|
584
|
-
children?: KubbNode;
|
|
585
|
-
baseName: string;
|
|
586
|
-
path: string;
|
|
587
|
-
override?: boolean;
|
|
588
|
-
meta?: File['meta'];
|
|
589
|
-
};
|
|
590
|
-
type KubbSourceProps = Source & {
|
|
591
|
-
children?: KubbNode;
|
|
592
|
-
};
|
|
593
|
-
type KubbImportProps = Import;
|
|
594
|
-
type KubbExportProps = Export;
|
|
595
|
-
type LineBreakProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
|
|
596
|
-
//#endregion
|
|
597
|
-
export { Plugin as A, File as B, TreeNode as C, FabricElement as D, FabricContext as E, Parser as F, Source as G, KubbFile_d_exports as H, UserParser as I, BaseName as L, RenderContextProps as M, FileManager as N, FabricMode as O, FileProcessor as P, Export as R, ComponentNode as S, FabricConfig as T, Path as U, Import as V, ResolvedFile as W, Params as _, Key as a, RootContextProps as b, KubbFileProps as c, KubbSourceProps as d, KubbTextProps as f, Param as g, FunctionParams as h, ElementNames as i, UserPlugin as j, FabricOptions as k, KubbImportProps as l, TextNode as m, DOMNode as n, KubbElement as o, LineBreakProps as p, DOMNodeAttribute as r, KubbExportProps as s, DOMElement as t, KubbNode as u, createFunctionParams as v, Fabric as w, Context as x, JSDoc as y, Extname as z };
|
|
433
|
+
export { reactPlugin as n, Options as t };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React, { JSX, Key, ReactNode } from "react";
|
|
2
|
+
import { KubbFile } from "@kubb/fabric-core/types";
|
|
3
|
+
|
|
4
|
+
//#region rolldown:runtime
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/utils/getFunctionParams.d.ts
|
|
7
|
+
type Param = {
|
|
8
|
+
/**
|
|
9
|
+
* `object` will return the pathParams as an object.
|
|
10
|
+
*
|
|
11
|
+
* `inline` will return the pathParams as comma separated params.
|
|
12
|
+
* @default `'inline'`
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
mode?: 'object' | 'inline' | 'inlineSpread';
|
|
16
|
+
type?: 'string' | 'number' | (string & {});
|
|
17
|
+
optional?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @example test = "default"
|
|
20
|
+
*/
|
|
21
|
+
default?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Used for no TypeScript(with mode object)
|
|
24
|
+
* @example test: "default"
|
|
25
|
+
*/
|
|
26
|
+
value?: string;
|
|
27
|
+
children?: Params;
|
|
28
|
+
};
|
|
29
|
+
type Params = Record<string, Param | undefined>;
|
|
30
|
+
type Options = {
|
|
31
|
+
type: 'constructor' | 'call' | 'object' | 'objectValue';
|
|
32
|
+
transformName?: (name: string) => string;
|
|
33
|
+
transformType?: (type: string) => string;
|
|
34
|
+
};
|
|
35
|
+
declare function createFunctionParams(params: Params): Params;
|
|
36
|
+
declare class FunctionParams {
|
|
37
|
+
#private;
|
|
38
|
+
static factory(params: Params): FunctionParams;
|
|
39
|
+
constructor(params: Params);
|
|
40
|
+
get params(): Params;
|
|
41
|
+
get flatParams(): Params;
|
|
42
|
+
toCall({
|
|
43
|
+
transformName,
|
|
44
|
+
transformType
|
|
45
|
+
}?: Pick<Options, 'transformName' | 'transformType'>): string;
|
|
46
|
+
toObject(): string;
|
|
47
|
+
toObjectValue(): string;
|
|
48
|
+
toConstructor(): string;
|
|
49
|
+
}
|
|
50
|
+
declare namespace types_d_exports {
|
|
51
|
+
export { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, Key, KubbElement, KubbExportProps, KubbFileProps, KubbImportProps, KubbNode, KubbSourceProps, KubbTextProps, LineBreakProps, Param, Params, TextNode };
|
|
52
|
+
}
|
|
53
|
+
import * as import__kubb_fabric_core_types from "@kubb/fabric-core/types";
|
|
54
|
+
type ReactElementNames = 'br' | 'div' | 'indent' | 'dedent';
|
|
55
|
+
type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app';
|
|
56
|
+
type Node = {
|
|
57
|
+
parentNode: DOMElement | undefined;
|
|
58
|
+
internal_static?: boolean;
|
|
59
|
+
};
|
|
60
|
+
type DOMNodeAttribute = boolean | string | number;
|
|
61
|
+
type TextName = '#text';
|
|
62
|
+
type TextNode = {
|
|
63
|
+
nodeName: TextName;
|
|
64
|
+
nodeValue: string;
|
|
65
|
+
} & Node;
|
|
66
|
+
type DOMNode<T = {
|
|
67
|
+
nodeName: NodeNames;
|
|
68
|
+
}> = T extends {
|
|
69
|
+
nodeName: infer U;
|
|
70
|
+
} ? U extends '#text' ? TextNode : DOMElement : never;
|
|
71
|
+
type OutputTransformer = (s: string, index: number) => string;
|
|
72
|
+
type DOMElement = {
|
|
73
|
+
nodeName: ElementNames;
|
|
74
|
+
attributes: Map<string, DOMNodeAttribute>;
|
|
75
|
+
childNodes: DOMNode[];
|
|
76
|
+
internal_transform?: OutputTransformer;
|
|
77
|
+
isStaticDirty?: boolean;
|
|
78
|
+
staticNode?: DOMElement;
|
|
79
|
+
onComputeLayout?: () => void;
|
|
80
|
+
onRender?: () => void;
|
|
81
|
+
onImmediateRender?: () => void;
|
|
82
|
+
} & Node;
|
|
83
|
+
type NodeNames = ElementNames | TextName;
|
|
84
|
+
type KubbNode = ReactNode;
|
|
85
|
+
type KubbElement = JSX.Element;
|
|
86
|
+
type KubbTextProps = {
|
|
87
|
+
children?: KubbNode;
|
|
88
|
+
};
|
|
89
|
+
type KubbFileProps = {
|
|
90
|
+
id?: string;
|
|
91
|
+
children?: KubbNode;
|
|
92
|
+
baseName: string;
|
|
93
|
+
path: string;
|
|
94
|
+
override?: boolean;
|
|
95
|
+
meta?: KubbFile.File['meta'];
|
|
96
|
+
};
|
|
97
|
+
type KubbSourceProps = KubbFile.Source & {
|
|
98
|
+
children?: KubbNode;
|
|
99
|
+
};
|
|
100
|
+
type KubbImportProps = KubbFile.Import;
|
|
101
|
+
type KubbExportProps = KubbFile.Export;
|
|
102
|
+
type LineBreakProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
|
|
103
|
+
//#endregion
|
|
104
|
+
export { Param as _, Key as a, __name as b, KubbFileProps as c, KubbSourceProps as d, KubbTextProps as f, FunctionParams as g, types_d_exports as h, ElementNames as i, KubbImportProps as l, TextNode as m, DOMNode as n, KubbElement as o, LineBreakProps as p, DOMNodeAttribute as r, KubbExportProps as s, DOMElement as t, KubbNode as u, Params as v, createFunctionParams as y };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { i as __reExport, n as __exportAll, r as __name } from "./chunk-CrnDzoTS.js";
|
|
2
|
+
import { KubbFile } from "@kubb/fabric-core/types";
|
|
3
|
+
import React, { JSX, Key, 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, Key, KubbElement, KubbExportProps, KubbFileProps, KubbImportProps, KubbNode, KubbSourceProps, KubbTextProps, LineBreakProps, Param, Params, TextNode };
|
|
51
|
+
}
|
|
52
|
+
import * as import__kubb_fabric_core_types from "@kubb/fabric-core/types";
|
|
53
|
+
type ReactElementNames = 'br' | 'div' | 'indent' | 'dedent';
|
|
54
|
+
type ElementNames = ReactElementNames | '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 KubbNode = ReactNode;
|
|
84
|
+
type KubbElement = JSX.Element;
|
|
85
|
+
type KubbTextProps = {
|
|
86
|
+
children?: KubbNode;
|
|
87
|
+
};
|
|
88
|
+
type KubbFileProps = {
|
|
89
|
+
id?: string;
|
|
90
|
+
children?: KubbNode;
|
|
91
|
+
baseName: string;
|
|
92
|
+
path: string;
|
|
93
|
+
override?: boolean;
|
|
94
|
+
meta?: KubbFile.File['meta'];
|
|
95
|
+
};
|
|
96
|
+
type KubbSourceProps = KubbFile.Source & {
|
|
97
|
+
children?: KubbNode;
|
|
98
|
+
};
|
|
99
|
+
type KubbImportProps = KubbFile.Import;
|
|
100
|
+
type KubbExportProps = KubbFile.Export;
|
|
101
|
+
type LineBreakProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { Param as _, Key as a, KubbFileProps as c, KubbSourceProps as d, KubbTextProps as f, FunctionParams as g, types_d_exports as h, ElementNames as i, KubbImportProps as l, TextNode as m, DOMNode as n, KubbElement as o, LineBreakProps as p, DOMNodeAttribute as r, KubbExportProps as s, DOMElement as t, KubbNode as u, Params as v, createFunctionParams as y };
|
package/dist/types.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { _ as Param, a as Key, c as KubbFileProps, d as KubbSourceProps, f as KubbTextProps, i as ElementNames, l as KubbImportProps, m as TextNode, n as DOMNode, o as KubbElement, p as LineBreakProps, r as DOMNodeAttribute, s as KubbExportProps, t as DOMElement, u as KubbNode, v as Params } from "./types-J_S-h-Ae.cjs";
|
|
2
|
+
export * from "@kubb/fabric-core/types";
|
|
3
|
+
export { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, Key, KubbElement, KubbExportProps, KubbFileProps, KubbImportProps, KubbNode, KubbSourceProps, KubbTextProps, LineBreakProps, Param, Params, TextNode };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { _ as Param, a as Key, c as KubbFileProps, d as KubbSourceProps, f as KubbTextProps, i as ElementNames, l as KubbImportProps, m as TextNode, n as DOMNode, o as KubbElement, p as LineBreakProps, r as DOMNodeAttribute, s as KubbExportProps, t as DOMElement, u as KubbNode, v as Params } from "./types-XiObCuPy.js";
|
|
2
|
+
export * from "@kubb/fabric-core/types";
|
|
3
|
+
export { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, Key, KubbElement, KubbExportProps, KubbFileProps, KubbImportProps, KubbNode, KubbSourceProps, KubbTextProps, LineBreakProps, Param, Params, TextNode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/react-fabric",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "React integration for Kubb, providing JSX runtime support and React component generation capabilities for code generation plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -100,9 +100,10 @@
|
|
|
100
100
|
"execa": "^9.6.1",
|
|
101
101
|
"natural-orderby": "^5.0.0",
|
|
102
102
|
"react-devtools-core": "6.1.5",
|
|
103
|
+
"remeda": "^2.33.4",
|
|
103
104
|
"signal-exit": "^4.1.0",
|
|
104
105
|
"ws": "8.18.0",
|
|
105
|
-
"@kubb/fabric-core": "0.12.
|
|
106
|
+
"@kubb/fabric-core": "0.12.1"
|
|
106
107
|
},
|
|
107
108
|
"devDependencies": {
|
|
108
109
|
"@types/react": "^19.2.8",
|