vuepress-plugin-md-power 1.0.0-rc.150 → 1.0.0-rc.152
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/lib/client/composables/pdf.js +3 -3
- package/lib/node/index.d.ts +5 -0
- package/lib/node/index.js +12 -22
- package/lib/shared/index.d.ts +5 -0
- package/package.json +13 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ensureEndingSlash, isLinkHttp } from "vuepress/shared";
|
|
2
|
-
import {
|
|
2
|
+
import { isMobile, isSafari, isiPad } from "@vuepress/helper/client";
|
|
3
3
|
import { withBase } from "vuepress/client";
|
|
4
4
|
import { pluginOptions } from "../options.js";
|
|
5
5
|
|
|
@@ -38,8 +38,8 @@ function usePDF(el, url, options) {
|
|
|
38
38
|
const { navigator } = window;
|
|
39
39
|
const { userAgent } = navigator;
|
|
40
40
|
const isModernBrowser = typeof window.Promise === "function";
|
|
41
|
-
const isMobileDevice =
|
|
42
|
-
const isSafariDesktop = !isMobileDevice &&
|
|
41
|
+
const isMobileDevice = isiPad(userAgent) || isMobile(userAgent);
|
|
42
|
+
const isSafariDesktop = !isMobileDevice && isSafari(userAgent);
|
|
43
43
|
const isFirefoxWithPDFJS = !isMobileDevice && /firefox/iu.test(userAgent) && userAgent.split("rv:").length > 1 ? Number.parseInt(userAgent.split("rv:")[1].split(".")[0], 10) > 18 : false;
|
|
44
44
|
const supportsPDFs = !isMobileDevice && (isModernBrowser || isFirefoxWithPDFJS);
|
|
45
45
|
if (!url) return;
|
package/lib/node/index.d.ts
CHANGED
|
@@ -283,6 +283,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
283
283
|
* @default false
|
|
284
284
|
*/
|
|
285
285
|
pdf?: boolean | PDFOptions;
|
|
286
|
+
// new syntax
|
|
286
287
|
/**
|
|
287
288
|
* 是否启用 图标支持
|
|
288
289
|
* - iconify - `::collect:icon_name::` => `<VPIcon name="collect:icon_name" />`
|
|
@@ -365,6 +366,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
365
366
|
* @default false
|
|
366
367
|
*/
|
|
367
368
|
field?: boolean;
|
|
369
|
+
// video embed
|
|
368
370
|
/**
|
|
369
371
|
* 是否启用 bilibili 视频嵌入
|
|
370
372
|
*
|
|
@@ -393,6 +395,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
393
395
|
* `@[audioReader](url)`
|
|
394
396
|
*/
|
|
395
397
|
audioReader?: boolean;
|
|
398
|
+
// code embed
|
|
396
399
|
/**
|
|
397
400
|
* 是否启用 codepen 嵌入
|
|
398
401
|
*
|
|
@@ -421,6 +424,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
421
424
|
* @default false
|
|
422
425
|
*/
|
|
423
426
|
jsfiddle?: boolean;
|
|
427
|
+
// container
|
|
424
428
|
/**
|
|
425
429
|
* 是否启用 REPL 容器语法
|
|
426
430
|
*
|
|
@@ -459,6 +463,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
459
463
|
* @default false
|
|
460
464
|
*/
|
|
461
465
|
caniuse?: boolean | CanIUseOptions;
|
|
466
|
+
// enhance
|
|
462
467
|
/**
|
|
463
468
|
* 是否启用 自动填充 图片宽高属性
|
|
464
469
|
*
|
package/lib/node/index.js
CHANGED
|
@@ -3612,32 +3612,22 @@ const iconPlugin = (md, options = {}) => {
|
|
|
3612
3612
|
/**
|
|
3613
3613
|
* ::collect:icon_name =size /color::
|
|
3614
3614
|
*/
|
|
3615
|
-
md.inline.ruler.before(
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
58,
|
|
3622
|
-
58,
|
|
3623
|
-
58
|
|
3624
|
-
])
|
|
3625
|
-
);
|
|
3615
|
+
md.inline.ruler.before("link", "icon", createIconRule([
|
|
3616
|
+
58,
|
|
3617
|
+
58,
|
|
3618
|
+
58,
|
|
3619
|
+
58
|
|
3620
|
+
]));
|
|
3626
3621
|
/**
|
|
3627
3622
|
* :[collect:icon_name size/color]:
|
|
3628
3623
|
* @deprecated
|
|
3629
3624
|
*/
|
|
3630
|
-
md.inline.ruler.before(
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
91,
|
|
3637
|
-
93,
|
|
3638
|
-
58
|
|
3639
|
-
], true)
|
|
3640
|
-
);
|
|
3625
|
+
md.inline.ruler.before("link", "icon_deprecated", createIconRule([
|
|
3626
|
+
58,
|
|
3627
|
+
91,
|
|
3628
|
+
93,
|
|
3629
|
+
58
|
|
3630
|
+
], true));
|
|
3641
3631
|
md.renderer.rules.icon = (tokens, idx, _, env) => {
|
|
3642
3632
|
const { content, meta } = tokens[idx];
|
|
3643
3633
|
let icon = content;
|
package/lib/shared/index.d.ts
CHANGED
|
@@ -281,6 +281,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
281
281
|
* @default false
|
|
282
282
|
*/
|
|
283
283
|
pdf?: boolean | PDFOptions;
|
|
284
|
+
// new syntax
|
|
284
285
|
/**
|
|
285
286
|
* 是否启用 图标支持
|
|
286
287
|
* - iconify - `::collect:icon_name::` => `<VPIcon name="collect:icon_name" />`
|
|
@@ -363,6 +364,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
363
364
|
* @default false
|
|
364
365
|
*/
|
|
365
366
|
field?: boolean;
|
|
367
|
+
// video embed
|
|
366
368
|
/**
|
|
367
369
|
* 是否启用 bilibili 视频嵌入
|
|
368
370
|
*
|
|
@@ -391,6 +393,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
391
393
|
* `@[audioReader](url)`
|
|
392
394
|
*/
|
|
393
395
|
audioReader?: boolean;
|
|
396
|
+
// code embed
|
|
394
397
|
/**
|
|
395
398
|
* 是否启用 codepen 嵌入
|
|
396
399
|
*
|
|
@@ -419,6 +422,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
419
422
|
* @default false
|
|
420
423
|
*/
|
|
421
424
|
jsfiddle?: boolean;
|
|
425
|
+
// container
|
|
422
426
|
/**
|
|
423
427
|
* 是否启用 REPL 容器语法
|
|
424
428
|
*
|
|
@@ -457,6 +461,7 @@ interface MarkdownPowerPluginOptions {
|
|
|
457
461
|
* @default false
|
|
458
462
|
*/
|
|
459
463
|
caniuse?: boolean | CanIUseOptions;
|
|
464
|
+
// enhance
|
|
460
465
|
/**
|
|
461
466
|
* 是否启用 自动填充 图片宽高属性
|
|
462
467
|
*
|
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.152",
|
|
5
5
|
"description": "The Plugin for VuePress 2 - markdown power",
|
|
6
6
|
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"artplayer": "^5.2.3",
|
|
35
35
|
"dashjs": "^5.0.2",
|
|
36
|
-
"esbuild": "^0.25.
|
|
36
|
+
"esbuild": "^0.25.5",
|
|
37
37
|
"hls.js": "^1.6.2",
|
|
38
38
|
"less": "^4.3.0",
|
|
39
39
|
"markdown-it": "^14.1.0",
|
|
@@ -61,16 +61,16 @@
|
|
|
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.
|
|
64
|
+
"@mdit/plugin-attrs": "^0.19.0",
|
|
65
|
+
"@mdit/plugin-footnote": "^0.19.0",
|
|
66
|
+
"@mdit/plugin-mark": "^0.19.0",
|
|
67
|
+
"@mdit/plugin-sub": "^0.19.0",
|
|
68
|
+
"@mdit/plugin-sup": "^0.19.0",
|
|
69
|
+
"@mdit/plugin-tab": "^0.19.0",
|
|
70
|
+
"@mdit/plugin-tasklist": "^0.19.0",
|
|
71
71
|
"@pengzhanbo/utils": "^2.1.0",
|
|
72
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
73
|
-
"@vueuse/core": "^13.
|
|
72
|
+
"@vuepress/helper": "2.0.0-rc.106",
|
|
73
|
+
"@vueuse/core": "^13.3.0",
|
|
74
74
|
"chokidar": "3.6.0",
|
|
75
75
|
"image-size": "^2.0.2",
|
|
76
76
|
"local-pkg": "^1.1.1",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"nanoid": "^5.1.5",
|
|
80
80
|
"shiki": "^3.4.2",
|
|
81
81
|
"tinyglobby": "0.2.13",
|
|
82
|
-
"tm-grammars": "^1.23.
|
|
82
|
+
"tm-grammars": "^1.23.24",
|
|
83
83
|
"tm-themes": "^1.10.6",
|
|
84
|
-
"vue": "^3.5.
|
|
84
|
+
"vue": "^3.5.15"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/markdown-it": "^14.1.2",
|