@slidev/cli 0.35.4 → 0.36.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.
@@ -8,13 +8,13 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
11
+ var _chunk74QPSS6Tjs = require('./chunk-74QPSS6T.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 = _chunkSQLX75IOjs.__commonJS.call(void 0, {
14
+ var require_fast_deep_equal = _chunk74QPSS6Tjs.__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
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
17
+ _chunk74QPSS6Tjs.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
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
60
+ _chunk74QPSS6Tjs.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="${_chunkSQLX75IOjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
90
- main = main.replace("__ENTRY__", _chunkSQLX75IOjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
89
+ <link rel="stylesheet" href="${_chunk74QPSS6Tjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
90
+ main = main.replace("__ENTRY__", _chunk74QPSS6Tjs.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
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
114
+ _chunk74QPSS6Tjs.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
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
121
+ _chunk74QPSS6Tjs.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(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "vite-plugin-windicss")));
155
+ const { default: WindiCSS, defaultConfigureFiles } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__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
- configFiles: [configFile],
169
- config,
170
- onConfigResolved(config2) {
171
- if (!config2.theme)
172
- config2.theme = {};
173
- if (!config2.theme.extend)
174
- config2.theme.extend = {};
175
- if (!config2.theme.extend.fontFamily)
176
- config2.theme.extend.fontFamily = {};
177
- const fontFamily = config2.theme.extend.fontFamily;
178
- fontFamily.sans || (fontFamily.sans = data.config.fonts.sans.join(","));
179
- fontFamily.mono || (fontFamily.mono = data.config.fonts.mono.join(","));
180
- fontFamily.serif || (fontFamily.serif = data.config.fonts.serif.join(","));
181
- return config2;
182
- },
183
- onOptionsResolved(config2) {
184
- themeRoots.forEach((i) => {
185
- config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
186
- config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
187
- });
188
- addonRoots.forEach((i) => {
189
- config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
190
- config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
191
- });
192
- config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
193
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkSQLX75IOjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
194
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkSQLX75IOjs.resolveImportPath.call(void 0, "katex/package.json", true)));
195
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkSQLX75IOjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
196
- },
197
- ...windiOptions
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, _chunk74QPSS6Tjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
195
+ config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveImportPath.call(void 0, "katex/package.json", true)));
196
+ config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
197
+ },
198
+ ...windiOptions
199
+ }
200
+ );
199
201
  }
200
202
 
201
203
  // node/plugins/preset.ts
202
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
204
+ _chunk74QPSS6Tjs.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,12 +212,15 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
210
212
 
211
213
 
212
214
  // node/drawings.ts
213
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
215
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
214
216
 
215
217
 
216
218
  var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
217
219
  function resolveDrawingsDir(options) {
218
- return options.data.config.drawings.persist ? _path.resolve.call(void 0, _path.dirname.call(void 0, options.entry), options.data.config.drawings.persist) : void 0;
220
+ return options.data.config.drawings.persist ? _path.resolve.call(void 0,
221
+ _path.dirname.call(void 0, options.entry),
222
+ options.data.config.drawings.persist
223
+ ) : void 0;
219
224
  }
