rspress-plugin-file-tree 0.4.0 → 1.0.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 (59) hide show
  1. package/dist/0~142.js +2 -0
  2. package/dist/0~164.js +2 -0
  3. package/dist/0~2.js +2 -0
  4. package/dist/0~225.js +2 -0
  5. package/dist/0~288.js +2 -0
  6. package/dist/0~299.js +2 -0
  7. package/dist/0~3.js +2 -0
  8. package/dist/0~311.js +2 -0
  9. package/dist/0~326.js +2 -0
  10. package/dist/0~40.js +2 -0
  11. package/dist/0~43.js +2 -0
  12. package/dist/0~433.js +2 -0
  13. package/dist/0~453.js +2 -0
  14. package/dist/0~457.js +2 -0
  15. package/dist/0~497.js +2 -0
  16. package/dist/0~511.js +2 -0
  17. package/dist/0~603.js +2 -0
  18. package/dist/0~616.js +2 -0
  19. package/dist/0~659.js +2 -0
  20. package/dist/0~670.js +2 -0
  21. package/dist/0~687.js +2 -0
  22. package/dist/0~706.js +2 -0
  23. package/dist/0~729.js +2 -0
  24. package/dist/0~768.js +2 -0
  25. package/dist/0~819.js +2 -0
  26. package/dist/0~830.js +2 -0
  27. package/dist/0~854.js +2 -0
  28. package/dist/0~863.js +2 -0
  29. package/dist/0~879.js +2 -0
  30. package/dist/0~96.js +2 -0
  31. package/dist/0~97.js +2 -0
  32. package/dist/components/FileTree/FileTree.css +83 -0
  33. package/dist/components/FileTree/FileTree.d.ts +7 -0
  34. package/dist/components/FileTree/FileTree.js +516 -0
  35. package/dist/components/FileTree/FileTreeItem.d.ts +8 -0
  36. package/dist/components/FileTree/RemoteSvgIcon.d.ts +11 -0
  37. package/dist/components/FileTree/index.d.ts +4 -0
  38. package/dist/components/folder-icons.d.ts +32 -0
  39. package/dist/components/languages.d.ts +7 -0
  40. package/dist/components/tree-parser/tree-parser.d.ts +12 -0
  41. package/dist/components/tree-parser/types.d.ts +10 -0
  42. package/dist/index.d.ts +1 -1
  43. package/dist/index.js +85 -17
  44. package/package.json +11 -8
  45. package/components/Tree/Expand.tsx +0 -149
  46. package/components/Tree/FileIcon.tsx +0 -41
  47. package/components/Tree/FileTreeRender.tsx +0 -16
  48. package/components/Tree/Tree.tsx +0 -112
  49. package/components/Tree/TreeContext.tsx +0 -18
  50. package/components/Tree/TreeFile.tsx +0 -69
  51. package/components/Tree/TreeFolder.tsx +0 -108
  52. package/components/Tree/TreeFolderIcon.tsx +0 -40
  53. package/components/Tree/TreeIndents.tsx +0 -26
  54. package/components/Tree/TreeStatusIcon.tsx +0 -45
  55. package/components/Tree/index.less +0 -178
  56. package/components/helpers.ts +0 -42
  57. package/components/presets.ts +0 -5
  58. package/dist/parser.d.ts +0 -8
  59. package/dist/parser.js +0 -40
