@slidev/cli 0.27.15 → 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-KCWMO7SM.mjs → chunk-2TTM3NLX.mjs} +5 -1
- package/dist/{chunk-QQD2JVXL.mjs → chunk-3LH2GTGU.mjs} +22 -2
- package/dist/{chunk-KMGT6NUH.js → chunk-3ND6GSCF.js} +74 -78
- package/dist/{chunk-JFBCXHDN.mjs → chunk-FN2B33RM.mjs} +39 -25
- package/dist/chunk-JGWGLMRC.mjs +10257 -0
- package/dist/{chunk-7EYE5BOQ.js → chunk-RUL3XRPS.js} +2 -4
- package/dist/{chunk-S3MZNAVL.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-7GGNKVR4.js → export-FUMCNU5W.js} +7 -7
- package/dist/{export-CN2WSQ3N.mjs → export-IU4RLVW7.mjs} +7 -5
- package/dist/index.js +7 -7
- package/dist/index.mjs +12 -4
- package/package.json +25 -25
- package/dist/build-O2HBWIR6.js +0 -407
- package/dist/build-RLBC36FM.mjs +0 -399
- package/dist/chunk-GNV3SYCV.mjs +0 -10264
- package/dist/chunk-YQJ43GEB.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');
|
|
@@ -68,6 +68,7 @@ async function getIndexHtml({ clientRoot, themeRoots, data, userRoot }) {
|
|
|
68
68
|
let main = await _fs.promises.readFile(_path.join.call(void 0, clientRoot, "index.html"), "utf-8");
|
|
69
69
|
let head = "";
|
|
70
70
|
let body = "";
|
|
71
|
+
head += `<link rel="icon" href="${data.config.favicon}">`;
|
|
71
72
|
const roots = _utils.uniq.call(void 0, [
|
|
72
73
|
...themeRoots,
|
|
73
74
|
userRoot
|
|
@@ -86,13 +87,13 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
|
|
|
86
87
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
|
|
87
88
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
88
89
|
head += `
|
|
89
|
-
<link rel="stylesheet" href="${
|
|
90
|
-
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);
|
|
91
92
|
return main;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
// node/plugins/windicss.ts
|
|
95
|
-
|
|
96
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
96
97
|
|
|
97
98
|
|
|
98
99
|
|
|
@@ -100,13 +101,13 @@ var _vitepluginwindicss = require('vite-plugin-windicss'); var _vitepluginwindic
|
|
|
100
101
|
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
101
102
|
|
|
102
103
|
// node/plugins/setupNode.ts
|
|
103
|
-
|
|
104
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
104
105
|
|
|
105
106
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
106
107
|
|
|
107
108
|
|
|
108
109
|
function deepMerge(a, b, rootPath = "") {
|
|
109
|
-
a =
|
|
110
|
+
a = _chunkRUL3XRPSjs.__spreadValues.call(void 0, {}, a);
|
|
110
111
|
Object.keys(b).forEach((key) => {
|
|
111
112
|
if (_utils.isObject.call(void 0, a[key]))
|
|
112
113
|
a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
|
|
@@ -144,7 +145,7 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
144
145
|
if (config.default)
|
|
145
146
|
config = config.default;
|
|
146
147
|
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
147
|
-
return _vitepluginwindicss2.default.call(void 0,
|
|
148
|
+
return _vitepluginwindicss2.default.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
148
149
|
configFiles: [configFile],
|
|
149
150
|
config,
|
|
150
151
|
onConfigResolved(config2) {
|
|
@@ -166,15 +167,15 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
166
167
|
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
167
168
|
});
|
|
168
169
|
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
169
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
170
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
171
|
-
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)));
|
|
172
173
|
}
|
|
173
174
|
}, windiOptions));
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
// node/plugins/preset.ts
|
|
177
|
-
|
|
178
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
178
179
|
var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
|
|
179
180
|
var _vite = require('unplugin-icons/vite'); var _vite2 = _interopRequireDefault(_vite);
|
|
180
181
|
var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
|
|
@@ -184,7 +185,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
|
|
|
184
185
|
|
|
185
186
|
|
|
186
187
|
// node/drawings.ts
|
|
187
|
-
|
|
188
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
188
189
|
|
|
189
190
|
|
|
190
191
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -230,7 +231,7 @@ ${value}
|
|
|
230
231
|
}
|
|
231
232
|
|
|
232
233
|
// node/plugins/extendConfig.ts
|
|
233
|
-
|
|
234
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
234
235
|
|
|
235
236
|
var _vite5 = require('vite');
|
|
236
237
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
@@ -241,29 +242,29 @@ var dependencies = {
|
|
|
241
242
|
"@antfu/utils": "^0.3.0",
|
|
242
243
|
"@slidev/parser": "workspace:*",
|
|
243
244
|
"@slidev/types": "workspace:*",
|
|
244
|
-
"@vueuse/core": "^
|
|
245
|
-
"@vueuse/head": "^0.
|
|
245
|
+
"@vueuse/core": "^7.3.0",
|
|
246
|
+
"@vueuse/head": "^0.7.4",
|
|
246
247
|
"@vueuse/motion": "^2.0.0-beta.4",
|
|
247
|
-
codemirror: "^5.
|
|
248
|
+
codemirror: "^5.64.0",
|
|
248
249
|
drauu: "^0.2.1",
|
|
249
250
|
"file-saver": "^2.0.5",
|
|
250
251
|
"js-base64": "^3.7.2",
|
|
251
252
|
"js-yaml": "^4.1.0",
|
|
252
|
-
katex: "^0.
|
|
253
|
+
katex: "^0.15.1",
|
|
253
254
|
mermaid: "8.13.0",
|
|
254
|
-
"monaco-editor": "^0.
|
|
255
|
+
"monaco-editor": "^0.31.0",
|
|
255
256
|
nanoid: "^3.1.30",
|
|
256
|
-
prettier: "^2.
|
|
257
|
+
prettier: "^2.5.1",
|
|
257
258
|
recordrtc: "^5.6.2",
|
|
258
259
|
resolve: "^1.20.0",
|
|
259
|
-
"vite-plugin-windicss": "^1.4
|
|
260
|
-
vue: "^3.2.
|
|
260
|
+
"vite-plugin-windicss": "^1.5.4",
|
|
261
|
+
vue: "^3.2.26",
|
|
261
262
|
"vue-router": "^4.0.12",
|
|
262
|
-
windicss: "^3.
|
|
263
|
+
windicss: "^3.3.0"
|
|
263
264
|
};
|
|
264
265
|
|
|
265
266
|
// node/vite/searchRoot.ts
|
|
266
|
-
|
|
267
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
267
268
|
|
|
268
269
|
|
|
269
270
|
var ROOT_FILES = [
|
|
@@ -323,7 +324,7 @@ function createConfigPlugin(options) {
|
|
|
323
324
|
define: getDefine(options),
|
|
324
325
|
resolve: {
|
|
325
326
|
alias: {
|
|
326
|
-
"@slidev/client/": `${
|
|
327
|
+
"@slidev/client/": `${_chunkRUL3XRPSjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
327
328
|
}
|
|
328
329
|
},
|
|
329
330
|
optimizeDeps: {
|
|
@@ -349,7 +350,7 @@ function createConfigPlugin(options) {
|
|
|
349
350
|
allow: _utils.uniq.call(void 0, [
|
|
350
351
|
searchForWorkspaceRoot(options.userRoot),
|
|
351
352
|
searchForWorkspaceRoot(options.cliRoot),
|
|
352
|
-
..._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"))] : []
|
|
353
354
|
])
|
|
354
355
|
}
|
|
355
356
|
}
|
|
@@ -358,7 +359,7 @@ function createConfigPlugin(options) {
|
|
|
358
359
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
359
360
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
360
361
|
injection.root = options.cliRoot;
|
|
361
|
-
injection.resolve.alias.vue = `${
|
|
362
|
+
injection.resolve.alias.vue = `${_chunkRUL3XRPSjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
362
363
|
}
|
|
363
364
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
364
365
|
},
|
|
@@ -379,7 +380,7 @@ function createConfigPlugin(options) {
|
|
|
379
380
|
}
|
|
380
381
|
function getDefine(options) {
|
|
381
382
|
return {
|
|
382
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
383
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkRUL3XRPSjs.toAtFS.call(void 0, options.clientRoot)),
|
|
383
384
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
384
385
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
385
386
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -388,20 +389,15 @@ function getDefine(options) {
|
|
|
388
389
|
}
|
|
389
390
|
|
|
390
391
|
// node/plugins/loaders.ts
|
|
391
|
-
|
|
392
|
-
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());
|
|
393
394
|
|
|
394
395
|
|
|
395
396
|
|
|
396
397
|
|
|
397
398
|
var _markdownit = require('markdown-it'); var _markdownit2 = _interopRequireDefault(_markdownit);
|
|
398
399
|
var _markdownitlinkattributes = require('markdown-it-link-attributes'); var _markdownitlinkattributes2 = _interopRequireDefault(_markdownitlinkattributes);
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
var _fs3 = require('@slidev/parser/fs');
|
|
400
|
+
var _fs3 = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs3);
|
|
405
401
|
var regexId = /^\/\@slidev\/slide\/(\d+)\.(md|json)(?:\?import)?$/;
|
|
406
402
|
var regexIdQuery = /(\d+?)\.(md|json)$/;
|
|
407
403
|
function getBodyJson(req) {
|
|
@@ -426,13 +422,13 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
426
422
|
}
|
|
427
423
|
});
|
|
428
424
|
function prepareSlideInfo(data) {
|
|
429
|
-
return
|
|
425
|
+
return _chunkRUL3XRPSjs.__spreadProps.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {}, data), {
|
|
430
426
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
431
427
|
});
|
|
432
428
|
}
|
|
433
429
|
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
434
430
|
const slidePrefix = "/@slidev/slides/";
|
|
435
|
-
const hmrPages = new Set();
|
|
431
|
+
const hmrPages = /* @__PURE__ */ new Set();
|
|
436
432
|
let server;
|
|
437
433
|
let _layouts_cache_time = 0;
|
|
438
434
|
let _layouts_cache = {};
|
|
@@ -459,10 +455,10 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
459
455
|
hmrPages.add(idx);
|
|
460
456
|
if (slide.source) {
|
|
461
457
|
Object.assign(slide.source, body);
|
|
462
|
-
await
|
|
458
|
+
await parser.saveExternalSlide(slide.source);
|
|
463
459
|
} else {
|
|
464
460
|
Object.assign(slide, body);
|
|
465
|
-
await
|
|
461
|
+
await parser.save(data, entry);
|
|
466
462
|
}
|
|
467
463
|
res.statusCode = 200;
|
|
468
464
|
res.write(JSON.stringify(prepareSlideInfo(slide)));
|
|
@@ -475,8 +471,8 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
475
471
|
var _a;
|
|
476
472
|
if (!data.entries.some((i) => _utils.slash.call(void 0, i) === ctx.file))
|
|
477
473
|
return;
|
|
478
|
-
const newData = await
|
|
479
|
-
const moduleIds = new Set();
|
|
474
|
+
const newData = await parser.load(entry, data.themeMeta);
|
|
475
|
+
const moduleIds = /* @__PURE__ */ new Set();
|
|
480
476
|
if (data.slides.length !== newData.slides.length) {
|
|
481
477
|
moduleIds.add("/@slidev/routes");
|
|
482
478
|
_utils.range.call(void 0, newData.slides.length).map((i) => hmrPages.add(i));
|
|
@@ -515,7 +511,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
515
511
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
516
512
|
try {
|
|
517
513
|
const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
518
|
-
return await VuePlugin.handleHotUpdate(
|
|
514
|
+
return await VuePlugin.handleHotUpdate(_chunkRUL3XRPSjs.__spreadProps.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {}, ctx), {
|
|
519
515
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
520
516
|
file,
|
|
521
517
|
read() {
|
|
@@ -597,13 +593,13 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
597
593
|
async function transformMarkdown(code, pageNo, data2) {
|
|
598
594
|
var _a, _b;
|
|
599
595
|
const layouts = await getLayouts();
|
|
600
|
-
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) || {});
|
|
601
597
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
602
598
|
if (!layouts[layoutName])
|
|
603
599
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
604
600
|
delete frontmatter.title;
|
|
605
601
|
const imports = [
|
|
606
|
-
`import InjectedLayout from "${
|
|
602
|
+
`import InjectedLayout from "${_chunkRUL3XRPSjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
607
603
|
`const frontmatter = ${JSON.stringify(frontmatter)}`
|
|
608
604
|
];
|
|
609
605
|
code = code.replace(/(<script setup.*>)/g, `$1
|
|
@@ -649,9 +645,9 @@ ${code.slice(injectB)}`;
|
|
|
649
645
|
}
|
|
650
646
|
async function generateUserStyles() {
|
|
651
647
|
const imports = [
|
|
652
|
-
`import "${
|
|
653
|
-
`import "${
|
|
654
|
-
`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"))}"`
|
|
655
651
|
];
|
|
656
652
|
const roots2 = _utils.uniq.call(void 0, [
|
|
657
653
|
...themeRoots,
|
|
@@ -667,22 +663,22 @@ ${code.slice(injectB)}`;
|
|
|
667
663
|
];
|
|
668
664
|
for (const style of styles) {
|
|
669
665
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
670
|
-
imports.push(`import "${
|
|
666
|
+
imports.push(`import "${_chunkRUL3XRPSjs.toAtFS.call(void 0, style)}"`);
|
|
671
667
|
continue;
|
|
672
668
|
}
|
|
673
669
|
}
|
|
674
670
|
}
|
|
675
671
|
if (data.features.katex)
|
|
676
|
-
imports.push(`import "${
|
|
672
|
+
imports.push(`import "${_chunkRUL3XRPSjs.toAtFS.call(void 0, _chunkRUL3XRPSjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
677
673
|
return imports.join("\n");
|
|
678
674
|
}
|
|
679
675
|
async function generateMonacoTypes() {
|
|
680
|
-
return `void 0; ${
|
|
676
|
+
return `void 0; ${parser.scanMonacoModules(data.raw).map((i) => `import('/@slidev-monaco-types/${i}')`).join("\n")}`;
|
|
681
677
|
}
|
|
682
678
|
async function generateLayouts() {
|
|
683
679
|
const imports = [];
|
|
684
680
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
685
|
-
imports.push(`import __layout_${k} from "${
|
|
681
|
+
imports.push(`import __layout_${k} from "${_chunkRUL3XRPSjs.toAtFS.call(void 0, v)}"`);
|
|
686
682
|
return [k, `__layout_${k}`];
|
|
687
683
|
});
|
|
688
684
|
return [
|
|
@@ -728,10 +724,10 @@ ${routes.join(",\n")}
|
|
|
728
724
|
return [...imports, routesStr].join("\n");
|
|
729
725
|
}
|
|
730
726
|
function generateConfigs() {
|
|
731
|
-
const config =
|
|
727
|
+
const config = _chunkRUL3XRPSjs.__spreadValues.call(void 0, {}, data.config);
|
|
732
728
|
if (_utils.isString.call(void 0, config.title)) {
|
|
733
729
|
const tokens = md.parseInline(config.title, {});
|
|
734
|
-
config.title =
|
|
730
|
+
config.title = _chunkRUL3XRPSjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
735
731
|
}
|
|
736
732
|
if (_utils.isString.call(void 0, config.info))
|
|
737
733
|
config.info = md.render(config.info);
|
|
@@ -752,7 +748,7 @@ ${routes.join(",\n")}
|
|
|
752
748
|
];
|
|
753
749
|
}
|
|
754
750
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
755
|
-
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");
|
|
756
752
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
757
753
|
return `
|
|
758
754
|
${imports}
|
|
@@ -767,7 +763,7 @@ export default {
|
|
|
767
763
|
}
|
|
768
764
|
|
|
769
765
|
// node/plugins/monacoTransform.ts
|
|
770
|
-
|
|
766
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
771
767
|
|
|
772
768
|
|
|
773
769
|
|
|
@@ -801,7 +797,7 @@ function createMonacoTypesLoader() {
|
|
|
801
797
|
}
|
|
802
798
|
|
|
803
799
|
// node/plugins/setupClient.ts
|
|
804
|
-
|
|
800
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
805
801
|
|
|
806
802
|
|
|
807
803
|
|
|
@@ -823,7 +819,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
823
819
|
setups.forEach((path, idx) => {
|
|
824
820
|
if (!_fs.existsSync.call(void 0, path))
|
|
825
821
|
return;
|
|
826
|
-
imports.push(`import __n${idx} from '${
|
|
822
|
+
imports.push(`import __n${idx} from '${_chunkRUL3XRPSjs.toAtFS.call(void 0, path)}'`);
|
|
827
823
|
let fn = `__n${idx}`;
|
|
828
824
|
let awaitFn = `await __n${idx}`;
|
|
829
825
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -851,7 +847,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
851
847
|
}
|
|
852
848
|
|
|
853
849
|
// node/plugins/markdown.ts
|
|
854
|
-
|
|
850
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
855
851
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
856
852
|
var _jsbase64 = require('js-base64'); var _jsbase642 = _interopRequireDefault(_jsbase64);
|
|
857
853
|
|
|
@@ -861,7 +857,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
861
857
|
var _plantumlencoder = require('plantuml-encoder');
|
|
862
858
|
|
|
863
859
|
// node/plugins/markdown-it-katex.ts
|
|
864
|
-
|
|
860
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
865
861
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
866
862
|
function isValidDelim(state, pos) {
|
|
867
863
|
const max = state.posMax;
|
|
@@ -1008,7 +1004,7 @@ function math_plugin(md2, options) {
|
|
|
1008
1004
|
}
|
|
1009
1005
|
|
|
1010
1006
|
// node/plugins/markdown-it-prism.ts
|
|
1011
|
-
|
|
1007
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
1012
1008
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1013
1009
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1014
1010
|
var DEFAULTS = {
|
|
@@ -1031,7 +1027,7 @@ function loadPrismLang(lang) {
|
|
|
1031
1027
|
}
|
|
1032
1028
|
function loadPrismPlugin(name) {
|
|
1033
1029
|
try {
|
|
1034
|
-
|
|
1030
|
+
_chunkRUL3XRPSjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1035
1031
|
} catch (e) {
|
|
1036
1032
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1037
1033
|
}
|
|
@@ -1071,7 +1067,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1071
1067
|
}
|
|
1072
1068
|
|
|
1073
1069
|
// node/plugins/markdown-it-shiki.ts
|
|
1074
|
-
|
|
1070
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
1075
1071
|
function getThemeName(theme) {
|
|
1076
1072
|
if (typeof theme === "string")
|
|
1077
1073
|
return theme;
|
|
@@ -1093,7 +1089,7 @@ function resolveShikiOptions(options) {
|
|
|
1093
1089
|
themes.push(options.theme);
|
|
1094
1090
|
}
|
|
1095
1091
|
}
|
|
1096
|
-
return
|
|
1092
|
+
return _chunkRUL3XRPSjs.__spreadProps.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {}, options), {
|
|
1097
1093
|
themes,
|
|
1098
1094
|
darkModeThemes: darkModeThemes ? {
|
|
1099
1095
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1131,7 +1127,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1131
1127
|
const setups = [];
|
|
1132
1128
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1133
1129
|
if (config.highlighter === "shiki") {
|
|
1134
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1130
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkRUL3XRPSjs.__toModule.call(void 0, _chunkRUL3XRPSjs.__require.call(void 0, "shiki")));
|
|
1135
1131
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1136
1132
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1137
1133
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1139,12 +1135,12 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1139
1135
|
} else {
|
|
1140
1136
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1141
1137
|
}
|
|
1142
|
-
const
|
|
1143
|
-
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, {
|
|
1144
1140
|
wrapperClasses: "",
|
|
1145
1141
|
headEnabled: false,
|
|
1146
1142
|
frontmatter: false,
|
|
1147
|
-
markdownItOptions:
|
|
1143
|
+
markdownItOptions: _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1148
1144
|
quotes: `""''`,
|
|
1149
1145
|
html: true,
|
|
1150
1146
|
xhtmlOut: true,
|
|
@@ -1160,7 +1156,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1160
1156
|
}
|
|
1161
1157
|
});
|
|
1162
1158
|
md2.use(_markdownitfootnote2.default);
|
|
1163
|
-
md2.use(math_plugin,
|
|
1159
|
+
md2.use(math_plugin, KatexOptions);
|
|
1164
1160
|
setups.forEach((i) => i(md2));
|
|
1165
1161
|
(_a = mdOptions == null ? void 0 : mdOptions.markdownItSetup) == null ? void 0 : _a.call(mdOptions, md2);
|
|
1166
1162
|
},
|
|
@@ -1281,7 +1277,7 @@ function escapeVueInCode(md2) {
|
|
|
1281
1277
|
}
|
|
1282
1278
|
|
|
1283
1279
|
// node/plugins/patchTransform.ts
|
|
1284
|
-
|
|
1280
|
+
_chunkRUL3XRPSjs.init_cjs_shims.call(void 0, );
|
|
1285
1281
|
|
|
1286
1282
|
function createFixPlugins(options) {
|
|
1287
1283
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1302,7 +1298,7 @@ function createFixPlugins(options) {
|
|
|
1302
1298
|
}
|
|
1303
1299
|
|
|
1304
1300
|
// node/plugins/preset.ts
|
|
1305
|
-
var customElements = new Set([
|
|
1301
|
+
var customElements = /* @__PURE__ */ new Set([
|
|
1306
1302
|
"annotation",
|
|
1307
1303
|
"math",
|
|
1308
1304
|
"mrow",
|
|
@@ -1335,10 +1331,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1335
1331
|
clientRoot,
|
|
1336
1332
|
data: { config }
|
|
1337
1333
|
} = options;
|
|
1338
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1334
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1339
1335
|
include: [/\.vue$/, /\.md$/],
|
|
1340
1336
|
exclude: [],
|
|
1341
|
-
template:
|
|
1337
|
+
template: _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1342
1338
|
compilerOptions: {
|
|
1343
1339
|
isCustomElement(tag) {
|
|
1344
1340
|
return customElements.has(tag);
|
|
@@ -1353,7 +1349,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1353
1349
|
MarkdownPlugin,
|
|
1354
1350
|
VuePlugin,
|
|
1355
1351
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1356
|
-
_vite4.default.call(void 0,
|
|
1352
|
+
_vite4.default.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1357
1353
|
extensions: ["vue", "md", "ts"],
|
|
1358
1354
|
dirs: [
|
|
1359
1355
|
`${clientRoot}/builtin`,
|
|
@@ -1371,11 +1367,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1371
1367
|
})
|
|
1372
1368
|
]
|
|
1373
1369
|
}, componentsOptions)),
|
|
1374
|
-
_vite2.default.call(void 0,
|
|
1370
|
+
_vite2.default.call(void 0, _chunkRUL3XRPSjs.__spreadValues.call(void 0, {
|
|
1375
1371
|
defaultClass: "slidev-icon",
|
|
1376
1372
|
autoInstall: true
|
|
1377
1373
|
}, iconsOptions)),
|
|
1378
|
-
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, {
|
|
1379
1375
|
rules: [
|
|
1380
1376
|
..._vitepluginremoteassets.DefaultRules,
|
|
1381
1377
|
{
|