@slidev/cli 0.27.18 → 0.27.20
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-LK5RLV7L.js +747 -0
- package/dist/build-OT76Q4KA.mjs +747 -0
- package/dist/{chunk-6HK3HED2.mjs → chunk-2TTM3NLX.mjs} +5 -1
- package/dist/{chunk-QQD2JVXL.mjs → chunk-3LH2GTGU.mjs} +22 -2
- package/dist/{chunk-DVHCB7TL.js → chunk-3ND6GSCF.js} +73 -78
- package/dist/{chunk-L7QFSRQN.mjs → chunk-FN2B33RM.mjs} +38 -25
- package/dist/chunk-JGWGLMRC.mjs +10257 -0
- package/dist/{chunk-7EYE5BOQ.js → chunk-RUL3XRPS.js} +2 -4
- package/dist/{chunk-3QMXOBKW.js → chunk-VN5XPBZO.js} +4 -4
- package/dist/chunk-XEDZVJCH.js +10256 -0
- package/dist/cli.js +29 -36
- package/dist/cli.mjs +19 -23
- package/dist/{export-YPXOSS5M.js → export-FUMCNU5W.js} +5 -5
- package/dist/{export-4IC3K3DC.mjs → export-IU4RLVW7.mjs} +5 -3
- package/dist/index.js +7 -7
- package/dist/index.mjs +12 -4
- package/package.json +25 -25
- package/dist/build-G4KCH5XF.mjs +0 -400
- package/dist/build-IDWUSCWC.js +0 -408
- package/dist/chunk-4A5D2CTX.mjs +0 -10264
- package/dist/chunk-I4X2EWTI.js +0 -10316
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FN2B33RM.mjs";
|
|
4
|
+
import {
|
|
5
|
+
init_esm_shims
|
|
6
|
+
} from "./chunk-3LH2GTGU.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 = {}) {
|
|
@@ -29,6 +29,9 @@ 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
|
};
|
|
@@ -44,14 +47,28 @@ var __toModule = (module) => {
|
|
|
44
47
|
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
48
|
};
|
|
46
49
|
|
|
50
|
+
// ../../node_modules/.pnpm/tsup@5.11.1_typescript@4.5.4/node_modules/tsup/assets/esm_shims.js
|
|
51
|
+
import { fileURLToPath } from "url";
|
|
52
|
+
import path from "path";
|
|
53
|
+
var getFilename, getDirname, __dirname, __filename;
|
|
54
|
+
var init_esm_shims = __esm({
|
|
55
|
+
"../../node_modules/.pnpm/tsup@5.11.1_typescript@4.5.4/node_modules/tsup/assets/esm_shims.js"() {
|
|
56
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
57
|
+
getDirname = () => path.dirname(getFilename());
|
|
58
|
+
__dirname = /* @__PURE__ */ getDirname();
|
|
59
|
+
__filename = /* @__PURE__ */ getFilename();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
47
63
|
// node/utils.ts
|
|
64
|
+
init_esm_shims();
|
|
48
65
|
import { join } from "path";
|
|
49
66
|
import { ensurePrefix, slash } from "@antfu/utils";
|
|
50
67
|
import isInstalledGlobally from "is-installed-globally";
|
|
51
68
|
import { sync as resolve } from "resolve";
|
|
52
69
|
import globalDirs from "global-dirs";
|
|
53
|
-
function toAtFS(
|
|
54
|
-
return `/@fs${ensurePrefix("/", slash(
|
|
70
|
+
function toAtFS(path2) {
|
|
71
|
+
return `/@fs${ensurePrefix("/", slash(path2))}`;
|
|
55
72
|
}
|
|
56
73
|
function resolveImportPath(importName, ensure = false) {
|
|
57
74
|
try {
|
|
@@ -107,6 +124,9 @@ export {
|
|
|
107
124
|
__require,
|
|
108
125
|
__commonJS,
|
|
109
126
|
__toModule,
|
|
127
|
+
__dirname,
|
|
128
|
+
__filename,
|
|
129
|
+
init_esm_shims,
|
|
110
130
|
toAtFS,
|
|
111
131
|
resolveImportPath,
|
|
112
132
|
resolveGlobalImportPath,
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkRUL3XRPSjs = require('./chunk-RUL3XRPS.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 = _chunkRUL3XRPSjs.__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
|
+
_chunkRUL3XRPSjs.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
|
+
_chunkRUL3XRPSjs.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="${_chunkRUL3XRPSjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunkRUL3XRPSjs.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
|
+
_chunkRUL3XRPSjs.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
|
+
_chunkRUL3XRPSjs.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 = _chunkRUL3XRPSjs.__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, _chunkRUL3XRPSjs.__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, _chunkRUL3XRPSjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
171
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkRUL3XRPSjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
172
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkRUL3XRPSjs.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
|
+
_chunkRUL3XRPSjs.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
|
+
_chunkRUL3XRPSjs.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
|
+
_chunkRUL3XRPSjs.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,29 +242,29 @@ var dependencies = {
|
|
|
242
242
|
"@antfu/utils": "^0.3.0",
|
|
243
243
|
"@slidev/parser": "workspace:*",
|
|
244
244
|
"@slidev/types": "workspace:*",
|
|
245
|
-
"@vueuse/core": "^
|
|
246
|
-
"@vueuse/head": "^0.
|
|
245
|
+
"@vueuse/core": "^7.3.0",
|
|
246
|
+
"@vueuse/head": "^0.7.4",
|
|
247
247
|
"@vueuse/motion": "^2.0.0-beta.4",
|
|
248
|
-
codemirror: "^5.
|
|
248
|
+
codemirror: "^5.64.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.1",
|
|
254
254
|
mermaid: "8.13.0",
|
|
255
|
-
"monaco-editor": "^0.
|
|
255
|
+
"monaco-editor": "^0.31.0",
|
|
256
256
|
nanoid: "^3.1.30",
|
|
257
|
-
prettier: "^2.
|
|
257
|
+
prettier: "^2.5.1",
|
|
258
258
|
recordrtc: "^5.6.2",
|
|
259
259
|
resolve: "^1.20.0",
|
|
260
|
-
"vite-plugin-windicss": "^1.4
|
|
261
|
-
vue: "^3.2.
|
|
260
|
+
"vite-plugin-windicss": "^1.5.4",
|
|
261
|
+
vue: "^3.2.26",
|
|
262
262
|
"vue-router": "^4.0.12",
|
|
263
|
-
windicss: "^3.
|
|
263
|
+
windicss: "^3.3.0"
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
// node/vite/searchRoot.ts
|
|
267
|
-
|
|
267
|
+
_chunkRUL3XRPSjs.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/": `${_chunkRUL3XRPSjs.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, _chunkRUL3XRPSjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkRUL3XRPSjs.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 = `${_chunkRUL3XRPSjs.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(_chunkRUL3XRPSjs.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
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
393
|
+
var import_fast_deep_equal = _chunkRUL3XRPSjs.__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 _chunkRUL3XRPSjs.__spreadProps.call(void 0, _chunkRUL3XRPSjs.__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(_chunkRUL3XRPSjs.__spreadProps.call(void 0, _chunkRUL3XRPSjs.__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 = _chunkRUL3XRPSjs.__spreadValues.call(void 0, _chunkRUL3XRPSjs.__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 "${_chunkRUL3XRPSjs.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 "${_chunkRUL3XRPSjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
649
|
+
`import "${_chunkRUL3XRPSjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
650
|
+
`import "${_chunkRUL3XRPSjs.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 "${_chunkRUL3XRPSjs.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 "${_chunkRUL3XRPSjs.toAtFS.call(void 0, _chunkRUL3XRPSjs.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 "${_chunkRUL3XRPSjs.toAtFS.call(void 0, v)}"`);
|
|
687
682
|
return [k, `__layout_${k}`];
|
|
688
683
|
});
|
|
689
684
|
return [
|
|
@@ -729,10 +724,10 @@ ${routes.join(",\n")}
|
|
|
729
724
|
return [...imports, routesStr].join("\n");
|
|
730
725
|
}
|
|
731
726
|
function generateConfigs() {
|
|
732
|
-
const config =
|
|
727
|
+
const config = _chunkRUL3XRPSjs.__spreadValues.call(void 0, {}, data.config);
|
|
733
728
|
if (_utils.isString.call(void 0, config.title)) {
|
|
734
729
|
const tokens = md.parseInline(config.title, {});
|
|
735
|
-
config.title =
|
|
730
|
+
config.title = _chunkRUL3XRPSjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
736
731
|
}
|
|
737
732
|
if (_utils.isString.call(void 0, config.info))
|
|
738
733
|
config.info = md.render(config.info);
|
|
@@ -753,7 +748,7 @@ ${routes.join(",\n")}
|
|
|
753
748
|
];
|
|
754
749
|
}
|
|
755
750
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
756
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
751
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkRUL3XRPSjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
757
752
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
758
753
|
return `
|
|
759
754
|
${imports}
|
|
@@ -768,7 +763,7 @@ export default {
|
|
|
768
763
|
}
|
|
769
764
|
|
|
770
765
|
// node/plugins/monacoTransform.ts
|
|
771
|
-
|
|
766
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
772
767
|
|
|
773
768
|
|
|
774
769
|
|
|
@@ -802,7 +797,7 @@ function createMonacoTypesLoader() {
|
|
|
802
797
|
}
|
|
803
798
|
|
|
804
799
|
// node/plugins/setupClient.ts
|
|
805
|
-
|
|
800
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
806
801
|
|
|
807
802
|
|
|
808
803
|
|
|
@@ -824,7 +819,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
824
819
|
setups.forEach((path, idx) => {
|
|
825
820
|
if (!_fs.existsSync.call(void 0, path))
|
|
826
821
|
return;
|
|
827
|
-
imports.push(`import __n${idx} from '${
|
|
822
|
+
imports.push(`import __n${idx} from '${_chunkRUL3XRPSjs.toAtFS.call(void 0, path)}'`);
|
|
828
823
|
let fn = `__n${idx}`;
|
|
829
824
|
let awaitFn = `await __n${idx}`;
|
|
830
825
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -852,7 +847,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
852
847
|
}
|
|
853
848
|
|
|
854
849
|
// node/plugins/markdown.ts
|
|
855
|
-
|
|
850
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
856
851
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
857
852
|
var _jsbase64 = require('js-base64'); var _jsbase642 = _interopRequireDefault(_jsbase64);
|
|
858
853
|
|
|
@@ -862,7 +857,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
862
857
|
var _plantumlencoder = require('plantuml-encoder');
|
|
863
858
|
|
|
864
859
|
// node/plugins/markdown-it-katex.ts
|
|
865
|
-
|
|
860
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
866
861
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
867
862
|
function isValidDelim(state, pos) {
|
|
868
863
|
const max = state.posMax;
|
|
@@ -1009,7 +1004,7 @@ function math_plugin(md2, options) {
|
|
|
1009
1004
|
}
|
|
1010
1005
|
|
|
1011
1006
|
// node/plugins/markdown-it-prism.ts
|
|
1012
|
-
|
|
1007
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
1013
1008
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1014
1009
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1015
1010
|
var DEFAULTS = {
|
|
@@ -1032,7 +1027,7 @@ function loadPrismLang(lang) {
|
|
|
1032
1027
|
}
|
|
1033
1028
|
function loadPrismPlugin(name) {
|
|
1034
1029
|
try {
|
|
1035
|
-
|
|
1030
|
+
_chunkRUL3XRPSjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1036
1031
|
} catch (e) {
|
|
1037
1032
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1038
1033
|
}
|
|
@@ -1072,7 +1067,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1072
1067
|
}
|
|
1073
1068
|
|
|
1074
1069
|
// node/plugins/markdown-it-shiki.ts
|
|
1075
|
-
|
|
1070
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
1076
1071
|
function getThemeName(theme) {
|
|
1077
1072
|
if (typeof theme === "string")
|
|
1078
1073
|
return theme;
|
|
@@ -1094,7 +1089,7 @@ function resolveShikiOptions(options) {
|
|
|
1094
1089
|
themes.push(options.theme);
|
|
1095
1090
|
}
|
|
1096
1091
|
}
|
|
1097
|
-
return
|
|
1092
|
+
return _chunkRUL3XRPSjs.__spreadProps.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {}, options), {
|
|
1098
1093
|
themes,
|
|
1099
1094
|
darkModeThemes: darkModeThemes ? {
|
|
1100
1095
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1132,7 +1127,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1132
1127
|
const setups = [];
|
|
1133
1128
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1134
1129
|
if (config.highlighter === "shiki") {
|
|
1135
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1130
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkRUL3XRPSjs.__toModule.call(void 0, _chunkRUL3XRPSjs.__require.call(void 0, "shiki")));
|
|
1136
1131
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1137
1132
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1138
1133
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1140,12 +1135,12 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1140
1135
|
} else {
|
|
1141
1136
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1142
1137
|
}
|
|
1143
|
-
const
|
|
1144
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1138
|
+
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1139
|
+
return _vitepluginmd2.default.call(void 0, _chunkRUL3XRPSjs.__spreadProps.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1145
1140
|
wrapperClasses: "",
|
|
1146
1141
|
headEnabled: false,
|
|
1147
1142
|
frontmatter: false,
|
|
1148
|
-
markdownItOptions:
|
|
1143
|
+
markdownItOptions: _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1149
1144
|
quotes: `""''`,
|
|
1150
1145
|
html: true,
|
|
1151
1146
|
xhtmlOut: true,
|
|
@@ -1161,7 +1156,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1161
1156
|
}
|
|
1162
1157
|
});
|
|
1163
1158
|
md2.use(_markdownitfootnote2.default);
|
|
1164
|
-
md2.use(math_plugin,
|
|
1159
|
+
md2.use(math_plugin, KatexOptions);
|
|
1165
1160
|
setups.forEach((i) => i(md2));
|
|
1166
1161
|
(_a = mdOptions == null ? void 0 : mdOptions.markdownItSetup) == null ? void 0 : _a.call(mdOptions, md2);
|
|
1167
1162
|
},
|
|
@@ -1282,7 +1277,7 @@ function escapeVueInCode(md2) {
|
|
|
1282
1277
|
}
|
|
1283
1278
|
|
|
1284
1279
|
// node/plugins/patchTransform.ts
|
|
1285
|
-
|
|
1280
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
1286
1281
|
|
|
1287
1282
|
function createFixPlugins(options) {
|
|
1288
1283
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1303,7 +1298,7 @@ function createFixPlugins(options) {
|
|
|
1303
1298
|
}
|
|
1304
1299
|
|
|
1305
1300
|
// node/plugins/preset.ts
|
|
1306
|
-
var customElements = new Set([
|
|
1301
|
+
var customElements = /* @__PURE__ */ new Set([
|
|
1307
1302
|
"annotation",
|
|
1308
1303
|
"math",
|
|
1309
1304
|
"mrow",
|
|
@@ -1336,10 +1331,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1336
1331
|
clientRoot,
|
|
1337
1332
|
data: { config }
|
|
1338
1333
|
} = options;
|
|
1339
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1334
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1340
1335
|
include: [/\.vue$/, /\.md$/],
|
|
1341
1336
|
exclude: [],
|
|
1342
|
-
template:
|
|
1337
|
+
template: _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1343
1338
|
compilerOptions: {
|
|
1344
1339
|
isCustomElement(tag) {
|
|
1345
1340
|
return customElements.has(tag);
|
|
@@ -1354,7 +1349,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1354
1349
|
MarkdownPlugin,
|
|
1355
1350
|
VuePlugin,
|
|
1356
1351
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1357
|
-
_vite4.default.call(void 0,
|
|
1352
|
+
_vite4.default.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1358
1353
|
extensions: ["vue", "md", "ts"],
|
|
1359
1354
|
dirs: [
|
|
1360
1355
|
`${clientRoot}/builtin`,
|
|
@@ -1372,11 +1367,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1372
1367
|
})
|
|
1373
1368
|
]
|
|
1374
1369
|
}, componentsOptions)),
|
|
1375
|
-
_vite2.default.call(void 0,
|
|
1370
|
+
_vite2.default.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1376
1371
|
defaultClass: "slidev-icon",
|
|
1377
1372
|
autoInstall: true
|
|
1378
1373
|
}, iconsOptions)),
|
|
1379
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1374
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1380
1375
|
rules: [
|
|
1381
1376
|
..._vitepluginremoteassets.DefaultRules,
|
|
1382
1377
|
{
|