@slidev/cli 0.35.5 → 0.35.6
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-PO2PXBSF.js → build-3OBKYP4E.js} +58 -43
- package/dist/{build-RBCFVFDG.mjs → build-JJPJN7L3.mjs} +52 -37
- package/dist/{chunk-SWNG6UPD.mjs → chunk-3VPTNK23.mjs} +64 -27
- package/dist/{chunk-AHXRM5NG.js → chunk-4UR3M5JD.js} +194 -157
- package/dist/{chunk-GVA336JI.mjs → chunk-57E5R3IA.mjs} +12 -7
- package/dist/{chunk-SQLX75IO.js → chunk-AW7KQET4.js} +12 -7
- package/dist/{chunk-QPGEWKWZ.mjs → chunk-IY7QSYZ2.mjs} +114 -83
- package/dist/{chunk-ZJSOFQBR.js → chunk-YUXTNPKA.js} +154 -123
- package/dist/cli.js +291 -252
- package/dist/cli.mjs +286 -247
- package/dist/{export-JXFGVO7B.js → export-3CTBMUMP.js} +4 -4
- package/dist/{export-U7F6XGP6.mjs → export-I2KYMDHO.mjs} +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +12 -12
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkAW7KQET4js = require('./chunk-AW7KQET4.js');
|
|
12
12
|
|
|
13
13
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
14
|
-
var require_fast_deep_equal =
|
|
14
|
+
var require_fast_deep_equal = _chunkAW7KQET4js.__commonJS.call(void 0, {
|
|
15
15
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
16
16
|
"use strict";
|
|
17
|
-
|
|
17
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
18
18
|
module.exports = function equal2(a, b) {
|
|
19
19
|
if (a === b)
|
|
20
20
|
return true;
|
|
@@ -57,7 +57,7 @@ var require_fast_deep_equal = _chunkSQLX75IOjs.__commonJS.call(void 0, {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
// node/common.ts
|
|
60
|
-
|
|
60
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
61
61
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
62
62
|
var _path = require('path');
|
|
63
63
|
var _utils = require('@antfu/utils');
|
|
@@ -86,8 +86,8 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
|
|
|
86
86
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
|
|
87
87
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
88
88
|
head += `
|
|
89
|
-
<link rel="stylesheet" href="${
|
|
90
|
-
main = main.replace("__ENTRY__",
|
|
89
|
+
<link rel="stylesheet" href="${_chunkAW7KQET4js.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
90
|
+
main = main.replace("__ENTRY__", _chunkAW7KQET4js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
91
91
|
return main;
|
|
92
92
|
}
|
|
93
93
|
async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config, command) {
|
|
@@ -111,14 +111,14 @@ async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config,
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// node/plugins/windicss.ts
|
|
114
|
-
|
|
114
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
119
119
|
|
|
120
120
|
// node/plugins/setupNode.ts
|
|
121
|
-
|
|
121
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
122
122
|
|
|
123
123
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
124
124
|
|
|
@@ -152,7 +152,7 @@ async function loadSetups(roots, name, arg, initial, merge = true) {
|
|
|
152
152
|
|
|
153
153
|
// node/plugins/windicss.ts
|
|
154
154
|
async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
155
|
-
const { default: WindiCSS, defaultConfigureFiles } = await Promise.resolve().then(() =>
|
|
155
|
+
const { default: WindiCSS, defaultConfigureFiles } = await Promise.resolve().then(() => _chunkAW7KQET4js.__toESM.call(void 0, _chunkAW7KQET4js.__require.call(void 0, "vite-plugin-windicss")));
|
|
156
156
|
const configFiles = _utils.uniq.call(void 0, [
|
|
157
157
|
...defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
|
|
158
158
|
...themeRoots.map((i) => `${i}/windi.config.ts`),
|
|
@@ -164,42 +164,44 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
164
164
|
if (config.default)
|
|
165
165
|
config = config.default;
|
|
166
166
|
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
167
|
-
return WindiCSS(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
config2.theme
|
|
173
|
-
|
|
174
|
-
config2.theme.extend
|
|
175
|
-
|
|
176
|
-
config2.theme.extend.fontFamily
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
167
|
+
return WindiCSS(
|
|
168
|
+
{
|
|
169
|
+
configFiles: [configFile],
|
|
170
|
+
config,
|
|
171
|
+
onConfigResolved(config2) {
|
|
172
|
+
if (!config2.theme)
|
|
173
|
+
config2.theme = {};
|
|
174
|
+
if (!config2.theme.extend)
|
|
175
|
+
config2.theme.extend = {};
|
|
176
|
+
if (!config2.theme.extend.fontFamily)
|
|
177
|
+
config2.theme.extend.fontFamily = {};
|
|
178
|
+
const fontFamily = config2.theme.extend.fontFamily;
|
|
179
|
+
fontFamily.sans || (fontFamily.sans = data.config.fonts.sans.join(","));
|
|
180
|
+
fontFamily.mono || (fontFamily.mono = data.config.fonts.mono.join(","));
|
|
181
|
+
fontFamily.serif || (fontFamily.serif = data.config.fonts.serif.join(","));
|
|
182
|
+
return config2;
|
|
183
|
+
},
|
|
184
|
+
onOptionsResolved(config2) {
|
|
185
|
+
themeRoots.forEach((i) => {
|
|
186
|
+
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
187
|
+
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
188
|
+
});
|
|
189
|
+
addonRoots.forEach((i) => {
|
|
190
|
+
config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
|
|
191
|
+
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
192
|
+
});
|
|
193
|
+
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
194
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkAW7KQET4js.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
195
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkAW7KQET4js.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
196
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkAW7KQET4js.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
197
|
+
},
|
|
198
|
+
...windiOptions
|
|
199
|
+
}
|
|
200
|
+
);
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
// node/plugins/preset.ts
|
|
202
|
-
|
|
204
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
203
205
|
|
|
204
206
|
var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
|
|
205
207
|
var _vite3 = require('unplugin-icons/vite'); var _vite4 = _interopRequireDefault(_vite3);
|
|
@@ -210,7 +212,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
|
|
|
210
212
|
|
|
211
213
|
|
|
212
214
|
// node/drawings.ts
|
|
213
|
-
|
|
215
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
214
216
|
|
|
215
217
|
|
|
216
218
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -246,18 +248,20 @@ async function writeDrawings(options, drawing) {
|
|
|
246
248
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
247
249
|
const SVG_HEAD = `<svg width="${width}" height="${height}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">`;
|
|
248
250
|
await _fsextra2.default.ensureDir(dir);
|
|
249
|
-
return Promise.all(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
return Promise.all(
|
|
252
|
+
Object.entries(drawing).map(async ([key, value]) => {
|
|
253
|
+
if (!value)
|
|
254
|
+
return;
|
|
255
|
+
const svg = `${SVG_HEAD}
|
|
253
256
|
${value}
|
|
254
257
|
</svg>`;
|
|
255
|
-
|
|
256
|
-
|
|
258
|
+
await _fsextra2.default.writeFile(_path.join.call(void 0, dir, `${key}.svg`), svg, "utf-8");
|
|
259
|
+
})
|
|
260
|
+
);
|
|
257
261
|
}
|
|
258
262
|
|
|
259
263
|
// node/plugins/extendConfig.ts
|
|
260
|
-
|
|
264
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
261
265
|
|
|
262
266
|
|
|
263
267
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
@@ -268,34 +272,34 @@ var dependencies = {
|
|
|
268
272
|
"@antfu/utils": "^0.5.2",
|
|
269
273
|
"@slidev/parser": "workspace:*",
|
|
270
274
|
"@slidev/types": "workspace:*",
|
|
271
|
-
"@unocss/reset": "^0.45.
|
|
272
|
-
"@vueuse/core": "^9.1.
|
|
275
|
+
"@unocss/reset": "^0.45.14",
|
|
276
|
+
"@vueuse/core": "^9.1.1",
|
|
273
277
|
"@vueuse/head": "^0.7.9",
|
|
274
|
-
"@vueuse/math": "^9.1.
|
|
278
|
+
"@vueuse/math": "^9.1.1",
|
|
275
279
|
"@vueuse/motion": "^2.0.0-beta.18",
|
|
276
280
|
codemirror: "^5.65.5",
|
|
277
|
-
defu: "^6.
|
|
278
|
-
drauu: "^0.3.
|
|
281
|
+
defu: "^6.1.0",
|
|
282
|
+
drauu: "^0.3.1",
|
|
279
283
|
"file-saver": "^2.0.5",
|
|
280
284
|
"js-base64": "^3.7.2",
|
|
281
285
|
"js-yaml": "^4.1.0",
|
|
282
|
-
katex: "^0.16.
|
|
283
|
-
mermaid: "^9.1.
|
|
284
|
-
"monaco-editor": "^0.
|
|
286
|
+
katex: "^0.16.2",
|
|
287
|
+
mermaid: "^9.1.6",
|
|
288
|
+
"monaco-editor": "^0.33.0",
|
|
285
289
|
nanoid: "^4.0.0",
|
|
286
290
|
prettier: "^2.7.1",
|
|
287
291
|
recordrtc: "^5.6.2",
|
|
288
292
|
resolve: "^1.22.1",
|
|
289
|
-
unocss: "^0.45.
|
|
293
|
+
unocss: "^0.45.14",
|
|
290
294
|
"vite-plugin-windicss": "^1.8.7",
|
|
291
|
-
vue: "^3.2.
|
|
292
|
-
"vue-router": "^4.1.
|
|
295
|
+
vue: "^3.2.38",
|
|
296
|
+
"vue-router": "^4.1.5",
|
|
293
297
|
"vue-starport": "^0.3.0",
|
|
294
298
|
windicss: "^3.5.6"
|
|
295
299
|
};
|
|
296
300
|
|
|
297
301
|
// node/vite/searchRoot.ts
|
|
298
|
-
|
|
302
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
299
303
|
|
|
300
304
|
|
|
301
305
|
var ROOT_FILES = [
|
|
@@ -360,7 +364,7 @@ function createConfigPlugin(options) {
|
|
|
360
364
|
define: getDefine(options),
|
|
361
365
|
resolve: {
|
|
362
366
|
alias: {
|
|
363
|
-
"@slidev/client/": `${
|
|
367
|
+
"@slidev/client/": `${_chunkAW7KQET4js.toAtFS.call(void 0, options.clientRoot)}/`
|
|
364
368
|
}
|
|
365
369
|
},
|
|
366
370
|
optimizeDeps: {
|
|
@@ -384,7 +388,7 @@ function createConfigPlugin(options) {
|
|
|
384
388
|
css: options.data.config.css === "unocss" ? {
|
|
385
389
|
postcss: {
|
|
386
390
|
plugins: [
|
|
387
|
-
await Promise.resolve().then(() =>
|
|
391
|
+
await Promise.resolve().then(() => _chunkAW7KQET4js.__toESM.call(void 0, _chunkAW7KQET4js.__require.call(void 0, "postcss-nested"))).then((r) => r.default())
|
|
388
392
|
]
|
|
389
393
|
}
|
|
390
394
|
} : {},
|
|
@@ -394,7 +398,7 @@ function createConfigPlugin(options) {
|
|
|
394
398
|
allow: _utils.uniq.call(void 0, [
|
|
395
399
|
searchForWorkspaceRoot(options.userRoot),
|
|
396
400
|
searchForWorkspaceRoot(options.cliRoot),
|
|
397
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
401
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkAW7KQET4js.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkAW7KQET4js.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
398
402
|
])
|
|
399
403
|
}
|
|
400
404
|
}
|
|
@@ -403,7 +407,7 @@ function createConfigPlugin(options) {
|
|
|
403
407
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
404
408
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
405
409
|
injection.root = options.cliRoot;
|
|
406
|
-
injection.resolve.alias.vue = `${
|
|
410
|
+
injection.resolve.alias.vue = `${_chunkAW7KQET4js.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
407
411
|
}
|
|
408
412
|
return _vite.mergeConfig.call(void 0, config, injection);
|
|
409
413
|
},
|
|
@@ -424,7 +428,7 @@ function createConfigPlugin(options) {
|
|
|
424
428
|
}
|
|
425
429
|
function getDefine(options) {
|
|
426
430
|
return {
|
|
427
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
431
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkAW7KQET4js.toAtFS.call(void 0, options.clientRoot)),
|
|
428
432
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
429
433
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
430
434
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -434,8 +438,8 @@ function getDefine(options) {
|
|
|
434
438
|
}
|
|
435
439
|
|
|
436
440
|
// node/plugins/loaders.ts
|
|
437
|
-
|
|
438
|
-
var import_fast_deep_equal =
|
|
441
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
442
|
+
var import_fast_deep_equal = _chunkAW7KQET4js.__toESM.call(void 0, require_fast_deep_equal());
|
|
439
443
|
|
|
440
444
|
|
|
441
445
|
|
|
@@ -554,22 +558,24 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
554
558
|
Object.assign(data, newData);
|
|
555
559
|
if (hmrPages.size > 0)
|
|
556
560
|
moduleIds.add("/@slidev/titles.md");
|
|
557
|
-
const vueModules = (await Promise.all(
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
561
|
+
const vueModules = (await Promise.all(
|
|
562
|
+
Array.from(hmrPages).map(async (i) => {
|
|
563
|
+
var _a2;
|
|
564
|
+
const file = `${slidePrefix}${i + 1}.md`;
|
|
565
|
+
try {
|
|
566
|
+
const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
567
|
+
return await VuePlugin.handleHotUpdate({
|
|
568
|
+
...ctx,
|
|
569
|
+
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
570
|
+
file,
|
|
571
|
+
read() {
|
|
572
|
+
return md2;
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
} catch (e3) {
|
|
576
|
+
}
|
|
577
|
+
})
|
|
578
|
+
)).flatMap((i) => i || []);
|
|
573
579
|
hmrPages.clear();
|
|
574
580
|
const moduleEntries = [
|
|
575
581
|
...vueModules,
|
|
@@ -687,7 +693,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
687
693
|
delete frontmatter.title;
|
|
688
694
|
const imports = [
|
|
689
695
|
'import { inject as vueInject } from "vue"',
|
|
690
|
-
`import InjectedLayout from "${
|
|
696
|
+
`import InjectedLayout from "${_chunkAW7KQET4js.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
691
697
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
692
698
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
693
699
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -792,9 +798,9 @@ defineProps<{ no: number | string }>()`);
|
|
|
792
798
|
}
|
|
793
799
|
async function generateUserStyles() {
|
|
794
800
|
const imports = [
|
|
795
|
-
`import "${
|
|
796
|
-
`import "${
|
|
797
|
-
`import "${
|
|
801
|
+
`import "${_chunkAW7KQET4js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
802
|
+
`import "${_chunkAW7KQET4js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
803
|
+
`import "${_chunkAW7KQET4js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
798
804
|
];
|
|
799
805
|
const roots2 = _utils.uniq.call(void 0, [
|
|
800
806
|
...themeRoots,
|
|
@@ -811,19 +817,30 @@ defineProps<{ no: number | string }>()`);
|
|
|
811
817
|
];
|
|
812
818
|
for (const style of styles) {
|
|
813
819
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
814
|
-
imports.push(`import "${
|
|
820
|
+
imports.push(`import "${_chunkAW7KQET4js.toAtFS.call(void 0, style)}"`);
|
|
815
821
|
continue;
|
|
816
822
|
}
|
|
817
823
|
}
|
|
818
824
|
}
|
|
819
825
|
if (data.features.katex)
|
|
820
|
-
imports.push(`import "${
|
|
826
|
+
imports.push(`import "${_chunkAW7KQET4js.toAtFS.call(void 0, _chunkAW7KQET4js.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
821
827
|
if (data.config.css === "unocss") {
|
|
822
|
-
imports.unshift(
|
|
828
|
+
imports.unshift(
|
|
829
|
+
'import "@unocss/reset/tailwind.css"',
|
|
830
|
+
'import "uno:preflights.css"',
|
|
831
|
+
'import "uno:typography.css"',
|
|
832
|
+
'import "uno:shortcuts.css"'
|
|
833
|
+
);
|
|
823
834
|
imports.push('import "uno.css"');
|
|
824
835
|
} else {
|
|
825
|
-
imports.unshift(
|
|
826
|
-
|
|
836
|
+
imports.unshift(
|
|
837
|
+
'import "virtual:windi-components.css"',
|
|
838
|
+
'import "virtual:windi-base.css"'
|
|
839
|
+
);
|
|
840
|
+
imports.push(
|
|
841
|
+
'import "virtual:windi-utilities.css"',
|
|
842
|
+
'import "virtual:windi-devtools"'
|
|
843
|
+
);
|
|
827
844
|
}
|
|
828
845
|
return imports.join("\n");
|
|
829
846
|
}
|
|
@@ -832,10 +849,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
832
849
|
}
|
|
833
850
|
async function generateLayouts() {
|
|
834
851
|
const imports = [];
|
|
835
|
-
const layouts = _utils.objectMap.call(void 0,
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
852
|
+
const layouts = _utils.objectMap.call(void 0,
|
|
853
|
+
await getLayouts(),
|
|
854
|
+
(k, v) => {
|
|
855
|
+
imports.push(`import __layout_${k} from "${_chunkAW7KQET4js.toAtFS.call(void 0, v)}"`);
|
|
856
|
+
return [k, `__layout_${k}`];
|
|
857
|
+
}
|
|
858
|
+
);
|
|
839
859
|
return [
|
|
840
860
|
imports.join("\n"),
|
|
841
861
|
`export default {
|
|
@@ -881,7 +901,7 @@ ${routes.join(",\n")}
|
|
|
881
901
|
const config = { ...data.config, remote };
|
|
882
902
|
if (_utils.isString.call(void 0, config.title)) {
|
|
883
903
|
const tokens = md.parseInline(config.title, {});
|
|
884
|
-
config.title =
|
|
904
|
+
config.title = _chunkAW7KQET4js.stringifyMarkdownTokens.call(void 0, tokens);
|
|
885
905
|
}
|
|
886
906
|
if (_utils.isString.call(void 0, config.info))
|
|
887
907
|
config.info = md.render(config.info);
|
|
@@ -902,7 +922,7 @@ ${routes.join(",\n")}
|
|
|
902
922
|
];
|
|
903
923
|
}
|
|
904
924
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
905
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
925
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkAW7KQET4js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
906
926
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
907
927
|
return `
|
|
908
928
|
${imports}
|
|
@@ -921,7 +941,7 @@ export default {
|
|
|
921
941
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
922
942
|
];
|
|
923
943
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
924
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
944
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkAW7KQET4js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
925
945
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
926
946
|
return `
|
|
927
947
|
${imports}
|
|
@@ -936,7 +956,7 @@ export default {
|
|
|
936
956
|
}
|
|
937
957
|
|
|
938
958
|
// node/plugins/monacoTransform.ts
|
|
939
|
-
|
|
959
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
940
960
|
|
|
941
961
|
|
|
942
962
|
|
|
@@ -970,7 +990,7 @@ function createMonacoTypesLoader() {
|
|
|
970
990
|
}
|
|
971
991
|
|
|
972
992
|
// node/plugins/setupClient.ts
|
|
973
|
-
|
|
993
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
974
994
|
|
|
975
995
|
|
|
976
996
|
|
|
@@ -993,7 +1013,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
993
1013
|
setups.forEach((path, idx) => {
|
|
994
1014
|
if (!_fs.existsSync.call(void 0, path))
|
|
995
1015
|
return;
|
|
996
|
-
imports.push(`import __n${idx} from '${
|
|
1016
|
+
imports.push(`import __n${idx} from '${_chunkAW7KQET4js.toAtFS.call(void 0, path)}'`);
|
|
997
1017
|
let fn = `__n${idx}`;
|
|
998
1018
|
let awaitFn = `await __n${idx}`;
|
|
999
1019
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -1017,8 +1037,14 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1017
1037
|
fn += "()";
|
|
1018
1038
|
awaitFn += "()";
|
|
1019
1039
|
}
|
|
1020
|
-
injections.push(
|
|
1021
|
-
|
|
1040
|
+
injections.push(
|
|
1041
|
+
`// ${path}`,
|
|
1042
|
+
fn
|
|
1043
|
+
);
|
|
1044
|
+
asyncInjections.push(
|
|
1045
|
+
`// ${path}`,
|
|
1046
|
+
awaitFn
|
|
1047
|
+
);
|
|
1022
1048
|
});
|
|
1023
1049
|
code = code.replace("/* __imports__ */", imports.join("\n"));
|
|
1024
1050
|
code = code.replace("/* __injections__ */", injections.join("\n"));
|
|
@@ -1031,7 +1057,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1031
1057
|
}
|
|
1032
1058
|
|
|
1033
1059
|
// node/plugins/markdown.ts
|
|
1034
|
-
|
|
1060
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1035
1061
|
var _vitepluginvuemarkdown = require('vite-plugin-vue-markdown'); var _vitepluginvuemarkdown2 = _interopRequireDefault(_vitepluginvuemarkdown);
|
|
1036
1062
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
1037
1063
|
|
|
@@ -1042,7 +1068,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
1042
1068
|
var _plantumlencoder = require('plantuml-encoder');
|
|
1043
1069
|
|
|
1044
1070
|
// node/plugins/markdown-it-katex.ts
|
|
1045
|
-
|
|
1071
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1046
1072
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
1047
1073
|
function isValidDelim(state, pos) {
|
|
1048
1074
|
const max = state.posMax;
|
|
@@ -1189,7 +1215,7 @@ function math_plugin(md2, options) {
|
|
|
1189
1215
|
}
|
|
1190
1216
|
|
|
1191
1217
|
// node/plugins/markdown-it-prism.ts
|
|
1192
|
-
|
|
1218
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1193
1219
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1194
1220
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1195
1221
|
var DEFAULTS = {
|
|
@@ -1212,7 +1238,7 @@ function loadPrismLang(lang) {
|
|
|
1212
1238
|
}
|
|
1213
1239
|
function loadPrismPlugin(name) {
|
|
1214
1240
|
try {
|
|
1215
|
-
|
|
1241
|
+
_chunkAW7KQET4js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1216
1242
|
} catch (e) {
|
|
1217
1243
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1218
1244
|
}
|
|
@@ -1252,7 +1278,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1252
1278
|
}
|
|
1253
1279
|
|
|
1254
1280
|
// node/plugins/markdown-it-shiki.ts
|
|
1255
|
-
|
|
1281
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1256
1282
|
function getThemeName(theme) {
|
|
1257
1283
|
if (typeof theme === "string")
|
|
1258
1284
|
return theme;
|
|
@@ -1296,7 +1322,9 @@ var MarkdownItShiki = (markdownit, options = {}) => {
|
|
|
1296
1322
|
const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki"', '<pre class="slidev-code shiki shiki-light"');
|
|
1297
1323
|
return escapeVueInCode(`<pre class="shiki-container">${dark}${light}</pre>`);
|
|
1298
1324
|
} else {
|
|
1299
|
-
return escapeVueInCode(
|
|
1325
|
+
return escapeVueInCode(
|
|
1326
|
+
_highlighter.codeToHtml(code, { lang: lang || "text" }).replace('<pre class="shiki"', '<pre class="slidev-code shiki"')
|
|
1327
|
+
);
|
|
1300
1328
|
}
|
|
1301
1329
|
};
|
|
1302
1330
|
};
|
|
@@ -1313,7 +1341,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1313
1341
|
const setups = [];
|
|
1314
1342
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1315
1343
|
if (config.highlighter === "shiki") {
|
|
1316
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1344
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkAW7KQET4js.__toESM.call(void 0, _chunkAW7KQET4js.__require.call(void 0, "shiki")));
|
|
1317
1345
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1318
1346
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1319
1347
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1434,14 +1462,17 @@ function transformPageCSS(md2, id) {
|
|
|
1434
1462
|
if (!page)
|
|
1435
1463
|
return md2;
|
|
1436
1464
|
const { isInsideCodeblocks } = getCodeBlocks(md2);
|
|
1437
|
-
const result = md2.replace(
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1465
|
+
const result = md2.replace(
|
|
1466
|
+
/(\n<style[^>]*?>)([\s\S]+?)(<\/style>)/g,
|
|
1467
|
+
(full, start, css, end, index) => {
|
|
1468
|
+
if (index < 0 || isInsideCodeblocks(index))
|
|
1469
|
+
return full;
|
|
1470
|
+
if (!start.includes("scoped"))
|
|
1471
|
+
start = start.replace("<style", "<style scoped");
|
|
1472
|
+
return `${start}
|
|
1443
1473
|
${css}${end}`;
|
|
1444
|
-
|
|
1474
|
+
}
|
|
1475
|
+
);
|
|
1445
1476
|
return result;
|
|
1446
1477
|
}
|
|
1447
1478
|
function transformMermaid(md2) {
|
|
@@ -1464,7 +1495,7 @@ function escapeVueInCode(md2) {
|
|
|
1464
1495
|
}
|
|
1465
1496
|
|
|
1466
1497
|
// node/plugins/patchTransform.ts
|
|
1467
|
-
|
|
1498
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1468
1499
|
|
|
1469
1500
|
function createFixPlugins(options) {
|
|
1470
1501
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1485,14 +1516,14 @@ function createFixPlugins(options) {
|
|
|
1485
1516
|
}
|
|
1486
1517
|
|
|
1487
1518
|
// node/plugins/unocss.ts
|
|
1488
|
-
|
|
1519
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1489
1520
|
|
|
1490
1521
|
|
|
1491
1522
|
|
|
1492
1523
|
|
|
1493
1524
|
async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data }, { unocss: unoOptions }) {
|
|
1494
1525
|
var _a, _b, _c, _d;
|
|
1495
|
-
const UnoCSS = await Promise.resolve().then(() =>
|
|
1526
|
+
const UnoCSS = await Promise.resolve().then(() => _chunkAW7KQET4js.__toESM.call(void 0, _chunkAW7KQET4js.__require.call(void 0, "unocss/vite"))).then((r) => r.default);
|
|
1496
1527
|
const configFiles = _utils.uniq.call(void 0, [
|
|
1497
1528
|
...themeRoots.map((i) => `${i}/uno.config.ts`),
|
|
1498
1529
|
...addonRoots.map((i) => `${i}/uno.config.ts`),
|