@slidev/cli 0.27.20 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-LK5RLV7L.js → build-QOWIXXQM.js} +28 -36
- package/dist/{build-OT76Q4KA.mjs → build-RXLELNJK.mjs} +32 -40
- package/dist/{chunk-3LH2GTGU.mjs → chunk-4OPORETI.mjs} +8 -2
- package/dist/{chunk-FN2B33RM.mjs → chunk-GWFBEY26.mjs} +23 -21
- package/dist/{chunk-VN5XPBZO.js → chunk-HF2PX43I.js} +4 -4
- package/dist/{chunk-3ND6GSCF.js → chunk-MFCJMLB5.js} +73 -71
- package/dist/{chunk-2TTM3NLX.mjs → chunk-MSSOXTVZ.mjs} +2 -2
- package/dist/{chunk-RUL3XRPS.js → chunk-QT3EQ43A.js} +9 -3
- package/dist/{chunk-JGWGLMRC.mjs → chunk-S4SUAR5N.mjs} +3241 -193
- package/dist/{chunk-XEDZVJCH.js → chunk-TJBBZIND.js} +3472 -424
- package/dist/cli.js +26 -26
- package/dist/cli.mjs +13 -13
- package/dist/{export-FUMCNU5W.js → export-KTPRCIUI.js} +5 -5
- package/dist/{export-IU4RLVW7.mjs → export-MHGYZJHW.mjs} +2 -2
- package/dist/index.d.ts +68 -4
- package/dist/index.js +9 -11
- package/dist/index.mjs +6 -8
- package/package.json +33 -32
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.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 = _chunkQT3EQ43Ajs.__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
|
+
_chunkQT3EQ43Ajs.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 = _chunkRUL3XRPSjs.__commonJS.call(void 0, {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// node/common.ts
|
|
62
|
-
|
|
62
|
+
_chunkQT3EQ43Ajs.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="${_chunkQT3EQ43Ajs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunkQT3EQ43Ajs.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
|
+
_chunkQT3EQ43Ajs.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
|
+
_chunkQT3EQ43Ajs.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 = _chunkQT3EQ43Ajs.__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, _chunkQT3EQ43Ajs.__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, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
171
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
172
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkQT3EQ43Ajs.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
|
+
_chunkQT3EQ43Ajs.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
|
+
_chunkQT3EQ43Ajs.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
|
+
_chunkQT3EQ43Ajs.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,32 @@ var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglo
|
|
|
239
239
|
|
|
240
240
|
// ../client/package.json
|
|
241
241
|
var dependencies = {
|
|
242
|
-
"@antfu/utils": "^0.
|
|
242
|
+
"@antfu/utils": "^0.5.0",
|
|
243
243
|
"@slidev/parser": "workspace:*",
|
|
244
244
|
"@slidev/types": "workspace:*",
|
|
245
|
-
"@vueuse/core": "^7.
|
|
246
|
-
"@vueuse/head": "^0.7.
|
|
247
|
-
"@vueuse/motion": "^2.0.0-beta.
|
|
248
|
-
codemirror: "^5.
|
|
245
|
+
"@vueuse/core": "^7.6.0",
|
|
246
|
+
"@vueuse/head": "^0.7.5",
|
|
247
|
+
"@vueuse/motion": "^2.0.0-beta.9",
|
|
248
|
+
codemirror: "^5.65.1",
|
|
249
249
|
drauu: "^0.2.1",
|
|
250
250
|
"file-saver": "^2.0.5",
|
|
251
251
|
"js-base64": "^3.7.2",
|
|
252
252
|
"js-yaml": "^4.1.0",
|
|
253
|
-
katex: "^0.15.
|
|
253
|
+
katex: "^0.15.2",
|
|
254
254
|
mermaid: "8.13.0",
|
|
255
|
-
"monaco-editor": "^0.
|
|
256
|
-
nanoid: "^3.
|
|
255
|
+
"monaco-editor": "^0.32.1",
|
|
256
|
+
nanoid: "^3.2.0",
|
|
257
257
|
prettier: "^2.5.1",
|
|
258
258
|
recordrtc: "^5.6.2",
|
|
259
|
-
resolve: "^1.
|
|
260
|
-
"vite-plugin-windicss": "^1.
|
|
261
|
-
vue: "^3.2.
|
|
259
|
+
resolve: "^1.22.0",
|
|
260
|
+
"vite-plugin-windicss": "^1.7.0",
|
|
261
|
+
vue: "^3.2.30",
|
|
262
262
|
"vue-router": "^4.0.12",
|
|
263
|
-
windicss: "^3.3
|
|
263
|
+
windicss: "^3.4.3"
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
// node/vite/searchRoot.ts
|
|
267
|
-
|
|
267
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
268
268
|
|
|
269
269
|
|
|
270
270
|
var ROOT_FILES = [
|
|
@@ -324,7 +324,7 @@ function createConfigPlugin(options) {
|
|
|
324
324
|
define: getDefine(options),
|
|
325
325
|
resolve: {
|
|
326
326
|
alias: {
|
|
327
|
-
"@slidev/client/": `${
|
|
327
|
+
"@slidev/client/": `${_chunkQT3EQ43Ajs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
328
328
|
}
|
|
329
329
|
},
|
|
330
330
|
optimizeDeps: {
|
|
@@ -350,7 +350,7 @@ function createConfigPlugin(options) {
|
|
|
350
350
|
allow: _utils.uniq.call(void 0, [
|
|
351
351
|
searchForWorkspaceRoot(options.userRoot),
|
|
352
352
|
searchForWorkspaceRoot(options.cliRoot),
|
|
353
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
353
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
354
354
|
])
|
|
355
355
|
}
|
|
356
356
|
}
|
|
@@ -359,7 +359,7 @@ function createConfigPlugin(options) {
|
|
|
359
359
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
360
360
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
361
361
|
injection.root = options.cliRoot;
|
|
362
|
-
injection.resolve.alias.vue = `${
|
|
362
|
+
injection.resolve.alias.vue = `${_chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
363
363
|
}
|
|
364
364
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
365
365
|
},
|
|
@@ -380,7 +380,7 @@ function createConfigPlugin(options) {
|
|
|
380
380
|
}
|
|
381
381
|
function getDefine(options) {
|
|
382
382
|
return {
|
|
383
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
383
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkQT3EQ43Ajs.toAtFS.call(void 0, options.clientRoot)),
|
|
384
384
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
385
385
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
386
386
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -389,8 +389,8 @@ function getDefine(options) {
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
// node/plugins/loaders.ts
|
|
392
|
-
|
|
393
|
-
var import_fast_deep_equal =
|
|
392
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
393
|
+
var import_fast_deep_equal = _chunkQT3EQ43Ajs.__toModule.call(void 0, require_fast_deep_equal());
|
|
394
394
|
|
|
395
395
|
|
|
396
396
|
|
|
@@ -422,7 +422,7 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
424
|
function prepareSlideInfo(data) {
|
|
425
|
-
return
|
|
425
|
+
return _chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, data), {
|
|
426
426
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
427
427
|
});
|
|
428
428
|
}
|
|
@@ -511,7 +511,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
511
511
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
512
512
|
try {
|
|
513
513
|
const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
514
|
-
return await VuePlugin.handleHotUpdate(
|
|
514
|
+
return await VuePlugin.handleHotUpdate(_chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, ctx), {
|
|
515
515
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
516
516
|
file,
|
|
517
517
|
read() {
|
|
@@ -593,13 +593,13 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
593
593
|
async function transformMarkdown(code, pageNo, data2) {
|
|
594
594
|
var _a, _b;
|
|
595
595
|
const layouts = await getLayouts();
|
|
596
|
-
const frontmatter =
|
|
596
|
+
const frontmatter = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
597
597
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
598
598
|
if (!layouts[layoutName])
|
|
599
599
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
600
600
|
delete frontmatter.title;
|
|
601
601
|
const imports = [
|
|
602
|
-
`import InjectedLayout from "${
|
|
602
|
+
`import InjectedLayout from "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
603
603
|
`const frontmatter = ${JSON.stringify(frontmatter)}`
|
|
604
604
|
];
|
|
605
605
|
code = code.replace(/(<script setup.*>)/g, `$1
|
|
@@ -645,9 +645,9 @@ ${code.slice(injectB)}`;
|
|
|
645
645
|
}
|
|
646
646
|
async function generateUserStyles() {
|
|
647
647
|
const imports = [
|
|
648
|
-
`import "${
|
|
649
|
-
`import "${
|
|
650
|
-
`import "${
|
|
648
|
+
`import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
649
|
+
`import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
650
|
+
`import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
651
651
|
];
|
|
652
652
|
const roots2 = _utils.uniq.call(void 0, [
|
|
653
653
|
...themeRoots,
|
|
@@ -663,13 +663,13 @@ ${code.slice(injectB)}`;
|
|
|
663
663
|
];
|
|
664
664
|
for (const style of styles) {
|
|
665
665
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
666
|
-
imports.push(`import "${
|
|
666
|
+
imports.push(`import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, style)}"`);
|
|
667
667
|
continue;
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
if (data.features.katex)
|
|
672
|
-
imports.push(`import "${
|
|
672
|
+
imports.push(`import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
673
673
|
return imports.join("\n");
|
|
674
674
|
}
|
|
675
675
|
async function generateMonacoTypes() {
|
|
@@ -678,7 +678,7 @@ ${code.slice(injectB)}`;
|
|
|
678
678
|
async function generateLayouts() {
|
|
679
679
|
const imports = [];
|
|
680
680
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
681
|
-
imports.push(`import __layout_${k} from "${
|
|
681
|
+
imports.push(`import __layout_${k} from "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, v)}"`);
|
|
682
682
|
return [k, `__layout_${k}`];
|
|
683
683
|
});
|
|
684
684
|
return [
|
|
@@ -706,7 +706,9 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
|
|
|
706
706
|
note: i.note,
|
|
707
707
|
filepath: ((_b = i.source) == null ? void 0 : _b.filepath) || entry,
|
|
708
708
|
id: idx,
|
|
709
|
-
no
|
|
709
|
+
no,
|
|
710
|
+
title: i.title,
|
|
711
|
+
level: i.level
|
|
710
712
|
},
|
|
711
713
|
__clicksElements: [],
|
|
712
714
|
__preloaded: false
|
|
@@ -724,10 +726,10 @@ ${routes.join(",\n")}
|
|
|
724
726
|
return [...imports, routesStr].join("\n");
|
|
725
727
|
}
|
|
726
728
|
function generateConfigs() {
|
|
727
|
-
const config =
|
|
729
|
+
const config = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, data.config);
|
|
728
730
|
if (_utils.isString.call(void 0, config.title)) {
|
|
729
731
|
const tokens = md.parseInline(config.title, {});
|
|
730
|
-
config.title =
|
|
732
|
+
config.title = _chunkQT3EQ43Ajs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
731
733
|
}
|
|
732
734
|
if (_utils.isString.call(void 0, config.info))
|
|
733
735
|
config.info = md.render(config.info);
|
|
@@ -748,7 +750,7 @@ ${routes.join(",\n")}
|
|
|
748
750
|
];
|
|
749
751
|
}
|
|
750
752
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
751
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
753
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkQT3EQ43Ajs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
752
754
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
753
755
|
return `
|
|
754
756
|
${imports}
|
|
@@ -763,7 +765,7 @@ export default {
|
|
|
763
765
|
}
|
|
764
766
|
|
|
765
767
|
// node/plugins/monacoTransform.ts
|
|
766
|
-
|
|
768
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
767
769
|
|
|
768
770
|
|
|
769
771
|
|
|
@@ -797,7 +799,7 @@ function createMonacoTypesLoader() {
|
|
|
797
799
|
}
|
|
798
800
|
|
|
799
801
|
// node/plugins/setupClient.ts
|
|
800
|
-
|
|
802
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
801
803
|
|
|
802
804
|
|
|
803
805
|
|
|
@@ -819,7 +821,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
819
821
|
setups.forEach((path, idx) => {
|
|
820
822
|
if (!_fs.existsSync.call(void 0, path))
|
|
821
823
|
return;
|
|
822
|
-
imports.push(`import __n${idx} from '${
|
|
824
|
+
imports.push(`import __n${idx} from '${_chunkQT3EQ43Ajs.toAtFS.call(void 0, path)}'`);
|
|
823
825
|
let fn = `__n${idx}`;
|
|
824
826
|
let awaitFn = `await __n${idx}`;
|
|
825
827
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -847,9 +849,9 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
847
849
|
}
|
|
848
850
|
|
|
849
851
|
// node/plugins/markdown.ts
|
|
850
|
-
|
|
852
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
851
853
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
852
|
-
var _jsbase64 = require('js-base64'); var
|
|
854
|
+
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
853
855
|
|
|
854
856
|
|
|
855
857
|
var _markdownitfootnote = require('markdown-it-footnote'); var _markdownitfootnote2 = _interopRequireDefault(_markdownitfootnote);
|
|
@@ -857,7 +859,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
857
859
|
var _plantumlencoder = require('plantuml-encoder');
|
|
858
860
|
|
|
859
861
|
// node/plugins/markdown-it-katex.ts
|
|
860
|
-
|
|
862
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
861
863
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
862
864
|
function isValidDelim(state, pos) {
|
|
863
865
|
const max = state.posMax;
|
|
@@ -1004,7 +1006,7 @@ function math_plugin(md2, options) {
|
|
|
1004
1006
|
}
|
|
1005
1007
|
|
|
1006
1008
|
// node/plugins/markdown-it-prism.ts
|
|
1007
|
-
|
|
1009
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
1008
1010
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1009
1011
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1010
1012
|
var DEFAULTS = {
|
|
@@ -1027,7 +1029,7 @@ function loadPrismLang(lang) {
|
|
|
1027
1029
|
}
|
|
1028
1030
|
function loadPrismPlugin(name) {
|
|
1029
1031
|
try {
|
|
1030
|
-
|
|
1032
|
+
_chunkQT3EQ43Ajs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1031
1033
|
} catch (e) {
|
|
1032
1034
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1033
1035
|
}
|
|
@@ -1067,7 +1069,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1067
1069
|
}
|
|
1068
1070
|
|
|
1069
1071
|
// node/plugins/markdown-it-shiki.ts
|
|
1070
|
-
|
|
1072
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
1071
1073
|
function getThemeName(theme) {
|
|
1072
1074
|
if (typeof theme === "string")
|
|
1073
1075
|
return theme;
|
|
@@ -1089,7 +1091,7 @@ function resolveShikiOptions(options) {
|
|
|
1089
1091
|
themes.push(options.theme);
|
|
1090
1092
|
}
|
|
1091
1093
|
}
|
|
1092
|
-
return
|
|
1094
|
+
return _chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, options), {
|
|
1093
1095
|
themes,
|
|
1094
1096
|
darkModeThemes: darkModeThemes ? {
|
|
1095
1097
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1127,7 +1129,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1127
1129
|
const setups = [];
|
|
1128
1130
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1129
1131
|
if (config.highlighter === "shiki") {
|
|
1130
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1132
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkQT3EQ43Ajs.__toModule.call(void 0, _chunkQT3EQ43Ajs.__require.call(void 0, "shiki")));
|
|
1131
1133
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1132
1134
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1133
1135
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1136,11 +1138,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1136
1138
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1137
1139
|
}
|
|
1138
1140
|
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1139
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1141
|
+
return _vitepluginmd2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
|
|
1140
1142
|
wrapperClasses: "",
|
|
1141
1143
|
headEnabled: false,
|
|
1142
1144
|
frontmatter: false,
|
|
1143
|
-
markdownItOptions:
|
|
1145
|
+
markdownItOptions: _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
|
|
1144
1146
|
quotes: `""''`,
|
|
1145
1147
|
html: true,
|
|
1146
1148
|
xhtmlOut: true,
|
|
@@ -1180,7 +1182,7 @@ function transformMarkdownMonaco(md2) {
|
|
|
1180
1182
|
md2 = md2.replace(/^```(\w+?)\s*{monaco}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code) => {
|
|
1181
1183
|
lang = lang.trim();
|
|
1182
1184
|
options = options.trim() || "{}";
|
|
1183
|
-
const encoded =
|
|
1185
|
+
const encoded = base64.encode(code, true);
|
|
1184
1186
|
return `<Monaco :code="'${encoded}'" lang="${lang}" v-bind="${options}" />`;
|
|
1185
1187
|
});
|
|
1186
1188
|
return md2;
|
|
@@ -1195,7 +1197,7 @@ function transformSlotSugar(md2) {
|
|
|
1195
1197
|
lines.forEach((line, idx) => {
|
|
1196
1198
|
if (isLineInsideCodeblocks(idx))
|
|
1197
1199
|
return;
|
|
1198
|
-
const match = line.
|
|
1200
|
+
const match = line.trimEnd().match(/^::\s*(\w+)\s*::$/);
|
|
1199
1201
|
if (match) {
|
|
1200
1202
|
lines[idx] = `${prevSlot ? "\n\n</template>\n" : "\n"}<template v-slot:${match[1]}="slotProps">
|
|
1201
1203
|
`;
|
|
@@ -1261,7 +1263,7 @@ function transformMermaid(md2) {
|
|
|
1261
1263
|
return md2.replace(/^```mermaid\s*?({.*?})?\n([\s\S]+?)\n```/mg, (full, options = "", code = "") => {
|
|
1262
1264
|
code = code.trim();
|
|
1263
1265
|
options = options.trim() || "{}";
|
|
1264
|
-
const encoded =
|
|
1266
|
+
const encoded = base64.encode(code, true);
|
|
1265
1267
|
return `<Mermaid :code="'${encoded}'" v-bind="${options}" />`;
|
|
1266
1268
|
});
|
|
1267
1269
|
}
|
|
@@ -1277,7 +1279,7 @@ function escapeVueInCode(md2) {
|
|
|
1277
1279
|
}
|
|
1278
1280
|
|
|
1279
1281
|
// node/plugins/patchTransform.ts
|
|
1280
|
-
|
|
1282
|
+
_chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
|
|
1281
1283
|
|
|
1282
1284
|
function createFixPlugins(options) {
|
|
1283
1285
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1331,10 +1333,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1331
1333
|
clientRoot,
|
|
1332
1334
|
data: { config }
|
|
1333
1335
|
} = options;
|
|
1334
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1336
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
|
|
1335
1337
|
include: [/\.vue$/, /\.md$/],
|
|
1336
1338
|
exclude: [],
|
|
1337
|
-
template:
|
|
1339
|
+
template: _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
|
|
1338
1340
|
compilerOptions: {
|
|
1339
1341
|
isCustomElement(tag) {
|
|
1340
1342
|
return customElements.has(tag);
|
|
@@ -1349,7 +1351,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1349
1351
|
MarkdownPlugin,
|
|
1350
1352
|
VuePlugin,
|
|
1351
1353
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1352
|
-
_vite4.default.call(void 0,
|
|
1354
|
+
_vite4.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
|
|
1353
1355
|
extensions: ["vue", "md", "ts"],
|
|
1354
1356
|
dirs: [
|
|
1355
1357
|
`${clientRoot}/builtin`,
|
|
@@ -1367,11 +1369,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1367
1369
|
})
|
|
1368
1370
|
]
|
|
1369
1371
|
}, componentsOptions)),
|
|
1370
|
-
_vite2.default.call(void 0,
|
|
1372
|
+
_vite2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
|
|
1371
1373
|
defaultClass: "slidev-icon",
|
|
1372
1374
|
autoInstall: true
|
|
1373
1375
|
}, iconsOptions)),
|
|
1374
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1376
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
|
|
1375
1377
|
rules: [
|
|
1376
1378
|
..._vitepluginremoteassets.DefaultRules,
|
|
1377
1379
|
{
|
|
@@ -35,6 +35,11 @@ var __esm = (fn, res) => function __init() {
|
|
|
35
35
|
var __commonJS = (cb, mod) => function __require2() {
|
|
36
36
|
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
37
37
|
};
|
|
38
|
+
var __export = (target, all) => {
|
|
39
|
+
__markAsModule(target);
|
|
40
|
+
for (var name in all)
|
|
41
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
42
|
+
};
|
|
38
43
|
var __reExport = (target, module, desc) => {
|
|
39
44
|
if (module && typeof module === "object" || typeof module === "function") {
|
|
40
45
|
for (let key of __getOwnPropNames(module))
|
|
@@ -47,9 +52,9 @@ var __toModule = (module) => {
|
|
|
47
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);
|
|
48
53
|
};
|
|
49
54
|
|
|
50
|
-
// ../../node_modules/.pnpm/tsup@5.11.
|
|
55
|
+
// ../../node_modules/.pnpm/tsup@5.11.13_typescript@4.5.5/node_modules/tsup/assets/cjs_shims.js
|
|
51
56
|
var init_cjs_shims = __esm({
|
|
52
|
-
"../../node_modules/.pnpm/tsup@5.11.
|
|
57
|
+
"../../node_modules/.pnpm/tsup@5.11.13_typescript@4.5.5/node_modules/tsup/assets/cjs_shims.js"() {
|
|
53
58
|
}
|
|
54
59
|
});
|
|
55
60
|
|
|
@@ -123,4 +128,5 @@ function generateGoogleFontsUrl(options) {
|
|
|
123
128
|
|
|
124
129
|
|
|
125
130
|
|
|
126
|
-
|
|
131
|
+
|
|
132
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; exports.__commonJS = __commonJS; exports.__export = __export; exports.__toModule = __toModule; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl;
|