@slidev/cli 0.31.2 → 0.32.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-DHS7EAI7.js → build-OV5R3MX7.js} +11 -11
- package/dist/{build-HKOWIJTJ.mjs → build-RKDPZPJ4.mjs} +3 -3
- package/dist/{chunk-55JD2XFU.mjs → chunk-2OKC6HYP.mjs} +39 -31
- package/dist/{chunk-U4YYUHKV.mjs → chunk-36AQIIEM.mjs} +441 -3428
- package/dist/{chunk-N6ENRMDM.js → chunk-64ARPHPA.js} +93 -85
- package/dist/{chunk-ZN6VJBWP.js → chunk-ALT27UGE.js} +577 -3564
- package/dist/{chunk-OVW2G2MH.js → chunk-JWGORJY6.js} +6 -5
- package/dist/{chunk-D6ZT4BYV.mjs → chunk-NOFZO6W4.mjs} +7 -6
- package/dist/cli.js +37 -37
- package/dist/cli.mjs +27 -27
- package/dist/{export-HA4VXV3M.mjs → export-GIPHUNUX.mjs} +3 -5
- package/dist/{export-JHHUB6BA.js → export-M6HJUIFY.js} +4 -6
- package/dist/index.d.ts +13 -69
- package/dist/index.js +9 -7
- package/dist/index.mjs +10 -8
- package/package.json +15 -15
- package/dist/chunk-MRYU4L7C.mjs +0 -31
- package/dist/chunk-UGIPPIZX.js +0 -31
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkJWGORJY6js = require('./chunk-JWGORJY6.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 = _chunkJWGORJY6js.__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
|
+
_chunkJWGORJY6js.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
|
+
_chunkJWGORJY6js.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="${_chunkJWGORJY6js.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunkJWGORJY6js.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
|
+
_chunkJWGORJY6js.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
|
+
_chunkJWGORJY6js.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 = _chunkJWGORJY6js.__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);
|
|
@@ -134,10 +134,11 @@ async function loadSetups(roots, name, arg, initial, merge = true) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
// node/plugins/windicss.ts
|
|
137
|
-
async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
137
|
+
async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
138
138
|
const configFiles = _utils.uniq.call(void 0, [
|
|
139
139
|
..._vitepluginwindicss.defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
|
|
140
140
|
...themeRoots.map((i) => `${i}/windi.config.ts`),
|
|
141
|
+
...addonRoots.map((i) => `${i}/windi.config.ts`),
|
|
141
142
|
_path.resolve.call(void 0, clientRoot, "windi.config.ts")
|
|
142
143
|
]);
|
|
143
144
|
const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
|
|
@@ -145,7 +146,7 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
145
146
|
if (config.default)
|
|
146
147
|
config = config.default;
|
|
147
148
|
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
148
|
-
return _vitepluginwindicss2.default.call(void 0,
|
|
149
|
+
return _vitepluginwindicss2.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
149
150
|
configFiles: [configFile],
|
|
150
151
|
config,
|
|
151
152
|
onConfigResolved(config2) {
|
|
@@ -166,16 +167,20 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
166
167
|
config2.scanOptions.include.push(`${i}/components/*.{vue,ts}`);
|
|
167
168
|
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
168
169
|
});
|
|
170
|
+
addonRoots.forEach((i) => {
|
|
171
|
+
config2.scanOptions.include.push(`${i}/components/*.{vue,ts}`);
|
|
172
|
+
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
173
|
+
});
|
|
169
174
|
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,
|
|
175
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkJWGORJY6js.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
176
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkJWGORJY6js.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
177
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkJWGORJY6js.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
173
178
|
}
|
|
174
179
|
}, windiOptions));
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
// node/plugins/preset.ts
|
|
178
|
-
|
|
183
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
179
184
|
var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
|
|
180
185
|
var _vite = require('unplugin-icons/vite'); var _vite2 = _interopRequireDefault(_vite);
|
|
181
186
|
var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
|
|
@@ -185,7 +190,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
|
|
|
185
190
|
|
|
186
191
|
|
|
187
192
|
// node/drawings.ts
|
|
188
|
-
|
|
193
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
189
194
|
|
|
190
195
|
|
|
191
196
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -231,7 +236,7 @@ ${value}
|
|
|
231
236
|
}
|
|
232
237
|
|
|
233
238
|
// node/plugins/extendConfig.ts
|
|
234
|
-
|
|
239
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
235
240
|
|
|
236
241
|
var _vite5 = require('vite');
|
|
237
242
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
@@ -239,10 +244,10 @@ var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglo
|
|
|
239
244
|
|
|
240
245
|
// ../client/package.json
|
|
241
246
|
var dependencies = {
|
|
242
|
-
"@antfu/utils": "^0.5.
|
|
247
|
+
"@antfu/utils": "^0.5.2",
|
|
243
248
|
"@slidev/parser": "workspace:*",
|
|
244
249
|
"@slidev/types": "workspace:*",
|
|
245
|
-
"@vueuse/core": "^8.
|
|
250
|
+
"@vueuse/core": "^8.5.0",
|
|
246
251
|
"@vueuse/head": "^0.7.6",
|
|
247
252
|
"@vueuse/motion": "^2.0.0-beta.18",
|
|
248
253
|
codemirror: "^5.65.3",
|
|
@@ -252,21 +257,21 @@ var dependencies = {
|
|
|
252
257
|
"js-base64": "^3.7.2",
|
|
253
258
|
"js-yaml": "^4.1.0",
|
|
254
259
|
katex: "^0.15.3",
|
|
255
|
-
mermaid: "^9.
|
|
260
|
+
mermaid: "^9.1.1",
|
|
256
261
|
"monaco-editor": "^0.33.0",
|
|
257
262
|
nanoid: "^3.3.4",
|
|
258
263
|
prettier: "^2.6.2",
|
|
259
264
|
recordrtc: "^5.6.2",
|
|
260
265
|
resolve: "^1.22.0",
|
|
261
266
|
"vite-plugin-windicss": "^1.8.4",
|
|
262
|
-
vue: "^3.2.
|
|
267
|
+
vue: "^3.2.34",
|
|
263
268
|
"vue-router": "^4.0.15",
|
|
264
269
|
"vue-starport": "^0.2.10",
|
|
265
|
-
windicss: "^3.5.
|
|
270
|
+
windicss: "^3.5.4"
|
|
266
271
|
};
|
|
267
272
|
|
|
268
273
|
// node/vite/searchRoot.ts
|
|
269
|
-
|
|
274
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
270
275
|
|
|
271
276
|
|
|
272
277
|
var ROOT_FILES = [
|
|
@@ -326,7 +331,7 @@ function createConfigPlugin(options) {
|
|
|
326
331
|
define: getDefine(options),
|
|
327
332
|
resolve: {
|
|
328
333
|
alias: {
|
|
329
|
-
"@slidev/client/": `${
|
|
334
|
+
"@slidev/client/": `${_chunkJWGORJY6js.toAtFS.call(void 0, options.clientRoot)}/`
|
|
330
335
|
}
|
|
331
336
|
},
|
|
332
337
|
optimizeDeps: {
|
|
@@ -353,7 +358,7 @@ function createConfigPlugin(options) {
|
|
|
353
358
|
allow: _utils.uniq.call(void 0, [
|
|
354
359
|
searchForWorkspaceRoot(options.userRoot),
|
|
355
360
|
searchForWorkspaceRoot(options.cliRoot),
|
|
356
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
361
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkJWGORJY6js.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkJWGORJY6js.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
357
362
|
])
|
|
358
363
|
}
|
|
359
364
|
}
|
|
@@ -362,7 +367,7 @@ function createConfigPlugin(options) {
|
|
|
362
367
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
363
368
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
364
369
|
injection.root = options.cliRoot;
|
|
365
|
-
injection.resolve.alias.vue = `${
|
|
370
|
+
injection.resolve.alias.vue = `${_chunkJWGORJY6js.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
366
371
|
}
|
|
367
372
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
368
373
|
},
|
|
@@ -383,7 +388,7 @@ function createConfigPlugin(options) {
|
|
|
383
388
|
}
|
|
384
389
|
function getDefine(options) {
|
|
385
390
|
return {
|
|
386
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
391
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkJWGORJY6js.toAtFS.call(void 0, options.clientRoot)),
|
|
387
392
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
388
393
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
389
394
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -393,8 +398,8 @@ function getDefine(options) {
|
|
|
393
398
|
}
|
|
394
399
|
|
|
395
400
|
// node/plugins/loaders.ts
|
|
396
|
-
|
|
397
|
-
var import_fast_deep_equal =
|
|
401
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
402
|
+
var import_fast_deep_equal = _chunkJWGORJY6js.__toESM.call(void 0, require_fast_deep_equal());
|
|
398
403
|
|
|
399
404
|
|
|
400
405
|
|
|
@@ -426,11 +431,11 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
426
431
|
}
|
|
427
432
|
});
|
|
428
433
|
function prepareSlideInfo(data) {
|
|
429
|
-
return
|
|
434
|
+
return _chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, data), {
|
|
430
435
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
431
436
|
});
|
|
432
437
|
}
|
|
433
|
-
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
438
|
+
function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
434
439
|
const slidePrefix = "/@slidev/slides/";
|
|
435
440
|
const hmrPages = /* @__PURE__ */ new Set();
|
|
436
441
|
let server;
|
|
@@ -517,7 +522,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
517
522
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
518
523
|
try {
|
|
519
524
|
const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
520
|
-
return await VuePlugin.handleHotUpdate(
|
|
525
|
+
return await VuePlugin.handleHotUpdate(_chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, ctx), {
|
|
521
526
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
522
527
|
file,
|
|
523
528
|
read() {
|
|
@@ -634,14 +639,14 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
634
639
|
async function transformMarkdown(code, pageNo, data2) {
|
|
635
640
|
var _a, _b;
|
|
636
641
|
const layouts = await getLayouts();
|
|
637
|
-
const frontmatter =
|
|
642
|
+
const frontmatter = _chunkJWGORJY6js.__spreadValues.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
638
643
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
639
644
|
if (!layouts[layoutName])
|
|
640
645
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
641
646
|
delete frontmatter.title;
|
|
642
647
|
const imports = [
|
|
643
648
|
'import { inject as vueInject } from "vue"',
|
|
644
|
-
`import InjectedLayout from "${
|
|
649
|
+
`import InjectedLayout from "${_chunkJWGORJY6js.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
645
650
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
646
651
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
647
652
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -675,38 +680,36 @@ ${code.slice(injectB)}`;
|
|
|
675
680
|
${imports.join("\n")}
|
|
676
681
|
`);
|
|
677
682
|
} else if (matchScript && !matchScript[2]) {
|
|
678
|
-
const matchExport = code.match(/export\s+default\s+
|
|
683
|
+
const matchExport = code.match(/export\s+default\s+{/);
|
|
679
684
|
if (matchExport) {
|
|
680
685
|
const exportIndex = (matchExport.index || 0) + matchExport[0].length;
|
|
681
686
|
let component = code.slice(exportIndex);
|
|
682
687
|
component = component.slice(0, component.indexOf("<\/script>"));
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
return `${code.slice(0, injectIndex - 1)}{
|
|
688
|
+
const scriptIndex = (matchScript.index || 0) + matchScript[0].length;
|
|
689
|
+
const provideImport = '\nimport { injectionSlidevContext } from "@slidev/client/constants"\n';
|
|
690
|
+
code = `${code.slice(0, scriptIndex)}${provideImport}${code.slice(scriptIndex)}`;
|
|
691
|
+
let injectIndex = exportIndex + provideImport.length;
|
|
692
|
+
let injectObject = "$slidev: { from: injectionSlidevContext },";
|
|
693
|
+
const matchInject = component.match(/.*inject\s*:\s*([\[{])/);
|
|
694
|
+
if (matchInject) {
|
|
695
|
+
injectIndex += (matchInject.index || 0) + matchInject[0].length;
|
|
696
|
+
if (matchInject[1] === "[") {
|
|
697
|
+
let injects = component.slice((matchInject.index || 0) + matchInject[0].length);
|
|
698
|
+
const injectEndIndex = injects.indexOf("]");
|
|
699
|
+
injects = injects.slice(0, injectEndIndex);
|
|
700
|
+
injectObject += injects.split(",").map((inject) => `${inject}: {from: ${inject}}`).join(",");
|
|
701
|
+
return `${code.slice(0, injectIndex - 1)}{
|
|
698
702
|
${injectObject}
|
|
699
703
|
}${code.slice(injectIndex + injectEndIndex + 1)}`;
|
|
700
|
-
|
|
701
|
-
|
|
704
|
+
} else {
|
|
705
|
+
return `${code.slice(0, injectIndex)}
|
|
702
706
|
${injectObject}
|
|
703
707
|
${code.slice(injectIndex)}`;
|
|
704
|
-
}
|
|
705
708
|
}
|
|
706
|
-
|
|
709
|
+
}
|
|
710
|
+
return `${code.slice(0, injectIndex)}
|
|
707
711
|
inject: { ${injectObject} },
|
|
708
712
|
${code.slice(injectIndex)}`;
|
|
709
|
-
}
|
|
710
713
|
}
|
|
711
714
|
}
|
|
712
715
|
return `<script setup>
|
|
@@ -726,6 +729,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
726
729
|
const roots2 = _utils.uniq.call(void 0, [
|
|
727
730
|
userRoot,
|
|
728
731
|
...themeRoots,
|
|
732
|
+
...addonRoots,
|
|
729
733
|
clientRoot
|
|
730
734
|
]);
|
|
731
735
|
for (const root of roots2) {
|
|
@@ -746,12 +750,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
746
750
|
}
|
|
747
751
|
async function generateUserStyles() {
|
|
748
752
|
const imports = [
|
|
749
|
-
`import "${
|
|
750
|
-
`import "${
|
|
751
|
-
`import "${
|
|
753
|
+
`import "${_chunkJWGORJY6js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
754
|
+
`import "${_chunkJWGORJY6js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
755
|
+
`import "${_chunkJWGORJY6js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
752
756
|
];
|
|
753
757
|
const roots2 = _utils.uniq.call(void 0, [
|
|
754
758
|
...themeRoots,
|
|
759
|
+
...addonRoots,
|
|
755
760
|
userRoot
|
|
756
761
|
]);
|
|
757
762
|
for (const root of roots2) {
|
|
@@ -764,13 +769,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
764
769
|
];
|
|
765
770
|
for (const style of styles) {
|
|
766
771
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
767
|
-
imports.push(`import "${
|
|
772
|
+
imports.push(`import "${_chunkJWGORJY6js.toAtFS.call(void 0, style)}"`);
|
|
768
773
|
continue;
|
|
769
774
|
}
|
|
770
775
|
}
|
|
771
776
|
}
|
|
772
777
|
if (data.features.katex)
|
|
773
|
-
imports.push(`import "${
|
|
778
|
+
imports.push(`import "${_chunkJWGORJY6js.toAtFS.call(void 0, _chunkJWGORJY6js.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
774
779
|
return imports.join("\n");
|
|
775
780
|
}
|
|
776
781
|
async function generateMonacoTypes() {
|
|
@@ -779,7 +784,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
779
784
|
async function generateLayouts() {
|
|
780
785
|
const imports = [];
|
|
781
786
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
782
|
-
imports.push(`import __layout_${k} from "${
|
|
787
|
+
imports.push(`import __layout_${k} from "${_chunkJWGORJY6js.toAtFS.call(void 0, v)}"`);
|
|
783
788
|
return [k, `__layout_${k}`];
|
|
784
789
|
});
|
|
785
790
|
return [
|
|
@@ -828,10 +833,10 @@ ${routes.join(",\n")}
|
|
|
828
833
|
return [...imports, routesStr].join("\n");
|
|
829
834
|
}
|
|
830
835
|
function generateConfigs() {
|
|
831
|
-
const config =
|
|
836
|
+
const config = _chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, data.config), { remote });
|
|
832
837
|
if (_utils.isString.call(void 0, config.title)) {
|
|
833
838
|
const tokens = md.parseInline(config.title, {});
|
|
834
|
-
config.title =
|
|
839
|
+
config.title = _chunkJWGORJY6js.stringifyMarkdownTokens.call(void 0, tokens);
|
|
835
840
|
}
|
|
836
841
|
if (_utils.isString.call(void 0, config.info))
|
|
837
842
|
config.info = md.render(config.info);
|
|
@@ -852,7 +857,7 @@ ${routes.join(",\n")}
|
|
|
852
857
|
];
|
|
853
858
|
}
|
|
854
859
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
855
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
860
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkJWGORJY6js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
856
861
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
857
862
|
return `
|
|
858
863
|
${imports}
|
|
@@ -871,7 +876,7 @@ export default {
|
|
|
871
876
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
872
877
|
];
|
|
873
878
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
874
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
879
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkJWGORJY6js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
875
880
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
876
881
|
return `
|
|
877
882
|
${imports}
|
|
@@ -886,7 +891,7 @@ export default {
|
|
|
886
891
|
}
|
|
887
892
|
|
|
888
893
|
// node/plugins/monacoTransform.ts
|
|
889
|
-
|
|
894
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
890
895
|
|
|
891
896
|
|
|
892
897
|
|
|
@@ -920,11 +925,11 @@ function createMonacoTypesLoader() {
|
|
|
920
925
|
}
|
|
921
926
|
|
|
922
927
|
// node/plugins/setupClient.ts
|
|
923
|
-
|
|
928
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
924
929
|
|
|
925
930
|
|
|
926
931
|
|
|
927
|
-
function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
932
|
+
function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot }) {
|
|
928
933
|
const setupEntry = _utils.slash.call(void 0, _path.resolve.call(void 0, clientRoot, "setup"));
|
|
929
934
|
return {
|
|
930
935
|
name: "slidev:setup",
|
|
@@ -937,12 +942,13 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
937
942
|
const asyncInjections = [];
|
|
938
943
|
const setups = _utils.uniq.call(void 0, [
|
|
939
944
|
...themeRoots,
|
|
945
|
+
...addonRoots,
|
|
940
946
|
userRoot
|
|
941
947
|
]).map((i) => _path.join.call(void 0, i, "setup", name));
|
|
942
948
|
setups.forEach((path, idx) => {
|
|
943
949
|
if (!_fs.existsSync.call(void 0, path))
|
|
944
950
|
return;
|
|
945
|
-
imports.push(`import __n${idx} from '${
|
|
951
|
+
imports.push(`import __n${idx} from '${_chunkJWGORJY6js.toAtFS.call(void 0, path)}'`);
|
|
946
952
|
let fn = `__n${idx}`;
|
|
947
953
|
let awaitFn = `await __n${idx}`;
|
|
948
954
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -970,7 +976,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
970
976
|
}
|
|
971
977
|
|
|
972
978
|
// node/plugins/markdown.ts
|
|
973
|
-
|
|
979
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
974
980
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
975
981
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
976
982
|
|
|
@@ -980,7 +986,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
980
986
|
var _plantumlencoder = require('plantuml-encoder');
|
|
981
987
|
|
|
982
988
|
// node/plugins/markdown-it-katex.ts
|
|
983
|
-
|
|
989
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
984
990
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
985
991
|
function isValidDelim(state, pos) {
|
|
986
992
|
const max = state.posMax;
|
|
@@ -1127,7 +1133,7 @@ function math_plugin(md2, options) {
|
|
|
1127
1133
|
}
|
|
1128
1134
|
|
|
1129
1135
|
// node/plugins/markdown-it-prism.ts
|
|
1130
|
-
|
|
1136
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
1131
1137
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1132
1138
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1133
1139
|
var DEFAULTS = {
|
|
@@ -1150,7 +1156,7 @@ function loadPrismLang(lang) {
|
|
|
1150
1156
|
}
|
|
1151
1157
|
function loadPrismPlugin(name) {
|
|
1152
1158
|
try {
|
|
1153
|
-
|
|
1159
|
+
_chunkJWGORJY6js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1154
1160
|
} catch (e) {
|
|
1155
1161
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1156
1162
|
}
|
|
@@ -1190,7 +1196,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1190
1196
|
}
|
|
1191
1197
|
|
|
1192
1198
|
// node/plugins/markdown-it-shiki.ts
|
|
1193
|
-
|
|
1199
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
1194
1200
|
function getThemeName(theme) {
|
|
1195
1201
|
if (typeof theme === "string")
|
|
1196
1202
|
return theme;
|
|
@@ -1212,7 +1218,7 @@ function resolveShikiOptions(options) {
|
|
|
1212
1218
|
themes.push(options.theme);
|
|
1213
1219
|
}
|
|
1214
1220
|
}
|
|
1215
|
-
return
|
|
1221
|
+
return _chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, options), {
|
|
1216
1222
|
themes,
|
|
1217
1223
|
darkModeThemes: darkModeThemes ? {
|
|
1218
1224
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1250,7 +1256,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1250
1256
|
const setups = [];
|
|
1251
1257
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1252
1258
|
if (config.highlighter === "shiki") {
|
|
1253
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1259
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "shiki")));
|
|
1254
1260
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1255
1261
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1256
1262
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1259,11 +1265,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1259
1265
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1260
1266
|
}
|
|
1261
1267
|
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1262
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1268
|
+
return _vitepluginmd2.default.call(void 0, _chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1263
1269
|
wrapperClasses: "",
|
|
1264
1270
|
headEnabled: false,
|
|
1265
1271
|
frontmatter: false,
|
|
1266
|
-
markdownItOptions:
|
|
1272
|
+
markdownItOptions: _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1267
1273
|
quotes: `""''`,
|
|
1268
1274
|
html: true,
|
|
1269
1275
|
xhtmlOut: true,
|
|
@@ -1399,7 +1405,7 @@ function escapeVueInCode(md2) {
|
|
|
1399
1405
|
}
|
|
1400
1406
|
|
|
1401
1407
|
// node/plugins/patchTransform.ts
|
|
1402
|
-
|
|
1408
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
1403
1409
|
|
|
1404
1410
|
function createFixPlugins(options) {
|
|
1405
1411
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1460,13 +1466,14 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1460
1466
|
const {
|
|
1461
1467
|
mode,
|
|
1462
1468
|
themeRoots,
|
|
1469
|
+
addonRoots,
|
|
1463
1470
|
clientRoot,
|
|
1464
1471
|
data: { config }
|
|
1465
1472
|
} = options;
|
|
1466
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1473
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1467
1474
|
include: [/\.vue$/, /\.md$/],
|
|
1468
1475
|
exclude: [],
|
|
1469
|
-
template:
|
|
1476
|
+
template: _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1470
1477
|
compilerOptions: {
|
|
1471
1478
|
isCustomElement(tag) {
|
|
1472
1479
|
return customElements.has(tag);
|
|
@@ -1481,12 +1488,13 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1481
1488
|
MarkdownPlugin,
|
|
1482
1489
|
VuePlugin,
|
|
1483
1490
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1484
|
-
_vite4.default.call(void 0,
|
|
1491
|
+
_vite4.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1485
1492
|
extensions: ["vue", "md", "ts"],
|
|
1486
1493
|
dirs: [
|
|
1487
1494
|
`${clientRoot}/builtin`,
|
|
1488
1495
|
`${clientRoot}/components`,
|
|
1489
1496
|
...themeRoots.map((i) => `${i}/components`),
|
|
1497
|
+
...addonRoots.map((i) => `${i}/components`),
|
|
1490
1498
|
"src/components",
|
|
1491
1499
|
"components"
|
|
1492
1500
|
],
|
|
@@ -1499,11 +1507,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1499
1507
|
})
|
|
1500
1508
|
]
|
|
1501
1509
|
}, componentsOptions)),
|
|
1502
|
-
_vite2.default.call(void 0,
|
|
1510
|
+
_vite2.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1503
1511
|
defaultClass: "slidev-icon",
|
|
1504
1512
|
autoInstall: true
|
|
1505
1513
|
}, iconsOptions)),
|
|
1506
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1514
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1507
1515
|
rules: [
|
|
1508
1516
|
..._vitepluginremoteassets.DefaultRules,
|
|
1509
1517
|
{
|
|
@@ -1516,7 +1524,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1516
1524
|
}, remoteAssetsOptions)) : null,
|
|
1517
1525
|
_vitepluginvueserverref2.default.call(void 0, {
|
|
1518
1526
|
debug: process.env.NODE_ENV === "development",
|
|
1519
|
-
state:
|
|
1527
|
+
state: _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1520
1528
|
sync: false,
|
|
1521
1529
|
nav: {
|
|
1522
1530
|
page: 0,
|