vuepress-plugin-md-power 1.0.0-rc.143 → 1.0.0-rc.145
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/README.md +10 -10
- package/lib/client/components/CanIUse.vue +4 -4
- package/lib/client/components/FileTreeNode.vue +229 -0
- package/lib/client/components/VPField.vue +94 -0
- package/lib/client/composables/demo.js +3 -3
- package/lib/node/index.d.ts +7 -1
- package/lib/node/index.js +460 -440
- package/lib/shared/index.d.ts +7 -1
- package/package.json +18 -18
- package/lib/client/components/FileTreeItem.vue +0 -183
package/lib/shared/index.d.ts
CHANGED
|
@@ -204,7 +204,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
204
204
|
/**
|
|
205
205
|
* 是否启用 iconify 图标嵌入语法
|
|
206
206
|
*
|
|
207
|
-
*
|
|
207
|
+
* `::collect:icon_name::`
|
|
208
208
|
*
|
|
209
209
|
* @default false
|
|
210
210
|
*/
|
|
@@ -267,6 +267,12 @@ interface MarkdownPowerPluginOptions {
|
|
|
267
267
|
* @default false
|
|
268
268
|
*/
|
|
269
269
|
chat?: boolean;
|
|
270
|
+
/**
|
|
271
|
+
* 是否启用 field / field-group 容器
|
|
272
|
+
*
|
|
273
|
+
* @default false
|
|
274
|
+
*/
|
|
275
|
+
field?: boolean;
|
|
270
276
|
/**
|
|
271
277
|
* 是否启用 bilibili 视频嵌入
|
|
272
278
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuepress-plugin-md-power",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.145",
|
|
5
5
|
"description": "The Plugin for VuePress 2 - markdown power",
|
|
6
6
|
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
"lib"
|
|
32
32
|
],
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"artplayer": "^5.2.
|
|
34
|
+
"artplayer": "^5.2.3",
|
|
35
35
|
"dashjs": "^5.0.1",
|
|
36
|
-
"esbuild": "^0.25.
|
|
36
|
+
"esbuild": "^0.25.3",
|
|
37
37
|
"hls.js": "^1.6.2",
|
|
38
38
|
"less": "^4.3.0",
|
|
39
39
|
"markdown-it": "^14.1.0",
|
|
40
40
|
"mpegts.js": "^1.7.3",
|
|
41
|
-
"sass": "^1.
|
|
42
|
-
"sass-embedded": "^1.
|
|
41
|
+
"sass": "^1.87.0",
|
|
42
|
+
"sass-embedded": "^1.87.0",
|
|
43
43
|
"stylus": "^0.64.0",
|
|
44
|
-
"vuepress": "2.0.0-rc.
|
|
44
|
+
"vuepress": "2.0.0-rc.22"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"artplayer": {
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@mdit/plugin-attrs": "^0.
|
|
65
|
-
"@mdit/plugin-footnote": "^0.
|
|
66
|
-
"@mdit/plugin-mark": "^0.
|
|
67
|
-
"@mdit/plugin-sub": "^0.
|
|
68
|
-
"@mdit/plugin-sup": "^0.
|
|
69
|
-
"@mdit/plugin-tab": "^0.
|
|
70
|
-
"@mdit/plugin-tasklist": "^0.
|
|
71
|
-
"@pengzhanbo/utils": "^2.
|
|
72
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
64
|
+
"@mdit/plugin-attrs": "^0.17.0",
|
|
65
|
+
"@mdit/plugin-footnote": "^0.17.0",
|
|
66
|
+
"@mdit/plugin-mark": "^0.17.0",
|
|
67
|
+
"@mdit/plugin-sub": "^0.17.0",
|
|
68
|
+
"@mdit/plugin-sup": "^0.17.0",
|
|
69
|
+
"@mdit/plugin-tab": "^0.17.0",
|
|
70
|
+
"@mdit/plugin-tasklist": "^0.17.0",
|
|
71
|
+
"@pengzhanbo/utils": "^2.1.0",
|
|
72
|
+
"@vuepress/helper": "2.0.0-rc.98",
|
|
73
73
|
"@vueuse/core": "^13.1.0",
|
|
74
74
|
"chokidar": "3.6.0",
|
|
75
75
|
"image-size": "^2.0.2",
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"lru-cache": "^11.1.0",
|
|
78
78
|
"markdown-it-container": "^4.0.0",
|
|
79
79
|
"nanoid": "^5.1.5",
|
|
80
|
-
"shiki": "^3.
|
|
81
|
-
"tm-grammars": "^1.23.
|
|
80
|
+
"shiki": "^3.3.0",
|
|
81
|
+
"tm-grammars": "^1.23.16",
|
|
82
82
|
"tm-themes": "^1.10.5",
|
|
83
83
|
"vue": "^3.5.13"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@types/markdown-it": "^14.1.2",
|
|
87
|
-
"artplayer": "^5.2.
|
|
87
|
+
"artplayer": "^5.2.3",
|
|
88
88
|
"dashjs": "^5.0.1",
|
|
89
89
|
"hls.js": "^1.6.2",
|
|
90
90
|
"mpegts.js": "1.7.3"
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted, onUnmounted, ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
type: 'file' | 'folder'
|
|
6
|
-
expanded: boolean
|
|
7
|
-
empty: boolean
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
const active = ref(!!props.expanded)
|
|
11
|
-
const el = ref<HTMLElement>()
|
|
12
|
-
|
|
13
|
-
function toggle(e: HTMLElementEventMap['click']) {
|
|
14
|
-
const target = e.target as HTMLElement
|
|
15
|
-
if (target.matches('.comment') || e.currentTarget === target)
|
|
16
|
-
return
|
|
17
|
-
active.value = !active.value
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
onMounted(() => {
|
|
21
|
-
if (!el.value || props.type !== 'folder')
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
el.value.querySelector('.tree-node.folder')?.addEventListener(
|
|
25
|
-
'click',
|
|
26
|
-
toggle as EventListener,
|
|
27
|
-
)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
onUnmounted(() => {
|
|
31
|
-
if (!el.value || props.type !== 'folder')
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
el.value.querySelector('.tree-node.folder')?.removeEventListener(
|
|
35
|
-
'click',
|
|
36
|
-
toggle as EventListener,
|
|
37
|
-
)
|
|
38
|
-
})
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<template>
|
|
42
|
-
<li ref="el" class="file-tree-item" :class="{ expanded: active }">
|
|
43
|
-
<slot />
|
|
44
|
-
<ul v-if="props.type === 'folder' && props.empty">
|
|
45
|
-
<li class="file-tree-item">
|
|
46
|
-
<span class="tree-node file">
|
|
47
|
-
<span class="name">…</span>
|
|
48
|
-
</span>
|
|
49
|
-
</li>
|
|
50
|
-
</ul>
|
|
51
|
-
</li>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
54
|
-
<style>
|
|
55
|
-
.vp-file-tree {
|
|
56
|
-
width: fit-content;
|
|
57
|
-
max-width: 100%;
|
|
58
|
-
padding: 16px;
|
|
59
|
-
font-size: 14px;
|
|
60
|
-
background-color: var(--vp-c-bg-safe);
|
|
61
|
-
border: solid 1px var(--vp-c-divider);
|
|
62
|
-
border-radius: 8px;
|
|
63
|
-
transition: border var(--vp-t-color), background-color var(--vp-t-color);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.vp-file-tree .vp-file-tree-title {
|
|
67
|
-
padding-left: 16px;
|
|
68
|
-
margin: -16px -16px 0;
|
|
69
|
-
font-weight: bold;
|
|
70
|
-
color: var(--vp-c-text-1);
|
|
71
|
-
border-bottom: solid 1px var(--vp-c-divider);
|
|
72
|
-
transition: color var(--vp-t-color), border-color var(--vp-t-color);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.vp-file-tree ul {
|
|
76
|
-
padding: 0 !important;
|
|
77
|
-
margin: 0 !important;
|
|
78
|
-
list-style: none !important;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.file-tree-item {
|
|
82
|
-
margin-left: 14px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.vp-file-tree .file-tree-item {
|
|
86
|
-
margin-top: 0;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.file-tree-item .tree-node {
|
|
90
|
-
display: flex;
|
|
91
|
-
flex-wrap: wrap;
|
|
92
|
-
gap: 8px;
|
|
93
|
-
align-items: center;
|
|
94
|
-
justify-content: flex-start;
|
|
95
|
-
margin: 4px 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.file-tree-item .tree-node .name {
|
|
99
|
-
font-family: var(--vp-font-family-mono);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.file-tree-item .tree-node.folder {
|
|
103
|
-
position: relative;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.file-tree-item .tree-node.folder > .name {
|
|
107
|
-
color: var(--vp-c-text-1);
|
|
108
|
-
cursor: pointer;
|
|
109
|
-
transition: color var(--vp-t-color);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.file-tree-item .tree-node.folder > .name:hover {
|
|
113
|
-
color: var(--vp-c-brand-1);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.file-tree-item .tree-node.folder::before {
|
|
117
|
-
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M5.536 21.886a1 1 0 0 0 1.033-.064l13-9a1 1 0 0 0 0-1.644l-13-9A1 1 0 0 0 5 3v18a1 1 0 0 0 .536.886'/%3E%3C/svg%3E");
|
|
118
|
-
|
|
119
|
-
position: absolute;
|
|
120
|
-
top: 7px;
|
|
121
|
-
left: -14px;
|
|
122
|
-
display: block;
|
|
123
|
-
width: 10px;
|
|
124
|
-
height: 10px;
|
|
125
|
-
color: var(--vp-c-text-3);
|
|
126
|
-
cursor: pointer;
|
|
127
|
-
content: "";
|
|
128
|
-
background-color: currentcolor;
|
|
129
|
-
-webkit-mask: var(--icon) no-repeat;
|
|
130
|
-
mask: var(--icon) no-repeat;
|
|
131
|
-
-webkit-mask-size: 100% 100%;
|
|
132
|
-
mask-size: 100% 100%;
|
|
133
|
-
transition: color var(--vp-t-color);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.file-tree-item .tree-node .name.focus {
|
|
137
|
-
position: relative;
|
|
138
|
-
padding: 0 4px;
|
|
139
|
-
margin: 0 -4px;
|
|
140
|
-
font-weight: bold;
|
|
141
|
-
color: var(--vp-c-bg);
|
|
142
|
-
background-color: var(--vp-c-brand-2);
|
|
143
|
-
border-radius: 4px;
|
|
144
|
-
transition: color var(--vp-t-color), background-color var(--vp-t-color);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.file-tree-item .tree-node .name.focus:hover {
|
|
148
|
-
color: var(--vp-c-bg);
|
|
149
|
-
background-color: var(--vp-c-brand-1);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.file-tree-item .tree-node .comment {
|
|
153
|
-
margin-left: 20px;
|
|
154
|
-
overflow: hidden;
|
|
155
|
-
color: var(--vp-c-text-3);
|
|
156
|
-
transition: color var(--vp-t-color);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.file-tree-item .tree-node [class*="vpi-"] {
|
|
160
|
-
width: 1.2em;
|
|
161
|
-
height: 1.2em;
|
|
162
|
-
margin: 0;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.file-tree-item .tree-node.folder [class*="vpi-"] {
|
|
166
|
-
cursor: pointer;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.vp-file-tree .file-tree-item > ul {
|
|
170
|
-
padding-left: 8px !important;
|
|
171
|
-
margin: 0 0 0 6px !important;
|
|
172
|
-
border-left: solid 1px var(--vp-c-divider);
|
|
173
|
-
transition: border-color var(--vp-t-color);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.file-tree-item:not(.expanded) > ul {
|
|
177
|
-
display: none;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.file-tree-item.expanded > .tree-node.folder::before {
|
|
181
|
-
transform: rotate(90deg);
|
|
182
|
-
}
|
|
183
|
-
</style>
|