220
225
  async function loadDrawings(options) {
221
226
  const dir = resolveDrawingsDir(options);
@@ -246,18 +251,20 @@ async function writeDrawings(options, drawing) {
246
251
  const height = Math.round(width / options.data.config.aspectRatio);
247
252
  const SVG_HEAD = `<svg width="${width}" height="${height}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">`;
248
253
  await _fsextra2.default.ensureDir(dir);
249
- return Promise.all(Object.entries(drawing).map(async ([key, value]) => {
250
- if (!value)
251
- return;
252
- const svg = `${SVG_HEAD}
254
+ return Promise.all(
255
+ Object.entries(drawing).map(async ([key, value]) => {
256
+ if (!value)
257
+ return;
258
+ const svg = `${SVG_HEAD}
253
259
  ${value}
254
260
  </svg>`;
255
- await _fsextra2.default.writeFile(_path.join.call(void 0, dir, `${key}.svg`), svg, "utf-8");
256
- }));
261
+ await _fsextra2.default.writeFile(_path.join.call(void 0, dir, `${key}.svg`), svg, "utf-8");
262
+ })
263
+ );
257
264
  }
258
265
 
259
266
  // node/plugins/extendConfig.ts
260
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
267
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
261
268
 
262
269
 
263
270
  var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
@@ -268,34 +275,34 @@ var dependencies = {
268
275
  "@antfu/utils": "^0.5.2",
269
276
  "@slidev/parser": "workspace:*",
270
277
  "@slidev/types": "workspace:*",
271
- "@unocss/reset": "^0.45.1",
272
- "@vueuse/core": "^9.0.1",
273
- "@vueuse/head": "^0.7.8",
274
- "@vueuse/math": "^9.0.1",
275
- "@vueuse/motion": "^2.0.0-beta.18",
278
+ "@unocss/reset": "^0.45.20",
279
+ "@vueuse/core": "^9.2.0",
280
+ "@vueuse/head": "^0.7.10",
281
+ "@vueuse/math": "^9.2.0",
282
+ "@vueuse/motion": "^2.0.0-beta.22",
276
283
  codemirror: "^5.65.5",
277
- defu: "^6.0.0",
278
- drauu: "^0.3.0",
284
+ defu: "^6.1.0",
285
+ drauu: "^0.3.1",
279
286
  "file-saver": "^2.0.5",
280
287
  "js-base64": "^3.7.2",
281
288
  "js-yaml": "^4.1.0",
282
- katex: "^0.16.0",
283
- mermaid: "^9.1.3",
289
+ katex: "^0.16.2",
290
+ mermaid: "^9.1.6",
284
291
  "monaco-editor": "^0.33.0",
285
292
  nanoid: "^4.0.0",
286
293
  prettier: "^2.7.1",
287
294
  recordrtc: "^5.6.2",
288
295
  resolve: "^1.22.1",
289
- unocss: "^0.45.1",
290
- "vite-plugin-windicss": "^1.8.7",
291
- vue: "^3.2.37",
292
- "vue-router": "^4.1.3",
296
+ unocss: "^0.45.20",
297
+ "vite-plugin-windicss": "^1.8.8",
298
+ vue: "^3.2.39",
299
+ "vue-router": "^4.1.5",
293
300
  "vue-starport": "^0.3.0",
294
301
  windicss: "^3.5.6"
295
302
  };
296
303
 
297
304
  // node/vite/searchRoot.ts
298
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
305
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
299
306
 
300
307
 
301
308
  var ROOT_FILES = [
@@ -341,6 +348,9 @@ function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
341
348
  var EXCLUDE = [
342
349
  "@slidev/shared",
343
350
  "@slidev/types",
351
+ "@slidev/client",
352
+ "@slidev/client/constants",
353
+ "@slidev/client/logic/dark",
344
354
  "@vueuse/core",
345
355
  "@vueuse/shared",
346
356
  "@unocss/reset",
@@ -357,7 +367,7 @@ function createConfigPlugin(options) {
357
367
  define: getDefine(options),
358
368
  resolve: {
359
369
  alias: {
360
- "@slidev/client/": `${_chunkSQLX75IOjs.toAtFS.call(void 0, options.clientRoot)}/`
370
+ "@slidev/client/": `${_chunk74QPSS6Tjs.toAtFS.call(void 0, options.clientRoot)}/`
361
371
  }
362
372
  },
363
373
  optimizeDeps: {
@@ -381,7 +391,7 @@ function createConfigPlugin(options) {
381
391
  css: options.data.config.css === "unocss" ? {
382
392
  postcss: {
383
393
  plugins: [
384
- await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "postcss-nested"))).then((r) => r.default())
394
+ await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "postcss-nested"))).then((r) => r.default())
385
395
  ]
386
396
  }
387
397
  } : {},
@@ -391,7 +401,7 @@ function createConfigPlugin(options) {
391
401
  allow: _utils.uniq.call(void 0, [
392
402
  searchForWorkspaceRoot(options.userRoot),
393
403
  searchForWorkspaceRoot(options.cliRoot),
394
- ..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkSQLX75IOjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkSQLX75IOjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
404
+ ..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunk74QPSS6Tjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
395
405
  ])
396
406
  }
397
407
  }
@@ -400,7 +410,7 @@ function createConfigPlugin(options) {
400
410
  injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
401
411
  injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
402
412
  injection.root = options.cliRoot;
403
- injection.resolve.alias.vue = `${_chunkSQLX75IOjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
413
+ injection.resolve.alias.vue = `${_chunk74QPSS6Tjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
404
414
  }
405
415
  return _vite.mergeConfig.call(void 0, config, injection);
406
416
  },
@@ -421,7 +431,7 @@ function createConfigPlugin(options) {
421
431
  }
422
432
  function getDefine(options) {
423
433
  return {
424
- __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkSQLX75IOjs.toAtFS.call(void 0, options.clientRoot)),
434
+ __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunk74QPSS6Tjs.toAtFS.call(void 0, options.clientRoot)),
425
435
  __SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
426
436
  __SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
427
437
  __SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
@@ -431,8 +441,8 @@ function getDefine(options) {
431
441
  }
432
442
 
433
443
  // node/plugins/loaders.ts
434
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
435
- var import_fast_deep_equal = _chunkSQLX75IOjs.__toESM.call(void 0, require_fast_deep_equal());
444
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
445
+ var import_fast_deep_equal = _chunk74QPSS6Tjs.__toESM.call(void 0, require_fast_deep_equal());
436
446
 
437
447
 
438
448
 
@@ -551,22 +561,25 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
551
561
  Object.assign(data, newData);
552
562
  if (hmrPages.size > 0)
553
563
  moduleIds.add("/@slidev/titles.md");
554
- const vueModules = (await Promise.all(Array.from(hmrPages).map(async (i) => {
555
- var _a2;
556
- const file = `${slidePrefix}${i + 1}.md`;
557
- try {
558
- const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
559
- return await VuePlugin.handleHotUpdate({
560
- ...ctx,
561
- modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
562
- file,
563
- read() {
564
- return md2;
565
- }
566
- });
567
- } catch (e3) {
568
- }
569
- }))).flatMap((i) => i || []);
564
+ const vueModules = (await Promise.all(
565
+ Array.from(hmrPages).map(async (i) => {
566
+ var _a2;
567
+ const file = `${slidePrefix}${i + 1}.md`;
568
+ try {
569
+ const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
570
+ const handleHotUpdate = "handler" in VuePlugin.handleHotUpdate ? VuePlugin.handleHotUpdate.handler : VuePlugin.handleHotUpdate;
571
+ return await handleHotUpdate({
572
+ ...ctx,
573
+ modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
574
+ file,
575
+ read() {
576
+ return md2;
577
+ }
578
+ });
579
+ } catch (e3) {
580
+ }
581
+ })
582
+ )).flatMap((i) => i || []);
570
583
  hmrPages.clear();
571
584
  const moduleEntries = [
572
585
  ...vueModules,
@@ -684,7 +697,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
684
697
  delete frontmatter.title;
685
698
  const imports = [
686
699
  'import { inject as vueInject } from "vue"',
687
- `import InjectedLayout from "${_chunkSQLX75IOjs.toAtFS.call(void 0, layouts[layoutName])}"`,
700
+ `import InjectedLayout from "${_chunk74QPSS6Tjs.toAtFS.call(void 0, layouts[layoutName])}"`,
688
701
  'import { injectionSlidevContext } from "@slidev/client/constants"',
689
702
  `const frontmatter = ${JSON.stringify(frontmatter)}`,
690
703
  "const $slidev = vueInject(injectionSlidevContext)"
@@ -789,9 +802,9 @@ defineProps<{ no: number | string }>()`);
789
802
  }
790
803
  async function generateUserStyles() {
791
804
  const imports = [
792
- `import "${_chunkSQLX75IOjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
793
- `import "${_chunkSQLX75IOjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
794
- `import "${_chunkSQLX75IOjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
805
+ `import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
806
+ `import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
807
+ `import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
795
808
  ];
796
809
  const roots2 = _utils.uniq.call(void 0, [
797
810
  ...themeRoots,
@@ -808,19 +821,30 @@ defineProps<{ no: number | string }>()`);
808
821
  ];
809
822
  for (const style of styles) {
810
823
  if (_fsextra.existsSync.call(void 0, style)) {
811
- imports.push(`import "${_chunkSQLX75IOjs.toAtFS.call(void 0, style)}"`);
824
+ imports.push(`import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, style)}"`);
812
825
  continue;
813
826
  }
814
827
  }
815
828
  }
816
829
  if (data.features.katex)
817
- imports.push(`import "${_chunkSQLX75IOjs.toAtFS.call(void 0, _chunkSQLX75IOjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
830
+ imports.push(`import "${_chunk74QPSS6Tjs.toAtFS.call(void 0, _chunk74QPSS6Tjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
818
831
  if (data.config.css === "unocss") {
819
- imports.unshift('import "@unocss/reset/tailwind.css"', 'import "uno:preflights.css"', 'import "uno:typography.css"', 'import "uno:shortcuts.css"');
832
+ imports.unshift(
833
+ 'import "@unocss/reset/tailwind.css"',
834
+ 'import "uno:preflights.css"',
835
+ 'import "uno:typography.css"',
836
+ 'import "uno:shortcuts.css"'
837
+ );
820
838
  imports.push('import "uno.css"');
821
839
  } else {
822
- imports.unshift('import "virtual:windi-components.css"', 'import "virtual:windi-base.css"');
823
- imports.push('import "virtual:windi-utilities.css"', 'import "virtual:windi-devtools"');
840
+ imports.unshift(
841
+ 'import "virtual:windi-components.css"',
842
+ 'import "virtual:windi-base.css"'
843
+ );
844
+ imports.push(
845
+ 'import "virtual:windi-utilities.css"',
846
+ 'import "virtual:windi-devtools"'
847
+ );
824
848
  }
825
849
  return imports.join("\n");
826
850
  }
@@ -829,10 +853,13 @@ defineProps<{ no: number | string }>()`);
829
853
  }
830
854
  async function generateLayouts() {
831
855
  const imports = [];
832
- const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
833
- imports.push(`import __layout_${k} from "${_chunkSQLX75IOjs.toAtFS.call(void 0, v)}"`);
834
- return [k, `__layout_${k}`];
835
- });
856
+ const layouts = _utils.objectMap.call(void 0,
857
+ await getLayouts(),
858
+ (k, v) => {
859
+ imports.push(`import __layout_${k} from "${_chunk74QPSS6Tjs.toAtFS.call(void 0, v)}"`);
860
+ return [k, `__layout_${k}`];
861
+ }
862
+ );
836
863
  return [
837
864
  imports.join("\n"),
838
865
  `export default {
@@ -878,7 +905,7 @@ ${routes.join(",\n")}
878
905
  const config = { ...data.config, remote };
879
906
  if (_utils.isString.call(void 0, config.title)) {
880
907
  const tokens = md.parseInline(config.title, {});
881
- config.title = _chunkSQLX75IOjs.stringifyMarkdownTokens.call(void 0, tokens);
908
+ config.title = _chunk74QPSS6Tjs.stringifyMarkdownTokens.call(void 0, tokens);
882
909
  }
883
910
  if (_utils.isString.call(void 0, config.info))
884
911
  config.info = md.render(config.info);
@@ -899,7 +926,7 @@ ${routes.join(",\n")}
899
926
  ];
900
927
  }
901
928
  }).filter((i) => _fsextra2.default.existsSync(i));
