@slidev/cli 0.29.0 → 0.30.0
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-NHXJRHBN.mjs → build-C73NWEPF.mjs} +5 -5
- package/dist/{build-VM52TR6Q.js → build-ZQJFWYTE.js} +12 -12
- package/dist/{chunk-G22DGVU7.mjs → chunk-46RYGQQC.mjs} +2 -2
- package/dist/{chunk-UEIFQWPY.mjs → chunk-4AVLCCHB.mjs} +81 -15
- package/dist/{chunk-7F2QYO53.js → chunk-7FQD47HM.js} +133 -67
- package/dist/{chunk-5BL2KALH.js → chunk-HBDQZUZK.js} +4 -4
- package/dist/{chunk-7QXPSYEZ.js → chunk-IXNT7VMK.js} +16 -16
- package/dist/{chunk-WMQA2JLO.mjs → chunk-KZHGLGA5.mjs} +1868 -1896
- package/dist/{chunk-VYBQLH2X.mjs → chunk-XMETW2MS.mjs} +12 -16
- package/dist/{chunk-OOHN7CTS.js → chunk-ZDBME6IC.js} +1962 -1989
- package/dist/cli.js +29 -28
- package/dist/cli.mjs +12 -11
- package/dist/{export-OVSG7H7S.mjs → export-OZQCWKXN.mjs} +69 -64
- package/dist/{export-GML5GDLW.js → export-SQVJKP3A.js} +69 -64
- package/dist/index.js +7 -7
- package/dist/index.mjs +4 -4
- package/package.json +17 -18
- package/template.md +1 -1
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkIXNT7VMKjs = require('./chunk-IXNT7VMK.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 = _chunkIXNT7VMKjs.__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
|
+
_chunkIXNT7VMKjs.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 = _chunk7QXPSYEZjs.__commonJS.call(void 0, {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// node/common.ts
|
|
62
|
-
|
|
62
|
+
_chunkIXNT7VMKjs.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="${_chunkIXNT7VMKjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunkIXNT7VMKjs.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
|
+
_chunkIXNT7VMKjs.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
|
+
_chunkIXNT7VMKjs.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 = _chunkIXNT7VMKjs.__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, _chunkIXNT7VMKjs.__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, _chunkIXNT7VMKjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
171
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkIXNT7VMKjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
172
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkIXNT7VMKjs.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
|
+
_chunkIXNT7VMKjs.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
|
+
_chunkIXNT7VMKjs.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
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
235
235
|
|
|
236
236
|
var _vite5 = require('vite');
|
|
237
237
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
@@ -239,32 +239,34 @@ 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.1",
|
|
243
243
|
"@slidev/parser": "workspace:*",
|
|
244
244
|
"@slidev/types": "workspace:*",
|
|
245
|
-
"@vueuse/core": "^8.
|
|
245
|
+
"@vueuse/core": "^8.2.5",
|
|
246
246
|
"@vueuse/head": "^0.7.5",
|
|
247
|
-
"@vueuse/motion": "^2.0.0-beta.
|
|
247
|
+
"@vueuse/motion": "^2.0.0-beta.18",
|
|
248
248
|
codemirror: "^5.65.2",
|
|
249
|
+
defu: "^6.0.0",
|
|
249
250
|
drauu: "^0.3.0",
|
|
250
251
|
"file-saver": "^2.0.5",
|
|
251
252
|
"js-base64": "^3.7.2",
|
|
252
253
|
"js-yaml": "^4.1.0",
|
|
253
254
|
katex: "^0.15.3",
|
|
254
|
-
mermaid: "^
|
|
255
|
+
mermaid: "^9.0.0",
|
|
255
256
|
"monaco-editor": "^0.33.0",
|
|
256
|
-
nanoid: "^3.3.
|
|
257
|
-
prettier: "^2.6.
|
|
257
|
+
nanoid: "^3.3.2",
|
|
258
|
+
prettier: "^2.6.2",
|
|
258
259
|
recordrtc: "^5.6.2",
|
|
259
260
|
resolve: "^1.22.0",
|
|
260
|
-
"vite-plugin-windicss": "^1.8.
|
|
261
|
-
vue: "^3.2.
|
|
261
|
+
"vite-plugin-windicss": "^1.8.4",
|
|
262
|
+
vue: "^3.2.32",
|
|
262
263
|
"vue-router": "^4.0.14",
|
|
264
|
+
"vue-starport": "^0.2.4",
|
|
263
265
|
windicss: "^3.5.1"
|
|
264
266
|
};
|
|
265
267
|
|
|
266
268
|
// node/vite/searchRoot.ts
|
|
267
|
-
|
|
269
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
268
270
|
|
|
269
271
|
|
|
270
272
|
var ROOT_FILES = [
|
|
@@ -324,7 +326,7 @@ function createConfigPlugin(options) {
|
|
|
324
326
|
define: getDefine(options),
|
|
325
327
|
resolve: {
|
|
326
328
|
alias: {
|
|
327
|
-
"@slidev/client/": `${
|
|
329
|
+
"@slidev/client/": `${_chunkIXNT7VMKjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
328
330
|
}
|
|
329
331
|
},
|
|
330
332
|
optimizeDeps: {
|
|
@@ -351,7 +353,7 @@ function createConfigPlugin(options) {
|
|
|
351
353
|
allow: _utils.uniq.call(void 0, [
|
|
352
354
|
searchForWorkspaceRoot(options.userRoot),
|
|
353
355
|
searchForWorkspaceRoot(options.cliRoot),
|
|
354
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
356
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkIXNT7VMKjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkIXNT7VMKjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
355
357
|
])
|
|
356
358
|
}
|
|
357
359
|
}
|
|
@@ -360,7 +362,7 @@ function createConfigPlugin(options) {
|
|
|
360
362
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
361
363
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
362
364
|
injection.root = options.cliRoot;
|
|
363
|
-
injection.resolve.alias.vue = `${
|
|
365
|
+
injection.resolve.alias.vue = `${_chunkIXNT7VMKjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
364
366
|
}
|
|
365
367
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
366
368
|
},
|
|
@@ -381,7 +383,7 @@ function createConfigPlugin(options) {
|
|
|
381
383
|
}
|
|
382
384
|
function getDefine(options) {
|
|
383
385
|
return {
|
|
384
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
386
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkIXNT7VMKjs.toAtFS.call(void 0, options.clientRoot)),
|
|
385
387
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
386
388
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
387
389
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -390,8 +392,8 @@ function getDefine(options) {
|
|
|
390
392
|
}
|
|
391
393
|
|
|
392
394
|
// node/plugins/loaders.ts
|
|
393
|
-
|
|
394
|
-
var import_fast_deep_equal =
|
|
395
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
396
|
+
var import_fast_deep_equal = _chunkIXNT7VMKjs.__toESM.call(void 0, require_fast_deep_equal());
|
|
395
397
|
|
|
396
398
|
|
|
397
399
|
|
|
@@ -423,7 +425,7 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
423
425
|
}
|
|
424
426
|
});
|
|
425
427
|
function prepareSlideInfo(data) {
|
|
426
|
-
return
|
|
428
|
+
return _chunkIXNT7VMKjs.__spreadProps.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {}, data), {
|
|
427
429
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
428
430
|
});
|
|
429
431
|
}
|
|
@@ -512,7 +514,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
512
514
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
513
515
|
try {
|
|
514
516
|
const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
515
|
-
return await VuePlugin.handleHotUpdate(
|
|
517
|
+
return await VuePlugin.handleHotUpdate(_chunkIXNT7VMKjs.__spreadProps.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {}, ctx), {
|
|
516
518
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
517
519
|
file,
|
|
518
520
|
read() {
|
|
@@ -592,6 +594,15 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
592
594
|
const pageNo = parseInt(no) - 1;
|
|
593
595
|
return transformMarkdown(code, pageNo, data);
|
|
594
596
|
}
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: "slidev:context-transform:pre",
|
|
600
|
+
enforce: "pre",
|
|
601
|
+
async transform(code, id) {
|
|
602
|
+
if (!id.endsWith(".vue"))
|
|
603
|
+
return;
|
|
604
|
+
return transformVue(code);
|
|
605
|
+
}
|
|
595
606
|
}
|
|
596
607
|
];
|
|
597
608
|
function updateServerWatcher() {
|
|
@@ -603,14 +614,17 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
603
614
|
async function transformMarkdown(code, pageNo, data2) {
|
|
604
615
|
var _a, _b;
|
|
605
616
|
const layouts = await getLayouts();
|
|
606
|
-
const frontmatter =
|
|
617
|
+
const frontmatter = _chunkIXNT7VMKjs.__spreadValues.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
607
618
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
608
619
|
if (!layouts[layoutName])
|
|
609
620
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
610
621
|
delete frontmatter.title;
|
|
611
622
|
const imports = [
|
|
612
|
-
|
|
613
|
-
`
|
|
623
|
+
'import { inject as vueInject } from "vue"',
|
|
624
|
+
`import InjectedLayout from "${_chunkIXNT7VMKjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
625
|
+
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
626
|
+
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
627
|
+
"const $slidev = vueInject(injectionSlidevContext)"
|
|
614
628
|
];
|
|
615
629
|
code = code.replace(/(<script setup.*>)/g, `$1
|
|
616
630
|
${imports.join("\n")}
|
|
@@ -627,6 +641,59 @@ ${body}
|
|
|
627
641
|
${code.slice(injectB)}`;
|
|
628
642
|
return code;
|
|
629
643
|
}
|
|
644
|
+
function transformVue(code) {
|
|
645
|
+
if (code.includes("injectionSlidevContext"))
|
|
646
|
+
return code;
|
|
647
|
+
const imports = [
|
|
648
|
+
'import { inject as vueInject } from "vue"',
|
|
649
|
+
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
650
|
+
"const $slidev = vueInject(injectionSlidevContext)"
|
|
651
|
+
];
|
|
652
|
+
const matchScript = code.match(/<script((?!setup).)*(setup)?.*>/);
|
|
653
|
+
if (matchScript && matchScript[2]) {
|
|
654
|
+
return code.replace(/(<script.*>)/g, `$1
|
|
655
|
+
${imports.join("\n")}
|
|
656
|
+
`);
|
|
657
|
+
} else if (matchScript && !matchScript[2]) {
|
|
658
|
+
const matchExport = code.match(/export\s+default\s+[^{]*{/);
|
|
659
|
+
if (matchExport) {
|
|
660
|
+
const exportIndex = (matchExport.index || 0) + matchExport[0].length;
|
|
661
|
+
let component = code.slice(exportIndex);
|
|
662
|
+
component = component.slice(0, component.indexOf("<\/script>"));
|
|
663
|
+
if (component.match(/setup\s*\(/)) {
|
|
664
|
+
const scriptIndex = (matchScript.index || 0) + matchScript[0].length;
|
|
665
|
+
const provideImport = '\nimport { injectionSlidevContext } from "@slidev/client/constants"\n';
|
|
666
|
+
code = `${code.slice(0, scriptIndex)}${provideImport}${code.slice(scriptIndex)}`;
|
|
667
|
+
let injectIndex = exportIndex + provideImport.length;
|
|
668
|
+
let injectObject = "$slidev: { from: injectionSlidevContext },";
|
|
669
|
+
const matchInject = component.match(/.*inject\s*:\s*([\[{])/);
|
|
670
|
+
if (matchInject) {
|
|
671
|
+
injectIndex += (matchInject.index || 0) + matchInject[0].length;
|
|
672
|
+
if (matchInject[1] === "[") {
|
|
673
|
+
let injects = component.slice((matchInject.index || 0) + matchInject[0].length);
|
|
674
|
+
const injectEndIndex = injects.indexOf("]");
|
|
675
|
+
injects = injects.slice(0, injectEndIndex);
|
|
676
|
+
injectObject += injects.split(",").map((inject) => `${inject}: {from: ${inject}}`).join(",");
|
|
677
|
+
return `${code.slice(0, injectIndex - 1)}{
|
|
678
|
+
${injectObject}
|
|
679
|
+
}${code.slice(injectIndex + injectEndIndex + 1)}`;
|
|
680
|
+
} else {
|
|
681
|
+
return `${code.slice(0, injectIndex)}
|
|
682
|
+
${injectObject}
|
|
683
|
+
${code.slice(injectIndex)}`;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
return `${code.slice(0, injectIndex)}
|
|
687
|
+
inject: { ${injectObject} },
|
|
688
|
+
${code.slice(injectIndex)}`;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
return `<script setup>
|
|
693
|
+
${imports.join("\n")}
|
|
694
|
+
<\/script>
|
|
695
|
+
${code}`;
|
|
696
|
+
}
|
|
630
697
|
async function getLayouts() {
|
|
631
698
|
const now = Date.now();
|
|
632
699
|
if (now - _layouts_cache_time < 2e3)
|
|
@@ -655,9 +722,9 @@ ${code.slice(injectB)}`;
|
|
|
655
722
|
}
|
|
656
723
|
async function generateUserStyles() {
|
|
657
724
|
const imports = [
|
|
658
|
-
`import "${
|
|
659
|
-
`import "${
|
|
660
|
-
`import "${
|
|
725
|
+
`import "${_chunkIXNT7VMKjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
726
|
+
`import "${_chunkIXNT7VMKjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
727
|
+
`import "${_chunkIXNT7VMKjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
661
728
|
];
|
|
662
729
|
const roots2 = _utils.uniq.call(void 0, [
|
|
663
730
|
...themeRoots,
|
|
@@ -673,13 +740,13 @@ ${code.slice(injectB)}`;
|
|
|
673
740
|
];
|
|
674
741
|
for (const style of styles) {
|
|
675
742
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
676
|
-
imports.push(`import "${
|
|
743
|
+
imports.push(`import "${_chunkIXNT7VMKjs.toAtFS.call(void 0, style)}"`);
|
|
677
744
|
continue;
|
|
678
745
|
}
|
|
679
746
|
}
|
|
680
747
|
}
|
|
681
748
|
if (data.features.katex)
|
|
682
|
-
imports.push(`import "${
|
|
749
|
+
imports.push(`import "${_chunkIXNT7VMKjs.toAtFS.call(void 0, _chunkIXNT7VMKjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
683
750
|
return imports.join("\n");
|
|
684
751
|
}
|
|
685
752
|
async function generateMonacoTypes() {
|
|
@@ -688,7 +755,7 @@ ${code.slice(injectB)}`;
|
|
|
688
755
|
async function generateLayouts() {
|
|
689
756
|
const imports = [];
|
|
690
757
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
691
|
-
imports.push(`import __layout_${k} from "${
|
|
758
|
+
imports.push(`import __layout_${k} from "${_chunkIXNT7VMKjs.toAtFS.call(void 0, v)}"`);
|
|
692
759
|
return [k, `__layout_${k}`];
|
|
693
760
|
});
|
|
694
761
|
return [
|
|
@@ -736,10 +803,10 @@ ${routes.join(",\n")}
|
|
|
736
803
|
return [...imports, routesStr].join("\n");
|
|
737
804
|
}
|
|
738
805
|
function generateConfigs() {
|
|
739
|
-
const config =
|
|
806
|
+
const config = _chunkIXNT7VMKjs.__spreadValues.call(void 0, {}, data.config);
|
|
740
807
|
if (_utils.isString.call(void 0, config.title)) {
|
|
741
808
|
const tokens = md.parseInline(config.title, {});
|
|
742
|
-
config.title =
|
|
809
|
+
config.title = _chunkIXNT7VMKjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
743
810
|
}
|
|
744
811
|
if (_utils.isString.call(void 0, config.info))
|
|
745
812
|
config.info = md.render(config.info);
|
|
@@ -760,7 +827,7 @@ ${routes.join(",\n")}
|
|
|
760
827
|
];
|
|
761
828
|
}
|
|
762
829
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
763
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
830
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkIXNT7VMKjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
764
831
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
765
832
|
return `
|
|
766
833
|
${imports}
|
|
@@ -779,7 +846,7 @@ export default {
|
|
|
779
846
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
780
847
|
];
|
|
781
848
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
782
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
849
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkIXNT7VMKjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
783
850
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
784
851
|
return `
|
|
785
852
|
${imports}
|
|
@@ -794,7 +861,7 @@ export default {
|
|
|
794
861
|
}
|
|
795
862
|
|
|
796
863
|
// node/plugins/monacoTransform.ts
|
|
797
|
-
|
|
864
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
798
865
|
|
|
799
866
|
|
|
800
867
|
|
|
@@ -828,7 +895,7 @@ function createMonacoTypesLoader() {
|
|
|
828
895
|
}
|
|
829
896
|
|
|
830
897
|
// node/plugins/setupClient.ts
|
|
831
|
-
|
|
898
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
832
899
|
|
|
833
900
|
|
|
834
901
|
|
|
@@ -850,7 +917,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
850
917
|
setups.forEach((path, idx) => {
|
|
851
918
|
if (!_fs.existsSync.call(void 0, path))
|
|
852
919
|
return;
|
|
853
|
-
imports.push(`import __n${idx} from '${
|
|
920
|
+
imports.push(`import __n${idx} from '${_chunkIXNT7VMKjs.toAtFS.call(void 0, path)}'`);
|
|
854
921
|
let fn = `__n${idx}`;
|
|
855
922
|
let awaitFn = `await __n${idx}`;
|
|
856
923
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -878,7 +945,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
878
945
|
}
|
|
879
946
|
|
|
880
947
|
// node/plugins/markdown.ts
|
|
881
|
-
|
|
948
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
882
949
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
883
950
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
884
951
|
|
|
@@ -888,7 +955,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
888
955
|
var _plantumlencoder = require('plantuml-encoder');
|
|
889
956
|
|
|
890
957
|
// node/plugins/markdown-it-katex.ts
|
|
891
|
-
|
|
958
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
892
959
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
893
960
|
function isValidDelim(state, pos) {
|
|
894
961
|
const max = state.posMax;
|
|
@@ -1035,7 +1102,7 @@ function math_plugin(md2, options) {
|
|
|
1035
1102
|
}
|
|
1036
1103
|
|
|
1037
1104
|
// node/plugins/markdown-it-prism.ts
|
|
1038
|
-
|
|
1105
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
1039
1106
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1040
1107
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1041
1108
|
var DEFAULTS = {
|
|
@@ -1058,7 +1125,7 @@ function loadPrismLang(lang) {
|
|
|
1058
1125
|
}
|
|
1059
1126
|
function loadPrismPlugin(name) {
|
|
1060
1127
|
try {
|
|
1061
|
-
|
|
1128
|
+
_chunkIXNT7VMKjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1062
1129
|
} catch (e) {
|
|
1063
1130
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1064
1131
|
}
|
|
@@ -1098,7 +1165,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1098
1165
|
}
|
|
1099
1166
|
|
|
1100
1167
|
// node/plugins/markdown-it-shiki.ts
|
|
1101
|
-
|
|
1168
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
1102
1169
|
function getThemeName(theme) {
|
|
1103
1170
|
if (typeof theme === "string")
|
|
1104
1171
|
return theme;
|
|
@@ -1120,7 +1187,7 @@ function resolveShikiOptions(options) {
|
|
|
1120
1187
|
themes.push(options.theme);
|
|
1121
1188
|
}
|
|
1122
1189
|
}
|
|
1123
|
-
return
|
|
1190
|
+
return _chunkIXNT7VMKjs.__spreadProps.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {}, options), {
|
|
1124
1191
|
themes,
|
|
1125
1192
|
darkModeThemes: darkModeThemes ? {
|
|
1126
1193
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1158,7 +1225,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1158
1225
|
const setups = [];
|
|
1159
1226
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1160
1227
|
if (config.highlighter === "shiki") {
|
|
1161
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1228
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkIXNT7VMKjs.__toESM.call(void 0, _chunkIXNT7VMKjs.__require.call(void 0, "shiki")));
|
|
1162
1229
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1163
1230
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1164
1231
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1167,11 +1234,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1167
1234
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1168
1235
|
}
|
|
1169
1236
|
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1170
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1237
|
+
return _vitepluginmd2.default.call(void 0, _chunkIXNT7VMKjs.__spreadProps.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {
|
|
1171
1238
|
wrapperClasses: "",
|
|
1172
1239
|
headEnabled: false,
|
|
1173
1240
|
frontmatter: false,
|
|
1174
|
-
markdownItOptions:
|
|
1241
|
+
markdownItOptions: _chunkIXNT7VMKjs.__spreadValues.call(void 0, {
|
|
1175
1242
|
quotes: `""''`,
|
|
1176
1243
|
html: true,
|
|
1177
1244
|
xhtmlOut: true,
|
|
@@ -1277,8 +1344,7 @@ function transformPageCSS(md2, id) {
|
|
|
1277
1344
|
if (!page)
|
|
1278
1345
|
return md2;
|
|
1279
1346
|
const { isInsideCodeblocks } = getCodeBlocks(md2);
|
|
1280
|
-
const result = md2.replace(/(\n<style[^>]*?>)([\s\S]+?)(<\/style>)/g, (full, start, css, end) => {
|
|
1281
|
-
const index = md2.indexOf(full);
|
|
1347
|
+
const result = md2.replace(/(\n<style[^>]*?>)([\s\S]+?)(<\/style>)/g, (full, start, css, end, index) => {
|
|
1282
1348
|
if (index < 0 || isInsideCodeblocks(index))
|
|
1283
1349
|
return full;
|
|
1284
1350
|
if (!start.includes("scoped"))
|
|
@@ -1308,7 +1374,7 @@ function escapeVueInCode(md2) {
|
|
|
1308
1374
|
}
|
|
1309
1375
|
|
|
1310
1376
|
// node/plugins/patchTransform.ts
|
|
1311
|
-
|
|
1377
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
1312
1378
|
|
|
1313
1379
|
function createFixPlugins(options) {
|
|
1314
1380
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1372,10 +1438,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1372
1438
|
clientRoot,
|
|
1373
1439
|
data: { config }
|
|
1374
1440
|
} = options;
|
|
1375
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1441
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {
|
|
1376
1442
|
include: [/\.vue$/, /\.md$/],
|
|
1377
1443
|
exclude: [],
|
|
1378
|
-
template:
|
|
1444
|
+
template: _chunkIXNT7VMKjs.__spreadValues.call(void 0, {
|
|
1379
1445
|
compilerOptions: {
|
|
1380
1446
|
isCustomElement(tag) {
|
|
1381
1447
|
return customElements.has(tag);
|
|
@@ -1390,7 +1456,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1390
1456
|
MarkdownPlugin,
|
|
1391
1457
|
VuePlugin,
|
|
1392
1458
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1393
|
-
_vite4.default.call(void 0,
|
|
1459
|
+
_vite4.default.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {
|
|
1394
1460
|
extensions: ["vue", "md", "ts"],
|
|
1395
1461
|
dirs: [
|
|
1396
1462
|
`${clientRoot}/builtin`,
|
|
@@ -1408,11 +1474,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1408
1474
|
})
|
|
1409
1475
|
]
|
|
1410
1476
|
}, componentsOptions)),
|
|
1411
|
-
_vite2.default.call(void 0,
|
|
1477
|
+
_vite2.default.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {
|
|
1412
1478
|
defaultClass: "slidev-icon",
|
|
1413
1479
|
autoInstall: true
|
|
1414
1480
|
}, iconsOptions)),
|
|
1415
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1481
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkIXNT7VMKjs.__spreadValues.call(void 0, {
|
|
1416
1482
|
rules: [
|
|
1417
1483
|
..._vitepluginremoteassets.DefaultRules,
|
|
1418
1484
|
{
|
|
@@ -1425,7 +1491,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1425
1491
|
}, remoteAssetsOptions)) : null,
|
|
1426
1492
|
_vitepluginvueserverref2.default.call(void 0, {
|
|
1427
1493
|
debug: process.env.NODE_ENV === "development",
|
|
1428
|
-
state:
|
|
1494
|
+
state: _chunkIXNT7VMKjs.__spreadValues.call(void 0, {
|
|
1429
1495
|
sync: false,
|
|
1430
1496
|
nav: {
|
|
1431
1497
|
page: 0,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7FQD47HMjs = require('./chunk-7FQD47HM.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkIXNT7VMKjs = require('./chunk-IXNT7VMK.js');
|
|
7
7
|
|
|
8
8
|
// node/server.ts
|
|
9
|
-
|
|
9
|
+
_chunkIXNT7VMKjs.init_cjs_shims.call(void 0, );
|
|
10
10
|
var _path = require('path');
|
|
11
11
|
var _vite = require('vite');
|
|
12
12
|
async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
@@ -20,7 +20,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
plugins: [
|
|
23
|
-
await
|
|
23
|
+
await _chunk7FQD47HMjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
|
|
24
24
|
]
|
|
25
25
|
}));
|
|
26
26
|
return server;
|
|
@@ -21,7 +21,6 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
26
25
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
27
26
|
}) : x)(function(x) {
|
|
@@ -30,31 +29,31 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
30
29
|
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
31
30
|
});
|
|
32
31
|
var __esm = (fn, res) => function __init() {
|
|
33
|
-
return fn && (res = (0, fn[
|
|
32
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
34
33
|
};
|
|
35
34
|
var __commonJS = (cb, mod) => function __require2() {
|
|
36
|
-
return mod || (0, cb[
|
|
35
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
37
36
|
};
|
|
38
37
|
var __export = (target, all) => {
|
|
39
|
-
__markAsModule(target);
|
|
40
38
|
for (var name in all)
|
|
41
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
42
40
|
};
|
|
43
|
-
var
|
|
44
|
-
if (
|
|
45
|
-
for (let key of __getOwnPropNames(
|
|
46
|
-
if (!__hasOwnProp.call(
|
|
47
|
-
__defProp(
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
48
46
|
}
|
|
49
|
-
return
|
|
50
|
-
};
|
|
51
|
-
var __toModule = (module) => {
|
|
52
|
-
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
|
|
47
|
+
return to;
|
|
53
48
|
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
54
50
|
|
|
55
|
-
// ../../node_modules/.pnpm/tsup@5.
|
|
51
|
+
// ../../node_modules/.pnpm/tsup@5.12.5_typescript@4.6.3/node_modules/tsup/assets/cjs_shims.js
|
|
52
|
+
var getImportMetaUrl, importMetaUrl;
|
|
56
53
|
var init_cjs_shims = __esm({
|
|
57
|
-
"../../node_modules/.pnpm/tsup@5.
|
|
54
|
+
"../../node_modules/.pnpm/tsup@5.12.5_typescript@4.6.3/node_modules/tsup/assets/cjs_shims.js"() {
|
|
55
|
+
getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
56
|
+
importMetaUrl = exports.importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
59
|
|
|
@@ -129,4 +128,5 @@ function generateGoogleFontsUrl(options) {
|
|
|
129
128
|
|
|
130
129
|
|
|
131
130
|
|
|
132
|
-
|
|
131
|
+
|
|
132
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; exports.__commonJS = __commonJS; exports.__export = __export; exports.__toESM = __toESM; exports.importMetaUrl = importMetaUrl; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl;
|