vuepress-plugin-md-power 1.0.0-rc.96 → 1.0.0-rc.98

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.
@@ -25,61 +25,6 @@ interface SizeOptions {
25
25
  ratio?: number | string;
26
26
  }
27
27
 
28
- type PDFEmbedType = 'iframe' | 'embed' | 'pdfjs';
29
- interface PDFTokenMeta extends SizeOptions {
30
- page?: number;
31
- noToolbar?: boolean;
32
- zoom?: number;
33
- src?: string;
34
- title?: string;
35
- }
36
- interface PDFOptions {
37
- /**
38
- * pdfjs url
39
- */
40
- pdfjsUrl?: string;
41
- }
42
-
43
- interface IconsOptions {
44
- /**
45
- * The prefix of the icon className
46
- * @default 'vp-mdi'
47
- */
48
- prefix?: string;
49
- /**
50
- * The size of the icon
51
- * @default '1em'
52
- */
53
- size?: string | number;
54
- /**
55
- * The color of the icon
56
- * @default 'currentColor'
57
- */
58
- color?: string;
59
- }
60
-
61
- interface VideoOptions {
62
- bilibili?: boolean;
63
- youtube?: boolean;
64
- }
65
- interface BilibiliTokenMeta extends SizeOptions {
66
- title?: string;
67
- bvid?: string;
68
- aid?: string;
69
- cid?: string;
70
- autoplay?: boolean;
71
- time?: string | number;
72
- page?: number;
73
- }
74
- interface YoutubeTokenMeta extends SizeOptions {
75
- title?: string;
76
- id: string;
77
- autoplay?: boolean;
78
- loop?: boolean;
79
- start?: string | number;
80
- end?: string | number;
81
- }
82
-
83
28
  interface CodepenTokenMeta extends SizeOptions {
84
29
  title?: string;
85
30
  user?: string;
@@ -101,32 +46,22 @@ interface CodeSandboxTokenMeta extends SizeOptions {
101
46
  console?: boolean;
102
47
  }
103
48
 
104
- type ThemeOptions = BuiltinTheme | {
105
- light: BuiltinTheme;
106
- dark: BuiltinTheme;
107
- };
108
- interface ReplOptions {
109
- theme?: ThemeOptions;
110
- go?: boolean;
111
- kotlin?: boolean;
112
- rust?: boolean;
113
- }
114
- interface ReplEditorData {
115
- grammars: {
116
- go?: any;
117
- kotlin?: any;
118
- rust?: any;
119
- };
120
- theme: ThemeRegistration | {
121
- light: ThemeRegistration;
122
- dark: ThemeRegistration;
123
- };
124
- }
125
-
126
- interface ReplitTokenMeta extends SizeOptions {
127
- title?: string;
128
- source?: string;
129
- theme?: string;
49
+ interface IconsOptions {
50
+ /**
51
+ * The prefix of the icon className
52
+ * @default 'vp-mdi'
53
+ */
54
+ prefix?: string;
55
+ /**
56
+ * The size of the icon
57
+ * @default '1em'
58
+ */
59
+ size?: string | number;
60
+ /**
61
+ * The color of the icon
62
+ * @default 'currentColor'
63
+ */
64
+ color?: string;
130
65
  }
131
66
 
132
67
  interface JSFiddleTokenMeta extends SizeOptions {
@@ -137,6 +72,21 @@ interface JSFiddleTokenMeta extends SizeOptions {
137
72
  tab?: string;
138
73
  }
139
74
 
75
+ type PDFEmbedType = 'iframe' | 'embed' | 'pdfjs';
76
+ interface PDFTokenMeta extends SizeOptions {
77
+ page?: number;
78
+ noToolbar?: boolean;
79
+ zoom?: number;
80
+ src?: string;
81
+ title?: string;
82
+ }
83
+ interface PDFOptions {
84
+ /**
85
+ * pdfjs url
86
+ */
87
+ pdfjsUrl?: string;
88
+ }
89
+
140
90
  interface PlotOptions {
141
91
  /**
142
92
  * 是否启用 `=| |=` markdown (该标记为非标准标记,脱离插件将不生效)
@@ -165,22 +115,163 @@ interface PlotOptions {
165
115
  trigger?: 'hover' | 'click';
166
116
  }
167
117
 
118
+ type ThemeOptions = BuiltinTheme | {
119
+ light: BuiltinTheme;
120
+ dark: BuiltinTheme;
121
+ };
122
+ interface ReplOptions {
123
+ theme?: ThemeOptions;
124
+ go?: boolean;
125
+ kotlin?: boolean;
126
+ rust?: boolean;
127
+ }
128
+ interface ReplEditorData {
129
+ grammars: {
130
+ go?: any;
131
+ kotlin?: any;
132
+ rust?: any;
133
+ };
134
+ theme: ThemeRegistration | {
135
+ light: ThemeRegistration;
136
+ dark: ThemeRegistration;
137
+ };
138
+ }
139
+
168
140
  interface MarkdownPowerPluginOptions {
141
+ /**
142
+ * 是否启用 PDF 嵌入语法
143
+ *
144
+ * `@[pdf](pdf_url)`
145
+ *
146
+ * @default false
147
+ */
169
148
  pdf?: boolean | PDFOptions;
149
+ /**
150
+ * 是否启用 iconify 图标嵌入语法
151
+ *
152
+ * `:[collect:icon_name]:`
153
+ *
154
+ * @default false
155
+ */
170
156
  icons?: boolean | IconsOptions;
157
+ /**
158
+ * 是否启用 隐秘文本 语法
159
+ *
160
+ * `!!plot_content!!`
161
+ *
162
+ * @default false
163
+ */
171
164
  plot?: boolean | PlotOptions;
165
+ /**
166
+ * 是否启用 bilibili 视频嵌入
167
+ *
168
+ * `@[bilibili](bid)`
169
+ *
170
+ * @default false
171
+ */
172
172
  bilibili?: boolean;
173
+ /**
174
+ * 是否启用 youtube 视频嵌入
175
+ *
176
+ * `@[youtube](video_id)`
177
+ *
178
+ * @default false
179
+ */
173
180
  youtube?: boolean;
181
+ /**
182
+ * 是否启用 codepen 嵌入
183
+ *
184
+ * `@[codepen](pen_id)`
185
+ *
186
+ * @default false
187
+ */
174
188
  codepen?: boolean;
175
189
  /**
176
190
  * @deprecated
177
191
  */
178
192
  replit?: boolean;
193
+ /**
194
+ * 是否启用 codeSandbox 嵌入
195
+ *
196
+ * `@[codesandbox](codesandbox_id)`
197
+ *
198
+ * @default false
199
+ */
179
200
  codeSandbox?: boolean;
201
+ /**
202
+ * 是否启用 jsfiddle 嵌入
203
+ *
204
+ * `@[jsfiddle](jsfiddle_id)`
205
+ *
206
+ * @default false
207
+ */
180
208
  jsfiddle?: boolean;
209
+ /**
210
+ * 是否启用 REPL 容器语法
211
+ *
212
+ * @default false
213
+ */
181
214
  repl?: false | ReplOptions;
215
+ /**
216
+ * 是否启用 文件树 容器语法
217
+ *
218
+ * @default false
219
+ */
182
220
  fileTree?: boolean;
221
+ /**
222
+ * 是否启用 caniuse 嵌入语法
223
+ *
224
+ * `@[caniuse](feature_name)`
225
+ *
226
+ * @default false
227
+ */
183
228
  caniuse?: boolean | CanIUseOptions;
229
+ /**
230
+ * 是否启用 自动填充 图片宽高属性
231
+ *
232
+ * __请注意,无论是否启用,该功能仅在构建生产包时生效__
233
+ *
234
+ * - 如果为 `true` ,等同于 `'local'`
235
+ * - 如果为 `local`,则仅对本地图片 添加 width 和 height
236
+ * - 如果为 `all`,则对所有图片(即包括 本地 和 远程) 添加 width 和 height
237
+ *
238
+ * 图片在加载过程中如果比较慢,从加载到完成的过程会导致页面布局不稳定,导致内容闪烁等。
239
+ * 此功能通过给图片添加 `width` 和 `height` 属性来解决该问题。
240
+ *
241
+ * 请谨慎使用 `all` 选项,该选项会在构建阶段发起网络请求,尝试加载远程图片以获取图片尺寸信息,
242
+ * 这可能会导致 构建时间变得更长(幸运的是获取尺寸信息只需要加载图片 几 KB 的数据包,因此耗时不会过长)
243
+ *
244
+ * @default false
245
+ */
246
+ imageSize?: boolean | 'local' | 'all';
247
+ }
248
+
249
+ interface ReplitTokenMeta extends SizeOptions {
250
+ title?: string;
251
+ source?: string;
252
+ theme?: string;
253
+ }
254
+
255
+ interface VideoOptions {
256
+ bilibili?: boolean;
257
+ youtube?: boolean;
258
+ }
259
+ interface BilibiliTokenMeta extends SizeOptions {
260
+ title?: string;
261
+ bvid?: string;
262
+ aid?: string;
263
+ cid?: string;
264
+ autoplay?: boolean;
265
+ time?: string | number;
266
+ page?: number;
267
+ }
268
+ interface YoutubeTokenMeta extends SizeOptions {
269
+ title?: string;
270
+ id: string;
271
+ autoplay?: boolean;
272
+ loop?: boolean;
273
+ start?: string | number;
274
+ end?: string | number;
184
275
  }
185
276
 
186
277
  export type { BilibiliTokenMeta, CanIUseMode, CanIUseOptions, CanIUseTokenMeta, CodeSandboxTokenMeta, CodepenTokenMeta, IconsOptions, JSFiddleTokenMeta, MarkdownPowerPluginOptions, PDFEmbedType, PDFOptions, PDFTokenMeta, PlotOptions, ReplEditorData, ReplOptions, ReplitTokenMeta, SizeOptions, ThemeOptions, VideoOptions, YoutubeTokenMeta };
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.96",
4
+ "version": "1.0.0-rc.98",
5
5
  "description": "The Plugin for VuePress 2 - markdown power",
6
6
  "author": "pengzhanbo <volodymyr@foxmail.com>",
7
7
  "license": "MIT",
@@ -36,12 +36,13 @@
36
36
  "dependencies": {
37
37
  "@vuepress/helper": "2.0.0-rc.42",
38
38
  "@vueuse/core": "^11.0.3",
39
+ "image-size": "^1.1.1",
39
40
  "markdown-it-container": "^4.0.0",
40
41
  "nanoid": "^5.0.7",
41
- "shiki": "^1.16.2",
42
- "tm-grammars": "^1.17.16",
42
+ "shiki": "^1.17.0",
43
+ "tm-grammars": "^1.17.18",
43
44
  "tm-themes": "^1.8.1",
44
- "vue": "^3.5.2"
45
+ "vue": "^3.5.4"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@types/markdown-it": "^14.1.2"