902
- const imports = components.map((i, idx) => `import __n${idx} from '${_chunkSQLX75IOjs.toAtFS.call(void 0, i)}'`).join("\n");
929
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunk74QPSS6Tjs.toAtFS.call(void 0, i)}'`).join("\n");
903
930
  const render = components.map((i, idx) => `h(__n${idx})`).join(",");
904
931
  return `
905
932
  ${imports}
@@ -918,7 +945,7 @@ export default {
918
945
  _path.join.call(void 0, root, "CustomNavControls.vue")
919
946
  ];
920
947
  }).filter((i) => _fsextra2.default.existsSync(i));
921
- const imports = components.map((i, idx) => `import __n${idx} from '${_chunkSQLX75IOjs.toAtFS.call(void 0, i)}'`).join("\n");
948
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunk74QPSS6Tjs.toAtFS.call(void 0, i)}'`).join("\n");
922
949
  const render = components.map((i, idx) => `h(__n${idx})`).join(",");
923
950
  return `
924
951
  ${imports}
@@ -933,7 +960,7 @@ export default {
933
960
  }
934
961
 
935
962
  // node/plugins/monacoTransform.ts
936
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
963
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
937
964
 
938
965
 
939
966
 
@@ -967,7 +994,7 @@ function createMonacoTypesLoader() {
967
994
  }
968
995
 
969
996
  // node/plugins/setupClient.ts
970
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
997
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
971
998
 
972
999
 
973
1000
 
@@ -978,10 +1005,13 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
978
1005
  enforce: "pre",
979
1006
  async transform(code, id) {
980
1007
  if (id.startsWith(setupEntry)) {
1008
+ let getInjections2 = function(isAwait = false, isChained = false) {
1009
+ return injections.join("\n").replace(/:AWAIT:/g, isAwait ? "await " : "").replace(/(,\s*)?:LAST:/g, isChained ? "$1injection_return" : "");
1010
+ };
1011
+ var getInjections = getInjections2;
981
1012
  const name = id.slice(setupEntry.length + 1);
982
1013
  const imports = [];
983
1014
  const injections = [];
984
- const asyncInjections = [];
985
1015
  const setups = _utils.uniq.call(void 0, [
986
1016
  ...themeRoots,
987
1017
  ...addonRoots,
@@ -990,36 +1020,29 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
990
1020
  setups.forEach((path, idx) => {
991
1021
  if (!_fs.existsSync.call(void 0, path))
992
1022
  return;
993
- imports.push(`import __n${idx} from '${_chunkSQLX75IOjs.toAtFS.call(void 0, path)}'`);
994
- let fn = `__n${idx}`;
995
- let awaitFn = `await __n${idx}`;
996
- if (/\binjection_return\b/g.test(code)) {
1023
+ imports.push(`import __n${idx} from '${_chunk74QPSS6Tjs.toAtFS.call(void 0, path)}'`);
1024
+ let fn = `:AWAIT:__n${idx}`;
1025
+ if (/\binjection_return\b/g.test(code))
997
1026
  fn = `injection_return = ${fn}`;
998
- awaitFn = `injection_return = ${awaitFn}`;
999
- }
1000
1027
  if (/\binjection_arg\b/g.test(code)) {
1001
1028
  fn += "(";
1002
- awaitFn += "(";
1003
1029
  const matches = Array.from(code.matchAll(/\binjection_arg(_\d+)?\b/g));
1004
1030
  const dedupedMatches = Array.from(new Set(matches.map((m) => m[0])));
1005
- dedupedMatches.forEach((key, index) => {
1006
- const isLast = index === dedupedMatches.length - 1;
1007
- const arg = key + (isLast ? "" : ",");
1008
- fn += arg;
1009
- awaitFn += arg;
1010
- });
1011
- fn += ")";
1012
- awaitFn += ")";
1031
+ fn += dedupedMatches.join(", ");
1032
+ fn += ", :LAST:)";
1013
1033
  } else {
1014
- fn += "()";
1015
- awaitFn += "()";
1034
+ fn += "(:LAST:)";
1016
1035
  }
1017
- injections.push(`// ${path}`, fn);
1018
- asyncInjections.push(`// ${path}`, awaitFn);
1036
+ injections.push(
1037
+ `// ${path}`,
1038
+ fn
1039
+ );
1019
1040
  });
