@slidev/cli 0.48.0-beta.21 → 0.48.0-beta.23
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/dist/{build-LAWVABFK.mjs → build-PDGXAWGC.mjs} +2 -2
- package/dist/{chunk-NSAYO3FG.mjs → chunk-7IY2RRV6.mjs} +49 -37
- package/dist/{chunk-AUSTPPCJ.mjs → chunk-TKQ4IRDS.mjs} +1 -1
- package/dist/cli.mjs +57 -7
- package/dist/{export-QZQV5HQF.mjs → export-2XPAFE22.mjs} +37 -9
- package/dist/index.mjs +2 -2
- package/package.json +9 -8
- package/template.md +2 -2
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml,
|
|
4
4
|
mergeViteConfigs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7IY2RRV6.mjs";
|
|
6
6
|
import "./chunk-O6TYYGU6.mjs";
|
|
7
7
|
import "./chunk-CV7OWJOF.mjs";
|
|
8
8
|
|
|
@@ -62,7 +62,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
62
62
|
await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
63
63
|
`, "utf-8");
|
|
64
64
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
65
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
65
|
+
const { exportSlides, getExportOptions } = await import("./export-2XPAFE22.mjs");
|
|
66
66
|
const port = 12445;
|
|
67
67
|
const app = connect();
|
|
68
68
|
const server = http.createServer(app);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-CV7OWJOF.mjs";
|
|
8
8
|
|
|
9
9
|
// package.json
|
|
10
|
-
var version = "0.48.0-beta.
|
|
10
|
+
var version = "0.48.0-beta.23";
|
|
11
11
|
|
|
12
12
|
// node/common.ts
|
|
13
13
|
import { existsSync, promises as fs } from "node:fs";
|
|
@@ -146,7 +146,7 @@ import { uniq } from "@antfu/utils";
|
|
|
146
146
|
// ../client/package.json
|
|
147
147
|
var dependencies = {
|
|
148
148
|
"@antfu/utils": "^0.7.7",
|
|
149
|
-
"@iconify-json/carbon": "^1.1.
|
|
149
|
+
"@iconify-json/carbon": "^1.1.31",
|
|
150
150
|
"@iconify-json/ph": "^1.1.11",
|
|
151
151
|
"@iconify-json/svg-spinners": "^1.1.2",
|
|
152
152
|
"@shikijs/monaco": "^1.1.7",
|
|
@@ -155,7 +155,7 @@ var dependencies = {
|
|
|
155
155
|
"@slidev/rough-notation": "^0.1.0",
|
|
156
156
|
"@slidev/types": "workspace:*",
|
|
157
157
|
"@typescript/ata": "^0.9.4",
|
|
158
|
-
"@unhead/vue": "^1.8.
|
|
158
|
+
"@unhead/vue": "^1.8.11",
|
|
159
159
|
"@unocss/reset": "^0.58.5",
|
|
160
160
|
"@vueuse/core": "^10.9.0",
|
|
161
161
|
"@vueuse/math": "^10.9.0",
|
|
@@ -168,27 +168,35 @@ var dependencies = {
|
|
|
168
168
|
"js-yaml": "^4.1.0",
|
|
169
169
|
katex: "^0.16.9",
|
|
170
170
|
"lz-string": "^1.5.0",
|
|
171
|
-
mermaid: "^10.
|
|
171
|
+
mermaid: "^10.9.0",
|
|
172
172
|
"monaco-editor": "^0.46.0",
|
|
173
173
|
prettier: "^3.2.5",
|
|
174
174
|
recordrtc: "^5.6.2",
|
|
175
175
|
shiki: "^1.1.7",
|
|
176
|
-
"shiki-magic-move": "^0.
|
|
177
|
-
typescript: "^5.
|
|
176
|
+
"shiki-magic-move": "^0.3.4",
|
|
177
|
+
typescript: "^5.4.2",
|
|
178
178
|
unocss: "^0.58.5",
|
|
179
179
|
vue: "^3.4.21",
|
|
180
|
+
"vue-demi": "^0.14.7",
|
|
180
181
|
"vue-router": "^4.3.0"
|
|
181
182
|
};
|
|
182
183
|
|
|
183
184
|
// node/plugins/extendConfig.ts
|
|
184
185
|
var INCLUDE = [
|
|
185
186
|
...Object.keys(dependencies),
|
|
187
|
+
// CodeMirror
|
|
186
188
|
"codemirror/mode/javascript/javascript",
|
|
187
189
|
"codemirror/mode/css/css",
|
|
188
190
|
"codemirror/mode/markdown/markdown",
|
|
189
191
|
"codemirror/mode/xml/xml",
|
|
190
192
|
"codemirror/mode/htmlmixed/htmlmixed",
|
|
191
|
-
"codemirror/addon/display/placeholder"
|
|
193
|
+
"codemirror/addon/display/placeholder",
|
|
194
|
+
// Monaco
|
|
195
|
+
"monaco-editor/esm/vs/editor/standalone/browser/standaloneServices",
|
|
196
|
+
"monaco-editor/esm/vs/platform/contextview/browser/contextViewService",
|
|
197
|
+
"monaco-editor/esm/vs/platform/instantiation/common/descriptors",
|
|
198
|
+
// Others
|
|
199
|
+
"shiki-magic-move/vue"
|
|
192
200
|
];
|
|
193
201
|
var EXCLUDE = [
|
|
194
202
|
"@slidev/shared",
|
|
@@ -197,6 +205,7 @@ var EXCLUDE = [
|
|
|
197
205
|
"@slidev/client/constants",
|
|
198
206
|
"@slidev/client/logic/dark",
|
|
199
207
|
"@vueuse/core",
|
|
208
|
+
"@vueuse/math",
|
|
200
209
|
"@vueuse/shared",
|
|
201
210
|
"@unocss/reset",
|
|
202
211
|
"unocss",
|
|
@@ -458,7 +467,7 @@ function startsWithTodoMarkdown(token) {
|
|
|
458
467
|
// node/plugins/markdown.ts
|
|
459
468
|
import { encode as encodePlantUml } from "plantuml-encoder";
|
|
460
469
|
import Mdc from "markdown-it-mdc";
|
|
461
|
-
import { codeToKeyedTokens
|
|
470
|
+
import { codeToKeyedTokens } from "shiki-magic-move/core";
|
|
462
471
|
import mila from "markdown-it-link-attributes";
|
|
463
472
|
import mif from "markdown-it-footnote";
|
|
464
473
|
import lz from "lz-string";
|
|
@@ -941,6 +950,15 @@ function transformMarkdownMonaco(md2) {
|
|
|
941
950
|
return `<Monaco code-lz="${encoded}" lang="${lang}" v-bind="${options}" />`;
|
|
942
951
|
}
|
|
943
952
|
);
|
|
953
|
+
md2 = md2.replace(
|
|
954
|
+
/^```(\w+?)\s*{monaco-run}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg,
|
|
955
|
+
(full, lang = "ts", options = "{}", code) => {
|
|
956
|
+
lang = lang.trim();
|
|
957
|
+
options = options.trim() || "{}";
|
|
958
|
+
const encoded = lz.compressToBase64(code);
|
|
959
|
+
return `<Monaco runnable code-lz="${encoded}" lang="${lang}" v-bind="${options}" />`;
|
|
960
|
+
}
|
|
961
|
+
);
|
|
944
962
|
return md2;
|
|
945
963
|
}
|
|
946
964
|
function scanMonacoModules(md2) {
|
|
@@ -979,30 +997,26 @@ function transformSlotSugar(md2) {
|
|
|
979
997
|
lines[lines.length - 1] += "\n\n</template>";
|
|
980
998
|
return lines.join("\n");
|
|
981
999
|
}
|
|
982
|
-
var reMagicMoveBlock = /^````(?:md|markdown) magic-move(?:[ ]
|
|
1000
|
+
var reMagicMoveBlock = /^````(?:md|markdown) magic-move(?:[ ]*(\{.*?\})?([^\n]*?))?\n([\s\S]+?)^````$/mg;
|
|
983
1001
|
var reCodeBlock = /^```(\w+?)(?:\s*{([\d\w*,\|-]+)}\s*?({.*?})?(.*?))?\n([\s\S]+?)^```$/mg;
|
|
984
1002
|
function transformMagicMove(md2, shiki2, shikiOptions2) {
|
|
985
1003
|
return md2.replace(
|
|
986
1004
|
reMagicMoveBlock,
|
|
987
|
-
(full,
|
|
1005
|
+
(full, options = "{}", _attrs = "", body) => {
|
|
988
1006
|
if (!shiki2 || !shikiOptions2)
|
|
989
1007
|
throw new Error("Shiki is required for Magic Move. You may need to set `highlighter: shiki` in your Slidev config.");
|
|
990
1008
|
const matches = Array.from(body.matchAll(reCodeBlock));
|
|
991
1009
|
if (!matches.length)
|
|
992
1010
|
throw new Error("Magic Move block must contain at least one code block");
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
const lang = Array.from(langs)[0];
|
|
997
|
-
const magicMove = createMagicMoveMachine(
|
|
998
|
-
(code) => codeToKeyedTokens(shiki2, code, {
|
|
1011
|
+
const ranges = matches.map((i) => normalizeRangeStr(i[2]));
|
|
1012
|
+
const steps = matches.map(
|
|
1013
|
+
(i) => codeToKeyedTokens(shiki2, i[5].trimEnd(), {
|
|
999
1014
|
...shikiOptions2,
|
|
1000
|
-
lang
|
|
1015
|
+
lang: i[1]
|
|
1001
1016
|
})
|
|
1002
1017
|
);
|
|
1003
|
-
const steps = matches.map((i) => magicMove.commit((i[5] || "").trimEnd()));
|
|
1004
1018
|
const compressed = lz.compressToBase64(JSON.stringify(steps));
|
|
1005
|
-
return `<ShikiMagicMove steps-lz="${compressed}" />`;
|
|
1019
|
+
return `<ShikiMagicMove v-bind="${options}" steps-lz="${compressed}" :step-ranges='${JSON.stringify(ranges)}' />`;
|
|
1006
1020
|
}
|
|
1007
1021
|
);
|
|
1008
1022
|
}
|
|
@@ -1010,7 +1024,7 @@ function transformHighlighter(md2) {
|
|
|
1010
1024
|
return md2.replace(
|
|
1011
1025
|
reCodeBlock,
|
|
1012
1026
|
(full, lang = "", rangeStr = "", options = "", attrs = "", code) => {
|
|
1013
|
-
const ranges =
|
|
1027
|
+
const ranges = normalizeRangeStr(rangeStr);
|
|
1014
1028
|
code = code.trimEnd();
|
|
1015
1029
|
options = options.trim() || "{}";
|
|
1016
1030
|
return `
|
|
@@ -1024,6 +1038,9 @@ ${code}
|
|
|
1024
1038
|
}
|
|
1025
1039
|
);
|
|
1026
1040
|
}
|
|
1041
|
+
function normalizeRangeStr(rangeStr = "") {
|
|
1042
|
+
return !rangeStr.trim() ? [] : rangeStr.trim().split(/\|/g).map((i) => i.trim());
|
|
1043
|
+
}
|
|
1027
1044
|
function getCodeBlocks(md2) {
|
|
1028
1045
|
const codeblocks = Array.from(md2.matchAll(/^```[\s\S]*?^```/mg)).map((m) => {
|
|
1029
1046
|
const start = m.index;
|
|
@@ -1174,7 +1191,7 @@ function createSlidesLoader({ data, clientRoot, roots, remote, mode, userRoot },
|
|
|
1174
1191
|
if (!match)
|
|
1175
1192
|
return next();
|
|
1176
1193
|
const [, no, type] = match;
|
|
1177
|
-
const idx = Number.parseInt(no);
|
|
1194
|
+
const idx = Number.parseInt(no) - 1;
|
|
1178
1195
|
if (type === "json" && req.method === "GET") {
|
|
1179
1196
|
res.write(JSON.stringify(withRenderedNote(data.slides[idx])));
|
|
1180
1197
|
return res.end();
|
|
@@ -1221,7 +1238,7 @@ function createSlidesLoader({ data, clientRoot, roots, remote, mode, userRoot },
|
|
|
1221
1238
|
for (let i = 0; i < length; i++) {
|
|
1222
1239
|
const a = data.slides[i];
|
|
1223
1240
|
const b = newData.slides[i];
|
|
1224
|
-
if (a.content.trim() === b.content.trim() && a.title?.trim() === b.title?.trim() && equal(a.frontmatter, b.frontmatter) && Object.entries(a.snippetsUsed ?? {}).every(([file, oldContent]) => {
|
|
1241
|
+
if (!hmrPages.has(i) && a.content.trim() === b.content.trim() && a.title?.trim() === b.title?.trim() && equal(a.frontmatter, b.frontmatter) && Object.entries(a.snippetsUsed ?? {}).every(([file, oldContent]) => {
|
|
1225
1242
|
try {
|
|
1226
1243
|
const newContent = fs5.readFileSync(file, "utf-8");
|
|
1227
1244
|
return oldContent === newContent;
|
|
@@ -1233,7 +1250,7 @@ function createSlidesLoader({ data, clientRoot, roots, remote, mode, userRoot },
|
|
|
1233
1250
|
ctx.server.hot.send(
|
|
1234
1251
|
"slidev:update-note",
|
|
1235
1252
|
{
|
|
1236
|
-
|
|
1253
|
+
no: i + 1,
|
|
1237
1254
|
note: b.note || "",
|
|
1238
1255
|
noteHTML: renderNote(b.note || "")
|
|
1239
1256
|
}
|
|
@@ -1244,7 +1261,7 @@ function createSlidesLoader({ data, clientRoot, roots, remote, mode, userRoot },
|
|
|
1244
1261
|
ctx.server.hot.send(
|
|
1245
1262
|
"slidev:update-slide",
|
|
1246
1263
|
{
|
|
1247
|
-
|
|
1264
|
+
no: i + 1,
|
|
1248
1265
|
data: withRenderedNote(newData.slides[i])
|
|
1249
1266
|
}
|
|
1250
1267
|
);
|
|
@@ -1584,8 +1601,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
1584
1601
|
`import "${resolveUrlOfClient("styles/index.css")}"`,
|
|
1585
1602
|
`import "${resolveUrlOfClient("styles/code.css")}"`,
|
|
1586
1603
|
`import "${resolveUrlOfClient("styles/katex.css")}"`,
|
|
1587
|
-
`import "${resolveUrlOfClient("styles/transitions.css")}"
|
|
1588
|
-
`import "${resolveUrlOfClient("styles/monaco.css")}"`
|
|
1604
|
+
`import "${resolveUrlOfClient("styles/transitions.css")}"`
|
|
1589
1605
|
];
|
|
1590
1606
|
for (const root of roots) {
|
|
1591
1607
|
const styles = [
|
|
@@ -1630,7 +1646,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
1630
1646
|
result += `addFile(import(${JSON.stringify(url)}), ${JSON.stringify(file)})
|
|
1631
1647
|
`;
|
|
1632
1648
|
}
|
|
1633
|
-
const deps = data.config.monacoTypesAdditionalPackages;
|
|
1649
|
+
const deps = [...data.config.monacoTypesAdditionalPackages];
|
|
1634
1650
|
if (data.config.monacoTypesSource === "local")
|
|
1635
1651
|
deps.push(...scanMonacoModules(data.slides.map((s) => s.source.raw).join()));
|
|
1636
1652
|
function mapModuleNameToModule(moduleSpecifier) {
|
|
@@ -1697,16 +1713,11 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
|
|
|
1697
1713
|
`const data = [
|
|
1698
1714
|
${slides.join(",\n")}
|
|
1699
1715
|
]`,
|
|
1700
|
-
`
|
|
1701
|
-
`
|
|
1702
|
-
`export
|
|
1703
|
-
` oldRef = old`,
|
|
1704
|
-
` old.value = data`,
|
|
1705
|
-
`}`,
|
|
1716
|
+
`import.meta.hot.data.slides ??= shallowRef()`,
|
|
1717
|
+
`import.meta.hot.data.slides.value = data`,
|
|
1718
|
+
`export const slides = import.meta.hot.data.slides`,
|
|
1706
1719
|
`if (import.meta.hot) {`,
|
|
1707
|
-
` import.meta.hot.accept(
|
|
1708
|
-
` update(oldRef)`,
|
|
1709
|
-
` })`,
|
|
1720
|
+
` import.meta.hot.accept()`,
|
|
1710
1721
|
`}`
|
|
1711
1722
|
].join("\n");
|
|
1712
1723
|
}
|
|
@@ -2069,7 +2080,8 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
2069
2080
|
...remoteAssetsOptions
|
|
2070
2081
|
})) : null,
|
|
2071
2082
|
ServerRef({
|
|
2072
|
-
debug:
|
|
2083
|
+
debug: false,
|
|
2084
|
+
// process.env.NODE_ENV === 'development',
|
|
2073
2085
|
state: {
|
|
2074
2086
|
sync: false,
|
|
2075
2087
|
nav: {
|
package/dist/cli.mjs
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
resolveAddons,
|
|
6
6
|
resolveOptions,
|
|
7
7
|
resolveTheme
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TKQ4IRDS.mjs";
|
|
9
9
|
import {
|
|
10
10
|
version
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7IY2RRV6.mjs";
|
|
12
12
|
import {
|
|
13
13
|
loadSetups
|
|
14
14
|
} from "./chunk-O6TYYGU6.mjs";
|
|
@@ -42,6 +42,20 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
42
42
|
"editor",
|
|
43
43
|
"theme"
|
|
44
44
|
];
|
|
45
|
+
var FILES_CREATE_RESTART_GLOBS = [
|
|
46
|
+
"global-bottom.vue",
|
|
47
|
+
"global-top.vue",
|
|
48
|
+
"uno.config.js",
|
|
49
|
+
"uno.config.ts",
|
|
50
|
+
"unocss.config.js",
|
|
51
|
+
"unocss.config.ts"
|
|
52
|
+
];
|
|
53
|
+
var FILES_CHANGE_RESTART_GLOBS = [
|
|
54
|
+
"vite.config.*",
|
|
55
|
+
"setup/shiki.ts",
|
|
56
|
+
"setup/katex.ts",
|
|
57
|
+
"setup/preparser.ts"
|
|
58
|
+
];
|
|
45
59
|
injectPreparserExtensionLoader(async (headmatter, filepath, mode) => {
|
|
46
60
|
const addons = headmatter?.addons ?? [];
|
|
47
61
|
const { clientRoot, userRoot } = await getRoots();
|
|
@@ -96,6 +110,14 @@ cli.command(
|
|
|
96
110
|
let server;
|
|
97
111
|
let port = 3030;
|
|
98
112
|
let lastRemoteUrl;
|
|
113
|
+
let restartTimer;
|
|
114
|
+
function restartServer() {
|
|
115
|
+
clearTimeout(restartTimer);
|
|
116
|
+
restartTimer = setTimeout(() => {
|
|
117
|
+
console.log(yellow("\n restarting...\n"));
|
|
118
|
+
initServer();
|
|
119
|
+
}, 500);
|
|
120
|
+
}
|
|
99
121
|
async function initServer() {
|
|
100
122
|
if (server)
|
|
101
123
|
await server.close();
|
|
@@ -131,7 +153,7 @@ cli.command(
|
|
|
131
153
|
const themeRaw = theme || loaded.headmatter.theme || "default";
|
|
132
154
|
if (options.themeRaw !== themeRaw) {
|
|
133
155
|
console.log(yellow("\n restarting on theme change\n"));
|
|
134
|
-
|
|
156
|
+
restartServer();
|
|
135
157
|
return false;
|
|
136
158
|
}
|
|
137
159
|
const themeMeta = options.themeRoots[0] ? await getThemeMeta(themeRaw, options.themeRoots[0]) : void 0;
|
|
@@ -142,7 +164,7 @@ cli.command(
|
|
|
142
164
|
};
|
|
143
165
|
if (CONFIG_RESTART_FIELDS.some((i) => !equal(newData.config[i], oldData.config[i]))) {
|
|
144
166
|
console.log(yellow("\n restarting on config change\n"));
|
|
145
|
-
|
|
167
|
+
restartServer();
|
|
146
168
|
return false;
|
|
147
169
|
}
|
|
148
170
|
return newData;
|
|
@@ -248,6 +270,34 @@ ${dim(" Public IP: ")} ${blue(publicIp)}
|
|
|
248
270
|
}
|
|
249
271
|
initServer();
|
|
250
272
|
bindShortcut();
|
|
273
|
+
const { watch } = await import("chokidar");
|
|
274
|
+
const watcher = watch([
|
|
275
|
+
...FILES_CREATE_RESTART_GLOBS,
|
|
276
|
+
...FILES_CHANGE_RESTART_GLOBS
|
|
277
|
+
], {
|
|
278
|
+
ignored: ["node_modules", ".git"],
|
|
279
|
+
ignoreInitial: true
|
|
280
|
+
});
|
|
281
|
+
watcher.on("unlink", (file) => {
|
|
282
|
+
console.log(yellow(`
|
|
283
|
+
file ${file} removed, restarting...
|
|
284
|
+
`));
|
|
285
|
+
restartServer();
|
|
286
|
+
});
|
|
287
|
+
watcher.on("add", (file) => {
|
|
288
|
+
console.log(yellow(`
|
|
289
|
+
file ${file} added, restarting...
|
|
290
|
+
`));
|
|
291
|
+
restartServer();
|
|
292
|
+
});
|
|
293
|
+
watcher.on("change", (file) => {
|
|
294
|
+
if (FILES_CREATE_RESTART_GLOBS.includes(file))
|
|
295
|
+
return;
|
|
296
|
+
console.log(yellow(`
|
|
297
|
+
file ${file} changed, restarting...
|
|
298
|
+
`));
|
|
299
|
+
restartServer();
|
|
300
|
+
});
|
|
251
301
|
}
|
|
252
302
|
);
|
|
253
303
|
cli.command(
|
|
@@ -276,7 +326,7 @@ cli.command(
|
|
|
276
326
|
}).strict().help(),
|
|
277
327
|
async (args) => {
|
|
278
328
|
const { entry, theme, watch, base, download, out, inspect } = args;
|
|
279
|
-
const { build } = await import("./build-
|
|
329
|
+
const { build } = await import("./build-PDGXAWGC.mjs");
|
|
280
330
|
for (const entryFile of entry) {
|
|
281
331
|
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
282
332
|
if (download && !options.data.config.download)
|
|
@@ -351,7 +401,7 @@ cli.command(
|
|
|
351
401
|
(args) => exportOptions(commonOptions(args)).strict().help(),
|
|
352
402
|
async (args) => {
|
|
353
403
|
const { entry, theme } = args;
|
|
354
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
404
|
+
const { exportSlides, getExportOptions } = await import("./export-2XPAFE22.mjs");
|
|
355
405
|
const port = await getPort(12445);
|
|
356
406
|
for (const entryFile of entry) {
|
|
357
407
|
const options = await resolveOptions({ entry: entryFile, theme }, "export");
|
|
@@ -395,7 +445,7 @@ cli.command(
|
|
|
395
445
|
output,
|
|
396
446
|
timeout
|
|
397
447
|
}) => {
|
|
398
|
-
const { exportNotes } = await import("./export-
|
|
448
|
+
const { exportNotes } = await import("./export-2XPAFE22.mjs");
|
|
399
449
|
const port = await getPort(12445);
|
|
400
450
|
for (const entryFile of entry) {
|
|
401
451
|
const options = await resolveOptions({ entry: entryFile }, "export");
|
|
@@ -144,16 +144,44 @@ async function exportSlides({
|
|
|
144
144
|
});
|
|
145
145
|
await page.waitForLoadState("networkidle");
|
|
146
146
|
await page.emulateMedia({ colorScheme: dark ? "dark" : "light", media: "screen" });
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
{
|
|
148
|
+
const elements = page.locator(".slidev-slide-loading");
|
|
149
|
+
const count = await elements.count();
|
|
150
|
+
for (let index = 0; index < count; index++)
|
|
151
|
+
await elements.nth(index).waitFor({ state: "detached" });
|
|
152
|
+
}
|
|
153
|
+
{
|
|
154
|
+
const elements = page.locator("[data-waitfor]");
|
|
155
|
+
const count = await elements.count();
|
|
156
|
+
for (let index = 0; index < count; index++) {
|
|
157
|
+
const element = elements.nth(index);
|
|
158
|
+
const attribute = await element.getAttribute("data-waitfor");
|
|
159
|
+
if (attribute)
|
|
160
|
+
await element.locator(attribute).waitFor();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
{
|
|
164
|
+
const frames = page.frames();
|
|
165
|
+
await Promise.all(frames.map((frame) => frame.waitForLoadState()));
|
|
166
|
+
}
|
|
167
|
+
{
|
|
168
|
+
const container = page.locator("#mermaid-rendering-container");
|
|
169
|
+
while (true) {
|
|
170
|
+
const element = container.locator("div").first();
|
|
171
|
+
if (await element.count() === 0)
|
|
172
|
+
break;
|
|
173
|
+
await element.waitFor({ state: "detached" });
|
|
174
|
+
}
|
|
175
|
+
await container.evaluate((node) => node.style.display = "none");
|
|
176
|
+
}
|
|
177
|
+
{
|
|
178
|
+
const elements = page.locator(".monaco-aria-container");
|
|
179
|
+
const count = await elements.count();
|
|
180
|
+
for (let index = 0; index < count; index++) {
|
|
181
|
+
const element = elements.nth(index);
|
|
182
|
+
await element.evaluate((node) => node.style.display = "none");
|
|
183
|
+
}
|
|
154
184
|
}
|
|
155
|
-
const frames = page.frames();
|
|
156
|
-
await Promise.all(frames.map((frame) => frame.waitForLoadState()));
|
|
157
185
|
}
|
|
158
186
|
async function getSlidesIndex() {
|
|
159
187
|
const clicksBySlide = {};
|
package/dist/index.mjs
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
createServer,
|
|
3
3
|
parser,
|
|
4
4
|
resolveOptions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TKQ4IRDS.mjs";
|
|
6
6
|
import {
|
|
7
7
|
ViteSlidevPlugin
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7IY2RRV6.mjs";
|
|
9
9
|
import "./chunk-O6TYYGU6.mjs";
|
|
10
10
|
import "./chunk-CV7OWJOF.mjs";
|
|
11
11
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.48.0-beta.
|
|
3
|
+
"version": "0.48.0-beta.23",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@antfu/ni": "^0.21.12",
|
|
46
46
|
"@antfu/utils": "^0.7.7",
|
|
47
|
-
"@iconify-json/carbon": "^1.1.
|
|
47
|
+
"@iconify-json/carbon": "^1.1.31",
|
|
48
48
|
"@iconify-json/ph": "^1.1.11",
|
|
49
49
|
"@iconify-json/svg-spinners": "^1.1.2",
|
|
50
50
|
"@lillallol/outline-pdf": "^4.0.0",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"@unocss/reset": "^0.58.5",
|
|
56
56
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
57
57
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
58
|
+
"chokidar": "^3.6.0",
|
|
58
59
|
"cli-progress": "^3.12.0",
|
|
59
60
|
"codemirror": "^5.65.16",
|
|
60
61
|
"connect": "^3.7.0",
|
|
@@ -88,16 +89,16 @@
|
|
|
88
89
|
"resolve-global": "^2.0.0",
|
|
89
90
|
"semver": "^7.6.0",
|
|
90
91
|
"shiki": "^1.1.7",
|
|
91
|
-
"shiki-magic-move": "^0.
|
|
92
|
+
"shiki-magic-move": "^0.3.4",
|
|
92
93
|
"sirv": "^2.0.4",
|
|
93
|
-
"typescript": "^5.
|
|
94
|
+
"typescript": "^5.4.2",
|
|
94
95
|
"unocss": "^0.58.5",
|
|
95
96
|
"unplugin-icons": "^0.18.5",
|
|
96
97
|
"unplugin-vue-components": "^0.26.0",
|
|
97
98
|
"unplugin-vue-markdown": "^0.26.0",
|
|
98
99
|
"untun": "^0.1.3",
|
|
99
100
|
"uqr": "^0.1.2",
|
|
100
|
-
"vite": "^5.1.
|
|
101
|
+
"vite": "^5.1.5",
|
|
101
102
|
"vite-plugin-inspect": "^0.8.3",
|
|
102
103
|
"vite-plugin-remote-assets": "^0.4.1",
|
|
103
104
|
"vite-plugin-static-copy": "^1.0.1",
|
|
@@ -105,9 +106,9 @@
|
|
|
105
106
|
"vitefu": "^0.2.5",
|
|
106
107
|
"vue": "^3.4.21",
|
|
107
108
|
"yargs": "^17.7.2",
|
|
108
|
-
"@slidev/parser": "0.48.0-beta.
|
|
109
|
-
"@slidev/client": "0.48.0-beta.
|
|
110
|
-
"@slidev/types": "0.48.0-beta.
|
|
109
|
+
"@slidev/parser": "0.48.0-beta.23",
|
|
110
|
+
"@slidev/client": "0.48.0-beta.23",
|
|
111
|
+
"@slidev/types": "0.48.0-beta.23"
|
|
111
112
|
},
|
|
112
113
|
"devDependencies": {
|
|
113
114
|
"@hedgedoc/markdown-it-plugins": "^2.1.4",
|
package/template.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
theme: seriph
|
|
4
4
|
# random image from a curated Unsplash collection by Anthony
|
|
5
5
|
# like them? see https://unsplash.com/collections/94734566/slidev
|
|
6
|
-
background: https://
|
|
6
|
+
background: https://cover.sli.dev
|
|
7
7
|
# apply any unocss classes to the current slide
|
|
8
8
|
class: 'text-center'
|
|
9
9
|
# https://sli.dev/custom/highlighters.html
|
|
@@ -126,7 +126,7 @@ Hover on the bottom-left corner to see the navigation's controls panel, [learn m
|
|
|
126
126
|
|
|
127
127
|
---
|
|
128
128
|
layout: image-right
|
|
129
|
-
image: https://
|
|
129
|
+
image: https://cover.sli.dev
|
|
130
130
|
---
|
|
131
131
|
|
|
132
132
|
# Code
|