vuepress-plugin-md-power 1.0.0-rc.79 → 1.0.0-rc.81
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/components/CodeSandbox.vue +1 -1
- package/lib/client/components/PDFViewer.vue +1 -1
- package/lib/client/components/Plot.vue +1 -1
- package/lib/client/components/Replit.vue +1 -1
- package/lib/client/composables/codeRepl.d.ts +7 -5
- package/lib/client/composables/codeRepl.js +253 -145
- package/lib/client/composables/pdf.d.ts +7 -3
- package/lib/client/composables/pdf.js +55 -81
- package/lib/client/composables/rustRepl.d.ts +3 -2
- package/lib/client/composables/rustRepl.js +96 -94
- package/lib/client/composables/size.d.ts +9 -5
- package/lib/client/composables/size.js +36 -44
- package/lib/client/index.js +2 -1
- package/lib/client/options.d.ts +5 -2
- package/lib/client/options.js +5 -1
- package/lib/client/utils/http.d.ts +3 -1
- package/lib/client/utils/http.js +24 -20
- package/lib/client/utils/is.d.ts +5 -3
- package/lib/client/utils/is.js +16 -10
- package/lib/client/utils/link.d.ts +3 -1
- package/lib/client/utils/link.js +8 -4
- package/lib/client/utils/sleep.d.ts +3 -1
- package/lib/client/utils/sleep.js +8 -4
- package/lib/node/index.d.ts +188 -2
- package/lib/node/index.js +833 -2
- package/lib/shared/index.d.ts +185 -10
- package/lib/shared/index.js +0 -10
- package/package.json +5 -5
- package/lib/node/features/caniuse.d.ts +0 -25
- package/lib/node/features/caniuse.js +0 -87
- package/lib/node/features/codeSandbox.d.ts +0 -7
- package/lib/node/features/codeSandbox.js +0 -29
- package/lib/node/features/codepen.d.ts +0 -7
- package/lib/node/features/codepen.js +0 -42
- package/lib/node/features/icons/index.d.ts +0 -2
- package/lib/node/features/icons/index.js +0 -2
- package/lib/node/features/icons/plugin.d.ts +0 -10
- package/lib/node/features/icons/plugin.js +0 -61
- package/lib/node/features/icons/writer.d.ts +0 -11
- package/lib/node/features/icons/writer.js +0 -126
- package/lib/node/features/jsfiddle.d.ts +0 -6
- package/lib/node/features/jsfiddle.js +0 -28
- package/lib/node/features/langRepl.d.ts +0 -4
- package/lib/node/features/langRepl.js +0 -59
- package/lib/node/features/pdf.d.ts +0 -2
- package/lib/node/features/pdf.js +0 -31
- package/lib/node/features/plot.d.ts +0 -5
- package/lib/node/features/plot.js +0 -48
- package/lib/node/features/replit.d.ts +0 -7
- package/lib/node/features/replit.js +0 -22
- package/lib/node/features/video/bilibili.d.ts +0 -2
- package/lib/node/features/video/bilibili.js +0 -58
- package/lib/node/features/video/youtube.d.ts +0 -2
- package/lib/node/features/video/youtube.js +0 -47
- package/lib/node/plugin.d.ts +0 -3
- package/lib/node/plugin.js +0 -80
- package/lib/node/prepareConfigFile.d.ts +0 -3
- package/lib/node/prepareConfigFile.js +0 -59
- package/lib/node/utils/createRuleBlock.d.ts +0 -18
- package/lib/node/utils/createRuleBlock.js +0 -34
- package/lib/node/utils/package.d.ts +0 -4
- package/lib/node/utils/package.js +0 -4
- package/lib/node/utils/parseRect.d.ts +0 -1
- package/lib/node/utils/parseRect.js +0 -5
- package/lib/node/utils/resolveAttrs.d.ts +0 -4
- package/lib/node/utils/resolveAttrs.js +0 -29
- package/lib/node/utils/timeToSeconds.d.ts +0 -1
- package/lib/node/utils/timeToSeconds.js +0 -8
- package/lib/shared/caniuse.d.ts +0 -18
- package/lib/shared/caniuse.js +0 -1
- package/lib/shared/codeSandbox.d.ts +0 -11
- package/lib/shared/codeSandbox.js +0 -1
- package/lib/shared/codepen.d.ts +0 -10
- package/lib/shared/codepen.js +0 -1
- package/lib/shared/icons.d.ts +0 -17
- package/lib/shared/icons.js +0 -1
- package/lib/shared/jsfiddle.d.ts +0 -8
- package/lib/shared/jsfiddle.js +0 -1
- package/lib/shared/pdf.d.ts +0 -15
- package/lib/shared/pdf.js +0 -1
- package/lib/shared/plot.d.ts +0 -27
- package/lib/shared/plot.js +0 -1
- package/lib/shared/plugin.d.ts +0 -21
- package/lib/shared/plugin.js +0 -1
- package/lib/shared/repl.d.ts +0 -22
- package/lib/shared/repl.js +0 -1
- package/lib/shared/replit.d.ts +0 -6
- package/lib/shared/replit.js +0 -1
- package/lib/shared/size.d.ts +0 -5
- package/lib/shared/size.js +0 -1
- package/lib/shared/video.d.ts +0 -22
- package/lib/shared/video.js +0 -1
|
@@ -1,102 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
stderr: 'output/execute/wsExecuteStderr',
|
|
15
|
-
stdout: 'output/execute/wsExecuteStdout',
|
|
16
|
-
end: 'output/execute/wsExecuteEnd',
|
|
17
|
-
},
|
|
1
|
+
// src/client/composables/rustRepl.ts
|
|
2
|
+
import { tryOnScopeDispose } from "@vueuse/core";
|
|
3
|
+
var wsUrl = "wss://play.rust-lang.org/websocket";
|
|
4
|
+
var payloadType = {
|
|
5
|
+
connected: "websocket/connected",
|
|
6
|
+
request: "output/execute/wsExecuteRequest",
|
|
7
|
+
execute: {
|
|
8
|
+
begin: "output/execute/wsExecuteBegin",
|
|
9
|
+
// status: 'output/execute/wsExecuteStatus',
|
|
10
|
+
stderr: "output/execute/wsExecuteStderr",
|
|
11
|
+
stdout: "output/execute/wsExecuteStdout",
|
|
12
|
+
end: "output/execute/wsExecuteEnd"
|
|
13
|
+
}
|
|
18
14
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
var ws = null;
|
|
16
|
+
var isOpen = false;
|
|
17
|
+
var uuid = 0;
|
|
22
18
|
function connect() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
ws?.
|
|
45
|
-
|
|
19
|
+
if (isOpen)
|
|
20
|
+
return Promise.resolve();
|
|
21
|
+
ws = new WebSocket(wsUrl);
|
|
22
|
+
uuid = 0;
|
|
23
|
+
ws.addEventListener("open", () => {
|
|
24
|
+
isOpen = true;
|
|
25
|
+
send(
|
|
26
|
+
payloadType.connected,
|
|
27
|
+
{ iAcceptThisIsAnUnsupportedApi: true },
|
|
28
|
+
{ websocket: true, sequenceNumber: uuid }
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
ws.addEventListener("close", () => {
|
|
32
|
+
isOpen = false;
|
|
33
|
+
ws = null;
|
|
34
|
+
});
|
|
35
|
+
tryOnScopeDispose(() => ws?.close());
|
|
36
|
+
return new Promise((resolve) => {
|
|
37
|
+
function connected(e) {
|
|
38
|
+
const data = JSON.parse(e.data);
|
|
39
|
+
if (data.type === payloadType.connected) {
|
|
40
|
+
ws?.removeEventListener("message", connected);
|
|
41
|
+
resolve();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
ws?.addEventListener("message", connected);
|
|
45
|
+
});
|
|
46
46
|
}
|
|
47
47
|
function send(type, payload, meta) {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const msg = { type, meta, payload };
|
|
49
|
+
ws?.send(JSON.stringify(msg));
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
onStderr?.(stderr);
|
|
90
|
-
}
|
|
91
|
-
stderr = '';
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
if (type === payloadType.execute.end) {
|
|
95
|
-
if (payload.success === false)
|
|
96
|
-
onError?.(payload.exitDetail);
|
|
97
|
-
ws?.removeEventListener('message', onMessage);
|
|
98
|
-
onEnd?.();
|
|
51
|
+
async function rustExecute(code, { onEnd, onError, onStderr, onStdout, onBegin }) {
|
|
52
|
+
await connect();
|
|
53
|
+
const meta = { sequenceNumber: uuid++ };
|
|
54
|
+
const payload = {
|
|
55
|
+
backtrace: false,
|
|
56
|
+
channel: "stable",
|
|
57
|
+
crateType: "bin",
|
|
58
|
+
edition: "2021",
|
|
59
|
+
mode: "release",
|
|
60
|
+
tests: false,
|
|
61
|
+
code
|
|
62
|
+
};
|
|
63
|
+
send(payloadType.request, payload, meta);
|
|
64
|
+
let stdout = "";
|
|
65
|
+
let stderr = "";
|
|
66
|
+
function onMessage(e) {
|
|
67
|
+
const data = JSON.parse(e.data);
|
|
68
|
+
const { type, payload: payload2, meta: _meta = {} } = data;
|
|
69
|
+
if (_meta.sequenceNumber !== meta.sequenceNumber)
|
|
70
|
+
return;
|
|
71
|
+
if (type === payloadType.execute.begin)
|
|
72
|
+
onBegin?.();
|
|
73
|
+
if (type === payloadType.execute.stdout) {
|
|
74
|
+
stdout += payload2;
|
|
75
|
+
if (stdout.endsWith("\n")) {
|
|
76
|
+
onStdout?.(stdout);
|
|
77
|
+
stdout = "";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (type === payloadType.execute.stderr) {
|
|
81
|
+
stderr += payload2;
|
|
82
|
+
if (stderr.endsWith("\n")) {
|
|
83
|
+
if (stderr.startsWith("error:")) {
|
|
84
|
+
const index = stderr.indexOf("\n");
|
|
85
|
+
onStderr?.(stderr.slice(0, index));
|
|
86
|
+
onStderr?.(stderr.slice(index + 1));
|
|
87
|
+
} else {
|
|
88
|
+
onStderr?.(stderr);
|
|
99
89
|
}
|
|
90
|
+
stderr = "";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (type === payloadType.execute.end) {
|
|
94
|
+
if (payload2.success === false)
|
|
95
|
+
onError?.(payload2.exitDetail);
|
|
96
|
+
ws?.removeEventListener("message", onMessage);
|
|
97
|
+
onEnd?.();
|
|
100
98
|
}
|
|
101
|
-
|
|
99
|
+
}
|
|
100
|
+
ws?.addEventListener("message", onMessage);
|
|
102
101
|
}
|
|
102
|
+
export {
|
|
103
|
+
rustExecute
|
|
104
|
+
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { MaybeRef } from '@vueuse/core';
|
|
2
|
+
import { ShallowRef, Ref, ToRefs } from 'vue';
|
|
3
|
+
import { SizeOptions } from '../../shared/index.js';
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* Fork for https://github.com/vuepress-theme-hope/vuepress-theme-hope/blob/main/packages/components/src/client/composables/useSize.ts
|
|
3
7
|
*
|
|
@@ -10,13 +14,13 @@
|
|
|
10
14
|
*
|
|
11
15
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
12
16
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import type { SizeOptions } from '../../shared/size.js';
|
|
16
|
-
export interface SizeInfo<T extends HTMLElement> {
|
|
17
|
+
|
|
18
|
+
interface SizeInfo<T extends HTMLElement> {
|
|
17
19
|
el: ShallowRef<T | undefined>;
|
|
18
20
|
width: Ref<string>;
|
|
19
21
|
height: Ref<string>;
|
|
20
22
|
resize: () => void;
|
|
21
23
|
}
|
|
22
|
-
|
|
24
|
+
declare function useSize<T extends HTMLElement>(options: ToRefs<SizeOptions>, extraHeight?: MaybeRef<number>): SizeInfo<T>;
|
|
25
|
+
|
|
26
|
+
export { type SizeInfo, useSize };
|
|
@@ -1,45 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (el.value)
|
|
35
|
-
height.value = getHeight(el.value.offsetWidth);
|
|
36
|
-
};
|
|
37
|
-
onMounted(() => {
|
|
38
|
-
resize();
|
|
39
|
-
if (isRef(extraHeight))
|
|
40
|
-
watch(extraHeight, resize);
|
|
41
|
-
useEventListener('orientationchange', resize);
|
|
42
|
-
useEventListener('resize', resize);
|
|
43
|
-
});
|
|
44
|
-
return { el, width, height, resize };
|
|
1
|
+
// src/client/composables/size.ts
|
|
2
|
+
import { useEventListener } from "@vueuse/core";
|
|
3
|
+
import { computed, isRef, onMounted, ref, shallowRef, toValue, watch } from "vue";
|
|
4
|
+
function useSize(options, extraHeight = 0) {
|
|
5
|
+
const el = shallowRef();
|
|
6
|
+
const width = computed(() => toValue(options.width) || "100%");
|
|
7
|
+
const height = ref("auto");
|
|
8
|
+
const getRadio = (ratio) => {
|
|
9
|
+
if (typeof ratio === "string") {
|
|
10
|
+
const [width2, height2] = ratio.split(":");
|
|
11
|
+
const parsedRadio = Number(width2) / Number(height2);
|
|
12
|
+
if (!Number.isNaN(parsedRadio))
|
|
13
|
+
return parsedRadio;
|
|
14
|
+
}
|
|
15
|
+
return typeof ratio === "number" ? ratio : 16 / 9;
|
|
16
|
+
};
|
|
17
|
+
const getHeight = (width2) => {
|
|
18
|
+
const height2 = toValue(options.height);
|
|
19
|
+
const ratio = getRadio(toValue(options.ratio));
|
|
20
|
+
return height2 || `${Number(width2) / ratio + toValue(extraHeight)}px`;
|
|
21
|
+
};
|
|
22
|
+
const resize = () => {
|
|
23
|
+
if (el.value)
|
|
24
|
+
height.value = getHeight(el.value.offsetWidth);
|
|
25
|
+
};
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
resize();
|
|
28
|
+
if (isRef(extraHeight))
|
|
29
|
+
watch(extraHeight, resize);
|
|
30
|
+
useEventListener("orientationchange", resize);
|
|
31
|
+
useEventListener("resize", resize);
|
|
32
|
+
});
|
|
33
|
+
return { el, width, height, resize };
|
|
45
34
|
}
|
|
35
|
+
export {
|
|
36
|
+
useSize
|
|
37
|
+
};
|
package/lib/client/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
// src/client/index.ts
|
|
2
|
+
export * from "../shared/index.js";
|
package/lib/client/options.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { MarkdownPowerPluginOptions } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
declare const pluginOptions: MarkdownPowerPluginOptions;
|
|
4
|
+
|
|
5
|
+
export { pluginOptions };
|
package/lib/client/options.js
CHANGED
package/lib/client/utils/http.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
// src/client/utils/http.ts
|
|
2
|
+
var http = {
|
|
3
|
+
get: async (url, query) => {
|
|
4
|
+
const _url = new URL(url);
|
|
5
|
+
if (query) {
|
|
6
|
+
for (const [key, value] of Object.entries(query))
|
|
7
|
+
_url.searchParams.append(key, value);
|
|
8
|
+
}
|
|
9
|
+
const res = await fetch(_url.toString());
|
|
10
|
+
return await res.json();
|
|
11
|
+
},
|
|
12
|
+
post: async (url, data) => {
|
|
13
|
+
const res = await fetch(url, {
|
|
14
|
+
method: "POST",
|
|
15
|
+
headers: {
|
|
16
|
+
"Content-Type": "application/json"
|
|
17
|
+
},
|
|
18
|
+
body: data ? JSON.stringify(data) : void 0
|
|
19
|
+
});
|
|
20
|
+
return await res.json();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
http
|
|
21
25
|
};
|
package/lib/client/utils/is.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
declare function checkIsMobile(ua: string): boolean;
|
|
2
|
+
declare function checkIsSafari(ua: string): boolean;
|
|
3
|
+
declare function checkIsiPad(ua: string): boolean;
|
|
4
|
+
|
|
5
|
+
export { checkIsMobile, checkIsSafari, checkIsiPad };
|
package/lib/client/utils/is.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/client/utils/is.ts
|
|
2
|
+
function checkIsMobile(ua) {
|
|
3
|
+
return /\b(?:Android|iPhone)/i.test(ua);
|
|
3
4
|
}
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
function checkIsSafari(ua) {
|
|
6
|
+
return /version\/[\w.]+ .*(?:mobile ?safari|safari)/i.test(ua);
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
function checkIsiPad(ua) {
|
|
9
|
+
return [
|
|
10
|
+
/\((ipad);[-\w),; ]+apple/i,
|
|
11
|
+
/applecoremedia\/[\w.]+ \((ipad)/i,
|
|
12
|
+
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
|
|
13
|
+
].some((item) => item.test(ua));
|
|
13
14
|
}
|
|
15
|
+
export {
|
|
16
|
+
checkIsMobile,
|
|
17
|
+
checkIsSafari,
|
|
18
|
+
checkIsiPad
|
|
19
|
+
};
|
package/lib/client/utils/link.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// src/client/utils/link.ts
|
|
2
|
+
import { isLinkHttp } from "vuepress/shared";
|
|
3
|
+
import { withBase } from "vuepress/client";
|
|
4
|
+
function normalizeLink(url) {
|
|
5
|
+
return isLinkHttp(url) ? url : withBase(url);
|
|
5
6
|
}
|
|
7
|
+
export {
|
|
8
|
+
normalizeLink
|
|
9
|
+
};
|
package/lib/node/index.d.ts
CHANGED
|
@@ -1,2 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Plugin } from 'vuepress/core';
|
|
2
|
+
import { BuiltinTheme, ThemeRegistration } from 'shiki';
|
|
3
|
+
|
|
4
|
+
type CanIUseMode = 'embed' | 'image';
|
|
5
|
+
interface CanIUseTokenMeta {
|
|
6
|
+
feature: string;
|
|
7
|
+
mode: CanIUseMode;
|
|
8
|
+
versions: string;
|
|
9
|
+
}
|
|
10
|
+
interface CanIUseOptions {
|
|
11
|
+
/**
|
|
12
|
+
* 嵌入模式
|
|
13
|
+
*
|
|
14
|
+
* embed 通过iframe嵌入,提供可交互视图
|
|
15
|
+
*
|
|
16
|
+
* image 通过图片嵌入,静态
|
|
17
|
+
*
|
|
18
|
+
* @default 'embed'
|
|
19
|
+
*/
|
|
20
|
+
mode?: CanIUseMode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface SizeOptions {
|
|
24
|
+
width?: string;
|
|
25
|
+
height?: string;
|
|
26
|
+
ratio?: number | string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type PDFEmbedType = 'iframe' | 'embed' | 'pdfjs';
|
|
30
|
+
interface PDFTokenMeta extends SizeOptions {
|
|
31
|
+
page?: number;
|
|
32
|
+
noToolbar?: boolean;
|
|
33
|
+
zoom?: number;
|
|
34
|
+
src?: string;
|
|
35
|
+
title?: string;
|
|
36
|
+
}
|
|
37
|
+
interface PDFOptions {
|
|
38
|
+
/**
|
|
39
|
+
* pdfjs url
|
|
40
|
+
*/
|
|
41
|
+
pdfjsUrl?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface IconsOptions {
|
|
45
|
+
/**
|
|
46
|
+
* The prefix of the icon className
|
|
47
|
+
* @default 'vp-mdi'
|
|
48
|
+
*/
|
|
49
|
+
prefix?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The size of the icon
|
|
52
|
+
* @default '1em'
|
|
53
|
+
*/
|
|
54
|
+
size?: string | number;
|
|
55
|
+
/**
|
|
56
|
+
* The color of the icon
|
|
57
|
+
* @default 'currentColor'
|
|
58
|
+
*/
|
|
59
|
+
color?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface VideoOptions {
|
|
63
|
+
bilibili?: boolean;
|
|
64
|
+
youtube?: boolean;
|
|
65
|
+
}
|
|
66
|
+
interface BilibiliTokenMeta extends SizeOptions {
|
|
67
|
+
title?: string;
|
|
68
|
+
bvid?: string;
|
|
69
|
+
aid?: string;
|
|
70
|
+
cid?: string;
|
|
71
|
+
autoplay?: boolean;
|
|
72
|
+
time?: string | number;
|
|
73
|
+
page?: number;
|
|
74
|
+
}
|
|
75
|
+
interface YoutubeTokenMeta extends SizeOptions {
|
|
76
|
+
title?: string;
|
|
77
|
+
id: string;
|
|
78
|
+
autoplay?: boolean;
|
|
79
|
+
loop?: boolean;
|
|
80
|
+
start?: string | number;
|
|
81
|
+
end?: string | number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface CodepenTokenMeta extends SizeOptions {
|
|
85
|
+
title?: string;
|
|
86
|
+
user?: string;
|
|
87
|
+
slash?: string;
|
|
88
|
+
tab?: string;
|
|
89
|
+
theme?: string;
|
|
90
|
+
preview?: boolean;
|
|
91
|
+
editable?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface CodeSandboxTokenMeta extends SizeOptions {
|
|
95
|
+
user?: string;
|
|
96
|
+
id?: string;
|
|
97
|
+
layout?: string;
|
|
98
|
+
type?: 'button' | 'embed';
|
|
99
|
+
title?: string;
|
|
100
|
+
filepath?: string;
|
|
101
|
+
navbar?: boolean;
|
|
102
|
+
console?: boolean;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
type ThemeOptions = BuiltinTheme | {
|
|
106
|
+
light: BuiltinTheme;
|
|
107
|
+
dark: BuiltinTheme;
|
|
108
|
+
};
|
|
109
|
+
interface ReplOptions {
|
|
110
|
+
theme?: ThemeOptions;
|
|
111
|
+
go?: boolean;
|
|
112
|
+
kotlin?: boolean;
|
|
113
|
+
rust?: boolean;
|
|
114
|
+
}
|
|
115
|
+
interface ReplEditorData {
|
|
116
|
+
grammars: {
|
|
117
|
+
go?: any;
|
|
118
|
+
kotlin?: any;
|
|
119
|
+
rust?: any;
|
|
120
|
+
};
|
|
121
|
+
theme: ThemeRegistration | {
|
|
122
|
+
light: ThemeRegistration;
|
|
123
|
+
dark: ThemeRegistration;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface ReplitTokenMeta extends SizeOptions {
|
|
128
|
+
title?: string;
|
|
129
|
+
source?: string;
|
|
130
|
+
theme?: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface JSFiddleTokenMeta extends SizeOptions {
|
|
134
|
+
user?: string;
|
|
135
|
+
id?: string;
|
|
136
|
+
title?: string;
|
|
137
|
+
theme?: string;
|
|
138
|
+
tab?: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
interface PlotOptions {
|
|
142
|
+
/**
|
|
143
|
+
* 是否启用 `=| |=` markdown (该标记为非标准标记,脱离插件将不生效)
|
|
144
|
+
* @default true
|
|
145
|
+
*/
|
|
146
|
+
tag?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* 遮罩层颜色
|
|
149
|
+
*/
|
|
150
|
+
mask?: string | {
|
|
151
|
+
light: string;
|
|
152
|
+
dark: string;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* 文本颜色
|
|
156
|
+
*/
|
|
157
|
+
color?: string | {
|
|
158
|
+
light: string;
|
|
159
|
+
dark: string;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* 触发方式
|
|
163
|
+
*
|
|
164
|
+
* @default 'hover'
|
|
165
|
+
*/
|
|
166
|
+
trigger?: 'hover' | 'click';
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
interface MarkdownPowerPluginOptions {
|
|
170
|
+
pdf?: boolean | PDFOptions;
|
|
171
|
+
icons?: boolean | IconsOptions;
|
|
172
|
+
plot?: boolean | PlotOptions;
|
|
173
|
+
bilibili?: boolean;
|
|
174
|
+
youtube?: boolean;
|
|
175
|
+
codepen?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated
|
|
178
|
+
*/
|
|
179
|
+
replit?: boolean;
|
|
180
|
+
codeSandbox?: boolean;
|
|
181
|
+
jsfiddle?: boolean;
|
|
182
|
+
repl?: false | ReplOptions;
|
|
183
|
+
caniuse?: boolean | CanIUseOptions;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
declare function markdownPowerPlugin(options?: MarkdownPowerPluginOptions): Plugin;
|
|
187
|
+
|
|
188
|
+
export { type BilibiliTokenMeta, type CanIUseMode, type CanIUseOptions, type CanIUseTokenMeta, type CodeSandboxTokenMeta, type CodepenTokenMeta, type IconsOptions, type JSFiddleTokenMeta, type MarkdownPowerPluginOptions, type PDFEmbedType, type PDFOptions, type PDFTokenMeta, type PlotOptions, type ReplEditorData, type ReplOptions, type ReplitTokenMeta, type SizeOptions, type ThemeOptions, type VideoOptions, type YoutubeTokenMeta, markdownPowerPlugin };
|