vuepress-plugin-md-power 1.0.0-rc.80 → 1.0.0-rc.82

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.
Files changed (93) hide show
  1. package/lib/client/components/CodeEditor.vue +4 -3
  2. package/lib/client/components/CodeSandbox.vue +1 -1
  3. package/lib/client/components/PDFViewer.vue +1 -1
  4. package/lib/client/components/Plot.vue +1 -1
  5. package/lib/client/components/Replit.vue +1 -1
  6. package/lib/client/composables/codeRepl.d.ts +7 -5
  7. package/lib/client/composables/codeRepl.js +253 -145
  8. package/lib/client/composables/pdf.d.ts +7 -3
  9. package/lib/client/composables/pdf.js +55 -81
  10. package/lib/client/composables/rustRepl.d.ts +3 -2
  11. package/lib/client/composables/rustRepl.js +96 -94
  12. package/lib/client/composables/size.d.ts +9 -5
  13. package/lib/client/composables/size.js +36 -44
  14. package/lib/client/index.js +2 -1
  15. package/lib/client/options.d.ts +5 -2
  16. package/lib/client/options.js +5 -1
  17. package/lib/client/utils/http.d.ts +3 -1
  18. package/lib/client/utils/http.js +24 -20
  19. package/lib/client/utils/is.d.ts +5 -3
  20. package/lib/client/utils/is.js +16 -10
  21. package/lib/client/utils/link.d.ts +3 -1
  22. package/lib/client/utils/link.js +8 -4
  23. package/lib/client/utils/sleep.d.ts +3 -1
  24. package/lib/client/utils/sleep.js +8 -4
  25. package/lib/node/index.d.ts +188 -2
  26. package/lib/node/index.js +847 -2
  27. package/lib/shared/index.d.ts +185 -10
  28. package/lib/shared/index.js +0 -10
  29. package/package.json +9 -9
  30. package/lib/node/features/caniuse.d.ts +0 -25
  31. package/lib/node/features/caniuse.js +0 -87
  32. package/lib/node/features/codeSandbox.d.ts +0 -7
  33. package/lib/node/features/codeSandbox.js +0 -29
  34. package/lib/node/features/codepen.d.ts +0 -7
  35. package/lib/node/features/codepen.js +0 -42
  36. package/lib/node/features/icons/index.d.ts +0 -2
  37. package/lib/node/features/icons/index.js +0 -2
  38. package/lib/node/features/icons/plugin.d.ts +0 -10
  39. package/lib/node/features/icons/plugin.js +0 -61
  40. package/lib/node/features/icons/writer.d.ts +0 -11
  41. package/lib/node/features/icons/writer.js +0 -126
  42. package/lib/node/features/jsfiddle.d.ts +0 -6
  43. package/lib/node/features/jsfiddle.js +0 -28
  44. package/lib/node/features/langRepl.d.ts +0 -4
  45. package/lib/node/features/langRepl.js +0 -59
  46. package/lib/node/features/pdf.d.ts +0 -2
  47. package/lib/node/features/pdf.js +0 -31
  48. package/lib/node/features/plot.d.ts +0 -5
  49. package/lib/node/features/plot.js +0 -48
  50. package/lib/node/features/replit.d.ts +0 -7
  51. package/lib/node/features/replit.js +0 -22
  52. package/lib/node/features/video/bilibili.d.ts +0 -2
  53. package/lib/node/features/video/bilibili.js +0 -58
  54. package/lib/node/features/video/youtube.d.ts +0 -2
  55. package/lib/node/features/video/youtube.js +0 -47
  56. package/lib/node/plugin.d.ts +0 -3
  57. package/lib/node/plugin.js +0 -80
  58. package/lib/node/prepareConfigFile.d.ts +0 -3
  59. package/lib/node/prepareConfigFile.js +0 -59
  60. package/lib/node/utils/createRuleBlock.d.ts +0 -18
  61. package/lib/node/utils/createRuleBlock.js +0 -34
  62. package/lib/node/utils/package.d.ts +0 -4
  63. package/lib/node/utils/package.js +0 -4
  64. package/lib/node/utils/parseRect.d.ts +0 -1
  65. package/lib/node/utils/parseRect.js +0 -5
  66. package/lib/node/utils/resolveAttrs.d.ts +0 -4
  67. package/lib/node/utils/resolveAttrs.js +0 -29
  68. package/lib/node/utils/timeToSeconds.d.ts +0 -1
  69. package/lib/node/utils/timeToSeconds.js +0 -8
  70. package/lib/shared/caniuse.d.ts +0 -18
  71. package/lib/shared/caniuse.js +0 -1
  72. package/lib/shared/codeSandbox.d.ts +0 -11
  73. package/lib/shared/codeSandbox.js +0 -1
  74. package/lib/shared/codepen.d.ts +0 -10
  75. package/lib/shared/codepen.js +0 -1
  76. package/lib/shared/icons.d.ts +0 -17
  77. package/lib/shared/icons.js +0 -1
  78. package/lib/shared/jsfiddle.d.ts +0 -8
  79. package/lib/shared/jsfiddle.js +0 -1
  80. package/lib/shared/pdf.d.ts +0 -15
  81. package/lib/shared/pdf.js +0 -1
  82. package/lib/shared/plot.d.ts +0 -27
  83. package/lib/shared/plot.js +0 -1
  84. package/lib/shared/plugin.d.ts +0 -21
  85. package/lib/shared/plugin.js +0 -1
  86. package/lib/shared/repl.d.ts +0 -22
  87. package/lib/shared/repl.js +0 -1
  88. package/lib/shared/replit.d.ts +0 -6
  89. package/lib/shared/replit.js +0 -1
  90. package/lib/shared/size.d.ts +0 -5
  91. package/lib/shared/size.js +0 -1
  92. package/lib/shared/video.d.ts +0 -22
  93. package/lib/shared/video.js +0 -1
@@ -1,2 +1,188 @@
1
- export * from './plugin.js';
2
- export * from '../shared/index.js';
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 };