1020
1041
  code = code.replace("/* __imports__ */", imports.join("\n"));
1021
- code = code.replace("/* __injections__ */", injections.join("\n"));
1022
- code = code.replace("/* __async_injections__ */", asyncInjections.join("\n"));
1042
+ code = code.replace("/* __injections__ */", getInjections2());
1043
+ code = code.replace("/* __async_injections__ */", getInjections2(true));
1044
+ code = code.replace("/* __chained_injections__ */", getInjections2(false, true));
1045
+ code = code.replace("/* __chained_async_injections__ */", getInjections2(true, true));
1023
1046
  return code;
1024
1047
  }
1025
1048
  return null;
@@ -1028,7 +1051,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
1028
1051
  }
1029
1052
 
1030
1053
  // node/plugins/markdown.ts
1031
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1054
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
1032
1055
  var _vitepluginvuemarkdown = require('vite-plugin-vue-markdown'); var _vitepluginvuemarkdown2 = _interopRequireDefault(_vitepluginvuemarkdown);
1033
1056
  var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
1034
1057
 
@@ -1039,7 +1062,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
1039
1062
  var _plantumlencoder = require('plantuml-encoder');
1040
1063
 
1041
1064
  // node/plugins/markdown-it-katex.ts
1042
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1065
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
1043
1066
  var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
