@slidev/cli 0.35.2 → 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-Z26FNYJ3.js → build-3OBKYP4E.js} +58 -43
- package/dist/{build-52YMLBLI.mjs → build-JJPJN7L3.mjs} +52 -37
- package/dist/{chunk-DQSKYR2M.mjs → chunk-3VPTNK23.mjs} +64 -27
- package/dist/{chunk-OIH6DIQ4.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-X2HQWYH2.mjs → chunk-IY7QSYZ2.mjs} +119 -85
- package/dist/{chunk-GH4JJSLK.js → chunk-YUXTNPKA.js} +159 -125
- package/dist/cli.js +291 -247
- package/dist/cli.mjs +286 -242
- package/dist/{export-TH7MNEXN.js → export-3CTBMUMP.js} +9 -6
- package/dist/{export-5OVMZQWE.mjs → export-I2KYMDHO.mjs} +6 -3
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +16 -16
|
@@ -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);
|
|
@@ -238,7 +240,7 @@ async function loadDrawings(options) {
|
|
|
238
240
|
}));
|
|
239
241
|
return obj;
|
|
240
242
|
}
|
|
241
|
-
async function
|
|
243
|
+
async function writeDrawings(options, drawing) {
|
|
242
244
|
const dir = resolveDrawingsDir(options);
|
|
243
245
|
if (!dir)
|
|
244
246
|
return;
|
|
@@ -246,18 +248,20 @@ async function writeDarwings(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.
|
|
273
|
-
"@vueuse/head": "^0.7.
|
|
274
|
-
"@vueuse/math": "^9.
|
|
275
|
+
"@unocss/reset": "^0.45.14",
|
|
276
|
+
"@vueuse/core": "^9.1.1",
|
|
277
|
+
"@vueuse/head": "^0.7.9",
|
|
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.
|
|
286
|
+
katex: "^0.16.2",
|
|
287
|
+
mermaid: "^9.1.6",
|
|
284
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 = [
|
|
@@ -341,6 +345,9 @@ function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
|
|
341
345
|
var EXCLUDE = [
|
|
342
346
|
"@slidev/shared",
|
|
343
347
|
"@slidev/types",
|
|
348
|
+
"@slidev/client",
|
|
349
|
+
"@slidev/client/constants",
|
|
350
|
+
"@slidev/client/logic/dark",
|
|
344
351
|
"@vueuse/core",
|
|
345
352
|
"@vueuse/shared",
|
|
346
353
|
"@unocss/reset",
|
|
@@ -357,7 +364,7 @@ function createConfigPlugin(options) {
|
|
|
357
364
|
define: getDefine(options),
|
|
358
365
|
resolve: {
|
|
359
366
|
alias: {
|
|
360
|
-
"@slidev/client/": `${
|
|
367
|
+
"@slidev/client/": `${_chunkAW7KQET4js.toAtFS.call(void 0, options.clientRoot)}/`
|
|
361
368
|
}
|
|
362
369
|
},
|
|
363
370
|
optimizeDeps: {
|
|
@@ -381,7 +388,7 @@ function createConfigPlugin(options) {
|
|
|
381
388
|
css: options.data.config.css === "unocss" ? {
|
|
382
389
|
postcss: {
|
|
383
390
|
plugins: [
|
|
384
|
-
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())
|
|
385
392
|
]
|
|
386
393
|
}
|
|
387
394
|
} : {},
|
|
@@ -391,7 +398,7 @@ function createConfigPlugin(options) {
|
|
|
391
398
|
allow: _utils.uniq.call(void 0, [
|
|
392
399
|
searchForWorkspaceRoot(options.userRoot),
|
|
393
400
|
searchForWorkspaceRoot(options.cliRoot),
|
|
394
|
-
..._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"))] : []
|
|
395
402
|
])
|
|
396
403
|
}
|
|
397
404
|
}
|
|
@@ -400,7 +407,7 @@ function createConfigPlugin(options) {
|
|
|
400
407
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
401
408
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
402
409
|
injection.root = options.cliRoot;
|
|
403
|
-
injection.resolve.alias.vue = `${
|
|
410
|
+
injection.resolve.alias.vue = `${_chunkAW7KQET4js.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
404
411
|
}
|
|
405
412
|
return _vite.mergeConfig.call(void 0, config, injection);
|
|
406
413
|
},
|
|
@@ -421,7 +428,7 @@ function createConfigPlugin(options) {
|
|
|
421
428
|
}
|
|
422
429
|
function getDefine(options) {
|
|
423
430
|
return {
|
|
424
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
431
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkAW7KQET4js.toAtFS.call(void 0, options.clientRoot)),
|
|
425
432
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
426
433
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
427
434
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -431,8 +438,8 @@ function getDefine(options) {
|
|
|
431
438
|
}
|
|
432
439
|
|
|
433
440
|
// node/plugins/loaders.ts
|
|
434
|
-
|
|
435
|
-
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());
|
|
436
443
|
|
|
437
444
|
|
|
438
445
|
|
|
@@ -551,22 +558,24 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
551
558
|
Object.assign(data, newData);
|
|
552
559
|
if (hmrPages.size > 0)
|
|
553
560
|
moduleIds.add("/@slidev/titles.md");
|
|
554
|
-
const vueModules = (await Promise.all(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
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 || []);
|
|
570
579
|
hmrPages.clear();
|
|
571
580
|
const moduleEntries = [
|
|
572
581
|
...vueModules,
|
|
@@ -684,7 +693,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
684
693
|
delete frontmatter.title;
|
|
685
694
|
const imports = [
|
|
686
695
|
'import { inject as vueInject } from "vue"',
|
|
687
|
-
`import InjectedLayout from "${
|
|
696
|
+
`import InjectedLayout from "${_chunkAW7KQET4js.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
688
697
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
689
698
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
690
699
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -789,9 +798,9 @@ defineProps<{ no: number | string }>()`);
|
|
|
789
798
|
}
|
|
790
799
|
async function generateUserStyles() {
|
|
791
800
|
const imports = [
|
|
792
|
-
`import "${
|
|
793
|
-
`import "${
|
|
794
|
-
`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"))}"`
|
|
795
804
|
];
|
|
796
805
|
const roots2 = _utils.uniq.call(void 0, [
|
|
797
806
|
...themeRoots,
|
|
@@ -808,19 +817,30 @@ defineProps<{ no: number | string }>()`);
|
|
|
808
817
|
];
|
|
809
818
|
for (const style of styles) {
|
|
810
819
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
811
|
-
imports.push(`import "${
|
|
820
|
+
imports.push(`import "${_chunkAW7KQET4js.toAtFS.call(void 0, style)}"`);
|
|
812
821
|
continue;
|
|
813
822
|
}
|
|
814
823
|
}
|
|
815
824
|
}
|
|
816
825
|
if (data.features.katex)
|
|
817
|
-
imports.push(`import "${
|
|
826
|
+
imports.push(`import "${_chunkAW7KQET4js.toAtFS.call(void 0, _chunkAW7KQET4js.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
818
827
|
if (data.config.css === "unocss") {
|
|
819
|
-
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
|
+
);
|
|
820
834
|
imports.push('import "uno.css"');
|
|
821
835
|
} else {
|
|
822
|
-
imports.unshift(
|
|
823
|
-
|
|
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
|
+
);
|
|
824
844
|
}
|
|
825
845
|
return imports.join("\n");
|
|
826
846
|
}
|
|
@@ -829,10 +849,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
829
849
|
}
|
|
830
850
|
async function generateLayouts() {
|
|
831
851
|
const imports = [];
|
|
832
|
-
const layouts = _utils.objectMap.call(void 0,
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
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
|
+
);
|
|
836
859
|
return [
|
|
837
860
|
imports.join("\n"),
|
|
838
861
|
`export default {
|
|
@@ -878,7 +901,7 @@ ${routes.join(",\n")}
|
|
|
878
901
|
const config = { ...data.config, remote };
|
|
879
902
|
if (_utils.isString.call(void 0, config.title)) {
|
|
880
903
|
const tokens = md.parseInline(config.title, {});
|
|
881
|
-
config.title =
|
|
904
|
+
config.title = _chunkAW7KQET4js.stringifyMarkdownTokens.call(void 0, tokens);
|
|
882
905
|
}
|
|
883
906
|
if (_utils.isString.call(void 0, config.info))
|
|
884
907
|
config.info = md.render(config.info);
|
|
@@ -899,7 +922,7 @@ ${routes.join(",\n")}
|
|
|
899
922
|
];
|
|
900
923
|
}
|
|
901
924
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
902
|
-
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");
|
|
903
926
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
904
927
|
return `
|
|
905
928
|
${imports}
|
|
@@ -918,7 +941,7 @@ export default {
|
|
|
918
941
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
919
942
|
];
|
|
920
943
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
921
|
-
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");
|
|
922
945
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
923
946
|
return `
|
|
924
947
|
${imports}
|
|
@@ -933,7 +956,7 @@ export default {
|
|
|
933
956
|
}
|
|
934
957
|
|
|
935
958
|
// node/plugins/monacoTransform.ts
|
|
936
|
-
|
|
959
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
937
960
|
|
|
938
961
|
|
|
939
962
|
|
|
@@ -967,7 +990,7 @@ function createMonacoTypesLoader() {
|
|
|
967
990
|
}
|
|
968
991
|
|
|
969
992
|
// node/plugins/setupClient.ts
|
|
970
|
-
|
|
993
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
971
994
|
|
|
972
995
|
|
|
973
996
|
|
|
@@ -990,7 +1013,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
990
1013
|
setups.forEach((path, idx) => {
|
|
991
1014
|
if (!_fs.existsSync.call(void 0, path))
|
|
992
1015
|
return;
|
|
993
|
-
imports.push(`import __n${idx} from '${
|
|
1016
|
+
imports.push(`import __n${idx} from '${_chunkAW7KQET4js.toAtFS.call(void 0, path)}'`);
|
|
994
1017
|
let fn = `__n${idx}`;
|
|
995
1018
|
let awaitFn = `await __n${idx}`;
|
|
996
1019
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -1014,8 +1037,14 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1014
1037
|
fn += "()";
|
|
1015
1038
|
awaitFn += "()";
|
|
1016
1039
|
}
|
|
1017
|
-
injections.push(
|
|
1018
|
-
|
|
1040
|
+
injections.push(
|
|
1041
|
+
`// ${path}`,
|
|
1042
|
+
fn
|
|
1043
|
+
);
|
|
1044
|
+
asyncInjections.push(
|
|
1045
|
+
`// ${path}`,
|
|
1046
|
+
awaitFn
|
|
1047
|
+
);
|
|
1019
1048
|
});
|
|
1020
1049
|
code = code.replace("/* __imports__ */", imports.join("\n"));
|
|
1021
1050
|
code = code.replace("/* __injections__ */", injections.join("\n"));
|
|
@@ -1028,7 +1057,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1028
1057
|
}
|
|
1029
1058
|
|
|
1030
1059
|
// node/plugins/markdown.ts
|
|
1031
|
-
|
|
1060
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1032
1061
|
var _vitepluginvuemarkdown = require('vite-plugin-vue-markdown'); var _vitepluginvuemarkdown2 = _interopRequireDefault(_vitepluginvuemarkdown);
|
|
1033
1062
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
1034
1063
|
|
|
@@ -1039,7 +1068,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
1039
1068
|
var _plantumlencoder = require('plantuml-encoder');
|
|
1040
1069
|
|
|
1041
1070
|
// node/plugins/markdown-it-katex.ts
|
|
1042
|
-
|
|
1071
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1043
1072
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
1044
1073
|
function isValidDelim(state, pos) {
|
|
1045
1074
|
const max = state.posMax;
|
|
@@ -1186,7 +1215,7 @@ function math_plugin(md2, options) {
|
|
|
1186
1215
|
}
|
|
1187
1216
|
|
|
1188
1217
|
// node/plugins/markdown-it-prism.ts
|
|
1189
|
-
|
|
1218
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1190
1219
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1191
1220
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1192
1221
|
var DEFAULTS = {
|
|
@@ -1209,7 +1238,7 @@ function loadPrismLang(lang) {
|
|
|
1209
1238
|
}
|
|
1210
1239
|
function loadPrismPlugin(name) {
|
|
1211
1240
|
try {
|
|
1212
|
-
|
|
1241
|
+
_chunkAW7KQET4js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1213
1242
|
} catch (e) {
|
|
1214
1243
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1215
1244
|
}
|
|
@@ -1249,7 +1278,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1249
1278
|
}
|
|
1250
1279
|
|
|
1251
1280
|
// node/plugins/markdown-it-shiki.ts
|
|
1252
|
-
|
|
1281
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1253
1282
|
function getThemeName(theme) {
|
|
1254
1283
|
if (typeof theme === "string")
|
|
1255
1284
|
return theme;
|
|
@@ -1293,7 +1322,9 @@ var MarkdownItShiki = (markdownit, options = {}) => {
|
|
|
1293
1322
|
const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki"', '<pre class="slidev-code shiki shiki-light"');
|
|
1294
1323
|
return escapeVueInCode(`<pre class="shiki-container">${dark}${light}</pre>`);
|
|
1295
1324
|
} else {
|
|
1296
|
-
return escapeVueInCode(
|
|
1325
|
+
return escapeVueInCode(
|
|
1326
|
+
_highlighter.codeToHtml(code, { lang: lang || "text" }).replace('<pre class="shiki"', '<pre class="slidev-code shiki"')
|
|
1327
|
+
);
|
|
1297
1328
|
}
|
|
1298
1329
|
};
|
|
1299
1330
|
};
|
|
@@ -1310,7 +1341,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1310
1341
|
const setups = [];
|
|
1311
1342
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1312
1343
|
if (config.highlighter === "shiki") {
|
|
1313
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1344
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkAW7KQET4js.__toESM.call(void 0, _chunkAW7KQET4js.__require.call(void 0, "shiki")));
|
|
1314
1345
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1315
1346
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1316
1347
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1431,14 +1462,17 @@ function transformPageCSS(md2, id) {
|
|
|
1431
1462
|
if (!page)
|
|
1432
1463
|
return md2;
|
|
1433
1464
|
const { isInsideCodeblocks } = getCodeBlocks(md2);
|
|
1434
|
-
const result = md2.replace(
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
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}
|
|
1440
1473
|
${css}${end}`;
|
|
1441
|
-
|
|
1474
|
+
}
|
|
1475
|
+
);
|
|
1442
1476
|
return result;
|
|
1443
1477
|
}
|
|
1444
1478
|
function transformMermaid(md2) {
|
|
@@ -1461,7 +1495,7 @@ function escapeVueInCode(md2) {
|
|
|
1461
1495
|
}
|
|
1462
1496
|
|
|
1463
1497
|
// node/plugins/patchTransform.ts
|
|
1464
|
-
|
|
1498
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1465
1499
|
|
|
1466
1500
|
function createFixPlugins(options) {
|
|
1467
1501
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1482,14 +1516,14 @@ function createFixPlugins(options) {
|
|
|
1482
1516
|
}
|
|
1483
1517
|
|
|
1484
1518
|
// node/plugins/unocss.ts
|
|
1485
|
-
|
|
1519
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
1486
1520
|
|
|
1487
1521
|
|
|
1488
1522
|
|
|
1489
1523
|
|
|
1490
1524
|
async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data }, { unocss: unoOptions }) {
|
|
1491
1525
|
var _a, _b, _c, _d;
|
|
1492
|
-
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);
|
|
1493
1527
|
const configFiles = _utils.uniq.call(void 0, [
|
|
1494
1528
|
...themeRoots.map((i) => `${i}/uno.config.ts`),
|
|
1495
1529
|
...addonRoots.map((i) => `${i}/uno.config.ts`),
|
|
@@ -1629,7 +1663,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1629
1663
|
if (!options.data.config.drawings.persist)
|
|
1630
1664
|
return;
|
|
1631
1665
|
if (key === "drawings")
|
|
1632
|
-
|
|
1666
|
+
writeDrawings(options, patch != null ? patch : data);
|
|
1633
1667
|
}
|
|
1634
1668
|
}),
|
|
1635
1669
|
createConfigPlugin(options),
|