@slidev/cli 0.30.1 → 0.31.1
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-SSLWFRFJ.mjs → build-6XVXRYOT.mjs} +5 -4
- package/dist/{build-MOXNSJPP.js → build-WXX7THGM.js} +13 -12
- package/dist/chunk-6URMXVHV.mjs +12685 -0
- package/dist/{chunk-XMETW2MS.mjs → chunk-D6ZT4BYV.mjs} +47 -2
- package/dist/{chunk-HBDQZUZK.js → chunk-DQJN3MWP.js} +4 -4
- package/dist/chunk-IIMPX7JQ.js +12693 -0
- package/dist/{chunk-IXNT7VMK.js → chunk-OVW2G2MH.js} +47 -6
- package/dist/{chunk-4AVLCCHB.mjs → chunk-SJH4ZSSX.mjs} +41 -16
- package/dist/{chunk-46RYGQQC.mjs → chunk-T33EPP2B.mjs} +2 -2
- package/dist/{chunk-7FQD47HM.js → chunk-W64GQHIH.js} +96 -71
- package/dist/cli.js +26 -26
- package/dist/cli.mjs +7 -7
- package/dist/{export-2FIFRI4R.mjs → export-7O4RPYTW.mjs} +22 -14
- package/dist/{export-X3EA2DO6.js → export-HDUCFTTI.js} +25 -17
- package/dist/index.js +7 -7
- package/dist/index.mjs +4 -4
- package/package.json +19 -20
- package/dist/chunk-3GNNQ2GU.js +0 -13313
- package/dist/chunk-HJCTB5CG.mjs +0 -13313
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkOVW2G2MHjs = require('./chunk-OVW2G2MH.js');
|
|
14
14
|
|
|
15
15
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
16
|
-
var require_fast_deep_equal =
|
|
16
|
+
var require_fast_deep_equal = _chunkOVW2G2MHjs.__commonJS.call(void 0, {
|
|
17
17
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
18
18
|
"use strict";
|
|
19
|
-
|
|
19
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
20
20
|
module.exports = function equal2(a, b) {
|
|
21
21
|
if (a === b)
|
|
22
22
|
return true;
|
|
@@ -59,7 +59,7 @@ var require_fast_deep_equal = _chunkIXNT7VMKjs.__commonJS.call(void 0, {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// node/common.ts
|
|
62
|
-
|
|
62
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
63
63
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
64
64
|
var _path = require('path');
|
|
65
65
|
var _utils = require('@antfu/utils');
|
|
@@ -87,13 +87,13 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
|
|
|
87
87
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
|
|
88
88
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
89
89
|
head += `
|
|
90
|
-
<link rel="stylesheet" href="${
|
|
91
|
-
main = main.replace("__ENTRY__",
|
|
90
|
+
<link rel="stylesheet" href="${_chunkOVW2G2MHjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunkOVW2G2MHjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
92
92
|
return main;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// node/plugins/windicss.ts
|
|
96
|
-
|
|
96
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
|
|
@@ -101,13 +101,13 @@ var _vitepluginwindicss = require('vite-plugin-windicss'); var _vitepluginwindic
|
|
|
101
101
|
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
102
102
|
|
|
103
103
|
// node/plugins/setupNode.ts
|
|
104
|
-
|
|
104
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
105
105
|
|
|
106
106
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
function deepMerge(a, b, rootPath = "") {
|
|
110
|
-
a =
|
|
110
|
+
a = _chunkOVW2G2MHjs.__spreadValues.call(void 0, {}, a);
|
|
111
111
|
Object.keys(b).forEach((key) => {
|
|
112
112
|
if (_utils.isObject.call(void 0, a[key]))
|
|
113
113
|
a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
|
|
@@ -145,7 +145,7 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
145
145
|
if (config.default)
|
|
146
146
|
config = config.default;
|
|
147
147
|
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
148
|
-
return _vitepluginwindicss2.default.call(void 0,
|
|
148
|
+
return _vitepluginwindicss2.default.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
149
149
|
configFiles: [configFile],
|
|
150
150
|
config,
|
|
151
151
|
onConfigResolved(config2) {
|
|
@@ -167,15 +167,15 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
167
167
|
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
168
168
|
});
|
|
169
169
|
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
170
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
171
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
172
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
170
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkOVW2G2MHjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
171
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkOVW2G2MHjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
172
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkOVW2G2MHjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
173
173
|
}
|
|
174
174
|
}, windiOptions));
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
// node/plugins/preset.ts
|
|
178
|
-
|
|
178
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
179
179
|
var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
|
|
180
180
|
var _vite = require('unplugin-icons/vite'); var _vite2 = _interopRequireDefault(_vite);
|
|
181
181
|
var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
|
|
@@ -185,7 +185,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
|
|
|
185
185
|
|
|
186
186
|
|
|
187
187
|
// node/drawings.ts
|
|
188
|
-
|
|
188
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
189
189
|
|
|
190
190
|
|
|
191
191
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -231,7 +231,7 @@ ${value}
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
// node/plugins/extendConfig.ts
|
|
234
|
-
|
|
234
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
235
235
|
|
|
236
236
|
var _vite5 = require('vite');
|
|
237
237
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
@@ -242,31 +242,31 @@ var dependencies = {
|
|
|
242
242
|
"@antfu/utils": "^0.5.1",
|
|
243
243
|
"@slidev/parser": "workspace:*",
|
|
244
244
|
"@slidev/types": "workspace:*",
|
|
245
|
-
"@vueuse/core": "^8.
|
|
246
|
-
"@vueuse/head": "^0.7.
|
|
245
|
+
"@vueuse/core": "^8.4.1",
|
|
246
|
+
"@vueuse/head": "^0.7.6",
|
|
247
247
|
"@vueuse/motion": "^2.0.0-beta.18",
|
|
248
|
-
codemirror: "^5.65.
|
|
248
|
+
codemirror: "^5.65.3",
|
|
249
249
|
defu: "^6.0.0",
|
|
250
250
|
drauu: "^0.3.0",
|
|
251
251
|
"file-saver": "^2.0.5",
|
|
252
252
|
"js-base64": "^3.7.2",
|
|
253
253
|
"js-yaml": "^4.1.0",
|
|
254
254
|
katex: "^0.15.3",
|
|
255
|
-
mermaid: "^9.0.
|
|
255
|
+
mermaid: "^9.0.1",
|
|
256
256
|
"monaco-editor": "^0.33.0",
|
|
257
|
-
nanoid: "^3.3.
|
|
257
|
+
nanoid: "^3.3.4",
|
|
258
258
|
prettier: "^2.6.2",
|
|
259
259
|
recordrtc: "^5.6.2",
|
|
260
260
|
resolve: "^1.22.0",
|
|
261
261
|
"vite-plugin-windicss": "^1.8.4",
|
|
262
|
-
vue: "^3.2.
|
|
263
|
-
"vue-router": "^4.0.
|
|
264
|
-
"vue-starport": "^0.2.
|
|
262
|
+
vue: "^3.2.33",
|
|
263
|
+
"vue-router": "^4.0.15",
|
|
264
|
+
"vue-starport": "^0.2.10",
|
|
265
265
|
windicss: "^3.5.1"
|
|
266
266
|
};
|
|
267
267
|
|
|
268
268
|
// node/vite/searchRoot.ts
|
|
269
|
-
|
|
269
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
270
270
|
|
|
271
271
|
|
|
272
272
|
var ROOT_FILES = [
|
|
@@ -326,7 +326,7 @@ function createConfigPlugin(options) {
|
|
|
326
326
|
define: getDefine(options),
|
|
327
327
|
resolve: {
|
|
328
328
|
alias: {
|
|
329
|
-
"@slidev/client/": `${
|
|
329
|
+
"@slidev/client/": `${_chunkOVW2G2MHjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
330
330
|
}
|
|
331
331
|
},
|
|
332
332
|
optimizeDeps: {
|
|
@@ -353,7 +353,7 @@ function createConfigPlugin(options) {
|
|
|
353
353
|
allow: _utils.uniq.call(void 0, [
|
|
354
354
|
searchForWorkspaceRoot(options.userRoot),
|
|
355
355
|
searchForWorkspaceRoot(options.cliRoot),
|
|
356
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
356
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkOVW2G2MHjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkOVW2G2MHjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
357
357
|
])
|
|
358
358
|
}
|
|
359
359
|
}
|
|
@@ -362,7 +362,7 @@ function createConfigPlugin(options) {
|
|
|
362
362
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
363
363
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
364
364
|
injection.root = options.cliRoot;
|
|
365
|
-
injection.resolve.alias.vue = `${
|
|
365
|
+
injection.resolve.alias.vue = `${_chunkOVW2G2MHjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
366
366
|
}
|
|
367
367
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
368
368
|
},
|
|
@@ -383,17 +383,18 @@ function createConfigPlugin(options) {
|
|
|
383
383
|
}
|
|
384
384
|
function getDefine(options) {
|
|
385
385
|
return {
|
|
386
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
386
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkOVW2G2MHjs.toAtFS.call(void 0, options.clientRoot)),
|
|
387
387
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
388
388
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
389
389
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
390
|
+
__SLIDEV_FEATURE_RECORD__: JSON.stringify(options.data.config.record === true || options.data.config.record === options.mode),
|
|
390
391
|
__DEV__: options.mode === "dev" ? "true" : "false"
|
|
391
392
|
};
|
|
392
393
|
}
|
|
393
394
|
|
|
394
395
|
// node/plugins/loaders.ts
|
|
395
|
-
|
|
396
|
-
var import_fast_deep_equal =
|
|
396
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
397
|
+
var import_fast_deep_equal = _chunkOVW2G2MHjs.__toESM.call(void 0, require_fast_deep_equal());
|
|
397
398
|
|
|
398
399
|
|
|
399
400
|
|
|
@@ -425,7 +426,7 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
425
426
|
}
|
|
426
427
|
});
|
|
427
428
|
function prepareSlideInfo(data) {
|
|
428
|
-
return
|
|
429
|
+
return _chunkOVW2G2MHjs.__spreadProps.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {}, data), {
|
|
429
430
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
430
431
|
});
|
|
431
432
|
}
|
|
@@ -471,7 +472,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
471
472
|
});
|
|
472
473
|
},
|
|
473
474
|
async handleHotUpdate(ctx) {
|
|
474
|
-
var _a;
|
|
475
|
+
var _a, _b, _c;
|
|
475
476
|
if (!data.entries.some((i) => _utils.slash.call(void 0, i) === ctx.file))
|
|
476
477
|
return;
|
|
477
478
|
const newData = await parser.load(entry, data.themeMeta);
|
|
@@ -495,7 +496,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
495
496
|
for (let i = 0; i < length; i++) {
|
|
496
497
|
const a = data.slides[i];
|
|
497
498
|
const b = newData.slides[i];
|
|
498
|
-
if ((a == null ? void 0 : a.content.trim()) === (b == null ? void 0 : b.content.trim()) && (a == null ? void 0 : a.note) === (b == null ? void 0 : b.note) && (0, import_fast_deep_equal.default)(a.frontmatter, b.frontmatter))
|
|
499
|
+
if ((a == null ? void 0 : a.content.trim()) === (b == null ? void 0 : b.content.trim()) && ((_a = a == null ? void 0 : a.title) == null ? void 0 : _a.trim()) === ((_b = b == null ? void 0 : b.title) == null ? void 0 : _b.trim()) && (a == null ? void 0 : a.note) === (b == null ? void 0 : b.note) && (0, import_fast_deep_equal.default)(a.frontmatter, b.frontmatter))
|
|
499
500
|
continue;
|
|
500
501
|
ctx.server.ws.send({
|
|
501
502
|
type: "custom",
|
|
@@ -507,14 +508,16 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
507
508
|
});
|
|
508
509
|
hmrPages.add(i);
|
|
509
510
|
}
|
|
510
|
-
(
|
|
511
|
+
(_c = serverOptions.onDataReload) == null ? void 0 : _c.call(serverOptions, newData, data);
|
|
511
512
|
Object.assign(data, newData);
|
|
513
|
+
if (hmrPages.size > 0)
|
|
514
|
+
moduleIds.add("/@slidev/titles.md");
|
|
512
515
|
const vueModules = (await Promise.all(Array.from(hmrPages).map(async (i) => {
|
|
513
516
|
var _a2;
|
|
514
517
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
515
518
|
try {
|
|
516
|
-
const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
517
|
-
return await VuePlugin.handleHotUpdate(
|
|
519
|
+
const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
520
|
+
return await VuePlugin.handleHotUpdate(_chunkOVW2G2MHjs.__spreadProps.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {}, ctx), {
|
|
518
521
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
519
522
|
file,
|
|
520
523
|
read() {
|
|
@@ -558,6 +561,14 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
558
561
|
return generateGlobalComponents("bottom");
|
|
559
562
|
if (id === "/@slidev/custom-nav-controls")
|
|
560
563
|
return generateCustomNavControls();
|
|
564
|
+
if (id === "/@slidev/titles.md") {
|
|
565
|
+
return {
|
|
566
|
+
code: data.slides.map(({ title }, i) => {
|
|
567
|
+
return `<template ${i === 0 ? "v-if" : "v-else-if"}="+no === ${i + 1}">${title}</template>`;
|
|
568
|
+
}).join(""),
|
|
569
|
+
map: {}
|
|
570
|
+
};
|
|
571
|
+
}
|
|
561
572
|
if (id.startsWith(slidePrefix)) {
|
|
562
573
|
const remaning = id.slice(slidePrefix.length);
|
|
563
574
|
const match = remaning.match(regexIdQuery);
|
|
@@ -603,6 +614,15 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
603
614
|
return;
|
|
604
615
|
return transformVue(code);
|
|
605
616
|
}
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
name: "slidev:title-transform:pre",
|
|
620
|
+
enforce: "pre",
|
|
621
|
+
transform(code, id) {
|
|
622
|
+
if (id !== "/@slidev/titles.md")
|
|
623
|
+
return;
|
|
624
|
+
return transformTitles(code);
|
|
625
|
+
}
|
|
606
626
|
}
|
|
607
627
|
];
|
|
608
628
|
function updateServerWatcher() {
|
|
@@ -614,14 +634,14 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
614
634
|
async function transformMarkdown(code, pageNo, data2) {
|
|
615
635
|
var _a, _b;
|
|
616
636
|
const layouts = await getLayouts();
|
|
617
|
-
const frontmatter =
|
|
637
|
+
const frontmatter = _chunkOVW2G2MHjs.__spreadValues.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
618
638
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
619
639
|
if (!layouts[layoutName])
|
|
620
640
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
621
641
|
delete frontmatter.title;
|
|
622
642
|
const imports = [
|
|
623
643
|
'import { inject as vueInject } from "vue"',
|
|
624
|
-
`import InjectedLayout from "${
|
|
644
|
+
`import InjectedLayout from "${_chunkOVW2G2MHjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
625
645
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
626
646
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
627
647
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -693,6 +713,10 @@ ${code.slice(injectIndex)}`;
|
|
|
693
713
|
${imports.join("\n")}
|
|
694
714
|
<\/script>
|
|
695
715
|
${code}`;
|
|
716
|
+
}
|
|
717
|
+
function transformTitles(code) {
|
|
718
|
+
return code.replace(/<template>\s*<div>\s*<p>/, "<template>").replace(/<\/p>\s*<\/div>\s*<\/template>/, "</template>").replace(/<script\ssetup>/, `<script setup lang="ts">
|
|
719
|
+
defineProps<{ no: number | string }>()`);
|
|
696
720
|
}
|
|
697
721
|
async function getLayouts() {
|
|
698
722
|
const now = Date.now();
|
|
@@ -722,9 +746,9 @@ ${code}`;
|
|
|
722
746
|
}
|
|
723
747
|
async function generateUserStyles() {
|
|
724
748
|
const imports = [
|
|
725
|
-
`import "${
|
|
726
|
-
`import "${
|
|
727
|
-
`import "${
|
|
749
|
+
`import "${_chunkOVW2G2MHjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
750
|
+
`import "${_chunkOVW2G2MHjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
751
|
+
`import "${_chunkOVW2G2MHjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
728
752
|
];
|
|
729
753
|
const roots2 = _utils.uniq.call(void 0, [
|
|
730
754
|
...themeRoots,
|
|
@@ -740,13 +764,13 @@ ${code}`;
|
|
|
740
764
|
];
|
|
741
765
|
for (const style of styles) {
|
|
742
766
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
743
|
-
imports.push(`import "${
|
|
767
|
+
imports.push(`import "${_chunkOVW2G2MHjs.toAtFS.call(void 0, style)}"`);
|
|
744
768
|
continue;
|
|
745
769
|
}
|
|
746
770
|
}
|
|
747
771
|
}
|
|
748
772
|
if (data.features.katex)
|
|
749
|
-
imports.push(`import "${
|
|
773
|
+
imports.push(`import "${_chunkOVW2G2MHjs.toAtFS.call(void 0, _chunkOVW2G2MHjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
750
774
|
return imports.join("\n");
|
|
751
775
|
}
|
|
752
776
|
async function generateMonacoTypes() {
|
|
@@ -755,7 +779,7 @@ ${code}`;
|
|
|
755
779
|
async function generateLayouts() {
|
|
756
780
|
const imports = [];
|
|
757
781
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
758
|
-
imports.push(`import __layout_${k} from "${
|
|
782
|
+
imports.push(`import __layout_${k} from "${_chunkOVW2G2MHjs.toAtFS.call(void 0, v)}"`);
|
|
759
783
|
return [k, `__layout_${k}`];
|
|
760
784
|
});
|
|
761
785
|
return [
|
|
@@ -772,7 +796,7 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
|
|
|
772
796
|
let no = 1;
|
|
773
797
|
const routes = [
|
|
774
798
|
...data.slides.map((i, idx) => {
|
|
775
|
-
var _a, _b;
|
|
799
|
+
var _a, _b, _c, _d;
|
|
776
800
|
if ((_a = i.frontmatter) == null ? void 0 : _a.disabled)
|
|
777
801
|
return void 0;
|
|
778
802
|
imports.push(`import n${no} from '${slidePrefix}${idx + 1}.md'`);
|
|
@@ -792,9 +816,10 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
|
|
|
792
816
|
};
|
|
793
817
|
const meta = Object.assign({}, i.frontmatter, additions);
|
|
794
818
|
const route = `{ path: '${no}', name: 'page-${no}', component: n${no}, meta: ${JSON.stringify(meta)} }`;
|
|
819
|
+
const redirect = ((_c = i.frontmatter) == null ? void 0 : _c.routeAlias) ? `{ path: '${(_d = i.frontmatter) == null ? void 0 : _d.routeAlias}', redirect: { path: '${no}' } }` : null;
|
|
795
820
|
no += 1;
|
|
796
|
-
return route;
|
|
797
|
-
}).filter(_utils.notNullish),
|
|
821
|
+
return [route, redirect];
|
|
822
|
+
}).flat().filter(_utils.notNullish),
|
|
798
823
|
`{ path: "${no}", component: __layout__end, meta: { layout: "end" } }`
|
|
799
824
|
];
|
|
800
825
|
const routesStr = `export default [
|
|
@@ -803,10 +828,10 @@ ${routes.join(",\n")}
|
|
|
803
828
|
return [...imports, routesStr].join("\n");
|
|
804
829
|
}
|
|
805
830
|
function generateConfigs() {
|
|
806
|
-
const config =
|
|
831
|
+
const config = _chunkOVW2G2MHjs.__spreadValues.call(void 0, {}, data.config);
|
|
807
832
|
if (_utils.isString.call(void 0, config.title)) {
|
|
808
833
|
const tokens = md.parseInline(config.title, {});
|
|
809
|
-
config.title =
|
|
834
|
+
config.title = _chunkOVW2G2MHjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
810
835
|
}
|
|
811
836
|
if (_utils.isString.call(void 0, config.info))
|
|
812
837
|
config.info = md.render(config.info);
|
|
@@ -827,7 +852,7 @@ ${routes.join(",\n")}
|
|
|
827
852
|
];
|
|
828
853
|
}
|
|
829
854
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
830
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
855
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkOVW2G2MHjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
831
856
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
832
857
|
return `
|
|
833
858
|
${imports}
|
|
@@ -846,7 +871,7 @@ export default {
|
|
|
846
871
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
847
872
|
];
|
|
848
873
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
849
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
874
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkOVW2G2MHjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
850
875
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
851
876
|
return `
|
|
852
877
|
${imports}
|
|
@@ -861,7 +886,7 @@ export default {
|
|
|
861
886
|
}
|
|
862
887
|
|
|
863
888
|
// node/plugins/monacoTransform.ts
|
|
864
|
-
|
|
889
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
865
890
|
|
|
866
891
|
|
|
867
892
|
|
|
@@ -895,7 +920,7 @@ function createMonacoTypesLoader() {
|
|
|
895
920
|
}
|
|
896
921
|
|
|
897
922
|
// node/plugins/setupClient.ts
|
|
898
|
-
|
|
923
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
899
924
|
|
|
900
925
|
|
|
901
926
|
|
|
@@ -917,7 +942,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
917
942
|
setups.forEach((path, idx) => {
|
|
918
943
|
if (!_fs.existsSync.call(void 0, path))
|
|
919
944
|
return;
|
|
920
|
-
imports.push(`import __n${idx} from '${
|
|
945
|
+
imports.push(`import __n${idx} from '${_chunkOVW2G2MHjs.toAtFS.call(void 0, path)}'`);
|
|
921
946
|
let fn = `__n${idx}`;
|
|
922
947
|
let awaitFn = `await __n${idx}`;
|
|
923
948
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -945,7 +970,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
945
970
|
}
|
|
946
971
|
|
|
947
972
|
// node/plugins/markdown.ts
|
|
948
|
-
|
|
973
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
949
974
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
950
975
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
951
976
|
|
|
@@ -955,7 +980,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
955
980
|
var _plantumlencoder = require('plantuml-encoder');
|
|
956
981
|
|
|
957
982
|
// node/plugins/markdown-it-katex.ts
|
|
958
|
-
|
|
983
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
959
984
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
960
985
|
function isValidDelim(state, pos) {
|
|
961
986
|
const max = state.posMax;
|
|
@@ -1102,7 +1127,7 @@ function math_plugin(md2, options) {
|
|
|
1102
1127
|
}
|
|
1103
1128
|
|
|
1104
1129
|
// node/plugins/markdown-it-prism.ts
|
|
1105
|
-
|
|
1130
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
1106
1131
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1107
1132
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1108
1133
|
var DEFAULTS = {
|
|
@@ -1125,7 +1150,7 @@ function loadPrismLang(lang) {
|
|
|
1125
1150
|
}
|
|
1126
1151
|
function loadPrismPlugin(name) {
|
|
1127
1152
|
try {
|
|
1128
|
-
|
|
1153
|
+
_chunkOVW2G2MHjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1129
1154
|
} catch (e) {
|
|
1130
1155
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1131
1156
|
}
|
|
@@ -1165,7 +1190,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1165
1190
|
}
|
|
1166
1191
|
|
|
1167
1192
|
// node/plugins/markdown-it-shiki.ts
|
|
1168
|
-
|
|
1193
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
1169
1194
|
function getThemeName(theme) {
|
|
1170
1195
|
if (typeof theme === "string")
|
|
1171
1196
|
return theme;
|
|
@@ -1187,7 +1212,7 @@ function resolveShikiOptions(options) {
|
|
|
1187
1212
|
themes.push(options.theme);
|
|
1188
1213
|
}
|
|
1189
1214
|
}
|
|
1190
|
-
return
|
|
1215
|
+
return _chunkOVW2G2MHjs.__spreadProps.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {}, options), {
|
|
1191
1216
|
themes,
|
|
1192
1217
|
darkModeThemes: darkModeThemes ? {
|
|
1193
1218
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1225,7 +1250,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1225
1250
|
const setups = [];
|
|
1226
1251
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1227
1252
|
if (config.highlighter === "shiki") {
|
|
1228
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1253
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkOVW2G2MHjs.__toESM.call(void 0, _chunkOVW2G2MHjs.__require.call(void 0, "shiki")));
|
|
1229
1254
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1230
1255
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1231
1256
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1234,11 +1259,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1234
1259
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1235
1260
|
}
|
|
1236
1261
|
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1237
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1262
|
+
return _vitepluginmd2.default.call(void 0, _chunkOVW2G2MHjs.__spreadProps.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
1238
1263
|
wrapperClasses: "",
|
|
1239
1264
|
headEnabled: false,
|
|
1240
1265
|
frontmatter: false,
|
|
1241
|
-
markdownItOptions:
|
|
1266
|
+
markdownItOptions: _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
1242
1267
|
quotes: `""''`,
|
|
1243
1268
|
html: true,
|
|
1244
1269
|
xhtmlOut: true,
|
|
@@ -1374,7 +1399,7 @@ function escapeVueInCode(md2) {
|
|
|
1374
1399
|
}
|
|
1375
1400
|
|
|
1376
1401
|
// node/plugins/patchTransform.ts
|
|
1377
|
-
|
|
1402
|
+
_chunkOVW2G2MHjs.init_cjs_shims.call(void 0, );
|
|
1378
1403
|
|
|
1379
1404
|
function createFixPlugins(options) {
|
|
1380
1405
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1438,10 +1463,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1438
1463
|
clientRoot,
|
|
1439
1464
|
data: { config }
|
|
1440
1465
|
} = options;
|
|
1441
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1466
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
1442
1467
|
include: [/\.vue$/, /\.md$/],
|
|
1443
1468
|
exclude: [],
|
|
1444
|
-
template:
|
|
1469
|
+
template: _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
1445
1470
|
compilerOptions: {
|
|
1446
1471
|
isCustomElement(tag) {
|
|
1447
1472
|
return customElements.has(tag);
|
|
@@ -1456,7 +1481,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1456
1481
|
MarkdownPlugin,
|
|
1457
1482
|
VuePlugin,
|
|
1458
1483
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1459
|
-
_vite4.default.call(void 0,
|
|
1484
|
+
_vite4.default.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
1460
1485
|
extensions: ["vue", "md", "ts"],
|
|
1461
1486
|
dirs: [
|
|
1462
1487
|
`${clientRoot}/builtin`,
|
|
@@ -1474,11 +1499,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1474
1499
|
})
|
|
1475
1500
|
]
|
|
1476
1501
|
}, componentsOptions)),
|
|
1477
|
-
_vite2.default.call(void 0,
|
|
1502
|
+
_vite2.default.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
1478
1503
|
defaultClass: "slidev-icon",
|
|
1479
1504
|
autoInstall: true
|
|
1480
1505
|
}, iconsOptions)),
|
|
1481
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1506
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
1482
1507
|
rules: [
|
|
1483
1508
|
..._vitepluginremoteassets.DefaultRules,
|
|
1484
1509
|
{
|
|
@@ -1491,7 +1516,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1491
1516
|
}, remoteAssetsOptions)) : null,
|
|
1492
1517
|
_vitepluginvueserverref2.default.call(void 0, {
|
|
1493
1518
|
debug: process.env.NODE_ENV === "development",
|
|
1494
|
-
state:
|
|
1519
|
+
state: _chunkOVW2G2MHjs.__spreadValues.call(void 0, {
|
|
1495
1520
|
sync: false,
|
|
1496
1521
|
nav: {
|
|
1497
1522
|
page: 0,
|