1044
1067
  function isValidDelim(state, pos) {
1045
1068
  const max = state.posMax;
@@ -1186,7 +1209,7 @@ function math_plugin(md2, options) {
1186
1209
  }
1187
1210
 
1188
1211
  // node/plugins/markdown-it-prism.ts
1189
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1212
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
1190
1213
  var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
1191
1214
  var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
1192
1215
  var DEFAULTS = {
@@ -1209,7 +1232,7 @@ function loadPrismLang(lang) {
1209
1232
  }
1210
1233
  function loadPrismPlugin(name) {
1211
1234
  try {
1212
- _chunkSQLX75IOjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1235
+ _chunk74QPSS6Tjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1213
1236
  } catch (e) {
1214
1237
  throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
1215
1238
  }
@@ -1249,7 +1272,7 @@ function markdownItPrism(markdownit, useroptions) {
1249
1272
  }
1250
1273
 
1251
1274
  // node/plugins/markdown-it-shiki.ts
1252
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1275
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
1253
1276
  function getThemeName(theme) {
1254
1277
  if (typeof theme === "string")
1255
1278
  return theme;
@@ -1293,7 +1316,9 @@ var MarkdownItShiki = (markdownit, options = {}) => {
1293
1316
  const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki"', '<pre class="slidev-code shiki shiki-light"');
1294
1317
  return escapeVueInCode(`<pre class="shiki-container">${dark}${light}</pre>`);
1295
1318
  } else {
1296
- return escapeVueInCode(_highlighter.codeToHtml(code, { lang: lang || "text" }).replace('<pre class="shiki"', '<pre class="slidev-code shiki"'));
1319
+ return escapeVueInCode(
1320
+ _highlighter.codeToHtml(code, { lang: lang || "text" }).replace('<pre class="shiki"', '<pre class="slidev-code shiki"')
1321
+ );
1297
1322
  }
1298
1323
  };
1299
1324
  };
@@ -1310,7 +1335,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1310
1335
  const setups = [];
1311
1336
  const entryPath = _utils.slash.call(void 0, entry);
1312
1337
  if (config.highlighter === "shiki") {
1313
- const { getHighlighter } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "shiki")));
1338
+ const { getHighlighter } = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "shiki")));
1314
1339
  const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
