@slidev/cli 0.31.3 → 0.31.4
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-TARUTLV7.js → build-5QYEFLVL.js} +11 -11
- package/dist/{build-OBPH6VDP.mjs → build-QLCAUS73.mjs} +3 -3
- package/dist/{chunk-D6ZT4BYV.mjs → chunk-25USV2L5.mjs} +0 -5
- package/dist/{chunk-C4GAL67V.js → chunk-6FP4S4BJ.js} +4 -4
- package/dist/{chunk-ZSZGLQND.mjs → chunk-7HNXF4RI.mjs} +222 -3278
- package/dist/{chunk-EIZSCDHU.mjs → chunk-A6EFYWHQ.mjs} +2 -2
- package/dist/{chunk-MCHS7HQA.mjs → chunk-NKDK3BW7.mjs} +7 -7
- package/dist/{chunk-OVW2G2MH.js → chunk-OYCSUJS7.js} +1 -6
- package/dist/{chunk-BGLVULPK.js → chunk-RQ7QDWD6.js} +61 -61
- package/dist/{chunk-2MKHYABM.js → chunk-VNV7XQUU.js} +505 -3561
- package/dist/cli.js +37 -35
- package/dist/cli.mjs +26 -24
- package/dist/{export-F63P4ZXM.mjs → export-RFA6N32W.mjs} +2 -2
- package/dist/{export-I6OGAJWC.js → export-W52T2VBO.js} +5 -5
- package/dist/index.d.ts +9 -68
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/package.json +11 -11
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
resolveImportPath,
|
|
12
12
|
stringifyMarkdownTokens,
|
|
13
13
|
toAtFS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-25USV2L5.mjs";
|
|
15
15
|
|
|
16
16
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
17
17
|
var require_fast_deep_equal = __commonJS({
|
|
@@ -240,7 +240,7 @@ import { uniq as uniq3 } from "@antfu/utils";
|
|
|
240
240
|
|
|
241
241
|
// ../client/package.json
|
|
242
242
|
var dependencies = {
|
|
243
|
-
"@antfu/utils": "^0.5.
|
|
243
|
+
"@antfu/utils": "^0.5.2",
|
|
244
244
|
"@slidev/parser": "workspace:*",
|
|
245
245
|
"@slidev/types": "workspace:*",
|
|
246
246
|
"@vueuse/core": "^8.4.2",
|
|
@@ -253,7 +253,7 @@ var dependencies = {
|
|
|
253
253
|
"js-base64": "^3.7.2",
|
|
254
254
|
"js-yaml": "^4.1.0",
|
|
255
255
|
katex: "^0.15.3",
|
|
256
|
-
mermaid: "^9.
|
|
256
|
+
mermaid: "^9.1.1",
|
|
257
257
|
"monaco-editor": "^0.33.0",
|
|
258
258
|
nanoid: "^3.3.4",
|
|
259
259
|
prettier: "^2.6.2",
|
|
@@ -263,7 +263,7 @@ var dependencies = {
|
|
|
263
263
|
vue: "^3.2.33",
|
|
264
264
|
"vue-router": "^4.0.15",
|
|
265
265
|
"vue-starport": "^0.2.10",
|
|
266
|
-
windicss: "^3.5.
|
|
266
|
+
windicss: "^3.5.3"
|
|
267
267
|
};
|
|
268
268
|
|
|
269
269
|
// node/vite/searchRoot.ts
|
|
@@ -431,7 +431,7 @@ function prepareSlideInfo(data) {
|
|
|
431
431
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
|
-
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
434
|
+
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
435
435
|
const slidePrefix = "/@slidev/slides/";
|
|
436
436
|
const hmrPages = /* @__PURE__ */ new Set();
|
|
437
437
|
let server;
|
|
@@ -676,7 +676,7 @@ ${code.slice(injectB)}`;
|
|
|
676
676
|
${imports.join("\n")}
|
|
677
677
|
`);
|
|
678
678
|
} else if (matchScript && !matchScript[2]) {
|
|
679
|
-
const matchExport = code.match(/export\s+default\s+
|
|
679
|
+
const matchExport = code.match(/export\s+default\s+{/);
|
|
680
680
|
if (matchExport) {
|
|
681
681
|
const exportIndex = (matchExport.index || 0) + matchExport[0].length;
|
|
682
682
|
let component = code.slice(exportIndex);
|
|
@@ -827,7 +827,7 @@ ${routes.join(",\n")}
|
|
|
827
827
|
return [...imports, routesStr].join("\n");
|
|
828
828
|
}
|
|
829
829
|
function generateConfigs() {
|
|
830
|
-
const config = __spreadValues({}, data.config);
|
|
830
|
+
const config = __spreadProps(__spreadValues({}, data.config), { remote });
|
|
831
831
|
if (isString(config.title)) {
|
|
832
832
|
const tokens = md.parseInline(config.title, {});
|
|
833
833
|
config.title = stringifyMarkdownTokens(tokens);
|
|
@@ -46,10 +46,6 @@ var __esm = (fn, res) => function __init() {
|
|
|
46
46
|
var __commonJS = (cb, mod) => function __require2() {
|
|
47
47
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
48
48
|
};
|
|
49
|
-
var __export = (target, all) => {
|
|
50
|
-
for (var name in all)
|
|
51
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
52
|
-
};
|
|
53
49
|
var __copyProps = (to, from, except, desc) => {
|
|
54
50
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
55
51
|
for (let key of __getOwnPropNames(from))
|
|
@@ -169,5 +165,4 @@ function generateGoogleFontsUrl(options) {
|
|
|
169
165
|
|
|
170
166
|
|
|
171
167
|
|
|
172
|
-
|
|
173
|
-
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; exports.__objRest = __objRest; exports.__commonJS = __commonJS; exports.__export = __export; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl;
|
|
168
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; exports.__objRest = __objRest; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl;
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkOYCSUJS7js = require('./chunk-OYCSUJS7.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 = _chunkOYCSUJS7js.__commonJS.call(void 0, {
|
|
17
17
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
18
18
|
"use strict";
|
|
19
|
-
|
|
19
|
+
_chunkOYCSUJS7js.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 = _chunkOVW2G2MHjs.__commonJS.call(void 0, {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// node/common.ts
|
|
62
|
-
|
|
62
|
+
_chunkOYCSUJS7js.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="${_chunkOYCSUJS7js.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunkOYCSUJS7js.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
|
+
_chunkOYCSUJS7js.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
|
+
_chunkOYCSUJS7js.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 = _chunkOYCSUJS7js.__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, _chunkOYCSUJS7js.__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, _chunkOYCSUJS7js.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
171
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkOYCSUJS7js.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
172
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkOYCSUJS7js.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
|
+
_chunkOYCSUJS7js.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
|
+
_chunkOYCSUJS7js.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
|
+
_chunkOYCSUJS7js.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,7 +239,7 @@ var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglo
|
|
|
239
239
|
|
|
240
240
|
// ../client/package.json
|
|
241
241
|
var dependencies = {
|
|
242
|
-
"@antfu/utils": "^0.5.
|
|
242
|
+
"@antfu/utils": "^0.5.2",
|
|
243
243
|
"@slidev/parser": "workspace:*",
|
|
244
244
|
"@slidev/types": "workspace:*",
|
|
245
245
|
"@vueuse/core": "^8.4.2",
|
|
@@ -252,7 +252,7 @@ var dependencies = {
|
|
|
252
252
|
"js-base64": "^3.7.2",
|
|
253
253
|
"js-yaml": "^4.1.0",
|
|
254
254
|
katex: "^0.15.3",
|
|
255
|
-
mermaid: "^9.
|
|
255
|
+
mermaid: "^9.1.1",
|
|
256
256
|
"monaco-editor": "^0.33.0",
|
|
257
257
|
nanoid: "^3.3.4",
|
|
258
258
|
prettier: "^2.6.2",
|
|
@@ -262,11 +262,11 @@ var dependencies = {
|
|
|
262
262
|
vue: "^3.2.33",
|
|
263
263
|
"vue-router": "^4.0.15",
|
|
264
264
|
"vue-starport": "^0.2.10",
|
|
265
|
-
windicss: "^3.5.
|
|
265
|
+
windicss: "^3.5.3"
|
|
266
266
|
};
|
|
267
267
|
|
|
268
268
|
// node/vite/searchRoot.ts
|
|
269
|
-
|
|
269
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
270
270
|
|
|
271
271
|
|
|
272
272
|
var ROOT_FILES = [
|
|
@@ -326,7 +326,7 @@ function createConfigPlugin(options) {
|
|
|
326
326
|
define: getDefine(options),
|
|
327
327
|
resolve: {
|
|
328
328
|
alias: {
|
|
329
|
-
"@slidev/client/": `${
|
|
329
|
+
"@slidev/client/": `${_chunkOYCSUJS7js.toAtFS.call(void 0, options.clientRoot)}/`
|
|
330
330
|
}
|
|
331
331
|
},
|
|
332
332
|
optimizeDeps: {
|
|
@@ -353,7 +353,7 @@ function createConfigPlugin(options) {
|
|
|
353
353
|
allow: _utils.uniq.call(void 0, [
|
|
354
354
|
searchForWorkspaceRoot(options.userRoot),
|
|
355
355
|
searchForWorkspaceRoot(options.cliRoot),
|
|
356
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
356
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkOYCSUJS7js.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkOYCSUJS7js.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
357
357
|
])
|
|
358
358
|
}
|
|
359
359
|
}
|
|
@@ -362,7 +362,7 @@ function createConfigPlugin(options) {
|
|
|
362
362
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
363
363
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
364
364
|
injection.root = options.cliRoot;
|
|
365
|
-
injection.resolve.alias.vue = `${
|
|
365
|
+
injection.resolve.alias.vue = `${_chunkOYCSUJS7js.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
366
366
|
}
|
|
367
367
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
368
368
|
},
|
|
@@ -383,7 +383,7 @@ function createConfigPlugin(options) {
|
|
|
383
383
|
}
|
|
384
384
|
function getDefine(options) {
|
|
385
385
|
return {
|
|
386
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
386
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkOYCSUJS7js.toAtFS.call(void 0, options.clientRoot)),
|
|
387
387
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
388
388
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
389
389
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -393,8 +393,8 @@ function getDefine(options) {
|
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
// node/plugins/loaders.ts
|
|
396
|
-
|
|
397
|
-
var import_fast_deep_equal =
|
|
396
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
397
|
+
var import_fast_deep_equal = _chunkOYCSUJS7js.__toESM.call(void 0, require_fast_deep_equal());
|
|
398
398
|
|
|
399
399
|
|
|
400
400
|
|
|
@@ -426,11 +426,11 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
function prepareSlideInfo(data) {
|
|
429
|
-
return
|
|
429
|
+
return _chunkOYCSUJS7js.__spreadProps.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {}, data), {
|
|
430
430
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
-
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
433
|
+
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
434
434
|
const slidePrefix = "/@slidev/slides/";
|
|
435
435
|
const hmrPages = /* @__PURE__ */ new Set();
|
|
436
436
|
let server;
|
|
@@ -517,7 +517,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
517
517
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
518
518
|
try {
|
|
519
519
|
const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
520
|
-
return await VuePlugin.handleHotUpdate(
|
|
520
|
+
return await VuePlugin.handleHotUpdate(_chunkOYCSUJS7js.__spreadProps.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {}, ctx), {
|
|
521
521
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
522
522
|
file,
|
|
523
523
|
read() {
|
|
@@ -634,14 +634,14 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
634
634
|
async function transformMarkdown(code, pageNo, data2) {
|
|
635
635
|
var _a, _b;
|
|
636
636
|
const layouts = await getLayouts();
|
|
637
|
-
const frontmatter =
|
|
637
|
+
const frontmatter = _chunkOYCSUJS7js.__spreadValues.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
638
638
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
639
639
|
if (!layouts[layoutName])
|
|
640
640
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
641
641
|
delete frontmatter.title;
|
|
642
642
|
const imports = [
|
|
643
643
|
'import { inject as vueInject } from "vue"',
|
|
644
|
-
`import InjectedLayout from "${
|
|
644
|
+
`import InjectedLayout from "${_chunkOYCSUJS7js.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
645
645
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
646
646
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
647
647
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -675,7 +675,7 @@ ${code.slice(injectB)}`;
|
|
|
675
675
|
${imports.join("\n")}
|
|
676
676
|
`);
|
|
677
677
|
} else if (matchScript && !matchScript[2]) {
|
|
678
|
-
const matchExport = code.match(/export\s+default\s+
|
|
678
|
+
const matchExport = code.match(/export\s+default\s+{/);
|
|
679
679
|
if (matchExport) {
|
|
680
680
|
const exportIndex = (matchExport.index || 0) + matchExport[0].length;
|
|
681
681
|
let component = code.slice(exportIndex);
|
|
@@ -744,9 +744,9 @@ defineProps<{ no: number | string }>()`);
|
|
|
744
744
|
}
|
|
745
745
|
async function generateUserStyles() {
|
|
746
746
|
const imports = [
|
|
747
|
-
`import "${
|
|
748
|
-
`import "${
|
|
749
|
-
`import "${
|
|
747
|
+
`import "${_chunkOYCSUJS7js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
748
|
+
`import "${_chunkOYCSUJS7js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
749
|
+
`import "${_chunkOYCSUJS7js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
750
750
|
];
|
|
751
751
|
const roots2 = _utils.uniq.call(void 0, [
|
|
752
752
|
...themeRoots,
|
|
@@ -762,13 +762,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
762
762
|
];
|
|
763
763
|
for (const style of styles) {
|
|
764
764
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
765
|
-
imports.push(`import "${
|
|
765
|
+
imports.push(`import "${_chunkOYCSUJS7js.toAtFS.call(void 0, style)}"`);
|
|
766
766
|
continue;
|
|
767
767
|
}
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
770
|
if (data.features.katex)
|
|
771
|
-
imports.push(`import "${
|
|
771
|
+
imports.push(`import "${_chunkOYCSUJS7js.toAtFS.call(void 0, _chunkOYCSUJS7js.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
772
772
|
return imports.join("\n");
|
|
773
773
|
}
|
|
774
774
|
async function generateMonacoTypes() {
|
|
@@ -777,7 +777,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
777
777
|
async function generateLayouts() {
|
|
778
778
|
const imports = [];
|
|
779
779
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
780
|
-
imports.push(`import __layout_${k} from "${
|
|
780
|
+
imports.push(`import __layout_${k} from "${_chunkOYCSUJS7js.toAtFS.call(void 0, v)}"`);
|
|
781
781
|
return [k, `__layout_${k}`];
|
|
782
782
|
});
|
|
783
783
|
return [
|
|
@@ -826,10 +826,10 @@ ${routes.join(",\n")}
|
|
|
826
826
|
return [...imports, routesStr].join("\n");
|
|
827
827
|
}
|
|
828
828
|
function generateConfigs() {
|
|
829
|
-
const config =
|
|
829
|
+
const config = _chunkOYCSUJS7js.__spreadProps.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {}, data.config), { remote });
|
|
830
830
|
if (_utils.isString.call(void 0, config.title)) {
|
|
831
831
|
const tokens = md.parseInline(config.title, {});
|
|
832
|
-
config.title =
|
|
832
|
+
config.title = _chunkOYCSUJS7js.stringifyMarkdownTokens.call(void 0, tokens);
|
|
833
833
|
}
|
|
834
834
|
if (_utils.isString.call(void 0, config.info))
|
|
835
835
|
config.info = md.render(config.info);
|
|
@@ -850,7 +850,7 @@ ${routes.join(",\n")}
|
|
|
850
850
|
];
|
|
851
851
|
}
|
|
852
852
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
853
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
853
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkOYCSUJS7js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
854
854
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
855
855
|
return `
|
|
856
856
|
${imports}
|
|
@@ -869,7 +869,7 @@ export default {
|
|
|
869
869
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
870
870
|
];
|
|
871
871
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
872
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
872
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkOYCSUJS7js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
873
873
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
874
874
|
return `
|
|
875
875
|
${imports}
|
|
@@ -884,7 +884,7 @@ export default {
|
|
|
884
884
|
}
|
|
885
885
|
|
|
886
886
|
// node/plugins/monacoTransform.ts
|
|
887
|
-
|
|
887
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
888
888
|
|
|
889
889
|
|
|
890
890
|
|
|
@@ -918,7 +918,7 @@ function createMonacoTypesLoader() {
|
|
|
918
918
|
}
|
|
919
919
|
|
|
920
920
|
// node/plugins/setupClient.ts
|
|
921
|
-
|
|
921
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
922
922
|
|
|
923
923
|
|
|
924
924
|
|
|
@@ -940,7 +940,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
940
940
|
setups.forEach((path, idx) => {
|
|
941
941
|
if (!_fs.existsSync.call(void 0, path))
|
|
942
942
|
return;
|
|
943
|
-
imports.push(`import __n${idx} from '${
|
|
943
|
+
imports.push(`import __n${idx} from '${_chunkOYCSUJS7js.toAtFS.call(void 0, path)}'`);
|
|
944
944
|
let fn = `__n${idx}`;
|
|
945
945
|
let awaitFn = `await __n${idx}`;
|
|
946
946
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -968,7 +968,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
968
968
|
}
|
|
969
969
|
|
|
970
970
|
// node/plugins/markdown.ts
|
|
971
|
-
|
|
971
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
972
972
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
973
973
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
974
974
|
|
|
@@ -978,7 +978,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
978
978
|
var _plantumlencoder = require('plantuml-encoder');
|
|
979
979
|
|
|
980
980
|
// node/plugins/markdown-it-katex.ts
|
|
981
|
-
|
|
981
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
982
982
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
983
983
|
function isValidDelim(state, pos) {
|
|
984
984
|
const max = state.posMax;
|
|
@@ -1125,7 +1125,7 @@ function math_plugin(md2, options) {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
|
|
1127
1127
|
// node/plugins/markdown-it-prism.ts
|
|
1128
|
-
|
|
1128
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
1129
1129
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1130
1130
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1131
1131
|
var DEFAULTS = {
|
|
@@ -1148,7 +1148,7 @@ function loadPrismLang(lang) {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
function loadPrismPlugin(name) {
|
|
1150
1150
|
try {
|
|
1151
|
-
|
|
1151
|
+
_chunkOYCSUJS7js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1152
1152
|
} catch (e) {
|
|
1153
1153
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1154
1154
|
}
|
|
@@ -1188,7 +1188,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
|
|
1190
1190
|
// node/plugins/markdown-it-shiki.ts
|
|
1191
|
-
|
|
1191
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
1192
1192
|
function getThemeName(theme) {
|
|
1193
1193
|
if (typeof theme === "string")
|
|
1194
1194
|
return theme;
|
|
@@ -1210,7 +1210,7 @@ function resolveShikiOptions(options) {
|
|
|
1210
1210
|
themes.push(options.theme);
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
1213
|
-
return
|
|
1213
|
+
return _chunkOYCSUJS7js.__spreadProps.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {}, options), {
|
|
1214
1214
|
themes,
|
|
1215
1215
|
darkModeThemes: darkModeThemes ? {
|
|
1216
1216
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1248,7 +1248,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1248
1248
|
const setups = [];
|
|
1249
1249
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1250
1250
|
if (config.highlighter === "shiki") {
|
|
1251
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1251
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkOYCSUJS7js.__toESM.call(void 0, _chunkOYCSUJS7js.__require.call(void 0, "shiki")));
|
|
1252
1252
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1253
1253
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1254
1254
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1257,11 +1257,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1257
1257
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1258
1258
|
}
|
|
1259
1259
|
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1260
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1260
|
+
return _vitepluginmd2.default.call(void 0, _chunkOYCSUJS7js.__spreadProps.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {
|
|
1261
1261
|
wrapperClasses: "",
|
|
1262
1262
|
headEnabled: false,
|
|
1263
1263
|
frontmatter: false,
|
|
1264
|
-
markdownItOptions:
|
|
1264
|
+
markdownItOptions: _chunkOYCSUJS7js.__spreadValues.call(void 0, {
|
|
1265
1265
|
quotes: `""''`,
|
|
1266
1266
|
html: true,
|
|
1267
1267
|
xhtmlOut: true,
|
|
@@ -1397,7 +1397,7 @@ function escapeVueInCode(md2) {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
|
|
1399
1399
|
// node/plugins/patchTransform.ts
|
|
1400
|
-
|
|
1400
|
+
_chunkOYCSUJS7js.init_cjs_shims.call(void 0, );
|
|
1401
1401
|
|
|
1402
1402
|
function createFixPlugins(options) {
|
|
1403
1403
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1461,10 +1461,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1461
1461
|
clientRoot,
|
|
1462
1462
|
data: { config }
|
|
1463
1463
|
} = options;
|
|
1464
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1464
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {
|
|
1465
1465
|
include: [/\.vue$/, /\.md$/],
|
|
1466
1466
|
exclude: [],
|
|
1467
|
-
template:
|
|
1467
|
+
template: _chunkOYCSUJS7js.__spreadValues.call(void 0, {
|
|
1468
1468
|
compilerOptions: {
|
|
1469
1469
|
isCustomElement(tag) {
|
|
1470
1470
|
return customElements.has(tag);
|
|
@@ -1479,7 +1479,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1479
1479
|
MarkdownPlugin,
|
|
1480
1480
|
VuePlugin,
|
|
1481
1481
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1482
|
-
_vite4.default.call(void 0,
|
|
1482
|
+
_vite4.default.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {
|
|
1483
1483
|
extensions: ["vue", "md", "ts"],
|
|
1484
1484
|
dirs: [
|
|
1485
1485
|
`${clientRoot}/builtin`,
|
|
@@ -1497,11 +1497,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1497
1497
|
})
|
|
1498
1498
|
]
|
|
1499
1499
|
}, componentsOptions)),
|
|
1500
|
-
_vite2.default.call(void 0,
|
|
1500
|
+
_vite2.default.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {
|
|
1501
1501
|
defaultClass: "slidev-icon",
|
|
1502
1502
|
autoInstall: true
|
|
1503
1503
|
}, iconsOptions)),
|
|
1504
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1504
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkOYCSUJS7js.__spreadValues.call(void 0, {
|
|
1505
1505
|
rules: [
|
|
1506
1506
|
..._vitepluginremoteassets.DefaultRules,
|
|
1507
1507
|
{
|
|
@@ -1514,7 +1514,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1514
1514
|
}, remoteAssetsOptions)) : null,
|
|
1515
1515
|
_vitepluginvueserverref2.default.call(void 0, {
|
|
1516
1516
|
debug: process.env.NODE_ENV === "development",
|
|
1517
|
-
state:
|
|
1517
|
+
state: _chunkOYCSUJS7js.__spreadValues.call(void 0, {
|
|
1518
1518
|
sync: false,
|
|
1519
1519
|
nav: {
|
|
1520
1520
|
page: 0,
|