@@ -0,0 +1,516 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from "react";
3
+ var __webpack_modules__ = {};
4
+ var __webpack_module_cache__ = {};
5
+ function __webpack_require__(moduleId) {
6
+ var cachedModule = __webpack_module_cache__[moduleId];
7
+ if (void 0 !== cachedModule) return cachedModule.exports;
8
+ var module = __webpack_module_cache__[moduleId] = {
9
+ exports: {}
10
+ };
11
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
12
+ return module.exports;
13
+ }
14
+ __webpack_require__.m = __webpack_modules__;
15
+ (()=>{
16
+ __webpack_require__.add = function(modules) {
17
+ Object.assign(__webpack_require__.m, modules);
18
+ };
19
+ })();
20
+ const FileTree_module = {
21
+ container: "container-ZPDb1C"
22
+ };
23
+ const SUPPORTED_LANGUAGES = [
24
+ {
25
+ id: "javascript",
26
+ icons: [
27
+ {
28
+ name: "javascript",
29
+ content: ()=>import("../../0~311.js").then((mod)=>({
30
+ default: mod.javascriptraw_namespaceObject
31
+ })),
32
+ matcher: /^.*\.js$/
33
+ },
34
+ {
35
+ name: "javascript-beta",
36
+ content: ()=>import("../../0~311.js").then((mod)=>({
37
+ default: mod.javascriptraw_namespaceObject
38
+ })),
39
+ matcher: /^.*\.cjs$/
40
+ },
41
+ {
42
+ name: "javascript-beta",
43
+ content: ()=>import("../../0~311.js").then((mod)=>({
44
+ default: mod.javascriptraw_namespaceObject
45
+ })),
46
+ matcher: /^.*\.mjs$/
47
+ }
48
+ ]
49
+ },
50
+ {
51
+ id: "typescript",
52
+ icons: [
53
+ {
54
+ name: "typescript",
55
+ content: ()=>import("../../0~687.js").then((mod)=>({
56
+ default: mod.typescriptraw_namespaceObject
57
+ })),
58
+ matcher: /^.*\.ts$/
59
+ },
60
+ {
61
+ name: "typescript-beta",
62
+ content: ()=>import("../../0~687.js").then((mod)=>({
63
+ default: mod.typescriptraw_namespaceObject
64
+ })),
65
+ matcher: /^.*\.mts$/
66
+ },
67
+ {
68
+ name: "typescript-beta",
69
+ content: ()=>import("../../0~687.js").then((mod)=>({
70
+ default: mod.typescriptraw_namespaceObject
71
+ })),
72
+ matcher: /^.*\.cts$/
73
+ },
74
+ {
75
+ name: 'react_ts',
76
+ content: ()=>import("../../0~453.js").then((mod)=>({
77
+ default: mod.react_tsraw_namespaceObject
78
+ })),
79
+ matcher: /^.*\.tsx$/
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ id: 'react',
85
+ icons: [
86
+ {
87
+ name: 'react',
88
+ content: ()=>import("../../0~3.js").then((mod)=>({
89
+ default: mod.reactraw_namespaceObject
90
+ })),
91
+ matcher: /^.*\.jsx$/
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ id: 'css',
97
+ icons: [
98
+ {
99
+ name: 'css',
100
+ content: ()=>import("../../0~659.js").then((mod)=>({
101
+ default: mod.cssraw_namespaceObject
102
+ })),
103
+ matcher: /^.*\.css$/
104
+ },
105
+ {
106
+ name: 'less',
107
+ content: ()=>import("../../0~225.js").then((mod)=>({
108
+ default: mod.lessraw_namespaceObject
109
+ })),
110
+ matcher: /^.*\.less$/
111
+ },
112
+ {
113
+ name: 'sass',
114
+ content: ()=>import("../../0~670.js").then((mod)=>({
115
+ default: mod.sassraw_namespaceObject
116
+ })),
117
+ matcher: /^.*\.scss$/
118
+ }
119
+ ]
120
+ },
121
+ {
122
+ id: 'json',
123
+ icons: [
124
+ {
125
+ name: 'json',
126
+ content: ()=>import("../../0~706.js").then((mod)=>({
127
+ default: mod.jsonraw_namespaceObject
128
+ })),
129
+ matcher: /^.*\.json$/
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ id: 'markdown',
135
+ icons: [
136
+ {
137
+ name: 'markdown',
138
+ content: ()=>import("../../0~497.js").then((mod)=>({
139
+ default: mod.markdownraw_namespaceObject
140
+ })),
141
+ matcher: /^.*\.(md|mdx)$/
142
+ }
143
+ ]
144
+ }
145
+ ];
146
+ const FOLDER_ICONS = {
147
+ src: {
148
+ name: 'folder-src',
149
+ content: ()=>import("../../0~603.js").then((mod)=>({
150
+ default: mod.folder_srcraw_namespaceObject
151
+ }))
152
+ },
153
+ source: {
154
+ name: 'folder-src',
155
+ content: ()=>import("../../0~603.js").then((mod)=>({
156
+ default: mod.folder_srcraw_namespaceObject
157
+ }))
158
+ },
159
+ components: {
160
+ name: 'folder-components',
161
+ content: ()=>import("../../0~299.js").then((mod)=>({
162
+ default: mod.folder_componentsraw_namespaceObject
163
+ }))
164
+ },
165
+ component: {
166
+ name: 'folder-components',
167
+ content: ()=>import("../../0~299.js").then((mod)=>({
168
+ default: mod.folder_componentsraw_namespaceObject
169
+ }))
170
+ },
171
+ hooks: {
172
+ name: 'folder-hook',
173
+ content: ()=>import("../../0~40.js").then((mod)=>({
174
+ default: mod.folder_hookraw_namespaceObject
175
+ }))
176
+ },
177
+ hook: {
178
+ name: 'folder-hook',
179
+ content: ()=>import("../../0~40.js").then((mod)=>({
180
+ default: mod.folder_hookraw_namespaceObject
181
+ }))
182
+ },
183
+ utils: {
184
+ name: 'folder-utils',
185
+ content: ()=>import("../../0~288.js").then((mod)=>({
186
+ default: mod.folder_utilsraw_namespaceObject
187
+ }))
188
+ },
189
+ util: {
190
+ name: 'folder-utils',
191
+ content: ()=>import("../../0~288.js").then((mod)=>({
192
+ default: mod.folder_utilsraw_namespaceObject
193
+ }))
194
+ },
195
+ lib: {
196
+ name: 'folder-lib',
197
+ content: ()=>import("../../0~2.js").then((mod)=>({
198
+ default: mod.folder_libraw_namespaceObject
199
+ }))
200
+ },
201
+ libs: {
202
+ name: 'folder-lib',
203
+ content: ()=>import("../../0~2.js").then((mod)=>({
204
+ default: mod.folder_libraw_namespaceObject
205
+ }))
206
+ },
207
+ core: {
208
+ name: 'folder-core',
209
+ content: ()=>import("../../0~164.js").then((mod)=>({
210
+ default: mod.folder_coreraw_namespaceObject
211
+ }))
212
+ },
213
+ runtime: {
214
+ name: 'folder-core',
215
+ content: ()=>import("../../0~164.js").then((mod)=>({
216
+ default: mod.folder_coreraw_namespaceObject
217
+ }))
218
+ },
219
+ locales: {
220
+ name: 'folder-i18n',
221
+ content: ()=>import("../../0~511.js").then((mod)=>({
222
+ default: mod.folder_i18nraw_namespaceObject
223
+ }))
224
+ },
225
+ locale: {
226
+ name: 'folder-i18n',
227
+ content: ()=>import("../../0~511.js").then((mod)=>({
228
+ default: mod.folder_i18nraw_namespaceObject
229
+ }))
230
+ },
231
+ i18n: {
232
+ name: 'folder-i18n',
233
+ content: ()=>import("../../0~511.js").then((mod)=>({
234
+ default: mod.folder_i18nraw_namespaceObject
235
+ }))
236
+ },
237
+ assets: {
238
+ name: 'folder-images',
239
+ content: ()=>import("../../0~433.js").then((mod)=>({
240
+ default: mod.folder_imagesraw_namespaceObject
241
+ }))
242
+ },
243
+ images: {
244
+ name: 'folder-images',
245
+ content: ()=>import("../../0~433.js").then((mod)=>({
246
+ default: mod.folder_imagesraw_namespaceObject
247
+ }))
248
+ },
249
+ styles: {
250
+ name: 'folder-css',
251
+ content: ()=>import("../../0~854.js").then((mod)=>({
252
+ default: mod.folder_cssraw_namespaceObject
253
+ }))
254
+ },
255
+ css: {
256
+ name: 'folder-css',
257
+ content: ()=>import("../../0~854.js").then((mod)=>({
258
+ default: mod.folder_cssraw_namespaceObject
259
+ }))
260
+ },
261
+ test: {
262
+ name: 'folder-test',
263
+ content: ()=>import("../../0~43.js").then((mod)=>({
264
+ default: mod.folder_testraw_namespaceObject
265
+ }))
266
+ },
267
+ tests: {
268
+ name: 'folder-test',
269
+ content: ()=>import("../../0~43.js").then((mod)=>({
270
+ default: mod.folder_testraw_namespaceObject
271
+ }))
272
+ },
273
+ __tests__: {
274
+ name: 'folder-test',
275
+ content: ()=>import("../../0~43.js").then((mod)=>({
276
+ default: mod.folder_testraw_namespaceObject
277
+ }))
278
+ },
279
+ config: {
280
+ name: 'folder-config',
281
+ content: ()=>import("../../0~729.js").then((mod)=>({
282
+ default: mod.folder_configraw_namespaceObject
283
+ }))
284
+ },
285
+ configs: {
286
+ name: 'folder-config',
287
+ content: ()=>import("../../0~729.js").then((mod)=>({
288
+ default: mod.folder_configraw_namespaceObject
289
+ }))
290
+ },
291
+ api: {
292
+ name: 'folder-api',
293
+ content: ()=>import("../../0~97.js").then((mod)=>({
294
+ default: mod.folder_apiraw_namespaceObject
295
+ }))
296
+ },
297
+ apis: {
298
+ name: 'folder-api',
299
+ content: ()=>import("../../0~97.js").then((mod)=>({
300
+ default: mod.folder_apiraw_namespaceObject
301
+ }))
302
+ },
303
+ public: {
304
+ name: 'folder-public',
305
+ content: ()=>import("../../0~830.js").then((mod)=>({
306
+ default: mod.folder_publicraw_namespaceObject
307
+ }))
308
+ },
309
+ dist: {
310
+ name: 'folder-dist',
311
+ content: ()=>import("../../0~879.js").then((mod)=>({
312
+ default: mod.folder_distraw_namespaceObject
313
+ }))
314
+ },
315
+ build: {
316
+ name: 'folder-dist',
317
+ content: ()=>import("../../0~879.js").then((mod)=>({
318
+ default: mod.folder_distraw_namespaceObject
319
+ }))
320
+ },
321
+ node_modules: {
322
+ name: 'folder-node',
323
+ content: ()=>import("../../0~863.js").then((mod)=>({
324
+ default: mod.folder_noderaw_namespaceObject
325
+ }))
326
+ },
327
+ types: {
328
+ name: "folder-typescript",
329
+ content: ()=>import("../../0~616.js").then((mod)=>({
330
+ default: mod.folder_typescriptraw_namespaceObject
331
+ }))
332
+ },
333
+ typings: {
334
+ name: "folder-typescript",
335
+ content: ()=>import("../../0~616.js").then((mod)=>({
336
+ default: mod.folder_typescriptraw_namespaceObject
337
+ }))
338
+ },
339
+ pages: {
340
+ name: 'folder-views',
341
+ content: ()=>import("../../0~819.js").then((mod)=>({
342
+ default: mod.folder_viewsraw_namespaceObject
343
+ }))
344
+ },
345
+ views: {
346
+ name: 'folder-views',
347
+ content: ()=>import("../../0~819.js").then((mod)=>({
348
+ default: mod.folder_viewsraw_namespaceObject
349
+ }))
350
+ },
351
+ routes: {
352
+ name: 'folder-routes',
353
+ content: ()=>import("../../0~457.js").then((mod)=>({
354
+ default: mod.folder_routesraw_namespaceObject
355
+ }))
356
+ },
357
+ docs: {
358
+ name: 'folder-docs',
359
+ content: ()=>import("../../0~768.js").then((mod)=>({
360
+ default: mod.folder_docsraw_namespaceObject
361
+ }))
362
+ },
363
+ services: {
364
+ name: 'folder-app',
365
+ content: ()=>import("../../0~142.js").then((mod)=>({
366
+ default: mod.folder_appraw_namespaceObject
367
+ }))
368
+ },
369
+ app: {
370
+ name: 'folder-app',
371
+ content: ()=>import("../../0~142.js").then((mod)=>({
372
+ default: mod.folder_appraw_namespaceObject
373
+ }))
374
+ }
375
+ };
376
+ const DEFAULT_FOLDER_ICON = {
377
+ name: 'folder',
378
+ content: ()=>import("../../0~96.js").then((mod)=>({
379
+ default: mod.folderraw_namespaceObject
380
+ }))
381
+ };
382
+ const DEFAULT_FILE_ICON = {
383
+ name: 'file',
384
+ content: ()=>import("../../0~326.js").then((mod)=>({
385
+ default: mod.fileraw_namespaceObject
386
+ })),
387
+ matcher: /^.*$/
388
+ };
389
+ function getFolderIcon(name) {
390
+ const lowerName = name.toLowerCase();
391
+ return FOLDER_ICONS[lowerName] || DEFAULT_FOLDER_ICON;
392
+ }
393
+ function getFileIcon(fileName) {
394
+ for (const language of SUPPORTED_LANGUAGES)for (const icon of language.icons)if (icon.matcher.test(fileName)) return {
395
+ name: icon.name,
396
+ content: icon.content,
397
+ matcher: icon.matcher
398
+ };
399
+ return DEFAULT_FILE_ICON;
400
+ }
401
+ const FileTreeItem_module = {
402
+ item: "item-mfHlfR",
403
+ row: "row-AOLrYw",
404
+ chevron: "chevron-Zi120f",
405
+ iconWrapper: "iconWrapper-SwAXs4",
406
+ name: "name-ItNtUc",
407
+ children: "children-yp3kEz",
408
+ indentGuide: "indentGuide-bjr2fi"
409
+ };
410
+ const RemoteSvgIcon = ({ content, className })=>{
411
+ const [svgContent, setSvgContent] = useState('');
412
+ useEffect(()=>{
413
+ let cancelled = false;
414
+ content().then((mod)=>{
415
+ if (cancelled) return;
416
+ const svg = 'string' == typeof mod ? mod : mod.default;
417
+ setSvgContent(svg);
418
+ });
419
+ return ()=>{
420
+ cancelled = true;
421
+ };
422
+ }, [
423
+ content
424
+ ]);
425
+ if (!svgContent) return null;
426
+ return /*#__PURE__*/ jsx("span", {
427
+ className: className,
428
+ dangerouslySetInnerHTML: {
429
+ __html: svgContent
430
+ }
431
+ });
432
+ };
433
+ const INDENT_SIZE = 12;
434
+ const FileTreeItem = ({ node, depth })=>{
435
+ const [expanded, setExpanded] = useState(true);
436
+ const icon = useMemo(()=>{
437
+ if ('directory' === node.type) return getFolderIcon(node.name);
438
+ return getFileIcon(node.name);
439
+ }, [
440
+ node.name,
441
+ node.type
442
+ ]);
443
+ const isDirectory = 'directory' === node.type;
444
+ const toggle = (e)=>{
445
+ e.stopPropagation();
446
+ if (isDirectory) setExpanded((p)=>!p);
447
+ };
448
+ return /*#__PURE__*/ jsxs("div", {
449
+ className: FileTreeItem_module.item,
450
+ children: [
451
+ /*#__PURE__*/ jsxs("div", {
452
+ className: FileTreeItem_module.row,
453
+ onClick: toggle,
454
+ style: {
455
+ paddingLeft: `${depth * INDENT_SIZE}px`
456
+ },
457
+ children: [
458
+ /*#__PURE__*/ jsx("div", {
459
+ className: FileTreeItem_module.chevron,
460
+ "data-expanded": expanded,
461
+ style: {
462
+ visibility: isDirectory ? 'visible' : 'hidden'
463
+ },
464
+ children: /*#__PURE__*/ jsx("svg", {
465
+ width: "16",
466
+ height: "16",
467
+ viewBox: "0 0 16 16",
468
+ fill: "currentColor",
469
+ children: /*#__PURE__*/ jsx("path", {
470
+ fillRule: "evenodd",
471
+ clipRule: "evenodd",
472
+ d: "M10.072 8.024L5.715 3.667l.618-.62L11 8.024l-4.667 4.977-.618-.62L10.072 8.024z"
473
+ })
474
+ })
475
+ }),
476
+ /*#__PURE__*/ jsx("div", {
477
+ className: FileTreeItem_module.iconWrapper,
478
+ children: /*#__PURE__*/ jsx(RemoteSvgIcon, {
479
+ content: icon.content,
480
+ className: FileTreeItem_module.iconWrapper
481
+ })
482
+ }),
483
+ /*#__PURE__*/ jsx("span", {
484
+ className: FileTreeItem_module.name,
485
+ children: node.name
486
+ })
487
+ ]
488
+ }),
489
+ isDirectory && node.children.length > 0 && expanded && /*#__PURE__*/ jsxs("div", {
490
+ className: FileTreeItem_module.children,
491
+ children: [
492
+ /*#__PURE__*/ jsx("div", {
493
+ className: FileTreeItem_module.indentGuide,
494
+ style: {
495
+ left: `${depth * INDENT_SIZE + 6}px`
496
+ }
497
+ }),
498
+ node.children.map((child, index)=>/*#__PURE__*/ jsx(FileTreeItem, {
499
+ node: child,
500
+ depth: depth + 1
501
+ }, `${child.name}-${index}`))
502
+ ]
503
+ })
504
+ ]
505
+ });
506
+ };
507
+ const FileTree = ({ nodes })=>/*#__PURE__*/ jsx("div", {
508
+ className: FileTree_module.container,
509
+ children: nodes.map((node, index)=>/*#__PURE__*/ jsx(FileTreeItem, {
510
+ node: node,
511
+ depth: 0
512
+ }, `${node.name}-${index}`))
513
+ });
514
+ const FileTree_FileTree = FileTree;
515
+ export default FileTree_FileTree;
516
+ export { __webpack_require__, FileTree };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { TreeNode } from '../tree-parser/types';
3
+ interface FileTreeItemProps {
4
+ node: TreeNode;
5
+ depth: number;
6
+ }
7
+ export declare const FileTreeItem: React.FC<FileTreeItemProps>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface RemoteSvgIconProps {
3
+ content: () => Promise<{
4
+ default: string;
5
+ } | string>;
6
+ size?: 'sm' | 'md';
7
+ delay?: number;
8
+ className?: string;
9
+ }
10
+ export declare const RemoteSvgIcon: React.FC<RemoteSvgIconProps>;
11
+ export {};
@@ -0,0 +1,4 @@
1
+ import { FileTree } from './FileTree';
2
+ export default FileTree;
3
+ export { FileTree };
4
+ export { FileTreeItem } from './FileTreeItem';
@@ -0,0 +1,32 @@
1
+ /// <reference path="../../src/env.d.ts" />
2
+ export interface FolderIconDefinition {
3
+ name: string;
4
+ content: () => Promise<typeof import('*.svg')>;
5
+ }
6
+ export interface FileIconDefinition {
7
+ name: string;
8
+ content: () => Promise<typeof import('*.svg')>;
9
+ matcher: RegExp;
10
+ }
11
+ /**
12
+ * Special folder icons mapping
13
+ * Maps folder names to their corresponding icons
14
+ */
15
+ export declare const FOLDER_ICONS: Record<string, FolderIconDefinition>;
16
+ /**
17
+ * Default folder icon
18
+ */
19
+ export declare const DEFAULT_FOLDER_ICON: FolderIconDefinition;
20
+ /**
21
+ * Default file icon
22
+ */
23
+ export declare const DEFAULT_FILE_ICON: FileIconDefinition;
24
+ /**
25
+ * Get folder icon by folder name
26
+ */
27
+ export declare function getFolderIcon(name: string): FolderIconDefinition;
28
+ /**
29
+ * Get file icon by file name
30
+ * Searches through all supported languages for matching icon
31
+ */
32
+ export declare function getFileIcon(fileName: string): FileIconDefinition;
@@ -0,0 +1,7 @@
1
+ import { FileIconDefinition } from './folder-icons';
2
+ interface LanguageDefinition {
3
+ id: string;
4
+ icons: FileIconDefinition[];
5
+ }
6
+ export declare const SUPPORTED_LANGUAGES: LanguageDefinition[];
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ParsedTree } from './types';
2
+ /**
3
+ * Parse tree-style directory structure text into TreeNode array
4
+ *
5
+ * Supported formats:
6
+ * doc_build
7
+ * ├── file.ts
8
+ * └── folder
9
+ * ├── nested.ts
10
+ * └── another.ts
11
+ */
12
+ export declare function parseTreeContent(content: string): ParsedTree;
@@ -0,0 +1,10 @@
1
+ export interface TreeNode {
2
+ name: string;
3
+ type: 'file' | 'directory';
4
+ children: TreeNode[];
5
+ extension?: string;
6
+ }
7
+ export interface ParsedTree {
8
+ nodes: TreeNode[];
9
+ raw: string;
10
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RspressPlugin } from '@rspress/shared';
1
+ import type { RspressPlugin } from '@rspress/core';
2
2
  interface RspressPluginFileTreeOptions {
3
3
  initialExpandDepth?: number;
4
4
  }