1315
1340
  const { langs, themes } = resolveShikiOptions(shikiOptions);
1316
1341
  shikiOptions.highlighter = await getHighlighter({ themes, langs });
@@ -1431,14 +1456,17 @@ function transformPageCSS(md2, id) {
1431
1456
  if (!page)
1432
1457
  return md2;
1433
1458
  const { isInsideCodeblocks } = getCodeBlocks(md2);
1434
- const result = md2.replace(/(\n<style[^>]*?>)([\s\S]+?)(<\/style>)/g, (full, start, css, end, index) => {
1435
- if (index < 0 || isInsideCodeblocks(index))
1436
- return full;
1437
- if (!start.includes("scoped"))
1438
- start = start.replace("<style", "<style scoped");
1439
- return `${start}
1459
+ const result = md2.replace(
1460
+ /(\n<style[^>]*?>)([\s\S]+?)(<\/style>)/g,
1461
+ (full, start, css, end, index) => {
1462
+ if (index < 0 || isInsideCodeblocks(index))
1463
+ return full;
1464
+ if (!start.includes("scoped"))
1465
+ start = start.replace("<style", "<style scoped");
1466
+ return `${start}
1440
1467
  ${css}${end}`;
1441
- });
1468
+ }
1469
+ );
1442
1470
  return result;
1443
1471
  }
1444
1472
  function transformMermaid(md2) {
@@ -1461,7 +1489,7 @@ function escapeVueInCode(md2) {
1461
1489
  }
1462
1490
 
1463
1491
  // node/plugins/patchTransform.ts
1464
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1492
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
1465
1493
 
1466
1494
  function createFixPlugins(options) {
1467
1495
  const define = _utils.objectEntries.call(void 0, getDefine(options));
@@ -1482,14 +1510,14 @@ function createFixPlugins(options) {
1482
1510
  }
1483
1511
 
1484
1512
  // node/plugins/unocss.ts
1485
- _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1513
+ _chunk74QPSS6Tjs.init_cjs_shims.call(void 0, );
1486
1514
 
1487
1515
 
1488
1516
 
1489
1517
 
1490
1518
  async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data }, { unocss: unoOptions }) {
1491
1519
  var _a, _b, _c, _d;
1492
- const UnoCSS = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "unocss/vite"))).then((r) => r.default);
1520
+ const UnoCSS = await Promise.resolve().then(() => _chunk74QPSS6Tjs.__toESM.call(void 0, _chunk74QPSS6Tjs.__require.call(void 0, "unocss/vite"))).then((r) => r.default);
1493
1521
  const configFiles = _utils.uniq.call(void 0, [
1494
1522
  ...themeRoots.map((i) => `${i}/uno.config.ts`),
1495
1523
  ...addonRoots.map((i) => `${i}/uno.config.ts`),