vitepress-plugin-file-tree 0.10.0 → 0.11.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/client/browser/index.d.ts +18 -19
- package/dist/client/ssr/index.d.ts +17 -19
- package/dist/node/index.d.ts +0 -15
- package/package.json +8 -12
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import "../style.css";
|
|
1
2
|
import { InjectionKey, Ref } from "vue";
|
|
2
3
|
import { EnhanceAppContext } from "vitepress/client";
|
|
3
|
-
|
|
4
|
-
//#region src/client/VPFileTree.vue.d.ts
|
|
5
4
|
type __VLS_Props$1 = {
|
|
6
|
-
/** Optional title displayed above the file tree. / 显示在文件树上方的可选标题。 */
|
|
5
|
+
/** Optional title displayed above the file tree. / 显示在文件树上方的可选标题。 */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** URL-encoded plain-text representation of the file tree for the copy button. / 文件树的 URL 编码纯文本,供复制按钮使用。 */
|
|
7
8
|
text?: string;
|
|
8
9
|
};
|
|
9
10
|
declare var __VLS_1$1: {}, __VLS_8: {};
|
|
@@ -20,15 +21,20 @@ type __VLS_WithSlots$1<T, S> = T & {
|
|
|
20
21
|
$slots: S;
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/client/VPFileTreeNode.vue.d.ts
|
|
25
24
|
type __VLS_Props = {
|
|
26
|
-
/** Node type, either a folder or a file. / 节点类型,文件夹或文件。 */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
/** Node type, either a folder or a file. / 节点类型,文件夹或文件。 */
|
|
26
|
+
type: 'file' | 'folder';
|
|
27
|
+
/** Display name of the file or folder. / 文件或文件夹的显示名称。 */
|
|
28
|
+
filename: string;
|
|
29
|
+
/** Indentation depth level, used for visual offset. / 缩进层级,用于视觉偏移。 */
|
|
30
|
+
level: number;
|
|
31
|
+
/** Diff marker indicating the node was added or removed. / 差异标记,表示节点为新增或删除。 */
|
|
32
|
+
diff?: 'add' | 'remove';
|
|
33
|
+
/** Whether a folder node is expanded by default. / 文件夹节点是否默认展开。 */
|
|
34
|
+
expanded?: boolean;
|
|
35
|
+
/** Whether this node is visually highlighted as focused. / 是否作为聚焦节点高亮显示。 */
|
|
36
|
+
focus?: boolean;
|
|
37
|
+
/** Full file path used for active state matching. / 用于匹配激活状态的完整文件路径。 */
|
|
32
38
|
filepath?: string;
|
|
33
39
|
};
|
|
34
40
|
declare var __VLS_1: {}, __VLS_3: {};
|
|
@@ -45,8 +51,6 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
45
51
|
$slots: S;
|
|
46
52
|
};
|
|
47
53
|
};
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/client/constants.d.ts
|
|
50
54
|
/**
|
|
51
55
|
* File tree node click event
|
|
52
56
|
*
|
|
@@ -59,8 +63,6 @@ declare const ON_NODE_CLICK: InjectionKey<(filename: string, type: 'folder' | 'f
|
|
|
59
63
|
* 当前激活的文件树节点
|
|
60
64
|
*/
|
|
61
65
|
declare const ACTIVE_NODE_KEY: InjectionKey<Ref<string>>;
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/client/index.d.ts
|
|
64
66
|
/**
|
|
65
67
|
* Register file tree components globally during VitePress app enhancement.
|
|
66
68
|
*
|
|
@@ -74,8 +76,5 @@ declare const ACTIVE_NODE_KEY: InjectionKey<Ref<string>>;
|
|
|
74
76
|
* @param ctx - VitePress enhance app context / VitePress 应用增强上下文
|
|
75
77
|
* @param ctx.app - The VitePress Vue app instance / VitePress 的 Vue 应用实例
|
|
76
78
|
*/
|
|
77
|
-
declare function enhanceAppWithFileTree({
|
|
78
|
-
app
|
|
79
|
-
}: EnhanceAppContext): void;
|
|
80
|
-
//#endregion
|
|
79
|
+
declare function enhanceAppWithFileTree({ app }: EnhanceAppContext): void;
|
|
81
80
|
export { ACTIVE_NODE_KEY, ON_NODE_CLICK, _default as VPFileTree, _default$1 as VPFileTreeNode, enhanceAppWithFileTree };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InjectionKey, Ref } from "vue";
|
|
2
2
|
import { EnhanceAppContext } from "vitepress/client";
|
|
3
|
-
|
|
4
|
-
//#region src/client/VPFileTree.vue.d.ts
|
|
5
3
|
type __VLS_Props$1 = {
|
|
6
|
-
/** Optional title displayed above the file tree. / 显示在文件树上方的可选标题。 */
|
|
4
|
+
/** Optional title displayed above the file tree. / 显示在文件树上方的可选标题。 */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** URL-encoded plain-text representation of the file tree for the copy button. / 文件树的 URL 编码纯文本,供复制按钮使用。 */
|
|
7
7
|
text?: string;
|
|
8
8
|
};
|
|
9
9
|
declare var __VLS_1$1: {}, __VLS_8: {};
|
|
@@ -20,15 +20,20 @@ type __VLS_WithSlots$1<T, S> = T & {
|
|
|
20
20
|
$slots: S;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/client/VPFileTreeNode.vue.d.ts
|
|
25
23
|
type __VLS_Props = {
|
|
26
|
-
/** Node type, either a folder or a file. / 节点类型,文件夹或文件。 */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
/** Node type, either a folder or a file. / 节点类型,文件夹或文件。 */
|
|
25
|
+
type: 'file' | 'folder';
|
|
26
|
+
/** Display name of the file or folder. / 文件或文件夹的显示名称。 */
|
|
27
|
+
filename: string;
|
|
28
|
+
/** Indentation depth level, used for visual offset. / 缩进层级,用于视觉偏移。 */
|
|
29
|
+
level: number;
|
|
30
|
+
/** Diff marker indicating the node was added or removed. / 差异标记,表示节点为新增或删除。 */
|
|
31
|
+
diff?: 'add' | 'remove';
|
|
32
|
+
/** Whether a folder node is expanded by default. / 文件夹节点是否默认展开。 */
|
|
33
|
+
expanded?: boolean;
|
|
34
|
+
/** Whether this node is visually highlighted as focused. / 是否作为聚焦节点高亮显示。 */
|
|
35
|
+
focus?: boolean;
|
|
36
|
+
/** Full file path used for active state matching. / 用于匹配激活状态的完整文件路径。 */
|
|
32
37
|
filepath?: string;
|
|
33
38
|
};
|
|
34
39
|
declare var __VLS_1: {}, __VLS_3: {};
|
|
@@ -45,8 +50,6 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
45
50
|
$slots: S;
|
|
46
51
|
};
|
|
47
52
|
};
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/client/constants.d.ts
|
|
50
53
|
/**
|
|
51
54
|
* File tree node click event
|
|
52
55
|
*
|
|
@@ -59,8 +62,6 @@ declare const ON_NODE_CLICK: InjectionKey<(filename: string, type: 'folder' | 'f
|
|
|
59
62
|
* 当前激活的文件树节点
|
|
60
63
|
*/
|
|
61
64
|
declare const ACTIVE_NODE_KEY: InjectionKey<Ref<string>>;
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/client/index.d.ts
|
|
64
65
|
/**
|
|
65
66
|
* Register file tree components globally during VitePress app enhancement.
|
|
66
67
|
*
|
|
@@ -74,8 +75,5 @@ declare const ACTIVE_NODE_KEY: InjectionKey<Ref<string>>;
|
|
|
74
75
|
* @param ctx - VitePress enhance app context / VitePress 应用增强上下文
|
|
75
76
|
* @param ctx.app - The VitePress Vue app instance / VitePress 的 Vue 应用实例
|
|
76
77
|
*/
|
|
77
|
-
declare function enhanceAppWithFileTree({
|
|
78
|
-
app
|
|
79
|
-
}: EnhanceAppContext): void;
|
|
80
|
-
//#endregion
|
|
78
|
+
declare function enhanceAppWithFileTree({ app }: EnhanceAppContext): void;
|
|
81
79
|
export { ACTIVE_NODE_KEY, ON_NODE_CLICK, _default as VPFileTree, _default$1 as VPFileTreeNode, enhanceAppWithFileTree };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { PluginSimple } from "markdown-it";
|
|
2
|
-
|
|
3
|
-
//#region src/node/plugin.d.ts
|
|
4
2
|
/**
|
|
5
3
|
* VitePress plugin for rendering file tree diagrams in markdown.
|
|
6
4
|
*
|
|
@@ -28,8 +26,6 @@ import { PluginSimple } from "markdown-it";
|
|
|
28
26
|
* ```
|
|
29
27
|
*/
|
|
30
28
|
declare const fileTree: (options?: unknown) => import("vitepress-tuck").VitepressPlugin;
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/node/types.d.ts
|
|
33
29
|
/**
|
|
34
30
|
* File tree node structure.
|
|
35
31
|
*
|
|
@@ -81,8 +77,6 @@ interface FileTreeAttrs {
|
|
|
81
77
|
/** Optional title displayed above the file tree. / 显示在文件树上方的可选标题。 */
|
|
82
78
|
title?: string;
|
|
83
79
|
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/node/fileTreeToCMDText.d.ts
|
|
86
80
|
/**
|
|
87
81
|
* Convert file tree nodes into `tree` command-style plain text.
|
|
88
82
|
*
|
|
@@ -115,8 +109,6 @@ interface FileTreeAttrs {
|
|
|
115
109
|
* ```
|
|
116
110
|
*/
|
|
117
111
|
declare function fileTreeToCMDText(nodes: FileTreeNode[], prefix?: string): string;
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region src/node/markdown.d.ts
|
|
120
112
|
/**
|
|
121
113
|
* markdown-it plugin for rendering file tree diagrams.
|
|
122
114
|
*
|
|
@@ -150,8 +142,6 @@ declare function fileTreeToCMDText(nodes: FileTreeNode[], prefix?: string): stri
|
|
|
150
142
|
* ```
|
|
151
143
|
*/
|
|
152
144
|
declare const fileTreeMarkdownPlugin: PluginSimple;
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/node/parseContentWithContainer.d.ts
|
|
155
145
|
/**
|
|
156
146
|
* Parse the content from the `::: file-tree` container into a node tree structure.
|
|
157
147
|
*
|
|
@@ -178,8 +168,6 @@ declare const fileTreeMarkdownPlugin: PluginSimple;
|
|
|
178
168
|
* ```
|
|
179
169
|
*/
|
|
180
170
|
declare function parseContentWithContainer(content: string): FileTreeNode[];
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/node/parseContentWithFence.d.ts
|
|
183
171
|
/**
|
|
184
172
|
* Parse `tree` command output format into a structured file tree node array.
|
|
185
173
|
*
|
|
@@ -204,8 +192,6 @@ declare function parseContentWithContainer(content: string): FileTreeNode[];
|
|
|
204
192
|
* @returns Structured file tree node array / 结构化的文件树节点数组
|
|
205
193
|
*/
|
|
206
194
|
declare function parseContentWithFence(content: string): FileTreeNode[];
|
|
207
|
-
//#endregion
|
|
208
|
-
//#region src/node/parseNodeInfo.d.ts
|
|
209
195
|
/**
|
|
210
196
|
* Parse a single node info string, extracting filename, comment, type, and
|
|
211
197
|
* other metadata.
|
|
@@ -234,5 +220,4 @@ declare function parseContentWithFence(content: string): FileTreeNode[];
|
|
|
234
220
|
* ```
|
|
235
221
|
*/
|
|
236
222
|
declare function parseNodeInfo(info: string): Omit<FileTreeNode, 'children' | 'level'>;
|
|
237
|
-
//#endregion
|
|
238
223
|
export { FileTreeAttrs, FileTreeNode, fileTree as default, fileTree, fileTreeMarkdownPlugin, fileTreeToCMDText, parseContentWithContainer, parseContentWithFence, parseNodeInfo };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitepress-plugin-file-tree",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.1",
|
|
5
5
|
"description": "Render file tree structure in your VitePress site.",
|
|
6
6
|
"author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,26 +33,22 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"vitepress": "^
|
|
36
|
+
"vitepress": "^2.0.0-alpha.18",
|
|
37
37
|
"vue": "^3.5.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@pengzhanbo/utils": "^3.
|
|
40
|
+
"@pengzhanbo/utils": "^3.9.0",
|
|
41
41
|
"@vueuse/core": "^14.3.0",
|
|
42
|
-
"vitepress-plugin-toolkit": "0.
|
|
43
|
-
"vitepress-tuck": "0.
|
|
42
|
+
"vitepress-plugin-toolkit": "0.11.1",
|
|
43
|
+
"vitepress-tuck": "0.11.1"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public",
|
|
47
47
|
"provenance": true
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"copy": "cpx \"src/**/*.css\" dist",
|
|
54
|
-
"copy:watch": "pnpm copy -w",
|
|
55
|
-
"tsdown": "tsdown --config-loader unrun",
|
|
56
|
-
"tsdown:watch": "pnpm tsdown -w"
|
|
50
|
+
"dev": "pnpm tsdown -w",
|
|
51
|
+
"build": "pnpm tsdown",
|
|
52
|
+
"tsdown": "tsdown --config-loader unrun"
|
|
57
53
|
}
|
|
58
54
|
}
|