@slidev/cli 0.27.17 → 0.28.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-VI5LTCK6.mjs +746 -0
- package/dist/build-XTBYRS3W.js +746 -0
- package/dist/{chunk-L7QFSRQN.mjs → chunk-2E3KKOOJ.mjs} +52 -37
- package/dist/{chunk-7EYE5BOQ.js → chunk-BYTWGCY3.js} +9 -5
- package/dist/chunk-HP3YYHOH.js +13300 -0
- package/dist/{chunk-DVHCB7TL.js → chunk-INYQJTKA.js} +84 -87
- package/dist/{chunk-QQD2JVXL.mjs → chunk-OXQUV4ZP.mjs} +28 -2
- package/dist/{chunk-6HK3HED2.mjs → chunk-RLNIZC66.mjs} +5 -1
- package/dist/chunk-S3POBEBN.mjs +13301 -0
- package/dist/{chunk-3QMXOBKW.js → chunk-Z64T7ZBU.js} +4 -4
- package/dist/cli.js +29 -36
- package/dist/cli.mjs +19 -23
- package/dist/{export-P2HOWL7Q.mjs → export-EKEY7JZV.mjs} +7 -5
- package/dist/{export-OUL6OBWA.js → export-LPXJRXHR.js} +7 -7
- package/dist/index.d.ts +68 -4
- package/dist/index.js +9 -11
- package/dist/index.mjs +12 -6
- package/package.json +35 -34
- package/dist/build-3PYDYXWL.mjs +0 -400
- package/dist/build-DYELZSUV.js +0 -408
- package/dist/chunk-LJGOLBO3.js +0 -10316
- package/dist/chunk-NIUZ32MT.mjs +0 -10264
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.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 = _chunkBYTWGCY3js.__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
|
-
_chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
|
|
19
18
|
"use strict";
|
|
19
|
+
_chunkBYTWGCY3js.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 = _chunk7EYE5BOQjs.__commonJS.call(void 0, {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// node/common.ts
|
|
62
|
-
|
|
62
|
+
_chunkBYTWGCY3js.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="${_chunkBYTWGCY3js.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunkBYTWGCY3js.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
|
+
_chunkBYTWGCY3js.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
|
+
_chunkBYTWGCY3js.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 = _chunkBYTWGCY3js.__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, _chunkBYTWGCY3js.__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, _chunkBYTWGCY3js.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
171
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkBYTWGCY3js.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
172
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkBYTWGCY3js.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
|
+
_chunkBYTWGCY3js.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
|
+
_chunkBYTWGCY3js.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
|
+
_chunkBYTWGCY3js.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);
|
|
@@ -239,32 +239,32 @@ var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglo
|
|
|
239
239
|
|
|
240
240
|
// ../client/package.json
|
|
241
241
|
var dependencies = {
|
|
242
|
-
"@antfu/utils": "^0.
|
|
242
|
+
"@antfu/utils": "^0.4.0",
|
|
243
243
|
"@slidev/parser": "workspace:*",
|
|
244
244
|
"@slidev/types": "workspace:*",
|
|
245
|
-
"@vueuse/core": "^
|
|
246
|
-
"@vueuse/head": "^0.
|
|
247
|
-
"@vueuse/motion": "^2.0.0-beta.
|
|
248
|
-
codemirror: "^5.
|
|
245
|
+
"@vueuse/core": "^7.5.3",
|
|
246
|
+
"@vueuse/head": "^0.7.4",
|
|
247
|
+
"@vueuse/motion": "^2.0.0-beta.9",
|
|
248
|
+
codemirror: "^5.65.0",
|
|
249
249
|
drauu: "^0.2.1",
|
|
250
250
|
"file-saver": "^2.0.5",
|
|
251
251
|
"js-base64": "^3.7.2",
|
|
252
252
|
"js-yaml": "^4.1.0",
|
|
253
|
-
katex: "^0.
|
|
253
|
+
katex: "^0.15.2",
|
|
254
254
|
mermaid: "8.13.0",
|
|
255
|
-
"monaco-editor": "^0.
|
|
256
|
-
nanoid: "^3.1.
|
|
257
|
-
prettier: "^2.
|
|
255
|
+
"monaco-editor": "^0.31.1",
|
|
256
|
+
nanoid: "^3.1.32",
|
|
257
|
+
prettier: "^2.5.1",
|
|
258
258
|
recordrtc: "^5.6.2",
|
|
259
|
-
resolve: "^1.
|
|
260
|
-
"vite-plugin-windicss": "^1.
|
|
261
|
-
vue: "^3.2.
|
|
259
|
+
resolve: "^1.21.0",
|
|
260
|
+
"vite-plugin-windicss": "^1.6.2",
|
|
261
|
+
vue: "^3.2.26",
|
|
262
262
|
"vue-router": "^4.0.12",
|
|
263
|
-
windicss: "^3.
|
|
263
|
+
windicss: "^3.4.2"
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
// node/vite/searchRoot.ts
|
|
267
|
-
|
|
267
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
268
268
|
|
|
269
269
|
|
|
270
270
|
var ROOT_FILES = [
|
|
@@ -324,7 +324,7 @@ function createConfigPlugin(options) {
|
|
|
324
324
|
define: getDefine(options),
|
|
325
325
|
resolve: {
|
|
326
326
|
alias: {
|
|
327
|
-
"@slidev/client/": `${
|
|
327
|
+
"@slidev/client/": `${_chunkBYTWGCY3js.toAtFS.call(void 0, options.clientRoot)}/`
|
|
328
328
|
}
|
|
329
329
|
},
|
|
330
330
|
optimizeDeps: {
|
|
@@ -350,7 +350,7 @@ function createConfigPlugin(options) {
|
|
|
350
350
|
allow: _utils.uniq.call(void 0, [
|
|
351
351
|
searchForWorkspaceRoot(options.userRoot),
|
|
352
352
|
searchForWorkspaceRoot(options.cliRoot),
|
|
353
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
353
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkBYTWGCY3js.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkBYTWGCY3js.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
354
354
|
])
|
|
355
355
|
}
|
|
356
356
|
}
|
|
@@ -359,7 +359,7 @@ function createConfigPlugin(options) {
|
|
|
359
359
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
360
360
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
361
361
|
injection.root = options.cliRoot;
|
|
362
|
-
injection.resolve.alias.vue = `${
|
|
362
|
+
injection.resolve.alias.vue = `${_chunkBYTWGCY3js.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
363
363
|
}
|
|
364
364
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
365
365
|
},
|
|
@@ -380,7 +380,7 @@ function createConfigPlugin(options) {
|
|
|
380
380
|
}
|
|
381
381
|
function getDefine(options) {
|
|
382
382
|
return {
|
|
383
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
383
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkBYTWGCY3js.toAtFS.call(void 0, options.clientRoot)),
|
|
384
384
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
385
385
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
386
386
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -389,20 +389,15 @@ function getDefine(options) {
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
// node/plugins/loaders.ts
|
|
392
|
-
|
|
393
|
-
var import_fast_deep_equal =
|
|
392
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
393
|
+
var import_fast_deep_equal = _chunkBYTWGCY3js.__toModule.call(void 0, require_fast_deep_equal());
|
|
394
394
|
|
|
395
395
|
|
|
396
396
|
|
|
397
397
|
|
|
398
398
|
var _markdownit = require('markdown-it'); var _markdownit2 = _interopRequireDefault(_markdownit);
|
|
399
399
|
var _markdownitlinkattributes = require('markdown-it-link-attributes'); var _markdownitlinkattributes2 = _interopRequireDefault(_markdownitlinkattributes);
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
var _fs3 = require('@slidev/parser/fs');
|
|
400
|
+
var _fs3 = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs3);
|
|
406
401
|
var regexId = /^\/\@slidev\/slide\/(\d+)\.(md|json)(?:\?import)?$/;
|
|
407
402
|
var regexIdQuery = /(\d+?)\.(md|json)$/;
|
|
408
403
|
function getBodyJson(req) {
|
|
@@ -427,13 +422,13 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
427
422
|
}
|
|
428
423
|
});
|
|
429
424
|
function prepareSlideInfo(data) {
|
|
430
|
-
return
|
|
425
|
+
return _chunkBYTWGCY3js.__spreadProps.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, data), {
|
|
431
426
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
432
427
|
});
|
|
433
428
|
}
|
|
434
429
|
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
435
430
|
const slidePrefix = "/@slidev/slides/";
|
|
436
|
-
const hmrPages = new Set();
|
|
431
|
+
const hmrPages = /* @__PURE__ */ new Set();
|
|
437
432
|
let server;
|
|
438
433
|
let _layouts_cache_time = 0;
|
|
439
434
|
let _layouts_cache = {};
|
|
@@ -460,10 +455,10 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
460
455
|
hmrPages.add(idx);
|
|
461
456
|
if (slide.source) {
|
|
462
457
|
Object.assign(slide.source, body);
|
|
463
|
-
await
|
|
458
|
+
await parser.saveExternalSlide(slide.source);
|
|
464
459
|
} else {
|
|
465
460
|
Object.assign(slide, body);
|
|
466
|
-
await
|
|
461
|
+
await parser.save(data, entry);
|
|
467
462
|
}
|
|
468
463
|
res.statusCode = 200;
|
|
469
464
|
res.write(JSON.stringify(prepareSlideInfo(slide)));
|
|
@@ -476,8 +471,8 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
476
471
|
var _a;
|
|
477
472
|
if (!data.entries.some((i) => _utils.slash.call(void 0, i) === ctx.file))
|
|
478
473
|
return;
|
|
479
|
-
const newData = await
|
|
480
|
-
const moduleIds = new Set();
|
|
474
|
+
const newData = await parser.load(entry, data.themeMeta);
|
|
475
|
+
const moduleIds = /* @__PURE__ */ new Set();
|
|
481
476
|
if (data.slides.length !== newData.slides.length) {
|
|
482
477
|
moduleIds.add("/@slidev/routes");
|
|
483
478
|
_utils.range.call(void 0, newData.slides.length).map((i) => hmrPages.add(i));
|
|
@@ -516,7 +511,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
516
511
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
517
512
|
try {
|
|
518
513
|
const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
519
|
-
return await VuePlugin.handleHotUpdate(
|
|
514
|
+
return await VuePlugin.handleHotUpdate(_chunkBYTWGCY3js.__spreadProps.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, ctx), {
|
|
520
515
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
521
516
|
file,
|
|
522
517
|
read() {
|
|
@@ -598,13 +593,13 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
598
593
|
async function transformMarkdown(code, pageNo, data2) {
|
|
599
594
|
var _a, _b;
|
|
600
595
|
const layouts = await getLayouts();
|
|
601
|
-
const frontmatter =
|
|
596
|
+
const frontmatter = _chunkBYTWGCY3js.__spreadValues.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
602
597
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
603
598
|
if (!layouts[layoutName])
|
|
604
599
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
605
600
|
delete frontmatter.title;
|
|
606
601
|
const imports = [
|
|
607
|
-
`import InjectedLayout from "${
|
|
602
|
+
`import InjectedLayout from "${_chunkBYTWGCY3js.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
608
603
|
`const frontmatter = ${JSON.stringify(frontmatter)}`
|
|
609
604
|
];
|
|
610
605
|
code = code.replace(/(<script setup.*>)/g, `$1
|
|
@@ -650,9 +645,9 @@ ${code.slice(injectB)}`;
|
|
|
650
645
|
}
|
|
651
646
|
async function generateUserStyles() {
|
|
652
647
|
const imports = [
|
|
653
|
-
`import "${
|
|
654
|
-
`import "${
|
|
655
|
-
`import "${
|
|
648
|
+
`import "${_chunkBYTWGCY3js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
649
|
+
`import "${_chunkBYTWGCY3js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
650
|
+
`import "${_chunkBYTWGCY3js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
656
651
|
];
|
|
657
652
|
const roots2 = _utils.uniq.call(void 0, [
|
|
658
653
|
...themeRoots,
|
|
@@ -668,22 +663,22 @@ ${code.slice(injectB)}`;
|
|
|
668
663
|
];
|
|
669
664
|
for (const style of styles) {
|
|
670
665
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
671
|
-
imports.push(`import "${
|
|
666
|
+
imports.push(`import "${_chunkBYTWGCY3js.toAtFS.call(void 0, style)}"`);
|
|
672
667
|
continue;
|
|
673
668
|
}
|
|
674
669
|
}
|
|
675
670
|
}
|
|
676
671
|
if (data.features.katex)
|
|
677
|
-
imports.push(`import "${
|
|
672
|
+
imports.push(`import "${_chunkBYTWGCY3js.toAtFS.call(void 0, _chunkBYTWGCY3js.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
678
673
|
return imports.join("\n");
|
|
679
674
|
}
|
|
680
675
|
async function generateMonacoTypes() {
|
|
681
|
-
return `void 0; ${
|
|
676
|
+
return `void 0; ${parser.scanMonacoModules(data.raw).map((i) => `import('/@slidev-monaco-types/${i}')`).join("\n")}`;
|
|
682
677
|
}
|
|
683
678
|
async function generateLayouts() {
|
|
684
679
|
const imports = [];
|
|
685
680
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
686
|
-
imports.push(`import __layout_${k} from "${
|
|
681
|
+
imports.push(`import __layout_${k} from "${_chunkBYTWGCY3js.toAtFS.call(void 0, v)}"`);
|
|
687
682
|
return [k, `__layout_${k}`];
|
|
688
683
|
});
|
|
689
684
|
return [
|
|
@@ -711,7 +706,9 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
|
|
|
711
706
|
note: i.note,
|
|
712
707
|
filepath: ((_b = i.source) == null ? void 0 : _b.filepath) || entry,
|
|
713
708
|
id: idx,
|
|
714
|
-
no
|
|
709
|
+
no,
|
|
710
|
+
title: i.title,
|
|
711
|
+
level: i.level
|
|
715
712
|
},
|
|
716
713
|
__clicksElements: [],
|
|
717
714
|
__preloaded: false
|
|
@@ -729,10 +726,10 @@ ${routes.join(",\n")}
|
|
|
729
726
|
return [...imports, routesStr].join("\n");
|
|
730
727
|
}
|
|
731
728
|
function generateConfigs() {
|
|
732
|
-
const config =
|
|
729
|
+
const config = _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, data.config);
|
|
733
730
|
if (_utils.isString.call(void 0, config.title)) {
|
|
734
731
|
const tokens = md.parseInline(config.title, {});
|
|
735
|
-
config.title =
|
|
732
|
+
config.title = _chunkBYTWGCY3js.stringifyMarkdownTokens.call(void 0, tokens);
|
|
736
733
|
}
|
|
737
734
|
if (_utils.isString.call(void 0, config.info))
|
|
738
735
|
config.info = md.render(config.info);
|
|
@@ -753,7 +750,7 @@ ${routes.join(",\n")}
|
|
|
753
750
|
];
|
|
754
751
|
}
|
|
755
752
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
756
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
753
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkBYTWGCY3js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
757
754
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
758
755
|
return `
|
|
759
756
|
${imports}
|
|
@@ -768,7 +765,7 @@ export default {
|
|
|
768
765
|
}
|
|
769
766
|
|
|
770
767
|
// node/plugins/monacoTransform.ts
|
|
771
|
-
|
|
768
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
772
769
|
|
|
773
770
|
|
|
774
771
|
|
|
@@ -802,7 +799,7 @@ function createMonacoTypesLoader() {
|
|
|
802
799
|
}
|
|
803
800
|
|
|
804
801
|
// node/plugins/setupClient.ts
|
|
805
|
-
|
|
802
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
806
803
|
|
|
807
804
|
|
|
808
805
|
|
|
@@ -824,7 +821,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
824
821
|
setups.forEach((path, idx) => {
|
|
825
822
|
if (!_fs.existsSync.call(void 0, path))
|
|
826
823
|
return;
|
|
827
|
-
imports.push(`import __n${idx} from '${
|
|
824
|
+
imports.push(`import __n${idx} from '${_chunkBYTWGCY3js.toAtFS.call(void 0, path)}'`);
|
|
828
825
|
let fn = `__n${idx}`;
|
|
829
826
|
let awaitFn = `await __n${idx}`;
|
|
830
827
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -852,9 +849,9 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
852
849
|
}
|
|
853
850
|
|
|
854
851
|
// node/plugins/markdown.ts
|
|
855
|
-
|
|
852
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
856
853
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
857
|
-
var _jsbase64 = require('js-base64'); var
|
|
854
|
+
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
858
855
|
|
|
859
856
|
|
|
860
857
|
var _markdownitfootnote = require('markdown-it-footnote'); var _markdownitfootnote2 = _interopRequireDefault(_markdownitfootnote);
|
|
@@ -862,7 +859,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
862
859
|
var _plantumlencoder = require('plantuml-encoder');
|
|
863
860
|
|
|
864
861
|
// node/plugins/markdown-it-katex.ts
|
|
865
|
-
|
|
862
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
866
863
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
867
864
|
function isValidDelim(state, pos) {
|
|
868
865
|
const max = state.posMax;
|
|
@@ -1009,7 +1006,7 @@ function math_plugin(md2, options) {
|
|
|
1009
1006
|
}
|
|
1010
1007
|
|
|
1011
1008
|
// node/plugins/markdown-it-prism.ts
|
|
1012
|
-
|
|
1009
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1013
1010
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1014
1011
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1015
1012
|
var DEFAULTS = {
|
|
@@ -1032,7 +1029,7 @@ function loadPrismLang(lang) {
|
|
|
1032
1029
|
}
|
|
1033
1030
|
function loadPrismPlugin(name) {
|
|
1034
1031
|
try {
|
|
1035
|
-
|
|
1032
|
+
_chunkBYTWGCY3js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1036
1033
|
} catch (e) {
|
|
1037
1034
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1038
1035
|
}
|
|
@@ -1072,7 +1069,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1072
1069
|
}
|
|
1073
1070
|
|
|
1074
1071
|
// node/plugins/markdown-it-shiki.ts
|
|
1075
|
-
|
|
1072
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1076
1073
|
function getThemeName(theme) {
|
|
1077
1074
|
if (typeof theme === "string")
|
|
1078
1075
|
return theme;
|
|
@@ -1094,7 +1091,7 @@ function resolveShikiOptions(options) {
|
|
|
1094
1091
|
themes.push(options.theme);
|
|
1095
1092
|
}
|
|
1096
1093
|
}
|
|
1097
|
-
return
|
|
1094
|
+
return _chunkBYTWGCY3js.__spreadProps.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {}, options), {
|
|
1098
1095
|
themes,
|
|
1099
1096
|
darkModeThemes: darkModeThemes ? {
|
|
1100
1097
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1132,7 +1129,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1132
1129
|
const setups = [];
|
|
1133
1130
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1134
1131
|
if (config.highlighter === "shiki") {
|
|
1135
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1132
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkBYTWGCY3js.__toModule.call(void 0, _chunkBYTWGCY3js.__require.call(void 0, "shiki")));
|
|
1136
1133
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1137
1134
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1138
1135
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1140,12 +1137,12 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1140
1137
|
} else {
|
|
1141
1138
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1142
1139
|
}
|
|
1143
|
-
const
|
|
1144
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1140
|
+
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1141
|
+
return _vitepluginmd2.default.call(void 0, _chunkBYTWGCY3js.__spreadProps.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {
|
|
1145
1142
|
wrapperClasses: "",
|
|
1146
1143
|
headEnabled: false,
|
|
1147
1144
|
frontmatter: false,
|
|
1148
|
-
markdownItOptions:
|
|
1145
|
+
markdownItOptions: _chunkBYTWGCY3js.__spreadValues.call(void 0, {
|
|
1149
1146
|
quotes: `""''`,
|
|
1150
1147
|
html: true,
|
|
1151
1148
|
xhtmlOut: true,
|
|
@@ -1161,7 +1158,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1161
1158
|
}
|
|
1162
1159
|
});
|
|
1163
1160
|
md2.use(_markdownitfootnote2.default);
|
|
1164
|
-
md2.use(math_plugin,
|
|
1161
|
+
md2.use(math_plugin, KatexOptions);
|
|
1165
1162
|
setups.forEach((i) => i(md2));
|
|
1166
1163
|
(_a = mdOptions == null ? void 0 : mdOptions.markdownItSetup) == null ? void 0 : _a.call(mdOptions, md2);
|
|
1167
1164
|
},
|
|
@@ -1185,7 +1182,7 @@ function transformMarkdownMonaco(md2) {
|
|
|
1185
1182
|
md2 = md2.replace(/^```(\w+?)\s*{monaco}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code) => {
|
|
1186
1183
|
lang = lang.trim();
|
|
1187
1184
|
options = options.trim() || "{}";
|
|
1188
|
-
const encoded =
|
|
1185
|
+
const encoded = base64.encode(code, true);
|
|
1189
1186
|
return `<Monaco :code="'${encoded}'" lang="${lang}" v-bind="${options}" />`;
|
|
1190
1187
|
});
|
|
1191
1188
|
return md2;
|
|
@@ -1200,7 +1197,7 @@ function transformSlotSugar(md2) {
|
|
|
1200
1197
|
lines.forEach((line, idx) => {
|
|
1201
1198
|
if (isLineInsideCodeblocks(idx))
|
|
1202
1199
|
return;
|
|
1203
|
-
const match = line.
|
|
1200
|
+
const match = line.trimEnd().match(/^::\s*(\w+)\s*::$/);
|
|
1204
1201
|
if (match) {
|
|
1205
1202
|
lines[idx] = `${prevSlot ? "\n\n</template>\n" : "\n"}<template v-slot:${match[1]}="slotProps">
|
|
1206
1203
|
`;
|
|
@@ -1266,7 +1263,7 @@ function transformMermaid(md2) {
|
|
|
1266
1263
|
return md2.replace(/^```mermaid\s*?({.*?})?\n([\s\S]+?)\n```/mg, (full, options = "", code = "") => {
|
|
1267
1264
|
code = code.trim();
|
|
1268
1265
|
options = options.trim() || "{}";
|
|
1269
|
-
const encoded =
|
|
1266
|
+
const encoded = base64.encode(code, true);
|
|
1270
1267
|
return `<Mermaid :code="'${encoded}'" v-bind="${options}" />`;
|
|
1271
1268
|
});
|
|
1272
1269
|
}
|
|
@@ -1282,7 +1279,7 @@ function escapeVueInCode(md2) {
|
|
|
1282
1279
|
}
|
|
1283
1280
|
|
|
1284
1281
|
// node/plugins/patchTransform.ts
|
|
1285
|
-
|
|
1282
|
+
_chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
|
|
1286
1283
|
|
|
1287
1284
|
function createFixPlugins(options) {
|
|
1288
1285
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1303,7 +1300,7 @@ function createFixPlugins(options) {
|
|
|
1303
1300
|
}
|
|
1304
1301
|
|
|
1305
1302
|
// node/plugins/preset.ts
|
|
1306
|
-
var customElements = new Set([
|
|
1303
|
+
var customElements = /* @__PURE__ */ new Set([
|
|
1307
1304
|
"annotation",
|
|
1308
1305
|
"math",
|
|
1309
1306
|
"mrow",
|
|
@@ -1336,10 +1333,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1336
1333
|
clientRoot,
|
|
1337
1334
|
data: { config }
|
|
1338
1335
|
} = options;
|
|
1339
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1336
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {
|
|
1340
1337
|
include: [/\.vue$/, /\.md$/],
|
|
1341
1338
|
exclude: [],
|
|
1342
|
-
template:
|
|
1339
|
+
template: _chunkBYTWGCY3js.__spreadValues.call(void 0, {
|
|
1343
1340
|
compilerOptions: {
|
|
1344
1341
|
isCustomElement(tag) {
|
|
1345
1342
|
return customElements.has(tag);
|
|
@@ -1354,7 +1351,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1354
1351
|
MarkdownPlugin,
|
|
1355
1352
|
VuePlugin,
|
|
1356
1353
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1357
|
-
_vite4.default.call(void 0,
|
|
1354
|
+
_vite4.default.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {
|
|
1358
1355
|
extensions: ["vue", "md", "ts"],
|
|
1359
1356
|
dirs: [
|
|
1360
1357
|
`${clientRoot}/builtin`,
|
|
@@ -1372,11 +1369,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1372
1369
|
})
|
|
1373
1370
|
]
|
|
1374
1371
|
}, componentsOptions)),
|
|
1375
|
-
_vite2.default.call(void 0,
|
|
1372
|
+
_vite2.default.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {
|
|
1376
1373
|
defaultClass: "slidev-icon",
|
|
1377
1374
|
autoInstall: true
|
|
1378
1375
|
}, iconsOptions)),
|
|
1379
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1376
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkBYTWGCY3js.__spreadValues.call(void 0, {
|
|
1380
1377
|
rules: [
|
|
1381
1378
|
..._vitepluginremoteassets.DefaultRules,
|
|
1382
1379
|
{
|
|
@@ -29,9 +29,17 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
29
29
|
return require.apply(this, arguments);
|
|
30
30
|
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
31
31
|
});
|
|
32
|
+
var __esm = (fn, res) => function __init() {
|
|
33
|
+
return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
|
|
34
|
+
};
|
|
32
35
|
var __commonJS = (cb, mod) => function __require2() {
|
|
33
36
|
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
34
37
|
};
|
|
38
|
+
var __export = (target, all) => {
|
|
39
|
+
__markAsModule(target);
|
|
40
|
+
for (var name in all)
|
|
41
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
42
|
+
};
|
|
35
43
|
var __reExport = (target, module, desc) => {
|
|
36
44
|
if (module && typeof module === "object" || typeof module === "function") {
|
|
37
45
|
for (let key of __getOwnPropNames(module))
|
|
@@ -44,14 +52,28 @@ var __toModule = (module) => {
|
|
|
44
52
|
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
|
|
45
53
|
};
|
|
46
54
|
|
|
55
|
+
// ../../node_modules/.pnpm/tsup@5.11.11_typescript@4.5.4/node_modules/tsup/assets/esm_shims.js
|
|
56
|
+
import { fileURLToPath } from "url";
|
|
57
|
+
import path from "path";
|
|
58
|
+
var getFilename, getDirname, __dirname, __filename;
|
|
59
|
+
var init_esm_shims = __esm({
|
|
60
|
+
"../../node_modules/.pnpm/tsup@5.11.11_typescript@4.5.4/node_modules/tsup/assets/esm_shims.js"() {
|
|
61
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
62
|
+
getDirname = () => path.dirname(getFilename());
|
|
63
|
+
__dirname = /* @__PURE__ */ getDirname();
|
|
64
|
+
__filename = /* @__PURE__ */ getFilename();
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
47
68
|
// node/utils.ts
|
|
69
|
+
init_esm_shims();
|
|
48
70
|
import { join } from "path";
|
|
49
71
|
import { ensurePrefix, slash } from "@antfu/utils";
|
|
50
72
|
import isInstalledGlobally from "is-installed-globally";
|
|
51
73
|
import { sync as resolve } from "resolve";
|
|
52
74
|
import globalDirs from "global-dirs";
|
|
53
|
-
function toAtFS(
|
|
54
|
-
return `/@fs${ensurePrefix("/", slash(
|
|
75
|
+
function toAtFS(path2) {
|
|
76
|
+
return `/@fs${ensurePrefix("/", slash(path2))}`;
|
|
55
77
|
}
|
|
56
78
|
function resolveImportPath(importName, ensure = false) {
|
|
57
79
|
try {
|
|
@@ -106,7 +128,11 @@ export {
|
|
|
106
128
|
__spreadProps,
|
|
107
129
|
__require,
|
|
108
130
|
__commonJS,
|
|
131
|
+
__export,
|
|
109
132
|
__toModule,
|
|
133
|
+
__dirname,
|
|
134
|
+
__filename,
|
|
135
|
+
init_esm_shims,
|
|
110
136
|
toAtFS,
|
|
111
137
|
resolveImportPath,
|
|
112
138
|
resolveGlobalImportPath,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2E3KKOOJ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
init_esm_shims
|
|
6
|
+
} from "./chunk-OXQUV4ZP.mjs";
|
|
4
7
|
|
|
5
8
|
// node/server.ts
|
|
9
|
+
init_esm_shims();
|
|
6
10
|
import { join } from "path";
|
|
7
11
|
import { createServer as createViteServer, mergeConfig, resolveConfig } from "vite";
|
|
8
12
|
async function createServer(options, viteConfig = {}, serverOptions = {}) {
|